mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-10-12 15:04:04 +00:00
excluding zeitverfugbarkeit option from zeitsperren dropdown
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user