diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php
index d01aece1ca0..439a3d9cafa 100644
--- a/htdocs/admin/eventorganization.php
+++ b/htdocs/admin/eventorganization.php
@@ -48,8 +48,8 @@ $arrayofparameters = array(
'EVENTORGANIZATION_TASK_LABEL'=>array('type'=>'textarea','enabled'=>1),
'EVENTORGANIZATION_CATEG_THIRDPARTY_CONF'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
'EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
- //'EVENTORGANIZATION_FILTERATTENDEES_CAT'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
- //'EVENTORGANIZATION_FILTERATTENDEES_TYPE'=>array('type'=>'thirdparty_type:', 'enabled'=>1),
+ 'EVENTORGANIZATION_FILTERATTENDEES_CAT'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
+ 'EVENTORGANIZATION_FILTERATTENDEES_TYPE'=>array('type'=>'thirdparty_type:', 'enabled'=>1),
'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php
index 985c61376b6..61d8e7c32b2 100644
--- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php
+++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php
@@ -747,6 +747,10 @@ class ConferenceOrBoothAttendee extends CommonObject
$url .= '&conforboothid='.$this->fk_actioncomm;
}
+ if ($option == 'projectid') {
+ $url .= '&fk_project='.$this->fk_project.'&withproject=1';
+ }
+
if ($option == 'conforboothidproject') {
$url .= '&conforboothid='.$this->fk_actioncomm.'&withproject=1' ;
}
diff --git a/htdocs/eventorganization/conferenceorboothattendee_card.php b/htdocs/eventorganization/conferenceorboothattendee_card.php
index 80b4b00dc9f..ff46f7b4a7b 100644
--- a/htdocs/eventorganization/conferenceorboothattendee_card.php
+++ b/htdocs/eventorganization/conferenceorboothattendee_card.php
@@ -47,6 +47,7 @@ $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
//$lineid = GETPOST('lineid', 'int');
$conf_or_booth_id = GETPOST('conforboothid', 'int');
+$fk_project = GETPOST('fk_project', 'int');
$withproject = GETPOST('withproject', 'int');
// Initialize technical objects
@@ -174,7 +175,7 @@ $title = $langs->trans("ConferenceOrBoothAttendee");
$help_url = '';
llxHeader('', $title, $help_url);
-$result = $projectstatic->fetch($confOrBooth->fk_project);
+$result = $projectstatic->fetch(empty($confOrBooth->fk_project)?$fk_project:$confOrBooth->fk_project);
if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) {
$projectstatic->fetchComments();
}
@@ -343,10 +344,44 @@ if (!empty($withproject)) {
// Show message
$message = 'entity : "");
$message .= '&exportkey='.($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY ?urlencode($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) : '...');
- $message .= "&project=".$projectstatic->id.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').'';
+ $message .= "&project=".$projectstatic->id.'&module='.urlencode('@eventorganization').'&status='.ConferenceOrBooth::STATUS_CONFIRMED.'">'.$langs->trans('DownloadICSLink').img_picto('', 'download', 'class="paddingleft"').'';
print $message;
print "";
+ // Link to the submit vote/register page
+ print '
| ';
+ //print '';
+ print $form->textwithpicto($langs->trans("SuggestOrVoteForConfOrBooth"), $langs->trans("EvntOrgRegistrationHelpMessage"));
+ //print '';
+ print ' | ';
+ $linksuggest = $dolibarr_main_url_root.'/public/project/index.php?id='.$projectstatic->id;
+ $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 2);
+ $linksuggest .= '&securekey='.urlencode($encodedsecurekey);
+ //print '';
+ //print ajax_autoselect("linkregister");
+ print ' |
';
+
+ // Link to the subscribe
+ print '| ';
+ //print '';
+ print $langs->trans("PublicAttendeeSubscriptionGlobalPage");
+ //print '';
+ print ' | ';
+ $link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_subscription.php?id='.$projectstatic->id.'&type=global';
+ $encodedsecurekey = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$projectstatic->id, 2);
+ $link_subscription .= '&securekey='.urlencode($encodedsecurekey);
+ //print '';
+ //print ajax_autoselect("linkregister");
+ print ' |
';
+
print '';
print '';
@@ -370,7 +405,10 @@ if ($action == 'create') {
if ($confOrBooth->id > 0) {
print '';
}
- print '';
+ if ($projectstatic->id > 0) {
+ print '';
+ }
+
print '';
if ($backtopage) {
@@ -382,9 +420,6 @@ if ($action == 'create') {
print dol_get_fiche_head(array(), '');
- // Set some default values
- //if (! GETPOSTISSET('fieldname')) $_POST['fieldname'] = 'myvalue';
-
print ''."\n";
// Common attributes
@@ -428,6 +463,9 @@ if (($id || $ref) && $action == 'edit') {
if ($backtopageforcancel) {
print '';
}
+ if ($projectstatic->id > 0) {
+ print '';
+ }
print dol_get_fiche_head();
@@ -477,16 +515,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Confirmation of action xxxx
if ($action == 'xxx') {
$formquestion = array();
- /*
- $forcecombo=0;
- if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy
- $formquestion = array(
- // 'text' => $langs->trans("ConfirmClone"),
- // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
- // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
- // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo))
- );
- */
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220);
}
@@ -502,61 +530,22 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Print form confirm
print $formconfirm;
-
// Object card
// ------------------------------------------------------------
$linkback = ''.$langs->trans("BackToList").'';
$morehtmlref = '';
- /*
- // Ref customer
- $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
- $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
- // Thirdparty
- $morehtmlref.='
'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
- // Project
- if (! empty($conf->projet->enabled)) {
- $langs->load("projects");
- $morehtmlref .= '
'.$langs->trans('Project') . ' ';
- if ($permissiontoadd) {
- //if ($action != 'classify') $morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
- $morehtmlref .= ' : ';
- if ($action == 'classify') {
- //$morehtmlref .= $form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
- $morehtmlref .= '
';
- } else {
- $morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1);
- }
- } else {
- if (! empty($object->fk_project)) {
- $proj = new Project($db);
- $proj->fetch($object->fk_project);
- $morehtmlref .= ': '.$proj->getNomUrl();
- } else {
- $morehtmlref .= '';
- }
- }
- }*/
+
$morehtmlref .= '
';
-
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
-
print '';
print '
';
print '
';
print '
'."\n";
// Common attributes
- //$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
include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
// Other attributes. Fields from hook formObjectOptions and Extrafields.
@@ -635,29 +624,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if (empty($reshook)) {
// Send
if (empty($user->socid)) {
- print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle');
+ print dolGetButtonAction($langs->trans('SendMail'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').'&action=presend&mode=init#formmailbeforetitle');
}
- print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.'&conforboothid='.$confOrBooth->id.'&action=edit', '', $permissiontoadd);
+ print dolGetButtonAction($langs->trans('Modify'), '', 'default', $_SERVER["PHP_SELF"].'?id='.$object->id.(!empty($confOrBooth->id)?'&conforboothid='.$confOrBooth->id:'').(!empty($projectstatic->id)?'&fk_project='.$projectstatic->id:'').'&action=edit', '', $permissiontoadd);
// Clone
print dolGetButtonAction($langs->trans('ToClone'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&socid='.$object->socid.'&action=clone&object=scrumsprint', '', $permissiontoadd);
- /*
- if ($permissiontoadd) {
- if ($object->status == $object::STATUS_ENABLED) {
- print 'id.'&action=disable&token='.newToken().'">'.$langs->trans("Disable").''."\n";
- } else {
- print 'id.'&action=enable&token='.newToken().'">'.$langs->trans("Enable").''."\n";
- }
- }
- if ($permissiontoadd) {
- if ($object->status == $object::STATUS_VALIDATED) {
- print 'id.'&action=close&token='.newToken().'">'.$langs->trans("Cancel").''."\n";
- } else {
- print 'id.'&action=reopen&token='.newToken().'">'.$langs->trans("Re-Open").''."\n";
- }
- }
- */
// Delete (need delete permission, or if draft, just need create/modify permission)
print dolGetButtonAction($langs->trans('Delete'), '', 'delete', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=delete', '', $permissiontodelete || ($object->status == $object::STATUS_DRAFT && $permissiontoadd));
diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php
index d1dfccf2652..401f3367044 100644
--- a/htdocs/eventorganization/conferenceorboothattendee_list.php
+++ b/htdocs/eventorganization/conferenceorboothattendee_list.php
@@ -571,7 +571,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) {
print dol_get_fiche_end();
- if (!empty($fk_project)) {
+ if (empty($confOrBooth->id)) {
$head = conferenceorboothProjectPrepareHead($projectstatic);
$tab = 'attendees';
print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($project->public ? 'projectpub' : 'project'), 0, '', '');
@@ -632,6 +632,9 @@ foreach ($search as $key => $val) {
if ($confOrBooth->id > 0) {
$param .= '&conforboothid='.urlencode($confOrBooth->id).$withProjectUrl;
}
+if ($projectstatic->id > 0) {
+ $param .= '&fk_project='.urlencode($projectstatic->id).$withProjectUrl;
+}
if ($optioncss != '') {
$param .= '&optioncss='.urlencode($optioncss);
@@ -841,7 +844,11 @@ while ($i < ($limit ? min($num, $limit) : $num)) {
if ($key == 'status') {
print $object->getLibStatut(5);
} elseif ($key == 'ref') {
- print $object->getNomUrl(1, (!empty($withproject)?'conforboothidproject':'conforboothid'));
+ $optionLink = (!empty($withproject)?'conforboothidproject':'conforboothid');
+ if (empty($confOrBooth->id)) {
+ $optionLink='projectid';
+ }
+ print $object->getNomUrl(1, $optionLink);
} else {
print $object->showOutputField($val, $key, $object->$key, '');
}
diff --git a/htdocs/public/eventorganization/attendee_subscription.php b/htdocs/public/eventorganization/attendee_subscription.php
index 506b7215211..79688bffcf6 100644
--- a/htdocs/public/eventorganization/attendee_subscription.php
+++ b/htdocs/public/eventorganization/attendee_subscription.php
@@ -508,9 +508,7 @@ print '
';
dol_htmloutput_errors($errmsg);
-if (!empty($conference->id) && $conference->status!=2 || !empty($project->id) && $project->status==Project::STATUS_VALIDATED) {
- print $langs->trans("ConferenceIsNotConfirmed");
-} else {
+if (!empty($conference->id) && $conference->status==ConferenceOrBooth::STATUS_CONFIRMED || (!empty($project->id) && $project->status==Project::STATUS_VALIDATED)) {
// Print form
print '