Skip to content
Snippets Groups Projects
Commit 82e3a8d0 authored by Marcos García de La Fuente's avatar Marcos García de La Fuente
Browse files

New: [ task #823 ] Shipping_validate email notification

parent ab2709f6
No related branches found
No related tags found
No related merge requests found
......@@ -50,6 +50,7 @@ For users:
- New: [ task #770 ] Add ODT document generation for Projects module
- New: [ task #741 ] Add intervention box
- New: [ task #826 ] Optionnal increase stock when deleting an invoice already validated
- New: [ task #823 ] Shipping_validate email notification
For translators:
- Update language files.
......
<?php
/* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* 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
* it under the terms of the GNU General Public License as published by
......@@ -35,7 +36,8 @@ class InterfaceNotification
'PROPAL_VALIDATE',
'FICHINTER_VALIDATE',
'ORDER_SUPPLIER_APPROVE',
'ORDER_SUPPLIER_REFUSE'
'ORDER_SUPPLIER_REFUSE',
'SHIPPING_VALIDATE'
);
/**
......@@ -196,6 +198,19 @@ class InterfaceNotification
$notify = new Notify($this->db);
$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
/*
......
......@@ -5,6 +5,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* 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
* it under the terms of the GNU General Public License as published by
......@@ -698,16 +699,16 @@ if ($action == 'create')
//$lines = $object->fetch_lines(1);
$numAsked = count($object->lines);
print '<script type="text/javascript" language="javascript">
jQuery(document).ready(function() {
jQuery("#autofill").click(function() {';
print '<script type="text/javascript" language="javascript">
jQuery(document).ready(function() {
jQuery("#autofill").click(function() {';
$i=0;
while($i < $numAsked)
{
print 'jQuery("#qtyl'.$i.'").val(jQuery("#qtyasked'.$i.'").val() - jQuery("#qtydelivered'.$i.'").val());'."\n";
$i++;
}
print '});
}
print '});
jQuery("#autoreset").click(function() {';
$i=0;
while($i < $numAsked)
......@@ -716,8 +717,8 @@ if ($action == 'create')
$i++;
}
print '});
});
</script>';
});
</script>';
print '<br>';
......@@ -904,7 +905,7 @@ if ($action == 'create')
print '<br><center><input type="submit" class="button" value="'.$langs->trans("Create").'"></center>';
print '</form>';
print '</form>';
print '<br>';
}
......@@ -974,7 +975,18 @@ else
{
$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>';
}
/*
......
......@@ -152,6 +152,7 @@ EMailTextOrderApproved=The order %s has been approved.
EMailTextOrderApprovedBy=The order %s has been approved by %s.
EMailTextOrderRefused=The order %s has been refused.
EMailTextOrderRefusedBy=The order %s has been refused by %s.
EMailTextExpeditionValidated=The shipping %s has been validated.
ImportedWithSet=Importation data set
DolibarrNotification=Automatic notification
ResizeDesc=Enter new width <b>OR</b> new height. Ratio will be kept during resizing...
......
......@@ -151,6 +151,7 @@ EMailTextOrderApproved=Pedido %s aprobado
EMailTextOrderApprovedBy=Pedido %s aprobado por %s
EMailTextOrderRefused=Pedido %s rechazado
EMailTextOrderRefusedBy=Pedido %s rechazado por %s
EMailTextExpeditionValidated=El envío %s ha sido validado.
ImportedWithSet=Lote de importación (import key)
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 ...
......
......@@ -151,6 +151,7 @@ EMailTextOrderApproved=La commande %s a été approuvée.
EMailTextOrderApprovedBy=La commande %s a été approuvée par %s.
EMailTextOrderRefused=La commande %s a été refusée.
EMailTextOrderRefusedBy=La commande %s a été refusée par %s.
EMailTextExpeditionValidated=
ImportedWithSet=Lot d'importation (Import key)
DolibarrNotification=Notification automatique
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