Merge branch 'ticket-12754-MailAlert' into develop
This commit is contained in:
commit
bd54b64402
@ -20,6 +20,7 @@ class AdminPrivateSaleMailDelay extends AdminTab {
|
|||||||
$objet_mail = Tools::getValue('objet_mail');
|
$objet_mail = Tools::getValue('objet_mail');
|
||||||
$envoi_remise = Tools::getValue('envoi_remise', 0);
|
$envoi_remise = Tools::getValue('envoi_remise', 0);
|
||||||
$prefix_remise = Tools::getValue('prefix_remise');
|
$prefix_remise = Tools::getValue('prefix_remise');
|
||||||
|
$status_pending = Tools::getValue('status_pending', 0);
|
||||||
|
|
||||||
if($id_category == 0 || !Validate::isInt($montant_remise)) {
|
if($id_category == 0 || !Validate::isInt($montant_remise)) {
|
||||||
echo '<div class="error">Vérifier le formulaire</div>';
|
echo '<div class="error">Vérifier le formulaire</div>';
|
||||||
@ -27,8 +28,9 @@ class AdminPrivateSaleMailDelay extends AdminTab {
|
|||||||
$sale = Sale::getSaleFromCategory((int) $id_category);
|
$sale = Sale::getSaleFromCategory((int) $id_category);
|
||||||
$category = new Category($id_category, $cookie->id_lang);
|
$category = new Category($id_category, $cookie->id_lang);
|
||||||
|
|
||||||
$orders_single = $sale->getOrdersFromSale(NULL, TRUE);
|
$id_status = $status_pending? array(19):NULL;
|
||||||
$orders_multiple = $sale->getOrdersFromSale(NULL, FALSE);
|
$orders_single = $sale->getOrdersFromSale($id_status, TRUE);
|
||||||
|
$orders_multiple = $sale->getOrdersFromSale($id_status, FALSE);
|
||||||
|
|
||||||
if($type_envoi == 0) {
|
if($type_envoi == 0) {
|
||||||
$orders = array_merge($orders_multiple, $orders_single);
|
$orders = array_merge($orders_multiple, $orders_single);
|
||||||
@ -41,7 +43,7 @@ class AdminPrivateSaleMailDelay extends AdminTab {
|
|||||||
$orders = array_unique($orders);
|
$orders = array_unique($orders);
|
||||||
|
|
||||||
if(Tools::isSubmit('submitEnvoi')) {
|
if(Tools::isSubmit('submitEnvoi')) {
|
||||||
$this->displayConfirmationForm($category, $type_envoi, $contenu_mail, count($orders), $sale, $objet_mail, $envoi_remise, $montant_remise, $prefix_remise);
|
$this->displayConfirmationForm($category, $type_envoi, $contenu_mail, count($orders), $sale, $objet_mail, $envoi_remise, $montant_remise, $prefix_remise, $status_pending);
|
||||||
} else if(Tools::isSubmit('confirmationEnvoi')) {
|
} else if(Tools::isSubmit('confirmationEnvoi')) {
|
||||||
$contenu_mail = str_replace("%marque%", $category->name , $contenu_mail);
|
$contenu_mail = str_replace("%marque%", $category->name , $contenu_mail);
|
||||||
|
|
||||||
@ -133,7 +135,7 @@ class AdminPrivateSaleMailDelay extends AdminTab {
|
|||||||
return $discount;
|
return $discount;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function displayConfirmationForm($category, $type_envoi, $contenu_mail, $nb_envoi, $sale, $objet_mail, $envoi_remise, $montant_remise = 0, $prefix_remise) {
|
public function displayConfirmationForm($category, $type_envoi, $contenu_mail, $nb_envoi, $sale, $objet_mail, $envoi_remise, $montant_remise = 0, $prefix_remise, $status_pending=0) {
|
||||||
if($type_envoi == 0) {
|
if($type_envoi == 0) {
|
||||||
$type_envoi_text = "Toutes";
|
$type_envoi_text = "Toutes";
|
||||||
} else if($type_envoi == 1) {
|
} else if($type_envoi == 1) {
|
||||||
@ -151,9 +153,10 @@ class AdminPrivateSaleMailDelay extends AdminTab {
|
|||||||
$output.= '<input type="hidden" name="envoi_remise" value="'.(int)$envoi_remise.'"/>';
|
$output.= '<input type="hidden" name="envoi_remise" value="'.(int)$envoi_remise.'"/>';
|
||||||
$output.= '<input type="hidden" name="montant_remise" value="'.(int)$montant_remise.'"/>';
|
$output.= '<input type="hidden" name="montant_remise" value="'.(int)$montant_remise.'"/>';
|
||||||
$output.= '<input type="hidden" name="prefix_remise" value="'. (string)$prefix_remise.'"/>';
|
$output.= '<input type="hidden" name="prefix_remise" value="'. (string)$prefix_remise.'"/>';
|
||||||
|
$output.= '<input type="hidden" name="status_pending" value="'. (string)$status_pending.'"/>';
|
||||||
|
|
||||||
$output .= '<p class="conf">Vous allez envoyer '. $nb_envoi .' mails pour un retard concernant la vente '. $category->name .'
|
$output .= '<p class="conf">Vous allez envoyer '. $nb_envoi .' mails pour un retard concernant la vente '. $category->name .'
|
||||||
<br /> Segmentation des commandes : '. $type_envoi_text .'</p>
|
<br /> Segmentation des commandes : '. $type_envoi_text .' '.($status_pending?'(en attente)':'').'</p>
|
||||||
<center>
|
<center>
|
||||||
<input type="submit" value="Confirmer l\'envoi" name="confirmationEnvoi" class="button">
|
<input type="submit" value="Confirmer l\'envoi" name="confirmationEnvoi" class="button">
|
||||||
</center>
|
</center>
|
||||||
@ -198,6 +201,12 @@ class AdminPrivateSaleMailDelay extends AdminTab {
|
|||||||
<input type="radio" id="simple" value="2" name="type_envoi" /> <label for="simple" style="float:none">Simple</label>
|
<input type="radio" id="simple" value="2" name="type_envoi" /> <label for="simple" style="float:none">Simple</label>
|
||||||
</div>';
|
</div>';
|
||||||
|
|
||||||
|
$output .= '<label>Uniquement en attente</label>
|
||||||
|
<div class="margin-form">
|
||||||
|
<input type="radio" id="status_pending_no" value="0" name="status_pending" checked /> <label for="status_pending_no" style="float:none">Non</label>
|
||||||
|
<input type="radio" id="status_pending_yes" value="1" name="status_pending" /> <label for="status_pending_yes" style="float:none">Oui</label>
|
||||||
|
</div>';
|
||||||
|
|
||||||
$output .= '
|
$output .= '
|
||||||
<hr >
|
<hr >
|
||||||
<label>Ajoutez une remise ?</label>
|
<label>Ajoutez une remise ?</label>
|
||||||
|
@ -533,8 +533,8 @@ var oneQuantityAvailableSentence = '{l s='Warning: 1 item in stock!' js=1}';
|
|||||||
{if $key == 1}
|
{if $key == 1}
|
||||||
<p>
|
<p>
|
||||||
<b>{$date.name}</b> : {l s='Date de réception prévue entre le'} <strong>{$date.date_start|date_format:'%d/%m/%Y'}</strong> {l s='et le'} <strong>{$date.date_end|date_format:'%d/%m/%Y'}</strong>
|
<b>{$date.name}</b> : {l s='Date de réception prévue entre le'} <strong>{$date.date_start|date_format:'%d/%m/%Y'}</strong> {l s='et le'} <strong>{$date.date_end|date_format:'%d/%m/%Y'}</strong>
|
||||||
<br>{l s='Le delai de livraison peut varier'}
|
|
||||||
</p>
|
</p>
|
||||||
|
<p>{l s='Le delai de livraison peut varier'}</p>
|
||||||
{elseif $key == 5}
|
{elseif $key == 5}
|
||||||
<p>
|
<p>
|
||||||
<b>{$date.name}</b> : {l s='Livraison prévue avant le'} <strong>{l s='24/12'}</strong>
|
<b>{$date.name}</b> : {l s='Livraison prévue avant le'} <strong>{l s='24/12'}</strong>
|
||||||
|
@ -512,8 +512,8 @@ var oneQuantityAvailableSentence = '{l s='Warning: 1 item in stock!' js=1}';
|
|||||||
{if $key == 1}
|
{if $key == 1}
|
||||||
<p style="text-align:center;">
|
<p style="text-align:center;">
|
||||||
<b>{$date.name}</b> : <br>{l s='Date de réception prévue entre le'} <strong>{$date.date_start|date_format:'%d/%m/%Y'}</strong> {l s='et le'} <strong>{$date.date_end|date_format:'%d/%m/%Y'}</strong>
|
<b>{$date.name}</b> : <br>{l s='Date de réception prévue entre le'} <strong>{$date.date_start|date_format:'%d/%m/%Y'}</strong> {l s='et le'} <strong>{$date.date_end|date_format:'%d/%m/%Y'}</strong>
|
||||||
<br>{l s='Le delai de livraison peut varier'}
|
|
||||||
</p>
|
</p>
|
||||||
|
<p>{l s='Le delai de livraison peut varier'}</p>
|
||||||
{elseif $key == 5}
|
{elseif $key == 5}
|
||||||
<p>
|
<p>
|
||||||
<b>{$date.name}</b> : <br>{l s='Livraison prévue avant le'} <strong>{l s='24/12'}</strong>
|
<b>{$date.name}</b> : <br>{l s='Livraison prévue avant le'} <strong>{l s='24/12'}</strong>
|
||||||
|
Loading…
Reference in New Issue
Block a user