diff --git a/admin/themes/default/template/controllers/guest_registration/helpers/view/view.tpl b/admin/themes/default/template/controllers/guest_registration/helpers/view/view.tpl new file mode 100644 index 000000000..91b33e572 --- /dev/null +++ b/admin/themes/default/template/controllers/guest_registration/helpers/view/view.tpl @@ -0,0 +1,68 @@ +{** +* NOTICE OF LICENSE +* +* This source file is subject to the Open Software License version 3.0 +* that is bundled with this package in the file LICENSE.md +* It is also available through the world-wide-web at this URL: +* https://opensource.org/license/osl-3-0-php +* If you did not receive a copy of the license and are unable to +* obtain it through the world-wide-web, please send an email +* to support@qloapps.com so we can send you a copy immediately. +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade this module to a newer +* versions in the future. If you wish to customize this module for your needs +* please refer to https://store.webkul.com/customisation-guidelines for more information. +* +* @author Webkul IN +* @copyright Since 2010 Webkul +* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0 +*} + +
+
+ + {l s='Guest Registration Card Information'} +
+ +
+ + +
+ +
+ {$guest_reg_card_info_tree} +
+ +
+ + +
+
+ + diff --git a/modules/hotelreservationsystem/views/templates/admin/hotel_features/index.php b/admin/themes/default/template/controllers/guest_registration/index.php similarity index 82% rename from modules/hotelreservationsystem/views/templates/admin/hotel_features/index.php rename to admin/themes/default/template/controllers/guest_registration/index.php index 409280877..e7a621e6c 100644 --- a/modules/hotelreservationsystem/views/templates/admin/hotel_features/index.php +++ b/admin/themes/default/template/controllers/guest_registration/index.php @@ -2,10 +2,10 @@ /** * NOTICE OF LICENSE * -* This source file is subject to the Open Software License version 3.0 +* This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with this package in the file LICENSE.md * It is also available through the world-wide-web at this URL: -* https://opensource.org/license/osl-3-0-php +* https://opensource.org/licenses/afl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to support@qloapps.com so we can send you a copy immediately. @@ -18,7 +18,7 @@ * * @author Webkul IN * @copyright Since 2010 Webkul -* @license https://opensource.org/license/osl-3-0-php Open Software License version 3.0 +* @license https://opensource.org/licenses/afl-3.0.php Academic Free License 3.0 */ header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); @@ -29,4 +29,4 @@ header('Cache-Control: post-check=0, pre-check=0', false); header('Pragma: no-cache'); header('Location: ../../../'); -exit; +exit; \ No newline at end of file diff --git a/admin/themes/default/template/controllers/orders/_current_cart_details_data.tpl b/admin/themes/default/template/controllers/orders/_current_cart_details_data.tpl index 083021418..699ccfb1c 100644 --- a/admin/themes/default/template/controllers/orders/_current_cart_details_data.tpl +++ b/admin/themes/default/template/controllers/orders/_current_cart_details_data.tpl @@ -124,8 +124,15 @@ {/if} {assign var=shown_room_type_price value=$data.feature_price_tax_excl} + {if isset($can_edit_booking_carts)} + {assign var=can_edit_booking_cart_price value=$can_edit_booking_carts} + {elseif isset($can_edit)} + {assign var=can_edit_booking_cart_price value=$can_edit} + {else} + {assign var=can_edit_booking_cart_price value=0} + {/if}
- + {$currency->prefix}{$currency->suffix}
diff --git a/admin/themes/default/template/controllers/orders/_product_line.tpl b/admin/themes/default/template/controllers/orders/_product_line.tpl index 993f9915a..9a88614e6 100644 --- a/admin/themes/default/template/controllers/orders/_product_line.tpl +++ b/admin/themes/default/template/controllers/orders/_product_line.tpl @@ -179,6 +179,11 @@ {if $data.num_checkin_documents > 0}{$data.num_checkin_documents}{else}0{/if} +
  • + + {l s='GRC'} + +
  • diff --git a/admin/themes/default/template/controllers/orders/form.tpl b/admin/themes/default/template/controllers/orders/form.tpl index 432afef40..383aa2343 100644 --- a/admin/themes/default/template/controllers/orders/form.tpl +++ b/admin/themes/default/template/controllers/orders/form.tpl @@ -27,6 +27,8 @@ var id_cart = {$cart->id|intval}; {/if} var id_customer = 0; + var can_edit_booking_carts = {if isset($can_edit_booking_carts) && $can_edit_booking_carts}true{else}false{/if}; + var can_add_addresses = {if isset($can_add_addresses) && $can_add_addresses}true{else}false{/if}; var admin_order_tab_link = "{$link->getAdminLink('AdminOrders')|addslashes}"; var changed_shipping_price = false; var shipping_price_selected_carrier = ''; @@ -620,6 +622,10 @@ $(booking_occupancy_wrapper).siblings('.booking_guest_occupancy').find('span').text(guestButtonVal); } {/literal} + + if (!can_edit_booking_carts || !can_add_addresses) { + $('#address_part').hide(); + } }); function resetBind() @@ -953,7 +959,9 @@ {if isset($cart->id) && $cart->id} id_cart = "{$cart->id}"; {/if} - $('#new_address').attr('href', address_link.replace(/id_customer=[0-9]+/, 'id_customer='+id_customer)); + if (address_link) { + $('#new_address').attr('href', address_link.replace(/id_customer=[0-9]+/, 'id_customer='+id_customer)); + } $.ajax({ type:"POST", url : "{$link->getAdminLink('AdminCarts')|addslashes}", @@ -1505,13 +1513,20 @@ if (addresses.length == 0) { $('#address_delivery, #address_invoice').hide(); - $("#new_address").show(); + if (can_edit_booking_carts && can_add_addresses) { + $('#address_part').show(); + $("#new_address").show(); + } else { + $('#address_part').hide(); + } } else { $('#addresses_err').hide(); $("#new_address").hide(); $('#address_delivery, #address_invoice').show(); + $('#address_part').show(); + $('#address_part .panel-heading').show(); } $('#id_address_delivery').html(addresses_delivery_options).hide(); @@ -1894,13 +1909,15 @@ -
    - {l s='Or'}  - - - {l s='Add new customer'} - -
    + {if isset($can_edit_booking_carts) && $can_edit_booking_carts && isset($can_add_customers) && $can_add_customers} +
    + {l s='Or'}  + + + {l s='Add new customer'} + +
    + {/if} @@ -1918,7 +1935,7 @@ Details @@ -2127,13 +2144,15 @@ -
    - {l s='Or'}  - - - {l s='Add new voucher'} - -
    + {if isset($can_edit_booking_carts) && $can_edit_booking_carts && isset($can_add_vouchers) && $can_add_vouchers} +
    + {l s='Or'}  + + + {l s='Add new voucher'} + +
    + {/if} @@ -2155,7 +2174,7 @@
    -
    +
    {l s='Addresses'}
    @@ -2189,6 +2208,7 @@
    + {if isset($can_edit_booking_carts) && $can_edit_booking_carts && isset($can_add_addresses) && $can_add_addresses}
    + {/if} {/if} -
    - -
    - -
    -
    - {*
    diff --git a/classes/Address.php b/classes/Address.php index b6b69905b..5e11c50c1 100644 --- a/classes/Address.php +++ b/classes/Address.php @@ -543,14 +543,14 @@ class AddressCore extends ObjectModel LEFT JOIN `'._DB_PREFIX_.'state` s ON s.`id_country` = cl.`id_country` AND s.`id_state` = a.`id_state` WHERE id_customer > 0 AND a.`deleted` = 0 AND - (a.`address1` LIKE \'%'.$query.'%\' OR - a.`postcode` LIKE \'%'.$query.'%\' OR - a.`city` LIKE \'%'.$query.'%\' OR - a.`phone` LIKE \'%'.$query.'%\' OR - a.`company` LIKE \'%'.$query.'%\' OR - a.`alias` LIKE \'%'.$query.'%\' OR - s.`name` LIKE \'%'.$query.'%\' OR - cl.`name` LIKE \'%'.$query.'%\' + (a.`address1` LIKE \'%'.pSQL($query).'%\' OR + a.`postcode` LIKE \'%'.pSQL($query).'%\' OR + a.`city` LIKE \'%'.pSQL($query).'%\' OR + a.`phone` LIKE \'%'.pSQL($query).'%\' OR + a.`company` LIKE \'%'.pSQL($query).'%\' OR + a.`alias` LIKE \'%'.pSQL($query).'%\' OR + s.`name` LIKE \'%'.pSQL($query).'%\' OR + cl.`name` LIKE \'%'.pSQL($query).'%\' ) '); } diff --git a/classes/CustomerMessage.php b/classes/CustomerMessage.php index 21798c993..db0dddded 100644 --- a/classes/CustomerMessage.php +++ b/classes/CustomerMessage.php @@ -146,7 +146,7 @@ class CustomerMessageCore extends ObjectModel ON (ct.`id_customer_thread` = cm.`id_customer_thread`) LEFT JOIN '._DB_PREFIX_.'customer c ON (IFNULL(ct.`id_customer`, ct.`email`) = IFNULL(c.`id_customer`, c.`email`)) - WHERE `message` LIKE \'%'.$query.'%\' + WHERE `message` LIKE \'%'.pSQL($query).'%\' '); } diff --git a/classes/PaymentModule.php b/classes/PaymentModule.php index 22cff5476..4eae04959 100644 --- a/classes/PaymentModule.php +++ b/classes/PaymentModule.php @@ -678,8 +678,14 @@ abstract class PaymentModuleCore extends Module $orderTotals[$order->id]['excl'] -= $used['excl']; $cart_rules[$key]['remaining'] -= $used['excl']; } - - $order->addCartRule($cart_rule['obj']->id, $cart_rule['obj']->name, $values, 0, $cart_rule['obj']->free_shipping); + + $order->addCartRule( + $cart_rule['obj']->id, + $cart_rule['obj']->name, + array('tax_incl' => $used['incl'], 'tax_excl' => $used['excl']), + 0, + $cart_rule['obj']->free_shipping + ); if ($id_order_state != Configuration::get('PS_OS_ERROR') && $id_order_state != Configuration::get('PS_OS_CANCELED') && !in_array($cart_rule['obj']->id, $cart_rule_used)) { $cart_rule_used[] = $cart_rule['obj']->id; @@ -692,7 +698,7 @@ abstract class PaymentModuleCore extends Module $cart_rules_list[] = array( 'voucher_name' => $cart_rule['obj']->name, - 'voucher_reduction' => ($values['tax_incl'] != 0.00 ? '-' : '').Tools::displayPrice($values['tax_incl'], $this->context->currency, false) + 'voucher_reduction' => ($used['incl'] != 0.00 ? '-' : '').Tools::displayPrice($used['incl'], $this->context->currency, false) ); } diff --git a/classes/Product.php b/classes/Product.php index 10301fd86..31b035c0a 100644 --- a/classes/Product.php +++ b/classes/Product.php @@ -1077,9 +1077,6 @@ class ProductCore extends ObjectModel if (!$this->deleteServiceInfo()) { return false; } - } else { - $objHotelRoomTypeBedType = new HotelRoomTypeBedType(); - $objHotelRoomTypeBedType->deleteRoomTypeBedTypes(false, $this->id); } Hook::exec('actionProductDelete', array('id_product' => (int)$this->id, 'product' => $this)); @@ -1087,6 +1084,7 @@ class ProductCore extends ObjectModel !GroupReduction::deleteProductReduction($this->id) || !$this->deleteCategories(true) || !$this->deleteProductFeatures() || + !HotelRoomTypeAmenities::deleteByProduct((int)$this->id) || !$this->deleteTags() || !$this->deleteAttributesImpacts() || !$this->deleteAttachments(false) || @@ -6949,4 +6947,55 @@ class ProductCore extends ObjectModel return $price; } + + /** + * Prepare grouped core features and values for a room type, with selection state. + * + * @param int $idProduct + * @param int $idLang defaults to current context language + * @return array + */ + public static function getRoomTypeFeatureTreeData($idProduct, $idLang = 0) + { + if (!$idLang) { + $idLang = Context::getContext()->language->id; + } + + $product = new self((int) $idProduct); + $features = Feature::getFeatures( + $idLang, + (Shop::isFeatureActive() && Shop::getContext() == Shop::CONTEXT_SHOP) + ); + $selectedFeatureValues = array(); + foreach ($product->getFeatures() as $productFeature) { + $selectedFeatureValues[(int) $productFeature['id_feature']][] = (int) $productFeature['id_feature_value']; + } + + foreach ($features as &$feature) { + $featureValues = FeatureValue::getFeatureValuesWithLang( + $idLang, + (int) $feature['id_feature'] + ); + $feature['value'] = (int) $feature['id_feature']; + $feature['input_name'] = 'feature_value_parents'; + $feature['children'] = array(); + $selectedValues = isset($selectedFeatureValues[(int) $feature['id_feature']]) + ? $selectedFeatureValues[(int) $feature['id_feature']] + : array(); + + foreach ($featureValues as $featureValue) { + $featureValue['name'] = $featureValue['value']; + $featureValue['value'] = (int) $featureValue['id_feature_value']; + $featureValue['input_name'] = 'feature_values['.(int) $feature['id_feature'].']'; + $featureValue['selected'] = in_array((int) $featureValue['id_feature_value'], $selectedValues); + $feature['children'][] = $featureValue; + } + + if ($feature['children'] && count($selectedValues) === count($feature['children'])) { + $feature['selected'] = true; + } + } + + return $features; + } } diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index 9166f1750..2b6636eef 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -1211,10 +1211,25 @@ class AdminControllerCore extends Controller if (ob_get_level() && ob_get_length() > 0) { ob_clean(); } + $fields_to_export = array(); + if((int)Configuration::get('PS_EXPORT_FIELDS_TYPE') === HelperList::QLO_EXPORT_FIELDS_SELECTED){ + $list_visibility = json_decode($this->context->cookie->{'list_visibility_'.$this->context->controller->controller_name}); + foreach ($this->fields_list as $key => $field) { + if ((!isset($field['displayed']) || $field['displayed']) + && (empty($field['optional']) + || (!is_array($list_visibility) && !empty($field['visible_default'])) + || (is_array($list_visibility) && in_array($key, $list_visibility)) + )) { + $fields_to_export[$key] = $field; + } + } + } + $this->getList($this->context->language->id, null, null, 0, false); if (!count($this->_list)) { return; } + $fields_to_export = (int)Configuration::get('PS_EXPORT_FIELDS_TYPE') === HelperList::QLO_EXPORT_FIELDS_SELECTED ? $fields_to_export : $this->fields_list; header('Content-type: text/csv'); header('Content-Type: application/force-download; charset=UTF-8'); @@ -1223,9 +1238,9 @@ class AdminControllerCore extends Controller $fd = fopen('php://output', 'wb'); $headers = array(); - foreach ($this->fields_list as $key => $datas) { + foreach ($fields_to_export as $key => $datas) { if ('PDF' === $datas['title']) { - unset($this->fields_list[$key]); + unset($fields_to_export[$key]); } else { if ('ID' === $datas['title']) { $headers[] = strtolower(Tools::htmlentitiesDecodeUTF8($datas['title'])); @@ -1239,7 +1254,7 @@ class AdminControllerCore extends Controller foreach ($this->_list as $i => $row) { $content = array(); $path_to_image = false; - foreach ($this->fields_list as $key => $params) { + foreach ($fields_to_export as $key => $params) { $field_value = isset($row[$key]) ? Tools::htmlentitiesDecodeUTF8(Tools::nl2br($row[$key])) : ''; if ($key == 'image') { if ($params['image'] != 'p' || Configuration::get('PS_LEGACY_IMAGES')) { diff --git a/classes/helper/HelperList.php b/classes/helper/HelperList.php index 5e0a4e76f..b5fbd344b 100644 --- a/classes/helper/HelperList.php +++ b/classes/helper/HelperList.php @@ -29,6 +29,8 @@ */ class HelperListCore extends Helper { + const QLO_EXPORT_FIELDS_ALL = 0; + const QLO_EXPORT_FIELDS_SELECTED = 1; /** * @var int|null */ diff --git a/classes/pdf/HTMLTemplateGuestRegistrationForm.php b/classes/pdf/HTMLTemplateGuestRegistrationForm.php new file mode 100644 index 000000000..c5905f6dd --- /dev/null +++ b/classes/pdf/HTMLTemplateGuestRegistrationForm.php @@ -0,0 +1,292 @@ +hotelBookingDetail = new HotelBookingDetail((int)$idHotelBookingDetail); + $this->order = new Order((int)$this->hotelBookingDetail->id_order); + $this->smarty = $smarty; + $this->date = Tools::displayDate($this->order->date_add); + $this->title = $this->order->getUniqReference(); + $this->shop = new Shop((int)$this->order->id_shop); + } + + /** + * Returns the template's HTML header + * + * @return string HTML header + */ + public function getHeader() + { + $this->assignCommonHeaderData(); + $this->smarty->assign(array('header' => HTMLTemplateGuestRegistrationForm::l('Guest Registration Card'))); + + return $this->smarty->fetch($this->getTemplate('header')); + } + + /** + * Returns the template's HTML content + * + * @return string HTML content + */ + public function getContent() + { + $idLang = (int)$this->order->id_lang; + $objHotelBookingDetail = $this->hotelBookingDetail; + $idHotel = (int)$objHotelBookingDetail->id_hotel; + + $objHotelBranchInformation = null; + $hotelCountry = ''; + + if ($idHotel) { + $objHotelBranchInformation = new HotelBranchInformation($idHotel, $idLang); + if (Validate::isLoadedObject($objHotelBranchInformation)) { + if ($objHotelBranchInformation->id_country) { + $objCountry = new Country((int)$objHotelBranchInformation->id_country, $idLang); + if (Validate::isLoadedObject($objCountry)) { + $hotelCountry = (string)$objCountry->name; + } + } + } else { + $objHotelBranchInformation = null; + } + } + + $ratePerNight = ''; + $arrivalDateTime = ''; + $departureDateTime = ''; + + if (Validate::isLoadedObject($objHotelBookingDetail)) { + $nights = (int)HotelHelper::getNumberOfDays($objHotelBookingDetail->date_from, $objHotelBookingDetail->date_to); + if ($nights > 0) { + $currency = new Currency((int)$this->order->id_currency); + $ratePerNight = Tools::displayPrice((float)$objHotelBookingDetail->total_price_tax_incl / $nights, $currency, false); + } + $arrivalDateTime = $objHotelBookingDetail->date_from ? Tools::displayDate($objHotelBookingDetail->date_from) : ''; + $departureDateTime = $objHotelBookingDetail->date_to ? Tools::displayDate($objHotelBookingDetail->date_to) : ''; + if ($arrivalDateTime && $objHotelBranchInformation && $objHotelBranchInformation->check_in && $objHotelBranchInformation->check_in != '00:00:00') { + $arrivalDateTime .= ' '.date('h:i a', strtotime($objHotelBranchInformation->check_in)); + } + if ($departureDateTime && $objHotelBranchInformation && $objHotelBranchInformation->check_out && $objHotelBranchInformation->check_out != '00:00:00') { + $departureDateTime .= ' '.date('h:i a', strtotime($objHotelBranchInformation->check_out)); + } + } + + $additionalGuestsRows = 0; + if (Validate::isLoadedObject($objHotelBookingDetail)) { + $totalGuests = (int)$objHotelBookingDetail->adults + (int)$objHotelBookingDetail->children; + $additionalGuestsRows = ($totalGuests > 1) ? ($totalGuests - 1) : 0; + } + + // Build saved config: [sectionId => [fieldId => true, ...]] + $grcFields = array(); + $grcInfoJson = Configuration::get('QLO_GUEST_REGISTRATION_CARD_INFO'); + if ($grcInfoJson !== false && $grcInfoJson !== '') { + $grcData = Tools::jsonDecode($grcInfoJson, true); + if (is_array($grcData)) { + foreach ($grcData as $sectionId => $fieldIds) { + $fieldIds = array_map('intval', (array)$fieldIds); + if (!empty($fieldIds)) { + $grcFields[(int)$sectionId] = array_flip($fieldIds); + } + } + } + } + + // When nothing saved, show all sections and fields + $allVisible = empty($grcFields); + + // One pass: build false|string label for every field directly. + // false = hidden, non-empty string = visible (used for both visibility check and label text in template). + $grcInfo = $this->hotelBookingDetail->getRegistrationCardInfo(); + $fieldLabels = array(); + foreach ($grcInfo as $sectionId => $section) { + $isSectionEnabled = $allVisible || isset($grcFields[$sectionId]); + $fieldLabels[$sectionId] = array(); + foreach ($section['fields'] as $fieldId => $fieldLabel) { + $isVisible = $isSectionEnabled && ($allVisible || isset($grcFields[$sectionId][$fieldId])); + $fieldLabels[$sectionId][$fieldId] = $isVisible ? $fieldLabel : false; + } + } + + $section1 = HotelBookingDetail::GRC_SECTION_GUEST_INFO; + $section2 = HotelBookingDetail::GRC_SECTION_TRAVEL_INFO; + $section3 = HotelBookingDetail::GRC_SECTION_BOOKING_INFO; + $section4 = HotelBookingDetail::GRC_SECTION_IDENTIFICATION; + $section5 = HotelBookingDetail::GRC_SECTION_ADDITIONAL_GUESTS; + $section6 = HotelBookingDetail::GRC_SECTION_BILLING_CORPORATE; + $section7 = HotelBookingDetail::GRC_SECTION_PAYMENT_DEPOSIT; + $section8 = HotelBookingDetail::GRC_SECTION_GUEST_SIGNATURE; + $section9 = HotelBookingDetail::GRC_SECTION_PROPERTY_REGS; + $section10 = HotelBookingDetail::GRC_SECTION_OFFICE_USE_ONLY; + + // $labels: false = field hidden, label string = field visible. + // Template uses {if $labels.key} for visibility AND {$labels.key} for label — no separate boolean assigns. + $labels = array( + // Section 1: Guest Information + 'title' => $fieldLabels[$section1][HotelBookingDetail::GRC_GUEST_TITLE], + 'full_name' => $fieldLabels[$section1][HotelBookingDetail::GRC_GUEST_FULL_NAME], + 'phone' => $fieldLabels[$section1][HotelBookingDetail::GRC_GUEST_PHONE], + 'email' => $fieldLabels[$section1][HotelBookingDetail::GRC_GUEST_EMAIL], + 'dob' => $fieldLabels[$section1][HotelBookingDetail::GRC_GUEST_DOB], + 'nationality' => $fieldLabels[$section1][HotelBookingDetail::GRC_GUEST_NATIONALITY], + 'city_country' => $fieldLabels[$section1][HotelBookingDetail::GRC_GUEST_CITY_COUNTRY], + 'postal_code' => $fieldLabels[$section1][HotelBookingDetail::GRC_GUEST_POSTAL_CODE], + 'address' => $fieldLabels[$section1][HotelBookingDetail::GRC_GUEST_ADDRESS], + + // Section 2: Travel Information + 'arrived_from' => $fieldLabels[$section2][HotelBookingDetail::GRC_TRAVEL_ARRIVED_FROM], + 'next_dest' => $fieldLabels[$section2][HotelBookingDetail::GRC_TRAVEL_NEXT_DESTINATION], + 'flight' => $fieldLabels[$section2][HotelBookingDetail::GRC_TRAVEL_FLIGHT_TRAIN], + 'vehicle' => $fieldLabels[$section2][HotelBookingDetail::GRC_TRAVEL_VEHICLE_REG], + 'purpose' => $fieldLabels[$section2][HotelBookingDetail::GRC_TRAVEL_PURPOSE_OF_VISIT], + + // Section 3: Booking Information + 'booking_ref' => $fieldLabels[$section3][HotelBookingDetail::GRC_BOOKING_REFERENCE], + 'booking_rate' => $fieldLabels[$section3][HotelBookingDetail::GRC_BOOKING_RATE_PER_NIGHT], + 'booking_arrival' => $fieldLabels[$section3][HotelBookingDetail::GRC_BOOKING_ARRIVAL], + 'booking_departure' => $fieldLabels[$section3][HotelBookingDetail::GRC_BOOKING_DEPARTURE], + 'booking_room_type' => $fieldLabels[$section3][HotelBookingDetail::GRC_BOOKING_ROOM_TYPE], + 'booking_room_number' => $fieldLabels[$section3][HotelBookingDetail::GRC_BOOKING_ROOM_NUMBER], + 'num_guests' => $fieldLabels[$section3][HotelBookingDetail::GRC_BOOKING_NUM_GUESTS], + + // Section 4: Identification Document + 'id_proof' => $fieldLabels[$section4][HotelBookingDetail::GRC_ID_IDENTITY_PROOF], + 'id_number' => $fieldLabels[$section4][HotelBookingDetail::GRC_ID_NUMBER], + 'passport' => $fieldLabels[$section4][HotelBookingDetail::GRC_ID_PASSPORT_NO], + 'place_of_issue' => $fieldLabels[$section4][HotelBookingDetail::GRC_ID_PLACE_OF_ISSUE], + 'date_of_issue' => $fieldLabels[$section4][HotelBookingDetail::GRC_ID_DATE_OF_ISSUE], + 'date_of_expiry' => $fieldLabels[$section4][HotelBookingDetail::GRC_ID_DATE_OF_EXPIRY], + 'visa' => $fieldLabels[$section4][HotelBookingDetail::GRC_ID_VISA_NUMBER], + 'valid_until' => $fieldLabels[$section4][HotelBookingDetail::GRC_ID_VALID_UNTIL], + 'arrival_in_country' => $fieldLabels[$section4][HotelBookingDetail::GRC_ID_ARRIVAL_DATE_IN_COUNTRY], + + // Section 5: Additional Guests + 'addguest_name' => $fieldLabels[$section5][HotelBookingDetail::GRC_ADD_GUEST_NAME], + 'addguest_id_type' => $fieldLabels[$section5][HotelBookingDetail::GRC_ADD_GUEST_ID_TYPE], + 'addguest_id_number' => $fieldLabels[$section5][HotelBookingDetail::GRC_ADD_GUEST_ID_NUMBER], + 'addguest_nationality' => $fieldLabels[$section5][HotelBookingDetail::GRC_ADD_GUEST_NATIONALITY], + + // Section 6: Billing & Corporate + 'company' => $fieldLabels[$section6][HotelBookingDetail::GRC_BILLING_COMPANY], + 'tax_id' => $fieldLabels[$section6][HotelBookingDetail::GRC_BILLING_TAX_ID], + + // Section 7: Payment & Deposit + 'payment_method' => $fieldLabels[$section7][HotelBookingDetail::GRC_PAYMENT_METHOD], + 'card_number' => $fieldLabels[$section7][HotelBookingDetail::GRC_PAYMENT_CARD_NUMBER], + 'security_deposit' => $fieldLabels[$section7][HotelBookingDetail::GRC_PAYMENT_SECURITY_DEPOSIT], + + // Section 8: Guest Signature + 'signature' => $fieldLabels[$section8][HotelBookingDetail::GRC_SIG_SIGNATURE], + 'sig_date' => $fieldLabels[$section8][HotelBookingDetail::GRC_SIG_DATE], + + // Section 9: Property Regulations (checkin/checkout share one visibility flag; two separate PDF sub-labels) + 'checkin_time' => $fieldLabels[$section9][HotelBookingDetail::GRC_PROP_CHECKIN_CHECKOUT_TIME] ? 'Check-in Time' : false, + 'checkout_time' => $fieldLabels[$section9][HotelBookingDetail::GRC_PROP_CHECKIN_CHECKOUT_TIME] ? 'Check-out Time' : false, + 'hotel_policies' => $fieldLabels[$section9][HotelBookingDetail::GRC_PROP_HOTEL_POLICIES], + + // Section 10: For Office Use Only + 'staff_name' => $fieldLabels[$section10][HotelBookingDetail::GRC_OFFICE_STAFF_NAME], + 'office_checkin_time' => $fieldLabels[$section10][HotelBookingDetail::GRC_OFFICE_CHECKIN_TIME], + 'id_verified' => $fieldLabels[$section10][HotelBookingDetail::GRC_OFFICE_ID_VERIFIED], + 'reg_no' => $fieldLabels[$section10][HotelBookingDetail::GRC_OFFICE_REG_NO], + ); + + $showLocalIdGroup = (bool)$labels['id_proof'] || (bool)$labels['id_number']; + $showIntIdGroup = (bool)$labels['passport'] || (bool)$labels['place_of_issue'] || (bool)$labels['date_of_issue'] + || (bool)$labels['date_of_expiry'] || (bool)$labels['visa'] || (bool)$labels['valid_until'] + || (bool)$labels['arrival_in_country']; + + $this->smarty->assign(array( + 'style_tab' => $this->smarty->fetch($this->getTemplate('invoice.style-tab')), + 'hotel' => $objHotelBranchInformation, + 'hotel_country' => $hotelCountry, + 'booking_reference' => $this->order->getUniqReference(), + 'arrival_date_time' => $arrivalDateTime, + 'departure_date_time' => $departureDateTime, + 'room_type' => Validate::isLoadedObject($objHotelBookingDetail) ? $objHotelBookingDetail->room_type_name : '', + 'room_number' => Validate::isLoadedObject($objHotelBookingDetail) ? $objHotelBookingDetail->room_num : '', + 'adults' => Validate::isLoadedObject($objHotelBookingDetail) ? (int)$objHotelBookingDetail->adults : 0, + 'children' => Validate::isLoadedObject($objHotelBookingDetail) ? (int)$objHotelBookingDetail->children : 0, + 'rate_per_night' => $ratePerNight, + 'additional_guests_rows' => $additionalGuestsRows, + + // Section visibility + 'show_section_guest_info' => !empty(array_filter($fieldLabels[$section1])), + 'show_section_travel_info' => !empty(array_filter($fieldLabels[$section2])), + 'show_section_booking_info' => !empty(array_filter($fieldLabels[$section3])), + 'show_section_identification' => !empty(array_filter($fieldLabels[$section4])), + 'show_section_additional_guests' => !empty(array_filter($fieldLabels[$section5])), + 'show_section_billing_corporate' => !empty(array_filter($fieldLabels[$section6])), + 'show_section_payment_deposit' => !empty(array_filter($fieldLabels[$section7])), + 'show_section_guest_signature' => !empty(array_filter($fieldLabels[$section8])), + 'show_section_property_regs' => !empty(array_filter($fieldLabels[$section9])), + 'show_section_office_use' => !empty(array_filter($fieldLabels[$section10])), + + 'section_additional_guests' => $grcInfo[$section5]['name'], + 'section_property_regs' => $grcInfo[$section9]['name'], + + 'local_id' => $showLocalIdGroup, + 'int_id' => $showIntIdGroup, + 'labels' => $labels, + )); + + return $this->smarty->fetch($this->getTemplate('guest-registration-form')); + } + + /** + * Returns the template filename when using bulk rendering + * + * @return string filename + */ + public function getBulkFilename() + { + return 'guest-registration-forms.pdf'; + } + + /** + * Returns the template filename + * + * @return string filename + */ + public function getFilename() + { + $filename = 'guest-registration-form-'.$this->order->reference; + if ($this->hotelBookingDetail->id) { + $filename .= '-room-'.$this->hotelBookingDetail->id; + } + + return $filename.'.pdf'; + } +} diff --git a/classes/pdf/PDF.php b/classes/pdf/PDF.php index 69985fa7f..e6de69011 100644 --- a/classes/pdf/PDF.php +++ b/classes/pdf/PDF.php @@ -37,6 +37,7 @@ class PDFCore protected $smarty; const TEMPLATE_INVOICE = 'Invoice'; + const TEMPLATE_GUEST_REGISTRATION_FORM = 'GuestRegistrationForm'; const TEMPLATE_ORDER_RETURN = 'OrderReturn'; const TEMPLATE_ORDER_SLIP = 'OrderSlip'; const TEMPLATE_DELIVERY_SLIP = 'DeliverySlip'; diff --git a/controllers/admin/AdminAddressesController.php b/controllers/admin/AdminAddressesController.php index 551e9c207..82be1dc94 100644 --- a/controllers/admin/AdminAddressesController.php +++ b/controllers/admin/AdminAddressesController.php @@ -384,13 +384,13 @@ class AdminAddressesControllerCore extends AdminController 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'), 'filter_key' => 'a!phone'), - 'phone_mobile' => array('title' => $this->l('Mobile phone')), - 'address1' => array('title' => $this->l('Address (2)')), - 'dni' => array('title' => $this->l('Identification Number')), - 'vat_number' => array('title' => $this->l('VAT number')), - 'other' => array('title' => $this->l('Other')), + 'email' => array('title' => $this->l('Customer Email'), 'displayed' => false), + 'phone' => array('title' => $this->l('Phone'), 'filter_key' => 'a!phone', 'displayed' => false), + 'phone_mobile' => array('title' => $this->l('Mobile phone'), 'displayed' => false), + 'address2' => array('title' => $this->l('Address (2)'), 'displayed' => false), + 'dni' => array('title' => $this->l('Identification Number'), 'displayed' => false), + 'vat_number' => array('title' => $this->l('VAT number'), 'displayed' => false), + 'other' => array('title' => $this->l('Other'), 'displayed' => false), )); return parent::processExport($text_delimiter); diff --git a/controllers/admin/AdminCartsController.php b/controllers/admin/AdminCartsController.php index b72199d67..9a0bac0bc 100644 --- a/controllers/admin/AdminCartsController.php +++ b/controllers/admin/AdminCartsController.php @@ -695,6 +695,7 @@ class AdminCartsControllerCore extends AdminController 'cart_detail_data' => $cart_detail_data, 'cart' => $objCart, 'currency' => new Currency((int)$this->context->cart->id_currency), + 'can_edit_booking_carts' => ($this->tabAccess['edit'] === 1), 'occupancy_required_for_booking' => $occupancyRequiredForBooking, 'ajax' => true )); @@ -1265,7 +1266,8 @@ class AdminCartsControllerCore extends AdminController 'serviceProducts' => $serviceProducts, 'selectedRoomServiceProduct' => $selectedRoomServiceProduct, 'customServiceAllowed' => Configuration::get('PS_ALLOW_CREATE_CUSTOM_SERVICES_IN_BOOKING'), - 'loaderImg' => $this->context->link->getMediaLink(_PS_IMG_.'admin/ajax-loader.gif') + 'loaderImg' => $this->context->link->getMediaLink(_PS_IMG_.'admin/ajax-loader.gif'), + 'can_edit' => $this->tabAccess['edit'], )); $response['html_exta_demands'] = $this->context->smarty->fetch( @@ -1574,6 +1576,7 @@ class AdminCartsControllerCore extends AdminController 'serviceProducts' => $serviceProducts, 'selectedRoomServiceProduct' => $selectedRoomServiceProduct, 'customServiceAllowed' => Configuration::get('PS_ALLOW_CREATE_CUSTOM_SERVICES_IN_BOOKING'), + 'can_edit' => $this->tabAccess['edit'], )); $servicesTpl = $this->context->smarty->fetch( @@ -1589,7 +1592,9 @@ class AdminCartsControllerCore extends AdminController { $response = array('hasError' => false); // Check tab access is allowed to edit - if ($this->tabAccess['add'] === 1) { + $canAdd = ($this->tabAccess['add'] === 1); + $canEdit = ($this->tabAccess['edit'] === 1); + if ($canAdd || $canEdit) { $idCartBooking = Tools::getValue('id_hotel_cart_booking'); if (Validate::isLoadedObject($objHotelCartBookingData = new HotelCartBookingData($idCartBooking))) { $objCart = new Cart($objHotelCartBookingData->id_cart); @@ -1667,7 +1672,7 @@ class AdminCartsControllerCore extends AdminController ))) { $originalPrice = Product::getPriceStatic($idServiceProduct, false); // if price is different than the original service price then update the price - if ($operator == 'up' && $originalPrice != $unitPrice) { + if ($canEdit && $operator == 'up' && $originalPrice != $unitPrice) { if ($specificPriceInfo = SpecificPrice::getSpecificPrice( (int)$idServiceProduct, 0, diff --git a/controllers/admin/AdminCustomersController.php b/controllers/admin/AdminCustomersController.php index d1327461b..b013b3fe8 100644 --- a/controllers/admin/AdminCustomersController.php +++ b/controllers/admin/AdminCustomersController.php @@ -80,6 +80,9 @@ class AdminCustomersControllerCore extends AdminController $this->_join = 'LEFT JOIN '._DB_PREFIX_.'gender_lang gl ON (a.id_gender = gl.id_gender AND gl.id_lang = '.(int)$this->context->language->id.')'; $this->_join .= ' LEFT JOIN '._DB_PREFIX_.'group_lang grl ON (a.id_default_group = grl.id_group AND grl.id_lang = '.(int)$this->context->language->id.')'; $this->_join .= ' LEFT JOIN '._DB_PREFIX_.'orders o ON (a.id_customer = o.id_customer)'; + $this->_join .= ' LEFT JOIN '._DB_PREFIX_.'address ad ON (ad.id_customer = a.id_customer AND ad.deleted = 0)'; + $this->_join .= ' LEFT JOIN '._DB_PREFIX_.'state adstate ON (adstate.id_state = ad.id_state)'; + $this->_join .= ' LEFT JOIN '._DB_PREFIX_.'country_lang adcountry ON (adcountry.id_country = ad.id_country AND adcountry.id_lang = '.(int)$this->context->language->id.')'; $this->_group = 'GROUP BY a.`id_customer`'; $this->fields_list = array( @@ -119,6 +122,11 @@ class AdminCustomersControllerCore extends AdminController } $this->fields_list = array_merge($this->fields_list, array( + 'phone' => array( + 'title' => $this->l('Phone'), + 'filter_key' => 'a!phone', + 'visible_default' => true, + ), 'default_group_name' => array( 'title' => $this->l('Default Group'), 'optional' => true, @@ -144,11 +152,82 @@ class AdminCustomersControllerCore extends AdminController 'align' => 'text-right', 'badge_success' => true ), - 'phone' => array( - 'title' => $this->l('Phone'), - 'filter_key' => 'a!phone', + 'address_company' => array( + 'title' => $this->l('Company'), 'optional' => true, 'visible_default' => false, + 'havingFilter' => true, + 'orderby' => false, + ), + 'vat_number' => array( + 'title' => $this->l('VAT number'), + 'optional' => true, + 'visible_default' => false, + 'havingFilter' => true, + 'orderby' => false, + ), + 'address1' => array( + 'title' => $this->l('Address'), + 'optional' => true, + 'visible_default' => false, + 'search' => false, + 'orderby' => false, + ), + 'address2' => array( + 'title' => $this->l('Address (2)'), + 'optional' => true, + 'visible_default' => false, + 'search' => false, + 'orderby' => false, + ), + 'city' => array( + 'title' => $this->l('City'), + 'optional' => true, + 'visible_default' => false, + 'havingFilter' => true, + 'orderby' => false, + ), + 'state' => array( + 'title' => $this->l('State'), + 'optional' => true, + 'visible_default' => false, + 'havingFilter' => true, + 'orderby' => false, + ), + 'postcode' => array( + 'title' => $this->l('Zip/Postal Code'), + 'optional' => true, + 'visible_default' => false, + 'havingFilter' => true, + 'orderby' => false, + ), + 'country' => array( + 'title' => $this->l('Country'), + 'optional' => true, + 'visible_default' => false, + 'havingFilter' => true, + 'orderby' => false, + ), + 'address_phone' => array( + 'title' => $this->l('Home phone'), + 'optional' => true, + 'visible_default' => false, + 'havingFilter' => true, + 'orderby' => false, + ), + 'phone_mobile' => array( + 'title' => $this->l('Mobile phone'), + 'optional' => true, + 'visible_default' => false, + 'havingFilter' => true, + 'orderby' => false, + ), + 'dni' => array( + 'title' => $this->l('Identification Number'), + 'optional' => true, + 'visible_default' => false, + 'search' => false, + 'orderby' => false, ), 'active' => array( 'title' => $this->l('Enabled'), @@ -171,7 +250,9 @@ class AdminCustomersControllerCore extends AdminController 'align' => 'text-center', 'type' => 'bool', 'callback' => 'printOptinIcon', - 'orderby' => false + 'orderby' => false, + 'optional' => true, + 'visible_default' => false ), 'date_add' => array( 'title' => $this->l('Registration'), @@ -183,12 +264,15 @@ class AdminCustomersControllerCore extends AdminController 'title' => $this->l('Last visit'), 'type' => 'datetime', 'search' => false, - 'havingFilter' => true + 'havingFilter' => true, + 'optional' => true, + 'visible_default' => false, ), 'deleted' => array( 'title' => $this->l('Banned'), 'type' => 'bool', 'displayed' => false, + 'filter_key' => 'a!deleted', 'callback' => 'getCustomerStatusLabel', ), 'order_date' => array( @@ -211,7 +295,11 @@ class AdminCustomersControllerCore extends AdminController WHERE g.id_customer = a.id_customer ORDER BY c.date_add DESC LIMIT 1 - ) as connect'; + ) as connect, + ad.company as address_company, ad.vat_number, + ad.address1, ad.address2, ad.city, adstate.name as state, + ad.postcode, adcountry.name as country, ad.phone as address_phone, + ad.phone_mobile, ad.dni'; // Check if we can add a customer if (Shop::isFeatureActive() && (Shop::getContext() == Shop::CONTEXT_ALL || Shop::getContext() == Shop::CONTEXT_GROUP)) { diff --git a/controllers/admin/AdminFeaturesController.php b/controllers/admin/AdminFeaturesController.php index aa5d9c899..c90e51990 100644 --- a/controllers/admin/AdminFeaturesController.php +++ b/controllers/admin/AdminFeaturesController.php @@ -91,13 +91,22 @@ class AdminFeaturesControllerCore extends AdminController parent::__construct(); } + public function init() + { + parent::init(); + + if (($id = Tools::getValue('id_feature')) && Tools::getIsset('viewfeature')) { + self::$currentIndex .= '&id_feature='.(int)$id.'&viewfeature'; + } + } + /** * AdminController::renderList() override * @see AdminController::renderList() */ public function renderList() { - /*$this->addRowAction('view');*//*by webkul*/ + $this->addRowAction('view'); $this->addRowAction('edit'); $this->addRowAction('delete'); @@ -154,7 +163,6 @@ class AdminFeaturesControllerCore extends AdminController ); $this->_where = sprintf('AND `id_feature` = %d', (int)$id); - self::$currentIndex = self::$currentIndex.'&id_feature='.(int)$id.'&viewfeature'; $this->processFilter(); return parent::renderList(); } @@ -322,8 +330,14 @@ class AdminFeaturesControllerCore extends AdminController break; case 'view': - $bread_extended[] = $this->feature_name[$this->context->employee->id_lang]; - $this->addMetaTitle($bread_extended[count($bread_extended) - 1]); + if (!$this->feature_name && ($id = Tools::getValue('id_feature'))) { + $obj = new Feature((int)$id); + $this->feature_name = $obj->name; + } + if ($this->feature_name) { + $bread_extended[] = $this->feature_name[$this->context->employee->id_lang]; + $this->addMetaTitle($bread_extended[count($bread_extended) - 1]); + } break; case 'editFeatureValue': @@ -334,7 +348,7 @@ class AdminFeaturesControllerCore extends AdminController } if (Validate::isLoadedObject($obj = new FeatureValue((int)Tools::getValue('id_feature_value')))) { - $bread_extended[] = sprintf($this->l('Edit: %s'), $obj->value[$this->context->employee->id_lang]); + $bread_extended[] = sprintf($this->l('Edit: %s'), $obj->value[$this->context->employee->id_lang]); } } else { $bread_extended[] = $this->l('Edit Value'); @@ -549,13 +563,15 @@ class AdminFeaturesControllerCore extends AdminController { $object = parent::processAdd(); - if (Tools::isSubmit('submitAdd'.$this->table.'AndStay') && !count($this->errors)) { - if ($this->table == 'feature_value' && ($this->display == 'edit' || $this->display == 'add')) { - $this->redirect_after = self::$currentIndex.'&addfeature_value&id_feature='.(int)Tools::getValue('id_feature').'&token='.$this->token; + if ('feature_value' === $this->table && !count($this->errors)) { + if (Tools::isSubmit('submitAdd'.$this->table.'AndStay') && ($this->display == 'edit' || $this->display == 'add')) { + $this->redirect_after = self::$currentIndex.'&addfeature_value&id_feature='.(int)Tools::getValue('id_feature').'&conf=3&token='.$this->token; } else { - $this->redirect_after = self::$currentIndex.'&'.$this->identifier.'='.(int) $object->id.'&conf=3&update'.$this->table.'&token='.$this->token; + $this->redirect_after = self::$currentIndex.'&id_feature='.(int)Tools::getValue('id_feature').'&viewfeature&conf=3&token='.$this->token; } - } elseif (Tools::isSubmit('submitAdd'.$this->table.'AndStay') && count($this->errors) && $this->table == 'feature_value') { // enter only if feature is submitted + } elseif (Tools::isSubmit('submitAdd'.$this->table.'AndStay') && !count($this->errors)) { + $this->redirect_after = self::$currentIndex.'&'.$this->identifier.'='.(int) $object->id.'&conf=3&update'.$this->table.'&token='.$this->token; + } elseif (Tools::isSubmit('submitAdd'.$this->table.'AndStay') && count($this->errors) && 'feature_value' === $this->table) { // enter only if feature is submitted $this->display = 'editFeatureValue'; } @@ -570,8 +586,14 @@ class AdminFeaturesControllerCore extends AdminController { $object = parent::processUpdate(); - if (Tools::isSubmit('submitAdd'.$this->table.'AndStay') && !count($this->errors)) { - $this->redirect_after = self::$currentIndex.'&'.$this->identifier.'='.(int) Tools::getValue('id_feature').'&conf=4&update'.$this->table.'&token='.$this->token; + if ('feature_value' === $this->table && !count($this->errors)) { + if (Tools::isSubmit('submitAdd'.$this->table.'AndStay')) { + $this->redirect_after = self::$currentIndex.'&addfeature_value&id_feature='.(int)Tools::getValue('id_feature').'&conf=4&token='.$this->token; + } else { + $this->redirect_after = self::$currentIndex.'&id_feature='.(int)Tools::getValue('id_feature').'&viewfeature&conf=4&token='.$this->token; + } + } elseif (Tools::isSubmit('submitAdd'.$this->table.'AndStay') && !count($this->errors)) { + $this->redirect_after = self::$currentIndex.'&'.$this->identifier.'='.(int)$object->id.'&conf=4&update'.$this->table.'&token='.$this->token; } return $object; @@ -628,24 +650,12 @@ class AdminFeaturesControllerCore extends AdminController $this->errors[] = $this->l('Some error occurred while uploding room feature logo. Please try again.'); } } - - if ($featureValues = FeatureValue::getFeatureValuesWithLang( - $this->context->language->id, - $objFeature->id - )) { - $objFeatureValue = new FeatureValue($featureValues[0]['id_feature_value']); - } else { - $objFeatureValue = new FeatureValue(); - } - - $objFeatureValue->id_feature = $objFeature->id; - foreach (Language::getLanguages(true) as $lang) { - $objFeatureValue->value[$lang['id_lang']] = $objFeature->id.'.jpg'; - } - $objFeatureValue->save(); - return $objFeature; } + + return $objFeature; } + + return parent::processSave(); } /** diff --git a/controllers/admin/AdminGuestRegistrationController.php b/controllers/admin/AdminGuestRegistrationController.php new file mode 100644 index 000000000..e7347a620 --- /dev/null +++ b/controllers/admin/AdminGuestRegistrationController.php @@ -0,0 +1,123 @@ +bootstrap = true; + $this->table = 'configuration'; + $this->className = 'Configuration'; + $this->identifier = 'id_configuration'; + + parent::__construct(); + } + + public function initContent() + { + $this->display = 'view'; + $this->initToolbar(); + parent::initContent(); + } + + public function renderView() + { + $grcInfoJson = Configuration::get('QLO_GUEST_REGISTRATION_CARD_INFO'); + $savedSections = array(); + if ($grcInfoJson !== false && $grcInfoJson !== '') { + $grcData = Tools::jsonDecode($grcInfoJson, true); + if (is_array($grcData)) { + $savedSections = $grcData; + } + } + + $allSelected = empty($savedSections); + $nodes = array(); + $objHotelBookingDetail = new HotelBookingDetail(); + foreach ($objHotelBookingDetail->getRegistrationCardInfo() as $sectionId => $section) { + $sectionFields = isset($savedSections[$sectionId]) ? $savedSections[$sectionId] : array(); + $fieldNodes = array(); + foreach ($section['fields'] as $fieldId => $fieldName) { + $fieldSelected = $allSelected || in_array($fieldId, $sectionFields); + $fieldNodes[] = array( + 'value' => $fieldId, + 'name' => $fieldName, + 'input_name' => 'grc_field_'.$sectionId, + 'selected' => $fieldSelected, + ); + } + $fieldsSelected = $allSelected || !empty(array_filter($fieldNodes, function ($n) { return $n['selected']; })); + $nodes[] = array( + 'value' => $sectionId, + 'name' => $section['name'], + 'input_name' => 'grc_section', + 'selected' => $fieldsSelected, + 'children' => $fieldNodes, + ); + } + + $tree = new HelperTree('grc-card-info-tree'); + $tree->setData($nodes) + ->setUseCheckBox(true) + ->setAutoSelectChildren(true) + ->setUseBulkActions(true); + + $this->context->smarty->assign(array( + 'guest_reg_card_info_tree' => $tree->render(), + 'guest_reg_card_form_action' => self::$currentIndex.'&token='.$this->token, + 'guest_reg_card_preview_img_url' => $this->context->link->getBaseLink().'img/admin/guest_registration_preview.jpg', + 'guest_reg_card_preview_title' => $this->l('Guest Registration Card Preview'), + )); + + return parent::renderView(); + } + + public function initToolbarTitle() + { + $this->toolbar_title = array($this->l('Guest Registration Card')); + } + + public function postProcess() + { + if (Tools::isSubmit('submitGrcCardInfo')) { + $grcInfo = array(); + $objHotelBookingDetail = new HotelBookingDetail(); + foreach (array_keys($objHotelBookingDetail->getRegistrationCardInfo()) as $sectionId) { + $fields = array_values(array_filter(array_map('intval', (array)Tools::getValue('grc_field_'.$sectionId, array())))); + if (!empty($fields)) { + $grcInfo[$sectionId] = $fields; + } + } + if (empty($grcInfo)) { + $this->errors[] = $this->l('Please select at least one field for the Guest Registration Card.'); + return; + } + Configuration::updateValue('QLO_GUEST_REGISTRATION_CARD_INFO', Tools::jsonEncode($grcInfo)); + Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token.'&conf=4'); + return; + } + + parent::postProcess(); + } +} diff --git a/controllers/admin/AdminImportController.php b/controllers/admin/AdminImportController.php index 6be582d49..a790be281 100644 --- a/controllers/admin/AdminImportController.php +++ b/controllers/admin/AdminImportController.php @@ -3326,7 +3326,7 @@ class AdminImportControllerCore extends AdminController Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'htl_image`'); Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'htl_access`'); Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'htl_booking_detail`'); - Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'htl_branch_features`'); + Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'htl_branch_amenity`'); Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'htl_cart_booking_data`'); Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'htl_branch_refund_rules`'); Db::getInstance()->execute('TRUNCATE TABLE `'._DB_PREFIX_.'htl_order_restrict_date`'); diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index fa38e98ab..61ab497be 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -484,6 +484,22 @@ class AdminOrdersControllerCore extends AdminController } $objHotelAdvancedPayment = new HotelAdvancedPayment(); + $adminCartsAccess = Profile::getProfileAccess( + (int) $this->context->employee->id_profile, + (int) Tab::getIdFromClassName('AdminCarts') + ); + $adminCustomersAccess = Profile::getProfileAccess( + (int) $this->context->employee->id_profile, + (int) Tab::getIdFromClassName('AdminCustomers') + ); + $adminCartRulesAccess = Profile::getProfileAccess( + (int) $this->context->employee->id_profile, + (int) Tab::getIdFromClassName('AdminCartRules') + ); + $adminAddressesAccess = Profile::getProfileAccess( + (int) $this->context->employee->id_profile, + (int) Tab::getIdFromClassName('AdminAddresses') + ); $this->context->smarty->assign(array( 'order_total' => $cart->getOrderTotal(true), 'is_advance_payment_active' => $objHotelAdvancedPayment->isAdvancePaymentAvailableForCurrentCart(), @@ -497,6 +513,11 @@ class AdminOrdersControllerCore extends AdminController 'payment_types' => $paymentTypes, 'PAYMENT_TYPE_PAY_AT_HOTEL' => OrderPayment::PAYMENT_TYPE_PAY_AT_HOTEL, 'currency' => new Currency((int)$cart->id_currency), + 'can_edit_booking_carts' => (!empty($adminCartsAccess['edit']) && (int) $adminCartsAccess['edit'] === 1), + 'can_add_customers' => (!empty($adminCustomersAccess['add']) && (int) $adminCustomersAccess['add'] === 1), + 'can_add_vouchers' => (!empty($adminCartRulesAccess['add']) && (int) $adminCartRulesAccess['add'] === 1), + 'can_add_addresses' => (!empty($adminAddressesAccess['add']) && (int) $adminAddressesAccess['add'] === 1), + 'max_child_in_room' => Configuration::get('WK_GLOBAL_MAX_CHILD_IN_ROOM'), 'max_child_age' => Configuration::get('WK_GLOBAL_CHILD_MAX_AGE'), 'occupancy_required_for_booking' => $occupancyRequiredForBooking, )); diff --git a/controllers/admin/AdminPdfController.php b/controllers/admin/AdminPdfController.php index 2b74dad25..4d256dded 100644 --- a/controllers/admin/AdminPdfController.php +++ b/controllers/admin/AdminPdfController.php @@ -64,6 +64,15 @@ class AdminPdfControllerCore extends AdminController } } + public function processGenerateGuestRegistrationFormPDF() + { + if (Tools::isSubmit('id_hotel_booking_detail')) { + $this->generateGuestRegistrationFormPDF((int)Tools::getValue('id_hotel_booking_detail')); + } else { + die(Tools::displayError('The hotel booking detail ID is missing.')); + } + } + public function processGenerateBookingVoucherPDF() { if (Tools::isSubmit('id_order')) { @@ -234,6 +243,17 @@ class AdminPdfControllerCore extends AdminController $this->generatePDF($order_invoice, PDF::TEMPLATE_INVOICE); } + public function generateGuestRegistrationFormPDF($idHotelBookingDetail) + { + $idHotelBookingDetail = (int)$idHotelBookingDetail; + if (!$idHotelBookingDetail || !Validate::isLoadedObject(new HotelBookingDetail($idHotelBookingDetail))) { + die(Tools::displayError('The hotel booking cannot be found within your database.')); + } + + $pdf = new PDF($idHotelBookingDetail, PDF::TEMPLATE_GUEST_REGISTRATION_FORM, Context::getContext()->smarty); + $pdf->render('I'); + } + public function generateBookingVoucherPDFByIdOrder($id_order) { $order = new Order((int)$id_order); diff --git a/controllers/admin/AdminPreferencesController.php b/controllers/admin/AdminPreferencesController.php index a97ec7b54..4ceb3f0f5 100644 --- a/controllers/admin/AdminPreferencesController.php +++ b/controllers/admin/AdminPreferencesController.php @@ -195,6 +195,19 @@ class AdminPreferencesControllerCore extends AdminController 'class' => 'fixed-width-xl', 'desc' => sprintf($this->l('If set to 0, the maximum limit will be %d characters.'), Configuration::PS_SHORT_DESC_LIMIT) ), + 'PS_EXPORT_FIELDS_TYPE' => array( + 'title' => $this->l('CSV export fields'), + 'desc' => $this->l('Choose whether list CSV exports include all fields, or only the fields currently checked in the "Available Fields" selector of the list being exported.'), + 'validation' => 'isInt', + 'cast' => 'intval', + 'type' => 'select', + 'list' => array( + array('id' => HelperList::QLO_EXPORT_FIELDS_ALL, 'name' => $this->l('All Fields')), + array('id' => HelperList::QLO_EXPORT_FIELDS_SELECTED, 'name' => $this->l('Selected Fields')), + ), + 'identifier' => 'id', + 'defaultValue' => HelperList::QLO_EXPORT_FIELDS_ALL, + ), // 'PS_DISPLAY_SUPPLIERS' => array( // 'title' => $this->l('Display suppliers and manufacturers'), // 'desc' => $this->l('Enable suppliers and manufacturers pages on your front office even when their respective modules are disabled.'), diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 58d308fe4..bb88d4a23 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -107,6 +107,7 @@ class AdminProductsControllerCore extends AdminController 'Images' => $this->l('Images'), 'ServiceProduct' => $this->l('Service Products'), // 'Associations' => $this->l('Associations'), + 'Amenities' => $this->l('Amenities'), 'Features' => $this->l('Features'), 'Configuration' => $this->l('Rooms'), 'Occupancy' => $this->l('Occupancy'), @@ -121,9 +122,10 @@ class AdminProductsControllerCore extends AdminController 'Seo' => 2, // 'Associations' => 3, 'Images' => 4, - 'Features' => 5, - 'Configuration' => 6, - 'Occupancy' => 7, + 'Amenities' => 5, + 'Features' => 6, + 'Configuration' => 7, + 'Occupancy' => 8, 'ServiceProduct' => 9, 'LengthOfStay' => 10, 'AdditionalFacilities' => 11, @@ -972,12 +974,6 @@ class AdminProductsControllerCore extends AdminController $id_hotel_new = $room_type_info['id_hotel']; } - $objHotelRoomTypeBedType = new HotelRoomTypeBedType(); - if ($roomTypeBedTypes = $objHotelRoomTypeBedType->getRoomTypeBedTypes($id_product_old)) { - $roomTypeBedTypes = array_column($roomTypeBedTypes, 'id_bed_type'); - $objHotelRoomTypeBedType->updateRoomTypeBedTypes($roomTypeBedTypes, $product->id); - } - if ($product->hasAttributes()) { Product::updateDefaultAttribute($product->id); } else { @@ -1171,34 +1167,45 @@ class AdminProductsControllerCore extends AdminController } if (Validate::isLoadedObject($product = new Product((int)Tools::getValue('id_product')))) { - // delete all objects - $product->deleteFeatures(); - - // add new objects - $languages = Language::getLanguages(false); - foreach ($_POST as $key => $val) { - if (preg_match('/^feature_([0-9]+)_check/i', $key, $match)) { - if ($val) { - $product->addFeaturesToDB($match[1], $val); - } else { - if ($default_value = $this->checkFeatures($languages, $match[1])) { - $id_value = $product->addFeaturesToDB($match[1], 0, 1); - foreach ($languages as $language) { - if ($cust = Tools::getValue('custom_'.$match[1].'_'.(int)$language['id_lang'])) { - $product->addFeaturesCustomToDB($id_value, (int)$language['id_lang'], $cust); - } else { - $product->addFeaturesCustomToDB($id_value, (int)$language['id_lang'], $default_value); - } - } - } - } - } + if (!$this->saveRoomTypeFeatures($product)) { + $this->errors[] = Tools::displayError('An error occurred while saving room type features.'); } } else { $this->errors[] = Tools::displayError('A room type must be created before adding features.'); } } + /** + * Save assigned core feature values for a room type. + * + * @param Product $product + * + * @return bool + */ + protected function saveRoomTypeFeatures(Product $product) + { + $product->deleteFeatures(); + + $featureValues = Tools::getValue('feature_values', array()); + if (!is_array($featureValues) || empty($featureValues)) { + return true; + } + + foreach ($featureValues as $idFeature => $selectedValues) { + $idFeature = (int)$idFeature; + if (!$idFeature) { + continue; + } + foreach (array_unique(array_map('intval', $selectedValues)) as $idFeatureValue) { + if ($idFeatureValue) { + $product->addFeaturesToDB($idFeature, $idFeatureValue); + } + } + } + + return true; + } + /** * This function is never called at the moment (specific prices cannot be edited) */ @@ -1953,14 +1960,29 @@ class AdminProductsControllerCore extends AdminController $this->copyFromPost($this->object, $this->table); $this->object->booking_product = true; if ($this->object->add()) { - $objHotelRoomTypeBedType = new HotelRoomTypeBedType(); - $objHotelRoomTypeBedType->updateRoomTypeBedTypes(Tools::getValue('id_bed_types'), $this->object->id); // associateroom type to hotel // if ($this->object->is_virtual) { // } $this->assignRoomType($this->object); + if ($this->isTabSubmitted('Amenities')) { + $categories = HotelAmenities::getCategories(); + if ($categories && !HotelAmenities::getAmenities()) { + $this->errors[] = Tools::displayError('No amenities have been created. Please add amenities to at least one category before assigning them.'); + return false; + } + $selectedAmenities = Tools::getValue('room_type_amenities', array()); + $featuredAmenities = Tools::getValue('featured_amenities', array()); + if (!(new HotelRoomTypeAmenities())->saveRoomTypeAmenities((int)$this->object->id, $selectedAmenities, $featuredAmenities)) { + $this->errors[] = Tools::displayError('An error occurred while saving room type amenities.'); + return false; + } + } + if ($this->isTabSubmitted('Features') && !$this->saveRoomTypeFeatures($this->object)) { + $this->errors[] = Tools::displayError('An error occurred while saving room type features.'); + return false; + } PrestaShopLogger::addLog(sprintf($this->l('%s addition', 'AdminTab', false, false), $this->className), 1, null, $this->className, (int)$this->object->id, true, (int)$this->context->employee->id); @@ -2203,8 +2225,18 @@ class AdminProductsControllerCore extends AdminController } if ($object->update()) { - $objHotelRoomTypeBedType = new HotelRoomTypeBedType(); - $objHotelRoomTypeBedType->updateRoomTypeBedTypes(Tools::getValue('id_bed_types'), $object->id); + if ($this->isTabSubmitted('Amenities')) { + $selectedAmenities = Tools::getValue('room_type_amenities', array()); + $featuredAmenities = Tools::getValue('featured_amenities', array()); + if (!(new HotelRoomTypeAmenities())->saveRoomTypeAmenities((int)$object->id, $selectedAmenities, $featuredAmenities)) { + $this->errors[] = Tools::displayError('An error occurred while saving room type amenities.'); + return false; + } + } + if ($this->isTabSubmitted('Features') && !$this->saveRoomTypeFeatures($object)) { + $this->errors[] = Tools::displayError('An error occurred while saving room type features.'); + return false; + } // update position in category $object->setPositionInCategory(Tools::getValue('category_position')); @@ -2228,9 +2260,6 @@ class AdminProductsControllerCore extends AdminController if ($this->isTabSubmitted('Suppliers')) { // $this->processSuppliers(); } - if ($this->isTabSubmitted('Features')) { - $this->processFeatures(); - } if ($this->isTabSubmitted('Combinations')) { $this->processProductAttribute(); } @@ -4648,15 +4677,6 @@ class AdminProductsControllerCore extends AdminController $data->assign('htl_full_info', $hotelFullInfo); } - $objHotelBedType = new HotelBedType(); - $bedTypes = $objHotelBedType->getAllBedTypes($this->context->language->id); - $data->assign('bed_types_info', $bedTypes); - $objHotelRoomTypeBedType = new HotelRoomTypeBedType(); - if ($selectedBedTypes = $objHotelRoomTypeBedType->getRoomTypeBedTypes($product->id)) { - $selectedBedTypes = array_column($selectedBedTypes, 'id_bed_type'); - $data->assign('selected_bed_types', $selectedBedTypes); - } - $this->tpl_form_vars['product'] = $product; $this->tpl_form_vars['custom_form'] = $data->fetch(); } @@ -4898,37 +4918,17 @@ class AdminProductsControllerCore extends AdminController } else { if ($obj->id) { if ($this->product_exists_in_shop) { - $features = Feature::getFeatures($this->context->language->id, (Shop::isFeatureActive() && Shop::getContext() == Shop::CONTEXT_SHOP)); - - foreach ($features as $k => $tab_features) { - $features[$k]['current_item'] = false; - $features[$k]['val'] = array(); - - $custom = true; - foreach ($obj->getFeatures() as $tab_products) { - if ($tab_products['id_feature'] == $tab_features['id_feature']) { - $features[$k]['current_item'] = $tab_products['id_feature_value']; - } - } - - $features[$k]['featureValues'] = FeatureValue::getFeatureValuesWithLang($this->context->language->id, (int)$tab_features['id_feature']); - if (count($features[$k]['featureValues'])) { - foreach ($features[$k]['featureValues'] as $value) { - if ($features[$k]['current_item'] == $value['id_feature_value']) { - $custom = false; - } - } - } - - if ($custom) { - $feature_values_lang = FeatureValue::getFeatureValueLang($features[$k]['current_item']); - foreach ($feature_values_lang as $feature_value) { - $features[$k]['val'][$feature_value['id_lang']] = $feature_value; - } - } + $features = Product::getRoomTypeFeatureTreeData($obj->id); + if ($features) { + $tree = new HelperTree('room-type-features-tree', $features); + $tree->setShowCollapseExpandButton(true) + ->setUseCheckBox(true) + ->setAutoSelectChildren(true) + ->setUseBulkActions(true) + ->setUseSearch(true) + ->setHeaderTemplate('tree_header_room.tpl'); + $data->assign('room_type_features_tree', $tree->render()); } - - $data->assign('available_features', $features); $data->assign('product', $obj); $data->assign('link', $this->context->link); $data->assign('default_form_language', $this->default_form_language); @@ -4942,6 +4942,50 @@ class AdminProductsControllerCore extends AdminController $this->tpl_form_vars['custom_form'] = $data->fetch(); } + /** + * Prepare the amenities form tab for a room type. + * + * @param Product $obj + * + * @throws Exception + * @throws SmartyException + */ + public function initFormAmenities($obj) + { + if (!$this->default_form_language) { + $this->getLanguages(); + } + + $data = $this->createTemplate($this->tpl_form); + $data->assign('default_form_language', $this->default_form_language); + $data->assign('languages', $this->_languages); + $data->assign('link', $this->context->link); + $data->assign('product', $obj); + + if ($obj->id) { + if ($this->product_exists_in_shop) { + $roomTypeAmenities = HotelRoomTypeAmenities::getRoomTypeAmenitiesTreeData((int) $obj->id); + if ($roomTypeAmenities) { + $tree = new HelperTree('room-type-amenities-tree', $roomTypeAmenities); + $tree->setShowCollapseExpandButton(true) + ->setUseCheckBox(true) + ->setAutoSelectChildren(true) + ->setUseBulkActions(true) + ->setUseSearch(true) + ->setHeaderTemplate('tree_header_room.tpl'); + $data->assign('room_type_amenities_tree', $tree->render()); + $data->assign('featured_amenity_ids', array_column(HotelRoomTypeAmenities::getAmenities((int)$obj->id, 0, true), 'id')); + } + } else { + $this->displayWarning($this->l('You must save the room type in this shop before adding amenities.')); + } + } else { + $this->displayWarning($this->l('You must save this room type before adding amenities.')); + } + + $this->tpl_form_vars['custom_form'] = $data->fetch(); + } + public function getModalDuplicateOptions() { $idsHotel = HotelBranchInformation::getProfileAccessedHotels($this->context->employee->id_profile, 1, 1); diff --git a/controllers/admin/AdminSearchController.php b/controllers/admin/AdminSearchController.php index ac47c445f..c2ac5e28f 100644 --- a/controllers/admin/AdminSearchController.php +++ b/controllers/admin/AdminSearchController.php @@ -38,7 +38,7 @@ class AdminSearchControllerCore extends AdminController 'AdminOrderRefundRules' => 1, 'AdminRoomTypeGlobalDemand' => 1, 'AdminGroups' => 1, - 'AdminHotelFeatures' => 1, + 'AdminHotelAmenities' => 1, 'AdminCustomers' => 1, 'AdminAddHotel' => 1, 'AdminNormalProducts' => 1, @@ -190,7 +190,7 @@ class AdminSearchControllerCore extends AdminController if (!$searchType) { $this->searchAddress(); - $this->searchHotelFeatures(); + $this->searchHotelAmenities(); $this->searchAdditionalFacilities(); $this->searchRefundRules(); } @@ -428,23 +428,23 @@ class AdminSearchControllerCore extends AdminController } } - public function searchHotelFeatures() + public function searchHotelAmenities() { - if (class_exists('HotelFeatures')) { - if (isset($this->controllerAccess['AdminHotelFeatures']) && $this->controllerAccess['AdminHotelFeatures']) { - $objHotelFeatures = new HotelFeatures(); - if ($hotelFeatures = $objHotelFeatures->searchByName($this->query, $this->context->language->id)) { - $features = array(); - foreach ($hotelFeatures as $key => $hotelFeature) { - $features[$hotelFeature['id']]['name'] = $hotelFeature['name']; - if ($hotelFeature['parent_feature_id']) { - $features[$hotelFeature['id']]['id'] = $hotelFeature['parent_feature_id']; + if (class_exists('HotelAmenities')) { + if (isset($this->controllerAccess['AdminHotelAmenities']) && $this->controllerAccess['AdminHotelAmenities']) { + $objHotelAmenities = new HotelAmenities(); + if ($hotelAmenities = $objHotelAmenities->searchByName($this->query, $this->context->language->id)) { + $amenities = array(); + foreach ($hotelAmenities as $key => $hotelAmenity) { + $amenities[$hotelAmenity['id_amenity']]['name'] = $hotelAmenity['name']; + if ($hotelAmenity['id_parent']) { + $amenities[$hotelAmenity['id_amenity']]['id'] = $hotelAmenity['id_parent']; } else { - $features[$hotelFeature['id']]['id'] = $hotelFeature['id']; + $amenities[$hotelAmenity['id_amenity']]['id'] = $hotelAmenity['id_amenity']; } } - $this->_list['hotel_features'] = $features; + $this->_list['hotel_amenities'] = $amenities; } } } @@ -681,10 +681,10 @@ class AdminSearchControllerCore extends AdminController ); } - protected function initHotelFeatureList() + protected function initHotelAmenityList() { $this->show_toolbar = false; - $this->fields_list['hotel_features'] = array( + $this->fields_list['hotel_amenities'] = array( 'name' => array('title' => $this->l('name'), 'width' => 'auto'), ); } @@ -929,26 +929,26 @@ class AdminSearchControllerCore extends AdminController $this->tpl_view_vars['customers'] = $view; } - if (isset($this->_list['hotel_features']) && count($this->_list['hotel_features'])) { + if (isset($this->_list['hotel_amenities']) && count($this->_list['hotel_amenities'])) { $view = ''; - $this->initHotelFeatureList(); + $this->initHotelAmenityList(); $helper = new HelperList(); $helper->shopLinkType = ''; $helper->simple_header = true; - $helper->identifier = 'id'; + $helper->identifier = 'id_amenity'; $helper->actions = array('edit', 'view'); $helper->show_toolbar = false; - $helper->table = 'htl_features'; - $helper->currentIndex = $this->context->link->getAdminLink('AdminHotelFeatures', false); - $helper->token = Tools::getAdminTokenLite('AdminHotelFeatures'); + $helper->table = 'htl_amenity'; + $helper->currentIndex = $this->context->link->getAdminLink('AdminHotelAmenities', false); + $helper->token = Tools::getAdminTokenLite('AdminHotelAmenities'); - if ($this->_list['hotel_features']) { - $view = $helper->generateList($this->_list['hotel_features'], $this->fields_list['hotel_features']); + if ($this->_list['hotel_amenities']) { + $view = $helper->generateList($this->_list['hotel_amenities'], $this->fields_list['hotel_amenities']); } - $this->tpl_view_vars['num_hotel_features'] = count($this->_list['hotel_features']); - $this->tpl_view_vars['hotel_features'] = $view; + $this->tpl_view_vars['num_hotel_amenities'] = count($this->_list['hotel_amenities']); + $this->tpl_view_vars['hotel_amenities'] = $view; } if (isset($this->_list['groups']) && count($this->_list['groups'])) { $view = ''; diff --git a/controllers/front/CategoryController.php b/controllers/front/CategoryController.php index 582344f7d..6abb5d336 100644 --- a/controllers/front/CategoryController.php +++ b/controllers/front/CategoryController.php @@ -92,37 +92,45 @@ class CategoryControllerCore extends FrontController public function init() { // Get category ID - $id_category = (int)Tools::getValue('id_category'); - if (!$id_category || !Validate::isUnsignedId($id_category)) { - $this->errors[] = Tools::displayError('Missing category ID'); - } + $idCategory = (int) Tools::getValue('id_category'); + $this->category = new Category($idCategory, $this->context->language->id); - // validate dates if available $dateFrom = Tools::getValue('date_from'); $dateTo = Tools::getValue('date_to'); - $idHotel = HotelBranchInformation::getHotelIdByIdCategory($id_category); - if (!HotelHelper::validateDateRangeForHotel($dateFrom, $dateTo, $idHotel)) { + $idHotel = HotelBranchInformation::getHotelIdByIdCategory($idCategory); + + if (!$idCategory || !Validate::isUnsignedId($idCategory)) { Tools::redirect($this->context->link->getPageLink('pagenotfound')); - } - - // Instantiate category - $this->category = new Category($id_category, $this->context->language->id); - - parent::init(); - - // Check if the category is active and return 404 error if is disable. - if (!$this->category->active || !Validate::isLoadedObject($this->category) || !$this->category->inShop() || !$this->category->isAssociatedToShop() || in_array($this->category->id, array(Configuration::get('PS_HOME_CATEGORY'), Configuration::get('PS_ROOT_CATEGORY')))) { - header('HTTP/1.1 404 Not Found'); - header('Status: 404 Not Found'); + } elseif (!Validate::isLoadedObject($this->category) || !$this->category->active) { Tools::redirect($this->context->link->getPageLink('pagenotfound')); - } else - // Check if category can be accessible by current customer and return 403 if not - if (!$this->category->checkAccess($this->context->customer->id)) { + } elseif ($idHotel && !(new HotelBranchInformation())->hotelBranchInfoByCategoryId($idCategory)) { + Tools::redirect($this->context->link->getPageLink('pagenotfound')); + } elseif ($idHotel && !HotelHelper::validateDateRangeForHotel($dateFrom, $dateTo, $idHotel)) { + Tools::redirect($this->context->link->getPageLink('pagenotfound')); + } else { + parent::init(); + + if ( + !$this->category->inShop() + || !$this->category->isAssociatedToShop() + || in_array( + $this->category->id, + array( + Configuration::get('PS_HOME_CATEGORY'), + Configuration::get('PS_ROOT_CATEGORY') + ) + ) + ) { + header('HTTP/1.1 404 Not Found'); + header('Status: 404 Not Found'); + Tools::redirect($this->context->link->getPageLink('pagenotfound')); + } elseif (!$this->category->checkAccess($this->context->customer->id)) { header('HTTP/1.1 403 Forbidden'); header('Status: 403 Forbidden'); $this->errors[] = Tools::displayError('You do not have access to this category.'); $this->customer_access = false; } + } } /** @@ -130,14 +138,15 @@ class CategoryControllerCore extends FrontController */ public function initContent() { + if (!$this->customer_access) { + $this->display_column_left = false; + $this->display_column_right = false; + } + parent::initContent(); $this->setTemplate(_PS_THEME_DIR_.'category.tpl'); - if (!$this->customer_access) { - return; - } - $id_category = Tools::getValue('id_category'); $displayAllRoomsTypes = false; @@ -236,7 +245,6 @@ class CategoryControllerCore extends FrontController } } - $feat_img_dir = _PS_IMG_.'rf/'; $ratting_img = _MODULE_DIR_.'hotelreservationsystem/views/img/Slices/icons-sprite.png'; $this->context->smarty->assign(array( 'warning_num' => $warning_num, @@ -249,7 +257,7 @@ class CategoryControllerCore extends FrontController 'display_all_room_types' => $displayAllRoomsTypes, 'id_hotel' => $id_hotel, 'currency' => $currency, - 'feat_img_dir' => $feat_img_dir, + 'amenity_img_dir' => _MODULE_DIR_.'hotelreservationsystem/views/img/hotel_amenities/', 'ratting_img' => $ratting_img, )); diff --git a/controllers/front/OrderDetailController.php b/controllers/front/OrderDetailController.php index bde1ccf77..61bf29eea 100644 --- a/controllers/front/OrderDetailController.php +++ b/controllers/front/OrderDetailController.php @@ -528,8 +528,18 @@ class OrderDetailControllerCore extends FrontController { $response = array('extra_demands' => false); + $idOrder = (int) Tools::getValue('id_order'); + $order = new Order($idOrder); + + if (!Validate::isLoadedObject($order) + || $order->id_customer != $this->context->customer->id + || $order->secure_key != Tools::getValue('secure_key') + ) { + $this->ajaxDie(json_encode($response)); + } + if (($idProduct = Tools::getValue('id_product')) - && ($idOrder = Tools::getValue('id_order')) + && $idOrder && ($dateFrom = Tools::getValue('date_from')) && ($dateTo = Tools::getValue('date_to')) ) { @@ -573,7 +583,7 @@ class OrderDetailControllerCore extends FrontController } $this->context->smarty->assign(array( - 'objOrder' => new Order($idOrder), + 'objOrder' => $order, )); $response['extra_demands'] = $this->context->smarty->fetch(_PS_THEME_DIR_.'_partials/order-extra-services.tpl'); diff --git a/controllers/front/ProductController.php b/controllers/front/ProductController.php index e31cb0012..adb92a1f8 100644 --- a/controllers/front/ProductController.php +++ b/controllers/front/ProductController.php @@ -126,6 +126,12 @@ class ProductControllerCore extends FrontController $objHotelRoomType = new HotelRoomType(); if ($hotelRoomInfo = $objHotelRoomType->getRoomTypeInfoByIdProduct($this->product->id)) { $idHotel = (int) $hotelRoomInfo['id_hotel']; + + // If the hotel this room type belongs to is disabled, redirect to home page + if (!(new HotelBranchInformation())->hotelBranchesInfo(false, 1, 0, $idHotel)) { + Tools::redirect($this->context->link->getPageLink('pagenotfound')); + } + if (!HotelHelper::validateDateRangeForHotel($dateFrom, $dateTo, $idHotel)) { Tools::redirect($this->context->link->getPageLink('pagenotfound')); } @@ -346,12 +352,12 @@ class ProductControllerCore extends FrontController $hotel_location = $addressInfo['city']. ($addressInfo['id_state']?', '.$addressInfo['state']:'').', '.$addressInfo['country']; - $obj_hotel_feaures_ids = $obj_hotel_branch->getFeaturesOfHotelByHotelId($hotel_id); + $obj_hotel_amenities_ids = $obj_hotel_branch->getAmenitiesOfHotelByHotelId($hotel_id); - if (isset($obj_hotel_feaures_ids) && $obj_hotel_feaures_ids) { - foreach ($obj_hotel_feaures_ids as $key => $value) { - $obj_htl_ftr = new HotelFeatures(); - $htl_info = $obj_htl_ftr->getFeatureInfoById($value['feature_id']); + if (isset($obj_hotel_amenities_ids) && $obj_hotel_amenities_ids) { + foreach ($obj_hotel_amenities_ids as $key => $value) { + $obj_htl_amenity = new HotelAmenities(); + $htl_info = $obj_htl_amenity->getAmenityInfoById($value['amenity_id']); $htl_features[] = $htl_info['name']; } } @@ -409,19 +415,9 @@ class ProductControllerCore extends FrontController } } - $objHotelBedType = new HotelBedType(); - if ($bedTypes = $objHotelBedType->getAllBedTypes($this->context->language->id)) { - foreach ($bedTypes as $bedTypeKey => $bedType) { - $bedTypes[$bedTypeKey]['area'] = Tools::ps_round($bedType['width'], 2).' * '.Tools::ps_round($bedType['length'], 2); - } - - $bedTypes = array_column($bedTypes, null, 'id_bed_type'); - } - - $objHotelRoomTypeBedType = new HotelRoomTypeBedType(); - if ($selectedBedTypes = $objHotelRoomTypeBedType->getRoomTypeBedTypes($this->product->id)) { - $selectedBedTypes = array_column($selectedBedTypes, 'id_bed_type'); - } + $roomFeatures = $this->product->getFrontFeatures($this->context->language->id); + $roomAmenities = HotelRoomTypeAmenities::getAmenities($this->product->id, $this->context->language->id); + $hotelAmenities = HotelBranchAmenities::getAmenities($hotel_id, $this->context->language->id); $this->context->smarty->assign( array( @@ -449,14 +445,14 @@ class ProductControllerCore extends FrontController 'hotel_description' => $hotel_info_by_id['description'], 'hotel_policies' => $hotel_policies, 'hotel_features' => $htl_features, + 'room_type_features' => $roomFeatures, + 'room_dynamic_amenities' => $roomAmenities, + 'hotel_dynamic_amenities' => $hotelAmenities, + 'amenity_img_dir' => _MODULE_DIR_.'hotelreservationsystem/views/img/hotel_amenities/', 'hotel_image_link' => $hotelImageLink, 'hotel_has_images' => (bool) HotelImage::getCover($hotel_id), - 'ftr_img_src' => _PS_IMG_.'rf/', 'order_date_restrict' => $order_date_restrict, 'PS_SERVICE_PRODUCT_CATEGORY_FILTER' => Configuration::get('PS_SERVICE_PRODUCT_CATEGORY_FILTER'), - 'bed_types_info' => $bedTypes, - 'selected_bed_types' => $selectedBedTypes, - 'dimension_unit' => Configuration::get('WK_DIMENSION_UNIT', $this->context->language->id), ) ); diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt deleted file mode 100644 index 3359f0408..000000000 --- a/docs/CHANGELOG.txt +++ /dev/null @@ -1,8744 +0,0 @@ -2007-2017 PrestaShop - -NOTICE OF LICENSE - -This source file is subject to the Open Software License (OSL 3.0) -that is bundled with this package in the file LICENSE.txt. -It is also available through the world-wide-web at this URL: -http://opensource.org/licenses/osl-3.0.php -If you did not receive a copy of the license and are unable to -obtain it through the world-wide-web, please send an email -to license@prestashop.com so we can send you a copy immediately. - -DISCLAIMER - -Do not edit or add to this file if you wish to upgrade PrestaShop to newer -versions in the future. If you wish to customize PrestaShop for your -needs please refer to http://www.prestashop.com for more information. - -@author PrestaShop SA -@copyright 2007-2017 PrestaShop SA -@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) -International Registred Trademark & Property of PrestaShop SA - -Release Notes for PrestaShop 1.6 --------------------------------- -#################################### -# v1.6.1.23 - (2018-11-01) -#################################### - - -#################################### -# v1.6.1.22 - (2018-10-09) -#################################### - - Fixed bugs: - - CO: Missing class const on cert refresh - -#################################### -# v1.6.1.21 - (2018-10-03) -#################################### - - Fixed bugs: - - BO: Fix Module configure permission - BO: Disallow the negative discounts in orders - BO: Replace serialize with json_encode - - FO : Removed duplicate expressions - FO : Stop sending a copy of the contact message to the "author" (avoid spam) - - CO: Add a fallback to curl when file_get_content() return an empty response - CO: Hide arguments in debug trace page - CO: Fix the possibility to create a customer with "造" or " - CO: Catch all Swift exceptions in Mail::Send() - -#################################### -# v1.6.1.20 - (2018-06-27) -#################################### - - Fixed bugs: - - BO: Improve cookie encryption - BO: PHP 7.2 compat - Fix fatal error - BO: Fix undefined property key on Rijndael - - FO: Control if customer is the owner of the selected order in contact form - - CO: Use https no http employee class - - WS: FIX PHP 7.1 compat in WebserviceOutputBuilder - -#################################### -# v1.6.1.19 - (2018-05-28) -#################################### - - Fixed bugs: - - BO: Fix directory listing - - FO: Add compliance to GDPR law for blocknewsletter, contact form and mail alerts - -#################################### -# v1.6.1.18 - (2018-02-05) -#################################### - - Fixed bugs: - - BO: Move to HTTPS - BO: Update marketplace URL to http(S) - BO: Fix AdminController's processDeleteImage() redirect after URL - BO: Fix stock available after add product in order - BO: Fix selecting a product does not work on Mac - BO: Update AdminModulesController.php - BO: Fix Stock cover report stock out calculation - BO: Revert "Add paid order to stats dashboard even when there's no related invoice generated" - - FO: Hide the password in the confirmation email - FO: Fix the blank page when no currency defined in the shop - FO: Fix the sorting problem with a descending order in the products filtering page - FO: Split width of summary invoice pdf - FO: Fix conditionals check in DiscountController - FO: Fix the email validator - - CO: Fixed for duplication of product which has both combinations and specific prices - CO: Fix error 500, result of built-in function in write context - CO: Fix PHP 7.1 compatibility - CO: Increase limit message chars - CO: Fix PHP Warning when updating category with multishop - CO: Add DB prefix in delete() method all time $add_prefix is set to true - CO: Clean the DB after language delete - CO: Use english email template as fallback in getEmailTemplateContent - - IN: Update Postal Code of South Korea - - WS: Fix the update product web service - - -#################################### -# v1.6.1.17 - (2017-09-07) -#################################### - - Fixed bugs: - BO: Enable the create_order button when ordering virtual products & there's no available carriers - BO: Fix the currency display in supply order - BO: Fix coverage calculations in Stock Cover Report - BO: Add paid order to stats dashboard even when there's no related invoice generated - - FO: Wrong gift display in My Voucher page in My Account - FO: Fix the email validation in instant checkout - FO: Secure the contact_form from spammers - FO: Secure FO from JS injection in URL - FO: Fix select delivery_option when changing the address in OPC - FO: Display the price based on the feature Customer_Groups - - CO: Speed up search queries - CO: Load id_shop routes when needed - CO: Fix error when deleting a cart - CO: Add is_object condition in isInt function to prevent the error 500 - CO: Fix duplicate url for supplier list when try to access a supplier - CO: Update the encrypt and decrypt functions to support all PHP versions - CO: Check if CMS Category is associated to shop - - -#################################### -# v1.6.1.16 - (2017-08-01) -#################################### - - Fixed bugs: - BO: Fix bulk delete for CMS Category - BO: Remove download limit (SQL manager CSV export) - BO: Fix the export link of ASM movements - BO: Fixed bug about the language link in the reply_msg mail - BO: Add unicode prime symbol in PDF - BO: Add correctly the free_shipping cart_rule to an order from BO - BO: Update only checked fields when multishop option activated - - FO: Fix multistore search indexation - FO: Fix the pagination of the list of products - FO: Fixed opc_id_address_invoice in OPC - FO: Add impact on price to the product price - FO: CategoryController - Show page 404 with an error instead of redirecting to the 404 - FO: Use $base_dir_ssl if SSL is enabled on CMS categories pages - FO: Fix tax problems in shopping cart - FO: Fix unit price of the product with combinations - FO: Fix the translation when installing Prestashop - - CO: Use MySQL index in cart delete method - CO: Undefined index base_price - CO: Subrequest error in SQL Manager - CO: Fix import theme while module use non registered hook in DB - - -#################################### -# v1.6.1.15 - (2017-06-28) -#################################### - - Fixed bugs: - BO: Do not clutter webcaches with duplicated assets' objects - BO: Fix the conversion_rate in the order_payment table - BO: Fix the categories tree - BO: Display product reference in Stock management list (ASM) - BO: Fix available quantity for ASM items in Order_edit & FO - BO: Fix ASM real quantity issues when changing SupplyOrder status - BO: Fix subcategories pagination - BO: Prevent adding pack in itself - BO: Add the condition of SSL_ENABLED to Google Maps - BO: Eliminate currencies doubling in ASM currency list - - FO: Apache rules for .woff2 font files - FO: Fix the specific price of the default combination - FO: Fix line endings in theme's JS files - FO: Fix Category Block in the Left Sidebar on Sitemap Page - - CO: getBaseLink() should be public - CO: Fix AdminSlipController filter - CO: Fix wrong keys for cache - - LO: Update colombian tax rate - - WS: Fix preg_replace /e modifier for PHP 7.1 - - -#################################### -# v1.6.1.14 - (2017-06-05) -#################################### - - Fixed bugs: - BO: Pipes in product names in autocomplete - BO: Fix taxes in credit slip - BO: Fix the refresh button of the stats bloc in the products list - BO: Add API_KEY field to display the map - BO: Fix customer message order - BO: Set correct value on load to display the right tab - BO: Translation of return merchandise fields - BO: Fix html interpreted as text in carrier's wizard summary - BO: Fix non well formed numeric value - BO: Fix error in HelperOptions - - FO: Fix popover with multiple wishlists - FO: Shipping cost indication wrong - FO: Fix 404 bug when query string contains a LF - FO: Fix manufacturer pagination - FO: Fix JS error "Uncaught ReferenceError" - - CO: Increase carrier delay length - CO: Send Http 500 error code when we can't connect to the database instead of a 200 code - CO: make OrderInvoice overridable - - LO: Replace EN (US) by EN (UK) in UK localization pack - - -#################################### -# v1.6.1.13 - (2017-04-10) -#################################### - - Fixed bugs: - CO: Optimization for Cart Rules - CO: Fix url rewrite setting not used on multishop - CO: Clean order detail cache after setting invoice id - CO: Update Israel localization - CO: Remove unused variables declarations and assignations - - BO: Error importing theme when cache directory is cleared - BO: Allow stock transfer between warehouses in multishop context - BO: Fix search in Advanced Stock Management - BO: Use native round instead of 2 forced decimals - BO: Replace comma with dot in special price - BO: Don't double encode test email - BO: Generate PDF invoices in user language - BO: Fixes on must-have module upgrade - - FO: Fix Combination filter in stock management section - FO: Fix price display when quantity discount on combination - FO: Style categories tree in footer - - IN: Allow 255 char to company field in Adress - IN: Fix install language - -#################################### -# v1.6.1.12 - (2017-03-14) -#################################### - - Fixed bugs: - CO: Deflate .svg files - CO: Webservices now show PS validation errors - CO: Update Israel VAT to 17% - CO: Fix bag with Cart::getPackageSthippingCost cache id - CO: Fix send to multiple addresses with different names - CO: Add missing option to bcc multiple addresses in Mail::send() - CO: Use shop email as sender for template order_customer_comment - CO: Fix 7.1 compatibility - CO: Update Doc import files - - BO: Modification permission on Theme Page and option - BO: Modification permission on Theme Page and option - BO: Fix error when creating a zero value in the attribute size - BO: Fix bug while filtering Credit Slip - BO: Fix doubled quantity when ordering a customizable product - BO: Callback on HelperList should have highest priority - BO: Avoid overwriting $token in global Smarty context. - - FO: Product reference is now available in blockbestsellers module - FO: Fix ecotax rounded twice - FO: Bugfix JS with advancedEuCompliance - FO: Fix product without combination hashchange - -#################################### -# v1.6.1.11 - (2017-01-16) -#################################### - - Fixed bugs: - CO: Fix detection of APCu on Performance page - CO: Cast id_cart to int to keep it in the SQL query - CO: Performance opt on scandir() usage - CO: Fix for MySQL error 1093 in generating the invoice number - CO: Fix misuse of getimagesize returned informations - CO: Fixed method Order::isVirtual - CO: PHP 7.1 Fatal error: operator not supported in DbQuery.php - CO: Fix multiple configuration entry for PERCENT_PRODUCT_OUT_OF_STOCK_EXPIRE - - BO: Fixed category search in product association tab - BO: Fix date filter when entering BO - BO: Fixed product customization duplication - BO: Uploader helper multiple files undefined _max_files - BO: Orders amount currency fixed - BO: Remove synchronous javascript call in translations - - FO: Reset country in address page after error - FO: Fix & optimize search::find queries - FO: Re-instate default id for product list - FO: Accessory product names are not the product name (Schema.org) - FO: Fix grid view payment methods on small devices - - -#################################### -# v1.6.1.10 - (2016-11-25) -#################################### - - Fixed bugs: - - [-] MO : (3b0f90b) missing IF for PRODUCT_TAB - - [-] BO : (3979614) Fix admin email translations - - - Improved/changed features: - - [*] BO : (81d6f5b) Bring back email pattern value in case someone uses it - - - - - -#################################### -# v1.6.1.7 - (2016-09-06) -#################################### - - Fixed bugs: - - [-] BO : (f19ae86) Solved problem with non-unserialized filters datas - - [-] FO : (2636a31) Fix rouding error in ProductController (PSCSX-7566) - - - Improved/changed features: - - [*] CORE : (e12c209) Fix a case where $context->smarty could be undefined - - - Others: - - CO: Fixed cart rule removal with gift product - CO: Fix bug #PSCSX-6142 - wrong default cover id in webservice - CO: change visibility of installControllers() method - CO: Fix warning when duplicating products - - FO: Add a hook on cart product line - FO: Solved problem with a situation when we'd like to use category thumb w/o category lead banner - FO : Prevent customer to view all codes - - Resolved "price.toFixed is not a function" issue - PSCSX-7138 Bad discount computation when multiples tax rates are involved - Keep CMS HTML code when upgrading - - -#################################### -# v1.6.1.6 - (2016-06-15) -#################################### - - Fixed bugs: - - [-] BO : (2e3d0f6) fixed bug when no results with address and map does not exist - [-] BO : (2d30765) add user shop origin in autocomplete cart rule - [-] BO : (d207083) fixed bug parent tab list wont show if admin tab class is invalid. - [-] BO : (052208b) fixed bug when toggle status product not logged - - [-] FO : (c0ee6b7) Fix CSS 404 when using subdirectory - [-] FO : (e4a7b70) Only display vouchers available 'only' for customers - [-] FO : (e4e2b61) smartyHook now returns empty string when module is not installed. - [-] FO : (b2f9338) #PSCSX-5582 fix wrong displayed specific price on product detail - [-] FO : (44c1b4e) Display only available vouchers in customer back office - [-] FO : (c736160) on user bo, display all discount values - - [-] TEST : (c586ee3) Fix PHP 7 tests - - [-] CORE : (39241d6) Check for displayPaymentEU to fix advanced checkout restrictions - [-] CORE : (fb208a3) Fix fatal error on classes/stock/StockAvailable.php (1.6) - - [-] PDF : (2d14094) Fix generation of PDF files - - [-] WS : (114f10b) Fix for PHP 5.2, 5.3 and 7.0 compatibility - - [-] MO : (e7a51f3) #NM-248 Broken pagination links in loyalty - - - Improved/changed features: - - [*] FO : (4e1a70a) Added more information about minimum amount - - - Added Features: - - [+] IN : (a1ce85c) All key must not be nullable - - - - - -#################################### -# v1.6.1.5 - (2016-04-08) -#################################### - - Fixed bugs: - - [-] PDF : (9f7ab92) update constraints on Addresses display - [-] PDF : (e7103c4) updated b2b template - [-] PDF : (e0bde47) invoices printing now done as page groups to keep the pagination relevant - [-] PDF : (3464ca0) fixed pagination block display - [-] PDF : (a788652) Moved note block to his own remplate - [-] PDF : (b5ef9f2) (re) added shipping box in invoice - - [-] FO : (331527c) Fix incorrect cart rules list in case of country restriction (PSCSX-7873) - [-] FO : (a343610) PSCSX-7449, fix parse error in AuthController.php - [-] FO : (42d8847) #PSCSX-5582 fix wrong displayed specific price on product detail - [-] FO : (755f77b) Fix warning if combinations are disabled - [-] FO : (05b701f) Fix combination price calculation with impact and reduction - [-] FO : (b1352d7) Fix JavaScript mistake in blocklayered.js - [-] FO : (8ee195a) fixed bug on payment module, check if defined $order object - - [-] CORE : (9870d84) use a cached cacert file for curl - [-] CORE : (deebce3) Fixed double preg_quote() - - [-] BO : (647eba0) Fix the display of the listing filters on the toolbar - [-] BO : (6e69c4a) Change only active state on bulk status change - [-] BO : (69b87a8) Fix incorrect shipping taxes in order slips (PSCSX-4881) - [-] BO : (44eb96c) Fix filter by category change not working after other actions. … - [-] BO : (76d53ac) add error message on upload theme bigger than post_max_size - - [-] LO : (011a2e5) Traditionnal Chinese for HK pack - - [-] TR : (948a3e5) language.xml - fix TW script - - [-] SECURITY : (cc49345) Fixes PSCSX-4841 Usage of ECB mode - - [-] CLASS : (7234efd) Alias / return false if feature is not active in aliasExists() - - [-] MO : (de7e9aa) bankwire / correct module name for translation - - - Improved/changed features: - - [*] CORE : (85e6025) Update swift mailer - [*] CORE : (81465fe) Add a fallback to curl when file_get_content() return an empty response - - [*] TR : (4b3ddf5) Update Polish installer - [*] TR : (62bbc16) feature.xml in Vietnamese - [*] TR : (1cce929) Update italian installer - [*] TR : (5319857) Improve Dutch meta info - - [*] CLASS : (ec03391) Hook / indicate which method to use for deprecated methods - - [*] FO : (999ff45) Removed template logic that is not needed - - - Added Features: - - [+] TR : (30c4adc) Adding Vietnamese installer - - - - - -#################################### -# v1.6.1.4 - (2016-01-06) -#################################### - - Fixed bugs: - - [-] CORE : (c243c8a) Fix ObjectModel error management on validation - [-] CORE : (508e1cd) Fix AdminTab PHP 7 compatibilty - [-] CORE : (355a4a7) Report of https://github.com/PrestaShop/PrestaShop/pull/3673 - [-] CORE : (0a07da9) fix #PSCSX-7007, notice in searchcron - [-] CORE : (13285fd) Fix PSCSX-6953, bad upload error check - - [-] TESTS : (b826568) removed tests for prestafraud module - - [-] BO : (c35d896) Fixed bug in HTMLTemplateInvoice prevents problems with invoice prefixs - [-] BO : (e71bdaa) fixed translation bug in prestashop addons modal - [-] BO : (48d9da7) Fixed upgrade index specific_price table - - [-] FO : (0eecc7a) Fix #PSCSX-7021, bad specific base price for combinations - [-] FO : (40717fa) Fix #PSCSX-7021, bad impact price / currency - [-] FO : (0bd1bdc) Fix robots.txt rules for default language URLs - [-] FO : (ed08594) Fix quantity discount table wont appear again after swith on combination without quantity discount - - - Improved/changed features: - - [*] PROJECT : (bcbec89) Improve PHP 7 compatibility - - [*] BO : (ad3c187) #PSCSX-6251 on product order add unit product price without tax - [*] BO : (06502f9) Dont restrict orders listing to addresses join - - [*] CORE : (94846bd) Fix #PSCSX-7015, Uploader setAcceptFiles case sensitive - - [*] FO : (83c7ee1) #PSCSX-5582 update price from discount when changing quantity - - -#################################### -# v1.6.1.3 - (2015-11-26) -#################################### - - Fixed bugs: - - [-] FIX : (e3eef33) Uncaught Error: Access to undeclared static property: Validate::$field - [-] FIX : (0ab3b7d) Uncaught Error: Access to undeclared static property: Validate::$field - - [-] BO : (c83e478) Revert from #4015 to allow longer meta - [-] BO : (f1d09d6) Fix flush of local cache when adding a new specific price (PSCSX-7184) - - [-] FO : (bbbd4b3) Add id_order to order_details link to work without JS - - [-] LO : (673d7fe) Fix Intra-EU VAT - - - - - -#################################### -# v1.6.1.2 - (2015-10-29) -#################################### - - Fixed bugs: - - [-] FO : Fix wrong date check in specific price (PSCSX-6942) - [-] FO : Fix performances issue with SpecificPrice (PSCSX-6942) - [-] FO : Fix undefined var when no combinations - [-] FO : Added missing hook for AdvancedEU on accessories - [-] FO : Fix #PSCSX-6995, bad redirection on cart when minimum amount for order - [-] FO : Fix performances issue with smarty custom - [-] FO : Fix bug #PSCSX-6938, bad validation when empty zipcode validation pattern - [-] FO : Metas in maintenance mode - [-] FO : Fix #PSCSX-6926, notice Undefined index: nb_products - [-] FO : Fix #PSCSX-6884, bad redirect when PS_CART_REDIRECT - [-] FO : Fix #PSCSX-6888, products links without correct anchor for attributes in shopping-cart - [-] FO : Fix bug #PSCSX-6884, could not add to cart in quickview - [-] FO : #PSCSX-5366, no localstorage with Safari private browsing - [-] FO : Fix #PSCSX-5053, Too much calls of findCombination again - [-] FO : Fix #PSCSX-5480, content hooked to 'productListReviews' is removed on dynamic list/grid update - [-] FO : Fix #PSCSX-5344, could not see available vouchers when changing quantities - [-] FO : Fix #PSCSX-5447, no validation on non multishop filed in multishop - [-] FO : Report of https://github.com/PrestaShop/PrestaShop/pull/3928 - [-] FO : Fix #PSCSX-5182, for newsletter flag for customer if previously registred as guet - [-] FO : fix when clicking filters labels, not checkbox. Fixed an #3337 reported on 1.6.1.x - [-] FO : Footer fix in default-bootstrap theme: nocache on copyright year #3351 reported on 1.6.1.x - [-] FO : #PSCSX-6820 part 2/2 - [-] FO : Fix bug #PSCSX-6770, bad redirection to my account in accordion footer - [-] FO : Fix #PSCSX-6749, OrderHistory multishop getCustomerOrders shared orders - [-] FO : Fix #PSCSX-6701, notice on customizedDatas - [-] FO : Fix #PSCSX-6699, Table 'ps_product_reductions' already exists - [-] FO : Fix #PSCSX-6661 Fatal error Property CustomerThread->id_order is not valid - [-] FO : Possible error Cannot read property 'iso_code' of undefined - [-] FO : Possible undefined function binduniform - [-] FO : Fix #PSCSX-5669, $errors_discount dead code, report of https://github.com/PrestaShop/PrestaShop/pull/3076 - [-] FO : Fix bug #PSCSX-4707, new products name in columns - [-] FO : Fix #PSCSX-4898, possible fatal error in products-comparison - [-] FO : Avoid possible undefined vars in global.js - [-] FO : minimum order value outside order steps - [-] FO : Fix #PSCSX-5445, take account of PS_SSL_ENABLED_EVERYWHERE in file manager config - [-] FO : Css fix #PSCSX-5408, TOS width on small devices - [-] FO : Fix #PSCSX-5319, dead code in product-list.tpl - [-] FO : Fix #PSCSX-5483, missing nofollow in pagination.tpl - [-] FO : Fix #PSCSX-5261, no alt on subcategories images - [-] FO : Avoid displaying payment message - [-] FO : Fix #PSCSX-6492, negative prices on product page - [-] FO : Fix issue with multishop / multilanguage tags - [-] FO : Fix #PSCSX-4899, Search alias for words containing hyphens fail - [-] FO : Fix current_url variable used in pagination - [-] FO : Fix #PSCSX-6582, could not change currency with PS_DETECT_COUNTRY - [-] FO : #PSCSX-5459 Add to cart button for accessories - - [-] CORE : cleanCompareProducts interval - [-] CORE : Could not edit a carrier, follow up https://github.com/PrestaShop/PrestaShop/pull/4094 - [-] CORE : Fix #PSCSX-7012, bad length for compagny field (address) for upgrade from < 1.5.2.0 - [-] CORE : #PSCSX-6970, fix typo in getCMSContent - [-] CORE : Undefined var follow up https://github.com/PrestaShop/PrestaShop/pull/4006 - [-] CORE : Could not disable third party modules - [-] CORE : #PSCFV-10112 notice Undefined index: host in classes/ConnectionsSource.php - [-] CORE : Fix #PSCSX-4768, too much call of Carrier::addDeliveryPrice - [-] CORE : Adding few casts to ValidateOrder - [-] CORE : Error in foreign field name - [-] CORE : Follow up https://github.com/PrestaShop/PrestaShop/pull/2509/files - [-] CORE : Report of https://github.com/PrestaShop/PrestaShop/pull/3964 - [-] CORE : Report of https://github.com/PrestaShop/PrestaShop/pull/3963 - [-] CORE : Fixed currency convertion - [-] CORE : Fix #PSCSX-5357, inconsistent cart rule country restriction - [-] CORE : Allow invoice template override - [-] CORE : Fix #PSCSX-6798, add index on search_index table - [-] CORE : Fix #PSCSX-6797, hard coded table name in configuration class - [-] CORE : Typo report of https://github.com/PrestaShop/PrestaShop/pull/3995 - [-] CORE : Fix #PSCSX-6719, bad cache on colors list on attribute deletion - [-] CORE : Again and again fix #PSCSX-6719, bad cache_default_attribute on attribute group deletion - [-] CORE : Fix #PSCSX-6814, bad sql query in Lanqguage::loadUpdateSQL() - [-] CORE : Order::hasDelivery new return type - [-] CORE : Fix #PSCSX-6755, Notice: Undefined variable: delivery_address in classes/pdf/HTMLTemplateOrderSlip.php - [-] CORE : Fix #PSCSX-6632, Property StockAvailable->id_product is empty - [-] CORE : Bad norm function getCountry - [-] CORE : Revert of https://github.com/PrestaShop/PrestaShop/pull/2509 - [-] CORE : Fix #PSCSX-6637, incorrect cart total - [-] CORE : Fix #PSCSX-5273 Reflect 6 decimals for product weight according db structure - [-] CORE : Fix case statement in HTMLTemplateInvoice - [-] CORE : Fix colon in switch statement - [-] CORE : Remove leftover symbol in Translate.php - [-] CORE : Stock synchronization fails in case of shared warehouse - [-] CORE : #PSCSX-6577, could not load bootstrap-sortable.js with Chrome - [-] CORE : DbMySQLi + socket - - [-] BO : Notice in AdminCustomers - [-] BO : Fix #PSCSX-7050, wrong pictures shown in AdminProducts - [-] BO : Fix bad usage of .html() instead of .text() in carrier_wizard.js - [-] BO : Added missing escape on legend field product form - [-] BO : Fix pagination, followup https://github.com/PrestaShop/PrestaShop/commit/dd3cf42354fc1a7cd08b6b9efe202b185bdf3239 - [-] BO : Show stock warning on products less then 0 - [-] BO : Fix PSCSX-6960 - AdminCustomerController, string now translatable - [-] BO : remove old warning icon if no customer found when search one in create order - [-] BO : Fix #PSCSX-6916, Bad redirect when deleting shopping cart rule in customer details view - [-] BO : Fix #PSCSX-6903, Exception on specific price amount import - [-] BO : Fix bug #PSCSX-6924, Property CustomerMessage->message is empty - [-] BO : Fix #PSCSX-6837, delete thumb on product import - [-] BO : Fix #PSCSX-6865 bad utm_campaign, notice: Undefined index: lang_iso - [-] BO : Fix #PSCSX-6860, customer groups - remove enable status on customers - [-] BO : Fix #PSCSX-6859, wrong redirect after editing customer - [-] BO : Fix #PSCSX-6805, confusion about private messages in AdminCustomerThreads - [-] BO : Fixed checking if module is trusted PSCSX-6883 - [-] BO : Fixed bug while testing module - [-] BO : Fix #PSCSX-5435, remove back button message of expired POST data - [-] BO : Fix meta description, follow up https://github.com/PrestaShop/PrestaShop/pull/4015 - [-] BO : Bad sql association for date_upd of product and categories, could not reorder - [-] BO : Partial report of https://github.com/PrestaShop/PrestaShop/pull/3853 - [-] BO : fixed bug Unable to translate header - [-] BO : Fix #PSCSX-6834 Enable product pack and product dematerialized for redirection product (Moved 301) - [-] BO : Fix #PSCSX-6834 Enable product pack and product dematerialized for accessories - [-] BO : fix column icon width - [-] BO : Fix #PSCSX-6663, bad table id after DND - [-] BO : Fix use of custom class with textarea (even if autoload_rte not set) - [-] BO : Fix #PSCSX-6801, AdminBackupControllerCore and timeout - [-] BO : Fix #PSCSX-6795, Catalog Rule for a specific shop do not save shop_id - [-] BO : Group by on currencies on AdminSpecificPriceRule - [-] BO : Fix #PSCSX-6667, bad action display when sub categories disabled - [-] BO : Fix #PSCSX-6753, parse serror when quotes in import file name - [-] BO : Fix #PSCSX-6804, could not bulk delete attributes - [-] BO : Fix #PSCSX-6752, bad id for email translations toggle - [-] BO : Fix #PSCSX-6743, possible Exception in product tabs loading - [-] BO : Fix #PSCSX-6723, could not re enable module on devices - [-] BO : Fix #PSCSX-6718, virtual product Duplicate entry - [-] BO : Fix #PSCSX-6687, commas in carrier prices wizard - [-] BO : Fix #PSCSX-6664, product date_upd when position change - [-] BO : Fix #PSCSX-6664, category date_upd when position change - [-] BO : Fix performance issue with tags - [-] BO : #PSCSX-6658, wrong escaping in helpers/form/form.tpl - [-] BO : undefined var in AdminProducts - [-] BO : Fix #PSCSX-6636 modules logo witdh - [-] BO : Fix #PSCSX-6629 typo Warehouse::$idintval - [-] BO : Fix #SCSX-6588, wrong "back o list" href on AdminCategories - [-] BO : name of select multiple in Form Helper TPL - [-] BO : Fix #PSCSX-5442 cart rules don't retain customer name/email on error - [-] BO : Fix issue with smarty lazy cache & timestamp (PSCSX-6601) - [-] BO : Fix issue with smarty lazy cache & timestamp - [-] BO : Fix #PSCSX-5271, notices on order statuses - [-] BO : Duplicate currencies in AdminCountries in multishop - [-] BO : Fix issue with cover image (PSCSX-6473) - [-] BO : Fix product import dates - [-] BO : Fix #PSCSX-6583 / You can now have a "from" date and a "to" date like '0000-00-00 00:00:00' - [-] BO : Pass empty firstname and lastname email vars to mail template - - [-] INSTALLER : Date format was American (cherry picked from commit 7609530fce25663160def3d4387987d4c957885e) - - [-] TR : Change 'Uitzonderlijk' into 'Openstaand' - [-] TR : #PSCSX-5938 Emails not copied into theme folder - - [-] IN : Wrong id_guest in cart.xml - [-] IN : Bad install value for delivery table - [-] IN : Fix #PSCSX-6700, could not install in Czech, missing translation for fixtures data, still needs translation to be done - - [-] WS : Manage multiple exclude filter values - - [-] CLASS : AdminController / Remove displayNoSmarty() method - [-] CLASS : Module / $live_edit declared but not used - [-] CLASS : Customization / Use getValue() instead of getRow() - [-] CLASS : Address / Use getValue() instead of getRow() in isUsed() method - [-] CLASS : Missing category param when update positions + duplicate call - [-] CLASS : Category / Use DB delete() method in deleteCategoriesFromShop() - [-] CLASS : Category / Use DB delete() method in cleanGroups() & cleanAssoProducts(); - [-] CLASS : Product / Use DB delete() method in cleanGroups() - [-] CLASS : Customer / Give the possibility to filter on active field in getCustomers() - [-] CLASS : Cart / Correct cache_key name for getOrderedCartRulesIds() - [-] CLASS : Product / Use DB delete() method in deleteAccessories() & deleteFromAccessories() methods - [-] CLASS : Product / Change getDefaultIdProductAttribute() method - [-] CLASS : Product / Change getIdProductAttributeMostExpensive() method - [-] CLASS : Product / Use null direclty instead of create new var as null - [-] CLASS : Product / Call orderbyPrice only if there are some results - - [-] MO : #PSCSX-6820 related - [-] MO : NM-188 Correct points on product load in loyalty - - [-] INSTALL : Fix possible duplicate hook - - [-] TEST : Removing PrestaFraud scoring test - - [-] PDF : #PSCSX-6569 Could not translate "Free Shipping" in pdf - - - Improved/changed features: - - [*] BO : #PSCFV-12359 #PSCSX-1257 product tab async loading - [*] BO : wording AdminCarrierWizard - typo - [*] BO : wording - thumbnail image - [*] BO : wording - assign vs affect - [*] BO : Add versioning to addJS to renew admin.js - [*] BO : Fix max width 96px on module logo on "not trusted module" popin. #3356 reported of 1.6.1.x - [*] BO : makes picking products easier - [*] BO : Fix #PSCSX-4024 removing extra sapace at end of product names and url rewrite - [*] BO : Fix #PSCSX-6132 Add search_contains in chosen init - [*] BO : Fix #PSCSX-6570, id_connections in last connections - [*] BO : #NM-305 add driver in AdminInformation - [*] BO : Meta title and description use textarea - - [*] CORE : SpecificPriceRule without conditions to id_product 0 instead of full products list - [*] CORE : Fix htmlentities in conf - [*] CORE : #PSCSX-3181, follow up https://gist.github.com/hereswhatidid/8c8edef106ee95138b03 implements data-keepinline for scripts not being defered - [*] CORE : Media::getMediaPath improved - [*] CORE : Fix #PSCSX-5772 & #PSCSX-4666, enable invoice number reset - [*] CORE : #PSCSX-3576, add category thumbnail - - [*] FO : theme.sql new demo address - [*] FO : Fix #PSCSX-5053, improve findCombination speed - [*] FO : Add InStock mdata when out of stock is OK - - [*] TR : update Swedish installer - [*] TR : Better consistency + improved readability - [*] TR : Translate placeholder imgs to Dutch - [*] TR : Translate login info mail to Dutch - [*] TR : Translated risk levels to Dutch (cherry picked from commit 1e6788f358bc850d3d22964839aaa885119c9be9) - [*] TR : Translated country list to Dutch (cherry picked from commit ea0cdff236936f6a5af3511c0f285dbda24983b6) - [*] TR : Swedish install files, few edits - [*] TR : Translate install xml files to Swedish - - [*] IN : fixtures, add some Czech translations - - [*] MO : Blocklanguages add hreflang and rel alternate to the links for a better SEO and avoid duplicate content - - [*] INSTALL : Alter ignore drop key is now generic and fix an 1.6.1.1 error - [*] INSTALL : The 1.6.1.1 indexes are now safely removed - - - - - -#################################### -# v1.6.1.1 - (2015-08-20) -#################################### - - Fixed bugs: - - [-] FO : Fix #NM-132 undefined var - [-] FO : Fix #PSCSX-6537 / show-right-column in body class - [-] FO : Fix bug #PSCSX-6517, could have edit with defer JS + missing closing tags + additionnal js loading in ajax from #PSCSX-2361 again - [-] FO : Fix #PSCSX-6520 Wrong product availability text on Price drop page - [-] FO : Fix bug #NM-579 Signing in does not change status in the top navbar - [-] FO : undefined var + could not add to cart without block cart top hooked - [-] FO : display only specific price by current combination - [-] FO : remove leftColumnBlocks var declaration in global.js - [-] FO : Fix #PSCSX-6504 / Productcomments and new global.js stars are not display correctly - [-] FO : no cart-summary.js on step 0 with minimu order error - [-] FO : #PSCSX-6432 fix bug while specific price start to 1 quantity and initial price to 0 - [-] FO : Fix #PSCSX-6236, search missing lowercase chars - [-] FO : Remove useless parenthesis - [-] FO : add colors to product list before the hook "actionProductListModifier" - [-] FO : Fix #PSCSX-2183 bdisplay of one_phone_at_least in OPC - [-] FO : Fix temp table on slave issue - [-] FO : Can not see addresses when already registred as guest in OPC - [-] FO : Fix missing cart rule lines in shopping cart - [-] FO : Fix bug #PSCSX-5153, bad free shipping display when carrier out of range - [-] FO : Fix #PSCSX-5820, close new acount form - [-] FO : Fix #PSCSX-4346 correct ajax display of reduction - [-] FO : Fix #PSCSX-4346 specific price amount tax - [-] FO : #PSCSX-6427, link to favorites product in my accoutn with https - [-] FO : Fix bug #PSCSX-4260, "Free shipping" for virtual products, undefined $virtualCart - [-] FO : Fix #PSCSX-6316, display bug with uniform and selects in left column - [-] FO : #PSCSX-6341 fix bug when apply cart rule with free shipping - [-] FO : Fix #PSCSX-5038 order state on split order - [-] FO : Fix #PSCSX-5038 quantity on order detail of split order - [-] FO : #PSCSX-5065, backward compat - [-] FO : auth error if $back is not defined - [-] FO : $order is as class variable - [-] FO : theme retro-compatibility regarding the CGV - [-] FO : #PSCSX-6227 ajax search add hook for stats search - [-] FO : Fix #PSCSX-6345 handle id_product_attribute - [-] FO : Fixed bug showing errors in manufacturer list - [-] FO : Wrong discount table for combination - [-] FO : Invalid combination price in case of ecotax - [-] FO : Fix #PSCSX-6275, issue with attribute anchor separator - [-] FO : Fix #PSCSX-4340, wrong tax label display in cart summary - [-] FO : Fix bug #PSCSX-6103, no product images in cart when combinations feature not active - [-] FO : Fix #PSCSX-6165, root category in breadcrumb - [-] FO : Fix #PSCSX-4340, wrong tax label display in blockcart layer - [-] FO : NOTICE: non-existing property - [-] FO : fixed wrong postcode regexp validation - [-] FO : Fix wrong statement close - - [-] BO : Fix memcached test (PSCSX-6348) - [-] BO : Fix issue with multiple trees loaded on the same page (PSCSX-6268) - [-] BO : Hightlight default combination into Product Quantities tab - [-] BO : Fix #PSCSX-6474, bad display of inputs in orders - [-] BO : #PSCSX-6437 Product import, each image downloaded twice. - [-] BO : Fix placeholder clear event in AdminCustomerThreadsController - [-] BO : Fix #PSCSX-6474 currency input in orders - [-] BO : Fix bug with AdminOrdersController when trying to edit a product - [-] BO : Fix cover image issues (PSCSX-6473) - [-] BO : #PSCSX-6458 KPI not loaded - [-] BO : #PSCSX-6441 small css fix - [-] BO : #PSCSX-6385 remove ability to order position while filtering - [-] BO : Fix filters errors - [-] BO : #PSCSX-6453 Import duplicates parent categories if it does not exist - [-] BO : Set file as required in attachment form - [-] BO : badges in quickview modal - [-] BO : Fix #PSCSX-6457 "Maintenance Mode" disappears in Modules page - [-] BO : Fix #PSCSX-5992, bad display of carriers list - [-] BO : #PSCSX-5968, unable to add payment choosing specific date - [-] BO : #PSCSX-5931 type input field 'file' with multiple option to true - [-] BO : Correct chosen-sprite.png link - [-] BO : Fix #PSCSX-6380 , spaces in products' image url when importing - [-] BO : #PSCSX-6290 Datetimepicker hidden by header - [-] BO : again Fix #PSCSX-5821, after filtering products issue with category - [-] BO : Fix bug #PSCSX-5996, ordering Attributes Groups - [-] BO : Fix KPI refresh functions - [-] BO : #PSCSX-6308 refacto order slip PDF generation - [-] BO : Fix #PSCSX-5407 correct cart summary total - [-] BO : Usage of defined Referrer variable - [-] BO : Could not export default theme in dev mode because of .sass-cache - [-] BO : Fix #PSCSX-4214, "Recommended modules" on Localization Tab - [-] BO : Fix timeout on customer modules list - [-] BO : #PSCSX-6305 Display filters in back-office on mobile - [-] BO : Fix use of custom class with textarea (even if autoload_rte not set) - [-] BO : Remove duplicate bought and must have modules - [-] BO : Fixed bug in partial refund, not executed the hook actionOrderSlipAdd #PSCSX-6287 - [-] BO : Fix #PSCSX-6367, unable to see status of vouchers related to customer - [-] BO : Fix #PSCSX-6361, in employee admin theme list name, each theme name is "default" - [-] BO : Use original PS Addons width for modules icons (57 px) - [-] BO : Fix bought module that can't be installed because of the "must have" type - [-] BO : Fix getModuleTranslation() - [-] BO : Fix #PSCSX-5821, after filtering products issue with category tree filter - [-] BO : avoid redirection on addons registration - [-] BO : Fix #PSCSX-5390, duplicate in modules exceptions - [-] BO : libxml_clear_errors cache issue in AdminController Modules list - [-] BO : Set stock option the same for all context shops when creating a new product - [-] BO : Fix #PSCSX-6234, could not update category position to first position - [-] BO : Fix #PSCSX-6206, bad redirection on Transform a guest into a customer - [-] BO : Incorrect price TI initialisation in case of ecotax - [-] BO : Fix #PSCSX-6160, could not select hook in Admin Modules Positions - [-] BO : FixBug #PSCSX-6208 - Profiling redirection error - [-] BO : Fix unknown iso_user JS var while in AdminTab - [-] BO : Fix sign out exception with debug profiling - [-] BO : Fix bug #PSCSX-6246 - Wrong cart status filter - [-] BO : FIX #PSCSX-6158, notice in modules list - [-] BO : Fix #PSCSX-5365 id_shop not well set - [-] BO : Fix #PSCSX-5738 duplicate product on supply order - [-] BO : Fix #PSCSX-5883 need to check if multistore is enable - [-] BO : Fix #PSCSX-6138, CustomerMessage->message length (244826) must be between 0 and 65000 - [-] BO : Fix #PSCSX-5844, Property CustomerMessage->message is not valid - [-] BO : Fix bug #PSCSX-6154 - Customer filter in orders - [-] BO : Media::addJsDefL should be called in admin controllers with addslashes and no htmlentities - [-] BO : More flexible way to declare click function - [-] BO : Fix #PSCSX-6087 "Maintenance Mode" disappears in Modules page - [-] BO : Fix #PSCSX-6086, wrong version in header - [-] BO : Fix bug #NM-513 - JavaScript error on modules using AdminTab - [-] BO : Change bulk modules update - [-] BO : Fix bug #PSCSX-6052 - Invalid date_upd in import - [-] BO : Fix tree issue - [-] BO : Fix #PSCSX-5615 tinymce allow all html element - - [-] PDF : Order slip Tax detail computation fix. #PSCSX-6408 - [-] PDF : EN to dejavusans - [-] PDF : Fix shop_address missing in old order_invoice outside of upgrade process - [-] PDF : smarty warning for Order slip. #PSCSX-6245 - [-] PDF : Fix #PSCSX-5167, bad date display in delivery slip - [-] PDF : Need to use product_reference that depend of attribute - - [-] CORE : #PSCSX-5164 notices - [-] CORE : Fix PSCSX-6544, typo in replaceAccentedChars for letter B - [-] CORE : Fix bug #PSCSX-5912, actionCategoryDelete on all sub tree - [-] CORE : Avoid a division by zero that produces warning - [-] CORE : Fix #PSCSX-6484, fatal error on PrestaShopCollection::getAll - [-] CORE : Fix #PSCSX-6478 module override with explicit dependencies in ctor - [-] CORE : wrong currency on partial voucher using a different currency in an order - [-] CORE : Fix namespace usage in new Core Stock management for PHP 5.2 until v1.7 - [-] CORE : Warning on getAvailableCarrierList - [-] CORE : Fix #PSCSX-6420, Notice: : id_country in Country.php - [-] CORE : Fix #PSCSX-6425, phpdoc on orderSlip - [-] CORE : Fix #PSCSX-5471 don't need to update if continue before - [-] CORE : Fix #PSCSX-5611 delete advanced stock row when delete product - [-] CORE : Fix #PSCSX-6395, Exception Property StockMvt->id_supply_order is not valid - [-] CORE : Fix Configuration::updateValue method result - [-] CORE : Fix inserting HTML configuration variable first time - [-] CORE : Remove non-existent params from comment - [-] CORE : Fix #PSCSX-5629 Meta don't scan override dir to check new front controller - [-] CORE : Fix #PSCSX-6081 add those db field in the definition - [-] CORE : Fix missing backquotes on Employee - [-] CORE : Fix #PSCSX-6153 id shop not well set so don't cache - [-] CORE : Correct bug were supply order where validate etc.. but stock not added - [-] CORE : Tools::str_replace doesn't exist - [-] CORE : [-] fix #PSCSX-5826, sql db exception on features and attributes positions cleaning - [-] CORE : Added missing hook on update logo from AdminTheme - [-] CORE : Try to fix #PSCSX-5167, no payment mention in delivery pdf when no invoice - [-] CORE : Fix #PSCSX-3480 htaccess generation with media server - [-] CORE : Module class now add 4 space instead of a tab - [-] CORE : Correct regex that remove ligne when not needed - [-] CORE : Fix #PSCSX-5882 delete loose the information out of stock etc.. - [-] CORE : bad property name. image_type doesn't exist anymore. Replaced by imageType - [-] CORE : Fix translation issue with html entities - [-] CORE : Fix PHP 5.2 issue on FileSystem Core class - [-] CORE : fix SSL in CMS links - - [-] IN : Fix #PSCSX-6535 + PSCSX-6346 adding id_cart to id_product_2 key in specific_price - [-] IN : Fix bug #NM-474, no hook on header for blocktopmenu on theme copy - [-] IN : Fix #PSCSX-6133, Property TaxRulesGroup->date_add is not valid - - [-] LO : fix translation ES tabs - [-] LO : correct Sweden flag - - [-] WS : Fix current_state not filterable on Orders (#PSCSX-5578) - - [-] TEST : Clear hook_alias cache - [-] TEST : You mustn't do assertion on setup or teardown - [-] TEST : add setUpBeforeClass() - - [-] PROJECT : Fixed constant name in Order::getTotalPaid - [-] PROJECT : getBrightness() with a short $hex (e.g.: #FFF) - - [-] MO : update.gitmodules / add .git to sendtoafriend url - - [-] CLASS : DbQuery / Add rightJoin() and rightOuterJoin() methods - [-] CLASS : OrderDetail / Use DbQuery->letJoin() instead of join with LEFT JOIN inside - - - Deprecated methods: - - [~] BO : filters on Prices will match only Equality instead of %LIKE%. #PSCSX-6248 - - [~] PROJECT : Product packs: specific case to decrease stocks of a pack if one product is sold separately, as #PSCSX-4759 - - - Improved/changed features: - - [*] MO : Fix #NM-423, no h2 in blockcart - - [*] BO : wording for gross margin KPIs - [*] BO : modules new categories "Customer Reviews", "Social & Community". - [*] BO : AdminDeliverySlip - wording - [*] BO : AdminEmployeesController;php - wording for newsletter subscription - [*] BO : meta.php - error message punctuation - [*] BO : Remove version under the employee drop down - [*] BO : updated BG tab translations - [*] BO : add SR translation for tabs - [*] BO : add ID translation for tabs - [*] BO : add HU translation for tabs - [*] BO : add CS translation for tabs - [*] BO : fix PSCSX-6378, add NL translation for tabs - [*] BO : Fix #PSCSX-6299, Bo redirect_after on AdminSearch - [*] BO : Update wording about SSL - [*] BO : Allow SSL in _PS_HOST_MODE_ - [*] BO : #PSCSX-6240 dashbord add tax excl to sales and cart value - [*] BO : #PSCSX-6226 get real margin in stats best category - [*] BO : #PSCSX-6227 display tax ecxlude on average order/cart value - [*] BO : add bower/saas files to gitignore - [*] BO : Fix #PSCSX-6134, redirect_after on adminCustomers - [*] BO : Missing "readonly" attribute in form.tpl for "textarea" input type (Helpform) - [*] BO : fix #PSCSX-6096 untranslate string in orders pdf - - [*] LO : updated ES tab translation - [*] LO : fix PSCSX-5812 - updated tab translations - - [*] PROJECT : gitignore rules to ignore more mails template changes - [*] PROJECT : Added TODO comment about Configuration::updateValue method - [*] PROJECT : Convert indentation to spaces - - [*] CLASSES : Add actions hooks when customer logs in / out - - [*] PDF : Added page number and page count in footer - [*] PDF : #PSCSX-6166, Fix base price for specific price in % - [*] PDF : Shop address missing for old orders < 1.6.1 as #PSCSX-6169 - - [*] FO : Better display of carrier logo during order process - [*] FO : Remove inline css from js for advancedPayment option - [*] FO : Using class instead of id for displaying AEUC hook - - [*] CORE : Partial Fix #PSCSX-6135, include users proper defines file - - - Added Features: - - [+] TESTS : Add unit tests for PrestaShop#2867 minifyCSS() && ReplaceByAbsoluteURL() - - - - - -#################################### -# v1.6.1.0 - (2015-07-03) -#################################### - - Fixed bugs: - - [-] BO : Fix PSCSX-5831 - [-] BO : Fix PSCSX-5831 - [-] BO : Fix #PSCSX-6063 php warning while display cart without customizable product - [-] BO : Fixed wrong front url to live edit when rewrite url activate and also one lang configured - [-] BO : Fix bug #PSCSX-6029 - Wrong php warning message - [-] BO : fix missing check for new memcached extension - [-] BO : fix issue with cat creation (PSCSX-5899) - [-] BO : fix issue with image resize when original is smaller than target - [-] BO : fix issue with image resize when original is smaller than target - [-] BO : fix issue with image resize when original is smaller than target - [-] BO : fix issue with image resize when original is smaller than target - [-] BO : fix warning - [-] BO : Fix bug #PSCSX-5364 - Missing retina option - [-] BO : unsued if statement - [-] BO : FixBug #PSCSX-1996 - Impossible to disable shop url - [-] BO : #PSCSX-5898 wording - [-] BO : fix bug when generate Pdf delivery slip, wrong constant called with customized products - [-] BO : FixBug #PSCSX-5913 - Wrong column name - [-] BO : Fix PSCSX-1856, Labels edition in multishop - [-] BO : The design is broken with a width between 767px and 924px - [-] BO : HelperForm / Add possibilities to show success, warning and error messages - [-] BO : statuspage JS is included if _PS_HOST_MODE_ is true - [-] BO : Render Payment Add button correctly - [-] BO : Fix bug #PSCSX-5326, Bad product thumb in order - [-] BO : Install specific modules for hosted shops - [-] BO : Fix category creation during import - [-] BO : #PSCSX-5221 Filter contact services by shop - [-] BO : FixBug #PSCSX-5713 - Undefined javascript variable - [-] BO : disable modals on login page, fix some php notices - [-] BO : fixed bug while adding new customized product into new order - [-] BO : Fix apcu compatibility - [-] BO : Fix PSCSX-1856, edit images legends - [-] BO : Fix issue with multiple cart rules - [-] BO : Fix Catalog prices rules shop group context - [-] BO : Fix bug #PSCSX-5170, 'undefined' on images upload, reverts dummy https://github.com/PrestaShop/PrestaShop/commit/295b070c332565e5406d015ef28e880316ed5092 - [-] BO : Correct appearance of warning - [-] BO : Fix #PSCSX-5453 correct processsave return - [-] BO : Fix #PSCSX-5462 correct employee permission - [-] BO : Fix issue with checkbox / radio button in the category tree - [-] BO : #PSCSX-5589 Dashboard filter date update - [-] BO : Display rights warnings while updating a language pack - [-] BO : Fix generation of export themes - [-] BO : Fix memleak during thumbnail generation - [-] BO : Fix #PSCSX-5402, bad alias in list filters thanks @vox_fr - [-] BO : Fix #PSCSX-5440 avoid too much quantity refund in standard refund - [-] BO : Fix #PSCSX-5401, limit results for customers search. - [-] BO : Fix bug #PSCSX-5209 Bad positions moving on other page than first page - [-] BO : Fix parent category selection in category creation - [-] BO : Updated forums link - [-] BO : Allow lazy cache to properly handle partial cache_id struct [-] FO : Add cache_id to createTemplate for product-list-colors - [-] BO : verifyMail less strict on extention length - [-] BO : make name accept PERCENT_PRODUCT_OUT_OF_STOCK_EXPIRE - [-] BO : make name accept PERCENT_PRODUCT_OUT_OF_STOCK_EXPIRE - [-] BO : Fix #PSCSX-5159, warnings on tabs - [-] BO : Correct search for catalog product - [-] BO : Fix #PSCSX-2093 undefined $order - [-] BO : Change getBaseURI call in filemanager config - [-] BO : fix PSCSX-5171 - missing translation in PDF - [-] BO : fix variable initialization - [-] BO : fix PSCSX-5141 - bad URL - [-] BO : remove type column in adminorders shipping table - [-] BO : fix issues with ajax tree loading when creating a new category - [-] BO : Fix #PSCSX-5006, duplicated addresses on customers import + could not update addresses - [-] BO : AdminOrderPreferences - typo - [-] BO : #PSCSX-4326, currency unit to real currency - [-] BO : Fix NaN on price if ecotax isn't set - [-] BO : Fix #PSCSX-4272 Groups customers list does not filter by shop - [-] BO : set proper shop context during search indexing (PSCSX-5097) - [-] BO : Fix bug #PSCSX-4358, could not reorder features and attributes when no deltas, satart position at 0 like catetgories, products, cms // follow up https://github.com/PrestaShop/PrestaShop/commit/6a4cd46540097e899a6c85617d608d4d81bd3b52 - [-] BO : Fix default_on value update - [-] BO : Fix tree category issue - [-] BO : Fix tree category issue - [-] BO : Fix tree category issue - [-] BO : Fix filter category tree issue - [-] BO : AdminImportController / Use $var with Shop::isFeatureActive() - [-] BO : Bad display of module description in moudle lists - [-] BO : AdminImportController / Use $var with Tools::getValue() - [-] BO : Fix #PSCSX-5076, wrong positions in category list - [-] BO : Fix tree category issue - [-] BO : Fix #PSCSX-5006, add forceid to addresses import thanks @indesign47 - [-] BO : PaymentModule -> missing translation - [-] BO : AdminImagesController -> missing translations - [-] BO : Fix bug #PSCSX-5062 Return slip pdf is not possible to download from back-office - [-] BO : Languages form.tpl - remove extra space - [-] BO : AdminEmails / FIX #PSCSX-5000 - [-] BO : wording harmonization - back office - part 2 - [-] BO : wording harmonization - back office - part 1 - [-] BO : Uploader -> add translations - [-] BO : HelperImageUploader -> add translation - [-] BO : Fix attribute indexing (PSCSX-5028). Adapted from PR #2651 - [-] BO : Speed up search indexing & reduce memory usage (PSCSX-5039) - [-] BO : Fix bug #PSCSX-5027, bad cast in Helperlist - [-] BO : Fix bug #PSCSX-4917, missing multiple_value_separator - [-] BO : fix count optimizations - [-] BO : Add back the ability to fully flush the template cache - [-] BO : Notice follow up https://github.com/PrestaShop/PrestaShop/commit/1f0a89954adf849f5670788e4e3394a44ec05eca - [-] BO : Fix Syntax Error - [-] BO : Fix #PSCSX-4929 display problem of media server - [-] BO : Fix #PSCSX-4948 correct filemanager url in multistore - [-] BO : Fixed bug importing products when id_shop_default not 1 - [-] BO : Fix #PSCSX-4787 - [-] BO : AdminModules - Fix #PSCSX-4988 - [-] BO : Fix bug #PSCSX-4733 again - [-] BO : Fix bug #PSCSX-4762 again - [-] BO : Fix bug #PSCSX-4733, threads statuses not translated - [-] BO : Fix warnings #PSCSX-4734 in AdminRequestSql - [-] BO : Fix bug #PSCSX-4735, add list_id to sql forms - [-] BO : Removed hardcoded BO header image - [-] BO : Fix #PSCSX-4736, cms default order by - [-] BO : Fix bug #PSCSX-4762, too much calls of getQuantityAvailableByProduct - [-] BO : don't try to update the routes if the rewriting is disabled (the form is empty) - [-] BO : Fix Lithuanian encoding in PDF generation - [-] BO : Fix #PSCSX-4939 mistake - [-] BO : AdminimportController -> addresses add DNI - [-] BO : AdminimportController -> addresses add DNI - [-] BO : Fix delivery time string language in carrier wizard summary. - [-] BO : Fix Bug #PSCSX-4829 - [-] BO : Fix #PSCSX-4791 disabling advanced stock - [-] BO : Fix warehouse when add stock - [-] BO : AdminimportController -> active manufacturer - [-] BO : Sync stock reference, EAN13, UPC codes when updating product and attributes - [-] BO : Fix function return value in write context in AdminWarehousesController.php - [-] BO : Fix #PSCSX-4738 check if field is send - [-] BO : Fix bug #PSCFV-12280 again, page number on processStatus button - [-] BO : Fix bug #PSCFV-12280, save product list, last part - [-] BO : Fix bug #PSCFV-12280, save product list, first part - [-] BO : Fix #PSCSX-3035 swap helper update and add if no selected carrier for warehouse - [-] BO : Fix bug #PSCSX-4747, Inactive customers when creating new orders - [-] BO : unused variable - [-] BO : FixBig #PSCSX-4690, #PSCSX-4676 - Fixing Credit slip - Part 2 - [-] BO : FixBig #PSCSX-4690, #PSCSX-4676 - Fixing Credit slip - Part 1 - [-] BO : Missing Warehouse product location on ajax order product calls - [-] BO : Fix #PSCSX-4676 (follow up all in ti or te) - [-] BO : FixBug #PSCSX-4667 - Do not refund if no quantity selected - [-] BO : AdminShopUrlController -> add translation - [-] BO : AdminShopGroupController -> add translation - [-] BO : AdminShopController -> add translation - [-] BO : Hide field for totally refunded product line - [-] BO : Show free shipping vouchers in manual order - [-] BO : Fix bug #PSCSX-4635, could delete own account in bulk - [-] BO : Notices + bad merge - [-] BO : #PSCSX-4625, could not see errors on adding quicklink - [-] BO : avoid duplicates on modules image thumbnail - [-] BO : Fix #PSCSX-4567 Instant stock - [-] BO : Fix #PSCSX-4496 send if add tax or not to voucher - [-] BO : FileManager -> add translations - [-] BO : TinyMCE -> add translations - [-] BO : missing double quote breaking addons modal title and link - [-] BO : The new products now gets the group reductions correctly - [-] BO : Fix #PSCSX-4267 standard refund mess up - [-] BO : Fix Bug #PNM-3248 - Missing module name in warning - [-] BO : Fix #PSCSX-4479 correct media server if settings was badly update - [-] BO : Fix #PSCSX-4320 typo error - [-] BO : Fix #PSCSX-4320 typo error - [-] BO : Fix #PSCSX-4453 check float instead of int - [-] BO : Fix #PSCSX-4452 correct sync for product in pack - [-] BO : Fix #PSCSX-4538, typo - [-] BO : Fix the wrong impact price value on the combinations list helper. - [-] BO : Fix bug #PSCSX-4504, could not delete order retunr states - [-] BO : Fix #PSCSX-4504, bad display for two last default order states - [-] BO : #PSCSX-4479 Add check on htaccess before changing media servers - [-] BO : Fix #PSCSX-3408 : Carrier package size are tested for every rotation possible - [-] BO : Avoid slash in special product name - [-] BO : #PSCSX-3031 - Set KPI for product out of stock - [-] BO : fixed bug : it's not possible to override some AdminCartRulesController template - [-] BO : Permit "product_rule_group.tpl" override - [-] BO : FixBug #PSCSX-385 Cart rule does get minimum amount with correct curreny - [-] BO : FixBug #PSCFV-8755 - Total shipping amount include in second voucher - [-] BO : FixBug domain not added to regenerated htaccess - [-] BO : Error display on image legend length - [-] BO : Remove percentage char from frendly url - [-] BO : Clear CCC cache after media servers update - [-] BO : Image upload, legend can be null - [-] BO : fixed bug loading wrong root category in AdminCategoriesController - [-] BO : Undefined on image upload, revert of https://github.com/PrestaShop/PrestaShop/commit/48b7a49b1aea34a2def355ffec1d4c08dfdbdfd6 - [-] BO : Double separator in function createTemplate() - - [-] CORE : Fix PHP 5.2 Dispatcher warning on parse_url() - [-] CORE : Fix issue with PHP 5.2 and func_get_args() - [-] CORE : Fix bug PSCSX-5952 - HTMLPurifier_Config not loaded - [-] CORE : Fix issue with advancedeucompliance dependencies and Tax label display - [-] CORE : FixBug #PSCSX-5698 - Wrong ecotax calculation - [-] CORE : Module. New line replacement - [-] CORE : Fix issue with OPC/Advanced payment API when deleting all products from cart - [-] CORE : Fix #PSCSX-5724 avoid db exception - [-] CORE : Fix payment and carrier for OPC mode - [-] CORE : Fixed duplicate in EmailLister::getAvailableMails() - [-] CORE : follow up 4b21903 : we got this wrong, need to start from the tax incl price - [-] CORE : Fixed OPC with AdvancedPaymentOptions activated - [-] CORE : Fix #NM-345 need to recalculte depth only when current depth as changed - [-] CORE : Fixed issue with newInstanceArgs on PHP 5.3 - [-] CORE : Fix potential issue on EmailLister::getAvailableMails() - [-] CORE : Fix testing Exception handler - [-] CORE : Fix #PSCSX-5605 correct query syntax error - [-] CORE : Fix potential sql issue while using reserved SQL keywords - [-] CORE : Fix #PSCSX-1919 allow