@@ -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,10 +58,10 @@ discard block |
||
58 | 58 | global $current_user, $mod_strings; |
59 | 59 | $smarty = new Sugar_Smarty(); |
60 | 60 | $mb = new MBPackage("packageCustom"); |
61 | - $mod=$mb->getCustomModules(); |
|
62 | - foreach($mod as $key => $value){ |
|
63 | - $modules[]=$key; |
|
64 | - $custom[]=$value; |
|
61 | + $mod = $mb->getCustomModules(); |
|
62 | + foreach ($mod as $key => $value) { |
|
63 | + $modules[] = $key; |
|
64 | + $custom[] = $value; |
|
65 | 65 | } |
66 | 66 | $nb_mod = count($modules); |
67 | 67 | $smarty->assign('mod_strings', $mod_strings); |
@@ -69,11 +69,11 @@ discard block |
||
69 | 69 | $smarty->assign('custom', $custom); |
70 | 70 | $smarty->assign('nb_mod', $nb_mod); |
71 | 71 | $smarty->assign('defaultHelp', 'exportHelp'); |
72 | - $smarty->assign('moduleList',$GLOBALS['app_list_strings']['moduleList']); |
|
73 | - $smarty->assign('moduleList',$GLOBALS['app_list_strings']['moduleList']); |
|
72 | + $smarty->assign('moduleList', $GLOBALS['app_list_strings']['moduleList']); |
|
73 | + $smarty->assign('moduleList', $GLOBALS['app_list_strings']['moduleList']); |
|
74 | 74 | $ajax = new AjaxCompose(); |
75 | 75 | $ajax->addCrumb($mod_strings['LBL_STUDIO'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard")'); |
76 | - $ajax->addSection('center', $mod_strings['LBL_EC_TITLE'],$smarty->fetch($this->getCustomFilePathIfExists('modules/ModuleBuilder/tpls/exportcustomizations.tpl'))); |
|
76 | + $ajax->addSection('center', $mod_strings['LBL_EC_TITLE'], $smarty->fetch($this->getCustomFilePathIfExists('modules/ModuleBuilder/tpls/exportcustomizations.tpl'))); |
|
77 | 77 | echo $ajax->getJavascript(); |
78 | 78 | } |
79 | 79 | } |
80 | 80 | \ No newline at end of file |
@@ -37,12 +37,12 @@ discard block |
||
37 | 37 | * display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM". |
38 | 38 | ********************************************************************************/ |
39 | 39 | |
40 | -require_once ('modules/ModuleBuilder/MB/AjaxCompose.php') ; |
|
41 | -require_once ('modules/ModuleBuilder/MB/ModuleBuilder.php') ; |
|
42 | -require_once ('modules/ModuleBuilder/Module/StudioModuleFactory.php') ; |
|
43 | -require_once ('modules/ModuleBuilder/Module/StudioBrowser.php') ; |
|
44 | -require_once ('modules/ModuleBuilder/parsers/constants.php') ; |
|
45 | -require_once 'modules/ModuleBuilder/parsers/relationships/RelationshipFactory.php' ; |
|
40 | +require_once ('modules/ModuleBuilder/MB/AjaxCompose.php'); |
|
41 | +require_once ('modules/ModuleBuilder/MB/ModuleBuilder.php'); |
|
42 | +require_once ('modules/ModuleBuilder/Module/StudioModuleFactory.php'); |
|
43 | +require_once ('modules/ModuleBuilder/Module/StudioBrowser.php'); |
|
44 | +require_once ('modules/ModuleBuilder/parsers/constants.php'); |
|
45 | +require_once 'modules/ModuleBuilder/parsers/relationships/RelationshipFactory.php'; |
|
46 | 46 | |
47 | 47 | class ViewRelationship extends SugarView |
48 | 48 | { |
@@ -54,7 +54,7 @@ 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 | } |
@@ -63,214 +63,214 @@ discard block |
||
63 | 63 | $definition |
64 | 64 | ) |
65 | 65 | { |
66 | - require_once 'modules/ModuleBuilder/parsers/relationships/AbstractRelationship.php' ; |
|
67 | - foreach ( AbstractRelationship::$definitionKeys as $key ) |
|
66 | + require_once 'modules/ModuleBuilder/parsers/relationships/AbstractRelationship.php'; |
|
67 | + foreach (AbstractRelationship::$definitionKeys as $key) |
|
68 | 68 | { |
69 | - if(!empty($_REQUEST ['ajaxLoad']) && in_array($key, array('label', 'rhs_label', 'lhs_label')) ){ |
|
69 | + if (!empty($_REQUEST ['ajaxLoad']) && in_array($key, array('label', 'rhs_label', 'lhs_label'))) { |
|
70 | 70 | continue; |
71 | 71 | } |
72 | - if (! empty ( $_REQUEST [ $key ] )) |
|
72 | + if (!empty ($_REQUEST [$key])) |
|
73 | 73 | { |
74 | - $definition [ $key ] = $_REQUEST [ $key ] ; |
|
74 | + $definition [$key] = $_REQUEST [$key]; |
|
75 | 75 | } |
76 | 76 | } |
77 | - return $definition ; |
|
77 | + return $definition; |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | function display() |
81 | 81 | { |
82 | - $selected_lang = (!empty($_REQUEST['relationship_lang'])?$_REQUEST['relationship_lang']:$_SESSION['authenticated_user_language']); |
|
83 | - $this->smarty = new Sugar_Smarty ( ) ; |
|
84 | - $ac = new AjaxCompose ( ) ; |
|
85 | - $this->fromModuleBuilder = isset ( $_REQUEST [ 'MB' ] ) || (!empty ( $_REQUEST [ 'view_package' ] ) && $_REQUEST [ 'view_package' ] != 'studio') ; |
|
86 | - $this->smarty->assign ( 'fromModuleBuilder', $this->fromModuleBuilder ) ; |
|
82 | + $selected_lang = (!empty($_REQUEST['relationship_lang']) ? $_REQUEST['relationship_lang'] : $_SESSION['authenticated_user_language']); |
|
83 | + $this->smarty = new Sugar_Smarty( ); |
|
84 | + $ac = new AjaxCompose( ); |
|
85 | + $this->fromModuleBuilder = isset ($_REQUEST ['MB']) || (!empty ($_REQUEST ['view_package']) && $_REQUEST ['view_package'] != 'studio'); |
|
86 | + $this->smarty->assign('fromModuleBuilder', $this->fromModuleBuilder); |
|
87 | 87 | |
88 | 88 | if (!$this->fromModuleBuilder) |
89 | 89 | { |
90 | - $module = StudioModuleFactory::getStudioModule( $_REQUEST [ 'view_module' ] ) ; |
|
91 | - $moduleName = $_REQUEST [ 'view_module' ] ; |
|
92 | - $fields = $module->fields ; |
|
93 | - require_once 'modules/ModuleBuilder/parsers/relationships/DeployedRelationships.php' ; |
|
94 | - $relatableModules = DeployedRelationships::findRelatableModules () ; |
|
95 | - $appStrings = return_app_list_strings_language( $selected_lang ) ; |
|
96 | - $modStrings = return_module_language( $selected_lang, $_REQUEST [ 'view_module' ], true ) ; |
|
90 | + $module = StudioModuleFactory::getStudioModule($_REQUEST ['view_module']); |
|
91 | + $moduleName = $_REQUEST ['view_module']; |
|
92 | + $fields = $module->fields; |
|
93 | + require_once 'modules/ModuleBuilder/parsers/relationships/DeployedRelationships.php'; |
|
94 | + $relatableModules = DeployedRelationships::findRelatableModules(); |
|
95 | + $appStrings = return_app_list_strings_language($selected_lang); |
|
96 | + $modStrings = return_module_language($selected_lang, $_REQUEST ['view_module'], true); |
|
97 | 97 | $appStrings = $appStrings['moduleList']; |
98 | 98 | } else |
99 | 99 | { |
100 | - $mb = new ModuleBuilder ( ) ; |
|
100 | + $mb = new ModuleBuilder( ); |
|
101 | 101 | $mb->getPackages(); |
102 | 102 | //display the latest module name rather than what is in or not in the loaded app_list_strings. |
103 | 103 | $mb->getPackage($_REQUEST ['view_package'])->loadModuleTitles(); |
104 | - $module = $mb->getPackageModule ( $_REQUEST [ 'view_package' ], $_REQUEST [ 'view_module' ] ) ; |
|
104 | + $module = $mb->getPackageModule($_REQUEST ['view_package'], $_REQUEST ['view_module']); |
|
105 | 105 | $moduleName = empty($module->key_name) ? $module->getModuleName() : $module->key_name; |
106 | - $this->smarty->assign ( 'view_package', $_REQUEST [ 'view_package' ] ) ; |
|
107 | - $mbvardefs = $module->getVardefs () ; |
|
108 | - $fields = $mbvardefs [ 'fields' ] ; |
|
109 | - require_once 'modules/ModuleBuilder/parsers/relationships/UndeployedRelationships.php' ; |
|
110 | - $relatableModules = UndeployedRelationships::findRelatableModules () ; |
|
111 | - $appStrings = $module->getModStrings( $selected_lang ) ; |
|
106 | + $this->smarty->assign('view_package', $_REQUEST ['view_package']); |
|
107 | + $mbvardefs = $module->getVardefs(); |
|
108 | + $fields = $mbvardefs ['fields']; |
|
109 | + require_once 'modules/ModuleBuilder/parsers/relationships/UndeployedRelationships.php'; |
|
110 | + $relatableModules = UndeployedRelationships::findRelatableModules(); |
|
111 | + $appStrings = $module->getModStrings($selected_lang); |
|
112 | 112 | } |
113 | 113 | |
114 | - ksort( $relatableModules ) ; |
|
115 | - $lhs_subpanels = $module->getProvidedSubpanels () ; |
|
114 | + ksort($relatableModules); |
|
115 | + $lhs_subpanels = $module->getProvidedSubpanels(); |
|
116 | 116 | // Fix to re-add sorting of the subpanel names so that the 'default' subpanel always appears first in the list. |
117 | 117 | // This assumes that subpanels are usually named ForXYZ which is the case currently, and hence 'default' will be sorted first. |
118 | 118 | //I f this assumption is incorrect, then a better solution would be to remove 'default' from the subpanel list, then sort, and finally array_unshift it back on. |
119 | 119 | natcasesort($lhs_subpanels); |
120 | 120 | |
121 | - $cardinality = array ( MB_ONETOONE => translate ( 'LBL_ONETOONE' ) , MB_ONETOMANY => translate ( 'LBL_ONETOMANY' ) , MB_MANYTOONE=> translate ( 'LBL_MANYTOONE' ), MB_MANYTOMANY => translate ( 'LBL_MANYTOMANY' ), ) ; |
|
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 | 123 | if (!$this->fromModuleBuilder) |
124 | 124 | unset($cardinality[MB_MANYTOONE]); |
125 | 125 | |
126 | - $relationships = $module->getRelationships () ; |
|
126 | + $relationships = $module->getRelationships(); |
|
127 | 127 | |
128 | 128 | // if a description for this relationship already exists, then load it so it can be modified |
129 | - if (! empty ( $_REQUEST [ 'relationship_name' ] )) |
|
129 | + if (!empty ($_REQUEST ['relationship_name'])) |
|
130 | 130 | { |
131 | - $relationship = $relationships->get ( $_REQUEST [ 'relationship_name' ] ) ; |
|
132 | - $relationship->setName($_REQUEST [ 'relationship_name' ] ); |
|
131 | + $relationship = $relationships->get($_REQUEST ['relationship_name']); |
|
132 | + $relationship->setName($_REQUEST ['relationship_name']); |
|
133 | 133 | $definition = $relationship->getDefinition(); |
134 | - if (!$this->fromModuleBuilder){ |
|
135 | - $modStrings = return_module_language( $selected_lang, $relationship->rhs_module, true ) ; |
|
136 | - $definition['lhs_label'] = isset($modStrings[$relationship->getTitleKey()])?$modStrings[$relationship->getTitleKey()] : $relationship->lhs_module; |
|
137 | - $modStrings = return_module_language( $selected_lang, $relationship->lhs_module, true ) ; |
|
138 | - $definition['rhs_label'] = isset($modStrings[$relationship->getTitleKey(true)])?$modStrings[$relationship->getTitleKey(true)] : $relationship->rhs_module ; |
|
139 | - }else{ |
|
134 | + if (!$this->fromModuleBuilder) { |
|
135 | + $modStrings = return_module_language($selected_lang, $relationship->rhs_module, true); |
|
136 | + $definition['lhs_label'] = isset($modStrings[$relationship->getTitleKey()]) ? $modStrings[$relationship->getTitleKey()] : $relationship->lhs_module; |
|
137 | + $modStrings = return_module_language($selected_lang, $relationship->lhs_module, true); |
|
138 | + $definition['rhs_label'] = isset($modStrings[$relationship->getTitleKey(true)]) ? $modStrings[$relationship->getTitleKey(true)] : $relationship->rhs_module; |
|
139 | + } else { |
|
140 | 140 | #30624 |
141 | - if(!empty($_REQUEST['rhs_module'])){ |
|
141 | + if (!empty($_REQUEST['rhs_module'])) { |
|
142 | 142 | $definition['rhs_label'] = $_REQUEST['rhs_module']; |
143 | 143 | } |
144 | 144 | } |
145 | 145 | } else |
146 | 146 | { |
147 | - $definition = array ( ) ; |
|
148 | - $firstModuleDefinition = each ( $relatableModules ) ; |
|
149 | - $definition [ 'rhs_module' ] = $firstModuleDefinition [ 'key' ] ; |
|
150 | - $definition [ 'lhs_module' ] = $moduleName ; |
|
151 | - $definition [ 'lhs_label' ] = translate($moduleName); |
|
152 | - $definition [ 'relationship_type' ] = MB_MANYTOMANY ; |
|
147 | + $definition = array( ); |
|
148 | + $firstModuleDefinition = each($relatableModules); |
|
149 | + $definition ['rhs_module'] = $firstModuleDefinition ['key']; |
|
150 | + $definition ['lhs_module'] = $moduleName; |
|
151 | + $definition ['lhs_label'] = translate($moduleName); |
|
152 | + $definition ['relationship_type'] = MB_MANYTOMANY; |
|
153 | 153 | } |
154 | 154 | // load the relationship from post - required as we can call view.relationship.php from Ajax when changing the rhs_module for example |
155 | - $definition = $this->overrideDefinitionFromPOST ( $definition ) ; |
|
155 | + $definition = $this->overrideDefinitionFromPOST($definition); |
|
156 | 156 | |
157 | 157 | if (empty($definition ['rhs_label'])) |
158 | 158 | { |
159 | - $definition ['rhs_label'] = translate($definition [ 'rhs_module' ]); |
|
159 | + $definition ['rhs_label'] = translate($definition ['rhs_module']); |
|
160 | 160 | } |
161 | 161 | if (empty($definition ['lhs_label'])) |
162 | 162 | { |
163 | - $definition ['lhs_label'] = translate($definition [ 'lhs_module' ]); |
|
163 | + $definition ['lhs_label'] = translate($definition ['lhs_module']); |
|
164 | 164 | } |
165 | - $relationship = RelationshipFactory::newRelationship ( $definition ) ; |
|
165 | + $relationship = RelationshipFactory::newRelationship($definition); |
|
166 | 166 | |
167 | - $rhs_subpanels = $relatableModules [ $relationship->rhs_module ] ; |
|
167 | + $rhs_subpanels = $relatableModules [$relationship->rhs_module]; |
|
168 | 168 | // Fix to re-add sorting of the subpanel names so that the 'default' subpanel always appears first in the list. This assumes that subpanels are usually named ForXYZ which is the case currently, and hence 'default' will be sorted first. If this assumption is incorrect, then a better solution would be to remove 'default' from the subpanel list, then sort, and finally array_unshift it back on. |
169 | 169 | natcasesort($rhs_subpanels); |
170 | 170 | |
171 | - if (empty ( $_REQUEST [ 'relationship_name' ] )) |
|
171 | + if (empty ($_REQUEST ['relationship_name'])) |
|
172 | 172 | { |
173 | 173 | // tidy up the options for the view based on the modules participating in the relationship and the cardinality |
174 | 174 | // some modules (e.g., Knowledge Base/KBDocuments) lack subpanels. That means they can't be the lhs of a 1-many or many-many, or the rhs of a many-many for example |
175 | 175 | |
176 | 176 | // fix up the available cardinality options |
177 | - $relationship_type = $relationship->getType () ; |
|
178 | - if (count ( $lhs_subpanels ) == 0 || count ( $rhs_subpanels ) == 0) |
|
177 | + $relationship_type = $relationship->getType(); |
|
178 | + if (count($lhs_subpanels) == 0 || count($rhs_subpanels) == 0) |
|
179 | 179 | { |
180 | - unset ( $cardinality [ MB_MANYTOMANY ] ) ; |
|
180 | + unset ($cardinality [MB_MANYTOMANY]); |
|
181 | 181 | } |
182 | - if (count ( $rhs_subpanels ) == 0) |
|
182 | + if (count($rhs_subpanels) == 0) |
|
183 | 183 | { |
184 | - unset ( $cardinality [ MB_ONETOMANY ] ) ; |
|
184 | + unset ($cardinality [MB_ONETOMANY]); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | if (isset ($definition['rhs_module']) && $definition['rhs_module'] == 'Activities') { |
188 | - $cardinality = array( MB_ONETOMANY => translate ( 'LBL_ONETOMANY' )); |
|
188 | + $cardinality = array(MB_ONETOMANY => translate('LBL_ONETOMANY')); |
|
189 | 189 | } |
190 | 190 | //Bug 23139, Campaigns module current cannot display custom subpanels, so we need to ban it from any |
191 | 191 | //relationships that would require a new subpanel to be shown in Campaigns. |
192 | 192 | if (isset ($definition['lhs_module']) && $definition['lhs_module'] == 'Campaigns') { |
193 | - unset ( $cardinality [ MB_MANYTOMANY ] ) ; |
|
194 | - unset ( $cardinality [ MB_ONETOMANY ] ) ; |
|
193 | + unset ($cardinality [MB_MANYTOMANY]); |
|
194 | + unset ($cardinality [MB_ONETOMANY]); |
|
195 | 195 | } |
196 | - if (isset ($definition['rhs_module']) && $definition['rhs_module'] == 'Campaigns' && isset($cardinality [ MB_MANYTOMANY ])) { |
|
197 | - unset ( $cardinality [ MB_MANYTOMANY ] ) ; |
|
198 | - unset ( $cardinality [ MB_MANYTOONE ] ); |
|
196 | + if (isset ($definition['rhs_module']) && $definition['rhs_module'] == 'Campaigns' && isset($cardinality [MB_MANYTOMANY])) { |
|
197 | + unset ($cardinality [MB_MANYTOMANY]); |
|
198 | + unset ($cardinality [MB_MANYTOONE]); |
|
199 | 199 | } |
200 | - if (! isset($cardinality[$relationship->getType()])) |
|
200 | + if (!isset($cardinality[$relationship->getType()])) |
|
201 | 201 | { |
202 | - end ($cardinality) ; |
|
203 | - $definition [ 'relationship_type' ] = key ( $cardinality ) ; |
|
204 | - $relationship = RelationshipFactory::newRelationship ( $definition ) ; |
|
202 | + end($cardinality); |
|
203 | + $definition ['relationship_type'] = key($cardinality); |
|
204 | + $relationship = RelationshipFactory::newRelationship($definition); |
|
205 | 205 | } |
206 | 206 | |
207 | - $this->smarty->assign ( 'is_new', true ) ; |
|
207 | + $this->smarty->assign('is_new', true); |
|
208 | 208 | } else { |
209 | - $this->smarty->assign ( 'is_new', false ) ; |
|
209 | + $this->smarty->assign('is_new', false); |
|
210 | 210 | } |
211 | 211 | |
212 | 212 | //Remove Activities if one-to-many is not availible |
213 | - if (!isset($cardinality [ MB_ONETOMANY ]) && isset ($relatableModules['Activities'])) { |
|
213 | + if (!isset($cardinality [MB_ONETOMANY]) && isset ($relatableModules['Activities'])) { |
|
214 | 214 | unset ($relatableModules['Activities']); |
215 | 215 | } |
216 | 216 | |
217 | 217 | |
218 | 218 | // now enforce the relationship_only requirement - that is, only construct the underlying relationship and link fields, and not the UI, if the subpanel code will have troubles displaying the UI |
219 | - $relationships->enforceRelationshipOnly ( $relationship ) ; |
|
220 | - $this->smarty->assign ( 'view_module', $_REQUEST['view_module'] ) ; |
|
221 | - $this->smarty->assign ( 'rel', $relationship->getDefinition () ) ; |
|
222 | - $this->smarty->assign ( 'mod_strings', $GLOBALS [ 'mod_strings' ] ) ; |
|
223 | - $this->smarty->assign ( 'module_key', $relationship->lhs_module ) ; |
|
224 | - $this->smarty->assign ( 'cardinality', array_keys ( $cardinality ) ) ; |
|
225 | - $this->smarty->assign ( 'translated_cardinality', $cardinality ) ; |
|
226 | - $this->smarty->assign ( 'selected_cardinality', translate ( $relationship->getType () ) ) ; |
|
219 | + $relationships->enforceRelationshipOnly($relationship); |
|
220 | + $this->smarty->assign('view_module', $_REQUEST['view_module']); |
|
221 | + $this->smarty->assign('rel', $relationship->getDefinition()); |
|
222 | + $this->smarty->assign('mod_strings', $GLOBALS ['mod_strings']); |
|
223 | + $this->smarty->assign('module_key', $relationship->lhs_module); |
|
224 | + $this->smarty->assign('cardinality', array_keys($cardinality)); |
|
225 | + $this->smarty->assign('translated_cardinality', $cardinality); |
|
226 | + $this->smarty->assign('selected_cardinality', translate($relationship->getType())); |
|
227 | 227 | |
228 | - $relatable = array ( ) ; |
|
229 | - foreach ( $relatableModules as $name => $dummy ) |
|
228 | + $relatable = array( ); |
|
229 | + foreach ($relatableModules as $name => $dummy) |
|
230 | 230 | { |
231 | - $relatable [ $name ] = translate ( $name ) ; |
|
231 | + $relatable [$name] = translate($name); |
|
232 | 232 | } |
233 | - unset($relatable [ 'KBDocuments' ] ) ; |
|
234 | - natcasesort ( $relatable ) ; |
|
235 | - $this->smarty->assign ( 'relatable', array_keys ( $relatable ) ) ; |
|
236 | - $this->smarty->assign ( 'translated_relatable', $relatable ) ; |
|
237 | - $this->smarty->assign ( 'rhspanels', $rhs_subpanels ) ; |
|
238 | - $this->smarty->assign ( 'lhspanels', $lhs_subpanels ) ; |
|
233 | + unset($relatable ['KBDocuments']); |
|
234 | + natcasesort($relatable); |
|
235 | + $this->smarty->assign('relatable', array_keys($relatable)); |
|
236 | + $this->smarty->assign('translated_relatable', $relatable); |
|
237 | + $this->smarty->assign('rhspanels', $rhs_subpanels); |
|
238 | + $this->smarty->assign('lhspanels', $lhs_subpanels); |
|
239 | 239 | $this->smarty->assign('selected_lang', $selected_lang); |
240 | - $this->smarty->assign('available_languages',get_languages()); |
|
240 | + $this->smarty->assign('available_languages', get_languages()); |
|
241 | 241 | |
242 | - switch ( $relationship->relationship_type) |
|
242 | + switch ($relationship->relationship_type) |
|
243 | 243 | { |
244 | 244 | case MB_ONETOONE : |
245 | - break ; |
|
245 | + break; |
|
246 | 246 | |
247 | 247 | case MB_ONETOMANY : |
248 | - if (empty ( $relationship->relationship_column_name )) |
|
248 | + if (empty ($relationship->relationship_column_name)) |
|
249 | 249 | { |
250 | - $validRoleColumnFields = array ( ) ; |
|
251 | - foreach ( $fields as $field ) |
|
250 | + $validRoleColumnFields = array( ); |
|
251 | + foreach ($fields as $field) |
|
252 | 252 | { |
253 | - $validRoleColumnFields [] = $field ; |
|
253 | + $validRoleColumnFields [] = $field; |
|
254 | 254 | } |
255 | - $this->smarty->assign ( 'relationship_role_column_enum', $validRoleColumnFields ) ; |
|
255 | + $this->smarty->assign('relationship_role_column_enum', $validRoleColumnFields); |
|
256 | 256 | } |
257 | - if (! empty ( $relationship->relationship_role_column_value )) |
|
258 | - $this->smarty->assign ( 'relationship_role_column_value', $relationship->relationship_role_column_value ) ; |
|
259 | - break ; |
|
257 | + if (!empty ($relationship->relationship_role_column_value)) |
|
258 | + $this->smarty->assign('relationship_role_column_value', $relationship->relationship_role_column_value); |
|
259 | + break; |
|
260 | 260 | 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 | - break ; |
|
261 | + if (!empty ($relationship->relationship_role_column_value)) |
|
262 | + $this->smarty->assign('relationship_role_column_value', $relationship->relationship_role_column_value); |
|
263 | + break; |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | //see if we use the new system |
267 | - if (isset ( $_REQUEST [ 'json' ] ) && $_REQUEST [ 'json' ] == 'false') |
|
267 | + if (isset ($_REQUEST ['json']) && $_REQUEST ['json'] == 'false') |
|
268 | 268 | { |
269 | - echo $this->smarty->fetch ( 'modules/ModuleBuilder/tpls/studioRelationship.tpl' ) ; |
|
269 | + echo $this->smarty->fetch('modules/ModuleBuilder/tpls/studioRelationship.tpl'); |
|
270 | 270 | } else |
271 | 271 | { |
272 | - $ac->addSection ( 'east', $module->name . ' ' . $GLOBALS [ 'mod_strings' ] [ 'LBL_RELATIONSHIPS' ], $this->smarty->fetch ( 'modules/ModuleBuilder/tpls/studioRelationship.tpl' ) ) ; |
|
273 | - echo $ac->getJavascript () ; |
|
272 | + $ac->addSection('east', $module->name.' '.$GLOBALS ['mod_strings'] ['LBL_RELATIONSHIPS'], $this->smarty->fetch('modules/ModuleBuilder/tpls/studioRelationship.tpl')); |
|
273 | + echo $ac->getJavascript(); |
|
274 | 274 | } |
275 | 275 | } |
276 | 276 | } |
277 | 277 | \ No newline at end of file |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | global $mod_strings; |
50 | 50 | |
51 | 51 | return array( |
52 | - translate('LBL_MODULE_NAME','Administration'), |
|
52 | + translate('LBL_MODULE_NAME', 'Administration'), |
|
53 | 53 | ModuleBuilderController::getModuleTitle(), |
54 | 54 | ); |
55 | 55 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | require_once ('modules/ModuleBuilder/Module/DropDownTree.php'); |
65 | 65 | $mbt = new DropDownTree(); |
66 | 66 | $ajax->addSection('west', $mbt->getName(), $mbt->fetchNodes()); |
67 | - $smarty->assign('refreshTree',true); |
|
67 | + $smarty->assign('refreshTree', true); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | global $mod_strings; |
@@ -73,14 +73,14 @@ discard block |
||
73 | 73 | require_once('modules/ModuleBuilder/Module/DropDownBrowser.php'); |
74 | 74 | $dd = new DropDownBrowser(); |
75 | 75 | |
76 | - $smarty->assign('LBL_BTN_ADDDROPDOWN',translate('LBL_BTN_ADDDROPDOWN')); |
|
76 | + $smarty->assign('LBL_BTN_ADDDROPDOWN', translate('LBL_BTN_ADDDROPDOWN')); |
|
77 | 77 | $smarty->assign('dropdowns', $dd->getNodes()); |
78 | - $smarty->assign('deleteImage', SugarThemeRegistry::current()->getImage( 'delete_inline', '',null,null,'.gif',$mod_strings['LBL_MB_DELETE'])); |
|
79 | - $smarty->assign('editImage', SugarThemeRegistry::current()->getImage( 'edit_inline', '',null,null,'.gif',$mod_strings['LBL_EDIT'])); |
|
78 | + $smarty->assign('deleteImage', SugarThemeRegistry::current()->getImage('delete_inline', '', null, null, '.gif', $mod_strings['LBL_MB_DELETE'])); |
|
79 | + $smarty->assign('editImage', SugarThemeRegistry::current()->getImage('edit_inline', '', null, null, '.gif', $mod_strings['LBL_EDIT'])); |
|
80 | 80 | $smarty->assign('action', 'savedropdown'); |
81 | 81 | |
82 | 82 | |
83 | - $ajax->addSection('center', $GLOBALS['mod_strings']['LBL_DROPDOWNEDITOR'], $smarty->fetch('modules/ModuleBuilder/tpls/MBModule/dropdowns.tpl') ); |
|
83 | + $ajax->addSection('center', $GLOBALS['mod_strings']['LBL_DROPDOWNEDITOR'], $smarty->fetch('modules/ModuleBuilder/tpls/MBModule/dropdowns.tpl')); |
|
84 | 84 | echo $ajax->getJavascript(); |
85 | 85 | } |
86 | 86 | } |
87 | 87 | \ No newline at end of file |
@@ -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 | * SugarCRM Community Edition is a customer relationship management program developed by |
6 | 6 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -41,23 +41,23 @@ discard block |
||
41 | 41 | |
42 | 42 | |
43 | 43 | |
44 | -require_once ('modules/ModuleBuilder/views/view.listview.php') ; |
|
45 | -require_once 'modules/ModuleBuilder/parsers/constants.php' ; |
|
44 | +require_once ('modules/ModuleBuilder/views/view.listview.php'); |
|
45 | +require_once 'modules/ModuleBuilder/parsers/constants.php'; |
|
46 | 46 | |
47 | 47 | class ViewPopupview extends ViewListView |
48 | 48 | { |
49 | 49 | function __construct() |
50 | 50 | { |
51 | - $this->editModule = $_REQUEST [ 'view_module' ] ; |
|
52 | - $this->editLayout = $_REQUEST [ 'view' ] ; |
|
53 | - $this->editPackage = (isset ( $_REQUEST [ 'view_package' ] ) && ! empty ( $_REQUEST [ 'view_package' ] )) ? $_REQUEST [ 'view_package' ] : null ; |
|
51 | + $this->editModule = $_REQUEST ['view_module']; |
|
52 | + $this->editLayout = $_REQUEST ['view']; |
|
53 | + $this->editPackage = (isset ($_REQUEST ['view_package']) && !empty ($_REQUEST ['view_package'])) ? $_REQUEST ['view_package'] : null; |
|
54 | 54 | |
55 | - $this->fromModuleBuilder = isset ( $_REQUEST [ 'MB' ] ) || (isset($_REQUEST['view_package']) && $_REQUEST['view_package'] && $_REQUEST['view_package'] != 'studio') ; |
|
55 | + $this->fromModuleBuilder = isset ($_REQUEST ['MB']) || (isset($_REQUEST['view_package']) && $_REQUEST['view_package'] && $_REQUEST['view_package'] != 'studio'); |
|
56 | 56 | if (!$this->fromModuleBuilder) |
57 | 57 | { |
58 | - global $app_list_strings ; |
|
59 | - $moduleNames = array_change_key_case ( $app_list_strings [ 'moduleList' ] ) ; |
|
60 | - $this->translatedEditModule = $moduleNames [ strtolower ( $this->editModule ) ] ; |
|
58 | + global $app_list_strings; |
|
59 | + $moduleNames = array_change_key_case($app_list_strings ['moduleList']); |
|
60 | + $this->translatedEditModule = $moduleNames [strtolower($this->editModule)]; |
|
61 | 61 | } |
62 | 62 | } |
63 | 63 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | global $mod_strings; |
70 | 70 | |
71 | 71 | return array( |
72 | - translate('LBL_MODULE_NAME','Administration'), |
|
72 | + translate('LBL_MODULE_NAME', 'Administration'), |
|
73 | 73 | ModuleBuilderController::getModuleTitle(), |
74 | 74 | ); |
75 | 75 | } |
@@ -90,148 +90,148 @@ discard block |
||
90 | 90 | $preview = false |
91 | 91 | ) |
92 | 92 | { |
93 | - require_once 'modules/ModuleBuilder/parsers/ParserFactory.php' ; |
|
94 | - $parser = ParserFactory::getParser ( $this->editLayout, $this->editModule, $this->editPackage) ; |
|
93 | + require_once 'modules/ModuleBuilder/parsers/ParserFactory.php'; |
|
94 | + $parser = ParserFactory::getParser($this->editLayout, $this->editModule, $this->editPackage); |
|
95 | 95 | |
96 | - $smarty = $this->constructSmarty ( $parser ) ; |
|
96 | + $smarty = $this->constructSmarty($parser); |
|
97 | 97 | |
98 | - if(isset($this->view_object_map['new_parser'])) { |
|
98 | + if (isset($this->view_object_map['new_parser'])) { |
|
99 | 99 | $smarty = $this->constructSmarty($this->view_object_map['new_parser']); |
100 | 100 | } |
101 | 101 | |
102 | 102 | if ($preview) |
103 | 103 | { |
104 | - echo $smarty->fetch ( "modules/ModuleBuilder/tpls/Preview/listView.tpl" ) ; |
|
104 | + echo $smarty->fetch("modules/ModuleBuilder/tpls/Preview/listView.tpl"); |
|
105 | 105 | } else |
106 | 106 | { |
107 | - $ajax = $this->constructAjax () ; |
|
108 | - $ajax->addSection ( 'center', translate('LBL_POPUP'), $smarty->fetch ( "modules/ModuleBuilder/tpls/listView.tpl" ) ) ; |
|
109 | - echo $ajax->getJavascript () ; |
|
107 | + $ajax = $this->constructAjax(); |
|
108 | + $ajax->addSection('center', translate('LBL_POPUP'), $smarty->fetch("modules/ModuleBuilder/tpls/listView.tpl")); |
|
109 | + echo $ajax->getJavascript(); |
|
110 | 110 | } |
111 | 111 | } |
112 | 112 | |
113 | 113 | function constructAjax() |
114 | 114 | { |
115 | - require_once ('modules/ModuleBuilder/MB/AjaxCompose.php') ; |
|
116 | - $ajax = new AjaxCompose ( ) ; |
|
115 | + require_once ('modules/ModuleBuilder/MB/AjaxCompose.php'); |
|
116 | + $ajax = new AjaxCompose( ); |
|
117 | 117 | |
118 | 118 | if ($this->fromModuleBuilder) |
119 | 119 | { |
120 | - $ajax->addCrumb ( translate ( 'LBL_MODULEBUILDER', 'ModuleBuilder' ), 'ModuleBuilder.main("mb")' ) ; |
|
121 | - $ajax->addCrumb ( $_REQUEST [ 'view_package' ], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package=' . $this->editPackage . '")' ) ; |
|
122 | - $ajax->addCrumb ( $this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package=' . $this->editPackage . '&view_module=' . $this->editModule . '")' ) ; |
|
123 | - $ajax->addCrumb ( translate('LBL_LAYOUTS', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&layouts=1&MB=1&view_package='.$this->editPackage.'&view_module=' . $this->editModule . '")'); |
|
124 | - $ajax->addCrumb ( translate('LBL_POPUP', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=popup&MB=1&view_package='.$this->editPackage.'&view_module=' . $this->editModule . '")' ); |
|
120 | + $ajax->addCrumb(translate('LBL_MODULEBUILDER', 'ModuleBuilder'), 'ModuleBuilder.main("mb")'); |
|
121 | + $ajax->addCrumb($_REQUEST ['view_package'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$this->editPackage.'")'); |
|
122 | + $ajax->addCrumb($this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package='.$this->editPackage.'&view_module='.$this->editModule.'")'); |
|
123 | + $ajax->addCrumb(translate('LBL_LAYOUTS', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&layouts=1&MB=1&view_package='.$this->editPackage.'&view_module='.$this->editModule.'")'); |
|
124 | + $ajax->addCrumb(translate('LBL_POPUP', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=popup&MB=1&view_package='.$this->editPackage.'&view_module='.$this->editModule.'")'); |
|
125 | 125 | |
126 | 126 | $ViewLabel = ($this->editLayout == MB_POPUPLIST) ? 'LBL_POPUPLISTVIEW' : 'LBL_POPUPSEARCH'; |
127 | - $ajax->addCrumb ( translate ($ViewLabel, 'ModuleBuilder' ), '' ) ; |
|
128 | - }else{ |
|
129 | - $ajax->addCrumb ( translate($this->editModule), 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_module=' . $this->editModule . '")' ) ; |
|
130 | - $ajax->addCrumb ( translate('LBL_LAYOUTS', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&layouts=1&view_module=' . $this->editModule . '")'); |
|
131 | - $ajax->addCrumb ( translate('LBL_POPUP', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=popup&view_module=' . $this->editModule . '")' ); |
|
127 | + $ajax->addCrumb(translate($ViewLabel, 'ModuleBuilder'), ''); |
|
128 | + } else { |
|
129 | + $ajax->addCrumb(translate($this->editModule), 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_module='.$this->editModule.'")'); |
|
130 | + $ajax->addCrumb(translate('LBL_LAYOUTS', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&layouts=1&view_module='.$this->editModule.'")'); |
|
131 | + $ajax->addCrumb(translate('LBL_POPUP', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=popup&view_module='.$this->editModule.'")'); |
|
132 | 132 | $ViewLabel = ($this->editLayout == MB_POPUPLIST) ? 'LBL_POPUPLISTVIEW' : 'LBL_POPUPSEARCH'; |
133 | - $ajax->addCrumb ( translate ($ViewLabel, 'ModuleBuilder' ), '' ) ; |
|
133 | + $ajax->addCrumb(translate($ViewLabel, 'ModuleBuilder'), ''); |
|
134 | 134 | } |
135 | - return $ajax ; |
|
135 | + return $ajax; |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | function constructSmarty( |
139 | 139 | $parser |
140 | 140 | ) |
141 | 141 | { |
142 | - $smarty = new Sugar_Smarty ( ) ; |
|
143 | - $smarty->assign ( 'translate', true ) ; |
|
144 | - $smarty->assign ( 'language', $parser->getLanguage () ) ; |
|
145 | - |
|
146 | - $smarty->assign ( 'view', $this->editLayout ) ; |
|
147 | - $smarty->assign ( 'action', 'popupSave' ) ; |
|
148 | - $smarty->assign( 'module', 'ModuleBuilder'); |
|
149 | - $smarty->assign ( 'view_module', $this->editModule ) ; |
|
150 | - $smarty->assign ( 'field_defs', $parser->getFieldDefs () ) ; |
|
151 | - $helpName = (isset( $_REQUEST['view']) && $_REQUEST['view']==MB_POPUPSEARCH) ? 'searchViewEditor' : 'popupListViewEditor'; |
|
152 | - $smarty->assign ( 'helpName', $helpName ) ; |
|
153 | - $smarty->assign ( 'helpDefault', 'modify' ) ; |
|
142 | + $smarty = new Sugar_Smarty( ); |
|
143 | + $smarty->assign('translate', true); |
|
144 | + $smarty->assign('language', $parser->getLanguage()); |
|
145 | + |
|
146 | + $smarty->assign('view', $this->editLayout); |
|
147 | + $smarty->assign('action', 'popupSave'); |
|
148 | + $smarty->assign('module', 'ModuleBuilder'); |
|
149 | + $smarty->assign('view_module', $this->editModule); |
|
150 | + $smarty->assign('field_defs', $parser->getFieldDefs()); |
|
151 | + $helpName = (isset($_REQUEST['view']) && $_REQUEST['view'] == MB_POPUPSEARCH) ? 'searchViewEditor' : 'popupListViewEditor'; |
|
152 | + $smarty->assign('helpName', $helpName); |
|
153 | + $smarty->assign('helpDefault', 'modify'); |
|
154 | 154 | if ($this->fromModuleBuilder) { |
155 | - $mb = new ModuleBuilder ( ) ; |
|
156 | - $module = & $mb->getPackageModule ( $this->editPackage, $this->editModule ) ; |
|
155 | + $mb = new ModuleBuilder( ); |
|
156 | + $module = & $mb->getPackageModule($this->editPackage, $this->editModule); |
|
157 | 157 | $smarty->assign('current_mod_strings', $module->getModStrings()); |
158 | 158 | } |
159 | 159 | |
160 | - $smarty->assign ( 'title', $this->_constructTitle () ) ; |
|
161 | - $groups = array ( ) ; |
|
162 | - foreach ( $parser->columns as $column => $function ) |
|
160 | + $smarty->assign('title', $this->_constructTitle()); |
|
161 | + $groups = array( ); |
|
162 | + foreach ($parser->columns as $column => $function) |
|
163 | 163 | { |
164 | - $groups [ $GLOBALS [ 'mod_strings' ] [ $column ] ] = $parser->$function () ; |
|
164 | + $groups [$GLOBALS ['mod_strings'] [$column]] = $parser->$function(); |
|
165 | 165 | } |
166 | - foreach ( $groups as $groupKey => $group ) |
|
166 | + foreach ($groups as $groupKey => $group) |
|
167 | 167 | { |
168 | - foreach ( $group as $fieldKey => $field ) |
|
168 | + foreach ($group as $fieldKey => $field) |
|
169 | 169 | { |
170 | - if (isset ( $field [ 'width' ] )) |
|
170 | + if (isset ($field ['width'])) |
|
171 | 171 | { |
172 | - if (substr ( $field [ 'width' ], - 1, 1 ) == '%') |
|
172 | + if (substr($field ['width'], - 1, 1) == '%') |
|
173 | 173 | { |
174 | - $groups [ $groupKey ] [ $fieldKey ] [ 'width' ] = substr ( $field [ 'width' ], 0, strlen ( $field [ 'width' ] ) - 1 ) ; |
|
174 | + $groups [$groupKey] [$fieldKey] ['width'] = substr($field ['width'], 0, strlen($field ['width']) - 1); |
|
175 | 175 | } |
176 | 176 | } |
177 | 177 | } |
178 | 178 | } |
179 | 179 | |
180 | - $smarty->assign ( 'groups', $groups ) ; |
|
180 | + $smarty->assign('groups', $groups); |
|
181 | 181 | |
182 | 182 | global $image_path, $mod_strings; |
183 | - $imageSave = SugarThemeRegistry::current()->getImage('studio_save','',null,null,'.gif',$mod_strings['LBL_BTN_SAVE']) ; |
|
183 | + $imageSave = SugarThemeRegistry::current()->getImage('studio_save', '', null, null, '.gif', $mod_strings['LBL_BTN_SAVE']); |
|
184 | 184 | |
185 | 185 | |
186 | - $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\")" ; |
|
186 | + $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\")"; |
|
187 | 187 | if (isset($this->searchlayout)) |
188 | - $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$this->searchlayout}\")" ; |
|
188 | + $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$this->searchlayout}\")"; |
|
189 | 189 | |
190 | - $buttons = array ( ) ; |
|
191 | - if (! $this->fromModuleBuilder) |
|
190 | + $buttons = array( ); |
|
191 | + if (!$this->fromModuleBuilder) |
|
192 | 192 | { |
193 | - $buttons [] = array ( 'name' => 'savebtn' , 'image' => $imageSave , 'text' => $GLOBALS [ 'mod_strings' ] [ 'LBL_BTN_SAVEPUBLISH' ] , 'actionScript' => "onclick='studiotabs.generateGroupForm(\"edittabs\");ModuleBuilder.state.isDirty=false;ModuleBuilder.submitForm(\"edittabs\" )'" ) ; |
|
193 | + $buttons [] = array('name' => 'savebtn', 'image' => $imageSave, 'text' => $GLOBALS ['mod_strings'] ['LBL_BTN_SAVEPUBLISH'], 'actionScript' => "onclick='studiotabs.generateGroupForm(\"edittabs\");ModuleBuilder.state.isDirty=false;ModuleBuilder.submitForm(\"edittabs\" )'"); |
|
194 | 194 | } else |
195 | 195 | { |
196 | - $buttons [] = array ( 'name' => 'mbsavebtn' , 'image' => $imageSave , 'text' => $GLOBALS [ 'mod_strings' ] [ 'LBL_BTN_SAVE' ] , 'actionScript' => "onclick='studiotabs.generateGroupForm(\"edittabs\");ModuleBuilder.state.isDirty=false;ModuleBuilder.submitForm(\"edittabs\" )'" ) ; |
|
196 | + $buttons [] = array('name' => 'mbsavebtn', 'image' => $imageSave, 'text' => $GLOBALS ['mod_strings'] ['LBL_BTN_SAVE'], 'actionScript' => "onclick='studiotabs.generateGroupForm(\"edittabs\");ModuleBuilder.state.isDirty=false;ModuleBuilder.submitForm(\"edittabs\" )'"); |
|
197 | 197 | } |
198 | - $buttons [] = array ( 'name' => 'historyBtn' , 'text' => translate ( 'LBL_HISTORY' ) , 'actionScript' => "onclick='$histaction'" ) ; |
|
199 | - $smarty->assign ( 'buttons', $this->_buildImageButtons ( $buttons ) ) ; |
|
200 | - $editImage = SugarThemeRegistry::current()->getImage('edit_inline','',null,null,'.gif',$mod_strings['LBL_EDIT']) ; |
|
198 | + $buttons [] = array('name' => 'historyBtn', 'text' => translate('LBL_HISTORY'), 'actionScript' => "onclick='$histaction'"); |
|
199 | + $smarty->assign('buttons', $this->_buildImageButtons($buttons)); |
|
200 | + $editImage = SugarThemeRegistry::current()->getImage('edit_inline', '', null, null, '.gif', $mod_strings['LBL_EDIT']); |
|
201 | 201 | |
202 | - $smarty->assign ( 'editImage', $editImage ) ; |
|
203 | - $deleteImage = SugarThemeRegistry::current()->getImage('delete_inline','',null,null,'.gif',$mod_strings['LBL_MB_DELETE']) ; |
|
202 | + $smarty->assign('editImage', $editImage); |
|
203 | + $deleteImage = SugarThemeRegistry::current()->getImage('delete_inline', '', null, null, '.gif', $mod_strings['LBL_MB_DELETE']); |
|
204 | 204 | |
205 | - $smarty->assign ( 'deleteImage', $deleteImage ) ; |
|
206 | - $smarty->assign ( 'MOD', $GLOBALS [ 'mod_strings' ] ) ; |
|
205 | + $smarty->assign('deleteImage', $deleteImage); |
|
206 | + $smarty->assign('MOD', $GLOBALS ['mod_strings']); |
|
207 | 207 | |
208 | 208 | if ($this->fromModuleBuilder) |
209 | 209 | { |
210 | - $smarty->assign ( 'MB', true ) ; |
|
211 | - $smarty->assign ( 'view_package', $this->editPackage ) ; |
|
212 | - $smarty->assign ( 'description', $GLOBALS [ 'mod_strings' ] [ 'LBL_LISTVIEW_DESCRIPTION' ] ) ; |
|
210 | + $smarty->assign('MB', true); |
|
211 | + $smarty->assign('view_package', $this->editPackage); |
|
212 | + $smarty->assign('description', $GLOBALS ['mod_strings'] ['LBL_LISTVIEW_DESCRIPTION']); |
|
213 | 213 | |
214 | 214 | } else |
215 | 215 | { |
216 | - $smarty->assign ( 'description', $GLOBALS [ 'mod_strings' ] [ 'LBL_LISTVIEW_DESCRIPTION' ] ) ; |
|
216 | + $smarty->assign('description', $GLOBALS ['mod_strings'] ['LBL_LISTVIEW_DESCRIPTION']); |
|
217 | 217 | } |
218 | 218 | |
219 | - return $smarty ; |
|
219 | + return $smarty; |
|
220 | 220 | } |
221 | 221 | |
222 | 222 | function _constructTitle() |
223 | 223 | { |
224 | 224 | |
225 | - global $app_list_strings ; |
|
225 | + global $app_list_strings; |
|
226 | 226 | |
227 | 227 | if ($this->fromModuleBuilder) |
228 | 228 | { |
229 | - $title = $this->editModule ; |
|
229 | + $title = $this->editModule; |
|
230 | 230 | } else |
231 | 231 | { |
232 | - $title = $app_list_strings [ 'moduleList' ] [ $this->editModule ] ; |
|
232 | + $title = $app_list_strings ['moduleList'] [$this->editModule]; |
|
233 | 233 | } |
234 | - return $GLOBALS [ 'mod_strings' ] [ 'LBL_LISTVIEW_EDIT' ] . ': ' . $title ; |
|
234 | + return $GLOBALS ['mod_strings'] ['LBL_LISTVIEW_EDIT'].': '.$title; |
|
235 | 235 | |
236 | 236 | } |
237 | 237 | } |
@@ -40,8 +40,8 @@ discard block |
||
40 | 40 | |
41 | 41 | require_once('modules/ModuleBuilder/MB/AjaxCompose.php'); |
42 | 42 | require_once('modules/ModuleBuilder/Module/StudioModule.php'); |
43 | -require_once('modules/ModuleBuilder/Module/StudioBrowser.php') ; |
|
44 | -require_once('include/ytree/ExtNode.php') ; |
|
43 | +require_once('modules/ModuleBuilder/Module/StudioBrowser.php'); |
|
44 | +require_once('include/ytree/ExtNode.php'); |
|
45 | 45 | |
46 | 46 | class ViewHistory extends SugarView |
47 | 47 | { |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | global $mod_strings; |
54 | 54 | |
55 | 55 | return array( |
56 | - translate('LBL_MODULE_NAME','Administration'), |
|
56 | + translate('LBL_MODULE_NAME', 'Administration'), |
|
57 | 57 | ModuleBuilderController::getModuleTitle(), |
58 | 58 | ); |
59 | 59 | } |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | $root = new ExtNode('root', 'root', true); |
66 | 66 | $sb = new StudioBrowser(); |
67 | 67 | $sb->loadModules(); |
68 | - foreach($sb->modules as $name => $studioMod) { |
|
68 | + foreach ($sb->modules as $name => $studioMod) { |
|
69 | 69 | $root->add_node($this->buildStudioNode($studioMod)); |
70 | 70 | } |
71 | 71 | $json = getJSONobj(); |
@@ -37,12 +37,12 @@ discard block |
||
37 | 37 | * display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM". |
38 | 38 | ********************************************************************************/ |
39 | 39 | |
40 | -require_once ('modules/ModuleBuilder/MB/AjaxCompose.php') ; |
|
41 | -require_once ('modules/ModuleBuilder/MB/ModuleBuilder.php') ; |
|
42 | -require_once ('modules/ModuleBuilder/Module/StudioModule.php') ; |
|
43 | -require_once ('modules/ModuleBuilder/Module/StudioBrowser.php') ; |
|
44 | -require_once ('modules/DynamicFields/DynamicField.php') ; |
|
45 | -require_once 'modules/ModuleBuilder/Module/StudioModuleFactory.php' ; |
|
40 | +require_once ('modules/ModuleBuilder/MB/AjaxCompose.php'); |
|
41 | +require_once ('modules/ModuleBuilder/MB/ModuleBuilder.php'); |
|
42 | +require_once ('modules/ModuleBuilder/Module/StudioModule.php'); |
|
43 | +require_once ('modules/ModuleBuilder/Module/StudioBrowser.php'); |
|
44 | +require_once ('modules/DynamicFields/DynamicField.php'); |
|
45 | +require_once 'modules/ModuleBuilder/Module/StudioModuleFactory.php'; |
|
46 | 46 | require_once 'modules/ModuleBuilder/parsers/views/DeployedMetaDataImplementation.php'; |
47 | 47 | |
48 | 48 | class ViewResetmodule extends SugarView |
@@ -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 | } |
@@ -67,12 +67,12 @@ discard block |
||
67 | 67 | return $this->handleSave(); |
68 | 68 | } |
69 | 69 | |
70 | - $ajax = new AjaxCompose ( ) ; |
|
71 | - $ajax->addCrumb ( translate('LBL_STUDIO'), 'ModuleBuilder.main("studio")' ) ; |
|
72 | - $ajax->addCrumb ( translate($moduleName), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module=' . $moduleName . '")' ) ; |
|
73 | - $ajax->addCrumb ( translate('LBL_RESET') . " " . translate($moduleName) , '') ; |
|
70 | + $ajax = new AjaxCompose( ); |
|
71 | + $ajax->addCrumb(translate('LBL_STUDIO'), 'ModuleBuilder.main("studio")'); |
|
72 | + $ajax->addCrumb(translate($moduleName), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module='.$moduleName.'")'); |
|
73 | + $ajax->addCrumb(translate('LBL_RESET')." ".translate($moduleName), ''); |
|
74 | 74 | |
75 | - $smarty = new Sugar_Smarty ( ) ; |
|
75 | + $smarty = new Sugar_Smarty( ); |
|
76 | 76 | $smarty->assign("module", $moduleName); |
77 | 77 | $smarty->assign("actions", array( |
78 | 78 | array("name" => "relationships", "label" => translate("LBL_CLEAR_RELATIONSHIPS")), |
@@ -82,13 +82,13 @@ discard block |
||
82 | 82 | array("name" => "extensions", "label" => translate("LBL_CLEAR_EXTENSIONS")), |
83 | 83 | )); |
84 | 84 | |
85 | - $ajax->addSection ( |
|
85 | + $ajax->addSection( |
|
86 | 86 | 'center', |
87 | - "Reset ". translate($moduleName) , |
|
87 | + "Reset ".translate($moduleName), |
|
88 | 88 | $smarty->fetch('modules/ModuleBuilder/tpls/resetModule.tpl') //"This works now" |
89 | - ) ; |
|
89 | + ); |
|
90 | 90 | |
91 | - echo $ajax->getJavascript () ; |
|
91 | + echo $ajax->getJavascript(); |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | function handleSave() |
@@ -113,20 +113,20 @@ discard block |
||
113 | 113 | |
114 | 114 | $out .= "Complete!"; |
115 | 115 | |
116 | - $ajax = new AjaxCompose ( ) ; |
|
116 | + $ajax = new AjaxCompose( ); |
|
117 | 117 | |
118 | - $ajax->addCrumb ( translate('LBL_STUDIO'), 'ModuleBuilder.main("studio")' ) ; |
|
119 | - $ajax->addCrumb ( translate($this->module), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module=' . $this->module . '")' ) ; |
|
120 | - $ajax->addCrumb ( "Reset ". translate($this->module) , '') ; |
|
118 | + $ajax->addCrumb(translate('LBL_STUDIO'), 'ModuleBuilder.main("studio")'); |
|
119 | + $ajax->addCrumb(translate($this->module), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module='.$this->module.'")'); |
|
120 | + $ajax->addCrumb("Reset ".translate($this->module), ''); |
|
121 | 121 | |
122 | 122 | |
123 | - $ajax->addSection ( |
|
123 | + $ajax->addSection( |
|
124 | 124 | 'center', |
125 | - "Reset ". translate($this->module) , |
|
125 | + "Reset ".translate($this->module), |
|
126 | 126 | $out |
127 | - ) ; |
|
127 | + ); |
|
128 | 128 | |
129 | - echo $ajax->getJavascript () ; |
|
129 | + echo $ajax->getJavascript(); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | /** |
@@ -137,21 +137,21 @@ discard block |
||
137 | 137 | function removeCustomFields() |
138 | 138 | { |
139 | 139 | $moduleName = $this->module; |
140 | - $class_name = $GLOBALS [ 'beanList' ] [ $moduleName ] ; |
|
141 | - require_once ($GLOBALS [ 'beanFiles' ] [ $class_name ]) ; |
|
142 | - $seed = new $class_name ( ) ; |
|
143 | - $df = new DynamicField ( $moduleName ) ; |
|
144 | - $df->setup ( $seed ) ; |
|
140 | + $class_name = $GLOBALS ['beanList'] [$moduleName]; |
|
141 | + require_once ($GLOBALS ['beanFiles'] [$class_name]); |
|
142 | + $seed = new $class_name( ); |
|
143 | + $df = new DynamicField($moduleName); |
|
144 | + $df->setup($seed); |
|
145 | 145 | |
146 | 146 | |
147 | - $module = StudioModuleFactory::getStudioModule( $moduleName ) ; |
|
147 | + $module = StudioModuleFactory::getStudioModule($moduleName); |
|
148 | 148 | $customFields = array(); |
149 | - foreach($seed->field_defs as $def) { |
|
150 | - if(isset($def['source']) && $def['source'] == 'custom_fields') { |
|
149 | + foreach ($seed->field_defs as $def) { |
|
150 | + if (isset($def['source']) && $def['source'] == 'custom_fields') { |
|
151 | 151 | $field = $df->getFieldWidget($moduleName, $def['name']); |
152 | - $field->delete ( $df ) ; |
|
152 | + $field->delete($df); |
|
153 | 153 | |
154 | - $module->removeFieldFromLayouts( $def['name'] ); |
|
154 | + $module->removeFieldFromLayouts($def['name']); |
|
155 | 155 | $customFields[] = $def['name']; |
156 | 156 | } |
157 | 157 | } |
@@ -169,11 +169,11 @@ discard block |
||
169 | 169 | */ |
170 | 170 | function removeCustomLayouts() |
171 | 171 | { |
172 | - $module = StudioModuleFactory::getStudioModule( $this->module ) ; |
|
172 | + $module = StudioModuleFactory::getStudioModule($this->module); |
|
173 | 173 | $sources = $module->getViewMetadataSources(); |
174 | 174 | |
175 | 175 | $out = ""; |
176 | - foreach($sources as $view) |
|
176 | + foreach ($sources as $view) |
|
177 | 177 | { |
178 | 178 | $file = DeployedMetaDataImplementation::getFileName($view['type'], $this->module); |
179 | 179 | if (file_exists($file)) { |
@@ -183,8 +183,8 @@ discard block |
||
183 | 183 | } |
184 | 184 | |
185 | 185 | // now clear the cache |
186 | - include_once ('include/TemplateHandler/TemplateHandler.php') ; |
|
187 | - TemplateHandler::clearCache ( $this->module ) ; |
|
186 | + include_once ('include/TemplateHandler/TemplateHandler.php'); |
|
187 | + TemplateHandler::clearCache($this->module); |
|
188 | 188 | |
189 | 189 | return $out; |
190 | 190 | } |
@@ -196,21 +196,21 @@ discard block |
||
196 | 196 | */ |
197 | 197 | function removeCustomRelationships() |
198 | 198 | { |
199 | - require_once 'modules/ModuleBuilder/parsers/relationships/DeployedRelationships.php' ; |
|
199 | + require_once 'modules/ModuleBuilder/parsers/relationships/DeployedRelationships.php'; |
|
200 | 200 | $out = ""; |
201 | 201 | $madeChanges = false; |
202 | - $relationships = new DeployedRelationships ( $this->module ) ; |
|
202 | + $relationships = new DeployedRelationships($this->module); |
|
203 | 203 | |
204 | - foreach ( $relationships->getRelationshipList () as $relationshipName ) |
|
204 | + foreach ($relationships->getRelationshipList() as $relationshipName) |
|
205 | 205 | { |
206 | - $rel = $relationships->get ( $relationshipName )->getDefinition () ; |
|
207 | - if ($rel [ 'is_custom' ] || (isset($rel [ 'from_studio' ]) && $rel [ 'from_studio' ])) { |
|
208 | - $relationships->delete ($relationshipName); |
|
206 | + $rel = $relationships->get($relationshipName)->getDefinition(); |
|
207 | + if ($rel ['is_custom'] || (isset($rel ['from_studio']) && $rel ['from_studio'])) { |
|
208 | + $relationships->delete($relationshipName); |
|
209 | 209 | $out .= "Removed relationship $relationshipName<br/>"; |
210 | 210 | } |
211 | 211 | } |
212 | 212 | if ($madeChanges) |
213 | - $relationships->save () ; |
|
213 | + $relationships->save(); |
|
214 | 214 | |
215 | 215 | return $out; |
216 | 216 | } |
@@ -222,11 +222,11 @@ discard block |
||
222 | 222 | if (is_dir($languageDir)) { |
223 | 223 | $files = scandir($languageDir); |
224 | 224 | foreach ($files as $langFile) { |
225 | - if (substr($langFile, 0 ,1) == '.') continue; |
|
225 | + if (substr($langFile, 0, 1) == '.') continue; |
|
226 | 226 | $language = substr($langFile, 0, strlen($langFile) - 9); |
227 | - unlink($languageDir . "/" . $langFile); |
|
227 | + unlink($languageDir."/".$langFile); |
|
228 | 228 | |
229 | - LanguageManager::clearLanguageCache ( $this->module, $language ) ; |
|
229 | + LanguageManager::clearLanguageCache($this->module, $language); |
|
230 | 230 | $out .= "Removed language file $langFile<br/>"; |
231 | 231 | } |
232 | 232 | } |
@@ -240,9 +240,9 @@ discard block |
||
240 | 240 | $extDir = "custom/Extension/modules/{$this->module}"; |
241 | 241 | if (is_dir($extDir)) { |
242 | 242 | rmdir_recursive($extDir); |
243 | - require_once ('modules/Administration/QuickRepairAndRebuild.php') ; |
|
244 | - $rac = new RepairAndClear ( ) ; |
|
245 | - $rac->repairAndClearAll ( array ( 'clearAll' ), array ( $this->module ), true, false ) ; |
|
243 | + require_once ('modules/Administration/QuickRepairAndRebuild.php'); |
|
244 | + $rac = new RepairAndClear( ); |
|
245 | + $rac->repairAndClearAll(array('clearAll'), array($this->module), true, false); |
|
246 | 246 | $rac->rebuildExtensions(); |
247 | 247 | $out .= "Cleared extensions for {$this->module}<br/>"; |
248 | 248 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | global $mod_strings; |
50 | 50 | |
51 | 51 | return array( |
52 | - translate('LBL_MODULE_NAME','Administration'), |
|
52 | + translate('LBL_MODULE_NAME', 'Administration'), |
|
53 | 53 | ModuleBuilderController::getModuleTitle(), |
54 | 54 | ); |
55 | 55 | } |
@@ -70,25 +70,25 @@ discard block |
||
70 | 70 | |
71 | 71 | $ajax = new AjaxCompose(); |
72 | 72 | $ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package")'); |
73 | - $ajax->addCrumb($GLOBALS['mod_strings']['LBL_PACKAGE_LIST'],''); |
|
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 | 76 | } |
77 | 77 | else { |
78 | 78 | |
79 | - $name = (!empty($_REQUEST['package']))?$_REQUEST['package']:''; |
|
79 | + $name = (!empty($_REQUEST['package'])) ? $_REQUEST['package'] : ''; |
|
80 | 80 | $mb->getPackage($name); |
81 | 81 | |
82 | - require_once ('modules/ModuleBuilder/MB/MBPackageTree.php') ; |
|
82 | + require_once ('modules/ModuleBuilder/MB/MBPackageTree.php'); |
|
83 | 83 | $mbt = new MBPackageTree(); |
84 | 84 | $nodes = $mbt->fetchNodes(); |
85 | 85 | |
86 | 86 | $package_labels = array(); |
87 | - if(!empty($nodes['tree_data']['nodes'])) |
|
87 | + if (!empty($nodes['tree_data']['nodes'])) |
|
88 | 88 | { |
89 | - foreach($nodes['tree_data']['nodes'] as $entry) |
|
89 | + foreach ($nodes['tree_data']['nodes'] as $entry) |
|
90 | 90 | { |
91 | - if(!empty($entry['data']['label']) && $name != $entry['data']['label']) |
|
91 | + if (!empty($entry['data']['label']) && $name != $entry['data']['label']) |
|
92 | 92 | { |
93 | 93 | $package_labels[] = strtoupper($entry['data']['label']); |
94 | 94 | } |
@@ -98,15 +98,15 @@ discard block |
||
98 | 98 | $json = getJSONobj(); |
99 | 99 | $smarty->assign('package_labels', $json->encode($package_labels)); |
100 | 100 | |
101 | - $this->package =& $mb->packages[$name]; |
|
101 | + $this->package = & $mb->packages[$name]; |
|
102 | 102 | $this->loadModuleTypes(); |
103 | 103 | $this->loadPackageHelp($name); |
104 | 104 | $this->package->date_modified = $GLOBALS['timedate']->to_display_date_time($this->package->date_modified); |
105 | 105 | $smarty->assign('package', $this->package); |
106 | - $smarty->assign('mod_strings',$mod_strings); |
|
106 | + $smarty->assign('mod_strings', $mod_strings); |
|
107 | 107 | $smarty->assign('package_already_deployed', 'false'); |
108 | - foreach($this->package->modules as $a_module){ |
|
109 | - if(in_array($a_module->key_name, $GLOBALS['moduleList'])){ |
|
108 | + foreach ($this->package->modules as $a_module) { |
|
109 | + if (in_array($a_module->key_name, $GLOBALS['moduleList'])) { |
|
110 | 110 | $smarty->assign('package_already_deployed', 'true'); |
111 | 111 | break; |
112 | 112 | } |
@@ -114,11 +114,11 @@ discard block |
||
114 | 114 | |
115 | 115 | $ajax = new AjaxCompose(); |
116 | 116 | $ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package")'); |
117 | - if(empty($name))$name = $mod_strings['LBL_NEW_PACKAGE']; |
|
118 | - $ajax->addCrumb($name,''); |
|
119 | - $html=$smarty->fetch('modules/ModuleBuilder/tpls/MBPackage/package.tpl'); |
|
120 | - if(!empty($_REQUEST['action']) && $_REQUEST['action']=='SavePackage') |
|
121 | - $html.="<script>ModuleBuilder.treeRefresh('ModuleBuilder')</script>"; |
|
117 | + if (empty($name))$name = $mod_strings['LBL_NEW_PACKAGE']; |
|
118 | + $ajax->addCrumb($name, ''); |
|
119 | + $html = $smarty->fetch('modules/ModuleBuilder/tpls/MBPackage/package.tpl'); |
|
120 | + if (!empty($_REQUEST['action']) && $_REQUEST['action'] == 'SavePackage') |
|
121 | + $html .= "<script>ModuleBuilder.treeRefresh('ModuleBuilder')</script>"; |
|
122 | 122 | $ajax->addSection('center', translate('LBL_SECTION_PACKAGE', 'ModuleBuilder'), $html); |
123 | 123 | echo $ajax->getJavascript(); |
124 | 124 | } |
@@ -128,8 +128,8 @@ discard block |
||
128 | 128 | { |
129 | 129 | $this->package->moduleTypes = array(); |
130 | 130 | $this->package->loadModules(); |
131 | - foreach(array_keys($this->package->modules) as $name){ |
|
132 | - foreach($this->package->modules[$name]->config['templates'] as $template=>$var){ |
|
131 | + foreach (array_keys($this->package->modules) as $name) { |
|
132 | + foreach ($this->package->modules[$name]->config['templates'] as $template=>$var) { |
|
133 | 133 | |
134 | 134 | $this->package->moduleTypes[$name] = $template; |
135 | 135 | |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | $name |
141 | 141 | ) |
142 | 142 | { |
143 | - $this->package->help['default'] = (empty($name))?'create':'modify'; |
|
143 | + $this->package->help['default'] = (empty($name)) ? 'create' : 'modify'; |
|
144 | 144 | $this->package->help['group'] = 'package'; |
145 | 145 | } |
146 | 146 | |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | 'help' => 'newPackage', |
157 | 157 | 'linkId' => 'newPackageLink' |
158 | 158 | ); |
159 | - foreach($packages as $package) { |
|
159 | + foreach ($packages as $package) { |
|
160 | 160 | $this->buttons[$package] = array( |
161 | 161 | 'action' =>"module=ModuleBuilder&action=package&package={$package}", |
162 | 162 | 'imageTitle' => 'package', |
@@ -37,27 +37,27 @@ discard block |
||
37 | 37 | * display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM". |
38 | 38 | ********************************************************************************/ |
39 | 39 | |
40 | -require_once ('modules/ModuleBuilder/MB/AjaxCompose.php') ; |
|
41 | -require_once ('modules/ModuleBuilder/Module/StudioModuleFactory.php') ; |
|
42 | -require_once ('include/MVC/View/SugarView.php') ; |
|
40 | +require_once ('modules/ModuleBuilder/MB/AjaxCompose.php'); |
|
41 | +require_once ('modules/ModuleBuilder/Module/StudioModuleFactory.php'); |
|
42 | +require_once ('include/MVC/View/SugarView.php'); |
|
43 | 43 | |
44 | 44 | class ModuleBuilderViewWizard extends SugarView |
45 | 45 | { |
46 | - private $view = null ; // the wizard view to display |
|
47 | - private $actions ; |
|
48 | - private $buttons ; |
|
49 | - private $question ; |
|
50 | - private $title ; |
|
51 | - private $help ; |
|
46 | + private $view = null; // the wizard view to display |
|
47 | + private $actions; |
|
48 | + private $buttons; |
|
49 | + private $question; |
|
50 | + private $title; |
|
51 | + private $help; |
|
52 | 52 | |
53 | - private $editModule ; |
|
53 | + private $editModule; |
|
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 | - $this->editModule = (! empty ( $_REQUEST [ 'view_module' ] ) ) ? $_REQUEST [ 'view_module' ] : null ; |
|
60 | + $this->editModule = (!empty ($_REQUEST ['view_module'])) ? $_REQUEST ['view_module'] : null; |
|
61 | 61 | $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 |
62 | 62 | } |
63 | 63 | |
@@ -69,35 +69,35 @@ discard block |
||
69 | 69 | global $mod_strings; |
70 | 70 | |
71 | 71 | return array( |
72 | - translate('LBL_MODULE_NAME','Administration'), |
|
72 | + translate('LBL_MODULE_NAME', 'Administration'), |
|
73 | 73 | ModuleBuilderController::getModuleTitle(), |
74 | 74 | ); |
75 | 75 | } |
76 | 76 | |
77 | 77 | function display() |
78 | 78 | { |
79 | - $this->ajax = new AjaxCompose ( ) ; |
|
80 | - $smarty = new Sugar_Smarty ( ) ; |
|
79 | + $this->ajax = new AjaxCompose( ); |
|
80 | + $smarty = new Sugar_Smarty( ); |
|
81 | 81 | |
82 | - if (isset ( $_REQUEST [ 'MB' ] )) |
|
82 | + if (isset ($_REQUEST ['MB'])) |
|
83 | 83 | { |
84 | - $this->processMB ( $this->ajax ) ; |
|
84 | + $this->processMB($this->ajax); |
|
85 | 85 | } else |
86 | 86 | { |
87 | 87 | |
88 | - $this->processStudio ( $this->ajax ) ; |
|
88 | + $this->processStudio($this->ajax); |
|
89 | 89 | |
90 | 90 | } |
91 | 91 | |
92 | - $smarty->assign ( 'buttons', $this->buttons ) ; |
|
93 | - $smarty->assign ( 'image_path', $GLOBALS [ 'image_path' ] ) ; |
|
94 | - $smarty->assign ( "title", $this->title ) ; |
|
95 | - $smarty->assign ( "question", $this->question ) ; |
|
96 | - $smarty->assign ( "defaultHelp", $this->help ) ; |
|
97 | - $smarty->assign ( "actions", $this->actions ) ; |
|
92 | + $smarty->assign('buttons', $this->buttons); |
|
93 | + $smarty->assign('image_path', $GLOBALS ['image_path']); |
|
94 | + $smarty->assign("title", $this->title); |
|
95 | + $smarty->assign("question", $this->question); |
|
96 | + $smarty->assign("defaultHelp", $this->help); |
|
97 | + $smarty->assign("actions", $this->actions); |
|
98 | 98 | |
99 | - $this->ajax->addSection ( 'center', $this->title, $smarty->fetch ( 'modules/ModuleBuilder/tpls/wizard.tpl' ) ) ; |
|
100 | - echo $this->ajax->getJavascript () ; |
|
99 | + $this->ajax->addSection('center', $this->title, $smarty->fetch('modules/ModuleBuilder/tpls/wizard.tpl')); |
|
100 | + echo $this->ajax->getJavascript(); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | function processStudio( |
@@ -105,161 +105,161 @@ discard block |
||
105 | 105 | ) |
106 | 106 | { |
107 | 107 | |
108 | - $this->ajax->addCrumb ( translate( 'LBL_STUDIO' ), 'ModuleBuilder.main("studio")' ) ; |
|
108 | + $this->ajax->addCrumb(translate('LBL_STUDIO'), 'ModuleBuilder.main("studio")'); |
|
109 | 109 | |
110 | - if (! isset ( $this->editModule )) |
|
110 | + if (!isset ($this->editModule)) |
|
111 | 111 | { |
112 | 112 | //Studio Select Module Page |
113 | - $this->generateStudioModuleButtons () ; |
|
114 | - $this->question = translate('LBL_QUESTION_EDIT') ; |
|
115 | - $this->title = translate( 'LBL_STUDIO' ); |
|
113 | + $this->generateStudioModuleButtons(); |
|
114 | + $this->question = translate('LBL_QUESTION_EDIT'); |
|
115 | + $this->title = translate('LBL_STUDIO'); |
|
116 | 116 | global $current_user; |
117 | 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 | + $this->actions = "<input class=\"button\" type=\"button\" id=\"exportBtn\" name=\"exportBtn\" onclick=\"ModuleBuilder.getContent('module=ModuleBuilder&action=exportcustomizations');\" value=\"".translate('LBL_BTN_EXPORT').'">'; |
|
119 | 119 | |
120 | - $this->help = 'studioHelp' ; |
|
120 | + $this->help = 'studioHelp'; |
|
121 | 121 | } else |
122 | 122 | { |
123 | - $module = StudioModuleFactory::getStudioModule( $this->editModule ) ; |
|
124 | - $this->ajax->addCrumb ( $module->name, !empty($this->view) ? 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module=' . $this->editModule . '")' : '' ) ; |
|
125 | - switch ( $this->view ) |
|
123 | + $module = StudioModuleFactory::getStudioModule($this->editModule); |
|
124 | + $this->ajax->addCrumb($module->name, !empty($this->view) ? 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module='.$this->editModule.'")' : ''); |
|
125 | + switch ($this->view) |
|
126 | 126 | { |
127 | 127 | case 'layouts': |
128 | 128 | //Studio Select Layout page |
129 | - $this->buttons = $module->getLayouts() ; |
|
130 | - $this->title = $module->name . " " . translate('LBL_LAYOUTS') ; |
|
131 | - $this->question = translate( 'LBL_QUESTION_LAYOUT' ) ; |
|
132 | - $this->help = 'layoutsHelp' ; |
|
133 | - $this->ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), '' ) ; |
|
129 | + $this->buttons = $module->getLayouts(); |
|
130 | + $this->title = $module->name." ".translate('LBL_LAYOUTS'); |
|
131 | + $this->question = translate('LBL_QUESTION_LAYOUT'); |
|
132 | + $this->help = 'layoutsHelp'; |
|
133 | + $this->ajax->addCrumb(translate('LBL_LAYOUTS'), ''); |
|
134 | 134 | break; |
135 | 135 | |
136 | 136 | |
137 | 137 | case 'subpanels': |
138 | 138 | //Studio Select Subpanel page. |
139 | - $this->buttons = $module->getSubpanels() ; |
|
140 | - $this->title = $module->name . " " . translate( 'LBL_SUBPANELS' ) ; |
|
141 | - $this->question = translate( 'LBL_QUESTION_SUBPANEL' ) ; |
|
142 | - $this->ajax->addCrumb ( translate( 'LBL_SUBPANELS' ), '' ) ; |
|
143 | - $this->help = 'subpanelHelp' ; |
|
139 | + $this->buttons = $module->getSubpanels(); |
|
140 | + $this->title = $module->name." ".translate('LBL_SUBPANELS'); |
|
141 | + $this->question = translate('LBL_QUESTION_SUBPANEL'); |
|
142 | + $this->ajax->addCrumb(translate('LBL_SUBPANELS'), ''); |
|
143 | + $this->help = 'subpanelHelp'; |
|
144 | 144 | break; |
145 | 145 | |
146 | 146 | case 'search': |
147 | 147 | //Studio Select Search Layout page. |
148 | - $this->buttons = $module->getSearch() ; |
|
149 | - $this->title = $module->name . " " . translate('LBL_SEARCH'); |
|
150 | - $this->question = translate( 'LBL_QUESTION_SEARCH' ) ; |
|
151 | - $this->ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=layouts&view_module=' . $this->editModule . '")' ) ; |
|
152 | - $this->ajax->addCrumb ( translate( 'LBL_SEARCH' ), '' ) ; |
|
153 | - $this->help = 'searchHelp' ; |
|
148 | + $this->buttons = $module->getSearch(); |
|
149 | + $this->title = $module->name." ".translate('LBL_SEARCH'); |
|
150 | + $this->question = translate('LBL_QUESTION_SEARCH'); |
|
151 | + $this->ajax->addCrumb(translate('LBL_LAYOUTS'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=layouts&view_module='.$this->editModule.'")'); |
|
152 | + $this->ajax->addCrumb(translate('LBL_SEARCH'), ''); |
|
153 | + $this->help = 'searchHelp'; |
|
154 | 154 | break; |
155 | 155 | |
156 | 156 | case 'dashlet': |
157 | 157 | $this->generateStudioDashletButtons(); |
158 | - $this->title = $this->editModule ." " .translate('LBL_DASHLET'); |
|
159 | - $this->question = translate( 'LBL_QUESTION_DASHLET' ) ; |
|
160 | - $this->ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=layouts&view_module=' . $this->editModule . '")' ) ; |
|
161 | - $this->ajax->addCrumb ( translate( 'LBL_DASHLET' ), '' ) ; |
|
162 | - $this->help = 'dashletHelp' ; |
|
158 | + $this->title = $this->editModule." ".translate('LBL_DASHLET'); |
|
159 | + $this->question = translate('LBL_QUESTION_DASHLET'); |
|
160 | + $this->ajax->addCrumb(translate('LBL_LAYOUTS'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=layouts&view_module='.$this->editModule.'")'); |
|
161 | + $this->ajax->addCrumb(translate('LBL_DASHLET'), ''); |
|
162 | + $this->help = 'dashletHelp'; |
|
163 | 163 | break; |
164 | 164 | |
165 | 165 | case 'popup': |
166 | 166 | $this->generateStudioPopupButtons(); |
167 | - $this->title = $this->editModule ." " .translate('LBL_POPUP'); |
|
168 | - $this->question = translate( 'LBL_QUESTION_POPUP' ) ; |
|
169 | - $this->ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=layouts&view_module=' . $this->editModule . '")' ) ; |
|
170 | - $this->ajax->addCrumb ( translate( 'LBL_POPUP' ), '' ) ; |
|
171 | - $this->help = 'popupHelp' ; |
|
167 | + $this->title = $this->editModule." ".translate('LBL_POPUP'); |
|
168 | + $this->question = translate('LBL_QUESTION_POPUP'); |
|
169 | + $this->ajax->addCrumb(translate('LBL_LAYOUTS'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=layouts&view_module='.$this->editModule.'")'); |
|
170 | + $this->ajax->addCrumb(translate('LBL_POPUP'), ''); |
|
171 | + $this->help = 'popupHelp'; |
|
172 | 172 | break; |
173 | 173 | default: |
174 | 174 | //Studio Edit Module Page |
175 | - $this->buttons = $module->getModule () ; |
|
176 | - $this->question = translate( 'LBL_QUESTION_MODULE' ) ; |
|
177 | - $this->title = translate( 'LBL_EDIT' ) . " " . $module->name ; |
|
178 | - $this->help = 'moduleHelp' ; |
|
175 | + $this->buttons = $module->getModule(); |
|
176 | + $this->question = translate('LBL_QUESTION_MODULE'); |
|
177 | + $this->title = translate('LBL_EDIT')." ".$module->name; |
|
178 | + $this->help = 'moduleHelp'; |
|
179 | 179 | global $current_user; |
180 | 180 | if (is_admin($current_user)) |
181 | 181 | $this->actions = "<input class=\"button\" type=\"button\" id=\"exportBtn\" name=\"exportBtn\" " |
182 | 182 | . "onclick=\"ModuleBuilder.getContent('module=ModuleBuilder&action=resetmodule&view_module=$this->editModule');\" value=\"" |
183 | - . translate( 'LBL_RESET_MODULE' ) . '">' ; |
|
183 | + . translate('LBL_RESET_MODULE').'">'; |
|
184 | 184 | } |
185 | 185 | } |
186 | 186 | } |
187 | 187 | |
188 | - function processMB ( |
|
188 | + function processMB( |
|
189 | 189 | $ajax |
190 | 190 | ) |
191 | 191 | { |
192 | - if (! isset ( $_REQUEST [ 'view_package' ] )) |
|
192 | + if (!isset ($_REQUEST ['view_package'])) |
|
193 | 193 | { |
194 | - sugar_die ( "no ModuleBuilder package set" ) ; |
|
194 | + sugar_die("no ModuleBuilder package set"); |
|
195 | 195 | } |
196 | 196 | |
197 | - $this->editModule = $_REQUEST [ 'view_module' ] ; |
|
198 | - $this->package = $_REQUEST [ 'view_package' ] ; |
|
197 | + $this->editModule = $_REQUEST ['view_module']; |
|
198 | + $this->package = $_REQUEST ['view_package']; |
|
199 | 199 | |
200 | - $ajax->addCrumb ( translate ( 'LBL_MODULEBUILDER', 'ModuleBuilder' ), 'ModuleBuilder.main("mb")' ) ; |
|
201 | - $ajax->addCrumb ( $this->package, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&view_package=' . $this->package . '")' ) ; |
|
202 | - $ajax->addCrumb ( $this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_module=' . $this->editModule . '&view_package=' . $this->package . '")') ; |
|
200 | + $ajax->addCrumb(translate('LBL_MODULEBUILDER', 'ModuleBuilder'), 'ModuleBuilder.main("mb")'); |
|
201 | + $ajax->addCrumb($this->package, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&view_package='.$this->package.'")'); |
|
202 | + $ajax->addCrumb($this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_module='.$this->editModule.'&view_package='.$this->package.'")'); |
|
203 | 203 | |
204 | - switch ( $this->view ) |
|
204 | + switch ($this->view) |
|
205 | 205 | { |
206 | 206 | case 'search': |
207 | 207 | //MB Select Search Layout page. |
208 | - $this->generateMBSearchButtons () ; |
|
209 | - $this->title = $this->editModule . " " . translate( 'LBL_SEARCH' ) ; |
|
210 | - $this->question = translate( 'LBL_QUESTION_SEARCH' ) ; |
|
211 | - $ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), 'ModuleBuilder.getContent("module=ModuleBuilder&MB=true&action=wizard&view_module=' . $this->editModule . '&view_package=' . $this->package . '")' ) ; |
|
212 | - $ajax->addCrumb ( translate( 'LBL_SEARCH_FORMS' ), '' ) ; |
|
213 | - $this->help = "searchHelp" ; |
|
208 | + $this->generateMBSearchButtons(); |
|
209 | + $this->title = $this->editModule." ".translate('LBL_SEARCH'); |
|
210 | + $this->question = translate('LBL_QUESTION_SEARCH'); |
|
211 | + $ajax->addCrumb(translate('LBL_LAYOUTS'), 'ModuleBuilder.getContent("module=ModuleBuilder&MB=true&action=wizard&view_module='.$this->editModule.'&view_package='.$this->package.'")'); |
|
212 | + $ajax->addCrumb(translate('LBL_SEARCH_FORMS'), ''); |
|
213 | + $this->help = "searchHelp"; |
|
214 | 214 | break; |
215 | 215 | |
216 | 216 | case 'subpanel': |
217 | 217 | //ModuleBuilder Select Subpanel |
218 | - $ajax->addCrumb ( $this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_module=' . $this->editModule . '&view_package=' . $this->package . '")' ) ; |
|
219 | - $ajax->addCrumb ( translate( 'LBL_SUBPANELS' ), '' ) ; |
|
220 | - $this->question = translate( 'LBL_QUESTION_SUBPANEL' ) ; |
|
221 | - $this->help = 'subpanelHelp' ; |
|
218 | + $ajax->addCrumb($this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_module='.$this->editModule.'&view_package='.$this->package.'")'); |
|
219 | + $ajax->addCrumb(translate('LBL_SUBPANELS'), ''); |
|
220 | + $this->question = translate('LBL_QUESTION_SUBPANEL'); |
|
221 | + $this->help = 'subpanelHelp'; |
|
222 | 222 | break; |
223 | 223 | |
224 | 224 | case 'dashlet': |
225 | - $this->generateMBDashletButtons (); |
|
226 | - $this->title = $this->editModule ." " .translate('LBL_DASHLET'); |
|
227 | - $this->question = translate( 'LBL_QUESTION_DASHLET' ) ; |
|
228 | - $this->ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=layouts&MB=1&view_package='.$this->package.'&view_module=' . $this->editModule . '")' ) ; |
|
229 | - $this->ajax->addCrumb ( translate( 'LBL_DASHLET' ), '' ) ; |
|
230 | - $this->help = 'dashletHelp' ; |
|
225 | + $this->generateMBDashletButtons(); |
|
226 | + $this->title = $this->editModule." ".translate('LBL_DASHLET'); |
|
227 | + $this->question = translate('LBL_QUESTION_DASHLET'); |
|
228 | + $this->ajax->addCrumb(translate('LBL_LAYOUTS'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=layouts&MB=1&view_package='.$this->package.'&view_module='.$this->editModule.'")'); |
|
229 | + $this->ajax->addCrumb(translate('LBL_DASHLET'), ''); |
|
230 | + $this->help = 'dashletHelp'; |
|
231 | 231 | break; |
232 | 232 | |
233 | 233 | |
234 | 234 | case 'popup': |
235 | 235 | $this->generateMBPopupButtons(); |
236 | - $this->title = $this->editModule ." " .translate('LBL_POPUP'); |
|
237 | - $this->question = translate( 'LBL_QUESTION_POPUP' ) ; |
|
238 | - $this->ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), 'ModuleBuilder.getContent("module=ModuleBuilder&MB=true&action=wizard&view=layouts&MB=1&view_package='.$this->package.'&view_module=' . $this->editModule . '")' ) ; |
|
239 | - $this->ajax->addCrumb ( translate( 'LBL_POPUP' ), '' ) ; |
|
240 | - $this->help = 'popupHelp' ; |
|
236 | + $this->title = $this->editModule." ".translate('LBL_POPUP'); |
|
237 | + $this->question = translate('LBL_QUESTION_POPUP'); |
|
238 | + $this->ajax->addCrumb(translate('LBL_LAYOUTS'), 'ModuleBuilder.getContent("module=ModuleBuilder&MB=true&action=wizard&view=layouts&MB=1&view_package='.$this->package.'&view_module='.$this->editModule.'")'); |
|
239 | + $this->ajax->addCrumb(translate('LBL_POPUP'), ''); |
|
240 | + $this->help = 'popupHelp'; |
|
241 | 241 | break; |
242 | 242 | default: |
243 | - $ajax->addCrumb ( translate( 'LBL_LAYOUTS' ), '' ) ; |
|
244 | - $this->generateMBViewButtons () ; |
|
245 | - $this->title = $this->editModule . " " . translate( 'LBL_LAYOUTS' ) ; |
|
246 | - $this->question = translate( 'LBL_QUESTION_LAYOUT' ) ; |
|
247 | - $this->help = "layoutsHelp" ; |
|
243 | + $ajax->addCrumb(translate('LBL_LAYOUTS'), ''); |
|
244 | + $this->generateMBViewButtons(); |
|
245 | + $this->title = $this->editModule." ".translate('LBL_LAYOUTS'); |
|
246 | + $this->question = translate('LBL_QUESTION_LAYOUT'); |
|
247 | + $this->help = "layoutsHelp"; |
|
248 | 248 | } |
249 | 249 | } |
250 | 250 | |
251 | 251 | |
252 | 252 | function generateStudioModuleButtons() |
253 | 253 | { |
254 | - require_once ('modules/ModuleBuilder/Module/StudioBrowser.php') ; |
|
255 | - $sb = new StudioBrowser ( ) ; |
|
256 | - $sb->loadModules () ; |
|
257 | - $nodes = $sb->getNodes () ; |
|
258 | - $this->buttons = array ( ) ; |
|
254 | + require_once ('modules/ModuleBuilder/Module/StudioBrowser.php'); |
|
255 | + $sb = new StudioBrowser( ); |
|
256 | + $sb->loadModules(); |
|
257 | + $nodes = $sb->getNodes(); |
|
258 | + $this->buttons = array( ); |
|
259 | 259 | //$GLOBALS['log']->debug(print_r($nodes,true)); |
260 | - foreach ( $nodes as $module ) |
|
260 | + foreach ($nodes as $module) |
|
261 | 261 | { |
262 | - $this->buttons [ $module [ 'name' ] ] = array ( 'action' => $module [ 'action' ] , 'imageTitle' => ucfirst ( $module [ 'module' ] . "_32" ) , 'size' => '32', 'linkId' => 'studiolink_'.$module [ 'module' ] ) ; |
|
262 | + $this->buttons [$module ['name']] = array('action' => $module ['action'], 'imageTitle' => ucfirst($module ['module']."_32"), 'size' => '32', 'linkId' => 'studiolink_'.$module ['module']); |
|
263 | 263 | } |
264 | 264 | } |
265 | 265 | |
@@ -267,44 +267,44 @@ discard block |
||
267 | 267 | |
268 | 268 | function generateMBViewButtons() |
269 | 269 | { |
270 | - $this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_EDITVIEW' ] ] = |
|
271 | - array ( |
|
272 | - 'action' => "module=ModuleBuilder&MB=true&action=editLayout&view=".MB_EDITVIEW."&view_module={$this->editModule}&view_package={$this->package}" , |
|
270 | + $this->buttons [$GLOBALS ['mod_strings'] ['LBL_EDITVIEW']] = |
|
271 | + array( |
|
272 | + 'action' => "module=ModuleBuilder&MB=true&action=editLayout&view=".MB_EDITVIEW."&view_module={$this->editModule}&view_package={$this->package}", |
|
273 | 273 | 'imageTitle' => 'EditView', |
274 | 274 | 'help'=>'viewBtnEditView' |
275 | - ) ; |
|
276 | - $this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_DETAILVIEW' ] ] = |
|
277 | - array ( |
|
278 | - 'action' => "module=ModuleBuilder&MB=true&action=editLayout&view=".MB_DETAILVIEW."&view_module={$this->editModule}&view_package={$this->package}" , |
|
275 | + ); |
|
276 | + $this->buttons [$GLOBALS ['mod_strings'] ['LBL_DETAILVIEW']] = |
|
277 | + array( |
|
278 | + 'action' => "module=ModuleBuilder&MB=true&action=editLayout&view=".MB_DETAILVIEW."&view_module={$this->editModule}&view_package={$this->package}", |
|
279 | 279 | 'imageTitle' => 'DetailView', |
280 | 280 | 'help'=>'viewBtnListView' |
281 | - ) ; |
|
282 | - $this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_LISTVIEW' ] ] = |
|
283 | - array ( |
|
284 | - 'action' => "module=ModuleBuilder&MB=true&action=editLayout&view=".MB_LISTVIEW."&view_module={$this->editModule}&view_package={$this->package}" , |
|
281 | + ); |
|
282 | + $this->buttons [$GLOBALS ['mod_strings'] ['LBL_LISTVIEW']] = |
|
283 | + array( |
|
284 | + 'action' => "module=ModuleBuilder&MB=true&action=editLayout&view=".MB_LISTVIEW."&view_module={$this->editModule}&view_package={$this->package}", |
|
285 | 285 | 'imageTitle' => 'ListView', |
286 | 286 | 'help'=>'viewBtnListView' |
287 | - ) ; |
|
288 | - $this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_QUICKCREATE' ] ] = |
|
289 | - array ( |
|
290 | - 'action' => "module=ModuleBuilder&MB=true&action=editLayout&view=".MB_QUICKCREATE."&view_module={$this->editModule}&view_package={$this->package}" , |
|
287 | + ); |
|
288 | + $this->buttons [$GLOBALS ['mod_strings'] ['LBL_QUICKCREATE']] = |
|
289 | + array( |
|
290 | + 'action' => "module=ModuleBuilder&MB=true&action=editLayout&view=".MB_QUICKCREATE."&view_module={$this->editModule}&view_package={$this->package}", |
|
291 | 291 | 'imageTitle' => 'QuickCreate', |
292 | 292 | 'help'=>'viewBtnQuickCreate' |
293 | - ) ; |
|
294 | - $this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_SEARCH' ] ] = |
|
295 | - array ( |
|
296 | - 'action' => "module=ModuleBuilder&MB=true&action=wizard&view=search&view_module={$this->editModule}&view_package={$this->package}" , |
|
297 | - 'imageTitle' => 'SearchForm' , |
|
293 | + ); |
|
294 | + $this->buttons [$GLOBALS ['mod_strings'] ['LBL_SEARCH']] = |
|
295 | + array( |
|
296 | + 'action' => "module=ModuleBuilder&MB=true&action=wizard&view=search&view_module={$this->editModule}&view_package={$this->package}", |
|
297 | + 'imageTitle' => 'SearchForm', |
|
298 | 298 | 'help'=> 'searchBtn' |
299 | - ) ; |
|
300 | - $this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_DASHLET' ] ] = |
|
301 | - array ( |
|
302 | - 'action' => "module=ModuleBuilder&MB=true&action=wizard&view=dashlet&view_module={$this->editModule}&view_package={$this->package}" , |
|
299 | + ); |
|
300 | + $this->buttons [$GLOBALS ['mod_strings'] ['LBL_DASHLET']] = |
|
301 | + array( |
|
302 | + 'action' => "module=ModuleBuilder&MB=true&action=wizard&view=dashlet&view_module={$this->editModule}&view_package={$this->package}", |
|
303 | 303 | 'imageTitle' => 'Dashlet', |
304 | 304 | 'help'=>'viewBtnDashlet' |
305 | - ) ; |
|
306 | - $this->buttons [ $GLOBALS [ 'mod_strings' ] ['LBL_POPUP'] ] = |
|
307 | - array ( |
|
305 | + ); |
|
306 | + $this->buttons [$GLOBALS ['mod_strings'] ['LBL_POPUP']] = |
|
307 | + array( |
|
308 | 308 | 'imageTitle' => 'Popup', |
309 | 309 | 'action' => "module=ModuleBuilder&MB=true&action=wizard&view=popup&view_module={$this->editModule}&view_package={$this->package}", |
310 | 310 | 'help'=>'PopupListViewBtn' |
@@ -313,31 +313,31 @@ discard block |
||
313 | 313 | |
314 | 314 | function generateMBDashletButtons() |
315 | 315 | { |
316 | - $this->buttons [ $GLOBALS [ 'mod_strings' ][ 'LBL_DASHLETLISTVIEW' ] ] = array('action'=> "module=ModuleBuilder&MB=true&action=editLayout&view=dashlet&view_module={$this->editModule}&view_package={$this->package}", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_DASHLETLISTVIEW'], 'imageName'=>'ListView', 'help'=>'DashletListViewBtn'); |
|
317 | - $this->buttons [ $GLOBALS [ 'mod_strings' ][ 'LBL_DASHLETSEARCHVIEW' ] ] = array('action'=> "module=ModuleBuilder&MB=true&action=editLayout&view=dashletsearch&view_module={$this->editModule}&view_package={$this->package}", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_DASHLETSEARCHVIEW'], 'imageName'=>'BasicSearch','help'=> 'DashletSearchViewBtn'); |
|
316 | + $this->buttons [$GLOBALS ['mod_strings']['LBL_DASHLETLISTVIEW']] = array('action'=> "module=ModuleBuilder&MB=true&action=editLayout&view=dashlet&view_module={$this->editModule}&view_package={$this->package}", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_DASHLETLISTVIEW'], 'imageName'=>'ListView', 'help'=>'DashletListViewBtn'); |
|
317 | + $this->buttons [$GLOBALS ['mod_strings']['LBL_DASHLETSEARCHVIEW']] = array('action'=> "module=ModuleBuilder&MB=true&action=editLayout&view=dashletsearch&view_module={$this->editModule}&view_package={$this->package}", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_DASHLETSEARCHVIEW'], 'imageName'=>'BasicSearch', 'help'=> 'DashletSearchViewBtn'); |
|
318 | 318 | } |
319 | 319 | |
320 | 320 | function generateMBPopupButtons() |
321 | 321 | { |
322 | - $this->buttons [ $GLOBALS [ 'mod_strings' ][ 'LBL_POPUPLISTVIEW' ] ] = array('action'=> "module=ModuleBuilder&action=editLayout&view=popuplist&view_module={$this->editModule}&view_package={$this->package}", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_POPUPLISTVIEW'], 'imageName'=>'ListView', 'help'=>'PopupListViewBtn'); |
|
323 | - $this->buttons [ $GLOBALS [ 'mod_strings' ][ 'LBL_POPUPSEARCH' ] ] = array('action'=> "module=ModuleBuilder&action=editLayout&view=popupsearch&view_module={$this->editModule}&view_package={$this->package}", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_POPUPSEARCH'], 'imageName'=>'BasicSearch','help'=> 'PopupSearchViewBtn'); |
|
322 | + $this->buttons [$GLOBALS ['mod_strings']['LBL_POPUPLISTVIEW']] = array('action'=> "module=ModuleBuilder&action=editLayout&view=popuplist&view_module={$this->editModule}&view_package={$this->package}", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_POPUPLISTVIEW'], 'imageName'=>'ListView', 'help'=>'PopupListViewBtn'); |
|
323 | + $this->buttons [$GLOBALS ['mod_strings']['LBL_POPUPSEARCH']] = array('action'=> "module=ModuleBuilder&action=editLayout&view=popupsearch&view_module={$this->editModule}&view_package={$this->package}", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_POPUPSEARCH'], 'imageName'=>'BasicSearch', 'help'=> 'PopupSearchViewBtn'); |
|
324 | 324 | } |
325 | 325 | |
326 | 326 | function generateStudioDashletButtons() |
327 | 327 | { |
328 | - $this->buttons [ $GLOBALS [ 'mod_strings' ][ 'LBL_DASHLETLISTVIEW' ] ] = array('action'=> "module=ModuleBuilder&action=editLayout&view=dashlet&view_module={$this->editModule}", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_DASHLETLISTVIEW'], 'imageName'=>'ListView', 'help'=>'DashletListViewBtn'); |
|
329 | - $this->buttons [ $GLOBALS [ 'mod_strings' ][ 'LBL_DASHLETSEARCHVIEW' ] ] = array('action'=> "module=ModuleBuilder&action=editLayout&view=dashletsearch&view_module={$this->editModule}", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_DASHLETSEARCHVIEW'], 'imageName'=>'BasicSearch','help'=> 'DashletSearchViewBtn'); |
|
328 | + $this->buttons [$GLOBALS ['mod_strings']['LBL_DASHLETLISTVIEW']] = array('action'=> "module=ModuleBuilder&action=editLayout&view=dashlet&view_module={$this->editModule}", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_DASHLETLISTVIEW'], 'imageName'=>'ListView', 'help'=>'DashletListViewBtn'); |
|
329 | + $this->buttons [$GLOBALS ['mod_strings']['LBL_DASHLETSEARCHVIEW']] = array('action'=> "module=ModuleBuilder&action=editLayout&view=dashletsearch&view_module={$this->editModule}", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_DASHLETSEARCHVIEW'], 'imageName'=>'BasicSearch', 'help'=> 'DashletSearchViewBtn'); |
|
330 | 330 | } |
331 | 331 | |
332 | 332 | function generateStudioPopupButtons() |
333 | 333 | { |
334 | - $this->buttons [ $GLOBALS [ 'mod_strings' ][ 'LBL_POPUPLISTVIEW' ] ] = array('action'=> "module=ModuleBuilder&action=editLayout&view=popuplist&view_module={$this->editModule}", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_POPUPLISTVIEW'], 'imageName'=>'ListView', 'help'=>'PopupListViewBtn'); |
|
335 | - $this->buttons [ $GLOBALS [ 'mod_strings' ][ 'LBL_POPUPSEARCH' ] ] = array('action'=> "module=ModuleBuilder&action=editLayout&view=popupsearch&view_module={$this->editModule}", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_POPUPSEARCH'], 'imageName'=>'BasicSearch','help'=> 'PopupSearchViewBtn'); |
|
334 | + $this->buttons [$GLOBALS ['mod_strings']['LBL_POPUPLISTVIEW']] = array('action'=> "module=ModuleBuilder&action=editLayout&view=popuplist&view_module={$this->editModule}", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_POPUPLISTVIEW'], 'imageName'=>'ListView', 'help'=>'PopupListViewBtn'); |
|
335 | + $this->buttons [$GLOBALS ['mod_strings']['LBL_POPUPSEARCH']] = array('action'=> "module=ModuleBuilder&action=editLayout&view=popupsearch&view_module={$this->editModule}", 'imageTitle'=> $GLOBALS ['mod_strings']['LBL_POPUPSEARCH'], 'imageName'=>'BasicSearch', 'help'=> 'PopupSearchViewBtn'); |
|
336 | 336 | } |
337 | 337 | |
338 | 338 | function generateMBSearchButtons() |
339 | 339 | { |
340 | - $this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_BASIC' ] ] = array ( 'action' => "module=ModuleBuilder&MB=true&action=editLayout&view_module={$this->editModule}&view_package={$this->package}&view=SearchView&searchlayout=basic_search" , 'imageTitle' => $GLOBALS [ 'mod_strings' ] [ 'LBL_BASIC_SEARCH' ] , 'imageName' => 'BasicSearch','help' => "BasicSearchBtn" ) ; |
|
341 | - $this->buttons [ $GLOBALS [ 'mod_strings' ] [ 'LBL_ADVANCED' ] ] = array ( 'action' => "module=ModuleBuilder&MB=true&action=editLayout&view_module={$this->editModule}&view_package={$this->package}&view=SearchView&searchlayout=advanced_search" , 'imageTitle' => $GLOBALS [ 'mod_strings' ] [ 'LBL_ADVANCED_SEARCH' ] , 'imageName' => 'AdvancedSearch','help' => "AdvancedSearchBtn" ) ; |
|
340 | + $this->buttons [$GLOBALS ['mod_strings'] ['LBL_BASIC']] = array('action' => "module=ModuleBuilder&MB=true&action=editLayout&view_module={$this->editModule}&view_package={$this->package}&view=SearchView&searchlayout=basic_search", 'imageTitle' => $GLOBALS ['mod_strings'] ['LBL_BASIC_SEARCH'], 'imageName' => 'BasicSearch', 'help' => "BasicSearchBtn"); |
|
341 | + $this->buttons [$GLOBALS ['mod_strings'] ['LBL_ADVANCED']] = array('action' => "module=ModuleBuilder&MB=true&action=editLayout&view_module={$this->editModule}&view_package={$this->package}&view=SearchView&searchlayout=advanced_search", 'imageTitle' => $GLOBALS ['mod_strings'] ['LBL_ADVANCED_SEARCH'], 'imageName' => 'AdvancedSearch', 'help' => "AdvancedSearchBtn"); |
|
342 | 342 | } |
343 | 343 | } |
@@ -37,11 +37,11 @@ discard block |
||
37 | 37 | * display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM". |
38 | 38 | ********************************************************************************/ |
39 | 39 | |
40 | -require_once ('modules/ModuleBuilder/MB/AjaxCompose.php') ; |
|
41 | -require_once ('modules/ModuleBuilder/MB/ModuleBuilder.php') ; |
|
42 | -require_once ('modules/ModuleBuilder/views/view.relationship.php') ; |
|
43 | -require_once ('modules/ModuleBuilder/Module/StudioModule.php') ; |
|
44 | -require_once ('modules/ModuleBuilder/Module/StudioBrowser.php') ; |
|
40 | +require_once ('modules/ModuleBuilder/MB/AjaxCompose.php'); |
|
41 | +require_once ('modules/ModuleBuilder/MB/ModuleBuilder.php'); |
|
42 | +require_once ('modules/ModuleBuilder/views/view.relationship.php'); |
|
43 | +require_once ('modules/ModuleBuilder/Module/StudioModule.php'); |
|
44 | +require_once ('modules/ModuleBuilder/Module/StudioBrowser.php'); |
|
45 | 45 | |
46 | 46 | class ViewRelationships extends SugarView |
47 | 47 | { |
@@ -53,103 +53,103 @@ discard block |
||
53 | 53 | global $mod_strings; |
54 | 54 | |
55 | 55 | return array( |
56 | - translate('LBL_MODULE_NAME','Administration'), |
|
56 | + translate('LBL_MODULE_NAME', 'Administration'), |
|
57 | 57 | ModuleBuilderController::getModuleTitle(), |
58 | 58 | ); |
59 | 59 | } |
60 | 60 | |
61 | 61 | function display() |
62 | 62 | { |
63 | - $moduleName = ! empty ( $_REQUEST [ 'view_module' ] ) ? $_REQUEST [ 'view_module' ] : $_REQUEST [ 'edit_module' ] ; |
|
64 | - $smarty = new Sugar_Smarty ( ) ; |
|
63 | + $moduleName = !empty ($_REQUEST ['view_module']) ? $_REQUEST ['view_module'] : $_REQUEST ['edit_module']; |
|
64 | + $smarty = new Sugar_Smarty( ); |
|
65 | 65 | // set the mod_strings as we can be called after doing a Repair and the mod_strings are set to Administration |
66 | 66 | $GLOBALS['mod_strings'] = return_module_language($GLOBALS['current_language'], 'ModuleBuilder'); |
67 | - $smarty->assign ( 'mod_strings', $GLOBALS [ 'mod_strings' ] ) ; |
|
68 | - $smarty->assign ( 'view_module', $moduleName ) ; |
|
67 | + $smarty->assign('mod_strings', $GLOBALS ['mod_strings']); |
|
68 | + $smarty->assign('view_module', $moduleName); |
|
69 | 69 | |
70 | - $ajax = new AjaxCompose ( ) ; |
|
71 | - $json = getJSONobj () ; |
|
72 | - $this->fromModuleBuilder = !empty ( $_REQUEST [ 'MB' ] ) || (!empty($_REQUEST['view_package']) && $_REQUEST['view_package'] != 'studio') ; |
|
70 | + $ajax = new AjaxCompose( ); |
|
71 | + $json = getJSONobj(); |
|
72 | + $this->fromModuleBuilder = !empty ($_REQUEST ['MB']) || (!empty($_REQUEST['view_package']) && $_REQUEST['view_package'] != 'studio'); |
|
73 | 73 | $smarty->assign('fromModuleBuilder', $this->fromModuleBuilder); |
74 | 74 | if (!$this->fromModuleBuilder) |
75 | 75 | { |
76 | - $smarty->assign ( 'view_package', '' ) ; |
|
76 | + $smarty->assign('view_package', ''); |
|
77 | 77 | |
78 | - $relationships = new DeployedRelationships ( $moduleName ) ; |
|
79 | - $ajaxRelationships = $this->getAjaxRelationships( $relationships ) ; |
|
80 | - $smarty->assign ( 'relationships', $json->encode ( $ajaxRelationships ) ) ; |
|
81 | - $smarty->assign ( 'empty', (sizeof ( $ajaxRelationships ) == 0) ) ; |
|
82 | - $smarty->assign ( 'studio', true ) ; |
|
78 | + $relationships = new DeployedRelationships($moduleName); |
|
79 | + $ajaxRelationships = $this->getAjaxRelationships($relationships); |
|
80 | + $smarty->assign('relationships', $json->encode($ajaxRelationships)); |
|
81 | + $smarty->assign('empty', (sizeof($ajaxRelationships) == 0)); |
|
82 | + $smarty->assign('studio', true); |
|
83 | 83 | |
84 | 84 | //crumb |
85 | - global $app_list_strings ; |
|
86 | - $moduleNames = array_change_key_case ( $app_list_strings [ 'moduleList' ] ) ; |
|
87 | - $translatedModule = $moduleNames [ strtolower ( $moduleName ) ] ; |
|
88 | - $ajax->addCrumb ( translate('LBL_STUDIO'), 'ModuleBuilder.main("studio")' ) ; |
|
89 | - $ajax->addCrumb ( $translatedModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module=' . $moduleName . '")' ) ; |
|
90 | - $ajax->addCrumb ( translate('LBL_RELATIONSHIPS'), '' ) ; |
|
91 | - $ajax->addSection ( 'center', $moduleName . ' ' . translate('LBL_RELATIONSHIPS'), $this->fetchTemplate($smarty, 'modules/ModuleBuilder/tpls/studioRelationships.tpl')); |
|
85 | + global $app_list_strings; |
|
86 | + $moduleNames = array_change_key_case($app_list_strings ['moduleList']); |
|
87 | + $translatedModule = $moduleNames [strtolower($moduleName)]; |
|
88 | + $ajax->addCrumb(translate('LBL_STUDIO'), 'ModuleBuilder.main("studio")'); |
|
89 | + $ajax->addCrumb($translatedModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module='.$moduleName.'")'); |
|
90 | + $ajax->addCrumb(translate('LBL_RELATIONSHIPS'), ''); |
|
91 | + $ajax->addSection('center', $moduleName.' '.translate('LBL_RELATIONSHIPS'), $this->fetchTemplate($smarty, 'modules/ModuleBuilder/tpls/studioRelationships.tpl')); |
|
92 | 92 | |
93 | 93 | } else |
94 | 94 | { |
95 | - $smarty->assign ( 'view_package', $_REQUEST [ 'view_package' ] ) ; |
|
95 | + $smarty->assign('view_package', $_REQUEST ['view_package']); |
|
96 | 96 | |
97 | - $mb = new ModuleBuilder ( ) ; |
|
98 | - $module = & $mb->getPackageModule ( $_REQUEST [ 'view_package' ], $_REQUEST [ 'view_module' ] ) ; |
|
99 | - $package = $mb->packages [ $_REQUEST [ 'view_package' ] ] ; |
|
97 | + $mb = new ModuleBuilder( ); |
|
98 | + $module = & $mb->getPackageModule($_REQUEST ['view_package'], $_REQUEST ['view_module']); |
|
99 | + $package = $mb->packages [$_REQUEST ['view_package']]; |
|
100 | 100 | $package->loadModuleTitles(); |
101 | - $relationships = new UndeployedRelationships ( $module->getModuleDir () ) ; |
|
102 | - $ajaxRelationships = $this->getAjaxRelationships( $relationships ) ; |
|
103 | - $smarty->assign ( 'relationships', $json->encode ( $ajaxRelationships ) ) ; |
|
104 | - $smarty->assign ( 'empty', (sizeof ( $ajaxRelationships ) == 0) ) ; |
|
101 | + $relationships = new UndeployedRelationships($module->getModuleDir()); |
|
102 | + $ajaxRelationships = $this->getAjaxRelationships($relationships); |
|
103 | + $smarty->assign('relationships', $json->encode($ajaxRelationships)); |
|
104 | + $smarty->assign('empty', (sizeof($ajaxRelationships) == 0)); |
|
105 | 105 | |
106 | - $module->help [ 'default' ] = (empty ( $_REQUEST [ 'view_module' ] )) ? 'create' : 'modify' ; |
|
107 | - $module->help [ 'group' ] = 'module' ; |
|
106 | + $module->help ['default'] = (empty ($_REQUEST ['view_module'])) ? 'create' : 'modify'; |
|
107 | + $module->help ['group'] = 'module'; |
|
108 | 108 | |
109 | - $ajax->addCrumb ( translate('LBL_MODULEBUILDER'), 'ModuleBuilder.main("mb")' ) ; |
|
110 | - $ajax->addCrumb ( $package->name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package=' . $package->name . '")' ) ; |
|
111 | - $ajax->addCrumb ( $moduleName, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package=' . $package->name . '&view_module=' . $moduleName . '")' ) ; |
|
112 | - $ajax->addCrumb ( translate('LBL_RELATIONSHIPS'), '' ) ; |
|
113 | - $ajax->addSection ( 'center', $moduleName . ' ' . translate('LBL_RELATIONSHIPS'), $this->fetchTemplate($smarty, 'modules/ModuleBuilder/tpls/studioRelationships.tpl')); |
|
109 | + $ajax->addCrumb(translate('LBL_MODULEBUILDER'), 'ModuleBuilder.main("mb")'); |
|
110 | + $ajax->addCrumb($package->name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$package->name.'")'); |
|
111 | + $ajax->addCrumb($moduleName, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package='.$package->name.'&view_module='.$moduleName.'")'); |
|
112 | + $ajax->addCrumb(translate('LBL_RELATIONSHIPS'), ''); |
|
113 | + $ajax->addSection('center', $moduleName.' '.translate('LBL_RELATIONSHIPS'), $this->fetchTemplate($smarty, 'modules/ModuleBuilder/tpls/studioRelationships.tpl')); |
|
114 | 114 | } |
115 | - echo $ajax->getJavascript () ; |
|
115 | + echo $ajax->getJavascript(); |
|
116 | 116 | } |
117 | 117 | |
118 | 118 | /* |
119 | 119 | * Encode the relationships for this module for display in the Ext grid layout |
120 | 120 | */ |
121 | - function getAjaxRelationships ( $relationships ) |
|
121 | + function getAjaxRelationships($relationships) |
|
122 | 122 | { |
123 | - $ajaxrels = array ( ) ; |
|
124 | - foreach ( $relationships->getRelationshipList () as $relationshipName ) |
|
123 | + $ajaxrels = array( ); |
|
124 | + foreach ($relationships->getRelationshipList() as $relationshipName) |
|
125 | 125 | { |
126 | - $rel = $relationships->get ( $relationshipName )->getDefinition () ; |
|
127 | - $rel [ 'lhs_module' ] = translate( $rel [ 'lhs_module' ] ) ; |
|
128 | - $rel [ 'rhs_module' ] = translate( $rel [ 'rhs_module' ] ) ; |
|
126 | + $rel = $relationships->get($relationshipName)->getDefinition(); |
|
127 | + $rel ['lhs_module'] = translate($rel ['lhs_module']); |
|
128 | + $rel ['rhs_module'] = translate($rel ['rhs_module']); |
|
129 | 129 | |
130 | 130 | //#28668 , translate the relationship type before render it . |
131 | - switch($rel['relationship_type']){ |
|
131 | + switch ($rel['relationship_type']) { |
|
132 | 132 | case 'one-to-one': |
133 | - $rel['relationship_type'] = translate ( 'LBL_ONETOONE' ); |
|
133 | + $rel['relationship_type'] = translate('LBL_ONETOONE'); |
|
134 | 134 | break; |
135 | 135 | case 'one-to-many': |
136 | - $rel['relationship_type'] = translate ( 'LBL_ONETOMANY' ); |
|
136 | + $rel['relationship_type'] = translate('LBL_ONETOMANY'); |
|
137 | 137 | break; |
138 | 138 | case 'many-to-one': |
139 | - $rel['relationship_type'] = translate ( 'LBL_MANYTOONE' ); |
|
139 | + $rel['relationship_type'] = translate('LBL_MANYTOONE'); |
|
140 | 140 | break; |
141 | 141 | case 'many-to-many': |
142 | - $rel['relationship_type'] = translate ( 'LBL_MANYTOMANY' ); |
|
142 | + $rel['relationship_type'] = translate('LBL_MANYTOMANY'); |
|
143 | 143 | break; |
144 | - default: $rel['relationship_type'] = ''; |
|
144 | + default: $rel['relationship_type'] = ''; |
|
145 | 145 | } |
146 | - $rel [ 'name' ] = $relationshipName ; |
|
147 | - if ($rel [ 'is_custom' ] && isset($rel [ 'from_studio' ]) && $rel [ 'from_studio' ]) { |
|
148 | - $rel [ 'name' ] = $relationshipName . "*"; |
|
146 | + $rel ['name'] = $relationshipName; |
|
147 | + if ($rel ['is_custom'] && isset($rel ['from_studio']) && $rel ['from_studio']) { |
|
148 | + $rel ['name'] = $relationshipName."*"; |
|
149 | 149 | } |
150 | - $ajaxrels [] = $rel ; |
|
150 | + $ajaxrels [] = $rel; |
|
151 | 151 | } |
152 | - return $ajaxrels ; |
|
152 | + return $ajaxrels; |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | /** |