[-] BO : fixed #PSCFV-2176 - missing confirmation when deleting product

This commit is contained in:
tDidierjean
2012-05-03 12:51:09 +00:00
parent b86cfebbf4
commit 79da53f097
2 changed files with 4 additions and 3 deletions
@@ -2039,13 +2039,14 @@ class AdminProductsControllerCore extends AdminController
'short' => 'Delete',
'href' => $this->context->link->getAdminLink('AdminProducts').'&id_product='.(int)$product->id.'&deleteproduct',
'desc' => $this->l('Delete this product'),
'confirm' => 1);
'confirm' => 1,
'js' => 'if (confirm('.$this->l('\'Delete product?\'').')){return true;}else{event.preventDefault();}'
);
// adding button for duplicate this product
if ($this->tabAccess['add'] && $this->display != 'add')
$this->toolbar_btn['duplicate'] = array(
'short' => 'Duplicate',
//'href' => $this->context->link->getAdminLink('AdminProducts').'&id_product='.$product->id.'&duplicateproduct',
'desc' => $this->l('Duplicate'),
'confirm' => 1,
'js' => 'if (confirm(\''.$this->l('Also copy images').' ?\')) document.location = \''.$this->context->link->getAdminLink('AdminProducts').'&id_product='.(int)$product->id.'&duplicateproduct\'; else document.location = \''.$this->context->link->getAdminLink('AdminProducts').'&id_product='.(int)$product->id.'&duplicateproduct&noimage=1\';'