Merge branch 'feature-25999/C4' into feature-40309/Cis_News_widget

This commit is contained in:
SimonGschnell
2024-07-24 14:40:15 +02:00
26 changed files with 1833 additions and 458 deletions
@@ -19,4 +19,28 @@ class Gemeinde_model extends DB_Model
return $this->loadWhere(array("plz" => $plz));
}
public function getGemeindeByNation($nation, $zip){
$this->addSelect(["name"]);
if ($nation == "A") {
if (isset($zip) && $zip > 999 && $zip < 32000) {
$gemeinde_res = $this->GemeindeModel->loadWhere(['plz' => $zip]);
if (isError($gemeinde_res)) {
show_error("error while trying to query bis.tbl_gemeinde");
}
$gemeinde_res = hasData($gemeinde_res) ? getData($gemeinde_res) : null;
$gemeinde_res = array_map(function ($obj) {
return $obj->name;
}, $gemeinde_res);
echo json_encode($gemeinde_res);
} else {
echo json_encode(error("ortschaftskennziffer code was not valid"));
}
} else {}
}
}
@@ -77,6 +77,21 @@ class Profil_update_model extends DB_Model
}
//? remove File from the Profil Update
public function removeFileFromProfilUpdate($dms_id)
{
if(!is_int($dms_id) || $dms_id < 0){
return error("not valid dms_id");
}
return $this->execReadOnlyQuery("
UPDATE public.tbl_profil_update
SET attachment_id = NULL
WHERE attachment_id = ?", [$dms_id]);
}
/**
* getProfilUpdateWithPermission