dolibarr  9.0.0
html.formprojet.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 2013 Florian Henry <florian.henry@open-concept.pro>
3  * Copyright (C) 2015 Marcos GarcĂ­a <marcosgdf@gmail.com>
4  * Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  */
19 
31 {
35  public $db;
36 
40  public $error='';
41 
42 
48  function __construct($db)
49  {
50  $this->db = $db;
51  }
52 
53  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
74  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='')
75  {
76  // phpcs:enable
77  global $langs,$conf,$form;
78 
79  $out='';
80 
81  if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->PROJECT_USE_SEARCH_TO_SELECT))
82  {
83  $placeholder='';
84 
85  if ($selected && empty($selected_input_value))
86  {
87  require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
88  $project = new Project($this->db);
89  $project->fetch($selected);
90  $selected_input_value=$project->ref;
91  }
92  $urloption='socid='.$socid.'&htmlname='.$htmlname.'&discardclosed='.$discard_closed;
93  $out.=ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PROJECT_USE_SEARCH_TO_SELECT, 0, array(
94 // 'update' => array(
95 // 'projectid' => 'id'
96 // )
97  ));
98 
99  $out.='<input type="text" class="minwidth200'.($morecss?' '.$morecss:'').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' />';
100  }
101  else
102  {
103  $out.=$this->select_projects_list($socid, $selected, $htmlname, $maxlength, $option_only, $show_empty, $discard_closed, $forcefocus, $disabled, 0, $filterkey, 1, $forceaddid, $htmlid, $morecss);
104  }
105  if ($discard_closed)
106  {
107  if (class_exists('Form'))
108  {
109  if (empty($form)) $form=new Form($this->db);
110  $out.=$form->textwithpicto('', $langs->trans("ClosedProjectsAreHidden"));
111  }
112  }
113 
114  if (empty($nooutput))
115  {
116  print $out;
117  return '';
118  }
119  else return $out;
120  }
121 
122  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
143  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')
144  {
145  // phpcs:enable
146  global $user,$conf,$langs;
147 
148  require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
149 
150  if (empty($htmlid)) $htmlid = $htmlname;
151 
152  $out='';
153  $outarray=array();
154 
155  $hideunselectables = false;
156  if (! empty($conf->global->CONTRACT_HIDE_UNSELECTABLES)) $hideunselectables = true;
157 
158  $projectsListId = false;
159  if (empty($user->rights->projet->all->lire))
160  {
161  $projectstatic=new Project($this->db);
162  $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1);
163  }
164 
165  // Search all projects
166  $sql = 'SELECT p.rowid, p.ref, p.title, p.fk_soc, p.fk_statut, p.public, s.nom as name, s.name_alias';
167  $sql.= ' FROM '.MAIN_DB_PREFIX .'projet as p LEFT JOIN '.MAIN_DB_PREFIX .'societe as s ON s.rowid = p.fk_soc';
168  $sql.= " WHERE p.entity IN (".getEntity('project').")";
169  if ($projectsListId !== false) $sql.= " AND p.rowid IN (".$projectsListId.")";
170  if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
171  if ($socid > 0)
172  {
173  if (empty($conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY)) $sql.= " AND (p.fk_soc=".$socid." OR p.fk_soc IS NULL)";
174  else if ($conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY != 'all') // PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY is 'all' or a list of ids separated by coma.
175  {
176  $sql.= " AND (p.fk_soc IN (".$socid.", ".$conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY.") OR p.fk_soc IS NULL)";
177  }
178  }
179  if (!empty($filterkey)) $sql .= natural_search(array('p.title', 'p.ref'), $filterkey);
180  $sql.= " ORDER BY p.ref ASC";
181 
182  $resql=$this->db->query($sql);
183  if ($resql)
184  {
185  // Use select2 selector
186  if (! empty($conf->use_javascript_ajax))
187  {
188  include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
189  $comboenhancement = ajax_combobox($htmlid, array(), 0, $forcefocus);
190  $out.=$comboenhancement;
191  $morecss.=' minwidth100';
192  }
193 
194  if (empty($option_only)) {
195  $out.= '<select class="flat'.($morecss?' '.$morecss:'').'"'.($disabled?' disabled="disabled"':'').' id="'.$htmlid.'" name="'.$htmlname.'">';
196  }
197  if (!empty($show_empty)) {
198  $out.= '<option value="0">&nbsp;</option>';
199  }
200  $num = $this->db->num_rows($resql);
201  $i = 0;
202  if ($num)
203  {
204  while ($i < $num)
205  {
206  $obj = $this->db->fetch_object($resql);
207  // If we ask to filter on a company and user has no permission to see all companies and project is linked to another company, we hide project.
208  if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && ! $user->rights->societe->lire)
209  {
210  // Do nothing
211  }
212  else
213  {
214  if ($discard_closed == 1 && $obj->fk_statut == 2 && $obj->rowid != $selected) // We discard closed except if selected
215  {
216  $i++;
217  continue;
218  }
219 
220  $labeltoshow=dol_trunc($obj->ref,18);
221  //if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')';
222  //else $labeltoshow.=' ('.$langs->trans("Private").')';
223  $labeltoshow.=', '.dol_trunc($obj->title, $maxlength);
224  if ($obj->name)
225  {
226  $labeltoshow.=' - '.$obj->name;
227  if ($obj->name_alias) $labeltoshow.=' ('.$obj->name_alias.')';
228  }
229 
230  $disabled=0;
231  if ($obj->fk_statut == 0)
232  {
233  $disabled=1;
234  $labeltoshow.=' - '.$langs->trans("Draft");
235  }
236  else if ($obj->fk_statut == 2)
237  {
238  if ($discard_closed == 2) $disabled=1;
239  $labeltoshow.=' - '.$langs->trans("Closed");
240  }
241  else if ( empty($conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY) && $socid > 0 && (! empty($obj->fk_soc) && $obj->fk_soc != $socid))
242  {
243  $disabled=1;
244  $labeltoshow.=' - '.$langs->trans("LinkedToAnotherCompany");
245  }
246 
247  if (!empty($selected) && $selected == $obj->rowid)
248  {
249  $out.= '<option value="'.$obj->rowid.'" selected';
250  //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled
251  $out.= '>'.$labeltoshow.'</option>';
252  }
253  else
254  {
255  if ($hideunselectables && $disabled && ($selected != $obj->rowid))
256  {
257  $resultat='';
258  }
259  else
260  {
261  $resultat='<option value="'.$obj->rowid.'"';
262  if ($disabled) $resultat.=' disabled';
263  //if ($obj->public) $labeltoshow.=' ('.$langs->trans("Public").')';
264  //else $labeltoshow.=' ('.$langs->trans("Private").')';
265  $resultat.='>';
266  $resultat.=$labeltoshow;
267  $resultat.='</option>';
268  }
269  $out.= $resultat;
270 
271  $outarray[] = array(
272  'key' => (int) $obj->rowid,
273  'value' => $obj->ref,
274  'ref' => $obj->ref,
275  'label' => $labeltoshow,
276  'disabled' => (bool) $disabled
277  );
278  }
279  }
280  $i++;
281  }
282  }
283 
284  $this->db->free($resql);
285 
286  if (!$mode) {
287  if (empty($option_only)) $out.= '</select>';
288  if (empty($nooutput))
289  {
290  print $out;
291  return '';
292  }
293  else return $out;
294  } else {
295  return $outarray;
296  }
297  }
298  else
299  {
300  dol_print_error($this->db);
301  return -1;
302  }
303  }
304 
323  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='', $showproject='all', $usertofilter=null)
324  {
325  global $user,$conf,$langs;
326 
327  require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
328 
329  if (is_null($usertofilter))
330  {
331  $usertofilter = $user;
332  }
333 
334  $out='';
335 
336  $hideunselectables = false;
337  if (! empty($conf->global->PROJECT_HIDE_UNSELECTABLES)) $hideunselectables = true;
338 
339  if (empty($projectsListId))
340  {
341  if (empty($usertofilter->rights->projet->all->lire))
342  {
343  $projectstatic=new Project($this->db);
344  $projectsListId = $projectstatic->getProjectsAuthorizedForUser($usertofilter,0,1);
345  }
346  }
347 
348  // Search all projects
349  $sql = 'SELECT t.rowid, t.ref as tref, t.label as tlabel, p.rowid as pid, p.ref, p.title, p.fk_soc, p.fk_statut, p.public,';
350  $sql.= ' s.nom as name';
351  $sql.= ' FROM '.MAIN_DB_PREFIX .'projet as p';
352  $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON s.rowid = p.fk_soc,';
353  $sql.= ' '.MAIN_DB_PREFIX.'projet_task as t';
354  $sql.= " WHERE p.entity IN (".getEntity('project').")";
355  $sql.= " AND t.fk_projet = p.rowid";
356  if ($projectsListId) $sql.= " AND p.rowid IN (".$projectsListId.")";
357  if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
358  if ($socid > 0) $sql.= " AND (p.fk_soc=".$socid." OR p.fk_soc IS NULL)";
359  $sql.= " ORDER BY p.ref, t.ref ASC";
360 
361  $resql=$this->db->query($sql);
362  if ($resql)
363  {
364  // Use select2 selector
365  if (! empty($conf->use_javascript_ajax))
366  {
367  include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
368  $comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus);
369  $out.=$comboenhancement;
370  $morecss='minwidth200 maxwidth500';
371  }
372 
373  if (empty($option_only)) {
374  $out.= '<select class="valignmiddle flat'.($morecss?' '.$morecss:'').'"'.($disabled?' disabled="disabled"':'').' id="'.$htmlname.'" name="'.$htmlname.'">';
375  }
376  if (! empty($show_empty)) {
377  $out.= '<option value="0" class="optiongrey">';
378  if (! is_numeric($show_empty)) $out.=$show_empty;
379  else $out.='&nbsp;';
380  $out.= '</option>';
381  }
382  $num = $this->db->num_rows($resql);
383  $i = 0;
384  if ($num)
385  {
386  while ($i < $num)
387  {
388  $obj = $this->db->fetch_object($resql);
389  // If we ask to filter on a company and user has no permission to see all companies and project is linked to another company, we hide project.
390  if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && empty($usertofilter->rights->societe->lire))
391  {
392  // Do nothing
393  }
394  else
395  {
396  if ($discard_closed == 1 && $obj->fk_statut == Project::STATUS_CLOSED)
397  {
398  $i++;
399  continue;
400  }
401 
402  $labeltoshow = '';
403 
404  if ($showproject == 'all')
405  {
406  $labeltoshow.=dol_trunc($obj->ref,18); // Project ref
407  //if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')';
408  //else $labeltoshow.=' ('.$langs->trans("Private").')';
409  $labeltoshow.=' '.dol_trunc($obj->title,$maxlength);
410 
411  if ($obj->name) $labeltoshow.=' ('.$obj->name.')';
412 
413  $disabled=0;
414  if ($obj->fk_statut == Project::STATUS_DRAFT)
415  {
416  $disabled=1;
417  $labeltoshow.=' - '.$langs->trans("Draft");
418  }
419  else if ($obj->fk_statut == Project::STATUS_CLOSED)
420  {
421  if ($discard_closed == 2) $disabled=1;
422  $labeltoshow.=' - '.$langs->trans("Closed");
423  }
424  else if ($socid > 0 && (! empty($obj->fk_soc) && $obj->fk_soc != $socid))
425  {
426  $disabled=1;
427  $labeltoshow.=' - '.$langs->trans("LinkedToAnotherCompany");
428  }
429  $labeltoshow.=' - ';
430  }
431 
432  // Label for task
433  $labeltoshow.=$obj->tref.' '.dol_trunc($obj->tlabel,$maxlength);
434 
435  if (!empty($selected) && $selected == $obj->rowid)
436  {
437  $out.= '<option value="'.$obj->rowid.'" selected';
438  //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled
439  $out.= '>'.$labeltoshow.'</option>';
440  }
441  else
442  {
443  if ($hideunselectables && $disabled && ($selected != $obj->rowid))
444  {
445  $resultat='';
446  }
447  else
448  {
449  $resultat='<option value="'.$obj->rowid.'"';
450  if ($disabled) $resultat.=' disabled';
451  //if ($obj->public) $labeltoshow.=' ('.$langs->trans("Public").')';
452  //else $labeltoshow.=' ('.$langs->trans("Private").')';
453  $resultat.='>';
454  $resultat.=$labeltoshow;
455  $resultat.='</option>';
456  }
457  $out.= $resultat;
458  }
459  }
460  $i++;
461  }
462  }
463  if (empty($option_only)) {
464  $out.= '</select>';
465  }
466 
467  print $out;
468 
469  $this->db->free($resql);
470  return $num;
471  }
472  else
473  {
474  dol_print_error($this->db);
475  return -1;
476  }
477  }
478 
479 
480  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
491  function select_element($table_element, $socid=0, $morecss='', $limitonstatus=-2,$projectkey="fk_projet")
492  {
493  // phpcs:enable
494  global $conf, $langs;
495 
496  if ($table_element == 'projet_task') return ''; // Special cas of element we never link to a project (already always done)
497 
498  $linkedtothirdparty=false;
499  if (! in_array($table_element, array('don','expensereport_det','expensereport','loan','stock_mouvement','payment_salary','payment_various','chargesociales'))) $linkedtothirdparty=true;
500 
501  $sqlfilter='';
502 
503  //print $table_element;
504  switch ($table_element)
505  {
506  case "loan":
507  $sql = "SELECT t.rowid, t.label as ref";
508  break;
509  case "facture":
510  $sql = "SELECT t.rowid, t.facnumber as ref";
511  break;
512  case "facture_fourn":
513  $sql = "SELECT t.rowid, t.ref, t.ref_supplier";
514  break;
515  case "commande_fourn":
516  case "commande_fournisseur":
517  $sql = "SELECT t.rowid, t.ref, t.ref_supplier";
518  break;
519  case "facture_rec":
520  $sql = "SELECT t.rowid, t.titre as ref";
521  break;
522  case "actioncomm":
523  $sql = "SELECT t.id as rowid, t.label as ref";
524  $projectkey="fk_project";
525  break;
526  case "expensereport":
527  return '';
528  case "expensereport_det":
529  /*$sql = "SELECT rowid, '' as ref"; // table is llx_expensereport_det
530  $projectkey="fk_projet";
531  break;*/
532  return '';
533  case "commande":
534  case "contrat":
535  case "fichinter":
536  $sql = "SELECT t.rowid, t.ref";
537  break;
538  case 'stock_mouvement':
539  $sql = 'SELECT t.rowid, t.label as ref';
540  $projectkey='fk_origin';
541  break;
542  case "payment_salary":
543  $sql = "SELECT t.rowid, t.num_payment as ref"; // TODO In a future fill and use real ref field
544  break;
545  case "payment_various":
546  $sql = "SELECT t.rowid, t.num_payment as ref";
547  break;
548  case "chargesociales":
549  default:
550  $sql = "SELECT t.rowid, t.ref";
551  break;
552  }
553  if ($linkedtothirdparty) $sql.=", s.nom as name";
554  $sql.= " FROM ".MAIN_DB_PREFIX.$table_element." as t";
555  if ($linkedtothirdparty) $sql.=", ".MAIN_DB_PREFIX."societe as s";
556  $sql.= " WHERE ".$projectkey." is null";
557  if (! empty($socid) && $linkedtothirdparty)
558  {
559  if (is_numeric($socid)) $sql.= " AND t.fk_soc=".$socid;
560  else $sql.= " AND t.fk_soc IN (".$socid.")";
561  }
562  if (! in_array($table_element, array('expensereport_det','stock_mouvement'))) $sql.= ' AND t.entity IN ('.getEntity('project').')';
563  if ($linkedtothirdparty) $sql.=" AND s.rowid = t.fk_soc";
564  if ($sqlfilter) $sql.= " AND ".$sqlfilter;
565  $sql.= " ORDER BY ref DESC";
566 
567  dol_syslog(get_class($this).'::select_element', LOG_DEBUG);
568  $resql=$this->db->query($sql);
569  if ($resql)
570  {
571  $num = $this->db->num_rows($resql);
572  $i = 0;
573  if ($num > 0)
574  {
575  $sellist = '<select class="flat elementselect css'.$table_element.($morecss?' '.$morecss:'').'" name="elementselect">';
576  $sellist .='<option value="-1"></option>';
577  while ($i < $num)
578  {
579  $obj = $this->db->fetch_object($resql);
580  $ref=$obj->ref?$obj->ref:$obj->rowid;
581  if (! empty($obj->ref_supplier)) $ref.=' ('.$obj->ref_supplier.')';
582  if (! empty($obj->name)) $ref.=' - '.$obj->name;
583  $sellist .='<option value="'.$obj->rowid.'">'.$ref.'</option>';
584  $i++;
585  }
586  $sellist .='</select>';
587  }
588  /*else
589  {
590  $sellist = '<select class="flat" name="elementselect">';
591  $sellist.= '<option value="0" disabled>'.$langs->trans("None").'</option>';
592  $sellist.= '</select>';
593  }*/
594  $this->db->free($resql);
595 
596  return $sellist;
597  }
598  else
599  {
600  dol_print_error($this->db);
601  $this->error=$this->db->lasterror();
602  $this->errors[]=$this->db->lasterror();
603  dol_syslog(get_class($this) . "::select_element " . $this->error, LOG_ERR);
604  return -1;
605  }
606  }
607 
608 
621  function selectOpportunityStatus($htmlname, $preselected='-1', $showempty=1, $useshortlabel=0, $showallnone=0, $showpercent=0, $morecss='')
622  {
623  global $conf, $langs;
624 
625  $sql = "SELECT rowid, code, label, percent";
626  $sql.= " FROM ".MAIN_DB_PREFIX.'c_lead_status';
627  $sql.= " WHERE active = 1";
628  $sql.= " ORDER BY position";
629 
630  $resql=$this->db->query($sql);
631  if ($resql)
632  {
633  $num = $this->db->num_rows($resql);
634  $i = 0;
635  if ($num > 0)
636  {
637  $sellist = '<select class="flat oppstatus'.($morecss?' '.$morecss:'').'" id="'.$htmlname.'" name="'.$htmlname.'">';
638  if ($showempty) {
639  // Without &nbsp, strange move of screen when switching value
640  $sellist.= '<option value="-1">&nbsp;</option>';
641  }
642  if ($showallnone) {
643  $sellist.= '<option value="all"'.($preselected == 'all'?' selected="selected"':'').'>-- '.$langs->trans("OnlyOpportunitiesShort").' --</option>';
644  $sellist.= '<option value="openedopp"'.($preselected == 'openedopp'?' selected="selected"':'').'>-- '.$langs->trans("OpenedOpportunitiesShort").' --</option>';
645  $sellist.= '<option value="notopenedopp"'.($preselected == 'notopenedopp'?' selected="selected"':'').'>-- '.$langs->trans("NotOpenedOpportunitiesShort").' --</option>';
646  $sellist.= '<option value="none"'.($preselected == 'none'?' selected="selected"':'').'>-- '.$langs->trans("NotAnOpportunityShort").' --</option>';
647  }
648  while ($i < $num)
649  {
650  $obj = $this->db->fetch_object($resql);
651 
652  $sellist .='<option value="'.$obj->rowid.'" defaultpercent="'.$obj->percent.'" elemcode="'.$obj->code.'"';
653  if ($obj->rowid == $preselected) $sellist .= ' selected="selected"';
654  $sellist .= '>';
655  if ($useshortlabel)
656  {
657  $finallabel = ($langs->transnoentitiesnoconv("OppStatus".$obj->code) != "OppStatus".$obj->code ? $langs->transnoentitiesnoconv("OppStatus".$obj->code) : $obj->label);
658  }
659  else
660  {
661  $finallabel = ($langs->transnoentitiesnoconv("OppStatus".$obj->code) != "OppStatus".$obj->code ? $langs->transnoentitiesnoconv("OppStatus".$obj->code) : $obj->label);
662  if ($showpercent) $finallabel.= ' ('.$obj->percent.'%)';
663  }
664  $sellist .= $finallabel;
665  $sellist .='</option>';
666  $i++;
667  }
668  $sellist .='</select>';
669  }
670  /*else
671  {
672  $sellist = '<select class="flat" name="elementselect">';
673  $sellist.= '<option value="0" disabled>'.$langs->trans("None").'</option>';
674  $sellist.= '</select>';
675  }*/
676  $this->db->free($resql);
677 
678  return $sellist;
679  }
680  else
681  {
682  $this->error=$this->db->lasterror();
683  $this->errors[]=$this->db->lasterror();
684  dol_syslog(get_class($this) . "::selectOpportunityStatus " . $this->error, LOG_ERR);
685  return -1;
686  }
687  }
688 }
ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0, $widthTypeOfAutocomplete='resolve')
Convert a html select field into an ajax combobox.
Definition: ajax.lib.php:374
print
Draft customers invoices.
Definition: index.php:91
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding &#39;...&#39; if string larger than length.
if(! empty($conf->facture->enabled) && $user->rights->facture->lire) if(! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire) if(! empty($conf->don->enabled) && $user->rights->societe->lire) if(! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) if(! empty($conf->facture->enabled) &&! empty($conf->commande->enabled) && $user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(! empty($conf->facture->enabled) && $user->rights->facture->lire) if(! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
Definition: index.php:1053
select_element($table_element, $socid=0, $morecss='', $limitonstatus=-2, $projectkey="fk_projet")
Build a HTML select list of element of same thirdparty to suggest to link them to project...
__construct($db)
Constructor.
dol_print_error($db='', $error='', $errors=null)
Affiche message erreur system avec toutes les informations pour faciliter le diagnostic et la remonte...
const STATUS_CLOSED
Closed status.
Class to manage generation of HTML components Only common components must be here.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='')
Write log message into outputs.
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='')
Output a combo list with projects qualified for a third party / user.
Class to manage projects.
selectOpportunityStatus($htmlname, $preselected='-1', $showempty=1, $useshortlabel=0, $showallnone=0, $showpercent=0, $morecss='')
Build a HTML select list of element of same thirdparty to suggest to link them to project...
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')
Returns an array with projects qualified for a third party.
Class to manage building of HTML components.
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...
if(GETPOST('cancel', 'alpha')) if(! GETPOST( 'confirmmassaction', 'alpha') &&$massaction !='presend' &&$massaction !='confirm_presend')
Draft customers invoices.
Definition: list.php:156
ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLength=2, $autoselect=0, $ajaxoptions=array())
Generic function that return javascript to add to a page to transform a common input field into an au...
Definition: ajax.lib.php:46
const STATUS_DRAFT
Draft status.
selectTasks($socid=-1, $selected='', $htmlname='taskid', $maxlength=24, $option_only=0, $show_empty='1', $discard_closed=0, $forcefocus=0, $disabled=0, $morecss='maxwidth500', $projectsListId='', $showproject='all', $usertofilter=null)
Output a combo list with tasks qualified for a third party.