diff --git a/ChangeLog b/ChangeLog index 2aa466a76dd5593ff64bbeb348666d1c859e1dda..5deebade85b8dfc174904595477aa79687d0fcca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -45,7 +45,8 @@ For users: - New: Can filter on status for supplier order. - Fix: Project Task numbering customs rule works. - Fix: Add actions events not implemented. -- New: Add filter date in bank writing list page +- New: Add filter date in bank writing list page. +- Fix: Price min of composition is not supplier price min by quantity 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 7b0843e2421b20878418652e12d404c7dcd64204..3c2a61b1ec6492f6920e6308709a6a7aeee90b7e 100644 --- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php +++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php @@ -633,6 +633,53 @@ class InterfaceActionsAuto $ok=1; } + // Project tasks + elseif($action == 'TASK_CREATE') { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + $langs->load("other"); + $langs->load("projects"); + $langs->load("agenda"); + + $object->actiontypecode='AC_OTH_AUTO'; + + if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("TaskCreatedInDolibarr",$object->ref); + $object->actionmsg=$langs->transnoentities("TaskCreatedInDolibarr",$object->ref); + $object->actionmsg.="\n".$langs->transnoentities("Task").': '.$object->ref; + $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; + + $ok=1; + } + + elseif($action == 'TASK_MODIFY') { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + $langs->load("other"); + $langs->load("projects"); + $langs->load("agenda"); + + $object->actiontypecode='AC_OTH_AUTO'; + if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("TaskModifiedInDolibarr",$object->ref); + $object->actionmsg=$langs->transnoentities("TaskModifieddInDolibarr",$object->ref); + $object->actionmsg.="\n".$langs->transnoentities("Task").': '.$object->ref; + $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; + + $ok=1; + } + + elseif($action == 'TASK_DELETE') { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + $langs->load("other"); + $langs->load("projects"); + $langs->load("agenda"); + + $object->actiontypecode='AC_OTH_AUTO'; + if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("TaskDeletedInDolibarr",$object->ref); + $object->actionmsg=$langs->transnoentities("TaskDeletedInDolibarr",$object->ref); + $object->actionmsg.="\n".$langs->transnoentities("Task").': '.$object->ref; + $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; + + $ok=1; + } + // The trigger was enabled but we are missing the implementation, let the log know else { diff --git a/htdocs/install/mysql/data/llx_c_action_trigger.sql b/htdocs/install/mysql/data/llx_c_action_trigger.sql index 6905f4777ccb7c3934decbe3a8c9e7df045b057c..971d2d7514a0e1cb440ed06e6a5df81d8f026442 100644 --- a/htdocs/install/mysql/data/llx_c_action_trigger.sql +++ b/htdocs/install/mysql/data/llx_c_action_trigger.sql @@ -64,3 +64,6 @@ insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (32,'PROPAL_CLOSE_REFUSED','Customer proposal closed refused','Executed when a customer proposal is closed refused','propal',32); insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (33,'BILL_SUPPLIER_CANCELED','Supplier invoice cancelled','Executed when a supplier invoice is cancelled','invoice_supplier',33); insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (34,'MEMBER_MODIFY','Member modified','Executed when a member is modified','member',34); +insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (35,'TASK_CREATE','Task created','Executed when a project task is created','project',35); +insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (36,'TASK_MODIFY','Task modified','Executed when a project task is modified','project',36); +insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (37,'TASK_DELETE','Task deleted','Executed when a project task is deleted','project',37); diff --git a/htdocs/install/mysql/migration/3.5.0-3.6.0.sql b/htdocs/install/mysql/migration/3.5.0-3.6.0.sql index 84ecee3b2e03d7772c6838270f7d58379c353836..a503ab94344a71aec528ee6921c71325afd02821 100644 --- a/htdocs/install/mysql/migration/3.5.0-3.6.0.sql +++ b/htdocs/install/mysql/migration/3.5.0-3.6.0.sql @@ -1114,3 +1114,8 @@ insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (32,'PROPAL_CLOSE_REFUSED','Customer proposal closed refused','Executed when a customer proposal is closed refused','propal',32); insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (33,'BILL_SUPPLIER_CANCELED','Supplier invoice cancelled','Executed when a supplier invoice is cancelled','invoice_supplier',33); insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (34,'MEMBER_MODIFY','Member modified','Executed when a member is modified','member',34); + +-- Automatic events for tasks +insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (35,'TASK_CREATE','Task created','Executed when a project task is created','project',35); +insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (36,'TASK_MODIFY','Task modified','Executed when a project task is modified','project',36); +insert into llx_c_action_trigger (rowid,code,label,description,elementtype,rang) values (37,'TASK_DELETE','Task deleted','Executed when a project task is deleted','project',37); diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index dd4e8246892f669fffcf442ad5b00e50b949ea3d..a37e9651bcc94d03dd28778f4afc2fa4e2a4b03f 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -106,6 +106,9 @@ ProjectReportDate=Change task date according project start date ErrorShiftTaskDate=Impossible to shift task date according to new project start date ProjectsAndTasksLines=Projects and tasks ProjectCreatedInDolibarr=Project %s created +TaskCreatedInDolibarr=Task %s created +TaskModifiedInDolibarr=Task %s modified +TaskDeletedInDolibarr=Task %s deleted ##### Types de contacts ##### TypeContact_project_internal_PROJECTLEADER=Project leader TypeContact_project_external_PROJECTLEADER=Project leader diff --git a/htdocs/product/composition/fiche.php b/htdocs/product/composition/fiche.php index 7b35aa158c636a842fc960dc72e7b9587c5130ff..f7485fdc49dc1011c492a0104fde1be59a0e5418 100644 --- a/htdocs/product/composition/fiche.php +++ b/htdocs/product/composition/fiche.php @@ -4,7 +4,7 @@ * Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> - * Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es> + * Copyright (C) 2011-2014 Juanjo Menent <jmenent@2byte.es> * * 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 @@ -346,7 +346,7 @@ if ($id > 0 || ! empty($ref)) $productstatic->ref=$value['fullpath']; print '<td>'.$productstatic->getNomUrl(1,'composition').' ('.$value['nb'].')</td>'; print '<td align="right">'; - if ($product_fourn->find_min_price_product_fournisseur($productstatic->id, $value['nb']) > 0) + if ($product_fourn->find_min_price_product_fournisseur($productstatic->id) > 0) { print $langs->trans("BuyingPriceMinShort").': '; if ($product_fourn->product_fourn_price_id > 0) print $product_fourn->display_price_product_fournisseur(0,0); diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 33520901f168fe8a82048521ca9401bbea2c5a47..34dc9232e816151809f8ee87cbae750d570b63fd 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -83,7 +83,7 @@ if ($action == 'createtask' && $user->rights->projet->creer) { $error=0; - $date_start = dol_mktime($_POST['dateohour'],$_POST['dateomin'],0,$_POST['dateomonth'],$_POST['dateoday'],$_POST['dateoyeassskr'],'user'); + $date_start = dol_mktime($_POST['dateohour'],$_POST['dateomin'],0,$_POST['dateomonth'],$_POST['dateoday'],$_POST['dateoyear'],'user'); $date_end = dol_mktime($_POST['dateehour'],$_POST['dateemin'],0,$_POST['dateemonth'],$_POST['dateeday'],$_POST['dateeyear'],'user'); if (empty($_POST["cancel"]))