dolibarr  13.0.2
list.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2020 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
5  * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
6  * Copyright (C) 2014-2019 Juanjo Menent <jmenent@2byte.es>
7  * Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
8  * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
9  * Copyright (C) 2016-2018 Ferran Marcet <fmarcet@2byte.es>
10  * Copyright (C) 2019 Nicolas ZABOURI <info@inovea-conseil.com>
11  *
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 3 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with this program. If not, see <https://www.gnu.org/licenses/>.
24  */
25 
32 require '../main.inc.php';
33 require_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
34 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
35 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
36 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
37 require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
38 
39 // Load translation files required by the page
40 $langs->loadLangs(array('contracts', 'products', 'companies', 'compta'));
41 
42 $action = GETPOST('action', 'aZ09');
43 $massaction = GETPOST('massaction', 'alpha');
44 $show_files = GETPOST('show_files', 'int');
45 $confirm = GETPOST('confirm', 'alpha');
46 $toselect = GETPOST('toselect', 'array');
47 $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'contractlist'; // To manage different context of search
48 
49 $search_name = GETPOST('search_name', 'alpha');
50 $search_email = GETPOST('search_email', 'alpha');
51 $search_town = GETPOST('search_town', 'alpha');
52 $search_zip = GETPOST('search_zip', 'alpha');
53 $search_state = GETPOST("search_state", 'alpha');
54 $search_country = GETPOST("search_country", 'int');
55 $search_type_thirdparty = GETPOST("search_type_thirdparty", 'int');
56 $search_contract = GETPOST('search_contract', 'alpha');
57 $search_ref_customer = GETPOST('search_ref_customer', 'alpha');
58 $search_ref_supplier = GETPOST('search_ref_supplier', 'alpha');
59 $sall = (GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml');
60 $search_status = GETPOST('search_status', 'alpha');
61 $socid = GETPOST('socid', 'int');
62 $search_user = GETPOST('search_user', 'int');
63 $search_sale = GETPOST('search_sale', 'int');
64 $search_product_category = GETPOST('search_product_category', 'int');
65 $search_dfmonth = GETPOST('search_dfmonth', 'int');
66 $search_dfyear = GETPOST('search_dfyear', 'int');
67 $search_op2df = GETPOST('search_op2df', 'alpha');
68 $day = GETPOST("day", "int");
69 $year = GETPOST("year", "int");
70 $month = GETPOST("month", "int");
71 
72 $optioncss = GETPOST('optioncss', 'alpha');
73 
74 $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
75 $sortfield = GETPOST("sortfield", 'alpha');
76 $sortorder = GETPOST("sortorder", 'alpha');
77 $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
78 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
79 $offset = $limit * $page;
80 $pageprev = $page - 1;
81 $pagenext = $page + 1;
82 if (!$sortfield) $sortfield = 'c.ref';
83 if (!$sortorder) $sortorder = 'DESC';
84 
85 // Security check
86 $id = GETPOST('id', 'int');
87 if ($user->socid) $socid = $user->socid;
88 $result = restrictedArea($user, 'contrat', $id);
89 
90 $diroutputmassaction = $conf->contrat->dir_output.'/temp/massgeneration/'.$user->id;
91 
92 $staticcontrat = new Contrat($db);
93 $staticcontratligne = new ContratLigne($db);
94 
95 if ($search_status == '') $search_status = 1;
96 
97 // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
98 $object = new Contrat($db);
99 $hookmanager->initHooks(array('contractlist'));
100 $extrafields = new ExtraFields($db);
101 
102 // fetch optionals attributes and labels
103 $extrafields->fetch_name_optionals_label($object->table_element);
104 
105 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
106 // List of fields to search into when doing a "search in all"
107 $fieldstosearchall = array(
108  'c.ref'=>'Ref',
109  'c.ref_customer'=>'RefCustomer',
110  'c.ref_supplier'=>'RefSupplier',
111  's.nom'=>"ThirdParty",
112  'c.note_public'=>'NotePublic',
113 );
114 if (empty($user->socid)) $fieldstosearchall["c.note_private"] = "NotePrivate";
115 
116 $arrayfields = array(
117  'c.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1, 'position'=>10),
118  'c.ref_customer'=>array('label'=>$langs->trans("RefCustomer"), 'checked'=>1, 'position'=>12),
119  'c.ref_supplier'=>array('label'=>$langs->trans("RefSupplier"), 'checked'=>1, 'position'=>14),
120  's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1, 'position'=>30),
121  's.email'=>array('label'=>$langs->trans("ThirdPartyEmail"), 'checked'=>0, 'position'=>30),
122  's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>0, 'position'=>31),
123  's.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>0, 'position'=>32),
124  'state.nom'=>array('label'=>$langs->trans("StateShort"), 'checked'=>0, 'position'=>33),
125  'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0, 'position'=>34),
126  'sale_representative'=>array('label'=>$langs->trans("SaleRepresentativesOfThirdParty"), 'checked'=>1, 'position'=>80),
127  'c.date_contrat'=>array('label'=>$langs->trans("DateContract"), 'checked'=>1, 'position'=>45),
128  'c.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
129  'c.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
130  'lower_planned_end_date'=>array('label'=>$langs->trans("LowerDateEndPlannedShort"), 'checked'=>1, 'position'=>900, 'help'=>$langs->trans("LowerDateEndPlannedShort")),
131  'status'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000),
132 );
133 // Extra fields
134 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
135 
136 $object->fields = dol_sort_array($object->fields, 'position');
137 $arrayfields = dol_sort_array($arrayfields, 'position');
138 
139 
140 /*
141  * Action
142  */
143 
144 if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; }
145 if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') { $massaction = ''; }
146 
147 $parameters = array('socid'=>$socid);
148 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
149 if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
150 
151 include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
152 
153 // Purge search criteria
154 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) // All test are required to be compatible with all browsers
155 {
156  $day = '';
157  $month = '';
158  $year = '';
159  $search_dfmonth = '';
160  $search_dfyear = '';
161  $search_op2df = '';
162  $search_name = "";
163  $search_email = "";
164  $search_town = '';
165  $search_zip = "";
166  $search_state = "";
167  $search_type = '';
168  $search_country = '';
169  $search_contract = "";
170  $search_ref_customer = "";
171  $search_ref_supplier = "";
172  $search_user = '';
173  $search_sale = '';
174  $search_product_category = '';
175  $sall = "";
176  $search_status = "";
177  $toselect = '';
178  $search_array_options = array();
179 }
180 
181 if (empty($reshook))
182 {
183  $objectclass = 'Contrat';
184  $objectlabel = 'Contracts';
185  $permissiontoread = $user->rights->contrat->lire;
186  $permissiontodelete = $user->rights->contrat->supprimer;
187  $uploaddir = $conf->contrat->dir_output;
188  include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
189 }
190 
191 
192 /*
193  * View
194  */
195 
196 $now = dol_now();
197 $form = new Form($db);
198 $formfile = new FormFile($db);
199 $formother = new FormOther($db);
200 $socstatic = new Societe($db);
201 $contracttmp = new Contrat($db);
202 
203 $sql = 'SELECT';
204 $sql .= " c.rowid, c.ref, c.datec as date_creation, c.tms as date_update, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier, c.note_private, c.note_public, c.entity,";
205 $sql .= ' s.rowid as socid, s.nom as name, s.name_alias, s.email, s.town, s.zip, s.fk_pays as country_id, s.client, s.code_client, s.status as company_status, s.logo as company_logo,';
206 $sql .= " typent.code as typent_code,";
207 $sql .= " state.code_departement as state_code, state.nom as state_name,";
208 $sql .= " MIN(".$db->ifsql("cd.statut=4", "cd.date_fin_validite", "null").") as lower_planned_end_date,";
209 $sql .= ' SUM('.$db->ifsql("cd.statut=0", 1, 0).') as nb_initial,';
210 $sql .= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NULL OR cd.date_fin_validite >= '".$db->idate($now)."')", 1, 0).') as nb_running,';
211 $sql .= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now)."')", 1, 0).') as nb_expired,';
212 $sql .= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now - $conf->contrat->services->expires->warning_delay)."')", 1, 0).') as nb_late,';
213 $sql .= ' SUM('.$db->ifsql("cd.statut=5", 1, 0).') as nb_closed';
214 // Add fields from extrafields
215 if (!empty($extrafields->attributes[$object->table_element]['label'])) {
216  foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key.' as options_'.$key : '');
217 }
218 // Add fields from hooks
219 $parameters = array();
220 $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
221 $sql .= $hookmanager->resPrint;
222 $sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
223 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = s.fk_pays)";
224 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_typent as typent on (typent.id = s.fk_typent)";
225 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = s.fk_departement)";
226 if ($search_sale > 0 || (!$user->rights->societe->client->voir && !$socid)) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
227 $sql .= ", ".MAIN_DB_PREFIX."contrat as c";
228 if (is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (c.rowid = ef.fk_object)";
229 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."contratdet as cd ON c.rowid = cd.fk_contrat";
230 if ($search_product_category > 0) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'categorie_product as cp ON cp.fk_product=cd.fk_product';
231 if ($search_user > 0)
232 {
233  $sql .= ", ".MAIN_DB_PREFIX."element_contact as ec";
234  $sql .= ", ".MAIN_DB_PREFIX."c_type_contact as tc";
235 }
236 $sql .= " WHERE c.fk_soc = s.rowid ";
237 $sql .= ' AND c.entity IN ('.getEntity('contract').')';
238 if ($search_product_category > 0) $sql .= " AND cp.fk_categorie = ".$search_product_category;
239 if ($socid) $sql .= " AND s.rowid = ".$db->escape($socid);
240 if (!$user->rights->societe->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$user->id;
241 $sql .= dolSqlDateFilter('c.date_contrat', $day, $month, $year);
242 if ($search_name) $sql .= natural_search('s.nom', $search_name);
243 if ($search_email) $sql .= natural_search('s.email', $search_email);
244 if ($search_contract) $sql .= natural_search(array('c.rowid', 'c.ref'), $search_contract);
245 if (!empty($search_ref_customer)) $sql .= natural_search(array('c.ref_customer'), $search_ref_customer);
246 if (!empty($search_ref_supplier)) $sql .= natural_search(array('c.ref_supplier'), $search_ref_supplier);
247 if ($search_sale > 0)
248 {
249  $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = ".$search_sale;
250 }
251 if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall);
252 if ($search_user > 0) $sql .= " AND ec.fk_c_type_contact = tc.rowid AND tc.element='contrat' AND tc.source='internal' AND ec.element_id = c.rowid AND ec.fk_socpeople = ".$search_user;
253 // Add where from extra fields
254 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
255 // Add where from hooks
256 $parameters = array();
257 $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
258 $sql .= $hookmanager->resPrint;
259 $sql .= " GROUP BY c.rowid, c.ref, c.datec, c.tms, c.date_contrat, c.statut, c.ref_customer, c.ref_supplier, c.note_private, c.note_public, c.entity,";
260 $sql .= ' s.rowid, s.nom, s.name_alias, s.email, s.town, s.zip, s.fk_pays, s.client, s.code_client, s.status, s.logo,';
261 $sql .= " typent.code,";
262 $sql .= " state.code_departement, state.nom";
263 // Add fields from extrafields
264 if (!empty($extrafields->attributes[$object->table_element]['label'])) {
265  foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key : '');
266 }
267 // Add where from hooks
268 $parameters = array();
269 $reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters); // Note that $action and $object may have been modified by hook
270 $sql .= $hookmanager->resPrint;
271 if ($search_dfyear > 0 && $search_op2df)
272 {
273  if ($search_op2df == '<=') $sql .= " HAVING MIN(".$db->ifsql("cd.statut=4", "cd.date_fin_validite", "null").") <= '".$db->idate(dol_get_last_day($search_dfyear, $search_dfmonth, false))."'";
274  elseif ($search_op2df == '>=') $sql .= " HAVING MIN(".$db->ifsql("cd.statut=4", "cd.date_fin_validite", "null").") >= '".$db->idate(dol_get_first_day($search_dfyear, $search_dfmonth, false))."'";
275  else $sql .= " HAVING MIN(".$db->ifsql("cd.statut=4", "cd.date_fin_validite", "null").") <= '".$db->idate(dol_get_last_day($search_dfyear, $search_dfmonth, false))."' AND MIN(".$db->ifsql("cd.statut=4", "cd.date_fin_validite", "null").") >= '".$db->idate(dol_get_first_day($search_dfyear, $search_dfmonth, false))."'";
276 }
277 $sql .= $db->order($sortfield, $sortorder);
278 //print $sql;
279 
280 $totalnboflines = 0;
281 $result = $db->query($sql);
282 if ($result)
283 {
284  $totalnboflines = $db->num_rows($result);
285 }
286 
287 $nbtotalofrecords = '';
288 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
289 {
290  $result = $db->query($sql);
291  $nbtotalofrecords = $db->num_rows($result);
292  if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
293  {
294  $page = 0;
295  $offset = 0;
296  }
297 }
298 
299 $sql .= $db->plimit($limit + 1, $offset);
300 
301 $resql = $db->query($sql);
302 if (!$resql)
303 {
304  dol_print_error($db);
305  exit;
306 }
307 
308 $num = $db->num_rows($resql);
309 
310 // Direct jump if only one record found
311 if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $sall && !$page)
312 {
313  $obj = $db->fetch_object($resql);
314  $id = $obj->rowid;
315  header("Location: ".DOL_URL_ROOT.'/contrat/card.php?id='.$id);
316  exit;
317 }
318 
319 
320 // Output page
321 // --------------------------------------------------------------------
322 
323 llxHeader('', $langs->trans("Contracts"));
324 
325 $i = 0;
326 
327 $arrayofselected = is_array($toselect) ? $toselect : array();
328 
329 if ($socid > 0)
330 {
331  $soc = new Societe($db);
332  $soc->fetch($socid);
333  if (empty($search_name)) $search_name = $soc->name;
334 }
335 
336 $param = '';
337 if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
338 if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
339 if ($sall != '') $param .= '&sall='.urlencode($sall);
340 if ($search_contract != '') $param .= '&search_contract='.urlencode($search_contract);
341 if ($search_name != '') $param .= '&search_name='.urlencode($search_name);
342 if ($search_email != '') $param .= '&search_email='.urlencode($search_email);
343 if ($search_ref_customer != '') $param .= '&search_ref_customer='.urlencode($search_ref_customer);
344 if ($search_ref_supplier != '') $param .= '&search_ref_supplier='.urlencode($search_ref_supplier);
345 if ($search_op2df != '') $param .= '&search_op2df='.urlencode($search_op2df);
346 if ($search_dfyear != '') $param .= '&search_dfyear='.urlencode($search_dfyear);
347 if ($search_dfmonth != '') $param .= '&search_dfmonth='.urlencode($search_dfmonth);
348 if ($search_sale != '') $param .= '&search_sale='.urlencode($search_sale);
349 if ($search_user != '') $param .= '&search_user='.urlencode($search_user);
350 if ($search_product_category != '') $param .= '&search_product_category='.urlencode($search_product_category);
351 if ($show_files) $param .= '&show_files='.urlencode($show_files);
352 if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss);
353 // Add $param from extra fields
354 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
355 
356 // List of mass actions available
357 $arrayofmassactions = array(
358  'generate_doc'=>$langs->trans("ReGeneratePDF"),
359  'builddoc'=>$langs->trans("PDFMerge"),
360  'presend'=>$langs->trans("SendByMail"),
361 );
362 if ($user->rights->contrat->supprimer) $arrayofmassactions['predelete'] = '<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
363 if (in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array();
364 $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
365 
366 $url = DOL_URL_ROOT.'/contrat/card.php?action=create';
367 if (!empty($socid)) $url .= '&socid='.$socid;
368 $newcardbutton = dolGetButtonTitle($langs->trans('NewContractSubscription'), '', 'fa fa-plus-circle', $url, '', $user->rights->contrat->creer);
369 
370 print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
371 if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
372 print '<input type="hidden" name="token" value="'.newToken().'">';
373 print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
374 print '<input type="hidden" name="action" value="list">';
375 print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
376 print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
377 print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
378 
379 print_barre_liste($langs->trans("ListOfContracts"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $totalnboflines, 'contract', 0, $newcardbutton, '', $limit, 0, 0, 1);
380 
381 $topicmail = "SendContractRef";
382 $modelmail = "contract";
383 $objecttmp = new Contrat($db);
384 $trackid = 'con'.$object->id;
385 include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
386 
387 if ($sall)
388 {
389  foreach ($fieldstosearchall as $key => $val) $fieldstosearchall[$key] = $langs->trans($val);
390  print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $sall).join(', ', $fieldstosearchall).'</div>';
391 }
392 
393 $moreforfilter = '';
394 
395 // If the user can view prospects other than his'
396 if ($user->rights->societe->client->voir || $socid)
397 {
398  $langs->load("commercial");
399  $moreforfilter .= '<div class="divsearchfield">';
400  $moreforfilter .= $langs->trans('ThirdPartiesOfSaleRepresentative').': ';
401  $moreforfilter .= $formother->select_salesrepresentatives($search_sale, 'search_sale', $user, 0, 1, 'maxwidth200');
402  $moreforfilter .= '</div>';
403 }
404 // If the user can view other users
405 if ($user->rights->user->user->lire)
406 {
407  $moreforfilter .= '<div class="divsearchfield">';
408  $moreforfilter .= $langs->trans('LinkedToSpecificUsers').': ';
409  $moreforfilter .= $form->select_dolusers($search_user, 'search_user', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth200');
410  $moreforfilter .= '</div>';
411 }
412 // If the user can view categories of products
413 if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire && ($user->rights->produit->lire || $user->rights->service->lire))
414 {
415  include_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
416  $moreforfilter .= '<div class="divsearchfield">';
417  $moreforfilter .= $langs->trans('IncludingProductWithTag').': ';
418  $cate_arbo = $form->select_all_categories(Categorie::TYPE_PRODUCT, null, 'parent', null, null, 1);
419  $moreforfilter .= $form->selectarray('search_product_category', $cate_arbo, $search_product_category, 1, 0, 0, '', 0, 0, 0, 0, 'maxwidth300', 1);
420  $moreforfilter .= '</div>';
421 }
422 
423 $parameters = array();
424 $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook
425 if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
426 else $moreforfilter = $hookmanager->resPrint;
427 
428 if (!empty($moreforfilter))
429 {
430  print '<div class="liste_titre liste_titre_bydiv centpercent">';
431  print $moreforfilter;
432  print '</div>';
433 }
434 
435 $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
436 $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
437 if ($massactionbutton) $selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
438 
439 print '<div class="div-table-responsive">';
440 print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
441 
442 print '<tr class="liste_titre_filter">';
443 if (!empty($arrayfields['c.ref']['checked']))
444 {
445  print '<td class="liste_titre">';
446  print '<input type="text" class="flat" size="3" name="search_contract" value="'.dol_escape_htmltag($search_contract).'">';
447  print '</td>';
448 }
449 if (!empty($arrayfields['c.ref_customer']['checked']))
450 {
451  print '<td class="liste_titre">';
452  print '<input type="text" class="flat" size="6" name="search_ref_customer" value="'.dol_escape_htmltag($search_ref_customer).'">';
453  print '</td>';
454 }
455 if (!empty($arrayfields['c.ref_supplier']['checked']))
456 {
457  print '<td class="liste_titre">';
458  print '<input type="text" class="flat" size="6" name="search_ref_supplier" value="'.dol_escape_htmltag($search_ref_supplier).'">';
459  print '</td>';
460 }
461 if (!empty($arrayfields['s.nom']['checked']))
462 {
463  print '<td class="liste_titre">';
464  print '<input type="text" class="flat" size="8" name="search_name" value="'.dol_escape_htmltag($search_name).'">';
465  print '</td>';
466 }
467 if (!empty($arrayfields['s.email']['checked']))
468 {
469  print '<td class="liste_titre">';
470  print '<input type="text" class="flat" size="6" name="search_email" value="'.dol_escape_htmltag($search_email).'">';
471  print '</td>';
472 }
473 // Town
474 if (!empty($arrayfields['s.town']['checked'])) print '<td class="liste_titre"><input class="flat" type="text" size="6" name="search_town" value="'.$search_town.'"></td>';
475 // Zip
476 if (!empty($arrayfields['s.zip']['checked'])) print '<td class="liste_titre"><input class="flat" type="text" size="6" name="search_zip" value="'.$search_zip.'"></td>';
477 // State
478 if (!empty($arrayfields['state.nom']['checked']))
479 {
480  print '<td class="liste_titre">';
481  print '<input class="flat" size="4" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).'">';
482  print '</td>';
483 }
484 // Country
485 if (!empty($arrayfields['country.code_iso']['checked']))
486 {
487  print '<td class="liste_titre center">';
488  print $form->select_country($search_country, 'search_country', '', 0, 'minwidth100imp maxwidth100');
489  print '</td>';
490 }
491 // Company type
492 if (!empty($arrayfields['typent.code']['checked']))
493 {
494  print '<td class="liste_titre maxwidthonsmartphone center">';
495  print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 0, 0, 0, '', 0, 0, 0, (empty($conf->global->SOCIETE_SORT_ON_TYPEENT) ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT));
496  print '</td>';
497 }
498 if (!empty($arrayfields['sale_representative']['checked']))
499 {
500  print '<td class="liste_titre"></td>';
501 }
502 if (!empty($arrayfields['c.date_contrat']['checked']))
503 {
504  // Date contract
505  print '<td class="liste_titre center nowraponall">';
506  //print $langs->trans('Month').': ';
507  if (!empty($conf->global->MAIN_LIST_FILTER_ON_DAY)) print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="day" value="'.$day.'">';
508  print '<input class="flat width25 valignmiddle" type="text" maxlength="2" name="month" value="'.$month.'">';
509  //print '&nbsp;'.$langs->trans('Year').': ';
510  $syear = $year;
511  print $formother->selectyear($syear, 'year', 1, 20, 5);
512  print '</td>';
513 }
514 // Extra fields
515 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
516 
517 // Fields from hook
518 $parameters = array('arrayfields'=>$arrayfields);
519 $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
520 print $hookmanager->resPrint;
521 // Date creation
522 if (!empty($arrayfields['c.datec']['checked']))
523 {
524  print '<td class="liste_titre">';
525  print '</td>';
526 }
527 // Date modification
528 if (!empty($arrayfields['c.tms']['checked']))
529 {
530  print '<td class="liste_titre">';
531  print '</td>';
532 }
533 // First end date
534 if (!empty($arrayfields['lower_planned_end_date']['checked']))
535 {
536  print '<td class="liste_titre nowraponall center">';
537  $arrayofoperators = array('0'=>'', '='=>'=', '<='=>'<=', '>='=>'>=');
538  print $form->selectarray('search_op2df', $arrayofoperators, $search_op2df, 0, 0, 0, '', 0, 0, 0, '', 'maxwidth50imp');
539  print '</br>';
540  print $formother->select_month($search_dfmonth, 'search_dfmonth', 1, 0);
541  print ' ';
542  $formother->select_year($search_dfyear, 'search_dfyear', 1, 20, 5, 0, 0, '');
543  print '</td>';
544 }
545 // Status
546 if (!empty($arrayfields['status']['checked']))
547 {
548  print '<td class="liste_titre right" colspan="4"></td>';
549 }
550 print '<td class="liste_titre center">';
551 $searchpicto = $form->showFilterButtons();
552 print $searchpicto;
553 print '</td>';
554 print "</tr>\n";
555 
556 print '<tr class="liste_titre">';
557 if (!empty($arrayfields['c.ref']['checked'])) print_liste_field_titre($arrayfields['c.ref']['label'], $_SERVER["PHP_SELF"], "c.ref", "", $param, '', $sortfield, $sortorder);
558 if (!empty($arrayfields['c.ref_customer']['checked'])) print_liste_field_titre($arrayfields['c.ref_customer']['label'], $_SERVER["PHP_SELF"], "c.ref_customer", "", $param, '', $sortfield, $sortorder);
559 if (!empty($arrayfields['c.ref_supplier']['checked'])) print_liste_field_titre($arrayfields['c.ref_supplier']['label'], $_SERVER["PHP_SELF"], "c.ref_supplier", "", $param, '', $sortfield, $sortorder);
560 if (!empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'], $_SERVER["PHP_SELF"], "s.nom", "", $param, '', $sortfield, $sortorder);
561 if (!empty($arrayfields['s.email']['checked'])) print_liste_field_titre($arrayfields['s.email']['label'], $_SERVER["PHP_SELF"], "s.email", "", $param, '', $sortfield, $sortorder);
562 if (!empty($arrayfields['s.town']['checked'])) print_liste_field_titre($arrayfields['s.town']['label'], $_SERVER["PHP_SELF"], 's.town', '', $param, '', $sortfield, $sortorder);
563 if (!empty($arrayfields['s.zip']['checked'])) print_liste_field_titre($arrayfields['s.zip']['label'], $_SERVER["PHP_SELF"], 's.zip', '', $param, '', $sortfield, $sortorder);
564 if (!empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'], $_SERVER["PHP_SELF"], "state.nom", "", $param, '', $sortfield, $sortorder);
565 if (!empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, '', $sortfield, $sortorder, 'center ');
566 if (!empty($arrayfields['typent.code']['checked'])) print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, '', $sortfield, $sortorder, 'center ');
567 if (!empty($arrayfields['sale_representative']['checked'])) print_liste_field_titre($arrayfields['sale_representative']['label'], $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder);
568 if (!empty($arrayfields['c.date_contrat']['checked'])) print_liste_field_titre($arrayfields['c.date_contrat']['label'], $_SERVER["PHP_SELF"], "c.date_contrat", "", $param, '', $sortfield, $sortorder, 'center ');
569 // Extra fields
570 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
571 // Hook fields
572 $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
573 $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
574 print $hookmanager->resPrint;
575 if (!empty($arrayfields['c.datec']['checked'])) {
576  print_liste_field_titre($arrayfields['c.datec']['label'], $_SERVER["PHP_SELF"], "c.datec", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
577 }
578 if (!empty($arrayfields['c.tms']['checked'])) {
579  print_liste_field_titre($arrayfields['c.tms']['label'], $_SERVER["PHP_SELF"], "c.tms", "", $param, '', $sortfield, $sortorder, 'center nowrap ');
580 }
581 if (!empty($arrayfields['lower_planned_end_date']['checked'])) {
582  print_liste_field_titre($arrayfields['lower_planned_end_date']['label'], $_SERVER["PHP_SELF"], "lower_planned_end_date", "", $param, '', $sortfield, $sortorder, 'center ');
583 }
584 if (!empty($arrayfields['status']['checked'])) {
585  print_liste_field_titre($staticcontratligne->LibStatut(0, 3, -1, 'class="nochangebackground"'), '', '', '', '', 'width="16"');
586  print_liste_field_titre($staticcontratligne->LibStatut(4, 3, 0, 'class="nochangebackground"'), '', '', '', '', 'width="16"');
587  print_liste_field_titre($staticcontratligne->LibStatut(4, 3, 1, 'class="nochangebackground"'), '', '', '', '', 'width="16"');
588  print_liste_field_titre($staticcontratligne->LibStatut(5, 3, -1, 'class="nochangebackground"'), '', '', '', '', 'width="16"');
589 }
590 print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ');
591 print "</tr>\n";
592 
593 $totalarray = array();
594 $typenArray = array();
595 $cacheCountryIDCode = array();
596 
597 while ($i < min($num, $limit))
598 {
599  $obj = $db->fetch_object($resql);
600 
601  $contracttmp->ref = $obj->ref;
602  $contracttmp->id = $obj->rowid;
603  $contracttmp->ref_customer = $obj->ref_customer;
604  $contracttmp->ref_supplier = $obj->ref_supplier;
605 
606  if ($obj->socid > 0) {
607  $result = $socstatic->fetch($obj->socid);
608  }
609  /*$socstatic->id = $obj->socid;
610  $socstatic->name = $obj->name;
611  $socstatic->name_alias = $obj->name_alias;
612  $socstatic->email = $obj->email;
613  $socstatic->status = $obj->company_status;
614  $socstatic->logo = $obj->logo;
615  $socstatic->country_id = $obj->country_id;
616  $socstatic->country_code = '';
617  $socstatic->country = '';*/
618  if ($obj->country_id > 0) {
619  if (!isset($cacheCountryIDCode[$obj->country_id]['code'])) {
620  $tmparray = getCountry($obj->country_id, 'all');
621  $cacheCountryIDCode[$obj->country_id] = array('code'=> empty($tmparray['code']) ? '' : $tmparray['code'], 'label' => empty($tmparray['label']) ? '' : $tmparray['label']);
622  }
623  $socstatic->country_code = $cacheCountryIDCode[$obj->country_id]['code'];
624  $socstatic->country = $cacheCountryIDCode[$obj->country_id]['label'];
625  }
626 
627 
628  print '<tr class="oddeven">';
629 
630  // Ref
631  if (!empty($arrayfields['c.ref']['checked']))
632  {
633  print '<td class="nowraponall">';
634  print $contracttmp->getNomUrl(1);
635  if ($obj->nb_late) print img_warning($langs->trans("Late"));
636  if (!empty($obj->note_private) || !empty($obj->note_public)) {
637  print ' <span class="note">';
638  print '<a href="'.DOL_URL_ROOT.'/contrat/note.php?id='.$obj->rowid.'&save_lastsearch_values=1">'.img_picto($langs->trans("ViewPrivateNote"), 'note').'</a>';
639  print '</span>';
640  }
641 
642  $filename = dol_sanitizeFileName($obj->ref);
643  $filedir = $conf->contrat->multidir_output[$obj->entity].'/'.dol_sanitizeFileName($obj->ref);
644  $urlsource = $_SERVER['PHP_SELF'].'?id='.$obj->rowid;
645  print $formfile->getDocumentsLink($contracttmp->element, $filename, $filedir);
646  print '</td>';
647 
648  print '</td>';
649  }
650 
651  if (!empty($arrayfields['c.ref_customer']['checked']))
652  {
653  print '<td>'.$contracttmp->getFormatedCustomerRef($obj->ref_customer).'</td>';
654  }
655  if (!empty($arrayfields['c.ref_supplier']['checked']))
656  {
657  print '<td>'.$obj->ref_supplier.'</td>';
658  }
659  if (!empty($arrayfields['s.nom']['checked']))
660  {
661  print '<td class="tdoverflowmax150">';
662  if ($obj->socid > 0) {
663  // TODO Use a cache for this string
664  print $socstatic->getNomUrl(1, '');
665  }
666  print '</td>';
667  }
668  if (!empty($arrayfields['s.email']['checked']))
669  {
670  print '<td>'.$obj->email.'</td>';
671  }
672  // Town
673  if (!empty($arrayfields['s.town']['checked']))
674  {
675  print '<td class="nocellnopadd">';
676  print $obj->town;
677  print '</td>';
678  if (!$i) $totalarray['nbfield']++;
679  }
680  // Zip
681  if (!empty($arrayfields['s.zip']['checked']))
682  {
683  print '<td class="nocellnopadd">';
684  print $obj->zip;
685  print '</td>';
686  if (!$i) $totalarray['nbfield']++;
687  }
688  // State
689  if (!empty($arrayfields['state.nom']['checked']))
690  {
691  print "<td>".$obj->state_name."</td>\n";
692  if (!$i) $totalarray['nbfield']++;
693  }
694  // Country
695  if (!empty($arrayfields['country.code_iso']['checked']))
696  {
697  print '<td class="center">';
698  print $socstatic->country;
699  print '</td>';
700  if (!$i) $totalarray['nbfield']++;
701  }
702  // Type ent
703  if (!empty($arrayfields['typent.code']['checked']))
704  {
705  print '<td class="center">';
706  if (count($typenArray) == 0) $typenArray = $formcompany->typent_array(1);
707  print $typenArray[$obj->typent_code];
708  print '</td>';
709  if (!$i) $totalarray['nbfield']++;
710  }
711  if (!empty($arrayfields['sale_representative']['checked']))
712  {
713  // Sales representatives
714  print '<td>';
715  if ($obj->socid > 0)
716  {
717  $listsalesrepresentatives = $socstatic->getSalesRepresentatives($user);
718  if ($listsalesrepresentatives < 0) dol_print_error($db);
719  $nbofsalesrepresentative = count($listsalesrepresentatives);
720  if ($nbofsalesrepresentative > 3) {
721  // We print only number
722  print $nbofsalesrepresentative;
723  } elseif ($nbofsalesrepresentative > 0)
724  {
725  $userstatic = new User($db);
726  $j = 0;
727  foreach ($listsalesrepresentatives as $val)
728  {
729  $userstatic->id = $val['id'];
730  $userstatic->lastname = $val['lastname'];
731  $userstatic->firstname = $val['firstname'];
732  $userstatic->email = $val['email'];
733  $userstatic->statut = $val['statut'];
734  $userstatic->entity = $val['entity'];
735  $userstatic->photo = $val['photo'];
736 
737  //print '<div class="float">':
738  print $userstatic->getNomUrl(-2);
739  $j++;
740  if ($j < $nbofsalesrepresentative) print ' ';
741  //print '</div>';
742  }
743  }
744  //else print $langs->trans("NoSalesRepresentativeAffected");
745  } else {
746  print '&nbsp';
747  }
748  print '</td>';
749  }
750  // Date
751  if (!empty($arrayfields['c.date_contrat']['checked']))
752  {
753  print '<td class="center">'.dol_print_date($db->jdate($obj->date_contrat), 'day', 'tzserver').'</td>';
754  }
755  // Extra fields
756  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
757  // Fields from hook
758  $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
759  $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
760  print $hookmanager->resPrint;
761  // Date creation
762  if (!empty($arrayfields['c.datec']['checked']))
763  {
764  print '<td class="center nowrap">';
765  print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
766  print '</td>';
767  if (!$i) $totalarray['nbfield']++;
768  }
769  // Date modification
770  if (!empty($arrayfields['c.tms']['checked']))
771  {
772  print '<td class="center nowrap">';
773  print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
774  print '</td>';
775  if (!$i) $totalarray['nbfield']++;
776  }
777  // Date lower end date
778  if (!empty($arrayfields['lower_planned_end_date']['checked']))
779  {
780  print '<td class="center nowrapforall">';
781  print dol_print_date($db->jdate($obj->lower_planned_end_date), 'day', 'tzuser');
782  print '</td>';
783  if (!$i) $totalarray['nbfield']++;
784  }
785  // Status
786  if (!empty($arrayfields['status']['checked']))
787  {
788  print '<td class="center">'.($obj->nb_initial > 0 ? $obj->nb_initial : '').'</td>';
789  print '<td class="center">'.($obj->nb_running > 0 ? $obj->nb_running : '').'</td>';
790  print '<td class="center">'.($obj->nb_expired > 0 ? $obj->nb_expired : '').'</td>';
791  print '<td class="center">'.($obj->nb_closed > 0 ? $obj->nb_closed : '').'</td>';
792  }
793  // Action column
794  print '<td class="nowrap center">';
795  if ($massactionbutton || $massaction) // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
796  {
797  $selected = 0;
798  if (in_array($obj->rowid, $arrayofselected)) $selected = 1;
799  print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
800  }
801  print '</td>';
802  if (!$i) $totalarray['nbfield']++;
803 
804  print "</tr>\n";
805  $i++;
806 }
807 $db->free($resql);
808 
809 $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
810 $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook
811 print $hookmanager->resPrint;
812 
813 print '</table>';
814 print '</div>';
815 
816 print '</form>';
817 
818 $hidegeneratedfilelistifempty = 1;
819 if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) $hidegeneratedfilelistifempty = 0;
820 
821 // Show list of available documents
822 $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
823 $urlsource .= str_replace('&amp;', '&', $param);
824 
825 $filedir = $diroutputmassaction;
826 $genallowed = $user->rights->contrat->lire;
827 $delallowed = $user->rights->contrat->lire;
828 
829 print $formfile->showdocuments('massfilesarea_contract', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
830 
831 
832 llxFooter();
833 $db->close();
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
if(!empty($arrayfields['u.datec']['checked'])) print_liste_field_titre("DateCreationShort"u if(!empty($arrayfields['u.tms']['checked'])) print_liste_field_titre("DateModificationShort"u if(!empty($arrayfields['u.statut']['checked'])) print_liste_field_titre("Status"u statut
Definition: list.php:632
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.
dol_now($mode= 'auto')
Return date for now.
Class to manage Dolibarr users.
Definition: user.class.php:44
Class to manage contracts.
dol_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
Definition: date.lib.php:481
Class to manage lines of contracts.
img_warning($titlealt= 'default', $moreatt= '', $morecss= 'pictowarning')
Show warning logo.
llxHeader()
Empty header.
Definition: wrapper.php:45
Class to manage standard extra fields.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
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.
Class to manage generation of HTML components Only common components must be here.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname.
Class to manage third parties objects (customers, suppliers, prospects...)
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it&#39;s its name (generic function)
Classe permettant la generation de composants html autre Only common components are here...
if(!GETPOST('transkey', 'alphanohtml')&&!GETPOST('transphrase', 'alphanohtml')) else
View.
Definition: notice.php:44
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=0)
Check permissions of a user to show a page and an object.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
dol_sanitizeFileName($str, $newstr= '_', $unaccent=1)
Clean a string to use it as a file name.
dolSqlDateFilter($datefield, $day_date, $month_date, $year_date, $excludefirstand=0)
Generate a SQL string to make a filter into a range (for second of date until last second of date) ...
Definition: date.lib.php:281
Class to offer components to list and upload files.
print $_SERVER["PHP_SELF"]
Edit parameters.
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...
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
Definition: date.lib.php:498
print
Draft customers invoices.
Definition: index.php:89
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
Definition: index.php:1232
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
llxFooter()
Empty footer.
Definition: wrapper.php:59
if(!defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN'
Draft customers invoices.
getCountry($searchkey, $withcode= '', $dbtouse=0, $outputlangs= '', $entconv=1, $searchlabel= '')
Return country label, code or id from an id, code or label.