diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php
index 23fc463f3b5..743da034060 100644
--- a/htdocs/admin/eventorganization.php
+++ b/htdocs/admin/eventorganization.php
@@ -52,6 +52,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_TEMPLATE_EMAIL_ASK_CONF'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1),
'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1),
'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH'=>array('type'=>'emailtemplate:eventorganization_send', 'enabled'=>1),
@@ -144,7 +146,7 @@ if ($action == 'updateMask') {
}
}
}
-} elseif ($action == 'setdoc') {
+}/* elseif ($action == 'setdoc') {
// Set or unset default model
$tmpobjectkey = GETPOST('object');
if (!empty($tmpobjectkey)) {
@@ -167,7 +169,7 @@ if ($action == 'updateMask') {
$constforval = 'EVENTORGANIZATION_'.strtoupper($tmpobjectkey).'_ADDON_PDF';
dolibarr_del_const($db, $constforval, $conf->entity);
}
-}
+}*/
@@ -177,7 +179,7 @@ if ($action == 'updateMask') {
$form = new Form($db);
-$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
+//$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
$page_name = "EventOrganizationSetup";
llxHeader('', $langs->trans($page_name));
@@ -249,6 +251,10 @@ if ($action == 'edit') {
$tmp = explode(':', $val['type']);
print img_picto('', 'category', 'class="pictofixedwidth"');
print $formother->select_categories($tmp[1], $conf->global->{$constname}, $constname, 0, $langs->trans('CustomersProspectsCategoriesShort'));
+ } elseif (preg_match('/thirdparty_type/', $val['type'])) {
+ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
+ $formcompany = new FormCompany($db);
+ print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname);
} else {
print '';
}
@@ -309,6 +315,16 @@ if ($action == 'edit') {
}
print '
' . implode(' ', $toprint) . '
';
}
+ } elseif (preg_match('/thirdparty_type/', $val['type'])) {
+ if ($conf->global->{$constname}==2) {
+ print $langs->trans("Prospect");
+ } elseif ($conf->global->{$constname}==3) {
+ print $langs->trans("ProspectCustomer");
+ } elseif ($conf->global->{$constname}==1) {
+ print $langs->trans("Customer");
+ } elseif ($conf->global->{$constname}==0) {
+ print $langs->trans("NorProspectNorCustomer");
+ }
} else {
print $conf->global->{$constname};
}
@@ -327,7 +343,7 @@ if ($action == 'edit') {
}
-$moduledir = 'eventorganization';
+/*$moduledir = 'eventorganization';
$myTmpObjects = array();
$myTmpObjects['MyObject'] = array('includerefgeneration'=>0, 'includedocgeneration'=>0);
@@ -337,9 +353,6 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
continue;
}
if ($myTmpObjectArray['includerefgeneration']) {
- /*
- * Orders Numbering model
- */
$setupnotempty++;
print load_fiche_titre($langs->trans("NumberingModules", $myTmpObjectKey), '', '');
@@ -444,9 +457,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
}
if ($myTmpObjectArray['includedocgeneration']) {
- /*
- * Document templates generators
- */
+
$setupnotempty++;
$type = strtolower($myTmpObjectKey);
@@ -588,10 +599,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
print '';
}
}
-
-if (empty($setupnotempty)) {
- print '
'.$langs->trans("NothingToSetup");
-}
+*/
// Page end
print dol_get_fiche_end();
diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php
index 4def01d2c7f..c8cec4172c7 100644
--- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php
+++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php
@@ -194,6 +194,13 @@ class ConferenceOrBoothAttendee extends CommonObject
$this->fields['entity']['enabled'] = 0;
}
+ if (!empty($conf->global->EVENTORGANIZATION_FILTERATTENDEES_CAT)) {
+ $this->fields['fk_soc']['type'] .= ' AND rowid IN (SELECT DISTINCT c.fk_soc FROM '.MAIN_DB_PREFIX.'categorie_societe as c WHERE c.fk_categorie='.(int) $conf->global->EVENTORGANIZATION_FILTERATTENDEES_CAT.')';
+ }
+ if ($conf->global->EVENTORGANIZATION_FILTERATTENDEES_TYPE!=='') {
+ $this->fields['fk_soc']['type'] .= ' AND client='.(int) $conf->global->EVENTORGANIZATION_FILTERATTENDEES_TYPE;
+ }
+
// Example to show how to set values of fields definition dynamically
/*if ($user->rights->eventorganization->conferenceorboothattendee->read) {
$this->fields['myfield']['visible'] = 1;
diff --git a/htdocs/langs/en_US/eventorganization.lang b/htdocs/langs/en_US/eventorganization.lang
index 33d74affd3e..8dadf5fdb97 100644
--- a/htdocs/langs/en_US/eventorganization.lang
+++ b/htdocs/langs/en_US/eventorganization.lang
@@ -42,6 +42,8 @@ EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH = Template of email to send aft
EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT = Template of email to send after a subscription to an event has been paid.
EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_SPEAKER = Template of email of massaction to attendes
EVENTORGANIZATION_TEMPLATE_EMAIL_BULK_ATTENDES = Template of email of massaction to speakers
+EVENTORGANIZATION_FILTERATTENDEES_CAT = Filter thirdpartie's select list in attendees creation card/form with category
+EVENTORGANIZATION_FILTERATTENDEES_TYPE = Filter thirdpartie's select list in attendees creation card/form with customer type
#
# Object
@@ -52,6 +54,7 @@ ConferenceOrBooth = Conference Or Booth
ConferenceOrBoothTab = Conference Or Booth
AmountOfSubscriptionPaid = Amount of subscription paid
DateSubscription = Date of subscription
+ConferenceOrBoothAttendee = Conference Or Booth Attendee
#
# Template Mail
diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php
index 06b169863f5..2e00c5c7cf9 100644
--- a/htdocs/modulebuilder/template/admin/setup.php
+++ b/htdocs/modulebuilder/template/admin/setup.php
@@ -80,6 +80,7 @@ $arrayofparameters = array(
//'MYMODULE_MYPARAM3'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
//'MYMODULE_MYPARAM4'=>array('type'=>'emailtemplate:thirdparty', 'enabled'=>1),
//'MYMODULE_MYPARAM5'=>array('type'=>'yesno', 'enabled'=>1),
+ //'MYMODULE_MYPARAM5'=>array('type'=>'thirdparty_type', 'enabled'=>1),
);
$error = 0;
@@ -271,6 +272,10 @@ if ($action == 'edit') {
$tmp = explode(':', $val['type']);
print img_picto('', 'category', 'class="pictofixedwidth"');
print $formother->select_categories($tmp[1], $conf->global->{$constname}, $constname, 0, $langs->trans('CustomersProspectsCategoriesShort'));
+ } elseif (preg_match('/thirdparty_type/', $val['type'])) {
+ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
+ $formcompany = new FormCompany($db);
+ print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname);
} else {
print '';
}
@@ -327,6 +332,16 @@ if ($action == 'edit') {
$toprint[] = 'color ? ' style="background: #' . $c->color . ';"' : ' style="background: #bbb"') . '>' . $way . '';
}
print '' . implode(' ', $toprint) . '
';
+ } elseif (preg_match('/thirdparty_type/', $val['type'])) {
+ if ($conf->global->{$constname}==2) {
+ print $langs->trans("Prospect");
+ } elseif ($conf->global->{$constname}==3) {
+ print $langs->trans("ProspectCustomer");
+ } elseif ($conf->global->{$constname}==1) {
+ print $langs->trans("Customer");
+ } elseif ($conf->global->{$constname}==0) {
+ print $langs->trans("NorProspectNorCustomer");
+ }
} else {
print $conf->global->{$constname};
}