* Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2005 Simon TOSSER * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010 Juanjo Menent * * 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, see . */ /** * \file htdocs/comm/action/fiche.php * \ingroup agenda * \brief Page for event card */ require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/core/lib/agenda.lib.php"); require_once(DOL_DOCUMENT_ROOT."/core/lib/project.lib.php"); require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"); require_once(DOL_DOCUMENT_ROOT."/contact/class/contact.class.php"); require_once(DOL_DOCUMENT_ROOT."/user/class/user.class.php"); require_once(DOL_DOCUMENT_ROOT."/comm/action/class/cactioncomm.class.php"); require_once(DOL_DOCUMENT_ROOT."/comm/action/class/actioncomm.class.php"); require_once(DOL_DOCUMENT_ROOT."/core/class/html.formactions.class.php"); require_once(DOL_DOCUMENT_ROOT."/projet/class/project.class.php"); $langs->load("companies"); $langs->load("commercial"); $langs->load("other"); $langs->load("bills"); $langs->load("orders"); $langs->load("agenda"); $action=GETPOST('action','alpha'); $backtopage=GETPOST('backtopage','alpha'); // Security check $socid = GETPOST('socid','int'); $id = GETPOST('id','int'); if ($user->societe_id) $socid=$user->societe_id; //$result = restrictedArea($user, 'agenda', $id, 'actioncomm', 'actions', '', 'id'); $error=GETPOST("error"); $cactioncomm = new CActionComm($db); $actioncomm = new ActionComm($db); $contact = new Contact($db); //var_dump($_POST); /* * Action creation de l'action */ if ($action == 'add_action') { $error=0; if (empty($backtopage)) { if ($socid > 0) $backtopage = DOL_URL_ROOT.'/societe/agenda.php?socid='.$socid; else $backtopage=DOL_URL_ROOT.'/comm/action/index.php'; } if ($_POST["contactid"]) { $result=$contact->fetch($_POST["contactid"]); } if ($_POST['cancel']) { header("Location: ".$backtopage); exit; } $fulldayevent=$_POST["fullday"]; // Clean parameters $datep=dol_mktime($fulldayevent?'00':$_POST["aphour"], $fulldayevent?'00':$_POST["apmin"], 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]); $datef=dol_mktime($fulldayevent?'23':$_POST["p2hour"], $fulldayevent?'59':$_POST["p2min"], $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]); // Check parameters if (! $datef && $_POST["percentage"] == 100) { $error++; $action = 'create'; $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->trans("DateEnd")).'
'; } // Initialisation objet cactioncomm if (! $_POST["actioncode"]) { $error++; $action = 'create'; $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->trans("Type")).'
'; } else { $result=$cactioncomm->fetch($_POST["actioncode"]); } // Initialisation objet actioncomm $actioncomm->type_id = $cactioncomm->id; $actioncomm->type_code = $cactioncomm->code; $actioncomm->priority = isset($_POST["priority"])?$_POST["priority"]:0; $actioncomm->fulldayevent = $_POST["fullday"]?1:0; $actioncomm->location = isset($_POST["location"])?$_POST["location"]:''; $actioncomm->label = trim($_POST["label"]); if (! $_POST["label"]) { if ($_POST["actioncode"] == 'AC_RDV' && $contact->getFullName($langs)) { $actioncomm->label = $langs->transnoentitiesnoconv("TaskRDVWith",$contact->getFullName($langs)); } else { if ($langs->trans("Action".$actioncomm->type_code) != "Action".$actioncomm->type_code) { $actioncomm->label = $langs->transnoentitiesnoconv("Action".$actioncomm->type_code)."\n"; } else $actioncomm->label = $cactioncomm->libelle; } } $actioncomm->fk_project = isset($_POST["projectid"])?$_POST["projectid"]:0; $actioncomm->datep = $datep; $actioncomm->datef = $datef; $actioncomm->percentage = isset($_POST["percentage"])?$_POST["percentage"]:0; $actioncomm->duree=(($_POST["dureehour"] * 60) + $_POST["dureemin"]) * 60; $usertodo=new User($db); if ($_POST["affectedto"] > 0) { $usertodo->fetch($_POST["affectedto"]); } $actioncomm->usertodo = $usertodo; $userdone=new User($db); if ($_POST["doneby"] > 0) { $userdone->fetch($_POST["doneby"]); } $actioncomm->userdone = $userdone; $actioncomm->note = trim($_POST["note"]); if (isset($_POST["contactid"])) $actioncomm->contact = $contact; if (GETPOST('socid','int') > 0) { $societe = new Societe($db); $societe->fetch(GETPOST('socid','int')); $actioncomm->societe = $societe; } // Special for module webcal and phenix if ($_POST["add_webcal"] == 'on' && $conf->webcalendar->enabled) $actioncomm->use_webcal=1; if ($_POST["add_phenix"] == 'on' && $conf->phenix->enabled) $actioncomm->use_phenix=1; // Check parameters if ($actioncomm->type_code == 'AC_RDV' && ($datep == '' || $datef == '')) { $error++; $action = 'create'; $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("DateEnd")).'
'; } if ($datea && $_POST["percentage"] == 0) { $error++; $action = 'create'; $mesg='
'.$langs->trans("ErrorStatusCantBeZeroIfStarted").'
'; } if (! $_POST["apyear"] && ! $_POST["adyear"]) { $error++; $action = 'create'; $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")).'
'; } if (! $error) { $db->begin(); // On cree l'action $idaction=$actioncomm->add($user); if ($idaction > 0) { if (! $actioncomm->error) { $db->commit(); if (! empty($backtopage)) { dol_syslog("Back to ".$backtopage); Header("Location: ".$backtopage); } elseif($idaction) { Header("Location: ".DOL_URL_ROOT.'/comm/action/fiche.php?id='.$idaction); } else { Header("Location: ".DOL_URL_ROOT.'/comm/action/index.php'); } exit; } else { // Si erreur $db->rollback(); $id=$idaction; $langs->load("errors"); $error=$langs->trans($actioncomm->error); } } else { $db->rollback(); $id=$idaction; $langs->load("errors"); $error=$langs->trans($actioncomm->error); } } } /* * Action suppression de l'action */ if ($action == 'confirm_delete' && GETPOST("confirm") == 'yes') { $actioncomm = new ActionComm($db); $actioncomm->fetch($id); if ($user->rights->agenda->myactions->delete || $user->rights->agenda->allactions->delete) { $result=$actioncomm->delete(); if ($result >= 0) { Header("Location: index.php"); exit; } else { $mesg=$actioncomm->error; } } } /* * Action mise a jour de l'action */ if ($action == 'update') { if (! $_POST["cancel"]) { $fulldayevent=$_POST["fullday"]; // Clean parameters if ($_POST["aphour"] == -1) $_POST["aphour"]='0'; if ($_POST["apmin"] == -1) $_POST["apmin"]='0'; if ($_POST["p2hour"] == -1) $_POST["p2hour"]='0'; if ($_POST["p2min"] == -1) $_POST["p2min"]='0'; //if ($_POST["adhour"] == -1) $_POST["adhour"]='0'; //if ($_POST["admin"] == -1) $_POST["admin"]='0'; $actioncomm = new Actioncomm($db); $actioncomm->fetch($id); $datep=dol_mktime($fulldayevent?'00':$_POST["aphour"], $fulldayevent?'00':$_POST["apmin"], 0, $_POST["apmonth"], $_POST["apday"], $_POST["apyear"]); $datef=dol_mktime($fulldayevent?'23':$_POST["p2hour"], $fulldayevent?'59':$_POST["p2min"], $fulldayevent?'59':'0', $_POST["p2month"], $_POST["p2day"], $_POST["p2year"]); $actioncomm->label = $_POST["label"]; $actioncomm->datep = $datep; $actioncomm->datef = $datef; //$actioncomm->date = $datea; //$actioncomm->dateend = $datea2; $actioncomm->percentage = $_POST["percentage"]; $actioncomm->priority = $_POST["priority"]; $actioncomm->fulldayevent= $_POST["fullday"]?1:0; $actioncomm->location = isset($_POST["location"])?$_POST["location"]:''; $actioncomm->societe->id = $_POST["socid"]; $actioncomm->contact->id = $_POST["contactid"]; $actioncomm->fk_project = $_POST["projectid"]; $actioncomm->note = $_POST["note"]; $actioncomm->pnote = $_POST["note"]; if (! $datef && $_POST["percentage"] == 100) { $error=$langs->trans("ErrorFieldRequired",$langs->trans("DateEnd")); $action = 'edit'; } // Users $usertodo=new User($db); if ($_POST["affectedto"]) { $usertodo->fetch($_POST["affectedto"]); } $actioncomm->usertodo = $usertodo; $userdone=new User($db); if ($_POST["doneby"]) { $userdone->fetch($_POST["doneby"]); } $actioncomm->userdone = $userdone; if (! $error) { $db->begin(); $result=$actioncomm->update($user); if ($result > 0) { $db->commit(); } else { $db->rollback(); } } } if ($result < 0) { $langs->load("errors"); $mesg='
'.$langs->trans($actioncomm->error).'
'; } else { if (! empty($backtopage)) { header("Location: ".$backtopage); exit; } } } /* * View */ $help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda'; llxHeader('',$langs->trans("Agenda"),$help_url); $form = new Form($db); $htmlactions = new FormActions($db); if ($action == 'create') { $contact = new Contact($db); if (GETPOST("contactid")) { $result=$contact->fetch(GETPOST("contactid")); if ($result < 0) dol_print_error($db,$contact->error); } if ($conf->use_javascript_ajax) { print "\n".''."\n"; } print '
'; print ''; print ''; if ($backtopage) print ''; if (GETPOST("actioncode") == 'AC_RDV') print_fiche_titre($langs->trans("AddActionRendezVous")); else print_fiche_titre($langs->trans("AddAnAction")); dol_htmloutput_mesg($mesg); print ''; // Type d'action actifs print ''; // Title print ''; // Full day print ''; // Date start $datep=$actioncomm->datep; if (GETPOST('datep','int',1)) $datep=dol_stringtotime(GETPOST('datep','int',1),0); print ''; // Date end $datef=$actioncomm->datef; if (GETPOST('datef','int',1)) $datef=dol_stringtotime(GETPOST('datef','int',1),0); print ''; // Status print ''; print ''; // Location print ''; print '
'.$langs->trans("Type").''; if (GETPOST("actioncode")) { print ''."\n"; $cactioncomm->fetch(GETPOST("actioncode")); print $cactioncomm->getNomUrl(); } else { $htmlactions->select_type_actions($actioncomm->type_code, "actioncode"); } print '
'.$langs->trans("Title").'
'.$langs->trans("EventOnFullDay").'
'.$langs->trans("DateActionStart").''; if (GETPOST("afaire") == 1) $form->select_date($datep,'ap',1,1,0,"action",1,1,0,0,'fulldayend'); else if (GETPOST("afaire") == 2) $form->select_date($datep,'ap',1,1,1,"action",1,1,0,0,'fulldayend'); else $form->select_date($datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart'); print '
'.$langs->trans("DateActionEnd").''; if (GETPOST("afaire") == 1) $form->select_date($datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend'); else if (GETPOST("afaire") == 2) $form->select_date($datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend'); else $form->select_date($datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend'); print '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; $percent=-1; if (isset($_GET['percentage']) || isset($_POST['percentage'])) { $percent=GETPOST('percentage'); } else { if (GETPOST("afaire") == 1) $percent=0; if (GETPOST("afaire") == 2) $percent=100; } print $htmlactions->form_select_status_action('formaction',$percent,1,'complete'); print '
'.$langs->trans("Location").'
'; print '

'; print ''; // Affected by $var=false; print ''; // Realised by print ''; print '
'.$langs->trans("ActionAffectedTo").''; $form->select_users(GETPOST("affectedto")?GETPOST("affectedto"):($actioncomm->usertodo->id > 0 ? $actioncomm->usertodo : $user),'affectedto',1); print '
'.$langs->trans("ActionDoneBy").''; $form->select_users(GETPOST("doneby")?GETPOST("doneby"):($percent==100?$actioncomm->userdone:0),'doneby',1); print '
'; print '

'; print ''; // Societe, contact print ''; // If company is forced, we propose contacts (may be contact is also forced) if (GETPOST("contactid") > 0 || GETPOST('socid','int') > 0) { print ''; } // Project if ($conf->projet->enabled) { // Projet associe $langs->load("project"); print ''; } if (GETPOST("datep") && preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])$/',GETPOST("datep"),$reg)) { $actioncomm->datep=dol_mktime(0,0,0,$reg[2],$reg[3],$reg[1]); } // Priority print ''; add_row_for_calendar_link(); // Description print ''; print '
'.$langs->trans("ActionOnCompany").''; if (GETPOST('socid','int') > 0) { $societe = new Societe($db); $societe->fetch(GETPOST('socid','int')); print $societe->getNomUrl(1); print ''; } else { print $form->select_company('','socid','',1,1); } print '
'.$langs->trans("ActionOnContact").''; $form->select_contacts(GETPOST('socid','int'),GETPOST('contactid'),'contactid',1); print '
'.$langs->trans("Project").''; $numproject=select_projects($societe->id,GETPOST("projectid")?GETPOST("projectid"):$projectid,'projectid'); if ($numproject==0) { print '   '.$langs->trans("AddProject").''; } print '
'.$langs->trans("Priority").''; print 'priority?$actioncomm->priority:'')).'" size="5">'; print '
'.$langs->trans("Description").''; require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php"); $doleditor=new DolEditor('note',($_POST["note"]?$_POST["note"]:$actioncomm->note),'',280,'dolibarr_notes','In',true,true,$conf->fckeditor->enabled,ROWS_7,90); $doleditor->Create(); print '
'; print '

'; print ''; print '     '; print ''; print '
'; print "
"; } // View or edit if ($id) { if ($error) { dol_htmloutput_errors($error); } if ($mesg) { dol_htmloutput_mesg($mesg); } $act = new ActionComm($db); $result=$act->fetch($id); if ($result < 0) { dol_print_error($db,$act->error); exit; } $societe = new Societe($db); if ($act->societe->id) { $result=$societe->fetch($act->societe->id); } $act->societe = $societe; if ($act->author->id > 0) { $tmpuser=new User($db); $res=$tmpuser->fetch($act->author->id); $act->author=$tmpuser; } if ($act->usermod->id > 0) { $tmpuser=new User($db); $res=$tmpuser->fetch($act->usermod->id); $act->usermod=$tmpuser; } if ($act->usertodo->id > 0) { $tmpuser=new User($db); $res=$tmpuser->fetch($act->usertodo->id); $act->usertodo=$tmpuser; } if ($act->userdone->id > 0) { $tmpuser=new User($db); $res=$tmpuser->fetch($act->userdone->id); $act->userdone=$tmpuser; } $contact = new Contact($db); if ($act->contact->id) { $result=$contact->fetch($act->contact->id,$user); } $act->contact = $contact; /* * Affichage onglets */ $head=actions_prepare_head($act); dol_fiche_head($head, 'card', $langs->trans("Action"),0,'action'); $now=dol_now(); $delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60; // Confirmation suppression action if ($action == 'delete') { $ret=$form->form_confirm("fiche.php?id=".$id,$langs->trans("DeleteAction"),$langs->trans("ConfirmDeleteAction"),"confirm_delete",'','',1); if ($ret == 'html') print '
'; } if ($action == 'edit') { if ($conf->use_javascript_ajax) { print "\n".''."\n"; } // Fiche action en mode edition print '
'; print ''; print ''; print ''; print ''; if ($backtopage) print ''; print ''; // Ref print ''; // Type print ''; // Title print ''; // Full day event print ''; // Date start print ''; // Date end print ''; // Status print ''; // Location print ''; print '
'.$langs->trans("Ref").''.$act->id.'
'.$langs->trans("Type").''.$act->type.'
'.$langs->trans("Title").'
'.$langs->trans("EventOnFullDay").'fulldayevent?' checked="checked"':'').'>
'.$langs->trans("DateActionStart").''; if (GETPOST("afaire") == 1) $form->select_date($act->datep,'ap',1,1,0,"action",1,1,0,0,'fulldaystart'); else if (GETPOST("afaire") == 2) $form->select_date($act->datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart'); else $form->select_date($act->datep,'ap',1,1,1,"action",1,1,0,0,'fulldaystart'); print '
'.$langs->trans("DateActionEnd").''; if (GETPOST("afaire") == 1) $form->select_date($act->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend'); else if (GETPOST("afaire") == 2) $form->select_date($act->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend'); else $form->select_date($act->datef,'p2',1,1,1,"action",1,1,0,0,'fulldayend'); print '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; $percent=GETPOST("percentage")?GETPOST("percentage"):$act->percentage; print $htmlactions->form_select_status_action('formaction',$percent,1); print '
'.$langs->trans("Location").'


'; // Input by $var=false; print ''; // Affected to print ''; // Realised by print ''; print '
'.$langs->trans("ActionAskedBy").''; print $act->author->getNomUrl(1); print '
'.$langs->trans("ActionAffectedTo").''; print $form->select_dolusers($act->usertodo->id>0?$act->usertodo->id:-1,'affectedto',1); print '
'.$langs->trans("ActionDoneBy").''; print $form->select_dolusers($act->userdone->id> 0?$act->userdone->id:-1,'doneby',1); print '


'; print ''; // Company print ''; print ''; // Contact print ''; // Project if ($conf->projet->enabled) { // Projet associe $langs->load("project"); print ''; } // Priority print ''; // Object linked if (! empty($act->fk_element) && ! empty($act->elementtype)) { print ''; print ''; } // Description print ''; print '
'.$langs->trans("ActionOnCompany").''; print $form->select_company($act->societe->id,'socid','',1,1); print ''.$langs->trans("Contact").''; print $form->selectarray("contactid", (empty($act->societe->id)?array():$act->societe->contact_array()), $act->contact->id, 1); print '
'.$langs->trans("Project").''; $numprojet=select_projects($act->societe->id,$act->fk_project,'projectid'); if ($numprojet==0) { print '   '.$langs->trans("AddProject").''; } print '
'.$langs->trans("Priority").''; print ''; print '
'.$langs->trans("LinkedObject").''.$act->getElementUrl($act->fk_element,$act->elementtype,1).'
'.$langs->trans("Description").''; // Editeur wysiwyg require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php"); $doleditor=new DolEditor('note',$act->note,'',240,'dolibarr_notes','In',true,true,$conf->fckeditor->enabled,ROWS_5,90); $doleditor->Create(); print '
'; print '

'; print '     '; print '
'; print '
'; } else { // Affichage fiche action en mode visu print ''; // Ref print ''; // Type print ''; // Title print ''; // Full day event print ''; // Date start print ''; print ''; print ''; // Date end print ''; // Status print ''; // Location print ''; print '
'.$langs->trans("Ref").''; print $form->showrefnav($act,'id','',($user->societe_id?0:1),'id','ref',''); print '
'.$langs->trans("Type").''.$act->type.'
'.$langs->trans("Title").''.$act->label.'
'.$langs->trans("EventOnFullDay").''.yn($act->fulldayevent).'
'.$langs->trans("DateActionStart").''; if (! $act->fulldayevent) print dol_print_date($act->datep,'dayhour'); else print dol_print_date($act->datep,'day'); if ($act->percentage == 0 && $act->datep && $act->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late")); print ''."\n"; print '
'; print ''; print ''; print ''; print ''; print ''; //print ''; print img_picto($langs->trans("ViewCal"),'object_calendar').' '; print '
'."\n"; print '
'; print ''; print ''; print ''; print ''; print ''; //print ''; print img_picto($langs->trans("ViewCal"),'object_calendarweek').' '; print '
'."\n"; print '
'; print ''; print ''; print ''; print ''; print ''; //print ''; print img_picto($langs->trans("ViewCal"),'object_calendarday').' '; print '
'."\n"; print '
'.$langs->trans("DateActionEnd").''; if (! $act->fulldayevent) print dol_print_date($act->datef,'dayhour'); else print dol_print_date($act->datef,'day'); if ($act->percentage > 0 && $act->percentage < 100 && $act->datef && $act->datef < ($now- $delay_warning)) print img_warning($langs->trans("Late")); print '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; print $act->getLibStatut(4); print '
'.$langs->trans("Location").''.$act->location.'


'; // Input by $var=false; print ''; // Affecte a print ''; // Done by print ''; print '
'.$langs->trans("ActionAskedBy").''; if ($act->author->id > 0) print $act->author->getNomUrl(1); else print ' '; print '
'.$langs->trans("ActionAffectedTo").''; if ($act->usertodo->id > 0) print $act->usertodo->getNomUrl(1); print '
'.$langs->trans("ActionDoneBy").''; if ($act->userdone->id > 0) print $act->userdone->getNomUrl(1); print '


'; // Third party - Contact print ''; print ''; print ''; // Project if ($conf->projet->enabled) { print ''; } // Priority print ''; // Object linked if (! empty($act->fk_element) && ! empty($act->elementtype)) { print ''; print ''; } // Description print ''; print '
'.$langs->trans("ActionOnCompany").''.($act->societe->id?$act->societe->getNomUrl(1):$langs->trans("None")); if ($act->societe->id && $act->type_code == 'AC_TEL') { if ($act->societe->fetch($act->societe->id)) { print "
".dol_print_phone($act->societe->tel); } } print '
'.$langs->trans("Contact").''; if ($act->contact->id > 0) { print $act->contact->getNomUrl(1); if ($act->contact->id && $act->type_code == 'AC_TEL') { if ($act->contact->fetch($act->contact->id)) { print "
".dol_print_phone($act->contact->phone_pro); } } } else { print $langs->trans("None"); } print '
'.$langs->trans("Project").''; if ($act->fk_project) { $project=new Project($db); $project->fetch($act->fk_project); print $project->getNomUrl(1); } print '
'.$langs->trans("Priority").''; print ($act->priority?$act->priority:''); print '
'.$langs->trans("LinkedObject").''.$act->getElementUrl($act->fk_element,$act->elementtype,1).'
'.$langs->trans("Description").''; print dol_htmlentitiesbr($act->note); print '
'; } print "\n"; /* * Barre d'actions * */ print '
'; if ($action != 'edit') { if ($user->rights->agenda->allactions->create || (($act->author->id == $user->id || $act->usertodo->id == $user->id) && $user->rights->agenda->myactions->create)) { print ''.$langs->trans("Modify").''; } else { print ''.$langs->trans("Modify").''; } if ($user->rights->agenda->allactions->delete || (($act->author->id == $user->id || $act->usertodo->id == $user->id) && $user->rights->agenda->myactions->delete)) { print ''.$langs->trans("Delete").''; } else { print ''.$langs->trans("Delete").''; } } print '
'; } $db->close(); llxFooter(); /** * Ajoute une ligne de tableau a 2 colonnes pour avoir l'option synchro calendrier * * @return int Retourne le nombre de lignes ajoutees */ function add_row_for_calendar_link() { global $conf,$langs,$user; $nbtr=0; // Lien avec calendrier si module active if ($conf->webcalendar->enabled) { if ($conf->global->PHPWEBCALENDAR_SYNCRO != 'never') { $langs->load("other"); print ''.$langs->trans("AddCalendarEntry","Webcalendar").''; if (! $user->webcal_login) { print ''; print ' '.$langs->transnoentities("ErrorWebcalLoginNotDefined","id."\">".$user->login.""); print ''; print ''; $nbtr++; } else { if ($conf->global->PHPWEBCALENDAR_SYNCRO == 'always') { print ''; } else { print 'global->PHPWEBCALENDAR_SYNCRO=='always' || $conf->global->PHPWEBCALENDAR_SYNCRO=='yesbydefault')?' checked':'').'>'; print ''; $nbtr++; } } } } if ($conf->phenix->enabled) { if ($conf->global->PHPPHENIX_SYNCRO != 'never') { $langs->load("other"); print ''.$langs->trans("AddCalendarEntry","Phenix").''; if (! $user->phenix_login) { print ''; print ' '.$langs->transnoentities("ErrorPhenixLoginNotDefined","id."\">".$user->login.""); print ''; print ''; $nbtr++; } else { if ($conf->global->PHPPHENIX_SYNCRO == 'always') { print ''; } else { print 'global->PHPPHENIX_SYNCRO=='always' || $conf->global->PHPPHENIX_SYNCRO=='yesbydefault')?' checked':'').'>'; print ''; $nbtr++; } } } } return $nbtr; } ?>