27require
'../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';
43$langs->loadLangs(array(
"admin",
"eventorganization",
"categories"));
46$action =
GETPOST(
'action',
'aZ09');
47$cancel =
GETPOST(
'cancel',
'aZ09');
48$backtopage =
GETPOST(
'backtopage',
'alpha');
50$value =
GETPOST(
'value',
'alpha');
51$label =
GETPOST(
'label',
'alpha');
52$modulepart =
GETPOST(
'modulepart',
'aZ09');
54$scandir =
GETPOST(
'scan_dir',
'alpha');
57$arrayofparameters = array(
58 'EVENTORGANIZATION_TASK_LABEL' => array(
'type' =>
'textarea',
'enabled' => 1,
'css' =>
''),
59 'EVENTORGANIZATION_CATEG_THIRDPARTY_CONF' => array(
'type' =>
'category:'.Categorie::TYPE_CUSTOMER,
'enabled' => 1,
'css' =>
''),
60 'EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH' => array(
'type' =>
'category:'.Categorie::TYPE_CUSTOMER,
'enabled' => 1,
'css' =>
''),
61 'EVENTORGANIZATION_FILTERATTENDEES_CAT' => array(
'type' =>
'category:'.Categorie::TYPE_CUSTOMER,
'enabled' => 1,
'css' =>
''),
62 'EVENTORGANIZATION_FILTERATTENDEES_TYPE' => array(
'type' =>
'thirdparty_type:',
'enabled' => 1,
'css' =>
''),
63 'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF' => array(
'type' =>
'emailtemplate:conferenceorbooth',
'enabled' => 1,
'css' =>
''),
64 'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH' => array(
'type' =>
'emailtemplate:conferenceorbooth',
'enabled' => 1,
'css' =>
''),
65 'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH' => array(
'type' =>
'emailtemplate:conferenceorbooth',
'enabled' => 1,
'css' =>
''),
66 'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT' => array(
'type' =>
'emailtemplate:conferenceorbooth',
'enabled' => 1,
'css' =>
''),
69 'SERVICE_BOOTH_LOCATION' => array(
'type' =>
'product',
'enabled' => 1,
'css' =>
''),
70 'SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION' => array(
'type' =>
'product',
'enabled' => 1,
'css' =>
''),
71 'EVENTORGANIZATION_SECUREKEY' => array(
'type' =>
'securekey',
'enabled' => 1,
'css' =>
''),
77$dirmodels = array_merge(array(
'/'), (array)
$conf->modules_parts[
'models']);
80if (empty($user->admin)) {
94include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
96if ($action ==
'updateMask') {
97 $maskconstorder =
GETPOST(
'maskconstorder',
'aZ09');
98 $maskorder =
GETPOST(
'maskorder',
'alpha');
100 if ($maskconstorder && preg_match(
'/_MASK$/', $maskconstorder)) {
112} elseif ($action ==
'setmod') {
114 $tmpobjectkey =
GETPOST(
'object',
'aZ09');
115 if (!empty($tmpobjectkey)) {
116 $constforval =
'EVENTORGANIZATION_'.strtoupper($tmpobjectkey).
"_ADDON";
119} elseif ($action ==
'set') {
122} elseif ($action ==
'del') {
125 $tmpobjectkey =
GETPOST(
'object',
'aZ09');
126 if (!empty($tmpobjectkey)) {
127 $constforval =
'EVENTORGANIZATION_'.strtoupper($tmpobjectkey).
'_ADDON_PDF';
164$form =
new Form($db);
166$page_name =
"EventOrganizationSetup";
168llxHeader(
'', $langs->trans($page_name),
'',
'', 0, 0,
'',
'',
'',
'mod-admin page-eventorganization');
171$linkback =
'<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1').
'">'.$langs->trans(
"BackToModuleList").
'</a>';
177print
dol_get_fiche_head($head,
'settings', $langs->trans($page_name), -1,
'eventorganization');
180echo
'<span class="opacitymedium">'.$langs->trans(
"EventOrganizationSetupPage").
'</span><br><br>';
183if ($action ==
'edit') {
184 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
185 print
'<input type="hidden" name="token" value="'.newToken().
'">';
186 print
'<input type="hidden" name="action" value="update">';
188 print
'<table class="noborder centpercent">';
189 print
'<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans(
"Parameter").
'</td><td>'.$langs->trans(
"Value").
'</td></tr>';
191 foreach ($arrayofparameters as $constname => $val) {
192 if ($val[
'enabled'] == 1) {
194 print
'<tr class="oddeven"><td><!-- '.$constname.
' -->';
195 $tooltiphelp = (($langs->trans($constname .
'Tooltip') != $constname .
'Tooltip') ? $langs->trans($constname .
'Tooltip') :
'');
196 $tooltiphelp .= (($langs->trans($constname .
'Tooltip2') && $langs->trans($constname .
'Tooltip2') != $constname .
'Tooltip2') ?
'<br><br>'.
"\n".$langs->trans($constname .
'Tooltip2') :
'');
197 print
'<span id="helplink'.$constname.
'" class="spanforparamtooltip">'.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1,
'info',
'', 0, 3,
'tootips'.$constname).
'</span>';
200 if ($val[
'type'] ==
'textarea') {
201 print
'<textarea class="flat" name="'.$constname.
'" id="'.$constname.
'" cols="50" rows="5" wrap="soft">' .
"\n";
203 print
"</textarea>\n";
204 } elseif ($val[
'type'] ==
'html') {
205 require_once DOL_DOCUMENT_ROOT .
'/core/class/doleditor.class.php';
206 $doleditor =
new DolEditor($constname,
getDolGlobalString($constname),
'', 160,
'dolibarr_notes',
'',
false,
false, isModEnabled(
'fckeditor'), ROWS_5,
'90%');
207 $doleditor->Create();
208 } elseif ($val[
'type'] ==
'yesno') {
210 } elseif (preg_match(
'/emailtemplate:/', $val[
'type'])) {
211 include_once DOL_DOCUMENT_ROOT .
'/core/class/html.formmail.class.php';
214 $tmp = explode(
':', $val[
'type']);
215 $nboftemplates = $formmail->fetchAllEMailTemplate($tmp[1], $user,
null, 1);
217 $arrayofmessagename = array();
218 if (is_array($formmail->lines_model)) {
219 foreach ($formmail->lines_model as $modelmail) {
222 if (!empty($arrayofmessagename[$modelmail->label])) {
223 $moreonlabel =
' <span class="opacitymedium">(' . $langs->trans(
"SeveralLangugeVariatFound") .
')</span>';
226 $arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace(
'/\(|\)/',
'', $modelmail->label)) . $moreonlabel;
229 print $form->selectarray($constname, $arrayofmessagename,
getDolGlobalString($constname),
'None', 0, 0,
'', 0, 0, 0,
'',
'', 1);
230 } elseif (preg_match(
'/category:/', $val[
'type'])) {
231 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
232 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
235 $tmp = explode(
':', $val[
'type']);
236 print
img_picto(
'',
'category',
'class="pictofixedwidth"');
237 print $formother->select_categories($tmp[1],
getDolGlobalString($constname), $constname, 0, $langs->trans(
'CustomersProspectsCategoriesShort'));
238 } elseif (preg_match(
'/thirdparty_type/', $val[
'type'])) {
239 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
241 print $formcompany->selectProspectCustomerType(
getDolGlobalString($constname), $constname,
'customerorprospect',
'form',
'', 1);
242 } elseif ($val[
'type'] ==
'securekey') {
243 print
'<input type="text" class="flat" id="'.$constname.
'" name="'.$constname.
'" value="'.(
GETPOST($constname,
'alpha') ?
GETPOST($constname,
'alpha') :
getDolGlobalString($constname)).
'" size="40">';
244 if (!empty(
$conf->use_javascript_ajax)) {
245 print
' '.img_picto($langs->trans(
'Generate'),
'refresh',
'id="generate_token'.$constname.
'" class="linkobject"');
249 include_once DOL_DOCUMENT_ROOT.
'/core/lib/security2.lib.php';
251 } elseif ($val[
'type'] ==
'product') {
252 if (isModEnabled(
"product") || isModEnabled(
"service")) {
254 print
img_picto(
'',
'product',
'class="pictofixedwidth"');
255 print $form->select_produits($selected, $constname,
'', 0, 0, 1, 2,
'', 0, array(), 0,
'1', 0,
'maxwidth500 widthcentpercentminusx', 0,
'',
null, 1);
258 print
'<input name="' . $constname .
'" class="flat ' . (empty($val[
'css']) ?
'minwidth200' : $val[
'css']) .
'" value="' .
getDolGlobalString($constname) .
'">';
265 print $form->buttonsSaveCancel();
270 if (!empty($arrayofparameters)) {
271 print
'<table class="noborder centpercent">';
272 print
'<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans(
"Parameter").
'</td><td>'.$langs->trans(
"Value").
'</td></tr>';
274 foreach ($arrayofparameters as $constname => $val) {
275 if ($val[
'enabled'] == 1) {
277 print
'<tr class="oddeven">';
278 print
'<td><!-- '.$constname.
' -->';
279 $tooltiphelp = (($langs->trans($constname .
'Tooltip') != $constname .
'Tooltip') ? $langs->trans($constname .
'Tooltip') :
'');
280 $tooltiphelp .= (($langs->trans($constname .
'Tooltip2') && $langs->trans($constname .
'Tooltip2') != $constname .
'Tooltip2') ?
'<br><br>'.
"\n".$langs->trans($constname .
'Tooltip2') :
'');
281 print $form->textwithpicto($langs->trans($constname), $tooltiphelp);
284 if ($val[
'type'] ==
'textarea') {
286 } elseif ($val[
'type'] ==
'html') {
288 } elseif ($val[
'type'] ==
'yesno') {
289 print ajax_constantonoff($constname);
290 } elseif (preg_match(
'/emailtemplate:/', $val[
'type'])) {
292 include_once DOL_DOCUMENT_ROOT .
'/core/class/html.formmail.class.php';
295 $tmp = explode(
':', $val[
'type']);
297 if ($labelemailtemplate && $labelemailtemplate !=
'-1') {
298 $template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs,
getDolGlobalString($constname));
299 if (is_numeric($template) && $template < 0) {
302 if ($template->label !=
'default') {
303 print $langs->trans($template->label);
308 } elseif (preg_match(
'/category:/', $val[
'type'])) {
315 $ways = $c->print_all_ways(
' >> ',
'none', 0, 1);
317 foreach ($ways as $way) {
318 $toprint[] =
'<li class="select2-search-choice-dolibarr noborderoncategories"' . ($c->color ?
' style="background: #' . $c->color .
';"' :
' style="background: #bbb"') .
'>' . $way .
'</li>';
320 print
'<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(
' ', $toprint) .
'</ul></div>';
322 } elseif (preg_match(
'/thirdparty_type/', $val[
'type'])) {
324 print $langs->trans(
"Prospect");
326 print $langs->trans(
"ProspectCustomer");
328 print $langs->trans(
"Customer");
330 print $langs->trans(
"NorProspectNorCustomer");
332 } elseif ($val[
'type'] ==
'product') {
335 if ($idproduct > 0) {
336 $resprod = $product->fetch($idproduct);
338 print $product->getNomUrl(1);
339 } elseif ($resprod < 0) {
354 print
'<div class="tabsAction">';
355 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&token='.
newToken().
'">'.$langs->trans(
"Modify").
'</a>';
358 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.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
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.