dolibarr 21.0.0-beta
card.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
5 * Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
6 * Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro@open-dsi.fr>
7 * Copyright (C) 2018-2019 Thibault FOUCART <support@ptibogxiv.net>
8 * Copyright (C) 2018-2024 Frédéric France <frederic.france@free.fr>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22 */
23
30// Load Dolibarr environment
31require '../main.inc.php';
32require_once DOL_DOCUMENT_ROOT.'/core/modules/dons/modules_don.php';
33require_once DOL_DOCUMENT_ROOT.'/core/lib/donation.lib.php';
34require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
35require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
36require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
37require_once DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php';
38require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
39require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
40require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
41require_once DOL_DOCUMENT_ROOT.'/core/class/html.formmargin.class.php';
42require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
43if (isModEnabled('project')) {
44 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
45 require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
46}
47require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
48
58$langs->loadLangs(array('bills', 'companies', 'donations', 'users'));
59
60$id = GETPOST('rowid') ? GETPOSTINT('rowid') : GETPOSTINT('id');
61$ref = GETPOST('ref', 'alpha');
62$action = GETPOST('action', 'aZ09');
63$cancel = GETPOST('cancel', 'alpha');
64$confirm = GETPOST('confirm', 'alpha');
65$backtopage = GETPOST('backtopage', 'alpha');
66$socid = GETPOSTINT('socid');
67$amount = price2num(GETPOST('amount', 'alphanohtml'), 'MT');
68$donation_date = dol_mktime(12, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'));
69$projectid = (GETPOST('projectid') ? GETPOSTINT('projectid') : 0);
70$public_donation = GETPOSTINT("public");
71
72$object = new Don($db);
73if ($id > 0 || $ref) {
74 $object->fetch($id, $ref);
75}
76
77if (!empty($socid) && $socid > 0) {
78 $soc = new Societe($db);
79 if ($socid > 0) {
80 $soc->fetch($socid);
81 }
82}
83
84$extrafields = new ExtraFields($db);
85
86// fetch optionals attributes and labels
87$extrafields->fetch_name_optionals_label($object->table_element);
88$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
89
90// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
91$hookmanager->initHooks(array($object->element.'card', 'globalcard'));
92
93$upload_dir = $conf->don->dir_output;
94
95
96// Security check
97$result = restrictedArea($user, 'don', $object->id);
98
99$permissiontoread = $user->hasRight('don', 'lire');
100$permissiontoadd = $user->hasRight('don', 'creer');
101$permissiontodelete = $user->hasRight('don', 'supprimer');
102
103
104/*
105 * Actions
106 */
107
108$error = 0;
109
110$parameters = array();
111
112$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some
113if ($reshook < 0) {
114 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
115}
116
117if (empty($reshook)) {
118 $backurlforlist = DOL_URL_ROOT.'/don/list.php';
119
120 if (empty($backtopage) || ($cancel && empty($id))) {
121 if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
122 if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
123 $backtopage = $backurlforlist;
124 } else {
125 $backtopage = DOL_URL_ROOT.'/don/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__');
126 }
127 }
128 }
129
130 if ($cancel) {
131 if (!empty($backtopageforcancel)) {
132 header("Location: ".$backtopageforcancel);
133 exit;
134 } elseif (!empty($backtopage)) {
135 header("Location: ".$backtopage);
136 exit;
137 }
138 $action = '';
139 }
140
141 // Action reopen object
142 if ($action == 'confirm_reopen' && $confirm == 'yes' && $permissiontoadd) {
143 $object->fetch($id);
144
145 $result = $object->reopen($user);
146 if ($result >= 0) {
147 // Define output language
148 if (!getDolGlobalString('MAIN_DISABLE_PDF_AUTOUPDATE')) {
149 if (method_exists($object, 'generateDocument')) {
150 $outputlangs = $langs;
151 $newlang = '';
152 if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang) && GETPOST('lang_id', 'aZ09')) {
153 $newlang = GETPOST('lang_id', 'aZ09');
154 }
155 if (getDolGlobalInt('MAIN_MULTILANGS') && empty($newlang)) {
156 $newlang = $object->thirdparty->default_lang;
157 }
158 if (!empty($newlang)) {
159 $outputlangs = new Translate("", $conf);
160 $outputlangs->setDefaultLang($newlang);
161 }
162 $model = $object->model_pdf;
163 $ret = $object->fetch($id); // Reload to get new records
164
165 $object->generateDocument($model, $outputlangs, $hidedetails, $hidedesc, $hideref);
166 }
167 }
168
169 header("Location: ".$_SERVER["PHP_SELF"].'?id='.$object->id);
170 exit;
171 } else {
172 setEventMessages($object->error, $object->errors, 'errors');
173 $action = 'create';
174 }
175 }
176
177
178 // Action update object
179 if ($action == 'update' && $permissiontoadd) {
180 if (!empty($cancel)) {
181 header("Location: ".$_SERVER['PHP_SELF']."?id=".urlencode((string) ($id)));
182 exit;
183 }
184
185 if (empty($donation_date)) {
186 setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors');
187 $action = "create";
188 $error++;
189 }
190
191 if (empty($amount)) {
192 setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors');
193 $action = "create";
194 $error++;
195 }
196
197 if (!$error) {
198 $object->fetch($id);
199
200 $object->firstname = GETPOST("firstname", 'alpha');
201 $object->lastname = GETPOST("lastname", 'alpha');
202 $object->societe = GETPOST("societe", 'alpha');
203 $object->address = GETPOST("address", 'alpha');
204 $object->amount = GETPOSTFLOAT("amount");
205 $object->town = GETPOST("town", 'alpha');
206 $object->zip = GETPOST("zipcode", 'alpha');
207 $object->country_id = GETPOSTINT('country_id');
208 $object->email = GETPOST("email", 'alpha');
209 $object->date = $donation_date;
210 $object->public = $public_donation;
211 $object->fk_project = GETPOSTINT("fk_project");
212 $object->modepaymentid = GETPOSTINT('modepayment');
213
214 // Fill array 'array_options' with data from add form
215 $ret = $extrafields->setOptionalsFromPost(null, $object, '@GETPOSTISSET');
216 if ($ret < 0) {
217 $error++;
218 }
219
220 if ($object->update($user) > 0) {
221 header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
222 exit;
223 } else {
224 setEventMessages($object->error, $object->errors, 'errors');
225 $action = "create";
226 }
227 }
228 }
229
230
231 // Action add/create object
232 if ($action == 'add' && $permissiontoadd) {
233 if (!empty($cancel)) {
234 header("Location: index.php");
235 exit;
236 }
237
238 if (isModEnabled("societe") && getDolGlobalString('DONATION_USE_THIRDPARTIES') && !(GETPOSTINT("socid") > 0)) {
239 setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("ThirdParty")), null, 'errors');
240 $action = "create";
241 $error++;
242 }
243 if (empty($donation_date)) {
244 setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Date")), null, 'errors');
245 $action = "create";
246 $error++;
247 }
248
249 if (empty($amount)) {
250 setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Amount")), null, 'errors');
251 $action = "create";
252 $error++;
253 }
254
255 if (!$error) {
256 $object->socid = GETPOSTINT("socid");
257 $object->firstname = (string) GETPOST("firstname", 'alpha');
258 $object->lastname = (string) GETPOST("lastname", 'alpha');
259 $object->societe = (string) GETPOST("societe", 'alpha');
260 $object->address = (string) GETPOST("address", 'alpha');
261 $object->amount = price2num(GETPOST("amount", 'alpha'), '', 2);
262 $object->zip = (string) GETPOST("zipcode", 'alpha');
263 $object->town = (string) GETPOST("town", 'alpha');
264 $object->country_id = GETPOSTINT('country_id');
265 $object->email = (string) GETPOST('email', 'alpha');
266 $object->date = $donation_date;
267 $object->note_private = (string) GETPOST("note_private", 'restricthtml');
268 $object->note_public = (string) GETPOST("note_public", 'restricthtml');
269 $object->public = $public_donation;
270 $object->fk_project = GETPOSTINT("fk_project");
271 $object->modepaymentid = GETPOSTINT('modepayment');
272
273 // Fill array 'array_options' with data from add form
274 $ret = $extrafields->setOptionalsFromPost(null, $object);
275 if ($ret < 0) {
276 $error++;
277 }
278
279 $res = $object->create($user);
280 if ($res > 0) {
281 header("Location: ".$_SERVER['PHP_SELF'].'?id='.$res);
282 exit;
283 } else {
284 setEventMessages($object->error, $object->errors, 'errors');
285 $action = "create";
286 }
287 }
288 }
289
290 // Action delete object
291 if ($action == 'confirm_delete' && GETPOST("confirm") == "yes" && $permissiontodelete) {
292 $object->fetch($id);
293 $result = $object->delete($user);
294 if ($result > 0) {
295 header("Location: index.php");
296 exit;
297 } else {
298 dol_syslog($object->error, LOG_DEBUG);
299 setEventMessages($object->error, $object->errors, 'errors');
300 }
301 }
302
303 // Action validation
304 if ($action == 'valid_promesse' && $permissiontoadd) {
305 $object->fetch($id);
306 // @phan-suppress-next-line PhanPluginSuspiciousParamPosition
307 if ($object->valid_promesse($id, $user->id) >= 0) {
308 setEventMessages($langs->trans("DonationValidated", $object->ref), null);
309 $action = '';
310 } else {
311 setEventMessages($object->error, $object->errors, 'errors');
312 }
313 }
314
315 // Action cancel
316 if ($action == 'set_cancel' && $permissiontoadd) {
317 $object->fetch($id);
318 if ($object->set_cancel($id) >= 0) {
319 $action = '';
320 } else {
321 setEventMessages($object->error, $object->errors, 'errors');
322 }
323 }
324
325 // Action set paid
326 if ($action == 'set_paid' && $permissiontoadd) {
327 $modepayment = GETPOSTINT('modepayment');
328
329 $object->fetch($id);
330 if ($object->setPaid($id, $modepayment) >= 0) {
331 $action = '';
332 } else {
333 setEventMessages($object->error, $object->errors, 'errors');
334 }
335 } elseif ($action == 'classin' && $user->hasRight('don', 'creer')) {
336 $object->fetch($id);
337 $object->setProject($projectid);
338 }
339
340 if ($action == 'update_extras' && $permissiontoadd) {
341 $object->fetch($id);
342
343 $object->oldcopy = dol_clone($object, 2);
344
345 // Fill array 'array_options' with data from update form
346 $ret = $extrafields->setOptionalsFromPost(null, $object, GETPOST('attribute', 'restricthtml'));
347
348 if ($ret < 0) {
349 $error++;
350 }
351
352 if (!$error) {
353 $result = $object->insertExtraFields('DON_MODIFY');
354 if ($result < 0) {
355 setEventMessages($object->error, $object->errors, 'errors');
356 $error++;
357 }
358 }
359
360 if ($error) {
361 $action = 'edit_extras';
362 }
363 }
364
365 // Actions to build doc
366 include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
367}
368
369
370/*
371 * View
372 */
373
374$bankaccountstatic = new Account($db);
375
376$title = $langs->trans("Donation");
377
378$help_url = 'EN:Module_Donations|FR:Module_Dons|ES:M&oacute;dulo_Donaciones|DE:Modul_Spenden';
379
380llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-donation page-card');
381
382$form = new Form($db);
383$formfile = new FormFile($db);
384$formcompany = new FormCompany($db);
385if (isModEnabled('project')) {
386 $formproject = new FormProjets($db);
387}
388
389if ($action == 'create') {
390 print load_fiche_titre($langs->trans("AddDonation"), '', 'object_donation');
391
392 print '<form name="add" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
393 print '<input type="hidden" name="token" value="'.newToken().'">';
394 print '<input type="hidden" name="action" value="add">';
395 print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
396
397 print dol_get_fiche_head([]);
398
399 print '<table class="border centpercent">';
400 print '<tbody>';
401
402 // Ref
403 print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans('Ref').'</td><td>'.$langs->trans('Draft').'</td></tr>';
404
405 // Company
406 if (isModEnabled("societe") && getDolGlobalString('DONATION_USE_THIRDPARTIES')) {
407 // Thirdparty
408 if ($soc->id > 0) {
409 print '<td class="fieldrequired">'.$langs->trans('ThirdParty').'</td>';
410 print '<td>';
411 print $soc->getNomUrl(1);
412 print '<input type="hidden" name="socid" value="'.$soc->id.'">';
413 // Outstanding Bill
414 $arrayoutstandingbills = $soc->getOutstandingBills();
415 $outstandingBills = $arrayoutstandingbills['opened'];
416 print ' ('.$langs->trans('CurrentOutstandingBill').': ';
417 print price($outstandingBills, 0, $langs, 0, 0, -1, $conf->currency);
418 if ($soc->outstanding_limit != '') {
419 if ($outstandingBills > $soc->outstanding_limit) {
420 print img_warning($langs->trans("OutstandingBillReached"));
421 }
422 print ' / '.price($soc->outstanding_limit, 0, $langs, 0, 0, -1, $conf->currency);
423 }
424 print ')';
425 print '</td>';
426 } else {
427 print '<td class="fieldrequired">'.$langs->trans('ThirdParty').'</td>';
428 print '<td>';
429 $filter = '((s.client:IN:1,2,3) AND (status:=:1))';
430 print $form->select_company($soc->id, 'socid', $filter, 'SelectThirdParty', 0, 0, null, 0, 'minwidth300');
431 // Option to reload page to retrieve customer information. Note, this clear other input
432 if (getDolGlobalString('RELOAD_PAGE_ON_CUSTOMER_CHANGE_DISABLED')) {
433 print '<script type="text/javascript">
434 $(document).ready(function() {
435 $("#socid").change(function() {
436 console.log("We have changed the company - Reload page");
437 var socid = $(this).val();
438 var fac_rec = $(\'#fac_rec\').val();
439 // reload page
440 $("input[name=action]").val("create");
441 $("form[name=add]").submit();
442 });
443 });
444 </script>';
445 }
446 print ' <a href="'.DOL_URL_ROOT.'/societe/card.php?action=create&client=3&fournisseur=0&backtopage='.urlencode($_SERVER["PHP_SELF"].'?action=create').'"><span class="fa fa-plus-circle valignmiddle paddingleft" title="'.$langs->trans("AddThirdParty").'"></span></a>';
447 print '</td>';
448 }
449 print '</tr>'."\n";
450 }
451
452 // Date
453 print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("Date").'</td><td>';
454 print $form->selectDate($donation_date ? $donation_date : -1, '', 0, 0, 0, "add", 1, 1);
455 print '</td>';
456
457 // Amount
458 print "<tr>".'<td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="amount" value="'.dol_escape_htmltag(GETPOST("amount")).'" size="10"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
459
460 // Public donation
461 print '<tr><td class="fieldrequired">'.$langs->trans("PublicDonation")."</td><td>";
462 print $form->selectyesno("public", $public_donation, 1);
463 print "</td></tr>\n";
464
465 if (!isModEnabled('societe') || !getDolGlobalString('DONATION_USE_THIRDPARTIES')) {
466 print "<tr>".'<td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" value="'.dol_escape_htmltag(GETPOST("societe")).'" class="maxwidth200"></td></tr>';
467 print "<tr>".'<td>'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" value="'.dol_escape_htmltag(GETPOST("lastname")).'" class="maxwidth200"></td></tr>';
468 print "<tr>".'<td>'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" value="'.dol_escape_htmltag(GETPOST("firstname")).'" class="maxwidth200"></td></tr>';
469 print "<tr>".'<td>'.$langs->trans("Address").'</td><td>';
470 print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="3">'.dol_escape_htmltag(GETPOST("address", "alphanohtml"), 0, 1).'</textarea></td></tr>';
471
472 // Zip / Town
473 print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>';
474 print $formcompany->select_ziptown((GETPOSTISSET("zipcode") ? GETPOST("zipcode") : $object->zip), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6);
475 print ' ';
476 print $formcompany->select_ziptown((GETPOSTISSET("town") ? GETPOST("town") : $object->town), 'town', array('zipcode', 'selectcountry_id', 'state_id'));
477 print '</tr>';
478
479 // Country
480 print '<tr><td><label for="selectcountry_id">'.$langs->trans('Country').'</label></td><td class="maxwidthonsmartphone">';
481 print img_picto('', 'globe-americas', 'class="paddingrightonly"').$form->select_country(GETPOST('country_id') != '' ? GETPOST('country_id') : $object->country_id);
482 if ($user->admin) {
483 print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
484 }
485 print '</td></tr>';
486
487 print "<tr>".'<td>'.$langs->trans("EMail").'</td><td>'.img_picto('', 'object_email', 'class="paddingrightonly"').'<input type="text" name="email" value="'.dol_escape_htmltag(GETPOST("email")).'" class="maxwidth200"></td></tr>';
488 }
489
490 // Payment mode
491 print "<tr><td>".$langs->trans("PaymentMode")."</td><td>\n";
492 $selected = GETPOSTINT('modepayment');
493 print img_picto('', 'payment', 'class="pictofixedwidth"');
494 print $form->select_types_paiements($selected, 'modepayment', 'CRDT', 0, 1, 0, 0, 1, 'maxwidth200 widthcentpercentminusx', 1);
495 print "</td></tr>\n";
496
497 // Public note
498 print '<tr>';
499 print '<td class="tdtop">'.$langs->trans('NotePublic').'</td>';
500 print '<td>';
501 if (!isset($note_public)) {
502 $note_public = $object->getDefaultCreateValueFor('note_public');
503 }
504 $doleditor = new DolEditor('note_public', $note_public, '', 80, 'dolibarr_notes', 'In', false, false, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PUBLIC') ? 0 : 1, ROWS_3, '90%');
505 print $doleditor->Create(1);
506 print '</td></tr>';
507
508 // Private note
509 if (empty($user->socid)) {
510 print '<tr>';
511 print '<td class="tdtop">'.$langs->trans('NotePrivate').'</td>';
512 print '<td>';
513 if (!isset($note_private)) {
514 $note_private = $object->getDefaultCreateValueFor('note_private');
515 }
516 $doleditor = new DolEditor('note_private', $note_private, '', 80, 'dolibarr_notes', 'In', false, false, !getDolGlobalString('FCKEDITOR_ENABLE_NOTE_PRIVATE') ? 0 : 1, ROWS_3, '90%');
517 print $doleditor->Create(1);
518 print '</td></tr>';
519 }
520
521 if (isModEnabled('project')) {
522 print "<tr><td>".$langs->trans("Project")."</td><td>";
523 print img_picto('', 'project', 'class="pictofixedwidth"');
524 print $formproject->select_projects(-1, $projectid, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500');
525 print "</td></tr>\n";
526 }
527
528 // Other attributes
529 $parameters = array();
530 $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
531 print $hookmanager->resPrint;
532 if (empty($reshook)) {
533 print $object->showOptionals($extrafields, 'create', $parameters);
534 }
535
536 print '</tbody>';
537 print "</table>\n";
538
539 print dol_get_fiche_end();
540
541 print $form->buttonsSaveCancel();
542
543 print "</form>\n";
544}
545
546
547/* ************************************************************ */
548/* */
549/* Donation card in edit mode */
550/* */
551/* ************************************************************ */
552
553if (!empty($id) && $action == 'edit') {
554 $result = $object->fetch($id);
555 if ($result < 0) {
556 dol_print_error($db, $object->error);
557 exit;
558 }
559 $result = $object->fetch_optionals();
560 if ($result < 0) {
561 dol_print_error($db);
562 exit;
563 }
564
565 $hselected = 'card';
567
568 print '<form name="update" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
569 print '<input type="hidden" name="token" value="'.newToken().'">';
570 print '<input type="hidden" name="action" value="update">';
571 print '<input type="hidden" name="rowid" value="'.$object->id.'">';
572 print '<input type="hidden" name="amount" value="'.$object->amount.'">';
573 print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
574
575 print dol_get_fiche_head($head, $hselected, $langs->trans("Donation"), 0, 'donation');
576
577 print '<table class="border centpercent">';
578
579 // Ref
580 print '<tr><td>'.$langs->trans("Ref").'</td><td colspan="2">';
581 print $object->getNomUrl();
582 print '</td>';
583 print '</tr>';
584
585 // Date
586 print '<tr><td class="titlefieldcreate fieldrequired">'.$langs->trans("Date").'</td><td>';
587 print $form->selectDate($object->date, '', 0, 0, 0, "update");
588 print '</td>';
589
590 // Amount
591 if ($object->status == 0) {
592 print "<tr>".'<td class="fieldrequired">'.$langs->trans("Amount").'</td><td><input type="text" name="amount" size="10" value="'.price($object->amount).'"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
593 } else {
594 print '<tr><td>'.$langs->trans("Amount").'</td><td>';
595 print price($object->amount, 0, $langs, 0, 0, -1, $conf->currency);
596 print '</td></tr>';
597 }
598
599 print '<tr><td class="fieldrequired">'.$langs->trans("PublicDonation")."</td><td>";
600 print $form->selectyesno("public", $object->public, 1);
601 print "</td>";
602 print "</tr>\n";
603
604 if (isModEnabled("societe") && getDolGlobalString('DONATION_USE_THIRDPARTIES')) {
605 $company = new Societe($db);
606
607 print '<tr><td>'.$langs->trans("ThirdParty").'</td><td colspan="2">';
608 if ($object->socid > 0) {
609 $result = $company->fetch($object->socid);
610 print $company->getNomUrl(1);
611 }
612 print '</td></tr>';
613 } else {
614 $langs->load("companies");
615 print '<tr><td>'.$langs->trans("Company").'</td><td><input type="text" name="societe" class="maxwidth200" value="'.dol_escape_htmltag($object->societe).'"></td></tr>';
616 print '<tr><td>'.$langs->trans("Lastname").'</td><td><input type="text" name="lastname" class="maxwidth200" value="'.dol_escape_htmltag($object->lastname).'"></td></tr>';
617 print '<tr><td>'.$langs->trans("Firstname").'</td><td><input type="text" name="firstname" class="maxwidth200" value="'.dol_escape_htmltag($object->firstname).'"></td></tr>';
618 print '<tr><td>'.$langs->trans("Address").'</td><td>';
619 print '<textarea name="address" wrap="soft" class="quatrevingtpercent" rows="'.ROWS_3.'">'.dol_escape_htmltag($object->address, 0, 1).'</textarea></td></tr>';
620
621 // Zip / Town
622 print '<tr><td>'.$langs->trans("Zip").' / '.$langs->trans("Town").'</td><td>';
623 print $formcompany->select_ziptown((GETPOSTISSET("zipcode") ? GETPOSTISSET("zipcode") : $object->zip), 'zipcode', array('town', 'selectcountry_id', 'state_id'), 6);
624 print ' ';
625 print $formcompany->select_ziptown((GETPOSTISSET("town") ? GETPOST("town") : $object->town), 'town', array('zipcode', 'selectcountry_id', 'state_id'));
626 print '</tr>';
627
628 // Country
629 print '<tr><td class="titlefieldcreate">'.$langs->trans('Country').'</td><td>';
630 print $form->select_country((!empty($object->country_id) ? $object->country_id : $mysoc->country_code), 'country_id');
631 if ($user->admin) {
632 print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1);
633 }
634 print '</td></tr>';
635
636 print "<tr>".'<td>'.$langs->trans("EMail").'</td><td><input type="text" name="email" class="maxwidth200" value="'.dol_escape_htmltag($object->email).'"></td></tr>';
637 }
638 // Payment mode
639 print "<tr><td>".$langs->trans("PaymentMode")."</td><td>\n";
640 if ($object->mode_reglement_id) {
641 $selected = $object->mode_reglement_id;
642 } else {
643 $selected = '';
644 }
645 $form->select_types_paiements($selected, 'modepayment', 'CRDT', 0, 1);
646 print "</td></tr>\n";
647
648 // Status
649 print "<tr>".'<td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4).'</td></tr>';
650
651 // Project
652 if (isModEnabled('project')) {
653 $formproject = new FormProjets($db);
654
655 $langs->load('projects');
656 print '<tr><td>'.$langs->trans('Project').'</td><td>';
657 $formproject->select_projects(-1, $object->fk_project, 'fk_project', 0, 0, 1, 1, 0, 0, 0, '', 0, 0, 'maxwidth500');
658 print '</td></tr>';
659 }
660
661 // Other attributes
662 $parameters = array();
663 $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
664 print $hookmanager->resPrint;
665 if (empty($reshook)) {
666 print $object->showOptionals($extrafields, 'edit', $parameters);
667 }
668
669 print "</table>\n";
670
671 print dol_get_fiche_end();
672
673 print $form->buttonsSaveCancel();
674
675 print "</form>\n";
676}
677
678
679
680/* ************************************************************ */
681/* */
682/* Donation card in view mode */
683/* */
684/* ************************************************************ */
685if (!empty($id) && $action != 'edit') {
686 $formconfirm = "";
687 // Confirmation delete
688 if ($action == 'delete') {
689 $text = $langs->trans("ConfirmDeleteADonation");
690 print $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$object->id, $langs->trans("DeleteADonation"), $text, "confirm_delete", '', '', 1);
691 }
692
693 $result = $object->fetch($id);
694 if ($result < 0) {
695 dol_print_error($db, $object->error);
696 exit;
697 }
698 $result = $object->fetch_optionals();
699 if ($result < 0) {
700 dol_print_error($db);
701 exit;
702 }
703
704 $hselected = 'card';
705
707 print dol_get_fiche_head($head, $hselected, $langs->trans("Donation"), -1, 'donation');
708
709 // Print form confirm
710 print $formconfirm;
711
712 $linkback = '<a href="'.DOL_URL_ROOT.'/don/list.php'.(!empty($socid) ? '?socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
713
714 $morehtmlref = '<div class="refidno">';
715 // Project
716 if (isModEnabled('project')) {
717 $langs->load("projects");
718 $morehtmlref .= $langs->trans('Project').' ';
719 if ($user->hasRight('don', 'creer')) {
720 if ($action != 'classify') {
721 $morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a> : ';
722 }
723 if ($action == 'classify') {
724 //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
725 $morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
726 $morehtmlref .= '<input type="hidden" name="action" value="classin">';
727 $morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
728 $morehtmlref .= '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
729 $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1, 0, 'maxwidth500');
730 $morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
731 $morehtmlref .= '</form>';
732 } else {
733 $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, $object->socid, $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300');
734 }
735 } else {
736 if (!empty($object->fk_project)) {
737 $proj = new Project($db);
738 $proj->fetch($object->fk_project);
739 $morehtmlref .= ' : '.$proj->getNomUrl(1);
740 if ($proj->title) {
741 $morehtmlref .= ' - '.$proj->title;
742 }
743 } else {
744 $morehtmlref .= '';
745 }
746 }
747 }
748 $morehtmlref .= '</div>';
749
750
751 dol_banner_tab($object, 'rowid', $linkback, 1, 'rowid', 'ref', $morehtmlref);
752
753
754 print '<div class="fichecenter">';
755 print '<div class="fichehalfleft">';
756 print '<div class="underbanner clearboth"></div>';
757
758 print '<table class="border tableforfield" width="100%">';
759
760 // Date
761 print '<tr><td class="titlefield">'.$langs->trans("Date").'</td><td colspan="2">';
762 print dol_print_date($object->date, "day");
763 print "</td>";
764
765 print '<tr><td>'.$langs->trans("Amount").'</td><td colspan="2">';
766 print price($object->amount, 0, $langs, 0, 0, -1, $conf->currency);
767 print '</td></tr>';
768
769 print '<tr><td>'.$langs->trans("PublicDonation").'</td><td colspan="2">';
770 print yn($object->public);
771 print '</td></tr>';
772
773 if (isModEnabled("societe") && getDolGlobalString('DONATION_USE_THIRDPARTIES')) {
774 $company = new Societe($db);
775
776 print '<tr><td>'.$langs->trans("ThirdParty").'</td><td colspan="2">';
777 if ($object->socid > 0) {
778 $result = $company->fetch($object->socid);
779 print $company->getNomUrl(1);
780 }
781 print '</td></tr>';
782 } else {
783 print '<tr><td>'.$langs->trans("Company").'</td><td colspan="2">'.$object->societe.'</td></tr>';
784 print '<tr><td>'.$langs->trans("Lastname").'</td><td colspan="2">'.$object->lastname.'</td></tr>';
785 print '<tr><td>'.$langs->trans("Firstname").'</td><td colspan="2">'.$object->firstname.'</td></tr>';
786 }
787
788 // Payment mode
789 print "<tr><td>".$langs->trans("PaymentMode")."</td><td>";
790 $form->form_modes_reglement(null, $object->mode_reglement_id, 'none');
791 print "</td></tr>\n";
792
793 // Other attributes
794 $cols = 2;
795 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
796
797 print '</table>';
798
799 print '</div>';
800 print '<div class="fichehalfright">';
801
802 /*
803 * Payments
804 */
805 $sql = "SELECT p.rowid, p.num_payment, p.datep as dp, p.amount,";
806 $sql .= " c.code as type_code, c.libelle as paiement_type,";
807 $sql .= " b.fk_account";
808 $sql .= " FROM ".MAIN_DB_PREFIX."payment_donation as p";
809 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON p.fk_bank = b.rowid";
810 $sql .= ", ".MAIN_DB_PREFIX."c_paiement as c ";
811 $sql .= ", ".MAIN_DB_PREFIX."don as d";
812 $sql .= " WHERE d.rowid = ".((int) $id);
813 $sql .= " AND p.fk_donation = d.rowid";
814 $sql .= " AND d.entity IN (".getEntity('donation').")";
815 $sql .= " AND p.fk_typepayment = c.id";
816 $sql .= " ORDER BY dp";
817
818 //print $sql;
819 $resql = $db->query($sql);
820 if ($resql) {
821 $num = $db->num_rows($resql);
822 $i = 0;
823
824 $totalpaid = 0;
825 print '<table class="noborder paymenttable centpercent">';
826 print '<tr class="liste_titre">';
827 print '<td>'.$langs->trans("RefPayment").'</td>';
828 print '<td>'.$langs->trans("Date").'</td>';
829 print '<td>'.$langs->trans("Type").'</td>';
830 if (isModEnabled("bank")) {
831 print '<td>'.$langs->trans("BankAccount").'</td>';
832 }
833 print '<td class="right">'.$langs->trans("Amount").'</td>';
834 print '</tr>';
835
836 while ($i < $num) {
837 $objp = $db->fetch_object($resql);
838
839 print '<tr class="oddeven"><td>';
840 print '<a href="'.DOL_URL_ROOT.'/don/payment/card.php?id='.$objp->rowid.'">'.img_object($langs->trans("Payment"), "payment").' '.$objp->rowid.'</a></td>';
841 print '<td>'.dol_print_date($db->jdate($objp->dp), 'day')."</td>\n";
842 $labeltype = ($langs->trans("PaymentType".$objp->type_code) != "PaymentType".$objp->type_code) ? $langs->trans("PaymentType".$objp->type_code) : $objp->paiement_type;
843 print "<td>".$labeltype.' '.$objp->num_payment."</td>\n";
844 if (isModEnabled("bank")) {
845 $bankaccountstatic->fetch($objp->fk_account);
846 /*$bankaccountstatic->id = $objp->fk_bank;
847 $bankaccountstatic->ref = $objp->baref;
848 $bankaccountstatic->label = $objp->baref;
849 $bankaccountstatic->number = $objp->banumber;
850 $bankaccountstatic->currency_code = $objp->bacurrency_code;
851
852 if (isModEnabled('accounting')) {
853 $bankaccountstatic->account_number = $objp->account_number;
854
855 $accountingjournal = new AccountingJournal($db);
856 $accountingjournal->fetch($objp->fk_accountancy_journal);
857 $bankaccountstatic->accountancy_journal = $accountingjournal->getNomUrl(0, 1, 1, '', 1);
858 }
859 */
860 print '<td class="nowraponall">';
861 if ($bankaccountstatic->id) {
862 print $bankaccountstatic->getNomUrl(1, 'transactions');
863 }
864 print '</td>';
865 }
866 print '<td class="right">'.price($objp->amount)."</td>\n";
867 print "</tr>";
868 $totalpaid += $objp->amount;
869 $i++;
870 }
871
872 if ($object->paid == 0) {
873 $colspan = 3;
874 if (isModEnabled("bank")) {
875 $colspan++;
876 }
877 print '<tr><td colspan="'.$colspan.'" class="right">'.$langs->trans("AlreadyPaid").' :</td><td class="right">'.price($totalpaid)."</td></tr>\n";
878 print '<tr><td colspan="'.$colspan.'" class="right">'.$langs->trans("AmountExpected").' :</td><td class="right">'.price($object->amount)."</td></tr>\n";
879
880 $remaintopay = $object->amount - $totalpaid;
881 $resteapayeraffiche = $remaintopay;
882
883 print '<tr><td colspan="'.$colspan.'" class="right">'.$langs->trans("RemainderToPay")." :</td>";
884 print '<td class="right'.(!empty($resteapayeraffiche) ? ' amountremaintopay' : '').'">'.price($remaintopay)."</td></tr>\n";
885 }
886 print "</table>";
887 $db->free($resql);
888 } else {
889 dol_print_error($db);
890 }
891
892 print '</div>';
893 print '</div>';
894
895 print '<div class="clearboth"></div>';
896
897 print dol_get_fiche_end();
898
899 $remaintopay = $object->amount - $totalpaid;
900
901 // Actions buttons
902
903 print '<div class="tabsAction">';
904 $parameters = array();
905 $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action);
906 if (empty($reshook)) {
907 // Re-open
908 if ($permissiontoadd && $object->status == $object::STATUS_CANCELED) {
909 print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_reopen&confirm=yes&token='.newToken().'">'.$langs->trans("ReOpen").'</a>';
910 }
911
912 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>';
913
914 if ($object->status == $object::STATUS_DRAFT) {
915 print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&action=valid_promesse&token='.newToken().'">'.$langs->trans("ValidPromess").'</a></div>';
916 }
917
918 if (($object->status == $object::STATUS_DRAFT || $object->status == $object::STATUS_VALIDATED) && $totalpaid == 0 && $object->paid == 0) {
919 print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&action=set_cancel&token='.newToken().'">'.$langs->trans("ClassifyCanceled")."</a></div>";
920 }
921
922 // Create payment
923 if ($object->status == $object::STATUS_VALIDATED && $object->paid == 0 && $user->hasRight('don', 'creer')) {
924 if ($remaintopay == 0) {
925 print '<div class="inline-block divButAction"><span class="butActionRefused classfortooltip" title="'.$langs->trans("DisabledBecauseRemainderToPayIsZero").'">'.$langs->trans('DoPayment').'</span></div>';
926 } else {
927 print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/don/payment/payment.php?rowid='.$object->id.'&action=create&token='.newToken().'">'.$langs->trans('DoPayment').'</a></div>';
928 }
929 }
930
931 // Classify 'paid'
932 if ($object->status == $object::STATUS_VALIDATED && round($remaintopay) == 0 && $object->paid == 0 && $user->hasRight('don', 'creer')) {
933 print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?rowid='.$object->id.'&action=set_paid&token='.newToken().'">'.$langs->trans("ClassifyPaid")."</a></div>";
934 }
935
936 // Delete
937 if ($user->hasRight('don', 'supprimer')) {
938 if ($object->status == $object::STATUS_CANCELED || $object->status == $object::STATUS_DRAFT) {
939 print '<div class="inline-block divButAction"><a class="butActionDelete" href="card.php?rowid='.$object->id.'&action=delete&token='.newToken().'">'.$langs->trans("Delete")."</a></div>";
940 } else {
941 print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#" title="'.$langs->trans("CantRemovePaymentWithOneInvoicePaid").'">'.$langs->trans("Delete")."</a></div>";
942 }
943 } else {
944 print '<div class="inline-block divButAction"><a class="butActionRefused classfortooltip" href="#">'.$langs->trans("Delete")."</a></div>";
945 }
946 }
947
948 print "</div>";
949
950
951 print '<div class="fichecenter"><div class="fichehalfleft">';
952
953 /*
954 * Generated documents
955 */
956 $filename = dol_sanitizeFileName((string) $object->id);
957 $filedir = $conf->don->dir_output."/".dol_sanitizeFileName((string) $object->id);
958 $urlsource = $_SERVER['PHP_SELF'].'?rowid='.$object->id;
959 $genallowed = (($object->paid == 0 || $user->admin) && $user->hasRight('don', 'lire'));
960 $delallowed = $user->hasRight('don', 'creer');
961
962 print $formfile->showdocuments('donation', $filename, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf);
963
964 // Show links to link elements
965 $tmparray = $form->showLinkToObjectBlock($object, array(), array('don'), 1);
966 $linktoelem = $tmparray['linktoelem'];
967 $htmltoenteralink = $tmparray['htmltoenteralink'];
968 print $htmltoenteralink;
969
970 $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
971
972 // Show online payment link
973 // The list can be complete by the hook 'doValidatePayment' executed inside getValidOnlinePaymentMethods()
974 include_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
975 $validpaymentmethod = getValidOnlinePaymentMethods('');
976 $useonlinepayment = count($validpaymentmethod);
977
978 if ($useonlinepayment) { //$object->statut != Facture::STATUS_DRAFT &&
979 print '<br><!-- Link to pay -->'."\n";
980 require_once DOL_DOCUMENT_ROOT.'/core/lib/payments.lib.php';
981 print showOnlinePaymentUrl('donation', $object->ref).'<br>';
982 }
983
984 print '</div><div class="fichehalfright">';
985
986 print '</div></div>';
987}
988
989llxFooter();
990$db->close();
$id
Definition account.php:48
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:66
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:71
Class to manage bank accounts.
Class to manage a WYSIWYG editor.
Class to manage donations.
Definition don.class.php:41
Class to manage standard extra fields.
Class to build HTML component for third parties management Only common components are here.
Class to offer components to list and upload files.
Class to manage generation of HTML components Only common components must be here.
Class to manage building of HTML components.
Class to manage projects.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage translations.
llxFooter()
Footer empty.
Definition document.php:107
donation_prepare_head($object)
Prepare array with list of tabs.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
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)
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
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.
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 '.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
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.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
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).
newToken()
Return the value of token currently saved into session with name 'newtoken'.
yn($yesno, $format=1, $color=0)
Return yes or no in current language.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
GETPOSTFLOAT($paramname, $rounding='')
Return the value of a $_GET or $_POST supervariable, converted into float.
dol_clone($object, $native=2)
Create a clone of instance of object (new instance with same value for each properties) With native =...
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='')
Show information in HTML for admin users or standard users.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
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...
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79
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.