@@ -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); |
@@ -162,6 +162,9 @@ discard block |
||
| 162 | 162 | return $param; |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | +/** |
|
| 166 | + * @param boolean $moduleName |
|
| 167 | + */ |
|
| 165 | 168 | function vtws_getEntityNameFields($moduleName) |
| 166 | 169 | { |
| 167 | 170 | |
@@ -285,6 +288,10 @@ discard block |
||
| 285 | 288 | return vtws_addModuleTypeWebserviceEntity($moduleName, $moduleHandler['file'], $moduleHandler['class'], $isModule); |
| 286 | 289 | } |
| 287 | 290 | |
| 291 | +/** |
|
| 292 | + * @param string $filePath |
|
| 293 | + * @param string $className |
|
| 294 | + */ |
|
| 288 | 295 | function vtws_addModuleTypeWebserviceEntity($moduleName, $filePath, $className) |
| 289 | 296 | { |
| 290 | 297 | $adb = PearDatabase::getInstance(); |
@@ -313,6 +320,10 @@ discard block |
||
| 313 | 320 | } |
| 314 | 321 | } |
| 315 | 322 | |
| 323 | +/** |
|
| 324 | + * @param string $filePath |
|
| 325 | + * @param string $className |
|
| 326 | + */ |
|
| 316 | 327 | function vtws_addActorTypeWebserviceEntityWithName($moduleName, $filePath, $className, $actorNameDetails) |
| 317 | 328 | { |
| 318 | 329 | $adb = PearDatabase::getInstance(); |
@@ -322,6 +333,10 @@ discard block |
||
| 322 | 333 | vtws_addActorTypeName($entityId, $actorNameDetails['fieldNames'], $actorNameDetails['indexField'], $actorNameDetails['tableName']); |
| 323 | 334 | } |
| 324 | 335 | |
| 336 | +/** |
|
| 337 | + * @param string $filePath |
|
| 338 | + * @param string $className |
|
| 339 | + */ |
|
| 325 | 340 | function vtws_addActorTypeWebserviceEntityWithoutName($moduleName, $filePath, $className, $actorNameDetails) |
| 326 | 341 | { |
| 327 | 342 | $adb = PearDatabase::getInstance(); |
@@ -352,6 +367,9 @@ discard block |
||
| 352 | 367 | return $meta->getName($id); |
| 353 | 368 | } |
| 354 | 369 | |
| 370 | +/** |
|
| 371 | + * @param string $name |
|
| 372 | + */ |
|
| 355 | 373 | function vtws_preserveGlobal($name, $value) |
| 356 | 374 | { |
| 357 | 375 | return VTWS_PreserveGlobal::preserveGlobal($name, $value); |
@@ -953,6 +971,11 @@ discard block |
||
| 953 | 971 | return null; |
| 954 | 972 | } |
| 955 | 973 | |
| 974 | +/** |
|
| 975 | + * @param string $label |
|
| 976 | + * |
|
| 977 | + * @return integer|null |
|
| 978 | + */ |
|
| 956 | 979 | function vtws_getWebserviceTranslatedString($label) |
| 957 | 980 | { |
| 958 | 981 | $currentLanguage = vtws_getWebserviceCurrentLanguage(); |
@@ -5,6 +5,9 @@ discard block |
||
| 5 | 5 | $in_started = false; |
| 6 | 6 | $count = false; |
| 7 | 7 | |
| 8 | +/** |
|
| 9 | + * @param integer $count |
|
| 10 | + */ |
|
| 8 | 11 | function incrementN($lexer, $count) |
| 9 | 12 | { |
| 10 | 13 | $i = 0; |
@@ -160,6 +163,9 @@ discard block |
||
| 160 | 163 | } |
| 161 | 164 | } |
| 162 | 165 | |
| 166 | +/** |
|
| 167 | + * @param VTQL_Lexer $lexer |
|
| 168 | + */ |
|
| 163 | 169 | function handleend($lexer, $val) |
| 164 | 170 | { |
| 165 | 171 | return VTQL_Parser::SEMICOLON; |
@@ -179,6 +185,9 @@ discard block |
||
| 179 | 185 | public $mandatory; |
| 180 | 186 | public $current_state; |
| 181 | 187 | |
| 188 | + /** |
|
| 189 | + * @param string $data |
|
| 190 | + */ |
|
| 182 | 191 | public function __construct($data) |
| 183 | 192 | { |
| 184 | 193 | $this->index = 0; |