2015-10-10 06:38:42 +02:00
|
|
|
<?php
|
2019-01-28 21:39:22 +01:00
|
|
|
/* Copyright (C) 2015 Alexandre Spangaro <aspangaro@open-dsi.fr>
|
2024-09-23 00:37:30 +02:00
|
|
|
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
2015-10-10 06:38:42 +02:00
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2019-09-23 21:55:30 +02:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2015-10-10 06:38:42 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \file htdocs/core/lib/hrm.lib.php
|
|
|
|
|
* \ingroup HRM
|
2018-07-26 19:05:34 +02:00
|
|
|
* \brief Library for hrm
|
2015-10-10 06:38:42 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Return head table for establishment tabs screen
|
|
|
|
|
*
|
|
|
|
|
* @param Establishment $object Object related to tabs
|
2024-09-23 00:37:30 +02:00
|
|
|
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
|
2015-10-10 06:38:42 +02:00
|
|
|
*/
|
|
|
|
|
function establishment_prepare_head($object)
|
|
|
|
|
{
|
|
|
|
|
global $langs, $conf;
|
|
|
|
|
|
2019-07-20 16:22:00 +02:00
|
|
|
$langs->load('hrm');
|
|
|
|
|
|
2015-10-10 06:38:42 +02:00
|
|
|
$h = 0;
|
|
|
|
|
$head = array();
|
|
|
|
|
|
2020-04-10 10:59:32 +02:00
|
|
|
$head[$h][0] = DOL_URL_ROOT.'/hrm/establishment/card.php?id='.$object->id;
|
2020-05-17 13:34:16 +02:00
|
|
|
$head[$h][1] = $langs->trans("Establishment");
|
2015-10-10 06:38:42 +02:00
|
|
|
$head[$h][2] = 'card';
|
|
|
|
|
$h++;
|
|
|
|
|
|
|
|
|
|
// Show more tabs from modules
|
|
|
|
|
// Entries must be declared in modules descriptor with line
|
2020-09-07 10:18:17 +02:00
|
|
|
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
|
|
|
|
// $this->tabs = array('entity:-tabname); to remove a tab
|
2019-01-27 11:55:16 +01:00
|
|
|
complete_head_from_modules($conf, $langs, $object, $head, $h, 'establishment');
|
2015-10-10 06:38:42 +02:00
|
|
|
|
2020-04-10 10:59:32 +02:00
|
|
|
$head[$h][0] = DOL_URL_ROOT.'/hrm/establishment/info.php?id='.$object->id;
|
2015-10-10 06:38:42 +02:00
|
|
|
$head[$h][1] = $langs->trans("Info");
|
|
|
|
|
$head[$h][2] = 'info';
|
|
|
|
|
$h++;
|
|
|
|
|
|
2021-09-27 11:20:38 +02:00
|
|
|
complete_head_from_modules($conf, $langs, null, $head, $h, 'hrm');
|
|
|
|
|
|
2022-09-22 14:06:50 +02:00
|
|
|
complete_head_from_modules($conf, $langs, $object, $head, $h, 'establishment', 'remove');
|
|
|
|
|
|
2015-10-10 06:38:42 +02:00
|
|
|
return $head;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2024-01-13 19:48:20 +01:00
|
|
|
* Return array head with list of tabs to view object information
|
2015-10-10 06:38:42 +02:00
|
|
|
*
|
2024-10-14 01:59:44 +02:00
|
|
|
* @return array<array{0:string,1:string,2:string}> Array of tabs to show
|
2015-10-10 06:38:42 +02:00
|
|
|
*/
|
|
|
|
|
function hrm_admin_prepare_head()
|
|
|
|
|
{
|
2023-06-16 01:36:46 +02:00
|
|
|
global $langs, $conf;
|
2015-10-10 06:38:42 +02:00
|
|
|
|
2020-09-07 10:18:17 +02:00
|
|
|
$langs->load('hrm');
|
2019-07-20 16:22:00 +02:00
|
|
|
|
2020-09-07 10:18:17 +02:00
|
|
|
$h = 0;
|
|
|
|
|
$head = array();
|
2015-10-10 06:38:42 +02:00
|
|
|
|
|
|
|
|
$head[$h][0] = DOL_URL_ROOT.'/hrm/admin/admin_hrm.php';
|
2020-09-07 10:18:17 +02:00
|
|
|
$head[$h][1] = $langs->trans("Parameters");
|
|
|
|
|
$head[$h][2] = 'parameters';
|
|
|
|
|
$h++;
|
2015-10-10 06:38:42 +02:00
|
|
|
|
|
|
|
|
$head[$h][0] = DOL_URL_ROOT.'/hrm/admin/admin_establishment.php';
|
2020-09-07 10:18:17 +02:00
|
|
|
$head[$h][1] = $langs->trans("Establishments");
|
|
|
|
|
$head[$h][2] = 'establishments';
|
|
|
|
|
$h++;
|
2015-10-10 06:38:42 +02:00
|
|
|
|
2020-09-07 10:18:17 +02:00
|
|
|
// Show more tabs from modules
|
|
|
|
|
// Entries must be declared in modules descriptor with line
|
|
|
|
|
// $this->tabs = array('entity:+tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to add new tab
|
|
|
|
|
// $this->tabs = array('entity:-tabname:Title:@mymodule:/mymodule/mypage.php?id=__ID__'); to remove a tab
|
|
|
|
|
complete_head_from_modules($conf, $langs, null, $head, $h, 'hrm_admin');
|
2015-10-10 06:38:42 +02:00
|
|
|
|
2020-09-07 10:18:17 +02:00
|
|
|
complete_head_from_modules($conf, $langs, null, $head, $h, 'hrm_admin', 'remove');
|
2015-10-10 06:38:42 +02:00
|
|
|
|
2020-09-07 10:18:17 +02:00
|
|
|
return $head;
|
2015-10-10 06:38:42 +02:00
|
|
|
}
|