@@ -50,6 +50,9 @@ discard block |
||
50 | 50 | return $xml; |
51 | 51 | } |
52 | 52 | |
53 | + /** |
|
54 | + * @param integer $level |
|
55 | + */ |
|
53 | 56 | protected function createXML($key, $value, $level) |
54 | 57 | { |
55 | 58 | $indent = ''; |
@@ -69,6 +72,9 @@ discard block |
||
69 | 72 | return $xml; |
70 | 73 | } |
71 | 74 | |
75 | + /** |
|
76 | + * @param string $line |
|
77 | + */ |
|
72 | 78 | protected function parseLine($line) |
73 | 79 | { |
74 | 80 | $tag = substr($line, 1, strpos($line, ':', 1) - 1); |
@@ -114,6 +120,9 @@ discard block |
||
114 | 120 | $this->_lastTag = $tag; |
115 | 121 | } |
116 | 122 | |
123 | + /** |
|
124 | + * @param string $value |
|
125 | + */ |
|
117 | 126 | protected function parseOperation($value) |
118 | 127 | { |
119 | 128 | $this->operations[] = array( |
@@ -124,6 +133,9 @@ discard block |
||
124 | 133 | ); |
125 | 134 | } |
126 | 135 | |
136 | + /** |
|
137 | + * @param string $value |
|
138 | + */ |
|
127 | 139 | protected function parseBalance($value) |
128 | 140 | { |
129 | 141 | return array( |
@@ -134,6 +146,9 @@ discard block |
||
134 | 146 | ); |
135 | 147 | } |
136 | 148 | |
149 | + /** |
|
150 | + * @param string $value |
|
151 | + */ |
|
137 | 152 | protected function parseTransaction($value) |
138 | 153 | { |
139 | 154 | $transaction = array( |
@@ -34,8 +34,9 @@ discard block |
||
34 | 34 | public function parse() |
35 | 35 | { |
36 | 36 | $tab = $this->prepareFile(); |
37 | - foreach ($tab as $line) |
|
38 | - $this->parseLine($line); |
|
37 | + foreach ($tab as $line) { |
|
38 | + $this->parseLine($line); |
|
39 | + } |
|
39 | 40 | } |
40 | 41 | |
41 | 42 | public function getXML() |
@@ -53,13 +54,15 @@ discard block |
||
53 | 54 | protected function createXML($key, $value, $level) |
54 | 55 | { |
55 | 56 | $indent = ''; |
56 | - for ($i = 0; $i <= $level; $i++) |
|
57 | - $indent .= "\t"; |
|
57 | + for ($i = 0; $i <= $level; $i++) { |
|
58 | + $indent .= "\t"; |
|
59 | + } |
|
58 | 60 | if (is_array($value)) { |
59 | 61 | $xml = "$indent<$key>\n"; |
60 | 62 | foreach ($value as $subKey => $subVal) { |
61 | - if (is_numeric($subKey)) |
|
62 | - $subKey = substr($key, 0, -1); |
|
63 | + if (is_numeric($subKey)) { |
|
64 | + $subKey = substr($key, 0, -1); |
|
65 | + } |
|
63 | 66 | $xml .= $this->createXML($subKey, $subVal, $level + 1); |
64 | 67 | } |
65 | 68 | $xml .= "$indent</$key>\n"; |
@@ -85,10 +88,11 @@ discard block |
||
85 | 88 | break; |
86 | 89 | case 'NS': |
87 | 90 | $code = substr($value, 0, 2); |
88 | - if ($code == '22') |
|
89 | - $this->ownerName = substr($value, 2); |
|
90 | - else if ($code == '23') |
|
91 | - $this->accountName = substr($value, 2); |
|
91 | + if ($code == '22') { |
|
92 | + $this->ownerName = substr($value, 2); |
|
93 | + } else if ($code == '23') { |
|
94 | + $this->accountName = substr($value, 2); |
|
95 | + } |
|
92 | 96 | break; |
93 | 97 | case '60F': |
94 | 98 | $this->openBalance = $this->parseBalance($value); |
@@ -103,10 +107,11 @@ discard block |
||
103 | 107 | self::parseOperation($value); |
104 | 108 | break; |
105 | 109 | case '86': |
106 | - if ($this->_lastTag == '61') |
|
107 | - $this->parseTransaction($value); |
|
108 | - else |
|
109 | - $this->info .= $value; |
|
110 | + if ($this->_lastTag == '61') { |
|
111 | + $this->parseTransaction($value); |
|
112 | + } else { |
|
113 | + $this->info .= $value; |
|
114 | + } |
|
110 | 115 | break; |
111 | 116 | default: |
112 | 117 | break; |
@@ -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; |
@@ -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 parseTransaction($value) |
69 | 75 | { |
70 | 76 | $transaction = array( |
@@ -109,6 +115,9 @@ discard block |
||
109 | 115 | $this->operations[count($this->operations) - 1]['details'] = $transaction; |
110 | 116 | } |
111 | 117 | |
118 | + /** |
|
119 | + * @param string $value |
|
120 | + */ |
|
112 | 121 | protected function parseOperation($value) |
113 | 122 | { |
114 | 123 | $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; |
@@ -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') { |
@@ -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) { |
@@ -1229,18 +1242,20 @@ discard block |
||
1229 | 1242 | $fieldvalue = "vtiger_activity.status" . $this->getAdvComparator($comparator, trim($value), $datatype); |
1230 | 1243 | } |
1231 | 1244 | } else if ($comparator == 'ny') { |
1232 | - if ($fieldInfo['uitype'] == '10' || isReferenceUIType($fieldInfo['uitype'])) |
|
1233 | - $fieldvalue = "(" . $selectedfields[0] . "." . $selectedfields[1] . " IS NOT NULL && " . $selectedfields[0] . "." . $selectedfields[1] . " != '' && " . $selectedfields[0] . "." . $selectedfields[1] . " != '0')"; |
|
1234 | - else |
|
1235 | - $fieldvalue = "(" . $selectedfields[0] . "." . $selectedfields[1] . " IS NOT NULL && " . $selectedfields[0] . "." . $selectedfields[1] . " != '')"; |
|
1236 | - }elseif ($comparator == 'y' || ($comparator == 'e' && (trim($value) == "NULL" || trim($value) == ''))) { |
|
1245 | + if ($fieldInfo['uitype'] == '10' || isReferenceUIType($fieldInfo['uitype'])) { |
|
1246 | + $fieldvalue = "(" . $selectedfields[0] . "." . $selectedfields[1] . " IS NOT NULL && " . $selectedfields[0] . "." . $selectedfields[1] . " != '' && " . $selectedfields[0] . "." . $selectedfields[1] . " != '0')"; |
|
1247 | + } else { |
|
1248 | + $fieldvalue = "(" . $selectedfields[0] . "." . $selectedfields[1] . " IS NOT NULL && " . $selectedfields[0] . "." . $selectedfields[1] . " != '')"; |
|
1249 | + } |
|
1250 | + } elseif ($comparator == 'y' || ($comparator == 'e' && (trim($value) == "NULL" || trim($value) == ''))) { |
|
1237 | 1251 | if ($selectedfields[0] == 'vtiger_inventoryproductrel') { |
1238 | 1252 | $selectedfields[0] = 'vtiger_inventoryproductrel' . $moduleName; |
1239 | 1253 | } |
1240 | - if ($fieldInfo['uitype'] == '10' || isReferenceUIType($fieldInfo['uitype'])) |
|
1241 | - $fieldvalue = "(" . $selectedfields[0] . "." . $selectedfields[1] . " IS NULL || " . $selectedfields[0] . "." . $selectedfields[1] . " = '' || " . $selectedfields[0] . "." . $selectedfields[1] . " = '0')"; |
|
1242 | - else |
|
1243 | - $fieldvalue = "(" . $selectedfields[0] . "." . $selectedfields[1] . " IS NULL || " . $selectedfields[0] . "." . $selectedfields[1] . " = '')"; |
|
1254 | + if ($fieldInfo['uitype'] == '10' || isReferenceUIType($fieldInfo['uitype'])) { |
|
1255 | + $fieldvalue = "(" . $selectedfields[0] . "." . $selectedfields[1] . " IS NULL || " . $selectedfields[0] . "." . $selectedfields[1] . " = '' || " . $selectedfields[0] . "." . $selectedfields[1] . " = '0')"; |
|
1256 | + } else { |
|
1257 | + $fieldvalue = "(" . $selectedfields[0] . "." . $selectedfields[1] . " IS NULL || " . $selectedfields[0] . "." . $selectedfields[1] . " = '')"; |
|
1258 | + } |
|
1244 | 1259 | } elseif ($selectedfields[0] == 'vtiger_inventoryproductrel') { |
1245 | 1260 | if ($selectedfields[1] == 'productid') { |
1246 | 1261 | $fieldvalue = "vtiger_products$moduleName.productname " . $this->getAdvComparator($comparator, trim($value), $datatype); |
@@ -1286,8 +1301,9 @@ discard block |
||
1286 | 1301 | } |
1287 | 1302 | } |
1288 | 1303 | } |
1289 | - if (trim($advfiltersql) != "") |
|
1290 | - $advfiltersql = '(' . $advfiltersql . ')'; |
|
1304 | + if (trim($advfiltersql) != "") { |
|
1305 | + $advfiltersql = '(' . $advfiltersql . ')'; |
|
1306 | + } |
|
1291 | 1307 | |
1292 | 1308 | return $advfiltersql; |
1293 | 1309 | } |
@@ -1342,8 +1358,9 @@ discard block |
||
1342 | 1358 | |
1343 | 1359 | if ($fieldcolname != "none") { |
1344 | 1360 | $selectedfields = explode(":", $fieldcolname); |
1345 | - if ($selectedfields[0] == "vtiger_crmentity" . $this->primarymodule) |
|
1346 | - $selectedfields[0] = "vtiger_crmentity"; |
|
1361 | + if ($selectedfields[0] == "vtiger_crmentity" . $this->primarymodule) { |
|
1362 | + $selectedfields[0] = "vtiger_crmentity"; |
|
1363 | + } |
|
1347 | 1364 | |
1348 | 1365 | $moduleFieldLabel = $selectedfields[3]; |
1349 | 1366 | list($moduleName, $fieldLabel) = explode('__', $moduleFieldLabel, 2); |
@@ -1412,8 +1429,9 @@ discard block |
||
1412 | 1429 | { |
1413 | 1430 | if ($filtercolumn != "none") { |
1414 | 1431 | $selectedfields = explode(":", $filtercolumn); |
1415 | - if ($selectedfields[0] == "vtiger_crmentity" . $this->primarymodule) |
|
1416 | - $selectedfields[0] = "vtiger_crmentity"; |
|
1432 | + if ($selectedfields[0] == "vtiger_crmentity" . $this->primarymodule) { |
|
1433 | + $selectedfields[0] = "vtiger_crmentity"; |
|
1434 | + } |
|
1417 | 1435 | if ($filter == "custom") { |
1418 | 1436 | if ($startdate != "0000-00-00" && $enddate != "0000-00-00" && $startdate != "" && |
1419 | 1437 | $enddate != "" && $selectedfields[0] != "" && $selectedfields[1] != "") { |
@@ -1446,8 +1464,9 @@ discard block |
||
1446 | 1464 | if (!empty($advft_criteria)) { |
1447 | 1465 | foreach ($advft_criteria as $column_index => $column_condition) { |
1448 | 1466 | |
1449 | - if (empty($column_condition)) |
|
1450 | - continue; |
|
1467 | + if (empty($column_condition)) { |
|
1468 | + continue; |
|
1469 | + } |
|
1451 | 1470 | |
1452 | 1471 | $adv_filter_column = $column_condition["columnname"]; |
1453 | 1472 | $adv_filter_comparator = $column_condition["comparator"]; |
@@ -1504,10 +1523,12 @@ discard block |
||
1504 | 1523 | } |
1505 | 1524 | |
1506 | 1525 | foreach ($advft_criteria_groups as $group_index => $group_condition_info) { |
1507 | - if (empty($group_condition_info)) |
|
1508 | - continue; |
|
1509 | - if (empty($advfilterlist[$group_index])) |
|
1510 | - continue; |
|
1526 | + if (empty($group_condition_info)) { |
|
1527 | + continue; |
|
1528 | + } |
|
1529 | + if (empty($advfilterlist[$group_index])) { |
|
1530 | + continue; |
|
1531 | + } |
|
1511 | 1532 | $advfilterlist[$group_index]['condition'] = $group_condition_info["groupcondition"]; |
1512 | 1533 | $noOfGroupColumns = count($advfilterlist[$group_index]['columns']); |
1513 | 1534 | if (!empty($advfilterlist[$group_index]['columns'][$noOfGroupColumns - 1]['column_condition'])) { |
@@ -1549,8 +1570,9 @@ discard block |
||
1549 | 1570 | |
1550 | 1571 | if ($fieldcolname != "none") { |
1551 | 1572 | $selectedfields = explode(":", $fieldcolname); |
1552 | - if ($selectedfields[0] == "vtiger_crmentity" . $this->primarymodule) |
|
1553 | - $selectedfields[0] = "vtiger_crmentity"; |
|
1573 | + if ($selectedfields[0] == "vtiger_crmentity" . $this->primarymodule) { |
|
1574 | + $selectedfields[0] = "vtiger_crmentity"; |
|
1575 | + } |
|
1554 | 1576 | if ($datefilter == "custom") { |
1555 | 1577 | |
1556 | 1578 | if ($startdate != "0000-00-00" && $enddate != "0000-00-00" && $selectedfields[0] != "" && $selectedfields[1] != "" && $startdate != '' && $enddate != '') { |
@@ -1639,8 +1661,9 @@ discard block |
||
1639 | 1661 | |
1640 | 1662 | if ($fieldcolname != "none") { |
1641 | 1663 | $selectedfields = explode(":", $fieldcolname); |
1642 | - if ($selectedfields[0] == "vtiger_crmentity" . $this->primarymodule) |
|
1643 | - $selectedfields[0] = "vtiger_crmentity"; |
|
1664 | + if ($selectedfields[0] == "vtiger_crmentity" . $this->primarymodule) { |
|
1665 | + $selectedfields[0] = "vtiger_crmentity"; |
|
1666 | + } |
|
1644 | 1667 | if (stripos($selectedfields[1], 'cf_') == 0 && stristr($selectedfields[1], 'cf_') === true) { |
1645 | 1668 | //In sql queries forward slash(/) is treated as query terminator,so to avoid this problem |
1646 | 1669 | //the column names are enclosed within ('[]'),which will treat this as part of column name |
@@ -1733,8 +1756,9 @@ discard block |
||
1733 | 1756 | $sSQL .= ', '; |
1734 | 1757 | $this->orderbylistsql .= ', '; |
1735 | 1758 | } |
1736 | - if ($selectedfields[0] == 'vtiger_crmentity' . $this->primarymodule) |
|
1737 | - $selectedfields[0] = 'vtiger_crmentity'; |
|
1759 | + if ($selectedfields[0] == 'vtiger_crmentity' . $this->primarymodule) { |
|
1760 | + $selectedfields[0] = 'vtiger_crmentity'; |
|
1761 | + } |
|
1738 | 1762 | $sSQL .= $selectedfields[0] . '.' . $selectedfields[1] . ' ' . $sortorder; |
1739 | 1763 | $this->orderbylistsql .= $selectedfields[0] . '.' . $selectedfields[1] . ' ' . $selectedfields[2]; |
1740 | 1764 | } |
@@ -2357,8 +2381,9 @@ discard block |
||
2357 | 2381 | } |
2358 | 2382 | /* STRING TRANSLATION starts */ |
2359 | 2383 | $moduleLabel = ''; |
2360 | - if (in_array($module, $modules_selected)) |
|
2361 | - $moduleLabel = \App\Language::translate($module, $module); |
|
2384 | + if (in_array($module, $modules_selected)) { |
|
2385 | + $moduleLabel = \App\Language::translate($module, $module); |
|
2386 | + } |
|
2362 | 2387 | |
2363 | 2388 | if (empty($translatedLabel)) { |
2364 | 2389 | $translatedLabel = \App\Language::translate(str_replace('__', " ", $fld->name), $module); |
@@ -2438,8 +2463,9 @@ discard block |
||
2438 | 2463 | } |
2439 | 2464 | // END |
2440 | 2465 | |
2441 | - if ($is_admin === false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1) |
|
2442 | - $picklistarray = $this->getAccessPickListValues(); |
|
2466 | + if ($is_admin === false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1) { |
|
2467 | + $picklistarray = $this->getAccessPickListValues(); |
|
2468 | + } |
|
2443 | 2469 | if ($result) { |
2444 | 2470 | $y = $adb->getFieldsCount($result); |
2445 | 2471 | $arrayHeaders = Array(); |
@@ -2473,10 +2499,11 @@ discard block |
||
2473 | 2499 | $headerLabel_tmp = \App\Language::translate($mod_name[0] . " " . $mod_name[1]); |
2474 | 2500 | } |
2475 | 2501 | } |
2476 | - if ($headerLabel == $headerLabel_tmp) |
|
2477 | - $headerLabel = \App\Language::translate($headerLabel_tmp); |
|
2478 | - else |
|
2479 | - $headerLabel = $headerLabel_tmp; |
|
2502 | + if ($headerLabel == $headerLabel_tmp) { |
|
2503 | + $headerLabel = \App\Language::translate($headerLabel_tmp); |
|
2504 | + } else { |
|
2505 | + $headerLabel = $headerLabel_tmp; |
|
2506 | + } |
|
2480 | 2507 | /* STRING TRANSLATION ends */ |
2481 | 2508 | $header .= "<td class='rptCellLabel'>" . $headerLabel . "</td>"; |
2482 | 2509 | |
@@ -2512,14 +2539,17 @@ discard block |
||
2512 | 2539 | $snewvalue = $custom_field_values[1]; |
2513 | 2540 | $tnewvalue = $custom_field_values[2]; |
2514 | 2541 | } |
2515 | - if ($newvalue == "") |
|
2516 | - $newvalue = "-"; |
|
2542 | + if ($newvalue == "") { |
|
2543 | + $newvalue = "-"; |
|
2544 | + } |
|
2517 | 2545 | |
2518 | - if ($snewvalue == "") |
|
2519 | - $snewvalue = "-"; |
|
2546 | + if ($snewvalue == "") { |
|
2547 | + $snewvalue = "-"; |
|
2548 | + } |
|
2520 | 2549 | |
2521 | - if ($tnewvalue == "") |
|
2522 | - $tnewvalue = "-"; |
|
2550 | + if ($tnewvalue == "") { |
|
2551 | + $tnewvalue = "-"; |
|
2552 | + } |
|
2523 | 2553 | |
2524 | 2554 | $valtemplate .= "<tr>"; |
2525 | 2555 | |
@@ -2645,8 +2675,9 @@ discard block |
||
2645 | 2675 | } elseif ($outputformat == "PDF") { |
2646 | 2676 | $sSQL = $this->sGetSQLforReport($this->reportid, $filtersql, $outputformat, false, $startLimit, $endLimit); |
2647 | 2677 | $result = $adb->pquery($sSQL, array()); |
2648 | - if ($is_admin === false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1) |
|
2649 | - $picklistarray = $this->getAccessPickListValues(); |
|
2678 | + if ($is_admin === false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1) { |
|
2679 | + $picklistarray = $this->getAccessPickListValues(); |
|
2680 | + } |
|
2650 | 2681 | |
2651 | 2682 | if ($result) { |
2652 | 2683 | $y = $adb->getFieldsCount($result); |
@@ -2736,45 +2767,49 @@ discard block |
||
2736 | 2767 | $value = trim($key); |
2737 | 2768 | $arraykey = $value . '__SUM'; |
2738 | 2769 | if (isset($keyhdr[$arraykey])) { |
2739 | - if ($convert_price) |
|
2740 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
2741 | - else |
|
2742 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
2770 | + if ($convert_price) { |
|
2771 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
2772 | + } else { |
|
2773 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
2774 | + } |
|
2743 | 2775 | $totalpdf[$rowcount][$arraykey] = $conv_value; |
2744 | - }else { |
|
2776 | + } else { |
|
2745 | 2777 | $totalpdf[$rowcount][$arraykey] = ''; |
2746 | 2778 | } |
2747 | 2779 | |
2748 | 2780 | $arraykey = $value . '__AVG'; |
2749 | 2781 | if (isset($keyhdr[$arraykey])) { |
2750 | - if ($convert_price) |
|
2751 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
2752 | - else |
|
2753 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
2782 | + if ($convert_price) { |
|
2783 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
2784 | + } else { |
|
2785 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
2786 | + } |
|
2754 | 2787 | $totalpdf[$rowcount][$arraykey] = $conv_value; |
2755 | - }else { |
|
2788 | + } else { |
|
2756 | 2789 | $totalpdf[$rowcount][$arraykey] = ''; |
2757 | 2790 | } |
2758 | 2791 | |
2759 | 2792 | $arraykey = $value . '__MIN'; |
2760 | 2793 | if (isset($keyhdr[$arraykey])) { |
2761 | - if ($convert_price) |
|
2762 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
2763 | - else |
|
2764 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
2794 | + if ($convert_price) { |
|
2795 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
2796 | + } else { |
|
2797 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
2798 | + } |
|
2765 | 2799 | $totalpdf[$rowcount][$arraykey] = $conv_value; |
2766 | - }else { |
|
2800 | + } else { |
|
2767 | 2801 | $totalpdf[$rowcount][$arraykey] = ''; |
2768 | 2802 | } |
2769 | 2803 | |
2770 | 2804 | $arraykey = $value . '__MAX'; |
2771 | 2805 | if (isset($keyhdr[$arraykey])) { |
2772 | - if ($convert_price) |
|
2773 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
2774 | - else |
|
2775 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
2806 | + if ($convert_price) { |
|
2807 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
2808 | + } else { |
|
2809 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
2810 | + } |
|
2776 | 2811 | $totalpdf[$rowcount][$arraykey] = $conv_value; |
2777 | - }else { |
|
2812 | + } else { |
|
2778 | 2813 | $totalpdf[$rowcount][$arraykey] = ''; |
2779 | 2814 | } |
2780 | 2815 | $rowcount++; |
@@ -2848,45 +2883,49 @@ discard block |
||
2848 | 2883 | $value = trim($key); |
2849 | 2884 | $arraykey = $value . '__SUM'; |
2850 | 2885 | if (isset($keyhdr[$arraykey])) { |
2851 | - if ($convert_price) |
|
2852 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
2853 | - else |
|
2854 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
2886 | + if ($convert_price) { |
|
2887 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
2888 | + } else { |
|
2889 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
2890 | + } |
|
2855 | 2891 | $coltotalhtml .= '<td class="rptTotal">' . $conv_value . '</td>'; |
2856 | - }else { |
|
2892 | + } else { |
|
2857 | 2893 | $coltotalhtml .= '<td class="rptTotal"> </td>'; |
2858 | 2894 | } |
2859 | 2895 | |
2860 | 2896 | $arraykey = $value . '__AVG'; |
2861 | 2897 | if (isset($keyhdr[$arraykey])) { |
2862 | - if ($convert_price) |
|
2863 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
2864 | - else |
|
2865 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
2898 | + if ($convert_price) { |
|
2899 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
2900 | + } else { |
|
2901 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
2902 | + } |
|
2866 | 2903 | $coltotalhtml .= '<td class="rptTotal">' . $conv_value . '</td>'; |
2867 | - }else { |
|
2904 | + } else { |
|
2868 | 2905 | $coltotalhtml .= '<td class="rptTotal"> </td>'; |
2869 | 2906 | } |
2870 | 2907 | |
2871 | 2908 | $arraykey = $value . '__MIN'; |
2872 | 2909 | if (isset($keyhdr[$arraykey])) { |
2873 | - if ($convert_price) |
|
2874 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
2875 | - else |
|
2876 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
2910 | + if ($convert_price) { |
|
2911 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
2912 | + } else { |
|
2913 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
2914 | + } |
|
2877 | 2915 | $coltotalhtml .= '<td class="rptTotal">' . $conv_value . '</td>'; |
2878 | - }else { |
|
2916 | + } else { |
|
2879 | 2917 | $coltotalhtml .= '<td class="rptTotal"> </td>'; |
2880 | 2918 | } |
2881 | 2919 | |
2882 | 2920 | $arraykey = $value . '__MAX'; |
2883 | 2921 | if (isset($keyhdr[$arraykey])) { |
2884 | - if ($convert_price) |
|
2885 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
2886 | - else |
|
2887 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
2922 | + if ($convert_price) { |
|
2923 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
2924 | + } else { |
|
2925 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
2926 | + } |
|
2888 | 2927 | $coltotalhtml .= '<td class="rptTotal">' . $conv_value . '</td>'; |
2889 | - }else { |
|
2928 | + } else { |
|
2890 | 2929 | $coltotalhtml .= '<td class="rptTotal"> </td>'; |
2891 | 2930 | } |
2892 | 2931 | |
@@ -2914,8 +2953,9 @@ discard block |
||
2914 | 2953 | } elseif ($outputformat == "PRINT") { |
2915 | 2954 | $sSQL = $this->sGetSQLforReport($this->reportid, $filtersql, $outputformat); |
2916 | 2955 | $result = $adb->query($sSQL); |
2917 | - if ($is_admin === false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1) |
|
2918 | - $picklistarray = $this->getAccessPickListValues(); |
|
2956 | + if ($is_admin === false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1) { |
|
2957 | + $picklistarray = $this->getAccessPickListValues(); |
|
2958 | + } |
|
2919 | 2959 | |
2920 | 2960 | if ($result) { |
2921 | 2961 | $y = $adb->getFieldsCount($result); |
@@ -2944,14 +2984,17 @@ discard block |
||
2944 | 2984 | $tnewvalue = $custom_field_values[2]; |
2945 | 2985 | } |
2946 | 2986 | |
2947 | - if ($newvalue == "") |
|
2948 | - $newvalue = "-"; |
|
2987 | + if ($newvalue == "") { |
|
2988 | + $newvalue = "-"; |
|
2989 | + } |
|
2949 | 2990 | |
2950 | - if ($snewvalue == "") |
|
2951 | - $snewvalue = "-"; |
|
2991 | + if ($snewvalue == "") { |
|
2992 | + $snewvalue = "-"; |
|
2993 | + } |
|
2952 | 2994 | |
2953 | - if ($tnewvalue == "") |
|
2954 | - $tnewvalue = "-"; |
|
2995 | + if ($tnewvalue == "") { |
|
2996 | + $tnewvalue = "-"; |
|
2997 | + } |
|
2955 | 2998 | |
2956 | 2999 | $valtemplate .= "<tr>"; |
2957 | 3000 | |
@@ -3053,45 +3096,49 @@ discard block |
||
3053 | 3096 | $value = trim($key); |
3054 | 3097 | $arraykey = $value . '__SUM'; |
3055 | 3098 | if (isset($keyhdr[$arraykey])) { |
3056 | - if ($convert_price) |
|
3057 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
3058 | - else |
|
3059 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
3099 | + if ($convert_price) { |
|
3100 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
3101 | + } else { |
|
3102 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
3103 | + } |
|
3060 | 3104 | $coltotalhtml .= "<td class='rptTotal'>" . $conv_value . '</td>'; |
3061 | - }else { |
|
3105 | + } else { |
|
3062 | 3106 | $coltotalhtml .= "<td class='rptTotal'> </td>"; |
3063 | 3107 | } |
3064 | 3108 | |
3065 | 3109 | $arraykey = $value . '__AVG'; |
3066 | 3110 | if (isset($keyhdr[$arraykey])) { |
3067 | - if ($convert_price) |
|
3068 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
3069 | - else |
|
3070 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
3111 | + if ($convert_price) { |
|
3112 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
3113 | + } else { |
|
3114 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
3115 | + } |
|
3071 | 3116 | $coltotalhtml .= "<td class='rptTotal'>" . $conv_value . '</td>'; |
3072 | - }else { |
|
3117 | + } else { |
|
3073 | 3118 | $coltotalhtml .= "<td class='rptTotal'> </td>"; |
3074 | 3119 | } |
3075 | 3120 | |
3076 | 3121 | $arraykey = $value . '__MIN'; |
3077 | 3122 | if (isset($keyhdr[$arraykey])) { |
3078 | - if ($convert_price) |
|
3079 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
3080 | - else |
|
3081 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
3123 | + if ($convert_price) { |
|
3124 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
3125 | + } else { |
|
3126 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
3127 | + } |
|
3082 | 3128 | $coltotalhtml .= "<td class='rptTotal'>" . $conv_value . '</td>'; |
3083 | - }else { |
|
3129 | + } else { |
|
3084 | 3130 | $coltotalhtml .= "<td class='rptTotal'> </td>"; |
3085 | 3131 | } |
3086 | 3132 | |
3087 | 3133 | $arraykey = $value . '__MAX'; |
3088 | 3134 | if (isset($keyhdr[$arraykey])) { |
3089 | - if ($convert_price) |
|
3090 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
3091 | - else |
|
3092 | - $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
3135 | + if ($convert_price) { |
|
3136 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]); |
|
3137 | + } else { |
|
3138 | + $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
|
3139 | + } |
|
3093 | 3140 | $coltotalhtml .= "<td class='rptTotal'>" . $conv_value . '</td>'; |
3094 | - }else { |
|
3141 | + } else { |
|
3095 | 3142 | $coltotalhtml .= "<td class='rptTotal'> </td>"; |
3096 | 3143 | } |
3097 | 3144 | |
@@ -3346,8 +3393,9 @@ discard block |
||
3346 | 3393 | $adb = PearDatabase::getInstance(); |
3347 | 3394 | $current_user = vglobal('current_user'); |
3348 | 3395 | $id = array(\App\Module::getModuleId($this->primarymodule)); |
3349 | - if ($this->secondarymodule != '') |
|
3350 | - array_push($id, \App\Module::getModuleId($this->secondarymodule)); |
|
3396 | + if ($this->secondarymodule != '') { |
|
3397 | + array_push($id, \App\Module::getModuleId($this->secondarymodule)); |
|
3398 | + } |
|
3351 | 3399 | |
3352 | 3400 | $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 (?)'; |
3353 | 3401 | $result = $adb->pquery($query, $id); //,$select_column)); |
@@ -3376,13 +3424,15 @@ discard block |
||
3376 | 3424 | } else { |
3377 | 3425 | $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 |
3378 | 3426 | } |
3379 | - if ($fieldname != 'firstname') |
|
3380 | - $mulselresult = $adb->query($mulsel); |
|
3427 | + if ($fieldname != 'firstname') { |
|
3428 | + $mulselresult = $adb->query($mulsel); |
|
3429 | + } |
|
3381 | 3430 | $countMulSelResult = $adb->num_rows($mulselresult); |
3382 | 3431 | for ($j = 0; $j < $countMulSelResult; $j++) { |
3383 | 3432 | $fldvalue = $adb->query_result($mulselresult, $j, $fieldname); |
3384 | - if (in_array($fldvalue, $fieldvalues)) |
|
3385 | - continue; |
|
3433 | + if (in_array($fldvalue, $fieldvalues)) { |
|
3434 | + continue; |
|
3435 | + } |
|
3386 | 3436 | $fieldvalues[] = $fldvalue; |
3387 | 3437 | } |
3388 | 3438 | $field_count = count($fieldvalues); |
@@ -3393,16 +3443,18 @@ discard block |
||
3393 | 3443 | $temp_status[$keyvalue][($temp_count + $t)] = $fieldvalues[$t]; |
3394 | 3444 | } |
3395 | 3445 | $fieldvalues = $temp_status[$keyvalue]; |
3396 | - } else |
|
3397 | - $temp_status[$keyvalue] = $fieldvalues; |
|
3446 | + } else { |
|
3447 | + $temp_status[$keyvalue] = $fieldvalues; |
|
3448 | + } |
|
3398 | 3449 | } |
3399 | 3450 | |
3400 | - if ($uitype == 33) |
|
3401 | - $fieldlists[1][$keyvalue] = $fieldvalues; |
|
3402 | - else if ($uitype == 55 && $fieldname == 'salutationtype') |
|
3403 | - $fieldlists[$keyvalue] = $fieldvalues; |
|
3404 | - else if ($uitype == 15) |
|
3405 | - $fieldlists[$keyvalue] = $fieldvalues; |
|
3451 | + if ($uitype == 33) { |
|
3452 | + $fieldlists[1][$keyvalue] = $fieldvalues; |
|
3453 | + } else if ($uitype == 55 && $fieldname == 'salutationtype') { |
|
3454 | + $fieldlists[$keyvalue] = $fieldvalues; |
|
3455 | + } else if ($uitype == 15) { |
|
3456 | + $fieldlists[$keyvalue] = $fieldvalues; |
|
3457 | + } |
|
3406 | 3458 | } |
3407 | 3459 | return $fieldlists; |
3408 | 3460 | } |
@@ -998,7 +998,7 @@ discard block |
||
998 | 998 | $advfiltergroupsql .= "$tableColumnSql BETWEEN $start AND $end"; |
999 | 999 | else |
1000 | 1000 | $advfiltergroupsql .= "$tableColumnSql NOT BETWEEN $start AND $end"; |
1001 | - }else if ($comparator == 'bw') { |
|
1001 | + } else if ($comparator == 'bw') { |
|
1002 | 1002 | $values = explode(',', $value); |
1003 | 1003 | $startDateTime = explode(' ', $values[0]); |
1004 | 1004 | $endDateTime = explode(' ', $values[1]); |
@@ -1460,7 +1460,7 @@ discard block |
||
1460 | 1460 | } |
1461 | 1461 | |
1462 | 1462 | $temp_val = explode(",", $adv_filter_value); |
1463 | - 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 != '' )) { |
|
1463 | + 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 != '')) { |
|
1464 | 1464 | $val = Array(); |
1465 | 1465 | $countTempVal = count($temp_val); |
1466 | 1466 | for ($x = 0; $x < $countTempVal; $x++) { |
@@ -2723,7 +2723,7 @@ discard block |
||
2723 | 2723 | else |
2724 | 2724 | $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
2725 | 2725 | $totalpdf[$rowcount][$arraykey] = $conv_value; |
2726 | - }else { |
|
2726 | + } else { |
|
2727 | 2727 | $totalpdf[$rowcount][$arraykey] = ''; |
2728 | 2728 | } |
2729 | 2729 | |
@@ -2734,7 +2734,7 @@ discard block |
||
2734 | 2734 | else |
2735 | 2735 | $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
2736 | 2736 | $totalpdf[$rowcount][$arraykey] = $conv_value; |
2737 | - }else { |
|
2737 | + } else { |
|
2738 | 2738 | $totalpdf[$rowcount][$arraykey] = ''; |
2739 | 2739 | } |
2740 | 2740 | |
@@ -2745,7 +2745,7 @@ discard block |
||
2745 | 2745 | else |
2746 | 2746 | $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
2747 | 2747 | $totalpdf[$rowcount][$arraykey] = $conv_value; |
2748 | - }else { |
|
2748 | + } else { |
|
2749 | 2749 | $totalpdf[$rowcount][$arraykey] = ''; |
2750 | 2750 | } |
2751 | 2751 | |
@@ -2756,7 +2756,7 @@ discard block |
||
2756 | 2756 | else |
2757 | 2757 | $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
2758 | 2758 | $totalpdf[$rowcount][$arraykey] = $conv_value; |
2759 | - }else { |
|
2759 | + } else { |
|
2760 | 2760 | $totalpdf[$rowcount][$arraykey] = ''; |
2761 | 2761 | } |
2762 | 2762 | $rowcount++; |
@@ -2835,7 +2835,7 @@ discard block |
||
2835 | 2835 | else |
2836 | 2836 | $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
2837 | 2837 | $coltotalhtml .= '<td class="rptTotal">' . $conv_value . '</td>'; |
2838 | - }else { |
|
2838 | + } else { |
|
2839 | 2839 | $coltotalhtml .= '<td class="rptTotal"> </td>'; |
2840 | 2840 | } |
2841 | 2841 | |
@@ -2846,7 +2846,7 @@ discard block |
||
2846 | 2846 | else |
2847 | 2847 | $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
2848 | 2848 | $coltotalhtml .= '<td class="rptTotal">' . $conv_value . '</td>'; |
2849 | - }else { |
|
2849 | + } else { |
|
2850 | 2850 | $coltotalhtml .= '<td class="rptTotal"> </td>'; |
2851 | 2851 | } |
2852 | 2852 | |
@@ -2857,7 +2857,7 @@ discard block |
||
2857 | 2857 | else |
2858 | 2858 | $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
2859 | 2859 | $coltotalhtml .= '<td class="rptTotal">' . $conv_value . '</td>'; |
2860 | - }else { |
|
2860 | + } else { |
|
2861 | 2861 | $coltotalhtml .= '<td class="rptTotal"> </td>'; |
2862 | 2862 | } |
2863 | 2863 | |
@@ -2868,7 +2868,7 @@ discard block |
||
2868 | 2868 | else |
2869 | 2869 | $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
2870 | 2870 | $coltotalhtml .= '<td class="rptTotal">' . $conv_value . '</td>'; |
2871 | - }else { |
|
2871 | + } else { |
|
2872 | 2872 | $coltotalhtml .= '<td class="rptTotal"> </td>'; |
2873 | 2873 | } |
2874 | 2874 | |
@@ -3040,7 +3040,7 @@ discard block |
||
3040 | 3040 | else |
3041 | 3041 | $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
3042 | 3042 | $coltotalhtml .= "<td class='rptTotal'>" . $conv_value . '</td>'; |
3043 | - }else { |
|
3043 | + } else { |
|
3044 | 3044 | $coltotalhtml .= "<td class='rptTotal'> </td>"; |
3045 | 3045 | } |
3046 | 3046 | |
@@ -3051,7 +3051,7 @@ discard block |
||
3051 | 3051 | else |
3052 | 3052 | $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
3053 | 3053 | $coltotalhtml .= "<td class='rptTotal'>" . $conv_value . '</td>'; |
3054 | - }else { |
|
3054 | + } else { |
|
3055 | 3055 | $coltotalhtml .= "<td class='rptTotal'> </td>"; |
3056 | 3056 | } |
3057 | 3057 | |
@@ -3062,7 +3062,7 @@ discard block |
||
3062 | 3062 | else |
3063 | 3063 | $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
3064 | 3064 | $coltotalhtml .= "<td class='rptTotal'>" . $conv_value . '</td>'; |
3065 | - }else { |
|
3065 | + } else { |
|
3066 | 3066 | $coltotalhtml .= "<td class='rptTotal'> </td>"; |
3067 | 3067 | } |
3068 | 3068 | |
@@ -3073,7 +3073,7 @@ discard block |
||
3073 | 3073 | else |
3074 | 3074 | $conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true); |
3075 | 3075 | $coltotalhtml .= "<td class='rptTotal'>" . $conv_value . '</td>'; |
3076 | - }else { |
|
3076 | + } else { |
|
3077 | 3077 | $coltotalhtml .= "<td class='rptTotal'> </td>"; |
3078 | 3078 | } |
3079 | 3079 | |
@@ -3424,7 +3424,7 @@ discard block |
||
3424 | 3424 | $rowcount = 1; |
3425 | 3425 | //copy the first value details |
3426 | 3426 | $arrayFirstRowValues = $arrayValues[0]; |
3427 | - array_pop($arrayFirstRowValues); // removed action link in details |
|
3427 | + array_pop($arrayFirstRowValues); // removed action link in details |
|
3428 | 3428 | foreach ($arrayFirstRowValues as $key => $value) { |
3429 | 3429 | $worksheet->setCellValueExplicitByColumnAndRow($count, $rowcount, $key, true); |
3430 | 3430 | $worksheet->getStyleByColumnAndRow($count, $rowcount)->applyFromArray($header_styles); |
@@ -3455,7 +3455,7 @@ discard block |
||
3455 | 3455 | $count++; |
3456 | 3456 | foreach ($totalxls[0] as $key => $value) { |
3457 | 3457 | $operator = substr($key, -3, 3); |
3458 | - $worksheet->setCellValueExplicitByColumnAndRow($count, $rowcount, App\Language::translate("LBL_$operator", 'Reports')); |
|
3458 | + $worksheet->setCellValueExplicitByColumnAndRow($count, $rowcount, App\Language::translate("LBL_$operator", 'Reports')); |
|
3459 | 3459 | $worksheet->getStyleByColumnAndRow($count, $rowcount)->applyFromArray($header_styles); |
3460 | 3460 | $count++; |
3461 | 3461 | } |
@@ -3463,13 +3463,13 @@ discard block |
||
3463 | 3463 | $rowcount++; |
3464 | 3464 | foreach ($totalxls as $key => $array_value) { |
3465 | 3465 | $count = 0; |
3466 | - $labels = array_keys( $array_value); |
|
3466 | + $labels = array_keys($array_value); |
|
3467 | 3467 | $valueArray = explode('__', $labels[0], 2); |
3468 | 3468 | $operator = substr($labels[0], -3, 3); |
3469 | 3469 | $moduleName = $valueArray[0]; |
3470 | 3470 | $fieldLabel = str_replace("__$operator", '', $valueArray[1]); |
3471 | 3471 | $fieldLabel = str_replace('__', '', $fieldLabel); |
3472 | - $worksheet->setCellValueExplicitByColumnAndRow($count, $key + $rowcount, App\Language::translate($moduleName, $moduleName) .'-' . App\Language::translate($fieldLabel, $moduleName)); |
|
3472 | + $worksheet->setCellValueExplicitByColumnAndRow($count, $key + $rowcount, App\Language::translate($moduleName, $moduleName) . '-' . App\Language::translate($fieldLabel, $moduleName)); |
|
3473 | 3473 | $count++; |
3474 | 3474 | foreach ($array_value as $hdr => $value) { |
3475 | 3475 | $value = decode_html($value); |
@@ -3492,7 +3492,7 @@ discard block |
||
3492 | 3492 | if (isset($arr_val)) { |
3493 | 3493 | // Header |
3494 | 3494 | $csv_values = array_keys($arr_val[0]); |
3495 | - array_pop($csv_values); //removed header in csv file |
|
3495 | + array_pop($csv_values); //removed header in csv file |
|
3496 | 3496 | fputcsv($fp, $csv_values); |
3497 | 3497 | foreach ($arr_val as $key => $array_value) { |
3498 | 3498 | 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); |
@@ -363,13 +372,15 @@ discard block |
||
363 | 372 | $report_details ['reportname'] = $report["reportname"]; |
364 | 373 | $report_details ['sharingtype'] = $report["sharingtype"]; |
365 | 374 | $report_details['folderid'] = $report["folderid"]; |
366 | - if ($is_admin === true) |
|
367 | - $report_details ['editable'] = 'true'; |
|
368 | - else |
|
369 | - $report_details['editable'] = 'false'; |
|
375 | + if ($is_admin === true) { |
|
376 | + $report_details ['editable'] = 'true'; |
|
377 | + } else { |
|
378 | + $report_details['editable'] = 'false'; |
|
379 | + } |
|
370 | 380 | |
371 | - if (isPermitted($report["primarymodule"], 'index') == "yes") |
|
372 | - $returndata[] = $report_details; |
|
381 | + if (isPermitted($report["primarymodule"], 'index') == "yes") { |
|
382 | + $returndata[] = $report_details; |
|
383 | + } |
|
373 | 384 | }while ($report = $adb->fetch_array($result)); |
374 | 385 | } |
375 | 386 | \App\Log::trace("Reports :: ListView->Successfully returned vtiger_report details HTML"); |
@@ -450,13 +461,15 @@ discard block |
||
450 | 461 | $report_details['reportname'] = $report["reportname"]; |
451 | 462 | $report_details['reporttype'] = $report["reporttype"]; |
452 | 463 | $report_details['sharingtype'] = $report["sharingtype"]; |
453 | - if ($is_admin === true || in_array($report["owner"], $subordinate_users) || $report["owner"] == $currentUser->getId()) |
|
454 | - $report_details['editable'] = 'true'; |
|
455 | - else |
|
456 | - $report_details['editable'] = 'false'; |
|
464 | + if ($is_admin === true || in_array($report["owner"], $subordinate_users) || $report["owner"] == $currentUser->getId()) { |
|
465 | + $report_details['editable'] = 'true'; |
|
466 | + } else { |
|
467 | + $report_details['editable'] = 'false'; |
|
468 | + } |
|
457 | 469 | |
458 | - if (isPermitted($report["primarymodule"], 'index') == "yes") |
|
459 | - $returndata [$report["folderid"]][] = $report_details; |
|
470 | + if (isPermitted($report["primarymodule"], 'index') == "yes") { |
|
471 | + $returndata [$report["folderid"]][] = $report_details; |
|
472 | + } |
|
460 | 473 | }while ($report = $adb->fetch_array($result)); |
461 | 474 | } |
462 | 475 | |
@@ -571,8 +584,9 @@ discard block |
||
571 | 584 | $adb = PearDatabase::getInstance(); |
572 | 585 | $currentUser = Users_Privileges_Model::getCurrentUserPrivilegesModel(); |
573 | 586 | |
574 | - if (is_string($block)) |
|
575 | - $block = explode(',', $block); |
|
587 | + if (is_string($block)) { |
|
588 | + $block = explode(',', $block); |
|
589 | + } |
|
576 | 590 | $skipTalbes = array('vtiger_attachments'); |
577 | 591 | |
578 | 592 | $tabid = \App\Module::getModuleId($module); |
@@ -590,10 +604,11 @@ discard block |
||
590 | 604 | $sql .= ' and tablename NOT IN (' . generateQuestionMarks($skipTalbes) . ') '; |
591 | 605 | |
592 | 606 | //fix for Ticket #4016 |
593 | - if ($module == "Calendar") |
|
594 | - $sql .= " group by vtiger_field.fieldlabel order by sequence"; |
|
595 | - else |
|
596 | - $sql .= " group by vtiger_field.fieldid order by sequence"; |
|
607 | + if ($module == "Calendar") { |
|
608 | + $sql .= " group by vtiger_field.fieldlabel order by sequence"; |
|
609 | + } else { |
|
610 | + $sql .= " group by vtiger_field.fieldid order by sequence"; |
|
611 | + } |
|
597 | 612 | array_push($params, $skipTalbes); |
598 | 613 | |
599 | 614 | $result = $adb->pquery($sql, $params); |
@@ -635,8 +650,9 @@ discard block |
||
635 | 650 | $this->adv_rel_fields[$fieldtypeofdata][] = $adv_rel_field_tod_value; |
636 | 651 | } |
637 | 652 | //added to escape attachments fields in Reports as we have multiple attachments |
638 | - if ($module == 'HelpDesk' && $fieldname == 'filename') |
|
639 | - continue; |
|
653 | + if ($module == 'HelpDesk' && $fieldname == 'filename') { |
|
654 | + continue; |
|
655 | + } |
|
640 | 656 | |
641 | 657 | if (is_string($block) || $group_res_by_block === false) { |
642 | 658 | $module_columnlist[$optionvalue] = $fieldlabel; |
@@ -877,8 +893,9 @@ discard block |
||
877 | 893 | |
878 | 894 | $result = $adb->pquery($ssql, array($reportid, $groupId)); |
879 | 895 | $noOfColumns = $adb->num_rows($result); |
880 | - if ($noOfColumns <= 0) |
|
881 | - continue; |
|
896 | + if ($noOfColumns <= 0) { |
|
897 | + continue; |
|
898 | + } |
|
882 | 899 | |
883 | 900 | while ($relcriteriarow = $adb->fetch_array($result)) { |
884 | 901 | $columnIndex = $relcriteriarow["columnindex"]; |
@@ -936,8 +953,9 @@ discard block |
||
936 | 953 | $i++; |
937 | 954 | } |
938 | 955 | // Clear the condition (and/or) for last group, if any. |
939 | - if (!empty($advft_criteria[$i - 1]['condition'])) |
|
940 | - $advft_criteria[$i - 1]['condition'] = ''; |
|
956 | + if (!empty($advft_criteria[$i - 1]['condition'])) { |
|
957 | + $advft_criteria[$i - 1]['condition'] = ''; |
|
958 | + } |
|
941 | 959 | $this->advft_criteria = $advft_criteria; |
942 | 960 | \App\Log::trace("Reports :: Successfully returned getAdvancedFilterList"); |
943 | 961 | return true; |
@@ -1184,13 +1202,15 @@ discard block |
||
1184 | 1202 | $idelrelcriteriagroupsql = "delete from vtiger_relcriteria_grouping where queryid=?"; |
1185 | 1203 | $idelrelcriteriagroupsqlresult = $adb->pquery($idelrelcriteriagroupsql, array($reportid)); |
1186 | 1204 | |
1187 | - if (empty($advft_criteria)) |
|
1188 | - return; |
|
1205 | + if (empty($advft_criteria)) { |
|
1206 | + return; |
|
1207 | + } |
|
1189 | 1208 | |
1190 | 1209 | foreach ($advft_criteria as $column_index => $column_condition) { |
1191 | 1210 | |
1192 | - if (empty($column_condition)) |
|
1193 | - continue; |
|
1211 | + if (empty($column_condition)) { |
|
1212 | + continue; |
|
1213 | + } |
|
1194 | 1214 | |
1195 | 1215 | $adv_filter_column = $column_condition["columnname"]; |
1196 | 1216 | $adv_filter_comparator = $column_condition["comparator"]; |
@@ -1252,10 +1272,13 @@ discard block |
||
1252 | 1272 | |
1253 | 1273 | foreach ($advft_criteria_groups as $group_index => $group_condition_info) { |
1254 | 1274 | |
1255 | - if (empty($group_condition_info)) |
|
1256 | - continue; |
|
1257 | - if (empty($group_condition_info["conditionexpression"])) |
|
1258 | - continue; // Case when the group doesn't have any column criteria |
|
1275 | + if (empty($group_condition_info)) { |
|
1276 | + continue; |
|
1277 | + } |
|
1278 | + if (empty($group_condition_info["conditionexpression"])) { |
|
1279 | + continue; |
|
1280 | + } |
|
1281 | + // Case when the group doesn't have any column criteria |
|
1259 | 1282 | |
1260 | 1283 | $irelcriteriagroupsql = "insert into vtiger_relcriteria_grouping(GROUPID,QUERYID,GROUP_CONDITION,CONDITION_EXPRESSION) values (?,?,?,?)"; |
1261 | 1284 | $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 | } |