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"> <div class="col-lg-12">
<!-- Change status form --> <!-- Change status form -->
<form action="{$currentIndex}&vieworder&token={$smarty.get.token}" method="post"> <form action="{$currentIndex}&vieworder&token={$smarty.get.token}" method="post">
<fieldset class="well"> <fieldset>
<legend> <legend>
<i class="icon-table"></i> <i class="icon-table"></i>
{l s='Order status'} {l s='Order status'}
@@ -189,21 +189,19 @@
{/if} {/if}
{/foreach} {/foreach}
</table> </table>
{if $customer->id}
</fieldset> </fieldset>
</form> </form>
</div> </div>
{if $customer->id}
<!-- Customer informations --> <!-- Customer informations -->
<div class="col-lg-6"> <div class="col-lg-6">
<form action="" method=""> <fieldset>
<fieldset class="well">
<legend> <legend>
<i class="icon-user"></i> <i class="icon-user"></i>
{l s='Customer information'} {l s='Customer information'}
</legend> </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 /> (<a href="mailto:{$customer->email}">{$customer->email}</a>)<br /><br />
{if ($customer->isGuest())} {if ($customer->isGuest())}
{l s='This order has been placed by a guest.'} {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='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='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 /> {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> </fieldset>
{/if}
{/if}
<!-- Sources block --> <!-- Sources block -->
{if (sizeof($sources))} {if (sizeof($sources))}
@@ -246,13 +243,13 @@
<!-- Admin order hook --> <!-- Admin order hook -->
{hook h="displayAdminOrder" id_order=$order->id} {hook h="displayAdminOrder" id_order=$order->id}
</form>
</div> </div>
{/if}
<!-- New message --> <!-- New message -->
<div class="col-lg-6"> <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?'}');"> <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"> <legend onclick="$('#message').slideToggle();$('#message_m').slideToggle();return false">
<i class="icon-envelope"></i> <i class="icon-envelope"></i>
{l s='New message'} {l s='New message'}
@@ -289,7 +286,7 @@
</div> </div>
<p id="nbchars" style="display:inline;font-size:10px;color:#666;"></p> <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_order" value="{$order->id}" />
<input type="hidden" name="id_customer" value="{$order->id_customer}" /> <input type="hidden" name="id_customer" value="{$order->id_customer}" />
<button type="submit" class="btn btn-default pull-right" name="submitMessage"> <button type="submit" class="btn btn-default pull-right" name="submitMessage">
@@ -298,9 +295,9 @@
</div> </div>
</fieldset> </fieldset>
</form> </form>
{if (sizeof($messages))} {if (sizeof($messages))}
<form action="" method=""> <fieldset>
<fieldset class="well">
<legend> <legend>
<i class="icon-envelope"></i> <i class="icon-envelope"></i>
{l s='Messages'} {l s='Messages'}
@@ -324,7 +321,6 @@
</div> </div>
{/foreach} {/foreach}
</fieldset> </fieldset>
</form>
{/if} {/if}
</div> </div>
@@ -333,9 +329,8 @@
<!-- Addresses --> <!-- Addresses -->
<div class="col-lg-6"> <div class="col-lg-6">
{if !$order->isVirtual()} {if !$order->isVirtual()}
<form action="" method="">
<!-- Shipping address --> <!-- Shipping address -->
<fieldset class="well"> <fieldset>
<legend> <legend>
<i class="icon-truck"></i> <i class="icon-truck"></i>
{l s='Shipping address'} {l s='Shipping address'}
@@ -380,14 +375,12 @@
</ul> </ul>
</div> </div>
</fieldset> </fieldset>
</form>
{/if} {/if}
</div> </div>
<!-- Invoice address --> <!-- Invoice address -->
<div class="col-lg-6"> <div class="col-lg-6">
<form action="" method=""> <fieldset>
<fieldset class="well">
<legend> <legend>
<i class="icon-file"></i> <i class="icon-file"></i>
{l s='Invoice address'} {l s='Invoice address'}
@@ -418,7 +411,6 @@
</a> </a>
</div> </div>
</fieldset> </fieldset>
</form>
</div> </div>
<div class="col-lg-12"></div> <div class="col-lg-12"></div>
@@ -426,8 +418,7 @@
<!-- linked orders block --> <!-- linked orders block -->
{if count($order->getBrother()) > 0} {if count($order->getBrother()) > 0}
<div class="col-lg-6"> <div class="col-lg-6">
<form action="" method=""> <fieldset>
<fieldset class="well">
<legend> <legend>
<i class="icon-shopping-cart"></i> <i class="icon-shopping-cart"></i>
{l s='Linked orders'} {l s='Linked orders'}
@@ -468,14 +459,12 @@
</tbody> </tbody>
</table> </table>
</fieldset> </fieldset>
</form>
</div> </div>
{/if} {/if}
<!-- Documents block --> <!-- Documents block -->
<div class="col-lg-12"> <div class="col-lg-12">
<form action="" method=""> <fieldset>
<fieldset class="well">
<legend> <legend>
<i class="icon-file-text"></i> <i class="icon-file-text"></i>
{l s='Documents'} {l s='Documents'}
@@ -483,13 +472,11 @@
{* Include document template *} {* Include document template *}
{include file='controllers/orders/_documents.tpl'} {include file='controllers/orders/_documents.tpl'}
</fieldset> </fieldset>
</form>
</div> </div>
<!-- Payments block --> <!-- Payments block -->
<div class="col-lg-12"> <div class="col-lg-12">
<form action="" method=""> <fieldset>
<fieldset class="well">
<legend> <legend>
<i class="icon-money"></i> <i class="icon-money"></i>
{l s='Payment'} {l s='Payment'}
@@ -663,14 +650,11 @@
</table> </table>
</form> </form>
</fieldset> </fieldset>
</form>
</div> </div>
{if !$order->isVirtual()} {if !$order->isVirtual()}
<!-- Shipping block --> <!-- Shipping block -->
<div class="col-lg-6"> <fieldset>
<form action="" method="">
<fieldset class="well">
<legend> <legend>
<i class="icon-truck"></i> <i class="icon-truck"></i>
{l s='Shipping'} {l s='Shipping'}
@@ -722,13 +706,11 @@
{$carrierModuleCall} {$carrierModuleCall}
{/if} {/if}
</fieldset> </fieldset>
</form>
</div> </div>
<!-- Return block --> <!-- Return block -->
<div class="col-lg-6"> <div class="col-lg-6">
<form action="" method=""> <fieldset>
<fieldset class="well">
<legend> <legend>
<i class="icon-suitcase"></i> <i class="icon-suitcase"></i>
{l s='Merchandise returns'} {l s='Merchandise returns'}
@@ -793,14 +775,13 @@
{$carrierModuleCall} {$carrierModuleCall}
{/if} {/if}
</fieldset> </fieldset>
</form>
</div> </div>
{/if} {/if}
<div class="col-lg-12"> <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.'}');"> <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}" /> <input type="hidden" name="id_order" value="{$order->id}" />
<fieldset class="well"> <fieldset>
<div style="display: none"> <div style="display: none">
<input type="hidden" value="{$order->getWarehouseList()|implode}" id="warehouse_list" /> <input type="hidden" value="{$order->getWarehouseList()|implode}" id="warehouse_list" />
</div> </div>
@@ -991,10 +972,10 @@
{if ((!$order->hasBeenDelivered() && $order->hasBeenPaid()) || ($order->hasBeenDelivered() && Configuration::get('PS_ORDER_RETURN')))} {if ((!$order->hasBeenDelivered() && $order->hasBeenPaid()) || ($order->hasBeenDelivered() && Configuration::get('PS_ORDER_RETURN')))}
<input type="checkbox" id="generateCreditSlip" name="generateCreditSlip" onclick="toggleShippingCost(this)" /> <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)" /> <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;"> <span id="spanShippingBack" style="display:none;">
<input type="checkbox" id="shippingBack" name="shippingBack" /> <input type="checkbox" id="shippingBack" name="shippingBack" />
@@ -213,7 +213,7 @@ class AdminInvoicesControllerCore extends AdminController
public function postProcess() public function postProcess()
{ {
if (Tools::getValue('submitAddinvoice_date')) if (Tools::isSubmit('submitAddinvoice_date'))
{ {
if (!Validate::isDate(Tools::getValue('date_from'))) if (!Validate::isDate(Tools::getValue('date_from')))
$this->errors[] = $this->l('Invalid "From" date'); $this->errors[] = $this->l('Invalid "From" date');