@@ -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 | ?> |
@@ -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 | |
@@ -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 |
@@ -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 | { |
@@ -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 | ?> |
@@ -45,65 +45,65 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | class SugarWidgetSubPanelDetailViewLink extends SugarWidgetField |
| 47 | 47 | { |
| 48 | - function displayList($layout_def) |
|
| 49 | - { |
|
| 50 | - global $focus; |
|
| 51 | - |
|
| 52 | - $module = ''; |
|
| 53 | - $record = ''; |
|
| 54 | - |
|
| 55 | - if(isset($layout_def['varname'])) |
|
| 56 | - { |
|
| 57 | - $key = strtoupper($layout_def['varname']); |
|
| 58 | - } |
|
| 59 | - else |
|
| 60 | - { |
|
| 61 | - $key = $this->_get_column_alias($layout_def); |
|
| 62 | - $key = strtoupper($key); |
|
| 63 | - } |
|
| 64 | - if (empty($layout_def['fields'][$key])) { |
|
| 65 | - return ""; |
|
| 66 | - } else { |
|
| 67 | - $value = $layout_def['fields'][$key]; |
|
| 68 | - } |
|
| 69 | - |
|
| 70 | - |
|
| 71 | - if(empty($layout_def['target_record_key'])) |
|
| 72 | - { |
|
| 73 | - $record = $layout_def['fields']['ID']; |
|
| 74 | - } |
|
| 75 | - else |
|
| 76 | - { |
|
| 77 | - $record_key = strtoupper($layout_def['target_record_key']); |
|
| 78 | - $record = $layout_def['fields'][$record_key]; |
|
| 79 | - } |
|
| 80 | - |
|
| 81 | - if(!empty($layout_def['target_module_key'])) { |
|
| 82 | - if (!empty($layout_def['fields'][strtoupper($layout_def['target_module_key'])])) { |
|
| 83 | - $module=$layout_def['fields'][strtoupper($layout_def['target_module_key'])]; |
|
| 84 | - } |
|
| 85 | - } |
|
| 48 | + function displayList($layout_def) |
|
| 49 | + { |
|
| 50 | + global $focus; |
|
| 51 | + |
|
| 52 | + $module = ''; |
|
| 53 | + $record = ''; |
|
| 54 | + |
|
| 55 | + if(isset($layout_def['varname'])) |
|
| 56 | + { |
|
| 57 | + $key = strtoupper($layout_def['varname']); |
|
| 58 | + } |
|
| 59 | + else |
|
| 60 | + { |
|
| 61 | + $key = $this->_get_column_alias($layout_def); |
|
| 62 | + $key = strtoupper($key); |
|
| 63 | + } |
|
| 64 | + if (empty($layout_def['fields'][$key])) { |
|
| 65 | + return ""; |
|
| 66 | + } else { |
|
| 67 | + $value = $layout_def['fields'][$key]; |
|
| 68 | + } |
|
| 69 | + |
|
| 70 | + |
|
| 71 | + if(empty($layout_def['target_record_key'])) |
|
| 72 | + { |
|
| 73 | + $record = $layout_def['fields']['ID']; |
|
| 74 | + } |
|
| 75 | + else |
|
| 76 | + { |
|
| 77 | + $record_key = strtoupper($layout_def['target_record_key']); |
|
| 78 | + $record = $layout_def['fields'][$record_key]; |
|
| 79 | + } |
|
| 80 | + |
|
| 81 | + if(!empty($layout_def['target_module_key'])) { |
|
| 82 | + if (!empty($layout_def['fields'][strtoupper($layout_def['target_module_key'])])) { |
|
| 83 | + $module=$layout_def['fields'][strtoupper($layout_def['target_module_key'])]; |
|
| 84 | + } |
|
| 85 | + } |
|
| 86 | 86 | |
| 87 | 87 | if (empty($module)) { |
| 88 | - if(empty($layout_def['target_module'])) |
|
| 89 | - { |
|
| 90 | - $module = $layout_def['module']; |
|
| 91 | - } |
|
| 92 | - else |
|
| 93 | - { |
|
| 94 | - $module = $layout_def['target_module']; |
|
| 95 | - } |
|
| 96 | - } |
|
| 88 | + if(empty($layout_def['target_module'])) |
|
| 89 | + { |
|
| 90 | + $module = $layout_def['module']; |
|
| 91 | + } |
|
| 92 | + else |
|
| 93 | + { |
|
| 94 | + $module = $layout_def['target_module']; |
|
| 95 | + } |
|
| 96 | + } |
|
| 97 | 97 | |
| 98 | 98 | //links to email module now need additional information. |
| 99 | 99 | //this is to resolve the information about the target of the emails. necessitated by feature that allow |
| 100 | 100 | //only on email record for the whole campaign. |
| 101 | 101 | $parent=''; |
| 102 | 102 | if (!empty($layout_def['parent_info'])) { |
| 103 | - if (!empty($focus)){ |
|
| 104 | - $parent="&parent_id=".$focus->id; |
|
| 105 | - $parent.="&parent_module=".$focus->module_dir; |
|
| 106 | - } |
|
| 103 | + if (!empty($focus)){ |
|
| 104 | + $parent="&parent_id=".$focus->id; |
|
| 105 | + $parent.="&parent_module=".$focus->module_dir; |
|
| 106 | + } |
|
| 107 | 107 | } else { |
| 108 | 108 | if(!empty($layout_def['parent_id'])) { |
| 109 | 109 | if (isset($layout_def['fields'][strtoupper($layout_def['parent_id'])])) { |
@@ -117,13 +117,13 @@ discard block |
||
| 117 | 117 | } |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | - $action = 'DetailView'; |
|
| 121 | - $value = $layout_def['fields'][$key]; |
|
| 122 | - global $current_user; |
|
| 123 | - if( !empty($record) && |
|
| 124 | - ($layout_def['DetailView'] && !$layout_def['owner_module'] |
|
| 125 | - || $layout_def['DetailView'] && !ACLController::moduleSupportsACL($layout_def['owner_module']) |
|
| 126 | - || ACLController::checkAccess($layout_def['owner_module'], 'view', $layout_def['owner_id'] == $current_user->id))) |
|
| 120 | + $action = 'DetailView'; |
|
| 121 | + $value = $layout_def['fields'][$key]; |
|
| 122 | + global $current_user; |
|
| 123 | + if( !empty($record) && |
|
| 124 | + ($layout_def['DetailView'] && !$layout_def['owner_module'] |
|
| 125 | + || $layout_def['DetailView'] && !ACLController::moduleSupportsACL($layout_def['owner_module']) |
|
| 126 | + || ACLController::checkAccess($layout_def['owner_module'], 'view', $layout_def['owner_id'] == $current_user->id))) |
|
| 127 | 127 | { |
| 128 | 128 | $link = ajaxLink("index.php?module=$module&action=$action&record={$record}{$parent}"); |
| 129 | 129 | if ($module == 'EAPM') |
@@ -132,11 +132,11 @@ discard block |
||
| 132 | 132 | } |
| 133 | 133 | return '<a href="' . $link . '" >'."$value</a>"; |
| 134 | 134 | |
| 135 | - }else{ |
|
| 136 | - return $value; |
|
| 137 | - } |
|
| 135 | + }else{ |
|
| 136 | + return $value; |
|
| 137 | + } |
|
| 138 | 138 | |
| 139 | - } |
|
| 139 | + } |
|
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | ?> |
| 143 | 143 | \ No newline at end of file |
@@ -42,9 +42,9 @@ |
||
| 42 | 42 | |
| 43 | 43 | class SugarWidgetFieldDouble extends SugarWidgetFieldInt |
| 44 | 44 | { |
| 45 | - function SugarWidgetFieldDouble(&$layout_manager) { |
|
| 46 | - parent::SugarWidgetFieldInt($layout_manager); |
|
| 47 | - } |
|
| 45 | + function SugarWidgetFieldDouble(&$layout_manager) { |
|
| 46 | + parent::SugarWidgetFieldInt($layout_manager); |
|
| 47 | + } |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | ?> |
@@ -45,83 +45,83 @@ |
||
| 45 | 45 | |
| 46 | 46 | class SugarWidgetSubPanelRemoveButtonProjects 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 | - global $app_strings; |
|
| 53 | + function displayList(&$layout_def) |
|
| 54 | + { |
|
| 55 | + global $app_strings; |
|
| 56 | 56 | |
| 57 | - global $current_user; |
|
| 57 | + global $current_user; |
|
| 58 | 58 | |
| 59 | - $parent_record_id = $_REQUEST['record']; |
|
| 60 | - $parent_module = $_REQUEST['module']; |
|
| 59 | + $parent_record_id = $_REQUEST['record']; |
|
| 60 | + $parent_module = $_REQUEST['module']; |
|
| 61 | 61 | |
| 62 | - if ($layout_def['module'] == 'Holidays'){ |
|
| 63 | - $action = 'DeleteHolidayRelationship'; |
|
| 64 | - } |
|
| 65 | - else if ($layout_def['module'] == 'Users' || $layout_def['module'] == 'Contacts'){ |
|
| 66 | - $action = 'DeleteResourceRelationship'; |
|
| 67 | - } |
|
| 68 | - else{ |
|
| 69 | - $action = 'DeleteRelationship'; |
|
| 70 | - } |
|
| 62 | + if ($layout_def['module'] == 'Holidays'){ |
|
| 63 | + $action = 'DeleteHolidayRelationship'; |
|
| 64 | + } |
|
| 65 | + else if ($layout_def['module'] == 'Users' || $layout_def['module'] == 'Contacts'){ |
|
| 66 | + $action = 'DeleteResourceRelationship'; |
|
| 67 | + } |
|
| 68 | + else{ |
|
| 69 | + $action = 'DeleteRelationship'; |
|
| 70 | + } |
|
| 71 | 71 | |
| 72 | - $record = $layout_def['fields']['ID']; |
|
| 73 | - $current_module=$layout_def['module']; |
|
| 74 | - $hideremove=false; |
|
| 72 | + $record = $layout_def['fields']['ID']; |
|
| 73 | + $current_module=$layout_def['module']; |
|
| 74 | + $hideremove=false; |
|
| 75 | 75 | |
| 76 | - $return_module = $_REQUEST['module']; |
|
| 77 | - $return_action = 'SubPanelViewer'; |
|
| 78 | - $subpanel = $layout_def['subpanel_id']; |
|
| 79 | - $return_id = $_REQUEST['record']; |
|
| 76 | + $return_module = $_REQUEST['module']; |
|
| 77 | + $return_action = 'SubPanelViewer'; |
|
| 78 | + $subpanel = $layout_def['subpanel_id']; |
|
| 79 | + $return_id = $_REQUEST['record']; |
|
| 80 | 80 | |
| 81 | 81 | |
| 82 | - $focus = new Project(); |
|
| 82 | + $focus = new Project(); |
|
| 83 | 83 | |
| 84 | - $focus->retrieve($return_id); |
|
| 84 | + $focus->retrieve($return_id); |
|
| 85 | 85 | |
| 86 | - if ($current_user->id == $focus->assigned_user_id || is_admin($current_user)){ |
|
| 87 | - $is_owner = true; |
|
| 88 | - } |
|
| 89 | - else{ |
|
| 90 | - $is_owner = false; |
|
| 91 | - } |
|
| 86 | + if ($current_user->id == $focus->assigned_user_id || is_admin($current_user)){ |
|
| 87 | + $is_owner = true; |
|
| 88 | + } |
|
| 89 | + else{ |
|
| 90 | + $is_owner = false; |
|
| 91 | + } |
|
| 92 | 92 | |
| 93 | - if (isset($layout_def['linked_field_set']) && !empty($layout_def['linked_field_set'])) { |
|
| 94 | - $linked_field= $layout_def['linked_field_set'] ; |
|
| 95 | - } else { |
|
| 96 | - $linked_field = $layout_def['linked_field']; |
|
| 97 | - } |
|
| 98 | - $refresh_page = 0; |
|
| 99 | - if(!empty($layout_def['refresh_page'])){ |
|
| 100 | - $refresh_page = 1; |
|
| 101 | - } |
|
| 102 | - $return_url = "index.php?module=$return_module&action=$return_action&subpanel=$subpanel&record=$return_id&sugar_body_only=1&inline=1"; |
|
| 93 | + if (isset($layout_def['linked_field_set']) && !empty($layout_def['linked_field_set'])) { |
|
| 94 | + $linked_field= $layout_def['linked_field_set'] ; |
|
| 95 | + } else { |
|
| 96 | + $linked_field = $layout_def['linked_field']; |
|
| 97 | + } |
|
| 98 | + $refresh_page = 0; |
|
| 99 | + if(!empty($layout_def['refresh_page'])){ |
|
| 100 | + $refresh_page = 1; |
|
| 101 | + } |
|
| 102 | + $return_url = "index.php?module=$return_module&action=$return_action&subpanel=$subpanel&record=$return_id&sugar_body_only=1&inline=1"; |
|
| 103 | 103 | |
| 104 | - $icon_remove_text = strtolower($app_strings['LBL_ID_FF_REMOVE']); |
|
| 105 | - $icon_remove_html = SugarThemeRegistry::current()->getImage( 'delete_inline', 'align="absmiddle" border="0"',null,null,'.gif','');//setting alt to blank on purpose on subpanels for 508 |
|
| 106 | - $remove_url = $layout_def['start_link_wrapper'] |
|
| 107 | - . "index.php?module=$parent_module" |
|
| 108 | - . "&action=$action" |
|
| 109 | - . "&record=$parent_record_id" |
|
| 110 | - . "&linked_field=$linked_field" |
|
| 111 | - . "&linked_id=$record" |
|
| 112 | - . "&return_url=" . urlencode(urlencode($return_url)) |
|
| 113 | - . "&refresh_page=1" |
|
| 114 | - . $layout_def['end_link_wrapper']; |
|
| 115 | - $remove_confirmation_text = $app_strings['NTC_REMOVE_CONFIRMATION']; |
|
| 116 | - //based on listview since that lets you select records |
|
| 117 | - if($layout_def['ListView'] && !$hideremove && $is_owner) { |
|
| 118 | - return '<a href="' . $remove_url . '"' |
|
| 119 | - . ' class="listViewTdToolsS1"' |
|
| 120 | - . " onclick=\"return confirm('$remove_confirmation_text');\"" |
|
| 121 | - . ">$icon_remove_html $icon_remove_text</a>"; |
|
| 122 | - }else{ |
|
| 123 | - return ''; |
|
| 124 | - } |
|
| 125 | - } |
|
| 104 | + $icon_remove_text = strtolower($app_strings['LBL_ID_FF_REMOVE']); |
|
| 105 | + $icon_remove_html = SugarThemeRegistry::current()->getImage( 'delete_inline', 'align="absmiddle" border="0"',null,null,'.gif','');//setting alt to blank on purpose on subpanels for 508 |
|
| 106 | + $remove_url = $layout_def['start_link_wrapper'] |
|
| 107 | + . "index.php?module=$parent_module" |
|
| 108 | + . "&action=$action" |
|
| 109 | + . "&record=$parent_record_id" |
|
| 110 | + . "&linked_field=$linked_field" |
|
| 111 | + . "&linked_id=$record" |
|
| 112 | + . "&return_url=" . urlencode(urlencode($return_url)) |
|
| 113 | + . "&refresh_page=1" |
|
| 114 | + . $layout_def['end_link_wrapper']; |
|
| 115 | + $remove_confirmation_text = $app_strings['NTC_REMOVE_CONFIRMATION']; |
|
| 116 | + //based on listview since that lets you select records |
|
| 117 | + if($layout_def['ListView'] && !$hideremove && $is_owner) { |
|
| 118 | + return '<a href="' . $remove_url . '"' |
|
| 119 | + . ' class="listViewTdToolsS1"' |
|
| 120 | + . " onclick=\"return confirm('$remove_confirmation_text');\"" |
|
| 121 | + . ">$icon_remove_html $icon_remove_text</a>"; |
|
| 122 | + }else{ |
|
| 123 | + return ''; |
|
| 124 | + } |
|
| 125 | + } |
|
| 126 | 126 | } |
| 127 | 127 | ?> |
| 128 | 128 | \ No newline at end of file |
@@ -41,26 +41,26 @@ discard block |
||
| 41 | 41 | |
| 42 | 42 | |
| 43 | 43 | class SugarWidgetFieldMultiEnum extends SugarWidgetFieldEnum { |
| 44 | - public function queryFilternot_one_of(&$layout_def) { |
|
| 45 | - $arr = array (); |
|
| 46 | - foreach ($layout_def['input_name0'] as $value) { |
|
| 47 | - array_push($arr, "'".$GLOBALS['db']->quote($value)."'"); |
|
| 48 | - } |
|
| 49 | - $reporter = $this->layout_manager->getAttribute("reporter"); |
|
| 44 | + public function queryFilternot_one_of(&$layout_def) { |
|
| 45 | + $arr = array (); |
|
| 46 | + foreach ($layout_def['input_name0'] as $value) { |
|
| 47 | + array_push($arr, "'".$GLOBALS['db']->quote($value)."'"); |
|
| 48 | + } |
|
| 49 | + $reporter = $this->layout_manager->getAttribute("reporter"); |
|
| 50 | 50 | |
| 51 | - $col_name = $this->_get_column_select($layout_def) . " NOT LIKE " ; |
|
| 52 | - $arr_count = count($arr); |
|
| 53 | - $query = ""; |
|
| 54 | - foreach($arr as $key=>$val) { |
|
| 55 | - $query .= $col_name; |
|
| 56 | - $value = preg_replace("/^'/", "'%", $val, 1); |
|
| 57 | - $value = preg_replace("/'$/", "%'", $value, 1); |
|
| 58 | - $query .= $value; |
|
| 59 | - if ($key != ($arr_count - 1)) |
|
| 60 | - $query.= " OR " ; |
|
| 61 | - } |
|
| 62 | - return '('.$query.')'; |
|
| 63 | - } |
|
| 51 | + $col_name = $this->_get_column_select($layout_def) . " NOT LIKE " ; |
|
| 52 | + $arr_count = count($arr); |
|
| 53 | + $query = ""; |
|
| 54 | + foreach($arr as $key=>$val) { |
|
| 55 | + $query .= $col_name; |
|
| 56 | + $value = preg_replace("/^'/", "'%", $val, 1); |
|
| 57 | + $value = preg_replace("/'$/", "%'", $value, 1); |
|
| 58 | + $query .= $value; |
|
| 59 | + if ($key != ($arr_count - 1)) |
|
| 60 | + $query.= " OR " ; |
|
| 61 | + } |
|
| 62 | + return '('.$query.')'; |
|
| 63 | + } |
|
| 64 | 64 | |
| 65 | 65 | public function queryFilterone_of(&$layout_def) { |
| 66 | 66 | //Fix for inaccurate filtering of contacts in Contacts dashlet on multiselects. |
@@ -72,47 +72,47 @@ discard block |
||
| 72 | 72 | array_push($arr, "'^^'"); |
| 73 | 73 | } |
| 74 | 74 | } |
| 75 | - $reporter = $this->layout_manager->getAttribute("reporter"); |
|
| 75 | + $reporter = $this->layout_manager->getAttribute("reporter"); |
|
| 76 | 76 | |
| 77 | - $col_name = $this->_get_column_select($layout_def) . " LIKE " ; |
|
| 78 | - $arr_count = count($arr); |
|
| 79 | - $query = ""; |
|
| 80 | - foreach($arr as $key=>$val) { |
|
| 81 | - $query .= $col_name; |
|
| 82 | - $value = preg_replace("/^'/", "'%", $val, 1); |
|
| 83 | - $value = preg_replace("/'$/", "%'", $value, 1); |
|
| 84 | - $query .= $value; |
|
| 85 | - if ($key != ($arr_count - 1)) |
|
| 86 | - $query.= " OR " ; |
|
| 87 | - } |
|
| 88 | - return '('.$query.')'; |
|
| 89 | - } |
|
| 77 | + $col_name = $this->_get_column_select($layout_def) . " LIKE " ; |
|
| 78 | + $arr_count = count($arr); |
|
| 79 | + $query = ""; |
|
| 80 | + foreach($arr as $key=>$val) { |
|
| 81 | + $query .= $col_name; |
|
| 82 | + $value = preg_replace("/^'/", "'%", $val, 1); |
|
| 83 | + $value = preg_replace("/'$/", "%'", $value, 1); |
|
| 84 | + $query .= $value; |
|
| 85 | + if ($key != ($arr_count - 1)) |
|
| 86 | + $query.= " OR " ; |
|
| 87 | + } |
|
| 88 | + return '('.$query.')'; |
|
| 89 | + } |
|
| 90 | 90 | |
| 91 | - public function queryFilteris($layout_def) { |
|
| 92 | - $input_name0 = $layout_def['input_name0']; |
|
| 93 | - if (is_array($layout_def['input_name0'])) { |
|
| 94 | - $input_name0 = $layout_def['input_name0'][0]; |
|
| 95 | - } |
|
| 91 | + public function queryFilteris($layout_def) { |
|
| 92 | + $input_name0 = $layout_def['input_name0']; |
|
| 93 | + if (is_array($layout_def['input_name0'])) { |
|
| 94 | + $input_name0 = $layout_def['input_name0'][0]; |
|
| 95 | + } |
|
| 96 | 96 | |
| 97 | - // Bug 40022 |
|
| 98 | - // IS filter doesn't add the carets (^) to multienum custom field values |
|
| 99 | - $input_name0 = $this->encodeMultienumCustom($layout_def, $input_name0); |
|
| 97 | + // Bug 40022 |
|
| 98 | + // IS filter doesn't add the carets (^) to multienum custom field values |
|
| 99 | + $input_name0 = $this->encodeMultienumCustom($layout_def, $input_name0); |
|
| 100 | 100 | |
| 101 | - return $this->_get_column_select($layout_def)." = ".$this->reporter->db->quoted($input_name0)."\n"; |
|
| 102 | - } |
|
| 101 | + return $this->_get_column_select($layout_def)." = ".$this->reporter->db->quoted($input_name0)."\n"; |
|
| 102 | + } |
|
| 103 | 103 | |
| 104 | - public function queryFilteris_not($layout_def) { |
|
| 105 | - $input_name0 = $layout_def['input_name0']; |
|
| 106 | - if (is_array($layout_def['input_name0'])) { |
|
| 107 | - $input_name0 = $layout_def['input_name0'][0]; |
|
| 108 | - } |
|
| 104 | + public function queryFilteris_not($layout_def) { |
|
| 105 | + $input_name0 = $layout_def['input_name0']; |
|
| 106 | + if (is_array($layout_def['input_name0'])) { |
|
| 107 | + $input_name0 = $layout_def['input_name0'][0]; |
|
| 108 | + } |
|
| 109 | 109 | |
| 110 | - // Bug 50549 |
|
| 111 | - // IS NOT filter doesn't add the carets (^) to multienum custom field values |
|
| 112 | - $input_name0 = $this->encodeMultienumCustom($layout_def, $input_name0); |
|
| 110 | + // Bug 50549 |
|
| 111 | + // IS NOT filter doesn't add the carets (^) to multienum custom field values |
|
| 112 | + $input_name0 = $this->encodeMultienumCustom($layout_def, $input_name0); |
|
| 113 | 113 | |
| 114 | - return $this->_get_column_select($layout_def)." <> ".$this->reporter->db->quoted($input_name0)."\n"; |
|
| 115 | - } |
|
| 114 | + return $this->_get_column_select($layout_def)." <> ".$this->reporter->db->quoted($input_name0)."\n"; |
|
| 115 | + } |
|
| 116 | 116 | |
| 117 | 117 | /** |
| 118 | 118 | * Returns an OrderBy query for multi-select. We treat multi-select the same as a normal field because |
@@ -131,13 +131,13 @@ discard block |
||
| 131 | 131 | * @return string |
| 132 | 132 | */ |
| 133 | 133 | private function encodeMultienumCustom($layout_def, $value) { |
| 134 | - $field_def = $this->reporter->getFieldDefFromLayoutDef($layout_def); |
|
| 135 | - // Check if it is a custom field |
|
| 136 | - if (!empty($field_def['source']) && ($field_def['source'] == 'custom_fields' || ($field_def['source'] == 'non-db' && !empty($field_def['ext2']) && !empty($field_def['id']))) && !empty($field_def['real_table'])) |
|
| 137 | - { |
|
| 138 | - $value = encodeMultienumValue(array($value)); |
|
| 139 | - } |
|
| 140 | - return $value; |
|
| 134 | + $field_def = $this->reporter->getFieldDefFromLayoutDef($layout_def); |
|
| 135 | + // Check if it is a custom field |
|
| 136 | + if (!empty($field_def['source']) && ($field_def['source'] == 'custom_fields' || ($field_def['source'] == 'non-db' && !empty($field_def['ext2']) && !empty($field_def['id']))) && !empty($field_def['real_table'])) |
|
| 137 | + { |
|
| 138 | + $value = encodeMultienumValue(array($value)); |
|
| 139 | + } |
|
| 140 | + return $value; |
|
| 141 | 141 | } |
| 142 | 142 | } |
| 143 | 143 | ?> |