From d0d9e8252f65f7c9cd3bef06a90aa4be1c096db5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Mar 2009 00:20:21 +0000 Subject: [PATCH] Add permissions on agenda modules --- htdocs/comm/action/document.php | 2 +- htdocs/comm/action/fiche.php | 692 +++++++++--------- htdocs/comm/action/index.php | 2 +- .../menus/barre_left/eldy_backoffice.php | 2 +- .../menus/barre_left/eldy_frontoffice.php | 2 +- 5 files changed, 357 insertions(+), 343 deletions(-) diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index e6e3de8e4e6..236e016f580 100755 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -193,7 +193,7 @@ if ($objectid > 0) // Affiche formulaire upload $formfile=new FormFile($db); - $formfile->form_attach_new_file(DOL_URL_ROOT.'/comm/action/document.php?id='.$act->id,'',0,0,($user->rights->agenda->myactions->create||$user->rights->agenda->actions->create)); + $formfile->form_attach_new_file(DOL_URL_ROOT.'/comm/action/document.php?id='.$act->id,'',0,0,($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create)); // List of document diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 0ef8572f9e0..5e306f20b03 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -43,8 +43,8 @@ $langs->load("agenda"); // Security check if ($user->societe_id > 0) { - $action = ''; - $socid = $user->societe_id; + $action = ''; + $socid = $user->societe_id; } if (isset($_GET["error"])) $error=$_GET["error"]; @@ -59,12 +59,12 @@ $contact = new Contact($db); */ if ($_POST["action"] == 'add_action') { - if ($_POST["contactid"]) - { - $result=$contact->fetch($_POST["contactid"]); - } + if ($_POST["contactid"]) + { + $result=$contact->fetch($_POST["contactid"]); + } - if ($_POST['cancel']) + if ($_POST['cancel']) { $backtopage=''; if (! empty($_POST["backtopage"])) $backtopage=$_POST["backtopage"]; @@ -87,45 +87,45 @@ if ($_POST["action"] == 'add_action') //if ($_POST["a2hour"] == -1) $_POST["a2hour"]='0'; //if ($_POST["a2min"] == -1) $_POST["a2min"]='0'; $datep=dol_mktime($_POST["aphour"], - $_POST["apmin"], - 0, - $_POST["apmonth"], - $_POST["apday"], - $_POST["apyear"]); + $_POST["apmin"], + 0, + $_POST["apmonth"], + $_POST["apday"], + $_POST["apyear"]); $datep2=dol_mktime($_POST["p2hour"], - $_POST["p2min"], - 0, - $_POST["p2month"], - $_POST["p2day"], - $_POST["p2year"]); + $_POST["p2min"], + 0, + $_POST["p2month"], + $_POST["p2day"], + $_POST["p2year"]); /*$datea=dol_mktime($_POST["adhour"], // deprecated - $_POST["admin"], - 0, - $_POST["admonth"], - $_POST["adday"], - $_POST["adyear"]); - $datea2=dol_mktime($_POST["a2hour"], // deprecated - $_POST["a2min"], - 0, - $_POST["a2month"], - $_POST["a2day"], - $_POST["a2year"]); - */ + $_POST["admin"], + 0, + $_POST["admonth"], + $_POST["adday"], + $_POST["adyear"]); + $datea2=dol_mktime($_POST["a2hour"], // deprecated + $_POST["a2min"], + 0, + $_POST["a2month"], + $_POST["a2day"], + $_POST["a2year"]); + */ if (! $datep2 && $_POST["percentage"] == 100) { $error=1; - $_GET["action"] = 'create'; - $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->trans("DateEnd")).'
'; + $_GET["action"] = 'create'; + $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->trans("DateEnd")).'
'; } // Initialisation objet cactioncomm - if (! $_POST["actioncode"]) - { - $error=1; + if (! $_POST["actioncode"]) + { + $error=1; $_GET["action"] = 'create'; - $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->trans("Type")).'
'; - } + $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->trans("Type")).'
'; + } else { $result=$cactioncomm->fetch($_POST["actioncode"]); @@ -206,68 +206,68 @@ if ($_POST["action"] == 'add_action') { $error=1; $_GET["action"] = 'create'; - $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("DateEnd")).'
'; + $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentities("DateEnd")).'
'; } if ($datea && $_POST["percentage"] == 0) { $error=1; $_GET["action"] = 'create'; - $mesg='
'.$langs->trans("ErrorStatusCantBeZeroIfStarted").'
'; + $mesg='
'.$langs->trans("ErrorStatusCantBeZeroIfStarted").'
'; } - if (! $_POST["apyear"] && ! $_POST["adyear"]) - { - $error=1; + if (! $_POST["apyear"] && ! $_POST["adyear"]) + { + $error=1; $_GET["action"] = 'create'; - $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->trans("Date")).'
'; - } + $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->trans("Date")).'
'; + } - if (! $error) - { - $db->begin(); + if (! $error) + { + $db->begin(); - // On cree l'action - $idaction=$actioncomm->add($user); + // On cree l'action + $idaction=$actioncomm->add($user); - if ($idaction > 0) - { - if (! $actioncomm->error) - { - $db->commit(); - if ($_POST["from"]) - { + if ($idaction > 0) + { + if (! $actioncomm->error) + { + $db->commit(); + if ($_POST["from"]) + { dol_syslog("Back to ".$_POST["from"]); - Header("Location: ".$_POST["from"]); - } - 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(); - $_GET["id"]=$idaction; + Header("Location: ".$_POST["from"]); + } + 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(); + $_GET["id"]=$idaction; $langs->load("errors"); - $error=$langs->trans($actioncomm->error); - } - } - else - { - $db->rollback(); - $_GET["id"]=$idaction; + $error=$langs->trans($actioncomm->error); + } + } + else + { + $db->rollback(); + $_GET["id"]=$idaction; $langs->load("errors"); - $error=$langs->trans($actioncomm->error); - } - } + $error=$langs->trans($actioncomm->error); + } + } -// print $_REQUEST["from"]."rr"; + // print $_REQUEST["from"]."rr"; } /* @@ -276,19 +276,19 @@ if ($_POST["action"] == 'add_action') */ if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes') { - $actioncomm = new ActionComm($db); - $actioncomm->fetch($_GET["id"]); - $result=$actioncomm->delete(); + $actioncomm = new ActionComm($db); + $actioncomm->fetch($_GET["id"]); + $result=$actioncomm->delete(); if ($result >= 0) { - Header("Location: index.php"); - exit; - } - else - { - $mesg=$actioncomm->error; - } + Header("Location: index.php"); + exit; + } + else + { + $mesg=$actioncomm->error; + } } /* @@ -297,9 +297,9 @@ if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes') */ if ($_POST["action"] == 'update') { - if (! $_POST["cancel"]) - { - // Clean parameters + if (! $_POST["cancel"]) + { + // Clean parameters if ($_POST["aphour"] == -1) $_POST["aphour"]='0'; if ($_POST["apmin"] == -1) $_POST["apmin"]='0'; if ($_POST["p2hour"] == -1) $_POST["p2hour"]='0'; @@ -307,66 +307,66 @@ if ($_POST["action"] == 'update') //if ($_POST["adhour"] == -1) $_POST["adhour"]='0'; //if ($_POST["admin"] == -1) $_POST["admin"]='0'; - $actioncomm = new Actioncomm($db); - $actioncomm->fetch($_POST["id"]); + $actioncomm = new Actioncomm($db); + $actioncomm->fetch($_POST["id"]); - $datep=dol_mktime($_POST["aphour"], - $_POST["apmin"], - 0, - $_POST["apmonth"], - $_POST["apday"], - $_POST["apyear"]); + $datep=dol_mktime($_POST["aphour"], + $_POST["apmin"], + 0, + $_POST["apmonth"], + $_POST["apday"], + $_POST["apyear"]); $datep2=dol_mktime($_POST["p2hour"], - $_POST["p2min"], - 0, - $_POST["p2month"], - $_POST["p2day"], - $_POST["p2year"]); - /*$datea=dol_mktime($_POST["adhour"], - $_POST["admin"], - 0, - $_POST["admonth"], - $_POST["adday"], - $_POST["adyear"]); - $datea2=dol_mktime($_POST["a2hour"], - $_POST["a2min"], - 0, - $_POST["a2month"], - $_POST["a2day"], - $_POST["a2year"]); - */ + $_POST["p2min"], + 0, + $_POST["p2month"], + $_POST["p2day"], + $_POST["p2year"]); + /*$datea=dol_mktime($_POST["adhour"], + $_POST["admin"], + 0, + $_POST["admonth"], + $_POST["adday"], + $_POST["adyear"]); + $datea2=dol_mktime($_POST["a2hour"], + $_POST["a2min"], + 0, + $_POST["a2month"], + $_POST["a2day"], + $_POST["a2year"]); + */ //print $_POST["apmonth"].",".$_POST["apday"].",".$_POST["apyear"].",".$_POST["aphour"].",".$_POST["apmin"]."
\n"; //print $actioncomm->datep; - //print 'dddd'.$datep; - $actioncomm->label = $_POST["label"]; + //print 'dddd'.$datep; + $actioncomm->label = $_POST["label"]; $actioncomm->datep = $datep; $actioncomm->datef = $datep2; //$actioncomm->date = $datea; //$actioncomm->dateend = $datea2; - $actioncomm->percentage = $_POST["percentage"]; - $actioncomm->priority = $_POST["priority"]; + $actioncomm->percentage = $_POST["percentage"]; + $actioncomm->priority = $_POST["priority"]; $actioncomm->location = isset($_POST["location"])?$_POST["location"]:''; - $actioncomm->societe->id = $_POST["socid"]; - $actioncomm->contact->id = $_POST["contactid"]; - $actioncomm->note = $_POST["note"]; + $actioncomm->societe->id = $_POST["socid"]; + $actioncomm->contact->id = $_POST["contactid"]; + $actioncomm->note = $_POST["note"]; - if (! $datep2 && $_POST["percentage"] == 100) - { - $error=$langs->trans("ErrorFieldRequired",$langs->trans("DateEnd")); + if (! $datep2 && $_POST["percentage"] == 100) + { + $error=$langs->trans("ErrorFieldRequired",$langs->trans("DateEnd")); $_REQUEST["action"] = 'edit'; - } + } // Users $usertodo=new User($db,$_POST["affectedto"]); - if ($_POST["affectedto"]) + if ($_POST["affectedto"]) { $usertodo->fetch(); } $actioncomm->usertodo = $usertodo; $userdone=new User($db,$_POST["doneby"]); - if ($_POST["doneby"]) + if ($_POST["doneby"]) { $userdone->fetch(); } @@ -387,16 +387,16 @@ if ($_POST["action"] == 'update') $db->rollback(); } } - } + } - if ($result < 0) - { + if ($result < 0) + { $langs->load("errors"); - $mesg='
'.$langs->trans($actioncomm->error).'
'; - $_GET["id"]=$_POST["id"]; - } - else - { + $mesg='
'.$langs->trans($actioncomm->error).'
'; + $_GET["id"]=$_POST["id"]; + } + else + { if (! empty($_POST["from"])) { header("Location: ".$_POST["from"]); @@ -406,7 +406,7 @@ if ($_POST["action"] == 'update') { $_GET["id"]=$_REQUEST["id"]; } - } + } } @@ -436,7 +436,7 @@ if ($_GET["action"] == 'create') print '
'; print ''; - if (! empty($_REQUEST["backtopage"])) print ''; + if (! empty($_REQUEST["backtopage"])) print ''; if ($_GET["actioncode"] == 'AC_RDV') print_titre ($langs->trans("AddActionRendezVous")); else print_titre ($langs->trans("AddAnAction")); @@ -497,7 +497,7 @@ if ($_GET["action"] == 'create') // Affecte a print ''.$langs->trans("ActionAffectedTo").''; -// $html->select_users($_REQUEST["affectedto"]?$_REQUEST["affectedto"]:$actioncomm->usertodo,'affectedto',1); + // $html->select_users($_REQUEST["affectedto"]?$_REQUEST["affectedto"]:$actioncomm->usertodo,'affectedto',1); $html->select_users($_REQUEST["affectedto"]?$_REQUEST["affectedto"]:($actioncomm->usertodo->id > 0 ? $actioncomm->usertodo : $user),'affectedto',1); print ''; @@ -583,17 +583,17 @@ if ($_GET["action"] == 'create') */ if ($_GET["id"]) { - if ($error) - { - print '
'.$error.'

'; - } - if ($mesg) - { - print $mesg.'
'; - } + if ($error) + { + print '
'.$error.'

'; + } + if ($mesg) + { + print $mesg.'
'; + } - $act = new ActionComm($db); - $result=$act->fetch($_GET["id"]); + $act = new ActionComm($db); + $result=$act->fetch($_GET["id"]); if ($result < 0) dol_print_error($db,$act->error); $societe = new Societe($db); @@ -603,80 +603,80 @@ if ($_GET["id"]) } $act->societe = $societe; - if ($act->author->id > 0) { $tmpuser=new User($db); $tmpuser->id=$act->author->id; $res=$tmpuser->fetch(); $act->author=$tmpuser; } - if ($act->usermod->id > 0) { $tmpuser=new User($db); $tmpuser->id=$act->usermod->id; $res=$tmpuser->fetch(); $act->usermod=$tmpuser; } - if ($act->usertodo->id > 0) { $tmpuser=new User($db); $tmpuser->id=$act->usertodo->id; $res=$tmpuser->fetch(); $act->usertodo=$tmpuser; } - if ($act->userdone->id > 0) { $tmpuser=new User($db); $tmpuser->id=$act->userdone->id; $res=$tmpuser->fetch(); $act->userdone=$tmpuser; } + if ($act->author->id > 0) { $tmpuser=new User($db); $tmpuser->id=$act->author->id; $res=$tmpuser->fetch(); $act->author=$tmpuser; } + if ($act->usermod->id > 0) { $tmpuser=new User($db); $tmpuser->id=$act->usermod->id; $res=$tmpuser->fetch(); $act->usermod=$tmpuser; } + if ($act->usertodo->id > 0) { $tmpuser=new User($db); $tmpuser->id=$act->usertodo->id; $res=$tmpuser->fetch(); $act->usertodo=$tmpuser; } + if ($act->userdone->id > 0) { $tmpuser=new User($db); $tmpuser->id=$act->userdone->id; $res=$tmpuser->fetch(); $act->userdone=$tmpuser; } $contact = new Contact($db); if ($act->contact->id) { $result=$contact->fetch($act->contact->id,$user); } - $act->contact = $contact; + $act->contact = $contact; - /* - * Affichage onglets - */ + /* + * Affichage onglets + */ - $h = 0; + $h = 0; - $head[$h][0] = DOL_URL_ROOT.'/comm/action/fiche.php?id='.$_GET["id"]; - $head[$h][1] = $langs->trans("CardAction"); - $hselected=$h; - $h++; + $head[$h][0] = DOL_URL_ROOT.'/comm/action/fiche.php?id='.$_GET["id"]; + $head[$h][1] = $langs->trans("CardAction"); + $hselected=$h; + $h++; - $head[$h][0] = DOL_URL_ROOT.'/comm/action/document.php?id='.$_GET["id"]; - $head[$h][1] = $langs->trans('Documents'); - $h++; + $head[$h][0] = DOL_URL_ROOT.'/comm/action/document.php?id='.$_GET["id"]; + $head[$h][1] = $langs->trans('Documents'); + $h++; $head[$h][0] = DOL_URL_ROOT.'/comm/action/info.php?id='.$_GET["id"]; $head[$h][1] = $langs->trans('Info'); $h++; - dol_fiche_head($head, $hselected, $langs->trans("Action")); + dol_fiche_head($head, $hselected, $langs->trans("Action")); - $now=gmmktime(); + $now=gmmktime(); $delay_warning=$conf->global->MAIN_DELAY_ACTIONS_TODO*24*60*60; - // Confirmation suppression action - if ($_GET["action"] == 'delete') - { - $html->form_confirm("fiche.php?id=".$_GET["id"],$langs->trans("DeleteAction"),$langs->trans("ConfirmDeleteAction"),"confirm_delete"); - print '
'; - } + // Confirmation suppression action + if ($_GET["action"] == 'delete') + { + $html->form_confirm("fiche.php?id=".$_GET["id"],$langs->trans("DeleteAction"),$langs->trans("ConfirmDeleteAction"),"confirm_delete"); + print '
'; + } - if ($_REQUEST["action"] == 'edit') - { - // Fiche action en mode edition - print ''; - print ''; - print ''; - if (! empty($_REQUEST["backtopage"])) print ''; + if ($_REQUEST["action"] == 'edit') + { + // Fiche action en mode edition + print ''; + print ''; + print ''; + if (! empty($_REQUEST["backtopage"])) print ''; - print ''; + print '
'; - // Ref - print ''; + // Ref + print ''; - // Type - print ''; + // Type + print ''; - // Title - print ''; + // Title + print ''; - // Location - print ''; + // Location + print ''; - // Company - print ''; - print ''; + print ''; - print ''; + print ''; print '
'.$langs->trans("Ref").''.$act->id.'
'.$langs->trans("Ref").''.$act->id.'
'.$langs->trans("Type").''.$act->type.'
'.$langs->trans("Type").''.$act->type.'
'.$langs->trans("Title").'
'.$langs->trans("Title").'
'.$langs->trans("Location").'
'.$langs->trans("Location").'
'.$langs->trans("Company").''; + // Company + print '
'.$langs->trans("Company").''; print $html->select_societes($act->societe->id,'socid',1,1); print ''.$langs->trans("Contact").''; - $html->select_array("contactid", $act->societe->contact_array(), $act->contact->id, 1); - print '
'.$langs->trans("Contact").''; + $html->select_array("contactid", $act->societe->contact_array(), $act->contact->id, 1); + print '

'; @@ -711,64 +711,64 @@ if ($_GET["id"]) print ''; // Status - print ''; + print ''; // Priority print ''; - // Object linked - if ($act->objet_url) - { - print ''; - print ''; - } + // Object linked + if ($act->objet_url) + { + print ''; + print ''; + } - // Note - print ''; + print ''; - print ''; + print ''; - print '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; + print '
'.$langs->trans("Status").' / '.$langs->trans("Percentage").''; $percent=isset($_REQUEST["percentage"])?$_REQUEST["percentage"]:$act->percentage; print $htmlactions->form_select_status_action('formaction',$percent,1); - print '
'.$langs->trans("Priority").''; print ''; print '
'.$langs->trans("LinkedObject").''.$act->objet_url.'
'.$langs->trans("LinkedObject").''.$act->objet_url.'
'.$langs->trans("Note").''; + // Note + print '
'.$langs->trans("Note").''; if ($conf->fckeditor->enabled) - { + { // Editeur wysiwyg require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); $doleditor=new DolEditor('note',$act->note,240,'dolibarr_notes','In',true); $doleditor->Create(); - } - else - { + } + else + { print ''; - } + } - print '
'; - print '     '; - print '
'; + print '     '; + print '
'; - } - else - { - // Affichage fiche action en mode visu - print ''; + print '
'; + } + else + { + // Affichage fiche action en mode visu + print ''; // Ref - print ''; + print ''; // Type - print ''; + print ''; // Title - print ''; + print ''; // Location - print ''; + print ''; - // Societe - contact - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print '
'.$langs->trans("Ref").''.$act->id.'
'.$langs->trans("Ref").''.$act->id.'
'.$langs->trans("Type").''.$act->type.'
'.$langs->trans("Type").''.$act->type.'
'.$langs->trans("Title").''.$act->label.'
'.$langs->trans("Title").''.$act->label.'
'.$langs->trans("Location").''.$act->location.'
'.$langs->trans("Location").''.$act->location.'
'.$langs->trans("Company").''.($act->societe->id?$act->societe->getNomUrl(1):$langs->trans("None")); + // Societe - contact + print '
'.$langs->trans("Company").''.($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)) @@ -776,12 +776,12 @@ if ($_GET["id"]) print "
".dol_print_phone($act->societe->tel); } } - print '
'.$langs->trans("Contact").''; - if ($act->contact->id > 0) - { - print $act->contact->getNomUrl(1); + 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)) @@ -789,13 +789,13 @@ if ($_GET["id"]) print "
".dol_print_phone($act->contact->phone_pro); } } - } - else - { - print $langs->trans("None"); - } + } + else + { + print $langs->trans("None"); + } - print '

'; @@ -817,61 +817,75 @@ if ($_GET["id"]) print '

'; - // Date debut + // Date debut print ''; - // Date fin - print ''; - // Statut - print ''; + // Statut + print ''; // Priority print ''; - // Objet lie - if ($act->objet_url) - { - print ''; - print ''; - } + // Objet lie + if ($act->objet_url) + { + print ''; + print ''; + } - // Note - print ''; + print ''; - print '
'.$langs->trans("DateActionStart").''; print dol_print_date($act->datep,'dayhour'); if ($act->percentage == 0 && $act->datep && $act->datep < ($now - $delay_warning)) print img_warning($langs->trans("Late")); print '
'.$langs->trans("DateActionEnd").''; + // Date fin + print '
'.$langs->trans("DateActionEnd").''; print dol_print_date($act->datef,'dayhour'); 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("Status").' / '.$langs->trans("Percentage").''; + print $act->getLibStatut(4); + print '
'.$langs->trans("Priority").''; print $act->priority; print '
'.$langs->trans("LinkedObject").''.$act->objet_url.'
'.$langs->trans("LinkedObject").''.$act->objet_url.'
'.$langs->trans("Note").''; + // Note + print '
'.$langs->trans("Note").''; print dol_htmlentitiesbr($act->note); - print '
'; - } + print ''; + } - print "\n"; + print "\n"; - /** - * Barre d'actions - * - */ + /** + * Barre d'actions + * + */ - print '
'; + print '
'; - if ($_GET["action"] != 'edit' && $_GET["action"] != 'delete') - { - print ''.$langs->trans("Modify").''; + if ($_GET["action"] != 'edit' && $_GET["action"] != 'delete') + { + if ($user->rights->agenda->allactions->create) + { + print ''.$langs->trans("Modify").''; + } + else + { + print ''.$langs->trans("Modify").''; + } - print ''.$langs->trans("Delete").''; - } + if ($user->rights->agenda->allactions->create) + { + print ''.$langs->trans("Delete").''; + } + else + { + print ''.$langs->trans("Delete").''; + } + } - print '
'; + print '
'; } $db->close(); @@ -880,80 +894,80 @@ llxFooter('$Date$ - $Revision$'); /** - \brief Ajoute une ligne de tableau a 2 colonnes pour avoir l'option synchro calendrier - \return int Retourne le nombre de lignes ajoutees -*/ + \brief 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; + $nbtr=0; - // Lien avec calendrier si module active - if ($conf->webcal->enabled) - { - if ($conf->global->PHPWEBCALENDAR_SYNCRO != 'never') - { - $langs->load("other"); + // Lien avec calendrier si module active + if ($conf->webcal->enabled) + { + if ($conf->global->PHPWEBCALENDAR_SYNCRO != 'never') + { + $langs->load("other"); - print ''.$langs->trans("AddCalendarEntry","Webcalendar").''; + 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 (! $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"); + if ($conf->phenix->enabled) + { + if ($conf->global->PHPPHENIX_SYNCRO != 'never') + { + $langs->load("other"); - print ''.$langs->trans("AddCalendarEntry","Phenix").''; + 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++; - } - } - } - } + 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; + return $nbtr; } diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 89117c517ca..1ac766e2f87 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -509,7 +509,7 @@ function show_day_events($db, $day, $month, $year, $style, $actionarray, $maxPri print ''; print ''.dol_print_date($curtime,'%a %d').''; print ''; - if ($user->rights->agenda->myactions->create || $user->rights->agenda->actions->create) + if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) { print ''; print img_picto($langs->trans("NewAction"),'edit_add.png'); diff --git a/htdocs/includes/menus/barre_left/eldy_backoffice.php b/htdocs/includes/menus/barre_left/eldy_backoffice.php index e25f5e69247..33d3e4b698e 100644 --- a/htdocs/includes/menus/barre_left/eldy_backoffice.php +++ b/htdocs/includes/menus/barre_left/eldy_backoffice.php @@ -732,7 +732,7 @@ class MenuLeft { // Actions $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/index.php?mainmenu=agenda&leftmenu=agenda", $langs->trans("Actions"), 0, $user->rights->agenda->myactions->read); - $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/fiche.php?mainmenu=agenda&leftmenu=agenda&action=create", $langs->trans("NewAction"), 1, ($user->rights->agenda->myactions->create||$user->rights->agenda->actions->create)); + $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/fiche.php?mainmenu=agenda&leftmenu=agenda&action=create", $langs->trans("NewAction"), 1, ($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create)); // Calendar $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/index.php?mainmenu=agenda&leftmenu=agenda", $langs->trans("Calendar"), 1, $user->rights->agenda->myactions->read); $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine", $langs->trans("MenuToDoMyActions"),2, $user->rights->agenda->myactions->read); diff --git a/htdocs/includes/menus/barre_left/eldy_frontoffice.php b/htdocs/includes/menus/barre_left/eldy_frontoffice.php index 5aea77761f0..3fc4ac9cf73 100644 --- a/htdocs/includes/menus/barre_left/eldy_frontoffice.php +++ b/htdocs/includes/menus/barre_left/eldy_frontoffice.php @@ -701,7 +701,7 @@ class MenuLeft { // Actions $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/index.php?mainmenu=agenda&leftmenu=agenda", $langs->trans("Actions"), 0, $user->rights->agenda->myactions->read); - $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/fiche.php?mainmenu=agenda&leftmenu=agenda&action=create", $langs->trans("NewAction"), 1, ($user->rights->agenda->myactions->create||$user->rights->agenda->actions->create)); + $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/fiche.php?mainmenu=agenda&leftmenu=agenda&action=create", $langs->trans("NewAction"), 1, ($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create)); // Calendar $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/index.php?mainmenu=agenda&leftmenu=agenda", $langs->trans("Calendar"), 1, $user->rights->agenda->myactions->read); $newmenu->add_submenu(DOL_URL_ROOT."/comm/action/index.php?mainmenu=agenda&leftmenu=agenda&status=todo&filter=mine", $langs->trans("MenuToDoMyActions"),2, $user->rights->agenda->myactions->read);