flag "required" for documents in onlineapplication

This commit is contained in:
Robert Hofer
2015-03-20 14:34:55 +01:00
parent 8b4c82c0e3
commit 9e57867d08
3 changed files with 677 additions and 636 deletions
+637 -630
View File
File diff suppressed because it is too large Load Diff
+12 -1
View File
@@ -2609,6 +2609,17 @@ if(!$result = @$db->db_query("SELECT anwesenheit FROM campus.tbl_lvinfo LIMIT 1"
echo 'campus.tbl_lvinfo: Spalte "anwesenheit" hinzugefuegt!<br>';
}
// Spalte pflicht in tbl_dokumentstudiengang
if(!$result = @$db->db_query("SELECT pflicht FROM public.tbl_dokumentstudiengang LIMIT 1"))
{
$qry = "ALTER TABLE public.tbl_dokumentstudiengang ADD COLUMN pflicht BOOLEAN NOT NULL DEFAULT FALSE";
if(!$db->db_query($qry))
echo '<strong>public.tbl_dokumentstudiengang '.$db->db_last_error().'</strong><br>';
else
echo 'public.tbl_dokumentstudiengang: Spalte "pflicht" hinzugefuegt!<br>';
}
// Anrechnungen
if(!$result = @$db->db_query("SELECT 1 FROM lehre.tbl_anrechnung LIMIT 1;"))
{
@@ -2939,7 +2950,7 @@ $tabellen=array(
"public.tbl_buchungstyp" => array("buchungstyp_kurzbz","beschreibung","standardbetrag","standardtext","aktiv","credit_points"),
"public.tbl_dokument" => array("dokument_kurzbz","bezeichnung","ext_id"),
"public.tbl_dokumentprestudent" => array("dokument_kurzbz","prestudent_id","mitarbeiter_uid","datum","updateamum","updatevon","insertamum","insertvon","ext_id"),
"public.tbl_dokumentstudiengang" => array("dokument_kurzbz","studiengang_kz","ext_id", "onlinebewerbung"),
"public.tbl_dokumentstudiengang" => array("dokument_kurzbz","studiengang_kz","ext_id", "onlinebewerbung", "pflicht"),
"public.tbl_erhalter" => array("erhalter_kz","kurzbz","bezeichnung","dvr","logo","zvr"),
"public.tbl_fachbereich" => array("fachbereich_kurzbz","bezeichnung","farbe","studiengang_kz","aktiv","ext_id","oe_kurzbz"),
"public.tbl_filter" => array("filter_id","kurzbz","sql","valuename","showvalue","insertamum","insertvon","updateamum","updatevon","type","htmlattr"),
+28 -5
View File
@@ -27,9 +27,9 @@ require_once('../../include/studiengang.class.php');
require_once('../../include/dokument.class.php');
require_once('../../include/benutzerberechtigung.class.php');
$stg_kz=isset($_REQUEST['stg_kz'])?$_REQUEST['stg_kz']:'0';
$dokument_kurzbz=isset($_REQUEST['dokument_kurzbz'])?$_REQUEST['dokument_kurzbz']:'';
$onlinebewerbung=isset($_REQUEST['onlinebewerbung']);
$stg_kz = isset($_REQUEST['stg_kz']) ? $_REQUEST['stg_kz'] : '0';
$dokument_kurzbz = isset($_REQUEST['dokument_kurzbz']) ? $_REQUEST['dokument_kurzbz'] : '';
$onlinebewerbung = isset($_REQUEST['onlinebewerbung']);
$action=isset($_GET['action'])?$_GET['action']:'';
if(isset($_POST['add']))
@@ -52,6 +52,7 @@ if($action=='add')
$dokument->dokument_kurzbz = $dokument_kurzbz;
$dokument->studiengang_kz = $stg_kz;
$dokument->onlinebewerbung = $onlinebewerbung;
$dokument->pflicht = filter_input(INPUT_POST, 'pflicht', FILTER_VALIDATE_BOOLEAN);
$dokument->saveDokumentStudiengang();
}
}
@@ -82,6 +83,21 @@ if($action =='toggleonline')
}
}
if($action === 'togglepflicht') {
if($dokument_kurzbz != '' && $stg_kz != '')
{
$dokument=new dokument();
if($dokument->loadDokumentStudiengang($dokument_kurzbz, $stg_kz))
{
$dokument->pflicht = !$dokument->pflicht;
if(!$dokument->saveDokumentStudiengang())
echo $dokument->errormsg;
}
else
echo 'Zuordnung ist nicht vorhanden';
}
}
if($action=='saveDoc')
{
$dokBezeichnung=isset($_POST['dokument_bezeichnung'])?$_POST['dokument_bezeichnung']:'';
@@ -262,6 +278,7 @@ else
<tr>
<th>Dokumentname</th>
<th>Online-Bewerbung</th>
<th>Pflicht</th>
<th></th>
</tr>
</thead>
@@ -272,10 +289,12 @@ else
foreach($dokStg->result as $dok)
{
$zugewieseneDokumente[]=$dok->dokument_kurzbz;
$checked=$dok->onlinebewerbung?'true':'false';
$checked_onlinebewerbung = $dok->onlinebewerbung ? 'true' : 'false';
$checked_pflicht = $dok->pflicht ? 'true' : 'false';
echo '<tr>
<td>'.$dok->bezeichnung.'</td>
<td><a href="'.$_SERVER['PHP_SELF'].'?action=toggleonline&dokument_kurzbz='.$dok->dokument_kurzbz.'&stg_kz='.$stg_kz.'"><img src="../../skin/images/'.$checked.'.png" /></a></td>
<td><a href="'.$_SERVER['PHP_SELF'].'?action=toggleonline&dokument_kurzbz='.$dok->dokument_kurzbz.'&stg_kz='.$stg_kz.'"><img src="../../skin/images/'.$checked_onlinebewerbung.'.png" /></a></td>
<td><a href="'.$_SERVER['PHP_SELF'].'?action=togglepflicht&dokument_kurzbz='.$dok->dokument_kurzbz.'&stg_kz='.$stg_kz.'"><img src="../../skin/images/'.$checked_pflicht.'.png" /></a></td>
<td><a href="'.$_SERVER['PHP_SELF'].'?action=delete&dokument_kurzbz='.$dok->dokument_kurzbz.'&stg_kz='.$stg_kz.'">Zuordnung löschen</a></td>
</td>
</tr>';
@@ -294,6 +313,10 @@ else
}
echo '</select></td>
<td><input type="checkbox" name="onlinebewerbung" checked></td>
<td>
<input type="hidden" name="pflicht" value="0">
<input type="checkbox" name="pflicht" value="1" checked>
</td>
<td><input type="submit" name="add" value="Hinzufügen"></td>
</tr>
</tfoot>