From a33727f4c50c6dbbf4595a120a5c438b52b1fabe Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Thu, 15 Jan 2015 13:00:11 +0100 Subject: [PATCH 1/3] Update task.php Allow to change the ref of a task (like the ref of project) --- htdocs/projet/tasks/task.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index a64d5354768..fd821fe216b 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -81,6 +81,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->projet->creer) $task_parent=$tmparray[1]; if (empty($task_parent)) $task_parent = 0; // If task_parent is '' + $object->ref = $_POST["ref"]; $object->label = $_POST["label"]; $object->description = $_POST['description']; $object->fk_task_parent = $task_parent; @@ -308,7 +309,7 @@ if ($id > 0 || ! empty($ref)) // Ref print ''.$langs->trans("Ref").''; - print ''.$object->ref.''; + print ''; // Label print ''.$langs->trans("Label").''; From c923d06d84c8392d641f217c14fa9ff07fd46d09 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Thu, 15 Jan 2015 17:10:47 +0100 Subject: [PATCH 2/3] Update task.php --- htdocs/projet/tasks/task.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index fd821fe216b..e2bccd26a5d 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -37,7 +37,7 @@ $langs->load("projects"); $langs->load("companies"); $id=GETPOST('id','int'); -$ref=GETPOST('ref','alpha'); +$ref=$_GET["ref"]; $action=GETPOST('action','alpha'); $confirm=GETPOST('confirm','alpha'); $withproject=GETPOST('withproject','int'); From d98d4d219f67aba9124f731744d762f6b7fec28c Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Mon, 19 Jan 2015 22:46:28 +0100 Subject: [PATCH 3/3] Update task.php use GETPOST instead of $_GET and $_POST --- htdocs/projet/tasks/task.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index e2bccd26a5d..b9106c4e2e3 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -37,7 +37,7 @@ $langs->load("projects"); $langs->load("companies"); $id=GETPOST('id','int'); -$ref=$_GET["ref"]; +$ref=GETPOST("ref",'alpha',1); $action=GETPOST('action','alpha'); $confirm=GETPOST('confirm','alpha'); $withproject=GETPOST('withproject','int'); @@ -81,7 +81,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->projet->creer) $task_parent=$tmparray[1]; if (empty($task_parent)) $task_parent = 0; // If task_parent is '' - $object->ref = $_POST["ref"]; + $object->ref = GETPOST("ref",'alpha',2); $object->label = $_POST["label"]; $object->description = $_POST['description']; $object->fk_task_parent = $task_parent;