Cleaned the mess of Shipping zones, which is Shipping configuration...
This commit is contained in:
@@ -771,9 +771,9 @@
|
||||
<default key="_controller">Thelia\Controller\Admin\ShippingZoneController::indexAction</default>
|
||||
</route>
|
||||
|
||||
<route id="admin.configuration.shipping-zones.update.view" path="/admin/configuration/shipping_zones/update/{shipping_zones_id}" methods="get">
|
||||
<route id="admin.configuration.shipping-zones.update.view" path="/admin/configuration/shipping_zones/update/{delivery_module_id}" methods="get">
|
||||
<default key="_controller">Thelia\Controller\Admin\ShippingZoneController::updateAction</default>
|
||||
<requirement key="shipping_zones_id">\d+</requirement>
|
||||
<requirement key="delivery_module_id">\d+</requirement>
|
||||
</route>
|
||||
|
||||
<route id="admin.configuration.shipping-zones.area.add" path="/admin/configuration/shipping_zones/area/add" methods="post">
|
||||
|
||||
@@ -46,11 +46,11 @@ class ShippingZoneController extends BaseAdminController
|
||||
return $this->render("shipping-zones", array("display_shipping_zone" => 20));
|
||||
}
|
||||
|
||||
public function updateAction($shipping_zones_id)
|
||||
public function updateAction($delivery_module_id)
|
||||
{
|
||||
if (null !== $response = $this->checkAuth(AdminResources::SHIPPING_ZONE, array(), AccessManager::VIEW)) return $response;
|
||||
return $this->render("shipping-zones-edit", array(
|
||||
"shipping_zones_id" => $shipping_zones_id
|
||||
"delivery_module_id" => $delivery_module_id
|
||||
));
|
||||
}
|
||||
|
||||
@@ -133,13 +133,13 @@ class ShippingZoneController extends BaseAdminController
|
||||
protected function renderEditionTemplate()
|
||||
{
|
||||
return $this->render("shipping-zones-edit", array(
|
||||
"shipping_zones_id" => $this->getShippingZoneId()
|
||||
"delivery_module_id" => $this->getDeliveryModuleId()
|
||||
));
|
||||
}
|
||||
|
||||
protected function getShippingZoneId()
|
||||
protected function getDeliveryModuleId()
|
||||
{
|
||||
return $this->getRequest()->get('shipping_zone_id', 0);
|
||||
return $this->getRequest()->get('delivery_module_id', 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -77,7 +77,8 @@ class Area extends BaseLoop implements PropelSearchLoopInterface
|
||||
return new ArgumentCollection(
|
||||
Argument::createIntListTypeArgument('id'),
|
||||
Argument::createIntTypeArgument('with_zone'),
|
||||
Argument::createIntTypeArgument('without_zone')
|
||||
Argument::createIntTypeArgument('without_zone'),
|
||||
Argument::createBooleanOrBothTypeArgument('unassigned')
|
||||
);
|
||||
}
|
||||
|
||||
@@ -106,6 +107,14 @@ class Area extends BaseLoop implements PropelSearchLoopInterface
|
||||
->where('`without_zone`.delivery_module_id '.Criteria::ISNULL);
|
||||
}
|
||||
|
||||
$notAssigned = $this->getUnassigned();
|
||||
|
||||
if ($notAssigned) {
|
||||
$search
|
||||
->joinAreaDeliveryModule('unassigned', Criteria::LEFT_JOIN)
|
||||
->where('`unassigned`.delivery_module_id ' . Criteria::ISNULL);
|
||||
}
|
||||
|
||||
return $search;
|
||||
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ class ShippingZoneAddArea extends BaseForm
|
||||
new GreaterThan(array('value' => 0))
|
||||
),
|
||||
'label_attr' => array('for' => 'shipping_area'),
|
||||
'label' => Translator::getInstance()->trans('Area')
|
||||
'label' => Translator::getInstance()->trans('Available shipping zones')
|
||||
))
|
||||
->add('shipping_zone_id', 'integer', array(
|
||||
'constraints' => array(
|
||||
|
||||
@@ -9,6 +9,7 @@ return array(
|
||||
'<strong>Cannot translate all fields.</strong> According to your PHP configuration, forms cannot contains more than %current_max_input_vars input fields, but at least %required_max_input_vars are required. Please change the value of max_input_vars in your PHP configuration of change the translation file by hand.' => '<strong>Limitation système bloquante !</strong> Votre configuration PHP limite le nombre de champs d\'une forme HTML à %current_max_input_vars champs. Au moins %required_max_input_vars champs sont nécessaires pour effectuer les traductions. Merci de modifier en conséquence la variable max_input_vars de votre configuration PHP. Vous pouvez aussi modifier les fichiers de traduction à la main.',
|
||||
'<strong>Congratulations</strong>, all text is now translated !' => '<strong>Félicitations</strong>, tous les textes ont été traduits !',
|
||||
'<strong>Did not found any text to translate</strong>. It\'s probably normal. If not, please be sure to use Smarty\'s "intl" function in templates, or the Translator::trans() method in PHP files.' => '<streong>Aucun texte à traduire</strong>. C\'est probablement normal. Si ce n\'est pas le cas vérifiez que vous utilisez bien la fonction Smarty "intl" ou bien le translator Translator::trans dans un fichier php',
|
||||
'<strong>Warning</strong>, some of your shipping zones are not attached to any delivery module:' => '<strong>Attention</strong>, les zones de livraison suivantes ne sont associées à aucun module:',
|
||||
'A content could be attached to more than one folder. Select here the additional folders for this content.' => 'Un contenu peut être rattaché à plusieurs dossiers. Sélectionnez ici les dossiers dans lesquels ce contenu apparaîtra',
|
||||
'A product could be attached to more than one category. Select here the additional categories for this product.' => 'Un produit peut être associé à plusieurs rubriques. Sélectionner les rubrique pour lesquels le produit sera associé',
|
||||
'A short description, used when a summary or an introduction is required' => 'Une courte description, utilisée lorsqu\'un résumé ou une introduction est requise',
|
||||
@@ -374,13 +375,13 @@ return array(
|
||||
'Edit product' => 'Modifier le produit',
|
||||
'Edit product %title' => 'Modifier le produit %title',
|
||||
'Edit shipping configuration %title' => 'Modifier la configuration de livraison %title',
|
||||
'Edit shipping zone %title' => 'Modifier la zone de livraison %title',
|
||||
'Edit tax rule taxes' => 'Modifier les taxes de la règle de taxe',
|
||||
'Edit template "%name"' => 'Modifier le template "%name"',
|
||||
'Edit this address' => 'Editer cette adresse',
|
||||
'Edit this category' => 'Editer cette rubrique',
|
||||
'Edit this content' => 'Modifier ce contenu',
|
||||
'Edit this customer' => 'Modifier ce client',
|
||||
'Edit this delivery zone' => 'Modifier cette zone de livraison',
|
||||
'Edit this folder' => 'Modifier ce dossier',
|
||||
'Edit this module' => 'Modifier ce module',
|
||||
'Edit this order' => 'Editer cette commande',
|
||||
@@ -401,7 +402,7 @@ return array(
|
||||
'Editing profile' => 'Modification du profil',
|
||||
'Editing profile \'%name\'' => 'Edition du profil \'%name\' ',
|
||||
'Editing shipping configuration "%name"' => 'En cours de modification de la configuration de livraison "%name"',
|
||||
'Editing shipping zone "%name"' => 'En cours de modification de la zone de livraison "%name"',
|
||||
'Editing shipping configuration for module "%name"' => 'Configuration des zones de livraison du module "%title" ',
|
||||
'Editing tax' => 'En cours de modification de la taxe',
|
||||
'Editing tax rule' => 'En cours de modification de la règle de taxe',
|
||||
'Editing template "%name"' => 'Modification du template "%name"',
|
||||
@@ -738,7 +739,10 @@ return array(
|
||||
'Set as default tax rule' => 'Configurer en tant que règle par défaut',
|
||||
'Shipping configuration' => 'Configuration du transport',
|
||||
'Shipping configuration name' => 'Nom de la configuration de livraison',
|
||||
'Shipping zones' => 'Zones de livraison',
|
||||
'Shipping configuration of delivery module "%title"' => 'Configuration des zones de livraison du module "%title" ',
|
||||
'Shipping zone' => 'Zone de livraison',
|
||||
'Shipping zones for this module' => 'Zones de livraison associées à ce module',
|
||||
'Shipping zones management' => 'Zones de livraison',
|
||||
'Shop' => 'Boutique',
|
||||
'Shop Informations' => 'Informations sur la boutique',
|
||||
'Short conclusion' => 'Courte conclusion',
|
||||
@@ -819,6 +823,7 @@ return array(
|
||||
'Thelia support forum' => 'Forum de Thelia',
|
||||
'Thelia system variables' => 'Variables Thelia',
|
||||
'Thelia, the open source e-commerce solution' => 'Thelia, la solution e-commerce libre',
|
||||
'There are no shipping zones attached to this module.' => 'Ce module de transport n\'est associé à aucune zone de livraison',
|
||||
'There is currently no active module here.' => 'Il n\'y a aucun module actif ici',
|
||||
'There is no documents attached to this %type.' => 'Il n\'y a aucun document lié à ce %type.',
|
||||
'There is no images attached to this %type.' => 'Il n\'y a pas d\'image liée à ce %type.',
|
||||
@@ -919,7 +924,6 @@ return array(
|
||||
'You don\'t need to use commas or other punctuations.' => 'Vous n\'avez pas besoin d\'utiliser de virgules ou d\'autres signes de ponctuation',
|
||||
'Your current IP address is %ip' => 'Votre adresse IP est %ip',
|
||||
'Zip code' => 'Code postal',
|
||||
'Zones' => 'Zones',
|
||||
'activate' => 'activer',
|
||||
'activate %title module' => 'Activez le module %title',
|
||||
'activation' => 'Activation',
|
||||
|
||||
@@ -89,14 +89,14 @@
|
||||
|
||||
{loop type="auth" name="pcc2" role="ADMIN" resource="admin.configuration.shipping-zone" access="VIEW"}
|
||||
<tr>
|
||||
<td><a href="{url path='/admin/configuration/shipping_zones'}">{intl l='Shipping zones'}</a></td>
|
||||
<td><a href="{url path='/admin/configuration/shipping_zones'}">{intl l='Shipping configuration'}</a></td>
|
||||
<td><a class="btn btn-default btn-xs" href="{url path='/admin/configuration/shipping_zones'}"><i class="glyphicon glyphicon-edit"></i></a></td>
|
||||
</tr>
|
||||
{/loop}
|
||||
|
||||
{loop type="auth" name="pcc3" role="ADMIN" resource="admin.configuration.shipping-configuration" access="VIEW"}
|
||||
<tr>
|
||||
<td><a href="{url path='/admin/configuration/shipping_configuration'}">{intl l='Shipping configuration'}</a></td>
|
||||
<td><a href="{url path='/admin/configuration/shipping_configuration'}">{intl l='Shipping zones management'}</a></td>
|
||||
<td><a class="btn btn-default btn-xs" href="{url path='/admin/configuration/shipping_configuration'}"><i class="glyphicon glyphicon-edit"></i></a></td>
|
||||
</tr>
|
||||
{/loop}
|
||||
|
||||
@@ -10,20 +10,30 @@
|
||||
|
||||
<div id="wrapper" class="container">
|
||||
|
||||
{loop type="module" id="$delivery_module_id" active="*" name="module.name" backend_context="1"}
|
||||
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="{url path='/admin/home'}">{intl l="Home"}</a></li>
|
||||
<li><a href="{url path='/admin/configuration'}">{intl l="Configuration"}</a></li>
|
||||
<li><a href="{url path='/admin/configuration/shipping_zones'}">{intl l="Shipping zones"}</a></li>
|
||||
<li>{intl l='Editing shipping zone "%name"' name="{$TITLE}"}</li>
|
||||
<li><a href="{url path='/admin/configuration/shipping_zones'}">{intl l="Shipping configuration"}</a></li>
|
||||
<li>{intl l='Editing shipping configuration for module "%name"' name="{$TITLE}"}</li>
|
||||
</ul>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="general-block-decorator">
|
||||
|
||||
<div class="col-md-12 title title-without-tabs">
|
||||
{intl l='Edit shipping zone %title' title=$TITLE}
|
||||
<div class="title title-without-tabs">
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
{intl l='Shipping configuration of delivery module "%title"' title=$TITLE}
|
||||
</div>
|
||||
<div class="col-md-2 text-right">
|
||||
<a href="{url path='/admin/configuration/shipping_zones'}" class="btn btn-sm btn-default">{intl l='Close'} <span class="glyphicon glyphicon-remove"></span></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-container clearfix">
|
||||
<div class="col-md-4">
|
||||
@@ -32,18 +42,18 @@
|
||||
{form_hidden_fields form=$form}
|
||||
|
||||
{form_field form=$form field='success_url'}
|
||||
<input type="hidden" name="{$name}" value="{url path="/admin/configuration/shipping_zones/update/{$shipping_zones_id}"}" /> {* the url the user is redirected to on login success *}
|
||||
<input type="hidden" name="{$name}" value="{url path="/admin/configuration/shipping_zones/update/{$delivery_module_id}"}" /> {* the url the user is redirected to on login success *}
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='shipping_zone_id'}
|
||||
<input type="hidden" name="{$name}" value="{$shipping_zones_id}" />
|
||||
<input type="hidden" name="{$name}" value="{$delivery_module_id}" />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='area_id'}
|
||||
<label class="control-label" for="{$label_attr.for}">{$label}</label>
|
||||
<div class="input-group">
|
||||
<select name="{$name}" id="{$label_attr.for}" data-toggle="selectpicker">
|
||||
{loop name="area.module.not_associated" type="area" without_zone=$shipping_zones_id}
|
||||
{loop name="area.module.not_associated" type="area" without_zone=$delivery_module_id}
|
||||
<option value="{$ID}">{$NAME}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
@@ -61,21 +71,30 @@
|
||||
<table class="table table-striped table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{intl l="Zones"}</th>
|
||||
<th>{intl l="Actions"}</th>
|
||||
<th>{intl l="Shipping zone"}</th>
|
||||
<th class="text-center">{intl l="Actions"}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{loop type="area" name="area.module.associated" with_zone=$shipping_zones_id}
|
||||
{loop type="area" name="area.module.associated" with_zone=$delivery_module_id}
|
||||
<tr>
|
||||
<td>{$NAME}</td>
|
||||
<td>
|
||||
<td class="text-center">
|
||||
<a class="btn btn-default btn-xs delete-zone-area" title="{intl l='Delete this zone'}" href="#delete_zone_dialog" data-id="{$ID}" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-trash"></span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{/loop}
|
||||
{elseloop rel="area.module.associated"}
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<div class="text-center">
|
||||
{intl l="There are no shipping zones attached to this module."}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/elseloop}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -86,6 +105,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/loop}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -96,11 +116,11 @@
|
||||
{form_hidden_fields form=$form}
|
||||
|
||||
{form_field form=$form field='success_url'}
|
||||
<input type="hidden" name="{$name}" value="{url path="/admin/configuration/shipping_zones/update/{$shipping_zones_id}"}" /> {* the url the user is redirected to on login success *}
|
||||
<input type="hidden" name="{$name}" value="{url path="/admin/configuration/shipping_zones/update/{$delivery_module_id}"}" /> {* the url the user is redirected to on login success *}
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='shipping_zone_id'}
|
||||
<input type="hidden" name="{$name}" value="{$shipping_zones_id}" />
|
||||
<input type="hidden" name="{$name}" value="{$delivery_module_id}" />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='area_id'}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="{url path='/admin/home'}">{intl l="Home"}</a></li>
|
||||
<li><a href="{url path='/admin/configuration'}">{intl l="Configuration"}</a></li>
|
||||
<li><a href="{url path='/admin/configuration/shipping_zones'}">{intl l="Shipping zones"}</a></li>
|
||||
<li><a href="{url path='/admin/configuration/shipping_zones'}">{intl l="Shipping configuration"}</a></li>
|
||||
</ul>
|
||||
|
||||
{module_include location='shipping_zones_top'}
|
||||
@@ -21,18 +21,33 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="general-block-decorator">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="alert alert-warning">
|
||||
{intl l='<strong>Warning</strong>, some of your shipping zones are not attached to any delivery module:'}
|
||||
{loop name="area-not-attached" type="area" unassigned=true}
|
||||
<a href="{url path="/admin/configuration/shipping_configuration/update/$ID"}" title="{intl l='Edit this delivery zone'}">{$NAME}</a>{if $LOOP_COUNT < $LOOP_TOTAL},{else}.{/if}
|
||||
{/loop}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-condensed table-left-aligned">
|
||||
|
||||
<caption>
|
||||
{intl l='Thelia Shipping zones'}
|
||||
{intl l='Shipping configuration'}
|
||||
</caption>
|
||||
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{intl l="Name"}</th>
|
||||
<th>{intl l="Delivery module"}</th>
|
||||
<th>{intl l="Shipping zones for this module"}</th>
|
||||
|
||||
{module_include location='shipping_zones_table_header'}
|
||||
|
||||
<th>{intl l="Actions"}</th>
|
||||
<th class="text-center">{intl l="Actions"}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -40,10 +55,23 @@
|
||||
{loop type="module" module_type="2" active="*" name="delivery.list" backend_context="1"}
|
||||
<tr>
|
||||
<td><a href="{url path="/admin/configuration/shipping_zones/update/$ID"}">{$TITLE}</a></td>
|
||||
<td>
|
||||
{loop name="area.module.associated" type="area" with_zone=$ID backend_context="1"}
|
||||
{$countries = ''}
|
||||
{loop name="country-area" type="country" area=$ID backend_context="1"}
|
||||
{$countries = "$countries, $TITLE"}
|
||||
{/loop}
|
||||
{$countries = ltrim($countries, ', ')}
|
||||
|
||||
<a href="{url path="/admin/configuration/shipping_configuration/update/$ID"}" title="{$countries}">{$NAME}</a>{if $LOOP_COUNT < $LOOP_TOTAL},{/if}
|
||||
{/loop}
|
||||
{elseloop rel="area.module.associated"}
|
||||
{intl l="There are no shipping zones attached to this module."}
|
||||
{/elseloop}
|
||||
</td>
|
||||
{module_include location='shipping_zones_table_row'}
|
||||
|
||||
<td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
{loop type="auth" name="can_change" role="ADMIN" resource="admin.configuration.shipping-zone" access="UPDATE"}
|
||||
<a class="btn btn-default btn-xs shipping-zones-change" title="{intl l='Change this shipping zone'}" href="{url path="/admin/configuration/shipping_zones/update/$ID"}"><i class="glyphicon glyphicon-edit"></i></a>
|
||||
|
||||
Reference in New Issue
Block a user