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();
115 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
116 foreach ($dirmodels as $reldir) {
117 $file =
dol_buildpath($reldir.
"core/modules/eventorganization/doc/pdf_".$modele.
"_".strtolower($tmpobjectkey).
".modules.php", 0);
118 if (file_exists($file)) {
120 $classname =
"pdf_".$modele;
128 $module =
new $classname($db);
130 if ($module->write_file($tmpobject, $langs) > 0) {
131 header(
"Location: ".DOL_URL_ROOT.
"/document.php?modulepart=".strtolower($tmpobjectkey).
"&file=SPECIMEN.pdf");
139 dol_syslog($langs->trans(
"ErrorModuleNotFound"), LOG_ERR);
141} elseif ($action ==
'setmod') {
143 $tmpobjectkey =
GETPOST(
'object');
144 if (!empty($tmpobjectkey)) {
145 $constforval =
'EVENTORGANIZATION_'.strtoupper($tmpobjectkey).
"_ADDON";
148} elseif ($action ==
'set') {
151} elseif ($action ==
'del') {
154 $tmpobjectkey =
GETPOST(
'object');
155 if (!empty($tmpobjectkey)) {
156 $constforval =
'EVENTORGANIZATION_'.strtoupper($tmpobjectkey).
'_ADDON_PDF';
193$form =
new Form($db);
195$page_name =
"EventOrganizationSetup";
200$linkback =
'<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1').
'">'.$langs->trans(
"BackToModuleList").
'</a>';
206print
dol_get_fiche_head($head,
'settings', $langs->trans($page_name), -1,
'eventorganization');
209echo
'<span class="opacitymedium">'.$langs->trans(
"EventOrganizationSetupPage").
'</span><br><br>';
212if ($action ==
'edit') {
213 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
214 print
'<input type="hidden" name="token" value="'.newToken().
'">';
215 print
'<input type="hidden" name="action" value="update">';
217 print
'<table class="noborder centpercent">';
218 print
'<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans(
"Parameter").
'</td><td>'.$langs->trans(
"Value").
'</td></tr>';
220 foreach ($arrayofparameters as $constname => $val) {
221 if ($val[
'enabled']==1) {
223 print
'<tr class="oddeven"><td><!-- '.$constname.
' -->';
224 $tooltiphelp = (($langs->trans($constname .
'Tooltip') != $constname .
'Tooltip') ? $langs->trans($constname .
'Tooltip') :
'');
225 $tooltiphelp .= (($langs->trans($constname .
'Tooltip2') && $langs->trans($constname .
'Tooltip2') != $constname .
'Tooltip2') ?
'<br><br>'.
"\n".$langs->trans($constname .
'Tooltip2') :
'');
226 print
'<span id="helplink'.$constname.
'" class="spanforparamtooltip">'.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1,
'info',
'', 0, 3,
'tootips'.$constname).
'</span>';
229 if ($val[
'type'] ==
'textarea') {
230 print
'<textarea class="flat" name="'.$constname.
'" id="'.$constname.
'" cols="50" rows="5" wrap="soft">' .
"\n";
232 print
"</textarea>\n";
233 } elseif ($val[
'type']==
'html') {
234 require_once DOL_DOCUMENT_ROOT .
'/core/class/doleditor.class.php';
235 $doleditor =
new DolEditor($constname,
getDolGlobalString($constname),
'', 160,
'dolibarr_notes',
'',
false,
false, isModEnabled(
'fckeditor'), ROWS_5,
'90%');
236 $doleditor->Create();
237 } elseif ($val[
'type'] ==
'yesno') {
239 } elseif (preg_match(
'/emailtemplate:/', $val[
'type'])) {
240 include_once DOL_DOCUMENT_ROOT .
'/core/class/html.formmail.class.php';
243 $tmp = explode(
':', $val[
'type']);
244 $nboftemplates = $formmail->fetchAllEMailTemplate($tmp[1], $user,
null, 1);
246 $arrayofmessagename = array();
247 if (is_array($formmail->lines_model)) {
248 foreach ($formmail->lines_model as $modelmail) {
251 if (!empty($arrayofmessagename[$modelmail->label])) {
252 $moreonlabel =
' <span class="opacitymedium">(' . $langs->trans(
"SeveralLangugeVariatFound") .
')</span>';
255 $arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace(
'/\(|\)/',
'', $modelmail->label)) . $moreonlabel;
258 print $form->selectarray($constname, $arrayofmessagename,
getDolGlobalString($constname),
'None', 0, 0,
'', 0, 0, 0,
'',
'', 1);
259 } elseif (preg_match(
'/category:/', $val[
'type'])) {
260 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
261 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
264 $tmp = explode(
':', $val[
'type']);
265 print
img_picto(
'',
'category',
'class="pictofixedwidth"');
266 print $formother->select_categories($tmp[1],
getDolGlobalString($constname), $constname, 0, $langs->trans(
'CustomersProspectsCategoriesShort'));
267 } elseif (preg_match(
'/thirdparty_type/', $val[
'type'])) {
268 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
270 print $formcompany->selectProspectCustomerType(
getDolGlobalString($constname), $constname,
'customerorprospect',
'form',
'', 1);
271 } elseif ($val[
'type'] ==
'securekey') {
272 print
'<input type="text" class="flat" id="'.$constname.
'" name="'.$constname.
'" value="'.(
GETPOST($constname,
'alpha') ?
GETPOST($constname,
'alpha') :
getDolGlobalString($constname)).
'" size="40">';
273 if (!empty($conf->use_javascript_ajax)) {
274 print
' '.img_picto($langs->trans(
'Generate'),
'refresh',
'id="generate_token'.$constname.
'" class="linkobject"');
278 include_once DOL_DOCUMENT_ROOT.
'/core/lib/security2.lib.php';
280 } elseif ($val[
'type'] ==
'product') {
281 if (isModEnabled(
"product") || isModEnabled(
"service")) {
283 $form->select_produits($selected, $constname,
'', 0);
286 print
'<input name="' . $constname .
'" class="flat ' . (empty($val[
'css']) ?
'minwidth200' : $val[
'css']) .
'" value="' .
getDolGlobalString($constname) .
'">';
293 print $form->buttonsSaveCancel();
298 if (!empty($arrayofparameters)) {
299 print
'<table class="noborder centpercent">';
300 print
'<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans(
"Parameter").
'</td><td>'.$langs->trans(
"Value").
'</td></tr>';
302 foreach ($arrayofparameters as $constname => $val) {
303 if ($val[
'enabled']==1) {
305 print
'<tr class="oddeven">';
306 print
'<td><!-- '.$constname.
' -->';
307 $tooltiphelp = (($langs->trans($constname .
'Tooltip') != $constname .
'Tooltip') ? $langs->trans($constname .
'Tooltip') :
'');
308 $tooltiphelp .= (($langs->trans($constname .
'Tooltip2') && $langs->trans($constname .
'Tooltip2') != $constname .
'Tooltip2') ?
'<br><br>'.
"\n".$langs->trans($constname .
'Tooltip2') :
'');
309 print $form->textwithpicto($langs->trans($constname), $tooltiphelp);
312 if ($val[
'type'] ==
'textarea') {
314 } elseif ($val[
'type']==
'html') {
316 } elseif ($val[
'type'] ==
'yesno') {
317 print ajax_constantonoff($constname);
318 } elseif (preg_match(
'/emailtemplate:/', $val[
'type'])) {
320 include_once DOL_DOCUMENT_ROOT .
'/core/class/html.formmail.class.php';
323 $tmp = explode(
':', $val[
'type']);
325 if ($labelemailtemplate && $labelemailtemplate !=
'-1') {
326 $template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs,
getDolGlobalString($constname));
327 if (is_numeric($template) && $template < 0) {
330 if ($template->label !=
'default') {
331 print $langs->trans($template->label);
336 } elseif (preg_match(
'/category:/', $val[
'type'])) {
343 $ways = $c->print_all_ways(
' >> ',
'none', 0, 1);
345 foreach ($ways as $way) {
346 $toprint[] =
'<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ?
' style="background: #' . $c->color .
';"' :
' style="background: #bbb"') .
'>' . $way .
'</li>';
348 print
'<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(
' ', $toprint) .
'</ul></div>';
350 } elseif (preg_match(
'/thirdparty_type/', $val[
'type'])) {
352 print $langs->trans(
"Prospect");
354 print $langs->trans(
"ProspectCustomer");
356 print $langs->trans(
"Customer");
358 print $langs->trans(
"NorProspectNorCustomer");
360 } elseif ($val[
'type'] ==
'product') {
363 if ($idproduct > 0) {
364 $resprod = $product->fetch($idproduct);
366 print $product->getNomUrl(1);
367 } elseif ($resprod < 0) {
382 print
'<div class="tabsAction">';
383 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&token='.newToken().
'">'.$langs->trans(
"Modify").
'</a>';
386 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.