mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-10-12 06:54:04 +00:00
Merge branch 'master' into feature-75469/LeOptional4Projektarbeit
# Conflicts: # application/controllers/api/frontend/v1/Abgabe.php # application/controllers/api/frontend/v1/stv/Projektarbeit.php # application/models/education/Projektarbeit_model.php # public/css/Studentenverwaltung.css # public/js/components/Cis/Abgabetool/AbgabetoolAssistenz.js # public/js/components/Cis/Abgabetool/AbgabetoolMitarbeiter.js # public/js/components/Stv/Studentenverwaltung/Details/Projektarbeit/Projektarbeit.js # public/js/components/Stv/Studentenverwaltung/Details/Projektarbeit/Projektbetreuer.js
This commit is contained in:
@@ -80,7 +80,6 @@ require_once('dbupdate_3.4/61730_Dashboard_Anpassungen.php');
|
||||
require_once('dbupdate_3.4/40128_search.php');
|
||||
require_once('dbupdate_3.4/63394_Variablenbeschraenkung.php');
|
||||
require_once('dbupdate_3.4/63436_cis4_iframe_component.php');
|
||||
require_once('dbupdate_3.4/60882_lehrfaecherverteilung_favorites.php');
|
||||
require_once('dbupdate_3.4/66982_berufsschule.php');
|
||||
require_once('dbupdate_3.4/40314_electronic_onboarding_anbindung_ida.php');
|
||||
require_once('dbupdate_3.4/47972_pruefungsverwaltung_ects_angabe.php');
|
||||
@@ -96,6 +95,12 @@ require_once('dbupdate_3.4/75469_le_optional_4_projektarbeit.php');
|
||||
require_once('dbupdate_3.4/71566_studienordnungsdokument_neuer_organisationseinheitstyp_programm.php');
|
||||
require_once('dbupdate_3.4/70376_lohnguide.php');
|
||||
require_once('dbupdate_3.4/75888_reihungstest_mehrfachdurchfuehrung.php');
|
||||
require_once('dbupdate_3.4/76150_perm_other_lv_plan.php');
|
||||
require_once('dbupdate_3.4/68957_dashboard_bookmark_neue_Spalte_sort.php');
|
||||
require_once('dbupdate_3.4/68530_Dashboard_Cleanup.php');
|
||||
require_once('dbupdate_3.4/75959_StudVw_Automatische_Tags.php');
|
||||
require_once('dbupdate_3.4/76160_lvv_favorites.php');
|
||||
require_once('dbupdate_3.4/77080_tabulator_presets_table.php');
|
||||
|
||||
// *** Pruefung und hinzufuegen der neuen Attribute und Tabellen
|
||||
echo '<H2>Pruefe Tabellen und Attribute!</H2>';
|
||||
@@ -393,6 +398,7 @@ $tabellen=array(
|
||||
"public.tbl_studiengangstyp" => array("typ","bezeichnung","beschreibung","bezeichnung_mehrsprachig"),
|
||||
"public.tbl_studienjahr" => array("studienjahr_kurzbz","bezeichnung"),
|
||||
"public.tbl_studiensemester" => array("studiensemester_kurzbz","bezeichnung","start","ende","studienjahr_kurzbz","ext_id","beschreibung","onlinebewerbung"),
|
||||
"public.tbl_tabulator_presets" => array("preset_id", "benutzer_uid", "table_name", "preset_json"),
|
||||
"public.tbl_tag" => array("tag"),
|
||||
"public.tbl_variable" => array("name","uid","wert"),
|
||||
"public.tbl_variablenname" => array("name","defaultwert"),
|
||||
@@ -469,7 +475,7 @@ $tabellen=array(
|
||||
"wawi.tbl_rechnungsbetrag" => array("rechnungsbetrag_id","rechnung_id","mwst","betrag","bezeichnung","ext_id"),
|
||||
"wawi.tbl_aufteilung" => array("aufteilung_id","bestellung_id","oe_kurzbz","anteil","insertamum","insertvon","updateamum","updatevon"),
|
||||
"wawi.tbl_aufteilung_default" => array("aufteilung_id","kostenstelle_id","oe_kurzbz","anteil","insertamum","insertvon","updateamum","updatevon"),
|
||||
"dashboard.tbl_bookmark" => array("bookmark_id","uid","url","title","tag","insertamum","insertvon","updateamum","updatevon"),
|
||||
"dashboard.tbl_bookmark" => array("bookmark_id","uid","url","title","tag","insertamum","insertvon","updateamum","updatevon","sort"),
|
||||
|
||||
);
|
||||
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
/* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Christopher Hacker <[email protected]>,
|
||||
*
|
||||
* Description:
|
||||
* Cleanup Dashboard DB data
|
||||
*/
|
||||
if (! defined('DB_NAME')) exit('No direct script access allowed');
|
||||
|
||||
// Cleanup presets
|
||||
if ($result = @$db->db_query("
|
||||
SELECT 1
|
||||
FROM dashboard.tbl_dashboard_preset
|
||||
WHERE preset ? COALESCE(funktion_kurzbz, 'general')
|
||||
OR preset ? 'custom'
|
||||
LIMIT 1
|
||||
")) {
|
||||
if ($db->db_num_rows($result)) {
|
||||
$qry = "
|
||||
UPDATE dashboard.tbl_dashboard_preset
|
||||
SET preset = COALESCE(preset->COALESCE(funktion_kurzbz, 'general'), preset->'custom')->'widgets'
|
||||
WHERE preset ? COALESCE(funktion_kurzbz, 'general')
|
||||
OR preset ? 'custom'
|
||||
";
|
||||
|
||||
$result = $db->db_query($qry);
|
||||
|
||||
if (!$result) {
|
||||
echo '<strong>dashboard.tbl_dashboard_preset '.$db->db_last_error().'</strong><br>';
|
||||
} else {
|
||||
$affected_rows = $db->db_affected_rows($result);
|
||||
echo 'dashboard.tbl_dashboard_preset: ' . $affected_rows . ' rows migrated<br>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Cleanup user overrides
|
||||
if ($result = @$db->db_query("
|
||||
SELECT 1
|
||||
FROM dashboard.tbl_dashboard_benutzer_override
|
||||
WHERE EXISTS (
|
||||
SELECT 1
|
||||
FROM jsonb_each(override)
|
||||
WHERE value ? 'widgets'
|
||||
LIMIT 1
|
||||
) AND override <> '[]'::jsonb
|
||||
LIMIT 1
|
||||
")) {
|
||||
if ($db->db_num_rows($result)) {
|
||||
$qry = "
|
||||
UPDATE dashboard.tbl_dashboard_benutzer_override
|
||||
SET override = COALESCE((
|
||||
SELECT json_object_agg(key, value) FROM (
|
||||
SELECT value->'widgets' AS widgets
|
||||
FROM jsonb_each(override)
|
||||
WHERE jsonb_typeof(value->'widgets') = 'object'
|
||||
) x, jsonb_each(widgets)
|
||||
), '[]')
|
||||
WHERE EXISTS (
|
||||
SELECT 1
|
||||
FROM jsonb_each(override)
|
||||
WHERE value ? 'widgets'
|
||||
LIMIT 1
|
||||
) AND override <> '[]'::jsonb
|
||||
";
|
||||
|
||||
$result = $db->db_query($qry);
|
||||
|
||||
if (!$result) {
|
||||
echo '<strong>dashboard.tbl_dashboard_benutzer_override '.$db->db_last_error().'</strong><br>';
|
||||
} else {
|
||||
$affected_rows = $db->db_affected_rows($result);
|
||||
echo 'dashboard.tbl_dashboard_benutzer_override: ' . $affected_rows . ' rows migrated<br>';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
if (! defined('DB_NAME')) exit('No direct script access allowed');
|
||||
|
||||
//Add column sort to dashboard.tbl_bookmark
|
||||
if(!@$db->db_query("SELECT sort FROM dashboard.tbl_bookmark LIMIT 1")) {
|
||||
$qry = "ALTER TABLE dashboard.tbl_bookmark ADD COLUMN sort integer DEFAULT NULL;
|
||||
COMMENT ON COLUMN dashboard.tbl_bookmark.sort IS 'Sort Index for Bookmark.';
|
||||
";
|
||||
|
||||
if (!$db->db_query($qry))
|
||||
echo '<strong>dashboard.tbl_bookmark ' . $db->db_last_error() . '</strong><br>';
|
||||
else
|
||||
echo '<br>Spalte sort zu Tabelle dashboard.tbl_bookmark hinzugefügt';
|
||||
|
||||
//add preliminary Sort for all bookmarks if NULL
|
||||
if(@$db->db_query("SELECT sort FROM dashboard.tbl_bookmark LIMIT 1")) {
|
||||
$qry = "WITH ranked AS (
|
||||
SELECT
|
||||
t1.bookmark_id,
|
||||
(
|
||||
SELECT COUNT(*)
|
||||
FROM dashboard.tbl_bookmark t2
|
||||
WHERE t2.uid = t1.uid
|
||||
AND t2.bookmark_id <= t1.bookmark_id
|
||||
) AS rn
|
||||
FROM dashboard.tbl_bookmark t1
|
||||
)
|
||||
UPDATE dashboard.tbl_bookmark t
|
||||
SET sort = ranked.rn
|
||||
FROM ranked
|
||||
WHERE t.bookmark_id = ranked.bookmark_id
|
||||
AND t.sort IS NULL;";
|
||||
|
||||
if (!$db->db_query($qry))
|
||||
echo '<strong>dashboard.tbl_bookmark ' . $db->db_last_error() . '</strong><br>';
|
||||
else
|
||||
echo '<br>Tabelle dashboard.tbl_bookmark: Spalte sort mit vorläufiger Sortierung befüllt';
|
||||
}
|
||||
}
|
||||
|
||||
//set column tag to type JSONB
|
||||
if($result = @$db->db_query("SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA='dashboard'
|
||||
AND TABLE_NAME='tbl_bookmark' AND COLUMN_NAME = 'tag'
|
||||
AND DATA_TYPE='character varying' AND character_maximum_length='255';"))
|
||||
{
|
||||
if($db->db_num_rows($result) > 0)
|
||||
{
|
||||
$qry = "
|
||||
ALTER TABLE dashboard.tbl_bookmark
|
||||
ALTER COLUMN tag TYPE jsonb
|
||||
USING tag::jsonb;
|
||||
";
|
||||
|
||||
if (!$db->db_query($qry))
|
||||
echo '<strong>dashboard.tbl_bookmark ' . $db->db_last_error() . '</strong><br>';
|
||||
else
|
||||
echo '<br>Tabelle dashboard.tbl_bookmark: Spalte tag auf Typ JSONB geändert';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
<?php
|
||||
if (! defined('DB_NAME')) exit('No direct script access allowed');
|
||||
|
||||
//Add column entwicklungs_id to bis.tbl_entwicklungsteam
|
||||
if(!@$db->db_query("SELECT taglib FROM public.tbl_notiz_typ LIMIT 1"))
|
||||
{
|
||||
$qry = 'ALTER TABLE public.tbl_notiz_typ ADD COLUMN taglib character varying(32);';
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong> public.tbl_notiz_typ '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>public.tbl_notiz_typ: Neue Spalte taglib hinzugefügt';
|
||||
}
|
||||
|
||||
//automatic tags anlegen
|
||||
$tags = [
|
||||
[
|
||||
'typ_kurzbz' => 'wh_auto',
|
||||
'bezeichnung' => '{WH, WH}',
|
||||
'style' => 'tag_dark_grey',
|
||||
'prioritaet' => 11,
|
||||
'taglib' => 'tags/CoreWiederholerTagLib'
|
||||
],
|
||||
[
|
||||
'typ_kurzbz' => 'dd_auto',
|
||||
'bezeichnung' => '{DD, DD}',
|
||||
'style' => 'tag_braun',
|
||||
'prioritaet' => 10,
|
||||
'taglib' => 'tags/CoreDoubleDegreeTagLib'
|
||||
],
|
||||
[
|
||||
'typ_kurzbz' => 'out_auto',
|
||||
'bezeichnung' => '{Outgoing, Outgoing}',
|
||||
'style' => 'tag_limette',
|
||||
'prioritaet' => 12,
|
||||
'taglib' => 'tags/CoreOutgoingTagLib'
|
||||
],
|
||||
[
|
||||
'typ_kurzbz' => 'prewh_auto',
|
||||
'bezeichnung' => '{Pre-WH, pre-WH}',
|
||||
'style' => 'tag_light_grey',
|
||||
'prioritaet' => 13,
|
||||
'taglib' => 'tags/CorePrewiederholerTagLib'
|
||||
],
|
||||
[
|
||||
'typ_kurzbz' => 'zgv_auto',
|
||||
'bezeichnung' => '{ZGV offen, ZGV missing}',
|
||||
'style' => 'tag_beige',
|
||||
'prioritaet' => 14,
|
||||
'taglib' => 'tags/CoreMissingZgvTagLib'
|
||||
],
|
||||
[
|
||||
'typ_kurzbz' => 'unterbrecher_auto',
|
||||
'bezeichnung' => '{UB, UB}',
|
||||
'style' => 'tag_turquoise',
|
||||
'prioritaet' => 15,
|
||||
'taglib' => 'tags/CoreUnterbrecherTagLib'
|
||||
],
|
||||
[
|
||||
'typ_kurzbz' => 'stbtr_erh_auto',
|
||||
'bezeichnung' => '{erh.Studienbeitrag, Incr. Tuition Fees}',
|
||||
'style' => 'tag_bordeaux',
|
||||
'prioritaet' => 16,
|
||||
'taglib' => 'tags/CoreStbErhoehtTagLib'
|
||||
],
|
||||
[
|
||||
'typ_kurzbz' => 'jgv_auto',
|
||||
'bezeichnung' => '{JGV, YGR}',
|
||||
'style' => 'tag_olive',
|
||||
'prioritaet' => 17,
|
||||
'taglib' => 'tags/CoreJgvTagLib'
|
||||
],
|
||||
[
|
||||
'typ_kurzbz' => 'preabbr_auto',
|
||||
'bezeichnung' => '{Pre-Abbr, pre-Abbr}',
|
||||
'style' => 'tag_blush',
|
||||
'prioritaet' => 18,
|
||||
'taglib' => 'tags/CorePreabbrecherTagLib'
|
||||
],
|
||||
[
|
||||
'typ_kurzbz' => 'in_auto',
|
||||
'bezeichnung' => '{Incoming, Incoming}',
|
||||
'style' => 'tag_skyblue',
|
||||
'prioritaet' => 19,
|
||||
'taglib' => 'tags/CoreIncomingTagLib'
|
||||
],
|
||||
|
||||
];
|
||||
|
||||
foreach ($tags as $tag) {
|
||||
|
||||
$checkQry = "
|
||||
SELECT 1
|
||||
FROM public.tbl_notiz_typ
|
||||
WHERE typ_kurzbz = '".$tag['typ_kurzbz']."'
|
||||
";
|
||||
|
||||
if ($result = $db->db_query($checkQry)) {
|
||||
|
||||
if ($db->db_num_rows($result) == 0) {
|
||||
|
||||
$qry = "
|
||||
INSERT INTO public.tbl_notiz_typ
|
||||
(
|
||||
typ_kurzbz,
|
||||
bezeichnung_mehrsprachig,
|
||||
automatisiert,
|
||||
aktiv,
|
||||
tag,
|
||||
style,
|
||||
vorrueckung,
|
||||
prioritaet,
|
||||
taglib
|
||||
)
|
||||
VALUES
|
||||
(
|
||||
'".$tag['typ_kurzbz']."',
|
||||
'".$tag['bezeichnung']."',
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'".$tag['style']."',
|
||||
false,
|
||||
'".$tag['prioritaet']."',
|
||||
'".$tag['taglib']."'
|
||||
)
|
||||
";
|
||||
|
||||
if (!$db->db_query($qry))
|
||||
{
|
||||
echo '<strong>public.tbl_notiz_typ: '. $tag['typ_kurzbz']. ' '. $db->db_last_error().'</strong><br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<br>public.tbl_notiz_typ: Automatic Tag '.$tag['typ_kurzbz'].' hinzugefuegt';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
/* Copyright (C) 2017 fhcomplete.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
* Authors: Harald Bamberger <[email protected]>,
|
||||
*
|
||||
* Beschreibung:
|
||||
* Permission basis/other_lv_plan
|
||||
*/
|
||||
if (! defined('DB_NAME')) exit('No direct script access allowed');
|
||||
|
||||
// Add permission: basis/gehaelter
|
||||
if($result = @$db->db_query("SELECT 1 FROM system.tbl_berechtigung WHERE berechtigung_kurzbz = 'basis/other_lv_plan';"))
|
||||
{
|
||||
if($db->db_num_rows($result) == 0)
|
||||
{
|
||||
$qry = "INSERT INTO system.tbl_berechtigung(berechtigung_kurzbz, beschreibung) VALUES('basis/other_lv_plan', 'Permission holder can view other users timetables (LV plans)');";
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
{
|
||||
echo '<strong>system.tbl_berechtigung '.$db->db_last_error().'</strong><br>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo 'system.tbl_berechtigung: Added permission "basis/other_lv_plan"<br>';
|
||||
}
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -2,15 +2,15 @@
|
||||
if (!defined('DB_NAME')) exit('No direct script access allowed');
|
||||
|
||||
// Add new name type in public.tbl_variablenname
|
||||
if ($result = @$db->db_query("SELECT 1 FROM public.tbl_variablenname WHERE name = 'lv_favorites';"))
|
||||
if ($result = @$db->db_query("SELECT 1 FROM public.tbl_variablenname WHERE name = 'lvv_favorites';"))
|
||||
{
|
||||
if ($db->db_num_rows($result) == 0)
|
||||
{
|
||||
$qry = "INSERT INTO public.tbl_variablenname(name, defaultwert) VALUES('lv_favorites', null);";
|
||||
$qry = "INSERT INTO public.tbl_variablenname(name, defaultwert) VALUES('lvv_favorites', null);";
|
||||
|
||||
if (!$db->db_query($qry))
|
||||
echo '<strong>public.tbl_variablenname '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo 'public.tbl_variablenname: Added name "lv_favorites"<br>';
|
||||
echo 'public.tbl_variablenname: Added name "lvv_favorites"<br>';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
if (!defined('DB_NAME'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
if (!$result = @$db->db_query("SELECT 1 FROM public.tbl_tabulator_presets LIMIT 1")) {
|
||||
$qry = "CREATE TABLE public.tbl_tabulator_presets (
|
||||
preset_id int NOT NULL,
|
||||
benutzer_uid varchar(33) NOT NULL,
|
||||
table_name varchar(255) NOT NULL,
|
||||
preset_name varchar(255) NOT NULL,
|
||||
preset_json varchar(10000) NOT NULL,
|
||||
CONSTRAINT tbl_tabulator_presets_preset_id_pk PRIMARY KEY(preset_id),
|
||||
CONSTRAINT tbl_tabulator_presets_benutzer_uid_fk FOREIGN KEY (benutzer_uid) REFERENCES public.tbl_benutzer(uid)
|
||||
);";
|
||||
|
||||
if (!$db->db_query($qry))
|
||||
echo '<strong>public.tbl_tabulator_presets: ' . $db->db_last_error() . '</strong><br>';
|
||||
else
|
||||
echo '<br>public.tbl_tabulator_presets: table created';
|
||||
|
||||
|
||||
$db->db_query('CREATE SEQUENCE IF NOT EXISTS public.seq_tbl_tabulator_presets_preset_id
|
||||
INCREMENT BY 1
|
||||
NO MAXVALUE
|
||||
NO MINVALUE
|
||||
CACHE 1;');
|
||||
|
||||
$db->db_query("ALTER TABLE public.tbl_tabulator_presets ALTER COLUMN preset_id SET DEFAULT nextval('public.seq_tbl_tabulator_presets_preset_id');");
|
||||
|
||||
|
||||
$qry = 'GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.tbl_tabulator_presets TO web;';
|
||||
if (!$db->db_query($qry))
|
||||
echo '<strong>public.tbl_tabulator_presets: ' . $db->db_last_error() . '</strong><br>';
|
||||
else
|
||||
echo '<br>Granted privileges to <strong>web</strong> on public.tbl_tabulator_presets';
|
||||
|
||||
$qry = 'GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE public.tbl_tabulator_presets TO vilesci;';
|
||||
if (!$db->db_query($qry))
|
||||
echo '<strong>public.tbl_tabulator_presets: ' . $db->db_last_error() . '</strong><br>';
|
||||
else
|
||||
echo '<br>Granted privileges to <strong>vilesci</strong> on public.tbl_tabulator_presets';
|
||||
|
||||
$qry = 'GRANT USAGE ON public.seq_tbl_tabulator_presets_preset_id TO web;';
|
||||
if (!$db->db_query($qry))
|
||||
echo '<strong>public.tbl_tabulator_presets: ' . $db->db_last_error() . '</strong><br>';
|
||||
else
|
||||
echo '<br>Granted privileges to <strong>web</strong> on public.tbl_tabulator_presets';
|
||||
|
||||
$qry = 'GRANT USAGE ON public.seq_tbl_tabulator_presets_preset_id TO vilesci;';
|
||||
if (!$db->db_query($qry))
|
||||
echo '<strong>public.tbl_tabulator_presets: ' . $db->db_last_error() . '</strong><br>';
|
||||
else
|
||||
echo '<br>Granted privileges to <strong>vilesci</strong> on public.tbl_tabulator_presets';
|
||||
}
|
||||
+4175
-1
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user