From c8fd7ccbb67253e848b2470d26eb6e1532592c0b Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Tue, 3 Aug 2021 15:06:53 +0200 Subject: [PATCH 1/3] Close #18043 : fk_user_assign in create ticket --- htdocs/core/class/html.formticket.class.php | 8 ++++++++ htdocs/ticket/card.php | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php index 53ba83015b3..259e5a3a19a 100644 --- a/htdocs/core/class/html.formticket.class.php +++ b/htdocs/core/class/html.formticket.class.php @@ -436,6 +436,14 @@ class FormTicket print 'withnotifytiersatcreate ? ' checked="checked"' : '').'>'; print ''; } + + // User assigned + print ''; + print $langs->trans("AssignedTo"); + print ''; + print $form->select_dolusers(GETPOST('fk_user_assign', 'int'), 'fk_user_assign', 1); + print ''; + print ''; } if (!empty($conf->projet->enabled) && !$this->ispublic) { diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index f64b6e28fd1..9b5f937455e 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -188,7 +188,7 @@ if (empty($reshook)) { $object->email_from = $user->email; $notifyTiers = GETPOST("notify_tiers_at_create", 'alpha'); $object->notify_tiers_at_create = empty($notifyTiers) ? 0 : 1; - + $object->fk_user_assign = GETPOST("fk_user_assign", 'int'); $object->fk_project = $projectid; $id = $object->create($user); From 6e68bf10ef265f1d83c7610070a9dbeee478f5ac Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Tue, 3 Aug 2021 16:06:08 +0200 Subject: [PATCH 2/3] Update of card.php to change status --- htdocs/ticket/card.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 9b5f937455e..5d71ee4e393 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -188,7 +188,12 @@ if (empty($reshook)) { $object->email_from = $user->email; $notifyTiers = GETPOST("notify_tiers_at_create", 'alpha'); $object->notify_tiers_at_create = empty($notifyTiers) ? 0 : 1; - $object->fk_user_assign = GETPOST("fk_user_assign", 'int'); + $fk_user_assign = GETPOST("fk_user_assign", 'int'); + if (!empty($fk_user_assign)) { + $object->fk_user_assign = $fk_user_assign; + $object->fk_statut = $object::STATUS_ASSIGNED; + } + $object->fk_project = $projectid; $id = $object->create($user); From 892ec3a66166fdecdf56d363e5c74b417805f07c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 3 Aug 2021 17:06:07 +0200 Subject: [PATCH 3/3] Update card.php --- htdocs/ticket/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index 5d71ee4e393..8a11ac23e23 100644 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -189,7 +189,7 @@ if (empty($reshook)) { $notifyTiers = GETPOST("notify_tiers_at_create", 'alpha'); $object->notify_tiers_at_create = empty($notifyTiers) ? 0 : 1; $fk_user_assign = GETPOST("fk_user_assign", 'int'); - if (!empty($fk_user_assign)) { + if ($fk_user_assign > 0) { $object->fk_user_assign = $fk_user_assign; $object->fk_statut = $object::STATUS_ASSIGNED; }