2005-04-13 14:04:02 +02:00
< ? php
2024-07-10 18:59:04 +02:00
/* Copyright ( C ) 2005 Matthieu Valleton < mv @ seeschloss . org >
2024-09-06 16:40:06 +02:00
* Copyright ( C ) 2006 - 2024 Laurent Destailleur < eldy @ users . sourceforge . net >
2024-07-10 18:59:04 +02:00
* Copyright ( C ) 2007 Patrick Raguin < patrick . raguin @ gmail . com >
* Copyright ( C ) 2005 - 2012 Regis Houssin < regis . houssin @ inodbox . com >
* Copyright ( C ) 2015 Raphaël Doursenaud < rdoursenaud @ gpcsolutions . fr >
* Copyright ( C ) 2020 Tobias Sekan < tobias . sekan @ startmail . com >
* Copyright ( C ) 2020 Josep Lluís Amador < joseplluis @ lliuretic . cat >
2024-03-26 12:50:51 +01:00
* Copyright ( C ) 2024 MDW < mdeweerd @ users . noreply . github . com >
2024-07-09 19:28:59 +02:00
* Copyright ( C ) 2024 Frédéric France < frederic . france @ free . fr >
2024-07-10 18:59:04 +02:00
* Copyright ( C ) 2024 Alexandre Spangaro < alexandre @ inovea - conseil . com >
2024-11-15 14:09:04 +01:00
* Copyright ( C ) 2023 - 2024 Charlene Benke < charlene @ patas - monkey . com >
2005-04-13 14:04:02 +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
2005-04-13 14:04:02 +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 />.
2005-04-13 14:04:02 +02:00
*/
2006-08-15 20:52:02 +02:00
/**
2009-07-22 19:02:49 +02:00
* \file htdocs / categories / viewcat . php
* \ingroup category
2010-03-20 01:07:47 +01:00
* \brief Page to show a category card
2009-07-22 19:02:49 +02:00
*/
2006-08-15 20:52:02 +02:00
2022-09-07 20:08:59 +02:00
// Load Dolibarr environment
2012-08-22 23:24:21 +02:00
require '../main.inc.php' ;
2012-08-22 23:11:24 +02:00
require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php' ;
require_once DOL_DOCUMENT_ROOT . '/core/lib/categories.lib.php' ;
2014-03-16 16:04:18 +01:00
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php' ;
2015-09-17 19:51:56 +02:00
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formother.class.php' ;
2014-03-16 16:04:18 +01:00
2024-11-04 23:53:20 +01:00
/**
* @ var Conf $conf
* @ var DoliDB $db
* @ var HookManager $hookmanager
* @ var Translate $langs
* @ var User $user
*/
2018-05-27 09:58:23 +02:00
// Load translation files required by the page
2022-12-28 23:20:42 +01:00
$langs -> loadLangs ( array ( " categories " , " compta " ));
2011-03-14 12:21:46 +01:00
2023-12-04 12:01:45 +01:00
$action = GETPOST ( 'action' , 'aZ09' ) ? GETPOST ( 'action' , 'aZ09' ) : 'view' ; // The action 'add', 'create', 'edit', 'update', 'view', ...
2019-11-13 19:35:39 +01:00
$massaction = GETPOST ( 'massaction' , 'alpha' ); // The bulk action (combo box choice into lists)
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' ); // Show files area generated by bulk actions ?
2019-11-13 19:35:39 +01:00
$confirm = GETPOST ( 'confirm' , 'alpha' ); // Result of a confirmation
$cancel = GETPOST ( 'cancel' , 'alpha' ); // We click on a Cancel button
$toselect = GETPOST ( 'toselect' , 'array' ); // Array of ids of elements selected into a list
2023-12-04 12:01:45 +01:00
$contextpage = GETPOST ( 'contextpage' , 'aZ' ) ? GETPOST ( 'contextpage' , 'aZ' ) : 'categorylist' ; // To manage different context of search
2019-11-13 19:35:39 +01:00
$backtopage = GETPOST ( 'backtopage' , 'alpha' ); // Go back to a dedicated page
2021-02-23 18:04:37 +01:00
$optioncss = GETPOST ( 'optioncss' , 'aZ' ); // Option for the css output (always '' except when 'print')
2019-09-10 01:44:36 +02:00
2024-11-08 10:08:06 +01:00
$id = GETPOSTINT ( 'id' );
$label = GETPOST ( 'label' , 'alpha' );
$removeelem = GETPOSTINT ( 'removeelem' );
$elemid = GETPOSTINT ( 'elemid' );
if ( GETPOST ( 'addintocategory' )) {
$action = 'addintocategory' ;
}
2020-09-23 16:36:19 +02:00
2019-09-10 01:44:36 +02:00
// Load variable for pagination
2024-03-16 11:41:00 +01:00
$limit = GETPOSTINT ( 'limit' ) ? GETPOSTINT ( 'limit' ) : $conf -> liste_limit ;
2020-09-18 17:13:01 +02:00
$sortfield = GETPOST ( 'sortfield' , 'aZ09comma' );
2020-09-17 14:31:25 +02:00
$sortorder = GETPOST ( 'sortorder' , 'aZ09comma' );
2024-03-01 01:52:40 +01:00
$page = GETPOSTISSET ( 'pageplusone' ) ? ( GETPOSTINT ( 'pageplusone' ) - 1 ) : GETPOSTINT ( " page " );
2021-02-23 18:04:37 +01:00
if ( empty ( $page ) || $page == - 1 || GETPOST ( 'button_search' , 'alpha' ) || GETPOST ( 'button_removefilter' , 'alpha' ) || ( empty ( $toselect ) && $massaction === '0' )) {
$page = 0 ;
} // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
2019-09-10 01:44:36 +02:00
$offset = $limit * $page ;
$pageprev = $page - 1 ;
$pagenext = $page + 1 ;
2021-02-23 18:04:37 +01:00
if ( $id == " " && $label == " " ) {
2024-01-20 09:22:38 +01:00
dol_print_error ( null , 'Missing parameter id' );
2009-11-04 20:13:37 +01:00
exit ();
2006-03-30 17:02:24 +02:00
}
2024-08-20 23:32:43 +02:00
// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array array
$hookmanager -> initHooks ( array ( 'categorycard' , 'globalcard' ));
2011-08-20 11:02:56 +02:00
// Security check
2012-03-20 15:45:15 +01:00
$result = restrictedArea ( $user , 'categorie' , $id , '&category' );
2011-08-20 11:02:56 +02:00
2011-03-11 15:59:35 +01:00
$object = new Categorie ( $db );
2020-11-21 13:28:37 +01:00
$result = $object -> fetch ( $id , $label );
2018-02-21 14:48:25 +01:00
if ( $result <= 0 ) {
2023-12-04 12:01:45 +01:00
dol_print_error ( $db , $object -> error );
exit ;
2018-02-21 14:48:25 +01:00
}
2007-02-22 21:59:41 +01:00
2020-11-21 13:28:37 +01:00
$type = $object -> type ;
2021-02-23 18:04:37 +01:00
if ( is_numeric ( $type )) {
2024-11-11 14:48:18 +01:00
$type = Categorie :: $MAP_ID_TO_CODE [( int ) $type ]; // For backward compatibility
2021-02-23 18:04:37 +01:00
}
2007-02-22 21:59:41 +01:00
2014-03-16 16:04:18 +01:00
$extrafields = new ExtraFields ( $db );
2019-10-06 14:41:52 +02:00
$extrafields -> fetch_name_optionals_label ( $object -> table_element );
2007-02-22 21:59:41 +01:00
/*
2009-07-22 19:02:49 +02:00
* Actions
*/
2020-11-23 19:53:58 +01:00
2021-02-23 18:04:37 +01:00
if ( $confirm == 'no' ) {
2020-11-21 22:40:31 +01:00
if ( $backtopage ) {
header ( " Location: " . $backtopage );
exit ;
}
}
2024-03-14 18:40:56 +01:00
$parameters = array ( 'type' => $type , 'id' => $id , 'label' => $label );
2019-11-13 19:35:39 +01:00
$reshook = $hookmanager -> executeHooks ( 'doActions' , $parameters , $object , $action ); // Note that $action and $object may have been modified by some hooks
2013-06-05 16:24:32 +02:00
// Remove element from category
2024-09-06 16:40:06 +02:00
if ( $id > 0 && $removeelem > 0 && $action == 'unlink' ) { // Test on permission not required here. Done later according to type of object.
2024-09-18 03:27:25 +02:00
$tmpobject = null ;
2024-11-15 14:09:04 +01:00
$elementtype = '' ;
2023-06-19 23:05:59 +02:00
if ( $type == Categorie :: TYPE_PRODUCT && ( $user -> hasRight ( 'produit' , 'creer' ) || $user -> hasRight ( 'service' , 'creer' ))) {
2013-06-05 16:24:32 +02:00
require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php' ;
$tmpobject = new Product ( $db );
$result = $tmpobject -> fetch ( $removeelem );
$elementtype = 'product' ;
2023-06-05 23:49:13 +02:00
} elseif ( $type == Categorie :: TYPE_SUPPLIER && $user -> hasRight ( 'societe' , 'creer' )) {
2013-06-05 16:24:32 +02:00
$tmpobject = new Societe ( $db );
$result = $tmpobject -> fetch ( $removeelem );
2017-11-03 17:29:25 +01:00
$elementtype = 'supplier' ;
2023-06-05 23:49:13 +02:00
} elseif ( $type == Categorie :: TYPE_CUSTOMER && $user -> hasRight ( 'societe' , 'creer' )) {
2013-06-05 16:24:32 +02:00
$tmpobject = new Societe ( $db );
$result = $tmpobject -> fetch ( $removeelem );
2017-11-03 17:29:25 +01:00
$elementtype = 'customer' ;
2022-09-09 10:29:27 +02:00
} elseif ( $type == Categorie :: TYPE_MEMBER && $user -> hasRight ( 'adherent' , 'creer' )) {
2013-06-05 16:24:32 +02:00
require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php' ;
$tmpobject = new Adherent ( $db );
$result = $tmpobject -> fetch ( $removeelem );
2013-04-21 23:44:33 +02:00
$elementtype = 'member' ;
2023-06-05 23:49:13 +02:00
} elseif ( $type == Categorie :: TYPE_CONTACT && $user -> hasRight ( 'societe' , 'creer' )) {
2013-07-30 17:28:08 +02:00
require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php' ;
$tmpobject = new Contact ( $db );
$result = $tmpobject -> fetch ( $removeelem );
$elementtype = 'contact' ;
2023-10-15 15:32:35 +02:00
} elseif ( $type == Categorie :: TYPE_ACCOUNT && $user -> hasRight ( 'banque' , 'configurer' )) {
2020-10-31 14:32:18 +01:00
require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php' ;
$tmpobject = new Account ( $db );
$result = $tmpobject -> fetch ( $removeelem );
$elementtype = 'account' ;
2023-10-15 15:32:35 +02:00
} elseif ( $type == Categorie :: TYPE_PROJECT && $user -> hasRight ( 'projet' , 'creer' )) {
2020-10-31 14:32:18 +01:00
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php' ;
$tmpobject = new Project ( $db );
$result = $tmpobject -> fetch ( $removeelem );
$elementtype = 'project' ;
2023-06-05 23:49:13 +02:00
} elseif ( $type == Categorie :: TYPE_USER && $user -> hasRight ( 'user' , 'user' , 'creer' )) {
2020-02-03 11:01:58 +01:00
require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php' ;
$tmpobject = new User ( $db );
$result = $tmpobject -> fetch ( $removeelem );
$elementtype = 'user' ;
2023-10-15 15:32:35 +02:00
} elseif ( $type == Categorie :: TYPE_TICKET && $user -> hasRight ( 'ticket' , 'write' )) {
2021-07-01 19:30:00 +02:00
require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php' ;
$tmpobject = new Ticket ( $db );
$result = $tmpobject -> fetch ( $removeelem );
$elementtype = 'ticket' ;
2024-11-15 14:09:04 +01:00
} elseif ( $type == Categorie :: TYPE_FICHINTER && $user -> hasRight ( 'ficheinter' , 'write' )) {
require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php' ;
$tmpobject = new Fichinter ( $db );
$result = $tmpobject -> fetch ( $removeelem );
$elementtype = 'fichinter' ;
2025-02-14 14:29:49 +01:00
} elseif ( $type == Categorie :: TYPE_ORDER && $user -> hasRight ( 'commande' , 'creer' )) {
require_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php' ;
$tmpobject = new Commande ( $db );
$result = $tmpobject -> fetch ( $removeelem );
$elementtype = 'order' ;
2024-11-15 14:09:04 +01:00
} else {
dol_print_error ( null , " Not supported value of type = " . $type );
2020-02-03 11:01:58 +01:00
}
2014-01-12 15:54:28 +01:00
2019-11-13 19:35:39 +01:00
$result = $object -> del_type ( $tmpobject , $elementtype );
2021-02-23 18:04:37 +01:00
if ( $result < 0 ) {
2024-01-20 09:22:38 +01:00
dol_print_error ( null , $object -> error );
2021-02-23 18:04:37 +01:00
}
2013-06-05 16:24:32 +02:00
}
2013-04-21 23:44:33 +02:00
2023-10-15 15:32:35 +02:00
if ( $user -> hasRight ( 'categorie' , 'supprimer' ) && $action == 'confirm_delete' && $confirm == 'yes' ) {
2021-02-23 18:04:37 +01:00
if ( $object -> delete ( $user ) >= 0 ) {
2020-11-21 22:40:31 +01:00
if ( $backtopage ) {
header ( " Location: " . $backtopage );
exit ;
} else {
header ( " Location: " . DOL_URL_ROOT . '/categories/index.php?type=' . $type );
exit ;
}
2020-05-21 15:05:19 +02:00
} else {
2015-11-06 09:36:16 +01:00
setEventMessages ( $object -> error , $object -> errors , 'errors' );
2007-02-22 21:59:41 +01:00
}
2005-04-13 14:04:02 +02:00
}
2024-09-06 16:40:06 +02:00
if ( $elemid && $action == 'addintocategory' ) { // Test on permission not required here. Done just after depending on object type
2024-11-15 14:09:04 +01:00
$newobject = null ;
$elementtype = '' ;
if ( $type == Categorie :: TYPE_PRODUCT && ( $user -> hasRight ( 'produit' , 'creer' ) || $user -> hasRight ( 'service' , 'creer' ))) {
require_once DOL_DOCUMENT_ROOT . '/product/class/product.class.php' ;
$newobject = new Product ( $db );
$elementtype = 'product' ;
} elseif ( $type == Categorie :: TYPE_CUSTOMER && $user -> hasRight ( 'societe' , 'creer' )) {
require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php' ;
$newobject = new Societe ( $db );
$elementtype = 'customer' ;
} elseif ( $type == Categorie :: TYPE_SUPPLIER && $user -> hasRight ( 'societe' , 'creer' )) {
require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php' ;
$newobject = new Societe ( $db );
$elementtype = 'supplier' ;
} elseif ( $type == Categorie :: TYPE_TICKET && $user -> hasRight ( 'ticket' , 'write' )) {
require_once DOL_DOCUMENT_ROOT . '/ticket/class/ticket.class.php' ;
$newobject = new Ticket ( $db );
$elementtype = 'ticket' ;
} elseif ( $type == Categorie :: TYPE_FICHINTER && $user -> hasRight ( 'ficheinter' , 'write' )) {
require_once DOL_DOCUMENT_ROOT . '/fichinter/class/fichinter.class.php' ;
$newobject = new Fichinter ( $db );
$elementtype = 'fichinter' ;
} elseif ( $type == Categorie :: TYPE_PROJECT && $user -> hasRight ( 'projet' , 'creer' )) {
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php' ;
$newobject = new Project ( $db );
$elementtype = 'project' ;
} elseif ( $type == Categorie :: TYPE_MEMBER && $user -> hasRight ( 'adherent' , 'creer' )) {
require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php' ;
$newobject = new Adherent ( $db );
$elementtype = 'member' ;
} elseif ( $type == Categorie :: TYPE_CONTACT && $user -> hasRight ( 'societe' , 'creer' )) {
require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php' ;
$newobject = new Contact ( $db );
$elementtype = 'contact' ;
} elseif ( $type == Categorie :: TYPE_USER && $user -> hasRight ( 'user' , 'user' , 'creer' )) {
require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php' ;
$newobject = new User ( $db );
$elementtype = 'user' ;
} elseif ( $type == Categorie :: TYPE_ACCOUNT && $user -> hasRight ( 'banque' , 'configurer' )) {
require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php' ;
$newobject = new Account ( $db );
$elementtype = 'bank_account' ;
2025-02-14 14:29:49 +01:00
} elseif ( $type == Categorie :: TYPE_ORDER && $user -> hasRight ( 'commande' , 'creer' )) {
require_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php' ;
$newobject = new Commande ( $db );
$elementtype = 'order' ;
2024-11-15 14:09:04 +01:00
} else {
dol_print_error ( null , " Not supported value of type = " . $type );
}
if ( $newobject !== null ) {
$result = $newobject -> fetch ( $elemid );
}
2015-05-04 12:29:26 +02:00
2024-11-15 14:09:04 +01:00
// Add into category
$result = $object -> add_type ( $newobject , $elementtype );
if ( $result >= 0 ) {
setEventMessages ( $langs -> trans ( " WasAddedSuccessfully " , $newobject -> ref ), null , 'mesgs' );
} else {
if ( $object -> error == 'DB_ERROR_RECORD_ALREADY_EXISTS' ) {
setEventMessages ( $langs -> trans ( " ObjectAlreadyLinkedToCategory " ), null , 'warnings' );
2020-05-21 15:05:19 +02:00
} else {
2024-11-15 14:09:04 +01:00
setEventMessages ( $object -> error , $object -> errors , 'errors' );
2014-10-09 17:18:14 +02:00
}
}
}
2014-10-07 21:39:10 +02:00
2005-04-13 14:04:02 +02:00
2006-03-03 21:52:01 +01:00
/*
2008-07-01 21:30:39 +02:00
* View
2006-03-03 21:52:01 +01:00
*/
2008-07-01 21:30:39 +02:00
2011-11-08 10:18:45 +01:00
$form = new Form ( $db );
2015-09-17 19:51:56 +02:00
$formother = new FormOther ( $db );
2008-07-16 18:27:26 +02:00
2024-11-15 14:09:04 +01:00
$arrayofjs = array (
'/includes/jquery/plugins/jquerytreeview/jquery.treeview.js' ,
'/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js'
);
2020-04-10 10:59:32 +02:00
$arrayofcss = array ( '/includes/jquery/plugins/jquerytreeview/jquery.treeview.css' );
2021-03-19 09:27:29 +01:00
$help_url = '' ;
llxHeader ( " " , $langs -> trans ( " Categories " ), $help_url , '' , 0 , 0 , $arrayofjs , $arrayofcss );
2020-03-26 12:36:53 +01:00
2020-04-12 00:37:05 +02:00
$title = Categorie :: $MAP_TYPE_TITLE_AREA [ $type ];
2007-11-10 13:51:57 +01:00
2019-01-27 11:55:16 +01:00
$head = categories_prepare_head ( $object , $type );
2020-10-22 22:50:03 +02:00
print dol_get_fiche_head ( $head , 'card' , $langs -> trans ( $title ), - 1 , 'category' );
2020-11-21 15:57:11 +01:00
2021-03-14 15:06:40 +01:00
$backtolist = ( GETPOST ( 'backtolist' ) ? GETPOST ( 'backtolist' ) : DOL_URL_ROOT . '/categories/index.php?leftmenu=cat&type=' . urlencode ( $type ));
$linkback = '<a href="' . dol_sanitizeUrl ( $backtolist ) . '">' . $langs -> trans ( " BackToList " ) . '</a>' ;
2024-11-15 14:09:04 +01:00
$object -> next_prev_filter = 'type:=:' . (( int ) $object -> type );
2017-01-22 12:13:32 +01:00
$object -> ref = $object -> label ;
2021-03-14 15:06:40 +01:00
$morehtmlref = '<br><div class="refidno"><a href="' . DOL_URL_ROOT . '/categories/index.php?leftmenu=cat&type=' . urlencode ( $type ) . '">' . $langs -> trans ( " Root " ) . '</a> >> ' ;
2017-01-22 12:13:32 +01:00
$ways = $object -> print_all_ways ( " >> " , '' , 1 );
2021-02-23 18:04:37 +01:00
foreach ( $ways as $way ) {
2020-10-31 14:32:18 +01:00
$morehtmlref .= $way . " <br> \n " ;
2017-01-22 12:13:32 +01:00
}
2020-04-10 10:59:32 +02:00
$morehtmlref .= '</div>' ;
2017-01-22 12:13:32 +01:00
2021-03-14 15:06:40 +01:00
dol_banner_tab ( $object , 'label' , $linkback , ( $user -> socid ? 0 : 1 ), 'label' , 'label' , $morehtmlref , '&type=' . urlencode ( $type ), 0 , '' , '' , 1 );
2017-01-22 12:13:32 +01:00
2006-03-03 21:52:01 +01:00
2024-11-08 09:13:34 +01:00
// Confirmation of deletion
2021-02-23 18:04:37 +01:00
if ( $action == 'delete' ) {
2020-11-21 22:40:31 +01:00
if ( $backtopage ) {
2025-02-06 12:32:00 +01:00
print $form -> formconfirm ( $_SERVER [ " PHP_SELF " ] . '?id=' . $object -> id . '&type=' . urlencode ( $type ) . '&backtopage=' . urlencode ( $backtopage ), $langs -> trans ( 'DeleteCategory' ), $langs -> trans ( 'ConfirmDeleteCategory' ), 'confirm_delete' , '' , '' , 2 );
2020-11-21 22:40:31 +01:00
} else {
2025-02-06 12:32:00 +01:00
print $form -> formconfirm ( $_SERVER [ " PHP_SELF " ] . '?id=' . $object -> id . '&type=' . urlencode ( $type ), $langs -> trans ( 'DeleteCategory' ), $langs -> trans ( 'ConfirmDeleteCategory' ), 'confirm_delete' , '' , '' , 1 );
2020-11-21 22:40:31 +01:00
}
2007-02-22 21:59:41 +01:00
}
2017-01-22 12:13:32 +01:00
print '<br>' ;
2005-04-13 14:04:02 +02:00
2017-04-05 14:48:24 +02:00
print '<div class="fichecenter">' ;
2017-01-22 12:13:32 +01:00
print '<div class="underbanner clearboth"></div>' ;
2020-05-26 14:43:50 +02:00
print '<table class="border centpercent tableforfield">' ;
2006-08-15 20:52:02 +02:00
2009-07-22 19:02:49 +02:00
// Description
2017-04-09 15:02:55 +02:00
print '<tr><td class="titlefield notopnoleft tdtop">' ;
2006-08-15 20:52:02 +02:00
print $langs -> trans ( " Description " ) . '</td><td>' ;
2015-05-14 20:49:22 +02:00
print dol_htmlentitiesbr ( $object -> description );
2006-08-15 20:52:02 +02:00
print '</td></tr>' ;
2015-09-17 19:51:56 +02:00
// Color
print '<tr><td class="notopnoleft">' ;
print $langs -> trans ( " Color " ) . '</td><td>' ;
print $formother -> showColor ( $object -> color );
print '</td></tr>' ;
2024-01-17 21:11:42 +01:00
// Position
print '<tr><td class="titlefield notopnoleft">' ;
print $langs -> trans ( " Position " ) . '</td><td>' ;
print $object -> position ;
print '</td></tr>' ;
2017-06-07 16:44:04 +02:00
// Other attributes
2019-11-13 19:35:39 +01:00
include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php' ;
2014-03-16 16:04:18 +01:00
2006-08-15 20:52:02 +02:00
print '</table>' ;
2017-04-05 14:48:24 +02:00
print '</div>' ;
2006-08-15 20:52:02 +02:00
2020-10-27 18:19:31 +01:00
print dol_get_fiche_end ();
2006-08-15 20:52:02 +02:00
/*
* Boutons actions
*/
2015-05-14 20:49:22 +02:00
2006-08-15 20:52:02 +02:00
print " <div class='tabsAction'> \n " ;
2021-02-05 11:36:12 +01:00
$reshook = $hookmanager -> executeHooks ( 'addMoreActionsButtons' , $parameters , $object , $action ); // Note that $action and $object may have been modified by some hooks
2021-02-23 18:04:37 +01:00
if ( $reshook < 0 ) {
setEventMessages ( $hookmanager -> error , $hookmanager -> errors , 'errors' );
}
2021-02-05 11:36:12 +01:00
if ( empty ( $reshook )) {
2023-10-15 15:32:35 +02:00
if ( $user -> hasRight ( 'categorie' , 'creer' )) {
2021-02-06 01:14:48 +01:00
$socid = ( $object -> socid ? " &socid= " . $object -> socid : " " );
2025-02-06 12:32:00 +01:00
print '<a class="butAction" href="edit.php?id=' . $object -> id . $socid . '&type=' . urlencode ( $type ) . '">' . $langs -> trans ( " Modify " ) . '</a>' ;
2021-02-05 11:36:12 +01:00
}
2006-08-15 20:52:02 +02:00
2023-10-15 15:32:35 +02:00
if ( $user -> hasRight ( 'categorie' , 'supprimer' )) {
2025-02-06 12:32:00 +01:00
print '<a class="butActionDelete" href="' . $_SERVER [ " PHP_SELF " ] . '?action=delete&token=' . newToken () . '&id=' . $object -> id . '&type=' . urlencode ( $type ) . '&backtolist=' . urlencode ( $backtolist ) . '">' . $langs -> trans ( " Delete " ) . '</a>' ;
2021-02-05 11:36:12 +01:00
}
2006-08-15 20:52:02 +02:00
}
2005-04-13 14:04:02 +02:00
print " </div> " ;
2020-04-02 14:32:54 +02:00
$newcardbutton = '' ;
2023-10-15 15:32:35 +02:00
if ( $user -> hasRight ( 'categorie' , 'creer' )) {
2020-03-25 10:31:40 +01:00
$link = DOL_URL_ROOT . '/categories/card.php' ;
$link .= '?action=create' ;
2025-02-06 12:32:00 +01:00
$link .= '&type=' . urlencode ( $type );
$link .= '&catorigin=' . (( int ) $object -> id );
2020-03-25 10:31:40 +01:00
$link .= '&backtopage=' . urlencode ( $_SERVER [ " PHP_SELF " ] . '?type=' . $type . '&id=' . $id );
2020-04-02 14:32:54 +02:00
$newcardbutton = '<div class="right">' ;
$newcardbutton .= dolGetButtonTitle ( $langs -> trans ( 'NewCategory' ), '' , 'fa fa-plus-circle' , $link );
$newcardbutton .= '</div>' ;
2020-03-25 10:31:40 +01:00
}
2006-08-15 20:52:02 +02:00
2020-03-26 12:36:53 +01:00
/*
* Sub - category tree view of this category
*/
print '<div class="fichecenter">' ;
2020-04-02 14:32:54 +02:00
2020-04-09 16:36:39 +02:00
print load_fiche_titre ( $langs -> trans ( " SubCats " ), $newcardbutton , 'object_category' );
2020-04-02 14:32:54 +02:00
2024-11-08 09:38:35 +01:00
print '<table class="liste nohover noborder centpercent borderbottom">' ;
2020-03-26 12:36:53 +01:00
print '<tr class="liste_titre">' ;
print '<td>' . $langs -> trans ( " SubCats " ) . '</td>' ;
print '<td></td>' ;
print '<td class="right">' ;
2021-02-23 18:04:37 +01:00
if ( ! empty ( $conf -> use_javascript_ajax )) {
2020-03-26 12:36:53 +01:00
print '<div id="iddivjstreecontrol">' ;
2020-04-22 00:55:38 +02:00
print '<a class="notasortlink" href="#">' . img_picto ( '' , 'folder' ) . ' ' . $langs -> trans ( " UndoExpandAll " ) . '</a>' ;
2020-03-26 12:36:53 +01:00
print " | " ;
2020-04-22 00:55:38 +02:00
print '<a class="notasortlink" href="#">' . img_picto ( '' , 'folder-open' ) . ' ' . $langs -> trans ( " ExpandAll " ) . '</a>' ;
2020-03-26 12:36:53 +01:00
print '</div>' ;
}
print '</td>' ;
print '</tr>' ;
2011-03-11 15:59:35 +01:00
$cats = $object -> get_filles ();
2021-02-23 18:04:37 +01:00
if ( $cats < 0 ) {
2020-09-28 09:13:15 +02:00
dol_print_error ( $db , $object -> error , $object -> errors );
2021-02-23 18:04:37 +01:00
} elseif ( count ( $cats ) < 1 ) {
2023-08-15 13:51:17 +02:00
print '<tr class="oddeven nobottom">' ;
2022-12-27 01:45:00 +01:00
print '<td colspan="3"><span class="opacitymedium">' . $langs -> trans ( " NoSubCat " ) . '</span></td>' ;
2020-03-26 12:36:53 +01:00
print '</tr>' ;
2020-05-21 15:05:19 +02:00
} else {
2020-03-26 12:36:53 +01:00
$categstatic = new Categorie ( $db );
2020-04-12 00:37:05 +02:00
$fulltree = $categstatic -> get_full_arbo ( $type , $object -> id , 1 );
2020-03-26 12:36:53 +01:00
// Load possible missing includes
2022-07-25 18:45:02 +02:00
if ( getDolGlobalString ( 'CATEGORY_SHOW_COUNTS' )) {
2021-02-23 18:04:37 +01:00
if ( $type == Categorie :: TYPE_MEMBER ) {
require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php' ;
}
if ( $type == Categorie :: TYPE_ACCOUNT ) {
require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php' ;
}
if ( $type == Categorie :: TYPE_PROJECT ) {
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php' ;
}
if ( $type == Categorie :: TYPE_USER ) {
require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php' ;
}
2010-03-20 01:07:47 +01:00
}
2020-03-26 12:36:53 +01:00
// Define data (format for treeview)
$data = array ();
2024-11-04 12:32:13 +01:00
$data [] = array ( 'rowid' => 0 , 'fk_menu' => - 1 , 'title' => 'racine' , 'mainmenu' => '' , 'leftmenu' => '' , 'fk_mainmenu' => '' , 'fk_leftmenu' => '' );
2021-02-23 18:04:37 +01:00
foreach ( $fulltree as $key => $val ) {
2020-03-26 12:36:53 +01:00
$categstatic -> id = $val [ 'id' ];
$categstatic -> ref = $val [ 'label' ];
$categstatic -> color = $val [ 'color' ];
$categstatic -> type = $type ;
2024-11-08 09:13:34 +01:00
//$desc = dol_htmlcleanlastbr($val['description']);
2020-03-26 12:36:53 +01:00
2020-11-21 22:40:31 +01:00
$counter = '' ;
2022-07-25 18:45:02 +02:00
if ( getDolGlobalString ( 'CATEGORY_SHOW_COUNTS' )) {
2020-03-26 12:36:53 +01:00
// we need only a count of the elements, so it is enough to consume only the id's from the database
2022-07-25 18:45:02 +02:00
$elements = $categstatic -> getObjectsInCateg ( $type , 1 );
2020-03-26 12:36:53 +01:00
2021-11-28 15:43:22 +01:00
$counter = " <td class='left' width='40px;'> " . ( is_array ( $elements ) ? count ( $elements ) : '0' ) . " </td> " ;
2006-03-03 21:52:01 +01:00
}
2020-03-26 12:36:53 +01:00
2024-11-08 09:13:34 +01:00
if ( $categstatic -> color ) {
$stylecolor = ' style="background: #' . sprintf ( " %06s " , $categstatic -> color ) . ';"' ;
} else {
$stylecolor = ' style="background: #bbb;"' ;
}
$li = $categstatic -> getNomUrl ( 1 , '' , 60 , '&backtolist=' . urlencode ( $_SERVER [ " PHP_SELF " ] . '?id=' . (( int ) $id ) . '&type=' . urlencode ( $type )), 0 );
2020-03-26 12:36:53 +01:00
$entry = '<table class="nobordernopadding centpercent">' ;
$entry .= '<tr>' ;
$entry .= '<td>' ;
2024-11-08 09:13:34 +01:00
$entry .= '<span class="noborderoncategories" ' . $stylecolor . '>' . $li . '</span>' ;
2020-03-26 12:36:53 +01:00
$entry .= '</td>' ;
2020-11-21 22:40:31 +01:00
$entry .= $counter ;
2020-03-26 12:36:53 +01:00
$entry .= '<td class="right" width="20px;">' ;
2025-02-06 12:32:00 +01:00
$entry .= '<a href="' . DOL_URL_ROOT . '/categories/viewcat.php?id=' . $val [ 'id' ] . '&type=' . urlencode ( $type ) . '&backtolist=' . urlencode ( $_SERVER [ " PHP_SELF " ] . '?id=' . $id . '&type=' . urlencode ( $type )) . '">' . img_view () . '</a>' ;
2020-11-21 22:40:31 +01:00
$entry .= '</td>' ;
$entry .= '<td class="right" width="20px;">' ;
2025-02-06 12:32:00 +01:00
$entry .= '<a class="editfielda" href="' . DOL_URL_ROOT . '/categories/edit.php?id=' . $val [ 'id' ] . '&type=' . urlencode ( $type ) . '&backtopage=' . urlencode ( $_SERVER [ " PHP_SELF " ] . '?id=' . $id . '&type=' . urlencode ( $type )) . '">' . img_edit () . '</a>' ;
2020-11-21 22:40:31 +01:00
$entry .= '</td>' ;
$entry .= '<td class="right" width="20px;">' ;
2025-02-06 12:32:00 +01:00
$entry .= '<a class="deletefilelink" href="' . DOL_URL_ROOT . '/categories/viewcat.php?action=delete&token=' . newToken () . '&id=' . $val [ 'id' ] . '&type=' . urlencode ( $type ) . '&backtopage=' . urlencode ( $_SERVER [ " PHP_SELF " ] . '?id=' . $id . '&type=' . urlencode ( $type )) . '&backtolist=' . urlencode ( $_SERVER [ " PHP_SELF " ] . '?id=' . $id . '&type=' . urlencode ( $type )) . '">' . img_delete () . '</a>' ;
2020-03-26 12:36:53 +01:00
$entry .= '</td>' ;
$entry .= '</tr>' ;
$entry .= '</table>' ;
$data [] = array ( 'rowid' => $val [ 'rowid' ], 'fk_menu' => $val [ 'fk_parent' ], 'entry' => $entry );
}
2020-11-21 22:40:31 +01:00
$nbofentries = ( count ( $data ) - 1 );
2021-02-23 18:04:37 +01:00
if ( $nbofentries > 0 ) {
2020-03-26 12:36:53 +01:00
require_once DOL_DOCUMENT_ROOT . '/core/lib/treeview.lib.php' ;
print '<tr class="pair">' ;
print '<td colspan="3">' ;
// $data[0] is the current shown category, to don'T show the current category use $data[1] instead
tree_recur ( $data , $data [ 1 ], 0 );
print '</td>' ;
print '</tr>' ;
2020-05-21 15:05:19 +02:00
} else {
2020-03-26 12:36:53 +01:00
print '<tr class="pair">' ;
print '<td colspan="3">' ;
print '<table class="nobordernopadding">' ;
print '<tr class="nobordernopadding">' ;
print '<td>' . img_picto_common ( '' , 'treemenu/branchbottom.gif' ) . '</td>' ;
2023-07-01 16:07:58 +02:00
print '<td class="valignmiddle"><span class="opacitymedium">' . $langs -> trans ( " NoCategoryYet " ) . '</span></td>' ;
2020-03-26 12:36:53 +01:00
print '<td> </td>' ;
print '</tr>' ;
print '</table>' ;
print '</td>' ;
print '</tr>' ;
2006-03-03 21:52:01 +01:00
}
2005-04-13 14:04:02 +02:00
}
2020-03-26 12:36:53 +01:00
print " </table> " ;
print " </div> " ;
2015-12-19 13:55:27 +01:00
2019-09-10 01:44:36 +02:00
// List of mass actions available
2019-11-13 19:35:39 +01:00
$arrayofmassactions = array (
2019-09-10 01:44:36 +02:00
//'validate'=>$langs->trans("Validate"),
//'generate_doc'=>$langs->trans("ReGeneratePDF"),
//'builddoc'=>$langs->trans("PDFMerge"),
//'presend'=>$langs->trans("SendByMail"),
);
2019-11-13 19:35:39 +01:00
$massactionbutton = $form -> selectMassAction ( '' , $arrayofmassactions );
2019-09-10 01:44:36 +02:00
2025-02-06 12:32:00 +01:00
$typeid = $type ; // warning, typeid can be a string
2020-04-02 14:32:54 +02:00
2014-10-07 21:39:10 +02:00
// List of products or services (type is type of category)
2021-02-23 18:04:37 +01:00
if ( $type == Categorie :: TYPE_PRODUCT ) {
2023-07-05 10:14:31 +02:00
if ( $user -> hasRight ( " product " , " read " ) || $user -> hasRight ( " service " , " read " )) {
2023-07-06 22:22:26 +02:00
$permission = ( $user -> hasRight ( 'produit' , 'creer' ) || $user -> hasRight ( 'service' , 'creer' ));
2024-11-15 14:09:04 +01:00
$showclassifyform = ( $user -> hasRight ( 'produit' , 'creer' ) || $user -> hasRight ( 'service' , 'creer' ));
2022-08-29 11:22:27 +02:00
2024-12-03 19:20:51 +01:00
$prods = $object -> getObjectsInCateg ( $type , 0 , $limit , $offset , 'ref' );
2022-08-29 11:22:27 +02:00
if ( $prods < 0 ) {
dol_print_error ( $db , $object -> error , $object -> errors );
} else {
2024-01-12 17:11:08 +01:00
/** @var Product[] $prods */
2024-03-24 20:01:27 +01:00
'@phan-var-force Product[] $prods' ;
2023-07-01 16:07:58 +02:00
// Form to add record into the category
2014-10-09 17:18:14 +02:00
print '<form method="post" action="' . $_SERVER [ " PHP_SELF " ] . '">' ;
2019-12-18 23:12:31 +01:00
print '<input type="hidden" name="token" value="' . newToken () . '">' ;
2014-10-09 17:18:14 +02:00
print '<input type="hidden" name="typeid" value="' . $typeid . '">' ;
print '<input type="hidden" name="type" value="' . $typeid . '">' ;
print '<input type="hidden" name="id" value="' . $object -> id . '">' ;
2024-11-08 10:08:06 +01:00
print '<input type="hidden" name="page_y" value="">' ;
2022-08-29 11:22:27 +02:00
print '<input type="hidden" name="action" value="list">' ;
2020-04-02 14:32:54 +02:00
2022-08-29 11:22:27 +02:00
print '<br>' ;
2023-07-01 16:07:58 +02:00
$param = '&limit=' . $limit . '&id=' . $id . '&type=' . $type ;
$num = count ( $prods );
$nbtotalofrecords = '' ;
2024-07-10 18:59:04 +02:00
$newcardbutton = dolGetButtonTitle ( $langs -> trans ( " AddProduct " ), '' , 'fa fa-plus-circle' , DOL_URL_ROOT . '/product/card.php?action=create&categories[]=' . $object -> id . '&backtopage=' . urlencode ( $_SERVER [ " PHP_SELF " ] . '?id=' . $object -> id ), '' , $user -> hasRight ( 'societe' , 'creer' ));
2023-07-01 16:07:58 +02:00
2024-03-08 12:34:25 +01:00
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
2022-08-29 11:22:27 +02:00
print_barre_liste ( $langs -> trans ( " ProductsAndServices " ), $page , $_SERVER [ " PHP_SELF " ], $param , $sortfield , $sortorder , $massactionbutton , $num , $nbtotalofrecords , 'products' , 0 , $newcardbutton , '' , $limit );
2024-11-08 10:08:06 +01:00
if ( $showclassifyform ) {
print '<table class="noborder centpercent">' ;
print '<tr class="liste_titre"><td>' ;
print $langs -> trans ( " AddProductServiceIntoCategory " ) . ' ' ;
2024-11-12 00:35:14 +01:00
$form -> select_produits ( 0 , 'elemid' , '' , 0 , 0 , - 1 , 2 , '' , 1 , array (), 0 , 1 , 0 , '' , 0 , '' , null );
2024-11-08 10:08:06 +01:00
print '<input type="submit" class="button buttongen" name="addintocategory" value="' . $langs -> trans ( " ClassifyInCategory " ) . '"></td>' ;
print '</tr>' ;
print '</table>' ;
}
2022-08-29 11:22:27 +02:00
print '<table class="noborder centpercent">' . " \n " ;
print '<tr class="liste_titre"><td colspan="3">' . $langs -> trans ( " Ref " ) . '</td></tr>' . " \n " ;
if ( count ( $prods ) > 0 ) {
$i = 0 ;
foreach ( $prods as $prod ) {
$i ++ ;
if ( $i > $limit ) {
break ;
}
print " \t " . '<tr class="oddeven">' . " \n " ;
print '<td class="nowrap" valign="top">' ;
print $prod -> getNomUrl ( 1 );
print " </td> \n " ;
print '<td class="tdtop">' . $prod -> label . " </td> \n " ;
// Link to delete from category
print '<td class="right">' ;
if ( $permission ) {
2025-02-06 12:32:00 +01:00
print '<a class="reposition" href= "' . $_SERVER [ 'PHP_SELF' ] . " ? " . ( empty ( $socid ) ? 'id' : 'socid' ) . " = " . (( int ) $object -> id ) . " &type= " . urlencode ( $typeid ) . " &action=unlink&token= " . newToken () . " &removeelem= " . (( int ) $prod -> id ) . ( $limit ? '&limit=' . $limit : '' ) . '">' ;
2024-11-08 11:04:46 +01:00
//print $langs->trans("DeleteFromCat");
2024-09-25 22:21:31 +02:00
print img_picto ( $langs -> trans ( " DeleteFromCat " ), 'unlink' , '' , 0 , 0 , 0 , '' , 'paddingleft' );
2022-08-29 11:22:27 +02:00
print " </a> " ;
}
print '</td>' ;
print " </tr> \n " ;
2013-04-21 23:44:33 +02:00
}
2022-08-29 11:22:27 +02:00
} else {
2023-07-01 16:07:58 +02:00
print '<tr class="oddeven"><td colspan="2"><span class="opacitymedium">' . $langs -> trans ( " ThisCategoryHasNoItems " ) . '</span></td></tr>' ;
2007-04-30 12:53:58 +02:00
}
2022-08-29 11:22:27 +02:00
print " </table> \n " ;
2019-09-10 01:44:36 +02:00
2022-08-29 11:22:27 +02:00
print '</form>' . " \n " ;
}
} else {
2024-07-09 19:28:59 +02:00
print_barre_liste ( $langs -> trans ( " ProductsAndServices " ), null , $_SERVER [ " PHP_SELF " ], '' , '' , '' , '' , 0 , '' , 'products' );
2022-09-09 13:58:54 +02:00
accessforbidden ( " NotEnoughPermissions " , 0 , 0 );
2007-04-30 12:53:58 +02:00
}
2005-04-13 14:04:02 +02:00
}
2007-04-30 12:53:58 +02:00
2021-10-22 17:15:51 +02:00
// List of customers
2021-02-23 18:04:37 +01:00
if ( $type == Categorie :: TYPE_CUSTOMER ) {
2022-08-29 11:22:27 +02:00
if ( $user -> hasRight ( " societe " , " read " )) {
2023-02-20 18:55:52 +01:00
$permission = $user -> hasRight ( 'societe' , 'creer' );
2024-11-15 14:09:04 +01:00
$showclassifyform = $user -> hasRight ( 'societe' , 'creer' );
2022-08-29 11:22:27 +02:00
2024-12-03 19:20:51 +01:00
$socs = $object -> getObjectsInCateg ( $type , 0 , $limit , $offset , 'nom' );
2022-08-29 11:22:27 +02:00
if ( $socs < 0 ) {
dol_print_error ( $db , $object -> error , $object -> errors );
} else {
2024-01-12 17:11:08 +01:00
/** @var Societe[] $socs */
2024-03-24 20:01:27 +01:00
'@phan-var-force Societe[] $socs' ;
2022-08-29 11:22:27 +02:00
// Form to add record into a category
2020-10-22 16:12:01 +02:00
print '<form method="post" action="' . $_SERVER [ " PHP_SELF " ] . '">' ;
print '<input type="hidden" name="token" value="' . newToken () . '">' ;
print '<input type="hidden" name="typeid" value="' . $typeid . '">' ;
print '<input type="hidden" name="type" value="' . $typeid . '">' ;
print '<input type="hidden" name="id" value="' . $object -> id . '">' ;
2022-08-29 11:22:27 +02:00
print '<input type="hidden" name="action" value="list">' ;
2024-11-08 10:08:06 +01:00
print '<input type="hidden" name="page_y" value="">' ;
2020-10-22 16:12:01 +02:00
2022-08-29 11:22:27 +02:00
print '<br>' ;
2023-07-01 16:07:58 +02:00
$param = '&limit=' . $limit . '&id=' . $id . '&type=' . $type ;
$num = count ( $socs );
$nbtotalofrecords = '' ;
2024-07-10 18:59:04 +02:00
$newcardbutton = dolGetButtonTitle ( $langs -> trans ( " AddThirdParty " ), '' , 'fa fa-plus-circle' , DOL_URL_ROOT . '/societe/card.php?action=create&client=3&custcats[]=' . $object -> id . '&backtopage=' . urlencode ( $_SERVER [ " PHP_SELF " ] . '?id=' . $object -> id ), '' , $user -> hasRight ( 'societe' , 'creer' ));
2023-07-01 16:07:58 +02:00
2024-03-08 12:34:25 +01:00
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
2022-08-29 11:22:27 +02:00
print_barre_liste ( $langs -> trans ( " Customers " ), $page , $_SERVER [ " PHP_SELF " ], $param , $sortfield , $sortorder , $massactionbutton , $num , $nbtotalofrecords , 'companies' , 0 , $newcardbutton , '' , $limit );
2024-11-08 10:08:06 +01:00
if ( $showclassifyform ) {
print '<table class="noborder centpercent">' ;
print '<tr class="liste_titre"><td>' ;
print $langs -> trans ( " AddCustomerIntoCategory " ) . ' ' ;
2024-11-16 10:58:48 +01:00
$filter = '(s.client:IN:1,2,3)' ;
2024-11-08 10:08:06 +01:00
print $form -> select_company ( '' , 'elemid' , $filter );
print '<input type="submit" class="reposition button buttongen" name="addintocategory" value="' . $langs -> trans ( " ClassifyInCategory " ) . '"></td>' ;
print '</tr>' ;
print '</table>' ;
}
2022-08-29 11:22:27 +02:00
print '<table class="noborder centpercent">' . " \n " ;
print '<tr class="liste_titre"><td colspan="2">' . $langs -> trans ( " Name " ) . '</td></tr>' . " \n " ;
if ( count ( $socs ) > 0 ) {
$i = 0 ;
foreach ( $socs as $key => $soc ) {
$i ++ ;
if ( $i > $limit ) {
break ;
}
print " \t " . '<tr class="oddeven">' . " \n " ;
2024-11-08 09:13:34 +01:00
print '<td class="nowrap tdtop tdoverflowmax250">' ;
2022-08-29 11:22:27 +02:00
print $soc -> getNomUrl ( 1 );
print " </td> \n " ;
// Link to delete from category
print '<td class="right">' ;
if ( $permission ) {
2025-02-06 12:32:00 +01:00
print " <a href= ' " . $_SERVER [ 'PHP_SELF' ] . " ? " . ( empty ( $socid ) ? 'id' : 'socid' ) . " = " . $object -> id . " &type= " . urlencode ( $typeid ) . " &action=unlink&token= " . newToken () . " &removeelem= " . (( int ) $soc -> id ) . ( $limit ? '&limit=' . $limit : '' ) . " '> " ;
2024-11-08 11:04:46 +01:00
//print $langs->trans("DeleteFromCat");
2024-09-25 22:21:31 +02:00
print img_picto ( $langs -> trans ( " DeleteFromCat " ), 'unlink' , '' , 0 , 0 , 0 , '' , 'paddingleft' );
2022-08-29 11:22:27 +02:00
print " </a> " ;
}
print '</td>' ;
print " </tr> \n " ;
2013-06-05 16:24:32 +02:00
}
2022-08-29 11:22:27 +02:00
} else {
2023-07-01 16:07:58 +02:00
print '<tr class="oddeven"><td colspan="2"><span class="opacitymedium">' . $langs -> trans ( " ThisCategoryHasNoItems " ) . '</span></td></tr>' ;
2007-04-30 12:53:58 +02:00
}
2022-08-29 11:22:27 +02:00
print " </table> \n " ;
2019-09-10 01:44:36 +02:00
2022-08-29 11:22:27 +02:00
print '</form>' . " \n " ;
}
} else {
2024-07-09 19:28:59 +02:00
print_barre_liste ( $langs -> trans ( " Customers " ), null , $_SERVER [ " PHP_SELF " ], '' , '' , '' , '' , 0 , '' , 'companies' );
2022-09-09 13:58:54 +02:00
accessforbidden ( " NotEnoughPermissions " , 0 , 0 );
2007-04-30 12:53:58 +02:00
}
}
2021-10-22 17:15:51 +02:00
// List of suppliers
2021-02-23 18:04:37 +01:00
if ( $type == Categorie :: TYPE_SUPPLIER ) {
2022-08-29 11:22:27 +02:00
if ( $user -> hasRight ( " fournisseur " , " read " )) {
2023-02-20 18:55:52 +01:00
$permission = $user -> hasRight ( 'societe' , 'creer' );
2024-11-15 14:09:04 +01:00
$showclassifyform = $user -> hasRight ( 'societe' , 'creer' );
2022-08-29 11:22:27 +02:00
2024-12-03 19:20:51 +01:00
$socs = $object -> getObjectsInCateg ( $type , 0 , $limit , $offset , 'nom' );
2024-04-10 16:31:50 +02:00
2022-08-29 11:22:27 +02:00
if ( $socs < 0 ) {
dol_print_error ( $db , $object -> error , $object -> errors );
} else {
2024-01-12 17:11:08 +01:00
/** @var Fournisseur[] $socs */
2024-03-24 20:01:27 +01:00
'@phan-var-force Fournisseur[] $socs' ;
2022-08-29 11:22:27 +02:00
// Form to add record into a category
2020-10-22 16:12:01 +02:00
print '<form method="post" action="' . $_SERVER [ " PHP_SELF " ] . '">' ;
print '<input type="hidden" name="token" value="' . newToken () . '">' ;
print '<input type="hidden" name="typeid" value="' . $typeid . '">' ;
print '<input type="hidden" name="type" value="' . $typeid . '">' ;
print '<input type="hidden" name="id" value="' . $object -> id . '">' ;
2024-11-08 10:08:06 +01:00
print '<input type="hidden" name="page_y" value="">' ;
2022-08-29 11:22:27 +02:00
print '<input type="hidden" name="action" value="list">' ;
2017-06-07 16:44:04 +02:00
2022-08-29 11:22:27 +02:00
print '<br>' ;
2023-07-01 16:07:58 +02:00
$param = '&limit=' . $limit . '&id=' . $id . '&type=' . $type ;
$num = count ( $socs );
$nbtotalofrecords = '' ;
2024-07-10 18:59:04 +02:00
$newcardbutton = dolGetButtonTitle ( $langs -> trans ( " AddSupplier " ), '' , 'fa fa-plus-circle' , DOL_URL_ROOT . '/societe/card.php?action=create&fournisseur=1&suppcats[]=' . $object -> id . '&backtopage=' . urlencode ( $_SERVER [ " PHP_SELF " ] . '?id=' . $object -> id ), '' , $user -> hasRight ( 'societe' , 'creer' ));
2023-07-01 16:07:58 +02:00
2024-03-08 12:34:25 +01:00
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
2022-08-29 11:22:27 +02:00
print_barre_liste ( $langs -> trans ( " Suppliers " ), $page , $_SERVER [ " PHP_SELF " ], $param , $sortfield , $sortorder , $massactionbutton , $num , $nbtotalofrecords , 'companies' , 0 , $newcardbutton , '' , $limit );
2024-11-08 10:08:06 +01:00
if ( $showclassifyform ) {
print '<table class="noborder centpercent">' ;
print '<tr class="liste_titre"><td>' ;
print $langs -> trans ( " AddSupplierIntoCategory " ) . ' ' ;
$filter = '(s.fournisseur:=:1)' ;
print $form -> select_company ( '' , 'elemid' , $filter );
print '<input type="submit" class="button buttongen" name="addintocategory" value="' . $langs -> trans ( " ClassifyInCategory " ) . '"></td>' ;
print '</tr>' ;
print '</table>' ;
}
2022-08-29 11:22:27 +02:00
print '<table class="noborder centpercent">' . " \n " ;
print '<tr class="liste_titre"><td colspan="2">' . $langs -> trans ( " Name " ) . " </td></tr> \n " ;
if ( count ( $socs ) > 0 ) {
$i = 0 ;
foreach ( $socs as $soc ) {
$i ++ ;
if ( $i > $limit ) {
break ;
}
print " \t " . '<tr class="oddeven">' . " \n " ;
2023-07-01 16:07:58 +02:00
print '<td class="nowrap tdtop">' ;
2022-08-29 11:22:27 +02:00
print $soc -> getNomUrl ( 1 );
print " </td> \n " ;
// Link to delete from category
print '<td class="right">' ;
if ( $permission ) {
2025-02-06 12:32:00 +01:00
print '<a class="reposition" href="' . $_SERVER [ 'PHP_SELF' ] . " ? " . ( empty ( $socid ) ? 'id' : 'socid' ) . " = " . $object -> id . " &type= " . urlencode ( $typeid ) . " &action=unlink&token= " . newToken () . " &removeelem= " . (( int ) $soc -> id ) . ( $limit ? '&limit=' . $limit : '' ) . '">' ;
2024-11-08 11:04:46 +01:00
//print $langs->trans("DeleteFromCat");
2024-09-25 22:21:31 +02:00
print img_picto ( $langs -> trans ( " DeleteFromCat " ), 'unlink' , '' , 0 , 0 , 0 , '' , 'paddingleft' );
2022-08-29 11:22:27 +02:00
print " </a> " ;
}
print '</td>' ;
print " </tr> \n " ;
2013-06-05 16:24:32 +02:00
}
2022-08-29 11:22:27 +02:00
} else {
2023-07-01 16:07:58 +02:00
print '<tr class="oddeven"><td colspan="2"><span class="opacitymedium">' . $langs -> trans ( " ThisCategoryHasNoItems " ) . '</span></td></tr>' ;
2007-04-30 12:53:58 +02:00
}
2022-08-29 11:22:27 +02:00
print " </table> \n " ;
2019-09-10 01:44:36 +02:00
2022-08-29 11:22:27 +02:00
print '</form>' . " \n " ;
}
} else {
2024-07-09 19:28:59 +02:00
print_barre_liste ( $langs -> trans ( " Suppliers " ), null , $_SERVER [ " PHP_SELF " ], '' , '' , '' , '' , 0 , '' , 'companies' );
2022-09-09 13:58:54 +02:00
accessforbidden ( " NotEnoughPermissions " , 0 , 0 );
2006-03-03 21:52:01 +01:00
}
2005-04-13 14:04:02 +02:00
}
2010-03-20 01:07:47 +01:00
// List of members
2021-02-23 18:04:37 +01:00
if ( $type == Categorie :: TYPE_MEMBER ) {
2022-08-29 11:22:27 +02:00
if ( $user -> hasRight ( " adherent " , " read " )) {
require_once DOL_DOCUMENT_ROOT . '/adherents/class/adherent.class.php' ;
2010-03-20 01:07:47 +01:00
2022-09-09 10:29:27 +02:00
$permission = $user -> hasRight ( 'adherent' , 'creer' );
2024-11-15 14:09:04 +01:00
$showclassifyform = $user -> hasRight ( 'adherent' , 'creer' );
2022-08-29 11:22:27 +02:00
2024-12-03 19:20:51 +01:00
$members = $object -> getObjectsInCateg ( $type , 0 , $limit , $offset , 'lastname' );
2024-01-12 17:11:08 +01:00
if ( $members < 0 ) {
2022-08-29 11:22:27 +02:00
dol_print_error ( $db , $object -> error , $object -> errors );
} else {
2024-01-12 17:11:08 +01:00
/** @var Adherent[] $members */
2024-03-24 20:01:27 +01:00
'@phan-var-force Adherent[] $members' ;
2022-08-29 11:22:27 +02:00
// Form to add record into a category
2021-10-22 16:13:54 +02:00
print '<form method="post" action="' . $_SERVER [ " PHP_SELF " ] . '">' ;
print '<input type="hidden" name="token" value="' . newToken () . '">' ;
print '<input type="hidden" name="typeid" value="' . $typeid . '">' ;
print '<input type="hidden" name="type" value="' . $typeid . '">' ;
print '<input type="hidden" name="id" value="' . $object -> id . '">' ;
2024-11-08 10:08:06 +01:00
print '<input type="hidden" name="page_y" value="">' ;
2022-08-29 11:22:27 +02:00
print '<input type="hidden" name="action" value="list">' ;
2019-09-10 01:44:36 +02:00
2022-08-29 11:22:27 +02:00
print '<br>' ;
2023-07-01 16:07:58 +02:00
$param = '&limit=' . $limit . '&id=' . $id . '&type=' . $type ;
2024-01-12 17:11:08 +01:00
$num = count ( $members );
2023-07-01 16:07:58 +02:00
$nbtotalofrecords = '' ;
2022-09-09 10:29:27 +02:00
$newcardbutton = dolGetButtonTitle ( $langs -> trans ( " AddMember " ), '' , 'fa fa-plus-circle' , DOL_URL_ROOT . '/adherents/card.php?action=create&memcats[]=' . $object -> id . '&backtopage=' . urlencode ( $_SERVER [ " PHP_SELF " ] . '?id=' . $object -> id ), '' , $user -> hasRight ( 'adherent' , 'creer' ));
2023-07-01 16:07:58 +02:00
2024-03-08 12:34:25 +01:00
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
2022-08-29 11:22:27 +02:00
print_barre_liste ( $langs -> trans ( " Member " ), $page , $_SERVER [ " PHP_SELF " ], $param , $sortfield , $sortorder , $massactionbutton , $num , $nbtotalofrecords , 'members' , 0 , $newcardbutton , '' , $limit );
2024-11-08 10:08:06 +01:00
if ( $showclassifyform ) {
print '<table class="noborder centpercent">' ;
print '<tr class="liste_titre"><td>' ;
print $langs -> trans ( " AssignCategoryTo " ) . ' ' ;
print $form -> selectMembers ( '' , 'elemid' );
print '<input type="submit" class="button buttongen" value="' . $langs -> trans ( " Save " ) . '"></td>' ;
print '</tr>' ;
print '</table>' ;
}
2024-09-29 13:09:09 +02:00
print '<table class="noborder centpercent">' . " \n " ;
2022-08-29 11:22:27 +02:00
print '<tr class="liste_titre"><td colspan="4">' . $langs -> trans ( " Name " ) . '</td></tr>' . " \n " ;
2024-01-12 17:11:08 +01:00
if ( count ( $members ) > 0 ) {
2022-08-29 11:22:27 +02:00
$i = 0 ;
2024-01-12 17:11:08 +01:00
foreach ( $members as $key => $member ) {
2022-08-29 11:22:27 +02:00
$i ++ ;
if ( $i > $limit ) {
break ;
}
print " \t " . '<tr class="oddeven">' . " \n " ;
2023-07-01 16:07:58 +02:00
print '<td class="nowrap tdtop">' ;
2022-08-29 11:22:27 +02:00
$member -> ref = $member -> login ;
print $member -> getNomUrl ( 1 , 0 );
print " </td> \n " ;
print '<td class="tdtop">' . $member -> lastname . " </td> \n " ;
print '<td class="tdtop">' . $member -> firstname . " </td> \n " ;
// Link to delete from category
print '<td class="right">' ;
if ( $permission ) {
2025-02-06 12:32:00 +01:00
print " <a href= ' " . $_SERVER [ 'PHP_SELF' ] . " ? " . ( empty ( $socid ) ? 'id' : 'socid' ) . " = " . $object -> id . " &type= " . urlencode ( $typeid ) . " &action=unlink&token= " . newToken () . " &removeelem= " . (( int ) $member -> id ) . ( $limit ? '&limit=' . $limit : '' ) . " '> " ;
2024-11-08 11:04:46 +01:00
//print $langs->trans("DeleteFromCat");
2024-09-25 22:21:31 +02:00
print img_picto ( $langs -> trans ( " DeleteFromCat " ), 'unlink' , '' , 0 , 0 , 0 , '' , 'paddingleft' );
2022-08-29 11:22:27 +02:00
print " </a> " ;
}
2023-07-01 16:07:58 +02:00
print '</td>' ;
2022-08-29 11:22:27 +02:00
print " </tr> \n " ;
2013-04-21 23:44:33 +02:00
}
2022-08-29 11:22:27 +02:00
} else {
2023-07-01 16:07:58 +02:00
print '<tr class="oddeven"><td colspan="4"><span class="opacitymedium">' . $langs -> trans ( " ThisCategoryHasNoItems " ) . '</span></td></tr>' ;
2010-03-20 01:07:47 +01:00
}
2022-08-29 11:22:27 +02:00
print " </table> \n " ;
2019-09-10 01:44:36 +02:00
2022-08-29 11:22:27 +02:00
print '</form>' . " \n " ;
}
} else {
2024-07-09 19:28:59 +02:00
print_barre_liste ( $langs -> trans ( " Member " ), null , $_SERVER [ " PHP_SELF " ], '' , '' , '' , '' , 0 , '' , 'members' );
2022-09-09 13:58:54 +02:00
accessforbidden ( " NotEnoughPermissions " , 0 , 0 );
2010-03-20 01:07:47 +01:00
}
}
2022-07-29 12:31:51 +02:00
// List of contacts
2021-02-23 18:04:37 +01:00
if ( $type == Categorie :: TYPE_CONTACT ) {
2022-08-29 11:22:27 +02:00
if ( $user -> hasRight ( " societe " , " read " )) {
2023-02-20 18:55:52 +01:00
$permission = $user -> hasRight ( 'societe' , 'creer' );
2024-11-15 14:09:04 +01:00
$showclassifyform = $user -> hasRight ( 'societe' , 'creer' );
2020-04-02 14:32:54 +02:00
2024-12-03 19:20:51 +01:00
$contacts = $object -> getObjectsInCateg ( $type , 0 , $limit , $offset , 'lastname' );
2022-08-29 11:22:27 +02:00
if ( is_numeric ( $contacts ) && $contacts < 0 ) {
dol_print_error ( $db , $object -> error , $object -> errors );
} else {
2024-01-12 17:11:08 +01:00
/** @var Contact[] $contacts */
2024-03-24 20:01:27 +01:00
'@phan-var-force Contact[] $contacts' ;
2022-08-29 11:22:27 +02:00
// Form to add record into a category
2021-10-22 16:46:55 +02:00
print '<form method="post" action="' . $_SERVER [ " PHP_SELF " ] . '">' ;
print '<input type="hidden" name="token" value="' . newToken () . '">' ;
print '<input type="hidden" name="typeid" value="' . $typeid . '">' ;
print '<input type="hidden" name="type" value="' . $typeid . '">' ;
print '<input type="hidden" name="id" value="' . $object -> id . '">' ;
2024-11-08 10:08:06 +01:00
print '<input type="hidden" name="page_y" value="">' ;
2022-08-29 11:22:27 +02:00
print '<input type="hidden" name="action" value="list">' ;
2017-06-07 16:44:04 +02:00
2022-08-29 11:22:27 +02:00
print '<br>' ;
$param = '&limit=' . $limit . '&id=' . $id . '&type=' . $type ;
$num = count ( $contacts );
$nbtotalofrecords = '' ;
2024-07-10 18:59:04 +02:00
$newcardbutton = dolGetButtonTitle ( $langs -> trans ( " AddContact " ), '' , 'fa fa-plus-circle' , DOL_URL_ROOT . '/contact/card.php?action=create&contcats[]=' . $object -> id . '&backtopage=' . urlencode ( $_SERVER [ " PHP_SELF " ] . '?id=' . $object -> id ), '' , $user -> hasRight ( 'societe' , 'creer' ));
2023-07-01 16:07:58 +02:00
2024-11-08 10:08:06 +01:00
$objsoc = new Societe ( $db );
2024-03-08 12:34:25 +01:00
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
2022-08-29 11:22:27 +02:00
print_barre_liste ( $langs -> trans ( " Contact " ), $page , $_SERVER [ " PHP_SELF " ], $param , $sortfield , $sortorder , $massactionbutton , $num , $nbtotalofrecords , 'contact' , 0 , $newcardbutton , '' , $limit );
2024-11-08 10:08:06 +01:00
if ( $showclassifyform ) {
print '<table class="noborder centpercent">' ;
print '<tr class="liste_titre"><td>' ;
print $langs -> trans ( " AssignCategoryTo " ) . ' ' ;
print $form -> select_contact ( 0 , '' , 'elemid' , '' , '' , '' , 0 , 'maxwidth300 widthcentpercentminusx' );
print '<input type="submit" class="button buttongen" name="addintocategory" value="' . $langs -> trans ( " ClassifyInCategory " ) . '"></td>' ;
print '</tr>' ;
print '</table>' ;
}
2023-07-01 16:07:58 +02:00
2022-08-29 11:22:27 +02:00
print '<table class="noborder centpercent">' . " \n " ;
print '<tr class="liste_titre"><td colspan="2">' . $langs -> trans ( " Ref " ) . '</td></tr>' . " \n " ;
if ( is_array ( $contacts ) && count ( $contacts ) > 0 ) {
$i = 0 ;
foreach ( $contacts as $key => $contact ) {
$i ++ ;
if ( $i > $limit ) {
break ;
}
print " \t " . '<tr class="oddeven">' . " \n " ;
2023-07-01 16:07:58 +02:00
print '<td class="nowrap tdtop">' ;
2022-08-29 11:22:27 +02:00
print $contact -> getNomUrl ( 1 , 'category' );
if ( $contact -> socid > 0 ) {
$objsoc -> fetch ( $contact -> socid );
print ' - ' ;
print $objsoc -> getNomUrl ( 1 , 'contact' );
}
print " </td> \n " ;
// Link to delete from category
print '<td class="right">' ;
if ( $permission ) {
2025-02-06 12:32:00 +01:00
print " <a href= ' " . $_SERVER [ 'PHP_SELF' ] . " ? " . ( empty ( $socid ) ? 'id' : 'socid' ) . " = " . $object -> id . " &type= " . urlencode ( $typeid ) . " &action=unlink&token= " . newToken () . " &removeelem= " . (( int ) $contact -> id ) . ( $limit ? '&limit=' . $limit : '' ) . " '> " ;
2024-11-08 11:04:46 +01:00
//print $langs->trans("DeleteFromCat");
2024-09-25 22:21:31 +02:00
print img_picto ( $langs -> trans ( " DeleteFromCat " ), 'unlink' , '' , 0 , 0 , 0 , '' , 'paddingleft' );
2022-08-29 11:22:27 +02:00
print " </a> " ;
}
print '</td>' ;
print " </tr> \n " ;
2013-07-30 17:04:09 +02:00
}
2022-08-29 11:22:27 +02:00
} else {
2023-07-01 16:07:58 +02:00
print '<tr class="oddeven"><td colspan="2"><span class="opacitymedium">' . $langs -> trans ( " ThisCategoryHasNoItems " ) . '</span></td></tr>' ;
2013-07-30 17:04:09 +02:00
}
2022-08-29 11:22:27 +02:00
print " </table> \n " ;
2019-09-10 01:44:36 +02:00
2022-08-29 11:22:27 +02:00
print '</form>' . " \n " ;
}
} else {
2024-07-09 19:28:59 +02:00
print_barre_liste ( $langs -> trans ( " Contact " ), null , $_SERVER [ " PHP_SELF " ], '' , '' , '' , '' , 0 , '' , 'contact' );
2022-09-09 13:58:54 +02:00
accessforbidden ( " NotEnoughPermissions " , 0 , 0 );
2013-07-30 17:04:09 +02:00
}
}
2020-04-09 16:36:39 +02:00
// List of bank accounts
2021-02-23 18:04:37 +01:00
if ( $type == Categorie :: TYPE_ACCOUNT ) {
2022-08-29 11:22:27 +02:00
if ( $user -> hasRight ( " banque " , " read " )) {
require_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php' ;
2020-10-31 14:32:18 +01:00
2023-06-19 20:54:08 +02:00
$permission = $user -> hasRight ( 'banque' , 'creer' );
2024-11-15 14:09:04 +01:00
$showclassifyform = $user -> hasRight ( 'banque' , 'creer' );
2022-08-29 11:22:27 +02:00
$accounts = $object -> getObjectsInCateg ( $type , 0 , $limit , $offset );
if ( $accounts < 0 ) {
dol_print_error ( $db , $object -> error , $object -> errors );
} else {
2024-01-12 17:11:08 +01:00
/** @var Account[] $accounts */
2024-03-24 20:01:27 +01:00
'@phan-var-force Account[] $accounts' ;
2022-08-29 11:22:27 +02:00
// Form to add record into a category
2021-10-22 17:15:51 +02:00
print '<form method="post" action="' . $_SERVER [ " PHP_SELF " ] . '">' ;
print '<input type="hidden" name="token" value="' . newToken () . '">' ;
print '<input type="hidden" name="typeid" value="' . $typeid . '">' ;
print '<input type="hidden" name="type" value="' . $typeid . '">' ;
print '<input type="hidden" name="id" value="' . $object -> id . '">' ;
2024-11-08 10:08:06 +01:00
print '<input type="hidden" name="page_y" value="">' ;
2022-08-29 11:22:27 +02:00
print '<input type="hidden" name="action" value="list">' ;
2020-10-31 14:32:18 +01:00
2022-08-29 11:22:27 +02:00
print '<br>' ;
2023-07-01 16:07:58 +02:00
$param = '&limit=' . $limit . '&id=' . $id . '&type=' . $type ;
$num = count ( $accounts );
$nbtotalofrecords = '' ;
$newcardbutton = '' ;
2024-03-08 12:34:25 +01:00
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
2022-08-29 11:22:27 +02:00
print_barre_liste ( $langs -> trans ( " Account " ), $page , $_SERVER [ " PHP_SELF " ], $param , $sortfield , $sortorder , $massactionbutton , $num , $nbtotalofrecords , 'bank_account' , 0 , $newcardbutton , '' , $limit );
2024-11-08 10:08:06 +01:00
if ( $showclassifyform ) {
print '<table class="noborder centpercent">' ;
print '<tr class="liste_titre"><td>' ;
print $langs -> trans ( " AddObjectIntoCategory " ) . ' ' ;
print $form -> select_comptes ( '' , 'elemid' , 0 , '' , 0 , '' , 0 , '' , 1 );
print '<input type="submit" class="button buttongen" name="addintocategory" value="' . $langs -> trans ( " ClassifyInCategory " ) . '"></td>' ;
print '</tr>' ;
print '</table>' ;
}
2024-09-29 13:09:09 +02:00
print '<table class="noborder centpercent">' . " \n " ;
2022-08-29 11:22:27 +02:00
print '<tr class="liste_titre"><td colspan="4">' . $langs -> trans ( " Ref " ) . '</td></tr>' . " \n " ;
if ( count ( $accounts ) > 0 ) {
$i = 0 ;
foreach ( $accounts as $key => $account ) {
$i ++ ;
if ( $i > $limit ) {
break ;
}
print " \t " . '<tr class="oddeven">' . " \n " ;
2023-07-01 16:07:58 +02:00
print '<td class="nowrap tdtop">' ;
2022-08-29 11:22:27 +02:00
print $account -> getNomUrl ( 1 , 0 );
print " </td> \n " ;
print '<td class="tdtop">' . $account -> bank . " </td> \n " ;
print '<td class="tdtop">' . $account -> number . " </td> \n " ;
// Link to delete from category
print '<td class="right">' ;
if ( $permission ) {
2025-02-06 12:32:00 +01:00
print " <a href= ' " . $_SERVER [ 'PHP_SELF' ] . " ? " . ( empty ( $socid ) ? 'id' : 'socid' ) . " = " . $object -> id . " &type= " . urlencode ( $typeid ) . " &action=unlink&token= " . newToken () . " &removeelem= " . (( int ) $account -> id ) . ( $limit ? '&limit=' . $limit : '' ) . " '> " ;
2024-11-08 11:04:46 +01:00
//print $langs->trans("DeleteFromCat");
2024-09-25 22:21:31 +02:00
print img_picto ( $langs -> trans ( " DeleteFromCat " ), 'unlink' , '' , 0 , 0 , 0 , '' , 'paddingleft' );
2022-08-29 11:22:27 +02:00
print " </a> " ;
}
2023-07-01 16:07:58 +02:00
print '</td>' ;
2022-08-29 11:22:27 +02:00
print " </tr> \n " ;
2020-10-31 14:32:18 +01:00
}
2022-08-29 11:22:27 +02:00
} else {
2023-07-01 16:07:58 +02:00
print '<tr class="oddeven"><td colspan="4"><span class="opacitymedium">' . $langs -> trans ( " ThisCategoryHasNoItems " ) . '</span></td></tr>' ;
2020-10-31 14:32:18 +01:00
}
2022-08-29 11:22:27 +02:00
print " </table> \n " ;
2020-10-31 14:32:18 +01:00
2022-08-29 11:22:27 +02:00
print '</form>' . " \n " ;
}
} else {
2024-07-09 19:28:59 +02:00
print_barre_liste ( $langs -> trans ( " Banque " ), null , $_SERVER [ " PHP_SELF " ], '' , '' , '' , '' , 0 , '' , 'bank' );
2022-09-09 13:58:54 +02:00
accessforbidden ( " NotEnoughPermissions " , 0 , 0 );
2020-10-31 14:32:18 +01:00
}
2016-04-30 14:45:24 +02:00
}
2005-04-13 14:04:02 +02:00
2016-08-29 10:41:14 +02:00
// List of Project
2022-08-05 16:22:03 +02:00
if ( $type == Categorie :: TYPE_PROJECT ) {
2022-08-29 11:22:27 +02:00
if ( $user -> hasRight ( " project " , " read " )) {
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php' ;
2016-08-29 10:41:14 +02:00
2024-02-09 15:58:49 +01:00
$permission = $user -> hasRight ( 'projet' , 'creer' );
2024-11-15 14:09:04 +01:00
$showclassifyform = $user -> hasRight ( 'projet' , 'creer' );
2022-08-29 11:22:27 +02:00
$objects = $object -> getObjectsInCateg ( $type , 0 , $limit , $offset );
if ( $objects < 0 ) {
dol_print_error ( $db , $object -> error , $object -> errors );
} else {
2024-01-12 17:11:08 +01:00
/** @var Project $object */
2024-03-24 20:01:27 +01:00
'@phan-var-force Project $object' ;
2022-08-29 11:22:27 +02:00
// Form to add record into a category
2021-10-22 15:48:39 +02:00
print '<form method="post" action="' . $_SERVER [ " PHP_SELF " ] . '">' ;
print '<input type="hidden" name="token" value="' . newToken () . '">' ;
print '<input type="hidden" name="typeid" value="' . $typeid . '">' ;
print '<input type="hidden" name="type" value="' . $typeid . '">' ;
print '<input type="hidden" name="id" value="' . $object -> id . '">' ;
2024-11-08 10:08:06 +01:00
print '<input type="hidden" name="page_y" value="">' ;
2022-08-29 11:22:27 +02:00
print '<input type="hidden" name="action" value="list">' ;
2019-09-10 01:44:36 +02:00
2022-08-29 11:22:27 +02:00
print '<br>' ;
2023-07-01 16:07:58 +02:00
$param = '&limit=' . $limit . '&id=' . $id . '&type=' . $type ;
$num = count ( $objects );
$nbtotalofrecords = '' ;
$newcardbutton = '' ;
2022-08-29 11:22:27 +02:00
2024-03-08 12:34:25 +01:00
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
2022-08-29 11:22:27 +02:00
print_barre_liste ( $langs -> trans ( " Project " ), $page , $_SERVER [ " PHP_SELF " ], $param , $sortfield , $sortorder , $massactionbutton , $num , $nbtotalofrecords , 'project' , 0 , $newcardbutton , '' , $limit );
2024-11-08 10:08:06 +01:00
if ( $showclassifyform ) {
print '<table class="noborder centpercent">' ;
print '<tr class="liste_titre"><td>' ;
print $langs -> trans ( " AddObjectIntoCategory " ) . ' ' ;
$form -> selectProjects ( '' , 'elemid' );
print '<input type="submit" class="button buttongen" name="addintocategory" value="' . $langs -> trans ( " ClassifyInCategory " ) . '"></td>' ;
print '</tr>' ;
print '</table>' ;
}
2024-09-29 13:09:09 +02:00
print '<table class="noborder centpercent">' . " \n " ;
2022-08-29 11:22:27 +02:00
print '<tr class="liste_titre"><td colspan="4">' . $langs -> trans ( " Ref " ) . '</td></tr>' . " \n " ;
if ( count ( $objects ) > 0 ) {
$i = 0 ;
foreach ( $objects as $key => $project ) {
$i ++ ;
if ( $i > $limit ) {
break ;
}
print " \t " . '<tr class="oddeven">' . " \n " ;
2023-07-01 16:07:58 +02:00
print '<td class="nowrap tdtop">' ;
2022-08-29 11:22:27 +02:00
print $project -> getNomUrl ( 1 );
print " </td> \n " ;
print '<td class="tdtop">' . $project -> title . " </td> \n " ;
// Link to delete from category
print '<td class="right">' ;
if ( $permission ) {
2025-02-06 12:32:00 +01:00
print " <a href= ' " . $_SERVER [ 'PHP_SELF' ] . " ? " . ( empty ( $socid ) ? 'id' : 'socid' ) . " = " . $object -> id . " &type= " . urlencode ( $typeid ) . " &action=unlink&token= " . newToken () . " &removeelem= " . (( int ) $project -> id ) . ( $limit ? '&limit=' . $limit : '' ) . " '> " ;
2024-11-08 11:04:46 +01:00
//print $langs->trans("DeleteFromCat");
2024-09-25 22:21:31 +02:00
print img_picto ( $langs -> trans ( " DeleteFromCat " ), 'unlink' , '' , 0 , 0 , 0 , '' , 'paddingleft' );
2022-08-29 11:22:27 +02:00
print " </a> " ;
}
2023-07-01 16:07:58 +02:00
print '</td>' ;
2022-08-29 11:22:27 +02:00
print " </tr> \n " ;
2016-08-29 10:41:14 +02:00
}
2022-08-29 11:22:27 +02:00
} else {
2023-07-01 16:07:58 +02:00
print '<tr class="oddeven"><td colspan="4"><span class="opacitymedium">' . $langs -> trans ( " ThisCategoryHasNoItems " ) . '</span></td></tr>' ;
2016-08-29 10:41:14 +02:00
}
2022-08-29 11:22:27 +02:00
print " </table> \n " ;
2019-09-10 01:44:36 +02:00
2022-08-29 11:22:27 +02:00
print '</form>' . " \n " ;
}
} else {
2024-07-09 19:28:59 +02:00
print_barre_liste ( $langs -> trans ( " Project " ), null , $_SERVER [ " PHP_SELF " ], '' , '' , '' , '' , 0 , '' , 'project' );
2022-09-09 13:58:54 +02:00
accessforbidden ( " NotEnoughPermissions " , 0 , 0 );
2016-08-29 10:41:14 +02:00
}
}
2020-02-03 11:01:58 +01:00
// List of users
2022-08-29 11:22:27 +02:00
if ( $type == Categorie :: TYPE_USER ) {
if ( $user -> hasRight ( " user " , " user " , " read " )) {
require_once DOL_DOCUMENT_ROOT . '/user/class/user.class.php' ;
2024-11-15 14:09:04 +01:00
$showclassifyform = $user -> hasRight ( " user " , " user " , " creer " );
2020-02-03 11:01:58 +01:00
2024-12-04 15:14:53 +01:00
$users = $object -> getObjectsInCateg ( $type , 0 , 0 , 0 , 'lastname' );
2022-08-29 11:22:27 +02:00
if ( $users < 0 ) {
dol_print_error ( $db , $object -> error , $object -> errors );
} else {
2024-01-12 17:11:08 +01:00
/** @var User[] $users */
2024-03-24 20:01:27 +01:00
'@phan-var-force User[] $users' ;
2022-08-29 11:22:27 +02:00
// Form to add record into a category
2021-10-22 16:54:31 +02:00
print '<form method="post" action="' . $_SERVER [ " PHP_SELF " ] . '">' ;
print '<input type="hidden" name="token" value="' . newToken () . '">' ;
print '<input type="hidden" name="typeid" value="' . $typeid . '">' ;
print '<input type="hidden" name="type" value="' . $typeid . '">' ;
print '<input type="hidden" name="id" value="' . $object -> id . '">' ;
2024-11-08 10:08:06 +01:00
print '<input type="hidden" name="page_y" value="">' ;
2022-08-29 11:22:27 +02:00
print '<input type="hidden" name="action" value="list">' ;
print '<br>' ;
$param = '&limit=' . $limit . '&id=' . $id . '&type=' . $type ;
$num = count ( $users );
2023-07-01 16:07:58 +02:00
$nbtotalofrecords = '' ;
$newcardbutton = '' ;
2022-08-29 11:22:27 +02:00
2024-03-08 12:34:25 +01:00
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
2023-07-01 16:07:58 +02:00
print_barre_liste ( $langs -> trans ( " Users " ), $page , $_SERVER [ " PHP_SELF " ], $param , $sortfield , $sortorder , $massactionbutton , $num , $nbtotalofrecords , 'user' , 0 , '' , '' , $limit );
2022-08-29 11:22:27 +02:00
2024-11-08 10:08:06 +01:00
if ( $showclassifyform ) {
print '<table class="noborder centpercent">' ;
print '<tr class="liste_titre"><td>' ;
$force_entity = getEntity ( $object -> element ); // So we will get same filter than the getObjectsInCateg()
print img_picto ( '' , $type , 'class="pictofixedwidth"' );
print $form -> select_dolusers ( '' , 'elemid' , 1 , null , 0 , '' , '' , $force_entity );
print '<input type="submit" class="button buttongen" name="addintocategory" value="' . $langs -> trans ( " ClassifyInCategory " ) . '"></td>' ;
print '</tr>' ;
print '</table>' ;
}
2024-09-29 13:09:09 +02:00
print '<table class="noborder centpercent">' . " \n " ;
2023-07-01 16:07:58 +02:00
print '<tr class="liste_titre"><td colspan="3">' . $langs -> trans ( " Users " ) . ' <span class="badge">' . $num . '</span></td></tr>' . " \n " ;
2022-08-29 11:22:27 +02:00
if ( count ( $users ) > 0 ) {
// Use "$userentry" here, because "$user" is the current user
foreach ( $users as $key => $userentry ) {
print " \t " . '<tr class="oddeven">' . " \n " ;
2023-07-01 16:07:58 +02:00
print '<td class="nowrap tdtop">' ;
print $userentry -> getNomUrl ( - 1 );
2022-08-29 11:22:27 +02:00
print " </td> \n " ;
print '<td class="tdtop">' . $userentry -> job . " </td> \n " ;
// Link to delete from category
print '<td class="right">' ;
2023-06-19 20:08:27 +02:00
if ( $user -> hasRight ( 'user' , 'user' , 'creer' )) {
2025-02-06 12:32:00 +01:00
print " <a href= ' " . $_SERVER [ 'PHP_SELF' ] . " ? " . ( empty ( $socid ) ? 'id' : 'socid' ) . " = " . $object -> id . " &type= " . urlencode ( $typeid ) . " &action=unlink&token= " . newToken () . " &removeelem= " . (( int ) $userentry -> id ) . ( $limit ? '&limit=' . $limit : '' ) . " '> " ;
2024-11-08 11:04:46 +01:00
//print $langs->trans("DeleteFromCat");
2024-09-25 22:21:31 +02:00
print img_picto ( $langs -> trans ( " DeleteFromCat " ), 'unlink' , '' , 0 , 0 , 0 , '' , 'paddingleft' );
2022-08-29 11:22:27 +02:00
print " </a> " ;
}
2023-07-01 16:07:58 +02:00
print '</td>' ;
2022-08-29 11:22:27 +02:00
print " </tr> \n " ;
2020-02-03 11:01:58 +01:00
}
2022-08-29 11:22:27 +02:00
} else {
2023-07-01 16:07:58 +02:00
print '<tr class="oddeven"><td colspan="3"><span class="opacitymedium">' . $langs -> trans ( " ThisCategoryHasNoItems " ) . '</span></td></tr>' ;
2020-02-03 11:01:58 +01:00
}
2022-08-29 11:22:27 +02:00
print " </table> \n " ;
2020-04-02 14:32:54 +02:00
2022-08-29 11:22:27 +02:00
print '</form>' . " \n " ;
}
} else {
2024-07-09 19:28:59 +02:00
print_barre_liste ( $langs -> trans ( " Users " ), null , $_SERVER [ " PHP_SELF " ], '' , '' , '' , '' , 0 , '' , 'user' );
2022-09-09 13:58:54 +02:00
accessforbidden ( " NotEnoughPermissions " , 0 , 0 );
2020-02-03 11:01:58 +01:00
}
}
2020-09-28 08:31:39 +02:00
// List of warehouses
2021-02-23 18:04:37 +01:00
if ( $type == Categorie :: TYPE_WAREHOUSE ) {
2022-12-27 01:45:00 +01:00
if ( $user -> hasRight ( " stock " , " read " )) {
2024-01-12 17:11:08 +01:00
$permission = $user -> hasRight ( 'stock' , 'creer' );
2020-04-02 14:32:54 +02:00
2022-08-29 11:22:27 +02:00
require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php' ;
2020-04-02 14:32:54 +02:00
2022-08-29 11:22:27 +02:00
$objects = $object -> getObjectsInCateg ( $type , 0 , $limit , $offset );
if ( $objects < 0 ) {
dol_print_error ( $db , $object -> error , $object -> errors );
} else {
2024-01-12 17:11:08 +01:00
/** @var Entrepot[] $objects */
2024-03-24 20:01:27 +01:00
'@phan-var-force Entrepot[] $objects' ;
2022-08-29 11:22:27 +02:00
print '<form method="post" action="' . $_SERVER [ " PHP_SELF " ] . '">' ;
print '<input type="hidden" name="token" value="' . newToken () . '">' ;
print '<input type="hidden" name="typeid" value="' . $typeid . '">' ;
print '<input type="hidden" name="type" value="' . $typeid . '">' ;
print '<input type="hidden" name="id" value="' . $object -> id . '">' ;
2024-11-08 10:08:06 +01:00
print '<input type="hidden" name="page_y" value="">' ;
2022-08-29 11:22:27 +02:00
print '<input type="hidden" name="action" value="list">' ;
2020-04-02 14:32:54 +02:00
2022-08-29 11:22:27 +02:00
print '<br>' ;
2023-07-01 16:07:58 +02:00
$param = '&limit=' . $limit . '&id=' . $id . '&type=' . $type ;
$num = count ( $objects );
$nbtotalofrecords = '' ;
$newcardbutton = '' ;
2022-08-29 11:22:27 +02:00
2024-03-08 12:34:25 +01:00
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
2022-08-29 11:22:27 +02:00
print_barre_liste ( $langs -> trans ( " Warehouses " ), $page , $_SERVER [ " PHP_SELF " ], $param , $sortfield , $sortorder , $massactionbutton , $num , $nbtotalofrecords , 'stock' , 0 , $newcardbutton , '' , $limit );
2024-09-29 13:09:09 +02:00
print '<table class="noborder centpercent">' . " \n " ;
2022-08-29 11:22:27 +02:00
print '<tr class="liste_titre"><td colspan="4">' . $langs -> trans ( " Ref " ) . '</td></tr>' . " \n " ;
if ( count ( $objects ) > 0 ) {
$i = 0 ;
2024-01-12 17:11:08 +01:00
foreach ( $objects as $key => $warehouse ) {
2022-08-29 11:22:27 +02:00
$i ++ ;
if ( $i > $limit ) {
break ;
}
print " \t " . '<tr class="oddeven">' . " \n " ;
2023-07-01 16:07:58 +02:00
print '<td class="nowrap tdtop">' ;
2024-01-12 17:11:08 +01:00
print $warehouse -> getNomUrl ( 1 );
2022-08-29 11:22:27 +02:00
print " </td> \n " ;
2024-01-12 17:11:08 +01:00
print '<td class="tdtop">' . $warehouse -> ref . " </td> \n " ;
print '<td class="tdtop">' . $warehouse -> lieu . " </td> \n " ;
2022-08-29 11:22:27 +02:00
// Link to delete from category
print '<td class="right">' ;
if ( $permission ) {
2025-02-06 12:32:00 +01:00
print " <a href= ' " . $_SERVER [ 'PHP_SELF' ] . " ? " . ( empty ( $socid ) ? 'id' : 'socid' ) . " = " . $object -> id . " &type= " . urlencode ( $typeid ) . " &action=unlink&token= " . newToken () . " &removeelem= " . (( int ) $warehouse -> id ) . ( $limit ? '&limit=' . $limit : '' ) . " '> " ;
2024-11-08 11:04:46 +01:00
//print $langs->trans("DeleteFromCat");
2024-09-25 22:21:31 +02:00
print img_picto ( $langs -> trans ( " DeleteFromCat " ), 'unlink' , '' , 0 , 0 , 0 , '' , 'paddingleft' );
2022-08-29 11:22:27 +02:00
print " </a> " ;
}
2023-07-01 16:07:58 +02:00
print '</td>' ;
2022-08-29 11:22:27 +02:00
print " </tr> \n " ;
2020-04-02 14:32:54 +02:00
}
2022-08-29 11:22:27 +02:00
} else {
2023-07-01 16:07:58 +02:00
print '<tr class="oddeven"><td colspan="4"><span class="opacitymedium">' . $langs -> trans ( " ThisCategoryHasNoItems " ) . '</span></td></tr>' ;
2020-04-02 14:32:54 +02:00
}
2022-08-29 11:22:27 +02:00
print " </table> \n " ;
2020-04-02 14:32:54 +02:00
2022-08-29 11:22:27 +02:00
print '</form>' . " \n " ;
}
} else {
2024-07-09 19:28:59 +02:00
print_barre_liste ( $langs -> trans ( " Warehouse " ), null , $_SERVER [ " PHP_SELF " ], '' , '' , '' , '' , 0 , '' , 'stock' );
2022-09-09 13:58:54 +02:00
accessforbidden ( " NotEnoughPermissions " , 0 , 0 );
2020-04-02 14:32:54 +02:00
}
}
2022-07-29 12:31:51 +02:00
// List of tickets
2021-07-12 09:17:08 +02:00
if ( $type == Categorie :: TYPE_TICKET ) {
2022-08-29 11:22:27 +02:00
if ( $user -> hasRight ( " ticket " , " read " )) {
2024-07-10 18:59:04 +02:00
$permission = $user -> hasRight ( 'categorie' , 'creer' );
2024-11-15 14:09:04 +01:00
$showclassifyform = $user -> hasRight ( 'categorie' , 'creer' );
2022-08-29 11:22:27 +02:00
$tickets = $object -> getObjectsInCateg ( $type , 0 , $limit , $offset );
if ( $tickets < 0 ) {
dol_print_error ( $db , $object -> error , $object -> errors );
} else {
2024-01-12 17:11:08 +01:00
/** @var Ticket[] $tickets */
2024-03-24 20:01:27 +01:00
'@phan-var-force Ticket[] $tickets' ;
2022-08-29 11:22:27 +02:00
// Form to add record into a category
2021-07-01 19:30:00 +02:00
print '<form method="post" action="' . $_SERVER [ " PHP_SELF " ] . '">' ;
print '<input type="hidden" name="token" value="' . newToken () . '">' ;
print '<input type="hidden" name="typeid" value="' . $typeid . '">' ;
print '<input type="hidden" name="type" value="' . $typeid . '">' ;
print '<input type="hidden" name="id" value="' . $object -> id . '">' ;
2024-11-08 10:08:06 +01:00
print '<input type="hidden" name="page_y" value="">' ;
2022-08-29 11:22:27 +02:00
print '<input type="hidden" name="action" value="list">' ;
2021-07-01 19:30:00 +02:00
2022-08-29 11:22:27 +02:00
print '<br>' ;
2023-07-01 16:07:58 +02:00
$param = '&limit=' . $limit . '&id=' . $id . '&type=' . $type ;
$num = count ( $tickets );
$nbtotalofrecords = '' ;
$newcardbutton = '' ;
2024-03-08 12:34:25 +01:00
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
2022-08-29 11:22:27 +02:00
print_barre_liste ( $langs -> trans ( " Ticket " ), $page , $_SERVER [ " PHP_SELF " ], $param , $sortfield , $sortorder , $massactionbutton , $num , $nbtotalofrecords , 'ticket' , 0 , $newcardbutton , '' , $limit );
2024-11-08 10:08:06 +01:00
if ( $showclassifyform ) {
print '<table class="noborder centpercent">' ;
print '<tr class="liste_titre"><td>' ;
print $langs -> trans ( " AddTicketIntoCategory " ) . ' ' ;
$form -> selectTickets ( '' , 'elemid' );
print '<input type="submit" class="button buttongen" name="addintocategory" value="' . $langs -> trans ( " ClassifyInCategory " ) . '"></td>' ;
print '</tr>' ;
print '</table>' ;
}
2022-08-29 11:22:27 +02:00
print '<table class="noborder centpercent">' . " \n " ;
print '<tr class="liste_titre"><td colspan="3">' . $langs -> trans ( " Ref " ) . '</td></tr>' . " \n " ;
if ( count ( $tickets ) > 0 ) {
$i = 0 ;
foreach ( $tickets as $ticket ) {
$i ++ ;
2023-12-04 12:01:45 +01:00
if ( $i > $limit ) {
break ;
}
2022-08-29 11:22:27 +02:00
print " \t " . '<tr class="oddeven">' . " \n " ;
2023-07-01 16:07:58 +02:00
print '<td class="nowrap tdtop">' ;
2022-08-29 11:22:27 +02:00
print $ticket -> getNomUrl ( 1 );
print " </td> \n " ;
print '<td class="tdtop">' . $ticket -> label . " </td> \n " ;
// Link to delete from category
print '<td class="right">' ;
if ( $permission ) {
2025-02-06 12:32:00 +01:00
print " <a href= ' " . $_SERVER [ 'PHP_SELF' ] . " ? " . ( empty ( $socid ) ? 'id' : 'socid' ) . " = " . $object -> id . " &type= " . urlencode ( $typeid ) . " &action=unlink&token= " . newToken () . " &removeelem= " . (( int ) $ticket -> id ) . ( $limit ? '&limit=' . $limit : '' ) . " '> " ;
2024-11-08 11:04:46 +01:00
//print $langs->trans("DeleteFromCat");
2024-09-25 22:21:31 +02:00
print img_picto ( $langs -> trans ( " DeleteFromCat " ), 'unlink' , '' , 0 , 0 , 0 , '' , 'paddingleft' );
2022-08-29 11:22:27 +02:00
print " </a> " ;
}
print '</td>' ;
print " </tr> \n " ;
2021-07-01 19:30:00 +02:00
}
2022-08-29 11:22:27 +02:00
} else {
2023-07-01 16:07:58 +02:00
print '<tr class="oddeven"><td colspan="2"><span class="opacitymedium">' . $langs -> trans ( " ThisCategoryHasNoItems " ) . '</span></td></tr>' ;
2021-07-01 19:30:00 +02:00
}
2022-08-29 11:22:27 +02:00
print " </table> \n " ;
2021-07-01 19:30:00 +02:00
2022-08-29 11:22:27 +02:00
print '</form>' . " \n " ;
}
} else {
2024-07-09 19:28:59 +02:00
print_barre_liste ( $langs -> trans ( " Ticket " ), null , $_SERVER [ " PHP_SELF " ], '' , '' , '' , '' , 0 , '' , 'ticket' );
2022-09-09 13:58:54 +02:00
accessforbidden ( " NotEnoughPermissions " , 0 , 0 );
2021-07-01 19:30:00 +02:00
}
}
2020-04-02 14:32:54 +02:00
2024-11-15 14:09:04 +01:00
// List of Interventions
if ( $type == Categorie :: TYPE_FICHINTER ) {
if ( $user -> hasRight ( " fichinter " , " lire " )) {
$permission = $user -> hasRight ( 'categorie' , 'creer' );
$showclassifyform = $user -> hasRight ( 'categorie' , 'creer' );
$fichinters = $object -> getObjectsInCateg ( $type , 0 , $limit , $offset );
if ( $fichinters < 0 ) {
dol_print_error ( $db , $object -> error , $object -> errors );
} else {
// Form to add record into a category
if ( $showclassifyform ) {
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formintervention.class.php' ;
$formfichinter = new FormIntervention ( $db );
print '<br>' ;
print '<form method="post" action="' . $_SERVER [ " PHP_SELF " ] . '">' ;
print '<input type="hidden" name="token" value="' . newToken () . '">' ;
print '<input type="hidden" name="typeid" value="' . $typeid . '">' ;
print '<input type="hidden" name="type" value="' . $typeid . '">' ;
print '<input type="hidden" name="id" value="' . $object -> id . '">' ;
print '<input type="hidden" name="action" value="addintocategory">' ;
print '<table class="noborder centpercent">' ;
print '<tr class="liste_titre"><td>' ;
print $langs -> trans ( " AddFichinterIntoCategory " ) . ' ' ;
print $formfichinter -> select_interventions ( - 1 , 0 , 'elemid' );
print '<input type="submit" class="button buttongen" value="' . $langs -> trans ( " ClassifyInCategory " ) . '"></td>' ;
print '</tr>' ;
print '</table>' ;
print '</form>' ;
}
print '<form method="post" action="' . $_SERVER [ " PHP_SELF " ] . '">' ;
print '<input type="hidden" name="token" value="' . newToken () . '">' ;
print '<input type="hidden" name="typeid" value="' . $typeid . '">' ;
print '<input type="hidden" name="type" value="' . $typeid . '">' ;
print '<input type="hidden" name="id" value="' . $object -> id . '">' ;
print '<input type="hidden" name="action" value="list">' ;
print '<br>' ;
$param = '&limit=' . $limit . '&id=' . $id . '&type=' . $type ;
$num = count ( $fichinters );
$nbtotalofrecords = '' ;
$newcardbutton = '' ;
$langs -> load ( 'interventions' );
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
print_barre_liste ( $langs -> trans ( " Intervention " ), $page , $_SERVER [ " PHP_SELF " ], $param , $sortfield , $sortorder , $massactionbutton , $num , $nbtotalofrecords , 'object_intervention' , 0 , $newcardbutton , '' , $limit );
print '<table class="noborder centpercent">' . " \n " ;
print '<tr class="liste_titre"><td colspan="3">' . $langs -> trans ( " Ref " ) . '</td></tr>' . " \n " ;
if ( count ( $fichinters ) > 0 ) {
$i = 0 ;
foreach ( $fichinters as $fichinter ) {
$i ++ ;
if ( $i > $limit ) break ;
print " \t " . '<tr class="oddeven">' . " \n " ;
print '<td class="nowrap tdtop">' ;
print $fichinter -> getNomUrl ( 1 );
print " </td> \n " ;
print '<td class="tdtop">' . $fichinter -> description . " </td> \n " ;
// Link to delete from category
print '<td class="right">' ;
if ( $permission ) {
2025-02-06 12:32:00 +01:00
print " <a href= ' " . $_SERVER [ 'PHP_SELF' ] . " ? " . ( empty ( $socid ) ? 'id' : 'socid' ) . " = " . (( int ) $object -> id ) . " &type= " . urlencode ( $typeid ) . " &action=unlink&token= " . newToken () . " &removeelem= " . (( int ) $fichinter -> id ) . ( $limit ? '&limit=' . $limit : '' ) . " '> " ;
2024-11-15 14:09:04 +01:00
print $langs -> trans ( " DeleteFromCat " );
print img_picto ( $langs -> trans ( " DeleteFromCat " ), 'unlink' , '' , 0 , 0 , 0 , '' , 'paddingleft' );
print " </a> " ;
}
print '</td>' ;
print " </tr> \n " ;
}
} else {
print '<tr class="oddeven"><td colspan="2"><span class="opacitymedium">' . $langs -> trans ( " ThisCategoryHasNoItems " ) . '</span></td></tr>' ;
}
print " </table> \n " ;
print '</form>' . " \n " ;
}
} else {
print_barre_liste ( $langs -> trans ( " Intervention " ), null , $_SERVER [ " PHP_SELF " ], '' , '' , '' , '' , 0 , '' , 'fichinter' );
accessforbidden ( " NotEnoughPermissions " , 0 , 0 );
}
}
2025-02-14 14:29:49 +01:00
// List of Orders
if ( $type == Categorie :: TYPE_ORDER ) {
require_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php' ;
$permission = $user -> rights -> commande -> creer ;
$objects = $object -> getObjectsInCateg ( $type , 0 , $limit , $offset );
if ( $objects < 0 ) {
dol_print_error ( $db , $object -> error , $object -> errors );
} else {
// Form to add record into a category
2025-02-17 11:46:29 +01:00
$showclassifyform = $user -> hasRight ( 'order' , 'write' );
2025-02-14 14:29:49 +01:00
if ( $showclassifyform ) {
print '<br>' ;
print '<form method="post" action="' . $_SERVER [ " PHP_SELF " ] . '">' ;
print '<input type="hidden" name="token" value="' . newToken () . '">' ;
print '<input type="hidden" name="typeid" value="' . $typeid . '">' ;
print '<input type="hidden" name="type" value="' . $typeid . '">' ;
print '<input type="hidden" name="id" value="' . $object -> id . '">' ;
print '<input type="hidden" name="action" value="addintocategory">' ;
print '<table class="noborder centpercent">' ;
print '<tr class="liste_titre"><td>' ;
print $langs -> trans ( " AddOrderIntoCategory " ) . ' ' ;
$form -> selectOrder ( '' , 'elemid' );
print '<input type="submit" class="button buttongen" value="' . $langs -> trans ( " ClassifyInCategory " ) . '"></td>' ;
print '</tr>' ;
print '</table>' ;
print '</form>' ;
}
print '<form method="post" action="' . $_SERVER [ " PHP_SELF " ] . '">' ;
print '<input type="hidden" name="token" value="' . newToken () . '">' ;
print '<input type="hidden" name="typeid" value="' . $typeid . '">' ;
print '<input type="hidden" name="type" value="' . $typeid . '">' ;
print '<input type="hidden" name="id" value="' . $object -> id . '">' ;
print '<input type="hidden" name="action" value="list">' ;
print '<br>' ;
$param = '&limit=' . $limit . '&id=' . $id . '&type=' . $type ; $num = count ( $objects ); $nbtotalofrecords = '' ; $newcardbutton = '' ;
2024-08-26 15:45:38 +02:00
// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
2025-02-14 14:29:49 +01:00
print_barre_liste ( $langs -> trans ( " Orders " ), $page , $_SERVER [ " PHP_SELF " ], $param , $sortfield , $sortorder , $massactionbutton , $num , $nbtotalofrecords , 'bill' , 0 , $newcardbutton , '' , $limit );
print " <table class='noborder' width='100%'> \n " ;
print '<tr class="liste_titre"><td colspan="4">' . $langs -> trans ( " Ref " ) . '</td></tr>' . " \n " ;
if ( count ( $objects ) > 0 ) {
$i = 0 ;
2022-11-15 11:36:11 +01:00
foreach ( $objects as $key => $order ) {
2025-02-14 14:29:49 +01:00
$i ++ ;
if ( $i > $limit ) {
break ;
}
print " \t " . '<tr class="oddeven">' . " \n " ;
print '<td class="nowrap" valign="top">' ;
print $order -> getNomUrl ( 1 );
print " </td> \n " ;
print '<td class="tdtop">' . $order -> ref . " </td> \n " ;
// Link to delete from category
print '<td class="right">' ;
if ( $permission ) {
print " <a href= ' " . $_SERVER [ 'PHP_SELF' ] . " ? " . ( empty ( $socid ) ? 'id' : 'socid' ) . " = " . $object -> id . " &type= " . $typeid . " &removeelem= " . $order -> id . " '> " ;
print $langs -> trans ( " DeleteFromCat " );
2025-02-14 15:46:40 +01:00
print img_picto ( $langs -> trans ( " DeleteFromCat " ), 'unlink' , '' , 0 , 0 , 0 , '' , 'paddingleft' );
2025-02-14 14:29:49 +01:00
print " </a> " ;
}
print " </tr> \n " ;
}
} else {
print '<tr class="oddeven"><td colspan="3" class="opacitymedium">' . $langs -> trans ( " ThisCategoryHasNoItems " ) . '</td></tr>' ;
}
print " </table> \n " ;
print '</form>' . " \n " ;
}
}
2024-03-14 18:40:56 +01:00
// Note that $action and $object may have been modified by some hooks
$parameters = array ( 'type' => $type , 'id' => $id , 'label' => $label );
2024-03-14 22:32:18 +01:00
$reshook = $hookmanager -> executeHooks ( 'addMoreCategoriesList' , $parameters , $object , $action );
2024-03-14 18:40:56 +01:00
2018-07-29 13:40:35 +02:00
// End of page
2011-08-27 16:24:16 +02:00
llxFooter ();
2012-03-28 19:39:56 +02:00
$db -> close ();