From 19a3088055edbea20b53a116a1b5e18a749ca97c Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Mon, 17 Mar 2014 17:05:55 +0100 Subject: [PATCH 1/2] Fix: Add actions events not implemented --- ChangeLog | 1 + ...terface_50_modAgenda_ActionsAuto.class.php | 30 ++++++++++++++++++- htdocs/langs/en_US/agenda.lang | 1 + 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 12c79ad77c8..5e5dd3fda73 100644 --- a/ChangeLog +++ b/ChangeLog @@ -40,6 +40,7 @@ For users: - New: Add field url as product properties. - New: More options to create a credit note (can be filled autatically according to remain to pay). - Fix: Project Task numbering customs rule works. +- Fix: Add actions events not implemented TODO - New: Predefined product and free product use same form. diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index 0bb1b6c12b2..856ca34c693 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2009-2011 Regis Houssin - * Copyright (C) 2011-2013 Juanjo Menent + * Copyright (C) 2011-2014 Juanjo Menent * Copyright (C) 2013 Cedric GROSS * * This program is free software; you can redistribute it and/or modify @@ -426,6 +426,34 @@ class InterfaceActionsAuto $object->sendtoid=0; $ok=1; } + elseif ($action == 'ORDER_SUPPLIER_APPROVE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + $langs->load("orders"); + $langs->load("agenda"); + + $object->actiontypecode='AC_OTH_AUTO'; + if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderApprovedInDolibarr",$object->ref); + $object->actionmsg=$langs->transnoentities("OrderApprovedInDolibarr",$object->ref); + $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; + + $object->sendtoid=0; + $ok=1; + } + elseif ($action == 'ORDER_SUPPLIER_REFUSE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + $langs->load("orders"); + $langs->load("agenda"); + + $object->actiontypecode='AC_OTH_AUTO'; + if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("OrderRefusedInDolibarr",$object->ref); + $object->actionmsg=$langs->transnoentities("OrderRefusedInDolibarr",$object->ref); + $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; + + $object->sendtoid=0; + $ok=1; + } elseif ($action == 'ORDER_SUPPLIER_SENTBYMAIL') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index 0e37d3290f7..687e3cae146 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -43,6 +43,7 @@ InvoiceBackToDraftInDolibarr=Invoice %s go back to draft status InvoiceDeleteDolibarr=Invoice %s deleted OrderValidatedInDolibarr= Order %s validated OrderApprovedInDolibarr=Order %s approved +OrderRefusedInDolibarr=Order %s refused OrderBackToDraftInDolibarr=Order %s go back to draft status OrderCanceledInDolibarr=Order %s canceled InterventionValidatedInDolibarr=Intervention %s validated From 53bb32318ac7934990c528779d4cbf068ebdeb1f Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Mon, 17 Mar 2014 17:27:47 +0100 Subject: [PATCH 2/2] Fix: Bad action set for invoice --- htdocs/fourn/facture/fiche.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 11d53c10e58..0deb13f8c15 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -4,7 +4,7 @@ * Copyright (C) 2004 Christophe Combelles * Copyright (C) 2005 Marc Barilley * Copyright (C) 2005-2013 Regis Houssin - * Copyright (C) 2010-2012 Juanjo Menent + * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2013 Philippe Grand * Copyright (C) 2013 Florian Henry * @@ -824,7 +824,7 @@ if ($action == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_P { if (dol_strlen($_POST['subject'])) $subject=$_POST['subject']; else $subject = $langs->transnoentities('CustomerOrder').' '.$object->ref; - $actiontypecode='AC_SUP_ORD'; + $actiontypecode='AC_SUP_INV'; $actionmsg = $langs->transnoentities('MailSentBy').' '.$from.' '.$langs->transnoentities('To').' '.$sendto.".\n"; if ($message) {