169 lines
8.1 KiB
Smarty
169 lines
8.1 KiB
Smarty
{*
|
|
* TNT OFFICIAL MODULE FOR PRESTASHOP
|
|
*
|
|
* @author GFI Informatique <www.gfi.fr>
|
|
* @copyright 2016 GFI Informatique, 2016 TNT
|
|
* @license https://opensource.org/licenses/MIT MIT License
|
|
*}
|
|
<div id="formAdminShippingDatePanel" class="panel">
|
|
<div class="panel-heading">
|
|
<i class="icon-calendar"></i>
|
|
{l s='Shipping date' mod='tntofficiel'}
|
|
</div>
|
|
<div class="table-responsive">
|
|
<table class="table" id="parcelsTable">
|
|
<thead>
|
|
<tr>
|
|
<th><span class="title_box ">{l s='Shipping date' mod='tntofficiel'}</span></th>
|
|
<th><span class="title_box ">{l s='Due date' mod='tntofficiel'}</span></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>
|
|
<div class="input-group fixed-width-xl" style="float:left;margin-right:3px;">
|
|
<input type="text" name="shipping_date" id="shipping_date" class="datepicker" value="" >
|
|
<div class="input-group-addon">
|
|
<i class="icon-calendar-o"></i>
|
|
</div>
|
|
</div>
|
|
<div id="delivery-date-error" class="alert alert-danger alert-danger-small" style="display: none">
|
|
<p>{l s='La date n\'est pas valide' mod='tntofficiel'}</p>
|
|
</div>
|
|
<div id="delivery-date-success" class="alert alert-success alert-danger-small" style="display: none">
|
|
<p>{l s='La date est valide' mod='tntofficiel'}</p>
|
|
</div>
|
|
</td>
|
|
<td id="due-date">
|
|
{$dueDate|escape:'htmlall':'UTF-8'}
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
|
|
<span class="waitimage" style="display: none;"></span>
|
|
|
|
</div>
|
|
|
|
<div id="formAdminParcelsPanel" class="panel">
|
|
<div class="panel-heading">
|
|
<i class="icon-AdminTNTOfficiel"></i>
|
|
{l s='parcels' mod='tntofficiel'} <span class="badge">{$parcels|@count}</span> {if !empty($pickupNumber)}<span class="badge">{l s='Pickup number: ' mod='tntofficiel'} {$pickupNumber|escape:'htmlall':'UTF-8'}</span>{/if}
|
|
<span class="badge">{l s='Total weight: ' mod='tntofficiel'} <span id="total-weight">0</span> {l s='Kg' mod='tntofficiel'}</span>
|
|
</div>
|
|
<div class="table-responsive">
|
|
<table class="table" id="parcelsTable">
|
|
<thead>
|
|
<tr>
|
|
<th><span class="title_box ">{l s='parcel number' mod='tntofficiel'}</span></th>
|
|
<th><span class="title_box ">{l s='weight' mod='tntofficiel'}</span></th>
|
|
<th><span class="title_box ">{l s='action' mod='tntofficiel'}</span></th>
|
|
<th><span class="title_box ">{l s='PDL' mod='tntofficiel'}</span></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="parcelsTbody">
|
|
{foreach from=$parcels item=parcel key=parcelIndex}
|
|
<tr class="current-edit hidden-print" id="row-parcel-{$parcel.id_parcel|intval}">
|
|
<td>
|
|
<div class="input-group fixed-width-xl">
|
|
{$parcelIndex + 1|intval}
|
|
</div>
|
|
</td>
|
|
<td>
|
|
<input id="parcelWeight-{$parcel.id_parcel|intval}" value="{$parcel.weight|escape:'htmlall':'UTF-8'}">
|
|
<div class="alert alert-danger alert-danger-small" id="parcelWeightError-{$parcel.id_parcel|intval}" style="display: none">
|
|
<p id="updateParcelErrorMessage-{$parcel.id_parcel|intval}"></p>
|
|
</div>
|
|
<div class="alert alert-success alert-danger-small" id="parcelWeightSuccess-{$parcel.id_parcel|intval}" style="display: none">
|
|
<p id="updateParcelSuccessMessage-{$parcel.id_parcel|intval}">{l s='Update successful' mod='tntofficiel'}</p>
|
|
</div>
|
|
</td>
|
|
<td class="actions">
|
|
{if empty($isShipped)}
|
|
<button class="btn btn-primary updateParcel" value="{$parcel.id_parcel|intval}">
|
|
{l s='Update' mod='tntofficiel'}
|
|
</button>
|
|
<button class="btn btn-primary removeParcel" value="{$parcel.id_parcel|intval}">
|
|
{l s='Delete' mod='tntofficiel'}
|
|
</button>
|
|
{/if}
|
|
</td>
|
|
<td>
|
|
{if $parcel['pdl'] != ''}
|
|
<a href="{$parcel['pdl']|escape:'html':'UTF-8'}" target="_blank">
|
|
<button class="btn btn-primary" >
|
|
{l s='see' mod='tntofficiel'}
|
|
</button>
|
|
</a>
|
|
{/if}
|
|
</td>
|
|
</tr>
|
|
{/foreach}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{if empty($isShipped)}
|
|
<div class="row-margin-bottom row-margin-top">
|
|
<a href="#addParcelFancyBox" id="fancyBoxAddParcelLink">
|
|
<button class="btn btn-default" id="addParcel">
|
|
<i class="icon-plus-sign"></i>
|
|
{l s='add' mod='tntofficiel'}
|
|
</button>
|
|
</a>
|
|
</div>
|
|
{/if}
|
|
</div>
|
|
|
|
<div style="display:none">
|
|
<div class="bootstrap" id="addParcelFancyBox">
|
|
<h1 class="page-subheading">{l s='add parcel' mod='tntofficiel'}</h1>
|
|
<div class="alert alert-danger alert-danger-small" id="addParcelError" style="display: none">
|
|
<p id="addParcelErrorMessage"></p>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="weight">{l s='parcel weight' mod='tntofficiel'}</label>
|
|
<input class="form-control validate" type="text" id="addParcelWeight">
|
|
</div>
|
|
|
|
<p class="submit2">
|
|
<button type="submit" name="submitAddParcel" id="submitAddParcel" class="btn btn-default button button-medium">
|
|
<span>
|
|
{l s='save' mod='tntofficiel'}
|
|
<i class="icon-chevron-right right"></i>
|
|
</span>
|
|
</button>
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div>
|
|
<input type="hidden" id="AdminTNTOfficielToken" value="{$AdminTNTOfficielToken|escape:'htmlall':'UTF-8'}">
|
|
</div>
|
|
<div>
|
|
<input type="hidden" id="tntBt" value="{$bt_filename|escape:'htmlall':'UTF-8'}">
|
|
</div>
|
|
|
|
<script>
|
|
var removeParcelUrl = "{$removeParcelUrl|escape:'javascript':'UTF-8'}";
|
|
var addParcelUrl = "{$addParcelUrl|escape:'javascript':'UTF-8'}";
|
|
var updateParcelUrl = "{$updateParcelUrl|escape:'javascript':'UTF-8'}";
|
|
var checkShippingDateValidUrl = "{$checkShippingDateValidUrl|escape:'javascript':'UTF-8'}";
|
|
var updateSuccessfulStr = "{l s='Update successful' mod='tntofficiel'}";
|
|
var deleteStr = "{l s='Delete' mod='tntofficiel'}";
|
|
var updateStr = "{l s='Update' mod='tntofficiel'}";
|
|
var atLeastOneParcelStr = "{l s='An order requires at least one parcel' mod='tntofficiel'}";
|
|
var startDate = 0;
|
|
var tempDate;
|
|
{if $firstAvailableDate}
|
|
tempDate = "{$firstAvailableDate|escape:'javascript':'UTF-8'}".split("/");
|
|
var startDate = new Date(tempDate[2], tempDate[1] - 1, tempDate[0]);
|
|
{/if}
|
|
{if !empty($shippingDate)}
|
|
tempDate = "{$shippingDate|escape:'javascript':'UTF-8'}".split("-");
|
|
var shippingDate = new Date(tempDate[0], tempDate[1] - 1, tempDate[2]);
|
|
{/if}
|
|
var boolIsShipped = !!{$isShipped|intval};
|
|
var boolIsAddressEditable = !!{$isAddressEditable|intval};
|
|
</script> |