Feature #31322 » issue-31322.diff
| app/controllers/issues_controller.rb | ||
|---|---|---|
|
end
|
||
|
def show
|
||
|
@issue_statuses = IssueStatus.sorted.to_a
|
||
|
@journals = @issue.visible_journals_with_index
|
||
|
@has_changesets = @issue.changesets.visible.preload(:repository, :user).exists?
|
||
|
@relations = @issue.relations.select {|r| r.other_issue(@issue) && r.other_issue(@issue).visible? }
|
||
| ... | ... | |
|
# Used by #edit and #update to set some common instance variables
|
||
|
# from the params
|
||
|
def update_issue_from_params
|
||
|
@issue_statuses = IssueStatus.sorted.to_a
|
||
|
@time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project)
|
||
|
if params[:time_entry]
|
||
|
@time_entry.safe_attributes = params[:time_entry]
|
||
| app/views/issues/_attributes.html.erb | ||
|---|---|---|
|
<div class="splitcontentleft">
|
||
|
<% if @issue.safe_attribute?('status_id') && @allowed_statuses.present? %>
|
||
|
<p><%= f.select :status_id, (@allowed_statuses.collect {|p| [p.name, p.id]}), {:required => true},
|
||
|
:onchange => "updateIssueFrom('#{escape_javascript update_issue_form_path(@project, @issue)}', this)" %></p>
|
||
|
:onchange => "updateIssueFrom('#{escape_javascript update_issue_form_path(@project, @issue)}', this);add_confirm_dialog()" %></p>
|
||
|
<%= hidden_field_tag 'was_default_status', @issue.status_id, :id => nil if @issue.status == @issue.default_status %>
|
||
|
<% else %>
|
||
|
<p><label><%= l(:field_status) %></label> <%= @issue.status %></p>
|
||
| app/views/issues/_edit.html.erb | ||
|---|---|---|
|
<%= javascript_tag do %>
|
||
|
function add_confirm_dialog (){
|
||
|
var closed_issue_statuses =
|
||
|
<%= @issue_statuses.select{|i| i.is_closed?}.pluck(:id).map(&:to_s).to_json.html_safe %>;
|
||
|
var children = $("#issue_tree").find("tr.issue.child");
|
||
|
if (($.inArray($("#issue_status_id").val(), closed_issue_statuses) > -1) &&
|
||
|
(children.length > 0) &&
|
||
|
((children.length - $("#issue_tree").find("tr.issue.child.closed").length) > 0)) {
|
||
|
$("#submit_button").attr({
|
||
|
"data-confirm": 'POC'
|
||
|
});
|
||
|
} else {
|
||
|
$("#submit_button").removeAttr("data-confirm");
|
||
|
}
|
||
|
return true;
|
||
|
}
|
||
|
<% end %>
|
||
|
<%= labelled_form_for @issue, :html => {:id => 'issue-form', :multipart => true} do |f| %>
|
||
|
<%= error_messages_for 'issue', 'time_entry' %>
|
||
|
<%= render :partial => 'conflict' if @conflict %>
|
||
| ... | ... | |
|
<%= f.hidden_field :lock_version %>
|
||
|
<%= hidden_field_tag 'last_journal_id', params[:last_journal_id] || @issue.last_journal_id %>
|
||
|
<%= submit_tag l(:button_submit) %>
|
||
|
<%= submit_tag l(:button_submit), :id => "submit_button" %>
|
||
|
<%= link_to l(:button_cancel), issue_path(id: @issue.id), :onclick => params[:action] == 'show' ? "$('#update').hide(); return false;" : '' %>
|
||
|
<%= hidden_field_tag 'prev_issue_id', @prev_issue_id if @prev_issue_id %>
|
||