27 include_once DOL_DOCUMENT_ROOT.
'/core/modules/DolibarrModules.class.php';
28 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
50 $this->rights_class =
'eventorganization';
52 $this->family =
"projects";
54 $this->module_position =
'15';
56 $this->
name = preg_replace(
'/^mod/i',
'', get_class($this));
58 $this->
description =
"EventOrganizationDescription";
59 $this->descriptionlong =
"EventOrganizationDescriptionLong";
61 $this->version =
'dolibarr';
65 $this->const_name =
'MAIN_MODULE_'.strtoupper($this->
name);
67 $this->picto =
'conferenceorbooth';
70 $this->module_parts = array(
106 'moduleforexternal' => 0,
111 $this->dirs = array(
"/eventorganization/temp");
114 $this->config_page_url = array(
"eventorganization.php");
118 $this->hidden =
false;
120 $this->depends = array(
'modProjet',
'modCategorie');
121 $this->requiredby = array();
122 $this->conflictwith = array();
125 $this->langfiles = array(
"eventorganization");
128 $this->phpmin = array(7, 0);
129 $this->need_dolibarr_version = array(13, -3);
132 $this->warnings_activation = array();
133 $this->warnings_activation_ext = array();
142 $this->
const = array(1 => array(
'EVENTORGANIZATION_TASK_LABEL',
'chaine',
'',
'', 0));
152 if (!isset($conf->eventorganization) || !isset($conf->eventorganization->enabled)) {
153 $conf->eventorganization =
new stdClass();
154 $conf->eventorganization->enabled = 0;
158 $this->tabs = array();
186 $this->dictionaries = array();
190 $this->boxes = array(
201 $this->cronjobs = array(
206 $this->rights = array();
211 $this->rights[$r][0] = $this->numero + $r;
212 $this->rights[$r][1] =
'Read objects of EventOrganization';
213 $this->rights[$r][4] =
'read';
215 $this->rights[$r][0] = $this->numero + $r;
216 $this->rights[$r][1] =
'Create/Update objects of EventOrganization';
217 $this->rights[$r][4] =
'write';
219 $this->rights[$r][0] = $this->numero + $r;
220 $this->rights[$r][1] =
'Delete objects of EventOrganization';
221 $this->rights[$r][4] =
'delete';
226 $this->menu = array();
232 $this->menu[$r++] = array(
233 'fk_menu' =>
'fk_mainmenu=project',
235 'titre' =>
'EventOrganizationMenuLeft',
236 'prefix' =>
img_picto(
'',
'eventorganization',
'class="paddingright pictofixedwidth"'),
237 'mainmenu' =>
'project',
238 'leftmenu' =>
'eventorganization',
240 'langs' =>
'eventorganization',
241 'position' => 1000 + $r,
242 'enabled' =>
'isModEnabled("eventorganization")',
243 'perms' =>
'$user->hasRight("eventorganization", "read")',
247 $this->menu[$r++] = array(
248 'fk_menu' =>
'fk_mainmenu=project,fk_leftmenu=eventorganization',
251 'url' =>
'/projet/card.php?leftmenu=projects&action=create&usage_organize_event=1&usage_opportunity=0',
252 'langs' =>
'eventorganization@eventorganization',
253 'position' => 1000 + $r,
254 'enabled' =>
'isModEnabled("eventorganization")',
255 'perms' =>
'$user->hasRight("eventorganization", "write")',
259 $this->menu[$r++] = array(
260 'fk_menu' =>
'fk_mainmenu=project,fk_leftmenu=eventorganization',
263 'url' =>
'/projet/list.php?search_usage_event_organization=1&search_status=99&mainmenu=project&contextpage=organizedevents',
264 'langs' =>
'eventorganization@eventorganization',
265 'position' => 1000 + $r,
266 'enabled' =>
'isModEnabled("eventorganization")',
267 'perms' =>
'$user->hasRight("eventorganization", "write")',
271 $this->menu[$r++] = array(
272 'fk_menu' =>
'fk_mainmenu=project',
274 'titre' =>
'ConferenceOrBooth',
275 'prefix' =>
img_picto(
'',
'conferenceorbooth',
'class="paddingright pictofixedwidth"'),
276 'mainmenu' =>
'project',
277 'leftmenu' =>
'eventorganizationconforbooth',
279 'langs' =>
'eventorganization',
280 'position' => 1000 + $r,
281 'enabled' =>
'isModEnabled("eventorganization")',
282 'perms' =>
'$user->hasRight("eventorganization", "read")',
286 $this->menu[$r++] = array(
287 'fk_menu' =>
'fk_mainmenu=project,fk_leftmenu=eventorganizationconforbooth',
290 'url' =>
'/eventorganization/conferenceorbooth_card.php?leftmenu=projects&action=create',
291 'langs' =>
'eventorganization',
292 'position' => 1000 + $r,
293 'enabled' =>
'isModEnabled("eventorganization")',
294 'perms' =>
'$user->hasRight("eventorganization", "write")',
298 $this->menu[$r++] = array(
299 'fk_menu' =>
'fk_mainmenu=project,fk_leftmenu=eventorganizationconforbooth',
302 'url' =>
'/eventorganization/conferenceorbooth_list.php?mainmenu=project',
303 'langs' =>
'eventorganization',
304 'position' => 1000 + $r,
305 'enabled' =>
'isModEnabled("eventorganization")',
306 'perms' =>
'$user->hasRight("eventorganization", "read")',
316 $langs->load(
"eventorganization");
317 $this->export_code[$r] = $this->rights_class.
'_'.$r;
318 $this->export_label[$r] =
'ListOfAttendeesOfEvent';
319 $this->export_icon[$r] = $this->picto;
321 $keyforclass =
'ConferenceOrBoothAttendee';
322 $keyforclassfile =
'/eventorganization/class/conferenceorboothattendee.class.php';
323 $keyforelement =
'conferenceorboothattendee';
324 include DOL_DOCUMENT_ROOT.
'/core/commonfieldsinexport.inc.php';
325 $this->export_entities_array[$r][
't.fk_invoice'] =
'invoice';
326 unset($this->export_fields_array[$r][
't.fk_project']);
327 unset($this->export_fields_array[$r][
't.fk_soc']);
328 $this->export_fields_array[$r][
't.fk_invoice'] =
'InvoiceId';
329 $this->export_fields_array[$r][
't.fk_project'] =
'ProjectId';
330 $this->export_fields_array[$r][
'p.ref'] =
'ProjectRef';
331 $this->export_fields_array[$r][
't.fk_soc'] =
'IdThirdParty';
332 $this->export_entities_array[$r][
't.fk_project'] =
'project';
333 $this->export_entities_array[$r][
'p.ref'] =
'project';
334 $this->export_entities_array[$r][
't.fk_soc'] =
'company';
335 $this->export_TypeFields_array[$r][
't.fk_project'] =
'Numeric';
336 $this->export_TypeFields_array[$r][
't.fk_invoice'] =
'Numeric';
337 $this->export_TypeFields_array[$r][
'p.ref'] =
'Text';
338 $this->export_TypeFields_array[$r][
't.fk_soc'] =
'Numeric';
341 $keyforselect =
'conferenceorboothattendee';
342 $keyforaliasextra =
'extra';
343 $keyforelement =
'conferenceorboothattendee';
344 include DOL_DOCUMENT_ROOT.
'/core/extrafieldsinexport.inc.php';
349 $this->export_sql_start[$r] =
'SELECT DISTINCT ';
350 $this->export_sql_end[$r] =
' FROM '.MAIN_DB_PREFIX.
'eventorganization_conferenceorboothattendee as t, '.MAIN_DB_PREFIX.
'projet as p';
351 $this->export_sql_end[$r] .=
' WHERE t.fk_project = p.rowid';
352 $this->export_sql_end[$r] .=
' AND p.entity IN ('.getEntity(
'conferenceorboothattendee').
')';
431 public function init($options =
'')
433 global $conf, $langs, $user;
443 $this->
remove($options);
448 $moduledir =
'eventorganization';
449 $myTmpObjects = array();
450 $myTmpObjects[
'ConferenceOrBooth'] = array(
'includerefgeneration' => 0,
'includedocgeneration' => 0);
452 foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
453 if ($myTmpObjectKey ==
'ConferenceOrBooth') {
456 if ($myTmpObjectArray[
'includerefgeneration']) {
457 $src = DOL_DOCUMENT_ROOT.
'/install/doctemplates/eventorganization/template_conferenceorbooths.odt';
458 $dirodt = DOL_DATA_ROOT.
'/doctemplates/eventorganization';
459 $dest = $dirodt.
'/template_conferenceorbooths.odt';
461 if (file_exists($src) && !file_exists($dest)) {
462 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
464 $result =
dol_copy($src, $dest, 0, 0);
466 $langs->load(
"errors");
467 $this->error = $langs->trans(
'ErrorFailToCopyFile', $src, $dest);
473 "DELETE FROM ".MAIN_DB_PREFIX.
"document_model WHERE nom = 'standard_".strtolower($myTmpObjectKey).
"' AND type = '".$this->db->escape(strtolower($myTmpObjectKey)).
"' AND entity = ".((
int) $conf->entity),
474 "INSERT INTO ".MAIN_DB_PREFIX.
"document_model (nom, type, entity) VALUES('standard_".strtolower($myTmpObjectKey).
"','".$this->db->escape(strtolower($myTmpObjectKey)).
"',".((
int) $conf->entity).
")",
475 "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),
476 "INSERT INTO ".MAIN_DB_PREFIX.
"document_model (nom, type, entity) VALUES('generic_".strtolower($myTmpObjectKey).
"_odt', '".$this->db->escape(strtolower($myTmpObjectKey)).
"', ".((
int) $conf->entity).
")"
485 include_once DOL_DOCUMENT_ROOT.
'/core/class/html.formmail.class.php';
486 $formmail =
new FormMail($this->db);
488 include_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
489 if (!is_object($user)) {
490 $user =
new User($this->db);
493 $template = $formmail->getEMailTemplate($this->db,
'conferenceorbooth', $user, $langs, 0, 1,
'(EventOrganizationEmailAskConf)');
494 if ($template->id > 0) {
495 dolibarr_set_const($this->db,
'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF', $template->id,
'chaine', 0,
'', $conf->entity);
497 $template = $formmail->getEMailTemplate($this->db,
'conferenceorbooth', $user, $langs, 0, 1,
'(EventOrganizationEmailAskBooth)');
498 if ($template->id > 0) {
499 dolibarr_set_const($this->db,
'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH', $template->id,
'chaine', 0,
'', $conf->entity);
501 $template = $formmail->getEMailTemplate($this->db,
'conferenceorbooth', $user, $langs, 0, 1,
'(EventOrganizationEmailBoothPayment)');
502 if ($template->id > 0) {
503 dolibarr_set_const($this->db,
'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH', $template->id,
'chaine', 0,
'', $conf->entity);
505 $template = $formmail->getEMailTemplate($this->db,
'conferenceorbooth', $user, $langs, 0, 1,
'(EventOrganizationEmailRegistrationPayment)');
506 if ($template->id > 0) {
507 dolibarr_set_const($this->db,
'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT', $template->id,
'chaine', 0,
'', $conf->entity);
521 public function remove($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.
Class to manage Dolibarr users.
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.
if(isModEnabled('invoice') && $user->hasRight('facture', 'lire')) if((isModEnabled('fournisseur') &&!getDolGlobalString('MAIN_USE_NEW_SUPPLIERMOD') && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') && $user->hasRight('don', 'lire')) if(isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')) if(isModEnabled('invoice') &&isModEnabled('order') && $user->hasRight("commande", "lire") &&!getDolGlobalString('WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER')) $sql
Social contributions to pay.
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, $testvirus=0, $indexdatabase=0)
Copy a file to another file.
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_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.