2005-09-09 23:18:12 +02:00
< ? php
2007-02-11 17:32:29 +01:00
/* Copyright ( C ) 2005 - 2007 Laurent Destailleur < eldy @ users . sourceforge . net >
2005-09-09 23:18:12 +02:00
*
* 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
* the Free Software Foundation ; either version 2 of the License , or
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
* along with this program ; if not , write to the Free Software
* Foundation , Inc . , 59 Temple Place - Suite 330 , Boston , MA 02111 - 1307 , USA .
*
* $Id $
* $Source $
*/
/**
\file htdocs / includes / triggers / interface_webcal . class . php
\ingroup webcalendar
\brief Fichier de demo de personalisation des actions du workflow
\remarks Son propre fichier d ' actions peut etre cr<EFBFBD> <EFBFBD> par recopie de celui - ci :
- Le nom du fichier doit etre interface_xxx . class . php
- Le fichier doit rester stock<EFBFBD> dans includes / triggers
- Le nom de la classe doit etre InterfaceXxx
*/
include_once ( DOL_DOCUMENT_ROOT . '/lib/webcal.class.php' );
/**
\class InterfaceWebCal
2005-09-09 23:24:13 +02:00
\brief Classe des fonctions triggers des actions webcalendar
2005-09-09 23:18:12 +02:00
*/
class InterfaceWebCal
{
var $db ;
var $error ;
2005-10-01 17:57:05 +02:00
var $date ;
var $duree ;
var $texte ;
var $desc ;
2005-09-09 23:18:12 +02:00
/**
* \brief Constructeur .
2005-09-09 23:24:13 +02:00
* \param DB Handler d ' acc<EFBFBD> s base
2005-09-09 23:18:12 +02:00
*/
function InterfaceWebCal ( $DB )
{
$this -> db = $DB ;
$this -> name = " WebCal " ;
$this -> family = " webcal " ;
$this -> description = " Les triggers de ce composant permettent d'ins<6E> rer un <20> v<EFBFBD> nement dans le calendrier webcalendar pour chaque grand <20> v<EFBFBD> nement Dolibarr. " ;
$this -> version = 'dolibarr' ; // 'experimental' or 'dolibarr' or version
}
/**
* \brief Renvoi nom du lot de triggers
* \return string Nom du lot de triggers
*/
function getName ()
{
return $this -> name ;
}
/**
* \brief Renvoi descriptif du lot de triggers
* \return string Descriptif du lot de triggers
*/
function getDesc ()
{
return $this -> description ;
}
/**
* \brief Renvoi version du lot de triggers
* \return string Version du lot de triggers
*/
function getVersion ()
{
global $langs ;
$langs -> load ( " admin " );
if ( $this -> version == 'experimental' ) return $langs -> trans ( " Experimental " );
elseif ( $this -> version == 'dolibarr' ) return DOL_VERSION ;
elseif ( $this -> version ) return $this -> version ;
else return $langs -> trans ( " Unknown " );
}
/**
* \brief Fonction appel<EFBFBD> e lors du d<EFBFBD> clenchement d ' un <EFBFBD> v<EFBFBD> nement Dolibarr .
* D ' autres fonctions run_trigger peuvent etre pr<EFBFBD> sentes dans includes / triggers
* \param action Code de l ' evenement
* \param object Objet concern<EFBFBD>
* \param user Objet user
* \param lang Objet lang
* \param conf Objet conf
2005-09-09 23:24:13 +02:00
* \return int < 0 si ko , 0 si aucune action faite , > 0 si ok
2005-09-09 23:18:12 +02:00
*/
function run_trigger ( $action , $object , $user , $langs , $conf )
{
// Mettre ici le code <20> ex<65> cuter en r<> action de l'action
// Les donn<6E> es de l'action sont stock<63> es dans $object
if ( ! $conf -> webcal -> enabled ) return 0 ; // Module non actif
if ( ! $object -> use_webcal ) return 0 ; // Option syncro webcal non active
// Actions
if ( $action == 'ACTION_CREATE' )
{
2006-11-23 00:36:27 +01:00
dolibarr_syslog ( " Trigger ' " . $this -> name . " ' for action ' $action ' launched by " . __FILE__ . " . id= " . $object -> id );
2005-10-01 19:03:34 +02:00
$langs -> load ( " other " );
2005-09-09 23:18:12 +02:00
2005-10-01 19:03:34 +02:00
// Initialisation donnees (date,duree,texte,desc)
2005-09-09 23:18:12 +02:00
if ( $object -> type_id == 5 && $object -> contact -> fullname )
{
2007-02-28 00:48:20 +01:00
$libellecal = $langs -> transnoentities ( " TaskRDVWith " , $object -> contact -> fullname ) . " \n " ;
2005-09-09 23:18:12 +02:00
$libellecal .= $object -> note ;
}
else
{
$libellecal = " " ;
2007-02-28 00:48:20 +01:00
if ( $langs -> transnoentities ( " Action " . $object -> type_code ) != " Action " . $object -> type_code )
2005-09-09 23:18:12 +02:00
{
2007-02-28 00:48:20 +01:00
$libellecal .= $langs -> transnoentities ( " Action " . $object -> type_code ) . " \n " ;
2005-09-09 23:18:12 +02:00
}
$libellecal .= ( $object -> label != $libellecal ? $object -> label . " \n " : " " );
$libellecal .= ( $object -> note ? $object -> note : " " );
}
2006-09-16 02:38:58 +02:00
$this -> date = $object -> date ? $object -> date : $object -> datep ;
2005-10-01 17:57:05 +02:00
$this -> duree = $object -> duree ;
$this -> texte = $object -> societe -> nom ;
$this -> desc = $libellecal ;
}
2007-02-11 17:32:29 +01:00
// Third parties
2006-11-23 00:36:27 +01:00
elseif ( $action == 'COMPANY_CREATE' )
2005-10-01 17:57:05 +02:00
{
2006-11-23 00:36:27 +01:00
dolibarr_syslog ( " Trigger ' " . $this -> name . " ' for action ' $action ' launched by " . __FILE__ . " . id= " . $object -> id );
2005-10-01 19:03:34 +02:00
$langs -> load ( " other " );
// Initialisation donnees (date,duree,texte,desc)
2005-10-01 17:57:05 +02:00
$this -> date = time ();
$this -> duree = 0 ;
2007-02-28 00:48:20 +01:00
$this -> texte = $langs -> transnoentities ( " NewCompanyToDolibarr " , $object -> nom );
$this -> desc = $langs -> transnoentities ( " NewCompanyToDolibarr " , $object -> nom );
2006-02-24 20:43:06 +01:00
if ( $object -> prefix ) $this -> desc .= " ( " . $object -> prefix . " ) " ;
2007-02-28 00:48:20 +01:00
//$this->desc.="\n".$langs->transnoentities("Customer").': '.yn($object->client);
//$this->desc.="\n".$langs->transnoentities("Supplier").': '.yn($object->fournisseur);
2007-03-20 01:55:01 +01:00
$this -> desc .= " \n " . $langs -> transnoentities ( " Author " ) . ': ' . $user -> login ;
2005-10-01 17:57:05 +02:00
}
2007-02-11 17:32:29 +01:00
// Contracts
2006-11-23 00:36:27 +01:00
elseif ( $action == 'CONTRACT_VALIDATE' )
2005-10-01 17:57:05 +02:00
{
2006-11-23 00:36:27 +01:00
dolibarr_syslog ( " Trigger ' " . $this -> name . " ' for action ' $action ' launched by " . __FILE__ . " . id= " . $object -> id );
2005-10-01 19:03:34 +02:00
$langs -> load ( " other " );
// Initialisation donnees (date,duree,texte,desc)
$this -> date = time ();
$this -> duree = 0 ;
2007-02-28 00:48:20 +01:00
$this -> texte = $langs -> transnoentities ( " ContractValidatedInDolibarr " , $object -> ref );
$this -> desc = $langs -> transnoentities ( " ContractValidatedInDolibarr " , $object -> ref );
2007-03-20 01:55:01 +01:00
$this -> desc .= " \n " . $langs -> transnoentities ( " Author " ) . ': ' . $user -> login ;
2005-10-01 17:57:05 +02:00
}
2006-11-23 00:36:27 +01:00
elseif ( $action == 'CONTRACT_CANCEL' )
2005-10-01 17:57:05 +02:00
{
2006-11-23 00:36:27 +01:00
dolibarr_syslog ( " Trigger ' " . $this -> name . " ' for action ' $action ' launched by " . __FILE__ . " . id= " . $object -> id );
2005-10-01 19:03:34 +02:00
$langs -> load ( " other " );
$this -> date = time ();
$this -> duree = 0 ;
2007-02-28 00:48:20 +01:00
$this -> texte = $langs -> transnoentities ( " ContractCanceledInDolibarr " , $object -> ref );
$this -> desc = $langs -> transnoentities ( " ContractCanceledInDolibarr " , $object -> ref );
2007-03-20 01:55:01 +01:00
$this -> desc .= " \n " . $langs -> transnoentities ( " Author " ) . ': ' . $user -> login ;
2005-10-01 17:57:05 +02:00
}
2006-11-23 00:36:27 +01:00
elseif ( $action == 'CONTRACT_CLOSE' )
2005-10-01 17:57:05 +02:00
{
2006-11-23 00:36:27 +01:00
dolibarr_syslog ( " Trigger ' " . $this -> name . " ' for action ' $action ' launched by " . __FILE__ . " . id= " . $object -> id );
2005-10-01 19:03:34 +02:00
$langs -> load ( " other " );
$this -> date = time ();
$this -> duree = 0 ;
2007-02-28 00:48:20 +01:00
$this -> texte = $langs -> transnoentities ( " ContractClosedInDolibarr " , $object -> ref );
$this -> desc = $langs -> transnoentities ( " ContractClosedInDolibarr " , $object -> ref );
2007-03-20 01:55:01 +01:00
$this -> desc .= " \n " . $langs -> transnoentities ( " Author " ) . ': ' . $user -> login ;
2005-10-01 17:57:05 +02:00
}
2007-02-11 17:32:29 +01:00
// Proposals
2006-11-23 00:36:27 +01:00
elseif ( $action == 'PROPAL_VALIDATE' )
2006-02-24 20:43:06 +01:00
{
2006-11-23 00:36:27 +01:00
dolibarr_syslog ( " Trigger ' " . $this -> name . " ' for action ' $action ' launched by " . __FILE__ . " . id= " . $object -> id );
2006-02-24 20:43:06 +01:00
$langs -> load ( " other " );
$this -> date = time ();
$this -> duree = 0 ;
2007-02-28 00:48:20 +01:00
$this -> texte = $langs -> transnoentities ( " PropalValidatedInDolibarr " , $object -> ref );
$this -> desc = $langs -> transnoentities ( " PropalValidatedInDolibarr " , $object -> ref );
2007-03-20 01:55:01 +01:00
$this -> desc .= " \n " . $langs -> transnoentities ( " Author " ) . ': ' . $user -> login ;
2006-02-24 20:43:06 +01:00
}
2006-11-23 00:36:27 +01:00
elseif ( $action == 'PROPAL_CLOSE_SIGNED' )
2006-02-24 20:43:06 +01:00
{
2006-12-06 00:02:06 +01:00
dolibarr_syslog ( " Trigger ' " . $this -> name . " ' for action ' $action ' launched by " . __FILE__ . " . id= " . $object -> id );
2006-02-24 20:43:06 +01:00
$langs -> load ( " other " );
$this -> date = time ();
$this -> duree = 0 ;
2007-02-28 00:48:20 +01:00
$this -> texte = $langs -> transnoentities ( " PropalClosedSignedInDolibarr " , $object -> ref );
$this -> desc = $langs -> transnoentities ( " PropalClosedSignedInDolibarr " , $object -> ref );
2007-03-20 01:55:01 +01:00
$this -> desc .= " \n " . $langs -> transnoentities ( " Author " ) . ': ' . $user -> login ;
2006-02-24 20:43:06 +01:00
}
2006-11-23 00:36:27 +01:00
elseif ( $action == 'PROPAL_CLOSE_REFUSED' )
2006-02-24 20:43:06 +01:00
{
2006-12-06 00:02:06 +01:00
dolibarr_syslog ( " Trigger ' " . $this -> name . " ' for action ' $action ' launched by " . __FILE__ . " . id= " . $object -> id );
2006-02-24 20:43:06 +01:00
$langs -> load ( " other " );
$this -> date = time ();
$this -> duree = 0 ;
2007-02-28 00:48:20 +01:00
$this -> texte = $langs -> transnoentities ( " PropalClosedRefusedInDolibarr " , $object -> ref );
$this -> desc = $langs -> transnoentities ( " PropalClosedRefusedInDolibarr " , $object -> ref );
2007-03-20 01:55:01 +01:00
$this -> desc .= " \n " . $langs -> transnoentities ( " Author " ) . ': ' . $user -> login ;
2006-02-24 20:43:06 +01:00
}
2007-02-11 17:32:29 +01:00
// Invoices
elseif ( $action == 'BILL_VALIDATE' )
2005-10-01 17:57:05 +02:00
{
2006-12-06 00:02:06 +01:00
dolibarr_syslog ( " Trigger ' " . $this -> name . " ' for action ' $action ' launched by " . __FILE__ . " . id= " . $object -> id );
2005-10-01 19:03:34 +02:00
$langs -> load ( " other " );
$this -> date = time ();
$this -> duree = 0 ;
2007-02-28 00:48:20 +01:00
$this -> texte = $langs -> transnoentities ( " InvoiceValidatedInDolibarr " , $object -> ref );
$this -> desc = $langs -> transnoentities ( " InvoiceValidatedInDolibarr " , $object -> ref );
2007-03-20 01:55:01 +01:00
$this -> desc .= " \n " . $langs -> transnoentities ( " Author " ) . ': ' . $user -> login ;
2005-10-01 17:57:05 +02:00
}
2006-11-23 00:36:27 +01:00
elseif ( $action == 'BILL_PAYED' )
2005-10-01 17:57:05 +02:00
{
2006-12-06 00:02:06 +01:00
dolibarr_syslog ( " Trigger ' " . $this -> name . " ' for action ' $action ' launched by " . __FILE__ . " . id= " . $object -> id );
2005-10-01 19:03:34 +02:00
$langs -> load ( " other " );
$this -> date = time ();
$this -> duree = 0 ;
2007-02-28 00:48:20 +01:00
$this -> texte = $langs -> transnoentities ( " InvoicePayedInDolibarr " , $object -> ref );
$this -> desc = $langs -> transnoentities ( " InvoicePayedInDolibarr " , $object -> ref );
2007-03-20 01:55:01 +01:00
$this -> desc .= " \n " . $langs -> transnoentities ( " Author " ) . ': ' . $user -> login ;
2005-10-01 17:57:05 +02:00
}
2006-11-23 00:36:27 +01:00
elseif ( $action == 'BILL_CANCELED' )
2005-10-01 17:57:05 +02:00
{
2006-12-06 00:02:06 +01:00
dolibarr_syslog ( " Trigger ' " . $this -> name . " ' for action ' $action ' launched by " . __FILE__ . " . id= " . $object -> id );
2005-10-01 19:03:34 +02:00
$langs -> load ( " other " );
$this -> date = time ();
$this -> duree = 0 ;
2007-02-28 00:48:20 +01:00
$this -> texte = $langs -> transnoentities ( " InvoiceCanceledInDolibarr " , $object -> ref );
$this -> desc = $langs -> transnoentities ( " InvoiceCanceledInDolibarr " , $object -> ref );
2007-03-20 01:55:01 +01:00
$this -> desc .= " \n " . $langs -> transnoentities ( " Author " ) . ': ' . $user -> login ;
2005-10-01 17:57:05 +02:00
}
2007-02-11 17:32:29 +01:00
2006-04-08 14:52:30 +02:00
// Payments
elseif ( $action == 'PAYMENT_CUSTOMER_CREATE' )
{
2006-12-06 00:02:06 +01:00
dolibarr_syslog ( " Trigger ' " . $this -> name . " ' for action ' $action ' launched by " . __FILE__ . " . id= " . $object -> id );
2006-04-08 14:52:30 +02:00
$langs -> load ( " other " );
$this -> date = time ();
$this -> duree = 0 ;
2007-02-28 00:48:20 +01:00
$this -> texte = $langs -> transnoentities ( " CustomerPaymentDoneInDolibarr " , $object -> ref );
$this -> desc = $langs -> transnoentities ( " CustomerPaymentDoneInDolibarr " , $object -> ref );
$this -> desc .= " \n " . $langs -> transnoentities ( " AmountTTC " ) . ': ' . $object -> total ;
2007-03-20 01:55:01 +01:00
$this -> desc .= " \n " . $langs -> transnoentities ( " Author " ) . ': ' . $user -> login ;
2006-04-08 14:52:30 +02:00
}
elseif ( $action == 'PAYMENT_SUPPLIER_CREATE' )
{
2006-12-06 00:02:06 +01:00
dolibarr_syslog ( " Trigger ' " . $this -> name . " ' for action ' $action ' launched by " . __FILE__ . " . id= " . $object -> id );
2006-04-08 14:52:30 +02:00
$langs -> load ( " other " );
$this -> date = time ();
$this -> duree = 0 ;
2007-02-28 00:48:20 +01:00
$this -> texte = $langs -> transnoentities ( " SupplierPaymentDoneInDolibarr " , $object -> ref );
$this -> desc = $langs -> transnoentities ( " SupplierPaymentDoneInDolibarr " , $object -> ref );
$this -> desc .= " \n " . $langs -> transnoentities ( " AmountTTC " ) . ': ' . $object -> total ;
2007-03-20 01:55:01 +01:00
$this -> desc .= " \n " . $langs -> transnoentities ( " Author " ) . ': ' . $user -> login ;
2006-04-08 14:52:30 +02:00
}
2007-02-11 17:32:29 +01:00
// Members
elseif ( $action == 'MEMBER_CREATE' )
{
}
elseif ( $action == 'MEMBER_VALIDATE' )
{
dolibarr_syslog ( " Trigger ' " . $this -> name . " ' for action ' $action ' launched by " . __FILE__ . " . id= " . $object -> id );
$langs -> load ( " other " );
$langs -> load ( " members " );
$this -> date = time ();
$this -> duree = 0 ;
2007-02-28 00:48:20 +01:00
$this -> texte = $langs -> transnoentities ( " MemberValidatedInDolibarr " , $object -> id );
$this -> desc = $langs -> transnoentities ( " MemberValidatedInDolibarr " , $object -> id );
2007-05-10 01:55:59 +02:00
$this -> desc .= " \n " . $langs -> transnoentities ( " Member " ) . ': ' . $object -> fullname ;
2007-02-28 00:48:20 +01:00
$this -> desc .= " \n " . $langs -> transnoentities ( " Type " ) . ': ' . $object -> type ;
2007-03-20 01:55:01 +01:00
$this -> desc .= " \n " . $langs -> transnoentities ( " Author " ) . ': ' . $user -> login ;
2007-02-11 17:32:29 +01:00
}
elseif ( $action == 'MEMBER_SUBSCRIPTION' )
{
dolibarr_syslog ( " Trigger ' " . $this -> name . " ' for action ' $action ' launched by " . __FILE__ . " . id= " . $object -> id );
$langs -> load ( " other " );
$langs -> load ( " members " );
$this -> date = time ();
$this -> duree = 0 ;
2007-02-28 00:48:20 +01:00
$this -> texte = $langs -> transnoentities ( " MemberSubscriptionInDolibarr " , $object -> id );
$this -> desc = $langs -> transnoentities ( " MemberSubscriptionInDolibarr " , $object -> id );
2007-05-10 01:55:59 +02:00
$this -> desc .= " \n " . $langs -> transnoentities ( " Member " ) . ': ' . $object -> fullname ;
2007-02-28 00:48:20 +01:00
$this -> desc .= " \n " . $langs -> transnoentities ( " Type " ) . ': ' . $object -> type ;
$this -> desc .= " \n " . $langs -> transnoentities ( " Amount " ) . ': ' . $object -> last_subscription_amount ;
$this -> desc .= " \n " . $langs -> transnoentities ( " Period " ) . ': ' . dolibarr_print_date ( $object -> last_subscription_date_start , 'day' ) . ' - ' . dolibarr_print_date ( $object -> last_subscription_date_end , 'day' );
2007-03-20 01:55:01 +01:00
$this -> desc .= " \n " . $langs -> transnoentities ( " Author " ) . ': ' . $user -> login ;
2007-02-11 17:32:29 +01:00
}
2007-05-10 01:55:59 +02:00
elseif ( $action == 'MEMBER_MODIFY' )
{
dolibarr_syslog ( " Trigger ' " . $this -> name . " ' for action ' $action ' launched by " . __FILE__ . " . id= " . $object -> id );
$langs -> load ( " other " );
$langs -> load ( " members " );
$this -> date = time ();
$this -> duree = 0 ;
$this -> texte = $langs -> transnoentities ( " MemberModifiedInDolibarr " , $object -> id );
$this -> desc = $langs -> transnoentities ( " MemberModifiedInDolibarr " , $object -> id );
$this -> desc .= " \n " . $langs -> transnoentities ( " Member " ) . ': ' . $object -> fullname ;
$this -> desc .= " \n " . $langs -> transnoentities ( " Type " ) . ': ' . $object -> type ;
$this -> desc .= " \n " . $langs -> transnoentities ( " Author " ) . ': ' . $user -> login ;
}
2007-02-11 17:32:29 +01:00
elseif ( $action == 'MEMBER_RESILIATE' )
{
dolibarr_syslog ( " Trigger ' " . $this -> name . " ' for action ' $action ' launched by " . __FILE__ . " . id= " . $object -> id );
$langs -> load ( " other " );
$langs -> load ( " members " );
$this -> date = time ();
$this -> duree = 0 ;
2007-02-28 00:48:20 +01:00
$this -> texte = $langs -> transnoentities ( " MemberResiliatedInDolibarr " , $object -> id );
$this -> desc = $langs -> transnoentities ( " MemberResiliatedInDolibarr " , $object -> id );
2007-05-10 01:55:59 +02:00
$this -> desc .= " \n " . $langs -> transnoentities ( " Member " ) . ': ' . $object -> fullname ;
2007-02-28 00:48:20 +01:00
$this -> desc .= " \n " . $langs -> transnoentities ( " Type " ) . ': ' . $object -> type ;
2007-03-20 01:55:01 +01:00
$this -> desc .= " \n " . $langs -> transnoentities ( " Author " ) . ': ' . $user -> login ;
2007-02-11 17:32:29 +01:00
}
elseif ( $action == 'MEMBER_DELETE' )
{
dolibarr_syslog ( " Trigger ' " . $this -> name . " ' for action ' $action ' launched by " . __FILE__ . " . id= " . $object -> id );
$langs -> load ( " other " );
$langs -> load ( " members " );
$this -> date = time ();
$this -> duree = 0 ;
2007-02-28 00:48:20 +01:00
$this -> texte = $langs -> transnoentities ( " MemberDeletedInDolibarr " , $object -> id );
$this -> desc = $langs -> transnoentities ( " MemberDeletedInDolibarr " , $object -> id );
2007-05-10 01:55:59 +02:00
$this -> desc .= " \n " . $langs -> transnoentities ( " Member " ) . ': ' . $object -> fullname ;
2007-02-28 00:48:20 +01:00
$this -> desc .= " \n " . $langs -> transnoentities ( " Type " ) . ': ' . $object -> type ;
2007-03-20 01:55:01 +01:00
$this -> desc .= " \n " . $langs -> transnoentities ( " Author " ) . ': ' . $user -> login ;
2007-02-11 17:32:29 +01:00
}
2006-11-23 00:36:27 +01:00
// If not found
/*
else
{
dolibarr_syslog ( " Trigger ' " . $this -> name . " ' for action ' $action ' was ran by " . __FILE__ . " but no handler found for this action. " );
return 0 ;
}
*/
2005-10-01 17:57:05 +02:00
// Ajoute entr<74> e dans webcal
if ( $this -> date )
{
// Cr<43> e objet webcal et connexion avec params $conf->webcal->db->xxx
$webcal = new Webcal ();
if ( ! $webcal -> localdb -> ok )
{
// Si la creation de l'objet n'as pu se connecter
2007-02-11 17:32:29 +01:00
$error = " Dolibarr n'a pu se connecter <20> la base Webcalendar avec les identifiants d<> finis (host= " . $conf -> webcal -> db -> host . " dbname= " . $conf -> webcal -> db -> name . " user= " . $conf -> webcal -> db -> user . " ). " ;
$error .= " La mise a jour Webcalendar a <20> t<EFBFBD> ignor<6F> e. " ;
2005-10-01 17:57:05 +02:00
$this -> error = $error ;
2007-02-11 17:32:29 +01:00
//dolibarr_syslog("interface_webcal.class.php: ".$this->error);
2005-10-01 17:57:05 +02:00
return - 1 ;
}
$webcal -> date = $this -> date ;
$webcal -> duree = $this -> duree ;
$webcal -> texte = $this -> texte ;
$webcal -> desc = $this -> desc ;
2005-09-09 23:18:12 +02:00
$result = $webcal -> add ( $user );
2005-10-01 17:57:05 +02:00
if ( $result > 0 )
2005-09-09 23:18:12 +02:00
{
return 1 ;
}
else
{
2007-02-11 17:32:29 +01:00
$error = " Echec insertion dans webcal: " . $webcal -> error . " " ;
$error .= " La mise a jour Webcalendar a <20> t<EFBFBD> ignor<6F> e. " ;
$this -> error = $error ;
//dolibarr_syslog("interface_webcal.class.php: ".$this->error);
return - 2 ;
2005-09-09 23:18:12 +02:00
}
}
2006-11-23 00:36:27 +01:00
2005-09-09 23:24:13 +02:00
return 0 ;
2005-09-09 23:18:12 +02:00
}
}
?>