dolibarr  7.0.0-beta
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  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
30 {
31  var $db;
32  var $error;
33 
34 
40  function __construct($db)
41  {
42  $this->db = $db;
43  return 1;
44  }
45 
66  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='')
67  {
68  global $langs,$conf,$form;
69 
70  $out='';
71 
72  if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->PROJECT_USE_SEARCH_TO_SELECT))
73  {
74  $placeholder='';
75 
76  if ($selected && empty($selected_input_value))
77  {
78  require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
79  $project = new Project($this->db);
80  $project->fetch($selected);
81  $selected_input_value=$project->ref;
82  }
83  $urloption='socid='.$socid.'&htmlname='.$htmlname.'&discardclosed='.$discard_closed;
84  $out.=ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PROJECT_USE_SEARCH_TO_SELECT, 0, array(
85 // 'update' => array(
86 // 'projectid' => 'id'
87 // )
88  ));
89 
90  $out.='<input type="text" class="minwidth200'.($morecss?' '.$morecss:'').'" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' />';
91  }
92  else
93  {
94  $out.=$this->select_projects_list($socid, $selected, $htmlname, $maxlength, $option_only, $show_empty, $discard_closed, $forcefocus, $disabled, 0, $filterkey, 1, $forceaddid, $htmlid);
95  }
96  if ($discard_closed)
97  {
98  if (class_exists('Form'))
99  {
100  if (empty($form)) $form=new Form($this->db);
101  $out.=$form->textwithpicto('', $langs->trans("ClosedProjectsAreHidden"));
102  }
103  }
104 
105  if (empty($nooutput))
106  {
107  print $out;
108  return '';
109  }
110  else return $out;
111  }
112 
133  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')
134  {
135  global $user,$conf,$langs;
136 
137  require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
138 
139  if (empty($htmlid)) $htmlid = $htmlname;
140 
141  $out='';
142  $outarray=array();
143 
144  $hideunselectables = false;
145  if (! empty($conf->global->PROJECT_HIDE_UNSELECTABLES)) $hideunselectables = true;
146 
147  $projectsListId = false;
148  if (empty($user->rights->projet->all->lire))
149  {
150  $projectstatic=new Project($this->db);
151  $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1);
152  }
153 
154  // Search all projects
155  $sql = 'SELECT p.rowid, p.ref, p.title, p.fk_soc, p.fk_statut, p.public, s.nom as name, s.name_alias';
156  $sql.= ' FROM '.MAIN_DB_PREFIX .'projet as p LEFT JOIN '.MAIN_DB_PREFIX .'societe as s ON s.rowid = p.fk_soc';
157  $sql.= " WHERE p.entity IN (".getEntity('project').")";
158  if ($projectsListId !== false) $sql.= " AND p.rowid IN (".$projectsListId.")";
159  if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
160  if ($socid > 0)
161  {
162  if (empty($conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY)) $sql.= " AND (p.fk_soc=".$socid." OR p.fk_soc IS NULL)";
163  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.
164  {
165  $sql.= " AND (p.fk_soc IN (".$socid.", ".$conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY.") OR p.fk_soc IS NULL)";
166  }
167  }
168  if (!empty($filterkey)) $sql .= natural_search(array('p.title', 'p.ref'), $filterkey);
169  $sql.= " ORDER BY p.ref ASC";
170 
171  $resql=$this->db->query($sql);
172  if ($resql)
173  {
174  // Use select2 selector
175  if (! empty($conf->use_javascript_ajax))
176  {
177  include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
178  $comboenhancement = ajax_combobox($htmlid, array(), 0, $forcefocus);
179  $out.=$comboenhancement;
180  $morecss='minwidth100 maxwidth500';
181  }
182 
183  if (empty($option_only)) {
184  $out.= '<select class="flat'.($morecss?' '.$morecss:'').'"'.($disabled?' disabled="disabled"':'').' id="'.$htmlid.'" name="'.$htmlname.'">';
185  }
186  if (!empty($show_empty)) {
187  $out.= '<option value="0">&nbsp;</option>';
188  }
189  $num = $this->db->num_rows($resql);
190  $i = 0;
191  if ($num)
192  {
193  while ($i < $num)
194  {
195  $obj = $this->db->fetch_object($resql);
196  // 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.
197  if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && ! $user->rights->societe->lire)
198  {
199  // Do nothing
200  }
201  else
202  {
203  if ($discard_closed == 1 && $obj->fk_statut == 2 && $obj->rowid != $selected) // We discard closed except if selected
204  {
205  $i++;
206  continue;
207  }
208 
209  $labeltoshow=dol_trunc($obj->ref,18);
210  //if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')';
211  //else $labeltoshow.=' ('.$langs->trans("Private").')';
212  $labeltoshow.=', '.dol_trunc($obj->title, $maxlength);
213  if ($obj->name)
214  {
215  $labeltoshow.=' - '.$obj->name;
216  if ($obj->name_alias) $labeltoshow.=' ('.$obj->name_alias.')';
217  }
218 
219  $disabled=0;
220  if ($obj->fk_statut == 0)
221  {
222  $disabled=1;
223  $labeltoshow.=' - '.$langs->trans("Draft");
224  }
225  else if ($obj->fk_statut == 2)
226  {
227  if ($discard_close == 2) $disabled=1;
228  $labeltoshow.=' - '.$langs->trans("Closed");
229  }
230  else if ( empty($conf->global->PROJECT_ALLOW_TO_LINK_FROM_OTHER_COMPANY) && $socid > 0 && (! empty($obj->fk_soc) && $obj->fk_soc != $socid))
231  {
232  $disabled=1;
233  $labeltoshow.=' - '.$langs->trans("LinkedToAnotherCompany");
234  }
235 
236  if (!empty($selected) && $selected == $obj->rowid)
237  {
238  $out.= '<option value="'.$obj->rowid.'" selected';
239  //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled
240  $out.= '>'.$labeltoshow.'</option>';
241  }
242  else
243  {
244  if ($hideunselectables && $disabled && ($selected != $obj->rowid))
245  {
246  $resultat='';
247  }
248  else
249  {
250  $resultat='<option value="'.$obj->rowid.'"';
251  if ($disabled) $resultat.=' disabled';
252  //if ($obj->public) $labeltoshow.=' ('.$langs->trans("Public").')';
253  //else $labeltoshow.=' ('.$langs->trans("Private").')';
254  $resultat.='>';
255  $resultat.=$labeltoshow;
256  $resultat.='</option>';
257  }
258  $out.= $resultat;
259 
260  $outarray[] = array(
261  'key' => (int) $obj->rowid,
262  'value' => $obj->ref,
263  'ref' => $obj->ref,
264  'label' => $labeltoshow,
265  'disabled' => (bool) $disabled
266  );
267  }
268  }
269  $i++;
270  }
271  }
272 
273  $this->db->free($resql);
274 
275  if (!$mode) {
276  if (empty($option_only)) $out.= '</select>';
277  if (empty($nooutput))
278  {
279  print $out;
280  return '';
281  }
282  else return $out;
283  } else {
284  return $outarray;
285  }
286  }
287  else
288  {
289  dol_print_error($this->db);
290  return -1;
291  }
292  }
293 
309  function selectTasks($socid=-1, $selected='', $htmlname='taskid', $maxlength=24, $option_only=0, $show_empty='1', $discard_closed=0, $forcefocus=0, $disabled=0, $morecss='maxwidth500')
310  {
311  global $user,$conf,$langs;
312 
313  require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
314 
315  $out='';
316 
317  $hideunselectables = false;
318  if (! empty($conf->global->PROJECT_HIDE_UNSELECTABLES)) $hideunselectables = true;
319 
320  $projectsListId = false;
321  if (empty($user->rights->projet->all->lire))
322  {
323  $projectstatic=new Project($this->db);
324  $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,0,1);
325  }
326 
327  // Search all projects
328  $sql = 'SELECT t.rowid, t.ref as tref, t.label as tlabel, p.ref, p.title, p.fk_soc, p.fk_statut, p.public,';
329  $sql.= ' s.nom as name';
330  $sql.= ' FROM '.MAIN_DB_PREFIX .'projet as p';
331  $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON s.rowid = p.fk_soc';
332  $sql.= ', '.MAIN_DB_PREFIX.'projet_task as t';
333  $sql.= " WHERE p.entity = ".$conf->entity;
334  $sql.= " AND t.fk_projet = p.rowid";
335  if ($projectsListId !== false) $sql.= " AND p.rowid IN (".$projectsListId.")";
336  if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
337  if ($socid > 0) $sql.= " AND (p.fk_soc=".$socid." OR p.fk_soc IS NULL)";
338  $sql.= " ORDER BY p.ref, t.ref ASC";
339 
340  $resql=$this->db->query($sql);
341  if ($resql)
342  {
343  // Use select2 selector
344  if (! empty($conf->use_javascript_ajax))
345  {
346  include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
347  $comboenhancement = ajax_combobox($htmlname, '', 0, $forcefocus);
348  $out.=$comboenhancement;
349  $morecss='minwidth200 maxwidth500';
350  }
351 
352  if (empty($option_only)) {
353  $out.= '<select class="valignmiddle flat'.($morecss?' '.$morecss:'').'"'.($disabled?' disabled="disabled"':'').' id="'.$htmlname.'" name="'.$htmlname.'">';
354  }
355  if (! empty($show_empty)) {
356  $out.= '<option value="0" class="optiongrey">';
357  if (! is_numeric($show_empty)) $out.=$show_empty;
358  else $out.='&nbsp;';
359  $out.= '</option>';
360  }
361  $num = $this->db->num_rows($resql);
362  $i = 0;
363  if ($num)
364  {
365  while ($i < $num)
366  {
367  $obj = $this->db->fetch_object($resql);
368  // 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.
369  if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && empty($user->rights->societe->lire))
370  {
371  // Do nothing
372  }
373  else
374  {
375  if ($discard_closed == 1 && $obj->fk_statut == 2)
376  {
377  $i++;
378  continue;
379  }
380 
381  $labeltoshow=dol_trunc($obj->ref,18); // Project ref
382  //if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')';
383  //else $labeltoshow.=' ('.$langs->trans("Private").')';
384  $labeltoshow.=' '.dol_trunc($obj->title,$maxlength);
385 
386  if ($obj->name) $labeltoshow.=' ('.$obj->name.')';
387 
388  $disabled=0;
389  if ($obj->fk_statut == 0)
390  {
391  $disabled=1;
392  $labeltoshow.=' - '.$langs->trans("Draft");
393  }
394  else if ($obj->fk_statut == 2)
395  {
396  if ($discard_closed == 2) $disabled=1;
397  $labeltoshow.=' - '.$langs->trans("Closed");
398  }
399  else if ($socid > 0 && (! empty($obj->fk_soc) && $obj->fk_soc != $socid))
400  {
401  $disabled=1;
402  $labeltoshow.=' - '.$langs->trans("LinkedToAnotherCompany");
403  }
404  // Label for task
405  $labeltoshow.=' - '.$obj->tref.' '.dol_trunc($obj->tlabel,$maxlength);
406 
407  if (!empty($selected) && $selected == $obj->rowid)
408  {
409  $out.= '<option value="'.$obj->rowid.'" selected';
410  //if ($disabled) $out.=' disabled'; // with select2, field can't be preselected if disabled
411  $out.= '>'.$labeltoshow.'</option>';
412  }
413  else
414  {
415  if ($hideunselectables && $disabled && ($selected != $obj->rowid))
416  {
417  $resultat='';
418  }
419  else
420  {
421  $resultat='<option value="'.$obj->rowid.'"';
422  if ($disabled) $resultat.=' disabled';
423  //if ($obj->public) $labeltoshow.=' ('.$langs->trans("Public").')';
424  //else $labeltoshow.=' ('.$langs->trans("Private").')';
425  $resultat.='>';
426  $resultat.=$labeltoshow;
427  $resultat.='</option>';
428  }
429  $out.= $resultat;
430  }
431  }
432  $i++;
433  }
434  }
435  if (empty($option_only)) {
436  $out.= '</select>';
437  }
438 
439  print $out;
440 
441  $this->db->free($resql);
442  return $num;
443  }
444  else
445  {
446  dol_print_error($this->db);
447  return -1;
448  }
449  }
450 
451 
461  function select_element($table_element, $socid=0, $morecss='', $limitonstatus=-2)
462  {
463  global $conf, $langs;
464 
465  if ($table_element == 'projet_task') return ''; // Special cas of element we never link to a project (already always done)
466 
467  $linkedtothirdparty=false;
468  if (! in_array($table_element, array('don','expensereport_det','expensereport','loan','stock_mouvement','chargesociales'))) $linkedtothirdparty=true;
469 
470  $sqlfilter='';
471  $projectkey="fk_projet";
472  //print $table_element;
473  switch ($table_element)
474  {
475  case "loan":
476  $sql = "SELECT t.rowid, t.label as ref";
477  break;
478  case "facture":
479  $sql = "SELECT t.rowid, t.facnumber as ref";
480  break;
481  case "facture_fourn":
482  $sql = "SELECT t.rowid, t.ref, t.ref_supplier";
483  break;
484  case "commande_fourn":
485  case "commande_fournisseur":
486  $sql = "SELECT t.rowid, t.ref, t.ref_supplier";
487  break;
488  case "facture_rec":
489  $sql = "SELECT t.rowid, t.titre as ref";
490  break;
491  case "actioncomm":
492  $sql = "SELECT t.id as rowid, t.label as ref";
493  $projectkey="fk_project";
494  break;
495  case "expensereport":
496  return '';
497  case "expensereport_det":
498  /*$sql = "SELECT rowid, '' as ref"; // table is llx_expensereport_det
499  $projectkey="fk_projet";
500  break;*/
501  return '';
502  case "commande":
503  case "contrat":
504  case "fichinter":
505  $sql = "SELECT t.rowid, t.ref";
506  break;
507  case 'stock_mouvement':
508  $sql = 'SELECT t.rowid, t.label as ref';
509  $projectkey='fk_origin';
510  break;
511  case "payment_various":
512  $sql = "SELECT t.rowid, t.num_payment as ref";
513  break;
514  case "chargesociales":
515  default:
516  $sql = "SELECT t.rowid, t.ref";
517  break;
518  }
519  if ($linkedtothirdparty) $sql.=", s.nom as name";
520  $sql.= " FROM ".MAIN_DB_PREFIX.$table_element." as t";
521  if ($linkedtothirdparty) $sql.=", ".MAIN_DB_PREFIX."societe as s";
522  $sql.= " WHERE ".$projectkey." is null";
523  if (! empty($socid) && $linkedtothirdparty)
524  {
525  if (is_numeric($socid)) $sql.= " AND t.fk_soc=".$socid;
526  else $sql.= " AND t.fk_soc IN (".$socid.")";
527  }
528  if (! in_array($table_element, array('expensereport_det','stock_mouvement'))) $sql.= ' AND t.entity IN ('.getEntity('project').')';
529  if ($linkedtothirdparty) $sql.=" AND s.rowid = t.fk_soc";
530  if ($sqlfilter) $sql.= " AND ".$sqlfilter;
531  $sql.= " ORDER BY ref DESC";
532 
533  dol_syslog(get_class($this).'::select_element', LOG_DEBUG);
534  $resql=$this->db->query($sql);
535  if ($resql)
536  {
537  $num = $this->db->num_rows($resql);
538  $i = 0;
539  if ($num > 0)
540  {
541  $sellist = '<select class="flat elementselect css'.$table_element.($morecss?' '.$morecss:'').'" name="elementselect">';
542  $sellist .='<option value="-1"></option>';
543  while ($i < $num)
544  {
545  $obj = $this->db->fetch_object($resql);
546  $ref=$obj->ref?$obj->ref:$obj->rowid;
547  if (! empty($obj->ref_supplier)) $ref.=' ('.$obj->ref_supplier.')';
548  if (! empty($obj->name)) $ref.=' - '.$obj->name;
549  $sellist .='<option value="'.$obj->rowid.'">'.$ref.'</option>';
550  $i++;
551  }
552  $sellist .='</select>';
553  }
554  /*else
555  {
556  $sellist = '<select class="flat" name="elementselect">';
557  $sellist.= '<option value="0" disabled>'.$langs->trans("None").'</option>';
558  $sellist.= '</select>';
559  }*/
560  $this->db->free($resql);
561 
562  return $sellist;
563  }
564  else
565  {
566  dol_print_error($this->db);
567  $this->error=$this->db->lasterror();
568  $this->errors[]=$this->db->lasterror();
569  dol_syslog(get_class($this) . "::select_element " . $this->error, LOG_ERR);
570  return -1;
571  }
572  }
573 
574 
587  function selectOpportunityStatus($htmlname, $preselected='-1', $showempty=1, $useshortlabel=0, $showallnone=0, $showpercent=0, $morecss='')
588  {
589  global $conf, $langs;
590 
591  $sql = "SELECT rowid, code, label, percent";
592  $sql.= " FROM ".MAIN_DB_PREFIX.'c_lead_status';
593  $sql.= " WHERE active = 1";
594  $sql.= " ORDER BY position";
595 
596  $resql=$this->db->query($sql);
597  if ($resql)
598  {
599  $num = $this->db->num_rows($resql);
600  $i = 0;
601  if ($num > 0)
602  {
603  $sellist = '<select class="flat oppstatus'.($morecss?' '.$morecss:'').'" id="'.$htmlname.'" name="'.$htmlname.'">';
604  if ($showempty) $sellist.= '<option value="-1">&nbsp;</option>'; // Without &nbsp, strange move of screen when switching value
605  if ($showallnone) $sellist.= '<option value="all"'.($preselected == 'all'?' selected="selected"':'').'>--'.$langs->trans("OnlyOpportunitiesShort").'--</option>';
606  if ($showallnone) $sellist.= '<option value="openedopp"'.($preselected == 'openedopp'?' selected="selected"':'').'>--'.$langs->trans("OpenedOpportunitiesShort").'--</option>';
607  if ($showallnone) $sellist.= '<option value="none"'.($preselected == 'none'?' selected="selected"':'').'>--'.$langs->trans("NotAnOpportunityShort").'--</option>';
608  while ($i < $num)
609  {
610  $obj = $this->db->fetch_object($resql);
611 
612  $sellist .='<option value="'.$obj->rowid.'" defaultpercent="'.$obj->percent.'" elemcode="'.$obj->code.'"';
613  if ($obj->rowid == $preselected) $sellist .= ' selected="selected"';
614  $sellist .= '>';
615  if ($useshortlabel)
616  {
617  $finallabel = ($langs->transnoentitiesnoconv("OppStatusShort".$obj->code) != "OppStatusShort".$obj->code ? $langs->transnoentitiesnoconv("OppStatusShort".$obj->code) : $obj->label);
618  }
619  else
620  {
621  $finallabel = ($langs->transnoentitiesnoconv("OppStatus".$obj->code) != "OppStatus".$obj->code ? $langs->transnoentitiesnoconv("OppStatus".$obj->code) : $obj->label);
622  if ($showpercent) $finallabel.= ' ('.$obj->percent.'%)';
623  }
624  $sellist .= $finallabel;
625  $sellist .='</option>';
626  $i++;
627  }
628  $sellist .='</select>';
629  }
630  /*else
631  {
632  $sellist = '<select class="flat" name="elementselect">';
633  $sellist.= '<option value="0" disabled>'.$langs->trans("None").'</option>';
634  $sellist.= '</select>';
635  }*/
636  $this->db->free($resql);
637 
638  return $sellist;
639  }
640  else
641  {
642  $this->error=$this->db->lasterror();
643  $this->errors[]=$this->db->lasterror();
644  dol_syslog(get_class($this) . "::selectOpportunityStatus " . $this->error, LOG_ERR);
645  return -1;
646  }
647  }
648 
649 }
ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0, $forcefocus=0, $widthTypeOfAutocomplete='resolve')
Convert a html select field into an ajax combobox.
Definition: ajax.lib.php:392
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.
if(GETPOST('cancel','alpha')) if(!GETPOST('confirmmassaction','alpha')&&$massaction!= 'presend'&&$massaction!= 'confirm_presend')
Draft customers invoices.
Definition: list.php:147
selectTasks($socid=-1, $selected='', $htmlname='taskid', $maxlength=24, $option_only=0, $show_empty='1', $discard_closed=0, $forcefocus=0, $disabled=0, $morecss='maxwidth500')
Output a combo list with projects qualified for a third party.
__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...
if(empty($reshook)) $form
View.
Definition: perms.php:103
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.
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 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.
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...
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...
print
Draft customers invoices.
Definition: index.php:91
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:1013
select_element($table_element, $socid=0, $morecss='', $limitonstatus=-2)
Build a HTML select list of element of same thirdparty to suggest to link them to project...
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