hrm.lib.php 2.9 KB

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