diff --git a/application/controllers/system/TestUDF.php b/application/controllers/system/UDF.php
similarity index 65%
rename from application/controllers/system/TestUDF.php
rename to application/controllers/system/UDF.php
index 19a01c8cc..c3170d6aa 100644
--- a/application/controllers/system/TestUDF.php
+++ b/application/controllers/system/UDF.php
@@ -2,7 +2,7 @@
if (! defined('BASEPATH')) exit('No direct script access allowed');
-class TestUDF extends VileSci_Controller
+class UDF extends VileSci_Controller
{
public function __construct()
{
@@ -24,10 +24,16 @@ class TestUDF extends VileSci_Controller
$person = $this->PersonModel->load($person_id);
+ $udfs = $this->PersonModel->getUDFs();
+
+ $udfs['person_id'] = 1;
+ $udfs['prestudent_id'] = 1;
+ $udfs['caller'] = 'system/UDF?person_id=1';
+
$data = array(
- 'udfs' => $this->PersonModel->getUDFs()
+ 'udfs' => $udfs
);
- $this->load->view('system/testudf', $data);
+ $this->load->view('system/udf', $data);
}
}
\ No newline at end of file
diff --git a/application/views/system/testudf.php b/application/views/system/testudf.php
deleted file mode 100644
index 1d3c50f77..000000000
--- a/application/views/system/testudf.php
+++ /dev/null
@@ -1,40 +0,0 @@
-load->view("templates/header", array("title" => "UDF")); ?>
-
-
-
-
- widgetlib->UDFWidget(
- array(
- UDFWidgetTpl::SCHEMA_ARG_NAME => 'public',
- UDFWidgetTpl::TABLE_ARG_NAME => 'tbl_person',
- UDFWidgetTpl::FIELD_ARG_NAME => 'udf_schuhgroesse',
- DropdownWidget::SELECTED_ELEMENT => $udfs['udf_schuhgroesse']
- ),
- array('name' => 'schuhgroesseName', 'id' => 'schuhgroesseId')
- );
- ?>
-
-
-
-
-
-
-
-
-
-
- widgetlib->UDFWidget(
- array(
- UDFWidgetTpl::SCHEMA_ARG_NAME => 'public',
- UDFWidgetTpl::TABLE_ARG_NAME => 'tbl_person',
- UDFWidgetTpl::UDFS_ARG_NAME => $udfs
- )
- );
- ?>
-
-
-
-
-load->view("templates/footer"); ?>
\ No newline at end of file
diff --git a/application/views/system/udf.php b/application/views/system/udf.php
new file mode 100644
index 000000000..89ea770bb
--- /dev/null
+++ b/application/views/system/udf.php
@@ -0,0 +1,30 @@
+load->view("templates/header", array("title" => "UDF")); ?>
+
+
+
+
+
+
+
+load->view("templates/footer"); ?>
\ No newline at end of file
diff --git a/config/global.config-default.inc.php b/config/global.config-default.inc.php
index ba24752e3..87e51a74a 100644
--- a/config/global.config-default.inc.php
+++ b/config/global.config-default.inc.php
@@ -99,6 +99,9 @@ define('FAS_REIHUNGSTEST_PUNKTE', false);
// Legt fest ob Messages im FAS angezeigt werden true|false
define('FAS_MESSAGES',false);
+// Enable (true) or disable (false) the UDF tab
+define('FAS_UDF', true);
+
// Legt fest ob Aufnahmegruppen bei Reihungstests verwaltet werden true|false
define('FAS_REIHUNGSTEST_AUFNAHMEGRUPPEN',false);
diff --git a/content/student/studentenoverlay.xul.php b/content/student/studentenoverlay.xul.php
index 0ef95958e..ac7ed0cfa 100644
--- a/content/student/studentenoverlay.xul.php
+++ b/content/student/studentenoverlay.xul.php
@@ -484,6 +484,11 @@ else
if(!defined('FAS_MESSAGES') || FAS_MESSAGES==true)
echo '';
?>
+
+ ';
+ ?>
@@ -516,9 +521,13 @@ else
?>
';
+ if(!defined('FAS_MESSAGES') || FAS_MESSAGES==true)
+ echo '';
+
+ if(!defined('FAS_UDF') || FAS_UDF==true)
+ echo '';
?>
+
diff --git a/content/student/studentoverlay.js.php b/content/student/studentoverlay.js.php
index 43da64aa8..6ce82f4ed 100644
--- a/content/student/studentoverlay.js.php
+++ b/content/student/studentoverlay.js.php
@@ -5432,6 +5432,27 @@ function StudentMessagesIFrameLoad()
}
}
+// ****
+// * Load UDF IFrame
+// ****
+function StudentUDFIFrameLoad()
+{
+ var tree = document.getElementById('student-tree');
+
+ if (tree.currentIndex == -1) return;
+
+ try
+ {
+ //Ausgewaehlte person_id holen
+ var person_id = getTreeCellText(tree, 'student-treecol-person_id', tree.currentIndex);
+ var prestudent_id = getTreeCellText(tree, 'student-treecol-prestudent_id', tree.currentIndex);
+
+ url = 'udf.xul.php?person_id='+person_id+'&prestudent_id='+prestudent_id;
+ document.getElementById('student-udf').setAttribute('src', url);
+ }
+ catch(e) {}
+}
+
// ****
// * Laedt den Anwesenheit IFrame
// ****
diff --git a/content/udf.js.php b/content/udf.js.php
new file mode 100644
index 000000000..53ff71096
--- /dev/null
+++ b/content/udf.js.php
@@ -0,0 +1,67 @@
+
+ */
+require_once('../config/vilesci.config.inc.php');
+?>
+// ********** FUNKTIONEN ********** //
+var UDFPersonID = null;
+var UDFTreeDatasource = ''; // Datasource des Adressen Trees
+var UDFSelectID = '';
+var UDFIFrameIsInitialized = false;
+
+var UDFTreeSinkObserver =
+{
+ onBeginLoad : function(pSink) {},
+ onInterrupt : function(pSink) {},
+ onResume : function(pSink) {},
+ onError : function(pSink, pStatus, pError) {},
+ onEndLoad : function(pSink)
+ {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ }
+};
+
+var UDFTreeListener =
+{
+ willRebuild : function(builder) { },
+ didRebuild : function(builder)
+ {
+ //timeout nur bei Mozilla notwendig da sonst die rows
+ //noch keine values haben. Ab Seamonkey funktionierts auch
+ //ohne dem setTimeout
+ //window.setTimeout(KontaktAdressenTreeSelectID,10);
+ }
+};
+
+// ****
+// * Laedt die Trees
+// ****
+function loadUDF(person_id, prestudent_id)
+{
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+
+ var udfIFrame = document.getElementById('udfIFrame');
+
+ alert(udfIFrame.src);
+
+ if (udfIFrame != null)
+ {
+ udfIFrame.src = '/core/index.ci.php/system/UDF?person_id=' + person_id + '&prestudent_id' + prestudent_id;
+ }
+}
\ No newline at end of file
diff --git a/content/udf.xul.php b/content/udf.xul.php
new file mode 100644
index 000000000..a6cc806b9
--- /dev/null
+++ b/content/udf.xul.php
@@ -0,0 +1,72 @@
+
+ */
+header("Cache-Control: no-cache");
+header("Cache-Control: post-check=0, pre-check=0",false);
+header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
+header("Pragma: no-cache");
+header("Content-type: application/vnd.mozilla.xul+xml");
+
+require_once('../config/vilesci.config.inc.php');
+require_once('../include/functions.inc.php');
+require_once('../include/variable.class.php');
+require_once('../include/benutzer.class.php');
+
+$user=get_uid();
+$variable = new variable();
+if(!$variable->loadVariables($user))
+{
+ die('Fehler beim Laden der Variablen:'.$variable->errormsg);
+}
+
+$benutzer = new benutzer();
+$benutzer->load($user);
+
+echo ''."\n";
+
+echo '';
+echo '';
+echo '';
+
+$person_id = filter_input(INPUT_GET, 'person_id');
+$prestudent_id= filter_input(INPUT_GET, 'prestudent_id');
+
+echo '
+variable->locale.'/fas.dtd');
+echo ']>
+';
+?>
+
+);"
+ >
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file