summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorBjörn Geiger2011-08-05 12:22:52 +0200
committerBjörn Geiger2011-08-05 12:22:52 +0200
commitc8b354b1e9f02a23c06060ed4bf86931b90239aa (patch)
tree25782493588f98d581682787fb88bee63ea3b4f7 /application
parentverschiedene Fehler korrigiert (diff)
downloadpoolctrl-c8b354b1e9f02a23c06060ed4bf86931b90239aa.tar.gz
poolctrl-c8b354b1e9f02a23c06060ed4bf86931b90239aa.tar.xz
poolctrl-c8b354b1e9f02a23c06060ed4bf86931b90239aa.zip
Event Action wieder entfernt
Diffstat (limited to 'application')
-rw-r--r--application/controllers/EventController.php3
-rw-r--r--application/forms/EventAdd.php23
-rw-r--r--application/models/DbTable/Eventaction.php19
-rw-r--r--application/models/Eventaction.php110
-rw-r--r--application/models/EventactionMapper.php148
5 files changed, 1 insertions, 302 deletions
diff --git a/application/controllers/EventController.php b/application/controllers/EventController.php
index 997733c..43da76a 100644
--- a/application/controllers/EventController.php
+++ b/application/controllers/EventController.php
@@ -127,7 +127,6 @@ class EventController extends Zend_Controller_Action
public function addAction()
{
$eventcategorylist = $this->eventcategoryMapper->fetchAll();
- $eventactionlist = $this->eventactionMapper->fetchAll();
$bootOsApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['getbootoss'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', '');
$bootOsXMLString = $bootOsApiResult['http-body'];
if(strlen($bootOsXMLString) > 0) {
@@ -167,7 +166,7 @@ class EventController extends Zend_Controller_Action
}
$add = $this->getRequest()->getParam("add");
if (!isset($add)){
- $addForm = new Application_Form_EventAdd(array('eventcategorylist' => $eventcategorylist, 'eventactionlist' => $eventactionlist, 'bootoslist' => $bootoslist, 'poollist' => $poollist));
+ $addForm = new Application_Form_EventAdd(array('eventcategorylist' => $eventcategorylist, 'bootoslist' => $bootoslist, 'poollist' => $poollist));
} else {
$addForm = new Application_Form_EventAdd(array('eventcategorylist' => $eventcategorylist, 'eventactionlist' => $eventactionlist, 'bootoslist' => $bootoslist, 'poollist' => $poollist, $this->getRequest()->getParams()));
if ($addForm->isValid($this->getRequest()->getParams())) {
diff --git a/application/forms/EventAdd.php b/application/forms/EventAdd.php
index 32108e0..b803873 100644
--- a/application/forms/EventAdd.php
+++ b/application/forms/EventAdd.php
@@ -6,7 +6,6 @@ class Application_Form_EventAdd extends Zend_Form
private $bootoslist;
private $poollist;
private $eventcategorylist;
- private $eventactionlist;
public function setMembershiplist($membershiplist){
$this->membershiplist = $membershiplist;
@@ -45,16 +44,6 @@ class Application_Form_EventAdd extends Zend_Form
$this->eventcategorylist = $eventcategorylist;
}
- public function getEventactionlist()
- {
- return $this->eventactionlist;
- }
-
- public function setEventactionlist($eventactionlist)
- {
- $this->eventactionlist = $eventactionlist;
- }
-
public function init()
{
$this->setName('EventAdd');
@@ -69,18 +58,6 @@ class Application_Form_EventAdd extends Zend_Form
'label' => 'Title:',
));
- $eventactionfield = $this->createElement('select','action');
- $eventactionfield ->setLabel('Action:');
-
- if(count($this->eventactionlist)>0){
- foreach($this->eventactionlist as $action => $a){
- $eventactionfield->addMultiOption($a->getID(), $a->getTitle());
- }
- }
-
- $eventactionfield->setRegisterInArrayValidator(false);
- $this->addElement($eventactionfield);
-
$this->addElement('checkbox', 'immediate', array(
'required' => false,
'label' => 'Immediate Event',
diff --git a/application/models/DbTable/Eventaction.php b/application/models/DbTable/Eventaction.php
deleted file mode 100644
index 6fe9c03..0000000
--- a/application/models/DbTable/Eventaction.php
+++ /dev/null
@@ -1,19 +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_Eventaction extends Zend_Db_Table_Abstract
-{
-
- protected $_name = 'poolctrl_eventaction';
-
-
-} \ No newline at end of file
diff --git a/application/models/Eventaction.php b/application/models/Eventaction.php
deleted file mode 100644
index 8d48593..0000000
--- a/application/models/Eventaction.php
+++ /dev/null
@@ -1,110 +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_Eventaction
-{
- protected $_eventactionID;
- 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 eventaction property');
- }
- $this->$method($value);
- }
-
- public function __get($name)
- {
- $method = 'get' . $name;
- if (('mapper' == $name) || !method_exists($this, $method)) {
- throw new Exception('Invalid eventaction 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->_eventactionID;
- }
- public function setID($_eventactionID)
- {
- $this->_eventactionID = $_eventactionID;
- return $this;
- }
-
- public function getTitle()
- {
- return $this->_title;
- }
-
- public function setTitle($_title)
- {
- $this->_title = $_title;
- return $this;
- }
-} \ No newline at end of file
diff --git a/application/models/EventactionMapper.php b/application/models/EventactionMapper.php
deleted file mode 100644
index af319a4..0000000
--- a/application/models/EventactionMapper.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_EventactionMapper
-{
-
- 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_Event($row);
- $entry->setID($row['eventactionID']);
- $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_Eventaction');
- }
-
- return $this->_dbTable;
- }
-
- public function save(Application_Model_Eventaction $eventaction)
- {
- $data = array('eventactionID'=> $eventaction->getID() ,'title'=> $eventaction->getTitle() );
- if (null === ($id = $eventaction->getID()) ) {
- unset($data['eventactionID']);
- return $this->getDbTable(F)->insert($data);
- } else {
- $this->getDbTable()->update($data, array('eventactionID = ?' => $id));
- }
- }
-
- public function delete(Application_Model_Eventaction $eventaction)
- {
- if (null === ($id = $eventaction->getID()) ) {
- return;
- } else {
- $this->getDbTable()->delete(array('eventactionID = ?' => $id));
- }
- }
-
- public function find($id, Application_Model_Eventaction $eventaction = null)
- {
- $result = $this->getDbTable()->find($id);
- if (0 == count($result)) {
- return;
- }
-
- $row = $result->current();
-
- if($eventaction == null){
- $eventaction = new Application_Model_Eventaction();
- }
-
- $eventaction
- ->setID($row->eventactionID)
- ->setTitle($row->title);
- }
-
- public function fetchAll()
- {
- $resultSet = $this->getDbTable()->fetchAll();
- $entries = array();
- foreach ($resultSet as $row) {
- $entry = new Application_Model_Eventaction();
-
- $entry
- ->setID($row->eventactionID)
- ->setTitle($row->title);
-
- $entries[$row->eventactionID] = $entry;
- }
- return $entries;
- }
-
- public function compare(Application_Model_Eventaction $v1,Application_Model_Eventaction $v2){
- $vv1 = $v1->toArray();
- $vv2 = $v2->toArray();
- return array_diff($vv1,$vv2);
- }
-
-
-
-} \ No newline at end of file