dolibarr 21.0.0-beta
list.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2004-2018 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
5 * Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
6 * Copyright (C) 2019 Thibault FOUCART <support@ptibogxiv.net>
7 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
8 * Copyright (C) 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.'/don/class/don.class.php';
33if (isModEnabled('project')) {
34 require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
35}
36
45// Load translation files required by the page
46$langs->loadLangs(array('companies', 'donations'));
47
48// Get parameters
49$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'create'/'add', 'edit'/'update', 'view', ...
50$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
51$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'donationlist';
52$toselect = GETPOST('toselect', 'array');
53$optioncss = GETPOST('optioncss', 'alpha');
54$mode = GETPOST('mode', 'alpha');
55
56$type = GETPOST('type', 'aZ');
57
58$search_status = (GETPOST("search_status", 'intcomma') != '') ? GETPOST("search_status", 'intcomma') : "-4";
59$search_all = trim(GETPOST('search_all', 'alphanohtml'));
60$search_ref = GETPOST('search_ref', 'alpha');
61$search_company = GETPOST('search_company', 'alpha');
62$search_thirdparty = GETPOST('search_thirdparty', 'alpha');
63$search_name = GETPOST('search_name', 'alpha');
64$search_amount = GETPOST('search_amount', 'alpha');
65$moreforfilter = GETPOST('moreforfilter', 'alpha');
66
67// Load variable for pagination
68$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
69$sortfield = GETPOST('sortfield', 'aZ09comma');
70$sortorder = GETPOST('sortorder', 'aZ09comma');
71$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT('page');
72if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
73 // If $page is not defined, or '' or -1 or if we click on clear filters
74 $page = 0;
75}
76$offset = $limit * $page;
77$pageprev = $page - 1;
78$pagenext = $page + 1;
79
80// Initialize a technical objects
81$object = new Don($db);
82$extrafields = new ExtraFields($db);
83$diroutputmassaction = $conf->don->dir_output.'/temp/massgeneration/'.$user->id;
84$hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array of activated contexes
85
86// Fetch optionals attributes and labels
87$extrafields->fetch_name_optionals_label($object->table_element);
88//$extrafields->fetch_name_optionals_label($object->table_element_line);
89
90$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
91
92// Default sort order (if not yet defined by previous GETPOST)
93if (!$sortorder) {
94 $sortorder = "DESC";
95}
96if (!$sortfield) {
97 $sortfield = "d.datedon";
98}
99
100// Initialize array of search criteria
101$search_all = trim(GETPOST('search_all', 'alphanohtml'));
102$search = array();
103foreach ($object->fields as $key => $val) {
104 if (GETPOST('search_'.$key, 'alpha') !== '') {
105 $search[$key] = GETPOST('search_'.$key, 'alpha');
106 }
107 if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
108 $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear'));
109 $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear'));
110 }
111}
112
113// List of fields to search into when doing a "search in all"
114$fieldstosearchall = array(
115 'd.rowid' => 'Id',
116 'd.ref' => 'Ref',
117 'd.lastname' => 'Lastname',
118 'd.firstname' => 'Firstname',
119);
120// Extra fields
121include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
122
123$object->fields = dol_sort_array($object->fields, 'position');
124//$arrayfields['anotherfield'] = array('type'=>'integer', 'label'=>'AnotherField', 'checked'=>1, 'enabled'=>1, 'position'=>90, 'csslist'=>'right');
125$arrayfields = dol_sort_array($arrayfields, 'position');
126
127
128// Security check
129$result = restrictedArea($user, 'don');
130
131$permissiontoread = $user->hasRight('don', 'read');
132$permissiontoadd = $user->hasRight('don', 'write');
133$permissiontodelete = $user->hasRight('don', 'delete');
134
135
136/*
137 * Actions
138 */
139
140if (GETPOST('cancel', 'alpha')) {
141 $action = 'list';
142 $massaction = '';
143}
144if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
145 $massaction = '';
146}
147
148if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // Both test are required to be compatible with all browsers
149 $search_all = "";
150 $search_ref = "";
151 $search_company = "";
152 $search_thirdparty = "";
153 $search_name = "";
154 $search_amount = "";
155 $search_status = '';
156}
157
158
159/*
160 * View
161 */
162
163$form = new Form($db);
164
165$now = dol_now();
166
167$donationstatic = new Don($db);
168if (isModEnabled('project')) {
169 $projectstatic = new Project($db);
170}
171
172$title = $langs->trans("Donations");
173$help_url = 'EN:Module_Donations|FR:Module_Dons|ES:M&oacute;dulo_Donaciones|DE:Modul_Spenden';
174$morejs = array();
175$morecss = array();
176
177// Build and execute select
178// --------------------------------------------------------------------
179$sql = "SELECT d.rowid, d.datedon, d.fk_soc as socid, d.firstname, d.lastname, d.societe,";
180$sql .= " d.amount, d.fk_statut as status,";
181$sql .= " p.rowid as pid, p.ref, p.title, p.public";
182// Add fields from hooks
183$parameters = array();
184$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
185$sql .= $hookmanager->resPrint;
186$sql = preg_replace('/,\s*$/', '', $sql);
187
188$sqlfields = $sql; // $sql fields to remove for count total
189
190$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as d LEFT JOIN ".MAIN_DB_PREFIX."projet AS p";
191$sql .= " ON p.rowid = d.fk_projet";
192$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe AS s ON s.rowid = d.fk_soc";
193$sql .= " WHERE d.entity IN (". getEntity('donation') . ")";
194
195if ($search_status != '' && $search_status != '-4') {
196 $sql .= " AND d.fk_statut IN (".$db->sanitize($search_status).")";
197}
198if (trim($search_ref) != '') {
199 $sql .= natural_search(array('d.ref', "d.rowid"), $search_ref);
200}
201if (trim($search_all) != '') {
202 $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
203}
204if (trim($search_company) != '') {
205 $sql .= natural_search('d.societe', $search_company);
206}
207if (trim($search_thirdparty) != '') {
208 $sql .= natural_search("s.nom", $search_thirdparty);
209}
210if (trim($search_name) != '') {
211 $sql .= natural_search(array('d.lastname', 'd.firstname'), $search_name);
212}
213if ($search_amount) {
214 $sql .= natural_search('d.amount', $search_amount, 1);
215}
216
217// Count total nb of records
218$nbtotalofrecords = '';
219if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
220 /* The fast and low memory method to get and count full list converts the sql into a sql count */
221 $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
222 $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
223 $resql = $db->query($sqlforcount);
224 if ($resql) {
225 $objforcount = $db->fetch_object($resql);
226 $nbtotalofrecords = $objforcount->nbtotalofrecords;
227 } else {
228 dol_print_error($db);
229 }
230
231 if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
232 $page = 0;
233 $offset = 0;
234 }
235 $db->free($resql);
236}
237
238// Complete request and execute it with limit
239$sql .= $db->order($sortfield, $sortorder);
240if ($limit) {
241 $sql .= $db->plimit($limit + 1, $offset);
242}
243
244$resql = $db->query($sql);
245if (!$resql) {
246 dol_print_error($db);
247 exit;
248}
249
250$num = $db->num_rows($resql);
251
252// Direct jump if only one record found
253if ($num == 1 && getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
254 $obj = $db->fetch_object($resql);
255 $id = $obj->rowid;
256 header("Location: ".dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.$id);
257 exit;
258}
259
260
261// Output page
262// --------------------------------------------------------------------
263
264llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'mod-donation page-list bodyforlist'); // Can use also classforhorizontalscrolloftabs instead of bodyforlist for no horizontal scroll
265
266// Example : Adding jquery code
267// print '<script type="text/javascript">
268// jQuery(document).ready(function() {
269// function init_myfunc()
270// {
271// jQuery("#myid").removeAttr(\'disabled\');
272// jQuery("#myid").attr(\'disabled\',\'disabled\');
273// }
274// init_myfunc();
275// jQuery("#mybutton").click(function() {
276// init_myfunc();
277// });
278// });
279// </script>';
280
281$arrayofselected = is_array($toselect) ? $toselect : array();
282
283$param = '';
284if (!empty($mode)) {
285 $param .= '&mode='.urlencode($mode);
286}
287if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
288 $param .= '&contextpage='.urlencode($contextpage);
289}
290if ($limit > 0 && $limit != $conf->liste_limit) {
291 $param .= '&limit='.((int) $limit);
292}
293if ($optioncss != '') {
294 $param .= '&optioncss='.urlencode($optioncss);
295}
296if ($search_status && $search_status != -1) {
297 $param .= '&search_status='.urlencode($search_status);
298}
299if ($search_ref) {
300 $param .= '&search_ref='.urlencode($search_ref);
301}
302if ($search_company) {
303 $param .= '&search_company='.urlencode($search_company);
304}
305if ($search_name) {
306 $param .= '&search_name='.urlencode($search_name);
307}
308if ($search_amount) {
309 $param .= '&search_amount='.urlencode($search_amount);
310}
311
312// List of mass actions available
313$arrayofmassactions = array(
314 //'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"),
315 //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
316 //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
317 //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
318);
319if (!empty($permissiontodelete)) {
320 $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
321}
322if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) {
323 $arrayofmassactions = array();
324}
325$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
326
327
328print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
329if ($optioncss != '') {
330 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
331}
332print '<input type="hidden" name="token" value="'.newToken().'">';
333print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
334print '<input type="hidden" name="action" value="list">';
335print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
336print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
337print '<input type="hidden" name="page" value="'.$page.'">';
338print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
339print '<input type="hidden" name="page_y" value="">';
340print '<input type="hidden" name="mode" value="'.$mode.'">';
341print '<input type="hidden" name="type" value="'.$type.'">';
342
343$newcardbutton = '';
344$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'));
345$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'));
346if ($user->hasRight('don', 'creer')) {
347 $newcardbutton .= dolGetButtonTitleSeparator();
348 $newcardbutton .= dolGetButtonTitle($langs->trans('NewDonation'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/don/card.php?action=create');
349}
350
351// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
352print_barre_liste($langs->trans("Donations"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'object_donation', 0, $newcardbutton, '', $limit, 0, 0, 1);
353
354if ($search_all) {
355 $setupstring = '';
356 foreach ($fieldstosearchall as $key => $val) {
357 $fieldstosearchall[$key] = $langs->trans($val);
358 $setupstring .= $key."=".$val.";";
359 }
360 print '<!-- Search done like if DONATION_QUICKSEARCH_ON_FIELDS = '.$setupstring.' -->'."\n";
361 print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).implode(', ', $fieldstosearchall).'</div>';
362}
363
364$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
365$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup
366$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
367$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
368
369print '<div class="div-table-responsive">';
370print '<table class="tagtable nobottomiftotal liste'.(!empty($moreforfilter) ? " listwithfilterbefore" : "").'">'."\n";
371
372// Fields title search
373// --------------------------------------------------------------------
374print '<tr class="liste_titre_filter">';
375// Action column
376if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
377 print '<td class="liste_titre center maxwidthsearch">';
378 $searchpicto = $form->showFilterButtons('left');
379 print $searchpicto;
380 print '</td>';
381}
382print '<td class="liste_titre">';
383print '<input class="flat" size="10" type="text" name="search_ref" value="'.$search_ref.'">';
384print '</td>';
385if (getDolGlobalString('DONATION_USE_THIRDPARTIES')) {
386 print '<td class="liste_titre">';
387 print '<input class="flat" size="10" type="text" name="search_thirdparty" value="'.$search_thirdparty.'">';
388 print '</td>';
389} else {
390 print '<td class="liste_titre">';
391 print '<input class="flat" size="10" type="text" name="search_company" value="'.$search_company.'">';
392 print '</td>';
393}
394print '<td class="liste_titre">';
395print '<input class="flat" size="10" type="text" name="search_name" value="'.$search_name.'">';
396print '</td>';
397print '<td class="liste_titre left">';
398print '&nbsp;';
399print '</td>';
400if (isModEnabled('project')) {
401 print '<td class="liste_titre right">';
402 print '&nbsp;';
403 print '</td>';
404}
405print '<td class="liste_titre right"><input name="search_amount" class="flat" type="text" size="8" value="'.$search_amount.'"></td>';
406print '<td class="liste_titre center parentonrightofpage">';
407$liststatus = array(
408 Don::STATUS_DRAFT => $langs->trans("DonationStatusPromiseNotValidated"),
409 Don::STATUS_VALIDATED => $langs->trans("DonationStatusPromiseValidated"),
410 Don::STATUS_PAID => $langs->trans("DonationStatusPaid"),
411 Don::STATUS_CANCELED => $langs->trans("Canceled")
412);
413// @phan-suppress-next-line PhanPluginSuspiciousParamOrder
414print $form->selectarray('search_status', $liststatus, $search_status, -4, 0, 0, '', 0, 0, 0, '', 'search_status maxwidth100 onrightofpage');
415print '</td>';
416if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
417 print '<td class="liste_titre center maxwidthsearch">';
418 $searchpicto = $form->showFilterButtons();
419 print $searchpicto;
420 print '</td>';
421}
422print '</tr>'."\n";
423
424$totalarray = array();
425$totalarray['nbfield'] = 0;
426
427// Fields title label
428// --------------------------------------------------------------------
429print '<tr class="liste_titre">';
430// Action column
431if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
433 $totalarray['nbfield']++;
434}
435print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "d.rowid", "", $param, "", $sortfield, $sortorder);
436$totalarray['nbfield']++;
437if (getDolGlobalString('DONATION_USE_THIRDPARTIES')) {
438 print_liste_field_titre("ThirdParty", $_SERVER["PHP_SELF"], "d.fk_soc", "", $param, "", $sortfield, $sortorder);
439 $totalarray['nbfield']++;
440} else {
441 print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "d.societe", "", $param, "", $sortfield, $sortorder);
442 $totalarray['nbfield']++;
443}
444print_liste_field_titre("Name", $_SERVER["PHP_SELF"], "d.lastname", "", $param, "", $sortfield, $sortorder);
445$totalarray['nbfield']++;
446print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "d.datedon", "", $param, '', $sortfield, $sortorder, 'center ');
447$totalarray['nbfield']++;
448if (isModEnabled('project')) {
449 $langs->load("projects");
450 print_liste_field_titre("Project", $_SERVER["PHP_SELF"], "d.fk_projet", "", $param, "", $sortfield, $sortorder);
451 $totalarray['nbfield']++;
452}
453print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "d.amount", "", $param, '', $sortfield, $sortorder, 'right ');
454$totalarray['nbfield']++;
455print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "d.fk_statut", "", $param, '', $sortfield, $sortorder, 'center ');
456$totalarray['nbfield']++;
457if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
459 $totalarray['nbfield']++;
460}
461print '</tr>'."\n";
462
463$i = 0;
464$savnbfield = $totalarray['nbfield'];
465$totalarray = array();
466$totalarray['nbfield'] = 0;
467$imaxinloop = ($limit ? min($num, $limit) : $num);
468while ($i < $imaxinloop) {
469 $obj = $db->fetch_object($resql);
470
471 $donationstatic->setVarsFromFetchObj($obj);
472
473 $company = new Societe($db);
474 $result = $company->fetch($obj->socid);
475
476 if ($mode == 'kanban') {
477 if ($i == 0) {
478 print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
479 print '<div class="box-flex-container kanban">';
480 }
481 // Output Kanban
482 $donationstatic->amount = $obj->amount;
483 $donationstatic->date = $obj->datedon;
484 $donationstatic->status = $obj->status;
485 $donationstatic->id = $obj->rowid;
486 $donationstatic->ref = $obj->rowid;
487
488 if (!empty($obj->socid) && $company->id > 0) {
489 $donationstatic->societe = $company->getNomUrl(1);
490 } else {
491 $donationstatic->societe = $obj->societe;
492 }
493
494 $object = $donationstatic;
495
496 $selected = -1;
497 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
498 $selected = 0;
499 if (in_array($object->id, $arrayofselected)) {
500 $selected = 1;
501 }
502 }
503 print $donationstatic->getKanbanView('', array('selected' => $selected));
504 if ($i == ($imaxinloop - 1)) {
505 print '</div>';
506 print '</td></tr>';
507 }
508 } else {
509 $donationstatic->id = $obj->rowid;
510 $donationstatic->ref = $obj->rowid;
511 $donationstatic->lastname = $obj->lastname;
512 $donationstatic->firstname = $obj->firstname;
513
514 // Action
515 print '<tr class="oddeven">';
516 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
517 print '<td></td>';
518 }
519
520 // Ref
521 print "<td>".$donationstatic->getNomUrl(1)."</td>";
522
523 // Company
524 if (getDolGlobalString('DONATION_USE_THIRDPARTIES')) {
525 if (!empty($obj->socid) && $company->id > 0) {
526 print "<td>".$company->getNomUrl(1)."</td>";
527 } else {
528 print "<td>".((string) $obj->societe)."</td>";
529 }
530 } else {
531 print "<td>".((string) $obj->societe)."</td>";
532 }
533
534 // Donator
535 print "<td>".$donationstatic->getFullName($langs)."</td>";
536
537 // Date donation
538 print '<td class="center">'.dol_print_date($db->jdate($obj->datedon), 'day').'</td>';
539
540 if (isModEnabled('project')) {
541 print "<td>";
542 if ($obj->pid) {
543 $projectstatic->id = $obj->pid;
544 $projectstatic->ref = $obj->ref;
545 $projectstatic->id = $obj->pid;
546 $projectstatic->public = $obj->public;
547 $projectstatic->title = $obj->title;
548 print $projectstatic->getNomUrl(1);
549 } else {
550 print '&nbsp;';
551 }
552 print "</td>\n";
553 }
554 print '<td class="right"><span class="amount">'.price($obj->amount).'</span></td>';
555
556 // Status
557 print '<td class="center">'.$donationstatic->LibStatut($obj->status, 5).'</td>';
558
559 // Action
560 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
561 print '<td></td>';
562 }
563
564 print "</tr>";
565 }
566 $i++;
567}
568print "</table>";
569print '</div>';
570print "</form>\n";
571$db->free($resql);
572
573
574llxFooter();
575$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 donations.
Definition don.class.php:41
Class to manage standard extra fields.
Class to manage generation of HTML components Only common components must be here.
Class to manage projects.
Class to manage third parties objects (customers, suppliers, prospects...)
llxFooter()
Footer empty.
Definition document.php:107
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...
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
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.
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.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
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.
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
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.