FIX: user $backtopage insteead of $backurlforcard

This commit is contained in:
Marc de Lima Lucio 2018-04-18 10:12:19 +02:00
parent 2a265e9de9
commit 1a9675e410
2 changed files with 2 additions and 2 deletions

View File

@ -67,7 +67,7 @@ if ($action == 'add' && ! empty($permissiontoadd))
if ($result > 0)
{
// Creation OK
$urltogo=$backtopage?$backtopage:($backurlforcard?str_replace('__ID__', $result, $backurlforcard):$backurlforlist);
$urltogo=$backtopage?str_replace('__ID__', $result, $backtopage):$backurlforlist;
header("Location: ".$urltogo);
exit;
}

View File

@ -118,7 +118,7 @@ if (empty($reshook))
$permissiontoadd = $user->rights->mymodule->write;
$permissiontodelete = $user->rights->mymodule->delete;
$backurlforcard = dol_buildpath('/mymodule/myobject_card.php',1).'?id=__ID__';
if(empty($backtopage)) $backtopage = dol_buildpath('/mymodule/myobject_card.php',1).'?id=__ID__';
$backurlforlist = dol_buildpath('/mymodule/myobject_list.php',1);
// Actions cancel, add, update or delete