// Warehouses & supply orders : default country / lang / currency are now loaded by default in the forms
This commit is contained in:
@@ -185,12 +185,20 @@ class AdminSupplyOrdersControllerCore extends AdminController
|
||||
|
||||
//get currencies list
|
||||
$currencies = Currency::getCurrencies();
|
||||
$id_default_currency = Configuration::get('PS_CURRENCY_DEFAULT');
|
||||
$default_currency = Currency::getCurrency($id_default_currency);
|
||||
if ($default_currency)
|
||||
$currencies = array_merge(array($default_currency, '-'), $currencies);
|
||||
|
||||
//get suppliers list
|
||||
$suppliers = Supplier::getSuppliers();
|
||||
|
||||
//get languages list
|
||||
$languages = Language::getLanguages(true);
|
||||
$id_default_lang = Configuration::get('PS_LANG_DEFAULT');
|
||||
$default_lang = Language::getLanguage($id_default_lang);
|
||||
if ($default_lang)
|
||||
$languages = array_merge(array($default_lang, '-'), $languages);
|
||||
|
||||
$this->fields_form = array(
|
||||
'legend' => array(
|
||||
|
||||
@@ -137,6 +137,13 @@ class AdminWarehousesControllerCore extends AdminController
|
||||
$query->where('active = 1');
|
||||
$employees_array = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query);
|
||||
|
||||
// sets countries
|
||||
$countries = Country::getCountries($this->context->language->id, false);
|
||||
$id_default_country = Configuration::get('PS_SHOP_COUNTRY_ID');
|
||||
if (isset($countries[$id_default_country]))
|
||||
$countries = array($id_default_country => $countries[$id_default_country]) + $countries;
|
||||
|
||||
|
||||
// sets the title of the toolbar
|
||||
$this->toolbar_title = $this->l('Stock : Warehouse management');
|
||||
|
||||
@@ -216,7 +223,7 @@ class AdminWarehousesControllerCore extends AdminController
|
||||
'name' => 'id_country',
|
||||
'required' => true,
|
||||
'options' => array(
|
||||
'query' => Country::getCountries($this->context->language->id, false),
|
||||
'query' => $countries,
|
||||
'id' => 'id_country',
|
||||
'name' => 'name'
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user