fix bookmarks to allow Public items to be set and deleted by admins
This commit is contained in:
parent
891de3350f
commit
3573baf3ed
@ -171,7 +171,7 @@ if ($action == 'create') {
|
|||||||
|
|
||||||
// Owner
|
// Owner
|
||||||
print '<tr><td>'.$langs->trans("Owner").'</td><td>';
|
print '<tr><td>'.$langs->trans("Owner").'</td><td>';
|
||||||
print img_picto('', 'user').' '.$form->select_dolusers(GETPOSTISSET('userid') ? GETPOST('userid', 'int') : $user->id, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
|
print img_picto('', 'user').' '.$form->select_dolusers(GETPOSTISSET('userid') ? GETPOST('userid', 'int') : $user->id, 'userid', 0, '', 0, GETPOSTISSET('userid') ? GETPOST('userid', 'int') : array($user->id), '', 0, 0, 0, '', ($user->admin) ? 1 : 0, '', 'maxwidth300');
|
||||||
print '</td><td class="hideonsmartphone"> </td></tr>';
|
print '</td><td class="hideonsmartphone"> </td></tr>';
|
||||||
|
|
||||||
// Position
|
// Position
|
||||||
|
|||||||
@ -204,8 +204,10 @@ while ($i < min($num, $limit)) {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
$linkintern = 0;
|
$linkintern = 0;
|
||||||
$title = $obj->title;
|
$title = $obj->title;
|
||||||
$link = $obj->url;
|
$link = $obj->url;
|
||||||
|
$canedit = $user->rights->bookmark->supprimer;
|
||||||
|
$candelete = $user->rights->bookmark->creer;
|
||||||
|
|
||||||
// Title
|
// Title
|
||||||
print "<td>";
|
print "<td>";
|
||||||
@ -252,6 +254,10 @@ while ($i < min($num, $limit)) {
|
|||||||
print $tmpuser->getNomUrl(1);
|
print $tmpuser->getNomUrl(1);
|
||||||
} else {
|
} else {
|
||||||
print $langs->trans("Public");
|
print $langs->trans("Public");
|
||||||
|
if (!$user->admin) {
|
||||||
|
$candelete = false;
|
||||||
|
$canedit = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
print "</td>\n";
|
print "</td>\n";
|
||||||
|
|
||||||
@ -263,10 +269,10 @@ while ($i < min($num, $limit)) {
|
|||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
print '<td class="nowrap right">';
|
print '<td class="nowrap right">';
|
||||||
if ($user->rights->bookmark->creer) {
|
if ($canedit)
|
||||||
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/bookmarks/card.php?action=edit&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_edit()."</a>";
|
print '<a class="editfielda" href="'.DOL_URL_ROOT.'/bookmarks/card.php?action=edit&token='.newToken().'&id='.$obj->rowid.'&backtopage='.urlencode($_SERVER["PHP_SELF"]).'">'.img_edit()."</a>";
|
||||||
}
|
}
|
||||||
if ($user->rights->bookmark->supprimer) {
|
if ($candelete)
|
||||||
print '<a class="marginleftonly" href="'.$_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$obj->rowid.'">'.img_delete().'</a>';
|
print '<a class="marginleftonly" href="'.$_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$obj->rowid.'">'.img_delete().'</a>';
|
||||||
} else {
|
} else {
|
||||||
print " ";
|
print " ";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user