42 public $errors = array();
81 public function select_projects($socid = -1, $selected =
'', $htmlname =
'projectid', $maxlength = 16, $option_only = 0, $show_empty = 1, $discard_closed = 0, $forcefocus = 0, $disabled = 0, $mode = 0, $filterkey =
'', $nooutput = 0, $forceaddid = 0, $morecss =
'', $htmlid =
'', $morefilter =
'')
84 global $langs, $conf, $form;
86 $selected_input_value =
'';
87 if (is_object($selected)) {
88 $selected_input_value = $selected->ref;
89 $selected = $selected->id;
94 if (!empty($conf->use_javascript_ajax) && !empty($conf->global->PROJECT_USE_SEARCH_TO_SELECT)) {
97 if ($selected && empty($selected_input_value)) {
98 require_once DOL_DOCUMENT_ROOT .
'/projet/class/project.class.php';
99 $project =
new Project($this->db);
100 $project->fetch($selected);
101 $selected_input_value = $project->ref;
103 $urloption =
'socid=' . ((int) $socid) .
'&htmlname=' . urlencode($htmlname) .
'&discardclosed=' . ((int) $discard_closed);
104 if ($morefilter ==
'usage_organize_event=1') {
105 $urloption .=
'&usage_organize_event=1';
107 $out .=
'<input type="text" class="minwidth200' . ($morecss ?
' ' . $morecss :
'') .
'" name="search_' . $htmlname .
'" id="search_' . $htmlname .
'" value="' . $selected_input_value .
'"' . $placeholder .
' />';
109 $out .=
ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT .
'/projet/ajax/projects.php', $urloption, $conf->global->PROJECT_USE_SEARCH_TO_SELECT, 0, array());
111 $out .= $this->
select_projects_list($socid, $selected, $htmlname, $maxlength, $option_only, $show_empty, abs($discard_closed), $forcefocus, $disabled, 0, $filterkey, 1, $forceaddid, $htmlid, $morecss, $morefilter);
113 if ($discard_closed > 0) {
115 $out .= $form->textwithpicto(
'', $langs->trans(
"ClosedProjectsAreHidden"));
119 if (empty($nooutput)) {
150 public function select_projects_list($socid = -1, $selected =
'', $htmlname =
'projectid', $maxlength = 24, $option_only = 0, $show_empty = 1, $discard_closed = 0, $forcefocus = 0, $disabled = 0, $mode = 0, $filterkey =
'', $nooutput = 0, $forceaddid = 0, $htmlid =
'', $morecss =
'maxwidth500', $morefilter =
'')
153 global $user, $conf, $langs;
155 require_once DOL_DOCUMENT_ROOT .
'/projet/class/project.class.php';
157 if (empty($htmlid)) {
164 $hideunselectables =
false;
165 if (!empty($conf->global->PROJECT_HIDE_UNSELECTABLES)) {
166 $hideunselectables =
true;
169 $projectsListId =
false;
170 if (empty($user->rights->projet->all->lire)) {
171 $projectstatic =
new Project($this->db);
172 $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1);
176 $sql =
"SELECT p.rowid, p.ref, p.title, p.fk_soc, p.fk_statut, p.public, s.nom as name, s.name_alias";
177 $sql .=
" FROM " . $this->db->prefix() .
"projet as p LEFT JOIN " . $this->db->prefix() .
"societe as s ON s.rowid = p.fk_soc";
178 $sql .=
" WHERE p.entity IN (" .
getEntity(
'project') .
")";
179 if ($projectsListId !==
false) {
180 $sql .=
" AND p.rowid IN (" . $this->db->sanitize($projectsListId) .
")";
183 $sql .=
" AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
186 if (empty($conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY)) {
187 $sql .=
" AND (p.fk_soc=" . ((int) $socid) .
" OR p.fk_soc IS NULL)";
188 } elseif ($conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY !=
'all') {
189 $sql .=
" AND (p.fk_soc IN (" . $this->db->sanitize(((
int) $socid) .
", " . $conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY) .
") OR p.fk_soc IS NULL)";
192 if (!empty($filterkey)) {
196 $sql .=
' AND (' . $this->db->sanitize($morefilter, 0, 1) .
')';
198 $sql .=
" ORDER BY p.ref ASC";
200 $resql = $this->db->query($sql);
202 if (!empty($conf->use_javascript_ajax)) {
203 $morecss .=
' minwidth100';
205 if (empty($option_only)) {
206 $out .=
'<select class="flat' . ($morecss ?
' ' . $morecss :
'') .
'"' . ($disabled ?
' disabled="disabled"' :
'') .
' id="' . $htmlid .
'" name="' . $htmlname .
'">';
208 if (!empty($show_empty)) {
209 if (is_numeric($show_empty)) {
210 $out .=
'<option value="0"> </option>';
212 $out .=
'<option value="-1">'.$show_empty.
'</option>';
215 $num = $this->db->num_rows($resql);
219 $obj = $this->db->fetch_object($resql);
221 if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && !$user->hasRight(
'societe',
'lire')) {
224 if ($discard_closed == 1 && $obj->fk_statut == 2 && $obj->rowid != $selected) {
232 $labeltoshow .=
', ' .
dol_trunc($obj->title, $maxlength);
234 $labeltoshow .=
' - ' . $obj->name;
235 if ($obj->name_alias) {
236 $labeltoshow .=
' (' . $obj->name_alias .
')';
241 if ($obj->fk_statut == 0) {
243 $labeltoshow .=
' - ' . $langs->trans(
"Draft");
244 } elseif ($obj->fk_statut == 2) {
245 if ($discard_closed == 2) {
248 $labeltoshow .=
' - ' . $langs->trans(
"Closed");
249 } elseif (empty($conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY) && $socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) {
251 $labeltoshow .=
' - ' . $langs->trans(
"LinkedToAnotherCompany");
254 if (!empty($selected) && $selected == $obj->rowid) {
255 $out .=
'<option value="' . $obj->rowid .
'" selected';
257 $out .=
'>' . $labeltoshow .
'</option>';
259 if ($hideunselectables && $disabled && ($selected != $obj->rowid)) {
262 $resultat =
'<option value="' . $obj->rowid .
'"';
264 $resultat .=
' disabled';
269 $resultat .= $labeltoshow;
270 $resultat .=
'</option>';
275 'key' => (
int) $obj->rowid,
276 'value' => $obj->ref,
278 'labelx' => $labeltoshow,
279 'label' => ($disabled ?
'<span class="opacitymedium">' . $labeltoshow .
'</span>' : $labeltoshow),
280 'disabled' => (
bool) $disabled
288 $this->db->free($resql);
291 if (empty($option_only)) {
296 if (!empty($conf->use_javascript_ajax)) {
297 include_once DOL_DOCUMENT_ROOT .
'/core/lib/ajax.lib.php';
298 $comboenhancement =
ajax_combobox($htmlid, array(), 0, $forcefocus);
299 $out .= $comboenhancement;
300 $morecss .=
' minwidth100';
303 if (empty($nooutput)) {
336 public function selectTasks($socid = -1, $selected =
'', $htmlname =
'taskid', $maxlength = 24, $option_only = 0, $show_empty =
'1', $discard_closed = 0, $forcefocus = 0, $disabled = 0, $morecss =
'maxwidth500', $projectsListId =
'', $showmore =
'all', $usertofilter =
null)
338 global $user, $conf, $langs;
340 require_once DOL_DOCUMENT_ROOT .
'/projet/class/project.class.php';
342 if (is_null($usertofilter)) {
343 $usertofilter = $user;
348 $hideunselectables =
false;
349 if (!empty($conf->global->PROJECT_HIDE_UNSELECTABLES)) {
350 $hideunselectables =
true;
353 if (empty($projectsListId)) {
354 if (empty($usertofilter->rights->projet->all->lire)) {
355 $projectstatic =
new Project($this->db);
356 $projectsListId = $projectstatic->getProjectsAuthorizedForUser($usertofilter, 0, 1);
361 $sql =
"SELECT t.rowid, t.ref as tref, t.label as tlabel, t.progress,";
362 $sql .=
" p.rowid as pid, p.ref, p.title, p.fk_soc, p.fk_statut, p.public, p.usage_task,";
363 $sql .=
" s.nom as name";
364 $sql .=
" FROM " . $this->db->prefix() .
"projet as p";
365 $sql .=
" LEFT JOIN " . $this->db->prefix() .
"societe as s ON s.rowid = p.fk_soc,";
366 $sql .=
" " . $this->db->prefix() .
"projet_task as t";
367 $sql .=
" WHERE p.entity IN (" .
getEntity(
'project') .
")";
368 $sql .=
" AND t.fk_projet = p.rowid";
369 if ($projectsListId) {
370 $sql .=
" AND p.rowid IN (" . $this->db->sanitize($projectsListId) .
")";
373 $sql .=
" AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
376 $sql .=
" AND (p.fk_soc=" . ((int) $socid) .
" OR p.fk_soc IS NULL)";
378 $sql .=
" ORDER BY p.ref, t.ref ASC";
380 $resql = $this->db->query($sql);
383 if (empty($option_only) && !empty($conf->use_javascript_ajax)) {
384 include_once DOL_DOCUMENT_ROOT .
'/core/lib/ajax.lib.php';
385 $comboenhancement =
ajax_combobox($htmlname,
'', 0, $forcefocus);
386 $out .= $comboenhancement;
387 $morecss .=
' minwidth150imp';
390 if (empty($option_only)) {
391 $out .=
'<select class="valignmiddle flat' . ($morecss ?
' ' . $morecss :
'') .
'"' . ($disabled ?
' disabled="disabled"' :
'') .
' id="' . $htmlname .
'" name="' . $htmlname .
'">';
393 if (!empty($show_empty)) {
394 $out .=
'<option value="0" class="optiongrey">';
395 if (!is_numeric($show_empty)) {
405 $num = $this->db->num_rows($resql);
409 $obj = $this->db->fetch_object($resql);
411 if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && empty($usertofilter->rights->societe->lire)) {
426 if ($discard_closed == 2) {
429 } elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) {
433 if (preg_match(
'/all/', $showmore)) {
434 $labeltoshow .=
dol_trunc($obj->ref, 18);
437 $labeltoshow .=
' ' .
dol_trunc($obj->title, $maxlength);
438 $titletoshow = $labeltoshow;
441 $labeltoshow .=
' (' . $obj->name .
')';
442 $titletoshow .=
' <span class="opacitymedium">(' . $obj->name .
')</span>';
448 $labeltoshow .=
' - ' . $langs->trans(
"Draft");
449 $titletoshow .=
' - <span class="opacitymedium">' . $langs->trans(
"Draft") .
'</span>';
451 if ($discard_closed == 2) {
454 $labeltoshow .=
' - ' . $langs->trans(
"Closed");
455 $titletoshow .=
' - <span class="opacitymedium">' . $langs->trans(
"Closed") .
'</span>';
456 } elseif ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) {
458 $labeltoshow .=
' - ' . $langs->trans(
"LinkedToAnotherCompany");
459 $titletoshow .=
' - <span class="opacitymedium">' . $langs->trans(
"LinkedToAnotherCompany") .
'</span>';
461 $labeltoshow .=
' - ';
462 $titletoshow .=
' - ';
466 $labeltoshow .= $obj->tref .
' ' .
dol_trunc($obj->tlabel, $maxlength);
467 $titletoshow .= $obj->tref .
' ' .
dol_trunc($obj->tlabel, $maxlength);
468 if ($obj->usage_task && preg_match(
'/progress/', $showmore)) {
469 $labeltoshow .=
' <span class="opacitymedium">(' . $obj->progress .
'%)</span>';
470 $titletoshow .=
' <span class="opacitymedium">(' . $obj->progress .
'%)</span>';
473 if (!empty($selected) && $selected == $obj->rowid) {
474 $out .=
'<option value="' . $obj->rowid .
'" selected';
477 $out .=
'>' . $labeltoshow .
'</option>';
479 if ($hideunselectables && $disabled && ($selected != $obj->rowid)) {
482 $resultat =
'<option value="' . $obj->rowid .
'"';
484 $resultat .=
' disabled';
490 $resultat .= $labeltoshow;
491 $resultat .=
'</option>';
499 if (empty($option_only)) {
503 $this->nboftasks = $num;
507 $this->db->free($resql);
529 public function select_element($table_element, $socid = 0, $morecss =
'', $limitonstatus = -2, $projectkey =
"fk_projet", $placeholder =
'')
532 global $conf, $langs;
534 if ($table_element ==
'projet_task') {
538 $linkedtothirdparty =
false;
539 if (!in_array($table_element, array(
542 'expensereport',
'loan',
550 $linkedtothirdparty =
true;
556 switch ($table_element) {
558 $sql =
"SELECT t.rowid, t.label as ref";
561 $sql =
"SELECT t.rowid, t.ref as ref";
563 case "facture_fourn":
564 $sql =
"SELECT t.rowid, t.ref, t.ref_supplier";
566 case "commande_fourn":
567 case "commande_fournisseur":
568 $sql =
"SELECT t.rowid, t.ref, t.ref_supplier";
571 $sql =
"SELECT t.rowid, t.titre as ref";
574 $sql =
"SELECT t.id as rowid, t.label as ref";
575 $projectkey =
"fk_project";
577 case "expensereport":
579 case "expensereport_det":
587 $sql =
"SELECT t.rowid, t.ref";
589 case 'stock_mouvement':
590 $sql =
"SELECT t.rowid, t.label as ref";
591 $projectkey =
'fk_origin';
593 case "payment_salary":
594 $sql =
"SELECT t.rowid, t.num_payment as ref";
596 case "payment_various":
597 $sql =
"SELECT t.rowid, t.num_payment as ref";
599 case "chargesociales":
601 $sql =
"SELECT t.rowid, t.ref";
604 if ($linkedtothirdparty) {
605 $sql .=
", s.nom as name";
607 $sql .=
" FROM " . $this->db->prefix() . $table_element .
" as t";
608 if ($linkedtothirdparty) {
609 $sql .=
", " . $this->db->prefix() .
"societe as s";
611 $sql .=
" WHERE " . $projectkey .
" is null";
612 if (!empty($socid) && $linkedtothirdparty) {
613 if (is_numeric($socid)) {
614 $sql .=
" AND t.fk_soc = " . ((int) $socid);
616 $sql .=
" AND t.fk_soc IN (" . $this->db->sanitize($socid) .
")";
619 if (!in_array($table_element, array(
'expensereport_det',
'stock_mouvement'))) {
620 $sql .=
' AND t.entity IN (' .
getEntity(
'project') .
')';
622 if ($linkedtothirdparty) {
623 $sql .=
" AND s.rowid = t.fk_soc";
626 $sql .=
" AND " . $sqlfilter;
628 $sql .=
" ORDER BY ref DESC";
630 dol_syslog(get_class($this) .
'::select_element', LOG_DEBUG);
631 $resql = $this->db->query($sql);
633 $num = $this->db->num_rows($resql);
638 $sellist =
'<select class="flat elementselect css' . $table_element . ($morecss ?
' ' . $morecss :
'') .
'" name="elementselect">';
639 $sellist .=
'<option value="-1"' . ($placeholder ?
' class="optiongrey"' :
'') .
'>' . $placeholder .
'</option>';
641 $obj = $this->db->fetch_object($resql);
642 $ref = $obj->ref ? $obj->ref : $obj->rowid;
643 if (!empty($obj->ref_supplier)) {
644 $ref .=
' (' . $obj->ref_supplier .
')';
646 if (!empty($obj->name)) {
647 $ref .=
' - ' . $obj->name;
649 $sellist .=
'<option value="' . $obj->rowid .
'">' . $ref .
'</option>';
652 $sellist .=
'</select>';
660 $this->db->free($resql);
665 $this->error = $this->db->lasterror();
666 $this->errors[] = $this->db->lasterror();
667 dol_syslog(get_class($this) .
"::select_element " . $this->error, LOG_ERR);
687 public function selectOpportunityStatus($htmlname, $preselected =
'-1', $showempty = 1, $useshortlabel = 0, $showallnone = 0, $showpercent = 0, $morecss =
'', $noadmininfo = 0, $addcombojs = 0)
689 global $conf, $langs, $user;
691 $sql =
"SELECT rowid, code, label, percent";
692 $sql .=
" FROM " . $this->db->prefix() .
'c_lead_status';
693 $sql .=
" WHERE active = 1";
694 $sql .=
" ORDER BY position";
696 $resql = $this->db->query($sql);
698 $num = $this->db->num_rows($resql);
701 $sellist =
'<select class="flat oppstatus' . ($morecss ?
' ' . $morecss :
'') .
'" id="' . $htmlname .
'" name="' . $htmlname .
'">';
704 $sellist .=
'<option value="-1"> </option>';
707 $sellist .=
'<option value="all"' . ($preselected ==
'all' ?
' selected="selected"' :
'') .
'>-- ' . $langs->trans(
"OnlyOpportunitiesShort") .
'</option>';
708 $sellist .=
'<option value="openedopp"' . ($preselected ==
'openedopp' ?
' selected="selected"' :
'') .
'>-- ' . $langs->trans(
"OpenedOpportunitiesShort") .
'</option>';
709 $sellist .=
'<option value="notopenedopp"' . ($preselected ==
'notopenedopp' ?
' selected="selected"' :
'') .
'>-- ' . $langs->trans(
"NotOpenedOpportunitiesShort") .
'</option>';
710 $sellist .=
'<option value="none"' . ($preselected ==
'none' ?
' selected="selected"' :
'') .
'>-- ' . $langs->trans(
"NotAnOpportunityShort") .
'</option>';
713 $obj = $this->db->fetch_object($resql);
715 $sellist .=
'<option value="' . $obj->rowid .
'" defaultpercent="' . $obj->percent .
'" elemcode="' . $obj->code .
'"';
716 if ($obj->rowid == $preselected) {
717 $sellist .=
' selected="selected"';
720 if ($useshortlabel) {
721 $finallabel = ($langs->transnoentitiesnoconv(
"OppStatus" . $obj->code) !=
"OppStatus" . $obj->code ? $langs->transnoentitiesnoconv(
"OppStatus" . $obj->code) : $obj->label);
723 $finallabel = ($langs->transnoentitiesnoconv(
"OppStatus" . $obj->code) !=
"OppStatus" . $obj->code ? $langs->transnoentitiesnoconv(
"OppStatus" . $obj->code) : $obj->label);
725 $finallabel .=
' (' . $obj->percent .
'%)';
728 $sellist .= $finallabel;
729 $sellist .=
'</option>';
732 $sellist .=
'</select>';
734 if ($user->admin && !$noadmininfo) {
735 $sellist .=
info_admin($langs->trans(
"YouCanChangeValuesForThisListFromDictionarySetup"), 1);
748 $this->db->free($resql);
752 $this->error = $this->db->lasterror();
753 $this->errors[] = $this->db->lasterror();
754 dol_syslog(get_class($this) .
"::selectOpportunityStatus " . $this->error, LOG_ERR);
771 public function selectInvoiceAndLine($selectedInvoiceId = 0, $selectedLineId = 0, $htmlNameInvoice =
'invoiceid', $htmlNameInvoiceLine =
'invoicelineid', $morecss =
'maxwidth500', $filters = array(), $lineOnly = 0)
773 global $user, $conf, $langs;
775 require_once DOL_DOCUMENT_ROOT .
'/projet/class/project.class.php';
778 if (empty($lineOnly)) {
780 $sql =
"SELECT f.rowid, f.ref as fref,";
781 $sql .=
' s.nom as name';
782 $sql .=
' FROM ' . $this->db->prefix() .
'projet as p';
783 $sql .=
' INNER JOIN ' . $this->db->prefix() .
'societe as s ON s.rowid = p.fk_soc';
784 $sql .=
' INNER JOIN ' . $this->db->prefix() .
'facture as f ON f.fk_projet = p.rowid';
785 $sql .=
" WHERE p.entity IN (" .
getEntity(
'project') .
")";
786 if (!empty($filters)) {
787 foreach ($filters as $key => $value) {
788 if ($key ==
'p.rowid') {
789 $sql .=
" AND p.rowid=" . (int) $value;
791 if ($key ==
'f.rowid') {
792 $sql .=
" AND f.rowid=" . (int) $value;
796 $sql .=
" ORDER BY p.ref, f.ref ASC";
798 $resql = $this->db->query($sql);
801 if (!empty($conf->use_javascript_ajax)) {
802 include_once DOL_DOCUMENT_ROOT .
'/core/lib/ajax.lib.php';
803 $comboenhancement =
ajax_combobox($htmlNameInvoice, array(array(
'method'=>
'getLines',
'url'=>
dol_buildpath(
'/core/ajax/ajaxinvoiceline.php', 1),
'htmlname'=>$htmlNameInvoiceLine)), 0, 0);
804 $out .= $comboenhancement;
805 $morecss =
'minwidth200imp maxwidth500';
808 $out .=
'<select class="valignmiddle flat' . ($morecss ?
' ' . $morecss :
'') .
'" id="' . $htmlNameInvoice .
'" name="' . $htmlNameInvoice .
'">';
809 $num = $this->db->num_rows($resql);
811 while ($obj = $this->db->fetch_object($resql)) {
812 $labeltoshow = $obj->fref;
814 $labeltoshow .=
' - ' . $obj->name;
817 $out .=
'<option value="' . $obj->rowid .
'" ';
818 if (!empty($selectedInvoiceId) && $selectedInvoiceId == $obj->rowid) {
819 $out .=
' selected ';
821 $out .=
'>' . $labeltoshow .
'</option>';
832 $sql =
"SELECT fd.rowid, fd.label, fd.description";
833 $sql .=
' FROM ' . $this->db->prefix() .
'projet as p';
834 $sql .=
' INNER JOIN ' . $this->db->prefix() .
'societe as s ON s.rowid = p.fk_soc';
835 $sql .=
' INNER JOIN ' . $this->db->prefix() .
'facture as f ON f.fk_projet = p.rowid';
836 $sql .=
' INNER JOIN ' . $this->db->prefix() .
'facturedet as fd ON fd.fk_facture = f.rowid';
837 $sql .=
" WHERE p.entity IN (" .
getEntity(
'project') .
")";
838 if (!empty($filters)) {
839 foreach ($filters as $key => $value) {
840 if ($key ==
'p.rowid') {
841 $sql .=
" AND p.rowid=" . (int) $value;
845 if (!empty($selectedInvoiceId)) {
846 $sql .=
" AND f.rowid=" . (int) $selectedInvoiceId;
848 $sql .=
" ORDER BY p.ref, f.ref ASC";
849 $resql = $this->db->query($sql);
852 if (empty($lineOnly)) {
853 if (!empty($conf->use_javascript_ajax)) {
854 include_once DOL_DOCUMENT_ROOT .
'/core/lib/ajax.lib.php';
855 $comboenhancement =
ajax_combobox($htmlNameInvoiceLine,
'', 0, 0);
856 $out .= $comboenhancement;
857 $morecss =
'minwidth200imp maxwidth500';
860 $out .=
'<select class="valignmiddle flat' . ($morecss ?
' ' . $morecss :
'') .
'" id="' . $htmlNameInvoiceLine .
'" name="' . $htmlNameInvoiceLine .
'">';
862 $num = $this->db->num_rows($resql);
864 while ($obj = $this->db->fetch_object($resql)) {
865 $labeltoshow .= $obj->description;
867 $out .=
'<option value="' . $obj->rowid .
'" ';
868 if (!empty($selectedLineId) && $selectedLineId == $obj->rowid) {
869 $out .=
' selected ';
871 $out .=
'>' . $labeltoshow .
'</option>';
874 if (empty($lineOnly)) {
ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLength=2, $autoselect=0, $ajaxoptions=array(), $moreparams='')
Generic function that return javascript to add to a page to transform a common input field into an au...
ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0, $widthTypeOfAutocomplete='resolve', $idforemptyvalue='-1', $morecss='')
Convert a html select field into an ajax combobox.
Class to manage projects.
const STATUS_CLOSED
Closed status.
const STATUS_DRAFT
Draft status.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='')
Show information for admin users or standard users.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
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.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...