From 74d2e51da636f8ec981a0b004efb7e1f04b08e08 Mon Sep 17 00:00:00 2001
From: Björn Geiger
Date: Fri, 19 Aug 2011 00:45:34 +0200
Subject: verschiedene Datenbankänderungen

---
 setup/poolctrl.sql | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

(limited to 'setup/poolctrl.sql')

diff --git a/setup/poolctrl.sql b/setup/poolctrl.sql
index e1badbd..96db9d7 100644
--- a/setup/poolctrl.sql
+++ b/setup/poolctrl.sql
@@ -10,6 +10,7 @@ CREATE TABLE IF NOT EXISTS `poolctrl_event` (
   `start` timestamp COLLATE utf8_unicode_ci NOT NULL DEFAULT CURRENT_TIMESTAMP(),
   `end` timestamp COLLATE utf8_unicode_ci NULL,
   `participants` int(4) NOT NULL DEFAULT 50 CHECK (participants > 0),
+  `note` varchar(140) COLLATE utf8_unicode_ci DEFAULT NULL,
   `category` int(11) NOT NULL,
   `pbs_poolID` int(11) NOT NULL,
   `pbs_membershipID` int(11) NOT NULL,
@@ -18,7 +19,7 @@ CREATE TABLE IF NOT EXISTS `poolctrl_event` (
   `pbs_filterID` int(11) NOT NULL,
   `repeat` bool NOT NULL DEFAULT false,
   `immediate` bool NOT NULL DEFAULT false,
-  `note` varchar(140) COLLATE utf8_unicode_ci DEFAULT NULL,
+  `running` bool NOT NULL DEFAULT false,
   PRIMARY KEY (`eventID`),
   KEY `pbs_poolID` (`pbs_poolID`),
   KEY `pbs_membershipID` (`pbs_membershipID`),
@@ -28,22 +29,29 @@ CREATE TABLE IF NOT EXISTS `poolctrl_event` (
   KEY `category` (`category`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
 
+CREATE TABLE IF NOT EXISTS `poolctrl_eventcategory` (
+  `eventcategoryID` int(11) NOT NULL AUTO_INCREMENT,
+  `title` varchar(30) COLLATE utf8_unicode_ci NOT NULL UNIQUE,
+  PRIMARY KEY (`eventcategoryID`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
+
 CREATE TABLE IF NOT EXISTS `poolctrl_eventreport` (
   `reportID` int(11) NOT NULL AUTO_INCREMENT,
   `report` varchar(140) COLLATE utf8_unicode_ci DEFAULT 'success',
+  `type` int(11) NOT NULL,
   `eventID` int(11) NOT NULL,
   `timestamp` timestamp COLLATE utf8_unicode_ci NOT NULL DEFAULT CURRENT_TIMESTAMP(),
   PRIMARY KEY (`reportID`),
-  KEY `eventID` (`eventID`)
+  KEY `eventID` (`eventID`),
+  KEY `type` (`type`)
 ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
 
-CREATE TABLE IF NOT EXISTS `poolctrl_eventcategory` (
-  `eventcategoryID` int(11) NOT NULL AUTO_INCREMENT,
+CREATE TABLE IF NOT EXISTS `poolctrl_reporttype` (
+  `reporttypeID` int(11) NOT NULL AUTO_INCREMENT,
   `title` varchar(30) COLLATE utf8_unicode_ci NOT NULL UNIQUE,
-  PRIMARY KEY (`eventcategoryID`)
+  PRIMARY KEY (`reporttypeID`)
 ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
 
-
 -- PBS2 Tabellen
 -- TO DO: Tabellen an dieser Stelle nicht per Hand erzeugen sondern von der PBS2-Datenbank kopieren, sodass diese auf dem neusten Stand sind
 CREATE TABLE IF NOT EXISTS `pbs_bootos` (
@@ -177,7 +185,8 @@ ALTER TABLE `pbs_membership`
   ADD CONSTRAINT `pbs_membership_ibfk_2` FOREIGN KEY (`personID`) REFERENCES `pbs_person` (`personID`) ON DELETE CASCADE;
 
 ALTER TABLE `poolctrl_eventreport`
-  ADD CONSTRAINT `pbs_eventreport_eventidC` FOREIGN KEY (`eventID`) REFERENCES `poolctrl_event` (`eventID`) ON DELETE CASCADE;
+  ADD CONSTRAINT `pbs_eventreport_eventidC` FOREIGN KEY (`eventID`) REFERENCES `poolctrl_event` (`eventID`) ON DELETE CASCADE,
+  ADD CONSTRAINT `pbs_eventreport_typeidC` FOREIGN KEY (`type`) REFERENCES `poolctrl_reporttype` (`reporttypeID`) ON DELETE CASCADE;
 
 ALTER TABLE `poolctrl_event`
   ADD CONSTRAINT `poolctrl_event_poolidC` FOREIGN KEY (`pbs_poolID`) REFERENCES `pbs_pool` (`poolID`) ON DELETE CASCADE,
-- 
cgit v1.2.3-55-g7522


From 0c8e8ce07644347babcd1f4991e70c24f56446ba Mon Sep 17 00:00:00 2001
From: Björn Geiger
Date: Fri, 19 Aug 2011 11:36:38 +0200
Subject: verschiedene Korrekturen und Datenbankänderung

---
 application/configs/application.ini.dist      |  5 ++---
 application/controllers/GearmanController.php |  2 +-
 application/models/Event.php                  | 12 ++++++++++++
 application/models/EventMapper.php            |  8 +++++---
 setup/poolctrl.sql                            |  1 +
 5 files changed, 21 insertions(+), 7 deletions(-)

(limited to 'setup/poolctrl.sql')

diff --git a/application/configs/application.ini.dist b/application/configs/application.ini.dist
index 123c33f..6176733 100644
--- a/application/configs/application.ini.dist
+++ b/application/configs/application.ini.dist
@@ -16,6 +16,8 @@ resources.db.isDefaultTableAdapter = true
 resources.db.params.driver_options.1002 = "SET NAMES UTF8;"
 resources.view[] = ""
 resources.modules = ""
+resources.layout.layout = "default"
+resources.layout.layoutPath = APPLICATION_PATH "/layouts"
 pbs2.host = 
 pbs2.login = /resource/login/
 pbs2.checkright = /resource/checkright/apikey
@@ -34,9 +36,6 @@ gearman.server.host =
 gearman.server.port = 
 gearman.worker.waitTime = 120
 gearman.worker.updateRate = 1
-
-resources.layout.layout = "default"
-resources.layout.layoutPath = APPLICATION_PATH "/layouts"
  
 [staging : production]
 
diff --git a/application/controllers/GearmanController.php b/application/controllers/GearmanController.php
index 8167275..a0de744 100644
--- a/application/controllers/GearmanController.php
+++ b/application/controllers/GearmanController.php
@@ -2,11 +2,11 @@
 
 class GearmanController extends Zend_Controller_Action
 {
-	protected $gearmanClient;
 	protected $config;
 	protected $pbs2host;
 	protected $userIDsNamespace;
 	protected $acl;
+	protected $gearmanClient;
 	protected $gearmanServerHost;
 	protected $gearmanServerPort;
 	protected $gearmanWorkerUpdateRate;
diff --git a/application/models/Event.php b/application/models/Event.php
index 33a470e..7554442 100644
--- a/application/models/Event.php
+++ b/application/models/Event.php
@@ -27,6 +27,7 @@ class Application_Model_Event
 	protected $_repeat;
 	protected $_immediate;
 	protected $_running;
+	protected $_runningType;
 	protected $_note;
 
 	public function __construct(array $options = null)
@@ -276,5 +277,16 @@ class Application_Model_Event
 		$this->_running = $_running;
 		return $this;
 	}
+
+	public function getRunningType()
+	{
+		return $this->_runningType;
+	}
+
+	public function setRunningType($_runningType)
+	{
+		$this->_runningType = $_runningType;
+		return $this;
+	}
 }
 
diff --git a/application/models/EventMapper.php b/application/models/EventMapper.php
index a2648a0..f700b39 100644
--- a/application/models/EventMapper.php
+++ b/application/models/EventMapper.php
@@ -85,7 +85,7 @@ class Application_Model_EventMapper
 
 	public function save(Application_Model_Event $event)
 	{
-		$data = array('eventID'=> $event->getID() ,'category'=> $event->getCategory() ,'title'=> $event->getTitle(), 'pbs_membershipID'=> $event->getPbs_membershipID(),'end'=> $event->getEnd() ,'immediate'=> $event->getImmediate() ,'note'=> $event->getNote() ,'participants'=> $event->getParticipants() ,'pbs_bootosID'=> $event->getPbs_bootosID(),'pbs_poolID'=> $event->getPbs_poolID(),'repeat'=> $event->getRepeat(),'start'=> $event->getStart(),'pbs_bootmenuID'=> $event->getPbs_bootmenuID(),'pbs_filterID'=> $event->getPbs_filterID(), 'running' => $event->getRunning() );
+		$data = array('eventID'=> $event->getID() ,'category'=> $event->getCategory() ,'title'=> $event->getTitle(), 'pbs_membershipID'=> $event->getPbs_membershipID(),'end'=> $event->getEnd() ,'immediate'=> $event->getImmediate() ,'note'=> $event->getNote() ,'participants'=> $event->getParticipants() ,'pbs_bootosID'=> $event->getPbs_bootosID(),'pbs_poolID'=> $event->getPbs_poolID(),'repeat'=> $event->getRepeat(),'start'=> $event->getStart(),'pbs_bootmenuID'=> $event->getPbs_bootmenuID(),'pbs_filterID'=> $event->getPbs_filterID(), 'running' => $event->getRunning(), 'runningType' => $event->getRunningType() );
 		if (null === ($id = $event->getID()) ) {
 			unset($data['eventID']);
 			return $this->getDbTable()->insert($data);
@@ -131,7 +131,8 @@ class Application_Model_EventMapper
 		->setPbs_bootmenuID($row->pbs_bootmenuID)
 		->setRepeat($row->repeat)
 		->setStart($row->start)
-		->setRunning($row->running);
+		->setRunning($row->running)
+		->setRunningType($row->runningType);
 	}
 
 	public function fetchAll()
@@ -157,7 +158,8 @@ class Application_Model_EventMapper
 			->setPbs_bootmenuID($row->pbs_bootmenuID)
 			->setRepeat($row->repeat)
 			->setStart($row->start)
-			->setRunning($row->running);
+			->setRunning($row->running)
+			->setRunningType($row->runningType);
 
 			$entries[$row->eventID] = $entry;
 		}
diff --git a/setup/poolctrl.sql b/setup/poolctrl.sql
index 96db9d7..8c11f06 100644
--- a/setup/poolctrl.sql
+++ b/setup/poolctrl.sql
@@ -20,6 +20,7 @@ CREATE TABLE IF NOT EXISTS `poolctrl_event` (
   `repeat` bool NOT NULL DEFAULT false,
   `immediate` bool NOT NULL DEFAULT false,
   `running` bool NOT NULL DEFAULT false,
+  `runningType` tinyint(4) DEFAULT NULL,
   PRIMARY KEY (`eventID`),
   KEY `pbs_poolID` (`pbs_poolID`),
   KEY `pbs_membershipID` (`pbs_membershipID`),
-- 
cgit v1.2.3-55-g7522


From 216b0e0636bcc78759776a0a028cc8b113a9ebfb Mon Sep 17 00:00:00 2001
From: Björn Geiger
Date: Fri, 19 Aug 2011 12:00:34 +0200
Subject: Datenbankänderungen

---
 application/models/Runningtype.php       | 111 +++++++++++++++++++++++++++++++
 application/models/RunningtypeMapper.php |  87 ++++++++++++++++++++++++
 setup/poolctrl.sql                       |  12 +++-
 setup/poolctrl_data.sql                  |   5 ++
 4 files changed, 213 insertions(+), 2 deletions(-)
 create mode 100644 application/models/Runningtype.php
 create mode 100644 application/models/RunningtypeMapper.php

(limited to 'setup/poolctrl.sql')

diff --git a/application/models/Runningtype.php b/application/models/Runningtype.php
new file mode 100644
index 0000000..8a83a87
--- /dev/null
+++ b/application/models/Runningtype.php
@@ -0,0 +1,111 @@
+<?php
+/*
+ * Copyright (c) 2011 - OpenSLX GmbH, RZ Uni Freiburg
+ * This program is free software distributed under the GPL version 2.
+ * See http://gpl.openslx.org/
+ *
+ * If you have any feedback please consult http://feedback.openslx.org/ and
+ * send your suggestions, praise, or complaints to feedback@openslx.org
+ *
+ * General information about OpenSLX can be found at http://openslx.org/
+ */
+
+class Application_Model_Runningtype
+{
+	protected $_runningtypeID;
+	protected $_title;
+
+	public function __construct(array $options = null)
+	{
+		if (is_array($options)) {
+			$this->setOptions($options);
+		}
+	}
+
+	public function __set($name, $value)
+	{
+		$method = 'set' . $name;
+		if (('mapper' == $name) || !method_exists($this, $method)) {
+			throw new Exception('Invalid runningtype property');
+		}
+		$this->$method($value);
+	}
+
+	public function __get($name)
+	{
+		$method = 'get' . $name;
+		if (('mapper' == $name) || !method_exists($this, $method)) {
+			throw new Exception('Invalid runningtype property');
+		}
+		return $this->$method();
+	}
+
+	public function setOptions(array $options)
+	{
+		$methods = get_class_methods($this);
+		foreach ($options as $key => $value) {
+			$method = 'set' . ucfirst($key);
+			if (in_array($method, $methods)) {
+				$this->$method($value);
+			}
+		}
+		return $this;
+	}
+
+	/**
+	 * Returns current data as associative array using ReflectionClass
+	 *
+	 * @return    array    Returns associative array containing model data
+	 * If "get"-method not available (our primary keys) the function getID() is called
+	 */
+	public function toArray()
+	{
+		$reflectionClass = new ReflectionClass($this);
+		$properties = $reflectionClass->getProperties();
+		$result = array();
+		foreach ($properties as $property) {
+			$key = $property->name;
+			if (substr($key, 0, 1) != '_' && $this->$key !== null) {
+				$method = 'get' . ucfirst($key);
+				if ($reflectionClass->hasMethod($method)) {
+					$result[$key] = $this->$method();
+				} else {
+					$result[$key] = $this->$key;
+				}
+			}
+			elseif(substr($key, 0, 1) == '_' && $this->$key !== null) {
+				$key = substr($key, 1);
+				$method = 'get' . ucfirst($key);
+				if ($reflectionClass->hasMethod($method)) {
+					$result[$key] = $this->$method();
+				}else{
+					$result[$key] = $this->getID();
+				}
+					
+			}
+		}
+		return $result;
+	}
+
+	public function getID()
+	{
+		return $this->_runningtypeID;
+	}
+	public function setID($_runningtypeID)
+	{
+		$this->reporttypeID = $_runningtypeID;
+		return $this;
+	}
+
+	public function getTitle()
+	{
+		return $this->_title;
+	}
+
+	public function setTitle($_title)
+	{
+		$this->_title = $_title;
+		return $this;
+	}
+}
+
diff --git a/application/models/RunningtypeMapper.php b/application/models/RunningtypeMapper.php
new file mode 100644
index 0000000..b73d943
--- /dev/null
+++ b/application/models/RunningtypeMapper.php
@@ -0,0 +1,87 @@
+<?php
+
+class Application_Model_RunningtypeMapper
+{
+
+	protected $_dbTable;
+
+	public function setDbTable($dbTable)
+	{
+		if (is_string($dbTable)) {
+			$dbTable = new $dbTable();
+		}
+
+		if (!$dbTable instanceof Zend_Db_Table_Abstract) {
+			throw new Exception('Invalid table data gateway provided');
+		}
+
+		$this->_dbTable = $dbTable;
+
+		return $this;
+	}
+
+	public function getDbTable()
+	{
+		if (null === $this->_dbTable) {
+			$this->setDbTable('Application_Model_DbTable_Runningtype');
+		}
+
+		return $this->_dbTable;
+	}
+
+	public function save(Application_Model_Runningtype $runningtype)
+	{
+
+		$data = array('runningtypeID'=> $runningtype->getRunningtypeID() ,'title'=> $runningtype->getTitle() );
+
+		if (null === ($id = $runningtype->getID()) ) {
+			unset($data['runningtypeID']);
+			$this->getDbTable()->insert($data);
+		} else {
+			$this->getDbTable()->update($data, array('runningtypeID = ?' => $id));
+		}
+	}
+
+	public function delete(Application_Model_Runningtype $runningtype)
+	{
+		if (null === ($id = $runningtype->getID()) ) {
+			return;
+		} else {
+			$this->getDbTable()->delete(array('runningtypeID = ?' => $id));
+		}
+	}
+
+	public function find($id, Application_Model_Runningtype $runningtype)
+	{
+		$result = $this->getDbTable()->find($id);
+		if (0 == count($result)) {
+			return;
+		}
+
+		$row = $result->current();
+
+		$runningtype
+		->setRunningtypeID($row->runningtypeID)
+		->setTitle($row->title);
+	}
+
+	public function fetchAll()
+	{
+		$resultSet = $this->getDbTable()->fetchAll();
+		$entries   = array();
+		foreach ($resultSet as $row) {
+			$entry = new Application_Model_Runningtype();
+
+			$entry
+			->setRunningtypeID($row->runningtypeID)
+			->setTitle($row->title);
+
+			$entries[] = $entry;
+		}
+		return $entries;
+	}
+
+
+
+}
+
diff --git a/setup/poolctrl.sql b/setup/poolctrl.sql
index 8c11f06..470716e 100644
--- a/setup/poolctrl.sql
+++ b/setup/poolctrl.sql
@@ -20,16 +20,23 @@ CREATE TABLE IF NOT EXISTS `poolctrl_event` (
   `repeat` bool NOT NULL DEFAULT false,
   `immediate` bool NOT NULL DEFAULT false,
   `running` bool NOT NULL DEFAULT false,
-  `runningType` tinyint(4) DEFAULT NULL,
+  `runningtype` int(11) NOT NULL DEFAULT '0',
   PRIMARY KEY (`eventID`),
   KEY `pbs_poolID` (`pbs_poolID`),
   KEY `pbs_membershipID` (`pbs_membershipID`),
   KEY `pbs_bootosID` (`pbs_bootosID`),
   KEY `pbs_bootmenuID` (`pbs_bootmenuID`),
   KEY `pbs_filterID` (`pbs_filterID`),
-  KEY `category` (`category`)
+  KEY `category` (`category`),
+  KEY `runningtype` (`runningtype`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
 
+CREATE TABLE IF NOT EXISTS `poolctrl_runningtype` (
+  `runningtypeID` int(11) NOT NULL AUTO_INCREMENT,
+  `title` varchar(30) COLLATE utf8_unicode_ci NOT NULL UNIQUE,
+  PRIMARY KEY (`runningTypID`)
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
+
 CREATE TABLE IF NOT EXISTS `poolctrl_eventcategory` (
   `eventcategoryID` int(11) NOT NULL AUTO_INCREMENT,
   `title` varchar(30) COLLATE utf8_unicode_ci NOT NULL UNIQUE,
@@ -194,5 +201,6 @@ ALTER TABLE `poolctrl_event`
   ADD CONSTRAINT `poolctrl_event_bootosidC` FOREIGN KEY (`pbs_bootosID`) REFERENCES `pbs_bootos` (`bootosID`) ON DELETE CASCADE,
   ADD CONSTRAINT `poolctrl_event_membershipidC` FOREIGN KEY (`pbs_membershipID`) REFERENCES `pbs_membership` (`membershipID`)  ON DELETE CASCADE,
   ADD CONSTRAINT `poolctrl_event_categoryC` FOREIGN KEY (`category`) REFERENCES `poolctrl_eventcategory` (`eventcategoryID`) ON DELETE CASCADE,
+  ADD CONSTRAINT `poolctrl_event_runningtypeC` FOREIGN KEY (`runningtype`) REFERENCES `poolctrl_runningtype` (`runningtype`) ON DELETE SET NULl,
   ADD CONSTRAINT `poolctrl_event_startC` CHECK (start > CURRENT_TIMESTAMP()),
   ADD CONSTRAINT `poolctrl_event_endC` CHECK (end > start);
diff --git a/setup/poolctrl_data.sql b/setup/poolctrl_data.sql
index 365a3a5..f22da32 100644
--- a/setup/poolctrl_data.sql
+++ b/setup/poolctrl_data.sql
@@ -90,6 +90,11 @@ INSERT INTO `poolctrl_eventcategory` (`eventcategoryID`, `title`) VALUES
 (3, 'Boot'),
 (4, 'Shutdown');
 
+-- Adding runningtypes
+INSERT INTO `poolctrl_runningtype` (`runningtypeID`, `title`) VALUES
+(1, 'Boot'),
+(2, 'Shutdown');
+
 -- Adding events
 INSERT INTO `poolctrl_event` (`eventID`, `title`, `start`, `end`, `category`, `pbs_poolID`, `pbs_membershipID`, `pbs_bootosID`, `note`, `pbs_bootmenuID`, `pbs_filterID`) VALUES
 (1, 'Systeme I', '2011-06-24 12:10:00', '2011-06-24 14:00:00', '1', 1, 1, 1, 'Systeme I Vorlesung', 1, 1),
-- 
cgit v1.2.3-55-g7522


From bdbf7625d172fa64e7694f3bf37eed642517bbe1 Mon Sep 17 00:00:00 2001
From: Björn Geiger
Date: Mon, 22 Aug 2011 12:31:48 +0200
Subject: Datenbankänderung

---
 application/models/DbTable/Eventtype.php   |  20 ++++
 application/models/DbTable/Reporttype.php  |  20 ----
 application/models/DbTable/Runningtype.php |  20 ----
 application/models/Eventtype.php           | 111 ++++++++++++++++++++++
 application/models/EventtypeMapper.php     | 142 +++++++++++++++++++++++++++
 application/models/Reporttype.php          | 111 ----------------------
 application/models/ReporttypeMapper.php    | 148 -----------------------------
 application/models/Runningtype.php         | 111 ----------------------
 application/models/RunningtypeMapper.php   | 130 -------------------------
 setup/poolctrl.sql                         |  21 ++--
 setup/poolctrl_data.sql                    |  17 ++--
 11 files changed, 287 insertions(+), 564 deletions(-)
 create mode 100644 application/models/DbTable/Eventtype.php
 delete mode 100644 application/models/DbTable/Reporttype.php
 delete mode 100644 application/models/DbTable/Runningtype.php
 create mode 100644 application/models/Eventtype.php
 create mode 100644 application/models/EventtypeMapper.php
 delete mode 100644 application/models/Reporttype.php
 delete mode 100644 application/models/ReporttypeMapper.php
 delete mode 100644 application/models/Runningtype.php
 delete mode 100644 application/models/RunningtypeMapper.php

(limited to 'setup/poolctrl.sql')

diff --git a/application/models/DbTable/Eventtype.php b/application/models/DbTable/Eventtype.php
new file mode 100644
index 0000000..6c54913
--- /dev/null
+++ b/application/models/DbTable/Eventtype.php
@@ -0,0 +1,20 @@
+<?php
+/*
+ * Copyright (c) 2011 - OpenSLX GmbH, RZ Uni Freiburg
+ * This program is free software distributed under the GPL version 2.
+ * See http://gpl.openslx.org/
+ *
+ * If you have any feedback please consult http://feedback.openslx.org/ and
+ * send your suggestions, praise, or complaints to feedback@openslx.org
+ *
+ * General information about OpenSLX can be found at http://openslx.org/
+ */
+
+class Application_Model_DbTable_Eventtype extends Zend_Db_Table_Abstract
+{
+
+	protected $_name = 'poolctrl_eventtype';
+
+
+}
+
diff --git a/application/models/DbTable/Reporttype.php b/application/models/DbTable/Reporttype.php
deleted file mode 100644
index fe62330..0000000
--- a/application/models/DbTable/Reporttype.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-/*
- * Copyright (c) 2011 - OpenSLX GmbH, RZ Uni Freiburg
- * This program is free software distributed under the GPL version 2.
- * See http://gpl.openslx.org/
- *
- * If you have any feedback please consult http://feedback.openslx.org/ and
- * send your suggestions, praise, or complaints to feedback@openslx.org
- *
- * General information about OpenSLX can be found at http://openslx.org/
- */
-
-class Application_Model_DbTable_Reporttype extends Zend_Db_Table_Abstract
-{
-
-    protected $_name = 'poolctrl_reporttype';
-
-
-}
-
diff --git a/application/models/DbTable/Runningtype.php b/application/models/DbTable/Runningtype.php
deleted file mode 100644
index 0ed5638..0000000
--- a/application/models/DbTable/Runningtype.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-/*
- * Copyright (c) 2011 - OpenSLX GmbH, RZ Uni Freiburg
- * This program is free software distributed under the GPL version 2.
- * See http://gpl.openslx.org/
- *
- * If you have any feedback please consult http://feedback.openslx.org/ and
- * send your suggestions, praise, or complaints to feedback@openslx.org
- *
- * General information about OpenSLX can be found at http://openslx.org/
- */
-
-class Application_Model_DbTable_Runningtype extends Zend_Db_Table_Abstract
-{
-
-	protected $_name = 'poolctrl_runningtype';
-
-
-}
-
diff --git a/application/models/Eventtype.php b/application/models/Eventtype.php
new file mode 100644
index 0000000..fe21eeb
--- /dev/null
+++ b/application/models/Eventtype.php
@@ -0,0 +1,111 @@
+<?php
+/*
+ * Copyright (c) 2011 - OpenSLX GmbH, RZ Uni Freiburg
+ * This program is free software distributed under the GPL version 2.
+ * See http://gpl.openslx.org/
+ *
+ * If you have any feedback please consult http://feedback.openslx.org/ and
+ * send your suggestions, praise, or complaints to feedback@openslx.org
+ *
+ * General information about OpenSLX can be found at http://openslx.org/
+ */
+
+class Application_Model_Eventtype
+{
+	protected $_eventtypeID;
+	protected $_title;
+
+	public function __construct(array $options = null)
+	{
+		if (is_array($options)) {
+			$this->setOptions($options);
+		}
+	}
+
+	public function __set($name, $value)
+	{
+		$method = 'set' . $name;
+		if (('mapper' == $name) || !method_exists($this, $method)) {
+			throw new Exception('Invalid eventtype property');
+		}
+		$this->$method($value);
+	}
+
+	public function __get($name)
+	{
+		$method = 'get' . $name;
+		if (('mapper' == $name) || !method_exists($this, $method)) {
+			throw new Exception('Invalid eventtype property');
+		}
+		return $this->$method();
+	}
+
+	public function setOptions(array $options)
+	{
+		$methods = get_class_methods($this);
+		foreach ($options as $key => $value) {
+			$method = 'set' . ucfirst($key);
+			if (in_array($method, $methods)) {
+				$this->$method($value);
+			}
+		}
+		return $this;
+	}
+
+	/**
+	 * Returns current data as associative array using ReflectionClass
+	 *
+	 * @return    array    Returns associative array containing model data
+	 * If "get"-method not available (our primary keys) the function getID() is called
+	 */
+	public function toArray()
+	{
+		$reflectionClass = new ReflectionClass($this);
+		$properties = $reflectionClass->getProperties();
+		$result = array();
+		foreach ($properties as $property) {
+			$key = $property->name;
+			if (substr($key, 0, 1) != '_' && $this->$key !== null) {
+				$method = 'get' . ucfirst($key);
+				if ($reflectionClass->hasMethod($method)) {
+					$result[$key] = $this->$method();
+				} else {
+					$result[$key] = $this->$key;
+				}
+			}
+			elseif(substr($key, 0, 1) == '_' && $this->$key !== null) {
+				$key = substr($key, 1);
+				$method = 'get' . ucfirst($key);
+				if ($reflectionClass->hasMethod($method)) {
+					$result[$key] = $this->$method();
+				}else{
+					$result[$key] = $this->getID();
+				}
+					
+			}
+		}
+		return $result;
+	}
+
+	public function getID()
+	{
+		return $this->_eventtypeID;
+	}
+	public function setID($_eventtypeID)
+	{
+		$this->_eventtypeID = $_eventtypeID;
+		return $this;
+	}
+
+	public function getTitle()
+	{
+		return $this->_title;
+	}
+
+	public function setTitle($_title)
+	{
+		$this->_title = $_title;
+		return $this;
+	}
+}
+
diff --git a/application/models/EventtypeMapper.php b/application/models/EventtypeMapper.php
new file mode 100644
index 0000000..d1e2740
--- /dev/null
+++ b/application/models/EventtypeMapper.php
@@ -0,0 +1,142 @@
+<?php
+
+class Application_Model_RunningtypeMapper
+{
+	protected $_dbTable;
+
+	public function findBy($where, $array=false, $order=false)
+	{
+		foreach($where as $k => $v){
+			if($v != null)
+			$where2[] = "$k = '$v'";
+			else
+			$where2[] = "$k IS NULL";
+		}
+		$where = implode(" AND " ,$where2);
+
+		try{
+			$db = Zend_Db_Table::getDefaultAdapter();
+			$select = $this->getDbTable()->select()
+			->from($this->_dbTable)
+			->where($where);
+
+			if(is_array($order)){
+				foreach ($order as $k => $v)
+				$a[] = "$k $v";
+				$select->order($a);
+			}
+
+			$stmt = $select->query();
+			$result = $stmt->fetchAll();
+
+			if(!$array){
+				$entries = array();
+				if(count($result) > 0) {
+					foreach ($result as $row) {
+						$entry = new Application_Model_Eventtype($row);
+						$entry->setID($row['eventtypeID']);
+						$entries[] = $entry;
+					}
+				}
+				return $entries;
+			}else{
+				return $result;
+			}
+
+		}catch (Zend_Exception $e) {
+			echo "Error message 2: " . $e->getMessage() . "\n";
+		}
+	}
+
+	public function setDbTable($dbTable)
+	{
+		if (is_string($dbTable)) {
+			$dbTable = new $dbTable();
+		}
+
+		if (!$dbTable instanceof Zend_Db_Table_Abstract) {
+			throw new Exception('Invalid table data gateway provided');
+		}
+
+		$this->_dbTable = $dbTable;
+
+		return $this;
+	}
+
+	public function getDbTable()
+	{
+		if (null === $this->_dbTable) {
+			$this->setDbTable('Application_Model_DbTable_Eventtype');
+		}
+
+		return $this->_dbTable;
+	}
+
+	public function save(Application_Model_Eventtype $eventtype)
+	{
+
+		$data = array('eventtypeID'=> $eventtype->getID() ,'title'=> $eventtype->getTitle() );
+
+		if (null === ($id = $eventtype->getID()) ) {
+			unset($data['eventtypeID']);
+			$this->getDbTable()->insert($data);
+		} else {
+			$this->getDbTable()->update($data, array('eventtypeID = ?' => $id));
+		}
+	}
+
+	public function delete(Application_Model_Eventtype $eventtype)
+	{
+		if (null === ($id = $eventtype->getID()) ) {
+			return;
+		} else {
+			$this->getDbTable()->delete(array('eventtypeID = ?' => $id));
+		}
+	}
+
+	public function find($id, Application_Model_Eventtype $eventtype)
+	{
+		$result = $this->getDbTable()->find($id);
+		if (0 == count($result)) {
+			return;
+		}
+
+		if($eventtype == null) {
+			$return = true;
+		}
+
+		$row = $result->current();
+
+		if($return) {
+			$eventtype = new Application_Model_Eventtype();
+			$eventtype
+			->setID($row->eventtypeID)
+			->setTitle($row->title);
+			return $eventtype;
+		} else {
+			$eventtype
+			->setID($row->eventtypeID)
+			->setTitle($row->title);
+		}
+	}
+
+	public function fetchAll()
+	{
+		$resultSet = $this->getDbTable()->fetchAll();
+		$entries   = array();
+		foreach ($resultSet as $row) {
+			$entry = new Application_Model_Eventtype();
+
+			$entry
+			->setID($row->eventtypeID)
+			->setTitle($row->title);
+
+			$entries[] = $entry;
+		}
+		return $entries;
+	}
+
+
+
+}
+
diff --git a/application/models/Reporttype.php b/application/models/Reporttype.php
deleted file mode 100644
index ad5d668..0000000
--- a/application/models/Reporttype.php
+++ /dev/null
@@ -1,111 +0,0 @@
-<?php
-/*
- * Copyright (c) 2011 - OpenSLX GmbH, RZ Uni Freiburg
- * This program is free software distributed under the GPL version 2.
- * See http://gpl.openslx.org/
- *
- * If you have any feedback please consult http://feedback.openslx.org/ and
- * send your suggestions, praise, or complaints to feedback@openslx.org
- *
- * General information about OpenSLX can be found at http://openslx.org/
- */
-
-class Application_Model_Reporttype
-{
-	protected $_reporttypeID;
-	protected $_title;
-
-	public function __construct(array $options = null)
-	{
-		if (is_array($options)) {
-			$this->setOptions($options);
-		}
-	}
-
-	public function __set($name, $value)
-	{
-		$method = 'set' . $name;
-		if (('mapper' == $name) || !method_exists($this, $method)) {
-			throw new Exception('Invalid reporttype property');
-		}
-		$this->$method($value);
-	}
-
-	public function __get($name)
-	{
-		$method = 'get' . $name;
-		if (('mapper' == $name) || !method_exists($this, $method)) {
-			throw new Exception('Invalid reporttype property');
-		}
-		return $this->$method();
-	}
-
-	public function setOptions(array $options)
-	{
-		$methods = get_class_methods($this);
-		foreach ($options as $key => $value) {
-			$method = 'set' . ucfirst($key);
-			if (in_array($method, $methods)) {
-				$this->$method($value);
-			}
-		}
-		return $this;
-	}
-
-	/**
-	 * Returns current data as associative array using ReflectionClass
-	 *
-	 * @return    array    Returns associative array containing model data
-	 * If "get"-method not available (our primary keys) the function getID() is called
-	 */
-	public function toArray()
-	{
-		$reflectionClass = new ReflectionClass($this);
-		$properties = $reflectionClass->getProperties();
-		$result = array();
-		foreach ($properties as $property) {
-			$key = $property->name;
-			if (substr($key, 0, 1) != '_' && $this->$key !== null) {
-				$method = 'get' . ucfirst($key);
-				if ($reflectionClass->hasMethod($method)) {
-					$result[$key] = $this->$method();
-				} else {
-					$result[$key] = $this->$key;
-				}
-			}
-			elseif(substr($key, 0, 1) == '_' && $this->$key !== null) {
-				$key = substr($key, 1);
-				$method = 'get' . ucfirst($key);
-				if ($reflectionClass->hasMethod($method)) {
-					$result[$key] = $this->$method();
-				}else{
-					$result[$key] = $this->getID();
-				}
-					
-			}
-		}
-		return $result;
-	}
-
-	public function getID()
-	{
-		return $this->_reporttypeID;
-	}
-	public function setID($_reporttypeID)
-	{
-		$this->_reporttypeID = $_reporttypeID;
-		return $this;
-	}
-
-	public function getTitle()
-	{
-		return $this->_title;
-	}
-
-	public function setTitle($_title)
-	{
-		$this->_title = $_title;
-		return $this;
-	}
-}
-
diff --git a/application/models/ReporttypeMapper.php b/application/models/ReporttypeMapper.php
deleted file mode 100644
index c760dbc..0000000
--- a/application/models/ReporttypeMapper.php
+++ /dev/null
@@ -1,148 +0,0 @@
-<?php
-/*
- * Copyright (c) 2011 - OpenSLX GmbH, RZ Uni Freiburg
- * This program is free software distributed under the GPL version 2.
- * See http://gpl.openslx.org/
- *
- * If you have any feedback please consult http://feedback.openslx.org/ and
- * send your suggestions, praise, or complaints to feedback@openslx.org
- *
- * General information about OpenSLX can be found at http://openslx.org/
- */
-
-class Application_Model_ReporttypeMapper
-{
-
-	protected $_dbTable;
-
-	public function findBy($where, $array=false, $order=false)
-	{
-		foreach($where as $k => $v){
-			if($v != null)
-			$where2[] = "$k = '$v'";
-			else
-			$where2[] = "$k IS NULL";
-		}
-		$where = implode(" AND " ,$where2);
-
-		try{
-			$db = Zend_Db_Table::getDefaultAdapter();
-			$select = $this->getDbTable()->select()
-			->from($this->_dbTable)
-			->where($where);
-
-			if(is_array($order)){
-				foreach ($order as $k => $v)
-				$a[] = "$k $v";
-				$select->order($a);
-			}
-
-			$stmt = $select->query();
-			$result = $stmt->fetchAll();
-
-			if(!$array){
-				$entries = array();
-				if(count($result) > 0) {
-					foreach ($result as $row) {
-						$entry = new Application_Model_Reporttype($row);
-						$entry->setID($row['reporttypeID']);
-						$entries[] = $entry;
-					}
-				}
-				return $entries;
-			}else{
-				return $result;
-			}
-
-		}catch (Zend_Exception $e) {
-			echo "Error message 2: " . $e->getMessage() . "\n";
-		}
-	}
-
-	public function setDbTable($dbTable)
-	{
-		if (is_string($dbTable)) {
-			$dbTable = new $dbTable();
-		}
-
-		if (!$dbTable instanceof Zend_Db_Table_Abstract) {
-			throw new Exception('Invalid table data gateway provided');
-		}
-
-		$this->_dbTable = $dbTable;
-
-		return $this;
-	}
-
-	public function getDbTable()
-	{
-		if (null === $this->_dbTable) {
-			$this->setDbTable('Application_Model_DbTable_Reporttype');
-		}
-
-		return $this->_dbTable;
-	}
-
-	public function save(Application_Model_Reporttype $reporttype)
-	{
-		$data = array('reporttypeID'=> $reporttype->getID() ,'title'=> $reporttype->getTitle() );
-		if (null === ($id = $reporttype->getID()) ) {
-			unset($data['reporttypeID']);
-			return $this->getDbTable(F)->insert($data);
-		} else {
-			$this->getDbTable()->update($data, array('reporttypeID = ?' => $id));
-		}
-	}
-
-	public function delete(Application_Model_Reporttype $reporttype)
-	{
-		if (null === ($id = $reporttype->getID()) ) {
-			return;
-		} else {
-			$this->getDbTable()->delete(array('reporttypeID = ?' => $id));
-		}
-	}
-
-	public function find($id, Application_Model_Reporttype $reporttype = null)
-	{
-		$result = $this->getDbTable()->find($id);
-		if (0 == count($result)) {
-			return;
-		}
-
-		$row = $result->current();
-
-		if($reporttype == null){
-			$reporttype = new Application_Model_Reporttype();
-		}
-
-		$reporttype
-		->setID($row->reporttypeID)
-		->setTitle($row->title);
-	}
-
-	public function fetchAll()
-	{
-		$resultSet = $this->getDbTable()->fetchAll();
-		$entries   = array();
-		foreach ($resultSet as $row) {
-			$entry = new Application_Model_Reporttype();
-
-			$entry
-			->setID($row->reporttypeID)
-			->setTitle($row->title);
-
-			$entries[$row->reporttypeID] = $entry;
-		}
-		return $entries;
-	}
-
-	public function compare(Application_Model_Reporttype $v1,Application_Model_Reporttype $v2){
-		$vv1 = $v1->toArray();
-		$vv2 = $v2->toArray();
-		return array_diff($vv1,$vv2);
-	}
-
-
-
-}
\ No newline at end of file
diff --git a/application/models/Runningtype.php b/application/models/Runningtype.php
deleted file mode 100644
index d08222d..0000000
--- a/application/models/Runningtype.php
+++ /dev/null
@@ -1,111 +0,0 @@
-<?php
-/*
- * Copyright (c) 2011 - OpenSLX GmbH, RZ Uni Freiburg
- * This program is free software distributed under the GPL version 2.
- * See http://gpl.openslx.org/
- *
- * If you have any feedback please consult http://feedback.openslx.org/ and
- * send your suggestions, praise, or complaints to feedback@openslx.org
- *
- * General information about OpenSLX can be found at http://openslx.org/
- */
-
-class Application_Model_Runningtype
-{
-	protected $_runningtypeID;
-	protected $_title;
-
-	public function __construct(array $options = null)
-	{
-		if (is_array($options)) {
-			$this->setOptions($options);
-		}
-	}
-
-	public function __set($name, $value)
-	{
-		$method = 'set' . $name;
-		if (('mapper' == $name) || !method_exists($this, $method)) {
-			throw new Exception('Invalid runningtype property');
-		}
-		$this->$method($value);
-	}
-
-	public function __get($name)
-	{
-		$method = 'get' . $name;
-		if (('mapper' == $name) || !method_exists($this, $method)) {
-			throw new Exception('Invalid runningtype property');
-		}
-		return $this->$method();
-	}
-
-	public function setOptions(array $options)
-	{
-		$methods = get_class_methods($this);
-		foreach ($options as $key => $value) {
-			$method = 'set' . ucfirst($key);
-			if (in_array($method, $methods)) {
-				$this->$method($value);
-			}
-		}
-		return $this;
-	}
-
-	/**
-	 * Returns current data as associative array using ReflectionClass
-	 *
-	 * @return    array    Returns associative array containing model data
-	 * If "get"-method not available (our primary keys) the function getID() is called
-	 */
-	public function toArray()
-	{
-		$reflectionClass = new ReflectionClass($this);
-		$properties = $reflectionClass->getProperties();
-		$result = array();
-		foreach ($properties as $property) {
-			$key = $property->name;
-			if (substr($key, 0, 1) != '_' && $this->$key !== null) {
-				$method = 'get' . ucfirst($key);
-				if ($reflectionClass->hasMethod($method)) {
-					$result[$key] = $this->$method();
-				} else {
-					$result[$key] = $this->$key;
-				}
-			}
-			elseif(substr($key, 0, 1) == '_' && $this->$key !== null) {
-				$key = substr($key, 1);
-				$method = 'get' . ucfirst($key);
-				if ($reflectionClass->hasMethod($method)) {
-					$result[$key] = $this->$method();
-				}else{
-					$result[$key] = $this->getID();
-				}
-					
-			}
-		}
-		return $result;
-	}
-
-	public function getID()
-	{
-		return $this->_runningtypeID;
-	}
-	public function setID($_runningtypeID)
-	{
-		$this->_runningtypeID = $_runningtypeID;
-		return $this;
-	}
-
-	public function getTitle()
-	{
-		return $this->_title;
-	}
-
-	public function setTitle($_title)
-	{
-		$this->_title = $_title;
-		return $this;
-	}
-}
-
diff --git a/application/models/RunningtypeMapper.php b/application/models/RunningtypeMapper.php
deleted file mode 100644
index e012490..0000000
--- a/application/models/RunningtypeMapper.php
+++ /dev/null
@@ -1,130 +0,0 @@
-<?php
-
-class Application_Model_RunningtypeMapper
-{
-	protected $_dbTable;
-
-	public function findBy($where, $array=false, $order=false)
-	{
-		foreach($where as $k => $v){
-			if($v != null)
-			$where2[] = "$k = '$v'";
-			else
-			$where2[] = "$k IS NULL";
-		}
-		$where = implode(" AND " ,$where2);
-
-		try{
-			$db = Zend_Db_Table::getDefaultAdapter();
-			$select = $this->getDbTable()->select()
-			->from($this->_dbTable)
-			->where($where);
-
-			if(is_array($order)){
-				foreach ($order as $k => $v)
-				$a[] = "$k $v";
-				$select->order($a);
-			}
-
-			$stmt = $select->query();
-			$result = $stmt->fetchAll();
-
-			if(!$array){
-				$entries = array();
-				if(count($result) > 0) {
-					foreach ($result as $row) {
-						$entry = new Application_Model_Runningtype($row);
-						$entry->setID($row['runningtypeID']);
-						$entries[] = $entry;
-					}
-				}
-				return $entries;
-			}else{
-				return $result;
-			}
-
-		}catch (Zend_Exception $e) {
-			echo "Error message 2: " . $e->getMessage() . "\n";
-		}
-	}
-
-	public function setDbTable($dbTable)
-	{
-		if (is_string($dbTable)) {
-			$dbTable = new $dbTable();
-		}
-
-		if (!$dbTable instanceof Zend_Db_Table_Abstract) {
-			throw new Exception('Invalid table data gateway provided');
-		}
-
-		$this->_dbTable = $dbTable;
-
-		return $this;
-	}
-
-	public function getDbTable()
-	{
-		if (null === $this->_dbTable) {
-			$this->setDbTable('Application_Model_DbTable_Runningtype');
-		}
-
-		return $this->_dbTable;
-	}
-
-	public function save(Application_Model_Runningtype $runningtype)
-	{
-
-		$data = array('runningtypeID'=> $runningtype->getRunningtypeID() ,'title'=> $runningtype->getTitle() );
-
-		if (null === ($id = $runningtype->getID()) ) {
-			unset($data['runningtypeID']);
-			$this->getDbTable()->insert($data);
-		} else {
-			$this->getDbTable()->update($data, array('runningtypeID = ?' => $id));
-		}
-	}
-
-	public function delete(Application_Model_Runningtype $runningtype)
-	{
-		if (null === ($id = $runningtype->getID()) ) {
-			return;
-		} else {
-			$this->getDbTable()->delete(array('runningtypeID = ?' => $id));
-		}
-	}
-
-	public function find($id, Application_Model_Runningtype $runningtype)
-	{
-		$result = $this->getDbTable()->find($id);
-		if (0 == count($result)) {
-			return;
-		}
-
-		$row = $result->current();
-
-		$runningtype
-		->setRunningtypeID($row->runningtypeID)
-		->setTitle($row->title);
-	}
-
-	public function fetchAll()
-	{
-		$resultSet = $this->getDbTable()->fetchAll();
-		$entries   = array();
-		foreach ($resultSet as $row) {
-			$entry = new Application_Model_Runningtype();
-
-			$entry
-			->setRunningtypeID($row->runningtypeID)
-			->setTitle($row->title);
-
-			$entries[] = $entry;
-		}
-		return $entries;
-	}
-
-
-
-}
-
diff --git a/setup/poolctrl.sql b/setup/poolctrl.sql
index 470716e..3580485 100644
--- a/setup/poolctrl.sql
+++ b/setup/poolctrl.sql
@@ -20,7 +20,7 @@ CREATE TABLE IF NOT EXISTS `poolctrl_event` (
   `repeat` bool NOT NULL DEFAULT false,
   `immediate` bool NOT NULL DEFAULT false,
   `running` bool NOT NULL DEFAULT false,
-  `runningtype` int(11) NOT NULL DEFAULT '0',
+  `runningtype` int(11) DEFAULT NULL,
   PRIMARY KEY (`eventID`),
   KEY `pbs_poolID` (`pbs_poolID`),
   KEY `pbs_membershipID` (`pbs_membershipID`),
@@ -31,10 +31,10 @@ CREATE TABLE IF NOT EXISTS `poolctrl_event` (
   KEY `runningtype` (`runningtype`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
 
-CREATE TABLE IF NOT EXISTS `poolctrl_runningtype` (
-  `runningtypeID` int(11) NOT NULL AUTO_INCREMENT,
+CREATE TABLE IF NOT EXISTS `poolctrl_eventtype` (
+  `eventtypeID` int(11) NOT NULL AUTO_INCREMENT,
   `title` varchar(30) COLLATE utf8_unicode_ci NOT NULL UNIQUE,
-  PRIMARY KEY (`runningTypID`)
+  PRIMARY KEY (`eventtypeID`)
 ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
 
 CREATE TABLE IF NOT EXISTS `poolctrl_eventcategory` (
@@ -45,7 +45,8 @@ CREATE TABLE IF NOT EXISTS `poolctrl_eventcategory` (
 
 CREATE TABLE IF NOT EXISTS `poolctrl_eventreport` (
   `reportID` int(11) NOT NULL AUTO_INCREMENT,
-  `report` varchar(140) COLLATE utf8_unicode_ci DEFAULT 'success',
+  `result` varchar(140) COLLATE utf8_unicode_ci DEFAULT 'success',
+  `errors` varchar(140) COLLATE utf8_unicode_ci,
   `type` int(11) NOT NULL,
   `eventID` int(11) NOT NULL,
   `timestamp` timestamp COLLATE utf8_unicode_ci NOT NULL DEFAULT CURRENT_TIMESTAMP(),
@@ -54,12 +55,6 @@ CREATE TABLE IF NOT EXISTS `poolctrl_eventreport` (
   KEY `type` (`type`)
 ) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
 
-CREATE TABLE IF NOT EXISTS `poolctrl_reporttype` (
-  `reporttypeID` int(11) NOT NULL AUTO_INCREMENT,
-  `title` varchar(30) COLLATE utf8_unicode_ci NOT NULL UNIQUE,
-  PRIMARY KEY (`reporttypeID`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
-
 -- PBS2 Tabellen
 -- TO DO: Tabellen an dieser Stelle nicht per Hand erzeugen sondern von der PBS2-Datenbank kopieren, sodass diese auf dem neusten Stand sind
 CREATE TABLE IF NOT EXISTS `pbs_bootos` (
@@ -194,13 +189,13 @@ ALTER TABLE `pbs_membership`
 
 ALTER TABLE `poolctrl_eventreport`
   ADD CONSTRAINT `pbs_eventreport_eventidC` FOREIGN KEY (`eventID`) REFERENCES `poolctrl_event` (`eventID`) ON DELETE CASCADE,
-  ADD CONSTRAINT `pbs_eventreport_typeidC` FOREIGN KEY (`type`) REFERENCES `poolctrl_reporttype` (`reporttypeID`) ON DELETE CASCADE;
+  ADD CONSTRAINT `pbs_eventreport_typeidC` FOREIGN KEY (`type`) REFERENCES `poolctrl_eventtype` (`eventtypeID`) ON DELETE CASCADE;
 
 ALTER TABLE `poolctrl_event`
   ADD CONSTRAINT `poolctrl_event_poolidC` FOREIGN KEY (`pbs_poolID`) REFERENCES `pbs_pool` (`poolID`) ON DELETE CASCADE,
   ADD CONSTRAINT `poolctrl_event_bootosidC` FOREIGN KEY (`pbs_bootosID`) REFERENCES `pbs_bootos` (`bootosID`) ON DELETE CASCADE,
   ADD CONSTRAINT `poolctrl_event_membershipidC` FOREIGN KEY (`pbs_membershipID`) REFERENCES `pbs_membership` (`membershipID`)  ON DELETE CASCADE,
   ADD CONSTRAINT `poolctrl_event_categoryC` FOREIGN KEY (`category`) REFERENCES `poolctrl_eventcategory` (`eventcategoryID`) ON DELETE CASCADE,
-  ADD CONSTRAINT `poolctrl_event_runningtypeC` FOREIGN KEY (`runningtype`) REFERENCES `poolctrl_runningtype` (`runningtype`) ON DELETE SET NULl,
+  ADD CONSTRAINT `poolctrl_event_runningtypeC` FOREIGN KEY (`runningtype`) REFERENCES `poolctrl_eventtype` (`eventtypeID`) ON DELETE SET NULL,
   ADD CONSTRAINT `poolctrl_event_startC` CHECK (start > CURRENT_TIMESTAMP()),
   ADD CONSTRAINT `poolctrl_event_endC` CHECK (end > start);
diff --git a/setup/poolctrl_data.sql b/setup/poolctrl_data.sql
index f22da32..57df655 100644
--- a/setup/poolctrl_data.sql
+++ b/setup/poolctrl_data.sql
@@ -90,8 +90,8 @@ INSERT INTO `poolctrl_eventcategory` (`eventcategoryID`, `title`) VALUES
 (3, 'Boot'),
 (4, 'Shutdown');
 
--- Adding runningtypes
-INSERT INTO `poolctrl_runningtype` (`runningtypeID`, `title`) VALUES
+-- Adding eventtypes
+INSERT INTO `poolctrl_eventtype` (`eventtypeID`, `title`) VALUES
 (1, 'Boot'),
 (2, 'Shutdown');
 
@@ -101,13 +101,8 @@ INSERT INTO `poolctrl_event` (`eventID`, `title`, `start`, `end`, `category`, `p
 (2, 'Systeme II', '2011-06-24 14:10:00', '2011-06-24 16:00:00', '1', 1, 1, 1, 'Systeme II Vorlesung', 1, 1),
 (3, 'Systeme III', '2011-06-24 16:10:00', '2011-06-24 18:00:00', '1', 1, 1, 1, 'Systeme III Vorlesung', 1, 1);
 
--- Adding reporttypes
-INSERT INTO `poolctrl_reporttype` (`reporttypeID`, `title`) VALUES
-(1, 'Boot'),
-(2, 'Shutdown');
-
 -- Adding eventreports
-INSERT INTO `poolctrl_eventreport` (`reportID`, `report`, `type`, `eventID`) VALUES
-(1, DEFAULT, 1, 1),
-(2, DEFAULT, 1, 2),
-(3, 'wake-on-lan failed', 1, 3);
+INSERT INTO `poolctrl_eventreport` (`reportID`, `result`, `errors`, `type`, `eventID`) VALUES
+(1, DEFAULT, null, 1, 1),
+(2, DEFAULT, null, 1, 2),
+(3, 'failed', 'wake-on-lan failed', 1, 3);
-- 
cgit v1.2.3-55-g7522

