From c71ba2cc4020aa832e3db10256050de422812d73 Mon Sep 17 00:00:00 2001 From: vAugagneur Date: Wed, 29 Feb 2012 16:08:23 +0000 Subject: [PATCH] [*] BO : improve duplicate shop form --- .../controllers/shop/helpers/form/form.tpl | 71 ++++++++++--------- controllers/admin/AdminShopController.php | 16 ++--- translations/fr/admin.php | 6 +- 3 files changed, 50 insertions(+), 43 deletions(-) diff --git a/admin-dev/themes/default/template/controllers/shop/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/shop/helpers/form/form.tpl index 47f5e8432..6b99110c5 100644 --- a/admin-dev/themes/default/template/controllers/shop/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/shop/helpers/form/form.tpl @@ -78,43 +78,47 @@ {block name="other_fieldsets"} {if isset($form_import)}

-
+
{l s='Import data from another shop'} {foreach $form_import as $key => $field} - {if $key == 'legend'} - - {if isset($field.image)}{$field.title}{/if} - {$field.title} - - {elseif $key == 'label'} - - {/if} - {if $key == 'checkbox'} + {if $key == 'radio'} +
- - {elseif $key == 'select'} - - {elseif $key == 'allcheckbox'} -
-
    - {foreach $field.values as $key => $label} -
  • - {/foreach} -
-
- {elseif $key == 'p'} -

{$field}

+ + + + + +
+ {elseif $key == 'select'} +
+ +
+ +
+
+ {elseif $key == 'allcheckbox'} +
+ +
+
    + {foreach $field.values as $key => $label} +
  • {$label}
  • + {/foreach} +
+
+
{elseif $key == 'submit'}
- {/if} + {/if} {/foreach}
{/if} @@ -123,8 +127,11 @@ {block name=script} $(document).ready(function() { - $('#useImportData').click(function() { - $('#importList').slideToggle('slow'); + $('input[name=useImportData]').click(function() { + if ($(this).attr('id') == 'useImportData_on') + $('#shop_list, #data_list').slideDown('slow'); + else + $('#shop_list, #data_list').slideUp('slow'); }); }); diff --git a/controllers/admin/AdminShopController.php b/controllers/admin/AdminShopController.php index 1e0b71c6b..3ece1f322 100755 --- a/controllers/admin/AdminShopController.php +++ b/controllers/admin/AdminShopController.php @@ -374,9 +374,7 @@ class AdminShopControllerCore extends AdminController ); if (Shop::getTotalShops() > 1 && $obj->id) - $disabled = array( - 'active' => false - ); + $disabled = array('active' => false); else $disabled = false; @@ -409,19 +407,16 @@ class AdminShopControllerCore extends AdminController 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'), + 'radio' => array( + 'type' => 'radio', + 'label' => $this->l('Import data'), 'name' => 'useImportData', 'value' => 1 ), 'select' => array( 'type' => 'select', 'name' => 'importFromShop', + 'label' => $this->l('Choose the shop (source)'), 'options' => array( 'query' => Shop::getShops(false), 'name' => 'name' @@ -429,6 +424,7 @@ class AdminShopControllerCore extends AdminController ), 'allcheckbox' => array( 'type' => 'checkbox', + 'label' => $this->l('Choose data to import'), 'values' => $import_data ), 'desc' => $this->l('Use this option to associate data (products, modules, etc.) the same way as the selected shop') diff --git a/translations/fr/admin.php b/translations/fr/admin.php index 90367834b..114aa062f 100644 --- a/translations/fr/admin.php +++ b/translations/fr/admin.php @@ -3214,9 +3214,11 @@ $_LANGADM['AdminShippingf8617a92ba0a0a4eabee724eab7c9f48'] = 'Transporteur :'; $_LANGADM['AdminShop00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activé'; $_LANGADM['AdminShop068f80c7519d0528fb08e82137a72131'] = 'Produits'; $_LANGADM['AdminShop1d6af794b2599c1407a83029a09d1ecf'] = 'Transporteurs'; +$_LANGADM['AdminShop1d92a46c4e14c43c3096d85c9f26fc4e'] = 'Choisissez les données '; $_LANGADM['AdminShop2377be3c2ad9b435ba277a73f0f1ca76'] = 'Marques'; $_LANGADM['AdminShop24a23d787190f2c4812ff9ab11847a72'] = 'État :'; $_LANGADM['AdminShop25c25c36ef8fc9436725e3a4eb6044d2'] = 'Supprimer cette boutique'; +$_LANGADM['AdminShop2df07bc574bd6370979f7762b08b4a32'] = 'Choisissez la boutique (source)'; $_LANGADM['AdminShop37c0e2b9736bc4cc2005f7be3fd66fe5'] = 'Activer ou désactiver la boutique'; $_LANGADM['AdminShop38fb7d24e0d60a048f540ecb18e13376'] = 'Enregistrer'; $_LANGADM['AdminShop4390988a3f7d7cfa3d8a5ecb11976f58'] = 'Groupe de boutiques'; @@ -3236,9 +3238,9 @@ $_LANGADM['AdminShop7b19b37e7fc3dfe3c3e1ad5b84c7f565'] = 'Page d\'accueil'; $_LANGADM['AdminShop7e5bf0b306c8d4608fcddb53ce9b1169'] = 'Vous ne pouvez pas changer le groupe de boutiques lorsque vous avez plus d\'une boutique'; $_LANGADM['AdminShop7ffa831a8a11eb45e63b4dc3b7393bf9'] = 'URL principale de la boutique'; $_LANGADM['AdminShop821b8ee6937cec96c30fdafbfe836d68'] = 'Magasins'; -$_LANGADM['AdminShop8409f0f4c1b13db73d10a0f148b67dda'] = 'Importer les informations de la boutique'; $_LANGADM['AdminShop89b58c514d07acaa086ca02b57512dcb'] = 'Points d\'accroches des modules'; $_LANGADM['AdminShop92318dc9b42eb05bb1c958f0a15d19b9'] = 'Langues'; +$_LANGADM['AdminShop93cba07454f06a4a960172bbd6e2a435'] = 'Oui'; $_LANGADM['AdminShop99104e1966b34f0320d33c5892946a82'] = 'Importer les informations associées (produits, etc.) depuis une autre boutique'; $_LANGADM['AdminShop9d5bf15117441a1b52eb1f0808e4aad3'] = 'Réductions'; $_LANGADM['AdminShop9e43e210cf7bd16b8896636cae3e46b8'] = 'Restrictions des devises pour le module de paiement'; @@ -3276,10 +3278,12 @@ $_LANGADM['AdminShopb6755d218d5f4e1cef9cce9cc39aeda9'] = 'Méta'; $_LANGADM['AdminShopb718adec73e04ce3ec720dd11a06a308'] = 'ID'; $_LANGADM['AdminShopb8ddfef634372f5719de857ea26c99be'] = 'Langue des catégories'; $_LANGADM['AdminShopb9f5c797ebbf55adccdd8539a65a0241'] = 'Désactivé'; +$_LANGADM['AdminShopbafd7322c6e97d25b6299b5d6fe8920b'] = 'Non'; $_LANGADM['AdminShopbb34f602e45a9fbcb2cdfee7a48673fc'] = 'Scènes'; $_LANGADM['AdminShopbbaff12800505b22a853e8b7f4eb6a22'] = 'Contact'; $_LANGADM['AdminShopbf17ac149e2e7a530c677e9bd51d3fd2'] = 'Modules'; $_LANGADM['AdminShopc269874d047098fef892a344be025303'] = 'Restrictions des pays pour le module de paiement'; +$_LANGADM['AdminShopc8cfbbbe4253e14390b2b14d7e60d9c8'] = 'Importer les données'; $_LANGADM['AdminShopc9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer'; $_LANGADM['AdminShopcf173b732a2a0377698d631db6185836'] = 'Quantités disponibles à la vente'; $_LANGADM['AdminShopd3b206d196cd6be3a2764c1fb90b200f'] = 'Supprimer la sélection';