From e804a9949e78b05fc125a5ed5499b2e6cf39bc4f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 23 Aug 2010 19:15:51 +0000 Subject: [PATCH] Fix: Cancel button go on nowhere --- htdocs/projet/tasks.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/htdocs/projet/tasks.php b/htdocs/projet/tasks.php index 2f56cf3a734..f8dfc776b30 100644 --- a/htdocs/projet/tasks.php +++ b/htdocs/projet/tasks.php @@ -111,6 +111,15 @@ if ($_POST["action"] == 'createtask' && $user->rights->projet->creer) } } } + else + { + if (empty($_GET["id"]) && empty($_POST["id"])) + { + // We go back on task list + Header("Location: ".DOL_URL_ROOT.'/projet/tasks/index.php'.(empty($_REQUEST["mode"])?'':'?mode='.$_REQUEST["mode"])); + exit; + } + } } /* @@ -125,7 +134,7 @@ llxHeader("",$langs->trans("Tasks"),$help_url); $task = new Task($db); -$id = $_REQUEST['id']; +$id = (! empty($_GET['id']))?$_GET['id']:$_POST['id']; $ref= $_GET['ref']; if ($id > 0 || ! empty($ref)) {