From a8dd99519515f91a1f7d769872d0e31cae0182ce Mon Sep 17 00:00:00 2001 From: ma0068 Date: Wed, 22 Jul 2026 14:11:07 +0200 Subject: [PATCH] rebuild tags for whole studiengang / selection refactor backend for multiaction rebuildTags add phrases refactor haederFilter --- application/core/Tag_Controller.php | 21 ++- .../components/DetailHeader/DetailHeader.js | 4 +- .../Stv/Studentenverwaltung/List.js | 69 +++++++++- .../Studentenverwaltung/List/ModalLoading.js | 69 ++++++++++ system/phrasesupdate.php | 123 ++++++++++++++++++ 5 files changed, 278 insertions(+), 8 deletions(-) create mode 100644 public/js/components/Stv/Studentenverwaltung/List/ModalLoading.js diff --git a/application/core/Tag_Controller.php b/application/core/Tag_Controller.php index 0600200c8..cb7deda82 100644 --- a/application/core/Tag_Controller.php +++ b/application/core/Tag_Controller.php @@ -344,16 +344,27 @@ class Tag_Controller extends FHCAPI_Controller public function rebuildTagsForTypeId() { - $id = $this->input->post('id'); + $ids = $this->input->post('ids'); $typeId = $this->input->post('typeId'); $semester = $this->input->post('sem'); - $result = $this->taglib->rebuildTagsForTypeId($typeId, $id, $semester); + $idsSuccess = []; + $idsError = []; + $outputResult = []; - if (isError($result)) - return error ('Error occurred during updateAutomatedTags'); + foreach ($ids as $id) + { + $result = $this->taglib->rebuildTagsForTypeId($typeId, $id, $semester); - $this->terminateWithSuccess($result); + if (isError($result)) + $idsError[] = $id; + else + $idsSuccess[] = $id; + + $outputResult[] = $result; + } + + $this->terminateWithSuccess([$outputResult, $idsSuccess, $idsError]); } private function _setAuthUID() diff --git a/public/js/components/DetailHeader/DetailHeader.js b/public/js/components/DetailHeader/DetailHeader.js index 84e462df3..8bf1fe2be 100644 --- a/public/js/components/DetailHeader/DetailHeader.js +++ b/public/js/components/DetailHeader/DetailHeader.js @@ -315,8 +315,10 @@ export default { this.reload(); }, rebuildPrestudentTags(){ + const id = [this.headerData[0].prestudent_id]; + const params = { - id : this.headerData[0].prestudent_id, + ids: id, typeId: 'prestudent_id', sem: this.currentSemester }; diff --git a/public/js/components/Stv/Studentenverwaltung/List.js b/public/js/components/Stv/Studentenverwaltung/List.js index 56a6a5334..f9abb3558 100644 --- a/public/js/components/Stv/Studentenverwaltung/List.js +++ b/public/js/components/Stv/Studentenverwaltung/List.js @@ -4,6 +4,7 @@ import CoreTag from '../../Tag/Tag.js'; import { tagHeaderFilter } from "../../../tabulator/filters/extendedHeaderFilter.js"; import { addTagInTable, deleteTagInTable, updateTagInTable } from "../../../../js/helpers/TagHelper.js"; import { tagFormatter } from "../../../../js/tabulator/formatter/tags.js"; +import ModalLoading from "./List/ModalLoading.js"; import ApiTag from "../../../api/factory/stv/tag.js"; import ListFilter from './List/Filter.js'; @@ -18,7 +19,8 @@ export default { CoreFilterCmpt, ListNew, CoreTag, - ListFilter + ListFilter, + ModalLoading }, directives: { draggable @@ -246,7 +248,9 @@ export default { oldScrollUrl: '', oldScrollLeft: 0, oldScrollTop: 0, - allPrestudents: [] + allPrestudents: [], + rebuildData: [], + isLoading: false } }, computed: { @@ -646,11 +650,55 @@ export default { this.oldScrollUrl = this.$refs.table.tabulator.getAjaxUrl(); } }, + rebuild(selected){ + this.isLoading = true; + let prestudentIds = []; + this.showModal(); + if(!selected.length) + prestudentIds = this.$refs.table.tabulator + .getData() + .map(row => row.prestudent_id); + else + prestudentIds = selected.map(item => item.prestudent_id); + + const params = { + ids: prestudentIds, + typeId: 'prestudent_id', + sem: this.studiensemesterKurzbz + }; + + return this.$api + .call(ApiTag.rebuildTagsforTypeId(params)) + .then(result => { + this.rebuildData = result.data; + this.isLoading = false; + console.log("Rebuild manually triggered"); + if(this.rebuildData[1].length > 0) + { + this.$fhcAlert.alertSuccess(this.$p.t('tag', 'alertSuccessRebuild', { count: this.rebuildData[1].length })); + } + if(this.rebuildData[2].length > 0) + { + this.$fhcAlert.alertError(this.$p.t('tag', 'alertErrorRebuild') + this.rebuildData[2].toString()); + } + }) + .catch(this.$fhcAlert.handleSystemError); + }, + showModal(){ + this.$refs.modalLocked.open(); + }, }, // TODO(chris): focusin, focusout, keydown and tabindex should be in the filter component // TODO(chris): filter component column chooser has no accessibilty features template: `
+ + +
+ + +