@@ -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()) { |
@@ -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 | |
@@ -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); |
@@ -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; |
@@ -159,6 +159,9 @@ |
||
| 159 | 159 | private $syntax_error; |
| 160 | 160 | private $user; |
| 161 | 161 | |
| 162 | + /** |
|
| 163 | + * @param VTQL_Lexer $lex |
|
| 164 | + */ |
|
| 162 | 165 | public function __construct($user, $lex, $out) |
| 163 | 166 | { |
| 164 | 167 | if (!is_array($out)) { |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | { |
| 90 | 90 | |
| 91 | 91 | public $stateno; /* The state-number */ |
| 92 | - public $major; /* The major token value. This is the code |
|
| 92 | + public $major; /* The major token value. This is the code |
|
| 93 | 93 | * * number for the token at this stack level */ |
| 94 | 94 | public $minor; /* The user-supplied minor token value. This |
| 95 | 95 | * * is the value of the token */ |
@@ -663,17 +663,17 @@ discard block |
||
| 663 | 663 | /** |
| 664 | 664 | * @var int |
| 665 | 665 | */ |
| 666 | - public $yyidx; /* Index of top element in stack */ |
|
| 666 | + public $yyidx; /* Index of top element in stack */ |
|
| 667 | 667 | |
| 668 | 668 | /** |
| 669 | 669 | * @var int |
| 670 | 670 | */ |
| 671 | - public $yyerrcnt; /* Shifts left before out of the error */ |
|
| 671 | + public $yyerrcnt; /* Shifts left before out of the error */ |
|
| 672 | 672 | |
| 673 | 673 | /** |
| 674 | 674 | * @var array |
| 675 | 675 | */ |
| 676 | - public $yystack = []; /* The parser's stack */ |
|
| 676 | + public $yystack = []; /* The parser's stack */ |
|
| 677 | 677 | |
| 678 | 678 | /** |
| 679 | 679 | * For tracing shifts, the names of all terminals and nonterminals |
@@ -782,7 +782,7 @@ discard block |
||
| 782 | 782 | * * which appear on the RHS of the rule, but which are not used |
| 783 | 783 | * * inside the C code. |
| 784 | 784 | */ |
| 785 | - default: break; /* If no destructor action specified: do nothing */ |
|
| 785 | + default: break; /* If no destructor action specified: do nothing */ |
|
| 786 | 786 | } |
| 787 | 787 | } |
| 788 | 788 | |
@@ -1608,7 +1608,7 @@ discard block |
||
| 1608 | 1608 | { |
| 1609 | 1609 | // $yyact; /* The parser action. */ |
| 1610 | 1610 | // $yyendofinput; /* True if we are at the end of input */ |
| 1611 | - $yyerrorhit = 0; /* True if yymajor has invoked an error */ |
|
| 1611 | + $yyerrorhit = 0; /* True if yymajor has invoked an error */ |
|
| 1612 | 1612 | |
| 1613 | 1613 | /* (re)initialize the parser, if necessary */ |
| 1614 | 1614 | if ($this->yyidx === null || $this->yyidx < 0) { |
@@ -611,6 +611,7 @@ discard block |
||
| 611 | 611 | * @param integer $id - accountid |
| 612 | 612 | * @param array $parent_accounts - Array of all the parent accounts |
| 613 | 613 | * returns All the parent accounts of the given accountid in array format |
| 614 | + * @param integer[] $encountered_accounts |
|
| 614 | 615 | */ |
| 615 | 616 | public function __getParentAccounts($id, &$parent_accounts, &$encountered_accounts, $depthBase = 0) |
| 616 | 617 | { |
@@ -673,7 +674,7 @@ discard block |
||
| 673 | 674 | * Function to Recursively get all the child accounts of a given Account |
| 674 | 675 | * @param integer $id - accountid |
| 675 | 676 | * @param array $child_accounts - Array of all the child accounts |
| 676 | - * @param integer $depth - Depth at which the particular account has to be placed in the hierarchy |
|
| 677 | + * @param integer $depthBase - Depth at which the particular account has to be placed in the hierarchy |
|
| 677 | 678 | * returns All the child accounts of the given accountid in array format |
| 678 | 679 | */ |
| 679 | 680 | public function __getChildAccounts($id, &$child_accounts, $depthBase) |
@@ -111,10 +111,11 @@ discard block |
||
| 111 | 111 | $query .= $this->getNonAdminAccessControlQuery('Accounts', $current_user); |
| 112 | 112 | $where_auto = " vtiger_crmentity.deleted = 0 "; |
| 113 | 113 | |
| 114 | - if ($where != '') |
|
| 115 | - $query .= sprintf(' where (%s) && %s', $where, $where_auto); |
|
| 116 | - else |
|
| 117 | - $query .= sprintf(' where %s', $where_auto); |
|
| 114 | + if ($where != '') { |
|
| 115 | + $query .= sprintf(' where (%s) && %s', $where, $where_auto); |
|
| 116 | + } else { |
|
| 117 | + $query .= sprintf(' where %s', $where_auto); |
|
| 118 | + } |
|
| 118 | 119 | |
| 119 | 120 | \App\Log::trace("Exiting create_export_query method ..."); |
| 120 | 121 | return $query; |
@@ -430,8 +431,9 @@ discard block |
||
| 430 | 431 | public function unlinkRelationship($id, $return_module, $return_id, $relatedName = false) |
| 431 | 432 | { |
| 432 | 433 | |
| 433 | - if (empty($return_module) || empty($return_id)) |
|
| 434 | - return; |
|
| 434 | + if (empty($return_module) || empty($return_id)) { |
|
| 435 | + return; |
|
| 436 | + } |
|
| 435 | 437 | |
| 436 | 438 | if ($return_module === 'Campaigns') { |
| 437 | 439 | App\Db::getInstance()->createCommand()->delete('vtiger_campaign_records', ['crmid' => $id, 'campaignid' => $return_id])->execute(); |
@@ -444,8 +446,9 @@ discard block |
||
| 444 | 446 | |
| 445 | 447 | public function save_related_module($module, $crmid, $with_module, $with_crmids, $relatedName = false) |
| 446 | 448 | { |
| 447 | - if (!is_array($with_crmids)) |
|
| 448 | - $with_crmids = [$with_crmids]; |
|
| 449 | + if (!is_array($with_crmids)) { |
|
| 450 | + $with_crmids = [$with_crmids]; |
|
| 451 | + } |
|
| 449 | 452 | if (!in_array($with_module, ['Products', 'Campaigns'])) { |
| 450 | 453 | parent::save_related_module($module, $crmid, $with_module, $with_crmids, $relatedName); |
| 451 | 454 | } else { |
@@ -495,10 +498,12 @@ discard block |
||
| 495 | 498 | continue; |
| 496 | 499 | } |
| 497 | 500 | // Setup the default JOIN conditions if not specified |
| 498 | - if (empty($relmap[1])) |
|
| 499 | - $relmap[1] = $other->table_name; |
|
| 500 | - if (empty($relmap[2])) |
|
| 501 | - $relmap[2] = $relmap[0]; |
|
| 501 | + if (empty($relmap[1])) { |
|
| 502 | + $relmap[1] = $other->table_name; |
|
| 503 | + } |
|
| 504 | + if (empty($relmap[2])) { |
|
| 505 | + $relmap[2] = $relmap[0]; |
|
| 506 | + } |
|
| 502 | 507 | $join .= " LEFT JOIN $tname ON $tname.$relmap[0] = $relmap[1].$relmap[2]"; |
| 503 | 508 | } |
| 504 | 509 | } |
@@ -523,14 +528,16 @@ discard block |
||
| 523 | 528 | public function getRelatedContactsIds($id = null) |
| 524 | 529 | { |
| 525 | 530 | |
| 526 | - if ($id === null) |
|
| 527 | - $id = $this->id; |
|
| 531 | + if ($id === null) { |
|
| 532 | + $id = $this->id; |
|
| 533 | + } |
|
| 528 | 534 | $query = (new \App\Db\Query())->select('contactid')->from('vtiger_contactdetails') |
| 529 | 535 | ->innerJoin('vtiger_crmentity', 'vtiger_contactdetails.contactid = vtiger_crmentity.crmid') |
| 530 | 536 | ->where(['vtiger_contactdetails.parentid' => $id, 'vtiger_crmentity.deleted' => 0]); |
| 531 | 537 | $entityIds = $query->column(); |
| 532 | - if (empty($entityIds)) |
|
| 533 | - $entityIds = []; |
|
| 538 | + if (empty($entityIds)) { |
|
| 539 | + $entityIds = []; |
|
| 540 | + } |
|
| 534 | 541 | |
| 535 | 542 | return $entityIds; |
| 536 | 543 | } |