Add tristate filter in Room manager table, add parent room short code in vilesci legacy code

This commit is contained in:
Ivymaster
2026-05-07 13:35:50 +02:00
parent 667726e23b
commit eca9b22f7d
6 changed files with 156 additions and 37 deletions
@@ -107,7 +107,7 @@ class Ort extends FHCAPI_Controller
}
foreach ($searchableBooleanAttributes as $attribute) {
if (isset($filter[$attribute]) && $filter[$attribute] !== '' && $filter[$attribute] === 'true' ) {
if (isset($filter[$attribute]) && $filter[$attribute] !== '') {
$queryWhereFragments[] = "public.tbl_ort.$attribute = ?";
$filterData[] = $filter[$attribute] === 'true' ? true : false;
}
@@ -152,9 +152,8 @@ class Ort extends FHCAPI_Controller
$pageCount = ceil($totalItems / $paginationSize);
$this->addTabulatorPaginationData($pageCount);
}
$this->terminateWithSuccess($queryData);
exit;
}
/**
@@ -132,10 +132,6 @@ export default {
if (getLocationsResponse.meta.status === "success") {
this.editedRoom = getLocationsResponse.data;
} else {
console.error(
"Error fetching room data:",
getLocationsResponse.meta.message,
);
this.$fhcAlert.alertError(this.$p.t("ui", "errorLoadingRoomData"));
return;
}
@@ -255,7 +251,7 @@ export default {
if (getRoomsResponse.meta.status === "success") {
return getRoomsResponse.data;
} else {
console.error("Error fetching rooms:", getRoomsResponse.meta.message);
this.$fhcAlert.alertError(this.$p.t("ui", "errorLoadingRooms"));
}
return [];
@@ -272,10 +268,7 @@ export default {
kurzbz: "----------",
});
} else {
console.error(
"Error fetching locations:",
getLocationsResponse.meta.message,
);
this.$fhcAlert.alertError(this.$p.t("ui", "errorLoadingLocations"));
}
let getAllOrganizationalUnitsResponse = await this.$api.call(
@@ -286,9 +279,8 @@ export default {
(a, b) => a.bezeichnung.localeCompare(b.bezeichnung),
);
} else {
console.error(
"Error fetching organizational units:",
getAllOrganizationalUnitsResponse.meta.message,
this.$fhcAlert.alertError(
this.$p.t("ui", "errorLoadingOrganizationalUnits"),
);
}
@@ -42,9 +42,9 @@ export default {
locationId: null,
organizationalUnit: null,
buildingComponent: null,
isForTrainingProgram: false,
isReservationNeeded: false,
isActive: false,
isForTrainingProgram: null,
isReservationNeeded: null,
isActive: null,
},
locations: [],
organizationalUnits: [],
@@ -107,9 +107,38 @@ export default {
let floorFilter = params?.filter?.find((filter) => filter.field === "stockwerk");
let parentRoomFilter = params?.filter?.find((filter) => filter.field === "pr_ort_kurzbz");
let isForTrainingProgramValue = this.filterData.isForTrainingProgram ? "true" : isForTrainingProgramFilter?.value ? "true" : "false";
let reservationNeededValue = this.filterData.isReservationNeeded ? "true" : reservationNeededFilter?.value ? "true" : "false";
let isActiveValue = this.filterData.isActive ? "true" : isActiveFilter?.value ? "true" : "false";
let isForTrainingProgramValue = null;
if (this.filterData.isForTrainingProgram === true) {
isForTrainingProgramValue = true;
} else {
if (isForTrainingProgramFilter?.value === true) {
isForTrainingProgramValue = true;
} else if (isForTrainingProgramFilter?.value === false) {
isForTrainingProgramValue = false;
}
}
let reservationNeededValue = null;
if (this.filterData.isReservationNeeded === true) {
reservationNeededValue = true;
} else {
if (reservationNeededFilter?.value === true) {
reservationNeededValue = true;
} else if (reservationNeededFilter?.value === false) {
reservationNeededValue = false;
}
}
let isActiveValue = null;
if (this.filterData.isActive === true) {
isActiveValue = true;
} else {
if (isActiveFilter?.value === true) {
isActiveValue = true;
} else if (isActiveFilter?.value === false) {
isActiveValue = false;
}
}
return this.$api.call(
ApiRoom.getAllRooms({
@@ -192,6 +221,9 @@ export default {
title: this.$capitalize(this.$p.t("ui", "lehre")),
field: "lehre",
headerFilter: true,
headerFilterParams: {
"tristate":true, elementAttributes:{"value":"true"}
},
formatter: "tickCross",
hozAlign: "center",
formatterParams: {
@@ -203,6 +235,9 @@ export default {
title: this.$capitalize(this.$p.t("ui", "reservieren")),
field: "reservieren",
headerFilter: true,
headerFilterParams: {
"tristate":true, elementAttributes:{"value":"true"}
},
formatter: "tickCross",
hozAlign: "center",
formatterParams: {
@@ -214,6 +249,9 @@ export default {
title: this.$capitalize(this.$p.t("gruppenmanagement", "aktiv")),
field: "aktiv",
headerFilter: true,
headerFilterParams: {
"tristate":true, elementAttributes:{"value":"true"}
},
formatter: "tickCross",
hozAlign: "center",
formatterParams: {
@@ -378,13 +416,11 @@ export default {
this.$p.t("ui", "roomDeletedSuccessfully"),
);
} else {
console.error("Error deleting room:", response.meta.message);
this.reloadTableData();
this.$fhcAlert.alertError(this.$p.t("ui", "errorDeletingRoom"));
}
})
.catch((error) => {
console.error("Error deleting room:", error);
this.$fhcAlert.alertError(this.$p.t("ui", "errorDeletingRoom"));
});
},
@@ -411,7 +447,6 @@ export default {
this.$fhcAlert.alertSuccess(this.$p.t("ui", "successUpdate"));
this.reloadTableData();
} else {
console.error("Error updating room:", response.meta.message);
this.$fhcAlert.alertError(this.$p.t("ui", "errorUpdatingRoom"));
}
},
@@ -424,10 +459,7 @@ export default {
this.locations = getLocationsResponse.data;
this.locations.unshift({ standort_id: null, kurzbz: "----------" });
} else {
console.error(
"Error fetching locations:",
getLocationsResponse.meta.message,
);
this.$fhcAlert.alertError(this.$p.t("ui", "errorLoadingLocations"));
}
let getAllOrganizationalUnitsResponse = await this.$api.call(
@@ -438,10 +470,7 @@ export default {
(a, b) => a.bezeichnung.localeCompare(b.bezeichnung),
);
} else {
console.error(
"Error fetching organizational units:",
getAllOrganizationalUnitsResponse.meta.message,
);
this.$fhcAlert.alertError(this.$p.t("ui", "errorLoadingOrganizationalUnits"));
}
},
mounted() {
@@ -245,10 +245,7 @@ export default {
if (getRoomTypesResponse.meta.status === "success") {
this.roomTypes = getRoomTypesResponse.data;
} else {
console.error(
"Error fetching room types:",
getRoomTypesResponse.meta.message,
);
this.$fhcAlert.alertError(this.$p.t("ui", "errorLoadingRoomTypes"));
}
},
},
@@ -276,7 +273,7 @@ export default {
<div class="d-flex justify-content-end mb-1">
<a
v-if="!isRoomTypeFormVisible && hasBasisOrtWPermission"
:title='$p.t("ui", "createRoomType")'
:title='$capitalize($p.t("ui", "createRoomType"))'
@click.prevent="isRoomTypeFormVisible = !isRoomTypeFormVisible"
href="#"
class="btn btn-primary rounded-circle">
+100
View File
@@ -58517,6 +58517,26 @@ I have been informed that I am under no obligation to consent to the transmissio
)
)
),
array(
'app' => 'core',
'category' => 'ui',
'phrase' => 'errorLoadingRooms',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Fehler beim Laden der Räume',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Error loading rooms',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'ui',
@@ -58977,6 +58997,86 @@ I have been informed that I am under no obligation to consent to the transmissio
)
)
),
array(
'app' => 'core',
'category' => 'ui',
'phrase' => 'errorLoadingLocations',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Fehler beim Laden der Standorte',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Error loading locations',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'ui',
'phrase' => 'errorLoadingOrganizationalUnits',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Fehler beim Laden der Organisationseinheiten',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Error loading organizational units',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'ui',
'phrase' => 'errorLoadingRoomTypes',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Fehler beim Laden der Raumtypen',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Error loading room types',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'ui',
'phrase' => 'successUpdate',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Änderungen erfolgreich gespeichert',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Changes saved successfully',
'description' => '',
'insertvon' => 'system'
)
)
),
);
+2
View File
@@ -244,6 +244,7 @@ if (isset($_GET['sendform']))
<th>Aktiv</th>
<th>Kosten</th>
<th>Stockwerk</th>
<th>Parent Ort Kurzbz</th>
</tr>
</thead>
<tbody>';
@@ -287,6 +288,7 @@ if (isset($_GET['sendform']))
$htmlstr .= " <td>".$twraum->kosten."</td>\n";
$htmlstr .= " <td>".$twraum->stockwerk."</td>\n";
$htmlstr .= " <td><a href='raum_details.php?ort_kurzbz=".$twraum->parent_ort_kurzbz."' target='detail_raum'>".$twraum->parent_ort_kurzbz."</a></td>\n";
$htmlstr .= " </tr>\n";
}