dolibarr  13.0.2
list.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
4  * Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
5  * Copyright (C) 2013-2015 RaphaĆ«l Doursenaud <rdoursenaud@gpcsolutions.fr>
6  * Copyright (C) 2014-2016 Juanjo Menent <jmenent@2byte.es>
7  * Copyright (C) 2018 Alexandre Spangaro <aspangaro@open-dsi.fr>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <https://www.gnu.org/licenses/>.
21  */
22 
29 require '../main.inc.php';
30 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
31 require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
32 require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
33 require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
34 
35 $langs->loadLangs(array("members", "companies"));
36 
37 $action = GETPOST('action', 'aZ09');
38 $massaction = GETPOST('massaction', 'alpha');
39 $show_files = GETPOST('show_files', 'int');
40 $confirm = GETPOST('confirm', 'alpha');
41 $toselect = GETPOST('toselect', 'array');
42 $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'memberslist'; // To manage different context of search
43 
44 // Security check
45 $result = restrictedArea($user, 'adherent');
46 
47 $search = GETPOST("search", 'alpha');
48 $search_ref = GETPOST("search_ref", 'alpha');
49 $search_lastname = GETPOST("search_lastname", 'alpha');
50 $search_firstname = GETPOST("search_firstname", 'alpha');
51 $search_gender = GETPOST("search_gender", 'alpha');
52 $search_civility = GETPOST("search_civility", 'alpha');
53 $search_company = GETPOST('search_company', 'alphanohtml');
54 $search_login = GETPOST("search_login", 'alpha');
55 $search_address = GETPOST("search_address", 'alpha');
56 $search_zip = GETPOST("search_zip", 'alpha');
57 $search_town = GETPOST("search_town", 'alpha');
58 $search_state = GETPOST("search_state", 'alpha');
59 $search_country = GETPOST("search_country", 'alpha');
60 $search_phone = GETPOST("search_phone", 'alpha');
61 $search_phone_perso = GETPOST("search_phone_perso", 'alpha');
62 $search_phone_mobile = GETPOST("search_phone_mobile", 'alpha');
63 $search_type = GETPOST("search_type", 'alpha');
64 $search_email = GETPOST("search_email", 'alpha');
65 $search_categ = GETPOST("search_categ", 'int');
66 $search_filter = GETPOST("search_filter", 'alpha');
67 $search_status = GETPOST("search_status", 'intcomma');
68 $catid = GETPOST("catid", 'int');
69 $optioncss = GETPOST('optioncss', 'alpha');
70 
71 $filter = GETPOST("filter", 'alpha');
72 if ($filter) $search_filter = $filter; // For backward compatibility
73 $statut = GETPOST("statut", 'alpha');
74 if ($statut != '') $search_status = $statut; // For backward compatibility
75 
76 $sall = trim((GETPOST('search_all', 'alphanohtml') != '') ?GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
77 
78 if ($search_status < -1) $search_status = '';
79 
80 $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
81 $sortfield = GETPOST("sortfield", 'alpha');
82 $sortorder = GETPOST("sortorder", 'alpha');
83 $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
84 if (empty($page) || $page == -1) { $page = 0; } // If $page is not defined, or '' or -1
85 $offset = $limit * $page;
86 $pageprev = $page - 1;
87 $pagenext = $page + 1;
88 if (!$sortorder) { $sortorder = ($filter == 'outofdate' ? "DESC" : "ASC"); }
89 if (!$sortfield) { $sortfield = ($filter == 'outofdate' ? "d.datefin" : "d.lastname"); }
90 
91 $object = new Adherent($db);
92 
93 // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
94 $hookmanager->initHooks(array('memberlist'));
95 $extrafields = new ExtraFields($db);
96 
97 // fetch optionals attributes and labels
98 $extrafields->fetch_name_optionals_label($object->table_element);
99 
100 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
101 
102 // List of fields to search into when doing a "search in all"
103 $fieldstosearchall = array(
104  'd.rowid'=>'Ref',
105  'd.login'=>'Login',
106  'd.lastname'=>'Lastname',
107  'd.firstname'=>'Firstname',
108  'd.login'=>'Login',
109  'd.societe'=>"Company",
110  'd.email'=>'EMail',
111  'd.address'=>'Address',
112  'd.zip'=>'Zip',
113  'd.town'=>'Town',
114  'd.phone'=>"Phone",
115  'd.phone_perso'=>"PhonePerso",
116  'd.phone_mobile'=>"PhoneMobile",
117  'd.note_public'=>'NotePublic',
118  'd.note_private'=>'NotePrivate',
119 );
120 if ($db->type == 'pgsql') unset($fieldstosearchall['d.rowid']);
121 $arrayfields = array(
122  'd.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1),
123  'd.civility'=>array('label'=>$langs->trans("Civility"), 'checked'=>0),
124  'd.lastname'=>array('label'=>$langs->trans("Lastname"), 'checked'=>1),
125  'd.firstname'=>array('label'=>$langs->trans("Firstname"), 'checked'=>1),
126  'd.gender'=>array('label'=>$langs->trans("Gender"), 'checked'=>0),
127  'd.company'=>array('label'=>$langs->trans("Company"), 'checked'=>1),
128  'd.login'=>array('label'=>$langs->trans("Login"), 'checked'=>1),
129  'd.morphy'=>array('label'=>$langs->trans("MemberNature"), 'checked'=>1),
130  't.libelle'=>array('label'=>$langs->trans("Type"), 'checked'=>1),
131  'd.email'=>array('label'=>$langs->trans("Email"), 'checked'=>1),
132  'd.address'=>array('label'=>$langs->trans("Address"), 'checked'=>0),
133  'd.zip'=>array('label'=>$langs->trans("Zip"), 'checked'=>0),
134  'd.town'=>array('label'=>$langs->trans("Town"), 'checked'=>0),
135  'd.phone'=>array('label'=>$langs->trans("Phone"), 'checked'=>0),
136  'd.phone_perso'=>array('label'=>$langs->trans("PhonePerso"), 'checked'=>0),
137  'd.phone_mobile'=>array('label'=>$langs->trans("PhoneMobile"), 'checked'=>0),
138  'state.nom'=>array('label'=>$langs->trans("State"), 'checked'=>0),
139  'country.code_iso'=>array('label'=>$langs->trans("Country"), 'checked'=>0),
140  /*'d.note_public'=>array('label'=>$langs->trans("NotePublic"), 'checked'=>0),
141  'd.note_private'=>array('label'=>$langs->trans("NotePrivate"), 'checked'=>0),*/
142  'd.datefin'=>array('label'=>$langs->trans("EndSubscription"), 'checked'=>1, 'position'=>500),
143  'd.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500),
144  'd.birth'=>array('label'=>$langs->trans("Birthday"), 'checked'=>0, 'position'=>500),
145  'd.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500),
146  'd.statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000)
147 );
148 // Extra fields
149 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
150 
151 
152 /*
153  * Actions
154  */
155 
156 if (GETPOST('cancel', 'alpha')) { $action = 'list'; $massaction = ''; }
157 if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend' && $massaction != 'confirm_createbills') { $massaction = ''; }
158 
159 $parameters = array('socid'=>$socid);
160 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
161 if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
162 
163 if (empty($reshook)) {
164  // Selection of new fields
165  include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
166 
167  // Purge search criteria
168  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
169  $statut = '';
170  $filter = '';
171 
172  $search = "";
173  $search_ref = "";
174  $search_lastname = "";
175  $search_firstname = "";
176  $search_gender = "";
177  $search_civility = "";
178  $search_login = "";
179  $search_company = "";
180  $search_type = "";
181  $search_email = "";
182  $search_address = "";
183  $search_zip = "";
184  $search_town = "";
185  $search_state = "";
186  $search_country = '';
187  $search_phone = '';
188  $search_phone_perso = '';
189  $search_phone_mobile = '';
190  $search_morphy = "";
191  $search_categ = "";
192  $search_filter = "";
193  $search_status = "";
194  $catid = "";
195  $sall = "";
196  $toselect = '';
197  $search_array_options = array();
198  }
199 
200  // Close
201  if ($massaction == 'close' && $user->rights->adherent->creer) {
202  $tmpmember = new Adherent($db);
203  $error = 0;
204  $nbclose = 0;
205 
206  $db->begin();
207 
208  foreach ($toselect as $idtoclose) {
209  $tmpmember->fetch($idtoclose);
210  $result = $tmpmember->resiliate($user);
211 
212  if ($result < 0 && !count($tmpmember->errors)) {
213  setEventMessages($tmpmember->error, $tmpmember->errors, 'errors');
214  } else {
215  if ($result > 0) $nbclose++;
216  }
217  }
218 
219  if (!$error) {
220  setEventMessages($langs->trans("XMembersClosed", $nbclose), null, 'mesgs');
221 
222  $db->commit();
223  } else {
224  $db->rollback();
225  }
226  }
227 
228  // Mass actions
229  $objectclass = 'Adherent';
230  $objectlabel = 'Members';
231  $permissiontoread = $user->rights->adherent->lire;
232  $permissiontodelete = $user->rights->adherent->supprimer;
233  $uploaddir = $conf->adherent->dir_output;
234  include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
235 }
236 
237 
238 /*
239  * View
240  */
241 
242 $form = new Form($db);
243 $formother = new FormOther($db);
244 $membertypestatic = new AdherentType($db);
245 $memberstatic = new Adherent($db);
246 
247 $now = dol_now();
248 
249 $sql = "SELECT d.rowid, d.login, d.lastname, d.firstname, d.gender, d.societe as company, d.fk_soc,";
250 $sql .= " d.civility, d.datefin, d.address, d.zip, d.town, d.state_id, d.country,";
251 $sql .= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.skype, d.birth, d.public, d.photo,";
252 $sql .= " d.fk_adherent_type as type_id, d.morphy, d.statut, d.datec as date_creation, d.tms as date_update,";
253 $sql .= " d.note_private, d.note_public,";
254 $sql .= " s.nom,";
255 $sql .= " t.libelle as type, t.subscription,";
256 $sql .= " state.code_departement as state_code, state.nom as state_name,";
257 // Add fields from extrafields
258 if (!empty($extrafields->attributes[$object->table_element]['label']))
259  foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.' as options_'.$key.', ' : '');
260 // Add fields from hooks
261 $parameters = array();
262 $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
263 $sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
264 $sql = preg_replace('/,\s*$/', '', $sql);
265 $sql .= " FROM ".MAIN_DB_PREFIX."adherent as d";
266 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 (d.rowid = ef.fk_object)";
267 if (!empty($search_categ) || !empty($catid)) $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_member as cm ON d.rowid = cm.fk_member"; // We need this table joined to the select in order to filter by categ
268 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as country on (country.rowid = d.country)";
269 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as state on (state.rowid = d.state_id)";
270 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on (s.rowid = d.fk_soc)";
271 $sql .= ", ".MAIN_DB_PREFIX."adherent_type as t";
272 $sql .= " WHERE d.fk_adherent_type = t.rowid ";
273 if ($catid > 0) $sql .= " AND cm.fk_categorie = ".$db->escape($catid);
274 if ($catid == -2) $sql .= " AND cm.fk_categorie IS NULL";
275 if ($search_categ > 0) $sql .= " AND cm.fk_categorie = ".$db->escape($search_categ);
276 if ($search_categ == -2) $sql .= " AND cm.fk_categorie IS NULL";
277 $sql .= " AND d.entity IN (".getEntity('adherent').")";
278 if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall);
279 if ($search_type > 0) $sql .= " AND t.rowid=".$db->escape($search_type);
280 if ($search_filter == 'withoutsubscription') $sql .= " AND (datefin IS NULL OR t.subscription = 0)";
281 if ($search_filter == 'uptodate') $sql .= " AND (datefin >= '".$db->idate($now)."' OR t.subscription = 0)";
282 if ($search_filter == 'outofdate') $sql .= " AND (datefin < '".$db->idate($now)."' AND t.subscription = 1)";
283 if ($search_status != '') $sql .= " AND d.statut in (".$db->sanitize($db->escape($search_status)).")"; // Peut valoir un nombre ou liste de nombre separes par virgules
284 if ($search_ref) {
285  if (is_numeric($search_ref)) $sql .= " AND (d.rowid = ".$db->escape($search_ref).")";
286  else $sql .= " AND 1 = 2"; // Always wrong
287 }
288 if ($search_civility) $sql .= natural_search("d.civility", $search_civility);
289 if ($search_firstname) $sql .= natural_search("d.firstname", $search_firstname);
290 if ($search_lastname) $sql .= natural_search(array("d.firstname", "d.lastname", "d.societe"), $search_lastname);
291 if ($search_gender != '' && $search_gender != '-1') $sql .= natural_search("d.gender", $search_gender);
292 if ($search_login) $sql .= natural_search("d.login", $search_login);
293 if ($search_company) $sql .= natural_search("s.nom", $search_company);
294 if ($search_email) $sql .= natural_search("d.email", $search_email);
295 if ($search_address) $sql .= natural_search("d.address", $search_address);
296 if ($search_town) $sql .= natural_search("d.town", $search_town);
297 if ($search_zip) $sql .= natural_search("d.zip", $search_zip);
298 if ($search_state) $sql .= natural_search("state.nom", $search_state);
299 if ($search_phone) $sql .= natural_search("d.phone", $search_phone);
300 if ($search_phone_perso) $sql .= natural_search("d.phone_perso", $search_phone_perso);
301 if ($search_phone_mobile) $sql .= natural_search("d.phone_mobile", $search_phone_mobile);
302 if ($search_country) $sql .= " AND d.country IN (".$search_country.')';
303 
304 // Add where from extra fields
305 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
306 
307 // Add where from hooks
308 $parameters = array();
309 $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
310 $sql .= $hookmanager->resPrint;
311 
312 $sql .= $db->order($sortfield, $sortorder);
313 
314 // Count total nb of records with no order and no limits
315 $nbtotalofrecords = '';
316 if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
317  $resql = $db->query($sql);
318  if ($resql) $nbtotalofrecords = $db->num_rows($resql);
319  else dol_print_error($db);
320  if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
321  $page = 0;
322  $offset = 0;
323  }
324 }
325 // Add limit
326 $sql .= $db->plimit($limit + 1, $offset);
327 
328 dol_syslog("get list", LOG_DEBUG);
329 $resql = $db->query($sql);
330 if (!$resql) {
331  dol_print_error($db);
332  exit;
333 }
334 
335 $num = $db->num_rows($resql);
336 
337 $arrayofselected = is_array($toselect) ? $toselect : array();
338 
339 if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $sall) {
340  $obj = $db->fetch_object($resql);
341  $id = $obj->rowid;
342  header("Location: ".DOL_URL_ROOT.'/adherents/card.php?id='.$id);
343  exit;
344 }
345 
346 llxHeader('', $langs->trans("Member"), 'EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_Miembros');
347 
348 $titre = $langs->trans("MembersList");
349 if (GETPOSTISSET("search_status")) {
350  if ($search_status == '-1,1') { $titre = $langs->trans("MembersListQualified"); }
351  if ($search_status == '-1') { $titre = $langs->trans("MembersListToValid"); }
352  if ($search_status == '1' && $filter == '') { $titre = $langs->trans("MembersValidated"); }
353  if ($search_status == '1' && $filter == 'withoutsubscription') { $titre = $langs->trans("MembersWithSubscriptionToReceive"); }
354  if ($search_status == '1' && $filter == 'uptodate') { $titre = $langs->trans("MembersListUpToDate"); }
355  if ($search_status == '1' && $filter == 'outofdate') { $titre = $langs->trans("MembersListNotUpToDate"); }
356  if ($search_status == '0') { $titre = $langs->trans("MembersListResiliated"); }
357 } elseif ($action == 'search') {
358  $titre = $langs->trans("MembersListQualified");
359 }
360 
361 if ($search_type > 0) {
362  $membertype = new AdherentType($db);
363  $result = $membertype->fetch(GETPOST("type", 'int'));
364  $titre .= " (".$membertype->label.")";
365 }
366 
367 $param = '';
368 if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage);
369 if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit);
370 if ($sall != "") $param .= "&sall=".urlencode($sall);
371 if ($search_ref) $param .= "&search_ref=".urlencode($search_ref);
372 if ($search_civility) $param .= "&search_civility=".urlencode($search_civility);
373 if ($search_firstname) $param .= "&search_firstname=".urlencode($search_firstname);
374 if ($search_lastname) $param .= "&search_lastname=".urlencode($search_lastname);
375 if ($search_gender) $param .= "&search_gender=".urlencode($search_gender);
376 if ($search_login) $param .= "&search_login=".urlencode($search_login);
377 if ($search_email) $param .= "&search_email=".urlencode($search_email);
378 if ($search_categ) $param .= "&search_categ=".urlencode($search_categ);
379 if ($search_company) $param .= "&search_company=".urlencode($search_company);
380 if ($search_address != '') $param .= "&search_address=".urlencode($search_address);
381 if ($search_town != '') $param .= "&search_town=".urlencode($search_town);
382 if ($search_zip != '') $param .= "&search_zip=".urlencode($search_zip);
383 if ($search_state != '') $param .= "&search_state=".urlencode($search_state);
384 if ($search_country != '') $param .= "&search_country=".urlencode($search_country);
385 if ($search_phone != '') $param .= "&search_phone=".urlencode($search_phone);
386 if ($search_phone_perso != '') $param .= "&search_phone_perso=".urlencode($search_phone_perso);
387 if ($search_phone_mobile != '') $param .= "&search_phone_mobile=".urlencode($search_phone_mobile);
388 if ($search_filter && $search_filter != '-1') $param .= "&search_filter=".urlencode($search_filter);
389 if ($search_status != "" && $search_status != '-1') $param .= "&search_status=".urlencode($search_status);
390 if ($search_type > 0) $param .= "&search_type=".urlencode($search_type);
391 if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss);
392 // Add $param from extra fields
393 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
394 
395 // List of mass actions available
396 $arrayofmassactions = array(
397  //'presend'=>$langs->trans("SendByMail"),
398  //'builddoc'=>$langs->trans("PDFMerge"),
399 );
400 if ($user->rights->adherent->creer) $arrayofmassactions['close'] = $langs->trans("Resiliate");
401 if ($user->rights->adherent->supprimer) $arrayofmassactions['predelete'] = '<span class="fa fa-trash paddingrightonly"></span>'.$langs->trans("Delete");
402 if (in_array($massaction, array('presend', 'predelete'))) $arrayofmassactions = array();
403 $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
404 
405 $newcardbutton = '';
406 if ($user->rights->adherent->creer) {
407  $newcardbutton .= dolGetButtonTitle($langs->trans('NewMember'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/adherents/card.php?action=create');
408 }
409 
410 print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
411 if ($optioncss != '') print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
412 print '<input type="hidden" name="token" value="'.newToken().'">';
413 print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
414 print '<input type="hidden" name="action" value="list">';
415 print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
416 print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
417 print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
418 
419 print_barre_liste($titre, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit, 0, 0, 1);
420 
421 $topicmail = "Information";
422 $modelmail = "member";
423 $objecttmp = new Adherent($db);
424 $trackid = 'mem'.$object->id;
425 include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
426 
427 if ($sall) {
428  foreach ($fieldstosearchall as $key => $val) $fieldstosearchall[$key] = $langs->trans($val);
429  print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $sall).join(', ', $fieldstosearchall).'</div>';
430 }
431 
432 // Filter on categories
433 $moreforfilter = '';
434 if (!empty($conf->categorie->enabled) && $user->rights->categorie->lire) {
435  require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
436  $moreforfilter .= '<div class="divsearchfield">';
437  $moreforfilter .= $langs->trans('Categories').': ';
438  $moreforfilter .= $formother->select_categories(Categorie::TYPE_MEMBER, $search_categ, 'search_categ', 1);
439  $moreforfilter .= '</div>';
440 }
441 $parameters = array();
442 $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters); // Note that $action and $object may have been modified by hook
443 if (empty($reshook)) $moreforfilter .= $hookmanager->resPrint;
444 else $moreforfilter = $hookmanager->resPrint;
445 if (!empty($moreforfilter)) {
446  print '<div class="liste_titre liste_titre_bydiv centpercent">';
447  print $moreforfilter;
448  print '</div>';
449 }
450 
451 $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
452 $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage); // This also change content of $arrayfields
453 if ($massactionbutton) $selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
454 
455 print '<div class="div-table-responsive">';
456 print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
457 
458 
459 // Line for filters fields
460 print '<tr class="liste_titre_filter">';
461 
462 // Line numbering
463 if (!empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) {
464  print '<td class="liste_titre">&nbsp;</td>';
465 }
466 
467 // Ref
468 if (!empty($arrayfields['d.ref']['checked'])) {
469  print '<td class="liste_titre">';
470  print '<input class="flat maxwidth75imp" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'">';
471  print '</td>';
472 }
473 if (!empty($arrayfields['d.civility']['checked'])) {
474  print '<td class="liste_titre left">';
475  print '<input class="flat maxwidth50imp" type="text" name="search_civility" value="'.dol_escape_htmltag($search_civility).'"></td>';
476 }
477 if (!empty($arrayfields['d.firstname']['checked'])) {
478  print '<td class="liste_titre left">';
479  print '<input class="flat maxwidth75imp" type="text" name="search_firstname" value="'.dol_escape_htmltag($search_firstname).'"></td>';
480 }
481 if (!empty($arrayfields['d.lastname']['checked'])) {
482  print '<td class="liste_titre left">';
483  print '<input class="flat maxwidth75imp" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).'"></td>';
484 }
485 if (!empty($arrayfields['d.gender']['checked'])) {
486  print '<td class="liste_titre">';
487  $arraygender = array('man'=>$langs->trans("Genderman"), 'woman'=>$langs->trans("Genderwoman"), 'other'=>$langs->trans("Genderother"));
488  print $form->selectarray('search_gender', $arraygender, $search_gender, 1);
489  print '</td>';
490 }
491 if (!empty($arrayfields['d.company']['checked'])) {
492  print '<td class="liste_titre left">';
493  print '<input class="flat maxwidth75imp" type="text" name="search_company" value="'.dol_escape_htmltag($search_company).'"></td>';
494 }
495 if (!empty($arrayfields['d.login']['checked'])) {
496  print '<td class="liste_titre left">';
497  print '<input class="flat maxwidth75imp" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).'"></td>';
498 }
499 if (!empty($arrayfields['d.morphy']['checked'])) {
500  print '<td class="liste_titre left">';
501  print '</td>';
502 }
503 if (!empty($arrayfields['t.libelle']['checked'])) {
504  print '<td class="liste_titre">';
505  $listetype = $membertypestatic->liste_array();
506  print $form->selectarray("search_type", $listetype, $type, 1, 0, 0, '', 0, 32);
507  print '</td>';
508 }
509 
510 if (!empty($arrayfields['d.address']['checked'])) {
511  print '<td class="liste_titre left">';
512  print '<input class="flat maxwidth75imp" type="text" name="search_address" value="'.dol_escape_htmltag($search_address).'"></td>';
513 }
514 
515 if (!empty($arrayfields['d.zip']['checked'])) {
516  print '<td class="liste_titre left">';
517  print '<input class="flat maxwidth50imp" type="text" name="search_zip" value="'.dol_escape_htmltag($search_zip).'"></td>';
518 }
519 if (!empty($arrayfields['d.town']['checked'])) {
520  print '<td class="liste_titre left">';
521  print '<input class="flat maxwidth75imp" type="text" name="search_town" value="'.dol_escape_htmltag($search_town).'"></td>';
522 }
523 // State
524 if (!empty($arrayfields['state.nom']['checked'])) {
525  print '<td class="liste_titre">';
526  print '<input class="flat searchstring maxwidth75imp" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).'">';
527  print '</td>';
528 }
529 // Country
530 if (!empty($arrayfields['country.code_iso']['checked'])) {
531  print '<td class="liste_titre center">';
532  print $form->select_country($search_country, 'search_country', '', 0, 'minwidth100imp maxwidth100');
533  print '</td>';
534 }
535 // Phone pro
536 if (!empty($arrayfields['d.phone']['checked'])) {
537  print '<td class="liste_titre left">';
538  print '<input class="flat maxwidth75imp" type="text" name="search_phone" value="'.dol_escape_htmltag($search_phone).'"></td>';
539 }
540 // Phone perso
541 if (!empty($arrayfields['d.phone_perso']['checked'])) {
542  print '<td class="liste_titre left">';
543  print '<input class="flat maxwidth50" type="text" name="search_phone_perso" value="'.dol_escape_htmltag($search_phone_perso).'"></td>';
544 }
545 // Phone mobile
546 if (!empty($arrayfields['d.phone_mobile']['checked'])) {
547  print '<td class="liste_titre left">';
548  print '<input class="flat maxwidth75imp" type="text" name="search_phone_mobile" value="'.dol_escape_htmltag($search_phone_mobile).'"></td>';
549 }
550 // Email
551 if (!empty($arrayfields['d.email']['checked'])) {
552  print '<td class="liste_titre left">';
553  print '<input class="flat maxwidth75imp" type="text" name="search_email" value="'.dol_escape_htmltag($search_email).'"></td>';
554 }
555 // End of subscription date
556 if (!empty($arrayfields['d.datefin']['checked'])) {
557  print '<td class="liste_titre left">';
558  $selectarray = array('-1'=>'', 'withoutsubscription'=>$langs->trans("WithoutSubscription"), 'uptodate'=>$langs->trans("UpToDate"), 'outofdate'=>$langs->trans("OutOfDate"));
559  print $form->selectarray('search_filter', $selectarray, $search_filter);
560  print '</td>';
561 }
562 // Extra fields
563 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
564 
565 // Fields from hook
566 $parameters = array('arrayfields'=>$arrayfields);
567 $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
568 print $hookmanager->resPrint;
569 // Date creation
570 if (!empty($arrayfields['d.datec']['checked'])) {
571  print '<td class="liste_titre">';
572  print '</td>';
573 }
574 // Birthday
575 if (!empty($arrayfields['d.birth']['checked'])) {
576  print '<td class="liste_titre">';
577  print '</td>';
578 }
579 // Date modification
580 if (!empty($arrayfields['d.tms']['checked'])) {
581  print '<td class="liste_titre">';
582  print '</td>';
583 }
584 // Status
585 if (!empty($arrayfields['d.statut']['checked'])) {
586  print '<td class="liste_titre right maxwidthonsmartphone">';
587  $liststatus = array(
588  '-1'=>$langs->trans("Draft"),
589  '1'=>$langs->trans("Validated"),
590  '0'=>$langs->trans("Resiliated")
591  );
592  print $form->selectarray('search_status', $liststatus, $search_status, -2);
593  print '</td>';
594 }
595 // Action column
596 print '<td class="liste_titre middle">';
597 $searchpicto = $form->showFilterButtons();
598 print $searchpicto;
599 print '</td>';
600 
601 print "</tr>\n";
602 
603 print '<tr class="liste_titre">';
604 if (!empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) print_liste_field_titre("ID", $_SERVER["PHP_SELF"], '', '', $param, 'align="center"', $sortfield, $sortorder);
605 if (!empty($arrayfields['d.ref']['checked'])) print_liste_field_titre($arrayfields['d.ref']['label'], $_SERVER["PHP_SELF"], 'd.rowid', '', $param, '', $sortfield, $sortorder);
606 if (!empty($arrayfields['d.civility']['checked'])) print_liste_field_titre($arrayfields['d.civility']['label'], $_SERVER["PHP_SELF"], 'd.civility', '', $param, '', $sortfield, $sortorder);
607 if (!empty($arrayfields['d.firstname']['checked'])) print_liste_field_titre($arrayfields['d.firstname']['label'], $_SERVER["PHP_SELF"], 'd.firstname', '', $param, '', $sortfield, $sortorder);
608 if (!empty($arrayfields['d.lastname']['checked'])) print_liste_field_titre($arrayfields['d.lastname']['label'], $_SERVER["PHP_SELF"], 'd.lastname', '', $param, '', $sortfield, $sortorder);
609 if (!empty($arrayfields['d.gender']['checked'])) print_liste_field_titre($arrayfields['d.gender']['label'], $_SERVER['PHP_SELF'], 'd.gender', $param, "", "", $sortfield, $sortorder);
610 if (!empty($arrayfields['d.company']['checked'])) print_liste_field_titre($arrayfields['d.company']['label'], $_SERVER["PHP_SELF"], 'd.societe', '', $param, '', $sortfield, $sortorder);
611 if (!empty($arrayfields['d.login']['checked'])) print_liste_field_titre($arrayfields['d.login']['label'], $_SERVER["PHP_SELF"], 'd.login', '', $param, '', $sortfield, $sortorder);
612 if (!empty($arrayfields['d.morphy']['checked'])) print_liste_field_titre($arrayfields['d.morphy']['label'], $_SERVER["PHP_SELF"], 'd.morphy', '', $param, '', $sortfield, $sortorder);
613 if (!empty($arrayfields['t.libelle']['checked'])) print_liste_field_titre($arrayfields['t.libelle']['label'], $_SERVER["PHP_SELF"], 't.libelle', '', $param, '', $sortfield, $sortorder);
614 if (!empty($arrayfields['d.address']['checked'])) print_liste_field_titre($arrayfields['d.address']['label'], $_SERVER["PHP_SELF"], 'd.address', '', $param, '', $sortfield, $sortorder);
615 if (!empty($arrayfields['d.zip']['checked'])) print_liste_field_titre($arrayfields['d.zip']['label'], $_SERVER["PHP_SELF"], 'd.zip', '', $param, '', $sortfield, $sortorder);
616 if (!empty($arrayfields['d.town']['checked'])) print_liste_field_titre($arrayfields['d.town']['label'], $_SERVER["PHP_SELF"], 'd.town', '', $param, '', $sortfield, $sortorder);
617 if (!empty($arrayfields['state.nom']['checked'])) print_liste_field_titre($arrayfields['state.nom']['label'], $_SERVER["PHP_SELF"], "state.nom", "", $param, '', $sortfield, $sortorder);
618 if (!empty($arrayfields['country.code_iso']['checked'])) print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, 'align="center"', $sortfield, $sortorder);
619 if (!empty($arrayfields['d.phone']['checked'])) print_liste_field_titre($arrayfields['d.phone']['label'], $_SERVER["PHP_SELF"], 'd.phone', '', $param, '', $sortfield, $sortorder);
620 if (!empty($arrayfields['d.phone_perso']['checked'])) print_liste_field_titre($arrayfields['d.phone_perso']['label'], $_SERVER["PHP_SELF"], 'd.phone_perso', '', $param, '', $sortfield, $sortorder);
621 if (!empty($arrayfields['d.phone_mobile']['checked'])) print_liste_field_titre($arrayfields['d.phone_mobile']['label'], $_SERVER["PHP_SELF"], 'd.phone_mobile', '', $param, '', $sortfield, $sortorder);
622 if (!empty($arrayfields['d.email']['checked'])) print_liste_field_titre($arrayfields['d.email']['label'], $_SERVER["PHP_SELF"], 'd.email', '', $param, '', $sortfield, $sortorder);
623 if (!empty($arrayfields['d.datefin']['checked'])) print_liste_field_titre($arrayfields['d.datefin']['label'], $_SERVER["PHP_SELF"], 'd.datefin', '', $param, 'align="center"', $sortfield, $sortorder);
624 // Extra fields
625 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
626 
627 // Hook fields
628 $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
629 $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
630 print $hookmanager->resPrint;
631 if (!empty($arrayfields['d.datec']['checked'])) print_liste_field_titre($arrayfields['d.datec']['label'], $_SERVER["PHP_SELF"], "d.datec", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
632 if (!empty($arrayfields['d.birth']['checked'])) print_liste_field_titre($arrayfields['d.birth']['label'], $_SERVER["PHP_SELF"], "d.birth", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
633 if (!empty($arrayfields['d.tms']['checked'])) print_liste_field_titre($arrayfields['d.tms']['label'], $_SERVER["PHP_SELF"], "d.tms", "", $param, 'align="center" class="nowrap"', $sortfield, $sortorder);
634 if (!empty($arrayfields['d.statut']['checked'])) print_liste_field_titre($arrayfields['d.statut']['label'], $_SERVER["PHP_SELF"], "d.statut", "", $param, 'class="right"', $sortfield, $sortorder);
635 print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
636 print "</tr>\n";
637 
638 $i = 0;
639 $totalarray = array();
640 while ($i < min($num, $limit)) {
641  $obj = $db->fetch_object($resql);
642 
643  $datefin = $db->jdate($obj->datefin);
644  $memberstatic->id = $obj->rowid;
645  $memberstatic->ref = $obj->rowid;
646  $memberstatic->civility_id = $obj->civility;
647  $memberstatic->lastname = $obj->lastname;
648  $memberstatic->firstname = $obj->firstname;
649  $memberstatic->gender = $obj->gender;
650  $memberstatic->statut = $obj->statut;
651  $memberstatic->datefin = $datefin;
652  $memberstatic->socid = $obj->fk_soc;
653  $memberstatic->photo = $obj->photo;
654  $memberstatic->email = $obj->email;
655  $memberstatic->morphy = $obj->morphy;
656  $memberstatic->note_public = $obj->note_public;
657  $memberstatic->note_private = $obj->note_private;
658 
659  if (!empty($obj->fk_soc)) {
660  $memberstatic->fetch_thirdparty();
661  $companyname = $memberstatic->thirdparty->name;
662  } else {
663  $companyname = $obj->company;
664  }
665  $memberstatic->company = $companyname;
666 
667  print '<tr class="oddeven">';
668 
669  if (!empty($conf->global->MAIN_SHOW_TECHNICAL_ID)) {
670  print '<td class="center">'.$obj->rowid.'</td>';
671  if (!$i) $totalarray['nbfield']++;
672  }
673 
674  // Ref
675  if (!empty($arrayfields['d.ref']['checked'])) {
676  print "<td>";
677  print $memberstatic->getNomUrl(-1, 0, 'card', 'ref', '', -1, 0, 1);
678  print "</td>\n";
679  if (!$i) $totalarray['nbfield']++;
680  }
681  // Civility
682  if (!empty($arrayfields['d.civility']['checked'])) {
683  print "<td>";
684  print $obj->civility;
685  print "</td>\n";
686  if (!$i) $totalarray['nbfield']++;
687  }
688  // Firstname
689  if (!empty($arrayfields['d.firstname']['checked'])) {
690  print "<td>";
691  print $obj->firstname;
692  print "</td>\n";
693  if (!$i) $totalarray['nbfield']++;
694  }
695  // Lastname
696  if (!empty($arrayfields['d.lastname']['checked'])) {
697  print "<td>";
698  print $obj->lastname;
699  print "</td>\n";
700  if (!$i) $totalarray['nbfield']++;
701  }
702  // Gender
703  if (!empty($arrayfields['d.gender']['checked'])) {
704  print '<td>';
705  if ($obj->gender) print $langs->trans("Gender".$obj->gender);
706  print '</td>';
707  if (!$i) $totalarray['nbfield']++;
708  }
709  // Company
710  if (!empty($arrayfields['d.company']['checked'])) {
711  print "<td>";
712  print $companyname;
713  print "</td>\n";
714  }
715  // Login
716  if (!empty($arrayfields['d.login']['checked'])) {
717  print "<td>".$obj->login."</td>\n";
718  if (!$i) $totalarray['nbfield']++;
719  }
720  // Nature (Moral/Physical)
721  if (!empty($arrayfields['d.morphy']['checked'])) {
722  print '<td class="center">';
723  $s = '';
724  if ($obj->morphy == 'phy') {
725  $s .= '<span class="customer-back" title="'.$langs->trans("Physical").'">'.dol_substr($langs->trans("Physical"), 0, 1).'</span>';
726  }
727  if ($obj->morphy == 'mor') {
728  $s .= '<span class="vendor-back" title="'.$langs->trans("Moral").'">'.dol_substr($langs->trans("Moral"), 0, 1).'</span>';
729  }
730  print $s;
731  print "</td>\n";
732  if (!$i) $totalarray['nbfield']++;
733  }
734  // Type label
735  if (!empty($arrayfields['t.libelle']['checked'])) {
736  $membertypestatic->id = $obj->type_id;
737  $membertypestatic->label = $obj->type;
738  print '<td class="nowrap">';
739  print $membertypestatic->getNomUrl(1, 32);
740  print '</td>';
741  if (!$i) $totalarray['nbfield']++;
742  }
743  // Address
744  if (!empty($arrayfields['d.address']['checked'])) {
745  print '<td class="nocellnopadd">';
746  print $obj->address;
747  print '</td>';
748  if (!$i) $totalarray['nbfield']++;
749  }
750  // Zip
751  if (!empty($arrayfields['d.zip']['checked'])) {
752  print '<td class="nocellnopadd">';
753  print $obj->zip;
754  print '</td>';
755  if (!$i) $totalarray['nbfield']++;
756  }
757  // Town
758  if (!empty($arrayfields['d.town']['checked'])) {
759  print '<td class="nocellnopadd">';
760  print $obj->town;
761  print '</td>';
762  if (!$i) $totalarray['nbfield']++;
763  }
764  // State
765  if (!empty($arrayfields['state.nom']['checked'])) {
766  print "<td>".$obj->state_name."</td>\n";
767  if (!$i) $totalarray['nbfield']++;
768  }
769  // Country
770  if (!empty($arrayfields['country.code_iso']['checked'])) {
771  print '<td class="center">';
772  $tmparray = getCountry($obj->country, 'all');
773  print $tmparray['label'];
774  print '</td>';
775  if (!$i) $totalarray['nbfield']++;
776  }
777  // Phone pro
778  if (!empty($arrayfields['d.phone']['checked'])) {
779  print '<td class="nocellnopadd">';
780  print $obj->phone;
781  print '</td>';
782  if (!$i) $totalarray['nbfield']++;
783  }
784  // Phone perso
785  if (!empty($arrayfields['d.phone_perso']['checked'])) {
786  print '<td class="nocellnopadd">';
787  print $obj->phone_perso;
788  print '</td>';
789  if (!$i) $totalarray['nbfield']++;
790  }
791  // Phone mobile
792  if (!empty($arrayfields['d.phone_mobile']['checked'])) {
793  print '<td class="nocellnopadd">';
794  print $obj->phone_mobile;
795  print '</td>';
796  if (!$i) $totalarray['nbfield']++;
797  }
798  // EMail
799  if (!empty($arrayfields['d.email']['checked'])) {
800  print "<td>".dol_print_email($obj->email, 0, 0, 1)."</td>\n";
801  }
802  // End of subscription date
803  $datefin = $db->jdate($obj->datefin);
804  if (!empty($arrayfields['d.datefin']['checked'])) {
805  if ($datefin) {
806  print '<td class="nowrap center">';
807  print dol_print_date($datefin, 'day');
808  if ($memberstatic->hasDelay()) {
809  $textlate .= ' ('.$langs->trans("DateReference").' > '.$langs->trans("DateToday").' '.(ceil($conf->adherent->subscription->warning_delay / 60 / 60 / 24) >= 0 ? '+' : '').ceil($conf->adherent->subscription->warning_delay / 60 / 60 / 24).' '.$langs->trans("days").')';
810  print " ".img_warning($langs->trans("SubscriptionLate").$textlate);
811  }
812  print '</td>';
813  } else {
814  print '<td class="nowrap left">';
815  if ($obj->subscription == 'yes') {
816  print $langs->trans("SubscriptionNotReceived");
817  if ($obj->statut > 0) print " ".img_warning();
818  } else {
819  print '&nbsp;';
820  }
821  print '</td>';
822  }
823  }
824  // Extra fields
825  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
826  // Fields from hook
827  $parameters = array('arrayfields'=>$arrayfields, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
828  $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook
829  print $hookmanager->resPrint;
830  // Date creation
831  if (!empty($arrayfields['d.datec']['checked'])) {
832  print '<td class="nowrap center">';
833  print dol_print_date($db->jdate($obj->date_creation), 'dayhour', 'tzuser');
834  print '</td>';
835  if (!$i) $totalarray['nbfield']++;
836  }
837  // Birth
838  if (!empty($arrayfields['d.birth']['checked'])) {
839  print '<td class="nowrap center">';
840  print dol_print_date($db->jdate($obj->birth), 'day', 'tzuser');
841  print '</td>';
842  if (!$i) $totalarray['nbfield']++;
843  }
844  // Date modification
845  if (!empty($arrayfields['d.tms']['checked'])) {
846  print '<td class="nowrap center">';
847  print dol_print_date($db->jdate($obj->date_update), 'dayhour', 'tzuser');
848  print '</td>';
849  if (!$i) $totalarray['nbfield']++;
850  }
851  // Status
852  if (!empty($arrayfields['d.statut']['checked'])) {
853  print '<td class="nowrap right">';
854  print $memberstatic->LibStatut($obj->statut, $obj->subscription, $datefin, 5);
855  print '</td>';
856  if (!$i) $totalarray['nbfield']++;
857  }
858  // Action column
859  print '<td class="center">';
860  if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
861  $selected = 0;
862  if (in_array($obj->rowid, $arrayofselected)) $selected = 1;
863  print '<input id="cb'.$obj->rowid.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$obj->rowid.'"'.($selected ? ' checked="checked"' : '').'>';
864  }
865  print '</td>';
866  if (!$i) $totalarray['nbfield']++;
867 
868  print "</tr>\n";
869  $i++;
870 }
871 
872 // Show total line
873 include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
874 
875 
876 // If no record found
877 if ($num == 0) {
878  $colspan = 1;
879  foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) $colspan++; }
880  print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
881 }
882 
883 $db->free($resql);
884 
885 $parameters = array('sql' => $sql);
886 $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters); // Note that $action and $object may have been modified by hook
887 print $hookmanager->resPrint;
888 
889 print "</table>\n";
890 print "</div>";
891 print '</form>';
892 
893 // End of page
894 llxFooter();
895 $db->close();
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_substr($string, $start, $length, $stringencoding= '', $trunconbytes=0)
Make a substring.
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.
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.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
Classe permettant la generation de composants html autre Only common components are here...
Class to manage members of a foundation.
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...
Class to manage members type.
print $_SERVER["PHP_SELF"]
Edit parameters.
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
getCountry($searchkey, $withcode= '', $dbtouse=0, $outputlangs= '', $entconv=1, $searchlabel= '')
Return country label, code or id from an id, code or label.