added faulty owner view
This commit is contained in:
@@ -30,6 +30,7 @@ class ConstructionConsentController extends mfBaseController {
|
||||
}
|
||||
|
||||
$filter = [];
|
||||
$hasFaultyEntries = false;
|
||||
|
||||
if(is_array($this->request->filter)) {
|
||||
$filter = $this->request->filter;
|
||||
@@ -41,6 +42,7 @@ class ConstructionConsentController extends mfBaseController {
|
||||
} else {
|
||||
$_SESSION[MFAPPNAME . '-ConstructionConsent-filter-project-' . $filter["project_id"]] = $filter;
|
||||
}
|
||||
$hasFaultyEntries = ConstructionConsentProject::hasFaultyOwnerEntries($filter["project_id"]);
|
||||
} else {
|
||||
$_SESSION[MFAPPNAME . '-ConstructionConsent-filter'] = $filter;
|
||||
}
|
||||
@@ -59,6 +61,7 @@ class ConstructionConsentController extends mfBaseController {
|
||||
//var_dump($_SESSION, $filter);exit;
|
||||
|
||||
$this->layout->set("allowed_projects", $this->constructionConsentProjects);
|
||||
$this->layout->set("hasFaultyEntries", $hasFaultyEntries);
|
||||
$this->layout->set("filter", $filter);
|
||||
$filter = $this->getPreparedFilter($filter);
|
||||
|
||||
@@ -1373,4 +1376,37 @@ class ConstructionConsentController extends mfBaseController {
|
||||
self::returnJson(["success" => true]);
|
||||
}
|
||||
|
||||
protected function faultyEntriesAction() {
|
||||
// Get project ID from request if available
|
||||
$projectId = isset($_GET['project_id']) ? intval($_GET['project_id']) : null;
|
||||
if ($projectId === null) {
|
||||
$this->layout()->setFlash("Projekt nicht gefunden", "error");
|
||||
$this->redirect("ConstructionConsentProject");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Get faulty owner entries
|
||||
$faultyEntries = ConstructionConsentProject::getFaultyOwnerEntries($projectId);
|
||||
|
||||
$JSGlobals = [
|
||||
"BASE_URL" => self::getUrl(""),
|
||||
"DASHBOARD_URL" => self::getUrl("Dashboard"),
|
||||
"MFAPPNAME" => MFAPPNAME_SLUG,
|
||||
"PAGE_TITLE" => "Fehlerhafte Einträge - Zustimmungserklärungen",
|
||||
"PATH" => [
|
||||
["text" => MFAPPNAME_SLUG, "href" => self::getUrl("Dashboard")],
|
||||
["text" => "Zustimmungserklärungen", "href" => self::getUrl("ConstructionConsent")],
|
||||
["text" => "Fehlerhafte Einträge", "href" => self::getUrl("ConstructionConsent", "faultyEntries")],
|
||||
],
|
||||
"FAULTY_ENTRIES" => $faultyEntries,
|
||||
"SELECTED_PROJECT" => $projectId,
|
||||
"IS_ADMIN" => $this->me->is("Admin"),
|
||||
];
|
||||
|
||||
$this->layout()->set("vueViewName", "ConstructionConsentFaultyEntries");
|
||||
$this->layout()->set("JSGlobals", $JSGlobals);
|
||||
$this->layout()->setTemplate("VueViews/Vue");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user