@@ -31,11 +31,13 @@ |
||
| 31 | 31 | $banks = explode('_', str_replace(".php", "", $file->getFilename())); |
| 32 | 32 | $status = false; |
| 33 | 33 | for ($i = 0; $i < count($bank); $i++) { |
| 34 | - if ($bank[$i] == $banks[1]) |
|
| 35 | - $status = true; |
|
| 34 | + if ($bank[$i] == $banks[1]) { |
|
| 35 | + $status = true; |
|
| 36 | + } |
|
| 37 | + } |
|
| 38 | + if ($status !== true) { |
|
| 39 | + $bank[] = $banks[1]; |
|
| 36 | 40 | } |
| 37 | - if ($status !== true) |
|
| 38 | - $bank[] = $banks[1]; |
|
| 39 | 41 | } |
| 40 | 42 | } |
| 41 | 43 | } |
@@ -57,8 +57,9 @@ discard block |
||
| 57 | 57 | $seq_res = $adb->pquery("SELECT max(sequence) AS max_seq FROM vtiger_settings_field WHERE blockid = ?", array($blockid)); |
| 58 | 58 | if ($adb->num_rows($seq_res) > 0) { |
| 59 | 59 | $cur_seq = $adb->query_result($seq_res, 0, 'max_seq'); |
| 60 | - if ($cur_seq !== null) |
|
| 61 | - $seq = $cur_seq + 1; |
|
| 60 | + if ($cur_seq !== null) { |
|
| 61 | + $seq = $cur_seq + 1; |
|
| 62 | + } |
|
| 62 | 63 | } |
| 63 | 64 | |
| 64 | 65 | $result = $adb->pquery('SELECT 1 FROM vtiger_settings_field WHERE name=?', array($this->LBL_WEBFORMS)); |
@@ -70,8 +71,9 @@ discard block |
||
| 70 | 71 | |
| 71 | 72 | static function checkAdminAccess($user) |
| 72 | 73 | { |
| 73 | - if (\vtlib\Functions::userIsAdministrator($user)) |
|
| 74 | - return; |
|
| 74 | + if (\vtlib\Functions::userIsAdministrator($user)) { |
|
| 75 | + return; |
|
| 76 | + } |
|
| 75 | 77 | |
| 76 | 78 | echo "<table border='0' cellpadding='5' cellspacing='0' width='100%' height='450px'><tr><td align='center'>"; |
| 77 | 79 | echo "<div style='border: 3px solid rgb(153, 153, 153); background-color: rgb(255, 255, 255); width: 55%; position: relative; z-index: 10000000;'> |
@@ -31,11 +31,13 @@ |
||
| 31 | 31 | $banks = explode('_', str_replace(".php", "", $file->getFilename())); |
| 32 | 32 | $status = false; |
| 33 | 33 | for ($i = 0; $i < count($bank); $i++) { |
| 34 | - if ($bank[$i] == $banks[1]) |
|
| 35 | - $status = true; |
|
| 34 | + if ($bank[$i] == $banks[1]) { |
|
| 35 | + $status = true; |
|
| 36 | + } |
|
| 37 | + } |
|
| 38 | + if ($status !== true) { |
|
| 39 | + $bank[] = $banks[1]; |
|
| 36 | 40 | } |
| 37 | - if ($status !== true) |
|
| 38 | - $bank[] = $banks[1]; |
|
| 39 | 41 | } |
| 40 | 42 | } |
| 41 | 43 | } |
@@ -59,8 +59,9 @@ discard block |
||
| 59 | 59 | $seq_res = $adb->pquery("SELECT max(sequence) AS max_seq FROM vtiger_settings_field WHERE blockid = ?", array($blockid)); |
| 60 | 60 | if ($adb->num_rows($seq_res) > 0) { |
| 61 | 61 | $cur_seq = $adb->query_result($seq_res, 0, 'max_seq'); |
| 62 | - if ($cur_seq !== null) |
|
| 63 | - $seq = $cur_seq + 1; |
|
| 62 | + if ($cur_seq !== null) { |
|
| 63 | + $seq = $cur_seq + 1; |
|
| 64 | + } |
|
| 64 | 65 | } |
| 65 | 66 | |
| 66 | 67 | $adb->pquery('INSERT INTO vtiger_settings_field(fieldid, blockid, name, iconpath, description, linkto, sequence) |
@@ -189,10 +190,12 @@ discard block |
||
| 189 | 190 | $visible = $adb->query_result($query, 0, 'visible'); |
| 190 | 191 | self::updateCache($tabid, $visible); |
| 191 | 192 | return true; |
| 192 | - } else |
|
| 193 | - return false; |
|
| 194 | - } else |
|
| 195 | - return true; |
|
| 193 | + } else { |
|
| 194 | + return false; |
|
| 195 | + } |
|
| 196 | + } else { |
|
| 197 | + return true; |
|
| 198 | + } |
|
| 196 | 199 | } |
| 197 | 200 | |
| 198 | 201 | /** |
@@ -205,10 +208,11 @@ discard block |
||
| 205 | 208 | $query1 = $adb->pquery("SELECT * FROM vtiger_links WHERE linktype='DETAILVIEWBASIC' AND |
| 206 | 209 | linklabel = 'View History' && tabid = ?", array($tabid)); |
| 207 | 210 | $row = $adb->num_rows($query1); |
| 208 | - if ($row >= 1) |
|
| 209 | - return true; |
|
| 210 | - else |
|
| 211 | - return false; |
|
| 211 | + if ($row >= 1) { |
|
| 212 | + return true; |
|
| 213 | + } else { |
|
| 214 | + return false; |
|
| 215 | + } |
|
| 212 | 216 | } |
| 213 | 217 | |
| 214 | 218 | /** |
@@ -232,8 +236,9 @@ discard block |
||
| 232 | 236 | { |
| 233 | 237 | if (isset(self::$__cache_modtracker[$tabid])) { |
| 234 | 238 | return true; |
| 235 | - } else |
|
| 236 | - return false; |
|
| 239 | + } else { |
|
| 240 | + return false; |
|
| 241 | + } |
|
| 237 | 242 | } |
| 238 | 243 | |
| 239 | 244 | /** |
@@ -262,8 +267,9 @@ discard block |
||
| 262 | 267 | |
| 263 | 268 | $accessibleModules = $this->getModTrackerEnabledModules(); |
| 264 | 269 | |
| 265 | - if (empty($accessibleModules)) |
|
| 266 | - throw new Exception('Modtracker not enabled for any modules'); |
|
| 270 | + if (empty($accessibleModules)) { |
|
| 271 | + throw new Exception('Modtracker not enabled for any modules'); |
|
| 272 | + } |
|
| 267 | 273 | |
| 268 | 274 | $query = sprintf('SELECT id, module, modifiedtime, vtiger_crmentity.crmid, smownerid, vtiger_modtracker_basic.status |
| 269 | 275 | FROM vtiger_modtracker_basic |
@@ -277,8 +283,9 @@ discard block |
||
| 277 | 283 | $params[] = $entityModule; |
| 278 | 284 | } |
| 279 | 285 | |
| 280 | - if ($limit !== false) |
|
| 281 | - $query .=" LIMIT $limit"; |
|
| 286 | + if ($limit !== false) { |
|
| 287 | + $query .=" LIMIT $limit"; |
|
| 288 | + } |
|
| 282 | 289 | |
| 283 | 290 | $result = $adb->pquery($query, $params); |
| 284 | 291 | |
@@ -306,8 +313,9 @@ discard block |
||
| 306 | 313 | $uniqueIds[] = $record['uniqueid']; |
| 307 | 314 | } |
| 308 | 315 | |
| 309 | - if (!empty($uniqueIds)) |
|
| 310 | - $maxUniqueId = max($uniqueIds); |
|
| 316 | + if (!empty($uniqueIds)) { |
|
| 317 | + $maxUniqueId = max($uniqueIds); |
|
| 318 | + } |
|
| 311 | 319 | |
| 312 | 320 | if (empty($maxUniqueId)) { |
| 313 | 321 | $maxUniqueId = $uniqueId; |
@@ -367,8 +375,9 @@ discard block |
||
| 367 | 375 | for ($i = 0; $i < $adb->num_rows($fieldResult); $i++) { |
| 368 | 376 | $fieldName = $adb->query_result($fieldResult, $i, 'fieldname'); |
| 369 | 377 | if ($fieldName == 'record_id' || $fieldName == 'record_module' || |
| 370 | - $fieldName == 'createdtime') |
|
| 371 | - continue; |
|
| 378 | + $fieldName == 'createdtime') { |
|
| 379 | + continue; |
|
| 380 | + } |
|
| 372 | 381 | |
| 373 | 382 | $field['postvalue'] = $adb->query_result($fieldResult, $i, 'postvalue'); |
| 374 | 383 | $field['prevalue'] = $adb->query_result($fieldResult, $i, 'prevalue'); |
@@ -416,8 +425,9 @@ discard block |
||
| 416 | 425 | ]); |
| 417 | 426 | $isMyRecord = $adb->pquery('SELECT crmid FROM vtiger_crmentity WHERE smownerid <> ? && crmid = ?', array($currentUser->getRealId(), $sourceId)); |
| 418 | 427 | |
| 419 | - if ($adb->num_rows($isMyRecord) > 0) |
|
| 420 | - $adb->pquery("UPDATE vtiger_crmentity SET was_read = 0 WHERE crmid = ?;", array($sourceId)); |
|
| 428 | + if ($adb->num_rows($isMyRecord) > 0) { |
|
| 429 | + $adb->pquery("UPDATE vtiger_crmentity SET was_read = 0 WHERE crmid = ?;", array($sourceId)); |
|
| 430 | + } |
|
| 421 | 431 | } |
| 422 | 432 | |
| 423 | 433 | static function linkRelation($sourceModule, $sourceId, $targetModule, $targetId) |
@@ -52,8 +52,9 @@ |
||
| 52 | 52 | $seq_res = $adb->pquery("SELECT max(sequence) AS max_seq FROM vtiger_settings_field WHERE blockid = ?", array($blockid)); |
| 53 | 53 | if ($adb->num_rows($seq_res) > 0) { |
| 54 | 54 | $cur_seq = $adb->query_result($seq_res, 0, 'max_seq'); |
| 55 | - if ($cur_seq !== null) |
|
| 56 | - $seq = $cur_seq + 1; |
|
| 55 | + if ($cur_seq !== null) { |
|
| 56 | + $seq = $cur_seq + 1; |
|
| 57 | + } |
|
| 57 | 58 | } |
| 58 | 59 | |
| 59 | 60 | $adb->pquery('INSERT INTO vtiger_settings_field(fieldid, blockid, name, iconpath, description, linkto, sequence) |