@@ -44,40 +44,40 @@ |
||
44 | 44 | |
45 | 45 | class SugarWidgetSubPanelDeleteButton extends SugarWidgetField |
46 | 46 | { |
47 | - function displayList($layout_def) |
|
48 | - { |
|
49 | - global $app_strings; |
|
47 | + function displayList($layout_def) |
|
48 | + { |
|
49 | + global $app_strings; |
|
50 | 50 | global $subpanel_item_count; |
51 | - $return_module = $_REQUEST['module']; |
|
52 | - $return_id = $_REQUEST['record']; |
|
53 | - $module_name = $layout_def['module']; |
|
54 | - $record_id = $layout_def['fields']['ID']; |
|
51 | + $return_module = $_REQUEST['module']; |
|
52 | + $return_id = $_REQUEST['record']; |
|
53 | + $module_name = $layout_def['module']; |
|
54 | + $record_id = $layout_def['fields']['ID']; |
|
55 | 55 | $unique_id = $layout_def['subpanel_id']."_delete_".$subpanel_item_count; //bug 51512 |
56 | 56 | |
57 | - // calls and meetings are held. |
|
58 | - $new_status = 'Held'; |
|
57 | + // calls and meetings are held. |
|
58 | + $new_status = 'Held'; |
|
59 | 59 | |
60 | - switch($module_name) |
|
61 | - { |
|
62 | - case 'Tasks': |
|
63 | - $new_status = 'Completed'; |
|
64 | - break; |
|
65 | - } |
|
66 | - $subpanel = $layout_def['subpanel_id']; |
|
67 | - if (isset($layout_def['linked_field_set']) && !empty($layout_def['linked_field_set'])) { |
|
68 | - $linked_field= $layout_def['linked_field_set'] ; |
|
69 | - } else { |
|
70 | - $linked_field = $layout_def['linked_field']; |
|
71 | - } |
|
72 | - $refresh_page = 0; |
|
73 | - if(!empty($layout_def['refresh_page'])){ |
|
74 | - $refresh_page = 1; |
|
75 | - } |
|
60 | + switch($module_name) |
|
61 | + { |
|
62 | + case 'Tasks': |
|
63 | + $new_status = 'Completed'; |
|
64 | + break; |
|
65 | + } |
|
66 | + $subpanel = $layout_def['subpanel_id']; |
|
67 | + if (isset($layout_def['linked_field_set']) && !empty($layout_def['linked_field_set'])) { |
|
68 | + $linked_field= $layout_def['linked_field_set'] ; |
|
69 | + } else { |
|
70 | + $linked_field = $layout_def['linked_field']; |
|
71 | + } |
|
72 | + $refresh_page = 0; |
|
73 | + if(!empty($layout_def['refresh_page'])){ |
|
74 | + $refresh_page = 1; |
|
75 | + } |
|
76 | 76 | |
77 | - $html = "<a id=\"$unique_id\" onclick='return sp_del_conf();' href=\"javascript:sub_p_del('$subpanel', '$module_name', '$record_id', $refresh_page);\">".$app_strings['LNK_DELETE']."</a>"; |
|
78 | - return $html; |
|
77 | + $html = "<a id=\"$unique_id\" onclick='return sp_del_conf();' href=\"javascript:sub_p_del('$subpanel', '$module_name', '$record_id', $refresh_page);\">".$app_strings['LNK_DELETE']."</a>"; |
|
78 | + return $html; |
|
79 | 79 | |
80 | - } |
|
80 | + } |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | ?> |
84 | 84 | \ No newline at end of file |
@@ -41,7 +41,7 @@ |
||
41 | 41 | |
42 | 42 | class SugarWidgetFieldURL extends SugarWidgetFieldVarchar |
43 | 43 | { |
44 | - /* Display item as link |
|
44 | + /* Display item as link |
|
45 | 45 | * @param array $layout_def definition of field which we want to display as link |
46 | 46 | * @return string html code |
47 | 47 | */ |
@@ -42,9 +42,9 @@ |
||
42 | 42 | class SugarWidgetFieldImage extends SugarWidgetFieldVarchar |
43 | 43 | { |
44 | 44 | |
45 | - function displayListPlain($layout_def) { |
|
46 | - $value = $this->_get_list_value($layout_def); |
|
47 | - return "<a href=\"javascript:SUGAR.image.lightbox('index.php?entryPoint=download&id=$value&type=SugarFieldImage&isTempFile=1')\">" |
|
48 | - . translate("LBL_VIEW_IMAGE") . '</a>'; |
|
49 | - } |
|
45 | + function displayListPlain($layout_def) { |
|
46 | + $value = $this->_get_list_value($layout_def); |
|
47 | + return "<a href=\"javascript:SUGAR.image.lightbox('index.php?entryPoint=download&id=$value&type=SugarFieldImage&isTempFile=1')\">" |
|
48 | + . translate("LBL_VIEW_IMAGE") . '</a>'; |
|
49 | + } |
|
50 | 50 | } |
51 | 51 | \ No newline at end of file |
@@ -45,38 +45,38 @@ |
||
45 | 45 | //this widget is used only by the document subpanel under contracts. |
46 | 46 | class SugarWidgetSubPanelLoadSignedButton 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 | 57 | |
58 | - $href = 'index.php?module=' . 'Documents' |
|
59 | - . '&action=' . 'EditView' |
|
60 | - . '&record=' . $layout_def['fields']['ID'] |
|
61 | - . '&return_module=' . $_REQUEST['module'] |
|
62 | - . '&return_action=' . 'DetailView' |
|
63 | - . '&return_id=' . $_REQUEST['record'] |
|
64 | - . '&load_signed_id=' . $layout_def['fields']['LINKED_ID'] |
|
65 | - . '&parent_id=' . $_REQUEST['record'] |
|
66 | - . '&parent_name=' . $layout_def['fields']['CONTRACT_NAME'] |
|
67 | - . '&parent_type=' . $_REQUEST['module'] |
|
68 | - . '&selected_revision_id=' . $layout_def['fields']['SELECTED_REVISION_ID'] |
|
69 | - ; |
|
58 | + $href = 'index.php?module=' . 'Documents' |
|
59 | + . '&action=' . 'EditView' |
|
60 | + . '&record=' . $layout_def['fields']['ID'] |
|
61 | + . '&return_module=' . $_REQUEST['module'] |
|
62 | + . '&return_action=' . 'DetailView' |
|
63 | + . '&return_id=' . $_REQUEST['record'] |
|
64 | + . '&load_signed_id=' . $layout_def['fields']['LINKED_ID'] |
|
65 | + . '&parent_id=' . $_REQUEST['record'] |
|
66 | + . '&parent_name=' . $layout_def['fields']['CONTRACT_NAME'] |
|
67 | + . '&parent_type=' . $_REQUEST['module'] |
|
68 | + . '&selected_revision_id=' . $layout_def['fields']['SELECTED_REVISION_ID'] |
|
69 | + ; |
|
70 | 70 | |
71 | - $edit_icon_html = SugarThemeRegistry::current()->getImage( 'loadSignedDocument','align="absmiddle" border="0"',null,null,'.gif',$app_strings['LNK_LOAD_SIGNED']); |
|
72 | - //if the contract state is executed or document is not a template hide this action. |
|
73 | - if ((!empty($layout_def['fields']['CONTRACT_STATUS']) && $layout_def['fields']['CONTRACT_STATUS']=='executed') or |
|
74 | - empty($layout_def['fields']['IS_TEMPLATE']) or $layout_def['fields']['IS_TEMPLATE']==0) { |
|
75 | - return ""; |
|
76 | - } |
|
77 | - return '<a href="' . $href . '"' . "title ='". $app_strings['LNK_LOAD_SIGNED_TOOLTIP']."'" |
|
78 | - . 'class="listViewTdToolsS1">' . $edit_icon_html . ' ' . $app_strings['LNK_LOAD_SIGNED'] .'</a> '; |
|
79 | - } |
|
71 | + $edit_icon_html = SugarThemeRegistry::current()->getImage( 'loadSignedDocument','align="absmiddle" border="0"',null,null,'.gif',$app_strings['LNK_LOAD_SIGNED']); |
|
72 | + //if the contract state is executed or document is not a template hide this action. |
|
73 | + if ((!empty($layout_def['fields']['CONTRACT_STATUS']) && $layout_def['fields']['CONTRACT_STATUS']=='executed') or |
|
74 | + empty($layout_def['fields']['IS_TEMPLATE']) or $layout_def['fields']['IS_TEMPLATE']==0) { |
|
75 | + return ""; |
|
76 | + } |
|
77 | + return '<a href="' . $href . '"' . "title ='". $app_strings['LNK_LOAD_SIGNED_TOOLTIP']."'" |
|
78 | + . 'class="listViewTdToolsS1">' . $edit_icon_html . ' ' . $app_strings['LNK_LOAD_SIGNED'] .'</a> '; |
|
79 | + } |
|
80 | 80 | |
81 | 81 | } |
82 | 82 | ?> |
83 | 83 | \ No newline at end of file |
@@ -42,18 +42,18 @@ discard block |
||
42 | 42 | class SugarWidgetFieldBool extends SugarWidgetReportField |
43 | 43 | { |
44 | 44 | |
45 | - function queryFilterEquals(&$layout_def) |
|
46 | - { |
|
45 | + function queryFilterEquals(&$layout_def) |
|
46 | + { |
|
47 | 47 | |
48 | - $bool_val = $layout_def['input_name0'][0]; |
|
49 | - if ($bool_val == 'yes' || $bool_val == '1') |
|
50 | - { |
|
51 | - return "(".$this->_get_column_select($layout_def)." LIKE 'on' OR ".$this->_get_column_select($layout_def)."='1')\n"; |
|
52 | - } else { |
|
53 | - //return "(".$this->_get_column_select($layout_def)." is null OR ".$this->_get_column_select($layout_def)."='0' OR ".$this->_get_column_select($layout_def)."='off')\n"; |
|
48 | + $bool_val = $layout_def['input_name0'][0]; |
|
49 | + if ($bool_val == 'yes' || $bool_val == '1') |
|
50 | + { |
|
51 | + return "(".$this->_get_column_select($layout_def)." LIKE 'on' OR ".$this->_get_column_select($layout_def)."='1')\n"; |
|
52 | + } else { |
|
53 | + //return "(".$this->_get_column_select($layout_def)." is null OR ".$this->_get_column_select($layout_def)."='0' OR ".$this->_get_column_select($layout_def)."='off')\n"; |
|
54 | 54 | return "(".$this->_get_column_select($layout_def)." is null OR ". $this->_get_column_select($layout_def)."='0')\n"; |
55 | - } |
|
56 | - } |
|
55 | + } |
|
56 | + } |
|
57 | 57 | |
58 | 58 | function displayListPlain($layout_def) |
59 | 59 | { |
@@ -85,10 +85,10 @@ discard block |
||
85 | 85 | return $cell; |
86 | 86 | } |
87 | 87 | |
88 | - function queryFilterStarts_With(&$layout_def) |
|
89 | - { |
|
88 | + function queryFilterStarts_With(&$layout_def) |
|
89 | + { |
|
90 | 90 | return $this->queryFilterEquals($layout_def); |
91 | - } |
|
91 | + } |
|
92 | 92 | |
93 | 93 | function displayInput(&$layout_def) |
94 | 94 | { |
@@ -50,39 +50,39 @@ |
||
50 | 50 | return parent::getWidgetId(); |
51 | 51 | } |
52 | 52 | |
53 | - function display($defines, $additionalFormFields = NULL, $nonbutton = false) |
|
54 | - { |
|
55 | - global $app_strings; |
|
56 | - global $currentModule; |
|
53 | + function display($defines, $additionalFormFields = NULL, $nonbutton = false) |
|
54 | + { |
|
55 | + global $app_strings; |
|
56 | + global $currentModule; |
|
57 | 57 | |
58 | - $title = $app_strings['LBL_NEW_BUTTON_TITLE']; |
|
59 | - //$accesskey = $app_strings['LBL_NEW_BUTTON_KEY']; |
|
60 | - $value = $app_strings['LBL_NEW_BUTTON_LABEL']; |
|
61 | - $this->module = 'Contacts'; |
|
62 | - if( ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], 'edit', true)){ |
|
63 | - $button = "<input title='$title'class='button' type='button' name='button' value=' $value ' disabled/>\n"; |
|
64 | - return $button; |
|
65 | - } |
|
58 | + $title = $app_strings['LBL_NEW_BUTTON_TITLE']; |
|
59 | + //$accesskey = $app_strings['LBL_NEW_BUTTON_KEY']; |
|
60 | + $value = $app_strings['LBL_NEW_BUTTON_LABEL']; |
|
61 | + $this->module = 'Contacts'; |
|
62 | + if( ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], 'edit', true)){ |
|
63 | + $button = "<input title='$title'class='button' type='button' name='button' value=' $value ' disabled/>\n"; |
|
64 | + return $button; |
|
65 | + } |
|
66 | 66 | |
67 | - $additionalFormFields = array(); |
|
68 | - if(isset($defines['focus']->billing_address_street)) |
|
69 | - $additionalFormFields['primary_address_street'] = $defines['focus']->billing_address_street; |
|
70 | - if(isset($defines['focus']->billing_address_city)) |
|
71 | - $additionalFormFields['primary_address_city'] = $defines['focus']->billing_address_city; |
|
72 | - if(isset($defines['focus']->billing_address_state)) |
|
73 | - $additionalFormFields['primary_address_state'] = $defines['focus']->billing_address_state; |
|
74 | - if(isset($defines['focus']->billing_address_country)) |
|
75 | - $additionalFormFields['primary_address_country'] = $defines['focus']->billing_address_country; |
|
76 | - if(isset($defines['focus']->billing_address_postalcode)) |
|
77 | - $additionalFormFields['primary_address_postalcode'] = $defines['focus']->billing_address_postalcode; |
|
78 | - if(isset($defines['focus']->phone_office)) |
|
79 | - $additionalFormFields['phone_work'] = $defines['focus']->phone_office; |
|
67 | + $additionalFormFields = array(); |
|
68 | + if(isset($defines['focus']->billing_address_street)) |
|
69 | + $additionalFormFields['primary_address_street'] = $defines['focus']->billing_address_street; |
|
70 | + if(isset($defines['focus']->billing_address_city)) |
|
71 | + $additionalFormFields['primary_address_city'] = $defines['focus']->billing_address_city; |
|
72 | + if(isset($defines['focus']->billing_address_state)) |
|
73 | + $additionalFormFields['primary_address_state'] = $defines['focus']->billing_address_state; |
|
74 | + if(isset($defines['focus']->billing_address_country)) |
|
75 | + $additionalFormFields['primary_address_country'] = $defines['focus']->billing_address_country; |
|
76 | + if(isset($defines['focus']->billing_address_postalcode)) |
|
77 | + $additionalFormFields['primary_address_postalcode'] = $defines['focus']->billing_address_postalcode; |
|
78 | + if(isset($defines['focus']->phone_office)) |
|
79 | + $additionalFormFields['phone_work'] = $defines['focus']->phone_office; |
|
80 | 80 | |
81 | 81 | |
82 | - $button = $this->_get_form($defines, $additionalFormFields); |
|
83 | - $button .= "<input title='$title' class='button' type='submit' name='{$this->getWidgetId()}' id='{$this->getWidgetId()}' value=' $value '/>\n"; |
|
84 | - $button .= "</form>"; |
|
85 | - return $button; |
|
86 | - } |
|
82 | + $button = $this->_get_form($defines, $additionalFormFields); |
|
83 | + $button .= "<input title='$title' class='button' type='submit' name='{$this->getWidgetId()}' id='{$this->getWidgetId()}' value=' $value '/>\n"; |
|
84 | + $button .= "</form>"; |
|
85 | + return $button; |
|
86 | + } |
|
87 | 87 | } |
88 | 88 | ?> |
89 | 89 | \ No newline at end of file |
@@ -43,12 +43,12 @@ |
||
43 | 43 | |
44 | 44 | class SugarWidgetFielduser_name extends SugarWidgetFieldname |
45 | 45 | { |
46 | - function displayInput(&$layout_def) |
|
47 | - { |
|
46 | + function displayInput(&$layout_def) |
|
47 | + { |
|
48 | 48 | $selected_users = empty($layout_def['input_name0']) ? '' : $layout_def['input_name0']; |
49 | - $str = '<select multiple="true" size="3" name="' . $layout_def['name'] . '[]">' . get_select_options_with_id(get_user_array(false), $selected_users) . '</select>'; |
|
50 | - return $str; |
|
51 | - } |
|
49 | + $str = '<select multiple="true" size="3" name="' . $layout_def['name'] . '[]">' . get_select_options_with_id(get_user_array(false), $selected_users) . '</select>'; |
|
50 | + return $str; |
|
51 | + } |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | ?> |
@@ -45,77 +45,77 @@ discard block |
||
45 | 45 | |
46 | 46 | class SugarWidgetSubPanelIcon extends SugarWidgetField |
47 | 47 | { |
48 | - function displayHeaderCell($layout_def) |
|
49 | - { |
|
50 | - return ' '; |
|
51 | - } |
|
52 | - |
|
53 | - function displayList($layout_def) |
|
54 | - { |
|
55 | - global $app_strings; |
|
56 | - global $app_list_strings; |
|
57 | - global $current_user; |
|
58 | - |
|
59 | - if(isset($layout_def['varname'])) |
|
60 | - { |
|
61 | - $key = strtoupper($layout_def['varname']); |
|
62 | - } |
|
63 | - else |
|
64 | - { |
|
65 | - $key = $this->_get_column_alias($layout_def); |
|
66 | - $key = strtoupper($key); |
|
67 | - } |
|
48 | + function displayHeaderCell($layout_def) |
|
49 | + { |
|
50 | + return ' '; |
|
51 | + } |
|
52 | + |
|
53 | + function displayList($layout_def) |
|
54 | + { |
|
55 | + global $app_strings; |
|
56 | + global $app_list_strings; |
|
57 | + global $current_user; |
|
58 | + |
|
59 | + if(isset($layout_def['varname'])) |
|
60 | + { |
|
61 | + $key = strtoupper($layout_def['varname']); |
|
62 | + } |
|
63 | + else |
|
64 | + { |
|
65 | + $key = $this->_get_column_alias($layout_def); |
|
66 | + $key = strtoupper($key); |
|
67 | + } |
|
68 | 68 | //add module image |
69 | - //add module image |
|
70 | - if(!empty($layout_def['target_module_key'])) { |
|
71 | - if (!empty($layout_def['fields'][strtoupper($layout_def['target_module_key'])])) { |
|
72 | - $module=$layout_def['fields'][strtoupper($layout_def['target_module_key'])]; |
|
73 | - } |
|
74 | - } |
|
69 | + //add module image |
|
70 | + if(!empty($layout_def['target_module_key'])) { |
|
71 | + if (!empty($layout_def['fields'][strtoupper($layout_def['target_module_key'])])) { |
|
72 | + $module=$layout_def['fields'][strtoupper($layout_def['target_module_key'])]; |
|
73 | + } |
|
74 | + } |
|
75 | 75 | |
76 | 76 | if (empty($module)) { |
77 | - if(empty($layout_def['target_module'])) |
|
78 | - { |
|
79 | - $module = $layout_def['module']; |
|
80 | - } |
|
81 | - else |
|
82 | - { |
|
83 | - $module = $layout_def['target_module']; |
|
84 | - } |
|
85 | - } |
|
86 | - $action = 'DetailView'; |
|
87 | - if(empty($layout_def['target_record_key'])) |
|
88 | - { |
|
89 | - $record = $layout_def['fields']['ID']; |
|
90 | - } |
|
91 | - else |
|
92 | - { |
|
93 | - $record_key = strtoupper($layout_def['target_record_key']); |
|
94 | - $record = $layout_def['fields'][$record_key]; |
|
95 | - } |
|
96 | - $action_access = false; |
|
97 | - if(!empty($record) && |
|
98 | - ($layout_def[$action] && !$layout_def['owner_module'] |
|
99 | - || $layout_def[$action] && !ACLController::moduleSupportsACL($layout_def['owner_module']) |
|
100 | - || ACLController::checkAccess($layout_def['owner_module'], 'view', $layout_def['owner_id'] == $current_user->id))) { |
|
101 | - $action_access = true; |
|
102 | - } |
|
103 | - $icon_img_html = SugarThemeRegistry::current()->getImage( $module . '', 'border="0"',null,null,'.gif',$app_list_strings['moduleList'][$module]); |
|
104 | - if (!empty($layout_def['attachment_image_only']) && $layout_def['attachment_image_only'] == true) { |
|
105 | - $ret=""; |
|
106 | - } else { |
|
107 | - if ($action_access) { |
|
108 | - $ret = '<a href="index.php?module=' . $module . '&action=' . $action . '&record=' . $record . '" >' . $icon_img_html . "</a>"; |
|
109 | - } else { |
|
110 | - $ret = $icon_img_html; |
|
111 | - } |
|
112 | - } |
|
113 | - |
|
114 | - if(!empty($layout_def['image2']) && !empty($layout_def['image2_ext_url_field'])){ |
|
115 | - |
|
116 | - if (!empty($layout_def['fields'][strtoupper($layout_def['image2_ext_url_field'])])) { |
|
117 | - $link_url = $layout_def['fields'][strtoupper($layout_def['image2_ext_url_field'])]; |
|
118 | - } |
|
77 | + if(empty($layout_def['target_module'])) |
|
78 | + { |
|
79 | + $module = $layout_def['module']; |
|
80 | + } |
|
81 | + else |
|
82 | + { |
|
83 | + $module = $layout_def['target_module']; |
|
84 | + } |
|
85 | + } |
|
86 | + $action = 'DetailView'; |
|
87 | + if(empty($layout_def['target_record_key'])) |
|
88 | + { |
|
89 | + $record = $layout_def['fields']['ID']; |
|
90 | + } |
|
91 | + else |
|
92 | + { |
|
93 | + $record_key = strtoupper($layout_def['target_record_key']); |
|
94 | + $record = $layout_def['fields'][$record_key]; |
|
95 | + } |
|
96 | + $action_access = false; |
|
97 | + if(!empty($record) && |
|
98 | + ($layout_def[$action] && !$layout_def['owner_module'] |
|
99 | + || $layout_def[$action] && !ACLController::moduleSupportsACL($layout_def['owner_module']) |
|
100 | + || ACLController::checkAccess($layout_def['owner_module'], 'view', $layout_def['owner_id'] == $current_user->id))) { |
|
101 | + $action_access = true; |
|
102 | + } |
|
103 | + $icon_img_html = SugarThemeRegistry::current()->getImage( $module . '', 'border="0"',null,null,'.gif',$app_list_strings['moduleList'][$module]); |
|
104 | + if (!empty($layout_def['attachment_image_only']) && $layout_def['attachment_image_only'] == true) { |
|
105 | + $ret=""; |
|
106 | + } else { |
|
107 | + if ($action_access) { |
|
108 | + $ret = '<a href="index.php?module=' . $module . '&action=' . $action . '&record=' . $record . '" >' . $icon_img_html . "</a>"; |
|
109 | + } else { |
|
110 | + $ret = $icon_img_html; |
|
111 | + } |
|
112 | + } |
|
113 | + |
|
114 | + if(!empty($layout_def['image2']) && !empty($layout_def['image2_ext_url_field'])){ |
|
115 | + |
|
116 | + if (!empty($layout_def['fields'][strtoupper($layout_def['image2_ext_url_field'])])) { |
|
117 | + $link_url = $layout_def['fields'][strtoupper($layout_def['image2_ext_url_field'])]; |
|
118 | + } |
|
119 | 119 | |
120 | 120 | $imagePath = ''; |
121 | 121 | if ( $layout_def['image2'] == '__VARIABLE' ) { |
@@ -132,34 +132,34 @@ discard block |
||
132 | 132 | } |
133 | 133 | } |
134 | 134 | //if requested, add attachment icon. |
135 | - if(!empty($layout_def['image2']) && !empty($layout_def['image2_url_field'])){ |
|
135 | + if(!empty($layout_def['image2']) && !empty($layout_def['image2_url_field'])){ |
|
136 | 136 | |
137 | - if (is_array($layout_def['image2_url_field'])) { |
|
138 | - //Generate file url. |
|
139 | - if (!empty($layout_def['fields'][strtoupper($layout_def['image2_url_field']['id_field'])]) |
|
140 | - and !empty($layout_def['fields'][strtoupper($layout_def['image2_url_field']['filename_field'])]) ) { |
|
137 | + if (is_array($layout_def['image2_url_field'])) { |
|
138 | + //Generate file url. |
|
139 | + if (!empty($layout_def['fields'][strtoupper($layout_def['image2_url_field']['id_field'])]) |
|
140 | + and !empty($layout_def['fields'][strtoupper($layout_def['image2_url_field']['filename_field'])]) ) { |
|
141 | 141 | |
142 | - $key=$layout_def['fields'][strtoupper($layout_def['image2_url_field']['id_field'])]; |
|
142 | + $key=$layout_def['fields'][strtoupper($layout_def['image2_url_field']['id_field'])]; |
|
143 | 143 | $file=$layout_def['fields'][strtoupper($layout_def['image2_url_field']['filename_field'])]; |
144 | 144 | $filepath="index.php?entryPoint=download&id=".$key."&type=".$layout_def['module']; |
145 | - } |
|
146 | - } else { |
|
147 | - if (!empty($layout_def['fields'][strtoupper($layout_def['image2_url_field'])])) { |
|
148 | - $filepath="index.php?entryPoint=download&id=".$layout_def['fields']['ID']."&type=".$layout_def['module']; |
|
149 | - } |
|
150 | - } |
|
151 | - $icon_img_html = SugarThemeRegistry::current()->getImage( $layout_def['image2'] . '', 'border="0"',null,null,'.gif',$layout_def['image2']); |
|
152 | - if ($action_access && !empty($filepath)) { |
|
153 | - $ret .= '<a href="' . $filepath. '" >' . "$icon_img_html</a>"; |
|
154 | - } elseif (!empty($filepath)) { |
|
155 | - $ret .= $icon_img_html; |
|
156 | - } |
|
157 | - } |
|
158 | - // now handle attachments for Emails |
|
159 | - else if(!empty($layout_def['module']) && $layout_def['module'] == 'Emails' && !empty($layout_def['fields']['ATTACHMENT_IMAGE'])) { |
|
160 | - $ret.= $layout_def['fields']['ATTACHMENT_IMAGE']; |
|
161 | - } |
|
162 | - return $ret; |
|
163 | - } |
|
145 | + } |
|
146 | + } else { |
|
147 | + if (!empty($layout_def['fields'][strtoupper($layout_def['image2_url_field'])])) { |
|
148 | + $filepath="index.php?entryPoint=download&id=".$layout_def['fields']['ID']."&type=".$layout_def['module']; |
|
149 | + } |
|
150 | + } |
|
151 | + $icon_img_html = SugarThemeRegistry::current()->getImage( $layout_def['image2'] . '', 'border="0"',null,null,'.gif',$layout_def['image2']); |
|
152 | + if ($action_access && !empty($filepath)) { |
|
153 | + $ret .= '<a href="' . $filepath. '" >' . "$icon_img_html</a>"; |
|
154 | + } elseif (!empty($filepath)) { |
|
155 | + $ret .= $icon_img_html; |
|
156 | + } |
|
157 | + } |
|
158 | + // now handle attachments for Emails |
|
159 | + else if(!empty($layout_def['module']) && $layout_def['module'] == 'Emails' && !empty($layout_def['fields']['ATTACHMENT_IMAGE'])) { |
|
160 | + $ret.= $layout_def['fields']['ATTACHMENT_IMAGE']; |
|
161 | + } |
|
162 | + return $ret; |
|
163 | + } |
|
164 | 164 | } |
165 | 165 | ?> |
@@ -45,21 +45,21 @@ |
||
45 | 45 | |
46 | 46 | class SugarWidgetSubPanelConcat extends SugarWidgetField |
47 | 47 | { |
48 | - function displayList(&$layout_def) |
|
49 | - { |
|
50 | - $value=''; |
|
51 | - if (isset($layout_def['source']) and is_array($layout_def['source']) and isset($layout_def['fields']) and is_array($layout_def['fields'])) { |
|
48 | + function displayList(&$layout_def) |
|
49 | + { |
|
50 | + $value=''; |
|
51 | + if (isset($layout_def['source']) and is_array($layout_def['source']) and isset($layout_def['fields']) and is_array($layout_def['fields'])) { |
|
52 | 52 | |
53 | - foreach ($layout_def['source'] as $field) { |
|
53 | + foreach ($layout_def['source'] as $field) { |
|
54 | 54 | |
55 | - if (isset($layout_def['fields'][strtoupper($field)])) { |
|
56 | - $value.=$layout_def['fields'][strtoupper($field)]; |
|
57 | - } else { |
|
58 | - $value.=$field; |
|
59 | - } |
|
60 | - } |
|
61 | - } |
|
62 | - return $value; |
|
63 | - } |
|
55 | + if (isset($layout_def['fields'][strtoupper($field)])) { |
|
56 | + $value.=$layout_def['fields'][strtoupper($field)]; |
|
57 | + } else { |
|
58 | + $value.=$field; |
|
59 | + } |
|
60 | + } |
|
61 | + } |
|
62 | + return $value; |
|
63 | + } |
|
64 | 64 | } |
65 | 65 | ?> |
66 | 66 | \ No newline at end of file |