* * 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$ */ require("./pre.inc.php3"); require("../../contact.class.php3"); require("../../lib/webcal.class.php3"); require("../../cactioncomm.class.php3"); require("../../actioncomm.class.php3"); /* * Sécurité accés client */ if ($user->societe_id > 0) { $action = ''; $socidp = $user->societe_id; } $db = new Db(); /* * * * */ if ($action=='add_action') { $contact = new Contact($db); $contact->fetch($contactid); $societe = new Societe($db); $societe->fetch($socid); $actioncomm = new ActionComm($db); if ($actionid == 5) { $actioncomm->date = $db->idate(mktime($heurehour,$heuremin,0,$remonth,$reday,$reyear)); $actioncomm->percent = 0; } else { $actioncomm->date = $date; $actioncomm->percent = 100; } $actioncomm->priority = 2; $actioncomm->type = $actionid; $actioncomm->contact = $contactid; $actioncomm->user = $user; $actioncomm->societe = $socid; $actioncomm->note = $note; $actioncomm->add($user); if ($todo == 'on' ) { $todo = new ActionComm($db); $todo->type = 0; $todo->date = $db->idate(mktime(12,0,0,$remonth, $reday, $reyear)); $todo->libelle = $todo_label; $todo->priority = 2; $todo->societe = $societe->id; $todo->contact = $contactid; $todo->user = $user; $todo->note = $todo_note; $todo->percent = 0; $todo->add($user); if ($conf->webcal && $todo_webcal == 'on') { $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); } } Header("Location: /comm/fiche.php3?socid=$socid"); } /******************************************************************************/ /* */ /* Fin des Actions */ /* */ /******************************************************************************/ llxHeader(); /* * * * */ 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 '
'; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print '
Rendez-vous
Société'; print ''.$societe->nom.'
Contact'.$contact->fullname.'
Date'; print_date_select(); print '
Heure'; print_heure_select("heure",8,20); print '
Durée'; print_duree_select("duree"); print '
Commentaire'; print '
'; } /* * * Action autre que rendez-vous * * */ else { print '
'; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print '
Action effectuée
Action'.$caction->libelle.'
Société'; print ''.$societe->nom.'
Contact'.$contact->fullname.'
Date'.strftime('%d %B %Y %H:%M',time()).'
Commentaire'; print '
Prochaine Action à faire
Ajouter
Date'; print_date_select(); print '
Action
Calendrier
Commentaire'; print '
'; } } /* * * * */ if ($id) { $act = new ActionComm($db); $act->fetch($id); $act->societe->fetch($act->societe->id); print_titre ("Action commerciale"); print ''; print ''; print ''; print ''; print ''; print ''; print ''; print '
Type'.$act->type.'
Société'.$act->societe->nom.'Contact'.$fullname.'
Auteur'.$fullname.'Date'.strftime('%d %B %Y %H:%M',time()).'
Commentaire'; print nl2br($act->note).'
'; print '

Supprimer'; } $db->close(); llxFooter("Dernière modification $Date$ révision $Revision$"); ?>