Merge branch 'master' of https://github.com/thelia/thelia into coupon
* 'master' of https://github.com/thelia/thelia: (38 commits) add propel connection in transactions remove area to area_delivery_module add an area to a delivery module create shipping zone area form update readme start shipping zone management complete admin log message allow to create a new area delete area add pre/post methods in Area model display error message update area postage add missinf files remove country from area and start creating postage management add country to as area start area configuration tempalte choices access through smarty tax rule creation downgrade smarty version create all area events ...
This commit is contained in:
@@ -326,3 +326,79 @@
|
||||
height: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
// -- Drag & drop --
|
||||
.take{
|
||||
|
||||
.draggable{
|
||||
border: 2px dashed @gray-light;
|
||||
margin-bottom: 10px;
|
||||
padding: 10px;
|
||||
|
||||
&:last-child{
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.over{
|
||||
.drop-message{
|
||||
border-color: @brand-primary;
|
||||
color: @brand-primary;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.place{
|
||||
|
||||
.over{
|
||||
.drop-message{
|
||||
border-color: @brand-primary;
|
||||
color: @brand-primary;
|
||||
}
|
||||
}
|
||||
|
||||
.panel-body{
|
||||
|
||||
.draggable, .drag{
|
||||
margin: 5px 0;
|
||||
padding: 10px;
|
||||
border: 1px dashed @gray-light;
|
||||
}
|
||||
|
||||
.drop-group{
|
||||
padding: 10px;
|
||||
border: 2px dashed @gray-light;
|
||||
margin-bottom: 10px;
|
||||
|
||||
&:last-child{
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.take, .place{
|
||||
|
||||
.drop-message{
|
||||
width: 50%;
|
||||
margin: 10px auto;
|
||||
padding: 10px;
|
||||
color: @gray;
|
||||
border: 2px dashed @gray;
|
||||
text-align: center;
|
||||
.opacity(0.5);
|
||||
|
||||
.glyphicon{
|
||||
display: block;
|
||||
font-size: @font-size-large;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.ui-draggable-dragging{
|
||||
z-index: 100;
|
||||
}
|
||||
}
|
||||
@@ -66,7 +66,7 @@
|
||||
{form_hidden_fields form=$form}
|
||||
|
||||
{form_field form=$form field='success_url'}
|
||||
<input type="hidden" name="{$name}" value="{url path='/admin/category' category_id={$category_d}}" />
|
||||
<input type="hidden" name="{$name}" value="{url path='/admin/category' category_id={$category_id}}" />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='locale'}
|
||||
|
||||
@@ -58,6 +58,13 @@
|
||||
</tr>
|
||||
{/loop}
|
||||
|
||||
{loop type="auth" name="pcc6" roles="ADMIN" permissions="admin.configuration.taxe-rules"}
|
||||
<tr>
|
||||
<td><a href="{url path='/admin/configuration/taxes_rules'}">{intl l='Taxes rules'}</a></td>
|
||||
<td><a class="btn btn-default btn-xs" href="{url path='/admin/configuration/taxes_rules'}"><i class="glyphicon glyphicon-edit"></i></a></td>
|
||||
</tr>
|
||||
{/loop}
|
||||
|
||||
{module_include location='catalog_configuration_bottom'}
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -52,17 +52,17 @@
|
||||
{loop name="countries" type="country" backend_context="1" lang=$lang_id order=$order}
|
||||
<tr>
|
||||
<td>{$ID}</td>
|
||||
<td>{$TITLE}</td>
|
||||
<td><a href="{url path="/admin/configuration/country/update/{$ID}"}">{$TITLE}</a></td>
|
||||
<td>
|
||||
<div class="make-switch switch-small switch-radio change-default-toggle" data-id="{$ID}" data-on="success" data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok'></i>" data-off-label="<i class='glyphicon glyphicon-remove'></i>">
|
||||
<input class="change-default-toggle" type="radio" name="by_default" value="{$ID}" {if $IS_DEFAULT}checked="checked"{/if}/>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
{* <td>
|
||||
<div class="make-switch switch-small switch-radio" data-on="success" data-off="danger" data-on-label="<i class='glyphicon glyphicon-ok'></i>" data-off-label="<i class='glyphicon glyphicon-remove'></i>">
|
||||
<input class="change-default" type="radio" name="" value="{$ID}" {if $IS_DEFAULT}selected="selected"{/if}/>
|
||||
</div>
|
||||
</td>
|
||||
</td> *}
|
||||
<td>{$ISOCODE}</td>
|
||||
<td>{$ISOALPHA3}</td>
|
||||
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
<div class="col-md-12">
|
||||
|
||||
{form name="thelia.admin.country.modification"}
|
||||
<form method="POST" action="{url path='/admin/configuration/countries/save'}" {form_enctype form=$form} class="clearfix">
|
||||
|
||||
<form method="POST" action="{url path="/admin/configuration/country/save/{$ID}"}" {form_enctype form=$form} class="clearfix">
|
||||
{include file = "includes/inner-form-toolbar.html"}
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{* Be sure to get the country ID, even if the form could not be validated *}
|
||||
@@ -40,8 +40,12 @@
|
||||
{form_hidden_fields form=$form}
|
||||
|
||||
{form_field form=$form field='success_url'}
|
||||
<input type="hidden" name="{$name}" value="{url path='/admin/configuration/countries'}" />
|
||||
{/form_field}
|
||||
<input type="hidden" name="{$name}" value="{url path="/admin/configuration/country/update/{$ID}"}" />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='locale'}
|
||||
<input type="hidden" name="{$name}" value="{$edit_language_locale}" />
|
||||
{/form_field}
|
||||
|
||||
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
|
||||
|
||||
@@ -74,51 +78,26 @@
|
||||
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Alpha code 3'}">
|
||||
</div>
|
||||
{/form_field}
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 title title-without-tabs">
|
||||
{intl l="Translations"}
|
||||
</div>
|
||||
|
||||
{loop type="lang" name="lang"}
|
||||
<div class="col-md-3">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">
|
||||
<img src="{image file="assets/img/flags/{$CODE}.gif"}" alt="{intl l=$TITLE}"> {$TITLE}
|
||||
</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
{form_field form=$form field='title'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$TITLE}" title="{intl l="{$label}"}" placeholder="{intl l='Country title'}">
|
||||
</div>
|
||||
{/form_field}
|
||||
{form_field form=$form field='chapo'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||
<textarea id="{$label_attr.for}" name="{$name}" class="form-control" title="{intl l=""}" placeholder="{intl l='Country short description'}"></textarea>
|
||||
</div>
|
||||
{/form_field}
|
||||
{form_field form=$form field='description'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||
<textarea id="{$label_attr.for}" name="{$name}" class="form-control" title="{intl l="{$label}"}" placeholder="{intl l='Country description'}"></textarea>
|
||||
</div>
|
||||
{/form_field}
|
||||
</div>
|
||||
{form_field form=$form field='title'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" value="{$value}" title="{intl l="{$label}"}" placeholder="{intl l='Country title'}">
|
||||
</div>
|
||||
</div>
|
||||
{/loop}
|
||||
|
||||
<div class="col-md-12 text-right">
|
||||
<button type="submit" class="btn btn-default btn-primary" title="{intl l='Add a new country'}">
|
||||
{intl l="Save"}
|
||||
<span class="glyphicon glyphicon-ok"></span>
|
||||
</button>
|
||||
{/form_field}
|
||||
{form_field form=$form field='chapo'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||
<textarea id="{$label_attr.for}" name="{$name}" class="form-control" title="{intl l=""}" placeholder="{intl l='Country short description'}">{$value}</textarea>
|
||||
</div>
|
||||
{/form_field}
|
||||
{form_field form=$form field='description'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{intl l="{$label}"} : </label>
|
||||
<textarea id="{$label_attr.for}" name="{$name}" class="form-control" title="{intl l="{$label}"}" placeholder="{intl l='Country description'}">{$value}</textarea>
|
||||
</div>
|
||||
{/form_field}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
{/form}
|
||||
|
||||
|
||||
@@ -8,12 +8,12 @@
|
||||
<div class="shipping-configuration edit-shipping-configuration">
|
||||
|
||||
<div id="wrapper" class="container">
|
||||
|
||||
{loop name="area-edit" type="area" id=$area_id}
|
||||
<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_configuration'}">{intl l="Shipping configuration"}</a></li>
|
||||
<li>{intl l='Editing shipping configuration "%name"' name="{$TITLE}"}</li>
|
||||
<li>{intl l='Editing shipping configuration "%name"' name="{$NAME}"}</li>
|
||||
</ul>
|
||||
|
||||
<div class="row">
|
||||
@@ -21,30 +21,40 @@
|
||||
<div class="general-block-decorator">
|
||||
|
||||
<div class="col-md-12 title title-without-tabs">
|
||||
{intl l='Edit shipping configuration %title' title=$TITLE}
|
||||
{intl l='Edit shipping configuration %title' title=$NAME}
|
||||
</div>
|
||||
|
||||
<div class="form-container clearfix">
|
||||
<div class="col-md-4">
|
||||
|
||||
|
||||
{form name="thelia.admin.area.country"}
|
||||
<form method="POST" action="{url path="/admin/configuration/shipping_configuration/country/add"}">
|
||||
{form_hidden_fields form=$form}
|
||||
|
||||
<form method="POST" action="">
|
||||
<label class="control-label" for="">{intl l="Country"}</label>
|
||||
{form_field form=$form field='success_url'}
|
||||
<input type="hidden" name="{$name}" value="{url path="/admin/configuration/shipping_configuration/update/{$area_id}"}" >
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='area_id'}
|
||||
<input type="hidden" name="{$name}" value="{$area_id}">
|
||||
{/form_field}
|
||||
{form_field form=$form field='country_id'}
|
||||
<label class="control-label" for="{$label_attr.for}">{intl l="Country"}</label>
|
||||
|
||||
<div class="input-group">
|
||||
<select name="" id="" data-toggle="selectpicker">
|
||||
<option value="1">France</option>
|
||||
<option value="2">Monaco</option>
|
||||
<option value="3">Nouvelle-Calédonie</option>
|
||||
<select name="{$name}" id="{$label_attr.for}" data-toggle="selectpicker">
|
||||
{loop name="country-without-area" type="country" with_area="0" backend_context="1" lang=$lang_id}
|
||||
<option value="{$ID}">{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
<span class="input-group-btn">
|
||||
<button type="submit" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-plus-sign"></span> {intl l="Add this country"}</button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{/form_field}
|
||||
</form>
|
||||
|
||||
{/form}
|
||||
</div>
|
||||
|
||||
<div class="col-md-8">
|
||||
@@ -57,44 +67,46 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{loop name="country-area" type="country" area=$area_id backend_context="1"}
|
||||
<tr>
|
||||
<td>Wallis-et-Futuna</td>
|
||||
<td>{$TITLE}</td>
|
||||
<td>
|
||||
<a class="btn btn-default btn-xs" title="{intl l='Delete this country'}" href="#delete_country_dialog" data-id="{$ID}" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-trash"></span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Polynésie française</td>
|
||||
<td>
|
||||
<a class="btn btn-default btn-xs" title="{intl l='Delete this country'}" href="#delete_country_dialog" data-id="{$ID}" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-trash"></span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>USA - Alabama</td>
|
||||
<td>
|
||||
<a class="btn btn-default btn-xs" title="{intl l='Delete this country'}" href="#delete_zone_dialog" data-id="{$ID}" data-toggle="modal">
|
||||
<a class="btn btn-default btn-xs btn-delete-country" title="{intl l='Delete this country'}" href="#delete_country_dialog" data-id="{$ID}" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-trash"></span>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{/loop}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr class="active">
|
||||
<td colspan="2">
|
||||
<form method="POST" action="">
|
||||
<label for="" class="control-label">{intl l="Freight"}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" name="" id="" placeholder="Freight value">
|
||||
{form name="thelia.admin.area.postage"}
|
||||
<form method="POST" action="{url path="/admin/configuration/shipping_configuration/update_postage/{$area_id}"}">
|
||||
{form_hidden_fields form=$form}
|
||||
|
||||
{form_field form=$form field='success_url'}
|
||||
<input type="hidden" name="{$name}" value="{url path="/admin/configuration/shipping_configuration/update/{$area_id}"}" >
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='area_id'}
|
||||
<input type="hidden" name="{$name}" value="{$area_id}">
|
||||
{/form_field}
|
||||
{form_field form=$form field='postage'}
|
||||
<label for="{$label_attr.for}" class="control-label">{$label}</label>
|
||||
<div class="input-group {if $error}has-error{/if}">
|
||||
<input type="text" class="form-control" name="{$name}" value="{$POSTAGE}" id="{$label_attr.for}" placeholder="Postage">
|
||||
<span class="input-group-addon">€</span>
|
||||
<span class="input-group-btn">
|
||||
<button type="submit" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-check"></span></button>
|
||||
</span>
|
||||
{if $error }
|
||||
<span class="help-block"><i class="icon-remove"></i> {$message}</span>
|
||||
{/if}
|
||||
</div>
|
||||
{/form_field}
|
||||
</form>
|
||||
{/form}
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
@@ -106,14 +118,23 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/loop}
|
||||
|
||||
{elseloop rel="area-edit"}
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
{intl l="No area defined with this id"}
|
||||
</div>
|
||||
</div>
|
||||
{/elseloop}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{* Delete related content confirmation dialog *}
|
||||
|
||||
{capture "delete_country_dialog"}
|
||||
|
||||
<input type="hidden" name="area_id" value="{$area_id}">
|
||||
<input type="hidden" name="country_id" id="delete-country-id" value="">
|
||||
{/capture}
|
||||
|
||||
{include
|
||||
@@ -123,7 +144,7 @@
|
||||
dialog_title = {intl l="Remove country"}
|
||||
dialog_message = {intl l="Do you really want to remove this country ?"}
|
||||
|
||||
form_action = {url path=''}
|
||||
form_action = {url path='/admin/configuration/shipping_configuration/country/remove'}
|
||||
form_content = {$smarty.capture.delete_country_dialog nofilter}
|
||||
}
|
||||
{/block}
|
||||
@@ -135,4 +156,12 @@
|
||||
{javascripts file='assets/js/bootstrap-select/bootstrap-select.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$(".btn-delete-country").click(function(e){
|
||||
$("#delete-country-id").val($(this).data("id"));
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
@@ -41,66 +41,24 @@
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{loop name="area-list" type="area" backend_context="1"}
|
||||
<tr>
|
||||
<td>France</td>
|
||||
<td><a href="{url path="/admin/configuration/shipping_configuration/update/$ID"}">{$NAME}</a></td>
|
||||
|
||||
{module_include location='shipping_configuration_table_row'}
|
||||
|
||||
<td>
|
||||
{if ! $SECURED}
|
||||
<div class="btn-group">
|
||||
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.shipping-configuration.change"}
|
||||
<a class="btn btn-default btn-xs shipping-configuration-change" title="{intl l='Change this shipping configuration'}" href="{url path="/admin/configuration/shipping_configuration/update/$ID"}"><i class="glyphicon glyphicon-edit"></i></a>
|
||||
{/loop}
|
||||
{loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.configuration.shipping-configuration.delete"}
|
||||
<a class="btn btn-default btn-xs shipping-configuration-delete" title="{intl l='Delete this shipping configuration'}" href="#delete_dialog" data-id="{$ID}" data-toggle="modal"><i class="glyphicon glyphicon-trash"></i></a>
|
||||
{/loop}
|
||||
</div>
|
||||
{else}
|
||||
<i title="{intl l='This shipping configuration could not be changed.'}" class="glyphicon glyphicon-ban-circle"></i>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Outre-Mer DOM</td>
|
||||
|
||||
{module_include location='shipping_configuration_table_row'}
|
||||
|
||||
<td>
|
||||
{if ! $SECURED}
|
||||
<div class="btn-group">
|
||||
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.shipping-configuration.change"}
|
||||
<a class="btn btn-default btn-xs shipping-configuration-change" title="{intl l='Change this shipping configuration'}" href="{url path="/admin/configuration/shipping_configuration/update/$ID"}"><i class="glyphicon glyphicon-edit"></i></a>
|
||||
{/loop}
|
||||
{loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.configuration.shipping-configuration.delete"}
|
||||
<a class="btn btn-default btn-xs shipping-configuration-delete" title="{intl l='Delete this shipping configuration'}" href="#delete_dialog" data-id="{$ID}" data-toggle="modal"><i class="glyphicon glyphicon-trash"></i></a>
|
||||
{/loop}
|
||||
</div>
|
||||
{else}
|
||||
<i title="{intl l='This shipping configuration could not be changed.'}" class="glyphicon glyphicon-ban-circle"></i>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Outre-Mer TOM</td>
|
||||
|
||||
{module_include location='shipping_configuration_table_row'}
|
||||
|
||||
<td>
|
||||
{if ! $SECURED}
|
||||
<div class="btn-group">
|
||||
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.shipping-configuration.change"}
|
||||
<a class="btn btn-default btn-xs shipping-configuration-change" title="{intl l='Change this shipping configuration'}" href="{url path="/admin/configuration/shipping_configuration/update/$ID"}"><i class="glyphicon glyphicon-edit"></i></a>
|
||||
{/loop}
|
||||
{loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.configuration.shipping-configuration.delete"}
|
||||
<a class="btn btn-default btn-xs shipping-configuration-delete" title="{intl l='Delete this shipping configuration'}" href="#delete_dialog" data-id="{$ID}" data-toggle="modal"><i class="glyphicon glyphicon-trash"></i></a>
|
||||
{/loop}
|
||||
</div>
|
||||
{else}
|
||||
<i title="{intl l='This shipping configuration could not be changed.'}" class="glyphicon glyphicon-ban-circle"></i>
|
||||
{/if}
|
||||
<div class="btn-group">
|
||||
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.shipping-configuration.change"}
|
||||
<a class="btn btn-default btn-xs area-configuration-change" title="{intl l='Change this shipping configuration'}" href="{url path="/admin/configuration/shipping_configuration/update/$ID"}"><i class="glyphicon glyphicon-edit"></i></a>
|
||||
{/loop}
|
||||
{loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.configuration.shipping-configuration.delete"}
|
||||
<a class="btn btn-default btn-xs area-configuration-delete" title="{intl l='Delete this shipping configuration'}" href="#delete_dialog" data-id="{$ID}" data-toggle="modal"><i class="glyphicon glyphicon-trash"></i></a>
|
||||
{/loop}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{/loop}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -117,16 +75,23 @@
|
||||
|
||||
{* Capture the dialog body, to pass it to the generic dialog *}
|
||||
{capture "creation_dialog"}
|
||||
{form name="thelia.admin.area.create"}
|
||||
{form_hidden_fields form=$form}
|
||||
|
||||
|
||||
{form_field form=$form field='success_url'}
|
||||
{* on success, redirect to the edition page, _ID_ is replaced with the created object ID, see controller *}
|
||||
<input type="hidden" name="{$name}" value="{url path='/admin/configuration/shipping_configuration/update/_ID_'}" />
|
||||
{/form_field}
|
||||
{form_field form=$form field="name"}
|
||||
<div class="form-group">
|
||||
<label for="" class="control-label">{intl l="Name"} : </label>
|
||||
<input type="text" id="" name="" class="form-control" title="{intl l="Name"}" placeholder="{intl l='Shipping configuration name'}">
|
||||
<label for="{$label_attr.for}" class="control-label">{$label} : </label>
|
||||
<input type="text" id="{$label_attr.for}" name="{$name}" class="form-control" title="{intl l="Name"}" placeholder="{intl l='Shipping configuration name'}">
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
|
||||
{module_include location='shipping_configuration_create_form'}
|
||||
|
||||
{/form}
|
||||
{/capture}
|
||||
|
||||
{include
|
||||
@@ -139,7 +104,7 @@
|
||||
dialog_ok_label = {intl l="Create this shipping configuration"}
|
||||
dialog_cancel_label = {intl l="Cancel"}
|
||||
|
||||
form_action = {url path='/admin/configuration/configuration/shipping_configuration/create'}
|
||||
form_action = {url path='/admin/configuration/shipping_configuration/create'}
|
||||
form_enctype = ''
|
||||
form_error_message = $form_error_message
|
||||
}
|
||||
@@ -147,7 +112,7 @@
|
||||
{* Delete confirmation dialog *}
|
||||
|
||||
{capture "delete_dialog"}
|
||||
<input type="hidden" name="shipping_zones_id" id="shipping_configuration_delete_id" value="" />
|
||||
<input type="hidden" name="area_id" id="shipping_configuration_delete_id" value="" />
|
||||
|
||||
{module_include location='shipping_configuration_delete_form'}
|
||||
|
||||
@@ -163,4 +128,14 @@
|
||||
form_action = {url path='/admin/configuration/shipping_configuration/delete'}
|
||||
form_content = {$smarty.capture.delete_dialog nofilter}
|
||||
}
|
||||
{/block}
|
||||
|
||||
{block name="javascript-initialization"}
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$(".area-configuration-delete").click(function(e){
|
||||
$("#shipping_configuration_delete_id").val($(this).data("id"));
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
@@ -26,25 +26,33 @@
|
||||
|
||||
<div class="form-container clearfix">
|
||||
<div class="col-md-4">
|
||||
|
||||
<form method="POST" action="">
|
||||
<label class="control-label" for="">{intl l="Zones"}</label>
|
||||
{form name="thelia.shopping_zone_area"}
|
||||
<form method="POST" action="{url path="/admin/configuration/shipping_zones/area/add"}">
|
||||
{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 *}
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='shipping_zone_id'}
|
||||
<input type="hidden" name="{$name}" value="{$shipping_zones_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="" id="" data-toggle="selectpicker">
|
||||
<option value="">1</option>
|
||||
<option value="">2</option>
|
||||
<option value="">3</option>
|
||||
<option value="">4</option>
|
||||
<option value="">5</option>
|
||||
<select name="{$name}" id="{$label_attr.for}" data-toggle="selectpicker">
|
||||
{loop name="area.module.not_associated" type="area" without_zone=$shipping_zones_id}
|
||||
<option value="{$ID}">{$NAME}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
<span class="input-group-btn">
|
||||
<button type="submit" class="btn btn-default btn-primary"><span class="glyphicon glyphicon-plus-sign"></span> {intl l="Add"}</button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{/form_field}
|
||||
</form>
|
||||
|
||||
{/form}
|
||||
</div>
|
||||
|
||||
<div class="col-md-8">
|
||||
@@ -57,30 +65,16 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{loop type="area" name="area.module.associated" with_zone=$shipping_zones_id}
|
||||
<tr>
|
||||
<td>France</td>
|
||||
<td>{$NAME}</td>
|
||||
<td>
|
||||
<a class="btn btn-default btn-xs" 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>
|
||||
<tr>
|
||||
<td>Zone 1</td>
|
||||
<td>
|
||||
<a class="btn btn-default btn-xs" 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>
|
||||
<tr>
|
||||
<td>Zone 2</td>
|
||||
<td>
|
||||
<a class="btn btn-default btn-xs" title="{intl l='Delete this zone'}" href="#delete_zone_dialog" data-id="{$ID}" data-toggle="modal">
|
||||
<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}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -97,7 +91,22 @@
|
||||
{* Delete related content confirmation dialog *}
|
||||
|
||||
{capture "delete_zone_dialog"}
|
||||
|
||||
{form name="thelia.shopping_zone_remove_area"}
|
||||
{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 *}
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='shipping_zone_id'}
|
||||
<input type="hidden" name="{$name}" value="{$shipping_zones_id}" />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='area_id'}
|
||||
<input type="hidden" name="{$name}" value="" id="shipping-zone-id-delete" />
|
||||
{/form_field}
|
||||
|
||||
{/form}
|
||||
{/capture}
|
||||
|
||||
{include
|
||||
@@ -107,7 +116,7 @@
|
||||
dialog_title = {intl l="Remove zone"}
|
||||
dialog_message = {intl l="Do you really want to remove this zone ?"}
|
||||
|
||||
form_action = {url path=''}
|
||||
form_action = {url path='/admin/configuration/shipping_zones/area/remove'}
|
||||
form_content = {$smarty.capture.delete_zone_dialog nofilter}
|
||||
}
|
||||
{/block}
|
||||
@@ -119,4 +128,12 @@
|
||||
{javascripts file='assets/js/bootstrap-select/bootstrap-select.js'}
|
||||
<script src="{$asset_url}"></script>
|
||||
{/javascripts}
|
||||
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
$(".delete-zone-area").click(function(e){
|
||||
$("#shipping-zone-id-delete").val($(this).data('id'));
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/block}
|
||||
@@ -36,57 +36,21 @@
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{loop type="delivery" name="delivery.list" backend_context="1"}
|
||||
<tr>
|
||||
<td>So Colissimo</td>
|
||||
<td><a href="{url path="/admin/configuration/shipping_zones/update/$ID"}">{$TITLE}</a></td>
|
||||
|
||||
{module_include location='shipping_zones_table_row'}
|
||||
|
||||
<td>
|
||||
{if ! $SECURED}
|
||||
<div class="btn-group">
|
||||
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.shipping-zones.change"}
|
||||
<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>
|
||||
{/loop}
|
||||
</div>
|
||||
{else}
|
||||
<i title="{intl l='This shipping zone could not be changed.'}" class="glyphicon glyphicon-ban-circle"></i>
|
||||
{/if}
|
||||
<div class="btn-group">
|
||||
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.shipping-zones.change"}
|
||||
<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>
|
||||
{/loop}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Chronopost</td>
|
||||
|
||||
{module_include location='shipping_zones_table_row'}
|
||||
|
||||
<td>
|
||||
{if ! $SECURED}
|
||||
<div class="btn-group">
|
||||
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.shipping-zones.change"}
|
||||
<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>
|
||||
{/loop}
|
||||
</div>
|
||||
{else}
|
||||
<i title="{intl l='This shipping zone could not be changed.'}" class="glyphicon glyphicon-ban-circle"></i>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Kiala</td>
|
||||
|
||||
{module_include location='shipping_zones_table_row'}
|
||||
|
||||
<td>
|
||||
{if ! $SECURED}
|
||||
<div class="btn-group">
|
||||
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.shipping-zones.change"}
|
||||
<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>
|
||||
{/loop}
|
||||
</div>
|
||||
{else}
|
||||
<i title="{intl l='This shipping zone could not be changed.'}" class="glyphicon glyphicon-ban-circle"></i>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
{/loop}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -98,24 +62,4 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{* Delete confirmation dialog *}
|
||||
|
||||
{capture "delete_dialog"}
|
||||
<input type="hidden" name="shipping_zones_id" id="shipping_zones_delete_id" value="" />
|
||||
|
||||
{module_include location='shipping_zones_delete_form'}
|
||||
|
||||
{/capture}
|
||||
|
||||
{include
|
||||
file = "includes/generic-confirm-dialog.html"
|
||||
|
||||
dialog_id = "delete_dialog"
|
||||
dialog_title = {intl l="Delete shipping zone"}
|
||||
dialog_message = {intl l="Do you really want to delete this shipping zone ?"}
|
||||
|
||||
form_action = {url path='/admin/configuration/shipping_zones/delete'}
|
||||
form_content = {$smarty.capture.delete_dialog nofilter}
|
||||
}
|
||||
{/block}
|
||||
397
templates/admin/default/tax-rule-edit.html
Normal file
397
templates/admin/default/tax-rule-edit.html
Normal file
@@ -0,0 +1,397 @@
|
||||
{extends file="admin-layout.tpl"}
|
||||
|
||||
{block name="page-title"}{intl l='Edit a tax rule'}{/block}
|
||||
|
||||
{block name="check-permissions"}admin.configuration.taxes-rules.edit{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
|
||||
{assign oder_tab {$smarty.get.tab|default:$smarty.post.tab|default:'data'}}
|
||||
{assign asked_country {$smarty.get.country|default:{country ask="default" attr="id"}}}
|
||||
|
||||
<div class="taxes-rules edit-taxes-rules">
|
||||
|
||||
<div id="wrapper" class="container">
|
||||
|
||||
<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/taxes_rules'}">{intl l="Taxes rules"}</a></li>
|
||||
<li>{intl l='Editing tax rule'}</li>
|
||||
</ul>
|
||||
|
||||
{loop type="tax-rule" name="tax-rule" id=$tax_rule_id backend_context="1" lang=$edit_language_id}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12 general-block-decorator clearfix">
|
||||
|
||||
<ul class="nav nav-tabs clearfix">
|
||||
<li {if $oder_tab == 'data'}class="active"{/if}><a href="#data" data-tab-name="cart" data-toggle="tab"><span class="glyphicon glyphicon-shopping-cart"></span> {intl l="Description"}</a></li>
|
||||
<li {if $oder_tab == 'taxes'}class="active"{/if}><a href="#taxes" data-tab-name="bill" data-toggle="tab"><span class="glyphicon glyphicon-list-alt"></span> {intl l="Taxes"}</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade {if $oder_tab == 'data'}active in{/if}" id="data">
|
||||
|
||||
<div class="form-container">
|
||||
|
||||
{form name="thelia.admin.taxrule.modification"}
|
||||
|
||||
<form method="POST" action="{url path="/admin/configuration/taxes_rules/save"}" {form_enctype form=$form} >
|
||||
|
||||
{include
|
||||
file = "includes/inner-form-toolbar.html"
|
||||
hide_submit_buttons = false
|
||||
|
||||
page_url = {url path="/admin/configuration/taxes_rules/update/$tax_rule_id" tab=data}
|
||||
close_url = {url path="/admin/configuration/taxes_rules"}
|
||||
}
|
||||
|
||||
{* Be sure to get the product ID, even if the form could not be validated *}
|
||||
<input type="hidden" name="tax_rule_id" value="{$ID}" />
|
||||
|
||||
{form_hidden_fields form=$form}
|
||||
|
||||
{form_field form=$form field='success_url'}
|
||||
<input type="hidden" name="{$name}" value="{url path="/admin/configuration/taxes_rules"}" />
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='locale'}
|
||||
<input type="hidden" name="{$name}" value="{$edit_language_locale}" />
|
||||
{/form_field}
|
||||
|
||||
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
|
||||
|
||||
{form_field form=$form field='title'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{intl l=$label} : </label>
|
||||
<input type="text" id="{$label_attr.for}" name="{$name}" required="required" title="{intl l='Title'}" placeholder="{intl l='Title'}" class="form-control" value="{if $error}{$value}{else}{if $IS_TRANSLATED == 1}{$TITLE}{/if}{/if}">
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='description'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">
|
||||
{intl l=$label} :
|
||||
<span class="label-help-block">{intl l="The detailed description."}</span>
|
||||
</label>
|
||||
|
||||
<textarea name="{$name}" id="{$label_attr.for}" rows="10" class="form-control wysiwyg">{if $error}{$value}{else}{if $IS_TRANSLATED == 1}{$DESCRIPTION}{/if}{/if}</textarea>
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="control-group">
|
||||
<label> </label>
|
||||
<div class="controls">
|
||||
<p>{intl l='Tax rule created on %date_create. Last modification: %date_change' date_create={format_date date=$CREATE_DATE} date_change={format_date date=$UPDATE_DATE}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
{/form}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade {if $oder_tab == 'taxes'}active in{/if}" id="taxes">
|
||||
|
||||
<div class="col-md-12 title title-without-tabs">
|
||||
{intl l="Manage taxes"}
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="" class="label-control">{intl l="Choose a country"} :</label>
|
||||
<form id="country-selector-form" action="{url path="/admin/configuration/taxes_rules/update/$tax_rule_id"}" method="GET">
|
||||
<input type="hidden" name="tab" value="taxes">
|
||||
<select id="country-selector" name="country" data-toggle="selectpicker">
|
||||
{loop type="country" name="country-list"}
|
||||
<option value="{$ID}" {if $ID == $asked_country}selected="selected"{/if}>{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<p><strong>{intl l="Countries that have the same tax rule"} :<strong></p>
|
||||
<p class="lead">
|
||||
|
||||
{$matchedCountries.first=$asked_country}
|
||||
|
||||
{loop type="tax-rule-country" name="same-country-list" tax_rule=$ID taxes="1,2,3" country=$asked_country}
|
||||
{$matchedCountries[]=$COUNTRY}
|
||||
<span class="label label-info">{$COUNTRY_TITLE}</span>
|
||||
{/loop}
|
||||
|
||||
{elseloop rel="same-country-list"}
|
||||
<span class="label label-danger">{intl l="NONE"}</span>
|
||||
{/elseloop}
|
||||
</p>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
|
||||
<div id="panel" class="panel panel-default place">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">{intl l="Manage the tax rule taxes appliance order"}</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
{assign lastPosition 0}
|
||||
{loop type="tax-rule-country" name="existing-tax-list" tax_rule=$ID country=$asked_country}
|
||||
{if $POSITION != $lastPosition}
|
||||
{assign lastPosition $POSITION}
|
||||
{if $LOOP_COUNT > 1}
|
||||
</div>
|
||||
{/if}
|
||||
<div class="drop-group droppable add-to-group">
|
||||
<p class="drop-message">
|
||||
<span class="glyphicon glyphicon-plus"></span>
|
||||
<span class="message">{intl l="Add tax to this group"}</span>
|
||||
</p>
|
||||
{/if}
|
||||
|
||||
<div class="drag" data-id="{$TAX}">{$TAX_TITLE}</div>
|
||||
|
||||
{if $LOOP_COUNT == $LOOP_TOTAL}
|
||||
</div>
|
||||
{/if}
|
||||
{/loop}
|
||||
|
||||
{elseloop rel="existing-tax-list"}
|
||||
<div class="drop-group droppable add-to-group">
|
||||
<p class="drop-message">
|
||||
<span class="glyphicon glyphicon-plus"></span>
|
||||
<span class="message">{intl l="Add tax to this group"}</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/elseloop}
|
||||
|
||||
</div>
|
||||
<div class="panel-footer droppable create-group">
|
||||
<p class="drop-message">
|
||||
<span class="glyphicon glyphicon-plus"></span>
|
||||
<span class="message">{intl l="Drop tax here to create a tax group"}</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a href="#tax_list_update_dialog" data-toggle="modal" id="apply-taxes-rules" class="btn btn-default btn-primary btn-block"><span class="glyphicon glyphicon-check"></span> {intl l="Apply"}</a>
|
||||
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
|
||||
<div id="panel-list" class="panel panel-default take">
|
||||
<div class="panel-heading">
|
||||
<h3 class="panel-title">Available taxes</h3>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
{loop type="tax" name="tax-list" exclude_tax_rule=$ID country=$asked_country}
|
||||
<div class="draggable" data-id="{$ID}">{$TITLE}</div>
|
||||
{/loop}
|
||||
</div>
|
||||
<div class="panel-footer droppable remove-from-group">
|
||||
<p class="drop-message">
|
||||
<span class="glyphicon glyphicon-minus"></span>
|
||||
<span class="message">{intl l="Drop tax here to delete from group"}</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/loop}
|
||||
|
||||
</div>
|
||||
|
||||
{* Confirmation dialog *}
|
||||
{form name="thelia.admin.taxrule.taxlistupdate"}
|
||||
|
||||
{if $form_error_message}
|
||||
{$taxUpdateError = true}
|
||||
{else}
|
||||
{$taxUpdateError = false}
|
||||
{/if}
|
||||
|
||||
{* Capture the dialog body, to pass it to the generic dialog *}
|
||||
{capture "tax_list_update_dialog"}
|
||||
|
||||
<input type="hidden" name="tax_rule_id" value="{$tax_rule_id}">
|
||||
<input type="hidden" name="tab" value="taxes">
|
||||
|
||||
{form_hidden_fields form=$form}
|
||||
|
||||
{form_field form=$form field='country_list'}
|
||||
|
||||
<p>{intl l="Tax rule taxes will be update for the following countries :"}</p>
|
||||
<div class="form-group">
|
||||
<select name="{$name}" data-toggle="selectpicker" multiple>
|
||||
{loop type="country" name="country-list"}
|
||||
<option value='{$ID}' {if (!$value AND in_array($ID, $matchedCountries)) OR ($value AND in_array($ID, $value))}selected="selected"{/if}>{$TITLE}</option>
|
||||
{/loop}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
{/form_field}
|
||||
|
||||
{/capture}
|
||||
|
||||
{include
|
||||
file = "includes/generic-create-dialog.html"
|
||||
|
||||
dialog_id = "tax_list_update_dialog"
|
||||
dialog_title = {intl l="Update tax rule taxes"}
|
||||
dialog_body = {$smarty.capture.tax_list_update_dialog nofilter}
|
||||
|
||||
dialog_ok_label = {intl l="Edit tax rule taxes"}
|
||||
dialog_cancel_label = {intl l="Cancel"}
|
||||
|
||||
form_action = {url path="/admin/configuration/taxes_rules/saveTaxes"}
|
||||
form_enctype = {form_enctype form=$form}
|
||||
form_error_message = $form_error_message
|
||||
}
|
||||
|
||||
{/form}
|
||||
|
||||
{/block}
|
||||
|
||||
{block name="javascript-initialization"}
|
||||
|
||||
{javascripts file='assets/js/bootstrap-select/bootstrap-select.js'}
|
||||
<script src='{$asset_url}'></script>
|
||||
{/javascripts}
|
||||
|
||||
{javascripts file='assets/js/main.js'}
|
||||
<script src='{$asset_url}'></script>
|
||||
{/javascripts}
|
||||
|
||||
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
|
||||
{if $taxUpdateError == true}
|
||||
$('#tax_list_update_dialog').modal();
|
||||
{/if}
|
||||
|
||||
{literal}
|
||||
$('#country-selector').change(function(e) {
|
||||
$('#country-selector-form').submit();
|
||||
});
|
||||
|
||||
// Cache jQuery Objects
|
||||
var $group = $('#panel');
|
||||
var $list = $('#panel-list');
|
||||
|
||||
// Build array of taxes rules
|
||||
$('#apply-taxes-rules').click(function(){
|
||||
var taxesRules = [],
|
||||
index;
|
||||
|
||||
$('.drop-group', $group).each(function(i){
|
||||
var $this = $(this);
|
||||
index = i;
|
||||
taxesRules[index] = [];
|
||||
|
||||
$('.drag', $this).each(function(j){
|
||||
taxesRules[index][j] = [];
|
||||
taxesRules[index][j] = $(this).data('id'); // retrieve with data
|
||||
});
|
||||
});
|
||||
|
||||
console.log(taxesRules);
|
||||
$('#tax_list').val(JSON.stringify(taxesRules));
|
||||
});
|
||||
|
||||
// Default options for draggable
|
||||
var dragOptions = {
|
||||
cursor: 'move',
|
||||
containment: "document",
|
||||
opacity: 0.5,
|
||||
revert: "invalid", // when not dropped, the item will revert back to its initial position
|
||||
zIndex: 10
|
||||
};
|
||||
|
||||
// Default options for sortabble
|
||||
var sortOptions = {
|
||||
cursor: 'move',
|
||||
cancel: '.drop-message',
|
||||
update: function( event, ui ){
|
||||
// Check if we have an empty group
|
||||
var $zone = $('.add-to-group', $group);
|
||||
if($zone.size() > 1 && $(this).find('> div').size() == 0){ // Remove empty group only if we have more than 1 group
|
||||
$(this).slideUp(function(){ $(this).remove(); });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Default options for droppable
|
||||
var dropOptions = {
|
||||
accept: "#panel-list .draggable", // Controls which draggable elements are accepted
|
||||
hoverClass: "over",
|
||||
drop: function( event, ui ) {
|
||||
var $drop = $(this);
|
||||
|
||||
if($(this).hasClass('create-group')){
|
||||
// Check if we have already an empty group
|
||||
var $empty_group = $group.find('.drop-group:not(:has(> div))');
|
||||
if($empty_group.size() > 0){ // if yes (Use the first empty group)
|
||||
$drop = $empty_group.filter(':first');
|
||||
}else{ //if no (Create a new group)
|
||||
$drop = $group.find('.drop-group:last-child').clone().appendTo($group.find('.panel-body'));
|
||||
|
||||
// Remove taxes
|
||||
$drop.find('> div').remove();
|
||||
|
||||
// Make the new group droppable
|
||||
$drop
|
||||
.droppable(dropOptions)
|
||||
.sortable(sortOptions);
|
||||
}
|
||||
}
|
||||
|
||||
$("<div></div>").addClass('drag').attr('data-id', ui.draggable.data('id')).text( ui.draggable.text()).appendTo( $drop );
|
||||
ui.draggable.remove();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Make the list of taxes draggable
|
||||
$('.draggable', $list).draggable(dragOptions);
|
||||
|
||||
|
||||
// let the drop-group be droppable & sortable, accepting the tax items
|
||||
$('.droppable', $group)
|
||||
.droppable(dropOptions)
|
||||
.sortable(sortOptions);
|
||||
|
||||
$('.place .panel-body').sortable(sortOptions);
|
||||
|
||||
// let the gallery be droppable as well, accepting items from the trash
|
||||
$('.remove-from-group', $list)
|
||||
.droppable({
|
||||
accept: "#panel .drag",
|
||||
hoverClass: 'over',
|
||||
drop: function( event, ui ) {
|
||||
$("<div></div>").addClass('draggable').text( ui.draggable.text() ).attr('data-id', ui.draggable.data('id')).draggable(dragOptions).appendTo( $list.find('.panel-body') );
|
||||
ui.draggable.remove();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
{/literal}
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
{/block}
|
||||
168
templates/admin/default/taxes-rules.html
Normal file
168
templates/admin/default/taxes-rules.html
Normal file
@@ -0,0 +1,168 @@
|
||||
{extends file="admin-layout.tpl"}
|
||||
|
||||
{block name="page-title"}{intl l='Taxes rules'}{/block}
|
||||
|
||||
{block name="check-permissions"}admin.taxes-rules.view{/block}
|
||||
|
||||
{block name="main-content"}
|
||||
<div class="taxes-rules">
|
||||
|
||||
<div id="wrapper" class="container">
|
||||
|
||||
<div class="clearfix">
|
||||
<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/taxes_rules'}">{intl l="Taxes rules"}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
{module_include location='taxes_rules_top'}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="general-block-decorator">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-condensed table-left-aligned">
|
||||
<caption class="clearfix">
|
||||
{intl l="Taxes rules"}
|
||||
{loop type="auth" name="can_create" roles="ADMIN" permissions="admin.taxes-rules.create"}
|
||||
<a class="btn btn-default btn-primary pull-right" title="{intl l='Create a new tax rule'}" href="#tax_rule_create_dialog" data-toggle="modal">
|
||||
<span class="glyphicon glyphicon-plus"></span>
|
||||
</a>
|
||||
{/loop}
|
||||
</caption>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{intl l="Name"}</th>
|
||||
<th>{intl l="Description"}</th>
|
||||
<th>{intl l="Actions"}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
{loop type="tax-rule" name="taxes-rules"}
|
||||
|
||||
<tr>
|
||||
<td>{$TITLE}</td>
|
||||
<td>{$DESCRIPTION}</td>
|
||||
<td>
|
||||
<div class="btn-group">
|
||||
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.taxes-rules.change"}
|
||||
<a class="btn btn-default btn-xs" title="{intl l='Change this tax rule'}" href="{url path="/admin/configuration/taxes_rules/update/$ID"}"><span class="glyphicon glyphicon-edit"></span></a>
|
||||
{/loop}
|
||||
|
||||
{loop type="auth" name="can_change" roles="ADMIN" permissions="admin.configuration.taxes-rules.change"}
|
||||
<a class="btn btn-default btn-xs js-delete-tax-rule" title="{intl l='Delete this tax rule'}" href="#tax_rule_delete_dialog" data-id="{$ID}" data-toggle="modal"><span class="glyphicon glyphicon-trash"></span></a>
|
||||
{/loop}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
{/loop}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{module_include location='taxes_rules_bottom'}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{* -- Add tax rule confirmation dialog ----------------------------------- *}
|
||||
{form name="thelia.admin.taxrule.add"}
|
||||
|
||||
{if $form_error_message}
|
||||
{$taxCreateError = true}
|
||||
{else}
|
||||
{$taxCreateError = false}
|
||||
{/if}
|
||||
|
||||
{* Capture the dialog body, to pass it to the generic dialog *}
|
||||
{capture "tax_rule_create_dialog"}
|
||||
|
||||
{form_hidden_fields form=$form}
|
||||
|
||||
{form_field form=$form field='locale'}
|
||||
<input type="hidden" name="{$name}" value="{$edit_language_locale}" />
|
||||
{/form_field}
|
||||
|
||||
{if $form_error}<div class="alert alert-danger">{$form_error_message}</div>{/if}
|
||||
|
||||
{form_field form=$form field='title'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">{intl l=$label} : </label>
|
||||
<input type="text" id="{$label_attr.for}" name="{$name}" required="required" title="{intl l='Title'}" placeholder="{intl l='Title'}" class="form-control" value="{if $error}{$value}{else}{if $IS_TRANSLATED == 1}{$TITLE}{/if}{/if}">
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
{form_field form=$form field='description'}
|
||||
<div class="form-group {if $error}has-error{/if}">
|
||||
<label for="{$label_attr.for}" class="control-label">
|
||||
{intl l=$label} :
|
||||
<span class="label-help-block">{intl l="The detailed description."}</span>
|
||||
</label>
|
||||
|
||||
<textarea name="{$name}" id="{$label_attr.for}" rows="10" class="form-control wysiwyg">{if $error}{$value}{else}{if $IS_TRANSLATED == 1}{$DESCRIPTION}{/if}{/if}</textarea>
|
||||
</div>
|
||||
{/form_field}
|
||||
|
||||
{/capture}
|
||||
|
||||
{include
|
||||
file = "includes/generic-create-dialog.html"
|
||||
|
||||
dialog_id = "tax_rule_create_dialog"
|
||||
dialog_title = {intl l="Create a new tax rule"}
|
||||
dialog_body = {$smarty.capture.tax_rule_create_dialog nofilter}
|
||||
|
||||
dialog_ok_label = {intl l="Create"}
|
||||
dialog_cancel_label = {intl l="Cancel"}
|
||||
|
||||
form_action = {url path="/admin/configuration/taxes_rules/add"}
|
||||
form_enctype = {form_enctype form=$form}
|
||||
form_error_message = $form_error_message
|
||||
}
|
||||
|
||||
{/form}
|
||||
|
||||
{* -- Delete tax rule confirmation dialog ----------------------------------- *}
|
||||
|
||||
{capture "tax_rule_delete_dialog"}
|
||||
<input type="hidden" name="tax_rule_id" id="tax_rule_delete_id" value="" />
|
||||
|
||||
{module_include location='tax_rule_delete_form'}
|
||||
|
||||
{/capture}
|
||||
|
||||
{include
|
||||
file = "includes/generic-confirm-dialog.html"
|
||||
|
||||
dialog_id = "tax_rule_delete_dialog"
|
||||
dialog_title = {intl l="Delete tax rule"}
|
||||
dialog_message = {intl l="Do you really want to delete this tax rule ?"}
|
||||
|
||||
form_action = {url path='/admin/configuration/taxes_rules/delete'}
|
||||
form_content = {$smarty.capture.tax_rule_delete_dialog nofilter}
|
||||
}
|
||||
|
||||
{/block}
|
||||
|
||||
{block name="javascript-initialization"}
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
{if $taxCreateError == true}
|
||||
$('#tax_rule_create_dialog').modal();
|
||||
{/if}
|
||||
|
||||
$(".js-delete-tax-rule").click(function(e){
|
||||
$('#tax_rule_delete_id').val($(this).data('id'))
|
||||
});
|
||||
</script>
|
||||
|
||||
{/block}
|
||||
Reference in New Issue
Block a user