From 1f971275a0f252fb26a1556bbe4f91c62899c8be Mon Sep 17 00:00:00 2001
From: Marion Muszynski ';
if ($this->delete)
- echo '
'.Tools::displayError('You cannot disable/enable all of the items.');
+ } else {
+ $result = true;
+ foreach(Tools::getValue($this->table.'Box') as $id) {
+ $toChange = new $this->className($id);
+ $toChange->active = (int)$active;
+ $result = $result AND $toChange->update();
+ }
+
+ if ($result) {
+ $id_category = Tools::getValue('id_category');
+ $category_url = empty($id_category) ? '' : '&id_category='.$id_category;
+
+ Tools::redirectAdmin($currentIndex.'&conf=2&token='.$token.$category_url);
+ }
+ $this->_errors[] = Tools::displayError('An error occurred while deleting selection.');
+ }
+ } else {
+ $this->_errors[] = Tools::displayError('You must select at least one element to delete.');
+ }
+ }
+
/* @Override - Antadis, delete some images in same time */
elseif (Tools::isSubmit('deleteImages') && Tools::getValue('ids_image'))
{
@@ -1910,8 +1942,12 @@ class AdminProducts extends AdminTab
echo '';
global $cookie;
+ echo '