Completed
Push — console-installer ( 3d54e5...e2b50d )
by Adam
69:10 queued 48:24
created
modules/ModuleBuilder/views/view.modulelabels.php 2 patches
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -48,60 +48,60 @@
 block discarded – undo
48 48
 
49 49
 class ViewModulelabels extends SugarView
50 50
 {
51
- 	/**
52
-	 * @see SugarView::_getModuleTitleParams()
53
-	 */
54
-	protected function _getModuleTitleParams($browserTitle = false)
55
-	{
56
-	    global $mod_strings;
51
+        /**
52
+         * @see SugarView::_getModuleTitleParams()
53
+         */
54
+    protected function _getModuleTitleParams($browserTitle = false)
55
+    {
56
+        global $mod_strings;
57 57
 	    
58
-    	return array(
59
-    	   translate('LBL_MODULE_NAME','Administration'),
60
-    	   ModuleBuilderController::getModuleTitle(),
61
-    	   );
58
+        return array(
59
+            translate('LBL_MODULE_NAME','Administration'),
60
+            ModuleBuilderController::getModuleTitle(),
61
+            );
62 62
     }
63 63
 
64
-	function display()
65
-	{
66
- 		global $mod_strings;
64
+    function display()
65
+    {
66
+            global $mod_strings;
67 67
         $bak_mod_strings=$mod_strings;
68
- 		$smarty = new Sugar_Smarty();
68
+            $smarty = new Sugar_Smarty();
69 69
         $smarty->assign('mod_strings', $mod_strings);
70
- 		$package_name = $_REQUEST['view_package'];
71
- 		$module_name = $_REQUEST['view_module'];
70
+            $package_name = $_REQUEST['view_package'];
71
+            $module_name = $_REQUEST['view_module'];
72 72
 
73
-		require_once('modules/ModuleBuilder/MB/ModuleBuilder.php');
74
-		$mb = new ModuleBuilder();
75
-		$mb->getPackage($_REQUEST['view_package']);
76
-		$package = $mb->packages[$_REQUEST['view_package']];
77
-		$package->getModule($module_name);
78
-		$mbModule = $package->modules[$module_name];
79
-		$selected_lang = (!empty($_REQUEST['selected_lang'])?$_REQUEST['selected_lang']:$_SESSION['authenticated_user_language']);
80
-		if(empty($selected_lang)){
81
-	    	$selected_lang = $GLOBALS['sugar_config']['default_language'];
82
-		}
83
-	        //need to change the following to interface with MBlanguage.
73
+        require_once('modules/ModuleBuilder/MB/ModuleBuilder.php');
74
+        $mb = new ModuleBuilder();
75
+        $mb->getPackage($_REQUEST['view_package']);
76
+        $package = $mb->packages[$_REQUEST['view_package']];
77
+        $package->getModule($module_name);
78
+        $mbModule = $package->modules[$module_name];
79
+        $selected_lang = (!empty($_REQUEST['selected_lang'])?$_REQUEST['selected_lang']:$_SESSION['authenticated_user_language']);
80
+        if(empty($selected_lang)){
81
+            $selected_lang = $GLOBALS['sugar_config']['default_language'];
82
+        }
83
+            //need to change the following to interface with MBlanguage.
84 84
 
85 85
         $smarty->assign('MOD', $mbModule->getModStrings($selected_lang));
86
-		$smarty->assign('APP', $GLOBALS['app_strings']);
87
-		$smarty->assign('selected_lang', $selected_lang);
88
-		$smarty->assign('view_package', $package_name);
89
-		$smarty->assign('view_module', $module_name);
90
-		$smarty->assign('mb','1');
91
-		$smarty->assign('available_languages', get_languages());
92
-		///////////////////////////////////////////////////////////////////
93
- 		////ASSISTANT
94
- 		$smarty->assign('assistant',array('group'=>'module', 'key'=>'labels'));
95
-		/////////////////////////////////////////////////////////////////
96
-	 	////ASSISTANT
86
+        $smarty->assign('APP', $GLOBALS['app_strings']);
87
+        $smarty->assign('selected_lang', $selected_lang);
88
+        $smarty->assign('view_package', $package_name);
89
+        $smarty->assign('view_module', $module_name);
90
+        $smarty->assign('mb','1');
91
+        $smarty->assign('available_languages', get_languages());
92
+        ///////////////////////////////////////////////////////////////////
93
+            ////ASSISTANT
94
+            $smarty->assign('assistant',array('group'=>'module', 'key'=>'labels'));
95
+        /////////////////////////////////////////////////////////////////
96
+            ////ASSISTANT
97 97
 
98
-		$ajax = new AjaxCompose();
99
-		$ajax->addCrumb($bak_mod_strings['LBL_MODULEBUILDER'], 'ModuleBuilder.main("mb")');
100
-		$ajax->addCrumb($package_name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$package->name. '")');
98
+        $ajax = new AjaxCompose();
99
+        $ajax->addCrumb($bak_mod_strings['LBL_MODULEBUILDER'], 'ModuleBuilder.main("mb")');
100
+        $ajax->addCrumb($package_name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$package->name. '")');
101 101
         $ajax->addCrumb($module_name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package='.$package->name.'&view_module='. $module_name . '")');
102 102
         $ajax->addCrumb($bak_mod_strings['LBL_LABELS'], '');
103
-		$ajax->addSection('center', $bak_mod_strings['LBL_LABELS'],$smarty->fetch('modules/ModuleBuilder/tpls/labels.tpl'));
104
-		echo $ajax->getJavascript();
105
-	}
103
+        $ajax->addSection('center', $bak_mod_strings['LBL_LABELS'],$smarty->fetch('modules/ModuleBuilder/tpls/labels.tpl'));
104
+        echo $ajax->getJavascript();
105
+    }
106 106
 }
107 107
 
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	    global $mod_strings;
57 57
 	    
58 58
     	return array(
59
-    	   translate('LBL_MODULE_NAME','Administration'),
59
+    	   translate('LBL_MODULE_NAME', 'Administration'),
60 60
     	   ModuleBuilderController::getModuleTitle(),
61 61
     	   );
62 62
     }
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	function display()
65 65
 	{
66 66
  		global $mod_strings;
67
-        $bak_mod_strings=$mod_strings;
67
+        $bak_mod_strings = $mod_strings;
68 68
  		$smarty = new Sugar_Smarty();
69 69
         $smarty->assign('mod_strings', $mod_strings);
70 70
  		$package_name = $_REQUEST['view_package'];
@@ -76,8 +76,8 @@  discard block
 block discarded – undo
76 76
 		$package = $mb->packages[$_REQUEST['view_package']];
77 77
 		$package->getModule($module_name);
78 78
 		$mbModule = $package->modules[$module_name];
79
-		$selected_lang = (!empty($_REQUEST['selected_lang'])?$_REQUEST['selected_lang']:$_SESSION['authenticated_user_language']);
80
-		if(empty($selected_lang)){
79
+		$selected_lang = (!empty($_REQUEST['selected_lang']) ? $_REQUEST['selected_lang'] : $_SESSION['authenticated_user_language']);
80
+		if (empty($selected_lang)) {
81 81
 	    	$selected_lang = $GLOBALS['sugar_config']['default_language'];
82 82
 		}
83 83
 	        //need to change the following to interface with MBlanguage.
@@ -87,20 +87,20 @@  discard block
 block discarded – undo
87 87
 		$smarty->assign('selected_lang', $selected_lang);
88 88
 		$smarty->assign('view_package', $package_name);
89 89
 		$smarty->assign('view_module', $module_name);
90
-		$smarty->assign('mb','1');
90
+		$smarty->assign('mb', '1');
91 91
 		$smarty->assign('available_languages', get_languages());
92 92
 		///////////////////////////////////////////////////////////////////
93 93
  		////ASSISTANT
94
- 		$smarty->assign('assistant',array('group'=>'module', 'key'=>'labels'));
94
+ 		$smarty->assign('assistant', array('group'=>'module', 'key'=>'labels'));
95 95
 		/////////////////////////////////////////////////////////////////
96 96
 	 	////ASSISTANT
97 97
 
98 98
 		$ajax = new AjaxCompose();
99 99
 		$ajax->addCrumb($bak_mod_strings['LBL_MODULEBUILDER'], 'ModuleBuilder.main("mb")');
100
-		$ajax->addCrumb($package_name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$package->name. '")');
101
-        $ajax->addCrumb($module_name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package='.$package->name.'&view_module='. $module_name . '")');
100
+		$ajax->addCrumb($package_name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$package->name.'")');
101
+        $ajax->addCrumb($module_name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package='.$package->name.'&view_module='.$module_name.'")');
102 102
         $ajax->addCrumb($bak_mod_strings['LBL_LABELS'], '');
103
-		$ajax->addSection('center', $bak_mod_strings['LBL_LABELS'],$smarty->fetch('modules/ModuleBuilder/tpls/labels.tpl'));
103
+		$ajax->addSection('center', $bak_mod_strings['LBL_LABELS'], $smarty->fetch('modules/ModuleBuilder/tpls/labels.tpl'));
104 104
 		echo $ajax->getJavascript();
105 105
 	}
106 106
 }
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.history.php 3 patches
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -47,19 +47,19 @@  discard block
 block discarded – undo
47 47
     var $pageSize = 10 ;
48 48
 
49 49
     /**
50
-	 * @see SugarView::_getModuleTitleParams()
51
-	 */
52
-	protected function _getModuleTitleParams($browserTitle = false)
53
-	{
54
-	    global $mod_strings;
50
+     * @see SugarView::_getModuleTitleParams()
51
+     */
52
+    protected function _getModuleTitleParams($browserTitle = false)
53
+    {
54
+        global $mod_strings;
55 55
 	    
56
-    	return array(
57
-    	   translate('LBL_MODULE_NAME','Administration'),
58
-    	   ModuleBuilderController::getModuleTitle(),
59
-    	   );
56
+        return array(
57
+            translate('LBL_MODULE_NAME','Administration'),
58
+            ModuleBuilderController::getModuleTitle(),
59
+            );
60 60
     }
61 61
 
62
-	function display ()
62
+    function display ()
63 63
     {
64 64
         $this->layout = strtolower ( $_REQUEST [ 'view' ] ) ;
65 65
         
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
         }
136 136
         echo "<input type='button' name='close$sid' value='". translate ( 'LBL_BTN_CLOSE' )."' " . 
137 137
                 "class='button' onclick='ModuleBuilder.tabPanel.removeTab(ModuleBuilder.tabPanel.get(\"activeTab\"));' style='margin:5px;'>" . 
138
-             "<input type='button' name='restore$sid' value='" . translate ( 'LBL_MB_RESTORE' ) . "' " .  
138
+                "<input type='button' name='restore$sid' value='" . translate ( 'LBL_MB_RESTORE' ) . "' " .  
139 139
                 "class='button' onclick='ModuleBuilder.history.revert(\"$this->module\",\"{$this->layout}\",\"$sid\"$subpanel);' style='margin:5px;'>" ;
140 140
         $this->history->restoreByTimestamp ( $sid ) ;
141 141
         $view ;
@@ -149,12 +149,12 @@  discard block
 block discarded – undo
149 149
             $view = new ViewSearchView ( ) ;
150 150
         } else if ($this->layout == 'dashlet' || $this->layout == 'dashletsearch')
151 151
         {
152
-        	require_once ("modules/ModuleBuilder/views/view.dashlet.php") ;
153
-        	$view = new ViewDashlet ( ) ;
152
+            require_once ("modules/ModuleBuilder/views/view.dashlet.php") ;
153
+            $view = new ViewDashlet ( ) ;
154 154
         }  else if ($this->layout == 'popuplist' || $this->layout == 'popupsearch')
155 155
         {
156
-        	require_once ("modules/ModuleBuilder/views/view.popupview.php") ;
157
-        	$view = new ViewPopupview ( ) ;
156
+            require_once ("modules/ModuleBuilder/views/view.popupview.php") ;
157
+            $view = new ViewPopupview ( ) ;
158 158
         } else
159 159
         {
160 160
             require_once ("modules/ModuleBuilder/views/view.layoutview.php") ;
@@ -175,12 +175,12 @@  discard block
 block discarded – undo
175 175
         $this->history->restoreByTimestamp ( $sid ) ;
176 176
     }
177 177
 
178
-	/**
179
- 	 * Restores a layout to its current customized state. 
180
- 	 * Called when leaving a restored layout without saving.
181
- 	 */
178
+    /**
179
+     * Restores a layout to its current customized state. 
180
+     * Called when leaving a restored layout without saving.
181
+     */
182 182
     function unrestore() 
183 183
     {
184
-    	$this->history->undoRestore () ;
184
+        $this->history->undoRestore () ;
185 185
     }
186 186
 }
Please login to merge, or discard this patch.
Spacing   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -38,13 +38,13 @@  discard block
 block discarded – undo
38 38
  ********************************************************************************/
39 39
 
40 40
 
41
-require_once ('modules/ModuleBuilder/MB/AjaxCompose.php') ;
42
-require_once ('modules/ModuleBuilder/parsers/views/History.php') ;
43
-require_once ('modules/ModuleBuilder/parsers/ParserFactory.php') ;
41
+require_once ('modules/ModuleBuilder/MB/AjaxCompose.php');
42
+require_once ('modules/ModuleBuilder/parsers/views/History.php');
43
+require_once ('modules/ModuleBuilder/parsers/ParserFactory.php');
44 44
 
45 45
 class ViewHistory extends SugarView
46 46
 {
47
-    var $pageSize = 10 ;
47
+    var $pageSize = 10;
48 48
 
49 49
     /**
50 50
 	 * @see SugarView::_getModuleTitleParams()
@@ -54,125 +54,125 @@  discard block
 block discarded – undo
54 54
 	    global $mod_strings;
55 55
 	    
56 56
     	return array(
57
-    	   translate('LBL_MODULE_NAME','Administration'),
57
+    	   translate('LBL_MODULE_NAME', 'Administration'),
58 58
     	   ModuleBuilderController::getModuleTitle(),
59 59
     	   );
60 60
     }
61 61
 
62
-	function display ()
62
+	function display()
63 63
     {
64
-        $this->layout = strtolower ( $_REQUEST [ 'view' ] ) ;
64
+        $this->layout = strtolower($_REQUEST ['view']);
65 65
         
66
-        $subpanelName = null ;
67
-        if ((strtolower ( $this->layout ) == 'listview') && (!empty ( $_REQUEST [ 'subpanel' ] )))
66
+        $subpanelName = null;
67
+        if ((strtolower($this->layout) == 'listview') && (!empty ($_REQUEST ['subpanel'])))
68 68
         {
69
-            $subpanelName = $_REQUEST [ 'subpanel' ] ;
69
+            $subpanelName = $_REQUEST ['subpanel'];
70 70
             
71 71
         }
72 72
         
73
-        $packageName = (isset ( $_REQUEST [ 'view_package' ] ) && (strtolower ( $_REQUEST [ 'view_package' ] ) != 'studio')) ? $_REQUEST [ 'view_package' ] : null ;
74
-        $this->module = $_REQUEST [ 'view_module' ] ;
73
+        $packageName = (isset ($_REQUEST ['view_package']) && (strtolower($_REQUEST ['view_package']) != 'studio')) ? $_REQUEST ['view_package'] : null;
74
+        $this->module = $_REQUEST ['view_module'];
75 75
         
76
-        $this->parser = ParserFactory::getParser ( $this->layout, $this->module, $packageName, $subpanelName ) ;
77
-        $this->history = $this->parser->getHistory () ;
78
-        $action = ! empty ( $_REQUEST [ 'histAction' ] ) ? $_REQUEST [ 'histAction' ] : 'browse' ;
79
-        $GLOBALS['log']->debug( get_class($this)."->display(): performing History action {$action}" ) ;
80
-        $this->$action () ;
76
+        $this->parser = ParserFactory::getParser($this->layout, $this->module, $packageName, $subpanelName);
77
+        $this->history = $this->parser->getHistory();
78
+        $action = !empty ($_REQUEST ['histAction']) ? $_REQUEST ['histAction'] : 'browse';
79
+        $GLOBALS['log']->debug(get_class($this)."->display(): performing History action {$action}");
80
+        $this->$action();
81 81
     }
82 82
 
83
-    function browse ()
83
+    function browse()
84 84
     {
85
-        $smarty = new Sugar_Smarty ( ) ;
86
-        global $mod_strings ;
87
-        $smarty->assign ( 'mod_strings', $mod_strings ) ;
88
-        $smarty->assign ( 'view_module', $this->module ) ;
89
-        $smarty->assign ( 'view', $this->layout ) ;
85
+        $smarty = new Sugar_Smarty( );
86
+        global $mod_strings;
87
+        $smarty->assign('mod_strings', $mod_strings);
88
+        $smarty->assign('view_module', $this->module);
89
+        $smarty->assign('view', $this->layout);
90 90
         
91
-        if (! empty ( $_REQUEST [ 'subpanel' ] ))
91
+        if (!empty ($_REQUEST ['subpanel']))
92 92
         {
93
-            $smarty->assign ( 'subpanel', $_REQUEST [ 'subpanel' ] ) ;
93
+            $smarty->assign('subpanel', $_REQUEST ['subpanel']);
94 94
         }
95
-        $stamps = array ( ) ;
96
-        global $timedate ;
97
-        $userFormat = $timedate->get_date_time_format () ;
98
-        $page = ! empty ( $_REQUEST [ 'page' ] ) ? $_REQUEST [ 'page' ] : 0 ;
95
+        $stamps = array( );
96
+        global $timedate;
97
+        $userFormat = $timedate->get_date_time_format();
98
+        $page = !empty ($_REQUEST ['page']) ? $_REQUEST ['page'] : 0;
99 99
         $count = $this->history->getCount();
100
-        $ts = $this->history->getNth ( $page * $this->pageSize ) ;
101
-        $snapshots = array ( ) ;
102
-        for ( $i = 0 ; $i <= $this->pageSize && $ts > 0 ; $i ++ )
100
+        $ts = $this->history->getNth($page * $this->pageSize);
101
+        $snapshots = array( );
102
+        for ($i = 0; $i <= $this->pageSize && $ts > 0; $i++)
103 103
         {
104 104
             $dbDate = $timedate->fromTimestamp($ts)->asDb();
105
-            $displayTS = $timedate->to_display_date_time ( $dbDate ) ;
105
+            $displayTS = $timedate->to_display_date_time($dbDate);
106 106
             if ($page * $this->pageSize + $i + 1 == $count)
107 107
                 $displayTS = translate("LBL_MB_DEFAULT_LAYOUT");
108
-            $snapshots [ $ts ] = $displayTS ;
109
-            $ts = $this->history->getNext () ;
108
+            $snapshots [$ts] = $displayTS;
109
+            $ts = $this->history->getNext();
110 110
         }
111
-        if (count ( $snapshots ) > $this->pageSize)
111
+        if (count($snapshots) > $this->pageSize)
112 112
         {
113
-            $smarty->assign ( 'nextPage', true ) ;
113
+            $smarty->assign('nextPage', true);
114 114
         }
115
-        $snapshots = array_slice ( $snapshots, 0, $this->pageSize, true ) ;
116
-        $smarty->assign ( 'currentPage', $page ) ;
117
-        $smarty->assign ( 'snapshots', $snapshots ) ;
115
+        $snapshots = array_slice($snapshots, 0, $this->pageSize, true);
116
+        $smarty->assign('currentPage', $page);
117
+        $smarty->assign('snapshots', $snapshots);
118 118
         
119
-        $html = $smarty->fetch ( 'modules/ModuleBuilder/tpls/history.tpl' ) ;
120
-        echo $html ;
119
+        $html = $smarty->fetch('modules/ModuleBuilder/tpls/history.tpl');
120
+        echo $html;
121 121
     }
122 122
 
123
-    function preview ()
123
+    function preview()
124 124
     {
125
-        global $mod_strings ;
126
-        if (! isset ( $_REQUEST [ 'sid' ] ))
125
+        global $mod_strings;
126
+        if (!isset ($_REQUEST ['sid']))
127 127
         {
128
-            die ( 'SID Required' ) ;
128
+            die ('SID Required');
129 129
         }
130
-        $sid = $_REQUEST [ 'sid' ] ;
130
+        $sid = $_REQUEST ['sid'];
131 131
         $subpanel = '';
132
-        if (! empty ( $_REQUEST [ 'subpanel' ] ))
132
+        if (!empty ($_REQUEST ['subpanel']))
133 133
         {
134
-            $subpanel = ',"' . $_REQUEST [ 'subpanel' ] . '"' ;
134
+            $subpanel = ',"'.$_REQUEST ['subpanel'].'"';
135 135
         }
136
-        echo "<input type='button' name='close$sid' value='". translate ( 'LBL_BTN_CLOSE' )."' " . 
137
-                "class='button' onclick='ModuleBuilder.tabPanel.removeTab(ModuleBuilder.tabPanel.get(\"activeTab\"));' style='margin:5px;'>" . 
138
-             "<input type='button' name='restore$sid' value='" . translate ( 'LBL_MB_RESTORE' ) . "' " .  
139
-                "class='button' onclick='ModuleBuilder.history.revert(\"$this->module\",\"{$this->layout}\",\"$sid\"$subpanel);' style='margin:5px;'>" ;
140
-        $this->history->restoreByTimestamp ( $sid ) ;
141
-        $view ;
136
+        echo "<input type='button' name='close$sid' value='".translate('LBL_BTN_CLOSE')."' ". 
137
+                "class='button' onclick='ModuleBuilder.tabPanel.removeTab(ModuleBuilder.tabPanel.get(\"activeTab\"));' style='margin:5px;'>". 
138
+             "<input type='button' name='restore$sid' value='".translate('LBL_MB_RESTORE')."' ".  
139
+                "class='button' onclick='ModuleBuilder.history.revert(\"$this->module\",\"{$this->layout}\",\"$sid\"$subpanel);' style='margin:5px;'>";
140
+        $this->history->restoreByTimestamp($sid);
141
+        $view;
142 142
         if ($this->layout == 'listview')
143 143
         {
144
-            require_once ("modules/ModuleBuilder/views/view.listview.php") ;
145
-            $view = new ViewListView ( ) ;
144
+            require_once ("modules/ModuleBuilder/views/view.listview.php");
145
+            $view = new ViewListView( );
146 146
         } else if ($this->layout == 'basic_search' || $this->layout == 'advanced_search')
147 147
         {
148
-            require_once ("modules/ModuleBuilder/views/view.searchview.php") ;
149
-            $view = new ViewSearchView ( ) ;
148
+            require_once ("modules/ModuleBuilder/views/view.searchview.php");
149
+            $view = new ViewSearchView( );
150 150
         } else if ($this->layout == 'dashlet' || $this->layout == 'dashletsearch')
151 151
         {
152
-        	require_once ("modules/ModuleBuilder/views/view.dashlet.php") ;
153
-        	$view = new ViewDashlet ( ) ;
154
-        }  else if ($this->layout == 'popuplist' || $this->layout == 'popupsearch')
152
+        	require_once ("modules/ModuleBuilder/views/view.dashlet.php");
153
+        	$view = new ViewDashlet( );
154
+        } else if ($this->layout == 'popuplist' || $this->layout == 'popupsearch')
155 155
         {
156
-        	require_once ("modules/ModuleBuilder/views/view.popupview.php") ;
157
-        	$view = new ViewPopupview ( ) ;
156
+        	require_once ("modules/ModuleBuilder/views/view.popupview.php");
157
+        	$view = new ViewPopupview( );
158 158
         } else
159 159
         {
160
-            require_once ("modules/ModuleBuilder/views/view.layoutview.php") ;
161
-            $view = new ViewLayoutView ( ) ;
160
+            require_once ("modules/ModuleBuilder/views/view.layoutview.php");
161
+            $view = new ViewLayoutView( );
162 162
         }
163 163
         
164
-        $view->display ( true ) ;
165
-        $this->history->undoRestore () ;
164
+        $view->display(true);
165
+        $this->history->undoRestore();
166 166
     }
167 167
 
168
-    function restore ()
168
+    function restore()
169 169
     {
170
-        if (! isset ( $_REQUEST [ 'sid' ] ))
170
+        if (!isset ($_REQUEST ['sid']))
171 171
         {
172
-            die ( 'SID Required' ) ;
172
+            die ('SID Required');
173 173
         }
174
-        $sid = $_REQUEST [ 'sid' ] ;
175
-        $this->history->restoreByTimestamp ( $sid ) ;
174
+        $sid = $_REQUEST ['sid'];
175
+        $this->history->restoreByTimestamp($sid);
176 176
     }
177 177
 
178 178
 	/**
@@ -181,6 +181,6 @@  discard block
 block discarded – undo
181 181
  	 */
182 182
     function unrestore() 
183 183
     {
184
-    	$this->history->undoRestore () ;
184
+    	$this->history->undoRestore();
185 185
     }
186 186
 }
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -103,8 +103,9 @@  discard block
 block discarded – undo
103 103
         {
104 104
             $dbDate = $timedate->fromTimestamp($ts)->asDb();
105 105
             $displayTS = $timedate->to_display_date_time ( $dbDate ) ;
106
-            if ($page * $this->pageSize + $i + 1 == $count)
107
-                $displayTS = translate("LBL_MB_DEFAULT_LAYOUT");
106
+            if ($page * $this->pageSize + $i + 1 == $count) {
107
+                            $displayTS = translate("LBL_MB_DEFAULT_LAYOUT");
108
+            }
108 109
             $snapshots [ $ts ] = $displayTS ;
109 110
             $ts = $this->history->getNext () ;
110 111
         }
@@ -151,7 +152,7 @@  discard block
 block discarded – undo
151 152
         {
152 153
         	require_once ("modules/ModuleBuilder/views/view.dashlet.php") ;
153 154
         	$view = new ViewDashlet ( ) ;
154
-        }  else if ($this->layout == 'popuplist' || $this->layout == 'popupsearch')
155
+        } else if ($this->layout == 'popuplist' || $this->layout == 'popupsearch')
155 156
         {
156 157
         	require_once ("modules/ModuleBuilder/views/view.popupview.php") ;
157 158
         	$view = new ViewPopupview ( ) ;
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.labels.php 2 patches
Indentation   +89 added lines, -89 removed lines patch added patch discarded remove patch
@@ -48,73 +48,73 @@  discard block
 block discarded – undo
48 48
 class ViewLabels extends ViewModulefields
49 49
 {
50 50
     /**
51
-	 * @see SugarView::_getModuleTitleParams()
52
-	 */
53
-	protected function _getModuleTitleParams($browserTitle = false)
54
-	{
55
-	    global $mod_strings;
51
+     * @see SugarView::_getModuleTitleParams()
52
+     */
53
+    protected function _getModuleTitleParams($browserTitle = false)
54
+    {
55
+        global $mod_strings;
56 56
 
57
-    	return array(
58
-    	   translate('LBL_MODULE_NAME','Administration'),
59
-    	   ModuleBuilderController::getModuleTitle(),
60
-    	   );
57
+        return array(
58
+            translate('LBL_MODULE_NAME','Administration'),
59
+            ModuleBuilderController::getModuleTitle(),
60
+            );
61 61
     }
62 62
 
63
- 	//STUDIO LABELS ONLY//
64
- 	//TODO Bundle Studio and ModuleBuilder label handling to increase maintainability.
65
- 	function display()
66
- 	{
67
-		$editModule = $_REQUEST['view_module'];
68
-		$allLabels = (!empty($_REQUEST['labels']) && $_REQUEST['labels']== 'all');
63
+        //STUDIO LABELS ONLY//
64
+        //TODO Bundle Studio and ModuleBuilder label handling to increase maintainability.
65
+        function display()
66
+        {
67
+        $editModule = $_REQUEST['view_module'];
68
+        $allLabels = (!empty($_REQUEST['labels']) && $_REQUEST['labels']== 'all');
69 69
 
70
- 		if (!isset($_REQUEST['MB']))
71
-		{
72
-		    global $app_list_strings;
73
-		    $moduleNames = array_change_key_case($app_list_strings['moduleList']);
74
-		    $translatedEditModule = $moduleNames[strtolower($editModule)];
75
-		}
76
-		$selected_lang = (!empty($_REQUEST['selected_lang'])? $_REQUEST['selected_lang']:$_SESSION['authenticated_user_language']);
77
-		if(empty($selected_lang)){
78
-		    $selected_lang = $GLOBALS['sugar_config']['default_language'];
79
-		}
70
+            if (!isset($_REQUEST['MB']))
71
+        {
72
+            global $app_list_strings;
73
+            $moduleNames = array_change_key_case($app_list_strings['moduleList']);
74
+            $translatedEditModule = $moduleNames[strtolower($editModule)];
75
+        }
76
+        $selected_lang = (!empty($_REQUEST['selected_lang'])? $_REQUEST['selected_lang']:$_SESSION['authenticated_user_language']);
77
+        if(empty($selected_lang)){
78
+            $selected_lang = $GLOBALS['sugar_config']['default_language'];
79
+        }
80 80
 
81
-		$smarty = new Sugar_Smarty();
82
-		global $mod_strings;
81
+        $smarty = new Sugar_Smarty();
82
+        global $mod_strings;
83 83
         $smarty->assign('mod_strings', $mod_strings);
84
-		$smarty->assign('available_languages',get_languages());
84
+        $smarty->assign('available_languages',get_languages());
85 85
 
86 86
 
87 87
         $objectName = BeanFactory::getObjectName($editModule);
88 88
         VardefManager::loadVardef($editModule, $objectName);
89 89
         global $dictionary;
90 90
         $vnames = array();
91
-		//jchi 24557 . We should list all the lables in viewdefs(list,detail,edit,quickcreate) that the user can edit them.
92
-		require_once 'modules/ModuleBuilder/parsers/views/ListLayoutMetaDataParser.php' ;
91
+        //jchi 24557 . We should list all the lables in viewdefs(list,detail,edit,quickcreate) that the user can edit them.
92
+        require_once 'modules/ModuleBuilder/parsers/views/ListLayoutMetaDataParser.php' ;
93 93
         $parser = new ListLayoutMetaDataParser ( MB_LISTVIEW, $editModule ) ;
94 94
         foreach ( $parser->getLayout() as $key => $def )
95 95
         {
96
-        	if(isset($def['label']) ) {
97
-               $vnames[$def['label']] = $def['label'];
98
-        	}
96
+            if(isset($def['label']) ) {
97
+                $vnames[$def['label']] = $def['label'];
98
+            }
99 99
         }
100 100
 
101
-       require_once 'modules/ModuleBuilder/parsers/views/GridLayoutMetaDataParser.php' ;
101
+        require_once 'modules/ModuleBuilder/parsers/views/GridLayoutMetaDataParser.php' ;
102 102
         $variableMap = $this->getVariableMap($editModule);
103 103
         foreach($variableMap as $key => $value){
104
-        	$gridLayoutMetaDataParserTemp = new GridLayoutMetaDataParser ( $value, $editModule) ;
105
-        	foreach ( $gridLayoutMetaDataParserTemp->getLayout() as $panel)
106
-	        {
107
-	                foreach ( $panel as $row )
108
-	                {
109
-	                    foreach ( $row as $fieldArray )
110
-	                    { // fieldArray is an array('name'=>name,'label'=>label)
111
-	                        if (isset ( $fieldArray [ 'label' ] ))
112
-	                        {
113
-	                            $vnames[$fieldArray [ 'label' ] ] = $fieldArray [ 'label' ] ;
114
-	                        }
115
-	                    }
116
-	                }
117
-	        }
104
+            $gridLayoutMetaDataParserTemp = new GridLayoutMetaDataParser ( $value, $editModule) ;
105
+            foreach ( $gridLayoutMetaDataParserTemp->getLayout() as $panel)
106
+            {
107
+                    foreach ( $panel as $row )
108
+                    {
109
+                        foreach ( $row as $fieldArray )
110
+                        { // fieldArray is an array('name'=>name,'label'=>label)
111
+                            if (isset ( $fieldArray [ 'label' ] ))
112
+                            {
113
+                                $vnames[$fieldArray [ 'label' ] ] = $fieldArray [ 'label' ] ;
114
+                            }
115
+                        }
116
+                    }
117
+            }
118 118
         }
119 119
         //end
120 120
 
@@ -122,23 +122,23 @@  discard block
 block discarded – undo
122 122
         require_once ('include/SubPanel/SubPanel.php') ;
123 123
         $subList =  SubPanel::getModuleSubpanels ( $editModule );
124 124
         foreach($subList as $subpanel => $titleLabel) {
125
-        	$vnames[$titleLabel] = $titleLabel;
125
+            $vnames[$titleLabel] = $titleLabel;
126 126
         }
127 127
 
128 128
         foreach($dictionary[$objectName]['fields'] as $name=>$def) {
129
-        	if(isset($def['vname'])) {
130
-               $vnames[$def['vname']] = $def['vname'];
131
-        	}
132
-		}
133
- 	    $formatted_mod_strings = array();
129
+            if(isset($def['vname'])) {
130
+                $vnames[$def['vname']] = $def['vname'];
131
+            }
132
+        }
133
+            $formatted_mod_strings = array();
134 134
 
135
- 	    //we shouldn't set the $refresh=true here, or will lost template language mod_strings.
136
- 	    //return_module_language($selected_lang, $editModule,false) : the mod_strings will be included from cache files here.
135
+            //we shouldn't set the $refresh=true here, or will lost template language mod_strings.
136
+            //return_module_language($selected_lang, $editModule,false) : the mod_strings will be included from cache files here.
137 137
         foreach(return_module_language($selected_lang, $editModule,false) as $name=>$label) {
138
-        		//#25294
139
-        	 	if($allLabels || isset($vnames[$name]) || preg_match( '/lbl_city|lbl_country|lbl_billing_address|lbl_alt_address|lbl_shipping_address|lbl_postal_code|lbl_state$/si' , $name)) {
138
+                //#25294
139
+                    if($allLabels || isset($vnames[$name]) || preg_match( '/lbl_city|lbl_country|lbl_billing_address|lbl_alt_address|lbl_shipping_address|lbl_postal_code|lbl_state$/si' , $name)) {
140 140
                     $formatted_mod_strings[$name] = htmlentities($label, ENT_QUOTES, 'UTF-8');
141
-        	 	}
141
+                    }
142 142
         }
143 143
         //Grab everything from the custom files
144 144
         $mod_bak = $mod_strings;
@@ -147,49 +147,49 @@  discard block
 block discarded – undo
147 147
             "custom/modules/$editModule/Ext/Language/$selected_lang.lang.ext.php"
148 148
         );
149 149
         foreach($files as $langfile){
150
-        	$mod_strings = array();
151
-        	if (is_file($langfile))
152
-        	{
153
-        	   include($langfile);
154
-        	   foreach($mod_strings as $key => $label)
155
-        	   {
150
+            $mod_strings = array();
151
+            if (is_file($langfile))
152
+            {
153
+                include($langfile);
154
+                foreach($mod_strings as $key => $label)
155
+                {
156 156
                     $formatted_mod_strings[$key] = htmlentities($label, ENT_QUOTES, 'UTF-8');
157
-        	   }
158
-        	}
157
+                }
158
+            }
159 159
         }
160 160
         $mod_strings = $mod_bak;
161 161
         ksort($formatted_mod_strings);
162
-		$smarty->assign('MOD', $formatted_mod_strings);
163
-		$smarty->assign('view_module', $editModule);
164
-		$smarty->assign('APP', $GLOBALS['app_strings']);
165
-		$smarty->assign('selected_lang', $selected_lang);
166
-		$smarty->assign('defaultHelp', 'labelsBtn');
167
-		$smarty->assign('assistant', array('key'=>'labels', 'group'=>'module'));
168
-		$smarty->assign('labels_choice', $mod_strings['labelTypes']);
169
-		$smarty->assign('labels_current', $allLabels?"all":"");
162
+        $smarty->assign('MOD', $formatted_mod_strings);
163
+        $smarty->assign('view_module', $editModule);
164
+        $smarty->assign('APP', $GLOBALS['app_strings']);
165
+        $smarty->assign('selected_lang', $selected_lang);
166
+        $smarty->assign('defaultHelp', 'labelsBtn');
167
+        $smarty->assign('assistant', array('key'=>'labels', 'group'=>'module'));
168
+        $smarty->assign('labels_choice', $mod_strings['labelTypes']);
169
+        $smarty->assign('labels_current', $allLabels?"all":"");
170 170
 
171
-		$ajax = new AjaxCompose();
172
-		$ajax->addCrumb($mod_strings['LBL_STUDIO'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard")');
173
-		$ajax->addCrumb($translatedEditModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module='.$editModule.'")');
174
-		$ajax->addCrumb($mod_strings['LBL_LABELS'], '');
171
+        $ajax = new AjaxCompose();
172
+        $ajax->addCrumb($mod_strings['LBL_STUDIO'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard")');
173
+        $ajax->addCrumb($translatedEditModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module='.$editModule.'")');
174
+        $ajax->addCrumb($mod_strings['LBL_LABELS'], '');
175 175
 
176
- 		$html = $smarty->fetch('modules/ModuleBuilder/tpls/labels.tpl');
177
- 		$ajax->addSection('center', $GLOBALS['mod_strings']['LBL_SECTION_EDLABELS'], $html);
178
- 		echo $ajax->getJavascript();
179
- 	}
176
+            $html = $smarty->fetch('modules/ModuleBuilder/tpls/labels.tpl');
177
+            $ajax->addSection('center', $GLOBALS['mod_strings']['LBL_SECTION_EDLABELS'], $html);
178
+            echo $ajax->getJavascript();
179
+        }
180 180
     
181 181
     // fixing bug #39749: Quick Create in Studio
182 182
     function getVariableMap($module)
183 183
     {
184 184
         $variableMap = array(MB_EDITVIEW => 'EditView', 
185
-                             MB_DETAILVIEW => 'DetailView', 
186
-                             MB_QUICKCREATE => 'QuickCreate');
185
+                                MB_DETAILVIEW => 'DetailView', 
186
+                                MB_QUICKCREATE => 'QuickCreate');
187 187
         
188 188
         $hideQuickCreateForModules = array('KBDocuments',
189
-                                           'ProjectTask',
190
-                                           'Campaigns',
191
-                                           'Quotes',
192
-                                           'ProductTemplates');
189
+                                            'ProjectTask',
190
+                                            'Campaigns',
191
+                                            'Quotes',
192
+                                            'ProductTemplates');
193 193
         
194 194
         if(in_array($module, $hideQuickCreateForModules))
195 195
         {
Please login to merge, or discard this patch.
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	    global $mod_strings;
56 56
 
57 57
     	return array(
58
-    	   translate('LBL_MODULE_NAME','Administration'),
58
+    	   translate('LBL_MODULE_NAME', 'Administration'),
59 59
     	   ModuleBuilderController::getModuleTitle(),
60 60
     	   );
61 61
     }
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
  	function display()
66 66
  	{
67 67
 		$editModule = $_REQUEST['view_module'];
68
-		$allLabels = (!empty($_REQUEST['labels']) && $_REQUEST['labels']== 'all');
68
+		$allLabels = (!empty($_REQUEST['labels']) && $_REQUEST['labels'] == 'all');
69 69
 
70 70
  		if (!isset($_REQUEST['MB']))
71 71
 		{
@@ -73,15 +73,15 @@  discard block
 block discarded – undo
73 73
 		    $moduleNames = array_change_key_case($app_list_strings['moduleList']);
74 74
 		    $translatedEditModule = $moduleNames[strtolower($editModule)];
75 75
 		}
76
-		$selected_lang = (!empty($_REQUEST['selected_lang'])? $_REQUEST['selected_lang']:$_SESSION['authenticated_user_language']);
77
-		if(empty($selected_lang)){
76
+		$selected_lang = (!empty($_REQUEST['selected_lang']) ? $_REQUEST['selected_lang'] : $_SESSION['authenticated_user_language']);
77
+		if (empty($selected_lang)) {
78 78
 		    $selected_lang = $GLOBALS['sugar_config']['default_language'];
79 79
 		}
80 80
 
81 81
 		$smarty = new Sugar_Smarty();
82 82
 		global $mod_strings;
83 83
         $smarty->assign('mod_strings', $mod_strings);
84
-		$smarty->assign('available_languages',get_languages());
84
+		$smarty->assign('available_languages', get_languages());
85 85
 
86 86
 
87 87
         $objectName = BeanFactory::getObjectName($editModule);
@@ -89,28 +89,28 @@  discard block
 block discarded – undo
89 89
         global $dictionary;
90 90
         $vnames = array();
91 91
 		//jchi 24557 . We should list all the lables in viewdefs(list,detail,edit,quickcreate) that the user can edit them.
92
-		require_once 'modules/ModuleBuilder/parsers/views/ListLayoutMetaDataParser.php' ;
93
-        $parser = new ListLayoutMetaDataParser ( MB_LISTVIEW, $editModule ) ;
94
-        foreach ( $parser->getLayout() as $key => $def )
92
+		require_once 'modules/ModuleBuilder/parsers/views/ListLayoutMetaDataParser.php';
93
+        $parser = new ListLayoutMetaDataParser(MB_LISTVIEW, $editModule);
94
+        foreach ($parser->getLayout() as $key => $def)
95 95
         {
96
-        	if(isset($def['label']) ) {
96
+        	if (isset($def['label'])) {
97 97
                $vnames[$def['label']] = $def['label'];
98 98
         	}
99 99
         }
100 100
 
101
-       require_once 'modules/ModuleBuilder/parsers/views/GridLayoutMetaDataParser.php' ;
101
+       require_once 'modules/ModuleBuilder/parsers/views/GridLayoutMetaDataParser.php';
102 102
         $variableMap = $this->getVariableMap($editModule);
103
-        foreach($variableMap as $key => $value){
104
-        	$gridLayoutMetaDataParserTemp = new GridLayoutMetaDataParser ( $value, $editModule) ;
105
-        	foreach ( $gridLayoutMetaDataParserTemp->getLayout() as $panel)
103
+        foreach ($variableMap as $key => $value) {
104
+        	$gridLayoutMetaDataParserTemp = new GridLayoutMetaDataParser($value, $editModule);
105
+        	foreach ($gridLayoutMetaDataParserTemp->getLayout() as $panel)
106 106
 	        {
107
-	                foreach ( $panel as $row )
107
+	                foreach ($panel as $row)
108 108
 	                {
109
-	                    foreach ( $row as $fieldArray )
109
+	                    foreach ($row as $fieldArray)
110 110
 	                    { // fieldArray is an array('name'=>name,'label'=>label)
111
-	                        if (isset ( $fieldArray [ 'label' ] ))
111
+	                        if (isset ($fieldArray ['label']))
112 112
 	                        {
113
-	                            $vnames[$fieldArray [ 'label' ] ] = $fieldArray [ 'label' ] ;
113
+	                            $vnames[$fieldArray ['label']] = $fieldArray ['label'];
114 114
 	                        }
115 115
 	                    }
116 116
 	                }
@@ -119,14 +119,14 @@  discard block
 block discarded – undo
119 119
         //end
120 120
 
121 121
         //Get Subpanel Labels:
122
-        require_once ('include/SubPanel/SubPanel.php') ;
123
-        $subList =  SubPanel::getModuleSubpanels ( $editModule );
124
-        foreach($subList as $subpanel => $titleLabel) {
122
+        require_once ('include/SubPanel/SubPanel.php');
123
+        $subList = SubPanel::getModuleSubpanels($editModule);
124
+        foreach ($subList as $subpanel => $titleLabel) {
125 125
         	$vnames[$titleLabel] = $titleLabel;
126 126
         }
127 127
 
128
-        foreach($dictionary[$objectName]['fields'] as $name=>$def) {
129
-        	if(isset($def['vname'])) {
128
+        foreach ($dictionary[$objectName]['fields'] as $name=>$def) {
129
+        	if (isset($def['vname'])) {
130 130
                $vnames[$def['vname']] = $def['vname'];
131 131
         	}
132 132
 		}
@@ -134,9 +134,9 @@  discard block
 block discarded – undo
134 134
 
135 135
  	    //we shouldn't set the $refresh=true here, or will lost template language mod_strings.
136 136
  	    //return_module_language($selected_lang, $editModule,false) : the mod_strings will be included from cache files here.
137
-        foreach(return_module_language($selected_lang, $editModule,false) as $name=>$label) {
137
+        foreach (return_module_language($selected_lang, $editModule, false) as $name=>$label) {
138 138
         		//#25294
139
-        	 	if($allLabels || isset($vnames[$name]) || preg_match( '/lbl_city|lbl_country|lbl_billing_address|lbl_alt_address|lbl_shipping_address|lbl_postal_code|lbl_state$/si' , $name)) {
139
+        	 	if ($allLabels || isset($vnames[$name]) || preg_match('/lbl_city|lbl_country|lbl_billing_address|lbl_alt_address|lbl_shipping_address|lbl_postal_code|lbl_state$/si', $name)) {
140 140
                     $formatted_mod_strings[$name] = htmlentities($label, ENT_QUOTES, 'UTF-8');
141 141
         	 	}
142 142
         }
@@ -146,12 +146,12 @@  discard block
 block discarded – undo
146 146
             "custom/modules/$editModule/language/$selected_lang.lang.php",
147 147
             "custom/modules/$editModule/Ext/Language/$selected_lang.lang.ext.php"
148 148
         );
149
-        foreach($files as $langfile){
149
+        foreach ($files as $langfile) {
150 150
         	$mod_strings = array();
151 151
         	if (is_file($langfile))
152 152
         	{
153 153
         	   include($langfile);
154
-        	   foreach($mod_strings as $key => $label)
154
+        	   foreach ($mod_strings as $key => $label)
155 155
         	   {
156 156
                     $formatted_mod_strings[$key] = htmlentities($label, ENT_QUOTES, 'UTF-8');
157 157
         	   }
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 		$smarty->assign('defaultHelp', 'labelsBtn');
167 167
 		$smarty->assign('assistant', array('key'=>'labels', 'group'=>'module'));
168 168
 		$smarty->assign('labels_choice', $mod_strings['labelTypes']);
169
-		$smarty->assign('labels_current', $allLabels?"all":"");
169
+		$smarty->assign('labels_current', $allLabels ? "all" : "");
170 170
 
171 171
 		$ajax = new AjaxCompose();
172 172
 		$ajax->addCrumb($mod_strings['LBL_STUDIO'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard")');
@@ -191,17 +191,17 @@  discard block
 block discarded – undo
191 191
                                            'Quotes',
192 192
                                            'ProductTemplates');
193 193
         
194
-        if(in_array($module, $hideQuickCreateForModules))
194
+        if (in_array($module, $hideQuickCreateForModules))
195 195
         {
196
-            if(isset($variableMap['quickcreate']))
196
+            if (isset($variableMap['quickcreate']))
197 197
             {
198 198
                 unset($variableMap['quickcreate']);
199 199
             }
200 200
         }
201 201
         
202
-        if($module == 'KBDocuments')
202
+        if ($module == 'KBDocuments')
203 203
         {
204
-            $variableMap  = array();
204
+            $variableMap = array();
205 205
         }
206 206
         
207 207
         return $variableMap;
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.modulefields.php 3 patches
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	    global $mod_strings;
53 53
 	    
54 54
     	return array(
55
-    	   translate('LBL_MODULE_NAME','Administration'),
55
+    	   translate('LBL_MODULE_NAME', 'Administration'),
56 56
     	   ModuleBuilderController::getModuleTitle(),
57 57
     	   );
58 58
     }
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 	{
62 62
         $smarty = new Sugar_Smarty();
63 63
         global $mod_strings;
64
-        $bak_mod_strings=$mod_strings;
64
+        $bak_mod_strings = $mod_strings;
65 65
         $smarty->assign('mod_strings', $mod_strings);
66 66
 
67 67
         $module_name = $_REQUEST['view_module'];
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
         //add datetimecombo type field from the vardef overrides to point to Datetime type
78 78
         $fieldTypes['datetime'] = $fieldTypes['datetimecombo'];
79 79
 
80
-        if(!isset($_REQUEST['view_package']) || $_REQUEST['view_package'] == 'studio') {
80
+        if (!isset($_REQUEST['view_package']) || $_REQUEST['view_package'] == 'studio') {
81 81
             //$this->loadPackageHelp($module_name);
82 82
             $studioClass = new stdClass;
83 83
             $studioClass->name = $module_name;
@@ -88,12 +88,12 @@  discard block
 block discarded – undo
88 88
             global $dictionary;
89 89
             $f = array($mod_strings['LBL_HCUSTOM']=>array(), $mod_strings['LBL_HDEFAULT']=>array());
90 90
 
91
-            foreach($dictionary[$objectName]['fields'] as $def) {
91
+            foreach ($dictionary[$objectName]['fields'] as $def) {
92 92
                 if ($this->isValidStudioField($def))
93 93
                 {
94 94
                     $def['label'] = translate($def['vname'], $module_name);
95 95
 					//Custom relate fields will have a non-db source, but custom_module set
96
-                	if(isset($def['source']) && $def['source'] == 'custom_fields' || isset($def['custom_module'])) {
96
+                	if (isset($def['source']) && $def['source'] == 'custom_fields' || isset($def['custom_module'])) {
97 97
                        $f[$mod_strings['LBL_HCUSTOM']][$def['name']] = $def;
98 98
                        $def['custom'] = true;
99 99
                     } else {
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
             $ajax->addCrumb($mod_strings['LBL_STUDIO'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard")');
123 123
             $ajax->addCrumb(translate($module_name), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module='.$module_name.'")');
124 124
             $ajax->addCrumb($mod_strings['LBL_FIELDS'], '');
125
-            $ajax->addSection('center', $mod_strings['LBL_EDIT_FIELDS'],$smarty->fetch('modules/ModuleBuilder/tpls/MBModule/fields.tpl'));
125
+            $ajax->addSection('center', $mod_strings['LBL_EDIT_FIELDS'], $smarty->fetch('modules/ModuleBuilder/tpls/MBModule/fields.tpl'));
126 126
             $_REQUEST['field'] = '';
127 127
 
128 128
             echo $ajax->getJavascript();
@@ -139,20 +139,20 @@  discard block
 block discarded – undo
139 139
             $this->mbModule->mbvardefs->vardefs['fields'] = array_reverse($this->mbModule->mbvardefs->vardefs['fields'], true);
140 140
             $loadedFields = array();
141 141
 
142
-            if(file_exists($this->mbModule->path. '/language/'.$current_language.'.lang.php'))
142
+            if (file_exists($this->mbModule->path.'/language/'.$current_language.'.lang.php'))
143 143
             {
144
-                include($this->mbModule->path .'/language/'.$current_language.'.lang.php');
145
-                $this->mbModule->setModStrings($current_language,$mod_strings);
146
-            }elseif(file_exists($this->mbModule->path. '/language/en_us.lang.php')){
147
-                include($this->mbModule->path .'/language/en_us.lang.php');
148
-                $this->mbModule->setModStrings('en_us',$mod_strings);
144
+                include($this->mbModule->path.'/language/'.$current_language.'.lang.php');
145
+                $this->mbModule->setModStrings($current_language, $mod_strings);
146
+            }elseif (file_exists($this->mbModule->path.'/language/en_us.lang.php')) {
147
+                include($this->mbModule->path.'/language/en_us.lang.php');
148
+                $this->mbModule->setModStrings('en_us', $mod_strings);
149 149
             }
150 150
 
151
-            foreach($this->mbModule->mbvardefs->vardefs['fields'] as $k=>$v)
151
+            foreach ($this->mbModule->mbvardefs->vardefs['fields'] as $k=>$v)
152 152
             {
153 153
                 if ($k != $this->mbModule->name)
154 154
                 {
155
-                    foreach($v as $field => $def)
155
+                    foreach ($v as $field => $def)
156 156
                     {
157 157
                         if (in_array($field, array_keys($this->mbModule->mbvardefs->vardefs['fields'][$this->mbModule->name])))
158 158
                         {
@@ -164,15 +164,15 @@  discard block
 block discarded – undo
164 164
                 }
165 165
             }
166 166
 
167
-            foreach($this->mbModule->mbvardefs->vardefs['fields'] as $k=>$v)
167
+            foreach ($this->mbModule->mbvardefs->vardefs['fields'] as $k=>$v)
168 168
             {
169
-                if($k != $module_name)
169
+                if ($k != $module_name)
170 170
                 {
171
-                    $titleLBL[$k]=translate("LBL_".strtoupper($k),'ModuleBuilder');
172
-                }else{
173
-                    $titleLBL[$k]=$k;
171
+                    $titleLBL[$k] = translate("LBL_".strtoupper($k), 'ModuleBuilder');
172
+                } else {
173
+                    $titleLBL[$k] = $k;
174 174
                 }
175
-                foreach($v as $field => $def)
175
+                foreach ($v as $field => $def)
176 176
                 {
177 177
                 	if (isset($loadedFields[$field]))
178 178
                     {
@@ -199,15 +199,15 @@  discard block
 block discarded – undo
199 199
             $smarty->assign('title', $titleLBL);
200 200
             $smarty->assign('package', $package);
201 201
             $smarty->assign('module', $this->mbModule);
202
-            $smarty->assign('editLabelsMb','1');
202
+            $smarty->assign('editLabelsMb', '1');
203 203
             $smarty->assign('studio', false);
204 204
 
205 205
             $ajax = new AjaxCompose();
206 206
             $ajax->addCrumb($bak_mod_strings['LBL_MODULEBUILDER'], 'ModuleBuilder.main("mb")');
207
-            $ajax->addCrumb($package->name,'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$package->name.'")');
208
-            $ajax->addCrumb($module_name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package='.$package->name.'&view_module='. $module_name . '")');
207
+            $ajax->addCrumb($package->name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$package->name.'")');
208
+            $ajax->addCrumb($module_name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package='.$package->name.'&view_module='.$module_name.'")');
209 209
             $ajax->addCrumb($bak_mod_strings['LBL_FIELDS'], '');
210
-            $ajax->addSection('center', $bak_mod_strings["LBL_FIELDS"],$smarty->fetch('modules/ModuleBuilder/tpls/MBModule/fields.tpl'));
210
+            $ajax->addSection('center', $bak_mod_strings["LBL_FIELDS"], $smarty->fetch('modules/ModuleBuilder/tpls/MBModule/fields.tpl'));
211 211
             $_REQUEST['field'] = '';
212 212
 
213 213
             echo $ajax->getJavascript();
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
         $name
221 221
         )
222 222
     {
223
-        $this->mbModule->help['default'] = (empty($name))?'create':'modify';
223
+        $this->mbModule->help['default'] = (empty($name)) ? 'create' : 'modify';
224 224
         $this->mbModule->help['group'] = 'module';
225 225
         $this->mbModule->help['group'] = 'module';
226 226
     }
@@ -229,11 +229,11 @@  discard block
 block discarded – undo
229 229
         $def
230 230
         )
231 231
     {
232
-        if(!empty($def['parent_id']))
232
+        if (!empty($def['parent_id']))
233 233
             unset($def['parent_id']);
234
-        if(!empty($def['parent_type']))
234
+        if (!empty($def['parent_type']))
235 235
             unset($def['parent_type']);
236
-        if(!empty($def['currency_id']))
236
+        if (!empty($def['currency_id']))
237 237
             unset($def['currency_id']);
238 238
         return $def;
239 239
     }
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
         )
244 244
 	{
245 245
     	if (isset($def['studio'])) {
246
-            if (is_array($def [ 'studio' ]))
246
+            if (is_array($def ['studio']))
247 247
             {
248 248
     			if (isset($def['studio']['editField']) && $def['studio']['editField'] == true)
249 249
                     return true;
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
     		{
255 255
     			if ($def['studio'] == 'visible')
256 256
                     return true;
257
-                if ($def['studio'] == 'hidden' || $def['studio'] == 'false' || !$def['studio'] )
257
+                if ($def['studio'] == 'hidden' || $def['studio'] == 'false' || !$def['studio'])
258 258
                     return false;
259 259
             }
260 260
         }
Please login to merge, or discard this patch.
Braces   +26 added lines, -18 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
             {
144 144
                 include($this->mbModule->path .'/language/'.$current_language.'.lang.php');
145 145
                 $this->mbModule->setModStrings($current_language,$mod_strings);
146
-            }elseif(file_exists($this->mbModule->path. '/language/en_us.lang.php')){
146
+            } elseif(file_exists($this->mbModule->path. '/language/en_us.lang.php')){
147 147
                 include($this->mbModule->path .'/language/en_us.lang.php');
148 148
                 $this->mbModule->setModStrings('en_us',$mod_strings);
149 149
             }
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
                 if($k != $module_name)
170 170
                 {
171 171
                     $titleLBL[$k]=translate("LBL_".strtoupper($k),'ModuleBuilder');
172
-                }else{
172
+                } else{
173 173
                     $titleLBL[$k]=$k;
174 174
                 }
175 175
                 foreach($v as $field => $def)
@@ -229,12 +229,15 @@  discard block
 block discarded – undo
229 229
         $def
230 230
         )
231 231
     {
232
-        if(!empty($def['parent_id']))
233
-            unset($def['parent_id']);
234
-        if(!empty($def['parent_type']))
235
-            unset($def['parent_type']);
236
-        if(!empty($def['currency_id']))
237
-            unset($def['currency_id']);
232
+        if(!empty($def['parent_id'])) {
233
+                    unset($def['parent_id']);
234
+        }
235
+        if(!empty($def['parent_type'])) {
236
+                    unset($def['parent_type']);
237
+        }
238
+        if(!empty($def['currency_id'])) {
239
+                    unset($def['currency_id']);
240
+        }
238 241
         return $def;
239 242
     }
240 243
 	
@@ -245,23 +248,28 @@  discard block
 block discarded – undo
245 248
     	if (isset($def['studio'])) {
246 249
             if (is_array($def [ 'studio' ]))
247 250
             {
248
-    			if (isset($def['studio']['editField']) && $def['studio']['editField'] == true)
249
-                    return true;
250
-    			if (isset($def['studio']['required']) && $def['studio']['required'])
251
-                    return true;
251
+    			if (isset($def['studio']['editField']) && $def['studio']['editField'] == true) {
252
+    			                    return true;
253
+    			}
254
+    			if (isset($def['studio']['required']) && $def['studio']['required']) {
255
+    			                    return true;
256
+    			}
252 257
                     
253 258
     		} else
254 259
     		{
255
-    			if ($def['studio'] == 'visible')
256
-                    return true;
257
-                if ($def['studio'] == 'hidden' || $def['studio'] == 'false' || !$def['studio'] )
258
-                    return false;
260
+    			if ($def['studio'] == 'visible') {
261
+    			                    return true;
262
+    			}
263
+                if ($def['studio'] == 'hidden' || $def['studio'] == 'false' || !$def['studio'] ) {
264
+                                    return false;
265
+                }
259 266
             }
260 267
         }
261 268
     	if (empty($def ['source']) || $def ['source'] == 'db' || $def ['source'] == 'custom_fields')
262 269
 		{
263
-    		if ($def ['type'] != 'id' && (empty($def ['dbType']) || $def ['dbType'] != 'id'))
264
-		  return true;
270
+    		if ($def ['type'] != 'id' && (empty($def ['dbType']) || $def ['dbType'] != 'id')) {
271
+    				  return true;
272
+    		}
265 273
 		}
266 274
 		
267 275
 		return false;
Please login to merge, or discard this patch.
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -45,20 +45,20 @@  discard block
 block discarded – undo
45 45
     var $mbModule;
46 46
     
47 47
     /**
48
-	 * @see SugarView::_getModuleTitleParams()
49
-	 */
50
-	protected function _getModuleTitleParams($browserTitle = false)
51
-	{
52
-	    global $mod_strings;
48
+     * @see SugarView::_getModuleTitleParams()
49
+     */
50
+    protected function _getModuleTitleParams($browserTitle = false)
51
+    {
52
+        global $mod_strings;
53 53
 	    
54
-    	return array(
55
-    	   translate('LBL_MODULE_NAME','Administration'),
56
-    	   ModuleBuilderController::getModuleTitle(),
57
-    	   );
54
+        return array(
55
+            translate('LBL_MODULE_NAME','Administration'),
56
+            ModuleBuilderController::getModuleTitle(),
57
+            );
58 58
     }
59 59
 
60
-	function display()
61
-	{
60
+    function display()
61
+    {
62 62
         $smarty = new Sugar_Smarty();
63 63
         global $mod_strings;
64 64
         $bak_mod_strings=$mod_strings;
@@ -92,13 +92,13 @@  discard block
 block discarded – undo
92 92
                 if ($this->isValidStudioField($def))
93 93
                 {
94 94
                     $def['label'] = translate($def['vname'], $module_name);
95
-					//Custom relate fields will have a non-db source, but custom_module set
96
-                	if(isset($def['source']) && $def['source'] == 'custom_fields' || isset($def['custom_module'])) {
97
-                       $f[$mod_strings['LBL_HCUSTOM']][$def['name']] = $def;
98
-                       $def['custom'] = true;
95
+                    //Custom relate fields will have a non-db source, but custom_module set
96
+                    if(isset($def['source']) && $def['source'] == 'custom_fields' || isset($def['custom_module'])) {
97
+                        $f[$mod_strings['LBL_HCUSTOM']][$def['name']] = $def;
98
+                        $def['custom'] = true;
99 99
                     } else {
100
-                       $f[$mod_strings['LBL_HDEFAULT']][$def['name']] = $def;
101
-                       $def['custom'] = false;
100
+                        $f[$mod_strings['LBL_HDEFAULT']][$def['name']] = $def;
101
+                        $def['custom'] = false;
102 102
                     }
103 103
 
104 104
                     $def['type'] = isset($fieldTypes[$def['type']]) ? $fieldTypes[$def['type']] : ucfirst($def['type']);
@@ -183,15 +183,15 @@  discard block
 block discarded – undo
183 183
                     {
184 184
                         if (isset($loadedFields[$field]))
185 185
                         {
186
-                           unset($this->mbModule->mbvardefs->vardefs['fields'][$k][$field]);
186
+                            unset($this->mbModule->mbvardefs->vardefs['fields'][$k][$field]);
187 187
                         } else {
188
-                           $this->mbModule->mbvardefs->vardefs['fields'][$k][$field]['label'] = isset($def['vname']) && isset($this->mbModule->mblanguage->strings[$current_language.'.lang.php'][$def['vname']]) ? $this->mbModule->mblanguage->strings[$current_language.'.lang.php'][$def['vname']] : $field;
189
-                           $customFieldsData[$field] = ($k == $this->mbModule->name) ? true : false;
190
-                           $loadedFields[$field] = true;
188
+                            $this->mbModule->mbvardefs->vardefs['fields'][$k][$field]['label'] = isset($def['vname']) && isset($this->mbModule->mblanguage->strings[$current_language.'.lang.php'][$def['vname']]) ? $this->mbModule->mblanguage->strings[$current_language.'.lang.php'][$def['vname']] : $field;
189
+                            $customFieldsData[$field] = ($k == $this->mbModule->name) ? true : false;
190
+                            $loadedFields[$field] = true;
191 191
 
192
-                           $type = $this->mbModule->mbvardefs->vardefs['fields'][$k][$field]['type'];
193
-                           $this->mbModule->mbvardefs->vardefs['fields'][$k][$field]['type'] = isset($fieldTypes[$type]) ? $fieldTypes[$type] : ucfirst($type);
194
-                           $fieldsData[] = $this->mbModule->mbvardefs->vardefs['fields'][$k][$field];
192
+                            $type = $this->mbModule->mbvardefs->vardefs['fields'][$k][$field]['type'];
193
+                            $this->mbModule->mbvardefs->vardefs['fields'][$k][$field]['type'] = isset($fieldTypes[$type]) ? $fieldTypes[$type] : ucfirst($type);
194
+                            $fieldsData[] = $this->mbModule->mbvardefs->vardefs['fields'][$k][$field];
195 195
                         }
196 196
                     }
197 197
                 }
@@ -249,29 +249,29 @@  discard block
 block discarded – undo
249 249
     function isValidStudioField(
250 250
         $def
251 251
         )
252
-	{
253
-    	if (isset($def['studio'])) {
252
+    {
253
+        if (isset($def['studio'])) {
254 254
             if (is_array($def [ 'studio' ]))
255 255
             {
256
-    			if (isset($def['studio']['editField']) && $def['studio']['editField'] == true)
256
+                if (isset($def['studio']['editField']) && $def['studio']['editField'] == true)
257 257
                     return true;
258
-    			if (isset($def['studio']['required']) && $def['studio']['required'])
258
+                if (isset($def['studio']['required']) && $def['studio']['required'])
259 259
                     return true;
260 260
                     
261
-    		} else
262
-    		{
263
-    			if ($def['studio'] == 'visible')
261
+            } else
262
+            {
263
+                if ($def['studio'] == 'visible')
264 264
                     return true;
265 265
                 if ($def['studio'] == 'hidden' || $def['studio'] == 'false' || !$def['studio'] )
266 266
                     return false;
267 267
             }
268 268
         }
269
-    	if (empty($def ['source']) || $def ['source'] == 'db' || $def ['source'] == 'custom_fields')
270
-		{
271
-    		if ($def ['type'] != 'id' && (empty($def ['dbType']) || $def ['dbType'] != 'id'))
272
-		  return true;
273
-		}
269
+        if (empty($def ['source']) || $def ['source'] == 'db' || $def ['source'] == 'custom_fields')
270
+        {
271
+            if ($def ['type'] != 'id' && (empty($def ['dbType']) || $def ['dbType'] != 'id'))
272
+            return true;
273
+        }
274 274
 		
275
-		return false;
276
-	}
275
+        return false;
276
+    }
277 277
 }
278 278
\ No newline at end of file
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.modulefield.php 3 patches
Indentation   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -43,20 +43,20 @@  discard block
 block discarded – undo
43 43
 class ViewModulefield extends SugarView
44 44
 {
45 45
     /**
46
-	 * @see SugarView::_getModuleTitleParams()
47
-	 */
48
-	protected function _getModuleTitleParams($browserTitle = false)
49
-	{
50
-	    global $mod_strings;
46
+     * @see SugarView::_getModuleTitleParams()
47
+     */
48
+    protected function _getModuleTitleParams($browserTitle = false)
49
+    {
50
+        global $mod_strings;
51 51
 	    
52
-    	return array(
53
-    	   translate('LBL_MODULE_NAME','Administration'),
54
-    	   ModuleBuilderController::getModuleTitle(),
55
-    	   );
52
+        return array(
53
+            translate('LBL_MODULE_NAME','Administration'),
54
+            ModuleBuilderController::getModuleTitle(),
55
+            );
56 56
     }
57 57
 
58
-	function display()
59
-	{
58
+    function display()
59
+    {
60 60
         $ac = $this->fetch();
61 61
         echo $ac->getJavascript();
62 62
     }
@@ -76,21 +76,21 @@  discard block
 block discarded – undo
76 76
             $field_name = '';
77 77
 
78 78
         $action = 'saveField'; // tyoung bug 17606: default action is to save as a dynamic field; but for standard OOB
79
-                               // fields we override this so don't create a new dynamic field instead of updating the existing field
79
+                                // fields we override this so don't create a new dynamic field instead of updating the existing field
80 80
 
81 81
         $isClone = false;
82 82
         if(!empty($this->view_object_map['is_clone']) && $this->view_object_map['is_clone']
83 83
             && (strcmp($field_name, "name") != 0)   // bug #35767, do not allow cloning of name field
84 84
             )
85 85
             $isClone = true;
86
-		/*
86
+        /*
87 87
 		$field_types =  array('varchar'=>'YourField', 'int'=>'Integer', 'float'=>'Decimal','bool'=>'Checkbox','enum'=>'DropDown',
88 88
 				'date'=>'Date', 'phone' => 'Phone', 'currency' => 'Currency', 'html' => 'HTML', 'radioenum' => 'Radio',
89 89
 				'relate' => 'Relate', 'address' => 'Address', 'text' => 'TextArea', 'url' => 'Link');
90 90
 		*/
91
-		$field_types = $GLOBALS['mod_strings']['fieldTypes'];
92
-		if (isset($field_types['encrypt']))
93
-		  unset($field_types['encrypt']);
91
+        $field_types = $GLOBALS['mod_strings']['fieldTypes'];
92
+        if (isset($field_types['encrypt']))
93
+            unset($field_types['encrypt']);
94 94
         $field_name_exceptions = array(
95 95
             //bug 22264: Field name must not be an SQL keyword.
96 96
             //Taken from SQL Server's list of reserved keywords; http://msdn.microsoft.com/en-us/library/aa238507(SQL.80).aspx
@@ -110,26 +110,26 @@  discard block
 block discarded – undo
110 110
             'DROP','OPENROWSET','VIEW','DUMMY','OPENXML','WAITFOR','DUMP','OPTION','WHEN','ELSE','OR','WHERE',
111 111
             'END','ORDER','WHILE','ERRLVL','OUTER','WITH','ESCAPE','OVER','WRITETEXT',
112 112
             //Mysql Keywords from http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html (those not in MSSQL's list)
113
-			'ANALYZE', 'ASENSITIVE', 'BEFORE', 'BIGINT', 'BINARY', 'BOTH', 'CALL', 'CHANGE', 'CHARACTER',
114
-			'CONDITION', 'DATABASES', 'DAY_HOUR', 'DAY_MICROSECOND', 'DAY_MINUTE', 'DAY_SECOND', 'DEC', 'DECIMAL', 'DELAYED',
115
-			'DESCRIBE', 'DETERMINISTIC', 'DISTINCTROW', 'DIV', 'DUAL', 'EACH', 'ELSEIF', 'ENCLOSED', 'ESCAPED', 'EXPLAIN',
116
-			'FALSE', 'FLOAT', 'FLOAT4', 'FLOAT8', 'FORCE', 'FULLTEXT', 'HIGH_PRIORITY', 'HOUR_MICROSECOND', 'HOUR_MINUTE',
117
-			'HOUR_SECOND', 'IGNORE', 'INFILE', 'INOUT', 'INSENSITIVE', 'INT', 'INT1', 'INT2', 'INT3', 'INT4', 'INT8',
118
-			'INTEGER', 'ITERATE', 'KEYS', 'LEADING', 'LEAVE', 'LIMIT', 'LINES', 'LOCALTIME', 'LOCALTIMESTAMP', 'LOCK',
119
-			'LONGBLOB', 'LONGTEXT', 'LOOP', 'LOW_PRIORITY', 'MATCH', 'MEDIUMBLOB', 'MEDIUMINT', 'MEDIUMTEXT', 'MIDDLEINT',
120
-			'MINUTE_MICROSECOND', 'MINUTE_SECOND', 'MOD', 'MODIFIES', 'NATURAL', 'NO_WRITE_TO_BINLOG', 'NUMERIC', 'OPTIMIZE',
121
-			'OPTIONALLY', 'OUT', 'OUTFILE', 'PURGE', 'READS', 'REAL', 'REGEXP', 'RELEASE', 'RENAME', 'REPEAT', 'REPLACE',
122
-			'REQUIRE', 'RLIKE', 'SCHEMAS', 'SECOND_MICROSECOND', 'SENSITIVE', 'SEPARATOR', 'SHOW', 'SMALLINT', 'SONAME',
123
-			'SPATIAL', 'SPECIFIC', 'SQL', 'SQLEXCEPTION', 'SQLSTATE', 'SQLWARNING', 'SQL_BIG_RESULT', 'SQL_CALC_FOUND_ROWS',
124
-			'SQL_SMALL_RESULT', 'SSL', 'STARTING', 'STRAIGHT_JOIN', 'TERMINATED', 'TINYBLOB', 'TINYINT', 'TINYTEXT',
125
-			'TRAILING', 'TRUE', 'UNDO', 'UNLOCK', 'UNSIGNED', 'USAGE', 'USING', 'UTC_DATE', 'UTC_TIME', 'UTC_TIMESTAMP',
126
-			'VARBINARY', 'VARCHARACTER', 'WRITE', 'XOR', 'YEAR_MONTH', 'ZEROFILL', 'CONNECTION', 'LABEL', 'UPGRADE',
127
-			//Oracle datatypes
113
+            'ANALYZE', 'ASENSITIVE', 'BEFORE', 'BIGINT', 'BINARY', 'BOTH', 'CALL', 'CHANGE', 'CHARACTER',
114
+            'CONDITION', 'DATABASES', 'DAY_HOUR', 'DAY_MICROSECOND', 'DAY_MINUTE', 'DAY_SECOND', 'DEC', 'DECIMAL', 'DELAYED',
115
+            'DESCRIBE', 'DETERMINISTIC', 'DISTINCTROW', 'DIV', 'DUAL', 'EACH', 'ELSEIF', 'ENCLOSED', 'ESCAPED', 'EXPLAIN',
116
+            'FALSE', 'FLOAT', 'FLOAT4', 'FLOAT8', 'FORCE', 'FULLTEXT', 'HIGH_PRIORITY', 'HOUR_MICROSECOND', 'HOUR_MINUTE',
117
+            'HOUR_SECOND', 'IGNORE', 'INFILE', 'INOUT', 'INSENSITIVE', 'INT', 'INT1', 'INT2', 'INT3', 'INT4', 'INT8',
118
+            'INTEGER', 'ITERATE', 'KEYS', 'LEADING', 'LEAVE', 'LIMIT', 'LINES', 'LOCALTIME', 'LOCALTIMESTAMP', 'LOCK',
119
+            'LONGBLOB', 'LONGTEXT', 'LOOP', 'LOW_PRIORITY', 'MATCH', 'MEDIUMBLOB', 'MEDIUMINT', 'MEDIUMTEXT', 'MIDDLEINT',
120
+            'MINUTE_MICROSECOND', 'MINUTE_SECOND', 'MOD', 'MODIFIES', 'NATURAL', 'NO_WRITE_TO_BINLOG', 'NUMERIC', 'OPTIMIZE',
121
+            'OPTIONALLY', 'OUT', 'OUTFILE', 'PURGE', 'READS', 'REAL', 'REGEXP', 'RELEASE', 'RENAME', 'REPEAT', 'REPLACE',
122
+            'REQUIRE', 'RLIKE', 'SCHEMAS', 'SECOND_MICROSECOND', 'SENSITIVE', 'SEPARATOR', 'SHOW', 'SMALLINT', 'SONAME',
123
+            'SPATIAL', 'SPECIFIC', 'SQL', 'SQLEXCEPTION', 'SQLSTATE', 'SQLWARNING', 'SQL_BIG_RESULT', 'SQL_CALC_FOUND_ROWS',
124
+            'SQL_SMALL_RESULT', 'SSL', 'STARTING', 'STRAIGHT_JOIN', 'TERMINATED', 'TINYBLOB', 'TINYINT', 'TINYTEXT',
125
+            'TRAILING', 'TRUE', 'UNDO', 'UNLOCK', 'UNSIGNED', 'USAGE', 'USING', 'UTC_DATE', 'UTC_TIME', 'UTC_TIMESTAMP',
126
+            'VARBINARY', 'VARCHARACTER', 'WRITE', 'XOR', 'YEAR_MONTH', 'ZEROFILL', 'CONNECTION', 'LABEL', 'UPGRADE',
127
+            //Oracle datatypes
128 128
             'DATE','VARCHAR','VARCHAR2','NVARCHAR2','CHAR','NCHAR','NUMBER','PLS_INTEGER','BINARY_INTEGER','LONG','TIMESTAMP',
129
-			'INTERVAL','RAW','ROWID','UROWID','MLSLABEL','CLOB','NCLOB','BLOB','BFILE','XMLTYPE',
130
-			//SugarCRM reserved
131
-        	'ID', 'ID_C', 'PARENT_NAME', 'PARENT_ID',
132
-			);
129
+            'INTERVAL','RAW','ROWID','UROWID','MLSLABEL','CLOB','NCLOB','BLOB','BFILE','XMLTYPE',
130
+            //SugarCRM reserved
131
+            'ID', 'ID_C', 'PARENT_NAME', 'PARENT_ID',
132
+            );
133 133
 
134 134
 
135 135
         //C.L. - Add support to mark related module id columns as reserved keywords
@@ -173,14 +173,14 @@  discard block
 block discarded – undo
173 173
                 $fv->ss->assign('hideLevel', 3);
174 174
             }
175 175
             if($isClone && isset($vardef['type']) && $vardef['type'] == 'datetime'){
176
-            	$vardef['type'] = 'datetimecombo';
176
+                $vardef['type'] = 'datetimecombo';
177 177
             }
178 178
             
179
-			require_once ('modules/DynamicFields/FieldCases.php') ;
179
+            require_once ('modules/DynamicFields/FieldCases.php') ;
180 180
             $tf = get_widget ( empty($vardef [ 'type' ]) ?  "" : $vardef [ 'type' ]) ;
181 181
             $tf->module = $module;
182 182
             $tf->populateFromRow($vardef);
183
-			$vardef = array_merge($vardef, $tf->get_field_def());
183
+            $vardef = array_merge($vardef, $tf->get_field_def());
184 184
 
185 185
             //          $GLOBALS['log']->debug('vardefs after loading = '.print_r($vardef,true));
186 186
            
@@ -190,10 +190,10 @@  discard block
 block discarded – undo
190 190
             $enumFields = array();
191 191
             foreach($module->field_defs as $field => $def)
192 192
             {
193
-            	if (!empty($def['type']) && $def['type'] == "int" && !empty($def['auto_increment'])) {
194
-            	   $allowAutoInc = false;
195
-            	   continue;
196
-            	}
193
+                if (!empty($def['type']) && $def['type'] == "int" && !empty($def['auto_increment'])) {
194
+                    $allowAutoInc = false;
195
+                    continue;
196
+                }
197 197
                 if (!empty($def['type']) && $def['type'] == "enum" && $field != $vardef['name'])
198 198
                 {
199 199
                     if(!empty($def['studio']) && $def['studio'] == "false") continue; //bug51866 
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
             }
211 211
             $fv->ss->assign('module', $module);
212 212
             if(empty($module->mbvardefs->vardefs['fields']['parent_name']) || (isset($vardef['type']) && $vardef['type'] == 'parent'))
213
-				$field_types['parent'] = $GLOBALS['mod_strings']['parent'];
213
+                $field_types['parent'] = $GLOBALS['mod_strings']['parent'];
214 214
 
215 215
             $edit_or_add = 'editField' ;
216 216
 
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
                 }
245 245
             }
246 246
 
247
-			require_once ('modules/DynamicFields/FieldCases.php') ;
247
+            require_once ('modules/DynamicFields/FieldCases.php') ;
248 248
             $tf = get_widget ( empty($vardef [ 'type' ]) ?  "" : $vardef [ 'type' ]) ;
249 249
             $tf->module = $module;
250 250
             $tf->populateFromRow($vardef);
@@ -258,8 +258,8 @@  discard block
 block discarded – undo
258 258
 
259 259
             if(isset($vardef['vname']))
260 260
                 $fv->ss->assign('lbl_value', htmlentities($module->getLabel('en_us',$vardef['vname']), ENT_QUOTES, 'UTF-8'));
261
-			if(empty($module->mbvardefs->vardefs['fields']['parent_name']) || (isset($vardef['type']) && $vardef['type'] == 'parent'))
262
-				$field_types['parent'] = $GLOBALS['mod_strings']['parent'];
261
+            if(empty($module->mbvardefs->vardefs['fields']['parent_name']) || (isset($vardef['type']) && $vardef['type'] == 'parent'))
262
+                $field_types['parent'] = $GLOBALS['mod_strings']['parent'];
263 263
 
264 264
             $enumFields = array();
265 265
             if (!empty($module->mbvardefs->vardefs['fields']))
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
         }
281 281
 
282 282
         if($_REQUEST['action'] == 'RefreshField'){
283
-        	require_once('modules/DynamicFields/FieldCases.php');
283
+            require_once('modules/DynamicFields/FieldCases.php');
284 284
             $field = get_widget($_POST['type']);
285 285
             $field->populateFromPost();
286 286
             $vardef = $field->get_field_def();
@@ -289,16 +289,16 @@  discard block
 block discarded – undo
289 289
         }
290 290
 
291 291
         foreach(array("formula", "default", "comments", "help", "visiblityGrid") as $toEscape)
292
-		{
293
-			if (!empty($vardef[$toEscape]) && is_string($vardef[$toEscape])) {
294
-	        	$vardef[$toEscape] = htmlentities($vardef[$toEscape], ENT_QUOTES, 'UTF-8');
295
-	        }
296
-		}
292
+        {
293
+            if (!empty($vardef[$toEscape]) && is_string($vardef[$toEscape])) {
294
+                $vardef[$toEscape] = htmlentities($vardef[$toEscape], ENT_QUOTES, 'UTF-8');
295
+            }
296
+        }
297 297
 		
298 298
         if((!empty($vardef['studio']) && is_array($vardef['studio']) && !empty($vardef['studio']['no_duplicate']) && $vardef['studio']['no_duplicate'] == true)
299 299
            || (strcmp($field_name, "name") == 0) || (isset($vardef['type']) && $vardef['type'] == 'name')) // bug #35767, do not allow cloning of name field
300 300
             {
301
-               $fv->ss->assign('no_duplicate', true);
301
+                $fv->ss->assign('no_duplicate', true);
302 302
             }
303 303
 
304 304
         $fv->ss->assign('action',$action);
@@ -318,25 +318,25 @@  discard block
 block discarded – undo
318 318
         $existing_field_names = array () ;
319 319
         foreach ( $module->mbvardefs->vardefs['fields'] as $field )
320 320
         {
321
-        	if ($field [ 'type' ] == 'enum' || $field [ 'type'] == 'multienum' )
322
-        	{
323
-        		$triggers [] = $field [ 'name' ] ;
324
-        	}
321
+            if ($field [ 'type' ] == 'enum' || $field [ 'type'] == 'multienum' )
322
+            {
323
+                $triggers [] = $field [ 'name' ] ;
324
+            }
325 325
         	
326
-        	if (!isset($field['source']) || $field['source'] != 'non-db') {
327
-        		if(preg_match('/^(.*?)(_c)?$/', $field['name'], $matches))
328
-        		{
329
-        			$existing_field_names [] = strtoupper($matches[1]);	
330
-        		}
331
-        	}
326
+            if (!isset($field['source']) || $field['source'] != 'non-db') {
327
+                if(preg_match('/^(.*?)(_c)?$/', $field['name'], $matches))
328
+                {
329
+                    $existing_field_names [] = strtoupper($matches[1]);	
330
+                }
331
+            }
332 332
         }
333 333
         
334 334
         $fv->ss->assign('triggers',$triggers);
335 335
         $fv->ss->assign('existing_field_names', $json->encode($existing_field_names));
336 336
         $fv->ss->assign('mod_strings',$GLOBALS['mod_strings']);
337 337
 
338
-		// jchi #24880
339
-		// end
338
+        // jchi #24880
339
+        // end
340 340
 
341 341
 
342 342
         $layout = $fv->getLayout($vardef);
Please login to merge, or discard this patch.
Braces   +49 added lines, -31 removed lines patch added patch discarded remove patch
@@ -66,14 +66,17 @@  discard block
 block discarded – undo
66 66
         )
67 67
     {
68 68
         $fv = new FieldViewer();
69
-        if(empty($_REQUEST['field'])&& !empty($_REQUEST['name']))$_REQUEST['field'] = $_REQUEST['name'];
69
+        if(empty($_REQUEST['field'])&& !empty($_REQUEST['name'])) {
70
+            $_REQUEST['field'] = $_REQUEST['name'];
71
+        }
70 72
         $field_name = '';
71
-        if(!empty($this->view_object_map['field_name']))
72
-            $field_name = $this->view_object_map['field_name'];
73
-        elseif(!empty($_REQUEST['field']))
74
-            $field_name = $_REQUEST['field'];
75
-        else
76
-            $field_name = '';
73
+        if(!empty($this->view_object_map['field_name'])) {
74
+                    $field_name = $this->view_object_map['field_name'];
75
+        } elseif(!empty($_REQUEST['field'])) {
76
+                    $field_name = $_REQUEST['field'];
77
+        } else {
78
+                    $field_name = '';
79
+        }
77 80
 
78 81
         $action = 'saveField'; // tyoung bug 17606: default action is to save as a dynamic field; but for standard OOB
79 82
                                // fields we override this so don't create a new dynamic field instead of updating the existing field
@@ -81,16 +84,18 @@  discard block
 block discarded – undo
81 84
         $isClone = false;
82 85
         if(!empty($this->view_object_map['is_clone']) && $this->view_object_map['is_clone']
83 86
             && (strcmp($field_name, "name") != 0)   // bug #35767, do not allow cloning of name field
84
-            )
85
-            $isClone = true;
87
+            ) {
88
+                    $isClone = true;
89
+        }
86 90
 		/*
87 91
 		$field_types =  array('varchar'=>'YourField', 'int'=>'Integer', 'float'=>'Decimal','bool'=>'Checkbox','enum'=>'DropDown',
88 92
 				'date'=>'Date', 'phone' => 'Phone', 'currency' => 'Currency', 'html' => 'HTML', 'radioenum' => 'Radio',
89 93
 				'relate' => 'Relate', 'address' => 'Address', 'text' => 'TextArea', 'url' => 'Link');
90 94
 		*/
91 95
 		$field_types = $GLOBALS['mod_strings']['fieldTypes'];
92
-		if (isset($field_types['encrypt']))
93
-		  unset($field_types['encrypt']);
96
+		if (isset($field_types['encrypt'])) {
97
+				  unset($field_types['encrypt']);
98
+		}
94 99
         $field_name_exceptions = array(
95 100
             //bug 22264: Field name must not be an SQL keyword.
96 101
             //Taken from SQL Server's list of reserved keywords; http://msdn.microsoft.com/en-us/library/aa238507(SQL.80).aspx
@@ -163,12 +168,13 @@  discard block
 block discarded – undo
163 168
             }
164 169
           
165 170
             if(empty($vardef['name'])){
166
-                if(!empty($_REQUEST['type']))
167
-                    $vardef['type'] = $_REQUEST['type'];
171
+                if(!empty($_REQUEST['type'])) {
172
+                                    $vardef['type'] = $_REQUEST['type'];
173
+                }
168 174
                     $fv->ss->assign('hideLevel', 0);
169
-            }elseif(isset($vardef['custom_module'])){
175
+            } elseif(isset($vardef['custom_module'])){
170 176
                 $fv->ss->assign('hideLevel', 2);
171
-            }else{
177
+            } else{
172 178
                 $action = 'saveSugarField'; // tyoung - for OOB fields we currently only support modifying the label
173 179
                 $fv->ss->assign('hideLevel', 3);
174 180
             }
@@ -196,10 +202,14 @@  discard block
 block discarded – undo
196 202
             	}
197 203
                 if (!empty($def['type']) && $def['type'] == "enum" && $field != $vardef['name'])
198 204
                 {
199
-                    if(!empty($def['studio']) && $def['studio'] == "false") continue; //bug51866 
205
+                    if(!empty($def['studio']) && $def['studio'] == "false") {
206
+                        continue;
207
+                    }
208
+                    //bug51866 
200 209
                     $enumFields[$field] = translate($def['vname'], $moduleName);
201
-                    if (substr($enumFields[$field], -1) == ":")
202
-                        $enumFields[$field] = substr($enumFields[$field], 0, strlen($enumFields[$field]) - 1);
210
+                    if (substr($enumFields[$field], -1) == ":") {
211
+                                            $enumFields[$field] = substr($enumFields[$field], 0, strlen($enumFields[$field]) - 1);
212
+                    }
203 213
                 }
204 214
             }
205 215
             $fv->ss->assign( 'allowAutoInc', $allowAutoInc);   
@@ -209,8 +219,9 @@  discard block
 block discarded – undo
209 219
                 $fv->ss->assign('lbl_value', htmlentities(translate($vardef['vname'], $moduleName), ENT_QUOTES, 'UTF-8'));
210 220
             }
211 221
             $fv->ss->assign('module', $module);
212
-            if(empty($module->mbvardefs->vardefs['fields']['parent_name']) || (isset($vardef['type']) && $vardef['type'] == 'parent'))
213
-				$field_types['parent'] = $GLOBALS['mod_strings']['parent'];
222
+            if(empty($module->mbvardefs->vardefs['fields']['parent_name']) || (isset($vardef['type']) && $vardef['type'] == 'parent')) {
223
+            				$field_types['parent'] = $GLOBALS['mod_strings']['parent'];
224
+            }
214 225
 
215 226
             $edit_or_add = 'editField' ;
216 227
 
@@ -232,14 +243,16 @@  discard block
 block discarded – undo
232 243
             }
233 244
 
234 245
             if(empty($vardef['name'])){
235
-                if(!empty($_REQUEST['type']))$vardef['type'] = $_REQUEST['type'];
246
+                if(!empty($_REQUEST['type'])) {
247
+                    $vardef['type'] = $_REQUEST['type'];
248
+                }
236 249
                     $fv->ss->assign('hideLevel', 0);
237
-            }else{
250
+            } else{
238 251
                 if(!empty($module->mbvardefs->vardef['fields'][$vardef['name']])){
239 252
                     $fv->ss->assign('hideLevel', 1);
240
-                }elseif(isset($vardef['custom_module'])){
253
+                } elseif(isset($vardef['custom_module'])){
241 254
                     $fv->ss->assign('hideLevel', 2);
242
-                }else{
255
+                } else{
243 256
                     $fv->ss->assign('hideLevel', 3); // tyoung bug 17350 - effectively mark template derived fields as readonly
244 257
                 }
245 258
             }
@@ -256,10 +269,12 @@  discard block
 block discarded – undo
256 269
             $fv->ss->assign('package', $package);
257 270
             $fv->ss->assign('MB','1');
258 271
 
259
-            if(isset($vardef['vname']))
260
-                $fv->ss->assign('lbl_value', htmlentities($module->getLabel('en_us',$vardef['vname']), ENT_QUOTES, 'UTF-8'));
261
-			if(empty($module->mbvardefs->vardefs['fields']['parent_name']) || (isset($vardef['type']) && $vardef['type'] == 'parent'))
262
-				$field_types['parent'] = $GLOBALS['mod_strings']['parent'];
272
+            if(isset($vardef['vname'])) {
273
+                            $fv->ss->assign('lbl_value', htmlentities($module->getLabel('en_us',$vardef['vname']), ENT_QUOTES, 'UTF-8'));
274
+            }
275
+			if(empty($module->mbvardefs->vardefs['fields']['parent_name']) || (isset($vardef['type']) && $vardef['type'] == 'parent')) {
276
+							$field_types['parent'] = $GLOBALS['mod_strings']['parent'];
277
+			}
263 278
 
264 279
             $enumFields = array();
265 280
             if (!empty($module->mbvardefs->vardefs['fields']))
@@ -270,8 +285,9 @@  discard block
 block discarded – undo
270 285
                     {
271 286
                         $enumFields[$field] = isset($module->mblanguage->strings[$current_language][$def['vname']]) ?
272 287
                             $this->mbModule->mblanguage->strings[$current_language][$def['vname']] : translate($field);
273
-                        if (substr($enumFields[$field], -1) == ":")
274
-                            $enumFields[$field] = substr($enumFields[$field], 0, strlen($enumFields[$field]) -1);
288
+                        if (substr($enumFields[$field], -1) == ":") {
289
+                                                    $enumFields[$field] = substr($enumFields[$field], 0, strlen($enumFields[$field]) -1);
290
+                        }
275 291
                     }
276 292
                 }
277 293
             }
@@ -296,9 +312,11 @@  discard block
 block discarded – undo
296 312
 		}
297 313
 		
298 314
         if((!empty($vardef['studio']) && is_array($vardef['studio']) && !empty($vardef['studio']['no_duplicate']) && $vardef['studio']['no_duplicate'] == true)
299
-           || (strcmp($field_name, "name") == 0) || (isset($vardef['type']) && $vardef['type'] == 'name')) // bug #35767, do not allow cloning of name field
315
+           || (strcmp($field_name, "name") == 0) || (isset($vardef['type']) && $vardef['type'] == 'name')) {
316
+            // bug #35767, do not allow cloning of name field
300 317
             {
301 318
                $fv->ss->assign('no_duplicate', true);
319
+        }
302 320
             }
303 321
 
304 322
         $fv->ss->assign('action',$action);
Please login to merge, or discard this patch.
Spacing   +82 added lines, -82 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	    global $mod_strings;
51 51
 	    
52 52
     	return array(
53
-    	   translate('LBL_MODULE_NAME','Administration'),
53
+    	   translate('LBL_MODULE_NAME', 'Administration'),
54 54
     	   ModuleBuilderController::getModuleTitle(),
55 55
     	   );
56 56
     }
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
66 66
         )
67 67
     {
68 68
         $fv = new FieldViewer();
69
-        if(empty($_REQUEST['field'])&& !empty($_REQUEST['name']))$_REQUEST['field'] = $_REQUEST['name'];
69
+        if (empty($_REQUEST['field']) && !empty($_REQUEST['name']))$_REQUEST['field'] = $_REQUEST['name'];
70 70
         $field_name = '';
71
-        if(!empty($this->view_object_map['field_name']))
71
+        if (!empty($this->view_object_map['field_name']))
72 72
             $field_name = $this->view_object_map['field_name'];
73
-        elseif(!empty($_REQUEST['field']))
73
+        elseif (!empty($_REQUEST['field']))
74 74
             $field_name = $_REQUEST['field'];
75 75
         else
76 76
             $field_name = '';
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
                                // fields we override this so don't create a new dynamic field instead of updating the existing field
80 80
 
81 81
         $isClone = false;
82
-        if(!empty($this->view_object_map['is_clone']) && $this->view_object_map['is_clone']
82
+        if (!empty($this->view_object_map['is_clone']) && $this->view_object_map['is_clone']
83 83
             && (strcmp($field_name, "name") != 0)   // bug #35767, do not allow cloning of name field
84 84
             )
85 85
             $isClone = true;
@@ -94,21 +94,21 @@  discard block
 block discarded – undo
94 94
         $field_name_exceptions = array(
95 95
             //bug 22264: Field name must not be an SQL keyword.
96 96
             //Taken from SQL Server's list of reserved keywords; http://msdn.microsoft.com/en-us/library/aa238507(SQL.80).aspx
97
-            'ADD','EXCEPT','PERCENT','ALL','EXEC','PLAN','ALTER','EXECUTE','PRECISION','AND','EXISTS','PRIMARY',
98
-            'ANY','EXIT','PRINT','AS','FETCH','PROC','ASC','FILE','PROCEDURE','AUTHORIZATION','FILLFACTOR','PUBLIC',
99
-            'BACKUP','FOR','RAISERROR','BEGIN','FOREIGN','READ','BETWEEN','FREETEXT','READTEXT','BREAK','FREETEXTTABLE',
100
-            'RECONFIGURE','BROWSE','FROM','REFERENCES','BULK','FULL','REPLICATION','BY','FUNCTION','RESTORE',
101
-            'CASCADE','GOTO','RESTRICT','CASE','GRANT','RETURN','CHECK','GROUP','REVOKE','CHECKPOINT','HAVING','RIGHT','CLOSE',
102
-            'HOLDLOCK','ROLLBACK','CLUSTERED','IDENTITY','ROWCOUNT','COALESCE','IDENTITY_INSERT','ROWGUIDCOL','COLLATE','IDENTITYCOL',
103
-            'RULE','COLUMN','IF','SAVE','COMMIT','IN','SCHEMA','COMPUTE','INDEX','SELECT','CONSTRAINT','INNER','SESSION_USER',
104
-            'CONTAINS','INSERT','SET','CONTAINSTABLE','INTERSECT','SETUSER','CONTINUE','INTO','SHUTDOWN','CONVERT','IS','SOME',
105
-            'CREATE','JOIN','STATISTICS','CROSS','KEY','SYSTEM_USER','CURRENT','KILL','TABLE','CURRENT_DATE','LEFT','TEXTSIZE',
106
-            'CURRENT_TIME','LIKE','THEN','CURRENT_TIMESTAMP','LINENO','TO','CURRENT_USER','LOAD','TOP','CURSOR','NATIONAL','TRAN',
107
-            'DATABASE','NOCHECK','TRANSACTION','DBCC','NONCLUSTERED','TRIGGER','DEALLOCATE','NOT','TRUNCATE','DECLARE','NULL','TSEQUAL',
108
-            'DEFAULT','NULLIF','UNION','DELETE','OF','UNIQUE','DENY','OFF','UPDATE','DESC','OFFSETS','UPDATETEXT',
109
-            'DISK','ON','USE','DISTINCT','OPEN','USER','DISTRIBUTED','OPENCONNECTOR','VALUES','DOUBLE','OPENQUERY','VARYING',
110
-            'DROP','OPENROWSET','VIEW','DUMMY','OPENXML','WAITFOR','DUMP','OPTION','WHEN','ELSE','OR','WHERE',
111
-            'END','ORDER','WHILE','ERRLVL','OUTER','WITH','ESCAPE','OVER','WRITETEXT',
97
+            'ADD', 'EXCEPT', 'PERCENT', 'ALL', 'EXEC', 'PLAN', 'ALTER', 'EXECUTE', 'PRECISION', 'AND', 'EXISTS', 'PRIMARY',
98
+            'ANY', 'EXIT', 'PRINT', 'AS', 'FETCH', 'PROC', 'ASC', 'FILE', 'PROCEDURE', 'AUTHORIZATION', 'FILLFACTOR', 'PUBLIC',
99
+            'BACKUP', 'FOR', 'RAISERROR', 'BEGIN', 'FOREIGN', 'READ', 'BETWEEN', 'FREETEXT', 'READTEXT', 'BREAK', 'FREETEXTTABLE',
100
+            'RECONFIGURE', 'BROWSE', 'FROM', 'REFERENCES', 'BULK', 'FULL', 'REPLICATION', 'BY', 'FUNCTION', 'RESTORE',
101
+            'CASCADE', 'GOTO', 'RESTRICT', 'CASE', 'GRANT', 'RETURN', 'CHECK', 'GROUP', 'REVOKE', 'CHECKPOINT', 'HAVING', 'RIGHT', 'CLOSE',
102
+            'HOLDLOCK', 'ROLLBACK', 'CLUSTERED', 'IDENTITY', 'ROWCOUNT', 'COALESCE', 'IDENTITY_INSERT', 'ROWGUIDCOL', 'COLLATE', 'IDENTITYCOL',
103
+            'RULE', 'COLUMN', 'IF', 'SAVE', 'COMMIT', 'IN', 'SCHEMA', 'COMPUTE', 'INDEX', 'SELECT', 'CONSTRAINT', 'INNER', 'SESSION_USER',
104
+            'CONTAINS', 'INSERT', 'SET', 'CONTAINSTABLE', 'INTERSECT', 'SETUSER', 'CONTINUE', 'INTO', 'SHUTDOWN', 'CONVERT', 'IS', 'SOME',
105
+            'CREATE', 'JOIN', 'STATISTICS', 'CROSS', 'KEY', 'SYSTEM_USER', 'CURRENT', 'KILL', 'TABLE', 'CURRENT_DATE', 'LEFT', 'TEXTSIZE',
106
+            'CURRENT_TIME', 'LIKE', 'THEN', 'CURRENT_TIMESTAMP', 'LINENO', 'TO', 'CURRENT_USER', 'LOAD', 'TOP', 'CURSOR', 'NATIONAL', 'TRAN',
107
+            'DATABASE', 'NOCHECK', 'TRANSACTION', 'DBCC', 'NONCLUSTERED', 'TRIGGER', 'DEALLOCATE', 'NOT', 'TRUNCATE', 'DECLARE', 'NULL', 'TSEQUAL',
108
+            'DEFAULT', 'NULLIF', 'UNION', 'DELETE', 'OF', 'UNIQUE', 'DENY', 'OFF', 'UPDATE', 'DESC', 'OFFSETS', 'UPDATETEXT',
109
+            'DISK', 'ON', 'USE', 'DISTINCT', 'OPEN', 'USER', 'DISTRIBUTED', 'OPENCONNECTOR', 'VALUES', 'DOUBLE', 'OPENQUERY', 'VARYING',
110
+            'DROP', 'OPENROWSET', 'VIEW', 'DUMMY', 'OPENXML', 'WAITFOR', 'DUMP', 'OPTION', 'WHEN', 'ELSE', 'OR', 'WHERE',
111
+            'END', 'ORDER', 'WHILE', 'ERRLVL', 'OUTER', 'WITH', 'ESCAPE', 'OVER', 'WRITETEXT',
112 112
             //Mysql Keywords from http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html (those not in MSSQL's list)
113 113
 			'ANALYZE', 'ASENSITIVE', 'BEFORE', 'BIGINT', 'BINARY', 'BOTH', 'CALL', 'CHANGE', 'CHARACTER',
114 114
 			'CONDITION', 'DATABASES', 'DAY_HOUR', 'DAY_MICROSECOND', 'DAY_MINUTE', 'DAY_SECOND', 'DEC', 'DECIMAL', 'DELAYED',
@@ -125,8 +125,8 @@  discard block
 block discarded – undo
125 125
 			'TRAILING', 'TRUE', 'UNDO', 'UNLOCK', 'UNSIGNED', 'USAGE', 'USING', 'UTC_DATE', 'UTC_TIME', 'UTC_TIMESTAMP',
126 126
 			'VARBINARY', 'VARCHARACTER', 'WRITE', 'XOR', 'YEAR_MONTH', 'ZEROFILL', 'CONNECTION', 'LABEL', 'UPGRADE',
127 127
 			//Oracle datatypes
128
-            'DATE','VARCHAR','VARCHAR2','NVARCHAR2','CHAR','NCHAR','NUMBER','PLS_INTEGER','BINARY_INTEGER','LONG','TIMESTAMP',
129
-			'INTERVAL','RAW','ROWID','UROWID','MLSLABEL','CLOB','NCLOB','BLOB','BFILE','XMLTYPE',
128
+            'DATE', 'VARCHAR', 'VARCHAR2', 'NVARCHAR2', 'CHAR', 'NCHAR', 'NUMBER', 'PLS_INTEGER', 'BINARY_INTEGER', 'LONG', 'TIMESTAMP',
129
+			'INTERVAL', 'RAW', 'ROWID', 'UROWID', 'MLSLABEL', 'CLOB', 'NCLOB', 'BLOB', 'BFILE', 'XMLTYPE',
130 130
 			//SugarCRM reserved
131 131
         	'ID', 'ID_C', 'PARENT_NAME', 'PARENT_ID',
132 132
 			);
@@ -134,56 +134,56 @@  discard block
 block discarded – undo
134 134
 
135 135
         //C.L. - Add support to mark related module id columns as reserved keywords
136 136
         require_once 'modules/ModuleBuilder/parsers/relationships/DeployedRelationships.php';
137
-        $relatedModules = array_keys(DeployedRelationships::findRelatableModules()) ;
137
+        $relatedModules = array_keys(DeployedRelationships::findRelatableModules());
138 138
         global $beanList, $current_language;
139
-        foreach($relatedModules as $relModule)
139
+        foreach ($relatedModules as $relModule)
140 140
         {
141
-            if(isset($beanList[$relModule]))
141
+            if (isset($beanList[$relModule]))
142 142
             {
143
-                $field_name_exceptions[] = strtoupper($beanList[$relModule]) . '_ID';
143
+                $field_name_exceptions[] = strtoupper($beanList[$relModule]).'_ID';
144 144
             }
145 145
         }
146 146
 
147
-        if(empty($_REQUEST['view_package']) || $_REQUEST['view_package'] == 'studio') {
147
+        if (empty($_REQUEST['view_package']) || $_REQUEST['view_package'] == 'studio') {
148 148
             $moduleName = $_REQUEST['view_module'];
149 149
             $objectName = BeanFactory::getObjectName($moduleName);
150 150
             $module = BeanFactory::getBean($moduleName);
151 151
 
152
-            VardefManager::loadVardef($moduleName, $objectName,true);
152
+            VardefManager::loadVardef($moduleName, $objectName, true);
153 153
             global $dictionary;
154 154
 
155 155
             // Fix for issue #1177 - when trying to add or edit fields in a module an error message is shown:
156 156
             // "Warning: Creating default object from empty value"
157
-            if(!isset($module->mbvardefs) || is_null($module->mbvardefs)) {
157
+            if (!isset($module->mbvardefs) || is_null($module->mbvardefs)) {
158 158
                 $module->mbvardefs = new stdClass();
159 159
             }
160
-            $module->mbvardefs->vardefs =  $dictionary[$objectName];
160
+            $module->mbvardefs->vardefs = $dictionary[$objectName];
161 161
 			
162 162
             $module->name = $moduleName;
163
-            if(!$ac){
163
+            if (!$ac) {
164 164
                 $ac = new AjaxCompose();
165 165
             }
166
-            $vardef = (!empty($module->mbvardefs->vardefs['fields'][$field_name]))? $module->mbvardefs->vardefs['fields'][$field_name]: array();
167
-            if($isClone){
166
+            $vardef = (!empty($module->mbvardefs->vardefs['fields'][$field_name])) ? $module->mbvardefs->vardefs['fields'][$field_name] : array();
167
+            if ($isClone) {
168 168
                 unset($vardef['name']);
169 169
             }
170 170
           
171
-            if(empty($vardef['name'])){
172
-                if(!empty($_REQUEST['type']))
171
+            if (empty($vardef['name'])) {
172
+                if (!empty($_REQUEST['type']))
173 173
                     $vardef['type'] = $_REQUEST['type'];
174 174
                     $fv->ss->assign('hideLevel', 0);
175
-            }elseif(isset($vardef['custom_module'])){
175
+            }elseif (isset($vardef['custom_module'])) {
176 176
                 $fv->ss->assign('hideLevel', 2);
177
-            }else{
177
+            } else {
178 178
                 $action = 'saveSugarField'; // tyoung - for OOB fields we currently only support modifying the label
179 179
                 $fv->ss->assign('hideLevel', 3);
180 180
             }
181
-            if($isClone && isset($vardef['type']) && $vardef['type'] == 'datetime'){
181
+            if ($isClone && isset($vardef['type']) && $vardef['type'] == 'datetime') {
182 182
             	$vardef['type'] = 'datetimecombo';
183 183
             }
184 184
             
185
-			require_once ('modules/DynamicFields/FieldCases.php') ;
186
-            $tf = get_widget ( empty($vardef [ 'type' ]) ?  "" : $vardef [ 'type' ]) ;
185
+			require_once ('modules/DynamicFields/FieldCases.php');
186
+            $tf = get_widget(empty($vardef ['type']) ? "" : $vardef ['type']);
187 187
             $tf->module = $module;
188 188
             $tf->populateFromRow($vardef);
189 189
 			$vardef = array_merge($vardef, $tf->get_field_def());
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
             //Check if autoincrement fields are allowed
195 195
             $allowAutoInc = true;
196 196
             $enumFields = array();
197
-            foreach($module->field_defs as $field => $def)
197
+            foreach ($module->field_defs as $field => $def)
198 198
             {
199 199
             	if (!empty($def['type']) && $def['type'] == "int" && !empty($def['auto_increment'])) {
200 200
             	   $allowAutoInc = false;
@@ -202,56 +202,56 @@  discard block
 block discarded – undo
202 202
             	}
203 203
                 if (!empty($def['type']) && $def['type'] == "enum" && $field != $vardef['name'])
204 204
                 {
205
-                    if(!empty($def['studio']) && $def['studio'] == "false") continue; //bug51866 
205
+                    if (!empty($def['studio']) && $def['studio'] == "false") continue; //bug51866 
206 206
                     $enumFields[$field] = translate($def['vname'], $moduleName);
207 207
                     if (substr($enumFields[$field], -1) == ":")
208 208
                         $enumFields[$field] = substr($enumFields[$field], 0, strlen($enumFields[$field]) - 1);
209 209
                 }
210 210
             }
211
-            $fv->ss->assign( 'allowAutoInc', $allowAutoInc);   
211
+            $fv->ss->assign('allowAutoInc', $allowAutoInc);   
212 212
 
213
-            $GLOBALS['log']->warn('view.modulefield: hidelevel '.$fv->ss->get_template_vars('hideLevel')." ".print_r($vardef,true));
214
-            if(!empty($vardef['vname'])){
213
+            $GLOBALS['log']->warn('view.modulefield: hidelevel '.$fv->ss->get_template_vars('hideLevel')." ".print_r($vardef, true));
214
+            if (!empty($vardef['vname'])) {
215 215
                 $fv->ss->assign('lbl_value', htmlentities(translate($vardef['vname'], $moduleName), ENT_QUOTES, 'UTF-8'));
216 216
             }
217 217
             $fv->ss->assign('module', $module);
218
-            if(empty($module->mbvardefs->vardefs['fields']['parent_name']) || (isset($vardef['type']) && $vardef['type'] == 'parent'))
218
+            if (empty($module->mbvardefs->vardefs['fields']['parent_name']) || (isset($vardef['type']) && $vardef['type'] == 'parent'))
219 219
 				$field_types['parent'] = $GLOBALS['mod_strings']['parent'];
220 220
 
221
-            $edit_or_add = 'editField' ;
221
+            $edit_or_add = 'editField';
222 222
 
223 223
         } else
224 224
         {
225 225
             require_once('modules/ModuleBuilder/MB/ModuleBuilder.php');
226 226
             $mb = new ModuleBuilder();
227 227
             $moduleName = $_REQUEST['view_module'];
228
-            $module =& $mb->getPackageModule($_REQUEST['view_package'], $moduleName);
229
-            $package =& $mb->packages[$_REQUEST['view_package']];
228
+            $module = & $mb->getPackageModule($_REQUEST['view_package'], $moduleName);
229
+            $package = & $mb->packages[$_REQUEST['view_package']];
230 230
             $module->getVardefs();
231
-            if(!$ac){
231
+            if (!$ac) {
232 232
                 $ac = new AjaxCompose();
233 233
             }
234
-            $vardef = (!empty($module->mbvardefs->vardefs['fields'][$field_name]))? $module->mbvardefs->vardefs['fields'][$field_name]: array();
234
+            $vardef = (!empty($module->mbvardefs->vardefs['fields'][$field_name])) ? $module->mbvardefs->vardefs['fields'][$field_name] : array();
235 235
 
236
-            if($isClone){
236
+            if ($isClone) {
237 237
                 unset($vardef['name']);
238 238
             }
239 239
 
240
-            if(empty($vardef['name'])){
241
-                if(!empty($_REQUEST['type']))$vardef['type'] = $_REQUEST['type'];
240
+            if (empty($vardef['name'])) {
241
+                if (!empty($_REQUEST['type']))$vardef['type'] = $_REQUEST['type'];
242 242
                     $fv->ss->assign('hideLevel', 0);
243
-            }else{
244
-                if(!empty($module->mbvardefs->vardef['fields'][$vardef['name']])){
243
+            } else {
244
+                if (!empty($module->mbvardefs->vardef['fields'][$vardef['name']])) {
245 245
                     $fv->ss->assign('hideLevel', 1);
246
-                }elseif(isset($vardef['custom_module'])){
246
+                }elseif (isset($vardef['custom_module'])) {
247 247
                     $fv->ss->assign('hideLevel', 2);
248
-                }else{
248
+                } else {
249 249
                     $fv->ss->assign('hideLevel', 3); // tyoung bug 17350 - effectively mark template derived fields as readonly
250 250
                 }
251 251
             }
252 252
 
253
-			require_once ('modules/DynamicFields/FieldCases.php') ;
254
-            $tf = get_widget ( empty($vardef [ 'type' ]) ?  "" : $vardef [ 'type' ]) ;
253
+			require_once ('modules/DynamicFields/FieldCases.php');
254
+            $tf = get_widget(empty($vardef ['type']) ? "" : $vardef ['type']);
255 255
             $tf->module = $module;
256 256
             $tf->populateFromRow($vardef);
257 257
             $vardef = array_merge($vardef, $tf->get_field_def());
@@ -260,24 +260,24 @@  discard block
 block discarded – undo
260 260
 
261 261
             $fv->ss->assign('module', $module);
262 262
             $fv->ss->assign('package', $package);
263
-            $fv->ss->assign('MB','1');
263
+            $fv->ss->assign('MB', '1');
264 264
 
265
-            if(isset($vardef['vname']))
266
-                $fv->ss->assign('lbl_value', htmlentities($module->getLabel('en_us',$vardef['vname']), ENT_QUOTES, 'UTF-8'));
267
-			if(empty($module->mbvardefs->vardefs['fields']['parent_name']) || (isset($vardef['type']) && $vardef['type'] == 'parent'))
265
+            if (isset($vardef['vname']))
266
+                $fv->ss->assign('lbl_value', htmlentities($module->getLabel('en_us', $vardef['vname']), ENT_QUOTES, 'UTF-8'));
267
+			if (empty($module->mbvardefs->vardefs['fields']['parent_name']) || (isset($vardef['type']) && $vardef['type'] == 'parent'))
268 268
 				$field_types['parent'] = $GLOBALS['mod_strings']['parent'];
269 269
 
270 270
             $enumFields = array();
271 271
             if (!empty($module->mbvardefs->vardefs['fields']))
272 272
             {
273
-                foreach($module->mbvardefs->vardefs['fields'] as $field => $def)
273
+                foreach ($module->mbvardefs->vardefs['fields'] as $field => $def)
274 274
                 {
275 275
                     if (!empty($def['type']) && $def['type'] == "enum" && $field != $vardef['name'])
276 276
                     {
277 277
                         $enumFields[$field] = isset($module->mblanguage->strings[$current_language][$def['vname']]) ?
278 278
                             $this->mbModule->mblanguage->strings[$current_language][$def['vname']] : translate($field);
279 279
                         if (substr($enumFields[$field], -1) == ":")
280
-                            $enumFields[$field] = substr($enumFields[$field], 0, strlen($enumFields[$field]) -1);
280
+                            $enumFields[$field] = substr($enumFields[$field], 0, strlen($enumFields[$field]) - 1);
281 281
                     }
282 282
                 }
283 283
             }
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
             $edit_or_add = 'mbeditField';
286 286
         }
287 287
 
288
-        if($_REQUEST['action'] == 'RefreshField'){
288
+        if ($_REQUEST['action'] == 'RefreshField') {
289 289
         	require_once('modules/DynamicFields/FieldCases.php');
290 290
             $field = get_widget($_POST['type']);
291 291
             $field->populateFromPost();
@@ -294,52 +294,52 @@  discard block
 block discarded – undo
294 294
             $fv->ss->assign('lbl_value', htmlentities($_REQUEST['labelValue'], ENT_QUOTES, 'UTF-8'));
295 295
         }
296 296
 
297
-        foreach(array("formula", "default", "comments", "help", "visiblityGrid") as $toEscape)
297
+        foreach (array("formula", "default", "comments", "help", "visiblityGrid") as $toEscape)
298 298
 		{
299 299
 			if (!empty($vardef[$toEscape]) && is_string($vardef[$toEscape])) {
300 300
 	        	$vardef[$toEscape] = htmlentities($vardef[$toEscape], ENT_QUOTES, 'UTF-8');
301 301
 	        }
302 302
 		}
303 303
 		
304
-        if((!empty($vardef['studio']) && is_array($vardef['studio']) && !empty($vardef['studio']['no_duplicate']) && $vardef['studio']['no_duplicate'] == true)
304
+        if ((!empty($vardef['studio']) && is_array($vardef['studio']) && !empty($vardef['studio']['no_duplicate']) && $vardef['studio']['no_duplicate'] == true)
305 305
            || (strcmp($field_name, "name") == 0) || (isset($vardef['type']) && $vardef['type'] == 'name')) // bug #35767, do not allow cloning of name field
306 306
             {
307 307
                $fv->ss->assign('no_duplicate', true);
308 308
             }
309 309
 
310
-        $fv->ss->assign('action',$action);
310
+        $fv->ss->assign('action', $action);
311 311
         $fv->ss->assign('isClone', ($isClone ? 1 : 0));
312 312
         $fv->ss->assign("module_dd_fields", $enumFields);
313 313
         $json = getJSONobj();
314 314
 
315 315
         $fv->ss->assign('field_name_exceptions', $json->encode($field_name_exceptions));
316 316
         ksort($field_types);
317
-        $fv->ss->assign('field_types',$field_types);
317
+        $fv->ss->assign('field_types', $field_types);
318 318
 
319 319
 
320 320
         $fv->ss->assign('importable_options', $GLOBALS['app_list_strings']['custom_fields_importable_dom']);
321 321
         $fv->ss->assign('duplicate_merge_options', $GLOBALS['app_list_strings']['custom_fields_merge_dup_dom']);
322 322
 
323
-        $triggers = array () ;
324
-        $existing_field_names = array () ;
325
-        foreach ( $module->mbvardefs->vardefs['fields'] as $field )
323
+        $triggers = array();
324
+        $existing_field_names = array();
325
+        foreach ($module->mbvardefs->vardefs['fields'] as $field)
326 326
         {
327
-        	if ($field [ 'type' ] == 'enum' || $field [ 'type'] == 'multienum' )
327
+        	if ($field ['type'] == 'enum' || $field ['type'] == 'multienum')
328 328
         	{
329
-        		$triggers [] = $field [ 'name' ] ;
329
+        		$triggers [] = $field ['name'];
330 330
         	}
331 331
         	
332 332
         	if (!isset($field['source']) || $field['source'] != 'non-db') {
333
-        		if(preg_match('/^(.*?)(_c)?$/', $field['name'], $matches))
333
+        		if (preg_match('/^(.*?)(_c)?$/', $field['name'], $matches))
334 334
         		{
335 335
         			$existing_field_names [] = strtoupper($matches[1]);	
336 336
         		}
337 337
         	}
338 338
         }
339 339
         
340
-        $fv->ss->assign('triggers',$triggers);
340
+        $fv->ss->assign('triggers', $triggers);
341 341
         $fv->ss->assign('existing_field_names', $json->encode($existing_field_names));
342
-        $fv->ss->assign('mod_strings',$GLOBALS['mod_strings']);
342
+        $fv->ss->assign('mod_strings', $GLOBALS['mod_strings']);
343 343
 
344 344
 		// jchi #24880
345 345
 		// end
@@ -348,20 +348,20 @@  discard block
 block discarded – undo
348 348
         $layout = $fv->getLayout($vardef);
349 349
 
350 350
         $fv->ss->assign('fieldLayout', $layout);
351
-        if(empty($vardef['type']))
351
+        if (empty($vardef['type']))
352 352
         {
353 353
             $vardef['type'] = 'varchar';
354 354
         }
355 355
 
356 356
         $fv->ss->assign('vardef', $vardef);
357 357
 
358
-        if(empty($_REQUEST['field'])){
358
+        if (empty($_REQUEST['field'])) {
359 359
             $edit_or_add = 'addField';
360 360
         }
361 361
 
362 362
         $fv->ss->assign('help_group', $edit_or_add);
363 363
         $body = $this->fetchTemplate($fv, 'modules/ModuleBuilder/tpls/MBModule/field.tpl');
364
-        $ac->addSection('east', translate('LBL_SECTION_FIELDEDITOR','ModuleBuilder'), $body );
364
+        $ac->addSection('east', translate('LBL_SECTION_FIELDEDITOR', 'ModuleBuilder'), $body);
365 365
         return $ac;
366 366
     }
367 367
 
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.deletepackage.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -42,20 +42,20 @@  discard block
 block discarded – undo
42 42
 
43 43
 class Viewdeletepackage extends SugarView
44 44
 {
45
- 	/**
46
-	 * @see SugarView::_getModuleTitleParams()
47
-	 */
48
-	protected function _getModuleTitleParams($browserTitle = false)
49
-	{
50
-	    global $mod_strings;
45
+        /**
46
+         * @see SugarView::_getModuleTitleParams()
47
+         */
48
+    protected function _getModuleTitleParams($browserTitle = false)
49
+    {
50
+        global $mod_strings;
51 51
 	    
52
-    	return array(
53
-    	   translate('LBL_MODULE_NAME','Administration'),
54
-    	   ModuleBuilderController::getModuleTitle(),
55
-    	   );
52
+        return array(
53
+            translate('LBL_MODULE_NAME','Administration'),
54
+            ModuleBuilderController::getModuleTitle(),
55
+            );
56 56
     }
57 57
 
58
-	function display()
58
+    function display()
59 59
     {
60 60
         global $mod_strings;
61 61
         
@@ -63,5 +63,5 @@  discard block
 block discarded – undo
63 63
         $ajax->addSection('center', $mod_strings['LBL_PACKAGE_DELETED'], 
64 64
             str_replace('[[package]]',$_REQUEST['package'],$mod_strings['LBL_PACKAGE_WAS_DELETED']));
65 65
         echo $ajax->getJavascript();
66
- 	}
66
+        }
67 67
 }
68 68
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	    global $mod_strings;
51 51
 	    
52 52
     	return array(
53
-    	   translate('LBL_MODULE_NAME','Administration'),
53
+    	   translate('LBL_MODULE_NAME', 'Administration'),
54 54
     	   ModuleBuilderController::getModuleTitle(),
55 55
     	   );
56 56
     }
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         
62 62
         $ajax = new AjaxCompose();
63 63
         $ajax->addSection('center', $mod_strings['LBL_PACKAGE_DELETED'], 
64
-            str_replace('[[package]]',$_REQUEST['package'],$mod_strings['LBL_PACKAGE_WAS_DELETED']));
64
+            str_replace('[[package]]', $_REQUEST['package'], $mod_strings['LBL_PACKAGE_WAS_DELETED']));
65 65
         echo $ajax->getJavascript();
66 66
  	}
67 67
 }
68 68
\ No newline at end of file
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.home.php 3 patches
Indentation   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -40,51 +40,51 @@
 block discarded – undo
40 40
 require_once('modules/ModuleBuilder/MB/AjaxCompose.php');
41 41
 class ViewHome extends SugarView
42 42
 {
43
-	/**
44
-	 * @see SugarView::_getModuleTitleParams()
45
-	 */
46
-	protected function _getModuleTitleParams($browserTitle = false)
47
-	{
48
-	    global $mod_strings;
43
+    /**
44
+     * @see SugarView::_getModuleTitleParams()
45
+     */
46
+    protected function _getModuleTitleParams($browserTitle = false)
47
+    {
48
+        global $mod_strings;
49 49
 	    
50
-    	return array(
51
-    	   translate('LBL_MODULE_NAME','Administration'),
52
-    	   ModuleBuilderController::getModuleTitle(),
53
-    	   );
50
+        return array(
51
+            translate('LBL_MODULE_NAME','Administration'),
52
+            ModuleBuilderController::getModuleTitle(),
53
+            );
54 54
     }
55 55
 
56
-	function display()
57
-	{
58
-		global $current_user;
59
-		global $mod_strings;
60
-		$smarty = new Sugar_Smarty();
61
-		$smarty->assign('title' , $mod_strings['LBL_DEVELOPER_TOOLS']);
62
-		$smarty->assign('question', $mod_strings['LBL_QUESTION_EDITOR']);
63
-		$smarty->assign('defaultHelp', 'mainHelp');
64
-		$this->generateHomeButtons();
65
-		$smarty->assign('buttons', $this->buttons);
66
-		$assistant=array('group'=>'main', 'key'=>'welcome');
67
-		$smarty->assign('assistant',$assistant);
68
-		//initialize Assistant's display property.
69
-		$userPref = $current_user->getPreference('mb_assist', 'Assistant');
70
-		if(!$userPref) $userPref="na";
71
-		$smarty->assign('userPref',$userPref);
72
-		$ajax = new AjaxCompose();
73
-		$ajax->addSection('center', $mod_strings['LBL_HOME'],$smarty->fetch('modules/ModuleBuilder/tpls/wizard.tpl'));
74
-		echo $ajax->getJavascript();
75
-	}
56
+    function display()
57
+    {
58
+        global $current_user;
59
+        global $mod_strings;
60
+        $smarty = new Sugar_Smarty();
61
+        $smarty->assign('title' , $mod_strings['LBL_DEVELOPER_TOOLS']);
62
+        $smarty->assign('question', $mod_strings['LBL_QUESTION_EDITOR']);
63
+        $smarty->assign('defaultHelp', 'mainHelp');
64
+        $this->generateHomeButtons();
65
+        $smarty->assign('buttons', $this->buttons);
66
+        $assistant=array('group'=>'main', 'key'=>'welcome');
67
+        $smarty->assign('assistant',$assistant);
68
+        //initialize Assistant's display property.
69
+        $userPref = $current_user->getPreference('mb_assist', 'Assistant');
70
+        if(!$userPref) $userPref="na";
71
+        $smarty->assign('userPref',$userPref);
72
+        $ajax = new AjaxCompose();
73
+        $ajax->addSection('center', $mod_strings['LBL_HOME'],$smarty->fetch('modules/ModuleBuilder/tpls/wizard.tpl'));
74
+        echo $ajax->getJavascript();
75
+    }
76 76
 
77 77
 
78
-	function generateHomeButtons() 
79
-	{
80
-	    global $current_user;
78
+    function generateHomeButtons() 
79
+    {
80
+        global $current_user;
81 81
         if(displayStudioForCurrentUser() == true) {
82
-		//$this->buttons['Application'] = array ('action' => '', 'imageTitle' => 'Application', 'size' => '128', 'help'=>'appBtn');
83
-		$this->buttons[$GLOBALS['mod_strings']['LBL_STUDIO']] = array ('action' => 'javascript:ModuleBuilder.main("studio")', 'imageTitle' => 'Studio', 'size' => '128', 'help'=>'studioBtn');
82
+        //$this->buttons['Application'] = array ('action' => '', 'imageTitle' => 'Application', 'size' => '128', 'help'=>'appBtn');
83
+        $this->buttons[$GLOBALS['mod_strings']['LBL_STUDIO']] = array ('action' => 'javascript:ModuleBuilder.main("studio")', 'imageTitle' => 'Studio', 'size' => '128', 'help'=>'studioBtn');
84 84
         }
85 85
         if(is_admin($current_user)) {
86
-		$this->buttons[$GLOBALS['mod_strings']['LBL_MODULEBUILDER']] = array ('action' => 'javascript:ModuleBuilder.main("mb")', 'imageTitle' => 'ModuleBuilder', 'size' => '128', 'help'=>'mbBtn');
86
+        $this->buttons[$GLOBALS['mod_strings']['LBL_MODULEBUILDER']] = array ('action' => 'javascript:ModuleBuilder.main("mb")', 'imageTitle' => 'ModuleBuilder', 'size' => '128', 'help'=>'mbBtn');
87 87
         }
88
-		$this->buttons[$GLOBALS['mod_strings']['LBL_DROPDOWNEDITOR']] = array ('action' => 'javascript:ModuleBuilder.main("dropdowns")', 'imageTitle' => $GLOBALS['mod_strings']['LBL_HOME_EDIT_DROPDOWNS'], 'imageName' => 'DropDownEditor', 'size' => '128', 'help'=>'dropDownEditorBtn');
89
-	}
88
+        $this->buttons[$GLOBALS['mod_strings']['LBL_DROPDOWNEDITOR']] = array ('action' => 'javascript:ModuleBuilder.main("dropdowns")', 'imageTitle' => $GLOBALS['mod_strings']['LBL_HOME_EDIT_DROPDOWNS'], 'imageName' => 'DropDownEditor', 'size' => '128', 'help'=>'dropDownEditorBtn');
89
+    }
90 90
 }
91 91
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	    global $mod_strings;
49 49
 	    
50 50
     	return array(
51
-    	   translate('LBL_MODULE_NAME','Administration'),
51
+    	   translate('LBL_MODULE_NAME', 'Administration'),
52 52
     	   ModuleBuilderController::getModuleTitle(),
53 53
     	   );
54 54
     }
@@ -58,19 +58,19 @@  discard block
 block discarded – undo
58 58
 		global $current_user;
59 59
 		global $mod_strings;
60 60
 		$smarty = new Sugar_Smarty();
61
-		$smarty->assign('title' , $mod_strings['LBL_DEVELOPER_TOOLS']);
61
+		$smarty->assign('title', $mod_strings['LBL_DEVELOPER_TOOLS']);
62 62
 		$smarty->assign('question', $mod_strings['LBL_QUESTION_EDITOR']);
63 63
 		$smarty->assign('defaultHelp', 'mainHelp');
64 64
 		$this->generateHomeButtons();
65 65
 		$smarty->assign('buttons', $this->buttons);
66
-		$assistant=array('group'=>'main', 'key'=>'welcome');
67
-		$smarty->assign('assistant',$assistant);
66
+		$assistant = array('group'=>'main', 'key'=>'welcome');
67
+		$smarty->assign('assistant', $assistant);
68 68
 		//initialize Assistant's display property.
69 69
 		$userPref = $current_user->getPreference('mb_assist', 'Assistant');
70
-		if(!$userPref) $userPref="na";
71
-		$smarty->assign('userPref',$userPref);
70
+		if (!$userPref) $userPref = "na";
71
+		$smarty->assign('userPref', $userPref);
72 72
 		$ajax = new AjaxCompose();
73
-		$ajax->addSection('center', $mod_strings['LBL_HOME'],$smarty->fetch('modules/ModuleBuilder/tpls/wizard.tpl'));
73
+		$ajax->addSection('center', $mod_strings['LBL_HOME'], $smarty->fetch('modules/ModuleBuilder/tpls/wizard.tpl'));
74 74
 		echo $ajax->getJavascript();
75 75
 	}
76 76
 
@@ -78,13 +78,13 @@  discard block
 block discarded – undo
78 78
 	function generateHomeButtons() 
79 79
 	{
80 80
 	    global $current_user;
81
-        if(displayStudioForCurrentUser() == true) {
81
+        if (displayStudioForCurrentUser() == true) {
82 82
 		//$this->buttons['Application'] = array ('action' => '', 'imageTitle' => 'Application', 'size' => '128', 'help'=>'appBtn');
83
-		$this->buttons[$GLOBALS['mod_strings']['LBL_STUDIO']] = array ('action' => 'javascript:ModuleBuilder.main("studio")', 'imageTitle' => 'Studio', 'size' => '128', 'help'=>'studioBtn');
83
+		$this->buttons[$GLOBALS['mod_strings']['LBL_STUDIO']] = array('action' => 'javascript:ModuleBuilder.main("studio")', 'imageTitle' => 'Studio', 'size' => '128', 'help'=>'studioBtn');
84 84
         }
85
-        if(is_admin($current_user)) {
86
-		$this->buttons[$GLOBALS['mod_strings']['LBL_MODULEBUILDER']] = array ('action' => 'javascript:ModuleBuilder.main("mb")', 'imageTitle' => 'ModuleBuilder', 'size' => '128', 'help'=>'mbBtn');
85
+        if (is_admin($current_user)) {
86
+		$this->buttons[$GLOBALS['mod_strings']['LBL_MODULEBUILDER']] = array('action' => 'javascript:ModuleBuilder.main("mb")', 'imageTitle' => 'ModuleBuilder', 'size' => '128', 'help'=>'mbBtn');
87 87
         }
88
-		$this->buttons[$GLOBALS['mod_strings']['LBL_DROPDOWNEDITOR']] = array ('action' => 'javascript:ModuleBuilder.main("dropdowns")', 'imageTitle' => $GLOBALS['mod_strings']['LBL_HOME_EDIT_DROPDOWNS'], 'imageName' => 'DropDownEditor', 'size' => '128', 'help'=>'dropDownEditorBtn');
88
+		$this->buttons[$GLOBALS['mod_strings']['LBL_DROPDOWNEDITOR']] = array('action' => 'javascript:ModuleBuilder.main("dropdowns")', 'imageTitle' => $GLOBALS['mod_strings']['LBL_HOME_EDIT_DROPDOWNS'], 'imageName' => 'DropDownEditor', 'size' => '128', 'help'=>'dropDownEditorBtn');
89 89
 	}
90 90
 }
91 91
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,9 @@
 block discarded – undo
67 67
 		$smarty->assign('assistant',$assistant);
68 68
 		//initialize Assistant's display property.
69 69
 		$userPref = $current_user->getPreference('mb_assist', 'Assistant');
70
-		if(!$userPref) $userPref="na";
70
+		if(!$userPref) {
71
+		    $userPref="na";
72
+		}
71 73
 		$smarty->assign('userPref',$userPref);
72 74
 		$ajax = new AjaxCompose();
73 75
 		$ajax->addSection('center', $mod_strings['LBL_HOME'],$smarty->fetch('modules/ModuleBuilder/tpls/wizard.tpl'));
Please login to merge, or discard this patch.
modules/ModuleBuilder/parsers/StandardField.php 3 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
 
45 45
 class StandardField extends DynamicField
46 46
 {
47
-	var $custom_def = array();
48
-	var $base_def = array();
49
-	var $baseField;
47
+    var $custom_def = array();
48
+    var $base_def = array();
49
+    var $baseField;
50 50
 	
51 51
 
52 52
     function __construct($module = '') {
@@ -54,15 +54,15 @@  discard block
 block discarded – undo
54 54
     }
55 55
     
56 56
     protected function loadCustomDef($field){
57
-    	global $beanList;
58
-    	if (!empty($beanList[$this->module]) && is_file("custom/Extension/modules/{$this->module}/Ext/Vardefs/sugarfield_$field.php"))
59
-    	{
57
+        global $beanList;
58
+        if (!empty($beanList[$this->module]) && is_file("custom/Extension/modules/{$this->module}/Ext/Vardefs/sugarfield_$field.php"))
59
+        {
60 60
             $bean_name = get_valid_bean_name($this->module);
61 61
             $dictionary = array($bean_name => array("fields" => array($field => array())));
62 62
             include("$this->base_path/sugarfield_$field.php");
63 63
             if (!empty($dictionary[$bean_name]) && isset($dictionary[$bean_name]["fields"][$field]))
64 64
                 $this->custom_def = $dictionary[$bean_name]["fields"][$field];
65
-    	}
65
+        }
66 66
     }
67 67
 
68 68
     protected function loadBaseDef($field){
@@ -118,24 +118,24 @@  discard block
 block discarded – undo
118 118
         $this->baseField = get_widget ( $field->type) ;
119 119
         foreach ($field->vardef_map as $property => $fmd_col){
120 120
            
121
-        	if ($property == "action" || $property == "label_value" || $property == "label"
122
-            	|| ((substr($property, 0,3) == 'ext' && strlen($property) == 4))
121
+            if ($property == "action" || $property == "label_value" || $property == "label"
122
+                || ((substr($property, 0,3) == 'ext' && strlen($property) == 4))
123 123
             ) 
124
-            	continue;
124
+                continue;
125 125
        	 		
126 126
             // Bug 37043 - Avoid writing out vardef defintions that are the default value.
127 127
             if (isset($newDef[$property]) &&
128
-            	((!isset($currdef[$property]) && !$this->isDefaultValue($property,$newDef[$property], $this->baseField))
129
-            		|| (isset($currdef[$property]) && $currdef[$property] != $newDef[$property])
130
-            	)
128
+                ((!isset($currdef[$property]) && !$this->isDefaultValue($property,$newDef[$property], $this->baseField))
129
+                    || (isset($currdef[$property]) && $currdef[$property] != $newDef[$property])
130
+                )
131 131
             ){
132
-            	$this->custom_def[$property] =
132
+                $this->custom_def[$property] =
133 133
                     is_string($newDef[$property]) ? htmlspecialchars_decode($newDef[$property], ENT_QUOTES) : $newDef[$property];
134 134
             }
135 135
             
136 136
             //Remove any orphaned entries
137 137
             if (isset($this->custom_def[$property]) && !isset($newDef[$property]))
138
-            	unset($this->custom_def[$property]);
138
+                unset($this->custom_def[$property]);
139 139
 
140 140
             //Handle overrides of out of the box definitions with empty
141 141
             if (!empty($this->base_def[$property]) && !isset($newDef[$property]))
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
         }
154 154
         
155 155
         if (isset($this->custom_def["duplicate_merge_dom_value"]) && !isset($this->custom_def["duplicate_merge"]))
156
-        	unset($this->custom_def["duplicate_merge_dom_value"]);
156
+            unset($this->custom_def["duplicate_merge_dom_value"]);
157 157
         
158 158
         $this->writeVardefExtension($bean_name, $field, $this->custom_def);
159 159
     }
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (! defined ( 'sugarEntry' ) || ! sugarEntry)
3
-    die ( 'Not A Valid Entry Point' ) ;
2
+if (!defined('sugarEntry') || !sugarEntry)
3
+    die ('Not A Valid Entry Point');
4 4
 /*********************************************************************************
5 5
  * SugarCRM Community Edition is a customer relationship management program developed by
6 6
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
  ********************************************************************************/
41 41
 
42 42
 
43
-require_once ('modules/DynamicFields/DynamicField.php') ;
43
+require_once ('modules/DynamicFields/DynamicField.php');
44 44
 
45 45
 class StandardField extends DynamicField
46 46
 {
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         parent::DynamicField($module);
54 54
     }
55 55
     
56
-    protected function loadCustomDef($field){
56
+    protected function loadCustomDef($field) {
57 57
     	global $beanList;
58 58
     	if (!empty($beanList[$this->module]) && is_file("custom/Extension/modules/{$this->module}/Ext/Vardefs/sugarfield_$field.php"))
59 59
     	{
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     	}
66 66
     }
67 67
 
68
-    protected function loadBaseDef($field){
68
+    protected function loadBaseDef($field) {
69 69
         global $beanList;
70 70
         if (!empty($beanList[$this->module]) && is_file("modules/{$this->module}/vardefs.php"))
71 71
         {
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      * @param Field Object $field
83 83
      * @return boolean
84 84
      */
85
-    function addFieldObject(&$field){
85
+    function addFieldObject(&$field) {
86 86
         global $dictionary, $beanList;
87 87
         
88 88
         
@@ -98,9 +98,9 @@  discard block
 block discarded – undo
98 98
 
99 99
         // set $field->unified_search=true if field supports unified search
100 100
         // regarding #51427
101
-        if($field->supports_unified_search)
101
+        if ($field->supports_unified_search)
102 102
         {
103
-            if(isset($dictionary[$bean_name]['unified_search_default_enabled']) && isset($dictionary[$bean_name]['unified_search'])
103
+            if (isset($dictionary[$bean_name]['unified_search_default_enabled']) && isset($dictionary[$bean_name]['unified_search'])
104 104
             && $dictionary[$bean_name]['unified_search_default_enabled'] && $dictionary[$bean_name]['unified_search'])
105 105
             {
106 106
                 $currdef['unified_search'] = $field->unified_search = isset($currdef['unified_search'])
@@ -114,21 +114,21 @@  discard block
 block discarded – undo
114 114
         $this->loadBaseDef($field->name);
115 115
         $newDef = $field->get_field_def();
116 116
         
117
-        require_once ('modules/DynamicFields/FieldCases.php') ;
118
-        $this->baseField = get_widget ( $field->type) ;
119
-        foreach ($field->vardef_map as $property => $fmd_col){
117
+        require_once ('modules/DynamicFields/FieldCases.php');
118
+        $this->baseField = get_widget($field->type);
119
+        foreach ($field->vardef_map as $property => $fmd_col) {
120 120
            
121 121
         	if ($property == "action" || $property == "label_value" || $property == "label"
122
-            	|| ((substr($property, 0,3) == 'ext' && strlen($property) == 4))
122
+            	|| ((substr($property, 0, 3) == 'ext' && strlen($property) == 4))
123 123
             ) 
124 124
             	continue;
125 125
        	 		
126 126
             // Bug 37043 - Avoid writing out vardef defintions that are the default value.
127 127
             if (isset($newDef[$property]) &&
128
-            	((!isset($currdef[$property]) && !$this->isDefaultValue($property,$newDef[$property], $this->baseField))
128
+            	((!isset($currdef[$property]) && !$this->isDefaultValue($property, $newDef[$property], $this->baseField))
129 129
             		|| (isset($currdef[$property]) && $currdef[$property] != $newDef[$property])
130 130
             	)
131
-            ){
131
+            ) {
132 132
             	$this->custom_def[$property] =
133 133
                     is_string($newDef[$property]) ? htmlspecialchars_decode($newDef[$property], ENT_QUOTES) : $newDef[$property];
134 134
             }
@@ -141,11 +141,11 @@  discard block
 block discarded – undo
141 141
             if (!empty($this->base_def[$property]) && !isset($newDef[$property]))
142 142
             {
143 143
                 //Switch on type of the property to find what the correct 'empty' is.
144
-                if(is_string($this->base_def[$property]))
144
+                if (is_string($this->base_def[$property]))
145 145
                     $this->custom_def[$property] = "";
146
-                else if(is_array($this->base_def[$property]))
146
+                else if (is_array($this->base_def[$property]))
147 147
                     $this->custom_def[$property] = array();
148
-                else if(is_bool($this->base_def[$property]))
148
+                else if (is_bool($this->base_def[$property]))
149 149
                     $this->custom_def[$property] = false;
150 150
                 else
151 151
                     $this->custom_def[$property] = null;
Please login to merge, or discard this patch.
Braces   +32 added lines, -23 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (! defined ( 'sugarEntry' ) || ! sugarEntry)
2
+if (! defined ( 'sugarEntry' ) || ! sugarEntry) {
3 3
     die ( 'Not A Valid Entry Point' ) ;
4
+}
4 5
 /*********************************************************************************
5 6
  * SugarCRM Community Edition is a customer relationship management program developed by
6 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -60,8 +61,9 @@  discard block
 block discarded – undo
60 61
             $bean_name = get_valid_bean_name($this->module);
61 62
             $dictionary = array($bean_name => array("fields" => array($field => array())));
62 63
             include("$this->base_path/sugarfield_$field.php");
63
-            if (!empty($dictionary[$bean_name]) && isset($dictionary[$bean_name]["fields"][$field]))
64
-                $this->custom_def = $dictionary[$bean_name]["fields"][$field];
64
+            if (!empty($dictionary[$bean_name]) && isset($dictionary[$bean_name]["fields"][$field])) {
65
+                            $this->custom_def = $dictionary[$bean_name]["fields"][$field];
66
+            }
65 67
     	}
66 68
     }
67 69
 
@@ -71,8 +73,9 @@  discard block
 block discarded – undo
71 73
         {
72 74
             $dictionary = array();
73 75
             include("modules/{$this->module}/vardefs.php");
74
-            if (!empty($dictionary[$beanList[$this->module]]) && isset($dictionary[$beanList[$this->module]]["fields"][$field]))
75
-                $this->base_def = $dictionary[$beanList[$this->module]]["fields"][$field];
76
+            if (!empty($dictionary[$beanList[$this->module]]) && isset($dictionary[$beanList[$this->module]]["fields"][$field])) {
77
+                            $this->base_def = $dictionary[$beanList[$this->module]]["fields"][$field];
78
+            }
76 79
         }
77 80
     }
78 81
     
@@ -86,13 +89,15 @@  discard block
 block discarded – undo
86 89
         global $dictionary, $beanList;
87 90
         
88 91
         
89
-        if (empty($beanList[$this->module]))
90
-            return false;
92
+        if (empty($beanList[$this->module])) {
93
+                    return false;
94
+        }
91 95
 
92 96
         $bean_name = get_valid_bean_name($this->module);
93 97
 
94
-        if (empty($dictionary[$bean_name]) || empty($dictionary[$bean_name]["fields"][$field->name]))
95
-            return false;
98
+        if (empty($dictionary[$bean_name]) || empty($dictionary[$bean_name]["fields"][$field->name])) {
99
+                    return false;
100
+        }
96 101
 
97 102
         $currdef = $dictionary[$bean_name]["fields"][$field->name];
98 103
 
@@ -120,8 +125,9 @@  discard block
 block discarded – undo
120 125
            
121 126
         	if ($property == "action" || $property == "label_value" || $property == "label"
122 127
             	|| ((substr($property, 0,3) == 'ext' && strlen($property) == 4))
123
-            ) 
124
-            	continue;
128
+            ) {
129
+        	            	continue;
130
+        	}
125 131
        	 		
126 132
             // Bug 37043 - Avoid writing out vardef defintions that are the default value.
127 133
             if (isset($newDef[$property]) &&
@@ -134,26 +140,29 @@  discard block
 block discarded – undo
134 140
             }
135 141
             
136 142
             //Remove any orphaned entries
137
-            if (isset($this->custom_def[$property]) && !isset($newDef[$property]))
138
-            	unset($this->custom_def[$property]);
143
+            if (isset($this->custom_def[$property]) && !isset($newDef[$property])) {
144
+                        	unset($this->custom_def[$property]);
145
+            }
139 146
 
140 147
             //Handle overrides of out of the box definitions with empty
141 148
             if (!empty($this->base_def[$property]) && !isset($newDef[$property]))
142 149
             {
143 150
                 //Switch on type of the property to find what the correct 'empty' is.
144
-                if(is_string($this->base_def[$property]))
145
-                    $this->custom_def[$property] = "";
146
-                else if(is_array($this->base_def[$property]))
147
-                    $this->custom_def[$property] = array();
148
-                else if(is_bool($this->base_def[$property]))
149
-                    $this->custom_def[$property] = false;
150
-                else
151
-                    $this->custom_def[$property] = null;
151
+                if(is_string($this->base_def[$property])) {
152
+                                    $this->custom_def[$property] = "";
153
+                } else if(is_array($this->base_def[$property])) {
154
+                                    $this->custom_def[$property] = array();
155
+                } else if(is_bool($this->base_def[$property])) {
156
+                                    $this->custom_def[$property] = false;
157
+                } else {
158
+                                    $this->custom_def[$property] = null;
159
+                }
152 160
             }
153 161
         }
154 162
         
155
-        if (isset($this->custom_def["duplicate_merge_dom_value"]) && !isset($this->custom_def["duplicate_merge"]))
156
-        	unset($this->custom_def["duplicate_merge_dom_value"]);
163
+        if (isset($this->custom_def["duplicate_merge_dom_value"]) && !isset($this->custom_def["duplicate_merge"])) {
164
+                	unset($this->custom_def["duplicate_merge_dom_value"]);
165
+        }
157 166
         
158 167
         $this->writeVardefExtension($bean_name, $field, $this->custom_def);
159 168
     }
Please login to merge, or discard this patch.
modules/ModuleBuilder/parsers/relationships/OneToOneRelationship.php 2 patches
Spacing   +30 added lines, -30 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,7 +39,7 @@  discard block
 block discarded – undo
39 39
  ********************************************************************************/
40 40
 
41 41
 
42
-require_once 'modules/ModuleBuilder/parsers/relationships/AbstractRelationship.php' ;
42
+require_once 'modules/ModuleBuilder/parsers/relationships/AbstractRelationship.php';
43 43
 
44 44
 /*
45 45
  * Class to manage the metadata for a One-To-One Relationship
@@ -71,9 +71,9 @@  discard block
 block discarded – undo
71 71
      * Constructor
72 72
      * @param array $definition Parameters passed in as array with keys defined in parent::keys
73 73
      */
74
-    function __construct ($definition)
74
+    function __construct($definition)
75 75
     {
76
-        parent::__construct ( $definition ) ;
76
+        parent::__construct($definition);
77 77
     }
78 78
     
79 79
     /*
@@ -83,55 +83,55 @@  discard block
 block discarded – undo
83 83
     /*
84 84
      * @return array    An array of relationship metadata definitions
85 85
      */
86
-    function buildRelationshipMetaData ()
86
+    function buildRelationshipMetaData()
87 87
     {
88
-        return array( $this->lhs_module => $this->getRelationshipMetaData ( MB_ONETOONE ) ) ;
88
+        return array($this->lhs_module => $this->getRelationshipMetaData(MB_ONETOONE));
89 89
     }
90 90
 
91 91
     /* Build a set of Link Field definitions for this relationship
92 92
      * @return array    An array of field definitions, ready for the vardefs, keyed by module
93 93
      */
94
-    function buildVardefs ( )
94
+    function buildVardefs( )
95 95
     {
96
-        $vardefs = array ( ) ;
97
-        $vardefs [ $this->rhs_module ] [] = $this->getLinkFieldDefinition ( $this->lhs_module, $this->relationship_name , false, 
98
-            'LBL_' . strtoupper ( $this->relationship_name . '_FROM_' . $this->getLeftModuleSystemLabel() ) . '_TITLE' ,
99
-            $this->relationship_only ? false : $this->getIDName( $this->lhs_module )
100
-        ) ;
101
-        $vardefs [ $this->lhs_module ] [] = $this->getLinkFieldDefinition ( $this->rhs_module, $this->relationship_name, false, 
102
-            'LBL_' . strtoupper ( $this->relationship_name . '_FROM_' . $this->getRightModuleSystemLabel()   ) . '_TITLE'  ,
103
-            $this->relationship_only ? false : $this->getIDName( $this->rhs_module )
104
-        ) ;
96
+        $vardefs = array( );
97
+        $vardefs [$this->rhs_module] [] = $this->getLinkFieldDefinition($this->lhs_module, $this->relationship_name, false, 
98
+            'LBL_'.strtoupper($this->relationship_name.'_FROM_'.$this->getLeftModuleSystemLabel()).'_TITLE',
99
+            $this->relationship_only ? false : $this->getIDName($this->lhs_module)
100
+        );
101
+        $vardefs [$this->lhs_module] [] = $this->getLinkFieldDefinition($this->rhs_module, $this->relationship_name, false, 
102
+            'LBL_'.strtoupper($this->relationship_name.'_FROM_'.$this->getRightModuleSystemLabel()).'_TITLE',
103
+            $this->relationship_only ? false : $this->getIDName($this->rhs_module)
104
+        );
105 105
         
106 106
         if (!$this->relationship_only)
107 107
         {
108
-            $vardefs [ $this->lhs_module ] [] = $this->getRelateFieldDefinition ( $this->rhs_module, $this->relationship_name, $this->getRightModuleSystemLabel() ) ;
109
-            $vardefs [ $this->rhs_module ] [] = $this->getRelateFieldDefinition ( $this->lhs_module, $this->relationship_name, $this->getLeftModuleSystemLabel() ) ;
110
-            $vardefs [ $this->lhs_module ] [] = $this->getLink2FieldDefinition ( $this->rhs_module, $this->relationship_name , false, 
111
-            'LBL_' . strtoupper ( $this->relationship_name . '_FROM_' . $this->getRightModuleSystemLabel()   ) . '_TITLE' ) ;
112
-            $vardefs [ $this->rhs_module ] [] = $this->getLink2FieldDefinition ( $this->lhs_module, $this->relationship_name , false, 
113
-            'LBL_' . strtoupper ( $this->relationship_name . '_FROM_' . $this->getLeftModuleSystemLabel() ) . '_TITLE' ) ;
108
+            $vardefs [$this->lhs_module] [] = $this->getRelateFieldDefinition($this->rhs_module, $this->relationship_name, $this->getRightModuleSystemLabel());
109
+            $vardefs [$this->rhs_module] [] = $this->getRelateFieldDefinition($this->lhs_module, $this->relationship_name, $this->getLeftModuleSystemLabel());
110
+            $vardefs [$this->lhs_module] [] = $this->getLink2FieldDefinition($this->rhs_module, $this->relationship_name, false, 
111
+            'LBL_'.strtoupper($this->relationship_name.'_FROM_'.$this->getRightModuleSystemLabel()).'_TITLE');
112
+            $vardefs [$this->rhs_module] [] = $this->getLink2FieldDefinition($this->lhs_module, $this->relationship_name, false, 
113
+            'LBL_'.strtoupper($this->relationship_name.'_FROM_'.$this->getLeftModuleSystemLabel()).'_TITLE');
114 114
         }
115 115
         
116
-        return $vardefs ;
116
+        return $vardefs;
117 117
     }
118 118
 
119 119
     /*
120 120
      * Define what fields to add to which modules layouts
121 121
      * @return array    An array of module => fieldname
122 122
      */
123
-    function buildFieldsToLayouts ()
123
+    function buildFieldsToLayouts()
124 124
     {
125 125
         if ($this->relationship_only)
126
-            return array () ;
126
+            return array();
127 127
  
128 128
         if ($this->lhs_module == $this->rhs_module) // don't add in two fields on recursive relationships
129
-            return array ( $this->lhs_module => $this->getValidDBName($this->relationship_name . "_name") );
129
+            return array($this->lhs_module => $this->getValidDBName($this->relationship_name."_name"));
130 130
         else
131
-            return array (
132
-                $this->lhs_module => $this->getValidDBName($this->relationship_name . "_name") ,
133
-                $this->rhs_module => $this->getValidDBName($this->relationship_name . "_name")
134
-            ) ;
131
+            return array(
132
+                $this->lhs_module => $this->getValidDBName($this->relationship_name."_name"),
133
+                $this->rhs_module => $this->getValidDBName($this->relationship_name."_name")
134
+            );
135 135
     }
136 136
 
137 137
 }
Please login to merge, or discard this patch.
Braces   +11 added lines, -6 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.
@@ -122,16 +124,19 @@  discard block
 block discarded – undo
122 124
      */
123 125
     function buildFieldsToLayouts ()
124 126
     {
125
-        if ($this->relationship_only)
126
-            return array () ;
127
+        if ($this->relationship_only) {
128
+                    return array () ;
129
+        }
127 130
  
128
-        if ($this->lhs_module == $this->rhs_module) // don't add in two fields on recursive relationships
131
+        if ($this->lhs_module == $this->rhs_module) {
132
+            // don't add in two fields on recursive relationships
129 133
             return array ( $this->lhs_module => $this->getValidDBName($this->relationship_name . "_name") );
130
-        else
131
-            return array (
134
+        } else {
135
+                    return array (
132 136
                 $this->lhs_module => $this->getValidDBName($this->relationship_name . "_name") ,
133 137
                 $this->rhs_module => $this->getValidDBName($this->relationship_name . "_name")
134 138
             ) ;
139
+        }
135 140
     }
136 141
 
137 142
 }
Please login to merge, or discard this patch.