From abeb1c644c7721bc931eaf97611d0ac6b09489da Mon Sep 17 00:00:00 2001 From: Dorian Vabre Date: Thu, 6 May 2021 13:50:13 +0200 Subject: [PATCH] country now only required when paying a booth, dates of start and end required --- htdocs/public/project/suggestbooth.php | 13 +++++++++---- htdocs/public/project/suggestconference.php | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/htdocs/public/project/suggestbooth.php b/htdocs/public/project/suggestbooth.php index 96a00434374..e8b7ad44874 100644 --- a/htdocs/public/project/suggestbooth.php +++ b/htdocs/public/project/suggestbooth.php @@ -242,7 +242,7 @@ if (empty($reshook) && $action == 'add') { $langs->load("errors"); $errmsg .= $langs->trans("ErrorBadEMail", GETPOST("email"))."
\n"; } - if (!GETPOST("country_id")) { + if (!GETPOST("country_id") && !empty(floatval($project->price_booth))) { $error++; $errmsg .= $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Country"))."
\n"; } @@ -407,6 +407,7 @@ if (empty($reshook) && $action == 'add') { $contact->errors = $facture->errors; $error++; } else { + $db->commit(); $facture->add_object_linked($contact->element, $contact->id); } } @@ -572,10 +573,10 @@ print '*'."\n"; print ''."\n"; // Start Date -print ''.$langs->trans("DateStart").''."\n"; +print ''.$langs->trans("DateStart").'*'."\n"; print ''."\n"; // End Date -print ''.$langs->trans("DateEnd").''."\n"; +print ''.$langs->trans("DateEnd").'*'."\n"; print ''."\n"; // Address print ''.$langs->trans("Address").''."\n"; @@ -587,7 +588,11 @@ print ' / '; print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); print ''; // Country -print ''.$langs->trans('Country').'*'; +print ''.$langs->trans('Country'); +if (!empty(floatval($project->price_booth))) { + print '*'; +} +print ''; $country_id = GETPOST('country_id'); if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs); diff --git a/htdocs/public/project/suggestconference.php b/htdocs/public/project/suggestconference.php index 1350716072b..0483312e519 100644 --- a/htdocs/public/project/suggestconference.php +++ b/htdocs/public/project/suggestconference.php @@ -526,7 +526,7 @@ print ' / '; print $formcompany->select_ziptown(GETPOST('town'), 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 1); print ''; // Country -print ''.$langs->trans('Country').'*'; +print ''.$langs->trans('Country').''; $country_id = GETPOST('country_id'); if (!$country_id && !empty($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE)) { $country_id = getCountry($conf->global->MEMBER_NEWFORM_FORCECOUNTRYCODE, 2, $db, $langs);