From cb71c61d409208d9c1c4cf2e8fc3ab8a5835f875 Mon Sep 17 00:00:00 2001 From: rMalie Date: Wed, 15 Feb 2012 16:14:34 +0000 Subject: [PATCH] // 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 --- .../admin/AdminCustomersController.php | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/controllers/admin/AdminCustomersController.php b/controllers/admin/AdminCustomersController.php index ed502512f..ea1d1d3dd 100644 --- a/controllers/admin/AdminCustomersController.php +++ b/controllers/admin/AdminCustomersController.php @@ -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()))