34require
'../main.inc.php';
35require_once DOL_DOCUMENT_ROOT.
'/expedition/class/expedition.class.php';
36require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
37require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formother.class.php';
38require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
39require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/lib/product.lib.php';
42require_once DOL_DOCUMENT_ROOT.
'/compta/facture/class/facture.class.php';
45$langs->loadLangs(array(
"sendings",
"deliveries",
'companies',
'bills',
'products',
'orders'));
47$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'shipmentlist';
51$action =
GETPOST(
'action',
'alpha');
52$massaction =
GETPOST(
'massaction',
'alpha');
54$toselect =
GETPOST(
'toselect',
'array');
55$optioncss =
GETPOST(
'optioncss',
'alpha');
56$mode =
GETPOST(
'mode',
'alpha');
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_ids =
GETPOST(
'search_shipping_method_ids',
'array:int');
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",
'alpha');
67$search_country =
GETPOST(
"search_country",
'aZ09');
68$search_type_thirdparty =
GETPOST(
"search_type_thirdparty",
'intcomma');
69$search_billed =
GETPOST(
"search_billed",
'intcomma');
74$search_all = trim((
GETPOST(
'search_all',
'alphanohtml') !=
'') ?
GETPOST(
'search_all',
'alphanohtml') :
GETPOST(
'sall',
'alphanohtml'));
75$search_user =
GETPOST(
'search_user',
'intcomma');
76$search_sale =
GETPOST(
'search_sale',
'intcomma');
77$search_categ_cus =
GETPOST(
"search_categ_cus",
'intcomma');
78$search_product_category =
GETPOST(
'search_product_category',
'intcomma');
81$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
82$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
90if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
94$offset = $limit * $page;
98$search_status =
GETPOST(
'search_status',
'intcomma');
100$diroutputmassaction = $conf->expedition->dir_output.
'/sending/temp/massgeneration/'.$user->id;
105$hookmanager->initHooks(array(
'shipmentlist'));
109$extrafields->fetch_name_optionals_label(
$object->table_element);
111$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
114$fieldstosearchall = array(
116 's.nom' =>
"ThirdParty",
117 'e.note_public' =>
'NotePublic',
119 'e.tracking_number' =>
"TrackingNumber",
121if (empty($user->socid)) {
122 $fieldstosearchall[
"e.note_private"] =
"NotePrivate";
125$checkedtypetiers = 0;
127 'e.ref' => array(
'label' => $langs->trans(
"Ref"),
'checked' => 1,
'position' => 1),
128 'e.ref_customer' => array(
'label' => $langs->trans(
"RefCustomer"),
'checked' => 1,
'position' => 2),
129 's.nom' => array(
'label' => $langs->trans(
"ThirdParty"),
'checked' => 1,
'position' => 3),
130 's.town' => array(
'label' => $langs->trans(
"Town"),
'checked' => 1,
'position' => 4),
131 's.zip' => array(
'label' => $langs->trans(
"Zip"),
'checked' => -1,
'position' => 5),
132 'state.nom' => array(
'label' => $langs->trans(
"StateShort"),
'checked' => 0,
'position' => 6),
133 'country.code_iso' => array(
'label' => $langs->trans(
"Country"),
'checked' => 0,
'position' => 7),
134 'typent.code' => array(
'label' => $langs->trans(
"ThirdPartyType"),
'checked' => $checkedtypetiers,
'position' => 8),
135 'e.date_delivery' => array(
'label' => $langs->trans(
"DateDeliveryPlanned"),
'checked' => 1,
'position' => 9),
136 'e.fk_shipping_method' => array(
'label' => $langs->trans(
'SendingMethod'),
'checked' => 1,
'position' => 10),
137 'e.tracking_number' => array(
'label' => $langs->trans(
"TrackingNumber"),
'checked' => 1,
'position' => 11),
138 'e.weight' => array(
'label' => $langs->trans(
"Weight"),
'checked' => 0,
'position' => 12),
139 'e.datec' => array(
'label' => $langs->trans(
"DateCreation"),
'checked' => 0,
'position' => 500),
140 'e.tms' => array(
'label' => $langs->trans(
"DateModificationShort"),
'checked' => 0,
'position' => 500),
141 'e.fk_statut' => array(
'label' => $langs->trans(
"Status"),
'checked' => 1,
'position' => 1000),
142 'l.ref' => array(
'label' => $langs->trans(
"DeliveryRef"),
'checked' => 1,
'position' => 1010,
'enabled' => (
getDolGlobalInt(
'MAIN_SUBMODULE_DELIVERY') ? 1 : 0)),
143 'l.date_delivery' => array(
'label' => $langs->trans(
"DateReceived"),
'position' => 1020,
'checked' => 1,
'enabled' => (
getDolGlobalInt(
'MAIN_SUBMODULE_DELIVERY') ? 1 : 0)),
144 'e.billed' => array(
'label' => $langs->trans(
"Billed"),
'checked' => 1,
'position' => 1100,
'enabled' =>
'getDolGlobalString("WORKFLOW_BILL_ON_SHIPMENT") !== "0"'),
145 'e.note_public'=>array(
'label'=>
'NotePublic',
'checked'=>0,
'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES)),
'position'=>135),
146 'e.note_private'=>array(
'label'=>
'NotePrivate',
'checked'=>0,
'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES)),
'position'=>140),
150include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_array_fields.tpl.php';
154'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields';
159 $socid = $user->socid;
170if (
GETPOST(
'cancel',
'alpha')) {
174if (!
GETPOST(
'confirmmassaction',
'alpha') && $massaction !=
'presend' && $massaction !=
'confirm_presend' && $massaction !=
'confirm_createbills') {
178$parameters = array(
'socid' => $socid,
'arrayfields' => &$arrayfields);
179$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
184include DOL_DOCUMENT_ROOT.
'/core/actions_changeselectedfields.inc.php';
187if (
GETPOST(
'button_removefilter_x',
'alpha') ||
GETPOST(
'button_removefilter.x',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
190 $search_product_category =
'';
191 $search_ref_exp =
'';
192 $search_ref_liv =
'';
193 $search_ref_customer =
'';
194 $search_company =
'';
199 $search_country =
'';
200 $search_tracking =
'';
201 $search_shipping_method_ids = [];
202 $search_type_thirdparty =
'';
204 $search_datedelivery_start =
'';
205 $search_datedelivery_end =
'';
206 $search_datereceipt_start =
'';
207 $search_datereceipt_end =
'';
210 $search_array_options = array();
211 $search_categ_cus = 0;
215if (empty($reshook)) {
216 $objectclass =
'Expedition';
217 $objectlabel =
'Sendings';
218 $permissiontoread = $user->hasRight(
'expedition',
'lire');
219 $permissiontoadd = $user->hasRight(
'expedition',
'creer');
220 $permissiontodelete = $user->hasRight(
'expedition',
'supprimer');
221 $uploaddir = $conf->expedition->dir_output.
'/sending';
222 include DOL_DOCUMENT_ROOT.
'/core/actions_massactions.inc.php';
224 if ($massaction ==
'confirm_createbills') {
225 $sendings =
GETPOST(
'toselect',
'array');
226 $createbills_onebythird =
GETPOST(
'createbills_onebythird',
'int');
227 $validate_invoices =
GETPOST(
'validate_invoices',
'int');
232 $TFactThird = array();
233 $TFactThirdNbLines = array();
235 $nb_bills_created = 0;
241 $nbSendings = is_array($sendings) ? count($sendings) : 1;
243 foreach ($sendings as $id_sending) {
245 if ($expd->fetch($id_sending) <= 0) {
248 $expd->fetch_thirdparty();
254 $expdCmdSrc->fetch($expd->origin_id);
256 if (!empty($createbills_onebythird) && !empty($TFactThird[$expd->socid])) {
258 $objecttmp = $TFactThird[$expd->socid];
261 $objecttmp->socid = $expd->socid;
262 $objecttmp->thirdparty = $expd->thirdparty;
264 $objecttmp->type = $objecttmp::TYPE_STANDARD;
265 $objecttmp->cond_reglement_id = !empty($expdCmdSrc->cond_reglement_id) ? $expdCmdSrc->cond_reglement_id : (!empty($objecttmp->thirdparty->cond_reglement_id) ? $objecttmp->thirdparty->cond_reglement_id : 1);
266 $objecttmp->mode_reglement_id = !empty($expdCmdSrc->mode_reglement_id) ? $expdCmdSrc->mode_reglement_id : (!empty($objecttmp->thirdparty->mode_reglement_id) ? $objecttmp->thirdparty->mode_reglement_id : 0);
268 $objecttmp->fk_project = $expd->fk_project;
269 $objecttmp->multicurrency_code = !empty($expdCmdSrc->multicurrency_code) ? $expdCmdSrc->multicurrency_code : (!empty($objecttmp->thirdparty->multicurrency_code) ? $objecttmp->thirdparty->multicurrency_code : $expd->multicurrency_code);
270 if (empty($createbills_onebythird)) {
271 $objecttmp->ref_customer = $expd->ref_customer;
275 if (empty($datefacture)) {
279 $objecttmp->date = $datefacture;
280 $objecttmp->origin_type =
'shipping';
281 $objecttmp->origin_id = $id_sending;
283 $objecttmp->array_options = $expd->array_options;
285 $res = $objecttmp->create($user);
289 $lastref = $objecttmp->ref;
290 $lastid = $objecttmp->id;
292 $TFactThird[$expd->socid] = $objecttmp;
293 $TFactThirdNbLines[$expd->socid] = 0;
295 $langs->load(
"errors");
296 $errors[] = $expd->ref.
' : '.$langs->trans($objecttmp->errors[0]);
301 if ($objecttmp->id > 0) {
302 $res = $objecttmp->add_object_linked($objecttmp->origin, $id_sending);
305 $errors[] = $expd->ref.
' : '.$langs->trans($objecttmp->errors[0]);
309 $expd->fetchObjectLinked();
310 foreach ($expd->linkedObjectsIds as $sourcetype => $TIds) {
311 if ($sourcetype ==
'facture') {
314 if (!empty($createbills_onebythird) && !empty($TFactThird[$expd->socid])) {
315 $objecttmp->fetchObjectLinked(
$object->id,
'commande');
316 foreach ($objecttmp->linkedObjectsIds as $tmpSourcetype => $tmpTIds) {
317 if ($tmpSourcetype == $sourcetype) {
318 if (!empty(array_intersect($TIds, $tmpTIds))) {
325 $res = $objecttmp->add_object_linked($sourcetype, current($TIds));
328 $errors[] = $expd->ref.
' : '.$langs->trans($objecttmp->errors[0]);
334 $lines = $expd->lines;
335 if (empty($lines) && method_exists($expd,
'fetch_lines')) {
336 $expd->fetch_lines();
337 $lines = $expd->lines;
341 $num = count($lines);
343 for ($i = 0; $i < $num; $i++) {
344 $desc = ($lines[$i]->desc ? $lines[$i]->desc :
'');
346 if (!empty($createbills_onebythird)) {
347 $desc =
dol_concatdesc($desc, $langs->trans(
"Order").
': '.$expdCmdSrc->ref.
' - '. $langs->trans(
"Shipment").
': '.$expd->ref.($expd->date_shipping ?
' - '.dol_print_date($expd->date_shipping,
'day'):
''));
350 if ($lines[$i]->subprice < 0 && empty($conf->global->INVOICE_KEEP_DISCOUNT_LINES_AS_IN_ORIGIN)) {
353 $discount->socid = $objecttmp->socid;
354 $discount->amount_ht = abs($lines[$i]->total_ht);
355 $discount->amount_tva = abs($lines[$i]->total_tva);
356 $discount->amount_ttc = abs($lines[$i]->total_ttc);
357 $discount->tva_tx = $lines[$i]->tva_tx;
358 $discount->fk_user = $user->id;
359 $discount->description = $desc;
360 $discountid = $discount->create($user);
361 if ($discountid > 0) {
362 $result = $objecttmp->insert_discount($discountid);
371 $product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0);
374 if ($lines[$i]->date_debut_prevue) {
375 $date_start = $lines[$i]->date_debut_prevue;
377 if ($lines[$i]->date_debut_reel) {
378 $date_start = $lines[$i]->date_debut_reel;
380 if ($lines[$i]->date_start) {
381 $date_start = $lines[$i]->date_start;
385 if ($lines[$i]->date_fin_prevue) {
386 $date_end = $lines[$i]->date_fin_prevue;
388 if ($lines[$i]->date_fin_reel) {
389 $date_end = $lines[$i]->date_fin_reel;
391 if ($lines[$i]->date_end) {
392 $date_end = $lines[$i]->date_end;
395 if (($lines[$i]->product_type != 9 && empty($lines[$i]->fk_parent_line)) || $lines[$i]->product_type == 9) {
400 if (method_exists($lines[$i],
'fetch_optionals')) {
401 $lines[$i]->fetch_optionals();
402 $array_options = $lines[$i]->array_options;
405 $objecttmp->context[
'createfromclone'] =
'createfromclone';
407 $rang = ($nbSendings > 1) ? -1 : $lines[$i]->rang;
409 if (!empty($createbills_onebythird)) {
410 $rang = $TFactThirdNbLines[$expd->socid];
413 $result = $objecttmp->addline(
415 $lines[$i]->subprice,
418 $lines[$i]->localtax1_tx,
419 $lines[$i]->localtax2_tx,
420 $lines[$i]->fk_product,
421 $lines[$i]->remise_percent,
425 $lines[$i]->info_bits,
426 $lines[$i]->fk_remise_except,
431 $lines[$i]->special_code,
435 $lines[$i]->fk_fournprice,
438 !empty($array_options) ? $array_options :
'',
445 if (!empty($createbills_onebythird))
446 $TFactThirdNbLines[$expd->socid]++;
450 $errors[] = $objecttmp->error;
454 if ($result > 0 && $lines[$i]->product_type == 9) {
455 $fk_parent_line = $result;
462 if (!empty($createbills_onebythird) && empty($TFactThird[$expd->socid])) {
463 $TFactThird[$expd->socid] = $objecttmp;
465 $TFact[$objecttmp->id] = $objecttmp;
470 $TAllFact = empty($createbills_onebythird) ? $TFact : $TFactThird;
473 if (!$error && $validate_invoices) {
474 $massaction = $action =
'builddoc';
476 foreach ($TAllFact as &$objecttmp) {
477 $result = $objecttmp->validate($user);
484 $id = $objecttmp->id;
488 $upload_dir = $conf->facture->dir_output;
489 $permissiontoadd = $user->hasRight(
'facture',
'creer');
494 include DOL_DOCUMENT_ROOT.
'/core/actions_builddoc.inc.php';
498 $massaction = $action =
'confirm_createbills';
504 if ($nb_bills_created == 1) {
505 $texttoshow = $langs->trans(
'BillXCreated',
'{s1}');
506 $texttoshow = str_replace(
'{s1}',
'<a href="'.DOL_URL_ROOT.
'/compta/facture/card.php?id='.urlencode(strval($lastid)).
'">'.$lastref.
'</a>', $texttoshow);
509 setEventMessages($langs->trans(
'BillCreated', $nb_bills_created),
null,
'mesgs');
514 if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
515 $param .=
'&contextpage='.urlencode($contextpage);
517 if ($limit > 0 && $limit != $conf->liste_limit) {
518 $param .=
'&limit='.urlencode(strval($limit));
521 $param .=
"&sall=".urlencode($sall);
523 if ($search_ref_exp) {
524 $param .=
"&search_ref_exp=".urlencode($search_ref_exp);
526 if ($search_ref_liv) {
527 $param .=
"&search_ref_liv=".urlencode($search_ref_liv);
529 if ($search_ref_customer) {
530 $param .=
"&search_ref_customer=".urlencode($search_ref_customer);
532 if ($search_user > 0) {
533 $param .=
'&search_user='.urlencode($search_user);
535 if ($search_sale > 0) {
536 $param .=
'&search_sale='.urlencode($search_sale);
538 if ($search_company) {
539 $param .=
"&search_company=".urlencode($search_company);
541 if ($search_shipping_method_id) {
542 $param .=
"&search_shipping_method_id=".urlencode($search_shipping_method_id);
544 if ($search_tracking) {
545 $param .=
"&search_tracking=".urlencode($search_tracking);
548 $param .=
'&search_town='.urlencode($search_town);
551 $param .=
'&search_zip='.urlencode($search_zip);
553 if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
554 $param .=
'&search_type_thirdparty='.urlencode($search_type_thirdparty);
556 if ($search_datedelivery_start) {
557 $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'));
559 if ($search_datedelivery_end) {
560 $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'));
562 if ($search_datereceipt_start) {
563 $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'));
565 if ($search_datereceipt_end) {
566 $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'));
568 if ($search_product_category !=
'') {
569 $param .=
'&search_product_category='.urlencode($search_product_category);
571 if (($search_categ_cus > 0) || ($search_categ_cus == -2)) {
572 $param .=
'&search_categ_cus='.urlencode($search_categ_cus);
574 if ($search_status !=
'') {
575 $param .=
'&search_status='.urlencode($search_status);
577 if ($optioncss !=
'') {
578 $param .=
'&optioncss='.urlencode($optioncss);
580 if ($search_billed !=
'') {
581 $param .=
'&billed='.urlencode($search_billed);
584 header(
"Location: ".$_SERVER[
'PHP_SELF'].
'?'.$param);
590 $_GET[
"origin"] = $_POST[
"origin"];
591 $_GET[
"originid"] = $_POST[
"originid"];
592 if (!empty($errors)) {
602 if ($massaction ==
'classifyclose') {
604 $selectids =
GETPOST(
'toselect',
'array');
605 foreach ($selectids as $selectid) {
608 $result =
$object->setClosed();
611 $massaction = $action =
'classifyclose';
622 header(
'Location: '.$_SERVER[
"PHP_SELF"]);
637$form =
new Form($db);
640$companystatic =
new Societe($db);
644$title = $langs->trans(
'ListOfSendings');
645$help_url =
'EN:Module_Shipments|FR:Module_Expéditions|ES:Módulo_Expediciones';
647llxHeader(
'', $title, $help_url,
'', 0, 0,
'',
'',
'',
'bodyforlist');
650if ($search_all || $search_user > 0) {
651 $sql =
'SELECT DISTINCT';
653$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,";
656 $sql .=
" l.date_delivery as date_reception,";
658$sql .=
" s.rowid as socid, s.nom as name, s.town, s.zip, s.fk_pays, s.client, s.code_client, ";
659$sql .=
" typent.code as typent_code,";
660$sql .=
" state.code_departement as state_code, state.nom as state_name,";
661$sql .=
" e.date_creation as date_creation, e.tms as date_modification,e.note_public, e.note_private,";
664if (!empty($extrafields->attributes[
$object->table_element][
'label'])) {
665 foreach ($extrafields->attributes[
$object->table_element][
'label'] as $key => $val) {
666 $sql .= ($extrafields->attributes[
$object->table_element][
'type'][$key] !=
'separate' ?
", ef.".$key.
" as options_".$key :
'');
670$parameters = array();
671$reshook = $hookmanager->executeHooks(
'printFieldListSelect', $parameters, $object, $action);
672$sql .= $hookmanager->resPrint;
676$sql .=
" FROM ".MAIN_DB_PREFIX.
"expedition as e";
677if (!empty($extrafields->attributes[
$object->table_element][
'label']) && is_array($extrafields->attributes[
$object->table_element][
'label']) && count($extrafields->attributes[
$object->table_element][
'label'])) {
678 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element.
"_extrafields as ef on (e.rowid = ef.fk_object)";
681 $sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'expeditiondet as ed ON e.rowid=ed.fk_expedition';
683$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"societe as s ON s.rowid = e.fk_soc";
684$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_country as country on (country.rowid = s.fk_pays)";
685$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_typent as typent on (typent.id = s.fk_typent)";
686$sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_departements as state on (state.rowid = s.fk_departement)";
689 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_element as ee ON e.rowid = ee.fk_source AND ee.sourcetype = 'shipping' AND ee.targettype = 'delivery'";
690 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"delivery as l ON l.rowid = ee.fk_target";
692$sql .=
' LEFT JOIN '.MAIN_DB_PREFIX.
'user as u ON e.fk_user_author = u.rowid';
693if ($search_user > 0) {
694 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"element_element as eesource ON eesource.fk_target = e.rowid AND eesource.targettype = 'shipping' AND eesource.sourcetype = 'commande'";
696if ($search_user > 0) {
697 $sql .=
", ".MAIN_DB_PREFIX.
"element_contact as ec";
698 $sql .=
", ".MAIN_DB_PREFIX.
"c_type_contact as tc";
702$parameters = array();
703$reshook = $hookmanager->executeHooks(
'printFieldListFrom', $parameters, $object, $action);
704$sql .= $hookmanager->resPrint;
706$sql .=
" WHERE e.entity IN (".getEntity(
'expedition').
")";
709 $sql .=
" AND s.rowid = ".((int) $socid);
712 $sql .=
" AND e.fk_soc = ".((int) $socid);
714if ($search_status !=
'' && $search_status >= 0) {
715 $sql .=
" AND e.fk_statut = ".((int) $search_status);
717if ($search_ref_customer !=
'') {
720if ($search_billed !=
'' && $search_billed >= 0) {
721 $sql .=
' AND e.billed = '.((int) $search_billed);
732if ($search_country) {
733 $sql .=
" AND s.fk_pays IN (".$db->sanitize($search_country).
')';
735if (!empty($search_shipping_method_ids)) {
736 $sql .=
" AND e.fk_shipping_method IN (".$db->sanitize(implode(
',', $search_shipping_method_ids)).
')';
738if ($search_tracking) {
741if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
742 $sql .=
" AND s.fk_typent IN (".$db->sanitize($search_type_thirdparty).
')';
744if ($search_user > 0) {
746 $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);
748if ($search_company) {
751if ($search_ref_exp) {
754if ($search_datedelivery_start) {
755 $sql .=
" AND e.date_delivery >= '".$db->idate($search_datedelivery_start).
"'";
757if ($search_datedelivery_end) {
758 $sql .=
" AND e.date_delivery <= '".$db->idate($search_datedelivery_end).
"'";
761 if ($search_ref_liv) {
764 if ($search_datereceipt_start) {
765 $sql .=
" AND l.date_delivery >= '".$db->idate($search_datereceipt_start).
"'";
767 if ($search_datereceipt_end) {
768 $sql .=
" AND l.date_delivery <= '".$db->idate($search_datereceipt_end).
"'";
772 $sql .=
natural_search(array_keys($fieldstosearchall), $search_all);
775if ($search_sale && $search_sale !=
'-1') {
776 if ($search_sale == -2) {
777 $sql .=
" AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX.
"societe_commerciaux as sc WHERE sc.fk_soc = e.fk_soc)";
778 } elseif ($search_sale > 0) {
779 $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).
")";
783$searchCategoryCustomerOperator = -1;
784$searchCategoryCustomerList = array($search_categ_cus);
785if (!empty($searchCategoryCustomerList)) {
786 $searchCategoryCustomerSqlList = array();
787 $listofcategoryid =
'';
788 foreach ($searchCategoryCustomerList as $searchCategoryCustomer) {
789 if (intval($searchCategoryCustomer) == -2) {
790 $searchCategoryCustomerSqlList[] =
"NOT EXISTS (SELECT cs.fk_soc FROM ".MAIN_DB_PREFIX.
"categorie_societe as cs WHERE s.rowid = cs.fk_soc)";
791 } elseif (intval($searchCategoryCustomer) > 0) {
792 if ($searchCategoryCustomerOperator == 0) {
793 $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).
")";
795 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryCustomer);
799 if ($listofcategoryid) {
800 $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).
"))";
802 if ($searchCategoryCustomerOperator == 1) {
803 if (!empty($searchCategoryCustomerSqlList)) {
804 $sql .=
" AND (".implode(
' OR ', $searchCategoryCustomerSqlList).
")";
807 if (!empty($searchCategoryCustomerSqlList)) {
808 $sql .=
" AND (".implode(
' AND ', $searchCategoryCustomerSqlList).
")";
813$searchCategoryProductOperator = -1;
814$searchCategoryProductList = array($search_product_category);
815if (!empty($searchCategoryProductList)) {
816 $searchCategoryProductSqlList = array();
817 $listofcategoryid =
'';
818 foreach ($searchCategoryProductList as $searchCategoryProduct) {
819 if (intval($searchCategoryProduct) == -2) {
820 $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_elementdet = cd.rowid AND cd.fk_product = ck.fk_product)";
821 } elseif (intval($searchCategoryProduct) > 0) {
822 if ($searchCategoryProductOperator == 0) {
823 $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_elementdet = cd.rowid AND cd.fk_product = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).
")";
825 $listofcategoryid .= ($listofcategoryid ?
', ' :
'') .((
int) $searchCategoryProduct);
829 if ($listofcategoryid) {
830 $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_elementdet = cd.rowid AND cd.fk_product = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid).
"))";
832 if ($searchCategoryProductOperator == 1) {
833 if (!empty($searchCategoryProductSqlList)) {
834 $sql .=
" AND (".implode(
' OR ', $searchCategoryProductSqlList).
")";
837 if (!empty($searchCategoryProductSqlList)) {
838 $sql .=
" AND (".implode(
' AND ', $searchCategoryProductSqlList).
")";
843include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_sql.tpl.php';
846$parameters = array();
847$reshook = $hookmanager->executeHooks(
'printFieldListWhere', $parameters, $object, $action);
848$sql .= $hookmanager->resPrint;
851$parameters = array();
852$reshook = $hookmanager->executeHooks(
'printFieldListHaving', $parameters, $object, $action);
853$sql .= empty($hookmanager->resPrint) ?
"" :
" HAVING 1=1 ".$hookmanager->resPrint;
855$nbtotalofrecords =
'';
858 $sqlforcount = preg_replace(
'/^'.preg_quote($sqlfields,
'/').
'/',
'SELECT COUNT(*) as nbtotalofrecords', $sql);
859 $sqlforcount = preg_replace(
'/GROUP BY .*$/',
'', $sqlforcount);
860 $resql = $db->query($sqlforcount);
862 $objforcount = $db->fetch_object($resql);
863 $nbtotalofrecords = $objforcount->nbtotalofrecords;
868 if (($page * $limit) > $nbtotalofrecords) {
876$sql .= $db->order($sortfield, $sortorder);
878 $sql .= $db->plimit($limit + 1, $offset);
882$resql = $db->query($sql);
888$num = $db->num_rows($resql);
890$arrayofselected = is_array($toselect) ? $toselect : array();
897 if (empty($search_company)) {
898 $search_company = $soc->name;
904 $param .=
'&socid='.urlencode((
string) ($socid));
907 $param .=
'&mode='.urlencode($mode);
909if (!empty($contextpage) && $contextpage != $_SERVER[
"PHP_SELF"]) {
910 $param .=
'&contextpage='.urlencode($contextpage);
912if ($limit > 0 && $limit != $conf->liste_limit) {
913 $param .=
'&limit='.((int) $limit);
916 $param .=
"&search_all=".urlencode($search_all);
918if ($search_ref_exp) {
919 $param .=
"&search_ref_exp=".urlencode($search_ref_exp);
921if ($search_ref_liv) {
922 $param .=
"&search_ref_liv=".urlencode($search_ref_liv);
924if ($search_ref_customer) {
925 $param .=
"&search_ref_customer=".urlencode($search_ref_customer);
927if ($search_user > 0) {
928 $param .=
'&search_user='.urlencode((
string) ($search_user));
930if ($search_sale > 0) {
931 $param .=
'&search_sale='.urlencode((
string) ($search_sale));
933if ($search_company) {
934 $param .=
"&search_company=".urlencode($search_company);
936if ($search_shipping_method_ids) {
937 foreach ($search_shipping_method_ids as $value) {
938 $param .=
"&search_shipping_method_ids[]=".urlencode($value);
941if ($search_tracking) {
942 $param .=
"&search_tracking=".urlencode($search_tracking);
945 $param .=
'&search_town='.urlencode($search_town);
948 $param .=
'&search_zip='.urlencode($search_zip);
950if ($search_type_thirdparty !=
'' && $search_type_thirdparty > 0) {
951 $param .=
'&search_type_thirdparty='.urlencode((
string) ($search_type_thirdparty));
953if ($search_datedelivery_start) {
954 $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'));
956if ($search_datedelivery_end) {
957 $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'));
959if ($search_datereceipt_start) {
960 $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'));
962if ($search_datereceipt_end) {
963 $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'));
965if ($search_product_category !=
'') {
966 $param .=
'&search_product_category='.urlencode((
string) ($search_product_category));
968if (($search_categ_cus > 0) || ($search_categ_cus == -2)) {
969 $param .=
'&search_categ_cus='.urlencode((
string) ($search_categ_cus));
971if ($search_status !=
'') {
972 $param .=
'&search_status='.urlencode($search_status);
974if ($optioncss !=
'') {
975 $param .=
'&optioncss='.urlencode($optioncss);
978include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_param.tpl.php';
981$parameters = array(
'param' => &$param);
982$reshook = $hookmanager->executeHooks(
'printFieldListSearchParam', $parameters, $object, $action);
983$param .= $hookmanager->resPrint;
985$arrayofmassactions = array(
986 'builddoc' =>
img_picto(
'',
'pdf',
'class="pictofixedwidth"').$langs->trans(
"PDFMerge"),
987 'classifyclose' =>
img_picto(
'',
'stop-circle',
'class="pictofixedwidth"').$langs->trans(
"Close"),
988 'presend' =>
img_picto(
'',
'email',
'class="pictofixedwidth"').$langs->trans(
"SendByMail"),
990if ($user->hasRight(
'facture',
'creer')) {
991 $arrayofmassactions[
'createbills'] =
img_picto(
'',
'bill',
'class="pictofixedwidth"').$langs->trans(
"CreateInvoiceForThisCustomerFromSendings");
993if (in_array($massaction, array(
'presend',
'createbills'))) {
994 $arrayofmassactions = array();
996$massactionbutton = $form->selectMassAction(
'', $arrayofmassactions);
1003$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'));
1004$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'));
1006$newcardbutton .=
dolGetButtonTitle($langs->trans(
'NewSending'),
'',
'fa fa-plus-circle', DOL_URL_ROOT.
'/expedition/card.php?action=create2',
'', $user->hasRight(
'expedition',
'creer'));
1009print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">'.
"\n";
1010if ($optioncss !=
'') {
1011 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
1013print
'<input type="hidden" name="token" value="'.newToken().
'">';
1014print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
1015print
'<input type="hidden" name="action" value="list">';
1016print
'<input type="hidden" name="sortfield" value="'.$sortfield.
'">';
1017print
'<input type="hidden" name="sortorder" value="'.$sortorder.
'">';
1018print
'<input type="hidden" name="socid" value="'.$socid.
'">';
1019print
'<input type="hidden" name="mode" value="'.$mode.
'">';
1022print_barre_liste($langs->trans(
'ListOfSendings'), $page, $_SERVER[
"PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords,
'dolly', 0, $newcardbutton,
'', $limit, 0, 0, 1);
1024$topicmail =
"SendShippingRef";
1025$modelmail =
"shipping_send";
1027$trackid =
'shi'.$object->id;
1028include DOL_DOCUMENT_ROOT.
'/core/tpl/massactions_pre.tpl.php';
1030if ($massaction ==
'createbills') {
1031 print
'<input type="hidden" name="massaction" value="confirm_createbills">';
1033 print
'<table class="noborder" width="100%" >';
1035 print
'<td class="titlefield">';
1036 print $langs->trans(
'DateInvoice');
1039 print $form->selectDate(
'',
'',
'',
'',
'',
'', 1, 1);
1044 print $langs->trans(
'CreateOneBillByThird');
1047 print $form->selectyesno(
'createbills_onebythird',
'', 1);
1052 print $langs->trans(
'ValidateInvoices');
1055 if (!empty($conf->stock->enabled) && !empty($conf->global->STOCK_CALCULATE_ON_BILL)) {
1056 print $form->selectyesno(
'validate_invoices', 0, 1, 1);
1057 $langs->load(
"errors");
1058 print
' ('.$langs->trans(
"WarningAutoValNotPossibleWhenStockIsDecreasedOnInvoiceVal").
')';
1060 print $form->selectyesno(
'validate_invoices', 0, 1);
1062 if (!empty($conf->workflow->enabled) && !empty($conf->global->WORKFLOW_INVOICE_AMOUNT_CLASSIFY_BILLED_ORDER)) {
1063 print
' <span class="opacitymedium">'.$langs->trans(
"IfValidateInvoiceIsNoSendingStayUnbilled").
'</span>';
1065 print
' <span class="opacitymedium">'.$langs->trans(
"OptionToSetSendingBilledNotEnabled").
'</span>';
1072 print
'<div class="center">';
1073 print
'<input type="submit" class="button" id="createbills" name="createbills" value="'.$langs->trans(
'CreateInvoiceForThisCustomerFromSendings').
'"> ';
1074 print
'<input type="submit" class="button button-cancel" id="cancel" name="cancel" value="'.$langs->trans(
"Cancel").
'">';
1080 foreach ($fieldstosearchall as $key => $val) {
1081 $fieldstosearchall[$key] = $langs->trans($val);
1083 print
'<div class="divsearchfieldfilter">'.$langs->trans(
"FilterOnInto", $search_all).implode(
', ', $fieldstosearchall).
'</div>';
1089if ($user->hasRight(
'user',
'user',
'lire')) {
1090 $langs->load(
"commercial");
1091 $moreforfilter .=
'<div class="divsearchfield">';
1092 $tmptitle = $langs->trans(
'ThirdPartiesOfSaleRepresentative');
1093 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"');
1094 $moreforfilter .= $formother->select_salesrepresentatives($search_sale,
'search_sale', $user, 0, $tmptitle,
'maxwidth200');
1095 $moreforfilter .=
'</div>';
1098if ($user->hasRight(
'user',
'user',
'lire')) {
1099 $moreforfilter .=
'<div class="divsearchfield">';
1100 $tmptitle = $langs->trans(
'LinkedToSpecificUsers');
1101 $moreforfilter .=
img_picto($tmptitle,
'user',
'class="pictofixedwidth"');
1102 $moreforfilter .= $form->select_dolusers($search_user,
'search_user', $tmptitle,
'', 0,
'',
'', 0, 0, 0,
'', 0,
'',
'maxwidth200');
1103 $moreforfilter .=
'</div>';
1106if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire') && ($user->hasRight(
'produit',
'lire') || $user->hasRight(
'service',
'lire'))) {
1107 include_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1108 $moreforfilter .=
'<div class="divsearchfield">';
1109 $tmptitle = $langs->trans(
'IncludingProductWithTag');
1110 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"');
1113 $moreforfilter .= $formother->select_categories(Categorie::TYPE_PRODUCT, $search_product_category,
'search_product_category', 1, $tmptitle);
1115 $moreforfilter .=
'</div>';
1117if (isModEnabled(
'category') && $user->hasRight(
'categorie',
'lire')) {
1118 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
1119 $moreforfilter .=
'<div class="divsearchfield">';
1120 $tmptitle = $langs->trans(
'CustomersProspectsCategoriesShort');
1121 $moreforfilter .=
img_picto($tmptitle,
'category',
'class="pictofixedwidth"');
1122 $moreforfilter .= $formother->select_categories(
'customer', $search_categ_cus,
'search_categ_cus', 1, $tmptitle);
1123 $moreforfilter .=
'</div>';
1125$parameters = array();
1126$reshook = $hookmanager->executeHooks(
'printFieldPreListTitle', $parameters, $object, $action);
1127if (empty($reshook)) {
1128 $moreforfilter .= $hookmanager->resPrint;
1130 $moreforfilter = $hookmanager->resPrint;
1133if (!empty($moreforfilter)) {
1134 print
'<div class="liste_titre liste_titre_bydiv centpercent">';
1135 print $moreforfilter;
1139$varpage = empty($contextpage) ? $_SERVER[
"PHP_SELF"] : $contextpage;
1140$selectedfields = $form->multiSelectArrayWithCheckbox(
'selectedfields', $arrayfields, $varpage,
getDolGlobalString(
'MAIN_CHECKBOX_LEFT_COLUMN'));
1141if ($massactionbutton) {
1142 $selectedfields .= $form->showCheckAddButtons(
'checkforselect', 1);
1145print
'<div class="div-table-responsive">';
1146print
'<table class="tagtable liste'.($moreforfilter ?
" listwithfilterbefore" :
"").
'">'.
"\n";
1150print
'<tr class="liste_titre_filter">';
1153 print
'<td class="liste_titre center maxwidthsearch">';
1154 $searchpicto = $form->showFilterButtons(
'left');
1159if (!empty($arrayfields[
'e.ref'][
'checked'])) {
1160 print
'<td class="liste_titre">';
1161 print
'<input class="flat" size="6" type="text" name="search_ref_exp" value="'.$search_ref_exp.
'">';
1165if (!empty($arrayfields[
'e.ref_customer'][
'checked'])) {
1166 print
'<td class="liste_titre">';
1167 print
'<input class="flat" size="6" type="text" name="search_ref_customer" value="'.$search_ref_customer.
'">';
1171if (!empty($arrayfields[
's.nom'][
'checked'])) {
1172 print
'<td class="liste_titre left">';
1173 print
'<input class="flat" type="text" size="8" name="search_company" value="'.dol_escape_htmltag($search_company).
'">';
1177if (!empty($arrayfields[
's.town'][
'checked'])) {
1178 print
'<td class="liste_titre"><input class="flat" type="text" size="6" name="search_town" value="'.$search_town.
'"></td>';
1181if (!empty($arrayfields[
's.zip'][
'checked'])) {
1182 print
'<td class="liste_titre"><input class="flat" type="text" size="6" name="search_zip" value="'.$search_zip.
'"></td>';
1185if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1186 print
'<td class="liste_titre">';
1187 print
'<input class="flat" size="4" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).
'">';
1191if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1192 print
'<td class="liste_titre center">';
1193 print $form->select_country($search_country,
'search_country',
'', 0,
'minwidth100imp maxwidth100');
1197if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1198 print
'<td class="liste_titre maxwidthonsmartphone center">';
1199 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'),
'maxwidth75', 1);
1203if (!empty($arrayfields[
'e.weight'][
'checked'])) {
1204 print
'<td class="liste_titre maxwidthonsmartphone center">';
1209if (!empty($arrayfields[
'e.date_delivery'][
'checked'])) {
1210 print
'<td class="liste_titre center">';
1211 print
'<div class="nowrapfordate">';
1212 print $form->selectDate($search_datedelivery_start ? $search_datedelivery_start : -1,
'search_datedelivery_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1214 print
'<div class="nowrapfordate">';
1215 print $form->selectDate($search_datedelivery_end ? $search_datedelivery_end : -1,
'search_datedelivery_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1219if (!empty($arrayfields[
'e.fk_shipping_method'][
'checked'])) {
1221 print
'<td class="liste_titre center">';
1222 $shipment->fetch_delivery_methods();
1223 print $form->selectarray(
"search_shipping_method_ids[]", $shipment->meths, $search_shipping_method_ids, 1, 0, 0,
'multiple', 1, 0, 0,
'',
'maxwidth150');
1227if (!empty($arrayfields[
'e.tracking_number'][
'checked'])) {
1228 print
'<td class="liste_titre center">';
1229 print
'<input class="flat" size="6" type="text" name="search_tracking" value="'.dol_escape_htmltag($search_tracking).
'">';
1232if (!empty($arrayfields[
'l.ref'][
'checked'])) {
1234 print
'<td class="liste_titre">';
1235 print
'<input class="flat width75" type="text" name="search_ref_liv" value="'.dol_escape_htmltag($search_ref_liv).
'"';
1238if (!empty($arrayfields[
'l.date_delivery'][
'checked'])) {
1240 print
'<td class="liste_titre center">';
1241 print
'<div class="nowrapfordate">';
1242 print $form->selectDate($search_datereceipt_start ? $search_datereceipt_start : -1,
'search_datereceipt_start', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'From'));
1244 print
'<div class="nowrapfordate">';
1245 print $form->selectDate($search_datereceipt_end ? $search_datereceipt_end : -1,
'search_datereceipt_end', 0, 0, 1,
'', 1, 0, 0,
'',
'',
'',
'', 1,
'', $langs->trans(
'to'));
1250if (!empty($arrayfields[
'e.note_public'][
'checked'])) {
1251 print
'<td class="liste_titre">';
1255if (!empty($arrayfields[
'e.note_private'][
'checked'])) {
1256 print
'<td class="liste_titre">';
1260include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_input.tpl.php';
1263$parameters = array(
'arrayfields' => $arrayfields);
1264$reshook = $hookmanager->executeHooks(
'printFieldListOption', $parameters, $object, $action);
1265print $hookmanager->resPrint;
1267if (!empty($arrayfields[
'e.datec'][
'checked'])) {
1268 print
'<td class="liste_titre">';
1272if (!empty($arrayfields[
'e.tms'][
'checked'])) {
1273 print
'<td class="liste_titre">';
1277if (!empty($arrayfields[
'e.fk_statut'][
'checked'])) {
1278 print
'<td class="liste_titre right parentonrightofpage">';
1279 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');
1283if (!empty($arrayfields[
'e.billed'][
'checked'])) {
1284 print
'<td class="liste_titre maxwidthonsmartphone center">';
1285 print $form->selectyesno(
'search_billed', $search_billed, 1, 0, 1);
1290 print
'<td class="liste_titre center maxwidthsearch">';
1291 $searchpicto = $form->showFilterButtons();
1297$totalarray = array();
1298$totalarray[
'nbfield'] = 0;
1302print
'<tr class="liste_titre">';
1305 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
1306 $totalarray[
'nbfield']++;
1308if (!empty($arrayfields[
'e.ref'][
'checked'])) {
1309 print_liste_field_titre($arrayfields[
'e.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"e.ref",
"", $param,
'', $sortfield, $sortorder);
1310 $totalarray[
'nbfield']++;
1312if (!empty($arrayfields[
'e.ref_customer'][
'checked'])) {
1313 print_liste_field_titre($arrayfields[
'e.ref_customer'][
'label'], $_SERVER[
"PHP_SELF"],
"e.ref_customer",
"", $param,
'', $sortfield, $sortorder);
1314 $totalarray[
'nbfield']++;
1316if (!empty($arrayfields[
's.nom'][
'checked'])) {
1317 print_liste_field_titre($arrayfields[
's.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"s.nom",
"", $param,
'', $sortfield, $sortorder,
'left ');
1318 $totalarray[
'nbfield']++;
1320if (!empty($arrayfields[
's.town'][
'checked'])) {
1321 print_liste_field_titre($arrayfields[
's.town'][
'label'], $_SERVER[
"PHP_SELF"],
's.town',
'', $param,
'', $sortfield, $sortorder);
1322 $totalarray[
'nbfield']++;
1324if (!empty($arrayfields[
's.zip'][
'checked'])) {
1325 print_liste_field_titre($arrayfields[
's.zip'][
'label'], $_SERVER[
"PHP_SELF"],
's.zip',
'', $param,
'', $sortfield, $sortorder);
1326 $totalarray[
'nbfield']++;
1328if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1329 print_liste_field_titre($arrayfields[
'state.nom'][
'label'], $_SERVER[
"PHP_SELF"],
"state.nom",
"", $param,
'', $sortfield, $sortorder);
1330 $totalarray[
'nbfield']++;
1332if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1333 print_liste_field_titre($arrayfields[
'country.code_iso'][
'label'], $_SERVER[
"PHP_SELF"],
"country.code_iso",
"", $param,
'', $sortfield, $sortorder,
'center ');
1334 $totalarray[
'nbfield']++;
1336if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1337 print_liste_field_titre($arrayfields[
'typent.code'][
'label'], $_SERVER[
"PHP_SELF"],
"typent.code",
"", $param,
'', $sortfield, $sortorder,
'center ');
1338 $totalarray[
'nbfield']++;
1340if (!empty($arrayfields[
'e.weight'][
'checked'])) {
1341 print_liste_field_titre($arrayfields[
'e.weight'][
'label'], $_SERVER[
"PHP_SELF"],
"e.weight",
"", $param,
'', $sortfield, $sortorder,
'center ');
1342 $totalarray[
'nbfield']++;
1344if (!empty($arrayfields[
'e.date_delivery'][
'checked'])) {
1345 print_liste_field_titre($arrayfields[
'e.date_delivery'][
'label'], $_SERVER[
"PHP_SELF"],
"e.date_delivery",
"", $param,
'', $sortfield, $sortorder,
'center ');
1346 $totalarray[
'nbfield']++;
1348if (!empty($arrayfields[
'e.fk_shipping_method'][
'checked'])) {
1349 print_liste_field_titre($arrayfields[
'e.fk_shipping_method'][
'label'], $_SERVER[
"PHP_SELF"],
"e.fk_shipping_method",
"", $param,
'', $sortfield, $sortorder,
'center ');
1350 $totalarray[
'nbfield']++;
1352if (!empty($arrayfields[
'e.tracking_number'][
'checked'])) {
1353 print_liste_field_titre($arrayfields[
'e.tracking_number'][
'label'], $_SERVER[
"PHP_SELF"],
"e.tracking_number",
"", $param,
'', $sortfield, $sortorder,
'center ');
1354 $totalarray[
'nbfield']++;
1356if (!empty($arrayfields[
'l.ref'][
'checked'])) {
1357 print_liste_field_titre($arrayfields[
'l.ref'][
'label'], $_SERVER[
"PHP_SELF"],
"l.ref",
"", $param,
'', $sortfield, $sortorder);
1358 $totalarray[
'nbfield']++;
1360if (!empty($arrayfields[
'l.date_delivery'][
'checked'])) {
1361 print_liste_field_titre($arrayfields[
'l.date_delivery'][
'label'], $_SERVER[
"PHP_SELF"],
"l.date_delivery",
"", $param,
'', $sortfield, $sortorder,
'center ');
1362 $totalarray[
'nbfield']++;
1364if (!empty($arrayfields[
'e.note_public'][
'checked'])) {
1365 print_liste_field_titre($arrayfields[
'e.note_public'][
'label'], $_SERVER[
"PHP_SELF"],
"e.note_public",
"", $param,
'', $sortfield, $sortorder,
'right ');
1367if (!empty($arrayfields[
'e.note_private'][
'checked'])) {
1368 print_liste_field_titre($arrayfields[
'e.note_private'][
'label'], $_SERVER[
"PHP_SELF"],
"e.note_private",
"", $param,
'', $sortfield, $sortorder,
'right ');
1372include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_search_title.tpl.php';
1374$parameters = array(
'arrayfields' => $arrayfields,
'param' => $param,
'sortfield' => $sortfield,
'sortorder' => $sortorder,
'$totalarray' => &$totalarray);
1375$reshook = $hookmanager->executeHooks(
'printFieldListTitle', $parameters, $object, $action);
1376print $hookmanager->resPrint;
1377if (!empty($arrayfields[
'e.datec'][
'checked'])) {
1378 print_liste_field_titre($arrayfields[
'e.datec'][
'label'], $_SERVER[
"PHP_SELF"],
"e.date_creation",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1379 $totalarray[
'nbfield']++;
1381if (!empty($arrayfields[
'e.tms'][
'checked'])) {
1382 print_liste_field_titre($arrayfields[
'e.tms'][
'label'], $_SERVER[
"PHP_SELF"],
"e.tms",
"", $param,
'', $sortfield, $sortorder,
'center nowrap ');
1383 $totalarray[
'nbfield']++;
1385if (!empty($arrayfields[
'e.fk_statut'][
'checked'])) {
1386 print_liste_field_titre($arrayfields[
'e.fk_statut'][
'label'], $_SERVER[
"PHP_SELF"],
"e.fk_statut",
"", $param,
'', $sortfield, $sortorder,
'right ');
1387 $totalarray[
'nbfield']++;
1389if (!empty($arrayfields[
'e.billed'][
'checked'])) {
1390 print_liste_field_titre($arrayfields[
'e.billed'][
'label'], $_SERVER[
"PHP_SELF"],
"e.billed",
"", $param,
'', $sortfield, $sortorder,
'center ');
1391 $totalarray[
'nbfield']++;
1395 print_liste_field_titre($selectedfields, $_SERVER[
"PHP_SELF"],
"",
'',
'',
'', $sortfield, $sortorder,
'center maxwidthsearch ');
1396 $totalarray[
'nbfield']++;
1400$typenArray = $formcompany->typent_array(1);
1405$savnbfield = $totalarray[
'nbfield'];
1406$totalarray = array();
1407$totalarray[
'nbfield'] = 0;
1408$imaxinloop = ($limit ? min($num, $limit) : $num);
1409while ($i < $imaxinloop) {
1410 $obj = $db->fetch_object($resql);
1415 $companystatic->id = $obj->socid;
1416 $companystatic->ref = $obj->name;
1417 $companystatic->name = $obj->name;
1422 if ($mode ==
'kanban') {
1424 print
'<tr class="trkanban"><td colspan="'.$savnbfield.
'">';
1425 print
'<div class="box-flex-container kanban">';
1427 $object->date_delivery = $obj->delivery_date;
1432 if ($massactionbutton || $massaction) {
1434 if (in_array(
$object->id, $arrayofselected)) {
1438 print
$object->getKanbanView(
'', array(
'thirdparty' => $companystatic->getNomUrl(1),
'selected' => $selected));
1439 if ($i == min($num, $limit) - 1) {
1444 print
'<tr class="oddeven">';
1448 print
'<td class="nowrap center">';
1449 if ($massactionbutton || $massaction) {
1451 if (in_array($obj->rowid, $arrayofselected)) {
1454 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1459 if (!empty($arrayfields[
'e.ref'][
'checked'])) {
1460 print
'<td class="nowraponall">';
1462 $filedir = ($conf->expedition->multidir_output[
$object->entity] ? $conf->expedition->multidir_output[
$object->entity] : $conf->expedition->dir_output).
'/sending/'.
get_exdir(0, 0, 0, 1, $object,
'');
1464 print $formfile->getDocumentsLink(
'expedition', $filename, $filedir);
1467 $totalarray[
'nbfield']++;
1472 if (!empty($arrayfields[
'e.ref_customer'][
'checked'])) {
1473 print
'<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->ref_customer).
'">';
1477 $totalarray[
'nbfield']++;
1482 if (!empty($arrayfields[
's.nom'][
'checked'])) {
1483 print
'<td class="tdoverflowmax150">';
1484 print $companystatic->getNomUrl(1);
1487 $totalarray[
'nbfield']++;
1491 if (!empty($arrayfields[
's.town'][
'checked'])) {
1492 print
'<td class="nocellnopadd">';
1496 $totalarray[
'nbfield']++;
1500 if (!empty($arrayfields[
's.zip'][
'checked'])) {
1501 print
'<td class="nocellnopadd center">';
1505 $totalarray[
'nbfield']++;
1509 if (!empty($arrayfields[
'state.nom'][
'checked'])) {
1510 print
'<td class="center">'.$obj->state_name.
"</td>\n";
1512 $totalarray[
'nbfield']++;
1516 if (!empty($arrayfields[
'country.code_iso'][
'checked'])) {
1517 print
'<td class="center">';
1518 $tmparray =
getCountry($obj->fk_pays,
'all');
1522 $totalarray[
'nbfield']++;
1526 if (!empty($arrayfields[
'typent.code'][
'checked'])) {
1527 print
'<td class="center">';
1528 if (isset($typenArray[$obj->typent_code])) {
1529 print $typenArray[$obj->typent_code];
1533 $totalarray[
'nbfield']++;
1537 if (!empty($arrayfields[
'e.weight'][
'checked'])) {
1538 print
'<td class="center">';
1539 if (empty(
$object->trueWeight)) {
1540 $tmparray =
$object->getTotalWeightVolume();
1541 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');
1542 print $form->textwithpicto(
'', $langs->trans(
'EstimatedWeight'), 1);
1545 print (
$object->trueWeight &&
$object->weight_units !=
'') ?
' '.measuringUnitString(0,
"weight",
$object->weight_units) :
'';
1549 $totalarray[
'nbfield']++;
1553 if (!empty($arrayfields[
'e.date_delivery'][
'checked'])) {
1554 print
'<td class="center nowraponall">';
1555 print
dol_print_date($db->jdate($obj->delivery_date),
"dayhour");
1558 $totalarray[
'nbfield']++;
1561 if (!empty($arrayfields[
'e.fk_shipping_method'][
'checked'])) {
1563 $code = $langs->getLabelFromKey($db,
$object->shipping_method_id,
'c_shipment_mode',
'rowid',
'code');
1564 print
'<td class="center tdoverflowmax150" title="'.dol_escape_htmltag($langs->trans(
"SendingMethod".strtoupper($code))).
'">';
1565 if (
$object->shipping_method_id > 0) {
1566 print $langs->trans(
"SendingMethod".strtoupper($code));
1570 $totalarray[
'nbfield']++;
1574 if (!empty($arrayfields[
'e.tracking_number'][
'checked'])) {
1575 $object->getUrlTrackingStatus($obj->tracking_number);
1576 print
'<td class="center" title="'.dol_escape_htmltag(
$object->tracking_url).
'">'.
$object->tracking_url.
"</td>\n";
1578 $totalarray[
'nbfield']++;
1582 if (!empty($arrayfields[
'l.ref'][
'checked']) || !empty($arrayfields[
'l.date_delivery'][
'checked'])) {
1585 if (array_key_exists(
'delivery',
$object->linkedObjects) && count(
$object->linkedObjects[
'delivery']) > 0) {
1586 $receiving = reset(
$object->linkedObjects[
'delivery']);
1589 if (!empty($arrayfields[
'l.ref'][
'checked'])) {
1591 print
'<td class="nowraponall">';
1592 print !empty($receiving) ? $receiving->getNomUrl($db) :
'';
1596 if (!empty($arrayfields[
'l.date_delivery'][
'checked'])) {
1598 print
'<td class="center nowraponall">';
1604 if (!empty($arrayfields[
'e.note_public'][
'checked'])) {
1605 print
'<td class="sensiblehtmlcontent center">';
1609 $totalarray[
'nbfield']++;
1613 if (!empty($arrayfields[
'e.note_private'][
'checked'])) {
1614 print
'<td class="sensiblehtmlcontent center">';
1618 $totalarray[
'nbfield']++;
1622 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_list_print_fields.tpl.php';
1624 $parameters = array(
'arrayfields' => $arrayfields,
'obj' => $obj,
'i' => $i,
'totalarray' => &$totalarray);
1625 $reshook = $hookmanager->executeHooks(
'printFieldListValue', $parameters, $object, $action);
1626 print $hookmanager->resPrint;
1628 if (!empty($arrayfields[
'e.datec'][
'checked'])) {
1629 print
'<td class="center nowraponall">';
1630 print
dol_print_date($db->jdate($obj->date_creation),
'dayhour',
'tzuserrel');
1633 $totalarray[
'nbfield']++;
1637 if (!empty($arrayfields[
'e.tms'][
'checked'])) {
1638 print
'<td class="center nowraponall">';
1639 print
dol_print_date($db->jdate($obj->date_modification),
'dayhour',
'tzuser');
1642 $totalarray[
'nbfield']++;
1646 if (!empty($arrayfields[
'e.fk_statut'][
'checked'])) {
1647 print
'<td class="right nowrap">'.$object->getLibStatut(5).
'</td>';
1649 $totalarray[
'nbfield']++;
1653 if (!empty($arrayfields[
'e.billed'][
'checked'])) {
1654 print
'<td class="center">'.yn($obj->billed).
'</td>';
1656 $totalarray[
'nbfield']++;
1662 print
'<td class="nowrap center">';
1663 if ($massactionbutton || $massaction) {
1665 if (in_array($obj->rowid, $arrayofselected)) {
1668 print
'<input id="cb'.$obj->rowid.
'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.
'"'.($selected ?
' checked="checked"' :
'').
'>';
1673 $totalarray[
'nbfield']++;
1684 foreach ($arrayfields as $key => $val) {
1685 if (!empty($val[
'checked'])) {
1689 print
'<tr><td colspan="'.$colspan.
'"><span class="opacitymedium">'.$langs->trans(
"NoRecordFound").
'</span></td></tr>';
1694$parameters = array(
'arrayfields' => $arrayfields,
'totalarray' => $totalarray,
'sql' => $sql);
1695$reshook = $hookmanager->executeHooks(
'printFieldListFooter', $parameters, $object, $action);
1696print $hookmanager->resPrint;
1702$hidegeneratedfilelistifempty = 1;
1703if ($massaction ==
'builddoc' || $action ==
'remove_file' || $show_files) {
1704 $hidegeneratedfilelistifempty = 0;
1708$urlsource = $_SERVER[
'PHP_SELF'].
'?sortfield='.$sortfield.
'&sortorder='.$sortorder;
1709$urlsource .= str_replace(
'&',
'&', $param);
1711$filedir = $diroutputmassaction;
1712$genallowed = $user->hasRight(
'expedition',
'lire');
1713$delallowed = $user->hasRight(
'expedition',
'creer');
1716print $formfile->showdocuments(
'massfilesarea_sendings',
'', $filedir, $urlsource, 0, $delallowed,
'', 1, 1, 0, 48, 1, $param, $title,
'',
'',
'',
null, $hidegeneratedfilelistifempty);
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage customers orders.
Class to manage absolute discounts.
Class to manage shipments.
Class to manage invoices.
Class to manage third parties objects (customers, suppliers, prospects...)
getCountry($searchkey, $withcode='', $dbtouse=null, $outputlangs=null, $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 information (by default a local PHP server timestamp) Rep...
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dolPrintHTML($s, $allowiframe=0)
Return a string (that can be on several lines) ready to be output on a HTML page.
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_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
if(!function_exists( 'dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
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.
dol_concatdesc($text1, $text2, $forxml=false, $invert=false)
Concat 2 descriptions with a new line between them (second operand after first one with appropriate n...
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
print_barre_liste($title, $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.
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.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart='')
Return a path to have a the directory according to object where files are stored.
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.