mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-25 00:24:35 +00:00
116 lines
2.9 KiB
PHP
116 lines
2.9 KiB
PHP
<?php
|
|
|
|
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
|
|
|
class MaZeitsperren extends FHCAPI_Controller
|
|
{
|
|
public function __construct()
|
|
{
|
|
parent::__construct([
|
|
'getAllActiveZeitsperren' => self::PERM_LOGGED,
|
|
'getAllZeitsperrenFixeMa' => self::PERM_LOGGED,
|
|
'getAllZeitsperrenLector' => self::PERM_LOGGED,
|
|
'getAllZeitsperrenOes' => self::PERM_LOGGED,
|
|
'getZeitsperrenAss' => self::PERM_LOGGED,
|
|
'getStgLectors' => self::PERM_LOGGED,
|
|
'loadZeitsperrenLectorStg' => self::PERM_LOGGED,
|
|
]);
|
|
|
|
// Load Libraries
|
|
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
|
$this->load->library('form_validation');
|
|
|
|
// Load language phrases
|
|
$this->loadPhrases([
|
|
'ui',
|
|
'person',
|
|
'zeitsperren'
|
|
]);
|
|
|
|
// Load models
|
|
$this->load->model('ressource/Zeitsperre_model', 'ZeitsperreModel');
|
|
}
|
|
|
|
//only user with zeitsperren
|
|
public function getAllActiveZeitsperren($days)
|
|
{
|
|
|
|
$result = $this->ZeitsperreModel->getZeitsperrenForNextDays($days);
|
|
$data = $this->getDataOrTerminateWithError($result);
|
|
|
|
$this->terminateWithSuccess($data);
|
|
}
|
|
|
|
//TODO: check query: more results after join with hr-table
|
|
//all fixe Ma
|
|
public function getAllZeitsperrenFixeMa($days)
|
|
{
|
|
$result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($days, true, false, null, false);
|
|
$data = $this->getDataOrTerminateWithError($result);
|
|
|
|
$this->terminateWithSuccess($data);
|
|
}
|
|
|
|
public function getAllZeitsperrenLector($days)
|
|
{
|
|
$result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($days, false, true, null, false);
|
|
|
|
$data = $this->getDataOrTerminateWithError($result);
|
|
|
|
$this->terminateWithSuccess($data);
|
|
}
|
|
|
|
public function getZeitsperrenAss($days)
|
|
{
|
|
$result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($days, false, false, null, true);
|
|
|
|
$data = $this->getDataOrTerminateWithError($result);
|
|
|
|
$this->terminateWithSuccess($data);
|
|
}
|
|
|
|
public function getAllZeitsperrenOes($days, $oe)
|
|
{
|
|
$result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($days, false, false, $oe, false);
|
|
|
|
$data = $this->getDataOrTerminateWithError($result);
|
|
|
|
$this->terminateWithSuccess($data);
|
|
}
|
|
|
|
public function loadZeitsperrenLectorStg($days, $stg)
|
|
{
|
|
$result = $this->ZeitsperreModel->getMitarbeiterWithZeitsperren($days, false, true, false, false, $stg);
|
|
|
|
$data = $this->getDataOrTerminateWithError($result);
|
|
|
|
$this->terminateWithSuccess($data);
|
|
}
|
|
|
|
public function getStgLectors()
|
|
{
|
|
$sql = "
|
|
select
|
|
studiengang_kz,
|
|
kurzbz,
|
|
kurzbzlang,
|
|
typ,
|
|
bezeichnung,
|
|
kurzbzlang || ' (' || bezeichnung || ')' AS label
|
|
from
|
|
public.tbl_studiengang
|
|
where
|
|
typ in ('b','m')
|
|
order by typ asc, kurzbz Asc
|
|
";
|
|
|
|
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
|
$result = $this->StudiengangModel->execReadOnlyQuery($sql);
|
|
$data = $this->getDataOrTerminateWithError($result);
|
|
|
|
$this->terminateWithSuccess($data);
|
|
}
|
|
|
|
}
|
|
|