Added: Confirmation modal when deleting cart rules and while changes credit slip status
This commit is contained in:
@@ -296,9 +296,51 @@ class AdminSlipControllerCore extends AdminController
|
||||
return '--';
|
||||
}
|
||||
|
||||
public function ajaxProcessInitSlipStatusModal()
|
||||
{
|
||||
$response = array('success' => false);
|
||||
if ($idOrderSlip = Tools::getValue('id_order_slip')) {
|
||||
if (Validate::isLoadedObject($objOrderSlip = new OrderSlip($idOrderSlip, $this->context->language->id))) {
|
||||
$objOrder = new Order($objOrderSlip->id_order);
|
||||
$objCustomer = new Customer($objOrder->id_customer);
|
||||
|
||||
$modalConfirmDelete = $this->createTemplate('modal_confirm_update.tpl');
|
||||
$modalConfirmDelete->assign(array(
|
||||
'customer' => $objCustomer,
|
||||
'order' => $objOrder,
|
||||
'orderSlip' => $objOrderSlip,
|
||||
'link' => $this->context->link
|
||||
));
|
||||
$tpl = $this->createTemplate('modal.tpl');
|
||||
$tpl->assign(array(
|
||||
'modal_id' => 'moduleConfirmUpdate',
|
||||
'modal_class' => 'modal-md',
|
||||
'modal_content' => $modalConfirmDelete->fetch(),
|
||||
'modal_actions' => array(
|
||||
array(
|
||||
'type' => 'button',
|
||||
'class' => 'process_update btn-primary',
|
||||
'label' => $this->l('Change status'),
|
||||
),
|
||||
),
|
||||
|
||||
));
|
||||
$response['modalHtml'] = $tpl->fetch();
|
||||
}
|
||||
}
|
||||
$response['success'] = true;
|
||||
|
||||
die(Tools::jsonEncode($response));
|
||||
}
|
||||
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
Media::addJsDef(
|
||||
array(
|
||||
'admin_order_slip_tab_link' => $this->context->link->getAdminLink('AdminSlip'),
|
||||
)
|
||||
);
|
||||
$this->addJS(_PS_JS_DIR_.'admin/slips.js');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user