From f00892539cd3e971891e191fc572fb74e1512657 Mon Sep 17 00:00:00 2001 From: rGaillard Date: Mon, 21 Nov 2011 09:18:27 +0000 Subject: [PATCH] // Improve AdminShopController git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10317 b9a71923-0436-4b27-9f14-aed3839534dd --- controllers/admin/AdminShopController.php | 57 ++++++++++++----------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/controllers/admin/AdminShopController.php b/controllers/admin/AdminShopController.php index 4761b739a..135c1f9f0 100755 --- a/controllers/admin/AdminShopController.php +++ b/controllers/admin/AdminShopController.php @@ -157,7 +157,7 @@ class AdminShopControllerCore extends AdminController 'input' => array( array( 'type' => 'text', - 'label' => $this->l('GroupShop name:'), + 'label' => $this->l('Shop name:'), 'name' => 'name', 'required' => true, ) @@ -276,31 +276,32 @@ class AdminShopControllerCore extends AdminController 'store' => $this->l('Stores'), ); - $this->fields_import_form = array( - 'legend' => array( - 'title' => $this->l('Import data from another shop') - ), - 'label' => $this->l('Import data from another shop'), - 'checkbox' => array( - 'type' => 'checkbox', - 'label' => $this->l('Duplicate data from shop'), - 'name' => 'useImportData', - 'value' => 1 - ), - 'select' => array( - 'type' => 'select', - 'name' => 'importFromShop', - 'options' => array( - 'query' => Shop::getTree(), - 'name' => 'name' - ) - ), - 'allcheckbox' => array( - 'type' => 'checkbox', - 'values' => $import_data - ), - 'desc' => $this->l('Use this option to associate data (products, modules, etc.) the same way as the selected shop') - ); + if (!$this->object->id) + $this->fields_import_form = array( + 'legend' => array( + 'title' => $this->l('Import data from another shop') + ), + 'label' => $this->l('Import data from another shop'), + 'checkbox' => array( + 'type' => 'checkbox', + 'label' => $this->l('Duplicate data from shop'), + 'name' => 'useImportData', + 'value' => 1 + ), + 'select' => array( + 'type' => 'select', + 'name' => 'importFromShop', + 'options' => array( + 'query' => Shop::getTree(), + 'name' => 'name' + ) + ), + 'allcheckbox' => array( + 'type' => 'checkbox', + 'values' => $import_data + ), + 'desc' => $this->l('Use this option to associate data (products, modules, etc.) the same way as the selected shop') + ); $this->fields_value = array( 'id_group_shop' => $obj->id_group_shop @@ -310,9 +311,11 @@ class AdminShopControllerCore extends AdminController 'disabled' => $disabled, 'checked' => (Tools::getValue('addshop') !== false) ? true : false, 'defaultGroup' => Shop::getInstance(Configuration::get('PS_SHOP_DEFAULT'))->getGroupID(), - 'form_import' => $this->fields_import_form ); + if (isset($this->fields_import_form)) + $this->tpl_form_vars = array_merge($this->tpl_form_vars, array('form_import' => $this->fields_import_form)); + return parent::initForm(); } }