26require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobject.class.php';
38 public $module =
'eventorganization';
43 public $element =
'conferenceorboothattendee';
48 public $table_element =
'eventorganization_conferenceorboothattendee';
54 public $ismultientitymanaged =
'fk_project@projet';
59 public $isextrafieldmanaged = 1;
64 public $picto =
'contact';
68 const STATUS_DRAFT = 0;
69 const STATUS_VALIDATED = 1;
70 const STATUS_CANCELED = 9;
103 public $fields = array(
104 'rowid' => array(
'type'=>
'integer',
'label'=>
'TechnicalID',
'enabled'=>
'1',
'position'=>1,
'notnull'=>1,
'visible'=>0,
'noteditable'=>
'1',
'index'=>1,
'css'=>
'left',
'comment'=>
"Id"),
105 'ref' => array(
'type'=>
'varchar(128)',
'label'=>
'Ref',
'enabled'=>
'1',
'position'=>10,
'notnull'=>1,
'visible'=>2,
'index'=>1,
'comment'=>
"Reference of object"),
107 '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'),
108 'email' => array(
'type'=>
'mail',
'label'=>
'EmailAttendee',
'enabled'=>
'1',
'position'=>30,
'notnull'=>1,
'visible'=>1,
'index'=>1,
'autofocusoncreate'=>1,
'searchall'=>1,
'csslist'=>
'tdoverflowmax150'),
109 'firstname' => array(
'type'=>
'varchar(100)',
'label'=>
'Firstname',
'enabled'=>
'1',
'position'=>31,
'notnull'=>0,
'visible'=>1,
'index'=>1,
'searchall'=>1,
'csslist'=>
'tdoverflowmax125'),
110 'lastname' => array(
'type'=>
'varchar(100)',
'label'=>
'Lastname',
'enabled'=>
'1',
'position'=>32,
'notnull'=>0,
'visible'=>1,
'index'=>1,
'searchall'=>1,
'csslist'=>
'tdoverflowmax125'),
111 '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'),
112 'email_company' => array(
'type'=>
'mail',
'label'=>
'EmailCompany',
'enabled'=>
'1',
'position'=>41,
'notnull'=>0,
'visible'=>-2,
'searchall'=>1),
113 'date_subscription' => array(
'type'=>
'datetime',
'label'=>
'DateOfRegistration',
'enabled'=>
'1',
'position'=>56,
'notnull'=>1,
'visible'=>1,
'showoncombobox'=>
'1',),
114 'fk_invoice' => array(
'type'=>
'integer:Facture:compta/facture/class/facture.class.php',
'label'=>
'Invoice',
'enabled'=>
'isModEnabled("facture")',
'position'=>57,
'notnull'=>0,
'visible'=>1,
'index'=>0,
'picto'=>
'bill',
'css'=>
'maxwidth500 widthcentpercentminusxx',
'csslist'=>
'tdoverflowmax150'),
115 'amount' => array(
'type'=>
'price',
'label'=>
'AmountPaid',
'enabled'=>
'1',
'position'=>57,
'notnull'=>0,
'visible'=>1,
'default'=>
'null',
'isameasure'=>
'1',
'help'=>
"AmountOfRegistrationPaid",),
116 'note_public' => array(
'type'=>
'html',
'label'=>
'NotePublic',
'enabled'=>
'1',
'position'=>61,
'notnull'=>0,
'visible'=>3,),
117 'note_private' => array(
'type'=>
'html',
'label'=>
'NotePrivate',
'enabled'=>
'1',
'position'=>62,
'notnull'=>0,
'visible'=>3,),
118 'date_creation' => array(
'type'=>
'datetime',
'label'=>
'DateCreation',
'enabled'=>
'1',
'position'=>500,
'notnull'=>1,
'visible'=>-2,
'css'=>
'nowraponall'),
119 'tms' => array(
'type'=>
'timestamp',
'label'=>
'DateModification',
'enabled'=>
'1',
'position'=>501,
'notnull'=>0,
'visible'=>-2,),
120 'fk_user_creat' => array(
'type'=>
'integer:User:user/class/user.class.php',
'label'=>
'UserAuthor',
'enabled'=>
'1',
'position'=>510,
'notnull'=>-1,
'visible'=>-2),
121 'fk_user_modif' => array(
'type'=>
'integer:User:user/class/user.class.php',
'label'=>
'UserModif',
'enabled'=>
'1',
'position'=>511,
'notnull'=>-1,
'visible'=>-2,),
122 'last_main_doc' => array(
'type'=>
'varchar(255)',
'label'=>
'LastMainDoc',
'enabled'=>
'1',
'position'=>600,
'notnull'=>0,
'visible'=>0,),
123 'import_key' => array(
'type'=>
'varchar(14)',
'label'=>
'ImportId',
'enabled'=>
'1',
'position'=>1000,
'notnull'=>-1,
'visible'=>-2,),
124 'model_pdf' => array(
'type'=>
'varchar(255)',
'label'=>
'Model pdf',
'enabled'=>
'1',
'position'=>1010,
'notnull'=>-1,
'visible'=>0,),
125 'ip' => array(
'type'=>
'varchar(250)',
'label'=>
'IPAddress',
'enabled'=>
'1',
'position'=>900,
'notnull'=>-1,
'visible'=>-2,),
126 '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'),),
130 public $fk_actioncomm;
136 public $email_company;
137 public $date_subscription;
141 public $note_private;
142 public $date_creation;
144 public $fk_user_creat;
145 public $fk_user_modif;
146 public $last_main_doc;
196 global $conf, $langs;
200 if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields[
'rowid'])) {
201 $this->fields[
'rowid'][
'visible'] = 0;
203 if (!isModEnabled(
'multicompany') && isset($this->fields[
'entity'])) {
204 $this->fields[
'entity'][
'enabled'] = 0;
207 if (!empty($conf->global->EVENTORGANIZATION_FILTERATTENDEES_CAT)) {
208 $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.
')';
210 if (isset($conf->global->EVENTORGANIZATION_FILTERATTENDEES_TYPE)
211 && $conf->global->EVENTORGANIZATION_FILTERATTENDEES_TYPE !==
''
212 && $conf->global->EVENTORGANIZATION_FILTERATTENDEES_TYPE !==
'-1') {
213 $this->fields[
'fk_soc'][
'type'] .=
' AND client = '.(int) $conf->global->EVENTORGANIZATION_FILTERATTENDEES_TYPE;
223 foreach ($this->fields as $key => $val) {
224 if (isset($val[
'enabled']) && empty($val[
'enabled'])) {
225 unset($this->fields[$key]);
230 if (is_object($langs)) {
231 foreach ($this->fields as $key => $val) {
232 if (!empty($val[
'arrayofkeyval']) && is_array($val[
'arrayofkeyval'])) {
233 foreach ($val[
'arrayofkeyval'] as $key2 => $val2) {
234 $this->fields[$key][
'arrayofkeyval'][$key2] = $langs->trans($val2);
252 if (!isValidEMail($this->email)) {
253 $langs->load(
"errors");
254 $this->errors[] = $langs->trans(
"ErrorBadEMail", $this->email);
260 $result = $this->
fetch($result);
262 $this->
ref = $this->id;
263 $result = $this->
update($user);
278 global $langs, $extrafields;
283 $object =
new self($this->db);
288 $result = $object->fetchCommon($fromid);
289 if ($result > 0 && !empty($object->table_element_line)) {
290 $object->fetchLines();
299 unset($object->fk_user_creat);
300 unset($object->import_key);
303 if (property_exists($object,
'ref')) {
304 $object->ref = empty($this->fields[
'ref'][
'default']) ?
"(PROV)" : $this->fields[
'ref'][
'default'];
306 if (property_exists($object,
'label')) {
307 $object->label = empty($this->fields[
'label'][
'default']) ? $langs->trans(
"CopyOf").
" ".$object->label : $this->fields[
'label'][
'default'];
309 if (property_exists($object,
'status')) {
310 $object->status = self::STATUS_DRAFT;
312 if (property_exists($object,
'date_creation')) {
313 $object->date_creation =
dol_now();
315 if (property_exists($object,
'date_modification')) {
316 $object->date_modification =
null;
320 if (is_array($object->array_options) && count($object->array_options) > 0) {
321 $extrafields->fetch_name_optionals_label($this->table_element);
322 foreach ($object->array_options as $key => $option) {
323 $shortkey = preg_replace(
'/options_/',
'', $key);
324 if (!empty($extrafields->attributes[$this->table_element][
'unique'][$shortkey])) {
327 unset($object->array_options[$key]);
333 $object->context[
'createfromclone'] =
'createfromclone';
334 $result = $object->createCommon($user);
337 $this->error = $object->error;
338 $this->errors = $object->errors;
340 $object->ref = $object->id;
341 $result = $object->update($user);
353 if (property_exists($this,
'fk_soc') && $this->fk_soc == $object->socid) {
360 unset($object->context[
'createfromclone']);
367 $this->db->rollback();
379 public function fetch($id, $ref =
null)
382 if ($result > 0 && !empty($this->table_element_line)) {
395 $this->lines = array();
413 public function fetchAll($sortorder =
'', $sortfield =
'', $limit = 0, $offset = 0, array $filter = array(), $filtermode =
'AND')
423 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
424 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"actioncomm as a on a.id = t.fk_actioncomm";
425 if (isset($this->ismultientitymanaged) && $this->ismultientitymanaged == 1) {
426 $sql .=
' WHERE t.entity IN ('.getEntity($this->element).
')';
428 $sql .=
' WHERE 1 = 1';
432 if (count($filter) > 0) {
433 foreach ($filter as $key => $value) {
434 if ($key ==
't.rowid' || $key ==
't.fk_soc' || $key ==
't.fk_project' || $key ==
't.fk_actioncomm') {
435 $sqlwhere[] = $key.
'='.((int) $value);
436 } elseif (in_array($this->fields[$key][
'type'], array(
'date',
'datetime',
'timestamp'))) {
437 $sqlwhere[] = $key.
" = '".$this->db->idate($value).
"'";
438 } elseif ($key ==
'customsql') {
439 $sqlwhere[] = $value;
440 } elseif (strpos($value,
'%') ===
false) {
441 $sqlwhere[] = $key.
' IN ('.$this->db->sanitize($this->db->escape($value)).
')';
443 $sqlwhere[] = $key.
" LIKE '%".$this->db->escape($value).
"%'";
447 if (count($sqlwhere) > 0) {
448 $sql .=
' AND ('.implode(
' '.$this->db->escape($filtermode).
' ', $sqlwhere).
')';
451 if (!empty($sortfield)) {
452 $sql .= $this->db->order($sortfield, $sortorder);
454 if (!empty($limit)) {
455 $sql .= $this->db->plimit($limit, $offset);
458 $resql = $this->db->query($sql);
460 $num = $this->db->num_rows($resql);
462 while ($i < ($limit ? min($limit, $num) : $num)) {
463 $obj = $this->db->fetch_object($resql);
465 $record =
new self($this->db);
466 $record->setVarsFromFetchObj($obj);
468 $records[$record->id] = $record;
472 $this->db->free($resql);
476 $this->errors[] =
'Error '.$this->db->lasterror();
477 dol_syslog(__METHOD__.
' '.join(
',', $this->errors), LOG_ERR);
502 public function delete(
User $user, $notrigger =
false)
518 if ($this->status < 0) {
519 $this->error =
'ErrorDeleteLineNotAllowedByObjectStatus';
536 global $conf, $langs;
538 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
543 if ($this->status == self::STATUS_VALIDATED) {
544 dol_syslog(get_class($this).
"::validate action abandonned: already validated", LOG_WARNING);
561 if (!$error && (preg_match(
'/^[\(]?PROV/i', $this->
ref) || empty($this->
ref))) {
566 $this->newref = $num;
570 $sql =
"UPDATE ".MAIN_DB_PREFIX.$this->table_element;
571 $sql .=
" SET ref = '".$this->db->escape($num).
"',";
572 $sql .=
" status = ".self::STATUS_VALIDATED;
573 if (!empty($this->fields[
'date_validation'])) {
574 $sql .=
", date_validation = '".$this->db->idate($now).
"'";
576 if (!empty($this->fields[
'fk_user_valid'])) {
577 $sql .=
", fk_user_valid = ".$user->id;
579 $sql .=
" WHERE rowid = ".((int) $this->
id);
581 dol_syslog(get_class($this).
"::validate()", LOG_DEBUG);
582 $resql = $this->db->query($sql);
585 $this->error = $this->db->lasterror();
589 if (!$error && !$notrigger) {
591 $result = $this->
call_trigger(
'CONFERENCEORBOOTHATTENDEE_VALIDATE', $user);
600 $this->oldref = $this->ref;
603 if (preg_match(
'/^[\(]?PROV/i', $this->
ref)) {
605 $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).
"'";
606 $sql .=
" WHERE filename LIKE '".$this->db->escape($this->
ref).
"%' AND filepath = 'conferenceorboothattendee/".$this->db->escape($this->
ref).
"' and entity = ".$conf->entity;
607 $resql = $this->db->query($sql);
609 $error++; $this->error = $this->db->lasterror();
611 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"ecm_files set filepath = 'conferenceorboothattendee/".$this->db->escape($this->newref).
"'";
612 $sql .=
" WHERE filepath = 'conferenceorboothattendee/".$this->db->escape($this->
ref).
"' and entity = ".$conf->entity;
613 $resql = $this->db->query($sql);
615 $error++; $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)) {
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) {
704 return $this->
setStatusCommon($user, self::STATUS_DRAFT, $notrigger,
'CONFERENCEORBOOTHATTENDEE_UNVALIDATE');
714 public function cancel($user, $notrigger = 0)
717 if ($this->status != self::STATUS_VALIDATED) {
728 return $this->
setStatusCommon($user, self::STATUS_CANCELED, $notrigger,
'CONFERENCEORBOOTHATTENDEE_CANCEL');
738 public function reopen($user, $notrigger = 0)
741 if ($this->status != self::STATUS_CANCELED) {
752 return $this->
setStatusCommon($user, self::STATUS_VALIDATED, $notrigger,
'CONFERENCEORBOOTHATTENDEE_REOPEN');
765 public function getNomUrl($withpicto = 0, $option =
'', $notooltip = 0, $morecss =
'', $save_lastsearch_value = -1)
767 global $conf, $langs, $hookmanager;
769 if (!empty($conf->dol_no_mouse_hover)) {
775 $label =
img_picto(
'', $this->picto).
' <u>'.$langs->trans(
"ConferenceOrBoothAttendee").
'</u>';
776 if (isset($this->status)) {
777 $label .=
' '.$this->getLibStatut(5);
780 $label .=
'<b>'.$langs->trans(
'Ref').
':</b> '.$this->ref;
781 $label .=
'<br><b>'.$langs->trans(
'DateOfRegistration').
':</b> '.
dol_print_date($this->date_subscription,
'dayhour');
782 $label .=
'<br><b>'.$langs->trans(
'AmountPaid').
':</b> '.$this->amount;
784 $url = DOL_URL_ROOT.
'/eventorganization/conferenceorboothattendee_card.php?id='.$this->id;
786 if ($option !=
'nolink') {
788 $add_save_lastsearch_values = ($save_lastsearch_value == 1 ? 1 : 0);
789 if ($save_lastsearch_value == -1 && preg_match(
'/list\.php/', $_SERVER[
"PHP_SELF"])) {
790 $add_save_lastsearch_values = 1;
792 if ($add_save_lastsearch_values) {
793 $url .=
'&save_lastsearch_values=1';
796 if ($option ==
'conforboothid') {
797 $url .=
'&conforboothid='.((int) $this->fk_actioncomm);
800 if ($option ==
'projectid') {
801 $url .=
'&fk_project='.((int) $this->fk_project).
'&withproject=1';
804 if ($option ==
'conforboothidproject') {
805 $url .=
'&conforboothid='.((int) $this->fk_actioncomm).
'&withproject=1';
810 if (empty($notooltip)) {
811 if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
812 $label = $langs->trans(
"ShowConferenceOrBoothAttendee");
813 $linkclose .=
' alt="'.dol_escape_htmltag($label, 1).
'"';
815 $linkclose .=
' title="'.dol_escape_htmltag($label, 1).
'"';
816 $linkclose .=
' class="classfortooltip'.($morecss ?
' '.$morecss :
'').
'"';
818 $linkclose = ($morecss ?
' class="'.$morecss.
'"' :
'');
821 if ($option ==
'nolink') {
822 $linkstart =
'<span';
824 $linkstart =
'<a href="'.$url.
'"';
826 $linkstart .= $linkclose.
'>';
827 if ($option ==
'nolink') {
828 $linkend =
'</span>';
833 $result .= $linkstart;
835 if (empty($this->showphoto_on_popup)) {
837 $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);
841 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
843 list($class, $module) = explode(
'@', $this->picto);
846 $filename = $filearray[0][
'name'];
847 if (!empty($filename)) {
848 $pospoint = strpos($filearray[0][
'name'],
'.');
850 $pathtophoto = $class.
'/'.$this->
ref.
'/thumbs/'.substr($filename, 0, $pospoint).
'_mini'.substr($filename, $pospoint);
851 if (empty($conf->global->{strtoupper($module.
'_'.$class).
'_FORMATLISTPHOTOSASUSERS'})) {
852 $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>';
854 $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>';
859 $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);
864 if ($withpicto != 2) {
865 $result .= $this->ref;
871 global $action, $hookmanager;
872 $hookmanager->initHooks(array(
'conferenceorboothattendeedao'));
873 $parameters = array(
'id'=>$this->
id,
'getnomurl' => &$result);
874 $reshook = $hookmanager->executeHooks(
'getNomUrl', $parameters, $this, $action);
876 $result = $hookmanager->resPrint;
878 $result .= $hookmanager->resPrint;
892 return $this->LibStatut($this->status, $mode);
903 return $this->LibStatut($this->status, $mode);
919 if (empty($this->labelStatus) || empty($this->labelStatusShort)) {
921 $this->labelStatus[self::STATUS_DRAFT] = $langs->trans(
'Draft');
922 $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans(
'Validated');
923 $this->labelStatus[self::STATUS_CANCELED] = $langs->trans(
'Disabled');
924 $this->labelStatusShort[self::STATUS_DRAFT] = $langs->trans(
'Draft');
925 $this->labelStatusShort[self::STATUS_VALIDATED] = $langs->trans(
'Validated');
926 $this->labelStatusShort[self::STATUS_CANCELED] = $langs->trans(
'Disabled');
929 $statusType =
'status'.$status;
931 if ($status == self::STATUS_CANCELED) {
932 $statusType =
'status6';
935 if ($status == self::STATUS_VALIDATED && $this->date_subscription && $this->amount) {
936 $statusType =
'status4';
937 $this->labelStatus[self::STATUS_VALIDATED] = $langs->trans(
'Validated').
' - '.$langs->trans(
"Paid");
940 return dolGetStatus($this->labelStatus[$status], $this->labelStatusShort[$status],
'', $statusType, $mode);
951 $sql =
'SELECT rowid, date_creation as datec, tms as datem,';
952 $sql .=
' fk_user_creat, fk_user_modif';
953 $sql .=
' FROM '.MAIN_DB_PREFIX.$this->table_element.
' as t';
954 $sql .=
' WHERE t.rowid = '.((int) $id);
955 $result = $this->db->query($sql);
957 if ($this->db->num_rows($result)) {
958 $obj = $this->db->fetch_object($result);
959 $this->
id = $obj->rowid;
961 $this->user_creation_id = $obj->fk_user_creat;
962 $this->user_modification_id = $obj->fk_user_modif;
963 $this->date_creation = $this->db->jdate($obj->datec);
964 $this->date_modification = empty($obj->datem) ?
'' : $this->db->jdate($obj->datem);
967 $this->db->free($result);
981 $this->initAsSpecimenCommon();
991 global $langs, $conf;
992 $langs->load(
"eventorganization@eventorganization");
994 if (empty($conf->global->EVENTORGANIZATION_CONFERENCEORBOOTHATTENDEE_ADDON)) {
995 $conf->global->EVENTORGANIZATION_CONFERENCEORBOOTHATTENDEE_ADDON =
'mod_conferenceorboothattendee_standard';
998 if (!empty($conf->global->EVENTORGANIZATION_CONFERENCEORBOOTHATTENDEE_ADDON)) {
1001 $file = $conf->global->EVENTORGANIZATION_CONFERENCEORBOOTHATTENDEE_ADDON.
".php";
1002 $classname = $conf->global->EVENTORGANIZATION_CONFERENCEORBOOTHATTENDEE_ADDON;
1005 $dirmodels = array_merge(array(
'/'), (array) $conf->modules_parts[
'models']);
1006 foreach ($dirmodels as $reldir) {
1007 $dir =
dol_buildpath($reldir.
"core/modules/eventorganization/");
1010 $mybool |= @include_once $dir.$file;
1013 if ($mybool ===
false) {
1018 if (class_exists($classname)) {
1019 $obj =
new $classname();
1020 $numref = $obj->getNextValue($this);
1022 if ($numref !=
'' && $numref !=
'-1') {
1025 $this->error = $obj->error;
1030 print $langs->trans(
"Error").
" ".$langs->trans(
"ClassNotFound").
' '.$classname;
1034 print $langs->trans(
"ErrorNumberingModuleNotSetup", $this->element);
1050 public function generateDocument($modele, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0, $moreparams =
null)
1052 global $conf, $langs;
1055 $includedocgeneration = 0;
1057 $langs->load(
"eventorganization@eventorganization");
1060 $modele =
'standard_conferenceorboothattendee';
1062 if (!empty($this->model_pdf)) {
1063 $modele = $this->model_pdf;
1064 } elseif (!empty($conf->global->CONFERENCEORBOOTHATTENDEE_ADDON_PDF)) {
1065 $modele = $conf->global->CONFERENCEORBOOTHATTENDEE_ADDON_PDF;
1069 $modelpath =
"core/modules/eventorganization/doc/";
1071 if ($includedocgeneration && !empty($modele)) {
1072 $result = $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams);
1087 global $conf, $langs;
1103 $this->db->commit();
1119 'eventorganization_conferenceorboothattendee'
1134 public function getFullName($langs, $option = 0, $nameorder = -1, $maxlen = 0)
1136 $lastname = $this->lastname;
1137 $firstname = $this->firstname;
1138 if (empty($lastname)) {
1139 $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 :
'')))));
1151require_once DOL_DOCUMENT_ROOT.
'/core/class/commonobjectline.class.php';
1164 public $isextrafieldmanaged = 0;
Parent class of all other business classes (invoices, contracts, proposals, orders,...
deleteLineCommon(User $user, $idline, $notrigger=false)
Delete a line of object in database.
fetchCommon($id, $ref=null, $morewhere='')
Load object in memory from the database.
createCommon(User $user, $notrigger=false)
Create object into database.
deleteCommon(User $user, $notrigger=false, $forcechilddeletion=0)
Delete object in database.
getFieldList($alias='', $excludefields=array())
Function to concat keys of fields.
setStatusCommon($user, $status, $notrigger=0, $triggercode='')
Set to a status.
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.
updateCommon(User $user, $notrigger=false)
Update object into database.
fetchLinesCommon($morewhere='')
Load object in memory from the 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.
deleteLine(User $user, $idline, $notrigger=false)
Delete a line of object in database.
cancel($user, $notrigger=0)
Set cancel status.
createFromClone(User $user, $fromid)
Clone an object into another one.
update(User $user, $notrigger=false)
Update object into database.
getLibStatut($mode=0)
Return the label of the status.
info($id)
Load the info information in the object.
create(User $user, $notrigger=false)
Create object into database.
fetch($id, $ref=null)
Load object in memory from the database.
getLabelStatus($mode=0)
Return the label of the status.
fetchAll($sortorder='', $sortfield='', $limit=0, $offset=0, array $filter=array(), $filtermode='AND')
Load list of objects in memory from the 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 optionaly 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.
doScheduledJob()
Action executed by scheduler CAN BE A CRON TASK.
reopen($user, $notrigger=0)
Set back to validated status.
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($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.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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_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.
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.