mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-23 09:52:22 +00:00
Erweiterungen für UnDo
This commit is contained in:
@@ -39,6 +39,7 @@ require_once('../include/lehreinheit.class.php');
|
||||
require_once('../include/lehreinheitmitarbeiter.class.php');
|
||||
require_once('../include/lehreinheitgruppe.class.php');
|
||||
require_once('../include/benutzerberechtigung.class.php');
|
||||
require_once('../include/log.class.php');
|
||||
|
||||
$user = get_uid();
|
||||
|
||||
|
||||
@@ -352,7 +352,7 @@ echo "<?xml-stylesheet href=\"".APP_ROOT."content/lehrveranstaltung.css\" type=\
|
||||
</row>
|
||||
<row>
|
||||
<label control="lehrveranstaltung-lehreinheitmitarbeiter-textbox-anmerkung" value="Anmerkung: "/>
|
||||
<textbox id="lehrveranstaltung-lehreinheitmitarbeiter-textbox-anmerkung" disabled="true" maxlength="256" flex="1" oncommand="LeMitarbeiterValueChanged();"/>
|
||||
<textbox id="lehrveranstaltung-lehreinheitmitarbeiter-textbox-anmerkung" disabled="true" maxlength="256" flex="1" oninput="LeMitarbeiterValueChanged();"/>
|
||||
<label control="lehrveranstaltung-lehreinheitmitarbeiter-checkbox-bismelden" value="BIS-Melden: "/>
|
||||
<checkbox id="lehrveranstaltung-lehreinheitmitarbeiter-checkbox-bismelden" disabled="true" flex="1" oncommand="LeMitarbeiterValueChanged();"/>
|
||||
</row>
|
||||
|
||||
@@ -98,3 +98,37 @@ function studiensemesterChange()
|
||||
return true;
|
||||
}
|
||||
|
||||
function loadUndoList()
|
||||
{
|
||||
menu = document.getElementById('menu-edit-undo');
|
||||
|
||||
var url = '<?php echo APP_ROOT; ?>rdf/undo.rdf.php?'+gettimestamp();
|
||||
menu.setAttribute('datasources', url);
|
||||
debug('load:'+url);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function UnDo(log_id, bezeichnung)
|
||||
{
|
||||
if(confirm('Wollen Sie folgenden Befehl wirklich Rueckgaengig machen: '+bezeichnung))
|
||||
{
|
||||
//Request absetzen
|
||||
var req = new phpRequest('tempusDBDML.php','','');
|
||||
|
||||
req.add('type','undo');
|
||||
req.add('log_id',log_id);
|
||||
|
||||
var response = req.executePOST();
|
||||
var val = new ParseReturnValue(response)
|
||||
|
||||
if (!val.dbdml_return)
|
||||
{
|
||||
alert(val.dbdml_errormsg)
|
||||
}
|
||||
else
|
||||
{
|
||||
LvTreeRefresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
+19
-2
@@ -61,7 +61,7 @@ echo '<?xul-overlay href="'.APP_ROOT.'content/tempusoverlay.xul.php"?>';
|
||||
</keyset>
|
||||
|
||||
<toolbox id="main-toolbox">
|
||||
<menubar id="menu">
|
||||
<menubar id="menu" >
|
||||
<menu id="menu-file" label="&menu-file:label;" accesskey="&menu-file:accesskey;">
|
||||
<menupopup id="menu-file-popup">
|
||||
<menuitem
|
||||
@@ -72,6 +72,24 @@ echo '<?xul-overlay href="'.APP_ROOT.'content/tempusoverlay.xul.php"?>';
|
||||
accesskey = "&menu-file-close:accesskey;"/>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menu id="menu-edit" label="&menu-edit:label;" accesskey="&menu-edit:accesskey;" onclick="loadUndoList();">
|
||||
<menupopup id="menu-edit-popup" onpopupshowing="debug('wooosaar');">
|
||||
<menu id="menu-edit-undo" label="&menu-edit-undo:label;"
|
||||
datasources="rdf:null"
|
||||
ref="http://www.technikum-wien.at/undo/liste"
|
||||
>
|
||||
<template>
|
||||
<rule>
|
||||
<menupopup>
|
||||
<menuitem uri="rdf:*" label="rdf:http://www.technikum-wien.at/undo/rdf#beschreibung"
|
||||
value="rdf:http://www.technikum-wien.at/undo/rdf#log_id"
|
||||
onclick="UnDo(this.value, this.label);"/>
|
||||
</menupopup>
|
||||
</rule>
|
||||
</template>
|
||||
</menu>
|
||||
</menupopup>
|
||||
</menu>
|
||||
<menu id="menu-prefs" label="&menu-prefs:label;" accesskey="&menu-prefs:accesskey;">
|
||||
<menupopup id="menu-prefs-popup">
|
||||
<menu id="menu-prefs-stpltable" label="&menu-prefs-stpltable:label;" accesskey="&menu-prefs-stpltable:accesskey;">
|
||||
@@ -126,7 +144,6 @@ echo '<?xul-overlay href="'.APP_ROOT.'content/tempusoverlay.xul.php"?>';
|
||||
</menu>
|
||||
</menubar>
|
||||
</toolbox>
|
||||
|
||||
<hbox flex="1">
|
||||
<tabbox id="tabbox-left" orient="vertical" flex="1">
|
||||
<tabs orient="horizontal">
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
<?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>.
|
||||
*/
|
||||
|
||||
// ****************************************
|
||||
// * Insert/Update/Delete
|
||||
// * der Lehreinheiten
|
||||
// *
|
||||
// * Script sorgt fuer den Datenbanzugriff
|
||||
// * fuer das XUL - Lehreinheiten-Modul
|
||||
// *
|
||||
// * Derzeitige Funktionen:
|
||||
// * - Lehreinheitmitarbeiter Zuteilung hinzufuegen/bearbeiten/loeschen
|
||||
// * - Lehreinheitgruppe Zutelung hinzufuegen/loeschen
|
||||
// * - Lehreinheit anlegen/bearbeiten/loeschen
|
||||
// ****************************************
|
||||
|
||||
require_once('../vilesci/config.inc.php');
|
||||
require_once('../include/functions.inc.php');
|
||||
require_once('../include/benutzerberechtigung.class.php');
|
||||
require_once('../include/log.class.php');
|
||||
|
||||
$user = get_uid();
|
||||
|
||||
error_reporting(0);
|
||||
|
||||
// Datenbank Verbindung
|
||||
if (!$conn = @pg_pconnect(CONN_STRING))
|
||||
$error_msg='Es konnte keine Verbindung zum Server aufgebaut werden!';
|
||||
|
||||
$return = false;
|
||||
$errormsg = 'unknown';
|
||||
$data = '';
|
||||
$error = false;
|
||||
|
||||
//Berechtigungen laden
|
||||
$rechte = new benutzerberechtigung($conn);
|
||||
$rechte->getBerechtigungen($user);
|
||||
if(!$rechte->isBerechtigt('admin'))
|
||||
{
|
||||
$return = false;
|
||||
$errormsg = 'Keine Berechtigung';
|
||||
$data = '';
|
||||
$error = true;
|
||||
}
|
||||
|
||||
if(!$error)
|
||||
{
|
||||
if(isset($_POST['type']) && $_POST['type']=='undo')
|
||||
{
|
||||
//UNDO Befehl ausfuehren
|
||||
|
||||
if (!isset($_POST['log_id']))
|
||||
{
|
||||
$return = false;
|
||||
$errormsg = 'Fehlerhafte Parameteruebergabe';
|
||||
$data = '';
|
||||
$error = true;
|
||||
}
|
||||
|
||||
if(!$error)
|
||||
{
|
||||
$log = new log($conn, null, null, true);
|
||||
|
||||
if($log->undo($log_id))
|
||||
{
|
||||
$return = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$return = false;
|
||||
$errormsg = 'Fehler bei UnDo:'.$log->errormsg;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$return = false;
|
||||
$errormsg = 'Unkown type';
|
||||
$data = '';
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<RDF:RDF
|
||||
xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:NC="http://home.netscape.com/NC-rdf#"
|
||||
xmlns:DBDML="http://www.technikum-wien.at/dbdml/rdf#"
|
||||
>
|
||||
<RDF:Seq RDF:about="http://www.technikum-wien.at/dbdml/msg">
|
||||
<RDF:li>
|
||||
<RDF:Description RDF:about="http://www.technikum-wien.at/dbdml/0" >
|
||||
<DBDML:return><?php echo ($return?'true':'false'); ?></DBDML:return>
|
||||
<DBDML:errormsg><![CDATA[<?php echo $errormsg; ?>]]></DBDML:errormsg>
|
||||
<DBDML:data><![CDATA[<?php echo $data ?>]]></DBDML:data>
|
||||
</RDF:Description>
|
||||
</RDF:li>
|
||||
</RDF:Seq>
|
||||
</RDF:RDF>
|
||||
@@ -19,6 +19,8 @@ function onVerbandSelect()
|
||||
{
|
||||
var contentFrame=document.getElementById('iframeTimeTableWeek');
|
||||
var tree=document.getElementById('tree-verband');
|
||||
if(tree.currentIndex==-1)
|
||||
return;
|
||||
var stg_kz=tree.view.getCellText(tree.currentIndex,"stg_kz");
|
||||
var sem=tree.view.getCellText(tree.currentIndex,"sem");
|
||||
var ver=tree.view.getCellText(tree.currentIndex,"ver");
|
||||
|
||||
@@ -25,7 +25,7 @@ echo '<?xul-overlay href="'.APP_ROOT.'content/stpl-semester-overlay.xul.php"?>';
|
||||
<script type="application/x-javascript" src="<?php echo APP_ROOT; ?>content/DragAndDrop.js"/>
|
||||
<script type="application/x-javascript" src="<?php echo APP_ROOT; ?>content/dragboard.js.php"/>
|
||||
|
||||
<tree id="tree-verband" onselect="onVerbandSelect();"
|
||||
<tree id="tree-verband" onmouseup="onVerbandSelect();"
|
||||
seltype="single" hidecolumnpicker="false" flex="1"
|
||||
enableColumnDrag="true"
|
||||
ondraggesture="nsDragAndDrop.startDrag(event,lvbgrpDDObserver);"
|
||||
|
||||
Reference in New Issue
Block a user