diff --git a/admin/themes/default/template/form_date_range_picker.tpl b/admin/themes/default/template/form_date_range_picker.tpl index 7334aa52b..54b17b4cb 100644 --- a/admin/themes/default/template/form_date_range_picker.tpl +++ b/admin/themes/default/template/form_date_range_picker.tpl @@ -51,8 +51,7 @@ let dateTo = $('form#calendar_form .datepicker#datepickerTo').val().trim(); if (dateFrom >= dateTo) { - let dateFromSplit = dateFrom.split('-'); - let objDateFrom = new Date(dateFromSplit[0], dateFromSplit[1] - 1, dateFromSplit[2]); + let objDateFrom = $.datepicker.parseDate('yy-mm-dd', dateFrom); let objDateToMin = objDateFrom; objDateToMin.setDate(objDateToMin.getDate() + 1); @@ -71,8 +70,7 @@ let dateFrom = $('form#calendar_form .datepicker#datepickerFrom').val().trim(); if (typeof dateFrom != 'undefined' && dateFrom != '') { - let dateFromSplit = dateFrom.split('-'); - let objDateFrom = new Date(dateFromSplit[0], dateFromSplit[1] - 1, dateFromSplit[2]); + let objDateFrom = $.datepicker.parseDate('yy-mm-dd', dateFrom); let objDateToMin = objDateFrom; objDateToMin.setDate(objDateToMin.getDate() + 1); diff --git a/js/jquery/plugins/connections/LICENSE.txt b/js/jquery/plugins/connections/LICENSE.txt new file mode 100644 index 000000000..eb0230470 --- /dev/null +++ b/js/jquery/plugins/connections/LICENSE.txt @@ -0,0 +1,20 @@ +Copyright (c) David Császár (Diamond/Musclesoft Crew) + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/js/jquery/plugins/connections/index.php b/js/jquery/plugins/connections/index.php new file mode 100644 index 000000000..5d9e49caf --- /dev/null +++ b/js/jquery/plugins/connections/index.php @@ -0,0 +1,29 @@ +_totalCount = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT FOUND_ROWS()'); foreach ($values as &$value) { - $value['hotel_name'] = ''.$value['hotel_name'].''; + if (Tools::getValue('export') == false) { + $value['hotel_name'] = ''.$value['hotel_name'].''; + } $value['totalMargin'] = 0; if (((float) $value['totalRevenue']) > 0 && ((float) $value['totalOperatingCost']) > 0) { diff --git a/modules/statsbestcustomers/statsbestcustomers.php b/modules/statsbestcustomers/statsbestcustomers.php index 944d5f333..f62a7b98a 100644 --- a/modules/statsbestcustomers/statsbestcustomers.php +++ b/modules/statsbestcustomers/statsbestcustomers.php @@ -190,7 +190,9 @@ class StatsBestCustomers extends ModuleGrid $this->_totalCount = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT FOUND_ROWS()'); foreach ($values as &$value) { - $value['email'] = ''.$value['email'].''; + if (Tools::getValue('export') == false) { + $value['email'] = ''.$value['email'].''; + } $value['totalMoneySpent'] = Tools::displayPrice($value['totalMoneySpent'], $currency); } diff --git a/modules/statsbestproducts/statsbestproducts.php b/modules/statsbestproducts/statsbestproducts.php index 52135343f..04dfe49ff 100644 --- a/modules/statsbestproducts/statsbestproducts.php +++ b/modules/statsbestproducts/statsbestproducts.php @@ -157,8 +157,8 @@ class StatsBestProducts extends ModuleGrid $array_date_between = explode(' AND ', $date_between); $id_lang = $this->getLang(); - $this->query = 'SELECT p.`id_product`, pl.`name` AS room_type_name, - p.`active`, hrt.`id_hotel`, hbil.`hotel_name`, + $this->query = 'SELECT p.`id_product`, pl.`name` AS roomTypeName, + p.`active`, hrt.`id_hotel`, hbil.`hotel_name` AS hotelName, ( SELECT IFNULL(SUM(DATEDIFF(LEAST(hbd.`date_to`, "'.pSQL($date_to).'"), GREATEST(hbd.`date_from`, "'.pSQL($date_from).'"))), 0) FROM `'._DB_PREFIX_.'htl_booking_detail` hbd @@ -224,8 +224,10 @@ class StatsBestProducts extends ModuleGrid $objHotelBookingDetail = new HotelBookingDetail(); $numberOfDays = $objHotelBookingDetail->getNumberOfDays($date_from, $date_to); foreach ($values as &$value) { - $value['roomTypeName'] = ''.$value['room_type_name'].''; - $value['hotelName'] = ''.$value['hotel_name'].''; + if (Tools::getValue('export') == false) { + $value['roomTypeName'] = ''.$value['roomTypeName'].''; + $value['hotelName'] = ''.$value['hotelName'].''; + } $value['totalRoomsBooked'] = (int) $value['totalRoomsBooked']; $value['availableRooms'] = max($value['totalRooms'] - $value['totalRoomsBooked'], 0); // availableRooms can be negative if more rooms are disabled than available for booking $value['bookingsPerDay'] = sprintf('%0.2f', ($numberOfDays ? $value['totalRoomsBooked'] / $numberOfDays : 0)); diff --git a/modules/statsbestvouchers/statsbestvouchers.php b/modules/statsbestvouchers/statsbestvouchers.php index b92d1a3fa..40681d1d7 100644 --- a/modules/statsbestvouchers/statsbestvouchers.php +++ b/modules/statsbestvouchers/statsbestvouchers.php @@ -144,8 +144,10 @@ class StatsBestVouchers extends ModuleGrid $values = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($this->query); $this->_totalCount = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT FOUND_ROWS()'); foreach ($values as &$value) { - $value['code'] = ''.$value['code'].''; - $value['name'] = ''.$value['name'].''; + if (Tools::getValue('export') == false) { + $value['code'] = ''.$value['code'].''; + $value['name'] = ''.$value['name'].''; + } $value['ca'] = Tools::displayPrice($value['ca'], $currency); } diff --git a/modules/statsproduct/statsproduct.php b/modules/statsproduct/statsproduct.php index 2774955ea..3c03159e0 100644 --- a/modules/statsproduct/statsproduct.php +++ b/modules/statsproduct/statsproduct.php @@ -380,9 +380,9 @@ class StatsProduct extends ModuleGraph break; case 42: - $this->_titles['main'][1] = $this->l('Reference'); - $this->_titles['main'][2] = $this->l('Name'); - $this->_titles['main'][3] = $this->l('Stock'); + $this->_titles['main'][0] = $this->l('ID'); + $this->_titles['main'][1] = $this->l('Room type name'); + $this->_titles['main'][2] = $this->l('Total Rooms'); break; } } @@ -403,9 +403,8 @@ class StatsProduct extends ModuleGraph if ($this->option == 42) { $products = $this->getProducts(); foreach ($products as $product) { - $this->_values[0][] = $product['reference']; - $this->_values[1][] = $product['name']; - $this->_values[2][] = $product['quantity']; + $this->_values[0][] = $product['name']; + $this->_values[1][] = $product['total_rooms']; $this->_legend[] = $product['id_product']; } } elseif ($this->option != 3) {