NEW: default add action: new param $backurlforcard to redict to card
This commit is contained in:
parent
cdcfe8e356
commit
2a265e9de9
@ -26,6 +26,7 @@
|
|||||||
// $object must be defined
|
// $object must be defined
|
||||||
// $permissiontoadd must be defined
|
// $permissiontoadd must be defined
|
||||||
// $permissiontodelete must be defined
|
// $permissiontodelete must be defined
|
||||||
|
// $backurlforcard must be defined
|
||||||
// $backurlforlist must be defined
|
// $backurlforlist must be defined
|
||||||
// $backtopage may be defined
|
// $backtopage may be defined
|
||||||
|
|
||||||
@ -66,7 +67,7 @@ if ($action == 'add' && ! empty($permissiontoadd))
|
|||||||
if ($result > 0)
|
if ($result > 0)
|
||||||
{
|
{
|
||||||
// Creation OK
|
// Creation OK
|
||||||
$urltogo=$backtopage?$backtopage:$backurlforlist;
|
$urltogo=$backtopage?$backtopage:($backurlforcard?str_replace('__ID__', $result, $backurlforcard):$backurlforlist);
|
||||||
header("Location: ".$urltogo);
|
header("Location: ".$urltogo);
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -118,6 +118,7 @@ if (empty($reshook))
|
|||||||
|
|
||||||
$permissiontoadd = $user->rights->mymodule->write;
|
$permissiontoadd = $user->rights->mymodule->write;
|
||||||
$permissiontodelete = $user->rights->mymodule->delete;
|
$permissiontodelete = $user->rights->mymodule->delete;
|
||||||
|
$backurlforcard = dol_buildpath('/mymodule/myobject_card.php',1).'?id=__ID__';
|
||||||
$backurlforlist = dol_buildpath('/mymodule/myobject_list.php',1);
|
$backurlforlist = dol_buildpath('/mymodule/myobject_list.php',1);
|
||||||
|
|
||||||
// Actions cancel, add, update or delete
|
// Actions cancel, add, update or delete
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user