protected function processBulkDelete() { $can_bulk = true; if (is_array($this->boxes) && !empty($this->boxes)) { foreach ($this->boxes as $id_lang) { $object = new Language((int) $id_lang); if (!$this->checkDeletion($object)) { return false; } if (!$this->deleteNoPictureImages((int) $object->id)) { $this->errors[] = Tools::displayError('An error occurred while deleting the object.') . ' <b>' . $this->table . '</b> '; return false; } } } return parent::processBulkDelete(); }
protected function processBulkDelete() { if ($this->tabAccess['delete'] === '1') { $cats_ids = array(); foreach (Tools::getValue($this->table . 'Box') as $id_category) { $category = new Category((int) $id_category); if (!$category->isRootCategoryForAShop()) { $cats_ids[$category->id] = $category->id_parent; } } if (parent::processBulkDelete()) { $this->setDeleteMode(); foreach ($cats_ids as $id => $id_parent) { $this->processFatherlessProducts((int) $id_parent); } return true; } else { return false; } } else { $this->errors[] = Tools::displayError('You do not have permission to delete here.'); } }
/** * Delete multiple items * * @return boolean true if succcess */ protected function processBulkDelete() { if (is_array($this->boxes) && !empty($this->boxes)) { $deleted = false; foreach ($this->boxes as $id) { $to_delete = new Address((int) $id); if ($to_delete->isUsed()) { $deleted = true; break; } } $this->deleted = $deleted; } return parent::processBulkDelete(); }
protected function processBulkDelete() { if (is_array($this->boxes) && !empty($this->boxes)) { foreach ($this->boxes as $id_employee) { if ((int) $this->context->employee->id == (int) $id_employee) { $this->restrict_edition = true; return $this->canModifyEmployee(); } } } return parent::processBulkDelete(); }
/** * Overrides parent to delete items from sublist * * @return mixed */ public function processBulkDelete() { // If we are deleting attributes instead of attribute_groups if (Tools::getIsset('attributeBox')) { $this->className = 'Attribute'; $this->table = 'attribute'; $this->boxes = Tools::getValue($this->table . 'Box'); } $result = parent::processBulkDelete(); // Restore vars $this->className = 'AttributeGroup'; $this->table = 'attribute_group'; return $result; }
protected function processBulkDelete() { $this->_setDeletedMode(); parent::processBulkDelete(); }
protected function processBulkDelete() { if (is_array($this->boxes) && !empty($this->boxes)) { foreach ($this->boxes as $id_currency) { $object = new Currency((int) $id_currency); if (!$this->checkDeletion($object)) { return false; } } } return parent::processBulkDelete(); }
public function postProcess() { if (Tools::isSubmit($this->table . 'Orderby') || Tools::isSubmit($this->table . 'Orderway')) { $this->filter = true; } if (Tools::isSubmit('submitAddorder_return_state') || Tools::isSubmit('submitAddorder_return_state')) { $id_order_return_state = Tools::getValue('id_order_return_state'); // Create Object OrderReturnState $order_return_state = new OrderReturnState((int) $id_order_return_state); $order_return_state->color = Tools::getValue('color'); $order_return_state->name = array(); $languages = Language::getLanguages(false); foreach ($languages as $language) { $order_return_state->name[$language['id_lang']] = Tools::getValue('name_' . $language['id_lang']); } // Update object if (!$order_return_state->save()) { $this->errors[] = Tools::displayError('An error has occurred: Can\'t save the current order\'s return state.'); } else { Tools::redirectAdmin(self::$currentIndex . '&conf=4&token=' . $this->token); } } if (Tools::isSubmit('submitBulkdeleteorder_return_state')) { $this->className = 'OrderReturnState'; $this->table = 'order_return_state'; $this->boxes = Tools::getValue('order_return_stateBox'); parent::processBulkDelete(); } if (Tools::isSubmit('deleteorder_return_state')) { $id_order_return_state = Tools::getValue('id_order_return_state'); // Create Object OrderReturnState $order_return_state = new OrderReturnState((int) $id_order_return_state); if (!$order_return_state->delete()) { $this->errors[] = Tools::displayError('An error has occurred: Can\'t delete the current order\'s return state.'); } else { Tools::redirectAdmin(self::$currentIndex . '&conf=1&token=' . $this->token); } } if (Tools::isSubmit('submitAdd' . $this->table)) { $this->deleted = false; // Disabling saving historisation $_POST['invoice'] = (int) Tools::getValue('invoice_on'); $_POST['logable'] = (int) Tools::getValue('logable_on'); $_POST['send_email'] = (int) Tools::getValue('send_email_on'); $_POST['hidden'] = (int) Tools::getValue('hidden_on'); $_POST['shipped'] = (int) Tools::getValue('shipped_on'); $_POST['paid'] = (int) Tools::getValue('paid_on'); $_POST['delivery'] = (int) Tools::getValue('delivery_on'); if (!$_POST['send_email']) { $languages = Language::getLanguages(false); foreach ($languages as $language) { $_POST['template_' . $language['id_lang']] = ''; } } return parent::postProcess(); } else { if (Tools::isSubmit('delete' . $this->table)) { $order_state = new OrderState(Tools::getValue('id_order_state'), $this->context->language->id); if (!$order_state->isRemovable()) { $this->errors[] = $this->l('For security reasons, you cannot delete default order statuses.'); } else { return parent::postProcess(); } } else { if (Tools::isSubmit('submitBulkdelete' . $this->table)) { foreach (Tools::getValue($this->table . 'Box') as $selection) { $order_state = new OrderState((int) $selection, $this->context->language->id); if (!$order_state->isRemovable()) { $this->errors[] = $this->l('For security reasons, you cannot delete default order statuses.'); break; } } if (!count($this->errors)) { return parent::postProcess(); } } else { return parent::postProcess(); } } } }
protected function processBulkDelete() { if ($this->access('delete')) { $cats_ids = array(); foreach (Tools::getValue($this->table . 'Box') as $id_category) { $category = new Category((int) $id_category); if (!$category->isRootCategoryForAShop()) { $cats_ids[$category->id] = $category->id_parent; } } if (parent::processBulkDelete()) { $this->setDeleteMode(); foreach ($cats_ids as $id => $id_parent) { $this->processFatherlessProducts((int) $id_parent); } return true; } else { return false; } } else { $this->errors[] = $this->trans('You do not have permission to delete this.', array(), 'Admin.Notifications.Error'); } }
protected function processBulkDelete() { $cats_ids = array(); foreach (Tools::getValue($this->table . 'Box') as $id_category) { $category = new Category((int) $id_category); if (!$category->isRootCategoryForAShop()) { $cats_ids[$category->id] = $category->id_parent; } } if (parent::processBulkDelete()) { $this->setDeleteMode(); foreach ($cats_ids as $id => $id_parent) { $this->processFatherlessProducts((int) $id_parent); } return true; } else { return false; } }