excluding zeitverfugbarkeit option from zeitsperren dropdown

This commit is contained in:
adisposkofh
2026-08-14 14:13:03 +02:00
parent 9c7e98f1cb
commit 00f07ba6f0
2 changed files with 18 additions and 2 deletions
@@ -58,8 +58,8 @@ class Zeitsperren extends FHCAPI_Controller
public function getTypenZeitsperren()
{
$this->ZeitsperretypModel->addOrder('beschreibung', 'ASC');
$result = $this->ZeitsperretypModel->load();
$excludedTypes = array('ZVerfueg');
$result = $this->ZeitsperretypModel->getTypenZeitsperren($excludedTypes);
if (isError($result)) {
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
}
@@ -11,4 +11,20 @@ class Zeitsperretyp_model extends DB_Model
$this->dbTable = 'campus.tbl_zeitsperretyp';
$this->pk = 'zeitsperretyp_kurzbz';
}
public function getTypenZeitsperren($excludedTypes = [])
{
$whereNotClause = "";
if (count($excludedTypes)) {
$excludedTypes = array_map(
function ($type) {
return "'$type'";
},
$excludedTypes
);
$excludedTypes = implode(", ", $excludedTypes);
$whereNotClause = "WHERE NOT zeitsperretyp_kurzbz IN ($excludedTypes)";
}
return $this->execQuery("SELECT * FROM $this->dbTable $whereNotClause ORDER BY beschreibung ASC");
}
}