PluginProbe
VikBooking Hotel Booking Engine & PMS / 1.8.16
VikBooking Hotel Booking Engine & PMS v1.8.16
1.8.16 1.8.15 1.8.14 1.8.13 1.8.12 1.8.11 1.8.10 1.8.9 1.8.6 1.8.7 1.8.8 trunk 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 All 37 releases
← All changes | admin/helpers/src/report/loader.php +14 -4 1.7.2 → 1.8.16 View file →
@@ -123,11 +123,21 @@
123 123 unset($report_files[$k]);
124 124 continue;
125 125 }
126 126
127 + // instantiate the report object
128 + $reportInstance = new $classname;
129 +
130 + // ensure the report is compatible with the current environment
131 + if ($reportInstance->preflight() === false) {
132 + // exclude non-compatible report
133 + unset($report_files[$k]);
134 + continue;
135 + }
136 +
127 137 if ($report_file == 'revenue' && $this->global_reports) {
128 138 // make the "revenue" the first element of the list
129 - array_unshift($this->global_reports, new $classname);
139 + array_unshift($this->global_reports, $reportInstance);
130 140 } elseif (strpos($report_file, 'istat') !== false || strpos($report_file, 'polizia') !== false) {
131 141 // this is a country (italy) specific report so we push it to a separate array
132 142 $country_key = 'IT';
133 143 if (!isset($this->country_reports[$country_key])) {
@@ -132,9 +142,9 @@
132 142 $country_key = 'IT';
133 143 if (!isset($this->country_reports[$country_key])) {
134 144 $this->country_reports[$country_key] = [];
135 145 }
136 - $this->country_reports[$country_key][] = new $classname;
146 + $this->country_reports[$country_key][] = $reportInstance;
137 147 } elseif (substr($report_file, 2, 1) == '_') {
138 148 // this is probably a country specific report so we push it to a separate array (two-letter country code + underscore in file name)
139 149 $country_key = strtoupper(substr($report_file, 0, 2));
140 150 if (!isset($this->country_reports[$country_key])) {
@@ -139,12 +149,12 @@
139 149 $country_key = strtoupper(substr($report_file, 0, 2));
140 150 if (!isset($this->country_reports[$country_key])) {
141 151 $this->country_reports[$country_key] = [];
142 152 }
143 - $this->country_reports[$country_key][] = new $classname;
153 + $this->country_reports[$country_key][] = $reportInstance;
144 154 } else {
145 155 // push this object as a global report
146 - $this->global_reports[] = new $classname;
156 + $this->global_reports[] = $reportInstance;
147 157 }
148 158 }
149 159
150 160 // get countries information for the reports