mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
Verwaltung für Services hinzugefügt
This commit is contained in:
Executable
+255
@@ -0,0 +1,255 @@
|
||||
<?php
|
||||
/* Copyright (C) 20012 FH 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: Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
|
||||
*/
|
||||
/**
|
||||
* Klasse Service
|
||||
*
|
||||
*/
|
||||
require_once(dirname(__FILE__).'/basis_db.class.php');
|
||||
|
||||
class service extends basis_db
|
||||
{
|
||||
public $new;
|
||||
public $result = array();
|
||||
|
||||
//Tabellenspalten
|
||||
public $service_id; // bigint
|
||||
public $bezeichnung; // varchar(64)
|
||||
public $beschreibung; // text
|
||||
public $ext_id; // bigint
|
||||
public $oe_kurzbz; // varchar(32)
|
||||
|
||||
/**
|
||||
* Konstruktor - Laedt optional ein Service
|
||||
* @param $service_id
|
||||
*/
|
||||
public function __construct($service_id=null)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
if(!is_null($service_id))
|
||||
$this->load($service_id);
|
||||
}
|
||||
|
||||
/**
|
||||
* Laedt ein Service mit der uebergebenen ID
|
||||
*
|
||||
* @param $service_id
|
||||
* @return boolean
|
||||
*/
|
||||
public function load($service_id)
|
||||
{
|
||||
if(!is_numeric($service_id))
|
||||
{
|
||||
$this->errormsg = 'Service ID ist ungueltig';
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$qry = "SELECT * FROM public.tbl_service WHERE service_id=".$this->db_add_param($service_id, FHC_INTEGER);
|
||||
|
||||
if($result = $this->db_query($qry))
|
||||
{
|
||||
if($row = $this->db_fetch_object($result))
|
||||
{
|
||||
$this->service_id = $row->service_id;
|
||||
$this->bezeichnung = $row->bezeichnung;
|
||||
$this->beschreibung = $row->beschreibung;
|
||||
$this->ext_id = $row->ext_id;
|
||||
$this->oe_kurzbz = $row->oe_kurzbz;
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Service mit dieser ID exisitert nicht';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Laden des Service';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Laedt alle vorhandenen Services
|
||||
*/
|
||||
public function getAll()
|
||||
{
|
||||
$qry = "SELECT * FROM public.tbl_service ORDER BY oe_kurzbz, bezeichnung";
|
||||
|
||||
if($result = $this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object($result))
|
||||
{
|
||||
$obj = new service();
|
||||
|
||||
$obj->service_id = $row->service_id;
|
||||
$obj->bezeichnung = $row->bezeichnung;
|
||||
$obj->beschreibung = $row->beschreibung;
|
||||
$obj->ext_id = $row->ext_id;
|
||||
$obj->oe_kurzbz = $row->oe_kurzbz;
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg='Fehler beim Laden der Daten';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function getServicesOrganisationseinheit($oe_kurzbz)
|
||||
{
|
||||
$qry = 'SELECT
|
||||
*
|
||||
FROM
|
||||
public.tbl_service
|
||||
WHERE
|
||||
oe_kurzbz='.$this->db_add_param($oe_kurzbz).'
|
||||
ORDER BY bezeichnung';
|
||||
|
||||
if($result = $this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object($result))
|
||||
{
|
||||
$obj = new service();
|
||||
|
||||
$obj->service_id = $row->service_id;
|
||||
$obj->bezeichnung = $row->bezeichnung;
|
||||
$obj->beschreibung = $row->beschreibung;
|
||||
$obj->ext_id = $row->ext_id;
|
||||
$obj->oe_kurzbz = $row->oe_kurzbz;
|
||||
|
||||
$this->result[] = $obj;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg='Fehler beim Laden der Daten';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prueft die Daten vor dem Speichern
|
||||
* @return boolean
|
||||
*/
|
||||
public function validate()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Speichert ein Service
|
||||
* @param $new
|
||||
*/
|
||||
public function save($new=null)
|
||||
{
|
||||
if(is_null($new))
|
||||
$new = $this->new;
|
||||
|
||||
if(!$this->validate())
|
||||
return false;
|
||||
|
||||
if($new)
|
||||
{
|
||||
$qry = "BEGIN;INSERT INTO public.tbl_service (bezeichnung, beschreibung, ext_id, oe_kurzbz)
|
||||
VALUES(".
|
||||
$this->db_add_param($this->bezeichnung).','.
|
||||
$this->db_add_param($this->beschreibung).','.
|
||||
$this->db_add_param($this->ext_id).','.
|
||||
$this->db_add_param($this->oe_kurzbz).');';
|
||||
}
|
||||
else
|
||||
{
|
||||
$qry = 'UPDATE public.tbl_service SET'.
|
||||
' bezeichnung = '.$this->db_add_param($this->bezeichnung).','.
|
||||
' beschreibung = '.$this->db_add_param($this->beschreibung).','.
|
||||
' ext_id = '.$this->db_add_param($this->ext_id).','.
|
||||
' oe_kurzbz = '.$this->db_add_param($this->oe_kurzbz).
|
||||
' WHERE service_id='.$this->db_add_param($this->service_id, FHC_INTEGER).';';
|
||||
}
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
if($new)
|
||||
{
|
||||
$qry = "SELECT currval('public.seq_service_service_id') as id";
|
||||
if($result = $this->db_query($qry))
|
||||
{
|
||||
if($row = $this->db_fetch_object($result))
|
||||
{
|
||||
$this->service_id = $row->id;
|
||||
$this->db_query('COMMIT;');
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Auslesen der Sequence';
|
||||
$this->db_query('ROLLBACK');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Auslesen der Sequence';
|
||||
$this->db_query('ROLLBACK');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Speichern der Daten';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loescht einen Service
|
||||
|
||||
* @param $service_id
|
||||
*/
|
||||
public function delete($service_id)
|
||||
{
|
||||
if(!is_numeric($service_id))
|
||||
{
|
||||
$this->errormsg='ID ist ungueltig';
|
||||
return false;
|
||||
}
|
||||
$qry = "DELETE FROM public.tbl_service WHERE service_id=".$this->db_add_param($service_id);
|
||||
|
||||
if($this->db_query($qry))
|
||||
return true;
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler beim Loeschen des Service';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
@@ -168,6 +168,7 @@ $menu=array
|
||||
'Ampel'=>array('name'=>'Ampel', 'link'=>'stammdaten/ampel_frameset.html', 'target'=>'main','permissions'=>array('basis/ampel')),
|
||||
'Infoscreen'=>array('name'=>'Infoscreen', 'link'=>'stammdaten/infoscreen_frameset.html', 'target'=>'main','permissions'=>array('basis/infoscreen')),
|
||||
'Ferien'=>array('name'=>'Ferien', 'link'=>'lehre/ferienverwaltung.php', 'target'=>'main','permissions'=>array('admin')),
|
||||
'Service'=>array('name'=>'Service', 'link'=>'stammdaten/service_frameset.html', 'target'=>'main','permissions'=>array('basis/service')),
|
||||
'FH Ausweis'=>array
|
||||
(
|
||||
'name'=>'FH Ausweis','permissions'=>array('basis/fhausweis'),
|
||||
|
||||
+1735
-572
File diff suppressed because it is too large
Load Diff
+57
-1
@@ -3930,6 +3930,61 @@ if(!@$db->db_query("SELECT 1 FROM campus.tbl_lehre_tools LIMIT 1"))
|
||||
else
|
||||
echo 'Tabelle campus.tbl_lehre_tools und campus.tbl_lehre_tools_organisationeinheit hinzugefuegt<br>';
|
||||
}
|
||||
|
||||
// SLA Services
|
||||
if(!@$db->db_query("SELECT 1 FROM public.tbl_service LIMIT 1"))
|
||||
{
|
||||
$qry ="
|
||||
CREATE TABLE public.tbl_service
|
||||
(
|
||||
service_id bigint NOT NULL,
|
||||
bezeichnung varchar(64),
|
||||
beschreibung text,
|
||||
ext_id bigint,
|
||||
oe_kurzbz varchar(32)
|
||||
);
|
||||
|
||||
CREATE SEQUENCE public.seq_service_service_id
|
||||
INCREMENT BY 1
|
||||
NO MAXVALUE
|
||||
NO MINVALUE
|
||||
CACHE 1;
|
||||
|
||||
GRANT SELECT, UPDATE ON SEQUENCE public.seq_service_service_id TO vilesci;
|
||||
|
||||
ALTER TABLE public.tbl_service ADD CONSTRAINT pk_service PRIMARY KEY (service_id);
|
||||
ALTER TABLE public.tbl_service ALTER COLUMN service_id SET DEFAULT nextval('public.seq_service_service_id');
|
||||
ALTER TABLE public.tbl_service ADD CONSTRAINT fk_service_organisationseinheit FOREIGN KEY(oe_kurzbz) REFERENCES public.tbl_organisationseinheit (oe_kurzbz) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
GRANT SELECT ON public.tbl_service TO web;
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE ON public.tbl_service TO vilesci;
|
||||
|
||||
ALTER TABLE campus.tbl_zeitaufzeichnung ADD COLUMN oe_kurzbz_1 varchar(32);
|
||||
ALTER TABLE campus.tbl_zeitaufzeichnung ADD COLUMN oe_kurzbz_2 varchar(32);
|
||||
ALTER TABLE campus.tbl_zeitaufzeichnung ADD COLUMN ext_id bigint;
|
||||
ALTER TABLE campus.tbl_zeitaufzeichnung ADD COLUMN service_id bigint;
|
||||
ALTER TABLE campus.tbl_zeitaufzeichnung ADD COLUMN kunde_uid varchar(32);
|
||||
|
||||
ALTER TABLE campus.tbl_zeitaufzeichnung ADD CONSTRAINT fk_zeitaufzeichnung_organisationseinheit_1 FOREIGN KEY(oe_kurzbz_1) REFERENCES public.tbl_organisationseinheit (oe_kurzbz) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
ALTER TABLE campus.tbl_zeitaufzeichnung ADD CONSTRAINT fk_zeitaufzeichnung_organisationseinheit_2 FOREIGN KEY(oe_kurzbz_2) REFERENCES public.tbl_organisationseinheit (oe_kurzbz) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
ALTER TABLE campus.tbl_zeitaufzeichnung ADD CONSTRAINT fk_zeitaufzeichnung_service FOREIGN KEY(service_id) REFERENCES public.tbl_service (service_id) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
ALTER TABLE campus.tbl_zeitaufzeichnung ADD CONSTRAINT fk_zeitaufzeichnung_benutzer_kunde FOREIGN KEY(kunde_uid) REFERENCES public.tbl_benutzer (uid) ON DELETE RESTRICT ON UPDATE CASCADE;
|
||||
|
||||
ALTER TABLE campus.tbl_zeitaufzeichnung ALTER COLUMN aktivitaet_kurzbz DROP NOT NULL;
|
||||
ALTER TABLE campus.tbl_zeitaufzeichnung ALTER COLUMN projekt_kurzbz DROP NOT NULL;
|
||||
|
||||
UPDATE campus.tbl_zeitaufzeichnung SET oe_kurzbz_1 = (SELECT oe_kurzbz FROM public.tbl_studiengang WHERE studiengang_kz=tbl_zeitaufzeichnung.studiengang_kz);
|
||||
UPDATE campus.tbl_zeitaufzeichnung SET oe_kurzbz_2 = (SELECT oe_kurzbz FROM public.tbl_fachbereich WHERE fachbereich_kurzbz=tbl_zeitaufzeichnung.fachbereich_kurzbz);
|
||||
ALTER TABLE campus.tbl_zeitaufzeichnung DROP COLUMN studiengang_kz;
|
||||
ALTER TABLE campus.tbl_zeitaufzeichnung DROP COLUMN fachbereich_kurzbz;
|
||||
|
||||
";
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>public.tl_service: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo 'Tabelle public.service hinzugefuegt, campus.tbl_zeitaufzeichnung geaendert<br>';
|
||||
}
|
||||
echo '<br>';
|
||||
|
||||
$tabellen=array(
|
||||
@@ -3995,7 +4050,7 @@ $tabellen=array(
|
||||
"campus.tbl_uebung" => array("uebung_id","gewicht","punkte","angabedatei","freigabevon","freigabebis","abgabe","beispiele","statistik","bezeichnung","positiv","defaultbemerkung","lehreinheit_id","maxstd","maxbsp","liste_id","prozent","nummer","updateamum","updatevon","insertamum","insertvon"),
|
||||
"campus.tbl_veranstaltung" => array("veranstaltung_id","titel","beschreibung","veranstaltungskategorie_kurzbz","inhalt","start","ende","freigabevon","freigabeamum","updateamum","updatevon","insertamum","insertvon"),
|
||||
"campus.tbl_veranstaltungskategorie" => array("veranstaltungskategorie_kurzbz","bezeichnung","bild","farbe"),
|
||||
"campus.tbl_zeitaufzeichnung" => array("zeitaufzeichnung_id","uid","aktivitaet_kurzbz","projekt_kurzbz","start","ende","beschreibung","studiengang_kz","fachbereich_kurzbz","insertamum","insertvon","updateamum","updatevon"),
|
||||
"campus.tbl_zeitaufzeichnung" => array("zeitaufzeichnung_id","uid","aktivitaet_kurzbz","projekt_kurzbz","start","ende","beschreibung","oe_kurzbz_1","oe_kurzbz_2","insertamum","insertvon","updateamum","updatevon","ext_id","service_id","kunde_uid"),
|
||||
"campus.tbl_zeitsperre" => array("zeitsperre_id","zeitsperretyp_kurzbz","mitarbeiter_uid","bezeichnung","vondatum","vonstunde","bisdatum","bisstunde","vertretung_uid","updateamum","updatevon","insertamum","insertvon","erreichbarkeit_kurzbz","freigabeamum","freigabevon"),
|
||||
"campus.tbl_zeitsperretyp" => array("zeitsperretyp_kurzbz","beschreibung","farbe"),
|
||||
"campus.tbl_zeitwunsch" => array("stunde","mitarbeiter_uid","tag","gewicht","updateamum","updatevon","insertamum","insertvon"),
|
||||
@@ -4094,6 +4149,7 @@ $tabellen=array(
|
||||
"public.tbl_reihungstest" => array("reihungstest_id","studiengang_kz","ort_kurzbz","anmerkung","datum","uhrzeit","updateamum","updatevon","insertamum","insertvon","ext_id","freigeschaltet"),
|
||||
"public.tbl_status" => array("status_kurzbz","beschreibung","anmerkung","ext_id"),
|
||||
"public.tbl_semesterwochen" => array("semester","studiengang_kz","wochen"),
|
||||
"public.tbl_service" => array("service_id", "bezeichnung","beschreibung","ext_id","oe_kurzbz"),
|
||||
"public.tbl_sprache" => array("sprache","locale","flagge","index","content","bezeichnung"),
|
||||
"public.tbl_standort" => array("standort_id","adresse_id","kurzbz","bezeichnung","insertvon","insertamum","updatevon","updateamum","ext_id", "firma_id"),
|
||||
"public.tbl_statistik" => array("statistik_kurzbz","bezeichnung","url","r","gruppe","sql","php","content_id","insertamum","insertvon","updateamum","updatevon","berechtigung_kurzbz"),
|
||||
|
||||
Executable
+159
@@ -0,0 +1,159 @@
|
||||
<?php
|
||||
/* Copyright (C) 2012 FH 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: Andreas Oesterreicher < andreas.oesterreicher@technikum-wien.at >
|
||||
*/
|
||||
/**
|
||||
* Seite zur Wartung der Services
|
||||
*/
|
||||
require_once('../../config/vilesci.config.inc.php');
|
||||
require_once('../../include/service.class.php');
|
||||
require_once('../../include/benutzerberechtigung.class.php');
|
||||
require_once('../../include/datum.class.php');
|
||||
require_once('../../include/organisationseinheit.class.php');
|
||||
|
||||
if (!$db = new basis_db())
|
||||
die('Es konnte keine Verbindung zum Server aufgebaut werden.');
|
||||
|
||||
$user = get_uid();
|
||||
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($user);
|
||||
|
||||
if(!$rechte->isBerechtigt('basis/service'))
|
||||
die('Sie haben keine Berechtigung fuer diese Seite');
|
||||
|
||||
$datum_obj = new datum();
|
||||
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>Ampel - Details</title>
|
||||
<link rel="stylesheet" href="../../skin/fhcomplete.css" type="text/css">
|
||||
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<?php
|
||||
$action = (isset($_GET['action'])?$_GET['action']:'new');
|
||||
$service_id = (isset($_REQUEST['service_id'])?$_REQUEST['service_id']:'');
|
||||
$service = new service();
|
||||
|
||||
if($action=='save')
|
||||
{
|
||||
$bezeichnung = (isset($_POST['bezeichnung'])?$_POST['bezeichnung']:die('Bezeichnung fehlt'));
|
||||
$beschreibung = (isset($_POST['beschreibung'])?$_POST['beschreibung']:die('Beschreibung fehlt'));
|
||||
$oe_kurzbz = (isset($_POST['oe_kurzbz'])?$_POST['oe_kurzbz']:die('Organisationseinheit fehlt'));
|
||||
$ext_id = (isset($_POST['ext_id'])?$_POST['ext_id']:die('ext_id fehlt'));
|
||||
$new = (isset($_POST['new'])?$_POST['new']:'true');
|
||||
if($new=='true')
|
||||
{
|
||||
$service->new = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!$service->load($service_id))
|
||||
die($service->errormsg);
|
||||
|
||||
$service->new=false;
|
||||
}
|
||||
|
||||
$service->bezeichnung=$bezeichnung;
|
||||
$service->beschreibung = $beschreibung;
|
||||
$service->ext_id = $ext_id;
|
||||
$service->oe_kurzbz = $oe_kurzbz;
|
||||
|
||||
if($service->save())
|
||||
{
|
||||
echo '<span class="ok">Daten erfolgreich gespeichert</span>';
|
||||
echo "<script type='text/javascript'>\n";
|
||||
echo " parent.uebersicht_service.location.href='service_uebersicht.php';";
|
||||
echo "</script>\n";
|
||||
$action='update';
|
||||
$service_id = $service->service_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
$action='new';
|
||||
echo '<span class="error">'.$service->errormsg.'</span>';
|
||||
}
|
||||
}
|
||||
|
||||
echo '<fieldset>';
|
||||
switch($action)
|
||||
{
|
||||
case 'new':
|
||||
echo '<legend>Neu</legend>';
|
||||
$new = 'true';
|
||||
break;
|
||||
case 'update':
|
||||
if(!$service->load($service_id))
|
||||
die($service->errormsg);
|
||||
echo "<legend>Bearbeiten von ID $service_id</legend>";
|
||||
$new = 'false';
|
||||
break;
|
||||
default:
|
||||
die('Invalid Action');
|
||||
break;
|
||||
}
|
||||
|
||||
echo '<form action="'.$_SERVER['PHP_SELF'].'?action=save" method="POST">';
|
||||
echo '<input type="hidden" name="new" value="'.htmlspecialchars($new).'">';
|
||||
echo '<input type="hidden" name="service_id" value="'.htmlspecialchars($service->service_id).'">';
|
||||
echo '<table>';
|
||||
echo '<tr>';
|
||||
echo ' <td>Organisationseinheit </td>';
|
||||
echo ' <td>';
|
||||
echo '<SELECT name="oe_kurzbz">';
|
||||
$oe = new organisationseinheit();
|
||||
$oe->getAll();
|
||||
foreach($oe->result as $row)
|
||||
{
|
||||
if($row->oe_kurzbz==$service->oe_kurzbz)
|
||||
$selected='selected';
|
||||
else
|
||||
$selected='';
|
||||
|
||||
echo '<OPTION value="'.$row->oe_kurzbz.'" '.$selected.'>'.$row->organisationseinheittyp_kurzbz.' '.$row->bezeichnung.'</OPTION>';
|
||||
}
|
||||
|
||||
echo '</SELECT>';
|
||||
echo ' </td>';
|
||||
echo '</tr>';
|
||||
echo '<tr>';
|
||||
echo ' <td>Bezeichnung</td>';
|
||||
echo ' <td><input type="text" name="bezeichnung" size="30" maxlength="64" value="'.htmlspecialchars($service->bezeichnung).'"></td>';
|
||||
echo '</tr>';
|
||||
echo '<tr valign="top">';
|
||||
echo ' <td>Beschreibung</td>';
|
||||
echo ' <td><textarea name="beschreibung" cols="60" rows="5">'.htmlspecialchars($service->beschreibung).'</textarea></td>';
|
||||
echo '</tr>';
|
||||
echo '<tr valign="top">';
|
||||
echo ' <td>Externe ID</td>';
|
||||
echo ' <td><input type="text" name="ext_id" size="4" maxlength="10" value="'.htmlspecialchars($service->ext_id).'"></td>';
|
||||
echo '</tr>';
|
||||
echo '<tr><td></td><td> </td></tr>';
|
||||
echo '<tr valign="bottom">';
|
||||
echo ' <td></td>';
|
||||
echo ' <td><input type="submit" value="Speichern" name="save"></td>';
|
||||
echo '</table>';
|
||||
echo '</form>';
|
||||
|
||||
echo '</fieldset>';
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
<!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=UTF-8" />
|
||||
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css" />
|
||||
</head>
|
||||
|
||||
<frameset rows="50%,*">
|
||||
<frame src="service_uebersicht.php" name="uebersicht_service" frameborder="0" />
|
||||
<frame src="service_details.php" name="detail_service" frameborder="0" />
|
||||
<noframes>
|
||||
<body bgcolor="#FFFFFF">
|
||||
This application works only with a frames-enabled browser.<br />
|
||||
</body>
|
||||
</noframes>
|
||||
</frameset>
|
||||
|
||||
</html>
|
||||
Executable
+143
@@ -0,0 +1,143 @@
|
||||
<?php
|
||||
/* Copyright (C) 2012 FH 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: Andreas Oesterreicher < andreas.oesterreicher@technikum-wien.at >
|
||||
*/
|
||||
require_once('../../config/vilesci.config.inc.php');
|
||||
require_once('../../include/service.class.php');
|
||||
require_once('../../include/benutzerberechtigung.class.php');
|
||||
require_once('../../include/datum.class.php');
|
||||
|
||||
$user = get_uid();
|
||||
|
||||
$rechte = new benutzerberechtigung();
|
||||
$rechte->getBerechtigungen($user);
|
||||
|
||||
if(!$rechte->isBerechtigt('basis/service'))
|
||||
die('Sie haben keine Berechtigung fuer diese Seite');
|
||||
|
||||
$datum_obj = new datum();
|
||||
|
||||
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>Service</title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
|
||||
<link rel="stylesheet" href="../../skin/tablesort.css" type="text/css"/>
|
||||
<link rel="stylesheet" href="../../skin/fhcomplete.css" type="text/css">
|
||||
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css">
|
||||
<script type="text/javascript" src="../../include/js/jquery.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function()
|
||||
{
|
||||
$("#myTable").tablesorter(
|
||||
{
|
||||
sortList: [[2,0]],
|
||||
widgets: [\'zebra\']
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
function confdel()
|
||||
{
|
||||
return confirm("Wollen Sie diesen Eintrag wirklich löschen?");
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<h2>Service Übersicht</h2>
|
||||
<div style="text-align:right">
|
||||
<a href="service_details.php?action=new" target="detail_service">Neu</a>
|
||||
</div>';
|
||||
if(isset($_GET['action']) && $_GET['action']=='delete')
|
||||
{
|
||||
if(!$rechte->isBerechtigt('basis/service', null, 'suid'))
|
||||
die('Sie haben keine Berechtigung fuer diese Seite');
|
||||
|
||||
if(!isset($_GET['service_id']))
|
||||
die('Fehlender Parameter ServiceID');
|
||||
|
||||
$service = new service();
|
||||
if($service->delete($_GET['service_id']))
|
||||
echo '<span class="ok">Eintrag wurde erfolgreich gelöscht</span>';
|
||||
else
|
||||
echo '<span class="error">'.$serivce->errormsg.'</span>';
|
||||
}
|
||||
|
||||
$oe_kurzbz = (isset($_GET['oe_kurzbz'])?$_GET['oe_kurzbz']:'');
|
||||
|
||||
$service = new service();
|
||||
echo '<form action="'.$_SERVER['PHP_SELF'].'" method="GET">';
|
||||
echo 'Organisationseinheit: ';
|
||||
echo '<SELECT name="oe_kurzbz">
|
||||
<OPTION value="">-- Alle --</OPTION>';
|
||||
|
||||
$oe = new organisationseinheit();
|
||||
$oe->getAll();
|
||||
foreach($oe->result as $row)
|
||||
{
|
||||
if($row->oe_kurzbz==$oe_kurzbz)
|
||||
$selected='selected';
|
||||
else
|
||||
$selected='';
|
||||
|
||||
echo '<OPTION value="'.$row->oe_kurzbz.'" '.$selected.'>'.$row->organisationseinheittyp_kurzbz.' '.$row->bezeichnung.'</OPTION>';
|
||||
}
|
||||
echo '</SELECT>
|
||||
<input type="submit" value="Filtern" />
|
||||
</form>';
|
||||
|
||||
if($oe_kurzbz!='')
|
||||
{
|
||||
if(!$service->getServicesOrganisationseinheit($oe_kurzbz))
|
||||
die($service->errormsg);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!$service->getAll())
|
||||
die($service->errormsg);
|
||||
}
|
||||
echo '<table class="tablesorter" id="myTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Bezeichnung</th>
|
||||
<th>Beschreibung</th>
|
||||
<th>Organisationseinheit</th>
|
||||
<th colspan="3">Aktion</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>';
|
||||
|
||||
foreach($service->result as $row)
|
||||
{
|
||||
echo '<tr>';
|
||||
echo '<td><a href="service_details.php?action=update&service_id=',$row->service_id,' " target="detail_service">',$row->service_id,'</a></td>';
|
||||
echo '<td>',$row->bezeichnung,'</td>';
|
||||
echo '<td>',$row->beschreibung,'</td>';
|
||||
echo '<td>',$row->oe_kurzbz,'</td>';
|
||||
echo '<td><a href="service_details.php?action=update&service_id=',$row->service_id,' " target="detail_service">bearbeiten</a></td>';
|
||||
echo '<td><a href="service_uebersicht.php?action=delete&service_id=',$row->service_id,' " onclick="return confdel()">entfernen</a></td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
echo '</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>';
|
||||
?>
|
||||
Reference in New Issue
Block a user