diff --git a/cis/testtool/admin/index.php b/cis/testtool/admin/index.php index 6da9c0fd6..2232ae896 100644 --- a/cis/testtool/admin/index.php +++ b/cis/testtool/admin/index.php @@ -80,7 +80,7 @@ $save_vorschlag_error=false; - + + //]]> + @@ -111,12 +118,12 @@ if($result = pg_query($conn, $qry)) { $gruppe = $row->gruppe_kurzbz; } - else + else die('Pruefling wurde nicht gefunden'); } -else +else die('Pruefling wurde nicht gefunden'); - + //Start des Pruefungsvorganges if(isset($_GET['start'])) { @@ -141,22 +148,22 @@ if(isset($_POST['submitantwort']) && isset($_GET['frage_id'])) { if(!$antwort->load($_POST['antwort_id'])) die('Antwort konnte nicht geladen werden'); - else + else { $antwort->new = false; $antwort->antwort_id = $_POST['antwort_id']; } } - else + else $antwort->new = true; - + $antwort->frage_id = $_GET['frage_id']; $antwort->pruefling_id = $_SESSION['pruefling_id']; $antwort->antwort = trim(strtoupper($_POST['antwort'])); $antwort->endtime = date('Y-m-d H:i:s'); if(!$antwort->save()) die('Fehler beim Speichern'); - else + else { $frage = new frage($conn); $frage_id = $frage->getNextFrage($gebiet_id, $gruppe, $frage_id); @@ -175,16 +182,16 @@ if($result = pg_query($conn, $qry)) //Hat bereits Fragen beantwortet -> Frage anzeigen $demo=false; } - else - { + else + { //Demo anzeigen $demo=true; } } - else + else die('error'); } -else +else die('error'); //Zeit des Gebietes holen @@ -198,12 +205,12 @@ if(!$row = pg_fetch_object($result)) list($stunde, $minute, $sekunde) = split(':',$row->zeit); if($demo) -{ +{ //Wenn es sich um ein Demobeispiel handelt, dann wird die Maximale Gesamtzeit angezeigt echo $minute.':'.$sekunde.' Minuten '; - echo ""; + echo ""; } -else +else { //Wenn es sich um eine Testfrage handelt, dann wird die verbleibende Zeit angezeigt $qry = "SELECT '$row->zeit'-(now()-min(begintime)) as time FROM testtool.tbl_antwort JOIN testtool.tbl_frage USING(frage_id) WHERE gebiet_id='".addslashes($gebiet_id)."' AND pruefling_id='".addslashes($_SESSION['pruefling_id'])."'"; @@ -219,7 +226,7 @@ else $zeit = $zeit*-1; } - echo ' Minuten'; + echo ' Minuten'; echo ""; } echo ''; @@ -232,7 +239,7 @@ if($frage_id!='') //Frage wurde uebergeben { $frage->load($frage_id); } -else +else { if($demo) //Demofrage wird angezeigt { @@ -254,7 +261,7 @@ else if($frage->frage_id!='') { $frage_id = $frage->frage_id; - + if(!$demo) { //Nachschauen ob diese Frage bereits angesehen wurde @@ -271,12 +278,12 @@ if($frage->frage_id!='') echo 'Fehler beim Speichern der Erstansicht'; } } - echo '

'; + echo '

'; //Bild und Text der Frage anzeigen if($frage->bild!='') - echo "

\n"; - echo "$frage->text

\n"; - + echo "

\n"; + echo "$frage->text

\n"; + //Vorschlaege laden $vs = new vorschlag($conn); $vs->getVorschlag($frage->frage_id); @@ -286,20 +293,20 @@ if($frage->frage_id!='') //Vorschlaege anzeigen foreach ($vs->result as $vorschlag) { - echo "\n"; - echo "$vorschlag->antwort
"; + echo "\n"; + echo "$vorschlag->antwort
"; if($vorschlag->bild!='') - echo "
"; + echo "
"; if($vorschlag->text!='') - echo $vorschlag->text.'
'; + echo $vorschlag->text.'
'; echo ""; $anzahl++; - + if($anzahl>$MAX_VORSCHLAEGE_PRO_ZEILE) { echo ''; $anzahl=1; - } + } } echo ''; //Antwort laden falls bereits vorhanden @@ -307,12 +314,12 @@ if($frage->frage_id!='') $antwort->getAntwort($_SESSION['pruefling_id'],$frage->frage_id); if(!$demo) { - echo "
frage_id\" method=\"POST\">"; - echo "antwort_id\">"; - echo "Antwort: antwort))."\">   "; + echo "frage_id\" method=\"POST\">"; + echo "antwort_id\" />"; + echo "Antwort: antwort))."\" /> "; echo "
"; } - echo '


'; + echo '


'; //Fusszeile mit Weiter Button und Sprung direkt zu einer Frage if(!$demo) { @@ -325,29 +332,29 @@ if($frage->frage_id!='') if($row->frage_id==$frage_id) echo " $row->nummer -"; else - echo " $row->nummer -"; + echo " $row->nummer -"; } } - + //Naechste Frage holen und Weiter-Button anzeigen $frage = new frage($conn); $nextfrage = $frage->getNextFrage($gebiet_id, $gruppe, $frage_id, $demo); if($nextfrage) { - echo " Weiter >>"; + echo " Weiter >>"; } - else + else { //Wenns der letzte Eintrag ist, wieder zum ersten springen echo " Weiter >>"; } - + echo '
'; } else { //Wenn kein Demo vorhanden ist - echo "


Start drcken um zu beginnen
"; + echo "


Start drcken um zu beginnen
"; } ?> diff --git a/cis/testtool/mathml.xsl b/cis/testtool/mathml.xsl new file mode 100644 index 000000000..7afdb6171 --- /dev/null +++ b/cis/testtool/mathml.xsl @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/cis/testtool/pmathml.xsl b/cis/testtool/pmathml.xsl new file mode 100644 index 000000000..faafd306c --- /dev/null +++ b/cis/testtool/pmathml.xsl @@ -0,0 +1,597 @@ + + + + + + + + + + '<!--' + + + + + + + + + + + + + + + + + + + + + + + + +in mpdialog mode, we just write out some JavaScript to display +dialog to the reader asking whether they want to install MathPlayer +Depending on the response we get, we then instantiate an XSL processor +and reprocess the doc, passing $secondpass according to the +reader response. + +Using d-o-e is fairly horrible, but this code is only for IE +anyway, and we need to force HTML semantics in this case. + + +var cookieName = "MathPlayerInstall="; +function MPInstall(){ + var showDialog=true; + var c = document.cookie; + var i = c.indexOf(cookieName); + if (i >= 0) { + if ( c.substr(i + cookieName.length, 1) >= 2) { showDialog=false; } + } + if (showDialog) { + MPDialog(); + c = document.cookie; + i = c.indexOf(cookieName); + } + if (i >= 0) return c.substr(i + cookieName.length, 1); + else return null; +} + +function MPDialog() { + var vArgs=""; + var sFeatures="dialogWidth:410px;dialogHeight:190px;help:off;status:no"; + var text = ""; + text += "javascript:document.write('" + text += '<script>' + text += 'function fnClose(v) { ' + text += 'var exp = new Date();' + text += 'var thirtyDays = exp.getTime() + (30 * 24 * 60 * 60 * 1000);' + text += 'exp.setTime(thirtyDays);' + text += 'var cookieProps = ";expires=" + exp.toGMTString();' + text += 'if (document.forms[0].dontask.checked) v+=2;' + text += 'document.cookie="' + cookieName + '"+v+cookieProps;' + text += 'window.close();' + text += '}' + text += '</' + 'script>' + text += '<head><title>Install MathPlayer?</title></head>' + text += '<body bgcolor="#D4D0C8"><form>' + text += '<table cellpadding=10 style="font-family:Arial;font-size:10pt" border=0 width=100%>' + text += '<tr><td align=left>This page requires Design Science\\\'s MathPlayer&trade;.<br>' + text += 'Do you want to download and install MathPlayer?</td></tr>'; + text += '<tr><td align=center><input type="checkbox" name="dontask">' + text += 'Don\\\'t ask me again</td></tr>' + text += '<tr><td align=center><input id=yes type="button" value=" Yes "' + text += ' onClick="fnClose(1)">&nbsp;&nbsp;&nbsp;' + text += '<input type="button" value=" No " onClick="fnClose(0)"></td></tr>' + text += '</table></form>'; + text += '</body>' + text += "')" + window.showModalDialog( text , vArgs, sFeatures ); +} + +function WaitDialog() { + var vArgs=""; + var sFeatures="dialogWidth:510px;dialogHeight:150px;help:off;status:no"; + var text = ""; + text += "javascript:document.write('" + text += '<script>' + text += 'window.onload=fnLoad;' + text += 'function fnLoad() {document.forms[0].yes.focus();}' + text += 'function fnClose(v) { ' + text += 'window.returnValue=v;' + text += 'window.close();' + text += '}' + text += '</' + 'script>' + text += '<head><title>Wait for Installation?</title></head>' + text += '<body bgcolor="#D4D0C8" onload="fnLoad()"><form><' + text += 'table cellpadding=10 style="font-family:Arial;font-size:10pt" border=0 width=100%>' + text += '<tr><td align=left>Click OK once MathPlayer is installed ' + text += 'to refresh the page.<br>' + text += 'Click Cancel to view the page immediately without MathPlayer.</td></tr>'; + text += '<tr><td align=center><input id=yes type="button" ' + text += 'value=" OK " onClick="fnClose(1)">&nbsp;&nbsp;&nbsp;' + text += '<input type="button" value="Cancel" onClick="fnClose(0)"></td></tr>' + text += '</table></form>'; + text += '</body>' + text += "')" + return window.showModalDialog( text , vArgs, sFeatures ); +} + +var result = MPInstall(); + +var action = "fallthrough"; +if (result == 1 || result == 3) { + window.open("http://www.dessci.com/webmath/mathplayer"); + var wait = WaitDialog(); + if ( wait == 1) { + action = "install"; + document.location.reload(); + + } +} +if (action == "fallthrough") { +var xsl = new ActiveXObject("Microsoft.FreeThreadedXMLDOM"); +xsl.async = false; +xsl.validateOnParse = false; +xsl.load("pmathmlcss.xsl"); +var xslTemplate = new ActiveXObject("MSXML2.XSLTemplate.3.0"); +xslTemplate.stylesheet=xsl.documentElement; +var xslProc = xslTemplate.createProcessor(); +xslProc.input = document.XMLDocument; + +xslProc.transform(); +var str = xslProc.output; + +var repl = "replace"; +if (window.navigator.appVersion.match(/Windows NT 5.1/)) { repl = ""; } +var newDoc = document.open("text/html", repl); +newDoc.write(str); +document.close(); +} + + +mathplayer-dl + +techexplorer-plugin + + + + + + + + techexplorer-plugin + + + + + mathplayer-dl + + + + + + + + + + + + +IE5 hacks +This code will be ignored by an XSLT engine as a top level +element in a foreign namespace. It will be executed by an IE5XSL +engine and insert <!-- into the output stream, ie the start of a +comment. This will comment out all the XSLT code which will be copied +to the output. A similar clause below will close this comment, it is +then followed by the IE5XSL templates to be executed. +This trick is due to Jonathan Marsh of Microsoft, and used in +the stylesheet for +the XPath 2 data model draft. + + +XSLT stylesheet +MSXSL script block + +The following script block implements an extension function that +tests whether a specified ActiveX component is known to the client. +This is used below to test for the existence of MathML rendering +components. + + function isinstalled(ax) + { + try { + var ActiveX = new ActiveXObject(ax); + return "true"; + } catch (e) { + return "false"; + } +} + + +The main bulk of this stylesheet is an identity transformation so... + + + + + + + + + +XHTML elements are copied sans prefix (XHTML is default namespace +here, so these elements will still be in XHTML namespace + + + + + + + +IE's treatment of XHTML as HTML needs a little help here... + + + + + + > + + + + + + + + + + +This just ensures the mathml prefix declaration isn't copied from +the source at this stage, so that the system will use the mml prefix +coming from this stylesheet + + + + + + + +We modify the head element to add code to specify a Microsoft +"Behaviour" if the behaviour component is known to the system. +Test for MathPlayer (Design Science) +Test for Techexplorer (IBM) +Test for Microsoft. In this case we just +output a small HTML file that executes a script that will re-process +the source docuument with a different stylesheet. Doing things this +way avoids the need to xsl:import the second stylesheet, which would +very much increase the processing overhead of running this +stylesheet. +Further tests (eg for netscape/mozilla) could +be added here if necessary + + + + + + + + + + namespace="mml" implementation="#mmlFactory" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +Somewhat bizarrely in an otherwise namespace aware system, +Microsoft behaviours are defined to trigger off the +prefix not the Namespace. In the code above +we associated a MathML rendering behaviour (if one was found) with the +prefix mml: so here we ensure that this is the prefix +that actually gets used in the output. + + + + + + + +Copy semantics element through in IE (so mathplayer gets to see +mathplayer annotations, otherwise use first child or a presentation annotation. + + + + + + + + + + + + + + + + + + + + + + + + > + + + + + + + + + /> + + + + + + " + + + + + + " + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +IE5XSL stylesheet +In a rare fit of sympathy for users of +the-language-known-as-XSL-in-IE5 this file incorporates a +version of the above code designed to work in the Microsoft dialect. +This is needed otherwise users of a MathML rendering behaviour would +have to make a choice whether they wanted to use this stylesheet +(keeping their source documents conforming XHTML+MathML) or to use +the explicit Microsoft Object code, which is less portable, but would +work in at least IE5.5. + +This entire section of code, down to the end of the stylesheet is +contained within this ie5:if. Thus XSLT sees it as a top level element +from a foreign namespace and silently ignores it. IE5XSL sees it as +"if true" and so executes the code. + + +First close the comment started at the beginning. This ensures +that the bulk of the XSLT code, while being copied to the result tree +by the IE5XSL engine, will not be rendered in the browser. + +Lacking attribute value templates in +xsl:element, and the local-name() function, we resort to constructing +the start and end tags in strings in javascript, then using +no-entities attribute which is the IE5XSL equivalent of disable-output-encoding + + +'-->' + + + + + + function mpisinstalled() + { + try { + var ActiveX = new ActiveXObject("MathPlayer.Factory.1"); + return "true"; + } catch (e) { + return "false"; + } +} + + + + + + + + + + + + + + + + + + + + +'<mml:' + this.nodeName.substring(this.nodeName.indexOf(":")+1) + +' ' + this.nodeName="" + +'>' + +'</mml:' + this.nodeName.substring(this.nodeName.indexOf(":")+1) + '>' + + + + + + + +'<math>' + +'</math>' + + + + +'<mml:' + this.nodeName.substring(this.nodeName.indexOf(":")+1) + +' ' + this.nodeName="" + +'>' + +'</mml:' + this.nodeName.substring(this.nodeName.indexOf(":")+1) + '>' + + + + + + + + + + + namespace="mml" implementation="#mmlFactory" + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/content/fas_bis_personal.php b/content/fas_bis_personal.php index 6a41b043b..c86974b37 100644 --- a/content/fas_bis_personal.php +++ b/content/fas_bis_personal.php @@ -7,7 +7,7 @@ header("content-type text/xml"); if(!$conn=pg_connect(CONN_STRING_FAS)) die("Connection Problem"); - $error=''; + $error='
VornameNachnamePersNrFehlermeldung
'; $funktionen=''; $stgleitung=''; $myausmass='
VornameNachnamePersNrFehlermeldung
'; @@ -17,7 +17,7 @@ $stsemwhere = "(funktion.studiensemester_fk=$stsem1 OR funktion.studiensemester_fk=$stsem2)"; if(isset($_GET['printerror']) && $_GET['printerror']=='false') $printerror=false; - else + else $printerror=true; echo ''."\n"; ?> @@ -58,10 +58,10 @@ if(!in_array($row->habilitation,array('J','j','N','n'))) $error.= ''; echo " ".$row->habilitation."\n"; - + //VERWENDUNG echo " \n"; - + //Beschaeftigungsart1 $qry1 = "Select beschart1 from funktion where mitarbeiter_fk='$row->mitarbeiter_pk' and beschart1 in(1,2,3,4,5,6) AND $stsemwhere"; if(!$result1 = pg_query($conn,$qry1)) @@ -71,9 +71,9 @@ $error.= ''; else $beschart1 = $row1->beschart1; - + echo " ".$beschart1."\n"; - + //Beschaeftingungsart2 $qry1 = "Select beschart2 from funktion where mitarbeiter_fk='$row->mitarbeiter_pk' and beschart2 in(1,2) AND $stsemwhere"; if(!$result1 = pg_query($conn,$qry1)) @@ -83,9 +83,9 @@ $error.= ''; else $beschart2 = $row1->beschart2; - + echo " ".$beschart2."\n"; - + //Beschaeftigungsausmass $qry1 = "Select ausmass from funktion where mitarbeiter_fk='$row->mitarbeiter_pk' and ausmass in(1,2,3,4,5) AND $stsemwhere"; if(!$result1 = pg_query($conn,$qry1)) @@ -95,7 +95,7 @@ $error.= ''; else $ausmass = $row1->ausmass; - + echo " ".$ausmass."\n"; $myausmass .= ""; //Verwendung @@ -107,9 +107,9 @@ $error.= ''; else $verwendung = $row1->verwendung; - + echo " ".$verwendung."\n"; - + //Hauptberuflich / Hauptberuf $qry1 = "Select hauptberuflich, hauptberuf from funktion where mitarbeiter_fk = '$row->mitarbeiter_pk' and hauptberuflich!='' AND $stsemwhere"; if(!$result1=pg_query($conn,$qry1)) @@ -135,8 +135,8 @@ $hauptberuf = $row1->hauptberuf; } - - + + //Studiengangsleiter Funktionen zusammenbauen $qry1 = "Select distinct kennzahl FROM studiengang where studiengang_pk in(Select studiengang_fk from funktion where funktion.funktion=5 AND $stsemwhere AND mitarbeiter_fk='$row->mitarbeiter_pk')"; if(!$result1 = pg_query($conn,$qry1)) @@ -152,12 +152,12 @@ //FUNKTIONEN $qry1 = "SELECT studiengang_pk, kennzahl, entwicklungsteam, besonderequalifikation FROM funktion, studiengang WHERE mitarbeiter_fk='$row->mitarbeiter_pk' AND $stsemwhere AND studiengang_fk=studiengang_pk"; - + if($result1 = pg_query($conn,$qry1)) { $stg = array(); while($row1 = pg_fetch_object($result1)) - { + { //Wenn noch kein Funktionseintrag fuer diesen Studiengang vorhanden ist if(!in_array($row1->studiengang_pk,$stg)) { @@ -167,12 +167,12 @@ $x = sprintf("%04d",$row1->kennzahl); $funktion.= " \n"; $funktion.= " ".$x."\n"; - + //$qry2 = "Select sum(sws) as sws from lehreinheit, mitarbeiterlehreinheit where lehreinheit_pk = lehreinheit_fk and (lehreinheit.studiensemester_fk=$stsem1 or lehreinheit.studiensemester_fk=$stsem2) and mitarbeiter_fk='$row->mitarbeiter_pk'"; $qry2 = "Select sum(semesterwochenstunden) as sws from lehreinheit, mitarbeiter_lehreinheit where studiengang_fk='$row1->studiengang_pk' AND lehreinheit_pk = mitarbeiter_lehreinheit.lehreinheit_fk and (lehreinheit.studiensemester_fk=$stsem1 or lehreinheit.studiensemester_fk=$stsem2) and mitarbeiter_fk='$row->mitarbeiter_pk'"; if(!$row2 = pg_fetch_object(pg_query($conn,$qry2))) $error.="
qry failed: $qry2"; - + //Semesterwochenstunden if($row2->sws > 80 || $row2->sws < 0) $error.= '
'; @@ -185,7 +185,7 @@ $funktion.= " ".$hauptberuflich."\n"; //Hauptberuf if($hauptberuflich=='n' || $hauptberuflich=='N') - { + { if(!in_array($hauptberuf, array(0,1,2,3,4,5,6,7,8,9,10,11,12))) $error.= ''; $funktion.= " ".$hauptberuf."\n"; @@ -193,9 +193,9 @@ //Mitglied im Entwicklungsteam if(!in_array($row1->entwicklungsteam, array('J','j','n','N'))) $funktion.= " N\n"; - else + else $funktion.= " ".$row1->entwicklungsteam."\n"; - + //Besondere Qualifikation if($row1->entwicklungsteam=='J' || $row1->entwicklungsteam=='j') { @@ -209,9 +209,9 @@ } } } - else + else $error.=""; - + if($aktpers!=0) //Ende einer Person erreicht { echo $stgleitung; @@ -220,7 +220,7 @@ echo " \n"; } } - + if($printerror) { echo $error.'
VornameNachnameAusmass
'.$row->vorname.''.$row->familienname.''.$row->persnr.'Habilitation ist ungueltig
'.$row->vorname.''.$row->familienname.''.$row->persnr.'BeschaeftigungsArt1 ist ungueltig
'.$row->vorname.''.$row->familienname.''.$row->persnr.'BeschaeftigungsArt2 ist ungueltig
'.$row->vorname.''.$row->familienname.''.$row->persnr.'Ausmass ist ungueltig
$row->vorname$row->familienname$ausmass
'.$row->vorname.''.$row->familienname.''.$row->persnr.'Verwendung ist ungueltig
'.$row->vorname.''.$row->familienname.''.$row->persnr.'SWS ist ungueltig:'.$row2->sws.'
'.$row->vorname.''.$row->familienname.''.$row->persnr.' HauptberufCode ist ungueltig
qry failed: $qry1
'; diff --git a/content/functions.js.php b/content/functions.js.php index 2892918d8..92e7d011e 100644 --- a/content/functions.js.php +++ b/content/functions.js.php @@ -14,7 +14,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. * - * Authors: Christian Paminger , + * Authors: Christian Paminger , * Andreas Oesterreicher and * Rudolf Hangl . */ @@ -27,13 +27,13 @@ // **** // * Liefert den Value aus einer XML-Datasource // **** -function getTargetHelper(dsource,subj,predi) +function getTargetHelper(dsource,subj,predi) { - if (dsource.hasArcOut(subj, predi)) + if (dsource.hasArcOut(subj, predi)) { var target = dsource.GetTarget(subj, predi, true); if (target instanceof Components.interfaces.nsIRDFLiteral || - target instanceof Components.interfaces.nsIRDFInt) + target instanceof Components.interfaces.nsIRDFInt) { return target.Value; } @@ -69,7 +69,7 @@ function gettimestamp() // **** // * Parst die Returnwerte der DBDML Scripte // * @param response ... RDF Response des DBDML Scripts -// * +// * // * obj.dbdml_return ... Returnwert des Scripts // * obj.dbdml_errormsg ... Errormessage // * obj.dbdml_data ... zusaetzliche Daten vom Script. zB ID des angelegten Datansatzes @@ -79,13 +79,13 @@ function ParseReturnValue(response) netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); // Returnwerte aus RDF abfragen var dsource=parseRDFString(response, 'http://www.technikum-wien.at/dbdml'); - + var rdfService = Components.classes["@mozilla.org/rdf/rdf-service;1"]. getService(Components.interfaces.nsIRDFService); var subject = rdfService.GetResource("http://www.technikum-wien.at/dbdml/0"); - + var predicateNS = "http://www.technikum-wien.at/dbdml/rdf"; - + retval = getTargetHelper(dsource, subject, rdfService.GetResource( predicateNS + "#return" )); if(retval=='true') this.dbdml_return = true; diff --git a/content/mitarbeiterdetailoverlay.xul.php b/content/mitarbeiterdetailoverlay.xul.php index 17bbc35d7..a8746e872 100644 --- a/content/mitarbeiterdetailoverlay.xul.php +++ b/content/mitarbeiterdetailoverlay.xul.php @@ -205,14 +205,14 @@ echo ''; - + - +