Completed
Push — developer ( b86c8e...fd7ea3 )
by Błażej
83:10 queued 45:05
created
modules/Calendar/CalendarCommon.php 1 patch
Braces   +31 added lines, -23 removed lines patch added patch discarded remove patch
@@ -21,8 +21,9 @@  discard block
 block discarded – undo
21 21
 	$result = $adb->pquery($query, array($sharedid));
22 22
 	if ($adb->num_rows($result) != 0) {
23 23
 		$countResult = $adb->num_rows($result);
24
-		for ($j = 0; $j < $countResult; $j++)
25
-			$userid[] = $adb->query_result($result, $j, 'userid');
24
+		for ($j = 0; $j < $countResult; $j++) {
25
+					$userid[] = $adb->query_result($result, $j, 'userid');
26
+		}
26 27
 		$shared_ids = implode(",", $userid);
27 28
 	}
28 29
 	return $shared_ids;
@@ -43,15 +44,17 @@  discard block
 block discarded – undo
43 44
 	if ($format == 'am/pm' || $format == '12') {
44 45
 		$hr = $sthr + 0;
45 46
 		$timearr['startfmt'] = ($hr >= 12) ? "pm" : "am";
46
-		if ($hr == 0)
47
-			$hr = 12;
47
+		if ($hr == 0) {
48
+					$hr = 12;
49
+		}
48 50
 		$timearr['starthour'] = twoDigit(($hr > 12) ? ($hr - 12) : $hr);
49 51
 		$timearr['startmin'] = $stmin;
50 52
 
51 53
 		$edhr = $edhr + 0;
52 54
 		$timearr['endfmt'] = ($edhr >= 12) ? "pm" : "am";
53
-		if ($edhr == 0)
54
-			$edhr = 12;
55
+		if ($edhr == 0) {
56
+					$edhr = 12;
57
+		}
55 58
 		$timearr['endhour'] = twoDigit(($edhr > 12) ? ($edhr - 12) : $edhr);
56 59
 		$timearr['endmin'] = $edmin;
57 60
 		return $timearr;
@@ -99,10 +102,11 @@  discard block
 block discarded – undo
99 102
 	$startDate = new DateTimeField($description['st_date_time']);
100 103
 	$endDate = new DateTimeField($description['end_date_time']);
101 104
 
102
-	if ($from == "invite")
103
-		$msg = \includes\Language::translate($mod_strings['LBL_ACTIVITY_INVITATION']);
104
-	else
105
-		$msg = \includes\Language::translate($mod_strings['LBL_ACTIVITY_NOTIFICATION']);
105
+	if ($from == "invite") {
106
+			$msg = \includes\Language::translate($mod_strings['LBL_ACTIVITY_INVITATION']);
107
+	} else {
108
+			$msg = \includes\Language::translate($mod_strings['LBL_ACTIVITY_NOTIFICATION']);
109
+	}
106 110
 
107 111
 	$currentUsername = \includes\fields\Owner::getUserLabel($currentUser->id);
108 112
 	$status = \includes\Language::translate($description['status'], 'Calendar');
@@ -116,8 +120,9 @@  discard block
 block discarded – undo
116 120
 	$list .= '<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $mod_strings["Related To"] . ': ' . \includes\Language::translate($description['relatedto']);
117 121
 	if (!empty($description['contact_name'])) {
118 122
 		$list .= '<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $mod_strings["LBL_CONTACT_LIST"] . ' ' . $description['contact_name'];
119
-	} else
120
-		$list .= '<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $mod_strings["Location"] . ' : ' . $description['location'];
123
+	} else {
124
+			$list .= '<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $mod_strings["Location"] . ' : ' . $description['location'];
125
+	}
121 126
 
122 127
 	$list .= '<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $mod_strings["LBL_APP_DESCRIPTION"] . ': ' . $description['description'];
123 128
 	$list .= '<br><br>' . $mod_strings["LBL_REGARDS_STRING"] . ' ,';
@@ -129,11 +134,12 @@  discard block
 block discarded – undo
129 134
 
130 135
 function twoDigit($no)
131 136
 {
132
-	if ($no < 10 && strlen(trim($no)) < 2)
133
-		return "0" . $no;
134
-	else
135
-		return "" . $no;
136
-}
137
+	if ($no < 10 && strlen(trim($no)) < 2) {
138
+			return "0" . $no;
139
+	} else {
140
+			return "" . $no;
141
+	}
142
+	}
137 143
 
138 144
 // User Select Customization
139 145
 /**
@@ -144,8 +150,9 @@  discard block
 block discarded – undo
144 150
 {
145 151
 	$currentUser = Users_Privileges_Model::getCurrentUserModel();
146 152
 	$onlyForUser = htmlspecialchars(strip_tags(AppRequest::getForSql('onlyforuser')), ENT_QUOTES, AppConfig::main('default_charset'));
147
-	if ($onlyForUser == '')
148
-		$onlyForUser = $currentUser->id;
153
+	if ($onlyForUser == '') {
154
+			$onlyForUser = $currentUser->id;
155
+	}
149 156
 	return $onlyForUser;
150 157
 }
151 158
 
@@ -161,10 +168,11 @@  discard block
 block discarded – undo
161 168
 			if ($onlyForUser == $currentUser->id) {
162 169
 				$userGroupIds = fetchUserGroupids($currentUser->id);
163 170
 				// User does not belong to any group? Let us reset to non-existent group
164
-				if (!empty($userGroupIds))
165
-					$userGroupIds .= ',';
166
-				else
167
-					$userGroupIds = '';
171
+				if (!empty($userGroupIds)) {
172
+									$userGroupIds .= ',';
173
+				} else {
174
+									$userGroupIds = '';
175
+				}
168 176
 				$userGroupIds .= $currentUser->id;
169 177
 				$qcondition = " && vtiger_crmentity.smownerid IN (" . $userGroupIds . ")";
170 178
 			} else {
Please login to merge, or discard this patch.