# HG changeset patch --
Bitbucket.org
# Project galaxy-dist
# URL
http://bitbucket.org/galaxy/galaxy-dist/overview
# User rc
# Date 1283287548 14400
# Node ID c472ac58348b0cd6d7e2040e4c5b2bfb4f42724e
# Parent 568f8d3854e8fcae7f78fbe906971a2369c65c33
lims: added search by request state to find samples page
--- a/templates/requests/common/find.mako
+++ b/templates/requests/common/find.mako
@@ -55,8 +55,8 @@
<form name="find_request" id="find_request"
action="${h.url_for( controller='requests_common', action='find',
cntrller=cntrller)}" method="post" ><div
class="form-row"><label>Find in sequencing requests in
state:</label>
- <select name="select_search_type">
- <option value="In-Progress"
selected>In-Progress</option>
+ <select name="request_state">
+ <option value="In Progress"
selected>In-Progress</option><option
value="Complete">Complete</option><option
value="Both">Both</option></select>
--- a/lib/galaxy/web/controllers/requests_common.py
+++ b/lib/galaxy/web/controllers/requests_common.py
@@ -1265,6 +1265,12 @@ class RequestsCommon( BaseController, Us
status = params.get( 'status', 'done' )
search_string = kwd.get( 'search_string', '' )
search_type = params.get( 'search_type', '' )
+ if params.get( 'request_state', 'In Progress' ) ==
'Both':
+ request_states = ['In Progress', 'Complete']
+ else:
+ request_states = [params.get( 'request_state', 'In Progress'
)]
+
+
samples_list = []
results = ''
if params.get('go_button', '') == 'Go':
@@ -1280,10 +1286,15 @@ class RequestsCommon( BaseController, Us
.all()
if cntrller == 'requests':
for s in samples:
- if s.request.user.id == trans.user.id:
+ if s.request.user.id == trans.user.id \
+ and s.request.state() in request_states\
+ and not s.request.deleted:
samples_list.append(s)
elif cntrller == 'requests_admin':
- samples_list = samples
+ for s in samples:
+ if not s.request.deleted \
+ and s.request.state() in request_states:
+ samples_list.append(s)
results = 'There are %i sequencing requests matching the search
parameters.' % len(samples_list)
return trans.fill_template( '/requests/common/find.mako',
cntrller=cntrller,