diff --git a/ChangeLog b/ChangeLog index 309ff14b547..a9ff43f00bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -42,8 +42,9 @@ For users: For developers: - Qual: Reorganize /dev directory. - Qual: Change the way items are linked together. -- New: Modules can add their own tab on projects cards. - Qual: The login page now use a template in /core/template/login.tpl.php. +- New: Modules can add their own tab on projects cards. +- New: Add management of triger FICHEINTER_VALIDATE ***** ChangeLog for 2.7.1 compared to 2.7 ***** diff --git a/htdocs/actioncomm.class.php b/htdocs/actioncomm.class.php index 625af8c5bc6..154671f7a37 100644 --- a/htdocs/actioncomm.class.php +++ b/htdocs/actioncomm.class.php @@ -97,7 +97,9 @@ class ActionComm { global $langs,$conf; - // Clean parameters + $now=dol_now('tzserver'); + + // Clean parameters $this->label=trim($this->label); $this->location=trim($this->location); $this->note=dol_htmlcleanlastbr(trim($this->note)); @@ -106,13 +108,12 @@ class ActionComm if (! $this->punctual) $this->punctual = 0; if ($this->percentage > 100) $this->percentage = 100; if ($this->percentage == 100 && ! $this->dateend) $this->dateend = $this->date; - if ($this->datep && $this->datef) $this->durationp=($this->datef - $this->datep); + if ($this->datep && $this->datef) $this->durationp=($this->datef - $this->datep); if ($this->date && $this->dateend) $this->durationa=($this->dateend - $this->date); if ($this->datep && $this->datef && $this->datep > $this->datef) $this->datef=$this->datep; if ($this->date && $this->dateend && $this->date > $this->dateend) $this->dateend=$this->date; if ($this->fk_project < 0) $this->fk_project = 0; - $now=time(); if (! $this->type_id && $this->type_code) { # Get id from code diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index 2588e591e99..6b9584eb8f0 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2008-2010 Laurent Destailleur * * 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 @@ -49,6 +49,7 @@ $eventstolog=array( array('id'=>'BILL_PAYED', 'test'=>$conf->facture->enabled), array('id'=>'BILL_CANCELED', 'test'=>$conf->facture->enabled), array('id'=>'BILL_SENTBYMAIL', 'test'=>$conf->facture->enabled), + array('id'=>'FICHEINTER_VALIDATE', 'test'=>$conf->ficheinter->enabled), array('id'=>'ORDER_SUPPLIER_VALIDATE','test'=>$conf->fournisseur->enabled), array('id'=>'BILL_SUPPLIER_VALIDATE', 'test'=>$conf->fournisseur->enabled), // array('id'=>'PAYMENT_CUSTOMER_CREATE','test'=>$conf->facture->enabled), @@ -68,7 +69,7 @@ if ($_POST["action"] == "save" && empty($_POST["cancel"])) $i=0; $db->begin(); - + foreach ($eventstolog as $key => $arr) { $param='MAIN_AGENDA_ACTIONAUTO_'.$arr['id']; @@ -76,7 +77,7 @@ if ($_POST["action"] == "save" && empty($_POST["cancel"])) if (! empty($_POST[$param])) dolibarr_set_const($db,$param,$_POST[$param],'chaine',0,'',$conf->entity); else dolibarr_del_const($db,$param,$conf->entity); } - + $db->commit(); $mesg = "".$langs->trans("SetupSaved").""; } diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index 5a2f8ef8cc2..f5e4f30fe3a 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2009 Laurent Destailleur + * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -236,11 +236,7 @@ if ($_POST['action'] == 'setdescription') if ($result < 0) dol_print_error($db,$fichinter->error); } - - -/* - * Ajout d'une ligne d'intervention - */ +// Add line if ($_POST['action'] == "addligne" && $user->rights->ficheinter->creer) { if ($_POST['np_desc'] && ($_POST['durationhour'] || $_POST['durationmin'])) diff --git a/htdocs/fichinter/fichinter.class.php b/htdocs/fichinter/fichinter.class.php index c103f187c60..259196bb8ab 100644 --- a/htdocs/fichinter/fichinter.class.php +++ b/htdocs/fichinter/fichinter.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2009 Laurent Destailleur + * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -187,8 +187,8 @@ class Fichinter extends CommonObject { $sql = "SELECT rowid, ref, description, fk_soc, fk_statut,"; $sql.= " datec,"; - $sql.= " as datev,"; - $sql.= " datem,"; + $sql.= " date_valid as datev,"; + $sql.= " tms as datem,"; $sql.= " duree, fk_projet, note_public, note_private, model_pdf"; $sql.= " FROM ".MAIN_DB_PREFIX."fichinter as f"; if ($ref) $sql.= " WHERE f.ref='".$ref."'"; @@ -852,6 +852,7 @@ class FichinterLigne function insert() { dol_syslog("FichinterLigne::insert rang=".$this->rang); + $this->db->begin(); $rangToUse=$this->rang; @@ -962,6 +963,8 @@ class FichinterLigne { global $conf; + $this->db->begin(); + $sql = "SELECT SUM(duree) as total_duration"; $sql.= " FROM ".MAIN_DB_PREFIX."fichinterdet"; $sql.= " WHERE fk_fichinter=".$this->fk_fichinter; diff --git a/htdocs/includes/triggers/interface_modAgenda_ActionsAuto.class.php b/htdocs/includes/triggers/interface_modAgenda_ActionsAuto.class.php index 1fec40c5efe..359eb2a0210 100644 --- a/htdocs/includes/triggers/interface_modAgenda_ActionsAuto.class.php +++ b/htdocs/includes/triggers/interface_modAgenda_ActionsAuto.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2005-2010 Laurent Destailleur * * 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 @@ -18,15 +18,15 @@ /** * \file htdocs/includes/triggers/interface_modAgenda_ActionsAuto.class.php - * \ingroup core - * \brief Trigger file for + * \ingroup agenda + * \brief Trigger file for agenda module * \version $Id$ */ /** * \class InterfaceActionsAuto - * \brief Classe des fonctions triggers des actions agenda + * \brief Class of triggered functions for agenda module */ class InterfaceActionsAuto { @@ -293,6 +293,21 @@ class InterfaceActionsAuto $object->orderrowid=$object->propalrowid=0; $ok=1; } + elseif ($action == 'FICHEINTER_VALIDATE') + { + dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); + $langs->load("other"); + $langs->load("interventions"); + $langs->load("agenda"); + + $object->actiontypecode='AC_OTH'; + $object->actionmsg2=$langs->transnoentities("InterventionValidatedInDolibarr",$object->ref); + $object->actionmsg=$langs->transnoentities("InterventionValidatedInDolibarr",$object->ref); + $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; + + $object->sendtoid=0; + $ok=1; + } elseif ($action == 'ORDER_SUPPLIER_VALIDATE') { dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); @@ -420,7 +435,7 @@ class InterfaceActionsAuto // Add entry in event table if ($ok) { - $now=gmmktime(); + $now=dol_now('tzserver'); // Insertion action require_once(DOL_DOCUMENT_ROOT.'/contact.class.php'); diff --git a/htdocs/langs/en_US/agenda.lang b/htdocs/langs/en_US/agenda.lang index c77de6c6849..2d43425d4ef 100644 --- a/htdocs/langs/en_US/agenda.lang +++ b/htdocs/langs/en_US/agenda.lang @@ -29,9 +29,10 @@ AutoActions = Automatic filling of agenda AgendaAutoActionDesc = Define here events for which you want Dolibarr to create automatically an action in agenda. If nothing is checked (by default), only manual actions will be included in agenda. AgendaSetupOtherDesc = This page allows to configure other parameters of agenda module. ActionsEvents = Events for which Dolibarr will create an action in agenda automatically -PropalValidatedInDolibarr = Proposal validated -InvoiceValidatedInDolibarr = Invoice validated -OrderValidatedInDolibarr = Order validated +PropalValidatedInDolibarr = Proposal %s validated +InvoiceValidatedInDolibarr = Invoice %s validated +OrderValidatedInDolibarr = Order %s validated +InterventionValidatedInDolibarr=Intervention %s validated NewCompanyToDolibarr = Third party created DateActionPlannedStart = Planned start date DateActionPlannedEnd = Planned end date diff --git a/htdocs/langs/fr_FR/agenda.lang b/htdocs/langs/fr_FR/agenda.lang index 579c4c08068..00c3ef20e25 100644 --- a/htdocs/langs/fr_FR/agenda.lang +++ b/htdocs/langs/fr_FR/agenda.lang @@ -29,9 +29,10 @@ AutoActions=Alimentation automatique de l'agenda AgendaAutoActionDesc=Définissez dans cet onglet les évènements pour lesquels dolibarr créera automatiquement une action dans l'agenda. Si aucune case n'est cochée (par défaut), seules les actions manuelles seront incluses dans l'agenda. AgendaSetupOtherDesc=Cette page permet de configurer les autres paramètres du module agenda. ActionsEvents=Evènements pour lesquels Dolibarr doit créer une action dans l'agenda en automatique. -PropalValidatedInDolibarr=Proposition validée -InvoiceValidatedInDolibarr=Facture validée -OrderValidatedInDolibarr=Commande validée +PropalValidatedInDolibarr=Proposition %s validée +InvoiceValidatedInDolibarr=Facture %s validée +OrderValidatedInDolibarr=Commande %s validée +InterventionValidatedInDolibarr=Intervention %s validée NewCompanyToDolibarr=Tiers créé DateActionPlannedStart=Date début réalisation prévue DateActionPlannedEnd=Date fin réalisation prévue