Init du module DHL (sur la base du module Colissimo)

This commit is contained in:
2020-12-03 17:12:39 +01:00
parent 979767253d
commit 7f00efb081
48 changed files with 4198 additions and 541 deletions

View File

@@ -0,0 +1,139 @@
<div class="row">
<!-- Errors -->
{loop name="checkrights.dhl" type="dhl.check.rights"}
<div class="alert alert-danger">
<p>{$ERRMES} {$ERRFILE} | {intl d='dhl.bo.default' l="Please change the access rights"}.</p>
</div>
{/loop}
</div>
{elseloop rel="checkrights.dhl"}
<div class="alert alert-info">
<p>{intl d='dhl.bo.default' l="DHL Module allows to send your products all around the world."}</p>
</div>
<div class="general-block-decorator">
<div class="row">
<div class="col-md-12">
{form name="dhl.configuration"}
<form method="POST" action="{url path='/admin/module/dhl/configuration/update'}">
{form_hidden_fields form=$form}
{render_form_field field="tracking_url" value={module_config module="DHL" key='tracking_url' locale="fr_FR"}}
<button type="submit" name="dhl_save_configuration" value="save" class="form-submit-button btn btn-sm btn-default" title="{intl d='dhl.bo.default' l='Save'}">
{intl d='dhl.bo.default' l='Save'}
</button>
</form>
{/form}
</div>
</div>
</div>
<div class="general-block-decorator">
<div class="row">
<div class="col-md-12">
<div class="tab-content">
<div id="prices_slices_tab" class="tab-pane active form-container">
<div id="table-prices-dhl">
<!-- Prices editing -->
{* -- Add price slice confirmation dialog ----------------------------------- *}
{loop type="area" name="list area" backend_context=true module_id=$module_id}
{include
file = "includes/generic-create-dialog.html"
dialog_id = "price_slice_create_dialog_{$ID}"
dialog_title = {intl d='dhl.bo.default' l="Create a price slice"}
dialog_body = "<input type=\"hidden\" name=\"operation\" value=\"add\"/>
<input type=\"hidden\" name=\"area\" value=\"{$ID}\" />
<label for=\"weight_{$ID}\">{intl d='dhl.bo.default' l="Weight up to ... (kg)"}</label></label>
<input type=\"number\" step=\"0.01\" id=\"weight_{$ID}\" name=\"weight\" value=\"1\" class=\"form-control\" pattern=\"\d+\.?\d*\" required/>
<label for=\"price_{$ID}\">{intl d='dhl.bo.default' l="Price (€)"}</label></label>
<input type=\"number\" step=\"0.01\" id=\"price_{$ID}\" name=\"price\" value=\"1\" class=\"form-control\" pattern=\"\d+\.?\d*\" required/>"
form_action="{url path="/admin/module/dhl/prices"}"
dialog_ok_label = {intl d='dhl.bo.default' l="Create"}
dialog_cancel_label = {intl d='dhl.bo.default' l="Cancel"}
}
<div class="table-responsive">
<table class="table table-striped table-condensed table-left-aligned">
<caption class="clearfix">
{intl d='dhl.bo.default' l="Area : "}{$NAME}
{loop type="auth" name="can_create" role="ADMIN" module="dhl" access="CREATE"}
<a class="btn btn-default btn-primary pull-right" title="{intl d='dhl.bo.default' l='Create a new price slice'}" href="#price_slice_create_dialog_{$ID}" data-toggle="modal">
<span class="glyphicon glyphicon-plus"></span>
</a>
{/loop}
</caption>
<thead>
<tr>
<th class="col-md-3">{intl d='dhl.bo.default' l="Weight up to ... (kg)"}</th>
<th class="col-md-5">{intl d='dhl.bo.default' l="Price (€)"}</th>
<th class="col-md-1">{intl d='dhl.bo.default' l="Actions"}</th>
</tr>
</thead>
<tbody>
{loop type="dhl" name="dhl" area=$ID}
{* -- EDIT price slice confirmation dialog ----------------------------------- *}
{include
file = "includes/generic-confirm-dialog.html"
dialog_id = "price_slice_edit_dialog_{$ID}_{$MAX_WEIGHT|replace:'.':'-'}"
dialog_title = {intl d='dhl.bo.default' l="Edit a price slice"}
dialog_message = "<input type=\"hidden\" name=\"operation\" value=\"add\"/>
<input type=\"hidden\" name=\"area\" value=\"{$ID}\"/>
<input type=\"hidden\" name=\"weight\" value=\"{$MAX_WEIGHT}\"/>
<label for=\"price_edit_{$ID}_{$MAX_WEIGHT}\">{intl d='dhl.bo.default' l='Price (€)'}</label>
<input type=\"number\" step=\"0.01\" id=\"price_edit_{$ID}_{$MAX_WEIGHT}\" class=\"form-control\" name=\"price\" value=\"{$PRICE}\" pattern=\"\d+\.?\d*\" required/>"
form_action="{url path="/admin/module/dhl/prices"}"
dialog_ok_label = {intl d='dhl.bo.default' l="Edit"}
dialog_cancel_label = {intl d='dhl.bo.default' l="Cancel"}
}
{* -- Delete price slice confirmation dialog ----------------------------------- *}
{include
file = "includes/generic-confirm-dialog.html"
dialog_id = "price_slice_delete_dialog_{$ID}_{$MAX_WEIGHT|replace:'.':'-'}"
dialog_title = {intl d='dhl.bo.default' l="Delete a price slice"}
dialog_message = "<input type=\"hidden\" name=\"operation\" value=\"delete\"/>
<input type=\"hidden\" name=\"area\" value=\"{$ID}\"/>
<input type=\"hidden\" name=\"weight\" value=\"{$MAX_WEIGHT}\"/>
{intl d='dhl.bo.default' l="Do you really want to delete this slice ?"}"
form_action="{url path="/admin/module/dhl/prices"}"
dialog_ok_label = {intl d='dhl.bo.default' l="Delete"}
dialog_cancel_label = {intl d='dhl.bo.default' l="Cancel"}
}
<tr>
<td>{$MAX_WEIGHT}</td>
<td>{$PRICE}</td>
<td>
<div class="btn-group">
{loop type="auth" name="can_change" role="ADMIN" module="dhl" access="UPDATE"}
<a class="btn btn-default btn-xs" title="{intl d='dhl.bo.default' l='Edit this price slice'}" href="#price_slice_edit_dialog_{$ID}_{$MAX_WEIGHT|replace:'.':'-'}" data-toggle="modal">
<span class="glyphicon glyphicon-edit"></span>
</a>
<a class="btn btn-default btn-xs" title="{intl d='dhl.bo.default' l='Delete this price slice'}" href="#price_slice_delete_dialog_{$ID}_{$MAX_WEIGHT|replace:'.':'-'}" data-toggle="modal">
<span class="glyphicon glyphicon-trash"></span>
</a>
{/loop}
</div>
</td>
</tr>
{/loop}
</tbody>
</table>
</div>
{/loop}
</div>
</div>
</div>
</div>
</div>
</div>
{/elseloop}