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