summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorBjörn Geiger2011-08-05 12:15:51 +0200
committerBjörn Geiger2011-08-05 12:15:51 +0200
commit2ad7dcd8251dcd1ec99f0f6c998dfb5423e36d6f (patch)
treeeb0c0125242fe7d69fc406514c1155255d9183a7 /application
parentFehler korrigiert (diff)
downloadpoolctrl-2ad7dcd8251dcd1ec99f0f6c998dfb5423e36d6f.tar.gz
poolctrl-2ad7dcd8251dcd1ec99f0f6c998dfb5423e36d6f.tar.xz
poolctrl-2ad7dcd8251dcd1ec99f0f6c998dfb5423e36d6f.zip
verschiedene Fehler korrigiert
Diffstat (limited to 'application')
-rw-r--r--application/controllers/IndexController.php3
-rw-r--r--application/controllers/PersonController.php12
-rw-r--r--application/layouts/default.phtml8
-rw-r--r--application/views/scripts/event/index.phtml10
4 files changed, 15 insertions, 18 deletions
diff --git a/application/controllers/IndexController.php b/application/controllers/IndexController.php
index f04aad4..0099301 100644
--- a/application/controllers/IndexController.php
+++ b/application/controllers/IndexController.php
@@ -18,5 +18,4 @@ class IndexController extends Zend_Controller_Action
}
-}
-
+} \ No newline at end of file
diff --git a/application/controllers/PersonController.php b/application/controllers/PersonController.php
index c2f6422..792bb8f 100644
--- a/application/controllers/PersonController.php
+++ b/application/controllers/PersonController.php
@@ -27,16 +27,17 @@ class PersonController extends Zend_Controller_Action
$this->config = $bootstrap->getOptions();
$this->pbs2host = $this->config['pbs2']['host'];
$this->userIDsNamespace = Zend_Session::namespaceGet('userIDs');
+ $this->membershipMapper = new Application_Model_MembershipMapper();
+ $this->currentMembership = new Application_Model_Membership();
+ $this->person = new Application_Model_Person();
+ $this->memberships = Zend_Session::namespaceGet('memberships');
if(count($this->userIDsNamespace)) {
$membershipID = $this->userIDsNamespace['membershipID'];
- $this->currentMembership = new Application_Model_Membership();
- $this->membershipMapper = new Application_Model_MembershipMapper();
$this->membershipMapper->find($membershipID, $this->currentMembership);
$personApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['getperson'] . $this->currentMembership->getApikey(), 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', '');
$personXMLString = $personApiResult['http-body'];
if(strlen($personXMLString) > 0) {
$personXML = new SimpleXMLElement($personXMLString);
- $this->person = new Application_Model_Person();
$this->person->setID(sprintf("%s", $personXML->person->id));
$this->person->setCity(sprintf("%s", $personXML->person->city));
$this->person->setEmail(sprintf("%s", $personXML->person->email));
@@ -53,9 +54,6 @@ class PersonController extends Zend_Controller_Action
}
}
- $this->memberships = Zend_Session::namespaceGet('memberships');
- $this->view->apikeys = array();
-
if(isset($this->memberships)) {
foreach($this->memberships as $membership) {
$grouprequest = "groupid=" . $membership['groupID'];
@@ -109,8 +107,8 @@ class PersonController extends Zend_Controller_Action
if(isset($_POST['selectmembership'])) {
$userSession = new Zend_Session_Namespace('userIDs');
$userSession->membershipID = $_POST['membershipID'];
- $userSession->personID = $this->person->getID();
$membership = $this->membershipMapper->find($_POST['membershipID']);
+ $userSession->personID = $membership->getPersonID();
$userSession->groupID = $membership->getGroupID();
$userSession->apikey = $membership->getApikey();
$this->_redirect('/');
diff --git a/application/layouts/default.phtml b/application/layouts/default.phtml
index f9de7ca..1932d5b 100644
--- a/application/layouts/default.phtml
+++ b/application/layouts/default.phtml
@@ -1,7 +1,7 @@
<?php
$bootstrap = Zend_Controller_Front::getInstance()->getParam('bootstrap');
$config = $bootstrap->getOptions();
-$pbs2host = $this->config['pbs2']['host'];
+$pbs2host = $config['pbs2']['host'];
?>
<?php echo $this->doctype(); ?>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
@@ -65,7 +65,7 @@ echo $this->headScript()."\n";
<div id="head-titlebar">
<div style='float: right'><?php
if(Zend_Auth::getInstance()->hasIdentity()){
- echo 'Logged in as';
+ echo 'Logged in as ';
$userIDsNamespace = Zend_Session::namespaceGet('userIDs');
if(isset($userIDsNamespace['membershipID'])){
@@ -97,8 +97,8 @@ if(Zend_Auth::getInstance()->hasIdentity()){
}
if(isset($userIDsNamespace['groupID'])){
echo " in group ";
- $grouprequest = "groupid=" . $membership['groupID'];
- $groupApiResult = PostToHost($pbs2host, $config['pbs2']['getgroup'] . $membership['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', $grouprequest);
+ $grouprequest = "groupid=" . $userIDsNamespace['groupID'];
+ $groupApiResult = PostToHost($pbs2host, $config['pbs2']['getgroup'] . $userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', $grouprequest);
$groupXMLString = $groupApiResult['http-body'];
if(strlen($groupXMLString) > 0) {
$groupXML = new SimpleXMLElement($groupXMLString);
diff --git a/application/views/scripts/event/index.phtml b/application/views/scripts/event/index.phtml
index 38fec17..aa090de 100644
--- a/application/views/scripts/event/index.phtml
+++ b/application/views/scripts/event/index.phtml
@@ -95,13 +95,13 @@ if(count($this->eventlist)>0) {
?>
<?php
- foreach ($this->poollist as $pool):
- $poolEvents = $this->eventlist[$pool->getID()]; ?>
- <div id='pool<?php echo $pool->getID(); ?>' style='display:none;' >
- <h2><?php echo $pool->getTitle(); ?></h2>
- <?php if(count($poolEvents)==0) {
+ foreach ($this->poollist as $pool):?>
+ <div id='pool<?php echo $pool->getID(); ?>' style='display:none;' >
+ <h2><?php echo $pool->getTitle(); ?></h2>
+ <?php if(!isset($this->eventlist[$pool->getID()])) {
echo "This Pool hasn't events yet";
} else { ?>
+ <?php $poolEvents = $this->eventlist[$pool->getID()]; ?>
<?php foreach ($poolEvents as $event): ?>
<div class='element'>
<div class='content'>