@@ -197,7 +197,7 @@ |
||
| 197 | 197 | |
| 198 | 198 | /** function used to get whether the pricebook has related with a product or not |
| 199 | 199 | * @param int $id - product id |
| 200 | - * @return true or false - if there are no pricebooks available or associated pricebooks for the product is equal to total number of pricebooks then return false, else return true |
|
| 200 | + * @return boolean|null or false - if there are no pricebooks available or associated pricebooks for the product is equal to total number of pricebooks then return false, else return true |
|
| 201 | 201 | */ |
| 202 | 202 | public function get_pricebook_noproduct($id) |
| 203 | 203 | { |
@@ -103,6 +103,9 @@ discard block |
||
| 103 | 103 | $this->customTables[] = $table; |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | + /** |
|
| 107 | + * @param ReportRunQueryDependencyMatrix $dependencies |
|
| 108 | + */ |
|
| 106 | 109 | public function requireTable($table, $dependencies = null) |
| 107 | 110 | { |
| 108 | 111 | |
@@ -782,6 +785,7 @@ discard block |
||
| 782 | 785 | /** Function to get field that is to be compared in query form for the given Comparator and field |
| 783 | 786 | * @ param $field : field |
| 784 | 787 | * returns the value for the comparator |
| 788 | + * @param string $field |
|
| 785 | 789 | */ |
| 786 | 790 | public function getFilterComparedField($field) |
| 787 | 791 | { |
@@ -2308,6 +2312,11 @@ discard block |
||
| 2308 | 2312 | * HTML strings for |
| 2309 | 2313 | */ |
| 2310 | 2314 | // Performance Optimization: Added parameter directOutput to avoid building big-string! |
| 2315 | + |
|
| 2316 | + /** |
|
| 2317 | + * @param string $outputformat |
|
| 2318 | + * @param string $filtersql |
|
| 2319 | + */ |
|
| 2311 | 2320 | public function GenerateReport($outputformat, $filtersql, $directOutput = false, $startLimit = false, $endLimit = false) |
| 2312 | 2321 | { |
| 2313 | 2322 | $adb = PearDatabase::getInstance(); |
@@ -53,8 +53,9 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | protected function computeDependencies() |
| 55 | 55 | { |
| 56 | - if ($this->computedMatrix !== null) |
|
| 57 | - return; |
|
| 56 | + if ($this->computedMatrix !== null) { |
|
| 57 | + return; |
|
| 58 | + } |
|
| 58 | 59 | |
| 59 | 60 | $this->computedMatrix = array(); |
| 60 | 61 | foreach ($this->matrix as $key => $values) { |
@@ -93,8 +94,9 @@ discard block |
||
| 93 | 94 | |
| 94 | 95 | public function addTable($table) |
| 95 | 96 | { |
| 96 | - if (!empty($table)) |
|
| 97 | - $this->tables[$table] = $table; |
|
| 97 | + if (!empty($table)) { |
|
| 98 | + $this->tables[$table] = $table; |
|
| 99 | + } |
|
| 98 | 100 | } |
| 99 | 101 | |
| 100 | 102 | public function addCustomTable($table) |
@@ -613,8 +615,9 @@ discard block |
||
| 613 | 615 | $access_fields[] = $collistrow["fieldname"]; |
| 614 | 616 | } |
| 615 | 617 | //added to include ticketid for Reports module in select columnlist for all users |
| 616 | - if ($module == "HelpDesk") |
|
| 617 | - $access_fields[] = "ticketid"; |
|
| 618 | + if ($module == "HelpDesk") { |
|
| 619 | + $access_fields[] = "ticketid"; |
|
| 620 | + } |
|
| 618 | 621 | return $access_fields; |
| 619 | 622 | } |
| 620 | 623 | |
@@ -690,8 +693,9 @@ discard block |
||
| 690 | 693 | } |
| 691 | 694 | if ($ordercolumnsequal) { |
| 692 | 695 | $selectedfields = explode(":", $fieldcolname); |
| 693 | - if ($selectedfields[0] == "vtiger_crmentity" . $this->primarymodule) |
|
| 694 | - $selectedfields[0] = "vtiger_crmentity"; |
|
| 696 | + if ($selectedfields[0] == "vtiger_crmentity" . $this->primarymodule) { |
|
| 697 | + $selectedfields[0] = "vtiger_crmentity"; |
|
| 698 | + } |
|
| 695 | 699 | $sSQLList[] = $selectedfields[0] . "." . $selectedfields[1] . " '" . $selectedfields[2] . "'"; |
| 696 | 700 | } |
| 697 | 701 | } |
@@ -743,11 +747,12 @@ discard block |
||
| 743 | 747 | if (trim($value) == 'NULL') { |
| 744 | 748 | $rtvalue = ' is NOT NULL'; |
| 745 | 749 | } elseif (trim($value) != '') { |
| 746 | - if ($columnName) |
|
| 747 | - $rtvalue = ' <> ' . $adb->quote($value) . ' OR ' . $columnName . " IS NULL "; |
|
| 748 | - else |
|
| 749 | - $rtvalue = ' <> ' . $adb->quote($value); |
|
| 750 | - }elseif (trim($value) == '' && $datatype == 'V') { |
|
| 750 | + if ($columnName) { |
|
| 751 | + $rtvalue = ' <> ' . $adb->quote($value) . ' OR ' . $columnName . " IS NULL "; |
|
| 752 | + } else { |
|
| 753 | + $rtvalue = ' <> ' . $adb->quote($value); |
|
| 754 | + } |
|
| 755 | + } elseif (trim($value) == '' && $datatype == 'V') { |
|
| 751 | 756 | $rtvalue = ' <> ' . $adb->quote($value); |
| 752 | 757 | } else { |
| 753 | 758 | $rtvalue = ' is NOT NULL'; |
@@ -878,8 +883,9 @@ discard block |
||
| 878 | 883 | |
| 879 | 884 | $result = $adb->pquery($ssql, array($reportid, $groupId)); |
| 880 | 885 | $noOfColumns = $adb->num_rows($result); |
| 881 | - if ($noOfColumns <= 0) |
|
| 882 | - continue; |
|
| 886 | + if ($noOfColumns <= 0) { |
|
| 887 | + continue; |
|
| 888 | + } |
|
| 883 | 889 | |
| 884 | 890 | while ($relcriteriarow = $adb->fetch_array($result)) { |
| 885 | 891 | $columnIndex = $relcriteriarow["columnindex"]; |
@@ -903,8 +909,9 @@ discard block |
||
| 903 | 909 | $i++; |
| 904 | 910 | } |
| 905 | 911 | // Clear the condition (and/or) for last group, if any. |
| 906 | - if (!empty($advft_criteria[$i - 1]['condition'])) |
|
| 907 | - $advft_criteria[$i - 1]['condition'] = ''; |
|
| 912 | + if (!empty($advft_criteria[$i - 1]['condition'])) { |
|
| 913 | + $advft_criteria[$i - 1]['condition'] = ''; |
|
| 914 | + } |
|
| 908 | 915 | return $advft_criteria; |
| 909 | 916 | } |
| 910 | 917 | |
@@ -1011,11 +1018,12 @@ discard block |
||
| 1011 | 1018 | $end = getValidDBInsertDateTimeValue($date2); |
| 1012 | 1019 | $start = "'$start'"; |
| 1013 | 1020 | $end = "'$end'"; |
| 1014 | - if ($comparator == 'e') |
|
| 1015 | - $advfiltergroupsql .= "$tableColumnSql BETWEEN $start AND $end"; |
|
| 1016 | - else |
|
| 1017 | - $advfiltergroupsql .= "$tableColumnSql NOT BETWEEN $start AND $end"; |
|
| 1018 | - }else if ($comparator == 'bw') { |
|
| 1021 | + if ($comparator == 'e') { |
|
| 1022 | + $advfiltergroupsql .= "$tableColumnSql BETWEEN $start AND $end"; |
|
| 1023 | + } else { |
|
| 1024 | + $advfiltergroupsql .= "$tableColumnSql NOT BETWEEN $start AND $end"; |
|
| 1025 | + } |
|
| 1026 | + } else if ($comparator == 'bw') { |
|
| 1019 | 1027 | $values = explode(',', $value); |
| 1020 | 1028 | $startDateTime = explode(' ', $values[0]); |
| 1021 | 1029 | $endDateTime = explode(' ', $values[1]); |
@@ -1067,10 +1075,12 @@ discard block |
||
| 1067 | 1075 | } |
| 1068 | 1076 | //Added to handle yes or no for checkbox field in reports advance filters. -shahul |
| 1069 | 1077 | if ($selectedfields[4] == 'C') { |
| 1070 | - if (strcasecmp(trim($value), "yes") == 0) |
|
| 1071 | - $value = "1"; |
|
| 1072 | - if (strcasecmp(trim($value), "no") == 0) |
|
| 1073 | - $value = "0"; |
|
| 1078 | + if (strcasecmp(trim($value), "yes") == 0) { |
|
| 1079 | + $value = "1"; |
|
| 1080 | + } |
|
| 1081 | + if (strcasecmp(trim($value), "no") == 0) { |
|
| 1082 | + $value = "0"; |
|
| 1083 | + } |
|
| 1074 | 1084 | } |
| 1075 | 1085 | if (in_array($comparator, \App\CustomView::STD_FILTER_CONDITIONS)) { |
| 1076 | 1086 | $columninfo['stdfilter'] = $columninfo['comparator']; |
@@ -1115,13 +1125,15 @@ discard block |
||
| 1115 | 1125 | $advcolsql[] = "vtiger_troubletickets.status" . $this->getAdvComparator($comparator, trim($valuearray[$n]), $datatype); |
| 1116 | 1126 | } else if ($selectedfields[2] == 'Faq_Status') { |
| 1117 | 1127 | $advcolsql[] = "vtiger_faq.status" . $this->getAdvComparator($comparator, trim($valuearray[$n]), $datatype); |
| 1118 | - } else |
|
| 1119 | - $advcolsql[] = $selectedfields[0] . "." . $selectedfields[1] . $this->getAdvComparator($comparator, trim($valuearray[$n]), $datatype); |
|
| 1128 | + } else { |
|
| 1129 | + $advcolsql[] = $selectedfields[0] . "." . $selectedfields[1] . $this->getAdvComparator($comparator, trim($valuearray[$n]), $datatype); |
|
| 1130 | + } |
|
| 1120 | 1131 | } elseif ($selectedfields[1] == 'description') {//when you use comma seperated values. |
| 1121 | - if ($selectedfields[0] == 'vtiger_crmentity' . $this->primarymodule) |
|
| 1122 | - $advcolsql[] = "vtiger_crmentity.description" . $this->getAdvComparator($comparator, trim($valuearray[$n]), $datatype); |
|
| 1123 | - else |
|
| 1124 | - $advcolsql[] = $selectedfields[0] . "." . $selectedfields[1] . $this->getAdvComparator($comparator, trim($valuearray[$n]), $datatype); |
|
| 1132 | + if ($selectedfields[0] == 'vtiger_crmentity' . $this->primarymodule) { |
|
| 1133 | + $advcolsql[] = "vtiger_crmentity.description" . $this->getAdvComparator($comparator, trim($valuearray[$n]), $datatype); |
|
| 1134 | + } else { |
|
| 1135 | + $advcolsql[] = $selectedfields[0] . "." . $selectedfields[1] . $this->getAdvComparator($comparator, trim($valuearray[$n]), $datatype); |
|
| 1136 | + } |
|
| 1125 | 1137 | } elseif ($selectedfields[2] == 'Quotes_Inventory_Manager') { |
| 1126 | 1138 | $advcolsql[] = ("trim($concatSql)" . $this->getAdvComparator($comparator, trim($valuearray[$n]), $datatype)); |
| 1127 | 1139 | } elseif ($selectedfields[1] == 'modifiedby') { |
@@ -1138,7 +1150,7 @@ discard block |
||
| 1138 | 1150 | $this->getAdvComparator($comparator, trim($valuearray[$n]), $datatype); |
| 1139 | 1151 | } |
| 1140 | 1152 | $this->queryPlanner->addTable($tableName); |
| 1141 | - } elseif ($selectedfields[1] == 'shownerid') { |
|
| 1153 | + } elseif ($selectedfields[1] == 'shownerid') { |
|
| 1142 | 1154 | $advcolsql[] = ' u_yf_crmentity_showners.userid' . $this->getAdvComparator($comparator, trim($valuearray[$n]), $datatype); |
| 1143 | 1155 | $this->queryPlanner->addTable('u_yf_crmentity_showners'); |
| 1144 | 1156 | } else { |
@@ -1146,10 +1158,11 @@ discard block |
||
| 1146 | 1158 | } |
| 1147 | 1159 | } |
| 1148 | 1160 | //If negative logic filter ('not equal to', 'does not contain') is used, 'and' condition should be applied instead of 'or' |
| 1149 | - if ($comparator == 'n' || $comparator == 'k') |
|
| 1150 | - $advcolumnsql = implode(" and ", $advcolsql); |
|
| 1151 | - else |
|
| 1152 | - $advcolumnsql = implode(" or ", $advcolsql); |
|
| 1161 | + if ($comparator == 'n' || $comparator == 'k') { |
|
| 1162 | + $advcolumnsql = implode(" and ", $advcolsql); |
|
| 1163 | + } else { |
|
| 1164 | + $advcolumnsql = implode(" or ", $advcolsql); |
|
| 1165 | + } |
|
| 1153 | 1166 | $fieldvalue = " (" . $advcolumnsql . ") "; |
| 1154 | 1167 | } elseif ($selectedfields[1] == 'user_name') { |
| 1155 | 1168 | if ($selectedfields[0] == "vtiger_users" . $this->primarymodule) { |
@@ -1230,18 +1243,20 @@ discard block |
||
| 1230 | 1243 | $fieldvalue = "vtiger_activity.status" . $this->getAdvComparator($comparator, trim($value), $datatype); |
| 1231 | 1244 | } |
| 1232 | 1245 | } else if ($comparator == 'ny') { |
| 1233 | - if ($fieldInfo['uitype'] == '10' || isReferenceUIType($fieldInfo['uitype'])) |
|
| 1234 | - $fieldvalue = "(" . $selectedfields[0] . "." . $selectedfields[1] . " IS NOT NULL && " . $selectedfields[0] . "." . $selectedfields[1] . " != '' && " . $selectedfields[0] . "." . $selectedfields[1] . " != '0')"; |
|
| 1235 | - else |
|
| 1236 | - $fieldvalue = "(" . $selectedfields[0] . "." . $selectedfields[1] . " IS NOT NULL && " . $selectedfields[0] . "." . $selectedfields[1] . " != '')"; |
|
| 1237 | - }elseif ($comparator == 'y' || ($comparator == 'e' && (trim($value) == "NULL" || trim($value) == ''))) { |
|
| 1246 | + if ($fieldInfo['uitype'] == '10' || isReferenceUIType($fieldInfo['uitype'])) { |
|
| 1247 | + $fieldvalue = "(" . $selectedfields[0] . "." . $selectedfields[1] . " IS NOT NULL && " . $selectedfields[0] . "." . $selectedfields[1] . " != '' && " . $selectedfields[0] . "." . $selectedfields[1] . " != '0')"; |
|
| 1248 | + } else { |
|
| 1249 | + $fieldvalue = "(" . $selectedfields[0] . "." . $selectedfields[1] . " IS NOT NULL && " . $selectedfields[0] . "." . $selectedfields[1] . " != '')"; |
|
| 1250 | + } |
|
| 1251 | + } elseif ($comparator == 'y' || ($comparator == 'e' && (trim($value) == "NULL" || trim($value) == ''))) { |
|
| 1238 | 1252 | if ($selectedfields[0] == 'vtiger_inventoryproductrel') { |
| 1239 | 1253 | $selectedfields[0] = 'vtiger_inventoryproductrel' . $moduleName; |
| 1240 | 1254 | } |
| 1241 | - if ($fieldInfo['uitype'] == '10' || isReferenceUIType($fieldInfo['uitype'])) |
|
| 1242 | - $fieldvalue = "(" . $selectedfields[0] . "." . $selectedfields[1] . " IS NULL || " . $selectedfields[0] . "." . $selectedfields[1] . " = '' || " . $selectedfields[0] . "." . $selectedfields[1] . " = '0')"; |
|
| 1243 | - else |
|
| 1244 | - $fieldvalue = "(" . $selectedfields[0] . "." . $selectedfields[1] . " IS NULL || " . $selectedfields[0] . "." . $selectedfields[1] . " = '')"; |
|
| 1255 | + if ($fieldInfo['uitype'] == '10' || isReferenceUIType($fieldInfo['uitype'])) { |
|
| 1256 | + $fieldvalue = "(" . $selectedfields[0] . "." . $selectedfields[1] . " IS NULL || " . $selectedfields[0] . "." . $selectedfields[1] . " = '' || " . $selectedfields[0] . "." . $selectedfields[1] . " = '0')"; |
|
| 1257 | + } else { |
|
| 1258 | + $fieldvalue = "(" . $selectedfields[0] . "." . $selectedfields[1] . " IS NULL || " . $selectedfields[0] . "." . $selectedfields[1] . " = '')"; |
|
| 1259 | + } |
|
| 1245 | 1260 | } elseif ($selectedfields[0] == 'vtiger_inventoryproductrel') { |
| 1246 | 1261 | if ($selectedfields[1] == 'productid') { |
| 1247 | 1262 | $fieldvalue = "vtiger_products$moduleName.productname " . $this->getAdvComparator($comparator, trim($value), $datatype); |
@@ -1287,8 +1302,9 @@ discard block |
||
| 1287 | 1302 | } |
| 1288 | 1303 | } |
| 1289 | 1304 | } |
| 1290 | - if (trim($advfiltersql) != "") |
|
| 1291 | - $advfiltersql = '(' . $advfiltersql . ')'; |
|
| 1305 | + if (trim($advfiltersql) != "") { |
|
| 1306 | + $advfiltersql = '(' . $advfiltersql . ')'; |
|
| 1307 | + } |
|
| 1292 | 1308 | |
| 1293 | 1309 | return $advfiltersql; |
| 1294 | 1310 | } |
@@ -1343,8 +1359,9 @@ discard block |
||
| 1343 | 1359 | |
| 1344 | 1360 | if ($fieldcolname != "none") { |
| 1345 | 1361 | $selectedfields = explode(":", $fieldcolname); |
| 1346 | - if ($selectedfields[0] == "vtiger_crmentity" . $this->primarymodule) |
|
| 1347 | - $selectedfields[0] = "vtiger_crmentity"; |
|
| 1362 | + if ($selectedfields[0] == "vtiger_crmentity" . $this->primarymodule) { |
|
| 1363 | + $selectedfields[0] = "vtiger_crmentity"; |
|
| 1364 | + } |
|
| 1348 | 1365 | |
| 1349 | 1366 | $moduleFieldLabel = $selectedfields[3]; |
| 1350 | 1367 | list($moduleName, $fieldLabel) = explode('__', $moduleFieldLabel, 2); |
@@ -1413,8 +1430,9 @@ discard block |
||
| 1413 | 1430 | { |
| 1414 | 1431 | if ($filtercolumn != "none") { |
| 1415 | 1432 | $selectedfields = explode(":", $filtercolumn); |
| 1416 | - if ($selectedfields[0] == "vtiger_crmentity" . $this->primarymodule) |
|
| 1417 | - $selectedfields[0] = "vtiger_crmentity"; |
|
| 1433 | + if ($selectedfields[0] == "vtiger_crmentity" . $this->primarymodule) { |
|
| 1434 | + $selectedfields[0] = "vtiger_crmentity"; |
|
| 1435 | + } |
|
| 1418 | 1436 | if ($filter == "custom") { |
| 1419 | 1437 | if ($startdate != "0000-00-00" && $enddate != "0000-00-00" && $startdate != "" && |
| 1420 | 1438 | $enddate != "" && $selectedfields[0] != "" && $selectedfields[1] != "") { |
@@ -1447,8 +1465,9 @@ discard block |
||
| 1447 | 1465 | if (!empty($advft_criteria)) { |
| 1448 | 1466 | foreach ($advft_criteria as $column_index => $column_condition) { |
| 1449 | 1467 | |
| 1450 | - if (empty($column_condition)) |
|
| 1451 | - continue; |
|
| 1468 | + if (empty($column_condition)) { |
|
| 1469 | + continue; |
|
| 1470 | + } |
|
| 1452 | 1471 | |
| 1453 | 1472 | $adv_filter_column = $column_condition["columnname"]; |
| 1454 | 1473 | $adv_filter_comparator = $column_condition["comparator"]; |
@@ -1505,10 +1524,12 @@ discard block |
||
| 1505 | 1524 | } |
| 1506 | 1525 | |
| 1507 | 1526 | foreach ($advft_criteria_groups as $group_index => $group_condition_info) { |
| 1508 | - if (empty($group_condition_info)) |
|
| 1509 | - continue; |
|
| 1510 | - if (empty($advfilterlist[$group_index])) |
|
| 1511 | - continue; |
|
| 1527 | + if (empty($group_condition_info)) { |
|
| 1528 | + continue; |
|
| 1529 | + } |
|
| 1530 | + if (empty($advfilterlist[$group_index])) { |
|
| 1531 | + continue; |
|
| 1532 | + } |
|
| 1512 | 1533 | $advfilterlist[$group_index]['condition'] = $group_condition_info["groupcondition"]; |
| 1513 | 1534 | $noOfGroupColumns = count($advfilterlist[$group_index]['columns']); |
| 1514 | 1535 | if (!empty($advfilterlist[$group_index]['columns'][$noOfGroupColumns - 1]['column_condition'])) { |
@@ -1550,8 +1571,9 @@ discard block |
||
| 1550 | 1571 | |
| 1551 | 1572 | if ($fieldcolname != "none") { |
| 1552 | 1573 | $selectedfields = explode(":", $fieldcolname); |
| 1553 | - if ($selectedfields[0] == "vtiger_crmentity" . $this->primarymodule) |
|
| 1554 | - $selectedfields[0] = "vtiger_crmentity"; |
|
| 1574 | + if ($selectedfields[0] == "vtiger_crmentity" . $this->primarymodule) { |
|
| 1575 | + $selectedfields[0] = "vtiger_crmentity"; |
|
| 1576 | + } |
|
| 1555 | 1577 | if ($datefilter == "custom") { |
| 1556 | 1578 | |
| 1557 | 1579 | if ($startdate != "0000-00-00" && $enddate != "0000-00-00" && $selectedfields[0] != "" && $selectedfields[1] != "" && $startdate != '' && $enddate != '') { |
@@ -1640,8 +1662,9 @@ discard block |
||
| 1640 | 1662 | |
| 1641 | 1663 | if ($fieldcolname != "none") { |
| 1642 | 1664 | $selectedfields = explode(":", $fieldcolname); |
| 1643 | - if ($selectedfields[0] == "vtiger_crmentity" . $this->primarymodule) |
|
| 1644 | - $selectedfields[0] = "vtiger_crmentity"; |
|
| 1665 | + if ($selectedfields[0] == "vtiger_crmentity" . $this->primarymodule) { |
|
| 1666 | + $selectedfields[0] = "vtiger_crmentity"; |
|
| 1667 | + } |
|
| 1645 | 1668 | if (stripos($selectedfields[1], 'cf_') == 0 && stristr($selectedfields[1], 'cf_') === true) { |
| 1646 | 1669 | //In sql queries forward slash(/) is treated as query terminator,so to avoid this problem |
| 1647 | 1670 | //the column names are enclosed within ('[]'),which will treat this as part of column name |
@@ -1734,8 +1757,9 @@ discard block |
||
| 1734 | 1757 | $sSQL .= ", "; |
| 1735 | 1758 | $this->orderbylistsql .= ", "; |
| 1736 | 1759 | } |
| 1737 | - if ($selectedfields[0] == "vtiger_crmentity" . $this->primarymodule) |
|
| 1738 | - $selectedfields[0] = "vtiger_crmentity"; |
|
| 1760 | + if ($selectedfields[0] == "vtiger_crmentity" . $this->primarymodule) { |
|
| 1761 | + $selectedfields[0] = "vtiger_crmentity"; |
|
| 1762 | + } |
|
| 1739 | 1763 | $sSQL .= $selectedfields[0] . "." . $selectedfields[1] . " " . $sortorder; |
| 1740 | 1764 | $this->orderbylistsql .= $selectedfields[0] . "." . $selectedfields[1] . " " . $selectedfields[2]; |
| 1741 | 1765 | } |
@@ -2375,8 +2399,9 @@ discard block |
||
| 2375 | 2399 | } |
| 2376 | 2400 | /* STRING TRANSLATION starts */ |
| 2377 | 2401 | $moduleLabel = ''; |
| 2378 | - if (in_array($module, $modules_selected)) |
|
| 2379 | - $moduleLabel = \App\Language::translate($module, $module); |
|
| 2402 | + if (in_array($module, $modules_selected)) { |
|
| 2403 | + $moduleLabel = \App\Language::translate($module, $module); |
|
| 2404 | + } |
|
| 2380 | 2405 | |
| 2381 | 2406 | if (empty($translatedLabel)) { |
| 2382 | 2407 | $translatedLabel = \App\Language::translate(str_replace('__', " ", $fld->name), $module); |
@@ -2456,8 +2481,9 @@ discard block |
||
| 2456 | 2481 | } |
| 2457 | 2482 | // END |
| 2458 | 2483 | |
| 2459 | - if ($is_admin === false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1) |
|
| 2460 | - $picklistarray = $this->getAccessPickListValues(); |
|
| 2484 | + if ($is_admin === false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1) { |
|
| 2485 | + $picklistarray = $this->getAccessPickListValues(); |
|
| 2486 | + } |
|
| 2461 | 2487 | if ($result) { |
| 2462 | 2488 | $y = $adb->getFieldsCount($result); |
| 2463 | 2489 | $arrayHeaders = Array(); |
@@ -2491,10 +2517,11 @@ discard block |
||
| 2491 | 2517 | $headerLabel_tmp = \App\Language::translate($mod_name[0] . " " . $mod_name[1]); |
| 2492 | 2518 | } |
| 2493 | 2519 | } |
| 2494 | - if ($headerLabel == $headerLabel_tmp) |
|
| 2495 | - $headerLabel = \App\Language::translate($headerLabel_tmp); |
|
| 2496 | - else |
|
| 2497 | - $headerLabel = $headerLabel_tmp; |
|
| 2520 | + if ($headerLabel == $headerLabel_tmp) { |
|
| 2521 | + $headerLabel = \App\Language::translate($headerLabel_tmp); |
|
| 2522 | + } else { |
|
| 2523 | + $headerLabel = $headerLabel_tmp; |
|
| 2524 | + } |
|
| 2498 | 2525 | /* STRING TRANSLATION ends */ |
| 2499 | 2526 | $header .= "<td class='rptCellLabel'>" . $headerLabel . "</td>"; |
| 2500 | 2527 | |
@@ -2530,14 +2557,17 @@ discard block |
||
| 2530 | 2557 | $snewvalue = $custom_field_values[1]; |
| 2531 | 2558 | $tnewvalue = $custom_field_values[2]; |
| 2532 | 2559 | } |
| 2533 | - if ($newvalue == "") |
|
| 2534 | - $newvalue = "-"; |
|
| 2560 | + if ($newvalue == "") { |
|
| 2561 | + $newvalue = "-"; |
|
| 2562 | + } |
|
| 2535 | 2563 | |
| 2536 | - if ($snewvalue == "") |
|
| 2537 | - $snewvalue = "-"; |
|
| 2564 | + if ($snewvalue == "") { |
|
| 2565 | + $snewvalue = "-"; |
|
| 2566 | + } |
|
| 2538 | 2567 | |
| 2539 | - if ($tnewvalue == "") |
|
| 2540 | - $tnewvalue = "-"; |
|
| 2568 | + if ($tnewvalue == "") { |
|
| 2569 | + $tnewvalue = "-"; |
|
| 2570 | + } |
|
| 2541 | 2571 | |
| 2542 | 2572 | $valtemplate .= "<tr>"; |
| 2543 | 2573 | |
@@ -2663,8 +2693,9 @@ discard block |
||
| 2663 | 2693 | } elseif ($outputformat == "PDF") { |
| 2664 | 2694 | $sSQL = $this->sGetSQLforReport($this->reportid, $filtersql, $outputformat, false, $startLimit, $endLimit); |
| 2665 | 2695 | $result = $adb->pquery($sSQL, array()); |
| 2666 | - if ($is_admin === false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1) |
|
| 2667 | - $picklistarray = $this->getAccessPickListValues(); |
|
| 2696 | + if ($is_admin === false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1) { |
|
| 2697 | + $picklistarray = $this->getAccessPickListValues(); |
|
| 2698 | + } |
|
| 2668 | 2699 | |
| 2669 | 2700 | if ($result) { |
| 2670 | 2701 | $y = $adb->getFieldsCount($result); |
@@ -2754,45 +2785,49 @@ discard block |
||
| 2754 | 2785 | $value = trim($key); |
| 2755 | 2786 | $arraykey = $value . '__SUM'; |
| 2756 | 2787 | if (isset($keyhdr[$arraykey])) { |
| 2757 | - if ($convert_price) |
|
| 2758 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
| 2759 | - else |
|
| 2760 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
| 2788 | + if ($convert_price) { |
|
| 2789 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
| 2790 | + } else { |
|
| 2791 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
| 2792 | + } |
|
| 2761 | 2793 | $totalpdf[$rowcount][$arraykey] = $conv_value; |
| 2762 | - }else { |
|
| 2794 | + } else { |
|
| 2763 | 2795 | $totalpdf[$rowcount][$arraykey] = ''; |
| 2764 | 2796 | } |
| 2765 | 2797 | |
| 2766 | 2798 | $arraykey = $value . '__AVG'; |
| 2767 | 2799 | if (isset($keyhdr[$arraykey])) { |
| 2768 | - if ($convert_price) |
|
| 2769 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
| 2770 | - else |
|
| 2771 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
| 2800 | + if ($convert_price) { |
|
| 2801 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
| 2802 | + } else { |
|
| 2803 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
| 2804 | + } |
|
| 2772 | 2805 | $totalpdf[$rowcount][$arraykey] = $conv_value; |
| 2773 | - }else { |
|
| 2806 | + } else { |
|
| 2774 | 2807 | $totalpdf[$rowcount][$arraykey] = ''; |
| 2775 | 2808 | } |
| 2776 | 2809 | |
| 2777 | 2810 | $arraykey = $value . '__MIN'; |
| 2778 | 2811 | if (isset($keyhdr[$arraykey])) { |
| 2779 | - if ($convert_price) |
|
| 2780 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
| 2781 | - else |
|
| 2782 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
| 2812 | + if ($convert_price) { |
|
| 2813 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
| 2814 | + } else { |
|
| 2815 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
| 2816 | + } |
|
| 2783 | 2817 | $totalpdf[$rowcount][$arraykey] = $conv_value; |
| 2784 | - }else { |
|
| 2818 | + } else { |
|
| 2785 | 2819 | $totalpdf[$rowcount][$arraykey] = ''; |
| 2786 | 2820 | } |
| 2787 | 2821 | |
| 2788 | 2822 | $arraykey = $value . '__MAX'; |
| 2789 | 2823 | if (isset($keyhdr[$arraykey])) { |
| 2790 | - if ($convert_price) |
|
| 2791 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
| 2792 | - else |
|
| 2793 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
| 2824 | + if ($convert_price) { |
|
| 2825 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
| 2826 | + } else { |
|
| 2827 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
| 2828 | + } |
|
| 2794 | 2829 | $totalpdf[$rowcount][$arraykey] = $conv_value; |
| 2795 | - }else { |
|
| 2830 | + } else { |
|
| 2796 | 2831 | $totalpdf[$rowcount][$arraykey] = ''; |
| 2797 | 2832 | } |
| 2798 | 2833 | $rowcount++; |
@@ -2866,45 +2901,49 @@ discard block |
||
| 2866 | 2901 | $value = trim($key); |
| 2867 | 2902 | $arraykey = $value . '__SUM'; |
| 2868 | 2903 | if (isset($keyhdr[$arraykey])) { |
| 2869 | - if ($convert_price) |
|
| 2870 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
| 2871 | - else |
|
| 2872 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
| 2904 | + if ($convert_price) { |
|
| 2905 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
| 2906 | + } else { |
|
| 2907 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
| 2908 | + } |
|
| 2873 | 2909 | $coltotalhtml .= '<td class="rptTotal">' . $conv_value . '</td>'; |
| 2874 | - }else { |
|
| 2910 | + } else { |
|
| 2875 | 2911 | $coltotalhtml .= '<td class="rptTotal"> </td>'; |
| 2876 | 2912 | } |
| 2877 | 2913 | |
| 2878 | 2914 | $arraykey = $value . '__AVG'; |
| 2879 | 2915 | if (isset($keyhdr[$arraykey])) { |
| 2880 | - if ($convert_price) |
|
| 2881 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
| 2882 | - else |
|
| 2883 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
| 2916 | + if ($convert_price) { |
|
| 2917 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
| 2918 | + } else { |
|
| 2919 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
| 2920 | + } |
|
| 2884 | 2921 | $coltotalhtml .= '<td class="rptTotal">' . $conv_value . '</td>'; |
| 2885 | - }else { |
|
| 2922 | + } else { |
|
| 2886 | 2923 | $coltotalhtml .= '<td class="rptTotal"> </td>'; |
| 2887 | 2924 | } |
| 2888 | 2925 | |
| 2889 | 2926 | $arraykey = $value . '__MIN'; |
| 2890 | 2927 | if (isset($keyhdr[$arraykey])) { |
| 2891 | - if ($convert_price) |
|
| 2892 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
| 2893 | - else |
|
| 2894 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
| 2928 | + if ($convert_price) { |
|
| 2929 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
| 2930 | + } else { |
|
| 2931 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
| 2932 | + } |
|
| 2895 | 2933 | $coltotalhtml .= '<td class="rptTotal">' . $conv_value . '</td>'; |
| 2896 | - }else { |
|
| 2934 | + } else { |
|
| 2897 | 2935 | $coltotalhtml .= '<td class="rptTotal"> </td>'; |
| 2898 | 2936 | } |
| 2899 | 2937 | |
| 2900 | 2938 | $arraykey = $value . '__MAX'; |
| 2901 | 2939 | if (isset($keyhdr[$arraykey])) { |
| 2902 | - if ($convert_price) |
|
| 2903 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
| 2904 | - else |
|
| 2905 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
| 2940 | + if ($convert_price) { |
|
| 2941 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
| 2942 | + } else { |
|
| 2943 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
| 2944 | + } |
|
| 2906 | 2945 | $coltotalhtml .= '<td class="rptTotal">' . $conv_value . '</td>'; |
| 2907 | - }else { |
|
| 2946 | + } else { |
|
| 2908 | 2947 | $coltotalhtml .= '<td class="rptTotal"> </td>'; |
| 2909 | 2948 | } |
| 2910 | 2949 | |
@@ -2932,8 +2971,9 @@ discard block |
||
| 2932 | 2971 | } elseif ($outputformat == "PRINT") { |
| 2933 | 2972 | $sSQL = $this->sGetSQLforReport($this->reportid, $filtersql, $outputformat); |
| 2934 | 2973 | $result = $adb->query($sSQL); |
| 2935 | - if ($is_admin === false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1) |
|
| 2936 | - $picklistarray = $this->getAccessPickListValues(); |
|
| 2974 | + if ($is_admin === false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1) { |
|
| 2975 | + $picklistarray = $this->getAccessPickListValues(); |
|
| 2976 | + } |
|
| 2937 | 2977 | |
| 2938 | 2978 | if ($result) { |
| 2939 | 2979 | $y = $adb->getFieldsCount($result); |
@@ -2962,14 +3002,17 @@ discard block |
||
| 2962 | 3002 | $tnewvalue = $custom_field_values[2]; |
| 2963 | 3003 | } |
| 2964 | 3004 | |
| 2965 | - if ($newvalue == "") |
|
| 2966 | - $newvalue = "-"; |
|
| 3005 | + if ($newvalue == "") { |
|
| 3006 | + $newvalue = "-"; |
|
| 3007 | + } |
|
| 2967 | 3008 | |
| 2968 | - if ($snewvalue == "") |
|
| 2969 | - $snewvalue = "-"; |
|
| 3009 | + if ($snewvalue == "") { |
|
| 3010 | + $snewvalue = "-"; |
|
| 3011 | + } |
|
| 2970 | 3012 | |
| 2971 | - if ($tnewvalue == "") |
|
| 2972 | - $tnewvalue = "-"; |
|
| 3013 | + if ($tnewvalue == "") { |
|
| 3014 | + $tnewvalue = "-"; |
|
| 3015 | + } |
|
| 2973 | 3016 | |
| 2974 | 3017 | $valtemplate .= "<tr>"; |
| 2975 | 3018 | |
@@ -3071,45 +3114,49 @@ discard block |
||
| 3071 | 3114 | $value = trim($key); |
| 3072 | 3115 | $arraykey = $value . '__SUM'; |
| 3073 | 3116 | if (isset($keyhdr[$arraykey])) { |
| 3074 | - if ($convert_price) |
|
| 3075 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
| 3076 | - else |
|
| 3077 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
| 3117 | + if ($convert_price) { |
|
| 3118 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
| 3119 | + } else { |
|
| 3120 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
| 3121 | + } |
|
| 3078 | 3122 | $coltotalhtml .= "<td class='rptTotal'>" . $conv_value . '</td>'; |
| 3079 | - }else { |
|
| 3123 | + } else { |
|
| 3080 | 3124 | $coltotalhtml .= "<td class='rptTotal'> </td>"; |
| 3081 | 3125 | } |
| 3082 | 3126 | |
| 3083 | 3127 | $arraykey = $value . '__AVG'; |
| 3084 | 3128 | if (isset($keyhdr[$arraykey])) { |
| 3085 | - if ($convert_price) |
|
| 3086 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
| 3087 | - else |
|
| 3088 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
| 3129 | + if ($convert_price) { |
|
| 3130 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
| 3131 | + } else { |
|
| 3132 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
| 3133 | + } |
|
| 3089 | 3134 | $coltotalhtml .= "<td class='rptTotal'>" . $conv_value . '</td>'; |
| 3090 | - }else { |
|
| 3135 | + } else { |
|
| 3091 | 3136 | $coltotalhtml .= "<td class='rptTotal'> </td>"; |
| 3092 | 3137 | } |
| 3093 | 3138 | |
| 3094 | 3139 | $arraykey = $value . '__MIN'; |
| 3095 | 3140 | if (isset($keyhdr[$arraykey])) { |
| 3096 | - if ($convert_price) |
|
| 3097 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
| 3098 | - else |
|
| 3099 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
| 3141 | + if ($convert_price) { |
|
| 3142 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
| 3143 | + } else { |
|
| 3144 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
| 3145 | + } |
|
| 3100 | 3146 | $coltotalhtml .= "<td class='rptTotal'>" . $conv_value . '</td>'; |
| 3101 | - }else { |
|
| 3147 | + } else { |
|
| 3102 | 3148 | $coltotalhtml .= "<td class='rptTotal'> </td>"; |
| 3103 | 3149 | } |
| 3104 | 3150 | |
| 3105 | 3151 | $arraykey = $value . '__MAX'; |
| 3106 | 3152 | if (isset($keyhdr[$arraykey])) { |
| 3107 | - if ($convert_price) |
|
| 3108 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
| 3109 | - else |
|
| 3110 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
| 3153 | + if ($convert_price) { |
|
| 3154 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
| 3155 | + } else { |
|
| 3156 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
| 3157 | + } |
|
| 3111 | 3158 | $coltotalhtml .= "<td class='rptTotal'>" . $conv_value . '</td>'; |
| 3112 | - }else { |
|
| 3159 | + } else { |
|
| 3113 | 3160 | $coltotalhtml .= "<td class='rptTotal'> </td>"; |
| 3114 | 3161 | } |
| 3115 | 3162 | |
@@ -3364,8 +3411,9 @@ discard block |
||
| 3364 | 3411 | $adb = PearDatabase::getInstance(); |
| 3365 | 3412 | $current_user = vglobal('current_user'); |
| 3366 | 3413 | $id = array(\App\Module::getModuleId($this->primarymodule)); |
| 3367 | - if ($this->secondarymodule != '') |
|
| 3368 | - array_push($id, \App\Module::getModuleId($this->secondarymodule)); |
|
| 3414 | + if ($this->secondarymodule != '') { |
|
| 3415 | + array_push($id, \App\Module::getModuleId($this->secondarymodule)); |
|
| 3416 | + } |
|
| 3369 | 3417 | |
| 3370 | 3418 | $query = sprintf('select fieldname,columnname,fieldid,fieldlabel,tabid,uitype from vtiger_field where tabid in(%s) and uitype in (15,33,55)', generateQuestionMarks($id)); //and columnname in (?)'; |
| 3371 | 3419 | $result = $adb->pquery($query, $id); //,$select_column)); |
@@ -3394,13 +3442,15 @@ discard block |
||
| 3394 | 3442 | } else { |
| 3395 | 3443 | $mulsel = "select distinct $fieldname from vtiger_$fieldname inner join vtiger_role2picklist on vtiger_role2picklist.picklistvalueid = vtiger_$fieldname.picklist_valueid where roleid ='" . $roleid . "' and picklistid in (select picklistid from vtiger_$fieldname)"; // order by sortid asc - not requried |
| 3396 | 3444 | } |
| 3397 | - if ($fieldname != 'firstname') |
|
| 3398 | - $mulselresult = $adb->query($mulsel); |
|
| 3445 | + if ($fieldname != 'firstname') { |
|
| 3446 | + $mulselresult = $adb->query($mulsel); |
|
| 3447 | + } |
|
| 3399 | 3448 | $countMulSelResult = $adb->num_rows($mulselresult); |
| 3400 | 3449 | for ($j = 0; $j < $countMulSelResult; $j++) { |
| 3401 | 3450 | $fldvalue = $adb->query_result($mulselresult, $j, $fieldname); |
| 3402 | - if (in_array($fldvalue, $fieldvalues)) |
|
| 3403 | - continue; |
|
| 3451 | + if (in_array($fldvalue, $fieldvalues)) { |
|
| 3452 | + continue; |
|
| 3453 | + } |
|
| 3404 | 3454 | $fieldvalues[] = $fldvalue; |
| 3405 | 3455 | } |
| 3406 | 3456 | $field_count = count($fieldvalues); |
@@ -3411,16 +3461,18 @@ discard block |
||
| 3411 | 3461 | $temp_status[$keyvalue][($temp_count + $t)] = $fieldvalues[$t]; |
| 3412 | 3462 | } |
| 3413 | 3463 | $fieldvalues = $temp_status[$keyvalue]; |
| 3414 | - } else |
|
| 3415 | - $temp_status[$keyvalue] = $fieldvalues; |
|
| 3464 | + } else { |
|
| 3465 | + $temp_status[$keyvalue] = $fieldvalues; |
|
| 3466 | + } |
|
| 3416 | 3467 | } |
| 3417 | 3468 | |
| 3418 | - if ($uitype == 33) |
|
| 3419 | - $fieldlists[1][$keyvalue] = $fieldvalues; |
|
| 3420 | - else if ($uitype == 55 && $fieldname == 'salutationtype') |
|
| 3421 | - $fieldlists[$keyvalue] = $fieldvalues; |
|
| 3422 | - else if ($uitype == 15) |
|
| 3423 | - $fieldlists[$keyvalue] = $fieldvalues; |
|
| 3469 | + if ($uitype == 33) { |
|
| 3470 | + $fieldlists[1][$keyvalue] = $fieldvalues; |
|
| 3471 | + } else if ($uitype == 55 && $fieldname == 'salutationtype') { |
|
| 3472 | + $fieldlists[$keyvalue] = $fieldvalues; |
|
| 3473 | + } else if ($uitype == 15) { |
|
| 3474 | + $fieldlists[$keyvalue] = $fieldvalues; |
|
| 3475 | + } |
|
| 3424 | 3476 | } |
| 3425 | 3477 | return $fieldlists; |
| 3426 | 3478 | } |
@@ -1015,7 +1015,7 @@ discard block |
||
| 1015 | 1015 | $advfiltergroupsql .= "$tableColumnSql BETWEEN $start AND $end"; |
| 1016 | 1016 | else |
| 1017 | 1017 | $advfiltergroupsql .= "$tableColumnSql NOT BETWEEN $start AND $end"; |
| 1018 | - }else if ($comparator == 'bw') { |
|
| 1018 | + } else if ($comparator == 'bw') { |
|
| 1019 | 1019 | $values = explode(',', $value); |
| 1020 | 1020 | $startDateTime = explode(' ', $values[0]); |
| 1021 | 1021 | $endDateTime = explode(' ', $values[1]); |
@@ -1132,7 +1132,7 @@ discard block |
||
| 1132 | 1132 | $tableName = 'vtiger_lastModifiedBy' . $this->primarymodule; |
| 1133 | 1133 | } |
| 1134 | 1134 | if (is_numeric($valuearray[$n]) || empty($valuearray[$n])) { |
| 1135 | - $advcolsql []= '(' . $tableName . '.id' . $this->getAdvComparator($comparator, trim($valuearray[$n]), $datatype) . ')'; |
|
| 1135 | + $advcolsql [] = '(' . $tableName . '.id' . $this->getAdvComparator($comparator, trim($valuearray[$n]), $datatype) . ')'; |
|
| 1136 | 1136 | } else { |
| 1137 | 1137 | $advcolsql[] = 'trim(' . \vtlib\Deprecated::getSqlForNameInDisplayFormat(array('last_name' => "$tableName.last_name", 'first_name' => "$tableName.first_name"), 'Users') . ')' . |
| 1138 | 1138 | $this->getAdvComparator($comparator, trim($valuearray[$n]), $datatype); |
@@ -1478,7 +1478,7 @@ discard block |
||
| 1478 | 1478 | } |
| 1479 | 1479 | |
| 1480 | 1480 | $temp_val = explode(",", $adv_filter_value); |
| 1481 | - 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 != '' )) { |
|
| 1481 | + 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 != '')) { |
|
| 1482 | 1482 | $val = Array(); |
| 1483 | 1483 | $countTempVal = count($temp_val); |
| 1484 | 1484 | for ($x = 0; $x < $countTempVal; $x++) { |
@@ -2691,7 +2691,7 @@ discard block |
||
| 2691 | 2691 | $usersSqlFullName = \App\Module::getSqlForNameInDisplayFormat('Users'); |
| 2692 | 2692 | $query = sprintf('SELECT %s FROM u_yf_crmentity_showners LEFT JOIN vtiger_users ON u_yf_crmentity_showners.userid = vtiger_users.id WHERE crmid = ?', $usersSqlFullName); |
| 2693 | 2693 | $resultOwners = $adb->pquery($query, [$id]); |
| 2694 | - $fieldvalue = implode(', ',$adb->getArrayColumn($resultOwners)); |
|
| 2694 | + $fieldvalue = implode(', ', $adb->getArrayColumn($resultOwners)); |
|
| 2695 | 2695 | } |
| 2696 | 2696 | |
| 2697 | 2697 | $arraylists[$headerLabel] = $fieldvalue; |
@@ -2759,7 +2759,7 @@ discard block |
||
| 2759 | 2759 | else |
| 2760 | 2760 | $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
| 2761 | 2761 | $totalpdf[$rowcount][$arraykey] = $conv_value; |
| 2762 | - }else { |
|
| 2762 | + } else { |
|
| 2763 | 2763 | $totalpdf[$rowcount][$arraykey] = ''; |
| 2764 | 2764 | } |
| 2765 | 2765 | |
@@ -2770,7 +2770,7 @@ discard block |
||
| 2770 | 2770 | else |
| 2771 | 2771 | $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
| 2772 | 2772 | $totalpdf[$rowcount][$arraykey] = $conv_value; |
| 2773 | - }else { |
|
| 2773 | + } else { |
|
| 2774 | 2774 | $totalpdf[$rowcount][$arraykey] = ''; |
| 2775 | 2775 | } |
| 2776 | 2776 | |
@@ -2781,7 +2781,7 @@ discard block |
||
| 2781 | 2781 | else |
| 2782 | 2782 | $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
| 2783 | 2783 | $totalpdf[$rowcount][$arraykey] = $conv_value; |
| 2784 | - }else { |
|
| 2784 | + } else { |
|
| 2785 | 2785 | $totalpdf[$rowcount][$arraykey] = ''; |
| 2786 | 2786 | } |
| 2787 | 2787 | |
@@ -2792,7 +2792,7 @@ discard block |
||
| 2792 | 2792 | else |
| 2793 | 2793 | $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
| 2794 | 2794 | $totalpdf[$rowcount][$arraykey] = $conv_value; |
| 2795 | - }else { |
|
| 2795 | + } else { |
|
| 2796 | 2796 | $totalpdf[$rowcount][$arraykey] = ''; |
| 2797 | 2797 | } |
| 2798 | 2798 | $rowcount++; |
@@ -2871,7 +2871,7 @@ discard block |
||
| 2871 | 2871 | else |
| 2872 | 2872 | $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
| 2873 | 2873 | $coltotalhtml .= '<td class="rptTotal">' . $conv_value . '</td>'; |
| 2874 | - }else { |
|
| 2874 | + } else { |
|
| 2875 | 2875 | $coltotalhtml .= '<td class="rptTotal"> </td>'; |
| 2876 | 2876 | } |
| 2877 | 2877 | |
@@ -2882,7 +2882,7 @@ discard block |
||
| 2882 | 2882 | else |
| 2883 | 2883 | $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
| 2884 | 2884 | $coltotalhtml .= '<td class="rptTotal">' . $conv_value . '</td>'; |
| 2885 | - }else { |
|
| 2885 | + } else { |
|
| 2886 | 2886 | $coltotalhtml .= '<td class="rptTotal"> </td>'; |
| 2887 | 2887 | } |
| 2888 | 2888 | |
@@ -2893,7 +2893,7 @@ discard block |
||
| 2893 | 2893 | else |
| 2894 | 2894 | $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
| 2895 | 2895 | $coltotalhtml .= '<td class="rptTotal">' . $conv_value . '</td>'; |
| 2896 | - }else { |
|
| 2896 | + } else { |
|
| 2897 | 2897 | $coltotalhtml .= '<td class="rptTotal"> </td>'; |
| 2898 | 2898 | } |
| 2899 | 2899 | |
@@ -2904,7 +2904,7 @@ discard block |
||
| 2904 | 2904 | else |
| 2905 | 2905 | $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
| 2906 | 2906 | $coltotalhtml .= '<td class="rptTotal">' . $conv_value . '</td>'; |
| 2907 | - }else { |
|
| 2907 | + } else { |
|
| 2908 | 2908 | $coltotalhtml .= '<td class="rptTotal"> </td>'; |
| 2909 | 2909 | } |
| 2910 | 2910 | |
@@ -3076,7 +3076,7 @@ discard block |
||
| 3076 | 3076 | else |
| 3077 | 3077 | $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
| 3078 | 3078 | $coltotalhtml .= "<td class='rptTotal'>" . $conv_value . '</td>'; |
| 3079 | - }else { |
|
| 3079 | + } else { |
|
| 3080 | 3080 | $coltotalhtml .= "<td class='rptTotal'> </td>"; |
| 3081 | 3081 | } |
| 3082 | 3082 | |
@@ -3087,7 +3087,7 @@ discard block |
||
| 3087 | 3087 | else |
| 3088 | 3088 | $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
| 3089 | 3089 | $coltotalhtml .= "<td class='rptTotal'>" . $conv_value . '</td>'; |
| 3090 | - }else { |
|
| 3090 | + } else { |
|
| 3091 | 3091 | $coltotalhtml .= "<td class='rptTotal'> </td>"; |
| 3092 | 3092 | } |
| 3093 | 3093 | |
@@ -3098,7 +3098,7 @@ discard block |
||
| 3098 | 3098 | else |
| 3099 | 3099 | $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
| 3100 | 3100 | $coltotalhtml .= "<td class='rptTotal'>" . $conv_value . '</td>'; |
| 3101 | - }else { |
|
| 3101 | + } else { |
|
| 3102 | 3102 | $coltotalhtml .= "<td class='rptTotal'> </td>"; |
| 3103 | 3103 | } |
| 3104 | 3104 | |
@@ -3109,7 +3109,7 @@ discard block |
||
| 3109 | 3109 | else |
| 3110 | 3110 | $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
| 3111 | 3111 | $coltotalhtml .= "<td class='rptTotal'>" . $conv_value . '</td>'; |
| 3112 | - }else { |
|
| 3112 | + } else { |
|
| 3113 | 3113 | $coltotalhtml .= "<td class='rptTotal'> </td>"; |
| 3114 | 3114 | } |
| 3115 | 3115 | |
@@ -3470,7 +3470,7 @@ discard block |
||
| 3470 | 3470 | $rowcount = 1; |
| 3471 | 3471 | //copy the first value details |
| 3472 | 3472 | $arrayFirstRowValues = $arr_val[0]; |
| 3473 | - array_pop($arrayFirstRowValues); // removed action link in details |
|
| 3473 | + array_pop($arrayFirstRowValues); // removed action link in details |
|
| 3474 | 3474 | foreach ($arrayFirstRowValues as $key => $value) { |
| 3475 | 3475 | $worksheet->setCellValueExplicitByColumnAndRow($count, $rowcount, $key, true); |
| 3476 | 3476 | $worksheet->getStyleByColumnAndRow($count, $rowcount)->applyFromArray($header_styles); |
@@ -3535,7 +3535,7 @@ discard block |
||
| 3535 | 3535 | if (isset($arr_val)) { |
| 3536 | 3536 | // Header |
| 3537 | 3537 | $csv_values = array_keys($arr_val[0]); |
| 3538 | - array_pop($csv_values); //removed header in csv file |
|
| 3538 | + array_pop($csv_values); //removed header in csv file |
|
| 3539 | 3539 | fputcsv($fp, $csv_values); |
| 3540 | 3540 | foreach ($arr_val as $key => $array_value) { |
| 3541 | 3541 | array_pop($array_value); //removed action link |
@@ -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++) { |
@@ -127,10 +127,11 @@ discard block |
||
| 127 | 127 | $this->reportname = decode_html($cachedInfo["reportname"]); |
| 128 | 128 | $this->reportdescription = decode_html($cachedInfo["description"]); |
| 129 | 129 | $this->folderid = $cachedInfo["folderid"]; |
| 130 | - if ($is_admin === true || in_array($cachedInfo["owner"], $subordinate_users) || $cachedInfo["owner"] == $current_user->id) |
|
| 131 | - $this->is_editable = 'true'; |
|
| 132 | - else |
|
| 133 | - $this->is_editable = 'false'; |
|
| 130 | + if ($is_admin === true || in_array($cachedInfo["owner"], $subordinate_users) || $cachedInfo["owner"] == $current_user->id) { |
|
| 131 | + $this->is_editable = 'true'; |
|
| 132 | + } else { |
|
| 133 | + $this->is_editable = 'false'; |
|
| 134 | + } |
|
| 134 | 135 | } else { |
| 135 | 136 | throw new \Exception\NoPermitted('LBL_PERMISSION_DENIED'); |
| 136 | 137 | } |
@@ -141,8 +142,9 @@ discard block |
||
| 141 | 142 | public function updateModuleList($module) |
| 142 | 143 | { |
| 143 | 144 | $adb = PearDatabase::getInstance(); |
| 144 | - if (!isset($module)) |
|
| 145 | - return; |
|
| 145 | + if (!isset($module)) { |
|
| 146 | + return; |
|
| 147 | + } |
|
| 146 | 148 | require_once('include/utils/utils.php'); |
| 147 | 149 | $tabid = \App\Module::getModuleId($module); |
| 148 | 150 | if ($module == 'Calendar') { |
@@ -151,12 +153,14 @@ discard block |
||
| 151 | 153 | $sql = sprintf('SELECT blockid, blocklabel FROM vtiger_blocks WHERE tabid IN (%s)', generateQuestionMarks($tabid)); |
| 152 | 154 | $res = $adb->pquery($sql, [$tabid]); |
| 153 | 155 | $noOfRows = $adb->num_rows($res); |
| 154 | - if ($noOfRows <= 0) |
|
| 155 | - return; |
|
| 156 | + if ($noOfRows <= 0) { |
|
| 157 | + return; |
|
| 158 | + } |
|
| 156 | 159 | for ($index = 0; $index < $noOfRows; ++$index) { |
| 157 | 160 | $blockid = $adb->query_result($res, $index, 'blockid'); |
| 158 | - if (in_array($blockid, $this->module_list[$module])) |
|
| 159 | - continue; |
|
| 161 | + if (in_array($blockid, $this->module_list[$module])) { |
|
| 162 | + continue; |
|
| 163 | + } |
|
| 160 | 164 | $blockid_list[] = $blockid; |
| 161 | 165 | $blocklabel = $adb->query_result($res, $index, 'blocklabel'); |
| 162 | 166 | $this->module_list[$module][$blocklabel] = $blockid; |
@@ -187,10 +191,14 @@ discard block |
||
| 187 | 191 | |
| 188 | 192 | if ($modulerows) { |
| 189 | 193 | foreach ($modulerows as $resultrow) { |
| 190 | - if ($resultrow['presence'] == '1') |
|
| 191 | - continue; // skip disabled modules |
|
| 192 | - if ($resultrow['isentitytype'] != '1') |
|
| 193 | - continue; // skip extension modules |
|
| 194 | + if ($resultrow['presence'] == '1') { |
|
| 195 | + continue; |
|
| 196 | + } |
|
| 197 | + // skip disabled modules |
|
| 198 | + if ($resultrow['isentitytype'] != '1') { |
|
| 199 | + continue; |
|
| 200 | + } |
|
| 201 | + // skip extension modules |
|
| 194 | 202 | if (in_array($resultrow['name'], $restricted_modules)) { // skip restricted modules |
| 195 | 203 | continue; |
| 196 | 204 | } |
@@ -221,10 +229,11 @@ discard block |
||
| 221 | 229 | } |
| 222 | 230 | |
| 223 | 231 | if (!empty($blocklabel)) { |
| 224 | - if ($module == 'Calendar' && $blocklabel == 'LBL_CUSTOM_INFORMATION') |
|
| 225 | - $this->module_list[$module][$blockid] = \App\Language::translate($blocklabel, $module); |
|
| 226 | - else |
|
| 227 | - $this->module_list[$module][$blockid] = \App\Language::translate($blocklabel, $module); |
|
| 232 | + if ($module == 'Calendar' && $blocklabel == 'LBL_CUSTOM_INFORMATION') { |
|
| 233 | + $this->module_list[$module][$blockid] = \App\Language::translate($blocklabel, $module); |
|
| 234 | + } else { |
|
| 235 | + $this->module_list[$module][$blockid] = \App\Language::translate($blocklabel, $module); |
|
| 236 | + } |
|
| 228 | 237 | $prev_block_label = $blocklabel; |
| 229 | 238 | } else { |
| 230 | 239 | $this->module_list[$module][$blockid] = \App\Language::translate($prev_block_label, $module); |
@@ -368,13 +377,15 @@ discard block |
||
| 368 | 377 | $report_details ['reportname'] = $report["reportname"]; |
| 369 | 378 | $report_details ['sharingtype'] = $report["sharingtype"]; |
| 370 | 379 | $report_details['folderid'] = $report["folderid"]; |
| 371 | - if ($is_admin === true) |
|
| 372 | - $report_details ['editable'] = 'true'; |
|
| 373 | - else |
|
| 374 | - $report_details['editable'] = 'false'; |
|
| 380 | + if ($is_admin === true) { |
|
| 381 | + $report_details ['editable'] = 'true'; |
|
| 382 | + } else { |
|
| 383 | + $report_details['editable'] = 'false'; |
|
| 384 | + } |
|
| 375 | 385 | |
| 376 | - if (isPermitted($report["primarymodule"], 'index') == "yes") |
|
| 377 | - $returndata[] = $report_details; |
|
| 386 | + if (isPermitted($report["primarymodule"], 'index') == "yes") { |
|
| 387 | + $returndata[] = $report_details; |
|
| 388 | + } |
|
| 378 | 389 | }while ($report = $adb->fetch_array($result)); |
| 379 | 390 | } |
| 380 | 391 | \App\Log::trace("Reports :: ListView->Successfully returned vtiger_report details HTML"); |
@@ -455,13 +466,15 @@ discard block |
||
| 455 | 466 | $report_details['reportname'] = $report["reportname"]; |
| 456 | 467 | $report_details['reporttype'] = $report["reporttype"]; |
| 457 | 468 | $report_details['sharingtype'] = $report["sharingtype"]; |
| 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'; |
|
| 469 | + if ($is_admin === true || in_array($report["owner"], $subordinate_users) || $report["owner"] == $currentUser->getId()) { |
|
| 470 | + $report_details['editable'] = 'true'; |
|
| 471 | + } else { |
|
| 472 | + $report_details['editable'] = 'false'; |
|
| 473 | + } |
|
| 462 | 474 | |
| 463 | - if (isPermitted($report["primarymodule"], 'index') == "yes") |
|
| 464 | - $returndata [$report["folderid"]][] = $report_details; |
|
| 475 | + if (isPermitted($report["primarymodule"], 'index') == "yes") { |
|
| 476 | + $returndata [$report["folderid"]][] = $report_details; |
|
| 477 | + } |
|
| 465 | 478 | }while ($report = $adb->fetch_array($result)); |
| 466 | 479 | } |
| 467 | 480 | |
@@ -594,8 +607,9 @@ discard block |
||
| 594 | 607 | $adb = PearDatabase::getInstance(); |
| 595 | 608 | $currentUser = Users_Privileges_Model::getCurrentUserPrivilegesModel(); |
| 596 | 609 | |
| 597 | - if (is_string($block)) |
|
| 598 | - $block = explode(",", $block); |
|
| 610 | + if (is_string($block)) { |
|
| 611 | + $block = explode(",", $block); |
|
| 612 | + } |
|
| 599 | 613 | $skipTalbes = array('vtiger_emaildetails', 'vtiger_attachments'); |
| 600 | 614 | |
| 601 | 615 | $tabid = \App\Module::getModuleId($module); |
@@ -613,10 +627,11 @@ discard block |
||
| 613 | 627 | $sql .= ' and tablename NOT IN (' . generateQuestionMarks($skipTalbes) . ') '; |
| 614 | 628 | |
| 615 | 629 | //fix for Ticket #4016 |
| 616 | - if ($module == "Calendar") |
|
| 617 | - $sql .= " group by vtiger_field.fieldlabel order by sequence"; |
|
| 618 | - else |
|
| 619 | - $sql .= " group by vtiger_field.fieldid order by sequence"; |
|
| 630 | + if ($module == "Calendar") { |
|
| 631 | + $sql .= " group by vtiger_field.fieldlabel order by sequence"; |
|
| 632 | + } else { |
|
| 633 | + $sql .= " group by vtiger_field.fieldid order by sequence"; |
|
| 634 | + } |
|
| 620 | 635 | array_push($params, $skipTalbes); |
| 621 | 636 | |
| 622 | 637 | $result = $adb->pquery($sql, $params); |
@@ -663,8 +678,9 @@ discard block |
||
| 663 | 678 | $this->adv_rel_fields[$fieldtypeofdata][] = $adv_rel_field_tod_value; |
| 664 | 679 | } |
| 665 | 680 | //added to escape attachments fields in Reports as we have multiple attachments |
| 666 | - if ($module == 'HelpDesk' && $fieldname == 'filename') |
|
| 667 | - continue; |
|
| 681 | + if ($module == 'HelpDesk' && $fieldname == 'filename') { |
|
| 682 | + continue; |
|
| 683 | + } |
|
| 668 | 684 | |
| 669 | 685 | if (is_string($block) || $group_res_by_block === false) { |
| 670 | 686 | $module_columnlist[$optionvalue] = $fieldlabel; |
@@ -905,8 +921,9 @@ discard block |
||
| 905 | 921 | |
| 906 | 922 | $result = $adb->pquery($ssql, array($reportid, $groupId)); |
| 907 | 923 | $noOfColumns = $adb->num_rows($result); |
| 908 | - if ($noOfColumns <= 0) |
|
| 909 | - continue; |
|
| 924 | + if ($noOfColumns <= 0) { |
|
| 925 | + continue; |
|
| 926 | + } |
|
| 910 | 927 | |
| 911 | 928 | while ($relcriteriarow = $adb->fetch_array($result)) { |
| 912 | 929 | $columnIndex = $relcriteriarow["columnindex"]; |
@@ -964,8 +981,9 @@ discard block |
||
| 964 | 981 | $i++; |
| 965 | 982 | } |
| 966 | 983 | // Clear the condition (and/or) for last group, if any. |
| 967 | - if (!empty($advft_criteria[$i - 1]['condition'])) |
|
| 968 | - $advft_criteria[$i - 1]['condition'] = ''; |
|
| 984 | + if (!empty($advft_criteria[$i - 1]['condition'])) { |
|
| 985 | + $advft_criteria[$i - 1]['condition'] = ''; |
|
| 986 | + } |
|
| 969 | 987 | $this->advft_criteria = $advft_criteria; |
| 970 | 988 | \App\Log::trace("Reports :: Successfully returned getAdvancedFilterList"); |
| 971 | 989 | return true; |
@@ -1214,13 +1232,15 @@ discard block |
||
| 1214 | 1232 | $idelrelcriteriagroupsql = "delete from vtiger_relcriteria_grouping where queryid=?"; |
| 1215 | 1233 | $idelrelcriteriagroupsqlresult = $adb->pquery($idelrelcriteriagroupsql, array($reportid)); |
| 1216 | 1234 | |
| 1217 | - if (empty($advft_criteria)) |
|
| 1218 | - return; |
|
| 1235 | + if (empty($advft_criteria)) { |
|
| 1236 | + return; |
|
| 1237 | + } |
|
| 1219 | 1238 | |
| 1220 | 1239 | foreach ($advft_criteria as $column_index => $column_condition) { |
| 1221 | 1240 | |
| 1222 | - if (empty($column_condition)) |
|
| 1223 | - continue; |
|
| 1241 | + if (empty($column_condition)) { |
|
| 1242 | + continue; |
|
| 1243 | + } |
|
| 1224 | 1244 | |
| 1225 | 1245 | $adv_filter_column = $column_condition["columnname"]; |
| 1226 | 1246 | $adv_filter_comparator = $column_condition["comparator"]; |
@@ -1282,10 +1302,13 @@ discard block |
||
| 1282 | 1302 | |
| 1283 | 1303 | foreach ($advft_criteria_groups as $group_index => $group_condition_info) { |
| 1284 | 1304 | |
| 1285 | - if (empty($group_condition_info)) |
|
| 1286 | - continue; |
|
| 1287 | - if (empty($group_condition_info["conditionexpression"])) |
|
| 1288 | - continue; // Case when the group doesn't have any column criteria |
|
| 1305 | + if (empty($group_condition_info)) { |
|
| 1306 | + continue; |
|
| 1307 | + } |
|
| 1308 | + if (empty($group_condition_info["conditionexpression"])) { |
|
| 1309 | + continue; |
|
| 1310 | + } |
|
| 1311 | + // Case when the group doesn't have any column criteria |
|
| 1289 | 1312 | |
| 1290 | 1313 | $irelcriteriagroupsql = "insert into vtiger_relcriteria_grouping(GROUPID,QUERYID,GROUP_CONDITION,CONDITION_EXPRESSION) values (?,?,?,?)"; |
| 1291 | 1314 | $irelcriteriagroupresult = $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) { |
@@ -82,6 +82,9 @@ |
||
| 82 | 82 | $response->emit(); |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | + /** |
|
| 86 | + * @param string $datetime |
|
| 87 | + */ |
|
| 85 | 88 | public function changeDateTime($datetime, $delta) |
| 86 | 89 | { |
| 87 | 90 | $date = new DateTime($datetime); |
@@ -318,6 +318,9 @@ discard block |
||
| 318 | 318 | return $permissions; |
| 319 | 319 | } |
| 320 | 320 | |
| 321 | + /** |
|
| 322 | + * @param string $val |
|
| 323 | + */ |
|
| 321 | 324 | public static function getFlag($val) |
| 322 | 325 | { |
| 323 | 326 | if ($val == 'On' || $val == 1 || stripos($val, 'On') !== false) { |
@@ -326,6 +329,9 @@ discard block |
||
| 326 | 329 | return 'Off'; |
| 327 | 330 | } |
| 328 | 331 | |
| 332 | + /** |
|
| 333 | + * @param string $value |
|
| 334 | + */ |
|
| 329 | 335 | public function error2string($value) |
| 330 | 336 | { |
| 331 | 337 | $level_names = array( |
@@ -120,56 +120,68 @@ discard block |
||
| 120 | 120 | $directiveValues['suhosin.post.max_value_length'] = array('prefer' => '1500000'); |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | - if (ini_get('display_errors') == '1' || stripos(ini_get('display_errors'), 'On') !== false) |
|
| 124 | - $directiveValues['display_errors']['status'] = true; |
|
| 123 | + if (ini_get('display_errors') == '1' || stripos(ini_get('display_errors'), 'On') !== false) { |
|
| 124 | + $directiveValues['display_errors']['status'] = true; |
|
| 125 | + } |
|
| 125 | 126 | $directiveValues['display_errors']['current'] = self::getFlag(ini_get('display_errors')); |
| 126 | 127 | |
| 127 | - if (ini_get('file_uploads') != '1' || stripos(ini_get('file_uploads'), 'Off') !== false) |
|
| 128 | - $directiveValues['file_uploads']['status'] = true; |
|
| 128 | + if (ini_get('file_uploads') != '1' || stripos(ini_get('file_uploads'), 'Off') !== false) { |
|
| 129 | + $directiveValues['file_uploads']['status'] = true; |
|
| 130 | + } |
|
| 129 | 131 | $directiveValues['file_uploads']['current'] = self::getFlag(ini_get('file_uploads')); |
| 130 | 132 | |
| 131 | - if ((ini_get('output_buffering') <= '4096' && ini_get('output_buffering') != '1') || stripos(ini_get('output_buffering'), 'Off') !== false) |
|
| 132 | - $directiveValues['output_buffering']['status'] = true; |
|
| 133 | + if ((ini_get('output_buffering') <= '4096' && ini_get('output_buffering') != '1') || stripos(ini_get('output_buffering'), 'Off') !== false) { |
|
| 134 | + $directiveValues['output_buffering']['status'] = true; |
|
| 135 | + } |
|
| 133 | 136 | if (!in_array(ini_get('output_buffering'), ['On', 1, 0, 'Off'])) { |
| 134 | 137 | $directiveValues['output_buffering']['current'] = ini_get('output_buffering'); |
| 135 | 138 | } else { |
| 136 | 139 | $directiveValues['output_buffering']['current'] = self::getFlag(ini_get('output_buffering')); |
| 137 | 140 | } |
| 138 | 141 | |
| 139 | - if (ini_get('max_execution_time') != 0 && ini_get('max_execution_time') < 600) |
|
| 140 | - $directiveValues['max_execution_time']['status'] = true; |
|
| 142 | + if (ini_get('max_execution_time') != 0 && ini_get('max_execution_time') < 600) { |
|
| 143 | + $directiveValues['max_execution_time']['status'] = true; |
|
| 144 | + } |
|
| 141 | 145 | $directiveValues['max_execution_time']['current'] = ini_get('max_execution_time'); |
| 142 | 146 | |
| 143 | - if (ini_get('max_input_time') != 0 && ini_get('max_input_time') < 600) |
|
| 144 | - $directiveValues['max_input_time']['status'] = true; |
|
| 147 | + if (ini_get('max_input_time') != 0 && ini_get('max_input_time') < 600) { |
|
| 148 | + $directiveValues['max_input_time']['status'] = true; |
|
| 149 | + } |
|
| 145 | 150 | $directiveValues['max_input_time']['current'] = ini_get('max_input_time'); |
| 146 | 151 | |
| 147 | - if (ini_get('default_socket_timeout') != 0 && ini_get('default_socket_timeout') < 600) |
|
| 148 | - $directiveValues['default_socket_timeout']['status'] = true; |
|
| 152 | + if (ini_get('default_socket_timeout') != 0 && ini_get('default_socket_timeout') < 600) { |
|
| 153 | + $directiveValues['default_socket_timeout']['status'] = true; |
|
| 154 | + } |
|
| 149 | 155 | $directiveValues['default_socket_timeout']['current'] = ini_get('default_socket_timeout'); |
| 150 | 156 | |
| 151 | - if (vtlib\Functions::parseBytes(ini_get('memory_limit')) < 33554432) |
|
| 152 | - $directiveValues['memory_limit']['status'] = true; |
|
| 157 | + if (vtlib\Functions::parseBytes(ini_get('memory_limit')) < 33554432) { |
|
| 158 | + $directiveValues['memory_limit']['status'] = true; |
|
| 159 | + } |
|
| 153 | 160 | $directiveValues['memory_limit']['current'] = vtlib\Functions::showBytes(ini_get('memory_limit')); |
| 154 | 161 | |
| 155 | - if (vtlib\Functions::parseBytes(ini_get('post_max_size')) < 10485760) |
|
| 156 | - $directiveValues['post_max_size']['status'] = true; |
|
| 162 | + if (vtlib\Functions::parseBytes(ini_get('post_max_size')) < 10485760) { |
|
| 163 | + $directiveValues['post_max_size']['status'] = true; |
|
| 164 | + } |
|
| 157 | 165 | $directiveValues['post_max_size']['current'] = vtlib\Functions::showBytes(ini_get('post_max_size')); |
| 158 | 166 | |
| 159 | - if (vtlib\Functions::parseBytes(ini_get('upload_max_filesize')) < 10485760) |
|
| 160 | - $directiveValues['upload_max_filesize']['status'] = true; |
|
| 167 | + if (vtlib\Functions::parseBytes(ini_get('upload_max_filesize')) < 10485760) { |
|
| 168 | + $directiveValues['upload_max_filesize']['status'] = true; |
|
| 169 | + } |
|
| 161 | 170 | $directiveValues['upload_max_filesize']['current'] = vtlib\Functions::showBytes(ini_get('upload_max_filesize')); |
| 162 | 171 | |
| 163 | - if (ini_get('zlib.output_compression') == '1' || stripos(ini_get('zlib.output_compression'), 'On') !== false) |
|
| 164 | - $directiveValues['zlib.output_compression']['status'] = true; |
|
| 172 | + if (ini_get('zlib.output_compression') == '1' || stripos(ini_get('zlib.output_compression'), 'On') !== false) { |
|
| 173 | + $directiveValues['zlib.output_compression']['status'] = true; |
|
| 174 | + } |
|
| 165 | 175 | $directiveValues['zlib.output_compression']['current'] = self::getFlag((ini_get('zlib.output_compression'))); |
| 166 | 176 | |
| 167 | - if (ini_get('session.auto_start') == '1' || stripos(ini_get('session.auto_start'), 'On') !== false) |
|
| 168 | - $directiveValues['session.auto_start']['status'] = true; |
|
| 177 | + if (ini_get('session.auto_start') == '1' || stripos(ini_get('session.auto_start'), 'On') !== false) { |
|
| 178 | + $directiveValues['session.auto_start']['status'] = true; |
|
| 179 | + } |
|
| 169 | 180 | $directiveValues['session.auto_start']['current'] = self::getFlag(ini_get('session.auto_start')); |
| 170 | 181 | |
| 171 | - if (ini_get('session.cookie_httponly') != '1' || stripos(ini_get('session.cookie_httponly'), 'On') !== false) |
|
| 172 | - $directiveValues['session.cookie_httponly']['status'] = true; |
|
| 182 | + if (ini_get('session.cookie_httponly') != '1' || stripos(ini_get('session.cookie_httponly'), 'On') !== false) { |
|
| 183 | + $directiveValues['session.cookie_httponly']['status'] = true; |
|
| 184 | + } |
|
| 173 | 185 | $directiveValues['session.cookie_httponly']['current'] = self::getFlag(ini_get('session.cookie_httponly')); |
| 174 | 186 | |
| 175 | 187 | /* |
@@ -183,24 +195,29 @@ discard block |
||
| 183 | 195 | } |
| 184 | 196 | $directiveValues['mbstring.func_overload']['current'] = self::getFlag(ini_get('mbstring.func_overload')); |
| 185 | 197 | |
| 186 | - if (ini_get('log_errors') == '1' || stripos(ini_get('log_errors'), 'On') !== false) |
|
| 187 | - $directiveValues['log_errors']['status'] = true; |
|
| 198 | + if (ini_get('log_errors') == '1' || stripos(ini_get('log_errors'), 'On') !== false) { |
|
| 199 | + $directiveValues['log_errors']['status'] = true; |
|
| 200 | + } |
|
| 188 | 201 | $directiveValues['log_errors']['current'] = self::getFlag(ini_get('log_errors')); |
| 189 | 202 | |
| 190 | - if (ini_get('short_open_tag') != '1' || stripos(ini_get('short_open_tag'), 'Off') !== false) |
|
| 191 | - $directiveValues['short_open_tag']['status'] = true; |
|
| 203 | + if (ini_get('short_open_tag') != '1' || stripos(ini_get('short_open_tag'), 'Off') !== false) { |
|
| 204 | + $directiveValues['short_open_tag']['status'] = true; |
|
| 205 | + } |
|
| 192 | 206 | $directiveValues['short_open_tag']['current'] = self::getFlag(ini_get('short_open_tag')); |
| 193 | 207 | |
| 194 | - if (ini_get('session.gc_maxlifetime') < 21600) |
|
| 195 | - $directiveValues['session.gc_maxlifetime']['status'] = true; |
|
| 208 | + if (ini_get('session.gc_maxlifetime') < 21600) { |
|
| 209 | + $directiveValues['session.gc_maxlifetime']['status'] = true; |
|
| 210 | + } |
|
| 196 | 211 | $directiveValues['session.gc_maxlifetime']['current'] = ini_get('session.gc_maxlifetime'); |
| 197 | 212 | |
| 198 | - if (ini_get('session.gc_divisor') < 500) |
|
| 199 | - $directiveValues['session.gc_divisor']['status'] = true; |
|
| 213 | + if (ini_get('session.gc_divisor') < 500) { |
|
| 214 | + $directiveValues['session.gc_divisor']['status'] = true; |
|
| 215 | + } |
|
| 200 | 216 | $directiveValues['session.gc_divisor']['current'] = ini_get('session.gc_divisor'); |
| 201 | 217 | |
| 202 | - if (ini_get('session.gc_probability') < 1) |
|
| 203 | - $directiveValues['session.gc_probability']['status'] = true; |
|
| 218 | + if (ini_get('session.gc_probability') < 1) { |
|
| 219 | + $directiveValues['session.gc_probability']['status'] = true; |
|
| 220 | + } |
|
| 204 | 221 | $directiveValues['session.gc_probability']['current'] = ini_get('session.gc_probability'); |
| 205 | 222 | |
| 206 | 223 | if (ini_get('max_input_vars') < 5000) { |
@@ -219,8 +236,9 @@ discard block |
||
| 219 | 236 | |
| 220 | 237 | |
| 221 | 238 | if (extension_loaded('suhosin')) { |
| 222 | - if (ini_get('suhosin.session.encrypt') == '1' || stripos(ini_get('suhosin.session.encrypt'), 'On') !== false) |
|
| 223 | - $directiveValues['suhosin.session.encrypt']['status'] = true; |
|
| 239 | + if (ini_get('suhosin.session.encrypt') == '1' || stripos(ini_get('suhosin.session.encrypt'), 'On') !== false) { |
|
| 240 | + $directiveValues['suhosin.session.encrypt']['status'] = true; |
|
| 241 | + } |
|
| 224 | 242 | $directiveValues['suhosin.session.encrypt']['current'] = self::getFlag(ini_get('suhosin.session.encrypt')); |
| 225 | 243 | |
| 226 | 244 | if (ini_get('suhosin.request.max_vars') < 5000) { |
@@ -239,8 +257,9 @@ discard block |
||
| 239 | 257 | $directiveValues['suhosin.post.max_value_length']['current'] = ini_get('suhosin.post.max_value_length'); |
| 240 | 258 | } |
| 241 | 259 | if (!$instalMode && App\Db::getInstance()->getDriverName() === 'mysql') { |
| 242 | - if (ini_get('mysql.connect_timeout') != 0 && ini_get('mysql.connect_timeout') < 600) |
|
| 243 | - $directiveValues['mysql.connect_timeout']['status'] = true; |
|
| 260 | + if (ini_get('mysql.connect_timeout') != 0 && ini_get('mysql.connect_timeout') < 600) { |
|
| 261 | + $directiveValues['mysql.connect_timeout']['status'] = true; |
|
| 262 | + } |
|
| 244 | 263 | $directiveValues['mysql.connect_timeout']['current'] = ini_get('mysql.connect_timeout'); |
| 245 | 264 | |
| 246 | 265 | $db = PearDatabase::getInstance(); |
@@ -277,8 +296,9 @@ discard block |
||
| 277 | 296 | } |
| 278 | 297 | |
| 279 | 298 | $errorReporting = stripos(ini_get('error_reporting'), '_') === false ? self::error2string(ini_get('error_reporting')) : ini_get('error_reporting'); |
| 280 | - if (in_array('E_NOTICE', $errorReporting) || in_array('E_DEPRECATED', $errorReporting) || in_array('E_STRICT', $errorReporting)) |
|
| 281 | - $directiveValues['error_reporting']['status'] = true; |
|
| 299 | + if (in_array('E_NOTICE', $errorReporting) || in_array('E_DEPRECATED', $errorReporting) || in_array('E_STRICT', $errorReporting)) { |
|
| 300 | + $directiveValues['error_reporting']['status'] = true; |
|
| 301 | + } |
|
| 282 | 302 | $directiveValues['error_reporting']['current'] = implode(' | ', $errorReporting); |
| 283 | 303 | |
| 284 | 304 | return $directiveValues; |
@@ -333,16 +353,18 @@ discard block |
||
| 333 | 353 | E_COMPILE_ERROR => 'E_COMPILE_ERROR', E_COMPILE_WARNING => 'E_COMPILE_WARNING', |
| 334 | 354 | E_USER_ERROR => 'E_USER_ERROR', E_USER_WARNING => 'E_USER_WARNING', |
| 335 | 355 | E_USER_NOTICE => 'E_USER_NOTICE'); |
| 336 | - if (defined('E_STRICT')) |
|
| 337 | - $level_names[E_STRICT] = 'E_STRICT'; |
|
| 356 | + if (defined('E_STRICT')) { |
|
| 357 | + $level_names[E_STRICT] = 'E_STRICT'; |
|
| 358 | + } |
|
| 338 | 359 | $levels = array(); |
| 339 | 360 | if (($value & E_ALL) == E_ALL) { |
| 340 | 361 | $levels[] = 'E_ALL'; |
| 341 | 362 | $value &= ~E_ALL; |
| 342 | 363 | } |
| 343 | - foreach ($level_names as $level => $name) |
|
| 344 | - if (($value & $level) == $level) |
|
| 364 | + foreach ($level_names as $level => $name) { |
|
| 365 | + if (($value & $level) == $level) |
|
| 345 | 366 | $levels[] = $name; |
| 367 | + } |
|
| 346 | 368 | return $levels; |
| 347 | 369 | } |
| 348 | 370 | } |
@@ -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(); |
@@ -221,7 +221,7 @@ |
||
| 221 | 221 | /** |
| 222 | 222 | * Checks if given record has valid pdf template |
| 223 | 223 | * @param Vtiger_Request $request |
| 224 | - * @return boolean true if valid template exists for this record |
|
| 224 | + * @return boolean|null true if valid template exists for this record |
|
| 225 | 225 | */ |
| 226 | 226 | public function hasValidTemplate(Vtiger_Request $request) |
| 227 | 227 | { |