| '.$p->t("global/bezeichnung").' |
'.$p->t("services/leistung").' |
'.$p->t("services/design").' |
+ '.$p->t("services/kritikalitaet").' |
'.$p->t("services/details").' |
@@ -159,6 +158,8 @@ foreach($service->result as $row)
echo '',$design,' | ';
//echo '',$betrieb,' | ';
//echo '',$operativ,' | ';
+ $title = (isset($servicekategorie_arr[$row->servicekategorie_kurzbz])?$servicekategorie_arr[$row->servicekategorie_kurzbz]:'');
+ echo '',$title,' | ';
echo ''.($row->content_id!=''?'Details':'');
if (defined("ADDON_MOODLE_PATH"))
echo ' '.($row->ext_id!=''?'Beschreibung':'');
diff --git a/cis/private/lehre/anwesenheitsliste.php b/cis/private/lehre/anwesenheitsliste.php
index 8b1f28408..0ba5531c8 100644
--- a/cis/private/lehre/anwesenheitsliste.php
+++ b/cis/private/lehre/anwesenheitsliste.php
@@ -62,7 +62,7 @@
$stsem = $_GET['stsem'];
else
die($p->t('anwesenheitsliste/studiensemesterIstUngueltig'));
-
+
$covidhelper = new CovidHelper();
?>
";
- $qry = "SELECT *, tbl_lehreinheitgruppe.studiengang_kz, tbl_lehreinheitgruppe.semester FROM lehre.tbl_lehreinheit JOIN lehre.tbl_lehreinheitgruppe USING(lehreinheit_id) JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id)
- WHERE lehrveranstaltung_id='$lvid' AND studiensemester_kurzbz=".$db->db_add_param($stsem);
-
$qry = "SELECT *, tbl_lehreinheitgruppe.studiengang_kz, tbl_lehreinheitgruppe.semester ,tbl_lehreinheit.lehrform_kurzbz
FROM lehre.tbl_lehreinheit
JOIN lehre.tbl_lehreinheitgruppe USING(lehreinheit_id)
@@ -213,7 +210,7 @@ $covidhelper = new CovidHelper();
$covid_content = "".$p->t('anwesenheitsliste/covidstatuslisten')." | ".$covid_content." ";
else
$covid_content = ($covidhelper->isUdfDefined()) ? $p->t('anwesenheitsliste/keineStudentenVorhanden') : '';
-
+
if($aw_content!='')
$aw_content = "".$p->t('anwesenheitsliste/anwesenheitslisten')." | ".$aw_content." ";
else
@@ -241,9 +238,9 @@ $covidhelper = new CovidHelper();
{
$covid_content = '';
}
-
+
echo "
-
+
| $aw_content |
$covid_content |
diff --git a/cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php b/cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php
index 6dce2b6ae..a799c9fad 100644
--- a/cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php
+++ b/cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php
@@ -102,6 +102,22 @@ $noten_obj->getAll();
$sprachen = new sprache();
$sprachen->getAll(true);
+
+$noten_array = array();
+$js_noten='';
+foreach ($noten_obj->result as $row)
+{
+ $js_noten .= " noten_array['" . $row->note . "']='" . addslashes($row->bezeichnung) . "';\n";
+ $noten_array[$row->note]['bezeichnung'] = $row->bezeichnung;
+ $noten_array[$row->note]['positiv'] = $row->positiv;
+ $noten_array[$row->note]['aktiv'] = $row->aktiv;
+ $noten_array[$row->note]['lehre'] = $row->lehre;
+ $noten_array[$row->note]['lkt_ueberschreibbar'] = $row->lkt_ueberschreibbar;
+ $noten_array[$row->note]['anmerkung'] = $row->anmerkung;
+ foreach ($sprachen->result as $s)
+ $noten_array[$row->note]['bezeichnung_mehrsprachig'][$s->sprache] = $row->bezeichnung_mehrsprachig[$s->sprache];
+}
+
$errormsg = '';
// eingetragene lv-gesamtnoten freigeben
@@ -326,19 +342,7 @@ echo '
var noten_array = Array();
';
-$noten_array = array();
-foreach ($noten_obj->result as $row)
-{
- echo " noten_array['" . $row->note . "']='" . addslashes($row->bezeichnung) . "';\n";
- $noten_array[$row->note]['bezeichnung'] = $row->bezeichnung;
- $noten_array[$row->note]['positiv'] = $row->positiv;
- $noten_array[$row->note]['aktiv'] = $row->aktiv;
- $noten_array[$row->note]['lehre'] = $row->lehre;
- $noten_array[$row->note]['lkt_ueberschreibbar'] = $row->lkt_ueberschreibbar;
- $noten_array[$row->note]['anmerkung'] = $row->anmerkung;
- foreach ($sprachen->result as $s)
- $noten_array[$row->note]['bezeichnung_mehrsprachig'][$s->sprache] = $row->bezeichnung_mehrsprachig[$s->sprache];
-}
+echo $js_noten;
?>
@@ -806,16 +810,16 @@ foreach ($noten_obj->result as $row)
for(row in rows)
{
linenumber++;
- if( rows[row] == '' )
+ if( rows[row] == '' )
{
//skip empty lines
continue;
}
zeile = rows[row].split(" ");
-
+
if( zeile.length < 2 )
{
- alertMsg = alertMsg + "Zeile " + linenumber + ': '
+ alertMsg = alertMsg + "Zeile " + linenumber + ': '
+ 'Zu wenig Paramter - 2 erforderlich. '
+ 'Die Zeile wurde uebersprungen.' + "\n\n";
continue;
@@ -917,36 +921,36 @@ foreach ($noten_obj->result as $row)
for(row in rows)
{
linenumber++;
- if( rows[row] == '' )
+ if( rows[row] == '' )
{
//skip empty lines
continue;
}
zeile = rows[row].split(" ");
-
+
if( zeile.length < 3 )
{
- alertMsg = alertMsg + "Zeile " + linenumber + ': '
+ alertMsg = alertMsg + "Zeile " + linenumber + ': '
+ 'Zu wenig Paramter - 3 erforderlich. '
+ 'Die Zeile wurde uebersprungen.' + "\n\n";
continue;
}
-
+
if( zeile[1] == '' && zeile[2] == '' )
{
- // ignore lines just copied from excel
+ // ignore lines just copied from excel
continue;
}
-
- if( zeile[2] == '' )
+
+ if( zeile[2] == '' )
{
alertMsg = alertMsg + "Zeile " + linenumber + ': '
+ "Die Note oder Punkte fehlen. "
+ "Die Zeile wurde uebersprungen. \n\n";
- continue;
+ continue;
}
-
- if (CIS_GESAMTNOTE_PUNKTE == false)
+
+ if (CIS_GESAMTNOTE_PUNKTE == false)
{
// check for valid grades
if (validGrades.indexOf(zeile[2]) === -1)
@@ -958,7 +962,7 @@ foreach ($noten_obj->result as $row)
}
}
- if( !zeile[1].match(/[0-9]{2}\.[0-9]{2}\.[0-9]{4}/) )
+ if( !zeile[1].match(/[0-9]{2}\.[0-9]{2}\.[0-9]{4}/) )
{
alertMsg = alertMsg + "Zeile " + linenumber + ': '
+ "Das Datum "+zeile[1]+" fehlt oder ist nicht zulaessig. "
diff --git a/cis/private/lehre/benotungstool/nachpruefungeintragen.php b/cis/private/lehre/benotungstool/nachpruefungeintragen.php
index 873c0f173..55954fcda 100644
--- a/cis/private/lehre/benotungstool/nachpruefungeintragen.php
+++ b/cis/private/lehre/benotungstool/nachpruefungeintragen.php
@@ -251,7 +251,7 @@ else
// deshalb wird hier versucht eine passende Lehreinheit zu ermitteln.
$lehreinheit_id = getLehreinheit($db, $lvid, $student_uid, $stsem);
- $response = savePruefung($lvid, $student_uid, $stsem, $lehreinheit_id, $datum, $typ, $note);
+ $response = savePruefung($lvid, $student_uid, $stsem, $lehreinheit_id, $datum, $typ, $note, $punkte);
echo $response;
}
else
diff --git a/cis/private/pdfExport.php b/cis/private/pdfExport.php
index 6db6f885a..ad2bb1fae 100644
--- a/cis/private/pdfExport.php
+++ b/cis/private/pdfExport.php
@@ -65,6 +65,11 @@ $xsl_stg_kz = 0;
$sign = false;
+/* Signing on CIS disabled
+if(isset($_GET['sign']))
+ $sign = true;
+*/
+
// Direkte uebergabe des Studienganges dessen Vorlage verwendet werden soll
if (isset($_GET['xsl_stg_kz']))
$xsl_stg_kz = $_GET['xsl_stg_kz'];
@@ -298,22 +303,18 @@ if ((((isset($_GET["uid"]) && $user == $_GET["uid"])) || $rechte->isBerechtigt('
$dokument->setFilename($filename);
- if (!$dokument->create($output))
- die($dokument->errormsg);
-
if ($sign === true)
{
- if ($dokument->sign($user))
- {
- $dokument->output();
- }
- else
+ if (!$dokument->sign($user))
{
echo $dokument->errormsg;
}
}
- else
- $dokument->output();
+
+ if (!$dokument->create($output))
+ die($dokument->errormsg);
+
+ $dokument->output();
$dokument->close();
}
else
diff --git a/cis/private/tools/zeitaufzeichnung.php b/cis/private/tools/zeitaufzeichnung.php
index 46fd2c4c3..7b1fb1fbb 100644
--- a/cis/private/tools/zeitaufzeichnung.php
+++ b/cis/private/tools/zeitaufzeichnung.php
@@ -1222,7 +1222,6 @@ if ($projekt->getProjekteMitarbeiter($user, true))
";
break;
case 'datepicker':
- $html .= '';
+ $html .= 'kurzbz]))
+ {
+ $html .= ' value="'.$getParams[$filter->kurzbz].'"';
+ }
+ $html .= ' >';
$html .= '';
break;
+ case 'text':
+ $html .= 'htmlattr;
+ if (isset($getParams[$filter->kurzbz]))
+ {
+ $html .= ' value="'.$getParams[$filter->kurzbz].'"';
+ }
+ $html .= '>';
+ break;
}
return $html;
}
diff --git a/include/mitarbeiter.class.php b/include/mitarbeiter.class.php
index bb2a7b478..2802e241d 100644
--- a/include/mitarbeiter.class.php
+++ b/include/mitarbeiter.class.php
@@ -1889,6 +1889,46 @@ class mitarbeiter extends benutzer
}
+ /**
+ * Liefert alle Mitarbeiter*innen
+ *
+ * @param $filter
+ * @return boolean
+ */
+ public function getAll()
+ {
+ $qry = '
+ SELECT
+ ma.mitarbeiter_uid, p.nachname, p.vorname, b.alias
+ FROM
+ public.tbl_mitarbeiter ma
+ JOIN public.tbl_benutzer b ON (mitarbeiter_uid=uid)
+ JOIN public.tbl_person p USING(person_id)
+ ORDER BY p.nachname
+ ';
+
+ if($this->db_query($qry))
+ {
+ while($row = $this->db_fetch_object())
+ {
+ $ma_obj = new mitarbeiter();
+
+ $ma_obj->nachname = $row->nachname;
+ $ma_obj->vorname = $row->vorname;
+ $ma_obj->mitarbeiter_uid = $row->mitarbeiter_uid;
+ $ma_obj->alias = $row->alias;
+
+ $this->maData[] = $ma_obj;
+ }
+ return true;
+ }
+ else
+ {
+ $this->errormsg = 'Fehler beim Laden der Daten';
+ return false;
+ }
+ }
+
/**
* Generiert nächste freie Personalnummer anhand der sequence tbl_mitarbeiter_personalnummer_seq
* @return string $personalnummer
@@ -1947,6 +1987,5 @@ class mitarbeiter extends benutzer
return true;
}
}
-
}
?>
diff --git a/include/projekt.class.php b/include/projekt.class.php
index 389d7140c..1dd7f60fb 100644
--- a/include/projekt.class.php
+++ b/include/projekt.class.php
@@ -413,6 +413,8 @@ class projekt extends basis_db
AND mitarbeiter_uid=" . $this->db_add_param($mitarbeiter_uid);
}
+ $qry .= ' ORDER BY titel';
+
if ($result = $this->db_query($qry))
{
while ($row = $this->db_fetch_object($result))
diff --git a/include/projektphase.class.php b/include/projektphase.class.php
index c1cd8322c..c7b224861 100644
--- a/include/projektphase.class.php
+++ b/include/projektphase.class.php
@@ -190,7 +190,7 @@ class projektphase extends basis_db
if(!is_null($foreignkey))
$qry .= " and projektphase_fk is NULL";
- $qry .= " ORDER BY start, projektphase_fk DESC;";
+ $qry .= " ORDER BY tbl_projektphase.start, tbl_projektphase.bezeichnung, projektphase_fk DESC;";
if($this->db_query($qry))
{
@@ -794,7 +794,8 @@ class projektphase extends basis_db
)
)
AND mitarbeiter_uid = ".$this->db_add_param($mitarbeiter_uid)."
- AND tbl_projekt.projekt_kurzbz = ".$this->db_add_param($projekt_kurzbz);
+ AND tbl_projekt.projekt_kurzbz = ".$this->db_add_param($projekt_kurzbz). "
+ ORDER BY tbl_projektphase.start, tbl_projektphase.bezeichnung";
if($result = $this->db_query($qry))
{
diff --git a/include/statistik.class.php b/include/statistik.class.php
index 34477a548..fd48e7d28 100644
--- a/include/statistik.class.php
+++ b/include/statistik.class.php
@@ -1,655 +1,656 @@
-,
- * Andreas Oesterreicher
- * Karl Burkhart .
- */
-require_once(dirname(__FILE__).'/basis_db.class.php');
-
-class statistik extends basis_db
-{
- public $new;
- public $statistik_obj=array();
- public $result=array();
-
- public $statistik_kurzbz;
- public $content_id;
- public $bezeichnung;
- public $url;
- public $sql;
- public $gruppe;
- public $publish;
- public $insertamum;
- public $insertvon;
- public $updateamum;
- public $udpatevon;
- public $berechtigung_kurzbz;
- public $preferences;
-
- public $studiengang_kz; // integer
- public $prestudent_id; // integer
- public $geschlecht; // char(1)
- public $studiensemester_kurzbz;// varchar(16)
- public $ausbildungssemester;// smallint
-
- public $anzahl; //Hilfsvariable fuer Group BY Abfragen
-
- // Daten der Statistik
- public $data; // DB ressource
- public $html;
- public $countRows;
- public $csv;
- public $json;
-
- /**
- * Konstruktor
- */
- public function __construct($statistik_kurzbz=null)
- {
- parent::__construct();
-
- if(!is_null($statistik_kurzbz))
- $this->load($statistik_kurzbz);
- else
- $this->new=true;
- }
-
- /**
- * Laedt eine Statistik
- * @param $statistik_kurzbz
- */
- public function load($statistik_kurzbz)
- {
- $qry = "SELECT
- *
- FROM
- public.tbl_statistik
- WHERE
- statistik_kurzbz = " . $this->db_add_param($statistik_kurzbz);
-
- if($result = $this->db_query($qry))
- {
- if($row = $this->db_fetch_object($result))
- {
- $this->statistik_kurzbz = $row->statistik_kurzbz;
- $this->content_id = $row->content_id;
- $this->bezeichnung = $row->bezeichnung;
- $this->url = $row->url;
- $this->sql = $row->sql;
- $this->gruppe = $row->gruppe;
- $this->publish = $this->db_parse_bool($row->publish);
- $this->insertamum = $row->insertamum;
- $this->insertvon = $row->insertvon;
- $this->updateamum = $row->updateamum;
- $this->udpatevon = $row->updatevon;
- $this->berechtigung_kurzbz = $row->berechtigung_kurzbz;
- $this->preferences = $row->preferences;
- $this->new = false;
-
- return true;
- }
- else
- {
- $this->errormsg = 'Dieser Eintrag wurde nicht gefunden: ' . $statistik_kurzbz;
- return false;
- }
- }
- else
- {
- $this->errormsg = 'Fehler beim Laden der Daten';
- return false;
- }
- }
-
- /**
- * Laedt alle Statistiken
- * @return true wenn ok, sonst false
- */
- public function getAll($order = FALSE)
- {
- $qry = 'SELECT * FROM public.tbl_statistik';
-
- if($order)
- $qry .= ' ORDER BY ' . $order;
-
- if($result = $this->db_query($qry))
- {
- while($row = $this->db_fetch_object($result))
- {
- $obj = new statistik();
-
- $obj->statistik_kurzbz = $row->statistik_kurzbz;
- $obj->content_id = $row->content_id;
- $obj->bezeichnung = $row->bezeichnung;
- $obj->url = $row->url;
- $obj->sql = $row->sql;
- $obj->gruppe = $row->gruppe;
- $obj->publish = $this->db_parse_bool($row->publish);
- $obj->insertamum = $row->insertamum;
- $obj->insertvon = $row->insertvon;
- $obj->updateamum = $row->updateamum;
- $obj->updatevon = $row->updatevon;
- $obj->berechtigung_kurzbz = $row->berechtigung_kurzbz;
- $obj->preferences = $row->preferences;
-
- $this->result[] = $obj;
- }
-
- return true;
- }
- else
- {
- $this->errormsg = 'Fehler beim Laden der Daten';
- return false;
- }
- }
- /**
- * Laedt alle Statistiken einer Gruppe, Parameter publish zum Filtern.
- * @return true wenn ok, sonst false
- */
- public function getGruppe($gruppe,$publish=null)
- {
- $qry = "SELECT * FROM public.tbl_statistik WHERE gruppe=".$this->db_add_param($gruppe);
- if ($publish===true)
- $qry.=' AND publish ';
- elseif ($publish===false)
- $qry.=' AND NOT publish ';
- $qry.=' ORDER BY bezeichnung;';
-
- if($result = $this->db_query($qry))
- {
- while($row = $this->db_fetch_object($result))
- {
- $obj = new statistik();
-
- $obj->statistik_kurzbz = $row->statistik_kurzbz;
- $obj->content_id = $row->content_id;
- $obj->bezeichnung = $row->bezeichnung;
- $obj->url = $row->url;
- $obj->sql = $row->sql;
- $obj->gruppe = $row->gruppe;
- $obj->publish = $this->db_parse_bool($row->publish);
- $obj->insertamum = $row->insertamum;
- $obj->insertvon = $row->insertvon;
- $obj->updateamum = $row->updateamum;
- $obj->udpatevon = $row->updatevon;
- $obj->berechtigung_kurzbz = $row->berechtigung_kurzbz;
- $obj->preferences = $row->preferences;
-
- $this->result[] = $obj;
- }
-
- return true;
- }
- else
- {
- $this->errormsg = 'Fehler beim Laden der Daten';
- return false;
- }
- }
- /**
- * Laedt alle Statistik Gruppen, Parameter publish zum Filtern.
- * @return true wenn ok, sonst false
- */
- public function getAnzahlGruppe($publish = null)
- {
- $qry = 'SELECT gruppe, count(*) AS anzahl FROM public.tbl_statistik ';
-
- if($publish === true)
- {
- $qry .= 'WHERE publish ';
- }
- elseif($publish === false)
- {
- $qry .= 'WHERE NOT publish ';
- }
-
- $qry .= ' GROUP BY gruppe ORDER BY gruppe;';
-
- if($result = $this->db_query($qry))
- {
- while($row = $this->db_fetch_object($result))
- {
- $obj = new statistik();
-
- $obj->gruppe = $row->gruppe;
- $obj->anzahl = $row->anzahl;
-
- $this->result[] = $obj;
- }
-
- return true;
- }
- else
- {
- $this->errormsg = 'Fehler beim Laden der Daten';
- return false;
- }
- }
- /**
- * Speichert einen Statistik Datensatz
- * @param $new boolean
- * @return boolean true wenn ok false im Fehlerfalls
- */
- public function save($new=null)
- {
- if(is_null($new))
- $new = $this->new;
-
- /* Da derzeit die statistik_kurzbz der primary key in der DB ist,
- * darf er vorerst nur [a-zA-Z0-9_] (\w) enthalten. (bis auf autoincrement
- * integer umgestellt ist)
- */
- $this->statistik_kurzbz = preg_replace('/\W/', '', $this->statistik_kurzbz);
-
- if($new)
- {
- $qry = 'INSERT INTO public.tbl_statistik(statistik_kurzbz, content_id, bezeichnung, url, sql,
- gruppe, publish, insertamum, insertvon, updateamum, updatevon, preferences, berechtigung_kurzbz) VALUES('.
- $this->db_add_param($this->statistik_kurzbz).','.
- $this->db_add_param($this->content_id,FHC_INTEGER).','.
- $this->db_add_param($this->bezeichnung).','.
- $this->db_add_param($this->url).','.
- $this->db_add_param($this->sql).','.
- $this->db_add_param($this->gruppe).','.
- $this->db_add_param($this->publish, FHC_BOOLEAN).','.
- $this->db_add_param($this->insertamum).','.
- $this->db_add_param($this->insertvon).','.
- $this->db_add_param($this->updateamum).','.
- $this->db_add_param($this->updatevon).','.
- $this->db_add_param($this->preferences).','.
- $this->db_add_param($this->berechtigung_kurzbz).');';
- }
- else
- {
- if($this->statistik_kurzbz_orig=='')
- $this->statistik_kurzbz_orig=$this->statistik_kurzbz;
- $qry = 'UPDATE public.tbl_statistik SET
- content_id='.$this->db_add_param($this->content_id,FHC_INTEGER).','.
- ' bezeichnung='.$this->db_add_param($this->bezeichnung).','.
- ' statistik_kurzbz='.$this->db_add_param($this->statistik_kurzbz).','.
- ' url='.$this->db_add_param($this->url).','.
- ' sql='.$this->db_add_param($this->sql).','.
- ' gruppe='.$this->db_add_param($this->gruppe).','.
- ' publish='.$this->db_add_param($this->publish, FHC_BOOLEAN).','.
- ' insertamum='.$this->db_add_param($this->insertamum).','.
- ' insertvon='.$this->db_add_param($this->insertvon).','.
- ' updateamum='.$this->db_add_param($this->updateamum).','.
- ' updatevon='.$this->db_add_param($this->updatevon).','.
- ' preferences='.$this->db_add_param($this->preferences).','.
- ' berechtigung_kurzbz='.$this->db_add_param($this->berechtigung_kurzbz).
- ' WHERE statistik_kurzbz='.$this->db_add_param($this->statistik_kurzbz_orig,FHC_STRING,false);
- }
- //echo $qry;
- if($this->db_query($qry))
- {
- return true;
- }
- else
- {
- $this->errormsg='Fehler beim Speichern der Daten';
- return false;
- }
- }
-
- /**
- * Liefert ein Array mit den Menueeintraegen der Statistiken
- * Mit dem Returnwert dieser Funktion wird die entsprechende Stelle im
- * Menue ueberschrieben
- * @return Array fuer Menue
- */
- public function getMenueArray()
- {
- $arr = array();
-
- $qry = "SELECT
- *
- FROM
- public.tbl_statistik
- ORDER BY gruppe, bezeichnung, statistik_kurzbz";
-
- if($result = $this->db_query($qry))
- {
- $lastgruppe='';
- while($row = $this->db_fetch_object($result))
- {
- if($row->gruppe!='' && $row->gruppe!=$lastgruppe)
- {
- $arr[$row->gruppe]=array('name'=>$row->gruppe);
- $lastgruppe=$row->gruppe;
- }
- if($row->gruppe!='')
- {
- $arr[$row->gruppe][$row->statistik_kurzbz]=array('name'=>$row->bezeichnung, 'link'=>APP_ROOT.'vilesci/statistik/statistik_frameset.php?statistik_kurzbz='.$row->statistik_kurzbz, 'target'=>'main');
- if($row->berechtigung_kurzbz!='')
- $arr[$row->gruppe][$row->statistik_kurzbz]['permissions']=array($row->berechtigung_kurzbz);
- }
- else
- {
- $arr[$row->statistik_kurzbz]=array('name'=>$row->bezeichnung, 'link'=>APP_ROOT.'vilesci/statistik/statistik_frameset.php?statistik_kurzbz='.$row->statistik_kurzbz, 'target'=>'main');
- if($row->berechtigung_kurzbz!='')
- $arr[$row->statistik_kurzbz]['permissions']=array($row->berechtigung_kurzbz);
- }
- }
- }
- return $arr;
- }
-
- /**
- * Loescht einen Eintrag
- *
- * @param $statistik_kurzbz
- * @return true wenn ok, sonst false
- */
- public function delete($statistik_kurzbz)
- {
- $qry = "DELETE FROM public.tbl_statistik WHERE statistik_kurzbz=".$this->db_add_param($statistik_kurzbz).";";
-
- if($this->db_query($qry))
- {
- return true;
- }
- else
- {
- $this->errormsg='Fehler beim Löschen des Eintrages';
- return false;
- }
- }
-
-
-
- /**
- * Laedt bestimmte PreStudenten
- * @param studiengang_kz KZ des Studienganges der zu Laden ist
- * @param studiensemester_kurzbz Studiensemester
- * @param ausbildungssemester KZ Ausbildungssemester
- * @param datum_stichtag Stichtag im ISO-Format, Ergebniss filtert auf <= (kleiner,gleich)
- * @return true wenn ok, false im Fehlerfall
- */
- public function get_prestudenten($studiengang_kz, $studiensemester_kurzbz, $ausbildungssemester=null, $datum_stichtag=null)
- {
- if(!is_numeric($studiengang_kz))
- {
- $this->errormsg = 'Studiengang_kz muss eine gueltige Zahl sein';
- return false;
- }
-
- if($ausbildungssemester!='' && !is_numeric($ausbildungssemester))
- {
- $this->errormsg = 'Ausbildungssemester muss eine gueltige Zahl sein';
- return false;
- }
-
- // Neue Studenten ermitteln
- $qry="
- SELECT
- DISTINCT prestudent_id, geschlecht, studiengang_kz, ausbildungssemester, studiensemester_kurzbz
- FROM
- public.tbl_prestudent
- JOIN public.tbl_prestudentstatus status USING (prestudent_id)
- JOIN public.tbl_person USING (person_id)
- WHERE
- status_kurzbz='Student'
- AND NOT EXISTS(SELECT 1 FROM public.tbl_prestudentstatus WHERE status_kurzbz='Student' AND datumdb_add_param($studiensemester_kurzbz);
- if (!is_null($datum_stichtag))
- $qry.=" AND datum <=".$this->db_add_param($datum_stichtag);
- $qry.=') ';
- $qry.=" OR (studiensemester_kurzbz=".$this->db_add_param($studiensemester_kurzbz);
- if (!is_null($datum_stichtag))
- $qry.=" AND datum <=".$this->db_add_param($datum_stichtag);
- $qry.="))";
- $qry.=" ORDER BY prestudent_id;";
-
- if($result = $this->db_query($qry))
- {
- while($row = $this->db_fetch_object($result))
- {
- $stat_obj = new statistik();
- $stat_obj->studiengang_kz=$row->studiengang_kz;
- $stat_obj->ausbildungssemester=$row->ausbildungssemester;
- $stat_obj->prestudent_id=$row->prestudent_id;
- $stat_obj->geschlecht=$row->geschlecht;
- $stat_obj->studiensemester_kurzbz=$row->studiensemester_kurzbz;
- $this->statistik_obj[]=$stat_obj;
- }
- }
- else
- {
- $this->errormsg = 'Datensatz konnte nicht geladen werden';
- return false;
- }
-
- return true;
- }
-
- /**
- *
- * Liefert die DropOut Rate
- * @param unknown_type $studiengang_kz
- * @param unknown_type $studiensemester_kurzbz
- * @param unknown_type $ausbildungssemester
- * @param unknown_type $datum_stichtag
- */
- public function get_DropOut($studiengang_kz, $studiensemester_kurzbz, $ausbildungssemester=null, $datum_stichtag=null)
- {
- $this->statistik_obj=array();
-
- if(!is_numeric($studiengang_kz))
- {
- $this->errormsg = 'Studiengang_kz muss eine gueltige Zahl sein';
- return false;
- }
-
- if($ausbildungssemester!='' && !is_numeric($ausbildungssemester))
- {
- $this->errormsg = 'Ausbildungssemester muss eine gueltige Zahl sein';
- return false;
- }
-
- // Neue Studenten ermitteln
- $qry="SELECT DISTINCT prestudent_id, geschlecht, studiengang_kz, ausbildungssemester, studiensemester_kurzbz
- FROM tbl_prestudent JOIN tbl_prestudentstatus USING (prestudent_id) JOIN tbl_person USING (person_id)
- WHERE (status_kurzbz='Abbrecher')
- AND studiengang_kz=".$this->db_add_param($studiengang_kz);
- if($ausbildungssemester!='')
- $qry.=" AND ausbildungssemester=".$this->db_add_param($ausbildungssemester);
-
- $qry.=" AND (studiensemester_kurzbz=".$this->db_add_param($studiensemester_kurzbz);
- if (!is_null($datum_stichtag))
- $qry.=" AND datum <=".$this->db_add_param($datum_stichtag);
- $qry.=') ';
- $qry.=" ORDER BY prestudent_id;";
-
- if($result = $this->db_query($qry))
- {
- while($row = $this->db_fetch_object($result))
- {
- $stat_obj = new statistik();
- $stat_obj->studiengang_kz=$row->studiengang_kz;
- $stat_obj->ausbildungssemester=$row->ausbildungssemester;
- $stat_obj->prestudent_id=$row->prestudent_id;
- $stat_obj->geschlecht=$row->geschlecht;
- $stat_obj->studiensemester_kurzbz=$row->studiensemester_kurzbz;
- $this->statistik_obj[]=$stat_obj;
- }
- }
- else
- {
- $this->errormsg = 'Datensatz konnte nicht geladen werden';
- return false;
- }
-
- return true;
- }
-
- /**
- * Laedt die Daten einer Statistik (derzeit nur SQL)
- * @param $statistik_kurzbz
- */
- public function loadData()
- {
- $this->html='';
- $this->csv='';
- $this->json=array();
- $this->countRows=0;
- set_time_limit(600);
-
- // In case a decryption function is used then perform password substitution
- $this->sql = $this->replaceSQLDecryptionPassword($this->sql);
-
- if($this->sql!='')
- {
- $sql = $this->sql;
-
- // Wenn im SQL ein $user vorkommt wird das durch den eingeloggten User ersetzt
- if(strpos($sql, '$user')!==false)
- {
- $uid = get_uid();
- $sql = str_replace('$user',$this->db_add_param($uid),$sql);
- }
- foreach($_REQUEST as $name=>$value)
- {
- // Inputs, die in eckigen Klammern stehen, werden als Array interpretiert
- if (is_string($value) && substr($value, 0, 1) == '[' && substr($value, -1) == ']')
- {
- //Eckige Klammern entfernen und String aufsplitten
- $value = substr($value, 1);
- $value = substr($value, 0, -1);
- $value = explode(',', $value);
- }
- if (is_array($value))
- {
- $in = $this->db_implode4SQL($value);
- $sql = str_replace('$'.$name,$in,$sql);
- }
- else
- $sql = str_replace('$'.$name,$this->db_add_param($value),$sql);
- }
- if($this->data = $this->db_query($sql))
- {
- $this->html.= '';
- $anzahl_spalten = $this->db_num_fields($this->data);
- for($spalte=0;$spalte<$anzahl_spalten;$spalte++)
- {
- $this->html.= '| '.$this->convert_html_chars($this->db_field_name($this->data,$spalte)).' | ';
- $this->csv.='"'.$this->db_field_name($this->data,$spalte).'",';
- }
- $this->html.= ' ';
- $this->csv=substr($this->csv,0,-1)."\n";
- while($row = $this->db_fetch_object($this->data))
- {
- $this->html.= '';
- $anzahl_spalten = $this->db_num_fields($this->data);
-
- for($spalte=0;$spalte<$anzahl_spalten;$spalte++)
- {
- $name = $this->db_field_name($this->data,$spalte);
- $this->html.= '| '.$this->convert_html_chars($row->$name).' | ';
- // Umwandeln von Punkt in Komma bei Float-Werten
- if (is_numeric($row->$name))
- {
- if (strpos($row->$name,'.') != false)
- $row->$name = number_format($row->$name,2,",","");
- }
- $this->csv.= '"'.$row->$name.'",';
- }
-
- $this->json[] = $row;
- $this->html.= ' ';
- $this->csv=substr($this->csv,0,-1)."\n";
- $this->countRows++;
- }
- $this->html.= '';
- }
- return true;
- }
- else
- {
- $this->errormsg= 'Zu dieser Statistik gibt es keine SQL Abfrage';
- return false;
- }
- }
-
- function getHtmlTable($id, $class='')
- {
- return ''.$this->countRows.' Zeilen ';
- }
-
- function getCSV()
- {
- return $this->csv;
- }
-
- function writeCSV($filename, $delimiter=',', $enclosure='"')
- {
- $fh=fopen($filename,'w');
-
- $fieldnames=array();
- for ($i=0; $i < $this->db_num_fields($this->data); $i++)
- $fieldnames[]=$this->db_field_name($this->data,$i);
- fputcsv($fh, $fieldnames, $delimiter, $enclosure);
- $this->db_result_seek($this->data,0);
- while ($row = $this->db_fetch_row($this->data))
- fputcsv($fh, $row, $delimiter, $enclosure);
- fclose($fh);
- return true;
- }
-
- function getJSON()
- {
- return json_encode($this->json);
- }
-
- function getArray()
- {
- return $this->json;
- }
-
- /**
- *
- * Parst Variablen aus einem String und liefert diese als Array zurueck
- * @param $value String mit Variablen
- * z.B.: "Select * from tbl_person where person_id<'$person_id'"
- * oder "../content/statistik/bewerberstatistik.php?stsem=$StSem&stg_kz=$stg_kz"
- *
- * @return Array mit den Variablennamen
- */
- function parseVars($value)
- {
- $result = array();
-
- $check = '/\$[0-9A-z]+/';
- preg_match_all($check, $value, $result);
- $result = $result[0];
- $vars = array();
- for($i=0;$i,
+ * Andreas Oesterreicher
+ * Karl Burkhart .
+ */
+require_once(dirname(__FILE__).'/basis_db.class.php');
+
+class statistik extends basis_db
+{
+ public $new;
+ public $statistik_obj=array();
+ public $result=array();
+
+ public $statistik_kurzbz;
+ public $content_id;
+ public $bezeichnung;
+ public $url;
+ public $sql;
+ public $gruppe;
+ public $publish;
+ public $insertamum;
+ public $insertvon;
+ public $updateamum;
+ public $udpatevon;
+ public $berechtigung_kurzbz;
+ public $preferences;
+
+ public $studiengang_kz; // integer
+ public $prestudent_id; // integer
+ public $geschlecht; // char(1)
+ public $studiensemester_kurzbz;// varchar(16)
+ public $ausbildungssemester;// smallint
+
+ public $anzahl; //Hilfsvariable fuer Group BY Abfragen
+
+ // Daten der Statistik
+ public $data; // DB ressource
+ public $html;
+ public $countRows;
+ public $csv;
+ public $json;
+
+ /**
+ * Konstruktor
+ */
+ public function __construct($statistik_kurzbz=null)
+ {
+ parent::__construct();
+
+ if(!is_null($statistik_kurzbz))
+ $this->load($statistik_kurzbz);
+ else
+ $this->new=true;
+ }
+
+ /**
+ * Laedt eine Statistik
+ * @param $statistik_kurzbz
+ */
+ public function load($statistik_kurzbz)
+ {
+ $qry = "SELECT
+ *
+ FROM
+ public.tbl_statistik
+ WHERE
+ statistik_kurzbz = " . $this->db_add_param($statistik_kurzbz);
+
+ if($result = $this->db_query($qry))
+ {
+ if($row = $this->db_fetch_object($result))
+ {
+ $this->statistik_kurzbz = $row->statistik_kurzbz;
+ $this->content_id = $row->content_id;
+ $this->bezeichnung = $row->bezeichnung;
+ $this->url = $row->url;
+ $this->sql = $row->sql;
+ $this->gruppe = $row->gruppe;
+ $this->publish = $this->db_parse_bool($row->publish);
+ $this->insertamum = $row->insertamum;
+ $this->insertvon = $row->insertvon;
+ $this->updateamum = $row->updateamum;
+ $this->udpatevon = $row->updatevon;
+ $this->berechtigung_kurzbz = $row->berechtigung_kurzbz;
+ $this->preferences = $row->preferences;
+ $this->new = false;
+
+ return true;
+ }
+ else
+ {
+ $this->errormsg = 'Dieser Eintrag wurde nicht gefunden: ' . $statistik_kurzbz;
+ return false;
+ }
+ }
+ else
+ {
+ $this->errormsg = 'Fehler beim Laden der Daten';
+ return false;
+ }
+ }
+
+ /**
+ * Laedt alle Statistiken
+ * @return true wenn ok, sonst false
+ */
+ public function getAll($order = FALSE)
+ {
+ $qry = 'SELECT * FROM public.tbl_statistik';
+
+ if($order)
+ $qry .= ' ORDER BY ' . $order;
+
+ if($result = $this->db_query($qry))
+ {
+ while($row = $this->db_fetch_object($result))
+ {
+ $obj = new statistik();
+
+ $obj->statistik_kurzbz = $row->statistik_kurzbz;
+ $obj->content_id = $row->content_id;
+ $obj->bezeichnung = $row->bezeichnung;
+ $obj->url = $row->url;
+ $obj->sql = $row->sql;
+ $obj->gruppe = $row->gruppe;
+ $obj->publish = $this->db_parse_bool($row->publish);
+ $obj->insertamum = $row->insertamum;
+ $obj->insertvon = $row->insertvon;
+ $obj->updateamum = $row->updateamum;
+ $obj->updatevon = $row->updatevon;
+ $obj->berechtigung_kurzbz = $row->berechtigung_kurzbz;
+ $obj->preferences = $row->preferences;
+
+ $this->result[] = $obj;
+ }
+
+ return true;
+ }
+ else
+ {
+ $this->errormsg = 'Fehler beim Laden der Daten';
+ return false;
+ }
+ }
+ /**
+ * Laedt alle Statistiken einer Gruppe, Parameter publish zum Filtern.
+ * @return true wenn ok, sonst false
+ */
+ public function getGruppe($gruppe,$publish=null)
+ {
+ $qry = "SELECT * FROM public.tbl_statistik WHERE gruppe=".$this->db_add_param($gruppe);
+ if ($publish===true)
+ $qry.=' AND publish ';
+ elseif ($publish===false)
+ $qry.=' AND NOT publish ';
+ $qry.=' ORDER BY bezeichnung;';
+
+ if($result = $this->db_query($qry))
+ {
+ while($row = $this->db_fetch_object($result))
+ {
+ $obj = new statistik();
+
+ $obj->statistik_kurzbz = $row->statistik_kurzbz;
+ $obj->content_id = $row->content_id;
+ $obj->bezeichnung = $row->bezeichnung;
+ $obj->url = $row->url;
+ $obj->sql = $row->sql;
+ $obj->gruppe = $row->gruppe;
+ $obj->publish = $this->db_parse_bool($row->publish);
+ $obj->insertamum = $row->insertamum;
+ $obj->insertvon = $row->insertvon;
+ $obj->updateamum = $row->updateamum;
+ $obj->udpatevon = $row->updatevon;
+ $obj->berechtigung_kurzbz = $row->berechtigung_kurzbz;
+ $obj->preferences = $row->preferences;
+
+ $this->result[] = $obj;
+ }
+
+ return true;
+ }
+ else
+ {
+ $this->errormsg = 'Fehler beim Laden der Daten';
+ return false;
+ }
+ }
+ /**
+ * Laedt alle Statistik Gruppen, Parameter publish zum Filtern.
+ * @return true wenn ok, sonst false
+ */
+ public function getAnzahlGruppe($publish = null)
+ {
+ $qry = 'SELECT gruppe, count(*) AS anzahl FROM public.tbl_statistik ';
+
+ if($publish === true)
+ {
+ $qry .= 'WHERE publish ';
+ }
+ elseif($publish === false)
+ {
+ $qry .= 'WHERE NOT publish ';
+ }
+
+ $qry .= ' GROUP BY gruppe ORDER BY gruppe;';
+
+ if($result = $this->db_query($qry))
+ {
+ while($row = $this->db_fetch_object($result))
+ {
+ $obj = new statistik();
+
+ $obj->gruppe = $row->gruppe;
+ $obj->anzahl = $row->anzahl;
+
+ $this->result[] = $obj;
+ }
+
+ return true;
+ }
+ else
+ {
+ $this->errormsg = 'Fehler beim Laden der Daten';
+ return false;
+ }
+ }
+ /**
+ * Speichert einen Statistik Datensatz
+ * @param $new boolean
+ * @return boolean true wenn ok false im Fehlerfalls
+ */
+ public function save($new=null)
+ {
+ if(is_null($new))
+ $new = $this->new;
+
+ /* Da derzeit die statistik_kurzbz der primary key in der DB ist,
+ * darf er vorerst nur [a-zA-Z0-9_] (\w) enthalten. (bis auf autoincrement
+ * integer umgestellt ist)
+ */
+ $this->statistik_kurzbz = preg_replace('/\W/', '', $this->statistik_kurzbz);
+
+ if($new)
+ {
+ $qry = 'INSERT INTO public.tbl_statistik(statistik_kurzbz, content_id, bezeichnung, url, sql,
+ gruppe, publish, insertamum, insertvon, updateamum, updatevon, preferences, berechtigung_kurzbz) VALUES('.
+ $this->db_add_param($this->statistik_kurzbz).','.
+ $this->db_add_param($this->content_id,FHC_INTEGER).','.
+ $this->db_add_param($this->bezeichnung).','.
+ $this->db_add_param($this->url).','.
+ $this->db_add_param($this->sql).','.
+ $this->db_add_param($this->gruppe).','.
+ $this->db_add_param($this->publish, FHC_BOOLEAN).','.
+ $this->db_add_param($this->insertamum).','.
+ $this->db_add_param($this->insertvon).','.
+ $this->db_add_param($this->updateamum).','.
+ $this->db_add_param($this->updatevon).','.
+ $this->db_add_param($this->preferences).','.
+ $this->db_add_param($this->berechtigung_kurzbz).');';
+ }
+ else
+ {
+ if($this->statistik_kurzbz_orig=='')
+ $this->statistik_kurzbz_orig=$this->statistik_kurzbz;
+ $qry = 'UPDATE public.tbl_statistik SET
+ content_id='.$this->db_add_param($this->content_id,FHC_INTEGER).','.
+ ' bezeichnung='.$this->db_add_param($this->bezeichnung).','.
+ ' statistik_kurzbz='.$this->db_add_param($this->statistik_kurzbz).','.
+ ' url='.$this->db_add_param($this->url).','.
+ ' sql='.$this->db_add_param($this->sql).','.
+ ' gruppe='.$this->db_add_param($this->gruppe).','.
+ ' publish='.$this->db_add_param($this->publish, FHC_BOOLEAN).','.
+ ' insertamum='.$this->db_add_param($this->insertamum).','.
+ ' insertvon='.$this->db_add_param($this->insertvon).','.
+ ' updateamum='.$this->db_add_param($this->updateamum).','.
+ ' updatevon='.$this->db_add_param($this->updatevon).','.
+ ' preferences='.$this->db_add_param($this->preferences).','.
+ ' berechtigung_kurzbz='.$this->db_add_param($this->berechtigung_kurzbz).
+ ' WHERE statistik_kurzbz='.$this->db_add_param($this->statistik_kurzbz_orig,FHC_STRING,false);
+ }
+ //echo $qry;
+ if($this->db_query($qry))
+ {
+ return true;
+ }
+ else
+ {
+ $this->errormsg='Fehler beim Speichern der Daten';
+ return false;
+ }
+ }
+
+ /**
+ * Liefert ein Array mit den Menueeintraegen der Statistiken
+ * Mit dem Returnwert dieser Funktion wird die entsprechende Stelle im
+ * Menue ueberschrieben
+ * @return Array fuer Menue
+ */
+ public function getMenueArray()
+ {
+ $arr = array();
+
+ $qry = "SELECT
+ *
+ FROM
+ public.tbl_statistik
+ ORDER BY gruppe, bezeichnung, statistik_kurzbz";
+
+ if($result = $this->db_query($qry))
+ {
+ $lastgruppe='';
+ while($row = $this->db_fetch_object($result))
+ {
+ if($row->gruppe!='' && $row->gruppe!=$lastgruppe)
+ {
+ $arr[$row->gruppe]=array('name'=>$row->gruppe);
+ $lastgruppe=$row->gruppe;
+ }
+ if($row->gruppe!='')
+ {
+ $arr[$row->gruppe][$row->statistik_kurzbz]=array('name'=>$row->bezeichnung, 'link'=>APP_ROOT.'vilesci/statistik/statistik_frameset.php?statistik_kurzbz='.$row->statistik_kurzbz, 'target'=>'main');
+ if($row->berechtigung_kurzbz!='')
+ $arr[$row->gruppe][$row->statistik_kurzbz]['permissions']=array($row->berechtigung_kurzbz);
+ }
+ else
+ {
+ $arr[$row->statistik_kurzbz]=array('name'=>$row->bezeichnung, 'link'=>APP_ROOT.'vilesci/statistik/statistik_frameset.php?statistik_kurzbz='.$row->statistik_kurzbz, 'target'=>'main');
+ if($row->berechtigung_kurzbz!='')
+ $arr[$row->statistik_kurzbz]['permissions']=array($row->berechtigung_kurzbz);
+ }
+ }
+ }
+ return $arr;
+ }
+
+ /**
+ * Loescht einen Eintrag
+ *
+ * @param $statistik_kurzbz
+ * @return true wenn ok, sonst false
+ */
+ public function delete($statistik_kurzbz)
+ {
+ $qry = "DELETE FROM public.tbl_statistik WHERE statistik_kurzbz=".$this->db_add_param($statistik_kurzbz).";";
+
+ if($this->db_query($qry))
+ {
+ return true;
+ }
+ else
+ {
+ $this->errormsg='Fehler beim Löschen des Eintrages';
+ return false;
+ }
+ }
+
+
+
+ /**
+ * Laedt bestimmte PreStudenten
+ * @param studiengang_kz KZ des Studienganges der zu Laden ist
+ * @param studiensemester_kurzbz Studiensemester
+ * @param ausbildungssemester KZ Ausbildungssemester
+ * @param datum_stichtag Stichtag im ISO-Format, Ergebniss filtert auf <= (kleiner,gleich)
+ * @return true wenn ok, false im Fehlerfall
+ */
+ public function get_prestudenten($studiengang_kz, $studiensemester_kurzbz, $ausbildungssemester=null, $datum_stichtag=null)
+ {
+ if(!is_numeric($studiengang_kz))
+ {
+ $this->errormsg = 'Studiengang_kz muss eine gueltige Zahl sein';
+ return false;
+ }
+
+ if($ausbildungssemester!='' && !is_numeric($ausbildungssemester))
+ {
+ $this->errormsg = 'Ausbildungssemester muss eine gueltige Zahl sein';
+ return false;
+ }
+
+ // Neue Studenten ermitteln
+ $qry="
+ SELECT
+ DISTINCT prestudent_id, geschlecht, studiengang_kz, ausbildungssemester, studiensemester_kurzbz
+ FROM
+ public.tbl_prestudent
+ JOIN public.tbl_prestudentstatus status USING (prestudent_id)
+ JOIN public.tbl_person USING (person_id)
+ WHERE
+ status_kurzbz='Student'
+ AND NOT EXISTS(SELECT 1 FROM public.tbl_prestudentstatus WHERE status_kurzbz='Student' AND datumdb_add_param($studiensemester_kurzbz);
+ if (!is_null($datum_stichtag))
+ $qry.=" AND datum <=".$this->db_add_param($datum_stichtag);
+ $qry.=') ';
+ $qry.=" OR (studiensemester_kurzbz=".$this->db_add_param($studiensemester_kurzbz);
+ if (!is_null($datum_stichtag))
+ $qry.=" AND datum <=".$this->db_add_param($datum_stichtag);
+ $qry.="))";
+ $qry.=" ORDER BY prestudent_id;";
+
+ if($result = $this->db_query($qry))
+ {
+ while($row = $this->db_fetch_object($result))
+ {
+ $stat_obj = new statistik();
+ $stat_obj->studiengang_kz=$row->studiengang_kz;
+ $stat_obj->ausbildungssemester=$row->ausbildungssemester;
+ $stat_obj->prestudent_id=$row->prestudent_id;
+ $stat_obj->geschlecht=$row->geschlecht;
+ $stat_obj->studiensemester_kurzbz=$row->studiensemester_kurzbz;
+ $this->statistik_obj[]=$stat_obj;
+ }
+ }
+ else
+ {
+ $this->errormsg = 'Datensatz konnte nicht geladen werden';
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ *
+ * Liefert die DropOut Rate
+ * @param unknown_type $studiengang_kz
+ * @param unknown_type $studiensemester_kurzbz
+ * @param unknown_type $ausbildungssemester
+ * @param unknown_type $datum_stichtag
+ */
+ public function get_DropOut($studiengang_kz, $studiensemester_kurzbz, $ausbildungssemester=null, $datum_stichtag=null)
+ {
+ $this->statistik_obj=array();
+
+ if(!is_numeric($studiengang_kz))
+ {
+ $this->errormsg = 'Studiengang_kz muss eine gueltige Zahl sein';
+ return false;
+ }
+
+ if($ausbildungssemester!='' && !is_numeric($ausbildungssemester))
+ {
+ $this->errormsg = 'Ausbildungssemester muss eine gueltige Zahl sein';
+ return false;
+ }
+
+ // Neue Studenten ermitteln
+ $qry="SELECT DISTINCT prestudent_id, geschlecht, studiengang_kz, ausbildungssemester, studiensemester_kurzbz
+ FROM tbl_prestudent JOIN tbl_prestudentstatus USING (prestudent_id) JOIN tbl_person USING (person_id)
+ WHERE (status_kurzbz='Abbrecher')
+ AND studiengang_kz=".$this->db_add_param($studiengang_kz);
+ if($ausbildungssemester!='')
+ $qry.=" AND ausbildungssemester=".$this->db_add_param($ausbildungssemester);
+
+ $qry.=" AND (studiensemester_kurzbz=".$this->db_add_param($studiensemester_kurzbz);
+ if (!is_null($datum_stichtag))
+ $qry.=" AND datum <=".$this->db_add_param($datum_stichtag);
+ $qry.=') ';
+ $qry.=" ORDER BY prestudent_id;";
+
+ if($result = $this->db_query($qry))
+ {
+ while($row = $this->db_fetch_object($result))
+ {
+ $stat_obj = new statistik();
+ $stat_obj->studiengang_kz=$row->studiengang_kz;
+ $stat_obj->ausbildungssemester=$row->ausbildungssemester;
+ $stat_obj->prestudent_id=$row->prestudent_id;
+ $stat_obj->geschlecht=$row->geschlecht;
+ $stat_obj->studiensemester_kurzbz=$row->studiensemester_kurzbz;
+ $this->statistik_obj[]=$stat_obj;
+ }
+ }
+ else
+ {
+ $this->errormsg = 'Datensatz konnte nicht geladen werden';
+ return false;
+ }
+
+ return true;
+ }
+
+ /**
+ * Laedt die Daten einer Statistik (derzeit nur SQL)
+ * @param $statistik_kurzbz
+ */
+ public function loadData()
+ {
+ $this->html='';
+ $this->csv='';
+ $this->json=array();
+ $this->countRows=0;
+ set_time_limit(600);
+
+ // In case a decryption function is used then perform password substitution
+ $this->sql = $this->replaceSQLDecryptionPassword($this->sql);
+
+ if($this->sql!='')
+ {
+ $sql = $this->sql;
+
+ // Wenn im SQL ein $user vorkommt wird das durch den eingeloggten User ersetzt
+ if(strpos($sql, '$user')!==false)
+ {
+ $uid = get_uid();
+ $sql = str_replace('$user',$this->db_add_param($uid),$sql);
+ }
+
+ foreach($_REQUEST as $name=>$value)
+ {
+ // Inputs, die in eckigen Klammern stehen, werden als Array interpretiert
+ if (is_string($value) && substr($value, 0, 1) == '[' && substr($value, -1) == ']')
+ {
+ //Eckige Klammern entfernen und String aufsplitten
+ $value = substr($value, 1);
+ $value = substr($value, 0, -1);
+ $value = explode(',', $value);
+ }
+ if (is_array($value))
+ {
+ $in = $this->db_implode4SQL($value);
+ $sql = str_replace('$'.$name,$in,$sql);
+ }
+ else
+ $sql = str_replace('$'.$name,$this->db_add_param($value),$sql);
+ }
+ if($this->data = $this->db_query($sql))
+ {
+ $this->html.= '';
+ $anzahl_spalten = $this->db_num_fields($this->data);
+ for($spalte=0;$spalte<$anzahl_spalten;$spalte++)
+ {
+ $this->html.= '| '.$this->convert_html_chars($this->db_field_name($this->data,$spalte)).' | ';
+ $this->csv.='"'.$this->db_field_name($this->data,$spalte).'",';
+ }
+ $this->html.= ' ';
+ $this->csv=substr($this->csv,0,-1)."\n";
+ while($row = $this->db_fetch_object($this->data))
+ {
+ $this->html.= '';
+ $anzahl_spalten = $this->db_num_fields($this->data);
+
+ for($spalte=0;$spalte<$anzahl_spalten;$spalte++)
+ {
+ $name = $this->db_field_name($this->data,$spalte);
+ $this->html.= '| '.$this->convert_html_chars($row->$name).' | ';
+ // Umwandeln von Punkt in Komma bei Float-Werten
+ if (is_numeric($row->$name))
+ {
+ if (strpos($row->$name,'.') != false)
+ $row->$name = number_format($row->$name,2,",","");
+ }
+ $this->csv.= '"'.$row->$name.'",';
+ }
+
+ $this->json[] = $row;
+ $this->html.= ' ';
+ $this->csv=substr($this->csv,0,-1)."\n";
+ $this->countRows++;
+ }
+ $this->html.= '';
+ }
+ return true;
+ }
+ else
+ {
+ $this->errormsg= 'Zu dieser Statistik gibt es keine SQL Abfrage';
+ return false;
+ }
+ }
+
+ function getHtmlTable($id, $class='')
+ {
+ return ''.$this->countRows.' Zeilen ';
+ }
+
+ function getCSV()
+ {
+ return $this->csv;
+ }
+
+ function writeCSV($filename, $delimiter=',', $enclosure='"')
+ {
+ $fh=fopen($filename,'w');
+
+ $fieldnames=array();
+ for ($i=0; $i < $this->db_num_fields($this->data); $i++)
+ $fieldnames[]=$this->db_field_name($this->data,$i);
+ fputcsv($fh, $fieldnames, $delimiter, $enclosure);
+ $this->db_result_seek($this->data,0);
+ while ($row = $this->db_fetch_row($this->data))
+ fputcsv($fh, $row, $delimiter, $enclosure);
+ fclose($fh);
+ return true;
+ }
+
+ function getJSON()
+ {
+ return json_encode($this->json);
+ }
+
+ function getArray()
+ {
+ return $this->json;
+ }
+
+ /**
+ *
+ * Parst Variablen aus einem String und liefert diese als Array zurueck
+ * @param $value String mit Variablen
+ * z.B.: "Select * from tbl_person where person_id<'$person_id'"
+ * oder "../content/statistik/bewerberstatistik.php?stsem=$StSem&stg_kz=$stg_kz"
+ *
+ * @return Array mit den Variablennamen
+ */
+ function parseVars($value)
+ {
+ $result = array();
+
+ $check = '/\$[0-9A-z]+/';
+ preg_match_all($check, $value, $result);
+ $result = $result[0];
+ $vars = array();
+ for($i=0;$i'Mitarbeiter','permissions'=>array('admin','mitarbeiter','support'),
'Übersicht'=>array('name'=>'Übersicht', 'link'=>'personen/lektor_uebersicht.php', 'target'=>'main'),
'Zeitsperren'=>array('name'=>'Zeitsperren/Urlaub', 'link'=>'personen/urlaubsverwaltung.php', 'target'=>'main','permissions'=>array('mitarbeiter/zeitsperre:begrenzt')),
+ 'Projektexport'=>array('name'=>'Projektexport', 'link'=>'personen/projektexport.php', 'target'=>'main','permissions'=>array('mitarbeiter/zeitsperre')),
),
'Betriebsmittel'=>array('name'=>'Betriebsmittel', 'link'=>'stammdaten/betriebsmittel_frameset.php', 'target'=>'main','permissions'=>array('basis/betriebsmittel')),
'AnwesenheitslistenBarcode'=>array('name'=>'Anwesenheitslisten mit Barcodes', 'link'=>'personen/anwesenheitslisten_barcode.php', 'target'=>'main','permissions'=>array('basis/person')),
diff --git a/locale/de-AT/services.php b/locale/de-AT/services.php
index 1b03bc956..159efd2e9 100644
--- a/locale/de-AT/services.php
+++ b/locale/de-AT/services.php
@@ -5,6 +5,7 @@ $this->phrasen['services/details']='Details';
$this->phrasen['services/filtern']='Filtern';
$this->phrasen['services/leistung']='Leistung';
$this->phrasen['services/design']='Verantwortlich';
+$this->phrasen['services/kritikalitaet']='Kritikalität';
$this->phrasen['services/betrieb']='Betrieb';
$this->phrasen['services/operativ']='Operativ';
?>
diff --git a/locale/en-US/services.php b/locale/en-US/services.php
index d3c0642fa..ac31031a9 100644
--- a/locale/en-US/services.php
+++ b/locale/en-US/services.php
@@ -5,6 +5,7 @@ $this->phrasen['services/details']='Details';
$this->phrasen['services/filtern']='Filter';
$this->phrasen['services/leistung']='Service';
$this->phrasen['services/design']='Design';
+$this->phrasen['services/kritikalitaet']='Criticality';
$this->phrasen['services/betrieb']='Running';
$this->phrasen['services/operativ']='Operating';
-?>
\ No newline at end of file
+?>
diff --git a/public/js/api/fhcapifactory.js b/public/js/api/fhcapifactory.js
new file mode 100644
index 000000000..41c89ef50
--- /dev/null
+++ b/public/js/api/fhcapifactory.js
@@ -0,0 +1,30 @@
+/**
+ * Copyright (C) 2024 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 3 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, see .
+ */
+
+import search from "./search.js";
+import phrasen from "./phrasen.js";
+import navigation from "./navigation.js";
+import filter from "./filter.js";
+import studstatus from "./studstatus.js";
+
+export default {
+ search,
+ phrasen,
+ navigation,
+ filter,
+ studstatus
+};
diff --git a/public/js/api/filter.js b/public/js/api/filter.js
new file mode 100644
index 000000000..a5920c758
--- /dev/null
+++ b/public/js/api/filter.js
@@ -0,0 +1,89 @@
+/**
+ * Copyright (C) 2024 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 3 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, see .
+ */
+
+export default {
+ saveCustomFilter(wsParams) {
+ return this.$fhcApi.post(
+ '/api/frontend/v1/filter/saveCustomFilter',
+ {
+ filterUniqueId: wsParams.filterUniqueId,
+ filterType: wsParams.filterType,
+ customFilterName: wsParams.customFilterName
+ }
+ );
+ },
+ removeCustomFilter(wsParams) {
+ return this.$fhcApi.post(
+ '/api/frontend/v1/filter/removeCustomFilter',
+ {
+ filterUniqueId: wsParams.filterUniqueId,
+ filterType: wsParams.filterType,
+ filterId: wsParams.filterId
+ }
+ );
+ },
+ applyFilterFields(wsParams) {
+ return this.$fhcApi.post(
+ '/api/frontend/v1/filter/applyFilterFields',
+ {
+ filterUniqueId: wsParams.filterUniqueId,
+ filterType: wsParams.filterType,
+ filterFields: wsParams.filterFields
+ }
+ );
+ },
+ addFilterField(wsParams) {
+ return this.$fhcApi.post(
+ '/api/frontend/v1/filter/addFilterField',
+ {
+ filterUniqueId: wsParams.filterUniqueId,
+ filterType: wsParams.filterType,
+ filterField: wsParams.filterField
+ }
+ );
+ },
+ removeFilterField(wsParams) {
+ return this.$fhcApi.post(
+ '/api/frontend/v1/filter/removeFilterField',
+ {
+ filterUniqueId: wsParams.filterUniqueId,
+ filterType: wsParams.filterType,
+ filterField: wsParams.filterField
+ }
+ );
+ },
+ getFilterById(wsParams) {
+ return this.$fhcApi.get(
+ '/api/frontend/v1/filter/getFilter',
+ {
+ filterUniqueId: wsParams.filterUniqueId,
+ filterType: wsParams.filterType,
+ filterId: wsParams.filterId
+ }
+ );
+ },
+ getFilter(wsParams) {
+ return this.$fhcApi.get(
+ '/api/frontend/v1/filter/getFilter',
+ {
+ filterUniqueId: wsParams.filterUniqueId,
+ filterType: wsParams.filterType
+ }
+ );
+ }
+};
+
diff --git a/public/js/api/navigation.js b/public/js/api/navigation.js
new file mode 100644
index 000000000..05006331f
--- /dev/null
+++ b/public/js/api/navigation.js
@@ -0,0 +1,32 @@
+/**
+ * Copyright (C) 2024 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 3 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, see .
+ */
+
+export default {
+ getHeader(navigation_page) {
+ return this.$fhcApi.get(
+ '/api/frontend/v1/navigation/header',
+ { navigation_page }
+ );
+ },
+ getMenu: function(navigation_page) {
+ return this.$fhcApi.get(
+ '/api/frontend/v1/navigation/menu',
+ { navigation_page }
+ );
+ }
+};
+
diff --git a/public/js/api/phrasen.js b/public/js/api/phrasen.js
new file mode 100644
index 000000000..896641bcf
--- /dev/null
+++ b/public/js/api/phrasen.js
@@ -0,0 +1,22 @@
+/**
+ * Copyright (C) 2024 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 3 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, see .
+ */
+
+export default {
+ loadCategory(category) {
+ return this.$fhcApi.get('/api/frontend/v1/phrasen/loadModule/' + category);
+ }
+};
diff --git a/public/js/api/search.js b/public/js/api/search.js
new file mode 100644
index 000000000..4655d8fa8
--- /dev/null
+++ b/public/js/api/search.js
@@ -0,0 +1,27 @@
+/**
+ * Copyright (C) 2024 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 3 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, see .
+ */
+
+export default {
+ search(searchsettings) {
+ const url = '/api/frontend/v1/searchbar/search';
+ return this.$fhcApi.post(url, searchsettings);
+ },
+ searchdummy(searchsettings) {
+ const url = 'public/js/apps/api/dummyapi.php/Search';
+ return this.$fhcApi.post(url, searchsettings);
+ }
+};
\ No newline at end of file
diff --git a/public/js/api/studstatus.js b/public/js/api/studstatus.js
new file mode 100644
index 000000000..87d6840b1
--- /dev/null
+++ b/public/js/api/studstatus.js
@@ -0,0 +1,223 @@
+/**
+ * Copyright (C) 2024 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 3 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, see .
+ */
+
+export default {
+ abmeldung: {
+ getDetails(antrag_id, prestudent_id) {
+ const url = '/api/frontend/v1/studstatus/abmeldung/'
+ + (antrag_id !== undefined ? 'getDetailsForAntrag/' + antrag_id : 'getDetailsForNewAntrag/' + prestudent_id);
+ return this.$fhcApi.get(url);
+ },
+ create(stdsem, prestudent_id, grund) {
+ return this.$fhcApi.post('/api/frontend/v1/studstatus/abmeldung/createAntrag', {
+ studiensemester: stdsem,
+ prestudent_id,
+ grund
+ }, {
+ errorHandling: 'strict'
+ });
+ },
+ cancel(antrag_id) {
+ if (!Array.isArray(antrag_id))
+ return this.$fhcApi.post(
+ '/api/frontend/v1/studstatus/abmeldung/cancelAntrag',
+ { antrag_id }
+ );
+ return Promise.allSettled(antrag_id.map(antrag => this.$fhcApi.post(
+ '/api/frontend/v1/studstatus/abmeldung/cancelAntrag',
+ { antrag_id: antrag.studierendenantrag_id },
+ { errorHeader: '#' + antrag.studierendenantrag_id }
+ )));
+ }
+ },
+ unterbrechung: {
+ getDetails(antrag_id, prestudent_id) {
+ const url = '/api/frontend/v1/studstatus/unterbrechung/'
+ + (antrag_id !== undefined ? 'getDetailsForAntrag/' + antrag_id : 'getDetailsForNewAntrag/' + prestudent_id);
+ return this.$fhcApi.get(url);
+ },
+ create(studiensemester, prestudent_id, grund, datum_wiedereinstieg, attachment) {
+ return this.$fhcApi.post('/api/frontend/v1/studstatus/unterbrechung/createAntrag', {
+ studiensemester,
+ prestudent_id,
+ grund,
+ datum_wiedereinstieg,
+ attachment
+ }, {
+ errorHandling: 'strict'
+ });
+ },
+ cancel(antrag_id) {
+ return this.$fhcApi.post('/api/frontend/v1/studstatus/unterbrechung/cancelAntrag', {
+ antrag_id
+ }, {
+ errorHandling: 'strict'
+ });
+ }
+ },
+ wiederholung: {
+ getDetails(prestudent_id) {
+ const url = '/api/frontend/v1/studstatus/wiederholung/getDetailsForNewAntrag/' + prestudent_id;
+ return this.$fhcApi.get(url)
+ },
+ getLvs(antrag_id) {
+ const url = '/api/frontend/v1/studstatus/wiederholung/getLvs/' + antrag_id;
+ return this.$fhcApi.get(url)
+ },
+ create(prestudent_id, studiensemester) {
+ return this.$fhcApi.post('/api/frontend/v1/studstatus/wiederholung/createAntrag', {
+ prestudent_id,
+ studiensemester
+ }, {
+ errorHandling: 'strict'
+ });
+ },
+ cancel(prestudent_id, studiensemester) {
+ return this.$fhcApi.post('/api/frontend/v1/studstatus/wiederholung/cancelAntrag', {
+ prestudent_id,
+ studiensemester
+ }, {
+ errorHandling: 'strict'
+ });
+ },
+ saveLvs(forbiddenLvs, mandatoryLvs) {
+ return this.$fhcApi.post('/api/frontend/v1/studstatus/wiederholung/saveLvs', {
+ forbiddenLvs,
+ mandatoryLvs
+ });
+ }
+ },
+ leitung: {
+ getStgs() {
+ return this.$fhcApi.get('/api/frontend/v1/studstatus/leitung/getActiveStgs');
+ },
+ getAntraege(url, config, params) {
+ return this.$fhcApi
+ .get('/api/frontend/v1/studstatus/leitung/getAntraege/' + url)
+ .then(res => res.data); // Return data for tabulator
+ },
+ getHistory(antrag_id) {
+ return this.$fhcApi.get('/api/frontend/v1/studstatus/leitung/getHistory/' + antrag_id)
+ },
+ getPrestudents(query, signal) {
+ return this.$fhcApi.post(
+ '/api/frontend/v1/studstatus/leitung/getPrestudents',
+ { query },
+ {
+ signal: signal,
+ timeout: 30000
+ }
+ );
+ },
+ approve(antrag) {
+ if (!Array.isArray(antrag))
+ return this.$fhcApi.post(
+ '/api/frontend/v1/studstatus/leitung/approveAntrag',
+ antrag
+ );
+ return Promise.allSettled(antrag.map(a => this.$fhcApi.post(
+ '/api/frontend/v1/studstatus/leitung/approveAntrag',
+ a,
+ { errorHeader: '#' + a.studierendenantrag_id }
+ )));
+ },
+ reject(antrag) {
+ if (!Array.isArray(antrag))
+ return this.$fhcApi.post(
+ '/api/frontend/v1/studstatus/leitung/rejectAntrag',
+ antrag
+ );
+ return Promise.allSettled(antrag.map(a => this.$fhcApi.post(
+ '/api/frontend/v1/studstatus/leitung/rejectAntrag',
+ a,
+ { errorHeader: '#' + a.studierendenantrag_id }
+ )));
+ },
+ reopen(antrag) {
+ if (!Array.isArray(antrag))
+ return this.$fhcApi.post(
+ '/api/frontend/v1/studstatus/leitung/reopenAntrag',
+ antrag
+ );
+ return Promise.allSettled(antrag.map(a => this.$fhcApi.post(
+ '/api/frontend/v1/studstatus/leitung/reopenAntrag',
+ a,
+ { errorHeader: '#' + a.studierendenantrag_id }
+ )));
+ },
+ pause(antrag) {
+ if (!Array.isArray(antrag))
+ return this.$fhcApi.post(
+ '/api/frontend/v1/studstatus/leitung/pauseAntrag',
+ antrag
+ );
+ return Promise.allSettled(antrag.map(a => this.$fhcApi.post(
+ '/api/frontend/v1/studstatus/leitung/pauseAntrag',
+ a,
+ { errorHeader: '#' + a.studierendenantrag_id }
+ )));
+ },
+ unpause(antrag) {
+ if (!Array.isArray(antrag))
+ return this.$fhcApi.post(
+ '/api/frontend/v1/studstatus/leitung/unpauseAntrag',
+ antrag
+ );
+ return Promise.allSettled(antrag.map(a => this.$fhcApi.post(
+ '/api/frontend/v1/studstatus/leitung/unpauseAntrag',
+ a,
+ { errorHeader: '#' + a.studierendenantrag_id }
+ )));
+ },
+ object(antrag) {
+ if (!Array.isArray(antrag))
+ return this.$fhcApi.post(
+ '/api/frontend/v1/studstatus/leitung/objectAntrag',
+ antrag
+ );
+ return Promise.allSettled(antrag.map(a => this.$fhcApi.post(
+ '/api/frontend/v1/studstatus/leitung/objectAntrag',
+ a,
+ { errorHeader: '#' + a.studierendenantrag_id }
+ )));
+ },
+ approveObjection(antrag) {
+ if (!Array.isArray(antrag))
+ return this.$fhcApi.post(
+ '/api/frontend/v1/studstatus/leitung/approveObjection',
+ antrag
+ );
+ return Promise.allSettled(antrag.map(a => this.$fhcApi.post(
+ '/api/frontend/v1/studstatus/leitung/approveObjection',
+ a,
+ { errorHeader: '#' + a.studierendenantrag_id }
+ )));
+ },
+ denyObjection(antrag) {
+ if (!Array.isArray(antrag))
+ return this.$fhcApi.post(
+ '/api/frontend/v1/studstatus/leitung/denyObjection',
+ antrag
+ );
+ return Promise.allSettled(antrag.map(a => this.$fhcApi.post(
+ '/api/frontend/v1/studstatus/leitung/denyObjection',
+ a,
+ { errorHeader: '#' + a.studierendenantrag_id }
+ )));
+ }
+ }
+};
\ No newline at end of file
diff --git a/public/js/apps/TestSearch.js b/public/js/apps/TestSearch.js
index d4aa35312..469aaeb09 100644
--- a/public/js/apps/TestSearch.js
+++ b/public/js/apps/TestSearch.js
@@ -1,195 +1,195 @@
-import {CoreFilterCmpt} from '../components/Filter.js';
-import {CoreNavigationCmpt} from '../components/Navigation.js';
-import verticalsplit from "../components/verticalsplit/verticalsplit.js";
-import searchbar from "../components/searchbar/searchbar.js";
-import fhcapifactory from "./api/fhcapifactory.js";
+import {CoreFilterCmpt} from '../components/filter/Filter.js';
+import {CoreNavigationCmpt} from '../components/navigation/Navigation.js';
+import CoreVerticalsplit from "../components/verticalsplit/verticalsplit.js";
+import CoreSearchbar from "../components/searchbar/searchbar.js";
+import FhcApi from "../plugin/FhcApi.js";
-Vue.$fhcapi = fhcapifactory;
-
-Vue.createApp({
- "data": function() {
- return {
- "title": "Test Search",
- "appSideMenuEntries": {},
- "searchbaroptions": {
- "types": [
- "person",
- "raum",
- "mitarbeiter",
- "student",
- "prestudent",
- "document",
- "cms",
- "organisationunit"
- ],
- "actions": {
- "person": {
- "defaultaction": {
- "type": "link",
- "action": function(data) {
- //alert('person defaultaction ' + JSON.stringify(data));
- //window.location.href = data.profil;
- return data.profil;
- }
- },
- "childactions": [
- {
- "label": "testchildaction1",
- "icon": "fas fa-check-circle",
- "type": "function",
- "action": function(data) {
- alert('person testchildaction 01 ' + JSON.stringify(data));
- }
- },
- {
- "label": "testchildaction2",
- "icon": "fas fa-file-csv",
- "type": "function",
- "action": function(data) {
- alert('person testchildaction 02 ' + JSON.stringify(data));
- }
- }
- ]
- },
- "raum": {
- "defaultaction": {
- "type": "function",
- "action": function(data) {
- alert('raum defaultaction ' + JSON.stringify(data));
- }
- },
- "childactions": [
- {
- "label": "Rauminformation",
- "icon": "fas fa-info-circle",
- "type": "link",
- "action": function(data) {
- return data.infolink;
- }
- },
- {
- "label": "Raumreservierung",
- "icon": "fas fa-bookmark",
- "type": "link",
- "action": function(data) {
- return data.booklink;
- }
- }
- ]
- },
- "employee": {
- "defaultaction": {
- "type": "function",
- "action": function(data) {
- alert('employee defaultaction ' + JSON.stringify(data));
- }
- },
- "childactions": [
- {
- "label": "testchildaction1",
- "icon": "fas fa-address-book",
- "type": "function",
- "action": function(data) {
- alert('employee testchildaction 01 ' + JSON.stringify(data));
- }
- },
- {
- "label": "testchildaction2",
- "icon": "fas fa-user-slash",
- "type": "function",
- "action": function(data) {
- alert('employee testchildaction 02 ' + JSON.stringify(data));
- }
- },
- {
- "label": "testchildaction3",
- "icon": "fas fa-bell",
- "type": "function",
- "action": function(data) {
- alert('employee testchildaction 03 ' + JSON.stringify(data));
- }
- },
- {
- "label": "testchildaction4",
- "icon": "fas fa-calculator",
- "type": "function",
- "action": function(data) {
- alert('employee testchildaction 04 ' + JSON.stringify(data));
- }
- }
- ]
- },
- "organisationunit": {
- "defaultaction": {
- "type": "function",
- "action": function(data) {
- alert('organisationunit defaultaction ' + JSON.stringify(data));
- }
- },
- "childactions": []
- }
- }
- },
- "searchbaroptions2": {
- "types": [
- "raum",
- "organisationunit"
- ],
- "actions": {
- "raum": {
- "defaultaction": {
- "type": "function",
- "action": function(data) {
- alert('raum defaultaction ' + JSON.stringify(data));
- }
- },
- "childactions": [
- {
- "label": "Rauminformation",
- "icon": "fas fa-info-circle",
- "type": "link",
- "action": function(data) {
- return data.infolink;
- }
- },
- {
- "label": "Raumreservierung",
- "icon": "fas fa-bookmark",
- "type": "link",
- "action": function(data) {
- return data.booklink;
- }
- }
- ]
- },
- "organisationunit": {
- "defaultaction": {
- "type": "function",
- "action": function(data) {
- alert('organisationunit defaultaction ' + JSON.stringify(data));
- }
- },
- "childactions": []
- }
- }
- }
- };
- },
- "components": {
- "CoreNavigationCmpt": CoreNavigationCmpt,
- "CoreFilterCmpt": CoreFilterCmpt,
- "verticalsplit": verticalsplit,
- "searchbar": searchbar
- },
- "methods": {
- "newSideMenuEntryHandler": function(payload) {
- this.appSideMenuEntries = payload;
- },
- "searchfunction": function(searchsettings) {
- return Vue.$fhcapi.Search.search(searchsettings);
- },
- "searchfunctiondummy": function(searchsettings) {
- return Vue.$fhcapi.Search.searchdummy(searchsettings);
- }
- }
-}).mount('#main');
+const app = Vue.createApp({
+ components: {
+ CoreNavigationCmpt,
+ CoreFilterCmpt,
+ CoreVerticalsplit,
+ CoreSearchbar
+ },
+ data() {
+ return {
+ title: "Test Search",
+ appSideMenuEntries: {},
+ searchbaroptions: {
+ types: [
+ "person",
+ "raum",
+ "mitarbeiter",
+ "student",
+ "prestudent",
+ "document",
+ "cms",
+ "organisationunit"
+ ],
+ actions: {
+ person: {
+ defaultaction: {
+ type: "link",
+ action(data) {
+ //alert('person defaultaction ' + JSON.stringify(data));
+ //window.location.href = data.profil;
+ return data.profil;
+ }
+ },
+ childactions: [
+ {
+ label: "testchildaction1",
+ icon: "fas fa-check-circle",
+ type: "function",
+ action(data) {
+ alert('person testchildaction 01 ' + JSON.stringify(data));
+ }
+ },
+ {
+ label: "testchildaction2",
+ icon: "fas fa-file-csv",
+ type: "function",
+ action(data) {
+ alert('person testchildaction 02 ' + JSON.stringify(data));
+ }
+ }
+ ]
+ },
+ raum: {
+ defaultaction: {
+ type: "function",
+ action(data) {
+ alert('raum defaultaction ' + JSON.stringify(data));
+ }
+ },
+ childactions: [
+ {
+ label: "Rauminformation",
+ icon: "fas fa-info-circle",
+ type: "link",
+ action(data) {
+ return data.infolink;
+ }
+ },
+ {
+ label: "Raumreservierung",
+ icon: "fas fa-bookmark",
+ type: "link",
+ action(data) {
+ return data.booklink;
+ }
+ }
+ ]
+ },
+ employee: {
+ defaultaction: {
+ type: "function",
+ action(data) {
+ alert('employee defaultaction ' + JSON.stringify(data));
+ }
+ },
+ childactions: [
+ {
+ label: "testchildaction1",
+ icon: "fas fa-address-book",
+ type: "function",
+ action(data) {
+ alert('employee testchildaction 01 ' + JSON.stringify(data));
+ }
+ },
+ {
+ label: "testchildaction2",
+ icon: "fas fa-user-slash",
+ type: "function",
+ action(data) {
+ alert('employee testchildaction 02 ' + JSON.stringify(data));
+ }
+ },
+ {
+ label: "testchildaction3",
+ icon: "fas fa-bell",
+ type: "function",
+ action(data) {
+ alert('employee testchildaction 03 ' + JSON.stringify(data));
+ }
+ },
+ {
+ label: "testchildaction4",
+ icon: "fas fa-calculator",
+ type: "function",
+ action(data) {
+ alert('employee testchildaction 04 ' + JSON.stringify(data));
+ }
+ }
+ ]
+ },
+ organisationunit: {
+ defaultaction: {
+ type: "function",
+ action(data) {
+ alert('organisationunit defaultaction ' + JSON.stringify(data));
+ }
+ },
+ childactions: []
+ }
+ }
+ },
+ searchbaroptions2: {
+ types: [
+ "raum",
+ "organisationunit"
+ ],
+ actions: {
+ raum: {
+ defaultaction: {
+ type: "function",
+ action(data) {
+ alert('raum defaultaction ' + JSON.stringify(data));
+ }
+ },
+ childactions: [
+ {
+ label: "Rauminformation",
+ icon: "fas fa-info-circle",
+ type: "link",
+ action(data) {
+ return data.infolink;
+ }
+ },
+ {
+ label: "Raumreservierung",
+ icon: "fas fa-bookmark",
+ type: "link",
+ action(data) {
+ return data.booklink;
+ }
+ }
+ ]
+ },
+ organisationunit: {
+ defaultaction: {
+ type: "function",
+ action(data) {
+ alert('organisationunit defaultaction ' + JSON.stringify(data));
+ }
+ },
+ childactions: []
+ }
+ }
+ }
+ };
+ },
+ methods: {
+ newSideMenuEntryHandler(payload) {
+ this.appSideMenuEntries = payload;
+ },
+ searchfunction(searchsettings) {
+ return this.$fhcApi.factory.search.search(searchsettings);
+ },
+ searchfunctiondummy(searchsettings) {
+ return this.$fhcApi.factory.search.searchdummy(searchsettings);
+ }
+ }
+});
+app.use(FhcApi)
+app.mount('#main');
diff --git a/public/js/apps/lehre/Antrag.js b/public/js/apps/lehre/Antrag.js
index 00a5877b3..d0c8ab89a 100644
--- a/public/js/apps/lehre/Antrag.js
+++ b/public/js/apps/lehre/Antrag.js
@@ -1,12 +1,10 @@
import StudierendenantragAntrag from "../../components/Studierendenantrag/Antrag.js";
import StudierendenantragStatus from "../../components/Studierendenantrag/Status.js";
import StudierendenantragInfoblock from "../../components/Studierendenantrag/Infoblock.js";
-import VueDatePicker from "../../components/vueDatepicker.js.php";
import Phrasen from '../../plugin/Phrasen.js';
const app = Vue.createApp({
components: {
- VueDatePicker,
StudierendenantragAntrag,
StudierendenantragStatus,
StudierendenantragInfoblock
diff --git a/public/js/components/Fetch.js b/public/js/components/Fetch.js
index 9a34e1a3f..2f7985649 100644
--- a/public/js/components/Fetch.js
+++ b/public/js/components/Fetch.js
@@ -99,8 +99,10 @@ export const CoreFetchCmpt = {
*
*/
errorHandler: function(error) {
- if (error.response.data.retval)
+ if (error.response?.data?.retval)
this.setError(error.response.data.retval);
+ else if (error.data?.message)
+ this.setError(error.data.message);
else
this.setError(error.message);
},
diff --git a/public/js/components/Form/Form.js b/public/js/components/Form/Form.js
index 9a729b88f..fb264e0fe 100644
--- a/public/js/components/Form/Form.js
+++ b/public/js/components/Form/Form.js
@@ -46,7 +46,8 @@ export default {
const factory = Object.create(Object.getPrototypeOf(this.$fhcApi.factory), Object.getOwnPropertyDescriptors(this.$fhcApi.factory));
factory.$fhcApi = {
get: this.get,
- post: this.post
+ post: this.post,
+ _defaultErrorHandlers: this.$fhcApi._defaultErrorHandlers
};
return factory;
}
diff --git a/public/js/components/Studierendenantrag/Form/Abmeldung.js b/public/js/components/Studierendenantrag/Form/Abmeldung.js
index d72f84265..1660957c5 100644
--- a/public/js/components/Studierendenantrag/Form/Abmeldung.js
+++ b/public/js/components/Studierendenantrag/Form/Abmeldung.js
@@ -1,10 +1,16 @@
import {CoreFetchCmpt} from '../../Fetch.js';
+import CoreForm from '../../Form/Form.js';
+import FormValidation from '../../Form/Validation.js';
+import FormInput from '../../Form/Input.js';
var _uuid = 0;
export default {
components: {
- CoreFetchCmpt
+ CoreFetchCmpt,
+ CoreForm,
+ FormValidation,
+ FormInput
},
emits: [
'setInfos',
@@ -18,9 +24,8 @@ export default {
return {
data: null,
saving: false,
- errors: {
- grund: [],
- default: []
+ formData: {
+ grund: ''
}
}
},
@@ -34,24 +39,14 @@ export default {
case 'Genehmigt': return 'success';
default: return 'warning';
}
- },
- loadUrl() {
- if (this.studierendenantragId)
- return '/components/Antrag/Abmeldung/getDetailsForAntrag/'+
- this.studierendenantragId;
- return '/components/Antrag/Abmeldung/getDetailsForNewAntrag/' +
- this.prestudentId;
}
},
methods: {
load() {
- return axios.get(
- FHC_JS_DATA_STORAGE_OBJECT.app_root +
- FHC_JS_DATA_STORAGE_OBJECT.ci_router +
- this.loadUrl
- ).then(
- result => {
- this.data = result.data.retval;
+ return this.$fhcApi.factory
+ .studstatus.abmeldung.getDetails(this.studierendenantragId, this.prestudentId)
+ .then(result => {
+ this.data = result.data;
if (this.data.status) {
const msg = (this.data.status == 'Pause' && this.data.status_insertvon == "Studienabbruch") ? Vue.computed(() => {
let status = this.$p.t('studierendenantrag/status_stop');
@@ -63,8 +58,8 @@ export default {
});
}
return result;
- }
- );
+ })
+ .catch(this.$fhcAlert.handleSystemError);
},
createAntrag() {
bootstrap.Modal.getOrCreateInstance(this.$refs.modal).hide();
@@ -73,52 +68,39 @@ export default {
severity: 'warning'
});
this.saving = true;
- for(var k in this.errors)
- this.errors[k] = [];
- axios.post(
- FHC_JS_DATA_STORAGE_OBJECT.app_root +
- FHC_JS_DATA_STORAGE_OBJECT.ci_router +
- '/components/Antrag/Abmeldung/createAntrag/', {
- studiensemester: this.data.studiensemester_kurzbz,
- prestudent_id: this.data.prestudent_id,
- grund: this.$refs.grund.value
- }
- ).then(
- result => {
- if (result.data.error)
- {
- for (var k in result.data.retval)
- {
- if (this.errors[k] !== undefined)
- this.errors[k].push(result.data.retval[k]);
- else
- this.errors.default.push(result.data.retval[k]);
- }
- this.$emit('setStatus', {
- msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_error')})),
- severity: 'danger'
+
+ this.$refs.form.clearValidation();
+ this.$refs.form.factory
+ .studstatus.abmeldung.create(
+ this.data.studiensemester_kurzbz,
+ this.data.prestudent_id,
+ this.formData.grund
+ )
+ .then(result => {
+ if (result.data === true)
+ document.location += "";
+
+ this.data = result.data;
+ if (this.data.status)
+ this.$emit("setStatus", {
+ msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.data.statustyp})),
+ severity: this.statusSeverity
});
- }
else
- {
- if (result.data.retval === true)
- document.location += "";
- this.data = result.data.retval;
- if (this.data.status) {
- this.$emit("setStatus", {
- msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.data.statustyp})),
- severity: this.statusSeverity
- });
- }
- else
- this.$emit('setStatus', {
- msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_open')})),
- severity:'success'
- });
- }
+ this.$emit('setStatus', {
+ msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_open')})),
+ severity:'success'
+ });
this.saving = false;
- }
- );
+ })
+ .catch(error => {
+ this.$emit('setStatus', {
+ msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_error')})),
+ severity: 'danger'
+ });
+ this.saving = false;
+ this.$fhcAlert.handleSystemError(error);
+ });
},
cancelAntrag() {
this.$emit('setStatus', {
@@ -126,51 +108,37 @@ export default {
severity: 'warning'
});
this.saving = true;
- for(var k in this.errors)
- this.errors[k] = [];
- axios.post(
- FHC_JS_DATA_STORAGE_OBJECT.app_root +
- FHC_JS_DATA_STORAGE_OBJECT.ci_router +
- '/components/Antrag/Abmeldung/cancelAntrag/', {
- antrag_id: this.data.studierendenantrag_id
- }
- ).then(
- result => {
- if (result.data.error)
- {
- for (var k in result.data.retval)
- {
- if (this.errors[k] !== undefined)
- this.errors[k].push(result.data.retval[k]);
- else
- this.errors.default.push(result.data.retval[k]);
- }
- this.$emit('setStatus', {
- msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_error')})),
- severity:'danger'
+
+ this.$refs.form.clearValidation();
+ this.$refs.form.factory
+ .studstatus.abmeldung.cancel(
+ this.data.studierendenantrag_id
+ )
+ .then(result => {
+ if (Number.isInteger(result.data))
+ document.location = document.location.replace(/abmeldung\/([0-9]*)\/[0-9]*[\/]?$/, 'abmeldung/$1') + "/" + result.data;
+
+ this.data = result.data;
+ if (this.data.status)
+ this.$emit("setStatus", {
+ msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.data.statustyp})),
+ severity: this.statusSeverity
});
- }
else
- {
- if (Number.isInteger(result.data.retval)) {
- document.location = document.location.replace(/abmeldung\/([0-9]*)\/[0-9]*[\/]?$/, 'abmeldung/$1') + "/" + result.data.retval;
- }
- this.data = result.data.retval;
- if (this.data.status) {
- this.$emit("setStatus", {
- msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.data.statustyp})),
- severity: this.statusSeverity
- });
- }
- else
- this.$emit('setStatus', {
- msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_cancelled')})),
- severity: 'danger'
- });
- }
+ this.$emit('setStatus', {
+ msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_cancelled')})),
+ severity: 'danger'
+ });
this.saving = false;
- }
- );
+ })
+ .catch(error => {
+ this.$emit('setStatus', {
+ msg: Vue.computed(() => this.$p.t('studierendenantrag', 'status_x', {status: this.$p.t('studierendenantrag', 'status_error')})),
+ severity: 'danger'
+ });
+ this.saving = false;
+ this.$fhcAlert.handleSystemError(error);
+ });
}
},
created() {
@@ -179,10 +147,9 @@ export default {
template: `
| |