This commit is contained in:
ldestailleur
2025-06-22 12:41:32 +02:00
parent 34b3096b21
commit 60e595ff24
2 changed files with 6 additions and 4 deletions

View File

@@ -432,7 +432,7 @@ if ($mode == 'hierarchy') {
$entry .= '<span class="noborderoncategories" '.$color.'>'.$li.'</span>';
if (!empty($conf->main_checkbox_left_column)) {
if ($user->hasRight('categorie', 'creer')) {
$entry .= ' &nbsp; <a class="editfielda" href="' . DOL_URL_ROOT . '/categories/edit.php?id=' . $val['id'] . $param . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?type=' . urlencode($type)) . '">' . img_edit() . '</a>';
$entry .= ' &nbsp; <a class="editfielda" href="' . DOL_URL_ROOT . '/categories/edit.php?id=' . ((int) $val['id']) . $param . '&backtopage=' . urlencode($_SERVER["PHP_SELF"].'?type='.urlencode($type).'&'.$param) . '">' . img_edit() . '</a>';
}
if ($user->hasRight('categorie', 'supprimer')) {
$entry .= ' &nbsp; <a class="deletefilelink" href="' . DOL_URL_ROOT . '/categories/viewcat.php?action=delete&token=' . newToken() . '&id=' . $val['id'] . $param . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?' . $param) . '&backtolist=' . urlencode($_SERVER["PHP_SELF"] . '?' . $param) . '">' . img_delete() . '</a>';
@@ -446,7 +446,7 @@ if ($mode == 'hierarchy') {
if (empty($conf->main_checkbox_left_column)) {
$entry .= '<td class="right" width="30px;">';
if ($user->hasRight('categorie', 'creer')) {
$entry .= '<a class="editfielda" href="' . DOL_URL_ROOT . '/categories/edit.php?id=' . $val['id'] . $param . '&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?type=' . urlencode($type)) . '">' . img_edit() . '</a>';
$entry .= '<a class="editfielda" href="' . DOL_URL_ROOT . '/categories/edit.php?id=' . $val['id'] . $param . '&backtopage=' . urlencode($_SERVER["PHP_SELF"].'?type='.urlencode($type).'&'.$param).'">' . img_edit() . '</a>';
}
$entry .= '</td>';

View File

@@ -49,6 +49,7 @@ $action = (GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'edit');
$confirm = GETPOST('confirm');
$cancel = GETPOST('cancel', 'alpha');
$backtopage = GETPOST('backtopage', 'alpha');
$dol_openinpopup = GETPOST('dol_openinpopup', 'aZ');
$socid = GETPOSTINT('socid');
$label = (string) GETPOST('label', 'alphanohtml');
@@ -103,7 +104,7 @@ if (empty($reshook)) {
header("Location: ".$backtopage);
exit;
} else {
header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.$object->id.'&type='.$type);
header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.((int) $object->id).'&type='.urlencode($type).($dol_openinpopup ? '&dol_openinpopup='.urlencode($dol_openinpopup) : ''));
exit;
}
}
@@ -136,7 +137,7 @@ if (empty($reshook)) {
header("Location: ".$backtopage);
exit;
} else {
header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.$object->id.'&type='.$type);
header('Location: '.DOL_URL_ROOT.'/categories/viewcat.php?id='.((int) $object->id).'&type='.urlencode($type).($dol_openinpopup ? '&dol_openinpopup='.urlencode($dol_openinpopup) : ''));
exit;
}
} else {
@@ -170,6 +171,7 @@ print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
print '<input type="hidden" name="type" value="'.$type.'">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
print '<input type="hidden" name="dol_openinpopup" value="'.$dol_openinpopup.'">';
print dol_get_fiche_head([]);