dolibarr  7.0.0-beta
list.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
5  * Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
6  * Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
7  * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
8  * Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
9  * Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com>
10  * Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
11  * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
12  * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
13  * Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
14  * Copyright (C) 2017 Charlene Benke <charlie@patas-monkey.com>
15  *
16  * This program is free software; you can redistribute it and/or modify
17  * it under the terms of the GNU General Public License as published by
18  * the Free Software Foundation; either version 3 of the License, or
19  * (at your option) any later version.
20  *
21  * This program is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24  * GNU General Public License for more details.
25  *
26  * You should have received a copy of the GNU General Public License
27  * along with this program. If not, see <http://www.gnu.org/licenses/>.
28  */
29 
36 require '../../main.inc.php';
37 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
38 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
39 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formpropal.class.php';
40 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
41 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
42 require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
43 require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
44 if (! empty($conf->projet->enabled))
45  require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
46 
47 $langs->load('companies');
48 $langs->load('propal');
49 $langs->load('compta');
50 $langs->load('bills');
51 $langs->load('orders');
52 $langs->load('products');
53 
54 $socid=GETPOST('socid','int');
55 
56 $action=GETPOST('action','alpha');
57 $massaction=GETPOST('massaction','alpha');
58 $show_files=GETPOST('show_files','int');
59 $confirm=GETPOST('confirm','alpha');
60 $toselect = GETPOST('toselect', 'array');
61 
62 $search_user=GETPOST('search_user','int');
63 $search_sale=GETPOST('search_sale','int');
64 $search_ref=GETPOST('sf_ref')?GETPOST('sf_ref','alpha'):GETPOST('search_ref','alpha');
65 $search_refcustomer=GETPOST('search_refcustomer','alpha');
66 
67 $search_refproject=GETPOST('search_refproject','alpha');
68 
69 $search_societe=GETPOST('search_societe','alpha');
70 $search_montant_ht=GETPOST('search_montant_ht','alpha');
71 $search_montant_vat=GETPOST('search_montant_vat','alpha');
72 $search_montant_ttc=GETPOST('search_montant_ttc','alpha');
73 $search_login=GETPOST('search_login','alpha');
74 $search_product_category=GETPOST('search_product_category','int');
75 $search_town=GETPOST('search_town','alpha');
76 $search_zip=GETPOST('search_zip','alpha');
77 $search_state=trim(GETPOST("search_state"));
78 $search_country=GETPOST("search_country",'int');
79 $search_type_thirdparty=GETPOST("search_type_thirdparty",'int');
80 $search_day=GETPOST("search_day","int");
81 $search_month=GETPOST("search_month","int");
82 $search_year=GETPOST("search_year","int");
83 
84 $viewstatut=GETPOST('viewstatut','alpha');
85 $optioncss = GETPOST('optioncss','alpha');
86 $object_statut=GETPOST('search_statut','alpha');
87 
88 $sall=trim((GETPOST('search_all', 'alphanohtml')!='')?GETPOST('search_all', 'alphanohtml'):GETPOST('sall', 'alphanohtml'));
89 $mesg=(GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg"));
90 
91 
92 $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit;
93 $sortfield = GETPOST("sortfield",'alpha');
94 $sortorder = GETPOST("sortorder",'alpha');
95 $page = GETPOST("page",'int');
96 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
97 $offset = $limit * $page;
98 $pageprev = $page - 1;
99 $pagenext = $page + 1;
100 if (! $sortfield) $sortfield='p.ref';
101 if (! $sortorder) $sortorder='DESC';
102 
103 // Initialize technical object to manage context to save list fields
104 $contextpage=GETPOST('contextpage','aZ')?GETPOST('contextpage','aZ'):'proposallist';
105 
106 // Security check
107 $module='propal';
108 $dbtable='';
109 $objectid='';
110 if (! empty($user->societe_id)) $socid=$user->societe_id;
111 if (! empty($socid))
112 {
113  $objectid=$socid;
114  $module='societe';
115  $dbtable='&societe';
116 }
117 $result = restrictedArea($user, $module, $objectid, $dbtable);
118 
119 $diroutputmassaction=$conf->propal->dir_output . '/temp/massgeneration/'.$user->id;
120 
121 // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
122 $hookmanager->initHooks(array('propallist'));
123 $extrafields = new ExtraFields($db);
124 
125 // fetch optionals attributes and labels
126 $extralabels = $extrafields->fetch_name_optionals_label('propal');
127 $search_array_options=$extrafields->getOptionalsFromPost($extralabels,'','search_');
128 
129 // List of fields to search into when doing a "search in all"
130 $fieldstosearchall = array(
131  'p.ref'=>'Ref',
132  'p.ref_client'=>'CustomerRef',
133  'pd.description'=>'Description',
134  's.nom'=>"ThirdParty",
135  'p.note_public'=>'NotePublic',
136 );
137 if (empty($user->socid)) $fieldstosearchall["p.note_private"]="NotePrivate";
138 
139 
140 $checkedtypetiers=0;
141 $arrayfields=array(
142  'p.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
143  'p.ref_client'=>array('label'=>$langs->trans("RefCustomer"), 'checked'=>1),
144  'pr.ref'=>array('label'=>$langs->trans("Project"), 'checked'=>1, 'enabled'=>(empty($conf->projet->enabled)?0:1)),
145  's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1),
146  's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>1),
147  's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>1),
148  'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0),
149  'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0),
150  'typent.code'=>array('label'=>$langs->trans("ThirdPartyType"), 'checked'=>$checkedtypetiers),
151  'p.date'=>array('label'=>$langs->trans("Date"), 'checked'=>1),
152  'p.fin_validite'=>array('label'=>$langs->trans("DateEnd"), 'checked'=>1),
153  'p.total_ht'=>array('label'=>$langs->trans("AmountHT"), 'checked'=>1),
154  'p.total_vat'=>array('label'=>$langs->trans("AmountVAT"), 'checked'=>0),
155  'p.total_ttc'=>array('label'=>$langs->trans("AmountTTC"), 'checked'=>0),
156  'u.login'=>array('label'=>$langs->trans("Author"), 'checked'=>1, 'position'=>10),
157  'p.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
158  'p.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
159  'p.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
160 );
161 // Extra fields
162 if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label))
163 {
164  foreach($extrafields->attribute_label as $key => $val)
165  {
166  if (! empty($extrafields->attribute_list[$key])) $arrayfields["ef.".$key]=array('label'=>$extrafields->attribute_label[$key], 'checked'=>(($extrafields->attribute_list[$key]<0)?0:1), 'position'=>$extrafields->attribute_pos[$key], 'enabled'=>(abs($extrafields->attribute_list[$key])!=3 && $extrafields->attribute_perms[$key]));
167  }
168 }
169 
170 $object = new Propal($db); // To be passed as parameter of executeHooks that need
171 
172 
173 /*
174  * Actions
175  */
176 
177 if (GETPOST('cancel','alpha')) { $action='list'; $massaction=''; }
178 if (! GETPOST('confirmmassaction','alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction=''; }
179 
180 $parameters=array('socid'=>$socid);
181 $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
182 if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
183 
184 include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
185 
186 // Do we click on purge search criteria ?
187 if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
188 {
189  $search_categ='';
190  $search_user='';
191  $search_sale='';
192  $search_ref='';
193  $search_refcustomer='';
194  $search_refproject='';
195  $search_societe='';
196  $search_montant_ht='';
197  $search_montant_vat='';
198  $search_montant_ttc='';
199  $search_login='';
200  $search_product_category='';
201  $search_town='';
202  $search_zip="";
203  $search_state="";
204  $search_type='';
205  $search_country='';
206  $search_type_thirdparty='';
207  $search_year='';
208  $search_month='';
209  $search_day='';
210  $viewstatut='';
211  $object_statut='';
212  $toselect='';
213  $search_array_options=array();
214 }
215 if ($object_statut != '') $viewstatut=$object_statut;
216 
217 if (empty($reshook))
218 {
219  $objectclass='Propal';
220  $objectlabel='Proposals';
221  $permtoread = $user->rights->propal->lire;
222  $permtodelete = $user->rights->propal->supprimer;
223  $uploaddir = $conf->propal->dir_output;
224  include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
225 }
226 
227 
228 
229 /*
230  * View
231  */
232 
233 $now=dol_now();
234 
235 $form = new Form($db);
236 $formother = new FormOther($db);
237 $formfile = new FormFile($db);
238 $formpropal = new FormPropal($db);
239 $companystatic=new Societe($db);
240 $formcompany=new FormCompany($db);
241 
242 $help_url='EN:Commercial_Proposals|FR:Proposition_commerciale|ES:Presupuestos';
243 llxHeader('',$langs->trans('Proposal'),$help_url);
244 
245 $sql = 'SELECT';
246 if ($sall || $search_product_category > 0) $sql = 'SELECT DISTINCT';
247 $sql.= ' s.rowid as socid, s.nom as name, s.email, s.town, s.zip, s.fk_pays, s.client, s.code_client, ';
248 $sql.= " typent.code as typent_code,";
249 $sql.= " state.code_departement as state_code, state.nom as state_name,";
250 $sql.= ' p.rowid, p.note_private, p.total_ht, p.tva as total_vat, p.total as total_ttc, p.localtax1, p.localtax2, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,';
251 $sql.= ' p.datec as date_creation, p.tms as date_update,';
252 $sql.= " pr.rowid as project_id, pr.ref as project_ref,";
253 if (! $user->rights->societe->client->voir && ! $socid) $sql .= " sc.fk_soc, sc.fk_user,";
254 $sql.= ' u.login';
255 // Add fields from extrafields
256 foreach ($extrafields->attribute_label as $key => $val) $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key.' as options_'.$key : '');
257 // Add fields from hooks
258 $parameters=array();
259 $reshook=$hookmanager->executeHooks('printFieldListSelect',$parameters); // Note that $action and $object may have been modified by hook
260 $sql.=$hookmanager->resPrint;
261 $sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s';
262 $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)";
263 $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)";
264 $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)";
265 $sql.= ', '.MAIN_DB_PREFIX.'propal as p';
266 if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."propal_extrafields as ef on (p.rowid = ef.fk_object)";
267 if ($sall || $search_product_category > 0) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'propaldet as pd ON p.rowid=pd.fk_propal';
268 if ($search_product_category > 0) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=pd.fk_product';
269 $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON p.fk_user_author = u.rowid';
270 $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet as pr ON pr.rowid = p.fk_projet";
271 // We'll need this table joined to the select in order to filter by sale
272 if ($search_sale > 0 || (! $user->rights->societe->client->voir && ! $socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
273 if ($search_user > 0)
274 {
275  $sql.=", ".MAIN_DB_PREFIX."element_contact as c";
276  $sql.=", ".MAIN_DB_PREFIX."c_type_contact as tc";
277 }
278 $sql.= ' WHERE p.fk_soc = s.rowid';
279 $sql.= ' AND p.entity IN ('.getEntity('propal').')';
280 if (! $user->rights->societe->client->voir && ! $socid) //restriction
281 {
282  $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
283 }
284 if ($search_town) $sql.= natural_search('s.town', $search_town);
285 if ($search_zip) $sql.= natural_search("s.zip", $search_zip);
286 if ($search_state) $sql.= natural_search("state.nom", $search_state);
287 if ($search_country) $sql .= " AND s.fk_pays IN (".$db->escape($search_country).')';
288 if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$db->escape($search_type_thirdparty).')';
289 if ($search_ref) $sql .= natural_search('p.ref', $search_ref);
290 if ($search_refcustomer) $sql .= natural_search('p.ref_client', $search_refcustomer);
291 if ($search_refproject) $sql .= natural_search('pr.ref', $search_refprojet);
292 
293 if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
294 if ($search_login) $sql .= natural_search("u.login", $search_login);
295 if ($search_montant_ht != '') $sql.= natural_search("p.total_ht", $search_montant_ht, 1);
296 if ($search_montant_vat != '') $sql.= natural_search("p.tva", $search_montant_vat, 1);
297 if ($search_montant_ttc != '') $sql.= natural_search("p.total", $search_montant_ttc, 1);
298 if ($sall) {
299  $sql .= natural_search(array_keys($fieldstosearchall), $sall);
300 }
301 if ($search_product_category > 0) $sql.=" AND cp.fk_categorie = ".$db->escape($search_product_category);
302 if ($socid > 0) $sql.= ' AND s.rowid = '.$socid;
303 if ($viewstatut != '' && $viewstatut != '-1')
304 {
305  $sql.= ' AND p.fk_statut IN ('.$db->escape($viewstatut).')';
306 }
307 if ($search_month > 0)
308 {
309  if ($search_year > 0 && empty($search_day))
310  $sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($search_year,$search_month,false))."' AND '".$db->idate(dol_get_last_day($search_year,$search_month,false))."'";
311  else if ($search_year > 0 && ! empty($search_day))
312  $sql.= " AND p.datep BETWEEN '".$db->idate(dol_mktime(0, 0, 0, $search_month, $search_day, $search_year))."' AND '".$db->idate(dol_mktime(23, 59, 59, $search_month, $search_day, $search_year))."'";
313  else
314  $sql.= " AND date_format(p.datep, '%m') = '".$db->escape($search_month)."'";
315 }
316 else if ($search_year > 0)
317 {
318  $sql.= " AND p.datep BETWEEN '".$db->idate(dol_get_first_day($search_year,1,false))."' AND '".$db->idate(dol_get_last_day($search_year,12,false))."'";
319 }
320 if ($search_sale > 0) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$db->escape($search_sale);
321 if ($search_user > 0)
322 {
323  $sql.= " AND c.fk_c_type_contact = tc.rowid AND tc.element='propal' AND tc.source='internal' AND c.element_id = p.rowid AND c.fk_socpeople = ".$db->escape($search_user);
324 }
325 // Add where from extra fields
326 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
327 
328 // Add where from hooks
329 $parameters=array();
330 $reshook=$hookmanager->executeHooks('printFieldListWhere',$parameters); // Note that $action and $object may have been modified by hook
331 $sql.=$hookmanager->resPrint;
332 
333 $sql.= $db->order($sortfield,$sortorder);
334 $sql.=', p.ref DESC';
335 
336 // Count total nb of records
337 $nbtotalofrecords = '';
338 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
339 {
340  $result = $db->query($sql);
341  $nbtotalofrecords = $db->num_rows($result);
342 }
343 
344 $sql.= $db->plimit($limit+1, $offset);
345 
346 $resql=$db->query($sql);
347 if ($resql)
348 {
349  $objectstatic=new Propal($db);
350  $userstatic=new User($db);
351 
352  if ($socid > 0)
353  {
354  $soc = new Societe($db);
355  $soc->fetch($socid);
356  $title = $langs->trans('ListOfProposals') . ' - '.$soc->name;
357  if (empty($search_societe)) $search_societe = $soc->name;
358  }
359  else
360  {
361  $title = $langs->trans('ListOfProposals');
362  }
363 
364  $num = $db->num_rows($resql);
365 
366  $arrayofselected=is_array($toselect)?$toselect:array();
367 
368  $param='&viewstatut='.urlencode($viewstatut);
369  if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.urlencode($contextpage);
370  if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.urlencode($limit);
371  if ($sall) $param.='&sall='.urlencode($sall);
372  if ($search_day) $param.='&search_day='.urlencode($search_day);
373  if ($search_month) $param.='&search_month='.urlencode($search_month);
374  if ($search_year) $param.='&search_year='.urlencode($search_year);
375  if ($search_ref) $param.='&search_ref='.urlencode($search_ref);
376  if ($search_refcustomer) $param.='&search_refcustomer='.urlencode($search_refcustomer);
377  if ($search_refprojet) $param.='&search_refprojet='.urlencode($search_refprojet);
378  if ($search_societe) $param.='&search_societe='.urlencode($search_societe);
379  if ($search_user > 0) $param.='&search_user='.urlencode($search_user);
380  if ($search_sale > 0) $param.='&search_sale='.urlencode($search_sale);
381  if ($search_montant_ht) $param.='&search_montant_ht='.urlencode($search_montant_ht);
382  if ($search_login) $param.='&search_login='.urlencode($search_login);
383  if ($search_town) $param.='&search_town='.urlencode($search_town);
384  if ($search_zip) $param.='&search_zip='.urlencode($search_zip);
385  if ($socid > 0) $param.='&socid='.urlencode($socid);
386  if ($optioncss != '') $param.='&optioncss='.urlencode($optioncss);
387 
388  // Add $param from extra fields
389  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
390 
391  // List of mass actions available
392  $arrayofmassactions = array(
393  'presend'=>$langs->trans("SendByMail"),
394  'builddoc'=>$langs->trans("PDFMerge"),
395  );
396  if ($user->rights->propal->supprimer) $arrayofmassactions['predelete']=$langs->trans("Delete");
397  if (in_array($massaction, array('presend','predelete'))) $arrayofmassactions=array();
398  $massactionbutton=$form->selectMassAction('', $arrayofmassactions);
399 
400  // Lignes des champs de filtre
401  print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
402  if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
403  print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
404  print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
405  print '<input type="hidden" name="action" value="list">';
406  print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
407  print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
408  print '<input type="hidden" name="page" value="'.$page.'">';
409  print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
410 
411  print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_commercial.png', 0, '', '', $limit);
412 
413  $topicmail="SendPropalRef";
414  $modelmail="proposal_send";
415  $objecttmp=new Propal($db);
416  $trackid='pro'.$object->id;
417  include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
418 
419  if ($sall)
420  {
421  foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
422  print $langs->trans("FilterOnInto", $sall) . join(', ',$fieldstosearchall);
423  }
424 
425  $i = 0;
426 
427  $moreforfilter='';
428 
429  // If the user can view prospects other than his'
430  if ($user->rights->societe->client->voir || $socid)
431  {
432  $langs->load("commercial");
433  $moreforfilter.='<div class="divsearchfield">';
434  $moreforfilter.=$langs->trans('ThirdPartiesOfSaleRepresentative'). ': ';
435  $moreforfilter.=$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, 1, 'maxwidth200');
436  $moreforfilter.='</div>';
437  }
438  // If the user can view prospects other than his'
439  if ($user->rights->societe->client->voir || $socid)
440  {
441  $moreforfilter.='<div class="divsearchfield">';
442  $moreforfilter.=$langs->trans('LinkedToSpecificUsers'). ': ';
443  $moreforfilter.=$form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200');
444  $moreforfilter.='</div>';
445  }
446  // If the user can view products
447  if ($conf->categorie->enabled && ($user->rights->produit->lire || $user->rights->service->lire))
448  {
449  include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
450  $moreforfilter.='<div class="divsearchfield">';
451  $moreforfilter.=$langs->trans('IncludingProductWithTag'). ': ';
452  $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
453  $moreforfilter.=$form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1);
454  $moreforfilter.='</div>';
455  }
456  $parameters=array();
457  $reshook=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
458  if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
459  else $moreforfilter = $hookmanager->resPrint;
460 
461  if (! empty($moreforfilter))
462  {
463  print '<div class="liste_titre liste_titre_bydiv centpercent">';
464  print $moreforfilter;
465  print '</div>';
466  }
467 
468  $varpage=empty($contextpage)?$_SERVER["PHP_SELF"]:$contextpage;
469  $selectedfields=$form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
470  if ($massactionbutton) $selectedfields.=$form->showCheckAddButtons('checkforselect', 1);
471 
472  print '<div class="div-table-responsive">';
473  print '<table class="tagtable liste'.($moreforfilter?" listwithfilterbefore":"").'">'."\n";
474 
475  print '<tr class="liste_titre_filter">';
476  if (! empty($arrayfields['p.ref']['checked']))
477  {
478  print '<td class="liste_titre">';
479  print '<input class="flat" size="6" type="text" name="search_ref" value="'.$search_ref.'">';
480  print '</td>';
481  }
482  if (! empty($arrayfields['p.ref_client']['checked']))
483  {
484  print '<td class="liste_titre">';
485  print '<input class="flat" size="6" type="text" name="search_refcustomer" value="'.$search_refcustomer.'">';
486  print '</td>';
487  }
488  if (! empty($arrayfields['pr.ref']['checked']))
489  {
490  print '<td class="liste_titre">';
491  print '<input class="flat" size="6" type="text" name="search_refproject" value="'.$search_refproject.'">';
492  print '</td>';
493  }
494  if (! empty($arrayfields['s.nom']['checked']))
495  {
496  print '<td class="liste_titre" align="left">';
497  print '<input class="flat" type="text" size="10" name="search_societe" value="'.$search_societe.'">';
498  print '</td>';
499  }
500  if (! empty($arrayfields['s.town']['checked'])) print '<td class="liste_titre"><input class="flat" type="text" size="6" name="search_town" value="'.$search_town.'"></td>';
501  if (! empty($arrayfields['s.zip']['checked'])) print '<td class="liste_titre"><input class="flat" type="text" size="4" name="search_zip" value="'.$search_zip.'"></td>';
502  // State
503  if (! empty($arrayfields['state.nom']['checked']))
504  {
505  print '<td class="liste_titre">';
506  print '<input class="flat" size="4" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).'">';
507  print '</td>';
508  }
509  // Country
510  if (! empty($arrayfields['country.code_iso']['checked']))
511  {
512  print '<td class="liste_titre" align="center">';
513  print $form->select_country($search_country,'search_country','',0,'maxwidth100');
514  print '</td>';
515  }
516  // Company type
517  if (! empty($arrayfields['typent.code']['checked']))
518  {
519  print '<td class="liste_titre maxwidthonsmartphone" align="center">';
520  print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT)?'ASC':$conf->global->SOCIETE_SORT_ON_TYPEENT));
521  print '</td>';
522  }
523  // Date
524  if (! empty($arrayfields['p.date']['checked']))
525  {
526  print '<td class="liste_titre" align="center">';
527  //print $langs->trans('Month').': ';
528  if (! empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat" type="text" size="1" maxlength="2" name="search_day" value="'.$search_day.'">';
529  print '<input class="flat" type="text" size="1" maxlength="2" name="search_month" value="'.$search_month.'">';
530  //print '&nbsp;'.$langs->trans('Year').': ';
531  $formother->select_year($search_year,'search_year',1, 20, 5);
532  print '</td>';
533  }
534  // Date end
535  if (! empty($arrayfields['p.fin_validite']['checked']))
536  {
537  print '<td class="liste_titre">&nbsp;</td>';
538  }
539  if (! empty($arrayfields['p.total_ht']['checked']))
540  {
541  // Amount
542  print '<td class="liste_titre" align="right">';
543  print '<input class="flat" type="text" size="5" name="search_montant_ht" value="'.$search_montant_ht.'">';
544  print '</td>';
545  }
546  if (! empty($arrayfields['p.total_vat']['checked']))
547  {
548  // Amount
549  print '<td class="liste_titre" align="right">';
550  print '<input class="flat" type="text" size="5" name="search_montant_vat" value="'.$search_montant_vat.'">';
551  print '</td>';
552  }
553  if (! empty($arrayfields['p.total_ttc']['checked']))
554  {
555  // Amount
556  print '<td class="liste_titre" align="right">';
557  print '<input class="flat" type="text" size="5" name="search_montant_ttc" value="'.$search_montant_ttc.'">';
558  print '</td>';
559  }
560  if (! empty($arrayfields['u.login']['checked']))
561  {
562  // Author
563  print '<td class="liste_titre" align="center">';
564  print '<input class="flat" size="4" type="text" name="search_login" value="'.$search_login.'">';
565  print '</td>';
566  }
567  // Extra fields
568  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
569 
570  // Fields from hook
571  $parameters=array('arrayfields'=>$arrayfields);
572  $reshook=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
573  print $hookmanager->resPrint;
574  // Date creation
575  if (! empty($arrayfields['p.datec']['checked']))
576  {
577  print '<td class="liste_titre">';
578  print '</td>';
579  }
580  // Date modification
581  if (! empty($arrayfields['p.tms']['checked']))
582  {
583  print '<td class="liste_titre">';
584  print '</td>';
585  }
586  // Status
587  if (! empty($arrayfields['p.fk_statut']['checked']))
588  {
589  print '<td class="liste_titre maxwidthonsmartphone" align="right">';
590  $formpropal->selectProposalStatus($viewstatut, 1, 0, 1, 'customer', 'search_statut');
591  print '</td>';
592  }
593  // Action column
594  print '<td class="liste_titre" align="middle">';
595  $searchpicto=$form->showFilterButtons();
596  print $searchpicto;
597  print '</td>';
598 
599  print "</tr>\n";
600 
601 
602  // Fields title
603  print '<tr class="liste_titre">';
604  if (! empty($arrayfields['p.ref']['checked'])) print_liste_field_titre($arrayfields['p.ref']['label'],$_SERVER["PHP_SELF"],'p.ref','',$param,'',$sortfield,$sortorder);
605  if (! empty($arrayfields['p.ref_client']['checked'])) print_liste_field_titre($arrayfields['p.ref_client']['label'],$_SERVER["PHP_SELF"],'p.ref_client','',$param,'',$sortfield,$sortorder);
606  if (! empty($arrayfields['pr.ref']['checked'])) print_liste_field_titre($arrayfields['pr.ref']['label'],$_SERVER["PHP_SELF"],'pr.ref','',$param,'',$sortfield,$sortorder);
607  if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'],$_SERVER["PHP_SELF"],'s.nom','',$param,'',$sortfield,$sortorder);
608  if (! empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'],$_SERVER["PHP_SELF"],'s.town','',$param,'',$sortfield,$sortorder);
609  if (! empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'],$_SERVER["PHP_SELF"],'s.zip','',$param,'',$sortfield,$sortorder);
610  if (! empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'],$_SERVER["PHP_SELF"],"state.nom","",$param,'',$sortfield,$sortorder);
611  if (! empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'],$_SERVER["PHP_SELF"],"country.code_iso","",$param,'align="center"',$sortfield,$sortorder);
612  if (! empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'],$_SERVER["PHP_SELF"],"typent.code","",$param,'align="center"',$sortfield,$sortorder);
613  if (! empty($arrayfields['p.date']['checked'])) print_liste_field_titre($arrayfields['p.date']['label'],$_SERVER["PHP_SELF"],'p.datep','',$param, 'align="center"',$sortfield,$sortorder);
614  if (! empty($arrayfields['p.fin_validite']['checked'])) print_liste_field_titre($arrayfields['p.fin_validite']['label'],$_SERVER["PHP_SELF"],'dfv','',$param, 'align="center"',$sortfield,$sortorder);
615  if (! empty($arrayfields['p.total_ht']['checked'])) print_liste_field_titre($arrayfields['p.total_ht']['label'],$_SERVER["PHP_SELF"],'p.total_ht','',$param, 'align="right"',$sortfield,$sortorder);
616  if (! empty($arrayfields['p.total_vat']['checked'])) print_liste_field_titre($arrayfields['p.total_vat']['label'],$_SERVER["PHP_SELF"],'p.tva','',$param, 'align="right"',$sortfield,$sortorder);
617  if (! empty($arrayfields['p.total_ttc']['checked'])) print_liste_field_titre($arrayfields['p.total_ttc']['label'],$_SERVER["PHP_SELF"],'p.total','',$param, 'align="right"',$sortfield,$sortorder);
618  if (! empty($arrayfields['u.login']['checked'])) print_liste_field_titre($arrayfields['u.login']['label'],$_SERVER["PHP_SELF"],'u.login','',$param,'align="center"',$sortfield,$sortorder);
619  // Extra fields
620  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
621  // Hook fields
622  $parameters=array('arrayfields'=>$arrayfields);
623  $reshook=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
624  print $hookmanager->resPrint;
625  if (! empty($arrayfields['p.datec']['checked'])) print_liste_field_titre($arrayfields['p.datec']['label'],$_SERVER["PHP_SELF"],"p.datec","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
626  if (! empty($arrayfields['p.tms']['checked'])) print_liste_field_titre($arrayfields['p.tms']['label'],$_SERVER["PHP_SELF"],"p.tms","",$param,'align="center" class="nowrap"',$sortfield,$sortorder);
627  if (! empty($arrayfields['p.fk_statut']['checked'])) print_liste_field_titre($arrayfields['p.fk_statut']['label'],$_SERVER["PHP_SELF"],"p.fk_statut","",$param,'align="right"',$sortfield,$sortorder);
628  print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ');
629  print '</tr>'."\n";
630 
631  $now = dol_now();
632  $i=0;
633  $totalarray=array();
634  while ($i < min($num,$limit))
635  {
636  $obj = $db->fetch_object($resql);
637 
638  $objectstatic->id=$obj->rowid;
639  $objectstatic->ref=$obj->ref;
640 
641  print '<tr class="oddeven">';
642 
643  if (! empty($arrayfields['p.ref']['checked']))
644  {
645  print '<td class="nowrap">';
646 
647  print '<table class="nobordernopadding"><tr class="nocellnopadd">';
648  // Picto + Ref
649  print '<td class="nobordernopadding nowrap">';
650  print $objectstatic->getNomUrl(1, '', '', 0, 1);
651  print '</td>';
652  // Warning
653  $warnornote='';
654  if ($obj->fk_statut == 1 && $db->jdate($obj->dfv) < ($now - $conf->propal->cloture->warning_delay)) $warnornote.=img_warning($langs->trans("Late"));
655  if (! empty($obj->note_private))
656  {
657  $warnornote.=($warnornote?' ':'');
658  $warnornote.= '<span class="note">';
659  $warnornote.= '<a href="note.php?id='.$obj->rowid.'">'.img_picto($langs->trans("ViewPrivateNote"),'object_generic').'</a>';
660  $warnornote.= '</span>';
661  }
662  if ($warnornote)
663  {
664  print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
665  print $warnornote;
666  print '</td>';
667  }
668  // Other picto tool
669  print '<td width="16" align="right" class="nobordernopadding">';
670  $filename=dol_sanitizeFileName($obj->ref);
671  $filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref);
672  $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
673  print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
674  print '</td></tr></table>';
675 
676  print "</td>\n";
677  if (! $i) $totalarray['nbfield']++;
678  }
679 
680  if (! empty($arrayfields['p.ref_client']['checked']))
681  {
682  // Customer ref
683  print '<td class="nocellnopadd nowrap">';
684  print $obj->ref_client;
685  print '</td>';
686  if (! $i) $totalarray['nbfield']++;
687  }
688 
689  if (! empty($arrayfields['pr.ref']['checked']))
690  {
691  // Project ref
692  print '<td class="nocellnopadd nowrap">';
693  if ($obj->project_id) {
694  $projectstatic->fetch($obj->project_id);
695  print $projectstatic->getNomUrl(1);
696  }
697  print '</td>';
698  if (! $i) $totalarray['nbfield']++;
699  }
700 
701  $companystatic->id=$obj->socid;
702  $companystatic->name=$obj->name;
703  $companystatic->client=$obj->client;
704  $companystatic->code_client=$obj->code_client;
705  $companystatic->email=$obj->email;
706 
707  // Thirdparty
708  if (! empty($arrayfields['s.nom']['checked']))
709  {
710  print '<td class="tdoverflowmax200">';
711  print $companystatic->getNomUrl(1,'customer');
712  print '</td>';
713  if (! $i) $totalarray['nbfield']++;
714  }
715 
716  // Town
717  if (! empty($arrayfields['s.town']['checked']))
718  {
719  print '<td class="nocellnopadd">';
720  print $obj->town;
721  print '</td>';
722  if (! $i) $totalarray['nbfield']++;
723  }
724  // Zip
725  if (! empty($arrayfields['s.zip']['checked']))
726  {
727  print '<td class="nocellnopadd">';
728  print $obj->zip;
729  print '</td>';
730  if (! $i) $totalarray['nbfield']++;
731  }
732  // State
733  if (! empty($arrayfields['state.nom']['checked']))
734  {
735  print "<td>".$obj->state_name."</td>\n";
736  if (! $i) $totalarray['nbfield']++;
737  }
738  // Country
739  if (! empty($arrayfields['country.code_iso']['checked']))
740  {
741  print '<td align="center">';
742  $tmparray=getCountry($obj->fk_pays,'all');
743  print $tmparray['label'];
744  print '</td>';
745  if (! $i) $totalarray['nbfield']++;
746  }
747  // Type ent
748  if (! empty($arrayfields['typent.code']['checked']))
749  {
750  print '<td align="center">';
751  if (count($typenArray)==0) $typenArray = $formcompany->typent_array(1);
752  print $typenArray[$obj->typent_code];
753  print '</td>';
754  if (! $i) $totalarray['nbfield']++;
755  }
756 
757  // Date proposal
758  if (! empty($arrayfields['p.date']['checked']))
759  {
760  print '<td align="center">';
761  print dol_print_date($db->jdate($obj->dp), 'day');
762  print "</td>\n";
763  if (! $i) $totalarray['nbfield']++;
764  }
765 
766  // Date end validity
767  if (! empty($arrayfields['p.fin_validite']['checked']))
768  {
769  if ($obj->dfv)
770  {
771  print '<td align="center">'.dol_print_date($db->jdate($obj->dfv),'day');
772  print '</td>';
773  }
774  else
775  {
776  print '<td>&nbsp;</td>';
777  }
778  if (! $i) $totalarray['nbfield']++;
779  }
780 
781  // Amount HT
782  if (! empty($arrayfields['p.total_ht']['checked']))
783  {
784  print '<td align="right">'.price($obj->total_ht)."</td>\n";
785  if (! $i) $totalarray['nbfield']++;
786  if (! $i) $totalarray['totalhtfield']=$totalarray['nbfield'];
787  $totalarray['totalht'] += $obj->total_ht;
788  }
789  // Amount VAT
790  if (! empty($arrayfields['p.total_vat']['checked']))
791  {
792  print '<td align="right">'.price($obj->total_vat)."</td>\n";
793  if (! $i) $totalarray['nbfield']++;
794  if (! $i) $totalarray['totalvatfield']=$totalarray['nbfield'];
795  $totalarray['totalvat'] += $obj->total_vat;
796  }
797  // Amount TTC
798  if (! empty($arrayfields['p.total_ttc']['checked']))
799  {
800  print '<td align="right">'.price($obj->total_ttc)."</td>\n";
801  if (! $i) $totalarray['nbfield']++;
802  if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield'];
803  $totalarray['totalttc'] += $obj->total_ttc;
804  }
805 
806  $userstatic->id=$obj->fk_user_author;
807  $userstatic->login=$obj->login;
808 
809  // Author
810  if (! empty($arrayfields['u.login']['checked']))
811  {
812  print '<td align="center">';
813  if ($userstatic->id) print $userstatic->getLoginUrl(1);
814  else print '&nbsp;';
815  print "</td>\n";
816  if (! $i) $totalarray['nbfield']++;
817  }
818 
819  // Extra fields
820  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
821  // Fields from hook
822  $parameters=array('arrayfields'=>$arrayfields, 'obj'=>$obj);
823  $reshook=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
824  print $hookmanager->resPrint;
825  // Date creation
826  if (! empty($arrayfields['p.datec']['checked']))
827  {
828  print '<td align="center" class="nowrap">';
829  print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
830  print '</td>';
831  if (! $i) $totalarray['nbfield']++;
832  }
833  // Date modification
834  if (! empty($arrayfields['p.tms']['checked']))
835  {
836  print '<td align="center" class="nowrap">';
837  print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
838  print '</td>';
839  if (! $i) $totalarray['nbfield']++;
840  }
841  // Status
842  if (! empty($arrayfields['p.fk_statut']['checked']))
843  {
844  print '<td align="right" class="nowrap">'.$objectstatic->LibStatut($obj->fk_statut,5).'</td>';
845  if (! $i) $totalarray['nbfield']++;
846  }
847  // Action column
848  print '<td class="nowrap" align="center">';
849  if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
850  {
851  $selected=0;
852  if (in_array($obj->rowid, $arrayofselected)) $selected=1;
853  print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected?' checked="checked"':'').'>';
854  }
855  print '</td>';
856  if (! $i) $totalarray['nbfield']++;
857 
858  print "</tr>\n";
859 
860  $i++;
861  }
862 
863  // Show total line
864  if (isset($totalarray['totalhtfield'])
865  || isset($totalarray['totalvatfield'])
866  || isset($totalarray['totalttcfield'])
867  || isset($totalarray['totalamfield'])
868  || isset($totalarray['totalrtpfield'])
869  )
870  {
871  print '<tr class="liste_total">';
872  $i=0;
873  while ($i < $totalarray['nbfield'])
874  {
875  $i++;
876  if ($i == 1)
877  {
878  if ($num < $limit && empty($offset)) print '<td align="left">'.$langs->trans("Total").'</td>';
879  else print '<td align="left">'.$langs->trans("Totalforthispage").'</td>';
880  }
881  elseif ($totalarray['totalhtfield'] == $i) print '<td align="right">'.price($totalarray['totalht']).'</td>';
882  elseif ($totalarray['totalvatfield'] == $i) print '<td align="right">'.price($totalarray['totalvat']).'</td>';
883  elseif ($totalarray['totalttcfield'] == $i) print '<td align="right">'.price($totalarray['totalttc']).'</td>';
884  else print '<td></td>';
885  }
886  print '</tr>';
887  }
888 
889  $db->free($resql);
890 
891  $parameters=array('arrayfields'=>$arrayfields, 'sql'=>$sql);
892  $reshook=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
893  print $hookmanager->resPrint;
894 
895  print '</table>'."\n";
896  print '</div>'."\n";
897 
898  print '</form>'."\n";
899 
900  if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files)
901  {
902  /*
903  * Show list of available documents
904  */
905  $urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
906  $urlsource.=str_replace('&amp;','&',$param);
907 
908  $filedir=$diroutputmassaction;
909  $genallowed=$user->rights->propal->lire;
910  $delallowed=$user->rights->propal->creer;
911 
912  print $formfile->showdocuments('massfilesarea_proposals','',$filedir,$urlsource,0,$delallowed,'',1,1,0,48,1,$param,'','');
913  }
914  else
915  {
916  print '<br><a name="show_files"></a><a href="'.$_SERVER["PHP_SELF"].'?show_files=1'.$param.'#show_files">'.$langs->trans("ShowTempMassFilesArea").'</a>';
917  }
918 
919 }
920 else
921 {
922  dol_print_error($db);
923 }
924 
925 // End of page
926 llxFooter();
927 $db->close();
llxFooter()
Empty footer.
Definition: wrapper.php:58
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='')
Show picto whatever it's its name (generic function)
setEventMessages($mesg, $mesgs, $style='mesgs')
Set event messages in dol_events session object.
if(!GETPOST('transkey')&&!GETPOST('transphrase')) else
View.
Definition: notice.php:43
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm=false, $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
if(GETPOST('cancel','alpha')) if(!GETPOST('confirmmassaction','alpha')&&$massaction!= 'presend'&&$massaction!= 'confirm_presend')
Draft customers invoices.
Definition: list.php:147
Class to manage Dolibarr users.
Definition: user.class.php:39
dol_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
Definition: date.lib.php:445
dol_print_error($db='', $error='', $errors=null)
Affiche message erreur system avec toutes les informations pour faciliter le diagnostic et la remonte...
getCountry($searchkey, $withcode='', $dbtouse=0, $outputlangs='', $entconv=1, $searchlabel='')
Return country label, code or id from an id, code or label.
Class to manage generation of HTML components for proposal management.
if(empty($reshook)) $form
View.
Definition: perms.php:103
GETPOST($paramname, $check='none', $method=0, $filter=NULL, $options=NULL, $noreplace=0)
Return value of a param into GET or POST supervariable.
Class to build HTML component for third parties management Only common components are here...
Class to manage standard extra fields.
Class to manage generation of HTML components Only common components must be here.
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='title_generic.png', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0)
Print a title with navigation controls for pagination.
Class to manage third parties objects (customers, suppliers, prospects...)
img_warning($titlealt= 'default', $moreatt= '')
Show warning logo.
if($_POST["cancel"]==$langs->trans("Cancel")&&!$id) if($action== 'setdatev'&&$user->rights->tax->charges->creer) if($action== 'add'&&$_POST["cancel"]<> $langs->trans("Cancel")) if($action== 'delete') $title
Actions.
Definition: card.php:183
Classe permettant la generation de composants html autre Only common components are here...
llxHeader()
Empty header.
Definition: wrapper.php:46
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...
dol_now($mode='gmt')
Return date for now.
Class to offer components to list and upload files.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages...
dol_print_date($time, $format='', $tzoutput='tzserver', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
Definition: date.lib.php:459
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
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="")
Show title line of an array.
restrictedArea($user, $features, $objectid=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $objcanvas=null)
Check permissions of a user to show a page and an object.
Class to manage proposals.