mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-19 16:02:15 +00:00
- Verwaltungsseite für Organisationseinheiten
- Berechtigungen für Firmen und Organisationseinheiten - JQuery und JQuery-UI für Drag&Drop unterstützung
This commit is contained in:
@@ -21,9 +21,32 @@
|
||||
</tr>
|
||||
<tr><td>
|
||||
<!-- Newseintrag -->
|
||||
<div id="news">
|
||||
<div id="news">
|
||||
<div class="news">
|
||||
|
||||
<div class="titel">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td width="30%" align="left">E-Mail Erinnerungen</td>
|
||||
<td width="30%" align="center"></td>
|
||||
<td width="30%" align="right" style="display: block" id="1Verfasser">04.11.2009</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div class="text" style="display: block;" id="1Text">
|
||||
Ab 10. November 2009 werden automatische e-mail-Erinnerungen an Studierende versandt, deren Medien bereits überfällig bzw. kurz vor dem Ablaufen sind. Wir haben dabei eine Testphase bis 30. November vorgesehen.
|
||||
Ab 1. Dezember 2009 wird es dann ernst: BenutzerInnen, deren Medien seit 7 Tagen oder länger überfällig sind, werden für die weitere Entlehnung gesperrt. Gleichzeitig mit der Sperre wird eine Mahngebühr fällig. Diese beträgt innerhalb von 14 Tagen ab Sperre 4 Euro, ab dem 15. Tag 7 Euro. Wir dürfen Sie daher in Ihrem eigenen Interesse ersuchen, Fristverlängerungen (telefonisch oder per e-Mail) rechtzeitig durchzuführen.
|
||||
Für Rückfragen steht Ihnen das Bibliotheksteam gerne zur Verfügung.<br>
|
||||
<br>
|
||||
As of November 10, library users will receive automatically generated e-mail reminders, if the loan period of their media is about to expire or has already expired. There will be a test phase until November 30.
|
||||
As of December 1, students whose media have been overdue for 7 days or longer, will be blocked from borrowing more media. In addition to this a penalty fee will be due. This fee is 4 Euros within 14 days after being blocked and 7 Euros after that date.
|
||||
So, renewing the loan period (by phone or by e-mail) is for your own benefit.
|
||||
Please feel free to contact the library staff if you have any questions.
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="news">
|
||||
|
||||
<div class="titel">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
|
||||
Vendored
+298
File diff suppressed because one or more lines are too long
Vendored
+19
File diff suppressed because one or more lines are too long
@@ -39,6 +39,9 @@ class organisationseinheit extends basis_db
|
||||
public $organisationseinheittyp_kurzbz;
|
||||
public $aktiv;
|
||||
|
||||
public $oe_kurzbz_orig;
|
||||
public $beschreibung;
|
||||
|
||||
/**
|
||||
* Konstruktor
|
||||
* @param $oe_kurzbz Kurzbz der Organisationseinheit
|
||||
@@ -232,5 +235,89 @@ class organisationseinheit extends basis_db
|
||||
}
|
||||
return $childs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Speichert eine Organisationseinheit
|
||||
*
|
||||
* @param $new
|
||||
*/
|
||||
public function save($new=null)
|
||||
{
|
||||
if(is_null($new))
|
||||
$new = $this->new;
|
||||
|
||||
if($new)
|
||||
{
|
||||
//Neu anlegen
|
||||
$qry = 'INSERT INTO public.tbl_organisationseinheit(oe_kurzbz, oe_parent_kurzbz, bezeichnung,
|
||||
organisationseinheittyp_kurzbz, aktiv) VALUES('.
|
||||
$this->addslashes($this->oe_kurzbz).','.
|
||||
$this->addslashes($this->oe_parent_kurzbz).','.
|
||||
$this->addslashes($this->bezeichnung).','.
|
||||
$this->addslasheS($this->organisationseinheittyp_kurzbz).','.
|
||||
($this->aktiv?'true':'false').');';
|
||||
}
|
||||
else
|
||||
{
|
||||
if($this->oe_kurzbz=='')
|
||||
{
|
||||
$this->errormsg = 'Kurzbezeichnung darf nicht leer sein';
|
||||
return false;
|
||||
}
|
||||
|
||||
if($this->oe_kurzbz_orig=='')
|
||||
{
|
||||
$this->oe_kurzbz_orig=$this->oe_kurzbz;
|
||||
}
|
||||
|
||||
$qry = 'UPDATE public.tbl_organisationseinheit SET '.
|
||||
' oe_kurzbz='.$this->addslashes($this->oe_kurzbz).','.
|
||||
' oe_parent_kurzbz='.$this->addslashes($this->oe_parent_kurzbz).','.
|
||||
' bezeichnung='.$this->addslashes($this->bezeichnung).','.
|
||||
' organisationseinheittyp_kurzbz='.$this->addslashes($this->organisationseinheittyp_kurzbz).','.
|
||||
' aktiv='.($this->aktiv?'true':'false').
|
||||
" WHERE oe_kurzbz='".addslashes($this->oe_kurzbz_orig)."';";
|
||||
}
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Speichern der Organisationseinheit';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Laedt alle Organisationseinheittypen
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getTypen()
|
||||
{
|
||||
$qry = "SELECT * FROM public.tbl_organisationseinheittyp ORDER BY bezeichnung";
|
||||
|
||||
if($result = $this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object($result))
|
||||
{
|
||||
$obj = new organisationseinheit();
|
||||
|
||||
$obj->organisationseinheittyp_kurzbz = $row->organisationseinheittyp_kurzbz;
|
||||
$obj->bezeichnung = $row->bezeichnung;
|
||||
$obj->beschreibung = $row->beschreibung;
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Laden der Typen';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -62,16 +62,24 @@
|
||||
<!-- <td class="tdwrap"></td>
|
||||
<td><a href="private/info/oeh/index.php" target="content" class="Item" ><img src="../skin/images/menu_item.gif" alt="menu item" width="7" height="9"> ÖH-Wahl</a></td>
|
||||
-->
|
||||
<td class="tdwrap"></td>
|
||||
<td><a href="private/info/oeh/index.php" target="content" class="Item"><img src="../skin/images/menu_item.gif" alt="menu item" width="7" height="9"> ÖH-Mandate 2009</a>
|
||||
</td>
|
||||
</tr>
|
||||
<td class="tdwrap"></td>
|
||||
<td><a target="content" href="private/info/oeh/index.php" class="MenuItem" onClick="js_toggle_container('oeh');"><img src="../skin/images/menu_item.gif" alt="menu item" width="7" height="9"> ÖH</a>
|
||||
<table class="tabcontent" id="oeh" style="display: visible">
|
||||
<tr>
|
||||
<td class="tdwrap"></td>
|
||||
<td><a href="private/info/oeh/index.php" target="content" class="Item"><img src="../skin/images/menu_item.gif" alt="menu item" width="7" height="9"> ÖH-Mandate 2009</a></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="tdwrap"></td>
|
||||
<td><a href="private/info/oeh/wahlen.php" target="content" class="Item"><img src="../skin/images/menu_item.gif" alt="menu item" width="7" height="9"> ÖH-Herbstwahlen 2009 </a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tdwrap"></td>
|
||||
<td><a href="private/info/oeh/wahlen.php" target="content" class="Item"><img src="../skin/images/menu_item.gif" alt="menu item" width="7" height="9"> ÖH-Herbstwahlen 2009 </a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tdwrap"></td>
|
||||
<td><a href="private/info/oeh/bewerber.php" target="content" class="Item"><img src="../skin/images/menu_item.gif" alt="menu item" width="7" height="9"> ÖH-Kandidaturen </a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
|
||||
@@ -104,14 +104,14 @@ $menu=array
|
||||
),
|
||||
'Stammdaten'=> array
|
||||
(
|
||||
'name'=>'Stammdaten', 'opener'=>'true', 'hide'=>'true', 'permissions'=>array('admin','lv-plan','support','basis/berechtigung','basis/variable','basis/studiengang','basis/ort'), 'image'=>'folder.png',
|
||||
'name'=>'Stammdaten', 'opener'=>'true', 'hide'=>'true', 'permissions'=>array('admin','lv-plan','support','basis/berechtigung','basis/variable','basis/studiengang','basis/ort','basis/firma'), 'image'=>'folder.png',
|
||||
'link'=>'left.php?categorie=Stammdaten', 'target'=>'nav',
|
||||
'Betriebsmittel'=>array('name'=>'Betriebsmittel', 'link'=>'stammdaten/betriebsmittel_frameset.html', 'target'=>'main'),
|
||||
'Reihungstest'=>array('name'=>'Reihungstest', 'link'=>'stammdaten/reihungstestverwaltung.php', 'target'=>'main'),
|
||||
'Betriebsmittel'=>array('name'=>'Betriebsmittel', 'link'=>'stammdaten/betriebsmittel_frameset.html', 'target'=>'main','permissions'=>array('admin')),
|
||||
'Reihungstest'=>array('name'=>'Reihungstest', 'link'=>'stammdaten/reihungstestverwaltung.php', 'target'=>'main','permissions'=>array('admin','assistenz')),
|
||||
|
||||
'User'=>array
|
||||
(
|
||||
'name'=>'User',
|
||||
'name'=>'User', 'permissions'=>array('basis/variable','basis/berechtigung'),
|
||||
'Berechtigungen'=>array('name'=>'Berechtigungen', 'link'=>'stammdaten/benutzerberechtigung_frameset.html', 'target'=>'main','permissions'=>array('basis/berechtigung')),
|
||||
'Variablen'=>array('name'=>'Variablen', 'link'=>'stammdaten/variablen_frameset.html', 'target'=>'main', 'target'=>'main','permissions'=>array('basis/variable')),
|
||||
),
|
||||
@@ -123,10 +123,11 @@ $menu=array
|
||||
),*/
|
||||
'Studiengang'=>array('name'=>'Studiengang', 'link'=>'stammdaten/studiengang_frameset.html', 'target'=>'main','permissions'=>array('basis/studiengang')),
|
||||
'Ort'=>array('name'=>'Ort (Raum)', 'link'=>'stammdaten/raum_frameset.html', 'target'=>'main','permissions'=>array('basis/ort')),
|
||||
'Firmen'=>array('name'=>'Firmen', 'link'=>'stammdaten/firma_frameset.html', 'target'=>'main'),
|
||||
'Firmen'=>array('name'=>'Firmen', 'link'=>'stammdaten/firma_frameset.html', 'target'=>'main','permissions'=>array('basis/firma')),
|
||||
'Organisationseinheiten'=>array('name'=>'Organisationseinheiten', 'link'=>'stammdaten/organisationseinheiten.php', 'target'=>'main','permissions'=>array('basis/organisationseinheit')),
|
||||
'ImExport'=>array
|
||||
(
|
||||
'name'=>'ImExport',
|
||||
'name'=>'ImExport','permissions'=>array('admin'),
|
||||
'Zutrittskarten'=>array('name'=>'Zutrittskarten', 'link'=>'stammdaten/imexport/zutrittskarten/index.html', 'target'=>'main')
|
||||
)
|
||||
),
|
||||
@@ -157,7 +158,6 @@ $menu=array
|
||||
'Raumauslastung'=>array('name'=>'Raumauslastung', 'link'=>'lehre/raumauslastung.php', 'target'=>'main'),
|
||||
'Verplanungsuebersicht'=>array('name'=>'Verplanungsübersicht', 'link'=>'lehre/check/verplanungsuebersicht.php', 'target'=>'main'),
|
||||
'Zeitwünsche'=>array('name'=>'Zeitwünsche', 'link'=>'lehre/zeitwuensche.php', 'target'=>'main'),
|
||||
'Organisationseinheiten'=>array('name'=>'Organisationseinheiten', 'link'=>'stammdaten/organisationseinheiten.php', 'target'=>'main'),
|
||||
'Institute'=>array('name'=>'Institute', 'link'=>'personen/institutsliste.php', 'target'=>'main'),
|
||||
),
|
||||
'Admin'=> array
|
||||
|
||||
@@ -21,17 +21,15 @@
|
||||
* Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at >
|
||||
*/
|
||||
|
||||
require_once('../../config/vilesci.config.inc.php');
|
||||
require_once('../../include/basis_db.class.php');
|
||||
if (!$db = new basis_db())
|
||||
die('Es konnte keine Verbindung zum Server aufgebaut werden.');
|
||||
|
||||
require_once('../../config/vilesci.config.inc.php');
|
||||
require_once('../../include/functions.inc.php');
|
||||
require_once('../../include/firma.class.php');
|
||||
require_once('../../include/adresse.class.php');
|
||||
require_once('../../include/nation.class.php');
|
||||
require_once('../../include/benutzerberechtigung.class.php');
|
||||
|
||||
if (!$db = new basis_db())
|
||||
die('Es konnte keine Verbindung zum Server aufgebaut werden.');
|
||||
|
||||
// ******* INIT ********
|
||||
$user = get_uid();
|
||||
@@ -40,7 +38,7 @@
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($user);
|
||||
|
||||
if(!$rechte->isBerechtigt('admin') && !$rechte->isBerechtigt('preinteressent') && !$rechte->isBerechtigt('assistenz'))
|
||||
if(!$rechte->isBerechtigt('basis/firma'))
|
||||
die('Sie haben keine Berechtigung für diese Seite');
|
||||
|
||||
$htmlstr = '';
|
||||
@@ -72,6 +70,9 @@
|
||||
//Loeschen einer Adresse
|
||||
if(isset($_GET['deleteadresse']))
|
||||
{
|
||||
if(!$rechte->isBerechtigt('basis/firma',null, 'suid'))
|
||||
die('Sie haben keine Berechtigung fuer diese Aktion');
|
||||
|
||||
if(is_numeric($adresse_id))
|
||||
{
|
||||
$adresse_obj = new adresse();
|
||||
@@ -85,6 +86,9 @@
|
||||
//Speichern einer Adresse
|
||||
if(isset($_POST['saveadresse']))
|
||||
{
|
||||
if(!$rechte->isBerechtigt('basis/firma',null,'suid'))
|
||||
die('Sie haben keine Berechtigung fuer diese Aktion');
|
||||
|
||||
$adresse_obj = new adresse();
|
||||
|
||||
if(is_numeric($adresse_id))
|
||||
@@ -137,6 +141,9 @@
|
||||
// Speichern der Firmendaten
|
||||
if(isset($_POST['save']))
|
||||
{
|
||||
if(!$rechte->isBerechtigt('basis/firma',null, 'suid'))
|
||||
die('Sie haben keine Berechtigung fuer diese Aktion');
|
||||
|
||||
$firma = new firma();
|
||||
|
||||
if($firma_id!='')
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN">
|
||||
<html lang="de_AT">
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>VileSci</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css" />
|
||||
</head>
|
||||
|
||||
<frameset rows="70%,*">
|
||||
|
||||
@@ -20,17 +20,23 @@
|
||||
* Rudolf Hangl < rudolf.hangl@technikum-wien.at >
|
||||
* Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at >
|
||||
*/
|
||||
|
||||
require_once('../../config/vilesci.config.inc.php');
|
||||
require_once('../../include/basis_db.class.php');
|
||||
if (!$db = new basis_db())
|
||||
die('Es konnte keine Verbindung zum Server aufgebaut werden.');
|
||||
|
||||
require_once('../../include/functions.inc.php');
|
||||
require_once('../../config/vilesci.config.inc.php');
|
||||
require_once('../../include/functions.inc.php');
|
||||
require_once('../../include/firma.class.php');
|
||||
require_once('../../include/benutzerberechtigung.class.php');
|
||||
|
||||
|
||||
if (!$db = new basis_db())
|
||||
die('Es konnte keine Verbindung zum Server aufgebaut werden.');
|
||||
|
||||
$user = get_uid();
|
||||
|
||||
//Berechtigung pruefen
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($user);
|
||||
|
||||
if(!$rechte->isBerechtigt('basis/firma'))
|
||||
die('Sie haben keine Berechtigung fuer diese Seite');
|
||||
|
||||
$filter = (isset($_GET['filter'])?$_GET['filter']:'');
|
||||
$firmentypfilter = (isset($_GET['firmentypfilter'])?$_GET['firmentypfilter']:'');
|
||||
|
||||
|
||||
@@ -20,21 +20,211 @@
|
||||
* Rudolf Hangl <rudolf.hangl@technikum-wien.at> and
|
||||
* Gerald Simane-Sequens <gerald.simane-sequens@technikum-wien.at>
|
||||
*/
|
||||
/**
|
||||
* Stellt die Abhaengigkeiten Organisationseinheiten grafisch dar.
|
||||
*/
|
||||
require_once('../../config/vilesci.config.inc.php');
|
||||
require_once('../../include/benutzerfunktion.class.php');
|
||||
require_once('../../include/benutzerberechtigung.class.php');
|
||||
require_once('../../include/fachbereich.class.php');
|
||||
require_once('../../include/functions.inc.php');
|
||||
require_once('../../include/mitarbeiter.class.php');
|
||||
require_once('../../include/organisationseinheit.class.php');
|
||||
require_once('../../include/studiengang.class.php');
|
||||
|
||||
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
$user = get_uid();
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($user);
|
||||
|
||||
if(!$rechte->isBerechtigt('basis/organisationseinheit'))
|
||||
die('Sie haben keine Berechtigung fuer diese Seite');
|
||||
|
||||
echo '
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Organisationseinheiten - Übersicht</title>
|
||||
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css">
|
||||
<meta http-equiv="content-type" content="text/html" charset="UTF-8" />
|
||||
</head>
|
||||
<body class="Background_main">
|
||||
<h2>Organisationseinheiten - Übersicht</h2><br />';
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<link href="../../skin/vilesci.css" rel="stylesheet" type="text/css">
|
||||
<script src="../../include/js/jquery.js" language="Javascript"></script>
|
||||
<script src="../../include/js/jquery-ui.js" language="Javascript"></script>
|
||||
|
||||
<script language="Javascript">
|
||||
$(function() {
|
||||
$("a.ui-widget-content").draggable({revert: true, helper: \'clone\'});
|
||||
$("a.ui-widget-content").droppable({
|
||||
over: function(event, ui) {
|
||||
$(this).css("color","red");
|
||||
},
|
||||
out: function(event, ui) {
|
||||
$(this).css("color","#336699");
|
||||
},
|
||||
drop: function(event, ui) {
|
||||
$(this).css("color","#336699");
|
||||
var kurzbz = encodeURIComponent(ui.helper[0].id);
|
||||
var parent_kurzbz = encodeURIComponent(this.id);
|
||||
window.location.href="'.$_SERVER['PHP_SELF'].'?action=updateparent&kurzbz="+kurzbz+"&parent_kurzbz="+parent_kurzbz;
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
td
|
||||
{
|
||||
font-size: small;
|
||||
margin: 0px;
|
||||
padding: 2px;
|
||||
}
|
||||
a:hover
|
||||
{
|
||||
color:#336611;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h2>Organisationseinheiten</h2>
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td><span style="font-size: small">Zuordnung kann per Drag&Drop geändert werden!</font></td>
|
||||
<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=neu">Neue Organisationseinheit anlegen</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
';
|
||||
|
||||
//Parent durch Drag&Drop Updaten
|
||||
if(isset($_GET['action']) && $_GET['action']=='updateparent')
|
||||
{
|
||||
if(!$rechte->isBerechtigt('basis/organisationseinheit', null, 'suid'))
|
||||
die('Sie haben keine Berechtigung fuer diese Aktion');
|
||||
|
||||
$oe = new organisationseinheit($_GET['kurzbz']);
|
||||
|
||||
$oe->oe_parent_kurzbz = $_GET['parent_kurzbz'];
|
||||
if(!$oe->save())
|
||||
{
|
||||
echo 'Fehler:'.$oe->errormsg;
|
||||
}
|
||||
}
|
||||
|
||||
//Speichern der Daten
|
||||
if(isset($_POST['save']))
|
||||
{
|
||||
if(!$rechte->isBerechtigt('basis/organisationseinheit', null, 'suid'))
|
||||
die('Sie haben keine Berechtigung fuer diese Aktion');
|
||||
|
||||
if(!isset($_POST['oe_kurzbz'])
|
||||
|| !isset($_POST['oe_kurzbz_orig'])
|
||||
|| !isset($_POST['oe_parent_kurzbz'])
|
||||
|| !isset($_POST['bezeichnung'])
|
||||
|| !isset($_POST['organisationseinheittyp_kurzbz']))
|
||||
{
|
||||
die('Fehler bei der Parameteruebergabe');
|
||||
}
|
||||
else
|
||||
{
|
||||
if($_POST['oe_kurzbz_orig']=='')
|
||||
{
|
||||
$new = true;
|
||||
$oe = new organisationseinheit();
|
||||
}
|
||||
else
|
||||
{
|
||||
$new = false;
|
||||
$oe = new organisationseinheit($_POST['oe_kurzbz_orig']);
|
||||
}
|
||||
|
||||
$oe->oe_kurzbz_orig = $_POST['oe_kurzbz_orig'];
|
||||
$oe->oe_kurzbz = $_POST['oe_kurzbz'];
|
||||
$oe->oe_parent_kurzbz = $_POST['oe_parent_kurzbz'];
|
||||
$oe->bezeichnung = $_POST['bezeichnung'];
|
||||
$oe->organisationseinheittyp_kurzbz = $_POST['organisationseinheittyp_kurzbz'];
|
||||
$oe->aktiv = isset($_POST['aktiv']);
|
||||
|
||||
if($oe->save($new))
|
||||
{
|
||||
echo '<br><b>Daten erfolgreich gespeichert</b>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo '<br><span class="error">Fehler: '.$oe->errormsg.'</span>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Formular zum Editieren und NEU anlegen anzeigen
|
||||
if(isset($_GET['action']) && ($_GET['action']=='edit' || $_GET['action']=='neu'))
|
||||
{
|
||||
if(!$rechte->isBerechtigt('basis/organisationseinheit', null, 'suid'))
|
||||
die('Sie haben keine Berechtigung fuer diese Aktion');
|
||||
|
||||
if($_GET['action']=='edit')
|
||||
$oe = new organisationseinheit($_GET['kurzbz']);
|
||||
else
|
||||
$oe = new organisationseinheit();
|
||||
|
||||
echo '
|
||||
<form action="'.$_SERVER['PHP_SELF'].'" method="POST">
|
||||
<table>
|
||||
<tr>
|
||||
<td>Kurzbz</td><td>';
|
||||
echo '<input type="text" name="oe_kurzbz" value="'.$oe->oe_kurzbz.'" />';
|
||||
echo '<input type="hidden" name="oe_kurzbz_orig" value="'.$oe->oe_kurzbz.'" />';
|
||||
echo '</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Parent</td>
|
||||
<td>';
|
||||
|
||||
//Parent DropDown
|
||||
echo '<SELECT name="oe_parent_kurzbz">
|
||||
<OPTION value="">-- keine Auswahl --</OPTION>';
|
||||
|
||||
$hlp = new organisationseinheit();
|
||||
$hlp->getAll();
|
||||
foreach($hlp->result as $row)
|
||||
{
|
||||
if($row->oe_kurzbz==$oe->oe_parent_kurzbz)
|
||||
$selected='selected';
|
||||
else
|
||||
$selected='';
|
||||
|
||||
echo '<OPTION value="'.$row->oe_kurzbz.'" '.$selected.'>'.$row->organisationseinheittyp_kurzbz.' '.$row->bezeichnung.'</OPTION>';
|
||||
}
|
||||
echo '</SELECT>';
|
||||
echo '
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Bezeichnung</td><td><input type="text" size="50" name="bezeichnung" value="'.$oe->bezeichnung.'"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Typ</td><td>';
|
||||
|
||||
//TYP DropDown
|
||||
echo '<SELECT name="organisationseinheittyp_kurzbz">';
|
||||
$hlp = new organisationseinheit();
|
||||
$hlp->getTypen();
|
||||
foreach($hlp->result as $row)
|
||||
{
|
||||
if($row->organisationseinheittyp_kurzbz==$oe->organisationseinheittyp_kurzbz)
|
||||
$selected='selected';
|
||||
else
|
||||
$selected='';
|
||||
|
||||
echo '<OPTION value="'.$row->organisationseinheittyp_kurzbz.'" '.$selected.'>'.$row->organisationseinheittyp_kurzbz.'</OPTION>';
|
||||
}
|
||||
echo '</SELECT>';
|
||||
|
||||
echo '</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Aktiv</td><td><input type="checkbox" name="aktiv" '.($oe->aktiv?'checked':'').'></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td><td><input type="submit" name="save" value="Speichern" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
';
|
||||
}
|
||||
|
||||
//Benutzerdefiniert Sortierfunktion damit die Eintraege mit
|
||||
//Kindelementen nach oben sortiert werden
|
||||
@@ -61,26 +251,35 @@ function mysort($a, $b)
|
||||
}
|
||||
}
|
||||
|
||||
//Uebersicht anzeigen
|
||||
//Alle obersten Organisationseinheiten holen
|
||||
$oe = new organisationseinheit();
|
||||
$oe->getHeads();
|
||||
|
||||
echo "\n";
|
||||
echo '<table style="text-align: center; padding:5;" cellspacing=5 cellpadding=5><tr>';
|
||||
foreach ($oe->result as $result)
|
||||
{
|
||||
echo '<td valign="top" >';
|
||||
$arr = array();
|
||||
$arr1 = array();
|
||||
|
||||
//Array mit den Kindelementen erzeugen
|
||||
$arr = getChilds($result->oe_kurzbz);
|
||||
|
||||
//Sortieren damit die Eintraege mit Kindern weiter oben stehen
|
||||
uasort($arr,'mysort');
|
||||
|
||||
//Parent hinzufuegen
|
||||
$arr1[$result->oe_kurzbz] = $arr;
|
||||
echo "\n";
|
||||
|
||||
//Anzeigen
|
||||
displayh($arr1);
|
||||
display($arr1);
|
||||
echo '</td>';
|
||||
|
||||
}
|
||||
echo "\n";
|
||||
echo '</tr></table>';
|
||||
|
||||
//Liefert die Kindelemente einer Organisationseinheit in
|
||||
//einem verschachteltem Array zurueck
|
||||
@@ -102,40 +301,75 @@ function getChilds($foo)
|
||||
}
|
||||
|
||||
//Zeigt das Array in einer Verschachtelten Tabelle an
|
||||
function displayh($arr)
|
||||
function display($arr)
|
||||
{
|
||||
echo '<table style="text-align: left; padding:0;" cellspacing=0 cellpadding=0>';
|
||||
//Wenn eines der Element noch Unterelemente hat, dann das Array sortieren, damit
|
||||
//die Eintraege mit den Untereintraegen zuerst kommen
|
||||
$sort = false;
|
||||
foreach ($arr as $row)
|
||||
{
|
||||
if(count($row)>0)
|
||||
$sort=true;
|
||||
}
|
||||
if($sort)
|
||||
{
|
||||
uasort($arr,'mysort');
|
||||
$style='background-color: #F5F5F5;';
|
||||
}
|
||||
else
|
||||
{
|
||||
$style='background-color: #b1b1b1;';
|
||||
|
||||
}
|
||||
echo "\n ";
|
||||
echo '<table style="'.$style.'" cellspacing=0 cellpadding=5><tr>';
|
||||
$td=false;
|
||||
foreach ($arr as $key=>$val)
|
||||
{
|
||||
//wenn noch Kindelemente dranhaengen dann einen Rahmen zeichen, sonst nicht
|
||||
if(is_array($val) && count($val)>0)
|
||||
$style = 'style="border: 1px solid gray; font-weight:bold; padding-right: 10px;padding-left: 10px; margin:0;"';
|
||||
else
|
||||
$style = 'style="padding-left: 10px;padding-right: 10px;"';
|
||||
|
||||
$obj = new organisationseinheit();
|
||||
$obj->load($key);
|
||||
|
||||
|
||||
//inaktive OEs farblich markieren
|
||||
if($obj->aktiv)
|
||||
{
|
||||
echo '<tr><td valign="center" '.$style.'>';
|
||||
$aktivstyle='';
|
||||
else
|
||||
$aktivstyle='background-color: pink;';
|
||||
|
||||
echo $obj->organisationseinheittyp_kurzbz.' - ';
|
||||
if($obj->organisationseinheittyp_kurzbz=='Institut')
|
||||
echo $obj->oe_kurzbz;
|
||||
else
|
||||
echo $obj->bezeichnung;
|
||||
echo '</td>';
|
||||
$style = 'style="border: 1px solid gray; font-weight:bold; padding: 0px; margin:0;"';
|
||||
echo '<td valign="center" '.$style.'>';
|
||||
if(is_array($val) && count($val)>0)
|
||||
echo '<td valign="top"><div style="background-color: #b1b1b1; padding: 0px; margin:0px"><br><span style="font-weight: bold;">';
|
||||
else
|
||||
{
|
||||
if(!$td)
|
||||
{
|
||||
echo '<td nowrap valign="top">';
|
||||
$td=true;
|
||||
}
|
||||
else
|
||||
echo '<br>';
|
||||
}
|
||||
//echo '<span class="ui-widget-content" style=" padding: 0px; margin:0px;'.$aktivstyle.'" >';
|
||||
echo '<a href="'.$_SERVER['PHP_SELF'].'?action=edit&kurzbz='.$obj->oe_kurzbz.'" class="Item ui-widget-content" id="'.$obj->oe_kurzbz.'">';
|
||||
echo $obj->organisationseinheittyp_kurzbz.' - ';
|
||||
if($obj->organisationseinheittyp_kurzbz=='Institut')
|
||||
echo $obj->oe_kurzbz;
|
||||
else
|
||||
echo $obj->bezeichnung;
|
||||
echo '</a>';
|
||||
//echo '</span>';
|
||||
if(is_array($val) && count($val)>0)
|
||||
{
|
||||
echo '</span><br><br>';
|
||||
|
||||
if(is_array($val) && count($val)>0)
|
||||
displayh($val);
|
||||
|
||||
echo '</td></tr>';
|
||||
display($val);
|
||||
echo '</div></td>';
|
||||
}
|
||||
}
|
||||
echo '</table>';
|
||||
if($td)
|
||||
echo '</td>';
|
||||
echo "</tr>\n </table>";
|
||||
}
|
||||
echo '</body></html>';
|
||||
|
||||
echo '
|
||||
</body>
|
||||
</html>';
|
||||
?>
|
||||
Reference in New Issue
Block a user