@@ -45,406 +45,406 @@ |
||
| 45 | 45 | */ |
| 46 | 46 | class SubPanel |
| 47 | 47 | { |
| 48 | - var $hideNewButton = false; |
|
| 49 | - var $subpanel_id; |
|
| 50 | - var $parent_record_id; |
|
| 51 | - var $parent_module; // the name of the parent module |
|
| 52 | - var $parent_bean; // the instantiated bean of the parent |
|
| 53 | - var $template_file; |
|
| 54 | - var $linked_fields; |
|
| 55 | - var $action = 'DetailView'; |
|
| 56 | - var $show_select_button = true; |
|
| 57 | - var $subpanel_define = null; // contains the layout_def.php |
|
| 58 | - var $subpanel_defs; |
|
| 59 | - var $subpanel_query=null; |
|
| 48 | + var $hideNewButton = false; |
|
| 49 | + var $subpanel_id; |
|
| 50 | + var $parent_record_id; |
|
| 51 | + var $parent_module; // the name of the parent module |
|
| 52 | + var $parent_bean; // the instantiated bean of the parent |
|
| 53 | + var $template_file; |
|
| 54 | + var $linked_fields; |
|
| 55 | + var $action = 'DetailView'; |
|
| 56 | + var $show_select_button = true; |
|
| 57 | + var $subpanel_define = null; // contains the layout_def.php |
|
| 58 | + var $subpanel_defs; |
|
| 59 | + var $subpanel_query=null; |
|
| 60 | 60 | var $layout_def_key=''; |
| 61 | - var $search_query=''; |
|
| 62 | - var $collections = array(); |
|
| 63 | - |
|
| 64 | - function SubPanel($module, $record_id, $subpanel_id, $subpanelDef, $layout_def_key='', $collections = array() ) |
|
| 65 | - { |
|
| 66 | - global $beanList, $beanFiles, $focus, $app_strings; |
|
| 67 | - |
|
| 68 | - $this->subpanel_defs=$subpanelDef; |
|
| 69 | - $this->subpanel_id = $subpanel_id; |
|
| 70 | - $this->parent_record_id = $record_id; |
|
| 71 | - $this->parent_module = $module; |
|
| 72 | - $this->layout_def_key = $layout_def_key; |
|
| 73 | - $this->collections = $collections; |
|
| 74 | - |
|
| 75 | - $this->parent_bean = $focus; |
|
| 76 | - $result = $focus; |
|
| 77 | - |
|
| 78 | - if(empty($result)) |
|
| 79 | - { |
|
| 80 | - $parent_bean_name = $beanList[$module]; |
|
| 81 | - $parent_bean_file = $beanFiles[$parent_bean_name]; |
|
| 82 | - require_once($parent_bean_file); |
|
| 83 | - $this->parent_bean = new $parent_bean_name(); |
|
| 84 | - $this->parent_bean->retrieve($this->parent_record_id); |
|
| 85 | - $result = $this->parent_bean; |
|
| 86 | - } |
|
| 87 | - |
|
| 88 | - if($record_id!='fab4' && $result == null) |
|
| 89 | - { |
|
| 90 | - sugar_die($app_strings['ERROR_NO_RECORD']); |
|
| 91 | - } |
|
| 92 | - $this->buildSearchQuery(); |
|
| 93 | - if (empty($subpanelDef)) { |
|
| 94 | - //load the subpanel by name. |
|
| 95 | - if (!class_exists('MyClass')) { |
|
| 96 | - require_once 'include/SubPanel/SubPanelDefinitions.php' ; |
|
| 97 | - } |
|
| 98 | - $panelsdef=new SubPanelDefinitions($result,$layout_def_key); |
|
| 99 | - $subpanelDef=$panelsdef->load_subpanel($subpanel_id, false, false, $this->search_query,$collections); |
|
| 100 | - $this->subpanel_defs=$subpanelDef; |
|
| 101 | - |
|
| 102 | - } |
|
| 103 | - } |
|
| 104 | - |
|
| 105 | - function setTemplateFile($template_file) |
|
| 106 | - { |
|
| 107 | - $this->template_file = $template_file; |
|
| 108 | - } |
|
| 109 | - |
|
| 110 | - function setBeanList(&$value){ |
|
| 111 | - $this->bean_list =$value; |
|
| 112 | - } |
|
| 113 | - |
|
| 114 | - function setHideNewButton($value){ |
|
| 115 | - $this->hideNewButton = $value; |
|
| 116 | - } |
|
| 117 | - |
|
| 118 | - |
|
| 119 | - function getHeaderText( $currentModule){ |
|
| 120 | - } |
|
| 121 | - |
|
| 122 | - function get_buttons( $panel_query=null) |
|
| 123 | - { |
|
| 124 | - |
|
| 125 | - $thisPanel =& $this->subpanel_defs; |
|
| 126 | - $subpanel_def = $thisPanel->get_buttons(); |
|
| 127 | - |
|
| 128 | - if(!isset($this->listview)){ |
|
| 129 | - $this->listview = new ListView(); |
|
| 130 | - } |
|
| 131 | - $layout_manager = $this->listview->getLayoutManager(); |
|
| 132 | - $widget_contents = '<div><table cellpadding="0" cellspacing="0"><tr>'; |
|
| 133 | - foreach($subpanel_def as $widget_data) |
|
| 134 | - { |
|
| 135 | - $widget_data['action'] = $_REQUEST['action']; |
|
| 136 | - $widget_data['module'] = $thisPanel->get_inst_prop_value('module'); |
|
| 137 | - $widget_data['focus'] = $this->parent_bean; |
|
| 138 | - $widget_data['subpanel_definition'] = $thisPanel; |
|
| 139 | - $widget_contents .= '<td style="padding-right: 2px; padding-bottom: 2px;">' . "\n"; |
|
| 140 | - |
|
| 141 | - if(empty($widget_data['widget_class'])) |
|
| 142 | - { |
|
| 143 | - $widget_contents .= "widget_class not defined for top subpanel buttons"; |
|
| 144 | - } |
|
| 145 | - else |
|
| 146 | - { |
|
| 147 | - $widget_contents .= $layout_manager->widgetDisplay($widget_data); |
|
| 148 | - } |
|
| 149 | - |
|
| 150 | - $widget_contents .= '</td>'; |
|
| 151 | - } |
|
| 152 | - |
|
| 153 | - $widget_contents .= '</tr></table></div>'; |
|
| 154 | - return $widget_contents; |
|
| 155 | - } |
|
| 156 | - |
|
| 157 | - |
|
| 158 | - function ProcessSubPanelListView($xTemplatePath, &$mod_strings) |
|
| 159 | - { |
|
| 160 | - global $app_strings; |
|
| 161 | - global $current_user; |
|
| 162 | - global $sugar_config; |
|
| 163 | - |
|
| 164 | - if(isset($this->listview)){ |
|
| 165 | - $ListView =& $this->listview; |
|
| 166 | - }else{ |
|
| 167 | - $ListView = new ListView(); |
|
| 168 | - } |
|
| 169 | - $ListView->initNewXTemplate($xTemplatePath,$this->subpanel_defs->mod_strings); |
|
| 170 | - $ListView->xTemplateAssign("RETURN_URL", "&return_module=".$this->parent_module."&return_action=DetailView&return_id=".$this->parent_bean->id); |
|
| 171 | - $ListView->xTemplateAssign("RELATED_MODULE", $this->parent_module); // TODO: what about unions? |
|
| 172 | - $ListView->xTemplateAssign("RECORD_ID", $this->parent_bean->id); |
|
| 173 | - $ListView->xTemplateAssign("EDIT_INLINE_PNG", SugarThemeRegistry::current()->getImage('edit_inline','align="absmiddle" border="0"',null,null,'.gif',$app_strings['LNK_EDIT'])); |
|
| 174 | - $ListView->xTemplateAssign("DELETE_INLINE_PNG", SugarThemeRegistry::current()->getImage('delete_inline','align="absmiddle" border="0"',null,null,'.gif',$app_strings['LBL_DELETE_INLINE'])); |
|
| 175 | - $ListView->xTemplateAssign("REMOVE_INLINE_PNG", SugarThemeRegistry::current()->getImage('delete_inline','align="absmiddle" border="0"',null,null,'.gif',$app_strings['LBL_ID_FF_REMOVE'])); |
|
| 176 | - $header_text= ''; |
|
| 177 | - |
|
| 178 | - $ListView->xTemplateAssign("SUBPANEL_ID", $this->subpanel_id); |
|
| 179 | - $ListView->xTemplateAssign("SUBPANEL_SEARCH", $this->getSearchForm()); |
|
| 180 | - $display_sps = ''; |
|
| 181 | - if($this->search_query == '' && empty($this->collections)) $display_sps = 'display:none'; |
|
| 182 | - $ListView->xTemplateAssign("DISPLAY_SPS",$display_sps); |
|
| 183 | - |
|
| 184 | - if(is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])) |
|
| 185 | - { |
|
| 186 | - $exploded = explode('/', $xTemplatePath); |
|
| 187 | - $file_name = $exploded[sizeof($exploded) - 1]; |
|
| 188 | - $mod_name = $exploded[sizeof($exploded) - 2]; |
|
| 189 | - $header_text= " <a href='index.php?action=index&module=DynamicLayout&from_action=$file_name&from_module=$mod_name&mod_lang=" |
|
| 190 | - .$_REQUEST['module']."'>".SugarThemeRegistry::current()->getImage("EditLayout","border='0' align='bottom'",null,null,'.gif','Edit Layout')."</a>"; |
|
| 191 | - } |
|
| 192 | - $ListView->setHeaderTitle(''); |
|
| 193 | - $ListView->setHeaderText(''); |
|
| 194 | - |
|
| 195 | - ob_start(); |
|
| 196 | - |
|
| 197 | - $ListView->is_dynamic = true; |
|
| 198 | - $ListView->records_per_page = $sugar_config['list_max_entries_per_subpanel'] + 0; |
|
| 199 | - if (isset($this->subpanel_defs->_instance_properties['records_per_page'])) { |
|
| 200 | - $ListView->records_per_page = $this->subpanel_defs->_instance_properties['records_per_page'] + 0; |
|
| 201 | - } |
|
| 202 | - $ListView->start_link_wrapper = "javascript:showSubPanel('".$this->subpanel_id."','"; |
|
| 203 | - $ListView->subpanel_id = $this->subpanel_id; |
|
| 204 | - $ListView->end_link_wrapper = "',true);"; |
|
| 205 | - if ( !empty($this->layout_def_key) ) { |
|
| 206 | - $ListView->end_link_wrapper = '&layout_def_key='.$this->layout_def_key.$ListView->end_link_wrapper; |
|
| 207 | - } |
|
| 208 | - |
|
| 209 | - $where = ''; |
|
| 210 | - $ListView->setQuery($where, '', '', ''); |
|
| 211 | - $ListView->show_export_button = false; |
|
| 212 | - |
|
| 213 | - //function returns the query that was used to populate sub-panel data. |
|
| 214 | - |
|
| 215 | - $query=$ListView->process_dynamic_listview($this->parent_module, $this->parent_bean,$this->subpanel_defs); |
|
| 216 | - $this->subpanel_query=$query; |
|
| 217 | - $ob_contents = ob_get_contents(); |
|
| 218 | - ob_end_clean(); |
|
| 219 | - return $ob_contents; |
|
| 220 | - } |
|
| 221 | - |
|
| 222 | - function display() |
|
| 223 | - { |
|
| 224 | - $result_array = array(); |
|
| 225 | - |
|
| 226 | - $return_string = $this->ProcessSubPanelListView($this->template_file,$result_array); |
|
| 227 | - |
|
| 228 | - print $return_string; |
|
| 229 | - } |
|
| 230 | - |
|
| 231 | - function getModulesWithSubpanels() |
|
| 232 | - { |
|
| 233 | - global $beanList; |
|
| 234 | - $dir = dir('modules'); |
|
| 235 | - $modules = array(); |
|
| 236 | - while($entry = $dir->read()) |
|
| 237 | - { |
|
| 238 | - if(file_exists('modules/' . $entry . '/layout_defs.php')) |
|
| 239 | - { |
|
| 240 | - $modules[$entry] = $entry; |
|
| 241 | - } |
|
| 242 | - } |
|
| 243 | - return $modules; |
|
| 244 | - } |
|
| 245 | - |
|
| 246 | - static function getModuleSubpanels($module){ |
|
| 247 | - require_once('include/SubPanel/SubPanelDefinitions.php'); |
|
| 248 | - global $beanList, $beanFiles; |
|
| 249 | - if(!isset($beanList[$module])){ |
|
| 250 | - return array(); |
|
| 251 | - } |
|
| 252 | - |
|
| 253 | - $class = $beanList[$module]; |
|
| 254 | - require_once($beanFiles[$class]); |
|
| 255 | - $mod = new $class(); |
|
| 256 | - $spd = new SubPanelDefinitions($mod); |
|
| 257 | - $tabs = $spd->get_available_tabs(true); |
|
| 258 | - $ret_tabs = array(); |
|
| 259 | - $reject_tabs = array('history'=>1, 'activities'=>1); |
|
| 260 | - foreach($tabs as $key=>$tab){ |
|
| 261 | - foreach($tab as $k=>$v){ |
|
| 61 | + var $search_query=''; |
|
| 62 | + var $collections = array(); |
|
| 63 | + |
|
| 64 | + function SubPanel($module, $record_id, $subpanel_id, $subpanelDef, $layout_def_key='', $collections = array() ) |
|
| 65 | + { |
|
| 66 | + global $beanList, $beanFiles, $focus, $app_strings; |
|
| 67 | + |
|
| 68 | + $this->subpanel_defs=$subpanelDef; |
|
| 69 | + $this->subpanel_id = $subpanel_id; |
|
| 70 | + $this->parent_record_id = $record_id; |
|
| 71 | + $this->parent_module = $module; |
|
| 72 | + $this->layout_def_key = $layout_def_key; |
|
| 73 | + $this->collections = $collections; |
|
| 74 | + |
|
| 75 | + $this->parent_bean = $focus; |
|
| 76 | + $result = $focus; |
|
| 77 | + |
|
| 78 | + if(empty($result)) |
|
| 79 | + { |
|
| 80 | + $parent_bean_name = $beanList[$module]; |
|
| 81 | + $parent_bean_file = $beanFiles[$parent_bean_name]; |
|
| 82 | + require_once($parent_bean_file); |
|
| 83 | + $this->parent_bean = new $parent_bean_name(); |
|
| 84 | + $this->parent_bean->retrieve($this->parent_record_id); |
|
| 85 | + $result = $this->parent_bean; |
|
| 86 | + } |
|
| 87 | + |
|
| 88 | + if($record_id!='fab4' && $result == null) |
|
| 89 | + { |
|
| 90 | + sugar_die($app_strings['ERROR_NO_RECORD']); |
|
| 91 | + } |
|
| 92 | + $this->buildSearchQuery(); |
|
| 93 | + if (empty($subpanelDef)) { |
|
| 94 | + //load the subpanel by name. |
|
| 95 | + if (!class_exists('MyClass')) { |
|
| 96 | + require_once 'include/SubPanel/SubPanelDefinitions.php' ; |
|
| 97 | + } |
|
| 98 | + $panelsdef=new SubPanelDefinitions($result,$layout_def_key); |
|
| 99 | + $subpanelDef=$panelsdef->load_subpanel($subpanel_id, false, false, $this->search_query,$collections); |
|
| 100 | + $this->subpanel_defs=$subpanelDef; |
|
| 101 | + |
|
| 102 | + } |
|
| 103 | + } |
|
| 104 | + |
|
| 105 | + function setTemplateFile($template_file) |
|
| 106 | + { |
|
| 107 | + $this->template_file = $template_file; |
|
| 108 | + } |
|
| 109 | + |
|
| 110 | + function setBeanList(&$value){ |
|
| 111 | + $this->bean_list =$value; |
|
| 112 | + } |
|
| 113 | + |
|
| 114 | + function setHideNewButton($value){ |
|
| 115 | + $this->hideNewButton = $value; |
|
| 116 | + } |
|
| 117 | + |
|
| 118 | + |
|
| 119 | + function getHeaderText( $currentModule){ |
|
| 120 | + } |
|
| 121 | + |
|
| 122 | + function get_buttons( $panel_query=null) |
|
| 123 | + { |
|
| 124 | + |
|
| 125 | + $thisPanel =& $this->subpanel_defs; |
|
| 126 | + $subpanel_def = $thisPanel->get_buttons(); |
|
| 127 | + |
|
| 128 | + if(!isset($this->listview)){ |
|
| 129 | + $this->listview = new ListView(); |
|
| 130 | + } |
|
| 131 | + $layout_manager = $this->listview->getLayoutManager(); |
|
| 132 | + $widget_contents = '<div><table cellpadding="0" cellspacing="0"><tr>'; |
|
| 133 | + foreach($subpanel_def as $widget_data) |
|
| 134 | + { |
|
| 135 | + $widget_data['action'] = $_REQUEST['action']; |
|
| 136 | + $widget_data['module'] = $thisPanel->get_inst_prop_value('module'); |
|
| 137 | + $widget_data['focus'] = $this->parent_bean; |
|
| 138 | + $widget_data['subpanel_definition'] = $thisPanel; |
|
| 139 | + $widget_contents .= '<td style="padding-right: 2px; padding-bottom: 2px;">' . "\n"; |
|
| 140 | + |
|
| 141 | + if(empty($widget_data['widget_class'])) |
|
| 142 | + { |
|
| 143 | + $widget_contents .= "widget_class not defined for top subpanel buttons"; |
|
| 144 | + } |
|
| 145 | + else |
|
| 146 | + { |
|
| 147 | + $widget_contents .= $layout_manager->widgetDisplay($widget_data); |
|
| 148 | + } |
|
| 149 | + |
|
| 150 | + $widget_contents .= '</td>'; |
|
| 151 | + } |
|
| 152 | + |
|
| 153 | + $widget_contents .= '</tr></table></div>'; |
|
| 154 | + return $widget_contents; |
|
| 155 | + } |
|
| 156 | + |
|
| 157 | + |
|
| 158 | + function ProcessSubPanelListView($xTemplatePath, &$mod_strings) |
|
| 159 | + { |
|
| 160 | + global $app_strings; |
|
| 161 | + global $current_user; |
|
| 162 | + global $sugar_config; |
|
| 163 | + |
|
| 164 | + if(isset($this->listview)){ |
|
| 165 | + $ListView =& $this->listview; |
|
| 166 | + }else{ |
|
| 167 | + $ListView = new ListView(); |
|
| 168 | + } |
|
| 169 | + $ListView->initNewXTemplate($xTemplatePath,$this->subpanel_defs->mod_strings); |
|
| 170 | + $ListView->xTemplateAssign("RETURN_URL", "&return_module=".$this->parent_module."&return_action=DetailView&return_id=".$this->parent_bean->id); |
|
| 171 | + $ListView->xTemplateAssign("RELATED_MODULE", $this->parent_module); // TODO: what about unions? |
|
| 172 | + $ListView->xTemplateAssign("RECORD_ID", $this->parent_bean->id); |
|
| 173 | + $ListView->xTemplateAssign("EDIT_INLINE_PNG", SugarThemeRegistry::current()->getImage('edit_inline','align="absmiddle" border="0"',null,null,'.gif',$app_strings['LNK_EDIT'])); |
|
| 174 | + $ListView->xTemplateAssign("DELETE_INLINE_PNG", SugarThemeRegistry::current()->getImage('delete_inline','align="absmiddle" border="0"',null,null,'.gif',$app_strings['LBL_DELETE_INLINE'])); |
|
| 175 | + $ListView->xTemplateAssign("REMOVE_INLINE_PNG", SugarThemeRegistry::current()->getImage('delete_inline','align="absmiddle" border="0"',null,null,'.gif',$app_strings['LBL_ID_FF_REMOVE'])); |
|
| 176 | + $header_text= ''; |
|
| 177 | + |
|
| 178 | + $ListView->xTemplateAssign("SUBPANEL_ID", $this->subpanel_id); |
|
| 179 | + $ListView->xTemplateAssign("SUBPANEL_SEARCH", $this->getSearchForm()); |
|
| 180 | + $display_sps = ''; |
|
| 181 | + if($this->search_query == '' && empty($this->collections)) $display_sps = 'display:none'; |
|
| 182 | + $ListView->xTemplateAssign("DISPLAY_SPS",$display_sps); |
|
| 183 | + |
|
| 184 | + if(is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])) |
|
| 185 | + { |
|
| 186 | + $exploded = explode('/', $xTemplatePath); |
|
| 187 | + $file_name = $exploded[sizeof($exploded) - 1]; |
|
| 188 | + $mod_name = $exploded[sizeof($exploded) - 2]; |
|
| 189 | + $header_text= " <a href='index.php?action=index&module=DynamicLayout&from_action=$file_name&from_module=$mod_name&mod_lang=" |
|
| 190 | + .$_REQUEST['module']."'>".SugarThemeRegistry::current()->getImage("EditLayout","border='0' align='bottom'",null,null,'.gif','Edit Layout')."</a>"; |
|
| 191 | + } |
|
| 192 | + $ListView->setHeaderTitle(''); |
|
| 193 | + $ListView->setHeaderText(''); |
|
| 194 | + |
|
| 195 | + ob_start(); |
|
| 196 | + |
|
| 197 | + $ListView->is_dynamic = true; |
|
| 198 | + $ListView->records_per_page = $sugar_config['list_max_entries_per_subpanel'] + 0; |
|
| 199 | + if (isset($this->subpanel_defs->_instance_properties['records_per_page'])) { |
|
| 200 | + $ListView->records_per_page = $this->subpanel_defs->_instance_properties['records_per_page'] + 0; |
|
| 201 | + } |
|
| 202 | + $ListView->start_link_wrapper = "javascript:showSubPanel('".$this->subpanel_id."','"; |
|
| 203 | + $ListView->subpanel_id = $this->subpanel_id; |
|
| 204 | + $ListView->end_link_wrapper = "',true);"; |
|
| 205 | + if ( !empty($this->layout_def_key) ) { |
|
| 206 | + $ListView->end_link_wrapper = '&layout_def_key='.$this->layout_def_key.$ListView->end_link_wrapper; |
|
| 207 | + } |
|
| 208 | + |
|
| 209 | + $where = ''; |
|
| 210 | + $ListView->setQuery($where, '', '', ''); |
|
| 211 | + $ListView->show_export_button = false; |
|
| 212 | + |
|
| 213 | + //function returns the query that was used to populate sub-panel data. |
|
| 214 | + |
|
| 215 | + $query=$ListView->process_dynamic_listview($this->parent_module, $this->parent_bean,$this->subpanel_defs); |
|
| 216 | + $this->subpanel_query=$query; |
|
| 217 | + $ob_contents = ob_get_contents(); |
|
| 218 | + ob_end_clean(); |
|
| 219 | + return $ob_contents; |
|
| 220 | + } |
|
| 221 | + |
|
| 222 | + function display() |
|
| 223 | + { |
|
| 224 | + $result_array = array(); |
|
| 225 | + |
|
| 226 | + $return_string = $this->ProcessSubPanelListView($this->template_file,$result_array); |
|
| 227 | + |
|
| 228 | + print $return_string; |
|
| 229 | + } |
|
| 230 | + |
|
| 231 | + function getModulesWithSubpanels() |
|
| 232 | + { |
|
| 233 | + global $beanList; |
|
| 234 | + $dir = dir('modules'); |
|
| 235 | + $modules = array(); |
|
| 236 | + while($entry = $dir->read()) |
|
| 237 | + { |
|
| 238 | + if(file_exists('modules/' . $entry . '/layout_defs.php')) |
|
| 239 | + { |
|
| 240 | + $modules[$entry] = $entry; |
|
| 241 | + } |
|
| 242 | + } |
|
| 243 | + return $modules; |
|
| 244 | + } |
|
| 245 | + |
|
| 246 | + static function getModuleSubpanels($module){ |
|
| 247 | + require_once('include/SubPanel/SubPanelDefinitions.php'); |
|
| 248 | + global $beanList, $beanFiles; |
|
| 249 | + if(!isset($beanList[$module])){ |
|
| 250 | + return array(); |
|
| 251 | + } |
|
| 252 | + |
|
| 253 | + $class = $beanList[$module]; |
|
| 254 | + require_once($beanFiles[$class]); |
|
| 255 | + $mod = new $class(); |
|
| 256 | + $spd = new SubPanelDefinitions($mod); |
|
| 257 | + $tabs = $spd->get_available_tabs(true); |
|
| 258 | + $ret_tabs = array(); |
|
| 259 | + $reject_tabs = array('history'=>1, 'activities'=>1); |
|
| 260 | + foreach($tabs as $key=>$tab){ |
|
| 261 | + foreach($tab as $k=>$v){ |
|
| 262 | 262 | if (! isset ( $reject_tabs [$k] )) { |
| 263 | 263 | $ret_tabs [$k] = $v; |
| 264 | 264 | } |
| 265 | 265 | } |
| 266 | - } |
|
| 266 | + } |
|
| 267 | 267 | |
| 268 | - return $ret_tabs; |
|
| 268 | + return $ret_tabs; |
|
| 269 | 269 | |
| 270 | 270 | |
| 271 | - } |
|
| 271 | + } |
|
| 272 | 272 | |
| 273 | - //saves overrides for defs |
|
| 274 | - function saveSubPanelDefOverride( $panel, $subsection, $override){ |
|
| 275 | - global $layout_defs, $beanList; |
|
| 273 | + //saves overrides for defs |
|
| 274 | + function saveSubPanelDefOverride( $panel, $subsection, $override){ |
|
| 275 | + global $layout_defs, $beanList; |
|
| 276 | 276 | |
| 277 | - //save the new subpanel |
|
| 278 | - $name = "subpanel_layout['list_fields']"; |
|
| 277 | + //save the new subpanel |
|
| 278 | + $name = "subpanel_layout['list_fields']"; |
|
| 279 | 279 | |
| 280 | - //bugfix: load looks for moduleName/metadata/subpanels, not moduleName/subpanels |
|
| 281 | - $path = 'custom/modules/'. $panel->_instance_properties['module'] . '/metadata/subpanels'; |
|
| 280 | + //bugfix: load looks for moduleName/metadata/subpanels, not moduleName/subpanels |
|
| 281 | + $path = 'custom/modules/'. $panel->_instance_properties['module'] . '/metadata/subpanels'; |
|
| 282 | 282 | |
| 283 | - //bug# 40171: "Custom subpanels not working as expected" |
|
| 284 | - //each custom subpanel needs to have a unique custom def file |
|
| 285 | - $filename = $panel->parent_bean->object_name . "_subpanel_" . $panel->name; //bug 42262 (filename with $panel->_instance_properties['get_subpanel_data'] can create problem if had word "function" in it) |
|
| 286 | - $oldName1 = '_override' . $panel->parent_bean->object_name .$panel->_instance_properties['module'] . $panel->_instance_properties['subpanel_name'] ; |
|
| 287 | - $oldName2 = '_override' . $panel->parent_bean->object_name .$panel->_instance_properties['get_subpanel_data'] ; |
|
| 288 | - if (file_exists('custom/Extension/modules/'. $panel->parent_bean->module_dir . "/Ext/Layoutdefs/$oldName1.php")){ |
|
| 289 | - unlink('custom/Extension/modules/'. $panel->parent_bean->module_dir . "/Ext/Layoutdefs/$oldName1.php"); |
|
| 290 | - } |
|
| 291 | - if (file_exists('custom/Extension/modules/'. $panel->parent_bean->module_dir . "/Ext/Layoutdefs/$oldName2.php")){ |
|
| 292 | - unlink('custom/Extension/modules/'. $panel->parent_bean->module_dir . "/Ext/Layoutdefs/$oldName2.php"); |
|
| 293 | - } |
|
| 294 | - $extname = '_override'.$filename; |
|
| 295 | - //end of bug# 40171 |
|
| 283 | + //bug# 40171: "Custom subpanels not working as expected" |
|
| 284 | + //each custom subpanel needs to have a unique custom def file |
|
| 285 | + $filename = $panel->parent_bean->object_name . "_subpanel_" . $panel->name; //bug 42262 (filename with $panel->_instance_properties['get_subpanel_data'] can create problem if had word "function" in it) |
|
| 286 | + $oldName1 = '_override' . $panel->parent_bean->object_name .$panel->_instance_properties['module'] . $panel->_instance_properties['subpanel_name'] ; |
|
| 287 | + $oldName2 = '_override' . $panel->parent_bean->object_name .$panel->_instance_properties['get_subpanel_data'] ; |
|
| 288 | + if (file_exists('custom/Extension/modules/'. $panel->parent_bean->module_dir . "/Ext/Layoutdefs/$oldName1.php")){ |
|
| 289 | + unlink('custom/Extension/modules/'. $panel->parent_bean->module_dir . "/Ext/Layoutdefs/$oldName1.php"); |
|
| 290 | + } |
|
| 291 | + if (file_exists('custom/Extension/modules/'. $panel->parent_bean->module_dir . "/Ext/Layoutdefs/$oldName2.php")){ |
|
| 292 | + unlink('custom/Extension/modules/'. $panel->parent_bean->module_dir . "/Ext/Layoutdefs/$oldName2.php"); |
|
| 293 | + } |
|
| 294 | + $extname = '_override'.$filename; |
|
| 295 | + //end of bug# 40171 |
|
| 296 | 296 | |
| 297 | - mkdir_recursive($path, true); |
|
| 298 | - write_array_to_file( $name, $override,$path.'/' . $filename .'.php'); |
|
| 297 | + mkdir_recursive($path, true); |
|
| 298 | + write_array_to_file( $name, $override,$path.'/' . $filename .'.php'); |
|
| 299 | 299 | |
| 300 | - //save the override for the layoutdef |
|
| 300 | + //save the override for the layoutdef |
|
| 301 | 301 | //tyoung 10.12.07 pushed panel->name to lowercase to match case in subpaneldefs.php files - |
| 302 | 302 | //gave error on bad index 'module' as this override key didn't match the key in the subpaneldefs |
| 303 | - $name = "layout_defs['". $panel->parent_bean->module_dir. "']['subpanel_setup']['" .strtolower($panel->name). "']"; |
|
| 303 | + $name = "layout_defs['". $panel->parent_bean->module_dir. "']['subpanel_setup']['" .strtolower($panel->name). "']"; |
|
| 304 | 304 | // $GLOBALS['log']->debug('SubPanel.php->saveSubPanelDefOverride(): '.$name); |
| 305 | - $newValue = override_value_to_string($name, 'override_subpanel_name', $filename); |
|
| 306 | - mkdir_recursive('custom/Extension/modules/'. $panel->parent_bean->module_dir . '/Ext/Layoutdefs', true); |
|
| 307 | - $fp = sugar_fopen('custom/Extension/modules/'. $panel->parent_bean->module_dir . "/Ext/Layoutdefs/$extname.php", 'w'); |
|
| 308 | - fwrite($fp, "<?php\n//auto-generated file DO NOT EDIT\n$newValue\n?>"); |
|
| 309 | - fclose($fp); |
|
| 310 | - require_once('ModuleInstall/ModuleInstaller.php'); |
|
| 311 | - $moduleInstaller = new ModuleInstaller(); |
|
| 312 | - $moduleInstaller->silent = true; // make sure that the ModuleInstaller->log() function doesn't echo while rebuilding the layoutdefs |
|
| 313 | - $moduleInstaller->rebuild_layoutdefs(); |
|
| 314 | - if (file_exists('modules/'. $panel->parent_bean->module_dir . '/layout_defs.php')) |
|
| 315 | - include('modules/'. $panel->parent_bean->module_dir . '/layout_defs.php'); |
|
| 316 | - if (file_exists('custom/modules/'. $panel->parent_bean->module_dir . '/Ext/Layoutdefs/layoutdefs.ext.php')) |
|
| 317 | - include('custom/modules/'. $panel->parent_bean->module_dir . '/Ext/Layoutdefs/layoutdefs.ext.php'); |
|
| 318 | - } |
|
| 319 | - |
|
| 320 | - function get_subpanel_setup($module) |
|
| 321 | - { |
|
| 322 | - $subpanel_setup = ''; |
|
| 323 | - $layout_defs = get_layout_defs(); |
|
| 324 | - |
|
| 325 | - if(!empty($layout_defs) && !empty($layout_defs[$module]['subpanel_setup'])) |
|
| 326 | - { |
|
| 327 | - $subpanel_setup = $layout_defs[$module]['subpanel_setup']; |
|
| 328 | - } |
|
| 329 | - |
|
| 330 | - return $subpanel_setup; |
|
| 331 | - } |
|
| 332 | - |
|
| 333 | - /** |
|
| 334 | - * Retrieve the subpanel definition from the registered layout_defs arrays. |
|
| 335 | - */ |
|
| 336 | - function getSubPanelDefine($module, $subpanel_id) |
|
| 337 | - { |
|
| 338 | - $default_subpanel_define = SubPanel::_get_default_subpanel_define($module, $subpanel_id); |
|
| 339 | - $custom_subpanel_define = SubPanel::_get_custom_subpanel_define($module, $subpanel_id); |
|
| 340 | - |
|
| 341 | - $subpanel_define = array_merge($default_subpanel_define, $custom_subpanel_define); |
|
| 342 | - |
|
| 343 | - if(empty($subpanel_define)) |
|
| 344 | - { |
|
| 345 | - print('Could not load subpanel definition for: ' . $subpanel_id); |
|
| 346 | - } |
|
| 347 | - |
|
| 348 | - return $subpanel_define; |
|
| 349 | - } |
|
| 350 | - |
|
| 351 | - function _get_custom_subpanel_define($module, $subpanel_id) |
|
| 352 | - { |
|
| 353 | - $ret_val = array(); |
|
| 354 | - |
|
| 355 | - if($subpanel_id != '') |
|
| 356 | - { |
|
| 357 | - $layout_defs = get_layout_defs(); |
|
| 358 | - |
|
| 359 | - if(!empty($layout_defs[$module]['custom_subpanel_defines'][$subpanel_id])) |
|
| 360 | - { |
|
| 361 | - $ret_val = $layout_defs[$module]['custom_subpanel_defines'][$subpanel_id]; |
|
| 362 | - } |
|
| 363 | - } |
|
| 305 | + $newValue = override_value_to_string($name, 'override_subpanel_name', $filename); |
|
| 306 | + mkdir_recursive('custom/Extension/modules/'. $panel->parent_bean->module_dir . '/Ext/Layoutdefs', true); |
|
| 307 | + $fp = sugar_fopen('custom/Extension/modules/'. $panel->parent_bean->module_dir . "/Ext/Layoutdefs/$extname.php", 'w'); |
|
| 308 | + fwrite($fp, "<?php\n//auto-generated file DO NOT EDIT\n$newValue\n?>"); |
|
| 309 | + fclose($fp); |
|
| 310 | + require_once('ModuleInstall/ModuleInstaller.php'); |
|
| 311 | + $moduleInstaller = new ModuleInstaller(); |
|
| 312 | + $moduleInstaller->silent = true; // make sure that the ModuleInstaller->log() function doesn't echo while rebuilding the layoutdefs |
|
| 313 | + $moduleInstaller->rebuild_layoutdefs(); |
|
| 314 | + if (file_exists('modules/'. $panel->parent_bean->module_dir . '/layout_defs.php')) |
|
| 315 | + include('modules/'. $panel->parent_bean->module_dir . '/layout_defs.php'); |
|
| 316 | + if (file_exists('custom/modules/'. $panel->parent_bean->module_dir . '/Ext/Layoutdefs/layoutdefs.ext.php')) |
|
| 317 | + include('custom/modules/'. $panel->parent_bean->module_dir . '/Ext/Layoutdefs/layoutdefs.ext.php'); |
|
| 318 | + } |
|
| 319 | + |
|
| 320 | + function get_subpanel_setup($module) |
|
| 321 | + { |
|
| 322 | + $subpanel_setup = ''; |
|
| 323 | + $layout_defs = get_layout_defs(); |
|
| 324 | + |
|
| 325 | + if(!empty($layout_defs) && !empty($layout_defs[$module]['subpanel_setup'])) |
|
| 326 | + { |
|
| 327 | + $subpanel_setup = $layout_defs[$module]['subpanel_setup']; |
|
| 328 | + } |
|
| 329 | + |
|
| 330 | + return $subpanel_setup; |
|
| 331 | + } |
|
| 332 | + |
|
| 333 | + /** |
|
| 334 | + * Retrieve the subpanel definition from the registered layout_defs arrays. |
|
| 335 | + */ |
|
| 336 | + function getSubPanelDefine($module, $subpanel_id) |
|
| 337 | + { |
|
| 338 | + $default_subpanel_define = SubPanel::_get_default_subpanel_define($module, $subpanel_id); |
|
| 339 | + $custom_subpanel_define = SubPanel::_get_custom_subpanel_define($module, $subpanel_id); |
|
| 340 | + |
|
| 341 | + $subpanel_define = array_merge($default_subpanel_define, $custom_subpanel_define); |
|
| 342 | + |
|
| 343 | + if(empty($subpanel_define)) |
|
| 344 | + { |
|
| 345 | + print('Could not load subpanel definition for: ' . $subpanel_id); |
|
| 346 | + } |
|
| 347 | + |
|
| 348 | + return $subpanel_define; |
|
| 349 | + } |
|
| 350 | + |
|
| 351 | + function _get_custom_subpanel_define($module, $subpanel_id) |
|
| 352 | + { |
|
| 353 | + $ret_val = array(); |
|
| 354 | + |
|
| 355 | + if($subpanel_id != '') |
|
| 356 | + { |
|
| 357 | + $layout_defs = get_layout_defs(); |
|
| 358 | + |
|
| 359 | + if(!empty($layout_defs[$module]['custom_subpanel_defines'][$subpanel_id])) |
|
| 360 | + { |
|
| 361 | + $ret_val = $layout_defs[$module]['custom_subpanel_defines'][$subpanel_id]; |
|
| 362 | + } |
|
| 363 | + } |
|
| 364 | 364 | |
| 365 | - return $ret_val; |
|
| 366 | - } |
|
| 365 | + return $ret_val; |
|
| 366 | + } |
|
| 367 | 367 | |
| 368 | - function _get_default_subpanel_define($module, $subpanel_id) |
|
| 369 | - { |
|
| 370 | - $ret_val = array(); |
|
| 368 | + function _get_default_subpanel_define($module, $subpanel_id) |
|
| 369 | + { |
|
| 370 | + $ret_val = array(); |
|
| 371 | 371 | |
| 372 | - if($subpanel_id != '') |
|
| 373 | - { |
|
| 374 | - $layout_defs = get_layout_defs(); |
|
| 372 | + if($subpanel_id != '') |
|
| 373 | + { |
|
| 374 | + $layout_defs = get_layout_defs(); |
|
| 375 | 375 | |
| 376 | - if(!empty($layout_defs[$subpanel_id]['default_subpanel_define'])) |
|
| 377 | - { |
|
| 378 | - $ret_val = $layout_defs[$subpanel_id]['default_subpanel_define']; |
|
| 379 | - } |
|
| 380 | - } |
|
| 376 | + if(!empty($layout_defs[$subpanel_id]['default_subpanel_define'])) |
|
| 377 | + { |
|
| 378 | + $ret_val = $layout_defs[$subpanel_id]['default_subpanel_define']; |
|
| 379 | + } |
|
| 380 | + } |
|
| 381 | 381 | |
| 382 | - return $ret_val; |
|
| 383 | - } |
|
| 382 | + return $ret_val; |
|
| 383 | + } |
|
| 384 | 384 | |
| 385 | - function buildSearchQuery() |
|
| 386 | - { |
|
| 387 | - require_once('include/SubPanel/SubPanelSearchForm.php'); |
|
| 385 | + function buildSearchQuery() |
|
| 386 | + { |
|
| 387 | + require_once('include/SubPanel/SubPanelSearchForm.php'); |
|
| 388 | 388 | |
| 389 | - $module = 'Meetings'; |
|
| 389 | + $module = 'Meetings'; |
|
| 390 | 390 | |
| 391 | - $seed = new Meeting(); |
|
| 391 | + $seed = new Meeting(); |
|
| 392 | 392 | |
| 393 | - $_REQUEST['searchFormTab'] = 'basic_search'; |
|
| 394 | - $searchForm = new SubPanelSearchForm($seed, $module, $this); |
|
| 393 | + $_REQUEST['searchFormTab'] = 'basic_search'; |
|
| 394 | + $searchForm = new SubPanelSearchForm($seed, $module, $this); |
|
| 395 | 395 | |
| 396 | - $searchMetaData = $searchForm->retrieveSearchDefs($module); |
|
| 397 | - $searchForm->setup($searchMetaData['searchdefs'], $searchMetaData['searchFields'], 'SubpanelSearchFormGeneric.tpl', 'basic_search'); |
|
| 396 | + $searchMetaData = $searchForm->retrieveSearchDefs($module); |
|
| 397 | + $searchForm->setup($searchMetaData['searchdefs'], $searchMetaData['searchFields'], 'SubpanelSearchFormGeneric.tpl', 'basic_search'); |
|
| 398 | 398 | |
| 399 | - $searchForm->populateFromRequest(); |
|
| 399 | + $searchForm->populateFromRequest(); |
|
| 400 | 400 | |
| 401 | - $where_clauses = $searchForm->generateSearchWhere(true, $seed->module_dir); |
|
| 401 | + $where_clauses = $searchForm->generateSearchWhere(true, $seed->module_dir); |
|
| 402 | 402 | |
| 403 | - if (count($where_clauses) > 0 )$this->search_query = '('. implode(' ) AND ( ', $where_clauses) . ')'; |
|
| 404 | - $GLOBALS['log']->info("Subpanel Where Clause: $this->search_query"); |
|
| 403 | + if (count($where_clauses) > 0 )$this->search_query = '('. implode(' ) AND ( ', $where_clauses) . ')'; |
|
| 404 | + $GLOBALS['log']->info("Subpanel Where Clause: $this->search_query"); |
|
| 405 | 405 | |
| 406 | - return print_r($where_clauses,true); |
|
| 407 | - } |
|
| 406 | + return print_r($where_clauses,true); |
|
| 407 | + } |
|
| 408 | 408 | |
| 409 | - function get_searchdefs($module) |
|
| 410 | - { |
|
| 411 | - $thisPanel =& $this->subpanel_defs; |
|
| 412 | - $subpanel_defs = $thisPanel->_instance_properties; |
|
| 409 | + function get_searchdefs($module) |
|
| 410 | + { |
|
| 411 | + $thisPanel =& $this->subpanel_defs; |
|
| 412 | + $subpanel_defs = $thisPanel->_instance_properties; |
|
| 413 | 413 | |
| 414 | - if(isset($subpanel_defs['searchdefs'])){ |
|
| 415 | - $searchdefs[$module]['layout']['basic_search'] = $subpanel_defs['searchdefs']; |
|
| 416 | - $searchdefs[$module]['templateMeta'] = Array ('maxColumns' => 3, 'maxColumnsBasic' => 4, 'widths' => Array ( 'label' => 10, 'field' => 30 )) ; |
|
| 417 | - return $searchdefs; |
|
| 418 | - } |
|
| 414 | + if(isset($subpanel_defs['searchdefs'])){ |
|
| 415 | + $searchdefs[$module]['layout']['basic_search'] = $subpanel_defs['searchdefs']; |
|
| 416 | + $searchdefs[$module]['templateMeta'] = Array ('maxColumns' => 3, 'maxColumnsBasic' => 4, 'widths' => Array ( 'label' => 10, 'field' => 30 )) ; |
|
| 417 | + return $searchdefs; |
|
| 418 | + } |
|
| 419 | 419 | |
| 420 | - return false; |
|
| 421 | - } |
|
| 420 | + return false; |
|
| 421 | + } |
|
| 422 | 422 | |
| 423 | - function getSearchForm() |
|
| 424 | - { |
|
| 425 | - require_once('include/SubPanel/SubPanelSearchForm.php'); |
|
| 423 | + function getSearchForm() |
|
| 424 | + { |
|
| 425 | + require_once('include/SubPanel/SubPanelSearchForm.php'); |
|
| 426 | 426 | |
| 427 | - $module = 'Meetings'; |
|
| 427 | + $module = 'Meetings'; |
|
| 428 | 428 | |
| 429 | - $seed = new Meeting(); |
|
| 429 | + $seed = new Meeting(); |
|
| 430 | 430 | |
| 431 | - $searchForm = new SubPanelSearchForm($seed, $module, $this); |
|
| 431 | + $searchForm = new SubPanelSearchForm($seed, $module, $this); |
|
| 432 | 432 | |
| 433 | - $searchMetaData = $searchForm->retrieveSearchDefs($module); |
|
| 433 | + $searchMetaData = $searchForm->retrieveSearchDefs($module); |
|
| 434 | 434 | |
| 435 | - if ($subpanel_searchMetaData = $this->get_searchdefs($module)){ |
|
| 435 | + if ($subpanel_searchMetaData = $this->get_searchdefs($module)){ |
|
| 436 | 436 | |
| 437 | - $searchForm->setup($subpanel_searchMetaData, $searchMetaData['searchFields'], 'SubpanelSearchFormGeneric.tpl', 'basic_search'); |
|
| 437 | + $searchForm->setup($subpanel_searchMetaData, $searchMetaData['searchFields'], 'SubpanelSearchFormGeneric.tpl', 'basic_search'); |
|
| 438 | 438 | |
| 439 | - if(!empty($this->collections)) |
|
| 440 | - $searchForm->searchFields['collection'] = array(); |
|
| 439 | + if(!empty($this->collections)) |
|
| 440 | + $searchForm->searchFields['collection'] = array(); |
|
| 441 | 441 | |
| 442 | - $searchForm->populateFromRequest(); |
|
| 442 | + $searchForm->populateFromRequest(); |
|
| 443 | 443 | |
| 444 | - return $searchForm->display(); |
|
| 445 | - } |
|
| 444 | + return $searchForm->display(); |
|
| 445 | + } |
|
| 446 | 446 | |
| 447 | - return ''; |
|
| 448 | - } |
|
| 447 | + return ''; |
|
| 448 | + } |
|
| 449 | 449 | } |
| 450 | 450 | ?> |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 3 | 3 | /********************************************************************************* |
| 4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
| 5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -48,24 +48,24 @@ discard block |
||
| 48 | 48 | var $hideNewButton = false; |
| 49 | 49 | var $subpanel_id; |
| 50 | 50 | var $parent_record_id; |
| 51 | - var $parent_module; // the name of the parent module |
|
| 52 | - var $parent_bean; // the instantiated bean of the parent |
|
| 51 | + var $parent_module; // the name of the parent module |
|
| 52 | + var $parent_bean; // the instantiated bean of the parent |
|
| 53 | 53 | var $template_file; |
| 54 | 54 | var $linked_fields; |
| 55 | 55 | var $action = 'DetailView'; |
| 56 | 56 | var $show_select_button = true; |
| 57 | - var $subpanel_define = null; // contains the layout_def.php |
|
| 57 | + var $subpanel_define = null; // contains the layout_def.php |
|
| 58 | 58 | var $subpanel_defs; |
| 59 | - var $subpanel_query=null; |
|
| 60 | - var $layout_def_key=''; |
|
| 61 | - var $search_query=''; |
|
| 59 | + var $subpanel_query = null; |
|
| 60 | + var $layout_def_key = ''; |
|
| 61 | + var $search_query = ''; |
|
| 62 | 62 | var $collections = array(); |
| 63 | 63 | |
| 64 | - function SubPanel($module, $record_id, $subpanel_id, $subpanelDef, $layout_def_key='', $collections = array() ) |
|
| 64 | + function SubPanel($module, $record_id, $subpanel_id, $subpanelDef, $layout_def_key = '', $collections = array()) |
|
| 65 | 65 | { |
| 66 | 66 | global $beanList, $beanFiles, $focus, $app_strings; |
| 67 | 67 | |
| 68 | - $this->subpanel_defs=$subpanelDef; |
|
| 68 | + $this->subpanel_defs = $subpanelDef; |
|
| 69 | 69 | $this->subpanel_id = $subpanel_id; |
| 70 | 70 | $this->parent_record_id = $record_id; |
| 71 | 71 | $this->parent_module = $module; |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | $this->parent_bean = $focus; |
| 76 | 76 | $result = $focus; |
| 77 | 77 | |
| 78 | - if(empty($result)) |
|
| 78 | + if (empty($result)) |
|
| 79 | 79 | { |
| 80 | 80 | $parent_bean_name = $beanList[$module]; |
| 81 | 81 | $parent_bean_file = $beanFiles[$parent_bean_name]; |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | $result = $this->parent_bean; |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | - if($record_id!='fab4' && $result == null) |
|
| 88 | + if ($record_id != 'fab4' && $result == null) |
|
| 89 | 89 | { |
| 90 | 90 | sugar_die($app_strings['ERROR_NO_RECORD']); |
| 91 | 91 | } |
@@ -93,11 +93,11 @@ discard block |
||
| 93 | 93 | if (empty($subpanelDef)) { |
| 94 | 94 | //load the subpanel by name. |
| 95 | 95 | if (!class_exists('MyClass')) { |
| 96 | - require_once 'include/SubPanel/SubPanelDefinitions.php' ; |
|
| 96 | + require_once 'include/SubPanel/SubPanelDefinitions.php'; |
|
| 97 | 97 | } |
| 98 | - $panelsdef=new SubPanelDefinitions($result,$layout_def_key); |
|
| 99 | - $subpanelDef=$panelsdef->load_subpanel($subpanel_id, false, false, $this->search_query,$collections); |
|
| 100 | - $this->subpanel_defs=$subpanelDef; |
|
| 98 | + $panelsdef = new SubPanelDefinitions($result, $layout_def_key); |
|
| 99 | + $subpanelDef = $panelsdef->load_subpanel($subpanel_id, false, false, $this->search_query, $collections); |
|
| 100 | + $this->subpanel_defs = $subpanelDef; |
|
| 101 | 101 | |
| 102 | 102 | } |
| 103 | 103 | } |
@@ -107,38 +107,38 @@ discard block |
||
| 107 | 107 | $this->template_file = $template_file; |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | - function setBeanList(&$value){ |
|
| 111 | - $this->bean_list =$value; |
|
| 110 | + function setBeanList(&$value) { |
|
| 111 | + $this->bean_list = $value; |
|
| 112 | 112 | } |
| 113 | 113 | |
| 114 | - function setHideNewButton($value){ |
|
| 114 | + function setHideNewButton($value) { |
|
| 115 | 115 | $this->hideNewButton = $value; |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | |
| 119 | - function getHeaderText( $currentModule){ |
|
| 119 | + function getHeaderText($currentModule) { |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | - function get_buttons( $panel_query=null) |
|
| 122 | + function get_buttons($panel_query = null) |
|
| 123 | 123 | { |
| 124 | 124 | |
| 125 | - $thisPanel =& $this->subpanel_defs; |
|
| 125 | + $thisPanel = & $this->subpanel_defs; |
|
| 126 | 126 | $subpanel_def = $thisPanel->get_buttons(); |
| 127 | 127 | |
| 128 | - if(!isset($this->listview)){ |
|
| 128 | + if (!isset($this->listview)) { |
|
| 129 | 129 | $this->listview = new ListView(); |
| 130 | 130 | } |
| 131 | 131 | $layout_manager = $this->listview->getLayoutManager(); |
| 132 | 132 | $widget_contents = '<div><table cellpadding="0" cellspacing="0"><tr>'; |
| 133 | - foreach($subpanel_def as $widget_data) |
|
| 133 | + foreach ($subpanel_def as $widget_data) |
|
| 134 | 134 | { |
| 135 | 135 | $widget_data['action'] = $_REQUEST['action']; |
| 136 | - $widget_data['module'] = $thisPanel->get_inst_prop_value('module'); |
|
| 136 | + $widget_data['module'] = $thisPanel->get_inst_prop_value('module'); |
|
| 137 | 137 | $widget_data['focus'] = $this->parent_bean; |
| 138 | 138 | $widget_data['subpanel_definition'] = $thisPanel; |
| 139 | - $widget_contents .= '<td style="padding-right: 2px; padding-bottom: 2px;">' . "\n"; |
|
| 139 | + $widget_contents .= '<td style="padding-right: 2px; padding-bottom: 2px;">'."\n"; |
|
| 140 | 140 | |
| 141 | - if(empty($widget_data['widget_class'])) |
|
| 141 | + if (empty($widget_data['widget_class'])) |
|
| 142 | 142 | { |
| 143 | 143 | $widget_contents .= "widget_class not defined for top subpanel buttons"; |
| 144 | 144 | } |
@@ -161,33 +161,33 @@ discard block |
||
| 161 | 161 | global $current_user; |
| 162 | 162 | global $sugar_config; |
| 163 | 163 | |
| 164 | - if(isset($this->listview)){ |
|
| 165 | - $ListView =& $this->listview; |
|
| 166 | - }else{ |
|
| 164 | + if (isset($this->listview)) { |
|
| 165 | + $ListView = & $this->listview; |
|
| 166 | + } else { |
|
| 167 | 167 | $ListView = new ListView(); |
| 168 | 168 | } |
| 169 | - $ListView->initNewXTemplate($xTemplatePath,$this->subpanel_defs->mod_strings); |
|
| 169 | + $ListView->initNewXTemplate($xTemplatePath, $this->subpanel_defs->mod_strings); |
|
| 170 | 170 | $ListView->xTemplateAssign("RETURN_URL", "&return_module=".$this->parent_module."&return_action=DetailView&return_id=".$this->parent_bean->id); |
| 171 | - $ListView->xTemplateAssign("RELATED_MODULE", $this->parent_module); // TODO: what about unions? |
|
| 171 | + $ListView->xTemplateAssign("RELATED_MODULE", $this->parent_module); // TODO: what about unions? |
|
| 172 | 172 | $ListView->xTemplateAssign("RECORD_ID", $this->parent_bean->id); |
| 173 | - $ListView->xTemplateAssign("EDIT_INLINE_PNG", SugarThemeRegistry::current()->getImage('edit_inline','align="absmiddle" border="0"',null,null,'.gif',$app_strings['LNK_EDIT'])); |
|
| 174 | - $ListView->xTemplateAssign("DELETE_INLINE_PNG", SugarThemeRegistry::current()->getImage('delete_inline','align="absmiddle" border="0"',null,null,'.gif',$app_strings['LBL_DELETE_INLINE'])); |
|
| 175 | - $ListView->xTemplateAssign("REMOVE_INLINE_PNG", SugarThemeRegistry::current()->getImage('delete_inline','align="absmiddle" border="0"',null,null,'.gif',$app_strings['LBL_ID_FF_REMOVE'])); |
|
| 176 | - $header_text= ''; |
|
| 173 | + $ListView->xTemplateAssign("EDIT_INLINE_PNG", SugarThemeRegistry::current()->getImage('edit_inline', 'align="absmiddle" border="0"', null, null, '.gif', $app_strings['LNK_EDIT'])); |
|
| 174 | + $ListView->xTemplateAssign("DELETE_INLINE_PNG", SugarThemeRegistry::current()->getImage('delete_inline', 'align="absmiddle" border="0"', null, null, '.gif', $app_strings['LBL_DELETE_INLINE'])); |
|
| 175 | + $ListView->xTemplateAssign("REMOVE_INLINE_PNG", SugarThemeRegistry::current()->getImage('delete_inline', 'align="absmiddle" border="0"', null, null, '.gif', $app_strings['LBL_ID_FF_REMOVE'])); |
|
| 176 | + $header_text = ''; |
|
| 177 | 177 | |
| 178 | 178 | $ListView->xTemplateAssign("SUBPANEL_ID", $this->subpanel_id); |
| 179 | 179 | $ListView->xTemplateAssign("SUBPANEL_SEARCH", $this->getSearchForm()); |
| 180 | 180 | $display_sps = ''; |
| 181 | - if($this->search_query == '' && empty($this->collections)) $display_sps = 'display:none'; |
|
| 182 | - $ListView->xTemplateAssign("DISPLAY_SPS",$display_sps); |
|
| 181 | + if ($this->search_query == '' && empty($this->collections)) $display_sps = 'display:none'; |
|
| 182 | + $ListView->xTemplateAssign("DISPLAY_SPS", $display_sps); |
|
| 183 | 183 | |
| 184 | - if(is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])) |
|
| 184 | + if (is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])) |
|
| 185 | 185 | { |
| 186 | 186 | $exploded = explode('/', $xTemplatePath); |
| 187 | 187 | $file_name = $exploded[sizeof($exploded) - 1]; |
| 188 | - $mod_name = $exploded[sizeof($exploded) - 2]; |
|
| 189 | - $header_text= " <a href='index.php?action=index&module=DynamicLayout&from_action=$file_name&from_module=$mod_name&mod_lang=" |
|
| 190 | - .$_REQUEST['module']."'>".SugarThemeRegistry::current()->getImage("EditLayout","border='0' align='bottom'",null,null,'.gif','Edit Layout')."</a>"; |
|
| 188 | + $mod_name = $exploded[sizeof($exploded) - 2]; |
|
| 189 | + $header_text = " <a href='index.php?action=index&module=DynamicLayout&from_action=$file_name&from_module=$mod_name&mod_lang=" |
|
| 190 | + .$_REQUEST['module']."'>".SugarThemeRegistry::current()->getImage("EditLayout", "border='0' align='bottom'", null, null, '.gif', 'Edit Layout')."</a>"; |
|
| 191 | 191 | } |
| 192 | 192 | $ListView->setHeaderTitle(''); |
| 193 | 193 | $ListView->setHeaderText(''); |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | $ListView->start_link_wrapper = "javascript:showSubPanel('".$this->subpanel_id."','"; |
| 203 | 203 | $ListView->subpanel_id = $this->subpanel_id; |
| 204 | 204 | $ListView->end_link_wrapper = "',true);"; |
| 205 | - if ( !empty($this->layout_def_key) ) { |
|
| 205 | + if (!empty($this->layout_def_key)) { |
|
| 206 | 206 | $ListView->end_link_wrapper = '&layout_def_key='.$this->layout_def_key.$ListView->end_link_wrapper; |
| 207 | 207 | } |
| 208 | 208 | |
@@ -212,8 +212,8 @@ discard block |
||
| 212 | 212 | |
| 213 | 213 | //function returns the query that was used to populate sub-panel data. |
| 214 | 214 | |
| 215 | - $query=$ListView->process_dynamic_listview($this->parent_module, $this->parent_bean,$this->subpanel_defs); |
|
| 216 | - $this->subpanel_query=$query; |
|
| 215 | + $query = $ListView->process_dynamic_listview($this->parent_module, $this->parent_bean, $this->subpanel_defs); |
|
| 216 | + $this->subpanel_query = $query; |
|
| 217 | 217 | $ob_contents = ob_get_contents(); |
| 218 | 218 | ob_end_clean(); |
| 219 | 219 | return $ob_contents; |
@@ -223,7 +223,7 @@ discard block |
||
| 223 | 223 | { |
| 224 | 224 | $result_array = array(); |
| 225 | 225 | |
| 226 | - $return_string = $this->ProcessSubPanelListView($this->template_file,$result_array); |
|
| 226 | + $return_string = $this->ProcessSubPanelListView($this->template_file, $result_array); |
|
| 227 | 227 | |
| 228 | 228 | print $return_string; |
| 229 | 229 | } |
@@ -233,9 +233,9 @@ discard block |
||
| 233 | 233 | global $beanList; |
| 234 | 234 | $dir = dir('modules'); |
| 235 | 235 | $modules = array(); |
| 236 | - while($entry = $dir->read()) |
|
| 236 | + while ($entry = $dir->read()) |
|
| 237 | 237 | { |
| 238 | - if(file_exists('modules/' . $entry . '/layout_defs.php')) |
|
| 238 | + if (file_exists('modules/'.$entry.'/layout_defs.php')) |
|
| 239 | 239 | { |
| 240 | 240 | $modules[$entry] = $entry; |
| 241 | 241 | } |
@@ -243,10 +243,10 @@ discard block |
||
| 243 | 243 | return $modules; |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | - static function getModuleSubpanels($module){ |
|
| 246 | + static function getModuleSubpanels($module) { |
|
| 247 | 247 | require_once('include/SubPanel/SubPanelDefinitions.php'); |
| 248 | 248 | global $beanList, $beanFiles; |
| 249 | - if(!isset($beanList[$module])){ |
|
| 249 | + if (!isset($beanList[$module])) { |
|
| 250 | 250 | return array(); |
| 251 | 251 | } |
| 252 | 252 | |
@@ -257,9 +257,9 @@ discard block |
||
| 257 | 257 | $tabs = $spd->get_available_tabs(true); |
| 258 | 258 | $ret_tabs = array(); |
| 259 | 259 | $reject_tabs = array('history'=>1, 'activities'=>1); |
| 260 | - foreach($tabs as $key=>$tab){ |
|
| 261 | - foreach($tab as $k=>$v){ |
|
| 262 | - if (! isset ( $reject_tabs [$k] )) { |
|
| 260 | + foreach ($tabs as $key=>$tab) { |
|
| 261 | + foreach ($tab as $k=>$v) { |
|
| 262 | + if (!isset ($reject_tabs [$k])) { |
|
| 263 | 263 | $ret_tabs [$k] = $v; |
| 264 | 264 | } |
| 265 | 265 | } |
@@ -271,50 +271,50 @@ discard block |
||
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | //saves overrides for defs |
| 274 | - function saveSubPanelDefOverride( $panel, $subsection, $override){ |
|
| 274 | + function saveSubPanelDefOverride($panel, $subsection, $override) { |
|
| 275 | 275 | global $layout_defs, $beanList; |
| 276 | 276 | |
| 277 | 277 | //save the new subpanel |
| 278 | 278 | $name = "subpanel_layout['list_fields']"; |
| 279 | 279 | |
| 280 | 280 | //bugfix: load looks for moduleName/metadata/subpanels, not moduleName/subpanels |
| 281 | - $path = 'custom/modules/'. $panel->_instance_properties['module'] . '/metadata/subpanels'; |
|
| 281 | + $path = 'custom/modules/'.$panel->_instance_properties['module'].'/metadata/subpanels'; |
|
| 282 | 282 | |
| 283 | 283 | //bug# 40171: "Custom subpanels not working as expected" |
| 284 | 284 | //each custom subpanel needs to have a unique custom def file |
| 285 | - $filename = $panel->parent_bean->object_name . "_subpanel_" . $panel->name; //bug 42262 (filename with $panel->_instance_properties['get_subpanel_data'] can create problem if had word "function" in it) |
|
| 286 | - $oldName1 = '_override' . $panel->parent_bean->object_name .$panel->_instance_properties['module'] . $panel->_instance_properties['subpanel_name'] ; |
|
| 287 | - $oldName2 = '_override' . $panel->parent_bean->object_name .$panel->_instance_properties['get_subpanel_data'] ; |
|
| 288 | - if (file_exists('custom/Extension/modules/'. $panel->parent_bean->module_dir . "/Ext/Layoutdefs/$oldName1.php")){ |
|
| 289 | - unlink('custom/Extension/modules/'. $panel->parent_bean->module_dir . "/Ext/Layoutdefs/$oldName1.php"); |
|
| 285 | + $filename = $panel->parent_bean->object_name."_subpanel_".$panel->name; //bug 42262 (filename with $panel->_instance_properties['get_subpanel_data'] can create problem if had word "function" in it) |
|
| 286 | + $oldName1 = '_override'.$panel->parent_bean->object_name.$panel->_instance_properties['module'].$panel->_instance_properties['subpanel_name']; |
|
| 287 | + $oldName2 = '_override'.$panel->parent_bean->object_name.$panel->_instance_properties['get_subpanel_data']; |
|
| 288 | + if (file_exists('custom/Extension/modules/'.$panel->parent_bean->module_dir."/Ext/Layoutdefs/$oldName1.php")) { |
|
| 289 | + unlink('custom/Extension/modules/'.$panel->parent_bean->module_dir."/Ext/Layoutdefs/$oldName1.php"); |
|
| 290 | 290 | } |
| 291 | - if (file_exists('custom/Extension/modules/'. $panel->parent_bean->module_dir . "/Ext/Layoutdefs/$oldName2.php")){ |
|
| 292 | - unlink('custom/Extension/modules/'. $panel->parent_bean->module_dir . "/Ext/Layoutdefs/$oldName2.php"); |
|
| 291 | + if (file_exists('custom/Extension/modules/'.$panel->parent_bean->module_dir."/Ext/Layoutdefs/$oldName2.php")) { |
|
| 292 | + unlink('custom/Extension/modules/'.$panel->parent_bean->module_dir."/Ext/Layoutdefs/$oldName2.php"); |
|
| 293 | 293 | } |
| 294 | 294 | $extname = '_override'.$filename; |
| 295 | 295 | //end of bug# 40171 |
| 296 | 296 | |
| 297 | 297 | mkdir_recursive($path, true); |
| 298 | - write_array_to_file( $name, $override,$path.'/' . $filename .'.php'); |
|
| 298 | + write_array_to_file($name, $override, $path.'/'.$filename.'.php'); |
|
| 299 | 299 | |
| 300 | 300 | //save the override for the layoutdef |
| 301 | 301 | //tyoung 10.12.07 pushed panel->name to lowercase to match case in subpaneldefs.php files - |
| 302 | 302 | //gave error on bad index 'module' as this override key didn't match the key in the subpaneldefs |
| 303 | - $name = "layout_defs['". $panel->parent_bean->module_dir. "']['subpanel_setup']['" .strtolower($panel->name). "']"; |
|
| 303 | + $name = "layout_defs['".$panel->parent_bean->module_dir."']['subpanel_setup']['".strtolower($panel->name)."']"; |
|
| 304 | 304 | // $GLOBALS['log']->debug('SubPanel.php->saveSubPanelDefOverride(): '.$name); |
| 305 | 305 | $newValue = override_value_to_string($name, 'override_subpanel_name', $filename); |
| 306 | - mkdir_recursive('custom/Extension/modules/'. $panel->parent_bean->module_dir . '/Ext/Layoutdefs', true); |
|
| 307 | - $fp = sugar_fopen('custom/Extension/modules/'. $panel->parent_bean->module_dir . "/Ext/Layoutdefs/$extname.php", 'w'); |
|
| 306 | + mkdir_recursive('custom/Extension/modules/'.$panel->parent_bean->module_dir.'/Ext/Layoutdefs', true); |
|
| 307 | + $fp = sugar_fopen('custom/Extension/modules/'.$panel->parent_bean->module_dir."/Ext/Layoutdefs/$extname.php", 'w'); |
|
| 308 | 308 | fwrite($fp, "<?php\n//auto-generated file DO NOT EDIT\n$newValue\n?>"); |
| 309 | 309 | fclose($fp); |
| 310 | 310 | require_once('ModuleInstall/ModuleInstaller.php'); |
| 311 | 311 | $moduleInstaller = new ModuleInstaller(); |
| 312 | 312 | $moduleInstaller->silent = true; // make sure that the ModuleInstaller->log() function doesn't echo while rebuilding the layoutdefs |
| 313 | 313 | $moduleInstaller->rebuild_layoutdefs(); |
| 314 | - if (file_exists('modules/'. $panel->parent_bean->module_dir . '/layout_defs.php')) |
|
| 315 | - include('modules/'. $panel->parent_bean->module_dir . '/layout_defs.php'); |
|
| 316 | - if (file_exists('custom/modules/'. $panel->parent_bean->module_dir . '/Ext/Layoutdefs/layoutdefs.ext.php')) |
|
| 317 | - include('custom/modules/'. $panel->parent_bean->module_dir . '/Ext/Layoutdefs/layoutdefs.ext.php'); |
|
| 314 | + if (file_exists('modules/'.$panel->parent_bean->module_dir.'/layout_defs.php')) |
|
| 315 | + include('modules/'.$panel->parent_bean->module_dir.'/layout_defs.php'); |
|
| 316 | + if (file_exists('custom/modules/'.$panel->parent_bean->module_dir.'/Ext/Layoutdefs/layoutdefs.ext.php')) |
|
| 317 | + include('custom/modules/'.$panel->parent_bean->module_dir.'/Ext/Layoutdefs/layoutdefs.ext.php'); |
|
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 | function get_subpanel_setup($module) |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | $subpanel_setup = ''; |
| 323 | 323 | $layout_defs = get_layout_defs(); |
| 324 | 324 | |
| 325 | - if(!empty($layout_defs) && !empty($layout_defs[$module]['subpanel_setup'])) |
|
| 325 | + if (!empty($layout_defs) && !empty($layout_defs[$module]['subpanel_setup'])) |
|
| 326 | 326 | { |
| 327 | 327 | $subpanel_setup = $layout_defs[$module]['subpanel_setup']; |
| 328 | 328 | } |
@@ -340,9 +340,9 @@ discard block |
||
| 340 | 340 | |
| 341 | 341 | $subpanel_define = array_merge($default_subpanel_define, $custom_subpanel_define); |
| 342 | 342 | |
| 343 | - if(empty($subpanel_define)) |
|
| 343 | + if (empty($subpanel_define)) |
|
| 344 | 344 | { |
| 345 | - print('Could not load subpanel definition for: ' . $subpanel_id); |
|
| 345 | + print('Could not load subpanel definition for: '.$subpanel_id); |
|
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | return $subpanel_define; |
@@ -352,11 +352,11 @@ discard block |
||
| 352 | 352 | { |
| 353 | 353 | $ret_val = array(); |
| 354 | 354 | |
| 355 | - if($subpanel_id != '') |
|
| 355 | + if ($subpanel_id != '') |
|
| 356 | 356 | { |
| 357 | 357 | $layout_defs = get_layout_defs(); |
| 358 | 358 | |
| 359 | - if(!empty($layout_defs[$module]['custom_subpanel_defines'][$subpanel_id])) |
|
| 359 | + if (!empty($layout_defs[$module]['custom_subpanel_defines'][$subpanel_id])) |
|
| 360 | 360 | { |
| 361 | 361 | $ret_val = $layout_defs[$module]['custom_subpanel_defines'][$subpanel_id]; |
| 362 | 362 | } |
@@ -369,11 +369,11 @@ discard block |
||
| 369 | 369 | { |
| 370 | 370 | $ret_val = array(); |
| 371 | 371 | |
| 372 | - if($subpanel_id != '') |
|
| 372 | + if ($subpanel_id != '') |
|
| 373 | 373 | { |
| 374 | 374 | $layout_defs = get_layout_defs(); |
| 375 | 375 | |
| 376 | - if(!empty($layout_defs[$subpanel_id]['default_subpanel_define'])) |
|
| 376 | + if (!empty($layout_defs[$subpanel_id]['default_subpanel_define'])) |
|
| 377 | 377 | { |
| 378 | 378 | $ret_val = $layout_defs[$subpanel_id]['default_subpanel_define']; |
| 379 | 379 | } |
@@ -400,20 +400,20 @@ discard block |
||
| 400 | 400 | |
| 401 | 401 | $where_clauses = $searchForm->generateSearchWhere(true, $seed->module_dir); |
| 402 | 402 | |
| 403 | - if (count($where_clauses) > 0 )$this->search_query = '('. implode(' ) AND ( ', $where_clauses) . ')'; |
|
| 403 | + if (count($where_clauses) > 0)$this->search_query = '('.implode(' ) AND ( ', $where_clauses).')'; |
|
| 404 | 404 | $GLOBALS['log']->info("Subpanel Where Clause: $this->search_query"); |
| 405 | 405 | |
| 406 | - return print_r($where_clauses,true); |
|
| 406 | + return print_r($where_clauses, true); |
|
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 | function get_searchdefs($module) |
| 410 | 410 | { |
| 411 | - $thisPanel =& $this->subpanel_defs; |
|
| 411 | + $thisPanel = & $this->subpanel_defs; |
|
| 412 | 412 | $subpanel_defs = $thisPanel->_instance_properties; |
| 413 | 413 | |
| 414 | - if(isset($subpanel_defs['searchdefs'])){ |
|
| 414 | + if (isset($subpanel_defs['searchdefs'])) { |
|
| 415 | 415 | $searchdefs[$module]['layout']['basic_search'] = $subpanel_defs['searchdefs']; |
| 416 | - $searchdefs[$module]['templateMeta'] = Array ('maxColumns' => 3, 'maxColumnsBasic' => 4, 'widths' => Array ( 'label' => 10, 'field' => 30 )) ; |
|
| 416 | + $searchdefs[$module]['templateMeta'] = Array('maxColumns' => 3, 'maxColumnsBasic' => 4, 'widths' => Array('label' => 10, 'field' => 30)); |
|
| 417 | 417 | return $searchdefs; |
| 418 | 418 | } |
| 419 | 419 | |
@@ -432,11 +432,11 @@ discard block |
||
| 432 | 432 | |
| 433 | 433 | $searchMetaData = $searchForm->retrieveSearchDefs($module); |
| 434 | 434 | |
| 435 | - if ($subpanel_searchMetaData = $this->get_searchdefs($module)){ |
|
| 435 | + if ($subpanel_searchMetaData = $this->get_searchdefs($module)) { |
|
| 436 | 436 | |
| 437 | 437 | $searchForm->setup($subpanel_searchMetaData, $searchMetaData['searchFields'], 'SubpanelSearchFormGeneric.tpl', 'basic_search'); |
| 438 | 438 | |
| 439 | - if(!empty($this->collections)) |
|
| 439 | + if (!empty($this->collections)) |
|
| 440 | 440 | $searchForm->searchFields['collection'] = array(); |
| 441 | 441 | |
| 442 | 442 | $searchForm->populateFromRequest(); |
@@ -1,5 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
| 3 | + die('Not A Valid Entry Point'); |
|
| 4 | +} |
|
| 3 | 5 | /********************************************************************************* |
| 4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
| 5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -141,8 +143,7 @@ discard block |
||
| 141 | 143 | if(empty($widget_data['widget_class'])) |
| 142 | 144 | { |
| 143 | 145 | $widget_contents .= "widget_class not defined for top subpanel buttons"; |
| 144 | - } |
|
| 145 | - else |
|
| 146 | + } else |
|
| 146 | 147 | { |
| 147 | 148 | $widget_contents .= $layout_manager->widgetDisplay($widget_data); |
| 148 | 149 | } |
@@ -163,7 +164,7 @@ discard block |
||
| 163 | 164 | |
| 164 | 165 | if(isset($this->listview)){ |
| 165 | 166 | $ListView =& $this->listview; |
| 166 | - }else{ |
|
| 167 | + } else{ |
|
| 167 | 168 | $ListView = new ListView(); |
| 168 | 169 | } |
| 169 | 170 | $ListView->initNewXTemplate($xTemplatePath,$this->subpanel_defs->mod_strings); |
@@ -178,7 +179,9 @@ discard block |
||
| 178 | 179 | $ListView->xTemplateAssign("SUBPANEL_ID", $this->subpanel_id); |
| 179 | 180 | $ListView->xTemplateAssign("SUBPANEL_SEARCH", $this->getSearchForm()); |
| 180 | 181 | $display_sps = ''; |
| 181 | - if($this->search_query == '' && empty($this->collections)) $display_sps = 'display:none'; |
|
| 182 | + if($this->search_query == '' && empty($this->collections)) { |
|
| 183 | + $display_sps = 'display:none'; |
|
| 184 | + } |
|
| 182 | 185 | $ListView->xTemplateAssign("DISPLAY_SPS",$display_sps); |
| 183 | 186 | |
| 184 | 187 | if(is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])) |
@@ -311,10 +314,12 @@ discard block |
||
| 311 | 314 | $moduleInstaller = new ModuleInstaller(); |
| 312 | 315 | $moduleInstaller->silent = true; // make sure that the ModuleInstaller->log() function doesn't echo while rebuilding the layoutdefs |
| 313 | 316 | $moduleInstaller->rebuild_layoutdefs(); |
| 314 | - if (file_exists('modules/'. $panel->parent_bean->module_dir . '/layout_defs.php')) |
|
| 315 | - include('modules/'. $panel->parent_bean->module_dir . '/layout_defs.php'); |
|
| 316 | - if (file_exists('custom/modules/'. $panel->parent_bean->module_dir . '/Ext/Layoutdefs/layoutdefs.ext.php')) |
|
| 317 | - include('custom/modules/'. $panel->parent_bean->module_dir . '/Ext/Layoutdefs/layoutdefs.ext.php'); |
|
| 317 | + if (file_exists('modules/'. $panel->parent_bean->module_dir . '/layout_defs.php')) { |
|
| 318 | + include('modules/'. $panel->parent_bean->module_dir . '/layout_defs.php'); |
|
| 319 | + } |
|
| 320 | + if (file_exists('custom/modules/'. $panel->parent_bean->module_dir . '/Ext/Layoutdefs/layoutdefs.ext.php')) { |
|
| 321 | + include('custom/modules/'. $panel->parent_bean->module_dir . '/Ext/Layoutdefs/layoutdefs.ext.php'); |
|
| 322 | + } |
|
| 318 | 323 | } |
| 319 | 324 | |
| 320 | 325 | function get_subpanel_setup($module) |
@@ -400,7 +405,9 @@ discard block |
||
| 400 | 405 | |
| 401 | 406 | $where_clauses = $searchForm->generateSearchWhere(true, $seed->module_dir); |
| 402 | 407 | |
| 403 | - if (count($where_clauses) > 0 )$this->search_query = '('. implode(' ) AND ( ', $where_clauses) . ')'; |
|
| 408 | + if (count($where_clauses) > 0 ) { |
|
| 409 | + $this->search_query = '('. implode(' ) AND ( ', $where_clauses) . ')'; |
|
| 410 | + } |
|
| 404 | 411 | $GLOBALS['log']->info("Subpanel Where Clause: $this->search_query"); |
| 405 | 412 | |
| 406 | 413 | return print_r($where_clauses,true); |
@@ -436,8 +443,9 @@ discard block |
||
| 436 | 443 | |
| 437 | 444 | $searchForm->setup($subpanel_searchMetaData, $searchMetaData['searchFields'], 'SubpanelSearchFormGeneric.tpl', 'basic_search'); |
| 438 | 445 | |
| 439 | - if(!empty($this->collections)) |
|
| 440 | - $searchForm->searchFields['collection'] = array(); |
|
| 446 | + if(!empty($this->collections)) { |
|
| 447 | + $searchForm->searchFields['collection'] = array(); |
|
| 448 | + } |
|
| 441 | 449 | |
| 442 | 450 | $searchForm->populateFromRequest(); |
| 443 | 451 | |
@@ -102,6 +102,9 @@ discard block |
||
| 102 | 102 | } |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | + /** |
|
| 106 | + * @param string $template_file |
|
| 107 | + */ |
|
| 105 | 108 | function setTemplateFile($template_file) |
| 106 | 109 | { |
| 107 | 110 | $this->template_file = $template_file; |
@@ -271,6 +274,10 @@ discard block |
||
| 271 | 274 | } |
| 272 | 275 | |
| 273 | 276 | //saves overrides for defs |
| 277 | + |
|
| 278 | + /** |
|
| 279 | + * @param string $subsection |
|
| 280 | + */ |
|
| 274 | 281 | function saveSubPanelDefOverride( $panel, $subsection, $override){ |
| 275 | 282 | global $layout_defs, $beanList; |
| 276 | 283 | |
@@ -406,6 +413,9 @@ discard block |
||
| 406 | 413 | return print_r($where_clauses,true); |
| 407 | 414 | } |
| 408 | 415 | |
| 416 | + /** |
|
| 417 | + * @param string $module |
|
| 418 | + */ |
|
| 409 | 419 | function get_searchdefs($module) |
| 410 | 420 | { |
| 411 | 421 | $thisPanel =& $this->subpanel_defs; |
@@ -49,8 +49,8 @@ |
||
| 49 | 49 | function get_layout_defs() |
| 50 | 50 | { |
| 51 | 51 | //TODO add global memory cache support here. If there is an in memory cache, leverage it. |
| 52 | - global $layout_defs; |
|
| 53 | - return $layout_defs; |
|
| 52 | + global $layout_defs; |
|
| 53 | + return $layout_defs; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | ?> |
| 57 | 57 | \ No newline at end of file |
@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 3 | 3 | /********************************************************************************* |
| 4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
| 5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -1,5 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
| 3 | + die('Not A Valid Entry Point'); |
|
| 4 | +} |
|
| 3 | 5 | /********************************************************************************* |
| 4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
| 5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -48,15 +48,15 @@ discard block |
||
| 48 | 48 | class SubPanelTilesTabs extends SubPanelTiles |
| 49 | 49 | { |
| 50 | 50 | |
| 51 | - function SubPanelTiles(&$focus, $layout_def_key='', $layout_def_override = '') |
|
| 52 | - { |
|
| 51 | + function SubPanelTiles(&$focus, $layout_def_key='', $layout_def_override = '') |
|
| 52 | + { |
|
| 53 | 53 | |
| 54 | - $this->focus = $focus; |
|
| 55 | - $this->id = $focus->id; |
|
| 56 | - $this->module = $focus->module_dir; |
|
| 57 | - $this->layout_def_key = $layout_def_key; |
|
| 58 | - $this->subpanel_definitions = new SubPanelDefinitions($focus, $layout_def_key, $layout_def_override); |
|
| 59 | - } |
|
| 54 | + $this->focus = $focus; |
|
| 55 | + $this->id = $focus->id; |
|
| 56 | + $this->module = $focus->module_dir; |
|
| 57 | + $this->layout_def_key = $layout_def_key; |
|
| 58 | + $this->subpanel_definitions = new SubPanelDefinitions($focus, $layout_def_key, $layout_def_override); |
|
| 59 | + } |
|
| 60 | 60 | |
| 61 | 61 | function getSubpanelGroupLayout($selectedGroup) |
| 62 | 62 | { |
@@ -77,9 +77,9 @@ discard block |
||
| 77 | 77 | { |
| 78 | 78 | //WDong Bug: 12258 "All" tab in the middle of a record's detail view is not localized. |
| 79 | 79 | if($key=='All') |
| 80 | - { |
|
| 81 | - $key=translate('LBL_TABGROUP_ALL'); |
|
| 82 | - } |
|
| 80 | + { |
|
| 81 | + $key=translate('LBL_TABGROUP_ALL'); |
|
| 82 | + } |
|
| 83 | 83 | $usersCustomLayout = SubPanelTilesTabs::getSubpanelGroupLayout($key); |
| 84 | 84 | if(!empty($usersCustomLayout)) |
| 85 | 85 | { |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | $tabs = array_intersect($usersCustomLayout, $tabs); |
| 92 | 92 | foreach($diff as $subpanel) |
| 93 | 93 | { |
| 94 | - $tabs []= $subpanel; |
|
| 94 | + $tabs []= $subpanel; |
|
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | |
@@ -112,39 +112,39 @@ discard block |
||
| 112 | 112 | { |
| 113 | 113 | //WDong Bug: 12258 "All" tab in the middle of a record's detail view is not localized. |
| 114 | 114 | if($selectedGroup=='All') |
| 115 | - $selectedGroup=translate('LBL_TABGROUP_ALL'); |
|
| 116 | - |
|
| 117 | - // Set up a mapping from subpanelID, found in the $tabs list, to the source module name |
|
| 118 | - // As the $GLOBALS['tabStructure'] array holds the Group Tabs by module name we need to efficiently convert between the two |
|
| 119 | - // when constructing the subpanel tabs |
|
| 120 | - // Note that we can't use the very similar GroupedTabStructure class as it lacks this mapping, and logically, it is designed |
|
| 121 | - // for use when constructing the module by module tabs, not the subpanel tabs, as we move away from using module names to represent |
|
| 122 | - // subpanels, and use unique subpanel IDs instead. |
|
| 123 | - |
|
| 124 | - $moduleNames = array () ; |
|
| 125 | - foreach ( $tabs as $subpanelID ) |
|
| 126 | - { |
|
| 115 | + $selectedGroup=translate('LBL_TABGROUP_ALL'); |
|
| 116 | + |
|
| 117 | + // Set up a mapping from subpanelID, found in the $tabs list, to the source module name |
|
| 118 | + // As the $GLOBALS['tabStructure'] array holds the Group Tabs by module name we need to efficiently convert between the two |
|
| 119 | + // when constructing the subpanel tabs |
|
| 120 | + // Note that we can't use the very similar GroupedTabStructure class as it lacks this mapping, and logically, it is designed |
|
| 121 | + // for use when constructing the module by module tabs, not the subpanel tabs, as we move away from using module names to represent |
|
| 122 | + // subpanels, and use unique subpanel IDs instead. |
|
| 123 | + |
|
| 124 | + $moduleNames = array () ; |
|
| 125 | + foreach ( $tabs as $subpanelID ) |
|
| 126 | + { |
|
| 127 | 127 | // Bug #44344 : Custom relationships under same module only show once in subpanel tabs |
| 128 | 128 | // use object property instead new object to have ability run unit test (can override subpanel_definitions) |
| 129 | 129 | $subpanel = $this->subpanel_definitions->load_subpanel( $subpanelID ); |
| 130 | - if ($subpanel !== false) |
|
| 131 | - $moduleNames [ $subpanelID ] = $subpanel->get_module_name() ; |
|
| 132 | - } |
|
| 130 | + if ($subpanel !== false) |
|
| 131 | + $moduleNames [ $subpanelID ] = $subpanel->get_module_name() ; |
|
| 132 | + } |
|
| 133 | 133 | |
| 134 | - $groups = array () ; |
|
| 135 | - $found = array () ; |
|
| 134 | + $groups = array () ; |
|
| 135 | + $found = array () ; |
|
| 136 | 136 | |
| 137 | 137 | foreach( $GLOBALS['tabStructure'] as $mainTab => $subModules) |
| 138 | 138 | { |
| 139 | 139 | foreach( $subModules['modules'] as $key => $subModule ) |
| 140 | 140 | { |
| 141 | - foreach ( $tabs as $subpanelID ) |
|
| 141 | + foreach ( $tabs as $subpanelID ) |
|
| 142 | 142 | if (isset($moduleNames[ $subpanelID ] ) && strcasecmp( $subModule , $moduleNames[ $subpanelID ] ) === 0) |
| 143 | 143 | { |
| 144 | 144 | // Bug #44344 : Custom relationships under same module only show once in subpanel tabs |
| 145 | 145 | $groups [ translate ( $mainTab ) ] [ 'modules' ] [] = $subpanelID ; |
| 146 | - $found [ $subpanelID ] = true ; |
|
| 147 | - } |
|
| 146 | + $found [ $subpanelID ] = true ; |
|
| 147 | + } |
|
| 148 | 148 | } |
| 149 | 149 | } |
| 150 | 150 | |
@@ -152,8 +152,8 @@ discard block |
||
| 152 | 152 | |
| 153 | 153 | foreach( $tabs as $subpanelID ) |
| 154 | 154 | { |
| 155 | - if ( ! isset ( $found [ $subpanelID ] ) ) |
|
| 156 | - $groups [ translate ('LBL_TABGROUP_OTHER') ]['modules'] [] = $subpanelID ; |
|
| 155 | + if ( ! isset ( $found [ $subpanelID ] ) ) |
|
| 156 | + $groups [ translate ('LBL_TABGROUP_OTHER') ]['modules'] [] = $subpanelID ; |
|
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | /* Move history to same tab as activities */ |
@@ -161,11 +161,11 @@ discard block |
||
| 161 | 161 | { |
| 162 | 162 | foreach($groups as $mainTab => $group) |
| 163 | 163 | { |
| 164 | - if(in_array('activities', array_map('strtolower', $group['modules']))) |
|
| 164 | + if(in_array('activities', array_map('strtolower', $group['modules']))) |
|
| 165 | 165 | { |
| 166 | - if(!in_array('history', array_map('strtolower', $group['modules']))) |
|
| 166 | + if(!in_array('history', array_map('strtolower', $group['modules']))) |
|
| 167 | 167 | { |
| 168 | - /* Move hist from there to here */ |
|
| 168 | + /* Move hist from there to here */ |
|
| 169 | 169 | $groups[$mainTab]['modules'] []= 'history'; |
| 170 | 170 | } |
| 171 | 171 | } |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | unset($groups[$mainTab]['modules'][$i]); |
| 175 | 175 | if(empty($groups[$mainTab]['modules'])) |
| 176 | 176 | { |
| 177 | - unset($groups[$mainTab]); |
|
| 177 | + unset($groups[$mainTab]); |
|
| 178 | 178 | } |
| 179 | 179 | } |
| 180 | 180 | } |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | * it will be overwritten in this union operation. |
| 186 | 186 | */ |
| 187 | 187 | if(count($groups) <= 1) |
| 188 | - $groups = array(translate('LBL_TABGROUP_ALL') => array('label' => translate('LBL_TABGROUP_ALL'), 'modules' => $tabs)); |
|
| 188 | + $groups = array(translate('LBL_TABGROUP_ALL') => array('label' => translate('LBL_TABGROUP_ALL'), 'modules' => $tabs)); |
|
| 189 | 189 | else |
| 190 | 190 | $groups = array(translate('LBL_TABGROUP_ALL') => array('label' => translate('LBL_TABGROUP_ALL'), 'modules' => $tabs)) + $groups; |
| 191 | 191 | /* Note - all $display checking and array_intersects with $tabs |
@@ -197,14 +197,14 @@ discard block |
||
| 197 | 197 | $retTabs = array(); |
| 198 | 198 | if($showTabs) |
| 199 | 199 | { |
| 200 | - require_once('include/SubPanel/SugarTab.php'); |
|
| 201 | - $sugarTab = new SugarTab(); |
|
| 200 | + require_once('include/SubPanel/SugarTab.php'); |
|
| 201 | + $sugarTab = new SugarTab(); |
|
| 202 | 202 | |
| 203 | 203 | $displayTabs = array(); |
| 204 | 204 | $otherTabs = array(); |
| 205 | 205 | |
| 206 | - foreach ($groups as $key=>$tab) |
|
| 207 | - { |
|
| 206 | + foreach ($groups as $key=>$tab) |
|
| 207 | + { |
|
| 208 | 208 | $display = false; |
| 209 | 209 | foreach($tab['modules'] as $subkey=>$subtab) |
| 210 | 210 | { |
@@ -227,9 +227,9 @@ discard block |
||
| 227 | 227 | $relevantTabs = SubPanelTilesTabs::applyUserCustomLayoutToTabs($tabs, $key); |
| 228 | 228 | |
| 229 | 229 | $sugarTabs[$key] = array(//'url'=>'index.php?module=' . $_REQUEST['module'] . '&record=' . $_REQUEST['record'] . '&action=' . $_REQUEST['action']. '&subpanel=' . $key.'#tabs', |
| 230 | - //'url'=>"javascript:SUGAR.util.retrieveAndFill('index.php?to_pdf=1&module=MySettings&action=LoadTabSubpanels&loadModule={$_REQUEST['module']}&record={$_REQUEST['record']}&subpanel=$key','subpanel_list',null,null,null);", |
|
| 231 | - 'label'=>( !empty($tab['label']) ? $tab['label']: $key ), |
|
| 232 | - 'type'=>$selected); |
|
| 230 | + //'url'=>"javascript:SUGAR.util.retrieveAndFill('index.php?to_pdf=1&module=MySettings&action=LoadTabSubpanels&loadModule={$_REQUEST['module']}&record={$_REQUEST['record']}&subpanel=$key','subpanel_list',null,null,null);", |
|
| 231 | + 'label'=>( !empty($tab['label']) ? $tab['label']: $key ), |
|
| 232 | + 'type'=>$selected); |
|
| 233 | 233 | |
| 234 | 234 | $otherTabs[$key] = array('key'=>$key, 'tabs'=>array()); |
| 235 | 235 | |
@@ -246,7 +246,7 @@ discard block |
||
| 246 | 246 | $retTabs = $orderedTabs; |
| 247 | 247 | } |
| 248 | 248 | } |
| 249 | - } |
|
| 249 | + } |
|
| 250 | 250 | |
| 251 | 251 | if(empty($displayTabs) && !empty($otherTabs)) |
| 252 | 252 | { |
@@ -258,8 +258,8 @@ discard block |
||
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | if (!empty($sugarTabs) || !empty($otherTabs) ) { |
| 261 | - $sugarTab->setup($sugarTabs, $otherTabs, $displayTabs, $selectedGroup); |
|
| 262 | - $sugarTab->display(); |
|
| 261 | + $sugarTab->setup($sugarTabs, $otherTabs, $displayTabs, $selectedGroup); |
|
| 262 | + $sugarTab->display(); |
|
| 263 | 263 | } |
| 264 | 264 | } |
| 265 | 265 | else |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | $retTabs = array_intersect($tabs, array_map('strtolower', $groups[$selectedGroup]['modules'])); |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | - return $retTabs; |
|
| 273 | - } |
|
| 272 | + return $retTabs; |
|
| 273 | + } |
|
| 274 | 274 | } |
| 275 | 275 | ?> |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 3 | 3 | /********************************************************************************* |
| 4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
| 5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | class SubPanelTilesTabs extends SubPanelTiles |
| 49 | 49 | { |
| 50 | 50 | |
| 51 | - function SubPanelTiles(&$focus, $layout_def_key='', $layout_def_override = '') |
|
| 51 | + function SubPanelTiles(&$focus, $layout_def_key = '', $layout_def_override = '') |
|
| 52 | 52 | { |
| 53 | 53 | |
| 54 | 54 | $this->focus = $focus; |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | $layoutParams = $this->module; |
| 66 | 66 | //WDong Bug: 12258 "All" tab in the middle of a record's detail view is not localized. |
| 67 | - if($selectedGroup != translate('LBL_TABGROUP_ALL')) |
|
| 67 | + if ($selectedGroup != translate('LBL_TABGROUP_ALL')) |
|
| 68 | 68 | { |
| 69 | 69 | $layoutParams .= ':'.$selectedGroup; |
| 70 | 70 | } |
@@ -73,15 +73,15 @@ discard block |
||
| 73 | 73 | return $current_user->getPreference('subpanelLayout', $layoutParams); |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | - function applyUserCustomLayoutToTabs($tabs, $key='All') |
|
| 76 | + function applyUserCustomLayoutToTabs($tabs, $key = 'All') |
|
| 77 | 77 | { |
| 78 | 78 | //WDong Bug: 12258 "All" tab in the middle of a record's detail view is not localized. |
| 79 | - if($key=='All') |
|
| 79 | + if ($key == 'All') |
|
| 80 | 80 | { |
| 81 | - $key=translate('LBL_TABGROUP_ALL'); |
|
| 81 | + $key = translate('LBL_TABGROUP_ALL'); |
|
| 82 | 82 | } |
| 83 | 83 | $usersCustomLayout = SubPanelTilesTabs::getSubpanelGroupLayout($key); |
| 84 | - if(!empty($usersCustomLayout)) |
|
| 84 | + if (!empty($usersCustomLayout)) |
|
| 85 | 85 | { |
| 86 | 86 | /* Return elements of the custom layout |
| 87 | 87 | * which occur in $tabs in unchanged order. |
@@ -89,9 +89,9 @@ discard block |
||
| 89 | 89 | * not included in the layout. */ |
| 90 | 90 | $diff = array_diff($tabs, $usersCustomLayout); |
| 91 | 91 | $tabs = array_intersect($usersCustomLayout, $tabs); |
| 92 | - foreach($diff as $subpanel) |
|
| 92 | + foreach ($diff as $subpanel) |
|
| 93 | 93 | { |
| 94 | - $tabs []= $subpanel; |
|
| 94 | + $tabs [] = $subpanel; |
|
| 95 | 95 | } |
| 96 | 96 | } |
| 97 | 97 | |
@@ -104,15 +104,15 @@ discard block |
||
| 104 | 104 | * @param boolean $showTabs Call the view code to display the generated tabs |
| 105 | 105 | * @param string $selectedGroup (Optional) Name of any selected tab (defaults to 'All') |
| 106 | 106 | */ |
| 107 | - function getTabs($showTabs = true, $selectedGroup='') { |
|
| 107 | + function getTabs($showTabs = true, $selectedGroup = '') { |
|
| 108 | 108 | $args = func_get_args(); |
| 109 | 109 | return call_user_func_array(array($this, '_getTabs'), $args); |
| 110 | 110 | } |
| 111 | - function _getTabs($tabs, $showTabs = true, $selectedGroup='All') |
|
| 111 | + function _getTabs($tabs, $showTabs = true, $selectedGroup = 'All') |
|
| 112 | 112 | { |
| 113 | 113 | //WDong Bug: 12258 "All" tab in the middle of a record's detail view is not localized. |
| 114 | - if($selectedGroup=='All') |
|
| 115 | - $selectedGroup=translate('LBL_TABGROUP_ALL'); |
|
| 114 | + if ($selectedGroup == 'All') |
|
| 115 | + $selectedGroup = translate('LBL_TABGROUP_ALL'); |
|
| 116 | 116 | |
| 117 | 117 | // Set up a mapping from subpanelID, found in the $tabs list, to the source module name |
| 118 | 118 | // As the $GLOBALS['tabStructure'] array holds the Group Tabs by module name we need to efficiently convert between the two |
@@ -121,58 +121,58 @@ discard block |
||
| 121 | 121 | // for use when constructing the module by module tabs, not the subpanel tabs, as we move away from using module names to represent |
| 122 | 122 | // subpanels, and use unique subpanel IDs instead. |
| 123 | 123 | |
| 124 | - $moduleNames = array () ; |
|
| 125 | - foreach ( $tabs as $subpanelID ) |
|
| 124 | + $moduleNames = array(); |
|
| 125 | + foreach ($tabs as $subpanelID) |
|
| 126 | 126 | { |
| 127 | 127 | // Bug #44344 : Custom relationships under same module only show once in subpanel tabs |
| 128 | 128 | // use object property instead new object to have ability run unit test (can override subpanel_definitions) |
| 129 | - $subpanel = $this->subpanel_definitions->load_subpanel( $subpanelID ); |
|
| 129 | + $subpanel = $this->subpanel_definitions->load_subpanel($subpanelID); |
|
| 130 | 130 | if ($subpanel !== false) |
| 131 | - $moduleNames [ $subpanelID ] = $subpanel->get_module_name() ; |
|
| 131 | + $moduleNames [$subpanelID] = $subpanel->get_module_name(); |
|
| 132 | 132 | } |
| 133 | 133 | |
| 134 | - $groups = array () ; |
|
| 135 | - $found = array () ; |
|
| 134 | + $groups = array(); |
|
| 135 | + $found = array(); |
|
| 136 | 136 | |
| 137 | - foreach( $GLOBALS['tabStructure'] as $mainTab => $subModules) |
|
| 137 | + foreach ($GLOBALS['tabStructure'] as $mainTab => $subModules) |
|
| 138 | 138 | { |
| 139 | - foreach( $subModules['modules'] as $key => $subModule ) |
|
| 139 | + foreach ($subModules['modules'] as $key => $subModule) |
|
| 140 | 140 | { |
| 141 | - foreach ( $tabs as $subpanelID ) |
|
| 142 | - if (isset($moduleNames[ $subpanelID ] ) && strcasecmp( $subModule , $moduleNames[ $subpanelID ] ) === 0) |
|
| 141 | + foreach ($tabs as $subpanelID) |
|
| 142 | + if (isset($moduleNames[$subpanelID]) && strcasecmp($subModule, $moduleNames[$subpanelID]) === 0) |
|
| 143 | 143 | { |
| 144 | 144 | // Bug #44344 : Custom relationships under same module only show once in subpanel tabs |
| 145 | - $groups [ translate ( $mainTab ) ] [ 'modules' ] [] = $subpanelID ; |
|
| 146 | - $found [ $subpanelID ] = true ; |
|
| 145 | + $groups [translate($mainTab)] ['modules'] [] = $subpanelID; |
|
| 146 | + $found [$subpanelID] = true; |
|
| 147 | 147 | } |
| 148 | 148 | } |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | // Put all the remaining subpanels into the 'Other' tab. |
| 152 | 152 | |
| 153 | - foreach( $tabs as $subpanelID ) |
|
| 153 | + foreach ($tabs as $subpanelID) |
|
| 154 | 154 | { |
| 155 | - if ( ! isset ( $found [ $subpanelID ] ) ) |
|
| 156 | - $groups [ translate ('LBL_TABGROUP_OTHER') ]['modules'] [] = $subpanelID ; |
|
| 155 | + if (!isset ($found [$subpanelID])) |
|
| 156 | + $groups [translate('LBL_TABGROUP_OTHER')]['modules'] [] = $subpanelID; |
|
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | /* Move history to same tab as activities */ |
| 160 | - if(in_array('history', $tabs) && in_array('activities', $tabs)) |
|
| 160 | + if (in_array('history', $tabs) && in_array('activities', $tabs)) |
|
| 161 | 161 | { |
| 162 | - foreach($groups as $mainTab => $group) |
|
| 162 | + foreach ($groups as $mainTab => $group) |
|
| 163 | 163 | { |
| 164 | - if(in_array('activities', array_map('strtolower', $group['modules']))) |
|
| 164 | + if (in_array('activities', array_map('strtolower', $group['modules']))) |
|
| 165 | 165 | { |
| 166 | - if(!in_array('history', array_map('strtolower', $group['modules']))) |
|
| 166 | + if (!in_array('history', array_map('strtolower', $group['modules']))) |
|
| 167 | 167 | { |
| 168 | 168 | /* Move hist from there to here */ |
| 169 | - $groups[$mainTab]['modules'] []= 'history'; |
|
| 169 | + $groups[$mainTab]['modules'] [] = 'history'; |
|
| 170 | 170 | } |
| 171 | 171 | } |
| 172 | - else if(false !== ($i = array_search('history', array_map('strtolower', $group['modules'])))) |
|
| 172 | + else if (false !== ($i = array_search('history', array_map('strtolower', $group['modules'])))) |
|
| 173 | 173 | { |
| 174 | 174 | unset($groups[$mainTab]['modules'][$i]); |
| 175 | - if(empty($groups[$mainTab]['modules'])) |
|
| 175 | + if (empty($groups[$mainTab]['modules'])) |
|
| 176 | 176 | { |
| 177 | 177 | unset($groups[$mainTab]); |
| 178 | 178 | } |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | * Note that if a tab group already exists with the name 'All', |
| 185 | 185 | * it will be overwritten in this union operation. |
| 186 | 186 | */ |
| 187 | - if(count($groups) <= 1) |
|
| 187 | + if (count($groups) <= 1) |
|
| 188 | 188 | $groups = array(translate('LBL_TABGROUP_ALL') => array('label' => translate('LBL_TABGROUP_ALL'), 'modules' => $tabs)); |
| 189 | 189 | else |
| 190 | 190 | $groups = array(translate('LBL_TABGROUP_ALL') => array('label' => translate('LBL_TABGROUP_ALL'), 'modules' => $tabs)) + $groups; |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | */ |
| 196 | 196 | |
| 197 | 197 | $retTabs = array(); |
| 198 | - if($showTabs) |
|
| 198 | + if ($showTabs) |
|
| 199 | 199 | { |
| 200 | 200 | require_once('include/SubPanel/SugarTab.php'); |
| 201 | 201 | $sugarTab = new SugarTab(); |
@@ -206,9 +206,9 @@ discard block |
||
| 206 | 206 | foreach ($groups as $key=>$tab) |
| 207 | 207 | { |
| 208 | 208 | $display = false; |
| 209 | - foreach($tab['modules'] as $subkey=>$subtab) |
|
| 209 | + foreach ($tab['modules'] as $subkey=>$subtab) |
|
| 210 | 210 | { |
| 211 | - if(in_array(strtolower($subtab), $tabs)) |
|
| 211 | + if (in_array(strtolower($subtab), $tabs)) |
|
| 212 | 212 | { |
| 213 | 213 | $display = true; |
| 214 | 214 | break; |
@@ -217,30 +217,30 @@ discard block |
||
| 217 | 217 | |
| 218 | 218 | $selected = ''; |
| 219 | 219 | |
| 220 | - if($selectedGroup == $key) |
|
| 220 | + if ($selectedGroup == $key) |
|
| 221 | 221 | { |
| 222 | 222 | $selected = 'current'; |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | - if($display) |
|
| 225 | + if ($display) |
|
| 226 | 226 | { |
| 227 | 227 | $relevantTabs = SubPanelTilesTabs::applyUserCustomLayoutToTabs($tabs, $key); |
| 228 | 228 | |
| 229 | 229 | $sugarTabs[$key] = array(//'url'=>'index.php?module=' . $_REQUEST['module'] . '&record=' . $_REQUEST['record'] . '&action=' . $_REQUEST['action']. '&subpanel=' . $key.'#tabs', |
| 230 | 230 | //'url'=>"javascript:SUGAR.util.retrieveAndFill('index.php?to_pdf=1&module=MySettings&action=LoadTabSubpanels&loadModule={$_REQUEST['module']}&record={$_REQUEST['record']}&subpanel=$key','subpanel_list',null,null,null);", |
| 231 | - 'label'=>( !empty($tab['label']) ? $tab['label']: $key ), |
|
| 231 | + 'label'=>(!empty($tab['label']) ? $tab['label'] : $key), |
|
| 232 | 232 | 'type'=>$selected); |
| 233 | 233 | |
| 234 | 234 | $otherTabs[$key] = array('key'=>$key, 'tabs'=>array()); |
| 235 | 235 | |
| 236 | 236 | $orderedTabs = array_intersect($relevantTabs, array_map('strtolower', $groups[$key]['modules'])); |
| 237 | 237 | |
| 238 | - foreach($orderedTabs as $subkey => $subtab) |
|
| 238 | + foreach ($orderedTabs as $subkey => $subtab) |
|
| 239 | 239 | { |
| 240 | 240 | $otherTabs[$key]['tabs'][$subkey] = array('key'=>$subtab, 'label'=>translate($this->subpanel_definitions->layout_defs['subpanel_setup'][$subtab]['title_key'])); |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | - if($selectedGroup == $key) |
|
| 243 | + if ($selectedGroup == $key) |
|
| 244 | 244 | { |
| 245 | 245 | $displayTabs = $otherTabs[$key]['tabs']; |
| 246 | 246 | $retTabs = $orderedTabs; |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | } |
| 249 | 249 | } |
| 250 | 250 | |
| 251 | - if(empty($displayTabs) && !empty($otherTabs)) |
|
| 251 | + if (empty($displayTabs) && !empty($otherTabs)) |
|
| 252 | 252 | { |
| 253 | 253 | //WDong Bug: 12258 "All" tab in the middle of a record's detail view is not localized. |
| 254 | 254 | $selectedGroup = translate('LBL_TABGROUP_ALL'); |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | $retTabs = array_intersect($tabs, array_map('strtolower', $groups[$selectedGroup]['modules'])); |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | - if (!empty($sugarTabs) || !empty($otherTabs) ) { |
|
| 260 | + if (!empty($sugarTabs) || !empty($otherTabs)) { |
|
| 261 | 261 | $sugarTab->setup($sugarTabs, $otherTabs, $displayTabs, $selectedGroup); |
| 262 | 262 | $sugarTab->display(); |
| 263 | 263 | } |
@@ -1,5 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
| 3 | + die('Not A Valid Entry Point'); |
|
| 4 | +} |
|
| 3 | 5 | /********************************************************************************* |
| 4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
| 5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -111,8 +113,9 @@ discard block |
||
| 111 | 113 | function _getTabs($tabs, $showTabs = true, $selectedGroup='All') |
| 112 | 114 | { |
| 113 | 115 | //WDong Bug: 12258 "All" tab in the middle of a record's detail view is not localized. |
| 114 | - if($selectedGroup=='All') |
|
| 115 | - $selectedGroup=translate('LBL_TABGROUP_ALL'); |
|
| 116 | + if($selectedGroup=='All') { |
|
| 117 | + $selectedGroup=translate('LBL_TABGROUP_ALL'); |
|
| 118 | + } |
|
| 116 | 119 | |
| 117 | 120 | // Set up a mapping from subpanelID, found in the $tabs list, to the source module name |
| 118 | 121 | // As the $GLOBALS['tabStructure'] array holds the Group Tabs by module name we need to efficiently convert between the two |
@@ -127,8 +130,9 @@ discard block |
||
| 127 | 130 | // Bug #44344 : Custom relationships under same module only show once in subpanel tabs |
| 128 | 131 | // use object property instead new object to have ability run unit test (can override subpanel_definitions) |
| 129 | 132 | $subpanel = $this->subpanel_definitions->load_subpanel( $subpanelID ); |
| 130 | - if ($subpanel !== false) |
|
| 131 | - $moduleNames [ $subpanelID ] = $subpanel->get_module_name() ; |
|
| 133 | + if ($subpanel !== false) { |
|
| 134 | + $moduleNames [ $subpanelID ] = $subpanel->get_module_name() ; |
|
| 135 | + } |
|
| 132 | 136 | } |
| 133 | 137 | |
| 134 | 138 | $groups = array () ; |
@@ -138,11 +142,12 @@ discard block |
||
| 138 | 142 | { |
| 139 | 143 | foreach( $subModules['modules'] as $key => $subModule ) |
| 140 | 144 | { |
| 141 | - foreach ( $tabs as $subpanelID ) |
|
| 142 | - if (isset($moduleNames[ $subpanelID ] ) && strcasecmp( $subModule , $moduleNames[ $subpanelID ] ) === 0) |
|
| 145 | + foreach ( $tabs as $subpanelID ) { |
|
| 146 | + if (isset($moduleNames[ $subpanelID ] ) && strcasecmp( $subModule , $moduleNames[ $subpanelID ] ) === 0) |
|
| 143 | 147 | { |
| 144 | 148 | // Bug #44344 : Custom relationships under same module only show once in subpanel tabs |
| 145 | 149 | $groups [ translate ( $mainTab ) ] [ 'modules' ] [] = $subpanelID ; |
| 150 | + } |
|
| 146 | 151 | $found [ $subpanelID ] = true ; |
| 147 | 152 | } |
| 148 | 153 | } |
@@ -152,8 +157,9 @@ discard block |
||
| 152 | 157 | |
| 153 | 158 | foreach( $tabs as $subpanelID ) |
| 154 | 159 | { |
| 155 | - if ( ! isset ( $found [ $subpanelID ] ) ) |
|
| 156 | - $groups [ translate ('LBL_TABGROUP_OTHER') ]['modules'] [] = $subpanelID ; |
|
| 160 | + if ( ! isset ( $found [ $subpanelID ] ) ) { |
|
| 161 | + $groups [ translate ('LBL_TABGROUP_OTHER') ]['modules'] [] = $subpanelID ; |
|
| 162 | + } |
|
| 157 | 163 | } |
| 158 | 164 | |
| 159 | 165 | /* Move history to same tab as activities */ |
@@ -168,8 +174,7 @@ discard block |
||
| 168 | 174 | /* Move hist from there to here */ |
| 169 | 175 | $groups[$mainTab]['modules'] []= 'history'; |
| 170 | 176 | } |
| 171 | - } |
|
| 172 | - else if(false !== ($i = array_search('history', array_map('strtolower', $group['modules'])))) |
|
| 177 | + } else if(false !== ($i = array_search('history', array_map('strtolower', $group['modules'])))) |
|
| 173 | 178 | { |
| 174 | 179 | unset($groups[$mainTab]['modules'][$i]); |
| 175 | 180 | if(empty($groups[$mainTab]['modules'])) |
@@ -184,10 +189,11 @@ discard block |
||
| 184 | 189 | * Note that if a tab group already exists with the name 'All', |
| 185 | 190 | * it will be overwritten in this union operation. |
| 186 | 191 | */ |
| 187 | - if(count($groups) <= 1) |
|
| 188 | - $groups = array(translate('LBL_TABGROUP_ALL') => array('label' => translate('LBL_TABGROUP_ALL'), 'modules' => $tabs)); |
|
| 189 | - else |
|
| 190 | - $groups = array(translate('LBL_TABGROUP_ALL') => array('label' => translate('LBL_TABGROUP_ALL'), 'modules' => $tabs)) + $groups; |
|
| 192 | + if(count($groups) <= 1) { |
|
| 193 | + $groups = array(translate('LBL_TABGROUP_ALL') => array('label' => translate('LBL_TABGROUP_ALL'), 'modules' => $tabs)); |
|
| 194 | + } else { |
|
| 195 | + $groups = array(translate('LBL_TABGROUP_ALL') => array('label' => translate('LBL_TABGROUP_ALL'), 'modules' => $tabs)) + $groups; |
|
| 196 | + } |
|
| 191 | 197 | /* Note - all $display checking and array_intersects with $tabs |
| 192 | 198 | * are now redundant (thanks to GroupedTabStructure), and could |
| 193 | 199 | * be removed for performance, but for now can stay to help ensure |
@@ -261,8 +267,7 @@ discard block |
||
| 261 | 267 | $sugarTab->setup($sugarTabs, $otherTabs, $displayTabs, $selectedGroup); |
| 262 | 268 | $sugarTab->display(); |
| 263 | 269 | } |
| 264 | - } |
|
| 265 | - else |
|
| 270 | + } else |
|
| 266 | 271 | { |
| 267 | 272 | $tabs = SubPanelTilesTabs::applyUserCustomLayoutToTabs($tabs, $selectedGroup); |
| 268 | 273 | |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * SubPanelSearchForm.php |
|
| 4 | - * @author SalesAgility <[email protected]> |
|
| 5 | - * Date: 28/01/14 |
|
| 6 | - */ |
|
| 3 | + * SubPanelSearchForm.php |
|
| 4 | + * @author SalesAgility <[email protected]> |
|
| 5 | + * Date: 28/01/14 |
|
| 6 | + */ |
|
| 7 | 7 | |
| 8 | 8 | require_once('include/SearchForm/SearchForm2.php'); |
| 9 | 9 | |
@@ -7,16 +7,16 @@ discard block |
||
| 7 | 7 | |
| 8 | 8 | require_once('include/SearchForm/SearchForm2.php'); |
| 9 | 9 | |
| 10 | -class SubPanelSearchForm extends SearchForm { |
|
| 10 | +class SubPanelSearchForm extends SearchForm { |
|
| 11 | 11 | |
| 12 | 12 | var $subPanel; // the instantiated bean of the subPanel |
| 13 | 13 | |
| 14 | - function SubPanelSearchForm($seed, $module, $subPanel, $options = array()){ |
|
| 14 | + function SubPanelSearchForm($seed, $module, $subPanel, $options = array()) { |
|
| 15 | 15 | $this->subPanel = $subPanel; |
| 16 | 16 | parent::SearchForm($seed, $module, 'DetailView', $options); |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | - function display($header = false){ |
|
| 19 | + function display($header = false) { |
|
| 20 | 20 | /*//global $app_list_strings; |
| 21 | 21 | if($this->subPanel->subpanel_defs->isCollection() && isset($this->subPanel->subpanel_defs->base_collection_list)){ |
| 22 | 22 | $GLOBALS['app_list_strings']['collection_temp_list'] = $this->getCollectionList($this->subPanel->subpanel_defs->base_collection_list); |
@@ -26,16 +26,16 @@ discard block |
||
| 26 | 26 | return parent::display($header); |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | - function getCollectionList($collection = array()){ |
|
| 29 | + function getCollectionList($collection = array()) { |
|
| 30 | 30 | global $app_list_strings; |
| 31 | 31 | |
| 32 | 32 | $select = array(); |
| 33 | 33 | |
| 34 | - if(!empty($collection)){ |
|
| 34 | + if (!empty($collection)) { |
|
| 35 | 35 | |
| 36 | 36 | $select = array(); |
| 37 | - foreach($collection as $name => $value_array){ |
|
| 38 | - if(isset($app_list_strings['moduleList'][$value_array['module']])){ |
|
| 37 | + foreach ($collection as $name => $value_array) { |
|
| 38 | + if (isset($app_list_strings['moduleList'][$value_array['module']])) { |
|
| 39 | 39 | $select[$name] = $app_list_strings['moduleList'][$value_array['module']]; |
| 40 | 40 | } |
| 41 | 41 | } |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | return $select; |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | - function displaySavedSearchSelect(){ |
|
| 46 | + function displaySavedSearchSelect() { |
|
| 47 | 47 | return null; |
| 48 | 48 | } |
| 49 | 49 | |
@@ -11,6 +11,11 @@ |
||
| 11 | 11 | |
| 12 | 12 | var $subPanel; // the instantiated bean of the subPanel |
| 13 | 13 | |
| 14 | + /** |
|
| 15 | + * @param Meeting $seed |
|
| 16 | + * @param string $module |
|
| 17 | + * @param SubPanel $subPanel |
|
| 18 | + */ |
|
| 14 | 19 | function SubPanelSearchForm($seed, $module, $subPanel, $options = array()){ |
| 15 | 20 | $this->subPanel = $subPanel; |
| 16 | 21 | parent::SearchForm($seed, $module, 'DetailView', $options); |
@@ -45,40 +45,40 @@ |
||
| 45 | 45 | |
| 46 | 46 | class SugarWidgetSubPanelGetLatestButton extends SugarWidgetField |
| 47 | 47 | { |
| 48 | - function displayHeaderCell($layout_def) |
|
| 49 | - { |
|
| 50 | - return ' '; |
|
| 51 | - } |
|
| 48 | + function displayHeaderCell($layout_def) |
|
| 49 | + { |
|
| 50 | + return ' '; |
|
| 51 | + } |
|
| 52 | 52 | |
| 53 | - function displayList($layout_def) |
|
| 54 | - { |
|
| 55 | - //if the contract has been executed or selected_revision is same as latest revision |
|
| 56 | - //then hide the latest button. |
|
| 57 | - //if the contract state is executed or document is not a template hide this action. |
|
| 58 | - if ((!empty($layout_def['fields']['CONTRACT_STATUS']) && $layout_def['fields']['CONTRACT_STATUS']=='executed') or |
|
| 59 | - $layout_def['fields']['SELECTED_REVISION_ID']== $layout_def['fields']['LATEST_REVISION_ID']) { |
|
| 60 | - return ""; |
|
| 61 | - } |
|
| 53 | + function displayList($layout_def) |
|
| 54 | + { |
|
| 55 | + //if the contract has been executed or selected_revision is same as latest revision |
|
| 56 | + //then hide the latest button. |
|
| 57 | + //if the contract state is executed or document is not a template hide this action. |
|
| 58 | + if ((!empty($layout_def['fields']['CONTRACT_STATUS']) && $layout_def['fields']['CONTRACT_STATUS']=='executed') or |
|
| 59 | + $layout_def['fields']['SELECTED_REVISION_ID']== $layout_def['fields']['LATEST_REVISION_ID']) { |
|
| 60 | + return ""; |
|
| 61 | + } |
|
| 62 | 62 | |
| 63 | - global $app_strings; |
|
| 63 | + global $app_strings; |
|
| 64 | 64 | |
| 65 | 65 | |
| 66 | - $href = 'index.php?module=' . $layout_def['module'] |
|
| 67 | - . '&action=' . 'GetLatestRevision' |
|
| 68 | - . '&record=' . $layout_def['fields']['ID'] |
|
| 69 | - . '&return_module=' . $_REQUEST['module'] |
|
| 70 | - . '&return_action=' . 'DetailView' |
|
| 71 | - . '&return_id=' . $_REQUEST['record'] |
|
| 72 | - . '&get_latest_for_id=' . $layout_def['fields']['LINKED_ID']; |
|
| 66 | + $href = 'index.php?module=' . $layout_def['module'] |
|
| 67 | + . '&action=' . 'GetLatestRevision' |
|
| 68 | + . '&record=' . $layout_def['fields']['ID'] |
|
| 69 | + . '&return_module=' . $_REQUEST['module'] |
|
| 70 | + . '&return_action=' . 'DetailView' |
|
| 71 | + . '&return_id=' . $_REQUEST['record'] |
|
| 72 | + . '&get_latest_for_id=' . $layout_def['fields']['LINKED_ID']; |
|
| 73 | 73 | |
| 74 | - $edit_icon_html = SugarThemeRegistry::current()->getImage( 'getLatestDocument','align="absmiddle" border="0"',null,null,'.gif',$app_strings['LNK_GET_LATEST']); |
|
| 75 | - if($layout_def['EditView']){ |
|
| 76 | - return '<a href="' . $href . '"' . "title ='". $app_strings['LNK_GET_LATEST_TOOLTIP'] ."'" |
|
| 77 | - . 'class="listViewTdToolsS1">' . $edit_icon_html . ' ' . $app_strings['LNK_GET_LATEST'] .'</a> '; |
|
| 78 | - }else{ |
|
| 79 | - return ''; |
|
| 80 | - } |
|
| 81 | - } |
|
| 74 | + $edit_icon_html = SugarThemeRegistry::current()->getImage( 'getLatestDocument','align="absmiddle" border="0"',null,null,'.gif',$app_strings['LNK_GET_LATEST']); |
|
| 75 | + if($layout_def['EditView']){ |
|
| 76 | + return '<a href="' . $href . '"' . "title ='". $app_strings['LNK_GET_LATEST_TOOLTIP'] ."'" |
|
| 77 | + . 'class="listViewTdToolsS1">' . $edit_icon_html . ' ' . $app_strings['LNK_GET_LATEST'] .'</a> '; |
|
| 78 | + }else{ |
|
| 79 | + return ''; |
|
| 80 | + } |
|
| 81 | + } |
|
| 82 | 82 | |
| 83 | 83 | } |
| 84 | 84 | |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 3 | 3 | /********************************************************************************* |
| 4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
| 5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -55,27 +55,27 @@ discard block |
||
| 55 | 55 | //if the contract has been executed or selected_revision is same as latest revision |
| 56 | 56 | //then hide the latest button. |
| 57 | 57 | //if the contract state is executed or document is not a template hide this action. |
| 58 | - if ((!empty($layout_def['fields']['CONTRACT_STATUS']) && $layout_def['fields']['CONTRACT_STATUS']=='executed') or |
|
| 59 | - $layout_def['fields']['SELECTED_REVISION_ID']== $layout_def['fields']['LATEST_REVISION_ID']) { |
|
| 58 | + if ((!empty($layout_def['fields']['CONTRACT_STATUS']) && $layout_def['fields']['CONTRACT_STATUS'] == 'executed') or |
|
| 59 | + $layout_def['fields']['SELECTED_REVISION_ID'] == $layout_def['fields']['LATEST_REVISION_ID']) { |
|
| 60 | 60 | return ""; |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | global $app_strings; |
| 64 | 64 | |
| 65 | 65 | |
| 66 | - $href = 'index.php?module=' . $layout_def['module'] |
|
| 67 | - . '&action=' . 'GetLatestRevision' |
|
| 68 | - . '&record=' . $layout_def['fields']['ID'] |
|
| 69 | - . '&return_module=' . $_REQUEST['module'] |
|
| 70 | - . '&return_action=' . 'DetailView' |
|
| 71 | - . '&return_id=' . $_REQUEST['record'] |
|
| 72 | - . '&get_latest_for_id=' . $layout_def['fields']['LINKED_ID']; |
|
| 66 | + $href = 'index.php?module='.$layout_def['module'] |
|
| 67 | + . '&action='.'GetLatestRevision' |
|
| 68 | + . '&record='.$layout_def['fields']['ID'] |
|
| 69 | + . '&return_module='.$_REQUEST['module'] |
|
| 70 | + . '&return_action='.'DetailView' |
|
| 71 | + . '&return_id='.$_REQUEST['record'] |
|
| 72 | + . '&get_latest_for_id='.$layout_def['fields']['LINKED_ID']; |
|
| 73 | 73 | |
| 74 | - $edit_icon_html = SugarThemeRegistry::current()->getImage( 'getLatestDocument','align="absmiddle" border="0"',null,null,'.gif',$app_strings['LNK_GET_LATEST']); |
|
| 75 | - if($layout_def['EditView']){ |
|
| 76 | - return '<a href="' . $href . '"' . "title ='". $app_strings['LNK_GET_LATEST_TOOLTIP'] ."'" |
|
| 77 | - . 'class="listViewTdToolsS1">' . $edit_icon_html . ' ' . $app_strings['LNK_GET_LATEST'] .'</a> '; |
|
| 78 | - }else{ |
|
| 74 | + $edit_icon_html = SugarThemeRegistry::current()->getImage('getLatestDocument', 'align="absmiddle" border="0"', null, null, '.gif', $app_strings['LNK_GET_LATEST']); |
|
| 75 | + if ($layout_def['EditView']) { |
|
| 76 | + return '<a href="'.$href.'"'."title ='".$app_strings['LNK_GET_LATEST_TOOLTIP']."'" |
|
| 77 | + . 'class="listViewTdToolsS1">'.$edit_icon_html.' '.$app_strings['LNK_GET_LATEST'].'</a> '; |
|
| 78 | + } else { |
|
| 79 | 79 | return ''; |
| 80 | 80 | } |
| 81 | 81 | } |
@@ -1,5 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
| 3 | + die('Not A Valid Entry Point'); |
|
| 4 | +} |
|
| 3 | 5 | /********************************************************************************* |
| 4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
| 5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -111,7 +113,7 @@ discard block |
||
| 111 | 113 | if($layout_def['ListView']) { |
| 112 | 114 | return "<a href=\"javascript:sub_p_rem('$subpanel', '$linked_field'" .", '$record', $refresh_page);\"" |
| 113 | 115 | . ' class="listViewTdToolsS1"' . " onclick=\"return sp_rem_conf();\"" . ">$icon_remove_text</a>"; |
| 114 | - }else{ |
|
| 116 | + } else{ |
|
| 115 | 117 | return ''; |
| 116 | 118 | } |
| 117 | 119 | } |
@@ -51,77 +51,77 @@ |
||
| 51 | 51 | return parent::getWidgetId(); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - function display($defines, $additionalFormFields = NULL, $nonbutton = false) |
|
| 55 | - { |
|
| 56 | - global $app_strings; |
|
| 57 | - global $currentModule; |
|
| 54 | + function display($defines, $additionalFormFields = NULL, $nonbutton = false) |
|
| 55 | + { |
|
| 56 | + global $app_strings; |
|
| 57 | + global $currentModule; |
|
| 58 | 58 | |
| 59 | - $title = $app_strings['LBL_NEW_BUTTON_TITLE']; |
|
| 60 | - //$accesskey = $app_strings['LBL_NEW_BUTTON_KEY']; |
|
| 61 | - $value = $app_strings['LBL_NEW_BUTTON_LABEL']; |
|
| 62 | - $this->module = 'Leads'; |
|
| 63 | - if( ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], 'edit', true)){ |
|
| 64 | - $button = "<input title='$title'class='button' type='button' name='button' value=' $value ' disabled/>\n"; |
|
| 65 | - return $button; |
|
| 66 | - } |
|
| 59 | + $title = $app_strings['LBL_NEW_BUTTON_TITLE']; |
|
| 60 | + //$accesskey = $app_strings['LBL_NEW_BUTTON_KEY']; |
|
| 61 | + $value = $app_strings['LBL_NEW_BUTTON_LABEL']; |
|
| 62 | + $this->module = 'Leads'; |
|
| 63 | + if( ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], 'edit', true)){ |
|
| 64 | + $button = "<input title='$title'class='button' type='button' name='button' value=' $value ' disabled/>\n"; |
|
| 65 | + return $button; |
|
| 66 | + } |
|
| 67 | 67 | |
| 68 | - $additionalFormFields = array(); |
|
| 68 | + $additionalFormFields = array(); |
|
| 69 | 69 | |
| 70 | - //from accounts |
|
| 71 | - if ($defines['focus']->object_name == 'Account') { |
|
| 72 | - if(isset($defines['focus']->billing_address_street)) |
|
| 73 | - $additionalFormFields['primary_address_street'] = $defines['focus']->billing_address_street; |
|
| 74 | - if(isset($defines['focus']->billing_address_city)) |
|
| 75 | - $additionalFormFields['primary_address_city'] = $defines['focus']->billing_address_city; |
|
| 76 | - if(isset($defines['focus']->billing_address_state)) |
|
| 77 | - $additionalFormFields['primary_address_state'] = $defines['focus']->billing_address_state; |
|
| 78 | - if(isset($defines['focus']->billing_address_country)) |
|
| 79 | - $additionalFormFields['primary_address_country'] = $defines['focus']->billing_address_country; |
|
| 80 | - if(isset($defines['focus']->billing_address_postalcode)) |
|
| 81 | - $additionalFormFields['primary_address_postalcode'] = $defines['focus']->billing_address_postalcode; |
|
| 82 | - if(isset($defines['focus']->phone_office)) |
|
| 83 | - $additionalFormFields['phone_work'] = $defines['focus']->phone_office; |
|
| 84 | - if(isset($defines['focus']->id)) |
|
| 85 | - $additionalFormFields['account_id'] = $defines['focus']->id; |
|
| 86 | - } |
|
| 87 | - //from contacts |
|
| 88 | - if ($defines['focus']->object_name == 'Contact') { |
|
| 89 | - if(isset($defines['focus']->salutation)) |
|
| 90 | - $additionalFormFields['salutation'] = $defines['focus']->salutation; |
|
| 91 | - if(isset($defines['focus']->first_name)) |
|
| 92 | - $additionalFormFields['first_name'] = $defines['focus']->first_name; |
|
| 93 | - if(isset($defines['focus']->last_name)) |
|
| 94 | - $additionalFormFields['last_name'] = $defines['focus']->last_name; |
|
| 95 | - if(isset($defines['focus']->primary_address_street)) |
|
| 96 | - $additionalFormFields['primary_address_street'] = $defines['focus']->primary_address_street; |
|
| 97 | - if(isset($defines['focus']->primary_address_city)) |
|
| 98 | - $additionalFormFields['primary_address_city'] = $defines['focus']->primary_address_city; |
|
| 99 | - if(isset($defines['focus']->primary_address_state)) |
|
| 100 | - $additionalFormFields['primary_address_state'] = $defines['focus']->primary_address_state; |
|
| 101 | - if(isset($defines['focus']->primary_address_country)) |
|
| 102 | - $additionalFormFields['primary_address_country'] = $defines['focus']->primary_address_country; |
|
| 103 | - if(isset($defines['focus']->primary_address_postalcode)) |
|
| 104 | - $additionalFormFields['primary_address_postalcode'] = $defines['focus']->primary_address_postalcode; |
|
| 105 | - if(isset($defines['focus']->phone_work)) |
|
| 106 | - $additionalFormFields['phone_work'] = $defines['focus']->phone_work; |
|
| 107 | - if(isset($defines['focus']->id)) |
|
| 108 | - $additionalFormFields['contact_id'] = $defines['focus']->id; |
|
| 109 | - } |
|
| 70 | + //from accounts |
|
| 71 | + if ($defines['focus']->object_name == 'Account') { |
|
| 72 | + if(isset($defines['focus']->billing_address_street)) |
|
| 73 | + $additionalFormFields['primary_address_street'] = $defines['focus']->billing_address_street; |
|
| 74 | + if(isset($defines['focus']->billing_address_city)) |
|
| 75 | + $additionalFormFields['primary_address_city'] = $defines['focus']->billing_address_city; |
|
| 76 | + if(isset($defines['focus']->billing_address_state)) |
|
| 77 | + $additionalFormFields['primary_address_state'] = $defines['focus']->billing_address_state; |
|
| 78 | + if(isset($defines['focus']->billing_address_country)) |
|
| 79 | + $additionalFormFields['primary_address_country'] = $defines['focus']->billing_address_country; |
|
| 80 | + if(isset($defines['focus']->billing_address_postalcode)) |
|
| 81 | + $additionalFormFields['primary_address_postalcode'] = $defines['focus']->billing_address_postalcode; |
|
| 82 | + if(isset($defines['focus']->phone_office)) |
|
| 83 | + $additionalFormFields['phone_work'] = $defines['focus']->phone_office; |
|
| 84 | + if(isset($defines['focus']->id)) |
|
| 85 | + $additionalFormFields['account_id'] = $defines['focus']->id; |
|
| 86 | + } |
|
| 87 | + //from contacts |
|
| 88 | + if ($defines['focus']->object_name == 'Contact') { |
|
| 89 | + if(isset($defines['focus']->salutation)) |
|
| 90 | + $additionalFormFields['salutation'] = $defines['focus']->salutation; |
|
| 91 | + if(isset($defines['focus']->first_name)) |
|
| 92 | + $additionalFormFields['first_name'] = $defines['focus']->first_name; |
|
| 93 | + if(isset($defines['focus']->last_name)) |
|
| 94 | + $additionalFormFields['last_name'] = $defines['focus']->last_name; |
|
| 95 | + if(isset($defines['focus']->primary_address_street)) |
|
| 96 | + $additionalFormFields['primary_address_street'] = $defines['focus']->primary_address_street; |
|
| 97 | + if(isset($defines['focus']->primary_address_city)) |
|
| 98 | + $additionalFormFields['primary_address_city'] = $defines['focus']->primary_address_city; |
|
| 99 | + if(isset($defines['focus']->primary_address_state)) |
|
| 100 | + $additionalFormFields['primary_address_state'] = $defines['focus']->primary_address_state; |
|
| 101 | + if(isset($defines['focus']->primary_address_country)) |
|
| 102 | + $additionalFormFields['primary_address_country'] = $defines['focus']->primary_address_country; |
|
| 103 | + if(isset($defines['focus']->primary_address_postalcode)) |
|
| 104 | + $additionalFormFields['primary_address_postalcode'] = $defines['focus']->primary_address_postalcode; |
|
| 105 | + if(isset($defines['focus']->phone_work)) |
|
| 106 | + $additionalFormFields['phone_work'] = $defines['focus']->phone_work; |
|
| 107 | + if(isset($defines['focus']->id)) |
|
| 108 | + $additionalFormFields['contact_id'] = $defines['focus']->id; |
|
| 109 | + } |
|
| 110 | 110 | |
| 111 | - //from opportunities |
|
| 112 | - if ($defines['focus']->object_name == 'Opportunity') { |
|
| 113 | - if(isset($defines['focus']->id)) |
|
| 114 | - $additionalFormFields['opportunity_id'] = $defines['focus']->id; |
|
| 115 | - if(isset($defines['focus']->account_name)) |
|
| 116 | - $additionalFormFields['account_name'] = $defines['focus']->account_name; |
|
| 117 | - if(isset($defines['focus']->account_id)) |
|
| 118 | - $additionalFormFields['account_id'] = $defines['focus']->account_id; |
|
| 119 | - } |
|
| 111 | + //from opportunities |
|
| 112 | + if ($defines['focus']->object_name == 'Opportunity') { |
|
| 113 | + if(isset($defines['focus']->id)) |
|
| 114 | + $additionalFormFields['opportunity_id'] = $defines['focus']->id; |
|
| 115 | + if(isset($defines['focus']->account_name)) |
|
| 116 | + $additionalFormFields['account_name'] = $defines['focus']->account_name; |
|
| 117 | + if(isset($defines['focus']->account_id)) |
|
| 118 | + $additionalFormFields['account_id'] = $defines['focus']->account_id; |
|
| 119 | + } |
|
| 120 | 120 | |
| 121 | - $button = $this->_get_form($defines, $additionalFormFields); |
|
| 122 | - $button .= "<input title='$title' class='button' type='submit' name='{$this->getWidgetId()}_button' id='{$this->getWidgetId()}' value=' $value '/>\n"; |
|
| 123 | - $button .= "</form>"; |
|
| 124 | - return $button; |
|
| 125 | - } |
|
| 121 | + $button = $this->_get_form($defines, $additionalFormFields); |
|
| 122 | + $button .= "<input title='$title' class='button' type='submit' name='{$this->getWidgetId()}_button' id='{$this->getWidgetId()}' value=' $value '/>\n"; |
|
| 123 | + $button .= "</form>"; |
|
| 124 | + return $button; |
|
| 125 | + } |
|
| 126 | 126 | } |
| 127 | 127 | ?> |
| 128 | 128 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 3 | 3 | /********************************************************************************* |
| 4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
| 5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | //$accesskey = $app_strings['LBL_NEW_BUTTON_KEY']; |
| 61 | 61 | $value = $app_strings['LBL_NEW_BUTTON_LABEL']; |
| 62 | 62 | $this->module = 'Leads'; |
| 63 | - if( ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], 'edit', true)){ |
|
| 63 | + if (ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], 'edit', true)) { |
|
| 64 | 64 | $button = "<input title='$title'class='button' type='button' name='button' value=' $value ' disabled/>\n"; |
| 65 | 65 | return $button; |
| 66 | 66 | } |
@@ -69,52 +69,52 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | //from accounts |
| 71 | 71 | if ($defines['focus']->object_name == 'Account') { |
| 72 | - if(isset($defines['focus']->billing_address_street)) |
|
| 72 | + if (isset($defines['focus']->billing_address_street)) |
|
| 73 | 73 | $additionalFormFields['primary_address_street'] = $defines['focus']->billing_address_street; |
| 74 | - if(isset($defines['focus']->billing_address_city)) |
|
| 74 | + if (isset($defines['focus']->billing_address_city)) |
|
| 75 | 75 | $additionalFormFields['primary_address_city'] = $defines['focus']->billing_address_city; |
| 76 | - if(isset($defines['focus']->billing_address_state)) |
|
| 76 | + if (isset($defines['focus']->billing_address_state)) |
|
| 77 | 77 | $additionalFormFields['primary_address_state'] = $defines['focus']->billing_address_state; |
| 78 | - if(isset($defines['focus']->billing_address_country)) |
|
| 78 | + if (isset($defines['focus']->billing_address_country)) |
|
| 79 | 79 | $additionalFormFields['primary_address_country'] = $defines['focus']->billing_address_country; |
| 80 | - if(isset($defines['focus']->billing_address_postalcode)) |
|
| 80 | + if (isset($defines['focus']->billing_address_postalcode)) |
|
| 81 | 81 | $additionalFormFields['primary_address_postalcode'] = $defines['focus']->billing_address_postalcode; |
| 82 | - if(isset($defines['focus']->phone_office)) |
|
| 82 | + if (isset($defines['focus']->phone_office)) |
|
| 83 | 83 | $additionalFormFields['phone_work'] = $defines['focus']->phone_office; |
| 84 | - if(isset($defines['focus']->id)) |
|
| 84 | + if (isset($defines['focus']->id)) |
|
| 85 | 85 | $additionalFormFields['account_id'] = $defines['focus']->id; |
| 86 | 86 | } |
| 87 | 87 | //from contacts |
| 88 | 88 | if ($defines['focus']->object_name == 'Contact') { |
| 89 | - if(isset($defines['focus']->salutation)) |
|
| 89 | + if (isset($defines['focus']->salutation)) |
|
| 90 | 90 | $additionalFormFields['salutation'] = $defines['focus']->salutation; |
| 91 | - if(isset($defines['focus']->first_name)) |
|
| 91 | + if (isset($defines['focus']->first_name)) |
|
| 92 | 92 | $additionalFormFields['first_name'] = $defines['focus']->first_name; |
| 93 | - if(isset($defines['focus']->last_name)) |
|
| 93 | + if (isset($defines['focus']->last_name)) |
|
| 94 | 94 | $additionalFormFields['last_name'] = $defines['focus']->last_name; |
| 95 | - if(isset($defines['focus']->primary_address_street)) |
|
| 95 | + if (isset($defines['focus']->primary_address_street)) |
|
| 96 | 96 | $additionalFormFields['primary_address_street'] = $defines['focus']->primary_address_street; |
| 97 | - if(isset($defines['focus']->primary_address_city)) |
|
| 97 | + if (isset($defines['focus']->primary_address_city)) |
|
| 98 | 98 | $additionalFormFields['primary_address_city'] = $defines['focus']->primary_address_city; |
| 99 | - if(isset($defines['focus']->primary_address_state)) |
|
| 99 | + if (isset($defines['focus']->primary_address_state)) |
|
| 100 | 100 | $additionalFormFields['primary_address_state'] = $defines['focus']->primary_address_state; |
| 101 | - if(isset($defines['focus']->primary_address_country)) |
|
| 101 | + if (isset($defines['focus']->primary_address_country)) |
|
| 102 | 102 | $additionalFormFields['primary_address_country'] = $defines['focus']->primary_address_country; |
| 103 | - if(isset($defines['focus']->primary_address_postalcode)) |
|
| 103 | + if (isset($defines['focus']->primary_address_postalcode)) |
|
| 104 | 104 | $additionalFormFields['primary_address_postalcode'] = $defines['focus']->primary_address_postalcode; |
| 105 | - if(isset($defines['focus']->phone_work)) |
|
| 105 | + if (isset($defines['focus']->phone_work)) |
|
| 106 | 106 | $additionalFormFields['phone_work'] = $defines['focus']->phone_work; |
| 107 | - if(isset($defines['focus']->id)) |
|
| 107 | + if (isset($defines['focus']->id)) |
|
| 108 | 108 | $additionalFormFields['contact_id'] = $defines['focus']->id; |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | //from opportunities |
| 112 | 112 | if ($defines['focus']->object_name == 'Opportunity') { |
| 113 | - if(isset($defines['focus']->id)) |
|
| 113 | + if (isset($defines['focus']->id)) |
|
| 114 | 114 | $additionalFormFields['opportunity_id'] = $defines['focus']->id; |
| 115 | - if(isset($defines['focus']->account_name)) |
|
| 115 | + if (isset($defines['focus']->account_name)) |
|
| 116 | 116 | $additionalFormFields['account_name'] = $defines['focus']->account_name; |
| 117 | - if(isset($defines['focus']->account_id)) |
|
| 117 | + if (isset($defines['focus']->account_id)) |
|
| 118 | 118 | $additionalFormFields['account_id'] = $defines['focus']->account_id; |
| 119 | 119 | } |
| 120 | 120 | |
@@ -1,5 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
| 3 | + die('Not A Valid Entry Point'); |
|
| 4 | +} |
|
| 3 | 5 | /********************************************************************************* |
| 4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
| 5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -69,53 +71,73 @@ discard block |
||
| 69 | 71 | |
| 70 | 72 | //from accounts |
| 71 | 73 | if ($defines['focus']->object_name == 'Account') { |
| 72 | - if(isset($defines['focus']->billing_address_street)) |
|
| 73 | - $additionalFormFields['primary_address_street'] = $defines['focus']->billing_address_street; |
|
| 74 | - if(isset($defines['focus']->billing_address_city)) |
|
| 75 | - $additionalFormFields['primary_address_city'] = $defines['focus']->billing_address_city; |
|
| 76 | - if(isset($defines['focus']->billing_address_state)) |
|
| 77 | - $additionalFormFields['primary_address_state'] = $defines['focus']->billing_address_state; |
|
| 78 | - if(isset($defines['focus']->billing_address_country)) |
|
| 79 | - $additionalFormFields['primary_address_country'] = $defines['focus']->billing_address_country; |
|
| 80 | - if(isset($defines['focus']->billing_address_postalcode)) |
|
| 81 | - $additionalFormFields['primary_address_postalcode'] = $defines['focus']->billing_address_postalcode; |
|
| 82 | - if(isset($defines['focus']->phone_office)) |
|
| 83 | - $additionalFormFields['phone_work'] = $defines['focus']->phone_office; |
|
| 84 | - if(isset($defines['focus']->id)) |
|
| 85 | - $additionalFormFields['account_id'] = $defines['focus']->id; |
|
| 74 | + if(isset($defines['focus']->billing_address_street)) { |
|
| 75 | + $additionalFormFields['primary_address_street'] = $defines['focus']->billing_address_street; |
|
| 76 | + } |
|
| 77 | + if(isset($defines['focus']->billing_address_city)) { |
|
| 78 | + $additionalFormFields['primary_address_city'] = $defines['focus']->billing_address_city; |
|
| 79 | + } |
|
| 80 | + if(isset($defines['focus']->billing_address_state)) { |
|
| 81 | + $additionalFormFields['primary_address_state'] = $defines['focus']->billing_address_state; |
|
| 82 | + } |
|
| 83 | + if(isset($defines['focus']->billing_address_country)) { |
|
| 84 | + $additionalFormFields['primary_address_country'] = $defines['focus']->billing_address_country; |
|
| 85 | + } |
|
| 86 | + if(isset($defines['focus']->billing_address_postalcode)) { |
|
| 87 | + $additionalFormFields['primary_address_postalcode'] = $defines['focus']->billing_address_postalcode; |
|
| 88 | + } |
|
| 89 | + if(isset($defines['focus']->phone_office)) { |
|
| 90 | + $additionalFormFields['phone_work'] = $defines['focus']->phone_office; |
|
| 91 | + } |
|
| 92 | + if(isset($defines['focus']->id)) { |
|
| 93 | + $additionalFormFields['account_id'] = $defines['focus']->id; |
|
| 94 | + } |
|
| 86 | 95 | } |
| 87 | 96 | //from contacts |
| 88 | 97 | if ($defines['focus']->object_name == 'Contact') { |
| 89 | - if(isset($defines['focus']->salutation)) |
|
| 90 | - $additionalFormFields['salutation'] = $defines['focus']->salutation; |
|
| 91 | - if(isset($defines['focus']->first_name)) |
|
| 92 | - $additionalFormFields['first_name'] = $defines['focus']->first_name; |
|
| 93 | - if(isset($defines['focus']->last_name)) |
|
| 94 | - $additionalFormFields['last_name'] = $defines['focus']->last_name; |
|
| 95 | - if(isset($defines['focus']->primary_address_street)) |
|
| 96 | - $additionalFormFields['primary_address_street'] = $defines['focus']->primary_address_street; |
|
| 97 | - if(isset($defines['focus']->primary_address_city)) |
|
| 98 | - $additionalFormFields['primary_address_city'] = $defines['focus']->primary_address_city; |
|
| 99 | - if(isset($defines['focus']->primary_address_state)) |
|
| 100 | - $additionalFormFields['primary_address_state'] = $defines['focus']->primary_address_state; |
|
| 101 | - if(isset($defines['focus']->primary_address_country)) |
|
| 102 | - $additionalFormFields['primary_address_country'] = $defines['focus']->primary_address_country; |
|
| 103 | - if(isset($defines['focus']->primary_address_postalcode)) |
|
| 104 | - $additionalFormFields['primary_address_postalcode'] = $defines['focus']->primary_address_postalcode; |
|
| 105 | - if(isset($defines['focus']->phone_work)) |
|
| 106 | - $additionalFormFields['phone_work'] = $defines['focus']->phone_work; |
|
| 107 | - if(isset($defines['focus']->id)) |
|
| 108 | - $additionalFormFields['contact_id'] = $defines['focus']->id; |
|
| 98 | + if(isset($defines['focus']->salutation)) { |
|
| 99 | + $additionalFormFields['salutation'] = $defines['focus']->salutation; |
|
| 100 | + } |
|
| 101 | + if(isset($defines['focus']->first_name)) { |
|
| 102 | + $additionalFormFields['first_name'] = $defines['focus']->first_name; |
|
| 103 | + } |
|
| 104 | + if(isset($defines['focus']->last_name)) { |
|
| 105 | + $additionalFormFields['last_name'] = $defines['focus']->last_name; |
|
| 106 | + } |
|
| 107 | + if(isset($defines['focus']->primary_address_street)) { |
|
| 108 | + $additionalFormFields['primary_address_street'] = $defines['focus']->primary_address_street; |
|
| 109 | + } |
|
| 110 | + if(isset($defines['focus']->primary_address_city)) { |
|
| 111 | + $additionalFormFields['primary_address_city'] = $defines['focus']->primary_address_city; |
|
| 112 | + } |
|
| 113 | + if(isset($defines['focus']->primary_address_state)) { |
|
| 114 | + $additionalFormFields['primary_address_state'] = $defines['focus']->primary_address_state; |
|
| 115 | + } |
|
| 116 | + if(isset($defines['focus']->primary_address_country)) { |
|
| 117 | + $additionalFormFields['primary_address_country'] = $defines['focus']->primary_address_country; |
|
| 118 | + } |
|
| 119 | + if(isset($defines['focus']->primary_address_postalcode)) { |
|
| 120 | + $additionalFormFields['primary_address_postalcode'] = $defines['focus']->primary_address_postalcode; |
|
| 121 | + } |
|
| 122 | + if(isset($defines['focus']->phone_work)) { |
|
| 123 | + $additionalFormFields['phone_work'] = $defines['focus']->phone_work; |
|
| 124 | + } |
|
| 125 | + if(isset($defines['focus']->id)) { |
|
| 126 | + $additionalFormFields['contact_id'] = $defines['focus']->id; |
|
| 127 | + } |
|
| 109 | 128 | } |
| 110 | 129 | |
| 111 | 130 | //from opportunities |
| 112 | 131 | if ($defines['focus']->object_name == 'Opportunity') { |
| 113 | - if(isset($defines['focus']->id)) |
|
| 114 | - $additionalFormFields['opportunity_id'] = $defines['focus']->id; |
|
| 115 | - if(isset($defines['focus']->account_name)) |
|
| 116 | - $additionalFormFields['account_name'] = $defines['focus']->account_name; |
|
| 117 | - if(isset($defines['focus']->account_id)) |
|
| 118 | - $additionalFormFields['account_id'] = $defines['focus']->account_id; |
|
| 132 | + if(isset($defines['focus']->id)) { |
|
| 133 | + $additionalFormFields['opportunity_id'] = $defines['focus']->id; |
|
| 134 | + } |
|
| 135 | + if(isset($defines['focus']->account_name)) { |
|
| 136 | + $additionalFormFields['account_name'] = $defines['focus']->account_name; |
|
| 137 | + } |
|
| 138 | + if(isset($defines['focus']->account_id)) { |
|
| 139 | + $additionalFormFields['account_id'] = $defines['focus']->account_id; |
|
| 140 | + } |
|
| 119 | 141 | } |
| 120 | 142 | |
| 121 | 143 | $button = $this->_get_form($defines, $additionalFormFields); |
@@ -174,25 +174,25 @@ discard block |
||
| 174 | 174 | return $this->_get_column_select($layout_def) . " IN ('" . implode("', '", $ids) . "')"; |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | - //for to_pdf/to_csv |
|
| 178 | - function displayListPlain($layout_def) { |
|
| 179 | - $reporter = $this->layout_manager->getAttribute("reporter"); |
|
| 180 | - $field_def = $reporter->all_fields[$layout_def['column_key']]; |
|
| 181 | - $display = strtoupper($field_def['secondary_table'].'_name'); |
|
| 182 | - //#31797 , we should get the table alias in a global registered array:selected_loaded_custom_links |
|
| 183 | - if(!empty($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table']])){ |
|
| 184 | - $display = strtoupper($reporter->selected_loaded_custom_links[$field_def['secondary_table']]['join_table_alias'].'_name'); |
|
| 185 | - } |
|
| 177 | + //for to_pdf/to_csv |
|
| 178 | + function displayListPlain($layout_def) { |
|
| 179 | + $reporter = $this->layout_manager->getAttribute("reporter"); |
|
| 180 | + $field_def = $reporter->all_fields[$layout_def['column_key']]; |
|
| 181 | + $display = strtoupper($field_def['secondary_table'].'_name'); |
|
| 182 | + //#31797 , we should get the table alias in a global registered array:selected_loaded_custom_links |
|
| 183 | + if(!empty($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table']])){ |
|
| 184 | + $display = strtoupper($reporter->selected_loaded_custom_links[$field_def['secondary_table']]['join_table_alias'].'_name'); |
|
| 185 | + } |
|
| 186 | 186 | elseif(isset($field_def['rep_rel_name']) && isset($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['rep_rel_name']])) |
| 187 | 187 | { |
| 188 | 188 | $display = strtoupper($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['rep_rel_name']]['join_table_alias'].'_name'); |
| 189 | 189 | } |
| 190 | - elseif(!empty($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['name']])){ |
|
| 191 | - $display = strtoupper($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['name']]['join_table_alias'].'_name'); |
|
| 192 | - } |
|
| 193 | - $cell = $layout_def['fields'][$display]; |
|
| 194 | - return $cell; |
|
| 195 | - } |
|
| 190 | + elseif(!empty($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['name']])){ |
|
| 191 | + $display = strtoupper($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['name']]['join_table_alias'].'_name'); |
|
| 192 | + } |
|
| 193 | + $cell = $layout_def['fields'][$display]; |
|
| 194 | + return $cell; |
|
| 195 | + } |
|
| 196 | 196 | |
| 197 | 197 | function displayList($layout_def) { |
| 198 | 198 | $reporter = $this->layout_manager->getAttribute("reporter"); |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | |
| 202 | 202 | //#31797 , we should get the table alias in a global registered array:selected_loaded_custom_links |
| 203 | 203 | if(!empty($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table']])){ |
| 204 | - $display = strtoupper($reporter->selected_loaded_custom_links[$field_def['secondary_table']]['join_table_alias'].'_name'); |
|
| 204 | + $display = strtoupper($reporter->selected_loaded_custom_links[$field_def['secondary_table']]['join_table_alias'].'_name'); |
|
| 205 | 205 | } |
| 206 | 206 | elseif(isset($field_def['rep_rel_name']) && isset($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['rep_rel_name']])) |
| 207 | 207 | { |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 3 | 3 | /********************************************************************************* |
| 4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
| 5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -58,18 +58,18 @@ discard block |
||
| 58 | 58 | { |
| 59 | 59 | $values[] = $layout_def['input_name0']; |
| 60 | 60 | } |
| 61 | - $html = '<select name="' . $layout_def['name'] . '[]" multiple="true">'; |
|
| 61 | + $html = '<select name="'.$layout_def['name'].'[]" multiple="true">'; |
|
| 62 | 62 | |
| 63 | 63 | $query = $this->displayInputQuery($layout_def); |
| 64 | 64 | $result = $this->reporter->db->query($query); |
| 65 | 65 | while ($row = $this->reporter->db->fetchByAssoc($result)) |
| 66 | 66 | { |
| 67 | - $html .= '<option value="' . $row['id'] . '"'; |
|
| 67 | + $html .= '<option value="'.$row['id'].'"'; |
|
| 68 | 68 | if (in_array($row['id'], $values)) |
| 69 | 69 | { |
| 70 | 70 | $html .= ' selected="selected"'; |
| 71 | 71 | } |
| 72 | - $html .= '>' . htmlspecialchars($row['title']) . '</option>'; |
|
| 72 | + $html .= '>'.htmlspecialchars($row['title']).'</option>'; |
|
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | $html .= '</select>'; |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | $ids[] = $row['id']; |
| 135 | 135 | } |
| 136 | 136 | $layout_def['name'] = 'id'; |
| 137 | - return $this->_get_column_select($layout_def) . " IN ('" . implode("', '", $ids) . "')"; |
|
| 137 | + return $this->_get_column_select($layout_def)." IN ('".implode("', '", $ids)."')"; |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | /** |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | $module = isset($layout_def['custom_module']) ? $layout_def['custom_module'] : $layout_def['module']; |
| 155 | 155 | $seed = BeanFactory::getBean($module); |
| 156 | 156 | |
| 157 | - foreach($layout_def['input_name0'] as $beanId) |
|
| 157 | + foreach ($layout_def['input_name0'] as $beanId) |
|
| 158 | 158 | { |
| 159 | 159 | if (!empty($relation->lhs_module) && !empty($relation->rhs_module) |
| 160 | 160 | && $relation->lhs_module == $relation->rhs_module) { |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | } |
| 172 | 172 | $ids = array_unique($ids); |
| 173 | 173 | $layout_def['name'] = 'id'; |
| 174 | - return $this->_get_column_select($layout_def) . " IN ('" . implode("', '", $ids) . "')"; |
|
| 174 | + return $this->_get_column_select($layout_def)." IN ('".implode("', '", $ids)."')"; |
|
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | //for to_pdf/to_csv |
@@ -180,14 +180,14 @@ discard block |
||
| 180 | 180 | $field_def = $reporter->all_fields[$layout_def['column_key']]; |
| 181 | 181 | $display = strtoupper($field_def['secondary_table'].'_name'); |
| 182 | 182 | //#31797 , we should get the table alias in a global registered array:selected_loaded_custom_links |
| 183 | - if(!empty($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table']])){ |
|
| 183 | + if (!empty($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table']])) { |
|
| 184 | 184 | $display = strtoupper($reporter->selected_loaded_custom_links[$field_def['secondary_table']]['join_table_alias'].'_name'); |
| 185 | 185 | } |
| 186 | - elseif(isset($field_def['rep_rel_name']) && isset($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['rep_rel_name']])) |
|
| 186 | + elseif (isset($field_def['rep_rel_name']) && isset($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['rep_rel_name']])) |
|
| 187 | 187 | { |
| 188 | 188 | $display = strtoupper($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['rep_rel_name']]['join_table_alias'].'_name'); |
| 189 | 189 | } |
| 190 | - elseif(!empty($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['name']])){ |
|
| 190 | + elseif (!empty($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['name']])) { |
|
| 191 | 191 | $display = strtoupper($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['name']]['join_table_alias'].'_name'); |
| 192 | 192 | } |
| 193 | 193 | $cell = $layout_def['fields'][$display]; |
@@ -200,14 +200,14 @@ discard block |
||
| 200 | 200 | $display = strtoupper($field_def['secondary_table'].'_name'); |
| 201 | 201 | |
| 202 | 202 | //#31797 , we should get the table alias in a global registered array:selected_loaded_custom_links |
| 203 | - if(!empty($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table']])){ |
|
| 203 | + if (!empty($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table']])) { |
|
| 204 | 204 | $display = strtoupper($reporter->selected_loaded_custom_links[$field_def['secondary_table']]['join_table_alias'].'_name'); |
| 205 | 205 | } |
| 206 | - elseif(isset($field_def['rep_rel_name']) && isset($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['rep_rel_name']])) |
|
| 206 | + elseif (isset($field_def['rep_rel_name']) && isset($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['rep_rel_name']])) |
|
| 207 | 207 | { |
| 208 | 208 | $display = strtoupper($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['rep_rel_name']]['join_table_alias'].'_name'); |
| 209 | 209 | } |
| 210 | - elseif(!empty($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['name']])){ |
|
| 210 | + elseif (!empty($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['name']])) { |
|
| 211 | 211 | $display = strtoupper($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['name']]['join_table_alias'].'_name'); |
| 212 | 212 | } |
| 213 | 213 | $recordField = $this->getTruncatedColumnAlias(strtoupper($layout_def['table_alias']).'_'.strtoupper($layout_def['name'])); |
@@ -1,5 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
| 3 | + die('Not A Valid Entry Point'); |
|
| 4 | +} |
|
| 3 | 5 | /********************************************************************************* |
| 4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
| 5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -53,8 +55,7 @@ discard block |
||
| 53 | 55 | if (is_array($layout_def['input_name0'])) |
| 54 | 56 | { |
| 55 | 57 | $values = $layout_def['input_name0']; |
| 56 | - } |
|
| 57 | - else |
|
| 58 | + } else |
|
| 58 | 59 | { |
| 59 | 60 | $values[] = $layout_def['input_name0']; |
| 60 | 61 | } |
@@ -182,12 +183,10 @@ discard block |
||
| 182 | 183 | //#31797 , we should get the table alias in a global registered array:selected_loaded_custom_links |
| 183 | 184 | if(!empty($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table']])){ |
| 184 | 185 | $display = strtoupper($reporter->selected_loaded_custom_links[$field_def['secondary_table']]['join_table_alias'].'_name'); |
| 185 | - } |
|
| 186 | - elseif(isset($field_def['rep_rel_name']) && isset($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['rep_rel_name']])) |
|
| 186 | + } elseif(isset($field_def['rep_rel_name']) && isset($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['rep_rel_name']])) |
|
| 187 | 187 | { |
| 188 | 188 | $display = strtoupper($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['rep_rel_name']]['join_table_alias'].'_name'); |
| 189 | - } |
|
| 190 | - elseif(!empty($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['name']])){ |
|
| 189 | + } elseif(!empty($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['name']])){ |
|
| 191 | 190 | $display = strtoupper($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['name']]['join_table_alias'].'_name'); |
| 192 | 191 | } |
| 193 | 192 | $cell = $layout_def['fields'][$display]; |
@@ -202,12 +201,10 @@ discard block |
||
| 202 | 201 | //#31797 , we should get the table alias in a global registered array:selected_loaded_custom_links |
| 203 | 202 | if(!empty($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table']])){ |
| 204 | 203 | $display = strtoupper($reporter->selected_loaded_custom_links[$field_def['secondary_table']]['join_table_alias'].'_name'); |
| 205 | - } |
|
| 206 | - elseif(isset($field_def['rep_rel_name']) && isset($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['rep_rel_name']])) |
|
| 204 | + } elseif(isset($field_def['rep_rel_name']) && isset($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['rep_rel_name']])) |
|
| 207 | 205 | { |
| 208 | 206 | $display = strtoupper($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['rep_rel_name']]['join_table_alias'].'_name'); |
| 209 | - } |
|
| 210 | - elseif(!empty($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['name']])){ |
|
| 207 | + } elseif(!empty($reporter->selected_loaded_custom_links) && !empty($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['name']])){ |
|
| 211 | 208 | $display = strtoupper($reporter->selected_loaded_custom_links[$field_def['secondary_table'].'_'.$field_def['name']]['join_table_alias'].'_name'); |
| 212 | 209 | } |
| 213 | 210 | $recordField = $this->getTruncatedColumnAlias(strtoupper($layout_def['table_alias']).'_'.strtoupper($layout_def['name'])); |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 3 | 3 | /********************************************************************************* |
| 4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
| 5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -45,16 +45,16 @@ discard block |
||
| 45 | 45 | { |
| 46 | 46 | function displayListPlain($layout_def) { |
| 47 | 47 | |
| 48 | - $value= $this->_get_list_value($layout_def); |
|
| 48 | + $value = $this->_get_list_value($layout_def); |
|
| 49 | 49 | |
| 50 | - if (isset($layout_def['widget_type']) && $layout_def['widget_type'] =='checkbox') { |
|
| 50 | + if (isset($layout_def['widget_type']) && $layout_def['widget_type'] == 'checkbox') { |
|
| 51 | 51 | |
| 52 | - if ($value != '' && ($value == 'on' || intval($value) == 1 || $value == 'yes')) |
|
| 52 | + if ($value != '' && ($value == 'on' || intval($value) == 1 || $value == 'yes')) |
|
| 53 | 53 | { |
| 54 | 54 | return " <input name='checkbox_display' class='checkbox' type='checkbox' disabled='true' checked>"; |
| 55 | 55 | } |
| 56 | 56 | //Modification to allow checkboxes to be displayed correctly in subpanel |
| 57 | - if ($layout_def['checkbox_value']=='true'){ |
|
| 57 | + if ($layout_def['checkbox_value'] == 'true') { |
|
| 58 | 58 | return " <input name='".$layout_def['module']."checkbox_display[]' class='checkbox' type='checkbox' id='".$layout_def['module']."checkbox_display_id[]' value=\"".$layout_def['fields']['ID']."\" onclick=''>"; |
| 59 | 59 | } |
| 60 | 60 | |
@@ -1,5 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
| 3 | + die('Not A Valid Entry Point'); |
|
| 4 | +} |
|
| 3 | 5 | /********************************************************************************* |
| 4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
| 5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -45,41 +45,41 @@ |
||
| 45 | 45 | |
| 46 | 46 | class SugarWidgetSubPanelTopArchiveEmailButton extends SugarWidgetSubPanelTopButton |
| 47 | 47 | { |
| 48 | - function display($defines, $additionalFormFields = NULL, $nonbutton = false) |
|
| 49 | - { |
|
| 50 | - if((ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], 'edit', true) || |
|
| 51 | - $defines['module'] == "History" & !ACLController::checkAccess("Emails", 'edit', true))){ |
|
| 52 | - $temp = ''; |
|
| 53 | - return $temp; |
|
| 54 | - } |
|
| 48 | + function display($defines, $additionalFormFields = NULL, $nonbutton = false) |
|
| 49 | + { |
|
| 50 | + if((ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], 'edit', true) || |
|
| 51 | + $defines['module'] == "History" & !ACLController::checkAccess("Emails", 'edit', true))){ |
|
| 52 | + $temp = ''; |
|
| 53 | + return $temp; |
|
| 54 | + } |
|
| 55 | 55 | |
| 56 | - global $app_strings; |
|
| 57 | - global $mod_strings; |
|
| 58 | - global $currentModule; |
|
| 56 | + global $app_strings; |
|
| 57 | + global $mod_strings; |
|
| 58 | + global $currentModule; |
|
| 59 | 59 | |
| 60 | - $title = $app_strings['LBL_TRACK_EMAIL_BUTTON_TITLE']; |
|
| 61 | - $value = $app_strings['LBL_TRACK_EMAIL_BUTTON_LABEL']; |
|
| 62 | - $this->module = 'Emails'; |
|
| 60 | + $title = $app_strings['LBL_TRACK_EMAIL_BUTTON_TITLE']; |
|
| 61 | + $value = $app_strings['LBL_TRACK_EMAIL_BUTTON_LABEL']; |
|
| 62 | + $this->module = 'Emails'; |
|
| 63 | 63 | |
| 64 | - $additionalFormFields = array(); |
|
| 65 | - $additionalFormFields['type'] = 'archived'; |
|
| 66 | - // cn: bug 5727 - must override the parents' parent for contacts (which could be an Account) |
|
| 67 | - $additionalFormFields['parent_type'] = $defines['focus']->module_dir; |
|
| 68 | - $additionalFormFields['parent_id'] = $defines['focus']->id; |
|
| 69 | - $additionalFormFields['parent_name'] = $defines['focus']->name; |
|
| 64 | + $additionalFormFields = array(); |
|
| 65 | + $additionalFormFields['type'] = 'archived'; |
|
| 66 | + // cn: bug 5727 - must override the parents' parent for contacts (which could be an Account) |
|
| 67 | + $additionalFormFields['parent_type'] = $defines['focus']->module_dir; |
|
| 68 | + $additionalFormFields['parent_id'] = $defines['focus']->id; |
|
| 69 | + $additionalFormFields['parent_name'] = $defines['focus']->name; |
|
| 70 | 70 | |
| 71 | - if(isset($defines['focus']->email1)) |
|
| 72 | - { |
|
| 73 | - $additionalFormFields['to_email_addrs'] = $defines['focus']->email1; |
|
| 74 | - } |
|
| 75 | - if(ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], 'edit', true)){ |
|
| 76 | - $button = "<input id='".preg_replace('[ ]', '', $value)."_button' title='$title' class='button' type='button' name='".preg_replace('[ ]', '', mb_strtolower($value, 'UTF-8'))."_button' value='$value' disabled/>\n"; |
|
| 77 | - return $button; |
|
| 78 | - } |
|
| 79 | - $button = $this->_get_form($defines, $additionalFormFields); |
|
| 80 | - $button .= "<input id='".preg_replace('[ ]', '', $value)."_button' title='$title' class='button' type='submit' name='".preg_replace('[ ]', '', mb_strtolower($value, 'UTF-8'))."_button' value='$value'/>\n"; |
|
| 81 | - $button .= "</form>"; |
|
| 82 | - return $button; |
|
| 83 | - } |
|
| 71 | + if(isset($defines['focus']->email1)) |
|
| 72 | + { |
|
| 73 | + $additionalFormFields['to_email_addrs'] = $defines['focus']->email1; |
|
| 74 | + } |
|
| 75 | + if(ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], 'edit', true)){ |
|
| 76 | + $button = "<input id='".preg_replace('[ ]', '', $value)."_button' title='$title' class='button' type='button' name='".preg_replace('[ ]', '', mb_strtolower($value, 'UTF-8'))."_button' value='$value' disabled/>\n"; |
|
| 77 | + return $button; |
|
| 78 | + } |
|
| 79 | + $button = $this->_get_form($defines, $additionalFormFields); |
|
| 80 | + $button .= "<input id='".preg_replace('[ ]', '', $value)."_button' title='$title' class='button' type='submit' name='".preg_replace('[ ]', '', mb_strtolower($value, 'UTF-8'))."_button' value='$value'/>\n"; |
|
| 81 | + $button .= "</form>"; |
|
| 82 | + return $button; |
|
| 83 | + } |
|
| 84 | 84 | } |
| 85 | 85 | ?> |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 3 | 3 | /********************************************************************************* |
| 4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
| 5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -47,8 +47,8 @@ discard block |
||
| 47 | 47 | { |
| 48 | 48 | function display($defines, $additionalFormFields = NULL, $nonbutton = false) |
| 49 | 49 | { |
| 50 | - if((ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], 'edit', true) || |
|
| 51 | - $defines['module'] == "History" & !ACLController::checkAccess("Emails", 'edit', true))){ |
|
| 50 | + if ((ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], 'edit', true) || |
|
| 51 | + $defines['module'] == "History" & !ACLController::checkAccess("Emails", 'edit', true))) { |
|
| 52 | 52 | $temp = ''; |
| 53 | 53 | return $temp; |
| 54 | 54 | } |
@@ -68,11 +68,11 @@ discard block |
||
| 68 | 68 | $additionalFormFields['parent_id'] = $defines['focus']->id; |
| 69 | 69 | $additionalFormFields['parent_name'] = $defines['focus']->name; |
| 70 | 70 | |
| 71 | - if(isset($defines['focus']->email1)) |
|
| 71 | + if (isset($defines['focus']->email1)) |
|
| 72 | 72 | { |
| 73 | 73 | $additionalFormFields['to_email_addrs'] = $defines['focus']->email1; |
| 74 | 74 | } |
| 75 | - if(ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], 'edit', true)){ |
|
| 75 | + if (ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], 'edit', true)) { |
|
| 76 | 76 | $button = "<input id='".preg_replace('[ ]', '', $value)."_button' title='$title' class='button' type='button' name='".preg_replace('[ ]', '', mb_strtolower($value, 'UTF-8'))."_button' value='$value' disabled/>\n"; |
| 77 | 77 | return $button; |
| 78 | 78 | } |
@@ -1,5 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
| 2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
| 3 | + die('Not A Valid Entry Point'); |
|
| 4 | +} |
|
| 3 | 5 | /********************************************************************************* |
| 4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
| 5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |