diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php
index b6a964d8617..c76d9a5c188 100644
--- a/htdocs/admin/eventorganization.php
+++ b/htdocs/admin/eventorganization.php
@@ -61,6 +61,8 @@ $arrayofparameters = array(
'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1),
'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1),
'EVENTORGANIZATION_SECUREKEY'=>array('type'=>'securekey', 'enabled'=>1),
+ 'SERVICE_BOOTH_LOCATION'=>array('type'=>'product', 'enabled'=>1),
+ 'SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION'=>array('type'=>'product', 'enabled'=>1),
);
$error = 0;
@@ -276,6 +278,23 @@ if ($action == 'edit') {
});';
print '';
}
+ } elseif ($var['type'] == 'product') {
+ if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
+ print '
| '.$langs->trans("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS").' | ';
+ print '';
+ $selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);
+ $form->select_produits($selected, $constname, '', 0);
+ print ' | ';
+ print "
\n";
+ }
+ if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
+ print '| '.$langs->trans("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS").' | ';
+ print '';
+ $selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);
+ $form->select_produits($selected, $constname, '', 0);
+ print ' | ';
+ }
+ print "
\n";
} else {
print '';
}
diff --git a/htdocs/eventorganization/class/conferenceorbooth.class.php b/htdocs/eventorganization/class/conferenceorbooth.class.php
index 41fe4ebd94d..b859c10a98d 100644
--- a/htdocs/eventorganization/class/conferenceorbooth.class.php
+++ b/htdocs/eventorganization/class/conferenceorbooth.class.php
@@ -237,7 +237,19 @@ class ConferenceOrBooth extends ActionComm
*/
public function fetch($id, $ref = null, $ref_ext = '', $email_msgid = '')
{
+ global $dolibarr_main_url_root, $dolibarr_main_instance_unique_id, $conf, $langs;
+
$result = parent::fetch($id, $ref, $ref_ext, $email_msgid);
+
+ $encodedid = dol_encode($id, $dolibarr_main_instance_unique_id);
+ $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_subscription.php?id='.$encodedid;
+
+ $encodedsecurekey = dol_encode($conf->global->EVENTORGANIZATION_SECUREKEY.$encodedid, $dolibarr_main_instance_unique_id);
+ $link_subscription .= '&securekey='.urlencode($encodedsecurekey);
+
+ $this->fields['pubregister'] = array('type'=>'url', 'label'=>$langs->trans("PublicAttendeeSubscriptionPage"), 'enabled'=>'1', 'position'=>72, 'notnull'=>0, 'visible'=>1);
+ $this->pubregister = $link_subscription;
+
$this->getActionCommFields();
return $result;
}
diff --git a/htdocs/eventorganization/conferenceorbooth_card.php b/htdocs/eventorganization/conferenceorbooth_card.php
index 15b52eda038..fc232406ce9 100644
--- a/htdocs/eventorganization/conferenceorbooth_card.php
+++ b/htdocs/eventorganization/conferenceorbooth_card.php
@@ -493,18 +493,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
//$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field
//unset($object->fields['fk_project']); // Hide field already shown in banner
//unset($object->fields['fk_soc']); // Hide field already shown in banner
- global $dolibarr_main_url_root;
-
- $encodedid = dol_encode($id, $dolibarr_main_instance_unique_id);
- $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_subscription.php?id='.$encodedid;
-
- $encodedsecurekey = dol_encode($conf->global->EVENTORGANIZATION_SECUREKEY.$encodedid, $dolibarr_main_instance_unique_id);
- $link_subscription .= '&securekey='.urlencode($encodedsecurekey);
-
- $object->fields['pubregister'] = array('type'=>'url', 'label'=>$langs->trans("PublicAttendeeSubscriptionPage"), 'enabled'=>'1', 'position'=>72, 'notnull'=>0, 'visible'=>1);
- $object->pubregister = $link_subscription;
$keyforbreak='pubregister';
-
+
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
//var_dump($object);
// Other attributes. Fields from hook formObjectOptions and Extrafields.
diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang
index fbee3de4e3d..3fc655b92e9 100644
--- a/htdocs/langs/en_US/eventorganization.lang
+++ b/htdocs/langs/en_US/eventorganization.lang
@@ -82,6 +82,8 @@ EventOrganizationICSLink=Link ICS for events
ConferenceOrBoothInformation=Conference Or Booth informations
Attendees = Attendees
EVENTORGANIZATION_SECUREKEY = Secure Key of the public registration link to a conference
+SERVICE_BOOTH_LOCATION = Service used for the invoice row about a booth location
+SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION = Service used for the invoice row about an attendee subscription to a conference
#
# Status
#
diff --git a/htdocs/public/eventorganization/attendee_subscription.php b/htdocs/public/eventorganization/attendee_subscription.php
index a47a93557d3..9aa1ca7d2e0 100644
--- a/htdocs/public/eventorganization/attendee_subscription.php
+++ b/htdocs/public/eventorganization/attendee_subscription.php
@@ -299,14 +299,14 @@ if (empty($reshook) && $action == 'add') {
$facture->paye = 0;
//@todo price and taxes to add
$tva = get_default_tva($mysoc, $thirdparty);
-
$facture->date = dol_now();
+
$resultfacture = $facture->create($user);
if ($resultfacture < 0){
$error++;
$errmsg .= $facture->error;
} else {
- $thirdparty->fetch('', '', '', '', '', '', '', '', '', '', $email);
+ // @todo corriger la réf qui est surement celle de la facture au lieu du client
$redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?amount='.$project->price_registration.'&source=conferenceattendeesubscription&ref='.$thirdparty->ref;
Header("Location: ".$redirection);
exit;