Fixed: order details action permission issue

This commit is contained in:
Amit sharma
2026-01-09 17:08:55 +05:30
parent 1474ec2c61
commit 5013b27777
2 changed files with 8 additions and 2 deletions

View File

@@ -1110,7 +1110,7 @@
<div class="panel panel-vouchers">
<div class="panel-heading">
<span><i class="icon-tag"></i> &nbsp;{l s='Voucher'}</span>
{if $can_edit && $order->total_paid > 0}
{if $can_edit && $order->total_paid > 0 && $cartRuleAccess['add'] === 1}
<button id="add_voucher" class="btn btn-primary pull-right" type="button" >
<i class="icon-ticket"></i> {l s='Add new voucher'}
</button>

View File

@@ -1028,7 +1028,11 @@ class AdminOrdersControllerCore extends AdminController
$taxRulesGroups = TaxRulesGroup::getTaxRulesGroups(true);
$smartyVars['taxRulesGroups'] = $taxRulesGroups;
$smartyVars['invoices_collection'] = $objOrder->getInvoicesCollection();
$smartyVars['customServiceAllowed'] = Configuration::get('PS_ALLOW_CREATE_CUSTOM_SERVICES_IN_BOOKING');
$serviceProductAccess = Profile::getProfileAccess(
$this->context->employee->id_profile,
Tab::getIdFromClassName('AdminNormalProducts')
);
$smartyVars['customServiceAllowed'] = $serviceProductAccess['add'] && Configuration::get('PS_ALLOW_CREATE_CUSTOM_SERVICES_IN_BOOKING');
$smartyVars['current_id_lang'] = $this->context->language->id;
$this->context->smarty->assign($smartyVars);
@@ -3602,6 +3606,7 @@ class AdminOrdersControllerCore extends AdminController
$objProduct = new Product();
$hotelStandaloneProducts = $objProduct->getServiceProducts(null, Product::SELLING_PREFERENCE_HOTEL_STANDALONE);
$standaloneProducts = $objProduct->getServiceProducts(null, Product::SELLING_PREFERENCE_STANDALONE);
$cartRuleAccess = Profile::getProfileAccess($this->context->employee->id_profile, (int)Tab::getIdFromClassName('AdminCartRules'));
$this->tpl_view_vars = array(
'hotelStandaloneProducts' => $hotelStandaloneProducts,
@@ -3670,6 +3675,7 @@ class AdminOrdersControllerCore extends AdminController
'iso_code_lang' => $this->context->language->iso_code,
'id_lang' => $this->context->language->id,
'can_edit' => ($this->tabAccess['edit'] === 1),
'cartRuleAccess' => $cartRuleAccess,
'current_id_lang' => $this->context->language->id,
'invoices_collection' => $order->getInvoicesCollection(),
'not_paid_invoices_collection' => $order->getNotPaidInvoicesCollection(),