From 6238ff0321db496a52195fbc2e052f6647876d8b Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Wed, 14 Apr 2021 15:52:46 +0200 Subject: [PATCH] wip on asking for the company name only if price is set --- .../eventorganization/attendee_subscription.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/htdocs/public/eventorganization/attendee_subscription.php b/htdocs/public/eventorganization/attendee_subscription.php index 3d1ee6272cc..a18912da4ef 100644 --- a/htdocs/public/eventorganization/attendee_subscription.php +++ b/htdocs/public/eventorganization/attendee_subscription.php @@ -81,6 +81,9 @@ $email = GETPOST("email"); $encodedid = GETPOST('id'); $id = dol_decode($encodedid, $dolibarr_main_instance_unique_id); +$project = new Project($db); + + // Getting 'securekey'.'id' from Post and decoding it $encodedsecurekeyandid = GETPOST('securekey', 'alpha'); $securekeyandid = dol_decode($encodedsecurekeyandid, $dolibarr_main_instance_unique_id); @@ -193,10 +196,11 @@ if (empty($reshook) && $action == 'add') { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Email"))."
\n"; } - /*if (!GETPOST("societe")) { + // If the price has been set, name is required for the invoice + if (!GETPOST("societe") && !empty(floatval($project->price_registration))) { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Societe"))."
\n"; - }*/ + } if (GETPOST("email") && !isValidEmail(GETPOST("email"))) { $error++; $langs->load("errors"); @@ -350,7 +354,11 @@ print ''." // Email print ''."\n"; // Company -print ''."\n"; +print ''."\n"; // Address print ''."\n";
'.$langs->trans("Email").' *
'.$langs->trans("Company").'
'.$langs->trans("Company"); +if(!empty(floatval($project->price_registration))){ + print '*'; +} +print '
'.$langs->trans("Address").''."\n"; print '