/** * */ public function initContent() { parent::initContent(); $module = new now_block_customer_references(); $this->context->smarty->assign('module_dir', $module->module_uri . 'uploads/'); $this->context->smarty->assign('nowBlockCustomerReferencesList', NowBlockCustomerReferences::getItems()); $this->setTemplate('list-customers-references.tpl'); }
/** * Right Column * @param $params * @return mixed */ public function hookRightColumn($params) { if (Configuration::get('NOW_CUST_REFERENCE_ENABLE')) { if (Context::getContext()->controller->php_self == 'product') { require_once _PS_MODULE_DIR_ . 'now_product_type/classes/NowProductTypeProduct.php'; $nowProductTypeProduct = NowProductTypeProduct::getObjectByProductId(Tools::getValue('id_product')); if (!$nowProductTypeProduct || !Validate::isLoadedObject($nowProductTypeProduct)) { // Si il s'agit d'un type de produit, on n'affiche pas le module return false; } } // Lists of items $aItems = NowBlockCustomerReferences::getItems(); $this->context->smarty->assign(array('module_dir' => $this->module_uri . 'uploads/', 'aItems' => $aItems)); return $this->context->smarty->fetch($this->module_dir . 'views/templates/hook/footer.tpl'); } }
/** * @return bool */ protected function processBulkDelete() { if (is_array($this->boxes) && !empty($this->boxes)) { foreach ($this->boxes as $iIdNowBlockCustomerReferences) { $oNowBlockCustomerReferences = new NowBlockCustomerReferences((int) $iIdNowBlockCustomerReferences); if (!$oNowBlockCustomerReferences->deleteImage()) { $this->errors[] = Tools::displayError('An error occurred while deleting image of the object (NowBlockCustomerReferences).') . ' <b>' . $this->table . '</b> '; return false; } } } return parent::processBulkDelete(); }
/** * @see ObjectModel::delete() */ public function delete() { if (!parent::delete()) { return false; } NowBlockCustomerReferences::cleanPositions(); }