Completed
Push — console-installer ( e2b50d...6ce748 )
by Adam
22:30
created
modules/ModuleBuilder/views/view.module.php 3 patches
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -41,36 +41,36 @@  discard block
 block discarded – undo
41 41
 
42 42
 class ViewModule extends SugarView
43 43
 {
44
-	var $mbModule;
44
+    var $mbModule;
45 45
 	
46
- 	/**
47
-	 * @see SugarView::_getModuleTitleParams()
48
-	 */
49
-	protected function _getModuleTitleParams($browserTitle = false)
50
-	{
51
-	    global $mod_strings;
46
+        /**
47
+         * @see SugarView::_getModuleTitleParams()
48
+         */
49
+    protected function _getModuleTitleParams($browserTitle = false)
50
+    {
51
+        global $mod_strings;
52 52
 	    
53
-    	return array(
54
-    	   translate('LBL_MODULE_NAME','Administration'),
55
-    	   ModuleBuilderController::getModuleTitle(),
56
-    	   );
53
+        return array(
54
+            translate('LBL_MODULE_NAME','Administration'),
55
+            ModuleBuilderController::getModuleTitle(),
56
+            );
57 57
     }
58 58
 
59
-	function display()
60
-	{
61
-		global $mod_strings;
62
- 		$smarty = new Sugar_Smarty();
59
+    function display()
60
+    {
61
+        global $mod_strings;
62
+            $smarty = new Sugar_Smarty();
63 63
 
64
-		require_once('modules/ModuleBuilder/MB/ModuleBuilder.php');
65
-		$mb = new ModuleBuilder();
66
-		$mb->getPackage($_REQUEST['view_package']);
67
-		$package = $mb->packages[$_REQUEST['view_package']];
68
-		$module_name = (!empty($_REQUEST['view_module']))?$_REQUEST['view_module']:'';
69
-		$package->getModule($module_name);
70
-		$this->mbModule = $package->modules[$module_name];
71
-		$this->loadPackageHelp($module_name);
64
+        require_once('modules/ModuleBuilder/MB/ModuleBuilder.php');
65
+        $mb = new ModuleBuilder();
66
+        $mb->getPackage($_REQUEST['view_package']);
67
+        $package = $mb->packages[$_REQUEST['view_package']];
68
+        $module_name = (!empty($_REQUEST['view_module']))?$_REQUEST['view_module']:'';
69
+        $package->getModule($module_name);
70
+        $this->mbModule = $package->modules[$module_name];
71
+        $this->loadPackageHelp($module_name);
72 72
 		
73
-		// set up the list of either available types for a new module, or implemented types for an existing one
73
+        // set up the list of either available types for a new module, or implemented types for an existing one
74 74
         $types = (empty($module_name)) ? MBModule::getTypes() : $this->mbModule->mbvardefs->templates ;
75 75
         
76 76
         foreach( $types as $type=>$definition)
@@ -80,28 +80,28 @@  discard block
 block discarded – undo
80 80
         natcasesort($translated_type);
81 81
         $smarty->assign('types',$translated_type);
82 82
 		
83
-		$smarty->assign('package', $package);
84
-		$smarty->assign('module', $this->mbModule);
85
-		$smarty->assign('mod_strings', $mod_strings);
83
+        $smarty->assign('package', $package);
84
+        $smarty->assign('module', $this->mbModule);
85
+        $smarty->assign('mod_strings', $mod_strings);
86 86
 
87
-		$ajax = new AjaxCompose();
88
-		$ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.main("mb")');
89
-		$ajax->addCrumb(' '. $package->name,'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$package->name.'")');
90
-		if(empty($module_name))$module_name = translate('LBL_NEW_MODULE', 'ModuleBuilder');
91
-		$ajax->addCrumb($module_name, '');
92
-		$html=$smarty->fetch('modules/ModuleBuilder/tpls/MBModule/module.tpl');
93
-		if(!empty($_REQUEST['action']) && $_REQUEST['action']=='SaveModule')
94
-			$html .="<script>ModuleBuilder.treeRefresh('ModuleBuilder')</script>";
95
-		$ajax->addSection('center', translate('LBL_SECTION_MODULE', 'ModuleBuilder'), $html);
87
+        $ajax = new AjaxCompose();
88
+        $ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.main("mb")');
89
+        $ajax->addCrumb(' '. $package->name,'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$package->name.'")');
90
+        if(empty($module_name))$module_name = translate('LBL_NEW_MODULE', 'ModuleBuilder');
91
+        $ajax->addCrumb($module_name, '');
92
+        $html=$smarty->fetch('modules/ModuleBuilder/tpls/MBModule/module.tpl');
93
+        if(!empty($_REQUEST['action']) && $_REQUEST['action']=='SaveModule')
94
+            $html .="<script>ModuleBuilder.treeRefresh('ModuleBuilder')</script>";
95
+        $ajax->addSection('center', translate('LBL_SECTION_MODULE', 'ModuleBuilder'), $html);
96 96
 		
97
-		echo $ajax->getJavascript();
98
- 	}
97
+        echo $ajax->getJavascript();
98
+        }
99 99
  	
100
- 	function loadPackageHelp(
101
- 	    $name
102
- 	    )
103
- 	{
100
+        function loadPackageHelp(
101
+            $name
102
+            )
103
+        {
104 104
         $this->mbModule->help['default'] = (empty($name))?'create':'modify';
105 105
         $this->mbModule->help['group'] = 'module';
106
- 	}
106
+        }
107 107
 }
108 108
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 	    global $mod_strings;
52 52
 	    
53 53
     	return array(
54
-    	   translate('LBL_MODULE_NAME','Administration'),
54
+    	   translate('LBL_MODULE_NAME', 'Administration'),
55 55
     	   ModuleBuilderController::getModuleTitle(),
56 56
     	   );
57 57
     }
@@ -65,20 +65,20 @@  discard block
 block discarded – undo
65 65
 		$mb = new ModuleBuilder();
66 66
 		$mb->getPackage($_REQUEST['view_package']);
67 67
 		$package = $mb->packages[$_REQUEST['view_package']];
68
-		$module_name = (!empty($_REQUEST['view_module']))?$_REQUEST['view_module']:'';
68
+		$module_name = (!empty($_REQUEST['view_module'])) ? $_REQUEST['view_module'] : '';
69 69
 		$package->getModule($module_name);
70 70
 		$this->mbModule = $package->modules[$module_name];
71 71
 		$this->loadPackageHelp($module_name);
72 72
 		
73 73
 		// set up the list of either available types for a new module, or implemented types for an existing one
74
-        $types = (empty($module_name)) ? MBModule::getTypes() : $this->mbModule->mbvardefs->templates ;
74
+        $types = (empty($module_name)) ? MBModule::getTypes() : $this->mbModule->mbvardefs->templates;
75 75
         
76
-        foreach( $types as $type=>$definition)
76
+        foreach ($types as $type=>$definition)
77 77
         {
78
-            $translated_type[$type]=translate('LBL_TYPE_'.strtoupper($type),'ModuleBuilder');
78
+            $translated_type[$type] = translate('LBL_TYPE_'.strtoupper($type), 'ModuleBuilder');
79 79
         }
80 80
         natcasesort($translated_type);
81
-        $smarty->assign('types',$translated_type);
81
+        $smarty->assign('types', $translated_type);
82 82
 		
83 83
 		$smarty->assign('package', $package);
84 84
 		$smarty->assign('module', $this->mbModule);
@@ -86,12 +86,12 @@  discard block
 block discarded – undo
86 86
 
87 87
 		$ajax = new AjaxCompose();
88 88
 		$ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.main("mb")');
89
-		$ajax->addCrumb(' '. $package->name,'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$package->name.'")');
90
-		if(empty($module_name))$module_name = translate('LBL_NEW_MODULE', 'ModuleBuilder');
89
+		$ajax->addCrumb(' '.$package->name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$package->name.'")');
90
+		if (empty($module_name))$module_name = translate('LBL_NEW_MODULE', 'ModuleBuilder');
91 91
 		$ajax->addCrumb($module_name, '');
92
-		$html=$smarty->fetch('modules/ModuleBuilder/tpls/MBModule/module.tpl');
93
-		if(!empty($_REQUEST['action']) && $_REQUEST['action']=='SaveModule')
94
-			$html .="<script>ModuleBuilder.treeRefresh('ModuleBuilder')</script>";
92
+		$html = $smarty->fetch('modules/ModuleBuilder/tpls/MBModule/module.tpl');
93
+		if (!empty($_REQUEST['action']) && $_REQUEST['action'] == 'SaveModule')
94
+			$html .= "<script>ModuleBuilder.treeRefresh('ModuleBuilder')</script>";
95 95
 		$ajax->addSection('center', translate('LBL_SECTION_MODULE', 'ModuleBuilder'), $html);
96 96
 		
97 97
 		echo $ajax->getJavascript();
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
  	    $name
102 102
  	    )
103 103
  	{
104
-        $this->mbModule->help['default'] = (empty($name))?'create':'modify';
104
+        $this->mbModule->help['default'] = (empty($name)) ? 'create' : 'modify';
105 105
         $this->mbModule->help['group'] = 'module';
106 106
  	}
107 107
 }
108 108
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -87,11 +87,14 @@
 block discarded – undo
87 87
 		$ajax = new AjaxCompose();
88 88
 		$ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.main("mb")');
89 89
 		$ajax->addCrumb(' '. $package->name,'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$package->name.'")');
90
-		if(empty($module_name))$module_name = translate('LBL_NEW_MODULE', 'ModuleBuilder');
90
+		if(empty($module_name)) {
91
+		    $module_name = translate('LBL_NEW_MODULE', 'ModuleBuilder');
92
+		}
91 93
 		$ajax->addCrumb($module_name, '');
92 94
 		$html=$smarty->fetch('modules/ModuleBuilder/tpls/MBModule/module.tpl');
93
-		if(!empty($_REQUEST['action']) && $_REQUEST['action']=='SaveModule')
94
-			$html .="<script>ModuleBuilder.treeRefresh('ModuleBuilder')</script>";
95
+		if(!empty($_REQUEST['action']) && $_REQUEST['action']=='SaveModule') {
96
+					$html .="<script>ModuleBuilder.treeRefresh('ModuleBuilder')</script>";
97
+		}
95 98
 		$ajax->addSection('center', translate('LBL_SECTION_MODULE', 'ModuleBuilder'), $html);
96 99
 		
97 100
 		echo $ajax->getJavascript();
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.searchview.php 3 patches
Indentation   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -48,88 +48,88 @@
 block discarded – undo
48 48
 
49 49
 class ViewSearchView extends ViewListView
50 50
 {
51
- 	function __construct()
52
- 	{
53
- 		parent::__construct();
54
- 		if (!empty($_REQUEST['searchlayout'])) {
55
- 			$this->editLayout = $_REQUEST['searchlayout'];
56
- 		}
57
- 	}
51
+        function __construct()
52
+        {
53
+            parent::__construct();
54
+            if (!empty($_REQUEST['searchlayout'])) {
55
+                $this->editLayout = $_REQUEST['searchlayout'];
56
+            }
57
+        }
58 58
  	
59
- 	/**
60
-	 * @see SugarView::_getModuleTitleParams()
61
-	 */
62
-	protected function _getModuleTitleParams($browserTitle = false)
63
-	{
64
-	    global $mod_strings;
59
+        /**
60
+         * @see SugarView::_getModuleTitleParams()
61
+         */
62
+    protected function _getModuleTitleParams($browserTitle = false)
63
+    {
64
+        global $mod_strings;
65 65
 	    
66
-    	return array(
67
-    	   translate('LBL_MODULE_NAME','Administration'),
68
-    	   ModuleBuilderController::getModuleTitle(),
69
-    	   );
66
+        return array(
67
+            translate('LBL_MODULE_NAME','Administration'),
68
+            ModuleBuilderController::getModuleTitle(),
69
+            );
70 70
     }
71 71
 
72
- 	// DO NOT REMOVE - overrides parent ViewEdit preDisplay() which attempts to load a bean for a non-existent module
73
- 	function preDisplay()
74
- 	{
75
- 	}
72
+        // DO NOT REMOVE - overrides parent ViewEdit preDisplay() which attempts to load a bean for a non-existent module
73
+        function preDisplay()
74
+        {
75
+        }
76 76
 
77
- 	function display(
78
- 	    $preview = false
79
- 	    )
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 ) ;
77
+        function display(
78
+            $preview = false
79
+            )
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 ) ;
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
- 		if ($preview)
92
- 		{
93
- 			echo $smarty->fetch ( "modules/ModuleBuilder/tpls/Preview/listView.tpl" ) ;
94
- 		} else
95
- 		{
96
- 			$ajax = $this->constructAjax () ;
97
- 			$ajax->addSection ( 'center', translate ($this->title), $smarty->fetch ( "modules/ModuleBuilder/tpls/listView.tpl" ) ) ;
98
- 			echo $ajax->getJavascript () ;
99
- 		}
100
- 	}
91
+            if ($preview)
92
+            {
93
+                echo $smarty->fetch ( "modules/ModuleBuilder/tpls/Preview/listView.tpl" ) ;
94
+            } else
95
+            {
96
+                $ajax = $this->constructAjax () ;
97
+                $ajax->addSection ( 'center', translate ($this->title), $smarty->fetch ( "modules/ModuleBuilder/tpls/listView.tpl" ) ) ;
98
+                echo $ajax->getJavascript () ;
99
+            }
100
+        }
101 101
 
102
- 	function constructAjax()
103
- 	{
104
- 		require_once ('modules/ModuleBuilder/MB/AjaxCompose.php') ;
105
- 		$ajax = new AjaxCompose ( ) ;
106
- 		switch ( $this->editLayout )
107
- 		{
108
- 			default:
109
- 				$searchLabel = 'LBL_' . strtoupper ( $this->editLayout) ;
110
- 		}
102
+        function constructAjax()
103
+        {
104
+            require_once ('modules/ModuleBuilder/MB/AjaxCompose.php') ;
105
+            $ajax = new AjaxCompose ( ) ;
106
+            switch ( $this->editLayout )
107
+            {
108
+                default:
109
+                 $searchLabel = 'LBL_' . strtoupper ( $this->editLayout) ;
110
+            }
111 111
 
112 112
         $layoutLabel = 'LBL_LAYOUTS' ;
113 113
         $layoutView = 'layouts' ;
114 114
 
115 115
 
116
- 		if ($this->fromModuleBuilder)
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' ), '' ) ;
124
- 		} else
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' ), ''  ) ;
131
- 		}
132
- 		$this->title = $searchLabel;
133
- 		return $ajax ;
134
- 	}
116
+            if ($this->fromModuleBuilder)
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' ), '' ) ;
124
+            } else
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' ), ''  ) ;
131
+            }
132
+            $this->title = $searchLabel;
133
+            return $ajax ;
134
+        }
135 135
 }
Please login to merge, or discard this 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.
Braces   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (! defined ( 'sugarEntry' ) || ! sugarEntry)
3
-die ( 'Not A Valid Entry Point' ) ;
2
+if (! defined ( 'sugarEntry' ) || ! sugarEntry) {
3
+    die ( 'Not A Valid Entry Point' ) ;
4
+}
4 5
 /*********************************************************************************
5 6
  * SugarCRM Community Edition is a customer relationship management program developed by
6 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -119,14 +120,18 @@  discard block
 block discarded – undo
119 120
  			$ajax->addCrumb ( $_REQUEST [ 'view_package' ], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package=' . $_REQUEST [ 'view_package' ] . '")' ) ;
120 121
  			$ajax->addCrumb ( $this->editModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package=' . $_REQUEST [ 'view_package' ] . "&view_module={$this->editModule}" . '")'  ) ;
121 122
  			$ajax->addCrumb ( translate ( $layoutLabel, 'ModuleBuilder' ), 'ModuleBuilder.getContent("module=ModuleBuilder&MB=true&action=wizard&view_module=' . $this->editModule. '&view_package=' . $_REQUEST['view_package'] . '")'  ) ;
122
- 			if ( $layoutLabel == 'LBL_LAYOUTS' ) $ajax->addCrumb ( translate ( 'LBL_SEARCH_FORMS', 'ModuleBuilder' ), 'ModuleBuilder.getContent("module=ModuleBuilder&MB=true&action=wizard&view=search&view_module=' .$this->editModule . '&view_package=' . $_REQUEST [ 'view_package' ] . '")'  ) ;
123
+ 			if ( $layoutLabel == 'LBL_LAYOUTS' ) {
124
+ 			    $ajax->addCrumb ( translate ( 'LBL_SEARCH_FORMS', 'ModuleBuilder' ), 'ModuleBuilder.getContent("module=ModuleBuilder&MB=true&action=wizard&view=search&view_module=' .$this->editModule . '&view_package=' . $_REQUEST [ 'view_package' ] . '")'  ) ;
125
+ 			}
123 126
  			$ajax->addCrumb ( translate ( $searchLabel, 'ModuleBuilder' ), '' ) ;
124 127
  		} else
125 128
  		{
126 129
  			$ajax->addCrumb ( translate ( 'LBL_STUDIO', 'ModuleBuilder' ), 'ModuleBuilder.main("studio")' ) ;
127 130
  			$ajax->addCrumb ( $this->translatedEditModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module=' . $this->editModule . '")'  ) ;
128 131
  			$ajax->addCrumb ( translate ( $layoutLabel, 'ModuleBuilder' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view='.$layoutView.'&view_module=' . $this->editModule . '")'  ) ;
129
- 			if ( $layoutLabel == 'LBL_LAYOUTS' ) $ajax->addCrumb ( translate ( 'LBL_SEARCH_FORMS', 'ModuleBuilder' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=search&view_module=' .$this->editModule . '")' ) ;
132
+ 			if ( $layoutLabel == 'LBL_LAYOUTS' ) {
133
+ 			    $ajax->addCrumb ( translate ( 'LBL_SEARCH_FORMS', 'ModuleBuilder' ), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=search&view_module=' .$this->editModule . '")' ) ;
134
+ 			}
130 135
  			$ajax->addCrumb ( translate ( $searchLabel, 'ModuleBuilder' ), ''  ) ;
131 136
  		}
132 137
  		$this->title = $searchLabel;
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.exportcustomizations.php 2 patches
Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -40,40 +40,40 @@
 block discarded – undo
40 40
 require_once('modules/ModuleBuilder/MB/AjaxCompose.php');
41 41
 class ViewExportcustomizations extends SugarView
42 42
 {
43
-	/**
44
-	 * @see SugarView::_getModuleTitleParams()
45
-	 */
46
-	protected function _getModuleTitleParams($browserTitle = false)
47
-	{
48
-	    global $mod_strings;
43
+    /**
44
+     * @see SugarView::_getModuleTitleParams()
45
+     */
46
+    protected function _getModuleTitleParams($browserTitle = false)
47
+    {
48
+        global $mod_strings;
49 49
 	    
50
-    	return array(
51
-    	   translate('LBL_MODULE_NAME','Administration'),
52
-    	   ModuleBuilderController::getModuleTitle(),
53
-    	   );
50
+        return array(
51
+            translate('LBL_MODULE_NAME','Administration'),
52
+            ModuleBuilderController::getModuleTitle(),
53
+            );
54 54
     }
55 55
 
56
-	function display()
57
-	{
58
- 		global $current_user, $mod_strings;
59
- 		$smarty = new Sugar_Smarty();
60
- 		$mb = new MBPackage("packageCustom");
61
- 		$mod=$mb->getCustomModules();
62
- 		foreach($mod as $key => $value){
63
- 		    $modules[]=$key;
64
- 		    $custom[]=$value;
65
- 		}
66
- 		$nb_mod = count($modules);
67
- 		$smarty->assign('mod_strings', $mod_strings);
68
- 		$smarty->assign('modules', $mod);
69
- 		$smarty->assign('custom', $custom);
70
- 		$smarty->assign('nb_mod', $nb_mod);
71
- 		$smarty->assign('defaultHelp', 'exportHelp');
72
- 		$smarty->assign('moduleList',$GLOBALS['app_list_strings']['moduleList']);  
73
- 		$smarty->assign('moduleList',$GLOBALS['app_list_strings']['moduleList']);  
74
-		$ajax = new AjaxCompose();
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')));
77
-		echo $ajax->getJavascript();
78
- 	}
56
+    function display()
57
+    {
58
+            global $current_user, $mod_strings;
59
+            $smarty = new Sugar_Smarty();
60
+            $mb = new MBPackage("packageCustom");
61
+            $mod=$mb->getCustomModules();
62
+            foreach($mod as $key => $value){
63
+                $modules[]=$key;
64
+                $custom[]=$value;
65
+            }
66
+            $nb_mod = count($modules);
67
+            $smarty->assign('mod_strings', $mod_strings);
68
+            $smarty->assign('modules', $mod);
69
+            $smarty->assign('custom', $custom);
70
+            $smarty->assign('nb_mod', $nb_mod);
71
+            $smarty->assign('defaultHelp', 'exportHelp');
72
+            $smarty->assign('moduleList',$GLOBALS['app_list_strings']['moduleList']);  
73
+            $smarty->assign('moduleList',$GLOBALS['app_list_strings']['moduleList']);  
74
+        $ajax = new AjaxCompose();
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')));
77
+        echo $ajax->getJavascript();
78
+        }
79 79
 }
80 80
\ No newline at end of file
Please login to merge, or discard this 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 3 patches
Indentation   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -47,16 +47,16 @@  discard block
 block discarded – undo
47 47
 class ViewRelationship extends SugarView
48 48
 {
49 49
     /**
50
-	 * @see SugarView::_getModuleTitleParams()
51
-	 */
52
-	protected function _getModuleTitleParams($browserTitle = false)
53
-	{
54
-	    global $mod_strings;
50
+     * @see SugarView::_getModuleTitleParams()
51
+     */
52
+    protected function _getModuleTitleParams($browserTitle = false)
53
+    {
54
+        global $mod_strings;
55 55
 	    
56
-    	return array(
57
-    	   translate('LBL_MODULE_NAME','Administration'),
58
-    	   ModuleBuilderController::getModuleTitle(),
59
-    	   );
56
+        return array(
57
+            translate('LBL_MODULE_NAME','Administration'),
58
+            ModuleBuilderController::getModuleTitle(),
59
+            );
60 60
     }
61 61
 
62 62
     function overrideDefinitionFromPOST(
@@ -66,9 +66,9 @@  discard block
 block discarded – undo
66 66
         require_once 'modules/ModuleBuilder/parsers/relationships/AbstractRelationship.php' ;
67 67
         foreach ( AbstractRelationship::$definitionKeys as $key )
68 68
         {
69
-        	if(!empty($_REQUEST ['ajaxLoad']) && in_array($key, array('label', 'rhs_label', 'lhs_label')) ){
70
-        		continue;
71
-        	}
69
+            if(!empty($_REQUEST ['ajaxLoad']) && in_array($key, array('label', 'rhs_label', 'lhs_label')) ){
70
+                continue;
71
+            }
72 72
             if (! empty ( $_REQUEST [ $key ] ))
73 73
             {
74 74
                 $definition [ $key ] = $_REQUEST [ $key ] ;
@@ -92,15 +92,15 @@  discard block
 block discarded – undo
92 92
             $fields = $module->fields ;
93 93
             require_once 'modules/ModuleBuilder/parsers/relationships/DeployedRelationships.php' ;
94 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
-        	$appStrings = $appStrings['moduleList'];
95
+            $appStrings = return_app_list_strings_language( $selected_lang ) ;
96
+            $modStrings = return_module_language( $selected_lang, $_REQUEST [ 'view_module' ], true ) ;
97
+            $appStrings = $appStrings['moduleList'];
98 98
         } else
99 99
         {
100 100
             $mb = new ModuleBuilder ( ) ;
101
-			$mb->getPackages();
102
-			//display the latest module name rather than what is in or not in the loaded app_list_strings.
103
-			$mb->getPackage($_REQUEST ['view_package'])->loadModuleTitles();
101
+            $mb->getPackages();
102
+            //display the latest module name rather than what is in or not in the loaded app_list_strings.
103
+            $mb->getPackage($_REQUEST ['view_package'])->loadModuleTitles();
104 104
             $module = $mb->getPackageModule ( $_REQUEST [ 'view_package' ], $_REQUEST [ 'view_module' ] ) ;
105 105
             $moduleName = empty($module->key_name) ? $module->getModuleName() : $module->key_name;
106 106
             $this->smarty->assign ( 'view_package', $_REQUEST [ 'view_package' ] ) ;
@@ -132,16 +132,16 @@  discard block
 block discarded – undo
132 132
             $relationship->setName($_REQUEST [ 'relationship_name' ] );
133 133
             $definition = $relationship->getDefinition();
134 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
-				#30624
141
-				if(!empty($_REQUEST['rhs_module'])){
142
-					$definition['rhs_label'] = $_REQUEST['rhs_module'];
143
-				}
144
-			}
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
+                #30624
141
+                if(!empty($_REQUEST['rhs_module'])){
142
+                    $definition['rhs_label'] = $_REQUEST['rhs_module'];
143
+                }
144
+            }
145 145
         } else
146 146
         {
147 147
             $definition = array ( ) ;
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
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
         {
@@ -185,17 +185,17 @@  discard block
 block discarded – undo
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
-        	if (isset ($definition['lhs_module']) && $definition['lhs_module'] == 'Campaigns') {
193
-            	unset ( $cardinality [ MB_MANYTOMANY ] ) ;
194
-            	unset ( $cardinality [ MB_ONETOMANY ] ) ;
192
+            if (isset ($definition['lhs_module']) && $definition['lhs_module'] == 'Campaigns') {
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 200
             if (! isset($cardinality[$relationship->getType()]))
201 201
             {
@@ -206,12 +206,12 @@  discard block
 block discarded – undo
206 206
             
207 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'])) {
214
-        	unset ($relatableModules['Activities']);
213
+        if (!isset($cardinality [ MB_ONETOMANY ]) && isset ($relatableModules['Activities'])) {
214
+            unset ($relatableModules['Activities']);
215 215
         }
216 216
         
217 217
         
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
         $this->smarty->assign ( 'rhspanels', $rhs_subpanels ) ;
238 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 242
         switch ( $relationship->relationship_type)
243 243
         {
Please login to merge, or discard this 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.
Braces   +10 added lines, -7 removed lines patch added patch discarded remove patch
@@ -120,8 +120,9 @@  discard block
 block discarded – undo
120 120
                 
121 121
         $cardinality = array ( MB_ONETOONE => translate ( 'LBL_ONETOONE' ) , MB_ONETOMANY => translate ( 'LBL_ONETOMANY' ) , MB_MANYTOONE=> translate ( 'LBL_MANYTOONE' ), MB_MANYTOMANY => translate ( 'LBL_MANYTOMANY' ), ) ;
122 122
         
123
-        if (!$this->fromModuleBuilder)
124
-            unset($cardinality[MB_MANYTOONE]);
123
+        if (!$this->fromModuleBuilder) {
124
+                    unset($cardinality[MB_MANYTOONE]);
125
+        }
125 126
             
126 127
         $relationships = $module->getRelationships () ;
127 128
         
@@ -136,7 +137,7 @@  discard block
 block discarded – undo
136 137
 	            $definition['lhs_label'] = isset($modStrings[$relationship->getTitleKey()])?$modStrings[$relationship->getTitleKey()] : $relationship->lhs_module;
137 138
 	            $modStrings = return_module_language( $selected_lang, $relationship->lhs_module, true ) ;
138 139
 	    		$definition['rhs_label'] = isset($modStrings[$relationship->getTitleKey(true)])?$modStrings[$relationship->getTitleKey(true)] : $relationship->rhs_module ;
139
-			}else{
140
+			} else{
140 141
 				#30624
141 142
 				if(!empty($_REQUEST['rhs_module'])){
142 143
 					$definition['rhs_label'] = $_REQUEST['rhs_module'];
@@ -254,12 +255,14 @@  discard block
 block discarded – undo
254 255
                     }
255 256
                     $this->smarty->assign ( 'relationship_role_column_enum', $validRoleColumnFields ) ;
256 257
                 }
257
-                if (! empty ( $relationship->relationship_role_column_value ))
258
-                    $this->smarty->assign ( 'relationship_role_column_value', $relationship->relationship_role_column_value ) ;
258
+                if (! empty ( $relationship->relationship_role_column_value )) {
259
+                                    $this->smarty->assign ( 'relationship_role_column_value', $relationship->relationship_role_column_value ) ;
260
+                }
259 261
                 break ;
260 262
             case MB_MANYTOMANY :
261
-                if (! empty ( $relationship->relationship_role_column_value ))
262
-                    $this->smarty->assign ( 'relationship_role_column_value', $relationship->relationship_role_column_value ) ;
263
+                if (! empty ( $relationship->relationship_role_column_value )) {
264
+                                    $this->smarty->assign ( 'relationship_role_column_value', $relationship->relationship_role_column_value ) ;
265
+                }
263 266
                 break ;
264 267
         }
265 268
         
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.dropdowns.php 2 patches
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -41,31 +41,31 @@  discard block
 block discarded – undo
41 41
 
42 42
 class ViewDropdowns extends SugarView
43 43
 {
44
- 	/**
45
-	 * @see SugarView::_getModuleTitleParams()
46
-	 */
47
-	protected function _getModuleTitleParams($browserTitle = false)
48
-	{
49
-	    global $mod_strings;
44
+        /**
45
+         * @see SugarView::_getModuleTitleParams()
46
+         */
47
+    protected function _getModuleTitleParams($browserTitle = false)
48
+    {
49
+        global $mod_strings;
50 50
 	    
51
-    	return array(
52
-    	   translate('LBL_MODULE_NAME','Administration'),
53
-    	   ModuleBuilderController::getModuleTitle(),
54
-    	   );
51
+        return array(
52
+            translate('LBL_MODULE_NAME','Administration'),
53
+            ModuleBuilderController::getModuleTitle(),
54
+            );
55 55
     }
56 56
 
57
-	function display()
58
- 	{
59
-		$ajax = new AjaxCompose();
60
-		$smarty = new Sugar_Smarty();
57
+    function display()
58
+        {
59
+        $ajax = new AjaxCompose();
60
+        $smarty = new Sugar_Smarty();
61 61
 		
62
- 		if (isset($_REQUEST['refreshTree']))
63
-		{
64
-			require_once ('modules/ModuleBuilder/Module/DropDownTree.php');
65
-			$mbt = new DropDownTree();
66
-			$ajax->addSection('west', $mbt->getName(), $mbt->fetchNodes());
67
-			$smarty->assign('refreshTree',true);
68
-		}
62
+            if (isset($_REQUEST['refreshTree']))
63
+        {
64
+            require_once ('modules/ModuleBuilder/Module/DropDownTree.php');
65
+            $mbt = new DropDownTree();
66
+            $ajax->addSection('west', $mbt->getName(), $mbt->fetchNodes());
67
+            $smarty->assign('refreshTree',true);
68
+        }
69 69
                 
70 70
         global $mod_strings;
71 71
         $ajax->addCrumb($mod_strings['LBL_DROPDOWNEDITOR'], 'ModuleBuilder.main("dropdowns")');
@@ -75,12 +75,12 @@  discard block
 block discarded – undo
75 75
         
76 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']));
80
-		$smarty->assign('action', 'savedropdown');
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
+        $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') );
84
- 		echo $ajax->getJavascript();
85
- 	}
83
+        $ajax->addSection('center', $GLOBALS['mod_strings']['LBL_DROPDOWNEDITOR'], $smarty->fetch('modules/ModuleBuilder/tpls/MBModule/dropdowns.tpl') );
84
+            echo $ajax->getJavascript();
85
+        }
86 86
 }
87 87
\ No newline at end of file
Please login to merge, or discard this 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 3 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -62,16 +62,16 @@  discard block
 block discarded – undo
62 62
     }
63 63
     
64 64
     /**
65
-	 * @see SugarView::_getModuleTitleParams()
66
-	 */
67
-	protected function _getModuleTitleParams($browserTitle = false)
68
-	{
69
-	    global $mod_strings;
65
+     * @see SugarView::_getModuleTitleParams()
66
+     */
67
+    protected function _getModuleTitleParams($browserTitle = false)
68
+    {
69
+        global $mod_strings;
70 70
 	    
71
-    	return array(
72
-    	   translate('LBL_MODULE_NAME','Administration'),
73
-    	   ModuleBuilderController::getModuleTitle(),
74
-    	   );
71
+        return array(
72
+            translate('LBL_MODULE_NAME','Administration'),
73
+            ModuleBuilderController::getModuleTitle(),
74
+            );
75 75
     }
76 76
 
77 77
 //    /*
@@ -101,12 +101,12 @@  discard block
 block discarded – undo
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
 
@@ -151,11 +151,11 @@  discard block
 block discarded – undo
151 151
         $helpName = (isset( $_REQUEST['view']) && $_REQUEST['view']==MB_POPUPSEARCH) ? 'searchViewEditor' : 'popupListViewEditor';
152 152
         $smarty->assign ( 'helpName', $helpName ) ;
153 153
         $smarty->assign ( 'helpDefault', 'modify' ) ;
154
-   	 	if ($this->fromModuleBuilder) {
155
-			$mb = new ModuleBuilder ( ) ;
154
+            if ($this->fromModuleBuilder) {
155
+            $mb = new ModuleBuilder ( ) ;
156 156
             $module = & $mb->getPackageModule ( $this->editPackage, $this->editModule ) ;
157
-		    $smarty->assign('current_mod_strings', $module->getModStrings());
158
-		}
157
+            $smarty->assign('current_mod_strings', $module->getModStrings());
158
+        }
159 159
 
160 160
         $smarty->assign ( 'title', $this->_constructTitle () ) ;
161 161
         $groups = array ( ) ;
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
                 {
172 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
             }
Please login to merge, or discard this 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.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (! defined ( 'sugarEntry' ) || ! sugarEntry)
2
+if (! defined ( 'sugarEntry' ) || ! sugarEntry) {
3 3
     die ( 'Not A Valid Entry Point' ) ;
4
+}
4 5
 /*********************************************************************************
5 6
  * SugarCRM Community Edition is a customer relationship management program developed by
6 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -125,7 +126,7 @@  discard block
 block discarded – undo
125 126
 
126 127
             $ViewLabel = ($this->editLayout == MB_POPUPLIST) ? 'LBL_POPUPLISTVIEW' : 'LBL_POPUPSEARCH';
127 128
             $ajax->addCrumb ( translate ($ViewLabel, 'ModuleBuilder' ), '' ) ;
128
-        }else{
129
+        } else{
129 130
             $ajax->addCrumb ( translate($this->editModule), 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_module=' . $this->editModule . '")' ) ;
130 131
             $ajax->addCrumb ( translate('LBL_LAYOUTS', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&layouts=1&view_module=' . $this->editModule . '")');
131 132
             $ajax->addCrumb ( translate('LBL_POPUP', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=popup&view_module=' . $this->editModule . '")' );
@@ -184,8 +185,9 @@  discard block
 block discarded – undo
184 185
 
185 186
 
186 187
         $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\")" ;
187
-        if (isset($this->searchlayout))
188
-            $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$this->searchlayout}\")" ;
188
+        if (isset($this->searchlayout)) {
189
+                    $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$this->searchlayout}\")" ;
190
+        }
189 191
 
190 192
         $buttons = array ( ) ;
191 193
         if (! $this->fromModuleBuilder)
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.property.php 3 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -49,16 +49,16 @@  discard block
 block discarded – undo
49 49
     }
50 50
     
51 51
     /**
52
-	 * @see SugarView::_getModuleTitleParams()
53
-	 */
54
-	protected function _getModuleTitleParams($browserTitle = false)
55
-	{
56
-	    global $mod_strings;
52
+     * @see SugarView::_getModuleTitleParams()
53
+     */
54
+    protected function _getModuleTitleParams($browserTitle = false)
55
+    {
56
+        global $mod_strings;
57 57
 	    
58
-    	return array(
59
-    	   translate('LBL_MODULE_NAME','Administration'),
60
-    	   ModuleBuilderController::getModuleTitle(),
61
-    	   );
58
+        return array(
59
+            translate('LBL_MODULE_NAME','Administration'),
60
+            ModuleBuilderController::getModuleTitle(),
61
+            );
62 62
     }
63 63
 
64 64
 	
@@ -97,12 +97,12 @@  discard block
 block discarded – undo
97 97
                 $this->properties[substr($key,6)]['title'] = $value;
98 98
             }
99 99
         }
100
-     }
100
+        }
101 101
 
102 102
     function display()
103 103
     {
104 104
         global $mod_strings;
105
-    	$ajax = new AjaxCompose();
105
+        $ajax = new AjaxCompose();
106 106
         $smarty = new Sugar_Smarty();
107 107
         if (isset($_REQUEST['MB']) && $_REQUEST['MB'] == "1")
108 108
         {
@@ -111,11 +111,11 @@  discard block
 block discarded – undo
111 111
         }
112 112
 
113 113
         $selected_lang = (!empty($_REQUEST['selected_lang'])?$_REQUEST['selected_lang']:$_SESSION['authenticated_user_language']);
114
-		if(empty($selected_lang)){
115
-		    $selected_lang = $GLOBALS['sugar_config']['default_language'];
116
-		}
117
-		$smarty->assign('available_languages', get_languages());
118
-		$smarty->assign('selected_lang', $selected_lang);
114
+        if(empty($selected_lang)){
115
+            $selected_lang = $GLOBALS['sugar_config']['default_language'];
116
+        }
117
+        $smarty->assign('available_languages', get_languages());
118
+        $smarty->assign('selected_lang', $selected_lang);
119 119
 		
120 120
         ksort($this->properties);
121 121
 
Please login to merge, or discard this patch.
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -51,9 +51,9 @@  discard block
 block discarded – undo
51 51
     /**
52 52
      * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead
53 53
      */
54
-    function ViewProperty(){
54
+    function ViewProperty() {
55 55
         $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code';
56
-        if(isset($GLOBALS['log'])) {
56
+        if (isset($GLOBALS['log'])) {
57 57
             $GLOBALS['log']->deprecated($deprecatedMessage);
58 58
         }
59 59
         else {
@@ -71,45 +71,45 @@  discard block
 block discarded – undo
71 71
 	    global $mod_strings;
72 72
 
73 73
     	return array(
74
-    	   translate('LBL_MODULE_NAME','Administration'),
74
+    	   translate('LBL_MODULE_NAME', 'Administration'),
75 75
     	   ModuleBuilderController::getModuleTitle(),
76 76
     	   );
77 77
     }
78 78
 
79 79
 
80
-    function init () // pseduo-constuctor - given a well-known name to allow subclasses to call this classes constructor
80
+    function init() // pseduo-constuctor - given a well-known name to allow subclasses to call this classes constructor
81 81
     {
82
-        $this->editModule = (! empty($_REQUEST['view_module'])) ? $_REQUEST['view_module'] : null;
83
-        $this->editPackage = (! empty($_REQUEST['view_package'])) ? $_REQUEST['view_package'] : null;
84
-        $this->id = (! empty($_REQUEST['id'])) ? $_REQUEST['id'] : null;
85
-        $this->subpanel = (! empty($_REQUEST['subpanel'])) ? $_REQUEST['subpanel'] : "";
82
+        $this->editModule = (!empty($_REQUEST['view_module'])) ? $_REQUEST['view_module'] : null;
83
+        $this->editPackage = (!empty($_REQUEST['view_package'])) ? $_REQUEST['view_package'] : null;
84
+        $this->id = (!empty($_REQUEST['id'])) ? $_REQUEST['id'] : null;
85
+        $this->subpanel = (!empty($_REQUEST['subpanel'])) ? $_REQUEST['subpanel'] : "";
86 86
         $this->properties = array();
87
-        foreach($_REQUEST as $key=>$value)
87
+        foreach ($_REQUEST as $key=>$value)
88 88
         {
89
-            if (substr($key,0,4) == 'name')
89
+            if (substr($key, 0, 4) == 'name')
90 90
             {
91
-                $this->properties[substr($key,5)]['name'] = $value;
91
+                $this->properties[substr($key, 5)]['name'] = $value;
92 92
             }
93
-            if (substr($key,0,2) == 'id')
93
+            if (substr($key, 0, 2) == 'id')
94 94
             {
95
-                $this->properties[substr($key,3)]['id'] = $value;
95
+                $this->properties[substr($key, 3)]['id'] = $value;
96 96
             }
97
-            if (substr($key,0,5) == 'value')
97
+            if (substr($key, 0, 5) == 'value')
98 98
             {
99
-                $this->properties[substr($key,6)]['value'] = $value;
99
+                $this->properties[substr($key, 6)]['value'] = $value;
100 100
                 // 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
101
-                if (substr($key,6) == 'label')
101
+                if (substr($key, 6) == 'label')
102 102
                 {
103 103
                     //#29796  , we disable the edit function for sub panel label
104
-                    if (preg_match('/\{.*\}/',$value) || !empty($this->subpanel))
104
+                    if (preg_match('/\{.*\}/', $value) || !empty($this->subpanel))
105 105
                     {
106
-                        $this->properties[substr($key,6)]['hidden'] = 1;
106
+                        $this->properties[substr($key, 6)]['hidden'] = 1;
107 107
                     }
108 108
                 }
109 109
             }
110
-            if (substr($key,0,5) == 'title')
110
+            if (substr($key, 0, 5) == 'title')
111 111
             {
112
-                $this->properties[substr($key,6)]['title'] = $value;
112
+                $this->properties[substr($key, 6)]['title'] = $value;
113 113
             }
114 114
         }
115 115
      }
@@ -125,8 +125,8 @@  discard block
 block discarded – undo
125 125
             $smarty->assign("view_package", $_REQUEST['view_package']);
126 126
         }
127 127
 
128
-        $selected_lang = (!empty($_REQUEST['selected_lang'])?$_REQUEST['selected_lang']:$_SESSION['authenticated_user_language']);
129
-		if(empty($selected_lang)){
128
+        $selected_lang = (!empty($_REQUEST['selected_lang']) ? $_REQUEST['selected_lang'] : $_SESSION['authenticated_user_language']);
129
+		if (empty($selected_lang)) {
130 130
 		    $selected_lang = $GLOBALS['sugar_config']['default_language'];
131 131
 		}
132 132
 		$smarty->assign('available_languages', get_languages());
@@ -134,10 +134,10 @@  discard block
 block discarded – undo
134 134
 
135 135
         ksort($this->properties);
136 136
 
137
-        $smarty->assign("properties",$this->properties);
137
+        $smarty->assign("properties", $this->properties);
138 138
 //        $smarty->assign("id",$this->id);
139 139
 
140
-        $smarty->assign("mod_strings",$mod_strings);
140
+        $smarty->assign("mod_strings", $mod_strings);
141 141
         $smarty->assign('APP', $GLOBALS['app_strings']);
142 142
         $smarty->assign("view_module", $this->editModule);
143 143
         $smarty->assign("subpanel", $this->subpanel);
Please login to merge, or discard this patch.
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,8 +55,7 @@  discard block
 block discarded – undo
55 55
         $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code';
56 56
         if(isset($GLOBALS['log'])) {
57 57
             $GLOBALS['log']->deprecated($deprecatedMessage);
58
-        }
59
-        else {
58
+        } else {
60 59
             trigger_error($deprecatedMessage, E_USER_DEPRECATED);
61 60
         }
62 61
         self::__construct();
@@ -141,8 +140,9 @@  discard block
 block discarded – undo
141 140
         $smarty->assign('APP', $GLOBALS['app_strings']);
142 141
         $smarty->assign("view_module", $this->editModule);
143 142
         $smarty->assign("subpanel", $this->subpanel);
144
-        if (isset($this->editPackage))
145
-            $smarty->assign("view_package", $this->editPackage);
143
+        if (isset($this->editPackage)) {
144
+                    $smarty->assign("view_package", $this->editPackage);
145
+        }
146 146
 
147 147
         $ajax->addSection('east', translate('LBL_SECTION_PROPERTIES', 'ModuleBuilder'), $smarty->fetch('modules/ModuleBuilder/tpls/editProperty.tpl'));
148 148
         echo $ajax->getJavascript();
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.tree.php 2 patches
Indentation   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -45,40 +45,40 @@
 block discarded – undo
45 45
 
46 46
 class ViewHistory extends SugarView 
47 47
 {
48
- 	/**
49
-	 * @see SugarView::_getModuleTitleParams()
50
-	 */
51
-	protected function _getModuleTitleParams($browserTitle = false)
52
-	{
53
-	    global $mod_strings;
48
+        /**
49
+         * @see SugarView::_getModuleTitleParams()
50
+         */
51
+    protected function _getModuleTitleParams($browserTitle = false)
52
+    {
53
+        global $mod_strings;
54 54
 	    
55
-    	return array(
56
-    	   translate('LBL_MODULE_NAME','Administration'),
57
-    	   ModuleBuilderController::getModuleTitle(),
58
-    	   );
55
+        return array(
56
+            translate('LBL_MODULE_NAME','Administration'),
57
+            ModuleBuilderController::getModuleTitle(),
58
+            );
59 59
     }
60 60
 
61
-	//STUDIO LABELS ONLY//
62
- 	//TODO Bundle Studio and ModuleBuilder label handling to increase maintainability.
63
- 	function display()
64
- 	{
65
-		$root = new ExtNode('root', 'root', true);
66
-		$sb = new StudioBrowser();
67
-		$sb->loadModules();
68
-		foreach($sb->modules as $name => $studioMod) {
69
-			$root->add_node($this->buildStudioNode($studioMod));
70
-		}
71
-		$json = getJSONobj();
72
-		echo($json->encode($root));
73
- 	}
61
+    //STUDIO LABELS ONLY//
62
+        //TODO Bundle Studio and ModuleBuilder label handling to increase maintainability.
63
+        function display()
64
+        {
65
+        $root = new ExtNode('root', 'root', true);
66
+        $sb = new StudioBrowser();
67
+        $sb->loadModules();
68
+        foreach($sb->modules as $name => $studioMod) {
69
+            $root->add_node($this->buildStudioNode($studioMod));
70
+        }
71
+        $json = getJSONobj();
72
+        echo($json->encode($root));
73
+        }
74 74
 	
75
-	/**
76
-	 * 
77
-	 * @return ExtNode built from the passed StudioModule
78
-	 * @param $module StudioModule
79
-	 */
80
-	function buildStudioNode($module) {
75
+    /**
76
+     * 
77
+     * @return ExtNode built from the passed StudioModule
78
+     * @param $module StudioModule
79
+     */
80
+    function buildStudioNode($module) {
81 81
 		
82
-	}
82
+    }
83 83
 
84 84
 }
Please login to merge, or discard this 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 3 patches
Indentation   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -48,19 +48,19 @@  discard block
 block discarded – undo
48 48
 class ViewResetmodule extends SugarView
49 49
 {
50 50
     /**
51
-	 * @see SugarView::_getModuleTitleParams()
52
-	 */
53
-	protected function _getModuleTitleParams($browserTitle = false)
54
-	{
55
-	    global $mod_strings;
51
+     * @see SugarView::_getModuleTitleParams()
52
+     */
53
+    protected function _getModuleTitleParams($browserTitle = false)
54
+    {
55
+        global $mod_strings;
56 56
 	    
57
-    	return array(
58
-    	   translate('LBL_MODULE_NAME','Administration'),
59
-    	   ModuleBuilderController::getModuleTitle(),
60
-    	   );
57
+        return array(
58
+            translate('LBL_MODULE_NAME','Administration'),
59
+            ModuleBuilderController::getModuleTitle(),
60
+            );
61 61
     }
62 62
 
63
-	function display()
63
+    function display()
64 64
     {
65 65
         $moduleName = $this->module = $_REQUEST['view_module'];
66 66
         if (isset($_REQUEST['handle']) && $_REQUEST['handle'] == "execute") {
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
             array("name" => "fields", "label" => translate("LBL_REMOVE_FIELDS")),
80 80
             array("name" => "layouts", "label" => translate("LBL_RESET_LAYOUTS")),
81 81
             array("name" => "labels", "label" => translate("LBL_RESET_LABELS")),
82
-			array("name" => "extensions", "label" => translate("LBL_CLEAR_EXTENSIONS")),
82
+            array("name" => "extensions", "label" => translate("LBL_CLEAR_EXTENSIONS")),
83 83
         ));
84 84
         
85 85
         $ajax->addSection ( 
@@ -104,10 +104,10 @@  discard block
 block discarded – undo
104 104
         if (!empty($_REQUEST['layouts']))
105 105
             $out .= $this->removeCustomLayouts();
106 106
 			
107
-		if (!empty($_REQUEST['labels']))
107
+        if (!empty($_REQUEST['labels']))
108 108
             $out .= $this->removeCustomLabels();
109 109
 			
110
-		if (!empty($_REQUEST['extensions']))
110
+        if (!empty($_REQUEST['extensions']))
111 111
             $out .= $this->removeCustomExtensions();	
112 112
 			
113 113
         
@@ -148,11 +148,11 @@  discard block
 block discarded – undo
148 148
         $customFields = array();
149 149
         foreach($seed->field_defs as $def) {
150 150
             if(isset($def['source']) && $def['source'] == 'custom_fields') {
151
-               $field = $df->getFieldWidget($moduleName, $def['name']);
152
-               $field->delete ( $df ) ;
151
+                $field = $df->getFieldWidget($moduleName, $def['name']);
152
+                $field->delete ( $df ) ;
153 153
                
154
-               $module->removeFieldFromLayouts( $def['name'] );
155
-               $customFields[] = $def['name'];
154
+                $module->removeFieldFromLayouts( $def['name'] );
155
+                $customFields[] = $def['name'];
156 156
             }
157 157
         }
158 158
         $out = "";
@@ -196,7 +196,7 @@  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 202
         $relationships = new DeployedRelationships ( $this->module ) ;
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
             }
211 211
         }
212 212
         if ($madeChanges)
213
-           $relationships->save () ;
213
+            $relationships->save () ;
214 214
         
215 215
         return $out;
216 216
     }
@@ -218,33 +218,33 @@  discard block
 block discarded – undo
218 218
     function removeCustomLabels() 
219 219
     {
220 220
         $out = "";
221
-		$languageDir = "custom/modules/{$this->module}/language";
221
+        $languageDir = "custom/modules/{$this->module}/language";
222 222
         if (is_dir($languageDir)) {
223 223
             $files = scandir($languageDir);
224 224
             foreach ($files as $langFile) {
225 225
                 if (substr($langFile, 0 ,1) == '.') continue;
226
-				$language = substr($langFile, 0, strlen($langFile) - 9);
227
-				unlink($languageDir . "/" . $langFile);
226
+                $language = substr($langFile, 0, strlen($langFile) - 9);
227
+                unlink($languageDir . "/" . $langFile);
228 228
 				
229
-				LanguageManager::clearLanguageCache ( $this->module, $language ) ;
230
-				$out .= "Removed language file $langFile<br/>";
229
+                LanguageManager::clearLanguageCache ( $this->module, $language ) ;
230
+                $out .= "Removed language file $langFile<br/>";
231 231
             }
232 232
         }
233 233
 		
234
-		return $out;
234
+        return $out;
235 235
     }
236 236
 	
237
-	function removeCustomExtensions() 
238
-	{
237
+    function removeCustomExtensions() 
238
+    {
239 239
         $out = "";
240 240
         $extDir = "custom/Extension/modules/{$this->module}";
241 241
         if (is_dir($extDir)) {
242
-        	rmdir_recursive($extDir);
243
-        	require_once ('modules/Administration/QuickRepairAndRebuild.php') ;
242
+            rmdir_recursive($extDir);
243
+            require_once ('modules/Administration/QuickRepairAndRebuild.php') ;
244 244
             $rac = new RepairAndClear ( ) ;
245 245
             $rac->repairAndClearAll ( array ( 'clearAll' ), array ( $this->module ), true, false ) ;
246
-			$rac->rebuildExtensions();
247
-        	$out .= "Cleared extensions for {$this->module}<br/>";
246
+            $rac->rebuildExtensions();
247
+            $out .= "Cleared extensions for {$this->module}<br/>";
248 248
         }
249 249
 		
250 250
         return $out;
Please login to merge, or discard this 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.
Braces   +21 added lines, -13 removed lines patch added patch discarded remove patch
@@ -95,20 +95,25 @@  discard block
 block discarded – undo
95 95
     {
96 96
         $out = "<script>ajaxStatus.flashStatus(SUGAR.language.get('app_strings', 'LBL_REQUEST_PROCESSED'), 2000);</script>";
97 97
         
98
-        if (!empty($_REQUEST['relationships']))
99
-            $out .= $this->removeCustomRelationships();
98
+        if (!empty($_REQUEST['relationships'])) {
99
+                    $out .= $this->removeCustomRelationships();
100
+        }
100 101
             
101
-        if (!empty($_REQUEST['fields']))
102
-            $out .= $this->removeCustomFields();
102
+        if (!empty($_REQUEST['fields'])) {
103
+                    $out .= $this->removeCustomFields();
104
+        }
103 105
             
104
-        if (!empty($_REQUEST['layouts']))
105
-            $out .= $this->removeCustomLayouts();
106
+        if (!empty($_REQUEST['layouts'])) {
107
+                    $out .= $this->removeCustomLayouts();
108
+        }
106 109
 			
107
-		if (!empty($_REQUEST['labels']))
108
-            $out .= $this->removeCustomLabels();
110
+		if (!empty($_REQUEST['labels'])) {
111
+		            $out .= $this->removeCustomLabels();
112
+		}
109 113
 			
110
-		if (!empty($_REQUEST['extensions']))
111
-            $out .= $this->removeCustomExtensions();	
114
+		if (!empty($_REQUEST['extensions'])) {
115
+		            $out .= $this->removeCustomExtensions();
116
+		}
112 117
 			
113 118
         
114 119
         $out .= "Complete!";
@@ -209,8 +214,9 @@  discard block
 block discarded – undo
209 214
                 $out .= "Removed relationship $relationshipName<br/>";
210 215
             }
211 216
         }
212
-        if ($madeChanges)
213
-           $relationships->save () ;
217
+        if ($madeChanges) {
218
+                   $relationships->save () ;
219
+        }
214 220
         
215 221
         return $out;
216 222
     }
@@ -222,7 +228,9 @@  discard block
 block discarded – undo
222 228
         if (is_dir($languageDir)) {
223 229
             $files = scandir($languageDir);
224 230
             foreach ($files as $langFile) {
225
-                if (substr($langFile, 0 ,1) == '.') continue;
231
+                if (substr($langFile, 0 ,1) == '.') {
232
+                    continue;
233
+                }
226 234
 				$language = substr($langFile, 0, strlen($langFile) - 9);
227 235
 				unlink($languageDir . "/" . $langFile);
228 236
 				
Please login to merge, or discard this patch.