|
From: <ma...@us...> - 2006-05-22 19:50:40
|
Revision: 282 Author: markwkm Date: 2006-05-22 12:50:36 -0700 (Mon, 22 May 2006) ViewCVS: http://svn.sourceforge.net/stp/?rev=282&view=rev Log Message: ----------- Fixed the logic when using the pagination links. Modified Paths: -------------- trunk/stp-ror/app/controllers/test_requests_controller.rb Modified: trunk/stp-ror/app/controllers/test_requests_controller.rb =================================================================== --- trunk/stp-ror/app/controllers/test_requests_controller.rb 2006-05-22 19:13:46 UTC (rev 281) +++ trunk/stp-ror/app/controllers/test_requests_controller.rb 2006-05-22 19:50:36 UTC (rev 282) @@ -144,20 +144,20 @@ test_request.each { |key, value| @pagination_link_options["test_request[#{key}]"] = value - } + } if test_request software = params[:software] software.each { |key, value| @pagination_link_options["software[#{key}]"] = value - } + } if software softwares_test_requests = params[:softwares_test_requests] softwares_test_requests.each { |key, value| value = '""' if value.nil? @pagination_link_options["softwares_test_requests[#{key}]"] = value - } + } if softwares_test_requests # # First note that I may be doing this because I don't know how else to use # the Paginate class. @@ -176,37 +176,37 @@ ' tr.test_request_state_id, tr.created_on, tr.updated_on, ' + ' tr.test_case_id, tr.user_id ' - unless test_request[:host_type_id] == 'Any' then + if test_request and test_request[:host_type_id] != 'Any' then condition << "tr.host_type_id = '#{test_request[:host_type_id]}'" end - unless test_request[:distro_id] == 'Any' then + if test_request and test_request[:distro_id] != 'Any' then condition << "tr.distro_id = #{test_request[:distro_id]}" end - unless softwares_test_requests[:patch_name].empty? then + if softwares_test_requests and !softwares_test_requests[:patch_name].empty? then table << 'softwares_test_requests str' condition << 'tr.id = str.test_request_id' condition << "str.patch_name = #{softwares_test_requests[:patch_name]}" end - unless software[:id] == 'Any' then + if software and software[:id] != 'Any' then table << 'softwares_test_requests str' condition << 'tr.id = str.test_request_id' condition << "str.software_id = #{software[:id]}" end - unless test_request[:test_request_state_id] == 'Any' then + if test_request and test_request[:test_request_state_id] != 'Any' then condition << "tr.test_request_state_id = #{test_request[:test_request_state_id]}" end - unless test_request[:test_case_id] == 'Any' then + if test_request and test_request[:test_case_id] != 'Any' then condition << "tr.test_case_id = #{test_request[:test_case_id]}" end user = params[:user] - unless user[:login].empty? then + if user and !user[:login].empty? then table << 'users u' condition << 'tr.user_id = u.id' condition << "u.login = '#{user[:login]}'" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |