diff --git a/include/fachbereich.class.php b/include/fachbereich.class.php index f79c931a1..a5fd7c2d7 100644 --- a/include/fachbereich.class.php +++ b/include/fachbereich.class.php @@ -59,7 +59,7 @@ class fachbereich extends basis_db */ public function getAll() { - $qry = 'SELECT * FROM public.tbl_fachbereich order by fachbereich_kurzbz;'; + $qry = 'SELECT * FROM public.tbl_fachbereich ORDER BY fachbereich_kurzbz;'; if(!$this->db_query($qry)) { @@ -85,6 +85,50 @@ class fachbereich extends basis_db return true; } + /** + * Laedt die Institute die als Array uebergeben werden + * @param $kurzbzs Array mit den Instituts-Kurzbezeichnungen + * @param $order Sortierreihenfolge + * @param $aktiv wenn true dann nur aktive sonst alle + * @return true wenn ok, false im Fehlerfall + */ + public function loadArray($kurzbzs, $order=null, $aktiv=true) + { + if(count($kurzbzs)==0) + return true; + + $kurzbzs = "'".implode("','",$kurzbzs)."'"; + $qry = 'SELECT * FROM public.tbl_fachbereich WHERE fachbereich_kurzbz in('.$kurzbzs.')'; + if ($aktiv) + $qry.=' AND aktiv=true'; + + if($order!=null) + $qry .=" ORDER BY $order"; + + if(!$this->db_query($qry)) + { + $this->errormsg = 'Fehler beim Laden der Datensaetze'; + return false; + } + + while($row = $this->db_fetch_object()) + { + $fachb_obj = new fachbereich(); + + $fachb_obj->fachbereich_kurzbz = $row->fachbereich_kurzbz; + $fachb_obj->bezeichnung = $row->bezeichnung; + $fachb_obj->farbe = $row->farbe; + $fachb_obj->studiengang_kz = $row->studiengang_kz; + $fachb_obj->ext_id = $row->ext_id; + $fachb_obj->aktiv = ($row->aktiv=='t'?true:false); + $fachb_obj->oe_kurzbz = $row->oe_kurzbz; + + $this->result[] = $fachb_obj; + $this->bezeichnung_arr[$row->fachbereich_kurzbz] = $row->bezeichnung; + } + return true; + } + /** * Laedt einen Fachbereich * @param $fachb_id ID des zu ladenden Fachbereiches diff --git a/include/functions.inc.php b/include/functions.inc.php index dd04cfd34..6e9edde78 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -390,7 +390,13 @@ function checkldapuser($username,$password) return(false); } -//Berechnet die Schnittmenge zweier Strings +/** + * Berechnet die Schnittmenge zweier Strings + * + * @param $str1 + * @param $str2 + * @return intersected string + */ function intersect($str1, $str2) { if (mb_strlen($str1) > mb_strlen($str2)) @@ -409,6 +415,13 @@ function intersect($str1, $str2) return $intersect; } +/** + * Konvertiert Problematische Sonderzeichen in Strings fuer + * Accountnamen und EMail-Aliase + * + * @param $str + * @return bereinigter String + */ function convertProblemChars($str) { $enc = 'UTF-8'; @@ -481,17 +494,12 @@ function xmlclean($string) return str_replace($mixed, "", $string); } - -// ------------------------------------------------------------------------------------------ -// Stringverkuerzen auf bestimmte laenge -// ------------------------------------------------------------------------------------------ - /** - * Verkuertzt einen String auf eine bestimmte laenge - beachtet werden Wortzeichen - * @param String der die Zeichenkette enthaelt die verkuertzt werden soll - * @param Laenge des Strings der geliefert werden soll (inkl. der Laenge des Fortsetzungszeichen) - * @return Daten Objekt wenn ok, false im Fehlerfall - */ - +/** + * Verkuertzt einen String auf eine bestimmte laenge - beachtet werden Wortzeichen + * @param String der die Zeichenkette enthaelt die verkuertzt werden soll + * @param Laenge des Strings der geliefert werden soll (inkl. der Laenge des Fortsetzungszeichen) + * @return Daten Objekt wenn ok, false im Fehlerfall + */ function StringCut($str='',$len=0,$checkWortumbruch=false,$fortsetzungszeichen='...') { // Plausib @@ -567,9 +575,15 @@ function StringCut($str='',$len=0,$checkWortumbruch=false,$fortsetzungszeichen=' } return $vStr; } + +/** + * Prueft ob ein String UTF-8 Kodiert ist + * + * @param $str + * @return true wenn utf8 sonst false + */ function check_utf8($str="") { -#return true; $cStr=$str; if (strlen($cStr)>3590) { @@ -589,80 +603,92 @@ function check_utf8($str="") return $stati; } -// ------------------------------------------------------------------------------------------ -// Konertierungen -// ------------------------------------------------------------------------------------------ +/** + * DB Array Konvertieren zu XML + * + * @param $rows + * @param $root + * @return XML + */ +function array_to_xml($rows,$root='root') +{ + if (!count($rows)) + return '<'.$root.' />'."\r\n"; + + $xml_string=''; + $xml_string.='<'.$root.'>'."\r\n"; + reset($rows); - -// ------------------------------------------------------------------------------------------ -// DB Array Konvertieren zu XML -// ------------------------------------------------------------------------------------------ - function array_to_xml($rows,$root='root') - { - if (!count($rows)) - return '<'.$root.' />'."\r\n"; - - $xml_string=''; - $xml_string.='<'.$root.'>'."\r\n"; - reset($rows); - - for ($i=0;$i'."\r\n"; - } - elseif (is_numeric($tmp_key)) - { - $xml_string.=''."\r\n"; - } - } - $xml_string.=''."\r\n"; - } - $xml_string.=''."\r\n"; - return $xml_string; + $xml_string.='<'.$tmp_key.'>'."\r\n"; + } + elseif (is_numeric($tmp_key)) + { + $xml_string.=''."\r\n"; + } + } + $xml_string.=''."\r\n"; + } + $xml_string.=''."\r\n"; + return $xml_string; +} + +/** + * DB Array Konvertieren zu RDF + * + * @param $rows + * @param $root + * @param $rdf_uri + * @return RDF + */ +function array_to_rdf($rows,$root='root',$rdf_uri='rdf') +{ + $rdf_server=$_SERVER['SERVER_NAME']; + $rdf_string=''; + if (!count($rows)) + return $rdf_string.='<'.strtoupper($rdf_uri).':'.$root.' />'."\r\n"; + + $rdf_string.='<'.strtoupper($rdf_uri).':Seq rdf:about="http://'.$rdf_server.'/'.$root.'/liste">'."\r\n"; + + reset($rows); + for ($i=0;$i'."\r\n"; + $rdf_string.='<'.strtoupper($rdf_uri).':Description id="'.$i.'" about="http://'.$rdf_server.'/liste'.$i.'">'."\r\n"; + + $row=$rows[$i]; + reset($row); + while (list( $tmp_key, $tmp_value ) = each($row) ) + { + if (!is_numeric($tmp_key)) + { + $rdf_string.='<'.strtoupper($rdf_uri).':'.$tmp_key.'>'."\r\n"; + } + } + $rdf_string.=''."\r\n"; + $rdf_string.=''."\r\n"; } + $rdf_string.=''."\r\n"; + return $rdf_string; +} -// ------------------------------------------------------------------------------------------ -// DB Array Konvertieren zu RDF -// ------------------------------------------------------------------------------------------ - function array_to_rdf($rows,$root='root',$rdf_uri='rdf') - { -##exit(" $root $rdf_uri "); +/** + * Prueft, ob ein String nur aus ganzen Zahlen besteht + * + * @param $mixed + * @return boolean + */ +function isint( $mixed ) +{ + return ( preg_match( '/^\d*$/' , $mixed) == 1 ); +} - $rdf_server=$_SERVER['SERVER_NAME']; - $rdf_string=''; - if (!count($rows)) - return $rdf_string.='<'.strtoupper($rdf_uri).':'.$root.' />'."\r\n"; - -# $rdf_string.='<'.strtoupper($rdf_uri).':'.$root.'>'."\r\n"; - $rdf_string.='<'.strtoupper($rdf_uri).':Seq rdf:about="http://'.$rdf_server.'/'.$root.'/liste">'."\r\n"; - - reset($rows); - for ($i=0;$i'."\r\n"; - $rdf_string.='<'.strtoupper($rdf_uri).':Description id="'.$i.'" about="http://'.$rdf_server.'/liste'.$i.'">'."\r\n"; - - $row=$rows[$i]; - reset($row); - while (list( $tmp_key, $tmp_value ) = each($row) ) - { - if (!is_numeric($tmp_key)) - { - $rdf_string.='<'.strtoupper($rdf_uri).':'.$tmp_key.'>'."\r\n"; - } - } - $rdf_string.=''."\r\n"; - $rdf_string.=''."\r\n"; - } -# $rdf_string.=''."\r\n"; - $rdf_string.=''."\r\n"; - return $rdf_string; - } ?> diff --git a/include/lehrveranstaltung.class.php b/include/lehrveranstaltung.class.php index 1d5727333..c394a0703 100644 --- a/include/lehrveranstaltung.class.php +++ b/include/lehrveranstaltung.class.php @@ -20,6 +20,7 @@ * Rudolf Hangl . */ require_once(dirname(__FILE__).'/basis_db.class.php'); +require_once(dirname(__FILE__).'/functions.inc.php'); class lehrveranstaltung extends basis_db { @@ -306,7 +307,7 @@ class lehrveranstaltung extends basis_db } if(!is_null($aktiv) && !is_bool($aktiv)) { - $this->errormsg = 'Aktivkz muss ein boolscher Wert sein'; + $this->errormsg = 'Aktiv muss ein boolscher Wert sein'; return false; } if(!is_null($lehre) && !is_bool($lehre)) @@ -495,11 +496,6 @@ class lehrveranstaltung extends basis_db $this->errormsg = 'Planfaktor ist ungueltig'; return false; } - if($this->semesterstunden!='' && !is_numeric($this->semesterstunden)) - { - $this->errormsg = 'Semesterstunden ist ungueltig'; - return false; - } if($this->planlektoren!='' && !is_numeric($this->planlektoren)) { $this->errormsg = 'Planlektoren ist ungueltig'; @@ -515,6 +511,11 @@ class lehrveranstaltung extends basis_db $this->errormsg = 'ECTS darf nicht groesser als 40 sein'; return false; } + if($this->semesterstunden!='' && !isint($this->semesterstunden)) + { + $this->errormsg = 'Semesterstunden muss ein eine gueltige ganze Zahl sein'; + return false; + } $this->errormsg = ''; return true; } diff --git a/rdf/diplomasupplement.xml.php b/rdf/diplomasupplement.xml.php index 79f28a149..37b5652ac 100644 --- a/rdf/diplomasupplement.xml.php +++ b/rdf/diplomasupplement.xml.php @@ -113,26 +113,25 @@ if (isset($_REQUEST["xmlformat"]) && $_REQUEST["xmlformat"] == "xml") else echo ' '; - if($row->organisationsform=='m') + if($row->orgform_kurzbz=='VBB') { - //Bei Mischformen, die Organisationsform aus dem Status nehmen + //Bei Mischformen, die OrgForm aus dem Status nehmen $prestudent = new prestudent(); $prestudent->getLastStatus($row->prestudent_id); - switch($prestudent->orgform_kurzbz) - { - case 'BB': $row->organisationsform = 'b'; break; - case 'VZ': $row->organisationsform = 'v'; break; - case 'FST': $row->organisationsform = 'f'; break; - } - + $row->orgform_kurzbz=$prestudent->orgform_kurzbz; } - if($row->organisationsform=='b' || $row->organisationsform=='BB') - echo ' Berufbegleitendes Studium/Part-time degree programm'; - elseif($row->organisationsform=='v' || $row->organisationsform=='VZ') - echo ' Vollzeitstudium/Full-time degree programm'; - else - echo ' Fernstudium/Distance study'; + switch($row->orgform_kurzbz) + { + case 'BB': echo ' Berufbegleitendes Studium/Part-time degree programm'; + break; + case 'VZ': echo ' Vollzeitstudium/Full-time degree programm'; + break; + case 'FST': echo ' Fernstudium/Distance study'; + break; + default: echo ' '; + break; + } if($row->typ=='d') { diff --git a/system/FH-Complete.txp b/system/FH-Complete.txp index bc3c1be80..0da5627c2 100644 --- a/system/FH-Complete.txp +++ b/system/FH-Complete.txp @@ -19423,7 +19423,7 @@ 1361 0 1021 - 1214 + 1175 0 1 1 @@ -21239,11 +21239,11 @@ 2382 - 1812 + 1789 2413 - 1812 + 1789 3032 @@ -21290,11 +21290,11 @@ 1361 - 1725 + 1706 1330 - 1725 + 1706 1118 @@ -21336,16 +21336,16 @@ {91BA0243-304A-4001-80BF-C75C622D009C} - 1332 - 2535 + 1161 + 2530 - 2042 - 2332 + 1701 + 2293 - 2042 - 2363 + 1701 + 2324 1376 @@ -21392,11 +21392,11 @@ 2382 - 1638 + 1622 2413 - 1638 + 1622 4447 @@ -21443,11 +21443,11 @@ 2382 - 1465 + 1454 2413 - 1465 + 1454 6072 @@ -21490,15 +21490,15 @@ {A32D24AE-207A-4907-ABD5-BB9CBE371A16} 1696 - 2131 + 2130 1361 - 2028 + 1999 1330 - 2028 + 1999 1207 @@ -21591,16 +21591,16 @@ {33986E60-971D-45AB-863E-3389A4534998} - 2130 + 2144 1735 2382 - 1985 + 1957 2413 - 1985 + 1957 2413 @@ -21647,11 +21647,11 @@ 1361 - 1422 + 1412 1330 - 1422 + 1412 1189 @@ -21749,11 +21749,11 @@ 2382 - 1291 + 1286 2413 - 1291 + 1286 3129 @@ -22156,8 +22156,8 @@ {4C98A428-14DD-4587-B44B-5A31CAA42B19} - 1384 - 2229 + 1414 + 2368 2424 @@ -22176,12 +22176,12 @@ 2324 - 1701 - 2363 + 2042 + 2324 - 1701 - 2332 + 2042 + 2293 @@ -23895,7 +23895,7 @@ {4C98A428-14DD-4587-B44B-5A31CAA42B19} 1721 - 2093 + 2095 2666 @@ -23915,11 +23915,11 @@ 2413 - 2159 + 2125 2382 - 2159 + 2125 @@ -30721,7 +30721,7 @@ 234 0 1021 - 1214 + 1175 0 1 1 @@ -31035,16 +31035,16 @@ {744DF66B-0A2B-4220-A1CE-27094A300A0F} - 479 - 1757 + 474 + 1743 574 - 1718 + 1679 574 - 1749 + 1710 574 @@ -31239,16 +31239,16 @@ {07671D5F-C98D-435D-9506-BEDB90120E11} - 1065 + 1063 1689 915 - 1718 + 1679 915 - 1749 + 1710 1119 @@ -34417,7 +34417,7 @@ Technikum Wien 2.0 2009-04-17T10:15:21.000+01:00 - 2009-12-09T15:11:57.703+01:00 + 2009-12-10T10:09:35.000+01:00 FH-Complete 2.0 @@ -96682,47 +96682,6 @@ ALTER TABLE tbl_mitarbeiter ALTER COLUMN personalnummer DROP NOT NULL; 0 - - {3E484EFE-3C40-4442-AA12-51AA56E1FE5F} - organisationsform - 20 - {C92E5E2A-0C2D-42DA-8D64-0C199FE96D5E} - 0 - 1 - 17 - 0 - 1 - - - - - 1 - - 0 - - 0 - 0 - organisationsform - 0 - - - - - - - - - - {E12D6C2A-E13A-4877-B9C4-AA7BA668C316} - - - - - - - - 0 - {3FDA30B7-95F7-4362-BAAF-4744878EC11F} titelbescheidvom diff --git a/system/checksystem.php b/system/checksystem.php index 5f6975197..11d22520c 100644 --- a/system/checksystem.php +++ b/system/checksystem.php @@ -306,6 +306,16 @@ if($result = $db->db_query("SELECT is_nullable FROM information_schema.columns W } } +if(@$db->db_query("SELECT organisationsform FROM public.tbl_studiengang LIMIT 1")) +{ + $qry = "ALTER TABLE public.tbl_studiengang DROP COLUMN organisationsform;"; + + if(!$db->db_query($qry)) + echo 'public.tbl_studiengang: '.$db->db_last_error().'
'; + else + echo 'public.tbl_studiengang: Spalte organisationsform entfernt!
'; +} + echo '
'; @@ -435,7 +445,7 @@ $tabellen=array( "public.tbl_standort" => array("standort_kurzbz","adresse_id"), "public.tbl_student" => array("student_uid","matrikelnr","prestudent_id","studiengang_kz","semester","verband","gruppe","updateamum","updatevon","insertamum","insertvon","ext_id"), "public.tbl_studentlehrverband" => array("student_uid","studiensemester_kurzbz","studiengang_kz","semester","verband","gruppe","updateamum","updatevon","insertamum","insertvon","ext_id"), - "public.tbl_studiengang" => array("studiengang_kz","kurzbz","kurzbzlang","typ","bezeichnung","english","farbe","email","telefon","max_semester","max_verband","max_gruppe","erhalter_kz","bescheid","bescheidbgbl1","bescheidbgbl2","bescheidgz","bescheidvom","orgform_kurzbz","titelbescheidvom","aktiv","ext_id","zusatzinfo_html","organisationsform","moodle","sprache","testtool_sprachwahl","studienplaetze","oe_kurzbz","lgartcode"), + "public.tbl_studiengang" => array("studiengang_kz","kurzbz","kurzbzlang","typ","bezeichnung","english","farbe","email","telefon","max_semester","max_verband","max_gruppe","erhalter_kz","bescheid","bescheidbgbl1","bescheidbgbl2","bescheidgz","bescheidvom","orgform_kurzbz","titelbescheidvom","aktiv","ext_id","zusatzinfo_html","moodle","sprache","testtool_sprachwahl","studienplaetze","oe_kurzbz","lgartcode"), "public.tbl_studiensemester" => array("studiensemester_kurzbz","bezeichnung","start","ende","ext_id"), "public.tbl_variable" => array("name","uid","wert"), "public.tbl_vorlage" => array("vorlage_kurzbz","bezeichnung","anmerkung"), diff --git a/vilesci/lehre/lehrveranstaltung_details.php b/vilesci/lehre/lehrveranstaltung_details.php index 7fb6239f6..bd7330f48 100644 --- a/vilesci/lehre/lehrveranstaltung_details.php +++ b/vilesci/lehre/lehrveranstaltung_details.php @@ -126,13 +126,18 @@ if (isset($_REQUEST['lv_id']) || isset($_REQUEST['neu'])) { - $lv = new lehrveranstaltung(); - - if (isset($_REQUEST['lv_id'])) + //wenn ein Fehler beim Speichern auftritt, dann sollen die alten Daten nochmals + //angezeigt werden. + if(!isset($_POST['schick'])) { - $lvid = $_REQUEST['lv_id']; - if (!$lv->load($lvid)) - $htmlstr .= "
Lehrveranstaltung ".$lvid." existiert nicht
"; + $lv = new lehrveranstaltung(); + + if (isset($_REQUEST['lv_id'])) + { + $lvid = $_REQUEST['lv_id']; + if (!$lv->load($lvid)) + $htmlstr .= "
Lehrveranstaltung ".$lvid." existiert nicht
"; + } } $htmlstr .= "
Lehrveranstaltung
\n"; @@ -271,12 +276,11 @@ } $htmlstr .= "
".$errorstr."
\n"; ?> - -Studiengang - Details +Lehrveranstaltung - Details