mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
- Added migration script 020_dokumentstudiengang to add a new column
called nachreichbar - Added property nachreichbar to class dokument into dokument.class.php - VileSci->Wartung->"Dokumente Zuteilung" in now handling the field nachreichbar
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once APPPATH . '/libraries/MigrationLib.php';
|
||||
|
||||
class Migration_Dokumentstudiengang extends MigrationLib
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function up()
|
||||
{
|
||||
$this->startUP();
|
||||
|
||||
// Add nachreichbar to public.tbl_dokumentstudiengang
|
||||
$columns = array(
|
||||
'nachreichbar' => array(
|
||||
'type' => 'boolean DEFAULT FALSE',
|
||||
'null' => false
|
||||
)
|
||||
);
|
||||
$this->addColumn('public', 'tbl_dokumentstudiengang', $columns);
|
||||
|
||||
$this->endUP();
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->startDown();
|
||||
|
||||
$this->dropColumn('public', 'tbl_dokumentstudiengang', 'nachreichbar');
|
||||
|
||||
$this->endDown();
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,7 @@ class dokument extends basis_db
|
||||
public $bezeichnung;
|
||||
public $studiengang_kz;
|
||||
public $pflicht;
|
||||
public $nachreichbar;
|
||||
public $bezeichnung_mehrsprachig;
|
||||
public $dokumentbeschreibung_mehrsprachig;
|
||||
|
||||
@@ -403,6 +404,7 @@ class dokument extends basis_db
|
||||
$dok->dokument_kurzbz = $row->dokument_kurzbz;
|
||||
$dok->bezeichnung = $row->bezeichnung;
|
||||
$dok->pflicht = $this->db_parse_bool($row->pflicht);
|
||||
$dok->nachreichbar = $this->db_parse_bool($row->nachreichbar);
|
||||
$dok->onlinebewerbung = $this->db_parse_bool($row->onlinebewerbung);
|
||||
$this->result[] = $dok;
|
||||
}
|
||||
@@ -435,6 +437,7 @@ class dokument extends basis_db
|
||||
$dok->dokument_kurzbz = $row->dokument_kurzbz;
|
||||
$dok->bezeichnung = $row->bezeichnung;
|
||||
$dok->pflicht = $this->db_parse_bool($row->pflicht);
|
||||
$dok->nachreichbar = $this->db_parse_bool($row->nachreichbar);
|
||||
$dok->onlinebewerbung = $this->db_parse_bool($row->onlinebewerbung);
|
||||
|
||||
$this->result[] = $dok;
|
||||
@@ -511,6 +514,7 @@ class dokument extends basis_db
|
||||
$this->studiengang_kz = $row->studiengang_kz;
|
||||
$this->onlinebewerbung = $this->db_parse_bool($row->onlinebewerbung);
|
||||
$this->pflicht = $this->db_parse_bool($row->pflicht);
|
||||
$this->nachreichbar = $this->db_parse_bool($row->nachreichbar);
|
||||
$this->beschreibung_mehrsprachig = $sprache->parseSprachResult('beschreibung_mehrsprachig',$row);
|
||||
return true;
|
||||
}
|
||||
@@ -572,7 +576,7 @@ class dokument extends basis_db
|
||||
$qry.=" beschreibung_mehrsprachig[$idx],";
|
||||
}
|
||||
|
||||
$qry.=' pflicht, onlinebewerbung)
|
||||
$qry.=' pflicht, nachreichbar, onlinebewerbung)
|
||||
VALUES ('.
|
||||
$this->db_add_param($this->dokument_kurzbz).','.
|
||||
$this->db_add_param($this->studiengang_kz,FHC_INTEGER).',';
|
||||
@@ -581,6 +585,7 @@ class dokument extends basis_db
|
||||
$qry.=$this->db_add_param($value).',';
|
||||
|
||||
$qry.= $this->db_add_param($this->pflicht,FHC_BOOLEAN).','.
|
||||
$this->db_add_param($this->nachreichbar,FHC_BOOLEAN).','.
|
||||
$this->db_add_param($this->onlinebewerbung,FHC_BOOLEAN).')';
|
||||
}
|
||||
else
|
||||
@@ -593,12 +598,13 @@ class dokument extends basis_db
|
||||
$idx = sprache::$index_arr[$key];
|
||||
$qry.=" beschreibung_mehrsprachig[$idx]=".$this->db_add_param($value).",";
|
||||
}
|
||||
$qry.=' pflicht='.$this->db_add_param($this->pflicht, FHC_BOOLEAN).'
|
||||
$qry.=' pflicht='.$this->db_add_param($this->pflicht, FHC_BOOLEAN).',
|
||||
nachreichbar='.$this->db_add_param($this->nachreichbar, FHC_BOOLEAN).'
|
||||
WHERE
|
||||
dokument_kurzbz='.$this->db_add_param($this->dokument_kurzbz).'
|
||||
AND studiengang_kz='.$this->db_add_param($this->studiengang_kz);
|
||||
}
|
||||
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
return true;
|
||||
@@ -652,7 +658,7 @@ class dokument extends basis_db
|
||||
$bezeichnung_mehrsprachig = $sprache->getSprachQuery('bezeichnung_mehrsprachig');
|
||||
$dokumentbeschreibung_mehrsprachig = $sprache->getSprachQuery('dokumentbeschreibung_mehrsprachig');
|
||||
$beschreibung_mehrsprachig = $sprache->getSprachQuery('beschreibung_mehrsprachig');
|
||||
$qry = "SELECT distinct on (dokument_kurzbz) dokument_kurzbz, bezeichnung, pflicht,
|
||||
$qry = "SELECT distinct on (dokument_kurzbz) dokument_kurzbz, bezeichnung, pflicht, nachreichbar
|
||||
$bezeichnung_mehrsprachig, $dokumentbeschreibung_mehrsprachig, $beschreibung_mehrsprachig
|
||||
FROM public.tbl_dokumentstudiengang
|
||||
JOIN public.tbl_prestudent using (studiengang_kz)
|
||||
@@ -673,6 +679,7 @@ class dokument extends basis_db
|
||||
$dok->dokument_kurzbz = $row->dokument_kurzbz;
|
||||
$dok->bezeichnung = $row->bezeichnung;
|
||||
$dok->pflicht= $this->db_parse_bool($row->pflicht);
|
||||
$dok->nachreichbar= $this->db_parse_bool($row->nachreichbar);
|
||||
$dok->bezeichnung_mehrsprachig = $sprache->parseSprachResult('bezeichnung_mehrsprachig', $row);
|
||||
$dok->dokumentbeschreibung_mehrsprachig = $sprache->parseSprachResult('dokumentbeschreibung_mehrsprachig', $row);
|
||||
$dok->beschreibung_mehrsprachig = $sprache->parseSprachResult('beschreibung_mehrsprachig', $row);
|
||||
|
||||
@@ -32,6 +32,7 @@ $stg_kz = isset($_REQUEST['stg_kz']) ? $_REQUEST['stg_kz'] : '0';
|
||||
$dokument_kurzbz = isset($_REQUEST['dokument_kurzbz']) ? $_REQUEST['dokument_kurzbz'] : '';
|
||||
$onlinebewerbung = isset($_REQUEST['onlinebewerbung']);
|
||||
$pflicht = isset($_POST['pflicht']);
|
||||
$nachreichbar = isset($_POST['nachreichbar']);
|
||||
|
||||
$sprache = new sprache();
|
||||
$sprache->getAll(true);
|
||||
@@ -58,6 +59,7 @@ if($action=='add')
|
||||
$dokument->studiengang_kz = $stg_kz;
|
||||
$dokument->onlinebewerbung = $onlinebewerbung;
|
||||
$dokument->pflicht = $pflicht;
|
||||
$dokument->nachreichbar = $nachreichbar;
|
||||
|
||||
$beschreibung_mehrsprachig=array();
|
||||
foreach($sprache->result as $row_sprache)
|
||||
@@ -112,6 +114,21 @@ if($action === 'togglepflicht') {
|
||||
}
|
||||
}
|
||||
|
||||
if($action === 'togglenachreichbar') {
|
||||
if($dokument_kurzbz != '' && $stg_kz != '')
|
||||
{
|
||||
$dokument=new dokument();
|
||||
if($dokument->loadDokumentStudiengang($dokument_kurzbz, $stg_kz))
|
||||
{
|
||||
$dokument->nachreichbar = !$dokument->nachreichbar;
|
||||
if(!$dokument->saveDokumentStudiengang())
|
||||
echo $dokument->errormsg;
|
||||
}
|
||||
else
|
||||
echo 'Zuordnung ist nicht vorhanden';
|
||||
}
|
||||
}
|
||||
|
||||
if($action=='saveDoc')
|
||||
{
|
||||
$dokBezeichnung=isset($_POST['dokument_bezeichnung'])?$_POST['dokument_bezeichnung']:'';
|
||||
@@ -351,6 +368,7 @@ else
|
||||
<th>Dokumentname</th>
|
||||
<th>Online-Bewerbung</th>
|
||||
<th>Pflicht</th>
|
||||
<th>Nachreichbar</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -363,10 +381,12 @@ else
|
||||
$zugewieseneDokumente[]=$dok->dokument_kurzbz;
|
||||
$checked_onlinebewerbung = $dok->onlinebewerbung ? 'true' : 'false';
|
||||
$checked_pflicht = $dok->pflicht ? 'true' : 'false';
|
||||
$checked_nachreichbar = $dok->nachreichbar ? '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_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=togglenachreichbar&dokument_kurzbz='.$dok->dokument_kurzbz.'&stg_kz='.$stg_kz.'"><img src="../../skin/images/'.$checked_nachreichbar.'.png" /></a></td>
|
||||
<td>
|
||||
<a href="'.$_SERVER['PHP_SELF'].'?action=edit&dokument_kurzbz='.$dok->dokument_kurzbz.'&stg_kz='.$stg_kz.'"><img src="../../skin/images/edit.png" title="Zuordnung bearbeiten" size="17px" /></a>
|
||||
<a href="'.$_SERVER['PHP_SELF'].'?action=delete&dokument_kurzbz='.$dok->dokument_kurzbz.'&stg_kz='.$stg_kz.'" onclick="return confdel()"><img src="../../skin/images/delete.png" title="Zuordnung löschen" height="17px"/></a>
|
||||
@@ -410,6 +430,9 @@ else
|
||||
<td valign="top">
|
||||
<input type="checkbox" name="pflicht" '.($dok->pflicht?'checked="checked"':'').'>
|
||||
</td>
|
||||
<td valign="top">
|
||||
<input type="checkbox" name="nachreichbar" '.($dok->nachreichbar?'checked="checked"':'').'>
|
||||
</td>
|
||||
<td valign="top"><input type="submit" name="add" value="Hinzufügen"></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
|
||||
Reference in New Issue
Block a user