@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -56,8 +58,9 @@ discard block |
||
56 | 58 | $value = preg_replace("/^'/", "'%", $val, 1); |
57 | 59 | $value = preg_replace("/'$/", "%'", $value, 1); |
58 | 60 | $query .= $value; |
59 | - if ($key != ($arr_count - 1)) |
|
60 | - $query.= " OR " ; |
|
61 | + if ($key != ($arr_count - 1)) { |
|
62 | + $query.= " OR " ; |
|
63 | + } |
|
61 | 64 | } |
62 | 65 | return '('.$query.')'; |
63 | 66 | } |
@@ -68,7 +71,7 @@ discard block |
||
68 | 71 | foreach ($layout_def['input_name0'] as $value) { |
69 | 72 | if($value != ""){ |
70 | 73 | array_push($arr, "'".$GLOBALS['db']->quote($value)."'"); |
71 | - }else{ |
|
74 | + } else{ |
|
72 | 75 | array_push($arr, "'^^'"); |
73 | 76 | } |
74 | 77 | } |
@@ -82,8 +85,9 @@ discard block |
||
82 | 85 | $value = preg_replace("/^'/", "'%", $val, 1); |
83 | 86 | $value = preg_replace("/'$/", "%'", $value, 1); |
84 | 87 | $query .= $value; |
85 | - if ($key != ($arr_count - 1)) |
|
86 | - $query.= " OR " ; |
|
88 | + if ($key != ($arr_count - 1)) { |
|
89 | + $query.= " OR " ; |
|
90 | + } |
|
87 | 91 | } |
88 | 92 | return '('.$query.')'; |
89 | 93 | } |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | |
4 | 6 | require_once('include/generic/SugarWidgets/SugarWidgetSubPanelTopButton.php'); |
5 | 7 |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -49,18 +51,15 @@ discard block |
||
49 | 51 | if(!empty($layout_def['remove_blank']) && $layout_def['remove_blank']) { |
50 | 52 | if ( is_array($layout_def['options']) ) { |
51 | 53 | $ops = $layout_def['options']; |
52 | - } |
|
53 | - elseif (isset($layout_def['options']) && isset($app_list_strings[$layout_def['options']])){ |
|
54 | + } elseif (isset($layout_def['options']) && isset($app_list_strings[$layout_def['options']])){ |
|
54 | 55 | $ops = $app_list_strings[$layout_def['options']]; |
55 | 56 | if(array_key_exists('', $app_list_strings[$layout_def['options']])) { |
56 | 57 | unset($ops['']); |
57 | 58 | } |
58 | - } |
|
59 | - else{ |
|
59 | + } else{ |
|
60 | 60 | $ops = array(); |
61 | 61 | } |
62 | - } |
|
63 | - else { |
|
62 | + } else { |
|
64 | 63 | $ops = $app_list_strings[$layout_def['options']]; |
65 | 64 | } |
66 | 65 |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -68,7 +70,7 @@ discard block |
||
68 | 70 | return '<a href="' . $href . '"' |
69 | 71 | . "id=\"$unique_id\"" |
70 | 72 | . 'class="listViewTdToolsS1">' . $app_strings['LNK_EDIT'] .'</a> '; |
71 | - }else{ |
|
73 | + } else{ |
|
72 | 74 | return ''; |
73 | 75 | } |
74 | 76 | } |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -61,8 +63,7 @@ discard block |
||
61 | 63 | if(!empty($defines['focus']->$value)) |
62 | 64 | { |
63 | 65 | $additionalFormFields[$key] = $defines['focus']->$value; |
64 | - } |
|
65 | - else |
|
66 | + } else |
|
66 | 67 | { |
67 | 68 | $additionalFormFields[$key] = ''; |
68 | 69 | } |
@@ -72,8 +73,7 @@ discard block |
||
72 | 73 | if(!empty($this->module)) |
73 | 74 | { |
74 | 75 | $defines['child_module_name'] = $this->module; |
75 | - } |
|
76 | - else |
|
76 | + } else |
|
77 | 77 | { |
78 | 78 | $defines['child_module_name'] = $defines['module']; |
79 | 79 | } |
@@ -109,8 +109,7 @@ discard block |
||
109 | 109 | { |
110 | 110 | if($defines['focus']->object_name=='Contact') { |
111 | 111 | $additionalFormFields['parent_type'] = 'Accounts'; |
112 | - } |
|
113 | - else { |
|
112 | + } else { |
|
114 | 113 | $additionalFormFields['parent_type'] = $defines['focus']->module_dir; |
115 | 114 | } |
116 | 115 | } |
@@ -119,8 +118,7 @@ discard block |
||
119 | 118 | if($defines['focus']->object_name=='Contact') { |
120 | 119 | $additionalFormFields['parent_name'] = $defines['focus']->account_name; |
121 | 120 | $additionalFormFields['account_name'] = $defines['focus']->account_name; |
122 | - } |
|
123 | - else { |
|
121 | + } else { |
|
124 | 122 | $additionalFormFields['parent_name'] = $defines['focus']->name; |
125 | 123 | } |
126 | 124 | } |
@@ -129,8 +127,7 @@ discard block |
||
129 | 127 | if($defines['focus']->object_name=='Contact') { |
130 | 128 | $additionalFormFields['parent_id'] = $defines['focus']->account_id; |
131 | 129 | $additionalFormFields['account_id'] = $defines['focus']->account_id; |
132 | - } |
|
133 | - else { |
|
130 | + } else { |
|
134 | 131 | $additionalFormFields['parent_id'] = $defines['focus']->id; |
135 | 132 | } |
136 | 133 | } |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -60,8 +62,7 @@ discard block |
||
60 | 62 | if(!empty($defines['focus']->$value)) |
61 | 63 | { |
62 | 64 | $additionalFormFields[$key] = $defines['focus']->$value; |
63 | - } |
|
64 | - else |
|
65 | + } else |
|
65 | 66 | { |
66 | 67 | $additionalFormFields[$key] = ''; |
67 | 68 | } |
@@ -71,8 +72,7 @@ discard block |
||
71 | 72 | if(!empty($this->module)) |
72 | 73 | { |
73 | 74 | $defines['child_module_name'] = $this->module; |
74 | - } |
|
75 | - else |
|
75 | + } else |
|
76 | 76 | { |
77 | 77 | $defines['child_module_name'] = $defines['module']; |
78 | 78 | } |
@@ -104,8 +104,9 @@ discard block |
||
104 | 104 | $additionalFormFields['return_name'] = $defines['focus']->name; |
105 | 105 | } |
106 | 106 | |
107 | - if(!empty($defines['view'])) |
|
108 | - $button .= '<input type="hidden" name="target_view" value="'. $defines['view'] . '" />'; |
|
107 | + if(!empty($defines['view'])) { |
|
108 | + $button .= '<input type="hidden" name="target_view" value="'. $defines['view'] . '" />'; |
|
109 | + } |
|
109 | 110 | $button .= '<input type="hidden" name="to_pdf" value="true" />'; |
110 | 111 | $button .= '<input type="hidden" name="tpl" value="QuickCreate.tpl" />'; |
111 | 112 | $button .= '<input type="hidden" name="return_module" value="' . $currentModule . "\" />\n"; |
@@ -119,8 +120,7 @@ discard block |
||
119 | 120 | { |
120 | 121 | if($defines['focus']->object_name=='Contact') { |
121 | 122 | $additionalFormFields['parent_type'] = 'Accounts'; |
122 | - } |
|
123 | - else { |
|
123 | + } else { |
|
124 | 124 | $additionalFormFields['parent_type'] = $defines['focus']->module_dir; |
125 | 125 | } |
126 | 126 | } |
@@ -129,8 +129,7 @@ discard block |
||
129 | 129 | if($defines['focus']->object_name=='Contact') { |
130 | 130 | $additionalFormFields['parent_name'] = $defines['focus']->account_name; |
131 | 131 | $additionalFormFields['account_name'] = $defines['focus']->account_name; |
132 | - } |
|
133 | - else { |
|
132 | + } else { |
|
134 | 133 | $additionalFormFields['parent_name'] = $defines['focus']->name; |
135 | 134 | } |
136 | 135 | } |
@@ -139,8 +138,7 @@ discard block |
||
139 | 138 | if($defines['focus']->object_name=='Contact') { |
140 | 139 | $additionalFormFields['parent_id'] = $defines['focus']->account_id; |
141 | 140 | $additionalFormFields['account_id'] = $defines['focus']->account_id; |
142 | - } |
|
143 | - else { |
|
141 | + } else { |
|
144 | 142 | $additionalFormFields['parent_id'] = $defines['focus']->id; |
145 | 143 | } |
146 | 144 | } |
@@ -149,15 +147,27 @@ discard block |
||
149 | 147 | //set variables to account name, or parent account name |
150 | 148 | if(strtolower($defines['parent_bean_name']) == 'account' ){ |
151 | 149 | //if account is parent bean, then get focus id/focus name |
152 | - if(isset($defines['focus']->id))$additionalFormFields['account_id'] = $defines['focus']->id; |
|
153 | - if(isset($defines['focus']->name))$additionalFormFields['account_name'] = $defines['focus']->name; |
|
154 | - }elseif(strtolower($defines['parent_bean_name']) == 'quote' ){ |
|
150 | + if(isset($defines['focus']->id)) { |
|
151 | + $additionalFormFields['account_id'] = $defines['focus']->id; |
|
152 | + } |
|
153 | + if(isset($defines['focus']->name)) { |
|
154 | + $additionalFormFields['account_name'] = $defines['focus']->name; |
|
155 | + } |
|
156 | + } elseif(strtolower($defines['parent_bean_name']) == 'quote' ){ |
|
155 | 157 | //if quote is parent bean, then get billing_account_id/billing_account_name |
156 | - if(isset($defines['focus']->billing_account_id))$additionalFormFields['account_id'] = $defines['focus']->billing_account_id; |
|
157 | - if(isset($defines['focus']->billing_account_name))$additionalFormFields['account_name'] = $defines['focus']->billing_account_name; |
|
158 | - }else{ |
|
159 | - if(isset($defines['focus']->account_id))$additionalFormFields['account_id'] = $defines['focus']->account_id; |
|
160 | - if(isset($defines['focus']->account_name))$additionalFormFields['account_name'] = $defines['focus']->account_name; |
|
158 | + if(isset($defines['focus']->billing_account_id)) { |
|
159 | + $additionalFormFields['account_id'] = $defines['focus']->billing_account_id; |
|
160 | + } |
|
161 | + if(isset($defines['focus']->billing_account_name)) { |
|
162 | + $additionalFormFields['account_name'] = $defines['focus']->billing_account_name; |
|
163 | + } |
|
164 | + } else{ |
|
165 | + if(isset($defines['focus']->account_id)) { |
|
166 | + $additionalFormFields['account_id'] = $defines['focus']->account_id; |
|
167 | + } |
|
168 | + if(isset($defines['focus']->account_name)) { |
|
169 | + $additionalFormFields['account_name'] = $defines['focus']->account_name; |
|
170 | + } |
|
161 | 171 | } |
162 | 172 | } |
163 | 173 |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -62,14 +64,23 @@ discard block |
||
62 | 64 | |
63 | 65 | |
64 | 66 | |
65 | - if(isset($_REQUEST['action'])) $action = $_REQUEST['action']; |
|
66 | - else $action = ''; |
|
67 | + if(isset($_REQUEST['action'])) { |
|
68 | + $action = $_REQUEST['action']; |
|
69 | + } else { |
|
70 | + $action = ''; |
|
71 | + } |
|
67 | 72 | |
68 | - if(isset($_REQUEST['module'])) $module = $_REQUEST['module']; |
|
69 | - else $module = ''; |
|
73 | + if(isset($_REQUEST['module'])) { |
|
74 | + $module = $_REQUEST['module']; |
|
75 | + } else { |
|
76 | + $module = ''; |
|
77 | + } |
|
70 | 78 | |
71 | - if(isset($_REQUEST['record'])) $record = $_REQUEST['record']; |
|
72 | - else $record = ''; |
|
79 | + if(isset($_REQUEST['record'])) { |
|
80 | + $record = $_REQUEST['record']; |
|
81 | + } else { |
|
82 | + $record = ''; |
|
83 | + } |
|
73 | 84 | |
74 | 85 | if (!empty($focus->name)) { |
75 | 86 | $name = $focus->name; |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -64,8 +66,7 @@ discard block |
||
64 | 66 | if(!empty($date)) { // able to get the date context of the time |
65 | 67 | $td = explode(' ', $timedate->to_display_date_time($date . ' ' . $content)); |
66 | 68 | return $td[1]; |
67 | - } |
|
68 | - else { // assume there is no time context |
|
69 | + } else { // assume there is no time context |
|
69 | 70 | return $timedate->to_display_time($content); |
70 | 71 | } |
71 | 72 | } |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /** |
4 | 6 | * SugarWidgetSubPanelEditRoleButton |
5 | 7 | * |
@@ -70,7 +72,7 @@ discard block |
||
70 | 72 | if($layout_def['ListView']){ |
71 | 73 | return '<a href="' . $href . '"' |
72 | 74 | . 'class="listViewTdToolsS1">' . $edit_icon_html . ' ' . $app_strings['LNK_EDIT'] .'</a> '; |
73 | - }else{ |
|
75 | + } else{ |
|
74 | 76 | return ''; |
75 | 77 | } |
76 | 78 | } |