2011-06-06 18:15:02 +02:00
< ? php
2020-09-16 10:51:19 +02:00
/* Copyright ( C ) 2003 - 2004 Rodolphe Quiedeville < rodolphe @ quiedeville . org >
* Copyright ( C ) 2004 - 2017 Laurent Destailleur < eldy @ users . sourceforge . net >
* Copyright ( C ) 2005 - 2012 Regis Houssin < regis . houssin @ inodbox . com >
* Copyright ( C ) 2019 Nicolas ZABOURI < info @ inovea - conseil . com >
* Copyright ( C ) 2020 Tobias Sekan < tobias . sekan @ startmail . com >
2024-11-04 23:53:20 +01:00
* Copyright ( C ) 2024 Frédéric France < frederic . france @ free . fr >
2011-06-06 18:15: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
2011-06-06 18:15: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 />.
2011-06-06 18:15:02 +02:00
*/
/**
2021-02-23 18:59:19 +01:00
* \file htdocs / comm / propal / index . php
2020-09-16 10:51:19 +02:00
* \ingroup propal
* \brief Home page of proposal area
2011-06-06 18:15: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' ;
2020-09-16 10:51:19 +02:00
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php' ;
require_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php' ;
2021-04-26 11:59:47 +02:00
require_once DOL_DOCUMENT_ROOT . '/core/lib/propal.lib.php' ;
2020-09-16 10:51:19 +02:00
2024-11-04 23:53:20 +01:00
/**
* @ var Conf $conf
* @ var DoliDB $db
* @ var HookManager $hookmanager
* @ var Translate $langs
* @ var User $user
*/
2024-06-30 21:02:50 +02:00
// Initialize a technical object to manage hooks. Note that conf->hooks_modules contains array
2020-09-16 10:51:19 +02:00
$hookmanager = new HookManager ( $db );
$hookmanager -> initHooks ( array ( 'proposalindex' ));
// Load translation files required by the page
$langs -> loadLangs ( array ( 'propal' , 'companies' ));
$now = dol_now ();
2024-04-03 15:30:10 +02:00
$max = getDolGlobalInt ( 'MAIN_SIZE_SHORTLIST_LIMIT' , 5 );
2011-06-06 18:15:02 +02:00
2021-03-29 22:43:39 +02:00
// Security check
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
$socid = GETPOSTINT ( 'socid' );
2024-11-04 23:53:20 +01:00
if ( ! empty ( $user -> socid ) && $user -> socid > 0 ) {
2021-03-29 22:43:39 +02:00
$action = '' ;
$socid = $user -> socid ;
}
2021-04-26 11:59:47 +02:00
2021-03-29 22:43:39 +02:00
restrictedArea ( $user , 'propal' );
2011-06-06 18:15:02 +02:00
/*
* View
*/
2021-03-29 22:43:39 +02:00
2019-11-13 19:35:02 +01:00
$propalstatic = new Propal ( $db );
$companystatic = new Societe ( $db );
2011-11-08 10:18:45 +01:00
$form = new Form ( $db );
2011-06-06 18:15:02 +02:00
$formfile = new FormFile ( $db );
2019-11-13 19:35:02 +01:00
$help_url = " EN:Module_Commercial_Proposals|FR:Module_Propositions_commerciales|ES:Módulo_Presupuestos " ;
2011-06-06 18:15:02 +02:00
2019-01-27 11:55:16 +01:00
llxHeader ( " " , $langs -> trans ( " ProspectionArea " ), $help_url );
2011-06-06 18:15:02 +02:00
2020-04-25 13:49:44 +02:00
print load_fiche_titre ( $langs -> trans ( " ProspectionArea " ), '' , 'propal' );
2011-06-06 18:15:02 +02:00
2020-09-16 10:51:19 +02:00
print '<div class="fichecenter">' ;
print '<div class="fichethirdleft">' ;
2011-06-06 18:15:02 +02:00
2021-08-23 23:53:58 +02:00
$tmp = getCustomerProposalPieChart ( $socid );
if ( $tmp ) {
print $tmp ;
print '<br>' ;
}
2011-06-06 18:15:02 +02:00
/*
* Draft proposals
*/
2022-08-23 20:01:34 +02:00
if ( isModEnabled ( " propal " )) {
2024-08-14 16:51:53 +02:00
$sql = " SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.total_tva, p.total_ttc, " ;
$sql .= " s.rowid as socid, s.nom as name, s.client, s.canvas, s.code_client, s.code_fournisseur, s.email, s.entity, s.code_compta as code_compta_client " ;
$sql .= " FROM " . MAIN_DB_PREFIX . " propal as p, " ;
$sql .= " " . MAIN_DB_PREFIX . " societe as s " ;
2020-09-16 10:51:19 +02:00
$sql .= " WHERE p.entity IN ( " . getEntity ( $propalstatic -> element ) . " ) " ;
$sql .= " AND p.fk_soc = s.rowid " ;
$sql .= " AND p.fk_statut = " . Propal :: STATUS_DRAFT ;
2024-01-09 13:08:22 +01:00
// If the internal user must only see his customers, force searching by him
$search_sale = 0 ;
if ( ! $user -> hasRight ( 'societe' , 'client' , 'voir' )) {
$search_sale = $user -> id ;
}
// Search on sale representative
if ( $search_sale && $search_sale != '-1' ) {
if ( $search_sale == - 2 ) {
$sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . " societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc) " ;
} elseif ( $search_sale > 0 ) {
$sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . " societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc AND sc.fk_user = " . (( int ) $search_sale ) . " ) " ;
}
2021-02-22 13:14:13 +01:00
}
2024-01-09 13:08:22 +01:00
// Search on socid
2021-02-22 13:14:13 +01:00
if ( $socid ) {
2021-06-09 15:36:47 +02:00
$sql .= " AND p.fk_soc = " . (( int ) $socid );
2021-02-22 13:14:13 +01:00
}
2019-11-13 19:35:02 +01:00
$resql = $db -> query ( $sql );
2020-09-16 10:51:19 +02:00
if ( $resql ) {
2011-06-06 18:15:02 +02:00
$num = $db -> num_rows ( $resql );
2023-11-27 11:39:32 +01:00
$nbofloop = min ( $num , ( ! getDolGlobalString ( 'MAIN_MAXLIST_OVERLOAD' ) ? 500 : $conf -> global -> MAIN_MAXLIST_OVERLOAD ));
2020-09-16 14:03:41 +02:00
startSimpleTable ( " DraftPropals " , " comm/propal/list.php " , " search_status= " . Propal :: STATUS_DRAFT , 2 , $num );
2019-03-11 12:58:03 +01:00
2021-10-23 23:12:42 +02:00
$total = 0 ;
2020-09-16 10:51:19 +02:00
if ( $num ) {
2011-06-06 18:15:02 +02:00
$i = 0 ;
2020-09-16 10:51:19 +02:00
while ( $i < $nbofloop ) {
2011-06-06 18:15:02 +02:00
$obj = $db -> fetch_object ( $resql );
2012-04-18 12:42:41 +02:00
2019-11-13 19:35:02 +01:00
$propalstatic -> id = $obj -> rowid ;
$propalstatic -> ref = $obj -> ref ;
2020-09-16 10:51:19 +02:00
$propalstatic -> ref_client = $obj -> ref_client ;
2024-08-14 16:51:53 +02:00
$propalstatic -> ref_customer = $obj -> ref_client ;
2020-09-16 10:51:19 +02:00
$propalstatic -> total_ht = $obj -> total_ht ;
$propalstatic -> total_tva = $obj -> total_tva ;
$propalstatic -> total_ttc = $obj -> total_ttc ;
2012-04-18 12:42:41 +02:00
2019-11-13 19:35:02 +01:00
$companystatic -> id = $obj -> socid ;
2020-09-16 10:51:19 +02:00
$companystatic -> name = $obj -> name ;
2019-11-13 19:35:02 +01:00
$companystatic -> client = $obj -> client ;
2020-09-16 10:51:19 +02:00
$companystatic -> code_client = $obj -> code_client ;
$companystatic -> code_fournisseur = $obj -> code_fournisseur ;
2019-11-13 19:35:02 +01:00
$companystatic -> canvas = $obj -> canvas ;
2020-09-16 10:51:19 +02:00
$companystatic -> entity = $obj -> entity ;
$companystatic -> email = $obj -> email ;
2024-08-14 16:51:53 +02:00
$companystatic -> code_compta = $obj -> code_compta_client ;
$companystatic -> code_compta_client = $obj -> code_compta_client ;
2012-07-12 19:14:13 +02:00
2020-09-16 10:51:19 +02:00
print '<tr class="oddeven">' ;
print '<td class="nowrap">' . $propalstatic -> getNomUrl ( 1 ) . '</td>' ;
print '<td class="nowrap">' . $companystatic -> getNomUrl ( 1 , 'customer' , 16 ) . '</td>' ;
2023-11-27 11:39:32 +01:00
print '<td class="nowrap right">' . price ( getDolGlobalString ( 'MAIN_DASHBOARD_USE_TOTAL_HT' ) ? $obj -> total_ht : $obj -> total_ttc ) . '</td>' ;
2012-04-18 12:42:41 +02:00
print '</tr>' ;
2020-09-16 10:51:19 +02:00
2011-06-06 18:15:02 +02:00
$i ++ ;
2023-11-27 11:39:32 +01:00
$total += ( getDolGlobalString ( 'MAIN_DASHBOARD_USE_TOTAL_HT' ) ? $obj -> total_ht : $obj -> total_ttc );
2011-06-06 18:15:02 +02:00
}
}
2020-09-16 10:51:19 +02:00
addSummaryTableLine ( 3 , $num , $nbofloop , $total , " NoProposal " );
finishSimpleTable ( true );
$db -> free ( $resql );
} else {
dol_print_error ( $db );
2011-06-06 18:15:02 +02:00
}
}
2020-09-16 10:51:19 +02:00
print '</div>' ;
2013-03-16 14:53:15 +01:00
2020-09-16 10:51:19 +02:00
print '<div class="fichetwothirdright">' ;
2011-06-06 18:15:02 +02:00
/*
* Last modified proposals
*/
2024-11-19 00:10:20 +01:00
$sql = " SELECT c.rowid, c.entity, c.ref, c.total_ht, c.total_tva, c.total_ttc, c.fk_statut as status, date_cloture as datec, c.tms as datem, " ;
2024-08-14 16:51:53 +02:00
$sql .= " s.nom as socname, s.rowid as socid, s.canvas, s.client, s.email, s.code_compta as code_compta_client " ;
2024-04-03 15:30:10 +02:00
$sql .= " FROM " . MAIN_DB_PREFIX . " propal as c, " ;
$sql .= " " . MAIN_DB_PREFIX . " societe as s " ;
2020-09-16 10:51:19 +02:00
$sql .= " WHERE c.entity IN ( " . getEntity ( $propalstatic -> element ) . " ) " ;
$sql .= " AND c.fk_soc = s.rowid " ;
2024-01-09 13:08:22 +01:00
// If the internal user must only see his customers, force searching by him
$search_sale = 0 ;
if ( ! $user -> hasRight ( 'societe' , 'client' , 'voir' )) {
$search_sale = $user -> id ;
}
// Search on sale representative
if ( $search_sale && $search_sale != '-1' ) {
if ( $search_sale == - 2 ) {
$sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . " societe_commerciaux as sc WHERE sc.fk_soc = c.fk_soc) " ;
} elseif ( $search_sale > 0 ) {
$sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . " societe_commerciaux as sc WHERE sc.fk_soc = c.fk_soc AND sc.fk_user = " . (( int ) $search_sale ) . " ) " ;
}
}
// Search on socid
2021-02-22 13:14:13 +01:00
if ( $socid ) {
2021-06-09 15:36:47 +02:00
$sql .= " AND c.fk_soc = " . (( int ) $socid );
2021-02-22 13:14:13 +01:00
}
2019-11-13 19:35:02 +01:00
$sql .= " ORDER BY c.tms DESC " ;
2024-01-09 13:08:22 +01:00
2019-11-13 19:35:02 +01:00
$sql .= $db -> plimit ( $max , 0 );
2011-06-06 18:15:02 +02:00
2019-11-13 19:35:02 +01:00
$resql = $db -> query ( $sql );
2020-09-16 10:51:19 +02:00
if ( $resql ) {
2011-06-06 18:15:02 +02:00
$num = $db -> num_rows ( $resql );
2024-04-03 15:30:10 +02:00
startSimpleTable ( $langs -> trans ( " LastModifiedProposals " , $max ), " comm/propal/list.php " , " sortfield=p.tms&sortorder=DESC " , 2 , - 1 , 'propal' );
2020-09-16 10:51:19 +02:00
if ( $num ) {
2011-06-06 18:15:02 +02:00
$i = 0 ;
2020-09-16 10:51:19 +02:00
while ( $i < $num ) {
2011-06-06 18:15:02 +02:00
$obj = $db -> fetch_object ( $resql );
2019-11-13 19:35:02 +01:00
$propalstatic -> id = $obj -> rowid ;
$propalstatic -> ref = $obj -> ref ;
2024-11-19 00:10:20 +01:00
$propalstatic -> total_ht = $obj -> total_ht ;
$propalstatic -> total_tva = $obj -> total_tva ;
$propalstatic -> total_ttc = $obj -> total_ttc ;
2020-09-16 11:11:01 +02:00
2020-09-16 10:51:19 +02:00
$companystatic -> id = $obj -> socid ;
$companystatic -> name = $obj -> socname ;
$companystatic -> client = $obj -> client ;
$companystatic -> canvas = $obj -> canvas ;
2021-06-02 15:18:45 +02:00
$companystatic -> email = $obj -> email ;
2024-08-14 16:51:53 +02:00
$companystatic -> code_compta = $obj -> code_compta_client ;
$companystatic -> code_compta_client = $obj -> code_compta_client ;
2011-06-06 18:15:02 +02:00
2019-11-13 19:35:02 +01:00
$filename = dol_sanitizeFileName ( $obj -> ref );
$filedir = $conf -> propal -> multidir_output [ $obj -> entity ] . '/' . dol_sanitizeFileName ( $obj -> ref );
$urlsource = $_SERVER [ 'PHP_SELF' ] . '?id=' . $obj -> rowid ;
2011-06-06 18:15:02 +02:00
2020-09-16 10:51:19 +02:00
print '<tr class="oddeven">' ;
2024-04-03 15:30:10 +02:00
print '<td class="nowrap">' ;
2020-09-16 10:51:19 +02:00
print '<table class="nobordernopadding">' ;
print '<tr class="nocellnopadd">' ;
print '<td width="96" class="nobordernopadding nowrap">' . $propalstatic -> getNomUrl ( 1 ) . '</td>' ;
print '<td width="16" class="nobordernopadding nowrap"></td>' ;
print '<td width="16" class="nobordernopadding right">' . $formfile -> getDocumentsLink ( $propalstatic -> element , $filename , $filedir ) . '</td>' ;
print '</tr>' ;
print '</table>' ;
2011-06-06 18:15:02 +02:00
print '</td>' ;
2019-01-27 11:55:16 +01:00
print '<td>' . $companystatic -> getNomUrl ( 1 , 'customer' ) . '</td>' ;
2024-04-03 15:30:10 +02:00
$datem = $db -> jdate ( $obj -> datem );
print '<td class="center" title="' . dol_escape_htmltag ( $langs -> trans ( " DateModification " ) . ': ' . dol_print_date ( $datem , 'dayhour' , 'tzuserrel' )) . '">' ;
print dol_print_date ( $datem , 'day' , 'tzuserrel' );
print '</td>' ;
print '<td class="right">' . $propalstatic -> LibStatut ( $obj -> status , 3 ) . '</td>' ;
2020-09-16 10:51:19 +02:00
2011-06-06 18:15:02 +02:00
print '</tr>' ;
2020-09-16 10:51:19 +02:00
2011-06-06 18:15:02 +02:00
$i ++ ;
}
}
2020-09-16 10:51:19 +02:00
finishSimpleTable ( true );
$db -> free ( $resql );
} else {
dol_print_error ( $db );
}
2011-06-06 18:15:02 +02:00
2011-08-08 16:25:44 +02:00
/*
2020-09-16 10:51:19 +02:00
* Open ( validated ) proposals
2011-08-08 16:25:44 +02:00
*/
2023-02-14 22:56:12 +01:00
if ( isModEnabled ( " propal " ) && $user -> hasRight ( 'propal' , 'lire' )) {
2024-08-14 16:51:53 +02:00
$sql = " SELECT s.nom as socname, s.rowid as socid, s.canvas, s.client, s.email, s.code_compta as code_compta_client, " ;
2024-11-19 04:21:29 +01:00
$sql .= " p.rowid as propalid, p.entity, p.total_ttc, p.total_ht, p.total_tva, p.ref, p.fk_statut, p.datep as dp, p.fin_validite as dfv " ;
2024-08-14 16:51:53 +02:00
$sql .= " FROM " . MAIN_DB_PREFIX . " societe as s, " ;
$sql .= " " . MAIN_DB_PREFIX . " propal as p " ;
2019-11-13 19:35:02 +01:00
$sql .= " WHERE p.fk_soc = s.rowid " ;
2020-09-16 10:51:19 +02:00
$sql .= " AND p.entity IN ( " . getEntity ( $propalstatic -> element ) . " ) " ;
$sql .= " AND p.fk_statut = " . Propal :: STATUS_VALIDATED ;
2024-01-09 13:08:22 +01:00
// If the internal user must only see his customers, force searching by him
$search_sale = 0 ;
if ( ! $user -> hasRight ( 'societe' , 'client' , 'voir' )) {
$search_sale = $user -> id ;
}
// Search on sale representative
if ( $search_sale && $search_sale != '-1' ) {
if ( $search_sale == - 2 ) {
$sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . " societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc) " ;
} elseif ( $search_sale > 0 ) {
$sql .= " AND EXISTS (SELECT sc.fk_soc FROM " . MAIN_DB_PREFIX . " societe_commerciaux as sc WHERE sc.fk_soc = p.fk_soc AND sc.fk_user = " . (( int ) $search_sale ) . " ) " ;
}
2021-02-22 13:14:13 +01:00
}
2024-01-09 13:08:22 +01:00
// Search on socid
2021-02-22 13:14:13 +01:00
if ( $socid ) {
2024-01-09 13:08:22 +01:00
$sql .= " AND p.fk_soc = " . (( int ) $socid );
2021-02-22 13:14:13 +01:00
}
2019-11-13 19:35:02 +01:00
$sql .= " ORDER BY p.rowid DESC " ;
2020-09-16 10:51:19 +02:00
$resql = $db -> query ( $sql );
if ( $resql ) {
2011-08-08 16:25:44 +02:00
$total = 0 ;
2020-09-16 10:51:19 +02:00
$num = $db -> num_rows ( $resql );
2023-11-27 11:39:32 +01:00
$nbofloop = min ( $num , ( ! getDolGlobalString ( 'MAIN_MAXLIST_OVERLOAD' ) ? 500 : $conf -> global -> MAIN_MAXLIST_OVERLOAD ));
2020-09-16 14:03:41 +02:00
startSimpleTable ( " ProposalsOpened " , " comm/propal/list.php " , " search_status= " . Propal :: STATUS_VALIDATED , 4 , $num );
2020-09-16 11:11:01 +02:00
2020-09-16 10:51:19 +02:00
if ( $num > 0 ) {
$i = 0 ;
while ( $i < $nbofloop ) {
$obj = $db -> fetch_object ( $resql );
2011-08-08 16:25:44 +02:00
2019-11-13 19:35:02 +01:00
$propalstatic -> id = $obj -> propalid ;
$propalstatic -> ref = $obj -> ref ;
2024-11-19 00:10:20 +01:00
$propalstatic -> total_ht = $obj -> total_ht ;
$propalstatic -> total_tva = $obj -> total_tva ;
$propalstatic -> total_ttc = $obj -> total_ttc ;
2011-08-08 16:25:44 +02:00
2020-09-16 10:51:19 +02:00
$companystatic -> id = $obj -> socid ;
$companystatic -> name = $obj -> socname ;
$companystatic -> client = $obj -> client ;
$companystatic -> canvas = $obj -> canvas ;
2021-06-02 15:18:45 +02:00
$companystatic -> email = $obj -> email ;
2024-08-14 16:51:53 +02:00
$companystatic -> code_compta = $obj -> code_compta_client ;
$companystatic -> code_compta_client = $obj -> code_compta_client ;
2020-09-16 10:51:19 +02:00
2019-11-13 19:35:02 +01:00
$filename = dol_sanitizeFileName ( $obj -> ref );
$filedir = $conf -> propal -> multidir_output [ $obj -> entity ] . '/' . dol_sanitizeFileName ( $obj -> ref );
$urlsource = $_SERVER [ 'PHP_SELF' ] . '?id=' . $obj -> propalid ;
2011-08-08 16:25:44 +02:00
2020-09-16 10:51:19 +02:00
$warning = ( $db -> jdate ( $obj -> dfv ) < ( $now - $conf -> propal -> cloture -> warning_delay )) ? img_warning ( $langs -> trans ( " Late " )) : '' ;
2012-07-12 19:14:13 +02:00
2020-09-16 10:51:19 +02:00
print '<tr class="oddeven">' ;
2011-08-08 16:25:44 +02:00
2020-09-16 10:51:19 +02:00
// Ref
print '<td class="nowrap" width="140">' ;
print '<table class="nobordernopadding">' ;
print '<tr class="nocellnopadd">' ;
print '<td class="nobordernopadding nowrap">' . $propalstatic -> getNomUrl ( 1 ) . '</td>' ;
print '<td width="18" class="nobordernopadding nowrap">' . $warning . '</td>' ;
print '<td width="16" align="center" class="nobordernopadding">' . $formfile -> getDocumentsLink ( $propalstatic -> element , $filename , $filedir ) . '</td>' ;
print '</tr>' ;
print '</table>' ;
print '</td>' ;
2020-03-24 19:06:37 +01:00
2024-03-24 23:05:40 +01:00
print '<td class="tdoverflowmax150">' . $companystatic -> getNomUrl ( 1 , 'customer' , 44 ) . '</td>' ;
2020-09-16 10:51:19 +02:00
print '<td class="right">' . dol_print_date ( $db -> jdate ( $obj -> dp ), 'day' ) . '</td>' ;
2023-11-27 11:39:32 +01:00
print '<td class="right">' . price ( getDolGlobalString ( 'MAIN_DASHBOARD_USE_TOTAL_HT' ) ? $obj -> total_ht : $obj -> total_ttc ) . '</td>' ;
2020-09-16 10:51:19 +02:00
print '<td align="center" width="14">' . $propalstatic -> LibStatut ( $obj -> fk_statut , 3 ) . '</td>' ;
print '</tr>' ;
2020-03-24 19:06:37 +01:00
2011-08-08 16:25:44 +02:00
$i ++ ;
2023-11-27 11:39:32 +01:00
$total += ( getDolGlobalString ( 'MAIN_DASHBOARD_USE_TOTAL_HT' ) ? $obj -> total_ht : $obj -> total_ttc );
2011-08-08 16:25:44 +02:00
}
}
2020-09-16 10:51:19 +02:00
addSummaryTableLine ( 5 , $num , $nbofloop , $total , " None " , true );
finishSimpleTable ( true );
$db -> free ( $resql );
2020-05-21 15:05:19 +02:00
} else {
2011-08-08 16:25:44 +02:00
dol_print_error ( $db );
}
}
2020-09-16 10:51:19 +02:00
print '</div>' ;
print '</div>' ;
2011-06-06 18:15:02 +02:00
2019-06-18 14:07:52 +02:00
$parameters = array ( 'user' => $user );
$reshook = $hookmanager -> executeHooks ( 'dashboardPropals' , $parameters , $object ); // Note that $action and $object may have been modified by hook
2018-07-29 17:17:29 +02:00
// End of page
2011-08-27 16:24:16 +02:00
llxFooter ();
2013-03-16 14:53:15 +01:00
$db -> close ();