26require
'../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.
"/core/lib/admin.lib.php";
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/eventorganization.lib.php';
33require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
36$langs->loadLangs(array(
"admin",
"eventorganization",
"categories"));
39$action =
GETPOST(
'action',
'aZ09');
40$cancel =
GETPOST(
'cancel',
'aZ09');
41$backtopage =
GETPOST(
'backtopage',
'alpha');
43$value =
GETPOST(
'value',
'alpha');
44$label =
GETPOST(
'label',
'alpha');
45$modulepart =
GETPOST(
'modulepart',
'aZ09');
47$scandir =
GETPOST(
'scan_dir',
'alpha');
50$arrayofparameters = array(
51 'EVENTORGANIZATION_TASK_LABEL' => array(
'type' =>
'textarea',
'enabled' => 1,
'css' =>
''),
52 'EVENTORGANIZATION_CATEG_THIRDPARTY_CONF' => array(
'type' =>
'category:'.Categorie::TYPE_CUSTOMER,
'enabled' => 1,
'css' =>
''),
53 'EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH' => array(
'type' =>
'category:'.Categorie::TYPE_CUSTOMER,
'enabled' => 1,
'css' =>
''),
54 'EVENTORGANIZATION_FILTERATTENDEES_CAT' => array(
'type' =>
'category:'.Categorie::TYPE_CUSTOMER,
'enabled' => 1,
'css' =>
''),
55 'EVENTORGANIZATION_FILTERATTENDEES_TYPE' => array(
'type' =>
'thirdparty_type:',
'enabled' => 1,
'css' =>
''),
56 'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF' => array(
'type' =>
'emailtemplate:conferenceorbooth',
'enabled' => 1,
'css' =>
''),
57 'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH' => array(
'type' =>
'emailtemplate:conferenceorbooth',
'enabled' => 1,
'css' =>
''),
58 'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH' => array(
'type' =>
'emailtemplate:conferenceorbooth',
'enabled' => 1,
'css' =>
''),
59 'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT' => array(
'type' =>
'emailtemplate:conferenceorbooth',
'enabled' => 1,
'css' =>
''),
62 'SERVICE_BOOTH_LOCATION' => array(
'type' =>
'product',
'enabled' => 1,
'css' =>
''),
63 'SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION' => array(
'type' =>
'product',
'enabled' => 1,
'css' =>
''),
64 'EVENTORGANIZATION_SECUREKEY' => array(
'type' =>
'securekey',
'enabled' => 1,
'css' =>
''),
70$dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
73if (empty($user->admin)) {
87include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
89if ($action ==
'updateMask') {
90 $maskconstorder =
GETPOST(
'maskconstorder',
'aZ09');
91 $maskorder =
GETPOST(
'maskorder',
'alpha');
93 if ($maskconstorder && preg_match(
'/_MASK$/', $maskconstorder)) {
94 $res =
dolibarr_set_const($db, $maskconstorder, $maskorder,
'chaine', 0,
'', $conf->entity);
105} elseif ($action ==
'setmod') {
107 $tmpobjectkey =
GETPOST(
'object',
'aZ09');
108 if (!empty($tmpobjectkey)) {
109 $constforval =
'EVENTORGANIZATION_'.strtoupper($tmpobjectkey).
"_ADDON";
112} elseif ($action ==
'set') {
115} elseif ($action ==
'del') {
118 $tmpobjectkey =
GETPOST(
'object',
'aZ09');
119 if (!empty($tmpobjectkey)) {
120 $constforval =
'EVENTORGANIZATION_'.strtoupper($tmpobjectkey).
'_ADDON_PDF';
157$form =
new Form($db);
159$page_name =
"EventOrganizationSetup";
161llxHeader(
'', $langs->trans($page_name),
'',
'', 0, 0,
'',
'',
'',
'mod-admin page-eventorganization');
164$linkback =
'<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1').
'">'.$langs->trans(
"BackToModuleList").
'</a>';
170print
dol_get_fiche_head($head,
'settings', $langs->trans($page_name), -1,
'eventorganization');
173echo
'<span class="opacitymedium">'.$langs->trans(
"EventOrganizationSetupPage").
'</span><br><br>';
176if ($action ==
'edit') {
177 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
178 print
'<input type="hidden" name="token" value="'.newToken().
'">';
179 print
'<input type="hidden" name="action" value="update">';
181 print
'<table class="noborder centpercent">';
182 print
'<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans(
"Parameter").
'</td><td>'.$langs->trans(
"Value").
'</td></tr>';
184 foreach ($arrayofparameters as $constname => $val) {
185 if ($val[
'enabled'] == 1) {
187 print
'<tr class="oddeven"><td><!-- '.$constname.
' -->';
188 $tooltiphelp = (($langs->trans($constname .
'Tooltip') != $constname .
'Tooltip') ? $langs->trans($constname .
'Tooltip') :
'');
189 $tooltiphelp .= (($langs->trans($constname .
'Tooltip2') && $langs->trans($constname .
'Tooltip2') != $constname .
'Tooltip2') ?
'<br><br>'.
"\n".$langs->trans($constname .
'Tooltip2') :
'');
190 print
'<span id="helplink'.$constname.
'" class="spanforparamtooltip">'.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1,
'info',
'', 0, 3,
'tootips'.$constname).
'</span>';
193 if ($val[
'type'] ==
'textarea') {
194 print
'<textarea class="flat" name="'.$constname.
'" id="'.$constname.
'" cols="50" rows="5" wrap="soft">' .
"\n";
196 print
"</textarea>\n";
197 } elseif ($val[
'type'] ==
'html') {
198 require_once DOL_DOCUMENT_ROOT .
'/core/class/doleditor.class.php';
199 $doleditor =
new DolEditor($constname,
getDolGlobalString($constname),
'', 160,
'dolibarr_notes',
'',
false,
false, isModEnabled(
'fckeditor'), ROWS_5,
'90%');
200 $doleditor->Create();
201 } elseif ($val[
'type'] ==
'yesno') {
203 } elseif (preg_match(
'/emailtemplate:/', $val[
'type'])) {
204 include_once DOL_DOCUMENT_ROOT .
'/core/class/html.formmail.class.php';
207 $tmp = explode(
':', $val[
'type']);
208 $nboftemplates = $formmail->fetchAllEMailTemplate($tmp[1], $user,
null, 1);
210 $arrayofmessagename = array();
211 if (is_array($formmail->lines_model)) {
212 foreach ($formmail->lines_model as $modelmail) {
215 if (!empty($arrayofmessagename[$modelmail->label])) {
216 $moreonlabel =
' <span class="opacitymedium">(' . $langs->trans(
"SeveralLangugeVariatFound") .
')</span>';
219 $arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace(
'/\(|\)/',
'', $modelmail->label)) . $moreonlabel;
222 print $form->selectarray($constname, $arrayofmessagename,
getDolGlobalString($constname),
'None', 0, 0,
'', 0, 0, 0,
'',
'', 1);
223 } elseif (preg_match(
'/category:/', $val[
'type'])) {
224 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
225 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
228 $tmp = explode(
':', $val[
'type']);
229 print
img_picto(
'',
'category',
'class="pictofixedwidth"');
230 print $formother->select_categories($tmp[1],
getDolGlobalString($constname), $constname, 0, $langs->trans(
'CustomersProspectsCategoriesShort'));
231 } elseif (preg_match(
'/thirdparty_type/', $val[
'type'])) {
232 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
234 print $formcompany->selectProspectCustomerType(
getDolGlobalString($constname), $constname,
'customerorprospect',
'form',
'', 1);
235 } elseif ($val[
'type'] ==
'securekey') {
236 print
'<input type="text" class="flat" id="'.$constname.
'" name="'.$constname.
'" value="'.(
GETPOST($constname,
'alpha') ?
GETPOST($constname,
'alpha') :
getDolGlobalString($constname)).
'" size="40">';
237 if (!empty($conf->use_javascript_ajax)) {
238 print
' '.img_picto($langs->trans(
'Generate'),
'refresh',
'id="generate_token'.$constname.
'" class="linkobject"');
242 include_once DOL_DOCUMENT_ROOT.
'/core/lib/security2.lib.php';
244 } elseif ($val[
'type'] ==
'product') {
245 if (isModEnabled(
"product") || isModEnabled(
"service")) {
247 print
img_picto(
'',
'product',
'class="pictofixedwidth"');
248 print $form->select_produits($selected, $constname,
'', 0, 0, 1, 2,
'', 0, array(), 0,
'1', 0,
'maxwidth500 widthcentpercentminusx', 0,
'',
null, 1);
251 print
'<input name="' . $constname .
'" class="flat ' . (empty($val[
'css']) ?
'minwidth200' : $val[
'css']) .
'" value="' .
getDolGlobalString($constname) .
'">';
258 print $form->buttonsSaveCancel();
263 if (!empty($arrayofparameters)) {
264 print
'<table class="noborder centpercent">';
265 print
'<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans(
"Parameter").
'</td><td>'.$langs->trans(
"Value").
'</td></tr>';
267 foreach ($arrayofparameters as $constname => $val) {
268 if ($val[
'enabled'] == 1) {
270 print
'<tr class="oddeven">';
271 print
'<td><!-- '.$constname.
' -->';
272 $tooltiphelp = (($langs->trans($constname .
'Tooltip') != $constname .
'Tooltip') ? $langs->trans($constname .
'Tooltip') :
'');
273 $tooltiphelp .= (($langs->trans($constname .
'Tooltip2') && $langs->trans($constname .
'Tooltip2') != $constname .
'Tooltip2') ?
'<br><br>'.
"\n".$langs->trans($constname .
'Tooltip2') :
'');
274 print $form->textwithpicto($langs->trans($constname), $tooltiphelp);
277 if ($val[
'type'] ==
'textarea') {
279 } elseif ($val[
'type'] ==
'html') {
281 } elseif ($val[
'type'] ==
'yesno') {
282 print ajax_constantonoff($constname);
283 } elseif (preg_match(
'/emailtemplate:/', $val[
'type'])) {
285 include_once DOL_DOCUMENT_ROOT .
'/core/class/html.formmail.class.php';
288 $tmp = explode(
':', $val[
'type']);
290 if ($labelemailtemplate && $labelemailtemplate !=
'-1') {
291 $template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs,
getDolGlobalString($constname));
292 if (is_numeric($template) && $template < 0) {
295 if ($template->label !=
'default') {
296 print $langs->trans($template->label);
301 } elseif (preg_match(
'/category:/', $val[
'type'])) {
308 $ways = $c->print_all_ways(
' >> ',
'none', 0, 1);
310 foreach ($ways as $way) {
311 $toprint[] =
'<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ?
' style="background: #' . $c->color .
';"' :
' style="background: #bbb"') .
'>' . $way .
'</li>';
313 print
'<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(
' ', $toprint) .
'</ul></div>';
315 } elseif (preg_match(
'/thirdparty_type/', $val[
'type'])) {
317 print $langs->trans(
"Prospect");
319 print $langs->trans(
"ProspectCustomer");
321 print $langs->trans(
"Customer");
323 print $langs->trans(
"NorProspectNorCustomer");
325 } elseif ($val[
'type'] ==
'product') {
328 if ($idproduct > 0) {
329 $resprod = $product->fetch($idproduct);
331 print $product->getNomUrl(1);
332 } elseif ($resprod < 0) {
347 print
'<div class="tabsAction">';
348 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&token='.
newToken().
'">'.$langs->trans(
"Modify").
'</a>';
351 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($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
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($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
dolJSToSetRandomPassword($htmlname, $htmlnameofbutton='generate_token', $generic=1)
Output javascript 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.