@@ -48,60 +48,60 @@ |
||
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 |
@@ -56,7 +56,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -1,6 +1,7 @@ discard block |
||
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 | /********************************************************************************* |
6 | 7 | * SugarCRM Community Edition is a customer relationship management program developed by |
@@ -255,9 +256,9 @@ discard block |
||
255 | 256 | $ajax = new AjaxCompose ( ) ; |
256 | 257 | |
257 | 258 | $translatedViewType = '' ; |
258 | - if ( isset ( $labels [ strtolower ( $this->editLayout ) ] ) ) |
|
259 | - $translatedViewType = translate ( $labels [ strtolower( $this->editLayout ) ] , 'ModuleBuilder' ) ; |
|
260 | - else if (isset($this->sm)) |
|
259 | + if ( isset ( $labels [ strtolower ( $this->editLayout ) ] ) ) { |
|
260 | + $translatedViewType = translate ( $labels [ strtolower( $this->editLayout ) ] , 'ModuleBuilder' ) ; |
|
261 | + } else if (isset($this->sm)) |
|
261 | 262 | { |
262 | 263 | foreach($this->sm->sources as $file => $def) |
263 | 264 | { |
@@ -270,8 +271,9 @@ discard block |
||
270 | 271 | { |
271 | 272 | $label = "LBL_" . strtoupper($this->editLayout); |
272 | 273 | $translated = translate($label, $this->editModule); |
273 | - if ($translated != $label) |
|
274 | - $translatedViewType = $translated; |
|
274 | + if ($translated != $label) { |
|
275 | + $translatedViewType = $translated; |
|
276 | + } |
|
275 | 277 | } |
276 | 278 | } |
277 | 279 |
@@ -69,16 +69,16 @@ discard block |
||
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
72 | - * @see SugarView::_getModuleTitleParams() |
|
73 | - */ |
|
74 | - protected function _getModuleTitleParams($browserTitle = false) |
|
75 | - { |
|
76 | - global $mod_strings; |
|
77 | - |
|
78 | - return array( |
|
79 | - translate('LBL_MODULE_NAME','Administration'), |
|
80 | - ModuleBuilderController::getModuleTitle(), |
|
81 | - ); |
|
72 | + * @see SugarView::_getModuleTitleParams() |
|
73 | + */ |
|
74 | + protected function _getModuleTitleParams($browserTitle = false) |
|
75 | + { |
|
76 | + global $mod_strings; |
|
77 | + |
|
78 | + return array( |
|
79 | + translate('LBL_MODULE_NAME','Administration'), |
|
80 | + ModuleBuilderController::getModuleTitle(), |
|
81 | + ); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | // DO NOT REMOVE - overrides parent ViewEdit preDisplay() which attempts to load a bean for a non-existent module |
@@ -99,13 +99,13 @@ discard block |
||
99 | 99 | $history = $parser->getHistory () ; |
100 | 100 | $smarty = new Sugar_Smarty ( ) ; |
101 | 101 | //Add in the module we are viewing to our current mod strings |
102 | - if (! $this->fromModuleBuilder) { |
|
103 | - global $current_language; |
|
104 | - $editModStrings = return_module_language($current_language, $this->editModule); |
|
105 | - $mod_strings = sugarArrayMerge($editModStrings, $mod_strings); |
|
106 | - } |
|
102 | + if (! $this->fromModuleBuilder) { |
|
103 | + global $current_language; |
|
104 | + $editModStrings = return_module_language($current_language, $this->editModule); |
|
105 | + $mod_strings = sugarArrayMerge($editModStrings, $mod_strings); |
|
106 | + } |
|
107 | 107 | $smarty->assign('mod', $mod_strings); |
108 | - $smarty->assign('MOD', $mod_strings); |
|
108 | + $smarty->assign('MOD', $mod_strings); |
|
109 | 109 | // assign buttons |
110 | 110 | $images = array ( 'icon_save' => 'studio_save' , 'icon_publish' => 'studio_publish' , 'icon_address' => 'icon_Address' , 'icon_emailaddress' => 'icon_EmailAddress' , 'icon_phone' => 'icon_Phone' ) ; |
111 | 111 | foreach ( $images as $image => $file ) |
@@ -127,9 +127,9 @@ discard block |
||
127 | 127 | |
128 | 128 | //Check if we need to synch edit view to other layouts |
129 | 129 | if($this->editLayout == MB_DETAILVIEW || $this->editLayout == MB_QUICKCREATE){ |
130 | - $parser2 = ParserFactory::getParser(MB_EDITVIEW,$this->editModule,$this->package); |
|
130 | + $parser2 = ParserFactory::getParser(MB_EDITVIEW,$this->editModule,$this->package); |
|
131 | 131 | if($this->editLayout == MB_DETAILVIEW){ |
132 | - $disableLayout = $parser2->getSyncDetailEditViews(); |
|
132 | + $disableLayout = $parser2->getSyncDetailEditViews(); |
|
133 | 133 | } |
134 | 134 | if(!empty($_REQUEST['copyFromEditView'])){ |
135 | 135 | $editViewPanels = $parser2->convertFromCanonicalForm ( $parser2->_viewdefs [ 'panels' ] , $parser2->_fielddefs ) ; |
@@ -138,34 +138,34 @@ discard block |
||
138 | 138 | $parser->setUseTabs($parser2->getUseTabs()); |
139 | 139 | $parser->setTabDefs($parser2->getTabDefs()); |
140 | 140 | } |
141 | - } |
|
141 | + } |
|
142 | 142 | |
143 | 143 | if (! $this->fromModuleBuilder) |
144 | 144 | { |
145 | - $buttons [] = array ( |
|
145 | + $buttons [] = array ( |
|
146 | 146 | 'id' => 'saveBtn' , |
147 | 147 | 'text' => translate ( 'LBL_BTN_SAVE' ) , |
148 | 148 | 'actionScript' => "onclick='if(Studio2.checkGridLayout(\"{$this->editLayout}\")) Studio2.handleSave();'", |
149 | - 'disabled' => $disableLayout, |
|
149 | + 'disabled' => $disableLayout, |
|
150 | 150 | ) ; |
151 | 151 | $buttons [] = array ( |
152 | 152 | 'id' => 'publishBtn' , |
153 | 153 | 'text' => translate ( 'LBL_BTN_SAVEPUBLISH' ) , |
154 | 154 | 'actionScript' => "onclick='if(Studio2.checkGridLayout(\"{$this->editLayout}\")) Studio2.handlePublish();'", |
155 | - 'disabled' => $disableLayout, |
|
155 | + 'disabled' => $disableLayout, |
|
156 | 156 | ) ; |
157 | 157 | $buttons [] = array ( 'id' => 'spacer' , 'width' => '33px' ) ; |
158 | 158 | $buttons [] = array ( |
159 | - 'id' => 'historyBtn' , |
|
160 | - 'text' => translate ( 'LBL_HISTORY' ) , |
|
161 | - 'actionScript' => "onclick='ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\")'", |
|
159 | + 'id' => 'historyBtn' , |
|
160 | + 'text' => translate ( 'LBL_HISTORY' ) , |
|
161 | + 'actionScript' => "onclick='ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\")'", |
|
162 | 162 | 'disabled' => $disableLayout, |
163 | 163 | ) ; |
164 | 164 | $buttons [] = array ( |
165 | - 'id' => 'historyDefault' , |
|
166 | - 'text' => translate ( 'LBL_RESTORE_DEFAULT' ) , |
|
167 | - 'actionScript' => "onclick='ModuleBuilder.history.revert(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$history->getLast()}\", \"\")'", |
|
168 | - 'disabled' => $disableLayout, |
|
165 | + 'id' => 'historyDefault' , |
|
166 | + 'text' => translate ( 'LBL_RESTORE_DEFAULT' ) , |
|
167 | + 'actionScript' => "onclick='ModuleBuilder.history.revert(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$history->getLast()}\", \"\")'", |
|
168 | + 'disabled' => $disableLayout, |
|
169 | 169 | ) ; |
170 | 170 | } else |
171 | 171 | { |
@@ -205,15 +205,15 @@ discard block |
||
205 | 205 | foreach ( $buttons as $button ) |
206 | 206 | { |
207 | 207 | if ($button['id'] == "spacer") { |
208 | - $html .= "<td style='width:{$button['width']}'> </td>"; |
|
208 | + $html .= "<td style='width:{$button['width']}'> </td>"; |
|
209 | 209 | } else { |
210 | - $html .= "<td><input id='{$button['id']}' type='button' valign='center' class='button' style='cursor:pointer' " |
|
211 | - . "onmousedown='this.className=\"buttonOn\";return false;' onmouseup='this.className=\"button\"' " |
|
212 | - . "onmouseout='this.className=\"button\"' {$button['actionScript']} value = '{$button['text']}'" ; |
|
213 | - if(!empty($button['disabled'])){ |
|
214 | - $html .= " disabled"; |
|
215 | - } |
|
216 | - $html .= "></td>"; |
|
210 | + $html .= "<td><input id='{$button['id']}' type='button' valign='center' class='button' style='cursor:pointer' " |
|
211 | + . "onmousedown='this.className=\"buttonOn\";return false;' onmouseup='this.className=\"button\"' " |
|
212 | + . "onmouseout='this.className=\"button\"' {$button['actionScript']} value = '{$button['text']}'" ; |
|
213 | + if(!empty($button['disabled'])){ |
|
214 | + $html .= " disabled"; |
|
215 | + } |
|
216 | + $html .= "></td>"; |
|
217 | 217 | } |
218 | 218 | } |
219 | 219 | |
@@ -243,10 +243,10 @@ discard block |
||
243 | 243 | } |
244 | 244 | |
245 | 245 | $labels = array ( |
246 | - MB_EDITVIEW => 'LBL_EDITVIEW' , |
|
247 | - MB_DETAILVIEW => 'LBL_DETAILVIEW' , |
|
248 | - MB_QUICKCREATE => 'LBL_QUICKCREATE', |
|
249 | - ) ; |
|
246 | + MB_EDITVIEW => 'LBL_EDITVIEW' , |
|
247 | + MB_DETAILVIEW => 'LBL_DETAILVIEW' , |
|
248 | + MB_QUICKCREATE => 'LBL_QUICKCREATE', |
|
249 | + ) ; |
|
250 | 250 | |
251 | 251 | $layoutLabel = 'LBL_LAYOUTS' ; |
252 | 252 | $layoutView = 'layouts' ; |
@@ -255,8 +255,8 @@ discard block |
||
255 | 255 | $ajax = new AjaxCompose ( ) ; |
256 | 256 | |
257 | 257 | $translatedViewType = '' ; |
258 | - if ( isset ( $labels [ strtolower ( $this->editLayout ) ] ) ) |
|
259 | - $translatedViewType = translate ( $labels [ strtolower( $this->editLayout ) ] , 'ModuleBuilder' ) ; |
|
258 | + if ( isset ( $labels [ strtolower ( $this->editLayout ) ] ) ) |
|
259 | + $translatedViewType = translate ( $labels [ strtolower( $this->editLayout ) ] , 'ModuleBuilder' ) ; |
|
260 | 260 | else if (isset($this->sm)) |
261 | 261 | { |
262 | 262 | foreach($this->sm->sources as $file => $def) |
@@ -294,20 +294,20 @@ discard block |
||
294 | 294 | } |
295 | 295 | |
296 | 296 | // set up language files |
297 | - $smarty->assign ( 'language', $parser->getLanguage() ) ; // for sugar_translate in the smarty template |
|
297 | + $smarty->assign ( 'language', $parser->getLanguage() ) ; // for sugar_translate in the smarty template |
|
298 | 298 | $smarty->assign('from_mb',$this->fromModuleBuilder); |
299 | 299 | $smarty->assign('calc_field_list', json_encode($parser->getCalculatedFields())); |
300 | - if ($this->fromModuleBuilder) { |
|
301 | - $mb = new ModuleBuilder ( ) ; |
|
300 | + if ($this->fromModuleBuilder) { |
|
301 | + $mb = new ModuleBuilder ( ) ; |
|
302 | 302 | $module = & $mb->getPackageModule ( $this->package, $this->editModule ) ; |
303 | - $smarty->assign('current_mod_strings', $module->getModStrings()); |
|
304 | - } |
|
303 | + $smarty->assign('current_mod_strings', $module->getModStrings()); |
|
304 | + } |
|
305 | 305 | |
306 | 306 | $ajax->addSection ( 'center', $translatedViewType, $smarty->fetch ( 'modules/ModuleBuilder/tpls/layoutView.tpl' ) ) ; |
307 | 307 | if ($preview) { |
308 | - echo $smarty->fetch ( 'modules/ModuleBuilder/tpls/Preview/layoutView.tpl' ); |
|
309 | - } else { |
|
310 | - echo $ajax->getJavascript () ; |
|
311 | - } |
|
308 | + echo $smarty->fetch ( 'modules/ModuleBuilder/tpls/Preview/layoutView.tpl' ); |
|
309 | + } else { |
|
310 | + echo $ajax->getJavascript () ; |
|
311 | + } |
|
312 | 312 | } |
313 | 313 | } |
@@ -1,6 +1,6 @@ discard block |
||
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 | /********************************************************************************* |
6 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
@@ -41,28 +41,28 @@ discard block |
||
41 | 41 | ********************************************************************************/ |
42 | 42 | |
43 | 43 | |
44 | -require_once ('modules/ModuleBuilder/parsers/ParserFactory.php') ; |
|
45 | -require_once ('modules/ModuleBuilder/MB/AjaxCompose.php') ; |
|
46 | -require_once 'modules/ModuleBuilder/parsers/constants.php' ; |
|
44 | +require_once ('modules/ModuleBuilder/parsers/ParserFactory.php'); |
|
45 | +require_once ('modules/ModuleBuilder/MB/AjaxCompose.php'); |
|
46 | +require_once 'modules/ModuleBuilder/parsers/constants.php'; |
|
47 | 47 | |
48 | 48 | class ViewLayoutView extends SugarView |
49 | 49 | { |
50 | 50 | function __construct() |
51 | 51 | { |
52 | - $GLOBALS [ 'log' ]->debug ( 'in ViewLayoutView' ) ; |
|
53 | - $this->editModule = $_REQUEST [ 'view_module' ] ; |
|
54 | - $this->editLayout = $_REQUEST [ 'view' ] ; |
|
52 | + $GLOBALS ['log']->debug('in ViewLayoutView'); |
|
53 | + $this->editModule = $_REQUEST ['view_module']; |
|
54 | + $this->editLayout = $_REQUEST ['view']; |
|
55 | 55 | $this->package = null; |
56 | - $this->fromModuleBuilder = isset ( $_REQUEST [ 'MB' ] ) || !empty($_REQUEST [ 'view_package' ]); |
|
56 | + $this->fromModuleBuilder = isset ($_REQUEST ['MB']) || !empty($_REQUEST ['view_package']); |
|
57 | 57 | if ($this->fromModuleBuilder) |
58 | 58 | { |
59 | - $this->package = $_REQUEST [ 'view_package' ] ; |
|
59 | + $this->package = $_REQUEST ['view_package']; |
|
60 | 60 | $this->type = $this->editLayout; |
61 | 61 | } else |
62 | 62 | { |
63 | - global $app_list_strings ; |
|
64 | - $moduleNames = array_change_key_case ( $app_list_strings [ 'moduleList' ] ) ; |
|
65 | - $this->translatedEditModule = $moduleNames [ strtolower ( $this->editModule ) ] ; |
|
63 | + global $app_list_strings; |
|
64 | + $moduleNames = array_change_key_case($app_list_strings ['moduleList']); |
|
65 | + $this->translatedEditModule = $moduleNames [strtolower($this->editModule)]; |
|
66 | 66 | $this->sm = StudioModuleFactory::getStudioModule($this->editModule); |
67 | 67 | $this->type = $this->sm->getViewType($this->editLayout); |
68 | 68 | } |
@@ -76,30 +76,30 @@ discard block |
||
76 | 76 | global $mod_strings; |
77 | 77 | |
78 | 78 | return array( |
79 | - translate('LBL_MODULE_NAME','Administration'), |
|
79 | + translate('LBL_MODULE_NAME', 'Administration'), |
|
80 | 80 | ModuleBuilderController::getModuleTitle(), |
81 | 81 | ); |
82 | 82 | } |
83 | 83 | |
84 | 84 | // DO NOT REMOVE - overrides parent ViewEdit preDisplay() which attempts to load a bean for a non-existent module |
85 | - function preDisplay () |
|
85 | + function preDisplay() |
|
86 | 86 | { |
87 | 87 | } |
88 | 88 | |
89 | - function display ($preview = false) |
|
89 | + function display($preview = false) |
|
90 | 90 | { |
91 | 91 | |
92 | - global $mod_strings ; |
|
93 | - $parser = ParserFactory::getParser($this->editLayout,$this->editModule,$this->package); |
|
92 | + global $mod_strings; |
|
93 | + $parser = ParserFactory::getParser($this->editLayout, $this->editModule, $this->package); |
|
94 | 94 | |
95 | - if(isset($this->view_object_map['new_parser'])) { |
|
95 | + if (isset($this->view_object_map['new_parser'])) { |
|
96 | 96 | $parser = $this->view_object_map['new_parser']; |
97 | 97 | } |
98 | 98 | |
99 | - $history = $parser->getHistory () ; |
|
100 | - $smarty = new Sugar_Smarty ( ) ; |
|
99 | + $history = $parser->getHistory(); |
|
100 | + $smarty = new Sugar_Smarty( ); |
|
101 | 101 | //Add in the module we are viewing to our current mod strings |
102 | - if (! $this->fromModuleBuilder) { |
|
102 | + if (!$this->fromModuleBuilder) { |
|
103 | 103 | global $current_language; |
104 | 104 | $editModStrings = return_module_language($current_language, $this->editModule); |
105 | 105 | $mod_strings = sugarArrayMerge($editModStrings, $mod_strings); |
@@ -107,171 +107,171 @@ discard block |
||
107 | 107 | $smarty->assign('mod', $mod_strings); |
108 | 108 | $smarty->assign('MOD', $mod_strings); |
109 | 109 | // assign buttons |
110 | - $images = array ( 'icon_save' => 'studio_save' , 'icon_publish' => 'studio_publish' , 'icon_address' => 'icon_Address' , 'icon_emailaddress' => 'icon_EmailAddress' , 'icon_phone' => 'icon_Phone' ) ; |
|
111 | - foreach ( $images as $image => $file ) |
|
110 | + $images = array('icon_save' => 'studio_save', 'icon_publish' => 'studio_publish', 'icon_address' => 'icon_Address', 'icon_emailaddress' => 'icon_EmailAddress', 'icon_phone' => 'icon_Phone'); |
|
111 | + foreach ($images as $image => $file) |
|
112 | 112 | { |
113 | - $smarty->assign ( $image, SugarThemeRegistry::current()->getImage($file,'',null,null,'.gif',$file) ) ; |
|
113 | + $smarty->assign($image, SugarThemeRegistry::current()->getImage($file, '', null, null, '.gif', $file)); |
|
114 | 114 | } |
115 | 115 | |
116 | - $requiredFields = implode($parser->getRequiredFields () , ','); |
|
116 | + $requiredFields = implode($parser->getRequiredFields(), ','); |
|
117 | 117 | $slashedRequiredFields = addslashes($requiredFields); |
118 | - $buttons = array ( ) ; |
|
118 | + $buttons = array( ); |
|
119 | 119 | $disableLayout = false; |
120 | 120 | |
121 | 121 | if ($preview) |
122 | 122 | { |
123 | - $smarty->assign ( 'layouttitle', translate ( 'LBL_LAYOUT_PREVIEW', 'ModuleBuilder' ) ) ; |
|
123 | + $smarty->assign('layouttitle', translate('LBL_LAYOUT_PREVIEW', 'ModuleBuilder')); |
|
124 | 124 | } else |
125 | 125 | { |
126 | - $smarty->assign ( 'layouttitle', translate ( 'LBL_CURRENT_LAYOUT', 'ModuleBuilder' ) ) ; |
|
126 | + $smarty->assign('layouttitle', translate('LBL_CURRENT_LAYOUT', 'ModuleBuilder')); |
|
127 | 127 | |
128 | 128 | //Check if we need to synch edit view to other layouts |
129 | - if($this->editLayout == MB_DETAILVIEW || $this->editLayout == MB_QUICKCREATE){ |
|
130 | - $parser2 = ParserFactory::getParser(MB_EDITVIEW,$this->editModule,$this->package); |
|
131 | - if($this->editLayout == MB_DETAILVIEW){ |
|
129 | + if ($this->editLayout == MB_DETAILVIEW || $this->editLayout == MB_QUICKCREATE) { |
|
130 | + $parser2 = ParserFactory::getParser(MB_EDITVIEW, $this->editModule, $this->package); |
|
131 | + if ($this->editLayout == MB_DETAILVIEW) { |
|
132 | 132 | $disableLayout = $parser2->getSyncDetailEditViews(); |
133 | 133 | } |
134 | - if(!empty($_REQUEST['copyFromEditView'])){ |
|
135 | - $editViewPanels = $parser2->convertFromCanonicalForm ( $parser2->_viewdefs [ 'panels' ] , $parser2->_fielddefs ) ; |
|
136 | - $parser->_viewdefs [ 'panels' ] = $editViewPanels; |
|
134 | + if (!empty($_REQUEST['copyFromEditView'])) { |
|
135 | + $editViewPanels = $parser2->convertFromCanonicalForm($parser2->_viewdefs ['panels'], $parser2->_fielddefs); |
|
136 | + $parser->_viewdefs ['panels'] = $editViewPanels; |
|
137 | 137 | $parser->_fielddefs = $parser2->_fielddefs; |
138 | 138 | $parser->setUseTabs($parser2->getUseTabs()); |
139 | 139 | $parser->setTabDefs($parser2->getTabDefs()); |
140 | 140 | } |
141 | 141 | } |
142 | 142 | |
143 | - if (! $this->fromModuleBuilder) |
|
143 | + if (!$this->fromModuleBuilder) |
|
144 | 144 | { |
145 | - $buttons [] = array ( |
|
146 | - 'id' => 'saveBtn' , |
|
147 | - 'text' => translate ( 'LBL_BTN_SAVE' ) , |
|
145 | + $buttons [] = array( |
|
146 | + 'id' => 'saveBtn', |
|
147 | + 'text' => translate('LBL_BTN_SAVE'), |
|
148 | 148 | 'actionScript' => "onclick='if(Studio2.checkGridLayout(\"{$this->editLayout}\")) Studio2.handleSave();'", |
149 | 149 | 'disabled' => $disableLayout, |
150 | - ) ; |
|
151 | - $buttons [] = array ( |
|
152 | - 'id' => 'publishBtn' , |
|
153 | - 'text' => translate ( 'LBL_BTN_SAVEPUBLISH' ) , |
|
150 | + ); |
|
151 | + $buttons [] = array( |
|
152 | + 'id' => 'publishBtn', |
|
153 | + 'text' => translate('LBL_BTN_SAVEPUBLISH'), |
|
154 | 154 | 'actionScript' => "onclick='if(Studio2.checkGridLayout(\"{$this->editLayout}\")) Studio2.handlePublish();'", |
155 | 155 | 'disabled' => $disableLayout, |
156 | - ) ; |
|
157 | - $buttons [] = array ( 'id' => 'spacer' , 'width' => '33px' ) ; |
|
158 | - $buttons [] = array ( |
|
159 | - 'id' => 'historyBtn' , |
|
160 | - 'text' => translate ( 'LBL_HISTORY' ) , |
|
156 | + ); |
|
157 | + $buttons [] = array('id' => 'spacer', 'width' => '33px'); |
|
158 | + $buttons [] = array( |
|
159 | + 'id' => 'historyBtn', |
|
160 | + 'text' => translate('LBL_HISTORY'), |
|
161 | 161 | 'actionScript' => "onclick='ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\")'", |
162 | 162 | 'disabled' => $disableLayout, |
163 | - ) ; |
|
164 | - $buttons [] = array ( |
|
165 | - 'id' => 'historyDefault' , |
|
166 | - 'text' => translate ( 'LBL_RESTORE_DEFAULT' ) , |
|
163 | + ); |
|
164 | + $buttons [] = array( |
|
165 | + 'id' => 'historyDefault', |
|
166 | + 'text' => translate('LBL_RESTORE_DEFAULT'), |
|
167 | 167 | 'actionScript' => "onclick='ModuleBuilder.history.revert(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$history->getLast()}\", \"\")'", |
168 | 168 | 'disabled' => $disableLayout, |
169 | - ) ; |
|
169 | + ); |
|
170 | 170 | } else |
171 | 171 | { |
172 | - $buttons [] = array ( |
|
173 | - 'id' => 'saveBtn' , |
|
174 | - 'text' => $GLOBALS [ 'mod_strings' ] [ 'LBL_BTN_SAVE' ] , |
|
172 | + $buttons [] = array( |
|
173 | + 'id' => 'saveBtn', |
|
174 | + 'text' => $GLOBALS ['mod_strings'] ['LBL_BTN_SAVE'], |
|
175 | 175 | 'actionScript' => "onclick='if(Studio2.checkGridLayout(\"{$this->editLayout}\")) Studio2.handlePublish();'", |
176 | 176 | 'disabled' => $disableLayout, |
177 | - ) ; |
|
178 | - $buttons [] = array ( 'id' => 'spacer' , 'width' => '33px' ) ; |
|
179 | - $buttons [] = array ( |
|
180 | - 'id' => 'historyBtn' , |
|
181 | - 'text' => translate ( 'LBL_HISTORY' ) , |
|
177 | + ); |
|
178 | + $buttons [] = array('id' => 'spacer', 'width' => '33px'); |
|
179 | + $buttons [] = array( |
|
180 | + 'id' => 'historyBtn', |
|
181 | + 'text' => translate('LBL_HISTORY'), |
|
182 | 182 | 'actionScript' => "onclick='ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\")'", |
183 | 183 | 'disabled' => $disableLayout, |
184 | - ) ; |
|
185 | - $buttons [] = array ( |
|
186 | - 'id' => 'historyDefault' , |
|
187 | - 'text' => translate ( 'LBL_RESTORE_DEFAULT' ) , |
|
184 | + ); |
|
185 | + $buttons [] = array( |
|
186 | + 'id' => 'historyDefault', |
|
187 | + 'text' => translate('LBL_RESTORE_DEFAULT'), |
|
188 | 188 | 'actionScript' => "onclick='ModuleBuilder.history.revert(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$history->getLast()}\", \"\")'", |
189 | 189 | 'disabled' => $disableLayout, |
190 | - ) ; |
|
190 | + ); |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | |
194 | - if($this->editLayout == MB_DETAILVIEW || $this->editLayout == MB_QUICKCREATE){ |
|
195 | - $buttons [] = array ( |
|
196 | - 'id' => 'copyFromEditView' , |
|
197 | - 'text' => translate ( 'LBL_COPY_FROM_EDITVIEW' ) , |
|
194 | + if ($this->editLayout == MB_DETAILVIEW || $this->editLayout == MB_QUICKCREATE) { |
|
195 | + $buttons [] = array( |
|
196 | + 'id' => 'copyFromEditView', |
|
197 | + 'text' => translate('LBL_COPY_FROM_EDITVIEW'), |
|
198 | 198 | 'actionScript' => "onclick='ModuleBuilder.copyFromView(\"{$this->editModule}\", \"{$this->editLayout}\")'", |
199 | 199 | 'disabled' => $disableLayout, |
200 | - ) ; |
|
200 | + ); |
|
201 | 201 | } |
202 | 202 | } |
203 | 203 | |
204 | - $html = "" ; |
|
205 | - foreach ( $buttons as $button ) |
|
204 | + $html = ""; |
|
205 | + foreach ($buttons as $button) |
|
206 | 206 | { |
207 | 207 | if ($button['id'] == "spacer") { |
208 | 208 | $html .= "<td style='width:{$button['width']}'> </td>"; |
209 | 209 | } else { |
210 | 210 | $html .= "<td><input id='{$button['id']}' type='button' valign='center' class='button' style='cursor:pointer' " |
211 | 211 | . "onmousedown='this.className=\"buttonOn\";return false;' onmouseup='this.className=\"button\"' " |
212 | - . "onmouseout='this.className=\"button\"' {$button['actionScript']} value = '{$button['text']}'" ; |
|
213 | - if(!empty($button['disabled'])){ |
|
212 | + . "onmouseout='this.className=\"button\"' {$button['actionScript']} value = '{$button['text']}'"; |
|
213 | + if (!empty($button['disabled'])) { |
|
214 | 214 | $html .= " disabled"; |
215 | 215 | } |
216 | 216 | $html .= "></td>"; |
217 | 217 | } |
218 | 218 | } |
219 | 219 | |
220 | - $smarty->assign ( 'buttons', $html ) ; |
|
220 | + $smarty->assign('buttons', $html); |
|
221 | 221 | |
222 | 222 | // assign fields and layout |
223 | - $smarty->assign ( 'available_fields', $parser->getAvailableFields () ) ; |
|
224 | - |
|
225 | - $smarty->assign ( 'disable_layout', $disableLayout) ; |
|
226 | - $smarty->assign ( 'required_fields', $requiredFields) ; |
|
227 | - $smarty->assign ( 'layout', $parser->getLayout () ) ; |
|
228 | - $smarty->assign ( 'field_defs', $parser->getFieldDefs () ) ; |
|
229 | - $smarty->assign ( 'view_module', $this->editModule ) ; |
|
230 | - $smarty->assign ( 'view', $this->editLayout ) ; |
|
231 | - $smarty->assign ( 'maxColumns', $parser->getMaxColumns() ) ; |
|
232 | - $smarty->assign ( 'nextPanelId', $parser->getFirstNewPanelId() ) ; |
|
233 | - $smarty->assign ( 'displayAsTabs', $parser->getUseTabs() ) ; |
|
234 | - $smarty->assign ( 'tabDefs', $parser->getTabDefs() ) ; |
|
235 | - $smarty->assign ( 'syncDetailEditViews', $parser->getSyncDetailEditViews() ) ; |
|
236 | - $smarty->assign ( 'fieldwidth', 150 ) ; |
|
237 | - $smarty->assign ( 'translate', $this->fromModuleBuilder ? false : true ) ; |
|
223 | + $smarty->assign('available_fields', $parser->getAvailableFields()); |
|
224 | + |
|
225 | + $smarty->assign('disable_layout', $disableLayout); |
|
226 | + $smarty->assign('required_fields', $requiredFields); |
|
227 | + $smarty->assign('layout', $parser->getLayout()); |
|
228 | + $smarty->assign('field_defs', $parser->getFieldDefs()); |
|
229 | + $smarty->assign('view_module', $this->editModule); |
|
230 | + $smarty->assign('view', $this->editLayout); |
|
231 | + $smarty->assign('maxColumns', $parser->getMaxColumns()); |
|
232 | + $smarty->assign('nextPanelId', $parser->getFirstNewPanelId()); |
|
233 | + $smarty->assign('displayAsTabs', $parser->getUseTabs()); |
|
234 | + $smarty->assign('tabDefs', $parser->getTabDefs()); |
|
235 | + $smarty->assign('syncDetailEditViews', $parser->getSyncDetailEditViews()); |
|
236 | + $smarty->assign('fieldwidth', 150); |
|
237 | + $smarty->assign('translate', $this->fromModuleBuilder ? false : true); |
|
238 | 238 | |
239 | 239 | if ($this->fromModuleBuilder) |
240 | 240 | { |
241 | - $smarty->assign ( 'fromModuleBuilder', $this->fromModuleBuilder ) ; |
|
242 | - $smarty->assign ( 'view_package', $this->package ) ; |
|
241 | + $smarty->assign('fromModuleBuilder', $this->fromModuleBuilder); |
|
242 | + $smarty->assign('view_package', $this->package); |
|
243 | 243 | } |
244 | 244 | |
245 | - $labels = array ( |
|
246 | - MB_EDITVIEW => 'LBL_EDITVIEW' , |
|
247 | - MB_DETAILVIEW => 'LBL_DETAILVIEW' , |
|
245 | + $labels = array( |
|
246 | + MB_EDITVIEW => 'LBL_EDITVIEW', |
|
247 | + MB_DETAILVIEW => 'LBL_DETAILVIEW', |
|
248 | 248 | MB_QUICKCREATE => 'LBL_QUICKCREATE', |
249 | - ) ; |
|
249 | + ); |
|
250 | 250 | |
251 | - $layoutLabel = 'LBL_LAYOUTS' ; |
|
252 | - $layoutView = 'layouts' ; |
|
251 | + $layoutLabel = 'LBL_LAYOUTS'; |
|
252 | + $layoutView = 'layouts'; |
|
253 | 253 | |
254 | 254 | |
255 | - $ajax = new AjaxCompose ( ) ; |
|
255 | + $ajax = new AjaxCompose( ); |
|
256 | 256 | |
257 | - $translatedViewType = '' ; |
|
258 | - if ( isset ( $labels [ strtolower ( $this->editLayout ) ] ) ) |
|
259 | - $translatedViewType = translate ( $labels [ strtolower( $this->editLayout ) ] , 'ModuleBuilder' ) ; |
|
257 | + $translatedViewType = ''; |
|
258 | + if (isset ($labels [strtolower($this->editLayout)])) |
|
259 | + $translatedViewType = translate($labels [strtolower($this->editLayout)], 'ModuleBuilder'); |
|
260 | 260 | else if (isset($this->sm)) |
261 | 261 | { |
262 | - foreach($this->sm->sources as $file => $def) |
|
262 | + foreach ($this->sm->sources as $file => $def) |
|
263 | 263 | { |
264 | 264 | if (!empty($def['view']) && $def['view'] == $this->editLayout && !empty($def['name'])) |
265 | 265 | { |
266 | 266 | $translatedViewType = $def['name']; |
267 | 267 | } |
268 | 268 | } |
269 | - if(empty($translatedViewType)) |
|
269 | + if (empty($translatedViewType)) |
|
270 | 270 | { |
271 | - $label = "LBL_" . strtoupper($this->editLayout); |
|
271 | + $label = "LBL_".strtoupper($this->editLayout); |
|
272 | 272 | $translated = translate($label, $this->editModule); |
273 | 273 | if ($translated != $label) |
274 | - $translatedViewType = $translated; |
|
274 | + $translatedViewType = $translated; |
|
275 | 275 | } |
276 | 276 | } |
277 | 277 | |
@@ -280,34 +280,34 @@ discard block |
||
280 | 280 | |
281 | 281 | if ($this->fromModuleBuilder) |
282 | 282 | { |
283 | - $ajax->addCrumb ( translate ( 'LBL_MODULEBUILDER', 'ModuleBuilder' ), 'ModuleBuilder.main("mb")' ) ; |
|
284 | - $ajax->addCrumb ( $this->package, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package=' . $this->package . '")' ) ; |
|
285 | - $ajax->addCrumb ( $this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package=' . $this->package . '&view_module=' . $this->editModule . '")' ) ; |
|
286 | - $ajax->addCrumb ( translate ( $layoutLabel, 'ModuleBuilder' ), 'ModuleBuilder.getContent("module=ModuleBuilder&MB=true&action=wizard&view='.$layoutView.'&view_module=' . $this->editModule . '&view_package=' . $this->package . '")' ) ; |
|
287 | - $ajax->addCrumb ( $translatedViewType, '' ) ; |
|
283 | + $ajax->addCrumb(translate('LBL_MODULEBUILDER', 'ModuleBuilder'), 'ModuleBuilder.main("mb")'); |
|
284 | + $ajax->addCrumb($this->package, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$this->package.'")'); |
|
285 | + $ajax->addCrumb($this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package='.$this->package.'&view_module='.$this->editModule.'")'); |
|
286 | + $ajax->addCrumb(translate($layoutLabel, 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&MB=true&action=wizard&view='.$layoutView.'&view_module='.$this->editModule.'&view_package='.$this->package.'")'); |
|
287 | + $ajax->addCrumb($translatedViewType, ''); |
|
288 | 288 | } else |
289 | 289 | { |
290 | - $ajax->addCrumb ( translate ( 'LBL_STUDIO', 'ModuleBuilder' ), 'ModuleBuilder.main("studio")' ) ; |
|
291 | - $ajax->addCrumb ( $this->translatedEditModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module=' . $this->editModule . '")' ) ; |
|
292 | - $ajax->addCrumb ( translate ( $layoutLabel, 'ModuleBuilder' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view='.$layoutView.'&view_module=' . $this->editModule . '")' ) ; |
|
293 | - $ajax->addCrumb ( $translatedViewType, '' ) ; |
|
290 | + $ajax->addCrumb(translate('LBL_STUDIO', 'ModuleBuilder'), 'ModuleBuilder.main("studio")'); |
|
291 | + $ajax->addCrumb($this->translatedEditModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module='.$this->editModule.'")'); |
|
292 | + $ajax->addCrumb(translate($layoutLabel, 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view='.$layoutView.'&view_module='.$this->editModule.'")'); |
|
293 | + $ajax->addCrumb($translatedViewType, ''); |
|
294 | 294 | } |
295 | 295 | |
296 | 296 | // set up language files |
297 | - $smarty->assign ( 'language', $parser->getLanguage() ) ; // for sugar_translate in the smarty template |
|
298 | - $smarty->assign('from_mb',$this->fromModuleBuilder); |
|
297 | + $smarty->assign('language', $parser->getLanguage()); // for sugar_translate in the smarty template |
|
298 | + $smarty->assign('from_mb', $this->fromModuleBuilder); |
|
299 | 299 | $smarty->assign('calc_field_list', json_encode($parser->getCalculatedFields())); |
300 | 300 | if ($this->fromModuleBuilder) { |
301 | - $mb = new ModuleBuilder ( ) ; |
|
302 | - $module = & $mb->getPackageModule ( $this->package, $this->editModule ) ; |
|
301 | + $mb = new ModuleBuilder( ); |
|
302 | + $module = & $mb->getPackageModule($this->package, $this->editModule); |
|
303 | 303 | $smarty->assign('current_mod_strings', $module->getModStrings()); |
304 | 304 | } |
305 | 305 | |
306 | - $ajax->addSection ( 'center', $translatedViewType, $smarty->fetch ( 'modules/ModuleBuilder/tpls/layoutView.tpl' ) ) ; |
|
306 | + $ajax->addSection('center', $translatedViewType, $smarty->fetch('modules/ModuleBuilder/tpls/layoutView.tpl')); |
|
307 | 307 | if ($preview) { |
308 | - echo $smarty->fetch ( 'modules/ModuleBuilder/tpls/Preview/layoutView.tpl' ); |
|
308 | + echo $smarty->fetch('modules/ModuleBuilder/tpls/Preview/layoutView.tpl'); |
|
309 | 309 | } else { |
310 | - echo $ajax->getJavascript () ; |
|
310 | + echo $ajax->getJavascript(); |
|
311 | 311 | } |
312 | 312 | } |
313 | 313 | } |
@@ -47,19 +47,19 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -38,13 +38,13 @@ discard block |
||
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 |
||
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 |
||
181 | 181 | */ |
182 | 182 | function unrestore() |
183 | 183 | { |
184 | - $this->history->undoRestore () ; |
|
184 | + $this->history->undoRestore(); |
|
185 | 185 | } |
186 | 186 | } |
@@ -103,8 +103,9 @@ discard block |
||
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 |
||
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 ( ) ; |
@@ -48,73 +48,73 @@ discard block |
||
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 |
||
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 |
||
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 | { |
@@ -55,7 +55,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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; |
@@ -52,7 +52,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -143,7 +143,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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; |
@@ -45,20 +45,20 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -43,20 +43,20 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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); |
@@ -66,14 +66,17 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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); |
@@ -364,8 +364,7 @@ |
||
364 | 364 | * This function overrides fetchTemplate from SugarView. For view.modulefield.php we go through the FieldViewer |
365 | 365 | * class to fetch the display contents. |
366 | 366 | * |
367 | - * @param FieldViewer $mixed the FieldViewer instance |
|
368 | - * @param string $template the file to fetch |
|
367 | + * @param FieldViewer $fv |
|
369 | 368 | * @return string contents from calling the fetch method on the FieldViewer Sugar_Smarty instance |
370 | 369 | */ |
371 | 370 | protected function fetchTemplate($fv/*, $template*/) |
@@ -50,7 +50,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | $smarty->assign('message', $GLOBALS['mod_strings']['LBL_DEPLOY_IN_PROGRESS']); |
49 | 49 | $ajax = new AjaxCompose(); |
50 | 50 | $ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.main("mb")'); |
51 | - $ajax->addCrumb($_REQUEST['name'],'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$_REQUEST['name'].'")'); |
|
51 | + $ajax->addCrumb($_REQUEST['name'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$_REQUEST['name'].'")'); |
|
52 | 52 | $ajax->addCrumb(translate('LBL_SECTION_DEPLOY', 'ModuleBuilder'), ''); |
53 | 53 | $ajax->addSection('center', translate('LBL_SECTION_DEPLOY', 'ModuleBuilder'), $smarty->fetch('modules/ModuleBuilder/tpls/MBPackage/deploy.tpl')); |
54 | 54 | echo $ajax->getJavascript(); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | global $mod_strings; |
63 | 63 | |
64 | 64 | return array( |
65 | - translate('LBL_MODULE_NAME','Administration'), |
|
65 | + translate('LBL_MODULE_NAME', 'Administration'), |
|
66 | 66 | ModuleBuilderController::getModuleTitle(), |
67 | 67 | ); |
68 | 68 | } |
@@ -41,29 +41,29 @@ |
||
41 | 41 | |
42 | 42 | class ViewDisplaydeploy extends SugarView |
43 | 43 | { |
44 | - function __construct() |
|
45 | - { |
|
46 | - $smarty = new Sugar_Smarty(); |
|
47 | - $smarty->assign('package', $_REQUEST['name']); |
|
48 | - $smarty->assign('message', $GLOBALS['mod_strings']['LBL_DEPLOY_IN_PROGRESS']); |
|
49 | - $ajax = new AjaxCompose(); |
|
50 | - $ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.main("mb")'); |
|
51 | - $ajax->addCrumb($_REQUEST['name'],'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$_REQUEST['name'].'")'); |
|
52 | - $ajax->addCrumb(translate('LBL_SECTION_DEPLOY', 'ModuleBuilder'), ''); |
|
53 | - $ajax->addSection('center', translate('LBL_SECTION_DEPLOY', 'ModuleBuilder'), $smarty->fetch('modules/ModuleBuilder/tpls/MBPackage/deploy.tpl')); |
|
54 | - echo $ajax->getJavascript(); |
|
55 | - } |
|
44 | + function __construct() |
|
45 | + { |
|
46 | + $smarty = new Sugar_Smarty(); |
|
47 | + $smarty->assign('package', $_REQUEST['name']); |
|
48 | + $smarty->assign('message', $GLOBALS['mod_strings']['LBL_DEPLOY_IN_PROGRESS']); |
|
49 | + $ajax = new AjaxCompose(); |
|
50 | + $ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.main("mb")'); |
|
51 | + $ajax->addCrumb($_REQUEST['name'],'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$_REQUEST['name'].'")'); |
|
52 | + $ajax->addCrumb(translate('LBL_SECTION_DEPLOY', 'ModuleBuilder'), ''); |
|
53 | + $ajax->addSection('center', translate('LBL_SECTION_DEPLOY', 'ModuleBuilder'), $smarty->fetch('modules/ModuleBuilder/tpls/MBPackage/deploy.tpl')); |
|
54 | + echo $ajax->getJavascript(); |
|
55 | + } |
|
56 | 56 | |
57 | - /** |
|
58 | - * @see SugarView::_getModuleTitleParams() |
|
59 | - */ |
|
60 | - protected function _getModuleTitleParams($browserTitle = false) |
|
61 | - { |
|
62 | - global $mod_strings; |
|
57 | + /** |
|
58 | + * @see SugarView::_getModuleTitleParams() |
|
59 | + */ |
|
60 | + protected function _getModuleTitleParams($browserTitle = false) |
|
61 | + { |
|
62 | + global $mod_strings; |
|
63 | 63 | |
64 | - return array( |
|
65 | - translate('LBL_MODULE_NAME','Administration'), |
|
66 | - ModuleBuilderController::getModuleTitle(), |
|
67 | - ); |
|
64 | + return array( |
|
65 | + translate('LBL_MODULE_NAME','Administration'), |
|
66 | + ModuleBuilderController::getModuleTitle(), |
|
67 | + ); |
|
68 | 68 | } |
69 | 69 | } |
@@ -42,20 +42,20 @@ discard block |
||
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 |
||
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 |
@@ -50,7 +50,7 @@ discard block |
||
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 |
||
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 |
@@ -40,51 +40,51 @@ |
||
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 |
@@ -48,7 +48,7 @@ discard block |
||
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 |
||
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 |
||
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 |
@@ -67,7 +67,9 @@ |
||
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')); |