Merge branch 'ConstructionConsent/add-new-features' into 'master'

added new features

See merge request fronk/thetool!1435
This commit is contained in:
Luca Haid
2025-06-11 10:24:07 +00:00
6 changed files with 129 additions and 1 deletions
@@ -637,6 +637,15 @@ FROM ConstructionConsent
}
}
if(array_key_exists("prioritize", $filter)) {
$approve_override = $filter["prioritize"];
if($approve_override == "!NULL") {
$where .= " AND (prioritize IS NOT NULL AND prioritize != 0)";
} elseif($approve_override == "NULL") {
$where .= " AND (prioritize IS NULL OR prioritize = 0)";
}
}
if(array_key_exists("conduit_installed_ftu", $filter)) {
$conduit_installed_ftu = $filter["conduit_installed_ftu"];
if($conduit_installed_ftu == "!NULL") {
@@ -1078,6 +1078,21 @@ class ConstructionConsentController extends mfBaseController {
}
protected function prioritizeAction() {
$consent_id = $this->request->consent_id;
$checked = $this->request->checked;
$consent = new ConstructionConsent($consent_id);
if(!$consent->id) {
$this->returnJson(["status" => "error"]);
}
$consent->update(["prioritize" => $checked]);
$consent->save();
$this->returnJson(["status" => "OK"]);
}
protected function importConstructionConsentOwnersAction() {
$projectId = $this->request->project_id;
$importData = json_decode(file_get_contents('php://input'), true);