dolibarr 19.0.3
list.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
5 * Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
6 * Copyright (C) 2005-2013 Regis Houssin <regis.houssin@inodbox.com>
7 * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
8 * Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
9 * Copyright (C) 2010-2019 Philippe Grand <philippe.grand@atoo-net.com>
10 * Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
11 * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
12 * Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
13 * Copyright (C) 2018-2023 Charlene Benke <charlene@patas-monkey.com>
14 * Copyright (C) 2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
15 *
16 * This program is free software; you can redistribute it and/or modify
17 * it under the terms of the GNU General Public License as published by
18 * the Free Software Foundation; either version 3 of the License, or
19 * (at your option) any later version.
20 *
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
25 *
26 * You should have received a copy of the GNU General Public License
27 * along with this program. If not, see <https://www.gnu.org/licenses/>.
28 */
29
36// Load Dolibarr environment
37require '../main.inc.php';
38require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
39require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
40require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
41require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
42require_once DOL_DOCUMENT_ROOT.'/core/class/html.formpropal.class.php';
43require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
44require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
45if (isModEnabled('project')) {
46 require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
47}
48
49// Load translation files required by the page
50$langs->loadLangs(array('companies', 'propal', 'supplier_proposal', 'compta', 'bills', 'orders', 'products'));
51
52$socid = GETPOST('socid', 'int');
53
54$action = GETPOST('action', 'aZ09');
55$massaction = GETPOST('massaction', 'alpha');
56$show_files = GETPOST('show_files', 'int');
57$confirm = GETPOST('confirm', 'alpha');
58$toselect = GETPOST('toselect', 'array');
59$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'supplierproposallist';
60$mode = GETPOST('mode', 'alpha');
61
62$search_user = GETPOST('search_user', 'int');
63$search_sale = GETPOST('search_sale', 'int');
64$search_ref = GETPOST('sf_ref') ? GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha');
65$search_societe = GETPOST('search_societe', 'alpha');
66$search_societe_alias = GETPOST('search_societe_alias', 'alpha');
67$search_login = GETPOST('search_login', 'alpha');
68$search_town = GETPOST('search_town', 'alpha');
69$search_zip = GETPOST('search_zip', 'alpha');
70$search_state = GETPOST("search_state");
71$search_country = GETPOST("search_country", 'int');
72$search_date_startday = GETPOST('search_date_startday', 'int');
73$search_date_startmonth = GETPOST('search_date_startmonth', 'int');
74$search_date_startyear = GETPOST('search_date_startyear', 'int');
75$search_date_endday = GETPOST('search_date_endday', 'int');
76$search_date_endmonth = GETPOST('search_date_endmonth', 'int');
77$search_date_endyear = GETPOST('search_date_endyear', 'int');
78$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
79$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
80$search_date_valid_startday = GETPOST('search_date_valid_startday', 'int');
81$search_date_valid_startmonth = GETPOST('search_date_valid_startmonth', 'int');
82$search_date_valid_startyear = GETPOST('search_date_valid_startyear', 'int');
83$search_date_valid_endday = GETPOST('search_date_valid_endday', 'int');
84$search_date_valid_endmonth = GETPOST('search_date_valid_endmonth', 'int');
85$search_date_valid_endyear = GETPOST('search_date_valid_endyear', 'int');
86$search_date_valid_start = dol_mktime(0, 0, 0, $search_date_valid_startmonth, $search_date_valid_startday, $search_date_valid_startyear); // Use tzserver
87$search_date_valid_end = dol_mktime(23, 59, 59, $search_date_valid_endmonth, $search_date_valid_endday, $search_date_valid_endyear);
88$search_type_thirdparty = GETPOST("search_type_thirdparty", 'int');
89$search_montant_ht = GETPOST('search_montant_ht', 'alpha');
90$search_montant_vat = GETPOST('search_montant_vat', 'alpha');
91$search_montant_ttc = GETPOST('search_montant_ttc', 'alpha');
92$search_multicurrency_code = GETPOST('search_multicurrency_code', 'alpha');
93$search_multicurrency_tx = GETPOST('search_multicurrency_tx', 'alpha');
94$search_multicurrency_montant_ht = GETPOST('search_multicurrency_montant_ht', 'alpha');
95$search_multicurrency_montant_vat = GETPOST('search_multicurrency_montant_vat', 'alpha');
96$search_multicurrency_montant_ttc = GETPOST('search_multicurrency_montant_ttc', 'alpha');
97$search_status = GETPOST('search_status', 'int');
98$search_product_category = GETPOST('search_product_category', 'int');
99
100$object_statut = $db->escape(GETPOST('supplier_proposal_statut'));
101$search_btn = GETPOST('button_search', 'alpha');
102$search_remove_btn = GETPOST('button_removefilter', 'alpha');
103
104$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
105
106$mesg = (GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg"));
107
108$optioncss = GETPOST('optioncss', 'alpha');
109$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
110$sortfield = GETPOST('sortfield', 'aZ09comma');
111$sortorder = GETPOST('sortorder', 'aZ09comma');
112$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
113if (empty($page) || $page == -1 || !empty($search_btn) || !empty($search_remove_btn) || (empty($toselect) && $massaction === '0')) {
114 $page = 0;
115} // If $page is not defined, or '' or -1
116$offset = $limit * $page;
117$pageprev = $page - 1;
118$pagenext = $page + 1;
119if (!$sortfield) {
120 $sortfield = 'sp.date_livraison';
121}
122if (!$sortorder) {
123 $sortorder = 'DESC';
124}
125
126if ($object_statut != '') {
127 $search_status = $object_statut;
128}
129
130// Nombre de ligne pour choix de produit/service predefinis
131$NBLINES = 4;
132
133// Security check
134$module = 'supplier_proposal';
135$dbtable = '';
136$objectid = '';
137if (!empty($user->socid)) {
138 $socid = $user->socid;
139}
140if (!empty($socid)) {
141 $objectid = $socid;
142 $module = 'societe';
143 $dbtable = '&societe';
144}
145
146$diroutputmassaction = $conf->supplier_proposal->dir_output.'/temp/massgeneration/'.$user->id;
147
148// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
149$object = new SupplierProposal($db);
150$hookmanager->initHooks(array('supplier_proposallist'));
151$extrafields = new ExtraFields($db);
152
153// fetch optionals attributes and labels
154$extrafields->fetch_name_optionals_label($object->table_element);
155
156$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
157
158
159// List of fields to search into when doing a "search in all"
160$fieldstosearchall = array(
161 'sp.ref'=>'Ref',
162 's.nom'=>'Supplier',
163 'pd.description'=>'Description',
164 'sp.note_public'=>'NotePublic',
165);
166if (empty($user->socid)) {
167 $fieldstosearchall["p.note_private"] = "NotePrivate";
168}
169
170$checkedtypetiers = 0;
171$arrayfields = array(
172 'sp.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
173 's.nom'=>array('label'=>$langs->trans("Supplier"), 'checked'=>1),
174 's.name_alias'=>array('label'=>"AliasNameShort", 'checked'=>0),
175 's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>1),
176 's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>1),
177 'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0),
178 'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0),
179 'typent.code'=>array('label'=>$langs->trans("ThirdPartyType"), 'checked'=>$checkedtypetiers),
180 'sp.date_valid'=>array('label'=>$langs->trans("DateValidation"), 'checked'=>1),
181 'sp.date_livraison'=>array('label'=>$langs->trans("DateEnd"), 'checked'=>1),
182 'sp.total_ht'=>array('label'=>$langs->trans("AmountHT"), 'checked'=>1),
183 'sp.total_tva'=>array('label'=>$langs->trans("AmountVAT"), 'checked'=>0),
184 'sp.total_ttc'=>array('label'=>$langs->trans("AmountTTC"), 'checked'=>0),
185 'sp.multicurrency_code'=>array('label'=>'Currency', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
186 'sp.multicurrency_tx'=>array('label'=>'CurrencyRate', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
187 'sp.multicurrency_total_ht'=>array('label'=>'MulticurrencyAmountHT', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
188 'sp.multicurrency_total_vat'=>array('label'=>'MulticurrencyAmountVAT', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
189 'sp.multicurrency_total_ttc'=>array('label'=>'MulticurrencyAmountTTC', 'checked'=>0, 'enabled'=>(!isModEnabled("multicurrency") ? 0 : 1)),
190 'u.login'=>array('label'=>$langs->trans("Author"), 'checked'=>1, 'position'=>10),
191 'sp.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
192 'sp.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
193 'sp.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
194);
195// Extra fields
196include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
197
198$object->fields = dol_sort_array($object->fields, 'position');
199$arrayfields = dol_sort_array($arrayfields, 'position');
200
201if (!$user->hasRight('societe', 'client', 'voir')) {
202 $search_sale = $user->id;
203}
204
205$result = restrictedArea($user, $module, $objectid, $dbtable);
206
207$permissiontoread = $user->rights->supplier_proposal->lire;
208$permissiontodelete = $user->rights->supplier_proposal->supprimer;
209
210
211/*
212 * Actions
213 */
214
215if (GETPOST('cancel', 'alpha')) {
216 $action = 'list';
217 $massaction = '';
218}
219if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
220 $massaction = '';
221}
222
223$parameters = array('socid'=>$socid);
224$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
225if ($reshook < 0) {
226 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
227}
228
229if (empty($reshook)) {
230 // Selection of new fields
231 include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
232
233 // Purge search criteria
234 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
235 $search_categ = '';
236 $search_user = '';
237 $search_sale = '';
238 $search_ref = '';
239 $search_societe = '';
240 $search_societe_alias = '';
241 $search_montant_ht = '';
242 $search_montant_vat = '';
243 $search_montant_ttc = '';
244 $search_multicurrency_code = '';
245 $search_multicurrency_tx = '';
246 $search_multicurrency_montant_ht = '';
247 $search_multicurrency_montant_vat = '';
248 $search_multicurrency_montant_ttc = '';
249 $search_login = '';
250 $search_product_category = '';
251 $search_town = '';
252 $search_zip = "";
253 $search_state = "";
254 $search_type = '';
255 $search_country = '';
256 $search_type_thirdparty = '';
257 $search_date_startday = '';
258 $search_date_startmonth = '';
259 $search_date_startyear = '';
260 $search_date_endday = '';
261 $search_date_endmonth = '';
262 $search_date_endyear = '';
263 $search_date_start = '';
264 $search_date_end = '';
265 $search_date_valid_startday = '';
266 $search_date_valid_startmonth = '';
267 $search_date_valid_startyear = '';
268 $search_date_valid_endday = '';
269 $search_date_valid_endmonth = '';
270 $search_date_valid_endyear = '';
271 $search_date_valid_start = '';
272 $search_date_valid_end = '';
273 $search_status = '';
274 $object_statut = '';
275 }
276
277 $objectclass = 'SupplierProposal';
278 $objectlabel = 'SupplierProposals';
279 $uploaddir = $conf->supplier_proposal->dir_output;
280 include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
281}
282
283
284/*
285 * View
286 */
287
288$form = new Form($db);
289$formother = new FormOther($db);
290$formfile = new FormFile($db);
291$formpropal = new FormPropal($db);
292$companystatic = new Societe($db);
293$formcompany = new FormCompany($db);
294
295$now = dol_now();
296
297$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
298$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
299
300$title = $langs->trans('ListOfSupplierProposals');
301$help_url = 'EN:Ask_Price_Supplier|FR:Demande_de_prix_fournisseur';
302
303
304// Build and execute select
305// --------------------------------------------------------------------
306$sql = 'SELECT';
307if ($sall || $search_user > 0) {
308 $sql = 'SELECT DISTINCT';
309}
310$sql .= ' s.rowid as socid, s.nom as name, s.name_alias as alias, s.town, s.zip, s.fk_pays, s.client, s.code_client,';
311$sql .= " typent.code as typent_code,";
312$sql .= " state.code_departement as state_code, state.nom as state_name,";
313$sql .= ' sp.rowid, sp.note_public, sp.note_private, sp.total_ht, sp.total_tva, sp.total_ttc, sp.localtax1, sp.localtax2, sp.ref, sp.fk_statut as status, sp.fk_user_author, sp.date_valid, sp.date_livraison as dp,';
314$sql .= ' sp.fk_multicurrency, sp.multicurrency_code, sp.multicurrency_tx, sp.multicurrency_total_ht, sp.multicurrency_total_tva as multicurrency_total_vat, sp.multicurrency_total_ttc,';
315$sql .= ' sp.datec as date_creation, sp.tms as date_update,';
316$sql .= " p.rowid as project_id, p.ref as project_ref,";
317$sql .= " u.firstname, u.lastname, u.photo, u.login, u.statut as ustatus, u.admin, u.employee, u.email as uemail";
318// Add fields from extrafields
319if (!empty($extrafields->attributes[$object->table_element]['label'])) {
320 foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
321 $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
322 }
323}
324// Add fields from hooks
325$parameters = array();
326$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
327$sql .= $hookmanager->resPrint;
328$sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s';
329$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)";
330$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)";
331$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)";
332$sql .= ', '.MAIN_DB_PREFIX.'supplier_proposal as sp';
333if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
334 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (sp.rowid = ef.fk_object)";
335}
336if ($sall) {
337 $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'supplier_proposaldet as pd ON sp.rowid=pd.fk_supplier_proposal';
338}
339$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'user as u ON sp.fk_user_author = u.rowid';
340$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."projet as p ON p.rowid = sp.fk_projet";
341if ($search_user > 0) {
342 $sql .= ", ".MAIN_DB_PREFIX."element_contact as c";
343 $sql .= ", ".MAIN_DB_PREFIX."c_type_contact as tc";
344}
345$sql .= ' WHERE sp.fk_soc = s.rowid';
346$sql .= ' AND sp.entity IN ('.getEntity('supplier_proposal').')';
347if ($search_town) {
348 $sql .= natural_search('s.town', $search_town);
349}
350if ($search_zip) {
351 $sql .= natural_search("s.zip", $search_zip);
352}
353if ($search_state) {
354 $sql .= natural_search("state.nom", $search_state);
355}
356if ($search_country) {
357 $sql .= " AND s.fk_pays IN (".$db->sanitize($search_country).')';
358}
359if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) {
360 $sql .= " AND s.fk_typent IN (".$db->sanitize($search_type_thirdparty).')';
361}
362if ($search_ref) {
363 $sql .= natural_search('sp.ref', $search_ref);
364}
365if (empty($arrayfields['s.name_alias']['checked']) && $search_societe) {
366 $sql .= natural_search(array("s.nom", "s.name_alias"), $search_societe);
367} else {
368 if ($search_societe) {
369 $sql .= natural_search('s.nom', $search_societe);
370 }
371 if ($search_societe_alias) {
372 $sql .= natural_search('s.name_alias', $search_societe_alias);
373 }
374}
375if ($search_login) {
376 $sql .= natural_search(array('u.lastname', 'u.firstname', 'u.login'), $search_login);
377}
378if ($search_montant_ht) {
379 $sql .= natural_search('sp.total_ht', $search_montant_ht, 1);
380}
381if ($search_montant_vat != '') {
382 $sql .= natural_search("sp.total_tva", $search_montant_vat, 1);
383}
384if ($search_montant_ttc != '') {
385 $sql .= natural_search("sp.total_ttc", $search_montant_ttc, 1);
386}
387if ($search_multicurrency_code != '') {
388 $sql .= " AND sp.multicurrency_code = '".$db->escape($search_multicurrency_code)."'";
389}
390if ($search_multicurrency_tx != '') {
391 $sql .= natural_search('sp.multicurrency_tx', $search_multicurrency_tx, 1);
392}
393if ($search_multicurrency_montant_ht != '') {
394 $sql .= natural_search('sp.multicurrency_total_ht', $search_multicurrency_montant_ht, 1);
395}
396if ($search_multicurrency_montant_vat != '') {
397 $sql .= natural_search('sp.multicurrency_total_tva', $search_multicurrency_montant_vat, 1);
398}
399if ($search_multicurrency_montant_ttc != '') {
400 $sql .= natural_search('sp.multicurrency_total_ttc', $search_multicurrency_montant_ttc, 1);
401}
402if ($sall) {
403 $sql .= natural_search(array_keys($fieldstosearchall), $sall);
404}
405if ($socid > 0) {
406 $sql .= ' AND s.rowid = '.((int) $socid);
407}
408if ($search_status >= 0 && $search_status != '') {
409 $sql .= ' AND sp.fk_statut IN ('.$db->sanitize($db->escape($search_status)).')';
410}
411if ($search_date_start) {
412 $sql .= " AND sp.date_livraison >= '".$db->idate($search_date_start)."'";
413}
414if ($search_date_end) {
415 $sql .= " AND sp.date_livraison <= '".$db->idate($search_date_end)."'";
416}
417if ($search_date_valid_start) {
418 $sql .= " AND sp.date_valid >= '".$db->idate($search_date_valid_start)."'";
419}
420if ($search_date_valid_end) {
421 $sql .= " AND sp.date_valid <= '".$db->idate($search_date_valid_end)."'";
422}
423/*
424if ($search_sale > 0) {
425 $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".((int) $search_sale);
426}*/
427if ($search_user > 0) {
428 $sql .= " AND c.fk_c_type_contact = tc.rowid AND tc.element='supplier_proposal' AND tc.source='internal' AND c.element_id = sp.rowid AND c.fk_socpeople = ".((int) $search_user);
429}
430// Search on sale representative
431if ($search_sale && $search_sale != '-1') {
432 if ($search_sale == -2) {
433 $sql .= " AND NOT EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = sp.fk_soc)";
434 } elseif ($search_sale > 0) {
435 $sql .= " AND EXISTS (SELECT sc.fk_soc FROM ".MAIN_DB_PREFIX."societe_commerciaux as sc WHERE sc.fk_soc = sp.fk_soc AND sc.fk_user = ".((int) $search_sale).")";
436 }
437}
438// Search for tag/category ($searchCategoryProductList is an array of ID)
439$searchCategoryProductOperator = -1;
440$searchCategoryProductList = array($search_product_category);
441if (!empty($searchCategoryProductList)) {
442 $searchCategoryProductSqlList = array();
443 $listofcategoryid = '';
444 foreach ($searchCategoryProductList as $searchCategoryProduct) {
445 if (intval($searchCategoryProduct) == -2) {
446 $searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."supplier_proposaldet as sd WHERE sd.fk_supplier_proposal = sp.rowid AND sd.fk_product = ck.fk_product)";
447 } elseif (intval($searchCategoryProduct) > 0) {
448 if ($searchCategoryProductOperator == 0) {
449 $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."supplier_proposaldet as sd WHERE sd.fk_supplier_proposal = sp.rowid AND sd.fk_product = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")";
450 } else {
451 $listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct);
452 }
453 }
454 }
455 if ($listofcategoryid) {
456 $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."supplier_proposaldet as sd WHERE sd.fk_supplier_proposal = sp.rowid AND sd.fk_product = ck.fk_product AND ck.fk_categorie IN (".$db->sanitize($listofcategoryid)."))";
457 }
458 if ($searchCategoryProductOperator == 1) {
459 if (!empty($searchCategoryProductSqlList)) {
460 $sql .= " AND (".implode(' OR ', $searchCategoryProductSqlList).")";
461 }
462 } else {
463 if (!empty($searchCategoryProductSqlList)) {
464 $sql .= " AND (".implode(' AND ', $searchCategoryProductSqlList).")";
465 }
466 }
467}
468// Add where from extra fields
469include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
470// Add where from hooks
471$parameters = array();
472$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
473$sql .= $hookmanager->resPrint;
474
475$sql .= $db->order($sortfield, $sortorder);
476$sql .= ', sp.ref DESC';
477
478// Count total nb of records
479$nbtotalofrecords = '';
480if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
481 $resql = $db->query($sql);
482 $nbtotalofrecords = $db->num_rows($resql);
483 if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
484 $page = 0;
485 $offset = 0;
486 }
487}
488
489$sql .= $db->plimit($limit + 1, $offset);
490
491$resql = $db->query($sql);
492if ($resql) {
493 $objectstatic = new SupplierProposal($db);
494 $userstatic = new User($db);
495
496 if ($socid > 0) {
497 $soc = new Societe($db);
498 $soc->fetch($socid);
499 $title = $langs->trans('SupplierProposals').' - '.$soc->name;
500 } else {
501 $title = $langs->trans('SupplierProposals');
502 }
503
504 $num = $db->num_rows($resql);
505
506 $arrayofselected = is_array($toselect) ? $toselect : array();
507
508 if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $sall) {
509 $obj = $db->fetch_object($resql);
510
511 $id = $obj->rowid;
512
513 header("Location: ".DOL_URL_ROOT.'/supplier_proposal/card.php?id='.$id);
514 exit;
515 }
516
517 // Output page
518 // --------------------------------------------------------------------
519
520 llxHeader('', $title, $help_url);
521
522 $param = '';
523 if (!empty($mode)) {
524 $param .= '&mode='.urlencode($mode);
525 }
526 if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
527 $param .= '&contextpage='.urlencode($contextpage);
528 }
529 if ($limit > 0 && $limit != $conf->liste_limit) {
530 $param .= '&limit='.((int) $limit);
531 }
532 if ($sall) {
533 $param .= '&sall='.urlencode($sall);
534 }
535 if ($search_date_startday) {
536 $param .= '&search_date_startday='.urlencode($search_date_startday);
537 }
538 if ($search_date_startmonth) {
539 $param .= '&search_date_startmonth='.urlencode($search_date_startmonth);
540 }
541 if ($search_date_startyear) {
542 $param .= '&search_date_startyear='.urlencode($search_date_startyear);
543 }
544 if ($search_date_endday) {
545 $param .= '&search_date_endday='.urlencode($search_date_endday);
546 }
547 if ($search_date_endmonth) {
548 $param .= '&search_date_endmonth='.urlencode($search_date_endmonth);
549 }
550 if ($search_date_endyear) {
551 $param .= '&search_date_endyear='.urlencode($search_date_endyear);
552 }
553 if ($search_date_valid_startday) {
554 $param .= '&search_date_valid_startday='.urlencode($search_date_valid_startday);
555 }
556 if ($search_date_valid_startmonth) {
557 $param .= '&search_date_valid_startmonth='.urlencode($search_date_valid_startmonth);
558 }
559 if ($search_date_valid_startyear) {
560 $param .= '&search_date_valid_startyear='.urlencode($search_date_valid_startyear);
561 }
562 if ($search_date_valid_endday) {
563 $param .= '&search_date_valid_endday='.urlencode($search_date_valid_endday);
564 }
565 if ($search_date_valid_endmonth) {
566 $param .= '&search_date_valid_endmonth='.urlencode($search_date_valid_endmonth);
567 }
568 if ($search_date_valid_endyear) {
569 $param .= '&search_date_valid_endyear='.urlencode($search_date_valid_endyear);
570 }
571 if ($search_ref) {
572 $param .= '&search_ref='.urlencode($search_ref);
573 }
574 if ($search_societe) {
575 $param .= '&search_societe='.urlencode($search_societe);
576 }
577 if ($search_societe_alias) {
578 $param .= '&search_societe_alias='.urlencode($search_societe_alias);
579 }
580 if ($search_user > 0) {
581 $param .= '&search_user='.urlencode($search_user);
582 }
583 if ($search_sale > 0) {
584 $param .= '&search_sale='.urlencode($search_sale);
585 }
586 if ($search_montant_ht) {
587 $param .= '&search_montant_ht='.urlencode($search_montant_ht);
588 }
589 if ($search_multicurrency_code != '') {
590 $param .= '&search_multicurrency_code='.urlencode($search_multicurrency_code);
591 }
592 if ($search_multicurrency_tx != '') {
593 $param .= '&search_multicurrency_tx='.urlencode($search_multicurrency_tx);
594 }
595 if ($search_multicurrency_montant_ht != '') {
596 $param .= '&search_multicurrency_montant_ht='.urlencode($search_multicurrency_montant_ht);
597 }
598 if ($search_multicurrency_montant_vat != '') {
599 $param .= '&search_multicurrency_montant_vat='.urlencode($search_multicurrency_montant_vat);
600 }
601 if ($search_multicurrency_montant_ttc != '') {
602 $param .= '&search_multicurrency_montant_ttc='.urlencode($search_multicurrency_montant_ttc);
603 }
604 if ($search_login) {
605 $param .= '&search_login='.urlencode($search_login);
606 }
607 if ($search_town) {
608 $param .= '&search_town='.urlencode($search_town);
609 }
610 if ($search_zip) {
611 $param .= '&search_zip='.urlencode($search_zip);
612 }
613 if ($socid > 0) {
614 $param .= '&socid='.urlencode($socid);
615 }
616 if ($search_status != '') {
617 $param .= '&search_status='.urlencode($search_status);
618 }
619 if ($optioncss != '') {
620 $param .= '&optioncss='.urlencode($optioncss);
621 }
622 if ($search_type_thirdparty != '' && $search_type_thirdparty > 0) {
623 $param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty);
624 }
625 // Add $param from extra fields
626 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
627
628 // List of mass actions available
629 $arrayofmassactions = array(
630 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
631 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
632 //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
633 );
634 if ($user->hasRight('supplier_proposal', 'supprimer')) {
635 $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
636 }
637 if (in_array($massaction, array('presend', 'predelete'))) {
638 $arrayofmassactions = array();
639 }
640 $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
641
642 $url = DOL_URL_ROOT.'/supplier_proposal/card.php?action=create';
643 if (!empty($socid)) {
644 $url .= '&socid='.$socid;
645 }
646 $newcardbutton = '';
647 $newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition'));
648 $newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition'));
649 $newcardbutton .= dolGetButtonTitleSeparator();
650 $newcardbutton .= dolGetButtonTitle($langs->trans('NewAskPrice'), '', 'fa fa-plus-circle', $url, '', $user->hasRight('supplier_proposal', 'creer'));
651
652 // Fields title search
653 print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
654 if ($optioncss != '') {
655 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
656 }
657 print '<input type="hidden" name="token" value="'.newToken().'">';
658 print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
659 print '<input type="hidden" name="action" value="list">';
660 print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
661 print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
662 print '<input type="hidden" name="mode" value="'.$mode.'">';
663
664 print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'supplier_proposal', 0, $newcardbutton, '', $limit, 0, 0, 1);
665
666 $topicmail = "SendSupplierProposalRef";
667 $modelmail = "supplier_proposal_send";
668 $objecttmp = new SupplierProposal($db);
669 $trackid = 'spro'.$object->id;
670 include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
671
672 if ($sall) {
673 foreach ($fieldstosearchall as $key => $val) {
674 $fieldstosearchall[$key] = $langs->trans($val);
675 }
676 print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $sall).join(', ', $fieldstosearchall).'</div>';
677 }
678
679 $i = 0;
680
681 $moreforfilter = '';
682
683 // If the user can view prospects other than his'
684 if ($user->hasRight('user', 'user', 'lire')) {
685 $langs->load("commercial");
686 $moreforfilter .= '<div class="divsearchfield">';
687 $tmptitle = $langs->trans('ThirdPartiesOfSaleRepresentative');
688 $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, $tmptitle, 'maxwidth250 widthcentpercentminusx');
689 $moreforfilter .= '</div>';
690 }
691 // If the user can view prospects other than his'
692 if ($user->hasRight('user', 'user', 'lire')) {
693 $moreforfilter .= '<div class="divsearchfield">';
694 $tmptitle = $langs->trans('LinkedToSpecificUsers');
695 $moreforfilter .= img_picto($tmptitle, 'user', 'class="pictofixedwidth"').$form->select_dolusers($search_user, 'search_user', $tmptitle, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth250 widthcentpercentminusx');
696 $moreforfilter .= '</div>';
697 }
698 // If the user can view products
699 if (isModEnabled('categorie') && $user->hasRight('categorie', 'lire') && ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire'))) {
700 include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
701 $moreforfilter .= '<div class="divsearchfield">';
702 $tmptitle = $langs->trans('IncludingProductWithTag');
703 $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
704 $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$form->selectarray('search_product_category', $cate_arbo, $search_product_category, $tmptitle, 0, 0, '', 0, 0, 0, 0, 'maxwidth300 widthcentpercentminusx', 1);
705 $moreforfilter .= '</div>';
706 }
707 $parameters = array();
708 $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook
709 if (empty($reshook)) {
710 $moreforfilter .= $hookmanager->resPrint;
711 } else {
712 $moreforfilter = $hookmanager->resPrint;
713 }
714
715 if (!empty($moreforfilter)) {
716 print '<div class="liste_titre liste_titre_bydiv centpercent">';
717 print $moreforfilter;
718 print '</div>';
719 }
720
721 $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
722 $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields
723 $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
724
725 print '<div class="div-table-responsive">';
726 print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
727
728 // Fields title search
729 // --------------------------------------------------------------------
730 print '<tr class="liste_titre_filter">';
731 // Action column
732 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
733 print '<td class="liste_titre maxwidthsearch">';
734 $searchpicto = $form->showFilterButtons('left');
735 print $searchpicto;
736 print '</td>';
737 }
738 if (!empty($arrayfields['sp.ref']['checked'])) {
739 print '<td class="liste_titre">';
740 print '<input class="flat" size="6" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
741 print '</td>';
742 }
743 if (!empty($arrayfields['s.nom']['checked'])) {
744 print '<td class="liste_titre left">';
745 print '<input class="flat" type="text" size="12" name="search_societe" value="'.dol_escape_htmltag($search_societe).'">';
746 print '</td>';
747 }
748 if (!empty($arrayfields['s.name_alias']['checked'])) {
749 print '<td class="liste_titre left">';
750 print '<input class="flat" type="text" size="12" name="search_societe_alias" value="'.dol_escape_htmltag($search_societe_alias).'">';
751 print '</td>';
752 }
753 if (!empty($arrayfields['s.town']['checked'])) {
754 print '<td class="liste_titre"><input class="flat" type="text" size="6" name="search_town" value="'.$search_town.'"></td>';
755 }
756 if (!empty($arrayfields['s.zip']['checked'])) {
757 print '<td class="liste_titre"><input class="flat" type="text" size="4" name="search_zip" value="'.$search_zip.'"></td>';
758 }
759 // State
760 if (!empty($arrayfields['state.nom']['checked'])) {
761 print '<td class="liste_titre">';
762 print '<input class="flat" size="4" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).'">';
763 print '</td>';
764 }
765 // Country
766 if (!empty($arrayfields['country.code_iso']['checked'])) {
767 print '<td class="liste_titre center">';
768 print $form->select_country($search_country, 'search_country', '', 0, 'minwidth100imp maxwidth100');
769 print '</td>';
770 }
771 // Company type
772 if (!empty($arrayfields['typent.code']['checked'])) {
773 print '<td class="liste_titre maxwidthonsmartphone center">';
774 print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0, '', 0, 0, 0, (!getDolGlobalString('SOCIETE_SORT_ON_TYPEENT') ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), '', 1);
775 print '</td>';
776 }
777 // Date
778 if (!empty($arrayfields['sp.date_valid']['checked'])) {
779 print '<td class="liste_titre center">';
780 print '<div class="nowrapfordate">';
781 print $form->selectDate($search_date_valid_start ? $search_date_valid_start : -1, 'search_date_valid_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
782 print '</div>';
783 print '<div class="nowrapfordate">';
784 print $form->selectDate($search_date_valid_end ? $search_date_valid_end : -1, 'search_date_valid_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
785 print '</div>';
786 print '</td>';
787 }
788 // Date
789 if (!empty($arrayfields['sp.date_livraison']['checked'])) {
790 print '<td class="liste_titre center">';
791 print '<div class="nowrapfordate">';
792 print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
793 print '</div>';
794 print '<div class="nowrapfordate">';
795 print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
796 print '</div>';
797 print '</td>';
798 }
799
800 if (!empty($arrayfields['sp.total_ht']['checked'])) {
801 // Amount
802 print '<td class="liste_titre right">';
803 print '<input class="flat" type="text" size="5" name="search_montant_ht" value="'.dol_escape_htmltag($search_montant_ht).'">';
804 print '</td>';
805 }
806 if (!empty($arrayfields['sp.total_tva']['checked'])) {
807 // Amount
808 print '<td class="liste_titre right">';
809 print '<input class="flat" type="text" size="5" name="search_montant_vat" value="'.dol_escape_htmltag($search_montant_vat).'">';
810 print '</td>';
811 }
812 if (!empty($arrayfields['sp.total_ttc']['checked'])) {
813 // Amount
814 print '<td class="liste_titre right">';
815 print '<input class="flat" type="text" size="5" name="search_montant_ttc" value="'.dol_escape_htmltag($search_montant_ttc).'">';
816 print '</td>';
817 }
818 if (!empty($arrayfields['sp.multicurrency_code']['checked'])) {
819 // Currency
820 print '<td class="liste_titre">';
821 print $form->selectMultiCurrency($search_multicurrency_code, 'search_multicurrency_code', 1);
822 print '</td>';
823 }
824 if (!empty($arrayfields['sp.multicurrency_tx']['checked'])) {
825 // Currency rate
826 print '<td class="liste_titre">';
827 print '<input class="flat" type="text" size="4" name="search_multicurrency_tx" value="'.dol_escape_htmltag($search_multicurrency_tx).'">';
828 print '</td>';
829 }
830 if (!empty($arrayfields['sp.multicurrency_total_ht']['checked'])) {
831 // Amount
832 print '<td class="liste_titre right">';
833 print '<input class="flat" type="text" size="4" name="search_multicurrency_montant_ht" value="'.dol_escape_htmltag($search_multicurrency_montant_ht).'">';
834 print '</td>';
835 }
836 if (!empty($arrayfields['sp.multicurrency_total_vat']['checked'])) {
837 // Amount
838 print '<td class="liste_titre right">';
839 print '<input class="flat" type="text" size="4" name="search_multicurrency_montant_vat" value="'.dol_escape_htmltag($search_multicurrency_montant_vat).'">';
840 print '</td>';
841 }
842 if (!empty($arrayfields['sp.multicurrency_total_ttc']['checked'])) {
843 // Amount
844 print '<td class="liste_titre right">';
845 print '<input class="flat" type="text" size="4" name="search_multicurrency_montant_ttc" value="'.dol_escape_htmltag($search_multicurrency_montant_ttc).'">';
846 print '</td>';
847 }
848 if (!empty($arrayfields['u.login']['checked'])) {
849 // Author
850 print '<td class="liste_titre center">';
851 print '<input class="flat" size="4" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).'">';
852 print '</td>';
853 }
854 // Extra fields
855 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
856 // Fields from hook
857 $parameters = array('arrayfields'=>$arrayfields);
858 $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
859 print $hookmanager->resPrint;
860 // Date creation
861 if (!empty($arrayfields['sp.datec']['checked'])) {
862 print '<td class="liste_titre">';
863 print '</td>';
864 }
865 // Date modification
866 if (!empty($arrayfields['sp.tms']['checked'])) {
867 print '<td class="liste_titre">';
868 print '</td>';
869 }
870 // Status
871 if (!empty($arrayfields['sp.fk_statut']['checked'])) {
872 print '<td class="liste_titre center parentonrightofpage">';
873 $formpropal->selectProposalStatus($search_status, 1, 0, 1, 'supplier', 'search_status', 'search_status width100 onrightofpage');
874 print '</td>';
875 }
876 // Action column
877 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
878 print '<td class="liste_titre maxwidthsearch">';
879 $searchpicto = $form->showFilterButtons();
880 print $searchpicto;
881 print '</td>';
882 }
883
884 print "</tr>\n";
885
886 $totalarray = array();
887 $totalarray['nbfield'] = 0;
888
889 // Fields title
890 print '<tr class="liste_titre">';
891 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
892 print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
893 $totalarray['nbfield']++;
894 }
895 if (!empty($arrayfields['sp.ref']['checked'])) {
896 print_liste_field_titre($arrayfields['sp.ref']['label'], $_SERVER["PHP_SELF"], 'sp.ref', '', $param, '', $sortfield, $sortorder);
897 $totalarray['nbfield']++;
898 }
899 if (!empty($arrayfields['s.nom']['checked'])) {
900 print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], 's.nom', '', $param, '', $sortfield, $sortorder);
901 $totalarray['nbfield']++;
902 }
903 if (!empty($arrayfields['s.name_alias']['checked'])) {
904 print_liste_field_titre($arrayfields['s.name_alias']['label'], $_SERVER["PHP_SELF"], 's.name_alias', '', $param, '', $sortfield, $sortorder);
905 $totalarray['nbfield']++;
906 }
907 if (!empty($arrayfields['s.town']['checked'])) {
908 print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder);
909 $totalarray['nbfield']++;
910 }
911 if (!empty($arrayfields['s.zip']['checked'])) {
912 print_liste_field_titre($arrayfields['s.zip']['label'], $_SERVER["PHP_SELF"], 's.zip', '', $param, '', $sortfield, $sortorder);
913 $totalarray['nbfield']++;
914 }
915 if (!empty($arrayfields['state.nom']['checked'])) {
916 print_liste_field_titre($arrayfields['state.nom']['label'], $_SERVER["PHP_SELF"], "state.nom", "", $param, '', $sortfield, $sortorder);
917 $totalarray['nbfield']++;
918 }
919 if (!empty($arrayfields['country.code_iso']['checked'])) {
920 print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, '', $sortfield, $sortorder, 'center ');
921 $totalarray['nbfield']++;
922 }
923 if (!empty($arrayfields['typent.code']['checked'])) {
924 print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, '', $sortfield, $sortorder, 'center ');
925 $totalarray['nbfield']++;
926 }
927 if (!empty($arrayfields['sp.date_valid']['checked'])) {
928 print_liste_field_titre($arrayfields['sp.date_valid']['label'], $_SERVER["PHP_SELF"], 'sp.date_valid', '', $param, '', $sortfield, $sortorder, 'center ');
929 $totalarray['nbfield']++;
930 }
931 if (!empty($arrayfields['sp.date_livraison']['checked'])) {
932 print_liste_field_titre($arrayfields['sp.date_livraison']['label'], $_SERVER["PHP_SELF"], 'sp.date_livraison', '', $param, '', $sortfield, $sortorder, 'center ');
933 $totalarray['nbfield']++;
934 }
935 if (!empty($arrayfields['sp.total_ht']['checked'])) {
936 print_liste_field_titre($arrayfields['sp.total_ht']['label'], $_SERVER["PHP_SELF"], 'sp.total_ht', '', $param, '', $sortfield, $sortorder, 'right ');
937 $totalarray['nbfield']++;
938 }
939 if (!empty($arrayfields['sp.total_tva']['checked'])) {
940 print_liste_field_titre($arrayfields['sp.total_tva']['label'], $_SERVER["PHP_SELF"], 'sp.total_tva', '', $param, '', $sortfield, $sortorder, 'right ');
941 $totalarray['nbfield']++;
942 }
943 if (!empty($arrayfields['sp.total_ttc']['checked'])) {
944 print_liste_field_titre($arrayfields['sp.total_ttc']['label'], $_SERVER["PHP_SELF"], 'sp.total_ttc', '', $param, '', $sortfield, $sortorder, 'right ');
945 $totalarray['nbfield']++;
946 }
947 if (!empty($arrayfields['sp.multicurrency_code']['checked'])) {
948 print_liste_field_titre($arrayfields['sp.multicurrency_code']['label'], $_SERVER['PHP_SELF'], 'sp.multicurrency_code', '', $param, '', $sortfield, $sortorder);
949 $totalarray['nbfield']++;
950 }
951 if (!empty($arrayfields['sp.multicurrency_tx']['checked'])) {
952 print_liste_field_titre($arrayfields['sp.multicurrency_tx']['label'], $_SERVER['PHP_SELF'], 'sp.multicurrency_tx', '', $param, '', $sortfield, $sortorder);
953 $totalarray['nbfield']++;
954 }
955 if (!empty($arrayfields['sp.multicurrency_total_ht']['checked'])) {
956 print_liste_field_titre($arrayfields['sp.multicurrency_total_ht']['label'], $_SERVER['PHP_SELF'], 'sp.multicurrency_total_ht', '', $param, 'class="right"', $sortfield, $sortorder);
957 $totalarray['nbfield']++;
958 }
959 if (!empty($arrayfields['sp.multicurrency_total_vat']['checked'])) {
960 print_liste_field_titre($arrayfields['sp.multicurrency_total_vat']['label'], $_SERVER['PHP_SELF'], 'sp.multicurrency_total_tva', '', $param, 'class="right"', $sortfield, $sortorder);
961 $totalarray['nbfield']++;
962 }
963 if (!empty($arrayfields['sp.multicurrency_total_ttc']['checked'])) {
964 print_liste_field_titre($arrayfields['sp.multicurrency_total_ttc']['label'], $_SERVER['PHP_SELF'], 'sp.multicurrency_total_ttc', '', $param, 'class="right"', $sortfield, $sortorder);
965 $totalarray['nbfield']++;
966 }
967 if (!empty($arrayfields['u.login']['checked'])) {
968 print_liste_field_titre($arrayfields['u.login']['label'], $_SERVER["PHP_SELF"], 'u.login', '', $param, '', $sortfield, $sortorder, 'center ');
969 $totalarray['nbfield']++;
970 }
971 // Extra fields
972 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
973 // Hook fields
974 $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
975 $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
976 print $hookmanager->resPrint;
977 if (!empty($arrayfields['sp.datec']['checked'])) {
978 print_liste_field_titre($arrayfields['sp.datec']['label'], $_SERVER["PHP_SELF"], "sp.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
979 $totalarray['nbfield']++;
980 }
981 if (!empty($arrayfields['sp.tms']['checked'])) {
982 print_liste_field_titre($arrayfields['sp.tms']['label'], $_SERVER["PHP_SELF"], "sp.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap');
983 $totalarray['nbfield']++;
984 }
985 if (!empty($arrayfields['sp.fk_statut']['checked'])) {
986 print_liste_field_titre($arrayfields['sp.fk_statut']['label'], $_SERVER["PHP_SELF"], "sp.fk_statut", "", $param, '', $sortfield, $sortorder, 'center ');
987 $totalarray['nbfield']++;
988 }
989 // Action
990 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
991 print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
992 $totalarray['nbfield']++;
993 }
994 print '</tr>'."\n";
995
996 $now = dol_now();
997 $i = 0;
998 $total = 0;
999 $subtotal = 0;
1000 $savnbfield = $totalarray['nbfield'];
1001 $totalarray = array();
1002 $totalarray['nbfield'] = 0;
1003 $totalarray['val'] = array();
1004 $totalarray['val']['sp.total_ht'] = 0;
1005 $totalarray['val']['sp.total_tva'] = 0;
1006 $totalarray['val']['sp.total_ttc'] = 0;
1007
1008 $imaxinloop = ($limit ? min($num, $limit) : $num);
1009 while ($i < $imaxinloop) {
1010 $obj = $db->fetch_object($resql);
1011
1012 $objectstatic->id = $obj->rowid;
1013 $objectstatic->ref = $obj->ref;
1014 $objectstatic->note_public = $obj->note_public;
1015 $objectstatic->note_private = $obj->note_private;
1016 $objectstatic->status = $obj->status;
1017
1018 // Company
1019 $companystatic->id = $obj->socid;
1020 $companystatic->name = $obj->name;
1021 $companystatic->name_alias = $obj->alias;
1022 $companystatic->client = $obj->client;
1023 $companystatic->code_client = $obj->code_client;
1024
1025 if ($mode == 'kanban') {
1026 if ($i == 0) {
1027 print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
1028 print '<div class="box-flex-container kanban">';
1029 }
1030 // Output Kanban
1031 // TODO Use a cahe on user
1032 $userstatic->fetch($obj->fk_user_author);
1033 $objectstatic->delivery_date = $obj->dp;
1034 print $objectstatic->getKanbanView('', array('thirdparty'=>$companystatic, 'userauthor'=>$userstatic, 'selected' => in_array($obj->id, $arrayofselected)));
1035 if ($i == ($imaxinloop - 1)) {
1036 print '</div>';
1037 print '</td></tr>';
1038 }
1039 } else {
1040 print '<tr class="oddeven">';
1041 // Action column
1042 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
1043 print '<td class="nowrap center">';
1044 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
1045 $selected = 0;
1046 if (in_array($obj->rowid, $arrayofselected)) {
1047 $selected = 1;
1048 }
1049 print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
1050 }
1051 print '</td>';
1052 }
1053 if (!empty($arrayfields['sp.ref']['checked'])) {
1054 print '<td class="nowraponall">';
1055
1056 print '<table class="nobordernopadding"><tr class="nocellnopadd">';
1057 // Picto + Ref
1058 print '<td class="nobordernopadding nowraponall">';
1059 print $objectstatic->getNomUrl(1, '', '', 0, -1, 1);
1060 print '</td>';
1061 // Warning
1062 $warnornote = '';
1063 //if ($obj->fk_statut == 1 && $db->jdate($obj->date_valid) < ($now - $conf->supplier_proposal->warning_delay)) $warnornote .= img_warning($langs->trans("Late"));
1064 if ($warnornote) {
1065 print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
1066 print $warnornote;
1067 print '</td>';
1068 }
1069 // Other picto tool
1070 print '<td width="16" class="right nobordernopadding hideonsmartphone">';
1071 $filename = dol_sanitizeFileName($obj->ref);
1072 $filedir = $conf->supplier_proposal->dir_output.'/'.dol_sanitizeFileName($obj->ref);
1073 $urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->rowid;
1074 print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
1075 print '</td></tr></table>';
1076
1077 print "</td>\n";
1078 if (!$i) {
1079 $totalarray['nbfield']++;
1080 }
1081 }
1082
1083 // Thirdparty
1084 if (!empty($arrayfields['s.nom']['checked'])) {
1085 print '<td class="tdoverflowmax200">';
1086 print $companystatic->getNomUrl(1, 'supplier', 0, 0, -1, empty($arrayfields['s.name_alias']['checked']) ? 0 : 1);
1087 print '</td>';
1088 if (!$i) {
1089 $totalarray['nbfield']++;
1090 }
1091 }
1092
1093 // Alias
1094 if (!empty($arrayfields['s.name_alias']['checked'])) {
1095 print '<td class="tdoverflowmax200">';
1096 print $companystatic->name_alias;
1097 print '</td>';
1098 if (!$i) {
1099 $totalarray['nbfield']++;
1100 }
1101 }
1102
1103 // Town
1104 if (!empty($arrayfields['s.town']['checked'])) {
1105 print '<td class="nocellnopadd">';
1106 print $obj->town;
1107 print '</td>';
1108 if (!$i) {
1109 $totalarray['nbfield']++;
1110 }
1111 }
1112 // Zip
1113 if (!empty($arrayfields['s.zip']['checked'])) {
1114 print '<td class="nocellnopadd">';
1115 print $obj->zip;
1116 print '</td>';
1117 if (!$i) {
1118 $totalarray['nbfield']++;
1119 }
1120 }
1121 // State
1122 if (!empty($arrayfields['state.nom']['checked'])) {
1123 print "<td>".$obj->state_name."</td>\n";
1124 if (!$i) {
1125 $totalarray['nbfield']++;
1126 }
1127 }
1128 // Country
1129 if (!empty($arrayfields['country.code_iso']['checked'])) {
1130 print '<td class="center">';
1131 $tmparray = getCountry($obj->fk_pays, 'all');
1132 print $tmparray['label'];
1133 print '</td>';
1134 if (!$i) {
1135 $totalarray['nbfield']++;
1136 }
1137 }
1138 // Type ent
1139 if (!empty($arrayfields['typent.code']['checked'])) {
1140 print '<td class="center">';
1141 if (empty($typenArray) || !is_array($typenArray) || count($typenArray) == 0) {
1142 $typenArray = $formcompany->typent_array(1);
1143 }
1144 print $typenArray[$obj->typent_code];
1145 print '</td>';
1146 if (!$i) {
1147 $totalarray['nbfield']++;
1148 }
1149 }
1150
1151 // Date proposal
1152 if (!empty($arrayfields['sp.date_valid']['checked'])) {
1153 print '<td class="center">';
1154 print dol_print_date($db->jdate($obj->date_valid), 'day');
1155 print "</td>\n";
1156 if (!$i) {
1157 $totalarray['nbfield']++;
1158 }
1159 }
1160
1161 // Date delivery
1162 if (!empty($arrayfields['sp.date_livraison']['checked'])) {
1163 print '<td class="center">';
1164 print dol_print_date($db->jdate($obj->dp), 'day');
1165 print "</td>\n";
1166 if (!$i) {
1167 $totalarray['nbfield']++;
1168 }
1169 }
1170
1171 // Amount HT
1172 if (!empty($arrayfields['sp.total_ht']['checked'])) {
1173 print '<td class="right"><span class="amount">'.price($obj->total_ht)."</span></td>\n";
1174 if (!$i) {
1175 $totalarray['nbfield']++;
1176 }
1177 if (!$i) {
1178 $totalarray['pos'][$totalarray['nbfield']] = 'sp.total_ht';
1179 }
1180 $totalarray['val']['sp.total_ht'] += $obj->total_ht;
1181 }
1182 // Amount VAT
1183 if (!empty($arrayfields['sp.total_tva']['checked'])) {
1184 print '<td class="right"><span class="amount">'.price($obj->total_tva)."</span></td>\n";
1185 if (!$i) {
1186 $totalarray['nbfield']++;
1187 }
1188 if (!$i) {
1189 $totalarray['pos'][$totalarray['nbfield']] = 'sp.total_tva';
1190 }
1191 $totalarray['val']['sp.total_tva'] += $obj->total_tva;
1192 }
1193 // Amount TTC
1194 if (!empty($arrayfields['sp.total_ttc']['checked'])) {
1195 print '<td class="right"><span class="amount">'.price($obj->total_ttc)."</span></td>\n";
1196 if (!$i) {
1197 $totalarray['nbfield']++;
1198 }
1199 if (!$i) {
1200 $totalarray['pos'][$totalarray['nbfield']] = 'sp.total_ttc';
1201 }
1202 $totalarray['val']['sp.total_ttc'] += $obj->total_ttc;
1203 }
1204
1205 // Currency
1206 if (!empty($arrayfields['sp.multicurrency_code']['checked'])) {
1207 print '<td class="nowrap">'.$obj->multicurrency_code.' - '.$langs->trans('Currency'.$obj->multicurrency_code)."</td>\n";
1208 if (!$i) {
1209 $totalarray['nbfield']++;
1210 }
1211 }
1212
1213 // Currency rate
1214 if (!empty($arrayfields['sp.multicurrency_tx']['checked'])) {
1215 print '<td class="nowrap">';
1216 $form->form_multicurrency_rate($_SERVER['PHP_SELF'].'?id='.$obj->rowid, $obj->multicurrency_tx, 'none', $obj->multicurrency_code);
1217 print "</td>\n";
1218 if (!$i) {
1219 $totalarray['nbfield']++;
1220 }
1221 }
1222 // Amount HT
1223 if (!empty($arrayfields['sp.multicurrency_total_ht']['checked'])) {
1224 print '<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ht)."</span></td>\n";
1225 if (!$i) {
1226 $totalarray['nbfield']++;
1227 }
1228 }
1229 // Amount VAT
1230 if (!empty($arrayfields['sp.multicurrency_total_vat']['checked'])) {
1231 print '<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_vat)."</span></td>\n";
1232 if (!$i) {
1233 $totalarray['nbfield']++;
1234 }
1235 }
1236 // Amount TTC
1237 if (!empty($arrayfields['sp.multicurrency_total_ttc']['checked'])) {
1238 print '<td class="right nowrap"><span class="amount">'.price($obj->multicurrency_total_ttc)."</span></td>\n";
1239 if (!$i) {
1240 $totalarray['nbfield']++;
1241 }
1242 }
1243
1244 $userstatic->id = $obj->fk_user_author;
1245 $userstatic->login = $obj->login;
1246 $userstatic->status = $obj->ustatus;
1247 $userstatic->lastname = $obj->name;
1248 $userstatic->firstname = $obj->firstname;
1249 $userstatic->photo = $obj->photo;
1250 $userstatic->admin = $obj->admin;
1251 $userstatic->ref = $obj->fk_user_author;
1252 $userstatic->employee = $obj->employee;
1253 $userstatic->email = $obj->uemail;
1254
1255 // Author
1256 if (!empty($arrayfields['u.login']['checked'])) {
1257 print '<td class="center">';
1258 if ($userstatic->id > 0) {
1259 print $userstatic->getNomUrl(-1, '', 0, 0, 24, 1, 'login', '', 1);
1260 } else {
1261 print '&nbsp;';
1262 }
1263 print "</td>\n";
1264 if (!$i) {
1265 $totalarray['nbfield']++;
1266 }
1267 }
1268
1269 // Extra fields
1270 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
1271 // Fields from hook
1272 $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
1273 $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
1274 print $hookmanager->resPrint;
1275 // Date creation
1276 if (!empty($arrayfields['sp.datec']['checked'])) {
1277 print '<td class="center nowraponall">';
1278 print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
1279 print '</td>';
1280 if (!$i) {
1281 $totalarray['nbfield']++;
1282 }
1283 }
1284 // Date modification
1285 if (!empty($arrayfields['sp.tms']['checked'])) {
1286 print '<td class="center nowraponall">';
1287 print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
1288 print '</td>';
1289 if (!$i) {
1290 $totalarray['nbfield']++;
1291 }
1292 }
1293 // Status
1294 if (!empty($arrayfields['sp.fk_statut']['checked'])) {
1295 print '<td class="center">'.$objectstatic->getLibStatut(5)."</td>\n";
1296 if (!$i) {
1297 $totalarray['nbfield']++;
1298 }
1299 }
1300
1301 // Action column
1302 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
1303 print '<td class="nowrap center">';
1304 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
1305 $selected = 0;
1306 if (in_array($obj->rowid, $arrayofselected)) {
1307 $selected = 1;
1308 }
1309 print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
1310 }
1311 print '</td>';
1312 }
1313 if (!$i) {
1314 $totalarray['nbfield']++;
1315 }
1316
1317 print "</tr>\n";
1318
1319 $total += $obj->total_ht;
1320 $subtotal += $obj->total_ht;
1321 }
1322 $i++;
1323 }
1324
1325 // Show total line
1326 include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
1327
1328 // If no record found
1329 if ($num == 0) {
1330 $colspan = 1;
1331 foreach ($arrayfields as $key => $val) {
1332 if (!empty($val['checked'])) {
1333 $colspan++;
1334 }
1335 }
1336 print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
1337 }
1338
1339 $db->free($resql);
1340
1341 $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
1342 $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook
1343 print $hookmanager->resPrint;
1344
1345 print '</table>'."\n";
1346 print '</div>'."\n";
1347
1348 print '</form>'."\n";
1349
1350 $hidegeneratedfilelistifempty = 1;
1351 if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
1352 $hidegeneratedfilelistifempty = 0;
1353 }
1354
1355 // Show list of available documents
1356 $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
1357 $urlsource .= str_replace('&amp;', '&', $param);
1358
1359 $filedir = $diroutputmassaction;
1360
1361 $genallowed = $user->rights->supplier_proposal->lire;
1362 $delallowed = $user->rights->supplier_proposal->creer;
1363
1364 print $formfile->showdocuments('massfilesarea_supplier_proposal', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
1365} else {
1366 dol_print_error($db);
1367}
1368
1369// End of page
1370llxFooter();
1371$db->close();
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Definition wrapper.php:55
llxFooter()
Empty footer.
Definition wrapper.php:69
Class to manage standard extra fields.
Class to build HTML component for third parties management Only common components are here.
Class to offer components to list and upload files.
Class to manage generation of HTML components Only common components must be here.
Classe permettant la generation de composants html autre Only common components are here.
Class to manage generation of HTML components for proposal management.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage price ask supplier.
Class to manage Dolibarr users.
getCountry($searchkey, $withcode='', $dbtouse=0, $outputlangs='', $entconv=1, $searchlabel='')
Return country label, code or id from an id, code or label.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by second index function, which produces ascending (default) or descending output...
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $hideselectlimit=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.