payments.lib.php 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. /**
  3. * Copyright (C) 2013 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 <http://www.gnu.org/licenses/>.
  17. * or see http://www.gnu.org/
  18. */
  19. /**
  20. * Returns an array with the tabs for the "Payment" section
  21. * It loads tabs from modules looking for the entity payment
  22. *
  23. * @param Paiement $object Current payment object
  24. * @return array Tabs for the payment section
  25. */
  26. function payment_prepare_head(Paiement $object) {
  27. global $langs, $conf;
  28. $h = 0;
  29. $head = array();
  30. $head[$h][0] = DOL_URL_ROOT.'/compta/paiement/fiche.php?id='.$object->id;
  31. $head[$h][1] = $langs->trans("Card");
  32. $head[$h][2] = 'payment';
  33. $h++;
  34. // Show more tabs from modules
  35. // Entries must be declared in modules descriptor with line
  36. // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
  37. // $this->tabs = array('entity:-tabname); to remove a tab
  38. complete_head_from_modules($conf,$langs,$object,$head,$h,'payment');
  39. $head[$h][0] = DOL_URL_ROOT.'/compta/paiement/info.php?id='.$object->id;
  40. $head[$h][1] = $langs->trans("Info");
  41. $head[$h][2] = 'info';
  42. $h++;
  43. complete_head_from_modules($conf,$langs,$object,$head,$h,'payment', 'remove');
  44. return $head;
  45. }
  46. /**
  47. * Returns an array with the tabs for the "Supplier payment" section
  48. * It loads tabs from modules looking for the entity payment_supplier
  49. *
  50. * @param Paiement $object Current payment object
  51. * @return array Tabs for the payment section
  52. */
  53. function payment_supplier_prepare_head(Paiement $object) {
  54. global $langs, $conf;
  55. $h = 0;
  56. $head = array();
  57. $head[$h][0] = DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$object->id;
  58. $head[$h][1] = $langs->trans("Card");
  59. $head[$h][2] = 'payment';
  60. $h++;
  61. // Show more tabs from modules
  62. // Entries must be declared in modules descriptor with line
  63. // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
  64. // $this->tabs = array('entity:-tabname); to remove a tab
  65. complete_head_from_modules($conf,$langs,$object,$head,$h,'payment_supplier');
  66. $head[$h][0] = DOL_URL_ROOT.'/fourn/paiement/info.php?id='.$object->id;
  67. $head[$h][1] = $langs->trans('Info');
  68. $head[$h][2] = 'info';
  69. $h++;
  70. complete_head_from_modules($conf,$langs,$object,$head,$h,'payment_supplier', 'remove');
  71. return $head;
  72. }