// Remove shop field form when we add a customer a BO, use shop context instead #PSTEST-746

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13364 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2012-02-15 16:14:34 +00:00
parent 7190508df7
commit cb71c61d40
+5 -15
View File
@@ -413,20 +413,6 @@ class AdminCustomersControllerCore extends AdminController
array_splice($this->fields_form['input'], $k, 1);
}
if (Shop::isFeatureActive())
{
$this->fields_form['input'][] = array(
'type' => 'select',
'label' => $this->l('Shop:'),
'name' => 'id_shop',
'options' => array(
'query' => Shop::getShops(),
'id' => 'id_shop',
'name' => 'name'
),
);
}
if (Configuration::get('PS_B2B_ENABLE'))
{
$risks = Risk::getRisks();
@@ -502,7 +488,6 @@ class AdminCustomersControllerCore extends AdminController
'years' => $this->getFieldValue($obj, 'birthday') ? $birthday[0] : 0,
'months' => $this->getFieldValue($obj, 'birthday') ? $birthday[1] : 0,
'days' => $this->getFieldValue($obj, 'birthday') ? $birthday[2] : 0,
'id_shop' => (int)Configuration::get('PS_SHOP_DEFAULT')
);
// Added values of object Group
@@ -526,6 +511,11 @@ class AdminCustomersControllerCore extends AdminController
return parent::renderForm();
}
public function beforeAdd($customer)
{
$customer->id_shop = $this->context->shop->getID(true);
}
public function renderView()
{
if (!($customer = $this->loadObject()))