30 require
'../main.inc.php';
31 require_once DOL_DOCUMENT_ROOT.
'/expedition/class/expedition.class.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
35 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
36 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
37 require_once DOL_DOCUMENT_ROOT.
'/core/lib/product.lib.php';
40 $langs->loadLangs(array(
"sendings",
"deliveries",
'companies',
'bills',
'products'));
42 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'shipmentlist';
44 $socid =
GETPOST(
'socid',
'int');
46 $action =
GETPOST(
'action',
'alpha');
47 $massaction =
GETPOST(
'massaction',
'alpha');
48 $show_files =
GETPOST(
'show_files',
'int');
49 $toselect =
GETPOST(
'toselect',
'array');
52 $expeditionid =
GETPOST(
'id',
'int');
54 $socid = $user->socid;
58 $search_ref_exp =
GETPOST(
"search_ref_exp",
'alpha');
59 $search_ref_liv =
GETPOST(
'search_ref_liv',
'alpha');
60 $search_ref_customer =
GETPOST(
'search_ref_customer',
'alpha');
61 $search_company =
GETPOST(
"search_company",
'alpha');
62 $search_shipping_method_id =
GETPOST(
'search_shipping_method_id');
63 $search_tracking =
GETPOST(
"search_tracking",
'alpha');
64 $search_town =
GETPOST(
'search_town',
'alpha');
65 $search_zip =
GETPOST(
'search_zip',
'alpha');
66 $search_state =
GETPOST(
"search_state");
67 $search_country =
GETPOST(
"search_country",
'int');
68 $search_type_thirdparty =
GETPOST(
"search_type_thirdparty",
'int');
69 $search_billed =
GETPOST(
"search_billed",
'int');
70 $search_datedelivery_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_datedelivery_startmonth',
'int'),
GETPOST(
'search_datedelivery_startday',
'int'),
GETPOST(
'search_datedelivery_startyear',
'int'));
71 $search_datedelivery_end =
dol_mktime(23, 59, 59,
GETPOST(
'search_datedelivery_endmonth',
'int'),
GETPOST(
'search_datedelivery_endday',
'int'),
GETPOST(
'search_datedelivery_endyear',
'int'));
72 $search_datereceipt_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_datereceipt_startmonth',
'int'),
GETPOST(
'search_datereceipt_startday',
'int'),
GETPOST(
'search_datereceipt_startyear',
'int'));
73 $search_datereceipt_end =
dol_mktime(23, 59, 59,
GETPOST(
'search_datereceipt_endmonth',
'int'),
GETPOST(
'search_datereceipt_endday',
'int'),
GETPOST(
'search_datereceipt_endyear',
'int'));
74 $sall = trim((
GETPOST(
'search_all',
'alphanohtml') !=
'') ?
GETPOST(
'search_all',
'alphanohtml') :
GETPOST(
'sall',
'alphanohtml'));
75 $socid =
GETPOST(
'socid',
'int');
76 $search_user =
GETPOST(
'search_user',
'int');
77 $search_sale =
GETPOST(
'search_sale',
'int');
78 $search_categ_cus =
GETPOST(
"search_categ_cus",
'int');
79 $search_product_category =
GETPOST(
'search_product_category',
'int');
80 $optioncss =
GETPOST(
'optioncss',
'alpha');
81 $mode =
GETPOST(
'mode',
'alpha');
83 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
84 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
85 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
93 if (empty($page) || $page == -1 || (empty($toselect) && $massaction ===
'0')) {
96 $offset = $limit * $page;
97 $pageprev = $page - 1;
98 $pagenext = $page + 1;
100 $search_status =
GETPOST(
'search_status',
'intcomma');
102 $diroutputmassaction = $conf->expedition->dir_output.
'/sending/temp/massgeneration/'.$user->id;
108 $hookmanager->initHooks(array(
'shipmentlist'));
112 $extrafields->fetch_name_optionals_label($object->table_element);
114 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
117 $fieldstosearchall = array(
119 's.nom'=>
"ThirdParty",
120 'e.note_public'=>
'NotePublic',
122 'e.tracking_number'=>
"TrackingNumber",
124 if (empty($user->socid)) {
125 $fieldstosearchall[
"e.note_private"] =
"NotePrivate";
128 $checkedtypetiers = 0;
129 $arrayfields = array(
130 'e.ref'=>array(
'label'=>$langs->trans(
"Ref"),
'checked'=>1,
'position'=>1),
131 'e.ref_customer'=>array(
'label'=>$langs->trans(
"RefCustomer"),
'checked'=>1,
'position'=>2),
132 's.nom'=>array(
'label'=>$langs->trans(
"ThirdParty"),
'checked'=>1,
'position'=>3),
133 's.town'=>array(
'label'=>$langs->trans(
"Town"),
'checked'=>1,
'position'=>4),
134 's.zip'=>array(
'label'=>$langs->trans(
"Zip"),
'checked'=>1,
'position'=>5),
135 'state.nom'=>array(
'label'=>$langs->trans(
"StateShort"),
'checked'=>0,
'position'=>6),
136 'country.code_iso'=>array(
'label'=>$langs->trans(
"Country"),
'checked'=>0,
'position'=>7),
137 'typent.code'=>array(
'label'=>$langs->trans(
"ThirdPartyType"),
'checked'=>$checkedtypetiers,
'position'=>8),
138 'e.date_delivery'=>array(
'label'=>$langs->trans(
"DateDeliveryPlanned"),
'checked'=>1,
'position'=>9),
139 'e.fk_shipping_method'=>array(
'label'=>$langs->trans(
'SendingMethod'),
'checked'=>1,
'position'=>10),
140 'e.tracking_number'=>array(
'label'=>$langs->trans(
"TrackingNumber"),
'checked'=>1,
'position'=>11),
141 'e.weight'=>array(
'label'=>$langs->trans(
"Weight"),
'checked'=>0,
'position'=>12),
142 'e.datec'=>array(
'label'=>$langs->trans(
"DateCreation"),
'checked'=>0,
'position'=>500),
143 'e.tms'=>array(
'label'=>$langs->trans(
"DateModificationShort"),
'checked'=>0,
'position'=>500),
144 'e.fk_statut'=>array(
'label'=>$langs->trans(
"Status"),
'checked'=>1,
'position'=>1000),
145 'l.ref'=>array(
'label'=>$langs->trans(
"DeliveryRef"),
'checked'=>1,
'enabled'=>(empty($conf->delivery_note->enabled) ? 0 : 1)),
146 'l.date_delivery'=>array(
'label'=>$langs->trans(
"DateReceived"),
'checked'=>1,
'enabled'=>(empty($conf->delivery_note->enabled) ? 0 : 1)),
147 'e.billed'=>array(
'label'=>$langs->trans(
"Billed"),
'checked'=>1,
'position'=>1000,
'enabled'=>(!empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)))
151 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
162 if (
GETPOST(
'cancel',
'alpha')) {
163 $action =
'list'; $massaction =
'';
165 if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
169 $parameters = array(
'socid'=>$socid);
170 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
175 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
178 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
182 $search_product_category =
'';
183 $search_ref_exp =
'';
184 $search_ref_liv =
'';
185 $search_ref_customer =
'';
186 $search_company =
'';
191 $search_country =
'';
192 $search_tracking =
'';
193 $search_shipping_method_id =
'';
194 $search_type_thirdparty =
'';
196 $search_datedelivery_start =
'';
197 $search_datedelivery_end =
'';
198 $search_datereceipt_start =
'';
199 $search_datereceipt_end =
'';
202 $search_array_options = array();
203 $search_categ_cus = 0;
206 if (empty($reshook)) {
207 $objectclass =
'Expedition';
208 $objectlabel =
'Sendings';
209 $permissiontoread = $user->rights->expedition->lire;
210 $permissiontoadd = $user->rights->expedition->creer;
211 $permissiontodelete = $user->rights->expedition->supprimer;
212 $uploaddir = $conf->expedition->dir_output.
'/sending';
213 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
217 if ($massaction ==
'classifyclose') {
219 $selectids =
GETPOST(
'toselect',
'array');
220 foreach ($selectids as $selectid) {
222 $object->fetch($selectid);
223 $result = $object->setClosed();
226 $massaction = $action =
'classifyclose';
237 header(
'Location: '.$_SERVER[
"PHP_SELF"]);
254 $companystatic =
new Societe($db);
258 $helpurl =
'EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones';
259 llxHeader(
'', $langs->trans(
'ListOfSendings'), $helpurl);
262 if ($sall || $search_user > 0) {
263 $sql =
'SELECT DISTINCT';
265 $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, e.fk_shipping_method,";
268 $sql .=
" l.date_delivery as date_reception,";
270 $sql .=
" s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, ";
271 $sql .=
" typent.code as typent_code,";
272 $sql .=
" state.code_departement as state_code, state.nom as state_name,";
273 $sql .=
" e.date_creation as date_creation, e.tms as date_update,";
275 if (($search_categ_cus > 0) || ($search_categ_cus == -2)) {
276 $sql .=
", cc.fk_categorie, cc.fk_soc";
279 if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
280 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
281 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
285 $parameters = array();
286 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters);
287 $sql .= $hookmanager->resPrint;
291 $sql .=
" FROM ".MAIN_DB_PREFIX.
"expedition as e";
292 if (!empty($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
293 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (e.rowid = ef.fk_object)";
296 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'expeditiondet as ed ON e.rowid=ed.fk_expedition';
297 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'commandedet as pd ON pd.rowid=ed.fk_origin_line';
299 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON s.rowid = e.fk_soc";
300 if (($search_categ_cus > 0) || ($search_categ_cus == -2)) {
301 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
"categorie_societe as cc ON s.rowid = cc.fk_soc";
303 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on (country.rowid = s.fk_pays)";
304 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_typent as typent on (typent.id = s.fk_typent)";
305 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_departements as state on (state.rowid = s.fk_departement)";
308 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_element as ee ON e.rowid = ee.fk_source AND ee.sourcetype = 'shipping' AND ee.targettype = 'delivery'";
309 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"delivery as l ON l.rowid = ee.fk_target";
311 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user as u ON e.fk_user_author = u.rowid';
312 if ($search_user > 0) {
313 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_element as eesource ON eesource.fk_target = e.rowid AND eesource.targettype = 'shipping' AND eesource.sourcetype = 'commande'";
316 if ($search_sale > 0 || (empty($user->rights->societe->client->voir) && !$socid)) {
317 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
319 if ($search_user > 0) {
320 $sql .=
", ".MAIN_DB_PREFIX.
"element_contact as ec";
321 $sql .=
", ".MAIN_DB_PREFIX.
"c_type_contact as tc";
325 $parameters = array();
326 $reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
327 $sql .= $hookmanager->resPrint;
329 $sql .=
" WHERE e.entity IN (".getEntity(
'expedition').
")";
332 $sql .=
" AND s.rowid = ".((int) $socid);
334 if (empty($user->rights->societe->client->voir) && !$socid) {
335 $sql .=
" AND e.fk_soc = sc.fk_soc";
336 $sql .=
" AND sc.fk_user = ".((int) $user->id);
339 $sql .=
" AND e.fk_soc = ".((int) $socid);
341 if ($search_status <>
'' && $search_status >= 0) {
342 $sql .=
" AND e.fk_statut = ".((int) $search_status);
344 if ($search_ref_customer !=
'') {
347 if ($search_billed !=
'' && $search_billed >= 0) {
348 $sql .=
' AND e.billed = '.((int) $search_billed);
359 if ($search_country) {
360 $sql .=
" AND s.fk_pays IN (".$db->sanitize($search_country).
')';
362 if ($search_shipping_method_id > 0) {
363 $sql .=
" AND e.fk_shipping_method = ".((int) $search_shipping_method_id);
365 if ($search_tracking) {
368 if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
369 $sql .=
" AND s.fk_typent IN (".$db->sanitize($search_type_thirdparty).
')';
371 if ($search_sale > 0) {
372 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $search_sale);
374 if ($search_user > 0) {
376 $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 = ".((int) $search_user);
378 if ($search_company) {
381 if ($search_ref_exp) {
384 if ($search_datedelivery_start) {
385 $sql .=
" AND e.date_delivery >= '".$db->idate($search_datedelivery_start).
"'";
387 if ($search_datedelivery_end) {
388 $sql .=
" AND e.date_delivery <= '".$db->idate($search_datedelivery_end).
"'";
391 if ($search_ref_liv) {
394 if ($search_datereceipt_start) {
395 $sql .=
" AND l.date_delivery >= '".$db->idate($search_datereceipt_start).
"'";
397 if ($search_datereceipt_end) {
398 $sql .=
" AND l.date_delivery <= '".$db->idate($search_datereceipt_end).
"'";
404 if ($search_categ_cus > 0) {
405 $sql .=
" AND cc.fk_categorie = ".((int) $search_categ_cus);
407 if ($search_categ_cus == -2) {
408 $sql .=
" AND cc.fk_categorie IS NULL";
411 $searchCategoryProductOperator = -1;
412 $searchCategoryProductList = array($search_product_category);
413 if (!empty($searchCategoryProductList)) {
414 $searchCategoryProductSqlList = array();
415 $listofcategoryid =
'';
416 foreach ($searchCategoryProductList as $searchCategoryProduct) {
417 if (intval($searchCategoryProduct) == -2) {
418 $searchCategoryProductSqlList[] =
"NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX.
"categorie_product as ck, ".MAIN_DB_PREFIX.
"expeditiondet as ed, ".MAIN_DB_PREFIX.
"commandedet as cd WHERE ed.fk_expedition = e.rowid AND ed.fk_origin_line = cd.rowid AND cd.fk_product = ck.fk_product)";
419 } elseif (intval($searchCategoryProduct) > 0) {
420 if ($searchCategoryProductOperator == 0) {
421 $searchCategoryProductSqlList[] =
" EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX.
"categorie_product as ck, ".MAIN_DB_PREFIX.
"expeditiondet as ed, ".MAIN_DB_PREFIX.
"commandedet as cd WHERE ed.fk_expedition = e.rowid AND ed.fk_origin_line = cd.rowid AND cd.fk_product = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).
")";
423 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryProduct);
427 if ($listofcategoryid) {
428 $searchCategoryProductSqlList[] =
" EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX.
"categorie_product as ck, ".MAIN_DB_PREFIX.
"expeditiondet as ed, ".MAIN_DB_PREFIX.
"commandedet as cd WHERE ed.fk_expedition = e.rowid AND ed.fk_origin_line = cd.rowid AND cd.fk_product = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid).
"))";
430 if ($searchCategoryProductOperator == 1) {
431 if (!empty($searchCategoryProductSqlList)) {
432 $sql .=
" AND (".implode(
' OR ', $searchCategoryProductSqlList).
")";
435 if (!empty($searchCategoryProductSqlList)) {
436 $sql .=
" AND (".implode(
' AND ', $searchCategoryProductSqlList).
")";
441 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
444 $parameters = array();
445 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters);
446 $sql .= $hookmanager->resPrint;
449 $parameters = array();
450 $reshook = $hookmanager->executeHooks(
'printFieldListHaving', $parameters, $object);
451 $sql .= empty($hookmanager->resPrint) ?
"" :
" HAVING 1=1 ".$hookmanager->resPrint;
454 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
456 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
457 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
458 $resql = $db->query($sqlforcount);
460 $objforcount = $db->fetch_object(
$resql);
474 $sql .= $db->order($sortfield, $sortorder);
476 $sql .= $db->plimit($limit + 1, $offset);
480 $resql = $db->query($sql);
486 $num = $db->num_rows(
$resql);
488 $arrayofselected = is_array($toselect) ? $toselect : array();
494 $param .=
'&mode='.urlencode($mode);
496 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
497 $param .=
'&contextpage='.urlencode($contextpage);
499 if ($limit > 0 && $limit != $conf->liste_limit) {
500 $param .=
'&limit='.urlencode($limit);
503 $param .=
"&sall=".urlencode($sall);
505 if ($search_ref_exp) {
506 $param .=
"&search_ref_exp=".urlencode($search_ref_exp);
508 if ($search_ref_liv) {
509 $param .=
"&search_ref_liv=".urlencode($search_ref_liv);
511 if ($search_ref_customer) {
512 $param .=
"&search_ref_customer=".urlencode($search_ref_customer);
514 if ($search_user > 0) {
515 $param .=
'&search_user='.urlencode($search_user);
517 if ($search_sale > 0) {
518 $param .=
'&search_sale='.urlencode($search_sale);
520 if ($search_company) {
521 $param .=
"&search_company=".urlencode($search_company);
523 if ($search_shipping_method_id) {
524 $param .=
"&search_shipping_method_id=".urlencode($search_shipping_method_id);
526 if ($search_tracking) {
527 $param .=
"&search_tracking=".urlencode($search_tracking);
530 $param .=
'&search_town='.urlencode($search_town);
533 $param .=
'&search_zip='.urlencode($search_zip);
535 if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
536 $param .=
'&search_type_thirdparty='.urlencode($search_type_thirdparty);
538 if ($search_datedelivery_start) {
539 $param .=
'&search_datedelivery_startday='.urlencode(
dol_print_date($search_datedelivery_start,
'%d')).
'&search_datedelivery_startmonth='.urlencode(
dol_print_date($search_datedelivery_start,
'%m')).
'&search_datedelivery_startyear='.urlencode(
dol_print_date($search_datedelivery_start,
'%Y'));
541 if ($search_datedelivery_end) {
542 $param .=
'&search_datedelivery_endday='.urlencode(
dol_print_date($search_datedelivery_end,
'%d')).
'&search_datedelivery_endmonth='.urlencode(
dol_print_date($search_datedelivery_end,
'%m')).
'&search_datedelivery_endyear='.urlencode(
dol_print_date($search_datedelivery_end,
'%Y'));
544 if ($search_datereceipt_start) {
545 $param .=
'&search_datereceipt_startday='.urlencode(
dol_print_date($search_datereceipt_start,
'%d')).
'&search_datereceipt_startmonth='.urlencode(
dol_print_date($search_datereceipt_start,
'%m')).
'&search_datereceipt_startyear='.urlencode(
dol_print_date($search_datereceipt_start,
'%Y'));
547 if ($search_datereceipt_end) {
548 $param .=
'&search_datereceipt_endday='.urlencode(
dol_print_date($search_datereceipt_end,
'%d')).
'&search_datereceipt_endmonth='.urlencode(
dol_print_date($search_datereceipt_end,
'%m')).
'&search_datereceipt_endyear='.urlencode(
dol_print_date($search_datereceipt_end,
'%Y'));
550 if ($search_product_category !=
'') {
551 $param .=
'&search_product_category='.urlencode($search_product_category);
553 if (($search_categ_cus > 0) || ($search_categ_cus == -2)) {
554 $param .=
'&search_categ_cus='.urlencode($search_categ_cus);
556 if ($search_status !=
'') {
557 $param .=
'&search_status='.urlencode($search_status);
559 if ($optioncss !=
'') {
560 $param .=
'&optioncss='.urlencode($optioncss);
563 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
566 $parameters = array();
567 $reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object);
568 $param .= $hookmanager->resPrint;
570 $arrayofmassactions = array(
571 'builddoc' =>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"PDFMerge"),
572 'classifyclose' =>
img_picto(
'',
'stop-circle',
'class="pictofixedwidth"').$langs->trans(
"Close"),
573 'presend' =>
img_picto(
'',
'email',
'class="pictofixedwidth"').$langs->trans(
"SendByMail"),
575 if (in_array($massaction, array(
'presend'))) {
576 $arrayofmassactions = array();
578 $massactionbutton =
$form->selectMassAction(
'', $arrayofmassactions);
585 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewList'),
'',
'fa fa-bars imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=common'.preg_replace(
'/(&|\?)*mode=[^&]+/',
'', $param),
'', ((empty($mode) || $mode ==
'common') ? 2 : 1), array(
'morecss'=>
'reposition'));
586 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'ViewKanban'),
'',
'fa fa-th-list imgforviewmode', $_SERVER[
"PHP_SELF"].
'?mode=kanban'.preg_replace(
'/(&|\?)*mode=[^&]+/',
'', $param),
'', ($mode ==
'kanban' ? 2 : 1), array(
'morecss'=>
'reposition'));
587 $newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewSending'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/expedition/card.php?action=create2',
'', $user->rights->expedition->creer);
590 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
591 if ($optioncss !=
'') {
592 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
594 print
'<input type="hidden" name="token" value="'.newToken().
'">';
595 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
596 print
'<input type="hidden" name="action" value="list">';
597 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
598 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
599 print
'<input type="hidden" name="mode" value="'.$mode.
'">';
601 print_barre_liste($langs->trans(
'ListOfSendings'), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num,
$nbtotalofrecords,
'dolly', 0, $newcardbutton,
'', $limit, 0, 0, 1);
603 $topicmail =
"SendShippingRef";
604 $modelmail =
"shipping_send";
606 $trackid =
'shi'.$object->id;
607 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
610 foreach ($fieldstosearchall as $key => $val) {
611 $fieldstosearchall[$key] = $langs->trans($val);
613 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $sall).join(
', ', $fieldstosearchall).
'</div>';
619 if ($user->rights->user->user->lire) {
620 $langs->load(
"commercial");
621 $moreforfilter .=
'<div class="divsearchfield">';
622 $tmptitle = $langs->trans(
'ThirdPartiesOfSaleRepresentative');
623 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"');
624 $moreforfilter .= $formother->select_salesrepresentatives($search_sale,
'search_sale', $user, 0, $tmptitle,
'maxwidth200');
625 $moreforfilter .=
'</div>';
628 if ($user->rights->user->user->lire) {
629 $moreforfilter .=
'<div class="divsearchfield">';
630 $tmptitle = $langs->trans(
'LinkedToSpecificUsers');
631 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"');
632 $moreforfilter .=
$form->select_dolusers($search_user,
'search_user', $tmptitle,
'', 0,
'',
'', 0, 0, 0,
'', 0,
'',
'maxwidth200');
633 $moreforfilter .=
'</div>';
636 if (
isModEnabled(
'categorie') && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) {
637 include_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
638 $moreforfilter .=
'<div class="divsearchfield">';
639 $tmptitle = $langs->trans(
'IncludingProductWithTag');
640 $moreforfilter .=
img_picto($tmptitle,
'category');
643 $moreforfilter .= $formother->select_categories(Categorie::TYPE_PRODUCT, $search_product_category,
'search_product_category', 1, $tmptitle);
645 $moreforfilter .=
'</div>';
647 if (
isModEnabled(
'categorie') && $user->rights->categorie->lire) {
648 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
649 $moreforfilter .=
'<div class="divsearchfield">';
650 $tmptitle = $langs->trans(
'CustomersProspectsCategoriesShort');
651 $moreforfilter .=
img_picto($tmptitle,
'category');
652 $moreforfilter .= $formother->select_categories(
'customer', $search_categ_cus,
'search_categ_cus', 1, $tmptitle);
653 $moreforfilter .=
'</div>';
655 $parameters = array();
656 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters);
657 if (empty($reshook)) {
658 $moreforfilter .= $hookmanager->resPrint;
660 $moreforfilter = $hookmanager->resPrint;
663 if (!empty($moreforfilter)) {
664 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
665 print $moreforfilter;
669 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
670 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN',
''));
671 if ($massactionbutton) {
672 $selectedfields .=
$form->showCheckAddButtons(
'checkforselect', 1);
675 print
'<div class="div-table-responsive">';
676 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
679 print
'<tr class="liste_titre_filter">';
681 if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
682 print
'<td class="liste_titre middle">';
683 $searchpicto =
$form->showFilterButtons(
'left');
688 if (!empty($arrayfields[
'e.ref'][
'checked'])) {
689 print
'<td class="liste_titre">';
690 print
'<input class="flat" size="6" type="text" name="search_ref_exp" value="'.$search_ref_exp.
'">';
694 if (!empty($arrayfields[
'e.ref_customer'][
'checked'])) {
695 print
'<td class="liste_titre">';
696 print
'<input class="flat" size="6" type="text" name="search_ref_customer" value="'.$search_ref_customer.
'">';
700 if (!empty($arrayfields[
's.nom'][
'checked'])) {
701 print
'<td class="liste_titre left">';
702 print
'<input class="flat" type="text" size="8" name="search_company" value="'.dol_escape_htmltag($search_company).
'">';
706 if (!empty($arrayfields[
's.town'][
'checked'])) {
707 print
'<td class="liste_titre"><input class="flat" type="text" size="6" name="search_town" value="'.$search_town.
'"></td>';
710 if (!empty($arrayfields[
's.zip'][
'checked'])) {
711 print
'<td class="liste_titre"><input class="flat" type="text" size="6" name="search_zip" value="'.$search_zip.
'"></td>';
714 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
715 print
'<td class="liste_titre">';
716 print
'<input class="flat" size="4" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).
'">';
720 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
721 print
'<td class="liste_titre center">';
722 print
$form->select_country($search_country,
'search_country',
'', 0,
'minwidth100imp maxwidth100');
726 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
727 print
'<td class="liste_titre maxwidthonsmartphone center">';
728 print
$form->selectarray(
"search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0,
'', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ?
'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT),
'', 1);
732 if (!empty($arrayfields[
'e.weight'][
'checked'])) {
733 print
'<td class="liste_titre maxwidthonsmartphone center">';
738 if (!empty($arrayfields[
'e.date_delivery'][
'checked'])) {
739 print
'<td class="liste_titre center">';
740 print
'<div class="nowrap">';
741 print
$form->selectDate($search_datedelivery_start ? $search_datedelivery_start : -1,
'search_datedelivery_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
743 print
'<div class="nowrap">';
744 print
$form->selectDate($search_datedelivery_end ? $search_datedelivery_end : -1,
'search_datedelivery_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
748 if (!empty($arrayfields[
'e.fk_shipping_method'][
'checked'])) {
750 print
'<td class="liste_titre center">';
751 $shipment->fetch_delivery_methods();
752 print
$form->selectarray(
"search_shipping_method_id", $shipment->meths, $search_shipping_method_id, 1, 0, 0,
"", 1, 0, 0,
'',
'maxwidth150');
756 if (!empty($arrayfields[
'e.tracking_number'][
'checked'])) {
757 print
'<td class="liste_titre center">';
758 print
'<input class="flat" size="6" type="text" name="search_tracking" value="'.dol_escape_htmltag($search_tracking).
'">';
761 if (!empty($arrayfields[
'l.ref'][
'checked'])) {
763 print
'<td class="liste_titre">';
764 print
'<input class="flat" size="10" type="text" name="search_ref_liv" value="'.dol_escape_htmltag($search_ref_liv).
'"';
767 if (!empty($arrayfields[
'l.date_delivery'][
'checked'])) {
769 print
'<td class="liste_titre center">';
770 print
'<div class="nowrap">';
771 print
$form->selectDate($search_datereceipt_start ? $search_datereceipt_start : -1,
'search_datereceipt_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
773 print
'<div class="nowrap">';
774 print
$form->selectDate($search_datereceipt_end ? $search_datereceipt_end : -1,
'search_datereceipt_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
779 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
782 $parameters = array(
'arrayfields'=>$arrayfields);
783 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
784 print $hookmanager->resPrint;
786 if (!empty($arrayfields[
'e.datec'][
'checked'])) {
787 print
'<td class="liste_titre">';
791 if (!empty($arrayfields[
'e.tms'][
'checked'])) {
792 print
'<td class="liste_titre">';
796 if (!empty($arrayfields[
'e.fk_statut'][
'checked'])) {
797 print
'<td class="liste_titre maxwidthonsmartphone right">';
798 print
$form->selectarray(
'search_status', array(
'0'=>$langs->trans(
'StatusSendingDraftShort'),
'1'=>$langs->trans(
'StatusSendingValidatedShort'),
'2'=>$langs->trans(
'StatusSendingProcessedShort')), $search_status, 1, 0, 0,
'', 0, 0, 0,
'',
'onrightofpage');
802 if (!empty($arrayfields[
'e.billed'][
'checked'])) {
803 print
'<td class="liste_titre maxwidthonsmartphone center">';
804 print
$form->selectyesno(
'search_billed', $search_billed, 1, 0, 1);
808 if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
809 print
'<td class="liste_titre middle">';
810 $searchpicto =
$form->showFilterAndCheckAddButtons(0);
816 print
'<tr class="liste_titre">';
817 if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
818 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
820 if (!empty($arrayfields[
'e.ref'][
'checked'])) {
821 print_liste_field_titre($arrayfields[
'e.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"e.ref",
"", $param,
'', $sortfield, $sortorder);
823 if (!empty($arrayfields[
'e.ref_customer'][
'checked'])) {
824 print_liste_field_titre($arrayfields[
'e.ref_customer'][
'label'], $_SERVER[
"PHP_SELF"],
"e.ref_customer",
"", $param,
'', $sortfield, $sortorder);
826 if (!empty($arrayfields[
's.nom'][
'checked'])) {
827 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s.nom",
"", $param,
'', $sortfield, $sortorder,
'left ');
829 if (!empty($arrayfields[
's.town'][
'checked'])) {
830 print_liste_field_titre($arrayfields[
's.town'][
'label'], $_SERVER[
"PHP_SELF"],
's.town',
'', $param,
'', $sortfield, $sortorder);
832 if (!empty($arrayfields[
's.zip'][
'checked'])) {
833 print_liste_field_titre($arrayfields[
's.zip'][
'label'], $_SERVER[
"PHP_SELF"],
's.zip',
'', $param,
'', $sortfield, $sortorder);
835 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
836 print_liste_field_titre($arrayfields[
'state.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"state.nom",
"", $param,
'', $sortfield, $sortorder);
838 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
839 print_liste_field_titre($arrayfields[
'country.code_iso'][
'label'], $_SERVER[
"PHP_SELF"],
"country.code_iso",
"", $param,
'', $sortfield, $sortorder,
'center ');
841 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
842 print_liste_field_titre($arrayfields[
'typent.code'][
'label'], $_SERVER[
"PHP_SELF"],
"typent.code",
"", $param,
'', $sortfield, $sortorder,
'center ');
844 if (!empty($arrayfields[
'e.weight'][
'checked'])) {
845 print_liste_field_titre($arrayfields[
'e.weight'][
'label'], $_SERVER[
"PHP_SELF"],
"e.weight",
"", $param,
'', $sortfield, $sortorder,
'center ');
847 if (!empty($arrayfields[
'e.date_delivery'][
'checked'])) {
848 print_liste_field_titre($arrayfields[
'e.date_delivery'][
'label'], $_SERVER[
"PHP_SELF"],
"e.date_delivery",
"", $param,
'', $sortfield, $sortorder,
'center ');
850 if (!empty($arrayfields[
'e.fk_shipping_method'][
'checked'])) {
851 print_liste_field_titre($arrayfields[
'e.fk_shipping_method'][
'label'], $_SERVER[
"PHP_SELF"],
"e.fk_shipping_method",
"", $param,
'', $sortfield, $sortorder,
'center ');
853 if (!empty($arrayfields[
'e.tracking_number'][
'checked'])) {
854 print_liste_field_titre($arrayfields[
'e.tracking_number'][
'label'], $_SERVER[
"PHP_SELF"],
"e.tracking_number",
"", $param,
'', $sortfield, $sortorder,
'center ');
856 if (!empty($arrayfields[
'l.ref'][
'checked'])) {
857 print_liste_field_titre($arrayfields[
'l.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"l.ref",
"", $param,
'', $sortfield, $sortorder);
859 if (!empty($arrayfields[
'l.date_delivery'][
'checked'])) {
860 print_liste_field_titre($arrayfields[
'l.date_delivery'][
'label'], $_SERVER[
"PHP_SELF"],
"l.date_delivery",
"", $param,
'', $sortfield, $sortorder,
'center ');
863 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
865 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
866 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
867 print $hookmanager->resPrint;
868 if (!empty($arrayfields[
'e.datec'][
'checked'])) {
869 print_liste_field_titre($arrayfields[
'e.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"e.date_creation",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
871 if (!empty($arrayfields[
'e.tms'][
'checked'])) {
872 print_liste_field_titre($arrayfields[
'e.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"e.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
874 if (!empty($arrayfields[
'e.fk_statut'][
'checked'])) {
875 print_liste_field_titre($arrayfields[
'e.fk_statut'][
'label'], $_SERVER[
"PHP_SELF"],
"e.fk_statut",
"", $param,
'', $sortfield, $sortorder,
'right ');
877 if (!empty($arrayfields[
'e.billed'][
'checked'])) {
878 print_liste_field_titre($arrayfields[
'e.billed'][
'label'], $_SERVER[
"PHP_SELF"],
"e.billed",
"", $param,
'', $sortfield, $sortorder,
'center ');
880 if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
881 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
885 $typenArray = $formcompany->typent_array(1);
887 $totalarray = array();
888 $totalarray[
'nbfield'] = 0;
889 while ($i < min($num, $limit)) {
890 $obj = $db->fetch_object(
$resql);
892 $shipment->id = $obj->rowid;
893 $shipment->ref = $obj->ref;
894 $shipment->shipping_method_id=$obj->fk_shipping_method;
896 $companystatic->id = $obj->socid;
897 $companystatic->ref = $obj->name;
898 $companystatic->name = $obj->name;
901 $object->fetch($obj->rowid);
903 if ($mode ==
'kanban') {
905 print
'<tr><td colspan="12">';
906 print
'<div class="box-flex-container">';
908 $object->socid = $companystatic->getNomUrl(1);
909 $object->date_delivery = $obj->delivery_date;
910 $object->town = $obj->town;
911 print $object->getKanbanView(
'');
912 if ($i == min($num, $limit) - 1) {
917 print
'<tr class="oddeven">';
920 if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
921 print
'<td class="nowrap" align="center">';
922 if ($massactionbutton || $massaction) {
924 if (in_array($obj->rowid, $arrayofselected)) {
927 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
932 if (!empty($arrayfields[
'e.ref'][
'checked'])) {
933 print
'<td class="nowraponall">';
934 print $shipment->getNomUrl(1);
937 $totalarray[
'nbfield']++;
942 if (!empty($arrayfields[
'e.ref_customer'][
'checked'])) {
944 print $obj->ref_customer;
947 $totalarray[
'nbfield']++;
952 if (!empty($arrayfields[
's.nom'][
'checked'])) {
953 print
'<td class="tdoverflowmax150">';
954 print $companystatic->getNomUrl(1);
957 $totalarray[
'nbfield']++;
961 if (!empty($arrayfields[
's.town'][
'checked'])) {
962 print
'<td class="nocellnopadd">';
966 $totalarray[
'nbfield']++;
970 if (!empty($arrayfields[
's.zip'][
'checked'])) {
971 print
'<td class="nocellnopadd center">';
975 $totalarray[
'nbfield']++;
979 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
980 print
'<td class="center">'.$obj->state_name.
"</td>\n";
982 $totalarray[
'nbfield']++;
986 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
987 print
'<td class="center">';
989 print $tmparray[
'label'];
992 $totalarray[
'nbfield']++;
996 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
997 print
'<td class="center">';
998 if (isset($typenArray[$obj->typent_code])) {
999 print $typenArray[$obj->typent_code];
1003 $totalarray[
'nbfield']++;
1007 if (!empty($arrayfields[
'e.weight'][
'checked'])) {
1008 print
'<td class="center">';
1009 if (empty($object->trueWeight)) {
1010 $tmparray = $object->getTotalWeightVolume();
1011 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');
1012 print
$form->textwithpicto(
'', $langs->trans(
'EstimatedWeight'), 1);
1014 print $object->trueWeight;
1015 print ($object->trueWeight && $object->weight_units !=
'') ?
' '.measuringUnitString(0,
"weight", $object->weight_units) :
'';
1019 $totalarray[
'nbfield']++;
1023 if (!empty($arrayfields[
'e.date_delivery'][
'checked'])) {
1024 print
'<td class="center">';
1025 print
dol_print_date($db->jdate($obj->delivery_date),
"dayhour");
1028 if (!empty($arrayfields[
'e.fk_shipping_method'][
'checked'])) {
1030 $code=$langs->getLabelFromKey($db, $shipment->shipping_method_id,
'c_shipment_mode',
'rowid',
'code');
1031 print
'<td class="center tdoverflowmax150" title="'.dol_escape_htmltag($langs->trans(
"SendingMethod".strtoupper($code))).
'">';
1032 if ($shipment->shipping_method_id > 0) print $langs->trans(
"SendingMethod".strtoupper($code));
1036 if (!empty($arrayfields[
'e.tracking_number'][
'checked'])) {
1037 $shipment->getUrlTrackingStatus($obj->tracking_number);
1038 print
'<td class="center">'.$shipment->tracking_url.
"</td>\n";
1041 $totalarray[
'nbfield']++;
1045 if (!empty($arrayfields[
'l.ref'][
'checked']) || !empty($arrayfields[
'l.date_delivery'][
'checked'])) {
1046 $shipment->fetchObjectLinked($shipment->id, $shipment->element);
1048 if (is_array($shipment->linkedObjects[
'delivery']) && count($shipment->linkedObjects[
'delivery']) > 0) {
1049 $receiving = reset($shipment->linkedObjects[
'delivery']);
1052 if (!empty($arrayfields[
'l.ref'][
'checked'])) {
1055 print !empty($receiving) ? $receiving->getNomUrl($db) :
'';
1059 if (!empty($arrayfields[
'l.date_delivery'][
'checked'])) {
1061 print
'<td class="center">';
1068 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1070 $parameters = array(
'arrayfields'=>$arrayfields,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
1071 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
1072 print $hookmanager->resPrint;
1074 if (!empty($arrayfields[
'e.datec'][
'checked'])) {
1075 print
'<td class="center nowrap">';
1076 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
1079 $totalarray[
'nbfield']++;
1083 if (!empty($arrayfields[
'e.tms'][
'checked'])) {
1084 print
'<td class="center nowrap">';
1085 print
dol_print_date($db->jdate($obj->date_update),
'dayhour',
'tzuser');
1088 $totalarray[
'nbfield']++;
1092 if (!empty($arrayfields[
'e.fk_statut'][
'checked'])) {
1093 print
'<td class="right nowrap">'.$shipment->LibStatut($obj->fk_statut, 5).
'</td>';
1095 $totalarray[
'nbfield']++;
1099 if (!empty($arrayfields[
'e.billed'][
'checked'])) {
1100 print
'<td class="center">'.yn($obj->billed).
'</td>';
1102 $totalarray[
'nbfield']++;
1107 if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1108 print
'<td class="nowrap" align="center">';
1109 if ($massactionbutton || $massaction) {
1111 if (in_array($obj->rowid, $arrayofselected)) {
1114 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1119 $totalarray[
'nbfield']++;
1130 foreach ($arrayfields as $key => $val) {
1131 if (!empty($val[
'checked'])) {
1135 print
'<tr><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</td></tr>';
1140 $parameters = array(
'arrayfields'=>$arrayfields,
'totalarray' => $totalarray,
'sql'=>$sql);
1141 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters);
1142 print $hookmanager->resPrint;
1148 $hidegeneratedfilelistifempty = 1;
1149 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
1150 $hidegeneratedfilelistifempty = 0;
1154 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
1155 $urlsource .= str_replace(
'&',
'&', $param);
1157 $filedir = $diroutputmassaction;
1158 $genallowed = $user->rights->expedition->lire;
1159 $delallowed = $user->rights->expedition->creer;
1162 print $formfile->showdocuments(
'massfilesarea_sendings',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage shipments.
Class to manage third parties objects (customers, suppliers, prospects...)
getCountry($searchkey, $withcode='', $dbtouse=0, $outputlangs='', $entconv=1, $searchlabel='')
Return country label, code or id from an id, code or label.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
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...
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.
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...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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...
showDimensionInBestUnit($dimension, $unit, $type, $outputlangs, $round=-1, $forceunitoutput='no', $use_short_label=0)
Output a dimension with best unit.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessage($mesgs, $style='mesgs')
Set event message 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.
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
isModEnabled($module)
Is Dolibarr module enabled.
$nbtotalofrecords
Count total nb of records.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.