@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -75,12 +77,15 @@ discard block |
||
75 | 77 | $this->javascript->setSugarBean($focus); |
76 | 78 | $this->javascript->addAllFields(''); |
77 | 79 | |
78 | - if (is_null($focus->date_start)) |
|
79 | - $focus->date_start = $timedate->to_display_date(TimeDate::getInstance()->nowDb()); |
|
80 | - if (is_null($focus->time_start)) |
|
81 | - $focus->time_start = $timedate->to_display_time(TimeDate::getInstance()->nowDb(), true); |
|
82 | - if (!isset ($focus->duration_hours)) |
|
83 | - $focus->duration_hours = "1"; |
|
80 | + if (is_null($focus->date_start)) { |
|
81 | + $focus->date_start = $timedate->to_display_date(TimeDate::getInstance()->nowDb()); |
|
82 | + } |
|
83 | + if (is_null($focus->time_start)) { |
|
84 | + $focus->time_start = $timedate->to_display_time(TimeDate::getInstance()->nowDb(), true); |
|
85 | + } |
|
86 | + if (!isset ($focus->duration_hours)) { |
|
87 | + $focus->duration_hours = "1"; |
|
88 | + } |
|
84 | 89 | |
85 | 90 | |
86 | 91 | $date_start_array=explode(" ",trim($focus->date_start)); |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -94,7 +96,9 @@ discard block |
||
94 | 96 | |
95 | 97 | if(!empty($fields['DESCRIPTION'])) { |
96 | 98 | $overlib_string .= '<b>'. $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300); |
97 | - if(strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...'; |
|
99 | + if(strlen($fields['DESCRIPTION']) > 300) { |
|
100 | + $overlib_string .= '...'; |
|
101 | + } |
|
98 | 102 | $overlib_string .= '<br>'; |
99 | 103 | } |
100 | 104 | $overlib_string .= '<br>'; |
@@ -87,11 +87,14 @@ |
||
87 | 87 | $ajax = new AjaxCompose(); |
88 | 88 | $ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.main("mb")'); |
89 | 89 | $ajax->addCrumb(' '. $package->name,'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$package->name.'")'); |
90 | - if(empty($module_name))$module_name = translate('LBL_NEW_MODULE', 'ModuleBuilder'); |
|
90 | + if(empty($module_name)) { |
|
91 | + $module_name = translate('LBL_NEW_MODULE', 'ModuleBuilder'); |
|
92 | + } |
|
91 | 93 | $ajax->addCrumb($module_name, ''); |
92 | 94 | $html=$smarty->fetch('modules/ModuleBuilder/tpls/MBModule/module.tpl'); |
93 | - if(!empty($_REQUEST['action']) && $_REQUEST['action']=='SaveModule') |
|
94 | - $html .="<script>ModuleBuilder.treeRefresh('ModuleBuilder')</script>"; |
|
95 | + if(!empty($_REQUEST['action']) && $_REQUEST['action']=='SaveModule') { |
|
96 | + $html .="<script>ModuleBuilder.treeRefresh('ModuleBuilder')</script>"; |
|
97 | + } |
|
95 | 98 | $ajax->addSection('center', translate('LBL_SECTION_MODULE', 'ModuleBuilder'), $html); |
96 | 99 | |
97 | 100 | echo $ajax->getJavascript(); |
@@ -1,6 +1,7 @@ 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 | * SugarCRM Community Edition is a customer relationship management program developed by |
6 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -119,14 +120,18 @@ discard block |
||
119 | 120 | $ajax->addCrumb ( $_REQUEST [ 'view_package' ], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package=' . $_REQUEST [ 'view_package' ] . '")' ) ; |
120 | 121 | $ajax->addCrumb ( $this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package=' . $_REQUEST [ 'view_package' ] . "&view_module={$this->editModule}" . '")' ) ; |
121 | 122 | $ajax->addCrumb ( translate ( $layoutLabel, 'ModuleBuilder' ), 'ModuleBuilder.getContent("module=ModuleBuilder&MB=true&action=wizard&view_module=' . $this->editModule. '&view_package=' . $_REQUEST['view_package'] . '")' ) ; |
122 | - if ( $layoutLabel == 'LBL_LAYOUTS' ) $ajax->addCrumb ( translate ( 'LBL_SEARCH_FORMS', 'ModuleBuilder' ), 'ModuleBuilder.getContent("module=ModuleBuilder&MB=true&action=wizard&view=search&view_module=' .$this->editModule . '&view_package=' . $_REQUEST [ 'view_package' ] . '")' ) ; |
|
123 | + if ( $layoutLabel == 'LBL_LAYOUTS' ) { |
|
124 | + $ajax->addCrumb ( translate ( 'LBL_SEARCH_FORMS', 'ModuleBuilder' ), 'ModuleBuilder.getContent("module=ModuleBuilder&MB=true&action=wizard&view=search&view_module=' .$this->editModule . '&view_package=' . $_REQUEST [ 'view_package' ] . '")' ) ; |
|
125 | + } |
|
123 | 126 | $ajax->addCrumb ( translate ( $searchLabel, 'ModuleBuilder' ), '' ) ; |
124 | 127 | } else |
125 | 128 | { |
126 | 129 | $ajax->addCrumb ( translate ( 'LBL_STUDIO', 'ModuleBuilder' ), 'ModuleBuilder.main("studio")' ) ; |
127 | 130 | $ajax->addCrumb ( $this->translatedEditModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module=' . $this->editModule . '")' ) ; |
128 | 131 | $ajax->addCrumb ( translate ( $layoutLabel, 'ModuleBuilder' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view='.$layoutView.'&view_module=' . $this->editModule . '")' ) ; |
129 | - if ( $layoutLabel == 'LBL_LAYOUTS' ) $ajax->addCrumb ( translate ( 'LBL_SEARCH_FORMS', 'ModuleBuilder' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=search&view_module=' .$this->editModule . '")' ) ; |
|
132 | + if ( $layoutLabel == 'LBL_LAYOUTS' ) { |
|
133 | + $ajax->addCrumb ( translate ( 'LBL_SEARCH_FORMS', 'ModuleBuilder' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=search&view_module=' .$this->editModule . '")' ) ; |
|
134 | + } |
|
130 | 135 | $ajax->addCrumb ( translate ( $searchLabel, 'ModuleBuilder' ), '' ) ; |
131 | 136 | } |
132 | 137 | $this->title = $searchLabel; |
@@ -120,8 +120,9 @@ discard block |
||
120 | 120 | |
121 | 121 | $cardinality = array ( MB_ONETOONE => translate ( 'LBL_ONETOONE' ) , MB_ONETOMANY => translate ( 'LBL_ONETOMANY' ) , MB_MANYTOONE=> translate ( 'LBL_MANYTOONE' ), MB_MANYTOMANY => translate ( 'LBL_MANYTOMANY' ), ) ; |
122 | 122 | |
123 | - if (!$this->fromModuleBuilder) |
|
124 | - unset($cardinality[MB_MANYTOONE]); |
|
123 | + if (!$this->fromModuleBuilder) { |
|
124 | + unset($cardinality[MB_MANYTOONE]); |
|
125 | + } |
|
125 | 126 | |
126 | 127 | $relationships = $module->getRelationships () ; |
127 | 128 | |
@@ -136,7 +137,7 @@ discard block |
||
136 | 137 | $definition['lhs_label'] = isset($modStrings[$relationship->getTitleKey()])?$modStrings[$relationship->getTitleKey()] : $relationship->lhs_module; |
137 | 138 | $modStrings = return_module_language( $selected_lang, $relationship->lhs_module, true ) ; |
138 | 139 | $definition['rhs_label'] = isset($modStrings[$relationship->getTitleKey(true)])?$modStrings[$relationship->getTitleKey(true)] : $relationship->rhs_module ; |
139 | - }else{ |
|
140 | + } else{ |
|
140 | 141 | #30624 |
141 | 142 | if(!empty($_REQUEST['rhs_module'])){ |
142 | 143 | $definition['rhs_label'] = $_REQUEST['rhs_module']; |
@@ -254,12 +255,14 @@ discard block |
||
254 | 255 | } |
255 | 256 | $this->smarty->assign ( 'relationship_role_column_enum', $validRoleColumnFields ) ; |
256 | 257 | } |
257 | - if (! empty ( $relationship->relationship_role_column_value )) |
|
258 | - $this->smarty->assign ( 'relationship_role_column_value', $relationship->relationship_role_column_value ) ; |
|
258 | + if (! empty ( $relationship->relationship_role_column_value )) { |
|
259 | + $this->smarty->assign ( 'relationship_role_column_value', $relationship->relationship_role_column_value ) ; |
|
260 | + } |
|
259 | 261 | break ; |
260 | 262 | case MB_MANYTOMANY : |
261 | - if (! empty ( $relationship->relationship_role_column_value )) |
|
262 | - $this->smarty->assign ( 'relationship_role_column_value', $relationship->relationship_role_column_value ) ; |
|
263 | + if (! empty ( $relationship->relationship_role_column_value )) { |
|
264 | + $this->smarty->assign ( 'relationship_role_column_value', $relationship->relationship_role_column_value ) ; |
|
265 | + } |
|
263 | 266 | break ; |
264 | 267 | } |
265 | 268 |
@@ -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 | * SugarCRM Community Edition is a customer relationship management program developed by |
6 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -125,7 +126,7 @@ discard block |
||
125 | 126 | |
126 | 127 | $ViewLabel = ($this->editLayout == MB_POPUPLIST) ? 'LBL_POPUPLISTVIEW' : 'LBL_POPUPSEARCH'; |
127 | 128 | $ajax->addCrumb ( translate ($ViewLabel, 'ModuleBuilder' ), '' ) ; |
128 | - }else{ |
|
129 | + } else{ |
|
129 | 130 | $ajax->addCrumb ( translate($this->editModule), 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_module=' . $this->editModule . '")' ) ; |
130 | 131 | $ajax->addCrumb ( translate('LBL_LAYOUTS', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&layouts=1&view_module=' . $this->editModule . '")'); |
131 | 132 | $ajax->addCrumb ( translate('LBL_POPUP', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=popup&view_module=' . $this->editModule . '")' ); |
@@ -184,8 +185,9 @@ discard block |
||
184 | 185 | |
185 | 186 | |
186 | 187 | $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\")" ; |
187 | - if (isset($this->searchlayout)) |
|
188 | - $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$this->searchlayout}\")" ; |
|
188 | + if (isset($this->searchlayout)) { |
|
189 | + $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$this->searchlayout}\")" ; |
|
190 | + } |
|
189 | 191 | |
190 | 192 | $buttons = array ( ) ; |
191 | 193 | if (! $this->fromModuleBuilder) |
@@ -95,20 +95,25 @@ discard block |
||
95 | 95 | { |
96 | 96 | $out = "<script>ajaxStatus.flashStatus(SUGAR.language.get('app_strings', 'LBL_REQUEST_PROCESSED'), 2000);</script>"; |
97 | 97 | |
98 | - if (!empty($_REQUEST['relationships'])) |
|
99 | - $out .= $this->removeCustomRelationships(); |
|
98 | + if (!empty($_REQUEST['relationships'])) { |
|
99 | + $out .= $this->removeCustomRelationships(); |
|
100 | + } |
|
100 | 101 | |
101 | - if (!empty($_REQUEST['fields'])) |
|
102 | - $out .= $this->removeCustomFields(); |
|
102 | + if (!empty($_REQUEST['fields'])) { |
|
103 | + $out .= $this->removeCustomFields(); |
|
104 | + } |
|
103 | 105 | |
104 | - if (!empty($_REQUEST['layouts'])) |
|
105 | - $out .= $this->removeCustomLayouts(); |
|
106 | + if (!empty($_REQUEST['layouts'])) { |
|
107 | + $out .= $this->removeCustomLayouts(); |
|
108 | + } |
|
106 | 109 | |
107 | - if (!empty($_REQUEST['labels'])) |
|
108 | - $out .= $this->removeCustomLabels(); |
|
110 | + if (!empty($_REQUEST['labels'])) { |
|
111 | + $out .= $this->removeCustomLabels(); |
|
112 | + } |
|
109 | 113 | |
110 | - if (!empty($_REQUEST['extensions'])) |
|
111 | - $out .= $this->removeCustomExtensions(); |
|
114 | + if (!empty($_REQUEST['extensions'])) { |
|
115 | + $out .= $this->removeCustomExtensions(); |
|
116 | + } |
|
112 | 117 | |
113 | 118 | |
114 | 119 | $out .= "Complete!"; |
@@ -209,8 +214,9 @@ discard block |
||
209 | 214 | $out .= "Removed relationship $relationshipName<br/>"; |
210 | 215 | } |
211 | 216 | } |
212 | - if ($madeChanges) |
|
213 | - $relationships->save () ; |
|
217 | + if ($madeChanges) { |
|
218 | + $relationships->save () ; |
|
219 | + } |
|
214 | 220 | |
215 | 221 | return $out; |
216 | 222 | } |
@@ -222,7 +228,9 @@ discard block |
||
222 | 228 | if (is_dir($languageDir)) { |
223 | 229 | $files = scandir($languageDir); |
224 | 230 | foreach ($files as $langFile) { |
225 | - if (substr($langFile, 0 ,1) == '.') continue; |
|
231 | + if (substr($langFile, 0 ,1) == '.') { |
|
232 | + continue; |
|
233 | + } |
|
226 | 234 | $language = substr($langFile, 0, strlen($langFile) - 9); |
227 | 235 | unlink($languageDir . "/" . $langFile); |
228 | 236 |
@@ -73,8 +73,7 @@ discard block |
||
73 | 73 | $ajax->addCrumb($GLOBALS['mod_strings']['LBL_PACKAGE_LIST'],''); |
74 | 74 | $ajax->addSection('center', $GLOBALS['mod_strings']['LBL_PACKAGE_LIST'], $smarty->fetch('modules/ModuleBuilder/tpls/wizard.tpl')); |
75 | 75 | echo $ajax->getJavascript(); |
76 | - } |
|
77 | - else { |
|
76 | + } else { |
|
78 | 77 | |
79 | 78 | $name = (!empty($_REQUEST['package']))?$_REQUEST['package']:''; |
80 | 79 | $mb->getPackage($name); |
@@ -114,11 +113,14 @@ discard block |
||
114 | 113 | |
115 | 114 | $ajax = new AjaxCompose(); |
116 | 115 | $ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package")'); |
117 | - if(empty($name))$name = $mod_strings['LBL_NEW_PACKAGE']; |
|
116 | + if(empty($name)) { |
|
117 | + $name = $mod_strings['LBL_NEW_PACKAGE']; |
|
118 | + } |
|
118 | 119 | $ajax->addCrumb($name,''); |
119 | 120 | $html=$smarty->fetch('modules/ModuleBuilder/tpls/MBPackage/package.tpl'); |
120 | - if(!empty($_REQUEST['action']) && $_REQUEST['action']=='SavePackage') |
|
121 | - $html.="<script>ModuleBuilder.treeRefresh('ModuleBuilder')</script>"; |
|
121 | + if(!empty($_REQUEST['action']) && $_REQUEST['action']=='SavePackage') { |
|
122 | + $html.="<script>ModuleBuilder.treeRefresh('ModuleBuilder')</script>"; |
|
123 | + } |
|
122 | 124 | $ajax->addSection('center', translate('LBL_SECTION_PACKAGE', 'ModuleBuilder'), $html); |
123 | 125 | echo $ajax->getJavascript(); |
124 | 126 | } |
@@ -54,8 +54,9 @@ discard block |
||
54 | 54 | |
55 | 55 | function __construct() |
56 | 56 | { |
57 | - if ( isset ( $_REQUEST [ 'view' ] ) ) |
|
58 | - $this->view = $_REQUEST [ 'view' ] ; |
|
57 | + if ( isset ( $_REQUEST [ 'view' ] ) ) { |
|
58 | + $this->view = $_REQUEST [ 'view' ] ; |
|
59 | + } |
|
59 | 60 | |
60 | 61 | $this->editModule = (! empty ( $_REQUEST [ 'view_module' ] ) ) ? $_REQUEST [ 'view_module' ] : null ; |
61 | 62 | $this->buttons = array(); // initialize so that modules without subpanels for example don't result in this being unset and causing problems in the smarty->assign |
@@ -114,8 +115,9 @@ discard block |
||
114 | 115 | $this->question = translate('LBL_QUESTION_EDIT') ; |
115 | 116 | $this->title = translate( 'LBL_STUDIO' ); |
116 | 117 | global $current_user; |
117 | - if (is_admin($current_user)) |
|
118 | - $this->actions = "<input class=\"button\" type=\"button\" id=\"exportBtn\" name=\"exportBtn\" onclick=\"ModuleBuilder.getContent('module=ModuleBuilder&action=exportcustomizations');\" value=\"" . translate ( 'LBL_BTN_EXPORT' ) . '">' ; |
|
118 | + if (is_admin($current_user)) { |
|
119 | + $this->actions = "<input class=\"button\" type=\"button\" id=\"exportBtn\" name=\"exportBtn\" onclick=\"ModuleBuilder.getContent('module=ModuleBuilder&action=exportcustomizations');\" value=\"" . translate ( 'LBL_BTN_EXPORT' ) . '">' ; |
|
120 | + } |
|
119 | 121 | |
120 | 122 | $this->help = 'studioHelp' ; |
121 | 123 | } else |
@@ -177,10 +179,11 @@ discard block |
||
177 | 179 | $this->title = translate( 'LBL_EDIT' ) . " " . $module->name ; |
178 | 180 | $this->help = 'moduleHelp' ; |
179 | 181 | global $current_user; |
180 | - if (is_admin($current_user)) |
|
181 | - $this->actions = "<input class=\"button\" type=\"button\" id=\"exportBtn\" name=\"exportBtn\" " |
|
182 | + if (is_admin($current_user)) { |
|
183 | + $this->actions = "<input class=\"button\" type=\"button\" id=\"exportBtn\" name=\"exportBtn\" " |
|
182 | 184 | . "onclick=\"ModuleBuilder.getContent('module=ModuleBuilder&action=resetmodule&view_module=$this->editModule');\" value=\"" |
183 | 185 | . translate( 'LBL_RESET_MODULE' ) . '">' ; |
186 | + } |
|
184 | 187 | } |
185 | 188 | } |
186 | 189 | } |