// Fixed revision 13573
This commit is contained in:
@@ -51,7 +51,7 @@ class AdminAddressesControllerCore extends AdminController
|
||||
$countries = Country::getCountries($this->context->language->id);
|
||||
foreach ($countries as $country)
|
||||
$this->countries_array[$country['id_country']] = $country['name'];
|
||||
|
||||
|
||||
$this->fieldsDisplay = array(
|
||||
'id_address' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
|
||||
'firstname' => array('title' => $this->l('First name'), 'width' => 120, 'filter_key' => 'a!firstname'),
|
||||
@@ -187,24 +187,42 @@ class AdminAddressesControllerCore extends AdminController
|
||||
}
|
||||
else if ($addr_field_item == 'lastname')
|
||||
{
|
||||
if (isset($customer) &&
|
||||
!Tools::isSubmit('submit'.strtoupper($this->table)) &&
|
||||
Validate::isLoadedObject($customer) &&
|
||||
!Validate::isLoadedObject($this->object))
|
||||
$default_value = $customer->lastname;
|
||||
else
|
||||
$default_value = '';
|
||||
|
||||
$temp_fields[] = array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('Last name'),
|
||||
'name' => 'lastname',
|
||||
'size' => 33,
|
||||
'required' => true,
|
||||
'hint' => $this->l('Invalid characters:').' 0-9!<>,;?=+()@#"�{}_$%:<span class="hint-pointer"> </span>'
|
||||
'hint' => $this->l('Invalid characters:').' 0-9!<>,;?=+()@#"�{}_$%:<span class="hint-pointer"> </span>',
|
||||
'default_value' => $default_value,
|
||||
);
|
||||
}
|
||||
else if ($addr_field_item == 'firstname')
|
||||
{
|
||||
if (isset($customer) &&
|
||||
!Tools::isSubmit('submit'.strtoupper($this->table)) &&
|
||||
Validate::isLoadedObject($customer) &&
|
||||
!Validate::isLoadedObject($this->object))
|
||||
$default_value = $customer->firstname;
|
||||
else
|
||||
$default_value = '';
|
||||
|
||||
$temp_fields[] = array(
|
||||
'type' => 'text',
|
||||
'label' => $this->l('First name'),
|
||||
'name' => 'firstname',
|
||||
'size' => 33,
|
||||
'required' => true,
|
||||
'hint' => $this->l('Invalid characters:').' 0-9!<>,;?=+()@#"�{}_$%:<span class="hint-pointer"> </span>'
|
||||
'hint' => $this->l('Invalid characters:').' 0-9!<>,;?=+()@#"�{}_$%:<span class="hint-pointer"> </span>',
|
||||
'default_value' => $default_value,
|
||||
);
|
||||
}
|
||||
else if ($addr_field_item == 'address1')
|
||||
@@ -254,11 +272,11 @@ class AdminAddressesControllerCore extends AdminController
|
||||
'label' => $this->l('Country:'),
|
||||
'name' => 'id_country',
|
||||
'required' => false,
|
||||
'default_value' => (int)$this->context->country->id,
|
||||
'options' => array(
|
||||
'query' => Country::getCountries($this->context->language->id),
|
||||
'id' => 'id_country',
|
||||
'name' => 'name',
|
||||
'preselect_country' => true,
|
||||
)
|
||||
);
|
||||
$temp_fields[] = array(
|
||||
@@ -272,17 +290,9 @@ class AdminAddressesControllerCore extends AdminController
|
||||
'name' => 'name',
|
||||
)
|
||||
);
|
||||
|
||||
$this->fields_value['id_country'] = Configuration::get('PS_COUNTRY_DEFAULT');
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($customer) && !Tools::isSubmit('submit'.strtoupper($this->table)) && Validate::isLoadedObject($customer) && !Validate::isLoadedObject($this->object))
|
||||
{
|
||||
$this->fields_value['lastname'] = $customer->lastname;
|
||||
$this->fields_value['firstname'] = $customer->firstname;
|
||||
}
|
||||
|
||||
// merge address format with the rest of the form
|
||||
array_splice($this->fields_form['input'], 3, 0, $temp_fields);
|
||||
|
||||
@@ -373,7 +383,7 @@ class AdminAddressesControllerCore extends AdminController
|
||||
Tools::redirectAdmin(Tools::getValue('back').'&conf=4');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function processAdd($token)
|
||||
{
|
||||
if (Tools::getValue('submitFormAjax'))
|
||||
|
||||
@@ -76,9 +76,10 @@ class AdminCmsContentControllerCore extends AdminController
|
||||
|
||||
if ($this->display == 'edit_category')
|
||||
$this->content .= $this->adminCMSCategories->renderForm();
|
||||
elseif ($this->display == 'edit_page')
|
||||
else if ($this->display == 'edit_page')
|
||||
$this->content .= $this->adminCMS->renderForm();
|
||||
elseif ($this->display == 'view_page'){}
|
||||
else if ($this->display == 'view_page')
|
||||
$fixme = 'fixme';// @FIXME
|
||||
else
|
||||
{
|
||||
$id_cms_category = (int)(Tools::getValue('id_cms_category'));
|
||||
@@ -112,14 +113,14 @@ class AdminCmsContentControllerCore extends AdminController
|
||||
|| isset($_GET['updatecms_category'])
|
||||
|| isset($_GET['addcms_category']))
|
||||
$this->display = 'edit_category';
|
||||
elseif (((Tools::isSubmit('submitAddcms') || Tools::isSubmit('submitAddcmsAndStay')) && count($this->adminCMS->errors))
|
||||
else if (((Tools::isSubmit('submitAddcms') || Tools::isSubmit('submitAddcmsAndStay')) && count($this->adminCMS->errors))
|
||||
|| isset($_GET['updatecms'])
|
||||
|| isset($_GET['addcms']))
|
||||
$this->display = 'edit_page';
|
||||
else
|
||||
{
|
||||
$this->display = 'list';
|
||||
$this->id_cms_category = (int)(Tools::getValue('id_cms_category'));
|
||||
$this->id_cms_category = (int)Tools::getValue('id_cms_category');
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('submitDelcms')
|
||||
@@ -129,7 +130,7 @@ class AdminCmsContentControllerCore extends AdminController
|
||||
|| Tools::isSubmit('viewcms')
|
||||
|| (Tools::isSubmit('statuscms') && Tools::isSubmit('id_cms')) && (Tools::isSubmit('position') && !Tools::isSubmit('id_cms_category_to_move')))
|
||||
$this->adminCMS->postProcess();
|
||||
elseif (Tools::isSubmit('submitDelcms_category')
|
||||
else if (Tools::isSubmit('submitDelcms_category')
|
||||
|| Tools::isSubmit('submitAddcms_categoryAndBackToParent')
|
||||
|| Tools::isSubmit('submitAddcms_category')
|
||||
|| isset($_GET['deletecms_category'])
|
||||
|
||||
@@ -53,7 +53,7 @@ class AdminCmsControllerCore extends AdminController
|
||||
$this->_join = '
|
||||
LEFT JOIN `'._DB_PREFIX_.'cms_category` c ON (c.`id_cms_category` = a.`id_cms_category`)';
|
||||
$this->_select = 'a.position ';
|
||||
$this->_filter = 'AND c.id_cms_category = '.(int)($this->_category->id);
|
||||
$this->_filter = 'AND c.id_cms_category = '.(int)$this->_category->id;
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
@@ -231,7 +231,7 @@ class AdminCmsControllerCore extends AdminController
|
||||
Configuration::updateValue('PS_CONDITIONS', 0);
|
||||
Configuration::updateValue('PS_CONDITIONS_CMS_ID', 0);
|
||||
}
|
||||
$cms = new CMS((int)(Tools::getValue('id_cms')));
|
||||
$cms = new CMS((int)Tools::getValue('id_cms'));
|
||||
$cms->cleanPositions($cms->id_cms_category);
|
||||
if (!$cms->delete())
|
||||
$this->errors[] = Tools::displayError('An error occurred while deleting object.').' <b>'.$this->table.' ('.Db::getInstance()->getMsgError().')</b>';
|
||||
|
||||
@@ -405,16 +405,6 @@ class AdminCustomerThreadsControllerCore extends AdminController
|
||||
$this->errors[] = Tools::displayError('An error occurred, your message was not sent. Please contact your system administrator.');
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
if (Tools::isSubmit('submitGeneral'.$this->table))
|
||||
{
|
||||
p($_POST);
|
||||
|
||||
die('toto');
|
||||
//PS_SAV_IMAP_OPT
|
||||
}
|
||||
*/
|
||||
|
||||
return parent::postProcess();
|
||||
}
|
||||
|
||||
@@ -456,11 +456,11 @@ class AdminManufacturersControllerCore extends AdminController
|
||||
'label' => $this->l('Country:'),
|
||||
'name' => 'id_country',
|
||||
'required' => false,
|
||||
'default_value' => (int)$this->context->country->id,
|
||||
'options' => array(
|
||||
'query' => Country::getCountries($this->context->language->id),
|
||||
'id' => 'id_country',
|
||||
'name' => 'name',
|
||||
'preselect_country' => true,
|
||||
)
|
||||
);
|
||||
$form['input'][] = array(
|
||||
|
||||
@@ -124,11 +124,11 @@ class AdminStatesControllerCore extends AdminController
|
||||
'label' => $this->l('Country:'),
|
||||
'name' => 'id_country',
|
||||
'required' => false,
|
||||
'default_value' => (int)$this->context->country->id,
|
||||
'options' => array(
|
||||
'query' => Country::getCountries($this->context->language->id, false, true),
|
||||
'id' => 'id_country',
|
||||
'name' => 'name',
|
||||
'preselect_country' => true,
|
||||
),
|
||||
'desc' => $this->l('Country where state, region or city is located')
|
||||
),
|
||||
|
||||
@@ -180,11 +180,11 @@ class AdminStoresControllerCore extends AdminController
|
||||
'label' => $this->l('Country:'),
|
||||
'name' => 'id_country',
|
||||
'required' => true,
|
||||
'default_value' => (int)$this->context->country->id,
|
||||
'options' => array(
|
||||
'query' => Country::getCountries($this->context->language->id),
|
||||
'id' => 'id_country',
|
||||
'name' => 'name',
|
||||
'preselect_country' => true,
|
||||
)
|
||||
),
|
||||
array(
|
||||
|
||||
@@ -139,11 +139,11 @@ class AdminSuppliersControllerCore extends AdminController
|
||||
'label' => $this->l('Country:'),
|
||||
'name' => 'id_country',
|
||||
'required' => true,
|
||||
'default_value' => (int)$this->context->country->id,
|
||||
'options' => array(
|
||||
'query' => Country::getCountries($this->context->language->id, false),
|
||||
'id' => 'id_country',
|
||||
'name' => 'name',
|
||||
'preselect_country' => true,
|
||||
),
|
||||
'desc' => $this->l('Country where the state, region or city is located')
|
||||
),
|
||||
|
||||
@@ -44,7 +44,7 @@ class AdminSupplyOrdersControllerCore extends AdminController
|
||||
$this->identifier = 'id_supply_order';
|
||||
$this->lang = false;
|
||||
$this->is_template_list = false;
|
||||
$this->multishop_context = Shop::CONTEXT_ALL;
|
||||
$this->multishop_context = Shop::CONTEXT_ALL;
|
||||
|
||||
$this->addRowAction('updatereceipt');
|
||||
$this->addRowAction('changestate');
|
||||
@@ -805,6 +805,10 @@ class AdminSupplyOrdersControllerCore extends AdminController
|
||||
$helper->override_folder = 'supply_orders_receipt_history/';
|
||||
$helper->toolbar_btn = $this->toolbar_btn;
|
||||
|
||||
$helper->ajax_params = array(
|
||||
'display_product_history' => 1,
|
||||
);
|
||||
|
||||
$helper->currentIndex = self::$currentIndex.$action;
|
||||
|
||||
// display these global order informations
|
||||
@@ -1451,7 +1455,7 @@ class AdminSupplyOrdersControllerCore extends AdminController
|
||||
public function ajaxProcess()
|
||||
{
|
||||
// tests if an id is submit
|
||||
if (Tools::isSubmit('id'))
|
||||
if (Tools::isSubmit('id') && !Tools::isSubmit('display_product_history'))
|
||||
{
|
||||
// overrides attributes
|
||||
$this->identifier = 'id_supply_order_history';
|
||||
@@ -1524,14 +1528,14 @@ class AdminSupplyOrdersControllerCore extends AdminController
|
||||
|
||||
echo Tools::jsonEncode(array('use_parent_structure' => false, 'data' => $content));
|
||||
}
|
||||
else if (Tools::isSubmit('id_supply_order_detail'))
|
||||
else if (Tools::isSubmit('id') && Tools::isSubmit('display_product_history'))
|
||||
{
|
||||
$this->identifier = 'id_supply_order_receipt_history';
|
||||
$this->table = 'supply_order_receipt_history';
|
||||
$this->display = 'list';
|
||||
$this->lang = false;
|
||||
$lang_id = (int)$this->context->language->id;
|
||||
$id_supply_order_detail = (int)Tools::getValue('id_supply_order_detail');
|
||||
$id_supply_order_detail = (int)Tools::getValue('id');
|
||||
|
||||
unset($this->fieldsDisplay);
|
||||
$this->fieldsDisplay = array(
|
||||
@@ -2023,14 +2027,13 @@ class AdminSupplyOrdersControllerCore extends AdminController
|
||||
$manager = StockManagerFactory::getManager();
|
||||
foreach ($items as $item)
|
||||
{
|
||||
$diff = 0;
|
||||
$diff = (int)$threshold;
|
||||
|
||||
if ($supply_order->is_template != 0)
|
||||
{
|
||||
$real_quantity = (int)$manager->getProductRealQuantities($item['id_product'], $item['id_product_attribute'], $supply_order->id_warehouse, true);
|
||||
$diff = (int)$threshold - (int)$real_quantity;
|
||||
}
|
||||
else
|
||||
$diff = (int)$threshold;
|
||||
|
||||
if ($diff > 0)
|
||||
{
|
||||
@@ -2060,6 +2063,7 @@ class AdminSupplyOrdersControllerCore extends AdminController
|
||||
|
||||
// updates supply order
|
||||
$supply_order->update();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user