[hg] galaxy 3435: lims:
details: http://www.bx.psu.edu/hg/galaxy/rev/c1d024e76c2c changeset: 3435:c1d024e76c2c user: rc date: Wed Feb 24 10:04:03 2010 -0500 description: lims: - added error msg when dataset transfer is started for samples with no library - fixed typos - now dataset transfer does not affect sample state - request completion logic restored. diffstat: lib/galaxy/model/__init__.py | 2 +- lib/galaxy/web/controllers/requests_admin.py | 28 +++++++++++++++-------- scripts/galaxy_messaging/server/data_transfer.py | 2 +- templates/admin/requests/get_data.mako | 4 +- templates/admin/requests/show_request.mako | 8 +------ templates/base_panels.mako | 1 + templates/requests/show_request.mako | 2 +- 7 files changed, 25 insertions(+), 22 deletions(-) diffs (159 lines): diff -r 80747406525d -r c1d024e76c2c lib/galaxy/model/__init__.py --- a/lib/galaxy/model/__init__.py Wed Feb 24 08:44:22 2010 -0500 +++ b/lib/galaxy/model/__init__.py Wed Feb 24 10:04:03 2010 -0500 @@ -1414,7 +1414,7 @@ if self.events: return self.events[0].state return None - def untransfered_dataset_files(self): + def untransferred_dataset_files(self): count = 0 for df, status in self.dataset_files: if status == self.transfer_status.NOT_STARTED: diff -r 80747406525d -r c1d024e76c2c lib/galaxy/web/controllers/requests_admin.py --- a/lib/galaxy/web/controllers/requests_admin.py Wed Feb 24 08:44:22 2010 -0500 +++ b/lib/galaxy/web/controllers/requests_admin.py Wed Feb 24 10:04:03 2010 -0500 @@ -1275,8 +1275,8 @@ if s.current_state().id != request.type.states[-1].id: complete = False if request.complete() and not complete: - comments = "Sample(s) " % request.type.states[-1].name - event = trans.app.model.RequestEvent(request, request.states.COMPLETE, comments) + comments = "One or more samples moved back from the %s state" % request.type.states[-1].name + event = trans.app.model.RequestEvent(request, request.states.SUBMITTED, comments) trans.sa_session.add( event ) trans.sa_session.flush() elif complete: @@ -1325,7 +1325,7 @@ event = trans.app.model.SampleEvent(sample, new_state, comments) trans.sa_session.add( event ) trans.sa_session.flush() - #self.__set_request_state( trans, sample.request ) + self.__set_request_state( trans, sample.request ) return trans.response.send_redirect( web.url_for( controller='requests_admin', action='show_events', sample_id=sample.id)) @@ -1370,6 +1370,14 @@ status='error', message="Invalid sample ID", **kwd) ) + # check if a library and folder has been set for this sample yet. + if not sample.library or not sample.folder: + return trans.response.send_redirect( web.url_for( controller='requests_admin', + action='list', + operation='show_request', + messagetype='error', + msg="Set a data library and folder for <b>%s</b> to transfer dataset(s)." % sample.name, + id=trans.security.encode_id(sample.request.id) ) ) if sample.request.type.datatx_info.get('data_dir', ''): folder_path = util.restore_text( sample.request.type.datatx_info.get('data_dir', '') ) else: @@ -1405,7 +1413,7 @@ sample_id=trans.security.encode_id(sample.id), msg=msg, messagetype='error', folder_path=folder_path )) - return output.split()[2:] + return output.split() def __get_files_in_dir(self, trans, sample, folder_path): tmpfiles = self.__get_files(trans, sample, folder_path) @@ -1581,12 +1589,12 @@ dataset_index=index, cmd=cmd) dtt.start() - # set the sample state to the last state - if sample.current_state().id != sample.request.type.states[-1].id: - event = trans.app.model.SampleEvent(sample, sample.request.type.states[-1], - 'The dataset is ready and are being transfered to Galaxy') - trans.sa_session.add( event ) - trans.sa_session.flush() +# # set the sample state to the last state +# if sample.current_state().id != sample.request.type.states[-1].id: +# event = trans.app.model.SampleEvent(sample, sample.request.type.states[-1], +# 'The dataset is ready and are being transferred to Galaxy') +# trans.sa_session.add( event ) +# trans.sa_session.flush() if error_msg: return trans.response.send_redirect( web.url_for( controller='requests_admin', action='show_datatx_page', diff -r 80747406525d -r c1d024e76c2c scripts/galaxy_messaging/server/data_transfer.py --- a/scripts/galaxy_messaging/server/data_transfer.py Wed Feb 24 08:44:22 2010 -0500 +++ b/scripts/galaxy_messaging/server/data_transfer.py Wed Feb 24 10:04:03 2010 -0500 @@ -94,7 +94,7 @@ # update the data transfer status in the db self.update_status('Complete') # cleanup - self.cleanup() + #self.cleanup() sys.exit(0) def cleanup(self): diff -r 80747406525d -r c1d024e76c2c templates/admin/requests/get_data.mako --- a/templates/admin/requests/get_data.mako Wed Feb 24 08:44:22 2010 -0500 +++ b/templates/admin/requests/get_data.mako Wed Feb 24 10:04:03 2010 -0500 @@ -30,7 +30,7 @@ <h3>Sample "${sample.name}" of Request "${sample.request.name}"</h3> <ul class="manage-table-actions"> -## %if sample.request.submitted() and sample.untransfered_dataset_files(): +## %if sample.request.submitted() and sample.untransferred_dataset_files(): ## <li> ## <a class="action-button" href="${h.url_for( controller='requests_admin', action='start_datatx', id=trans.security.encode_id(sample.id) )}"> ## <span>Start data transfer</span></a> @@ -60,7 +60,7 @@ <form name="get_data" action="${h.url_for( controller='requests_admin', action='get_data', sample_id=sample.id)}" method="post" > %if len(dataset_files): <div class="form-row"> - <h4>Datasets Transfered</h4> + <h4>Datasets Transferred</h4> <div class="form-row"> <table class="grid"> <thead> diff -r 80747406525d -r c1d024e76c2c templates/admin/requests/show_request.mako --- a/templates/admin/requests/show_request.mako Wed Feb 24 08:44:22 2010 -0500 +++ b/templates/admin/requests/show_request.mako Wed Feb 24 10:04:03 2010 -0500 @@ -72,12 +72,6 @@ <span>Reject request</span></a> </li> %endif -## %if request.submitted() and request.samples: -## <li> -## <a class="action-button" href="${h.url_for( controller='requests_admin', action='bar_codes', request_id=request.id)}"> -## <span>Bar codes</span></a> -## </li> -## %endif <li> <a class="action-button" href="${h.url_for( controller='requests_admin', action='list', operation='events', id=trans.security.encode_id(request.id) )}"> <span>History</span></a> @@ -134,7 +128,7 @@ <th>Data Library</th> <th>Folder</th> %if request.submitted() or request.complete(): - <th>Dataset(s) Transfered</th> + <th>Dataset(s) Transferred</th> %endif <th></th> </tr> diff -r 80747406525d -r c1d024e76c2c templates/base_panels.mako --- a/templates/base_panels.mako Wed Feb 24 08:44:22 2010 -0500 +++ b/templates/base_panels.mako Wed Feb 24 10:04:03 2010 -0500 @@ -188,6 +188,7 @@ <div class="submenu"> <ul> <li><a href="${h.url_for( controller='/requests', action='index' )}">Sequencing Requests</a></li> + <li><a target="_blank" href="${app.config.get( "lims_doc_url", "http://main.g2.bx.psu.edu/u/rc/p/sts" )}">Help</a></li> </ul> </div> </td> diff -r 80747406525d -r c1d024e76c2c templates/requests/show_request.mako --- a/templates/requests/show_request.mako Wed Feb 24 08:44:22 2010 -0500 +++ b/templates/requests/show_request.mako Wed Feb 24 10:04:03 2010 -0500 @@ -124,7 +124,7 @@ <th>Data Library</th> <th>Folder</th> %if request.submitted() or request.complete(): - <th>Dataset(s) Transfered</th> + <th>Dataset(s) Transferred</th> %endif <th></th> </tr>
participants (1)
-
Greg Von Kuster