Merge branch 'develop' into gli-3047

This commit is contained in:
azhar bhat
2026-08-14 12:23:25 +05:30
59 changed files with 1526 additions and 57 deletions

View File

@@ -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);

View File

@@ -0,0 +1,123 @@
<?php
/**
* 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
*/
class AdminGuestRegistrationControllerCore extends AdminController
{
public function __construct()
{
$this->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();
}
}

View File

@@ -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);

View File

@@ -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.'),