Merge branch 'bootstrap' of https://github.com/PrestaShop/PrestaShop into bootstrap

# By Jérôme Nadaud
# Via Jérôme Nadaud
* 'bootstrap' of https://github.com/PrestaShop/PrestaShop:
  [-] BO : Order template misplaced empty form
  [+] BO : Handler invoice date generation button
This commit is contained in:
Kevin Granger
2013-07-26 18:55:18 +02:00
2 changed files with 449 additions and 468 deletions
@@ -129,7 +129,7 @@
<div class="col-lg-12">
<!-- Change status form -->
<form action="{$currentIndex}&vieworder&token={$smarty.get.token}" method="post">
<fieldset class="well">
<fieldset>
<legend>
<i class="icon-table"></i>
{l s='Order status'}
@@ -189,21 +189,19 @@
{/if}
{/foreach}
</table>
{if $customer->id}
</fieldset>
</form>
</div>
{if $customer->id}
<!-- Customer informations -->
<div class="col-lg-6">
<form action="" method="">
<fieldset class="well">
<fieldset>
<legend>
<i class="icon-user"></i>
{l s='Customer information'}
</legend>
<span style="font-weight: bold; font-size: 14px;"><a href="?tab=AdminCustomers&id_customer={$customer->id}&viewcustomer&token={getAdminToken tab='AdminCustomers'}"> {$customer->firstname} {$customer->lastname}</a></span> ({l s='#'}{$customer->id})<br />
<span><a href="?tab=AdminCustomers&id_customer={$customer->id}&viewcustomer&token={getAdminToken tab='AdminCustomers'}"> {$customer->firstname} {$customer->lastname}</a></span> ({l s='#'}{$customer->id})<br />
(<a href="mailto:{$customer->email}">{$customer->email}</a>)<br /><br />
{if ($customer->isGuest())}
{l s='This order has been placed by a guest.'}
@@ -220,9 +218,8 @@
{l s='Account registered:'} <strong>{dateFormat date=$customer->date_add full=true}</strong><br />
{l s='Valid orders placed:'} <strong>{$customerStats['nb_orders']}</strong><br />
{l s='Total spent since registration:'} <strong>{displayPrice price=Tools::ps_round(Tools::convertPrice($customerStats['total_orders'], $currency), 2) currency=$currency->id}</strong><br />
{/if}
</fieldset>
{/if}
{/if}
<!-- Sources block -->
{if (sizeof($sources))}
@@ -246,13 +243,13 @@
<!-- Admin order hook -->
{hook h="displayAdminOrder" id_order=$order->id}
</form>
</div>
{/if}
<!-- New message -->
<div class="col-lg-6">
<form action="{$smarty.server.REQUEST_URI}&token={$smarty.get.token}" method="post" onsubmit="if (getE('visibility').checked == true) return confirm('{l s='Do you want to send this message to the customer?'}');">
<fieldset class="well">
<fieldset>
<legend onclick="$('#message').slideToggle();$('#message_m').slideToggle();return false">
<i class="icon-envelope"></i>
{l s='New message'}
@@ -289,7 +286,7 @@
</div>
<p id="nbchars" style="display:inline;font-size:10px;color:#666;"></p>
<textarea id="txt_msg" name="message" cols="50" rows="8" onKeyUp="var length = document.getElementById('txt_msg').value.length; if (length > 600) length = '600+'; document.getElementById('nbchars').innerHTML = '{l s='600 characters, max.'} (' + length + ')';">{Tools::getValue('message')|escape:'htmlall':'UTF-8'}</textarea><br /><br />
<textarea id="txt_msg" name="message" cols="50" rows="8" onKeyUp="var length = document.getElementById('txt_msg').value.length; if (length > 600) length = '600+'; document.getElementById('nbchars').innerHTML = '{l s='600 characters, max.'} (' + length + ')';">{Tools::getValue('message')|escape:'htmlall':'UTF-8'}</textarea>
<input type="hidden" name="id_order" value="{$order->id}" />
<input type="hidden" name="id_customer" value="{$order->id_customer}" />
<button type="submit" class="btn btn-default pull-right" name="submitMessage">
@@ -298,9 +295,9 @@
</div>
</fieldset>
</form>
{if (sizeof($messages))}
<form action="" method="">
<fieldset class="well">
<fieldset>
<legend>
<i class="icon-envelope"></i>
{l s='Messages'}
@@ -324,7 +321,6 @@
</div>
{/foreach}
</fieldset>
</form>
{/if}
</div>
@@ -333,9 +329,8 @@
<!-- Addresses -->
<div class="col-lg-6">
{if !$order->isVirtual()}
<form action="" method="">
<!-- Shipping address -->
<fieldset class="well">
<fieldset>
<legend>
<i class="icon-truck"></i>
{l s='Shipping address'}
@@ -380,14 +375,12 @@
</ul>
</div>
</fieldset>
</form>
{/if}
</div>
<!-- Invoice address -->
<div class="col-lg-6">
<form action="" method="">
<fieldset class="well">
<fieldset>
<legend>
<i class="icon-file"></i>
{l s='Invoice address'}
@@ -418,7 +411,6 @@
</a>
</div>
</fieldset>
</form>
</div>
<div class="col-lg-12"></div>
@@ -426,8 +418,7 @@
<!-- linked orders block -->
{if count($order->getBrother()) > 0}
<div class="col-lg-6">
<form action="" method="">
<fieldset class="well">
<fieldset>
<legend>
<i class="icon-shopping-cart"></i>
{l s='Linked orders'}
@@ -468,14 +459,12 @@
</tbody>
</table>
</fieldset>
</form>
</div>
{/if}
<!-- Documents block -->
<div class="col-lg-12">
<form action="" method="">
<fieldset class="well">
<fieldset>
<legend>
<i class="icon-file-text"></i>
{l s='Documents'}
@@ -483,13 +472,11 @@
{* Include document template *}
{include file='controllers/orders/_documents.tpl'}
</fieldset>
</form>
</div>
<!-- Payments block -->
<div class="col-lg-12">
<form action="" method="">
<fieldset class="well">
<fieldset>
<legend>
<i class="icon-money"></i>
{l s='Payment'}
@@ -663,14 +650,11 @@
</table>
</form>
</fieldset>
</form>
</div>
{if !$order->isVirtual()}
<!-- Shipping block -->
<div class="col-lg-6">
<form action="" method="">
<fieldset class="well">
<fieldset>
<legend>
<i class="icon-truck"></i>
{l s='Shipping'}
@@ -722,13 +706,11 @@
{$carrierModuleCall}
{/if}
</fieldset>
</form>
</div>
<!-- Return block -->
<div class="col-lg-6">
<form action="" method="">
<fieldset class="well">
<fieldset>
<legend>
<i class="icon-suitcase"></i>
{l s='Merchandise returns'}
@@ -793,14 +775,13 @@
{$carrierModuleCall}
{/if}
</fieldset>
</form>
</div>
{/if}
<div class="col-lg-12">
<form class="container-command-top-spacing" action="{$current_index}&vieworder&token={$smarty.get.token}&id_order={$order->id}" method="post" onsubmit="return orderDeleteProduct('{l s='This product cannot be returned.'}', '{l s='Quantity to cancel is greater than quantity available.'}');">
<input type="hidden" name="id_order" value="{$order->id}" />
<fieldset class="well">
<fieldset>
<div style="display: none">
<input type="hidden" value="{$order->getWarehouseList()|implode}" id="warehouse_list" />
</div>
@@ -991,10 +972,10 @@
{if ((!$order->hasBeenDelivered() && $order->hasBeenPaid()) || ($order->hasBeenDelivered() && Configuration::get('PS_ORDER_RETURN')))}
<input type="checkbox" id="generateCreditSlip" name="generateCreditSlip" onclick="toggleShippingCost(this)" />
<label for="generateCreditSlip" class="control-label">{l s='Generate a credit card slip'}</label><br />
<label for="generateCreditSlip" class="control-label">{l s='Generate a credit card slip'}</label>
<input type="checkbox" id="generateDiscount" name="generateDiscount" onclick="toggleShippingCost(this)" />
<label for="generateCreditSlip" class="control-label">{l s='Generate a voucher'}</label><br />
<label for="generateCreditSlip" class="control-label">{l s='Generate a voucher'}</label>
<span id="spanShippingBack" style="display:none;">
<input type="checkbox" id="shippingBack" name="shippingBack" />
@@ -213,7 +213,7 @@ class AdminInvoicesControllerCore extends AdminController
public function postProcess()
{
if (Tools::getValue('submitAddinvoice_date'))
if (Tools::isSubmit('submitAddinvoice_date'))
{
if (!Validate::isDate(Tools::getValue('date_from')))
$this->errors[] = $this->l('Invalid "From" date');