Merge branch 'master' into feature-67484/lvverwaltung_finetunning

This commit is contained in:
Andreas Österreicher
2025-10-20 11:33:43 +02:00
68 changed files with 3083 additions and 340 deletions
+13 -12
View File
@@ -1,7 +1,7 @@
<?php
/**
* Copyright (C) 2022 fhcomplete.org
* Copyright (C) 2025 fhcomplete.org
*
* 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
@@ -177,7 +177,7 @@ class FilterCmptLib
$session = $this->getSession();
// If session is NOT empty -> a filter was already loaded
if ($session != null)
if (!isError($session) && $session != null)
{
// Retrieve the filterId stored in the session
$sessionFilterId = $this->_getSessionElement(FilterCmptLib::FILTER_ID);
@@ -219,9 +219,7 @@ class FilterCmptLib
}
}
}
// If the session is empty -> first time that this filter is loaded
if ($session == null)
else
{
// Load filter definition data from DB
$definition = $this->_loadDefinition(
@@ -602,7 +600,7 @@ class FilterCmptLib
{
$session = getSessionElement(self::SESSION_NAME, $this->_filterUniqueId);
if (isset($session[$name]))
if (!isError($session) && isset($session[$name]))
{
return $session[$name];
}
@@ -623,7 +621,7 @@ class FilterCmptLib
if (!$this->_ci->permissionlib->hasAtLeastOne($this->_requiredPermissions, self::PERMISSION_FILTER_METHOD, self::PERMISSION_TYPE))
{
$this->_setSession(error('The required permission is not help by the logged user'));
$this->_setSession(error('The required permission is not held by the logged user'));
return false;
}
@@ -904,7 +902,7 @@ class FilterCmptLib
$filterCmptsSession = getSession(self::SESSION_NAME);
// If something is present in session
if ($filterCmptsSession != null)
if (!isError($filterCmptsSession) && $filterCmptsSession != null)
{
// Loops in the session for all the filter components
foreach ($filterCmptsSession as $filterCmpt => $filterCmptData)
@@ -951,9 +949,11 @@ class FilterCmptLib
{
$session = getSessionElement(self::SESSION_NAME, $this->_filterUniqueId);
$session[$name] = $value;
setSessionElement(self::SESSION_NAME, $this->_filterUniqueId, $session); // stores the single value
if (!isError($session) && $session != null)
{
$session[$name] = $value;
setSessionElement(self::SESSION_NAME, $this->_filterUniqueId, $session); // stores the single value
}
}
/**
@@ -965,7 +965,7 @@ class FilterCmptLib
$filterCmptsSession = getSession(self::SESSION_NAME);
// If something is present in session
if ($filterCmptsSession != null)
if (!isError($filterCmptsSession) && $filterCmptsSession != null)
{
// Loops in the session for all the filter components
foreach ($filterCmptsSession as $filterCmpt => $filterCmptData)
@@ -1174,3 +1174,4 @@ class FilterCmptLib
return $filterName;
}
}
+13 -4
View File
@@ -183,7 +183,10 @@ class ProfilLib{
$zutrittskarte_ausgegebenam = $zutrittskarte_ausgegebenam ? current($zutrittskarte_ausgegebenam)->ausgegebenam : null;
//? formats date from 01-01-2000 to 01.01.2000
$zutrittskarte_ausgegebenam = str_replace("-", ".", $zutrittskarte_ausgegebenam);
if ($zutrittskarte_ausgegebenam !== NULL)
{
$zutrittskarte_ausgegebenam = (new DateTime($zutrittskarte_ausgegebenam))->format('d.m.Y');
}
return $zutrittskarte_ausgegebenam;
}
@@ -196,7 +199,7 @@ class ProfilLib{
private function getAdressenInfo($pid)
{
$this->ci->load->model("person/Adresse_model","AdresseModel");
$adresse_res = $this->ci->AdresseModel->addSelect(["adresse_id", "strasse", "tbl_adressentyp.bezeichnung as typ", "plz", "ort", "zustelladresse", "gemeinde", "nation"]);
$adresse_res = $this->ci->AdresseModel->addSelect(["adresse_id", "strasse", "tbl_adressentyp.bezeichnung as typ", "plz", "ort", "heimatadresse", "zustelladresse", "gemeinde", "nation"]);
$adresse_res = $this->ci->AdresseModel->addOrder("zustelladresse", "DESC");
$adresse_res = $this->ci->AdresseModel->addJoin("tbl_adressentyp", "typ=adressentyp_kurzbz");
@@ -214,7 +217,7 @@ class ProfilLib{
* @param integer $uid the userID used to get the kontakt information
* @return array all the kontakt information corresponding to a userID
*/
private function getKontaktInfo($pid)
private function getKontaktInfo($pid, $includehidden=false)
{
$this->ci->load->model("person/Kontakt_model","KontaktModel");
$this->ci->KontaktModel->addSelect(['kontakttyp', 'kontakt_id', 'kontakt', 'tbl_kontakt.anmerkung', 'tbl_kontakt.zustellung']);
@@ -222,7 +225,13 @@ class ProfilLib{
$this->ci->KontaktModel->addJoin('public.tbl_firma', 'firma_id', 'LEFT');
$this->ci->KontaktModel->addOrder('kontakttyp, kontakt, tbl_kontakt.updateamum, tbl_kontakt.insertamum');
$kontakte_res = $this->ci->KontaktModel->loadWhere(['person_id' => $pid]);
$params = array('person_id' => $pid);
if(!$includehidden)
{
$params['kontakttyp <>'] = 'hidden';
}
$kontakte_res = $this->ci->KontaktModel->loadWhere($params);
if(isError($kontakte_res)){
return error(getData($kontakte_res));
}
+4 -3
View File
@@ -229,9 +229,10 @@ class StundenplanLib
$this->_ci->load->model('ressource/Stundenplan_model', 'StundenplanModel');
$is_mitarbeiter = getData($this->_ci->MitarbeiterModel->isMitarbeiter(getAuthUID()));
if ($is_mitarbeiter) {
$reservierungen = $this->_ci->ReservierungModel->getReservierungenMitarbeiter($start_date, $end_date, $ort_kurzbz);
if ($is_mitarbeiter && empty($ort_kurzbz)) {
// request for personal lvplan show only reservations of logged in user
$reservierungen = $this->_ci->ReservierungModel->getReservierungenMitarbeiter($start_date, $end_date);
} else {
// querying the reservierungen
$reservierungen = $this->_ci->ReservierungModel->getReservierungen($start_date, $end_date, $ort_kurzbz);