dolibarr 21.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-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
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 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
12 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program. If not, see <https://www.gnu.org/licenses/>.
26 */
27
34// Load Dolibarr environment
35require '../main.inc.php';
36require_once DOL_DOCUMENT_ROOT.'/core/lib/member.lib.php';
37require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
38require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php';
39require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
40require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
41
42// Load translation files required by the page
43$langs->load("members");
44
45$rowid = GETPOSTINT('rowid');
46$action = GETPOST('action', 'aZ09');
47$massaction = GETPOST('massaction', 'alpha');
48$cancel = GETPOST('cancel', 'alpha');
49$toselect = GETPOST('toselect', 'array');
50$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search
51$backtopage = GETPOST('backtopage', 'alpha');
52$mode = GETPOST('mode', 'alpha');
53
54$sall = GETPOST("sall", "alpha");
55$filter = GETPOST("filter", 'alpha');
56$search_ref = GETPOST('search_ref', 'alpha');
57$search_lastname = GETPOST('search_lastname', 'alpha');
58$search_login = GETPOST('search_login', 'alpha');
59$search_email = GETPOST('search_email', 'alpha');
60$type = GETPOST('type', 'intcomma');
61$status = GETPOST('status', 'alpha');
62$optioncss = GETPOST('optioncss', 'alpha');
63
64// Load variable for pagination
65$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
66$sortfield = GETPOST('sortfield', 'aZ09comma');
67$sortorder = GETPOST('sortorder', 'aZ09comma');
68$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
69if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
70 // If $page is not defined, or '' or -1 or if we click on clear filters
71 $page = 0;
72}
73$offset = $limit * $page;
74$pageprev = $page - 1;
75$pagenext = $page + 1;
76if (!$sortorder) {
77 $sortorder = "DESC";
78}
79if (!$sortfield) {
80 $sortfield = "d.lastname";
81}
82
83$label = GETPOST("label", "alpha");
84$morphy = GETPOST("morphy", "alpha");
85$status = GETPOST("status", "intcomma");
86$subscription = GETPOSTINT("subscription");
87$amount = GETPOST('amount', 'alpha');
88$duration_value = GETPOSTINT('duration_value');
89$duration_unit = GETPOST('duration_unit', 'alpha');
90$vote = GETPOSTINT("vote");
91$comment = GETPOST("comment", 'restricthtml');
92$mail_valid = GETPOST("mail_valid", 'restricthtml');
93$caneditamount = GETPOSTINT("caneditamount");
94
95// Initialize a technical objects
96$object = new AdherentType($db);
97$extrafields = new ExtraFields($db);
98$hookmanager->initHooks(array('membertypecard', 'globalcard'));
99
100// Fetch optionals attributes and labels
101$extrafields->fetch_name_optionals_label($object->table_element);
102
103// Security check
104$result = restrictedArea($user, 'adherent', $rowid, 'adherent_type');
105
106
107/*
108 * Actions
109 */
110
111if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
112 $search_ref = "";
113 $search_lastname = "";
114 $search_login = "";
115 $search_email = "";
116 $type = "";
117 $sall = "";
118}
119
120if (GETPOST('cancel', 'alpha')) {
121 $action = 'list';
122 $massaction = '';
123}
124if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
125 $massaction = '';
126}
127
128if ($cancel) {
129 $action = '';
130
131 if (!empty($backtopage)) {
132 header("Location: ".$backtopage);
133 exit;
134 }
135}
136
137if ($action == 'add' && $user->hasRight('adherent', 'configurer')) {
138 $object->label = trim($label);
139 $object->morphy = trim($morphy);
140 $object->status = (int) $status;
141 $object->subscription = (int) $subscription;
142 $object->amount = ($amount == '' ? '' : price2num($amount, 'MT'));
143 $object->caneditamount = $caneditamount;
144 $object->duration_value = $duration_value;
145 $object->duration_unit = $duration_unit;
146 $object->note_public = trim($comment);
147 $object->note_private = '';
148 $object->mail_valid = trim($mail_valid);
149 $object->vote = $vote; // $vote is already int
150
151 // Fill array 'array_options' with data from add form
152 $ret = $extrafields->setOptionalsFromPost(null, $object);
153 if ($ret < 0) {
154 $error++;
155 }
156
157 if (empty($object->label)) {
158 $error++;
159 setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Label")), null, 'errors');
160 } else {
161 $sql = "SELECT libelle FROM ".MAIN_DB_PREFIX."adherent_type WHERE libelle = '".$db->escape($object->label)."'";
162 $sql .= " WHERE entity IN (".getEntity('member_type').")";
163 $result = $db->query($sql);
164 $num = null;
165 if ($result) {
166 $num = $db->num_rows($result);
167 }
168 if ($num) {
169 $error++;
170 $langs->load("errors");
171 setEventMessages($langs->trans("ErrorLabelAlreadyExists", $login), null, 'errors');
172 }
173 }
174
175 if (!$error) {
176 $id = $object->create($user);
177 if ($id > 0) {
178 $backurlforlist = $_SERVER["PHP_SELF"];
179
180 $urltogo = $backtopage ? str_replace('__ID__', (string) $id, $backtopage) : $backurlforlist;
181 $urltogo = preg_replace('/--IDFORBACKTOPAGE--/', (string) $object->id, $urltogo); // New method to autoselect field created after a New on another form object creation
182
183 header("Location: " . $urltogo);
184 exit;
185 } else {
186 setEventMessages($object->error, $object->errors, 'errors');
187 $action = 'create';
188 }
189 } else {
190 $action = 'create';
191 }
192}
193
194if ($action == 'update' && $user->hasRight('adherent', 'configurer')) {
195 $object->fetch($rowid);
196
197 $object->oldcopy = dol_clone($object, 2);
198
199 $object->label = trim($label);
200 $object->morphy = trim($morphy);
201 $object->status = (int) $status;
202 $object->subscription = (int) $subscription;
203 $object->amount = ($amount == '' ? '' : price2num($amount, 'MT'));
204 $object->caneditamount = $caneditamount;
205 $object->duration_value = $duration_value;
206 $object->duration_unit = $duration_unit;
207 $object->note_public = trim($comment);
208 $object->note_private = '';
209 $object->mail_valid = trim($mail_valid);
210 $object->vote = $vote; // $vote is already int.
211
212 // Fill array 'array_options' with data from add form
213 $ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
214 if ($ret < 0) {
215 $error++;
216 }
217
218 $ret = $object->update($user);
219
220 if ($ret >= 0 && !count($object->errors)) {
221 setEventMessages($langs->trans("MemberTypeModified"), null, 'mesgs');
222 } else {
223 setEventMessages($object->error, $object->errors, 'errors');
224 }
225
226 header("Location: ".$_SERVER["PHP_SELF"]."?rowid=".$object->id);
227 exit;
228}
229
230if ($action == 'confirm_delete' && $user->hasRight('adherent', 'configurer')) {
231 $object->fetch($rowid);
232 $res = $object->delete($user);
233
234 if ($res > 0) {
235 setEventMessages($langs->trans("MemberTypeDeleted"), null, 'mesgs');
236 header("Location: ".$_SERVER["PHP_SELF"]);
237 exit;
238 } else {
239 setEventMessages($langs->trans("MemberTypeCanNotBeDeleted"), null, 'errors');
240 $action = '';
241 }
242}
243
244
245/*
246 * View
247 */
248
249$form = new Form($db);
250$formproduct = new FormProduct($db);
251
252$title = $langs->trans("MembersTypeSetup");
253$help_url = 'EN:Module_Foundations|FR:Module_Adh&eacute;rents|ES:M&oacute;dulo_Miembros|DE:Modul_Mitglieder';
254
255llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-member page-type');
256
257$arrayofselected = is_array($toselect) ? $toselect : array();
258
259// List of members type
260if (!$rowid && $action != 'create' && $action != 'edit') {
261 //print dol_get_fiche_head('');
262
263 $sql = "SELECT d.rowid, d.libelle as label, d.subscription, d.amount, d.caneditamount, d.vote, d.statut as status, d.morphy, d.duration";
264 $sql .= " FROM ".MAIN_DB_PREFIX."adherent_type as d";
265 $sql .= " WHERE d.entity IN (".getEntity('member_type').")";
266
267 $result = $db->query($sql);
268 if ($result) {
269 $num = $db->num_rows($result);
270 $nbtotalofrecords = $num;
271
272 $i = 0;
273
274 $param = '';
275 if (!empty($mode)) {
276 $param .= '&mode='.urlencode($mode);
277 }
278 if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
279 $param .= '&contextpage='.$contextpage;
280 }
281 if ($limit > 0 && $limit != $conf->liste_limit) {
282 $param .= '&limit='.$limit;
283 }
284
285 $newcardbutton = '';
286
287 $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'));
288 $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'));
289
290 if ($user->hasRight('adherent', 'configurer')) {
291 $newcardbutton .= dolGetButtonTitleSeparator();
292 $newcardbutton .= dolGetButtonTitle($langs->trans('NewMemberType'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/adherents/type.php?action=create');
293 }
294
295 print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
296 if ($optioncss != '') {
297 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
298 }
299 print '<input type="hidden" name="token" value="'.newToken().'">';
300 print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
301 print '<input type="hidden" name="action" value="list">';
302 print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
303 print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
304 print '<input type="hidden" name="mode" value="'.$mode.'">';
305
306
307 print_barre_liste($langs->trans("MembersTypes"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'members', 0, $newcardbutton, '', $limit, 0, 0, 1);
308
309 $moreforfilter = '';
310
311 print '<div class="div-table-responsive">';
312 print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
313
314 print '<tr class="liste_titre">';
315 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
316 print '<th>&nbsp;</th>';
317 }
318 print '<th>'.$langs->trans("Ref").'</th>';
319 print '<th>'.$langs->trans("Label").'</th>';
320 print '<th class="center">'.$langs->trans("MembersNature").'</th>';
321 print '<th class="center">'.$langs->trans("MembershipDuration").'</th>';
322 print '<th class="center">'.$langs->trans("SubscriptionRequired").'</th>';
323 print '<th class="center">'.$langs->trans("Amount").'</th>';
324 print '<th class="center">'.$langs->trans("CanEditAmountShort").'</th>';
325 print '<th class="center">'.$langs->trans("VoteAllowed").'</th>';
326 print '<th class="center">'.$langs->trans("Status").'</th>';
327 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
328 print '<th>&nbsp;</th>';
329 }
330 print "</tr>\n";
331
332 $membertype = new AdherentType($db);
333
334 $i = 0;
335 $savnbfield = 9;
336 /*$savnbfield = $totalarray['nbfield'];
337 $totalarray = array();
338 $totalarray['nbfield'] = 0;*/
339
340 $imaxinloop = ($limit ? min($num, $limit) : $num);
341 while ($i < $imaxinloop) {
342 $objp = $db->fetch_object($result);
343
344 $membertype->id = $objp->rowid;
345 $membertype->ref = $objp->rowid;
346 $membertype->label = $objp->rowid;
347 $membertype->status = $objp->status;
348 $membertype->subscription = $objp->subscription;
349 $membertype->amount = $objp->amount;
350 $membertype->caneditamount = $objp->caneditamount;
351
352 if ($mode == 'kanban') {
353 if ($i == 0) {
354 print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
355 print '<div class="box-flex-container kanban">';
356 }
357 //output kanban
358 $membertype->label = $objp->label;
359 print $membertype->getKanbanView('', array('selected' => in_array($object->id, $arrayofselected)));
360 if ($i == ($imaxinloop - 1)) {
361 print '</div>';
362 print '</td></tr>';
363 }
364 } else {
365 print '<tr class="oddeven">';
366
367 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
368 if ($user->hasRight('adherent', 'configurer')) {
369 print '<td class="center"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit&rowid='.$objp->rowid.'">'.img_edit().'</a></td>';
370 }
371 }
372
373 print '<td class="nowraponall">';
374 print $membertype->getNomUrl(1);
375 //<a href="'.$_SERVER["PHP_SELF"].'?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowType"),'group').' '.$objp->rowid.'</a>
376 print '</td>';
377
378 print '<td>'.dol_escape_htmltag($objp->label).'</td>';
379
380 print '<td class="center">';
381 if ($objp->morphy == 'phy') {
382 print $langs->trans("Physical");
383 } elseif ($objp->morphy == 'mor') {
384 print $langs->trans("Moral");
385 } else {
386 print $langs->trans("MorAndPhy");
387 }
388 print '</td>';
389
390 print '<td class="center nowrap">';
391 if ($objp->duration) {
392 $duration_value = intval($objp->duration);
393 if ($duration_value > 1) {
394 $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"));
395 } else {
396 $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"));
397 }
398 $unit = preg_replace("/[^a-zA-Z]+/", "", $objp->duration);
399 print max(1, $duration_value).' '.$dur[$unit];
400 }
401 print '</td>';
402
403 print '<td class="center">'.yn($objp->subscription).'</td>';
404
405 print '<td class="center"><span class="amount">'.(is_null($objp->amount) || $objp->amount === '' ? '' : price($objp->amount)).'</span></td>';
406
407 print '<td class="center">'.yn($objp->caneditamount).'</td>';
408
409 print '<td class="center">'.yn($objp->vote).'</td>';
410
411 print '<td class="center">'.$membertype->getLibStatut(5).'</td>';
412
413 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
414 if ($user->hasRight('adherent', 'configurer')) {
415 print '<td class="right"><a class="editfielda" href="'.$_SERVER["PHP_SELF"].'?action=edit&rowid='.$objp->rowid.'">'.img_edit().'</a></td>';
416 }
417 }
418 print "</tr>";
419 }
420 $i++;
421 }
422
423 // If no record found
424 if ($num == 0) {
425 /*$colspan = 1;
426 foreach ($arrayfields as $key => $val) {
427 if (!empty($val['checked'])) {
428 $colspan++;
429 }
430 }*/
431 $colspan = 9;
432 print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
433 }
434
435 print "</table>";
436 print '</div>';
437
438 print '</form>';
439 } else {
440 dol_print_error($db);
441 }
442}
443
444// Creation
445if ($action == 'create') {
446 $object = new AdherentType($db);
447
448 print load_fiche_titre($langs->trans("NewMemberType"), '', 'members');
449
450 print '<form action="'.$_SERVER['PHP_SELF'].'" method="POST">';
451 print '<input type="hidden" name="token" value="'.newToken().'">';
452 print '<input type="hidden" name="action" value="add">';
453 print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
454
455 print dol_get_fiche_head('');
456
457 print '<table class="border centpercent">';
458 print '<tbody>';
459
460 print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Label").'</td><td><input type="text" class="minwidth200" name="label" autofocus="autofocus"></td></tr>';
461
462 print '<tr><td>'.$langs->trans("Status").'</td><td>';
463 print $form->selectarray('status', array('0' => $langs->trans('ActivityCeased'), '1' => $langs->trans('InActivity')), 1, 0, 0, 0, '', 0, 0, 0, '', 'minwidth100');
464 print '</td></tr>';
465
466 // Morphy
467 $morphys = array();
468 $morphys[""] = $langs->trans("MorAndPhy");
469 $morphys["phy"] = $langs->trans("Physical");
470 $morphys["mor"] = $langs->trans("Moral");
471 print '<tr><td><span>'.$langs->trans("MembersNature").'</span></td><td>';
472 print $form->selectarray("morphy", $morphys, GETPOSTISSET("morphy") ? GETPOST("morphy", 'aZ09') : 'morphy');
473 print "</td></tr>";
474
475 print '<tr><td>'.$form->textwithpicto($langs->trans("SubscriptionRequired"), $langs->trans("SubscriptionRequiredDesc")).'</td><td>';
476 print $form->selectyesno("subscription", 1, 1);
477 print '</td></tr>';
478
479 print '<tr><td>'.$langs->trans("Amount").'</td><td>';
480 print '<input name="amount" size="5" value="'.(GETPOSTISSET('amount') ? GETPOST('amount') : price($amount)).'">';
481 print '</td></tr>';
482
483 print '<tr><td>'.$form->textwithpicto($langs->trans("CanEditAmountShort"), $langs->transnoentities("CanEditAmount")).'</td><td>';
484 print $form->selectyesno("caneditamount", GETPOSTISSET('caneditamount') ? GETPOST('caneditamount') : 0, 1);
485 print '</td></tr>';
486
487 print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>';
488 print $form->selectyesno("vote", GETPOSTISSET("vote") ? GETPOST('vote', 'aZ09') : 1, 1);
489 print '</td></tr>';
490
491 print '<tr><td>'.$langs->trans("Duration").'</td><td colspan="3">';
492 print '<input name="duration_value" size="5" value="'.GETPOST('duraction_unit', 'aZ09').'"> ';
493 print $formproduct->selectMeasuringUnits("duration_unit", "time", GETPOSTISSET("duration_unit") ? GETPOST('duration_unit', 'aZ09') : 'y', 0, 1);
494 print '</td></tr>';
495
496 print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
497 require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
498 $doleditor = new DolEditor('comment', (GETPOSTISSET('comment') ? GETPOST('comment', 'restricthtml') : $object->note_public), '', 200, 'dolibarr_notes', '', false, true, isModEnabled('fckeditor'), 15, '90%');
499 $doleditor->Create();
500
501 print '<tr><td class="tdtop">'.$langs->trans("WelcomeEMail").'</td><td>';
502 require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
503 $doleditor = new DolEditor('mail_valid', GETPOSTISSET('mail_valid') ? GETPOST('mail_valid') : $object->mail_valid, '', 250, 'dolibarr_notes', '', false, true, isModEnabled('fckeditor'), 15, '90%');
504 $doleditor->Create();
505 print '</td></tr>';
506
507 // Other attributes
508 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
509
510 print '<tbody>';
511 print "</table>\n";
512
513 print dol_get_fiche_end();
514
515 print $form->buttonsSaveCancel();
516
517 print "</form>\n";
518}
519
520// View
521if ($rowid > 0) {
522 if ($action != 'edit') {
523 $object = new AdherentType($db);
524 $object->fetch($rowid);
525 $object->fetch_optionals();
526
527 /*
528 * Confirmation deletion
529 */
530 if ($action == 'delete') {
531 print $form->formconfirm($_SERVER['PHP_SELF']."?rowid=".$object->id, $langs->trans("DeleteAMemberType"), $langs->trans("ConfirmDeleteMemberType", $object->label), "confirm_delete", '', 0, 1);
532 }
533
534 $head = member_type_prepare_head($object);
535
536 print dol_get_fiche_head($head, 'card', $langs->trans("MemberType"), -1, 'group');
537
538 $linkback = '<a href="'.DOL_URL_ROOT.'/adherents/type.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
539
540 dol_banner_tab($object, 'rowid', $linkback);
541
542 print '<div class="fichecenter">';
543 print '<div class="underbanner clearboth"></div>';
544
545 print '<table class="tableforfield border centpercent">';
546
547 // Morphy
548 print '<tr><td>'.$langs->trans("MembersNature").'</td><td class="valeur" >'.$object->getmorphylib($object->morphy).'</td>';
549 print '</tr>';
550
551 print '<tr><td>'.$form->textwithpicto($langs->trans("SubscriptionRequired"), $langs->trans("SubscriptionRequiredDesc")).'</td><td>';
552 print yn($object->subscription);
553 print '</tr>';
554
555 // Amount
556 print '<tr><td class="titlefield">'.$langs->trans("Amount").'</td><td>';
557 print((is_null($object->amount) || $object->amount === '') ? '' : '<span class="amount">'.price($object->amount).'</span>');
558 print '</tr>';
559
560 print '<tr><td>'.$form->textwithpicto($langs->trans("CanEditAmountShort"), $langs->transnoentities("CanEditAmount")).'</td><td>';
561 print yn($object->caneditamount);
562 print '</td></tr>';
563
564 print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>';
565 print yn($object->vote);
566 print '</tr>';
567
568 print '<tr><td class="titlefield">'.$langs->trans("Duration").'</td><td colspan="2">'.$object->duration_value.'&nbsp;';
569 if ($object->duration_value > 1) {
570 $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"));
571 } elseif ($object->duration_value > 0) {
572 $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"));
573 }
574 print(!empty($object->duration_unit) && isset($dur[$object->duration_unit]) ? $langs->trans($dur[$object->duration_unit]) : '')."&nbsp;";
575 print '</td></tr>';
576
577 print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
579 print "</td></tr>";
580
581 print '<tr><td class="tdtop">'.$langs->trans("WelcomeEMail").'</td><td>';
583 print "</td></tr>";
584
585 // Other attributes
586 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
587
588 print '</table>';
589 print '</div>';
590
591 print dol_get_fiche_end();
592
593
594 /*
595 * Buttons
596 */
597
598 print '<div class="tabsAction">';
599
600 // Edit
601 if ($user->hasRight('adherent', 'configurer')) {
602 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>';
603 }
604
605 // Add
606 if ($object->morphy == 'phy') {
607 $morphy = 'phy';
608 } elseif ($object->morphy == 'mor') {
609 $morphy = 'mor';
610 } else {
611 $morphy = '';
612 }
613
614 if ($user->hasRight('adherent', 'configurer') && !empty($object->status)) {
615 print '<div class="inline-block divButAction"><a class="butAction" href="card.php?action=create&token='.newToken().'&typeid='.$object->id.($morphy ? '&morphy='.urlencode($morphy) : '').'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?rowid='.$object->id).'">'.$langs->trans("AddMember").'</a></div>';
616 } else {
617 print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NoAddMember")).'">'.$langs->trans("AddMember").'</a></div>';
618 }
619
620 // Delete
621 if ($user->hasRight('adherent', 'configurer')) {
622 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>';
623 }
624
625 print "</div>";
626
627
628 // Show list of members (nearly same code than in page list.php)
629
630 $membertypestatic = new AdherentType($db);
631
632 $now = dol_now();
633
634 $sql = "SELECT d.rowid, d.ref, d.entity, d.login, d.firstname, d.lastname, d.societe as company, d.fk_soc,";
635 $sql .= " d.datefin,";
636 $sql .= " d.email, d.photo, d.fk_adherent_type as type_id, d.morphy, d.statut as status,";
637 $sql .= " t.libelle as type, t.subscription, t.amount";
638
639 $sqlfields = $sql; // $sql fields to remove for count total
640
641 $sql .= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t";
642 $sql .= " WHERE d.fk_adherent_type = t.rowid ";
643 $sql .= " AND d.entity IN (".getEntity('adherent').")";
644 $sql .= " AND t.rowid = ".((int) $object->id);
645 if ($sall) {
646 $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);
647 }
648 if ($status != '') {
649 $sql .= natural_search('d.statut', $status, 2);
650 }
651 if ($action == 'search') {
652 if (GETPOST('search', 'alpha')) {
653 $sql .= natural_search(array("d.firstname", "d.lastname"), GETPOST('search', 'alpha'));
654 }
655 }
656 if (!empty($search_ref)) {
657 $sql .= natural_search("d.ref", $search_ref);
658 }
659 if (!empty($search_lastname)) {
660 $sql .= natural_search(array("d.firstname", "d.lastname"), $search_lastname);
661 }
662 if (!empty($search_login)) {
663 $sql .= natural_search("d.login", $search_login);
664 }
665 if (!empty($search_email)) {
666 $sql .= natural_search("d.email", $search_email);
667 }
668 if ($filter == 'uptodate') {
669 $sql .= " AND (datefin >= '".$db->idate($now)."') OR t.subscription = 0)";
670 }
671 if ($filter == 'outofdate') {
672 $sql .= " AND (datefin < '".$db->idate($now)."' AND t.subscription = 1)";
673 }
674
675 // Count total nb of records
676 $nbtotalofrecords = '';
677 if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
678 /* The fast and low memory method to get and count full list converts the sql into a sql count */
679 $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
680 $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
681 $resql = $db->query($sqlforcount);
682 if ($resql) {
683 $objforcount = $db->fetch_object($resql);
684 $nbtotalofrecords = $objforcount->nbtotalofrecords;
685 } else {
686 dol_print_error($db);
687 }
688
689 if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
690 $page = 0;
691 $offset = 0;
692 }
693 $db->free($resql);
694 }
695
696 // Complete request and execute it with limit
697 $sql .= $db->order($sortfield, $sortorder);
698 if ($limit) {
699 $sql .= $db->plimit($limit + 1, $offset);
700 }
701
702 $resql = $db->query($sql);
703 if ($resql) {
704 $num = $db->num_rows($resql);
705 $i = 0;
706
707 $titre = $langs->trans("MembersList");
708 if ($status != '') {
709 if ($status == '-1,1') {
710 $titre = $langs->trans("MembersListQualified");
711 } elseif ($status == '-1') {
712 $titre = $langs->trans("MembersListToValid");
713 } elseif ($status == '1' && !$filter) {
714 $titre = $langs->trans("MembersListValid");
715 } elseif ($status == '1' && $filter == 'uptodate') {
716 $titre = $langs->trans("MembersListUpToDate");
717 } elseif ($status == '1' && $filter == 'outofdate') {
718 $titre = $langs->trans("MembersListNotUpToDate");
719 } elseif ($status == '0') {
720 $titre = $langs->trans("MembersListResiliated");
721 } elseif ($status == '-2') {
722 $titre = $langs->trans("MembersListExcluded");
723 }
724 } elseif ($action == 'search') {
725 $titre = $langs->trans("MembersListQualified");
726 }
727
728 if ($type > 0) {
729 $membertype = new AdherentType($db);
730 $result = $membertype->fetch($type);
731 $titre .= " (".$membertype->label.")";
732 }
733
734 $param = "&rowid=".urlencode((string) ($object->id));
735 if (!empty($mode)) {
736 $param .= '&mode='.urlencode($mode);
737 }
738 if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
739 $param .= '&contextpage='.urlencode($contextpage);
740 }
741 if ($limit > 0 && $limit != $conf->liste_limit) {
742 $param .= '&limit='.((int) $limit);
743 }
744 if (!empty($status)) {
745 $param .= "&status=".urlencode($status);
746 }
747 if (!empty($search_ref)) {
748 $param .= "&search_ref=".urlencode($search_ref);
749 }
750 if (!empty($search_lastname)) {
751 $param .= "&search_lastname=".urlencode($search_lastname);
752 }
753 if (!empty($search_firstname)) {
754 $param .= "&search_firstname=".urlencode($search_firstname);
755 }
756 if (!empty($search_login)) {
757 $param .= "&search_login=".urlencode($search_login);
758 }
759 if (!empty($search_email)) {
760 $param .= "&search_email=".urlencode($search_email);
761 }
762 if (!empty($filter)) {
763 $param .= "&filter=".urlencode($filter);
764 }
765
766 if ($sall) {
767 print $langs->trans("Filter")." (".$langs->trans("Lastname").", ".$langs->trans("Firstname").", ".$langs->trans("EMail").", ".$langs->trans("Address")." ".$langs->trans("or")." ".$langs->trans("Town")."): ".$sall;
768 }
769
770 print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'" name="formfilter" autocomplete="off">';
771 print '<input type="hidden" name="token" value="'.newToken().'">';
772 print '<input class="flat" type="hidden" name="rowid" value="'.$object->id.'"></td>';
773
774 print_barre_liste('', $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'generic', 0, '', '', $limit);
775
776 $moreforfilter = '';
777
778 print '<div class="div-table-responsive">';
779 print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
780
781 // Fields title search
782 print '<tr class="liste_titre_filter">';
783
784 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
785 print '<td class="liste_titre center maxwidthsearch">';
786 $searchpicto = $form->showFilterButtons('left');
787 print $searchpicto;
788 print '</td>';
789 }
790
791 print '<td class="liste_titre left">';
792 print '<input class="flat maxwidth100" type="text" name="search_ref" value="'.dol_escape_htmltag($search_ref).'"></td>';
793
794 print '<td class="liste_titre left">';
795 print '<input class="flat maxwidth100" type="text" name="search_lastname" value="'.dol_escape_htmltag($search_lastname).'"></td>';
796
797 print '<td class="liste_titre left">';
798 print '<input class="flat maxwidth100" type="text" name="search_login" value="'.dol_escape_htmltag($search_login).'"></td>';
799
800 print '<td class="liste_titre">&nbsp;</td>';
801
802 print '<td class="liste_titre left">';
803 print '<input class="flat maxwidth100" type="text" name="search_email" value="'.dol_escape_htmltag($search_email).'"></td>';
804
805 print '<td class="liste_titre">&nbsp;</td>';
806
807 print '<td class="liste_titre">&nbsp;</td>';
808
809 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
810 print '<td class="liste_titre center nowraponall">';
811 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")).'">';
812 print '&nbsp; ';
813 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")).'">';
814 print '</td>';
815 }
816
817 print "</tr>\n";
818
819 print '<tr class="liste_titre">';
820 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
821 print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder);
822 }
823 print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "d.ref", $param, "", "", $sortfield, $sortorder);
824 print_liste_field_titre("NameSlashCompany", $_SERVER["PHP_SELF"], "d.lastname", $param, "", "", $sortfield, $sortorder);
825 print_liste_field_titre("Login", $_SERVER["PHP_SELF"], "d.login", $param, "", "", $sortfield, $sortorder);
826 print_liste_field_titre("MemberNature", $_SERVER["PHP_SELF"], "d.morphy", $param, "", "", $sortfield, $sortorder);
827 print_liste_field_titre("EMail", $_SERVER["PHP_SELF"], "d.email", $param, "", "", $sortfield, $sortorder);
828 print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "d.statut,d.datefin", $param, "", "", $sortfield, $sortorder);
829 print_liste_field_titre("EndSubscription", $_SERVER["PHP_SELF"], "d.datefin", $param, "", 'align="center"', $sortfield, $sortorder);
830 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
831 print_liste_field_titre("Action", $_SERVER["PHP_SELF"], "", $param, "", 'width="60" align="center"', $sortfield, $sortorder);
832 }
833 print "</tr>\n";
834
835 $adh = new Adherent($db);
836
837 $imaxinloop = ($limit ? min($num, $limit) : $num);
838 while ($i < $imaxinloop) {
839 $objp = $db->fetch_object($resql);
840
841 $datefin = $db->jdate($objp->datefin);
842
843 $adh->id = $objp->rowid;
844 $adh->ref = $objp->ref;
845 $adh->login = $objp->login;
846 $adh->lastname = $objp->lastname;
847 $adh->firstname = $objp->firstname;
848 $adh->datefin = $datefin;
849 $adh->need_subscription = $objp->subscription;
850 $adh->statut = $objp->status;
851 $adh->email = $objp->email;
852 $adh->photo = $objp->photo;
853
854 print '<tr class="oddeven">';
855
856 // Actions
857 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
858 print '<td class="center">';
859 if ($user->hasRight('adherent', 'creer')) {
860 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>';
861 }
862 if ($user->hasRight('adherent', 'supprimer')) {
863 print '<a class="marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=resiliate&token='.newToken().'">'.img_picto($langs->trans("Resiliate"), 'disable.png').'</a>';
864 }
865 print "</td>";
866 }
867
868 // Ref
869 print "<td>";
870 print $adh->getNomUrl(-1, 0, 'card', 'ref', '', -1, 0, 1);
871 print "</td>\n";
872
873 // Lastname
874 if ($objp->company != '') {
875 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";
876 } else {
877 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";
878 }
879
880 // Login
881 print "<td>".dol_escape_htmltag($objp->login)."</td>\n";
882
883 // Type
884 /*print '<td class="nowrap">';
885 $membertypestatic->id=$objp->type_id;
886 $membertypestatic->label=$objp->type;
887 print $membertypestatic->getNomUrl(1,12);
888 print '</td>';
889 */
890
891 // Moral/Physique
892 print "<td>".$adh->getmorphylib($objp->morphy, 1)."</td>\n";
893
894 // EMail
895 print "<td>".dol_print_email($objp->email, 0, 0, 1)."</td>\n";
896
897 // Status
898 print '<td class="nowrap">';
899 print $adh->getLibStatut(2);
900 print "</td>";
901
902 // Date end subscription
903 if ($datefin) {
904 print '<td class="nowrap center">';
905 if ($datefin < dol_now() && $objp->status > 0) {
906 print dol_print_date($datefin, 'day')." ".img_warning($langs->trans("SubscriptionLate"));
907 } else {
908 print dol_print_date($datefin, 'day');
909 }
910 print '</td>';
911 } else {
912 print '<td class="nowrap center">';
913 if (!empty($objp->subscription)) {
914 print '<span class="opacitymedium">'.$langs->trans("SubscriptionNotReceived").'</span>';
915 if ($objp->status > 0) {
916 print " ".img_warning();
917 }
918 } else {
919 print '&nbsp;';
920 }
921 print '</td>';
922 }
923
924 // Actions
925 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
926 print '<td class="center">';
927 if ($user->hasRight('adherent', 'creer')) {
928 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>';
929 }
930 if ($user->hasRight('adherent', 'supprimer')) {
931 print '<a class="marginleftonly" href="card.php?rowid='.$objp->rowid.'&action=resiliate&token='.newToken().'">'.img_picto($langs->trans("Resiliate"), 'disable.png').'</a>';
932 }
933 print "</td>";
934 }
935 print "</tr>\n";
936 $i++;
937 }
938
939 if ($i == 0) {
940 print '<tr><td colspan="9"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
941 }
942
943 print "</table>\n";
944 print '</div>';
945 print '</form>';
946 } else {
947 dol_print_error($db);
948 }
949 }
950
951 /* ************************************************************************** */
952 /* */
953 /* Edition mode */
954 /* */
955 /* ************************************************************************** */
956
957 if ($action == 'edit') {
958 $object = new AdherentType($db);
959 $object->fetch($rowid);
960 $object->fetch_optionals();
961
962 $head = member_type_prepare_head($object);
963
964 print '<form method="post" action="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'">';
965 print '<input type="hidden" name="token" value="'.newToken().'">';
966 print '<input type="hidden" name="rowid" value="'.$object->id.'">';
967 print '<input type="hidden" name="action" value="update">';
968
969 print dol_get_fiche_head($head, 'card', $langs->trans("MemberType"), 0, 'group');
970
971 print '<table class="border centpercent">';
972
973 print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>'.$object->id.'</td></tr>';
974
975 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>';
976
977 print '<tr><td>'.$langs->trans("Status").'</td><td>';
978 print $form->selectarray('status', array('0' => $langs->trans('ActivityCeased'), '1' => $langs->trans('InActivity')), $object->status, 0, 0, 0, '', 0, 0, 0, '', 'minwidth100');
979 print '</td></tr>';
980
981 // Morphy
982 $morphys[""] = $langs->trans("MorAndPhy");
983 $morphys["phy"] = $langs->trans("Physical");
984 $morphys["mor"] = $langs->trans("Moral");
985 print '<tr><td><span>'.$langs->trans("MembersNature").'</span></td><td>';
986 print $form->selectarray("morphy", $morphys, GETPOSTISSET("morphy") ? GETPOST("morphy", 'aZ09') : $object->morphy);
987 print "</td></tr>";
988
989 print '<tr><td>'.$langs->trans("SubscriptionRequired").'</td><td>';
990 print $form->selectyesno("subscription", $object->subscription, 1);
991 print '</td></tr>';
992
993 print '<tr><td>'.$langs->trans("Amount").'</td><td>';
994 print '<input name="amount" size="5" value="';
995 print((is_null($object->amount) || $object->amount === '') ? '' : price($object->amount));
996 print '">';
997 print '</td></tr>';
998
999 print '<tr><td>'.$form->textwithpicto($langs->trans("CanEditAmountShort"), $langs->transnoentities("CanEditAmountDetail")).'</td><td>';
1000 print $form->selectyesno("caneditamount", $object->caneditamount, 1);
1001 print '</td></tr>';
1002
1003 print '<tr><td>'.$langs->trans("VoteAllowed").'</td><td>';
1004 print $form->selectyesno("vote", $object->vote, 1);
1005 print '</td></tr>';
1006
1007 print '<tr><td>'.$langs->trans("Duration").'</td><td colspan="3">';
1008 print '<input name="duration_value" size="5" value="'.$object->duration_value.'"> ';
1009 print $formproduct->selectMeasuringUnits("duration_unit", "time", ($object->duration_unit === '' ? 'y' : $object->duration_unit), 0, 1);
1010 print '</td></tr>';
1011
1012 print '<tr><td class="tdtop">'.$langs->trans("Description").'</td><td>';
1013 require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
1014 $doleditor = new DolEditor('comment', $object->note_public, '', 220, 'dolibarr_notes', '', false, true, isModEnabled('fckeditor'), 15, '90%');
1015 $doleditor->Create();
1016 print "</td></tr>";
1017
1018 print '<tr><td class="tdtop">'.$langs->trans("WelcomeEMail").'</td><td>';
1019 $doleditor = new DolEditor('mail_valid', $object->mail_valid, '', 280, 'dolibarr_notes', '', false, true, isModEnabled('fckeditor'), 15, '90%');
1020 $doleditor->Create();
1021 print "</td></tr>";
1022
1023 // Other attributes
1024 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
1025
1026 print '</table>';
1027
1028 print dol_get_fiche_end();
1029
1030 print $form->buttonsSaveCancel();
1031
1032 print "</form>";
1033 }
1034}
1035
1036// End of page
1037llxFooter();
1038$db->close();
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:58
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:70
Class to manage members of a foundation.
Class to manage members type.
Class to manage a WYSIWYG editor.
Class to manage standard extra fields.
Class to manage generation of HTML components Only common components must be here.
Class with static methods for building HTML components related to products Only components common to ...
llxFooter()
Footer empty.
Definition document.php:107
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
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_get_fiche_end($notab=0)
Return tab footer of a card.
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...
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.
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles=1, $removeclassattribute=1, $cleanalsojavascript=0, $allowiframe=0, $allowed_tags=array(), $allowlink=0)
Clean a string to keep only desirable HTML tags.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_clone($object, $native=0)
Create a clone of instance of object (new instance with same value for each properties) With native =...
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
print_barre_liste($title, $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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.
dol_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
member_type_prepare_head(AdherentType $object)
Return array head with list of tabs to view object information.
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.