dolibarr  18.0.0-alpha
type.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
4  * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
5  * Copyright (C) 2005-2017 Regis Houssin <regis.houssin@inodbox.com>
6  * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
7  * Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
8  * Copyright (C) 2019-2022 Thibault Foucart <support@ptibogxiv.net>
9  * Copyright (C) 2020 Josep Lluís Amador <joseplluis@lliuretic.cat>
10  * Copyright (C) 2021 Waël Almoman <info@almoman.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 // Load Dolibarr environment
33 require '../main.inc.php';
34 require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
35 require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
36 require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
37 require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
38 require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
39 
40 // Load translation files required by the page
41 $langs->load("members");
42 
43 $rowid = GETPOST('rowid', 'int');
44 $action = GETPOST('action', 'aZ09');
45 $massaction = GETPOST('massaction', 'alpha');
46 $cancel = GETPOST('cancel', 'alpha');
47 $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search
48 $backtopage = GETPOST('backtopage', 'alpha');
49 $mode = GETPOST('mode', 'alopha');
50 
51 $sall = GETPOST("sall", "alpha");
52 $filter = GETPOST("filter", 'alpha');
53 $search_lastname = GETPOST('search_lastname', 'alpha');
54 $search_login = GETPOST('search_login', 'alpha');
55 $search_email = GETPOST('search_email', 'alpha');
56 $type = GETPOST('type', 'intcomma');
57 $status = GETPOST('status', 'alpha');
58 $optioncss = GETPOST('optioncss', 'alpha');
59 
60 // Load variable for pagination
61 $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
62 $sortfield = GETPOST('sortfield', 'aZ09comma');
63 $sortorder = GETPOST('sortorder', 'aZ09comma');
64 $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
65 if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
66  // If $page is not defined, or '' or -1 or if we click on clear filters
67  $page = 0;
68 }
69 $offset = $limit * $page;
70 $pageprev = $page - 1;
71 $pagenext = $page + 1;
72 if (!$sortorder) {
73  $sortorder = "DESC";
74 }
75 if (!$sortfield) {
76  $sortfield = "d.lastname";
77 }
78 
79 $label = GETPOST("label", "alpha");
80 $morphy = GETPOST("morphy", "alpha");
81 $status = GETPOST("status", "int");
82 $subscription = GETPOST("subscription", "int");
83 $amount = GETPOST('amount', 'alpha');
84 $duration_value = GETPOST('duration_value', 'int');
85 $duration_unit = GETPOST('duration_unit', 'alpha');
86 $vote = GETPOST("vote", "int");
87 $comment = GETPOST("comment", 'restricthtml');
88 $mail_valid = GETPOST("mail_valid", 'restricthtml');
89 $caneditamount = GETPOSTINT("caneditamount");
90 
91 // Initialize technical objects
92 $object = new AdherentType($db);
93 $extrafields = new ExtraFields($db);
94 $hookmanager->initHooks(array('membertypecard', 'globalcard'));
95 
96 // Fetch optionals attributes and labels
97 $extrafields->fetch_name_optionals_label($object->table_element);
98 
99 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
100  $search_lastname = "";
101  $search_login = "";
102  $search_email = "";
103  $type = "";
104  $sall = "";
105 }
106 
107 
108 // Security check
109 $result = restrictedArea($user, 'adherent', $rowid, 'adherent_type');
110 
111 
112 /*
113  * Actions
114  */
115 
116 if (GETPOST('cancel', 'alpha')) {
117  $action = 'list';
118  $massaction = '';
119 }
120 if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
121  $massaction = '';
122 }
123 
124 if ($cancel) {
125  $action = '';
126 
127  if (!empty($backtopage)) {
128  header("Location: ".$backtopage);
129  exit;
130  }
131 }
132 
133 if ($action == 'add' && $user->hasRight('adherent', 'configurer')) {
134  $object->label = trim($label);
135  $object->morphy = trim($morphy);
136  $object->status = (int) $status;
137  $object->subscription = (int) $subscription;
138  $object->amount = ($amount == '' ? '' : price2num($amount, 'MT'));
139  $object->caneditamount = $caneditamount;
140  $object->duration_value = $duration_value;
141  $object->duration_unit = $duration_unit;
142  $object->note_public = trim($comment);
143  $object->note_private = '';
144  $object->mail_valid = trim($mail_valid);
145  $object->vote = (int) $vote;
146 
147  // Fill array 'array_options' with data from add form
148  $ret = $extrafields->setOptionalsFromPost(null, $object);
149  if ($ret < 0) {
150  $error++;
151  }
152 
153  if (empty($object->label)) {
154  $error++;
155  setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors');
156  } else {
157  $sql = "SELECT libelle FROM ".MAIN_DB_PREFIX."adherent_type WHERE libelle = '".$db->escape($object->label)."'";
158  $sql .= " WHERE entity IN (".getEntity('member_type').")";
159  $result = $db->query($sql);
160  $num = null;
161  if ($result) {
162  $num = $db->num_rows($result);
163  }
164  if ($num) {
165  $error++;
166  $langs->load("errors");
167  setEventMessages($langs->trans("ErrorLabelAlreadyExists", $login), null, 'errors');
168  }
169  }
170 
171  if (!$error) {
172  $id = $object->create($user);
173  if ($id > 0) {
174  header("Location: ".$_SERVER["PHP_SELF"]);
175  exit;
176  } else {
177  setEventMessages($object->error, $object->errors, 'errors');
178  $action = 'create';
179  }
180  } else {
181  $action = 'create';
182  }
183 }
184 
185 if ($action == 'update' && $user->hasRight('adherent', 'configurer')) {
186  $object->fetch($rowid);
187 
188  $object->oldcopy = dol_clone($object);
189 
190  $object->label= trim($label);
191  $object->morphy = trim($morphy);
192  $object->status = (int) $status;
193  $object->subscription = (int) $subscription;
194  $object->amount = ($amount == '' ? '' : price2num($amount, 'MT'));
195  $object->caneditamount = $caneditamount;
196  $object->duration_value = $duration_value;
197  $object->duration_unit = $duration_unit;
198  $object->note_public = trim($comment);
199  $object->note_private = '';
200  $object->mail_valid = trim($mail_valid);
201  $object->vote = (boolean) trim($vote);
202 
203  // Fill array 'array_options' with data from add form
204  $ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
205  if ($ret < 0) {
206  $error++;
207  }
208 
209  $ret = $object->update($user);
210 
211  if ($ret >= 0 && !count($object->errors)) {
212  setEventMessages($langs->trans("MemberTypeModified"), null, 'mesgs');
213  } else {
214  setEventMessages($object->error, $object->errors, 'errors');
215  }
216 
217  header("Location: ".$_SERVER["PHP_SELF"]."?rowid=".$object->id);
218  exit;
219 }
220 
221 if ($action == 'confirm_delete' && $user->hasRight('adherent', 'configurer')) {
222  $object->fetch($rowid);
223  $res = $object->delete();
224 
225  if ($res > 0) {
226  setEventMessages($langs->trans("MemberTypeDeleted"), null, 'mesgs');
227  header("Location: ".$_SERVER["PHP_SELF"]);
228  exit;
229  } else {
230  setEventMessages($langs->trans("MemberTypeCanNotBeDeleted"), null, 'errors');
231  $action = '';
232  }
233 }
234 
235 
236 /*
237  * View
238  */
239 
240 $form = new Form($db);
241 $formproduct = new FormProduct($db);
242 
243 $help_url = 'EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_Miembros|DE:Modul_Mitglieder';
244 
245 llxHeader('', $langs->trans("MembersTypeSetup"), $help_url);
246 
247 // List of members type
248 if (!$rowid && $action != 'create' && $action != 'edit') {
249  //print dol_get_fiche_head('');
250 
251  $sql = "SELECT d.rowid, d.libelle as label, d.subscription, d.amount, d.caneditamount, d.vote, d.statut as status, d.morphy";
252  $sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as d";
253  $sql .= " WHERE d.entity IN (".getEntity('member_type').")";
254 
255  $result = $db->query($sql);
256  if ($result) {
257  $num = $db->num_rows($result);
258  $nbtotalofrecords = $num;
259 
260  $i = 0;
261 
262  $param = '';
263  if (!empty($mode)) {
264  $param .= '&mode'.urlencode($mode);
265  }
266  if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
267  $param .= '&contextpage='.$contextpage;
268  }
269  if ($limit > 0 && $limit != $conf->liste_limit) {
270  $param .= '&limit='.$limit;
271  }
272 
273  $newcardbutton = '';
274 
275  $newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss'=>'reposition'));
276  $newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss'=>'reposition'));
277 
278  if ($user->hasRight('adherent', 'configurer')) {
279  $newcardbutton .= dolGetButtonTitle($langs->trans('NewMemberType'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/adherents/type.php?action=create');
280  }
281 
282  print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
283  if ($optioncss != '') {
284  print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
285  }
286  print '<input type="hidden" name="token" value="'.newToken().'">';
287  print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
288  print '<input type="hidden" name="action" value="list">';
289  print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
290  print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
291  print '<input type="hidden" name="mode" value="'.$mode.'">';
292 
293 
294  print_barre_liste($langs->trans("MembersTypes"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit, 0, 0, 1);
295 
296  $moreforfilter = '';
297 
298  print '<div class="div-table-responsive">';
299  print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
300 
301  print '<tr class="liste_titre">';
302  if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
303  print '<th>&nbsp;</th>';
304  }
305  print '<th>'.$langs->trans("Ref").'</th>';
306  print '<th>'.$langs->trans("Label").'</th>';
307  print '<th class="center">'.$langs->trans("MembersNature").'</th>';
308  print '<th class="center">'.$langs->trans("SubscriptionRequired").'</th>';
309  print '<th class="center">'.$langs->trans("Amount").'</th>';
310  print '<th class="center">'.$langs->trans("CanEditAmountShort").'</th>';
311  print '<th class="center">'.$langs->trans("VoteAllowed").'</th>';
312  print '<th class="center">'.$langs->trans("Status").'</th>';
313  if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
314  print '<th>&nbsp;</th>';
315  }
316  print "</tr>\n";
317 
318  $membertype = new AdherentType($db);
319 
320  $i = 0;
321  /*$savnbfield = $totalarray['nbfield'];
322  $totalarray = array();
323  $totalarray['nbfield'] = 0;*/
324 
325  $imaxinloop = ($limit ? min($num, $limit) : $num);
326  while ($i < $imaxinloop) {
327  $objp = $db->fetch_object($result);
328 
329  $membertype->id = $objp->rowid;
330  $membertype->ref = $objp->rowid;
331  $membertype->label = $objp->rowid;
332  $membertype->status = $objp->status;
333  $membertype->subscription = $objp->subscription;
334  $membertype->amount = $objp->amount;
335  $membertype->caneditamount = $objp->caneditamount;
336 
337  if ($mode == 'kanban') {
338  if ($i == 0) {
339  print '<tr><td colspan="12">';
340  print '<div class="box-flex-container kanban">';
341  }
342  //output kanban
343  $membertype->label = $objp->label;
344  print $membertype->getKanbanView('');
345  if ($i == ($imaxinloop - 1)) {
346  print '</div>';
347  print '</td></tr>';
348  }
349  } else {
350  print '<tr class="oddeven">';
351  if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
352  if ($user->rights->adherent->configurer) {
353  print '<td class="center"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit&rowid='.$objp->rowid.'">'.img_edit().'</a></td>';
354  }
355  }
356  print '<td class="nowraponall">';
357  print $membertype->getNomUrl(1);
358  //<a href="'.$_SERVER["PHP_SELF"].'?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowType"),'group').' '.$objp->rowid.'</a>
359  print '</td>';
360  print '<td>'.dol_escape_htmltag($objp->label).'</td>';
361  print '<td class="center">';
362  if ($objp->morphy == 'phy') {
363  print $langs->trans("Physical");
364  } elseif ($objp->morphy == 'mor') {
365  print $langs->trans("Moral");
366  } else {
367  print $langs->trans("MorAndPhy");
368  }
369  print '</td>';
370  print '<td class="center">'.yn($objp->subscription).'</td>';
371  print '<td class="center"><span class="amount">'.(is_null($objp->amount) || $objp->amount === '' ? '' : price($objp->amount)).'</span></td>';
372  print '<td class="center">'.yn($objp->caneditamount).'</td>';
373  print '<td class="center">'.yn($objp->vote).'</td>';
374  print '<td class="center">'.$membertype->getLibStatut(5).'</td>';
375  if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
376  if ($user->rights->adherent->configurer) {
377  print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit&rowid='.$objp->rowid.'">'.img_edit().'</a></td>';
378  }
379  }
380  print "</tr>";
381  }
382  $i++;
383  }
384 
385  // If no record found
386  if ($num == 0) {
387  /*$colspan = 1;
388  foreach ($arrayfields as $key => $val) {
389  if (!empty($val['checked'])) {
390  $colspan++;
391  }
392  }*/
393  $colspan = 9;
394  print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
395  }
396 
397  print "</table>";
398  print '</div>';
399 
400  print '</form>';
401  } else {
402  dol_print_error($db);
403  }
404 }
405 
406 // Creation
407 if ($action == 'create') {
408  $object = new AdherentType($db);
409 
410  print load_fiche_titre($langs->trans("NewMemberType"), '', 'members');
411 
412  print '<form action="'.$_SERVER['PHP_SELF'].'" method="POST">';
413  print '<input type="hidden" name="token" value="'.newToken().'">';
414  print '<input type="hidden" name="action" value="add">';
415 
416  print dol_get_fiche_head('');
417 
418  print '<table class="border centpercent">';
419  print '<tbody>';
420 
421  print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" class="minwidth200" name="label" autofocus="autofocus"></td></tr>';
422 
423  print '<tr><td>'.$langs->trans("Status").'</td><td>';
424  print $form->selectarray('status', array('0'=>$langs->trans('ActivityCeased'), '1'=>$langs->trans('InActivity')), 1, 0, 0, 0, '', 0, 0, 0, '', 'minwidth100');
425  print '</td></tr>';
426 
427  // Morphy
428  $morphys = array();
429  $morphys[""] = $langs->trans("MorAndPhy");
430  $morphys["phy"] = $langs->trans("Physical");
431  $morphys["mor"] = $langs->trans("Moral");
432  print '<tr><td><span>'.$langs->trans("MembersNature").'</span></td><td>';
433  print $form->selectarray("morphy", $morphys, GETPOSTISSET("morphy") ? GETPOST("morphy", 'aZ09') : 'morphy');
434  print "</td></tr>";
435 
436  print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
437  print $form->selectyesno("subscription", 1, 1);
438  print '</td></tr>';
439 
440  print '<tr><td>'.$langs->trans("Amount").'</td><td>';
441  print '<input name="amount" size="5" value="'.(GETPOSTISSET('amount') ? GETPOST('amount') : price($amount)).'">';
442  print '</td></tr>';
443 
444  print '<tr><td>'.$form->textwithpicto($langs->trans("CanEditAmountShort"), $langs->transnoentities("CanEditAmount")).'</td><td>';
445  print $form->selectyesno("caneditamount", GETPOSTISSET('caneditamount') ? GETPOST('caneditamount') : 0, 1);
446  print '</td></tr>';
447 
448  print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>';
449  print $form->selectyesno("vote", GETPOSTISSET("vote") ? GETPOST('vote', 'aZ09') : 1, 1);
450  print '</td></tr>';
451 
452  print '<tr><td>'.$langs->trans("Duration").'</td><td colspan="3">';
453  print '<input name="duration_value" size="5" value="'.GETPOST('duraction_unit', 'aZ09').'"> ';
454  print $formproduct->selectMeasuringUnits("duration_unit", "time", GETPOSTISSET("duration_unit") ? GETPOST('duration_unit', 'aZ09') : 'y', 0, 1);
455  print '</td></tr>';
456 
457  print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
458  require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
459  $doleditor = new DolEditor('comment', (GETPOSTISSET('comment') ? GETPOST('comment', 'restricthtml') : $object->note_public), '', 200, 'dolibarr_notes', '', false, true, empty($conf->fckeditor->enabled) ? false : $conf->fckeditor->enabled, 15, '90%');
460  $doleditor->Create();
461 
462  print '<tr><td class="tdtop">'.$langs->trans("WelcomeEMail").'</td><td>';
463  require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
464  $doleditor = new DolEditor('mail_valid', GETPOSTISSET('mail_valid') ? GETPOST('mail_valid') : $object->mail_valid, '', 250, 'dolibarr_notes', '', false, true, empty($conf->fckeditor->enabled) ? false : $conf->fckeditor->enabled, 15, '90%');
465  $doleditor->Create();
466  print '</td></tr>';
467 
468  // Other attributes
469  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
470 
471  print '<tbody>';
472  print "</table>\n";
473 
474  print dol_get_fiche_end();
475 
476  print $form->buttonsSaveCancel();
477 
478  print "</form>\n";
479 }
480 
481 // View
482 if ($rowid > 0) {
483  if ($action != 'edit') {
484  $object = new AdherentType($db);
485  $object->fetch($rowid);
486  $object->fetch_optionals();
487 
488  /*
489  * Confirmation deletion
490  */
491  if ($action == 'delete') {
492  print $form->formconfirm($_SERVER['PHP_SELF']."?rowid=".$object->id, $langs->trans("DeleteAMemberType"), $langs->trans("ConfirmDeleteMemberType", $object->label), "confirm_delete", '', 0, 1);
493  }
494 
495  $head = member_type_prepare_head($object);
496 
497  print dol_get_fiche_head($head, 'card', $langs->trans("MemberType"), -1, 'group');
498 
499  $linkback = '<a href="'.DOL_URL_ROOT.'/adherents/type.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
500 
501  dol_banner_tab($object, 'rowid', $linkback);
502 
503  print '<div class="fichecenter">';
504  print '<div class="underbanner clearboth"></div>';
505 
506  print '<table class="tableforfield border centpercent">';
507 
508  // Morphy
509  print '<tr><td>'.$langs->trans("MembersNature").'</td><td class="valeur" >'.$object->getmorphylib($object->morphy).'</td>';
510  print '</tr>';
511 
512  print '<tr><td class="titlefield">'.$langs->trans("SubscriptionRequired").'</td><td>';
513  print yn($object->subscription);
514  print '</tr>';
515 
516  // Amount
517  print '<tr><td class="titlefield">'.$langs->trans("Amount").'</td><td>';
518  print ((is_null($object->amount) || $object->amount === '') ? '' : '<span class="amount">'.price($object->amount).'</span>');
519  print '</tr>';
520 
521  print '<tr><td>'.$form->textwithpicto($langs->trans("CanEditAmountShort"), $langs->transnoentities("CanEditAmount")).'</td><td>';
522  print yn($object->caneditamount);
523  print '</td></tr>';
524 
525  print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>';
526  print yn($object->vote);
527  print '</tr>';
528 
529  print '<tr><td class="titlefield">'.$langs->trans("Duration").'</td><td colspan="2">'.$object->duration_value.'&nbsp;';
530  if ($object->duration_value > 1) {
531  $dur = array("i"=>$langs->trans("Minutes"), "h"=>$langs->trans("Hours"), "d"=>$langs->trans("Days"), "w"=>$langs->trans("Weeks"), "m"=>$langs->trans("Months"), "y"=>$langs->trans("Years"));
532  } elseif ($object->duration_value > 0) {
533  $dur = array("i"=>$langs->trans("Minute"), "h"=>$langs->trans("Hour"), "d"=>$langs->trans("Day"), "w"=>$langs->trans("Week"), "m"=>$langs->trans("Month"), "y"=>$langs->trans("Year"));
534  }
535  print (!empty($object->duration_unit) && isset($dur[$object->duration_unit]) ? $langs->trans($dur[$object->duration_unit]) : '')."&nbsp;";
536  print '</td></tr>';
537 
538  print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
539  print nl2br($object->note)."</td></tr>";
540 
541  print '<tr><td class="tdtop">'.$langs->trans("WelcomeEMail").'</td><td>';
542  print nl2br($object->mail_valid)."</td></tr>";
543 
544  // Other attributes
545  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
546 
547  print '</table>';
548  print '</div>';
549 
550  print dol_get_fiche_end();
551 
552  /*
553  * Buttons
554  */
555 
556  print '<div class="tabsAction">';
557 
558  // Edit
559  if ($user->hasRight('adherent', 'configurer')) {
560  print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=edit&token='.newToken().'&rowid='.$object->id.'">'.$langs->trans("Modify").'</a></div>';
561  }
562 
563  // Add
564  if ($user->hasRight('adherent', 'configurer')&& !empty($object->status)) {
565  print '<div class="inline-block divButAction"><a class="butAction" href="card.php?action=create&token='.newToken().'&typeid='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.$langs->trans("AddMember").'</a></div>';
566  } else {
567  print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NoAddMember")).'">'.$langs->trans("AddMember").'</a></div>';
568  }
569 
570  // Delete
571  if ($user->hasRight('adherent', 'configurer')) {
572  print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=delete&token='.newToken().'&rowid='.$object->id.'">'.$langs->trans("DeleteType").'</a></div>';
573  }
574 
575  print "</div>";
576 
577 
578  // Show list of members (nearly same code than in page list.php)
579 
580  $membertypestatic = new AdherentType($db);
581 
582  $now = dol_now();
583 
584  $sql = "SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe as company,";
585  $sql .= " d.datefin,";
586  $sql .= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut as status,";
587  $sql .= " t.libelle as type, t.subscription, t.amount";
588  $sql .= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t";
589  $sql .= " WHERE d.fk_adherent_type = t.rowid ";
590  $sql .= " AND d.entity IN (".getEntity('adherent').")";
591  $sql .= " AND t.rowid = ".((int) $object->id);
592  if ($sall) {
593  $sql .= natural_search(array("d.firstname", "d.lastname", "d.societe", "d.email", "d.login", "d.address", "d.town", "d.note_public", "d.note_private"), $sall);
594  }
595  if ($status != '') {
596  $sql .= natural_search('d.statut', $status, 2);
597  }
598  if ($action == 'search') {
599  if (GETPOST('search', 'alpha')) {
600  $sql .= natural_search(array("d.firstname", "d.lastname"), GETPOST('search', 'alpha'));
601  }
602  }
603  if (!empty($search_lastname)) {
604  $sql .= natural_search(array("d.firstname", "d.lastname"), $search_lastname);
605  }
606  if (!empty($search_login)) {
607  $sql .= natural_search("d.login", $search_login);
608  }
609  if (!empty($search_email)) {
610  $sql .= natural_search("d.email", $search_email);
611  }
612  if ($filter == 'uptodate') {
613  $sql .= " AND (datefin >= '".$db->idate($now)."') OR t.subscription = 0)";
614  }
615  if ($filter == 'outofdate') {
616  $sql .= " AND (datefin < '".$db->idate($now)."' AND t.subscription = 1)";
617  }
618 
619  $sql .= " ".$db->order($sortfield, $sortorder);
620 
621  // Count total nb of records
622  $nbtotalofrecords = '';
623  if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
624  $resql = $db->query($sql);
625  if ($resql) {
626  $nbtotalofrecords = $db->num_rows($result);
627  } else {
628  dol_print_error($db);
629  }
630  if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
631  $page = 0;
632  $offset = 0;
633  }
634  }
635 
636  $sql .= " ".$db->plimit($conf->liste_limit + 1, $offset);
637 
638  $resql = $db->query($sql);
639  if ($resql) {
640  $num = $db->num_rows($resql);
641  $i = 0;
642 
643  $titre = $langs->trans("MembersList");
644  if ($status != '') {
645  if ($status == '-1,1') {
646  $titre = $langs->trans("MembersListQualified");
647  } elseif ($status == '-1') {
648  $titre = $langs->trans("MembersListToValid");
649  } elseif ($status == '1' && !$filter) {
650  $titre = $langs->trans("MembersListValid");
651  } elseif ($status == '1' && $filter == 'uptodate') {
652  $titre = $langs->trans("MembersListUpToDate");
653  } elseif ($status == '1' && $filter == 'outofdate') {
654  $titre = $langs->trans("MembersListNotUpToDate");
655  } elseif ($status == '0') {
656  $titre = $langs->trans("MembersListResiliated");
657  } elseif ($status == '-2') {
658  $titre = $langs->trans("MembersListExcluded");
659  }
660  } elseif ($action == 'search') {
661  $titre = $langs->trans("MembersListQualified");
662  }
663 
664  if ($type > 0) {
665  $membertype = new AdherentType($db);
666  $result = $membertype->fetch($type);
667  $titre .= " (".$membertype->label.")";
668  }
669 
670  $param = "&rowid=".urlencode($object->id);
671  if (!empty($status)) {
672  $param .= "&status=".urlencode($status);
673  }
674  if (!empty($search_lastname)) {
675  $param .= "&search_lastname=".urlencode($search_lastname);
676  }
677  if (!empty($search_firstname)) {
678  $param .= "&search_firstname=".urlencode($search_firstname);
679  }
680  if (!empty($search_login)) {
681  $param .= "&search_login=".urlencode($search_login);
682  }
683  if (!empty($search_email)) {
684  $param .= "&search_email=".urlencode($search_email);
685  }
686  if (!empty($filter)) {
687  $param .= "&filter=".urlencode($filter);
688  }
689 
690  if ($sall) {
691  print $langs->trans("Filter")." (".$langs->trans("Lastname").", ".$langs->trans("Firstname").", ".$langs->trans("EMail").", ".$langs->trans("Address")." ".$langs->trans("or")." ".$langs->trans("Town")."): ".$sall;
692  }
693 
694  print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
695  print '<input type="hidden" name="token" value="'.newToken().'">';
696  print '<input class="flat" type="hidden" name="rowid" value="'.$object->id.'" size="12"></td>';
697 
698  print '<br>';
699  print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords);
700 
701  $moreforfilter = '';
702 
703  print '<div class="div-table-responsive">';
704  print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
705 
706  // Fields title search
707  print '<tr class="liste_titre_filter">';
708 
709  print '<td class="liste_titre left">';
710  print '<input class="flat" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).'" size="12"></td>';
711 
712  print '<td class="liste_titre left">';
713  print '<input class="flat" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).'" size="7"></td>';
714 
715  print '<td class="liste_titre">&nbsp;</td>';
716 
717  print '<td class="liste_titre left">';
718  print '<input class="flat" type="text" name="search_email" value="'.dol_escape_htmltag($search_email).'" size="12"></td>';
719 
720  print '<td class="liste_titre">&nbsp;</td>';
721 
722  print '<td class="liste_titre right" colspan="2">';
723  print '<input type="image" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" name="button_search" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
724  print '&nbsp; ';
725  print '<input type="image" class="liste_titre" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/searchclear.png" name="button_removefilter" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
726  print '</td>';
727 
728  print "</tr>\n";
729 
730  print '<tr class="liste_titre">';
731  if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
732  print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder);
733  }
734  print_liste_field_titre("NameSlashCompany", $_SERVER["PHP_SELF"], "d.lastname", $param, "", "", $sortfield, $sortorder);
735  print_liste_field_titre("Login", $_SERVER["PHP_SELF"], "d.login", $param, "", "", $sortfield, $sortorder);
736  print_liste_field_titre("MemberNature", $_SERVER["PHP_SELF"], "d.morphy", $param, "", "", $sortfield, $sortorder);
737  print_liste_field_titre("EMail", $_SERVER["PHP_SELF"], "d.email", $param, "", "", $sortfield, $sortorder);
738  print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "d.statut,d.datefin", $param, "", "", $sortfield, $sortorder);
739  print_liste_field_titre("EndSubscription", $_SERVER["PHP_SELF"], "d.datefin", $param, "", 'align="center"', $sortfield, $sortorder);
740  if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
741  print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder);
742  }
743  print "</tr>\n";
744 
745  $adh = new Adherent($db);
746 
747  $imaxinloop = ($limit ? min($num, $limit) : $num);
748  while ($i < $imaxinloop) {
749  $objp = $db->fetch_object($resql);
750 
751  $datefin = $db->jdate($objp->datefin);
752 
753  $adh->lastname = $objp->lastname;
754  $adh->firstname = $objp->firstname;
755  $adh->datefin = $datefin;
756  $adh->need_subscription = $objp->subscription;
757  $adh->statut = $objp->status;
758 
759  print '<tr class="oddeven">';
760  // Actions
761  if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
762  print '<td class="center">';
763  if ($user->hasRight('adherent', 'creer')) {
764  print '<a class="editfielda marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=edit&token='.newToken().'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.img_edit().'</a>';
765  }
766  if ($user->hasRight('adherent', 'supprimer')) {
767  print '<a class="marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=resiliate&token='.newToken().'">'.img_picto($langs->trans("Resiliate"), 'disable.png').'</a>';
768  }
769  print "</td>";
770  }
771  // Lastname
772  if ($objp->company != '') {
773  print '<td><a href="card.php?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowMember"), "user", 'class="paddingright"').$adh->getFullName($langs, 0, -1, 20).' / '.dol_trunc($objp->company, 12).'</a></td>'."\n";
774  } else {
775  print '<td><a href="card.php?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowMember"), "user", 'class="paddingright"').$adh->getFullName($langs, 0, -1, 32).'</a></td>'."\n";
776  }
777 
778  // Login
779  print "<td>".dol_escape_htmltag($objp->login)."</td>\n";
780 
781  // Type
782  /*print '<td class="nowrap">';
783  $membertypestatic->id=$objp->type_id;
784  $membertypestatic->label=$objp->type;
785  print $membertypestatic->getNomUrl(1,12);
786  print '</td>';
787  */
788 
789  // Moral/Physique
790  print "<td>".$adh->getmorphylib($objp->morphy, 1)."</td>\n";
791 
792  // EMail
793  print "<td>".dol_print_email($objp->email, 0, 0, 1)."</td>\n";
794 
795  // Status
796  print '<td class="nowrap">';
797  print $adh->getLibStatut(2);
798  print "</td>";
799 
800  // Date end subscription
801  if ($datefin) {
802  print '<td class="nowrap center">';
803  if ($datefin < dol_now() && $objp->status > 0) {
804  print dol_print_date($datefin, 'day')." ".img_warning($langs->trans("SubscriptionLate"));
805  } else {
806  print dol_print_date($datefin, 'day');
807  }
808  print '</td>';
809  } else {
810  print '<td class="nowrap center">';
811  if (!empty($objp->subscription)) {
812  print '<span class="opacitymedium">'.$langs->trans("SubscriptionNotReceived").'</span>';
813  if ($objp->status > 0) {
814  print " ".img_warning();
815  }
816  } else {
817  print '&nbsp;';
818  }
819  print '</td>';
820  }
821 
822  // Actions
823  if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
824  print '<td class="center">';
825  if ($user->hasRight('adherent', 'creer')) {
826  print '<a class="editfielda marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=edit&token='.newToken().'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.img_edit().'</a>';
827  }
828  if ($user->hasRight('adherent', 'supprimer')) {
829  print '<a class="marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=resiliate&token='.newToken().'">'.img_picto($langs->trans("Resiliate"), 'disable.png').'</a>';
830  }
831  print "</td>";
832  }
833  print "</tr>\n";
834  $i++;
835  }
836 
837  if ($i == 0) {
838  print '<tr><td colspan="7"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
839  }
840 
841  print "</table>\n";
842  print '</div>';
843  print '</form>';
844 
845  if ($num > $limit) {
846  print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, '');
847  }
848  } else {
849  dol_print_error($db);
850  }
851  }
852 
853  /* ************************************************************************** */
854  /* */
855  /* Edition mode */
856  /* */
857  /* ************************************************************************** */
858 
859  if ($action == 'edit') {
860  $object = new AdherentType($db);
861  $object->fetch($rowid);
862  $object->fetch_optionals();
863 
864  $head = member_type_prepare_head($object);
865 
866  print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'">';
867  print '<input type="hidden" name="token" value="'.newToken().'">';
868  print '<input type="hidden" name="rowid" value="'.$object->id.'">';
869  print '<input type="hidden" name="action" value="update">';
870 
871  print dol_get_fiche_head($head, 'card', $langs->trans("MemberType"), 0, 'group');
872 
873  print '<table class="border centpercent">';
874 
875  print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>'.$object->id.'</td></tr>';
876 
877  print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" class="minwidth300" name="label" value="'.dol_escape_htmltag($object->label).'"></td></tr>';
878 
879  print '<tr><td>'.$langs->trans("Status").'</td><td>';
880  print $form->selectarray('status', array('0'=>$langs->trans('ActivityCeased'), '1'=>$langs->trans('InActivity')), $object->status, 0, 0, 0, '', 0, 0, 0, '', 'minwidth100');
881  print '</td></tr>';
882 
883  // Morphy
884  $morphys[""] = $langs->trans("MorAndPhy");
885  $morphys["phy"] = $langs->trans("Physical");
886  $morphys["mor"] = $langs->trans("Moral");
887  print '<tr><td><span>'.$langs->trans("MembersNature").'</span></td><td>';
888  print $form->selectarray("morphy", $morphys, GETPOSTISSET("morphy") ? GETPOST("morphy", 'aZ09') : $object->morphy);
889  print "</td></tr>";
890 
891  print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
892  print $form->selectyesno("subscription", $object->subscription, 1);
893  print '</td></tr>';
894 
895  print '<tr><td>'.$langs->trans("Amount").'</td><td>';
896  print '<input name="amount" size="5" value="';
897  print ((is_null($object->amount) || $object->amount === '') ? '' : price($object->amount));
898  print '">';
899  print '</td></tr>';
900 
901  print '<tr><td>'.$form->textwithpicto($langs->trans("CanEditAmountShort"), $langs->transnoentities("CanEditAmountDetail")).'</td><td>';
902  print $form->selectyesno("caneditamount", $object->caneditamount, 1);
903  print '</td></tr>';
904 
905  print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>';
906  print $form->selectyesno("vote", $object->vote, 1);
907  print '</td></tr>';
908 
909  print '<tr><td>'.$langs->trans("Duration").'</td><td colspan="3">';
910  print '<input name="duration_value" size="5" value="'.$object->duration_value.'"> ';
911  print $formproduct->selectMeasuringUnits("duration_unit", "time", ($object->duration_unit === '' ? 'y' : $object->duration_unit), 0, 1);
912  print '</td></tr>';
913 
914  print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
915  require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
916  $doleditor = new DolEditor('comment', $object->note_public, '', 220, 'dolibarr_notes', '', false, true, empty($conf->fckeditor->enabled) ? false : $conf->fckeditor->enabled, 15, '90%');
917  $doleditor->Create();
918  print "</td></tr>";
919 
920  print '<tr><td class="tdtop">'.$langs->trans("WelcomeEMail").'</td><td>';
921  $doleditor = new DolEditor('mail_valid', $object->mail_valid, '', 280, 'dolibarr_notes', '', false, true, empty($conf->fckeditor->enabled) ? false : $conf->fckeditor->enabled, 15, '90%');
922  $doleditor->Create();
923  print "</td></tr>";
924 
925  // Other attributes
926  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
927 
928  print '</table>';
929 
930  print dol_get_fiche_end();
931 
932  print $form->buttonsSaveCancel();
933 
934  print "</form>";
935  }
936 }
937 
938 // End of page
939 llxFooter();
940 $db->close();
AdherentType
Class to manage members type.
Definition: adherent_type.class.php:35
yn
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
Definition: functions.lib.php:6699
dol_escape_htmltag
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
Definition: functions.lib.php:1504
dol_trunc
dol_trunc($string, $size=40, $trunc='right', $stringencoding='UTF-8', $nodot=0, $display=0)
Truncate a string to a particular length adding '…' if string larger than length.
Definition: functions.lib.php:3950
llxFooter
llxFooter()
Empty footer.
Definition: wrapper.php:70
$sql
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $sql
Social contributions to pay.
Definition: index.php:745
load_fiche_titre
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
Definition: functions.lib.php:5363
GETPOST
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Definition: functions.lib.php:530
dol_print_error
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
Definition: functions.lib.php:4994
member_type_prepare_head
member_type_prepare_head(AdherentType $object)
Return array head with list of tabs to view object informations.
Definition: member.lib.php:153
img_warning
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
Definition: functions.lib.php:4671
$form
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:143
dol_clone
dol_clone($object, $native=0)
Create a clone of instance of object (new instance with same value for each properties) With native =...
Definition: functions.lib.php:1168
img_edit
img_edit($titlealt='default', $float=0, $other='')
Show logo editer/modifier fiche.
Definition: functions.lib.php:4539
dol_banner_tab
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
Definition: functions.lib.php:2097
$help_url
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
Definition: agenda.php:118
price2num
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
Definition: functions.lib.php:5834
dol_print_date
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
Definition: functions.lib.php:2566
img_picto
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
Definition: functions.lib.php:4025
llxHeader
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:56
dolGetButtonTitle
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.
Definition: functions.lib.php:11044
GETPOSTINT
GETPOSTINT($paramname, $method=0)
Return value of a param into GET or POST supervariable.
Definition: functions.lib.php:847
print_barre_liste
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.
Definition: functions.lib.php:5416
Adherent
Class to manage members of a foundation.
Definition: adherent.class.php:46
dol_get_fiche_head
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
Definition: functions.lib.php:1873
getDolGlobalString
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
Definition: functions.lib.php:82
restrictedArea
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
Definition: security.lib.php:341
FormProduct
Class with static methods for building HTML components related to products Only components common to ...
Definition: html.formproduct.class.php:30
newToken
newToken()
Return the value of token currently saved into session with name 'newtoken'.
Definition: functions.lib.php:11317
dol_get_fiche_end
dol_get_fiche_end($notab=0)
Return tab footer of a card.
Definition: functions.lib.php:2069
GETPOSTISSET
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
Definition: functions.lib.php:431
print_liste_field_titre
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
Definition: functions.lib.php:5181
natural_search
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...
Definition: functions.lib.php:9823
ExtraFields
Class to manage standard extra fields.
Definition: extrafields.class.php:39
Form
Class to manage generation of HTML components Only common components must be here.
Definition: html.form.class.php:52
img_object
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
Definition: functions.lib.php:4361
dol_now
dol_now($mode='auto')
Return date for now.
Definition: functions.lib.php:2947
price
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages.
Definition: functions.lib.php:5708
setEventMessages
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
Definition: functions.lib.php:8509
$nbtotalofrecords
$nbtotalofrecords
Count total nb of records.
Definition: list.php:329
DolEditor
Class to manage a WYSIWYG editor.
Definition: doleditor.class.php:30