From cabaf4d4338af9be58008b65ba8d11858ea78058 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 30 Oct 2004 12:17:49 +0000 Subject: [PATCH] Trad: Traduction des actions --- htdocs/actioncomm.class.php | 29 ++++++++++++++++++++++++++--- htdocs/societe.php | 9 +++++++-- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/htdocs/actioncomm.class.php b/htdocs/actioncomm.class.php index a4b31a8b04f..bb7b56cc785 100644 --- a/htdocs/actioncomm.class.php +++ b/htdocs/actioncomm.class.php @@ -64,11 +64,15 @@ class ActionComm } /** - * \brief Ajout d'une action en base + * \brief Ajout d'une action en base (et eventuellement dans webcalendar) * \param author auteur de la creation de l'action + * \param webcal ressource webcalendar: 0=on oublie webcal, 1=on ajoute une entrée générique dans webcal, objet=ajout de l'objet dans webcal + * \return int id de l'action créée */ - function add($author) + function add($author, $webcal=0) { + global $conf; + if (! $this->contact) { $this->contact = 0; @@ -92,13 +96,32 @@ class ActionComm if ($this->db->query($sql) ) { - return 1; + $idaction = $this->db->last_insert_id(); + + if ($conf->webcal->enabled) { + if (is_object($webcal)) + { + // Ajoute entrée dans webcal + $result=$webcal->add($author,$webcal->date,$webcal->texte,$webcal->desc); + if ($result < 0) { + $this->error="Echec insertion dans webcal ".$webcal->error; + } + } + else if ($webcal == 1) + { + // \todo On ajoute une entrée générique, pour l'instant pas utilisé + + } + } + + return $idaction; } else { dolibarr_print_error($this->db); return -1; } + } /** diff --git a/htdocs/societe.php b/htdocs/societe.php index 630eb07e693..f81f4678352 100644 --- a/htdocs/societe.php +++ b/htdocs/societe.php @@ -20,13 +20,18 @@ * $Source$ */ +/*! + \file htdocs/societe.php + \ingroup societe + \brief Page des societes + \version $Revision$ +*/ + require("./pre.inc.php"); require("./contact.class.php"); -require("./lib/webcal.class.php"); require("./cactioncomm.class.php"); require("./actioncomm.class.php"); - $langs->load("companies"); $langs->load("customers"); $langs->load("suppliers");