Completed
Push — developer ( 02a7a3...2908cf )
by Błażej
84:08 queued 41:50
created
modules/Calendar/Appointment.php 3 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.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -169,7 +169,7 @@
 block discarded – undo
169 169
 		//Get Recurring events
170 170
 		$q = "SELECT vtiger_activity.*, vtiger_crmentity.*, case when (vtiger_users.user_name not like '') then $userNameSql else vtiger_groups.groupname end as user_name , vtiger_recurringevents.recurringid, vtiger_recurringevents.recurringdate as date_start ,vtiger_recurringevents.recurringtype,vtiger_groups.groupname from vtiger_activity inner join vtiger_crmentity on vtiger_activity.activityid = vtiger_crmentity.crmid inner join vtiger_recurringevents on vtiger_activity.activityid=vtiger_recurringevents.activityid left join vtiger_groups on vtiger_groups.groupid = vtiger_crmentity.smownerid LEFT JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smownerid";
171 171
 		$q .= getNonAdminAccessControlQuery('Calendar', $current_user);
172
-		$q.=" where vtiger_crmentity.deleted = 0 and vtiger_activity.activitytype not in ('Emails','Task') && (cast(concat(recurringdate, ' ', time_start) as datetime) between ? and ?) ";
172
+		$q .= " where vtiger_crmentity.deleted = 0 and vtiger_activity.activitytype not in ('Emails','Task') && (cast(concat(recurringdate, ' ', time_start) as datetime) between ? and ?) ";
173 173
 
174 174
 		// User Select Customization
175 175
 		$q .= $query_filter_prefix;
Please login to merge, or discard this patch.
Braces   +16 added lines, -11 removed lines patch added patch discarded remove patch
@@ -221,13 +221,15 @@  discard block
 block discarded – undo
221 221
 				$que = "select * from vtiger_sharedcalendar where sharedid=? and userid=?";
222 222
 				$row = $adb->pquery($que, array($current_user->id, $act_array["smownerid"]));
223 223
 				$no = $adb->getRowCount($row);
224
-				if ($no > 0)
225
-					$this->shared = true;
224
+				if ($no > 0) {
225
+									$this->shared = true;
226
+				}
226 227
 			}
227 228
 		}
228 229
 		$this->image_name = $act_array["activitytype"] . ".gif";
229
-		if (!empty($act_array["recurringid"]) && !empty($act_array["recurringtype"]))
230
-			$this->recurring = "Recurring.gif";
230
+		if (!empty($act_array["recurringid"]) && !empty($act_array["recurringtype"])) {
231
+					$this->recurring = "Recurring.gif";
232
+		}
231 233
 
232 234
 		$this->record = $act_array["activityid"];
233 235
 		$date = new DateTimeField($act_array["date_start"] . ' ' . $act_array['time_start']);
@@ -295,8 +297,9 @@  discard block
 block discarded – undo
295 297
 		$roleid = $current_user->roleid;
296 298
 		$roleids = Array();
297 299
 		$subrole = getRoleSubordinates($roleid);
298
-		if (count($subrole) > 0)
299
-			$roleids = $subrole;
300
+		if (count($subrole) > 0) {
301
+					$roleids = $subrole;
302
+		}
300 303
 		array_push($roleids, $roleid);
301 304
 
302 305
 		//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...
@@ -310,12 +313,14 @@  discard block
 block discarded – undo
310 313
 			$res_val = $adb->pquery($pick_query, array($roleids));
311 314
 			$num_val = $adb->num_rows($res_val);
312 315
 		}
313
-		if ($num_val > 0)
316
+		if ($num_val > 0) {
317
+					$pick_val = $exist_val;
318
+		} else {
319
+					$pick_val = \includes\Language::translate('LBL_NOT_ACCESSIBLE');
320
+		}
321
+	} else {
314 322
 			$pick_val = $exist_val;
315
-		else
316
-			$pick_val = \includes\Language::translate('LBL_NOT_ACCESSIBLE');
317
-	} else
318
-		$pick_val = $exist_val;
323
+	}
319 324
 
320 325
 	return $pick_val;
321 326
 }
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.
modules/com_vtiger_workflow/VTWorkflowTemplateManager.inc 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	 * Retrieve a template given it's id
42 42
 	 *
43 43
 	 * @param $templateId The id of the template
44
-	 * @return The template object
44
+	 * @return VTWorkflowTemplate template object
45 45
 	 */
46 46
 	public function retrieveTemplate($templateId)
47 47
 	{
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	 *
63 63
 	 * The new workflow will also be added to the database.
64 64
 	 *
65
-	 * @param $template The template to use
65
+	 * @param VTWorkflowTemplate $template The template to use
66 66
 	 * @return A workflow object.
67 67
 	 */
68 68
 	public function createWorkflow($template)
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 	 * This can be used for exporting templates from one 
146 146
 	 * machine to another
147 147
 	 *
148
-	 * @return The string dump of the templates.
148
+	 * @return string string dump of the templates.
149 149
 	 */
150 150
 	public function dumpAllTemplates()
151 151
 	{
Please login to merge, or discard this patch.
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -113,8 +113,7 @@
 block discarded – undo
113 113
 		$adb = $this->adb;
114 114
 		if (is_numeric($template->id)) {//How do I check whether a member exists in php?
115 115
 			$templateId = $template->id;
116
-			$adb->pquery("update com_vtiger_workflowtemplates set title=?," +
117
-				" module_name=?, template=? where template_id=?", array($template->title, $template->moduleName,
116
+			$adb->pquery("update com_vtiger_workflowtemplates set title=?," +" module_name=?, template=? where template_id=?", array($template->title, $template->moduleName,
118 117
 				$template->template, $templateId));
119 118
 			return $templateId;
120 119
 		} else {
Please login to merge, or discard this patch.
modules/com_vtiger_workflow/VTWorkflowUtils.php 1 patch
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -108,6 +108,7 @@  discard block
 block discarded – undo
108 108
 
109 109
 	/**
110 110
 	 * Insert redirection script
111
+	 * @param string $to
111 112
 	 */
112 113
 	public function redirectTo($to, $message)
113 114
 	{
@@ -132,6 +133,9 @@  discard block
 block discarded – undo
132 133
 	 * @params :: $modulename - name of the module
133 134
 	 */
134 135
 
136
+	/**
137
+	 * @param boolean $modulename
138
+	 */
135 139
 	public static function checkModuleWorkflow($modulename)
136 140
 	{
137 141
 		$adb = PearDatabase::getInstance();
Please login to merge, or discard this patch.
modules/com_vtiger_workflow/WorkFlowScheduler.php 2 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -126,6 +126,9 @@  discard block
 block discarded – undo
126 126
 		$scheduledWorkflows = null;
127 127
 	}
128 128
 
129
+	/**
130
+	 * @param QueryGenerator $queryGenerator
131
+	 */
129 132
 	public function addWorkflowConditionsToQueryGenerator($queryGenerator, $conditions)
130 133
 	{
131 134
 		$conditionMapping = array(
@@ -232,7 +235,7 @@  discard block
 block discarded – undo
232 235
 	/**
233 236
 	 * Function parse the value based on the condition
234 237
 	 * @param <Array> $condition
235
-	 * @return <String>
238
+	 * @return string
236 239
 	 */
237 240
 	public function _parseValueForDate($condition)
238 241
 	{
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -175,8 +175,9 @@
 block discarded – undo
175 175
 				$operation = $condition['operation'];
176 176
 
177 177
 				//Cannot handle this condition for scheduled workflows
178
-				if ($operation == 'has changed')
179
-					continue;
178
+				if ($operation == 'has changed') {
179
+									continue;
180
+				}
180 181
 
181 182
 				$value = $condition['value'];
182 183
 				if (in_array($operation, $this->_specialDateTimeOperator())) {
Please login to merge, or discard this patch.