@@ -43,22 +43,22 @@ |
||
43 | 43 | class Viewdeletemodule extends SugarView |
44 | 44 | { |
45 | 45 | /** |
46 | - * @see SugarView::_getModuleTitleParams() |
|
47 | - */ |
|
48 | - protected function _getModuleTitleParams($browserTitle = false) |
|
49 | - { |
|
50 | - global $mod_strings; |
|
46 | + * @see SugarView::_getModuleTitleParams() |
|
47 | + */ |
|
48 | + protected function _getModuleTitleParams($browserTitle = false) |
|
49 | + { |
|
50 | + global $mod_strings; |
|
51 | 51 | |
52 | - return array( |
|
53 | - translate('LBL_MODULE_NAME','Administration'), |
|
54 | - ModuleBuilderController::getModuleTitle(), |
|
55 | - ); |
|
52 | + return array( |
|
53 | + translate('LBL_MODULE_NAME','Administration'), |
|
54 | + ModuleBuilderController::getModuleTitle(), |
|
55 | + ); |
|
56 | 56 | } |
57 | 57 | |
58 | - function display() |
|
59 | - { |
|
60 | - $ajax = new AjaxCompose(); |
|
61 | - $ajax->addSection('center', 'Module Deleted', $_REQUEST['module'] . ' was deleted from ' . $_REQUEST['package']); |
|
62 | - echo $ajax->getJavascript(); |
|
63 | - } |
|
58 | + function display() |
|
59 | + { |
|
60 | + $ajax = new AjaxCompose(); |
|
61 | + $ajax->addSection('center', 'Module Deleted', $_REQUEST['module'] . ' was deleted from ' . $_REQUEST['package']); |
|
62 | + echo $ajax->getJavascript(); |
|
63 | + } |
|
64 | 64 | } |
65 | 65 | \ No newline at end of file |
@@ -41,130 +41,130 @@ |
||
41 | 41 | |
42 | 42 | class ViewDropdown 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 = $this->generateSmarty(); |
|
57 | + function display() |
|
58 | + { |
|
59 | + $ajax = new AjaxCompose(); |
|
60 | + $smarty = $this->generateSmarty(); |
|
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 | |
72 | - $smarty->assign('deleteImage', SugarThemeRegistry::current()->getImage( 'delete_inline', '',null,null,'.gif',$mod_strings['LBL_MB_DELETE'])); |
|
73 | - $smarty->assign('editImage', SugarThemeRegistry::current()->getImage( 'edit_inline', '' |
|
72 | + $smarty->assign('deleteImage', SugarThemeRegistry::current()->getImage( 'delete_inline', '',null,null,'.gif',$mod_strings['LBL_MB_DELETE'])); |
|
73 | + $smarty->assign('editImage', SugarThemeRegistry::current()->getImage( 'edit_inline', '' |
|
74 | 74 | ,null,null,'.gif',$mod_strings['LBL_EDIT'])); |
75 | - $smarty->assign('action', 'savedropdown'); |
|
76 | - $body = $smarty->fetch('modules/ModuleBuilder/tpls/MBModule/dropdown.tpl'); |
|
77 | - $ajax->addSection('east2', $mod_strings['LBL_SECTION_DROPDOWNED'], $body ); |
|
78 | - echo $ajax->getJavascript(); |
|
79 | - } |
|
75 | + $smarty->assign('action', 'savedropdown'); |
|
76 | + $body = $smarty->fetch('modules/ModuleBuilder/tpls/MBModule/dropdown.tpl'); |
|
77 | + $ajax->addSection('east2', $mod_strings['LBL_SECTION_DROPDOWNED'], $body ); |
|
78 | + echo $ajax->getJavascript(); |
|
79 | + } |
|
80 | 80 | |
81 | - function generateSmarty() |
|
82 | - { |
|
83 | - //get the selected language |
|
84 | - $selected_lang = (!empty($_REQUEST['dropdown_lang'])?$_REQUEST['dropdown_lang']:$_SESSION['authenticated_user_language']); |
|
85 | - $vardef = array(); |
|
86 | - $package_name = 'studio'; |
|
87 | - $package_strings = array(); |
|
88 | - $new =false; |
|
89 | - $my_list_strings = return_app_list_strings_language( $selected_lang ) ; |
|
81 | + function generateSmarty() |
|
82 | + { |
|
83 | + //get the selected language |
|
84 | + $selected_lang = (!empty($_REQUEST['dropdown_lang'])?$_REQUEST['dropdown_lang']:$_SESSION['authenticated_user_language']); |
|
85 | + $vardef = array(); |
|
86 | + $package_name = 'studio'; |
|
87 | + $package_strings = array(); |
|
88 | + $new =false; |
|
89 | + $my_list_strings = return_app_list_strings_language( $selected_lang ) ; |
|
90 | 90 | // $my_list_strings = $GLOBALS['app_list_strings']; |
91 | 91 | |
92 | 92 | $smarty = new Sugar_Smarty(); |
93 | 93 | |
94 | - //if we are using ModuleBuilder then process the following |
|
95 | - if(!empty($_REQUEST['view_package']) && $_REQUEST['view_package'] != 'studio'){ |
|
96 | - require_once('modules/ModuleBuilder/MB/ModuleBuilder.php'); |
|
97 | - $mb = new ModuleBuilder(); |
|
98 | - $module = $mb->getPackageModule($_REQUEST['view_package'], $_REQUEST['view_module']); |
|
99 | - $package = $mb->packages[$_REQUEST['view_package']]; |
|
100 | - $package_name = $package->name; |
|
101 | - $module->getVardefs(); |
|
102 | - if(empty($_REQUEST['dropdown_name']) && !empty($_REQUEST['field'])){ |
|
103 | - $new = true; |
|
104 | - $_REQUEST['dropdown_name'] = $_REQUEST['field']. '_list'; |
|
105 | - } |
|
94 | + //if we are using ModuleBuilder then process the following |
|
95 | + if(!empty($_REQUEST['view_package']) && $_REQUEST['view_package'] != 'studio'){ |
|
96 | + require_once('modules/ModuleBuilder/MB/ModuleBuilder.php'); |
|
97 | + $mb = new ModuleBuilder(); |
|
98 | + $module = $mb->getPackageModule($_REQUEST['view_package'], $_REQUEST['view_module']); |
|
99 | + $package = $mb->packages[$_REQUEST['view_package']]; |
|
100 | + $package_name = $package->name; |
|
101 | + $module->getVardefs(); |
|
102 | + if(empty($_REQUEST['dropdown_name']) && !empty($_REQUEST['field'])){ |
|
103 | + $new = true; |
|
104 | + $_REQUEST['dropdown_name'] = $_REQUEST['field']. '_list'; |
|
105 | + } |
|
106 | 106 | |
107 | - $vardef = (!empty($module->mbvardefs->fields[$_REQUEST['dropdown_name']]))? $module->mbvardefs->fields[$_REQUEST['dropdown_name']]: array(); |
|
108 | - $module->mblanguage->generateAppStrings(false) ; |
|
107 | + $vardef = (!empty($module->mbvardefs->fields[$_REQUEST['dropdown_name']]))? $module->mbvardefs->fields[$_REQUEST['dropdown_name']]: array(); |
|
108 | + $module->mblanguage->generateAppStrings(false) ; |
|
109 | 109 | $my_list_strings = array_merge( $my_list_strings, $module->mblanguage->appListStrings[$selected_lang.'.lang.php'] ); |
110 | 110 | $smarty->assign('module_name', $module->name); |
111 | - } |
|
111 | + } |
|
112 | 112 | |
113 | 113 | $module_name = !empty($module->name) ? $module->name : ''; |
114 | 114 | $module_name = (empty($module_name) && !empty($_REQUEST['view_module'])) ? $_REQUEST['view_module'] : $module_name; |
115 | 115 | |
116 | - foreach($my_list_strings as $key=>$value){ |
|
117 | - if(!is_array($value)){ |
|
118 | - unset($my_list_strings[$key]); |
|
119 | - } |
|
120 | - } |
|
116 | + foreach($my_list_strings as $key=>$value){ |
|
117 | + if(!is_array($value)){ |
|
118 | + unset($my_list_strings[$key]); |
|
119 | + } |
|
120 | + } |
|
121 | 121 | |
122 | - $dropdowns = array_keys($my_list_strings); |
|
123 | - asort($dropdowns); |
|
124 | - $keys = array_keys($dropdowns); |
|
125 | - $first_string = $my_list_strings[$dropdowns[$keys[0]]]; |
|
122 | + $dropdowns = array_keys($my_list_strings); |
|
123 | + asort($dropdowns); |
|
124 | + $keys = array_keys($dropdowns); |
|
125 | + $first_string = $my_list_strings[$dropdowns[$keys[0]]]; |
|
126 | 126 | |
127 | - $name = ''; |
|
128 | - $selected_dropdown = array(); |
|
127 | + $name = ''; |
|
128 | + $selected_dropdown = array(); |
|
129 | 129 | |
130 | - $json = getJSONobj(); |
|
130 | + $json = getJSONobj(); |
|
131 | 131 | |
132 | - if(!empty($_REQUEST['dropdown_name']) && !$new){ |
|
133 | - $name = $_REQUEST['dropdown_name']; |
|
132 | + if(!empty($_REQUEST['dropdown_name']) && !$new){ |
|
133 | + $name = $_REQUEST['dropdown_name']; |
|
134 | 134 | |
135 | - // handle the case where we've saved a dropdown in one language, and now attempt to edit it for another language. The $name exists, but $my_list_strings[$name] doesn't |
|
135 | + // handle the case where we've saved a dropdown in one language, and now attempt to edit it for another language. The $name exists, but $my_list_strings[$name] doesn't |
|
136 | 136 | // for now, we just treat it as if it was new. A better approach might be to use the first language version as a template for future languages |
137 | 137 | if (!isset($my_list_strings[$name])) |
138 | 138 | $my_list_strings[$name] = array () ; |
139 | 139 | |
140 | - $selected_dropdown = (!empty($vardef['options']) && !empty($my_list_strings[$vardef['options']])) ? $my_list_strings[$vardef['options']] : $my_list_strings[$name]; |
|
141 | - $smarty->assign('ul_list', 'list = '.$json->encode(array_keys($selected_dropdown))); |
|
142 | - $smarty->assign('dropdown_name', (!empty($vardef['options']) ? $vardef['options'] : $_REQUEST['dropdown_name'])); |
|
143 | - $smarty->assign('name', $_REQUEST['dropdown_name']); |
|
144 | - $smarty->assign('options', $selected_dropdown); |
|
145 | - }else{ |
|
146 | - $smarty->assign('ul_list', 'list = {}'); |
|
147 | - //we should try to find a name for this dropdown based on the field name. |
|
148 | - $pre_pop_name = ''; |
|
149 | - if(!empty($_REQUEST['field'])) |
|
150 | - $pre_pop_name = $_REQUEST['field']; |
|
151 | - //ensure this dropdown name does not already exist |
|
152 | - $use_name = $pre_pop_name.'_list'; |
|
153 | - for($i = 0; $i < 100; $i++){ |
|
154 | - if(empty($my_list_strings[$use_name])) |
|
155 | - break; |
|
156 | - else |
|
157 | - $use_name = $pre_pop_name.'_'.$i; |
|
158 | - } |
|
159 | - $smarty->assign('prepopulated_name', $use_name); |
|
160 | - } |
|
140 | + $selected_dropdown = (!empty($vardef['options']) && !empty($my_list_strings[$vardef['options']])) ? $my_list_strings[$vardef['options']] : $my_list_strings[$name]; |
|
141 | + $smarty->assign('ul_list', 'list = '.$json->encode(array_keys($selected_dropdown))); |
|
142 | + $smarty->assign('dropdown_name', (!empty($vardef['options']) ? $vardef['options'] : $_REQUEST['dropdown_name'])); |
|
143 | + $smarty->assign('name', $_REQUEST['dropdown_name']); |
|
144 | + $smarty->assign('options', $selected_dropdown); |
|
145 | + }else{ |
|
146 | + $smarty->assign('ul_list', 'list = {}'); |
|
147 | + //we should try to find a name for this dropdown based on the field name. |
|
148 | + $pre_pop_name = ''; |
|
149 | + if(!empty($_REQUEST['field'])) |
|
150 | + $pre_pop_name = $_REQUEST['field']; |
|
151 | + //ensure this dropdown name does not already exist |
|
152 | + $use_name = $pre_pop_name.'_list'; |
|
153 | + for($i = 0; $i < 100; $i++){ |
|
154 | + if(empty($my_list_strings[$use_name])) |
|
155 | + break; |
|
156 | + else |
|
157 | + $use_name = $pre_pop_name.'_'.$i; |
|
158 | + } |
|
159 | + $smarty->assign('prepopulated_name', $use_name); |
|
160 | + } |
|
161 | 161 | |
162 | - $smarty->assign('module_name', $module_name); |
|
163 | - $smarty->assign('APP', $GLOBALS['app_strings']); |
|
164 | - $smarty->assign('MOD', $GLOBALS['mod_strings']); |
|
165 | - $smarty->assign('selected_lang', $selected_lang); |
|
166 | - $smarty->assign('available_languages',get_languages()); |
|
167 | - $smarty->assign('package_name', $package_name); |
|
168 | - return $smarty; |
|
169 | - } |
|
162 | + $smarty->assign('module_name', $module_name); |
|
163 | + $smarty->assign('APP', $GLOBALS['app_strings']); |
|
164 | + $smarty->assign('MOD', $GLOBALS['mod_strings']); |
|
165 | + $smarty->assign('selected_lang', $selected_lang); |
|
166 | + $smarty->assign('available_languages',get_languages()); |
|
167 | + $smarty->assign('package_name', $package_name); |
|
168 | + return $smarty; |
|
169 | + } |
|
170 | 170 | } |
171 | 171 | \ No newline at end of file |
@@ -46,16 +46,16 @@ discard block |
||
46 | 46 | class ViewListView extends SugarView |
47 | 47 | { |
48 | 48 | /** |
49 | - * @see SugarView::_getModuleTitleParams() |
|
50 | - */ |
|
51 | - protected function _getModuleTitleParams($browserTitle = false) |
|
52 | - { |
|
53 | - global $mod_strings; |
|
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 | 61 | /* |
@@ -112,12 +112,12 @@ discard block |
||
112 | 112 | |
113 | 113 | |
114 | 114 | $labels = array ( |
115 | - MB_LISTVIEW => 'LBL_LISTVIEW' , |
|
116 | - ) ; |
|
115 | + MB_LISTVIEW => 'LBL_LISTVIEW' , |
|
116 | + ) ; |
|
117 | 117 | $translatedViewType = '' ; |
118 | - if ( isset ( $labels [ strtolower ( $this->editLayout ) ] ) ) |
|
119 | - $translatedViewType = translate ( $labels [ strtolower( $this->editLayout ) ] , 'ModuleBuilder' ) ; |
|
120 | - $this->translatedViewType = $translatedViewType; |
|
118 | + if ( isset ( $labels [ strtolower ( $this->editLayout ) ] ) ) |
|
119 | + $translatedViewType = translate ( $labels [ strtolower( $this->editLayout ) ] , 'ModuleBuilder' ) ; |
|
120 | + $this->translatedViewType = $translatedViewType; |
|
121 | 121 | |
122 | 122 | if ($this->fromModuleBuilder) |
123 | 123 | { |
@@ -198,8 +198,8 @@ discard block |
||
198 | 198 | $subRef = $subList[strtolower($this->subpanel)]; |
199 | 199 | $subTitleKey = !empty($subRef) ? $subRef : "LBL_" . strtoupper($this->subpanel) . "_SUBPANEL_TITLE"; |
200 | 200 | $subTitle = !empty($subRef) ? translate($subTitleKey, $this->editModule) : UCfirst($this->subpanel); |
201 | - $smarty->assign ( 'subpanel_label', $subTitleKey ) ; |
|
202 | - $smarty->assign ( 'subpanel_title', $subTitle ) ; |
|
201 | + $smarty->assign ( 'subpanel_label', $subTitleKey ) ; |
|
202 | + $smarty->assign ( 'subpanel_title', $subTitle ) ; |
|
203 | 203 | } |
204 | 204 | } |
205 | 205 | $helpName = $this->subpanel ? 'subPanelEditor' : 'listViewEditor'; |
@@ -321,11 +321,11 @@ discard block |
||
321 | 321 | |
322 | 322 | function _buildImageButtons ($buttons , $horizontal = true) |
323 | 323 | { |
324 | - $text = '<table cellspacing=2><tr>' ; |
|
324 | + $text = '<table cellspacing=2><tr>' ; |
|
325 | 325 | foreach ( $buttons as $button ) |
326 | 326 | { |
327 | 327 | if (empty($button['id'])) { |
328 | - $button['id'] = $button['name']; |
|
328 | + $button['id'] = $button['name']; |
|
329 | 329 | } |
330 | 330 | if (! $horizontal) |
331 | 331 | { |
@@ -68,16 +68,16 @@ discard block |
||
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
71 | - * @see SugarView::_getModuleTitleParams() |
|
72 | - */ |
|
73 | - protected function _getModuleTitleParams($browserTitle = false) |
|
74 | - { |
|
75 | - global $mod_strings; |
|
71 | + * @see SugarView::_getModuleTitleParams() |
|
72 | + */ |
|
73 | + protected function _getModuleTitleParams($browserTitle = false) |
|
74 | + { |
|
75 | + global $mod_strings; |
|
76 | 76 | |
77 | - return array( |
|
78 | - translate('LBL_MODULE_NAME','Administration'), |
|
79 | - ModuleBuilderController::getModuleTitle(), |
|
80 | - ); |
|
77 | + return array( |
|
78 | + translate('LBL_MODULE_NAME','Administration'), |
|
79 | + ModuleBuilderController::getModuleTitle(), |
|
80 | + ); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | // DO NOT REMOVE - overrides parent ViewEdit preDisplay() which attempts to load a bean for a non-existent module |
@@ -97,12 +97,12 @@ discard block |
||
97 | 97 | $smarty = $this->constructSmarty ( $parser ) ; |
98 | 98 | if ($preview) |
99 | 99 | { |
100 | - echo $smarty->fetch ( "modules/ModuleBuilder/tpls/Preview/listView.tpl" ) ; |
|
100 | + echo $smarty->fetch ( "modules/ModuleBuilder/tpls/Preview/listView.tpl" ) ; |
|
101 | 101 | } else |
102 | 102 | { |
103 | - $ajax = $this->constructAjax () ; |
|
104 | - $ajax->addSection ( 'center', translate('LBL_DASHLET'), $smarty->fetch ( "modules/ModuleBuilder/tpls/listView.tpl" ) ) ; |
|
105 | - echo $ajax->getJavascript () ; |
|
103 | + $ajax = $this->constructAjax () ; |
|
104 | + $ajax->addSection ( 'center', translate('LBL_DASHLET'), $smarty->fetch ( "modules/ModuleBuilder/tpls/listView.tpl" ) ) ; |
|
105 | + echo $ajax->getJavascript () ; |
|
106 | 106 | } |
107 | 107 | } |
108 | 108 | |
@@ -145,11 +145,11 @@ discard block |
||
145 | 145 | $helpName = (isset( $_REQUEST['view']) && $_REQUEST['view']=='dashletsearch') ? 'searchViewEditor' : 'listViewEditor'; |
146 | 146 | $smarty->assign ( 'helpName', $helpName ) ; |
147 | 147 | $smarty->assign ( 'helpDefault', 'modify' ) ; |
148 | - if ($this->fromModuleBuilder) { |
|
149 | - $mb = new ModuleBuilder ( ) ; |
|
148 | + if ($this->fromModuleBuilder) { |
|
149 | + $mb = new ModuleBuilder ( ) ; |
|
150 | 150 | $module = & $mb->getPackageModule ( $this->editPackage, $this->editModule ) ; |
151 | - $smarty->assign('current_mod_strings', $module->getModStrings()); |
|
152 | - } |
|
151 | + $smarty->assign('current_mod_strings', $module->getModStrings()); |
|
152 | + } |
|
153 | 153 | $smarty->assign ( 'title', $this->_constructTitle () ) ; |
154 | 154 | $groups = array ( ) ; |
155 | 155 | foreach ( $parser->columns as $column => $function ) |
@@ -48,60 +48,60 @@ |
||
48 | 48 | |
49 | 49 | class ViewModulelabels extends SugarView |
50 | 50 | { |
51 | - /** |
|
52 | - * @see SugarView::_getModuleTitleParams() |
|
53 | - */ |
|
54 | - protected function _getModuleTitleParams($browserTitle = false) |
|
55 | - { |
|
56 | - global $mod_strings; |
|
51 | + /** |
|
52 | + * @see SugarView::_getModuleTitleParams() |
|
53 | + */ |
|
54 | + protected function _getModuleTitleParams($browserTitle = false) |
|
55 | + { |
|
56 | + global $mod_strings; |
|
57 | 57 | |
58 | - return array( |
|
59 | - translate('LBL_MODULE_NAME','Administration'), |
|
60 | - ModuleBuilderController::getModuleTitle(), |
|
61 | - ); |
|
58 | + return array( |
|
59 | + translate('LBL_MODULE_NAME','Administration'), |
|
60 | + ModuleBuilderController::getModuleTitle(), |
|
61 | + ); |
|
62 | 62 | } |
63 | 63 | |
64 | - function display() |
|
65 | - { |
|
66 | - global $mod_strings; |
|
64 | + function display() |
|
65 | + { |
|
66 | + global $mod_strings; |
|
67 | 67 | $bak_mod_strings=$mod_strings; |
68 | - $smarty = new Sugar_Smarty(); |
|
68 | + $smarty = new Sugar_Smarty(); |
|
69 | 69 | $smarty->assign('mod_strings', $mod_strings); |
70 | - $package_name = $_REQUEST['view_package']; |
|
71 | - $module_name = $_REQUEST['view_module']; |
|
70 | + $package_name = $_REQUEST['view_package']; |
|
71 | + $module_name = $_REQUEST['view_module']; |
|
72 | 72 | |
73 | - require_once('modules/ModuleBuilder/MB/ModuleBuilder.php'); |
|
74 | - $mb = new ModuleBuilder(); |
|
75 | - $mb->getPackage($_REQUEST['view_package']); |
|
76 | - $package = $mb->packages[$_REQUEST['view_package']]; |
|
77 | - $package->getModule($module_name); |
|
78 | - $mbModule = $package->modules[$module_name]; |
|
79 | - $selected_lang = (!empty($_REQUEST['selected_lang'])?$_REQUEST['selected_lang']:$_SESSION['authenticated_user_language']); |
|
80 | - if(empty($selected_lang)){ |
|
81 | - $selected_lang = $GLOBALS['sugar_config']['default_language']; |
|
82 | - } |
|
83 | - //need to change the following to interface with MBlanguage. |
|
73 | + require_once('modules/ModuleBuilder/MB/ModuleBuilder.php'); |
|
74 | + $mb = new ModuleBuilder(); |
|
75 | + $mb->getPackage($_REQUEST['view_package']); |
|
76 | + $package = $mb->packages[$_REQUEST['view_package']]; |
|
77 | + $package->getModule($module_name); |
|
78 | + $mbModule = $package->modules[$module_name]; |
|
79 | + $selected_lang = (!empty($_REQUEST['selected_lang'])?$_REQUEST['selected_lang']:$_SESSION['authenticated_user_language']); |
|
80 | + if(empty($selected_lang)){ |
|
81 | + $selected_lang = $GLOBALS['sugar_config']['default_language']; |
|
82 | + } |
|
83 | + //need to change the following to interface with MBlanguage. |
|
84 | 84 | |
85 | 85 | $smarty->assign('MOD', $mbModule->getModStrings($selected_lang)); |
86 | - $smarty->assign('APP', $GLOBALS['app_strings']); |
|
87 | - $smarty->assign('selected_lang', $selected_lang); |
|
88 | - $smarty->assign('view_package', $package_name); |
|
89 | - $smarty->assign('view_module', $module_name); |
|
90 | - $smarty->assign('mb','1'); |
|
91 | - $smarty->assign('available_languages', get_languages()); |
|
92 | - /////////////////////////////////////////////////////////////////// |
|
93 | - ////ASSISTANT |
|
94 | - $smarty->assign('assistant',array('group'=>'module', 'key'=>'labels')); |
|
95 | - ///////////////////////////////////////////////////////////////// |
|
96 | - ////ASSISTANT |
|
86 | + $smarty->assign('APP', $GLOBALS['app_strings']); |
|
87 | + $smarty->assign('selected_lang', $selected_lang); |
|
88 | + $smarty->assign('view_package', $package_name); |
|
89 | + $smarty->assign('view_module', $module_name); |
|
90 | + $smarty->assign('mb','1'); |
|
91 | + $smarty->assign('available_languages', get_languages()); |
|
92 | + /////////////////////////////////////////////////////////////////// |
|
93 | + ////ASSISTANT |
|
94 | + $smarty->assign('assistant',array('group'=>'module', 'key'=>'labels')); |
|
95 | + ///////////////////////////////////////////////////////////////// |
|
96 | + ////ASSISTANT |
|
97 | 97 | |
98 | - $ajax = new AjaxCompose(); |
|
99 | - $ajax->addCrumb($bak_mod_strings['LBL_MODULEBUILDER'], 'ModuleBuilder.main("mb")'); |
|
100 | - $ajax->addCrumb($package_name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$package->name. '")'); |
|
98 | + $ajax = new AjaxCompose(); |
|
99 | + $ajax->addCrumb($bak_mod_strings['LBL_MODULEBUILDER'], 'ModuleBuilder.main("mb")'); |
|
100 | + $ajax->addCrumb($package_name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$package->name. '")'); |
|
101 | 101 | $ajax->addCrumb($module_name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package='.$package->name.'&view_module='. $module_name . '")'); |
102 | 102 | $ajax->addCrumb($bak_mod_strings['LBL_LABELS'], ''); |
103 | - $ajax->addSection('center', $bak_mod_strings['LBL_LABELS'],$smarty->fetch('modules/ModuleBuilder/tpls/labels.tpl')); |
|
104 | - echo $ajax->getJavascript(); |
|
105 | - } |
|
103 | + $ajax->addSection('center', $bak_mod_strings['LBL_LABELS'],$smarty->fetch('modules/ModuleBuilder/tpls/labels.tpl')); |
|
104 | + echo $ajax->getJavascript(); |
|
105 | + } |
|
106 | 106 | } |
107 | 107 |
@@ -69,16 +69,16 @@ discard block |
||
69 | 69 | } |
70 | 70 | |
71 | 71 | /** |
72 | - * @see SugarView::_getModuleTitleParams() |
|
73 | - */ |
|
74 | - protected function _getModuleTitleParams($browserTitle = false) |
|
75 | - { |
|
76 | - global $mod_strings; |
|
72 | + * @see SugarView::_getModuleTitleParams() |
|
73 | + */ |
|
74 | + protected function _getModuleTitleParams($browserTitle = false) |
|
75 | + { |
|
76 | + global $mod_strings; |
|
77 | 77 | |
78 | - return array( |
|
79 | - translate('LBL_MODULE_NAME','Administration'), |
|
80 | - ModuleBuilderController::getModuleTitle(), |
|
81 | - ); |
|
78 | + return array( |
|
79 | + translate('LBL_MODULE_NAME','Administration'), |
|
80 | + ModuleBuilderController::getModuleTitle(), |
|
81 | + ); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | // DO NOT REMOVE - overrides parent ViewEdit preDisplay() which attempts to load a bean for a non-existent module |
@@ -99,13 +99,13 @@ discard block |
||
99 | 99 | $history = $parser->getHistory () ; |
100 | 100 | $smarty = new Sugar_Smarty ( ) ; |
101 | 101 | //Add in the module we are viewing to our current mod strings |
102 | - if (! $this->fromModuleBuilder) { |
|
103 | - global $current_language; |
|
104 | - $editModStrings = return_module_language($current_language, $this->editModule); |
|
105 | - $mod_strings = sugarArrayMerge($editModStrings, $mod_strings); |
|
106 | - } |
|
102 | + if (! $this->fromModuleBuilder) { |
|
103 | + global $current_language; |
|
104 | + $editModStrings = return_module_language($current_language, $this->editModule); |
|
105 | + $mod_strings = sugarArrayMerge($editModStrings, $mod_strings); |
|
106 | + } |
|
107 | 107 | $smarty->assign('mod', $mod_strings); |
108 | - $smarty->assign('MOD', $mod_strings); |
|
108 | + $smarty->assign('MOD', $mod_strings); |
|
109 | 109 | // assign buttons |
110 | 110 | $images = array ( 'icon_save' => 'studio_save' , 'icon_publish' => 'studio_publish' , 'icon_address' => 'icon_Address' , 'icon_emailaddress' => 'icon_EmailAddress' , 'icon_phone' => 'icon_Phone' ) ; |
111 | 111 | foreach ( $images as $image => $file ) |
@@ -127,9 +127,9 @@ discard block |
||
127 | 127 | |
128 | 128 | //Check if we need to synch edit view to other layouts |
129 | 129 | if($this->editLayout == MB_DETAILVIEW || $this->editLayout == MB_QUICKCREATE){ |
130 | - $parser2 = ParserFactory::getParser(MB_EDITVIEW,$this->editModule,$this->package); |
|
130 | + $parser2 = ParserFactory::getParser(MB_EDITVIEW,$this->editModule,$this->package); |
|
131 | 131 | if($this->editLayout == MB_DETAILVIEW){ |
132 | - $disableLayout = $parser2->getSyncDetailEditViews(); |
|
132 | + $disableLayout = $parser2->getSyncDetailEditViews(); |
|
133 | 133 | } |
134 | 134 | if(!empty($_REQUEST['copyFromEditView'])){ |
135 | 135 | $editViewPanels = $parser2->convertFromCanonicalForm ( $parser2->_viewdefs [ 'panels' ] , $parser2->_fielddefs ) ; |
@@ -138,34 +138,34 @@ discard block |
||
138 | 138 | $parser->setUseTabs($parser2->getUseTabs()); |
139 | 139 | $parser->setTabDefs($parser2->getTabDefs()); |
140 | 140 | } |
141 | - } |
|
141 | + } |
|
142 | 142 | |
143 | 143 | if (! $this->fromModuleBuilder) |
144 | 144 | { |
145 | - $buttons [] = array ( |
|
145 | + $buttons [] = array ( |
|
146 | 146 | 'id' => 'saveBtn' , |
147 | 147 | 'text' => translate ( 'LBL_BTN_SAVE' ) , |
148 | 148 | 'actionScript' => "onclick='if(Studio2.checkGridLayout(\"{$this->editLayout}\")) Studio2.handleSave();'", |
149 | - 'disabled' => $disableLayout, |
|
149 | + 'disabled' => $disableLayout, |
|
150 | 150 | ) ; |
151 | 151 | $buttons [] = array ( |
152 | 152 | 'id' => 'publishBtn' , |
153 | 153 | 'text' => translate ( 'LBL_BTN_SAVEPUBLISH' ) , |
154 | 154 | 'actionScript' => "onclick='if(Studio2.checkGridLayout(\"{$this->editLayout}\")) Studio2.handlePublish();'", |
155 | - 'disabled' => $disableLayout, |
|
155 | + 'disabled' => $disableLayout, |
|
156 | 156 | ) ; |
157 | 157 | $buttons [] = array ( 'id' => 'spacer' , 'width' => '33px' ) ; |
158 | 158 | $buttons [] = array ( |
159 | - 'id' => 'historyBtn' , |
|
160 | - 'text' => translate ( 'LBL_HISTORY' ) , |
|
161 | - 'actionScript' => "onclick='ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\")'", |
|
159 | + 'id' => 'historyBtn' , |
|
160 | + 'text' => translate ( 'LBL_HISTORY' ) , |
|
161 | + 'actionScript' => "onclick='ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\")'", |
|
162 | 162 | 'disabled' => $disableLayout, |
163 | 163 | ) ; |
164 | 164 | $buttons [] = array ( |
165 | - 'id' => 'historyDefault' , |
|
166 | - 'text' => translate ( 'LBL_RESTORE_DEFAULT' ) , |
|
167 | - 'actionScript' => "onclick='ModuleBuilder.history.revert(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$history->getLast()}\", \"\")'", |
|
168 | - 'disabled' => $disableLayout, |
|
165 | + 'id' => 'historyDefault' , |
|
166 | + 'text' => translate ( 'LBL_RESTORE_DEFAULT' ) , |
|
167 | + 'actionScript' => "onclick='ModuleBuilder.history.revert(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$history->getLast()}\", \"\")'", |
|
168 | + 'disabled' => $disableLayout, |
|
169 | 169 | ) ; |
170 | 170 | } else |
171 | 171 | { |
@@ -205,15 +205,15 @@ discard block |
||
205 | 205 | foreach ( $buttons as $button ) |
206 | 206 | { |
207 | 207 | if ($button['id'] == "spacer") { |
208 | - $html .= "<td style='width:{$button['width']}'> </td>"; |
|
208 | + $html .= "<td style='width:{$button['width']}'> </td>"; |
|
209 | 209 | } else { |
210 | - $html .= "<td><input id='{$button['id']}' type='button' valign='center' class='button' style='cursor:pointer' " |
|
211 | - . "onmousedown='this.className=\"buttonOn\";return false;' onmouseup='this.className=\"button\"' " |
|
212 | - . "onmouseout='this.className=\"button\"' {$button['actionScript']} value = '{$button['text']}'" ; |
|
213 | - if(!empty($button['disabled'])){ |
|
214 | - $html .= " disabled"; |
|
215 | - } |
|
216 | - $html .= "></td>"; |
|
210 | + $html .= "<td><input id='{$button['id']}' type='button' valign='center' class='button' style='cursor:pointer' " |
|
211 | + . "onmousedown='this.className=\"buttonOn\";return false;' onmouseup='this.className=\"button\"' " |
|
212 | + . "onmouseout='this.className=\"button\"' {$button['actionScript']} value = '{$button['text']}'" ; |
|
213 | + if(!empty($button['disabled'])){ |
|
214 | + $html .= " disabled"; |
|
215 | + } |
|
216 | + $html .= "></td>"; |
|
217 | 217 | } |
218 | 218 | } |
219 | 219 | |
@@ -243,10 +243,10 @@ discard block |
||
243 | 243 | } |
244 | 244 | |
245 | 245 | $labels = array ( |
246 | - MB_EDITVIEW => 'LBL_EDITVIEW' , |
|
247 | - MB_DETAILVIEW => 'LBL_DETAILVIEW' , |
|
248 | - MB_QUICKCREATE => 'LBL_QUICKCREATE', |
|
249 | - ) ; |
|
246 | + MB_EDITVIEW => 'LBL_EDITVIEW' , |
|
247 | + MB_DETAILVIEW => 'LBL_DETAILVIEW' , |
|
248 | + MB_QUICKCREATE => 'LBL_QUICKCREATE', |
|
249 | + ) ; |
|
250 | 250 | |
251 | 251 | $layoutLabel = 'LBL_LAYOUTS' ; |
252 | 252 | $layoutView = 'layouts' ; |
@@ -255,8 +255,8 @@ discard block |
||
255 | 255 | $ajax = new AjaxCompose ( ) ; |
256 | 256 | |
257 | 257 | $translatedViewType = '' ; |
258 | - if ( isset ( $labels [ strtolower ( $this->editLayout ) ] ) ) |
|
259 | - $translatedViewType = translate ( $labels [ strtolower( $this->editLayout ) ] , 'ModuleBuilder' ) ; |
|
258 | + if ( isset ( $labels [ strtolower ( $this->editLayout ) ] ) ) |
|
259 | + $translatedViewType = translate ( $labels [ strtolower( $this->editLayout ) ] , 'ModuleBuilder' ) ; |
|
260 | 260 | else if (isset($this->sm)) |
261 | 261 | { |
262 | 262 | foreach($this->sm->sources as $file => $def) |
@@ -294,20 +294,20 @@ discard block |
||
294 | 294 | } |
295 | 295 | |
296 | 296 | // set up language files |
297 | - $smarty->assign ( 'language', $parser->getLanguage() ) ; // for sugar_translate in the smarty template |
|
297 | + $smarty->assign ( 'language', $parser->getLanguage() ) ; // for sugar_translate in the smarty template |
|
298 | 298 | $smarty->assign('from_mb',$this->fromModuleBuilder); |
299 | 299 | $smarty->assign('calc_field_list', json_encode($parser->getCalculatedFields())); |
300 | - if ($this->fromModuleBuilder) { |
|
301 | - $mb = new ModuleBuilder ( ) ; |
|
300 | + if ($this->fromModuleBuilder) { |
|
301 | + $mb = new ModuleBuilder ( ) ; |
|
302 | 302 | $module = & $mb->getPackageModule ( $this->package, $this->editModule ) ; |
303 | - $smarty->assign('current_mod_strings', $module->getModStrings()); |
|
304 | - } |
|
303 | + $smarty->assign('current_mod_strings', $module->getModStrings()); |
|
304 | + } |
|
305 | 305 | |
306 | 306 | $ajax->addSection ( 'center', $translatedViewType, $smarty->fetch ( 'modules/ModuleBuilder/tpls/layoutView.tpl' ) ) ; |
307 | 307 | if ($preview) { |
308 | - echo $smarty->fetch ( 'modules/ModuleBuilder/tpls/Preview/layoutView.tpl' ); |
|
309 | - } else { |
|
310 | - echo $ajax->getJavascript () ; |
|
311 | - } |
|
308 | + echo $smarty->fetch ( 'modules/ModuleBuilder/tpls/Preview/layoutView.tpl' ); |
|
309 | + } else { |
|
310 | + echo $ajax->getJavascript () ; |
|
311 | + } |
|
312 | 312 | } |
313 | 313 | } |
@@ -47,19 +47,19 @@ discard block |
||
47 | 47 | var $pageSize = 10 ; |
48 | 48 | |
49 | 49 | /** |
50 | - * @see SugarView::_getModuleTitleParams() |
|
51 | - */ |
|
52 | - protected function _getModuleTitleParams($browserTitle = false) |
|
53 | - { |
|
54 | - global $mod_strings; |
|
50 | + * @see SugarView::_getModuleTitleParams() |
|
51 | + */ |
|
52 | + protected function _getModuleTitleParams($browserTitle = false) |
|
53 | + { |
|
54 | + global $mod_strings; |
|
55 | 55 | |
56 | - return array( |
|
57 | - translate('LBL_MODULE_NAME','Administration'), |
|
58 | - ModuleBuilderController::getModuleTitle(), |
|
59 | - ); |
|
56 | + return array( |
|
57 | + translate('LBL_MODULE_NAME','Administration'), |
|
58 | + ModuleBuilderController::getModuleTitle(), |
|
59 | + ); |
|
60 | 60 | } |
61 | 61 | |
62 | - function display () |
|
62 | + function display () |
|
63 | 63 | { |
64 | 64 | $this->layout = strtolower ( $_REQUEST [ 'view' ] ) ; |
65 | 65 | |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | } |
136 | 136 | echo "<input type='button' name='close$sid' value='". translate ( 'LBL_BTN_CLOSE' )."' " . |
137 | 137 | "class='button' onclick='ModuleBuilder.tabPanel.removeTab(ModuleBuilder.tabPanel.get(\"activeTab\"));' style='margin:5px;'>" . |
138 | - "<input type='button' name='restore$sid' value='" . translate ( 'LBL_MB_RESTORE' ) . "' " . |
|
138 | + "<input type='button' name='restore$sid' value='" . translate ( 'LBL_MB_RESTORE' ) . "' " . |
|
139 | 139 | "class='button' onclick='ModuleBuilder.history.revert(\"$this->module\",\"{$this->layout}\",\"$sid\"$subpanel);' style='margin:5px;'>" ; |
140 | 140 | $this->history->restoreByTimestamp ( $sid ) ; |
141 | 141 | $view ; |
@@ -149,12 +149,12 @@ discard block |
||
149 | 149 | $view = new ViewSearchView ( ) ; |
150 | 150 | } else if ($this->layout == 'dashlet' || $this->layout == 'dashletsearch') |
151 | 151 | { |
152 | - require_once ("modules/ModuleBuilder/views/view.dashlet.php") ; |
|
153 | - $view = new ViewDashlet ( ) ; |
|
152 | + require_once ("modules/ModuleBuilder/views/view.dashlet.php") ; |
|
153 | + $view = new ViewDashlet ( ) ; |
|
154 | 154 | } else if ($this->layout == 'popuplist' || $this->layout == 'popupsearch') |
155 | 155 | { |
156 | - require_once ("modules/ModuleBuilder/views/view.popupview.php") ; |
|
157 | - $view = new ViewPopupview ( ) ; |
|
156 | + require_once ("modules/ModuleBuilder/views/view.popupview.php") ; |
|
157 | + $view = new ViewPopupview ( ) ; |
|
158 | 158 | } else |
159 | 159 | { |
160 | 160 | require_once ("modules/ModuleBuilder/views/view.layoutview.php") ; |
@@ -175,12 +175,12 @@ discard block |
||
175 | 175 | $this->history->restoreByTimestamp ( $sid ) ; |
176 | 176 | } |
177 | 177 | |
178 | - /** |
|
179 | - * Restores a layout to its current customized state. |
|
180 | - * Called when leaving a restored layout without saving. |
|
181 | - */ |
|
178 | + /** |
|
179 | + * Restores a layout to its current customized state. |
|
180 | + * Called when leaving a restored layout without saving. |
|
181 | + */ |
|
182 | 182 | function unrestore() |
183 | 183 | { |
184 | - $this->history->undoRestore () ; |
|
184 | + $this->history->undoRestore () ; |
|
185 | 185 | } |
186 | 186 | } |
@@ -48,73 +48,73 @@ discard block |
||
48 | 48 | class ViewLabels extends ViewModulefields |
49 | 49 | { |
50 | 50 | /** |
51 | - * @see SugarView::_getModuleTitleParams() |
|
52 | - */ |
|
53 | - protected function _getModuleTitleParams($browserTitle = false) |
|
54 | - { |
|
55 | - global $mod_strings; |
|
51 | + * @see SugarView::_getModuleTitleParams() |
|
52 | + */ |
|
53 | + protected function _getModuleTitleParams($browserTitle = false) |
|
54 | + { |
|
55 | + global $mod_strings; |
|
56 | 56 | |
57 | - return array( |
|
58 | - translate('LBL_MODULE_NAME','Administration'), |
|
59 | - ModuleBuilderController::getModuleTitle(), |
|
60 | - ); |
|
57 | + return array( |
|
58 | + translate('LBL_MODULE_NAME','Administration'), |
|
59 | + ModuleBuilderController::getModuleTitle(), |
|
60 | + ); |
|
61 | 61 | } |
62 | 62 | |
63 | - //STUDIO LABELS ONLY// |
|
64 | - //TODO Bundle Studio and ModuleBuilder label handling to increase maintainability. |
|
65 | - function display() |
|
66 | - { |
|
67 | - $editModule = $_REQUEST['view_module']; |
|
68 | - $allLabels = (!empty($_REQUEST['labels']) && $_REQUEST['labels']== 'all'); |
|
63 | + //STUDIO LABELS ONLY// |
|
64 | + //TODO Bundle Studio and ModuleBuilder label handling to increase maintainability. |
|
65 | + function display() |
|
66 | + { |
|
67 | + $editModule = $_REQUEST['view_module']; |
|
68 | + $allLabels = (!empty($_REQUEST['labels']) && $_REQUEST['labels']== 'all'); |
|
69 | 69 | |
70 | - if (!isset($_REQUEST['MB'])) |
|
71 | - { |
|
72 | - global $app_list_strings; |
|
73 | - $moduleNames = array_change_key_case($app_list_strings['moduleList']); |
|
74 | - $translatedEditModule = $moduleNames[strtolower($editModule)]; |
|
75 | - } |
|
76 | - $selected_lang = (!empty($_REQUEST['selected_lang'])? $_REQUEST['selected_lang']:$_SESSION['authenticated_user_language']); |
|
77 | - if(empty($selected_lang)){ |
|
78 | - $selected_lang = $GLOBALS['sugar_config']['default_language']; |
|
79 | - } |
|
70 | + if (!isset($_REQUEST['MB'])) |
|
71 | + { |
|
72 | + global $app_list_strings; |
|
73 | + $moduleNames = array_change_key_case($app_list_strings['moduleList']); |
|
74 | + $translatedEditModule = $moduleNames[strtolower($editModule)]; |
|
75 | + } |
|
76 | + $selected_lang = (!empty($_REQUEST['selected_lang'])? $_REQUEST['selected_lang']:$_SESSION['authenticated_user_language']); |
|
77 | + if(empty($selected_lang)){ |
|
78 | + $selected_lang = $GLOBALS['sugar_config']['default_language']; |
|
79 | + } |
|
80 | 80 | |
81 | - $smarty = new Sugar_Smarty(); |
|
82 | - global $mod_strings; |
|
81 | + $smarty = new Sugar_Smarty(); |
|
82 | + global $mod_strings; |
|
83 | 83 | $smarty->assign('mod_strings', $mod_strings); |
84 | - $smarty->assign('available_languages',get_languages()); |
|
84 | + $smarty->assign('available_languages',get_languages()); |
|
85 | 85 | |
86 | 86 | |
87 | 87 | $objectName = BeanFactory::getObjectName($editModule); |
88 | 88 | VardefManager::loadVardef($editModule, $objectName); |
89 | 89 | global $dictionary; |
90 | 90 | $vnames = array(); |
91 | - //jchi 24557 . We should list all the lables in viewdefs(list,detail,edit,quickcreate) that the user can edit them. |
|
92 | - require_once 'modules/ModuleBuilder/parsers/views/ListLayoutMetaDataParser.php' ; |
|
91 | + //jchi 24557 . We should list all the lables in viewdefs(list,detail,edit,quickcreate) that the user can edit them. |
|
92 | + require_once 'modules/ModuleBuilder/parsers/views/ListLayoutMetaDataParser.php' ; |
|
93 | 93 | $parser = new ListLayoutMetaDataParser ( MB_LISTVIEW, $editModule ) ; |
94 | 94 | foreach ( $parser->getLayout() as $key => $def ) |
95 | 95 | { |
96 | - if(isset($def['label']) ) { |
|
97 | - $vnames[$def['label']] = $def['label']; |
|
98 | - } |
|
96 | + if(isset($def['label']) ) { |
|
97 | + $vnames[$def['label']] = $def['label']; |
|
98 | + } |
|
99 | 99 | } |
100 | 100 | |
101 | - require_once 'modules/ModuleBuilder/parsers/views/GridLayoutMetaDataParser.php' ; |
|
101 | + require_once 'modules/ModuleBuilder/parsers/views/GridLayoutMetaDataParser.php' ; |
|
102 | 102 | $variableMap = $this->getVariableMap($editModule); |
103 | 103 | foreach($variableMap as $key => $value){ |
104 | - $gridLayoutMetaDataParserTemp = new GridLayoutMetaDataParser ( $value, $editModule) ; |
|
105 | - foreach ( $gridLayoutMetaDataParserTemp->getLayout() as $panel) |
|
106 | - { |
|
107 | - foreach ( $panel as $row ) |
|
108 | - { |
|
109 | - foreach ( $row as $fieldArray ) |
|
110 | - { // fieldArray is an array('name'=>name,'label'=>label) |
|
111 | - if (isset ( $fieldArray [ 'label' ] )) |
|
112 | - { |
|
113 | - $vnames[$fieldArray [ 'label' ] ] = $fieldArray [ 'label' ] ; |
|
114 | - } |
|
115 | - } |
|
116 | - } |
|
117 | - } |
|
104 | + $gridLayoutMetaDataParserTemp = new GridLayoutMetaDataParser ( $value, $editModule) ; |
|
105 | + foreach ( $gridLayoutMetaDataParserTemp->getLayout() as $panel) |
|
106 | + { |
|
107 | + foreach ( $panel as $row ) |
|
108 | + { |
|
109 | + foreach ( $row as $fieldArray ) |
|
110 | + { // fieldArray is an array('name'=>name,'label'=>label) |
|
111 | + if (isset ( $fieldArray [ 'label' ] )) |
|
112 | + { |
|
113 | + $vnames[$fieldArray [ 'label' ] ] = $fieldArray [ 'label' ] ; |
|
114 | + } |
|
115 | + } |
|
116 | + } |
|
117 | + } |
|
118 | 118 | } |
119 | 119 | //end |
120 | 120 | |
@@ -122,23 +122,23 @@ discard block |
||
122 | 122 | require_once ('include/SubPanel/SubPanel.php') ; |
123 | 123 | $subList = SubPanel::getModuleSubpanels ( $editModule ); |
124 | 124 | foreach($subList as $subpanel => $titleLabel) { |
125 | - $vnames[$titleLabel] = $titleLabel; |
|
125 | + $vnames[$titleLabel] = $titleLabel; |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | foreach($dictionary[$objectName]['fields'] as $name=>$def) { |
129 | - if(isset($def['vname'])) { |
|
130 | - $vnames[$def['vname']] = $def['vname']; |
|
131 | - } |
|
132 | - } |
|
133 | - $formatted_mod_strings = array(); |
|
129 | + if(isset($def['vname'])) { |
|
130 | + $vnames[$def['vname']] = $def['vname']; |
|
131 | + } |
|
132 | + } |
|
133 | + $formatted_mod_strings = array(); |
|
134 | 134 | |
135 | - //we shouldn't set the $refresh=true here, or will lost template language mod_strings. |
|
136 | - //return_module_language($selected_lang, $editModule,false) : the mod_strings will be included from cache files here. |
|
135 | + //we shouldn't set the $refresh=true here, or will lost template language mod_strings. |
|
136 | + //return_module_language($selected_lang, $editModule,false) : the mod_strings will be included from cache files here. |
|
137 | 137 | foreach(return_module_language($selected_lang, $editModule,false) as $name=>$label) { |
138 | - //#25294 |
|
139 | - if($allLabels || isset($vnames[$name]) || preg_match( '/lbl_city|lbl_country|lbl_billing_address|lbl_alt_address|lbl_shipping_address|lbl_postal_code|lbl_state$/si' , $name)) { |
|
138 | + //#25294 |
|
139 | + if($allLabels || isset($vnames[$name]) || preg_match( '/lbl_city|lbl_country|lbl_billing_address|lbl_alt_address|lbl_shipping_address|lbl_postal_code|lbl_state$/si' , $name)) { |
|
140 | 140 | $formatted_mod_strings[$name] = htmlentities($label, ENT_QUOTES, 'UTF-8'); |
141 | - } |
|
141 | + } |
|
142 | 142 | } |
143 | 143 | //Grab everything from the custom files |
144 | 144 | $mod_bak = $mod_strings; |
@@ -147,49 +147,49 @@ discard block |
||
147 | 147 | "custom/modules/$editModule/Ext/Language/$selected_lang.lang.ext.php" |
148 | 148 | ); |
149 | 149 | foreach($files as $langfile){ |
150 | - $mod_strings = array(); |
|
151 | - if (is_file($langfile)) |
|
152 | - { |
|
153 | - include($langfile); |
|
154 | - foreach($mod_strings as $key => $label) |
|
155 | - { |
|
150 | + $mod_strings = array(); |
|
151 | + if (is_file($langfile)) |
|
152 | + { |
|
153 | + include($langfile); |
|
154 | + foreach($mod_strings as $key => $label) |
|
155 | + { |
|
156 | 156 | $formatted_mod_strings[$key] = htmlentities($label, ENT_QUOTES, 'UTF-8'); |
157 | - } |
|
158 | - } |
|
157 | + } |
|
158 | + } |
|
159 | 159 | } |
160 | 160 | $mod_strings = $mod_bak; |
161 | 161 | ksort($formatted_mod_strings); |
162 | - $smarty->assign('MOD', $formatted_mod_strings); |
|
163 | - $smarty->assign('view_module', $editModule); |
|
164 | - $smarty->assign('APP', $GLOBALS['app_strings']); |
|
165 | - $smarty->assign('selected_lang', $selected_lang); |
|
166 | - $smarty->assign('defaultHelp', 'labelsBtn'); |
|
167 | - $smarty->assign('assistant', array('key'=>'labels', 'group'=>'module')); |
|
168 | - $smarty->assign('labels_choice', $mod_strings['labelTypes']); |
|
169 | - $smarty->assign('labels_current', $allLabels?"all":""); |
|
162 | + $smarty->assign('MOD', $formatted_mod_strings); |
|
163 | + $smarty->assign('view_module', $editModule); |
|
164 | + $smarty->assign('APP', $GLOBALS['app_strings']); |
|
165 | + $smarty->assign('selected_lang', $selected_lang); |
|
166 | + $smarty->assign('defaultHelp', 'labelsBtn'); |
|
167 | + $smarty->assign('assistant', array('key'=>'labels', 'group'=>'module')); |
|
168 | + $smarty->assign('labels_choice', $mod_strings['labelTypes']); |
|
169 | + $smarty->assign('labels_current', $allLabels?"all":""); |
|
170 | 170 | |
171 | - $ajax = new AjaxCompose(); |
|
172 | - $ajax->addCrumb($mod_strings['LBL_STUDIO'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard")'); |
|
173 | - $ajax->addCrumb($translatedEditModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module='.$editModule.'")'); |
|
174 | - $ajax->addCrumb($mod_strings['LBL_LABELS'], ''); |
|
171 | + $ajax = new AjaxCompose(); |
|
172 | + $ajax->addCrumb($mod_strings['LBL_STUDIO'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard")'); |
|
173 | + $ajax->addCrumb($translatedEditModule, 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module='.$editModule.'")'); |
|
174 | + $ajax->addCrumb($mod_strings['LBL_LABELS'], ''); |
|
175 | 175 | |
176 | - $html = $smarty->fetch('modules/ModuleBuilder/tpls/labels.tpl'); |
|
177 | - $ajax->addSection('center', $GLOBALS['mod_strings']['LBL_SECTION_EDLABELS'], $html); |
|
178 | - echo $ajax->getJavascript(); |
|
179 | - } |
|
176 | + $html = $smarty->fetch('modules/ModuleBuilder/tpls/labels.tpl'); |
|
177 | + $ajax->addSection('center', $GLOBALS['mod_strings']['LBL_SECTION_EDLABELS'], $html); |
|
178 | + echo $ajax->getJavascript(); |
|
179 | + } |
|
180 | 180 | |
181 | 181 | // fixing bug #39749: Quick Create in Studio |
182 | 182 | function getVariableMap($module) |
183 | 183 | { |
184 | 184 | $variableMap = array(MB_EDITVIEW => 'EditView', |
185 | - MB_DETAILVIEW => 'DetailView', |
|
186 | - MB_QUICKCREATE => 'QuickCreate'); |
|
185 | + MB_DETAILVIEW => 'DetailView', |
|
186 | + MB_QUICKCREATE => 'QuickCreate'); |
|
187 | 187 | |
188 | 188 | $hideQuickCreateForModules = array('KBDocuments', |
189 | - 'ProjectTask', |
|
190 | - 'Campaigns', |
|
191 | - 'Quotes', |
|
192 | - 'ProductTemplates'); |
|
189 | + 'ProjectTask', |
|
190 | + 'Campaigns', |
|
191 | + 'Quotes', |
|
192 | + 'ProductTemplates'); |
|
193 | 193 | |
194 | 194 | if(in_array($module, $hideQuickCreateForModules)) |
195 | 195 | { |
@@ -45,20 +45,20 @@ discard block |
||
45 | 45 | var $mbModule; |
46 | 46 | |
47 | 47 | /** |
48 | - * @see SugarView::_getModuleTitleParams() |
|
49 | - */ |
|
50 | - protected function _getModuleTitleParams($browserTitle = false) |
|
51 | - { |
|
52 | - global $mod_strings; |
|
48 | + * @see SugarView::_getModuleTitleParams() |
|
49 | + */ |
|
50 | + protected function _getModuleTitleParams($browserTitle = false) |
|
51 | + { |
|
52 | + global $mod_strings; |
|
53 | 53 | |
54 | - return array( |
|
55 | - translate('LBL_MODULE_NAME','Administration'), |
|
56 | - ModuleBuilderController::getModuleTitle(), |
|
57 | - ); |
|
54 | + return array( |
|
55 | + translate('LBL_MODULE_NAME','Administration'), |
|
56 | + ModuleBuilderController::getModuleTitle(), |
|
57 | + ); |
|
58 | 58 | } |
59 | 59 | |
60 | - function display() |
|
61 | - { |
|
60 | + function display() |
|
61 | + { |
|
62 | 62 | $smarty = new Sugar_Smarty(); |
63 | 63 | global $mod_strings; |
64 | 64 | $bak_mod_strings=$mod_strings; |
@@ -92,13 +92,13 @@ discard block |
||
92 | 92 | if ($this->isValidStudioField($def)) |
93 | 93 | { |
94 | 94 | $def['label'] = translate($def['vname'], $module_name); |
95 | - //Custom relate fields will have a non-db source, but custom_module set |
|
96 | - if(isset($def['source']) && $def['source'] == 'custom_fields' || isset($def['custom_module'])) { |
|
97 | - $f[$mod_strings['LBL_HCUSTOM']][$def['name']] = $def; |
|
98 | - $def['custom'] = true; |
|
95 | + //Custom relate fields will have a non-db source, but custom_module set |
|
96 | + if(isset($def['source']) && $def['source'] == 'custom_fields' || isset($def['custom_module'])) { |
|
97 | + $f[$mod_strings['LBL_HCUSTOM']][$def['name']] = $def; |
|
98 | + $def['custom'] = true; |
|
99 | 99 | } else { |
100 | - $f[$mod_strings['LBL_HDEFAULT']][$def['name']] = $def; |
|
101 | - $def['custom'] = false; |
|
100 | + $f[$mod_strings['LBL_HDEFAULT']][$def['name']] = $def; |
|
101 | + $def['custom'] = false; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | $def['type'] = isset($fieldTypes[$def['type']]) ? $fieldTypes[$def['type']] : ucfirst($def['type']); |
@@ -174,17 +174,17 @@ discard block |
||
174 | 174 | } |
175 | 175 | foreach($v as $field => $def) |
176 | 176 | { |
177 | - if (isset($loadedFields[$field])) |
|
177 | + if (isset($loadedFields[$field])) |
|
178 | 178 | { |
179 | - unset($this->mbModule->mbvardefs->vardefs['fields'][$k][$field]); |
|
179 | + unset($this->mbModule->mbvardefs->vardefs['fields'][$k][$field]); |
|
180 | 180 | } else { |
181 | - $this->mbModule->mbvardefs->vardefs['fields'][$k][$field]['label'] = isset($def['vname']) && isset($this->mbModule->mblanguage->strings[$current_language.'.lang.php'][$def['vname']]) ? $this->mbModule->mblanguage->strings[$current_language.'.lang.php'][$def['vname']] : $field; |
|
182 | - $customFieldsData[$field] = ($k == $this->mbModule->name) ? true : false; |
|
183 | - $loadedFields[$field] = true; |
|
181 | + $this->mbModule->mbvardefs->vardefs['fields'][$k][$field]['label'] = isset($def['vname']) && isset($this->mbModule->mblanguage->strings[$current_language.'.lang.php'][$def['vname']]) ? $this->mbModule->mblanguage->strings[$current_language.'.lang.php'][$def['vname']] : $field; |
|
182 | + $customFieldsData[$field] = ($k == $this->mbModule->name) ? true : false; |
|
183 | + $loadedFields[$field] = true; |
|
184 | 184 | |
185 | - $type = $this->mbModule->mbvardefs->vardefs['fields'][$k][$field]['type']; |
|
186 | - $this->mbModule->mbvardefs->vardefs['fields'][$k][$field]['type'] = isset($fieldTypes[$type]) ? $fieldTypes[$type] : ucfirst($type); |
|
187 | - $fieldsData[] = $this->mbModule->mbvardefs->vardefs['fields'][$k][$field]; |
|
185 | + $type = $this->mbModule->mbvardefs->vardefs['fields'][$k][$field]['type']; |
|
186 | + $this->mbModule->mbvardefs->vardefs['fields'][$k][$field]['type'] = isset($fieldTypes[$type]) ? $fieldTypes[$type] : ucfirst($type); |
|
187 | + $fieldsData[] = $this->mbModule->mbvardefs->vardefs['fields'][$k][$field]; |
|
188 | 188 | } |
189 | 189 | } |
190 | 190 | } |
@@ -241,29 +241,29 @@ discard block |
||
241 | 241 | function isValidStudioField( |
242 | 242 | $def |
243 | 243 | ) |
244 | - { |
|
245 | - if (isset($def['studio'])) { |
|
244 | + { |
|
245 | + if (isset($def['studio'])) { |
|
246 | 246 | if (is_array($def [ 'studio' ])) |
247 | 247 | { |
248 | - if (isset($def['studio']['editField']) && $def['studio']['editField'] == true) |
|
248 | + if (isset($def['studio']['editField']) && $def['studio']['editField'] == true) |
|
249 | 249 | return true; |
250 | - if (isset($def['studio']['required']) && $def['studio']['required']) |
|
250 | + if (isset($def['studio']['required']) && $def['studio']['required']) |
|
251 | 251 | return true; |
252 | 252 | |
253 | - } else |
|
254 | - { |
|
255 | - if ($def['studio'] == 'visible') |
|
253 | + } else |
|
254 | + { |
|
255 | + if ($def['studio'] == 'visible') |
|
256 | 256 | return true; |
257 | 257 | if ($def['studio'] == 'hidden' || $def['studio'] == 'false' || !$def['studio'] ) |
258 | 258 | return false; |
259 | 259 | } |
260 | 260 | } |
261 | - if (empty($def ['source']) || $def ['source'] == 'db' || $def ['source'] == 'custom_fields') |
|
262 | - { |
|
263 | - if ($def ['type'] != 'id' && (empty($def ['dbType']) || $def ['dbType'] != 'id')) |
|
264 | - return true; |
|
265 | - } |
|
261 | + if (empty($def ['source']) || $def ['source'] == 'db' || $def ['source'] == 'custom_fields') |
|
262 | + { |
|
263 | + if ($def ['type'] != 'id' && (empty($def ['dbType']) || $def ['dbType'] != 'id')) |
|
264 | + return true; |
|
265 | + } |
|
266 | 266 | |
267 | - return false; |
|
268 | - } |
|
267 | + return false; |
|
268 | + } |
|
269 | 269 | } |
270 | 270 | \ No newline at end of file |