Test Failed
Push — CI ( 0f01dd...c95a04 )
by Adam
55:13
created
modules/ModuleBuilder/views/view.searchview.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (! defined ( 'sugarEntry' ) || ! sugarEntry)
3
-die ( 'Not A Valid Entry Point' ) ;
2
+if (!defined('sugarEntry') || !sugarEntry)
3
+die ('Not A Valid Entry Point');
4 4
 /*********************************************************************************
5 5
  * SugarCRM Community Edition is a customer relationship management program developed by
6 6
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
 
44 44
 
45 45
 
46
-require_once ('modules/ModuleBuilder/views/view.listview.php') ;
47
-require_once 'modules/ModuleBuilder/parsers/constants.php' ;
46
+require_once ('modules/ModuleBuilder/views/view.listview.php');
47
+require_once 'modules/ModuleBuilder/parsers/constants.php';
48 48
 
49 49
 class ViewSearchView extends ViewListView
50 50
 {
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	    global $mod_strings;
65 65
 	    
66 66
     	return array(
67
-    	   translate('LBL_MODULE_NAME','Administration'),
67
+    	   translate('LBL_MODULE_NAME', 'Administration'),
68 68
     	   ModuleBuilderController::getModuleTitle(),
69 69
     	   );
70 70
     }
@@ -78,58 +78,58 @@  discard block
 block discarded – undo
78 78
  	    $preview = false
79 79
  	    )
80 80
  	{
81
- 		$packageName = (isset ( $_REQUEST [ 'view_package' ] )) ? $_REQUEST [ 'view_package' ] : '' ;
82
- 		require_once 'modules/ModuleBuilder/parsers/ParserFactory.php' ;
83
- 		$parser = ParserFactory::getParser ( $this->editLayout , $this->editModule, $packageName ) ;
81
+ 		$packageName = (isset ($_REQUEST ['view_package'])) ? $_REQUEST ['view_package'] : '';
82
+ 		require_once 'modules/ModuleBuilder/parsers/ParserFactory.php';
83
+ 		$parser = ParserFactory::getParser($this->editLayout, $this->editModule, $packageName);
84 84
 
85
- 		$smarty = parent::constructSmarty ( $parser ) ;
86
- 		$smarty->assign ( 'action', 'searchViewSave' ) ;
87
- 		$smarty->assign ( 'view', $this->editLayout ) ;
88
- 		$smarty->assign ( 'helpName', 'searchViewEditor' ) ;
89
- 		$smarty->assign ( 'helpDefault', 'modify' ) ;
85
+ 		$smarty = parent::constructSmarty($parser);
86
+ 		$smarty->assign('action', 'searchViewSave');
87
+ 		$smarty->assign('view', $this->editLayout);
88
+ 		$smarty->assign('helpName', 'searchViewEditor');
89
+ 		$smarty->assign('helpDefault', 'modify');
90 90
 
91 91
  		if ($preview)
92 92
  		{
93
- 			echo $smarty->fetch ( "modules/ModuleBuilder/tpls/Preview/listView.tpl" ) ;
93
+ 			echo $smarty->fetch("modules/ModuleBuilder/tpls/Preview/listView.tpl");
94 94
  		} else
95 95
  		{
96
- 			$ajax = $this->constructAjax () ;
97
- 			$ajax->addSection ( 'center', translate ($this->title), $smarty->fetch ( "modules/ModuleBuilder/tpls/listView.tpl" ) ) ;
98
- 			echo $ajax->getJavascript () ;
96
+ 			$ajax = $this->constructAjax();
97
+ 			$ajax->addSection('center', translate($this->title), $smarty->fetch("modules/ModuleBuilder/tpls/listView.tpl"));
98
+ 			echo $ajax->getJavascript();
99 99
  		}
100 100
  	}
101 101
 
102 102
  	function constructAjax()
103 103
  	{
104
- 		require_once ('modules/ModuleBuilder/MB/AjaxCompose.php') ;
105
- 		$ajax = new AjaxCompose ( ) ;
106
- 		switch ( $this->editLayout )
104
+ 		require_once ('modules/ModuleBuilder/MB/AjaxCompose.php');
105
+ 		$ajax = new AjaxCompose( );
106
+ 		switch ($this->editLayout)
107 107
  		{
108 108
  			default:
109
- 				$searchLabel = 'LBL_' . strtoupper ( $this->editLayout) ;
109
+ 				$searchLabel = 'LBL_'.strtoupper($this->editLayout);
110 110
  		}
111 111
 
112
-        $layoutLabel = 'LBL_LAYOUTS' ;
113
-        $layoutView = 'layouts' ;
112
+        $layoutLabel = 'LBL_LAYOUTS';
113
+        $layoutView = 'layouts';
114 114
 
115 115
 
116 116
  		if ($this->fromModuleBuilder)
117 117
  		{
118
- 			$ajax->addCrumb ( translate ( 'LBL_MODULEBUILDER', 'ModuleBuilder' ), 'ModuleBuilder.main("mb")' ) ;
119
- 			$ajax->addCrumb ( $_REQUEST [ 'view_package' ], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package=' . $_REQUEST [ 'view_package' ] . '")' ) ;
120
- 			$ajax->addCrumb ( $this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package=' . $_REQUEST [ 'view_package' ] . "&view_module={$this->editModule}" . '")'  ) ;
121
- 			$ajax->addCrumb ( translate ( $layoutLabel, 'ModuleBuilder' ), 'ModuleBuilder.getContent("module=ModuleBuilder&MB=true&action=wizard&view_module=' . $this->editModule. '&view_package=' . $_REQUEST['view_package'] . '")'  ) ;
122
- 			if ( $layoutLabel == 'LBL_LAYOUTS' ) $ajax->addCrumb ( translate ( 'LBL_SEARCH_FORMS', 'ModuleBuilder' ), 'ModuleBuilder.getContent("module=ModuleBuilder&MB=true&action=wizard&view=search&view_module=' .$this->editModule . '&view_package=' . $_REQUEST [ 'view_package' ] . '")'  ) ;
123
- 			$ajax->addCrumb ( translate ( $searchLabel, 'ModuleBuilder' ), '' ) ;
118
+ 			$ajax->addCrumb(translate('LBL_MODULEBUILDER', 'ModuleBuilder'), 'ModuleBuilder.main("mb")');
119
+ 			$ajax->addCrumb($_REQUEST ['view_package'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$_REQUEST ['view_package'].'")');
120
+ 			$ajax->addCrumb($this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package='.$_REQUEST ['view_package']."&view_module={$this->editModule}".'")');
121
+ 			$ajax->addCrumb(translate($layoutLabel, 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&MB=true&action=wizard&view_module='.$this->editModule.'&view_package='.$_REQUEST['view_package'].'")');
122
+ 			if ($layoutLabel == 'LBL_LAYOUTS') $ajax->addCrumb(translate('LBL_SEARCH_FORMS', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&MB=true&action=wizard&view=search&view_module='.$this->editModule.'&view_package='.$_REQUEST ['view_package'].'")');
123
+ 			$ajax->addCrumb(translate($searchLabel, 'ModuleBuilder'), '');
124 124
  		} else
125 125
  		{
126
- 			$ajax->addCrumb ( translate ( 'LBL_STUDIO', 'ModuleBuilder' ), 'ModuleBuilder.main("studio")' ) ;
127
- 			$ajax->addCrumb ( $this->translatedEditModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module=' . $this->editModule . '")'  ) ;
128
- 			$ajax->addCrumb ( translate ( $layoutLabel, 'ModuleBuilder' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view='.$layoutView.'&view_module=' . $this->editModule . '")'  ) ;
129
- 			if ( $layoutLabel == 'LBL_LAYOUTS' ) $ajax->addCrumb ( translate ( 'LBL_SEARCH_FORMS', 'ModuleBuilder' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=search&view_module=' .$this->editModule . '")' ) ;
130
- 			$ajax->addCrumb ( translate ( $searchLabel, 'ModuleBuilder' ), ''  ) ;
126
+ 			$ajax->addCrumb(translate('LBL_STUDIO', 'ModuleBuilder'), 'ModuleBuilder.main("studio")');
127
+ 			$ajax->addCrumb($this->translatedEditModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module='.$this->editModule.'")');
128
+ 			$ajax->addCrumb(translate($layoutLabel, 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view='.$layoutView.'&view_module='.$this->editModule.'")');
129
+ 			if ($layoutLabel == 'LBL_LAYOUTS') $ajax->addCrumb(translate('LBL_SEARCH_FORMS', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=search&view_module='.$this->editModule.'")');
130
+ 			$ajax->addCrumb(translate($searchLabel, 'ModuleBuilder'), '');
131 131
  		}
132 132
  		$this->title = $searchLabel;
133
- 		return $ajax ;
133
+ 		return $ajax;
134 134
  	}
135 135
 }
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.exportcustomizations.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	    global $mod_strings;
49 49
 	    
50 50
     	return array(
51
-    	   translate('LBL_MODULE_NAME','Administration'),
51
+    	   translate('LBL_MODULE_NAME', 'Administration'),
52 52
     	   ModuleBuilderController::getModuleTitle(),
53 53
     	   );
54 54
     }
@@ -58,10 +58,10 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.relationship.php 1 patch
Spacing   +112 added lines, -112 removed lines patch added patch discarded remove patch
@@ -37,12 +37,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
54 54
 	    global $mod_strings;
55 55
 	    
56 56
     	return array(
57
-    	   translate('LBL_MODULE_NAME','Administration'),
57
+    	   translate('LBL_MODULE_NAME', 'Administration'),
58 58
     	   ModuleBuilderController::getModuleTitle(),
59 59
     	   );
60 60
     }
@@ -63,214 +63,214 @@  discard block
 block discarded – undo
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
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.dropdowns.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.popupview.php 1 patch
Spacing   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (! defined ( 'sugarEntry' ) || ! sugarEntry)
3
-    die ( 'Not A Valid Entry Point' ) ;
2
+if (!defined('sugarEntry') || !sugarEntry)
3
+    die ('Not A Valid Entry Point');
4 4
 /*********************************************************************************
5 5
  * SugarCRM Community Edition is a customer relationship management program developed by
6 6
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -41,23 +41,23 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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' ] . ':&nbsp;' . $title ;
234
+        return $GLOBALS ['mod_strings'] ['LBL_LISTVIEW_EDIT'].':&nbsp;'.$title;
235 235
 
236 236
     }
237 237
 }
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.property.php 1 patch
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -56,45 +56,45 @@  discard block
 block discarded – undo
56 56
 	    global $mod_strings;
57 57
 	    
58 58
     	return array(
59
-    	   translate('LBL_MODULE_NAME','Administration'),
59
+    	   translate('LBL_MODULE_NAME', 'Administration'),
60 60
     	   ModuleBuilderController::getModuleTitle(),
61 61
     	   );
62 62
     }
63 63
 
64 64
 	
65
-    function init () // pseduo-constuctor - given a well-known name to allow subclasses to call this classes constructor
65
+    function init() // pseduo-constuctor - given a well-known name to allow subclasses to call this classes constructor
66 66
     {
67
-        $this->editModule = (! empty($_REQUEST['view_module'])) ? $_REQUEST['view_module'] : null;
68
-        $this->editPackage = (! empty($_REQUEST['view_package'])) ? $_REQUEST['view_package'] : null;
69
-        $this->id = (! empty($_REQUEST['id'])) ? $_REQUEST['id'] : null;
70
-        $this->subpanel = (! empty($_REQUEST['subpanel'])) ? $_REQUEST['subpanel'] : "";
67
+        $this->editModule = (!empty($_REQUEST['view_module'])) ? $_REQUEST['view_module'] : null;
68
+        $this->editPackage = (!empty($_REQUEST['view_package'])) ? $_REQUEST['view_package'] : null;
69
+        $this->id = (!empty($_REQUEST['id'])) ? $_REQUEST['id'] : null;
70
+        $this->subpanel = (!empty($_REQUEST['subpanel'])) ? $_REQUEST['subpanel'] : "";
71 71
         $this->properties = array();
72
-        foreach($_REQUEST as $key=>$value)
72
+        foreach ($_REQUEST as $key=>$value)
73 73
         {
74
-            if (substr($key,0,4) == 'name')
74
+            if (substr($key, 0, 4) == 'name')
75 75
             {
76
-                $this->properties[substr($key,5)]['name'] = $value;
76
+                $this->properties[substr($key, 5)]['name'] = $value;
77 77
             }
78
-            if (substr($key,0,2) == 'id')
78
+            if (substr($key, 0, 2) == 'id')
79 79
             {
80
-                $this->properties[substr($key,3)]['id'] = $value;
80
+                $this->properties[substr($key, 3)]['id'] = $value;
81 81
             }
82
-            if (substr($key,0,5) == 'value')
82
+            if (substr($key, 0, 5) == 'value')
83 83
             {
84
-                $this->properties[substr($key,6)]['value'] = $value;
84
+                $this->properties[substr($key, 6)]['value'] = $value;
85 85
                 // tyoung - now a nasty hack to disable editing of labels which contain Smarty functions - this is envisaged to be a temporary fix to prevent admins modifying these functions then being unable to restore the original complicated value if they regret it
86
-                if (substr($key,6) == 'label')
86
+                if (substr($key, 6) == 'label')
87 87
                 {
88 88
                     //#29796  , we disable the edit function for sub panel label
89
-                    if (preg_match('/\{.*\}/',$value) || !empty($this->subpanel))
89
+                    if (preg_match('/\{.*\}/', $value) || !empty($this->subpanel))
90 90
                     {
91
-                        $this->properties[substr($key,6)]['hidden'] = 1;
91
+                        $this->properties[substr($key, 6)]['hidden'] = 1;
92 92
                     }
93 93
                 }
94 94
             }
95
-            if (substr($key,0,5) == 'title')
95
+            if (substr($key, 0, 5) == 'title')
96 96
             {
97
-                $this->properties[substr($key,6)]['title'] = $value;
97
+                $this->properties[substr($key, 6)]['title'] = $value;
98 98
             }
99 99
         }
100 100
      }
@@ -110,8 +110,8 @@  discard block
 block discarded – undo
110 110
             $smarty->assign("view_package", $_REQUEST['view_package']);
111 111
         }
112 112
 
113
-        $selected_lang = (!empty($_REQUEST['selected_lang'])?$_REQUEST['selected_lang']:$_SESSION['authenticated_user_language']);
114
-		if(empty($selected_lang)){
113
+        $selected_lang = (!empty($_REQUEST['selected_lang']) ? $_REQUEST['selected_lang'] : $_SESSION['authenticated_user_language']);
114
+		if (empty($selected_lang)) {
115 115
 		    $selected_lang = $GLOBALS['sugar_config']['default_language'];
116 116
 		}
117 117
 		$smarty->assign('available_languages', get_languages());
@@ -119,10 +119,10 @@  discard block
 block discarded – undo
119 119
 		
120 120
         ksort($this->properties);
121 121
 
122
-        $smarty->assign("properties",$this->properties);
122
+        $smarty->assign("properties", $this->properties);
123 123
 //        $smarty->assign("id",$this->id);
124 124
         
125
-        $smarty->assign("mod_strings",$mod_strings);
125
+        $smarty->assign("mod_strings", $mod_strings);
126 126
         $smarty->assign('APP', $GLOBALS['app_strings']);
127 127
         $smarty->assign("view_module", $this->editModule);
128 128
         $smarty->assign("subpanel", $this->subpanel);
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.tree.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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();
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.resetmodule.php 1 patch
Spacing   +51 added lines, -51 removed lines patch added patch discarded remove patch
@@ -37,12 +37,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
55 55
 	    global $mod_strings;
56 56
 	    
57 57
     	return array(
58
-    	   translate('LBL_MODULE_NAME','Administration'),
58
+    	   translate('LBL_MODULE_NAME', 'Administration'),
59 59
     	   ModuleBuilderController::getModuleTitle(),
60 60
     	   );
61 61
     }
@@ -67,12 +67,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
         }
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.displaydeployresult.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 
42 42
 class ViewDisplaydeployresult extends SugarView
43 43
 {
44
-	function ViewDisplaydeployresult(){
44
+	function ViewDisplaydeployresult() {
45 45
 		$this->show_header = false;
46 46
 		$this->show_title = false;
47 47
  		$this->show_subpanels = false;
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 	    global $mod_strings;
60 60
 
61 61
     	return array(
62
-    	   translate('LBL_MODULE_NAME','Administration'),
62
+    	   translate('LBL_MODULE_NAME', 'Administration'),
63 63
     	   ModuleBuilderController::getModuleTitle(),
64 64
     	   );
65 65
     }
Please login to merge, or discard this patch.