diff options
| author | michael pereira | 2011-04-26 10:59:15 +0200 |
|---|---|---|
| committer | michael pereira | 2011-04-26 10:59:15 +0200 |
| commit | cd54d29288e6d4f0085beec47d3dc257774e6659 (patch) | |
| tree | 124480bfe99570c091643960c70b3555e42c75dc /application | |
| parent | home on usb and draggable bootmenulist (diff) | |
| parent | groupController Redirects && Graph editiert (diff) | |
| download | pbs2-cd54d29288e6d4f0085beec47d3dc257774e6659.tar.gz pbs2-cd54d29288e6d4f0085beec47d3dc257774e6659.tar.xz pbs2-cd54d29288e6d4f0085beec47d3dc257774e6659.zip | |
Merge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2
Diffstat (limited to 'application')
5 files changed, 20 insertions, 7 deletions
diff --git a/application/modules/fbgui/forms/MembershipSelect.php b/application/modules/fbgui/forms/MembershipSelect.php index a141116..d59a6d8 100644 --- a/application/modules/fbgui/forms/MembershipSelect.php +++ b/application/modules/fbgui/forms/MembershipSelect.php @@ -42,6 +42,7 @@ class fbgui_Form_MembershipSelect extends Zend_Form $this->addElement('submit', 'selectmembership', array( 'required' => false, + 'id' => 'submit', 'ignore' => true, 'label' => 'Select', )); diff --git a/application/modules/fbgui/views/scripts/auth/login.phtml b/application/modules/fbgui/views/scripts/auth/login.phtml index 330b34f..e78d973 100644 --- a/application/modules/fbgui/views/scripts/auth/login.phtml +++ b/application/modules/fbgui/views/scripts/auth/login.phtml @@ -7,10 +7,10 @@ echo $this->loginForm; <script> $(document).ready(function(){ $("#email").focus(); - $('input').keypress(function(e) { + $(document).keydown(function(e) { if(e.which == 13) { $(this).blur(); - $('#login').focus().click(); + $('#submit').focus().click(); } }); }); diff --git a/application/modules/fbgui/views/scripts/person/selectmembership.phtml b/application/modules/fbgui/views/scripts/person/selectmembership.phtml index e226b82..c40f94a 100644 --- a/application/modules/fbgui/views/scripts/person/selectmembership.phtml +++ b/application/modules/fbgui/views/scripts/person/selectmembership.phtml @@ -6,5 +6,11 @@ echo $this->membershipSelectForm; <script> $(document).ready(function(){ $("#membershipID").focus(); + $(document).keydown(function(e) { + if(e.which == 13) { + $(this).blur(); + $('#submit').focus().click(); + } + }); }); </script> diff --git a/application/modules/user/controllers/GroupController.php b/application/modules/user/controllers/GroupController.php index bb39287..d3afec9 100644 --- a/application/modules/user/controllers/GroupController.php +++ b/application/modules/user/controllers/GroupController.php @@ -111,6 +111,12 @@ class User_GroupController extends Zend_Controller_Action if ($addForm->isValid($_POST)) { $group = new Application_Model_Group($_POST); + + $db = $this->groupMapper->findBy(array('title'=>$group->getTitle())); + if(count($db)>=1){ + $this->_redirect('/user/group/index/page/'.$this->page.'/addresult/error'); + } + try { $this->groupMapper->save($group); } catch(Zend_Exception $e) @@ -161,7 +167,7 @@ class User_GroupController extends Zend_Controller_Action } } - $this->_helper->redirector('', 'group'); + $this->_redirect('/user/group/index/page/'.$this->page.'/addresult/ok'); return; } } @@ -186,7 +192,7 @@ class User_GroupController extends Zend_Controller_Action return; } if((!Pbs_Acl::checkRight('geo') && $groupID == $this->membership->getGroupID()) || ( !Pbs_Acl::checkRight('ge') && $groupID != $this->membership->getGroupID() )) - $this->_redirect('/user/group/index/page/'.$this->page.'/deleteresult/forbidden'); + $this->_redirect('/user/group/index/page/'.$this->page.'/modifyresult/forbidden'); if (!isset($_POST["save"])){ $group = $this->groupMapper->find($groupID); $_POST['title'] = $group->getTitle(); @@ -205,7 +211,7 @@ class User_GroupController extends Zend_Controller_Action echo "Message: " . $e->getMessage() . "<br/>"; return; } - $this->_helper->redirector('', 'group'); + $this->_redirect('/user/group/index/page/'.$this->page.'/modifyresult/ok'); return; } } @@ -389,7 +395,7 @@ class User_GroupController extends Zend_Controller_Action if(strpos($_SERVER['HTTP_REFERER'], '/user/group/show') !== false && strpos($_SERVER['HTTP_REFERER'], '/groupID/') === false) { $this->_helper->redirector('changemembership', 'person'); } else { - $this->_helper->redirector('', 'group'); + $this->_redirect('/user/group/index/page/'.$this->page.'/deleteresult/ok'); } } else { $this->_helper->redirector('', 'group'); diff --git a/application/modules/user/views/scripts/group/index.phtml b/application/modules/user/views/scripts/group/index.phtml index e987ae6..54beeb8 100644 --- a/application/modules/user/views/scripts/group/index.phtml +++ b/application/modules/user/views/scripts/group/index.phtml @@ -3,7 +3,7 @@ <?php echo $this->searchform; ?> <?php if(Pbs_Acl::checkRight('gc')):?> <?php echo $this->formButton('addgroup', 'Add Group', array( - 'onclick' => 'self.location="/user/group/add"', + 'onclick' => 'self.location="/user/group/add/page/'.$this->page.'"', 'class' => 'addbutton')) ?> <?php endif;?> |
