linkedobjectblock.tpl.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 3 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  19. *
  20. */
  21. print "<!-- BEGIN PHP TEMPLATE don/tpl/linkedobjectblock.tpl.php -->\n";
  22. global $user;
  23. global $noMoreLinkedObjectBlockAfter;
  24. $langs = $GLOBALS['langs'];
  25. $linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
  26. $langs->load("donations");
  27. $total = 0;
  28. $ilink = 0;
  29. foreach ($linkedObjectBlock as $key => $objectlink) {
  30. $ilink++;
  31. $trclass = 'oddeven';
  32. if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) {
  33. $trclass .= ' liste_sub_total';
  34. }
  35. print '<tr class="'.$trclass.'">';
  36. print '<td>'.$langs->trans("Donation").'</td>';
  37. print '<td>'.$objectlink->getNomUrl(1).'</td>';
  38. print '<td class="center">'.$objectlink->ref_client.'</td>';
  39. print '<td class="center">'.dol_print_date($objectlink->date, 'day').'</td>';
  40. print '<td class="right">';
  41. $total = $total + $objectlink->total_ht;
  42. echo price($objectlink->total_ht);
  43. }
  44. print '</td>';
  45. print '<td class="right">'.$objectlink->getLibStatut(3).'</td>';
  46. print '</tr>';
  47. if (count($linkedObjectBlock) > 1) {
  48. ?>
  49. <tr class="liste_total <?php echo (empty($noMoreLinkedObjectBlockAfter) ? 'liste_sub_total' : ''); ?>">
  50. <td><?php echo $langs->trans("Total"); ?></td>
  51. <td></td>
  52. <td class="center"></td>
  53. <td class="center"></td>
  54. <td class="right"><?php echo price($total); ?></td>
  55. <td class="right"></td>
  56. <td class="right"></td>
  57. </tr>
  58. <?php
  59. }
  60. print "<!-- END PHP TEMPLATE -->\n";