diff options
author | Björn Geiger | 2011-04-13 17:27:50 +0200 |
---|---|---|
committer | Björn Geiger | 2011-04-13 17:27:50 +0200 |
commit | dba424de73b449bda6677a4655383f67a679b8e2 (patch) | |
tree | 912b76f8376a6da83426c48007c30b8a3d3ffad0 /application/modules/user | |
parent | Merge branch 'master' of ssh://git.openslx.org/lsfks/master-teamprojekt/pbs2 (diff) | |
download | pbs2-dba424de73b449bda6677a4655383f67a679b8e2.tar.gz pbs2-dba424de73b449bda6677a4655383f67a679b8e2.tar.xz pbs2-dba424de73b449bda6677a4655383f67a679b8e2.zip |
HTML Fehler, die in Eclipse angezeigt wurden, entfernt
Diffstat (limited to 'application/modules/user')
3 files changed, 42 insertions, 41 deletions
diff --git a/application/modules/user/controllers/SessionController.php b/application/modules/user/controllers/SessionController.php index e17dbfe..d0b05ec 100644 --- a/application/modules/user/controllers/SessionController.php +++ b/application/modules/user/controllers/SessionController.php @@ -3,9 +3,9 @@ class User_SessionController extends Zend_Controller_Action { private $membership; - public function init() - { - if (Zend_Auth::getInstance()->hasIdentity()) { + public function init() + { + if (Zend_Auth::getInstance()->hasIdentity()) { $userIDsNamespace = Zend_Session::namespaceGet('userIDs'); if($userIDsNamespace['membershipID'] ==''){ $pbsNotifier = new Pbs_Notifier(); @@ -20,42 +20,42 @@ class User_SessionController extends Zend_Controller_Action } $this->page = $this->_request->getParam('page'); - } + } + + public function indexAction() + { + if(!Pbs_Acl::checkRight('so')) + $this->_redirect('/user/index'); - public function indexAction() - { - if(!Pbs_Acl::checkRight('so')) - $this->_redirect('/user/index'); - $sessionMapper = new Application_Model_SessionMapper(); $bootisoMapper = new Application_Model_BootIsoMapper(); $bootosMapper = new Application_Model_BootOsMapper(); $bootmenuentriesMapper = new Application_Model_BootMenuEntriesMapper(); $membershipMapper = new Application_Model_MembershipMapper(); $personMapper = new Application_Model_PersonMapper(); - + $bootisos = $bootisoMapper->findBy(array('groupID',$this->membership->getGroupID())); foreach($bootisos as $bootiso){ - $sessions = $sessionMapper->findBy(array('bootisoID',$bootiso->getID())); + $sessions = $sessionMapper->findBy(array('bootisoID',$bootiso->getID())); foreach($sessions as $session){ #echo $session->getBootosID(); if($session->getBootosID() != ''){ $bo = $bootosMapper->find($session->getBootosID()); if($bo != null) - $session->setBootosID("[".$session->getBootosID()."] ".$bo->getTitle()); + $session->setBootosID("[".$session->getBootosID()."] ".$bo->getTitle()); } if($session->getBootmenuentryID() != ''){ $bm = $bootmenuentriesMapper->find($session->getBootmenuentryID()); - if($bm != null) - $session->setBootmenuentryID("[".$session->getBootmenuentryID()."] ".$bm->getTitle()); - + if($bm != null) + $session->setBootmenuentryID("[".$session->getBootmenuentryID()."] ".$bm->getTitle()); + } - + if($session->getBootisoID() != ''){ $bi = $bootisoMapper->find($session->getBootisoID()); if($bi != null) - $session->setBootisoID("[".$session->getBootisoID()."] ".$bi->getTitle()); + $session->setBootisoID("[".$session->getBootisoID()."] ".$bi->getTitle()); } if($session->getMembershipID() != ''){ @@ -63,47 +63,48 @@ class User_SessionController extends Zend_Controller_Action $p = new Application_Model_Person(); $personMapper->find($personID,$p); if($p != null) - $session->setMembershipID("[".$session->getMembershipID()."] ".$p->getFirstname()." ".$p->getName()); - } + $session->setMembershipID("[".$session->getMembershipID()."] ".$p->getFirstname()." ".$p->getName()); + } $session->setTime(date(Zend_Registry::get('dateformat'),$session->getTime())); $mySessions[] =$session; - } + } } // Sort after date/id - usort($mySessions, function($func_a, $func_b) { - if($func_a->getID() == $func_b->getID()) return 0; - return ($func_a->getID() < $func_b->getID()) ? 1 : -1; - }); - + usort($mySessions, sortFunc); + // Search $search = $this->_request->getParam('search'); $mySearch = new Pbs_Search(); $mySearch->setSearchTerm($search); $mySearch->setModule('session'); if($search != ''){ - $this->view->search = $mySearch->getSearchTerm(); - $mySessions = $mySearch->search($mySessions); + $this->view->search = $mySearch->getSearchTerm(); + $mySessions = $mySearch->search($mySessions); } $this->view->searchform = $mySearch->searchForm(); - - // Pagination - $pagination = new Pbs_Pagination(); - $pagination->setPerPage(10); + + // Pagination + $pagination = new Pbs_Pagination(); + $pagination->setPerPage(10); $pagination->setElement($mySessions); - $pagination->setRequestPage($this->_request->getParam('page')); + $pagination->setRequestPage($this->_request->getParam('page')); $pagination->setPageUrl('/user/session/index'.((isset($this->view->search))?'/search/'.$this->view->search:'')); - $mySessions = $pagination->getElements(); - + $mySessions = $pagination->getElements(); + $this->view->pagination = $pagination->pagination(); $this->view->page = $pagination->getRequestPage(); - $this->view->sessions = $mySessions; - - } - - public function searchAction(){ + $this->view->sessions = $mySessions; + + } + + public function searchAction(){ $this->_redirect('/user/session/index/search/'.($_GET['search'])); } } +function sortFunc($func_a, $func_b) { + if($func_a->getID() == $func_b->getID()) return 0; + return ($func_a->getID() < $func_b->getID()) ? 1 : -1; +}
\ No newline at end of file diff --git a/application/modules/user/views/scripts/bootos/index.phtml b/application/modules/user/views/scripts/bootos/index.phtml index 00a0eb8..c2ce559 100644 --- a/application/modules/user/views/scripts/bootos/index.phtml +++ b/application/modules/user/views/scripts/bootos/index.phtml @@ -53,7 +53,7 @@ 'page' => $this->page ), 'default', - true, false) ?>"><img src='/media/img/update.png' alt='Updates available' /></a></td> + true, false) ?>"><img src='/media/img/update.png' alt='Updates available' /></a> <?php else: ?> <a><img src='/media/img/update_grey.png' alt='No updates available' /></a> <?php endif; ?> diff --git a/application/modules/user/views/scripts/index/index.phtml b/application/modules/user/views/scripts/index/index.phtml index f00d0dd..4acdfca 100644 --- a/application/modules/user/views/scripts/index/index.phtml +++ b/application/modules/user/views/scripts/index/index.phtml @@ -5,7 +5,7 @@ <?php if(count($this->links)>0 && is_array($this->links)): ?> <ul> <?php foreach($this->links as $link => $text):?> - <a href='<?php echo $link;?>'><li><?php echo $text;?></li></a> + <li><a href='<?php echo $link;?>'><?php echo $text;?></a></li> <?php endforeach ?> </ul> </div> |