hrm.lib.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?php
  2. /* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  16. */
  17. /**
  18. * \file htdocs/core/lib/hrm.lib.php
  19. * \ingroup HRM
  20. * \brief Library for hrm
  21. */
  22. /**
  23. * Return head table for establishment tabs screen
  24. *
  25. * @param Establishment $object Object related to tabs
  26. * @return array Array of tabs to show
  27. */
  28. function establishment_prepare_head($object)
  29. {
  30. global $langs, $conf;
  31. $langs->load('hrm');
  32. $h = 0;
  33. $head = array();
  34. $head[$h][0] = DOL_URL_ROOT.'/hrm/establishment/card.php?id='.$object->id;
  35. $head[$h][1] = $langs->trans("Establishment");
  36. $head[$h][2] = 'card';
  37. $h++;
  38. // Show more tabs from modules
  39. // Entries must be declared in modules descriptor with line
  40. // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
  41. // $this->tabs = array('entity:-tabname); to remove a tab
  42. complete_head_from_modules($conf, $langs, $object, $head, $h, 'establishment');
  43. $head[$h][0] = DOL_URL_ROOT.'/hrm/establishment/info.php?id='.$object->id;
  44. $head[$h][1] = $langs->trans("Info");
  45. $head[$h][2] = 'info';
  46. $h++;
  47. complete_head_from_modules($conf, $langs, $object, $head, $h, 'establishment', 'remove');
  48. return $head;
  49. }
  50. /**
  51. * Return array head with list of tabs to view object informations
  52. *
  53. * @return array head
  54. */
  55. function hrm_admin_prepare_head()
  56. {
  57. global $langs, $conf, $user;
  58. $langs->load('hrm');
  59. $h = 0;
  60. $head = array();
  61. $head[$h][0] = DOL_URL_ROOT.'/hrm/admin/admin_hrm.php';
  62. $head[$h][1] = $langs->trans("Parameters");
  63. $head[$h][2] = 'parameters';
  64. $h++;
  65. $head[$h][0] = DOL_URL_ROOT.'/hrm/admin/admin_establishment.php';
  66. $head[$h][1] = $langs->trans("Establishments");
  67. $head[$h][2] = 'establishments';
  68. $h++;
  69. // Show more tabs from modules
  70. // Entries must be declared in modules descriptor with line
  71. // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
  72. // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
  73. complete_head_from_modules($conf, $langs, null, $head, $h, 'hrm_admin');
  74. complete_head_from_modules($conf, $langs, null, $head, $h, 'hrm_admin', 'remove');
  75. return $head;
  76. }