removed useless fetch, moved link to the fetch method of the conferenceorbooth class, wip on service to use on the invoice
This commit is contained in:
parent
339596f134
commit
55afc59db2
@ -61,6 +61,8 @@ $arrayofparameters = array(
|
|||||||
'EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1),
|
'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_TEMPLATE_EMAIL_BULK_ATTENDES'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1),
|
||||||
'EVENTORGANIZATION_SECUREKEY'=>array('type'=>'securekey', '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;
|
$error = 0;
|
||||||
@ -276,6 +278,23 @@ if ($action == 'edit') {
|
|||||||
});';
|
});';
|
||||||
print '</script>';
|
print '</script>';
|
||||||
}
|
}
|
||||||
|
} elseif ($var['type'] == 'product') {
|
||||||
|
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
|
||||||
|
print '<tr class="oddeven"><td>'.$langs->trans("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS").'</td>';
|
||||||
|
print '<td>';
|
||||||
|
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);
|
||||||
|
$form->select_produits($selected, $constname, '', 0);
|
||||||
|
print '</td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
}
|
||||||
|
if (!empty($conf->product->enabled) || !empty($conf->service->enabled)) {
|
||||||
|
print '<tr class="oddeven"><td>'.$langs->trans("ADHERENT_PRODUCT_ID_FOR_SUBSCRIPTIONS").'</td>';
|
||||||
|
print '<td>';
|
||||||
|
$selected = (empty($conf->global->$constname) ? '' : $conf->global->$constname);
|
||||||
|
$form->select_produits($selected, $constname, '', 0);
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
print "</tr>\n";
|
||||||
} else {
|
} else {
|
||||||
print '<input name="'.$constname.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.$conf->global->{$constname}.'">';
|
print '<input name="'.$constname.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.$conf->global->{$constname}.'">';
|
||||||
}
|
}
|
||||||
|
|||||||
@ -237,7 +237,19 @@ class ConferenceOrBooth extends ActionComm
|
|||||||
*/
|
*/
|
||||||
public function fetch($id, $ref = null, $ref_ext = '', $email_msgid = '')
|
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);
|
$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();
|
$this->getActionCommFields();
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -493,18 +493,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||||||
//$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field
|
//$keyforbreak='fieldkeytoswitchonsecondcolumn'; // We change column just before this field
|
||||||
//unset($object->fields['fk_project']); // Hide field already shown in banner
|
//unset($object->fields['fk_project']); // Hide field already shown in banner
|
||||||
//unset($object->fields['fk_soc']); // 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';
|
$keyforbreak='pubregister';
|
||||||
|
|
||||||
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
|
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
|
||||||
//var_dump($object);
|
//var_dump($object);
|
||||||
// Other attributes. Fields from hook formObjectOptions and Extrafields.
|
// Other attributes. Fields from hook formObjectOptions and Extrafields.
|
||||||
|
|||||||
@ -82,6 +82,8 @@ EventOrganizationICSLink=Link ICS for events
|
|||||||
ConferenceOrBoothInformation=Conference Or Booth informations
|
ConferenceOrBoothInformation=Conference Or Booth informations
|
||||||
Attendees = Attendees
|
Attendees = Attendees
|
||||||
EVENTORGANIZATION_SECUREKEY = Secure Key of the public registration link to a conference
|
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
|
# Status
|
||||||
#
|
#
|
||||||
|
|||||||
@ -299,14 +299,14 @@ if (empty($reshook) && $action == 'add') {
|
|||||||
$facture->paye = 0;
|
$facture->paye = 0;
|
||||||
//@todo price and taxes to add
|
//@todo price and taxes to add
|
||||||
$tva = get_default_tva($mysoc, $thirdparty);
|
$tva = get_default_tva($mysoc, $thirdparty);
|
||||||
|
|
||||||
$facture->date = dol_now();
|
$facture->date = dol_now();
|
||||||
|
|
||||||
$resultfacture = $facture->create($user);
|
$resultfacture = $facture->create($user);
|
||||||
if ($resultfacture < 0){
|
if ($resultfacture < 0){
|
||||||
$error++;
|
$error++;
|
||||||
$errmsg .= $facture->error;
|
$errmsg .= $facture->error;
|
||||||
} else {
|
} 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;
|
$redirection = $dolibarr_main_url_root.'/public/payment/newpayment.php?amount='.$project->price_registration.'&source=conferenceattendeesubscription&ref='.$thirdparty->ref;
|
||||||
Header("Location: ".$redirection);
|
Header("Location: ".$redirection);
|
||||||
exit;
|
exit;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user