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',
'alpha');
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');
61$arrayofparameters = array(
62 'EVENTORGANIZATION_TASK_LABEL' => array(
'type' =>
'textarea',
'enabled' => 1,
'css' =>
''),
63 'EVENTORGANIZATION_CATEG_THIRDPARTY_CONF' => array(
'type' =>
'category:'.Categorie::TYPE_CUSTOMER,
'enabled' => 1,
'css' =>
''),
64 'EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH' => array(
'type' =>
'category:'.Categorie::TYPE_CUSTOMER,
'enabled' => 1,
'css' =>
''),
65 'EVENTORGANIZATION_FILTERATTENDEES_CAT' => array(
'type' =>
'category:'.Categorie::TYPE_CUSTOMER,
'enabled' => 1,
'css' =>
''),
66 'EVENTORGANIZATION_FILTERATTENDEES_TYPE' => array(
'type' =>
'thirdparty_type:',
'enabled' => 1,
'css' =>
''),
67 'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF' => array(
'type' =>
'emailtemplate:conferenceorbooth',
'enabled' => 1,
'css' =>
''),
68 'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH' => array(
'type' =>
'emailtemplate:conferenceorbooth',
'enabled' => 1,
'css' =>
''),
69 'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH' => array(
'type' =>
'emailtemplate:conferenceorbooth',
'enabled' => 1,
'css' =>
''),
70 'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT' => array(
'type' =>
'emailtemplate:conferenceorbooth',
'enabled' => 1,
'css' =>
''),
73 'SERVICE_BOOTH_LOCATION' => array(
'type' =>
'product',
'enabled' => 1,
'css' =>
'maxwidth500'),
74 'SERVICE_CONFERENCE_ATTENDEE_SUBSCRIPTION' => array(
'type' =>
'product',
'enabled' => 1,
'css' =>
'maxwidth500'),
80$dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
83if (empty($user->admin)) {
97include DOL_DOCUMENT_ROOT.
'/core/actions_setmoduleoptions.inc.php';
99if ($action ==
'updateMask') {
100 $maskconstorder =
GETPOST(
'maskconstorder',
'aZ09');
101 $maskorder =
GETPOST(
'maskorder',
'alpha');
103 if ($maskconstorder && preg_match(
'/_MASK$/', $maskconstorder)) {
104 $res =
dolibarr_set_const($db, $maskconstorder, $maskorder,
'chaine', 0,
'', $conf->entity);
115} elseif ($action ==
'setmod') {
117 $tmpobjectkey =
GETPOST(
'object',
'aZ09');
118 if (!empty($tmpobjectkey)) {
119 $constforval =
'EVENTORGANIZATION_'.strtoupper($tmpobjectkey).
"_ADDON";
122} elseif ($action ==
'set') {
125} elseif ($action ==
'del') {
128 $tmpobjectkey =
GETPOST(
'object',
'aZ09');
129 if (!empty($tmpobjectkey)) {
130 $constforval =
'EVENTORGANIZATION_'.strtoupper($tmpobjectkey).
'_ADDON_PDF';
143$form =
new Form($db);
145$page_name =
"EventOrganizationSetup";
147llxHeader(
'', $langs->trans($page_name),
'',
'', 0, 0,
'',
'',
'',
'mod-admin page-eventorganization');
150$linkback =
'<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1').
'">'.
img_picto($langs->trans(
"BackToModuleList"),
'back',
'class="pictofixedwidth"').
'<span class="hideonsmartphone">'.$langs->trans(
"BackToModuleList").
'</span></a>';
156print
dol_get_fiche_head($head,
'settings', $langs->trans($page_name), -1,
'eventorganization');
163if ($action ==
'edit') {
164 print
'<form method="POST" action="'.dolBuildUrl($_SERVER[
"PHP_SELF"]).
'">';
165 print
'<input type="hidden" name="token" value="'.newToken().
'">';
166 print
'<input type="hidden" name="action" value="update">';
168 print
'<table class="noborder centpercent">';
169 print
'<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans(
"Parameter").
'</td><td></td></tr>';
171 foreach ($arrayofparameters as $constname => $val) {
172 if ($val[
'enabled'] == 1) {
174 print
'<tr class="oddeven"><td><!-- '.$constname.
' -->';
175 $tooltiphelp = (($langs->trans($constname .
'Tooltip') != $constname .
'Tooltip') ? $langs->trans($constname .
'Tooltip') :
'');
176 $tooltiphelp .= (($langs->trans($constname .
'Tooltip2') && $langs->trans($constname .
'Tooltip2') != $constname .
'Tooltip2') ?
'<br><br>'.
"\n".$langs->trans($constname .
'Tooltip2') :
'');
177 print
'<span id="helplink'.$constname.
'" class="spanforparamtooltip">'.$form->textwithpicto($langs->trans($constname), $tooltiphelp, 1,
'info',
'', 0, 3,
'tootips'.$constname).
'</span>';
180 if ($val[
'type'] ==
'textarea') {
181 print
'<textarea class="flat" name="'.$constname.
'" id="'.$constname.
'" cols="50" rows="5" wrap="soft">' .
"\n";
183 print
"</textarea>\n";
184 } elseif (preg_match(
'/emailtemplate:/', $val[
'type'])) {
185 include_once DOL_DOCUMENT_ROOT .
'/core/class/html.formmail.class.php';
188 $tmp = explode(
':', $val[
'type']);
189 $nboftemplates = $formmail->fetchAllEMailTemplate($tmp[1], $user,
null, 1);
191 $arrayofmessagename = array();
192 if (is_array($formmail->lines_model)) {
193 foreach ($formmail->lines_model as $modelmail) {
196 if (!empty($arrayofmessagename[$modelmail->label])) {
197 $moreonlabel =
' <span class="opacitymedium">(' . $langs->trans(
"SeveralLangugeVariatFound") .
')</span>';
200 $arrayofmessagename[$modelmail->id] = $langs->trans(preg_replace(
'/\(|\)/',
'', $modelmail->label)) . $moreonlabel;
203 print $form->selectarray($constname, $arrayofmessagename,
getDolGlobalString($constname),
'None', 0, 0,
'', 0, 0, 0,
'',
'', 1);
204 } elseif (preg_match(
'/category:/', $val[
'type'])) {
205 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
206 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
209 $tmp = explode(
':', $val[
'type']);
210 print
img_picto(
'',
'category',
'class="pictofixedwidth"');
211 print $formother->select_categories($tmp[1],
getDolGlobalInt($constname), $constname, 0, $langs->trans(
'CustomersProspectsCategoriesShort'));
212 } elseif (preg_match(
'/thirdparty_type/', $val[
'type'])) {
213 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
215 print $formcompany->selectProspectCustomerType(
getDolGlobalString($constname), $constname,
'customerorprospect',
'form',
'',
'1');
216 } elseif ($val[
'type'] ==
'product') {
219 print
img_picto(
'',
'product',
'class="pictofixedwidth"');
220 print $form->select_produits($selected, $constname,
'', 0, 0, 1, 2,
'', 0, array(), 0,
'1', 0,
'maxwidth500 widthcentpercentminusx', 0,
'',
null, 1);
223 print
'<input name="' . $constname .
'" class="flat ' . (empty($val[
'css']) ?
'minwidth200' : $val[
'css']) .
'" value="' .
getDolGlobalString($constname) .
'">';
230 print $form->buttonsSaveCancel(
'Save',
'');
235 print
'<table class="noborder centpercent">';
236 print
'<tr class="liste_titre"><td class="titlefieldmiddle">'.$langs->trans(
"Parameter").
'</td><td></td></tr>';
238 foreach ($arrayofparameters as $constname => $val) {
243 print
'<tr class="oddeven">';
244 print
'<td><!-- '.$constname.
' -->';
245 $tooltiphelp = (($langs->trans($constname .
'Tooltip') != $constname .
'Tooltip') ? $langs->trans($constname .
'Tooltip') :
'');
246 $tooltiphelp .= (($langs->trans($constname .
'Tooltip2') && $langs->trans($constname .
'Tooltip2') != $constname .
'Tooltip2') ?
'<br><br>'.
"\n".$langs->trans($constname .
'Tooltip2') :
'');
247 print $form->textwithpicto($langs->trans($constname), $tooltiphelp);
250 if ($val[
'type'] ==
'textarea') {
252 } elseif (preg_match(
'/emailtemplate:/', $val[
'type'])) {
254 include_once DOL_DOCUMENT_ROOT .
'/core/class/html.formmail.class.php';
257 $tmp = explode(
':', $val[
'type']);
259 if ($labelemailtemplate && $labelemailtemplate !=
'-1') {
260 $template = $formmail->getEMailTemplate($db, $tmp[1], $user, $langs,
getDolGlobalInt($constname));
261 if (is_numeric($template) && $template < 0) {
264 if ($template->label !=
'default') {
265 print $langs->trans($template->label);
270 } elseif (preg_match(
'/category:/', $val[
'type'])) {
277 $ways =
$c->print_all_ways(
'auto',
'none', 0, 1);
279 foreach ($ways as $way) {
280 $toprint[] =
'<li class="select2-search-choice-dolibarr noborderoncategories"' . (
$c->color ?
' style="background: #' .
$c->color .
';"' :
' style="background: #bbb"') .
'>' . $way .
'</li>';
282 print
'<div class="select2-container-multi-dolibarr" style="width: 90%;"><ul class="select2-choices-dolibarr">' . implode(
' ', $toprint) .
'</ul></div>';
284 } elseif (preg_match(
'/thirdparty_type/', $val[
'type'])) {
286 print $langs->trans(
"Prospect");
288 print $langs->trans(
"ProspectCustomer");
290 print $langs->trans(
"Customer");
292 print $langs->trans(
"NorProspectNorCustomer");
294 } elseif ($val[
'type'] ==
'product') {
297 if ($idproduct > 0) {
298 $resprod = $product->fetch($idproduct);
300 print $product->getNomUrl(1);
301 } elseif ($resprod < 0) {
315 print
'<div class="tabsAction">';
316 print
'<a class="butAction" href="'.$_SERVER[
"PHP_SELF"].
'?action=edit&token='.
newToken().
'">'.$langs->trans(
"Modify").
'</a>';
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.
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
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 products or services.
eventorganizationAdminPrepareHead()
Prepare admin pages header.
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, $allowothertags=array())
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, $morecssdiv='')
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.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
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.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.