linkedobjectblock.tpl.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. /* Copyright (C) 2010-2011 Regis Houssin <regis.houssin@inodbox.com>
  3. * Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  17. */
  18. // Protection to avoid direct call of template
  19. if (empty($conf) || !is_object($conf)) {
  20. print "Error, template page can't be called as URL";
  21. exit;
  22. }
  23. print "<!-- BEGIN PHP TEMPLATE fourn/commande/tpl/linkedobjectblock.tpl.php -->\n";
  24. global $user;
  25. global $noMoreLinkedObjectBlockAfter;
  26. $langs = $GLOBALS['langs'];
  27. $linkedObjectBlock = $GLOBALS['linkedObjectBlock'];
  28. $langs->load("orders");
  29. $total = 0;
  30. $ilink = 0;
  31. foreach ($linkedObjectBlock as $key => $objectlink) {
  32. $ilink++;
  33. $trclass = 'oddeven';
  34. if ($ilink == count($linkedObjectBlock) && empty($noMoreLinkedObjectBlockAfter) && count($linkedObjectBlock) <= 1) {
  35. $trclass .= ' liste_sub_total';
  36. }
  37. ?>
  38. <tr class="<?php echo $trclass; ?>">
  39. <td><?php echo $langs->trans("SupplierOrder"); ?></td>
  40. <td><?php print $objectlink->getNomUrl(1); ?></td>
  41. <td class="left"><?php echo $objectlink->ref_supplier; ?></td>
  42. <td class="center"><?php echo dol_print_date($objectlink->date, 'day'); ?></td>
  43. <td class="right"><?php
  44. if ($user->rights->fournisseur->commande->lire) {
  45. $total = $total + $objectlink->total_ht;
  46. echo price($objectlink->total_ht);
  47. } ?></td>
  48. <td class="right"><?php echo $objectlink->getLibStatut(3); ?></td>
  49. <td class="right"><a class="reposition" href="<?php echo $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=dellink&token='.newToken().'&dellinkid='.$key; ?>"><?php echo img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink'); ?></a></td>
  50. </tr>
  51. <?php
  52. }
  53. if (count($linkedObjectBlock) > 1) {
  54. ?>
  55. <tr class="liste_total <?php echo (empty($noMoreLinkedObjectBlockAfter) ? 'liste_sub_total' : ''); ?>">
  56. <td><?php echo $langs->trans("Total"); ?></td>
  57. <td></td>
  58. <td class="center"></td>
  59. <td class="center"></td>
  60. <td class="right"><?php echo price($total); ?></td>
  61. <td class="right"></td>
  62. <td class="right"></td>
  63. </tr>
  64. <?php
  65. }
  66. print "<!-- END PHP TEMPLATE -->\n";