diff --git a/classes/Hook.php b/classes/Hook.php index 5d67ecf60..15da8d080 100644 --- a/classes/Hook.php +++ b/classes/Hook.php @@ -27,10 +27,26 @@ class HookCore extends ObjectModel { - /** @var string Name and Title */ + /** + * @var string Hook name identifier + */ public $name; + + /** + * @var string Hook title (displayed in BO) + */ public $title; + /** + * @var string Hook description + */ + public $description; + + /** + * @var bool Is this hook usable with live edit ? + */ + public $live_edit = false; + /** * @see ObjectModel::$definition */ @@ -38,8 +54,11 @@ class HookCore extends ObjectModel 'table' => 'hook', 'primary' => 'id_hook', 'fields' => array( - 'name' => array('type' => self::TYPE_STRING, 'validate' => 'isHookName', 'required' => true, 'size' => 32), - 'title' => array('type' => self::TYPE_STRING), + 'name' => array('type' => self::TYPE_STRING, 'validate' => 'isHookName', 'required' => true, 'size' => 32), + 'title' => array('type' => self::TYPE_STRING), + 'description' => array('type' => self::TYPE_HTML), + 'position' => array('type' => self::TYPE_BOOL), + 'live_edit' => array('type' => self::TYPE_BOOL), ), ); @@ -48,9 +67,6 @@ class HookCore extends ObjectModel protected static $_hook_modules_cache_exec = null; static $_hook_alias = null; - - - /** * Preload hook alias list * @@ -110,7 +126,6 @@ class HookCore extends ObjectModel return ($result ? $result['id_hook'] : false); } - /** * Return Hooks List * @@ -124,7 +139,6 @@ class HookCore extends ObjectModel '.($position ? 'WHERE h.`position` = 1' : '')); } - /** * Preload hook modules cache * @@ -164,7 +178,6 @@ class HookCore extends ObjectModel return true; } - /** * Return Hooks List * @@ -182,8 +195,6 @@ class HookCore extends ObjectModel return $list; } - - /** * Get Hook Module Cache Exec, testing hook name and retrocompatible hook name * @@ -207,8 +218,6 @@ class HookCore extends ObjectModel return false; } - - /** * Execute modules for specified hook * @@ -358,8 +367,6 @@ class HookCore extends ObjectModel return $return; } - - public static function orderConfirmation($id_order) { if (Validate::isUnsignedId($id_order)) @@ -426,10 +433,6 @@ class HookCore extends ObjectModel return Hook::exec('updateCarrier', array('id_carrier' => $id_carrier, 'carrier' => $carrier)); } - - - - /** * Return hook ID from name * @@ -452,7 +455,6 @@ class HookCore extends ObjectModel return ($result ? $result['id_hook'] : false); } - /** * Called when quantity of a product is updated. * @@ -470,47 +472,67 @@ class HookCore extends ObjectModel 'orderStatus' => $orderStatus)); } + /** + * @deprecated 1.5.0 + */ public static function updateQuantity($product, $order = null) { Tools::displayAsDeprecated(); return Hook::exec('updateQuantity', array('product' => $product, 'order' => $order)); } + /** + * @deprecated 1.5.0 + */ public static function productFooter($product, $category) { Tools::displayAsDeprecated(); return Hook::exec('productFooter', array('product' => $product, 'category' => $category)); } + /** + * @deprecated 1.5.0 + */ public static function productOutOfStock($product) { Tools::displayAsDeprecated(); return Hook::exec('productOutOfStock', array('product' => $product)); } + /** + * @deprecated 1.5.0 + */ public static function addProduct($product) { Tools::displayAsDeprecated(); return Hook::exec('addProduct', array('product' => $product)); } + /** + * @deprecated 1.5.0 + */ public static function updateProduct($product) { Tools::displayAsDeprecated(); return Hook::exec('updateProduct', array('product' => $product)); } + /** + * @deprecated 1.5.0 + */ public static function deleteProduct($product) { Tools::displayAsDeprecated(); return Hook::exec('deleteProduct', array('product' => $product)); } + /** + * @deprecated 1.5.0 + */ public static function updateProductAttribute($id_product_attribute) { Tools::displayAsDeprecated(); return Hook::exec('updateProductAttribute', array('id_product_attribute' => $id_product_attribute)); } - } diff --git a/install-dev/sql/db.sql b/install-dev/sql/db.sql index e42394889..5f60bfbac 100644 --- a/install-dev/sql/db.sql +++ b/install-dev/sql/db.sql @@ -813,7 +813,6 @@ CREATE TABLE `PREFIX_hook` ( `description` text, `position` tinyint(1) NOT NULL default '1', `live_edit` tinyint(1) NOT NULL default '0', - `is_native` tinyint(1) NOT NULL default '0', PRIMARY KEY (`id_hook`), UNIQUE KEY `hook_name` (`name`) ) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; diff --git a/install-dev/sql/upgrade/1.5.0.1.sql b/install-dev/sql/upgrade/1.5.0.1.sql index bf8f2c05e..c45b16954 100644 --- a/install-dev/sql/upgrade/1.5.0.1.sql +++ b/install-dev/sql/upgrade/1.5.0.1.sql @@ -544,8 +544,6 @@ ALTER TABLE `PREFIX_orders` ADD COLUMN `id_warehouse` int(10) unsigned DEFAULT 0 ALTER TABLE `PREFIX_cart` ADD COLUMN `order_reference` varchar(9) AFTER `id_cart`; ALTER TABLE `PREFIX_cart` ADD COLUMN `delivery_option` varchar(100) AFTER `id_carrier`; -ALTER TABLE `PREFIX_hook` ADD `is_native` TINYINT( 1 ) NOT NULL DEFAULT '0'; - ALTER TABLE `PREFIX_tax` ADD COLUMN `account_number` VARCHAR(64) NOT NULL; /* PHP:add_new_tab(AdminAttributeGenerator, fr:Générateur de déclinaisons|es:Combinations generator|en:Combinations generator|de:Combinations generator|it:Combinations generator, -1); */; diff --git a/install-new/data/db_structure.sql b/install-new/data/db_structure.sql index e42394889..5f60bfbac 100644 --- a/install-new/data/db_structure.sql +++ b/install-new/data/db_structure.sql @@ -813,7 +813,6 @@ CREATE TABLE `PREFIX_hook` ( `description` text, `position` tinyint(1) NOT NULL default '1', `live_edit` tinyint(1) NOT NULL default '0', - `is_native` tinyint(1) NOT NULL default '0', PRIMARY KEY (`id_hook`), UNIQUE KEY `hook_name` (`name`) ) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; diff --git a/install-new/data/xml/hook.xml b/install-new/data/xml/hook.xml index 7a9ee0e4e..0d43c07ab 100644 --- a/install-new/data/xml/hook.xml +++ b/install-new/data/xml/hook.xml @@ -1,5 +1,11 @@ + + + + + + displayPayment @@ -432,11 +438,4 @@ Display extra informations inside the "my account" block - - - - - - - diff --git a/install-new/upgrade/sql/1.5.0.1.sql b/install-new/upgrade/sql/1.5.0.1.sql index 41a35141d..dc0179f1b 100644 --- a/install-new/upgrade/sql/1.5.0.1.sql +++ b/install-new/upgrade/sql/1.5.0.1.sql @@ -493,6 +493,4 @@ ALTER TABLE `PREFIX_specific_price` ADD `id_product_attribute` INT UNSIGNED NOT ALTER TABLE `PREFIX_specific_price` DROP INDEX `id_product`; ALTER TABLE `PREFIX_specific_price` ADD INDEX `id_product` (`id_product`, `id_product_attribute`, `id_shop`, `id_currency`, `id_country`, `id_group`, `from_quantity`, `from`, `to`); -ALTER TABLE `PREFIX_hook` ADD `is_native` TINYINT( 1 ) NOT NULL DEFAULT '0'; - /* PHP:add_new_tab(AdminAttributeGenerator, fr:Générateur de combinaisons|es:Combinations generator|en:Combinations generator|de:Combinations generator|it:Combinations generator, 1); */;