Files
sterivein/local/modules/Colissimo/AdminIncludes/module_configuration.html
Benjamin Perche d00bc84cd5 Add dynamical prices editing in Colissimo
modified:   local/modules/Colissimo/AdminIncludes/module_configuration.html
	modified:   local/modules/Colissimo/Colissimo.php
	modified:   local/modules/Colissimo/Config/config.xml
	modified:   local/modules/Colissimo/Config/module.xml
	modified:   local/modules/Colissimo/Config/prices.json
	new file:   local/modules/Colissimo/Config/routing.xml
	modified:   local/modules/Colissimo/Config/thelia.sql
	new file:   local/modules/Colissimo/Controller/EditPrices.php
	new file:   local/modules/Colissimo/I18n/en_US.php
	new file:   local/modules/Colissimo/I18n/fr_FR.php
	modified:   local/modules/Colissimo/Listener/SendMail.php
	new file:   local/modules/Colissimo/Loop/CheckRightsLoop.php
	modified:   local/modules/Colissimo/Loop/Price.php
	modified:   local/modules/Colissimo/documentation/TarifsAvril2013.pdf
	modified:   local/modules/Colissimo/documentation/readme.txt
2014-02-19 09:51:22 +01:00

116 lines
6.0 KiB
HTML
Executable File

<div class="row">
<!-- Errors -->
{loop name="checkrights.colissimo" type="colissimo.check.rights"}
<div class="alert alert-danger">
<p>{$ERRMES} {$ERRFILE} | {intl l="Please change the access rights"}.</p>
</div>
{/loop}
</div>
{elseloop rel="checkrights.colissimo"}
<div class="row">
<div class="col-md-12">
<div class="alert alert-info">
<p>{intl l="Colissimo Module allows to send your products all around the world with La Poste."}</p>
</div>
<div class="general-block-decorator">
{* -- Add price slice confirmation dialog ----------------------------------- *}
{loop type="area" name="list area" backend_context=true}
{include
file = "includes/generic-create-dialog.html"
dialog_id = "price_slice_create_dialog_{$ID}"
dialog_title = {intl 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 l="Weight up to ... (kg)"}</label></label>
<input type=\"number\" id=\"weight_{$ID}\" name=\"weight\" value=\"1\" class=\"form-control\" pattern=\"\\d+\\.?\\d*\" required/>
<label for=\"price_{$ID}\">{intl l="Price (€)"}</label></label>
<input type=\"number\" id=\"price_{$ID}\" name=\"price\" value=\"1\" class=\"form-control\" pattern=\"\\d+\\.?\\d*\" required/>"
form_action="{url path="/admin/module/colissimo/prices"}"
dialog_ok_label = {intl l="Create"}
dialog_cancel_label = {intl l="Cancel"}
}
<div class="table-responsive">
<table class="table table-striped table-condensed table-left-aligned">
<caption class="clearfix">
{intl l="Area : "}{$NAME}
{loop type="auth" name="can_create" role="ADMIN" module="colissimo" access="CREATE"}
<a class="btn btn-default btn-primary pull-right" title="{intl 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 l="Weight up to ... (kg)"}</th>
<th class="col-md-5">{intl l="Price (€)"}</th>
<th class="col-md-1">{intl l="Actions"}</th>
</tr>
</thead>
<tbody>
{loop type="colissimo" name="colissimo" 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 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 l='Price (€)'}</label>
<input type=\"number\" id=\"price_edit_{$ID}_{$MAX_WEIGHT}\" class=\"form-control\" name=\"price\" value=\"{$PRICE}\" pattern=\"\\d+\\.?\\d*\" required/>"
form_action="{url path="/admin/module/colissimo/prices"}"
dialog_ok_label = {intl l="Edit"}
dialog_cancel_label = {intl 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 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 l="Do you really want to delete this slice ?"}"
form_action="{url path="/admin/module/colissimo/prices"}"
dialog_ok_label = {intl l="Delete"}
dialog_cancel_label = {intl l="Cancel"}
}
<tr>
<td>{$MAX_WEIGHT}</td>
<td>{$PRICE}</td>
<td>
<div class="btn-group">
{loop type="auth" name="can_change" role="ADMIN" module="colissimo" access="UPDATE"}
<a class="btn btn-default btn-xs" title="{intl 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 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>
{/elseloop}