@@ -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 | * Products, Quotations & Invoices modules. |
5 | 5 | * Extensions to SugarCRM |
@@ -40,16 +40,16 @@ discard block |
||
40 | 40 | array('label' => '10', 'field' => '30'), |
41 | 41 | ), |
42 | 42 | ), |
43 | - 'panels' =>array ( |
|
43 | + 'panels' =>array( |
|
44 | 44 | 'DEFAULT' => |
45 | - array ( |
|
45 | + array( |
|
46 | 46 | array( |
47 | - array('name'=>'name', 'displayParams'=>array('required'=>true,'size'=>20)), |
|
47 | + array('name'=>'name', 'displayParams'=>array('required'=>true, 'size'=>20)), |
|
48 | 48 | ), |
49 | - array ( |
|
50 | - array('name'=>'description','displayParams'=>array('rows'=>3, 'cols'=>20)), |
|
49 | + array( |
|
50 | + array('name'=>'description', 'displayParams'=>array('rows'=>3, 'cols'=>20)), |
|
51 | 51 | ), |
52 | - array ( |
|
52 | + array( |
|
53 | 53 | array('name'=>'assigned_user_name', 'displayParams'=>array('required'=>true, 'size'=>11, 'selectOnly'=>true)), |
54 | 54 | ), |
55 | 55 | ), |
@@ -29,32 +29,32 @@ |
||
29 | 29 | $module_name = 'AOS_Products'; |
30 | 30 | $viewdefs[$module_name]['SideQuickCreate'] = array( |
31 | 31 | 'templateMeta' => array('form'=>array('buttons'=>array('SAVE'), |
32 | - 'button_location'=>'bottom', |
|
33 | - 'headerTpl'=>'include/EditView/header.tpl', |
|
34 | - 'footerTpl'=>'include/EditView/footer.tpl', |
|
35 | - ), |
|
36 | - 'maxColumns' => '1', |
|
37 | - 'panelClass'=>'none', |
|
38 | - 'labelsOnTop'=>true, |
|
32 | + 'button_location'=>'bottom', |
|
33 | + 'headerTpl'=>'include/EditView/header.tpl', |
|
34 | + 'footerTpl'=>'include/EditView/footer.tpl', |
|
35 | + ), |
|
36 | + 'maxColumns' => '1', |
|
37 | + 'panelClass'=>'none', |
|
38 | + 'labelsOnTop'=>true, |
|
39 | 39 | 'widths' => array( |
40 | 40 | array('label' => '10', 'field' => '30'), |
41 | - ), |
|
41 | + ), |
|
42 | 42 | ), |
43 | - 'panels' =>array ( |
|
44 | - 'DEFAULT' => |
|
45 | - array ( |
|
43 | + 'panels' =>array ( |
|
44 | + 'DEFAULT' => |
|
45 | + array ( |
|
46 | 46 | array( |
47 | - array('name'=>'name', 'displayParams'=>array('required'=>true,'size'=>20)), |
|
47 | + array('name'=>'name', 'displayParams'=>array('required'=>true,'size'=>20)), |
|
48 | 48 | ), |
49 | 49 | array ( |
50 | - array('name'=>'description','displayParams'=>array('rows'=>3, 'cols'=>20)), |
|
50 | + array('name'=>'description','displayParams'=>array('rows'=>3, 'cols'=>20)), |
|
51 | 51 | ), |
52 | 52 | array ( |
53 | - array('name'=>'assigned_user_name', 'displayParams'=>array('required'=>true, 'size'=>11, 'selectOnly'=>true)), |
|
53 | + array('name'=>'assigned_user_name', 'displayParams'=>array('required'=>true, 'size'=>11, 'selectOnly'=>true)), |
|
54 | + ), |
|
54 | 55 | ), |
55 | - ), |
|
56 | 56 | |
57 | - ) |
|
57 | + ) |
|
58 | 58 | |
59 | 59 | |
60 | 60 | ); |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -125,6 +125,6 @@ |
||
125 | 125 | include('metadata/securitygroups_usersMetaData.php'); |
126 | 126 | |
127 | 127 | if(file_exists('custom/application/Ext/TableDictionary/tabledictionary.ext.php')){ |
128 | - include('custom/application/Ext/TableDictionary/tabledictionary.ext.php'); |
|
128 | + include('custom/application/Ext/TableDictionary/tabledictionary.ext.php'); |
|
129 | 129 | } |
130 | 130 | ?> |
@@ -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. |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | include('metadata/securitygroups_recordsMetaData.php'); |
125 | 125 | include('metadata/securitygroups_usersMetaData.php'); |
126 | 126 | |
127 | -if(file_exists('custom/application/Ext/TableDictionary/tabledictionary.ext.php')){ |
|
127 | +if (file_exists('custom/application/Ext/TableDictionary/tabledictionary.ext.php')) { |
|
128 | 128 | include('custom/application/Ext/TableDictionary/tabledictionary.ext.php'); |
129 | 129 | } |
130 | 130 | ?> |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -84,8 +84,7 @@ discard block |
||
84 | 84 | $html .= '<script>insertGroup();</script>'; |
85 | 85 | } |
86 | 86 | |
87 | - } |
|
88 | - else if($view == 'DetailView'){ |
|
87 | + } else if($view == 'DetailView'){ |
|
89 | 88 | $params = array('currency_id' => $focus->currency_id); |
90 | 89 | |
91 | 90 | $sql = "SELECT pg.id, pg.group_id FROM aos_products_quotes pg LEFT JOIN aos_line_item_groups lig ON pg.group_id = lig.id WHERE pg.parent_type = '".$focus->object_name."' AND pg.parent_id = '".$focus->id."' AND pg.deleted = 0 ORDER BY lig.number ASC, pg.number ASC"; |
@@ -111,7 +110,9 @@ discard block |
||
111 | 110 | |
112 | 111 | if($enable_groups && ($group_id != $row['group_id'] || $i == 0)){ |
113 | 112 | $html .= $groupStart.$product.$service.$groupEnd; |
114 | - if($i != 0)$html .= "<tr><td colspan='9' nowrap='nowrap'><br></td></tr>"; |
|
113 | + if($i != 0) { |
|
114 | + $html .= "<tr><td colspan='9' nowrap='nowrap'><br></td></tr>"; |
|
115 | + } |
|
115 | 116 | $groupStart = ''; |
116 | 117 | $groupEnd = ''; |
117 | 118 | $product = ''; |
@@ -229,15 +230,13 @@ discard block |
||
229 | 230 | if($type == 'Amount') |
230 | 231 | { |
231 | 232 | return currency_format_number($amount,$params )."</td>"; |
232 | - } |
|
233 | - else if($locale->getPrecision()) |
|
233 | + } else if($locale->getPrecision()) |
|
234 | 234 | { |
235 | 235 | return rtrim(rtrim(format_number($amount), '0'),$sep[1])."%"; |
236 | 236 | } else{ |
237 | 237 | return format_number($amount)."%"; |
238 | 238 | } |
239 | - } |
|
240 | - else |
|
239 | + } else |
|
241 | 240 | { |
242 | 241 | return "-"; |
243 | 242 | } |
@@ -248,7 +247,9 @@ discard block |
||
248 | 247 | if($view == 'EditView'){ |
249 | 248 | global $app_list_strings; |
250 | 249 | |
251 | - if($value != '') $value = format_number($value); |
|
250 | + if($value != '') { |
|
251 | + $value = format_number($value); |
|
252 | + } |
|
252 | 253 | |
253 | 254 | $html = "<input id='shipping_tax_amt' type='text' tabindex='0' title='' value='".$value."' maxlength='26,6' size='22' name='shipping_tax_amt' onblur='calculateTotal(\"lineItems\");'>"; |
254 | 255 | $html .= "<select name='shipping_tax' id='shipping_tax' onchange='calculateTotal(\"lineItems\");' >".get_select_options_with_id($app_list_strings['vat_list'], (isset($focus->shipping_tax) ? $focus->shipping_tax : ''))."</select>"; |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | * @author SalesAgility <[email protected]> |
23 | 23 | */ |
24 | 24 | |
25 | -function display_lines($focus, $field, $value, $view){ |
|
25 | +function display_lines($focus, $field, $value, $view) { |
|
26 | 26 | |
27 | 27 | global $sugar_config, $locale, $app_list_strings, $mod_strings; |
28 | 28 | |
@@ -31,10 +31,10 @@ discard block |
||
31 | 31 | |
32 | 32 | $html = ''; |
33 | 33 | |
34 | - if($view == 'EditView'){ |
|
34 | + if ($view == 'EditView') { |
|
35 | 35 | |
36 | 36 | $html .= '<script src="modules/AOS_Products_Quotes/line_items.js"></script>'; |
37 | - if(file_exists('custom/modules/AOS_Products_Quotes/line_items.js')){ |
|
37 | + if (file_exists('custom/modules/AOS_Products_Quotes/line_items.js')) { |
|
38 | 38 | $html .= '<script src="custom/modules/AOS_Products_Quotes/line_items.js"></script>'; |
39 | 39 | } |
40 | 40 | $html .= '<script language="javascript">var sig_digits = '.$locale->getPrecision().';'; |
@@ -45,18 +45,18 @@ discard block |
||
45 | 45 | |
46 | 46 | $html .= "<table border='0' cellspacing='4' width='37.5%' id='lineItems'></table>"; |
47 | 47 | |
48 | - if($enable_groups){ |
|
48 | + if ($enable_groups) { |
|
49 | 49 | $html .= "<div style='padding-top: 10px; padding-bottom:10px;'>"; |
50 | 50 | $html .= "<input type=\"button\" tabindex=\"116\" class=\"button\" value=\"".$mod_strings['LBL_ADD_GROUP']."\" id=\"addGroup\" onclick=\"insertGroup(0)\" />"; |
51 | 51 | $html .= "</div>"; |
52 | 52 | } |
53 | 53 | $html .= '<input type="hidden" name="vathidden" id="vathidden" value="'.get_select_options_with_id($app_list_strings['vat_list'], '').'"> |
54 | 54 | <input type="hidden" name="discounthidden" id="discounthidden" value="'.get_select_options_with_id($app_list_strings['discount_list'], '').'">'; |
55 | - if($focus->id != '') { |
|
55 | + if ($focus->id != '') { |
|
56 | 56 | require_once('modules/AOS_Products_Quotes/AOS_Products_Quotes.php'); |
57 | 57 | require_once('modules/AOS_Line_Item_Groups/AOS_Line_Item_Groups.php'); |
58 | 58 | |
59 | - $sql = "SELECT pg.id, pg.group_id FROM aos_products_quotes pg LEFT JOIN aos_line_item_groups lig ON pg.group_id = lig.id WHERE pg.parent_type = '" . $focus->object_name . "' AND pg.parent_id = '" . $focus->id . "' AND pg.deleted = 0 ORDER BY lig.number ASC, pg.number ASC"; |
|
59 | + $sql = "SELECT pg.id, pg.group_id FROM aos_products_quotes pg LEFT JOIN aos_line_item_groups lig ON pg.group_id = lig.id WHERE pg.parent_type = '".$focus->object_name."' AND pg.parent_id = '".$focus->id."' AND pg.deleted = 0 ORDER BY lig.number ASC, pg.number ASC"; |
|
60 | 60 | |
61 | 61 | $result = $focus->db->query($sql); |
62 | 62 | $html .= "<script> |
@@ -75,17 +75,17 @@ discard block |
||
75 | 75 | $group_item = json_encode($group_item->toArray()); |
76 | 76 | } |
77 | 77 | $html .= "<script> |
78 | - insertLineItems(" . $line_item . "," . $group_item . "); |
|
78 | + insertLineItems(" . $line_item.",".$group_item."); |
|
79 | 79 | </script>"; |
80 | 80 | |
81 | 81 | } |
82 | 82 | } |
83 | - if(!$enable_groups){ |
|
83 | + if (!$enable_groups) { |
|
84 | 84 | $html .= '<script>insertGroup();</script>'; |
85 | 85 | } |
86 | 86 | |
87 | 87 | } |
88 | - else if($view == 'DetailView'){ |
|
88 | + else if ($view == 'DetailView') { |
|
89 | 89 | $params = array('currency_id' => $focus->currency_id); |
90 | 90 | |
91 | 91 | $sql = "SELECT pg.id, pg.group_id FROM aos_products_quotes pg LEFT JOIN aos_line_item_groups lig ON pg.group_id = lig.id WHERE pg.parent_type = '".$focus->object_name."' AND pg.parent_id = '".$focus->id."' AND pg.deleted = 0 ORDER BY lig.number ASC, pg.number ASC"; |
@@ -109,9 +109,9 @@ discard block |
||
109 | 109 | $line_item->retrieve($row['id']); |
110 | 110 | |
111 | 111 | |
112 | - if($enable_groups && ($group_id != $row['group_id'] || $i == 0)){ |
|
112 | + if ($enable_groups && ($group_id != $row['group_id'] || $i == 0)) { |
|
113 | 113 | $html .= $groupStart.$product.$service.$groupEnd; |
114 | - if($i != 0)$html .= "<tr><td colspan='9' nowrap='nowrap'><br></td></tr>"; |
|
114 | + if ($i != 0)$html .= "<tr><td colspan='9' nowrap='nowrap'><br></td></tr>"; |
|
115 | 115 | $groupStart = ''; |
116 | 116 | $groupEnd = ''; |
117 | 117 | $product = ''; |
@@ -152,8 +152,8 @@ discard block |
||
152 | 152 | $groupEnd .= "<td class='tabDetailViewDL' style='text-align: right;padding:2px;'>".currency_format_number($group_item->total_amount, $params)."</td>"; |
153 | 153 | $groupEnd .= "</tr>"; |
154 | 154 | } |
155 | - if($line_item->product_id != '0' && $line_item->product_id != null){ |
|
156 | - if($productCount == 0) |
|
155 | + if ($line_item->product_id != '0' && $line_item->product_id != null) { |
|
156 | + if ($productCount == 0) |
|
157 | 157 | { |
158 | 158 | $product .= "<tr>"; |
159 | 159 | $product .= "<td width='5%' class='tabDetailViewDL' style='text-align: left;padding:2px;' scope='row'> </td>"; |
@@ -169,26 +169,26 @@ discard block |
||
169 | 169 | } |
170 | 170 | |
171 | 171 | $product .= "<tr>"; |
172 | - $product_note = wordwrap($line_item->description,40,"<br />\n"); |
|
172 | + $product_note = wordwrap($line_item->description, 40, "<br />\n"); |
|
173 | 173 | $product .= "<td class='tabDetailViewDF' style='text-align: left; padding:2px;'>".++$productCount."</td>"; |
174 | - $product .= "<td class='tabDetailViewDF' style='padding:2px;'>".stripDecimalPointsAndTrailingZeroes(format_number($line_item->product_qty),$sep[1])."</td>"; |
|
174 | + $product .= "<td class='tabDetailViewDF' style='padding:2px;'>".stripDecimalPointsAndTrailingZeroes(format_number($line_item->product_qty), $sep[1])."</td>"; |
|
175 | 175 | |
176 | 176 | $product .= "<td class='tabDetailViewDF' style='padding:2px;'><a href='index.php?module=AOS_Products&action=DetailView&record=".$line_item->product_id."' class='tabDetailViewDFLink'>".$line_item->name."</a><br />".$product_note."</td>"; |
177 | - $product .= "<td class='tabDetailViewDF' style='text-align: right; padding:2px;'>".currency_format_number($line_item->product_list_price,$params)."</td>"; |
|
177 | + $product .= "<td class='tabDetailViewDF' style='text-align: right; padding:2px;'>".currency_format_number($line_item->product_list_price, $params)."</td>"; |
|
178 | 178 | |
179 | 179 | $product .= "<td class='tabDetailViewDF' style='text-align: right; padding:2px;'>".get_discount_string($line_item->discount, $line_item->product_discount, $params, $locale, $sep)."</td>"; |
180 | 180 | |
181 | - $product .= "<td class='tabDetailViewDF' style='text-align: right; padding:2px;'>".currency_format_number($line_item->product_unit_price,$params )."</td>"; |
|
182 | - if($locale->getPrecision()){ |
|
183 | - $product .= "<td class='tabDetailViewDF' style='text-align: right; padding:2px;'>".rtrim(rtrim(format_number($line_item->vat), '0'),$sep[1])."%</td>"; |
|
181 | + $product .= "<td class='tabDetailViewDF' style='text-align: right; padding:2px;'>".currency_format_number($line_item->product_unit_price, $params)."</td>"; |
|
182 | + if ($locale->getPrecision()) { |
|
183 | + $product .= "<td class='tabDetailViewDF' style='text-align: right; padding:2px;'>".rtrim(rtrim(format_number($line_item->vat), '0'), $sep[1])."%</td>"; |
|
184 | 184 | } else { |
185 | 185 | $product .= "<td class='tabDetailViewDF' style='text-align: right; padding:2px;'>".format_number($line_item->vat)."%</td>"; |
186 | 186 | } |
187 | - $product .= "<td class='tabDetailViewDF' style='text-align: right; padding:2px;'>".currency_format_number($line_item->vat_amt,$params )."</td>"; |
|
188 | - $product .= "<td class='tabDetailViewDF' style='text-align: right; padding:2px;'>".currency_format_number($line_item->product_total_price,$params )."</td>"; |
|
187 | + $product .= "<td class='tabDetailViewDF' style='text-align: right; padding:2px;'>".currency_format_number($line_item->vat_amt, $params)."</td>"; |
|
188 | + $product .= "<td class='tabDetailViewDF' style='text-align: right; padding:2px;'>".currency_format_number($line_item->product_total_price, $params)."</td>"; |
|
189 | 189 | $product .= "</tr>"; |
190 | 190 | } else { |
191 | - if($serviceCount == 0) |
|
191 | + if ($serviceCount == 0) |
|
192 | 192 | { |
193 | 193 | $service .= "<tr>"; |
194 | 194 | $service .= "<td width='5%' class='tabDetailViewDL' style='text-align: left;padding:2px;' scope='row'> </td>"; |
@@ -205,15 +205,15 @@ discard block |
||
205 | 205 | $service .= "<tr>"; |
206 | 206 | $service .= "<td class='tabDetailViewDF' style='text-align: left; padding:2px;'>".++$serviceCount."</td>"; |
207 | 207 | $service .= "<td class='tabDetailViewDF' style='padding:2px;' colspan='2'>".$line_item->name."</td>"; |
208 | - $service .= "<td class='tabDetailViewDF' style='text-align: right; padding:2px;'>".currency_format_number($line_item->product_list_price,$params)."</td>"; |
|
208 | + $service .= "<td class='tabDetailViewDF' style='text-align: right; padding:2px;'>".currency_format_number($line_item->product_list_price, $params)."</td>"; |
|
209 | 209 | |
210 | 210 | $service .= "<td class='tabDetailViewDF' style='text-align: right; padding:2px;'>".get_discount_string($line_item->discount, $line_item->product_discount, $params, $locale, $sep)."</td>"; |
211 | 211 | |
212 | 212 | |
213 | - $service .= "<td class='tabDetailViewDF' style='text-align: right; padding:2px;'>".currency_format_number($line_item->product_unit_price,$params)."</td>"; |
|
213 | + $service .= "<td class='tabDetailViewDF' style='text-align: right; padding:2px;'>".currency_format_number($line_item->product_unit_price, $params)."</td>"; |
|
214 | 214 | $service .= "<td class='tabDetailViewDF' style='text-align: right; padding:2px;'>".rtrim(rtrim(format_number($line_item->vat), '0'), $sep[1])."%</td>"; |
215 | - $service .= "<td class='tabDetailViewDF' style='text-align: right; padding:2px;'>".currency_format_number($line_item->vat_amt,$params )."</td>"; |
|
216 | - $service .= "<td class='tabDetailViewDF' style='text-align: right; padding:2px;'>".currency_format_number($line_item->product_total_price,$params )."</td>"; |
|
215 | + $service .= "<td class='tabDetailViewDF' style='text-align: right; padding:2px;'>".currency_format_number($line_item->vat_amt, $params)."</td>"; |
|
216 | + $service .= "<td class='tabDetailViewDF' style='text-align: right; padding:2px;'>".currency_format_number($line_item->product_total_price, $params)."</td>"; |
|
217 | 217 | $service .= "</tr>"; |
218 | 218 | |
219 | 219 | } |
@@ -230,22 +230,22 @@ discard block |
||
230 | 230 | //field was 0. |
231 | 231 | //The approach below will strip off the fractional part if it is only zeroes (and in this case the decimal separator |
232 | 232 | //will also be stripped off) The custom decimal separator is passed in to the function from the locale settings |
233 | -function stripDecimalPointsAndTrailingZeroes($inputString,$decimalSeparator) |
|
233 | +function stripDecimalPointsAndTrailingZeroes($inputString, $decimalSeparator) |
|
234 | 234 | { |
235 | - return preg_replace('/'.preg_quote($decimalSeparator).'[0]+$/','',$inputString); |
|
235 | + return preg_replace('/'.preg_quote($decimalSeparator).'[0]+$/', '', $inputString); |
|
236 | 236 | } |
237 | 237 | |
238 | -function get_discount_string($type, $amount, $params, $locale, $sep){ |
|
239 | - if($amount != '' && $amount != '0.00') |
|
238 | +function get_discount_string($type, $amount, $params, $locale, $sep) { |
|
239 | + if ($amount != '' && $amount != '0.00') |
|
240 | 240 | { |
241 | - if($type == 'Amount') |
|
241 | + if ($type == 'Amount') |
|
242 | 242 | { |
243 | - return currency_format_number($amount,$params )."</td>"; |
|
243 | + return currency_format_number($amount, $params)."</td>"; |
|
244 | 244 | } |
245 | - else if($locale->getPrecision()) |
|
245 | + else if ($locale->getPrecision()) |
|
246 | 246 | { |
247 | - return rtrim(rtrim(format_number($amount), '0'),$sep[1])."%"; |
|
248 | - } else{ |
|
247 | + return rtrim(rtrim(format_number($amount), '0'), $sep[1])."%"; |
|
248 | + } else { |
|
249 | 249 | return format_number($amount)."%"; |
250 | 250 | } |
251 | 251 | } |
@@ -255,12 +255,12 @@ discard block |
||
255 | 255 | } |
256 | 256 | } |
257 | 257 | |
258 | -function display_shipping_vat($focus, $field, $value, $view){ |
|
258 | +function display_shipping_vat($focus, $field, $value, $view) { |
|
259 | 259 | |
260 | - if($view == 'EditView'){ |
|
260 | + if ($view == 'EditView') { |
|
261 | 261 | global $app_list_strings; |
262 | 262 | |
263 | - if($value != '') $value = format_number($value); |
|
263 | + if ($value != '') $value = format_number($value); |
|
264 | 264 | |
265 | 265 | $html = "<input id='shipping_tax_amt' type='text' tabindex='0' title='' value='".$value."' maxlength='26,6' size='22' name='shipping_tax_amt' onblur='calculateTotal(\"lineItems\");'>"; |
266 | 266 | $html .= "<select name='shipping_tax' id='shipping_tax' onchange='calculateTotal(\"lineItems\");' >".get_select_options_with_id($app_list_strings['vat_list'], (isset($focus->shipping_tax) ? $focus->shipping_tax : ''))."</select>"; |
@@ -23,43 +23,43 @@ discard block |
||
23 | 23 | */ |
24 | 24 | |
25 | 25 | $dictionary['AOS_Products_Quotes'] = array( |
26 | - 'table'=>'aos_products_quotes', |
|
27 | - 'audited'=>true, |
|
28 | - 'fields'=>array ( |
|
29 | - 'name' => |
|
26 | + 'table'=>'aos_products_quotes', |
|
27 | + 'audited'=>true, |
|
28 | + 'fields'=>array ( |
|
29 | + 'name' => |
|
30 | 30 | array ( |
31 | - 'name' => 'name', |
|
32 | - 'vname' => 'LBL_NAME', |
|
33 | - 'type' => 'text', |
|
34 | - 'link' => true, |
|
35 | - 'unified_search' => true, |
|
36 | - 'required' => true, |
|
37 | - 'importable' => 'required', |
|
31 | + 'name' => 'name', |
|
32 | + 'vname' => 'LBL_NAME', |
|
33 | + 'type' => 'text', |
|
34 | + 'link' => true, |
|
35 | + 'unified_search' => true, |
|
36 | + 'required' => true, |
|
37 | + 'importable' => 'required', |
|
38 | 38 | ), |
39 | 39 | 'currency_id' => |
40 | - array ( |
|
41 | - 'required' => false, |
|
42 | - 'name' => 'currency_id', |
|
43 | - 'vname' => 'LBL_CURRENCY', |
|
44 | - 'type' => 'id', |
|
45 | - 'massupdate' => 0, |
|
46 | - 'comments' => '', |
|
47 | - 'help' => '', |
|
48 | - 'importable' => 'true', |
|
49 | - 'duplicate_merge' => 'disabled', |
|
50 | - 'duplicate_merge_dom_value' => 0, |
|
51 | - 'audited' => false, |
|
52 | - 'reportable' => false, |
|
53 | - 'len' => 36, |
|
54 | - 'size' => '20', |
|
55 | - 'studio' => 'visible', |
|
56 | - 'function' => |
|
40 | + array ( |
|
41 | + 'required' => false, |
|
42 | + 'name' => 'currency_id', |
|
43 | + 'vname' => 'LBL_CURRENCY', |
|
44 | + 'type' => 'id', |
|
45 | + 'massupdate' => 0, |
|
46 | + 'comments' => '', |
|
47 | + 'help' => '', |
|
48 | + 'importable' => 'true', |
|
49 | + 'duplicate_merge' => 'disabled', |
|
50 | + 'duplicate_merge_dom_value' => 0, |
|
51 | + 'audited' => false, |
|
52 | + 'reportable' => false, |
|
53 | + 'len' => 36, |
|
54 | + 'size' => '20', |
|
55 | + 'studio' => 'visible', |
|
56 | + 'function' => |
|
57 | 57 | array ( |
58 | 58 | 'name' => 'getCurrencyDropDown', |
59 | 59 | 'returns' => 'html', |
60 | 60 | ), |
61 | 61 | ), |
62 | - 'part_number' => |
|
62 | + 'part_number' => |
|
63 | 63 | array ( |
64 | 64 | 'required' => false, |
65 | 65 | 'name' => 'part_number', |
@@ -90,8 +90,8 @@ discard block |
||
90 | 90 | 'rows' => 6, |
91 | 91 | 'cols' => 80, |
92 | 92 | ), |
93 | - 'number' => |
|
94 | - array ( |
|
93 | + 'number' => |
|
94 | + array ( |
|
95 | 95 | 'required' => false, |
96 | 96 | 'name' => 'number', |
97 | 97 | 'vname' => 'LBL_LIST_NUM', |
@@ -106,9 +106,9 @@ discard block |
||
106 | 106 | 'reportable' => true, |
107 | 107 | 'len' => '11', |
108 | 108 | 'disable_num_format' => '', |
109 | - ), |
|
110 | - 'product_qty' => |
|
111 | - array ( |
|
109 | + ), |
|
110 | + 'product_qty' => |
|
111 | + array ( |
|
112 | 112 | 'required' => false, |
113 | 113 | 'name' => 'product_qty', |
114 | 114 | 'vname' => 'LBL_PRODUCT_QTY', |
@@ -125,9 +125,9 @@ discard block |
||
125 | 125 | 'size' => '20', |
126 | 126 | 'enable_range_search' => false, |
127 | 127 | 'precision' => '4', |
128 | - ), |
|
129 | - 'product_cost_price' => |
|
130 | - array ( |
|
128 | + ), |
|
129 | + 'product_cost_price' => |
|
130 | + array ( |
|
131 | 131 | 'required' => false, |
132 | 132 | 'name' => 'product_cost_price', |
133 | 133 | 'vname' => 'LBL_PRODUCT_COST_PRICE', |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | 'audited' => 0, |
142 | 142 | 'reportable' => true, |
143 | 143 | 'len' => '26,6', |
144 | - ), |
|
144 | + ), |
|
145 | 145 | 'product_cost_price_usdollar' => |
146 | 146 | array ( |
147 | 147 | 'name' => 'product_cost_price_usdollar', |
@@ -159,8 +159,8 @@ discard block |
||
159 | 159 | ), |
160 | 160 | 'len' => '26,6', |
161 | 161 | ), |
162 | - 'product_list_price' => |
|
163 | - array ( |
|
162 | + 'product_list_price' => |
|
163 | + array ( |
|
164 | 164 | 'required' => false, |
165 | 165 | 'name' => 'product_list_price', |
166 | 166 | 'vname' => 'LBL_PRODUCT_LIST_PRICE', |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | 'audited' => 1, |
175 | 175 | 'reportable' => true, |
176 | 176 | 'len' => '26,6', |
177 | - ), |
|
177 | + ), |
|
178 | 178 | 'product_list_price_usdollar' => |
179 | 179 | array ( |
180 | 180 | 'name' => 'product_list_price_usdollar', |
@@ -192,8 +192,8 @@ discard block |
||
192 | 192 | ), |
193 | 193 | 'len' => '26,6', |
194 | 194 | ), |
195 | - 'product_discount' => |
|
196 | - array ( |
|
195 | + 'product_discount' => |
|
196 | + array ( |
|
197 | 197 | 'required' => false, |
198 | 198 | 'name' => 'product_discount', |
199 | 199 | 'vname' => 'LBL_PRODUCT_DISCOUNT', |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | 'audited' => 1, |
208 | 208 | 'reportable' => true, |
209 | 209 | 'len' => '26,6', |
210 | - ), |
|
210 | + ), |
|
211 | 211 | 'product_discount_usdollar' => |
212 | 212 | array ( |
213 | 213 | 'name' => 'product_discount_usdollar', |
@@ -225,8 +225,8 @@ discard block |
||
225 | 225 | ), |
226 | 226 | 'len' => '26,6', |
227 | 227 | ), |
228 | - 'product_discount_amount' => |
|
229 | - array ( |
|
228 | + 'product_discount_amount' => |
|
229 | + array ( |
|
230 | 230 | 'required' => false, |
231 | 231 | 'name' => 'product_discount_amount', |
232 | 232 | 'vname' => 'LBL_PRODUCT_DISCOUNT_AMOUNT', |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | 'audited' => 1, |
241 | 241 | 'reportable' => true, |
242 | 242 | 'len' => '26,6', |
243 | - ), |
|
243 | + ), |
|
244 | 244 | 'product_discount_amount_usdollar' => |
245 | 245 | array ( |
246 | 246 | 'name' => 'product_discount_amount_usdollar', |
@@ -258,8 +258,8 @@ discard block |
||
258 | 258 | ), |
259 | 259 | 'len' => '26,6', |
260 | 260 | ), |
261 | - 'discount' => |
|
262 | - array ( |
|
261 | + 'discount' => |
|
262 | + array ( |
|
263 | 263 | 'required' => false, |
264 | 264 | 'name' => 'discount', |
265 | 265 | 'vname' => 'LBL_DISCOUNT', |
@@ -276,10 +276,10 @@ discard block |
||
276 | 276 | 'len' => 255, |
277 | 277 | 'options' => 'discount_list', |
278 | 278 | 'studio' => 'visible', |
279 | - ), |
|
279 | + ), |
|
280 | 280 | |
281 | - 'product_unit_price' => |
|
282 | - array ( |
|
281 | + 'product_unit_price' => |
|
282 | + array ( |
|
283 | 283 | 'required' => '1', |
284 | 284 | 'name' => 'product_unit_price', |
285 | 285 | 'vname' => 'LBL_PRODUCT_UNIT_PRICE', |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | 'audited' => 1, |
294 | 294 | 'reportable' => true, |
295 | 295 | 'len' => '26,6', |
296 | - ), |
|
296 | + ), |
|
297 | 297 | 'product_unit_price_usdollar' => |
298 | 298 | array ( |
299 | 299 | 'name' => 'product_unit_price_usdollar', |
@@ -311,8 +311,8 @@ discard block |
||
311 | 311 | ), |
312 | 312 | 'len' => '26,6', |
313 | 313 | ), |
314 | - 'vat_amt' => |
|
315 | - array ( |
|
314 | + 'vat_amt' => |
|
315 | + array ( |
|
316 | 316 | 'required' => '1', |
317 | 317 | 'name' => 'vat_amt', |
318 | 318 | 'vname' => 'LBL_VAT_AMT', |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | 'audited' => 1, |
327 | 327 | 'reportable' => true, |
328 | 328 | 'len' => '26,6', |
329 | - ), |
|
329 | + ), |
|
330 | 330 | 'vat_amt_usdollar' => |
331 | 331 | array ( |
332 | 332 | 'name' => 'vat_amt_usdollar', |
@@ -344,8 +344,8 @@ discard block |
||
344 | 344 | ), |
345 | 345 | 'len' => '26,6', |
346 | 346 | ), |
347 | - 'product_total_price' => |
|
348 | - array ( |
|
347 | + 'product_total_price' => |
|
348 | + array ( |
|
349 | 349 | 'required' => '1', |
350 | 350 | 'name' => 'product_total_price', |
351 | 351 | 'vname' => 'LBL_PRODUCT_TOTAL_PRICE', |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | 'audited' => 1, |
360 | 360 | 'reportable' => true, |
361 | 361 | 'len' => '26,6', |
362 | - ), |
|
362 | + ), |
|
363 | 363 | 'product_total_price_usdollar' => |
364 | 364 | array ( |
365 | 365 | 'name' => 'product_total_price_usdollar', |
@@ -377,8 +377,8 @@ discard block |
||
377 | 377 | ), |
378 | 378 | 'len' => '26,6', |
379 | 379 | ), |
380 | - 'vat' => |
|
381 | - array ( |
|
380 | + 'vat' => |
|
381 | + array ( |
|
382 | 382 | 'required' => false, |
383 | 383 | 'name' => 'vat', |
384 | 384 | 'vname' => 'LBL_VAT', |
@@ -395,9 +395,9 @@ discard block |
||
395 | 395 | 'len' => 100, |
396 | 396 | 'options' => 'vat_list', |
397 | 397 | 'studio' => 'visible', |
398 | - ), |
|
399 | - 'parent_name' => |
|
400 | - array ( |
|
398 | + ), |
|
399 | + 'parent_name' => |
|
400 | + array ( |
|
401 | 401 | 'required' => false, |
402 | 402 | 'source' => 'non-db', |
403 | 403 | 'name' => 'parent_name', |
@@ -417,9 +417,9 @@ discard block |
||
417 | 417 | 'type_name' => 'parent_type', |
418 | 418 | 'id_name' => 'parent_id', |
419 | 419 | 'parent_type' => 'record_type_display', |
420 | - ), |
|
421 | - 'parent_type' => |
|
422 | - array ( |
|
420 | + ), |
|
421 | + 'parent_type' => |
|
422 | + array ( |
|
423 | 423 | 'required' => false, |
424 | 424 | 'name' => 'parent_type', |
425 | 425 | 'vname' => 'LBL_PARENT_TYPE', |
@@ -435,9 +435,9 @@ discard block |
||
435 | 435 | 'len' => 100, |
436 | 436 | 'dbType' => 'varchar', |
437 | 437 | 'studio' => 'hidden', |
438 | - ), |
|
439 | - 'parent_id' => |
|
440 | - array ( |
|
438 | + ), |
|
439 | + 'parent_id' => |
|
440 | + array ( |
|
441 | 441 | 'required' => false, |
442 | 442 | 'name' => 'parent_id', |
443 | 443 | 'vname' => 'LBL_PARENT_ID', |
@@ -451,9 +451,9 @@ discard block |
||
451 | 451 | 'audited' => 0, |
452 | 452 | 'reportable' => 0, |
453 | 453 | 'len' => 36, |
454 | - ), |
|
455 | - 'product_id' => |
|
456 | - array ( |
|
454 | + ), |
|
455 | + 'product_id' => |
|
456 | + array ( |
|
457 | 457 | 'required' => false, |
458 | 458 | 'name' => 'product_id', |
459 | 459 | 'vname' => '', |
@@ -467,9 +467,9 @@ discard block |
||
467 | 467 | 'audited' => 0, |
468 | 468 | 'reportable' => 0, |
469 | 469 | 'len' => 36, |
470 | - ), |
|
471 | - 'group_name' => |
|
472 | - array( |
|
470 | + ), |
|
471 | + 'group_name' => |
|
472 | + array( |
|
473 | 473 | 'name'=>'group_name', |
474 | 474 | 'rname'=>'name', |
475 | 475 | 'vname' => 'LBL_GROUP_NAME', |
@@ -480,9 +480,9 @@ discard block |
||
480 | 480 | 'id_name' => 'group_id', |
481 | 481 | 'module'=>'AOS_Line_Item_Groups', |
482 | 482 | 'duplicate_merge'=>'disabled', |
483 | - ), |
|
484 | - 'group_id' => |
|
485 | - array ( |
|
483 | + ), |
|
484 | + 'group_id' => |
|
485 | + array ( |
|
486 | 486 | 'required' => false, |
487 | 487 | 'name' => 'group_id', |
488 | 488 | 'vname' => '', |
@@ -496,37 +496,37 @@ discard block |
||
496 | 496 | 'audited' => 0, |
497 | 497 | 'reportable' => 0, |
498 | 498 | 'len' => 36, |
499 | - ), |
|
500 | - 'aos_products' => |
|
501 | - array ( |
|
502 | - 'name' => 'aos_products', |
|
499 | + ), |
|
500 | + 'aos_products' => |
|
501 | + array ( |
|
502 | + 'name' => 'aos_products', |
|
503 | 503 | 'type' => 'link', |
504 | 504 | 'relationship' => 'aos_product_quotes_aos_products', |
505 | 505 | 'module'=>'AOS_Products', |
506 | 506 | 'bean_name'=>'AOS_Products', |
507 | 507 | 'source'=>'non-db', |
508 | - ), |
|
508 | + ), |
|
509 | 509 | ), |
510 | 510 | 'indices' => array ( |
511 | 511 | array ( |
512 | - 'name' => 'idx_aospq_par_del', |
|
513 | - 'type' => 'index', |
|
514 | - 'fields' => array('parent_id','parent_type','deleted') |
|
512 | + 'name' => 'idx_aospq_par_del', |
|
513 | + 'type' => 'index', |
|
514 | + 'fields' => array('parent_id','parent_type','deleted') |
|
515 | 515 | ) |
516 | 516 | ), |
517 | 517 | 'relationships'=>array ( |
518 | - 'aos_product_quotes_aos_products' => |
|
519 | - array ( |
|
520 | - 'lhs_module'=> 'AOS_Products', |
|
521 | - 'lhs_table'=> 'aos_products', |
|
522 | - 'lhs_key' => 'id', |
|
523 | - 'rhs_module'=> 'AOS_Products_Quotes', |
|
524 | - 'rhs_table'=> 'aos_products_quotes', |
|
525 | - 'rhs_key' => 'product_id', |
|
526 | - 'relationship_type'=>'one-to-many', |
|
527 | - ), |
|
518 | + 'aos_product_quotes_aos_products' => |
|
519 | + array ( |
|
520 | + 'lhs_module'=> 'AOS_Products', |
|
521 | + 'lhs_table'=> 'aos_products', |
|
522 | + 'lhs_key' => 'id', |
|
523 | + 'rhs_module'=> 'AOS_Products_Quotes', |
|
524 | + 'rhs_table'=> 'aos_products_quotes', |
|
525 | + 'rhs_key' => 'product_id', |
|
526 | + 'relationship_type'=>'one-to-many', |
|
527 | + ), |
|
528 | 528 | ), |
529 | - 'optimistic_lock'=>true, |
|
529 | + 'optimistic_lock'=>true, |
|
530 | 530 | ); |
531 | 531 | require_once('include/SugarObjects/VardefManager.php'); |
532 | 532 | VardefManager::createVardef('AOS_Products_Quotes','AOS_Products_Quotes', array('basic','assignable')); |
@@ -25,9 +25,9 @@ discard block |
||
25 | 25 | $dictionary['AOS_Products_Quotes'] = array( |
26 | 26 | 'table'=>'aos_products_quotes', |
27 | 27 | 'audited'=>true, |
28 | - 'fields'=>array ( |
|
28 | + 'fields'=>array( |
|
29 | 29 | 'name' => |
30 | - array ( |
|
30 | + array( |
|
31 | 31 | 'name' => 'name', |
32 | 32 | 'vname' => 'LBL_NAME', |
33 | 33 | 'type' => 'text', |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | 'importable' => 'required', |
38 | 38 | ), |
39 | 39 | 'currency_id' => |
40 | - array ( |
|
40 | + array( |
|
41 | 41 | 'required' => false, |
42 | 42 | 'name' => 'currency_id', |
43 | 43 | 'vname' => 'LBL_CURRENCY', |
@@ -54,13 +54,13 @@ discard block |
||
54 | 54 | 'size' => '20', |
55 | 55 | 'studio' => 'visible', |
56 | 56 | 'function' => |
57 | - array ( |
|
57 | + array( |
|
58 | 58 | 'name' => 'getCurrencyDropDown', |
59 | 59 | 'returns' => 'html', |
60 | 60 | ), |
61 | 61 | ), |
62 | 62 | 'part_number' => |
63 | - array ( |
|
63 | + array( |
|
64 | 64 | 'required' => false, |
65 | 65 | 'name' => 'part_number', |
66 | 66 | 'vname' => 'LBL_PART_NUMBER', |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | 'id' => 'AOS_Products_Quotespart_number', |
83 | 83 | ), |
84 | 84 | 'item_description' => |
85 | - array ( |
|
85 | + array( |
|
86 | 86 | 'name' => 'item_description', |
87 | 87 | 'vname' => 'LBL_PRODUCT_DESCRIPTION', |
88 | 88 | 'type' => 'text', |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | 'cols' => 80, |
92 | 92 | ), |
93 | 93 | 'number' => |
94 | - array ( |
|
94 | + array( |
|
95 | 95 | 'required' => false, |
96 | 96 | 'name' => 'number', |
97 | 97 | 'vname' => 'LBL_LIST_NUM', |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | 'disable_num_format' => '', |
109 | 109 | ), |
110 | 110 | 'product_qty' => |
111 | - array ( |
|
111 | + array( |
|
112 | 112 | 'required' => false, |
113 | 113 | 'name' => 'product_qty', |
114 | 114 | 'vname' => 'LBL_PRODUCT_QTY', |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | 'precision' => '4', |
128 | 128 | ), |
129 | 129 | 'product_cost_price' => |
130 | - array ( |
|
130 | + array( |
|
131 | 131 | 'required' => false, |
132 | 132 | 'name' => 'product_cost_price', |
133 | 133 | 'vname' => 'LBL_PRODUCT_COST_PRICE', |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | 'len' => '26,6', |
144 | 144 | ), |
145 | 145 | 'product_cost_price_usdollar' => |
146 | - array ( |
|
146 | + array( |
|
147 | 147 | 'name' => 'product_cost_price_usdollar', |
148 | 148 | 'vname' => 'LBL_PRODUCT_COST_PRICE_USDOLLAR', |
149 | 149 | 'type' => 'currency', |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | 'len' => '26,6', |
161 | 161 | ), |
162 | 162 | 'product_list_price' => |
163 | - array ( |
|
163 | + array( |
|
164 | 164 | 'required' => false, |
165 | 165 | 'name' => 'product_list_price', |
166 | 166 | 'vname' => 'LBL_PRODUCT_LIST_PRICE', |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | 'len' => '26,6', |
177 | 177 | ), |
178 | 178 | 'product_list_price_usdollar' => |
179 | - array ( |
|
179 | + array( |
|
180 | 180 | 'name' => 'product_list_price_usdollar', |
181 | 181 | 'vname' => 'LBL_PRODUCT_LIST_PRICE_USDOLLAR', |
182 | 182 | 'type' => 'currency', |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | 'len' => '26,6', |
194 | 194 | ), |
195 | 195 | 'product_discount' => |
196 | - array ( |
|
196 | + array( |
|
197 | 197 | 'required' => false, |
198 | 198 | 'name' => 'product_discount', |
199 | 199 | 'vname' => 'LBL_PRODUCT_DISCOUNT', |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | 'len' => '26,6', |
210 | 210 | ), |
211 | 211 | 'product_discount_usdollar' => |
212 | - array ( |
|
212 | + array( |
|
213 | 213 | 'name' => 'product_discount_usdollar', |
214 | 214 | 'vname' => 'LBL_PRODUCT_DISCOUNT_USDOLLAR', |
215 | 215 | 'type' => 'currency', |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | 'len' => '26,6', |
227 | 227 | ), |
228 | 228 | 'product_discount_amount' => |
229 | - array ( |
|
229 | + array( |
|
230 | 230 | 'required' => false, |
231 | 231 | 'name' => 'product_discount_amount', |
232 | 232 | 'vname' => 'LBL_PRODUCT_DISCOUNT_AMOUNT', |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | 'len' => '26,6', |
243 | 243 | ), |
244 | 244 | 'product_discount_amount_usdollar' => |
245 | - array ( |
|
245 | + array( |
|
246 | 246 | 'name' => 'product_discount_amount_usdollar', |
247 | 247 | 'vname' => 'LBL_PRODUCT_DISCOUNT_AMOUNT_USDOLLAR', |
248 | 248 | 'type' => 'currency', |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | 'len' => '26,6', |
260 | 260 | ), |
261 | 261 | 'discount' => |
262 | - array ( |
|
262 | + array( |
|
263 | 263 | 'required' => false, |
264 | 264 | 'name' => 'discount', |
265 | 265 | 'vname' => 'LBL_DISCOUNT', |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | ), |
280 | 280 | |
281 | 281 | 'product_unit_price' => |
282 | - array ( |
|
282 | + array( |
|
283 | 283 | 'required' => '1', |
284 | 284 | 'name' => 'product_unit_price', |
285 | 285 | 'vname' => 'LBL_PRODUCT_UNIT_PRICE', |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | 'len' => '26,6', |
296 | 296 | ), |
297 | 297 | 'product_unit_price_usdollar' => |
298 | - array ( |
|
298 | + array( |
|
299 | 299 | 'name' => 'product_unit_price_usdollar', |
300 | 300 | 'vname' => 'LBL_PRODUCT_UNIT_PRICE_USDOLLAR', |
301 | 301 | 'type' => 'currency', |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | 'len' => '26,6', |
313 | 313 | ), |
314 | 314 | 'vat_amt' => |
315 | - array ( |
|
315 | + array( |
|
316 | 316 | 'required' => '1', |
317 | 317 | 'name' => 'vat_amt', |
318 | 318 | 'vname' => 'LBL_VAT_AMT', |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | 'len' => '26,6', |
329 | 329 | ), |
330 | 330 | 'vat_amt_usdollar' => |
331 | - array ( |
|
331 | + array( |
|
332 | 332 | 'name' => 'vat_amt_usdollar', |
333 | 333 | 'vname' => 'LBL_VAT_AMT_USDOLLAR', |
334 | 334 | 'type' => 'currency', |
@@ -345,7 +345,7 @@ discard block |
||
345 | 345 | 'len' => '26,6', |
346 | 346 | ), |
347 | 347 | 'product_total_price' => |
348 | - array ( |
|
348 | + array( |
|
349 | 349 | 'required' => '1', |
350 | 350 | 'name' => 'product_total_price', |
351 | 351 | 'vname' => 'LBL_PRODUCT_TOTAL_PRICE', |
@@ -361,7 +361,7 @@ discard block |
||
361 | 361 | 'len' => '26,6', |
362 | 362 | ), |
363 | 363 | 'product_total_price_usdollar' => |
364 | - array ( |
|
364 | + array( |
|
365 | 365 | 'name' => 'product_total_price_usdollar', |
366 | 366 | 'vname' => 'LBL_PRODUCT_TOTAL_PRICE_USDOLLAR', |
367 | 367 | 'type' => 'currency', |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | 'len' => '26,6', |
379 | 379 | ), |
380 | 380 | 'vat' => |
381 | - array ( |
|
381 | + array( |
|
382 | 382 | 'required' => false, |
383 | 383 | 'name' => 'vat', |
384 | 384 | 'vname' => 'LBL_VAT', |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | 'studio' => 'visible', |
398 | 398 | ), |
399 | 399 | 'parent_name' => |
400 | - array ( |
|
400 | + array( |
|
401 | 401 | 'required' => false, |
402 | 402 | 'source' => 'non-db', |
403 | 403 | 'name' => 'parent_name', |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | 'parent_type' => 'record_type_display', |
420 | 420 | ), |
421 | 421 | 'parent_type' => |
422 | - array ( |
|
422 | + array( |
|
423 | 423 | 'required' => false, |
424 | 424 | 'name' => 'parent_type', |
425 | 425 | 'vname' => 'LBL_PARENT_TYPE', |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | 'studio' => 'hidden', |
438 | 438 | ), |
439 | 439 | 'parent_id' => |
440 | - array ( |
|
440 | + array( |
|
441 | 441 | 'required' => false, |
442 | 442 | 'name' => 'parent_id', |
443 | 443 | 'vname' => 'LBL_PARENT_ID', |
@@ -453,7 +453,7 @@ discard block |
||
453 | 453 | 'len' => 36, |
454 | 454 | ), |
455 | 455 | 'product_id' => |
456 | - array ( |
|
456 | + array( |
|
457 | 457 | 'required' => false, |
458 | 458 | 'name' => 'product_id', |
459 | 459 | 'vname' => '', |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | 'duplicate_merge'=>'disabled', |
483 | 483 | ), |
484 | 484 | 'group_id' => |
485 | - array ( |
|
485 | + array( |
|
486 | 486 | 'required' => false, |
487 | 487 | 'name' => 'group_id', |
488 | 488 | 'vname' => '', |
@@ -498,7 +498,7 @@ discard block |
||
498 | 498 | 'len' => 36, |
499 | 499 | ), |
500 | 500 | 'aos_products' => |
501 | - array ( |
|
501 | + array( |
|
502 | 502 | 'name' => 'aos_products', |
503 | 503 | 'type' => 'link', |
504 | 504 | 'relationship' => 'aos_product_quotes_aos_products', |
@@ -507,16 +507,16 @@ discard block |
||
507 | 507 | 'source'=>'non-db', |
508 | 508 | ), |
509 | 509 | ), |
510 | -'indices' => array ( |
|
511 | - array ( |
|
510 | +'indices' => array( |
|
511 | + array( |
|
512 | 512 | 'name' => 'idx_aospq_par_del', |
513 | 513 | 'type' => 'index', |
514 | - 'fields' => array('parent_id','parent_type','deleted') |
|
514 | + 'fields' => array('parent_id', 'parent_type', 'deleted') |
|
515 | 515 | ) |
516 | 516 | ), |
517 | -'relationships'=>array ( |
|
517 | +'relationships'=>array( |
|
518 | 518 | 'aos_product_quotes_aos_products' => |
519 | - array ( |
|
519 | + array( |
|
520 | 520 | 'lhs_module'=> 'AOS_Products', |
521 | 521 | 'lhs_table'=> 'aos_products', |
522 | 522 | 'lhs_key' => 'id', |
@@ -529,4 +529,4 @@ discard block |
||
529 | 529 | 'optimistic_lock'=>true, |
530 | 530 | ); |
531 | 531 | require_once('include/SugarObjects/VardefManager.php'); |
532 | -VardefManager::createVardef('AOS_Products_Quotes','AOS_Products_Quotes', array('basic','assignable')); |
|
532 | +VardefManager::createVardef('AOS_Products_Quotes', 'AOS_Products_Quotes', array('basic', 'assignable')); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | 'LBL_EMAIL_ADDRESS' => 'Email Address:', |
56 | 56 | 'LBL_MY_PIPELINE_FORM_TITLE' => 'My Pipeline', |
57 | 57 | 'LBL_PIPELINE_FORM_TITLE' => 'Pipeline By Sales Stage', |
58 | - 'LBL_RGraph_PIPELINE_FORM_TITLE' => 'Pipeline By Sales Stage', |
|
58 | + 'LBL_RGraph_PIPELINE_FORM_TITLE' => 'Pipeline By Sales Stage', |
|
59 | 59 | 'LBL_CAMPAIGN_ROI_FORM_TITLE' => 'Campaign ROI', |
60 | 60 | 'LBL_MY_CLOSED_OPPORTUNITIES_GAUGE' => 'My Closed Won Opportunities Gauge', |
61 | 61 | 'LNK_NEW_CONTACT' => 'Create Contact', |
@@ -80,35 +80,35 @@ discard block |
||
80 | 80 | 'LBL_NO_RESULTS' => '<h2>There were no results found. Please search again.</h2><br>', |
81 | 81 | 'LBL_NO_RESULTS_TIPS' => '<h3>Search Tips:</h3><ul><li>Make sure you have the proper categories selected above.</li><li>Broaden your search criteria.</li><li>If you still cannot find any results try the advanced search option.</li></ul>', |
82 | 82 | |
83 | - 'LBL_RELOAD_PAGE' => 'Please <a href="javascript: window.location.reload()">reload the window</a> to use this SuiteCRM Dashlet.', |
|
84 | - 'LBL_ADD_DASHLETS' => 'Add SuiteCRM Dashlets', |
|
85 | - 'LBL_ADD_PAGE' => 'Add Page', |
|
86 | - 'LBL_DEL_PAGE' => 'Delete Page', |
|
87 | - 'LBL_WEBSITE_TITLE' => 'Website', |
|
88 | - 'LBL_RSS_TITLE' => 'News Feed', |
|
89 | - 'LBL_DELETE_PAGE' => 'Delete Page', |
|
90 | - 'LBL_CHANGE_LAYOUT' => 'Change Layout', |
|
91 | - 'LBL_RENAME_PAGE' => 'Rename Page', |
|
92 | - 'LBL_CLOSE_DASHLETS' => 'Close', |
|
93 | - 'LBL_OPTIONS' => 'Options', |
|
94 | - // dashlet search fields |
|
95 | - 'LBL_TODAY'=>'Today', |
|
96 | - 'LBL_YESTERDAY' => 'Yesterday', |
|
97 | - 'LBL_TOMORROW'=>'Tomorrow', |
|
98 | - 'LBL_LAST_WEEK'=>'Last Week', |
|
99 | - 'LBL_NEXT_WEEK'=>'Next Week', |
|
100 | - 'LBL_LAST_7_DAYS'=>'Last 7 Days', |
|
101 | - 'LBL_NEXT_7_DAYS'=>'Next 7 Days', |
|
102 | - 'LBL_LAST_MONTH'=>'Last Month', |
|
103 | - 'LBL_NEXT_MONTH'=>'Next Month', |
|
104 | - 'LBL_LAST_QUARTER'=>'Last Quarter', |
|
105 | - 'LBL_THIS_QUARTER'=>'This Quarter', |
|
106 | - 'LBL_LAST_YEAR'=>'Last Year', |
|
107 | - 'LBL_NEXT_YEAR'=>'Next Year', |
|
108 | - 'LBL_LAST_30_DAYS' => 'Last 30 Days', |
|
109 | - 'LBL_NEXT_30_DAYS' => 'Next 30 Days', |
|
110 | - 'LBL_THIS_MONTH' => 'This Month', |
|
111 | - 'LBL_THIS_YEAR' => 'This Year', |
|
83 | + 'LBL_RELOAD_PAGE' => 'Please <a href="javascript: window.location.reload()">reload the window</a> to use this SuiteCRM Dashlet.', |
|
84 | + 'LBL_ADD_DASHLETS' => 'Add SuiteCRM Dashlets', |
|
85 | + 'LBL_ADD_PAGE' => 'Add Page', |
|
86 | + 'LBL_DEL_PAGE' => 'Delete Page', |
|
87 | + 'LBL_WEBSITE_TITLE' => 'Website', |
|
88 | + 'LBL_RSS_TITLE' => 'News Feed', |
|
89 | + 'LBL_DELETE_PAGE' => 'Delete Page', |
|
90 | + 'LBL_CHANGE_LAYOUT' => 'Change Layout', |
|
91 | + 'LBL_RENAME_PAGE' => 'Rename Page', |
|
92 | + 'LBL_CLOSE_DASHLETS' => 'Close', |
|
93 | + 'LBL_OPTIONS' => 'Options', |
|
94 | + // dashlet search fields |
|
95 | + 'LBL_TODAY'=>'Today', |
|
96 | + 'LBL_YESTERDAY' => 'Yesterday', |
|
97 | + 'LBL_TOMORROW'=>'Tomorrow', |
|
98 | + 'LBL_LAST_WEEK'=>'Last Week', |
|
99 | + 'LBL_NEXT_WEEK'=>'Next Week', |
|
100 | + 'LBL_LAST_7_DAYS'=>'Last 7 Days', |
|
101 | + 'LBL_NEXT_7_DAYS'=>'Next 7 Days', |
|
102 | + 'LBL_LAST_MONTH'=>'Last Month', |
|
103 | + 'LBL_NEXT_MONTH'=>'Next Month', |
|
104 | + 'LBL_LAST_QUARTER'=>'Last Quarter', |
|
105 | + 'LBL_THIS_QUARTER'=>'This Quarter', |
|
106 | + 'LBL_LAST_YEAR'=>'Last Year', |
|
107 | + 'LBL_NEXT_YEAR'=>'Next Year', |
|
108 | + 'LBL_LAST_30_DAYS' => 'Last 30 Days', |
|
109 | + 'LBL_NEXT_30_DAYS' => 'Next 30 Days', |
|
110 | + 'LBL_THIS_MONTH' => 'This Month', |
|
111 | + 'LBL_THIS_YEAR' => 'This Year', |
|
112 | 112 | |
113 | 113 | 'LBL_MODULES' => 'Modules', |
114 | 114 | 'LBL_CHARTS' => 'Charts', |
@@ -116,44 +116,44 @@ discard block |
||
116 | 116 | 'LBL_WEB' => 'Web', |
117 | 117 | 'LBL_SEARCH_RESULTS' => 'Search Result', |
118 | 118 | |
119 | - // Dashlet Categories |
|
120 | - 'dashlet_categories_dom' => array( |
|
121 | - 'Module Views' => 'Module Views', |
|
122 | - 'Portal' => 'Portal', |
|
123 | - 'Charts' => 'Charts', |
|
124 | - 'Tools' => 'Tools', |
|
125 | - 'Miscellaneous' => 'Miscellaneous'), |
|
126 | - 'LBL_MAX_DASHLETS_REACHED' => 'You have reached the maximum number of SuiteCRM Dashlets your administrator has set. Please remove a SuiteCRM Dashlet to add a new one.', |
|
127 | - 'LBL_ADDING_DASHLET' => 'Adding SuiteCRM Dashlet ...', |
|
128 | - 'LBL_ADDED_DASHLET' => 'SuiteCRM Dashlet Added', |
|
129 | - 'LBL_REMOVE_DASHLET_CONFIRM' => 'Are you sure you want to remove this SuiteCRM Dashlet?', |
|
130 | - 'LBL_REMOVING_DASHLET' => 'Removing SuiteCRM Dashlet ...', |
|
131 | - 'LBL_REMOVED_DASHLET' => 'SuiteCRM Dashlet Removed', |
|
132 | - 'LBL_DASHLET_CONFIGURE_GENERAL' => 'General', |
|
133 | - 'LBL_DASHLET_CONFIGURE_FILTERS' => 'Filters', |
|
134 | - 'LBL_DASHLET_CONFIGURE_MY_ITEMS_ONLY' => 'Only My Items', |
|
135 | - 'LBL_DASHLET_CONFIGURE_TITLE' => 'Title', |
|
136 | - 'LBL_DASHLET_CONFIGURE_DISPLAY_ROWS' => 'Display Rows', |
|
119 | + // Dashlet Categories |
|
120 | + 'dashlet_categories_dom' => array( |
|
121 | + 'Module Views' => 'Module Views', |
|
122 | + 'Portal' => 'Portal', |
|
123 | + 'Charts' => 'Charts', |
|
124 | + 'Tools' => 'Tools', |
|
125 | + 'Miscellaneous' => 'Miscellaneous'), |
|
126 | + 'LBL_MAX_DASHLETS_REACHED' => 'You have reached the maximum number of SuiteCRM Dashlets your administrator has set. Please remove a SuiteCRM Dashlet to add a new one.', |
|
127 | + 'LBL_ADDING_DASHLET' => 'Adding SuiteCRM Dashlet ...', |
|
128 | + 'LBL_ADDED_DASHLET' => 'SuiteCRM Dashlet Added', |
|
129 | + 'LBL_REMOVE_DASHLET_CONFIRM' => 'Are you sure you want to remove this SuiteCRM Dashlet?', |
|
130 | + 'LBL_REMOVING_DASHLET' => 'Removing SuiteCRM Dashlet ...', |
|
131 | + 'LBL_REMOVED_DASHLET' => 'SuiteCRM Dashlet Removed', |
|
132 | + 'LBL_DASHLET_CONFIGURE_GENERAL' => 'General', |
|
133 | + 'LBL_DASHLET_CONFIGURE_FILTERS' => 'Filters', |
|
134 | + 'LBL_DASHLET_CONFIGURE_MY_ITEMS_ONLY' => 'Only My Items', |
|
135 | + 'LBL_DASHLET_CONFIGURE_TITLE' => 'Title', |
|
136 | + 'LBL_DASHLET_CONFIGURE_DISPLAY_ROWS' => 'Display Rows', |
|
137 | 137 | |
138 | - 'LBL_DASHLET_DELETE' => 'Delete SuiteCRM Dashlet', |
|
139 | - 'LBL_DASHLET_REFRESH' => 'Refresh SuiteCRM Dashlet', |
|
140 | - 'LBL_DASHLET_EDIT' => 'Edit SuiteCRM Dashlet', |
|
138 | + 'LBL_DASHLET_DELETE' => 'Delete SuiteCRM Dashlet', |
|
139 | + 'LBL_DASHLET_REFRESH' => 'Refresh SuiteCRM Dashlet', |
|
140 | + 'LBL_DASHLET_EDIT' => 'Edit SuiteCRM Dashlet', |
|
141 | 141 | |
142 | 142 | 'LBL_TRAINING_TITLE' => 'Training', |
143 | 143 | |
144 | - 'LBL_CREATING_NEW_PAGE' => 'Creating New Page...', |
|
145 | - 'LBL_NEW_PAGE_FEEDBACK' => 'You have created a new page. You can add new content with the Add SuiteCRM Dashlets option.', |
|
146 | - 'LBL_DELETE_PAGE_CONFIRM' => 'Are you sure you want to delete this page?', |
|
147 | - 'LBL_SAVING_PAGE_TITLE' => 'Saving Page Title...', |
|
148 | - 'LBL_RETRIEVING_PAGE' => 'Retrieving Page...', |
|
144 | + 'LBL_CREATING_NEW_PAGE' => 'Creating New Page...', |
|
145 | + 'LBL_NEW_PAGE_FEEDBACK' => 'You have created a new page. You can add new content with the Add SuiteCRM Dashlets option.', |
|
146 | + 'LBL_DELETE_PAGE_CONFIRM' => 'Are you sure you want to delete this page?', |
|
147 | + 'LBL_SAVING_PAGE_TITLE' => 'Saving Page Title...', |
|
148 | + 'LBL_RETRIEVING_PAGE' => 'Retrieving Page...', |
|
149 | 149 | |
150 | - // Default out-of-box names for tabs |
|
151 | - 'LBL_HOME_PAGE_1_NAME' => 'My SuiteCRM', |
|
152 | - 'LBL_HOME_PAGE_2_NAME' => 'Sales', |
|
153 | - 'LBL_HOME_PAGE_3_NAME' => 'Support', |
|
154 | - 'LBL_HOME_PAGE_6_NAME' => 'Marketing',//bug 16510, separate the support and marketing page from each other |
|
155 | - 'LBL_HOME_PAGE_4_NAME' => 'Tracker', |
|
156 | - 'LBL_CLOSE_SITEMAP' => 'Close', |
|
150 | + // Default out-of-box names for tabs |
|
151 | + 'LBL_HOME_PAGE_1_NAME' => 'My SuiteCRM', |
|
152 | + 'LBL_HOME_PAGE_2_NAME' => 'Sales', |
|
153 | + 'LBL_HOME_PAGE_3_NAME' => 'Support', |
|
154 | + 'LBL_HOME_PAGE_6_NAME' => 'Marketing',//bug 16510, separate the support and marketing page from each other |
|
155 | + 'LBL_HOME_PAGE_4_NAME' => 'Tracker', |
|
156 | + 'LBL_CLOSE_SITEMAP' => 'Close', |
|
157 | 157 | |
158 | 158 | 'LBL_SEARCH' => 'Search', |
159 | 159 | 'LBL_CLEAR' => 'Clear', |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | 'LBL_MY_TEAM_REPORT_CHARTS' => 'My Team Reports', |
167 | 167 | 'LBL_MY_SAVED_REPORT_CHARTS' => 'My Saved Reports', |
168 | 168 | |
169 | - 'LBL_DASHLET_SEARCH' => 'Find SuiteCRM Dashlet', |
|
169 | + 'LBL_DASHLET_SEARCH' => 'Find SuiteCRM Dashlet', |
|
170 | 170 | |
171 | 171 | //ABOUT page |
172 | 172 | 'LBL_VERSION' => 'Version', |
@@ -177,77 +177,77 @@ discard block |
||
177 | 177 | 'LBL_ADD_TERM_COM' => '<P>The interactive user interfaces in modified source and object code versions of this program must display Appropriate Legal Notices, as required under Section 5 of the GNU Affero General Public License version 3. In accordance with Section 7(b) of the GNU General Public License version 3, these Appropriate Legal Notices must retain the display of the "Powered by SugarCRM" logo. If the display of the logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices must display the words "Powered by SugarCRM".</P>', |
178 | 178 | |
179 | 179 | |
180 | - 'LBL_SUGAR_COMMUNITY_EDITION' => 'Sugar Community Edition', |
|
181 | - 'LBL_AND' => "and", |
|
182 | - 'LBL_ARE' => "are", |
|
183 | - 'LBL_TRADEMARKS' => 'trademarks', |
|
184 | - 'LBL_OF' => 'of', |
|
185 | - 'LBL_FOUNDERS' => 'Founders', |
|
186 | - 'LBL_JOIN_SUGAR_COMMUNITY' => 'Join the SuiteCRM Community', |
|
187 | - 'LBL_DETAILS_SUGARFORGE' => 'Collaborate and develop SuiteCRM extensions', |
|
188 | - 'LBL_DETAILS_SUGAREXCHANGE' => 'Buy and sell certified SuiteCRM extensions', |
|
189 | - 'LBL_TRAINING' => 'Training', |
|
190 | - 'LBL_DETAILS_TRAINING' => 'Learn about SuiteCRM using online and interactive learning content', |
|
191 | - 'LBL_FORUMS' => 'Forums', |
|
192 | - 'LBL_DETAILS_FORUMS' => 'Discuss SuiteCRM with expert community users and developers', |
|
193 | - 'LBL_WIKI' => 'Wiki', |
|
194 | - 'LBL_DETAILS_WIKI' => 'Search the knowledge base of user and developer topics', |
|
195 | - 'LBL_DEVSITE' => 'Developer Site', |
|
196 | - 'LBL_DETAILS_DEVSITE' => 'Discover resources, tutorials, and helpful links to get you up to speed on SuiteCRM development', |
|
197 | - 'LBL_GET_SUGARCRM_RSS' => 'Get SuiteCRM RSS', |
|
198 | - 'LBL_SUGARCRM_NEWS' => 'SuiteCRM News', |
|
199 | - 'LBL_SUGARCRM_TRAINING_NEWS' => 'SuiteCRM Training News', |
|
200 | - 'LBL_SUGARCRM_FORUMS' => 'SuiteCRM Forums', |
|
201 | - 'LBL_SUGARFORGE_NEWS' => 'SuiteCRM News', |
|
202 | - 'LBL_ALL_NEWS' => 'All News', |
|
203 | - 'LBL_SOURCE_CODE' => 'Source Code', |
|
180 | + 'LBL_SUGAR_COMMUNITY_EDITION' => 'Sugar Community Edition', |
|
181 | + 'LBL_AND' => "and", |
|
182 | + 'LBL_ARE' => "are", |
|
183 | + 'LBL_TRADEMARKS' => 'trademarks', |
|
184 | + 'LBL_OF' => 'of', |
|
185 | + 'LBL_FOUNDERS' => 'Founders', |
|
186 | + 'LBL_JOIN_SUGAR_COMMUNITY' => 'Join the SuiteCRM Community', |
|
187 | + 'LBL_DETAILS_SUGARFORGE' => 'Collaborate and develop SuiteCRM extensions', |
|
188 | + 'LBL_DETAILS_SUGAREXCHANGE' => 'Buy and sell certified SuiteCRM extensions', |
|
189 | + 'LBL_TRAINING' => 'Training', |
|
190 | + 'LBL_DETAILS_TRAINING' => 'Learn about SuiteCRM using online and interactive learning content', |
|
191 | + 'LBL_FORUMS' => 'Forums', |
|
192 | + 'LBL_DETAILS_FORUMS' => 'Discuss SuiteCRM with expert community users and developers', |
|
193 | + 'LBL_WIKI' => 'Wiki', |
|
194 | + 'LBL_DETAILS_WIKI' => 'Search the knowledge base of user and developer topics', |
|
195 | + 'LBL_DEVSITE' => 'Developer Site', |
|
196 | + 'LBL_DETAILS_DEVSITE' => 'Discover resources, tutorials, and helpful links to get you up to speed on SuiteCRM development', |
|
197 | + 'LBL_GET_SUGARCRM_RSS' => 'Get SuiteCRM RSS', |
|
198 | + 'LBL_SUGARCRM_NEWS' => 'SuiteCRM News', |
|
199 | + 'LBL_SUGARCRM_TRAINING_NEWS' => 'SuiteCRM Training News', |
|
200 | + 'LBL_SUGARCRM_FORUMS' => 'SuiteCRM Forums', |
|
201 | + 'LBL_SUGARFORGE_NEWS' => 'SuiteCRM News', |
|
202 | + 'LBL_ALL_NEWS' => 'All News', |
|
203 | + 'LBL_SOURCE_CODE' => 'Source Code', |
|
204 | 204 | 'LBL_SOURCE_SUGAR' => 'SugarCRM Inc - providers of CE framework', |
205 | - 'LBL_SOURCE_XTEMPLATE' => 'XTemplate - A template engine for PHP created by Barnabás Debreceni', |
|
206 | - 'LBL_SOURCE_NUSOAP' => 'NuSOAP - A set of PHP classes that allow developers to create and consume web services created by NuSphere Corporation and Dietrich Ayala', |
|
207 | - 'LBL_SOURCE_JSCALENDAR' => 'JS Calendar - A calendar for entering dates created by Mihai Bazon', |
|
208 | - 'LBL_SOURCE_PHPPDF' => 'PHP PDF - A library for creating PDF documents created by Wayne Munro', |
|
209 | - 'LBL_SOURCE_HTTP_WEBDAV_SERVER' => 'HTTP_WebDAV_Server - A WebDAV Server Implementation in PHP.', |
|
210 | - 'LBL_SOURCE_PCLZIP' => 'PclZip - library offers compression and extraction functions for Zip formatted archives by Vincent Blavet', |
|
211 | - 'LBL_SOURCE_SMARTY' => 'Smarty - A template engine for PHP.', |
|
212 | - 'LBL_SOURCE_YAHOO_UI_LIB' => 'Yahoo! User Interface Library - The UI Library Utilities facilitate the implementation of rich client-side features.', |
|
213 | - 'LBL_SOURCE_PHPMAILER' => 'PHPMailer - A full featured email transfer class for PHP', |
|
214 | - 'LBL_SOURCE_JSHRINK' => 'JShrink - A Javascript minifier written in PHP', |
|
215 | - 'LBL_SOURCE_CRYPT_BLOWFISH' => 'Crypt_Blowfish - Allows for quick two-way blowfish encryption without requiring the MCrypt PHP extension.', |
|
216 | - 'LBL_SOURCE_XML_HTMLSAX3' => 'XML_HTMLSax3 - A SAX parser for HTML and other badly formed XML documents', |
|
217 | - 'LBL_SOURCE_YAHOO_UI_LIB_EXT' => 'Yahoo! UI Extensions Library - Extensions to the Yahoo! User Interface Library by Jack Slocum', |
|
218 | - 'LBL_SOURCE_SWFOBJECT' => 'SWFObject - Javascript Flash Player detection and embed script.', |
|
219 | - 'LBL_SOURCE_TINYMCE' => 'TinyMCE - A WYSIWYG editor control for web browsers that enables the user to edit HTML contents', |
|
220 | - 'LBL_SOURCE_EXT' => 'Ext - A client-side JavaScript framework for building web applications.', |
|
221 | - 'LBL_SOURCE_RECAPTCHA' => 'reCAPTCHA - A free CAPTCHA service that helps to digitize books, newspapers and old time radio shows.', |
|
222 | - 'LBL_SOURCE_TCPDF' => 'TCPDF - A PHP class for generating PDF documents.', |
|
223 | - 'LBL_SOURCE_CSSMIN' => 'CssMin - A css parser and minifier.', |
|
224 | - 'LBL_SOURCE_PHPSAML' => 'PHP-SAML - A simple SAML toolkit for PHP.', |
|
225 | - 'LBL_SOURCE_ISCROLL' => 'iScroll - The overflow:scroll for mobile webkit. Native scrolling inside a fixed width/height element.', |
|
226 | - 'LBL_SOURCE_FLASHCANVAS' => 'FlashCanvas - FlashCanvas is a JavaScript library which adds the HTML5 Canvas support to Internet Explorer. It renders shapes and images via Flash drawing API. It supports almost all Canvas APIs and, in many cases, runs faster than other similar libraries which use VML or Silverlight.', |
|
227 | - 'LBL_SOURCE_JIT' => 'JavaScript InfoVis Toolkit - The JavaScript InfoVis Toolkit provides tools for creating Interactive Data Visualizations for the Web.', |
|
228 | - 'LBL_SOURCE_ZEND' => 'Zend Framework - An open source, object oriented web application framework for PHP5.', |
|
229 | - 'LBL_SOURCE_PARSECSV' => 'parseCSV - CSV data parser for PHP', |
|
230 | - 'LBL_SOURCE_PHPJS' => 'php.js - Use PHP functions in JavaScript', |
|
231 | - 'LBL_SOURCE_PHPSQL' => 'PHP SQL Parser', |
|
232 | - 'LBL_SOURCE_HTMLPURIFIER' => 'HTML Purifier - A standards-compliant HTML filtering library.', |
|
233 | - 'LBL_SOURCE_XHPROF' => 'XHProf - A function-level hierarchical profiler for PHP.', |
|
234 | - 'LBL_SOURCE_ELASTICA' => 'Elastica - PHP client for the distributed search engine elasticsearch ', |
|
235 | - 'LBL_SOURCE_FACEBOOKSDK' => 'Facebook PHP SDK', |
|
236 | - 'LBL_SOURCE_JQUERY' => 'jQuery - jQuery is a fast, small, and feature-rich JavaScript library.', |
|
237 | - 'LBL_SOURCE_JQUERY_UI' => 'jQuery UI - jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library.', |
|
238 | - 'LBL_SOURCE_OVERLIB' => 'OverlibMWS - The overlibmws library uses javascript for DHTML popups that serve as informational and navigational aids for websites.', |
|
205 | + 'LBL_SOURCE_XTEMPLATE' => 'XTemplate - A template engine for PHP created by Barnabás Debreceni', |
|
206 | + 'LBL_SOURCE_NUSOAP' => 'NuSOAP - A set of PHP classes that allow developers to create and consume web services created by NuSphere Corporation and Dietrich Ayala', |
|
207 | + 'LBL_SOURCE_JSCALENDAR' => 'JS Calendar - A calendar for entering dates created by Mihai Bazon', |
|
208 | + 'LBL_SOURCE_PHPPDF' => 'PHP PDF - A library for creating PDF documents created by Wayne Munro', |
|
209 | + 'LBL_SOURCE_HTTP_WEBDAV_SERVER' => 'HTTP_WebDAV_Server - A WebDAV Server Implementation in PHP.', |
|
210 | + 'LBL_SOURCE_PCLZIP' => 'PclZip - library offers compression and extraction functions for Zip formatted archives by Vincent Blavet', |
|
211 | + 'LBL_SOURCE_SMARTY' => 'Smarty - A template engine for PHP.', |
|
212 | + 'LBL_SOURCE_YAHOO_UI_LIB' => 'Yahoo! User Interface Library - The UI Library Utilities facilitate the implementation of rich client-side features.', |
|
213 | + 'LBL_SOURCE_PHPMAILER' => 'PHPMailer - A full featured email transfer class for PHP', |
|
214 | + 'LBL_SOURCE_JSHRINK' => 'JShrink - A Javascript minifier written in PHP', |
|
215 | + 'LBL_SOURCE_CRYPT_BLOWFISH' => 'Crypt_Blowfish - Allows for quick two-way blowfish encryption without requiring the MCrypt PHP extension.', |
|
216 | + 'LBL_SOURCE_XML_HTMLSAX3' => 'XML_HTMLSax3 - A SAX parser for HTML and other badly formed XML documents', |
|
217 | + 'LBL_SOURCE_YAHOO_UI_LIB_EXT' => 'Yahoo! UI Extensions Library - Extensions to the Yahoo! User Interface Library by Jack Slocum', |
|
218 | + 'LBL_SOURCE_SWFOBJECT' => 'SWFObject - Javascript Flash Player detection and embed script.', |
|
219 | + 'LBL_SOURCE_TINYMCE' => 'TinyMCE - A WYSIWYG editor control for web browsers that enables the user to edit HTML contents', |
|
220 | + 'LBL_SOURCE_EXT' => 'Ext - A client-side JavaScript framework for building web applications.', |
|
221 | + 'LBL_SOURCE_RECAPTCHA' => 'reCAPTCHA - A free CAPTCHA service that helps to digitize books, newspapers and old time radio shows.', |
|
222 | + 'LBL_SOURCE_TCPDF' => 'TCPDF - A PHP class for generating PDF documents.', |
|
223 | + 'LBL_SOURCE_CSSMIN' => 'CssMin - A css parser and minifier.', |
|
224 | + 'LBL_SOURCE_PHPSAML' => 'PHP-SAML - A simple SAML toolkit for PHP.', |
|
225 | + 'LBL_SOURCE_ISCROLL' => 'iScroll - The overflow:scroll for mobile webkit. Native scrolling inside a fixed width/height element.', |
|
226 | + 'LBL_SOURCE_FLASHCANVAS' => 'FlashCanvas - FlashCanvas is a JavaScript library which adds the HTML5 Canvas support to Internet Explorer. It renders shapes and images via Flash drawing API. It supports almost all Canvas APIs and, in many cases, runs faster than other similar libraries which use VML or Silverlight.', |
|
227 | + 'LBL_SOURCE_JIT' => 'JavaScript InfoVis Toolkit - The JavaScript InfoVis Toolkit provides tools for creating Interactive Data Visualizations for the Web.', |
|
228 | + 'LBL_SOURCE_ZEND' => 'Zend Framework - An open source, object oriented web application framework for PHP5.', |
|
229 | + 'LBL_SOURCE_PARSECSV' => 'parseCSV - CSV data parser for PHP', |
|
230 | + 'LBL_SOURCE_PHPJS' => 'php.js - Use PHP functions in JavaScript', |
|
231 | + 'LBL_SOURCE_PHPSQL' => 'PHP SQL Parser', |
|
232 | + 'LBL_SOURCE_HTMLPURIFIER' => 'HTML Purifier - A standards-compliant HTML filtering library.', |
|
233 | + 'LBL_SOURCE_XHPROF' => 'XHProf - A function-level hierarchical profiler for PHP.', |
|
234 | + 'LBL_SOURCE_ELASTICA' => 'Elastica - PHP client for the distributed search engine elasticsearch ', |
|
235 | + 'LBL_SOURCE_FACEBOOKSDK' => 'Facebook PHP SDK', |
|
236 | + 'LBL_SOURCE_JQUERY' => 'jQuery - jQuery is a fast, small, and feature-rich JavaScript library.', |
|
237 | + 'LBL_SOURCE_JQUERY_UI' => 'jQuery UI - jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library.', |
|
238 | + 'LBL_SOURCE_OVERLIB' => 'OverlibMWS - The overlibmws library uses javascript for DHTML popups that serve as informational and navigational aids for websites.', |
|
239 | 239 | |
240 | - 'LBL_DASHLET_TITLE' => 'My Sites', |
|
241 | - 'LBL_DASHLET_OPT_TITLE' => 'Title', |
|
242 | - 'LBL_DASHLET_INCORRECT_URL' => 'Incorrect website location is specified', |
|
243 | - 'LBL_DASHLET_OPT_URL' => 'Website Location', |
|
244 | - 'LBL_DASHLET_OPT_HEIGHT' => 'Dashlet Height (in pixels)', |
|
245 | - 'LBL_DASHLET_SUGAR_NEWS' => 'SuiteCRM News', |
|
246 | - 'LBL_DASHLET_DISCOVER_SUGAR_PRO' => 'Discover SuiteCRM', |
|
247 | - 'LBL_POWERED_BY_SUGAR' => 'Powered By SugarCRM' /*for 508 compliance fix*/, |
|
248 | - 'LBL_MORE_DETAIL' => 'More Detail' /*for 508 compliance fix*/, |
|
249 | - 'LBL_BASIC_SEARCH' => 'Basic Search' /*for 508 compliance fix*/, |
|
250 | - 'LBL_ADVANCED_SEARCH' => 'Advanced Search' /*for 508 compliance fix*/, |
|
240 | + 'LBL_DASHLET_TITLE' => 'My Sites', |
|
241 | + 'LBL_DASHLET_OPT_TITLE' => 'Title', |
|
242 | + 'LBL_DASHLET_INCORRECT_URL' => 'Incorrect website location is specified', |
|
243 | + 'LBL_DASHLET_OPT_URL' => 'Website Location', |
|
244 | + 'LBL_DASHLET_OPT_HEIGHT' => 'Dashlet Height (in pixels)', |
|
245 | + 'LBL_DASHLET_SUGAR_NEWS' => 'SuiteCRM News', |
|
246 | + 'LBL_DASHLET_DISCOVER_SUGAR_PRO' => 'Discover SuiteCRM', |
|
247 | + 'LBL_POWERED_BY_SUGAR' => 'Powered By SugarCRM' /*for 508 compliance fix*/, |
|
248 | + 'LBL_MORE_DETAIL' => 'More Detail' /*for 508 compliance fix*/, |
|
249 | + 'LBL_BASIC_SEARCH' => 'Basic Search' /*for 508 compliance fix*/, |
|
250 | + 'LBL_ADVANCED_SEARCH' => 'Advanced Search' /*for 508 compliance fix*/, |
|
251 | 251 | 'LBL_TOUR_HOME' => 'Home Icon', |
252 | 252 | 'LBL_TOUR_HOME_DESCRIPTION' => 'Quickly get back to your Home Page dashboard in one click.', |
253 | 253 | 'LBL_TOUR_MODULES' => 'Modules', |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * Contributor(s): ______________________________________.. |
45 | 45 | ********************************************************************************/ |
46 | 46 | |
47 | -$mod_strings = array( |
|
47 | +$mod_strings = array( |
|
48 | 48 | 'LBL_MODULE_NAME' => 'Home', |
49 | 49 | 'LBL_MODULES_TO_SEARCH' => 'Modules to Search', |
50 | 50 | 'LBL_NEW_FORM_TITLE' => 'New Contact', |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | 'LBL_HOME_PAGE_1_NAME' => 'My SuiteCRM', |
152 | 152 | 'LBL_HOME_PAGE_2_NAME' => 'Sales', |
153 | 153 | 'LBL_HOME_PAGE_3_NAME' => 'Support', |
154 | - 'LBL_HOME_PAGE_6_NAME' => 'Marketing',//bug 16510, separate the support and marketing page from each other |
|
154 | + 'LBL_HOME_PAGE_6_NAME' => 'Marketing', //bug 16510, separate the support and marketing page from each other |
|
155 | 155 | 'LBL_HOME_PAGE_4_NAME' => 'Tracker', |
156 | 156 | 'LBL_CLOSE_SITEMAP' => 'Close', |
157 | 157 |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -58,10 +58,10 @@ discard block |
||
58 | 58 | /*search form class name*/ |
59 | 59 | var $searchFormClass = 'SearchForm'; |
60 | 60 | |
61 | - function __construct(){ |
|
62 | - if(!empty($_REQUEST['query_string'])){ |
|
61 | + function __construct() { |
|
62 | + if (!empty($_REQUEST['query_string'])) { |
|
63 | 63 | $query_string = trim($_REQUEST['query_string']); |
64 | - if(!empty($query_string)){ |
|
64 | + if (!empty($query_string)) { |
|
65 | 65 | $this->query_string = $query_string; |
66 | 66 | } |
67 | 67 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | function getDropDownDiv($tpl = 'modules/Home/UnifiedSearchAdvanced.tpl') { |
73 | 73 | global $app_list_strings, $app_strings; |
74 | 74 | |
75 | - if(!file_exists($this->cache_search)) |
|
75 | + if (!file_exists($this->cache_search)) |
|
76 | 76 | { |
77 | 77 | $this->buildCache(); |
78 | 78 | } |
@@ -83,10 +83,10 @@ discard block |
||
83 | 83 | $users_modules = $current_user->getPreference('globalSearch', 'search'); |
84 | 84 | |
85 | 85 | // preferences are empty, select all |
86 | - if(empty($users_modules)) { |
|
86 | + if (empty($users_modules)) { |
|
87 | 87 | $users_modules = array(); |
88 | - foreach($unified_search_modules_display as $module=>$data) { |
|
89 | - if (!empty($data['visible']) ) { |
|
88 | + foreach ($unified_search_modules_display as $module=>$data) { |
|
89 | + if (!empty($data['visible'])) { |
|
90 | 90 | $users_modules[$module] = $beanList[$module]; |
91 | 91 | } |
92 | 92 | } |
@@ -97,15 +97,15 @@ discard block |
||
97 | 97 | |
98 | 98 | $modules_to_search = array(); |
99 | 99 | |
100 | - foreach($users_modules as $key=>$module) |
|
100 | + foreach ($users_modules as $key=>$module) |
|
101 | 101 | { |
102 | - if(ACLController::checkAccess($key, 'list', true)) |
|
102 | + if (ACLController::checkAccess($key, 'list', true)) |
|
103 | 103 | { |
104 | 104 | $modules_to_search[$key]['checked'] = true; |
105 | 105 | } |
106 | 106 | } |
107 | 107 | |
108 | - if(!empty($this->query_string)) |
|
108 | + if (!empty($this->query_string)) |
|
109 | 109 | { |
110 | 110 | $sugar_smarty->assign('query_string', securexss($this->query_string)); |
111 | 111 | } else { |
@@ -121,9 +121,9 @@ discard block |
||
121 | 121 | $json_disabled = array(); |
122 | 122 | |
123 | 123 | //Now add the rest of the modules that are searchable via Global Search settings |
124 | - foreach($unified_search_modules_display as $module=>$data) |
|
124 | + foreach ($unified_search_modules_display as $module=>$data) |
|
125 | 125 | { |
126 | - if(!isset($modules_to_search[$module]) && $data['visible'] && ACLController::checkAccess($module, 'list', true)) |
|
126 | + if (!isset($modules_to_search[$module]) && $data['visible'] && ACLController::checkAccess($module, 'list', true)) |
|
127 | 127 | { |
128 | 128 | $modules_to_search[$module]['checked'] = false; |
129 | 129 | } else if (isset($modules_to_search[$module]) && !$data['visible']) { |
@@ -132,10 +132,10 @@ discard block |
||
132 | 132 | } |
133 | 133 | |
134 | 134 | //Create the two lists (doing it this way preserves the user's ordering choice for enabled modules) |
135 | - foreach($modules_to_search as $module=>$data) |
|
135 | + foreach ($modules_to_search as $module=>$data) |
|
136 | 136 | { |
137 | 137 | $label = isset($app_list_strings['moduleList'][$module]) ? $app_list_strings['moduleList'][$module] : $module; |
138 | - if(!empty($data['checked'])) |
|
138 | + if (!empty($data['checked'])) |
|
139 | 139 | { |
140 | 140 | $json_enabled[] = array("module" => $module, 'label' => $label); |
141 | 141 | } else { |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | $sugar_smarty->assign('disabled_modules', json_encode($json_disabled)); |
148 | 148 | |
149 | 149 | $showDiv = $current_user->getPreference('showGSDiv', 'search'); |
150 | - if(!isset($showDiv)) |
|
150 | + if (!isset($showDiv)) |
|
151 | 151 | { |
152 | 152 | $showDiv = 'no'; |
153 | 153 | } |
@@ -181,11 +181,11 @@ discard block |
||
181 | 181 | |
182 | 182 | $this->query_string = $GLOBALS['db']->quote(securexss(from_html(clean_string($this->query_string, 'UNIFIED_SEARCH')))); |
183 | 183 | |
184 | - if(!empty($_REQUEST['advanced']) && $_REQUEST['advanced'] != 'false') { |
|
184 | + if (!empty($_REQUEST['advanced']) && $_REQUEST['advanced'] != 'false') { |
|
185 | 185 | $modules_to_search = array(); |
186 | - if(!empty($_REQUEST['search_modules'])) |
|
186 | + if (!empty($_REQUEST['search_modules'])) |
|
187 | 187 | { |
188 | - foreach(explode (',', $_REQUEST['search_modules'] ) as $key) |
|
188 | + foreach (explode(',', $_REQUEST['search_modules']) as $key) |
|
189 | 189 | { |
190 | 190 | if (isset($unified_search_modules_display[$key]) && !empty($unified_search_modules_display[$key]['visible'])) |
191 | 191 | { |
@@ -200,16 +200,16 @@ discard block |
||
200 | 200 | $users_modules = $current_user->getPreference('globalSearch', 'search'); |
201 | 201 | $modules_to_search = array(); |
202 | 202 | |
203 | - if(!empty($users_modules)) { |
|
203 | + if (!empty($users_modules)) { |
|
204 | 204 | // use user's previous selections |
205 | - foreach ( $users_modules as $key => $value ) { |
|
205 | + foreach ($users_modules as $key => $value) { |
|
206 | 206 | if (isset($unified_search_modules_display[$key]) && !empty($unified_search_modules_display[$key]['visible'])) { |
207 | 207 | $modules_to_search[$key] = $beanList[$key]; |
208 | 208 | } |
209 | 209 | } |
210 | 210 | } else { |
211 | - foreach($unified_search_modules_display as $module=>$data) { |
|
212 | - if (!empty($data['visible']) ) { |
|
211 | + foreach ($unified_search_modules_display as $module=>$data) { |
|
212 | + if (!empty($data['visible'])) { |
|
213 | 213 | $modules_to_search[$module] = $beanList[$module]; |
214 | 214 | } |
215 | 215 | } |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | |
220 | 220 | |
221 | 221 | $templateFile = 'modules/Home/UnifiedSearchAdvancedForm.tpl'; |
222 | - if(file_exists('custom/' . $templateFile)) |
|
222 | + if (file_exists('custom/'.$templateFile)) |
|
223 | 223 | { |
224 | 224 | $templateFile = 'custom/'.$templateFile; |
225 | 225 | } |
@@ -230,9 +230,9 @@ discard block |
||
230 | 230 | $module_counts = array(); |
231 | 231 | $has_results = false; |
232 | 232 | |
233 | - if(!empty($this->query_string)) { |
|
234 | - foreach($modules_to_search as $moduleName => $beanName) { |
|
235 | - require_once $beanFiles[$beanName] ; |
|
233 | + if (!empty($this->query_string)) { |
|
234 | + foreach ($modules_to_search as $moduleName => $beanName) { |
|
235 | + require_once $beanFiles[$beanName]; |
|
236 | 236 | $seed = new $beanName(); |
237 | 237 | |
238 | 238 | $lv = new ListViewSmarty(); |
@@ -243,25 +243,25 @@ discard block |
||
243 | 243 | require('modules/'.$seed->module_dir.'/metadata/listviewdefs.php'); |
244 | 244 | $orig_listViewDefs = $listViewDefs; |
245 | 245 | |
246 | - if(file_exists('custom/modules/'.$seed->module_dir.'/metadata/listviewdefs.php')) |
|
246 | + if (file_exists('custom/modules/'.$seed->module_dir.'/metadata/listviewdefs.php')) |
|
247 | 247 | { |
248 | 248 | require('custom/modules/'.$seed->module_dir.'/metadata/listviewdefs.php'); |
249 | 249 | } |
250 | 250 | |
251 | - if ( !isset($listViewDefs) || !isset($listViewDefs[$seed->module_dir]) ) |
|
251 | + if (!isset($listViewDefs) || !isset($listViewDefs[$seed->module_dir])) |
|
252 | 252 | { |
253 | 253 | continue; |
254 | 254 | } |
255 | 255 | |
256 | - $unifiedSearchFields = array () ; |
|
256 | + $unifiedSearchFields = array(); |
|
257 | 257 | $innerJoins = array(); |
258 | - foreach ( $unified_search_modules[ $moduleName ]['fields'] as $field=>$def ) |
|
258 | + foreach ($unified_search_modules[$moduleName]['fields'] as $field=>$def) |
|
259 | 259 | { |
260 | 260 | $listViewCheckField = strtoupper($field); |
261 | 261 | //check to see if the field is in listview defs |
262 | - if ( empty($listViewDefs[$seed->module_dir][$listViewCheckField]['default']) ) { |
|
262 | + if (empty($listViewDefs[$seed->module_dir][$listViewCheckField]['default'])) { |
|
263 | 263 | //check to see if field is in original list view defs (in case we are using custom layout defs) |
264 | - if (!empty($orig_listViewDefs[$seed->module_dir][$listViewCheckField]['default']) ) { |
|
264 | + if (!empty($orig_listViewDefs[$seed->module_dir][$listViewCheckField]['default'])) { |
|
265 | 265 | //if we are here then the layout has been customized, but the field is still needed for query creation |
266 | 266 | $listViewDefs[$seed->module_dir][$listViewCheckField] = $orig_listViewDefs[$seed->module_dir][$listViewCheckField]; |
267 | 267 | } |
@@ -270,9 +270,9 @@ discard block |
||
270 | 270 | |
271 | 271 | //bug: 34125 we might want to try to use the LEFT JOIN operator instead of the INNER JOIN in the case we are |
272 | 272 | //joining against a field that has not been populated. |
273 | - if(!empty($def['innerjoin']) ) |
|
273 | + if (!empty($def['innerjoin'])) |
|
274 | 274 | { |
275 | - if (empty($def['db_field']) ) |
|
275 | + if (empty($def['db_field'])) |
|
276 | 276 | { |
277 | 277 | continue; |
278 | 278 | } |
@@ -280,37 +280,37 @@ discard block |
||
280 | 280 | $def['innerjoin'] = str_replace('INNER', 'LEFT', $def['innerjoin']); |
281 | 281 | } |
282 | 282 | |
283 | - if(isset($seed->field_defs[$field]['type'])) |
|
283 | + if (isset($seed->field_defs[$field]['type'])) |
|
284 | 284 | { |
285 | 285 | $type = $seed->field_defs[$field]['type']; |
286 | - if($type == 'int' && !is_numeric($this->query_string)) |
|
286 | + if ($type == 'int' && !is_numeric($this->query_string)) |
|
287 | 287 | { |
288 | 288 | continue; |
289 | 289 | } |
290 | 290 | } |
291 | 291 | |
292 | - $unifiedSearchFields[ $moduleName ] [ $field ] = $def ; |
|
293 | - $unifiedSearchFields[ $moduleName ] [ $field ][ 'value' ] = $this->query_string ; |
|
292 | + $unifiedSearchFields[$moduleName] [$field] = $def; |
|
293 | + $unifiedSearchFields[$moduleName] [$field]['value'] = $this->query_string; |
|
294 | 294 | } |
295 | 295 | |
296 | 296 | /* |
297 | 297 | * Use searchForm2->generateSearchWhere() to create the search query, as it can generate SQL for the full set of comparisons required |
298 | 298 | * generateSearchWhere() expects to find the search conditions for a field in the 'value' parameter of the searchFields entry for that field |
299 | 299 | */ |
300 | - require_once $beanFiles[$beanName] ; |
|
300 | + require_once $beanFiles[$beanName]; |
|
301 | 301 | $seed = new $beanName(); |
302 | 302 | |
303 | 303 | require_once $this->searchFormPath; |
304 | - $searchForm = new $this->searchFormClass ( $seed, $moduleName ) ; |
|
304 | + $searchForm = new $this->searchFormClass($seed, $moduleName); |
|
305 | 305 | |
306 | - $searchForm->setup (array ( $moduleName => array() ) , $unifiedSearchFields , '' , 'saved_views' /* hack to avoid setup doing further unwanted processing */ ) ; |
|
307 | - $where_clauses = $searchForm->generateSearchWhere() ; |
|
306 | + $searchForm->setup(array($moduleName => array()), $unifiedSearchFields, '', 'saved_views' /* hack to avoid setup doing further unwanted processing */); |
|
307 | + $where_clauses = $searchForm->generateSearchWhere(); |
|
308 | 308 | //add inner joins back into the where clause |
309 | 309 | $params = array('custom_select' => ""); |
310 | - foreach($innerJoins as $field=>$def) { |
|
310 | + foreach ($innerJoins as $field=>$def) { |
|
311 | 311 | if (isset ($def['db_field'])) { |
312 | - foreach($def['db_field'] as $dbfield) |
|
313 | - $where_clauses[] = $dbfield . " LIKE '" . $this->query_string . "%'"; |
|
312 | + foreach ($def['db_field'] as $dbfield) |
|
313 | + $where_clauses[] = $dbfield." LIKE '".$this->query_string."%'"; |
|
314 | 314 | $params['custom_select'] .= ", $dbfield"; |
315 | 315 | $params['distinct'] = true; |
316 | 316 | //$filterFields[$dbfield] = $dbfield; |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | |
320 | 320 | if (count($where_clauses) > 0) |
321 | 321 | { |
322 | - $where = '(('. implode(' ) OR ( ', $where_clauses) . '))'; |
|
322 | + $where = '(('.implode(' ) OR ( ', $where_clauses).'))'; |
|
323 | 323 | } |
324 | 324 | else |
325 | 325 | { |
@@ -328,16 +328,16 @@ discard block |
||
328 | 328 | $where = ''; |
329 | 329 | } |
330 | 330 | $displayColumns = array(); |
331 | - foreach($listViewDefs[$seed->module_dir] as $colName => $param) |
|
331 | + foreach ($listViewDefs[$seed->module_dir] as $colName => $param) |
|
332 | 332 | { |
333 | - if(!empty($param['default']) && $param['default'] == true) |
|
333 | + if (!empty($param['default']) && $param['default'] == true) |
|
334 | 334 | { |
335 | - $param['url_sort'] = true;//bug 27933 |
|
335 | + $param['url_sort'] = true; //bug 27933 |
|
336 | 336 | $displayColumns[$colName] = $param; |
337 | 337 | } |
338 | 338 | } |
339 | 339 | |
340 | - if(count($displayColumns) > 0) |
|
340 | + if (count($displayColumns) > 0) |
|
341 | 341 | { |
342 | 342 | $lv->displayColumns = $displayColumns; |
343 | 343 | } else { |
@@ -354,12 +354,12 @@ discard block |
||
354 | 354 | |
355 | 355 | $lv->setup($seed, 'include/ListView/ListViewNoMassUpdate.tpl', $where, $params, 0, 10); |
356 | 356 | |
357 | - $module_results[$moduleName] = '<br /><br />' . get_form_header($GLOBALS['app_list_strings']['moduleList'][$seed->module_dir] . ' (' . $lv->data['pageData']['offsets']['total'] . ')', '', false); |
|
357 | + $module_results[$moduleName] = '<br /><br />'.get_form_header($GLOBALS['app_list_strings']['moduleList'][$seed->module_dir].' ('.$lv->data['pageData']['offsets']['total'].')', '', false); |
|
358 | 358 | $module_counts[$moduleName] = $lv->data['pageData']['offsets']['total']; |
359 | 359 | |
360 | - if($lv->data['pageData']['offsets']['total'] == 0) { |
|
360 | + if ($lv->data['pageData']['offsets']['total'] == 0) { |
|
361 | 361 | //$module_results[$moduleName] .= "<li class='noBullet' id='whole_subpanel_{$moduleName}'><div id='div_{$moduleName}'><h2>" . $home_mod_strings['LBL_NO_RESULTS_IN_MODULE'] . '</h2></div></li>'; |
362 | - $module_results[$moduleName] .= '<h2>' . $home_mod_strings['LBL_NO_RESULTS_IN_MODULE'] . '</h2>'; |
|
362 | + $module_results[$moduleName] .= '<h2>'.$home_mod_strings['LBL_NO_RESULTS_IN_MODULE'].'</h2>'; |
|
363 | 363 | } else { |
364 | 364 | $has_results = true; |
365 | 365 | //$module_results[$moduleName] .= "<li class='noBullet' id='whole_subpanel_{$moduleName}'><div id='div_{$moduleName}'>" . $lv->display(false, false) . '</div></li>'; |
@@ -369,11 +369,11 @@ discard block |
||
369 | 369 | } |
370 | 370 | } |
371 | 371 | |
372 | - if($has_results) { |
|
373 | - foreach($module_counts as $name=>$value) { |
|
372 | + if ($has_results) { |
|
373 | + foreach ($module_counts as $name=>$value) { |
|
374 | 374 | echo $module_results[$name]; |
375 | 375 | } |
376 | - } else if(empty($_REQUEST['form_only'])) { |
|
376 | + } else if (empty($_REQUEST['form_only'])) { |
|
377 | 377 | echo $home_mod_strings['LBL_NO_RESULTS']; |
378 | 378 | echo $home_mod_strings['LBL_NO_RESULTS_TIPS']; |
379 | 379 | } |
@@ -387,68 +387,68 @@ discard block |
||
387 | 387 | |
388 | 388 | $supported_modules = array(); |
389 | 389 | |
390 | - foreach($beanList as $moduleName=>$beanName) |
|
390 | + foreach ($beanList as $moduleName=>$beanName) |
|
391 | 391 | { |
392 | 392 | if (!isset($beanFiles[$beanName])) |
393 | 393 | continue; |
394 | 394 | |
395 | 395 | $beanName = BeanFactory::getObjectName($moduleName); |
396 | - $manager = new VardefManager ( ); |
|
397 | - $manager->loadVardef( $moduleName , $beanName ) ; |
|
396 | + $manager = new VardefManager( ); |
|
397 | + $manager->loadVardef($moduleName, $beanName); |
|
398 | 398 | |
399 | 399 | // obtain the field definitions used by generateSearchWhere (duplicate code in view.list.php) |
400 | - if(file_exists('custom/modules/'.$moduleName.'/metadata/metafiles.php')){ |
|
400 | + if (file_exists('custom/modules/'.$moduleName.'/metadata/metafiles.php')) { |
|
401 | 401 | require('custom/modules/'.$moduleName.'/metadata/metafiles.php'); |
402 | - }elseif(file_exists('modules/'.$moduleName.'/metadata/metafiles.php')){ |
|
402 | + }elseif (file_exists('modules/'.$moduleName.'/metadata/metafiles.php')) { |
|
403 | 403 | require('modules/'.$moduleName.'/metadata/metafiles.php'); |
404 | 404 | } |
405 | 405 | |
406 | 406 | |
407 | - if(!empty($metafiles[$moduleName]['searchfields'])) |
|
407 | + if (!empty($metafiles[$moduleName]['searchfields'])) |
|
408 | 408 | { |
409 | - require $metafiles[$moduleName]['searchfields'] ; |
|
410 | - } else if(file_exists("modules/{$moduleName}/metadata/SearchFields.php")) { |
|
411 | - require "modules/{$moduleName}/metadata/SearchFields.php" ; |
|
409 | + require $metafiles[$moduleName]['searchfields']; |
|
410 | + } else if (file_exists("modules/{$moduleName}/metadata/SearchFields.php")) { |
|
411 | + require "modules/{$moduleName}/metadata/SearchFields.php"; |
|
412 | 412 | } |
413 | 413 | |
414 | 414 | //Load custom SearchFields.php if it exists |
415 | - if(file_exists("custom/modules/{$moduleName}/metadata/SearchFields.php")) |
|
415 | + if (file_exists("custom/modules/{$moduleName}/metadata/SearchFields.php")) |
|
416 | 416 | { |
417 | - require "custom/modules/{$moduleName}/metadata/SearchFields.php" ; |
|
417 | + require "custom/modules/{$moduleName}/metadata/SearchFields.php"; |
|
418 | 418 | } |
419 | 419 | |
420 | 420 | //If there are $searchFields are empty, just continue, there are no search fields defined for the module |
421 | - if(empty($searchFields[$moduleName])) |
|
421 | + if (empty($searchFields[$moduleName])) |
|
422 | 422 | { |
423 | 423 | continue; |
424 | 424 | } |
425 | 425 | |
426 | - $isCustomModule = preg_match('/^([a-z0-9]{1,5})_([a-z0-9_]+)$/i' , $moduleName); |
|
426 | + $isCustomModule = preg_match('/^([a-z0-9]{1,5})_([a-z0-9_]+)$/i', $moduleName); |
|
427 | 427 | |
428 | 428 | //If the bean supports unified search or if it's a custom module bean and unified search is not defined |
429 | - if(!empty($dictionary[$beanName]['unified_search']) || $isCustomModule) |
|
429 | + if (!empty($dictionary[$beanName]['unified_search']) || $isCustomModule) |
|
430 | 430 | { |
431 | 431 | $fields = array(); |
432 | - foreach ( $dictionary [ $beanName ][ 'fields' ] as $field => $def ) |
|
432 | + foreach ($dictionary [$beanName]['fields'] as $field => $def) |
|
433 | 433 | { |
434 | 434 | // We cannot enable or disable unified_search for email in the vardefs as we don't actually have a vardef entry for 'email' |
435 | 435 | // the searchFields entry for 'email' doesn't correspond to any vardef entry. Instead it contains SQL to directly perform the search. |
436 | 436 | // So as a proxy we allow any field in the vardefs that has a name starting with 'email...' to be tagged with the 'unified_search' parameter |
437 | 437 | |
438 | - if (strpos($field,'email') !== false) |
|
438 | + if (strpos($field, 'email') !== false) |
|
439 | 439 | { |
440 | - $field = 'email' ; |
|
440 | + $field = 'email'; |
|
441 | 441 | } |
442 | 442 | |
443 | 443 | //bug: 38139 - allow phone to be searched through Global Search |
444 | - if (strpos($field,'phone') !== false) |
|
444 | + if (strpos($field, 'phone') !== false) |
|
445 | 445 | { |
446 | - $field = 'phone' ; |
|
446 | + $field = 'phone'; |
|
447 | 447 | } |
448 | 448 | |
449 | - if ( !empty($def['unified_search']) && isset ( $searchFields [ $moduleName ] [ $field ] )) |
|
449 | + if (!empty($def['unified_search']) && isset ($searchFields [$moduleName] [$field])) |
|
450 | 450 | { |
451 | - $fields [ $field ] = $searchFields [ $moduleName ] [ $field ] ; |
|
451 | + $fields [$field] = $searchFields [$moduleName] [$field]; |
|
452 | 452 | } |
453 | 453 | } |
454 | 454 | |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | } |
464 | 464 | } |
465 | 465 | |
466 | - if(count($fields) > 0) { |
|
466 | + if (count($fields) > 0) { |
|
467 | 467 | $supported_modules [$moduleName] ['fields'] = $fields; |
468 | 468 | if (isset($dictionary[$beanName]['unified_search_default_enabled']) && $dictionary[$beanName]['unified_search_default_enabled'] === TRUE) |
469 | 469 | { |
@@ -494,10 +494,10 @@ discard block |
||
494 | 494 | //Add the translated attribute for display label |
495 | 495 | $json_enabled = array(); |
496 | 496 | $json_disabled = array(); |
497 | - foreach($unified_search_modules_display as $module=>$data) |
|
497 | + foreach ($unified_search_modules_display as $module=>$data) |
|
498 | 498 | { |
499 | 499 | $label = isset($app_list_strings['moduleList'][$module]) ? $app_list_strings['moduleList'][$module] : $module; |
500 | - if($data['visible'] === true) |
|
500 | + if ($data['visible'] === true) |
|
501 | 501 | { |
502 | 502 | $json_enabled[] = array("module" => $module, 'label' => $label); |
503 | 503 | } |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | } |
509 | 509 | |
510 | 510 | //If the file doesn't exist |
511 | - if(!file_exists($this->cache_search)) |
|
511 | + if (!file_exists($this->cache_search)) |
|
512 | 512 | { |
513 | 513 | $this->buildCache(); |
514 | 514 | } |
@@ -516,12 +516,12 @@ discard block |
||
516 | 516 | include($this->cache_search); |
517 | 517 | |
518 | 518 | //Now add any new modules that may have since been added to unified_search_modules.php |
519 | - foreach($unified_search_modules as $module=>$data) |
|
519 | + foreach ($unified_search_modules as $module=>$data) |
|
520 | 520 | { |
521 | - if(!isset($unified_search_modules_display[$module])) |
|
521 | + if (!isset($unified_search_modules_display[$module])) |
|
522 | 522 | { |
523 | 523 | $label = isset($app_list_strings['moduleList'][$module]) ? $app_list_strings['moduleList'][$module] : $module; |
524 | - if($data['default']) |
|
524 | + if ($data['default']) |
|
525 | 525 | { |
526 | 526 | $json_enabled[] = array("module" => $module, 'label' => $label); |
527 | 527 | } else { |
@@ -542,20 +542,20 @@ discard block |
||
542 | 542 | */ |
543 | 543 | function saveGlobalSearchSettings() |
544 | 544 | { |
545 | - if(isset($_REQUEST['enabled_modules'])) |
|
545 | + if (isset($_REQUEST['enabled_modules'])) |
|
546 | 546 | { |
547 | 547 | $unified_search_modules_display = $this->getUnifiedSearchModulesDisplay(); |
548 | 548 | |
549 | 549 | $new_unified_search_modules_display = array(); |
550 | 550 | |
551 | - foreach(explode (',', $_REQUEST['enabled_modules'] ) as $module) |
|
551 | + foreach (explode(',', $_REQUEST['enabled_modules']) as $module) |
|
552 | 552 | { |
553 | 553 | $new_unified_search_modules_display[$module]['visible'] = true; |
554 | 554 | } |
555 | 555 | |
556 | - foreach($unified_search_modules_display as $module=>$data) |
|
556 | + foreach ($unified_search_modules_display as $module=>$data) |
|
557 | 557 | { |
558 | - if(!isset($new_unified_search_modules_display[$module])) |
|
558 | + if (!isset($new_unified_search_modules_display[$module])) |
|
559 | 559 | { |
560 | 560 | $new_unified_search_modules_display[$module]['visible'] = false; |
561 | 561 | } |
@@ -569,7 +569,7 @@ discard block |
||
569 | 569 | public static function unlinkUnifiedSearchModulesFile() { |
570 | 570 | //clear the unified_search_module.php file |
571 | 571 | $cache_search = sugar_cached('modules/unified_search_modules.php'); |
572 | - if(file_exists($cache_search)) |
|
572 | + if (file_exists($cache_search)) |
|
573 | 573 | { |
574 | 574 | $GLOBALS['log']->info("unlink {$cache_search}"); |
575 | 575 | unlink($cache_search); |
@@ -589,14 +589,14 @@ discard block |
||
589 | 589 | { |
590 | 590 | //Make directory if it doesn't exist |
591 | 591 | $cachedir = sugar_cached('modules'); |
592 | - if(!file_exists($cachedir)) |
|
592 | + if (!file_exists($cachedir)) |
|
593 | 593 | { |
594 | 594 | mkdir_recursive($cachedir); |
595 | 595 | } |
596 | 596 | |
597 | 597 | //Load unified_search_modules.php file |
598 | 598 | $cachedFile = sugar_cached('modules/unified_search_modules.php'); |
599 | - if(!file_exists($cachedFile)) |
|
599 | + if (!file_exists($cachedFile)) |
|
600 | 600 | { |
601 | 601 | $this->buildCache(); |
602 | 602 | } |
@@ -616,15 +616,15 @@ discard block |
||
616 | 616 | */ |
617 | 617 | public function getUnifiedSearchModulesDisplay() |
618 | 618 | { |
619 | - if(!file_exists('custom/modules/unified_search_modules_display.php')) |
|
619 | + if (!file_exists('custom/modules/unified_search_modules_display.php')) |
|
620 | 620 | { |
621 | 621 | $unified_search_modules = $this->getUnifiedSearchModules(); |
622 | 622 | |
623 | 623 | $unified_search_modules_display = array(); |
624 | 624 | |
625 | - if(!empty($unified_search_modules)) |
|
625 | + if (!empty($unified_search_modules)) |
|
626 | 626 | { |
627 | - foreach($unified_search_modules as $module=>$data) |
|
627 | + foreach ($unified_search_modules as $module=>$data) |
|
628 | 628 | { |
629 | 629 | $unified_search_modules_display[$module]['visible'] = (isset($data['default']) && $data['default']) ? true : false; |
630 | 630 | } |
@@ -647,12 +647,12 @@ discard block |
||
647 | 647 | */ |
648 | 648 | private function writeUnifiedSearchModulesDisplayFile($unified_search_modules_display) |
649 | 649 | { |
650 | - if(is_null($unified_search_modules_display) || empty($unified_search_modules_display)) |
|
650 | + if (is_null($unified_search_modules_display) || empty($unified_search_modules_display)) |
|
651 | 651 | { |
652 | 652 | return false; |
653 | 653 | } |
654 | 654 | |
655 | - if(!write_array_to_file("unified_search_modules_display", $unified_search_modules_display, 'custom/modules/unified_search_modules_display.php')) |
|
655 | + if (!write_array_to_file("unified_search_modules_display", $unified_search_modules_display, 'custom/modules/unified_search_modules_display.php')) |
|
656 | 656 | { |
657 | 657 | //Log error message and throw Exception |
658 | 658 | global $app_strings; |
@@ -667,7 +667,7 @@ discard block |
||
667 | 667 | |
668 | 668 | |
669 | 669 | function unified_search_modules_cmp($a, $b) { |
670 | - if(!isset($a['translated']) || !isset($b['translated'])) |
|
670 | + if (!isset($a['translated']) || !isset($b['translated'])) |
|
671 | 671 | { |
672 | 672 | return 0; |
673 | 673 | } |
@@ -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. |
@@ -309,8 +311,9 @@ discard block |
||
309 | 311 | $params = array('custom_select' => ""); |
310 | 312 | foreach($innerJoins as $field=>$def) { |
311 | 313 | if (isset ($def['db_field'])) { |
312 | - foreach($def['db_field'] as $dbfield) |
|
313 | - $where_clauses[] = $dbfield . " LIKE '" . $this->query_string . "%'"; |
|
314 | + foreach($def['db_field'] as $dbfield) { |
|
315 | + $where_clauses[] = $dbfield . " LIKE '" . $this->query_string . "%'"; |
|
316 | + } |
|
314 | 317 | $params['custom_select'] .= ", $dbfield"; |
315 | 318 | $params['distinct'] = true; |
316 | 319 | //$filterFields[$dbfield] = $dbfield; |
@@ -320,8 +323,7 @@ discard block |
||
320 | 323 | if (count($where_clauses) > 0) |
321 | 324 | { |
322 | 325 | $where = '(('. implode(' ) OR ( ', $where_clauses) . '))'; |
323 | - } |
|
324 | - else |
|
326 | + } else |
|
325 | 327 | { |
326 | 328 | /* Clear $where from prev. module |
327 | 329 | if in current module $where_clauses */ |
@@ -389,8 +391,9 @@ discard block |
||
389 | 391 | |
390 | 392 | foreach($beanList as $moduleName=>$beanName) |
391 | 393 | { |
392 | - if (!isset($beanFiles[$beanName])) |
|
393 | - continue; |
|
394 | + if (!isset($beanFiles[$beanName])) { |
|
395 | + continue; |
|
396 | + } |
|
394 | 397 | |
395 | 398 | $beanName = BeanFactory::getObjectName($moduleName); |
396 | 399 | $manager = new VardefManager ( ); |
@@ -399,7 +402,7 @@ discard block |
||
399 | 402 | // obtain the field definitions used by generateSearchWhere (duplicate code in view.list.php) |
400 | 403 | if(file_exists('custom/modules/'.$moduleName.'/metadata/metafiles.php')){ |
401 | 404 | require('custom/modules/'.$moduleName.'/metadata/metafiles.php'); |
402 | - }elseif(file_exists('modules/'.$moduleName.'/metadata/metafiles.php')){ |
|
405 | + } elseif(file_exists('modules/'.$moduleName.'/metadata/metafiles.php')){ |
|
403 | 406 | require('modules/'.$moduleName.'/metadata/metafiles.php'); |
404 | 407 | } |
405 | 408 | |
@@ -500,8 +503,7 @@ discard block |
||
500 | 503 | if($data['visible'] === true) |
501 | 504 | { |
502 | 505 | $json_enabled[] = array("module" => $module, 'label' => $label); |
503 | - } |
|
504 | - else |
|
506 | + } else |
|
505 | 507 | { |
506 | 508 | $json_disabled[] = array("module" => $module, 'label' => $label); |
507 | 509 | } |
@@ -69,95 +69,95 @@ discard block |
||
69 | 69 | $this->cache_display = sugar_cached('modules/unified_search_modules_display.php'); |
70 | 70 | } |
71 | 71 | |
72 | - function getDropDownDiv($tpl = 'modules/Home/UnifiedSearchAdvanced.tpl') { |
|
73 | - global $app_list_strings, $app_strings; |
|
72 | + function getDropDownDiv($tpl = 'modules/Home/UnifiedSearchAdvanced.tpl') { |
|
73 | + global $app_list_strings, $app_strings; |
|
74 | 74 | |
75 | - if(!file_exists($this->cache_search)) |
|
76 | - { |
|
77 | - $this->buildCache(); |
|
78 | - } |
|
75 | + if(!file_exists($this->cache_search)) |
|
76 | + { |
|
77 | + $this->buildCache(); |
|
78 | + } |
|
79 | 79 | |
80 | - $unified_search_modules_display = $this->getUnifiedSearchModulesDisplay(); |
|
80 | + $unified_search_modules_display = $this->getUnifiedSearchModulesDisplay(); |
|
81 | 81 | |
82 | - global $mod_strings, $modListHeader, $app_list_strings, $current_user, $app_strings, $beanList; |
|
83 | - $users_modules = $current_user->getPreference('globalSearch', 'search'); |
|
82 | + global $mod_strings, $modListHeader, $app_list_strings, $current_user, $app_strings, $beanList; |
|
83 | + $users_modules = $current_user->getPreference('globalSearch', 'search'); |
|
84 | 84 | |
85 | - // preferences are empty, select all |
|
86 | - if(empty($users_modules)) { |
|
87 | - $users_modules = array(); |
|
88 | - foreach($unified_search_modules_display as $module=>$data) { |
|
89 | - if (!empty($data['visible']) ) { |
|
85 | + // preferences are empty, select all |
|
86 | + if(empty($users_modules)) { |
|
87 | + $users_modules = array(); |
|
88 | + foreach($unified_search_modules_display as $module=>$data) { |
|
89 | + if (!empty($data['visible']) ) { |
|
90 | 90 | $users_modules[$module] = $beanList[$module]; |
91 | 91 | } |
92 | - } |
|
93 | - $current_user->setPreference('globalSearch', $users_modules, 0, 'search'); |
|
94 | - } |
|
92 | + } |
|
93 | + $current_user->setPreference('globalSearch', $users_modules, 0, 'search'); |
|
94 | + } |
|
95 | 95 | |
96 | - $sugar_smarty = new Sugar_Smarty(); |
|
96 | + $sugar_smarty = new Sugar_Smarty(); |
|
97 | 97 | |
98 | - $modules_to_search = array(); |
|
98 | + $modules_to_search = array(); |
|
99 | 99 | |
100 | - foreach($users_modules as $key=>$module) |
|
101 | - { |
|
100 | + foreach($users_modules as $key=>$module) |
|
101 | + { |
|
102 | 102 | if(ACLController::checkAccess($key, 'list', true)) |
103 | 103 | { |
104 | 104 | $modules_to_search[$key]['checked'] = true; |
105 | 105 | } |
106 | - } |
|
107 | - |
|
108 | - if(!empty($this->query_string)) |
|
109 | - { |
|
110 | - $sugar_smarty->assign('query_string', securexss($this->query_string)); |
|
111 | - } else { |
|
112 | - $sugar_smarty->assign('query_string', ''); |
|
113 | - } |
|
114 | - |
|
115 | - $sugar_smarty->assign('MOD', return_module_language($GLOBALS['current_language'], 'Administration')); |
|
116 | - $sugar_smarty->assign('APP', $app_strings); |
|
117 | - $sugar_smarty->assign('USE_SEARCH_GIF', 0); |
|
118 | - $sugar_smarty->assign('LBL_SEARCH_BUTTON_LABEL', $app_strings['LBL_SEARCH_BUTTON_LABEL']); |
|
119 | - $sugar_smarty->assign('LBL_SEARCH_BUTTON_TITLE', $app_strings['LBL_SEARCH_BUTTON_TITLE']); |
|
120 | - $sugar_smarty->assign('LBL_SEARCH', $app_strings['LBL_SEARCH']); |
|
121 | - |
|
122 | - $json_enabled = array(); |
|
123 | - $json_disabled = array(); |
|
124 | - |
|
125 | - //Now add the rest of the modules that are searchable via Global Search settings |
|
126 | - foreach($unified_search_modules_display as $module=>$data) |
|
127 | - { |
|
128 | - if(!isset($modules_to_search[$module]) && $data['visible'] && ACLController::checkAccess($module, 'list', true)) |
|
129 | - { |
|
130 | - $modules_to_search[$module]['checked'] = false; |
|
131 | - } else if (isset($modules_to_search[$module]) && !$data['visible']) { |
|
132 | - unset($modules_to_search[$module]); |
|
133 | - } |
|
134 | - } |
|
135 | - |
|
136 | - //Create the two lists (doing it this way preserves the user's ordering choice for enabled modules) |
|
137 | - foreach($modules_to_search as $module=>$data) |
|
138 | - { |
|
139 | - $label = isset($app_list_strings['moduleList'][$module]) ? $app_list_strings['moduleList'][$module] : $module; |
|
140 | - if(!empty($data['checked'])) |
|
141 | - { |
|
142 | - $json_enabled[] = array("module" => $module, 'label' => $label); |
|
143 | - } else { |
|
144 | - $json_disabled[] = array("module" => $module, 'label' => $label); |
|
145 | - } |
|
146 | - } |
|
147 | - |
|
148 | - $sugar_smarty->assign('enabled_modules', json_encode($json_enabled)); |
|
149 | - $sugar_smarty->assign('disabled_modules', json_encode($json_disabled)); |
|
150 | - |
|
151 | - $showDiv = $current_user->getPreference('showGSDiv', 'search'); |
|
152 | - if(!isset($showDiv)) |
|
153 | - { |
|
154 | - $showDiv = 'no'; |
|
155 | - } |
|
156 | - |
|
157 | - $sugar_smarty->assign('SHOWGSDIV', $showDiv); |
|
158 | - $sugar_smarty->debugging = true; |
|
159 | - return $sugar_smarty->fetch($tpl); |
|
160 | - } |
|
106 | + } |
|
107 | + |
|
108 | + if(!empty($this->query_string)) |
|
109 | + { |
|
110 | + $sugar_smarty->assign('query_string', securexss($this->query_string)); |
|
111 | + } else { |
|
112 | + $sugar_smarty->assign('query_string', ''); |
|
113 | + } |
|
114 | + |
|
115 | + $sugar_smarty->assign('MOD', return_module_language($GLOBALS['current_language'], 'Administration')); |
|
116 | + $sugar_smarty->assign('APP', $app_strings); |
|
117 | + $sugar_smarty->assign('USE_SEARCH_GIF', 0); |
|
118 | + $sugar_smarty->assign('LBL_SEARCH_BUTTON_LABEL', $app_strings['LBL_SEARCH_BUTTON_LABEL']); |
|
119 | + $sugar_smarty->assign('LBL_SEARCH_BUTTON_TITLE', $app_strings['LBL_SEARCH_BUTTON_TITLE']); |
|
120 | + $sugar_smarty->assign('LBL_SEARCH', $app_strings['LBL_SEARCH']); |
|
121 | + |
|
122 | + $json_enabled = array(); |
|
123 | + $json_disabled = array(); |
|
124 | + |
|
125 | + //Now add the rest of the modules that are searchable via Global Search settings |
|
126 | + foreach($unified_search_modules_display as $module=>$data) |
|
127 | + { |
|
128 | + if(!isset($modules_to_search[$module]) && $data['visible'] && ACLController::checkAccess($module, 'list', true)) |
|
129 | + { |
|
130 | + $modules_to_search[$module]['checked'] = false; |
|
131 | + } else if (isset($modules_to_search[$module]) && !$data['visible']) { |
|
132 | + unset($modules_to_search[$module]); |
|
133 | + } |
|
134 | + } |
|
135 | + |
|
136 | + //Create the two lists (doing it this way preserves the user's ordering choice for enabled modules) |
|
137 | + foreach($modules_to_search as $module=>$data) |
|
138 | + { |
|
139 | + $label = isset($app_list_strings['moduleList'][$module]) ? $app_list_strings['moduleList'][$module] : $module; |
|
140 | + if(!empty($data['checked'])) |
|
141 | + { |
|
142 | + $json_enabled[] = array("module" => $module, 'label' => $label); |
|
143 | + } else { |
|
144 | + $json_disabled[] = array("module" => $module, 'label' => $label); |
|
145 | + } |
|
146 | + } |
|
147 | + |
|
148 | + $sugar_smarty->assign('enabled_modules', json_encode($json_enabled)); |
|
149 | + $sugar_smarty->assign('disabled_modules', json_encode($json_disabled)); |
|
150 | + |
|
151 | + $showDiv = $current_user->getPreference('showGSDiv', 'search'); |
|
152 | + if(!isset($showDiv)) |
|
153 | + { |
|
154 | + $showDiv = 'no'; |
|
155 | + } |
|
156 | + |
|
157 | + $sugar_smarty->assign('SHOWGSDIV', $showDiv); |
|
158 | + $sugar_smarty->debugging = true; |
|
159 | + return $sugar_smarty->fetch($tpl); |
|
160 | + } |
|
161 | 161 | |
162 | 162 | |
163 | 163 | /** |
@@ -170,70 +170,70 @@ discard block |
||
170 | 170 | * |
171 | 171 | * |
172 | 172 | */ |
173 | - function search() { |
|
173 | + function search() { |
|
174 | 174 | |
175 | 175 | $unified_search_modules = $this->getUnifiedSearchModules(); |
176 | - $unified_search_modules_display = $this->getUnifiedSearchModulesDisplay(); |
|
176 | + $unified_search_modules_display = $this->getUnifiedSearchModulesDisplay(); |
|
177 | 177 | |
178 | 178 | |
179 | - require_once 'include/ListView/ListViewSmarty.php'; |
|
179 | + require_once 'include/ListView/ListViewSmarty.php'; |
|
180 | 180 | |
181 | - global $modListHeader, $beanList, $beanFiles, $current_language, $app_strings, $current_user, $mod_strings; |
|
182 | - $home_mod_strings = return_module_language($current_language, 'Home'); |
|
181 | + global $modListHeader, $beanList, $beanFiles, $current_language, $app_strings, $current_user, $mod_strings; |
|
182 | + $home_mod_strings = return_module_language($current_language, 'Home'); |
|
183 | 183 | |
184 | - $this->query_string = $GLOBALS['db']->quote(securexss(from_html(clean_string($this->query_string, 'UNIFIED_SEARCH')))); |
|
184 | + $this->query_string = $GLOBALS['db']->quote(securexss(from_html(clean_string($this->query_string, 'UNIFIED_SEARCH')))); |
|
185 | 185 | |
186 | - if(!empty($_REQUEST['advanced']) && $_REQUEST['advanced'] != 'false') { |
|
187 | - $modules_to_search = array(); |
|
188 | - if(!empty($_REQUEST['search_modules'])) |
|
189 | - { |
|
190 | - foreach(explode (',', $_REQUEST['search_modules'] ) as $key) |
|
191 | - { |
|
186 | + if(!empty($_REQUEST['advanced']) && $_REQUEST['advanced'] != 'false') { |
|
187 | + $modules_to_search = array(); |
|
188 | + if(!empty($_REQUEST['search_modules'])) |
|
189 | + { |
|
190 | + foreach(explode (',', $_REQUEST['search_modules'] ) as $key) |
|
191 | + { |
|
192 | 192 | if (isset($unified_search_modules_display[$key]) && !empty($unified_search_modules_display[$key]['visible'])) |
193 | 193 | { |
194 | 194 | $modules_to_search[$key] = $beanList[$key]; |
195 | 195 | } |
196 | - } |
|
197 | - } |
|
198 | - |
|
199 | - $current_user->setPreference('showGSDiv', isset($_REQUEST['showGSDiv']) ? $_REQUEST['showGSDiv'] : 'no', 0, 'search'); |
|
200 | - $current_user->setPreference('globalSearch', $modules_to_search, 0, 'search'); // save selections to user preference |
|
201 | - } else { |
|
202 | - $users_modules = $current_user->getPreference('globalSearch', 'search'); |
|
203 | - $modules_to_search = array(); |
|
204 | - |
|
205 | - if(!empty($users_modules)) { |
|
206 | - // use user's previous selections |
|
207 | - foreach ( $users_modules as $key => $value ) { |
|
208 | - if (isset($unified_search_modules_display[$key]) && !empty($unified_search_modules_display[$key]['visible'])) { |
|
209 | - $modules_to_search[$key] = $beanList[$key]; |
|
210 | - } |
|
211 | - } |
|
212 | - } else { |
|
213 | - foreach($unified_search_modules_display as $module=>$data) { |
|
214 | - if (!empty($data['visible']) ) { |
|
215 | - $modules_to_search[$module] = $beanList[$module]; |
|
216 | - } |
|
217 | - } |
|
218 | - } |
|
219 | - $current_user->setPreference('globalSearch', $modules_to_search, 'search'); |
|
220 | - } |
|
221 | - |
|
222 | - |
|
223 | - $templateFile = 'modules/Home/UnifiedSearchAdvancedForm.tpl'; |
|
224 | - if(file_exists('custom/' . $templateFile)) |
|
225 | - { |
|
226 | - $templateFile = 'custom/'.$templateFile; |
|
227 | - } |
|
228 | - |
|
229 | - echo $this->getDropDownDiv($templateFile); |
|
230 | - |
|
231 | - $module_results = array(); |
|
232 | - $module_counts = array(); |
|
233 | - $has_results = false; |
|
234 | - |
|
235 | - if(!empty($this->query_string)) { |
|
236 | - foreach($modules_to_search as $moduleName => $beanName) { |
|
196 | + } |
|
197 | + } |
|
198 | + |
|
199 | + $current_user->setPreference('showGSDiv', isset($_REQUEST['showGSDiv']) ? $_REQUEST['showGSDiv'] : 'no', 0, 'search'); |
|
200 | + $current_user->setPreference('globalSearch', $modules_to_search, 0, 'search'); // save selections to user preference |
|
201 | + } else { |
|
202 | + $users_modules = $current_user->getPreference('globalSearch', 'search'); |
|
203 | + $modules_to_search = array(); |
|
204 | + |
|
205 | + if(!empty($users_modules)) { |
|
206 | + // use user's previous selections |
|
207 | + foreach ( $users_modules as $key => $value ) { |
|
208 | + if (isset($unified_search_modules_display[$key]) && !empty($unified_search_modules_display[$key]['visible'])) { |
|
209 | + $modules_to_search[$key] = $beanList[$key]; |
|
210 | + } |
|
211 | + } |
|
212 | + } else { |
|
213 | + foreach($unified_search_modules_display as $module=>$data) { |
|
214 | + if (!empty($data['visible']) ) { |
|
215 | + $modules_to_search[$module] = $beanList[$module]; |
|
216 | + } |
|
217 | + } |
|
218 | + } |
|
219 | + $current_user->setPreference('globalSearch', $modules_to_search, 'search'); |
|
220 | + } |
|
221 | + |
|
222 | + |
|
223 | + $templateFile = 'modules/Home/UnifiedSearchAdvancedForm.tpl'; |
|
224 | + if(file_exists('custom/' . $templateFile)) |
|
225 | + { |
|
226 | + $templateFile = 'custom/'.$templateFile; |
|
227 | + } |
|
228 | + |
|
229 | + echo $this->getDropDownDiv($templateFile); |
|
230 | + |
|
231 | + $module_results = array(); |
|
232 | + $module_counts = array(); |
|
233 | + $has_results = false; |
|
234 | + |
|
235 | + if(!empty($this->query_string)) { |
|
236 | + foreach($modules_to_search as $moduleName => $beanName) { |
|
237 | 237 | require_once $beanFiles[$beanName] ; |
238 | 238 | $seed = new $beanName(); |
239 | 239 | |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | |
244 | 244 | //retrieve the original list view defs and store for processing in case of custom layout changes |
245 | 245 | require('modules/'.$seed->module_dir.'/metadata/listviewdefs.php'); |
246 | - $orig_listViewDefs = $listViewDefs; |
|
246 | + $orig_listViewDefs = $listViewDefs; |
|
247 | 247 | |
248 | 248 | if(file_exists('custom/modules/'.$seed->module_dir.'/metadata/listviewdefs.php')) |
249 | 249 | { |
@@ -255,20 +255,20 @@ discard block |
||
255 | 255 | continue; |
256 | 256 | } |
257 | 257 | |
258 | - $unifiedSearchFields = array () ; |
|
258 | + $unifiedSearchFields = array () ; |
|
259 | 259 | $innerJoins = array(); |
260 | 260 | foreach ( $unified_search_modules[ $moduleName ]['fields'] as $field=>$def ) |
261 | 261 | { |
262 | - $listViewCheckField = strtoupper($field); |
|
263 | - //check to see if the field is in listview defs |
|
264 | - if ( empty($listViewDefs[$seed->module_dir][$listViewCheckField]['default']) ) { |
|
265 | - //check to see if field is in original list view defs (in case we are using custom layout defs) |
|
266 | - if (!empty($orig_listViewDefs[$seed->module_dir][$listViewCheckField]['default']) ) { |
|
267 | - //if we are here then the layout has been customized, but the field is still needed for query creation |
|
268 | - $listViewDefs[$seed->module_dir][$listViewCheckField] = $orig_listViewDefs[$seed->module_dir][$listViewCheckField]; |
|
269 | - } |
|
262 | + $listViewCheckField = strtoupper($field); |
|
263 | + //check to see if the field is in listview defs |
|
264 | + if ( empty($listViewDefs[$seed->module_dir][$listViewCheckField]['default']) ) { |
|
265 | + //check to see if field is in original list view defs (in case we are using custom layout defs) |
|
266 | + if (!empty($orig_listViewDefs[$seed->module_dir][$listViewCheckField]['default']) ) { |
|
267 | + //if we are here then the layout has been customized, but the field is still needed for query creation |
|
268 | + $listViewDefs[$seed->module_dir][$listViewCheckField] = $orig_listViewDefs[$seed->module_dir][$listViewCheckField]; |
|
269 | + } |
|
270 | 270 | |
271 | - } |
|
271 | + } |
|
272 | 272 | |
273 | 273 | //bug: 34125 we might want to try to use the LEFT JOIN operator instead of the INNER JOIN in the case we are |
274 | 274 | //joining against a field that has not been populated. |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | require_once $beanFiles[$beanName] ; |
303 | 303 | $seed = new $beanName(); |
304 | 304 | |
305 | - require_once $this->searchFormPath; |
|
305 | + require_once $this->searchFormPath; |
|
306 | 306 | $searchForm = new $this->searchFormClass ( $seed, $moduleName ) ; |
307 | 307 | |
308 | 308 | $searchForm->setup (array ( $moduleName => array() ) , $unifiedSearchFields , '' , 'saved_views' /* hack to avoid setup doing further unwanted processing */ ) ; |
@@ -311,11 +311,11 @@ discard block |
||
311 | 311 | $params = array('custom_select' => ""); |
312 | 312 | foreach($innerJoins as $field=>$def) { |
313 | 313 | if (isset ($def['db_field'])) { |
314 | - foreach($def['db_field'] as $dbfield) |
|
315 | - $where_clauses[] = $dbfield . " LIKE '" . $this->query_string . "%'"; |
|
316 | - $params['custom_select'] .= ", $dbfield"; |
|
317 | - $params['distinct'] = true; |
|
318 | - //$filterFields[$dbfield] = $dbfield; |
|
314 | + foreach($def['db_field'] as $dbfield) |
|
315 | + $where_clauses[] = $dbfield . " LIKE '" . $this->query_string . "%'"; |
|
316 | + $params['custom_select'] .= ", $dbfield"; |
|
317 | + $params['distinct'] = true; |
|
318 | + //$filterFields[$dbfield] = $dbfield; |
|
319 | 319 | } |
320 | 320 | } |
321 | 321 | |
@@ -341,9 +341,9 @@ discard block |
||
341 | 341 | |
342 | 342 | if(count($displayColumns) > 0) |
343 | 343 | { |
344 | - $lv->displayColumns = $displayColumns; |
|
344 | + $lv->displayColumns = $displayColumns; |
|
345 | 345 | } else { |
346 | - $lv->displayColumns = $listViewDefs[$seed->module_dir]; |
|
346 | + $lv->displayColumns = $listViewDefs[$seed->module_dir]; |
|
347 | 347 | } |
348 | 348 | |
349 | 349 | $lv->export = false; |
@@ -368,56 +368,56 @@ discard block |
||
368 | 368 | $module_results[$moduleName] .= $lv->display(false, false); |
369 | 369 | } |
370 | 370 | |
371 | - } |
|
372 | - } |
|
371 | + } |
|
372 | + } |
|
373 | 373 | |
374 | - if($has_results) { |
|
375 | - foreach($module_counts as $name=>$value) { |
|
376 | - echo $module_results[$name]; |
|
377 | - } |
|
378 | - } else if(empty($_REQUEST['form_only'])) { |
|
379 | - echo $home_mod_strings['LBL_NO_RESULTS']; |
|
380 | - echo $home_mod_strings['LBL_NO_RESULTS_TIPS']; |
|
381 | - } |
|
374 | + if($has_results) { |
|
375 | + foreach($module_counts as $name=>$value) { |
|
376 | + echo $module_results[$name]; |
|
377 | + } |
|
378 | + } else if(empty($_REQUEST['form_only'])) { |
|
379 | + echo $home_mod_strings['LBL_NO_RESULTS']; |
|
380 | + echo $home_mod_strings['LBL_NO_RESULTS_TIPS']; |
|
381 | + } |
|
382 | 382 | |
383 | - } |
|
383 | + } |
|
384 | 384 | |
385 | - function buildCache() |
|
386 | - { |
|
385 | + function buildCache() |
|
386 | + { |
|
387 | 387 | |
388 | - global $beanList, $beanFiles, $dictionary; |
|
388 | + global $beanList, $beanFiles, $dictionary; |
|
389 | 389 | |
390 | - $supported_modules = array(); |
|
390 | + $supported_modules = array(); |
|
391 | 391 | |
392 | - foreach($beanList as $moduleName=>$beanName) |
|
393 | - { |
|
394 | - if (!isset($beanFiles[$beanName])) |
|
395 | - continue; |
|
392 | + foreach($beanList as $moduleName=>$beanName) |
|
393 | + { |
|
394 | + if (!isset($beanFiles[$beanName])) |
|
395 | + continue; |
|
396 | 396 | |
397 | - $beanName = BeanFactory::getObjectName($moduleName); |
|
398 | - $manager = new VardefManager ( ); |
|
399 | - $manager->loadVardef( $moduleName , $beanName ) ; |
|
397 | + $beanName = BeanFactory::getObjectName($moduleName); |
|
398 | + $manager = new VardefManager ( ); |
|
399 | + $manager->loadVardef( $moduleName , $beanName ) ; |
|
400 | 400 | |
401 | - // obtain the field definitions used by generateSearchWhere (duplicate code in view.list.php) |
|
402 | - if(file_exists('custom/modules/'.$moduleName.'/metadata/metafiles.php')){ |
|
401 | + // obtain the field definitions used by generateSearchWhere (duplicate code in view.list.php) |
|
402 | + if(file_exists('custom/modules/'.$moduleName.'/metadata/metafiles.php')){ |
|
403 | 403 | require('custom/modules/'.$moduleName.'/metadata/metafiles.php'); |
404 | 404 | }elseif(file_exists('modules/'.$moduleName.'/metadata/metafiles.php')){ |
405 | 405 | require('modules/'.$moduleName.'/metadata/metafiles.php'); |
406 | 406 | } |
407 | 407 | |
408 | 408 | |
409 | - if(!empty($metafiles[$moduleName]['searchfields'])) |
|
410 | - { |
|
411 | - require $metafiles[$moduleName]['searchfields'] ; |
|
412 | - } else if(file_exists("modules/{$moduleName}/metadata/SearchFields.php")) { |
|
413 | - require "modules/{$moduleName}/metadata/SearchFields.php" ; |
|
414 | - } |
|
409 | + if(!empty($metafiles[$moduleName]['searchfields'])) |
|
410 | + { |
|
411 | + require $metafiles[$moduleName]['searchfields'] ; |
|
412 | + } else if(file_exists("modules/{$moduleName}/metadata/SearchFields.php")) { |
|
413 | + require "modules/{$moduleName}/metadata/SearchFields.php" ; |
|
414 | + } |
|
415 | 415 | |
416 | - //Load custom SearchFields.php if it exists |
|
417 | - if(file_exists("custom/modules/{$moduleName}/metadata/SearchFields.php")) |
|
418 | - { |
|
419 | - require "custom/modules/{$moduleName}/metadata/SearchFields.php" ; |
|
420 | - } |
|
416 | + //Load custom SearchFields.php if it exists |
|
417 | + if(file_exists("custom/modules/{$moduleName}/metadata/SearchFields.php")) |
|
418 | + { |
|
419 | + require "custom/modules/{$moduleName}/metadata/SearchFields.php" ; |
|
420 | + } |
|
421 | 421 | |
422 | 422 | //If there are $searchFields are empty, just continue, there are no search fields defined for the module |
423 | 423 | if(empty($searchFields[$moduleName])) |
@@ -425,34 +425,34 @@ discard block |
||
425 | 425 | continue; |
426 | 426 | } |
427 | 427 | |
428 | - $isCustomModule = preg_match('/^([a-z0-9]{1,5})_([a-z0-9_]+)$/i' , $moduleName); |
|
429 | - |
|
430 | - //If the bean supports unified search or if it's a custom module bean and unified search is not defined |
|
431 | - if(!empty($dictionary[$beanName]['unified_search']) || $isCustomModule) |
|
432 | - { |
|
433 | - $fields = array(); |
|
434 | - foreach ( $dictionary [ $beanName ][ 'fields' ] as $field => $def ) |
|
435 | - { |
|
436 | - // We cannot enable or disable unified_search for email in the vardefs as we don't actually have a vardef entry for 'email' |
|
437 | - // the searchFields entry for 'email' doesn't correspond to any vardef entry. Instead it contains SQL to directly perform the search. |
|
438 | - // So as a proxy we allow any field in the vardefs that has a name starting with 'email...' to be tagged with the 'unified_search' parameter |
|
439 | - |
|
440 | - if (strpos($field,'email') !== false) |
|
441 | - { |
|
442 | - $field = 'email' ; |
|
443 | - } |
|
444 | - |
|
445 | - //bug: 38139 - allow phone to be searched through Global Search |
|
446 | - if (strpos($field,'phone') !== false) |
|
447 | - { |
|
448 | - $field = 'phone' ; |
|
449 | - } |
|
450 | - |
|
451 | - if ( !empty($def['unified_search']) && isset ( $searchFields [ $moduleName ] [ $field ] )) |
|
452 | - { |
|
453 | - $fields [ $field ] = $searchFields [ $moduleName ] [ $field ] ; |
|
454 | - } |
|
455 | - } |
|
428 | + $isCustomModule = preg_match('/^([a-z0-9]{1,5})_([a-z0-9_]+)$/i' , $moduleName); |
|
429 | + |
|
430 | + //If the bean supports unified search or if it's a custom module bean and unified search is not defined |
|
431 | + if(!empty($dictionary[$beanName]['unified_search']) || $isCustomModule) |
|
432 | + { |
|
433 | + $fields = array(); |
|
434 | + foreach ( $dictionary [ $beanName ][ 'fields' ] as $field => $def ) |
|
435 | + { |
|
436 | + // We cannot enable or disable unified_search for email in the vardefs as we don't actually have a vardef entry for 'email' |
|
437 | + // the searchFields entry for 'email' doesn't correspond to any vardef entry. Instead it contains SQL to directly perform the search. |
|
438 | + // So as a proxy we allow any field in the vardefs that has a name starting with 'email...' to be tagged with the 'unified_search' parameter |
|
439 | + |
|
440 | + if (strpos($field,'email') !== false) |
|
441 | + { |
|
442 | + $field = 'email' ; |
|
443 | + } |
|
444 | + |
|
445 | + //bug: 38139 - allow phone to be searched through Global Search |
|
446 | + if (strpos($field,'phone') !== false) |
|
447 | + { |
|
448 | + $field = 'phone' ; |
|
449 | + } |
|
450 | + |
|
451 | + if ( !empty($def['unified_search']) && isset ( $searchFields [ $moduleName ] [ $field ] )) |
|
452 | + { |
|
453 | + $fields [ $field ] = $searchFields [ $moduleName ] [ $field ] ; |
|
454 | + } |
|
455 | + } |
|
456 | 456 | |
457 | 457 | foreach ($searchFields[$moduleName] as $field => $def) |
458 | 458 | { |
@@ -465,23 +465,23 @@ discard block |
||
465 | 465 | } |
466 | 466 | } |
467 | 467 | |
468 | - if(count($fields) > 0) { |
|
469 | - $supported_modules [$moduleName] ['fields'] = $fields; |
|
470 | - if (isset($dictionary[$beanName]['unified_search_default_enabled']) && $dictionary[$beanName]['unified_search_default_enabled'] === TRUE) |
|
471 | - { |
|
468 | + if(count($fields) > 0) { |
|
469 | + $supported_modules [$moduleName] ['fields'] = $fields; |
|
470 | + if (isset($dictionary[$beanName]['unified_search_default_enabled']) && $dictionary[$beanName]['unified_search_default_enabled'] === TRUE) |
|
471 | + { |
|
472 | 472 | $supported_modules [$moduleName]['default'] = true; |
473 | 473 | } else { |
474 | 474 | $supported_modules [$moduleName]['default'] = false; |
475 | 475 | } |
476 | - } |
|
476 | + } |
|
477 | 477 | |
478 | - } |
|
478 | + } |
|
479 | 479 | |
480 | - } |
|
480 | + } |
|
481 | 481 | |
482 | - ksort($supported_modules); |
|
483 | - write_array_to_file('unified_search_modules', $supported_modules, $this->cache_search); |
|
484 | - } |
|
482 | + ksort($supported_modules); |
|
483 | + write_array_to_file('unified_search_modules', $supported_modules, $this->cache_search); |
|
484 | + } |
|
485 | 485 | |
486 | 486 | /** |
487 | 487 | * Retrieve the enabled and disabled modules used for global search. |
@@ -525,9 +525,9 @@ discard block |
||
525 | 525 | $label = isset($app_list_strings['moduleList'][$module]) ? $app_list_strings['moduleList'][$module] : $module; |
526 | 526 | if($data['default']) |
527 | 527 | { |
528 | - $json_enabled[] = array("module" => $module, 'label' => $label); |
|
528 | + $json_enabled[] = array("module" => $module, 'label' => $label); |
|
529 | 529 | } else { |
530 | - $json_disabled[] = array("module" => $module, 'label' => $label); |
|
530 | + $json_disabled[] = array("module" => $module, 'label' => $label); |
|
531 | 531 | } |
532 | 532 | } |
533 | 533 | } |
@@ -536,47 +536,47 @@ discard block |
||
536 | 536 | } |
537 | 537 | |
538 | 538 | |
539 | - /** |
|
540 | - * saveGlobalSearchSettings |
|
541 | - * This method handles the administrator's request to save the searchable modules selected and stores |
|
542 | - * the results in the unified_search_modules_display.php file |
|
543 | - * |
|
544 | - */ |
|
545 | - function saveGlobalSearchSettings() |
|
546 | - { |
|
547 | - if(isset($_REQUEST['enabled_modules'])) |
|
548 | - { |
|
539 | + /** |
|
540 | + * saveGlobalSearchSettings |
|
541 | + * This method handles the administrator's request to save the searchable modules selected and stores |
|
542 | + * the results in the unified_search_modules_display.php file |
|
543 | + * |
|
544 | + */ |
|
545 | + function saveGlobalSearchSettings() |
|
546 | + { |
|
547 | + if(isset($_REQUEST['enabled_modules'])) |
|
548 | + { |
|
549 | 549 | $unified_search_modules_display = $this->getUnifiedSearchModulesDisplay(); |
550 | 550 | |
551 | - $new_unified_search_modules_display = array(); |
|
551 | + $new_unified_search_modules_display = array(); |
|
552 | 552 | |
553 | 553 | foreach(explode (',', $_REQUEST['enabled_modules'] ) as $module) |
554 | 554 | { |
555 | 555 | $new_unified_search_modules_display[$module]['visible'] = true; |
556 | 556 | } |
557 | 557 | |
558 | - foreach($unified_search_modules_display as $module=>$data) |
|
559 | - { |
|
560 | - if(!isset($new_unified_search_modules_display[$module])) |
|
561 | - { |
|
562 | - $new_unified_search_modules_display[$module]['visible'] = false; |
|
563 | - } |
|
564 | - } |
|
565 | - |
|
566 | - $this->writeUnifiedSearchModulesDisplayFile($new_unified_search_modules_display); |
|
567 | - } |
|
568 | - } |
|
569 | - |
|
570 | - |
|
571 | - public static function unlinkUnifiedSearchModulesFile() { |
|
572 | - //clear the unified_search_module.php file |
|
573 | - $cache_search = sugar_cached('modules/unified_search_modules.php'); |
|
574 | - if(file_exists($cache_search)) |
|
575 | - { |
|
576 | - $GLOBALS['log']->info("unlink {$cache_search}"); |
|
577 | - unlink($cache_search); |
|
578 | - } |
|
579 | - } |
|
558 | + foreach($unified_search_modules_display as $module=>$data) |
|
559 | + { |
|
560 | + if(!isset($new_unified_search_modules_display[$module])) |
|
561 | + { |
|
562 | + $new_unified_search_modules_display[$module]['visible'] = false; |
|
563 | + } |
|
564 | + } |
|
565 | + |
|
566 | + $this->writeUnifiedSearchModulesDisplayFile($new_unified_search_modules_display); |
|
567 | + } |
|
568 | + } |
|
569 | + |
|
570 | + |
|
571 | + public static function unlinkUnifiedSearchModulesFile() { |
|
572 | + //clear the unified_search_module.php file |
|
573 | + $cache_search = sugar_cached('modules/unified_search_modules.php'); |
|
574 | + if(file_exists($cache_search)) |
|
575 | + { |
|
576 | + $GLOBALS['log']->info("unlink {$cache_search}"); |
|
577 | + unlink($cache_search); |
|
578 | + } |
|
579 | + } |
|
580 | 580 | |
581 | 581 | |
582 | 582 | /** |
@@ -589,21 +589,21 @@ discard block |
||
589 | 589 | */ |
590 | 590 | public function getUnifiedSearchModules() |
591 | 591 | { |
592 | - //Make directory if it doesn't exist |
|
592 | + //Make directory if it doesn't exist |
|
593 | 593 | $cachedir = sugar_cached('modules'); |
594 | - if(!file_exists($cachedir)) |
|
595 | - { |
|
596 | - mkdir_recursive($cachedir); |
|
597 | - } |
|
594 | + if(!file_exists($cachedir)) |
|
595 | + { |
|
596 | + mkdir_recursive($cachedir); |
|
597 | + } |
|
598 | 598 | |
599 | - //Load unified_search_modules.php file |
|
599 | + //Load unified_search_modules.php file |
|
600 | 600 | $cachedFile = sugar_cached('modules/unified_search_modules.php'); |
601 | - if(!file_exists($cachedFile)) |
|
602 | - { |
|
603 | - $this->buildCache(); |
|
604 | - } |
|
601 | + if(!file_exists($cachedFile)) |
|
602 | + { |
|
603 | + $this->buildCache(); |
|
604 | + } |
|
605 | 605 | |
606 | - include $cachedFile; |
|
606 | + include $cachedFile; |
|
607 | 607 | return $unified_search_modules; |
608 | 608 | } |
609 | 609 | |
@@ -618,8 +618,8 @@ discard block |
||
618 | 618 | */ |
619 | 619 | public function getUnifiedSearchModulesDisplay() |
620 | 620 | { |
621 | - if(!file_exists('custom/modules/unified_search_modules_display.php')) |
|
622 | - { |
|
621 | + if(!file_exists('custom/modules/unified_search_modules_display.php')) |
|
622 | + { |
|
623 | 623 | $unified_search_modules = $this->getUnifiedSearchModules(); |
624 | 624 | |
625 | 625 | $unified_search_modules_display = array(); |
@@ -633,13 +633,13 @@ discard block |
||
633 | 633 | } |
634 | 634 | |
635 | 635 | $this->writeUnifiedSearchModulesDisplayFile($unified_search_modules_display); |
636 | - } |
|
636 | + } |
|
637 | 637 | |
638 | - include('custom/modules/unified_search_modules_display.php'); |
|
638 | + include('custom/modules/unified_search_modules_display.php'); |
|
639 | 639 | return $unified_search_modules_display; |
640 | 640 | } |
641 | 641 | |
642 | - /* |
|
642 | + /* |
|
643 | 643 | * writeUnifiedSearchModulesDisplayFile |
644 | 644 | * Private method to handle writing the unified_search_modules_display value to file |
645 | 645 | * |
@@ -647,35 +647,35 @@ discard block |
||
647 | 647 | * @return boolean value indication whether or not file was successfully written |
648 | 648 | * @throws Exception Thrown if the file write operation fails |
649 | 649 | */ |
650 | - private function writeUnifiedSearchModulesDisplayFile($unified_search_modules_display) |
|
651 | - { |
|
652 | - if(is_null($unified_search_modules_display) || empty($unified_search_modules_display)) |
|
653 | - { |
|
654 | - return false; |
|
655 | - } |
|
656 | - |
|
657 | - if(!write_array_to_file("unified_search_modules_display", $unified_search_modules_display, 'custom/modules/unified_search_modules_display.php')) |
|
658 | - { |
|
659 | - //Log error message and throw Exception |
|
660 | - global $app_strings; |
|
661 | - $msg = string_format($app_strings['ERR_FILE_WRITE'], array('custom/modules/unified_search_modules_display.php')); |
|
662 | - $GLOBALS['log']->error($msg); |
|
663 | - throw new Exception($msg); |
|
664 | - } |
|
665 | - |
|
666 | - return true; |
|
667 | - } |
|
650 | + private function writeUnifiedSearchModulesDisplayFile($unified_search_modules_display) |
|
651 | + { |
|
652 | + if(is_null($unified_search_modules_display) || empty($unified_search_modules_display)) |
|
653 | + { |
|
654 | + return false; |
|
655 | + } |
|
656 | + |
|
657 | + if(!write_array_to_file("unified_search_modules_display", $unified_search_modules_display, 'custom/modules/unified_search_modules_display.php')) |
|
658 | + { |
|
659 | + //Log error message and throw Exception |
|
660 | + global $app_strings; |
|
661 | + $msg = string_format($app_strings['ERR_FILE_WRITE'], array('custom/modules/unified_search_modules_display.php')); |
|
662 | + $GLOBALS['log']->error($msg); |
|
663 | + throw new Exception($msg); |
|
664 | + } |
|
665 | + |
|
666 | + return true; |
|
667 | + } |
|
668 | 668 | } |
669 | 669 | |
670 | 670 | |
671 | 671 | function unified_search_modules_cmp($a, $b) { |
672 | - if(!isset($a['translated']) || !isset($b['translated'])) |
|
673 | - { |
|
674 | - return 0; |
|
675 | - } |
|
672 | + if(!isset($a['translated']) || !isset($b['translated'])) |
|
673 | + { |
|
674 | + return 0; |
|
675 | + } |
|
676 | 676 | |
677 | - $name1 = strtolower($a['translated']); |
|
678 | - $name2 = strtolower($b['translated']); |
|
677 | + $name1 = strtolower($a['translated']); |
|
678 | + $name2 = strtolower($b['translated']); |
|
679 | 679 | |
680 | - return $name1 < $name2 ? -1 : 1; |
|
680 | + return $name1 < $name2 ? -1 : 1; |
|
681 | 681 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | require_once('include/MySugar/MySugar.php'); |
46 | 46 | |
47 | 47 | // build dashlet cache file if not found |
48 | -if(!is_file($cachefile = sugar_cached('dashlets/dashlets.php'))) { |
|
48 | +if (!is_file($cachefile = sugar_cached('dashlets/dashlets.php'))) { |
|
49 | 49 | require_once('include/Dashlets/DashletCacheBuilder.php'); |
50 | 50 | |
51 | 51 | $dc = new DashletCacheBuilder(); |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | $hasUserPreferences = (!isset($pages) || empty($pages) || !isset($dashlets) || empty($dashlets)) ? false : true; |
65 | 65 | |
66 | -if(!$hasUserPreferences){ |
|
66 | +if (!$hasUserPreferences) { |
|
67 | 67 | $dashlets = array(); |
68 | 68 | |
69 | 69 | //list of preferences to move over and to where |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | $old_columns = $current_user->getPreference('columns', 'home'); |
89 | 89 | $old_dashlets = $current_user->getPreference('dashlets', 'home'); |
90 | 90 | |
91 | - if (isset($old_columns) && !empty($old_columns) && isset($old_dashlets) && !empty($old_dashlets)){ |
|
91 | + if (isset($old_columns) && !empty($old_columns) && isset($old_dashlets) && !empty($old_dashlets)) { |
|
92 | 92 | $columns = $old_columns; |
93 | 93 | $dashlets = $old_dashlets; |
94 | 94 | |
@@ -98,23 +98,23 @@ discard block |
||
98 | 98 | $current_user->setPreference('columns', $old_columns, 0, 'home'); |
99 | 99 | $current_user->setPreference('dashlets', $old_dashlets, 0, 'home'); |
100 | 100 | } |
101 | - else{ |
|
101 | + else { |
|
102 | 102 | // This is here to get Sugar dashlets added above the rest |
103 | - $dashlets[create_guid()] = array ('className' => 'SugarFeedDashlet', |
|
103 | + $dashlets[create_guid()] = array('className' => 'SugarFeedDashlet', |
|
104 | 104 | 'module' => 'SugarFeed', |
105 | 105 | 'forceColumn' => 1, |
106 | 106 | 'fileLocation' => $dashletsFiles['SugarFeedDashlet']['file'], |
107 | 107 | ); |
108 | 108 | |
109 | - foreach($defaultDashlets as $dashletName=>$module){ |
|
109 | + foreach ($defaultDashlets as $dashletName=>$module) { |
|
110 | 110 | // clint - fixes bug #20398 |
111 | 111 | // only display dashlets that are from visibile modules and that the user has permission to list |
112 | 112 | $myDashlet = new MySugar($module); |
113 | 113 | $displayDashlet = $myDashlet->checkDashletDisplay(); |
114 | - if (isset($dashletsFiles[$dashletName]) && $displayDashlet){ |
|
114 | + if (isset($dashletsFiles[$dashletName]) && $displayDashlet) { |
|
115 | 115 | $options = array(); |
116 | - $prefsforthisdashlet = array_keys($prefstomove,$dashletName); |
|
117 | - foreach ( $prefsforthisdashlet as $pref ) { |
|
116 | + $prefsforthisdashlet = array_keys($prefstomove, $dashletName); |
|
117 | + foreach ($prefsforthisdashlet as $pref) { |
|
118 | 118 | $options[$pref] = $current_user->getPreference($pref); |
119 | 119 | } |
120 | 120 | $dashlets[create_guid()] = array('className' => $dashletName, |
@@ -134,8 +134,8 @@ discard block |
||
134 | 134 | $columns[1]['width'] = '40%'; |
135 | 135 | $columns[1]['dashlets'] = array(); |
136 | 136 | |
137 | - foreach($dashlets as $guid=>$dashlet) { |
|
138 | - if( $dashlet['forceColumn'] == 0 ) array_push($columns[0]['dashlets'], $guid); |
|
137 | + foreach ($dashlets as $guid=>$dashlet) { |
|
138 | + if ($dashlet['forceColumn'] == 0) array_push($columns[0]['dashlets'], $guid); |
|
139 | 139 | else array_push($columns[1]['dashlets'], $guid); |
140 | 140 | $count++; |
141 | 141 | } |
@@ -150,29 +150,29 @@ discard block |
||
150 | 150 | // handles upgrading from versions that had the 'Dashboard' module; move those items over to the Home page |
151 | 151 | $pagesDashboard = $current_user->getPreference('pages', 'Dashboard'); |
152 | 152 | $dashletsDashboard = $current_user->getPreference('dashlets', 'Dashboard'); |
153 | -if ( !empty($pagesDashboard) ) { |
|
153 | +if (!empty($pagesDashboard)) { |
|
154 | 154 | // move dashlets from the dashboard to be at the end of the home screen dashlets |
155 | - foreach ($pagesDashboard[0]['columns'] as $dashboardColumnKey => $dashboardColumn ) { |
|
156 | - foreach ($dashboardColumn['dashlets'] as $dashletItem ) { |
|
155 | + foreach ($pagesDashboard[0]['columns'] as $dashboardColumnKey => $dashboardColumn) { |
|
156 | + foreach ($dashboardColumn['dashlets'] as $dashletItem) { |
|
157 | 157 | $pages[0]['columns'][$dashboardColumnKey]['dashlets'][] = $dashletItem; |
158 | 158 | } |
159 | 159 | } |
160 | - $pages = array_merge($pages,$pagesDashboard); |
|
160 | + $pages = array_merge($pages, $pagesDashboard); |
|
161 | 161 | $current_user->setPreference('pages', $pages, 0, 'Home'); |
162 | 162 | } |
163 | -if ( !empty($dashletsDashboard) ) { |
|
164 | - $dashlets = array_merge($dashlets,$dashletsDashboard); |
|
163 | +if (!empty($dashletsDashboard)) { |
|
164 | + $dashlets = array_merge($dashlets, $dashletsDashboard); |
|
165 | 165 | $current_user->setPreference('dashlets', $dashlets, 0, 'Home'); |
166 | 166 | } |
167 | -if ( !empty($pagesDashboard) || !empty($dashletsDashboard) ) |
|
167 | +if (!empty($pagesDashboard) || !empty($dashletsDashboard)) |
|
168 | 168 | $current_user->resetPreferences('Dashboard'); |
169 | 169 | |
170 | -if (empty($pages)){ |
|
170 | +if (empty($pages)) { |
|
171 | 171 | $pages = array(); |
172 | 172 | $pageIndex = 0; |
173 | 173 | $pages[0]['columns'] = $columns; |
174 | 174 | $pages[0]['numColumns'] = '3'; |
175 | - $pages[0]['pageTitleLabel'] = 'LBL_HOME_PAGE_1_NAME'; // "My Sugar" |
|
175 | + $pages[0]['pageTitleLabel'] = 'LBL_HOME_PAGE_1_NAME'; // "My Sugar" |
|
176 | 176 | $pageIndex++; |
177 | 177 | $current_user->setPreference('pages', $pages, 0, 'Home'); |
178 | 178 | $activePage = 0; |
@@ -191,34 +191,34 @@ discard block |
||
191 | 191 | $dashletIds = array(); // collect ids to pass to javascript |
192 | 192 | $display = array(); |
193 | 193 | |
194 | -foreach($pages[$activePage]['columns'] as $colNum => $column) { |
|
195 | - if ($colNum == $numCols){ |
|
194 | +foreach ($pages[$activePage]['columns'] as $colNum => $column) { |
|
195 | + if ($colNum == $numCols) { |
|
196 | 196 | break; |
197 | 197 | } |
198 | 198 | $display[$colNum]['width'] = $column['width']; |
199 | 199 | $display[$colNum]['dashlets'] = array(); |
200 | - foreach($column['dashlets'] as $num => $id) { |
|
200 | + foreach ($column['dashlets'] as $num => $id) { |
|
201 | 201 | // clint - fixes bug #20398 |
202 | 202 | // only display dashlets that are from visibile modules and that the user has permission to list |
203 | - if(!empty($id) && isset($dashlets[$id]) && is_file($dashlets[$id]['fileLocation'])) { |
|
203 | + if (!empty($id) && isset($dashlets[$id]) && is_file($dashlets[$id]['fileLocation'])) { |
|
204 | 204 | $module = 'Home'; |
205 | - if ( !empty($dashletsFiles[$dashlets[$id]['className']]['module']) ) |
|
205 | + if (!empty($dashletsFiles[$dashlets[$id]['className']]['module'])) |
|
206 | 206 | $module = $dashletsFiles[$dashlets[$id]['className']]['module']; |
207 | 207 | // Bug 24772 - Look into the user preference for the module the dashlet is a part of in case |
208 | 208 | // of the Report Chart dashlets. |
209 | - elseif ( !empty($dashlets[$id]['module']) ) |
|
209 | + elseif (!empty($dashlets[$id]['module'])) |
|
210 | 210 | $module = $dashlets[$id]['module']; |
211 | 211 | |
212 | 212 | $myDashlet = new MySugar($module); |
213 | 213 | |
214 | - if($myDashlet->checkDashletDisplay()) { |
|
214 | + if ($myDashlet->checkDashletDisplay()) { |
|
215 | 215 | require_once($dashlets[$id]['fileLocation']); |
216 | 216 | |
217 | 217 | |
218 | 218 | $dashlet = new $dashlets[$id]['className']($id, (isset($dashlets[$id]['options']) ? $dashlets[$id]['options'] : array())); |
219 | 219 | // Need to add support to dynamically display/hide dashlets |
220 | 220 | // If it has a method 'shouldDisplay' we will call it to see if we should display it or not |
221 | - if (method_exists($dashlet,'shouldDisplay')) { |
|
221 | + if (method_exists($dashlet, 'shouldDisplay')) { |
|
222 | 222 | if (!$dashlet->shouldDisplay()) { |
223 | 223 | // This dashlet doesn't want us to show it, skip it. |
224 | 224 | continue; |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | |
230 | 230 | $dashlets = $current_user->getPreference('dashlets', 'Home'); // Using hardcoded 'Home' because DynamicAction.php $_REQUEST['module'] value is always Home |
231 | 231 | $lvsParams = array(); |
232 | - if(!empty($dashlets[$id]['sort_options'])){ |
|
232 | + if (!empty($dashlets[$id]['sort_options'])) { |
|
233 | 233 | $lvsParams = $dashlets[$id]['sort_options']; |
234 | 234 | } |
235 | 235 | |
@@ -238,10 +238,10 @@ discard block |
||
238 | 238 | $display[$colNum]['dashlets'][$id]['display'] = $dashlet->display(); |
239 | 239 | $display[$colNum]['dashlets'][$id]['displayHeader'] = $dashlet->getHeader(); |
240 | 240 | $display[$colNum]['dashlets'][$id]['displayFooter'] = $dashlet->getFooter(); |
241 | - if($dashlet->hasScript) { |
|
241 | + if ($dashlet->hasScript) { |
|
242 | 242 | $display[$colNum]['dashlets'][$id]['script'] = $dashlet->displayScript(); |
243 | 243 | } |
244 | - } catch (Exception $ex) { |
|
244 | + }catch (Exception $ex) { |
|
245 | 245 | $display[$colNum]['dashlets'][$id]['display'] = $ex->getMessage(); |
246 | 246 | $display[$colNum]['dashlets'][$id]['displayHeader'] = $dashlet->getHeader(); |
247 | 247 | $display[$colNum]['dashlets'][$id]['displayFooter'] = $dashlet->getFooter(); |
@@ -253,18 +253,18 @@ discard block |
||
253 | 253 | |
254 | 254 | |
255 | 255 | $i = 0; |
256 | - while($i < count($pages)){ |
|
257 | - if($i == 0){ |
|
256 | + while ($i < count($pages)) { |
|
257 | + if ($i == 0) { |
|
258 | 258 | $pageTabs[$i]['pageTitle'] = $GLOBALS['app_strings']['LBL_SUITE_DASHBOARD']; |
259 | 259 | // $pageTabs[$i]['active'] = 'current'; |
260 | - }else{ |
|
260 | + } else { |
|
261 | 261 | $pageTabs[$i]['pageTitle'] = $pages[$i]['pageTitle']; |
262 | 262 | $divPages[] = $i; |
263 | 263 | } |
264 | 264 | $i++; |
265 | 265 | } |
266 | 266 | |
267 | -if(!empty($sugar_config['lock_homepage']) && $sugar_config['lock_homepage'] == true) $sugar_smarty->assign('lock_homepage', true); |
|
267 | +if (!empty($sugar_config['lock_homepage']) && $sugar_config['lock_homepage'] == true) $sugar_smarty->assign('lock_homepage', true); |
|
268 | 268 | |
269 | 269 | $sugar_smarty->assign('sugarVersion', $sugar_version); |
270 | 270 | $sugar_smarty->assign('sugarFlavor', $sugar_flavor); |
@@ -274,7 +274,7 @@ discard block |
||
274 | 274 | |
275 | 275 | $sugar_smarty->assign('maxCount', empty($sugar_config['max_dashlets_homepage']) ? 15 : $sugar_config['max_dashlets_homepage']); |
276 | 276 | $sugar_smarty->assign('dashletCount', $count); |
277 | -$sugar_smarty->assign('dashletIds', '["' . implode('","', $dashletIds) . '"]'); |
|
277 | +$sugar_smarty->assign('dashletIds', '["'.implode('","', $dashletIds).'"]'); |
|
278 | 278 | $sugar_smarty->assign('columns', $display); |
279 | 279 | |
280 | 280 | global $theme; |
@@ -305,16 +305,16 @@ discard block |
||
305 | 305 | $sugar_smarty->assign('chartResources', $resources); |
306 | 306 | $sugar_smarty->assign('mySugarChartResources', $mySugarResources); |
307 | 307 | |
308 | -if (file_exists("custom/themes/" . $theme ."/tpls/MySugar.tpl")) { |
|
309 | - echo $sugar_smarty->fetch("custom/themes/" . $theme ."/tpls/MySugar.tpl"); |
|
308 | +if (file_exists("custom/themes/".$theme."/tpls/MySugar.tpl")) { |
|
309 | + echo $sugar_smarty->fetch("custom/themes/".$theme."/tpls/MySugar.tpl"); |
|
310 | 310 | } |
311 | -else if(file_exists('custom/include/MySugar/tpls/MySugar.tpl')) { |
|
311 | +else if (file_exists('custom/include/MySugar/tpls/MySugar.tpl')) { |
|
312 | 312 | echo $sugar_smarty->fetch('custom/include/MySugar/tpls/MySugar.tpl'); |
313 | 313 | } |
314 | -elseif (file_exists("themes/" . $theme ."/tpls/MySugar.tpl")) { |
|
315 | - echo $sugar_smarty->fetch("themes/" . $theme ."/tpls/MySugar.tpl"); |
|
314 | +elseif (file_exists("themes/".$theme."/tpls/MySugar.tpl")) { |
|
315 | + echo $sugar_smarty->fetch("themes/".$theme."/tpls/MySugar.tpl"); |
|
316 | 316 | } |
317 | -else if(file_exists('include/MySugar/tpls/MySugar.tpl')) { |
|
317 | +else if (file_exists('include/MySugar/tpls/MySugar.tpl')) { |
|
318 | 318 | echo $sugar_smarty->fetch('include/MySugar/tpls/MySugar.tpl'); |
319 | 319 | } |
320 | 320 | else { |
@@ -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. |
@@ -97,8 +99,7 @@ discard block |
||
97 | 99 | $old_dashlets = array(); |
98 | 100 | $current_user->setPreference('columns', $old_columns, 0, 'home'); |
99 | 101 | $current_user->setPreference('dashlets', $old_dashlets, 0, 'home'); |
100 | - } |
|
101 | - else{ |
|
102 | + } else{ |
|
102 | 103 | // This is here to get Sugar dashlets added above the rest |
103 | 104 | $dashlets[create_guid()] = array ('className' => 'SugarFeedDashlet', |
104 | 105 | 'module' => 'SugarFeed', |
@@ -135,8 +136,11 @@ discard block |
||
135 | 136 | $columns[1]['dashlets'] = array(); |
136 | 137 | |
137 | 138 | foreach($dashlets as $guid=>$dashlet) { |
138 | - if( $dashlet['forceColumn'] == 0 ) array_push($columns[0]['dashlets'], $guid); |
|
139 | - else array_push($columns[1]['dashlets'], $guid); |
|
139 | + if( $dashlet['forceColumn'] == 0 ) { |
|
140 | + array_push($columns[0]['dashlets'], $guid); |
|
141 | + } else { |
|
142 | + array_push($columns[1]['dashlets'], $guid); |
|
143 | + } |
|
140 | 144 | $count++; |
141 | 145 | } |
142 | 146 | } |
@@ -164,8 +168,9 @@ discard block |
||
164 | 168 | $dashlets = array_merge($dashlets,$dashletsDashboard); |
165 | 169 | $current_user->setPreference('dashlets', $dashlets, 0, 'Home'); |
166 | 170 | } |
167 | -if ( !empty($pagesDashboard) || !empty($dashletsDashboard) ) |
|
171 | +if ( !empty($pagesDashboard) || !empty($dashletsDashboard) ) { |
|
168 | 172 | $current_user->resetPreferences('Dashboard'); |
173 | +} |
|
169 | 174 | |
170 | 175 | if (empty($pages)){ |
171 | 176 | $pages = array(); |
@@ -202,12 +207,14 @@ discard block |
||
202 | 207 | // only display dashlets that are from visibile modules and that the user has permission to list |
203 | 208 | if(!empty($id) && isset($dashlets[$id]) && is_file($dashlets[$id]['fileLocation'])) { |
204 | 209 | $module = 'Home'; |
205 | - if ( !empty($dashletsFiles[$dashlets[$id]['className']]['module']) ) |
|
206 | - $module = $dashletsFiles[$dashlets[$id]['className']]['module']; |
|
210 | + if ( !empty($dashletsFiles[$dashlets[$id]['className']]['module']) ) { |
|
211 | + $module = $dashletsFiles[$dashlets[$id]['className']]['module']; |
|
212 | + } |
|
207 | 213 | // Bug 24772 - Look into the user preference for the module the dashlet is a part of in case |
208 | 214 | // of the Report Chart dashlets. |
209 | - elseif ( !empty($dashlets[$id]['module']) ) |
|
210 | - $module = $dashlets[$id]['module']; |
|
215 | + elseif ( !empty($dashlets[$id]['module']) ) { |
|
216 | + $module = $dashlets[$id]['module']; |
|
217 | + } |
|
211 | 218 | |
212 | 219 | $myDashlet = new MySugar($module); |
213 | 220 | |
@@ -257,14 +264,16 @@ discard block |
||
257 | 264 | if($i == 0){ |
258 | 265 | $pageTabs[$i]['pageTitle'] = $GLOBALS['app_strings']['LBL_SUITE_DASHBOARD']; |
259 | 266 | // $pageTabs[$i]['active'] = 'current'; |
260 | - }else{ |
|
267 | + } else{ |
|
261 | 268 | $pageTabs[$i]['pageTitle'] = $pages[$i]['pageTitle']; |
262 | 269 | $divPages[] = $i; |
263 | 270 | } |
264 | 271 | $i++; |
265 | 272 | } |
266 | 273 | |
267 | -if(!empty($sugar_config['lock_homepage']) && $sugar_config['lock_homepage'] == true) $sugar_smarty->assign('lock_homepage', true); |
|
274 | +if(!empty($sugar_config['lock_homepage']) && $sugar_config['lock_homepage'] == true) { |
|
275 | + $sugar_smarty->assign('lock_homepage', true); |
|
276 | +} |
|
268 | 277 | |
269 | 278 | $sugar_smarty->assign('sugarVersion', $sugar_version); |
270 | 279 | $sugar_smarty->assign('sugarFlavor', $sugar_flavor); |
@@ -307,17 +316,13 @@ discard block |
||
307 | 316 | |
308 | 317 | if (file_exists("custom/themes/" . $theme ."/tpls/MySugar.tpl")) { |
309 | 318 | echo $sugar_smarty->fetch("custom/themes/" . $theme ."/tpls/MySugar.tpl"); |
310 | -} |
|
311 | -else if(file_exists('custom/include/MySugar/tpls/MySugar.tpl')) { |
|
319 | +} else if(file_exists('custom/include/MySugar/tpls/MySugar.tpl')) { |
|
312 | 320 | echo $sugar_smarty->fetch('custom/include/MySugar/tpls/MySugar.tpl'); |
313 | -} |
|
314 | -elseif (file_exists("themes/" . $theme ."/tpls/MySugar.tpl")) { |
|
321 | +} elseif (file_exists("themes/" . $theme ."/tpls/MySugar.tpl")) { |
|
315 | 322 | echo $sugar_smarty->fetch("themes/" . $theme ."/tpls/MySugar.tpl"); |
316 | -} |
|
317 | -else if(file_exists('include/MySugar/tpls/MySugar.tpl')) { |
|
323 | +} else if(file_exists('include/MySugar/tpls/MySugar.tpl')) { |
|
318 | 324 | echo $sugar_smarty->fetch('include/MySugar/tpls/MySugar.tpl'); |
319 | -} |
|
320 | -else { |
|
325 | +} else { |
|
321 | 326 | $GLOBALS['log']->fatal('MySugar.tpl not found'); |
322 | 327 | } |
323 | 328 |
@@ -24,12 +24,12 @@ |
||
24 | 24 | * Used to delete a project's related tasks after a project is deleted |
25 | 25 | */ |
26 | 26 | class delete_project_tasks { |
27 | - function delete_tasks(&$bean, $event, $arguments){ |
|
27 | + function delete_tasks(&$bean, $event, $arguments) { |
|
28 | 28 | global $db; |
29 | 29 | $Task = BeanFactory::getBean('ProjectTask'); |
30 | 30 | $tasks = $Task->get_full_list("order_number", "project_task.project_id = '".$bean->id."'"); |
31 | 31 | |
32 | - foreach($tasks as $task){ |
|
32 | + foreach ($tasks as $task) { |
|
33 | 33 | $query = "UPDATE project_task SET deleted ='1' WHERE id ='".$task->id."'"; |
34 | 34 | $update = $db->query($query); |
35 | 35 | } |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -66,24 +66,24 @@ |
||
66 | 66 | $this->javascript->setSugarBean($focus); |
67 | 67 | $this->javascript->addAllFields(''); |
68 | 68 | |
69 | - //$this->ss->assign("STATUS_OPTIONS", get_select_options_with_id($app_list_strings['project_status_dom'], $focus->status)); |
|
69 | + //$this->ss->assign("STATUS_OPTIONS", get_select_options_with_id($app_list_strings['project_status_dom'], $focus->status)); |
|
70 | 70 | $this->ss->assign('additionalScripts', $this->javascript->getScript(false)); |
71 | 71 | $this->ss->assign('CALENDAR_DATEFORMAT', $timedate->get_cal_date_format()); |
72 | 72 | |
73 | 73 | |
74 | 74 | $json = getJSONobj(); |
75 | 75 | |
76 | - $popup_request_data = array( |
|
77 | - 'call_back_function' => 'set_return', |
|
78 | - 'form_name' => 'projectsQuickCreate', |
|
79 | - 'field_to_name_array' => array( |
|
80 | - 'id' => 'account_id', |
|
81 | - 'name' => 'account_name', |
|
82 | - ), |
|
83 | - ); |
|
76 | + $popup_request_data = array( |
|
77 | + 'call_back_function' => 'set_return', |
|
78 | + 'form_name' => 'projectsQuickCreate', |
|
79 | + 'field_to_name_array' => array( |
|
80 | + 'id' => 'account_id', |
|
81 | + 'name' => 'account_name', |
|
82 | + ), |
|
83 | + ); |
|
84 | 84 | |
85 | - $encoded_popup_request_data = $json->encode($popup_request_data); |
|
86 | - $this->ss->assign('encoded_popup_request_data', $encoded_popup_request_data); |
|
85 | + $encoded_popup_request_data = $json->encode($popup_request_data); |
|
86 | + $this->ss->assign('encoded_popup_request_data', $encoded_popup_request_data); |
|
87 | 87 | |
88 | 88 | |
89 | 89 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
3 | 3 | /********************************************************************************* |
4 | 4 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 5 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | $this->ss->assign("SALUTATION_OPTIONS", get_select_options_with_id($app_list_strings['salutation_dom'], '')); |
57 | 57 | |
58 | - if($this->viaAJAX) { // override for ajax call |
|
58 | + if ($this->viaAJAX) { // override for ajax call |
|
59 | 59 | $this->ss->assign('saveOnclick', "onclick='if(check_form(\"contactsQuickCreate\")) return SUGAR.subpanelUtils.inlineSave(this.form.id, \"contacts\"); else return false;'"); |
60 | 60 | $this->ss->assign('cancelOnclick', "onclick='return SUGAR.subpanelUtils.cancelCreate(\"subpanel_contacts\")';"); |
61 | 61 | } |
@@ -1,5 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |