dolibarr  13.0.2
list.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2005-2010 Regis Houssin <regis.houssin@inodbox.com>
5  * Copyright (C) 2016-2018 Ferran Marcet <fmarcet@2byte.es>
6  * Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
7  * Copyright (C) 2020 Thibault FOUCART <support@ptibogxiv.net>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <https://www.gnu.org/licenses/>.
21  */
22 
29 require '../main.inc.php';
30 require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
31 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
32 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
33 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
34 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
35 require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
36 require_once DOL_DOCUMENT_ROOT.'/core/lib/product.lib.php';
37 
38 // Load translation files required by the page
39 $langs->loadLangs(array("sendings", "deliveries", 'companies', 'bills', 'products'));
40 
41 $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'shipmentlist'; // To manage different context of search
42 
43 $socid = GETPOST('socid', 'int');
44 
45 $action = GETPOST('action', 'alpha');
46 $massaction = GETPOST('massaction', 'alpha');
47 $show_files = GETPOST('show_files', 'int');
48 $toselect = GETPOST('toselect', 'array');
49 
50 // Security check
51 $expeditionid = GETPOST('id', 'int');
52 if ($user->socid) $socid = $user->socid;
53 $result = restrictedArea($user, 'expedition', $expeditionid, '');
54 
55 $search_ref_exp = GETPOST("search_ref_exp", 'alpha');
56 $search_ref_liv = GETPOST('search_ref_liv', 'alpha');
57 $search_ref_customer = GETPOST('search_ref_customer', 'alpha');
58 $search_company = GETPOST("search_company", 'alpha');
59 $search_tracking = GETPOST("search_tracking", 'alpha');
60 $search_town = GETPOST('search_town', 'alpha');
61 $search_zip = GETPOST('search_zip', 'alpha');
62 $search_state = GETPOST("search_state");
63 $search_country = GETPOST("search_country", 'int');
64 $search_type_thirdparty = GETPOST("search_type_thirdparty", 'int');
65 $search_billed = GETPOST("search_billed", 'int');
66 $search_datedelivery_start = dol_mktime(0, 0, 0, GETPOST('search_datedelivery_startmonth', 'int'), GETPOST('search_datedelivery_startday', 'int'), GETPOST('search_datedelivery_startyear', 'int'));
67 $search_datedelivery_end = dol_mktime(23, 59, 59, GETPOST('search_datedelivery_endmonth', 'int'), GETPOST('search_datedelivery_endday', 'int'), GETPOST('search_datedelivery_endyear', 'int'));
68 $search_datereceipt_start = dol_mktime(0, 0, 0, GETPOST('search_datereceipt_startmonth', 'int'), GETPOST('search_datereceipt_startday', 'int'), GETPOST('search_datereceipt_startyear', 'int'));
69 $search_datereceipt_end = dol_mktime(23, 59, 59, GETPOST('search_datereceipt_endmonth', 'int'), GETPOST('search_datereceipt_endday', 'int'), GETPOST('search_datereceipt_endyear', 'int'));
70 $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
71 $socid = GETPOST('socid', 'int');
72 $search_user = GETPOST('search_user', 'int');
73 $search_sale = GETPOST('search_sale', 'int');
74 $search_categ_cus = GETPOST("search_categ_cus", 'int');
75 $search_product_category = GETPOST('search_product_category', 'int');
76 $optioncss = GETPOST('optioncss', 'alpha');
77 
78 $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
79 $sortfield = GETPOST('sortfield', 'aZ09comma');
80 $sortorder = GETPOST('sortorder', 'aZ09comma');
81 $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
82 if (!$sortfield) $sortfield = "e.ref";
83 if (!$sortorder) $sortorder = "DESC";
84 if (empty($page) || $page == -1 || (empty($toselect) && $massaction === '0')) { $page = 0; } // If $page is not defined, or '' or -1
85 $offset = $limit * $page;
86 $pageprev = $page - 1;
87 $pagenext = $page + 1;
88 
89 $search_status = GETPOST('search_status');
90 
91 $diroutputmassaction = $conf->expedition->dir_output.'/sending/temp/massgeneration/'.$user->id;
92 
93 $object = new Expedition($db);
94 $form = new Form($db);
95 
96 // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
97 $hookmanager->initHooks(array('shipmentlist'));
98 $extrafields = new ExtraFields($db);
99 
100 // fetch optionals attributes and labels
101 $extrafields->fetch_name_optionals_label($object->table_element);
102 
103 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
104 
105 // List of fields to search into when doing a "search in all"
106 $fieldstosearchall = array(
107  'e.ref'=>"Ref",
108  's.nom'=>"ThirdParty",
109  'e.note_public'=>'NotePublic',
110  'e.tracking_number'=>"TrackingNumber",
111 );
112 if (empty($user->socid)) $fieldstosearchall["e.note_private"] = "NotePrivate";
113 
114 $checkedtypetiers = 0;
115 $arrayfields = array(
116  'e.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
117  'e.ref_customer'=>array('label'=>$langs->trans("RefCustomer"), 'checked'=>1),
118  's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1),
119  's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>1),
120  's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>1),
121  'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0),
122  'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0),
123  'typent.code'=>array('label'=>$langs->trans("ThirdPartyType"), 'checked'=>$checkedtypetiers),
124  'e.date_delivery'=>array('label'=>$langs->trans("DateDeliveryPlanned"), 'checked'=>1),
125  'e.tracking_number'=>array('label'=>$langs->trans("TrackingNumber"), 'checked'=>1),
126  'e.weight'=>array('label'=>$langs->trans("Weight"), 'checked'=>0),
127  'e.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
128  'e.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
129  'e.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
130  'l.ref'=>array('label'=>$langs->trans("DeliveryRef"), 'checked'=>1, 'enabled'=>(empty($conf->delivery_note->enabled) ? 0 : 1)),
131  'l.date_delivery'=>array('label'=>$langs->trans("DateReceived"), 'checked'=>1, 'enabled'=>(empty($conf->delivery_note->enabled) ? 0 : 1)),
132  'e.billed'=>array('label'=>$langs->trans("Billed"), 'checked'=>1, 'position'=>1000, 'enabled'=>(!empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)))
133 );
134 
135 // Extra fields
136 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
137 
138 $object->fields = dol_sort_array($object->fields, 'position');
139 $arrayfields = dol_sort_array($arrayfields, 'position');
140 
141 
142 /*
143  * Actions
144  */
145 $error = 0;
146 
147 if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; }
148 if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; }
149 
150 $parameters = array('socid'=>$socid);
151 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
152 if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
153 
154 include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
155 
156 // Purge search criteria
157 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
158 {
159  $search_categ = '';
160  $search_user = '';
161  $search_sale = '';
162  $search_product_category = '';
163  $search_ref_exp = '';
164  $search_ref_liv = '';
165  $search_ref_customer = '';
166  $search_company = '';
167  $search_town = '';
168  $search_zip = "";
169  $search_state = "";
170  $search_type = '';
171  $search_country = '';
172  $search_tracking = '';
173  $search_type_thirdparty = '';
174  $search_billed = '';
175  $search_datedelivery_start = '';
176  $search_datedelivery_end = '';
177  $search_datereceipt_start = '';
178  $search_datereceipt_end = '';
179  $search_status = '';
180  $toselect = '';
181  $search_array_options = array();
182  $search_categ_cus = 0;
183 }
184 
185 if (empty($reshook))
186 {
187  $objectclass = 'Expedition';
188  $objectlabel = 'Sendings';
189  $permissiontoread = $user->rights->expedition->lire;
190  $permissiontoadd = $user->rights->expedition->creer;
191  $permissiontodelete = $user->rights->expedition->supprimer;
192  $uploaddir = $conf->expedition->dir_output.'/sending';
193  include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
194 }
195 
196 
197 /*
198  * View
199  */
200 
201 $now = dol_now();
202 
203 $form = new Form($db);
204 $formother = new FormOther($db);
205 $formfile = new FormFile($db);
206 $companystatic = new Societe($db);
207 $formcompany = new FormCompany($db);
208 $shipment = new Expedition($db);
209 
210 $helpurl = 'EN:Module_Shipments|FR:Module_Exp&eacute;ditions|ES:M&oacute;dulo_Expediciones';
211 llxHeader('', $langs->trans('ListOfSendings'), $helpurl);
212 
213 $sql = 'SELECT';
214 if ($sall || $search_product_category > 0 || $search_user > 0) $sql = 'SELECT DISTINCT';
215 $sql .= " e.rowid, e.ref, e.ref_customer, e.date_expedition as date_expedition, e.weight, e.weight_units, e.date_delivery as delivery_date, e.fk_statut, e.billed, e.tracking_number,";
216 $sql .= " l.date_delivery as date_reception,";
217 $sql .= " s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, ";
218 $sql .= " typent.code as typent_code,";
219 $sql .= " state.code_departement as state_code, state.nom as state_name,";
220 $sql .= " e.date_creation as date_creation, e.tms as date_update,";
221 $sql .= " u.login";
222 if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc";
223 // Add fields from extrafields
224 if (!empty($extrafields->attributes[$object->table_element]['label'])) {
225  foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
226 }
227 // Add fields from hooks
228 $parameters = array();
229 $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
230 $sql .= $hookmanager->resPrint;
231 $sql .= " FROM ".MAIN_DB_PREFIX."expedition as e";
232 if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (e.rowid = ef.fk_object)";
233 if ($sall || $search_product_category > 0) {
234  $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'expeditiondet as ed ON e.rowid=ed.fk_expedition';
235  $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'commandedet as pd ON pd.rowid=ed.fk_origin_line';
236 }
237 if ($search_product_category > 0) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=pd.fk_product';
238 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = e.fk_soc";
239 if (!empty($search_categ_cus)) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_societe as cc ON s.rowid = cc.fk_soc"; // We'll need this table joined to the select in order to filter by categ
240 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)";
241 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)";
242 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)";
243 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as ee ON e.rowid = ee.fk_source AND ee.sourcetype = 'shipping' AND ee.targettype = 'delivery'";
244 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."delivery as l ON l.rowid = ee.fk_target";
245 $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON e.fk_user_author = u.rowid';
246 if ($search_user > 0) { // Get link to order to get the order id in eesource.fk_source
247  $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as eesource ON eesource.fk_target = e.rowid AND eesource.targettype = 'shipping' AND eesource.sourcetype = 'commande'";
248 }
249 // We'll need this table joined to the select in order to filter by sale
250 if ($search_sale > 0 || (!$user->rights->societe->client->voir && !$socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
251 if ($search_user > 0) {
252  $sql .= ", ".MAIN_DB_PREFIX."element_contact as ec";
253  $sql .= ", ".MAIN_DB_PREFIX."c_type_contact as tc";
254 }
255 $sql .= " WHERE e.entity IN (".getEntity('expedition').")";
256 if ($search_product_category > 0) $sql .= " AND cp.fk_categorie = ".$search_product_category;
257 if ($socid > 0) $sql .= ' AND s.rowid = '.$socid;
258 if (!$user->rights->societe->client->voir && !$socid) // Internal user with no permission to see all
259 {
260  $sql .= " AND e.fk_soc = sc.fk_soc";
261  $sql .= " AND sc.fk_user = ".$user->id;
262 }
263 if ($socid)
264 {
265  $sql .= " AND e.fk_soc = ".$socid;
266 }
267 if ($search_status <> '' && $search_status >= 0) {
268  $sql .= " AND e.fk_statut = ".$search_status;
269 }
270 if ($search_ref_customer != '') $sql .= natural_search('e.ref_customer', $search_ref_customer);
271 if ($search_billed != '' && $search_billed >= 0) $sql .= ' AND e.billed = '.$search_billed;
272 if ($search_town) $sql .= natural_search('s.town', $search_town);
273 if ($search_zip) $sql .= natural_search("s.zip", $search_zip);
274 if ($search_state) $sql .= natural_search("state.nom", $search_state);
275 if ($search_country) $sql .= " AND s.fk_pays IN (".$search_country.')';
276 if ($search_tracking) $sql .= natural_search("e.tracking_number", $search_tracking);
277 if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')';
278 if ($search_sale > 0) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$search_sale;
279 if ($search_user > 0)
280 {
281  // The contact on a shipment is also the contact of the order.
282  $sql .= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='commande' AND tc.source='internal' AND ec.element_id = eesource.fk_source AND ec.fk_socpeople = ".$db->escape($search_user);
283 }
284 if ($search_ref_exp) $sql .= natural_search('e.ref', $search_ref_exp);
285 if ($search_ref_liv) $sql .= natural_search('l.ref', $search_ref_liv);
286 if ($search_company) $sql .= natural_search('s.nom', $search_company);
287 if ($search_datedelivery_start) $sql .= " AND e.date_delivery >= '".$db->idate($search_datedelivery_start)."'";
288 if ($search_datedelivery_end) $sql .= " AND e.date_delivery <= '".$db->idate($search_datedelivery_end)."'";
289 if ($search_datereceipt_start) $sql .= " AND l.date_delivery >= '".$db->idate($search_datereceipt_start)."'";
290 if ($search_datereceipt_end) $sql .= " AND l.date_delivery <= '".$db->idate($search_datereceipt_end)."'";
291 if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall);
292 if ($search_categ_cus > 0) $sql .= " AND cc.fk_categorie = ".$db->escape($search_categ_cus);
293 if ($search_categ_cus == -2) $sql .= " AND cc.fk_categorie IS NULL";
294 
295 // Add where from extra fields
296 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
297 
298 // Add where from hooks
299 $parameters = array();
300 $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
301 $sql .= $hookmanager->resPrint;
302 
303 $sql .= $db->order($sortfield, $sortorder);
304 
305 $nbtotalofrecords = '';
306 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
307 {
308  $result = $db->query($sql);
309  $nbtotalofrecords = $db->num_rows($result);
310  if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
311  {
312  $page = 0;
313  $offset = 0;
314  }
315 }
316 
317 $sql .= $db->plimit($limit + 1, $offset);
318 
319 //print $sql;
320 $resql = $db->query($sql);
321 if ($resql)
322 {
323  $num = $db->num_rows($resql);
324 
325  $arrayofselected = is_array($toselect) ? $toselect : array();
326 
327  $expedition = new Expedition($db);
328 
329  $param = '';
330  if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
331  if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
332  if ($sall) $param .= "&amp;sall=".urlencode($sall);
333  if ($search_ref_exp) $param .= "&amp;search_ref_exp=".urlencode($search_ref_exp);
334  if ($search_ref_liv) $param .= "&amp;search_ref_liv=".urlencode($search_ref_liv);
335  if ($search_ref_customer) $param .= "&amp;search_ref_customer=".urlencode($search_ref_customer);
336  if ($search_user > 0) $param .= '&search_user='.urlencode($search_user);
337  if ($search_sale > 0) $param .= '&search_sale='.urlencode($search_sale);
338  if ($search_company) $param .= "&amp;search_company=".urlencode($search_company);
339  if ($search_tracking) $param .= "&amp;search_tracking=".urlencode($search_tracking);
340  if ($search_town) $param .= '&search_town='.urlencode($search_town);
341  if ($search_zip) $param .= '&search_zip='.urlencode($search_zip);
342 
343  if ($search_datedelivery_start) $param .= '&search_datedelivery_start='.urlencode($search_datedelivery_start);
344  if ($search_datedelivery_end) $param .= '&search_datedelivery_end='.urlencode($search_datedelivery_end);
345  if ($search_datereceipt_start) $param .= '&search_datereceipt_start='.urlencode($search_datereceipt_start);
346  if ($search_datereceipt_end) $param .= '&search_datereceipt_end='.urlencode($search_datereceipt_end);
347 
348  if ($search_product_category != '') $param .= '&search_product_category='.urlencode($search_product_category);
349  if ($search_categ_cus > 0) $param .= '&search_categ_cus='.urlencode($search_categ_cus);
350  if ($search_status != '') $param .= '&search_status='.urlencode($search_status);
351  if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss);
352  // Add $param from extra fields
353  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
354 
355  $arrayofmassactions = array(
356  'builddoc' => $langs->trans("PDFMerge"),
357  //'classifyclose'=>$langs->trans("Close"), TODO massive close shipment ie: when truck is charged
358  'presend' => $langs->trans("SendByMail"),
359  );
360  if (in_array($massaction, array('presend'))) $arrayofmassactions = array();
361  $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
362 
363  // Currently: a sending can't create from sending list
364  // $url = DOL_URL_ROOT.'/expedition/card.php?action=create';
365  // if (!empty($socid)) $url .= '&socid='.$socid;
366  // $newcardbutton = dolGetButtonTitle($langs->trans('NewSending'), '', 'fa fa-plus-circle', $url, '', $user->rights->expedition->creer);
367  $newcardbutton = dolGetButtonTitle($langs->trans('NewSending'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/expedition/card.php?action=create2', '', $user->rights->expedition->creer);
368 
369  $i = 0;
370  print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">'."\n";
371  if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
372  print '<input type="hidden" name="token" value="'.newToken().'">';
373  print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
374  print '<input type="hidden" name="action" value="list">';
375  print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
376  print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
377 
378  print_barre_liste($langs->trans('ListOfSendings'), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'dolly', 0, $newcardbutton, '', $limit, 0, 0, 1);
379 
380  $topicmail = "SendShippingRef";
381  $modelmail = "shipping_send";
382  $objecttmp = new Expedition($db);
383  $trackid = 'shi'.$object->id;
384  include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
385 
386  if ($sall)
387  {
388  foreach ($fieldstosearchall as $key => $val) $fieldstosearchall[$key] = $langs->trans($val);
389  print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $sall).join(', ', $fieldstosearchall).'</div>';
390  }
391 
392  $moreforfilter = '';
393 
394  // If the user can view prospects other than his'
395  if ($user->rights->societe->client->voir || $socid)
396  {
397  $langs->load("commercial");
398  $moreforfilter .= '<div class="divsearchfield">';
399  $moreforfilter .= $langs->trans('ThirdPartiesOfSaleRepresentative').': ';
400  $moreforfilter .= $formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, 1, 'maxwidth200');
401  $moreforfilter .= '</div>';
402  }
403  // If the user can view other users
404  if ($user->rights->user->user->lire)
405  {
406  $moreforfilter .= '<div class="divsearchfield">';
407  $moreforfilter .= $langs->trans('LinkedToSpecificUsers').': ';
408  $moreforfilter .= $form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200');
409  $moreforfilter .= '</div>';
410  }
411  // If the user can view prospects other than his'
412  if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire))
413  {
414  include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
415  $moreforfilter .= '<div class="divsearchfield">';
416  $moreforfilter .= $langs->trans('IncludingProductWithTag').': ';
417  $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
418  $moreforfilter .= $form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1);
419  $moreforfilter .= '</div>';
420  }
421  if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire)
422  {
423  require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
424  $moreforfilter .= '<div class="divsearchfield">';
425  $moreforfilter .= $langs->trans('CustomersProspectsCategoriesShort').': ';
426  $moreforfilter .= $formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1);
427  $moreforfilter .= '</div>';
428  }
429  $parameters = array();
430  $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook
431  if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
432  else $moreforfilter = $hookmanager->resPrint;
433 
434  if (!empty($moreforfilter))
435  {
436  print '<div class="liste_titre liste_titre_bydiv centpercent">';
437  print $moreforfilter;
438  print '</div>';
439  }
440 
441  $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
442  $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage);
443  if ($massactionbutton) $selectedfields .= $form->showCheckAddButtons('checkforselect', 1); // This also change content of $arrayfields
444 
445  print '<div class="div-table-responsive">';
446  print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
447 
448  // Fields title search
449  print '<tr class="liste_titre_filter">';
450  // Ref
451  if (!empty($arrayfields['e.ref']['checked']))
452  {
453  print '<td class="liste_titre">';
454  print '<input class="flat" size="6" type="text" name="search_ref_exp" value="'.$search_ref_exp.'">';
455  print '</td>';
456  }
457  // Ref customer
458  if (!empty($arrayfields['e.ref_customer']['checked']))
459  {
460  print '<td class="liste_titre">';
461  print '<input class="flat" size="6" type="text" name="search_ref_customer" value="'.$search_ref_customer.'">';
462  print '</td>';
463  }
464  // Thirdparty
465  if (!empty($arrayfields['s.nom']['checked']))
466  {
467  print '<td class="liste_titre left">';
468  print '<input class="flat" type="text" size="8" name="search_company" value="'.dol_escape_htmltag($search_company).'">';
469  print '</td>';
470  }
471  // Town
472  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>';
473  // Zip
474  if (!empty($arrayfields['s.zip']['checked'])) print '<td class="liste_titre"><input class="flat" type="text" size="6" name="search_zip" value="'.$search_zip.'"></td>';
475  // State
476  if (!empty($arrayfields['state.nom']['checked']))
477  {
478  print '<td class="liste_titre">';
479  print '<input class="flat" size="4" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).'">';
480  print '</td>';
481  }
482  // Country
483  if (!empty($arrayfields['country.code_iso']['checked']))
484  {
485  print '<td class="liste_titre center">';
486  print $form->select_country($search_country, 'search_country', '', 0, 'minwidth100imp maxwidth100');
487  print '</td>';
488  }
489  // Company type
490  if (!empty($arrayfields['typent.code']['checked']))
491  {
492  print '<td class="liste_titre maxwidthonsmartphone center">';
493  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));
494  print '</td>';
495  }
496  // Weight
497  if (!empty($arrayfields['e.weight']['checked']))
498  {
499  print '<td class="liste_titre maxwidthonsmartphone center">';
500 
501  print '</td>';
502  }
503  // Date delivery planned
504  if (!empty($arrayfields['e.date_delivery']['checked']))
505  {
506  print '<td class="liste_titre center">';
507  print '<div class="nowrap">';
508  print $langs->trans('From').' ';
509  print $form->selectDate($search_delivery_start ? $search_delivery_start : -1, 'search_delivery_start', 0, 0, 1);
510  print '</div>';
511  print '<div class="nowrap">';
512  print $langs->trans('to').' ';
513  print $form->selectDate($search_delivery_end ? $search_delivery_end : -1, 'search_delivery_end', 0, 0, 1);
514  print '</div>';
515  print '</td>';
516  }
517  // Tracking number
518  if (!empty($arrayfields['e.tracking_number']['checked']))
519  {
520  print '<td class="liste_titre center">';
521  print '<input class="flat" size="6" type="text" name="search_tracking" value="'.dol_escape_htmltag($search_tracking).'">';
522  print '</td>';
523  }
524  if (!empty($arrayfields['l.ref']['checked']))
525  {
526  // Delivery ref
527  print '<td class="liste_titre">';
528  print '<input class="flat" size="10" type="text" name="search_ref_liv" value="'.$search_ref_liv.'"';
529  print '</td>';
530  }
531  if (!empty($arrayfields['l.date_delivery']['checked']))
532  {
533  // Date received
534  print '<td class="liste_titre center">';
535  print '<div class="nowrap">';
536  print $langs->trans('From').' ';
537  print $form->selectDate($search_receipt_start ? $search_receipt_start : -1, 'search_receipt_start', 0, 0, 1);
538  print '</div>';
539  print '<div class="nowrap">';
540  print $langs->trans('to').' ';
541  print $form->selectDate($search_receipt_end ? $search_receipt_end : -1, 'search_receipt_end', 0, 0, 1);
542  print '</div>';
543  print '</td>';
544  }
545  // Extra fields
546  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
547 
548  // Fields from hook
549  $parameters = array('arrayfields'=>$arrayfields);
550  $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
551  print $hookmanager->resPrint;
552  // Date creation
553  if (!empty($arrayfields['e.datec']['checked']))
554  {
555  print '<td class="liste_titre">';
556  print '</td>';
557  }
558  // Date modification
559  if (!empty($arrayfields['e.tms']['checked']))
560  {
561  print '<td class="liste_titre">';
562  print '</td>';
563  }
564  // Status
565  if (!empty($arrayfields['e.fk_statut']['checked']))
566  {
567  print '<td class="liste_titre maxwidthonsmartphone right">';
568  print $form->selectarray('search_status', array('0'=>$langs->trans('StatusSendingDraftShort'), '1'=>$langs->trans('StatusSendingValidatedShort'), '2'=>$langs->trans('StatusSendingProcessedShort')), $search_status, 1);
569  print '</td>';
570  }
571  // Status billed
572  if (!empty($arrayfields['e.billed']['checked']))
573  {
574  print '<td class="liste_titre maxwidthonsmartphone center">';
575  print $form->selectyesno('search_billed', $search_billed, 1, 0, 1);
576  print '</td>';
577  }
578  // Action column
579  print '<td class="liste_titre middle">';
580  $searchpicto = $form->showFilterAndCheckAddButtons(0);
581  print $searchpicto;
582  print '</td>';
583  print "</tr>\n";
584 
585  print '<tr class="liste_titre">';
586  if (!empty($arrayfields['e.ref']['checked'])) print_liste_field_titre($arrayfields['e.ref']['label'], $_SERVER["PHP_SELF"], "e.ref", "", $param, '', $sortfield, $sortorder);
587  if (!empty($arrayfields['e.ref_customer']['checked'])) print_liste_field_titre($arrayfields['e.ref_customer']['label'], $_SERVER["PHP_SELF"], "e.ref_customer", "", $param, '', $sortfield, $sortorder);
588  if (!empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder, 'left ');
589  if (!empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder);
590  if (!empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'], $_SERVER["PHP_SELF"], 's.zip', '', $param, '', $sortfield, $sortorder);
591  if (!empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'], $_SERVER["PHP_SELF"], "state.nom", "", $param, '', $sortfield, $sortorder);
592  if (!empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, '', $sortfield, $sortorder, 'center ');
593  if (!empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, '', $sortfield, $sortorder, 'center ');
594  if (!empty($arrayfields['e.weight']['checked'])) print_liste_field_titre($arrayfields['e.weight']['label'], $_SERVER["PHP_SELF"], "e.weight", "", $param, '', $sortfield, $sortorder, 'center ');
595  if (!empty($arrayfields['e.date_delivery']['checked'])) print_liste_field_titre($arrayfields['e.date_delivery']['label'], $_SERVER["PHP_SELF"], "e.date_delivery", "", $param, '', $sortfield, $sortorder, 'center ');
596  if (!empty($arrayfields['e.tracking_number']['checked'])) print_liste_field_titre($arrayfields['e.tracking_number']['label'], $_SERVER["PHP_SELF"], "e.tracking_number", "", $param, '', $sortfield, $sortorder, 'center ');
597  if (!empty($arrayfields['l.ref']['checked'])) print_liste_field_titre($arrayfields['l.ref']['label'], $_SERVER["PHP_SELF"], "l.ref", "", $param, '', $sortfield, $sortorder);
598  if (!empty($arrayfields['l.date_delivery']['checked'])) print_liste_field_titre($arrayfields['l.date_delivery']['label'], $_SERVER["PHP_SELF"], "l.date_delivery", "", $param, '', $sortfield, $sortorder, 'center ');
599  // Extra fields
600  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
601  // Hook fields
602  $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
603  $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
604  print $hookmanager->resPrint;
605  if (!empty($arrayfields['e.datec']['checked'])) print_liste_field_titre($arrayfields['e.datec']['label'], $_SERVER["PHP_SELF"], "e.date_creation", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
606  if (!empty($arrayfields['e.tms']['checked'])) print_liste_field_titre($arrayfields['e.tms']['label'], $_SERVER["PHP_SELF"], "e.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
607  if (!empty($arrayfields['e.fk_statut']['checked'])) print_liste_field_titre($arrayfields['e.fk_statut']['label'], $_SERVER["PHP_SELF"], "e.fk_statut", "", $param, '', $sortfield, $sortorder, 'right ');
608  if (!empty($arrayfields['e.billed']['checked'])) print_liste_field_titre($arrayfields['e.billed']['label'], $_SERVER["PHP_SELF"], "e.billed", "", $param, '', $sortfield, $sortorder, 'center ');
609  print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
610  print "</tr>\n";
611 
612  $typenArray = $formcompany->typent_array(1);
613  $i = 0;
614  $totalarray = array();
615  while ($i < min($num, $limit))
616  {
617  $obj = $db->fetch_object($resql);
618 
619  $shipment->id = $obj->rowid;
620  $shipment->ref = $obj->ref;
621 
622  $companystatic->id = $obj->socid;
623  $companystatic->ref = $obj->name;
624  $companystatic->name = $obj->name;
625 
626  $object = new Expedition($db);
627  $object->fetch($obj->rowid);
628 
629  print '<tr class="oddeven">';
630 
631  // Ref
632  if (!empty($arrayfields['e.ref']['checked']))
633  {
634  print "<td>";
635  print $shipment->getNomUrl(1);
636  print "</td>\n";
637  if (!$i) $totalarray['nbfield']++;
638  }
639 
640  // Ref customer
641  if (!empty($arrayfields['e.ref_customer']['checked']))
642  {
643  print "<td>";
644  print $obj->ref_customer;
645  print "</td>\n";
646  if (!$i) $totalarray['nbfield']++;
647  }
648 
649  // Third party
650  if (!empty($arrayfields['s.nom']['checked']))
651  {
652  print '<td>';
653  print $companystatic->getNomUrl(1);
654  print '</td>';
655  if (!$i) $totalarray['nbfield']++;
656  }
657  // Town
658  if (!empty($arrayfields['s.town']['checked']))
659  {
660  print '<td class="nocellnopadd">';
661  print $obj->town;
662  print '</td>';
663  if (!$i) $totalarray['nbfield']++;
664  }
665  // Zip
666  if (!empty($arrayfields['s.zip']['checked']))
667  {
668  print '<td class="nocellnopadd">';
669  print $obj->zip;
670  print '</td>';
671  if (!$i) $totalarray['nbfield']++;
672  }
673  // State
674  if (!empty($arrayfields['state.nom']['checked']))
675  {
676  print "<td>".$obj->state_name."</td>\n";
677  if (!$i) $totalarray['nbfield']++;
678  }
679  // Country
680  if (!empty($arrayfields['country.code_iso']['checked']))
681  {
682  print '<td class="center">';
683  $tmparray = getCountry($obj->fk_pays, 'all');
684  print $tmparray['label'];
685  print '</td>';
686  if (!$i) $totalarray['nbfield']++;
687  }
688  // Type ent
689  if (!empty($arrayfields['typent.code']['checked']))
690  {
691  print '<td class="center">';
692  if (isset($typenArray[$obj->typent_code])) print $typenArray[$obj->typent_code];
693  print '</td>';
694  if (!$i) $totalarray['nbfield']++;
695  }
696  // Weight
697  if (!empty($arrayfields['e.weight']['checked']))
698  {
699  print '<td class="center">';
700  if (empty($object->trueWeight))
701  {
702  $tmparray = $object->getTotalWeightVolume();
703  print showDimensionInBestUnit($tmparray['weight'], 0, "weight", $langs, isset($conf->global->MAIN_WEIGHT_DEFAULT_ROUND) ? $conf->global->MAIN_WEIGHT_DEFAULT_ROUND : -1, isset($conf->global->MAIN_WEIGHT_DEFAULT_UNIT) ? $conf->global->MAIN_WEIGHT_DEFAULT_UNIT : 'no');
704  print $form->textwithpicto('', $langs->trans('EstimatedWeight'), 1);
705  } else {
706  print $object->trueWeight;
707  print ($object->trueWeight && $object->weight_units != '') ? ' '.measuringUnitString(0, "weight", $object->weight_units) : '';
708  }
709  print '</td>';
710  if (!$i) $totalarray['nbfield']++;
711  }
712  // Date delivery planed
713  if (!empty($arrayfields['e.date_delivery']['checked']))
714  {
715  print '<td class="center">';
716  print dol_print_date($db->jdate($obj->delivery_date), "dayhour");
717  /*$now = time();
718  if ( ($now - $db->jdate($obj->date_expedition)) > $conf->warnings->lim && $obj->statutid == 1 )
719  {
720  }*/
721  print "</td>\n";
722  }
723  // Tracking number
724  if (!empty($arrayfields['e.tracking_number']['checked']))
725  {
726  print '<td class="center">'.$obj->tracking_number."</td>\n";
727  if (!$i) $totalarray['nbfield']++;
728  }
729 
730  if (!empty($arrayfields['l.ref']['checked']) || !empty($arrayfields['l.date_delivery']['checked']))
731  {
732  $shipment->fetchObjectLinked($shipment->id, $shipment->element);
733  $receiving = '';
734  if (is_array($shipment->linkedObjects['delivery']) && count($shipment->linkedObjects['delivery']) > 0) $receiving = reset($shipment->linkedObjects['delivery']);
735 
736  if (!empty($arrayfields['l.ref']['checked']))
737  {
738  // Ref
739  print '<td>';
740  print !empty($receiving) ? $receiving->getNomUrl($db) : '';
741  print '</td>';
742  }
743 
744  if (!empty($arrayfields['l.date_delivery']['checked']))
745  {
746  // Date received
747  print '<td class="center">';
748  print dol_print_date($db->jdate($obj->date_reception), "day");
749  print '</td>'."\n";
750  }
751  }
752 
753  // Extra fields
754  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
755  // Fields from hook
756  $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
757  $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
758  print $hookmanager->resPrint;
759  // Date creation
760  if (!empty($arrayfields['e.datec']['checked']))
761  {
762  print '<td class="center nowrap">';
763  print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
764  print '</td>';
765  if (!$i) $totalarray['nbfield']++;
766  }
767  // Date modification
768  if (!empty($arrayfields['e.tms']['checked']))
769  {
770  print '<td class="center nowrap">';
771  print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
772  print '</td>';
773  if (!$i) $totalarray['nbfield']++;
774  }
775  // Status
776  if (!empty($arrayfields['e.fk_statut']['checked']))
777  {
778  print '<td class="right nowrap">'.$shipment->LibStatut($obj->fk_statut, 5).'</td>';
779  if (!$i) $totalarray['nbfield']++;
780  }
781  // Billed
782  if (!empty($arrayfields['e.billed']['checked']))
783  {
784  print '<td class="center">'.yn($obj->billed).'</td>';
785  if (!$i) $totalarray['nbfield']++;
786  }
787 
788  // Action column
789  print '<td class="nowrap" align="center">';
790  if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
791  {
792  $selected = 0;
793  if (in_array($obj->rowid, $arrayofselected)) $selected = 1;
794  print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
795  }
796  print '</td>';
797  if (!$i) $totalarray['nbfield']++;
798 
799  print "</tr>\n";
800 
801  $i++;
802  }
803  $db->free($resql);
804 
805  $parameters = array('arrayfields'=>$arrayfields, 'totalarray' => $totalarray, 'sql'=>$sql);
806  $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook
807  print $hookmanager->resPrint;
808 
809  print "</table>";
810  print "</div>";
811  print '</form>';
812 
813  $hidegeneratedfilelistifempty = 1;
814  if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) $hidegeneratedfilelistifempty = 0;
815 
816  // Show list of available documents
817  $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
818  $urlsource .= str_replace('&amp;', '&', $param);
819 
820  $filedir = $diroutputmassaction;
821  $genallowed = $user->rights->expedition->lire;
822  $delallowed = $user->rights->expedition->creer;
823  $title = '';
824 
825  print $formfile->showdocuments('massfilesarea_sendings', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
826 } else {
827  dol_print_error($db);
828 }
829 
830 // End of page
831 llxFooter();
832 $db->close();
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm= 'auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
dolGetButtonTitle($label, $helpText= '', $iconClass= 'fa fa-file', $url= '', $id= '', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
dol_now($mode= 'auto')
Return date for now.
llxHeader()
Empty header.
Definition: wrapper.php:45
Class to build HTML component for third parties management Only common components are here...
Class to manage standard extra fields.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
print_barre_liste($titre, $page, $file, $options= '', $sortfield= '', $sortorder= '', $morehtmlcenter= '', $num=-1, $totalnboflines= '', $picto= 'generic', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow= '')
Print a title with navigation controls for pagination.
Class to manage generation of HTML components Only common components must be here.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname.
Class to manage third parties objects (customers, suppliers, prospects...)
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round=-1, $forceunitoutput= 'no')
Output a dimension with best unit.
Class to manage shipments.
Classe permettant la generation de composants html autre Only common components are here...
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=0)
Check permissions of a user to show a page and an object.
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...
Class to offer components to list and upload files.
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_sort_array(&$array, $index, $order= 'asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
print
Draft customers invoices.
Definition: index.php:89
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->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)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
Definition: index.php:1232
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
llxFooter()
Empty footer.
Definition: wrapper.php:59
getCountry($searchkey, $withcode= '', $dbtouse=0, $outputlangs= '', $entconv=1, $searchlabel= '')
Return country label, code or id from an id, code or label.