Merge pull request #8563 from ATM-Marc/NEW_backurlforcard

NEW: default add action: new param $backurlforcard to redirect to card
This commit is contained in:
Laurent Destailleur 2018-04-27 11:57:15 +02:00 committed by GitHub
commit f1b9188e9b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

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

View File

@ -120,6 +120,7 @@ if (empty($reshook))
$permissiontoadd = $user->rights->mymodule->write;
$permissiontodelete = $user->rights->mymodule->delete;
if (empty($backtopage)) $backtopage = dol_buildpath('/mymodule/myobject_card.php',1).'?id=__ID__';
$backurlforlist = dol_buildpath('/mymodule/myobject_list.php',1);
$triggermodname = 'MYMODULE_MODIFY';