@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | |
189 | 189 | /** Function to update user to vtiger_role mapping based on the userid |
190 | 190 | * @param $roleid -- Role Id:: Type varchar |
191 | - * @param $userid User Id:: Type integer |
|
191 | + * @param integer $userid User Id:: Type integer |
|
192 | 192 | * |
193 | 193 | */ |
194 | 194 | function updateUser2RoleMapping($roleid, $userid) |
@@ -233,6 +233,7 @@ discard block |
||
233 | 233 | * @param $recordid -- Record Id:: Type integer |
234 | 234 | * @returns yes or no. If Yes means this action is allowed for the currently logged in user. If no means this action is not allowed for the currently logged in user |
235 | 235 | * |
236 | + * @return string |
|
236 | 237 | */ |
237 | 238 | function isPermitted($module, $actionname, $record_id = '') |
238 | 239 | { |
@@ -450,6 +451,9 @@ discard block |
||
450 | 451 | return $permission; |
451 | 452 | } |
452 | 453 | |
454 | +/** |
|
455 | + * @return string |
|
456 | + */ |
|
453 | 457 | function isPermittedBySharing($module, $tabid, $actionid, $record_id) |
454 | 458 | { |
455 | 459 | $userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel(); |
@@ -1525,6 +1529,9 @@ discard block |
||
1525 | 1529 | return $shareGrpList; |
1526 | 1530 | } |
1527 | 1531 | |
1532 | +/** |
|
1533 | + * @param string $data_type |
|
1534 | + */ |
|
1528 | 1535 | function constructList($array, $data_type) |
1529 | 1536 | { |
1530 | 1537 | $log = LoggerManager::getInstance(); |
@@ -405,7 +405,7 @@ discard block |
||
405 | 405 | if (\AppConfig::security('PERMITTED_BY_RECORD_HIERARCHY')) { |
406 | 406 | $userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel(); |
407 | 407 | $role = $userPrivilegesModel->getRoleDetail(); |
408 | - if ((($actionid == 3 || $actionid == 4) && $role->get('previewrelatedrecord') != 0 ) || (($actionid == 0 || $actionid == 1) && $role->get('editrelatedrecord') != 0 )) { |
|
408 | + if ((($actionid == 3 || $actionid == 4) && $role->get('previewrelatedrecord') != 0) || (($actionid == 0 || $actionid == 1) && $role->get('editrelatedrecord') != 0)) { |
|
409 | 409 | $parentRecord = Users_Privileges_Model::getParentRecord($record_id, $module, $role->get('previewrelatedrecord'), $actionid); |
410 | 410 | if ($parentRecord) { |
411 | 411 | $recordMetaData = vtlib\Functions::getCRMRecordMetadata($parentRecord); |
@@ -1084,7 +1084,7 @@ discard block |
||
1084 | 1084 | $query = sprintf("SELECT shareid FROM %s WHERE %s = ?", $tablename, $colNameArr[0]); |
1085 | 1085 | $params = array($grpId); |
1086 | 1086 | if (sizeof($colNameArr) > 1) { |
1087 | - $query .=" or " . $colNameArr[1] . "=?"; |
|
1087 | + $query .= " or " . $colNameArr[1] . "=?"; |
|
1088 | 1088 | array_push($params, $grpId); |
1089 | 1089 | } |
1090 | 1090 | |
@@ -1120,7 +1120,7 @@ discard block |
||
1120 | 1120 | $query = sprintf("SELECT shareid FROM %s WHERE %s = ?", $tablename, $colNameArr[0]); |
1121 | 1121 | $params = array($grpId); |
1122 | 1122 | if (sizeof($colNameArr) > 1) { |
1123 | - $query .=" or " . $colNameArr[1] . "=?"; |
|
1123 | + $query .= " or " . $colNameArr[1] . "=?"; |
|
1124 | 1124 | array_push($params, $grpId); |
1125 | 1125 | } |
1126 | 1126 |
@@ -1732,8 +1732,9 @@ discard block |
||
1732 | 1732 | $params = array($tabid, $fieldname); |
1733 | 1733 | } |
1734 | 1734 | //Postgres 8 fixes |
1735 | - if ($adb->isPostgres()) |
|
1736 | - $query = fixPostgresQuery($query, $log, 0); |
|
1735 | + if ($adb->isPostgres()) { |
|
1736 | + $query = fixPostgresQuery($query, $log, 0); |
|
1737 | + } |
|
1737 | 1738 | |
1738 | 1739 | |
1739 | 1740 | $result = $adb->pquery($query, $params); |
@@ -1741,8 +1742,9 @@ discard block |
||
1741 | 1742 | $log->debug('Exiting getFieldVisibilityPermission method ...'); |
1742 | 1743 | |
1743 | 1744 | // Returns value as a string |
1744 | - if ($adb->num_rows($result) == 0) |
|
1745 | - return '1'; |
|
1745 | + if ($adb->num_rows($result) == 0) { |
|
1746 | + return '1'; |
|
1747 | + } |
|
1746 | 1748 | return ($adb->query_result($result, "0", "visible") . ""); |
1747 | 1749 | } |
1748 | 1750 | } |
@@ -1867,8 +1869,9 @@ discard block |
||
1867 | 1869 | $adb = PearDatabase::getInstance(); |
1868 | 1870 | $sharingModuleArray = []; |
1869 | 1871 | |
1870 | - if (empty($eliminateModules)) |
|
1871 | - $eliminateModules = []; |
|
1872 | + if (empty($eliminateModules)) { |
|
1873 | + $eliminateModules = []; |
|
1874 | + } |
|
1872 | 1875 | |
1873 | 1876 | $query = 'SELECT name FROM vtiger_tab WHERE presence=0 && ownedby = 0 && isentitytype = 1'; |
1874 | 1877 | $query .= " && name NOT IN('" . implode("','", $eliminateModules) . "')"; |
@@ -395,6 +395,9 @@ discard block |
||
395 | 395 | /** Report module information based on used. */ |
396 | 396 | static $_reportmodule_infoperuser_cache = []; |
397 | 397 | |
398 | + /** |
|
399 | + * @param string $reportid |
|
400 | + */ |
|
398 | 401 | static function lookupReport_Info($userid, $reportid) |
399 | 402 | { |
400 | 403 | |
@@ -406,6 +409,9 @@ discard block |
||
406 | 409 | return false; |
407 | 410 | } |
408 | 411 | |
412 | + /** |
|
413 | + * @param string $reportid |
|
414 | + */ |
|
409 | 415 | static function updateReport_Info($userid, $reportid, $primarymodule, $secondarymodules, $reporttype, $reportname, $description, $folderid, $owner) |
410 | 416 | { |
411 | 417 | if (!isset(self::$_reportmodule_infoperuser_cache[$userid])) { |
@@ -428,6 +434,9 @@ discard block |
||
428 | 434 | /** Report module sub-ordinate users information. */ |
429 | 435 | static $_reportmodule_subordinateuserid_cache = []; |
430 | 436 | |
437 | + /** |
|
438 | + * @param string $reportid |
|
439 | + */ |
|
431 | 440 | static function lookupReport_SubordinateUsers($reportid) |
432 | 441 | { |
433 | 442 | if (isset(self::$_reportmodule_subordinateuserid_cache[$reportid])) { |
@@ -436,6 +445,9 @@ discard block |
||
436 | 445 | return false; |
437 | 446 | } |
438 | 447 | |
448 | + /** |
|
449 | + * @param string $reportid |
|
450 | + */ |
|
439 | 451 | static function updateReport_SubordinateUsers($reportid, $userids) |
440 | 452 | { |
441 | 453 | self::$_reportmodule_subordinateuserid_cache[$reportid] = $userids; |
@@ -444,6 +456,9 @@ discard block |
||
444 | 456 | /** Report module information based on used. */ |
445 | 457 | static $_reportmodule_scheduledinfoperuser_cache = []; |
446 | 458 | |
459 | + /** |
|
460 | + * @param string $reportid |
|
461 | + */ |
|
447 | 462 | static function lookupReport_ScheduledInfo($userid, $reportid) |
448 | 463 | { |
449 | 464 | |
@@ -455,6 +470,10 @@ discard block |
||
455 | 470 | return false; |
456 | 471 | } |
457 | 472 | |
473 | + /** |
|
474 | + * @param string $reportid |
|
475 | + * @param boolean $isScheduled |
|
476 | + */ |
|
458 | 477 | static function updateReport_ScheduledInfo($userid, $reportid, $isScheduled, $scheduledFormat, $scheduledInterval, $scheduledRecipients, $scheduledTime) |
459 | 478 | { |
460 | 479 | if (!isset(self::$_reportmodule_scheduledinfoperuser_cache[$userid])) { |
@@ -479,6 +498,9 @@ discard block |
||
479 | 498 | self::$_userSignature[$userName] = $signature; |
480 | 499 | } |
481 | 500 | |
501 | + /** |
|
502 | + * @return string |
|
503 | + */ |
|
482 | 504 | public static function getUserSignature($userName) |
483 | 505 | { |
484 | 506 | return self::$_userSignature[$userName]; |
@@ -491,6 +513,9 @@ discard block |
||
491 | 513 | self::$_userFullName[$userName] = $fullName; |
492 | 514 | } |
493 | 515 | |
516 | + /** |
|
517 | + * @return string |
|
518 | + */ |
|
494 | 519 | public static function getUserFullName($userName) |
495 | 520 | { |
496 | 521 | return self::$_userFullName[$userName]; |
@@ -503,6 +528,9 @@ discard block |
||
503 | 528 | return self::$_report_field_bylabel[$module][$label]; |
504 | 529 | } |
505 | 530 | |
531 | + /** |
|
532 | + * @param string $label |
|
533 | + */ |
|
506 | 534 | public static function setReportFieldByLabel($module, $label, $fieldInfo) |
507 | 535 | { |
508 | 536 | self::$_report_field_bylabel[$module][$label] = $fieldInfo; |
@@ -18,6 +18,9 @@ discard block |
||
18 | 18 | $__cache_vtiger_imagepath = []; |
19 | 19 | } |
20 | 20 | |
21 | +/** |
|
22 | + * @param string $imagename |
|
23 | + */ |
|
21 | 24 | function vtiger_imageurl($imagename, $themename) |
22 | 25 | { |
23 | 26 | global $__cache_vtiger_imagepath; |
@@ -200,6 +203,9 @@ discard block |
||
200 | 203 | } |
201 | 204 | } |
202 | 205 | |
206 | +/** |
|
207 | + * @param string $varname |
|
208 | + */ |
|
203 | 209 | function __vtlib_get_modulevar_value($module, $varname) |
204 | 210 | { |
205 | 211 | $mod_var_mapping = Array( |
@@ -497,7 +503,6 @@ discard block |
||
497 | 503 | /** |
498 | 504 | * Purify (Cleanup) malicious snippets of code from the input |
499 | 505 | * |
500 | - * @param String $value |
|
501 | 506 | * @param Boolean $ignore Skip cleaning of the input |
502 | 507 | * @return String |
503 | 508 | */ |
@@ -156,10 +156,11 @@ discard block |
||
156 | 156 | $old_dieOnError = $adb->dieOnError; |
157 | 157 | $adb->dieOnError = false; |
158 | 158 | |
159 | - if ($enable_disable === true) |
|
160 | - $enable_disable = 1; |
|
161 | - else if ($enable_disable === false) |
|
162 | - $enable_disable = 0; |
|
159 | + if ($enable_disable === true) { |
|
160 | + $enable_disable = 1; |
|
161 | + } else if ($enable_disable === false) { |
|
162 | + $enable_disable = 0; |
|
163 | + } |
|
163 | 164 | |
164 | 165 | $adb->pquery('UPDATE vtiger_language set active = ? WHERE prefix = ?', Array($enable_disable, $langprefix)); |
165 | 166 | |
@@ -195,8 +196,9 @@ discard block |
||
195 | 196 | |
196 | 197 | $checkfor = Array('table_name', 'table_index', 'related_tables', 'popup_fields', 'IsCustomModule'); |
197 | 198 | foreach ($checkfor as $check) { |
198 | - if (!isset($focus->$check)) |
|
199 | - $focus->$check = __vtlib_get_modulevar_value($module, $check); |
|
199 | + if (!isset($focus->$check)) { |
|
200 | + $focus->$check = __vtlib_get_modulevar_value($module, $check); |
|
201 | + } |
|
200 | 202 | } |
201 | 203 | } |
202 | 204 | |
@@ -356,8 +358,9 @@ discard block |
||
356 | 358 | function vtlib_tosingular($text) |
357 | 359 | { |
358 | 360 | $lastpos = strripos($text, 's'); |
359 | - if ($lastpos == strlen($text) - 1) |
|
360 | - return substr($text, 0, -1); |
|
361 | + if ($lastpos == strlen($text) - 1) { |
|
362 | + return substr($text, 0, -1); |
|
363 | + } |
|
361 | 364 | return $text; |
362 | 365 | } |
363 | 366 | |
@@ -377,8 +380,9 @@ discard block |
||
377 | 380 | $roleresCount = $adb->num_rows($roleres); |
378 | 381 | $allroles = []; |
379 | 382 | if ($roleresCount) { |
380 | - for ($index = 0; $index < $roleresCount; ++$index) |
|
381 | - $allroles[] = $adb->query_result($roleres, $index, 'roleid'); |
|
383 | + for ($index = 0; $index < $roleresCount; ++$index) { |
|
384 | + $allroles[] = $adb->query_result($roleres, $index, 'roleid'); |
|
385 | + } |
|
382 | 386 | } |
383 | 387 | sort($allroles); |
384 | 388 | |
@@ -401,8 +405,9 @@ discard block |
||
401 | 405 | foreach ($picklistval_roles as $picklistval => $pickvalroles) { |
402 | 406 | sort($pickvalroles); |
403 | 407 | $diff = array_diff($pickvalroles, $allroles); |
404 | - if (empty($diff)) |
|
405 | - $allrolevalues[] = $picklistval; |
|
408 | + if (empty($diff)) { |
|
409 | + $allrolevalues[] = $picklistval; |
|
410 | + } |
|
406 | 411 | } |
407 | 412 | |
408 | 413 | $log->debug('Exiting ' . __METHOD__ . ' method ...'); |
@@ -479,8 +484,9 @@ discard block |
||
479 | 484 | $tmpfile = 'vtiger' . time() . '-' . rand(1, 1000) . '.tmp'; |
480 | 485 | // Continue the loop unless we find a name that does not exists already. |
481 | 486 | $usefilename = "$dirpath/$tmpfile"; |
482 | - if (!file_exists($usefilename)) |
|
483 | - break; |
|
487 | + if (!file_exists($usefilename)) { |
|
488 | + break; |
|
489 | + } |
|
484 | 490 | } while (true); |
485 | 491 | $fh = @fopen($usefilename, 'a'); |
486 | 492 | if ($fh) { |
@@ -522,8 +528,9 @@ discard block |
||
522 | 528 | if (!$ignore) { |
523 | 529 | // Initialize the instance if it has not yet done |
524 | 530 | if ($__htmlpurifier_instance == false) { |
525 | - if (empty($use_charset)) |
|
526 | - $use_charset = 'UTF-8'; |
|
531 | + if (empty($use_charset)) { |
|
532 | + $use_charset = 'UTF-8'; |
|
533 | + } |
|
527 | 534 | |
528 | 535 | include_once ('libraries/htmlpurifier/library/HTMLPurifier.auto.php'); |
529 | 536 | |
@@ -590,8 +597,9 @@ discard block |
||
590 | 597 | if (!$ignore) { |
591 | 598 | // Initialize the instance if it has not yet done |
592 | 599 | if ($htmlPurifierForHtml == false) { |
593 | - if (empty($use_charset)) |
|
594 | - $use_charset = 'UTF-8'; |
|
600 | + if (empty($use_charset)) { |
|
601 | + $use_charset = 'UTF-8'; |
|
602 | + } |
|
595 | 603 | |
596 | 604 | include_once ('libraries/htmlpurifier/library/HTMLPurifier.auto.php'); |
597 | 605 |
@@ -48,6 +48,9 @@ |
||
48 | 48 | return $row; |
49 | 49 | } |
50 | 50 | |
51 | + /** |
|
52 | + * @param boolean $t |
|
53 | + */ |
|
51 | 54 | public static function sanitizeData($newRow, $meta, $t = null) |
52 | 55 | { |
53 | 56 |
@@ -24,8 +24,9 @@ discard block |
||
24 | 24 | $fieldColumnMapping = $meta->getFieldColumnMapping(); |
25 | 25 | $columnFieldMapping = array_flip($fieldColumnMapping); |
26 | 26 | foreach ($row as $col => $val) { |
27 | - if (array_key_exists($col, $columnFieldMapping)) |
|
28 | - $newRow[$columnFieldMapping[$col]] = $val; |
|
27 | + if (array_key_exists($col, $columnFieldMapping)) { |
|
28 | + $newRow[$columnFieldMapping[$col]] = $val; |
|
29 | + } |
|
29 | 30 | } |
30 | 31 | $newRow = DataTransform::sanitizeData($newRow, $meta, true); |
31 | 32 | return $newRow; |
@@ -149,8 +150,9 @@ discard block |
||
149 | 150 | $allFields = $meta->getFieldColumnMapping(); |
150 | 151 | $newRow = []; |
151 | 152 | foreach ($allFields as $field => $col) { |
152 | - if (isset($row[$field])) |
|
153 | - $newRow[$field] = $row[$field]; |
|
153 | + if (isset($row[$field])) { |
|
154 | + $newRow[$field] = $row[$field]; |
|
155 | + } |
|
154 | 156 | } |
155 | 157 | if (isset($row[$recordString])) { |
156 | 158 | $newRow[$recordString] = $row[$recordString]; |
@@ -41,6 +41,9 @@ |
||
41 | 41 | $$name; |
42 | 42 | } |
43 | 43 | |
44 | + /** |
|
45 | + * @param string $name |
|
46 | + */ |
|
44 | 47 | static function getGlobal($name) |
45 | 48 | { |
46 | 49 | global $$name; |
@@ -10,6 +10,9 @@ |
||
10 | 10 | |
11 | 11 | require_once("include/Webservices/QueryParser.php"); |
12 | 12 | |
13 | +/** |
|
14 | + * @param string $q |
|
15 | + */ |
|
13 | 16 | function vtws_query($q, $user) |
14 | 17 | { |
15 | 18 |
@@ -21,8 +21,9 @@ |
||
21 | 21 | // Cache the instance for re-use |
22 | 22 | $moduleRegex = "/[fF][rR][Oo][Mm]\s+([^\s;]+)/"; |
23 | 23 | $moduleName = ''; |
24 | - if (preg_match($moduleRegex, $q, $m)) |
|
25 | - $moduleName = trim($m[1]); |
|
24 | + if (preg_match($moduleRegex, $q, $m)) { |
|
25 | + $moduleName = trim($m[1]); |
|
26 | + } |
|
26 | 27 | |
27 | 28 | if (!isset($vtws_create_cache[$moduleName]['webserviceobject'])) { |
28 | 29 | $webserviceObject = VtigerWebserviceObject::fromQuery($adb, $q); |
@@ -12,6 +12,9 @@ |
||
12 | 12 | include_once 'include/Webservices/Query.php'; |
13 | 13 | include_once 'include/Webservices/RelatedTypes.php'; |
14 | 14 | |
15 | +/** |
|
16 | + * @param string $query |
|
17 | + */ |
|
15 | 18 | function vtws_query_related($query, $id, $relatedLabel, $user, $filterClause = null) |
16 | 19 | { |
17 | 20 |
@@ -71,7 +71,7 @@ |
||
71 | 71 | if (!empty($filterClause)) { |
72 | 72 | $query .= " " . $filterClause; |
73 | 73 | } |
74 | - $query.=";"; |
|
74 | + $query .= ";"; |
|
75 | 75 | $relatedRecords = vtws_query($query, $user); |
76 | 76 | } |
77 | 77 |
@@ -46,6 +46,9 @@ |
||
46 | 46 | } |
47 | 47 | } |
48 | 48 | |
49 | + /** |
|
50 | + * @param integer $relationId |
|
51 | + */ |
|
49 | 52 | private function getRelationMetaInfo($relationId) |
50 | 53 | { |
51 | 54 | return [ |
@@ -112,6 +112,9 @@ discard block |
||
112 | 112 | return HTTP_Session::id(); |
113 | 113 | } |
114 | 114 | |
115 | + /** |
|
116 | + * @param string $var_name |
|
117 | + */ |
|
115 | 118 | public function set($var_name, $var_value) |
116 | 119 | { |
117 | 120 | //TODO test setRef and getRef combination |
@@ -119,6 +122,9 @@ discard block |
||
119 | 122 | HTTP_Session::set($var_name, $var_value); |
120 | 123 | } |
121 | 124 | |
125 | + /** |
|
126 | + * @param string $name |
|
127 | + */ |
|
122 | 128 | public function get($name) |
123 | 129 | { |
124 | 130 | //echo "<br> getting for: ",$name," :value: ",HTTP_Session::get($name); |