28require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobject.class.php';
40 public $module =
'eventorganization';
45 public $element =
'conferenceorboothattendee';
50 public $table_element =
'eventorganization_conferenceorboothattendee';
55 public $picto =
'contact';
59 const STATUS_DRAFT = 0;
60 const STATUS_VALIDATED = 1;
61 const STATUS_CANCELED = 9;
94 public $fields = array(
95 'rowid' => array(
'type' =>
'integer',
'label' =>
'TechnicalID',
'enabled' => 1,
'position' => 1,
'notnull' => 1,
'visible' => 0,
'noteditable' => 1,
'index' => 1,
'css' =>
'left',
'comment' =>
"Id"),
96 'ref' => array(
'type' =>
'varchar(128)',
'label' =>
'Ref',
'enabled' => 1,
'position' => 10,
'notnull' => 1,
'visible' => 2,
'index' => 1,
'comment' =>
"Reference of object"),
98 'fk_project' => array(
'type' =>
'integer:Project:projet/class/project.class.php:1',
'label' =>
'Project',
'enabled' =>
"isModEnabled('project')",
'position' => 20,
'notnull' => 1,
'visible' => 0,
'index' => 1,
'picto' =>
'project',
'css' =>
'maxwidth500 widthcentpercentminusxx',
'csslist' =>
'tdoverflowmax150'),
99 'email' => array(
'type' =>
'mail',
'label' =>
'EmailAttendee',
'enabled' => 1,
'position' => 30,
'notnull' => 1,
'visible' => 1,
'index' => 1,
'autofocusoncreate' => 1,
'searchall' => 1,
'csslist' =>
'tdoverflowmax150'),
100 'firstname' => array(
'type' =>
'varchar(100)',
'label' =>
'Firstname',
'enabled' => 1,
'position' => 31,
'notnull' => 0,
'visible' => 1,
'index' => 1,
'searchall' => 1,
'csslist' =>
'tdoverflowmax125'),
101 'lastname' => array(
'type' =>
'varchar(100)',
'label' =>
'Lastname',
'enabled' => 1,
'position' => 32,
'notnull' => 0,
'visible' => 1,
'index' => 1,
'searchall' => 1,
'csslist' =>
'tdoverflowmax125'),
102 'fk_soc' => array(
'type' =>
'integer:Societe:societe/class/societe.class.php:1:((status:=:1) AND (entity:IN:__SHARED_ENTITIES__))',
'label' =>
'ThirdParty',
'enabled' =>
'isModEnabled("societe")',
'position' => 40,
'notnull' => -1,
'visible' => 1,
'index' => 1,
'help' =>
"OrganizationEventLinkToThirdParty",
'picto' =>
'company',
'css' =>
'maxwidth500 widthcentpercentminusxx',
'csslist' =>
'tdoverflowmax150'),
103 'email_company' => array(
'type' =>
'mail',
'label' =>
'EmailCompany',
'enabled' => 1,
'position' => 41,
'notnull' => 0,
'visible' => -2,
'searchall' => 1),
104 'date_subscription' => array(
'type' =>
'datetime',
'label' =>
'DateOfRegistration',
'enabled' => 1,
'position' => 56,
'notnull' => 1,
'visible' => 1,
'showoncombobox' => 1,),
105 'fk_invoice' => array(
'type' =>
'integer:Facture:compta/facture/class/facture.class.php',
'label' =>
'Invoice',
'enabled' =>
'isModEnabled("invoice")',
'position' => 57,
'notnull' => 0,
'visible' => 1,
'index' => 0,
'picto' =>
'bill',
'css' =>
'maxwidth500 widthcentpercentminusxx',
'csslist' =>
'tdoverflowmax150'),
106 'amount' => array(
'type' =>
'price',
'label' =>
'AmountPaid',
'enabled' => 1,
'position' => 57,
'notnull' => 0,
'visible' => 1,
'default' =>
'null',
'isameasure' => 1,
'help' =>
"AmountOfRegistrationPaid",),
107 'note_public' => array(
'type' =>
'html',
'label' =>
'NotePublic',
'enabled' => 1,
'position' => 61,
'notnull' => 0,
'visible' => 3,),
108 'note_private' => array(
'type' =>
'html',
'label' =>
'NotePrivate',
'enabled' => 1,
'position' => 62,
'notnull' => 0,
'visible' => 3,),
109 'date_creation' => array(
'type' =>
'datetime',
'label' =>
'DateCreation',
'enabled' => 1,
'position' => 500,
'notnull' => 1,
'visible' => -2,
'css' =>
'nowraponall'),
110 'tms' => array(
'type' =>
'timestamp',
'label' =>
'DateModification',
'enabled' => 1,
'position' => 501,
'notnull' => 0,
'visible' => -2,),
111 'fk_user_creat' => array(
'type' =>
'integer:User:user/class/user.class.php',
'label' =>
'UserAuthor',
'enabled' => 1,
'position' => 510,
'notnull' => -1,
'visible' => -2),
112 'fk_user_modif' => array(
'type' =>
'integer:User:user/class/user.class.php',
'label' =>
'UserModif',
'enabled' => 1,
'position' => 511,
'notnull' => -1,
'visible' => -2,),
113 'last_main_doc' => array(
'type' =>
'varchar(255)',
'label' =>
'LastMainDoc',
'enabled' => 1,
'position' => 600,
'notnull' => 0,
'visible' => 0,),
114 'import_key' => array(
'type' =>
'varchar(14)',
'label' =>
'ImportId',
'enabled' => 1,
'position' => 1000,
'notnull' => -1,
'visible' => -2,),
115 'model_pdf' => array(
'type' =>
'varchar(255)',
'label' =>
'Model pdf',
'enabled' => 1,
'position' => 1010,
'notnull' => -1,
'visible' => 0,),
116 'ip' => array(
'type' =>
'varchar(250)',
'label' =>
'IPAddress',
'enabled' => 1,
'position' => 900,
'notnull' => -1,
'visible' => -2,),
117 'status' => array(
'type' =>
'smallint',
'label' =>
'Status',
'enabled' => 1,
'position' => 1000,
'default' =>
'0',
'notnull' => 1,
'visible' => 1,
'index' => 1,
'arrayofkeyval' => array(
'0' =>
'Draft',
'1' =>
'Validated',
'9' =>
'Canceled'),),
121 public $fk_actioncomm;
127 public $email_company;
128 public $date_subscription;
132 public $note_private;
133 public $date_creation;
134 public $fk_user_creat;
135 public $fk_user_modif;
136 public $last_main_doc;
186 global $conf, $langs;
190 $this->ismultientitymanaged =
'fk_project@projet';
191 $this->isextrafieldmanaged = 1;
194 $this->fields[
'rowid'][
'visible'] = 0;
196 if (!isModEnabled(
'multicompany') && isset($this->fields[
'entity'])) {
197 $this->fields[
'entity'][
'enabled'] = 0;
201 $this->fields[
'fk_soc'][
'type'] .=
' AND rowid IN (SELECT DISTINCT c.fk_soc FROM '.MAIN_DB_PREFIX.
'categorie_societe as c WHERE c.fk_categorie='.(int) $conf->global->EVENTORGANIZATION_FILTERATTENDEES_CAT.
')';
203 if (isset($conf->global->EVENTORGANIZATION_FILTERATTENDEES_TYPE)
206 $this->fields[
'fk_soc'][
'type'] .=
' AND client = '.((int)
getDolGlobalInt(
'EVENTORGANIZATION_FILTERATTENDEES_TYPE', 0));
216 foreach ($this->fields as $key => $val) {
217 if (isset($val[
'enabled']) && empty($val[
'enabled'])) {
218 unset($this->fields[$key]);
223 if (is_object($langs)) {
224 foreach ($this->fields as $key => $val) {
225 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
226 foreach ($val[
'arrayofkeyval'] as $key2 => $val2) {
227 $this->fields[$key][
'arrayofkeyval'][$key2] = $langs->trans($val2);
246 $langs->load(
"errors");
247 $this->errors[] = $langs->trans(
"ErrorBadEMail", $this->email);
253 $result = $this->
fetch($result);
255 $this->
ref = (string) $this->
id;
256 $result = $this->
update($user);
271 global $langs, $extrafields;
281 $result =
$object->fetchCommon($fromid);
282 if ($result > 0 && !empty(
$object->table_element_line)) {
296 if (property_exists(
$object,
'ref')) {
297 $object->ref = empty($this->fields[
'ref'][
'default']) ?
"(PROV)" : $this->fields[
'ref'][
'default'];
299 if (property_exists(
$object,
'label')) {
300 $object->label = empty($this->fields[
'label'][
'default']) ? $langs->trans(
"CopyOf").
" ".
$object->label : $this->fields[
'label'][
'default'];
302 if (property_exists(
$object,
'status')) {
303 $object->status = self::STATUS_DRAFT;
305 if (property_exists(
$object,
'date_creation')) {
308 if (property_exists(
$object,
'date_modification')) {
309 $object->date_modification =
null;
313 if (is_array(
$object->array_options) && count(
$object->array_options) > 0) {
314 $extrafields->fetch_name_optionals_label($this->table_element);
315 foreach (
$object->array_options as $key => $option) {
316 $shortkey = preg_replace(
'/options_/',
'', $key);
317 if (!empty($extrafields->attributes[$this->table_element][
'unique'][$shortkey])) {
320 unset(
$object->array_options[$key]);
326 $object->context[
'createfromclone'] =
'createfromclone';
327 $result =
$object->createCommon($user);
333 $result =
$object->update($user);
345 if (property_exists($this,
'fk_soc') && $this->fk_soc ==
$object->socid) {
352 unset(
$object->context[
'createfromclone']);
359 $this->db->rollback();
371 public function fetch($id, $ref =
null)
374 if ($result > 0 && !empty($this->table_element_line)) {
387 $this->lines = array();
406 public function fetchAll($sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, $filter =
'', $filtermode =
'AND')
414 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
415 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"actioncomm as a on a.id = t.fk_actioncomm";
416 if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
417 $sql .=
' WHERE t.entity IN ('.getEntity($this->element).
')';
419 $sql .=
' WHERE 1 = 1';
423 if (is_array($filter)) {
424 dol_syslog(
"You are using a deprecated use of fetchAll. filter parameter mus be an USF string now.", LOG_WARNING);
426 if (count($filter) > 0) {
427 foreach ($filter as $key => $value) {
428 if ($key ==
't.rowid' || $key ==
't.fk_soc' || $key ==
't.fk_project' || $key ==
't.fk_actioncomm') {
429 $sqlwhere[] = $key.
'='.((int) $value);
430 } elseif (in_array($this->fields[$key][
'type'], array(
'date',
'datetime',
'timestamp'))) {
431 $sqlwhere[] = $key.
" = '".$this->db->idate($value).
"'";
432 } elseif ($key ==
'customsql') {
433 $sqlwhere[] = $value;
434 } elseif (strpos($value,
'%') ===
false) {
435 $sqlwhere[] = $key.
' IN ('.$this->db->sanitize($this->db->escape($value)).
')';
437 $sqlwhere[] = $key.
" LIKE '%".$this->db->escape($value).
"%'";
441 if (count($sqlwhere) > 0) {
442 $sql .=
' AND ('.implode(
' '.$this->db->escape($filtermode).
' ', $sqlwhere).
')';
452 $this->errors[] = $errormessage;
453 dol_syslog(__METHOD__.
' '.implode(
',', $this->errors), LOG_ERR);
457 if (!empty($sortfield)) {
458 $sql .= $this->db->order($sortfield, $sortorder);
460 if (!empty($limit)) {
461 $sql .= $this->db->plimit($limit, $offset);
464 $resql = $this->db->query($sql);
466 $num = $this->db->num_rows($resql);
468 while ($i < ($limit ? min($limit, $num) : $num)) {
469 $obj = $this->db->fetch_object($resql);
471 $record =
new self($this->db);
472 $record->setVarsFromFetchObj($obj);
474 $records[$record->id] = $record;
478 $this->db->free($resql);
482 $this->errors[] =
'Error '.$this->db->lasterror();
483 dol_syslog(__METHOD__.
' '.implode(
',', $this->errors), LOG_ERR);
508 public function delete(
User $user, $notrigger = 0)
525 $this->error =
'ErrorDeleteLineNotAllowedByObjectStatus';
544 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
549 if ($this->
status == self::STATUS_VALIDATED) {
550 dol_syslog(get_class($this).
"::validate action abandoned: already validated", LOG_WARNING);
559 if (!$error && (preg_match(
'/^[\(]?PROV/i', $this->
ref) || empty($this->
ref))) {
564 $this->newref = $num;
568 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
569 $sql .=
" SET ref = '".$this->db->escape($num).
"',";
570 $sql .=
" status = ".self::STATUS_VALIDATED;
571 if (!empty($this->fields[
'date_validation'])) {
572 $sql .=
", date_validation = '".$this->db->idate($now).
"'";
574 if (!empty($this->fields[
'fk_user_valid'])) {
575 $sql .=
", fk_user_valid = ".$user->id;
577 $sql .=
" WHERE rowid = ".((int) $this->
id);
579 dol_syslog(get_class($this).
"::validate()", LOG_DEBUG);
580 $resql = $this->db->query($sql);
583 $this->error = $this->db->lasterror();
587 if (!$error && !$notrigger) {
589 $result = $this->
call_trigger(
'CONFERENCEORBOOTHATTENDEE_VALIDATE', $user);
598 $this->oldref = $this->ref;
601 if (preg_match(
'/^[\(]?PROV/i', $this->
ref)) {
603 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"ecm_files set filename = CONCAT('".$this->db->escape($this->newref).
"', SUBSTR(filename, ".(strlen($this->
ref) + 1).
")), filepath = 'conferenceorboothattendee/".$this->db->escape($this->newref).
"'";
604 $sql .=
" WHERE filename LIKE '".$this->db->escape($this->
ref).
"%' AND filepath = 'conferenceorboothattendee/".$this->db->escape($this->
ref).
"' and entity = ".$conf->entity;
605 $resql = $this->db->query($sql);
608 $this->error = $this->db->lasterror();
610 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"ecm_files set filepath = 'conferenceorboothattendee/".$this->db->escape($this->newref).
"'";
611 $sql .=
" WHERE filepath = 'conferenceorboothattendee/".$this->db->escape($this->
ref).
"' and entity = ".$conf->entity;
612 $resql = $this->db->query($sql);
615 $this->error = $this->db->lasterror();
621 $dirsource = $conf->eventorganization->dir_output.
'/conferenceorboothattendee/'.$oldref;
622 $dirdest = $conf->eventorganization->dir_output.
'/conferenceorboothattendee/'.$newref;
623 if (!$error && file_exists($dirsource)) {
624 dol_syslog(get_class($this).
"::validate() rename dir ".$dirsource.
" into ".$dirdest);
626 if (@rename($dirsource, $dirdest)) {
629 $listoffiles =
dol_dir_list($conf->eventorganization->dir_output.
'/conferenceorboothattendee/'.$newref,
'files', 1,
'^'.preg_quote($oldref,
'/'));
630 foreach ($listoffiles as $fileentry) {
631 $dirsource = $fileentry[
'name'];
632 $dirdest = preg_replace(
'/^'.preg_quote($oldref,
'/').
'/', $newref, $dirsource);
633 $dirsource = $fileentry[
'path'].
'/'.$dirsource;
634 $dirdest = $fileentry[
'path'].
'/'.$dirdest;
635 @rename($dirsource, $dirdest);
645 $this->
status = self::STATUS_VALIDATED;
652 $this->db->rollback();
666 include_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
668 if (empty($this->fk_project) && !empty($this->fk_projet)) {
669 $this->fk_project = $this->fk_projet;
671 if (empty($this->fk_project)) {
675 $project =
new Project($this->db);
676 $result = $project->fetch($this->fk_project);
678 $this->projet = $project;
679 $this->project = $project;
693 if ($this->
status <= self::STATUS_DRAFT) {
697 return $this->
setStatusCommon($user, self::STATUS_DRAFT, $notrigger,
'CONFERENCEORBOOTHATTENDEE_UNVALIDATE');
707 public function cancel($user, $notrigger = 0)
710 if ($this->
status != self::STATUS_VALIDATED) {
714 return $this->
setStatusCommon($user, self::STATUS_CANCELED, $notrigger,
'CONFERENCEORBOOTHATTENDEE_CANCEL');
724 public function reopen($user, $notrigger = 0)
727 if ($this->
status != self::STATUS_CANCELED) {
731 return $this->
setStatusCommon($user, self::STATUS_VALIDATED, $notrigger,
'CONFERENCEORBOOTHATTENDEE_REOPEN');
744 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
746 global $conf, $langs, $hookmanager;
748 if (!empty($conf->dol_no_mouse_hover)) {
754 $label =
img_picto(
'', $this->picto).
' <u>'.$langs->trans(
"ConferenceOrBoothAttendee").
'</u>';
755 if (isset($this->
status)) {
756 $label .=
' '.$this->getLibStatut(5);
759 $label .=
'<b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
760 $label .=
'<br><b>'.$langs->trans(
'DateOfRegistration').
':</b> '.
dol_print_date($this->date_subscription,
'dayhour');
761 $label .=
'<br><b>'.$langs->trans(
'AmountPaid').
':</b> '.$this->amount;
763 $url = DOL_URL_ROOT.
'/eventorganization/conferenceorboothattendee_card.php?id='.$this->id;
765 if ($option !=
'nolink') {
767 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
768 if ($save_lastsearch_value == -1 && isset($_SERVER[
"PHP_SELF"]) && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
769 $add_save_lastsearch_values = 1;
771 if ($add_save_lastsearch_values) {
772 $url .=
'&save_lastsearch_values=1';
775 if ($option ==
'conforboothid') {
776 $url .=
'&conforboothid='.((int) $this->fk_actioncomm);
779 if ($option ==
'projectid') {
780 $url .=
'&fk_project='.((int) $this->fk_project).
'&withproject=1';
783 if ($option ==
'conforboothidproject') {
784 $url .=
'&conforboothid='.((int) $this->fk_actioncomm).
'&withproject=1';
789 if (empty($notooltip)) {
791 $label = $langs->trans(
"ShowConferenceOrBoothAttendee");
792 $linkclose .=
' alt="'.dol_escape_htmltag($label, 1).
'"';
794 $linkclose .=
' title="'.dol_escape_htmltag($label, 1).
'"';
795 $linkclose .=
' class="classfortooltip'.($morecss ?
' '.$morecss :
'').
'"';
797 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
800 if ($option ==
'nolink') {
801 $linkstart =
'<span';
803 $linkstart =
'<a href="'.$url.
'"';
805 $linkstart .= $linkclose.
'>';
806 if ($option ==
'nolink') {
807 $linkend =
'</span>';
812 $result .= $linkstart;
814 if (empty($this->showphoto_on_popup)) {
816 $result .=
img_object(($notooltip ?
'' : $label), ($this->picto ? $this->picto :
'generic'), ($notooltip ? (($withpicto != 2) ?
'class="paddingright"' :
'') :
'class="'.(($withpicto != 2) ?
'paddingright ' :
'').
'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
820 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
822 list($class, $module) = explode(
'@', $this->picto);
825 $filename = $filearray[0][
'name'];
826 if (!empty($filename)) {
827 $pospoint = strpos($filearray[0][
'name'],
'.');
829 $pathtophoto = $class.
'/'.$this->
ref.
'/thumbs/'.substr($filename, 0, $pospoint).
'_mini'.substr($filename, $pospoint);
831 $result .=
'<div class="floatleft inline-block valignmiddle divphotoref"><div class="photoref"><img class="photo'.$module.
'" alt="No photo" border="0" src="'.DOL_URL_ROOT.
'/viewimage.php?modulepart='.$module.
'&entity='.$conf->entity.
'&file='.urlencode($pathtophoto).
'"></div></div>';
833 $result .=
'<div class="floatleft inline-block valignmiddle divphotoref"><img class="photouserphoto userphoto" alt="No photo" border="0" src="'.DOL_URL_ROOT.
'/viewimage.php?modulepart='.$module.
'&entity='.$conf->entity.
'&file='.urlencode($pathtophoto).
'"></div>';
838 $result .=
img_object(($notooltip ?
'' : $label), ($this->picto ? $this->picto :
'generic'), ($notooltip ? (($withpicto != 2) ?
'class="paddingright"' :
'') :
'class="'.(($withpicto != 2) ?
'paddingright ' :
'').
'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
843 if ($withpicto != 2) {
844 $result .= $this->ref;
850 global $action, $hookmanager;
851 $hookmanager->initHooks(array(
'conferenceorboothattendeedao'));
852 $parameters = array(
'id' => $this->
id,
'getnomurl' => &$result);
853 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
855 $result = $hookmanager->resPrint;
857 $result .= $hookmanager->resPrint;
898 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
900 $this->labelStatus[self::STATUS_DRAFT] = $langs->trans(
'Draft');
901 $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans(
'Validated');
902 $this->labelStatus[self::STATUS_CANCELED] = $langs->trans(
'Disabled');
903 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans(
'Draft');
904 $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans(
'Validated');
905 $this->labelStatusShort[self::STATUS_CANCELED] = $langs->trans(
'Disabled');
908 $statusType =
'status'.$status;
910 if ($status == self::STATUS_CANCELED) {
911 $statusType =
'status6';
914 if ($status == self::STATUS_VALIDATED && $this->date_subscription && $this->amount) {
915 $statusType =
'status4';
916 $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans(
'Validated').
' - '.$langs->trans(
"Paid");
919 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
930 $sql =
'SELECT rowid, date_creation as datec, tms as datem,';
931 $sql .=
' fk_user_creat, fk_user_modif';
932 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
933 $sql .=
' WHERE t.rowid = '.((int) $id);
934 $result = $this->db->query($sql);
936 if ($this->db->num_rows($result)) {
937 $obj = $this->db->fetch_object($result);
939 $this->
id = $obj->rowid;
941 $this->user_creation_id = $obj->fk_user_creat;
942 $this->user_modification_id = $obj->fk_user_modif;
943 $this->date_creation = $this->db->jdate($obj->datec);
944 $this->date_modification = empty($obj->datem) ?
'' : $this->db->jdate($obj->datem);
947 $this->db->free($result);
971 global $langs, $conf;
972 $langs->load(
"eventorganization@eventorganization");
975 $conf->global->EVENTORGANIZATION_CONFERENCEORBOOTHATTENDEE_ADDON =
'mod_conferenceorboothattendee_standard';
981 $file =
getDolGlobalString(
'EVENTORGANIZATION_CONFERENCEORBOOTHATTENDEE_ADDON') .
".php";
985 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
986 foreach ($dirmodels as $reldir) {
987 $dir =
dol_buildpath($reldir.
"core/modules/eventorganization/");
990 $mybool = ((bool) @include_once $dir.$file) || $mybool;
993 if ($mybool ===
false) {
998 if (class_exists($classname)) {
999 $obj =
new $classname();
1000 $numref = $obj->getNextValue($this);
1002 if ($numref !=
'' && $numref !=
'-1') {
1005 $this->error = $obj->error;
1010 print $langs->trans(
"Error").
" ".$langs->trans(
"ClassNotFound").
' '.$classname;
1014 print $langs->trans(
"ErrorNumberingModuleNotSetup", $this->element);
1030 public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams =
null)
1032 global $conf, $langs;
1035 $includedocgeneration = 0;
1037 $langs->load(
"eventorganization@eventorganization");
1040 $modele =
'standard_conferenceorboothattendee';
1042 if (!empty($this->model_pdf)) {
1043 $modele = $this->model_pdf;
1049 $modelpath =
"core/modules/eventorganization/doc/";
1051 if ($includedocgeneration && !empty($modele)) {
1052 $result = $this->
commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
1067 global $conf, $langs;
1083 $this->db->commit();
1099 'eventorganization_conferenceorboothattendee'
1114 public function getFullName($langs, $option = 0, $nameorder = -1, $maxlen = 0)
1116 $lastname = $this->lastname;
1117 $firstname = $this->firstname;
1118 if (empty($lastname)) {
1119 $lastname = (isset($this->lastname) ? $this->lastname : (isset($this->
name) ? $this->
name : (isset($this->nom) ? $this->nom : (isset($this->societe) ? $this->societe : (isset($this->company) ? $this->company :
'')))));
1131require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobjectline.class.php';
1150 $this->isextrafieldmanaged = 0;
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
print $langs trans("AuditedSecurityEvents").'</strong >< span class="opacitymedium"></span >< br > status
Or an array listing all the potential status of the object: array: int of the status => translated la...
Parent class of all other business classes (invoices, contracts, proposals, orders,...
deleteLineCommon(User $user, $idline, $notrigger=0)
Delete a line of object in database.
commonGenerateDocument($modelspath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams=null)
Common function for all objects extending CommonObject for generating documents.
setErrorsFromObject($object)
setErrorsFromObject
createCommon(User $user, $notrigger=0)
Create object in the database.
getFieldList($alias='', $excludefields=array())
Function to concat keys of fields.
updateCommon(User $user, $notrigger=0)
Update object into database.
setStatusCommon($user, $status, $notrigger=0, $triggercode='')
Set to a status.
initAsSpecimenCommon()
Initialise object with example values Id must be 0 if object instance is a specimen.
copy_linked_contact($objFrom, $source='internal')
Copy contact from one element to current.
static commonReplaceThirdparty(DoliDB $dbs, $origin_id, $dest_id, array $tables, $ignoreerrors=0)
Function used to replace a thirdparty id with another one.
fetchLinesCommon($morewhere='', $noextrafields=0)
Load object in memory from the database.
fetchCommon($id, $ref=null, $morewhere='', $noextrafields=0)
Load object in memory from the database.
deleteCommon(User $user, $notrigger=0, $forcechilddeletion=0)
Delete object in database.
call_trigger($triggerName, $user)
Call trigger based on this instance.
Parent class for class inheritance lines of business objects This class is useless for the moment so ...
Class for ConferenceOrBoothAttendee.
cancel($user, $notrigger=0)
Set cancel status.
createFromClone(User $user, $fromid)
Clone an object into another one.
getLibStatut($mode=0)
Return the label of the status.
info($id)
Load the info information in the object.
fetch($id, $ref=null)
Load object in memory from the database.
getLabelStatus($mode=0)
Return the label of the status.
create(User $user, $notrigger=0)
Create object into database.
fetchLines()
Load object lines in memory from the database.
initAsSpecimen()
Initialise object with example values Id must be 0 if object instance is a specimen.
getNomUrl($withpicto=0, $option='', $notooltip=0, $morecss='', $save_lastsearch_value=-1)
Return a link to the object card (with optionally the picto)
LibStatut($status, $mode=0)
Return the status.
static replaceThirdparty(DoliDB $dbs, $origin_id, $dest_id)
Function used to replace a thirdparty id with another one.
fetch_projet()
Load the project with id $this->fk_project into this->project.
getFullName($langs, $option=0, $nameorder=-1, $maxlen=0)
Return full name ('name+' '+lastname)
__construct(DoliDB $db)
Constructor.
generateDocument($modele, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
Create a document onto disk according to template module.
deleteLine(User $user, $idline, $notrigger=0)
Delete a line of object in database.
update(User $user, $notrigger=0)
Update object into database.
doScheduledJob()
Action executed by scheduler CAN BE A CRON TASK.
reopen($user, $notrigger=0)
Set back to validated status.
fetchAll($sortorder='', $sortfield='', $limit=0, $offset=0, $filter='', $filtermode='AND')
Load list of objects in memory from the database.
getNextNumRef()
Returns the reference to the following non used object depending on the active numbering module.
setDraft($user, $notrigger=0)
Set draft status.
validate($user, $notrigger=0)
Validate object.
Class ConferenceOrBoothAttendeeLine.
__construct(DoliDB $db)
Constructor.
Class to manage Dolibarr database access.
Class to manage projects.
Class to manage Dolibarr users.
dol_dir_list($utf8_path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0, $nbsecondsold=0)
Scan a directory and return a list of files/directories.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
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_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
forgeSQLFromUniversalSearchCriteria($filter, &$errorstr='', $noand=0, $nopar=0, $noerror=0)
forgeSQLFromUniversalSearchCriteria
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dolGetFirstLastname($firstname, $lastname, $nameorder=-1)
Return firstname and lastname in correct order.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
isValidEmail($address, $acceptsupervisorkey=0, $acceptuserkey=0)
Return true if email syntax is ok.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
$conf db name
Only used if Module[ID]Name translation string is not found.