From 98c622446eabdf468b76d482a8f4eb5dca1d3c57 Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 15 Apr 2021 12:14:34 +0200 Subject: [PATCH] dynamic selector of service/product used for the invoice added --- htdocs/admin/eventorganization.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php index 58f09786e23..4e8d19d4590 100644 --- a/htdocs/admin/eventorganization.php +++ b/htdocs/admin/eventorganization.php @@ -278,16 +278,13 @@ if ($action == 'edit') { });'; print ''; } - } elseif ($var['type'] == 'product') { + } elseif ($val['type'] == 'product') { if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) { - print ''.$langs->trans("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS").''; - print ''; - $selected = (empty($conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS) ? '' : $conf->global->ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS); - $form->select_produits($selected, 'ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS', '', 0); - print ''; + $selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname); + $form->select_produits($selected, $constname, '', 0); } } else { - print ''; + print ''; } print ''; }