31 require
'../main.inc.php';
32 require_once DOL_DOCUMENT_ROOT.
'/expedition/class/expedition.class.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
35 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
36 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
37 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
38 require_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');
53 $expeditionid =
GETPOST(
'id',
'int');
55 $socid = $user->socid;
59 $search_ref_exp =
GETPOST(
"search_ref_exp",
'alpha');
60 $search_ref_liv =
GETPOST(
'search_ref_liv',
'alpha');
61 $search_ref_customer =
GETPOST(
'search_ref_customer',
'alpha');
62 $search_company =
GETPOST(
"search_company",
'alpha');
63 $search_shipping_method_id =
GETPOST(
'search_shipping_method_id');
64 $search_tracking =
GETPOST(
"search_tracking",
'alpha');
65 $search_town =
GETPOST(
'search_town',
'alpha');
66 $search_zip =
GETPOST(
'search_zip',
'alpha');
67 $search_state =
GETPOST(
"search_state");
68 $search_country =
GETPOST(
"search_country",
'int');
69 $search_type_thirdparty =
GETPOST(
"search_type_thirdparty",
'int');
70 $search_billed =
GETPOST(
"search_billed",
'int');
71 $search_datedelivery_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_datedelivery_startmonth',
'int'),
GETPOST(
'search_datedelivery_startday',
'int'),
GETPOST(
'search_datedelivery_startyear',
'int'));
72 $search_datedelivery_end =
dol_mktime(23, 59, 59,
GETPOST(
'search_datedelivery_endmonth',
'int'),
GETPOST(
'search_datedelivery_endday',
'int'),
GETPOST(
'search_datedelivery_endyear',
'int'));
73 $search_datereceipt_start =
dol_mktime(0, 0, 0,
GETPOST(
'search_datereceipt_startmonth',
'int'),
GETPOST(
'search_datereceipt_startday',
'int'),
GETPOST(
'search_datereceipt_startyear',
'int'));
74 $search_datereceipt_end =
dol_mktime(23, 59, 59,
GETPOST(
'search_datereceipt_endmonth',
'int'),
GETPOST(
'search_datereceipt_endday',
'int'),
GETPOST(
'search_datereceipt_endyear',
'int'));
75 $sall = trim((
GETPOST(
'search_all',
'alphanohtml') !=
'') ?
GETPOST(
'search_all',
'alphanohtml') :
GETPOST(
'sall',
'alphanohtml'));
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');
82 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
83 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
84 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
92 if (empty($page) || $page == -1 || (empty($toselect) && $massaction ===
'0')) {
95 $offset = $limit * $page;
96 $pageprev = $page - 1;
97 $pagenext = $page + 1;
99 $search_status =
GETPOST(
'search_status',
'intcomma');
101 $diroutputmassaction = $conf->expedition->dir_output.
'/sending/temp/massgeneration/'.$user->id;
107 $hookmanager->initHooks(array(
'shipmentlist'));
111 $extrafields->fetch_name_optionals_label($object->table_element);
113 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
116 $fieldstosearchall = array(
118 's.nom'=>
"ThirdParty",
119 'e.note_public'=>
'NotePublic',
121 'e.tracking_number'=>
"TrackingNumber",
123 if (empty($user->socid)) {
124 $fieldstosearchall[
"e.note_private"] =
"NotePrivate";
127 $checkedtypetiers = 0;
128 $arrayfields = array(
129 'e.ref'=>array(
'label'=>$langs->trans(
"Ref"),
'checked'=>1,
'position'=>1),
130 'e.ref_customer'=>array(
'label'=>$langs->trans(
"RefCustomer"),
'checked'=>1,
'position'=>2),
131 's.nom'=>array(
'label'=>$langs->trans(
"ThirdParty"),
'checked'=>1,
'position'=>3),
132 's.town'=>array(
'label'=>$langs->trans(
"Town"),
'checked'=>1,
'position'=>4),
133 's.zip'=>array(
'label'=>$langs->trans(
"Zip"),
'checked'=>1,
'position'=>5),
134 'state.nom'=>array(
'label'=>$langs->trans(
"StateShort"),
'checked'=>0,
'position'=>6),
135 'country.code_iso'=>array(
'label'=>$langs->trans(
"Country"),
'checked'=>0,
'position'=>7),
136 'typent.code'=>array(
'label'=>$langs->trans(
"ThirdPartyType"),
'checked'=>$checkedtypetiers,
'position'=>8),
137 'e.date_delivery'=>array(
'label'=>$langs->trans(
"DateDeliveryPlanned"),
'checked'=>1,
'position'=>9),
138 'e.fk_shipping_method'=>array(
'label'=>$langs->trans(
'SendingMethod'),
'checked'=>1,
'position'=>10),
139 'e.tracking_number'=>array(
'label'=>$langs->trans(
"TrackingNumber"),
'checked'=>1,
'position'=>11),
140 'e.weight'=>array(
'label'=>$langs->trans(
"Weight"),
'checked'=>0,
'position'=>12),
141 'e.datec'=>array(
'label'=>$langs->trans(
"DateCreation"),
'checked'=>0,
'position'=>500),
142 'e.tms'=>array(
'label'=>$langs->trans(
"DateModificationShort"),
'checked'=>0,
'position'=>500),
143 'e.fk_statut'=>array(
'label'=>$langs->trans(
"Status"),
'checked'=>1,
'position'=>1000),
144 'l.ref'=>array(
'label'=>$langs->trans(
"DeliveryRef"),
'checked'=>1,
'enabled'=>(empty($conf->delivery_note->enabled) ? 0 : 1)),
145 'l.date_delivery'=>array(
'label'=>$langs->trans(
"DateReceived"),
'checked'=>1,
'enabled'=>(empty($conf->delivery_note->enabled) ? 0 : 1)),
146 'e.billed'=>array(
'label'=>$langs->trans(
"Billed"),
'checked'=>1,
'position'=>1000,
'enabled'=>(!empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)))
150 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
161 if (
GETPOST(
'cancel',
'alpha')) {
162 $action =
'list'; $massaction =
'';
164 if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend') {
168 $parameters = array(
'socid'=>$socid);
169 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
174 include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
177 if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
181 $search_product_category =
'';
182 $search_ref_exp =
'';
183 $search_ref_liv =
'';
184 $search_ref_customer =
'';
185 $search_company =
'';
190 $search_country =
'';
191 $search_tracking =
'';
192 $search_shipping_method_id =
'';
193 $search_type_thirdparty =
'';
195 $search_datedelivery_start =
'';
196 $search_datedelivery_end =
'';
197 $search_datereceipt_start =
'';
198 $search_datereceipt_end =
'';
201 $search_array_options = array();
202 $search_categ_cus = 0;
205 if (empty($reshook)) {
206 $objectclass =
'Expedition';
207 $objectlabel =
'Sendings';
208 $permissiontoread = $user->rights->expedition->lire;
209 $permissiontoadd = $user->rights->expedition->creer;
210 $permissiontodelete = $user->rights->expedition->supprimer;
211 $uploaddir = $conf->expedition->dir_output.
'/sending';
212 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
216 if ($massaction ==
'classifyclose') {
218 $selectids =
GETPOST(
'toselect',
'array');
219 foreach ($selectids as $selectid) {
221 $object->fetch($selectid);
222 $result = $object->setClosed();
225 $massaction = $action =
'classifyclose';
236 header(
'Location: '.$_SERVER[
"PHP_SELF"]);
253 $companystatic =
new Societe($db);
257 $helpurl =
'EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones';
258 llxHeader(
'', $langs->trans(
'ListOfSendings'), $helpurl);
261 if ($sall || $search_user > 0) {
262 $sql =
'SELECT DISTINCT';
264 $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,";
267 $sql .=
" l.date_delivery as date_reception,";
269 $sql .=
" s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, ";
270 $sql .=
" typent.code as typent_code,";
271 $sql .=
" state.code_departement as state_code, state.nom as state_name,";
272 $sql .=
" e.date_creation as date_creation, e.tms as date_update,";
274 if (($search_categ_cus > 0) || ($search_categ_cus == -2)) {
275 $sql .=
", cc.fk_categorie, cc.fk_soc";
278 if (!empty($extrafields->attributes[$object->table_element][
'label'])) {
279 foreach ($extrafields->attributes[$object->table_element][
'label'] as $key => $val) {
280 $sql .= ($extrafields->attributes[$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
284 $parameters = array();
285 $reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters);
286 $sql .= $hookmanager->resPrint;
290 $sql .=
" FROM ".MAIN_DB_PREFIX.
"expedition as e";
291 if (!empty($extrafields->attributes[$object->table_element][
'label']) && is_array($extrafields->attributes[$object->table_element][
'label']) && count($extrafields->attributes[$object->table_element][
'label'])) {
292 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (e.rowid = ef.fk_object)";
295 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'expeditiondet as ed ON e.rowid=ed.fk_expedition';
296 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'commandedet as pd ON pd.rowid=ed.fk_origin_line';
298 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON s.rowid = e.fk_soc";
299 if (($search_categ_cus > 0) || ($search_categ_cus == -2)) {
300 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
"categorie_societe as cc ON s.rowid = cc.fk_soc";
302 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on (country.rowid = s.fk_pays)";
303 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_typent as typent on (typent.id = s.fk_typent)";
304 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_departements as state on (state.rowid = s.fk_departement)";
307 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_element as ee ON e.rowid = ee.fk_source AND ee.sourcetype = 'shipping' AND ee.targettype = 'delivery'";
308 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"delivery as l ON l.rowid = ee.fk_target";
310 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user as u ON e.fk_user_author = u.rowid';
311 if ($search_user > 0) {
312 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_element as eesource ON eesource.fk_target = e.rowid AND eesource.targettype = 'shipping' AND eesource.sourcetype = 'commande'";
315 if ($search_sale > 0 || (empty($user->rights->societe->client->voir) && !$socid)) {
316 $sql .=
", ".MAIN_DB_PREFIX.
"societe_commerciaux as sc";
318 if ($search_user > 0) {
319 $sql .=
", ".MAIN_DB_PREFIX.
"element_contact as ec";
320 $sql .=
", ".MAIN_DB_PREFIX.
"c_type_contact as tc";
324 $parameters = array();
325 $reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object);
326 $sql .= $hookmanager->resPrint;
328 $sql .=
" WHERE e.entity IN (".getEntity(
'expedition').
")";
331 $sql .=
" AND s.rowid = ".((int) $socid);
333 if (empty($user->rights->societe->client->voir) && !$socid) {
334 $sql .=
" AND e.fk_soc = sc.fk_soc";
335 $sql .=
" AND sc.fk_user = ".((int) $user->id);
338 $sql .=
" AND e.fk_soc = ".((int) $socid);
340 if ($search_status <>
'' && $search_status >= 0) {
341 $sql .=
" AND e.fk_statut = ".((int) $search_status);
343 if ($search_ref_customer !=
'') {
346 if ($search_billed !=
'' && $search_billed >= 0) {
347 $sql .=
' AND e.billed = '.((int) $search_billed);
358 if ($search_country) {
359 $sql .=
" AND s.fk_pays IN (".$db->sanitize($search_country).
')';
361 if ($search_shipping_method_id > 0) {
362 $sql .=
" AND e.fk_shipping_method = ".((int) $search_shipping_method_id);
364 if ($search_tracking) {
367 if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
368 $sql .=
" AND s.fk_typent IN (".$db->sanitize($search_type_thirdparty).
')';
370 if ($search_sale > 0) {
371 $sql .=
" AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $search_sale);
373 if ($search_user > 0) {
375 $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);
377 if ($search_company) {
380 if ($search_ref_exp) {
383 if ($search_datedelivery_start) {
384 $sql .=
" AND e.date_delivery >= '".$db->idate($search_datedelivery_start).
"'";
386 if ($search_datedelivery_end) {
387 $sql .=
" AND e.date_delivery <= '".$db->idate($search_datedelivery_end).
"'";
390 if ($search_ref_liv) {
393 if ($search_datereceipt_start) {
394 $sql .=
" AND l.date_delivery >= '".$db->idate($search_datereceipt_start).
"'";
396 if ($search_datereceipt_end) {
397 $sql .=
" AND l.date_delivery <= '".$db->idate($search_datereceipt_end).
"'";
403 if ($search_categ_cus > 0) {
404 $sql .=
" AND cc.fk_categorie = ".((int) $search_categ_cus);
406 if ($search_categ_cus == -2) {
407 $sql .=
" AND cc.fk_categorie IS NULL";
410 $searchCategoryProductOperator = -1;
411 $searchCategoryProductList = array($search_product_category);
412 if (!empty($searchCategoryProductList)) {
413 $searchCategoryProductSqlList = array();
414 $listofcategoryid =
'';
415 foreach ($searchCategoryProductList as $searchCategoryProduct) {
416 if (intval($searchCategoryProduct) == -2) {
417 $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)";
418 } elseif (intval($searchCategoryProduct) > 0) {
419 if ($searchCategoryProductOperator == 0) {
420 $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).
")";
422 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryProduct);
426 if ($listofcategoryid) {
427 $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).
"))";
429 if ($searchCategoryProductOperator == 1) {
430 if (!empty($searchCategoryProductSqlList)) {
431 $sql .=
" AND (".implode(
' OR ', $searchCategoryProductSqlList).
")";
434 if (!empty($searchCategoryProductSqlList)) {
435 $sql .=
" AND (".implode(
' AND ', $searchCategoryProductSqlList).
")";
440 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
443 $parameters = array();
444 $reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters);
445 $sql .= $hookmanager->resPrint;
448 $parameters = array();
449 $reshook = $hookmanager->executeHooks(
'printFieldListHaving', $parameters, $object);
450 $sql .= empty($hookmanager->resPrint) ?
"" :
" HAVING 1=1 ".$hookmanager->resPrint;
453 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
455 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
456 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
457 $resql = $db->query($sqlforcount);
459 $objforcount = $db->fetch_object(
$resql);
473 $sql .= $db->order($sortfield, $sortorder);
475 $sql .= $db->plimit($limit + 1, $offset);
479 $resql = $db->query($sql);
485 $num = $db->num_rows(
$resql);
487 $arrayofselected = is_array($toselect) ? $toselect : array();
492 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
493 $param .=
'&contextpage='.urlencode($contextpage);
495 if ($limit > 0 && $limit != $conf->liste_limit) {
496 $param .=
'&limit='.urlencode($limit);
499 $param .=
"&sall=".urlencode($sall);
501 if ($search_ref_exp) {
502 $param .=
"&search_ref_exp=".urlencode($search_ref_exp);
504 if ($search_ref_liv) {
505 $param .=
"&search_ref_liv=".urlencode($search_ref_liv);
507 if ($search_ref_customer) {
508 $param .=
"&search_ref_customer=".urlencode($search_ref_customer);
510 if ($search_user > 0) {
511 $param .=
'&search_user='.urlencode($search_user);
513 if ($search_sale > 0) {
514 $param .=
'&search_sale='.urlencode($search_sale);
516 if ($search_company) {
517 $param .=
"&search_company=".urlencode($search_company);
519 if ($search_shipping_method_id) {
520 $param .=
"&search_shipping_method_id=".urlencode($search_shipping_method_id);
522 if ($search_tracking) {
523 $param .=
"&search_tracking=".urlencode($search_tracking);
526 $param .=
'&search_town='.urlencode($search_town);
529 $param .=
'&search_zip='.urlencode($search_zip);
531 if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
532 $param .=
'&search_type_thirdparty='.urlencode($search_type_thirdparty);
534 if ($search_datedelivery_start) {
535 $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'));
537 if ($search_datedelivery_end) {
538 $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'));
540 if ($search_datereceipt_start) {
541 $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'));
543 if ($search_datereceipt_end) {
544 $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'));
546 if ($search_product_category !=
'') {
547 $param .=
'&search_product_category='.urlencode($search_product_category);
549 if (($search_categ_cus > 0) || ($search_categ_cus == -2)) {
550 $param .=
'&search_categ_cus='.urlencode($search_categ_cus);
552 if ($search_status !=
'') {
553 $param .=
'&search_status='.urlencode($search_status);
555 if ($optioncss !=
'') {
556 $param .=
'&optioncss='.urlencode($optioncss);
559 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
562 $parameters = array();
563 $reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object);
564 $param .= $hookmanager->resPrint;
566 $arrayofmassactions = array(
567 'builddoc' =>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"PDFMerge"),
568 'classifyclose' =>
img_picto(
'',
'stop-circle',
'class="pictofixedwidth"').$langs->trans(
"Close"),
569 'presend' =>
img_picto(
'',
'email',
'class="pictofixedwidth"').$langs->trans(
"SendByMail"),
571 if (in_array($massaction, array(
'presend'))) {
572 $arrayofmassactions = array();
574 $massactionbutton =
$form->selectMassAction(
'', $arrayofmassactions);
580 $newcardbutton =
dolGetButtonTitle($langs->trans(
'NewSending'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/expedition/card.php?action=create2',
'', $user->rights->expedition->creer);
583 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
584 if ($optioncss !=
'') {
585 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
587 print
'<input type="hidden" name="token" value="'.newToken().
'">';
588 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
589 print
'<input type="hidden" name="action" value="list">';
590 print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
591 print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
593 print_barre_liste($langs->trans(
'ListOfSendings'), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num,
$nbtotalofrecords,
'dolly', 0, $newcardbutton,
'', $limit, 0, 0, 1);
595 $topicmail =
"SendShippingRef";
596 $modelmail =
"shipping_send";
598 $trackid =
'shi'.$object->id;
599 include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
602 foreach ($fieldstosearchall as $key => $val) {
603 $fieldstosearchall[$key] = $langs->trans($val);
605 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $sall).join(
', ', $fieldstosearchall).
'</div>';
611 if ($user->rights->user->user->lire) {
612 $langs->load(
"commercial");
613 $moreforfilter .=
'<div class="divsearchfield">';
614 $tmptitle = $langs->trans(
'ThirdPartiesOfSaleRepresentative');
615 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"');
616 $moreforfilter .= $formother->select_salesrepresentatives($search_sale,
'search_sale', $user, 0, $tmptitle,
'maxwidth200');
617 $moreforfilter .=
'</div>';
620 if ($user->rights->user->user->lire) {
621 $moreforfilter .=
'<div class="divsearchfield">';
622 $tmptitle = $langs->trans(
'LinkedToSpecificUsers');
623 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"');
624 $moreforfilter .=
$form->select_dolusers($search_user,
'search_user', $tmptitle,
'', 0,
'',
'', 0, 0, 0,
'', 0,
'',
'maxwidth200');
625 $moreforfilter .=
'</div>';
628 if (
isModEnabled(
'categorie') && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire)) {
629 include_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
630 $moreforfilter .=
'<div class="divsearchfield">';
631 $tmptitle = $langs->trans(
'IncludingProductWithTag');
632 $moreforfilter .=
img_picto($tmptitle,
'category');
635 $moreforfilter .= $formother->select_categories(Categorie::TYPE_PRODUCT, $search_product_category,
'search_product_category', 1, $tmptitle);
637 $moreforfilter .=
'</div>';
639 if (
isModEnabled(
'categorie') && $user->rights->categorie->lire) {
640 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
641 $moreforfilter .=
'<div class="divsearchfield">';
642 $tmptitle = $langs->trans(
'CustomersProspectsCategoriesShort');
643 $moreforfilter .=
img_picto($tmptitle,
'category');
644 $moreforfilter .= $formother->select_categories(
'customer', $search_categ_cus,
'search_categ_cus', 1, $tmptitle);
645 $moreforfilter .=
'</div>';
647 $parameters = array();
648 $reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters);
649 if (empty($reshook)) {
650 $moreforfilter .= $hookmanager->resPrint;
652 $moreforfilter = $hookmanager->resPrint;
655 if (!empty($moreforfilter)) {
656 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
657 print $moreforfilter;
661 $varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
662 $selectedfields =
$form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN',
''));
663 if ($massactionbutton) {
664 $selectedfields .=
$form->showCheckAddButtons(
'checkforselect', 1);
667 print
'<div class="div-table-responsive">';
668 print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
671 print
'<tr class="liste_titre_filter">';
673 if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
674 print
'<td class="liste_titre middle">';
675 $searchpicto =
$form->showFilterButtons(
'left');
680 if (!empty($arrayfields[
'e.ref'][
'checked'])) {
681 print
'<td class="liste_titre">';
682 print
'<input class="flat" size="6" type="text" name="search_ref_exp" value="'.$search_ref_exp.
'">';
686 if (!empty($arrayfields[
'e.ref_customer'][
'checked'])) {
687 print
'<td class="liste_titre">';
688 print
'<input class="flat" size="6" type="text" name="search_ref_customer" value="'.$search_ref_customer.
'">';
692 if (!empty($arrayfields[
's.nom'][
'checked'])) {
693 print
'<td class="liste_titre left">';
694 print
'<input class="flat" type="text" size="8" name="search_company" value="'.dol_escape_htmltag($search_company).
'">';
698 if (!empty($arrayfields[
's.town'][
'checked'])) {
699 print
'<td class="liste_titre"><input class="flat" type="text" size="6" name="search_town" value="'.$search_town.
'"></td>';
702 if (!empty($arrayfields[
's.zip'][
'checked'])) {
703 print
'<td class="liste_titre"><input class="flat" type="text" size="6" name="search_zip" value="'.$search_zip.
'"></td>';
706 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
707 print
'<td class="liste_titre">';
708 print
'<input class="flat" size="4" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).
'">';
712 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
713 print
'<td class="liste_titre center">';
714 print
$form->select_country($search_country,
'search_country',
'', 0,
'minwidth100imp maxwidth100');
718 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
719 print
'<td class="liste_titre maxwidthonsmartphone center">';
720 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);
724 if (!empty($arrayfields[
'e.weight'][
'checked'])) {
725 print
'<td class="liste_titre maxwidthonsmartphone center">';
730 if (!empty($arrayfields[
'e.date_delivery'][
'checked'])) {
731 print
'<td class="liste_titre center">';
732 print
'<div class="nowrap">';
733 print
$form->selectDate($search_datedelivery_start ? $search_datedelivery_start : -1,
'search_datedelivery_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
735 print
'<div class="nowrap">';
736 print
$form->selectDate($search_datedelivery_end ? $search_datedelivery_end : -1,
'search_datedelivery_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
740 if (!empty($arrayfields[
'e.fk_shipping_method'][
'checked'])) {
742 print
'<td class="liste_titre center">';
743 $shipment->fetch_delivery_methods();
744 print
$form->selectarray(
"search_shipping_method_id", $shipment->meths, $search_shipping_method_id, 1, 0, 0,
"", 1, 0, 0,
'',
'maxwidth150');
748 if (!empty($arrayfields[
'e.tracking_number'][
'checked'])) {
749 print
'<td class="liste_titre center">';
750 print
'<input class="flat" size="6" type="text" name="search_tracking" value="'.dol_escape_htmltag($search_tracking).
'">';
753 if (!empty($arrayfields[
'l.ref'][
'checked'])) {
755 print
'<td class="liste_titre">';
756 print
'<input class="flat" size="10" type="text" name="search_ref_liv" value="'.dol_escape_htmltag($search_ref_liv).
'"';
759 if (!empty($arrayfields[
'l.date_delivery'][
'checked'])) {
761 print
'<td class="liste_titre center">';
762 print
'<div class="nowrap">';
763 print
$form->selectDate($search_datereceipt_start ? $search_datereceipt_start : -1,
'search_datereceipt_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
765 print
'<div class="nowrap">';
766 print
$form->selectDate($search_datereceipt_end ? $search_datereceipt_end : -1,
'search_datereceipt_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
771 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
774 $parameters = array(
'arrayfields'=>$arrayfields);
775 $reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters);
776 print $hookmanager->resPrint;
778 if (!empty($arrayfields[
'e.datec'][
'checked'])) {
779 print
'<td class="liste_titre">';
783 if (!empty($arrayfields[
'e.tms'][
'checked'])) {
784 print
'<td class="liste_titre">';
788 if (!empty($arrayfields[
'e.fk_statut'][
'checked'])) {
789 print
'<td class="liste_titre maxwidthonsmartphone right">';
790 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');
794 if (!empty($arrayfields[
'e.billed'][
'checked'])) {
795 print
'<td class="liste_titre maxwidthonsmartphone center">';
796 print
$form->selectyesno(
'search_billed', $search_billed, 1, 0, 1);
800 if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
801 print
'<td class="liste_titre middle">';
802 $searchpicto =
$form->showFilterAndCheckAddButtons(0);
808 print
'<tr class="liste_titre">';
809 if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
810 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
812 if (!empty($arrayfields[
'e.ref'][
'checked'])) {
813 print_liste_field_titre($arrayfields[
'e.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"e.ref",
"", $param,
'', $sortfield, $sortorder);
815 if (!empty($arrayfields[
'e.ref_customer'][
'checked'])) {
816 print_liste_field_titre($arrayfields[
'e.ref_customer'][
'label'], $_SERVER[
"PHP_SELF"],
"e.ref_customer",
"", $param,
'', $sortfield, $sortorder);
818 if (!empty($arrayfields[
's.nom'][
'checked'])) {
819 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s.nom",
"", $param,
'', $sortfield, $sortorder,
'left ');
821 if (!empty($arrayfields[
's.town'][
'checked'])) {
822 print_liste_field_titre($arrayfields[
's.town'][
'label'], $_SERVER[
"PHP_SELF"],
's.town',
'', $param,
'', $sortfield, $sortorder);
824 if (!empty($arrayfields[
's.zip'][
'checked'])) {
825 print_liste_field_titre($arrayfields[
's.zip'][
'label'], $_SERVER[
"PHP_SELF"],
's.zip',
'', $param,
'', $sortfield, $sortorder);
827 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
828 print_liste_field_titre($arrayfields[
'state.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"state.nom",
"", $param,
'', $sortfield, $sortorder);
830 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
831 print_liste_field_titre($arrayfields[
'country.code_iso'][
'label'], $_SERVER[
"PHP_SELF"],
"country.code_iso",
"", $param,
'', $sortfield, $sortorder,
'center ');
833 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
834 print_liste_field_titre($arrayfields[
'typent.code'][
'label'], $_SERVER[
"PHP_SELF"],
"typent.code",
"", $param,
'', $sortfield, $sortorder,
'center ');
836 if (!empty($arrayfields[
'e.weight'][
'checked'])) {
837 print_liste_field_titre($arrayfields[
'e.weight'][
'label'], $_SERVER[
"PHP_SELF"],
"e.weight",
"", $param,
'', $sortfield, $sortorder,
'center ');
839 if (!empty($arrayfields[
'e.date_delivery'][
'checked'])) {
840 print_liste_field_titre($arrayfields[
'e.date_delivery'][
'label'], $_SERVER[
"PHP_SELF"],
"e.date_delivery",
"", $param,
'', $sortfield, $sortorder,
'center ');
842 if (!empty($arrayfields[
'e.fk_shipping_method'][
'checked'])) {
843 print_liste_field_titre($arrayfields[
'e.fk_shipping_method'][
'label'], $_SERVER[
"PHP_SELF"],
"e.fk_shipping_method",
"", $param,
'', $sortfield, $sortorder,
'center ');
845 if (!empty($arrayfields[
'e.tracking_number'][
'checked'])) {
846 print_liste_field_titre($arrayfields[
'e.tracking_number'][
'label'], $_SERVER[
"PHP_SELF"],
"e.tracking_number",
"", $param,
'', $sortfield, $sortorder,
'center ');
848 if (!empty($arrayfields[
'l.ref'][
'checked'])) {
849 print_liste_field_titre($arrayfields[
'l.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"l.ref",
"", $param,
'', $sortfield, $sortorder);
851 if (!empty($arrayfields[
'l.date_delivery'][
'checked'])) {
852 print_liste_field_titre($arrayfields[
'l.date_delivery'][
'label'], $_SERVER[
"PHP_SELF"],
"l.date_delivery",
"", $param,
'', $sortfield, $sortorder,
'center ');
855 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
857 $parameters = array(
'arrayfields'=>$arrayfields,
'param'=>$param,
'sortfield'=>$sortfield,
'sortorder'=>$sortorder);
858 $reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters);
859 print $hookmanager->resPrint;
860 if (!empty($arrayfields[
'e.datec'][
'checked'])) {
861 print_liste_field_titre($arrayfields[
'e.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"e.date_creation",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
863 if (!empty($arrayfields[
'e.tms'][
'checked'])) {
864 print_liste_field_titre($arrayfields[
'e.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"e.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
866 if (!empty($arrayfields[
'e.fk_statut'][
'checked'])) {
867 print_liste_field_titre($arrayfields[
'e.fk_statut'][
'label'], $_SERVER[
"PHP_SELF"],
"e.fk_statut",
"", $param,
'', $sortfield, $sortorder,
'right ');
869 if (!empty($arrayfields[
'e.billed'][
'checked'])) {
870 print_liste_field_titre($arrayfields[
'e.billed'][
'label'], $_SERVER[
"PHP_SELF"],
"e.billed",
"", $param,
'', $sortfield, $sortorder,
'center ');
872 if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
873 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
877 $typenArray = $formcompany->typent_array(1);
879 $totalarray = array();
880 $totalarray[
'nbfield'] = 0;
881 while ($i < min($num, $limit)) {
882 $obj = $db->fetch_object(
$resql);
884 $shipment->id = $obj->rowid;
885 $shipment->ref = $obj->ref;
886 $shipment->shipping_method_id=$obj->fk_shipping_method;
888 $companystatic->id = $obj->socid;
889 $companystatic->ref = $obj->name;
890 $companystatic->name = $obj->name;
893 $object->fetch($obj->rowid);
895 print
'<tr class="oddeven">';
898 if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
899 print
'<td class="nowrap" align="center">';
900 if ($massactionbutton || $massaction) {
902 if (in_array($obj->rowid, $arrayofselected)) {
905 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
910 if (!empty($arrayfields[
'e.ref'][
'checked'])) {
911 print
'<td class="nowraponall">';
912 print $shipment->getNomUrl(1);
915 $totalarray[
'nbfield']++;
920 if (!empty($arrayfields[
'e.ref_customer'][
'checked'])) {
922 print $obj->ref_customer;
925 $totalarray[
'nbfield']++;
930 if (!empty($arrayfields[
's.nom'][
'checked'])) {
931 print
'<td class="tdoverflowmax150">';
932 print $companystatic->getNomUrl(1);
935 $totalarray[
'nbfield']++;
939 if (!empty($arrayfields[
's.town'][
'checked'])) {
940 print
'<td class="nocellnopadd">';
944 $totalarray[
'nbfield']++;
948 if (!empty($arrayfields[
's.zip'][
'checked'])) {
949 print
'<td class="nocellnopadd center">';
953 $totalarray[
'nbfield']++;
957 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
958 print
'<td class="center">'.$obj->state_name.
"</td>\n";
960 $totalarray[
'nbfield']++;
964 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
965 print
'<td class="center">';
967 print $tmparray[
'label'];
970 $totalarray[
'nbfield']++;
974 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
975 print
'<td class="center">';
976 if (isset($typenArray[$obj->typent_code])) {
977 print $typenArray[$obj->typent_code];
981 $totalarray[
'nbfield']++;
985 if (!empty($arrayfields[
'e.weight'][
'checked'])) {
986 print
'<td class="center">';
987 if (empty($object->trueWeight)) {
988 $tmparray = $object->getTotalWeightVolume();
989 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');
990 print
$form->textwithpicto(
'', $langs->trans(
'EstimatedWeight'), 1);
992 print $object->trueWeight;
993 print ($object->trueWeight && $object->weight_units !=
'') ?
' '.measuringUnitString(0,
"weight", $object->weight_units) :
'';
997 $totalarray[
'nbfield']++;
1001 if (!empty($arrayfields[
'e.date_delivery'][
'checked'])) {
1002 print
'<td class="center">';
1003 print
dol_print_date($db->jdate($obj->delivery_date),
"dayhour");
1006 if (!empty($arrayfields[
'e.fk_shipping_method'][
'checked'])) {
1008 $code=$langs->getLabelFromKey($db, $shipment->shipping_method_id,
'c_shipment_mode',
'rowid',
'code');
1009 print
'<td class="center tdoverflowmax150" title="'.dol_escape_htmltag($langs->trans(
"SendingMethod".strtoupper($code))).
'">';
1010 if ($shipment->shipping_method_id > 0) print $langs->trans(
"SendingMethod".strtoupper($code));
1014 if (!empty($arrayfields[
'e.tracking_number'][
'checked'])) {
1015 $shipment->getUrlTrackingStatus($obj->tracking_number);
1016 print
'<td class="center">'.$shipment->tracking_url.
"</td>\n";
1019 $totalarray[
'nbfield']++;
1023 if (!empty($arrayfields[
'l.ref'][
'checked']) || !empty($arrayfields[
'l.date_delivery'][
'checked'])) {
1024 $shipment->fetchObjectLinked($shipment->id, $shipment->element);
1026 if (is_array($shipment->linkedObjects[
'delivery']) && count($shipment->linkedObjects[
'delivery']) > 0) {
1027 $receiving = reset($shipment->linkedObjects[
'delivery']);
1030 if (!empty($arrayfields[
'l.ref'][
'checked'])) {
1033 print !empty($receiving) ? $receiving->getNomUrl($db) :
'';
1037 if (!empty($arrayfields[
'l.date_delivery'][
'checked'])) {
1039 print
'<td class="center">';
1046 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1048 $parameters = array(
'arrayfields'=>$arrayfields,
'obj'=>$obj,
'i'=>$i,
'totalarray'=>&$totalarray);
1049 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters);
1050 print $hookmanager->resPrint;
1052 if (!empty($arrayfields[
'e.datec'][
'checked'])) {
1053 print
'<td class="center nowrap">';
1054 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuser');
1057 $totalarray[
'nbfield']++;
1061 if (!empty($arrayfields[
'e.tms'][
'checked'])) {
1062 print
'<td class="center nowrap">';
1063 print
dol_print_date($db->jdate($obj->date_update),
'dayhour',
'tzuser');
1066 $totalarray[
'nbfield']++;
1070 if (!empty($arrayfields[
'e.fk_statut'][
'checked'])) {
1071 print
'<td class="right nowrap">'.$shipment->LibStatut($obj->fk_statut, 5).
'</td>';
1073 $totalarray[
'nbfield']++;
1077 if (!empty($arrayfields[
'e.billed'][
'checked'])) {
1078 print
'<td class="center">'.yn($obj->billed).
'</td>';
1080 $totalarray[
'nbfield']++;
1085 if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
1086 print
'<td class="nowrap" align="center">';
1087 if ($massactionbutton || $massaction) {
1089 if (in_array($obj->rowid, $arrayofselected)) {
1092 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1097 $totalarray[
'nbfield']++;
1108 foreach ($arrayfields as $key => $val) {
1109 if (!empty($val[
'checked'])) {
1113 print
'<tr><td colspan="'.$colspan.
'" class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</td></tr>';
1118 $parameters = array(
'arrayfields'=>$arrayfields,
'totalarray' => $totalarray,
'sql'=>$sql);
1119 $reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters);
1120 print $hookmanager->resPrint;
1126 $hidegeneratedfilelistifempty = 1;
1127 if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
1128 $hidegeneratedfilelistifempty = 0;
1132 $urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
1133 $urlsource .= str_replace(
'&',
'&', $param);
1135 $filedir = $diroutputmassaction;
1136 $genallowed = $user->rights->expedition->lire;
1137 $delallowed = $user->rights->expedition->creer;
1140 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.