*
* $Id$
* $Source$
*
* 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.
*
*/
require("./pre.inc.php3");
require("../contact.class.php3");
require("../lib/webcal.class.php3");
require("cactioncomm.class.php3");
require("actioncomm.class.php3");
require("../todocomm.class.php3");
llxHeader();
$db = new Db();
if ($page == -1) { $page = 0 ; }
$limit = $conf->liste_limit;
$offset = $limit * $page ;
/*
*
*
*
*/
if ($action=='add_action') {
$contact = new Contact($db);
$contact->fetch($contactid);
$actioncomm = new ActionComm($db);
if ($actionid == 5) {
$actioncomm->date = $db->idate(mktime($heurehour,$heuremin,0,$remonth,$reday,$reyear));
} else {
$actioncomm->date = $date;
}
$actioncomm->type = $actionid;
$actioncomm->contact = $contactid;
$actioncomm->societe = $socid;
$actioncomm->note = $note;
$actioncomm->add($user);
$societe = new Societe($db);
$societe->fetch($socid);
$todo = new TodoComm($db);
$todo->date = mktime(12,0,0,$remonth, $reday, $reyear);
$todo->libelle = $todo_label;
$todo->societe = $societe->id;
$todo->contact = $contactid;
$todo->note = $todo_note;
$todo->add($user);
$webcal = new Webcal();
$webcal->heure = $heurehour . $heuremin . '00';
$webcal->duree = ($dureehour * 60) + $dureemin;
if ($actionid == 5) {
$libelle = "Rendez-vous avec ".$contact->fullname;
$libelle .= "\n" . $todo->libelle;
} else {
$libelle = $todo->libelle;
}
$webcal->add($user, $todo->date, $societe->nom, $libelle);
}
/*
*
*
*
*/
if ($action=='create' && $actionid && $contactid) {
$caction = new CActioncomm();
$caction->fetch($db, $actionid);
$contact = new Contact($db);
$contact->fetch($contactid);
$societe = new Societe($db);
$societe->get_nom($socid);
/*
* Rendez-vous
*
*/
if ($actionid == 5)
{
print '