2004-10-20 22:06:49 +02:00
< ? php
2015-05-23 18:52:31 +02:00
/* Copyright ( C ) 2001 - 2006 Rodolphe Quiedeville < rodolphe @ quiedeville . org >
2019-04-01 19:27:34 +02:00
* Copyright ( C ) 2004 - 2019 Laurent Destailleur < eldy @ users . sourceforge . net >
2018-10-27 14:43:12 +02:00
* Copyright ( C ) 2005 - 2012 Regis Houssin < regis . houssin @ inodbox . com >
2016-07-23 16:37:21 +02:00
* Copyright ( C ) 2012 - 2016 Marcos García < marcosgdf @ gmail . com >
2023-03-17 22:52:01 +01:00
* Copyright ( C ) 2013 - 2023 Juanjo Menent < jmenent @ 2 byte . es >
2015-05-23 18:52:31 +02:00
* Copyright ( C ) 2013 - 2015 Raphaël Doursenaud < rdoursenaud @ gpcsolutions . fr >
* Copyright ( C ) 2013 Jean Heimburger < jean @ tiaris . info >
* Copyright ( C ) 2013 Cédric Salvador < csalvador @ gpcsolutions . fr >
* Copyright ( C ) 2013 Florian Henry < florian . henry @ open - concept . pro >
* Copyright ( C ) 2013 Adolfo segura < adolfo . segura @ gmail . com >
* Copyright ( C ) 2015 Jean - François Ferry < jfefe @ aternatik . fr >
2023-11-26 21:41:17 +01:00
* Copyright ( C ) 2016 Ferran Marcet < fmarcet @ 2 byte . es >
* Copyright ( C ) 2020 - 2021 Open - DSI < support @ open - dsi . fr >
* Copyright ( C ) 2022 Charlene Benke < charlene @ patas - monkey . com >
* Copyright ( C ) 2020 - 2023 Alexandre Spangaro < aspangaro @ easya . solutions >
2025-02-08 21:53:48 +01:00
* Copyright ( C ) 2024 - 2025 MDW < mdeweerd @ users . noreply . github . com >
2024-04-11 20:07:13 +02:00
* Copyright ( C ) 2024 Benjamin Falière < benjamin . faliere @ altairis . fr >
2024-07-03 02:30:53 +02:00
* Copyright ( C ) 2024 Frédéric France < frederic . france @ free . fr >
2003-09-04 11:59:59 +02:00
*
* This program is free software ; you can redistribute it and / or modify
* it under the terms of the GNU General Public License as published by
2013-01-16 15:36:08 +01:00
* the Free Software Foundation ; either version 3 of the License , or
2003-09-04 11:59:59 +02:00
* ( at your option ) any later version .
*
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
*
* You should have received a copy of the GNU General Public License
2019-09-23 21:55:30 +02:00
* along with this program . If not , see < https :// www . gnu . org / licenses />.
2003-09-04 11:59:59 +02:00
*/
2004-10-23 01:34:25 +02:00
2005-01-19 22:40:03 +01:00
/**
2014-09-18 20:33:37 +02:00
* \file htdocs / product / list . php
2008-11-17 19:59:02 +01:00
* \ingroup produit
* \brief Page to list products and services
*/
2004-10-23 01:34:25 +02:00
2022-08-29 18:43:06 +02:00
// Load Dolibarr environment
2012-08-22 23:24:21 +02:00
require '../main.inc.php' ;
2023-08-14 13:52:57 +02:00
require_once DOL_DOCUMENT_ROOT . '/core/lib/accounting.lib.php' ;
2019-04-28 00:49:21 +02:00
require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php' ;
2020-02-28 11:16:39 +01:00
require_once DOL_DOCUMENT_ROOT . '/core/lib/product.lib.php' ;
2020-09-16 12:34:07 +02:00
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php' ;
2012-08-22 23:11:24 +02:00
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php' ;
2023-08-14 13:52:57 +02:00
require_once DOL_DOCUMENT_ROOT . '/fourn/class/fournisseur.product.class.php' ;
require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php' ;
2020-10-14 16:39:42 +02:00
require_once DOL_DOCUMENT_ROOT . '/product/class/html.formproduct.class.php' ;
2023-08-27 19:36:48 +02:00
if ( isModEnabled ( 'workstation' )) {
require_once DOL_DOCUMENT_ROOT . '/workstation/class/workstation.class.php' ;
}
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'category' )) {
2012-08-22 23:11:24 +02:00
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php' ;
2022-10-31 08:13:11 +01:00
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcategory.class.php' ;
2021-02-26 14:25:17 +01:00
}
2003-09-04 11:59:59 +02:00
2024-11-04 23:53:20 +01:00
/**
* @ var Conf $conf
* @ var DoliDB $db
* @ var HookManager $hookmanager
* @ var Societe $mysoc
* @ var Translate $langs
* @ var User $user
*/
2018-05-26 23:52:52 +02:00
// Load translation files required by the page
2020-07-24 13:40:06 +02:00
$langs -> loadLangs ( array ( 'products' , 'stocks' , 'suppliers' , 'companies' , 'margins' ));
2022-08-31 21:55:55 +02:00
if ( isModEnabled ( 'productbatch' )) {
2021-02-26 14:25:17 +01:00
$langs -> load ( " productbatch " );
}
2004-08-13 23:25:54 +02:00
2022-08-29 18:43:06 +02:00
// Get parameters
2020-09-16 19:39:50 +02:00
$action = GETPOST ( 'action' , 'aZ09' );
2019-11-12 09:46:08 +01:00
$massaction = GETPOST ( 'massaction' , 'alpha' );
Fix: GETPOST(...,'int') to GETPOSTINT(...) (#28448)
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: Update spelling exceptions
* Qual: Ignore Phan Notice
2024-02-27 14:05:53 +01:00
$show_files = GETPOSTINT ( 'show_files' );
2019-11-12 09:46:08 +01:00
$confirm = GETPOST ( 'confirm' , 'alpha' );
2017-04-09 15:02:55 +02:00
$toselect = GETPOST ( 'toselect' , 'array' );
2024-04-03 17:50:24 +02:00
$optioncss = GETPOST ( 'optioncss' , 'alpha' );
$mode = GETPOST ( 'mode' , 'alpha' );
$fourn_id = GETPOSTINT ( " fourn_id " );
2017-04-09 15:02:55 +02:00
2024-01-12 17:55:52 +01:00
// Search Criteria
2024-11-07 12:25:31 +01:00
$search_all = trim ( GETPOST ( 'search_all' , 'alphanohtml' ));
2021-06-13 13:29:15 +02:00
$search_id = GETPOST ( " search_id " , 'alpha' );
2019-11-12 09:46:08 +01:00
$search_ref = GETPOST ( " search_ref " , 'alpha' );
2025-01-12 18:00:01 +01:00
$search_ref_ext = trim ( GETPOST ( " search_ref_ext " , 'alpha' ));
$search_ref_supplier = GETPOST ( " search_ref_supplier " , 'alpha' ); // ref of supplier price
2019-11-12 09:46:08 +01:00
$search_barcode = GETPOST ( " search_barcode " , 'alpha' );
$search_label = GETPOST ( " search_label " , 'alpha' );
2023-03-22 17:32:13 +01:00
$search_default_workstation = GETPOST ( " search_default_workstation " , 'alpha' );
2024-03-05 11:06:52 +01:00
$search_type = GETPOST ( " search_type " , " int " );
2019-11-12 09:46:08 +01:00
$search_vatrate = GETPOST ( " search_vatrate " , 'alpha' );
2022-01-18 16:36:50 +01:00
$searchCategoryProductOperator = 0 ;
if ( GETPOSTISSET ( 'formfilteraction' )) {
2022-10-31 08:13:11 +01:00
$searchCategoryProductOperator = GETPOSTINT ( 'search_category_product_operator' );
2023-11-27 11:56:32 +01:00
} elseif ( getDolGlobalString ( 'MAIN_SEARCH_CAT_OR_BY_DEFAULT' )) {
2024-01-05 04:18:53 +01:00
$searchCategoryProductOperator = getDolGlobalString ( 'MAIN_SEARCH_CAT_OR_BY_DEFAULT' );
2022-01-18 16:36:50 +01:00
}
2019-09-13 12:23:34 +02:00
$searchCategoryProductList = GETPOST ( 'search_category_product_list' , 'array' );
Fix: GETPOST(...,'int') to GETPOSTINT(...) (#28448)
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: GETPOST(...,'int') to GETPOSTINT(...)
# Fix: GETPOST(...,'int') to GETPOSTINT(...)
Converted using Phan plugin
* Fix: Update spelling exceptions
* Qual: Ignore Phan Notice
2024-02-27 14:05:53 +01:00
$catid = GETPOSTINT ( 'catid' );
2022-10-11 02:26:12 +02:00
if ( ! empty ( $catid ) && empty ( $searchCategoryProductList )) {
$searchCategoryProductList = array ( $catid );
}
2024-02-28 18:40:53 +01:00
$search_tosell = GETPOST ( " search_tosell " );
$search_tobuy = GETPOST ( " search_tobuy " );
2024-04-03 17:50:24 +02:00
$search_country = GETPOST ( " search_country " , 'aZ09' );
$search_state = GETPOST ( " state_id " , 'intcomma' );
2024-02-28 18:40:53 +01:00
$search_tobatch = GETPOST ( " search_tobatch " );
2019-01-27 11:55:16 +01:00
$search_accountancy_code_sell = GETPOST ( " search_accountancy_code_sell " , 'alpha' );
2019-04-25 01:16:29 +02:00
$search_accountancy_code_sell_intra = GETPOST ( " search_accountancy_code_sell_intra " , 'alpha' );
$search_accountancy_code_sell_export = GETPOST ( " search_accountancy_code_sell_export " , 'alpha' );
2019-01-27 11:55:16 +01:00
$search_accountancy_code_buy = GETPOST ( " search_accountancy_code_buy " , 'alpha' );
2020-03-01 04:52:12 +01:00
$search_accountancy_code_buy_intra = GETPOST ( " search_accountancy_code_buy_intra " , 'alpha' );
$search_accountancy_code_buy_export = GETPOST ( " search_accountancy_code_buy_export " , 'alpha' );
2024-05-31 15:46:24 +02:00
$search_import_key = GETPOST ( " search_import_key " , 'alpha' );
2024-02-28 18:40:53 +01:00
$search_finished = GETPOST ( " search_finished " );
2024-12-19 18:22:58 +01:00
$search_units = GETPOST ( 'search_units' , 'int' );
2024-04-03 17:50:24 +02:00
$type = GETPOST ( " type " , 'alpha' );
2022-12-06 16:11:14 +01:00
2023-08-26 22:18:49 +02:00
// Show/hide child product variants
2023-10-10 22:10:37 +02:00
$show_childproducts = 0 ;
2023-08-26 22:18:49 +02:00
if ( isModEnabled ( 'variants' )) {
2018-10-15 11:48:55 +02:00
$show_childproducts = GETPOST ( 'search_show_childproducts' );
2016-07-23 16:37:21 +02:00
}
2019-11-12 09:46:08 +01:00
$diroutputmassaction = $conf -> product -> dir_output . '/temp/massgeneration/' . $user -> id ;
2017-04-09 15:02:55 +02:00
2023-05-11 11:03:26 +02:00
// Load variable for pagination
2024-03-16 11:41:00 +01:00
$limit = GETPOSTINT ( 'limit' ) ? GETPOSTINT ( 'limit' ) : $conf -> liste_limit ;
2022-01-13 11:09:37 +01:00
$sortfield = GETPOST ( 'sortfield' , 'aZ09comma' );
$sortorder = GETPOST ( 'sortorder' , 'aZ09comma' );
2024-03-01 01:52:40 +01:00
$page = GETPOSTISSET ( 'pageplusone' ) ? ( GETPOSTINT ( 'pageplusone' ) - 1 ) : GETPOSTINT ( " page " );
2021-02-26 14:25:17 +01:00
if ( empty ( $page ) || $page < 0 || GETPOST ( 'button_search' , 'alpha' ) || GETPOST ( 'button_removefilter' , 'alpha' )) {
2023-05-11 11:03:26 +02:00
// If $page is not defined, or '' or -1 or if we click on clear filters
2021-02-26 14:25:17 +01:00
$page = 0 ;
2023-05-11 11:03:26 +02:00
}
2015-12-16 15:42:24 +01:00
$offset = $limit * $page ;
2010-11-20 14:08:44 +01:00
$pageprev = $page - 1 ;
$pagenext = $page + 1 ;
2021-02-26 14:25:17 +01:00
if ( ! $sortfield ) {
$sortfield = " p.ref " ;
}
if ( ! $sortorder ) {
$sortorder = " ASC " ;
}
2010-11-20 14:08:44 +01:00
2016-06-07 14:06:00 +02:00
// Initialize context for list
2023-12-04 13:49:31 +01:00
$contextpage = GETPOST ( 'contextpage' , 'aZ' ) ? GETPOST ( 'contextpage' , 'aZ' ) : 'productservicelist' ;
2021-02-26 14:25:17 +01:00
if (( string ) $type == '1' ) {
2023-12-04 13:49:31 +01:00
$contextpage = 'servicelist' ;
if ( $search_type == '' ) {
2021-02-26 14:25:17 +01:00
$search_type = '1' ;
}
}
if (( string ) $type == '0' ) {
2023-12-04 13:49:31 +01:00
$contextpage = 'productlist' ;
if ( $search_type == '' ) {
2021-02-26 14:25:17 +01:00
$search_type = '0' ;
}
}
2004-10-31 17:02:47 +01:00
2024-06-30 21:02:50 +02:00
// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array of hooks
2019-11-12 09:46:08 +01:00
$object = new Product ( $db );
2018-03-31 18:48:27 +02:00
$hookmanager -> initHooks ( array ( 'productservicelist' ));
2015-10-29 22:12:11 +01:00
$extrafields = new ExtraFields ( $db );
2019-11-12 09:46:08 +01:00
$form = new Form ( $db );
2020-09-16 12:34:07 +02:00
$formcompany = new FormCompany ( $db );
2020-10-14 16:39:42 +02:00
$formproduct = new FormProduct ( $db );
2015-10-29 22:12:11 +01:00
// fetch optionals attributes and labels
2020-08-04 12:47:09 +02:00
$extrafields -> fetch_name_optionals_label ( $object -> table_element );
2019-11-12 09:46:08 +01:00
$search_array_options = $extrafields -> getOptionalsFromPost ( $object -> table_element , '' , 'search_' );
2010-02-27 18:30:17 +01:00
2021-02-26 14:25:17 +01:00
if ( empty ( $action )) {
$action = 'list' ;
}
2010-02-27 18:30:17 +01:00
2011-04-06 18:40:11 +02:00
// Get object canvas (By default, this is not defined, so standard usage of dolibarr)
2019-11-12 09:46:08 +01:00
$canvas = GETPOST ( " canvas " );
$objcanvas = null ;
2021-02-26 14:25:17 +01:00
if ( ! empty ( $canvas )) {
2017-10-13 13:28:26 +02:00
require_once DOL_DOCUMENT_ROOT . '/core/class/canvas.class.php' ;
2019-01-27 11:55:16 +01:00
$objcanvas = new Canvas ( $db , $action );
$objcanvas -> getCanvas ( 'product' , 'list' , $canvas );
2011-04-06 18:40:11 +02:00
}
2010-03-16 21:05:44 +01:00
2016-04-28 15:22:38 +02:00
// Define virtualdiffersfromphysical
2019-11-12 09:46:08 +01:00
$virtualdiffersfromphysical = 0 ;
2023-11-27 11:56:32 +01:00
if ( getDolGlobalString ( 'STOCK_CALCULATE_ON_SHIPMENT' )
|| getDolGlobalString ( 'STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER' )
|| getDolGlobalString ( 'STOCK_CALCULATE_ON_SHIPMENT_CLOSE' )
|| getDolGlobalString ( 'STOCK_CALCULATE_ON_RECEPTION' )
|| getDolGlobalString ( 'STOCK_CALCULATE_ON_RECEPTION_CLOSE' )
2022-09-25 15:31:29 +02:00
|| isModEnabled ( 'mrp' )) {
2019-11-12 09:46:08 +01:00
$virtualdiffersfromphysical = 1 ; // According to increase/decrease stock options, virtual and physical stock may differs.
2016-04-28 15:22:38 +02:00
}
2015-10-17 00:14:36 +02:00
// List of fields to search into when doing a "search in all"
$fieldstosearchall = array (
2024-03-09 16:32:02 +01:00
'p.ref' => " Ref " ,
'p.label' => " ProductLabel " ,
'p.description' => " Description " ,
" p.note " => " Note " ,
'pfp.ref_fourn' => 'RefSupplier'
2015-10-17 00:14:36 +02:00
);
// multilang
2022-09-24 14:52:21 +02:00
if ( getDolGlobalInt ( 'MAIN_MULTILANGS' )) {
2019-11-12 09:46:08 +01:00
$fieldstosearchall [ 'pl.label' ] = 'ProductLabelTranslated' ;
$fieldstosearchall [ 'pl.description' ] = 'ProductDescriptionTranslated' ;
$fieldstosearchall [ 'pl.note' ] = 'ProductNoteTranslated' ;
2015-10-17 00:14:36 +02:00
}
2022-08-19 18:07:21 +02:00
if ( isModEnabled ( 'barcode' )) {
2019-11-12 09:46:08 +01:00
$fieldstosearchall [ 'p.barcode' ] = 'Gencod' ;
2023-09-19 17:29:24 +02:00
$fieldstosearchall [ 'pfp.barcode' ] = 'GencodBuyPrice' ;
2015-10-17 00:14:36 +02:00
}
2024-06-22 19:30:35 +02:00
// Personalized search criteria. Example: getDolGlobalString('PRODUCT_QUICKSEARCH_ON_FIELDS') = 'p.ref=ProductRef;p.label=ProductLabel;p.description=Description;p.note=Note;'
2023-11-27 11:56:32 +01:00
if ( getDolGlobalString ( 'PRODUCT_QUICKSEARCH_ON_FIELDS' )) {
2024-06-22 19:30:35 +02:00
$fieldstosearchall = dolExplodeIntoArray ( getDolGlobalString ( 'PRODUCT_QUICKSEARCH_ON_FIELDS' ));
2021-02-26 14:25:17 +01:00
}
2015-10-17 00:14:36 +02:00
2023-11-27 11:56:32 +01:00
if ( ! getDolGlobalString ( 'PRODUIT_MULTIPRICES' )) {
2019-11-12 09:46:08 +01:00
$titlesellprice = $langs -> trans ( " SellingPrice " );
2023-11-27 11:56:32 +01:00
if ( getDolGlobalString ( 'PRODUIT_CUSTOMER_PRICES' )) {
2019-11-12 09:46:08 +01:00
$titlesellprice = $form -> textwithpicto ( $langs -> trans ( " SellingPrice " ), $langs -> trans ( " DefaultPriceRealPriceMayDependOnCustomer " ));
2016-03-16 16:30:59 +01:00
}
}
2019-11-12 09:46:08 +01:00
$isInEEC = isInEEC ( $mysoc );
2019-04-25 01:16:29 +02:00
2023-11-27 11:56:32 +01:00
$alias_product_perentity = ! getDolGlobalString ( 'MAIN_PRODUCT_PERENTITY_SHARED' ) ? " p " : " ppe " ;
2021-03-20 07:42:16 +01:00
2024-03-09 16:32:02 +01:00
$arraypricelevel = array ();
2021-06-13 13:29:15 +02:00
// Definition of array of fields for columns
2019-11-12 09:46:08 +01:00
$arrayfields = array (
2024-03-09 16:32:02 +01:00
'p.rowid' => array ( 'type' => 'integer' , 'label' => 'TechnicalID' , 'enabled' => 1 , 'visible' => - 2 , 'noteditable' => 1 , 'notnull' => 1 , 'index' => 1 , 'position' => 1 , 'comment' => 'Id' , 'css' => 'left' ),
2025-01-12 18:00:01 +01:00
'p.ref' => array ( 'label' => 'ProductRef' , 'checked' => 1 , 'position' => 5 ),
'p.ref_ext' => array ( 'label' => 'RefExt' , 'checked' => 1 , 'position' => 6 , 'visible' => getDolGlobalInt ( 'MAIN_LIST_SHOW_REF_EXT' )),
2022-12-23 14:11:13 +01:00
//'pfp.ref_fourn'=>array('label'=>$langs->trans("RefSupplier"), 'checked'=>1, 'enabled'=>(isModEnabled('barcode'))),
2024-03-09 16:32:02 +01:00
'thumbnail' => array ( 'label' => 'Photo' , 'checked' => 0 , 'position' => 10 ),
'p.description' => array ( 'label' => 'Description' , 'checked' => 0 , 'position' => 10 ),
'p.label' => array ( 'label' => " Label " , 'checked' => 1 , 'position' => 10 ),
'p.fk_product_type' => array ( 'label' => " Type " , 'checked' => 0 , 'enabled' => ( isModEnabled ( " product " ) && isModEnabled ( " service " )), 'position' => 11 ),
'p.barcode' => array ( 'label' => " Gencod " , 'checked' => 1 , 'enabled' => ( isModEnabled ( 'barcode' )), 'position' => 12 ),
'p.duration' => array ( 'label' => " Duration " , 'checked' => ( $contextpage != 'productlist' ), 'enabled' => ( isModEnabled ( " service " ) && ( string ) $type == '1' ), 'position' => 13 ),
'pac.fk_product_parent' => array ( 'label' => " ParentProductOfVariant " , 'checked' => - 1 , 'enabled' => ( isModEnabled ( 'variants' )), 'position' => 14 ),
'p.finished' => array ( 'label' => " Nature " , 'checked' => 0 , 'enabled' => ( isModEnabled ( " product " ) && $type != '1' ), 'position' => 19 ),
'p.weight' => array ( 'label' => 'Weight' , 'checked' => 0 , 'enabled' => ( isModEnabled ( " product " ) && $type != '1' ), 'position' => 20 ),
'p.weight_units' => array ( 'label' => 'WeightUnits' , 'checked' => 0 , 'enabled' => ( isModEnabled ( " product " ) && $type != '1' ), 'position' => 21 ),
'p.length' => array ( 'label' => 'Length' , 'checked' => 0 , 'enabled' => ( isModEnabled ( " product " ) && ! getDolGlobalString ( 'PRODUCT_DISABLE_SIZE' ) && $type != '1' ), 'position' => 22 ),
'p.length_units' => array ( 'label' => 'LengthUnits' , 'checked' => 0 , 'enabled' => ( isModEnabled ( " product " ) && ! getDolGlobalString ( 'PRODUCT_DISABLE_SIZE' ) && $type != '1' ), 'position' => 23 ),
'p.width' => array ( 'label' => 'Width' , 'checked' => 0 , 'enabled' => ( isModEnabled ( " product " ) && ! getDolGlobalString ( 'PRODUCT_DISABLE_SIZE' ) && $type != '1' ), 'position' => 24 ),
'p.width_units' => array ( 'label' => 'WidthUnits' , 'checked' => 0 , 'enabled' => ( isModEnabled ( " product " ) && ! getDolGlobalString ( 'PRODUCT_DISABLE_SIZE' ) && $type != '1' ), 'position' => 25 ),
'p.height' => array ( 'label' => 'Height' , 'checked' => 0 , 'enabled' => ( isModEnabled ( " product " ) && ! getDolGlobalString ( 'PRODUCT_DISABLE_SIZE' ) && $type != '1' ), 'position' => 26 ),
'p.height_units' => array ( 'label' => 'HeightUnits' , 'checked' => 0 , 'enabled' => ( isModEnabled ( " product " ) && ! getDolGlobalString ( 'PRODUCT_DISABLE_SIZE' ) && $type != '1' ), 'position' => 27 ),
'p.surface' => array ( 'label' => 'Surface' , 'checked' => 0 , 'enabled' => ( isModEnabled ( " product " ) && ! getDolGlobalString ( 'PRODUCT_DISABLE_SURFACE' ) && $type != '1' ), 'position' => 28 ),
'p.surface_units' => array ( 'label' => 'SurfaceUnits' , 'checked' => 0 , 'enabled' => ( isModEnabled ( " product " ) && ! getDolGlobalString ( 'PRODUCT_DISABLE_SURFACE' ) && $type != '1' ), 'position' => 29 ),
'p.volume' => array ( 'label' => 'Volume' , 'checked' => 0 , 'enabled' => ( isModEnabled ( " product " ) && ! getDolGlobalString ( 'PRODUCT_DISABLE_VOLUME' ) && $type != '1' ), 'position' => 30 ),
'p.volume_units' => array ( 'label' => 'VolumeUnits' , 'checked' => 0 , 'enabled' => ( isModEnabled ( " product " ) && ! getDolGlobalString ( 'PRODUCT_DISABLE_VOLUME' ) && $type != '1' ), 'position' => 31 ),
'cu.label' => array ( 'label' => " DefaultUnitToShow " , 'checked' => 0 , 'enabled' => ( isModEnabled ( " product " ) && getDolGlobalString ( 'PRODUCT_USE_UNITS' )), 'position' => 32 ),
'p.fk_default_workstation' => array ( 'label' => 'DefaultWorkstation' , 'checked' => 0 , 'enabled' => isModEnabled ( 'workstation' ) && $type == 1 , 'position' => 33 ),
'p.sellprice' => array ( 'label' => " SellingPrice " , 'checked' => 1 , 'enabled' => ! getDolGlobalString ( 'PRODUIT_MULTIPRICES' ), 'position' => 40 ),
'p.tva_tx' => array ( 'label' => " VATRate " , 'checked' => 0 , 'enabled' => ! getDolGlobalString ( 'PRODUIT_MULTIPRICES' ), 'position' => 41 ),
'p.minbuyprice' => array ( 'label' => " BuyingPriceMinShort " , 'checked' => 1 , 'enabled' => ( $user -> hasRight ( 'fournisseur' , 'lire' )), 'position' => 42 ),
'p.numbuyprice' => array ( 'label' => " BuyingPriceNumShort " , 'checked' => 0 , 'enabled' => ( $user -> hasRight ( 'fournisseur' , 'lire' )), 'position' => 43 ),
'p.pmp' => array ( 'label' => " PMPValueShort " , 'checked' => 0 , 'enabled' => ( $user -> hasRight ( 'fournisseur' , 'lire' )), 'position' => 44 ),
'p.cost_price' => array ( 'label' => " CostPrice " , 'checked' => 0 , 'enabled' => ( $user -> hasRight ( 'fournisseur' , 'lire' )), 'position' => 45 ),
'p.seuil_stock_alerte' => array ( 'label' => " StockLimit " , 'checked' => 0 , 'enabled' => ( isModEnabled ( 'stock' ) && $user -> hasRight ( 'stock' , 'lire' ) && ( $contextpage != 'servicelist' || getDolGlobalString ( 'STOCK_SUPPORTS_SERVICES' ))), 'position' => 50 ),
'p.desiredstock' => array ( 'label' => " DesiredStock " , 'checked' => 1 , 'enabled' => ( isModEnabled ( 'stock' ) && $user -> hasRight ( 'stock' , 'lire' ) && ( $contextpage != 'servicelist' || getDolGlobalString ( 'STOCK_SUPPORTS_SERVICES' ))), 'position' => 51 ),
'p.stock' => array ( 'label' => " PhysicalStock " , 'checked' => 1 , 'enabled' => ( isModEnabled ( 'stock' ) && $user -> hasRight ( 'stock' , 'lire' ) && ( $contextpage != 'servicelist' || getDolGlobalString ( 'STOCK_SUPPORTS_SERVICES' ))), 'position' => 52 ),
'stock_virtual' => array ( 'label' => " VirtualStock " , 'checked' => 1 , 'enabled' => ( isModEnabled ( 'stock' ) && $user -> hasRight ( 'stock' , 'lire' ) && ( $contextpage != 'servicelist' || getDolGlobalString ( 'STOCK_SUPPORTS_SERVICES' )) && $virtualdiffersfromphysical ), 'position' => 53 ),
'p.tobatch' => array ( 'label' => " ManageLotSerial " , 'checked' => 0 , 'enabled' => ( isModEnabled ( 'productbatch' )), 'position' => 60 ),
'p.fk_country' => array ( 'label' => " Country " , 'checked' => 0 , 'position' => 100 ),
'p.fk_state' => array ( 'label' => " State " , 'checked' => 0 , 'position' => 101 ),
$alias_product_perentity . '.accountancy_code_sell' => array ( 'label' => " ProductAccountancySellCode " , 'checked' => 0 , 'enabled' => ! getDolGlobalString ( 'PRODUCT_DISABLE_ACCOUNTING' ), 'position' => 400 ),
$alias_product_perentity . '.accountancy_code_sell_intra' => array ( 'label' => " ProductAccountancySellIntraCode " , 'checked' => 0 , 'enabled' => $isInEEC && ! getDolGlobalString ( 'PRODUCT_DISABLE_ACCOUNTING' ), 'position' => 401 ),
$alias_product_perentity . '.accountancy_code_sell_export' => array ( 'label' => " ProductAccountancySellExportCode " , 'checked' => 0 , 'enabled' => ! getDolGlobalString ( 'PRODUCT_DISABLE_ACCOUNTING' ), 'position' => 402 ),
$alias_product_perentity . '.accountancy_code_buy' => array ( 'label' => " ProductAccountancyBuyCode " , 'checked' => 0 , 'enabled' => ! getDolGlobalString ( 'PRODUCT_DISABLE_ACCOUNTING' ), 'position' => 403 ),
$alias_product_perentity . '.accountancy_code_buy_intra' => array ( 'label' => " ProductAccountancyBuyIntraCode " , 'checked' => 0 , 'enabled' => $isInEEC && ! getDolGlobalString ( 'PRODUCT_DISABLE_ACCOUNTING' ), 'position' => 404 ),
$alias_product_perentity . '.accountancy_code_buy_export' => array ( 'label' => " ProductAccountancyBuyExportCode " , 'checked' => 0 , 'enabled' => ! getDolGlobalString ( 'PRODUCT_DISABLE_ACCOUNTING' ), 'position' => 405 ),
'p.datec' => array ( 'label' => " DateCreation " , 'checked' => 0 , 'position' => 500 ),
'p.tms' => array ( 'label' => " DateModificationShort " , 'checked' => 0 , 'position' => 500 ),
'p.tosell' => array ( 'label' => $langs -> transnoentitiesnoconv ( " Status " ) . ' (' . $langs -> transnoentitiesnoconv ( " Sell " ) . ')' , 'checked' => 1 , 'position' => 1000 ),
'p.tobuy' => array ( 'label' => $langs -> transnoentitiesnoconv ( " Status " ) . ' (' . $langs -> transnoentitiesnoconv ( " Buy " ) . ')' , 'checked' => 1 , 'position' => 1000 ),
'p.import_key' => array ( 'type' => 'varchar(14)' , 'label' => 'ImportId' , 'enabled' => 1 , 'visible' => - 2 , 'notnull' => - 1 , 'index' => 0 , 'checked' => - 1 , 'position' => 1100 ),
2015-11-11 17:05:18 +01:00
);
2021-06-13 13:29:15 +02:00
/* foreach ( $object -> fields as $key => $val ) {
// If $val['visible']==0, then we never show the field
if ( ! empty ( $val [ 'visible' ])) {
2022-03-01 16:38:06 +01:00
$visible = dol_eval ( $val [ 'visible' ], 1 , 1 , '1' );
2021-06-13 13:29:15 +02:00
$arrayfields [ 'p.' . $key ] = array (
'label' => $val [ 'label' ],
'checked' => (( $visible < 0 ) ? 0 : 1 ),
2024-07-09 17:26:49 +02:00
'enabled' => ( abs ( $visible ) != 3 && ( bool ) dol_eval ( $val [ 'enabled' ], 1 )),
2021-06-13 13:29:15 +02:00
'position' => $val [ 'position' ]
);
}
} */
2020-05-08 22:41:49 +02:00
// MultiPrices
2023-11-27 11:56:32 +01:00
if ( getDolGlobalString ( 'PRODUIT_MULTIPRICES' )) {
2024-06-22 19:30:35 +02:00
$produit_multiprices_limit = getDolGlobalInt ( 'PRODUIT_MULTIPRICES_LIMIT' );
for ( $i = 1 ; $i <= $produit_multiprices_limit ; $i ++ ) {
2020-05-09 00:28:23 +02:00
$keyforlabel = 'PRODUIT_MULTIPRICES_LABEL' . $i ;
2024-06-22 19:46:11 +02:00
if ( getDolGlobalString ( $keyforlabel )) {
$labelp = $i . ' - ' . $langs -> transnoentitiesnoconv ( getDolGlobalString ( $keyforlabel ));
2020-05-26 01:16:18 +02:00
} else {
2021-02-16 11:15:42 +01:00
$labelp = $langs -> transnoentitiesnoconv ( " SellingPrice " ) . " " . $i ;
2020-05-09 00:28:23 +02:00
}
2025-02-08 21:53:48 +01:00
$arrayfields [ 'p.sellprice' . $i ] = array ( 'label' => $labelp , 'checked' => ( $i == 1 ? '1' : '0' ), 'enabled' => getDolGlobalString ( 'PRODUIT_MULTIPRICES' ), 'position' => ( float ) ( '40.' . sprintf ( '%03d' , $i )));
2020-05-08 22:41:49 +02:00
$arraypricelevel [ $i ] = array ( $i );
}
}
2015-11-11 17:05:18 +01:00
// Extra fields
2020-12-01 02:41:19 +01:00
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php' ;
2020-11-06 12:19:45 +01:00
2018-03-31 17:51:36 +02:00
$object -> fields = dol_sort_array ( $object -> fields , 'position' );
$arrayfields = dol_sort_array ( $arrayfields , 'position' );
2025-02-08 21:53:48 +01:00
// Note: forcing int for position, but in reality it is a float here.
'@phan-var-force array<string,array{label:string,checked?:string,position?:int,enabled?:string,help?:string}> $arrayfields' ; // dol_sort_array looses type for Phan
2009-08-12 15:07:49 +02:00
2021-03-19 14:25:59 +01:00
// Security check
if ( $search_type == '0' ) {
$result = restrictedArea ( $user , 'produit' , '' , '' , '' , '' , '' , 0 );
} elseif ( $search_type == '1' ) {
$result = restrictedArea ( $user , 'service' , '' , '' , '' , '' , '' , 0 );
} else {
$result = restrictedArea ( $user , 'produit|service' , '' , '' , '' , '' , '' , 0 );
}
2016-04-28 15:22:38 +02:00
2022-10-11 02:26:12 +02:00
2009-03-09 22:59:29 +01:00
/*
* Actions
*/
2024-11-10 11:16:23 +01:00
$error = 0 ;
2009-03-09 22:59:29 +01:00
2021-02-26 14:25:17 +01:00
if ( GETPOST ( 'cancel' , 'alpha' )) {
2023-05-11 11:03:26 +02:00
$action = 'list' ;
$massaction = '' ;
2021-02-26 14:25:17 +01:00
}
if ( ! GETPOST ( 'confirmmassaction' , 'alpha' ) && $massaction != 'presend' && $massaction != 'confirm_presend' ) {
$massaction = '' ;
}
2024-04-11 20:07:13 +02:00
$parameters = array ( 'arrayfields' => & $arrayfields );
2019-11-12 09:46:08 +01:00
$reshook = $hookmanager -> executeHooks ( 'doActions' , $parameters , $object , $action ); // Note that $action and $object may have been modified by some hooks
2021-02-26 14:25:17 +01:00
if ( $reshook < 0 ) {
setEventMessages ( $hookmanager -> error , $hookmanager -> errors , 'errors' );
}
2015-10-29 22:12:11 +01:00
2020-12-23 23:48:45 +01:00
$rightskey = 'produit' ;
2021-02-26 14:25:17 +01:00
if ( $type == Product :: TYPE_SERVICE ) {
$rightskey = 'service' ;
}
2020-12-23 23:48:45 +01:00
2021-02-26 14:25:17 +01:00
if ( empty ( $reshook )) {
2017-10-13 13:28:26 +02:00
// Selection of new fields
include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php' ;
// Purge search criteria
2021-02-26 14:25:17 +01:00
if ( GETPOST ( 'button_removefilter_x' , 'alpha' ) || GETPOST ( 'button_removefilter.x' , 'alpha' ) || GETPOST ( 'button_removefilter' , 'alpha' )) { // All tests are required to be compatible with all browsers
2024-04-03 17:50:24 +02:00
$search_all = " " ;
2021-06-13 13:29:15 +02:00
$search_id = '' ;
2019-11-12 09:46:08 +01:00
$search_ref = " " ;
2025-01-12 18:00:01 +01:00
$search_ref_ext = " " ;
2021-03-19 09:34:40 +01:00
$search_ref_supplier = " " ;
2019-11-12 09:46:08 +01:00
$search_label = " " ;
2023-03-22 17:32:13 +01:00
$search_default_workstation = " " ;
2019-11-12 09:46:08 +01:00
$search_barcode = " " ;
2020-09-07 10:18:17 +02:00
$searchCategoryProductOperator = 0 ;
$searchCategoryProductList = array ();
2019-11-12 09:46:08 +01:00
$search_tosell = " " ;
$search_tobuy = " " ;
$search_tobatch = '' ;
2020-09-16 12:34:07 +02:00
$search_country = " " ;
$search_state = " " ;
2019-11-12 09:46:08 +01:00
$search_vatrate = " " ;
2020-10-14 16:39:42 +02:00
$search_finished = '' ;
2018-04-12 23:42:06 +02:00
//$search_type=''; // There is 2 types of list: a list of product and a list of services. No list with both. So when we clear search criteria, we must keep the filter on type.
2018-10-11 15:44:23 +02:00
$show_childproducts = '' ;
2024-05-31 15:46:24 +02:00
$search_import_key = '' ;
2019-11-12 09:46:08 +01:00
$search_accountancy_code_sell = '' ;
$search_accountancy_code_sell_intra = '' ;
$search_accountancy_code_sell_export = '' ;
$search_accountancy_code_buy = '' ;
2020-03-01 04:52:12 +01:00
$search_accountancy_code_buy_intra = '' ;
$search_accountancy_code_buy_export = '' ;
2019-11-12 09:46:08 +01:00
$search_array_options = array ();
2020-10-27 16:31:22 +01:00
$search_units = '' ;
2017-10-13 13:28:26 +02:00
}
// Mass actions
2019-11-12 09:46:08 +01:00
$objectclass = 'Product' ;
2021-02-26 14:25:17 +01:00
if (( string ) $search_type == '1' ) {
$objectlabel = 'Services' ;
}
if (( string ) $search_type == '0' ) {
$objectlabel = 'Products' ;
}
2017-10-13 13:28:26 +02:00
2023-05-16 15:36:27 +02:00
$permissiontoread = $user -> hasRight ( $rightskey , 'lire' );
$permissiontodelete = $user -> hasRight ( $rightskey , 'supprimer' );
$permissiontoadd = $user -> hasRight ( $rightskey , 'creer' );
2017-10-13 13:28:26 +02:00
$uploaddir = $conf -> product -> dir_output ;
include DOL_DOCUMENT_ROOT . '/core/actions_massactions.inc.php' ;
2021-12-06 02:48:34 +01:00
2024-11-10 11:16:23 +01:00
if ( $massaction == 'switchonsalestatus' && $permissiontoadd ) {
2021-12-06 02:48:34 +01:00
$product = new Product ( $db );
foreach ( $toselect as $toselectid ) {
$result = $product -> fetch ( $toselectid );
if ( $result > 0 && $product -> id > 0 ) {
2022-09-15 15:11:19 +02:00
if ( $product -> setStatut ( $product -> status ? 0 : 1 , null , 'product' , 'PRODUCT_MODIFY' , 'tosell' ) < 0 ) {
setEventMessages ( $product -> error , $product -> errors , 'errors' );
}
2021-12-06 02:48:34 +01:00
}
}
}
2024-11-10 11:16:23 +01:00
if ( $massaction == 'switchonpurchasestatus' && $permissiontoadd ) {
2021-12-06 02:48:34 +01:00
$product = new Product ( $db );
foreach ( $toselect as $toselectid ) {
$result = $product -> fetch ( $toselectid );
if ( $result > 0 && $product -> id > 0 ) {
2022-09-15 15:11:19 +02:00
if ( $product -> setStatut ( $product -> status_buy ? 0 : 1 , null , 'product' , 'PRODUCT_MODIFY' , 'tobuy' ) < 0 ) {
setEventMessages ( $product -> error , $product -> errors , 'errors' );
}
2021-12-06 02:48:34 +01:00
}
}
}
2004-10-31 17:02:47 +01:00
}
2009-08-12 15:07:49 +02:00
2004-08-13 23:25:54 +02:00
/*
2009-08-12 15:07:49 +02:00
* View
2004-08-13 23:25:54 +02:00
*/
2023-05-11 11:03:26 +02:00
$product_static = new Product ( $db );
2025-02-08 21:53:48 +01:00
$workstation_static = null ;
2023-09-05 17:01:04 +02:00
if ( isModEnabled ( 'workstation' )) {
$workstation_static = new Workstation ( $db );
}
2023-05-11 11:03:26 +02:00
$product_fourn = new ProductFournisseur ( $db );
2022-07-13 00:59:39 +02:00
$title = $langs -> trans ( " ProductsAndServices " );
2018-06-22 14:51:47 +02:00
2021-02-26 14:25:17 +01:00
if ( $search_type != '' && $search_type != '-1' ) {
if ( $search_type == 1 ) {
2022-07-13 00:59:39 +02:00
$title = $langs -> trans ( " Services " );
2020-05-21 15:05:19 +02:00
} else {
2022-07-13 00:59:39 +02:00
$title = $langs -> trans ( " Products " );
2018-06-22 14:51:47 +02:00
}
}
2023-05-11 11:03:26 +02:00
// Build and execute select
// --------------------------------------------------------------------
2025-01-12 20:03:05 +01:00
$sql = 'SELECT p.rowid, p.ref, p.ref_ext, p.description, p.label, p.fk_product_type, p.barcode, p.price, p.tva_tx, p.price_ttc, p.price_base_type, p.entity,' ;
2020-02-10 14:34:00 +01:00
$sql .= ' p.fk_product_type, p.duration, p.finished, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock,' ;
2023-03-22 16:29:18 +01:00
$sql .= ' p.tobatch, ' ;
if ( isModEnabled ( 'workstation' )) {
$sql .= ' p.fk_default_workstation, ws.status as status_workstation, ws.ref as ref_workstation, ' ;
}
2023-11-27 11:56:32 +01:00
if ( ! getDolGlobalString ( 'MAIN_PRODUCT_PERENTITY_SHARED' )) {
2021-03-20 07:42:16 +01:00
$sql .= " p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export, p.accountancy_code_buy, p.accountancy_code_buy_intra, p.accountancy_code_buy_export, " ;
} else {
2021-04-14 04:45:17 +02:00
$sql .= " ppe.accountancy_code_sell, ppe.accountancy_code_sell_intra, ppe.accountancy_code_sell_export, ppe.accountancy_code_buy, ppe.accountancy_code_buy_intra, ppe.accountancy_code_buy_export, " ;
2021-03-20 07:42:16 +01:00
}
2024-02-15 14:08:08 +01:00
$sql .= ' p.datec as date_creation, p.tms as date_modification, p.pmp, p.stock, p.cost_price,' ;
2024-02-09 15:02:02 +01:00
$sql .= ' p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units,' ;
$sql .= ' p.fk_country, p.fk_state,' ;
$sql .= ' p.import_key,' ;
2023-08-26 22:18:49 +02:00
if ( getDolGlobalString ( 'PRODUCT_USE_UNITS' )) {
2021-02-26 14:25:17 +01:00
$sql .= ' p.fk_unit, cu.label as cu_label,' ;
}
2022-11-08 22:28:59 +01:00
$sql .= ' MIN(pfp.unitprice) as bestpurchaseprice' ;
2023-08-26 21:46:10 +02:00
if ( isModEnabled ( 'variants' )) {
2022-11-08 19:22:54 +01:00
$sql .= ', pac.rowid as prod_comb_id' ;
2022-04-20 13:57:09 +02:00
$sql .= ', pac.fk_product_parent' ;
2018-06-22 14:51:47 +02:00
}
// Add fields from extrafields
2019-11-12 09:46:08 +01:00
if ( ! empty ( $extrafields -> attributes [ $object -> table_element ][ 'label' ])) {
2021-02-26 14:25:17 +01:00
foreach ( $extrafields -> attributes [ $object -> table_element ][ 'label' ] as $key => $val ) {
2021-08-27 22:42:04 +02:00
$sql .= ( $extrafields -> attributes [ $object -> table_element ][ 'type' ][ $key ] != 'separate' ? " , ef. " . $key . " as options_ " . $key : '' );
2021-02-26 14:25:17 +01:00
}
2018-06-22 14:51:47 +02:00
}
// Add fields from hooks
2019-11-12 09:46:08 +01:00
$parameters = array ();
2022-03-17 09:51:44 +01:00
$reshook = $hookmanager -> executeHooks ( 'printFieldListSelect' , $parameters , $object , $action ); // Note that $action and $object may have been modified by hook
2019-11-12 09:46:08 +01:00
$sql .= $hookmanager -> resPrint ;
2023-05-11 11:03:26 +02:00
$sql = preg_replace ( '/,\s*$/' , '' , $sql );
2022-11-18 16:14:14 +01:00
$sqlfields = $sql ; // $sql fields to remove for count total
2019-11-12 09:46:08 +01:00
$sql .= ' FROM ' . MAIN_DB_PREFIX . 'product as p' ;
2023-03-22 16:29:18 +01:00
if ( isModEnabled ( 'workstation' )) {
2023-09-19 17:29:24 +02:00
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . " workstation_workstation as ws ON (p.fk_default_workstation = ws.rowid) " ;
2023-03-22 16:29:18 +01:00
}
2023-11-27 11:56:32 +01:00
if ( getDolGlobalString ( 'MAIN_PRODUCT_PERENTITY_SHARED' )) {
2021-04-14 04:45:17 +02:00
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . " product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . (( int ) $conf -> entity );
2021-03-20 07:42:16 +01:00
}
2021-10-23 19:09:23 +02:00
if ( ! empty ( $extrafields -> attributes [ $object -> table_element ][ 'label' ]) && is_array ( $extrafields -> attributes [ $object -> table_element ][ 'label' ]) && count ( $extrafields -> attributes [ $object -> table_element ][ 'label' ])) {
2021-02-26 14:25:17 +01:00
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . " product_extrafields as ef on (p.rowid = ef.fk_object) " ;
}
2022-11-08 19:22:54 +01:00
$linktopfp = " LEFT JOIN " . MAIN_DB_PREFIX . " product_fournisseur_price as pfp ON p.rowid = pfp.fk_product " ;
$sql .= $linktopfp ;
2018-06-22 14:51:47 +02:00
// multilang
2022-09-24 14:52:21 +02:00
if ( getDolGlobalInt ( 'MAIN_MULTILANGS' )) {
2021-02-26 14:25:17 +01:00
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . " product_lang as pl ON pl.fk_product = p.rowid AND pl.lang = ' " . $db -> escape ( $langs -> getDefaultLang ()) . " ' " ;
}
2023-08-26 21:46:10 +02:00
if ( isModEnabled ( 'variants' )) {
2018-10-11 12:36:10 +02:00
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . " product_attribute_combination pac ON pac.fk_product_child = p.rowid " ;
}
2023-08-26 22:18:49 +02:00
if ( getDolGlobalString ( 'PRODUCT_USE_UNITS' )) {
2021-02-26 14:25:17 +01:00
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . " c_units cu ON cu.rowid = p.fk_unit " ;
}
2018-10-11 12:36:10 +02:00
2024-03-25 15:39:02 +01:00
// Add table from hooks
$parameters = array ();
$reshook = $hookmanager -> executeHooks ( 'printFieldListFrom' , $parameters , $object , $action ); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager -> resPrint ;
2019-11-12 09:46:08 +01:00
$sql .= ' WHERE p.entity IN (' . getEntity ( 'product' ) . ')' ;
2024-04-03 17:50:24 +02:00
if ( $search_all ) {
2023-09-19 17:29:24 +02:00
// Clean $fieldstosearchall
$newfieldstosearchall = $fieldstosearchall ;
unset ( $newfieldstosearchall [ 'pfp.ref_fourn' ]);
unset ( $newfieldstosearchall [ 'pfp.barcode' ]);
2022-11-17 12:39:24 +01:00
$sql .= ' AND (' ;
2024-04-03 17:50:24 +02:00
$sql .= natural_search ( array_keys ( $newfieldstosearchall ), $search_all , 0 , 1 );
2022-11-17 12:39:24 +01:00
// Search also into a supplier reference 'pfp.ref_fourn'="RefSupplier"
$sql .= ' OR EXISTS (SELECT rowid FROM ' . MAIN_DB_PREFIX . 'product_fournisseur_price as pfp WHERE pfp.fk_product = p.rowid' ;
2024-04-03 17:50:24 +02:00
$sql .= ' AND (' . natural_search ( 'pfp.ref_fourn' , $search_all , 0 , 1 );
2022-11-17 12:39:24 +01:00
if ( isModEnabled ( 'barcode' )) {
// Search also into a supplier barcode 'pfp.barcode'='GencodBuyPrice';
2024-04-03 17:50:24 +02:00
$sql .= ' OR ' . natural_search ( 'pfp.barcode' , $search_all , 0 , 1 );
2022-11-17 12:39:24 +01:00
}
$sql .= ')))' ;
2021-02-26 14:25:17 +01:00
}
2018-06-22 14:51:47 +02:00
// if the type is not 1, we show all products (type = 0,2,3)
2021-02-26 14:25:17 +01:00
if ( dol_strlen ( $search_type ) && $search_type != '-1' ) {
if ( $search_type == 1 ) {
$sql .= " AND p.fk_product_type = 1 " ;
} else {
$sql .= " AND p.fk_product_type <> 1 " ;
}
2018-06-22 14:51:47 +02:00
}
2006-12-09 12:37:36 +01:00
2023-08-26 22:18:49 +02:00
if ( isModEnabled ( 'variants' ) && ! $show_childproducts ) {
2018-10-11 12:36:10 +02:00
$sql .= " AND pac.rowid IS NULL " ;
}
2021-06-13 13:29:15 +02:00
if ( $search_id ) {
$sql .= natural_search ( 'p.rowid' , $search_id , 1 );
}
2021-02-26 14:25:17 +01:00
if ( $search_ref ) {
$sql .= natural_search ( 'p.ref' , $search_ref );
}
2025-01-12 18:00:01 +01:00
if ( $search_ref_ext ) {
$sql .= natural_search ( 'p.ref_ext' , $search_ref_ext );
}
2021-02-26 14:25:17 +01:00
if ( $search_label ) {
$sql .= natural_search ( 'p.label' , $search_label );
}
2023-03-22 17:32:13 +01:00
if ( $search_default_workstation ) {
$sql .= natural_search ( 'ws.ref' , $search_default_workstation );
}
2021-02-26 14:25:17 +01:00
if ( $search_barcode ) {
$sql .= natural_search ( 'p.barcode' , $search_barcode );
}
2024-05-31 15:46:24 +02:00
if ( $search_import_key ) {
$sql .= natural_search ( 'p.import_key' , $search_import_key );
}
2021-02-26 14:25:17 +01:00
if ( isset ( $search_tosell ) && dol_strlen ( $search_tosell ) > 0 && $search_tosell != - 1 ) {
$sql .= " AND p.tosell = " . (( int ) $search_tosell );
}
if ( isset ( $search_tobuy ) && dol_strlen ( $search_tobuy ) > 0 && $search_tobuy != - 1 ) {
$sql .= " AND p.tobuy = " . (( int ) $search_tobuy );
}
if ( isset ( $search_tobatch ) && dol_strlen ( $search_tobatch ) > 0 && $search_tobatch != - 1 ) {
$sql .= " AND p.tobatch = " . (( int ) $search_tobatch );
}
if ( $search_vatrate ) {
$sql .= natural_search ( 'p.tva_tx' , $search_vatrate , 1 );
}
if ( dol_strlen ( $canvas ) > 0 ) {
$sql .= " AND p.canvas = ' " . $db -> escape ( $canvas ) . " ' " ;
}
2024-12-24 00:27:15 +01:00
2022-10-10 23:49:41 +02:00
// Search for tag/category ($searchCategoryProductList is an array of ID)
if ( ! empty ( $searchCategoryProductList )) {
$searchCategoryProductSqlList = array ();
$listofcategoryid = '' ;
2020-09-07 10:18:17 +02:00
foreach ( $searchCategoryProductList as $searchCategoryProduct ) {
if ( intval ( $searchCategoryProduct ) == - 2 ) {
2022-10-10 23:49:41 +02:00
$searchCategoryProductSqlList [] = " NOT EXISTS (SELECT ck.fk_product FROM " . MAIN_DB_PREFIX . " categorie_product as ck WHERE p.rowid = ck.fk_product) " ;
2020-09-07 10:18:17 +02:00
} elseif ( intval ( $searchCategoryProduct ) > 0 ) {
2022-10-31 08:13:11 +01:00
if ( $searchCategoryProductOperator == 0 ) {
$searchCategoryProductSqlList [] = " EXISTS (SELECT ck.fk_product FROM " . MAIN_DB_PREFIX . " categorie_product as ck WHERE p.rowid = ck.fk_product AND ck.fk_categorie = " . (( int ) $searchCategoryProduct ) . " ) " ;
} else {
$listofcategoryid .= ( $listofcategoryid ? ', ' : '' ) . (( int ) $searchCategoryProduct );
}
2020-09-07 10:18:17 +02:00
}
}
2022-10-10 23:49:41 +02:00
if ( $listofcategoryid ) {
$searchCategoryProductSqlList [] = " EXISTS (SELECT ck.fk_product FROM " . MAIN_DB_PREFIX . " categorie_product as ck WHERE p.rowid = ck.fk_product AND ck.fk_categorie IN ( " . $db -> sanitize ( $listofcategoryid ) . " )) " ;
2020-09-07 10:18:17 +02:00
}
2022-10-10 23:49:41 +02:00
if ( $searchCategoryProductOperator == 1 ) {
if ( ! empty ( $searchCategoryProductSqlList )) {
$sql .= " AND ( " . implode ( ' OR ' , $searchCategoryProductSqlList ) . " ) " ;
}
} else {
if ( ! empty ( $searchCategoryProductSqlList )) {
$sql .= " AND ( " . implode ( ' AND ' , $searchCategoryProductSqlList ) . " ) " ;
2020-09-07 10:18:17 +02:00
}
}
2019-09-13 12:23:34 +02:00
}
2021-02-26 14:25:17 +01:00
if ( $fourn_id > 0 ) {
$sql .= " AND pfp.fk_soc = " . (( int ) $fourn_id );
}
if ( $search_country ) {
2021-03-22 13:31:06 +01:00
$sql .= " AND p.fk_country = " . (( int ) $search_country );
2021-02-26 14:25:17 +01:00
}
if ( $search_state ) {
2021-03-22 13:31:06 +01:00
$sql .= " AND p.fk_state = " . (( int ) $search_state );
2021-02-26 14:25:17 +01:00
}
if ( $search_finished >= 0 && $search_finished !== '' ) {
2021-03-22 13:31:06 +01:00
$sql .= " AND p.finished = " . (( int ) $search_finished );
2021-02-26 14:25:17 +01:00
}
if ( $search_accountancy_code_sell ) {
2023-05-08 21:50:44 +02:00
$sql .= natural_search ( $alias_product_perentity . '.accountancy_code_sell' , clean_account ( $search_accountancy_code_sell ));
2021-02-26 14:25:17 +01:00
}
if ( $search_accountancy_code_sell_intra ) {
2023-05-08 21:50:44 +02:00
$sql .= natural_search ( $alias_product_perentity . '.accountancy_code_sell_intra' , clean_account ( $search_accountancy_code_sell_intra ));
2021-02-26 14:25:17 +01:00
}
if ( $search_accountancy_code_sell_export ) {
2023-05-08 21:50:44 +02:00
$sql .= natural_search ( $alias_product_perentity . '.accountancy_code_sell_export' , clean_account ( $search_accountancy_code_sell_export ));
2021-02-26 14:25:17 +01:00
}
if ( $search_accountancy_code_buy ) {
2023-05-08 21:50:44 +02:00
$sql .= natural_search ( $alias_product_perentity . '.accountancy_code_buy' , clean_account ( $search_accountancy_code_buy ));
2021-02-26 14:25:17 +01:00
}
if ( $search_accountancy_code_buy_intra ) {
2023-05-08 21:50:44 +02:00
$sql .= natural_search ( $alias_product_perentity . '.accountancy_code_buy_intra' , clean_account ( $search_accountancy_code_buy_intra ));
2021-02-26 14:25:17 +01:00
}
if ( $search_accountancy_code_buy_export ) {
2023-05-08 21:50:44 +02:00
$sql .= natural_search ( $alias_product_perentity . '.accountancy_code_buy_export' , clean_account ( $search_accountancy_code_buy_export ));
2021-02-26 14:25:17 +01:00
}
2025-02-05 11:14:23 +01:00
if ( getDolGlobalString ( 'PRODUCT_USE_UNITS' ) && ! empty ( $search_units ) && $search_units != '-1' && $search_units !== 'none' ) {
2023-03-18 14:37:48 +01:00
$sql .= natural_search ( 'cu.rowid' , $search_units );
2023-03-18 11:10:42 +01:00
}
2024-12-24 00:27:15 +01:00
2018-06-22 14:51:47 +02:00
// Add where from extra fields
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_sql.tpl.php' ;
// Add where from hooks
2019-11-12 09:46:08 +01:00
$parameters = array ();
2022-03-17 09:51:44 +01:00
$reshook = $hookmanager -> executeHooks ( 'printFieldListWhere' , $parameters , $object , $action ); // Note that $action and $object may have been modified by hook
2019-11-12 09:46:08 +01:00
$sql .= $hookmanager -> resPrint ;
2023-10-14 14:22:15 +02:00
$sql .= " GROUP BY p.rowid, p.ref, p.description, p.label, p.barcode, p.price, p.tva_tx, p.price_ttc, p.price_base_type, " ;
2020-02-10 14:34:00 +01:00
$sql .= " p.fk_product_type, p.duration, p.finished, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock, " ;
2021-03-20 07:42:16 +01:00
$sql .= ' p.datec, p.tms, p.entity, p.tobatch, p.pmp, p.cost_price, p.stock,' ;
2023-11-27 11:56:32 +01:00
if ( ! getDolGlobalString ( 'MAIN_PRODUCT_PERENTITY_SHARED' )) {
2021-03-20 07:42:16 +01:00
$sql .= " p.accountancy_code_sell, p.accountancy_code_sell_intra, p.accountancy_code_sell_export, p.accountancy_code_buy, p.accountancy_code_buy_intra, p.accountancy_code_buy_export, " ;
} else {
2021-04-14 04:50:23 +02:00
$sql .= " ppe.accountancy_code_sell, ppe.accountancy_code_sell_intra, ppe.accountancy_code_sell_export, ppe.accountancy_code_buy, ppe.accountancy_code_buy_intra, ppe.accountancy_code_buy_export, " ;
2021-03-20 07:42:16 +01:00
}
2024-02-09 15:02:02 +01:00
$sql .= ' p.weight, p.weight_units, p.length, p.length_units, p.width, p.width_units, p.height, p.height_units, p.surface, p.surface_units, p.volume, p.volume_units,' ;
$sql .= ' p.fk_country, p.fk_state,' ;
$sql .= ' p.import_key' ;
2023-08-26 22:18:49 +02:00
if ( getDolGlobalString ( 'PRODUCT_USE_UNITS' )) {
2021-02-26 14:25:17 +01:00
$sql .= ', p.fk_unit, cu.label' ;
}
2023-03-23 09:43:30 +01:00
if ( isModEnabled ( 'workstation' )) {
2023-08-26 22:18:49 +02:00
$sql .= ', p.fk_default_workstation, ws.status, ws.ref' ;
2023-03-23 09:43:30 +01:00
}
2023-08-26 21:47:05 +02:00
if ( isModEnabled ( 'variants' )) {
2018-10-11 15:44:23 +02:00
$sql .= ', pac.rowid' ;
2022-04-20 13:57:09 +02:00
$sql .= ', pac.fk_product_parent' ;
2018-10-11 15:44:23 +02:00
}
2018-06-22 14:51:47 +02:00
// Add fields from extrafields
2019-11-12 09:46:08 +01:00
if ( ! empty ( $extrafields -> attributes [ $object -> table_element ][ 'label' ])) {
2021-02-26 14:25:17 +01:00
foreach ( $extrafields -> attributes [ $object -> table_element ][ 'label' ] as $key => $val ) {
$sql .= ( $extrafields -> attributes [ $object -> table_element ][ 'type' ][ $key ] != 'separate' ? " , ef. " . $key : '' );
}
2018-06-22 14:51:47 +02:00
}
2023-05-11 11:03:26 +02:00
// Add groupby from hooks
2019-11-12 09:46:08 +01:00
$parameters = array ();
2023-05-11 11:03:26 +02:00
$reshook = $hookmanager -> executeHooks ( 'printFieldListGroupBy' , $parameters , $object , $action ); // Note that $action and $object may have been modified by hook
2019-11-12 09:46:08 +01:00
$sql .= $hookmanager -> resPrint ;
2018-06-22 14:51:47 +02:00
//if (GETPOST("toolowstock")) $sql.= " HAVING SUM(s.reel) < p.seuil_stock_alerte"; // Not used yet
2006-12-09 12:37:36 +01:00
2018-06-22 14:51:47 +02:00
$nbtotalofrecords = '' ;
2023-04-28 16:05:25 +02:00
if ( ! getDolGlobalInt ( 'MAIN_DISABLE_FULL_SCANLIST' )) {
2022-11-08 19:22:54 +01:00
/* The fast and low memory method to get and count full list converts the sql into a sql count */
2022-11-23 13:00:50 +01:00
$sqlforcount = preg_replace ( '/^' . preg_quote ( $sqlfields , '/' ) . '/' , 'SELECT COUNT(*) as nbtotalofrecords' , $sql );
2022-11-08 19:22:54 +01:00
$sqlforcount = preg_replace ( '/' . preg_quote ( $linktopfp , '/' ) . '/' , '' , $sqlforcount );
$sqlforcount = preg_replace ( '/GROUP BY .*$/' , '' , $sqlforcount );
2023-09-19 17:29:24 +02:00
2022-11-08 19:22:54 +01:00
$resql = $db -> query ( $sqlforcount );
if ( $resql ) {
$objforcount = $db -> fetch_object ( $resql );
$nbtotalofrecords = $objforcount -> nbtotalofrecords ;
} else {
dol_print_error ( $db );
}
2023-05-11 11:03:26 +02:00
if (( $page * $limit ) > $nbtotalofrecords ) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
2018-06-22 14:51:47 +02:00
$page = 0 ;
$offset = 0 ;
}
2022-11-26 00:54:49 +01:00
$db -> free ( $resql );
2018-06-22 14:51:47 +02:00
}
2022-11-08 19:22:54 +01:00
// Complete request and execute it with limit
$sql .= $db -> order ( $sortfield , $sortorder );
if ( $limit ) {
$sql .= $db -> plimit ( $limit + 1 , $offset );
}
2018-06-22 14:51:47 +02:00
$resql = $db -> query ( $sql );
2022-11-08 19:22:54 +01:00
if ( ! $resql ) {
dol_print_error ( $db );
exit ;
}
2018-11-29 13:44:10 +01:00
2022-11-08 19:22:54 +01:00
$num = $db -> num_rows ( $resql );
2018-06-22 14:51:47 +02:00
2022-11-08 19:22:54 +01:00
// Direct jump if only one record found
2024-04-03 17:50:24 +02:00
if ( $num == 1 && getDolGlobalString ( 'MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE' ) && $search_all ) {
2022-11-08 19:22:54 +01:00
$obj = $db -> fetch_object ( $resql );
$id = $obj -> rowid ;
header ( " Location: " . DOL_URL_ROOT . '/product/card.php?id=' . $id );
exit ;
}
2005-11-27 22:41:30 +01:00
2023-05-11 11:03:26 +02:00
// Output page
// --------------------------------------------------------------------
2022-11-08 19:22:54 +01:00
$helpurl = '' ;
if ( $search_type != '' ) {
if ( $search_type == 0 ) {
$helpurl = 'EN:Module_Products|FR:Module_Produits|ES:Módulo_Productos' ;
} elseif ( $search_type == 1 ) {
$helpurl = 'EN:Module_Services_En|FR:Module_Services|ES:Módulo_Servicios' ;
2021-02-26 14:25:17 +01:00
}
2022-11-08 19:22:54 +01:00
}
2021-01-06 15:38:30 +01:00
2022-11-08 19:22:54 +01:00
$paramsCat = '' ;
foreach ( $searchCategoryProductList as $searchCategoryProduct ) {
$paramsCat .= " &search_category_product_list[]= " . urlencode ( $searchCategoryProduct );
}
2018-06-22 14:51:47 +02:00
2022-11-08 19:22:54 +01:00
//llxHeader('', $title, $helpurl, '', 0, 0, array(), array(), $paramsCat, 'classforhorizontalscrolloftabs');
2024-07-11 00:45:05 +02:00
llxHeader ( '' , $title , $helpurl , '' , 0 , 0 , array (), array (), $paramsCat , 'bodyforlist mod-product page-list' );
2016-07-23 16:37:21 +02:00
2023-05-11 11:03:26 +02:00
$arrayofselected = is_array ( $toselect ) ? $toselect : array ();
2022-11-08 19:22:54 +01:00
// Displays product removal confirmation
if ( GETPOST ( 'delprod' )) {
setEventMessages ( $langs -> trans ( " ProductDeleted " , GETPOST ( 'delprod' )), null , 'mesgs' );
}
2018-06-22 14:51:47 +02:00
2022-11-08 19:22:54 +01:00
$param = '' ;
2022-12-22 11:11:22 +01:00
if ( ! empty ( $mode )) {
2023-05-11 11:03:26 +02:00
$param .= '&mode=' . urlencode ( $mode );
2022-12-22 11:11:22 +01:00
}
2022-11-08 19:22:54 +01:00
if ( ! empty ( $contextpage ) && $contextpage != $_SERVER [ " PHP_SELF " ]) {
$param .= '&contextpage=' . urlencode ( $contextpage );
}
if ( $limit > 0 && $limit != $conf -> liste_limit ) {
2023-04-08 01:43:21 +02:00
$param .= '&limit=' . (( int ) $limit );
2022-11-08 19:22:54 +01:00
}
2023-05-11 11:03:26 +02:00
if ( $optioncss != '' ) {
$param .= '&optioncss=' . urlencode ( $optioncss );
}
2024-04-03 17:50:24 +02:00
if ( $search_all ) {
$param .= " &search_all= " . urlencode ( $search_all );
2022-11-08 19:22:54 +01:00
}
if ( $searchCategoryProductOperator == 1 ) {
2024-03-08 02:52:23 +01:00
$param .= " &search_category_product_operator= " . urlencode (( string ) ( $searchCategoryProductOperator ));
2022-11-08 19:22:54 +01:00
}
foreach ( $searchCategoryProductList as $searchCategoryProduct ) {
$param .= " &search_category_product_list[]= " . urlencode ( $searchCategoryProduct );
}
if ( $search_ref ) {
2023-11-20 23:47:46 +01:00
$param .= " &search_ref= " . urlencode ( $search_ref );
2022-11-08 19:22:54 +01:00
}
2025-01-12 18:00:01 +01:00
if ( $search_ref_ext ) {
$param .= " &search_ref_ext= " . urlencode ( $search_ref_ext );
}
2022-11-08 19:22:54 +01:00
if ( $search_ref_supplier ) {
2023-11-20 23:47:46 +01:00
$param .= " &search_ref_supplier= " . urlencode ( $search_ref_supplier );
2022-11-08 19:22:54 +01:00
}
if ( $search_barcode ) {
$param .= ( $search_barcode ? " &search_barcode= " . urlencode ( $search_barcode ) : " " );
}
2024-05-31 15:46:24 +02:00
if ( $search_import_key ) {
$param .= " &search_import_key= " . urlencode ( $search_import_key );
}
2022-11-08 19:22:54 +01:00
if ( $search_label ) {
$param .= " &search_label= " . urlencode ( $search_label );
}
2023-03-22 17:32:13 +01:00
if ( $search_default_workstation ) {
$param .= " &search_default_workstation= " . urlencode ( $search_default_workstation );
}
2022-11-08 19:22:54 +01:00
if ( $search_tosell != '' ) {
$param .= " &search_tosell= " . urlencode ( $search_tosell );
}
if ( $search_tobuy != '' ) {
$param .= " &search_tobuy= " . urlencode ( $search_tobuy );
}
if ( $search_tobatch ) {
2023-11-20 23:47:46 +01:00
$param .= " &search_tobatch= " . urlencode ( $search_tobatch );
2022-11-08 19:22:54 +01:00
}
if ( $search_country != '' ) {
2024-03-08 02:52:23 +01:00
$param .= " &search_country= " . urlencode (( string ) ( $search_country ));
2022-11-08 19:22:54 +01:00
}
if ( $search_state != '' ) {
2024-03-08 02:52:23 +01:00
$param .= " &search_state= " . urlencode (( string ) ( $search_state ));
2022-11-08 19:22:54 +01:00
}
if ( $search_vatrate ) {
2023-11-20 23:47:46 +01:00
$param .= " &search_vatrate= " . urlencode ( $search_vatrate );
2022-11-08 19:22:54 +01:00
}
if ( $fourn_id > 0 ) {
2024-03-08 02:52:23 +01:00
$param .= " &fourn_id= " . urlencode (( string ) ( $fourn_id ));
2022-11-08 19:22:54 +01:00
}
if ( $show_childproducts ) {
$param .= ( $show_childproducts ? " &search_show_childproducts= " . urlencode ( $show_childproducts ) : " " );
}
if ( $type != '' ) {
2024-03-08 02:52:23 +01:00
$param .= '&type=' . urlencode (( string ) ( $type ));
2022-11-08 19:22:54 +01:00
}
if ( $search_type != '' ) {
$param .= '&search_type=' . urlencode ( $search_type );
}
if ( $search_accountancy_code_sell ) {
2023-11-20 23:47:46 +01:00
$param .= " &search_accountancy_code_sell= " . urlencode ( $search_accountancy_code_sell );
2022-11-08 19:22:54 +01:00
}
if ( $search_accountancy_code_sell_intra ) {
2023-11-20 23:47:46 +01:00
$param .= " &search_accountancy_code_sell_intra= " . urlencode ( $search_accountancy_code_sell_intra );
2022-11-08 19:22:54 +01:00
}
if ( $search_accountancy_code_sell_export ) {
2023-11-20 23:47:46 +01:00
$param .= " &search_accountancy_code_sell_export= " . urlencode ( $search_accountancy_code_sell_export );
2022-11-08 19:22:54 +01:00
}
if ( $search_accountancy_code_buy ) {
2023-11-20 23:47:46 +01:00
$param .= " &search_accountancy_code_buy= " . urlencode ( $search_accountancy_code_buy );
2022-11-08 19:22:54 +01:00
}
if ( $search_accountancy_code_buy_intra ) {
2023-11-20 23:47:46 +01:00
$param .= " &search_accountancy_code_buy_intra= " . urlencode ( $search_accountancy_code_buy_intra );
2022-11-08 19:22:54 +01:00
}
if ( $search_accountancy_code_buy_export ) {
2023-11-20 23:47:46 +01:00
$param .= " &search_accountancy_code_buy_export= " . urlencode ( $search_accountancy_code_buy_export );
2022-11-08 19:22:54 +01:00
}
if ( $search_finished ) {
2023-11-20 23:47:46 +01:00
$param .= " &search_finished= " . urlencode ( $search_finished );
2022-11-08 19:22:54 +01:00
}
// Add $param from extra fields
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_param.tpl.php' ;
2023-11-20 23:58:08 +01:00
// Add $param from hooks
2024-05-23 14:41:56 +02:00
$parameters = array ( 'param' => & $param );
2023-11-20 23:58:08 +01:00
$reshook = $hookmanager -> executeHooks ( 'printFieldListSearchParam' , $parameters , $object , $action ); // Note that $action and $object may have been modified by hook
$param .= $hookmanager -> resPrint ;
2022-11-08 19:22:54 +01:00
// List of mass actions available
$arrayofmassactions = array (
2024-03-09 16:32:02 +01:00
'generate_doc' => img_picto ( '' , 'pdf' , 'class="pictofixedwidth"' ) . $langs -> trans ( " ReGeneratePDF " ),
'edit_extrafields' => img_picto ( '' , 'edit' , 'class="pictofixedwidth"' ) . $langs -> trans ( " ModifyValueExtrafields " ),
2022-11-08 19:22:54 +01:00
//'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
//'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
);
2023-05-16 15:36:27 +02:00
if ( $user -> hasRight ( $rightskey , 'creer' )) {
2025-01-28 19:31:46 +01:00
if ( getDolGlobalString ( 'PRODUCT_PRICE_UNIQ' )
|| getDolGlobalString ( 'PRODUIT_CUSTOMER_PRICES' )
|| getDolGlobalString ( 'PRODUIT_MULTIPRICES' )) {
2025-01-07 17:23:10 +01:00
$arrayofmassactions [ 'preupdateprice' ] = img_picto ( '' , 'edit' , 'class="pictofixedwidth"' ) . $langs -> trans ( " UpdatePrice " );
}
2022-11-08 19:22:54 +01:00
$arrayofmassactions [ 'switchonsalestatus' ] = img_picto ( '' , 'stop-circle' , 'class="pictofixedwidth"' ) . $langs -> trans ( " SwitchOnSaleStatus " );
$arrayofmassactions [ 'switchonpurchasestatus' ] = img_picto ( '' , 'stop-circle' , 'class="pictofixedwidth"' ) . $langs -> trans ( " SwitchOnPurchaseStatus " );
}
2023-05-16 15:36:27 +02:00
if ( isModEnabled ( 'category' ) && $user -> hasRight ( $rightskey , 'creer' )) {
2022-11-08 19:22:54 +01:00
$arrayofmassactions [ 'preaffecttag' ] = img_picto ( '' , 'category' , 'class="pictofixedwidth"' ) . $langs -> trans ( " AffectTag " );
}
if ( in_array ( $massaction , array ( 'presend' , 'predelete' , 'preaffecttag' , 'edit_extrafields' , 'preupdateprice' ))) {
$arrayofmassactions = array ();
}
2023-10-11 03:02:47 +02:00
if ( $user -> hasRight ( $rightskey , 'supprimer' )) {
$arrayofmassactions [ 'predelete' ] = img_picto ( '' , 'delete' , 'class="pictofixedwidth"' ) . $langs -> trans ( " Delete " );
}
2022-11-08 19:22:54 +01:00
$massactionbutton = $form -> selectMassAction ( '' , $arrayofmassactions );
$newcardbutton = '' ;
2024-03-09 16:32:02 +01:00
$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' ));
$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' ));
2023-01-23 11:57:28 +01:00
2025-02-08 21:53:48 +01:00
$perm = false ;
2022-11-08 19:22:54 +01:00
if ( $type === " " ) {
2023-05-16 15:36:27 +02:00
$perm = ( $user -> hasRight ( 'produit' , 'creer' ) || $user -> hasRight ( 'service' , 'creer' ));
2022-11-08 19:22:54 +01:00
} elseif ( $type == Product :: TYPE_SERVICE ) {
2023-05-16 15:36:27 +02:00
$perm = $user -> hasRight ( 'service' , 'creer' );
2022-11-08 19:22:54 +01:00
} elseif ( $type == Product :: TYPE_PRODUCT ) {
2023-05-16 15:36:27 +02:00
$perm = $user -> hasRight ( 'produit' , 'creer' );
2022-11-08 19:22:54 +01:00
}
2024-03-09 16:32:02 +01:00
$oldtype = $type ;
$params = array ();
2022-11-08 19:22:54 +01:00
if ( $type === " " ) {
$params [ 'forcenohideoftext' ] = 1 ;
}
2023-11-28 09:16:21 +01:00
$newcardbutton .= dolGetButtonTitleSeparator ();
2024-03-24 11:35:18 +01:00
if (( isModEnabled ( 'product' ) && $type === " " ) || $type == Product :: TYPE_PRODUCT ) {
2020-09-18 11:48:53 +02:00
$label = 'NewProduct' ;
2025-02-08 21:53:48 +01:00
$newcardbutton .= dolGetButtonTitle ( $langs -> trans ( $label ), '' , 'fa fa-plus-circle' , DOL_URL_ROOT . '/product/card.php?action=create&type=0' , '' , ( int ) $perm , $params );
2023-09-25 17:44:33 +02:00
}
2024-03-24 11:35:18 +01:00
if (( isModEnabled ( 'service' ) && $type === " " ) || $type == Product :: TYPE_SERVICE ) {
2022-11-08 19:22:54 +01:00
$label = 'NewService' ;
2025-02-08 21:53:48 +01:00
$newcardbutton .= dolGetButtonTitle ( $langs -> trans ( $label ), '' , 'fa fa-plus-circle' , DOL_URL_ROOT . '/product/card.php?action=create&type=1' , '' , ( int ) $perm , $params );
2022-11-08 19:22:54 +01:00
}
2020-09-18 11:48:53 +02:00
2023-05-11 11:03:26 +02:00
print '<form id="searchFormList" action="' . $_SERVER [ " PHP_SELF " ] . '" method="POST" name="formulaire">' ;
2022-11-08 19:22:54 +01:00
if ( $optioncss != '' ) {
print '<input type="hidden" name="optioncss" value="' . $optioncss . '">' ;
}
print '<input type="hidden" name="token" value="' . newToken () . '">' ;
print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">' ;
print '<input type="hidden" name="action" value="list">' ;
print '<input type="hidden" name="sortfield" value="' . $sortfield . '">' ;
print '<input type="hidden" name="sortorder" value="' . $sortorder . '">' ;
//print '<input type="hidden" name="page" value="'.$page.'">';
print '<input type="hidden" name="type" value="' . $type . '">' ;
2023-05-11 11:03:26 +02:00
print '<input type="hidden" name="page_y" value="">' ;
2022-12-22 11:11:22 +01:00
print '<input type="hidden" name="mode" value="' . $mode . '">' ;
2022-11-08 19:22:54 +01:00
if ( empty ( $arrayfields [ 'p.fk_product_type' ][ 'checked' ])) {
print '<input type="hidden" name="search_type" value="' . dol_escape_htmltag ( $search_type ) . '">' ;
}
2005-11-27 22:41:30 +01:00
2022-11-08 19:22:54 +01:00
$picto = 'product' ;
if ( $type == 1 ) {
$picto = 'service' ;
}
2018-06-22 14:51:47 +02:00
2022-11-08 19:22:54 +01:00
print_barre_liste ( $title , $page , $_SERVER [ " PHP_SELF " ], $param , $sortfield , $sortorder , $massactionbutton , $num , $nbtotalofrecords , $picto , 0 , $newcardbutton , '' , $limit , 0 , 0 , 1 );
2020-04-12 21:45:43 +02:00
2022-11-08 19:22:54 +01:00
$topicmail = " Information " ;
$modelmail = " product " ;
$objecttmp = new Product ( $db );
$trackid = 'prod' . $object -> id ;
include DOL_DOCUMENT_ROOT . '/core/tpl/massactions_pre.tpl.php' ;
2018-06-22 14:51:47 +02:00
2022-11-08 19:22:54 +01:00
if ( ! empty ( $catid )) {
print " <div id='ways'> " ;
$c = new Categorie ( $db );
$ways = $c -> print_all_ways ( ' > ' , 'product/list.php' );
print " > " . $ways [ 0 ] . " <br> \n " ;
print " </div><br> " ;
}
2018-06-22 14:51:47 +02:00
2024-04-03 17:50:24 +02:00
if ( $search_all ) {
2022-11-08 19:22:54 +01:00
$setupstring = '' ;
foreach ( $fieldstosearchall as $key => $val ) {
$fieldstosearchall [ $key ] = $langs -> trans ( $val );
$setupstring .= $key . " = " . $val . " ; " ;
2016-07-23 16:37:21 +02:00
}
2022-11-08 19:22:54 +01:00
print '<!-- Search done like if PRODUCT_QUICKSEARCH_ON_FIELDS = ' . $setupstring . ' -->' . " \n " ;
2024-04-03 17:50:24 +02:00
print '<div class="divsearchfieldfilter">' . $langs -> trans ( " FilterOnInto " , $search_all ) . implode ( ', ' , $fieldstosearchall ) . '</div>' . " \n " ;
2022-11-08 19:22:54 +01:00
}
// Filter on categories
$moreforfilter = '' ;
2024-02-27 15:30:37 +01:00
if ( isModEnabled ( 'category' ) && $user -> hasRight ( 'categorie' , 'read' )) {
2022-11-08 19:22:54 +01:00
$formcategory = new FormCategory ( $db );
$moreforfilter .= $formcategory -> getFilterBox ( Categorie :: TYPE_PRODUCT , $searchCategoryProductList , 'minwidth300' , $searchCategoryProductOperator ? $searchCategoryProductOperator : 0 );
}
2023-08-26 22:18:49 +02:00
// Show/hide child variant products
if ( isModEnabled ( 'variants' )) {
2022-11-08 19:22:54 +01:00
$moreforfilter .= '<div class="divsearchfield">' ;
$moreforfilter .= '<input type="checkbox" id="search_show_childproducts" name="search_show_childproducts"' . ( $show_childproducts ? 'checked="checked"' : '' ) . '>' ;
$moreforfilter .= ' <label for="search_show_childproducts">' . $langs -> trans ( 'ShowChildProducts' ) . '</label>' ;
$moreforfilter .= '</div>' ;
}
$parameters = array ();
$reshook = $hookmanager -> executeHooks ( 'printFieldPreListTitle' , $parameters , $object , $action ); // Note that $action and $object may have been modified by hook
if ( empty ( $reshook )) {
$moreforfilter .= $hookmanager -> resPrint ;
} else {
$moreforfilter = $hookmanager -> resPrint ;
}
2023-05-11 11:03:26 +02:00
if ( ! empty ( $moreforfilter )) {
2022-11-08 19:22:54 +01:00
print '<div class="liste_titre liste_titre_bydiv centpercent">' ;
print $moreforfilter ;
print '</div>' ;
}
$varpage = empty ( $contextpage ) ? $_SERVER [ " PHP_SELF " ] : $contextpage ;
2024-04-30 09:45:28 +02:00
$htmlofselectarray = $form -> multiSelectArrayWithCheckbox ( 'selectedfields' , $arrayfields , $varpage , getDolGlobalString ( 'MAIN_CHECKBOX_LEFT_COLUMN' )); // This also change content of $arrayfields with user setup
$selectedfields = ( $mode != 'kanban' ? $htmlofselectarray : '' );
2023-05-11 11:03:26 +02:00
$selectedfields .= ( count ( $arrayofmassactions ) ? $form -> showCheckAddButtons ( 'checkforselect' , 1 ) : '' );
2018-06-22 14:51:47 +02:00
2022-11-08 19:22:54 +01:00
print '<div class="div-table-responsive">' ;
2023-05-11 11:03:26 +02:00
print '<table class="tagtable nobottomiftotal liste' . ( $moreforfilter ? " listwithfilterbefore " : " " ) . '">' . " \n " ;
2022-11-08 19:22:54 +01:00
2023-05-11 11:03:26 +02:00
// Fields title search
// --------------------------------------------------------------------
2022-11-08 19:22:54 +01:00
print '<tr class="liste_titre_filter">' ;
2023-05-11 11:03:26 +02:00
// Action column
if ( getDolGlobalString ( 'MAIN_CHECKBOX_LEFT_COLUMN' )) {
2022-11-08 19:22:54 +01:00
print '<td class="liste_titre center maxwidthsearch">' ;
$searchpicto = $form -> showFilterButtons ( 'left' );
print $searchpicto ;
print '</td>' ;
}
if ( ! empty ( $arrayfields [ 'p.rowid' ][ 'checked' ])) {
print '<td class="liste_titre left">' ;
2025-01-12 18:00:01 +01:00
print '<input class="flat width50" type="text" name="search_id" value="' . dol_escape_htmltag ( $search_id ) . '">' ;
2022-11-08 19:22:54 +01:00
print '</td>' ;
}
if ( ! empty ( $arrayfields [ 'p.ref' ][ 'checked' ])) {
print '<td class="liste_titre left">' ;
2025-01-12 18:00:01 +01:00
print '<input class="flat width75" type="text" name="search_ref" value="' . dol_escape_htmltag ( $search_ref ) . '">' ;
print '</td>' ;
}
if ( ! empty ( $arrayfields [ 'p.ref_ext' ][ 'checked' ])) {
print '<td class="liste_titre left">' ;
print '<input class="flat width75" type="text" name="search_ref_ext" value="' . dol_escape_htmltag ( $search_ref_ext ) . '">' ;
2022-11-08 19:22:54 +01:00
print '</td>' ;
}
if ( ! empty ( $arrayfields [ 'pfp.ref_fourn' ][ 'checked' ])) {
print '<td class="liste_titre left">' ;
2025-01-12 18:00:01 +01:00
print '<input class="flat width75" type="text" name="search_ref_supplier" value="' . dol_escape_htmltag ( $search_ref_supplier ) . '">' ;
2022-11-08 19:22:54 +01:00
print '</td>' ;
}
// Thumbnail
if ( ! empty ( $arrayfields [ 'thumbnail' ][ 'checked' ])) {
print '<td class="liste_titre center">' ;
print '</td>' ;
}
if ( ! empty ( $arrayfields [ 'p.label' ][ 'checked' ])) {
print '<td class="liste_titre left">' ;
2024-06-22 02:30:31 +02:00
print '<input class="flat width100" type="text" name="search_label" value="' . dol_escape_htmltag ( $search_label ) . '">' ;
2022-11-08 19:22:54 +01:00
print '</td>' ;
}
// Type
if ( ! empty ( $arrayfields [ 'p.fk_product_type' ][ 'checked' ])) {
print '<td class="liste_titre center">' ;
2024-03-09 16:32:02 +01:00
$array = array ( '-1' => ' ' , '0' => $langs -> trans ( 'Product' ), '1' => $langs -> trans ( 'Service' ));
2022-11-08 19:22:54 +01:00
print $form -> selectarray ( 'search_type' , $array , $search_type );
print '</td>' ;
}
2023-10-20 12:51:05 +02:00
// Description
if ( ! empty ( $arrayfields [ 'p.description' ][ 'checked' ])) {
print '<td class="liste_titre left">' ;
print '</td>' ;
}
2022-11-08 19:22:54 +01:00
// Barcode
if ( ! empty ( $arrayfields [ 'p.barcode' ][ 'checked' ])) {
print '<td class="liste_titre">' ;
print '<input class="flat" type="text" name="search_barcode" size="6" value="' . dol_escape_htmltag ( $search_barcode ) . '">' ;
print '</td>' ;
}
// Duration
if ( ! empty ( $arrayfields [ 'p.duration' ][ 'checked' ])) {
print '<td class="liste_titre">' ;
print '</td>' ;
}
2023-08-26 21:46:10 +02:00
// Parent
if ( ! empty ( $arrayfields [ 'pac.fk_product_parent' ][ 'checked' ])) {
print '<td class="liste_titre">' ;
print '</td>' ;
}
2022-11-08 19:22:54 +01:00
// Finished
if ( ! empty ( $arrayfields [ 'p.finished' ][ 'checked' ])) {
print '<td class="liste_titre">' ;
print $formproduct -> selectProductNature ( 'search_finished' , $search_finished );
print '</td>' ;
}
// Weight
if ( ! empty ( $arrayfields [ 'p.weight' ][ 'checked' ])) {
print '<td class="liste_titre">' ;
print '</td>' ;
}
// Weight units
if ( ! empty ( $arrayfields [ 'p.weight_units' ][ 'checked' ])) {
print '<td class="liste_titre">' ;
print '</td>' ;
}
// Length
if ( ! empty ( $arrayfields [ 'p.length' ][ 'checked' ])) {
print '<td class="liste_titre">' ;
print '</td>' ;
}
// Length units
if ( ! empty ( $arrayfields [ 'p.length_units' ][ 'checked' ])) {
print '<td class="liste_titre">' ;
print '</td>' ;
}
// Width
if ( ! empty ( $arrayfields [ 'p.width' ][ 'checked' ])) {
print '<td class="liste_titre">' ;
print '</td>' ;
}
// Width units
if ( ! empty ( $arrayfields [ 'p.width_units' ][ 'checked' ])) {
print '<td class="liste_titre">' ;
print '</td>' ;
}
// Height
if ( ! empty ( $arrayfields [ 'p.height' ][ 'checked' ])) {
print '<td class="liste_titre">' ;
print '</td>' ;
}
// Height units
if ( ! empty ( $arrayfields [ 'p.height_units' ][ 'checked' ])) {
print '<td class="liste_titre">' ;
print '</td>' ;
}
// Surface
if ( ! empty ( $arrayfields [ 'p.surface' ][ 'checked' ])) {
print '<td class="liste_titre">' ;
print '</td>' ;
}
// Surface units
if ( ! empty ( $arrayfields [ 'p.surface_units' ][ 'checked' ])) {
print '<td class="liste_titre">' ;
print '</td>' ;
}
// Volume
if ( ! empty ( $arrayfields [ 'p.volume' ][ 'checked' ])) {
print '<td class="liste_titre">' ;
print '</td>' ;
}
// Volume units
if ( ! empty ( $arrayfields [ 'p.volume_units' ][ 'checked' ])) {
print '<td class="liste_titre">' ;
print '</td>' ;
}
// Unit
if ( ! empty ( $arrayfields [ 'cu.label' ][ 'checked' ])) {
print '<td class="liste_titre">' ;
2023-03-18 14:37:48 +01:00
print $form -> selectUnits ( $search_units , 'search_units' , 1 );
2022-11-08 19:22:54 +01:00
print '</td>' ;
}
2023-03-22 16:29:18 +01:00
// Default workstation
2023-03-22 17:32:13 +01:00
if ( ! empty ( $arrayfields [ 'p.fk_default_workstation' ][ 'checked' ])) {
2023-03-22 16:29:18 +01:00
print '<td class="liste_titre">' ;
2023-03-27 18:32:25 +02:00
print '<input class="flat width75" type="text" name="search_default_workstation" value="' . dol_escape_htmltag ( $search_default_workstation ) . '">' ;
2023-03-22 16:29:18 +01:00
print '</td>' ;
}
2022-11-08 19:22:54 +01:00
// Sell price
if ( ! empty ( $arrayfields [ 'p.sellprice' ][ 'checked' ])) {
print '<td class="liste_titre right">' ;
print '</td>' ;
}
// Multiprice
2023-11-27 11:56:32 +01:00
if ( getDolGlobalString ( 'PRODUIT_MULTIPRICES' )) {
2022-11-08 19:22:54 +01:00
foreach ( $arraypricelevel as $key => $value ) {
if ( ! empty ( $arrayfields [ 'p.sellprice' . $key ][ 'checked' ])) {
print '<td class="liste_titre right">' ;
print '</td>' ;
2021-02-26 14:25:17 +01:00
}
2018-06-22 15:43:22 +02:00
}
2022-11-08 19:22:54 +01:00
}
2018-06-22 15:43:22 +02:00
2022-11-08 19:22:54 +01:00
// Minimum buying Price
if ( ! empty ( $arrayfields [ 'p.minbuyprice' ][ 'checked' ])) {
print '<td class="liste_titre">' ;
print ' ' ;
print '</td>' ;
}
// Number buying Price
if ( ! empty ( $arrayfields [ 'p.numbuyprice' ][ 'checked' ])) {
print '<td class="liste_titre">' ;
print ' ' ;
print '</td>' ;
}
2023-11-26 21:41:17 +01:00
// VAT or Sell Tax Rate
2022-11-08 19:22:54 +01:00
if ( ! empty ( $arrayfields [ 'p.tva_tx' ][ 'checked' ])) {
print '<td class="liste_titre right">' ;
print '<input class="right flat maxwidth50" placeholder="%" type="text" name="search_vatrate" size="1" value="' . dol_escape_htmltag ( $search_vatrate ) . '">' ;
print '</td>' ;
}
// WAP
if ( ! empty ( $arrayfields [ 'p.pmp' ][ 'checked' ])) {
print '<td class="liste_titre">' ;
print ' ' ;
print '</td>' ;
}
// cost_price
if ( ! empty ( $arrayfields [ 'p.cost_price' ][ 'checked' ])) {
print '<td class="liste_titre">' ;
print ' ' ;
print '</td>' ;
}
// Limit for alert
if ( ! empty ( $arrayfields [ 'p.seuil_stock_alerte' ][ 'checked' ])) {
print '<td class="liste_titre">' ;
print ' ' ;
print '</td>' ;
}
// Desired stock
if ( ! empty ( $arrayfields [ 'p.desiredstock' ][ 'checked' ])) {
print '<td class="liste_titre">' ;
print ' ' ;
print '</td>' ;
}
// Stock
if ( ! empty ( $arrayfields [ 'p.stock' ][ 'checked' ])) {
print '<td class="liste_titre"> </td>' ;
}
// Stock
if ( ! empty ( $arrayfields [ 'stock_virtual' ][ 'checked' ])) {
print '<td class="liste_titre"> </td>' ;
}
// To batch
if ( ! empty ( $arrayfields [ 'p.tobatch' ][ 'checked' ])) {
print '<td class="liste_titre center">' ;
$statutarray = array (
'-1' => '' ,
'0' => $langs -> trans ( " ProductStatusNotOnBatchShort " ),
'1' => $langs -> trans ( " ProductStatusOnBatchShort " ),
'2' => $langs -> trans ( " ProductStatusOnSerialShort " )
);
print $form -> selectarray ( 'search_tobatch' , $statutarray , $search_tobatch );
print '</td>' ;
}
// Country
if ( ! empty ( $arrayfields [ 'p.fk_country' ][ 'checked' ])) {
print '<td class="liste_titre center">' ;
print $form -> select_country ( $search_country , 'search_country' , '' , 0 );
print '</td>' ;
}
// State
if ( ! empty ( $arrayfields [ 'p.fk_state' ][ 'checked' ])) {
print '<td class="liste_titre center">' ;
2025-02-08 21:53:48 +01:00
print $formcompany -> select_state (( int ) $search_state , $search_country );
2022-11-08 19:22:54 +01:00
print '</td>' ;
}
// Accountancy code sell
if ( ! empty ( $arrayfields [ $alias_product_perentity . '.accountancy_code_sell' ][ 'checked' ])) {
print '<td class="liste_titre"><input class="flat maxwidth75" type="text" name="search_accountancy_code_sell" value="' . dol_escape_htmltag ( $search_accountancy_code_sell ) . '"></td>' ;
}
if ( ! empty ( $arrayfields [ $alias_product_perentity . '.accountancy_code_sell_intra' ][ 'checked' ])) {
print '<td class="liste_titre"><input class="flat maxwidth75" type="text" name="search_accountancy_code_sell_intra" value="' . dol_escape_htmltag ( $search_accountancy_code_sell_intra ) . '"></td>' ;
}
if ( ! empty ( $arrayfields [ $alias_product_perentity . '.accountancy_code_sell_export' ][ 'checked' ])) {
print '<td class="liste_titre"><input class="flat maxwidth75" type="text" name="search_accountancy_code_sell_export" value="' . dol_escape_htmltag ( $search_accountancy_code_sell_export ) . '"></td>' ;
}
// Accountancy code buy
if ( ! empty ( $arrayfields [ $alias_product_perentity . '.accountancy_code_buy' ][ 'checked' ])) {
print '<td class="liste_titre"><input class="flat maxwidth75" type="text" name="search_accountancy_code_buy" value="' . dol_escape_htmltag ( $search_accountancy_code_buy ) . '"></td>' ;
}
if ( ! empty ( $arrayfields [ $alias_product_perentity . '.accountancy_code_buy_intra' ][ 'checked' ])) {
print '<td class="liste_titre"><input class="flat maxwidth75" type="text" name="search_accountancy_code_buy_intra" value="' . dol_escape_htmltag ( $search_accountancy_code_buy_intra ) . '"></td>' ;
}
if ( ! empty ( $arrayfields [ $alias_product_perentity . '.accountancy_code_buy_export' ][ 'checked' ])) {
print '<td class="liste_titre"><input class="flat maxwidth75" type="text" name="search_accountancy_code_buy_export" value="' . dol_escape_htmltag ( $search_accountancy_code_buy_export ) . '"></td>' ;
}
// Extra fields
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_input.tpl.php' ;
// Fields from hook
2024-03-09 16:32:02 +01:00
$parameters = array ( 'arrayfields' => $arrayfields );
2022-11-08 19:22:54 +01:00
$reshook = $hookmanager -> executeHooks ( 'printFieldListOption' , $parameters , $object , $action ); // Note that $action and $object may have been modified by hook
print $hookmanager -> resPrint ;
// Date creation
if ( ! empty ( $arrayfields [ 'p.datec' ][ 'checked' ])) {
print '<td class="liste_titre">' ;
print '</td>' ;
}
// Date modification
if ( ! empty ( $arrayfields [ 'p.tms' ][ 'checked' ])) {
print '<td class="liste_titre">' ;
print '</td>' ;
}
2024-02-09 15:02:02 +01:00
if ( ! empty ( $arrayfields [ 'p.import_key' ][ 'checked' ])) {
print '<td class="liste_titre center">' ;
2024-05-31 15:46:24 +02:00
print '<input class="flat maxwidth75" type="text" name="search_import_key" value="' . dol_escape_htmltag ( $search_import_key ) . '">' ;
2024-02-09 15:02:02 +01:00
print '</td>' ;
}
2022-11-08 19:22:54 +01:00
if ( ! empty ( $arrayfields [ 'p.tosell' ][ 'checked' ])) {
2023-01-05 03:12:52 +01:00
print '<td class="liste_titre center parentonrightofpage">' ;
2024-03-09 16:32:02 +01:00
print $form -> selectarray ( 'search_tosell' , array ( '0' => $langs -> trans ( 'ProductStatusNotOnSellShort' ), '1' => $langs -> trans ( 'ProductStatusOnSellShort' )), $search_tosell , 1 , 0 , 0 , '' , 0 , 0 , 0 , '' , 'search_status width100 onrightofpage' );
2023-01-05 03:12:52 +01:00
print '</td>' ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'p.tobuy' ][ 'checked' ])) {
2023-01-05 03:12:52 +01:00
print '<td class="liste_titre center parentonrightofpage">' ;
2024-03-09 16:32:02 +01:00
print $form -> selectarray ( 'search_tobuy' , array ( '0' => $langs -> trans ( 'ProductStatusNotOnBuyShort' ), '1' => $langs -> trans ( 'ProductStatusOnBuyShort' )), $search_tobuy , 1 , 0 , 0 , '' , 0 , 0 , 0 , '' , 'search_status width100 onrightofpage' );
2022-11-08 19:22:54 +01:00
print '</td>' ;
}
2023-05-11 11:03:26 +02:00
// Action column
if ( ! getDolGlobalString ( 'MAIN_CHECKBOX_LEFT_COLUMN' )) {
2022-11-08 19:22:54 +01:00
print '<td class="liste_titre center maxwidthsearch">' ;
$searchpicto = $form -> showFilterButtons ();
print $searchpicto ;
print '</td>' ;
}
2023-05-11 11:03:26 +02:00
print '</tr>' . " \n " ;
$totalarray = array ();
$totalarray [ 'nbfield' ] = 0 ;
2017-10-13 13:28:26 +02:00
2023-05-11 11:03:26 +02:00
// Fields title label
// --------------------------------------------------------------------
2022-11-08 19:22:54 +01:00
print '<tr class="liste_titre">' ;
2023-05-11 11:03:26 +02:00
// Action column
if ( getDolGlobalString ( 'MAIN_CHECKBOX_LEFT_COLUMN' )) {
2022-11-08 19:22:54 +01:00
print_liste_field_titre ( $selectedfields , $_SERVER [ " PHP_SELF " ], " " , '' , '' , '' , $sortfield , $sortorder , 'center maxwidthsearch ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'p.rowid' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.rowid' ][ 'label' ], $_SERVER [ " PHP_SELF " ], " p.rowid " , " " , $param , " " , $sortfield , $sortorder );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'p.ref' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.ref' ][ 'label' ], $_SERVER [ " PHP_SELF " ], " p.ref " , " " , $param , " " , $sortfield , $sortorder );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
2025-01-12 18:00:01 +01:00
if ( ! empty ( $arrayfields [ 'p.ref_ext' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.ref_ext' ][ 'label' ], $_SERVER [ " PHP_SELF " ], " p.ref_ext " , " " , $param , " " , $sortfield , $sortorder );
$totalarray [ 'nbfield' ] ++ ;
}
2022-11-08 19:22:54 +01:00
if ( ! empty ( $arrayfields [ 'pfp.ref_fourn' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'pfp.ref_fourn' ][ 'label' ], $_SERVER [ " PHP_SELF " ], " pfp.ref_fourn " , " " , $param , " " , $sortfield , $sortorder );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'thumbnail' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'thumbnail' ][ 'label' ], $_SERVER [ " PHP_SELF " ], '' , '' , $param , '' , $sortfield , $sortorder , 'center ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'p.label' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.label' ][ 'label' ], $_SERVER [ " PHP_SELF " ], " p.label " , " " , $param , " " , $sortfield , $sortorder );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'p.fk_product_type' ][ 'checked' ])) {
2024-09-29 21:52:31 +02:00
// @phan-suppress-next-line PhanTypeInvalidDimOffset
2022-11-08 19:22:54 +01:00
print_liste_field_titre ( $arrayfields [ 'p.fk_product_type' ][ 'label' ], $_SERVER [ " PHP_SELF " ], " p.fk_product_type " , " " , $param , " " , $sortfield , $sortorder , 'center ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
2023-11-26 21:41:17 +01:00
if ( ! empty ( $arrayfields [ 'p.description' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.description' ][ 'label' ], $_SERVER [ " PHP_SELF " ], " p.description " , " " , $param , " " , $sortfield , $sortorder );
$totalarray [ 'nbfield' ] ++ ;
}
2022-11-08 19:22:54 +01:00
if ( ! empty ( $arrayfields [ 'p.barcode' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.barcode' ][ 'label' ], $_SERVER [ " PHP_SELF " ], " p.barcode " , " " , $param , " " , $sortfield , $sortorder );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'p.duration' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.duration' ][ 'label' ], $_SERVER [ " PHP_SELF " ], " p.duration " , " " , $param , '' , $sortfield , $sortorder , 'center ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
2023-08-26 21:46:10 +02:00
if ( ! empty ( $arrayfields [ 'pac.fk_product_parent' ][ 'checked' ])) {
2023-08-31 18:26:38 +02:00
print_liste_field_titre ( $arrayfields [ 'pac.fk_product_parent' ][ 'label' ], $_SERVER [ " PHP_SELF " ], " pac.fk_product_parent " , " " , $param , '' , $sortfield , $sortorder , '' , empty ( $arrayfields [ 'pac.fk_product_parent' ][ 'help' ]) ? '' : $arrayfields [ 'pac.fk_product_parent' ][ 'help' ]);
2024-03-28 09:55:37 +01:00
$totalarray [ 'nbfield' ] ++ ;
2023-08-26 21:46:10 +02:00
}
2022-11-08 19:22:54 +01:00
if ( ! empty ( $arrayfields [ 'p.finished' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.finished' ][ 'label' ], $_SERVER [ " PHP_SELF " ], " p.finished " , " " , $param , '' , $sortfield , $sortorder , 'center ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'p.weight' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.weight' ][ 'label' ], $_SERVER [ 'PHP_SELF' ], 'p.weight' , '' , $param , '' , $sortfield , $sortorder , 'center ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'p.weight_units' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.weight_units' ][ 'label' ], $_SERVER [ 'PHP_SELF' ], 'p.weight_units' , '' , $param , '' , $sortfield , $sortorder , 'center ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'p.length' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.length' ][ 'label' ], $_SERVER [ 'PHP_SELF' ], 'p.length' , '' , $param , '' , $sortfield , $sortorder , 'center ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'p.length_units' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.length_units' ][ 'label' ], $_SERVER [ 'PHP_SELF' ], 'p.length_units' , '' , $param , '' , $sortfield , $sortorder , 'center ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'p.width' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.width' ][ 'label' ], $_SERVER [ 'PHP_SELF' ], 'p.width' , '' , $param , '' , $sortfield , $sortorder , 'center ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'p.width_units' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.width_units' ][ 'label' ], $_SERVER [ 'PHP_SELF' ], 'p.width_units' , '' , $param , '' , $sortfield , $sortorder , 'center ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'p.height' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.height' ][ 'label' ], $_SERVER [ 'PHP_SELF' ], 'p.height' , '' , $param , '' , $sortfield , $sortorder , 'center ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'p.height_units' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.height_units' ][ 'label' ], $_SERVER [ 'PHP_SELF' ], 'p.height_units' , '' , $param , '' , $sortfield , $sortorder , 'center ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'p.surface' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.surface' ][ 'label' ], $_SERVER [ 'PHP_SELF' ], " p.surface " , '' , $param , '' , $sortfield , $sortorder , 'center ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'p.surface_units' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.surface_units' ][ 'label' ], $_SERVER [ 'PHP_SELF' ], 'p.surface_units' , '' , $param , '' , $sortfield , $sortorder , 'center ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'p.volume' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.volume' ][ 'label' ], $_SERVER [ 'PHP_SELF' ], 'p.volume' , '' , $param , '' , $sortfield , $sortorder , 'center ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'p.volume_units' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.volume_units' ][ 'label' ], $_SERVER [ 'PHP_SELF' ], 'p.volume_units' , '' , $param , '' , $sortfield , $sortorder , 'center ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'cu.label' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'cu.label' ][ 'label' ], $_SERVER [ 'PHP_SELF' ], '' , '' , $param , '' , $sortfield , $sortorder , 'center ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
2023-03-22 17:32:13 +01:00
if ( ! empty ( $arrayfields [ 'p.fk_default_workstation' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.fk_default_workstation' ][ 'label' ], $_SERVER [ 'PHP_SELF' ], 'ws.ref' , '' , $param , '' , $sortfield , $sortorder );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2023-03-22 16:29:18 +01:00
}
2022-11-08 19:22:54 +01:00
if ( ! empty ( $arrayfields [ 'p.sellprice' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.sellprice' ][ 'label' ], $_SERVER [ " PHP_SELF " ], " " , " " , $param , '' , $sortfield , $sortorder , 'right ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
// Multiprices
2023-11-27 11:56:32 +01:00
if ( getDolGlobalString ( 'PRODUIT_MULTIPRICES' )) {
2022-11-08 19:22:54 +01:00
foreach ( $arraypricelevel as $key => $value ) {
if ( ! empty ( $arrayfields [ 'p.sellprice' . $key ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.sellprice' . $key ][ 'label' ], $_SERVER [ " PHP_SELF " ], " " , " " , $param , '' , $sortfield , $sortorder , 'right ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
2021-02-26 14:25:17 +01:00
}
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'p.minbuyprice' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.minbuyprice' ][ 'label' ], $_SERVER [ " PHP_SELF " ], " " , " " , $param , '' , $sortfield , $sortorder , 'right ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'p.numbuyprice' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.numbuyprice' ][ 'label' ], $_SERVER [ " PHP_SELF " ], " " , " " , $param , '' , $sortfield , $sortorder , 'right ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'p.tva_tx' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.tva_tx' ][ 'label' ], $_SERVER [ " PHP_SELF " ], 'p.tva_tx' , " " , $param , '' , $sortfield , $sortorder , 'right ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'p.pmp' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.pmp' ][ 'label' ], $_SERVER [ " PHP_SELF " ], " " , " " , $param , '' , $sortfield , $sortorder , 'right ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'p.cost_price' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.cost_price' ][ 'label' ], $_SERVER [ " PHP_SELF " ], " " , " " , $param , '' , $sortfield , $sortorder , 'right ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'p.seuil_stock_alerte' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.seuil_stock_alerte' ][ 'label' ], $_SERVER [ " PHP_SELF " ], " p.seuil_stock_alerte " , " " , $param , '' , $sortfield , $sortorder , 'right ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'p.desiredstock' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.desiredstock' ][ 'label' ], $_SERVER [ " PHP_SELF " ], " p.desiredstock " , " " , $param , '' , $sortfield , $sortorder , 'right ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'p.stock' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.stock' ][ 'label' ], $_SERVER [ " PHP_SELF " ], " p.stock " , " " , $param , '' , $sortfield , $sortorder , 'right ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'stock_virtual' ][ 'checked' ])) {
2023-02-15 18:52:36 +01:00
print_liste_field_titre ( $arrayfields [ 'stock_virtual' ][ 'label' ], $_SERVER [ " PHP_SELF " ], " " , " " , $param , '' , $sortfield , $sortorder , 'right ' , 'VirtualStockDesc' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'p.tobatch' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.tobatch' ][ 'label' ], $_SERVER [ " PHP_SELF " ], " p.tobatch " , " " , $param , '' , $sortfield , $sortorder , 'center ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'p.fk_country' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.fk_country' ][ 'label' ], $_SERVER [ " PHP_SELF " ], " p.fk_country " , " " , $param , '' , $sortfield , $sortorder );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'p.fk_state' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.fk_state' ][ 'label' ], $_SERVER [ " PHP_SELF " ], " p.fk_state " , " " , $param , '' , $sortfield , $sortorder );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ $alias_product_perentity . '.accountancy_code_sell' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ $alias_product_perentity . '.accountancy_code_sell' ][ 'label' ], $_SERVER [ " PHP_SELF " ], $alias_product_perentity . " .accountancy_code_sell " , " " , $param , '' , $sortfield , $sortorder );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ $alias_product_perentity . '.accountancy_code_sell_intra' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ $alias_product_perentity . '.accountancy_code_sell_intra' ][ 'label' ], $_SERVER [ " PHP_SELF " ], $alias_product_perentity . " .accountancy_code_sell_intra " , " " , $param , '' , $sortfield , $sortorder );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ $alias_product_perentity . '.accountancy_code_sell_export' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ $alias_product_perentity . '.accountancy_code_sell_export' ][ 'label' ], $_SERVER [ " PHP_SELF " ], $alias_product_perentity . " .accountancy_code_sell_export " , " " , $param , '' , $sortfield , $sortorder );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ $alias_product_perentity . '.accountancy_code_buy' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ $alias_product_perentity . '.accountancy_code_buy' ][ 'label' ], $_SERVER [ " PHP_SELF " ], $alias_product_perentity . " .accountancy_code_buy " , " " , $param , '' , $sortfield , $sortorder );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ $alias_product_perentity . '.accountancy_code_buy_intra' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ $alias_product_perentity . '.accountancy_code_buy_intra' ][ 'label' ], $_SERVER [ " PHP_SELF " ], $alias_product_perentity . " .accountancy_code_buy_intra " , " " , $param , '' , $sortfield , $sortorder );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ $alias_product_perentity . '.accountancy_code_buy_export' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ $alias_product_perentity . '.accountancy_code_buy_export' ][ 'label' ], $_SERVER [ " PHP_SELF " ], $alias_product_perentity . " .accountancy_code_buy_export " , " " , $param , '' , $sortfield , $sortorder );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
// Extra fields
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_title.tpl.php' ;
// Hook fields
2024-03-09 16:32:02 +01:00
$parameters = array ( 'arrayfields' => $arrayfields , 'param' => $param , 'sortfield' => $sortfield , 'sortorder' => $sortorder , 'totalarray' => & $totalarray );
2022-11-08 19:22:54 +01:00
$reshook = $hookmanager -> executeHooks ( 'printFieldListTitle' , $parameters , $object , $action ); // Note that $action and $object may have been modified by hook
print $hookmanager -> resPrint ;
if ( ! empty ( $arrayfields [ 'p.datec' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.datec' ][ 'label' ], $_SERVER [ " PHP_SELF " ], " p.datec " , " " , $param , '' , $sortfield , $sortorder , 'center nowrap ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'p.tms' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.tms' ][ 'label' ], $_SERVER [ " PHP_SELF " ], " p.tms " , " " , $param , '' , $sortfield , $sortorder , 'center nowrap ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
2024-02-09 15:02:02 +01:00
if ( ! empty ( $arrayfields [ 'p.import_key' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.import_key' ][ 'label' ], $_SERVER [ " PHP_SELF " ], " p.import_key " , " " , $param , '' , $sortfield , $sortorder , 'center ' );
$totalarray [ 'nbfield' ] ++ ;
}
2022-11-08 19:22:54 +01:00
if ( ! empty ( $arrayfields [ 'p.tosell' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.tosell' ][ 'label' ], $_SERVER [ " PHP_SELF " ], " p.tosell " , " " , $param , '' , $sortfield , $sortorder , 'center ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
if ( ! empty ( $arrayfields [ 'p.tobuy' ][ 'checked' ])) {
print_liste_field_titre ( $arrayfields [ 'p.tobuy' ][ 'label' ], $_SERVER [ " PHP_SELF " ], " p.tobuy " , " " , $param , '' , $sortfield , $sortorder , 'center ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
2023-05-11 11:03:26 +02:00
// Action column
if ( ! getDolGlobalString ( 'MAIN_CHECKBOX_LEFT_COLUMN' )) {
2022-11-08 19:22:54 +01:00
print_liste_field_titre ( $selectedfields , $_SERVER [ " PHP_SELF " ], " " , '' , '' , '' , $sortfield , $sortorder , 'center maxwidthsearch ' );
2023-05-11 11:03:26 +02:00
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
2023-05-11 11:03:26 +02:00
print '</tr>' . " \n " ;
2022-11-08 19:22:54 +01:00
2023-05-11 11:03:26 +02:00
// Loop on record
// --------------------------------------------------------------------
2022-11-08 19:22:54 +01:00
$i = 0 ;
2023-05-11 11:03:26 +02:00
$savnbfield = $totalarray [ 'nbfield' ];
2022-11-08 19:22:54 +01:00
$totalarray = array ();
$totalarray [ 'nbfield' ] = 0 ;
2023-01-23 11:57:28 +01:00
$imaxinloop = ( $limit ? min ( $num , $limit ) : $num );
2022-12-22 11:15:21 +01:00
while ( $i < $imaxinloop ) {
2022-11-08 19:22:54 +01:00
$obj = $db -> fetch_object ( $resql );
2023-05-11 11:03:26 +02:00
if ( empty ( $obj )) {
break ; // Should not happen
}
2018-06-22 15:43:22 +02:00
2022-11-08 19:22:54 +01:00
// Multilangs
if ( getDolGlobalInt ( 'MAIN_MULTILANGS' )) { // If multilang is enabled
$sql = " SELECT label " ;
$sql .= " FROM " . MAIN_DB_PREFIX . " product_lang " ;
$sql .= " WHERE fk_product = " . (( int ) $obj -> rowid );
$sql .= " AND lang = ' " . $db -> escape ( $langs -> getDefaultLang ()) . " ' " ;
$sql .= " LIMIT 1 " ;
$result = $db -> query ( $sql );
if ( $result ) {
$objtp = $db -> fetch_object ( $result );
if ( ! empty ( $objtp -> label )) {
$obj -> label = $objtp -> label ;
}
}
2018-06-22 15:43:22 +02:00
}
2023-01-23 11:57:28 +01:00
2022-11-15 13:50:33 +01:00
$parameters = array ( 'staticdata' => $obj );
// Note that $action and $object may have been modified by hook
2022-11-15 18:22:39 +01:00
// do product_static fetch in hook if wanted or anything else
2022-11-15 13:50:33 +01:00
$reshook = $hookmanager -> executeHooks ( 'loadStaticObject' , $parameters , $product_static , $action );
2022-11-15 18:22:39 +01:00
if ( empty ( $reshook )) {
2022-11-15 13:50:33 +01:00
$product_static -> id = $obj -> rowid ;
$product_static -> ref = $obj -> ref ;
2025-01-12 20:06:28 +01:00
$product_static -> ref_ext = $obj -> ref_ext ;
2023-10-12 15:39:42 +02:00
$product_static -> description = $obj -> description ;
2022-11-15 13:50:33 +01:00
$product_static -> ref_fourn = empty ( $obj -> ref_supplier ) ? '' : $obj -> ref_supplier ; // deprecated
$product_static -> ref_supplier = empty ( $obj -> ref_supplier ) ? '' : $obj -> ref_supplier ;
$product_static -> label = $obj -> label ;
2023-03-17 22:52:01 +01:00
$product_static -> barcode = $obj -> barcode ;
2022-11-15 13:50:33 +01:00
$product_static -> finished = $obj -> finished ;
$product_static -> type = $obj -> fk_product_type ;
$product_static -> status_buy = $obj -> tobuy ;
$product_static -> status = $obj -> tosell ;
$product_static -> status_batch = $obj -> tobatch ;
$product_static -> entity = $obj -> entity ;
$product_static -> pmp = $obj -> pmp ;
$product_static -> accountancy_code_sell = $obj -> accountancy_code_sell ;
$product_static -> accountancy_code_sell_export = $obj -> accountancy_code_sell_export ;
$product_static -> accountancy_code_sell_intra = $obj -> accountancy_code_sell_intra ;
$product_static -> accountancy_code_buy = $obj -> accountancy_code_buy ;
$product_static -> accountancy_code_buy_intra = $obj -> accountancy_code_buy_intra ;
$product_static -> accountancy_code_buy_export = $obj -> accountancy_code_buy_export ;
$product_static -> length = $obj -> length ;
$product_static -> length_units = $obj -> length_units ;
$product_static -> width = $obj -> width ;
$product_static -> width_units = $obj -> width_units ;
$product_static -> height = $obj -> height ;
$product_static -> height_units = $obj -> height_units ;
$product_static -> weight = $obj -> weight ;
$product_static -> weight_units = $obj -> weight_units ;
$product_static -> volume = $obj -> volume ;
$product_static -> volume_units = $obj -> volume_units ;
$product_static -> surface = $obj -> surface ;
$product_static -> surface_units = $obj -> surface_units ;
2023-11-27 11:56:32 +01:00
if ( getDolGlobalString ( 'PRODUCT_USE_UNITS' )) {
2022-11-15 13:50:33 +01:00
$product_static -> fk_unit = $obj -> fk_unit ;
}
2024-02-09 15:02:02 +01:00
$product_static -> import_key = $obj -> import_key ;
2022-11-15 13:50:33 +01:00
// STOCK_DISABLE_OPTIM_LOAD can be set to force load_stock whatever is permissions on stock.
2023-11-27 11:56:32 +01:00
if (( isModEnabled ( 'stock' ) && $user -> hasRight ( 'stock' , 'lire' ) && $search_type != 1 ) || getDolGlobalString ( 'STOCK_DISABLE_OPTIM_LOAD' )) { // To optimize call of load_stock
if ( $product_static -> type != 1 || getDolGlobalString ( 'STOCK_SUPPORTS_SERVICES' )) { // Not a service
2022-11-15 13:50:33 +01:00
$option = 'nobatch' ;
if ( empty ( $arrayfields [ 'stock_virtual' ][ 'checked' ])) {
$option .= ',novirtual' ;
}
$product_static -> load_stock ( $option ); // Load stock_reel + stock_warehouse. This can also call load_virtual_stock()
2022-11-08 19:22:54 +01:00
}
}
}
2021-06-13 13:29:15 +02:00
2023-05-11 11:03:26 +02:00
$product_static -> price = $obj -> price ;
2025-02-09 22:20:05 +01:00
$product_static -> price_ttc = $obj -> price_ttc ; // Allows to use price_ttc in calculated extra fields (ex : price per kilo)
2023-05-11 11:03:26 +02:00
$object = $product_static ;
2017-10-13 13:28:26 +02:00
2023-12-04 13:49:31 +01:00
$usercancreadprice = getDolGlobalString ( 'MAIN_USE_ADVANCED_PERMS' ) ? $user -> hasRight ( 'product' , 'product_advance' , 'read_prices' ) : $user -> hasRight ( 'product' , 'lire' );
2022-11-08 19:22:54 +01:00
if ( $product_static -> isService ()) {
2023-12-04 13:49:31 +01:00
$usercancreadprice = getDolGlobalString ( 'MAIN_USE_ADVANCED_PERMS' ) ? $user -> hasRight ( 'service' , 'service_advance' , 'read_prices' ) : $user -> hasRight ( 'service' , 'lire' );
2021-02-26 14:25:17 +01:00
}
2023-05-11 11:03:26 +02:00
2023-01-23 11:57:28 +01:00
if ( $mode == 'kanban' ) {
if ( $i == 0 ) {
2023-06-28 11:50:28 +02:00
print '<tr class="trkanban"><td colspan="' . $savnbfield . '">' ;
2023-02-19 02:39:39 +01:00
print '<div class="box-flex-container kanban">' ;
2022-11-08 19:22:54 +01:00
}
2023-04-29 13:04:45 +02:00
2023-01-23 11:57:28 +01:00
// Output Kanban
2023-10-17 15:27:07 +02:00
$selected = - 1 ;
2023-05-11 11:03:26 +02:00
if ( $massactionbutton || $massaction ) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0 ;
if ( in_array ( $object -> id , $arrayofselected )) {
$selected = 1 ;
}
}
2023-10-17 15:27:07 +02:00
print $object -> getKanbanView ( '' , array ( 'selected' => $selected ));
2023-01-23 11:57:28 +01:00
if ( $i == ( $imaxinloop - 1 )) {
print '</div>' ;
print '</td></tr>' ;
2022-11-08 19:22:54 +01:00
}
2023-01-23 11:57:28 +01:00
} else {
2023-05-11 11:03:26 +02:00
// Show line of result
$j = 0 ;
print '<tr data-rowid="' . $object -> id . '" class="oddeven">' ;
2023-01-23 11:57:28 +01:00
// Action column
2023-05-11 11:03:26 +02:00
if ( getDolGlobalString ( 'MAIN_CHECKBOX_LEFT_COLUMN' )) {
2023-01-23 11:57:28 +01:00
print '<td class="nowrap center">' ;
if ( $massactionbutton || $massaction ) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0 ;
2023-05-11 11:03:26 +02:00
if ( in_array ( $object -> id , $arrayofselected )) {
2023-01-23 11:57:28 +01:00
$selected = 1 ;
}
2023-05-11 11:03:26 +02:00
print '<input id="cb' . $object -> id . '" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $obj -> rowid . '"' . ( $selected ? ' checked="checked"' : '' ) . '>' ;
2023-01-23 11:57:28 +01:00
}
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2022-11-08 19:22:54 +01:00
}
2023-03-27 18:32:25 +02:00
// Rowid
2023-01-23 11:57:28 +01:00
if ( ! empty ( $arrayfields [ 'p.rowid' ][ 'checked' ])) {
print '<td class="nowraponall">' ;
print $product_static -> id ;
print " </td> \n " ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2022-11-08 19:22:54 +01:00
}
2023-01-23 11:57:28 +01:00
// Ref
if ( ! empty ( $arrayfields [ 'p.ref' ][ 'checked' ])) {
2023-01-27 02:43:41 +01:00
print '<td class="tdoverflowmax250">' ;
2023-01-23 11:57:28 +01:00
print $product_static -> getNomUrl ( 1 );
print " </td> \n " ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2022-11-08 19:22:54 +01:00
}
2025-01-12 18:00:01 +01:00
// Ref ext
if ( ! empty ( $arrayfields [ 'p.ref_ext' ][ 'checked' ])) {
print '<td class="tdoverflowmax250" title="' . dolPrintHTMLForAttribute ( $product_static -> ref_ext ) . '">' ;
print dolPrintHTML ( $product_static -> ref_ext );
print " </td> \n " ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
}
2023-01-23 11:57:28 +01:00
// Ref supplier
if ( ! empty ( $arrayfields [ 'pfp.ref_fourn' ][ 'checked' ])) {
print '<td class="tdoverflowmax200">' ;
print $product_static -> getNomUrl ( 1 );
print " </td> \n " ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
2022-11-08 19:22:54 +01:00
}
}
2023-01-23 11:57:28 +01:00
// Thumbnail
if ( ! empty ( $arrayfields [ 'thumbnail' ][ 'checked' ])) {
$product_thumbnail_html = '' ;
if ( ! empty ( $product_static -> entity )) {
$product_thumbnail = $product_static -> show_photos ( 'product' , $conf -> product -> multidir_output [ $product_static -> entity ], 1 , 1 , 0 , 0 , 0 , 80 );
if ( $product_static -> nbphoto > 0 ) {
$product_thumbnail_html = $product_thumbnail ;
}
}
2022-11-08 19:22:54 +01:00
2023-01-23 11:57:28 +01:00
print '<td class="center">' . $product_thumbnail_html . '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2022-11-08 19:22:54 +01:00
}
2023-01-23 11:57:28 +01:00
// Label
if ( ! empty ( $arrayfields [ 'p.label' ][ 'checked' ])) {
print '<td class="tdoverflowmax200" title="' . dol_escape_htmltag ( $product_static -> label ) . '">' . $product_static -> label . '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2022-11-08 19:22:54 +01:00
}
2023-01-23 11:57:28 +01:00
// Type
if ( ! empty ( $arrayfields [ 'p.fk_product_type' ][ 'checked' ])) {
print '<td class="center">' ;
$s = '' ;
if ( $product_static -> type == 0 ) {
$s .= img_picto ( $langs -> trans ( " Product " ), 'product' , 'class="paddingleftonly paddingrightonly colorgrey"' );
} else {
$s .= img_picto ( $langs -> trans ( " Service " ), 'service' , 'class="paddingleftonly paddingrightonly colorgrey"' );
}
print $s ;
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2022-11-08 19:22:54 +01:00
}
2023-11-26 21:41:17 +01:00
// Description
if ( ! empty ( $arrayfields [ 'p.description' ][ 'checked' ])) {
print '<td class="left">' ;
// Since description can be very large (several pages of HTML-
// code) we limit to the first two rows
2024-01-12 20:40:34 +01:00
print dolGetFirstLineOfText ( $product_static -> description , 2 );
2023-11-26 21:41:17 +01:00
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
}
2023-01-23 11:57:28 +01:00
// Barcode
if ( ! empty ( $arrayfields [ 'p.barcode' ][ 'checked' ])) {
2024-04-08 12:34:46 +02:00
print '<td class="tdoverflowmax125" title="' . dol_escape_htmltag ( $product_static -> barcode ) . '">' . dol_escape_htmltag ( $product_static -> barcode ) . '</td>' ;
2023-01-23 11:57:28 +01:00
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2022-11-08 19:22:54 +01:00
}
2023-01-23 11:57:28 +01:00
// Duration
if ( ! empty ( $arrayfields [ 'p.duration' ][ 'checked' ])) {
print '<td class="center nowraponall">' ;
2022-11-08 19:22:54 +01:00
2023-01-23 11:57:28 +01:00
if ( preg_match ( '/([^a-z]+)[a-z]$/i' , $obj -> duration )) {
$duration_value = substr ( $obj -> duration , 0 , dol_strlen ( $obj -> duration ) - 1 );
$duration_unit = substr ( $obj -> duration , - 1 );
2022-11-08 19:22:54 +01:00
2023-01-23 11:57:28 +01:00
if (( float ) $duration_value > 1 ) {
2024-03-09 16:32:02 +01:00
$dur = array ( " i " => $langs -> trans ( " Minutes " ), " h " => $langs -> trans ( " Hours " ), " d " => $langs -> trans ( " Days " ), " w " => $langs -> trans ( " Weeks " ), " m " => $langs -> trans ( " Months " ), " y " => $langs -> trans ( " Years " ));
2023-01-23 11:57:28 +01:00
} elseif (( float ) $duration_value > 0 ) {
2024-03-09 16:32:02 +01:00
$dur = array ( " i " => $langs -> trans ( " Minute " ), " h " => $langs -> trans ( " Hour " ), " d " => $langs -> trans ( " Day " ), " w " => $langs -> trans ( " Week " ), " m " => $langs -> trans ( " Month " ), " y " => $langs -> trans ( " Year " ));
2023-01-23 11:57:28 +01:00
}
print $duration_value ;
2023-12-04 13:49:31 +01:00
print (( ! empty ( $duration_unit ) && isset ( $dur [ $duration_unit ]) && $duration_value != '' ) ? ' ' . $langs -> trans ( $dur [ $duration_unit ]) : '' );
2023-01-23 11:57:28 +01:00
} elseif ( ! preg_match ( '/^[a-z]$/i' , $obj -> duration )) { // If duration is a simple char (like 's' of 'm'), we do not show value
print $obj -> duration ;
2022-11-08 19:22:54 +01:00
}
2023-01-23 11:57:28 +01:00
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2022-11-08 19:22:54 +01:00
}
2019-04-04 17:13:52 +02:00
2022-04-20 13:57:09 +02:00
if ( ! empty ( $arrayfields [ 'pac.fk_product_parent' ][ 'checked' ])) {
2023-08-26 22:18:49 +02:00
print '<td class="nowraponall">' ;
2022-04-20 13:57:09 +02:00
if ( $obj -> fk_product_parent > 0 ) {
2023-08-26 22:18:49 +02:00
if ( ! empty ( $conf -> cache [ 'product' ][ $obj -> fk_product_parent ])) {
$product_parent_static = $conf -> cache [ 'product' ][ $obj -> fk_product_parent ];
} else {
2024-03-09 16:32:02 +01:00
$product_parent_static = new Product ( $db );
2023-08-26 22:18:49 +02:00
$product_parent_static -> fetch ( $obj -> fk_product_parent );
$conf -> cache [ 'product' ][ $obj -> fk_product_parent ] = $product_parent_static ;
}
2022-04-20 13:57:09 +02:00
print $product_parent_static -> getNomUrl ( 1 );
}
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
}
2023-01-23 11:57:28 +01:00
// Finished
if ( ! empty ( $arrayfields [ 'p.finished' ][ 'checked' ])) {
print '<td class="center">' ;
print $product_static -> getLibFinished ();
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2022-11-08 19:22:54 +01:00
}
2023-01-23 11:57:28 +01:00
// Weight
if ( ! empty ( $arrayfields [ 'p.weight' ][ 'checked' ])) {
print '<td class="center">' ;
print $product_static -> weight ;
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2020-01-21 10:33:27 +01:00
}
2023-01-23 11:57:28 +01:00
// Weight units
if ( ! empty ( $arrayfields [ 'p.weight_units' ][ 'checked' ])) {
print '<td class="center">' ;
if ( $product_static -> weight != '' ) {
print measuringUnitString ( 0 , 'weight' , $product_static -> weight_units );
}
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2019-04-04 17:06:26 +02:00
}
2023-01-23 11:57:28 +01:00
// Length
if ( ! empty ( $arrayfields [ 'p.length' ][ 'checked' ])) {
print '<td class="center">' ;
print $product_static -> length ;
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2020-01-21 10:33:27 +01:00
}
2023-01-23 11:57:28 +01:00
// Length units
if ( ! empty ( $arrayfields [ 'p.length_units' ][ 'checked' ])) {
print '<td class="center">' ;
if ( $product_static -> length != '' ) {
print measuringUnitString ( 0 , 'size' , $product_static -> length_units );
}
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2020-09-07 10:18:17 +02:00
}
2023-01-23 11:57:28 +01:00
// Width
if ( ! empty ( $arrayfields [ 'p.width' ][ 'checked' ])) {
print '<td align="center">' ;
print $product_static -> width ;
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2020-01-21 10:33:27 +01:00
}
2023-01-23 11:57:28 +01:00
// Width units
if ( ! empty ( $arrayfields [ 'p.width_units' ][ 'checked' ])) {
print '<td class="center">' ;
if ( $product_static -> width != '' ) {
print measuringUnitString ( 0 , 'size' , $product_static -> width_units );
}
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2020-09-07 10:18:17 +02:00
}
2023-01-23 11:57:28 +01:00
// Height
if ( ! empty ( $arrayfields [ 'p.height' ][ 'checked' ])) {
print '<td align="center">' ;
print $product_static -> height ;
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2020-01-21 10:33:27 +01:00
}
2023-01-23 11:57:28 +01:00
// Height units
if ( ! empty ( $arrayfields [ 'p.height_units' ][ 'checked' ])) {
print '<td class="center">' ;
if ( $product_static -> height != '' ) {
print measuringUnitString ( 0 , 'size' , $product_static -> height_units );
}
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2019-04-04 17:06:26 +02:00
}
2023-01-23 11:57:28 +01:00
// Surface
if ( ! empty ( $arrayfields [ 'p.surface' ][ 'checked' ])) {
print '<td class="center">' ;
print $product_static -> surface ;
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2020-01-21 10:33:27 +01:00
}
2023-01-23 11:57:28 +01:00
// Surface units
if ( ! empty ( $arrayfields [ 'p.surface_units' ][ 'checked' ])) {
print '<td class="center">' ;
if ( $product_static -> surface != '' ) {
print measuringUnitString ( 0 , 'surface' , $product_static -> surface_units );
}
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2019-04-04 17:06:26 +02:00
}
2023-01-23 11:57:28 +01:00
// Volume
if ( ! empty ( $arrayfields [ 'p.volume' ][ 'checked' ])) {
print '<td class="center">' ;
print $product_static -> volume ;
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2020-01-21 10:33:27 +01:00
}
2023-01-23 11:57:28 +01:00
// Volume units
if ( ! empty ( $arrayfields [ 'p.volume_units' ][ 'checked' ])) {
print '<td class="center">' ;
if ( $product_static -> volume != '' ) {
print measuringUnitString ( 0 , 'volume' , $product_static -> volume_units );
}
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2020-09-07 10:18:17 +02:00
}
2023-01-23 11:57:28 +01:00
// Unit
if ( ! empty ( $arrayfields [ 'cu.label' ][ 'checked' ])) {
print '<td align="center">' ;
if ( ! empty ( $obj -> cu_label )) {
print $langs -> trans ( $obj -> cu_label );
}
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2022-11-08 19:22:54 +01:00
}
2019-04-04 17:13:52 +02:00
2023-03-27 18:32:25 +02:00
// Default Workstation
if ( ! empty ( $arrayfields [ 'p.fk_default_workstation' ][ 'checked' ])) {
print '<td align="left">' ;
2025-02-08 21:53:48 +01:00
if ( isModEnabled ( 'workstation' ) && ! empty ( $obj -> fk_default_workstation ) && $workstation_static !== null ) {
2023-09-05 17:01:04 +02:00
$workstation_static -> id = $obj -> fk_default_workstation ;
$workstation_static -> ref = $obj -> ref_workstation ;
$workstation_static -> status = $obj -> status_workstation ;
2023-03-22 16:29:18 +01:00
2023-09-05 17:01:04 +02:00
print $workstation_static -> getNomUrl ( 1 );
2023-03-27 18:32:25 +02:00
}
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2023-03-22 16:29:18 +01:00
}
2023-01-23 11:57:28 +01:00
// Sell price
if ( ! empty ( $arrayfields [ 'p.sellprice' ][ 'checked' ])) {
print '<td class="right nowraponall">' ;
if ( $product_static -> status && $usercancreadprice ) {
if ( $obj -> price_base_type == 'TTC' ) {
print '<span class="amount">' . price ( $obj -> price_ttc ) . ' ' . $langs -> trans ( " TTC " ) . '</span>' ;
} else {
print '<span class="amount">' . price ( $obj -> price ) . ' ' . $langs -> trans ( " HT " ) . '</span>' ;
}
}
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
2021-02-26 14:25:17 +01:00
}
2018-06-22 14:51:47 +02:00
}
2016-07-23 16:37:21 +02:00
2025-02-08 21:53:48 +01:00
$productpricescache = array ();
2023-01-23 11:57:28 +01:00
// Multiprices
2023-11-27 11:56:32 +01:00
if ( getDolGlobalString ( 'PRODUIT_MULTIPRICES' )) {
2025-02-08 21:53:48 +01:00
$productpricescache [ $obj -> rowid ] = array ();
2020-12-01 02:41:19 +01:00
2023-01-23 11:57:28 +01:00
if ( $product_static -> status && $usercancreadprice ) {
// Make 1 request for all price levels (without filter on price_level) and saved result into an cache array
// then reuse the cache array if we need prices for other price levels
$sqlp = " SELECT p.rowid, p.fk_product, p.price, p.price_ttc, p.price_level, p.date_price, p.price_base_type " ;
$sqlp .= " FROM " . MAIN_DB_PREFIX . " product_price as p " ;
$sqlp .= " WHERE fk_product = " . (( int ) $obj -> rowid );
$sqlp .= " ORDER BY p.date_price DESC, p.rowid DESC, p.price_level ASC " ;
$resultp = $db -> query ( $sqlp );
if ( $resultp ) {
$nump = $db -> num_rows ( $resultp );
$j = 0 ;
while ( $j < $nump ) {
$objp = $db -> fetch_object ( $resultp );
if ( empty ( $productpricescache [ $obj -> rowid ][ $objp -> price_level ])) {
$productpricescache [ $obj -> rowid ][ $objp -> price_level ][ 'price' ] = $objp -> price ;
$productpricescache [ $obj -> rowid ][ $objp -> price_level ][ 'price_ttc' ] = $objp -> price_ttc ;
$productpricescache [ $obj -> rowid ][ $objp -> price_level ][ 'price_base_type' ] = $objp -> price_base_type ;
}
$j ++ ;
2020-12-01 02:41:19 +01:00
}
2023-01-23 11:57:28 +01:00
$db -> free ( $resultp );
} else {
dol_print_error ( $db );
2020-12-01 02:41:19 +01:00
}
}
2025-02-08 21:53:48 +01:00
'@phan-var-force array<int,array<int,array{price:string,price_ttc:string,price_base_type:string}>> $productpricescache' ;
2020-11-25 10:40:38 +01:00
2023-01-23 11:57:28 +01:00
foreach ( $arraypricelevel as $key => $value ) {
if ( ! empty ( $arrayfields [ 'p.sellprice' . $key ][ 'checked' ])) {
print '<td class="right nowraponall">' ;
2024-10-23 23:06:00 +02:00
if ( ! empty ( $productpricescache [ $obj -> rowid ]) && isset ( $productpricescache [ $obj -> rowid ][ $key ][ 'price_base_type' ])) {
2023-01-23 11:57:28 +01:00
if ( $productpricescache [ $obj -> rowid ][ $key ][ 'price_base_type' ] == 'TTC' ) {
print '<span class="amount">' . price ( $productpricescache [ $obj -> rowid ][ $key ][ 'price_ttc' ]) . ' ' . $langs -> trans ( " TTC " ) . '</span>' ;
} else {
print '<span class="amount">' . price ( $productpricescache [ $obj -> rowid ][ $key ][ 'price' ]) . ' ' . $langs -> trans ( " HT " ) . '</span>' ;
}
}
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
2021-02-26 14:25:17 +01:00
}
2022-11-08 19:22:54 +01:00
}
2020-05-08 22:41:49 +02:00
}
}
2023-01-23 11:57:28 +01:00
// Better buy price
if ( ! empty ( $arrayfields [ 'p.minbuyprice' ][ 'checked' ])) {
print '<td class="right nowraponall">' ;
if ( $product_static -> status_buy && $obj -> bestpurchaseprice != '' && $usercancreadprice ) {
if ( $product_fourn -> find_min_price_product_fournisseur ( $obj -> rowid ) > 0 ) {
if ( $product_fourn -> product_fourn_price_id > 0 ) {
2023-11-27 11:56:32 +01:00
if (( isModEnabled ( " fournisseur " ) && $user -> hasRight ( 'fournisseur' , 'lire' ) && ! getDolGlobalString ( 'MAIN_USE_NEW_SUPPLIERMOD' )) || ( isModEnabled ( " supplier_order " ) && $user -> hasRight ( 'supplier_order' , 'lire' )) || ( isModEnabled ( " supplier_invoice " ) && $user -> hasRight ( 'supplier_invoice' , 'lire' ))) {
2023-01-23 11:57:28 +01:00
$htmltext = $product_fourn -> display_price_product_fournisseur ( 1 , 1 , 0 , 1 );
print '<span class="amount">' . $form -> textwithpicto ( price ( $product_fourn -> fourn_unitprice * ( 1 - $product_fourn -> fourn_remise_percent / 100 ) - $product_fourn -> fourn_remise ) . ' ' . $langs -> trans ( " HT " ), $htmltext ) . '</span>' ;
} else {
print '<span class="amount">' . price ( $product_fourn -> fourn_unitprice ) . ' ' . $langs -> trans ( " HT " ) . '</span>' ;
}
2017-06-30 10:56:05 +02:00
}
}
2018-06-22 15:43:22 +02:00
}
2022-12-22 11:15:21 +01:00
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2018-06-22 14:51:47 +02:00
}
2017-06-26 22:44:56 +02:00
2024-12-24 03:10:47 +01:00
// Number of buy prices - Vendor prices
2023-01-23 11:57:28 +01:00
if ( ! empty ( $arrayfields [ 'p.numbuyprice' ][ 'checked' ])) {
print '<td class="right">' ;
if ( $product_static -> status_buy && $usercancreadprice ) {
if ( count ( $productFournList = $product_fourn -> list_product_fournisseur_price ( $obj -> rowid )) > 0 ) {
$htmltext = $product_fourn -> display_price_product_fournisseur ( 1 , 1 , 0 , 1 , $productFournList );
2025-02-08 21:53:48 +01:00
print $form -> textwithpicto (( string ) count ( $productFournList ), $htmltext );
2023-01-23 11:57:28 +01:00
}
2018-06-22 15:43:22 +02:00
}
2023-01-23 11:57:28 +01:00
print '</td>' ;
2024-03-28 09:55:37 +01:00
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2018-06-22 14:51:47 +02:00
}
2017-07-07 19:48:35 +02:00
2023-01-23 11:57:28 +01:00
// VAT or Sell Tax Rate
if ( ! empty ( $arrayfields [ 'p.tva_tx' ][ 'checked' ])) {
print '<td class="right">' ;
print vatrate ( $obj -> tva_tx , true );
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2020-09-07 10:18:17 +02:00
}
2019-06-19 21:35:35 +02:00
2023-01-23 11:57:28 +01:00
// WAP
if ( ! empty ( $arrayfields [ 'p.pmp' ][ 'checked' ])) {
print '<td class="nowrap right">' ;
if ( $usercancreadprice ) {
print '<span class="amount">' . price ( $product_static -> pmp , 1 , $langs ) . " </span> " ;
}
print '</td>' ;
2024-03-28 09:55:37 +01:00
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2018-06-22 14:51:47 +02:00
}
2023-01-23 11:57:28 +01:00
// Cost price
if ( ! empty ( $arrayfields [ 'p.cost_price' ][ 'checked' ])) {
print '<td class="nowrap right">' ;
//print $obj->cost_price;
if ( $usercancreadprice ) {
print '<span class="amount">' . price ( $obj -> cost_price ) . ' ' . $langs -> trans ( " HT " ) . '</span>' ;
}
print '</td>' ;
2024-03-28 09:55:37 +01:00
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2020-07-24 13:40:06 +02:00
}
2018-06-22 15:43:22 +02:00
2023-01-23 11:57:28 +01:00
// Limit alert
if ( ! empty ( $arrayfields [ 'p.seuil_stock_alerte' ][ 'checked' ])) {
print '<td class="right">' ;
if ( $product_static -> type != 1 ) {
print $obj -> seuil_stock_alerte ;
2018-06-22 15:43:22 +02:00
}
2023-01-23 11:57:28 +01:00
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
2021-02-26 14:25:17 +01:00
}
2018-06-22 15:43:22 +02:00
}
2023-01-23 11:57:28 +01:00
// Desired stock
if ( ! empty ( $arrayfields [ 'p.desiredstock' ][ 'checked' ])) {
print '<td class="right">' ;
if ( $product_static -> type != 1 ) {
print $obj -> desiredstock ;
2018-06-22 15:43:22 +02:00
}
2023-01-23 11:57:28 +01:00
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
2021-02-26 14:25:17 +01:00
}
2018-06-22 15:43:22 +02:00
}
2023-01-23 11:57:28 +01:00
// Stock real
if ( ! empty ( $arrayfields [ 'p.stock' ][ 'checked' ])) {
print '<td class="right">' ;
if ( $product_static -> type != 1 ) {
if ( $obj -> seuil_stock_alerte != '' && $product_static -> stock_reel < ( float ) $obj -> seuil_stock_alerte ) {
print img_warning ( $langs -> trans ( " StockLowerThanLimit " , $obj -> seuil_stock_alerte )) . ' ' ;
}
if ( $usercancreadprice ) {
2023-12-04 13:49:31 +01:00
if ( $product_static -> stock_reel < 0 ) {
print '<span class="warning">' ;
}
2023-02-15 20:47:45 +01:00
print price ( price2num ( $product_static -> stock_reel , 'MS' ), 0 , $langs , 1 , 0 );
2023-12-04 13:49:31 +01:00
if ( $product_static -> stock_reel < 0 ) {
print '</span>' ;
}
2023-01-23 11:57:28 +01:00
}
}
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2018-06-22 14:51:47 +02:00
}
2023-01-23 11:57:28 +01:00
// Stock virtual
if ( ! empty ( $arrayfields [ 'stock_virtual' ][ 'checked' ])) {
print '<td class="right">' ;
if ( $product_static -> type != 1 ) {
if ( $obj -> seuil_stock_alerte != '' && $product_static -> stock_theorique < ( float ) $obj -> seuil_stock_alerte ) {
print img_warning ( $langs -> trans ( " StockLowerThanLimit " , $obj -> seuil_stock_alerte )) . ' ' ;
}
if ( $usercancreadprice ) {
2023-12-04 13:49:31 +01:00
if ( $product_static -> stock_theorique < 0 ) {
print '<span class="warning">' ;
}
2023-02-15 20:47:45 +01:00
print price ( price2num ( $product_static -> stock_theorique , 'MS' ), 0 , $langs , 1 , 0 );
2023-12-04 13:49:31 +01:00
if ( $product_static -> stock_theorique < 0 ) {
print '</span>' ;
}
2023-01-23 11:57:28 +01:00
}
}
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2020-09-16 12:34:07 +02:00
}
2023-01-23 11:57:28 +01:00
// Lot/Serial
if ( ! empty ( $arrayfields [ 'p.tobatch' ][ 'checked' ])) {
print '<td class="center">' ;
print $product_static -> getLibStatut ( 1 , 2 );
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2020-09-16 12:34:07 +02:00
}
2023-01-23 11:57:28 +01:00
// Country
if ( ! empty ( $arrayfields [ 'p.fk_country' ][ 'checked' ])) {
2024-09-06 13:44:29 +02:00
print '<td>' . getCountry ( $obj -> fk_country , '' , $db ) . '</td>' ;
2023-01-23 11:57:28 +01:00
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2018-06-22 15:43:22 +02:00
}
2023-01-23 11:57:28 +01:00
// State
if ( ! empty ( $arrayfields [ 'p.fk_state' ][ 'checked' ])) {
print '<td>' ;
if ( ! empty ( $obj -> fk_state )) {
2024-07-03 02:30:53 +02:00
print getState ( $obj -> fk_state , '0' , $db );
2023-01-23 11:57:28 +01:00
}
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2019-04-25 01:16:29 +02:00
}
2023-01-23 11:57:28 +01:00
// Accountancy code sell
if ( ! empty ( $arrayfields [ $alias_product_perentity . '.accountancy_code_sell' ][ 'checked' ])) {
2023-05-08 21:50:44 +02:00
print '<td>' . length_accountg ( $product_static -> accountancy_code_sell ) . '</td>' ;
2023-01-23 11:57:28 +01:00
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2019-04-25 01:16:29 +02:00
}
2023-01-23 11:57:28 +01:00
if ( ! empty ( $arrayfields [ $alias_product_perentity . '.accountancy_code_sell_intra' ][ 'checked' ])) {
2023-05-08 21:50:44 +02:00
print '<td>' . length_accountg ( $product_static -> accountancy_code_sell_intra ) . '</td>' ;
2023-01-23 11:57:28 +01:00
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2018-06-22 15:43:22 +02:00
}
2023-01-23 11:57:28 +01:00
if ( ! empty ( $arrayfields [ $alias_product_perentity . '.accountancy_code_sell_export' ][ 'checked' ])) {
2023-05-08 21:50:44 +02:00
print '<td>' . length_accountg ( $product_static -> accountancy_code_sell_export ) . '</td>' ;
2023-01-23 11:57:28 +01:00
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2020-03-01 04:52:12 +01:00
}
2023-01-23 11:57:28 +01:00
// Accountancy code buy
if ( ! empty ( $arrayfields [ $alias_product_perentity . '.accountancy_code_buy' ][ 'checked' ])) {
2023-05-08 21:50:44 +02:00
print '<td>' . length_accountg ( $product_static -> accountancy_code_buy ) . '</td>' ;
2023-01-23 11:57:28 +01:00
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2020-03-01 04:52:12 +01:00
}
2023-01-23 11:57:28 +01:00
if ( ! empty ( $arrayfields [ $alias_product_perentity . '.accountancy_code_buy_intra' ][ 'checked' ])) {
2023-05-08 21:50:44 +02:00
print '<td>' . length_accountg ( $product_static -> accountancy_code_buy_intra ) . '</td>' ;
2023-01-23 11:57:28 +01:00
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2018-06-22 14:51:47 +02:00
}
2023-01-23 11:57:28 +01:00
if ( ! empty ( $arrayfields [ $alias_product_perentity . '.accountancy_code_buy_export' ][ 'checked' ])) {
2023-05-08 21:50:44 +02:00
print '<td>' . length_accountg ( $product_static -> accountancy_code_buy_export ) . '</td>' ;
2023-01-23 11:57:28 +01:00
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2022-11-08 19:22:54 +01:00
}
2023-01-23 11:57:28 +01:00
// Extra fields
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_print_fields.tpl.php' ;
// Fields from hook
2024-03-09 16:32:02 +01:00
$parameters = array ( 'arrayfields' => $arrayfields , 'obj' => $obj , 'i' => $i , 'totalarray' => & $totalarray );
2023-01-23 11:57:28 +01:00
$reshook = $hookmanager -> executeHooks ( 'printFieldListValue' , $parameters , $object , $action ); // Note that $action and $object may have been modified by hook
print $hookmanager -> resPrint ;
// Date creation
if ( ! empty ( $arrayfields [ 'p.datec' ][ 'checked' ])) {
print '<td class="center nowraponall">' ;
print dol_print_date ( $db -> jdate ( $obj -> date_creation ), 'dayhour' , 'tzuser' );
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2022-11-08 19:22:54 +01:00
}
2023-01-23 11:57:28 +01:00
// Date modification
if ( ! empty ( $arrayfields [ 'p.tms' ][ 'checked' ])) {
print '<td class="center nowraponall">' ;
2024-02-15 14:08:08 +01:00
print dol_print_date ( $db -> jdate ( $obj -> date_modification ), 'dayhour' , 'tzuser' );
2023-01-23 11:57:28 +01:00
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2018-06-22 14:51:47 +02:00
}
2018-06-22 15:43:22 +02:00
2024-02-09 15:02:02 +01:00
// Import ID
if ( ! empty ( $arrayfields [ 'p.import_key' ][ 'checked' ])) {
print '<td class="center nowrap">' ;
2025-02-08 21:53:48 +01:00
print dol_escape_htmltag (( string ) $product_static -> import_key );
2024-02-09 15:02:02 +01:00
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
}
2023-01-23 11:57:28 +01:00
// Status (to sell)
if ( ! empty ( $arrayfields [ 'p.tosell' ][ 'checked' ])) {
print '<td class="center nowrap">' ;
2023-11-27 11:56:32 +01:00
if ( ! empty ( $conf -> use_javascript_ajax ) && $user -> hasRight ( " produit " , " creer " ) && getDolGlobalString ( 'MAIN_DIRECT_STATUS_UPDATE' )) {
2023-01-23 11:57:28 +01:00
print ajax_object_onoff ( $product_static , 'status' , 'tosell' , 'ProductStatusOnSell' , 'ProductStatusNotOnSell' );
} else {
print $product_static -> LibStatut ( $product_static -> status , 5 , 0 );
}
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2022-11-08 19:22:54 +01:00
}
2023-01-23 11:57:28 +01:00
// Status (to buy)
if ( ! empty ( $arrayfields [ 'p.tobuy' ][ 'checked' ])) {
print '<td class="center nowrap">' ;
2023-11-27 11:56:32 +01:00
if ( ! empty ( $conf -> use_javascript_ajax ) && $user -> hasRight ( " produit " , " creer " ) && getDolGlobalString ( 'MAIN_DIRECT_STATUS_UPDATE' )) {
2023-01-23 11:57:28 +01:00
print ajax_object_onoff ( $product_static , 'status_buy' , 'tobuy' , 'ProductStatusOnBuy' , 'ProductStatusNotOnBuy' );
} else {
print $product_static -> LibStatut ( $product_static -> status_buy , 5 , 1 );
}
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
}
2018-06-22 15:43:22 +02:00
}
2019-11-29 11:32:09 +01:00
2023-01-23 11:57:28 +01:00
// Action column
2023-05-11 11:03:26 +02:00
if ( ! getDolGlobalString ( 'MAIN_CHECKBOX_LEFT_COLUMN' )) {
2023-01-23 11:57:28 +01:00
print '<td class="nowrap center">' ;
if ( $massactionbutton || $massaction ) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
$selected = 0 ;
2023-05-11 11:03:26 +02:00
if ( in_array ( $object -> id , $arrayofselected )) {
2023-01-23 11:57:28 +01:00
$selected = 1 ;
}
2023-05-11 11:03:26 +02:00
print '<input id="cb' . $object -> id . '" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $obj -> rowid . '"' . ( $selected ? ' checked="checked"' : '' ) . '>' ;
2023-01-23 11:57:28 +01:00
}
print '</td>' ;
if ( ! $i ) {
$totalarray [ 'nbfield' ] ++ ;
2022-10-26 19:22:36 +02:00
}
2021-02-26 14:25:17 +01:00
}
2018-06-22 15:43:22 +02:00
2023-05-11 11:03:26 +02:00
print '</tr>' . " \n " ;
2017-10-13 13:28:26 +02:00
}
2018-06-22 15:43:22 +02:00
2022-11-08 19:22:54 +01:00
$i ++ ;
}
2003-09-04 11:59:59 +02:00
2022-11-08 19:22:54 +01:00
// If no record found
if ( $num == 0 ) {
$colspan = 1 ;
foreach ( $arrayfields as $key => $val ) {
if ( ! empty ( $val [ 'checked' ])) {
$colspan ++ ;
2022-07-13 01:01:44 +02:00
}
}
2022-11-08 19:22:54 +01:00
print '<tr><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs -> trans ( " NoRecordFound " ) . '</span></td></tr>' ;
2005-11-27 22:41:30 +01:00
}
2003-09-04 11:59:59 +02:00
2023-05-11 11:03:26 +02:00
$db -> free ( $resql );
print '</table>' . " \n " ;
print '</div>' . " \n " ;
print '</form>' . " \n " ;
2022-11-08 19:22:54 +01:00
2018-08-15 12:48:13 +02:00
// End of page
2011-08-27 16:24:16 +02:00
llxFooter ();
2012-07-24 17:52:46 +02:00
$db -> close ();