Add permissions on agenda modules
This commit is contained in:
parent
ba14103659
commit
d0d9e8252f
@ -193,7 +193,7 @@ if ($objectid > 0)
|
|||||||
|
|
||||||
// Affiche formulaire upload
|
// Affiche formulaire upload
|
||||||
$formfile=new FormFile($db);
|
$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
|
// List of document
|
||||||
|
|||||||
@ -865,11 +865,25 @@ if ($_GET["id"])
|
|||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
if ($_GET["action"] != 'edit' && $_GET["action"] != 'delete')
|
if ($_GET["action"] != 'edit' && $_GET["action"] != 'delete')
|
||||||
|
{
|
||||||
|
if ($user->rights->agenda->allactions->create)
|
||||||
{
|
{
|
||||||
print '<a class="butAction" href="fiche.php?action=edit&id='.$act->id.'">'.$langs->trans("Modify").'</a>';
|
print '<a class="butAction" href="fiche.php?action=edit&id='.$act->id.'">'.$langs->trans("Modify").'</a>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans("Modify").'</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($user->rights->agenda->allactions->create)
|
||||||
|
{
|
||||||
print '<a class="butActionDelete" href="fiche.php?action=delete&id='.$act->id.'">'.$langs->trans("Delete").'</a>';
|
print '<a class="butActionDelete" href="fiche.php?action=delete&id='.$act->id.'">'.$langs->trans("Delete").'</a>';
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<a class="butActionRefused" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans("Delete").'</a>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -509,7 +509,7 @@ function show_day_events($db, $day, $month, $year, $style, $actionarray, $maxPri
|
|||||||
print '<tr style="background: #EEEEEE"><td align="left" nowrap="nowrap">';
|
print '<tr style="background: #EEEEEE"><td align="left" nowrap="nowrap">';
|
||||||
print '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&day='.str_pad($day, 2, "0", STR_PAD_LEFT).'&month='.$month.'&year='.$year.'">'.dol_print_date($curtime,'%a %d').'</a>';
|
print '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action=show_day&day='.str_pad($day, 2, "0", STR_PAD_LEFT).'&month='.$month.'&year='.$year.'">'.dol_print_date($curtime,'%a %d').'</a>';
|
||||||
print '</td><td align="right" nowrap="nowrap">';
|
print '</td><td align="right" nowrap="nowrap">';
|
||||||
if ($user->rights->agenda->myactions->create || $user->rights->agenda->actions->create)
|
if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create)
|
||||||
{
|
{
|
||||||
print '<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&datep='.sprintf("%04d%02d%02d",$year,$month,$day).'">';
|
print '<a href="'.DOL_URL_ROOT.'/comm/action/fiche.php?action=create&datep='.sprintf("%04d%02d%02d",$year,$month,$day).'">';
|
||||||
print img_picto($langs->trans("NewAction"),'edit_add.png');
|
print img_picto($langs->trans("NewAction"),'edit_add.png');
|
||||||
|
|||||||
@ -732,7 +732,7 @@ class MenuLeft {
|
|||||||
|
|
||||||
// Actions
|
// 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/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
|
// 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", $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);
|
$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);
|
||||||
|
|||||||
@ -701,7 +701,7 @@ class MenuLeft {
|
|||||||
|
|
||||||
// Actions
|
// 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/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
|
// 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", $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);
|
$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);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user