diff --git a/controllers/admin/AdminAddressesController.php b/controllers/admin/AdminAddressesController.php index afc8f587b..030df365a 100644 --- a/controllers/admin/AdminAddressesController.php +++ b/controllers/admin/AdminAddressesController.php @@ -380,6 +380,29 @@ class AdminAddressesControllerCore extends AdminController return parent::renderForm(); } + public function processExport($text_delimiter = '"') + { + $this->fields_list = array_merge($this->fields_list, array( + 'email' => array( + 'title' => $this->l('Customer Email') + ), + 'phone' => array( + 'title' => $this->l('Phone') + ), + 'phone_mobile' => array( + 'title' => $this->l('Mobile phone') + ), + 'dni' => array( + 'title' => $this->l('Identification Number') + ), + 'vat_number' => array( + 'title' => $this->l('VAT number') + ), + )); + + return parent::processExport($text_delimiter); + } + // public function postProcess() // { diff --git a/controllers/admin/AdminCustomersController.php b/controllers/admin/AdminCustomersController.php index 7ae9ee221..de3309327 100644 --- a/controllers/admin/AdminCustomersController.php +++ b/controllers/admin/AdminCustomersController.php @@ -157,7 +157,8 @@ class AdminCustomersControllerCore extends AdminController 'active' => 'status', 'type' => 'bool', 'orderby' => false, - 'filter_key' => 'a!active' + 'filter_key' => 'a!active', + 'callback' => 'formatStatusAsLabel', ), 'newsletter' => array( 'title' => $this->l('Newsletter'), @@ -242,6 +243,17 @@ class AdminCustomersControllerCore extends AdminController } } + public function formatStatusAsLabel($val, $row) + { + if ($val) { + $str_return = $this->l('Yes'); + } else { + $str_return = $this->l('No'); + } + + return $str_return; + } + public function getCustomerStatusLabel($deleted, $tr) { if ($deleted == Customer::STATUS_DELETED) { @@ -1061,6 +1073,14 @@ class AdminCustomersControllerCore extends AdminController } } + public function processExport($text_delimiter = '"') + { + $this->fields_list['newsletter']['callback'] = 'formatStatusAsLabel'; + $this->fields_list['optin']['callback'] = 'formatStatusAsLabel'; + + return parent::processExport($text_delimiter); + } + protected function processBulkDelete() { // If customer is going to be deleted permanently then if customer has orders the change this customer as an anonymous customer diff --git a/controllers/admin/AdminNormalProductsController.php b/controllers/admin/AdminNormalProductsController.php index b3f3b4c1a..a07fcc477 100644 --- a/controllers/admin/AdminNormalProductsController.php +++ b/controllers/admin/AdminNormalProductsController.php @@ -257,12 +257,14 @@ class AdminNormalProductsControllerCore extends AdminController 'title' => $this->l('Available for order'), 'filter_key' => 'a!available_for_order', 'type' => 'bool', + 'callback' => 'formatStatusAsLabel', ); $this->fields_list['price_addition_type'] = array( 'displayed' => false, 'title' => $this->l('Price display preference'), 'filter_key' => 'a!price_addition_type', 'type' => 'select', + 'callback' => 'getPriceDisplayPreference', 'list' => $priceAdditionType, ); $this->fields_list['price_calculation_method_txt'] = array( @@ -311,7 +313,8 @@ class AdminNormalProductsControllerCore extends AdminController 'title' => $this->l('Base price'), 'type' => 'price', 'align' => 'text-left', - 'filter_key' => 'a!price' + 'filter_key' => 'a!price', + 'callback' => 'displayPrice', ); $this->fields_list['price_final'] = array( 'title' => $this->l('Final price'), @@ -319,7 +322,8 @@ class AdminNormalProductsControllerCore extends AdminController 'align' => 'text-left', 'havingFilter' => true, 'orderby' => false, - 'search' => false + 'search' => false, + 'callback' => 'displayPrice', ); $this->fields_list['active'] = array( @@ -329,6 +333,7 @@ class AdminNormalProductsControllerCore extends AdminController 'align' => 'text-center', 'type' => 'bool', 'class' => 'fixed-width-sm', + 'callback' => 'formatStatusAsLabel', 'orderby' => false ); @@ -342,6 +347,34 @@ class AdminNormalProductsControllerCore extends AdminController } } + public function formatStatusAsLabel($val, $row) + { + if ($val) { + $str_return = $this->l('Yes'); + } else { + $str_return = $this->l('No'); + } + + return $str_return; + } + + public function getPriceDisplayPreference($val, $row) + { + $str_return = $val; + if ($val == Product::PRICE_ADDITION_TYPE_WITH_ROOM) { + $str_return = $this->l('Add price in room price'); + } else if ($val == Product::PRICE_ADDITION_TYPE_INDEPENDENT) { + $str_return = $this->l('Convenience Fee'); + } + + return $str_return; + } + + public static function displayPrice($basePrice, $tr) + { + return Tools::displayPrice($basePrice, (int) Configuration::get('PS_CURRENCY_DEFAULT')); + } + private function buildCategoryOptions($category) { $space = str_repeat(' ', 5 * (($category['level_depth'] - $this->objLocationsCategory->level_depth) - 1)); diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index cc04b2959..9e98fc7bc 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -219,7 +219,7 @@ class AdminProductsControllerCore extends AdminController if ($join_category) { $this->_join .= ' INNER JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_product` = a.`id_product` AND cp.`id_category` = '.(int)$this->_category->id.') '; - $this->_select .= ' , cp.`position`, '; + $this->_select .= ' , cp.`position` '; } // show the list of the product according to the booking or service products @@ -283,6 +283,13 @@ class AdminProductsControllerCore extends AdminController 'type' => 'range', 'align' => 'center', ); + $this->fields_list['max_guests'] = array( + 'title' => $this->l('Maximum Occupancy'), + 'filter_key' => 'hrt!max_guests', + 'type' => 'range', + 'align' => 'center', + 'optional' => true, + ); // use it for total rooms $this->fields_list['num_rooms'] = array( 'title' => $this->l('Total Rooms'), @@ -319,15 +326,6 @@ class AdminProductsControllerCore extends AdminController 'visible_default' => true, 'orderby' => false ); - - $this->fields_list['max_guests'] = array( - 'title' => $this->l('Maximum Occupancy'), - 'filter_key' => 'hrt!max_guests', - 'type' => 'range', - 'align' => 'center', - 'optional' => true, - ); - $this->fields_list['show_at_front'] = array( 'title' => $this->l('Show at front'), 'align' => 'text-center', @@ -453,6 +451,7 @@ class AdminProductsControllerCore extends AdminController ); } } + public function formatStatusAsLabel($val, $row) { if ($val) { @@ -464,7 +463,6 @@ class AdminProductsControllerCore extends AdminController return $str_return; } - private function buildCategoryOptions($category) { $space = str_repeat(' ', 5 * (($category['level_depth'] - $this->objLocationsCategory->level_depth) - 1)); @@ -669,6 +667,7 @@ class AdminProductsControllerCore extends AdminController ) ); + unset($this->fields_list['id_category_default']); unset($this->fields_list['id_global_demand']); unset($this->fields_list['id_feature']); unset($this->fields_list['id_service_product']); diff --git a/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRequestsController.php b/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRequestsController.php index 810b45eb5..54e87382a 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRequestsController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRequestsController.php @@ -196,8 +196,10 @@ class AdminOrderRefundRequestsController extends ModuleAdminController if ($this->action == 'export' && empty($this->_listsql)) { $this->_select .= ', GROUP_CONCAT(hbd.`room_num`) AS room_num, GROUP_CONCAT(DISTINCT(hbd.`room_type_name`)) AS room_type_name, hbd.`id`, a.`id_order_return`, hbd.`hotel_name`, GROUP_CONCAT(hbd.`date_from`) AS date_from, GROUP_CONCAT(hbd.`date_to`) AS date_to'; - $this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'order_return_detail` ordd ON (ordd.`id_order_return` = a.`id_order_return`)'; - $this->_join .= ' LEFT JOIN '._DB_PREFIX_.'htl_booking_detail hbd ON (hbd.`id` = ordd.`id_htl_booking`)'; + if (!Tools::getValue('id_order')) { + $this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'order_return_detail` ordrd ON (ordrd.`id_order_return` = a.`id_order_return`)'; + } + $this->_join .= ' LEFT JOIN '._DB_PREFIX_.'htl_booking_detail hbd ON (hbd.`id` = ordrd.`id_htl_booking`)'; $this->_group = ' GROUP BY a.`id_order_return`'; $this->fields_list = array_merge($this->fields_list, array( 'room_num' => array(