diff --git a/htdocs/public/eventorganization/attendee_subscription.php b/htdocs/public/eventorganization/attendee_subscription.php
index 3d1ee6272cc..d3f9e6f06bd 100644
--- a/htdocs/public/eventorganization/attendee_subscription.php
+++ b/htdocs/public/eventorganization/attendee_subscription.php
@@ -66,6 +66,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php';
require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php';
+require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
// Init vars
@@ -81,6 +82,19 @@ $email = GETPOST("email");
$encodedid = GETPOST('id');
$id = dol_decode($encodedid, $dolibarr_main_instance_unique_id);
+$conference = new ConferenceOrBooth($db);
+$resultconf = $conference->fetch($id);
+if ($resultconf < 0) {
+ setEventMessages(null, $object->errors, "errors");
+}
+
+$project = new Project($db);
+$resultproject = $project->fetch($conference->fk_project);
+if ($resultproject < 0) {
+ $error++;
+ $errmsg .= $project->error;
+}
+
// Getting 'securekey'.'id' from Post and decoding it
$encodedsecurekeyandid = GETPOST('securekey', 'alpha');
$securekeyandid = dol_decode($encodedsecurekeyandid, $dolibarr_main_instance_unique_id);
@@ -193,10 +207,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 +365,11 @@ print '
| '.$langs->trans("Email").' * | |
| '.$langs->trans("Company").' | |
| '.$langs->trans("Company"); +if (!empty(floatval($project->price_registration))) { + print '*'; +} +print ' | |
| '.$langs->trans("Address").' | '."\n"; print ' |