hrm.lib.php 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. $head[$h][0] = dol_buildpath("/hrm/admin/setup.php", 1);
  48. $head[$h][1] = $langs->trans("Settings");
  49. $head[$h][2] = 'settings';
  50. $h++;
  51. $head[$h][0] = dol_buildpath("/hrm/admin/about.php", 1);
  52. $head[$h][1] = $langs->trans("About");
  53. $head[$h][2] = 'about';
  54. $h++;
  55. complete_head_from_modules($conf, $langs, null, $head, $h, 'hrm');
  56. complete_head_from_modules($conf, $langs, $object, $head, $h, 'establishment', 'remove');
  57. return $head;
  58. }
  59. /**
  60. * Return array head with list of tabs to view object informations
  61. *
  62. * @return array head
  63. */
  64. function hrm_admin_prepare_head()
  65. {
  66. global $langs, $conf, $user;
  67. $langs->load('hrm');
  68. $h = 0;
  69. $head = array();
  70. $head[$h][0] = DOL_URL_ROOT.'/hrm/admin/admin_hrm.php';
  71. $head[$h][1] = $langs->trans("Parameters");
  72. $head[$h][2] = 'parameters';
  73. $h++;
  74. $head[$h][0] = DOL_URL_ROOT.'/hrm/admin/admin_establishment.php';
  75. $head[$h][1] = $langs->trans("Establishments");
  76. $head[$h][2] = 'establishments';
  77. $h++;
  78. // Show more tabs from modules
  79. // Entries must be declared in modules descriptor with line
  80. // $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
  81. // $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
  82. complete_head_from_modules($conf, $langs, null, $head, $h, 'hrm_admin');
  83. complete_head_from_modules($conf, $langs, null, $head, $h, 'hrm_admin', 'remove');
  84. return $head;
  85. }