From ba68598ec75814dfa57133f593a01f1558d08fd9 Mon Sep 17 00:00:00 2001 From: abb Date: Sat, 23 May 2015 15:06:18 +0100 Subject: [PATCH] added new trigger for supplier invoice unvalidation in Agenda --- htdocs/core/modules/modAgenda.class.php | 2 ++ .../interface_50_modAgenda_ActionsAuto.class.php | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index 73a8390c9e6..c6492ab5161 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -6,6 +6,7 @@ * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2009-2011 Regis Houssin * Copyright (C) 2013 Cedric Gross + * Copyright (C) 2015 Bahfir Abbes * * 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 @@ -90,6 +91,7 @@ class modAgenda extends DolibarrModules $this->const[12] = array("MAIN_AGENDA_ACTIONAUTO_SHIPPING_VALIDATE","chaine","1"); $this->const[13] = array("MAIN_AGENDA_ACTIONAUTO_SHIPPING_SENTBYMAIL","chaine","1"); $this->const[14] = array("MAIN_AGENDA_ACTIONAUTO_BILL_UNVALIDATE","chaine","1"); + $this->const[15] = array("MAIN_AGENDA_ACTIONAUTO_BILL_SUPPLIER_UNVALIDATE","chaine","1"); // New pages on tabs // ----------------- diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php index 46a6cd0daa6..8a77bf86b4f 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2011-2014 Juanjo Menent * Copyright (C) 2013 Cedric GROSS * Copyright (C) 2014 Marcos GarcĂ­a + * Copyright (C) 2015 Bahfir Abbes * * 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 @@ -493,6 +494,18 @@ class InterfaceActionsAuto extends DolibarrTriggers $object->actionmsg=$langs->transnoentities("InvoiceValidatedInDolibarr",($object->newref?$object->newref:$object->ref)); $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; + $object->sendtoid=0; + } + elseif ($action == 'BILL_SUPPLIER_UNVALIDATE') + { + $langs->load("other"); + $langs->load("bills"); + + $object->actiontypecode='AC_OTH_AUTO'; + if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("InvoiceBackToDraftInDolibarr",$object->ref); + $object->actionmsg=$langs->transnoentities("InvoiceBackToDraftInDolibarr",$object->ref); + $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; + $object->sendtoid=0; } elseif ($action == 'BILL_SUPPLIER_SENTBYMAIL')