// SupplyOrder reference is now unique

This commit is contained in:
bMancone
2011-12-28 14:58:55 +00:00
parent a0b4675bec
commit 57415ee135
3 changed files with 34 additions and 0 deletions
@@ -936,6 +936,18 @@ class AdminSupplyOrdersControllerCore extends AdminController
$this->_errors[] = Tools::displayError($this->l('You do not have the required permission to add a supply order.'));
if (Tools::isSubmit('submitBulkUpdatesupply_order_detail') && !($this->tabAccess['edit'] === '1'))
$this->_errors[] = Tools::displayError($this->l('You do not have the required permission to edit an order.'));
// checks if supply order reference is unique
if (Tools::isSubmit('reference'))
{
$ref = pSQL(Tools::getValue('reference'));
if (SupplyOrder::exists($ref))
$this->_errors[] = Tools::displayError($this->l('The reference has to be unique.'));
}
if ($this->_errors)
return;
// Global checks when add / update a supply order
if (Tools::isSubmit('submitAddsupply_order') || Tools::isSubmit('submitAddsupply_orderAndStay'))
{