Files
awo-hamburg-intranet/module/knowledgecenter_update/Script/Script.php
Moritz Weinmann 743476f64a Module tasks + knowledgecenter_update aus Kundenprojekt übernehmen (bereinigt)
Beide Module wurden aus einem anderen Kundenprojekt kopiert und bereinigt:

Knowledgecenter:
- Bild-Cache (1.985 Dateien) geleert, Ordnerstruktur mit .gitkeep behalten
- Files-Gallery-Lizenzschlüssel entfernt (config.php)
- Kundenspezifische Kategorien gelöscht: Teil I/II/III QM-Struktur,
  nummerierte QM-Kapitel, Gremien (Präsidium/Finanzausschuss/Landesausschuss),
  Sitzungsservice-Serie, Protokoll-Abteilungen, Testeinträge
- 56 generische Kategorien bleiben (Downloads, Onboarding, Personalthemen …)

Tasks:
- Alle Betriebsdaten gelöscht (114 Tasks, 914 Submissions, 579 Assignments)
- Task-Definitionen und Verlinkungen geleert
- Kategoriestruktur bleibt (Allgemein, IT, Personal, Buchhaltung …)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 09:20:02 +02:00

116 lines
4.3 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script>
function buildFileGalleryUrl(target, mode, ajaxFunction, nocache) {
var base = "/module/knowledgecenter_update/Plugins/filesgallery.php?";
var startPath = (typeof window.kcPostGalleryPath === "string")
? window.kcPostGalleryPath.replace(/^\/+|\/+$/g, "")
: "";
var params = "input_id=" + encodeURIComponent(target) +
"&mode=" + encodeURIComponent(mode) +
"&saveajax=" + encodeURIComponent(ajaxFunction || "") +
"&kc_lock_path=" + encodeURIComponent(startPath) +
"&nocache=" + nocache;
if (startPath.length > 0) {
return base + encodeURIComponent(startPath) + "&" + params;
}
return base + params;
}
function showMessage(message, isSuccess) {
var $msg = $("#message");
// Vorherige Animationen stoppen und Opazität zurücksetzen
$msg.stop(true, true).css("opacity", 1);
// Styling je nach Erfolg oder Fehler
if (isSuccess) {
$msg.css({
"color": "green",
"position": "relative",
"background-color": "#d4edda",
"margin-bottom": "10px",
"border": "1px solid green"
});
} else {
$msg.css({
"color": "red",
"position": "relative",
"background-color": "#f8d7da",
"margin-bottom": "10px",
"border": "1px solid red"
});
}
$msg.text(message).show();
setTimeout(function () {
$msg.animate({ opacity: 0 }, 500, function () {
$msg.hide();
});
}, 3000);
}
// Popup-Öffnen für die Files Gallery
$(".openFileGallery").on("click", function () {
var target = $(this).data("target");
// Hole den Funktionsnamen aus data-ajax-function, Standardwert falls nicht definiert:
var ajaxFunction = $(this).data("ajax-function");
var nocache = new Date().getTime(); // Erzeugt einen Zeitstempel
window.open(buildFileGalleryUrl(target, "single", ajaxFunction, nocache),
"FileGallery", "width=1000,height=600");
});
$(".openFileGalleryMulti").on("click", function () {
var target = $(this).data("target");
var ajaxFunction = $(this).data("ajax-function");
var nocache = new Date().getTime(); // Zeitstempel zur Cache-Vermeidung
window.open(buildFileGalleryUrl(target, "multi", ajaxFunction, nocache),
"FileGallery", "width=1000,height=600");
});
// Funktion, die vom Files Gallery Popup im Parent-Fenster aufgerufen wird
window.setFilePath = function (path) {
if (window.fileGalleryTarget) {
$("#" + window.fileGalleryTarget).val(path);
}
};
// Alternative setFilePath-Funktion im globalen Kontext
function setFilePath(path) {
var input = document.getElementById(input_id);
if (input) {
input.value = path;
}
}
// Event-Handler für den Clear-Button
$(document).on("click", ".clearImage", function () {
// Hole den data-target Wert z.B. "image_1"
var targetId = $(this).data("target");
// Leere das versteckte Input-Feld
$("#" + targetId).val("");
// Suche das Vorschaubild innerhalb des Containers (.single_image_group)
$(this).closest('.single_image_group').find('.preview')
.attr("src", "") // Bildquelle entfernen
.css("background-color", "#f3f3f3"); // Standardhintergrund setzen
});
$(document).ready(function () {
$('.toggle').on('click', function (e) {
e.preventDefault();
// Lese das data-toggle-target Attribut des geklickten Elements aus
var target = $(this).data('toggle-target');
if (target) {
// Suche nach allen Elementen mit dem gleichen data-toggle-target,
// schließe aber das geklickte Element (und ggf. weitere Toggle-Elemente) aus.
var $targetElements = $('[data-toggle-target="' + target + '"]').not('.toggle');
if ($targetElements.length) {
$targetElements.slideToggle();
}
}
});
});
</script>