This commit is contained in:
Andreas Österreicher
2007-12-06 15:43:47 +00:00
parent 1a4358381d
commit 2fa290aac4
8 changed files with 421 additions and 8 deletions
+5
View File
@@ -419,6 +419,11 @@ Studenten<br>
<hr>
<h2>Erledigte Anforderungen</h2>
<ul>
<li>Beim Speichern von Lehreinheiten werden jetzt nicht mehr alle
Lehrveranstaltungen aufgeklappt.<br>
06.12.2007 oesi<br>
<br>
</li>
<li>AccountInfoBl&auml;tter k&ouml;nnen nur noch von den eigenen
Studenten erstellt werden. AccountInfoBl&auml;tter f&uuml;r Mitarbeiter
k&ouml;nnen nun nur mehr erstellt werden wenn Schreibrechte auf
+67 -1
View File
@@ -65,7 +65,22 @@ class variable
// *********************************************************
function load($uid, $name)
{
return false;
$qry = "SELECT wert FROM public.tbl_variable WHERE uid='".addslashes($uid)."' AND name='".addslashes($name)."'";
if($result = pg_query($this->conn, $qry))
{
if($row = pg_fetch_object($result))
{
$this->uid = $uid;
$this->name = $name;
$this->wert = $row->wert;
return true;
}
else
return false;
}
else
return false;
}
// *******************************************
@@ -145,5 +160,56 @@ class variable
return false;
}
}
// ****
// * Loescht einen Variableneintrag
// ****
function delete($name, $uid)
{
if($name=='' || $uid == '')
{
$this->errormsg = 'Name und UID muessen angegeben werden';
return false;
}
$qry = "DELETE FROM public.tbl_variable WHERE name='".addslashes($name)."' AND uid='".addslashes($uid)."'";
if(pg_query($this->conn, $qry))
return true;
else
{
$this->errormsg = 'Fehler beim Loeschen';
return false;
}
}
// ******
// * Liefert alle Variablen eines Benutzers
// ******
function getVars($uid)
{
$qry = "SELECT * FROM public.tbl_variable WHERE uid='".addslashes($uid)."' ORDER BY name";
if($result = pg_query($this->conn, $qry))
{
while($row = pg_fetch_object($result))
{
$v = new variable($this->conn, null, null, null);
$v->uid = $row->uid;
$v->name = $row->name;
$v->wert = $row->wert;
$this->variables[] = $v;
}
return true;
}
else
{
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}
}
?>
+6 -2
View File
@@ -203,7 +203,7 @@ if ($berechtigung->isBerechtigt('admin'))
</table>
</td>
</tr>
<!--Menu Eintrag Freifächer-->
<!--Menu Eintrag Freifaecher-->
<tr>
<td nowrap><a href="?Freifach" class="MenuItem1" onClick="return(js_toggle_container('Freifach'));"><img src="../skin/images/menu_item.gif" width="7" height="9">&nbsp;Freifach</a>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="Freifach" style="display: block;">
@@ -217,7 +217,7 @@ if ($berechtigung->isBerechtigt('admin'))
</tr>
</table>
</td>
</tr>
</tr>
</table>
</div>
@@ -359,6 +359,10 @@ if ($berechtigung->isBerechtigt('admin'))
<td width="10" nowrap>&nbsp;</td>
<td nowrap><a class="MenuItem2" href="stammdaten/benutzerberechtigung_frameset.html" target="main"><img src="../skin/images/menu_item.gif" width="7" height="9">&nbsp;&Uuml;bersicht</a></td>
</tr>
<tr>
<td width="10" nowrap>&nbsp;</td>
<td nowrap><a class="MenuItem2" href="stammdaten/variablen_frameset.html" target="main"><img src="../skin/images/menu_item.gif" width="7" height="9">&nbsp;Variablen</a></td>
</tr>
</table>
</td>
</tr>
@@ -22,7 +22,7 @@
$htmlstr .= "</div>";
$htmlstr .= "<form name='formular'><input type='hidden' name='check' value=''></form><table id='t1' class='liste table-autosort:2 table-stripeclass:alternate table-autostripe'>\n";
$htmlstr .= " <thead><tr class='liste'>\n";
$htmlstr .= " <th class='table-sortable:default'>UID</th><th class='table-sortable:default'>Vorname</th><th class='table-sortable:alphanumeric'>Nachname</th><th class='table-sortable:default'>Telefon</th><th class='table-sortable:default'>Email</th>";
$htmlstr .= " <th class='table-sortable:default'>UID</th><th class='table-sortable:default'>Vorname</th><th class='table-sortable:alphanumeric'>Nachname</th>";
$htmlstr .= " </tr></thead><tbody>\n";
$i = 0;
while($row=pg_fetch_object($erg))
@@ -32,9 +32,6 @@
$htmlstr .= " <td>".$row->uid."</td>\n";
$htmlstr .= " <td>".$row->vorname."</td>\n";
$htmlstr .= " <td><a href='benutzerberechtigung_details.php?uid=".$row->uid."' target='detail'>".$row->nachname."</a></td>\n";
$htmlstr .= " <td></td>\n";
$htmlstr .= " <td></td>\n";
$htmlstr .= " </tr>\n";
$i++;
}
+1 -1
View File
@@ -26,7 +26,7 @@
{
//$htmlstr .= " <tr class='liste". ($i%2) ."'>\n";
$htmlstr .= " <tr>\n";
$htmlstr .= " <td>".$row->firma_id."</td>\n";
$htmlstr .= " <td><a href='firma_details.php?firma_id=".$row->firma_id."' target='detail'>".$row->firma_id."</a></td>\n";
$htmlstr .= " <td><a href='firma_details.php?firma_id=".$row->firma_id."' target='detail'>".$row->name."</a></td>\n";
$htmlstr .= " <td>$row->adresse</td>\n";
$htmlstr .= " <td>$row->email</td>\n";
+224
View File
@@ -0,0 +1,224 @@
<?php
/* Copyright (C) 2006 Technikum-Wien
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
*/
require_once('../config.inc.php');
require_once('../../include/globals.inc.php');
require_once('../../include/functions.inc.php');
require_once('../../include/benutzerberechtigung.class.php');
require_once('../../include/variable.class.php');
require_once('../../include/person.class.php');
require_once('../../include/benutzer.class.php');
require_once('../../include/studiensemester.class.php');
if (!$conn = @pg_pconnect(CONN_STRING))
die('Es konnte keine Verbindung zum Server aufgebaut werden.');
$user = get_uid();
$rechte = new benutzerberechtigung($conn);
$rechte->getBerechtigungen($user);
if(!$rechte->isBerechtigt('admin'))
die('Sie haben keine Rechte für diese Seite');
$reloadstr = ""; // neuladen der liste im oberen frame
$htmlstr = "";
$errorstr = ""; //fehler beim insert
$name = isset($_REQUEST['name'])?$_REQUEST['name']:'';
$uid = isset($_REQUEST['uid'])?$_REQUEST['uid']:'';
$wert = isset($_REQUEST['wert'])?$_REQUEST['wert']:'';
if(isset($_GET['standard']))
{
$stsem_obj = new studiensemester($conn);
$stsem = $stsem_obj->getaktorNext();
$qrys = array(
"Insert into public.tbl_variable(name, uid, wert) values('semester_aktuell','$uid','$stsem');",
"Insert into public.tbl_variable(name, uid, wert) values('db_stpl_table','$uid','stundenplandev');",
"Insert into public.tbl_variable(name, uid, wert) values('ignore_kollision','$uid','false');",
"Insert into public.tbl_variable(name, uid, wert) values('kontofilterstg','$uid','false');",
"Insert into public.tbl_variable(name, uid, wert) values('ignore_zeitsperre','$uid','false');",
"Insert into public.tbl_variable(name, uid, wert) values('ignore_reservierung','$uid','false');"
);
$error = false;
foreach ($qrys as $qry)
{
if(!@pg_query($conn, $qry))
{
$error = true;
}
}
if($error)
$errorstr.="Es konnten nicht alle Werte angelegt werden";
$reloadstr .= "<script type='text/javascript'>\n";
$reloadstr .= " parent.uebersicht.location.href='variablen_uebersicht.php';";
$reloadstr .= "</script>\n";
}
if(isset($_POST["del"]))
{
if($name!='' && $uid!='')
{
$variable = new variable($conn);
if(!$variable->delete($name, $uid))
$errorstr .= "Datensatz konnte nicht gel&ouml;scht werden!";
else
{
$reloadstr .= "<script type='text/javascript'>\n";
$reloadstr .= " parent.uebersicht.location.href='variablen_uebersicht.php';";
$reloadstr .= "</script>\n";
}
}
else
{
die('Falsche Parameteruebergabe');
}
}
if(isset($_POST["schick"]))
{
$variable=new variable($conn);
if($variable->load($uid, $name))
$varialbe->new = false;
else
$variable->new = true;
$variable->name = $name;
$variable->uid = $uid;
$variable->wert = $wert;
if ($variable->save())
{
$reloadstr .= "<script type='text/javascript'>\n";
$reloadstr .= " parent.uebersicht.location.href='variablen_uebersicht.php';";
$reloadstr .= "</script>\n";
}
}
$qry = "SELECT distinct name FROM public.tbl_variable order by name";
if($result = pg_query($conn, $qry))
{
while($row = pg_fetch_object($result))
{
$namen[] = $row->name;
}
}
if ($uid!='')
{
$ben = new benutzer($conn);
if (!$ben->load($uid))
$htmlstr .= "<br><div class='kopf'>Benutzer <b>".$uid."</b> existiert nicht</div>";
else
{
$var = new variable($conn);
$var->getVars($uid);
$htmlstr .= "<br><div class='kopf'>Variablen für <b>".$uid."</b></div>\n";
$htmlstr .= "<table style='padding-top:10px;'>\n";
$htmlstr .= "<tr></tr>\n";
$htmlstr .= "<tr><td>Name</td><td>Wert</td></tr>\n";
foreach($var->variables as $v)
{
$htmlstr .= "<form action='".$_SERVER['PHP_SELF']."' method='POST'>\n";
$htmlstr .= "<input type='hidden' name='uid' value='".$v->uid."'>\n";
$htmlstr .= " <tr>\n";
$htmlstr .= " <td><select name='name'>\n";
foreach($namen as $val)
{
if ($val == $v->name)
$sel = " selected";
else
$sel = "";
$htmlstr .= " <option value='".$val."' ".$sel.">".$val."</option>";
}
$htmlstr .= " </select></td>\n";
$htmlstr .= " <td><input type='text' name='wert' value='".$v->wert."' size='15' maxlength='64'></td>\n";
$htmlstr .= " <td><input type='submit' name='schick' value='speichern'></td>";
$htmlstr .= " <td><input type='submit' name='del' value='l&ouml;schen'></td>";
$htmlstr .= " </tr>\n";
$htmlstr .= "</form>\n";
}
$htmlstr .= "<form action='".$_SERVER['PHP_SELF']."' method='POST'>\n";
$htmlstr .= "<input type='hidden' name='uid' value='".$uid."'>\n";
$htmlstr .= " <tr>\n";
$htmlstr .= " <td><select name='name'>\n";
foreach($namen as $val)
{
$htmlstr .= " <option value='".$val."'>".$val."</option>";
}
$htmlstr .= " </select></td>\n";
$htmlstr .= " <td><input type='text' name='wert' value='' size='15' maxlength='64'></td>\n";
$htmlstr .= " <td><input type='submit' name='schick' value='neu'></td>";
$htmlstr .= " </tr>\n";
$htmlstr .= "</form>\n";
$htmlstr .= "</table>\n";
$htmlstr .="<br><br><a href='".$_SERVER['PHP_SELF']."?standard=true&uid=$uid'>Standardwerte anlegen</a>";
}
}
$htmlstr .= "<div class='inserterror'>".$errorstr."</div>\n";
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Studiengang - Details</title>
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css">
<script src="../../include/js/mailcheck.js"></script>
<script src="../../include/js/datecheck.js"></script>
<script type="text/javascript">
function confdel()
{
if(confirm("Diesen Datensatz wirklick loeschen?"))
return true;
return false;
}
</script>
</head>
<body style="background-color:#eeeeee;">
<?php
echo $htmlstr;
echo $reloadstr;
?>
</body>
</html>
@@ -0,0 +1,21 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">
<html lang="de_AT">
<head>
<title>VileSci</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css" />
</head>
<frameset rows="60%,*">
<frame src="variablen_uebersicht.php" id="uebersicht" name="uebersicht" frameborder="0" />
<frame src="variablen_details.php" id="detail" name="detail" frameborder="0" />
<noframes>
<body bgcolor="#FFFFFF">
This application works only with a frames-enabled browser.<br />
<a href="main.php">Use without frames</a>
</body>
</noframes>
</frameset>
</html>
@@ -0,0 +1,96 @@
<?php
/* Copyright (C) 2006 Technikum-Wien
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Christian Paminger <christian.paminger@technikum-wien.at>,
* Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
* Rudolf Hangl <rudolf.hangl@technikum-wien.at>.
*/
require_once('../config.inc.php');
require_once('../../include/functions.inc.php');
require_once('../../include/studiengang.class.php');
require_once('../../include/benutzerberechtigung.class.php');
if (!$conn = @pg_pconnect(CONN_STRING))
die('Es konnte keine Verbindung zum Server aufgebaut werden.');
$user = get_uid();
$rechte = new benutzerberechtigung($conn);
$rechte->getBerechtigungen($user);
if(!$rechte->isBerechtigt('admin'))
die('Sie haben keine Berechtigung für diese Seite');
$htmlstr = "";
$sql_query = "SELECT
distinct(tbl_variable.uid), tbl_person.nachname, tbl_person.vorname
FROM
public.tbl_variable, public.tbl_benutzer, public.tbl_person
WHERE
tbl_variable.uid = tbl_benutzer.uid AND
tbl_benutzer.person_id = tbl_person.person_id
ORDER BY
nachname";
if(!$erg=pg_query($conn, $sql_query))
{
$errormsg='Fehler beim Laden der Berechtigungen';
}
else
{
//$htmlstr = "<table class='liste sortable'>\n";
$htmlstr .= "<div style='text-align:right'>";
$htmlstr .= "<form name='neuform' action='variablen_details.php' target='detail'><input type='text' value='' name='uid'>&nbsp;<input type='submit' name='neuschick' value='go'></form>";
$htmlstr .= "</div>";
$htmlstr .= "<form name='formular'><input type='hidden' name='check' value=''></form><table id='t1' class='liste table-autosort:2 table-stripeclass:alternate table-autostripe'>\n";
$htmlstr .= " <thead><tr class='liste'>\n";
$htmlstr .= " <th class='table-sortable:default'>UID</th><th class='table-sortable:default'>Vorname</th><th class='table-sortable:alphanumeric'>Nachname</th>";
$htmlstr .= " </tr></thead><tbody>\n";
$i = 0;
while($row=pg_fetch_object($erg))
{
//$htmlstr .= " <tr class='liste". ($i%2) ."'>\n";
$htmlstr .= " <tr>\n";
$htmlstr .= " <td>".$row->uid."</td>\n";
$htmlstr .= " <td>".$row->vorname."</td>\n";
$htmlstr .= " <td><a href='variablen_details.php?uid=".$row->uid."' target='detail'>".$row->nachname."</a></td>\n";
$htmlstr .= " </tr>\n";
$i++;
}
$htmlstr .= "</tbody></table>\n";
}
?>
<html>
<head>
<title>Variablen Uebersicht</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css">
<link rel="stylesheet" href="../../include/js/tablesort/table.css" type="text/css">
<script src="../../include/js/tablesort/table.js" type="text/javascript"></script>
</head>
<body class="background_main">
<h2>Variablen &Uuml;bersicht</h2>
<?php
echo $htmlstr;
?>
</body>
</html>