From e006876f2567ea406f8b261557b4bc201ccd1688 Mon Sep 17 00:00:00 2001 From: lvessiller Date: Fri, 5 Feb 2021 09:48:08 +0100 Subject: [PATCH] NEW choose lines while creating intervention card from origin --- htdocs/fichinter/card.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index c1c26234206..6c1dd4ddeb2 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -200,6 +200,7 @@ if (empty($reshook)) $mesg = $object->error; } } elseif ($action == 'add' && $user->rights->ficheinter->creer) { + $selectedLines = GETPOST('toselect', 'array'); $object->socid = $socid; $object->duration = (int) GETPOST('duration', 'int'); $object->fk_project = (int) GETPOST('projectid', 'int'); @@ -284,6 +285,8 @@ if (empty($reshook)) for ($i = 0; $i < $num; $i++) { + if (!in_array($lines[$i]->id, $selectedLines)) continue; // Skip unselected lines + $product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : Product::TYPE_PRODUCT); if ($product_type == Product::TYPE_SERVICE || !empty($conf->global->FICHINTER_PRINT_PRODUCTS)) { //only services except if config includes products @@ -1023,8 +1026,6 @@ if ($action == 'create') print ''; print ''; - print ''; - // Show origin lines if (!empty($origin) && !empty($originid) && is_object($objectsrc)) { $title = $langs->trans('Services'); @@ -1036,6 +1037,8 @@ if ($action == 'create') print ''; } + + print ''; } else { print '
'; print '';