@@ -20,6 +20,9 @@ discard block |
||
| 20 | 20 | $this->parseLine($line); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | + /** |
|
| 24 | + * @param string $line |
|
| 25 | + */ |
|
| 23 | 26 | protected function parseLine($line) |
| 24 | 27 | { |
| 25 | 28 | $tag = substr($line, 1, strpos($line, ':', 1) - 1); |
@@ -65,6 +68,9 @@ discard block |
||
| 65 | 68 | $this->_lastTag = $tag; |
| 66 | 69 | } |
| 67 | 70 | |
| 71 | + /** |
|
| 72 | + * @param string $value |
|
| 73 | + */ |
|
| 68 | 74 | protected function parseOperation($value) |
| 69 | 75 | { |
| 70 | 76 | $this->operations[] = array( |
@@ -16,8 +16,9 @@ discard block |
||
| 16 | 16 | public function parse() |
| 17 | 17 | { |
| 18 | 18 | $tab = $this->prepareFile(); |
| 19 | - foreach ($tab as $line) |
|
| 20 | - $this->parseLine($line); |
|
| 19 | + foreach ($tab as $line) { |
|
| 20 | + $this->parseLine($line); |
|
| 21 | + } |
|
| 21 | 22 | } |
| 22 | 23 | |
| 23 | 24 | protected function parseLine($line) |
@@ -36,10 +37,11 @@ discard block |
||
| 36 | 37 | break; |
| 37 | 38 | case 'NS': |
| 38 | 39 | $code = substr($value, 0, 2); |
| 39 | - if ($code == '22') |
|
| 40 | - $this->ownerName = substr($value, 2); |
|
| 41 | - else if ($code == '23') |
|
| 42 | - $this->accountName = substr($value, 2); |
|
| 40 | + if ($code == '22') { |
|
| 41 | + $this->ownerName = substr($value, 2); |
|
| 42 | + } else if ($code == '23') { |
|
| 43 | + $this->accountName = substr($value, 2); |
|
| 44 | + } |
|
| 43 | 45 | break; |
| 44 | 46 | case '60F': |
| 45 | 47 | $this->openBalance = $this->parseBalance($value); |
@@ -54,10 +56,11 @@ discard block |
||
| 54 | 56 | self::parseOperation($value); |
| 55 | 57 | break; |
| 56 | 58 | case '86': |
| 57 | - if ($this->_lastTag == '61') |
|
| 58 | - $this->parseTransaction($value); |
|
| 59 | - else |
|
| 60 | - $this->info .= $value; |
|
| 59 | + if ($this->_lastTag == '61') { |
|
| 60 | + $this->parseTransaction($value); |
|
| 61 | + } else { |
|
| 62 | + $this->info .= $value; |
|
| 63 | + } |
|
| 61 | 64 | break; |
| 62 | 65 | default: |
| 63 | 66 | break; |
@@ -387,6 +387,7 @@ |
||
| 387 | 387 | * This function accepts the folderid |
| 388 | 388 | * This Generates the Reports under each Reports module |
| 389 | 389 | * This Returns a HTML sring |
| 390 | + * @param boolean $rpt_fldr_id |
|
| 390 | 391 | */ |
| 391 | 392 | public function sgetRptsforFldr($rpt_fldr_id, $paramsList = false) |
| 392 | 393 | { |
@@ -188,9 +188,9 @@ discard block |
||
| 188 | 188 | if ($modulerows) { |
| 189 | 189 | foreach ($modulerows as $resultrow) { |
| 190 | 190 | if ($resultrow['presence'] == '1') |
| 191 | - continue; // skip disabled modules |
|
| 191 | + continue; // skip disabled modules |
|
| 192 | 192 | if ($resultrow['isentitytype'] != '1') |
| 193 | - continue; // skip extension modules |
|
| 193 | + continue; // skip extension modules |
|
| 194 | 194 | if (in_array($resultrow['name'], $restricted_modules)) { // skip restricted modules |
| 195 | 195 | continue; |
| 196 | 196 | } |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | $details = []; |
| 308 | 308 | $details['state'] = $reportfldrow["state"]; |
| 309 | 309 | $details['id'] = $reportfldrow["folderid"]; |
| 310 | - $details['name'] = ($mod_strings[$reportfldrow["foldername"]] == '' ) ? $reportfldrow["foldername"] : $mod_strings[$reportfldrow["foldername"]]; |
|
| 310 | + $details['name'] = ($mod_strings[$reportfldrow["foldername"]] == '') ? $reportfldrow["foldername"] : $mod_strings[$reportfldrow["foldername"]]; |
|
| 311 | 311 | $details['description'] = $reportfldrow["description"]; |
| 312 | 312 | $details['fname'] = popup_decode_html($details['name']); |
| 313 | 313 | $details['fdescription'] = popup_decode_html($reportfldrow["description"]); |
@@ -320,7 +320,7 @@ discard block |
||
| 320 | 320 | $details = []; |
| 321 | 321 | $details['state'] = $reportfldrow["state"]; |
| 322 | 322 | $details['id'] = $reportfldrow["folderid"]; |
| 323 | - $details['name'] = ($mod_strings[$reportfldrow["foldername"]] == '' ) ? $reportfldrow["foldername"] : $mod_strings[$reportfldrow["foldername"]]; |
|
| 323 | + $details['name'] = ($mod_strings[$reportfldrow["foldername"]] == '') ? $reportfldrow["foldername"] : $mod_strings[$reportfldrow["foldername"]]; |
|
| 324 | 324 | $details['description'] = $reportfldrow["description"]; |
| 325 | 325 | $details['fname'] = popup_decode_html($details['name']); |
| 326 | 326 | $details['fdescription'] = popup_decode_html($reportfldrow["description"]); |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | |
| 376 | 376 | if (isPermitted($report["primarymodule"], 'index') == "yes") |
| 377 | 377 | $returndata[] = $report_details; |
| 378 | - }while ($report = $adb->fetch_array($result)); |
|
| 378 | + } while ($report = $adb->fetch_array($result)); |
|
| 379 | 379 | } |
| 380 | 380 | \App\Log::trace("Reports :: ListView->Successfully returned vtiger_report details HTML"); |
| 381 | 381 | return $returndata; |
@@ -462,7 +462,7 @@ discard block |
||
| 462 | 462 | |
| 463 | 463 | if (isPermitted($report["primarymodule"], 'index') == "yes") |
| 464 | 464 | $returndata [$report["folderid"]][] = $report_details; |
| 465 | - }while ($report = $adb->fetch_array($result)); |
|
| 465 | + } while ($report = $adb->fetch_array($result)); |
|
| 466 | 466 | } |
| 467 | 467 | |
| 468 | 468 | if ($rpt_fldr_id !== false) { |
@@ -1264,7 +1264,7 @@ discard block |
||
| 1264 | 1264 | } |
| 1265 | 1265 | |
| 1266 | 1266 | $temp_val = explode(",", $adv_filter_value); |
| 1267 | - if (($column_info[4] == 'D' || ($column_info[4] == 'T' && $column_info[1] != 'time_start' && $column_info[1] != 'time_end') || ($column_info[4] == 'DT')) && ($column_info[4] != '' && $adv_filter_value != '' )) { |
|
| 1267 | + if (($column_info[4] == 'D' || ($column_info[4] == 'T' && $column_info[1] != 'time_start' && $column_info[1] != 'time_end') || ($column_info[4] == 'DT')) && ($column_info[4] != '' && $adv_filter_value != '')) { |
|
| 1268 | 1268 | $val = []; |
| 1269 | 1269 | $countTempVal = count($temp_val); |
| 1270 | 1270 | for ($x = 0; $x < $countTempVal; $x++) { |
@@ -122,10 +122,11 @@ discard block |
||
| 122 | 122 | $this->reportname = decode_html($cachedInfo["reportname"]); |
| 123 | 123 | $this->reportdescription = decode_html($cachedInfo["description"]); |
| 124 | 124 | $this->folderid = $cachedInfo["folderid"]; |
| 125 | - if ($is_admin === true || in_array($cachedInfo["owner"], $subordinate_users) || $cachedInfo["owner"] == $current_user->id) |
|
| 126 | - $this->is_editable = 'true'; |
|
| 127 | - else |
|
| 128 | - $this->is_editable = 'false'; |
|
| 125 | + if ($is_admin === true || in_array($cachedInfo["owner"], $subordinate_users) || $cachedInfo["owner"] == $current_user->id) { |
|
| 126 | + $this->is_editable = 'true'; |
|
| 127 | + } else { |
|
| 128 | + $this->is_editable = 'false'; |
|
| 129 | + } |
|
| 129 | 130 | } else { |
| 130 | 131 | throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED'); |
| 131 | 132 | } |
@@ -136,8 +137,9 @@ discard block |
||
| 136 | 137 | public function updateModuleList($module) |
| 137 | 138 | { |
| 138 | 139 | $adb = PearDatabase::getInstance(); |
| 139 | - if (!isset($module)) |
|
| 140 | - return; |
|
| 140 | + if (!isset($module)) { |
|
| 141 | + return; |
|
| 142 | + } |
|
| 141 | 143 | require_once('include/utils/utils.php'); |
| 142 | 144 | $tabid = \App\Module::getModuleId($module); |
| 143 | 145 | if ($module == 'Calendar') { |
@@ -146,12 +148,14 @@ discard block |
||
| 146 | 148 | $sql = sprintf('SELECT blockid, blocklabel FROM vtiger_blocks WHERE tabid IN (%s)', generateQuestionMarks($tabid)); |
| 147 | 149 | $res = $adb->pquery($sql, [$tabid]); |
| 148 | 150 | $noOfRows = $adb->num_rows($res); |
| 149 | - if ($noOfRows <= 0) |
|
| 150 | - return; |
|
| 151 | + if ($noOfRows <= 0) { |
|
| 152 | + return; |
|
| 153 | + } |
|
| 151 | 154 | for ($index = 0; $index < $noOfRows; ++$index) { |
| 152 | 155 | $blockid = $adb->query_result($res, $index, 'blockid'); |
| 153 | - if (in_array($blockid, $this->module_list[$module])) |
|
| 154 | - continue; |
|
| 156 | + if (in_array($blockid, $this->module_list[$module])) { |
|
| 157 | + continue; |
|
| 158 | + } |
|
| 155 | 159 | $blocklabel = $adb->query_result($res, $index, 'blocklabel'); |
| 156 | 160 | $this->module_list[$module][$blocklabel] = $blockid; |
| 157 | 161 | } |
@@ -181,10 +185,14 @@ discard block |
||
| 181 | 185 | |
| 182 | 186 | if ($modulerows) { |
| 183 | 187 | foreach ($modulerows as $resultrow) { |
| 184 | - if ($resultrow['presence'] == '1') |
|
| 185 | - continue; // skip disabled modules |
|
| 186 | - if ($resultrow['isentitytype'] != '1') |
|
| 187 | - continue; // skip extension modules |
|
| 188 | + if ($resultrow['presence'] == '1') { |
|
| 189 | + continue; |
|
| 190 | + } |
|
| 191 | + // skip disabled modules |
|
| 192 | + if ($resultrow['isentitytype'] != '1') { |
|
| 193 | + continue; |
|
| 194 | + } |
|
| 195 | + // skip extension modules |
|
| 188 | 196 | if (in_array($resultrow['name'], $restricted_modules)) { // skip restricted modules |
| 189 | 197 | continue; |
| 190 | 198 | } |
@@ -215,10 +223,11 @@ discard block |
||
| 215 | 223 | } |
| 216 | 224 | |
| 217 | 225 | if (!empty($blocklabel)) { |
| 218 | - if ($module == 'Calendar' && $blocklabel == 'LBL_CUSTOM_INFORMATION') |
|
| 219 | - $this->module_list[$module][$blockid] = \App\Language::translate($blocklabel, $module); |
|
| 220 | - else |
|
| 221 | - $this->module_list[$module][$blockid] = \App\Language::translate($blocklabel, $module); |
|
| 226 | + if ($module == 'Calendar' && $blocklabel == 'LBL_CUSTOM_INFORMATION') { |
|
| 227 | + $this->module_list[$module][$blockid] = \App\Language::translate($blocklabel, $module); |
|
| 228 | + } else { |
|
| 229 | + $this->module_list[$module][$blockid] = \App\Language::translate($blocklabel, $module); |
|
| 230 | + } |
|
| 222 | 231 | $prev_block_label = $blocklabel; |
| 223 | 232 | } else { |
| 224 | 233 | $this->module_list[$module][$blockid] = \App\Language::translate($prev_block_label, $module); |
@@ -357,13 +366,15 @@ discard block |
||
| 357 | 366 | $report_details ['reportname'] = $report["reportname"]; |
| 358 | 367 | $report_details ['sharingtype'] = $report["sharingtype"]; |
| 359 | 368 | $report_details['folderid'] = $report["folderid"]; |
| 360 | - if ($is_admin === true) |
|
| 361 | - $report_details ['editable'] = 'true'; |
|
| 362 | - else |
|
| 363 | - $report_details['editable'] = 'false'; |
|
| 369 | + if ($is_admin === true) { |
|
| 370 | + $report_details ['editable'] = 'true'; |
|
| 371 | + } else { |
|
| 372 | + $report_details['editable'] = 'false'; |
|
| 373 | + } |
|
| 364 | 374 | |
| 365 | - if (isPermitted($report["primarymodule"], 'index') == "yes") |
|
| 366 | - $returndata[] = $report_details; |
|
| 375 | + if (isPermitted($report["primarymodule"], 'index') == "yes") { |
|
| 376 | + $returndata[] = $report_details; |
|
| 377 | + } |
|
| 367 | 378 | }while ($report = $adb->fetch_array($result)); |
| 368 | 379 | } |
| 369 | 380 | \App\Log::trace("Reports :: ListView->Successfully returned vtiger_report details HTML"); |
@@ -444,13 +455,15 @@ discard block |
||
| 444 | 455 | $report_details['reportname'] = $report["reportname"]; |
| 445 | 456 | $report_details['reporttype'] = $report["reporttype"]; |
| 446 | 457 | $report_details['sharingtype'] = $report["sharingtype"]; |
| 447 | - if ($is_admin === true || in_array($report["owner"], $subordinate_users) || $report["owner"] == $currentUser->getId()) |
|
| 448 | - $report_details['editable'] = 'true'; |
|
| 449 | - else |
|
| 450 | - $report_details['editable'] = 'false'; |
|
| 458 | + if ($is_admin === true || in_array($report["owner"], $subordinate_users) || $report["owner"] == $currentUser->getId()) { |
|
| 459 | + $report_details['editable'] = 'true'; |
|
| 460 | + } else { |
|
| 461 | + $report_details['editable'] = 'false'; |
|
| 462 | + } |
|
| 451 | 463 | |
| 452 | - if (isPermitted($report["primarymodule"], 'index') == "yes") |
|
| 453 | - $returndata [$report["folderid"]][] = $report_details; |
|
| 464 | + if (isPermitted($report["primarymodule"], 'index') == "yes") { |
|
| 465 | + $returndata [$report["folderid"]][] = $report_details; |
|
| 466 | + } |
|
| 454 | 467 | }while ($report = $adb->fetch_array($result)); |
| 455 | 468 | } |
| 456 | 469 | |
@@ -565,8 +578,9 @@ discard block |
||
| 565 | 578 | $adb = PearDatabase::getInstance(); |
| 566 | 579 | $currentUser = Users_Privileges_Model::getCurrentUserPrivilegesModel(); |
| 567 | 580 | |
| 568 | - if (is_string($block)) |
|
| 569 | - $block = explode(',', $block); |
|
| 581 | + if (is_string($block)) { |
|
| 582 | + $block = explode(',', $block); |
|
| 583 | + } |
|
| 570 | 584 | $skipTalbes = array('vtiger_attachments'); |
| 571 | 585 | |
| 572 | 586 | $tabid = \App\Module::getModuleId($module); |
@@ -584,10 +598,11 @@ discard block |
||
| 584 | 598 | $sql .= ' and tablename NOT IN (' . generateQuestionMarks($skipTalbes) . ') '; |
| 585 | 599 | |
| 586 | 600 | //fix for Ticket #4016 |
| 587 | - if ($module == "Calendar") |
|
| 588 | - $sql .= " group by vtiger_field.fieldlabel order by sequence"; |
|
| 589 | - else |
|
| 590 | - $sql .= " group by vtiger_field.fieldid order by sequence"; |
|
| 601 | + if ($module == "Calendar") { |
|
| 602 | + $sql .= " group by vtiger_field.fieldlabel order by sequence"; |
|
| 603 | + } else { |
|
| 604 | + $sql .= " group by vtiger_field.fieldid order by sequence"; |
|
| 605 | + } |
|
| 591 | 606 | array_push($params, $skipTalbes); |
| 592 | 607 | |
| 593 | 608 | $result = $adb->pquery($sql, $params); |
@@ -629,8 +644,9 @@ discard block |
||
| 629 | 644 | $this->adv_rel_fields[$fieldtypeofdata][] = $adv_rel_field_tod_value; |
| 630 | 645 | } |
| 631 | 646 | //added to escape attachments fields in Reports as we have multiple attachments |
| 632 | - if ($module == 'HelpDesk' && $fieldname == 'filename') |
|
| 633 | - continue; |
|
| 647 | + if ($module == 'HelpDesk' && $fieldname == 'filename') { |
|
| 648 | + continue; |
|
| 649 | + } |
|
| 634 | 650 | |
| 635 | 651 | if (is_string($block) || $group_res_by_block === false) { |
| 636 | 652 | $module_columnlist[$optionvalue] = $fieldlabel; |
@@ -868,8 +884,9 @@ discard block |
||
| 868 | 884 | |
| 869 | 885 | $result = $adb->pquery($ssql, array($reportid, $groupId)); |
| 870 | 886 | $noOfColumns = $adb->num_rows($result); |
| 871 | - if ($noOfColumns <= 0) |
|
| 872 | - continue; |
|
| 887 | + if ($noOfColumns <= 0) { |
|
| 888 | + continue; |
|
| 889 | + } |
|
| 873 | 890 | |
| 874 | 891 | while ($relcriteriarow = $adb->fetch_array($result)) { |
| 875 | 892 | $criteria = []; |
@@ -925,8 +942,9 @@ discard block |
||
| 925 | 942 | $i++; |
| 926 | 943 | } |
| 927 | 944 | // Clear the condition (and/or) for last group, if any. |
| 928 | - if (!empty($advft_criteria[$i - 1]['condition'])) |
|
| 929 | - $advft_criteria[$i - 1]['condition'] = ''; |
|
| 945 | + if (!empty($advft_criteria[$i - 1]['condition'])) { |
|
| 946 | + $advft_criteria[$i - 1]['condition'] = ''; |
|
| 947 | + } |
|
| 930 | 948 | $this->advft_criteria = $advft_criteria; |
| 931 | 949 | \App\Log::trace("Reports :: Successfully returned getAdvancedFilterList"); |
| 932 | 950 | return true; |
@@ -1167,13 +1185,15 @@ discard block |
||
| 1167 | 1185 | $idelrelcriteriagroupsql = 'delete from vtiger_relcriteria_grouping where queryid=?'; |
| 1168 | 1186 | $adb->pquery($idelrelcriteriagroupsql, array($reportid)); |
| 1169 | 1187 | |
| 1170 | - if (empty($advft_criteria)) |
|
| 1171 | - return; |
|
| 1188 | + if (empty($advft_criteria)) { |
|
| 1189 | + return; |
|
| 1190 | + } |
|
| 1172 | 1191 | |
| 1173 | 1192 | foreach ($advft_criteria as $column_index => $column_condition) { |
| 1174 | 1193 | |
| 1175 | - if (empty($column_condition)) |
|
| 1176 | - continue; |
|
| 1194 | + if (empty($column_condition)) { |
|
| 1195 | + continue; |
|
| 1196 | + } |
|
| 1177 | 1197 | |
| 1178 | 1198 | $adv_filter_column = $column_condition["columnname"]; |
| 1179 | 1199 | $adv_filter_comparator = $column_condition["comparator"]; |
@@ -1234,10 +1254,13 @@ discard block |
||
| 1234 | 1254 | |
| 1235 | 1255 | foreach ($advft_criteria_groups as $group_index => $group_condition_info) { |
| 1236 | 1256 | |
| 1237 | - if (empty($group_condition_info)) |
|
| 1238 | - continue; |
|
| 1239 | - if (empty($group_condition_info["conditionexpression"])) |
|
| 1240 | - continue; // Case when the group doesn't have any column criteria |
|
| 1257 | + if (empty($group_condition_info)) { |
|
| 1258 | + continue; |
|
| 1259 | + } |
|
| 1260 | + if (empty($group_condition_info["conditionexpression"])) { |
|
| 1261 | + continue; |
|
| 1262 | + } |
|
| 1263 | + // Case when the group doesn't have any column criteria |
|
| 1241 | 1264 | |
| 1242 | 1265 | $irelcriteriagroupsql = "insert into vtiger_relcriteria_grouping(GROUPID,QUERYID,GROUP_CONDITION,CONDITION_EXPRESSION) values (?,?,?,?)"; |
| 1243 | 1266 | $adb->pquery($irelcriteriagroupsql, array($group_index, $reportid, $group_condition_info["groupcondition"], $group_condition_info["conditionexpression"])); |
@@ -340,6 +340,9 @@ |
||
| 340 | 340 | return $rolesAndSubHTML; |
| 341 | 341 | } |
| 342 | 342 | |
| 343 | + /** |
|
| 344 | + * @param Users $user |
|
| 345 | + */ |
|
| 343 | 346 | public static function getScheduledReports($adb, $user) |
| 344 | 347 | { |
| 345 | 348 | |
@@ -258,8 +258,9 @@ discard block |
||
| 258 | 258 | public static function generateRecipientOption($type, $value, $name = '') |
| 259 | 259 | { |
| 260 | 260 | switch ($type) { |
| 261 | - case 'users' : if (empty($name)) |
|
| 262 | - $name = \App\Fields\Owner::getUserLabel($value); |
|
| 261 | + case 'users' : if (empty($name)) { |
|
| 262 | + $name = \App\Fields\Owner::getUserLabel($value); |
|
| 263 | + } |
|
| 263 | 264 | $optionName = 'User::' . addslashes(decode_html($name)); |
| 264 | 265 | $optionValue = 'users::' . $value; |
| 265 | 266 | break; |
@@ -269,13 +270,15 @@ discard block |
||
| 269 | 270 | $optionName = 'Group::' . addslashes(decode_html($name)); |
| 270 | 271 | $optionValue = 'groups::' . $value; |
| 271 | 272 | break; |
| 272 | - case 'roles' : if (empty($name)) |
|
| 273 | - $name = \App\PrivilegeUtil::getRoleName($value); |
|
| 273 | + case 'roles' : if (empty($name)) { |
|
| 274 | + $name = \App\PrivilegeUtil::getRoleName($value); |
|
| 275 | + } |
|
| 274 | 276 | $optionName = 'Roles::' . addslashes(decode_html($name)); |
| 275 | 277 | $optionValue = 'roles::' . $value; |
| 276 | 278 | break; |
| 277 | - case 'rs' : if (empty($name)) |
|
| 278 | - $name = \App\PrivilegeUtil::getRoleName($value); |
|
| 279 | + case 'rs' : if (empty($name)) { |
|
| 280 | + $name = \App\PrivilegeUtil::getRoleName($value); |
|
| 281 | + } |
|
| 279 | 282 | $optionName = 'RoleAndSubordinates::' . addslashes(decode_html($name)); |
| 280 | 283 | $optionValue = 'rs::' . $value; |
| 281 | 284 | break; |
@@ -375,10 +378,12 @@ discard block |
||
| 375 | 378 | |
| 376 | 379 | $currentModule = vglobal('currentModule'); |
| 377 | 380 | $current_language = vglobal('current_language'); |
| 378 | - if (empty($currentModule)) |
|
| 379 | - $currentModule = 'Reports'; |
|
| 380 | - if (empty($current_language)) |
|
| 381 | - vglobal('current_language', 'en_us'); |
|
| 381 | + if (empty($currentModule)) { |
|
| 382 | + $currentModule = 'Reports'; |
|
| 383 | + } |
|
| 384 | + if (empty($current_language)) { |
|
| 385 | + vglobal('current_language', 'en_us'); |
|
| 386 | + } |
|
| 382 | 387 | |
| 383 | 388 | $scheduledReports = self::getScheduledReports($adb, $adminUser); |
| 384 | 389 | foreach ($scheduledReports as $scheduledReport) { |
@@ -938,8 +938,8 @@ discard block |
||
| 938 | 938 | |
| 939 | 939 | /** Gives an array which contains the information for what all roles, groups and user's related module data that is to be shared for the specified parent module and shared module |
| 940 | 940 | |
| 941 | - * @param $par_mod -- parent module name:: Type varchar |
|
| 942 | - * @param $share_mod -- shared module name:: Type varchar |
|
| 941 | + * @param string $par_mod -- parent module name:: Type varchar |
|
| 942 | + * @param string $share_mod -- shared module name:: Type varchar |
|
| 943 | 943 | * @param $userid -- user id:: Type integer |
| 944 | 944 | * @param $def_org_share -- default organization sharing permission array:: Type array |
| 945 | 945 | * @param $mod_sharingrule_members -- Sharing Rule Members array:: Type array |
@@ -1355,9 +1355,9 @@ discard block |
||
| 1355 | 1355 | |
| 1356 | 1356 | /** Function to populate the read/wirte Sharing permissions data for the specified user into the database |
| 1357 | 1357 | * @param $userid -- user id:: Type integer |
| 1358 | - * @param $enttype -- can have the value of User or Group:: Type varchar |
|
| 1358 | + * @param string $enttype -- can have the value of User or Group:: Type varchar |
|
| 1359 | 1359 | * @param $module -- module name:: Type varchar |
| 1360 | - * @param $pertype -- can have the value of read or write:: Type varchar |
|
| 1360 | + * @param string $pertype -- can have the value of read or write:: Type varchar |
|
| 1361 | 1361 | * @param $var_name_arr - Variable to use instead of including the sharing access again |
| 1362 | 1362 | */ |
| 1363 | 1363 | function populateSharingPrivileges($enttype, $userid, $module, $pertype, $var_name_arr = false) |
@@ -1432,10 +1432,10 @@ discard block |
||
| 1432 | 1432 | |
| 1433 | 1433 | /** Function to populate the read/wirte Sharing permissions related module data for the specified user into the database |
| 1434 | 1434 | * @param $userid -- user id:: Type integer |
| 1435 | - * @param $enttype -- can have the value of User or Group:: Type varchar |
|
| 1435 | + * @param string $enttype -- can have the value of User or Group:: Type varchar |
|
| 1436 | 1436 | * @param $module -- module name:: Type varchar |
| 1437 | 1437 | * @param $relmodule -- related module name:: Type varchar |
| 1438 | - * @param $pertype -- can have the value of read or write:: Type varchar |
|
| 1438 | + * @param string $pertype -- can have the value of read or write:: Type varchar |
|
| 1439 | 1439 | * @param $var_name_arr - Variable to use instead of including the sharing access again |
| 1440 | 1440 | */ |
| 1441 | 1441 | function populateRelatedSharingPrivileges($enttype, $userid, $module, $relmodule, $pertype, $var_name_arr = false) |
@@ -592,8 +592,9 @@ discard block |
||
| 592 | 592 | $var_name = $module . '_share_write_permission'; |
| 593 | 593 | } |
| 594 | 594 | // Lookup for the variable if not set through function argument |
| 595 | - if (!$var_name_arr) |
|
| 596 | - $var_name_arr = $$var_name; |
|
| 595 | + if (!$var_name_arr) { |
|
| 596 | + $var_name_arr = $$var_name; |
|
| 597 | + } |
|
| 597 | 598 | $user_arr = []; |
| 598 | 599 | if (sizeof($var_name_arr['ROLE']) > 0) { |
| 599 | 600 | foreach ($var_name_arr['ROLE'] as $roleid => $roleusers) { |
@@ -627,8 +628,9 @@ discard block |
||
| 627 | 628 | $var_name = $module . '_share_write_permission'; |
| 628 | 629 | } |
| 629 | 630 | // Lookup for the variable if not set through function argument |
| 630 | - if (!$var_name_arr) |
|
| 631 | - $var_name_arr = $$var_name; |
|
| 631 | + if (!$var_name_arr) { |
|
| 632 | + $var_name_arr = $$var_name; |
|
| 633 | + } |
|
| 632 | 634 | $grp_arr = []; |
| 633 | 635 | if (sizeof($var_name_arr['GROUP']) > 0) { |
| 634 | 636 | |
@@ -671,8 +673,9 @@ discard block |
||
| 671 | 673 | $var_name = $module . '_' . $relmodule . '_share_write_permission'; |
| 672 | 674 | } |
| 673 | 675 | // Lookup for the variable if not set through function argument |
| 674 | - if (!$var_name_arr) |
|
| 675 | - $var_name_arr = $$var_name; |
|
| 676 | + if (!$var_name_arr) { |
|
| 677 | + $var_name_arr = $$var_name; |
|
| 678 | + } |
|
| 676 | 679 | $user_arr = []; |
| 677 | 680 | if (sizeof($var_name_arr['ROLE']) > 0) { |
| 678 | 681 | foreach ($var_name_arr['ROLE'] as $roleid => $roleusers) { |
@@ -706,8 +709,9 @@ discard block |
||
| 706 | 709 | $var_name = $module . '_' . $relmodule . '_share_write_permission'; |
| 707 | 710 | } |
| 708 | 711 | // Lookup for the variable if not set through function argument |
| 709 | - if (!$var_name_arr) |
|
| 710 | - $var_name_arr = $$var_name; |
|
| 712 | + if (!$var_name_arr) { |
|
| 713 | + $var_name_arr = $$var_name; |
|
| 714 | + } |
|
| 711 | 715 | $grp_arr = []; |
| 712 | 716 | if (sizeof($var_name_arr['GROUP']) > 0) { |
| 713 | 717 | |
@@ -150,7 +150,6 @@ discard block |
||
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | /** Gives an array which contains the information for what all roles, groups and user's related module data that is to be shared for the specified parent module and shared module |
| 153 | - |
|
| 154 | 153 | * @param $par_mod -- parent module name:: Type varchar |
| 155 | 154 | * @param $share_mod -- shared module name:: Type varchar |
| 156 | 155 | * @param $userid -- user id:: Type integer |
@@ -310,7 +309,6 @@ discard block |
||
| 310 | 309 | } |
| 311 | 310 | |
| 312 | 311 | /** Converts the input array to a single string to facilitate the writing of the input array in a flat file |
| 313 | - |
|
| 314 | 312 | * @param $var -- input array:: Type array |
| 315 | 313 | * @returns $code -- contains the whole array in a single string:: Type array |
| 316 | 314 | */ |
@@ -327,7 +325,6 @@ discard block |
||
| 327 | 325 | } |
| 328 | 326 | |
| 329 | 327 | /** Converts the input array to a single string to facilitate the writing of the input array in a flat file |
| 330 | - |
|
| 331 | 328 | * @param $var -- input array:: Type array |
| 332 | 329 | * @returns $code -- contains the whole array in a single string:: Type array |
| 333 | 330 | */ |
@@ -352,7 +349,6 @@ discard block |
||
| 352 | 349 | } |
| 353 | 350 | |
| 354 | 351 | /** Converts the input array to a single string to facilitate the writing of the input array in a flat file |
| 355 | - |
|
| 356 | 352 | * @param $var -- input array:: Type array |
| 357 | 353 | * @returns $code -- contains the whole array in a single string:: Type array |
| 358 | 354 | */ |
@@ -377,7 +373,6 @@ discard block |
||
| 377 | 373 | } |
| 378 | 374 | |
| 379 | 375 | /** Converts the input array to a single string to facilitate the writing of the input array in a flat file |
| 380 | - |
|
| 381 | 376 | * @param $var -- input array:: Type array |
| 382 | 377 | * @returns $code -- contains the whole array in a single string:: Type array |
| 383 | 378 | */ |
@@ -394,7 +389,6 @@ discard block |
||
| 394 | 389 | } |
| 395 | 390 | |
| 396 | 391 | /** Converts the input array to a single string to facilitate the writing of the input array in a flat file |
| 397 | - |
|
| 398 | 392 | * @param $var -- input array:: Type array |
| 399 | 393 | * @returns $code -- contains the whole array in a single string:: Type array |
| 400 | 394 | */ |
@@ -411,7 +405,6 @@ discard block |
||
| 411 | 405 | } |
| 412 | 406 | |
| 413 | 407 | /** Converts the input array to a single string to facilitate the writing of the input array in a flat file |
| 414 | - |
|
| 415 | 408 | * @param $var -- input array:: Type array |
| 416 | 409 | * @returns $code -- contains the whole array in a single string:: Type array |
| 417 | 410 | */ |
@@ -432,7 +425,6 @@ discard block |
||
| 432 | 425 | } |
| 433 | 426 | |
| 434 | 427 | /** Converts the input array to a single string to facilitate the writing of the input array in a flat file |
| 435 | - |
|
| 436 | 428 | * @param $var -- input array:: Type array |
| 437 | 429 | * @returns $code -- contains the whole array in a single string:: Type array |
| 438 | 430 | */ |
@@ -453,7 +445,6 @@ discard block |
||
| 453 | 445 | } |
| 454 | 446 | |
| 455 | 447 | /** Converts the input array to a single string to facilitate the writing of the input array in a flat file |
| 456 | - |
|
| 457 | 448 | * @param $var -- input array:: Type array |
| 458 | 449 | * @returns $code -- contains the whole array in a single string:: Type array |
| 459 | 450 | */ |
@@ -474,7 +465,6 @@ discard block |
||
| 474 | 465 | } |
| 475 | 466 | |
| 476 | 467 | /** Converts the input array to a single string to facilitate the writing of the input array in a flat file |
| 477 | - |
|
| 478 | 468 | * @param $var -- input array:: Type array |
| 479 | 469 | * @returns $code -- contains the whole array in a single string:: Type array |
| 480 | 470 | */ |
@@ -17,6 +17,9 @@ |
||
| 17 | 17 | } |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | + /** |
|
| 21 | + * @param Vtiger_Record_Model $recordModel |
|
| 22 | + */ |
|
| 20 | 23 | public function checkMandatoryFields($recordModel) |
| 21 | 24 | { |
| 22 | 25 | $mandatoryFields = $recordModel->getModule()->getMandatoryFieldModels(); |
@@ -113,6 +113,9 @@ discard block |
||
| 113 | 113 | return []; |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | + /** |
|
| 117 | + * @param Vtiger_Widget_Model $widgetModel |
|
| 118 | + */ |
|
| 116 | 119 | public function setWidgetModel($widgetModel) |
| 117 | 120 | { |
| 118 | 121 | $this->widgetModel = $widgetModel; |
@@ -127,6 +130,9 @@ discard block |
||
| 127 | 130 | } |
| 128 | 131 | } |
| 129 | 132 | |
| 133 | + /** |
|
| 134 | + * @return string |
|
| 135 | + */ |
|
| 130 | 136 | public function getType() |
| 131 | 137 | { |
| 132 | 138 | return $this->extraData['chartType']; |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | if (!isset($groupData[$displayValue]['count'])) { |
| 111 | 111 | $groupData[$displayValue]['count'] = 1; |
| 112 | 112 | } else { |
| 113 | - $groupData[$displayValue]['count'] ++; |
|
| 113 | + $groupData[$displayValue]['count']++; |
|
| 114 | 114 | } |
| 115 | 115 | if (!isset($groupData[$displayValue]['link'])) { |
| 116 | 116 | $moduleModel = $this->getTargetModuleModel(); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | if (!isset($count[$sectorId])) { |
| 128 | 128 | $count[$sectorId] = 1; |
| 129 | 129 | } else { |
| 130 | - $count[$sectorId] ++; |
|
| 130 | + $count[$sectorId]++; |
|
| 131 | 131 | } |
| 132 | 132 | } |
| 133 | 133 | } |
@@ -16,8 +16,6 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | /** |
| 18 | 18 | * Create the name of the Inventory data table |
| 19 | - * @param string $module Module name |
|
| 20 | - * @param string $prefix Prefix table |
|
| 21 | 19 | * @return string Table name |
| 22 | 20 | */ |
| 23 | 21 | public function getTableName($type = 'data') |
@@ -118,8 +116,6 @@ discard block |
||
| 118 | 116 | |
| 119 | 117 | /** |
| 120 | 118 | * Get inventory columns |
| 121 | - * @param string $module Module name |
|
| 122 | - * @param boolean $returnInBlock Should the result be divided into blocks |
|
| 123 | 119 | * @return array Inventory columns |
| 124 | 120 | */ |
| 125 | 121 | public function getColumns() |
@@ -164,7 +160,6 @@ discard block |
||
| 164 | 160 | |
| 165 | 161 | /** |
| 166 | 162 | * Retrieve list of all fields |
| 167 | - * @param string $moduleName Module name |
|
| 168 | 163 | * @return array Fields instance Vtiger_Basic_InventoryField |
| 169 | 164 | */ |
| 170 | 165 | public function getAllFields() |
@@ -133,8 +133,9 @@ discard block |
||
| 133 | 133 | $columns = []; |
| 134 | 134 | foreach ($this->getFields() as $key => $field) { |
| 135 | 135 | $column = $field->getColumnName(); |
| 136 | - if (!empty($column) && $column != '-') |
|
| 137 | - $columns[] = $column; |
|
| 136 | + if (!empty($column) && $column != '-') { |
|
| 137 | + $columns[] = $column; |
|
| 138 | + } |
|
| 138 | 139 | foreach ($field->getCustomColumn() as $name => $field) { |
| 139 | 140 | $columns[] = $name; |
| 140 | 141 | } |
@@ -187,8 +188,9 @@ discard block |
||
| 187 | 188 | } |
| 188 | 189 | $fields = []; |
| 189 | 190 | foreach ($fieldPaths as $fieldPath) { |
| 190 | - if (!is_dir($fieldPath)) |
|
| 191 | - continue; |
|
| 191 | + if (!is_dir($fieldPath)) { |
|
| 192 | + continue; |
|
| 193 | + } |
|
| 192 | 194 | foreach (new DirectoryIterator($fieldPath) as $fileinfo) { |
| 193 | 195 | if ($fileinfo->isFile() && $fileinfo->getFilename() != 'Basic.php') { |
| 194 | 196 | $fieldName = str_replace('.php', '', $fileinfo->getFilename()); |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | |
| 43 | 43 | /** |
| 44 | 44 | * Functions returns webservices meta object |
| 45 | - * @return webservices meta |
|
| 45 | + * @return boolean meta |
|
| 46 | 46 | */ |
| 47 | 47 | public function getMeta() |
| 48 | 48 | { |
@@ -32,6 +32,9 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | + /** |
|
| 36 | + * @param boolean $interactive |
|
| 37 | + */ |
|
| 35 | 38 | public function setArguments($args, $interactive) |
| 36 | 39 | { |
| 37 | 40 | $this->arguments = $args; |
@@ -156,11 +159,18 @@ discard block |
||
| 156 | 159 | } while (true); |
| 157 | 160 | } |
| 158 | 161 | |
| 162 | + /** |
|
| 163 | + * @return string |
|
| 164 | + */ |
|
| 159 | 165 | protected function toAlphaNumeric($value) |
| 160 | 166 | { |
| 161 | 167 | return preg_replace("/[^a-zA-Z0-9_]/", "", $value); |
| 162 | 168 | } |
| 163 | 169 | |
| 170 | + /** |
|
| 171 | + * @param string $dir |
|
| 172 | + * @param string $file_pattern |
|
| 173 | + */ |
|
| 164 | 174 | protected function findFiles($dir, $file_pattern, &$files) |
| 165 | 175 | { |
| 166 | 176 | $items = glob($dir . '/*', GLOB_NOSORT); |
@@ -257,6 +267,9 @@ discard block |
||
| 257 | 267 | echo "DONE.\n"; |
| 258 | 268 | } |
| 259 | 269 | |
| 270 | + /** |
|
| 271 | + * @param string $name |
|
| 272 | + */ |
|
| 260 | 273 | public function find($name) |
| 261 | 274 | { |
| 262 | 275 | return vtlib\Module::getInstance($name); |
@@ -116,8 +116,9 @@ discard block |
||
| 116 | 116 | protected function prompt($msg = '', $type = self::PROMPT_ANY) |
| 117 | 117 | { |
| 118 | 118 | do { |
| 119 | - if ($msg) |
|
| 120 | - echo $msg; |
|
| 119 | + if ($msg) { |
|
| 120 | + echo $msg; |
|
| 121 | + } |
|
| 121 | 122 | $value = trim(fgets(STDIN)); |
| 122 | 123 | |
| 123 | 124 | if (!$value && $type == self::PROMPT_OPTIONAL) { |
@@ -463,8 +464,9 @@ discard block |
||
| 463 | 464 | $filename = basename($file, true); |
| 464 | 465 | $dir = substr($file, 0, strpos($file, $filename)); |
| 465 | 466 | $dir = str_replace('languages/' . self::BASE_LANG_PREFIX, 'languages/' . $languageInformation['prefix'], $dir); |
| 466 | - if (!file_exists($dir)) |
|
| 467 | - mkdir($dir); |
|
| 467 | + if (!file_exists($dir)) { |
|
| 468 | + mkdir($dir); |
|
| 469 | + } |
|
| 468 | 470 | |
| 469 | 471 | if (isset($languageInformation['prefix_value'])) { |
| 470 | 472 | $contents = file_get_contents($file); |