Completed
Push — develop ( 7c1bda...edae1e )
by Adam
18:38 queued 03:14
created
modules/ModuleBuilder/parsers/ParserFactory.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
     public static function getParser ( $view , $moduleName , $packageName = null , $subpanelName = null )
59 59
     {
60 60
         $GLOBALS [ 'log' ]->info ( "ParserFactory->getParser($view,$moduleName,$packageName,$subpanelName )" ) ;
61
-		$sm = null;
61
+        $sm = null;
62 62
         $lView = strtolower ( $view );
63 63
         if ( empty ( $packageName ) || ( $packageName == 'studio' ) )
64 64
         {
Please login to merge, or discard this patch.
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 }
44 44
 
45 45
 
46
-require_once 'modules/ModuleBuilder/parsers/constants.php' ;
46
+require_once 'modules/ModuleBuilder/parsers/constants.php';
47 47
 
48 48
 class ParserFactory
49 49
 {
@@ -57,20 +57,20 @@  discard block
 block discarded – undo
57 57
      * @return AbstractMetaDataParser
58 58
      */
59 59
 
60
-    public static function getParser ( $view , $moduleName , $packageName = null , $subpanelName = null )
60
+    public static function getParser($view, $moduleName, $packageName = null, $subpanelName = null)
61 61
     {
62
-        $GLOBALS [ 'log' ]->info ( "ParserFactory->getParser($view,$moduleName,$packageName,$subpanelName )" ) ;
62
+        $GLOBALS ['log']->info("ParserFactory->getParser($view,$moduleName,$packageName,$subpanelName )");
63 63
 		$sm = null;
64
-        $lView = strtolower ( $view );
65
-        if ( empty ( $packageName ) || ( $packageName == 'studio' ) )
64
+        $lView = strtolower($view);
65
+        if (empty ($packageName) || ($packageName == 'studio'))
66 66
         {
67
-            $packageName = null ;
67
+            $packageName = null;
68 68
             //For studio modules, check for view parser overrides
69 69
             $parser = self::checkForStudioParserOverride($view, $moduleName, $packageName);
70 70
             if ($parser) return $parser;
71 71
             $sm = StudioModuleFactory::getStudioModule($moduleName);
72 72
             //If we didn't find a specofic parser, see if there is a view to type mapping
73
-            foreach($sm->sources as $file => $def)
73
+            foreach ($sm->sources as $file => $def)
74 74
             {
75 75
                 if (!empty($def['view']) && $def['view'] == $view && !empty($def['type']))
76 76
                 {
@@ -80,41 +80,41 @@  discard block
 block discarded – undo
80 80
             }
81 81
         }
82 82
 
83
-        switch ( $lView)
83
+        switch ($lView)
84 84
         {
85 85
             case MB_EDITVIEW :
86 86
             case MB_DETAILVIEW :
87 87
             case MB_QUICKCREATE :
88
-                require_once 'modules/ModuleBuilder/parsers/views/GridLayoutMetaDataParser.php' ;
89
-                return new GridLayoutMetaDataParser ( $view, $moduleName, $packageName ) ;
88
+                require_once 'modules/ModuleBuilder/parsers/views/GridLayoutMetaDataParser.php';
89
+                return new GridLayoutMetaDataParser($view, $moduleName, $packageName);
90 90
             case MB_BASICSEARCH :
91 91
             case MB_ADVANCEDSEARCH :
92
-                require_once 'modules/ModuleBuilder/parsers/views/SearchViewMetaDataParser.php' ;
93
-                return new SearchViewMetaDataParser ( $view, $moduleName, $packageName ) ;
92
+                require_once 'modules/ModuleBuilder/parsers/views/SearchViewMetaDataParser.php';
93
+                return new SearchViewMetaDataParser($view, $moduleName, $packageName);
94 94
             case MB_LISTVIEW :
95 95
                 if ($subpanelName == null)
96 96
                 {
97
-                    require_once 'modules/ModuleBuilder/parsers/views/ListLayoutMetaDataParser.php' ;
98
-                    return new ListLayoutMetaDataParser ( MB_LISTVIEW, $moduleName, $packageName ) ;
97
+                    require_once 'modules/ModuleBuilder/parsers/views/ListLayoutMetaDataParser.php';
98
+                    return new ListLayoutMetaDataParser(MB_LISTVIEW, $moduleName, $packageName);
99 99
                 } else
100 100
                 {
101
-                    require_once 'modules/ModuleBuilder/parsers/views/SubpanelMetaDataParser.php' ;
102
-                    return new SubpanelMetaDataParser ( $subpanelName, $moduleName, $packageName ) ;
101
+                    require_once 'modules/ModuleBuilder/parsers/views/SubpanelMetaDataParser.php';
102
+                    return new SubpanelMetaDataParser($subpanelName, $moduleName, $packageName);
103 103
                 }
104 104
             case MB_DASHLET :
105 105
             case MB_DASHLETSEARCH :
106
-                require_once 'modules/ModuleBuilder/parsers/views/DashletMetaDataParser.php' ;
107
-                return new DashletMetaDataParser($view, $moduleName, $packageName  );
106
+                require_once 'modules/ModuleBuilder/parsers/views/DashletMetaDataParser.php';
107
+                return new DashletMetaDataParser($view, $moduleName, $packageName);
108 108
             case MB_POPUPLIST :
109 109
             case MB_POPUPSEARCH :
110
-                require_once 'modules/ModuleBuilder/parsers/views/PopupMetaDataParser.php' ;
111
-                return new PopupMetaDataParser($view, $moduleName, $packageName  );
110
+                require_once 'modules/ModuleBuilder/parsers/views/PopupMetaDataParser.php';
111
+                return new PopupMetaDataParser($view, $moduleName, $packageName);
112 112
             case MB_LABEL :
113
-                require_once 'modules/ModuleBuilder/parsers/parser.label.php' ;
114
-                return new ParserLabel ( $moduleName, $packageName ) ;
113
+                require_once 'modules/ModuleBuilder/parsers/parser.label.php';
114
+                return new ParserLabel($moduleName, $packageName);
115 115
             case MB_VISIBILITY :
116
-                require_once 'modules/ModuleBuilder/parsers/parser.visibility.php' ;
117
-                return new ParserVisibility ( $moduleName, $packageName ) ;
116
+                require_once 'modules/ModuleBuilder/parsers/parser.visibility.php';
117
+                return new ParserVisibility($moduleName, $packageName);
118 118
             default :
119 119
                 $parser = self::checkForParserClass($view, $moduleName, $packageName);
120 120
                 if ($parser)
@@ -122,33 +122,33 @@  discard block
 block discarded – undo
122 122
 
123 123
         }
124 124
 
125
-        $GLOBALS [ 'log' ]->fatal ("ParserFactory: cannot create ModuleBuilder Parser $view" ) ;
125
+        $GLOBALS ['log']->fatal("ParserFactory: cannot create ModuleBuilder Parser $view");
126 126
 
127 127
     }
128 128
 
129 129
     protected static function checkForParserClass($view, $moduleName, $packageName, $nameOverride = false)
130 130
     {
131 131
         $prefix = '';
132
-        if(!is_null ( $packageName )){
133
-            $prefix = empty($packageName) ? 'build' :'modify';
132
+        if (!is_null($packageName)) {
133
+            $prefix = empty($packageName) ? 'build' : 'modify';
134 134
         }
135 135
         $fileNames = array(
136
-            "custom/modules/$moduleName/parsers/parser." . strtolower ( $prefix . $view ) . ".php",
137
-            "modules/$moduleName/parsers/parser." . strtolower ( $prefix . $view ) . ".php",
138
-            "custom/modules/ModuleBuilder/parsers/parser." . strtolower ( $prefix . $view ) . ".php",
139
-            "modules/ModuleBuilder/parsers/parser." . strtolower ( $prefix . $view ) . ".php",
136
+            "custom/modules/$moduleName/parsers/parser.".strtolower($prefix.$view).".php",
137
+            "modules/$moduleName/parsers/parser.".strtolower($prefix.$view).".php",
138
+            "custom/modules/ModuleBuilder/parsers/parser.".strtolower($prefix.$view).".php",
139
+            "modules/ModuleBuilder/parsers/parser.".strtolower($prefix.$view).".php",
140 140
         );
141
-        foreach($fileNames as $fileName)
141
+        foreach ($fileNames as $fileName)
142 142
         {
143
-            if (file_exists ( $fileName ))
143
+            if (file_exists($fileName))
144 144
             {
145
-                require_once $fileName ;
146
-                $class = 'Parser' . $prefix . ucfirst ( $view ) ;
147
-                if (class_exists ( $class ))
145
+                require_once $fileName;
146
+                $class = 'Parser'.$prefix.ucfirst($view);
147
+                if (class_exists($class))
148 148
                 {
149
-                    $GLOBALS [ 'log' ]->debug ( 'Using ModuleBuilder Parser ' . $fileName ) ;
150
-                    $parser = new $class ( ) ;
151
-                    return $parser ;
149
+                    $GLOBALS ['log']->debug('Using ModuleBuilder Parser '.$fileName);
150
+                    $parser = new $class( );
151
+                    return $parser;
152 152
                 }
153 153
             }
154 154
         }
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
     {
166 166
         require_once('modules/ModuleBuilder/Module/StudioModuleFactory.php');
167 167
         $sm = StudioModuleFactory::getStudioModule($moduleName);
168
-        foreach($sm->sources as $file => $def)
168
+        foreach ($sm->sources as $file => $def)
169 169
         {
170 170
             if (!empty($def['view']) && $def['view'] == strtolower($view) && !empty($def['parser']))
171 171
             {
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
                     require_once("custom/$path");
176 176
                 else if (file_exists($path))
177 177
                     require_once($path);
178
-                if (class_exists ( $pName ))
178
+                if (class_exists($pName))
179 179
                     return new $pName($view, $moduleName, $packageName);
180 180
                 //If it wasn't defined directly, check for a generic parser name for the view
181 181
                 $parser = self::checkForParserClass($view, $moduleName, $packageName);
Please login to merge, or discard this patch.
Braces   +17 added lines, -11 removed lines patch added patch discarded remove patch
@@ -67,7 +67,9 @@  discard block
 block discarded – undo
67 67
             $packageName = null ;
68 68
             //For studio modules, check for view parser overrides
69 69
             $parser = self::checkForStudioParserOverride($view, $moduleName, $packageName);
70
-            if ($parser) return $parser;
70
+            if ($parser) {
71
+                return $parser;
72
+            }
71 73
             $sm = StudioModuleFactory::getStudioModule($moduleName);
72 74
             //If we didn't find a specofic parser, see if there is a view to type mapping
73 75
             foreach($sm->sources as $file => $def)
@@ -117,8 +119,9 @@  discard block
 block discarded – undo
117 119
                 return new ParserVisibility ( $moduleName, $packageName ) ;
118 120
             default :
119 121
                 $parser = self::checkForParserClass($view, $moduleName, $packageName);
120
-                if ($parser)
121
-                    return $parser;
122
+                if ($parser) {
123
+                                    return $parser;
124
+                }
122 125
 
123 126
         }
124 127
 
@@ -171,16 +174,19 @@  discard block
 block discarded – undo
171 174
             {
172 175
                 $pName = $def['parser'];
173 176
                 $path = "modules/ModuleBuilder/parsers/views/{$pName}.php";
174
-                if (file_exists("custom/$path"))
175
-                    require_once("custom/$path");
176
-                else if (file_exists($path))
177
-                    require_once($path);
178
-                if (class_exists ( $pName ))
179
-                    return new $pName($view, $moduleName, $packageName);
177
+                if (file_exists("custom/$path")) {
178
+                                    require_once("custom/$path");
179
+                } else if (file_exists($path)) {
180
+                                    require_once($path);
181
+                }
182
+                if (class_exists ( $pName )) {
183
+                                    return new $pName($view, $moduleName, $packageName);
184
+                }
180 185
                 //If it wasn't defined directly, check for a generic parser name for the view
181 186
                 $parser = self::checkForParserClass($view, $moduleName, $packageName);
182
-                if ($parser)
183
-                    return $parser;
187
+                if ($parser) {
188
+                                    return $parser;
189
+                }
184 190
             }
185 191
         }
186 192
         return false;
Please login to merge, or discard this patch.
modules/ModuleBuilder/parsers/parser.modifylistview.php 3 patches
Indentation   +262 added lines, -262 removed lines patch added patch discarded remove patch
@@ -43,144 +43,144 @@  discard block
 block discarded – undo
43 43
 require_once ('modules/ModuleBuilder/parsers/ModuleBuilderParser.php') ;
44 44
 class ParserModifyListView extends ModuleBuilderParser
45 45
 {
46
-	var $listViewDefs = false ;
47
-	var $defaults = array ( ) ;
48
-	var $additional = array ( ) ;
49
-	var $available = array ( ) ;
50
-	var $reserved = array(); // fields marked by 'studio'=>false in the listviewdefs; need to be preserved
51
-	//	var $language_module = '';
52
-	var $columns = array ( 'LBL_DEFAULT' => 'getDefaultFields' , 'LBL_AVAILABLE' => 'getAdditionalFields' , 'LBL_HIDDEN' => 'getAvailableFields' ) ;
53
-	function init ( $module_name , $submodule = '' )
54
-	{
55
-		global $app_list_strings ;
56
-		$this->module_name = $module_name ;
57
-		$mod_strings = return_module_language ( $GLOBALS [ 'current_language' ], $this->module_name ) ; // needed solely so that listviewdefs that reference this can be included without error
58
-		$class = $GLOBALS [ 'beanList' ] [ $this->module_name ] ;
59
-		require_once ($GLOBALS [ 'beanFiles' ] [ $class ]) ;
60
-		$this->module = new $class ( ) ;
46
+    var $listViewDefs = false ;
47
+    var $defaults = array ( ) ;
48
+    var $additional = array ( ) ;
49
+    var $available = array ( ) ;
50
+    var $reserved = array(); // fields marked by 'studio'=>false in the listviewdefs; need to be preserved
51
+    //	var $language_module = '';
52
+    var $columns = array ( 'LBL_DEFAULT' => 'getDefaultFields' , 'LBL_AVAILABLE' => 'getAdditionalFields' , 'LBL_HIDDEN' => 'getAvailableFields' ) ;
53
+    function init ( $module_name , $submodule = '' )
54
+    {
55
+        global $app_list_strings ;
56
+        $this->module_name = $module_name ;
57
+        $mod_strings = return_module_language ( $GLOBALS [ 'current_language' ], $this->module_name ) ; // needed solely so that listviewdefs that reference this can be included without error
58
+        $class = $GLOBALS [ 'beanList' ] [ $this->module_name ] ;
59
+        require_once ($GLOBALS [ 'beanFiles' ] [ $class ]) ;
60
+        $this->module = new $class ( ) ;
61 61
 
62
-		$loaded = $this->_loadFromFile('ListView','modules/' . $this->module_name . '/metadata/listviewdefs.php',$this->module_name);
63
-		$this->originalListViewDefs = $loaded['viewdefs'] [ $this->module_name ] ;
64
-		$this->_variables = $loaded['variables'];
65
-		//		_pp($loaded);
66
-		$this->customFile = 'custom/modules/' . $this->module_name . '/metadata/listviewdefs.php' ;
67
-		if (file_exists ( $this->customFile ))
68
-		{
69
-			$loaded = $this->_loadFromFile('ListView',$this->customFile,$this->module_name);
70
-			$this->listViewDefs = $loaded['viewdefs'] [ $this->module_name ] ;
71
-			$this->_variables = $loaded['variables'];
72
-		} else
73
-		{
74
-			$this->listViewDefs = & $this->originalListViewDefs ;
75
-		}
62
+        $loaded = $this->_loadFromFile('ListView','modules/' . $this->module_name . '/metadata/listviewdefs.php',$this->module_name);
63
+        $this->originalListViewDefs = $loaded['viewdefs'] [ $this->module_name ] ;
64
+        $this->_variables = $loaded['variables'];
65
+        //		_pp($loaded);
66
+        $this->customFile = 'custom/modules/' . $this->module_name . '/metadata/listviewdefs.php' ;
67
+        if (file_exists ( $this->customFile ))
68
+        {
69
+            $loaded = $this->_loadFromFile('ListView',$this->customFile,$this->module_name);
70
+            $this->listViewDefs = $loaded['viewdefs'] [ $this->module_name ] ;
71
+            $this->_variables = $loaded['variables'];
72
+        } else
73
+        {
74
+            $this->listViewDefs = & $this->originalListViewDefs ;
75
+        }
76 76
 
77
-		$this->fixKeys ( $this->originalListViewDefs ) ;
78
-		$this->fixKeys ( $this->listViewDefs ) ;
79
-		$this->language_module = $this->module_name ;
80
-	}
77
+        $this->fixKeys ( $this->originalListViewDefs ) ;
78
+        $this->fixKeys ( $this->listViewDefs ) ;
79
+        $this->language_module = $this->module_name ;
80
+    }
81 81
 	
82
-	function getLanguage()
83
-	{
84
-	    return $this->language_module;
85
-	}
86
-	// re-key array so that every entry has a key=name and all keys are lowercase - makes it easier in handleSave() later...
87
-	function fixKeys ( &$defs )
88
-	{
89
-		$temp = array ( ) ;
90
-		foreach ( $defs as $key => $value )
91
-		{
92
-			if (! is_array ( $value ))
93
-			{
94
-				$key = $value ;
95
-				$def = array ( ) ;
96
-				$def [ 'name' ] = (isset ( $this->module->field_defs [ $key ] )) ? $this->module->field_defs [ $key ] [ 'name' ] : $key ;
97
-				$value = $def ;
98
-			}
99
-			if (isset ( $value [ 'name' ] ))
100
-			{
101
-				$key = $value [ 'name' ] ; // override key with name, needed when the entry lacks a key
102
-			}
103
-			$temp [ strtolower ( $key ) ] = $value ;
104
-		}
105
-		$defs = $temp ;
106
-	}
82
+    function getLanguage()
83
+    {
84
+        return $this->language_module;
85
+    }
86
+    // re-key array so that every entry has a key=name and all keys are lowercase - makes it easier in handleSave() later...
87
+    function fixKeys ( &$defs )
88
+    {
89
+        $temp = array ( ) ;
90
+        foreach ( $defs as $key => $value )
91
+        {
92
+            if (! is_array ( $value ))
93
+            {
94
+                $key = $value ;
95
+                $def = array ( ) ;
96
+                $def [ 'name' ] = (isset ( $this->module->field_defs [ $key ] )) ? $this->module->field_defs [ $key ] [ 'name' ] : $key ;
97
+                $value = $def ;
98
+            }
99
+            if (isset ( $value [ 'name' ] ))
100
+            {
101
+                $key = $value [ 'name' ] ; // override key with name, needed when the entry lacks a key
102
+            }
103
+            $temp [ strtolower ( $key ) ] = $value ;
104
+        }
105
+        $defs = $temp ;
106
+    }
107 107
 	
108
-	/**
109
-	 * returns the default fields for a listview
110
-	 * Called only when displaying the listview for editing; not called when saving
111
-	 */
112
-	function getDefaultFields ()
113
-	{
114
-		$this->defaults = array ( ) ;
115
-		foreach ( $this->listViewDefs as $key => $def )
116
-		{
117
-		    // add in the default fields from the listviewdefs, stripping out any field with 'studio' set to a value other than true
118
-		    // Important: the 'studio' fields must be added back into the layout on save, as they're not editable rather than hidden
119
-			if (! empty ( $def [ 'default' ] ))
120
-			{
121
-			    if (! isset($def['studio']) || $def['studio'] === true)
122
-			    {
123
-			        $this->defaults [ $key ] = $def ;
124
-			    }
125
-			    else
126
-			    // anything which doesn't go into the defaults is a reserved field - this makes sure we don't miss anything
127
-			    {
128
-			        $this->reserved [ $key ] = $def;
129
-			    }
130
-			}
131
-		}
132
-		return $this->defaults ;
133
-	}
134
-	/**
135
-	 * returns additional fields available for users to create fields
136
-	 */
137
-	function getAdditionalFields ()
138
-	{
139
-		$this->additional = array ( ) ;
140
-		foreach ( $this->listViewDefs as $key => $def )
141
-		{
142
-			if (empty ( $def [ 'default' ] ))
143
-			{
144
-				$key = strtolower ( $key ) ;
145
-				$this->additional [ $key ] = $def ;
146
-			}
147
-		}
148
-		return $this->additional ;
149
-	}
150
-	/**
151
-	 * returns unused fields that are available for using in either default or additional list views
152
-	 */
153
-	function getAvailableFields ()
154
-	{
155
-		$this->availableFields = array ( ) ;
156
-		$lowerFieldList = array_change_key_case ( $this->listViewDefs ) ;
157
-		foreach ( $this->originalListViewDefs as $key => $def )
158
-		{
159
-			$key = strtolower ( $key ) ;
160
-			if (! isset ( $lowerFieldList [ $key ] ))
161
-			{
162
-				$this->availableFields [ $key ] = $def ;
163
-			}
164
-		}
165
-		$GLOBALS['log']->debug('parser.modifylistview.php->getAvailableFields(): field_defs='.print_r($this->availableFields,true));
166
-		$modFields = !empty($this->module->field_name_map) ? $this->module->field_name_map : $this->module->field_defs;
167
-		foreach ( $modFields as $key => $def )
168
-		{
169
-			$fieldName = strtolower ( $key ) ;
108
+    /**
109
+     * returns the default fields for a listview
110
+     * Called only when displaying the listview for editing; not called when saving
111
+     */
112
+    function getDefaultFields ()
113
+    {
114
+        $this->defaults = array ( ) ;
115
+        foreach ( $this->listViewDefs as $key => $def )
116
+        {
117
+            // add in the default fields from the listviewdefs, stripping out any field with 'studio' set to a value other than true
118
+            // Important: the 'studio' fields must be added back into the layout on save, as they're not editable rather than hidden
119
+            if (! empty ( $def [ 'default' ] ))
120
+            {
121
+                if (! isset($def['studio']) || $def['studio'] === true)
122
+                {
123
+                    $this->defaults [ $key ] = $def ;
124
+                }
125
+                else
126
+                // anything which doesn't go into the defaults is a reserved field - this makes sure we don't miss anything
127
+                {
128
+                    $this->reserved [ $key ] = $def;
129
+                }
130
+            }
131
+        }
132
+        return $this->defaults ;
133
+    }
134
+    /**
135
+     * returns additional fields available for users to create fields
136
+     */
137
+    function getAdditionalFields ()
138
+    {
139
+        $this->additional = array ( ) ;
140
+        foreach ( $this->listViewDefs as $key => $def )
141
+        {
142
+            if (empty ( $def [ 'default' ] ))
143
+            {
144
+                $key = strtolower ( $key ) ;
145
+                $this->additional [ $key ] = $def ;
146
+            }
147
+        }
148
+        return $this->additional ;
149
+    }
150
+    /**
151
+     * returns unused fields that are available for using in either default or additional list views
152
+     */
153
+    function getAvailableFields ()
154
+    {
155
+        $this->availableFields = array ( ) ;
156
+        $lowerFieldList = array_change_key_case ( $this->listViewDefs ) ;
157
+        foreach ( $this->originalListViewDefs as $key => $def )
158
+        {
159
+            $key = strtolower ( $key ) ;
160
+            if (! isset ( $lowerFieldList [ $key ] ))
161
+            {
162
+                $this->availableFields [ $key ] = $def ;
163
+            }
164
+        }
165
+        $GLOBALS['log']->debug('parser.modifylistview.php->getAvailableFields(): field_defs='.print_r($this->availableFields,true));
166
+        $modFields = !empty($this->module->field_name_map) ? $this->module->field_name_map : $this->module->field_defs;
167
+        foreach ( $modFields as $key => $def )
168
+        {
169
+            $fieldName = strtolower ( $key ) ;
170 170
             if ($fieldName == 'currency_id')
171 171
                 continue;
172
-			if (!isset ( $lowerFieldList [ $fieldName ] )) // bug 16728 - check this first, so that other conditions (e.g., studio == visible) can't override and add duplicate entries
173
-			{
172
+            if (!isset ( $lowerFieldList [ $fieldName ] )) // bug 16728 - check this first, so that other conditions (e.g., studio == visible) can't override and add duplicate entries
173
+            {
174 174
             // bug 19656: this test changed after 5.0.0b - we now remove all ID type fields - whether set as type, or dbtype, from the fielddefs
175 175
             if ($this->isValidField($key, $def)){
176
-					$label = (isset ( $def [ 'vname' ] )) ? $def [ 'vname' ] : (isset($def [ 'label' ]) ? $def['label'] : $def['name']) ;
177
-					$this->availableFields [ $fieldName ] = array ( 'width' => '10' , 'label' => $label ) ;
178
-				}
179
-			}
180
-		}
176
+                    $label = (isset ( $def [ 'vname' ] )) ? $def [ 'vname' ] : (isset($def [ 'label' ]) ? $def['label'] : $def['name']) ;
177
+                    $this->availableFields [ $fieldName ] = array ( 'width' => '10' , 'label' => $label ) ;
178
+                }
179
+            }
180
+        }
181 181
 
182
-		return $this->availableFields ;
183
-	}
182
+        return $this->availableFields ;
183
+    }
184 184
 
185 185
     function getFieldDefs()
186 186
     {
@@ -188,146 +188,146 @@  discard block
 block discarded – undo
188 188
     }
189 189
 
190 190
 	
191
-	function isValidField($key, $def) {
192
-	    //Allow fields that are studio visible  
193
-		if (! empty ( $def [ 'studio' ] ) && $def [ 'studio' ] == 'visible')
194
-		  return true;
191
+    function isValidField($key, $def) {
192
+        //Allow fields that are studio visible  
193
+        if (! empty ( $def [ 'studio' ] ) && $def [ 'studio' ] == 'visible')
194
+            return true;
195 195
 		  
196
-		//No ID fields
197
-		if  ((!empty ( $def [ 'dbType' ] ) && $def [ 'dbType' ] == 'id') || (!empty ( $def [ 'type' ] ) && $def [ 'type' ] == 'id'))
198
-		  return false;
196
+        //No ID fields
197
+        if  ((!empty ( $def [ 'dbType' ] ) && $def [ 'dbType' ] == 'id') || (!empty ( $def [ 'type' ] ) && $def [ 'type' ] == 'id'))
198
+            return false;
199 199
 		  
200
-		//only allow DB and custom fields (if a source is specified)
201
-	    if (!empty($def [ 'source' ]) && $def [ 'source' ] != 'db' && $def [ 'source' ] != 'custom_fields')
202
-		  return false;
200
+        //only allow DB and custom fields (if a source is specified)
201
+        if (!empty($def [ 'source' ]) && $def [ 'source' ] != 'db' && $def [ 'source' ] != 'custom_fields')
202
+            return false;
203 203
 
204
-		//Dont ever show the "deleted" fields or "_name" fields
205
-		if (strcmp ( $key, 'deleted' ) == 0 || (isset ( $def [ 'name' ] ) && strpos ( $def [ 'name' ], "_name" ) !== false))
206
-	       return false;
204
+        //Dont ever show the "deleted" fields or "_name" fields
205
+        if (strcmp ( $key, 'deleted' ) == 0 || (isset ( $def [ 'name' ] ) && strpos ( $def [ 'name' ], "_name" ) !== false))
206
+            return false;
207 207
 
208
-	    //If none of the "ifs" are true, the field is valid
209
-	    return true;
210
-	}
208
+        //If none of the "ifs" are true, the field is valid
209
+        return true;
210
+    }
211 211
 	
212 212
 	
213
-	function getField ( $fieldName )
214
-	{
215
-		$fieldName = strtolower ( $fieldName ) ;
216
-		foreach ( $this->listViewDefs as $key => $def )
217
-		{
218
-			$key = strtolower ( $key ) ;
219
-			if ($key == $fieldName)
220
-			{
221
-				return $def ;
222
-			}
223
-		}
224
-		foreach ( $this->module->field_defs as $key => $def )
225
-		{
226
-			$key = strtolower ( $key ) ;
227
-			if ($key == $fieldName)
228
-			{
229
-				return $def ;
230
-			}
231
-		}
232
-		return array ( ) ;
233
-	}
234
-	function addRelateData($fieldname, $listfielddef) {
235
-		$modFieldDef = $this->module->field_defs [ strtolower ( $fieldname ) ];
236
-		if (!empty($modFieldDef['module']) && !empty($modFieldDef['id_name'])) {
237
-			$listfielddef['module'] = $modFieldDef['module'];
238
-			$listfielddef['id'] = strtoupper($modFieldDef['id_name']);
239
-			$listfielddef['link'] = true;
240
-			$listfielddef['related_fields'] = array (strtolower($modFieldDef['id_name']));
241
-		}
242
-		return $listfielddef;
243
-	}
244
-	function _loadLayoutFromRequest ()
245
-	{
246
-	    $GLOBALS['log']->debug("ParserModifyListView->_loadLayoutFromRequest()");
247
-		$fields = array ( ) ;
248
-		$rejectTypes = array ( 'html' , 'enum' , 'text' ) ;
249
-		for ( $i = 0 ; isset ( $_POST [ 'group_' . $i ] ) && $i < 2 ; $i ++ )
250
-		{
251
-			//echo "\n***group-$i Size:".sizeof($_POST['group_' . $i])."\n";
252
-			foreach ( $_POST [ 'group_' . $i ] as $field )
253
-			{
254
-				$fieldname = strtoupper ( $field ) ;
255
-				//originalListViewDefs are all lower case
256
-				$lowerFieldName = strtolower ( $field ) ;
257
-				if (isset ( $this->originalListViewDefs [ $lowerFieldName ] ))
258
-				{
259
-					$fields [ $fieldname ] = $this->originalListViewDefs [ $lowerFieldName ] ;
260
-				} else
261
-				{
262
-					//check if we have the case wrong for custom fields
263
-					if (! isset ( $this->module->field_defs [ $fieldname ] ))
264
-					{
265
-						foreach ( $this->module->field_defs as $key => $value )
266
-						{
267
-							if (strtoupper ( $key ) == $fieldname)
268
-							{
269
-								$fields [ $fieldname ] = array ( 'width' => 10 , 'label' => $this->module->field_defs [ $key ] [ 'vname' ] ) ;
270
-								break ;
271
-							}
272
-						}
273
-					} else
274
-					{
275
-						$fields [ $fieldname ] = array ( 'width' => 10 , 'label' => $this->module->field_defs [ $fieldname ] [ 'vname' ] ) ;
276
-					}
277
-					// sorting fields of certain types will cause a database engine problems
278
-					// we only check this for custom fields, as we assume that OOB fields have been independently confirmed as ok
279
-					if (isset ( $this->module->field_defs [ strtolower ( $fieldname ) ] ) && (in_array ( $this->module->field_defs [ strtolower ( $fieldname ) ] [ 'type' ], $rejectTypes ) || isset($this->module->field_defs [ strtolower ( $fieldname ) ]['custom_module'])))
280
-					{
281
-						$fields [ $fieldname ] [ 'sortable' ] = false ;
282
-					}
283
-					// Bug 23728 - Make adding a currency type field default to setting the 'currency_format' to true
284
-					if (isset ( $this->module->field_defs [ strtolower ( $fieldname ) ] [ 'type ' ] ) && $this->module->field_defs [ strtolower ( $fieldname ) ] [ 'type' ] == 'currency') 
285
-					{
286
-						$fields [ $fieldname ] [ 'currency_format' ] = true;
287
-					}
288
-				}
289
-				if (isset ( $_REQUEST [ strtolower ( $fieldname ) . 'width' ] ))
290
-				{
291
-					$width = substr ( $_REQUEST [ strtolower ( $fieldname ) . 'width' ], 6, 3 ) ;
292
-					if (strpos ( $width, "%" ) !== false)
293
-					{
294
-						$width = substr ( $width, 0, 2 ) ;
295
-					}
296
-					if ($width < 101 && $width > 0)
297
-					{
298
-						$fields [ $fieldname ] [ 'width' ] = $width ;
299
-					}
300
-				} else if (isset ( $this->listViewDefs [ $fieldname ] [ 'width' ] ))
301
-				{
302
-					$fields [ $fieldname ] [ 'width' ] = $this->listViewDefs [ $fieldname ] [ 'width' ] ;
303
-				}
304
-				//Get additional Data for relate fields
305
-				if (isset($this->module->field_defs [ strtolower ( $fieldname ) ] [ 'type' ]) && $this->module->field_defs [ strtolower ( $fieldname ) ] [ 'type' ] == 'relate') {
306
-					$fields [ $fieldname ] = $this->addRelateData($field, $fields [ $fieldname ]);
307
-				}
308
-				$fields [ $fieldname ] [ 'default' ] = ($i == 0) ;
309
-			}
310
-		}
311
-		// Add the reserved fields back in to the end of the default fields in the layout
312
-		// ASSUMPTION: reserved fields go back at the end
313
-		// First, load the reserved fields - we cannot assume that getDefaultFields has been called earlier when saving
314
-		$this->getDefaultFields();
315
-		foreach ( $this->reserved as $key => $def)
316
-		{
317
-		    $fields[ $key ] = $def;
318
-		}
213
+    function getField ( $fieldName )
214
+    {
215
+        $fieldName = strtolower ( $fieldName ) ;
216
+        foreach ( $this->listViewDefs as $key => $def )
217
+        {
218
+            $key = strtolower ( $key ) ;
219
+            if ($key == $fieldName)
220
+            {
221
+                return $def ;
222
+            }
223
+        }
224
+        foreach ( $this->module->field_defs as $key => $def )
225
+        {
226
+            $key = strtolower ( $key ) ;
227
+            if ($key == $fieldName)
228
+            {
229
+                return $def ;
230
+            }
231
+        }
232
+        return array ( ) ;
233
+    }
234
+    function addRelateData($fieldname, $listfielddef) {
235
+        $modFieldDef = $this->module->field_defs [ strtolower ( $fieldname ) ];
236
+        if (!empty($modFieldDef['module']) && !empty($modFieldDef['id_name'])) {
237
+            $listfielddef['module'] = $modFieldDef['module'];
238
+            $listfielddef['id'] = strtoupper($modFieldDef['id_name']);
239
+            $listfielddef['link'] = true;
240
+            $listfielddef['related_fields'] = array (strtolower($modFieldDef['id_name']));
241
+        }
242
+        return $listfielddef;
243
+    }
244
+    function _loadLayoutFromRequest ()
245
+    {
246
+        $GLOBALS['log']->debug("ParserModifyListView->_loadLayoutFromRequest()");
247
+        $fields = array ( ) ;
248
+        $rejectTypes = array ( 'html' , 'enum' , 'text' ) ;
249
+        for ( $i = 0 ; isset ( $_POST [ 'group_' . $i ] ) && $i < 2 ; $i ++ )
250
+        {
251
+            //echo "\n***group-$i Size:".sizeof($_POST['group_' . $i])."\n";
252
+            foreach ( $_POST [ 'group_' . $i ] as $field )
253
+            {
254
+                $fieldname = strtoupper ( $field ) ;
255
+                //originalListViewDefs are all lower case
256
+                $lowerFieldName = strtolower ( $field ) ;
257
+                if (isset ( $this->originalListViewDefs [ $lowerFieldName ] ))
258
+                {
259
+                    $fields [ $fieldname ] = $this->originalListViewDefs [ $lowerFieldName ] ;
260
+                } else
261
+                {
262
+                    //check if we have the case wrong for custom fields
263
+                    if (! isset ( $this->module->field_defs [ $fieldname ] ))
264
+                    {
265
+                        foreach ( $this->module->field_defs as $key => $value )
266
+                        {
267
+                            if (strtoupper ( $key ) == $fieldname)
268
+                            {
269
+                                $fields [ $fieldname ] = array ( 'width' => 10 , 'label' => $this->module->field_defs [ $key ] [ 'vname' ] ) ;
270
+                                break ;
271
+                            }
272
+                        }
273
+                    } else
274
+                    {
275
+                        $fields [ $fieldname ] = array ( 'width' => 10 , 'label' => $this->module->field_defs [ $fieldname ] [ 'vname' ] ) ;
276
+                    }
277
+                    // sorting fields of certain types will cause a database engine problems
278
+                    // we only check this for custom fields, as we assume that OOB fields have been independently confirmed as ok
279
+                    if (isset ( $this->module->field_defs [ strtolower ( $fieldname ) ] ) && (in_array ( $this->module->field_defs [ strtolower ( $fieldname ) ] [ 'type' ], $rejectTypes ) || isset($this->module->field_defs [ strtolower ( $fieldname ) ]['custom_module'])))
280
+                    {
281
+                        $fields [ $fieldname ] [ 'sortable' ] = false ;
282
+                    }
283
+                    // Bug 23728 - Make adding a currency type field default to setting the 'currency_format' to true
284
+                    if (isset ( $this->module->field_defs [ strtolower ( $fieldname ) ] [ 'type ' ] ) && $this->module->field_defs [ strtolower ( $fieldname ) ] [ 'type' ] == 'currency') 
285
+                    {
286
+                        $fields [ $fieldname ] [ 'currency_format' ] = true;
287
+                    }
288
+                }
289
+                if (isset ( $_REQUEST [ strtolower ( $fieldname ) . 'width' ] ))
290
+                {
291
+                    $width = substr ( $_REQUEST [ strtolower ( $fieldname ) . 'width' ], 6, 3 ) ;
292
+                    if (strpos ( $width, "%" ) !== false)
293
+                    {
294
+                        $width = substr ( $width, 0, 2 ) ;
295
+                    }
296
+                    if ($width < 101 && $width > 0)
297
+                    {
298
+                        $fields [ $fieldname ] [ 'width' ] = $width ;
299
+                    }
300
+                } else if (isset ( $this->listViewDefs [ $fieldname ] [ 'width' ] ))
301
+                {
302
+                    $fields [ $fieldname ] [ 'width' ] = $this->listViewDefs [ $fieldname ] [ 'width' ] ;
303
+                }
304
+                //Get additional Data for relate fields
305
+                if (isset($this->module->field_defs [ strtolower ( $fieldname ) ] [ 'type' ]) && $this->module->field_defs [ strtolower ( $fieldname ) ] [ 'type' ] == 'relate') {
306
+                    $fields [ $fieldname ] = $this->addRelateData($field, $fields [ $fieldname ]);
307
+                }
308
+                $fields [ $fieldname ] [ 'default' ] = ($i == 0) ;
309
+            }
310
+        }
311
+        // Add the reserved fields back in to the end of the default fields in the layout
312
+        // ASSUMPTION: reserved fields go back at the end
313
+        // First, load the reserved fields - we cannot assume that getDefaultFields has been called earlier when saving
314
+        $this->getDefaultFields();
315
+        foreach ( $this->reserved as $key => $def)
316
+        {
317
+            $fields[ $key ] = $def;
318
+        }
319 319
 		
320
-		return $fields ;
321
-	}
322
-	function handleSave ()
323
-	{
324
-		$fields = $this->_loadLayoutFromRequest();
325
-		$this->_writeToFile($this->customFile,'ListView',$this->module_name,$fields,$this->_variables);
320
+        return $fields ;
321
+    }
322
+    function handleSave ()
323
+    {
324
+        $fields = $this->_loadLayoutFromRequest();
325
+        $this->_writeToFile($this->customFile,'ListView',$this->module_name,$fields,$this->_variables);
326 326
 
327
-		$GLOBALS [ "listViewDefs" ] [ $this->module_name ] = $fields ;
328
-		// now clear the cache so that the results are immediately visible
329
-		include_once ('include/TemplateHandler/TemplateHandler.php') ;
330
-		TemplateHandler::clearCache ( $this->module_name, "ListView.tpl" ) ; // not currently cached, but here for the future
331
-	}
327
+        $GLOBALS [ "listViewDefs" ] [ $this->module_name ] = $fields ;
328
+        // now clear the cache so that the results are immediately visible
329
+        include_once ('include/TemplateHandler/TemplateHandler.php') ;
330
+        TemplateHandler::clearCache ( $this->module_name, "ListView.tpl" ) ; // not currently cached, but here for the future
331
+    }
332 332
 }
333 333
 ?>
Please login to merge, or discard this patch.
Spacing   +117 added lines, -117 removed lines patch added patch discarded remove patch
@@ -43,43 +43,43 @@  discard block
 block discarded – undo
43 43
 }
44 44
 
45 45
 
46
-require_once ('modules/ModuleBuilder/parsers/ModuleBuilderParser.php') ;
46
+require_once ('modules/ModuleBuilder/parsers/ModuleBuilderParser.php');
47 47
 class ParserModifyListView extends ModuleBuilderParser
48 48
 {
49
-	var $listViewDefs = false ;
50
-	var $defaults = array ( ) ;
51
-	var $additional = array ( ) ;
52
-	var $available = array ( ) ;
49
+	var $listViewDefs = false;
50
+	var $defaults = array( );
51
+	var $additional = array( );
52
+	var $available = array( );
53 53
 	var $reserved = array(); // fields marked by 'studio'=>false in the listviewdefs; need to be preserved
54 54
 	//	var $language_module = '';
55
-	var $columns = array ( 'LBL_DEFAULT' => 'getDefaultFields' , 'LBL_AVAILABLE' => 'getAdditionalFields' , 'LBL_HIDDEN' => 'getAvailableFields' ) ;
56
-	function init ( $module_name , $submodule = '' )
55
+	var $columns = array('LBL_DEFAULT' => 'getDefaultFields', 'LBL_AVAILABLE' => 'getAdditionalFields', 'LBL_HIDDEN' => 'getAvailableFields');
56
+	function init($module_name, $submodule = '')
57 57
 	{
58
-		global $app_list_strings ;
59
-		$this->module_name = $module_name ;
60
-		$mod_strings = return_module_language ( $GLOBALS [ 'current_language' ], $this->module_name ) ; // needed solely so that listviewdefs that reference this can be included without error
61
-		$class = $GLOBALS [ 'beanList' ] [ $this->module_name ] ;
62
-		require_once ($GLOBALS [ 'beanFiles' ] [ $class ]) ;
63
-		$this->module = new $class ( ) ;
58
+		global $app_list_strings;
59
+		$this->module_name = $module_name;
60
+		$mod_strings = return_module_language($GLOBALS ['current_language'], $this->module_name); // needed solely so that listviewdefs that reference this can be included without error
61
+		$class = $GLOBALS ['beanList'] [$this->module_name];
62
+		require_once ($GLOBALS ['beanFiles'] [$class]);
63
+		$this->module = new $class( );
64 64
 
65
-		$loaded = $this->_loadFromFile('ListView','modules/' . $this->module_name . '/metadata/listviewdefs.php',$this->module_name);
66
-		$this->originalListViewDefs = $loaded['viewdefs'] [ $this->module_name ] ;
65
+		$loaded = $this->_loadFromFile('ListView', 'modules/'.$this->module_name.'/metadata/listviewdefs.php', $this->module_name);
66
+		$this->originalListViewDefs = $loaded['viewdefs'] [$this->module_name];
67 67
 		$this->_variables = $loaded['variables'];
68 68
 		//		_pp($loaded);
69
-		$this->customFile = 'custom/modules/' . $this->module_name . '/metadata/listviewdefs.php' ;
70
-		if (file_exists ( $this->customFile ))
69
+		$this->customFile = 'custom/modules/'.$this->module_name.'/metadata/listviewdefs.php';
70
+		if (file_exists($this->customFile))
71 71
 		{
72
-			$loaded = $this->_loadFromFile('ListView',$this->customFile,$this->module_name);
73
-			$this->listViewDefs = $loaded['viewdefs'] [ $this->module_name ] ;
72
+			$loaded = $this->_loadFromFile('ListView', $this->customFile, $this->module_name);
73
+			$this->listViewDefs = $loaded['viewdefs'] [$this->module_name];
74 74
 			$this->_variables = $loaded['variables'];
75 75
 		} else
76 76
 		{
77
-			$this->listViewDefs = & $this->originalListViewDefs ;
77
+			$this->listViewDefs = & $this->originalListViewDefs;
78 78
 		}
79 79
 
80
-		$this->fixKeys ( $this->originalListViewDefs ) ;
81
-		$this->fixKeys ( $this->listViewDefs ) ;
82
-		$this->language_module = $this->module_name ;
80
+		$this->fixKeys($this->originalListViewDefs);
81
+		$this->fixKeys($this->listViewDefs);
82
+		$this->language_module = $this->module_name;
83 83
 	}
84 84
 	
85 85
 	function getLanguage()
@@ -87,102 +87,102 @@  discard block
 block discarded – undo
87 87
 	    return $this->language_module;
88 88
 	}
89 89
 	// re-key array so that every entry has a key=name and all keys are lowercase - makes it easier in handleSave() later...
90
-	function fixKeys ( &$defs )
90
+	function fixKeys(&$defs)
91 91
 	{
92
-		$temp = array ( ) ;
93
-		foreach ( $defs as $key => $value )
92
+		$temp = array( );
93
+		foreach ($defs as $key => $value)
94 94
 		{
95
-			if (! is_array ( $value ))
95
+			if (!is_array($value))
96 96
 			{
97
-				$key = $value ;
98
-				$def = array ( ) ;
99
-				$def [ 'name' ] = (isset ( $this->module->field_defs [ $key ] )) ? $this->module->field_defs [ $key ] [ 'name' ] : $key ;
100
-				$value = $def ;
97
+				$key = $value;
98
+				$def = array( );
99
+				$def ['name'] = (isset ($this->module->field_defs [$key])) ? $this->module->field_defs [$key] ['name'] : $key;
100
+				$value = $def;
101 101
 			}
102
-			if (isset ( $value [ 'name' ] ))
102
+			if (isset ($value ['name']))
103 103
 			{
104
-				$key = $value [ 'name' ] ; // override key with name, needed when the entry lacks a key
104
+				$key = $value ['name']; // override key with name, needed when the entry lacks a key
105 105
 			}
106
-			$temp [ strtolower ( $key ) ] = $value ;
106
+			$temp [strtolower($key)] = $value;
107 107
 		}
108
-		$defs = $temp ;
108
+		$defs = $temp;
109 109
 	}
110 110
 	
111 111
 	/**
112 112
 	 * returns the default fields for a listview
113 113
 	 * Called only when displaying the listview for editing; not called when saving
114 114
 	 */
115
-	function getDefaultFields ()
115
+	function getDefaultFields()
116 116
 	{
117
-		$this->defaults = array ( ) ;
118
-		foreach ( $this->listViewDefs as $key => $def )
117
+		$this->defaults = array( );
118
+		foreach ($this->listViewDefs as $key => $def)
119 119
 		{
120 120
 		    // add in the default fields from the listviewdefs, stripping out any field with 'studio' set to a value other than true
121 121
 		    // Important: the 'studio' fields must be added back into the layout on save, as they're not editable rather than hidden
122
-			if (! empty ( $def [ 'default' ] ))
122
+			if (!empty ($def ['default']))
123 123
 			{
124
-			    if (! isset($def['studio']) || $def['studio'] === true)
124
+			    if (!isset($def['studio']) || $def['studio'] === true)
125 125
 			    {
126
-			        $this->defaults [ $key ] = $def ;
126
+			        $this->defaults [$key] = $def;
127 127
 			    }
128 128
 			    else
129 129
 			    // anything which doesn't go into the defaults is a reserved field - this makes sure we don't miss anything
130 130
 			    {
131
-			        $this->reserved [ $key ] = $def;
131
+			        $this->reserved [$key] = $def;
132 132
 			    }
133 133
 			}
134 134
 		}
135
-		return $this->defaults ;
135
+		return $this->defaults;
136 136
 	}
137 137
 	/**
138 138
 	 * returns additional fields available for users to create fields
139 139
 	 */
140
-	function getAdditionalFields ()
140
+	function getAdditionalFields()
141 141
 	{
142
-		$this->additional = array ( ) ;
143
-		foreach ( $this->listViewDefs as $key => $def )
142
+		$this->additional = array( );
143
+		foreach ($this->listViewDefs as $key => $def)
144 144
 		{
145
-			if (empty ( $def [ 'default' ] ))
145
+			if (empty ($def ['default']))
146 146
 			{
147
-				$key = strtolower ( $key ) ;
148
-				$this->additional [ $key ] = $def ;
147
+				$key = strtolower($key);
148
+				$this->additional [$key] = $def;
149 149
 			}
150 150
 		}
151
-		return $this->additional ;
151
+		return $this->additional;
152 152
 	}
153 153
 	/**
154 154
 	 * returns unused fields that are available for using in either default or additional list views
155 155
 	 */
156
-	function getAvailableFields ()
156
+	function getAvailableFields()
157 157
 	{
158
-		$this->availableFields = array ( ) ;
159
-		$lowerFieldList = array_change_key_case ( $this->listViewDefs ) ;
160
-		foreach ( $this->originalListViewDefs as $key => $def )
158
+		$this->availableFields = array( );
159
+		$lowerFieldList = array_change_key_case($this->listViewDefs);
160
+		foreach ($this->originalListViewDefs as $key => $def)
161 161
 		{
162
-			$key = strtolower ( $key ) ;
163
-			if (! isset ( $lowerFieldList [ $key ] ))
162
+			$key = strtolower($key);
163
+			if (!isset ($lowerFieldList [$key]))
164 164
 			{
165
-				$this->availableFields [ $key ] = $def ;
165
+				$this->availableFields [$key] = $def;
166 166
 			}
167 167
 		}
168
-		$GLOBALS['log']->debug('parser.modifylistview.php->getAvailableFields(): field_defs='.print_r($this->availableFields,true));
168
+		$GLOBALS['log']->debug('parser.modifylistview.php->getAvailableFields(): field_defs='.print_r($this->availableFields, true));
169 169
 		$modFields = !empty($this->module->field_name_map) ? $this->module->field_name_map : $this->module->field_defs;
170
-		foreach ( $modFields as $key => $def )
170
+		foreach ($modFields as $key => $def)
171 171
 		{
172
-			$fieldName = strtolower ( $key ) ;
172
+			$fieldName = strtolower($key);
173 173
             if ($fieldName == 'currency_id')
174 174
                 continue;
175
-			if (!isset ( $lowerFieldList [ $fieldName ] )) // bug 16728 - check this first, so that other conditions (e.g., studio == visible) can't override and add duplicate entries
175
+			if (!isset ($lowerFieldList [$fieldName])) // bug 16728 - check this first, so that other conditions (e.g., studio == visible) can't override and add duplicate entries
176 176
 			{
177 177
             // bug 19656: this test changed after 5.0.0b - we now remove all ID type fields - whether set as type, or dbtype, from the fielddefs
178
-            if ($this->isValidField($key, $def)){
179
-					$label = (isset ( $def [ 'vname' ] )) ? $def [ 'vname' ] : (isset($def [ 'label' ]) ? $def['label'] : $def['name']) ;
180
-					$this->availableFields [ $fieldName ] = array ( 'width' => '10' , 'label' => $label ) ;
178
+            if ($this->isValidField($key, $def)) {
179
+					$label = (isset ($def ['vname'])) ? $def ['vname'] : (isset($def ['label']) ? $def['label'] : $def['name']);
180
+					$this->availableFields [$fieldName] = array('width' => '10', 'label' => $label);
181 181
 				}
182 182
 			}
183 183
 		}
184 184
 
185
-		return $this->availableFields ;
185
+		return $this->availableFields;
186 186
 	}
187 187
 
188 188
     function getFieldDefs()
@@ -193,19 +193,19 @@  discard block
 block discarded – undo
193 193
 	
194 194
 	function isValidField($key, $def) {
195 195
 	    //Allow fields that are studio visible  
196
-		if (! empty ( $def [ 'studio' ] ) && $def [ 'studio' ] == 'visible')
196
+		if (!empty ($def ['studio']) && $def ['studio'] == 'visible')
197 197
 		  return true;
198 198
 		  
199 199
 		//No ID fields
200
-		if  ((!empty ( $def [ 'dbType' ] ) && $def [ 'dbType' ] == 'id') || (!empty ( $def [ 'type' ] ) && $def [ 'type' ] == 'id'))
200
+		if ((!empty ($def ['dbType']) && $def ['dbType'] == 'id') || (!empty ($def ['type']) && $def ['type'] == 'id'))
201 201
 		  return false;
202 202
 		  
203 203
 		//only allow DB and custom fields (if a source is specified)
204
-	    if (!empty($def [ 'source' ]) && $def [ 'source' ] != 'db' && $def [ 'source' ] != 'custom_fields')
204
+	    if (!empty($def ['source']) && $def ['source'] != 'db' && $def ['source'] != 'custom_fields')
205 205
 		  return false;
206 206
 
207 207
 		//Dont ever show the "deleted" fields or "_name" fields
208
-		if (strcmp ( $key, 'deleted' ) == 0 || (isset ( $def [ 'name' ] ) && strpos ( $def [ 'name' ], "_name" ) !== false))
208
+		if (strcmp($key, 'deleted') == 0 || (isset ($def ['name']) && strpos($def ['name'], "_name") !== false))
209 209
 	       return false;
210 210
 
211 211
 	    //If none of the "ifs" are true, the field is valid
@@ -213,124 +213,124 @@  discard block
 block discarded – undo
213 213
 	}
214 214
 	
215 215
 	
216
-	function getField ( $fieldName )
216
+	function getField($fieldName)
217 217
 	{
218
-		$fieldName = strtolower ( $fieldName ) ;
219
-		foreach ( $this->listViewDefs as $key => $def )
218
+		$fieldName = strtolower($fieldName);
219
+		foreach ($this->listViewDefs as $key => $def)
220 220
 		{
221
-			$key = strtolower ( $key ) ;
221
+			$key = strtolower($key);
222 222
 			if ($key == $fieldName)
223 223
 			{
224
-				return $def ;
224
+				return $def;
225 225
 			}
226 226
 		}
227
-		foreach ( $this->module->field_defs as $key => $def )
227
+		foreach ($this->module->field_defs as $key => $def)
228 228
 		{
229
-			$key = strtolower ( $key ) ;
229
+			$key = strtolower($key);
230 230
 			if ($key == $fieldName)
231 231
 			{
232
-				return $def ;
232
+				return $def;
233 233
 			}
234 234
 		}
235
-		return array ( ) ;
235
+		return array( );
236 236
 	}
237 237
 	function addRelateData($fieldname, $listfielddef) {
238
-		$modFieldDef = $this->module->field_defs [ strtolower ( $fieldname ) ];
238
+		$modFieldDef = $this->module->field_defs [strtolower($fieldname)];
239 239
 		if (!empty($modFieldDef['module']) && !empty($modFieldDef['id_name'])) {
240 240
 			$listfielddef['module'] = $modFieldDef['module'];
241 241
 			$listfielddef['id'] = strtoupper($modFieldDef['id_name']);
242 242
 			$listfielddef['link'] = true;
243
-			$listfielddef['related_fields'] = array (strtolower($modFieldDef['id_name']));
243
+			$listfielddef['related_fields'] = array(strtolower($modFieldDef['id_name']));
244 244
 		}
245 245
 		return $listfielddef;
246 246
 	}
247
-	function _loadLayoutFromRequest ()
247
+	function _loadLayoutFromRequest()
248 248
 	{
249 249
 	    $GLOBALS['log']->debug("ParserModifyListView->_loadLayoutFromRequest()");
250
-		$fields = array ( ) ;
251
-		$rejectTypes = array ( 'html' , 'enum' , 'text' ) ;
252
-		for ( $i = 0 ; isset ( $_POST [ 'group_' . $i ] ) && $i < 2 ; $i ++ )
250
+		$fields = array( );
251
+		$rejectTypes = array('html', 'enum', 'text');
252
+		for ($i = 0; isset ($_POST ['group_'.$i]) && $i < 2; $i++)
253 253
 		{
254 254
 			//echo "\n***group-$i Size:".sizeof($_POST['group_' . $i])."\n";
255
-			foreach ( $_POST [ 'group_' . $i ] as $field )
255
+			foreach ($_POST ['group_'.$i] as $field)
256 256
 			{
257
-				$fieldname = strtoupper ( $field ) ;
257
+				$fieldname = strtoupper($field);
258 258
 				//originalListViewDefs are all lower case
259
-				$lowerFieldName = strtolower ( $field ) ;
260
-				if (isset ( $this->originalListViewDefs [ $lowerFieldName ] ))
259
+				$lowerFieldName = strtolower($field);
260
+				if (isset ($this->originalListViewDefs [$lowerFieldName]))
261 261
 				{
262
-					$fields [ $fieldname ] = $this->originalListViewDefs [ $lowerFieldName ] ;
262
+					$fields [$fieldname] = $this->originalListViewDefs [$lowerFieldName];
263 263
 				} else
264 264
 				{
265 265
 					//check if we have the case wrong for custom fields
266
-					if (! isset ( $this->module->field_defs [ $fieldname ] ))
266
+					if (!isset ($this->module->field_defs [$fieldname]))
267 267
 					{
268
-						foreach ( $this->module->field_defs as $key => $value )
268
+						foreach ($this->module->field_defs as $key => $value)
269 269
 						{
270
-							if (strtoupper ( $key ) == $fieldname)
270
+							if (strtoupper($key) == $fieldname)
271 271
 							{
272
-								$fields [ $fieldname ] = array ( 'width' => 10 , 'label' => $this->module->field_defs [ $key ] [ 'vname' ] ) ;
273
-								break ;
272
+								$fields [$fieldname] = array('width' => 10, 'label' => $this->module->field_defs [$key] ['vname']);
273
+								break;
274 274
 							}
275 275
 						}
276 276
 					} else
277 277
 					{
278
-						$fields [ $fieldname ] = array ( 'width' => 10 , 'label' => $this->module->field_defs [ $fieldname ] [ 'vname' ] ) ;
278
+						$fields [$fieldname] = array('width' => 10, 'label' => $this->module->field_defs [$fieldname] ['vname']);
279 279
 					}
280 280
 					// sorting fields of certain types will cause a database engine problems
281 281
 					// we only check this for custom fields, as we assume that OOB fields have been independently confirmed as ok
282
-					if (isset ( $this->module->field_defs [ strtolower ( $fieldname ) ] ) && (in_array ( $this->module->field_defs [ strtolower ( $fieldname ) ] [ 'type' ], $rejectTypes ) || isset($this->module->field_defs [ strtolower ( $fieldname ) ]['custom_module'])))
282
+					if (isset ($this->module->field_defs [strtolower($fieldname)]) && (in_array($this->module->field_defs [strtolower($fieldname)] ['type'], $rejectTypes) || isset($this->module->field_defs [strtolower($fieldname)]['custom_module'])))
283 283
 					{
284
-						$fields [ $fieldname ] [ 'sortable' ] = false ;
284
+						$fields [$fieldname] ['sortable'] = false;
285 285
 					}
286 286
 					// Bug 23728 - Make adding a currency type field default to setting the 'currency_format' to true
287
-					if (isset ( $this->module->field_defs [ strtolower ( $fieldname ) ] [ 'type ' ] ) && $this->module->field_defs [ strtolower ( $fieldname ) ] [ 'type' ] == 'currency') 
287
+					if (isset ($this->module->field_defs [strtolower($fieldname)] ['type ']) && $this->module->field_defs [strtolower($fieldname)] ['type'] == 'currency') 
288 288
 					{
289
-						$fields [ $fieldname ] [ 'currency_format' ] = true;
289
+						$fields [$fieldname] ['currency_format'] = true;
290 290
 					}
291 291
 				}
292
-				if (isset ( $_REQUEST [ strtolower ( $fieldname ) . 'width' ] ))
292
+				if (isset ($_REQUEST [strtolower($fieldname).'width']))
293 293
 				{
294
-					$width = substr ( $_REQUEST [ strtolower ( $fieldname ) . 'width' ], 6, 3 ) ;
295
-					if (strpos ( $width, "%" ) !== false)
294
+					$width = substr($_REQUEST [strtolower($fieldname).'width'], 6, 3);
295
+					if (strpos($width, "%") !== false)
296 296
 					{
297
-						$width = substr ( $width, 0, 2 ) ;
297
+						$width = substr($width, 0, 2);
298 298
 					}
299 299
 					if ($width < 101 && $width > 0)
300 300
 					{
301
-						$fields [ $fieldname ] [ 'width' ] = $width ;
301
+						$fields [$fieldname] ['width'] = $width;
302 302
 					}
303
-				} else if (isset ( $this->listViewDefs [ $fieldname ] [ 'width' ] ))
303
+				} else if (isset ($this->listViewDefs [$fieldname] ['width']))
304 304
 				{
305
-					$fields [ $fieldname ] [ 'width' ] = $this->listViewDefs [ $fieldname ] [ 'width' ] ;
305
+					$fields [$fieldname] ['width'] = $this->listViewDefs [$fieldname] ['width'];
306 306
 				}
307 307
 				//Get additional Data for relate fields
308
-				if (isset($this->module->field_defs [ strtolower ( $fieldname ) ] [ 'type' ]) && $this->module->field_defs [ strtolower ( $fieldname ) ] [ 'type' ] == 'relate') {
309
-					$fields [ $fieldname ] = $this->addRelateData($field, $fields [ $fieldname ]);
308
+				if (isset($this->module->field_defs [strtolower($fieldname)] ['type']) && $this->module->field_defs [strtolower($fieldname)] ['type'] == 'relate') {
309
+					$fields [$fieldname] = $this->addRelateData($field, $fields [$fieldname]);
310 310
 				}
311
-				$fields [ $fieldname ] [ 'default' ] = ($i == 0) ;
311
+				$fields [$fieldname] ['default'] = ($i == 0);
312 312
 			}
313 313
 		}
314 314
 		// Add the reserved fields back in to the end of the default fields in the layout
315 315
 		// ASSUMPTION: reserved fields go back at the end
316 316
 		// First, load the reserved fields - we cannot assume that getDefaultFields has been called earlier when saving
317 317
 		$this->getDefaultFields();
318
-		foreach ( $this->reserved as $key => $def)
318
+		foreach ($this->reserved as $key => $def)
319 319
 		{
320
-		    $fields[ $key ] = $def;
320
+		    $fields[$key] = $def;
321 321
 		}
322 322
 		
323
-		return $fields ;
323
+		return $fields;
324 324
 	}
325
-	function handleSave ()
325
+	function handleSave()
326 326
 	{
327 327
 		$fields = $this->_loadLayoutFromRequest();
328
-		$this->_writeToFile($this->customFile,'ListView',$this->module_name,$fields,$this->_variables);
328
+		$this->_writeToFile($this->customFile, 'ListView', $this->module_name, $fields, $this->_variables);
329 329
 
330
-		$GLOBALS [ "listViewDefs" ] [ $this->module_name ] = $fields ;
330
+		$GLOBALS ["listViewDefs"] [$this->module_name] = $fields;
331 331
 		// now clear the cache so that the results are immediately visible
332
-		include_once ('include/TemplateHandler/TemplateHandler.php') ;
333
-		TemplateHandler::clearCache ( $this->module_name, "ListView.tpl" ) ; // not currently cached, but here for the future
332
+		include_once ('include/TemplateHandler/TemplateHandler.php');
333
+		TemplateHandler::clearCache($this->module_name, "ListView.tpl"); // not currently cached, but here for the future
334 334
 	}
335 335
 }
336 336
 ?>
Please login to merge, or discard this patch.
Braces   +19 added lines, -13 removed lines patch added patch discarded remove patch
@@ -124,8 +124,7 @@  discard block
 block discarded – undo
124 124
 			    if (! isset($def['studio']) || $def['studio'] === true)
125 125
 			    {
126 126
 			        $this->defaults [ $key ] = $def ;
127
-			    }
128
-			    else
127
+			    } else
129 128
 			    // anything which doesn't go into the defaults is a reserved field - this makes sure we don't miss anything
130 129
 			    {
131 130
 			        $this->reserved [ $key ] = $def;
@@ -170,13 +169,16 @@  discard block
 block discarded – undo
170 169
 		foreach ( $modFields as $key => $def )
171 170
 		{
172 171
 			$fieldName = strtolower ( $key ) ;
173
-            if ($fieldName == 'currency_id')
174
-                continue;
175
-			if (!isset ( $lowerFieldList [ $fieldName ] )) // bug 16728 - check this first, so that other conditions (e.g., studio == visible) can't override and add duplicate entries
172
+            if ($fieldName == 'currency_id') {
173
+                            continue;
174
+            }
175
+			if (!isset ( $lowerFieldList [ $fieldName ] )) {
176
+			    // bug 16728 - check this first, so that other conditions (e.g., studio == visible) can't override and add duplicate entries
176 177
 			{
177 178
             // bug 19656: this test changed after 5.0.0b - we now remove all ID type fields - whether set as type, or dbtype, from the fielddefs
178 179
             if ($this->isValidField($key, $def)){
179 180
 					$label = (isset ( $def [ 'vname' ] )) ? $def [ 'vname' ] : (isset($def [ 'label' ]) ? $def['label'] : $def['name']) ;
181
+			}
180 182
 					$this->availableFields [ $fieldName ] = array ( 'width' => '10' , 'label' => $label ) ;
181 183
 				}
182 184
 			}
@@ -193,20 +195,24 @@  discard block
 block discarded – undo
193 195
 	
194 196
 	function isValidField($key, $def) {
195 197
 	    //Allow fields that are studio visible  
196
-		if (! empty ( $def [ 'studio' ] ) && $def [ 'studio' ] == 'visible')
197
-		  return true;
198
+		if (! empty ( $def [ 'studio' ] ) && $def [ 'studio' ] == 'visible') {
199
+				  return true;
200
+		}
198 201
 		  
199 202
 		//No ID fields
200
-		if  ((!empty ( $def [ 'dbType' ] ) && $def [ 'dbType' ] == 'id') || (!empty ( $def [ 'type' ] ) && $def [ 'type' ] == 'id'))
201
-		  return false;
203
+		if  ((!empty ( $def [ 'dbType' ] ) && $def [ 'dbType' ] == 'id') || (!empty ( $def [ 'type' ] ) && $def [ 'type' ] == 'id')) {
204
+				  return false;
205
+		}
202 206
 		  
203 207
 		//only allow DB and custom fields (if a source is specified)
204
-	    if (!empty($def [ 'source' ]) && $def [ 'source' ] != 'db' && $def [ 'source' ] != 'custom_fields')
205
-		  return false;
208
+	    if (!empty($def [ 'source' ]) && $def [ 'source' ] != 'db' && $def [ 'source' ] != 'custom_fields') {
209
+	    		  return false;
210
+	    }
206 211
 
207 212
 		//Dont ever show the "deleted" fields or "_name" fields
208
-		if (strcmp ( $key, 'deleted' ) == 0 || (isset ( $def [ 'name' ] ) && strpos ( $def [ 'name' ], "_name" ) !== false))
209
-	       return false;
213
+		if (strcmp ( $key, 'deleted' ) == 0 || (isset ( $def [ 'name' ] ) && strpos ( $def [ 'name' ], "_name" ) !== false)) {
214
+			       return false;
215
+		}
210 216
 
211 217
 	    //If none of the "ifs" are true, the field is valid
212 218
 	    return true;
Please login to merge, or discard this patch.
modules/Reminders_Invitees/Reminder_Invitee.php 3 patches
Braces   +6 added lines, -7 removed lines patch added patch discarded remove patch
@@ -76,7 +76,9 @@  discard block
 block discarded – undo
76 76
     public static function saveRemindersInviteesData($reminderId, $inviteesData) {
77 77
         $savedInviteeIds = array();
78 78
         foreach($inviteesData as $k => $inviteeData) {
79
-            if(isset($_POST['isDuplicate']) && $_POST['isDuplicate']) $inviteeData->id = '';
79
+            if(isset($_POST['isDuplicate']) && $_POST['isDuplicate']) {
80
+                $inviteeData->id = '';
81
+            }
80 82
             $reminderInviteeBean = BeanFactory::getBean('Reminders_Invitees', $inviteeData->id);
81 83
             $reminderInviteeBean->reminder_id = $reminderId;
82 84
             $reminderInviteeBean->related_invitee_module = $inviteeData->module;
@@ -84,8 +86,7 @@  discard block
 block discarded – undo
84 86
             if(!$inviteeData->id) {
85 87
                 $reminderInviteeBean->save();
86 88
                 $savedInviteeIds[] = $reminderInviteeBean->id;
87
-            }
88
-            else {
89
+            } else {
89 90
                 $addedInvitees = BeanFactory::getBean('Reminders_Invitees')->get_full_list("", "reminders_invitees.id != '{$inviteeData->id}' AND reminders_invitees.reminder_id = '{$reminderInviteeBean->reminder_id}' AND reminders_invitees.related_invitee_module = '{$reminderInviteeBean->related_invitee_module}' AND reminders_invitees.related_invitee_module_id = '{$reminderInviteeBean->related_invitee_module_id}'");
90 91
                 if (!$addedInvitees) {
91 92
                     $reminderInviteeBean->save();
@@ -132,11 +133,9 @@  discard block
 block discarded – undo
132 133
             default:
133 134
                 if(isset($bean->first_name) && isset($bean->last_name)) {
134 135
                     $retValue = "{$bean->first_name} {$bean->last_name}";
135
-                }
136
-                else if(isset($bean->name)) {
136
+                } else if(isset($bean->name)) {
137 137
                     $retValue = $bean->name;
138
-                }
139
-                else if(isset($bean->email)) {
138
+                } else if(isset($bean->email)) {
140 139
                     $retValue = $bean->email;
141 140
                 }
142 141
                 if(!$retValue) {
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -64,13 +64,13 @@  discard block
 block discarded – undo
64 64
 	 */
65 65
     public static function saveRemindersInviteesData($reminderId, $inviteesData) {
66 66
         $savedInviteeIds = array();
67
-        foreach($inviteesData as $k => $inviteeData) {
68
-            if(isset($_POST['isDuplicate']) && $_POST['isDuplicate']) $inviteeData->id = '';
67
+        foreach ($inviteesData as $k => $inviteeData) {
68
+            if (isset($_POST['isDuplicate']) && $_POST['isDuplicate']) $inviteeData->id = '';
69 69
             $reminderInviteeBean = BeanFactory::getBean('Reminders_Invitees', $inviteeData->id);
70 70
             $reminderInviteeBean->reminder_id = $reminderId;
71 71
             $reminderInviteeBean->related_invitee_module = $inviteeData->module;
72 72
             $reminderInviteeBean->related_invitee_module_id = $inviteeData->module_id;
73
-            if(!$inviteeData->id) {
73
+            if (!$inviteeData->id) {
74 74
                 $reminderInviteeBean->save();
75 75
                 $savedInviteeIds[] = $reminderInviteeBean->id;
76 76
             }
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 		$ret = array();
98 98
 		$reminderInviteeBeen = new Reminder_Invitee();
99 99
 		$reminderInvitees = $reminderInviteeBeen->get_full_list("reminders_invitees.date_entered", "reminders_invitees.reminder_id = '$reminderId'");
100
-        if($reminderInvitees) {
100
+        if ($reminderInvitees) {
101 101
             foreach ($reminderInvitees as $reminderInvitee) {
102 102
                 $ret[] = array(
103 103
                     'id' => $isDuplicate ? null : $reminderInvitee->id,
@@ -114,21 +114,21 @@  discard block
 block discarded – undo
114 114
         $retValue = "unknown";
115 115
 
116 116
         $bean = BeanFactory::getBean($module, $moduleId);
117
-        switch($module) {
117
+        switch ($module) {
118 118
             case 'Users':
119 119
             case 'Contacts':
120 120
             case 'Leads':
121 121
             default:
122
-                if(isset($bean->first_name) && isset($bean->last_name)) {
122
+                if (isset($bean->first_name) && isset($bean->last_name)) {
123 123
                     $retValue = "{$bean->first_name} {$bean->last_name}";
124 124
                 }
125
-                else if(isset($bean->name)) {
125
+                else if (isset($bean->name)) {
126 126
                     $retValue = $bean->name;
127 127
                 }
128
-                else if(isset($bean->email)) {
128
+                else if (isset($bean->email)) {
129 129
                     $retValue = $bean->email;
130 130
                 }
131
-                if(!$retValue) {
131
+                if (!$retValue) {
132 132
                     $retValue = "$module ($moduleId)";
133 133
                 }
134 134
                 break;
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 	 */
145 145
     public static function deleteRemindersInviteesMultiple($reminderId, $inviteeIds = array()) {
146 146
         $invitees = BeanFactory::getBean('Reminders_Invitees')->get_full_list("", "reminders_invitees.reminder_id = '$reminderId'");
147
-        if($invitees) {
147
+        if ($invitees) {
148 148
             foreach ($invitees as $invitee) {
149 149
                 if (!in_array($invitee->id, $inviteeIds)) {
150 150
                     $invitee->mark_deleted($invitee->id);
Please login to merge, or discard this patch.
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -56,12 +56,12 @@  discard block
 block discarded – undo
56 56
     var $related_invitee_module;
57 57
     var $related_invitee_module_id;
58 58
 
59
-	/**
60
-	 * Save multiple reminders invitees data.
61
-	 *
62
-	 * @param string $reminderId Related Reminder GUID
63
-	 * @param array $inviteesData Invitees Data
64
-	 */
59
+    /**
60
+     * Save multiple reminders invitees data.
61
+     *
62
+     * @param string $reminderId Related Reminder GUID
63
+     * @param array $inviteesData Invitees Data
64
+     */
65 65
     public static function saveRemindersInviteesData($reminderId, $inviteesData) {
66 66
         $savedInviteeIds = array();
67 67
         foreach($inviteesData as $k => $inviteeData) {
@@ -87,16 +87,16 @@  discard block
 block discarded – undo
87 87
         self::deleteRemindersInviteesMultiple($reminderId, $savedInviteeIds);
88 88
     }
89 89
 
90
-	/**
91
-	 * Load reminders invitees data.
92
-	 *
93
-	 * @param string $reminderId Related Reminder GUID
94
-	 * @return array Invitees data
95
-	 */
96
-	public static function loadRemindersInviteesData($reminderId, $isDuplicate = false) {
97
-		$ret = array();
98
-		$reminderInviteeBeen = new Reminder_Invitee();
99
-		$reminderInvitees = $reminderInviteeBeen->get_full_list("reminders_invitees.date_entered", "reminders_invitees.reminder_id = '$reminderId'");
90
+    /**
91
+     * Load reminders invitees data.
92
+     *
93
+     * @param string $reminderId Related Reminder GUID
94
+     * @return array Invitees data
95
+     */
96
+    public static function loadRemindersInviteesData($reminderId, $isDuplicate = false) {
97
+        $ret = array();
98
+        $reminderInviteeBeen = new Reminder_Invitee();
99
+        $reminderInvitees = $reminderInviteeBeen->get_full_list("reminders_invitees.date_entered", "reminders_invitees.reminder_id = '$reminderId'");
100 100
         if($reminderInvitees) {
101 101
             foreach ($reminderInvitees as $reminderInvitee) {
102 102
                 $ret[] = array(
@@ -107,8 +107,8 @@  discard block
 block discarded – undo
107 107
                 );
108 108
             }
109 109
         }
110
-		return $ret;
111
-	}
110
+        return $ret;
111
+    }
112 112
 
113 113
     private static function getInviteeName($module, $moduleId) {
114 114
         $retValue = "unknown";
@@ -136,12 +136,12 @@  discard block
 block discarded – undo
136 136
         return $retValue;
137 137
     }
138 138
 
139
-	/**
140
-	 * Delete reminders invitees multiple.
141
-	 *
142
-	 * @param string $reminderId Related Reminder GUID
143
-	 * @param array $inviteeIds (optional) Exluded Invitees GUIDs, the invitee will not deleted if this argument contains that. Default is empty array.
144
-	 */
139
+    /**
140
+     * Delete reminders invitees multiple.
141
+     *
142
+     * @param string $reminderId Related Reminder GUID
143
+     * @param array $inviteeIds (optional) Exluded Invitees GUIDs, the invitee will not deleted if this argument contains that. Default is empty array.
144
+     */
145 145
     public static function deleteRemindersInviteesMultiple($reminderId, $inviteeIds = array()) {
146 146
         $invitees = BeanFactory::getBean('Reminders_Invitees')->get_full_list("", "reminders_invitees.reminder_id = '$reminderId'");
147 147
         if($invitees) {
Please login to merge, or discard this patch.
modules/SchedulersJobs/field_arrays.php 3 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -40,23 +40,23 @@
 block discarded – undo
40 40
 
41 41
 
42 42
 $fields_array['Schedulers_jobs'] = array (
43
-	'column_fields' => array (
44
-		'id',
45
-		'deleted',
46
-		'date_entered',
47
-		'date_modified',
48
-		'job_id',
49
-		'execute_time',
50
-		'status',
51
-	),
52
-	'list_fields' => array (
53
-		'id',
54
-		'job_id',
55
-		'execute_time'
56
-	),
57
-	'required_fields' => array (
58
-		'job_id' => 1,
59
-		'execute_time' => 1
60
-	)
43
+    'column_fields' => array (
44
+        'id',
45
+        'deleted',
46
+        'date_entered',
47
+        'date_modified',
48
+        'job_id',
49
+        'execute_time',
50
+        'status',
51
+    ),
52
+    'list_fields' => array (
53
+        'id',
54
+        'job_id',
55
+        'execute_time'
56
+    ),
57
+    'required_fields' => array (
58
+        'job_id' => 1,
59
+        'execute_time' => 1
60
+    )
61 61
 );
62 62
 ?>
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 3
 /*********************************************************************************
4 4
  * SugarCRM Community Edition is a customer relationship management program developed by
5 5
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
  ********************************************************************************/
40 40
 
41 41
 
42
-$fields_array['Schedulers_jobs'] = array (
43
-	'column_fields' => array (
42
+$fields_array['Schedulers_jobs'] = array(
43
+	'column_fields' => array(
44 44
 		'id',
45 45
 		'deleted',
46 46
 		'date_entered',
@@ -49,12 +49,12 @@  discard block
 block discarded – undo
49 49
 		'execute_time',
50 50
 		'status',
51 51
 	),
52
-	'list_fields' => array (
52
+	'list_fields' => array(
53 53
 		'id',
54 54
 		'job_id',
55 55
 		'execute_time'
56 56
 	),
57
-	'required_fields' => array (
57
+	'required_fields' => array(
58 58
 		'job_id' => 1,
59 59
 		'execute_time' => 1
60 60
 	)
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
Please login to merge, or discard this patch.
modules/Import/maps/ImportMapOutlook.php 4 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -49,11 +49,11 @@  discard block
 block discarded – undo
49 49
 
50 50
 class ImportMapOutlook extends ImportMapOther
51 51
 {
52
-	/**
52
+    /**
53 53
      * String identifier for this import
54 54
      */
55 55
     public $name = 'outlook';
56
-	/**
56
+    /**
57 57
      * Field delimiter
58 58
      */
59 59
     public $delimiter = ',';
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
      * Field enclosure
62 62
      */
63 63
     public $enclosure = '"';
64
-	/**
64
+    /**
65 65
      * Do we have a header?
66 66
      */
67 67
     public $has_header = true;
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
      * @param  string $module
73 73
      * @return array field mappings
74 74
      */
75
-	public function getMapping(
75
+    public function getMapping(
76 76
         $module
77 77
         )
78 78
     {
Please login to merge, or discard this patch.
Switch Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -78,19 +78,19 @@
 block discarded – undo
78 78
     {
79 79
         $return_array = parent::getMapping($module);
80 80
         switch ($module) {
81
-        case 'Contacts':
82
-        case 'Leads':
83
-            return $return_array + array(
84
-                "Job Title"=>"title",
85
-                "Home Country"=>"alt_address_country",
86
-                "E-mail 2 Address"=>"email2",
87
-                );
88
-            break;
89
-        case 'Accounts':
90
-            return $return_array;
91
-            break;
92
-        default:
93
-            return $return_array;
81
+            case 'Contacts':
82
+            case 'Leads':
83
+                return $return_array + array(
84
+                    "Job Title"=>"title",
85
+                    "Home Country"=>"alt_address_country",
86
+                    "E-mail 2 Address"=>"email2",
87
+                    );
88
+                break;
89
+            case 'Accounts':
90
+                return $return_array;
91
+                break;
92
+            default:
93
+                return $return_array;
94 94
         }
95 95
     }
96 96
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 3
 /*********************************************************************************
4 4
  * SugarCRM Community Edition is a customer relationship management program developed by
5 5
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
Please login to merge, or discard this patch.
modules/Import/maps/ImportMapGoogle.php 3 patches
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
45 45
 class ImportMapGoogle extends ImportMapOther
46 46
 {
47
-	/**
47
+    /**
48 48
      * String identifier for this import
49 49
      */
50 50
     public $name = 'google';
@@ -55,38 +55,38 @@  discard block
 block discarded – undo
55 55
      * @param  string $module
56 56
      * @return array field mappings
57 57
      */
58
-	public function getMapping($module)
58
+    public function getMapping($module)
59 59
     {
60
-         $return_array = array(
61
-             'first_name' => array('sugar_key' => 'first_name', 'sugar_label' => '', 'default_label' => 'Given Name'),
62
-             'last_name' => array('sugar_key' => 'last_name', 'sugar_label' => '', 'default_label' => 'Family Name'),
63
-             'birthday' => array('sugar_key' => 'birthdate', 'sugar_label' => '', 'default_label' => 'Birthday'),
64
-             'title' => array('sugar_key' => 'title', 'sugar_label' => '', 'default_label' => 'Title'),
65
-             'notes' => array('sugar_key' => 'description', 'sugar_label' => '', 'default_label' => 'Notes'),
60
+            $return_array = array(
61
+                'first_name' => array('sugar_key' => 'first_name', 'sugar_label' => '', 'default_label' => 'Given Name'),
62
+                'last_name' => array('sugar_key' => 'last_name', 'sugar_label' => '', 'default_label' => 'Family Name'),
63
+                'birthday' => array('sugar_key' => 'birthdate', 'sugar_label' => '', 'default_label' => 'Birthday'),
64
+                'title' => array('sugar_key' => 'title', 'sugar_label' => '', 'default_label' => 'Title'),
65
+                'notes' => array('sugar_key' => 'description', 'sugar_label' => '', 'default_label' => 'Notes'),
66 66
 
67
-             'alt_address_street' => array('sugar_key' => 'alt_address_street', 'sugar_label' => '', 'default_label' => 'Home Street'),
68
-             'alt_address_postcode' => array('sugar_key' => 'alt_address_postalcode', 'sugar_label' => '', 'default_label' => 'Home Postcode'),
69
-             'alt_address_city' => array('sugar_key' => 'alt_address_city', 'sugar_label' => '', 'default_label' => 'Home City'),
70
-             'alt_address_state' => array('sugar_key' => 'alt_address_state', 'sugar_label' => '', 'default_label' => 'Home State'),
71
-             'alt_address_country' => array('sugar_key' => 'alt_address_country', 'sugar_label' => '', 'default_label' => 'Home Country'),
67
+                'alt_address_street' => array('sugar_key' => 'alt_address_street', 'sugar_label' => '', 'default_label' => 'Home Street'),
68
+                'alt_address_postcode' => array('sugar_key' => 'alt_address_postalcode', 'sugar_label' => '', 'default_label' => 'Home Postcode'),
69
+                'alt_address_city' => array('sugar_key' => 'alt_address_city', 'sugar_label' => '', 'default_label' => 'Home City'),
70
+                'alt_address_state' => array('sugar_key' => 'alt_address_state', 'sugar_label' => '', 'default_label' => 'Home State'),
71
+                'alt_address_country' => array('sugar_key' => 'alt_address_country', 'sugar_label' => '', 'default_label' => 'Home Country'),
72 72
 
73
-             'primary_address_street' => array('sugar_key' => 'primary_address_street', 'sugar_label' => '', 'default_label' => 'Work Street'),
74
-             'primary_address_postcode' => array('sugar_key' => 'primary_address_postalcode', 'sugar_label' => '', 'default_label' => 'Work Postcode'),
75
-             'primary_address_city' => array('sugar_key' => 'primary_address_city', 'sugar_label' => '', 'default_label' => 'Work City'),
76
-             'primary_address_state' => array('sugar_key' => 'primary_address_state', 'sugar_label' => '', 'default_label' => 'Work State'),
77
-             'primary_address_country' => array('sugar_key' => 'primary_address_country', 'sugar_label' => '', 'default_label' => 'Work Country'),
73
+                'primary_address_street' => array('sugar_key' => 'primary_address_street', 'sugar_label' => '', 'default_label' => 'Work Street'),
74
+                'primary_address_postcode' => array('sugar_key' => 'primary_address_postalcode', 'sugar_label' => '', 'default_label' => 'Work Postcode'),
75
+                'primary_address_city' => array('sugar_key' => 'primary_address_city', 'sugar_label' => '', 'default_label' => 'Work City'),
76
+                'primary_address_state' => array('sugar_key' => 'primary_address_state', 'sugar_label' => '', 'default_label' => 'Work State'),
77
+                'primary_address_country' => array('sugar_key' => 'primary_address_country', 'sugar_label' => '', 'default_label' => 'Work Country'),
78 78
 
79
-             'phone_main' => array('sugar_key' => 'phone_other', 'sugar_label' => '', 'default_label' => 'Main Phone'),
80
-             'phone_mobile' => array('sugar_key' => 'phone_mobile', 'sugar_label' => '', 'default_label' => 'Mobile Phone'),
81
-             'phone_home' => array('sugar_key' => 'phone_home', 'sugar_label' => '', 'default_label' => 'Home phone'),
82
-             'phone_work' => array('sugar_key' => 'phone_work', 'sugar_label' => '', 'default_label' => 'Work phone'),
83
-             'phone_fax' => array('sugar_key' => 'phone_fax', 'sugar_label' => '', 'default_label' => 'Fax phone'),
79
+                'phone_main' => array('sugar_key' => 'phone_other', 'sugar_label' => '', 'default_label' => 'Main Phone'),
80
+                'phone_mobile' => array('sugar_key' => 'phone_mobile', 'sugar_label' => '', 'default_label' => 'Mobile Phone'),
81
+                'phone_home' => array('sugar_key' => 'phone_home', 'sugar_label' => '', 'default_label' => 'Home phone'),
82
+                'phone_work' => array('sugar_key' => 'phone_work', 'sugar_label' => '', 'default_label' => 'Work phone'),
83
+                'phone_fax' => array('sugar_key' => 'phone_fax', 'sugar_label' => '', 'default_label' => 'Fax phone'),
84 84
 
85
-             'email1' => array('sugar_key' => 'email1', 'sugar_label' => 'LBL_EMAIL_ADDRESS', 'default_label' => 'Email Address'),
86
-             'email2' => array('sugar_key' => 'email2', 'sugar_label' => 'LBL_OTHER_EMAIL_ADDRESS', 'default_label' => 'Other Email'),
85
+                'email1' => array('sugar_key' => 'email1', 'sugar_label' => 'LBL_EMAIL_ADDRESS', 'default_label' => 'Email Address'),
86
+                'email2' => array('sugar_key' => 'email2', 'sugar_label' => 'LBL_OTHER_EMAIL_ADDRESS', 'default_label' => 'Other Email'),
87 87
 
88
-             'assigned_user_name' => array('sugar_key' => 'assigned_user_name', 'sugar_help_key' => 'LBL_EXTERNAL_ASSIGNED_TOOLTIP', 'sugar_label' => 'LBL_ASSIGNED_TO_NAME', 'default_label' => 'Assigned To'),
89
-             'team_name' => array('sugar_key' => 'team_name', 'sugar_help_key' => 'LBL_EXTERNAL_TEAM_TOOLTIP','sugar_label' => 'LBL_TEAMS', 'default_label' => 'Teams'),
88
+                'assigned_user_name' => array('sugar_key' => 'assigned_user_name', 'sugar_help_key' => 'LBL_EXTERNAL_ASSIGNED_TOOLTIP', 'sugar_label' => 'LBL_ASSIGNED_TO_NAME', 'default_label' => 'Assigned To'),
89
+                'team_name' => array('sugar_key' => 'team_name', 'sugar_help_key' => 'LBL_EXTERNAL_TEAM_TOOLTIP','sugar_label' => 'LBL_TEAMS', 'default_label' => 'Teams'),
90 90
             );
91 91
 
92 92
         if($module == 'Users')
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 3
 /*********************************************************************************
4 4
  * SugarCRM Community Edition is a customer relationship management program developed by
5 5
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -86,13 +86,13 @@  discard block
 block discarded – undo
86 86
              'email2' => array('sugar_key' => 'email2', 'sugar_label' => 'LBL_OTHER_EMAIL_ADDRESS', 'default_label' => 'Other Email'),
87 87
 
88 88
              'assigned_user_name' => array('sugar_key' => 'assigned_user_name', 'sugar_help_key' => 'LBL_EXTERNAL_ASSIGNED_TOOLTIP', 'sugar_label' => 'LBL_ASSIGNED_TO_NAME', 'default_label' => 'Assigned To'),
89
-             'team_name' => array('sugar_key' => 'team_name', 'sugar_help_key' => 'LBL_EXTERNAL_TEAM_TOOLTIP','sugar_label' => 'LBL_TEAMS', 'default_label' => 'Teams'),
89
+             'team_name' => array('sugar_key' => 'team_name', 'sugar_help_key' => 'LBL_EXTERNAL_TEAM_TOOLTIP', 'sugar_label' => 'LBL_TEAMS', 'default_label' => 'Teams'),
90 90
             );
91 91
 
92
-        if($module == 'Users')
92
+        if ($module == 'Users')
93 93
         {
94
-            $return_array['status'] =  array('sugar_key' => 'status', 'sugar_label' => '', 'default_label' => 'Status');
95
-            $return_array['full_name'] =  array('sugar_key' => 'user_name', 'sugar_label' => '', 'default_label' => 'Full Name');
94
+            $return_array['status'] = array('sugar_key' => 'status', 'sugar_label' => '', 'default_label' => 'Status');
95
+            $return_array['full_name'] = array('sugar_key' => 'user_name', 'sugar_label' => '', 'default_label' => 'Full Name');
96 96
         }
97 97
         return $return_array;
98 98
     }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
Please login to merge, or discard this patch.
modules/Import/maps/ImportMapSalesforce.php 4 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -49,11 +49,11 @@  discard block
 block discarded – undo
49 49
 
50 50
 class ImportMapSalesforce extends ImportMapOther
51 51
 {
52
-	/**
52
+    /**
53 53
      * String identifier for this import
54 54
      */
55 55
     public $name = 'salesforce';
56
-	/**
56
+    /**
57 57
      * Field delimiter
58 58
      */
59 59
     public $delimiter = ',';
@@ -61,18 +61,18 @@  discard block
 block discarded – undo
61 61
      * Field enclosure
62 62
      */
63 63
     public $enclosure = '"';
64
-	/**
64
+    /**
65 65
      * Do we have a header?
66 66
      */
67 67
     public $has_header = true;
68 68
 
69
-	/**
69
+    /**
70 70
      * Gets the default mapping for a module
71 71
      *
72 72
      * @param  string $module
73 73
      * @return array field mappings
74 74
      */
75
-	public function getMapping(
75
+    public function getMapping(
76 76
         $module
77 77
         )
78 78
     {
@@ -151,15 +151,15 @@  discard block
 block discarded – undo
151 151
         }
152 152
     }
153 153
 	
154
-	/**
155
-	* @see ImportMapOther::getIgnoredFields()
154
+    /**
155
+     * @see ImportMapOther::getIgnoredFields()
156 156
      */
157
-	public function getIgnoredFields(
158
-		$module
159
-		)
160
-	{
161
-		return array_merge(parent::getIgnoredFields($module),array('id'));
162
-	}
157
+    public function getIgnoredFields(
158
+        $module
159
+        )
160
+    {
161
+        return array_merge(parent::getIgnoredFields($module),array('id'));
162
+    }
163 163
 }
164 164
 
165 165
 
Please login to merge, or discard this patch.
Switch Indentation   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -78,76 +78,76 @@
 block discarded – undo
78 78
     {
79 79
         $return_array = parent::getMapping($module);
80 80
         switch ($module) {
81
-        case 'Contacts':
82
-        case 'Leads':
83
-            return $return_array + array(
84
-                "Description"=>"description",
85
-                "Birthdate"=>"birthdate",
86
-                "Lead Source"=>"lead_source",
87
-                "Assistant"=>"assistant",
88
-                "Asst. Phone"=>"assistant_phone",
89
-                "Mailing Street"=>"primary_address_street",
90
-                "Mailing Address Line1"=>"primary_address_street_2",
91
-                "Mailing Address Line2"=>"primary_address_street_3",
92
-                "Mailing Address Line3"=>"primary_address_street_4",
93
-                "Mailing City"=>"primary_address_city",
94
-                "Mailing State"=>"primary_address_state",
95
-                "Mailing Zip/Postal Code"=>"primary_address_postalcode",
96
-                "Mailing Country"=>"primary_address_country",
97
-                "Other Street"=>"alt_address_street",
98
-                "Other Address Line 1"=>"alt_address_street_2",
99
-                "Other Address Line 2"=>"alt_address_street_3",
100
-                "Other Address Line 3"=>"alt_address_street_4",
101
-                "Other City"=>"alt_address_city",
102
-                "Other State"=>"alt_address_state",
103
-                "Other Zip/Postal Code"=>"alt_address_postalcode",
104
-                "Other Country"=>"alt_address_country",
105
-                "Phone"=>"phone_work",
106
-                "Mobile"=>"phone_mobile",
107
-                "Home Phone"=>"phone_home",
108
-                "Other Phone"=>"phone_other",
109
-                "Fax"=>"phone_fax",
110
-                "Email"=>"email1",
111
-                "Email Opt Out"=>"email_opt_out",
112
-                "Do Not Call"=>"do_not_call",
113
-                "Account Name"=>"account_name",
114
-                );
115
-            break;
116
-        case 'Accounts':
117
-            return array(
118
-                "Account Name"=>"name",
119
-                "Annual Revenue"=>"annual_revenue",
120
-                "Type"=>"account_type",
121
-                "Ticker Symbol"=>"ticker_symbol",
122
-                "Rating"=>"rating",
123
-                "Industry"=>"industry",
124
-                "SIC Code"=>"sic_code",
125
-                "Ownership"=>"ownership",
126
-                "Employees"=>"employees",
127
-                "Description"=>"description",
128
-                "Billing Street"=>"billing_address_street",
129
-                "Billing Address Line1"=>"billing_address_street_2",
130
-                "Billing Address Line2"=>"billing_address_street_3",
131
-                "Billing City"=>"billing_address_city",
132
-                "Billing State"=>"billing_address_state",
133
-                "Billing State/Province"=>"billing_address_state",
134
-                "Billing Zip/Postal Code"=>"billing_address_postalcode",
135
-                "Billing Country"=>"billing_address_country",
136
-                "Shipping Street"=>"shipping_address_street",
137
-                "Shipping Address Line1"=>"shipping_address_street_2",
138
-                "Shipping Address Line2"=>"shipping_address_street_3",
139
-                "Shipping City"=>"shipping_address_city",
140
-                "Shipping State"=>"shipping_address_state",
141
-                "Shipping Zip/Postal Code"=>"shipping_address_postalcode",
142
-                "Shipping Country"=>"shipping_address_country",
143
-                "Phone"=>"phone_office",
144
-                "Fax"=>"phone_fax",
145
-                "Website"=>"website",
146
-                "Created Date"=>"date_entered",
147
-                );
148
-            break;
149
-        default:
150
-            return $return_array;
81
+            case 'Contacts':
82
+            case 'Leads':
83
+                return $return_array + array(
84
+                    "Description"=>"description",
85
+                    "Birthdate"=>"birthdate",
86
+                    "Lead Source"=>"lead_source",
87
+                    "Assistant"=>"assistant",
88
+                    "Asst. Phone"=>"assistant_phone",
89
+                    "Mailing Street"=>"primary_address_street",
90
+                    "Mailing Address Line1"=>"primary_address_street_2",
91
+                    "Mailing Address Line2"=>"primary_address_street_3",
92
+                    "Mailing Address Line3"=>"primary_address_street_4",
93
+                    "Mailing City"=>"primary_address_city",
94
+                    "Mailing State"=>"primary_address_state",
95
+                    "Mailing Zip/Postal Code"=>"primary_address_postalcode",
96
+                    "Mailing Country"=>"primary_address_country",
97
+                    "Other Street"=>"alt_address_street",
98
+                    "Other Address Line 1"=>"alt_address_street_2",
99
+                    "Other Address Line 2"=>"alt_address_street_3",
100
+                    "Other Address Line 3"=>"alt_address_street_4",
101
+                    "Other City"=>"alt_address_city",
102
+                    "Other State"=>"alt_address_state",
103
+                    "Other Zip/Postal Code"=>"alt_address_postalcode",
104
+                    "Other Country"=>"alt_address_country",
105
+                    "Phone"=>"phone_work",
106
+                    "Mobile"=>"phone_mobile",
107
+                    "Home Phone"=>"phone_home",
108
+                    "Other Phone"=>"phone_other",
109
+                    "Fax"=>"phone_fax",
110
+                    "Email"=>"email1",
111
+                    "Email Opt Out"=>"email_opt_out",
112
+                    "Do Not Call"=>"do_not_call",
113
+                    "Account Name"=>"account_name",
114
+                    );
115
+                break;
116
+            case 'Accounts':
117
+                return array(
118
+                    "Account Name"=>"name",
119
+                    "Annual Revenue"=>"annual_revenue",
120
+                    "Type"=>"account_type",
121
+                    "Ticker Symbol"=>"ticker_symbol",
122
+                    "Rating"=>"rating",
123
+                    "Industry"=>"industry",
124
+                    "SIC Code"=>"sic_code",
125
+                    "Ownership"=>"ownership",
126
+                    "Employees"=>"employees",
127
+                    "Description"=>"description",
128
+                    "Billing Street"=>"billing_address_street",
129
+                    "Billing Address Line1"=>"billing_address_street_2",
130
+                    "Billing Address Line2"=>"billing_address_street_3",
131
+                    "Billing City"=>"billing_address_city",
132
+                    "Billing State"=>"billing_address_state",
133
+                    "Billing State/Province"=>"billing_address_state",
134
+                    "Billing Zip/Postal Code"=>"billing_address_postalcode",
135
+                    "Billing Country"=>"billing_address_country",
136
+                    "Shipping Street"=>"shipping_address_street",
137
+                    "Shipping Address Line1"=>"shipping_address_street_2",
138
+                    "Shipping Address Line2"=>"shipping_address_street_3",
139
+                    "Shipping City"=>"shipping_address_city",
140
+                    "Shipping State"=>"shipping_address_state",
141
+                    "Shipping Zip/Postal Code"=>"shipping_address_postalcode",
142
+                    "Shipping Country"=>"shipping_address_country",
143
+                    "Phone"=>"phone_office",
144
+                    "Fax"=>"phone_fax",
145
+                    "Website"=>"website",
146
+                    "Created Date"=>"date_entered",
147
+                    );
148
+                break;
149
+            default:
150
+                return $return_array;
151 151
         }
152 152
     }
153 153
 	
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 3
 /*********************************************************************************
4 4
  * SugarCRM Community Edition is a customer relationship management program developed by
5 5
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 		$module
159 159
 		)
160 160
 	{
161
-		return array_merge(parent::getIgnoredFields($module),array('id'));
161
+		return array_merge(parent::getIgnoredFields($module), array('id'));
162 162
 	}
163 163
 }
164 164
 
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
Please login to merge, or discard this patch.
modules/Import/maps/ImportMapOther.php 4 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -47,11 +47,11 @@  discard block
 block discarded – undo
47 47
 
48 48
 class ImportMapOther
49 49
 {
50
-	/**
50
+    /**
51 51
      * String identifier for this import
52 52
      */
53 53
     public $name = 'other';
54
-	/**
54
+    /**
55 55
      * Field delimiter
56 56
      */
57 57
     public $delimiter;
@@ -59,18 +59,18 @@  discard block
 block discarded – undo
59 59
      * Field enclosure
60 60
      */
61 61
     public $enclosure;
62
-	/**
62
+    /**
63 63
      * Do we have a header?
64 64
      */
65 65
     public $has_header = true;
66 66
 
67
-	/**
67
+    /**
68 68
      * Gets the default mapping for a module
69 69
      *
70 70
      * @param  string $module
71 71
      * @return array field mappings
72 72
      */
73
-	public function getMapping(
73
+    public function getMapping(
74 74
         $module
75 75
         )
76 76
     {
@@ -142,18 +142,18 @@  discard block
 block discarded – undo
142 142
         }
143 143
     }
144 144
 	
145
-	/**
145
+    /**
146 146
      * Returns a list of fields that should be ignorred for the module during import
147 147
      *
148 148
      * @param  string $module
149 149
      * @return array of fields to ignor
150 150
      */
151
-	public function getIgnoredFields(
152
-		$module
153
-		)
154
-	{
155
-		return array();
156
-	}
151
+    public function getIgnoredFields(
152
+        $module
153
+        )
154
+    {
155
+        return array();
156
+    }
157 157
 }
158 158
 
159 159
 
Please login to merge, or discard this patch.
Switch Indentation   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -75,70 +75,70 @@
 block discarded – undo
75 75
         )
76 76
     {
77 77
         switch ($module) {
78
-        case 'Contacts':
79
-        case 'Leads':
80
-            return array(
81
-                "Salutation"=>"salutation",
82
-                "Full Name"=>"full_name",
83
-                "Company"=>"company",
84
-                "First Name"=>"first_name",
85
-                "Last Name"=>"last_name",
86
-                "Title"=>"title",
87
-                "Department"=>"department",
88
-                "Birthday"=>"birthdate",
89
-                "Home Phone"=>"phone_home",
90
-                "Mobile Phone"=>"phone_mobile",
91
-                "Business Phone"=>"phone_work",
92
-                "Other Phone"=>"phone_other",
93
-                "Business Fax"=>"phone_fax",
94
-                "E-mail Address"=>"email1",
95
-                "E-mail 2"=>"email2",
96
-                "Assistant's Name"=>"assistant",
97
-                "Assistant's Phone"=>"assistant_phone",
98
-                "Business Street"=>"primary_address_street",
99
-                "Business Street 2"=>"primary_address_street_2",
100
-                "Business Street 3"=>"primary_address_street_3",
101
-                "Business City"=>"primary_address_city",
102
-                "Business State"=>"primary_address_state",
103
-                "Business Postal Code"=>"primary_address_postalcode",
104
-                "Business Country/Region"=>"primary_address_country",
105
-                "Home Street"=>"alt_address_street",
106
-                "Home Street 2"=>"alt_address_street_2",
107
-                "Home Street 3"=>"alt_address_street_3",
108
-                "Home City"=>"alt_address_city",
109
-                "Home State"=>"alt_address_state",
110
-                "Home Postal Code"=>"alt_address_postalcode",
111
-                "Home Country/Region"=>"alt_address_country",
112
-                );
113
-            break;
114
-        case 'Accounts':
115
-            return array(
116
-                "Company"=>"name",
117
-                "Business Street"=>"billing_address_street",
118
-                "Business City"=>"billing_address_city",
119
-                "Business State"=>"billing_address_state",
120
-                "Business Country"=>"billing_address_country",
121
-                "Business Postal Code"=>"billing_address_postalcode",
122
-                "Business Fax"=>"phone_fax",
123
-                "Company Main Phone"=>"phone_office",
124
-                "Web Page"=>"website",
125
-                );
126
-            break;
127
-        case 'Opportunities':
128
-            return array(
129
-                "Opportunity Name"=>"name" ,
130
-                "Type"=>"opportunity_type",
131
-                "Lead Source"=>"lead_source",
132
-                "Amount"=>"amount",
133
-                "Created Date"=>"date_entered",
134
-                "Close Date"=>"date_closed",
135
-                "Next Step"=>"next_step",
136
-                "Stage"=>"sales_stage",
137
-                "Probability (%)"=>"probability",
138
-                "Account Name"=>"account_name");
139
-            break;
140
-        default:
141
-            return array();
78
+            case 'Contacts':
79
+            case 'Leads':
80
+                return array(
81
+                    "Salutation"=>"salutation",
82
+                    "Full Name"=>"full_name",
83
+                    "Company"=>"company",
84
+                    "First Name"=>"first_name",
85
+                    "Last Name"=>"last_name",
86
+                    "Title"=>"title",
87
+                    "Department"=>"department",
88
+                    "Birthday"=>"birthdate",
89
+                    "Home Phone"=>"phone_home",
90
+                    "Mobile Phone"=>"phone_mobile",
91
+                    "Business Phone"=>"phone_work",
92
+                    "Other Phone"=>"phone_other",
93
+                    "Business Fax"=>"phone_fax",
94
+                    "E-mail Address"=>"email1",
95
+                    "E-mail 2"=>"email2",
96
+                    "Assistant's Name"=>"assistant",
97
+                    "Assistant's Phone"=>"assistant_phone",
98
+                    "Business Street"=>"primary_address_street",
99
+                    "Business Street 2"=>"primary_address_street_2",
100
+                    "Business Street 3"=>"primary_address_street_3",
101
+                    "Business City"=>"primary_address_city",
102
+                    "Business State"=>"primary_address_state",
103
+                    "Business Postal Code"=>"primary_address_postalcode",
104
+                    "Business Country/Region"=>"primary_address_country",
105
+                    "Home Street"=>"alt_address_street",
106
+                    "Home Street 2"=>"alt_address_street_2",
107
+                    "Home Street 3"=>"alt_address_street_3",
108
+                    "Home City"=>"alt_address_city",
109
+                    "Home State"=>"alt_address_state",
110
+                    "Home Postal Code"=>"alt_address_postalcode",
111
+                    "Home Country/Region"=>"alt_address_country",
112
+                    );
113
+                break;
114
+            case 'Accounts':
115
+                return array(
116
+                    "Company"=>"name",
117
+                    "Business Street"=>"billing_address_street",
118
+                    "Business City"=>"billing_address_city",
119
+                    "Business State"=>"billing_address_state",
120
+                    "Business Country"=>"billing_address_country",
121
+                    "Business Postal Code"=>"billing_address_postalcode",
122
+                    "Business Fax"=>"phone_fax",
123
+                    "Company Main Phone"=>"phone_office",
124
+                    "Web Page"=>"website",
125
+                    );
126
+                break;
127
+            case 'Opportunities':
128
+                return array(
129
+                    "Opportunity Name"=>"name" ,
130
+                    "Type"=>"opportunity_type",
131
+                    "Lead Source"=>"lead_source",
132
+                    "Amount"=>"amount",
133
+                    "Created Date"=>"date_entered",
134
+                    "Close Date"=>"date_closed",
135
+                    "Next Step"=>"next_step",
136
+                    "Stage"=>"sales_stage",
137
+                    "Probability (%)"=>"probability",
138
+                    "Account Name"=>"account_name");
139
+                break;
140
+            default:
141
+                return array();
142 142
         }
143 143
     }
144 144
 	
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 3
 /*********************************************************************************
4 4
  * SugarCRM Community Edition is a customer relationship management program developed by
5 5
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
             break;
127 127
         case 'Opportunities':
128 128
             return array(
129
-                "Opportunity Name"=>"name" ,
129
+                "Opportunity Name"=>"name",
130 130
                 "Type"=>"opportunity_type",
131 131
                 "Lead Source"=>"lead_source",
132 132
                 "Amount"=>"amount",
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
Please login to merge, or discard this patch.
modules/Import/maps/ImportMap.php 3 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -175,19 +175,19 @@  discard block
 block discarded – undo
175 175
      * @see SugarBean::retrieve()
176 176
      */
177 177
     public function retrieve($id = -1, $encode=true,$deleted=true)
178
-	{
179
-	    $returnVal = parent::retrieve($id,$encode,$deleted);
178
+    {
179
+        $returnVal = parent::retrieve($id,$encode,$deleted);
180 180
 
181
-	    if ( !($returnVal instanceOf $this) ) {
182
-	        return $returnVal;
183
-	    }
181
+        if ( !($returnVal instanceOf $this) ) {
182
+            return $returnVal;
183
+        }
184 184
 
185
-	    if ( $this->source == 'tab' && $this->delimiter == '' ) {
186
-	        $this->delimiter = "\t";
187
-	    }
185
+        if ( $this->source == 'tab' && $this->delimiter == '' ) {
186
+            $this->delimiter = "\t";
187
+        }
188 188
 
189
-	    return $this;
190
-	}
189
+        return $this;
190
+    }
191 191
 
192 192
     /**
193 193
      * Save
@@ -372,10 +372,10 @@  discard block
 block discarded – undo
372 372
         //list of field values we track during import wizard
373 373
         $import_step_fields = array(
374 374
         //step1
375
-          //  'import_module', 'source', 'custom_enclosure', 'custom_enclosure_other', 'custom_delimiter', 'type',
375
+            //  'import_module', 'source', 'custom_enclosure', 'custom_enclosure_other', 'custom_delimiter', 'type',
376 376
         //step2
377
-           // 'custom_delimiter', 'custom_enclosure', 'type', 'source', 'source_id', 'import_module', 'has_header',
378
-         //step3
377
+            // 'custom_delimiter', 'custom_enclosure', 'type', 'source', 'source_id', 'import_module', 'has_header',
378
+            //step3
379 379
             'display_tabs_def','custom_delimiter', 'custom_enclosure', 'import_type', 'source', 'source_id', 'import_module', 'has_header', 'importlocale_charset',
380 380
             'importlocale_dateformat', 'importlocale_timeformat', 'importlocale_timezone', 'importlocale_currency',
381 381
             'importlocale_default_currency_significant_digits', 'importlocale_num_grp_sep', 'importlocale_dec_sep',
Please login to merge, or discard this patch.
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 3
 /*********************************************************************************
4 4
  * SugarCRM Community Edition is a customer relationship management program developed by
5 5
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -107,11 +107,11 @@  discard block
 block discarded – undo
107 107
     public function getMapping()
108 108
     {
109 109
         $mapping_arr = array();
110
-        if ( !empty($this->content) )
110
+        if (!empty($this->content))
111 111
         {
112
-            $pairs = explode("&",$this->content);
113
-            foreach ($pairs as $pair){
114
-                list($name,$value) = explode("=",$pair);
112
+            $pairs = explode("&", $this->content);
113
+            foreach ($pairs as $pair) {
114
+                list($name, $value) = explode("=", $pair);
115 115
                 $mapping_arr[trim($name)] = $value;
116 116
             }
117 117
         }
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
         $mapping_arr
129 129
         )
130 130
     {
131
-        $output = array ();
131
+        $output = array();
132 132
         foreach ($mapping_arr as $key => $item) {
133 133
             $output[] = "$key=$item";
134 134
         }
@@ -143,11 +143,11 @@  discard block
 block discarded – undo
143 143
     public function getDefaultValues()
144 144
     {
145 145
         $defa_arr = array();
146
-        if ( !empty($this->default_values) )
146
+        if (!empty($this->default_values))
147 147
         {
148
-            $pairs = explode("&",$this->default_values);
149
-            foreach ($pairs as $pair){
150
-                list($name,$value) = explode("=",$pair);
148
+            $pairs = explode("&", $this->default_values);
149
+            foreach ($pairs as $pair) {
150
+                list($name, $value) = explode("=", $pair);
151 151
                 $defa_arr[trim($name)] = $value;
152 152
             }
153 153
         }
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
         $defa_arr
165 165
         )
166 166
     {
167
-        $output = array ();
167
+        $output = array();
168 168
         foreach ($defa_arr as $key => $item) {
169 169
             $output[] = "$key=$item";
170 170
         }
@@ -174,15 +174,15 @@  discard block
 block discarded – undo
174 174
     /**
175 175
      * @see SugarBean::retrieve()
176 176
      */
177
-    public function retrieve($id = -1, $encode=true,$deleted=true)
177
+    public function retrieve($id = -1, $encode = true, $deleted = true)
178 178
 	{
179
-	    $returnVal = parent::retrieve($id,$encode,$deleted);
179
+	    $returnVal = parent::retrieve($id, $encode, $deleted);
180 180
 
181
-	    if ( !($returnVal instanceOf $this) ) {
181
+	    if (!($returnVal instanceOf $this)) {
182 182
 	        return $returnVal;
183 183
 	    }
184 184
 
185
-	    if ( $this->source == 'tab' && $this->delimiter == '' ) {
185
+	    if ($this->source == 'tab' && $this->delimiter == '') {
186 186
 	        $this->delimiter = "\t";
187 187
 	    }
188 188
 
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 
228 228
         // Bug 23354 - Make sure enclosure gets saved as an empty string if
229 229
         // it is an empty string, instead of as a null
230
-        if ( strlen($enclosure) <= 0 ) $enclosure = ' ';
230
+        if (strlen($enclosure) <= 0) $enclosure = ' ';
231 231
 
232 232
         $this->assigned_user_id = $owner_id;
233 233
         $this->name             = $name;
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
         parent::save();
243 243
 
244 244
         // Bug 29365 - The enclosure character isn't saved correctly if it's a tab using MssqlManager, so resave it
245
-        if ( $enclosure == '\\t' && $this->db instanceOf MssqlManager ) {
245
+        if ($enclosure == '\\t' && $this->db instanceOf MssqlManager) {
246 246
             $this->enclosure = $enclosure;
247 247
             parent::save();
248 248
         }
@@ -262,11 +262,11 @@  discard block
 block discarded – undo
262 262
     {
263 263
         global $current_user;
264 264
 
265
-        if ( !is_admin($current_user) ) {
265
+        if (!is_admin($current_user)) {
266 266
             $other_map = new ImportMap();
267 267
             $other_map->retrieve_by_string_fields(array('id'=> $id), false);
268 268
 
269
-            if ( $other_map->assigned_user_id != $current_user->id )
269
+            if ($other_map->assigned_user_id != $current_user->id)
270 270
                 return false;
271 271
         }
272 272
 
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
     {
288 288
         global $current_user;
289 289
 
290
-        if ( !is_admin($current_user) )
290
+        if (!is_admin($current_user))
291 291
             return false;
292 292
 
293 293
         // check for problems
@@ -313,16 +313,16 @@  discard block
 block discarded – undo
313 313
         $other_map->retrieve_by_string_fields($query_arr, false);
314 314
 
315 315
         // if we find this other map, quit
316
-        if ( isset($other_map->id) )
316
+        if (isset($other_map->id))
317 317
             return false;
318 318
 
319 319
         // otherwise update the is_published flag
320 320
         $query = "UPDATE $this->table_name
321
-                    SET is_published = '". ($flag?'yes':'no') . "',
321
+                    SET is_published = '".($flag ? 'yes' : 'no')."',
322 322
                         assigned_user_id = '$user_id'
323 323
                     WHERE id = '{$this->id}'";
324 324
 
325
-        $this->db->query($query,true,"Error marking import map published: ");
325
+        $this->db->query($query, true, "Error marking import map published: ");
326 326
 
327 327
         return true;
328 328
     }
@@ -339,21 +339,21 @@  discard block
 block discarded – undo
339 339
     {
340 340
         $query = "SELECT *
341 341
                     FROM {$this->table_name}
342
-                    " . $this->get_where($fields_array);
342
+                    ".$this->get_where($fields_array);
343 343
 
344
-        $result = $this->db->query($query,true," Error: ");
344
+        $result = $this->db->query($query, true, " Error: ");
345 345
         $obj_arr = array();
346 346
 
347
-        while ($row = $this->db->fetchByAssoc($result,FALSE) ) {
347
+        while ($row = $this->db->fetchByAssoc($result, FALSE)) {
348 348
             $focus = new ImportMap();
349 349
 
350
-            foreach($this->column_fields as $field) {
351
-                if(isset($row[$field])) {
350
+            foreach ($this->column_fields as $field) {
351
+                if (isset($row[$field])) {
352 352
                     $focus->$field = $row[$field];
353 353
                 }
354 354
             }
355 355
             $focus->fill_in_additional_detail_fields();
356
-            $obj_arr[]=$focus;
356
+            $obj_arr[] = $focus;
357 357
         }
358 358
 
359 359
         return $obj_arr;
@@ -376,37 +376,37 @@  discard block
 block discarded – undo
376 376
         //step2
377 377
            // 'custom_delimiter', 'custom_enclosure', 'type', 'source', 'source_id', 'import_module', 'has_header',
378 378
          //step3
379
-            'display_tabs_def','custom_delimiter', 'custom_enclosure', 'import_type', 'source', 'source_id', 'import_module', 'has_header', 'importlocale_charset',
379
+            'display_tabs_def', 'custom_delimiter', 'custom_enclosure', 'import_type', 'source', 'source_id', 'import_module', 'has_header', 'importlocale_charset',
380 380
             'importlocale_dateformat', 'importlocale_timeformat', 'importlocale_timezone', 'importlocale_currency',
381 381
             'importlocale_default_currency_significant_digits', 'importlocale_num_grp_sep', 'importlocale_dec_sep',
382 382
         '   importlocale_default_locale_name_format');
383 383
 
384 384
         //retrieve user preferences and populate preference array
385 385
         $preference_values_str = $current_user->getPreference('field_values', 'import');
386
-        $preference_values = json_decode($preference_values_str,true);
386
+        $preference_values = json_decode($preference_values_str, true);
387 387
 
388
-        foreach ($import_step_fields as $val){
388
+        foreach ($import_step_fields as $val) {
389 389
             //overwrite preference array with new values from request if the value is different or new
390
-            if((isset($_REQUEST[$val]) && !isset($preference_values[$val])) || (isset($_REQUEST[$val]) && $preference_values[$val] != $_REQUEST[$val])){
390
+            if ((isset($_REQUEST[$val]) && !isset($preference_values[$val])) || (isset($_REQUEST[$val]) && $preference_values[$val] != $_REQUEST[$val])) {
391 391
                 $preference_values[$val] = $_REQUEST[$val];
392 392
                 $set = true;
393 393
             }
394 394
         }
395 395
 
396 396
         //force the values to passed in array if array is set
397
-        if(!empty($ForceValsArr) && is_array($ForceValsArr)){
398
-            foreach ($ForceValsArr as $forceKey=>$forceVal){
397
+        if (!empty($ForceValsArr) && is_array($ForceValsArr)) {
398
+            foreach ($ForceValsArr as $forceKey=>$forceVal) {
399 399
                 $preference_values[$forceKey] = $forceVal;
400 400
                 $set = true;
401 401
             }
402 402
         }
403 403
 
404 404
         //set preferences if any changes were made and return the new array
405
-        if($set){
406
-            $preference_values_str =  json_encode($preference_values);
405
+        if ($set) {
406
+            $preference_values_str = json_encode($preference_values);
407 407
             $current_user->setPreference('field_values', $preference_values_str, 0, 'import');
408 408
         }
409
-        if(empty($preference_values)){
409
+        if (empty($preference_values)) {
410 410
             return array();
411 411
         }
412 412
 
Please login to merge, or discard this patch.
Braces   +16 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -227,7 +229,9 @@  discard block
 block discarded – undo
227 229
 
228 230
         // Bug 23354 - Make sure enclosure gets saved as an empty string if
229 231
         // it is an empty string, instead of as a null
230
-        if ( strlen($enclosure) <= 0 ) $enclosure = ' ';
232
+        if ( strlen($enclosure) <= 0 ) {
233
+            $enclosure = ' ';
234
+        }
231 235
 
232 236
         $this->assigned_user_id = $owner_id;
233 237
         $this->name             = $name;
@@ -266,8 +270,9 @@  discard block
 block discarded – undo
266 270
             $other_map = new ImportMap();
267 271
             $other_map->retrieve_by_string_fields(array('id'=> $id), false);
268 272
 
269
-            if ( $other_map->assigned_user_id != $current_user->id )
270
-                return false;
273
+            if ( $other_map->assigned_user_id != $current_user->id ) {
274
+                            return false;
275
+            }
271 276
         }
272 277
 
273 278
         return parent::mark_deleted($id);
@@ -287,8 +292,9 @@  discard block
 block discarded – undo
287 292
     {
288 293
         global $current_user;
289 294
 
290
-        if ( !is_admin($current_user) )
291
-            return false;
295
+        if ( !is_admin($current_user) ) {
296
+                    return false;
297
+        }
292 298
 
293 299
         // check for problems
294 300
         if ($flag) {
@@ -299,8 +305,7 @@  discard block
 block discarded – undo
299 305
                 'name'         =>$this->name,
300 306
                 'is_published' =>'yes'
301 307
                 );
302
-        }
303
-        else {
308
+        } else {
304 309
             // if you are trying to unpublish a map
305 310
             // but you own an unpublished map by the same name
306 311
             $query_arr = array(
@@ -313,8 +318,9 @@  discard block
 block discarded – undo
313 318
         $other_map->retrieve_by_string_fields($query_arr, false);
314 319
 
315 320
         // if we find this other map, quit
316
-        if ( isset($other_map->id) )
317
-            return false;
321
+        if ( isset($other_map->id) ) {
322
+                    return false;
323
+        }
318 324
 
319 325
         // otherwise update the is_published flag
320 326
         $query = "UPDATE $this->table_name
Please login to merge, or discard this patch.