From ddea0446edb165f23df02f324cb3ca3c4066b308 Mon Sep 17 00:00:00 2001 From: Björn Geiger Date: Tue, 12 Apr 2011 15:45:15 +0200 Subject: Anzeige Request bei Personendetails --- .../modules/user/controllers/PersonController.php | 103 ++++++++++++++++----- .../user/views/scripts/person/owndetails.phtml | 39 ++++++++ .../modules/user/views/scripts/person/show.phtml | 28 ++++++ 3 files changed, 149 insertions(+), 21 deletions(-) (limited to 'application') diff --git a/application/modules/user/controllers/PersonController.php b/application/modules/user/controllers/PersonController.php index 7511233..bbdf232 100644 --- a/application/modules/user/controllers/PersonController.php +++ b/application/modules/user/controllers/PersonController.php @@ -2,13 +2,21 @@ class user_PersonController extends Zend_Controller_Action { + protected $person = null; + protected $personmapper = null; + protected $membershipMapper = null; + protected $memberships = null; + protected $groupMapper = null; + protected $groups = null; + protected $groupRequestMapper = null; + protected $userIDsNamespace = null; public function init() @@ -31,10 +39,10 @@ class user_PersonController extends Zend_Controller_Action foreach($this->memberships as $membership) { $group = $this->groupMapper->find($membership['groupID']); $this->groups[] = array ( - 'groupID' => $group->getID(), - 'title' => $group->getTitle(), - 'description' => $group->getDescription(), - 'membershipID' => $membership['membershipID'] + 'groupID' => $group->getID(), + 'title' => $group->getTitle(), + 'description' => $group->getDescription(), + 'membershipID' => $membership['membershipID'] ); } } @@ -88,6 +96,19 @@ class user_PersonController extends Zend_Controller_Action # $this->_redirect('/user'); #} $this->view->person = $this->person; + $groupRequests = $this->groupRequestMapper->findBy(array('personID' => $this->person->getID()),true); + if(isset($groupRequests)) { + foreach($groupRequests as $groupRequest) { + $group = $this->groupMapper->find($groupRequest['groupID']); + $groupRequestList[] = array( + 'grouprequestID' => $groupRequest['grouprequestID'], + 'group' => $group + ); + } + if(is_array($groupRequestList)) { + $this->view->groupRequestList = $groupRequestList; + } + } // Pagination $pagination = new Pbs_Pagination(); $pagination->setPerPage(3); @@ -217,13 +238,21 @@ class user_PersonController extends Zend_Controller_Action $date = new DateTime(); $groupRequest->setTime($date->getTimestamp()); $groupRequest->setPersonID($this->person->getID()); - try { - $groupRequestMapper->save($groupRequest); - } catch(Zend_Exception $e) - { - echo "Caught exception: " . get_class($e) . "
"; - echo "Message: " . $e->getMessage() . "
"; - return; + foreach($groupRequests as $groupRequestDB) { + if($groupRequestDB['groupID'] == $groupRequest->getGroupID()) { + $requestFound = true; + break; + } + } + if(!$requestFound) { + try { + $groupRequestMapper->save($groupRequest); + } catch(Zend_Exception $e) + { + echo "Caught exception: " . get_class($e) . "
"; + echo "Message: " . $e->getMessage() . "
"; + return; + } } $this->_helper->redirector('owndetails', 'person'); return; @@ -279,9 +308,9 @@ class user_PersonController extends Zend_Controller_Action $group = $groupMapper->find($membership['groupID']); $role = $roleMapper->find($membership['roleID']); $membershipList[] = array( - 'membershipID' => $membership['membershipID'], - 'group' => $group->getTitle(), - 'role' => $role->getTitle() + 'membershipID' => $membership['membershipID'], + 'group' => $group->getTitle(), + 'role' => $role->getTitle() ); } } @@ -302,7 +331,8 @@ class user_PersonController extends Zend_Controller_Action return; } - public function searchAction(){ + public function searchAction() + { if(!Pbs_Acl::checkRight('pso')) { $this->_redirect('/user'); } @@ -322,15 +352,27 @@ class user_PersonController extends Zend_Controller_Action foreach($memberships as $membership) { $group = $this->groupMapper->find($membership['groupID']); $groups[] = array ( - 'groupID' => $group->getID(), - 'title' => $group->getTitle(), - 'description' => $group->getDescription(), - 'membershipID' => $membership['membershipID'] + 'groupID' => $group->getID(), + 'title' => $group->getTitle(), + 'description' => $group->getDescription(), + 'membershipID' => $membership['membershipID'] ); } } $this->view->person = $person; - + $groupRequests = $this->groupRequestMapper->findBy(array('personID' => $person->getID()),true); + if(isset($groupRequests)) { + foreach($groupRequests as $groupRequest) { + $group = $this->groupMapper->find($groupRequest['groupID']); + $groupRequestList[] = array( + 'grouprequestID' => $groupRequest['grouprequestID'], + 'group' => $group + ); + } + if(is_array($groupRequestList)) { + $this->view->groupRequestList = $groupRequestList; + } + } // Pagination $pagination = new Pbs_Pagination(); $pagination->setPerPage(2); @@ -350,4 +392,23 @@ class user_PersonController extends Zend_Controller_Action return; } } -} \ No newline at end of file + + public function deleterequestAction() + { + $grouprequestID = $this->_request->getParam('grouprequestID'); + $grouprequest = $this->groupRequestMapper->find($grouprequestID); + try { + $this->groupRequestMapper->delete($grouprequest); + } catch(Zend_Exception $e) + { + echo "Caught exception: " . get_class($e) . "
"; + echo "Message: " . $e->getMessage() . "
"; + return; + } + $this->_helper->redirector('owndetails', 'person'); + return; + } + + +} + diff --git a/application/modules/user/views/scripts/person/owndetails.phtml b/application/modules/user/views/scripts/person/owndetails.phtml index 8f91cfd..ac96d25 100644 --- a/application/modules/user/views/scripts/person/owndetails.phtml +++ b/application/modules/user/views/scripts/person/owndetails.phtml @@ -105,4 +105,43 @@ $class= 'highlight checked'; pagination; + if(isset($this->groupRequestList)) { + ?> +
+

Requests:

+
groupRequestList as $grouprequest) { + $grouprequestID = $grouprequest['grouprequestID']; + $group = $grouprequest['group']; + ?> +
+
+
Delete Request +
+
getTitle(); ?>
+ getDescription()) { + ?> +
getDescription(); ?>
+ +
 
+
+
+
+ \ No newline at end of file diff --git a/application/modules/user/views/scripts/person/show.phtml b/application/modules/user/views/scripts/person/show.phtml index 5fb4bde..c43bde3 100644 --- a/application/modules/user/views/scripts/person/show.phtml +++ b/application/modules/user/views/scripts/person/show.phtml @@ -93,4 +93,32 @@ $class= 'highlight checked'; pagination; +if(isset($this->groupRequestList)) { + ?> +
+

Requests:

+
groupRequestList as $grouprequest) { + $grouprequestID = $grouprequest['grouprequestID']; + $group = $grouprequest['group']; + ?> +
+
+
getTitle(); ?>
+ getDescription()) { + ?> +
getDescription(); ?>
+ +
 
+
+
+
+ \ No newline at end of file -- cgit v1.2.3-55-g7522 From 037330f11b7e0917cd45cb969ea6aedb85605902 Mon Sep 17 00:00:00 2001 From: Simon Date: Tue, 12 Apr 2011 16:16:46 +0200 Subject: fbgui logik umgepackt --- application/modules/fbgui/controllers/IndexController.php | 12 ++---------- application/modules/fbgui/views/scripts/index/start.phtml | 10 ++++++++++ 2 files changed, 12 insertions(+), 10 deletions(-) (limited to 'application') diff --git a/application/modules/fbgui/controllers/IndexController.php b/application/modules/fbgui/controllers/IndexController.php index c874d97..23471a2 100644 --- a/application/modules/fbgui/controllers/IndexController.php +++ b/application/modules/fbgui/controllers/IndexController.php @@ -103,16 +103,8 @@ class Fbgui_IndexController extends Zend_Controller_Action $session->setBootmenuentryID($bootmenuntryID); $session->setBootosID($bootmenuentry->getBootosID()); $sessionMapper->save($session); - echo "

Downloading

"; - echo ""; + + $this->view->alphaid = $_SESSION['alphasessionID']; } diff --git a/application/modules/fbgui/views/scripts/index/start.phtml b/application/modules/fbgui/views/scripts/index/start.phtml index a59dd3e..94e8d97 100644 --- a/application/modules/fbgui/views/scripts/index/start.phtml +++ b/application/modules/fbgui/views/scripts/index/start.phtml @@ -112,3 +112,13 @@ function updateProgress(p, s, u){ back
+

Downloading

+"; -- cgit v1.2.3-55-g7522 From 0d83115e9f74963c311a8d2165daddb5954cde9f Mon Sep 17 00:00:00 2001 From: Simon Date: Tue, 12 Apr 2011 16:26:43 +0200 Subject: quickfix für fbgui --- application/modules/fbgui/controllers/IndexController.php | 1 + 1 file changed, 1 insertion(+) (limited to 'application') diff --git a/application/modules/fbgui/controllers/IndexController.php b/application/modules/fbgui/controllers/IndexController.php index 23471a2..450dd14 100644 --- a/application/modules/fbgui/controllers/IndexController.php +++ b/application/modules/fbgui/controllers/IndexController.php @@ -104,6 +104,7 @@ class Fbgui_IndexController extends Zend_Controller_Action $session->setBootosID($bootmenuentry->getBootosID()); $sessionMapper->save($session); + $this->view->host = '132.230.4.27'; $this->view->alphaid = $_SESSION['alphasessionID']; } -- cgit v1.2.3-55-g7522 From 4cbe29cb27b1963cabdeaa83b780b6705cd0ece9 Mon Sep 17 00:00:00 2001 From: Björn Geiger Date: Tue, 12 Apr 2011 16:37:05 +0200 Subject: Rechte können nun wieder bei Rollen hinzugefügt und gelöscht werden, alle Rechte gleichzeitig von einer Rolle löschen --- .../modules/user/controllers/RoleController.php | 55 +++++++++++++++------- .../modules/user/views/scripts/role/show.phtml | 34 ++++++++----- 2 files changed, 59 insertions(+), 30 deletions(-) (limited to 'application') diff --git a/application/modules/user/controllers/RoleController.php b/application/modules/user/controllers/RoleController.php index 91357f0..1b2e54f 100644 --- a/application/modules/user/controllers/RoleController.php +++ b/application/modules/user/controllers/RoleController.php @@ -322,7 +322,11 @@ class User_RoleController extends Zend_Controller_Action } } } else { - $rightlist = $rights; + $rightCategoryMapper = new Application_Model_RightCategoryMapper(); + foreach($rights as $right) { + $rightCategory = $rightCategoryMapper->find($right->getRightcategoryID()); + $rightlist[$rightCategory->getTitle()][$right->getID()] = $right->getTitle(); + } } if(count($rightlist) > 0) { if (!isset($_POST["link"])){ @@ -377,15 +381,10 @@ class User_RoleController extends Zend_Controller_Action if(isset($rightRolesID)) { $rightRolesID = explode('-',$rightRolesID); $roleID = $rightRolesID[0]; - $rightID = $rightRolesID[1]; - if (isset($roleID) && isset($rightID)){ - $roleMapper = new Application_Model_RoleMapper(); - $role = $roleMapper->find($roleID); - $roleGroupID = $role->getGroupID(); - if($this->userIDsNamespace['groupID'] == $roleGroupID) { - $rightroles = new Application_Model_RightRoles(); - $rightroles->setRoleID($roleID); - $rightroles->setRightID($rightID); + if($rightRolesID[1] == 'all') { + $rightRolesMapper = new Application_Model_RightRolesMapper(); + $rightroleslist = $rightRolesMapper->findBy(array('roleID' => $roleID)); + foreach($rightroleslist as $rightroles) { try { $this->rightRolesMapper->delete($rightroles); } catch(Zend_Exception $e) @@ -393,15 +392,37 @@ class User_RoleController extends Zend_Controller_Action echo "Caught exception: " . get_class($e) . "
"; echo "Message: " . $e->getMessage() . "
"; return; + } + } + $this->_redirect('/user/role/show/roleID/' . $roleID); + return; + } else { + $rightID = $rightRolesID[1]; + if (isset($roleID) && isset($rightID)){ + $roleMapper = new Application_Model_RoleMapper(); + $role = $roleMapper->find($roleID); + $roleGroupID = $role->getGroupID(); + if($this->userIDsNamespace['groupID'] == $roleGroupID) { + $rightroles = new Application_Model_RightRoles(); + $rightroles->setRoleID($roleID); + $rightroles->setRightID($rightID); + try { + $this->rightRolesMapper->delete($rightroles); + } catch(Zend_Exception $e) + { + echo "Caught exception: " . get_class($e) . "
"; + echo "Message: " . $e->getMessage() . "
"; + return; + } + $this->_redirect('/user/role/show/roleID/' . $roleID); + return; + } else { + $pbsNotifier = new Pbs_Notifier(); + echo $pbsNotifier->notify('unlink','forbidden'); + $this->_helper-> viewRenderer-> setNoRender(); + return; } - $this->_redirect('/user/role/show/roleID/' . $roleID); - return; - } else { - $pbsNotifier = new Pbs_Notifier(); - echo $pbsNotifier->notify('unlink','forbidden'); - $this->_helper-> viewRenderer-> setNoRender(); - return; } } } else { diff --git a/application/modules/user/views/scripts/role/show.phtml b/application/modules/user/views/scripts/role/show.phtml index 8f4bb50..8c7503f 100644 --- a/application/modules/user/views/scripts/role/show.phtml +++ b/application/modules/user/views/scripts/role/show.phtml @@ -53,17 +53,22 @@ if($this->rightsAvailable === true) { echo $this->formButton('linkright', 'Add Rights', array( 'onclick' => 'self.location="/user/role/linkright/roleID/' . $this->role->getID() .'"', 'class' => 'addbutton'))?> -
rightsList)==0) -echo "There are no Rights to display."; -if(isset($this->rightcategorieslist)) { - foreach($this->rightcategorieslist as $k => $v): - $rights = $this->rightsList[$k]; - if(count($rights) > 0) { - ?> +if(count($this->rightsList)==0) { + echo "There are no Rights to display."; +} else { + if($this->removeRightOfRoleRight) echo $this->formButton('deleteallrights', 'Delete All Rights', array( + 'onclick' => 'self.location="/user/role/unlinkright/rightrolesID/' . $this->roleID . '-all"', + 'class' => 'rightbutton'));?> +
+ rightcategorieslist)) { + foreach($this->rightcategorieslist as $k => $v): + $rights = $this->rightsList[$k]; + if(count($rights) > 0) { + ?>

:

getDescription()) {
+endforeach +?> +
- -- cgit v1.2.3-55-g7522