[-] BO : #PSCFI-4484 - Add historisation of the order status

This commit is contained in:
mDeflotte committed 2012-01-03 16:06:18 +00:00
1 parent 06d9e22156
commit c53e1fcfec
5 files changed
+10 -1

No files matched your search

+4
View File
@@ -59,6 +59,9 @@ class OrderStateCore extends ObjectModel
/** @var boolean Paid */ /** @var boolean Paid */
public $paid; public $paid;
/** @var boolean True if carrier has been deleted (staying in database as deleted) */
public $deleted = 0;
/** /**
* @see ObjectModel::$definition * @see ObjectModel::$definition
*/ */
@@ -76,6 +79,7 @@ class OrderStateCore extends ObjectModel
'delivery' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'delivery' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
'hidden' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'hidden' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
'paid' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'paid' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
'deleted' => array('type' => self::TYPE_BOOL, 'validade' => 'isBool'),
// Lang fields // Lang fields
'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 64), 'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 64),
@@ -32,7 +32,7 @@ class AdminStatusesControllerCore extends AdminController
$this->table = 'order_state'; $this->table = 'order_state';
$this->className = 'OrderState'; $this->className = 'OrderState';
$this->lang = true; $this->lang = true;
$this->deleted = false; $this->deleted = true;
$this->colorOnBackground = false; $this->colorOnBackground = false;
$this->context = Context::getContext(); $this->context = Context::getContext();
$this->imageType = 'gif'; $this->imageType = 'gif';
@@ -502,6 +502,7 @@ class AdminStatusesControllerCore extends AdminController
if (Tools::isSubmit('submitAdd'.$this->table)) if (Tools::isSubmit('submitAdd'.$this->table))
{ {
$this->deleted = false; // Disabling saving historisation
$_POST['invoice'] = (int)Tools::getValue('invoice_on'); $_POST['invoice'] = (int)Tools::getValue('invoice_on');
$_POST['logable'] = (int)Tools::getValue('logable_on'); $_POST['logable'] = (int)Tools::getValue('logable_on');
$_POST['send_email'] = (int)Tools::getValue('send_email_on'); $_POST['send_email'] = (int)Tools::getValue('send_email_on');
+1
View File
@@ -1252,6 +1252,7 @@ CREATE TABLE `PREFIX_order_state` (
`delivery` tinyint(1) UNSIGNED NOT NULL default '0', `delivery` tinyint(1) UNSIGNED NOT NULL default '0',
`shipped` tinyint(1) UNSIGNED NOT NULL default '0', `shipped` tinyint(1) UNSIGNED NOT NULL default '0',
`paid` tinyint(1) UNSIGNED NOT NULL default '0', `paid` tinyint(1) UNSIGNED NOT NULL default '0',
`deleted` tinyint(1) UNSIGNED NOT NULL default '0',
PRIMARY KEY (`id_order_state`) PRIMARY KEY (`id_order_state`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; ) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
+2
View File
@@ -1,2 +1,4 @@
SET NAMES 'utf8'; SET NAMES 'utf8';
ALTER TABLE `PREFIX_order_state` ADD COLUMN `deleted` tinyint(1) UNSIGNED NOT NULL default '0' AFTER `paid`;
+1
View File
@@ -1252,6 +1252,7 @@ CREATE TABLE `PREFIX_order_state` (
`delivery` tinyint(1) UNSIGNED NOT NULL default '0', `delivery` tinyint(1) UNSIGNED NOT NULL default '0',
`shipped` tinyint(1) UNSIGNED NOT NULL default '0', `shipped` tinyint(1) UNSIGNED NOT NULL default '0',
`paid` tinyint(1) UNSIGNED NOT NULL default '0', `paid` tinyint(1) UNSIGNED NOT NULL default '0',
`deleted` tinyint(1) UNSIGNED NOT NULL default '0',
PRIMARY KEY (`id_order_state`) PRIMARY KEY (`id_order_state`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; ) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;