Skip to content
Snippets Groups Projects
Commit 11023fa2 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Merge pull request #857 from marcosgdf/task-823

New: [ task #823 ] Shipping_validate email notification
parents e19e0ff5 82e3a8d0
No related branches found
No related tags found
No related merge requests found
...@@ -50,6 +50,7 @@ For users: ...@@ -50,6 +50,7 @@ For users:
- New: [ task #770 ] Add ODT document generation for Projects module - New: [ task #770 ] Add ODT document generation for Projects module
- New: [ task #741 ] Add intervention box - New: [ task #741 ] Add intervention box
- New: [ task #826 ] Optionnal increase stock when deleting an invoice already validated - New: [ task #826 ] Optionnal increase stock when deleting an invoice already validated
- New: [ task #823 ] Shipping_validate email notification
For translators: For translators:
- Update language files. - Update language files.
......
<?php <?php
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2011 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -35,7 +36,8 @@ class InterfaceNotification ...@@ -35,7 +36,8 @@ class InterfaceNotification
'PROPAL_VALIDATE', 'PROPAL_VALIDATE',
'FICHINTER_VALIDATE', 'FICHINTER_VALIDATE',
'ORDER_SUPPLIER_APPROVE', 'ORDER_SUPPLIER_APPROVE',
'ORDER_SUPPLIER_REFUSE' 'ORDER_SUPPLIER_REFUSE',
'SHIPPING_VALIDATE'
); );
/** /**
...@@ -196,6 +198,19 @@ class InterfaceNotification ...@@ -196,6 +198,19 @@ class InterfaceNotification
$notify = new Notify($this->db); $notify = new Notify($this->db);
$notify->send($action, $object->socid, $mesg, 'order_supplier', $object->id, $filepdf); $notify->send($action, $object->socid, $mesg, 'order_supplier', $object->id, $filepdf);
} }
elseif ($action == 'SHIPPING_VALIDATE')
{
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$ref = dol_sanitizeFileName($object->ref);
$filepdf = $conf->expedition->dir_output . '/sending/' . $ref . '/' . $ref . '.pdf';
if (! file_exists($filepdf)) $filepdf='';
$mesg = $langs->transnoentitiesnoconv("EMailTextExpeditionValidated",$object->ref);
$notify = new Notify($this->db);
$notify->send($action, $object->socid, $mesg, 'expedition', $object->id, $filepdf);
}
// If not found // If not found
/* /*
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro> * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Marcos García <marcosgdf@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -698,16 +699,16 @@ if ($action == 'create') ...@@ -698,16 +699,16 @@ if ($action == 'create')
//$lines = $object->fetch_lines(1); //$lines = $object->fetch_lines(1);
$numAsked = count($object->lines); $numAsked = count($object->lines);
print '<script type="text/javascript" language="javascript"> print '<script type="text/javascript" language="javascript">
jQuery(document).ready(function() { jQuery(document).ready(function() {
jQuery("#autofill").click(function() {'; jQuery("#autofill").click(function() {';
$i=0; $i=0;
while($i < $numAsked) while($i < $numAsked)
{ {
print 'jQuery("#qtyl'.$i.'").val(jQuery("#qtyasked'.$i.'").val() - jQuery("#qtydelivered'.$i.'").val());'."\n"; print 'jQuery("#qtyl'.$i.'").val(jQuery("#qtyasked'.$i.'").val() - jQuery("#qtydelivered'.$i.'").val());'."\n";
$i++; $i++;
} }
print '}); print '});
jQuery("#autoreset").click(function() {'; jQuery("#autoreset").click(function() {';
$i=0; $i=0;
while($i < $numAsked) while($i < $numAsked)
...@@ -716,8 +717,8 @@ if ($action == 'create') ...@@ -716,8 +717,8 @@ if ($action == 'create')
$i++; $i++;
} }
print '}); print '});
}); });
</script>'; </script>';
print '<br>'; print '<br>';
...@@ -904,7 +905,7 @@ if ($action == 'create') ...@@ -904,7 +905,7 @@ if ($action == 'create')
print '<br><center><input type="submit" class="button" value="'.$langs->trans("Create").'"></center>'; print '<br><center><input type="submit" class="button" value="'.$langs->trans("Create").'"></center>';
print '</form>'; print '</form>';
print '<br>'; print '<br>';
} }
...@@ -974,7 +975,18 @@ else ...@@ -974,7 +975,18 @@ else
{ {
$numref = $object->ref; $numref = $object->ref;
} }
$ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('ValidateSending'),$langs->trans("ConfirmValidateSending",$numref),'confirm_valid','',0,1);
$text = $langs->trans("ConfirmValidateSending",$numref);
if (! empty($conf->notification->enabled))
{
require_once DOL_DOCUMENT_ROOT .'/core/class/notify.class.php';
$notify=new Notify($db);
$text.='<br>';
$text.=$notify->confirmMessage('SHIPPING_VALIDATE',$object->socid);
}
$ret=$form->form_confirm($_SERVER['PHP_SELF'].'?id='.$object->id,$langs->trans('ValidateSending'),$text,'confirm_valid','',0,1);
if ($ret == 'html') print '<br>'; if ($ret == 'html') print '<br>';
} }
/* /*
......
...@@ -152,6 +152,7 @@ EMailTextOrderApproved=The order %s has been approved. ...@@ -152,6 +152,7 @@ EMailTextOrderApproved=The order %s has been approved.
EMailTextOrderApprovedBy=The order %s has been approved by %s. EMailTextOrderApprovedBy=The order %s has been approved by %s.
EMailTextOrderRefused=The order %s has been refused. EMailTextOrderRefused=The order %s has been refused.
EMailTextOrderRefusedBy=The order %s has been refused by %s. EMailTextOrderRefusedBy=The order %s has been refused by %s.
EMailTextExpeditionValidated=The shipping %s has been validated.
ImportedWithSet=Importation data set ImportedWithSet=Importation data set
DolibarrNotification=Automatic notification DolibarrNotification=Automatic notification
ResizeDesc=Enter new width <b>OR</b> new height. Ratio will be kept during resizing... ResizeDesc=Enter new width <b>OR</b> new height. Ratio will be kept during resizing...
......
...@@ -151,6 +151,7 @@ EMailTextOrderApproved=Pedido %s aprobado ...@@ -151,6 +151,7 @@ EMailTextOrderApproved=Pedido %s aprobado
EMailTextOrderApprovedBy=Pedido %s aprobado por %s EMailTextOrderApprovedBy=Pedido %s aprobado por %s
EMailTextOrderRefused=Pedido %s rechazado EMailTextOrderRefused=Pedido %s rechazado
EMailTextOrderRefusedBy=Pedido %s rechazado por %s EMailTextOrderRefusedBy=Pedido %s rechazado por %s
EMailTextExpeditionValidated=El envío %s ha sido validado.
ImportedWithSet=Lote de importación (import key) ImportedWithSet=Lote de importación (import key)
DolibarrNotification=Notificación automática DolibarrNotification=Notificación automática
ResizeDesc=Introduzca el nuevo ancho <b>O</b> la nueva altura. La relación se conserva al cambiar el tamaño ... ResizeDesc=Introduzca el nuevo ancho <b>O</b> la nueva altura. La relación se conserva al cambiar el tamaño ...
......
...@@ -151,6 +151,7 @@ EMailTextOrderApproved=La commande %s a été approuvée. ...@@ -151,6 +151,7 @@ EMailTextOrderApproved=La commande %s a été approuvée.
EMailTextOrderApprovedBy=La commande %s a été approuvée par %s. EMailTextOrderApprovedBy=La commande %s a été approuvée par %s.
EMailTextOrderRefused=La commande %s a été refusée. EMailTextOrderRefused=La commande %s a été refusée.
EMailTextOrderRefusedBy=La commande %s a été refusée par %s. EMailTextOrderRefusedBy=La commande %s a été refusée par %s.
EMailTextExpeditionValidated=
ImportedWithSet=Lot d'importation (Import key) ImportedWithSet=Lot d'importation (Import key)
DolibarrNotification=Notification automatique DolibarrNotification=Notification automatique
ResizeDesc=Entrer la nouvelle largeur <b>OU</b> la nouvelle hauteur. Le ratio est conservé lors du redimensionnement... ResizeDesc=Entrer la nouvelle largeur <b>OU</b> la nouvelle hauteur. Le ratio est conservé lors du redimensionnement...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment