@@ -58,22 +58,24 @@ |
||
| 58 | 58 | |
| 59 | 59 | $browser = $_SERVER['HTTP_USER_AGENT']; |
| 60 | 60 | |
| 61 | - if (strpos($browser, 'MSIE') !== false) |
|
| 61 | + if (strpos($browser, 'MSIE') !== false) { |
|
| 62 | + return 'Internet explorer'; |
|
| 63 | + } elseif (strpos($browser, 'Trident') !== false) { |
|
| 64 | + //For Supporting IE 11 |
|
| 62 | 65 | return 'Internet explorer'; |
| 63 | - elseif (strpos($browser, 'Trident') !== false) //For Supporting IE 11 |
|
| 64 | - return 'Internet explorer'; |
|
| 65 | - elseif (strpos($browser, 'Firefox') !== false) |
|
| 66 | - return 'Mozilla Firefox'; |
|
| 67 | - elseif (strpos($browser, 'Chrome') !== false) |
|
| 68 | - return 'Google Chrome'; |
|
| 69 | - elseif (strpos($browser, 'Opera Mini') !== false) |
|
| 70 | - return "Opera Mini"; |
|
| 71 | - elseif (strpos($browser, 'Opera') !== false) |
|
| 72 | - return "Opera"; |
|
| 73 | - elseif (strpos($browser, 'Safari') !== false) |
|
| 74 | - return "Safari"; |
|
| 75 | - else |
|
| 76 | - return 'unknow'; |
|
| 66 | + } elseif (strpos($browser, 'Firefox') !== false) { |
|
| 67 | + return 'Mozilla Firefox'; |
|
| 68 | + } elseif (strpos($browser, 'Chrome') !== false) { |
|
| 69 | + return 'Google Chrome'; |
|
| 70 | + } elseif (strpos($browser, 'Opera Mini') !== false) { |
|
| 71 | + return "Opera Mini"; |
|
| 72 | + } elseif (strpos($browser, 'Opera') !== false) { |
|
| 73 | + return "Opera"; |
|
| 74 | + } elseif (strpos($browser, 'Safari') !== false) { |
|
| 75 | + return "Safari"; |
|
| 76 | + } else { |
|
| 77 | + return 'unknow'; |
|
| 78 | + } |
|
| 77 | 79 | } |
| 78 | 80 | |
| 79 | 81 | static public function checkBlocked() |
@@ -235,18 +235,22 @@ |
||
| 235 | 235 | $lenght = strlen($field); |
| 236 | 236 | $field = str_replace(' ', '_', $field); |
| 237 | 237 | $field = strtolower($field); |
| 238 | - if ('' == $field) |
|
| 239 | - $result = 'not valid'; |
|
| 238 | + if ('' == $field) { |
|
| 239 | + $result = 'not valid'; |
|
| 240 | + } |
|
| 240 | 241 | |
| 241 | - if (preg_match('/[^a-z_A-Z]+/', $field, $matches)) |
|
| 242 | - $result = 'not valid'; |
|
| 242 | + if (preg_match('/[^a-z_A-Z]+/', $field, $matches)) { |
|
| 243 | + $result = 'not valid'; |
|
| 244 | + } |
|
| 243 | 245 | |
| 244 | - if ($lenght > 25) |
|
| 245 | - $result = 'not valid'; |
|
| 246 | + if ($lenght > 25) { |
|
| 247 | + $result = 'not valid'; |
|
| 248 | + } |
|
| 246 | 249 | |
| 247 | - if ($result == 'not valid') |
|
| 248 | - return false; |
|
| 249 | - else |
|
| 250 | - return $field; |
|
| 250 | + if ($result == 'not valid') { |
|
| 251 | + return false; |
|
| 252 | + } else { |
|
| 253 | + return $field; |
|
| 254 | + } |
|
| 251 | 255 | } |
| 252 | 256 | } |
@@ -76,10 +76,11 @@ discard block |
||
| 76 | 76 | |
| 77 | 77 | $log->debug("Exiting Settings_PublicHoliday_Module_Model::delete() method ..."); |
| 78 | 78 | |
| 79 | - if ($deleted == 1) |
|
| 80 | - return true; |
|
| 81 | - else |
|
| 82 | - return false; |
|
| 79 | + if ($deleted == 1) { |
|
| 80 | + return true; |
|
| 81 | + } else { |
|
| 82 | + return false; |
|
| 83 | + } |
|
| 83 | 84 | } |
| 84 | 85 | |
| 85 | 86 | /** |
@@ -103,10 +104,11 @@ discard block |
||
| 103 | 104 | |
| 104 | 105 | $log->debug("Exiting Settings_PublicHoliday_Module_Model::save() method ..."); |
| 105 | 106 | |
| 106 | - if ($saved == 1) |
|
| 107 | - return true; |
|
| 108 | - else |
|
| 109 | - return false; |
|
| 107 | + if ($saved == 1) { |
|
| 108 | + return true; |
|
| 109 | + } else { |
|
| 110 | + return false; |
|
| 111 | + } |
|
| 110 | 112 | } |
| 111 | 113 | |
| 112 | 114 | /** |
@@ -131,10 +133,11 @@ discard block |
||
| 131 | 133 | |
| 132 | 134 | $log->debug("Exiting Settings_PublicHoliday_Module_Model::edit() method ..."); |
| 133 | 135 | |
| 134 | - if ($saved == 1) |
|
| 135 | - return true; |
|
| 136 | - else |
|
| 137 | - return false; |
|
| 136 | + if ($saved == 1) { |
|
| 137 | + return true; |
|
| 138 | + } else { |
|
| 139 | + return false; |
|
| 140 | + } |
|
| 138 | 141 | } |
| 139 | 142 | |
| 140 | 143 | /** |
@@ -156,8 +159,9 @@ discard block |
||
| 156 | 159 | |
| 157 | 160 | $log->debug("Exiting Settings_PublicHoliday_Module_Model::checkIfHoliday() method ..."); |
| 158 | 161 | |
| 159 | - if ($num > 0) |
|
| 160 | - return true; |
|
| 162 | + if ($num > 0) { |
|
| 163 | + return true; |
|
| 164 | + } |
|
| 161 | 165 | |
| 162 | 166 | return false; |
| 163 | 167 | } |
@@ -181,9 +185,9 @@ discard block |
||
| 181 | 185 | $sql .= ' GROUP BY `holidaytype`'; |
| 182 | 186 | $result = $db->pquery($sql, $params); |
| 183 | 187 | $numRows = $db->num_rows($result); |
| 184 | - if (0 == $numRows) |
|
| 185 | - $return = false; |
|
| 186 | - else { |
|
| 188 | + if (0 == $numRows) { |
|
| 189 | + $return = false; |
|
| 190 | + } else { |
|
| 187 | 191 | for ($i = 0; $i < $numRows; $i++) { |
| 188 | 192 | $count = $db->query_result($result, $i, 'count'); |
| 189 | 193 | $type = $db->query_result($result, $i, 'holidaytype'); |
@@ -52,10 +52,11 @@ |
||
| 52 | 52 | $ftpPort = $request->get('ftpport'); |
| 53 | 53 | $ftpPath = $request->get('ftppath'); |
| 54 | 54 | $ftpActive = $request->get('ftpactive'); |
| 55 | - if ('true' == $ftpActive) |
|
| 56 | - $ftpActive = true; |
|
| 57 | - else |
|
| 58 | - $ftpActive = false; |
|
| 55 | + if ('true' == $ftpActive) { |
|
| 56 | + $ftpActive = true; |
|
| 57 | + } else { |
|
| 58 | + $ftpActive = false; |
|
| 59 | + } |
|
| 59 | 60 | |
| 60 | 61 | if ('' != $ftpPort) { |
| 61 | 62 | $ftpConnect = @ftp_connect($ftpServerName, $ftpPort); |
@@ -16,8 +16,9 @@ discard block |
||
| 16 | 16 | { |
| 17 | 17 | $conditions = array(); |
| 18 | 18 | $listSearchParams = array(); |
| 19 | - if ($assignedto != '') |
|
| 20 | - array_push($conditions, array('assigned_user_id', 'e', $assignedto)); |
|
| 19 | + if ($assignedto != '') { |
|
| 20 | + array_push($conditions, array('assigned_user_id', 'e', $assignedto)); |
|
| 21 | + } |
|
| 21 | 22 | if (!empty($date)) { |
| 22 | 23 | array_push($conditions, array('due_date', 'bw', $date . ',' . $date . '')); |
| 23 | 24 | } |
@@ -40,8 +41,9 @@ discard block |
||
| 40 | 41 | $sql = "SELECT sum_time AS daytime, due_date, timecontrol_type FROM vtiger_osstimecontrol |
| 41 | 42 | INNER JOIN vtiger_crmentity ON vtiger_osstimecontrol.osstimecontrolid = vtiger_crmentity.crmid |
| 42 | 43 | WHERE vtiger_crmentity.setype = ? && vtiger_crmentity.smownerid = ? "; |
| 43 | - if ($securityParameter != '') |
|
| 44 | - $sql.= $securityParameter; |
|
| 44 | + if ($securityParameter != '') { |
|
| 45 | + $sql.= $securityParameter; |
|
| 46 | + } |
|
| 45 | 47 | $sql .= "AND (vtiger_osstimecontrol.date_start >= ? && vtiger_osstimecontrol.due_date <= ?) && vtiger_osstimecontrol.deleted = 0 ORDER BY due_date "; |
| 46 | 48 | $result = $db->pquery($sql, $param); |
| 47 | 49 | $data = array(); |
@@ -62,20 +64,25 @@ discard block |
||
| 62 | 64 | if (!array_key_exists($row['timecontrol_type'], $timeTypes)) { |
| 63 | 65 | $timeTypes[$row['timecontrol_type']] = $counter++; |
| 64 | 66 | } |
| 65 | - if (!in_array($row['due_date'], $workedDaysAmount) && 'PLL_WORKING_TIME' == $row['timecontrol_type']) |
|
| 66 | - $workedDaysAmount[$row['due_date']] = 1; |
|
| 67 | + if (!in_array($row['due_date'], $workedDaysAmount) && 'PLL_WORKING_TIME' == $row['timecontrol_type']) { |
|
| 68 | + $workedDaysAmount[$row['due_date']] = 1; |
|
| 69 | + } |
|
| 67 | 70 | |
| 68 | - if (!in_array($row['due_date'], $holidayDaysAmount) && 'PLL_HOLIDAY' == $row['timecontrol_type']) |
|
| 69 | - $holidayDaysAmount[$row['due_date']] = 1; |
|
| 71 | + if (!in_array($row['due_date'], $holidayDaysAmount) && 'PLL_HOLIDAY' == $row['timecontrol_type']) { |
|
| 72 | + $holidayDaysAmount[$row['due_date']] = 1; |
|
| 73 | + } |
|
| 70 | 74 | |
| 71 | - if ('PLL_WORKING_TIME' == $row['timecontrol_type']) |
|
| 72 | - $sumWorkTime += $row['daytime']; |
|
| 75 | + if ('PLL_WORKING_TIME' == $row['timecontrol_type']) { |
|
| 76 | + $sumWorkTime += $row['daytime']; |
|
| 77 | + } |
|
| 73 | 78 | |
| 74 | - if ('PLL_BREAK_TIME' == $row['timecontrol_type']) |
|
| 75 | - $sumBreakTime += $row['daytime']; |
|
| 79 | + if ('PLL_BREAK_TIME' == $row['timecontrol_type']) { |
|
| 80 | + $sumBreakTime += $row['daytime']; |
|
| 81 | + } |
|
| 76 | 82 | |
| 77 | - if (!in_array($row['due_date'], $days)) |
|
| 78 | - $days[] = $row['due_date']; |
|
| 83 | + if (!in_array($row['due_date'], $days)) { |
|
| 84 | + $days[] = $row['due_date']; |
|
| 85 | + } |
|
| 79 | 86 | } |
| 80 | 87 | |
| 81 | 88 | if ($numRows > 0) { |
@@ -114,17 +121,19 @@ discard block |
||
| 114 | 121 | $response['workingDays'] = $allDaysAndWeekends['workingDays']; |
| 115 | 122 | |
| 116 | 123 | if ($sumWorkTime > 0) { |
| 117 | - if (0 == $workedDaysAmount) |
|
| 118 | - $averageWorkingTime = $sumWorkTime; |
|
| 119 | - else |
|
| 120 | - $averageWorkingTime = $sumWorkTime / $workedDaysAmount; |
|
| 124 | + if (0 == $workedDaysAmount) { |
|
| 125 | + $averageWorkingTime = $sumWorkTime; |
|
| 126 | + } else { |
|
| 127 | + $averageWorkingTime = $sumWorkTime / $workedDaysAmount; |
|
| 128 | + } |
|
| 121 | 129 | } |
| 122 | 130 | |
| 123 | 131 | if ($sumBreakTime > 0) { |
| 124 | - if (0 == $workedDaysAmount) |
|
| 125 | - $averageBreakTime = $sumBreakTime; |
|
| 126 | - else |
|
| 127 | - $averageBreakTime = $sumBreakTime / $workedDaysAmount; |
|
| 132 | + if (0 == $workedDaysAmount) { |
|
| 133 | + $averageBreakTime = $sumBreakTime; |
|
| 134 | + } else { |
|
| 135 | + $averageBreakTime = $sumBreakTime / $workedDaysAmount; |
|
| 136 | + } |
|
| 128 | 137 | } |
| 129 | 138 | |
| 130 | 139 | $response['holiayDays'] = $holidayDaysAmount; |
@@ -160,8 +169,9 @@ discard block |
||
| 160 | 169 | $time['start'] = vtlib\Functions::currentUserDisplayDate($time['start']); |
| 161 | 170 | $time['end'] = vtlib\Functions::currentUserDisplayDate($time['end']); |
| 162 | 171 | |
| 163 | - if ($user == NULL) |
|
| 164 | - $user = $loggedUserId; |
|
| 172 | + if ($user == NULL) { |
|
| 173 | + $user = $loggedUserId; |
|
| 174 | + } |
|
| 165 | 175 | $moduleModel = Vtiger_Module_Model::getInstance($moduleName); |
| 166 | 176 | $widget = Vtiger_Widget_Model::getInstance($linkId, $currentUser->getId()); |
| 167 | 177 | |
@@ -237,12 +247,14 @@ discard block |
||
| 237 | 247 | } |
| 238 | 248 | } |
| 239 | 249 | foreach ($notWorkingDaysType as $key => $value) { |
| 240 | - if ($whatDay == $value) |
|
| 241 | - $isWorkDay = false; |
|
| 250 | + if ($whatDay == $value) { |
|
| 251 | + $isWorkDay = false; |
|
| 252 | + } |
|
| 242 | 253 | } |
| 243 | 254 | |
| 244 | - if ($isWorkDay) |
|
| 245 | - $workDays++; |
|
| 255 | + if ($isWorkDay) { |
|
| 256 | + $workDays++; |
|
| 257 | + } |
|
| 246 | 258 | |
| 247 | 259 | if ($whatDay > 5 && !$isWorkDay && $notWorkingDaysType) { |
| 248 | 260 | $weekends++; |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | namespace Sabre\VObject\Property; |
| 4 | 4 | |
| 5 | 5 | use |
| 6 | - Sabre\VObject\Property; |
|
| 6 | + Sabre\VObject\Property; |
|
| 7 | 7 | |
| 8 | 8 | /** |
| 9 | 9 | * Boolean property. |
@@ -19,66 +19,66 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | class Boolean extends Property { |
| 21 | 21 | |
| 22 | - /** |
|
| 23 | - * Sets a raw value coming from a mimedir (iCalendar/vCard) file. |
|
| 24 | - * |
|
| 25 | - * This has been 'unfolded', so only 1 line will be passed. Unescaping is |
|
| 26 | - * not yet done, but parameters are not included. |
|
| 27 | - * |
|
| 28 | - * @param string $val |
|
| 29 | - * |
|
| 30 | - * @return void |
|
| 31 | - */ |
|
| 32 | - function setRawMimeDirValue($val) { |
|
| 33 | - |
|
| 34 | - $val = strtoupper($val) === 'TRUE' ? true : false; |
|
| 35 | - $this->setValue($val); |
|
| 36 | - |
|
| 37 | - } |
|
| 38 | - |
|
| 39 | - /** |
|
| 40 | - * Returns a raw mime-dir representation of the value. |
|
| 41 | - * |
|
| 42 | - * @return string |
|
| 43 | - */ |
|
| 44 | - function getRawMimeDirValue() { |
|
| 45 | - |
|
| 46 | - return $this->value ? 'TRUE' : 'false'; |
|
| 47 | - |
|
| 48 | - } |
|
| 49 | - |
|
| 50 | - /** |
|
| 51 | - * Returns the type of value. |
|
| 52 | - * |
|
| 53 | - * This corresponds to the VALUE= parameter. Every property also has a |
|
| 54 | - * 'default' valueType. |
|
| 55 | - * |
|
| 56 | - * @return string |
|
| 57 | - */ |
|
| 58 | - function getValueType() { |
|
| 59 | - |
|
| 60 | - return 'BOOLEAN'; |
|
| 61 | - |
|
| 62 | - } |
|
| 63 | - |
|
| 64 | - /** |
|
| 65 | - * Hydrate data from a XML subtree, as it would appear in a xCard or xCal |
|
| 66 | - * object. |
|
| 67 | - * |
|
| 68 | - * @param array $value |
|
| 69 | - * |
|
| 70 | - * @return void |
|
| 71 | - */ |
|
| 72 | - function setXmlValue(array $value) { |
|
| 73 | - |
|
| 74 | - $value = array_map( |
|
| 75 | - function($value) { |
|
| 76 | - return 'true' === $value; |
|
| 77 | - }, |
|
| 78 | - $value |
|
| 79 | - ); |
|
| 80 | - parent::setXmlValue($value); |
|
| 81 | - |
|
| 82 | - } |
|
| 22 | + /** |
|
| 23 | + * Sets a raw value coming from a mimedir (iCalendar/vCard) file. |
|
| 24 | + * |
|
| 25 | + * This has been 'unfolded', so only 1 line will be passed. Unescaping is |
|
| 26 | + * not yet done, but parameters are not included. |
|
| 27 | + * |
|
| 28 | + * @param string $val |
|
| 29 | + * |
|
| 30 | + * @return void |
|
| 31 | + */ |
|
| 32 | + function setRawMimeDirValue($val) { |
|
| 33 | + |
|
| 34 | + $val = strtoupper($val) === 'TRUE' ? true : false; |
|
| 35 | + $this->setValue($val); |
|
| 36 | + |
|
| 37 | + } |
|
| 38 | + |
|
| 39 | + /** |
|
| 40 | + * Returns a raw mime-dir representation of the value. |
|
| 41 | + * |
|
| 42 | + * @return string |
|
| 43 | + */ |
|
| 44 | + function getRawMimeDirValue() { |
|
| 45 | + |
|
| 46 | + return $this->value ? 'TRUE' : 'false'; |
|
| 47 | + |
|
| 48 | + } |
|
| 49 | + |
|
| 50 | + /** |
|
| 51 | + * Returns the type of value. |
|
| 52 | + * |
|
| 53 | + * This corresponds to the VALUE= parameter. Every property also has a |
|
| 54 | + * 'default' valueType. |
|
| 55 | + * |
|
| 56 | + * @return string |
|
| 57 | + */ |
|
| 58 | + function getValueType() { |
|
| 59 | + |
|
| 60 | + return 'BOOLEAN'; |
|
| 61 | + |
|
| 62 | + } |
|
| 63 | + |
|
| 64 | + /** |
|
| 65 | + * Hydrate data from a XML subtree, as it would appear in a xCard or xCal |
|
| 66 | + * object. |
|
| 67 | + * |
|
| 68 | + * @param array $value |
|
| 69 | + * |
|
| 70 | + * @return void |
|
| 71 | + */ |
|
| 72 | + function setXmlValue(array $value) { |
|
| 73 | + |
|
| 74 | + $value = array_map( |
|
| 75 | + function($value) { |
|
| 76 | + return 'true' === $value; |
|
| 77 | + }, |
|
| 78 | + $value |
|
| 79 | + ); |
|
| 80 | + parent::setXmlValue($value); |
|
| 81 | + |
|
| 82 | + } |
|
| 83 | 83 | |
| 84 | 84 | } |