25require
'../main.inc.php';
30require_once DOL_DOCUMENT_ROOT.
"/core/lib/admin.lib.php";
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/eventorganization.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
35$langs->loadLangs(array(
"admin",
"eventorganization",
"categories"));
38$action =
GETPOST(
'action',
'aZ09');
39$cancel =
GETPOST(
'cancel',
'aZ09');
40$backtopage =
GETPOST(
'backtopage',
'alpha');
42$value =
GETPOST(
'value',
'alpha');
43$label =
GETPOST(
'label',
'alpha');
44$modulepart =
GETPOST(
'modulepart',
'aZ09');
46$scandir =
GETPOST(
'scan_dir',
'alpha');
49$arrayofparameters = array(
50 'EVENTORGANIZATION_TASK_LABEL'=>array(
'type'=>
'textarea',
'enabled'=>1),
51 'EVENTORGANIZATION_CATEG_THIRDPARTY_CONF'=>array(
'type'=>
'category:'.Categorie::TYPE_CUSTOMER,
'enabled'=>1),
52 'EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH'=>array(
'type'=>
'category:'.Categorie::TYPE_CUSTOMER,
'enabled'=>1),
53 'EVENTORGANIZATION_FILTERATTENDEES_CAT'=>array(
'type'=>
'category:'.Categorie::TYPE_CUSTOMER,
'enabled'=>1),
54 'EVENTORGANIZATION_FILTERATTENDEES_TYPE'=>array(
'type'=>
'thirdparty_type:',
'enabled'=>1),
55 'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF'=>array(
'type'=>
'emailtemplate:conferenceorbooth',
'enabled'=>1),
56 'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH'=>array(
'type'=>
'emailtemplate:conferenceorbooth',
'enabled'=>1),
57 'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH'=>array(
'type'=>
'emailtemplate:conferenceorbooth',
'enabled'=>1),
58 'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT'=>array(
'type'=>
'emailtemplate:conferenceorbooth',
'enabled'=>1),
61 'SERVICE_BOOTH_LOCATION'=>array(
'type'=>
'product',
'enabled'=>1),
62 'SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION'=>array(
'type'=>
'product',
'enabled'=>1),
63 'EVENTORGANIZATION_SECUREKEY'=>array(
'type'=>
'securekey',
'enabled'=>1),
69$dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
72if (empty($user->admin)) {
86include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
88if ($action ==
'updateMask') {
89 $maskconstorder =
GETPOST(
'maskconstorder',
'aZ09');
90 $maskorder =
GETPOST(
'maskorder',
'alpha');
92 if ($maskconstorder && preg_match(
'/_MASK$/', $maskconstorder)) {
93 $res =
dolibarr_set_const($db, $maskconstorder, $maskorder,
'chaine', 0,
'', $conf->entity);
104} elseif ($action ==
'specimen') {
105 $modele =
GETPOST(
'module',
'alpha');
106 $tmpobjectkey =
GETPOST(
'object');
108 $tmpobject =
new $tmpobjectkey($db);
109 $tmpobject->initAsSpecimen();
112 $file =
''; $classname =
''; $filefound = 0;
113 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
114 foreach ($dirmodels as $reldir) {
115 $file =
dol_buildpath($reldir.
"core/modules/eventorganization/doc/pdf_".$modele.
"_".strtolower($tmpobjectkey).
".modules.php", 0);
116 if (file_exists($file)) {
118 $classname =
"pdf_".$modele;
126 $module =
new $classname($db);
128 if ($module->write_file($tmpobject, $langs) > 0) {
129 header(
"Location: ".DOL_URL_ROOT.
"/document.php?modulepart=".strtolower($tmpobjectkey).
"&file=SPECIMEN.pdf");
137 dol_syslog($langs->trans(
"ErrorModuleNotFound"), LOG_ERR);
139} elseif ($action ==
'setmod') {
141 $tmpobjectkey =
GETPOST(
'object');
142 if (!empty($tmpobjectkey)) {
143 $constforval =
'EVENTORGANIZATION_'.strtoupper($tmpobjectkey).
"_ADDON";
146} elseif ($action ==
'set') {
149} elseif ($action ==
'del') {
152 $tmpobjectkey =
GETPOST(
'object');
153 if (!empty($tmpobjectkey)) {
154 $constforval =
'EVENTORGANIZATION_'.strtoupper($tmpobjectkey).
'_ADDON_PDF';
155 if ($conf->global->$constforval ==
"$value") {
191$form =
new Form($db);
193$page_name =
"EventOrganizationSetup";
198$linkback =
'<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1').
'">'.$langs->trans(
"BackToModuleList").
'</a>';
204print
dol_get_fiche_head($head,
'settings', $langs->trans($page_name), -1,
'eventorganization');
207echo
'<span class="opacitymedium">'.$langs->trans(
"EventOrganizationSetupPage").
'</span><br><br>';
210if ($action ==
'edit') {
211 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
212 print
'<input type="hidden" name="token" value="'.newToken().
'">';
213 print
'<input type="hidden" name="action" value="update">';
215 print
'<table class="noborder centpercent">';
216 print
'<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans(
"Parameter").
'</td><td>'.$langs->trans(
"Value").
'</td></tr>';
218 foreach ($arrayofparameters as $constname => $val) {
219 if ($val[
'enabled']==1) {
221 print
'<tr class="oddeven"><td><!-- '.$constname.
' -->';
222 $tooltiphelp = (($langs->trans($constname .
'Tooltip') != $constname .
'Tooltip') ? $langs->trans($constname .
'Tooltip') :
'');
223 $tooltiphelp .= (($langs->trans($constname .
'Tooltip2') && $langs->trans($constname .
'Tooltip2') != $constname .
'Tooltip2') ?
'<br><br>'.
"\n".$langs->trans($constname .
'Tooltip2') :
'');
224 print
'<span id="helplink'.$constname.
'" class="spanforparamtooltip">'.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1,
'info',
'', 0, 3,
'tootips'.$constname).
'</span>';
227 if ($val[
'type'] ==
'textarea') {
228 print
'<textarea class="flat" name="'.$constname.
'" id="'.$constname.
'" cols="50" rows="5" wrap="soft">' .
"\n";
230 print
"</textarea>\n";
231 } elseif ($val[
'type']==
'html') {
232 require_once DOL_DOCUMENT_ROOT .
'/core/class/doleditor.class.php';
233 $doleditor =
new DolEditor($constname,
getDolGlobalString($constname),
'', 160,
'dolibarr_notes',
'',
false,
false, isModEnabled(
'fckeditor'), ROWS_5,
'90%');
234 $doleditor->Create();
235 } elseif ($val[
'type'] ==
'yesno') {
237 } elseif (preg_match(
'/emailtemplate:/', $val[
'type'])) {
238 include_once DOL_DOCUMENT_ROOT .
'/core/class/html.formmail.class.php';
241 $tmp = explode(
':', $val[
'type']);
242 $nboftemplates = $formmail->fetchAllEMailTemplate($tmp[1], $user,
null, 1);
244 $arrayofmessagename = array();
245 if (is_array($formmail->lines_model)) {
246 foreach ($formmail->lines_model as $modelmail) {
249 if (!empty($arrayofmessagename[$modelmail->label])) {
250 $moreonlabel =
' <span class="opacitymedium">(' . $langs->trans(
"SeveralLangugeVariatFound") .
')</span>';
253 $arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace(
'/\(|\)/',
'', $modelmail->label)) . $moreonlabel;
256 print $form->selectarray($constname, $arrayofmessagename,
getDolGlobalString($constname),
'None', 0, 0,
'', 0, 0, 0,
'',
'', 1);
257 } elseif (preg_match(
'/category:/', $val[
'type'])) {
258 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
259 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
262 $tmp = explode(
':', $val[
'type']);
263 print
img_picto(
'',
'category',
'class="pictofixedwidth"');
264 print $formother->select_categories($tmp[1],
getDolGlobalString($constname), $constname, 0, $langs->trans(
'CustomersProspectsCategoriesShort'));
265 } elseif (preg_match(
'/thirdparty_type/', $val[
'type'])) {
266 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
268 print $formcompany->selectProspectCustomerType(
getDolGlobalString($constname), $constname,
'customerorprospect',
'form',
'', 1);
269 } elseif ($val[
'type'] ==
'securekey') {
270 print
'<input type="text" class="flat" id="'.$constname.
'" name="'.$constname.
'" value="'.(
GETPOST($constname,
'alpha') ?
GETPOST($constname,
'alpha') :
getDolGlobalString($constname)).
'" size="40">';
271 if (!empty($conf->use_javascript_ajax)) {
272 print
' '.img_picto($langs->trans(
'Generate'),
'refresh',
'id="generate_token'.$constname.
'" class="linkobject"');
276 include_once DOL_DOCUMENT_ROOT.
'/core/lib/security2.lib.php';
278 } elseif ($val[
'type'] ==
'product') {
279 if (isModEnabled(
"product") || isModEnabled(
"service")) {
280 $selected = (empty($conf->global->$constname) ?
'' : $conf->global->$constname);
281 $form->select_produits($selected, $constname,
'', 0);
284 print
'<input name="' . $constname .
'" class="flat ' . (empty($val[
'css']) ?
'minwidth200' : $val[
'css']) .
'" value="' .
getDolGlobalString($constname) .
'">';
291 print $form->buttonsSaveCancel();
296 if (!empty($arrayofparameters)) {
297 print
'<table class="noborder centpercent">';
298 print
'<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans(
"Parameter").
'</td><td>'.$langs->trans(
"Value").
'</td></tr>';
300 foreach ($arrayofparameters as $constname => $val) {
301 if ($val[
'enabled']==1) {
303 print
'<tr class="oddeven">';
304 print
'<td><!-- '.$constname.
' -->';
305 $tooltiphelp = (($langs->trans($constname .
'Tooltip') != $constname .
'Tooltip') ? $langs->trans($constname .
'Tooltip') :
'');
306 $tooltiphelp .= (($langs->trans($constname .
'Tooltip2') && $langs->trans($constname .
'Tooltip2') != $constname .
'Tooltip2') ?
'<br><br>'.
"\n".$langs->trans($constname .
'Tooltip2') :
'');
307 print $form->textwithpicto($langs->trans($constname), $tooltiphelp);
310 if ($val[
'type'] ==
'textarea') {
312 } elseif ($val[
'type']==
'html') {
314 } elseif ($val[
'type'] ==
'yesno') {
315 print ajax_constantonoff($constname);
316 } elseif (preg_match(
'/emailtemplate:/', $val[
'type'])) {
318 include_once DOL_DOCUMENT_ROOT .
'/core/class/html.formmail.class.php';
321 $tmp = explode(
':', $val[
'type']);
323 if ($labelemailtemplate && $labelemailtemplate !=
'-1') {
324 $template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs,
getDolGlobalString($constname));
325 if (is_numeric($template) && $template < 0) {
328 if ($template->label !=
'default') {
329 print $langs->trans($template->label);
334 } elseif (preg_match(
'/category:/', $val[
'type'])) {
341 $ways = $c->print_all_ways(
' >> ',
'none', 0, 1);
343 foreach ($ways as $way) {
344 $toprint[] =
'<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ?
' style="background: #' . $c->color .
';"' :
' style="background: #bbb"') .
'>' . $way .
'</li>';
346 print
'<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(
' ', $toprint) .
'</ul></div>';
348 } elseif (preg_match(
'/thirdparty_type/', $val[
'type'])) {
350 print $langs->trans(
"Prospect");
352 print $langs->trans(
"ProspectCustomer");
354 print $langs->trans(
"Customer");
356 print $langs->trans(
"NorProspectNorCustomer");
358 } elseif ($val[
'type'] ==
'product') {
361 if ($idproduct > 0) {
362 $resprod = $product->fetch($idproduct);
364 print $product->getNomUrl(1);
365 } elseif ($resprod < 0) {
380 print
'<div class="tabsAction">';
381 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&token='.newToken().
'">'.$langs->trans(
"Modify").
'</a>';
384 print
'<br>'.$langs->trans(
"NothingToSetup");
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
delDocumentModel($name, $type)
Delete document model used by doc generator.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage categories.
Class to manage a WYSIWYG editor.
Class to manage products or services.
eventorganizationAdminPrepareHead()
Prepare admin pages header.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_nl2br($stringtoencode, $nl2brmode=0, $forxml=false)
Replace CRLF in string with a HTML BR tag.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dolJSToSetRandomPassword($htmlname, $htmlnameofbutton='generate_token', $generic=1)
Ouput javacript to autoset a generated password using default module into a HTML element.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.