diff --git a/module/group/js/managemember.js b/module/group/js/managemember.js index c9ec68a731..94465d17d7 100644 --- a/module/group/js/managemember.js +++ b/module/group/js/managemember.js @@ -5,4 +5,30 @@ $(function() var checked = $(this).prop('checked'); $(this).parents('tr').find('input[type=checkbox]').prop('checked', checked); }); + + $('#other,#group,#outside').selectable( + { + selector: 'input', + listenClick: false, + select: function(e) + { + $('[data-id=' + e.id + ']').prop('checked', true); + + var checked = true; + var memberNum = $('[data-id=' + e.id + ']').closest('td').find('input').length; + var checkedMemberNum = $('[data-id=' + e.id + ']').closest('td').find('input:checked').length; + if(memberNum > checkedMemberNum) checked = false; + $('[data-id=' + e.id + ']').closest('tr').find('.check-all input').prop('checked', checked); + }, + unselect: function(e) + { + $('[data-id=' + e.id + ']').prop('checked', false); + + var checked = true; + var memberNum = $('[data-id=' + e.id + ']').closest('td').find('input').length; + var checkedMemberNum = $('[data-id=' + e.id + ']').closest('td').find('input:checked').length; + if(memberNum > checkedMemberNum) checked = false; + $('[data-id=' + e.id + ']').closest('tr').find('.check-all input').prop('checked', checked); + } + }); }); diff --git a/module/productplan/control.php b/module/productplan/control.php index fb31e69a96..dbf0835978 100644 --- a/module/productplan/control.php +++ b/module/productplan/control.php @@ -393,8 +393,22 @@ class productplan extends control return print(js::error($this->lang->notFound) . js::locate($this->createLink('product', 'index'))); } - $this->session->set('storyList', $this->createLink('productplan', 'view', "planID=$planID&type=story"), 'product'); - $this->session->set('bugList', $this->createLink('productplan', 'view', "planID=$planID&type=bug"), 'qa'); + if($type == 'story' and ($orderBy != 'order_desc' or $pageID != 1 or $recPerPage != 100)) + { + $this->session->set('storyList', $this->app->getURI(true), 'product'); + } + else + { + $this->session->set('storyList', $this->createLink('productplan', 'view', "planID=$planID&type=story"), 'product'); + } + if($type == 'bug' and ($orderBy != 'order_desc' or $pageID != 1 or $recPerPage != 100)) + { + $this->session->set('bugList', $this->app->getURI(true), 'qa'); + } + else + { + $this->session->set('bugList', $this->createLink('productplan', 'view', "planID=$planID&type=bug"), 'qa'); + } /* Determines whether an object is editable. */ $canBeChanged = common::canBeChanged('plan', $plan);