Merge branch 'master' into TempusLektorFilter

This commit is contained in:
Manfred Kindl
2019-08-14 11:57:48 +02:00
9 changed files with 308 additions and 327 deletions
+148 -302
View File
@@ -23,8 +23,6 @@
*/
// Oberflaeche zum Upload von Bildern
//session_cache_limiter('none'); //muss gesetzt werden damit der upload in chrome und das automatische updaten des profilbildes funktioniert
require_once('../../config/cis.config.inc.php');
require_once('../../include/functions.inc.php');
require_once('../../include/person.class.php');
@@ -32,67 +30,52 @@ require_once('../../include/benutzer.class.php');
require_once('../../include/akte.class.php');
require_once('../../include/phrasen.class.php');
require_once('../../include/fotostatus.class.php');
$user = get_uid();
$sprache = getSprache();
$p = new phrasen($sprache);
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../vendor/twbs/bootstrap/dist/css/bootstrap.min.css">
<link href="../../skin/style.css.php" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="../../vendor/components/jqueryui/themes/base/jquery-ui.min.css">
<link rel="stylesheet" type="text/css" href="../../skin/simplecropper.css">'.
cropCss().'
<link rel="stylesheet" type="text/css" href="../../skin/jquery-ui-1.9.2.custom.min.css">
<script type="text/javascript" src="../../vendor/jquery/jqueryV1/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="../../vendor/christianbach/tablesorter/jquery.tablesorter.min.js"></script>
<script type="text/javascript" src="../../vendor/components/jqueryui/jquery-ui.min.js"></script>
<script type="text/javascript" src="../../include/js/jquery.ui.datepicker.translation.js"></script>
<script type="text/javascript" src="../../vendor/jquery/sizzle/sizzle.js"></script>
<script type="text/javascript" src="../../vendor/tapmodo/Jcrop/js/Jcrop.min.js"></script>
<script type="text/javascript" src="../../vendor/tomazdragar/SimpleCropper/scripts/jquery.SimpleCropper.js"></script>
<script type="text/javascript" src="../../include/js/cropper.js"></script>
<script type="text/javascript" src="../../vendor/jquery/jqueryV1/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="../../vendor/twbs/bootstrap/dist/js/bootstrap.min.js"></script>
<title>'.$p->t('profil/Bildupload').'</title>
</head>
<body>
<div style="padding: 10px">
<h1>'.$p->t('profil/Bildupload').'</h1>';
function resize($filename, $width, $height)
{
$ext = explode('.',$_FILES['bild']['name']);
$ext = strtolower($ext[count($ext)-1]);
$ext = explode('.',$_FILES['bild']['name']);
$ext = strtolower($ext[count($ext)-1]);
// Hoehe und Breite neu berechnen
list($width_orig, $height_orig) = getimagesize($filename);
if ($width && ($width_orig < $height_orig))
{
$width = ($height / $height_orig) * $width_orig;
}
else
{
$height = ($width / $width_orig) * $height_orig;
}
// Hoehe und Breite neu berechnen
list($width_orig, $height_orig) = getimagesize($filename);
$image_p = imagecreatetruecolor($width, $height);
if ($width && ($width_orig < $height_orig))
{
$width = ($height / $height_orig) * $width_orig;
}
else
{
$height = ($width / $width_orig) * $height_orig;
}
$image = imagecreatefromjpeg($filename);
$image_p = imagecreatetruecolor($width, $height);
//Bild nur verkleinern aber nicht vergroessern
if($width_orig>$width || $height_orig>$height)
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
else
$image_p = $image;
$image = imagecreatefromjpeg($filename);
imagejpeg($image_p, $filename, 80);
//Bild nur verkleinern aber nicht vergroessern
if($width_orig>$width || $height_orig>$height)
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
else
$image_p = $image;
imagejpeg($image_p, $filename, 80);
@imagedestroy($image_p);
@imagedestroy($image);
@imagedestroy($image_p);
@imagedestroy($image);
}
if(isset($_GET['person_id']))
{
$benutzer = new benutzer();
@@ -107,269 +90,132 @@ if(isset($_GET['person_id']))
}
else
die($p->t('global/fehlerBeiDerParameteruebergabe'));
//Bei Upload des Bildes
if(isset($_POST['submitbild']))
{
if(isset($_FILES['bild']['tmp_name']))
{
//Extension herausfiltern
$ext = explode('.',$_FILES['bild']['name']);
$ext = mb_strtolower($ext[count($ext)-1]);
$width=101;
$height=130;
echo '<br>';
echo $p->t('profil/BilduploadInfotext',array($p->t('dms_link/bildRichtlinien'))).'<br><br>';
echo '<div class="simple-cropper-images">
'.$p->t('profil/fotoAuswählen').'
<div class="cropme" id="croppingdiv" style="width: 300px; height: 400px; background-image:url(../../skin/images/photoupload.png); margin:10px; cursor:pointer;"></div>
<script>
// Init Simple Cropper
$(".cropme").simpleCropper();
</script>
</div>
<input type="button" name="submitbild" id="saveimgbutton" value="'.$p->t('profil/bildSpeichern').'" style="margin-left:90px;"/>
<input type="hidden" id="person_id" value="'.$_GET['person_id'].'" />';
//--check that it's a jpeg
if ($ext=='jpg' || $ext=='jpeg')
{
$filename = $_FILES['bild']['tmp_name'];
if (isset($_POST['src'])) {
$src = $_POST['src'];
echo $src;
//groesse auf maximal 827x1063 begrenzen
resize($filename, 827, 1063);
$fp = fopen($filename,'r');
//auslesen
$content = fread($fp, filesize($filename));
fclose($fp);
$akte = new akte();
if($akte->getAkten($_GET['person_id'], 'Lichtbil'))
{
if(count($akte->result)>0)
{
$akte = $akte->result[0];
$akte->new = false;
}
else
$akte->new = true;
}
else
{
$akte->new = true;
}
$akte->dokument_kurzbz = 'Lichtbil';
$akte->person_id = $_GET['person_id'];
$akte->inhalt = base64_encode($content);
$akte->mimetype = "image/jpg";
$akte->erstelltam = date('Y-m-d H:i:s');
$akte->gedruckt = false;
$akte->titel = "Lichtbild_".$_GET['person_id'].".jpg";
$akte->bezeichnung = "Lichtbild gross";
$akte->updateamum = date('Y-m-d H:i:s');
$akte->updatevon = $user;
$akte->insertamum = date('Y-m-d H:i:s');
$akte->insertvon = $user;
$akte->uid = '';
if(!$akte->save())
{
echo '<div class="alert alert-danger">Fehler: '.$akte->errormsg.'</div>';
}
//groesse auf maximal 101x130 begrenzen
resize($filename, 101, 130);
//in DB speichern
//File oeffnen
$fp = fopen($filename,'r');
//auslesen
$content = fread($fp, filesize($filename));
fclose($fp);
//in base64-Werte umrechnen
$content = base64_encode($content);
$person = new person();
if($person->load($_GET['person_id']))
{
//base64 Wert in die Datenbank speichern
$person->foto = $content;
$person->new = false;
if($person->save())
{
$fs = new fotostatus();
$fs->person_id=$person->person_id;
$fs->fotostatus_kurzbz='hochgeladen';
$fs->datum = date('Y-m-d');
$fs->insertamum = date('Y-m-d H:i:s');
$fs->insertvon = $user;
$fs->updateamum = date('Y-m-d H:i:s');
$fs->updatevon = $user;
if(!$fs->save(true))
echo '<div class="alert alert-danger">Fehler beim Setzen des Bildstatus</div>';
else
{
echo "<div class='alert alert-success'>Bild wurde erfolgreich gespeichert</div>
<script language='Javascript'>
if(typeof(opener.StudentAuswahl) == 'function')
opener.StudentAuswahl();
if(typeof(opener.MitarbeiterAuswahl) == 'function')
opener.MitarbeiterAuswahl();
if(typeof(opener.RefreshImage) == 'function' ||
typeof(opener.RefreshImage) == 'object')
{
opener.RefreshImage();
}
window.close();
</script>";
}
}
else
echo '<div class="alert alert-danger">'.$person->errormsg.'</div>';
}
else
echo '<div class="alert alert-danger">'.$person->errormsg.'</div>';
}
else
echo '<div class="alert alert-danger">'.$p->t('profil/nurJPGBilder').'</div>';
}
}
function cropCss() {
return '
<style type="text/css">
/* jquery.Jcrop.css v0.9.12 - MIT License */
/*
The outer-most container in a typical Jcrop instance
If you are having difficulty with formatting related to styles
on a parent element, place any fixes here or in a like selector
You can also style this element if you want to add a border, etc
A better method for styling can be seen below with .jcrop-light
(Add a class to the holder and style elements for that extended class)
*/
.jcrop-holder {
direction: ltr;
text-align: left;
}
/* Selection Border */
.jcrop-vline,
.jcrop-hline {
background: #ffffff url("../images/Jcrop.gif");
font-size: 0;
position: absolute;
}
.jcrop-vline {
height: 100%;
width: 1px !important;
}
.jcrop-vline.right {
right: 0;
}
.jcrop-hline {
height: 1px !important;
width: 100%;
}
.jcrop-hline.bottom {
bottom: 0;
}
/* Invisible click targets */
.jcrop-tracker {
height: 100%;
width: 100%;
/* "turn off" link highlight */
-webkit-tap-highlight-color: transparent;
/* disable callout, image save panel */
-webkit-touch-callout: none;
/* disable cut copy paste */
-webkit-user-select: none;
}
/* Selection Handles */
.jcrop-handle {
background-color: #333333;
border: 1px #eeeeee solid;
width: 14px;
height: 14px;
font-size: 1px;
}
.jcrop-handle.ord-n {
left: 50%;
margin-left: -4px;
margin-top: -4px;
top: 0;
}
.jcrop-handle.ord-s {
bottom: 0;
left: 50%;
margin-bottom: -4px;
margin-left: -4px;
}
.jcrop-handle.ord-e {
margin-right: -4px;
margin-top: -4px;
right: 0;
top: 50%;
}
.jcrop-handle.ord-w {
left: 0;
margin-left: -4px;
margin-top: -4px;
top: 50%;
}
.jcrop-handle.ord-nw {
left: 0;
margin-left: -4px;
margin-top: -4px;
top: 0;
}
.jcrop-handle.ord-ne {
margin-right: -4px;
margin-top: -4px;
right: 0;
top: 0;
}
.jcrop-handle.ord-se {
bottom: 0;
margin-bottom: -4px;
margin-right: -4px;
right: 0;
}
.jcrop-handle.ord-sw {
bottom: 0;
left: 0;
margin-bottom: -4px;
margin-left: -4px;
}
/* Dragbars */
.jcrop-dragbar.ord-n,
.jcrop-dragbar.ord-s {
height: 7px;
width: 100%;
}
.jcrop-dragbar.ord-e,
.jcrop-dragbar.ord-w {
height: 100%;
width: 7px;
}
.jcrop-dragbar.ord-n {
margin-top: -4px;
}
.jcrop-dragbar.ord-s {
bottom: 0;
margin-bottom: -4px;
}
.jcrop-dragbar.ord-e {
margin-right: -4px;
right: 0;
}
.jcrop-dragbar.ord-w {
margin-left: -4px;
}
/* The "jcrop-light" class/extension */
.jcrop-light .jcrop-vline,
.jcrop-light .jcrop-hline {
background: #ffffff;
filter: alpha(opacity=70) !important;
opacity: .70!important;
}
.jcrop-light .jcrop-handle {
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
background-color: #000000;
border-color: #ffffff;
border-radius: 3px;
}
/* The "jcrop-dark" class/extension */
.jcrop-dark .jcrop-vline,
.jcrop-dark .jcrop-hline {
background: #000000;
filter: alpha(opacity=70) !important;
opacity: 0.7 !important;
}
.jcrop-dark .jcrop-handle {
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
background-color: #ffffff;
border-color: #000000;
border-radius: 3px;
}
/* Simple macro to turn off the antlines */
.solid-line .jcrop-vline,
.solid-line .jcrop-hline {
background: #ffffff;
}
/* Fix for twitter bootstrap et al. */
.jcrop-holder img,
img.jcrop-preview {
max-width: none;
}
.clear{
font-size: 0px;
line-height: 0px;
overflow: hidden;
width: 0px;
height: 0px;
clear: both;
}
.simple-cropper-images{
width: 820px;
margin: 0 auto 20px;
}
.cropme{
background-image: url(../../skin/images/photoupload.png);
}
.cropme:hover{
}
.text{
font-family: arial;
font-size: 14px;
color: #4e4e4e;
margin-bottom: 20px;
}
.code{
font-family: arial;
font-size: 14px;
color: #4e4e4e;
margin-bottom: 20px;
background-color: #f1f1f1;
padding: 10px;
}
#fileInput{
width:0;
height:0;
overflow:hidden;
}
#modal{
z-index: 10;
position: fixed;
top: 0px;
left: 0px;
width: 100%;
height: 100%;
background-color: #5F5F5F;
opacity: 0.95;
display: none;
}
#preview{
z-index: 11;
position: fixed;
top: 0px;
left: 0px;
display: none;
border: 4px solid #A5A2A2;
border-radius: 4px;
float: left;
font-size: 0px;
line-height: 0px;
}
#preview .buttons{
width: 36px;
position: absolute;
bottom:0px;
right: -44px;
}
</style>';
}
//echo '<br>';
echo $p->t('profil/BilduploadInfotext',array($p->t('dms_link/bildRichtlinien'))).'<br><br>
<form accept-charset="UTF-8" method="POST" enctype="multipart/form-data" action="'.$_SERVER['PHP_SELF'].'?person_id='.$_GET['person_id'].'">
'.$p->t('profil/Bild').': <input type="file" accept="image/jpeg" name="bild" /><br>
<button type="submit" class="btn btn-primary" name="submitbild">Upload</button>
</form>
</td></tr>';
?>
</div>
</body>
</html>
-4
View File
@@ -259,8 +259,4 @@ define('STATUSGRUND_ID_EINSTIEG_SOMMERSEMESTER', null);
// Studiengangs_kz des Studiengangs "Qualifikationskurse". Der Studiengang hat eine Sonderstellung zB für das Bewerbungstool.
define('STUDIENGANG_KZ_QUALIFIKATIONKURSE', null);
// EinsteigerInnen ins Sommersemester werden mit einem Statusgrund versehen.
// Die ID dieses Statusgrundes kann hier eingegeben werden. Es wird zB vom Infocenter-Tool gesetzt und im Bewerbungstool abgefragt
define('STATUSGRUND_ID_EINSTIEG_SOMMERSEMESTER', null);
?>
+1 -1
View File
@@ -168,7 +168,7 @@ if(isset($_POST['submitbild']))
if(isset($_GET['person_id']))
{
$dokument = new dokument();
$dokument->getAllDokumente('Zeugnis');
$dokument->getAllDokumente('Zeugnis,DiplSupp,Bescheid');
echo " <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN' 'http://www.w3.org/TR/html4/loose.dtd'>
<html>
+12 -4
View File
@@ -36,6 +36,7 @@ class dokument extends basis_db
public $bezeichnung_mehrsprachig;
public $dokumentbeschreibung_mehrsprachig;
public $ausstellungsdetails = false;
public $stufe;
public $prestudent_id;
public $mitarbeiter_uid;
@@ -428,6 +429,7 @@ class dokument extends basis_db
$dok->nachreichbar = $this->db_parse_bool($row->nachreichbar);
$dok->onlinebewerbung = $this->db_parse_bool($row->onlinebewerbung);
$dok->ausstellungsdetails = $this->db_parse_bool($row->ausstellungsdetails);
$dok->stufe = $row->stufe;
$this->result[] = $dok;
}
return true;
@@ -467,6 +469,7 @@ class dokument extends basis_db
$dok->nachreichbar = $this->db_parse_bool($row->nachreichbar);
$dok->onlinebewerbung = $this->db_parse_bool($row->onlinebewerbung);
$dok->ausstellungsdetails = $this->db_parse_bool($row->ausstellungsdetails);
$dok->stufe = $row->stufe;
$this->result[] = $dok;
}
@@ -545,6 +548,7 @@ class dokument extends basis_db
$this->pflicht = $this->db_parse_bool($row->pflicht);
$this->nachreichbar = $this->db_parse_bool($row->nachreichbar);
$this->beschreibung_mehrsprachig = $sprache->parseSprachResult('beschreibung_mehrsprachig',$row);
$this->stufe = $row->stufe;
return true;
}
else
@@ -605,7 +609,7 @@ class dokument extends basis_db
$qry.=" beschreibung_mehrsprachig[$idx],";
}
$qry.=' pflicht, nachreichbar, onlinebewerbung)
$qry.=' pflicht, nachreichbar, onlinebewerbung, stufe)
VALUES ('.
$this->db_add_param($this->dokument_kurzbz).','.
$this->db_add_param($this->studiengang_kz,FHC_INTEGER).',';
@@ -615,7 +619,8 @@ class dokument extends basis_db
$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).')';
$this->db_add_param($this->onlinebewerbung,FHC_BOOLEAN).','.
$this->db_add_param($this->stufe,FHC_INTEGER).')';
}
else
{
@@ -628,7 +633,8 @@ class dokument extends basis_db
$qry.=" beschreibung_mehrsprachig[$idx]=".$this->db_add_param($value).",";
}
$qry.=' pflicht='.$this->db_add_param($this->pflicht, FHC_BOOLEAN).',
nachreichbar='.$this->db_add_param($this->nachreichbar, FHC_BOOLEAN).'
nachreichbar='.$this->db_add_param($this->nachreichbar, FHC_BOOLEAN).',
stufe='.$this->db_add_param($this->stufe, FHC_INTEGER).'
WHERE
dokument_kurzbz='.$this->db_add_param($this->dokument_kurzbz).'
AND studiengang_kz='.$this->db_add_param($this->studiengang_kz);
@@ -714,6 +720,7 @@ class dokument extends basis_db
$dok->dokumentbeschreibung_mehrsprachig = $sprache->parseSprachResult('dokumentbeschreibung_mehrsprachig', $row);
$dok->beschreibung_mehrsprachig = $sprache->parseSprachResult('beschreibung_mehrsprachig', $row);
$dok->ausstellungsdetails = $this->db_parse_bool($row->ausstellungsdetails);
$dok->stufe = $row->stufe;
$this->result[] = $dok;
}
@@ -838,7 +845,8 @@ class dokument extends basis_db
*/
public function getStudiengaengeDokument($dokument_kurzbz, $person_id = null)
{
$qry = " SELECT DISTINCT studiengang_kz,typ||kurzbz AS kuerzel, bezeichnung, english FROM public.tbl_dokumentstudiengang
$qry = " SELECT DISTINCT studiengang_kz,typ||kurzbz AS kuerzel, bezeichnung, english, stufe
FROM public.tbl_dokumentstudiengang
JOIN public.tbl_prestudent USING (studiengang_kz)
JOIN public.tbl_prestudentstatus USING (prestudent_id)
JOIN public.tbl_studiengang USING (studiengang_kz)
+5
View File
@@ -509,6 +509,11 @@ class frage extends basis_db
$level[$row->level]=round(($row->anzahl/$fragengesamt)*$maxfragen);
}
}
// Wenn ein Level besonders viele Fragen und eines nur eine Frage (nach dem Runden) hat,
// kann es durch Rundungsfehler vorkommen, dass bei der Ausgabe ein Level ausgelassen wird.
// Deshalb wird das array hier aufsteigend sortiert. So wird ggf. vom Level mit den meisten Fragen
// die letzte ausgelassen. Hier wäre eine sauberere Lösung besser.
asort($level);
// Von jedem Gebiet muss mindestens eine Frage kommen
foreach ($level as $key=>$row)
+2 -5
View File
@@ -368,12 +368,9 @@ class gebiet extends basis_db
$qry = "SELECT count(*) as anzahl FROM testtool.tbl_frage WHERE gebiet_id=".$this->db_add_param($gebiet_id, FHC_INTEGER)." AND not demo AND level is not null GROUP BY level";
if($this->db_query($qry))
{
if($row = $this->db_fetch_object())
if($this->db_num_rows() > $this->maxfragen)
{
if($row->anzahl>$this->maxfragen)
{
//$this->errormsg .= "Wenn Levelgleichverteilung gesetzt ist, muss maxfragen groesser als die Anzahl der verwendeten Levels sein\n";
}
$this->errormsg .= "Wenn Levelgleichverteilung gesetzt ist, muss maxfragen groesser als die Anzahl der verwendeten Levels sein\n";
}
}
}
+2 -2
View File
@@ -164,9 +164,9 @@ class statistik extends basis_db
public function getGruppe($gruppe,$publish=null)
{
$qry = "SELECT * FROM public.tbl_statistik WHERE gruppe=".$this->db_add_param($gruppe);
if ($publish==true)
if ($publish===true)
$qry.=' AND publish ';
elseif ($publish==false)
elseif ($publish===false)
$qry.=' AND NOT publish ';
$qry.=' ORDER BY bezeichnung;';
+12 -1
View File
@@ -3019,6 +3019,17 @@ if(!@$db->db_query("SELECT 0 FROM campus.tbl_zeitaufzeichnung_gd WHERE 0 = 1"))
}
// Add column Stufe to tbl_dokumentstudiengang
if(!$result = @$db->db_query("SELECT stufe FROM public.tbl_dokumentstudiengang LIMIT 1"))
{
$qry = "ALTER TABLE public.tbl_dokumentstudiengang ADD COLUMN stufe smallint;";
if(!$db->db_query($qry))
echo '<strong>public.tbl_dokumentstudiengang: '.$db->db_last_error().'</strong><br>';
else
echo '<br>public.tbl_dokumentstudiengang: Spalte stufe hinzugefuegt';
}
// *** Pruefung und hinzufuegen der neuen Attribute und Tabellen
echo '<H2>Pruefe Tabellen und Attribute!</H2>';
@@ -3181,7 +3192,7 @@ $tabellen=array(
"public.tbl_buchungstyp" => array("buchungstyp_kurzbz","beschreibung","standardbetrag","standardtext","aktiv","credit_points"),
"public.tbl_dokument" => array("dokument_kurzbz","bezeichnung","ext_id","bezeichnung_mehrsprachig","dokumentbeschreibung_mehrsprachig","ausstellungsdetails"),
"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", "pflicht","beschreibung_mehrsprachig","nachreichbar"),
"public.tbl_dokumentstudiengang" => array("dokument_kurzbz","studiengang_kz","ext_id", "onlinebewerbung", "pflicht","beschreibung_mehrsprachig","nachreichbar","stufe"),
"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", "bezeichnung"),
+126 -8
View File
@@ -34,6 +34,7 @@ $dokument_kurzbz = isset($_REQUEST['dokument_kurzbz']) ? $_REQUEST['dokument_kur
$onlinebewerbung = isset($_REQUEST['onlinebewerbung']);
$pflicht = isset($_POST['pflicht']);
$nachreichbar = isset($_POST['nachreichbar']);
$stufe = isset($_REQUEST['stufe']) ? $_REQUEST['stufe'] : '';
$sprache = new sprache();
$sprache->getAll(true, 'index');
@@ -64,6 +65,7 @@ if($action == 'add')
$dokument->onlinebewerbung = $onlinebewerbung;
$dokument->pflicht = $pflicht;
$dokument->nachreichbar = $nachreichbar;
$dokument->stufe = $stufe;
$beschreibung_mehrsprachig = array();
foreach($sprache->result as $row_sprache)
@@ -128,6 +130,44 @@ if($action === 'togglepflicht')
}
}
// Ändern der Stufe per Ajax
$changeStufe = filter_input(INPUT_POST, 'changeStufe', FILTER_VALIDATE_BOOLEAN);
if ($changeStufe && isset($_POST['stufe']) && isset($_POST['studiengang_kz']))
{
if (!$stufe = filter_input(INPUT_POST, 'stufe', FILTER_VALIDATE_INT))
{
echo json_encode(array(
'status' => 'fehler',
'msg' => '"'.$_POST['stufe'].'" ist kein gültiger Wert für die Stufe'
));
exit();
}
$studiengang_kz = filter_input(INPUT_POST, 'studiengang_kz', FILTER_VALIDATE_INT);
$dokument_kurzbz = filter_input(INPUT_POST, 'dokument_kurzbz');
$dokument = new dokument();
$dokument->loadDokumentStudiengang($dokument_kurzbz, $studiengang_kz);
$dokument->stufe = $stufe;
if (!$dokument->saveDokumentStudiengang())
{
echo json_encode(array(
'status' => 'fehler',
'msg' => $p->t('global/fehlerBeiDerParameteruebergabe')
));
exit();
}
else
{
echo json_encode(array(
'status' => 'ok',
'msg' => 'Status erfolgreich aktualisiert'
));
exit();
}
}
if($action === 'togglenachreichbar')
{
if(!$rechte->isBerechtigt('assistenz', $stg_kz, 'su'))
@@ -188,10 +228,25 @@ echo '<!DOCTYPE HTML>
<script type="text/javascript">
$(document).ready(function()
{
$.tablesorter.addParser({
// set a unique id
id: "stufe",
is: function(s) {
// return false so this parser is not auto detected
return false;
},
format: function(s, table, cell)
{
return $("input", cell).val();
},
// set type, either numeric or text
type: "numeric"
});
$("#t1").tablesorter(
{
sortList: [[0,0]],
widgets: ["zebra"]
widgets: ["zebra"],
headers: {7:{sorter: "stufe"}}
});
$("#t2").tablesorter(
{
@@ -237,6 +292,45 @@ echo '<!DOCTYPE HTML>
forced_root_block: "",
editor_deselector: "mceNoEditor"
});
function changeStufe(dokument_kurzbz)
{
var stufe = $("#stufe_"+dokument_kurzbz).val();
var studiengang_kz = $("#studiengangSelect").val();
data = {
stufe: stufe,
studiengang_kz: studiengang_kz,
dokument_kurzbz: dokument_kurzbz,
changeStufe: true
};
$.ajax({
url: "studiengang_dokumente.php",
data: data,
type: "POST",
dataType: "json",
success: function(data)
{
if(data.status!="ok")
{
$("#feedbackSpanFalse_"+dokument_kurzbz).toggle();
$("#feedbackSpanFalse_"+dokument_kurzbz).attr("title", data["msg"]);
}
else
{
$("#feedbackSpanFalse_"+dokument_kurzbz).hide();
$("#feedbackSpanTrue_"+dokument_kurzbz).toggle();
$("#feedbackSpanTrue_"+dokument_kurzbz).delay(1000).fadeOut();
}
},
error: function(data)
{
alert(data["msg"]);
}
});
}
</script>
<title>Zuordnung Studiengang - Dokumente</title>
</head>
@@ -399,7 +493,7 @@ else
<tr>
<td>
<form action='.$_SERVER['PHP_SELF'].' method="post" name="dokumente_zuteilung">
<select name="stg_kz" onchange="document.dokumente_zuteilung.submit()">';
<select id="studiengangSelect" name="stg_kz" onchange="document.dokumente_zuteilung.submit()">';
echo '<option value="">-- Studiengang auswählen --</option>';
foreach ($studiengang->result as $stg)
{
@@ -450,9 +544,10 @@ else
}
if($rechte->isBerechtigt('assistenz', $stg_kz, 'su'))
{
echo' <th class="sorter-false" style="text-align: center">Online-Bewerbung</th>
<th class="sorter-false" style="text-align: center">Pflicht</th>
<th class="sorter-false" style="text-align: center">Nachreichbar</th>
echo' <th style="text-align: center">Online-Bewerbung</th>
<th style="text-align: center">Pflicht</th>
<th style="text-align: center">Nachreichbar</th>
<th style="text-align: center">Stufe</th>
<th class="sorter-false"></th>';
}
echo'</tr>
@@ -488,9 +583,29 @@ else
}
if($rechte->isBerechtigt('assistenz', $stg_kz, 'su'))
{
echo' <td style="text-align: center"><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 style="text-align: center"><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 style="text-align: center"><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>
echo' <td style="text-align: center">
<div style="display: none">'.$checked_onlinebewerbung.'</div>
<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 style="text-align: center">
<div style="display: none">'.$checked_pflicht.'</div>
<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 style="text-align: center">
<div style="display: none">'.$checked_nachreichbar.'</div>
<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 style="text-align: left; width: 60px">
<input style="width: 30px" type="text" id="stufe_'.$dok->dokument_kurzbz.'" value="'.$dok->stufe.'" tabindex="1" onchange="changeStufe(\''.$dok->dokument_kurzbz.'\')">
<span id="feedbackSpanTrue_'.$dok->dokument_kurzbz.'" style="display: none"><img style="width: 16px" src="../../skin/images/true.png" /></span>
<span id="feedbackSpanFalse_'.$dok->dokument_kurzbz.'" style="display: none" title=""><img style="width: 16px" src="../../skin/images/false.png" /></span>
</td>
<td style="text-align: center">';
if($rechte->isBerechtigt('assistenz', $stg_kz, 'su'))
echo '<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>';
@@ -546,6 +661,9 @@ else
<td class="normal" style="text-align: center" valign="top">
<input type="checkbox" name="nachreichbar" '.($dok_stg->nachreichbar?'checked="checked"':'').'>
</td>
<td class="normal" style="text-align: center" valign="top">
<input type="text" style="width: 30px" name="stufe" value="'.$dok_stg->stufe.'">
</td>
<td class="normal" valign="top"><input type="submit" name="add" value="Speichern"></td>
</tr>
</tfoot>';