New: Add management of triger FICHEINTER_VALIDATE

This commit is contained in:
Laurent Destailleur 2010-01-19 10:47:26 +00:00
parent 347d9fc158
commit 160287304c
8 changed files with 46 additions and 27 deletions

View File

@ -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 *****

View File

@ -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

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2008-2009 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2008-2010 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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 = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
}

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
*
* 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']))

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
*
* 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;

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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');

View File

@ -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

View File

@ -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