26 include_once DOL_DOCUMENT_ROOT.
'/core/modules/DolibarrModules.class.php';
27 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
48 $this->rights_class =
'eventorganization';
50 $this->family =
"projects";
52 $this->module_position =
'20';
54 $this->
name = preg_replace(
'/^mod/i',
'', get_class($this));
56 $this->
description =
"EventOrganizationDescription";
57 $this->descriptionlong =
"EventOrganizationDescriptionLong";
59 $this->version =
'dolibarr';
63 $this->const_name =
'MAIN_MODULE_'.strtoupper($this->
name);
65 $this->picto =
'conferenceorbooth';
68 $this->module_parts = array(
104 'moduleforexternal' => 0,
109 $this->dirs = array(
"/eventorganization/temp");
112 $this->config_page_url = array(
"eventorganization.php");
116 $this->hidden =
false;
118 $this->depends = array(
'modProjet',
'modCategorie');
119 $this->requiredby = array();
120 $this->conflictwith = array();
123 $this->langfiles = array(
"eventorganization");
126 $this->phpmin = array(7, 0);
127 $this->need_dolibarr_version = array(13, -3);
130 $this->warnings_activation = array();
131 $this->warnings_activation_ext = array();
140 $this->
const = array(1 => array(
'EVENTORGANIZATION_TASK_LABEL',
'chaine',
'',
'', 0));
150 if (!isset($conf->eventorganization) || !isset($conf->eventorganization->enabled)) {
151 $conf->eventorganization =
new stdClass();
152 $conf->eventorganization->enabled = 0;
156 $this->tabs = array();
184 $this->dictionaries = array();
188 $this->boxes = array(
199 $this->cronjobs = array(
204 $this->rights = array();
209 $this->rights[$r][0] = $this->numero + $r;
210 $this->rights[$r][1] =
'Read objects of EventOrganization';
211 $this->rights[$r][4] =
'read';
213 $this->rights[$r][0] = $this->numero + $r;
214 $this->rights[$r][1] =
'Create/Update objects of EventOrganization';
215 $this->rights[$r][4] =
'write';
217 $this->rights[$r][0] = $this->numero + $r;
218 $this->rights[$r][1] =
'Delete objects of EventOrganization';
219 $this->rights[$r][4] =
'delete';
224 $this->menu = array();
230 $this->menu[$r++]=array(
231 'fk_menu'=>
'fk_mainmenu=project',
233 'titre'=>
'EventOrganizationMenuLeft',
234 'prefix' =>
img_picto(
'',
'eventorganization',
'class="paddingright pictofixedwidth"'),
235 'mainmenu'=>
'project',
236 'leftmenu'=>
'eventorganization',
238 'langs'=>
'eventorganization',
240 'enabled'=>
'$conf->eventorganization->enabled',
241 'perms'=>
'$user->rights->eventorganization->read',
245 $this->menu[$r++]=array(
246 'fk_menu'=>
'fk_mainmenu=project,fk_leftmenu=eventorganization',
249 'url'=>
'/projet/list.php?search_usage_event_organization=1&search_status=99&mainmenu=project&contextpage=organizedevents',
250 'langs'=>
'eventorganization@eventorganization',
252 'enabled'=>
'$conf->eventorganization->enabled',
253 'perms'=>
'$user->rights->eventorganization->read',
257 $this->menu[$r++]=array(
258 'fk_menu'=>
'fk_mainmenu=project,fk_leftmenu=eventorganization',
261 'url'=>
'/projet/card.php?leftmenu=projects&action=create&usage_organize_event=1&usage_opportunity=0',
262 'langs'=>
'eventorganization@eventorganization',
264 'enabled'=>
'$conf->eventorganization->enabled',
265 'perms'=>
'$user->rights->eventorganization->write',
269 $this->menu[$r++]=array(
270 'fk_menu'=>
'fk_mainmenu=project',
272 'titre'=>
'ConferenceOrBooth',
273 'prefix' =>
img_picto(
'',
'conferenceorbooth',
'class="paddingright pictofixedwidth"'),
274 'mainmenu'=>
'project',
275 'leftmenu'=>
'eventorganizationconforbooth',
277 'langs'=>
'eventorganization',
279 'enabled'=>
'$conf->eventorganization->enabled',
280 'perms'=>
'$user->rights->eventorganization->read',
284 $this->menu[$r++]=array(
285 'fk_menu'=>
'fk_mainmenu=project,fk_leftmenu=eventorganizationconforbooth',
288 'url'=>
'/eventorganization/conferenceorbooth_list.php?mainmenu=project',
289 'langs'=>
'eventorganization',
291 'enabled'=>
'$conf->eventorganization->enabled',
292 'perms'=>
'$user->rights->eventorganization->read',
296 $this->menu[$r++]=array(
297 'fk_menu'=>
'fk_mainmenu=project,fk_leftmenu=eventorganizationconforbooth',
300 'url'=>
'/eventorganization/conferenceorbooth_card.php?leftmenu=projects&action=create',
301 'langs'=>
'eventorganization',
303 'enabled'=>
'$conf->eventorganization->enabled',
304 'perms'=>
'$user->rights->eventorganization->write',
328 public function init($options =
'')
330 global $conf, $langs, $user;
333 $this->
remove($options);
338 $moduledir =
'eventorganization';
339 $myTmpObjects = array();
340 $myTmpObjects[
'ConferenceOrBooth'] = array(
'includerefgeneration'=>0,
'includedocgeneration'=>0);
342 foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
343 if ($myTmpObjectKey ==
'ConferenceOrBooth') {
346 if ($myTmpObjectArray[
'includerefgeneration']) {
347 $src = DOL_DOCUMENT_ROOT.
'/install/doctemplates/eventorganization/template_conferenceorbooths.odt';
348 $dirodt = DOL_DATA_ROOT.
'/doctemplates/eventorganization';
349 $dest = $dirodt.
'/template_conferenceorbooths.odt';
351 if (file_exists($src) && !file_exists($dest)) {
352 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
354 $result =
dol_copy($src, $dest, 0, 0);
356 $langs->load(
"errors");
357 $this->error = $langs->trans(
'ErrorFailToCopyFile', $src, $dest);
362 $sql = array_merge($sql, array(
363 "DELETE FROM ".MAIN_DB_PREFIX.
"document_model WHERE nom = 'standard_".strtolower($myTmpObjectKey).
"' AND type = '".$this->
db->escape(strtolower($myTmpObjectKey)).
"' AND entity = ".((
int) $conf->entity),
364 "INSERT INTO ".MAIN_DB_PREFIX.
"document_model (nom, type, entity) VALUES('standard_".strtolower($myTmpObjectKey).
"','".$this->
db->escape(strtolower($myTmpObjectKey)).
"',".((
int) $conf->entity).
")",
365 "DELETE FROM ".MAIN_DB_PREFIX.
"document_model WHERE nom = 'generic_".strtolower($myTmpObjectKey).
"_odt' AND type = '".$this->
db->escape(strtolower($myTmpObjectKey)).
"' AND entity = ".((
int) $conf->entity),
366 "INSERT INTO ".MAIN_DB_PREFIX.
"document_model (nom, type, entity) VALUES('generic_".strtolower($myTmpObjectKey).
"_odt', '".$this->
db->escape(strtolower($myTmpObjectKey)).
"', ".((
int) $conf->entity).
")"
371 $init = $this->
_init($sql, $options);
375 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
378 $template = $formmail->getEMailTemplate($this->
db,
'conferenceorbooth', $user, $langs, 0, 1,
'(EventOrganizationEmailAskConf)');
379 if ($template->id > 0) {
380 dolibarr_set_const($this->
db,
'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF', $template->id,
'chaine', 0,
'', $conf->entity);
382 $template = $formmail->getEMailTemplate($this->
db,
'conferenceorbooth', $user, $langs, 0, 1,
'(EventOrganizationEmailAskBooth)');
383 if ($template->id > 0) {
384 dolibarr_set_const($this->
db,
'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH', $template->id,
'chaine', 0,
'', $conf->entity);
386 $template = $formmail->getEMailTemplate($this->
db,
'conferenceorbooth', $user, $langs, 0, 1,
'(EventOrganizationEmailBoothPayment)');
387 if ($template->id > 0) {
388 dolibarr_set_const($this->
db,
'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH', $template->id,
'chaine', 0,
'', $conf->entity);
390 $template = $formmail->getEMailTemplate($this->
db,
'conferenceorbooth', $user, $langs, 0, 1,
'(EventOrganizationEmailRegistrationPayment)');
391 if ($template->id > 0) {
392 dolibarr_set_const($this->
db,
'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT', $template->id,
'chaine', 0,
'', $conf->entity);
406 public function remove($options =
'')
409 return $this->
_remove($sql, $options);
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).
_init($array_sql, $options='')
Enables a module.
_remove($array_sql, $options='')
Disable function.
Description and activation class for module EventOrganization This module is base on this specificati...
init($options='')
Function called when module is enabled.
__construct($db)
Constructor.
print *****$script_file(".$version.") pid cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
dol_copy($srcfile, $destfile, $newmask=0, $overwriteifexists=1)
Copy a file to another file.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
$conf db name
Only used if Module[ID]Name translation string is not found.
$conf db
API class for accounts.