fix code
This commit is contained in:
parent
0d56ef8c1d
commit
a08d84b995
@ -181,7 +181,7 @@ if ($object->id > 0) {
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if (isModEnabled('agenda')) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
print '<a class="butAction" href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create' . $out . '">' . $langs->trans("AddAction") . '</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#">' . $langs->trans("AddAction") . '</a>';
|
||||
|
||||
@ -183,7 +183,7 @@ if ($object->id > 0) {
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
// if (isModEnabled('agenda')) {
|
||||
// if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
|
||||
// if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
// print '<a class="butAction" href="' . DOL_URL_ROOT . '/comm/action/card.php?action=create' . $out . '">' . $langs->trans("AddAction") . '</a>';
|
||||
// } else {
|
||||
// print '<a class="butActionRefused classfortooltip" href="#">' . $langs->trans("AddAction") . '</a>';
|
||||
|
||||
@ -225,7 +225,7 @@ if ($object->id > 0) {
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if (isModEnabled('agenda')) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AddAction").'</a>';
|
||||
|
||||
@ -280,7 +280,7 @@ if ($object->id > 0) {
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if (isModEnabled('agenda')) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AddAction").'</a>';
|
||||
|
||||
@ -280,7 +280,7 @@ if ($object->id > 0) {
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if (isModEnabled('agenda')) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AddAction").'</a>';
|
||||
|
||||
@ -159,7 +159,7 @@ if ($user->socid && $socid) {
|
||||
$result = restrictedArea($user, 'societe', $socid);
|
||||
}
|
||||
|
||||
$usercancreate = $user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create);
|
||||
$usercancreate = $user->hasRight('agenda', 'allactions', 'create') || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create);
|
||||
|
||||
|
||||
/*
|
||||
@ -218,7 +218,7 @@ if (empty($reshook) && (GETPOST('addassignedtouser') || GETPOST('updateassignedt
|
||||
}
|
||||
|
||||
// Link to a project
|
||||
if (empty($reshook) && $action == 'classin' && ($user->rights->agenda->allactions->create ||
|
||||
if (empty($reshook) && $action == 'classin' && ($user->hasRight('agenda', 'allactions', 'create') ||
|
||||
(($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create))) {
|
||||
//$object->fetch($id);
|
||||
$object->setProject(GETPOST('projectid', 'int'));
|
||||
@ -1093,7 +1093,7 @@ if (empty($reshook) && GETPOST('actionmove', 'alpha') == 'mupdate') {
|
||||
|
||||
// Actions to delete doc
|
||||
$upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($object->ref);
|
||||
$permissiontoadd = ($user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->read));
|
||||
$permissiontoadd = ($user->hasRight('agenda', 'allactions', 'create') || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->read));
|
||||
if (empty($reshook)) {
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||
}
|
||||
@ -2466,14 +2466,14 @@ if ($id > 0) {
|
||||
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if (empty($reshook)) {
|
||||
if ($action != 'edit') {
|
||||
if ($user->rights->agenda->allactions->create ||
|
||||
if ($user->hasRight('agenda', 'allactions', 'create') ||
|
||||
(($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create)) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?action=edit&token='.newToken().'&id='.$object->id.'">'.$langs->trans("Modify").'</a></div>';
|
||||
} else {
|
||||
print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans("Modify").'</a></div>';
|
||||
}
|
||||
|
||||
if ($user->rights->agenda->allactions->create ||
|
||||
if ($user->hasRight('agenda', 'allactions', 'create') ||
|
||||
(($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create)) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?action=clone&object='.$object->element.'&id='.$object->id.'">'.$langs->trans("ToClone").'</a></div>';
|
||||
} else {
|
||||
|
||||
@ -210,7 +210,7 @@ class AgendaEvents extends DolibarrApi
|
||||
if (!DolibarrApiAccess::$user->rights->agenda->myactions->create) {
|
||||
throw new RestException(401, "Insufficient rights to create your Agenda Event");
|
||||
}
|
||||
if (!DolibarrApiAccess::$user->rights->agenda->allactions->create && DolibarrApiAccess::$user->id != $request_data['userownerid']) {
|
||||
if (!DolibarrApiAccess::$user->hasRight('agenda', 'allactions', 'create') && DolibarrApiAccess::$user->id != $request_data['userownerid']) {
|
||||
throw new RestException(401, "Insufficient rights to create an Agenda Event for owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id);
|
||||
}
|
||||
|
||||
@ -249,7 +249,7 @@ class AgendaEvents extends DolibarrApi
|
||||
if (!DolibarrApiAccess::$user->rights->agenda->myactions->create) {
|
||||
throw new RestException(401, "Insufficient rights to create your Agenda Event");
|
||||
}
|
||||
if (!DolibarrApiAccess::$user->rights->agenda->allactions->create && DolibarrApiAccess::$user->id != $request_data['userownerid']) {
|
||||
if (!DolibarrApiAccess::$user->hasRight('agenda', 'allactions', 'create') && DolibarrApiAccess::$user->id != $request_data['userownerid']) {
|
||||
throw new RestException(401, "Insufficient rights to create an Agenda Event for owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id);
|
||||
}
|
||||
|
||||
|
||||
@ -92,7 +92,7 @@ if ($user->socid && $socid) {
|
||||
$result = restrictedArea($user, 'societe', $socid);
|
||||
}
|
||||
|
||||
$usercancreate = $user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create);
|
||||
$usercancreate = $user->hasRight('agenda', 'allactions', 'create') || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create);
|
||||
$permissiontoadd = $usercancreate;
|
||||
|
||||
|
||||
@ -305,7 +305,7 @@ if ($object->id > 0) {
|
||||
|
||||
|
||||
$modulepart = 'actions';
|
||||
$permissiontoadd = $user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create;
|
||||
$permissiontoadd = $user->rights->agenda->myactions->create || $user->hasRight('agenda', 'allactions', 'create');
|
||||
$param = '&id='.$object->id;
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php';
|
||||
} else {
|
||||
|
||||
@ -540,7 +540,7 @@ $viewmode .= '<span class="marginrightonly"></span>'; // To add a space before t
|
||||
|
||||
$newcardbutton = '';
|
||||
$newparam = '';
|
||||
if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) {
|
||||
if ($user->rights->agenda->myactions->create || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
$tmpforcreatebutton = dol_getdate(dol_now(), true);
|
||||
|
||||
$newparam .= '&month='.((int) $month).'&year='.((int) $tmpforcreatebutton['year']).'&mode='.urlencode($mode);
|
||||
@ -1703,7 +1703,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
$curtime = dol_mktime(0, 0, 0, $month, $day, $year);
|
||||
$urltoshow = DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&day='.str_pad($day, 2, "0", STR_PAD_LEFT).'&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year.$newparam;
|
||||
$urltocreate = '';
|
||||
if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) {
|
||||
if ($user->rights->agenda->myactions->create || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
$newparam .= '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year;
|
||||
$hourminsec = '100000';
|
||||
$urltocreate = DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $year, $month, $day).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : ''));
|
||||
@ -1722,7 +1722,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
}
|
||||
print '</a>';
|
||||
print '</div><div class="nowrap floatright inline-block marginrightonly">';
|
||||
if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) {
|
||||
if ($user->rights->agenda->myactions->create || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
print '<a class="cursoradd" href="'.$urltocreate.'">'; // Explicit link, usefull for nojs interfaces
|
||||
print img_picto($langs->trans("NewAction"), 'edit_add.png');
|
||||
print '</a>';
|
||||
@ -1849,7 +1849,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
||||
$cssclass .= ' movable cursormove';
|
||||
}
|
||||
} else {
|
||||
if ($user->rights->agenda->allactions->create ||
|
||||
if ($user->hasRight('agenda', 'allactions', 'create') ||
|
||||
(($event->authorid == $user->id || $event->userownerid == $user->id) && $user->rights->agenda->myactions->create)) {
|
||||
$cssclass .= " movable cursormove";
|
||||
} else {
|
||||
|
||||
@ -53,7 +53,7 @@ if ($user->socid && $socid) {
|
||||
$result = restrictedArea($user, 'societe', $socid);
|
||||
}
|
||||
|
||||
$usercancreate = $user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create);
|
||||
$usercancreate = $user->hasRight('agenda', 'allactions', 'create') || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create);
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -700,7 +700,7 @@ $url = DOL_URL_ROOT.'/comm/action/card.php?action=create';
|
||||
$url .= '&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec;
|
||||
$url .= '&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : ''));
|
||||
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', $url, '', $user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create);
|
||||
$newcardbutton = dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', $url, '', $user->rights->agenda->myactions->create || $user->hasRight('agenda', 'allactions', 'create'));
|
||||
|
||||
$param .= '&mode='.$mode;
|
||||
|
||||
|
||||
@ -479,7 +479,7 @@ if (empty($reshook)) {
|
||||
|
||||
|
||||
$newcardbutton = '';
|
||||
if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) {
|
||||
if ($user->rights->agenda->myactions->create || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
$tmpforcreatebutton = dol_getdate(dol_now(), true);
|
||||
|
||||
$newparam .= '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year'];
|
||||
|
||||
@ -475,7 +475,7 @@ if (empty($reshook)) {
|
||||
|
||||
$newparam = '';
|
||||
$newcardbutton = '';
|
||||
if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) {
|
||||
if ($user->rights->agenda->myactions->create || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
$tmpforcreatebutton = dol_getdate(dol_now(), true);
|
||||
|
||||
$newparam .= '&month='.urlencode(str_pad($month, 2, "0", STR_PAD_LEFT)).'&year='.urlencode($tmpforcreatebutton['year']);
|
||||
|
||||
@ -266,7 +266,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
||||
$out .= '&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog'));
|
||||
}
|
||||
|
||||
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out);
|
||||
}
|
||||
}
|
||||
|
||||
@ -234,7 +234,7 @@ if ($id > 0) {
|
||||
|
||||
$newcardbutton = '';
|
||||
if (isModEnabled('agenda')) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
$backtopage = $_SERVER['PHP_SELF'].'?id='.$object->id;
|
||||
$out = '&origin='.$object->element.'&originid='.$object->id.'&backtopage='.urlencode($backtopage);
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out);
|
||||
|
||||
@ -12061,7 +12061,7 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = '', $n
|
||||
$out .= $actionstatic->getNomUrl(1, -1, 'valignmiddle').' ';
|
||||
}
|
||||
|
||||
if (!empty($user->rights->agenda->allactions->create) ||
|
||||
if ($user->hasRight('agenda', 'allactions', 'create') ||
|
||||
(($actionstatic->authorid == $user->id || $actionstatic->userownerid == $user->id) && !empty($user->rights->agenda->myactions->create))) {
|
||||
$out .= '<a class="timeline-btn" href="'.DOL_MAIN_URL_ROOT.'/comm/action/card.php?action=edit&token='.newToken().'&id='.$actionstatic->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?'.$param).'"><i class="fa fa-pencil" title="'.$langs->trans("Modify").'" ></i></a>';
|
||||
}
|
||||
|
||||
@ -241,7 +241,7 @@ class modAgenda extends DolibarrModules
|
||||
'url'=>'/comm/action/card.php?mainmenu=agenda&leftmenu=agenda&action=create',
|
||||
'langs'=>'commercial',
|
||||
'position'=>101,
|
||||
'perms'=>'($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create)',
|
||||
'perms'=>'($user->rights->agenda->myactions->create||$user->hasRight('agenda', 'allactions', 'create'))',
|
||||
'enabled'=>'$conf->agenda->enabled',
|
||||
'target'=>'',
|
||||
'user'=>2
|
||||
|
||||
@ -196,7 +196,7 @@ if ($permok) {
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if (isModEnabled('agenda')) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id).'">'.$langs->trans("AddAction").'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AddAction").'</a>';
|
||||
|
||||
@ -200,7 +200,7 @@ if ($object->id > 0) {
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if (isModEnabled('agenda')) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AddAction").'</a>';
|
||||
|
||||
@ -191,7 +191,7 @@ if ($object->id > 0) {
|
||||
|
||||
|
||||
if (isModEnabled('agenda')) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
$newcardbutton = '';
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out);
|
||||
}
|
||||
|
||||
@ -200,7 +200,7 @@ if ($object->id > 0) {
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if (isModEnabled('agenda')) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AddAction").'</a>';
|
||||
|
||||
@ -194,7 +194,7 @@ if ($object->id > 0) {
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if (isModEnabled('agenda')) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AddAction").'</a>';
|
||||
|
||||
@ -221,7 +221,7 @@ if ($object->id > 0) {
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if (isModEnabled('agenda')) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AddAction").'</a>';
|
||||
|
||||
@ -280,7 +280,7 @@ if ($object->id > 0) {
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if (isModEnabled('agenda')) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AddAction").'</a>';
|
||||
|
||||
@ -219,7 +219,7 @@ if ($object->id > 0) {
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if (isModEnabled('agenda')) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AddAction").'</a>';
|
||||
|
||||
@ -220,7 +220,7 @@ if ($object->id > 0) {
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if (isModEnabled('agenda')) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AddAction").'</a>';
|
||||
|
||||
@ -197,7 +197,7 @@ if ($id > 0 || $ref) {
|
||||
$out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : '').'&backtopage='.$_SERVER["PHP_SELF"].'?id='.$object->id.'&percentage=-1';
|
||||
}
|
||||
|
||||
$linktocreatetimeBtnStatus = !empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create);
|
||||
$linktocreatetimeBtnStatus = !empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create');
|
||||
$morehtmlcenter = dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out, '', $linktocreatetimeBtnStatus);
|
||||
}
|
||||
|
||||
|
||||
@ -210,7 +210,7 @@ $alias_product_perentity = empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED) ?
|
||||
$arrayfields = array(
|
||||
'p.rowid'=>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'noteditable'=>1, 'notnull'=> 1, 'index'=>1, 'position'=>1, 'comment'=>'Id', 'css'=>'left'),
|
||||
'p.ref'=>array('label'=>"Ref", 'checked'=>1, 'position'=>10),
|
||||
//'pfp.ref_fourn'=>array('label'=>$langs->trans("RefSupplier"), 'checked'=>1, 'enabled'=>(!empty($conf->barcode->enabled))),
|
||||
//'pfp.ref_fourn'=>array('label'=>$langs->trans("RefSupplier"), 'checked'=>1, 'enabled'=>(isModEnabled('barcode'))),
|
||||
'thumbnail'=>array('label'=>'Photo', 'checked'=>0, 'position'=>10),
|
||||
'p.label'=>array('label'=>"Label", 'checked'=>1, 'position'=>10),
|
||||
'p.fk_product_type'=>array('label'=>"Type", 'checked'=>0, 'enabled'=>(isModEnabled("product") && isModEnabled("service")), 'position'=>11),
|
||||
|
||||
@ -201,7 +201,7 @@ if ($object->id > 0) {
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if (isModEnabled('agenda')) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AddAction").'</a>';
|
||||
|
||||
@ -196,7 +196,7 @@ if (!empty($object->id)) {
|
||||
|
||||
// Show link to add event
|
||||
if (isModEnabled('agenda')) {
|
||||
$addActionBtnRight = !empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create);
|
||||
$addActionBtnRight = !empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create');
|
||||
$morehtmlcenter .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'&socid='.$object->socid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $addActionBtnRight);
|
||||
}
|
||||
|
||||
|
||||
@ -196,7 +196,7 @@ if (!empty($object->id)) {
|
||||
|
||||
// Show link to add event
|
||||
if (isModEnabled('agenda')) {
|
||||
$addActionBtnRight = !empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create);
|
||||
$addActionBtnRight = !empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create');
|
||||
$morehtmlcenter .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'&socid='.$object->socid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $addActionBtnRight);
|
||||
}
|
||||
|
||||
|
||||
@ -221,7 +221,7 @@ if ($object->id > 0) {
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if (isModEnabled('agenda')) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AddAction").'</a>';
|
||||
|
||||
@ -218,7 +218,7 @@ if ($object->id > 0) {
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if (isModEnabled('agenda')) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AddAction").'</a>';
|
||||
|
||||
@ -178,7 +178,7 @@ if ($socid > 0) {
|
||||
// $morehtmlright .= dolGetButtonTitle($langs->trans('TicketAddMessage'), '', 'fa fa-comment-dots', $url, 'add-new-ticket-title-button', $btnstatus);
|
||||
|
||||
if (isModEnabled('agenda')) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out);
|
||||
}
|
||||
}
|
||||
|
||||
@ -178,7 +178,7 @@ if ($socid > 0) {
|
||||
// $morehtmlright .= dolGetButtonTitle($langs->trans('TicketAddMessage'), '', 'fa fa-comment-dots', $url, 'add-new-ticket-title-button', $btnstatus);
|
||||
|
||||
if (isModEnabled('agenda')) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out);
|
||||
}
|
||||
}
|
||||
|
||||
@ -233,7 +233,7 @@ if ($object->id > 0) {
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if (isModEnabled('agenda')) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AddAction").'</a>';
|
||||
|
||||
@ -223,7 +223,7 @@ if ($object->id > 0) {
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
if (!empty($conf->agenda->enabled)) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) {
|
||||
if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) {
|
||||
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'">'.$langs->trans("AddAction").'</a>';
|
||||
} else {
|
||||
print '<a class="butActionRefused classfortooltip" href="#">'.$langs->trans("AddAction").'</a>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user