@@ -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. |
@@ -65,7 +67,9 @@ discard block |
||
65 | 67 | $i++; |
66 | 68 | $rows[$i] = $row; |
67 | 69 | } |
68 | - if ($i==-1) return null; |
|
70 | + if ($i==-1) { |
|
71 | + return null; |
|
72 | + } |
|
69 | 73 | |
70 | 74 | return $rows; |
71 | 75 | } |
@@ -77,7 +81,9 @@ discard block |
||
77 | 81 | if(!empty($mod)){ |
78 | 82 | global $current_language; |
79 | 83 | $mod_strings = return_module_language($current_language, $mod); |
80 | - }else global $mod_strings; |
|
84 | + } else { |
|
85 | + global $mod_strings; |
|
86 | + } |
|
81 | 87 | global $app_strings; |
82 | 88 | $cols = sizeof($rows[0]) * 2 + 1; |
83 | 89 | $form = '<table width="100%"><tr><td>'.$mod_strings['MSG_DUPLICATE']. '</td></tr><tr><td height="20"></td></tr></table>'; |
@@ -108,14 +114,14 @@ discard block |
||
108 | 114 | if(!$wasSet){ |
109 | 115 | $form .= "<td scope='row'><a target='_blank' href='index.php?module=Opportunities&action=DetailView&record=${row['id']}'>$value</a></td>"; |
110 | 116 | $wasSet = true; |
111 | - }else{ |
|
117 | + } else{ |
|
112 | 118 | $form .= "<td><a target='_blank' href='index.php?module=Opportunities&action=DetailView&record=${row['id']}'>$value</a></td>"; |
113 | 119 | } |
114 | 120 | }} |
115 | 121 | |
116 | 122 | if($rowColor == 'evenListRowS1'){ |
117 | 123 | $rowColor = 'oddListRowS1'; |
118 | - }else{ |
|
124 | + } else{ |
|
119 | 125 | $rowColor = 'evenListRowS1'; |
120 | 126 | } |
121 | 127 | $form .= "</tr>"; |
@@ -136,7 +142,9 @@ discard block |
||
136 | 142 | if(!empty($mod)){ |
137 | 143 | global $current_language; |
138 | 144 | $mod_strings = return_module_language($current_language, $mod); |
139 | -}else global $mod_strings; |
|
145 | +} else { |
|
146 | + global $mod_strings; |
|
147 | +} |
|
140 | 148 | global $app_strings; |
141 | 149 | global $sugar_version, $sugar_config; |
142 | 150 | |
@@ -286,7 +294,9 @@ discard block |
||
286 | 294 | EOQ; |
287 | 295 | //carry forward custom lead fields to opportunities during Lead Conversion |
288 | 296 | $tempOpp = new Opportunity(); |
289 | - if (method_exists($lead, 'convertCustomFieldsForm')) $lead->convertCustomFieldsForm($the_form, $tempOpp, $prefix); |
|
297 | + if (method_exists($lead, 'convertCustomFieldsForm')) { |
|
298 | + $lead->convertCustomFieldsForm($the_form, $tempOpp, $prefix); |
|
299 | + } |
|
290 | 300 | unset($tempOpp); |
291 | 301 | |
292 | 302 | $the_form .= <<<EOQ |
@@ -321,7 +331,9 @@ discard block |
||
321 | 331 | if(!empty($mod)){ |
322 | 332 | global $current_language; |
323 | 333 | $mod_strings = return_module_language($current_language, $mod); |
324 | -}else global $mod_strings; |
|
334 | +} else { |
|
335 | + global $mod_strings; |
|
336 | +} |
|
325 | 337 | global $app_strings; |
326 | 338 | global $app_list_strings; |
327 | 339 | global $theme; |
@@ -461,7 +473,7 @@ discard block |
||
461 | 473 | $GLOBALS['log']->debug("Saved record with id of ".$return_id); |
462 | 474 | if($redirect){ |
463 | 475 | handleRedirect($return_id,"Opportunities" ); |
464 | - }else{ |
|
476 | + } else{ |
|
465 | 477 | return $focus; |
466 | 478 | } |
467 | 479 | } |
@@ -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. |
@@ -153,8 +155,9 @@ discard block |
||
153 | 155 | if(empty($focus->name)){ |
154 | 156 | return null; |
155 | 157 | } |
156 | - if ( !isset($focus->assigned_user_id) || $focus->assigned_user_id == '' ) |
|
157 | - $focus->assigned_user_id = $GLOBALS['current_user']->id; |
|
158 | + if ( !isset($focus->assigned_user_id) || $focus->assigned_user_id == '' ) { |
|
159 | + $focus->assigned_user_id = $GLOBALS['current_user']->id; |
|
160 | + } |
|
158 | 161 | |
159 | 162 | $return_id = $focus->save(); |
160 | 163 | if($redirect){ |
@@ -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>"; |
@@ -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 | } |
@@ -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 |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if (!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -68,8 +70,7 @@ discard block |
||
68 | 70 | $task->date_finish = $enddate; |
69 | 71 | $task->save(); |
70 | 72 | |
71 | - } |
|
72 | - else if($rel_type == 'SS'){//if its a start to start |
|
73 | + } else if($rel_type == 'SS'){//if its a start to start |
|
73 | 74 | //check if the tasks duration has not been changed so that it does not update when the parent tasks duration is changed |
74 | 75 | if($bean->fetched_row['duration'] == $bean->duration){ |
75 | 76 |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -49,16 +51,30 @@ discard block |
||
49 | 51 | } |
50 | 52 | |
51 | 53 | $overlib_string = ''; |
52 | - if(!empty($fields['PRIORITY'])) $overlib_string .= '<b>' . $mod_strings['LBL_PRIORITY'] . '</b> ' . $fields['PRIORITY'] . '<br>'; |
|
53 | - if(!empty($fields['PERCENT_COMPLETE'])) $overlib_string .= '<b>' . $mod_strings['LBL_PERCENT_COMPLETE'] . '</b> ' . $fields['PERCENT_COMPLETE'] . '%<br>'; |
|
54 | - if(!empty($fields['ESTIMATED_EFFORT'])) $overlib_string .= '<b>' . $mod_strings['LBL_ESTIMATED_EFFORT'] . '</b> ' . $fields['ESTIMATED_EFFORT'] . '<br>'; |
|
55 | - if(!empty($fields['ACTUAL_EFFORT'])) $overlib_string .= '<b>' . $mod_strings['LBL_ACTUAL_EFFORT'] . '</b> ' . $fields['ACTUAL_EFFORT'] . '<br>'; |
|
56 | - if(!empty($fields['TASK_NUMBER'])) $overlib_string .= '<b>' . $mod_strings['LBL_TASK_NUMBER'] . '</b> ' . $fields['TASK_NUMBER'] . '<br>'; |
|
57 | - if(!empty($fields['DATE_START'])) $overlib_string .= '<b>' . $mod_strings['LBL_DATE_START'] . '</b> ' . $fields['DATE_START'] . ' ' . $fields['TIME_START'] . '<br>'; |
|
54 | + if(!empty($fields['PRIORITY'])) { |
|
55 | + $overlib_string .= '<b>' . $mod_strings['LBL_PRIORITY'] . '</b> ' . $fields['PRIORITY'] . '<br>'; |
|
56 | + } |
|
57 | + if(!empty($fields['PERCENT_COMPLETE'])) { |
|
58 | + $overlib_string .= '<b>' . $mod_strings['LBL_PERCENT_COMPLETE'] . '</b> ' . $fields['PERCENT_COMPLETE'] . '%<br>'; |
|
59 | + } |
|
60 | + if(!empty($fields['ESTIMATED_EFFORT'])) { |
|
61 | + $overlib_string .= '<b>' . $mod_strings['LBL_ESTIMATED_EFFORT'] . '</b> ' . $fields['ESTIMATED_EFFORT'] . '<br>'; |
|
62 | + } |
|
63 | + if(!empty($fields['ACTUAL_EFFORT'])) { |
|
64 | + $overlib_string .= '<b>' . $mod_strings['LBL_ACTUAL_EFFORT'] . '</b> ' . $fields['ACTUAL_EFFORT'] . '<br>'; |
|
65 | + } |
|
66 | + if(!empty($fields['TASK_NUMBER'])) { |
|
67 | + $overlib_string .= '<b>' . $mod_strings['LBL_TASK_NUMBER'] . '</b> ' . $fields['TASK_NUMBER'] . '<br>'; |
|
68 | + } |
|
69 | + if(!empty($fields['DATE_START'])) { |
|
70 | + $overlib_string .= '<b>' . $mod_strings['LBL_DATE_START'] . '</b> ' . $fields['DATE_START'] . ' ' . $fields['TIME_START'] . '<br>'; |
|
71 | + } |
|
58 | 72 | |
59 | 73 | if(!empty($fields['DESCRIPTION'])) { |
60 | 74 | $overlib_string .= '<b>'. $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300); |
61 | - if(strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...'; |
|
75 | + if(strlen($fields['DESCRIPTION']) > 300) { |
|
76 | + $overlib_string .= '...'; |
|
77 | + } |
|
62 | 78 | } |
63 | 79 | |
64 | 80 | return array('fieldToAddTo' => 'NAME', |
@@ -1,5 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
2 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
3 | + die('Not A Valid Entry Point'); |
|
4 | +} |
|
3 | 5 | /********************************************************************************* |
4 | 6 | * SugarCRM Community Edition is a customer relationship management program developed by |
5 | 7 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -65,14 +67,19 @@ discard block |
||
65 | 67 | |
66 | 68 | $button = "<table cellspacing='0' cellpadding='1' border='0'><form border='0' action='index.php' method='post' name='form' id='form'>\n"; |
67 | 69 | $button .= "<input type='hidden' name='module' value='Contacts'>\n"; |
68 | -if ($currentModule == 'Accounts') $button .= "<input type='hidden' name='account_id' value='$focus->id'>\n<input type='hidden' name='account_name' value='$focus->name'>\n"; |
|
70 | +if ($currentModule == 'Accounts') { |
|
71 | + $button .= "<input type='hidden' name='account_id' value='$focus->id'>\n<input type='hidden' name='account_name' value='$focus->name'>\n"; |
|
72 | +} |
|
69 | 73 | $button .= "<input type='hidden' name='return_module' value='".$currentModule."'>\n"; |
70 | 74 | $button .= "<input type='hidden' name='return_action' value='".$action."'>\n"; |
71 | 75 | $button .= "<input type='hidden' name='return_id' value='".$focus->id."'>\n"; |
72 | 76 | $button .= "<input type='hidden' name='action'>\n"; |
73 | 77 | $button .= "<tr><td> </td>"; |
74 | -if ($focus->parent_type == "Accounts") $button .= "<td><input title='".$app_strings['LBL_SELECT_CONTACT_BUTTON_TITLE']."' type='button' class='button' value='".$app_strings['LBL_SELECT_CONTACT_BUTTON_LABEL']."' name='button' LANGUAGE=javascript onclick='window.open(\"index.php?module=Contacts&action=Popup&html=Popup_picker&form=DetailView&form_submit=true&query=true&account_id=$focus->parent_id&account_name=".urlencode($focus->parent_name)."\",\"new\",\"width=600,height=400,resizable=1,scrollbars=1\");'></td>\n"; |
|
75 | -else $button .= "<td><input title='".$app_strings['LBL_SELECT_CONTACT_BUTTON_TITLE']."' type='button' class='button' value='".$app_strings['LBL_SELECT_CONTACT_BUTTON_LABEL']."' name='button' LANGUAGE=javascript onclick='window.open(\"index.php?module=Contacts&action=Popup&html=Popup_picker&form=DetailView&form_submit=true\",\"new\",\"width=600,height=400,resizable=1,scrollbars=1\");'></td>\n"; |
|
78 | +if ($focus->parent_type == "Accounts") { |
|
79 | + $button .= "<td><input title='".$app_strings['LBL_SELECT_CONTACT_BUTTON_TITLE']."' type='button' class='button' value='".$app_strings['LBL_SELECT_CONTACT_BUTTON_LABEL']."' name='button' LANGUAGE=javascript onclick='window.open(\"index.php?module=Contacts&action=Popup&html=Popup_picker&form=DetailView&form_submit=true&query=true&account_id=$focus->parent_id&account_name=".urlencode($focus->parent_name)."\",\"new\",\"width=600,height=400,resizable=1,scrollbars=1\");'></td>\n"; |
|
80 | +} else { |
|
81 | + $button .= "<td><input title='".$app_strings['LBL_SELECT_CONTACT_BUTTON_TITLE']."' type='button' class='button' value='".$app_strings['LBL_SELECT_CONTACT_BUTTON_LABEL']."' name='button' LANGUAGE=javascript onclick='window.open(\"index.php?module=Contacts&action=Popup&html=Popup_picker&form=DetailView&form_submit=true\",\"new\",\"width=600,height=400,resizable=1,scrollbars=1\");'></td>\n"; |
|
82 | +} |
|
76 | 83 | $button .= "<td><input title='".$app_strings['LBL_SELECT_USER_BUTTON_TITLE']."' type='button' class='button' value='".$app_strings['LBL_SELECT_USER_BUTTON_LABEL']."' name='button' LANGUAGE=javascript onclick='window.open(\"index.php?module=Users&action=Popup&html=Popup_picker&form=DetailView&form_submit=true\",\"new\",\"width=600,height=400,resizable=1,scrollbars=1\");'></td>\n"; |
77 | 84 | $button .= "</tr></form></table>\n"; |
78 | 85 | |
@@ -102,8 +109,7 @@ discard block |
||
102 | 109 | { |
103 | 110 | //todo move to themes |
104 | 111 | $xtpl->assign("ROW_COLOR", 'oddListRow'); |
105 | - } |
|
106 | - else |
|
112 | + } else |
|
107 | 113 | { |
108 | 114 | //todo move to themes |
109 | 115 | $xtpl->assign("ROW_COLOR", 'evenListRow'); |
@@ -135,8 +141,7 @@ discard block |
||
135 | 141 | { |
136 | 142 | //todo move to themes |
137 | 143 | $xtpl->assign("ROW_COLOR", 'oddListRow'); |
138 | - } |
|
139 | - else |
|
144 | + } else |
|
140 | 145 | { |
141 | 146 | //todo move to themes |
142 | 147 | $xtpl->assign("ROW_COLOR", 'evenListRow'); |
@@ -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. |
@@ -91,7 +93,9 @@ discard block |
||
91 | 93 | } |
92 | 94 | if(!empty($fields['DESCRIPTION'])) { |
93 | 95 | $overlib_string .= '<b>'. $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300); |
94 | - if(strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...'; |
|
96 | + if(strlen($fields['DESCRIPTION']) > 300) { |
|
97 | + $overlib_string .= '...'; |
|
98 | + } |
|
95 | 99 | $overlib_string .= '<br>'; |
96 | 100 | } |
97 | 101 | $overlib_string .= '<br>'; |