@@ -54,6 +54,9 @@ discard block |
||
| 54 | 54 | return $user; |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | + /** |
|
| 58 | + * @param Vtiger_Request $request |
|
| 59 | + */ |
|
| 57 | 60 | protected function triggerCheckPermission($handler, $request) |
| 58 | 61 | { |
| 59 | 62 | $moduleName = $request->getModule(); |
@@ -73,6 +76,9 @@ discard block |
||
| 73 | 76 | throw new \Exception\NoPermitted('LBL_NOT_ACCESSIBLE'); |
| 74 | 77 | } |
| 75 | 78 | |
| 79 | + /** |
|
| 80 | + * @param Vtiger_Request $request |
|
| 81 | + */ |
|
| 76 | 82 | protected function triggerPreProcess($handler, $request) |
| 77 | 83 | { |
| 78 | 84 | if ($request->isAjax()) { |
@@ -82,6 +88,9 @@ discard block |
||
| 82 | 88 | $handler->preProcess($request); |
| 83 | 89 | } |
| 84 | 90 | |
| 91 | + /** |
|
| 92 | + * @param Vtiger_Request $request |
|
| 93 | + */ |
|
| 85 | 94 | protected function triggerPostProcess($handler, $request) |
| 86 | 95 | { |
| 87 | 96 | if ($request->isAjax()) { |
@@ -59,6 +59,8 @@ |
||
| 59 | 59 | * Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. |
| 60 | 60 | * All Rights Reserved. |
| 61 | 61 | * Contributor(s): ______________________________________.. |
| 62 | + * @param string $item_id |
|
| 63 | + * @param string $item_summary |
|
| 62 | 64 | */ |
| 63 | 65 | public function track_view($user_id, $current_module, $item_id, $item_summary) |
| 64 | 66 | { |
@@ -80,8 +80,9 @@ |
||
| 80 | 80 | $fieldlists = explode(',', $fieldsname); |
| 81 | 81 | $fl = []; |
| 82 | 82 | foreach ($fieldlists as $w => $c) { |
| 83 | - if (count($fl)) |
|
| 84 | - $fl[] = "' '"; |
|
| 83 | + if (count($fl)) { |
|
| 84 | + $fl[] = "' '"; |
|
| 85 | + } |
|
| 85 | 86 | $fl[] = $c; |
| 86 | 87 | } |
| 87 | 88 | $fieldsname = $adb->concat($fl); |
@@ -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; |
@@ -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]; |
@@ -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 | |
@@ -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); |
@@ -148,6 +148,9 @@ |
||
| 148 | 148 | return false; |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | + /** |
|
| 152 | + * @param string $id |
|
| 153 | + */ |
|
| 151 | 154 | public function retrieve($id) |
| 152 | 155 | { |
| 153 | 156 | |
@@ -270,8 +270,7 @@ |
||
| 270 | 270 | foreach ($moduleFields as $fieldName => $webserviceField) { |
| 271 | 271 | array_push($fields, $this->getDescribeFieldArray($webserviceField)); |
| 272 | 272 | } |
| 273 | - $label = ($app_strings[$this->meta->getObectIndexColumn()]) ? $app_strings[$this->meta->getObectIndexColumn()] : |
|
| 274 | - $this->meta->getObectIndexColumn(); |
|
| 273 | + $label = ($app_strings[$this->meta->getObectIndexColumn()]) ? $app_strings[$this->meta->getObectIndexColumn()] : $this->meta->getObectIndexColumn(); |
|
| 275 | 274 | $this->moduleFields = $fields; |
| 276 | 275 | } |
| 277 | 276 | return $this->moduleFields; |
@@ -15,6 +15,9 @@ |
||
| 15 | 15 | protected static $fieldTypeMapping = []; |
| 16 | 16 | protected static $referenceTypeMapping = []; |
| 17 | 17 | |
| 18 | + /** |
|
| 19 | + * @param PearDatabase $adb |
|
| 20 | + */ |
|
| 18 | 21 | public function __construct($tableName, $webserviceObject, $adb, $user) |
| 19 | 22 | { |
| 20 | 23 | parent::__construct($webserviceObject, $user); |