mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 12:19:28 +00:00
Anwesenheiten im FAS bei Studenten und Lehrveranstaltungen sichtbar
This commit is contained in:
@@ -72,7 +72,7 @@ if(!$semester || !array_key_exists($semester, $alle_semester))
|
||||
$semester = key($alle_semester);
|
||||
}
|
||||
|
||||
$student->get_lv($uid, $semester);
|
||||
//$student->get_lv($uid, $semester);
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
@@ -100,25 +100,24 @@ $student->get_lv($uid, $semester);
|
||||
</select>
|
||||
</form>';
|
||||
|
||||
if($student->result)
|
||||
$anwesenheit = new anwesenheit();
|
||||
$anwesenheit->loadAnwesenheitStudiensemester($semester, $uid);
|
||||
if($anwesenheit->result)
|
||||
{
|
||||
|
||||
foreach($student->result as $lv)
|
||||
foreach($anwesenheit->result as $aw)
|
||||
{
|
||||
|
||||
$stunden_gesamt = $stundenplan->getStunden($lv->lehreinheit_id);
|
||||
|
||||
if(!$stunden_gesamt)
|
||||
if(!$aw->gesamtstunden)
|
||||
continue;
|
||||
|
||||
$fehlstunden = $anwesenheit->getAnwesenheit($uid, $lv->lehreinheit_id);
|
||||
$le_erledigt = $fehlstunden + $anwesenheit->getAnwesenheit($uid, $lv->lehreinheit_id, true);
|
||||
$anwesenheit_relativ = ($stunden_gesamt - $fehlstunden) / $stunden_gesamt * 100;
|
||||
$fehlstunden = $aw->nichtanwesend;
|
||||
$le_erledigt = $aw->erfassteanwesenheit;
|
||||
$anwesenheit_relativ = $aw->prozent;
|
||||
|
||||
echo '
|
||||
<div class="lv">
|
||||
<div>
|
||||
'.$db->convert_html_chars($lv->bezeichnung).' ('.$lv->lehrform_kurzbz.')
|
||||
'.$db->convert_html_chars($aw->bezeichnung).'
|
||||
</div>
|
||||
<div>
|
||||
<div class="progress-wrapper">
|
||||
@@ -126,7 +125,7 @@ $student->get_lv($uid, $semester);
|
||||
|
||||
</div>
|
||||
</div>'.round($anwesenheit_relativ, 1).'%
|
||||
'.$p->t('anwesenheitsliste/leAbgeschlossen').' ['.$le_erledigt.'/'.$stunden_gesamt.']';
|
||||
'.$p->t('anwesenheitsliste/leAbgeschlossen').' ['.$le_erledigt.'/'.$aw->gesamtstunden.']';
|
||||
|
||||
if($fehlstunden)
|
||||
{
|
||||
@@ -134,8 +133,9 @@ $student->get_lv($uid, $semester);
|
||||
<span class="fehlstunden-details" title="'.$p->t('anwesenheitsliste/fehlstunden').'">>></span>
|
||||
<div style="display: none;">
|
||||
<table><tr><td>'.$p->t('global/datum').'</td><td>'.$p->t('anwesenheitsliste/fehlstunden').'</td></tr>';
|
||||
$abwesend_termine = $anwesenheit->getAbwesendTermine($uid, $lv->lehreinheit_id);
|
||||
foreach($abwesend_termine as $termin)
|
||||
$anwesenheit_termine = new anwesenheit();
|
||||
$anwesenheit_termine->getAnwesenheitLehrveranstaltung($uid, $aw->lehrveranstaltung_id, $semester, false);
|
||||
foreach($anwesenheit_termine->result as $termin)
|
||||
{
|
||||
echo ' <tr>
|
||||
<td>'.$datum_obj->formatDatum($termin->datum,'d.m.Y').'</td>
|
||||
|
||||
@@ -173,7 +173,7 @@ if($lehreinheit_id)
|
||||
<div style="display: none;">
|
||||
<table>
|
||||
<tr><td>'.$p->t('global/datum').'</td><td>'.$p->t('anwesenheitsliste/fehlstunden').'</td></tr>';
|
||||
$abwesend_termine = $anwesenheit->getAbwesendTermine($student->uid, $le->lehreinheit_id);
|
||||
$abwesend_termine = $anwesenheit->getAbwesendTermine($student->uid, $lehreinheit_id);
|
||||
|
||||
foreach($abwesend_termine as $termin)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/* Copyright (C) 2015 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: Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>
|
||||
*/
|
||||
require_once('../config/vilesci.config.inc.php');
|
||||
?>
|
||||
// ********** FUNKTIONEN ********** //
|
||||
var anwesenheitStudentUID='';
|
||||
|
||||
// ****
|
||||
// * Laedt die Trees
|
||||
// ****
|
||||
function loadanwesenheit(student_uid,lehrveranstaltung_id)
|
||||
{
|
||||
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
|
||||
|
||||
anwesenheitStudentUID=student_uid;
|
||||
|
||||
//anwesenheit laden
|
||||
url = "<?php echo APP_ROOT; ?>rdf/anwesenheit.rdf.php?ts="+gettimestamp();
|
||||
|
||||
if(student_uid!='')
|
||||
url=url+"&student_uid="+student_uid;
|
||||
if(lehrveranstaltung_id!='')
|
||||
url=url+"&lehrveranstaltung_id="+lehrveranstaltung_id;
|
||||
|
||||
var treeanwesenheit=document.getElementById('anwesenheit-tree');
|
||||
|
||||
//Alte DS entfernen
|
||||
var oldDatasources = treeanwesenheit.database.GetDataSources();
|
||||
while(oldDatasources.hasMoreElements())
|
||||
{
|
||||
treeanwesenheit.database.RemoveDataSource(oldDatasources.getNext());
|
||||
}
|
||||
|
||||
var rdfService = Components.classes["@mozilla.org/rdf/rdf-service;1"].getService(Components.interfaces.nsIRDFService);
|
||||
var TerminTreeDatasource = rdfService.GetDataSource(url);
|
||||
TerminTreeDatasource.QueryInterface(Components.interfaces.nsIRDFRemoteDataSource);
|
||||
treeanwesenheit.database.AddDataSource(TerminTreeDatasource);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
/* Copyright (C) 2015 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: Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>
|
||||
*/
|
||||
header("Cache-Control: no-cache");
|
||||
header("Cache-Control: post-check=0, pre-check=0",false);
|
||||
header("Expires Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Pragma: no-cache");
|
||||
header("Content-type: application/vnd.mozilla.xul+xml");
|
||||
|
||||
require_once('../config/vilesci.config.inc.php');
|
||||
|
||||
echo '<?xml version="1.0" encoding="UTF-8"?>'."\n";
|
||||
|
||||
echo '<?xml-stylesheet href="'.APP_ROOT.'skin/tempus.css" type="text/css"?>';
|
||||
echo '<?xml-stylesheet href="'.APP_ROOT.'content/bindings.css" type="text/css"?>';
|
||||
|
||||
$student_uid = filter_input(INPUT_GET,'student_uid');
|
||||
$lehrveranstaltung_id= filter_input(INPUT_GET,'lehrveranstaltung_id');
|
||||
|
||||
?>
|
||||
|
||||
<window id="anwesenheit-window" title="anwesenheit"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="loadanwesenheit('<?php echo $student_uid;?>','<?php echo $lehrveranstaltung_id;?>');">
|
||||
|
||||
<script type="application/x-javascript" src="<?php echo APP_ROOT; ?>content/anwesenheit.js.php" />
|
||||
<script type="application/x-javascript" src="<?php echo APP_ROOT; ?>content/functions.js.php" />
|
||||
<script type="application/x-javascript" src="<?php echo APP_ROOT; ?>content/phpRequest.js.php" />
|
||||
<vbox flex="1">
|
||||
<groupbox id="anwesenheit-groupbox-anwesenheit" flex="1">
|
||||
<caption label="Anwesenheit" />
|
||||
<hbox flex="1">
|
||||
<tree id="anwesenheit-tree" seltype="single" hidecolumnpicker="false" flex="1"
|
||||
datasources="rdf:null"
|
||||
ref="http://www.technikum-wien.at/anwesenheit"
|
||||
persist="hidden, height"
|
||||
>
|
||||
<treecols>
|
||||
<treecol id="anwesenheit-treecol-lehrveranstaltung" label="Lehrveranstaltung" flex="1" hidden="<?php echo ($lehrveranstaltung_id==''?'false':'true');?>"
|
||||
class="sortDirectionIndicator"
|
||||
sort="rdf:http://www.technikum-wien.at/anwesenheit/rdf#lehrveranstaltung_bezeichnung" onclick="anwesenheitTreeSort()"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="anwesenheit-treecol-nachname" label="Nachname" flex="1" hidden="<?php echo ($lehrveranstaltung_id==''?'true':'false');?>"
|
||||
class="sortDirectionIndicator"
|
||||
sort="rdf:http://www.technikum-wien.at/anwesenheit/rdf#nachname" onclick="anwesenheitTreeSort()"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="anwesenheit-treecol-vorname" label="Vorname" flex="1" hidden="<?php echo ($lehrveranstaltung_id==''?'true':'false');?>"
|
||||
class="sortDirectionIndicator"
|
||||
sort="rdf:http://www.technikum-wien.at/anwesenheit/rdf#vorname" onclick="anwesenheitTreeSort()"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="anwesenheit-treecol-prozent" label="Anwesenheit in Prozent" flex="1" hidden="false"
|
||||
class="sortDirectionIndicator"
|
||||
sort="rdf:http://www.technikum-wien.at/anwesenheit/rdf#prozent" onclick="anwesenheitTreeSort()"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="anwesenheit-treecol-anwesend" label="Anwesend" flex="1" hidden="true"
|
||||
class="sortDirectionIndicator"
|
||||
sort="rdf:http://www.technikum-wien.at/anwesenheit/rdf#anwesend" onclick="anwesenheitTreeSort()"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="anwesenheit-treecol-nichtanwesend" label="Nicht anwesend" flex="1" hidden="true"
|
||||
class="sortDirectionIndicator"
|
||||
sort="rdf:http://www.technikum-wien.at/anwesenheit/rdf#nichtanwesend" onclick="anwesenheitTreeSort()"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="anwesenheit-treecol-uid" label="UID" flex="1" hidden="true"
|
||||
class="sortDirectionIndicator"
|
||||
sort="rdf:http://www.technikum-wien.at/anwesenheit/rdf#uid" onclick="anwesenheitTreeSort()"/>
|
||||
<splitter class="tree-splitter"/>
|
||||
</treecols>
|
||||
|
||||
<template>
|
||||
<rule>
|
||||
<treechildren>
|
||||
<treeitem uri="rdf:*">
|
||||
<treerow properties="rdf:http://www.technikum-wien.at/anwesenheit/rdf#ampel">
|
||||
<treecell label="rdf:http://www.technikum-wien.at/anwesenheit/rdf#lehrveranstaltung_bezeichnung" />
|
||||
<treecell label="rdf:http://www.technikum-wien.at/anwesenheit/rdf#nachname" />
|
||||
<treecell label="rdf:http://www.technikum-wien.at/anwesenheit/rdf#vorname" />
|
||||
<treecell label="rdf:http://www.technikum-wien.at/anwesenheit/rdf#prozent" />
|
||||
<treecell label="rdf:http://www.technikum-wien.at/anwesenheit/rdf#anwesend" />
|
||||
<treecell label="rdf:http://www.technikum-wien.at/anwesenheit/rdf#nichtanwesend" />
|
||||
<treecell label="rdf:http://www.technikum-wien.at/anwesenheit/rdf#uid" />
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
</rule>
|
||||
</template>
|
||||
</tree>
|
||||
</hbox>
|
||||
</groupbox>
|
||||
|
||||
</vbox>
|
||||
</window>
|
||||
@@ -765,6 +765,12 @@ function LeAuswahl()
|
||||
document.getElementById('lehrveranstaltung-termine').setAttribute('src','termine.xul.php?lehrveranstaltung_id='+lehrveranstaltung_id);
|
||||
}
|
||||
|
||||
if(document.getElementById('lehrveranstaltung-tabs').selectedItem==document.getElementById('lehrveranstaltung-tab-anwesenheit'))
|
||||
{
|
||||
// Anwesenheit Laden
|
||||
document.getElementById('lehrveranstaltung-anwesenheit').setAttribute('src','anwesenheit.xul.php?lehrveranstaltung_id='+lehrveranstaltung_id);
|
||||
}
|
||||
|
||||
LeDetailDisableFields(true);
|
||||
//Details zuruecksetzen
|
||||
LeDetailReset();
|
||||
@@ -2365,3 +2371,25 @@ function LehrveranstaltungTermineIFrameLoad()
|
||||
catch(e)
|
||||
{}
|
||||
}
|
||||
|
||||
/**
|
||||
* Laedt die Anwesenheiten einer Lehrveranstaltung wenn auf den Tab gewechselt wird
|
||||
*/
|
||||
function LehrveranstaltungTermineIFrameLoad()
|
||||
{
|
||||
var tree = document.getElementById('lehrveranstaltung-tree');
|
||||
|
||||
if (tree.currentIndex==-1)
|
||||
return;
|
||||
try
|
||||
{
|
||||
//Ausgewaehlte LV holen
|
||||
var col = tree.columns ? tree.columns["lehrveranstaltung-treecol-lehrveranstaltung_id"] : "lehrveranstaltung-treecol-lehrveranstaltung_id";
|
||||
var lehrveranstaltung_id=tree.view.getCellText(tree.currentIndex,col);
|
||||
|
||||
if(lehrveranstaltung_id!='')
|
||||
document.getElementById('lehrveranstaltung-anwesenheit').setAttribute('src','anwesenheit.xul.php?lehrveranstaltung_id='+lehrveranstaltung_id);
|
||||
}
|
||||
catch(e)
|
||||
{}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,12 @@ header("Pragma: no-cache");
|
||||
header("Content-type: application/vnd.mozilla.xul+xml");
|
||||
|
||||
require_once('../../config/vilesci.config.inc.php');
|
||||
require_once('../../include/functions.inc.php');
|
||||
require_once('../../include/benutzerberechtigung.class.php');
|
||||
|
||||
$user = get_uid();
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($user);
|
||||
|
||||
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>';
|
||||
|
||||
@@ -249,6 +255,11 @@ echo '<?xul-overlay href="'.APP_ROOT.'content/lvplanung/lehrveranstaltungnotenov
|
||||
<tab id="lehrveranstaltung-tab-notizen" label="Notizen" />
|
||||
<tab id="lehrveranstaltung-tab-lvangebot" label="LV-Angebot" />
|
||||
<tab id="lehrveranstaltung-tab-termine" label="Termine" onclick="LehrveranstaltungTermineIFrameLoad()"/>
|
||||
<?php
|
||||
if($rechte->isBerechtigt('student/anwesenheit'))
|
||||
echo '<tab id="lehrveranstaltung-tab-anwesenheit" label="Anwesenheit" onclick="LehrveranstaltungAnwesenheitIFrameLoad();"/>';
|
||||
?>
|
||||
|
||||
</tabs>
|
||||
<tabpanels id="lehrveranstaltung-tabpanels-main" flex="1">
|
||||
<vbox id="lehrveranstaltung-detail" />
|
||||
@@ -259,6 +270,10 @@ echo '<?xul-overlay href="'.APP_ROOT.'content/lvplanung/lehrveranstaltungnotenov
|
||||
</vbox>
|
||||
<vbox id="lehrveranstaltung-lvangebot" />
|
||||
<iframe id="lehrveranstaltung-termine" src="" style="margin-top:10px;" />
|
||||
<?php
|
||||
if($rechte->isBerechtigt('student/anwesenheit'))
|
||||
echo '<iframe id="lehrveranstaltung-anwesenheit" src="" style="margin-top:10px;" />';
|
||||
?>
|
||||
</tabpanels>
|
||||
</tabbox>
|
||||
</vbox>
|
||||
|
||||
@@ -370,6 +370,11 @@ else
|
||||
<tab id="student-tab-funktionen" label="Funktionen" onclick="StudentFunktionIFrameLoad();"/>
|
||||
<tab id="student-tab-notizen" label="Notizen"/>
|
||||
<tab id="student-tab-termine" label="Termine" onclick="StudentTermineIFrameLoad();"/>
|
||||
<?php
|
||||
if($rechte->isBerechtigt('student/anwesenheit'))
|
||||
echo '<tab id="student-tab-anwesenheit" label="Anwesenheit" onclick="StudentAnwesenheitIFrameLoad();"/>';
|
||||
?>
|
||||
|
||||
</tabs>
|
||||
<tabpanels id="student-tabpanels-main" flex="1">
|
||||
<vbox id="student-detail" style="margin-top:10px;" />
|
||||
@@ -394,6 +399,11 @@ else
|
||||
<box class="Notiz" flex="1" id="student-box-notizen"/>
|
||||
</vbox>
|
||||
<iframe id="student-termine" src="" style="margin-top:10px;" />
|
||||
<?php
|
||||
if($rechte->isBerechtigt('student/anwesenheit'))
|
||||
echo '<iframe id="student-anwesenheit" src="" style="margin-top:10px;" />';
|
||||
?>
|
||||
|
||||
</tabpanels>
|
||||
</tabbox>
|
||||
</vbox>
|
||||
|
||||
@@ -1532,6 +1532,12 @@ function StudentAuswahl()
|
||||
document.getElementById('student-termine').setAttribute('src','termine.xul.php?student_uid='+uid);
|
||||
}
|
||||
|
||||
// ***** Anwesenheit *****
|
||||
if(document.getElementById('student-content-tabs').selectedItem==document.getElementById('student-tab-anwesenheit'))
|
||||
{
|
||||
document.getElementById('student-anwesenheit').setAttribute('src','anwesenheit.xul.php?student_uid='+uid);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Notizen laden
|
||||
@@ -5309,6 +5315,19 @@ function StudentTermineIFrameLoad()
|
||||
}
|
||||
}
|
||||
|
||||
// ****
|
||||
// * Laedt den Anwesenheit IFrame
|
||||
// ****
|
||||
function StudentAnwesenheitIFrameLoad()
|
||||
{
|
||||
uid = document.getElementById('student-detail-textbox-uid').value;
|
||||
if(uid!='')
|
||||
{
|
||||
url = 'anwesenheit.xul.php?student_uid='+uid+'&ts='+gettimestamp();
|
||||
document.getElementById('student-anwesenheit').setAttribute('src',url);
|
||||
}
|
||||
}
|
||||
|
||||
// ****
|
||||
// * Funktionen IFrame ins leere zeigen lassen
|
||||
// ****
|
||||
|
||||
@@ -305,6 +305,54 @@ class anwesenheit extends basis_db
|
||||
return $row->einheiten;
|
||||
}
|
||||
|
||||
/**
|
||||
* Liefert die Anwesenheiten/Abwesenheiten eines Studenten bei einer LV
|
||||
*
|
||||
* @param string $student_uid
|
||||
* @param int $lehrveranstaltung_id
|
||||
* @param string $studiensemester_kurzbz
|
||||
* @param boolean $anwesend
|
||||
* @return boolean
|
||||
*/
|
||||
public function getAnwesenheitLehrveranstaltung($student_uid, $lehrveranstaltung_id, $studiensemester_kurzbz, $anwesend=false)
|
||||
{
|
||||
$qry = 'SELECT
|
||||
distinct tbl_anwesenheit.*
|
||||
FROM
|
||||
campus.tbl_anwesenheit
|
||||
JOIN campus.vw_student_lehrveranstaltung USING(uid)
|
||||
WHERE
|
||||
uid='.$this->db_add_param($student_uid).'
|
||||
AND lehrveranstaltung_id='.$this->db_add_param($lehrveranstaltung_id, FHC_INTEGER).'
|
||||
AND studiensemester_kurzbz='.$this->db_add_param($studiensemester_kurzbz).'
|
||||
AND anwesend=' . $this->db_add_param($anwesend, FHC_BOOLEAN).'
|
||||
ORDER BY datum';
|
||||
|
||||
if($result = $this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object($result))
|
||||
{
|
||||
$obj = new anwesenheit();
|
||||
|
||||
$obj->anwesenheit_id = $row->anwesenheit_id;
|
||||
$obj->uid = $row->uid;
|
||||
$obj->einheiten = $row->einheiten;
|
||||
$obj->datum = $row->datum;
|
||||
$obj->anwesend = $this->db_parse_bool($row->anwesend);
|
||||
$obj->lehreinheit_id = $row->lehreinheit_id;
|
||||
$obj->anmerkung = $row->anmerkung;
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Laden der Daten';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Liefert die Termine an denen eine Abwesenheit eingetragen ist.
|
||||
*
|
||||
@@ -384,4 +432,93 @@ class anwesenheit extends basis_db
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Laedt die Anwesenheiten in Prozent von Studierenden bei Lehrveranstaltungen
|
||||
* Wenn die StudentUID uebergeben wird, werden alle Lehrveranstaltungen zu denen der Studierenden zugeteilt ist inkl Prozent der Anwesenheit
|
||||
* Wenn die LehrveranstaltungID uebergeben wird, werden alle Studierenden geholt die zugeteilt sind inkl Prozent der Anwesenheit
|
||||
* Es werden pro Student die Anwesenheiten berechnet aufgrund der Lehreinheit zu der sie zugeordnet sind
|
||||
* @param $studiensemester_kurzbz
|
||||
* @param $student_uid
|
||||
* @param $lehrveranstaltung_id
|
||||
* @return boolean true wenn ok, false im fehlerfall
|
||||
*/
|
||||
public function loadAnwesenheitStudiensemester($studiensemester_kurzbz, $student_uid=null, $lehrveranstaltung_id=null)
|
||||
{
|
||||
$qry = "SELECT lehrveranstaltung_id, bezeichnung, vorname, nachname, uid, sum(anwesend) as anwesend, sum(nichtanwesend) as nichtanwesend, sum(gesamtstunden) as gesamtstunden FROM (
|
||||
SELECT
|
||||
lehrveranstaltung_id, bezeichnung, vorname, nachname, uid,
|
||||
(
|
||||
SELECT
|
||||
sum(einheiten)
|
||||
FROM
|
||||
campus.tbl_anwesenheit
|
||||
WHERE
|
||||
lehreinheit_id=vw_student_lehrveranstaltung.lehreinheit_id
|
||||
AND uid=vw_student_lehrveranstaltung.uid
|
||||
AND anwesend
|
||||
) as anwesend,
|
||||
(
|
||||
SELECT
|
||||
sum(einheiten)
|
||||
FROM
|
||||
campus.tbl_anwesenheit
|
||||
WHERE
|
||||
lehreinheit_id=vw_student_lehrveranstaltung.lehreinheit_id
|
||||
AND uid=vw_student_lehrveranstaltung.uid
|
||||
AND NOT anwesend
|
||||
) as nichtanwesend,
|
||||
(
|
||||
SELECT count(*) anzahl FROM
|
||||
(SELECT datum, stunde FROM campus.vw_stundenplan
|
||||
WHERE lehreinheit_id=vw_student_lehrveranstaltung.lehreinheit_id GROUP BY datum, stunde) as a
|
||||
) as gesamtstunden
|
||||
FROM
|
||||
campus.vw_student_lehrveranstaltung
|
||||
JOIN public.tbl_benutzer USING(uid)
|
||||
JOIN public.tbl_person USING(person_id)
|
||||
WHERE
|
||||
studiensemester_kurzbz=".$this->db_add_param($studiensemester_kurzbz);
|
||||
|
||||
if(!is_null($lehrveranstaltung_id))
|
||||
$qry.=" AND lehrveranstaltung_id=".$this->db_add_param($lehrveranstaltung_id);
|
||||
if(!is_null($student_uid))
|
||||
$qry.=" AND uid=".$this->db_add_param($student_uid);
|
||||
|
||||
$qry.=") as b GROUP BY lehrveranstaltung_id, bezeichnung, vorname, nachname, uid";
|
||||
|
||||
if($lehrveranstaltung_id!='')
|
||||
$qry.=" order by nachname, vorname ";
|
||||
elseif($student_uid!='')
|
||||
$qry.=" order by bezeichnung";
|
||||
|
||||
if($result = $this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object($result))
|
||||
{
|
||||
$obj = new stdClass();
|
||||
$obj->bezeichnung = $row->bezeichnung;
|
||||
$obj->anwesend = $row->anwesend;
|
||||
$obj->nichtanwesend = $row->nichtanwesend;
|
||||
$obj->gesamtstunden = $row->gesamtstunden;
|
||||
|
||||
$obj->erfassteanwesenheit = $row->anwesend+$row->nichtanwesend;
|
||||
if($row->gesamtstunden=='' || $obj->erfassteanwesenheit=='')
|
||||
$obj->prozent=100;
|
||||
else
|
||||
$obj->prozent = number_format(100-(100/$obj->gesamtstunden*$row->nichtanwesend),2);
|
||||
$obj->vorname = $row->vorname;
|
||||
$obj->nachname = $row->nachname;
|
||||
$obj->uid = $row->uid;
|
||||
$obj->lehrveranstaltung_id = $row->lehrveranstaltung_id;
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg='Fehler beim Laden der Daten';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+11
-3
@@ -104,13 +104,15 @@ class rdf
|
||||
* @param $value
|
||||
* @param $cdata
|
||||
*/
|
||||
public function setAttribut($name,$value,$cdata=true)
|
||||
public function setAttribut($name,$value,$cdata=true, $parsetype=null)
|
||||
{
|
||||
if(!isset($this->attr[$this->counter]))
|
||||
$this->attr[$this->counter] = new stdClass();
|
||||
$this->attr[$this->counter]->name=$name;
|
||||
$this->attr[$this->counter]->value=$value;
|
||||
$this->attr[$this->counter]->cdata=$cdata;
|
||||
if(!is_null($parsetype))
|
||||
$this->attr[$this->counter]->parseType=$parsetype;
|
||||
$this->counter++;
|
||||
//var_dump($this->attr);
|
||||
return true;
|
||||
@@ -122,7 +124,7 @@ class rdf
|
||||
public function createRdfHeader()
|
||||
{
|
||||
$this->rdf_text="\n".'<RDF:RDF'."\n\t"
|
||||
.'xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"'."\n\t".'xmlns:'.$this->xml_ns.'="'.$this->rdf_url.'/rdf#"'."\n".'>'."\n\t";
|
||||
.'xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"'."\n\t".'xmlns:nc="http://home.netscape.com/NC-rdf#"'."\n\t".'xmlns:'.$this->xml_ns.'="'.$this->rdf_url.'/rdf#"'."\n".'>'."\n\t";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -134,7 +136,13 @@ class rdf
|
||||
{
|
||||
$this->rdf_text.="\n\t\t".'<RDF:Description id="'.$obj->obj_id.'" about="'.$this->rdf_url.'/'.$obj->obj_id.'" >';
|
||||
foreach ($obj->attr as $attr)
|
||||
$this->rdf_text.="\n\t\t\t<".$this->xml_ns.':'.$attr->name.'><![CDATA['.$attr->value.']]></'.$this->xml_ns.':'.$attr->name.'>';
|
||||
{
|
||||
if(isset($attr->parseType))
|
||||
$parsetype = 'nc:parseType="'.$attr->parseType.'"';
|
||||
else
|
||||
$parsetype='';
|
||||
$this->rdf_text.="\n\t\t\t<".$this->xml_ns.':'.$attr->name.' '.$parsetype.'><![CDATA['.$attr->value.']]></'.$this->xml_ns.':'.$attr->name.'>';
|
||||
}
|
||||
$this->rdf_text.="\n\t\t".'</RDF:Description>';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
/* Copyright (C) 2015 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: Andreas Oesterreicher <oesi@technikum-wien.at>
|
||||
*/
|
||||
require_once('../config/vilesci.config.inc.php');
|
||||
require_once('../include/rdf.class.php');
|
||||
require_once('../include/basis_db.class.php');
|
||||
require_once('../include/functions.inc.php');
|
||||
require_once('../include/benutzerberechtigung.class.php');
|
||||
require_once('../include/variable.class.php');
|
||||
require_once('../include/lehrstunde.class.php');
|
||||
require_once('../include/datum.class.php');
|
||||
require_once('../include/stunde.class.php');
|
||||
require_once('../include/anwesenheit.class.php');
|
||||
|
||||
$user = get_uid();
|
||||
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($user);
|
||||
if(!$rechte->isBerechtigt('student/anwesenheit'))
|
||||
die($rechte->errormsg);
|
||||
|
||||
$variable = new variable();
|
||||
$variable->loadVariables($user);
|
||||
|
||||
$datum_obj = new datum();
|
||||
|
||||
$oRdf = new rdf('ANWESENHEIT','http://www.technikum-wien.at/anwesenheit');
|
||||
|
||||
$student_uid = filter_input(INPUT_GET,'student_uid');
|
||||
$lehrveranstaltung_id = filter_input(INPUT_GET,'lehrveranstaltung_id');
|
||||
$studiensemester_kurzbz = filter_input(INPUT_GET,'studiensemester_kurzbz');
|
||||
if($studiensemester_kurzbz=='')
|
||||
$studiensemester_kurzbz=$variable->variable->semester_aktuell;
|
||||
|
||||
$oRdf->sendHeader();
|
||||
$db = new basis_db();
|
||||
|
||||
$anwesenheit = new anwesenheit();
|
||||
if($student_uid!='')
|
||||
$anwesenheit->loadAnwesenheitStudiensemester($studiensemester_kurzbz, $student_uid);
|
||||
elseif($lehrveranstaltung_id!='')
|
||||
$anwesenheit->loadAnwesenheitStudiensemester($studiensemester_kurzbz,null,$lehrveranstaltung_id);
|
||||
|
||||
$i=0;
|
||||
if(isset($anwesenheit->result) && is_array($anwesenheit->result))
|
||||
{
|
||||
foreach($anwesenheit->result as $row)
|
||||
{
|
||||
$i=$oRdf->newObjekt($i);
|
||||
$oRdf->obj[$i]->setAttribut('lehrveranstaltung_bezeichnung',$row->bezeichnung,true);
|
||||
$oRdf->obj[$i]->setAttribut('prozent',$row->prozent,true,'Integer');
|
||||
$oRdf->obj[$i]->setAttribut('anwesend',$row->anwesend,true);
|
||||
$oRdf->obj[$i]->setAttribut('nichtanwesend',$row->nichtanwesend,true);
|
||||
$oRdf->obj[$i]->setAttribut('vorname',$row->vorname,true);
|
||||
$oRdf->obj[$i]->setAttribut('nachname',$row->nachname,true);
|
||||
$oRdf->obj[$i]->setAttribut('uid',$row->uid,true);
|
||||
|
||||
|
||||
$ampel='makeIt'.$anwesenheit->getAmpel($row->prozent);
|
||||
$oRdf->obj[$i]->setAttribut('ampel',$ampel,true);
|
||||
|
||||
$oRdf->addSequence($i);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$oRdf->sendRdfText();
|
||||
?>
|
||||
@@ -162,3 +162,16 @@ toolbarbutton.stplweekoverlay-toolbarbutton:hover
|
||||
color: #AAAAAA;
|
||||
visibility:hidden;
|
||||
}
|
||||
|
||||
treechildren::-moz-tree-row(makeItred)
|
||||
{
|
||||
background-color: #ff8989;
|
||||
}
|
||||
treechildren::-moz-tree-row(makeItgreen)
|
||||
{
|
||||
background-color: #d8ffd8;
|
||||
}
|
||||
treechildren::-moz-tree-row(makeItyellow)
|
||||
{
|
||||
background-color: #ffe6b5;
|
||||
}
|
||||
|
||||
@@ -3568,6 +3568,7 @@ $berechtigungen = array(
|
||||
array('soap/buchungen','Berechtigung für Buchungsabfrage Addon Kontoimport'),
|
||||
array('student/bankdaten','Bankdaten des Studenten'),
|
||||
array('student/anrechnung','Anrechnungen des Studenten'),
|
||||
array('student/anwesenheit','Anwesenheiten im FAS'),
|
||||
array('student/dokumente','Wenn SUID dann dürfen Dokumente auch wieder entfernt werden'),
|
||||
array('student/noten','Notenverwaltung'),
|
||||
array('student/stammdaten','Stammdaten der Studenten'),
|
||||
|
||||
Reference in New Issue
Block a user