31require
'../main.inc.php';
32require_once DOL_DOCUMENT_ROOT.
'/expedition/class/expedition.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/lib/product.lib.php';
41$langs->loadLangs(array(
"sendings",
"deliveries",
'companies',
'bills',
'products'));
43$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'shipmentlist';
45$socid =
GETPOST(
'socid',
'int');
47$action =
GETPOST(
'action',
'alpha');
48$massaction =
GETPOST(
'massaction',
'alpha');
49$show_files =
GETPOST(
'show_files',
'int');
50$toselect =
GETPOST(
'toselect',
'array');
51$optioncss =
GETPOST(
'optioncss',
'alpha');
52$mode =
GETPOST(
'mode',
'alpha');
54$search_ref_exp =
GETPOST(
"search_ref_exp",
'alpha');
55$search_ref_liv =
GETPOST(
'search_ref_liv',
'alpha');
56$search_ref_customer =
GETPOST(
'search_ref_customer',
'alpha');
57$search_company =
GETPOST(
"search_company",
'alpha');
58$search_shipping_method_id =
GETPOST(
'search_shipping_method_id');
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$search_all = trim((
GETPOST(
'search_all',
'alphanohtml') !=
'') ?
GETPOST(
'search_all',
'alphanohtml') :
GETPOST(
'sall',
'alphanohtml'));
71$search_user =
GETPOST(
'search_user',
'int');
72$search_sale =
GETPOST(
'search_sale',
'int');
73$search_categ_cus =
GETPOST(
"search_categ_cus",
'int');
74$search_product_category =
GETPOST(
'search_product_category',
'int');
76$limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
77$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
78$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
79$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
86if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
90$offset = $limit * $page;
94$search_status =
GETPOST(
'search_status',
'intcomma');
96$diroutputmassaction = $conf->expedition->dir_output.
'/sending/temp/massgeneration/'.$user->id;
101$hookmanager->initHooks(array(
'shipmentlist'));
105$extrafields->fetch_name_optionals_label($object->table_element);
107$search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
110$fieldstosearchall = array(
112 's.nom'=>
"ThirdParty",
113 'e.note_public'=>
'NotePublic',
115 'e.tracking_number'=>
"TrackingNumber",
117if (empty($user->socid)) {
118 $fieldstosearchall[
"e.note_private"] =
"NotePrivate";
121$checkedtypetiers = 0;
123 'e.ref'=>array(
'label'=>$langs->trans(
"Ref"),
'checked'=>1,
'position'=>1),
124 'e.ref_customer'=>array(
'label'=>$langs->trans(
"RefCustomer"),
'checked'=>1,
'position'=>2),
125 's.nom'=>array(
'label'=>$langs->trans(
"ThirdParty"),
'checked'=>1,
'position'=>3),
126 's.town'=>array(
'label'=>$langs->trans(
"Town"),
'checked'=>1,
'position'=>4),
127 's.zip'=>array(
'label'=>$langs->trans(
"Zip"),
'checked'=>1,
'position'=>5),
128 'state.nom'=>array(
'label'=>$langs->trans(
"StateShort"),
'checked'=>0,
'position'=>6),
129 'country.code_iso'=>array(
'label'=>$langs->trans(
"Country"),
'checked'=>0,
'position'=>7),
130 'typent.code'=>array(
'label'=>$langs->trans(
"ThirdPartyType"),
'checked'=>$checkedtypetiers,
'position'=>8),
131 'e.date_delivery'=>array(
'label'=>$langs->trans(
"DateDeliveryPlanned"),
'checked'=>1,
'position'=>9),
132 'e.fk_shipping_method'=>array(
'label'=>$langs->trans(
'SendingMethod'),
'checked'=>1,
'position'=>10),
133 'e.tracking_number'=>array(
'label'=>$langs->trans(
"TrackingNumber"),
'checked'=>1,
'position'=>11),
134 'e.weight'=>array(
'label'=>$langs->trans(
"Weight"),
'checked'=>0,
'position'=>12),
135 'e.datec'=>array(
'label'=>$langs->trans(
"DateCreation"),
'checked'=>0,
'position'=>500),
136 'e.tms'=>array(
'label'=>$langs->trans(
"DateModificationShort"),
'checked'=>0,
'position'=>500),
137 'e.fk_statut'=>array(
'label'=>$langs->trans(
"Status"),
'checked'=>1,
'position'=>1000),
138 'l.ref'=>array(
'label'=>$langs->trans(
"DeliveryRef"),
'checked'=>1,
'position'=>1010,
'enabled'=>(
getDolGlobalInt(
'MAIN_SUBMODULE_DELIVERY') ? 1 : 0)),
139 'l.date_delivery'=>array(
'label'=>$langs->trans(
"DateReceived"),
'position'=>1020,
'checked'=>1,
'enabled'=>(
getDolGlobalInt(
'MAIN_SUBMODULE_DELIVERY') ? 1 : 0)),
140 'e.billed'=>array(
'label'=>$langs->trans(
"Billed"),
'checked'=>1,
'position'=>1100,
'enabled'=>
'getDolGlobalString("WORKFLOW_BILL_ON_SHIPMENT") !== "0"')
144include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
150$expeditionid =
GETPOST(
'id',
'int');
152 $socid = $user->socid;
163if (
GETPOST(
'cancel',
'alpha')) {
167if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
171$parameters = array(
'socid'=>$socid);
172$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
177include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
180if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
183 $search_product_category =
'';
184 $search_ref_exp =
'';
185 $search_ref_liv =
'';
186 $search_ref_customer =
'';
187 $search_company =
'';
192 $search_country =
'';
193 $search_tracking =
'';
194 $search_shipping_method_id =
'';
195 $search_type_thirdparty =
'';
197 $search_datedelivery_start =
'';
198 $search_datedelivery_end =
'';
199 $search_datereceipt_start =
'';
200 $search_datereceipt_end =
'';
203 $search_array_options = array();
204 $search_categ_cus = 0;
207if (empty($reshook)) {
208 $objectclass =
'Expedition';
209 $objectlabel =
'Sendings';
210 $permissiontoread = $user->rights->expedition->lire;
211 $permissiontoadd = $user->rights->expedition->creer;
212 $permissiontodelete = $user->rights->expedition->supprimer;
213 $uploaddir = $conf->expedition->dir_output.
'/sending';
214 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"]);
252$form =
new Form($db);
255$companystatic =
new Societe($db);
259$helpurl =
'EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones';
260llxHeader(
'', $langs->trans(
'ListOfSendings'), $helpurl);
263if ($search_all || $search_user > 0) {
264 $sql =
'SELECT DISTINCT';
266$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,";
269 $sql .=
" l.date_delivery as date_reception,";
271$sql .=
" s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, ";
272$sql .=
" typent.code as typent_code,";
273$sql .=
" state.code_departement as state_code, state.nom as state_name,";
274$sql .=
" e.date_creation as date_creation, e.tms as date_update,";
277if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
278 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
279 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
283$parameters = array();
284$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
285$sql .= $hookmanager->resPrint;
289$sql .=
" FROM ".MAIN_DB_PREFIX.
"expedition as e";
290if (!empty($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
291 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (e.rowid = ef.fk_object)";
294 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'expeditiondet as ed ON e.rowid=ed.fk_expedition';
295 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'commandedet as pd ON pd.rowid=ed.fk_origin_line';
297$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON s.rowid = e.fk_soc";
298$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on (country.rowid = s.fk_pays)";
299$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_typent as typent on (typent.id = s.fk_typent)";
300$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_departements as state on (state.rowid = s.fk_departement)";
303 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_element as ee ON e.rowid = ee.fk_source AND ee.sourcetype = 'shipping' AND ee.targettype = 'delivery'";
304 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"delivery as l ON l.rowid = ee.fk_target";
306$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user as u ON e.fk_user_author = u.rowid';
307if ($search_user > 0) {
308 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_element as eesource ON eesource.fk_target = e.rowid AND eesource.targettype = 'shipping' AND eesource.sourcetype = 'commande'";
310if ($search_user > 0) {
311 $sql .=
", ".MAIN_DB_PREFIX.
"element_contact as ec";
312 $sql .=
", ".MAIN_DB_PREFIX.
"c_type_contact as tc";
316$parameters = array();
317$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object, $action);
318$sql .= $hookmanager->resPrint;
320$sql .=
" WHERE e.entity IN (".getEntity(
'expedition').
")";
323 $sql .=
" AND s.rowid = ".((int) $socid);
326 $sql .=
" AND e.fk_soc = ".((int) $socid);
328if ($search_status !=
'' && $search_status >= 0) {
329 $sql .=
" AND e.fk_statut = ".((int) $search_status);
331if ($search_ref_customer !=
'') {
334if ($search_billed !=
'' && $search_billed >= 0) {
335 $sql .=
' AND e.billed = '.((int) $search_billed);
346if ($search_country) {
347 $sql .=
" AND s.fk_pays IN (".$db->sanitize($search_country).
')';
349if ($search_shipping_method_id > 0) {
350 $sql .=
" AND e.fk_shipping_method = ".((int) $search_shipping_method_id);
352if ($search_tracking) {
355if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
356 $sql .=
" AND s.fk_typent IN (".$db->sanitize($search_type_thirdparty).
')';
358if ($search_user > 0) {
360 $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);
362if ($search_company) {
365if ($search_ref_exp) {
368if ($search_datedelivery_start) {
369 $sql .=
" AND e.date_delivery >= '".$db->idate($search_datedelivery_start).
"'";
371if ($search_datedelivery_end) {
372 $sql .=
" AND e.date_delivery <= '".$db->idate($search_datedelivery_end).
"'";
375 if ($search_ref_liv) {
378 if ($search_datereceipt_start) {
379 $sql .=
" AND l.date_delivery >= '".$db->idate($search_datereceipt_start).
"'";
381 if ($search_datereceipt_end) {
382 $sql .=
" AND l.date_delivery <= '".$db->idate($search_datereceipt_end).
"'";
386 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
389if ($search_sale && $search_sale !=
'-1') {
390 if ($search_sale == -2) {
391 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = e.fk_soc)";
392 } elseif ($search_sale > 0) {
393 $sql .=
" AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = e.fk_soc AND sc.fk_user = ".((int) $search_sale).
")";
397$searchCategoryCustomerOperator = -1;
398$searchCategoryCustomerList = array($search_categ_cus);
399if (!empty($searchCategoryCustomerList)) {
400 $searchCategoryCustomerSqlList = array();
401 $listofcategoryid =
'';
402 foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
403 if (intval($searchCategoryCustomer) == -2) {
404 $searchCategoryCustomerSqlList[] =
"NOT EXISTS (SELECT cs.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_societe as cs WHERE s.rowid = cs.fk_soc)";
405 } elseif (intval($searchCategoryCustomer) > 0) {
406 if ($searchCategoryCustomerOperator == 0) {
407 $searchCategoryCustomerSqlList[] =
" EXISTS (SELECT cs.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_societe as cs WHERE s.rowid = cs.fk_soc AND cs.fk_categorie = ".((int) $searchCategoryCustomer).
")";
409 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryCustomer);
413 if ($listofcategoryid) {
414 $searchCategoryCustomerSqlList[] =
" EXISTS (SELECT cs.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_societe as cs WHERE s.rowid = cs.fk_soc AND cs.fk_categorie IN (".$db->sanitize($listofcategoryid).
"))";
416 if ($searchCategoryCustomerOperator == 1) {
417 if (!empty($searchCategoryCustomerSqlList)) {
418 $sql .=
" AND (".implode(
' OR ', $searchCategoryCustomerSqlList).
")";
421 if (!empty($searchCategoryCustomerSqlList)) {
422 $sql .=
" AND (".implode(
' AND ', $searchCategoryCustomerSqlList).
")";
427$searchCategoryProductOperator = -1;
428$searchCategoryProductList = array($search_product_category);
429if (!empty($searchCategoryProductList)) {
430 $searchCategoryProductSqlList = array();
431 $listofcategoryid =
'';
432 foreach ($searchCategoryProductList as $searchCategoryProduct) {
433 if (intval($searchCategoryProduct) == -2) {
434 $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)";
435 } elseif (intval($searchCategoryProduct) > 0) {
436 if ($searchCategoryProductOperator == 0) {
437 $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).
")";
439 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryProduct);
443 if ($listofcategoryid) {
444 $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).
"))";
446 if ($searchCategoryProductOperator == 1) {
447 if (!empty($searchCategoryProductSqlList)) {
448 $sql .=
" AND (".implode(
' OR ', $searchCategoryProductSqlList).
")";
451 if (!empty($searchCategoryProductSqlList)) {
452 $sql .=
" AND (".implode(
' AND ', $searchCategoryProductSqlList).
")";
457include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
460$parameters = array();
461$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
462$sql .= $hookmanager->resPrint;
465$parameters = array();
466$reshook = $hookmanager->executeHooks(
'printFieldListHaving', $parameters, $object, $action);
467$sql .= empty($hookmanager->resPrint) ?
"" :
" HAVING 1=1 ".$hookmanager->resPrint;
469$nbtotalofrecords =
'';
472 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
473 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
474 $resql = $db->query($sqlforcount);
476 $objforcount = $db->fetch_object($resql);
477 $nbtotalofrecords = $objforcount->nbtotalofrecords;
482 if (($page * $limit) > $nbtotalofrecords) {
490$sql .= $db->order($sortfield, $sortorder);
492 $sql .= $db->plimit($limit + 1, $offset);
496$resql = $db->query($sql);
502$num = $db->num_rows($resql);
504$arrayofselected = is_array($toselect) ? $toselect : array();
510 $param .=
'&mode='.urlencode($mode);
512if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
513 $param .=
'&contextpage='.urlencode($contextpage);
515if ($limit > 0 && $limit != $conf->liste_limit) {
516 $param .=
'&limit='.((int) $limit);
519 $param .=
"&search_all=".urlencode($search_all);
521if ($search_ref_exp) {
522 $param .=
"&search_ref_exp=".urlencode($search_ref_exp);
524if ($search_ref_liv) {
525 $param .=
"&search_ref_liv=".urlencode($search_ref_liv);
527if ($search_ref_customer) {
528 $param .=
"&search_ref_customer=".urlencode($search_ref_customer);
530if ($search_user > 0) {
531 $param .=
'&search_user='.urlencode($search_user);
533if ($search_sale > 0) {
534 $param .=
'&search_sale='.urlencode($search_sale);
536if ($search_company) {
537 $param .=
"&search_company=".urlencode($search_company);
539if ($search_shipping_method_id) {
540 $param .=
"&search_shipping_method_id=".urlencode($search_shipping_method_id);
542if ($search_tracking) {
543 $param .=
"&search_tracking=".urlencode($search_tracking);
546 $param .=
'&search_town='.urlencode($search_town);
549 $param .=
'&search_zip='.urlencode($search_zip);
551if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
552 $param .=
'&search_type_thirdparty='.urlencode($search_type_thirdparty);
554if ($search_datedelivery_start) {
555 $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'));
557if ($search_datedelivery_end) {
558 $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'));
560if ($search_datereceipt_start) {
561 $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'));
563if ($search_datereceipt_end) {
564 $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'));
566if ($search_product_category !=
'') {
567 $param .=
'&search_product_category='.urlencode($search_product_category);
569if (($search_categ_cus > 0) || ($search_categ_cus == -2)) {
570 $param .=
'&search_categ_cus='.urlencode($search_categ_cus);
572if ($search_status !=
'') {
573 $param .=
'&search_status='.urlencode($search_status);
575if ($optioncss !=
'') {
576 $param .=
'&optioncss='.urlencode($optioncss);
579include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
582$parameters = array(
'param' => &$param);
583$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
584$param .= $hookmanager->resPrint;
586$arrayofmassactions = array(
587 'builddoc' =>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"PDFMerge"),
588 'classifyclose' =>
img_picto(
'',
'stop-circle',
'class="pictofixedwidth"').$langs->trans(
"Close"),
589 'presend' =>
img_picto(
'',
'email',
'class="pictofixedwidth"').$langs->trans(
"SendByMail"),
591if (in_array($massaction, array(
'presend'))) {
592 $arrayofmassactions = array();
594$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
601$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'));
602$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'));
604$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewSending'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/expedition/card.php?action=create2',
'', $user->hasRight(
'expedition',
'creer'));
607print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
608if ($optioncss !=
'') {
609 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
611print
'<input type="hidden" name="token" value="'.newToken().
'">';
612print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
613print
'<input type="hidden" name="action" value="list">';
614print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
615print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
616print
'<input type="hidden" name="mode" value="'.$mode.
'">';
618print_barre_liste($langs->trans(
'ListOfSendings'), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'dolly', 0, $newcardbutton,
'', $limit, 0, 0, 1);
620$topicmail =
"SendShippingRef";
621$modelmail =
"shipping_send";
623$trackid =
'shi'.$object->id;
624include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
627 foreach ($fieldstosearchall as $key => $val) {
628 $fieldstosearchall[$key] = $langs->trans($val);
630 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).join(
', ', $fieldstosearchall).
'</div>';
636if ($user->hasRight(
'user',
'user',
'lire')) {
637 $langs->load(
"commercial");
638 $moreforfilter .=
'<div class="divsearchfield">';
639 $tmptitle = $langs->trans(
'ThirdPartiesOfSaleRepresentative');
640 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"');
641 $moreforfilter .= $formother->select_salesrepresentatives($search_sale,
'search_sale', $user, 0, $tmptitle,
'maxwidth200');
642 $moreforfilter .=
'</div>';
645if ($user->hasRight(
'user',
'user',
'lire')) {
646 $moreforfilter .=
'<div class="divsearchfield">';
647 $tmptitle = $langs->trans(
'LinkedToSpecificUsers');
648 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"');
649 $moreforfilter .= $form->select_dolusers($search_user,
'search_user', $tmptitle,
'', 0,
'',
'', 0, 0, 0,
'', 0,
'',
'maxwidth200');
650 $moreforfilter .=
'</div>';
653if (isModEnabled(
'categorie') && $user->hasRight(
'categorie',
'lire') && ($user->hasRight(
'produit',
'lire') || $user->hasRight(
'service',
'lire'))) {
654 include_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
655 $moreforfilter .=
'<div class="divsearchfield">';
656 $tmptitle = $langs->trans(
'IncludingProductWithTag');
657 $moreforfilter .=
img_picto($tmptitle,
'category');
660 $moreforfilter .= $formother->select_categories(Categorie::TYPE_PRODUCT, $search_product_category,
'search_product_category', 1, $tmptitle);
662 $moreforfilter .=
'</div>';
664if (isModEnabled(
'categorie') && $user->hasRight(
'categorie',
'lire')) {
665 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
666 $moreforfilter .=
'<div class="divsearchfield">';
667 $tmptitle = $langs->trans(
'CustomersProspectsCategoriesShort');
668 $moreforfilter .=
img_picto($tmptitle,
'category');
669 $moreforfilter .= $formother->select_categories(
'customer', $search_categ_cus,
'search_categ_cus', 1, $tmptitle);
670 $moreforfilter .=
'</div>';
672$parameters = array();
673$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
674if (empty($reshook)) {
675 $moreforfilter .= $hookmanager->resPrint;
677 $moreforfilter = $hookmanager->resPrint;
680if (!empty($moreforfilter)) {
681 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
682 print $moreforfilter;
686$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
687$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN',
''));
688if ($massactionbutton) {
689 $selectedfields .= $form->showCheckAddButtons(
'checkforselect', 1);
692print
'<div class="div-table-responsive">';
693print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
697print
'<tr class="liste_titre_filter">';
700 print
'<td class="liste_titre center maxwidthsearch">';
701 $searchpicto = $form->showFilterButtons(
'left');
706if (!empty($arrayfields[
'e.ref'][
'checked'])) {
707 print
'<td class="liste_titre">';
708 print
'<input class="flat" size="6" type="text" name="search_ref_exp" value="'.$search_ref_exp.
'">';
712if (!empty($arrayfields[
'e.ref_customer'][
'checked'])) {
713 print
'<td class="liste_titre">';
714 print
'<input class="flat" size="6" type="text" name="search_ref_customer" value="'.$search_ref_customer.
'">';
718if (!empty($arrayfields[
's.nom'][
'checked'])) {
719 print
'<td class="liste_titre left">';
720 print
'<input class="flat" type="text" size="8" name="search_company" value="'.dol_escape_htmltag($search_company).
'">';
724if (!empty($arrayfields[
's.town'][
'checked'])) {
725 print
'<td class="liste_titre"><input class="flat" type="text" size="6" name="search_town" value="'.$search_town.
'"></td>';
728if (!empty($arrayfields[
's.zip'][
'checked'])) {
729 print
'<td class="liste_titre"><input class="flat" type="text" size="6" name="search_zip" value="'.$search_zip.
'"></td>';
732if (!empty($arrayfields[
'state.nom'][
'checked'])) {
733 print
'<td class="liste_titre">';
734 print
'<input class="flat" size="4" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).
'">';
738if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
739 print
'<td class="liste_titre center">';
740 print $form->select_country($search_country,
'search_country',
'', 0,
'minwidth100imp maxwidth100');
744if (!empty($arrayfields[
'typent.code'][
'checked'])) {
745 print
'<td class="liste_titre maxwidthonsmartphone center">';
746 print $form->selectarray(
"search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0,
'', 0, 0, 0, (!
getDolGlobalString(
'SOCIETE_SORT_ON_TYPEENT') ?
'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT),
'', 1);
750if (!empty($arrayfields[
'e.weight'][
'checked'])) {
751 print
'<td class="liste_titre maxwidthonsmartphone center">';
756if (!empty($arrayfields[
'e.date_delivery'][
'checked'])) {
757 print
'<td class="liste_titre center">';
758 print
'<div class="nowrapfordate">';
759 print $form->selectDate($search_datedelivery_start ? $search_datedelivery_start : -1,
'search_datedelivery_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
761 print
'<div class="nowrapfordate">';
762 print $form->selectDate($search_datedelivery_end ? $search_datedelivery_end : -1,
'search_datedelivery_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
766if (!empty($arrayfields[
'e.fk_shipping_method'][
'checked'])) {
768 print
'<td class="liste_titre center">';
769 $shipment->fetch_delivery_methods();
770 print $form->selectarray(
"search_shipping_method_id", $shipment->meths, $search_shipping_method_id, 1, 0, 0,
"", 1, 0, 0,
'',
'maxwidth150');
774if (!empty($arrayfields[
'e.tracking_number'][
'checked'])) {
775 print
'<td class="liste_titre center">';
776 print
'<input class="flat" size="6" type="text" name="search_tracking" value="'.dol_escape_htmltag($search_tracking).
'">';
779if (!empty($arrayfields[
'l.ref'][
'checked'])) {
781 print
'<td class="liste_titre">';
782 print
'<input class="flat width75" type="text" name="search_ref_liv" value="'.dol_escape_htmltag($search_ref_liv).
'"';
785if (!empty($arrayfields[
'l.date_delivery'][
'checked'])) {
787 print
'<td class="liste_titre center">';
788 print
'<div class="nowrapfordate">';
789 print $form->selectDate($search_datereceipt_start ? $search_datereceipt_start : -1,
'search_datereceipt_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
791 print
'<div class="nowrapfordate">';
792 print $form->selectDate($search_datereceipt_end ? $search_datereceipt_end : -1,
'search_datereceipt_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
797include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
800$parameters = array(
'arrayfields'=>$arrayfields);
801$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
802print $hookmanager->resPrint;
804if (!empty($arrayfields[
'e.datec'][
'checked'])) {
805 print
'<td class="liste_titre">';
809if (!empty($arrayfields[
'e.tms'][
'checked'])) {
810 print
'<td class="liste_titre">';
814if (!empty($arrayfields[
'e.fk_statut'][
'checked'])) {
815 print
'<td class="liste_titre right parentonrightofpage">';
816 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,
'',
'search_status width100 onrightofpage');
820if (!empty($arrayfields[
'e.billed'][
'checked'])) {
821 print
'<td class="liste_titre maxwidthonsmartphone center">';
822 print $form->selectyesno(
'search_billed', $search_billed, 1, 0, 1);
827 print
'<td class="liste_titre center maxwidthsearch">';
828 $searchpicto = $form->showFilterButtons();
834$totalarray = array();
835$totalarray[
'nbfield'] = 0;
839print
'<tr class="liste_titre">';
842 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
843 $totalarray[
'nbfield']++;
845if (!empty($arrayfields[
'e.ref'][
'checked'])) {
846 print_liste_field_titre($arrayfields[
'e.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"e.ref",
"", $param,
'', $sortfield, $sortorder);
847 $totalarray[
'nbfield']++;
849if (!empty($arrayfields[
'e.ref_customer'][
'checked'])) {
850 print_liste_field_titre($arrayfields[
'e.ref_customer'][
'label'], $_SERVER[
"PHP_SELF"],
"e.ref_customer",
"", $param,
'', $sortfield, $sortorder);
851 $totalarray[
'nbfield']++;
853if (!empty($arrayfields[
's.nom'][
'checked'])) {
854 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s.nom",
"", $param,
'', $sortfield, $sortorder,
'left ');
855 $totalarray[
'nbfield']++;
857if (!empty($arrayfields[
's.town'][
'checked'])) {
858 print_liste_field_titre($arrayfields[
's.town'][
'label'], $_SERVER[
"PHP_SELF"],
's.town',
'', $param,
'', $sortfield, $sortorder);
859 $totalarray[
'nbfield']++;
861if (!empty($arrayfields[
's.zip'][
'checked'])) {
862 print_liste_field_titre($arrayfields[
's.zip'][
'label'], $_SERVER[
"PHP_SELF"],
's.zip',
'', $param,
'', $sortfield, $sortorder);
863 $totalarray[
'nbfield']++;
865if (!empty($arrayfields[
'state.nom'][
'checked'])) {
866 print_liste_field_titre($arrayfields[
'state.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"state.nom",
"", $param,
'', $sortfield, $sortorder);
867 $totalarray[
'nbfield']++;
869if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
870 print_liste_field_titre($arrayfields[
'country.code_iso'][
'label'], $_SERVER[
"PHP_SELF"],
"country.code_iso",
"", $param,
'', $sortfield, $sortorder,
'center ');
871 $totalarray[
'nbfield']++;
873if (!empty($arrayfields[
'typent.code'][
'checked'])) {
874 print_liste_field_titre($arrayfields[
'typent.code'][
'label'], $_SERVER[
"PHP_SELF"],
"typent.code",
"", $param,
'', $sortfield, $sortorder,
'center ');
875 $totalarray[
'nbfield']++;
877if (!empty($arrayfields[
'e.weight'][
'checked'])) {
878 print_liste_field_titre($arrayfields[
'e.weight'][
'label'], $_SERVER[
"PHP_SELF"],
"e.weight",
"", $param,
'', $sortfield, $sortorder,
'center ');
879 $totalarray[
'nbfield']++;
881if (!empty($arrayfields[
'e.date_delivery'][
'checked'])) {
882 print_liste_field_titre($arrayfields[
'e.date_delivery'][
'label'], $_SERVER[
"PHP_SELF"],
"e.date_delivery",
"", $param,
'', $sortfield, $sortorder,
'center ');
883 $totalarray[
'nbfield']++;
885if (!empty($arrayfields[
'e.fk_shipping_method'][
'checked'])) {
886 print_liste_field_titre($arrayfields[
'e.fk_shipping_method'][
'label'], $_SERVER[
"PHP_SELF"],
"e.fk_shipping_method",
"", $param,
'', $sortfield, $sortorder,
'center ');
887 $totalarray[
'nbfield']++;
889if (!empty($arrayfields[
'e.tracking_number'][
'checked'])) {
890 print_liste_field_titre($arrayfields[
'e.tracking_number'][
'label'], $_SERVER[
"PHP_SELF"],
"e.tracking_number",
"", $param,
'', $sortfield, $sortorder,
'center ');
891 $totalarray[
'nbfield']++;
893if (!empty($arrayfields[
'l.ref'][
'checked'])) {
894 print_liste_field_titre($arrayfields[
'l.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"l.ref",
"", $param,
'', $sortfield, $sortorder);
895 $totalarray[
'nbfield']++;
897if (!empty($arrayfields[
'l.date_delivery'][
'checked'])) {
898 print_liste_field_titre($arrayfields[
'l.date_delivery'][
'label'], $_SERVER[
"PHP_SELF"],
"l.date_delivery",
"", $param,
'', $sortfield, $sortorder,
'center ');
899 $totalarray[
'nbfield']++;
902include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
904$parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder,
'$totalarray'=>&$totalarray);
905$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
906print $hookmanager->resPrint;
907if (!empty($arrayfields[
'e.datec'][
'checked'])) {
908 print_liste_field_titre($arrayfields[
'e.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"e.date_creation",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
909 $totalarray[
'nbfield']++;
911if (!empty($arrayfields[
'e.tms'][
'checked'])) {
912 print_liste_field_titre($arrayfields[
'e.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"e.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
913 $totalarray[
'nbfield']++;
915if (!empty($arrayfields[
'e.fk_statut'][
'checked'])) {
916 print_liste_field_titre($arrayfields[
'e.fk_statut'][
'label'], $_SERVER[
"PHP_SELF"],
"e.fk_statut",
"", $param,
'', $sortfield, $sortorder,
'right ');
917 $totalarray[
'nbfield']++;
919if (!empty($arrayfields[
'e.billed'][
'checked'])) {
920 print_liste_field_titre($arrayfields[
'e.billed'][
'label'], $_SERVER[
"PHP_SELF"],
"e.billed",
"", $param,
'', $sortfield, $sortorder,
'center ');
921 $totalarray[
'nbfield']++;
925 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
926 $totalarray[
'nbfield']++;
930$typenArray = $formcompany->typent_array(1);
935$savnbfield = $totalarray[
'nbfield'];
936$totalarray = array();
937$totalarray[
'nbfield'] = 0;
938$imaxinloop = ($limit ? min($num, $limit) : $num);
939while ($i < $imaxinloop) {
940 $obj = $db->fetch_object($resql);
945 $shipment->id = $obj->rowid;
946 $shipment->ref = $obj->ref;
947 $shipment->shipping_method_id=$obj->fk_shipping_method;
949 $companystatic->id = $obj->socid;
950 $companystatic->ref = $obj->name;
951 $companystatic->name = $obj->name;
954 $object->fetch($obj->rowid);
956 if ($mode ==
'kanban') {
958 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
959 print
'<div class="box-flex-container kanban">';
961 $object->date_delivery = $obj->delivery_date;
962 $object->town = $obj->town;
966 if ($massactionbutton || $massaction) {
968 if (in_array($object->id, $arrayofselected)) {
972 print $object->getKanbanView(
'', array(
'thirdparty' => $companystatic->getNomUrl(1),
'selected' => $selected));
973 if ($i == min($num, $limit) - 1) {
978 print
'<tr class="oddeven">';
982 print
'<td class="nowrap center">';
983 if ($massactionbutton || $massaction) {
985 if (in_array($obj->rowid, $arrayofselected)) {
988 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
993 if (!empty($arrayfields[
'e.ref'][
'checked'])) {
994 print
'<td class="nowraponall">';
995 print $shipment->getNomUrl(1);
998 $totalarray[
'nbfield']++;
1003 if (!empty($arrayfields[
'e.ref_customer'][
'checked'])) {
1004 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->ref_customer).
'">';
1008 $totalarray[
'nbfield']++;
1013 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1014 print
'<td class="tdoverflowmax150">';
1015 print $companystatic->getNomUrl(1);
1018 $totalarray[
'nbfield']++;
1022 if (!empty($arrayfields[
's.town'][
'checked'])) {
1023 print
'<td class="nocellnopadd">';
1027 $totalarray[
'nbfield']++;
1031 if (!empty($arrayfields[
's.zip'][
'checked'])) {
1032 print
'<td class="nocellnopadd center">';
1036 $totalarray[
'nbfield']++;
1040 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1041 print
'<td class="center">'.$obj->state_name.
"</td>\n";
1043 $totalarray[
'nbfield']++;
1047 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1048 print
'<td class="center">';
1049 $tmparray =
getCountry($obj->fk_pays,
'all');
1053 $totalarray[
'nbfield']++;
1057 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1058 print
'<td class="center">';
1059 if (isset($typenArray[$obj->typent_code])) {
1060 print $typenArray[$obj->typent_code];
1064 $totalarray[
'nbfield']++;
1068 if (!empty($arrayfields[
'e.weight'][
'checked'])) {
1069 print
'<td class="center">';
1070 if (empty($object->trueWeight)) {
1071 $tmparray = $object->getTotalWeightVolume();
1072 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');
1073 print $form->textwithpicto(
'', $langs->trans(
'EstimatedWeight'), 1);
1075 print $object->trueWeight;
1076 print ($object->trueWeight && $object->weight_units !=
'') ?
' '.measuringUnitString(0,
"weight", $object->weight_units) :
'';
1080 $totalarray[
'nbfield']++;
1084 if (!empty($arrayfields[
'e.date_delivery'][
'checked'])) {
1085 print
'<td class="center nowraponall">';
1086 print
dol_print_date($db->jdate($obj->delivery_date),
"dayhour");
1089 $totalarray[
'nbfield']++;
1092 if (!empty($arrayfields[
'e.fk_shipping_method'][
'checked'])) {
1094 $code=$langs->getLabelFromKey($db, $shipment->shipping_method_id,
'c_shipment_mode',
'rowid',
'code');
1095 print
'<td class="center tdoverflowmax150" title="'.dol_escape_htmltag($langs->trans(
"SendingMethod".strtoupper($code))).
'">';
1096 if ($shipment->shipping_method_id > 0) {
1097 print $langs->trans(
"SendingMethod".strtoupper($code));
1101 $totalarray[
'nbfield']++;
1105 if (!empty($arrayfields[
'e.tracking_number'][
'checked'])) {
1106 $shipment->getUrlTrackingStatus($obj->tracking_number);
1107 print
'<td class="center">'.$shipment->tracking_url.
"</td>\n";
1110 $totalarray[
'nbfield']++;
1114 if (!empty($arrayfields[
'l.ref'][
'checked']) || !empty($arrayfields[
'l.date_delivery'][
'checked'])) {
1115 $shipment->fetchObjectLinked($shipment->id, $shipment->element);
1117 if (is_array($shipment->linkedObjects[
'delivery']) && count($shipment->linkedObjects[
'delivery']) > 0) {
1118 $receiving = reset($shipment->linkedObjects[
'delivery']);
1121 if (!empty($arrayfields[
'l.ref'][
'checked'])) {
1124 print !empty($receiving) ? $receiving->getNomUrl($db) :
'';
1128 if (!empty($arrayfields[
'l.date_delivery'][
'checked'])) {
1130 print
'<td class="center nowraponall">';
1137 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1139 $parameters = array(
'arrayfields'=>$arrayfields,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
1140 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
1141 print $hookmanager->resPrint;
1143 if (!empty($arrayfields[
'e.datec'][
'checked'])) {
1144 print
'<td class="center nowraponall">';
1145 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuserrel');
1148 $totalarray[
'nbfield']++;
1152 if (!empty($arrayfields[
'e.tms'][
'checked'])) {
1153 print
'<td class="center nowraponall">';
1154 print
dol_print_date($db->jdate($obj->date_update),
'dayhour',
'tzuser');
1157 $totalarray[
'nbfield']++;
1161 if (!empty($arrayfields[
'e.fk_statut'][
'checked'])) {
1162 print
'<td class="right nowrap">'.$shipment->LibStatut($obj->fk_statut, 5).
'</td>';
1164 $totalarray[
'nbfield']++;
1168 if (!empty($arrayfields[
'e.billed'][
'checked'])) {
1169 print
'<td class="center">'.yn($obj->billed).
'</td>';
1171 $totalarray[
'nbfield']++;
1177 print
'<td class="nowrap center">';
1178 if ($massactionbutton || $massaction) {
1180 if (in_array($obj->rowid, $arrayofselected)) {
1183 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1188 $totalarray[
'nbfield']++;
1199 foreach ($arrayfields as $key => $val) {
1200 if (!empty($val[
'checked'])) {
1204 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1209$parameters = array(
'arrayfields'=>$arrayfields,
'totalarray' => $totalarray,
'sql'=>$sql);
1210$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
1211print $hookmanager->resPrint;
1217$hidegeneratedfilelistifempty = 1;
1218if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
1219 $hidegeneratedfilelistifempty = 0;
1223$urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
1224$urlsource .= str_replace(
'&',
'&', $param);
1226$filedir = $diroutputmassaction;
1227$genallowed = $user->rights->expedition->lire;
1228$delallowed = $user->rights->expedition->creer;
1231print $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.
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.
setEventMessage($mesgs, $style='mesgs', $noduplicate=0)
Set event message in dol_events session 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...
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 a 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.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
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.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
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.