Completed
Push — developer ( 51f696...681523 )
by Błażej
549:36 queued 490:16
created
libraries/Smarty/libs/sysplugins/smarty_template_source.php 3 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -126,7 +126,6 @@
 block discarded – undo
126 126
     /**
127 127
      * create Source Object container
128 128
      *
129
-     * @param Smarty_Resource $handler  Resource Handler this source object communicates with
130 129
      * @param Smarty          $smarty   Smarty instance this source object belongs to
131 130
      * @param string          $resource full template_resource
132 131
      * @param string          $type     type of resource
Please login to merge, or discard this patch.
Indentation   +196 added lines, -196 removed lines patch added patch discarded remove patch
@@ -11,200 +11,200 @@
 block discarded – undo
11 11
  */
12 12
 class Smarty_Template_Source
13 13
 {
14
-    /**
15
-     * Unique Template ID
16
-     *
17
-     * @var string
18
-     */
19
-    public $uid = null;
20
-
21
-    /**
22
-     * Template Resource (Smarty_Internal_Template::$template_resource)
23
-     *
24
-     * @var string
25
-     */
26
-    public $resource = null;
27
-
28
-    /**
29
-     * Resource Type
30
-     *
31
-     * @var string
32
-     */
33
-    public $type = null;
34
-
35
-    /**
36
-     * Resource Name
37
-     *
38
-     * @var string
39
-     */
40
-    public $name = null;
41
-
42
-    /**
43
-     * Source Filepath
44
-     *
45
-     * @var string
46
-     */
47
-    public $filepath = null;
48
-
49
-    /**
50
-     * Source Timestamp
51
-     *
52
-     * @var integer
53
-     */
54
-    public $timestamp = null;
55
-
56
-    /**
57
-     * Source Existence
58
-     *
59
-     * @var boolean
60
-     */
61
-    public $exists = false;
62
-
63
-    /**
64
-     * Source File Base name
65
-     *
66
-     * @var string
67
-     */
68
-    public $basename = null;
69
-
70
-    /**
71
-     * The Components an extended template is made of
72
-     *
73
-     * @var \Smarty_Template_Source[]
74
-     */
75
-    public $components = null;
76
-
77
-    /**
78
-     * Resource Handler
79
-     *
80
-     * @var \Smarty_Resource
81
-     */
82
-    public $handler = null;
83
-
84
-    /**
85
-     * Smarty instance
86
-     *
87
-     * @var Smarty
88
-     */
89
-    public $smarty = null;
90
-
91
-    /**
92
-     * Resource is source
93
-     *
94
-     * @var bool
95
-     */
96
-    public $isConfig = false;
97
-
98
-    /**
99
-     * Template source content eventually set by default handler
100
-     *
101
-     * @var string
102
-     */
103
-    public $content = null;
104
-
105
-    /**
106
-     * Name of the Class to compile this resource's contents with
107
-     *
108
-     * @var string
109
-     */
110
-    public $compiler_class = 'Smarty_Internal_SmartyTemplateCompiler';
111
-
112
-    /**
113
-     * Name of the Class to tokenize this resource's contents with
114
-     *
115
-     * @var string
116
-     */
117
-    public $template_lexer_class = 'Smarty_Internal_Templatelexer';
118
-
119
-    /**
120
-     * Name of the Class to parse this resource's contents with
121
-     *
122
-     * @var string
123
-     */
124
-    public $template_parser_class = 'Smarty_Internal_Templateparser';
125
-
126
-    /**
127
-     * create Source Object container
128
-     *
129
-     * @param Smarty_Resource $handler  Resource Handler this source object communicates with
130
-     * @param Smarty          $smarty   Smarty instance this source object belongs to
131
-     * @param string          $resource full template_resource
132
-     * @param string          $type     type of resource
133
-     * @param string          $name     resource name
134
-     *
135
-     */
136
-    public function __construct(Smarty $smarty, $resource, $type, $name)
137
-    {
138
-        $this->handler =
139
-            isset($smarty->_cache[ 'resource_handlers' ][ $type ]) ? $smarty->_cache[ 'resource_handlers' ][ $type ] :
140
-                Smarty_Resource::load($smarty, $type);
141
-        $this->smarty = $smarty;
142
-        $this->resource = $resource;
143
-        $this->type = $type;
144
-        $this->name = $name;
145
-    }
146
-
147
-    /**
148
-     * initialize Source Object for given resource
149
-     * Either [$_template] or [$smarty, $template_resource] must be specified
150
-     *
151
-     * @param  Smarty_Internal_Template $_template         template object
152
-     * @param  Smarty                   $smarty            smarty object
153
-     * @param  string                   $template_resource resource identifier
154
-     *
155
-     * @return Smarty_Template_Source Source Object
156
-     * @throws SmartyException
157
-     */
158
-    public static function load(Smarty_Internal_Template $_template = null, Smarty $smarty = null,
159
-                                $template_resource = null)
160
-    {
161
-        if ($_template) {
162
-            $smarty = $_template->smarty;
163
-            $template_resource = $_template->template_resource;
164
-        }
165
-        if (empty($template_resource)) {
166
-            throw new SmartyException('Source: Missing  name');
167
-        }
168
-        // parse resource_name, load resource handler, identify unique resource name
169
-        if (preg_match('/^([A-Za-z0-9_\-]{2,})[:]([\s\S]*)$/', $template_resource, $match)) {
170
-            $type = $match[ 1 ];
171
-            $name = $match[ 2 ];
172
-        } else {
173
-            // no resource given, use default
174
-            // or single character before the colon is not a resource type, but part of the filepath
175
-            $type = $smarty->default_resource_type;
176
-            $name = $template_resource;
177
-        }
178
-        // create new source  object
179
-        $source = new Smarty_Template_Source($smarty, $template_resource, $type, $name);
180
-        $source->handler->populate($source, $_template);
181
-        if (!$source->exists && isset($_template->smarty->default_template_handler_func)) {
182
-            Smarty_Internal_Method_RegisterDefaultTemplateHandler::_getDefaultTemplate($source);
183
-            $source->handler->populate($source, $_template);
184
-        }
185
-        return $source;
186
-    }
187
-
188
-    /**
189
-     * Get source time stamp
190
-     *
191
-     * @return int
192
-     */
193
-    public function getTimeStamp()
194
-    {
195
-        if (!isset($this->timestamp)) {
196
-            $this->handler->populateTimestamp($this);
197
-        }
198
-        return $this->timestamp;
199
-    }
200
-
201
-    /**
202
-     * Get source content
203
-     *
204
-     * @return string
205
-     */
206
-    public function getContent()
207
-    {
208
-        return isset($this->content) ? $this->content : $this->handler->getContent($this);
209
-    }
14
+	/**
15
+	 * Unique Template ID
16
+	 *
17
+	 * @var string
18
+	 */
19
+	public $uid = null;
20
+
21
+	/**
22
+	 * Template Resource (Smarty_Internal_Template::$template_resource)
23
+	 *
24
+	 * @var string
25
+	 */
26
+	public $resource = null;
27
+
28
+	/**
29
+	 * Resource Type
30
+	 *
31
+	 * @var string
32
+	 */
33
+	public $type = null;
34
+
35
+	/**
36
+	 * Resource Name
37
+	 *
38
+	 * @var string
39
+	 */
40
+	public $name = null;
41
+
42
+	/**
43
+	 * Source Filepath
44
+	 *
45
+	 * @var string
46
+	 */
47
+	public $filepath = null;
48
+
49
+	/**
50
+	 * Source Timestamp
51
+	 *
52
+	 * @var integer
53
+	 */
54
+	public $timestamp = null;
55
+
56
+	/**
57
+	 * Source Existence
58
+	 *
59
+	 * @var boolean
60
+	 */
61
+	public $exists = false;
62
+
63
+	/**
64
+	 * Source File Base name
65
+	 *
66
+	 * @var string
67
+	 */
68
+	public $basename = null;
69
+
70
+	/**
71
+	 * The Components an extended template is made of
72
+	 *
73
+	 * @var \Smarty_Template_Source[]
74
+	 */
75
+	public $components = null;
76
+
77
+	/**
78
+	 * Resource Handler
79
+	 *
80
+	 * @var \Smarty_Resource
81
+	 */
82
+	public $handler = null;
83
+
84
+	/**
85
+	 * Smarty instance
86
+	 *
87
+	 * @var Smarty
88
+	 */
89
+	public $smarty = null;
90
+
91
+	/**
92
+	 * Resource is source
93
+	 *
94
+	 * @var bool
95
+	 */
96
+	public $isConfig = false;
97
+
98
+	/**
99
+	 * Template source content eventually set by default handler
100
+	 *
101
+	 * @var string
102
+	 */
103
+	public $content = null;
104
+
105
+	/**
106
+	 * Name of the Class to compile this resource's contents with
107
+	 *
108
+	 * @var string
109
+	 */
110
+	public $compiler_class = 'Smarty_Internal_SmartyTemplateCompiler';
111
+
112
+	/**
113
+	 * Name of the Class to tokenize this resource's contents with
114
+	 *
115
+	 * @var string
116
+	 */
117
+	public $template_lexer_class = 'Smarty_Internal_Templatelexer';
118
+
119
+	/**
120
+	 * Name of the Class to parse this resource's contents with
121
+	 *
122
+	 * @var string
123
+	 */
124
+	public $template_parser_class = 'Smarty_Internal_Templateparser';
125
+
126
+	/**
127
+	 * create Source Object container
128
+	 *
129
+	 * @param Smarty_Resource $handler  Resource Handler this source object communicates with
130
+	 * @param Smarty          $smarty   Smarty instance this source object belongs to
131
+	 * @param string          $resource full template_resource
132
+	 * @param string          $type     type of resource
133
+	 * @param string          $name     resource name
134
+	 *
135
+	 */
136
+	public function __construct(Smarty $smarty, $resource, $type, $name)
137
+	{
138
+		$this->handler =
139
+			isset($smarty->_cache[ 'resource_handlers' ][ $type ]) ? $smarty->_cache[ 'resource_handlers' ][ $type ] :
140
+				Smarty_Resource::load($smarty, $type);
141
+		$this->smarty = $smarty;
142
+		$this->resource = $resource;
143
+		$this->type = $type;
144
+		$this->name = $name;
145
+	}
146
+
147
+	/**
148
+	 * initialize Source Object for given resource
149
+	 * Either [$_template] or [$smarty, $template_resource] must be specified
150
+	 *
151
+	 * @param  Smarty_Internal_Template $_template         template object
152
+	 * @param  Smarty                   $smarty            smarty object
153
+	 * @param  string                   $template_resource resource identifier
154
+	 *
155
+	 * @return Smarty_Template_Source Source Object
156
+	 * @throws SmartyException
157
+	 */
158
+	public static function load(Smarty_Internal_Template $_template = null, Smarty $smarty = null,
159
+								$template_resource = null)
160
+	{
161
+		if ($_template) {
162
+			$smarty = $_template->smarty;
163
+			$template_resource = $_template->template_resource;
164
+		}
165
+		if (empty($template_resource)) {
166
+			throw new SmartyException('Source: Missing  name');
167
+		}
168
+		// parse resource_name, load resource handler, identify unique resource name
169
+		if (preg_match('/^([A-Za-z0-9_\-]{2,})[:]([\s\S]*)$/', $template_resource, $match)) {
170
+			$type = $match[ 1 ];
171
+			$name = $match[ 2 ];
172
+		} else {
173
+			// no resource given, use default
174
+			// or single character before the colon is not a resource type, but part of the filepath
175
+			$type = $smarty->default_resource_type;
176
+			$name = $template_resource;
177
+		}
178
+		// create new source  object
179
+		$source = new Smarty_Template_Source($smarty, $template_resource, $type, $name);
180
+		$source->handler->populate($source, $_template);
181
+		if (!$source->exists && isset($_template->smarty->default_template_handler_func)) {
182
+			Smarty_Internal_Method_RegisterDefaultTemplateHandler::_getDefaultTemplate($source);
183
+			$source->handler->populate($source, $_template);
184
+		}
185
+		return $source;
186
+	}
187
+
188
+	/**
189
+	 * Get source time stamp
190
+	 *
191
+	 * @return int
192
+	 */
193
+	public function getTimeStamp()
194
+	{
195
+		if (!isset($this->timestamp)) {
196
+			$this->handler->populateTimestamp($this);
197
+		}
198
+		return $this->timestamp;
199
+	}
200
+
201
+	/**
202
+	 * Get source content
203
+	 *
204
+	 * @return string
205
+	 */
206
+	public function getContent()
207
+	{
208
+		return isset($this->content) ? $this->content : $this->handler->getContent($this);
209
+	}
210 210
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -136,8 +136,7 @@  discard block
 block discarded – undo
136 136
     public function __construct(Smarty $smarty, $resource, $type, $name)
137 137
     {
138 138
         $this->handler =
139
-            isset($smarty->_cache[ 'resource_handlers' ][ $type ]) ? $smarty->_cache[ 'resource_handlers' ][ $type ] :
140
-                Smarty_Resource::load($smarty, $type);
139
+            isset($smarty->_cache['resource_handlers'][$type]) ? $smarty->_cache['resource_handlers'][$type] : Smarty_Resource::load($smarty, $type);
141 140
         $this->smarty = $smarty;
142 141
         $this->resource = $resource;
143 142
         $this->type = $type;
@@ -167,8 +166,8 @@  discard block
 block discarded – undo
167 166
         }
168 167
         // parse resource_name, load resource handler, identify unique resource name
169 168
         if (preg_match('/^([A-Za-z0-9_\-]{2,})[:]([\s\S]*)$/', $template_resource, $match)) {
170
-            $type = $match[ 1 ];
171
-            $name = $match[ 2 ];
169
+            $type = $match[1];
170
+            $name = $match[2];
172 171
         } else {
173 172
             // no resource given, use default
174 173
             // or single character before the colon is not a resource type, but part of the filepath
Please login to merge, or discard this patch.
modules/Accounts/Accounts.php 2 patches
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -611,6 +611,7 @@  discard block
 block discarded – undo
611 611
 	 * @param  integer   $id      		- accountid
612 612
 	 * @param  array   $parent_accounts   - Array of all the parent accounts
613 613
 	 * returns All the parent accounts of the given accountid in array format
614
+	 * @param integer[] $encountered_accounts
614 615
 	 */
615 616
 	public function __getParentAccounts($id, &$parent_accounts, &$encountered_accounts, $depthBase = 0)
616 617
 	{
@@ -673,7 +674,7 @@  discard block
 block discarded – undo
673 674
 	 * Function to Recursively get all the child accounts of a given Account
674 675
 	 * @param  integer   $id      		- accountid
675 676
 	 * @param  array   $child_accounts   - Array of all the child accounts
676
-	 * @param  integer   $depth          - Depth at which the particular account has to be placed in the hierarchy
677
+	 * @param  integer   $depthBase          - Depth at which the particular account has to be placed in the hierarchy
677 678
 	 * returns All the child accounts of the given accountid in array format
678 679
 	 */
679 680
 	public function __getChildAccounts($id, &$child_accounts, $depthBase)
Please login to merge, or discard this patch.
Braces   +85 added lines, -60 removed lines patch added patch discarded remove patch
@@ -97,18 +97,20 @@  discard block
 block discarded – undo
97 97
 		vtlib_setup_modulevars($related_module, $other);
98 98
 		$singular_modname = vtlib_toSingular($related_module);
99 99
 
100
-		if ($singlepane_view == 'true')
101
-			$returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id;
102
-		else
103
-			$returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id;
100
+		if ($singlepane_view == 'true') {
101
+					$returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id;
102
+		} else {
103
+					$returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id;
104
+		}
104 105
 
105 106
 		$button = '';
106 107
 
107 108
 		$button .= '<input type="hidden" name="email_directing_module"><input type="hidden" name="record">';
108 109
 
109 110
 		if ($actions) {
110
-			if (is_string($actions))
111
-				$actions = explode(',', strtoupper($actions));
111
+			if (is_string($actions)) {
112
+							$actions = explode(',', strtoupper($actions));
113
+			}
112 114
 			if (in_array('SELECT', $actions) && isPermitted($related_module, 4, '') == 'yes') {
113 115
 				$button .= "<input title='" . \App\Language::translate('LBL_SELECT') . " " . \App\Language::translate($related_module) . "' class='crmbutton small edit' type='button' onclick=\"return window.open('index.php?module=$related_module&return_module=$currentModule&action=Popup&popuptype=detailview&select=enable&form=EditView&form_submit=false&recordid=$id','test','width=640,height=602,resizable=0,scrollbars=0');\" value='" . \App\Language::translate('LBL_SELECT') . " " . \App\Language::translate($related_module) . "'>&nbsp;";
114 116
 			}
@@ -134,8 +136,9 @@  discard block
 block discarded – undo
134 136
 
135 137
 		$return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset);
136 138
 
137
-		if ($return_value === null)
138
-			$return_value = [];
139
+		if ($return_value === null) {
140
+					$return_value = [];
141
+		}
139 142
 		$return_value['CUSTOM_BUTTON'] = $button;
140 143
 
141 144
 		\App\Log::trace("Exiting get_campaigns method ...");
@@ -161,16 +164,18 @@  discard block
 block discarded – undo
161 164
 		vtlib_setup_modulevars($related_module, $other);
162 165
 		$singular_modname = vtlib_toSingular($related_module);
163 166
 
164
-		if ($singlepane_view == 'true')
165
-			$returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id;
166
-		else
167
-			$returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id;
167
+		if ($singlepane_view == 'true') {
168
+					$returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id;
169
+		} else {
170
+					$returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id;
171
+		}
168 172
 
169 173
 		$button = '';
170 174
 		$current_user = vglobal('current_user');
171 175
 		if ($actions && getFieldVisibilityPermission($related_module, $current_user->id, 'account_id', 'readwrite') == '0') {
172
-			if (is_string($actions))
173
-				$actions = explode(',', strtoupper($actions));
176
+			if (is_string($actions)) {
177
+							$actions = explode(',', strtoupper($actions));
178
+			}
174 179
 			if (in_array('SELECT', $actions) && isPermitted($related_module, 4, '') == 'yes') {
175 180
 				$button .= "<input title='" . \App\Language::translate('LBL_SELECT') . " " . \App\Language::translate($related_module) . "' class='crmbutton small edit' type='button' onclick=\"return window.open('index.php?module=$related_module&return_module=$currentModule&action=Popup&popuptype=detailview&select=enable&form=EditView&form_submit=false&recordid=$id','test','width=640,height=602,resizable=0,scrollbars=0');\" value='" . \App\Language::translate('LBL_SELECT') . " " . \App\Language::translate($related_module) . "'>&nbsp;";
176 181
 			}
@@ -202,8 +207,9 @@  discard block
 block discarded – undo
202 207
 
203 208
 		$return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset);
204 209
 
205
-		if ($return_value === null)
206
-			$return_value = [];
210
+		if ($return_value === null) {
211
+					$return_value = [];
212
+		}
207 213
 		$return_value['CUSTOM_BUTTON'] = $button;
208 214
 
209 215
 		\App\Log::trace("Exiting get_contacts method ...");
@@ -229,16 +235,18 @@  discard block
 block discarded – undo
229 235
 		vtlib_setup_modulevars($related_module, $other);
230 236
 		$singular_modname = vtlib_toSingular($related_module);
231 237
 
232
-		if ($singlepane_view == 'true')
233
-			$returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id;
234
-		else
235
-			$returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id;
238
+		if ($singlepane_view == 'true') {
239
+					$returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id;
240
+		} else {
241
+					$returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id;
242
+		}
236 243
 
237 244
 		$button = '';
238 245
 		$current_user = vglobal('current_user');
239 246
 		if ($actions && getFieldVisibilityPermission($related_module, $current_user->id, 'parent_id', 'readwrite') == '0') {
240
-			if (is_string($actions))
241
-				$actions = explode(',', strtoupper($actions));
247
+			if (is_string($actions)) {
248
+							$actions = explode(',', strtoupper($actions));
249
+			}
242 250
 			if (in_array('SELECT', $actions) && isPermitted($related_module, 4, '') == 'yes') {
243 251
 				$button .= "<input title='" . \App\Language::translate('LBL_SELECT') . " " . \App\Language::translate($related_module) . "' class='crmbutton small edit' type='button' onclick=\"return window.open('index.php?module=$related_module&return_module=$currentModule&action=Popup&popuptype=detailview&select=enable&form=EditView&form_submit=false&recordid=$id','test','width=640,height=602,resizable=0,scrollbars=0');\" value='" . \App\Language::translate('LBL_SELECT') . " " . \App\Language::translate($related_module) . "'>&nbsp;";
244 252
 			}
@@ -263,8 +271,9 @@  discard block
 block discarded – undo
263 271
 
264 272
 		$return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset);
265 273
 
266
-		if ($return_value === null)
267
-			$return_value = [];
274
+		if ($return_value === null) {
275
+					$return_value = [];
276
+		}
268 277
 		$return_value['CUSTOM_BUTTON'] = $button;
269 278
 
270 279
 		\App\Log::trace("Exiting get_tickets method ...");
@@ -290,16 +299,18 @@  discard block
 block discarded – undo
290 299
 		vtlib_setup_modulevars($related_module, $other);
291 300
 		$singular_modname = vtlib_toSingular($related_module);
292 301
 
293
-		if ($singlepane_view == 'true')
294
-			$returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id;
295
-		else
296
-			$returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id;
302
+		if ($singlepane_view == 'true') {
303
+					$returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id;
304
+		} else {
305
+					$returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id;
306
+		}
297 307
 
298 308
 		$button = '';
299 309
 
300 310
 		if ($actions) {
301
-			if (is_string($actions))
302
-				$actions = explode(',', strtoupper($actions));
311
+			if (is_string($actions)) {
312
+							$actions = explode(',', strtoupper($actions));
313
+			}
303 314
 			if (in_array('SELECT', $actions) && isPermitted($related_module, 4, '') == 'yes') {
304 315
 				$button .= "<input title='" . \App\Language::translate('LBL_SELECT') . " " . \App\Language::translate($related_module) . "' class='crmbutton small edit' type='button' onclick=\"return window.open('index.php?module=$related_module&return_module=$currentModule&action=Popup&popuptype=detailview&select=enable&form=EditView&form_submit=false&recordid=$id','test','width=640,height=602,resizable=0,scrollbars=0');\" value='" . \App\Language::translate('LBL_SELECT') . " " . \App\Language::translate($related_module) . "'>&nbsp;";
305 316
 			}
@@ -327,8 +338,9 @@  discard block
 block discarded – undo
327 338
 		$query = sprintf($query, $entityIds);
328 339
 		$return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset);
329 340
 
330
-		if ($return_value === null)
331
-			$return_value = [];
341
+		if ($return_value === null) {
342
+					$return_value = [];
343
+		}
332 344
 		$return_value['CUSTOM_BUTTON'] = $button;
333 345
 
334 346
 		\App\Log::trace("Exiting get_products method ...");
@@ -370,10 +382,11 @@  discard block
 block discarded – undo
370 382
 		$query .= $this->getNonAdminAccessControlQuery('Accounts', $current_user);
371 383
 		$where_auto = " vtiger_crmentity.deleted = 0 ";
372 384
 
373
-		if ($where != '')
374
-			$query .= sprintf(' where (%s) && %s', $where, $where_auto);
375
-		else
376
-			$query .= sprintf(' where %s', $where_auto);
385
+		if ($where != '') {
386
+					$query .= sprintf(' where (%s) && %s', $where, $where_auto);
387
+		} else {
388
+					$query .= sprintf(' where %s', $where_auto);
389
+		}
377 390
 
378 391
 		\App\Log::trace("Exiting create_export_query method ...");
379 392
 		return $query;
@@ -732,8 +745,9 @@  discard block
 block discarded – undo
732 745
 	public function unlinkRelationship($id, $return_module, $return_id, $relatedName = false)
733 746
 	{
734 747
 
735
-		if (empty($return_module) || empty($return_id))
736
-			return;
748
+		if (empty($return_module) || empty($return_id)) {
749
+					return;
750
+		}
737 751
 
738 752
 		if ($return_module == 'Campaigns') {
739 753
 			$this->db->delete('vtiger_campaign_records', 'crmid=? && campaignid=?', [$id, $return_id]);
@@ -750,8 +764,9 @@  discard block
 block discarded – undo
750 764
 		$db = PearDatabase::getInstance();
751 765
 		$currentUser = Users_Record_Model::getCurrentUserModel();
752 766
 
753
-		if (!is_array($with_crmids))
754
-			$with_crmids = [$with_crmids];
767
+		if (!is_array($with_crmids)) {
768
+					$with_crmids = [$with_crmids];
769
+		}
755 770
 		if (!in_array($with_module, ['Products', 'Campaigns'])) {
756 771
 			parent::save_related_module($module, $crmid, $with_module, $with_crmids, $relatedName);
757 772
 		} else {
@@ -795,8 +810,9 @@  discard block
 block discarded – undo
795 810
 		$singular_modname = vtlib_toSingular($related_module);
796 811
 		$button = '';
797 812
 		if ($actions) {
798
-			if (is_string($actions))
799
-				$actions = explode(',', strtoupper($actions));
813
+			if (is_string($actions)) {
814
+							$actions = explode(',', strtoupper($actions));
815
+			}
800 816
 			if (in_array('SELECT', $actions) && isPermitted($related_module, 4, '') == 'yes') {
801 817
 				$button .= "<input title='" . \App\Language::translate('LBL_SELECT') . " " . \App\Language::translate($related_module) . "' class='crmbutton small edit' type='button' onclick=\"return window.open('index.php?module=$related_module&return_module=$currentModule&action=Popup&popuptype=detailview&select=enable&form=EditView&form_submit=false&recordid=$id','test','width=640,height=602,resizable=0,scrollbars=0');\" value='" . \App\Language::translate('LBL_SELECT') . " " . \App\Language::translate($related_module) . "'>&nbsp;";
802 818
 			}
@@ -837,8 +853,9 @@  discard block
 block discarded – undo
837 853
 
838 854
 		$return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset);
839 855
 
840
-		if ($return_value === null)
841
-			$return_value = [];
856
+		if ($return_value === null) {
857
+					$return_value = [];
858
+		}
842 859
 		$return_value['CUSTOM_BUTTON'] = $button;
843 860
 		return $return_value;
844 861
 	}
@@ -865,10 +882,12 @@  discard block
 block discarded – undo
865 882
 					continue;
866 883
 				}
867 884
 				// Setup the default JOIN conditions if not specified
868
-				if (empty($relmap[1]))
869
-					$relmap[1] = $other->table_name;
870
-				if (empty($relmap[2]))
871
-					$relmap[2] = $relmap[0];
885
+				if (empty($relmap[1])) {
886
+									$relmap[1] = $other->table_name;
887
+				}
888
+				if (empty($relmap[2])) {
889
+									$relmap[2] = $relmap[0];
890
+				}
872 891
 				$join .= " LEFT JOIN $tname ON $tname.$relmap[0] = $relmap[1].$relmap[2]";
873 892
 			}
874 893
 		}
@@ -911,8 +930,9 @@  discard block
 block discarded – undo
911 930
 
912 931
 		$button = '';
913 932
 		if ($actions) {
914
-			if (is_string($actions))
915
-				$actions = explode(',', strtoupper($actions));
933
+			if (is_string($actions)) {
934
+							$actions = explode(',', strtoupper($actions));
935
+			}
916 936
 			if (in_array('SELECT', $actions) && isPermitted($related_module, 4, '') == 'yes') {
917 937
 				$button .= "<input title='" . \App\Language::translate('LBL_SELECT') . " " . \App\Language::translate($related_module) . "' class='crmbutton small edit' " .
918 938
 					" type='button' onclick=\"return window.open('index.php?module=$related_module&return_module=$current_module&action=Popup&popuptype=detailview&select=enable&form=EditView&form_submit=false&recordid=$id','test','width=640,height=602,resizable=0,scrollbars=0');\"" .
@@ -937,10 +957,12 @@  discard block
 block discarded – undo
937 957
 		if (!empty($other->related_tables)) {
938 958
 			foreach ($other->related_tables as $tname => $relmap) {
939 959
 				// Setup the default JOIN conditions if not specified
940
-				if (empty($relmap[1]))
941
-					$relmap[1] = $other->table_name;
942
-				if (empty($relmap[2]))
943
-					$relmap[2] = $relmap[0];
960
+				if (empty($relmap[1])) {
961
+									$relmap[1] = $other->table_name;
962
+				}
963
+				if (empty($relmap[2])) {
964
+									$relmap[2] = $relmap[0];
965
+				}
944 966
 				$more_relation .= " LEFT JOIN $tname ON $tname.$relmap[0] = $relmap[1].$relmap[2]";
945 967
 			}
946 968
 		}
@@ -962,8 +984,9 @@  discard block
 block discarded – undo
962 984
 
963 985
 		$return_value = GetRelatedList($current_module, $related_module, $other, $query, $button, $returnset);
964 986
 
965
-		if ($return_value === null)
966
-			$return_value = [];
987
+		if ($return_value === null) {
988
+					$return_value = [];
989
+		}
967 990
 		$return_value['CUSTOM_BUTTON'] = $button;
968 991
 
969 992
 		return $return_value;
@@ -973,14 +996,16 @@  discard block
 block discarded – undo
973 996
 	public function getRelatedContactsIds($id = null)
974 997
 	{
975 998
 
976
-		if ($id === null)
977
-			$id = $this->id;
999
+		if ($id === null) {
1000
+					$id = $this->id;
1001
+		}
978 1002
 		$query = (new \App\Db\Query())->select('contactid')->from('vtiger_contactdetails')
979 1003
 			->innerJoin('vtiger_crmentity', 'vtiger_contactdetails.contactid = vtiger_crmentity.crmid')
980 1004
 			->where(['vtiger_contactdetails.parentid' => $id, 'vtiger_crmentity.deleted' => 0]);
981 1005
 		$entityIds = $query->column();
982
-		if (empty($entityIds))
983
-			$entityIds = [];
1006
+		if (empty($entityIds)) {
1007
+					$entityIds = [];
1008
+		}
984 1009
 
985 1010
 		return $entityIds;
986 1011
 	}
Please login to merge, or discard this patch.
modules/Assets/dashboards/ExpiringSoldProducts.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -36,6 +36,9 @@
 block discarded – undo
36 36
 		}
37 37
 	}
38 38
 
39
+	/**
40
+	 * @param Vtiger_Widget_Model $widget
41
+	 */
39 42
 	public function getData(Vtiger_Request $request, $widget)
40 43
 	{
41 44
 		$db = PearDatabase::getInstance();
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 		$queryGenerator = new QueryGenerator($module, $currentUser);
53 53
 		$queryGenerator->setFields($fields);
54 54
 		$sql = $queryGenerator->getQuery();
55
-		$sql.= \App\PrivilegeQuery::getAccessConditions($module, $currentUser->getId());
55
+		$sql .= \App\PrivilegeQuery::getAccessConditions($module, $currentUser->getId());
56 56
 		if (!empty($assetStatus)) {
57 57
 			$assetStatus = implode("','", $assetConfig['assetstatus']);
58 58
 			$sql .= " && vtiger_assets.assetstatus NOT IN ('$assetStatus')";
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 		}
66 66
 
67 67
 		$params[] = $currentUser->getId();
68
-		$sql.= ' ORDER BY vtiger_assets.dateinservice ASC LIMIT %s';
68
+		$sql .= ' ORDER BY vtiger_assets.dateinservice ASC LIMIT %s';
69 69
 		$sql = sprintf($sql, $limit);
70 70
 		$result = $db->pquery($sql, $params);
71 71
 		$returnData = array();
Please login to merge, or discard this patch.
modules/Calendar/Appointment.php 2 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	 * @param $userid -- The user Id:: Type integer
57 57
 	 * @param $from_datetime -- The start date Obj :: Type Array
58 58
 	 * @param $to_datetime -- The end date Obj :: Type Array
59
-	 * @param $view -- The calendar view :: Type String
59
+	 * @param string $view -- The calendar view :: Type String
60 60
 	 * @returns $list :: Type Array
61 61
 	 */
62 62
 	public function readAppointment($userid, &$from_datetime, &$to_datetime, $view)
@@ -286,6 +286,9 @@  discard block
 block discarded – undo
286 286
 	return ($a->start_time->ts < $b->start_time->ts) ? -1 : 1;
287 287
 }
288 288
 
289
+/**
290
+ * @param string $fldname
291
+ */
289 292
 function getRoleBasesdPickList($fldname, $exist_val)
290 293
 {
291 294
 	$adb = PearDatabase::getInstance();
Please login to merge, or discard this patch.
Braces   +16 added lines, -11 removed lines patch added patch discarded remove patch
@@ -222,13 +222,15 @@  discard block
 block discarded – undo
222 222
 				$que = "select * from vtiger_sharedcalendar where sharedid=? and userid=?";
223 223
 				$row = $adb->pquery($que, array($currentUser->id, $act_array["smownerid"]));
224 224
 				$no = $adb->getRowCount($row);
225
-				if ($no > 0)
226
-					$this->shared = true;
225
+				if ($no > 0) {
226
+									$this->shared = true;
227
+				}
227 228
 			}
228 229
 		}
229 230
 		$this->image_name = $act_array["activitytype"] . ".gif";
230
-		if (!empty($act_array["recurringid"]) && !empty($act_array["recurringtype"]))
231
-			$this->recurring = "Recurring.gif";
231
+		if (!empty($act_array["recurringid"]) && !empty($act_array["recurringtype"])) {
232
+					$this->recurring = "Recurring.gif";
233
+		}
232 234
 
233 235
 		$this->record = $act_array["activityid"];
234 236
 		$date = new DateTimeField($act_array["date_start"] . ' ' . $act_array['time_start']);
@@ -296,8 +298,9 @@  discard block
 block discarded – undo
296 298
 		$roleid = $currentUser->roleid;
297 299
 		$roleids = Array();
298 300
 		$subrole = getRoleSubordinates($roleid);
299
-		if (count($subrole) > 0)
300
-			$roleids = $subrole;
301
+		if (count($subrole) > 0) {
302
+					$roleids = $subrole;
303
+		}
301 304
 		array_push($roleids, $roleid);
302 305
 
303 306
 		//here we are checking wheather the table contains the sortorder column .If  sortorder is present in the main picklist table, then the role2picklist will be applicable for this table...
@@ -311,12 +314,14 @@  discard block
 block discarded – undo
311 314
 			$res_val = $adb->pquery($pick_query, array($roleids));
312 315
 			$num_val = $adb->num_rows($res_val);
313 316
 		}
314
-		if ($num_val > 0)
317
+		if ($num_val > 0) {
318
+					$pick_val = $exist_val;
319
+		} else {
320
+					$pick_val = \App\Language::translate('LBL_NOT_ACCESSIBLE');
321
+		}
322
+	} else {
315 323
 			$pick_val = $exist_val;
316
-		else
317
-			$pick_val = \App\Language::translate('LBL_NOT_ACCESSIBLE');
318
-	} else
319
-		$pick_val = $exist_val;
324
+	}
320 325
 
321 326
 	return $pick_val;
322 327
 }
Please login to merge, or discard this patch.
modules/Calendar/Date.php 2 patches
Doc Comments   +1 added lines, -5 removed lines patch added patch discarded remove patch
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 
385 385
 	/**
386 386
 	 *
387
-	 * @return Date
387
+	 * @return string
388 388
 	 */
389 389
 	public function get_DB_formatted_date()
390 390
 	{
@@ -529,10 +529,6 @@  discard block
 block discarded – undo
529 529
 	 * This should be used whereever possible
530 530
 	 *
531 531
 	 * @param integer       $index - number between 0 to 42
532
-	 * @param string        $day   - date
533
-	 * @param string        $month - month
534
-	 * @param string        $year  - year
535
-	 * return vt_DateTime obj  $datetimevalue
536 532
 	 */
537 533
 	public function getThisMonthsDayByIndex($index)
538 534
 	{
Please login to merge, or discard this patch.
Braces   +37 added lines, -26 removed lines patch added patch discarded remove patch
@@ -87,12 +87,15 @@  discard block
 block discarded – undo
87 87
 	 */
88 88
 	public function getTodayDatetimebyIndex($index, $day = '', $month = '', $year = '')
89 89
 	{
90
-		if ($day === '')
91
-			$day = $this->day;
92
-		if ($month === '')
93
-			$month = $this->month;
94
-		if ($year === '')
95
-			$year = $this->year;
90
+		if ($day === '') {
91
+					$day = $this->day;
92
+		}
93
+		if ($month === '') {
94
+					$month = $this->month;
95
+		}
96
+		if ($year === '') {
97
+					$year = $this->year;
98
+		}
96 99
 		$day_array = array();
97 100
 
98 101
 		if ($index < 0 || $index > 23) {
@@ -140,12 +143,15 @@  discard block
 block discarded – undo
140 143
 	 */
141 144
 	public function getThismonthDaysbyIndex($index, $day = '', $month = '', $year = '')
142 145
 	{
143
-		if ($day == '')
144
-			$day = $index + 1;
145
-		if ($month == '')
146
-			$month = $this->month;
147
-		if ($year == '')
148
-			$year = $this->year;
146
+		if ($day == '') {
147
+					$day = $index + 1;
148
+		}
149
+		if ($month == '') {
150
+					$month = $this->month;
151
+		}
152
+		if ($year == '') {
153
+					$year = $this->year;
154
+		}
149 155
 		$month_array = array();
150 156
 		$month_array['day'] = $day;
151 157
 		$month_array['month'] = $month;
@@ -356,8 +362,9 @@  discard block
 block discarded – undo
356 362
 		} else {
357 363
 			die("year was not set");
358 364
 		}
359
-		if (empty($hour) && $hour !== 0)
360
-			$hour = 0;
365
+		if (empty($hour) && $hour !== 0) {
366
+					$hour = 0;
367
+		}
361 368
 		$this->ts = mktime($hour, $minute, $second, $month, $day, $year);
362 369
 		$this->setDateTime($this->ts);
363 370
 	}
@@ -399,10 +406,12 @@  discard block
 block discarded – undo
399 406
 	{
400 407
 		$hour = $this->z_hour;
401 408
 		$min = $this->minute;
402
-		if (empty($hour))
403
-			$hour = '00';
404
-		if (empty($min))
405
-			$min = '00';
409
+		if (empty($hour)) {
410
+					$hour = '00';
411
+		}
412
+		if (empty($min)) {
413
+					$min = '00';
414
+		}
406 415
 		return $hour . ':' . $min;
407 416
 	}
408 417
 
@@ -413,10 +422,11 @@  discard block
 block discarded – undo
413 422
 	 */
414 423
 	public function get_changed_day($mode)
415 424
 	{
416
-		if ($mode == 'increment')
417
-			$day = $this->day + 1;
418
-		else
419
-			$day = $this->day - 1;
425
+		if ($mode == 'increment') {
426
+					$day = $this->day + 1;
427
+		} else {
428
+					$day = $this->day - 1;
429
+		}
420 430
 		$date_data = array('day' => $day,
421 431
 			'month' => $this->month,
422 432
 			'year' => $this->year
@@ -432,10 +442,11 @@  discard block
 block discarded – undo
432 442
 	public function get_first_day_of_changed_week($mode)
433 443
 	{
434 444
 		$first_day = $this->getThisweekDaysbyIndex(1);
435
-		if ($mode == 'increment')
436
-			$day = $first_day->day + 7;
437
-		else
438
-			$day = $first_day->day - 7;
445
+		if ($mode == 'increment') {
446
+					$day = $first_day->day + 7;
447
+		} else {
448
+					$day = $first_day->day - 7;
449
+		}
439 450
 		$date_data = array('day' => $day,
440 451
 			'month' => $first_day->month,
441 452
 			'year' => $first_day->year
Please login to merge, or discard this patch.
modules/com_vtiger_workflow/VTJsonCondition.inc 2 patches
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -11,6 +11,10 @@
 block discarded – undo
11 11
 class VTJsonCondition
12 12
 {
13 13
 
14
+	/**
15
+	 * @param VTEntityCache $entityCache
16
+	 * @param string $id
17
+	 */
14 18
 	function evaluate($condition, $entityCache, $id)
15 19
 	{
16 20
 		$expr = \includes\utils\Json::decode($condition);
Please login to merge, or discard this patch.
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -24,8 +24,9 @@  discard block
 block discarded – undo
24 24
 			$i = 0;
25 25
 			foreach ($expr as $cond) {
26 26
 				$conditionGroup = $cond['groupid'];
27
-				if (empty($conditionGroup))
28
-					$conditionGroup = 0;
27
+				if (empty($conditionGroup)) {
28
+									$conditionGroup = 0;
29
+				}
29 30
 				preg_match('/(\w+) : \((\w+)\) (\w+)/', $cond['fieldname'], $matches);
30 31
 				if (count($matches) == 0) {
31 32
 					$expressionResults[$conditionGroup][$i]['result'] = $this->checkCondition($entityData, $cond);
@@ -117,8 +118,9 @@  discard block
 block discarded – undo
117 118
 		$data = $entityData->getData();
118 119
 
119 120
 		$condition = $cond['operation'];
120
-		if (empty($condition))
121
-			return false;
121
+		if (empty($condition)) {
122
+					return false;
123
+		}
122 124
 		if ($cond['fieldname'] == 'date_start' || $cond['fieldname'] == 'due_date') {
123 125
 			$fieldName = $cond['fieldname'];
124 126
 			$dateTimePair = array('date_start' => 'time_start', 'due_date' => 'time_end');
@@ -238,8 +240,9 @@  discard block
 block discarded – undo
238 240
 				}
239 241
 				return strpos($fieldValue, $value) !== FALSE;
240 242
 			case 'does not contain':
241
-				if (empty($value))
242
-					unset($value);
243
+				if (empty($value)) {
244
+									unset($value);
245
+				}
243 246
 				if (is_array($value)) {
244 247
 					return !in_array($fieldValue, $value);
245 248
 				}
Please login to merge, or discard this patch.
modules/com_vtiger_workflow/VTTaskManager.inc 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -152,6 +152,9 @@  discard block
 block discarded – undo
152 152
 		}
153 153
 	}
154 154
 
155
+	/**
156
+	 * @param VTTaskType $taskTypeInstance
157
+	 */
155 158
 	public function retrieveTemplatePath($moduleName, $taskTypeInstance)
156 159
 	{
157 160
 		$taskTemplatePath = $taskTypeInstance->get('templatepath');
@@ -226,6 +229,9 @@  discard block
 block discarded – undo
226 229
 
227 230
 	var $data;
228 231
 
232
+	/**
233
+	 * @param string $key
234
+	 */
229 235
 	public function get($key)
230 236
 	{
231 237
 		return $this->data[$key];
Please login to merge, or discard this patch.
modules/com_vtiger_workflow/VTWorkflowApplication.inc 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -11,6 +11,9 @@  discard block
 block discarded – undo
11 11
 class VTWorkflowApplication
12 12
 {
13 13
 
14
+	/**
15
+	 * @param string $action
16
+	 */
14 17
 	function __construct($action)
15 18
 	{
16 19
 		$this->request;
@@ -36,6 +39,9 @@  discard block
 block discarded – undo
36 39
 		return $_SERVER["REQUEST_URI"];
37 40
 	}
38 41
 
42
+	/**
43
+	 * @return string
44
+	 */
39 45
 	function returnUrl()
40 46
 	{
41 47
 		return $this->returnUrl;
Please login to merge, or discard this patch.
modules/com_vtiger_workflow/VTWorkflowManager.inc 3 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
 	/**
481 481
 	 * Function gets the next trigger for the workflows
482 482
 	 * @global <String> $default_timezone
483
-	 * @return type
483
+	 * @return string|null
484 484
 	 */
485 485
 	function getNextTriggerTime()
486 486
 	{
@@ -525,8 +525,8 @@  discard block
 block discarded – undo
525 525
 
526 526
 	/**
527 527
 	 * get next trigger time for daily
528
-	 * @param type $schTime
529
-	 * @return time
528
+	 * @param type $scheduledTime
529
+	 * @return string
530 530
 	 */
531 531
 	function getNextTriggerTimeForDaily($scheduledTime)
532 532
 	{
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
 								module_name=?, summary=?, test=?, execution_condition=?, defaultworkflow=?, filtersavedinnew=?,
42 42
 								schtypeid=?, schtime=?, schdayofmonth=?, schdayofweek=?, schannualdates=?, nexttrigger_time=? where workflow_id=?", array($wf->moduleName, $wf->description, $wf->test, $wf->executionCondition, $wf->defaultworkflow, $wf->filtersavedinnew,
43 43
 				$wf->schtypeid, $wf->schtime, $wf->schdayofmonth, $wf->schdayofweek, $wf->schannualdates, $wf->nexttrigger_time, $wf->id));
44
-		}else {
44
+		} else {
45 45
 			$workflowId = $adb->getUniqueID("com_vtiger_workflows");
46 46
 			$workflow->id = $workflowId;
47 47
 			$wf = $workflow;
Please login to merge, or discard this patch.
Braces   +10 added lines, -7 removed lines patch added patch discarded remove patch
@@ -35,18 +35,20 @@  discard block
 block discarded – undo
35 35
 		$adb = $this->adb;
36 36
 		if (isset($workflow->id)) {
37 37
 			$wf = $workflow;
38
-			if ($wf->filtersavedinnew == null)
39
-				$wf->filtersavedinnew = 5;
38
+			if ($wf->filtersavedinnew == null) {
39
+							$wf->filtersavedinnew = 5;
40
+			}
40 41
 			$adb->pquery("update com_vtiger_workflows set
41 42
 								module_name=?, summary=?, test=?, execution_condition=?, defaultworkflow=?, filtersavedinnew=?,
42 43
 								schtypeid=?, schtime=?, schdayofmonth=?, schdayofweek=?, schannualdates=?, nexttrigger_time=? where workflow_id=?", array($wf->moduleName, $wf->description, $wf->test, $wf->executionCondition, $wf->defaultworkflow, $wf->filtersavedinnew,
43 44
 				$wf->schtypeid, $wf->schtime, $wf->schdayofmonth, $wf->schdayofweek, $wf->schannualdates, $wf->nexttrigger_time, $wf->id));
44
-		}else {
45
+		} else {
45 46
 			$workflowId = $adb->getUniqueID("com_vtiger_workflows");
46 47
 			$workflow->id = $workflowId;
47 48
 			$wf = $workflow;
48
-			if ($wf->filtersavedinnew == null)
49
-				$wf->filtersavedinnew = 5;
49
+			if ($wf->filtersavedinnew == null) {
50
+							$wf->filtersavedinnew = 5;
51
+			}
50 52
 
51 53
 			$result = $adb->getColumnNames("com_vtiger_workflows");
52 54
 			if (in_array("type", $result)) {
@@ -155,8 +157,9 @@  discard block
 block discarded – undo
155 157
 			$workflow = $this->getWorkflowInstance($row->type);
156 158
 			$workflow->setup($row->data);
157 159
 
158
-			if (!is_a($workflow, 'Workflow'))
159
-				continue;
160
+			if (!is_a($workflow, 'Workflow')) {
161
+							continue;
162
+			}
160 163
 
161 164
 			$workflows[$i++] = $workflow;
162 165
 		}
Please login to merge, or discard this patch.