dolibarr 22.0.5
linkedobjectblock.tpl.php
1<?php
2/* Copyright (C) 2010-2011 Regis Houssin <regis.houssin@inodbox.com>
3 * Copyright (C) 2013 Juanjo Menent <jmenent@2byte.es>
4 * Copyright (C) 2014 Marcos GarcĂ­a <marcosgdf@gmail.com>
5 * Copyright (C) 2017 Charlene Benke <cf.benke@patas-monkey.com>
6 * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 *
21 */
22
23print "<!-- BEGIN PHP TEMPLATE don/tpl/linkedobjectblock.tpl.php -->\n";
24
25global $user;
26global $noMoreLinkedObjectBlockAfter;
27
28$langs = $GLOBALS['langs'];
29$linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
30
31$langs->load("donations");
32
33$total = 0;
34$ilink = 0;
35$lastObjectLink = null;
36foreach ($linkedObjectBlock as $key => $objectlink) {
37 $ilink++;
38
39 $trclass = 'oddeven';
40 if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) {
41 $trclass .= ' liste_sub_total';
42 }
43 print '<tr class="'.$trclass.'">';
44 print '<td>'.$langs->trans("Donation").'</td>';
45 print '<td>'.$objectlink->getNomUrl(1).'</td>';
46 print '<td class="center linkedcol-ref tdoverflowmax150">'.$objectlink->ref_client.'</td>';
47 print '<td class="center">'.dol_print_date($objectlink->date, 'day').'</td>';
48 print '<td class="right">';
49 $total += $objectlink->total_ht;
50 echo price($objectlink->total_ht);
51 $lastObjectLink = $objectlink;
52}
53print '</td>';
54print '<td class="right">'.(is_object($lastObjectLink) ? $lastObjectLink->getLibStatut(3) : '').'</td>';
55print '</tr>';
56
57if (count($linkedObjectBlock) > 1) {
58 ?>
59 <tr class="liste_total <?php echo(empty($noMoreLinkedObjectBlockAfter) ? 'liste_sub_total' : ''); ?>">
60 <td><?php echo $langs->trans("Total"); ?></td>
61 <td></td>
62 <td class="center"></td>
63 <td class="center"></td>
64 <td class="right"><?php echo price($total); ?></td>
65 <td class="right"></td>
66 <td class="right"></td>
67 </tr>
68 <?php
69}
70
71print "<!-- END PHP TEMPLATE -->\n";
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.
$objectlink