summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authormichael pereira2011-04-26 10:59:15 +0200
committermichael pereira2011-04-26 10:59:15 +0200
commitcd54d29288e6d4f0085beec47d3dc257774e6659 (patch)
tree124480bfe99570c091643960c70b3555e42c75dc /application
parenthome on usb and draggable bootmenulist (diff)
parentgroupController Redirects && Graph editiert (diff)
downloadpbs2-cd54d29288e6d4f0085beec47d3dc257774e6659.tar.gz
pbs2-cd54d29288e6d4f0085beec47d3dc257774e6659.tar.xz
pbs2-cd54d29288e6d4f0085beec47d3dc257774e6659.zip
Merge branch 'master' of openslx.org:lsfks/master-teamprojekt/pbs2
Diffstat (limited to 'application')
-rw-r--r--application/modules/fbgui/forms/MembershipSelect.php1
-rw-r--r--application/modules/fbgui/views/scripts/auth/login.phtml4
-rw-r--r--application/modules/fbgui/views/scripts/person/selectmembership.phtml6
-rw-r--r--application/modules/user/controllers/GroupController.php14
-rw-r--r--application/modules/user/views/scripts/group/index.phtml2
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;?>