From 4abe8efd757aa0fd87780ac304e4f6eb0aa4c8bf Mon Sep 17 00:00:00 2001 From: rGaillard Date: Mon, 21 Nov 2011 09:46:01 +0000 Subject: [PATCH] // Improve AdminGroupShopController git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@10323 b9a71923-0436-4b27-9f14-aed3839534dd --- .../admin/AdminGroupShopController.php | 54 ++++++++++--------- 1 file changed, 28 insertions(+), 26 deletions(-) diff --git a/controllers/admin/AdminGroupShopController.php b/controllers/admin/AdminGroupShopController.php index 87c63227c..d111ba677 100644 --- a/controllers/admin/AdminGroupShopController.php +++ b/controllers/admin/AdminGroupShopController.php @@ -155,39 +155,41 @@ class AdminGroupShopControllerCore extends AdminController 'tax_rules_group' => $this->l('Tax rules groups'), 'zone' => $this->l('Zones'), ); - - $this->fields_import_form = array( - 'legend' => array( - 'title' => $this->l('Import data from another group shop') - ), - 'label' => $this->l('Duplicate data from group shop'), - 'checkbox' => array( - 'type' => 'checkbox', + + if (!$this->object->id) + $this->fields_import_form = array( + 'legend' => array( + 'title' => $this->l('Import data from another group shop') + ), 'label' => $this->l('Duplicate data from group shop'), - 'name' => 'useImportData', - 'value' => 1 - ), - 'list' => 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') - ); + 'checkbox' => array( + 'type' => 'checkbox', + 'label' => $this->l('Duplicate data from group shop'), + 'name' => 'useImportData', + 'value' => 1 + ), + 'list' => 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->tpl_form_vars = array( 'disabled' => $disabled, 'checked' => (Tools::getValue('addgroup_shop') !== 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(); }