added paabgabetyp columns "aktiv", "upload_allowed", "aktiv"; setting sensible default values for existing typen that are just the developers best guess really; accordion header with icons & tooltips; logLib in Abgabe API controller logging all successful delete/insert/update requests; show arbitrary '23:59' string after target date so it is clear until when the upload should be fulfilled, even though we still dont do anything technically different; new Termine can only be made with aktiv paabgabe typen; note & benotungsnotiz now tied to paabgabetyp benotbar flag instead of hardcoded for qgate1 & 2; added "noch nicht abgegeben" text in case the abgabedatum is null; modal now spawns in xl with fullscreen optionally enabled;

This commit is contained in:
Johann Hoffmann
2025-10-14 16:45:28 +02:00
parent 14aad56d5e
commit 0d2e41cf2f
8 changed files with 478 additions and 75 deletions
@@ -1,12 +1,59 @@
<?php
if (! defined('DB_NAME')) exit('No direct script access allowed');
// add campus.tbl_paabgabetyp options for Quality Gates
if($result = $db->db_query("SELECT 1 FROM information_schema.columns WHERE table_schema = 'campus' AND table_name = 'tbl_paabgabetyp' AND column_name = 'aktiv'"))
{
if($db->db_num_rows($result) === 0)
{
$qry = "ALTER TABLE campus.tbl_paabgabetyp
ADD COLUMN IF NOT EXISTS aktiv BOOLEAN DEFAULT true;";
if(!$db->db_query($qry))
echo '<strong>campus.tbl_paabgabetyp: '.$db->db_last_error().'</strong><br>';
else
echo '<br>paabgabetyp column aktiv default true hinzugefuegt';
}
}
if($result = $db->db_query("SELECT 1 FROM information_schema.columns WHERE table_schema = 'campus' AND table_name = 'tbl_paabgabetyp' AND column_name = 'upload_allowed_default'"))
{
if($db->db_num_rows($result) === 0)
{
$qry = "ALTER TABLE campus.tbl_paabgabetyp
ADD COLUMN IF NOT EXISTS upload_allowed_default BOOLEAN DEFAULT true;";
if(!$db->db_query($qry))
echo '<strong>campus.tbl_paabgabetyp: '.$db->db_last_error().'</strong><br>';
else
echo '<br>paabgabetyp column upload_allowed_default default true hinzugefuegt';
}
}
if($result = $db->db_query("SELECT 1 FROM information_schema.columns WHERE table_schema = 'campus' AND table_name = 'tbl_paabgabetyp' AND column_name = 'benotbar'"))
{
if($db->db_num_rows($result) === 0)
{
$qry = "ALTER TABLE campus.tbl_paabgabetyp
ADD COLUMN IF NOT EXISTS benotbar BOOLEAN DEFAULT true;";
if(!$db->db_query($qry))
echo '<strong>campus.tbl_paabgabetyp: '.$db->db_last_error().'</strong><br>';
else
echo '<br>paabgabetyp column benotbar default true hinzugefuegt';
}
}
// TODO DEFINE ACTUAL VALUES BENOTBAR / UPLOAD_ALLOWED_DEFAULT / AKTIV FOR EACH PAABGABETYPE - DEVLOPER DEFAULTS BELOW
if($result = $db->db_query("SELECT 1 FROM campus.tbl_paabgabetyp WHERE paabgabetyp_kurzbz='qualgate1'"))
{
if($db->db_num_rows($result) === 0)
{
$qry = "INSERT INTO campus.tbl_paabgabetyp (paabgabetyp_kurzbz, bezeichnung) VALUES('qualgate1', 'Quality Gate 1');";
$qry = "INSERT INTO campus.tbl_paabgabetyp (paabgabetyp_kurzbz, bezeichnung, benotbar, upload_allowed_default, aktiv)
VALUES('qualgate1', 'Quality Gate 1', true, true, true);";
if(!$db->db_query($qry))
echo '<strong>campus.tbl_paabgabetyp: '.$db->db_last_error().'</strong><br>';
@@ -15,11 +62,102 @@ if($result = $db->db_query("SELECT 1 FROM campus.tbl_paabgabetyp WHERE paabgabet
}
}
// set new cols for zwischenabgabe
if($result = $db->db_query("SELECT 1 FROM campus.tbl_paabgabetyp WHERE paabgabetyp_kurzbz='zwischen'"))
{
if($db->db_num_rows($result) === 1)
{
$qry = "UPDATE campus.tbl_paabgabetyp
SET benotbar = false,
upload_allowed_default = true,
aktiv = true
WHERE paabgabetyp_kurzbz='zwischen';";
if(!$db->db_query($qry))
echo '<strong>campus.tbl_paabgabetyp: '.$db->db_last_error().'</strong><br>';
else
echo '<br>paabgabetyp zwischen updated benotbar = false, upload_allowed_default = true, aktiv = true';
}
}
// set new cols for note
if($result = $db->db_query("SELECT 1 FROM campus.tbl_paabgabetyp WHERE paabgabetyp_kurzbz='note'"))
{
if($db->db_num_rows($result) === 1)
{
$qry = "UPDATE campus.tbl_paabgabetyp
SET benotbar = false,
upload_allowed_default = false,
aktiv = false
WHERE paabgabetyp_kurzbz='note';";
if(!$db->db_query($qry))
echo '<strong>campus.tbl_paabgabetyp: '.$db->db_last_error().'</strong><br>';
else
echo '<br>paabgabetyp note updated benotbar = false, upload_allowed_default = false, aktiv = false';
}
}
// set new cols for abstract / entwurf
if($result = $db->db_query("SELECT 1 FROM campus.tbl_paabgabetyp WHERE paabgabetyp_kurzbz='abstract'"))
{
if($db->db_num_rows($result) === 1)
{
$qry = "UPDATE campus.tbl_paabgabetyp
SET benotbar = false,
upload_allowed_default = true,
aktiv = true
WHERE paabgabetyp_kurzbz='abstract';";
if(!$db->db_query($qry))
echo '<strong>campus.tbl_paabgabetyp: '.$db->db_last_error().'</strong><br>';
else
echo '<br>paabgabetyp abstract updated benotbar = false, upload_allowed_default = true, aktiv = true';
}
}
// set new cols for endabgabe / end
if($result = $db->db_query("SELECT 1 FROM campus.tbl_paabgabetyp WHERE paabgabetyp_kurzbz='end'"))
{
if($db->db_num_rows($result) === 1)
{
$qry = "UPDATE campus.tbl_paabgabetyp
SET benotbar = false,
upload_allowed_default = true,
aktiv = true
WHERE paabgabetyp_kurzbz='end';";
if(!$db->db_query($qry))
echo '<strong>campus.tbl_paabgabetyp: '.$db->db_last_error().'</strong><br>';
else
echo '<br>paabgabetyp end updated benotbar = false, upload_allowed_default = true, aktiv = true';
}
}
// set new cols for endabgabe im sekretariat / enda
if($result = $db->db_query("SELECT 1 FROM campus.tbl_paabgabetyp WHERE paabgabetyp_kurzbz='enda'"))
{
if($db->db_num_rows($result) === 1)
{
$qry = "UPDATE campus.tbl_paabgabetyp
SET benotbar = false,
upload_allowed_default = false,
aktiv = false
WHERE paabgabetyp_kurzbz='enda';";
if(!$db->db_query($qry))
echo '<strong>campus.tbl_paabgabetyp: '.$db->db_last_error().'</strong><br>';
else
echo '<br>paabgabetyp enda updated benotbar = false, upload_allowed_default = false, aktiv = false';
}
}
if($result = $db->db_query("SELECT 1 FROM campus.tbl_paabgabetyp WHERE paabgabetyp_kurzbz='qualgate2'"))
{
if($db->db_num_rows($result) === 0)
{
$qry = "INSERT INTO campus.tbl_paabgabetyp (paabgabetyp_kurzbz, bezeichnung) VALUES('qualgate2', 'Quality Gate 2');";
$qry = "INSERT INTO campus.tbl_paabgabetyp (paabgabetyp_kurzbz, bezeichnung, benotbar, upload_allowed_default, aktiv)
VALUES('qualgate2', 'Quality Gate 2', true, true, true);";
if(!$db->db_query($qry))
echo '<strong>campus.tbl_paabgabetyp: '.$db->db_last_error().'</strong><br>';
@@ -34,7 +172,7 @@ if($result = $db->db_query("SELECT 1 FROM information_schema.columns WHERE table
{
$qry = "ALTER TABLE campus.tbl_paabgabe
ADD COLUMN note SMALLINT DEFAULT NULL,
ADD COLUMN IF NOT EXISTS note SMALLINT DEFAULT NULL,
ADD CONSTRAINT tbl_paabgabe_note_fkey
FOREIGN KEY (note)
REFERENCES lehre.tbl_note(note)
+120
View File
@@ -42816,6 +42816,106 @@ array(
)
)
),
array(
'app' => 'core',
'category' => 'abgabetool',
'phrase' => 'c4tooltipVerspaetet',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => "Verspätet abgegeben",
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Submitted late',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'abgabetool',
'phrase' => 'c4tooltipVerpasst',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => "Termin überschritten",
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Deadline exceeded',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'abgabetool',
'phrase' => 'c4tooltipAbzugeben',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => "Termin innerhalb von 12 Tagen",
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Deadline within 12 days',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'abgabetool',
'phrase' => 'c4tooltipStandard',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => "Termin mehr als 12 Tag entfernt",
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Deadline more than 12 days away',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'abgabetool',
'phrase' => 'c4tooltipAbgegeben',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => "Rechtzeitig abgegeben",
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Delivered on time',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'abgabetool',
@@ -42856,6 +42956,26 @@ array(
)
)
),
array(
'app' => 'core',
'category' => 'abgabetool',
'phrase' => 'c4nochNichtsAbgegeben',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => "Keine Abgabe vorhanden",
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'No submission yet',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'abgabetool',