Completed
Push — console-installer ( 3d54e5...e2b50d )
by Adam
69:10 queued 48:24
created
include/Smarty/plugins/function.sugar_field.php 1 patch
Braces   +30 added lines, -14 removed lines patch added patch discarded remove patch
@@ -55,31 +55,47 @@
 block discarded – undo
55 55
 function smarty_function_sugar_field($params, &$smarty)
56 56
 {
57 57
     if (!isset($params['vardef']) || !isset($params['displayType']) || !isset($params['parentFieldArray'])) {
58
-        if(!isset($params['vardef']))
59
-            $smarty->trigger_error("sugar_field: missing 'vardef' parameter");
60
-        if(!isset($params['displayType']))  
61
-            $smarty->trigger_error("sugar_field: missing 'displayType' parameter");
62
-        if(!isset($params['parentFieldArray']))  
63
-            $smarty->trigger_error("sugar_field: missing 'parentFieldArray' parameter");
58
+        if(!isset($params['vardef'])) {
59
+                    $smarty->trigger_error("sugar_field: missing 'vardef' parameter");
60
+        }
61
+        if(!isset($params['displayType'])) {
62
+                    $smarty->trigger_error("sugar_field: missing 'displayType' parameter");
63
+        }
64
+        if(!isset($params['parentFieldArray'])) {
65
+                    $smarty->trigger_error("sugar_field: missing 'parentFieldArray' parameter");
66
+        }
64 67
                              
65 68
         return;
66 69
     }
67 70
 
68 71
     static $sfh;
69
-    if(!isset($sfh)) $sfh = new SugarFieldHandler();
72
+    if(!isset($sfh)) {
73
+        $sfh = new SugarFieldHandler();
74
+    }
70 75
     
71
-    if(!isset($params['displayParams'])) $displayParams = array();
72
-    else $displayParams = $params['displayParams'];
76
+    if(!isset($params['displayParams'])) {
77
+        $displayParams = array();
78
+    } else {
79
+        $displayParams = $params['displayParams'];
80
+    }
73 81
     
74
-    if(isset($params['labelSpan'])) $displayParams['labelSpan'] = $params['labelSpan'];
75
-    else $displayParams['labelSpan'] = null;
76
-    if(isset($params['fieldSpan'])) $displayParams['fieldSpan'] = $params['fieldSpan'];
77
-    else $displayParams['fieldSpan'] = null;
82
+    if(isset($params['labelSpan'])) {
83
+        $displayParams['labelSpan'] = $params['labelSpan'];
84
+    } else {
85
+        $displayParams['labelSpan'] = null;
86
+    }
87
+    if(isset($params['fieldSpan'])) {
88
+        $displayParams['fieldSpan'] = $params['fieldSpan'];
89
+    } else {
90
+        $displayParams['fieldSpan'] = null;
91
+    }
78 92
 
79 93
     if(isset($params['typeOverride'])) { // override the type in the vardef?
80 94
         $params['vardef']['type'] = $params['typeOverride']; 
81 95
     }
82
-    if(isset($params['formName'])) $displayParams['formName'] = $params['formName'];
96
+    if(isset($params['formName'])) {
97
+        $displayParams['formName'] = $params['formName'];
98
+    }
83 99
     
84 100
     if(isset($params['field'])) {
85 101
         $params['vardef']['name'] = $params['field'];
Please login to merge, or discard this patch.
include/Smarty/plugins/function.sugar_variable_constructor.php 1 patch
Braces   +10 added lines, -8 removed lines patch added patch discarded remove patch
@@ -46,20 +46,22 @@
 block discarded – undo
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
     
Please login to merge, or discard this patch.
include/Smarty/plugins/function.mailto.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -70,8 +70,9 @@
 block discarded – undo
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':
Please login to merge, or discard this patch.
include/Smarty/plugins/function.html_select_time.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -84,8 +84,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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) {
Please login to merge, or discard this patch.
include/Smarty/plugins/modifier.multienum_to_ac.php 1 patch
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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)){
Please login to merge, or discard this patch.
include/Smarty/plugins/function.sugar_link.php 1 patch
Braces   +11 added lines, -8 removed lines patch added patch discarded remove patch
@@ -33,7 +33,9 @@  discard block
 block discarded – undo
33 33
 */
34 34
 
35 35
 
36
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
36
+if(!defined('sugarEntry') || !sugarEntry) {
37
+    die('Not A Valid Entry Point');
38
+}
37 39
 /*********************************************************************************
38 40
  * SugarCRM Community Edition is a customer relationship management program developed by
39 41
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -85,7 +87,7 @@  discard block
 block discarded – undo
85 87
 		$link_url .= 'module=iFrames&action=index';
86 88
 		$link_url .= '&record='.$params['data']['0'];
87 89
 		$link_url .= '&tab=true';
88
-    }else{
90
+    } else{
89 91
 		$action = (!empty($params['action']))?$params['action']:'index';
90 92
 	    
91 93
 	    $link_url = 'index.php?';
@@ -107,12 +109,13 @@  discard block
 block discarded – undo
107 109
     $module = ' module="'.$params['module'].'"';
108 110
 	$accesskey = (!empty($params['accesskey']))?' accesskey="'.$params['accesskey'].'" ':'';
109 111
     $options = (!empty($params['options']))?' '.$params['options'].'':'';
110
-    if(!empty($params['data']) && is_array($params['data']))
111
-		$label =$params['data']['4'];
112
-	elseif ( !empty($params['label']) )
113
-	    $label = $params['label'];
114
-	else
115
-	    $label = (!empty($GLOBALS['app_list_strings']['moduleList'][$params['module']]))?$GLOBALS['app_list_strings']['moduleList'][$params['module']]:$params['module'];
112
+    if(!empty($params['data']) && is_array($params['data'])) {
113
+    		$label =$params['data']['4'];
114
+    } elseif ( !empty($params['label']) ) {
115
+		    $label = $params['label'];
116
+	} else {
117
+		    $label = (!empty($GLOBALS['app_list_strings']['moduleList'][$params['module']]))?$GLOBALS['app_list_strings']['moduleList'][$params['module']]:$params['module'];
118
+	}
116 119
 
117 120
     $link = '<a href="'.ajaxLink($link_url).'"'.$id.$class.$style.$options.$title.$module.'>'.$label.'</a>';
118 121
     return $link;
Please login to merge, or discard this patch.
include/Smarty/plugins/modifier.regex_replace.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,8 +23,9 @@  discard block
 block discarded – undo
23 23
 function smarty_modifier_regex_replace($string, $search, $replace)
24 24
 {
25 25
     if(is_array($search)) {
26
-      foreach($search as $idx => $s)
27
-        $search[$idx] = _smarty_regex_replace_check($s);
26
+      foreach($search as $idx => $s) {
27
+              $search[$idx] = _smarty_regex_replace_check($s);
28
+      }
28 29
     } else {
29 30
       $search = _smarty_regex_replace_check($search);
30 31
     }       
@@ -34,8 +35,9 @@  discard block
 block discarded – undo
34 35
 
35 36
 function _smarty_regex_replace_check($search)
36 37
 {
37
-    if (($pos = strpos($search,"\0")) !== false)
38
-      $search = substr($search,0,$pos);
38
+    if (($pos = strpos($search,"\0")) !== false) {
39
+          $search = substr($search,0,$pos);
40
+    }
39 41
     if (preg_match('!([a-zA-Z\s]+)$!s', $search, $match) && (strpos($match[1], 'e') !== false)) {
40 42
         /* remove eval-modifier from $search */
41 43
         $search = substr($search, 0, -strlen($match[1])) . preg_replace('![e\s]+!', '', $match[1]);
Please login to merge, or discard this patch.
include/Smarty/plugins/modifier.strip_tags.php 1 patch
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -21,11 +21,12 @@
 block discarded – undo
21 21
  */
22 22
 function smarty_modifier_strip_tags($string, $replace_with_space = true)
23 23
 {
24
-    if ($replace_with_space)
25
-        return preg_replace('!<[^>]*?>!', ' ', $string);
26
-    else
27
-        return strip_tags($string);
28
-}
24
+    if ($replace_with_space) {
25
+            return preg_replace('!<[^>]*?>!', ' ', $string);
26
+    } else {
27
+            return strip_tags($string);
28
+    }
29
+    }
29 30
 
30 31
 /* vim: set expandtab: */
31 32
 
Please login to merge, or discard this patch.
include/Smarty/plugins/function.sugar_getlink.php 1 patch
Braces   +27 added lines, -18 removed lines patch added patch discarded remove patch
@@ -52,26 +52,35 @@
 block discarded – undo
52 52
 function smarty_function_sugar_getlink($params, &$smarty) {
53 53
 
54 54
 	// error checking for required parameters
55
-	if(!isset($params['url'])) 
56
-		$smarty->trigger_error($GLOBALS['app_strings']['ERR_MISSING_REQUIRED_FIELDS'] . 'url');
57
-	if(!isset($params['title']))
58
-		$smarty->trigger_error($GLOBALS['app_strings']['ERR_MISSING_REQUIRED_FIELDS'] . 'title');
55
+	if(!isset($params['url'])) {
56
+			$smarty->trigger_error($GLOBALS['app_strings']['ERR_MISSING_REQUIRED_FIELDS'] . 'url');
57
+	}
58
+	if(!isset($params['title'])) {
59
+			$smarty->trigger_error($GLOBALS['app_strings']['ERR_MISSING_REQUIRED_FIELDS'] . 'title');
60
+	}
59 61
 
60 62
 	// set defaults
61
-	if(!isset($params['attr']))
62
-		$params['attr'] = '';
63
-	if(!isset($params['img_name'])) 
64
-		$params['img_name'] = '';
65
-	if(!isset($params['img_attr']))
66
-		$params['img_attr'] = '';
67
-	if(!isset($params['img_width']))
68
-		$params['img_width'] = null;
69
-	if(!isset($params['img_height']))
70
-		$params['height'] = null;
71
-	if(!isset($params['img_placement']))
72
-		$params['img_placement'] = 'imageonly';
73
-	if(!isset($params['img_alt']))
74
-		$params['img_alt'] = '';
63
+	if(!isset($params['attr'])) {
64
+			$params['attr'] = '';
65
+	}
66
+	if(!isset($params['img_name'])) {
67
+			$params['img_name'] = '';
68
+	}
69
+	if(!isset($params['img_attr'])) {
70
+			$params['img_attr'] = '';
71
+	}
72
+	if(!isset($params['img_width'])) {
73
+			$params['img_width'] = null;
74
+	}
75
+	if(!isset($params['img_height'])) {
76
+			$params['height'] = null;
77
+	}
78
+	if(!isset($params['img_placement'])) {
79
+			$params['img_placement'] = 'imageonly';
80
+	}
81
+	if(!isset($params['img_alt'])) {
82
+			$params['img_alt'] = '';
83
+	}
75 84
 
76 85
 	return SugarThemeRegistry::current()->getLink($params['url'], $params['title'], $params['attr'], $params['img_name'], 
77 86
 		$params['img_attr'], $params['img_width'], $params['img_height'], $params['img_alt'], $params['img_placement']);	
Please login to merge, or discard this patch.