@@ -38,7 +38,7 @@ |
||
38 | 38 | return; |
39 | 39 | } |
40 | 40 | if (DIRECTORY_SEPARATOR == '\\') { |
41 | - $_win_from = array('%D', '%h', '%n', '%r', '%R', '%t', '%T'); |
|
41 | + $_win_from = array('%D', '%h', '%n', '%r', '%R', '%t', '%T'); |
|
42 | 42 | $_win_to = array('%m/%d/%y', '%b', "\n", '%I:%M:%S %p', '%H:%M', "\t", '%H:%M:%S'); |
43 | 43 | if (strpos($format, '%e') !== false) { |
44 | 44 | $_win_from[] = '%e'; |
@@ -72,15 +72,15 @@ |
||
72 | 72 | function smarty_function_sugar_help($params, &$smarty) |
73 | 73 | { |
74 | 74 | $text = str_replace("'","\'",htmlspecialchars($params['text'])); |
75 | - //append any additional parameters. |
|
76 | - $click = "return SUGAR.util.showHelpTips(this,'$text'"; |
|
75 | + //append any additional parameters. |
|
76 | + $click = "return SUGAR.util.showHelpTips(this,'$text'"; |
|
77 | 77 | |
78 | - if (count( $params) > 1){ |
|
78 | + if (count( $params) > 1){ |
|
79 | 79 | |
80 | - $click .=",'".$params['myPos']."','".$params['atPos']."'"; |
|
81 | - } |
|
80 | + $click .=",'".$params['myPos']."','".$params['atPos']."'"; |
|
81 | + } |
|
82 | 82 | $helpImage = SugarThemeRegistry::current()->getImageURL('helpInline.png'); |
83 | - $click .= " );" ; |
|
83 | + $click .= " );" ; |
|
84 | 84 | $alt_tag = $GLOBALS['app_strings']['LBL_ALT_INFO']; |
85 | 85 | return <<<EOHTML |
86 | 86 | <img border="0" |
@@ -71,16 +71,16 @@ |
||
71 | 71 | */ |
72 | 72 | function smarty_function_sugar_help($params, &$smarty) |
73 | 73 | { |
74 | - $text = str_replace("'","\'",htmlspecialchars($params['text'])); |
|
74 | + $text = str_replace("'", "\'", htmlspecialchars($params['text'])); |
|
75 | 75 | //append any additional parameters. |
76 | - $click = "return SUGAR.util.showHelpTips(this,'$text'"; |
|
76 | + $click = "return SUGAR.util.showHelpTips(this,'$text'"; |
|
77 | 77 | |
78 | - if (count( $params) > 1){ |
|
78 | + if (count($params) > 1) { |
|
79 | 79 | |
80 | - $click .=",'".$params['myPos']."','".$params['atPos']."'"; |
|
80 | + $click .= ",'".$params['myPos']."','".$params['atPos']."'"; |
|
81 | 81 | } |
82 | 82 | $helpImage = SugarThemeRegistry::current()->getImageURL('helpInline.png'); |
83 | - $click .= " );" ; |
|
83 | + $click .= " );"; |
|
84 | 84 | $alt_tag = $GLOBALS['app_strings']['LBL_ALT_INFO']; |
85 | 85 | return <<<EOHTML |
86 | 86 | <img border="0" |
@@ -207,8 +207,8 @@ |
||
207 | 207 | * @return String representing date value |
208 | 208 | */ |
209 | 209 | function smarty_modifier_default_date_value($defaultValue) { |
210 | - global $timedate; |
|
211 | - require_once('modules/DynamicFields/templates/Fields/TemplateDate.php'); |
|
212 | - $td = new TemplateDate(); |
|
213 | - return $timedate->asUser(new SugarDateTime($td->dateStrings[$defaultValue])); |
|
210 | + global $timedate; |
|
211 | + require_once('modules/DynamicFields/templates/Fields/TemplateDate.php'); |
|
212 | + $td = new TemplateDate(); |
|
213 | + return $timedate->asUser(new SugarDateTime($td->dateStrings[$defaultValue])); |
|
214 | 214 | } |
@@ -150,7 +150,7 @@ |
||
150 | 150 | */ |
151 | 151 | |
152 | 152 | |
153 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
153 | +if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
154 | 154 | /********************************************************************************* |
155 | 155 | * SugarCRM Community Edition is a customer relationship management program developed by |
156 | 156 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -43,7 +43,9 @@ |
||
43 | 43 | */ |
44 | 44 | |
45 | 45 | |
46 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
46 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
47 | + die('Not A Valid Entry Point'); |
|
48 | +} |
|
47 | 49 | /********************************************************************************* |
48 | 50 | * SugarCRM Community Edition is a customer relationship management program developed by |
49 | 51 | * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc. |
@@ -45,9 +45,9 @@ |
||
45 | 45 | */ |
46 | 46 | function smarty_function_sugar_getwebpath($params, &$smarty) |
47 | 47 | { |
48 | - if(!isset($params['file'])) { |
|
49 | - $smarty->trigger_error($GLOBALS['app_strings']['ERR_MISSING_REQUIRED_FIELDS'] . 'file'); |
|
50 | - } |
|
51 | - return getWebPath($params['file']); |
|
48 | + if(!isset($params['file'])) { |
|
49 | + $smarty->trigger_error($GLOBALS['app_strings']['ERR_MISSING_REQUIRED_FIELDS'] . 'file'); |
|
50 | + } |
|
51 | + return getWebPath($params['file']); |
|
52 | 52 | } |
53 | 53 | ?> |
54 | 54 | \ No newline at end of file |
@@ -45,8 +45,8 @@ |
||
45 | 45 | */ |
46 | 46 | function smarty_function_sugar_getwebpath($params, &$smarty) |
47 | 47 | { |
48 | - if(!isset($params['file'])) { |
|
49 | - $smarty->trigger_error($GLOBALS['app_strings']['ERR_MISSING_REQUIRED_FIELDS'] . 'file'); |
|
48 | + if (!isset($params['file'])) { |
|
49 | + $smarty->trigger_error($GLOBALS['app_strings']['ERR_MISSING_REQUIRED_FIELDS'].'file'); |
|
50 | 50 | } |
51 | 51 | return getWebPath($params['file']); |
52 | 52 | } |
@@ -46,21 +46,21 @@ |
||
46 | 46 | function smarty_function_sugar_variable_constructor($params, &$smarty) |
47 | 47 | { |
48 | 48 | if (!isset($params['objectName']) || !isset($params['memberName']) || !isset($params['key'])) { |
49 | - if(!isset($params['objectName'])) |
|
49 | + if (!isset($params['objectName'])) |
|
50 | 50 | $smarty->trigger_error("sugar_variable_constructor: missing 'objectName' parameter"); |
51 | - if(!isset($params['memberName'])) |
|
51 | + if (!isset($params['memberName'])) |
|
52 | 52 | $smarty->trigger_error("sugar_variable_constructor: missing 'memberName' parameter"); |
53 | - if(!isset($params['key'])) |
|
53 | + if (!isset($params['key'])) |
|
54 | 54 | $smarty->trigger_error("sugar_variable_constructor: missing 'key' parameter"); |
55 | 55 | |
56 | 56 | return; |
57 | 57 | } |
58 | 58 | |
59 | - if(isset($params['stringFormat'])) { |
|
60 | - $_contents = '$'. $params['objectName'] . '.' . $params['memberName'] . '.' . $params['key']; |
|
59 | + if (isset($params['stringFormat'])) { |
|
60 | + $_contents = '$'.$params['objectName'].'.'.$params['memberName'].'.'.$params['key']; |
|
61 | 61 | } |
62 | 62 | else { |
63 | - $_contents = '{$' . $params['objectName'] . '.' . $params['memberName'] . '.' . $params['key'] . '}'; |
|
63 | + $_contents = '{$'.$params['objectName'].'.'.$params['memberName'].'.'.$params['key'].'}'; |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | return $_contents; |
@@ -46,20 +46,22 @@ |
||
46 | 46 | function smarty_function_sugar_variable_constructor($params, &$smarty) |
47 | 47 | { |
48 | 48 | if (!isset($params['objectName']) || !isset($params['memberName']) || !isset($params['key'])) { |
49 | - if(!isset($params['objectName'])) |
|
50 | - $smarty->trigger_error("sugar_variable_constructor: missing 'objectName' parameter"); |
|
51 | - if(!isset($params['memberName'])) |
|
52 | - $smarty->trigger_error("sugar_variable_constructor: missing 'memberName' parameter"); |
|
53 | - if(!isset($params['key'])) |
|
54 | - $smarty->trigger_error("sugar_variable_constructor: missing 'key' parameter"); |
|
49 | + if(!isset($params['objectName'])) { |
|
50 | + $smarty->trigger_error("sugar_variable_constructor: missing 'objectName' parameter"); |
|
51 | + } |
|
52 | + if(!isset($params['memberName'])) { |
|
53 | + $smarty->trigger_error("sugar_variable_constructor: missing 'memberName' parameter"); |
|
54 | + } |
|
55 | + if(!isset($params['key'])) { |
|
56 | + $smarty->trigger_error("sugar_variable_constructor: missing 'key' parameter"); |
|
57 | + } |
|
55 | 58 | |
56 | 59 | return; |
57 | 60 | } |
58 | 61 | |
59 | 62 | if(isset($params['stringFormat'])) { |
60 | 63 | $_contents = '$'. $params['objectName'] . '.' . $params['memberName'] . '.' . $params['key']; |
61 | - } |
|
62 | - else { |
|
64 | + } else { |
|
63 | 65 | $_contents = '{$' . $params['objectName'] . '.' . $params['memberName'] . '.' . $params['key'] . '}'; |
64 | 66 | } |
65 | 67 |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | // netscape and mozilla do not decode %40 (@) in BCC field (bug?) |
64 | 64 | // so, don't encode it. |
65 | 65 | $search = array('%40', '%2C'); |
66 | - $replace = array('@', ','); |
|
66 | + $replace = array('@', ','); |
|
67 | 67 | $mail_parms = array(); |
68 | 68 | foreach ($params as $var=>$value) { |
69 | 69 | switch ($var) { |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | case 'bcc': |
72 | 72 | case 'followupto': |
73 | 73 | if (!empty($value)) |
74 | - $mail_parms[] = $var.'='.str_replace($search,$replace,rawurlencode($value)); |
|
74 | + $mail_parms[] = $var.'='.str_replace($search, $replace, rawurlencode($value)); |
|
75 | 75 | break; |
76 | 76 | |
77 | 77 | case 'subject': |
@@ -88,39 +88,39 @@ discard block |
||
88 | 88 | } |
89 | 89 | |
90 | 90 | $mail_parm_vals = ''; |
91 | - for ($i=0; $i<count($mail_parms); $i++) { |
|
92 | - $mail_parm_vals .= (0==$i) ? '?' : '&'; |
|
91 | + for ($i = 0; $i < count($mail_parms); $i++) { |
|
92 | + $mail_parm_vals .= (0 == $i) ? '?' : '&'; |
|
93 | 93 | $mail_parm_vals .= $mail_parms[$i]; |
94 | 94 | } |
95 | 95 | $address .= $mail_parm_vals; |
96 | 96 | |
97 | 97 | $encode = (empty($params['encode'])) ? 'none' : $params['encode']; |
98 | - if (!in_array($encode,array('javascript','javascript_charcode','hex','none')) ) { |
|
98 | + if (!in_array($encode, array('javascript', 'javascript_charcode', 'hex', 'none'))) { |
|
99 | 99 | $smarty->trigger_error("mailto: 'encode' parameter must be none, javascript or hex"); |
100 | 100 | return; |
101 | 101 | } |
102 | 102 | |
103 | - if ($encode == 'javascript' ) { |
|
103 | + if ($encode == 'javascript') { |
|
104 | 104 | $string = 'document.write(\'<a href="mailto:'.$address.'" '.$extra.'>'.$text.'</a>\');'; |
105 | 105 | |
106 | 106 | $js_encode = ''; |
107 | - for ($x=0; $x < strlen($string); $x++) { |
|
108 | - $js_encode .= '%' . bin2hex($string[$x]); |
|
107 | + for ($x = 0; $x < strlen($string); $x++) { |
|
108 | + $js_encode .= '%'.bin2hex($string[$x]); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | return '<script type="text/javascript">eval(unescape(\''.$js_encode.'\'))</script>'; |
112 | 112 | |
113 | - } elseif ($encode == 'javascript_charcode' ) { |
|
113 | + } elseif ($encode == 'javascript_charcode') { |
|
114 | 114 | $string = '<a href="mailto:'.$address.'" '.$extra.'>'.$text.'</a>'; |
115 | 115 | |
116 | - for($x = 0, $y = strlen($string); $x < $y; $x++ ) { |
|
116 | + for ($x = 0, $y = strlen($string); $x < $y; $x++) { |
|
117 | 117 | $ord[] = ord($string[$x]); |
118 | 118 | } |
119 | 119 | |
120 | 120 | $_ret = "<script type=\"text/javascript\" language=\"javascript\">\n"; |
121 | 121 | $_ret .= "<!--\n"; |
122 | 122 | $_ret .= "{document.write(String.fromCharCode("; |
123 | - $_ret .= implode(',',$ord); |
|
123 | + $_ret .= implode(',', $ord); |
|
124 | 124 | $_ret .= "))"; |
125 | 125 | $_ret .= "}\n"; |
126 | 126 | $_ret .= "//-->\n"; |
@@ -131,22 +131,22 @@ discard block |
||
131 | 131 | |
132 | 132 | } elseif ($encode == 'hex') { |
133 | 133 | |
134 | - preg_match('!^(.*)(\?.*)$!',$address,$match); |
|
135 | - if(!empty($match[2])) { |
|
134 | + preg_match('!^(.*)(\?.*)$!', $address, $match); |
|
135 | + if (!empty($match[2])) { |
|
136 | 136 | $smarty->trigger_error("mailto: hex encoding does not work with extra attributes. Try javascript."); |
137 | 137 | return; |
138 | 138 | } |
139 | 139 | $address_encode = ''; |
140 | - for ($x=0; $x < strlen($address); $x++) { |
|
141 | - if(preg_match('!\w!',$address[$x])) { |
|
142 | - $address_encode .= '%' . bin2hex($address[$x]); |
|
140 | + for ($x = 0; $x < strlen($address); $x++) { |
|
141 | + if (preg_match('!\w!', $address[$x])) { |
|
142 | + $address_encode .= '%'.bin2hex($address[$x]); |
|
143 | 143 | } else { |
144 | 144 | $address_encode .= $address[$x]; |
145 | 145 | } |
146 | 146 | } |
147 | 147 | $text_encode = ''; |
148 | - for ($x=0; $x < strlen($text); $x++) { |
|
149 | - $text_encode .= '&#x' . bin2hex($text[$x]).';'; |
|
148 | + for ($x = 0; $x < strlen($text); $x++) { |
|
149 | + $text_encode .= '&#x'.bin2hex($text[$x]).';'; |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | $mailto = "mailto:"; |
@@ -70,8 +70,9 @@ |
||
70 | 70 | case 'cc': |
71 | 71 | case 'bcc': |
72 | 72 | case 'followupto': |
73 | - if (!empty($value)) |
|
74 | - $mail_parms[] = $var.'='.str_replace($search,$replace,rawurlencode($value)); |
|
73 | + if (!empty($value)) { |
|
74 | + $mail_parms[] = $var.'='.str_replace($search,$replace,rawurlencode($value)); |
|
75 | + } |
|
75 | 76 | break; |
76 | 77 | |
77 | 78 | case 'subject': |
@@ -21,7 +21,7 @@ |
||
21 | 21 | function smarty_modifier_count_words($string) |
22 | 22 | { |
23 | 23 | // split text by ' ',\r,\n,\f,\t |
24 | - $split_array = preg_split('/\s+/',$string); |
|
24 | + $split_array = preg_split('/\s+/', $string); |
|
25 | 25 | // count matches that contain alphanumerics |
26 | 26 | $word_count = preg_grep('/[a-zA-Z0-9\\x80-\\xff]/', $split_array); |
27 | 27 |
@@ -100,10 +100,10 @@ discard block |
||
100 | 100 | } |
101 | 101 | $html_result .= '>'."\n"; |
102 | 102 | $html_result .= smarty_function_html_options(array('output' => $hours, |
103 | - 'values' => $hours, |
|
104 | - 'selected' => strftime($hour_fmt, $time), |
|
105 | - 'print_result' => false), |
|
106 | - $smarty); |
|
103 | + 'values' => $hours, |
|
104 | + 'selected' => strftime($hour_fmt, $time), |
|
105 | + 'print_result' => false), |
|
106 | + $smarty); |
|
107 | 107 | $html_result .= "</select>\n"; |
108 | 108 | } |
109 | 109 | |
@@ -127,10 +127,10 @@ discard block |
||
127 | 127 | $html_result .= '>'."\n"; |
128 | 128 | |
129 | 129 | $html_result .= smarty_function_html_options(array('output' => $minutes, |
130 | - 'values' => $minutes, |
|
131 | - 'selected' => $selected, |
|
132 | - 'print_result' => false), |
|
133 | - $smarty); |
|
130 | + 'values' => $minutes, |
|
131 | + 'selected' => $selected, |
|
132 | + 'print_result' => false), |
|
133 | + $smarty); |
|
134 | 134 | $html_result .= "</select>\n"; |
135 | 135 | } |
136 | 136 | |
@@ -155,10 +155,10 @@ discard block |
||
155 | 155 | $html_result .= '>'."\n"; |
156 | 156 | |
157 | 157 | $html_result .= smarty_function_html_options(array('output' => $seconds, |
158 | - 'values' => $seconds, |
|
159 | - 'selected' => $selected, |
|
160 | - 'print_result' => false), |
|
161 | - $smarty); |
|
158 | + 'values' => $seconds, |
|
159 | + 'selected' => $selected, |
|
160 | + 'print_result' => false), |
|
161 | + $smarty); |
|
162 | 162 | $html_result .= "</select>\n"; |
163 | 163 | } |
164 | 164 | |
@@ -179,10 +179,10 @@ discard block |
||
179 | 179 | $html_result .= '>'."\n"; |
180 | 180 | |
181 | 181 | $html_result .= smarty_function_html_options(array('output' => array('AM', 'PM'), |
182 | - 'values' => array('am', 'pm'), |
|
183 | - 'selected' => strtolower(strftime('%p', $time)), |
|
184 | - 'print_result' => false), |
|
185 | - $smarty); |
|
182 | + 'values' => array('am', 'pm'), |
|
183 | + 'selected' => strtolower(strftime('%p', $time)), |
|
184 | + 'print_result' => false), |
|
185 | + $smarty); |
|
186 | 186 | $html_result .= "</select>\n"; |
187 | 187 | } |
188 | 188 |
@@ -23,8 +23,8 @@ discard block |
||
23 | 23 | */ |
24 | 24 | function smarty_function_html_select_time($params, &$smarty) |
25 | 25 | { |
26 | - require_once $smarty->_get_plugin_filepath('shared','make_timestamp'); |
|
27 | - require_once $smarty->_get_plugin_filepath('function','html_options'); |
|
26 | + require_once $smarty->_get_plugin_filepath('shared', 'make_timestamp'); |
|
27 | + require_once $smarty->_get_plugin_filepath('function', 'html_options'); |
|
28 | 28 | /* Default values. */ |
29 | 29 | $prefix = "Time_"; |
30 | 30 | $time = time(); |
@@ -82,21 +82,21 @@ discard block |
||
82 | 82 | $html_result = ''; |
83 | 83 | |
84 | 84 | if ($display_hours) { |
85 | - $hours = $use_24_hours ? range(0, 23) : range(1, 12); |
|
85 | + $hours = $use_24_hours ? range(0, 23) : range(1, 12); |
|
86 | 86 | $hour_fmt = $use_24_hours ? '%H' : '%I'; |
87 | 87 | for ($i = 0, $for_max = count($hours); $i < $for_max; $i++) |
88 | 88 | $hours[$i] = sprintf('%02d', $hours[$i]); |
89 | 89 | $html_result .= '<select name='; |
90 | 90 | if (null !== $field_array) { |
91 | - $html_result .= '"' . $field_array . '[' . $prefix . 'Hour]"'; |
|
91 | + $html_result .= '"'.$field_array.'['.$prefix.'Hour]"'; |
|
92 | 92 | } else { |
93 | - $html_result .= '"' . $prefix . 'Hour"'; |
|
93 | + $html_result .= '"'.$prefix.'Hour"'; |
|
94 | 94 | } |
95 | - if (null !== $hour_extra){ |
|
96 | - $html_result .= ' ' . $hour_extra; |
|
95 | + if (null !== $hour_extra) { |
|
96 | + $html_result .= ' '.$hour_extra; |
|
97 | 97 | } |
98 | - if (null !== $all_extra){ |
|
99 | - $html_result .= ' ' . $all_extra; |
|
98 | + if (null !== $all_extra) { |
|
99 | + $html_result .= ' '.$all_extra; |
|
100 | 100 | } |
101 | 101 | $html_result .= '>'."\n"; |
102 | 102 | $html_result .= smarty_function_html_options(array('output' => $hours, |
@@ -109,20 +109,20 @@ discard block |
||
109 | 109 | |
110 | 110 | if ($display_minutes) { |
111 | 111 | $all_minutes = range(0, 59); |
112 | - for ($i = 0, $for_max = count($all_minutes); $i < $for_max; $i+= $minute_interval) |
|
112 | + for ($i = 0, $for_max = count($all_minutes); $i < $for_max; $i += $minute_interval) |
|
113 | 113 | $minutes[] = sprintf('%02d', $all_minutes[$i]); |
114 | 114 | $selected = intval(floor(strftime('%M', $time) / $minute_interval) * $minute_interval); |
115 | 115 | $html_result .= '<select name='; |
116 | 116 | if (null !== $field_array) { |
117 | - $html_result .= '"' . $field_array . '[' . $prefix . 'Minute]"'; |
|
117 | + $html_result .= '"'.$field_array.'['.$prefix.'Minute]"'; |
|
118 | 118 | } else { |
119 | - $html_result .= '"' . $prefix . 'Minute"'; |
|
119 | + $html_result .= '"'.$prefix.'Minute"'; |
|
120 | 120 | } |
121 | - if (null !== $minute_extra){ |
|
122 | - $html_result .= ' ' . $minute_extra; |
|
121 | + if (null !== $minute_extra) { |
|
122 | + $html_result .= ' '.$minute_extra; |
|
123 | 123 | } |
124 | - if (null !== $all_extra){ |
|
125 | - $html_result .= ' ' . $all_extra; |
|
124 | + if (null !== $all_extra) { |
|
125 | + $html_result .= ' '.$all_extra; |
|
126 | 126 | } |
127 | 127 | $html_result .= '>'."\n"; |
128 | 128 | |
@@ -136,21 +136,21 @@ discard block |
||
136 | 136 | |
137 | 137 | if ($display_seconds) { |
138 | 138 | $all_seconds = range(0, 59); |
139 | - for ($i = 0, $for_max = count($all_seconds); $i < $for_max; $i+= $second_interval) |
|
139 | + for ($i = 0, $for_max = count($all_seconds); $i < $for_max; $i += $second_interval) |
|
140 | 140 | $seconds[] = sprintf('%02d', $all_seconds[$i]); |
141 | 141 | $selected = intval(floor(strftime('%S', $time) / $second_interval) * $second_interval); |
142 | 142 | $html_result .= '<select name='; |
143 | 143 | if (null !== $field_array) { |
144 | - $html_result .= '"' . $field_array . '[' . $prefix . 'Second]"'; |
|
144 | + $html_result .= '"'.$field_array.'['.$prefix.'Second]"'; |
|
145 | 145 | } else { |
146 | - $html_result .= '"' . $prefix . 'Second"'; |
|
146 | + $html_result .= '"'.$prefix.'Second"'; |
|
147 | 147 | } |
148 | 148 | |
149 | - if (null !== $second_extra){ |
|
150 | - $html_result .= ' ' . $second_extra; |
|
149 | + if (null !== $second_extra) { |
|
150 | + $html_result .= ' '.$second_extra; |
|
151 | 151 | } |
152 | - if (null !== $all_extra){ |
|
153 | - $html_result .= ' ' . $all_extra; |
|
152 | + if (null !== $all_extra) { |
|
153 | + $html_result .= ' '.$all_extra; |
|
154 | 154 | } |
155 | 155 | $html_result .= '>'."\n"; |
156 | 156 | |
@@ -165,16 +165,16 @@ discard block |
||
165 | 165 | if ($display_meridian && !$use_24_hours) { |
166 | 166 | $html_result .= '<select name='; |
167 | 167 | if (null !== $field_array) { |
168 | - $html_result .= '"' . $field_array . '[' . $prefix . 'Meridian]"'; |
|
168 | + $html_result .= '"'.$field_array.'['.$prefix.'Meridian]"'; |
|
169 | 169 | } else { |
170 | - $html_result .= '"' . $prefix . 'Meridian"'; |
|
170 | + $html_result .= '"'.$prefix.'Meridian"'; |
|
171 | 171 | } |
172 | 172 | |
173 | - if (null !== $meridian_extra){ |
|
174 | - $html_result .= ' ' . $meridian_extra; |
|
173 | + if (null !== $meridian_extra) { |
|
174 | + $html_result .= ' '.$meridian_extra; |
|
175 | 175 | } |
176 | - if (null !== $all_extra){ |
|
177 | - $html_result .= ' ' . $all_extra; |
|
176 | + if (null !== $all_extra) { |
|
177 | + $html_result .= ' '.$all_extra; |
|
178 | 178 | } |
179 | 179 | $html_result .= '>'."\n"; |
180 | 180 |
@@ -84,8 +84,9 @@ discard block |
||
84 | 84 | if ($display_hours) { |
85 | 85 | $hours = $use_24_hours ? range(0, 23) : range(1, 12); |
86 | 86 | $hour_fmt = $use_24_hours ? '%H' : '%I'; |
87 | - for ($i = 0, $for_max = count($hours); $i < $for_max; $i++) |
|
88 | - $hours[$i] = sprintf('%02d', $hours[$i]); |
|
87 | + for ($i = 0, $for_max = count($hours); $i < $for_max; $i++) { |
|
88 | + $hours[$i] = sprintf('%02d', $hours[$i]); |
|
89 | + } |
|
89 | 90 | $html_result .= '<select name='; |
90 | 91 | if (null !== $field_array) { |
91 | 92 | $html_result .= '"' . $field_array . '[' . $prefix . 'Hour]"'; |
@@ -109,8 +110,9 @@ discard block |
||
109 | 110 | |
110 | 111 | if ($display_minutes) { |
111 | 112 | $all_minutes = range(0, 59); |
112 | - for ($i = 0, $for_max = count($all_minutes); $i < $for_max; $i+= $minute_interval) |
|
113 | - $minutes[] = sprintf('%02d', $all_minutes[$i]); |
|
113 | + for ($i = 0, $for_max = count($all_minutes); $i < $for_max; $i+= $minute_interval) { |
|
114 | + $minutes[] = sprintf('%02d', $all_minutes[$i]); |
|
115 | + } |
|
114 | 116 | $selected = intval(floor(strftime('%M', $time) / $minute_interval) * $minute_interval); |
115 | 117 | $html_result .= '<select name='; |
116 | 118 | if (null !== $field_array) { |
@@ -136,8 +138,9 @@ discard block |
||
136 | 138 | |
137 | 139 | if ($display_seconds) { |
138 | 140 | $all_seconds = range(0, 59); |
139 | - for ($i = 0, $for_max = count($all_seconds); $i < $for_max; $i+= $second_interval) |
|
140 | - $seconds[] = sprintf('%02d', $all_seconds[$i]); |
|
141 | + for ($i = 0, $for_max = count($all_seconds); $i < $for_max; $i+= $second_interval) { |
|
142 | + $seconds[] = sprintf('%02d', $all_seconds[$i]); |
|
143 | + } |
|
141 | 144 | $selected = intval(floor(strftime('%S', $time) / $second_interval) * $second_interval); |
142 | 145 | $html_result .= '<select name='; |
143 | 146 | if (null !== $field_array) { |
@@ -41,29 +41,29 @@ |
||
41 | 41 | |
42 | 42 | |
43 | 43 | function smarty_modifier_multienum_to_ac($value='', $field_options=array()){ |
44 | - $value = trim($value); |
|
45 | - if(empty($value) || empty($field_options)){ |
|
46 | - return ''; |
|
47 | - } |
|
44 | + $value = trim($value); |
|
45 | + if(empty($value) || empty($field_options)){ |
|
46 | + return ''; |
|
47 | + } |
|
48 | 48 | |
49 | - $expl = explode("^,^", $value); |
|
50 | - if(count($expl) == 1){ |
|
51 | - if(array_key_exists($value, $field_options)){ |
|
52 | - return $field_options[$value] . ", "; |
|
53 | - } |
|
54 | - else{ |
|
55 | - return ''; |
|
56 | - } |
|
57 | - } |
|
58 | - else{ |
|
59 | - $final_array = array(); |
|
60 | - foreach($expl as $key_val){ |
|
61 | - if(array_key_exists($key_val, $field_options)){ |
|
62 | - $final_array[] = $field_options[$key_val]; |
|
63 | - } |
|
64 | - } |
|
65 | - return implode(", ", $final_array) . ", "; |
|
66 | - } |
|
49 | + $expl = explode("^,^", $value); |
|
50 | + if(count($expl) == 1){ |
|
51 | + if(array_key_exists($value, $field_options)){ |
|
52 | + return $field_options[$value] . ", "; |
|
53 | + } |
|
54 | + else{ |
|
55 | + return ''; |
|
56 | + } |
|
57 | + } |
|
58 | + else{ |
|
59 | + $final_array = array(); |
|
60 | + foreach($expl as $key_val){ |
|
61 | + if(array_key_exists($key_val, $field_options)){ |
|
62 | + $final_array[] = $field_options[$key_val]; |
|
63 | + } |
|
64 | + } |
|
65 | + return implode(", ", $final_array) . ", "; |
|
66 | + } |
|
67 | 67 | |
68 | - return ''; |
|
68 | + return ''; |
|
69 | 69 | } |
@@ -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. |
@@ -40,29 +40,29 @@ discard block |
||
40 | 40 | |
41 | 41 | |
42 | 42 | |
43 | -function smarty_modifier_multienum_to_ac($value='', $field_options=array()){ |
|
43 | +function smarty_modifier_multienum_to_ac($value = '', $field_options = array()) { |
|
44 | 44 | $value = trim($value); |
45 | - if(empty($value) || empty($field_options)){ |
|
45 | + if (empty($value) || empty($field_options)) { |
|
46 | 46 | return ''; |
47 | 47 | } |
48 | 48 | |
49 | 49 | $expl = explode("^,^", $value); |
50 | - if(count($expl) == 1){ |
|
51 | - if(array_key_exists($value, $field_options)){ |
|
52 | - return $field_options[$value] . ", "; |
|
50 | + if (count($expl) == 1) { |
|
51 | + if (array_key_exists($value, $field_options)) { |
|
52 | + return $field_options[$value].", "; |
|
53 | 53 | } |
54 | - else{ |
|
54 | + else { |
|
55 | 55 | return ''; |
56 | 56 | } |
57 | 57 | } |
58 | - else{ |
|
58 | + else { |
|
59 | 59 | $final_array = array(); |
60 | - foreach($expl as $key_val){ |
|
61 | - if(array_key_exists($key_val, $field_options)){ |
|
60 | + foreach ($expl as $key_val) { |
|
61 | + if (array_key_exists($key_val, $field_options)) { |
|
62 | 62 | $final_array[] = $field_options[$key_val]; |
63 | 63 | } |
64 | 64 | } |
65 | - return implode(", ", $final_array) . ", "; |
|
65 | + return implode(", ", $final_array).", "; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | return ''; |
@@ -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. |
@@ -50,12 +52,10 @@ discard block |
||
50 | 52 | if(count($expl) == 1){ |
51 | 53 | if(array_key_exists($value, $field_options)){ |
52 | 54 | return $field_options[$value] . ", "; |
53 | - } |
|
54 | - else{ |
|
55 | + } else{ |
|
55 | 56 | return ''; |
56 | 57 | } |
57 | - } |
|
58 | - else{ |
|
58 | + } else{ |
|
59 | 59 | $final_array = array(); |
60 | 60 | foreach($expl as $key_val){ |
61 | 61 | if(array_key_exists($key_val, $field_options)){ |