@@ -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. |
@@ -46,17 +46,17 @@ discard block |
||
46 | 46 | function displayInput(&$layout_def) { |
47 | 47 | global $app_list_strings; |
48 | 48 | |
49 | - if(!empty($layout_def['remove_blank']) && $layout_def['remove_blank']) { |
|
50 | - if ( is_array($layout_def['options']) ) { |
|
49 | + if (!empty($layout_def['remove_blank']) && $layout_def['remove_blank']) { |
|
50 | + if (is_array($layout_def['options'])) { |
|
51 | 51 | $ops = $layout_def['options']; |
52 | 52 | } |
53 | - elseif (isset($layout_def['options']) && isset($app_list_strings[$layout_def['options']])){ |
|
53 | + elseif (isset($layout_def['options']) && isset($app_list_strings[$layout_def['options']])) { |
|
54 | 54 | $ops = $app_list_strings[$layout_def['options']]; |
55 | - if(array_key_exists('', $app_list_strings[$layout_def['options']])) { |
|
55 | + if (array_key_exists('', $app_list_strings[$layout_def['options']])) { |
|
56 | 56 | unset($ops['']); |
57 | 57 | } |
58 | 58 | } |
59 | - else{ |
|
59 | + else { |
|
60 | 60 | $ops = array(); |
61 | 61 | } |
62 | 62 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $ops = $app_list_strings[$layout_def['options']]; |
65 | 65 | } |
66 | 66 | |
67 | - $str = '<select name="' . $layout_def['name'] . '">'; |
|
67 | + $str = '<select name="'.$layout_def['name'].'">'; |
|
68 | 68 | $str .= get_select_options_with_id($ops, $layout_def['input_name0']); |
69 | 69 | $str .= '</select>'; |
70 | 70 | return $str; |
@@ -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. |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | { |
47 | 47 | public function getWidgetId($buttonSuffix = true) |
48 | 48 | { |
49 | - return parent::getWidgetId() . '_select_button'; |
|
49 | + return parent::getWidgetId().'_select_button'; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | function display($widget_data) |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | $this->title = $app_strings['LBL_SELECT_BUTTON_TITLE']; |
61 | 61 | $this->value = $app_strings['LBL_SELECT_BUTTON_LABEL']; |
62 | - $this->module = 'Campaigns';//'CampaignLog'; |
|
62 | + $this->module = 'Campaigns'; //'CampaignLog'; |
|
63 | 63 | $this->module_name = 'Campaigns'; |
64 | 64 | |
65 | 65 | |
@@ -68,52 +68,52 @@ discard block |
||
68 | 68 | |
69 | 69 | |
70 | 70 | $focus = $widget_data['focus']; |
71 | - if(ACLController::moduleSupportsACL($widget_data['module']) && !ACLController::checkAccess($widget_data['module'], 'list', true)){ |
|
72 | - $button = ' <input type="button" name="' . $this->getWidgetId() . '" id="' . $this->getWidgetId() . '" class="button"' . "\n" |
|
73 | - . ' title="' . $this->title . '"' |
|
74 | - . ' value="' . $this->value . "\"\n" |
|
71 | + if (ACLController::moduleSupportsACL($widget_data['module']) && !ACLController::checkAccess($widget_data['module'], 'list', true)) { |
|
72 | + $button = ' <input type="button" name="'.$this->getWidgetId().'" id="'.$this->getWidgetId().'" class="button"'."\n" |
|
73 | + . ' title="'.$this->title.'"' |
|
74 | + . ' value="'.$this->value."\"\n" |
|
75 | 75 | .' disabled />'; |
76 | 76 | return $button; |
77 | 77 | } |
78 | 78 | |
79 | 79 | //refresh the whole page after end of action? |
80 | 80 | $refresh_page = 0; |
81 | - if(!empty($widget_data['subpanel_definition']->_instance_properties['refresh_page'])){ |
|
81 | + if (!empty($widget_data['subpanel_definition']->_instance_properties['refresh_page'])) { |
|
82 | 82 | $refresh_page = 1; |
83 | 83 | } |
84 | 84 | |
85 | 85 | $subpanel_definition = $widget_data['subpanel_definition']; |
86 | 86 | $button_definition = $subpanel_definition->get_buttons(); |
87 | - $subpanel_name = $this->module; //"Campaigns";//$subpanel_definition->get_module_name(); |
|
87 | + $subpanel_name = $this->module; //"Campaigns";//$subpanel_definition->get_module_name(); |
|
88 | 88 | if (empty($this->module_name)) { |
89 | 89 | $this->module_name = $subpanel_name; |
90 | 90 | } |
91 | 91 | $link_field_name = $subpanel_definition->get_data_source_name(true); |
92 | - $popup_mode='multiselect'; |
|
93 | - if(isset($widget_data['mode'])){ |
|
94 | - $popup_mode=$widget_data['mode']; |
|
92 | + $popup_mode = 'multiselect'; |
|
93 | + if (isset($widget_data['mode'])) { |
|
94 | + $popup_mode = $widget_data['mode']; |
|
95 | 95 | } |
96 | - if(isset($widget_data['initial_filter_fields'])){ |
|
96 | + if (isset($widget_data['initial_filter_fields'])) { |
|
97 | 97 | if (is_array($widget_data['initial_filter_fields'])) { |
98 | 98 | foreach ($widget_data['initial_filter_fields'] as $value=>$alias) { |
99 | 99 | if (isset($focus->$value) and !empty($focus->$value)) { |
100 | - $initial_filter.="&".$alias . '='.urlencode($focus->$value); |
|
100 | + $initial_filter .= "&".$alias.'='.urlencode($focus->$value); |
|
101 | 101 | } |
102 | 102 | } |
103 | 103 | } |
104 | 104 | } |
105 | - $create="true"; |
|
106 | - if(isset($widget_data['create'])){ |
|
107 | - $create=$widget_data['create']; |
|
105 | + $create = "true"; |
|
106 | + if (isset($widget_data['create'])) { |
|
107 | + $create = $widget_data['create']; |
|
108 | 108 | } |
109 | 109 | $return_module = $_REQUEST['module']; |
110 | 110 | $return_action = 'SubPanelViewer'; |
111 | 111 | $return_id = $_REQUEST['record']; |
112 | 112 | |
113 | 113 | //field_to_name_array |
114 | - $fton_array= array('id' => 'subpanel_id'); |
|
115 | - if(isset($widget_data['field_to_name_array']) && is_array($widget_data['field_to_name_array'])){ |
|
116 | - $fton_array=array_merge($fton_array,$widget_data['field_to_name_array']); |
|
114 | + $fton_array = array('id' => 'subpanel_id'); |
|
115 | + if (isset($widget_data['field_to_name_array']) && is_array($widget_data['field_to_name_array'])) { |
|
116 | + $fton_array = array_merge($fton_array, $widget_data['field_to_name_array']); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | $return_url = "index.php?module=$return_module&action=$return_action&subpanel=$subpanel_name&record=$return_id&sugar_body_only=1"; |
@@ -132,20 +132,20 @@ discard block |
||
132 | 132 | ); |
133 | 133 | |
134 | 134 | if (is_array($this->button_properties) && !empty($this->button_properties['add_to_passthru_data'])) { |
135 | - $popup_request_data['passthru_data']= array_merge($popup_request_data['passthru_data'],$this->button_properties['add_to_passthru_data']); |
|
135 | + $popup_request_data['passthru_data'] = array_merge($popup_request_data['passthru_data'], $this->button_properties['add_to_passthru_data']); |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | if (is_array($this->button_properties) && !empty($this->button_properties['add_to_passthru_data']['return_type'])) { |
139 | 139 | |
140 | - if ($this->button_properties['add_to_passthru_data']['return_type']=='report') { |
|
141 | - $initial_filter = "&module_name=". urlencode($widget_data['module']); |
|
140 | + if ($this->button_properties['add_to_passthru_data']['return_type'] == 'report') { |
|
141 | + $initial_filter = "&module_name=".urlencode($widget_data['module']); |
|
142 | 142 | } |
143 | 143 | } |
144 | 144 | $json_encoded_php_array = $this->_create_json_encoded_popup_request($popup_request_data); |
145 | - return '<form action="index.php?module=CampaignLog&action=AddCampaignLog&type=contact">' . "\n" |
|
146 | - . ' <input type="button" name="' . $this->getWidgetId() . '_select_button" id="' . $this->getWidgetId() . '" class="button"' . "\n" |
|
147 | - . ' title="' . $this->title . '"' |
|
148 | - . ' value="' . $this->value . "\"\n" |
|
145 | + return '<form action="index.php?module=CampaignLog&action=AddCampaignLog&type=contact">'."\n" |
|
146 | + . ' <input type="button" name="'.$this->getWidgetId().'_select_button" id="'.$this->getWidgetId().'" class="button"'."\n" |
|
147 | + . ' title="'.$this->title.'"' |
|
148 | + . ' value="'.$this->value."\"\n" |
|
149 | 149 | . " onclick='open_popup(\"$this->module_name\",600,400,\"$initial_filter\",true,true,$json_encoded_php_array,\"$popup_mode\",$create);' /></form>\n"; |
150 | 150 | } |
151 | 151 | } |
@@ -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. |
@@ -56,19 +56,19 @@ discard block |
||
56 | 56 | global $subpanel_item_count; |
57 | 57 | $unique_id = $layout_def['subpanel_id']."_edit_".$subpanel_item_count; //bug 51512 |
58 | 58 | |
59 | - $href = 'index.php?module=' . $layout_def['module'] |
|
60 | - . '&action=' . 'ContactOpportunityRelationshipEdit' |
|
61 | - . '&record=' . $layout_def['fields']['OPPORTUNITY_ROLE_ID'] |
|
62 | - . '&return_module=' . $_REQUEST['module'] |
|
63 | - . '&return_action=' . 'DetailView' |
|
64 | - . '&return_id=' . $_REQUEST['record']; |
|
59 | + $href = 'index.php?module='.$layout_def['module'] |
|
60 | + . '&action='.'ContactOpportunityRelationshipEdit' |
|
61 | + . '&record='.$layout_def['fields']['OPPORTUNITY_ROLE_ID'] |
|
62 | + . '&return_module='.$_REQUEST['module'] |
|
63 | + . '&return_action='.'DetailView' |
|
64 | + . '&return_id='.$_REQUEST['record']; |
|
65 | 65 | |
66 | 66 | //based on listview since that lets you select records |
67 | - if($layout_def['ListView']){ |
|
68 | - return '<a href="' . $href . '"' |
|
67 | + if ($layout_def['ListView']) { |
|
68 | + return '<a href="'.$href.'"' |
|
69 | 69 | . "id=\"$unique_id\"" |
70 | - . 'class="listViewTdToolsS1">' . $app_strings['LNK_EDIT'] .'</a> '; |
|
71 | - }else{ |
|
70 | + . 'class="listViewTdToolsS1">'.$app_strings['LNK_EDIT'].'</a> '; |
|
71 | + } else { |
|
72 | 72 | return ''; |
73 | 73 | } |
74 | 74 | } |
@@ -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. |
@@ -50,15 +50,15 @@ discard block |
||
50 | 50 | global $app_strings; |
51 | 51 | global $currentModule; |
52 | 52 | |
53 | - $this->module="Notes"; |
|
53 | + $this->module = "Notes"; |
|
54 | 54 | $this->subpanelDiv = "history"; |
55 | 55 | |
56 | 56 | // Create the additional form fields with real values if they were not passed in |
57 | - if(empty($additionalFormFields) && $this->additional_form_fields) |
|
57 | + if (empty($additionalFormFields) && $this->additional_form_fields) |
|
58 | 58 | { |
59 | - foreach($this->additional_form_fields as $key=>$value) |
|
59 | + foreach ($this->additional_form_fields as $key=>$value) |
|
60 | 60 | { |
61 | - if(!empty($defines['focus']->$value)) |
|
61 | + if (!empty($defines['focus']->$value)) |
|
62 | 62 | { |
63 | 63 | $additionalFormFields[$key] = $defines['focus']->$value; |
64 | 64 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
72 | - if(!empty($this->module)) |
|
72 | + if (!empty($this->module)) |
|
73 | 73 | { |
74 | 74 | $defines['child_module_name'] = $this->module; |
75 | 75 | } |
@@ -78,45 +78,45 @@ discard block |
||
78 | 78 | $defines['child_module_name'] = $defines['module']; |
79 | 79 | } |
80 | 80 | |
81 | - if(!empty($this->subpanelDiv)) |
|
81 | + if (!empty($this->subpanelDiv)) |
|
82 | 82 | { |
83 | 83 | $defines['subpanelDiv'] = $this->subpanelDiv; |
84 | 84 | } |
85 | 85 | |
86 | - $defines['parent_bean_name'] = get_class( $defines['focus']); |
|
86 | + $defines['parent_bean_name'] = get_class($defines['focus']); |
|
87 | 87 | |
88 | - $form = 'form' . $defines['child_module_name']; |
|
89 | - $button = '<form onsubmit="return SUGAR.subpanelUtils.sendAndRetrieve(this.id, \'subpanel_' . strtolower($defines['subpanelDiv']) . '\', \'' . addslashes($app_strings['LBL_LOADING']) . '\');" action="index.php" method="post" name="form" id="form' . $form . "\">\n"; |
|
88 | + $form = 'form'.$defines['child_module_name']; |
|
89 | + $button = '<form onsubmit="return SUGAR.subpanelUtils.sendAndRetrieve(this.id, \'subpanel_'.strtolower($defines['subpanelDiv']).'\', \''.addslashes($app_strings['LBL_LOADING']).'\');" action="index.php" method="post" name="form" id="form'.$form."\">\n"; |
|
90 | 90 | |
91 | 91 | //module_button is used to override the value of module name |
92 | 92 | $button .= "<input type='hidden' name='target_module' value='".$defines['child_module_name']."'>\n"; |
93 | 93 | $button .= "<input type='hidden' name='".strtolower($defines['parent_bean_name'])."_id' value='".$defines['focus']->id."'>\n"; |
94 | 94 | |
95 | - if(isset($defines['focus']->name)) |
|
95 | + if (isset($defines['focus']->name)) |
|
96 | 96 | { |
97 | 97 | $button .= "<input type='hidden' name='".strtolower($defines['parent_bean_name'])."_name' value='".$defines['focus']->name."'>"; |
98 | 98 | } |
99 | 99 | |
100 | 100 | $button .= '<input type="hidden" name="to_pdf" value="true" />'; |
101 | 101 | $button .= '<input type="hidden" name="tpl" value="QuickCreate.tpl" />'; |
102 | - $button .= '<input type="hidden" name="return_module" value="' . $currentModule . "\" />\n"; |
|
103 | - $button .= '<input type="hidden" name="return_action" value="' . $defines['action'] . "\" />\n"; |
|
104 | - $button .= '<input type="hidden" name="return_id" value="' . $defines['focus']->id . "\" />\n"; |
|
102 | + $button .= '<input type="hidden" name="return_module" value="'.$currentModule."\" />\n"; |
|
103 | + $button .= '<input type="hidden" name="return_action" value="'.$defines['action']."\" />\n"; |
|
104 | + $button .= '<input type="hidden" name="return_id" value="'.$defines['focus']->id."\" />\n"; |
|
105 | 105 | $button .= '<input type="hidden" name="record" value="" />'; |
106 | 106 | |
107 | 107 | // TODO: move this out and get $additionalFormFields working properly |
108 | - if(empty($additionalFormFields['parent_type'])) |
|
108 | + if (empty($additionalFormFields['parent_type'])) |
|
109 | 109 | { |
110 | - if($defines['focus']->object_name=='Contact') { |
|
110 | + if ($defines['focus']->object_name == 'Contact') { |
|
111 | 111 | $additionalFormFields['parent_type'] = 'Accounts'; |
112 | 112 | } |
113 | 113 | else { |
114 | 114 | $additionalFormFields['parent_type'] = $defines['focus']->module_dir; |
115 | 115 | } |
116 | 116 | } |
117 | - if(empty($additionalFormFields['parent_name'])) |
|
117 | + if (empty($additionalFormFields['parent_name'])) |
|
118 | 118 | { |
119 | - if($defines['focus']->object_name=='Contact') { |
|
119 | + if ($defines['focus']->object_name == 'Contact') { |
|
120 | 120 | $additionalFormFields['parent_name'] = $defines['focus']->account_name; |
121 | 121 | $additionalFormFields['account_name'] = $defines['focus']->account_name; |
122 | 122 | } |
@@ -124,9 +124,9 @@ discard block |
||
124 | 124 | $additionalFormFields['parent_name'] = $defines['focus']->name; |
125 | 125 | } |
126 | 126 | } |
127 | - if(empty($additionalFormFields['parent_id'])) |
|
127 | + if (empty($additionalFormFields['parent_id'])) |
|
128 | 128 | { |
129 | - if($defines['focus']->object_name=='Contact') { |
|
129 | + if ($defines['focus']->object_name == 'Contact') { |
|
130 | 130 | $additionalFormFields['parent_id'] = $defines['focus']->account_id; |
131 | 131 | $additionalFormFields['account_id'] = $defines['focus']->account_id; |
132 | 132 | } |
@@ -135,16 +135,16 @@ discard block |
||
135 | 135 | } |
136 | 136 | } |
137 | 137 | |
138 | - $button .= '<input type="hidden" name="action" value="SubpanelCreates" />' . "\n"; |
|
139 | - $button .= '<input type="hidden" name="module" value="Home" />' . "\n"; |
|
140 | - $button .= '<input type="hidden" name="target_action" value="QuickCreate" />' . "\n"; |
|
138 | + $button .= '<input type="hidden" name="action" value="SubpanelCreates" />'."\n"; |
|
139 | + $button .= '<input type="hidden" name="module" value="Home" />'."\n"; |
|
140 | + $button .= '<input type="hidden" name="target_action" value="QuickCreate" />'."\n"; |
|
141 | 141 | |
142 | 142 | // fill in additional form fields for all but action |
143 | - foreach($additionalFormFields as $key => $value) |
|
143 | + foreach ($additionalFormFields as $key => $value) |
|
144 | 144 | { |
145 | - if($key != 'action') |
|
145 | + if ($key != 'action') |
|
146 | 146 | { |
147 | - $button .= '<input type="hidden" name="' . $key . '" value="' . $value . '" />' . "\n"; |
|
147 | + $button .= '<input type="hidden" name="'.$key.'" value="'.$value.'" />'."\n"; |
|
148 | 148 | } |
149 | 149 | } |
150 | 150 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | function display($defines, $additionalFormFields = null, $nonbutton = false) |
156 | 156 | { |
157 | 157 | $focus = new Note; |
158 | - if ( !$focus->ACLAccess('EditView') ) { |
|
158 | + if (!$focus->ACLAccess('EditView')) { |
|
159 | 159 | return ''; |
160 | 160 | } |
161 | 161 |
@@ -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. |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | * Bug25633 code change start |
54 | 54 | */ |
55 | 55 | if (!ACLController::checkAccess($widget_data["module"], "edit", true)) { |
56 | - return ; |
|
56 | + return; |
|
57 | 57 | } |
58 | 58 | /* |
59 | 59 | * Bug25633 code change end |
@@ -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,7 +47,7 @@ discard block |
||
47 | 47 | { |
48 | 48 | global $mod_strings; |
49 | 49 | $button = "<script src='include/javascript/checkbox.js' type='text/javascript'></script>"; |
50 | - $button .= "<form id='CustSelectForm' name='CustSelectForm' method='post' action=''>"; |
|
50 | + $button .= "<form id='CustSelectForm' name='CustSelectForm' method='post' action=''>"; |
|
51 | 51 | |
52 | 52 | // $button .= "<input id='custom_hidden_5' type='hidden' name='custom_hidden_5' value=''/>"; |
53 | 53 | $button .= "<input id='Custom_Select' class='button' type='button' name='Custom_Select' onclick='select_targets()' value='".$mod_strings['LBL_SELECT_DELEGATES']."'/>\n</form>"; |
@@ -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. |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | function displayList(&$layout_def) |
54 | 54 | { |
55 | - die("<pre>" . print_r($layout_def, true) . "</pre>"); |
|
55 | + die("<pre>".print_r($layout_def, true)."</pre>"); |
|
56 | 56 | |
57 | 57 | $rel = $layout_def['linked_field']; |
58 | 58 | $module = $layout_def['module']; |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | |
61 | 61 | global $app_strings; |
62 | 62 | |
63 | - $edit_icon_html = SugarThemeRegistry::current()->getImage( 'edit_inline', |
|
64 | - 'align="absmiddle" alt="' . $app_strings['LNK_EDIT'] . '" border="0"'); |
|
63 | + $edit_icon_html = SugarThemeRegistry::current()->getImage('edit_inline', |
|
64 | + 'align="absmiddle" alt="'.$app_strings['LNK_EDIT'].'" border="0"'); |
|
65 | 65 | |
66 | 66 | $script = " |
67 | 67 | function editRel(name, id, module) { |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | |
91 | 91 | return "<script>$script</script>" |
92 | 92 | . '<div onclick="editRel(\'p1_b1_accounts\', \'cac203f3-0380-495f-3231-4cf58f089f00\', \'Accounts\')">' |
93 | - . $edit_icon_html . "</div>"; |
|
93 | + . $edit_icon_html."</div>"; |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | } |
@@ -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. |
@@ -56,13 +56,13 @@ discard block |
||
56 | 56 | |
57 | 57 | function display($defines, $additionalFormFields = NULL, $nonbutton = false) |
58 | 58 | { |
59 | - if((ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], 'edit', true) || |
|
60 | - $defines['module'] == "Activities" & !ACLController::checkAccess("Emails", 'edit', true))){ |
|
59 | + if ((ACLController::moduleSupportsACL($defines['module']) && !ACLController::checkAccess($defines['module'], 'edit', true) || |
|
60 | + $defines['module'] == "Activities" & !ACLController::checkAccess("Emails", 'edit', true))) { |
|
61 | 61 | $temp = ''; |
62 | 62 | return $temp; |
63 | 63 | } |
64 | 64 | |
65 | - global $app_strings,$current_user,$sugar_config,$beanList,$beanFiles; |
|
65 | + global $app_strings, $current_user, $sugar_config, $beanList, $beanFiles; |
|
66 | 66 | $title = $app_strings['LBL_COMPOSE_EMAIL_BUTTON_TITLE']; |
67 | 67 | //$accesskey = $app_strings['LBL_COMPOSE_EMAIL_BUTTON_KEY']; |
68 | 68 | $value = $app_strings['LBL_COMPOSE_EMAIL_BUTTON_LABEL']; |
@@ -72,20 +72,20 @@ discard block |
||
72 | 72 | //martin Bug 19660 |
73 | 73 | $userPref = $current_user->getPreference('email_link_type'); |
74 | 74 | $defaultPref = $sugar_config['email_default_client']; |
75 | - if($userPref != '') { |
|
75 | + if ($userPref != '') { |
|
76 | 76 | $client = $userPref; |
77 | 77 | } else { |
78 | 78 | $client = $defaultPref; |
79 | 79 | } |
80 | - if($client != 'sugar') { |
|
80 | + if ($client != 'sugar') { |
|
81 | 81 | $bean = $defines['focus']; |
82 | 82 | // awu: Not all beans have emailAddress property, we must account for this |
83 | - if (isset($bean->emailAddress)){ |
|
83 | + if (isset($bean->emailAddress)) { |
|
84 | 84 | $to_addrs = $bean->emailAddress->getPrimaryAddress($bean); |
85 | - $button = "<input class='button' type='button' value='$value' id='". $this->getWidgetId() . "' name='".preg_replace('[ ]', '', $value)."' title='$title' onclick=\"location.href='mailto:$to_addrs';return false;\" />"; |
|
85 | + $button = "<input class='button' type='button' value='$value' id='".$this->getWidgetId()."' name='".preg_replace('[ ]', '', $value)."' title='$title' onclick=\"location.href='mailto:$to_addrs';return false;\" />"; |
|
86 | 86 | } |
87 | - else{ |
|
88 | - $button = "<input class='button' type='button' value='$value' id='". $this->getWidgetId() ."' name='".preg_replace('[ ]', '', $value)."' title='$title' onclick=\"location.href='mailto:';return false;\" />"; |
|
87 | + else { |
|
88 | + $button = "<input class='button' type='button' value='$value' id='".$this->getWidgetId()."' name='".preg_replace('[ ]', '', $value)."' title='$title' onclick=\"location.href='mailto:';return false;\" />"; |
|
89 | 89 | } |
90 | 90 | } else { |
91 | 91 | //Generate the compose package for the quick create options. |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | $eUi = new EmailUI(); |
95 | 95 | $j_quickComposeOptions = $eUi->generateComposePackageForQuickCreate($composeData, http_build_query($composeData), false, $defines['focus']); |
96 | 96 | |
97 | - $button = "<input title='$title' id='". $this->getWidgetId()."' onclick='SUGAR.quickCompose.init($j_quickComposeOptions);' class='button' type='submit' name='".preg_replace('[ ]', '', $value)."_button' value='$value' />"; |
|
97 | + $button = "<input title='$title' id='".$this->getWidgetId()."' onclick='SUGAR.quickCompose.init($j_quickComposeOptions);' class='button' type='submit' name='".preg_replace('[ ]', '', $value)."_button' value='$value' />"; |
|
98 | 98 | } |
99 | 99 | return $button; |
100 | 100 | } |
@@ -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. |
@@ -50,15 +50,15 @@ discard block |
||
50 | 50 | global $app_strings; |
51 | 51 | global $currentModule; |
52 | 52 | |
53 | - $this->module="Calls"; |
|
53 | + $this->module = "Calls"; |
|
54 | 54 | $this->subpanelDiv = "activities"; |
55 | 55 | |
56 | 56 | // Create the additional form fields with real values if they were not passed in |
57 | - if(empty($additionalFormFields) && $this->additional_form_fields) |
|
57 | + if (empty($additionalFormFields) && $this->additional_form_fields) |
|
58 | 58 | { |
59 | - foreach($this->additional_form_fields as $key=>$value) |
|
59 | + foreach ($this->additional_form_fields as $key=>$value) |
|
60 | 60 | { |
61 | - if(!empty($defines['focus']->$value)) |
|
61 | + if (!empty($defines['focus']->$value)) |
|
62 | 62 | { |
63 | 63 | $additionalFormFields[$key] = $defines['focus']->$value; |
64 | 64 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
72 | - if(!empty($this->module)) |
|
72 | + if (!empty($this->module)) |
|
73 | 73 | { |
74 | 74 | $defines['child_module_name'] = $this->module; |
75 | 75 | } |
@@ -78,45 +78,45 @@ discard block |
||
78 | 78 | $defines['child_module_name'] = $defines['module']; |
79 | 79 | } |
80 | 80 | |
81 | - if(!empty($this->subpanelDiv)) |
|
81 | + if (!empty($this->subpanelDiv)) |
|
82 | 82 | { |
83 | 83 | $defines['subpanelDiv'] = $this->subpanelDiv; |
84 | 84 | } |
85 | 85 | |
86 | - $defines['parent_bean_name'] = get_class( $defines['focus']); |
|
86 | + $defines['parent_bean_name'] = get_class($defines['focus']); |
|
87 | 87 | |
88 | - $form = 'form' . $defines['child_module_name']; |
|
89 | - $button = '<form onsubmit="return SUGAR.subpanelUtils.sendAndRetrieve(this.id, \'subpanel_' . strtolower($defines['subpanelDiv']) . '\', \'' . addslashes($app_strings['LBL_LOADING']) . '\');" action="index.php" method="post" name="form" id="form' . $form . "\">\n"; |
|
88 | + $form = 'form'.$defines['child_module_name']; |
|
89 | + $button = '<form onsubmit="return SUGAR.subpanelUtils.sendAndRetrieve(this.id, \'subpanel_'.strtolower($defines['subpanelDiv']).'\', \''.addslashes($app_strings['LBL_LOADING']).'\');" action="index.php" method="post" name="form" id="form'.$form."\">\n"; |
|
90 | 90 | |
91 | 91 | //module_button is used to override the value of module name |
92 | 92 | $button .= "<input type='hidden' name='target_module' value='".$defines['child_module_name']."'>\n"; |
93 | 93 | $button .= "<input type='hidden' name='".strtolower($defines['parent_bean_name'])."_id' value='".$defines['focus']->id."'>\n"; |
94 | 94 | |
95 | - if(isset($defines['focus']->name)) |
|
95 | + if (isset($defines['focus']->name)) |
|
96 | 96 | { |
97 | 97 | $button .= "<input type='hidden' name='".strtolower($defines['parent_bean_name'])."_name' value='".$defines['focus']->name."'>"; |
98 | 98 | } |
99 | 99 | |
100 | 100 | $button .= '<input type="hidden" name="to_pdf" value="true" />'; |
101 | 101 | $button .= '<input type="hidden" name="tpl" value="QuickCreate.tpl" />'; |
102 | - $button .= '<input type="hidden" name="return_module" value="' . $currentModule . "\" />\n"; |
|
103 | - $button .= '<input type="hidden" name="return_action" value="' . $defines['action'] . "\" />\n"; |
|
104 | - $button .= '<input type="hidden" name="return_id" value="' . $defines['focus']->id . "\" />\n"; |
|
102 | + $button .= '<input type="hidden" name="return_module" value="'.$currentModule."\" />\n"; |
|
103 | + $button .= '<input type="hidden" name="return_action" value="'.$defines['action']."\" />\n"; |
|
104 | + $button .= '<input type="hidden" name="return_id" value="'.$defines['focus']->id."\" />\n"; |
|
105 | 105 | $button .= '<input type="hidden" name="record" value="" />'; |
106 | 106 | |
107 | 107 | // TODO: move this out and get $additionalFormFields working properly |
108 | - if(empty($additionalFormFields['parent_type'])) |
|
108 | + if (empty($additionalFormFields['parent_type'])) |
|
109 | 109 | { |
110 | - if($defines['focus']->object_name=='Contact') { |
|
110 | + if ($defines['focus']->object_name == 'Contact') { |
|
111 | 111 | $additionalFormFields['parent_type'] = 'Accounts'; |
112 | 112 | } |
113 | 113 | else { |
114 | 114 | $additionalFormFields['parent_type'] = $defines['focus']->module_dir; |
115 | 115 | } |
116 | 116 | } |
117 | - if(empty($additionalFormFields['parent_name'])) |
|
117 | + if (empty($additionalFormFields['parent_name'])) |
|
118 | 118 | { |
119 | - if($defines['focus']->object_name=='Contact') { |
|
119 | + if ($defines['focus']->object_name == 'Contact') { |
|
120 | 120 | $additionalFormFields['parent_name'] = $defines['focus']->account_name; |
121 | 121 | $additionalFormFields['account_name'] = $defines['focus']->account_name; |
122 | 122 | } |
@@ -124,9 +124,9 @@ discard block |
||
124 | 124 | $additionalFormFields['parent_name'] = $defines['focus']->name; |
125 | 125 | } |
126 | 126 | } |
127 | - if(empty($additionalFormFields['parent_id'])) |
|
127 | + if (empty($additionalFormFields['parent_id'])) |
|
128 | 128 | { |
129 | - if($defines['focus']->object_name=='Contact') { |
|
129 | + if ($defines['focus']->object_name == 'Contact') { |
|
130 | 130 | $additionalFormFields['parent_id'] = $defines['focus']->account_id; |
131 | 131 | $additionalFormFields['account_id'] = $defines['focus']->account_id; |
132 | 132 | } |
@@ -135,16 +135,16 @@ discard block |
||
135 | 135 | } |
136 | 136 | } |
137 | 137 | |
138 | - $button .= '<input type="hidden" name="action" value="SubpanelCreates" />' . "\n"; |
|
139 | - $button .= '<input type="hidden" name="module" value="Home" />' . "\n"; |
|
140 | - $button .= '<input type="hidden" name="target_action" value="QuickCreate" />' . "\n"; |
|
138 | + $button .= '<input type="hidden" name="action" value="SubpanelCreates" />'."\n"; |
|
139 | + $button .= '<input type="hidden" name="module" value="Home" />'."\n"; |
|
140 | + $button .= '<input type="hidden" name="target_action" value="QuickCreate" />'."\n"; |
|
141 | 141 | |
142 | 142 | // fill in additional form fields for all but action |
143 | - foreach($additionalFormFields as $key => $value) |
|
143 | + foreach ($additionalFormFields as $key => $value) |
|
144 | 144 | { |
145 | - if($key != 'action') |
|
145 | + if ($key != 'action') |
|
146 | 146 | { |
147 | - $button .= '<input type="hidden" name="' . $key . '" value="' . $value . '" />' . "\n"; |
|
147 | + $button .= '<input type="hidden" name="'.$key.'" value="'.$value.'" />'."\n"; |
|
148 | 148 | } |
149 | 149 | } |
150 | 150 | $button .= getVersionedScript('include/SugarFields/Fields/Datetimecombo/Datetimecombo.js')."\n"; |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | function display($defines, $additionalFormFields = null, $nonbutton = false) |
155 | 155 | { |
156 | 156 | $focus = new Call; |
157 | - if ( !$focus->ACLAccess('EditView') ) { |
|
157 | + if (!$focus->ACLAccess('EditView')) { |
|
158 | 158 | return ''; |
159 | 159 | } |
160 | 160 |