myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [2270] trunk/app: added "Select..." option to wor


From: noreply
Subject: [myexperiment-hackers] [2270] trunk/app: added "Select..." option to workflow types dropdown box to catch unspecified types
Date: Fri, 11 Sep 2009 11:14:14 -0400 (EDT)

Revision
2270
Author
dgc
Date
2009-09-11 11:14:13 -0400 (Fri, 11 Sep 2009)

Log Message

added "Select..." option to workflow types dropdown box to catch unspecified types

Modified Paths

Diff

Modified: trunk/app/controllers/workflows_controller.rb (2269 => 2270)


--- trunk/app/controllers/workflows_controller.rb	2009-09-08 12:54:20 UTC (rev 2269)
+++ trunk/app/controllers/workflows_controller.rb	2009-09-11 15:14:13 UTC (rev 2270)
@@ -743,6 +743,16 @@
       when "create_version"   then view_to_render_on_fail = "new_version"
     end
     
+    # Check that they selected a Workflow Type.
+
+    if params[:metadata_choice] == 'custom' && params[:workflow][:type] == 'Select...'
+      respond_to do |format|
+        flash.now[:error] = "You selected custom metadata but did not specify a workflow type"
+        format.html { render :action ="" view_to_render_on_fail }
+      end
+      return false
+    end
+
     # If a custom workflow type has been specified, check that it is not "Other" or "other" as this can cause havoc in the UI.
     if params[:metadata_choice] == 'custom' && params[:workflow][:type] && params[:workflow][:type].downcase == 'other'
 

Modified: trunk/app/views/workflows/_main_metadata_form.rhtml (2269 => 2270)


--- trunk/app/views/workflows/_main_metadata_form.rhtml	2009-09-08 12:54:20 UTC (rev 2269)
+++ trunk/app/views/workflows/_main_metadata_form.rhtml	2009-09-11 15:14:13 UTC (rev 2270)
@@ -49,7 +49,7 @@
 						<span class="required">*</span>
 					</p>
 					<%= select_tag "workflow[type]", 
-												 options_for_select(workflow_types, (params[:workflow].nil? ? nil : params[:workflow][:type])),
+												 options_for_select(['Select...'] + workflow_types, (params[:workflow].nil? ? nil : params[:workflow][:type])),
 												 : "if (this.value == 'Other') { $('workflow[type_other]').show(); $('workflow[type_other]').focus(); } else { $('workflow[type_other]').hide(); }",
 												 :style => "vertical-align: middle;" -%>
 					<%= text_field_tag "workflow[type_other]",

reply via email to

[Prev in Thread] Current Thread [Next in Thread]