Note mandatory when rejecting or delegating
This commit is contained in:
parent
e3912119bb
commit
cf8e310d81
@ -95,7 +95,7 @@ module DmsfWorkflowsHelper
|
||||
def principals_radio_button_tags(name, principals)
|
||||
s = +''
|
||||
principals.each do |principal|
|
||||
s << "<label>#{ radio_button_tag name, principal.id * 10, false, id: nil } #{h principal}</label>\n"
|
||||
s << "<label>#{ radio_button_tag name, principal.id * 10, false, onclick: 'noteMandatory(true);', id: nil } #{h principal}</label>\n"
|
||||
end
|
||||
s.html_safe
|
||||
end
|
||||
|
||||
@ -27,13 +27,13 @@
|
||||
<%= hidden_field_tag :dmsf_file_revision_id, params[:dmsf_file_revision_id] %>
|
||||
<p>
|
||||
<label>
|
||||
<%= radio_button_tag 'step_action', DmsfWorkflowStepAction::ACTION_APPROVE, true %>
|
||||
<%= radio_button_tag 'step_action', DmsfWorkflowStepAction::ACTION_APPROVE, true, onclick: 'noteMandatory(false);' %>
|
||||
<%= l(:label_dmsf_wokflow_action_approve) %>
|
||||
</label>
|
||||
</p>
|
||||
<p>
|
||||
<label>
|
||||
<%= radio_button_tag 'step_action', DmsfWorkflowStepAction::ACTION_REJECT %>
|
||||
<%= radio_button_tag 'step_action', DmsfWorkflowStepAction::ACTION_REJECT, false, onclick: 'noteMandatory(true);' %>
|
||||
<%= l(:label_dmsf_wokflow_action_reject) %>
|
||||
</label>
|
||||
<br/>
|
||||
@ -51,7 +51,7 @@
|
||||
</div>
|
||||
|
||||
<p class="buttons">
|
||||
<%= submit_tag l(:button_submit), name: 'commit', onclick: 'hideModal(this);' %>
|
||||
<%= submit_tag l(:button_cancel), name: 'commit', onclick: 'hideModal(this);' %>
|
||||
<%= submit_tag l(:button_submit), name: 'commit' %>
|
||||
<%= submit_tag l(:button_cancel), name: 'cancel', onclick: 'hideModal(this);' %>
|
||||
</p>
|
||||
<% end %>
|
||||
|
||||
@ -147,3 +147,11 @@ function dmsfExpandRows(id, parentRow, url) {
|
||||
alert('An error in rows expanding');
|
||||
});
|
||||
}
|
||||
|
||||
function noteMandatory(mandatory) {
|
||||
let note = $('textarea#note');
|
||||
note.prop('required', mandatory);
|
||||
if(mandatory){
|
||||
note.focus();
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user