Project

General

Profile

Patch #987 ยป redmine1.diff

Dmitriy Miksir, 2008-04-09 01:07

View differences:

app/controllers/issues_controller.rb (working copy)
145 145
                                                                                                       :value => (params[:custom_fields] ? params[:custom_fields][x.id.to_s] : nil)) }
146 146
      @issue.custom_values = @custom_values
147 147
      if @issue.save
148
        if params[:relation_to]
149
          relation = IssueRelation.new({:relation_type => params[:relation_type], :issue_to_id => params[:relation_to]})
150
          relation.issue_from = @issue
151
          relation.save
152
        end
148 153
        attach_files(@issue, params[:attachments])
149 154
        flash[:notice] = l(:notice_successful_create)
150 155
        Mailer.deliver_issue_add(@issue) if Setting.notified_events.include?('issue_added')
app/views/issue_relations/_form.rhtml (working copy)
1 1
<%= error_messages_for 'relation' %>
2 2

  
3
<p><%= f.select :relation_type, collection_for_relation_type_select, {}, :onchange => "setPredecessorFieldsVisibility();" %>
4
<%= l(:label_issue) %> #<%= f.text_field :issue_to_id, :size => 6 %>
5
<span id="predecessor_fields" style="display:none;">
6
<%= l(:field_delay) %>: <%= f.text_field :delay, :size => 3 %> <%= l(:label_day_plural) %>
7
</span>
8
<%= submit_tag l(:button_add) %>
9
<%= toggle_link l(:button_cancel), 'new-relation-form'%>
10
</p>
3
<p><%= f.select :relation_type, collection_for_relation_type_select, {}, :onchange => "setPredecessorFieldsVisibility();" %></p>
4
<blockquote>
5
 <p><%= link_to l(:label_issue_new), {:controller => 'issues', :action => 'new', :project_id => @project, :relation_to => @issue}, :onclick => 'this.href=this.href+"&relation_type="+$(\'relation_relation_type\').value;' %></p>
6
 <p><%= l(:label_issue) %> #<%= f.text_field :issue_to_id, :size => 6 %>
7
 <span id="predecessor_fields" style="display:none;">
8
 <%= l(:field_delay) %>: <%= f.text_field :delay, :size => 3 %> <%= l(:label_day_plural) %>
9
 </span>
10
 <%= submit_tag l(:button_add) %>
11
 <p>
12
 <p><%= toggle_link l(:button_cancel), 'new-relation-form'%></p>
13
</blockquote>
11 14

  
12 15
<%= javascript_tag "setPredecessorFieldsVisibility();" %>
app/views/issues/_form.rhtml (working copy)
48 48
<p><label><%=l(:label_attachment_plural)%></label><%= render :partial => 'attachments/form' %></p>
49 49
<% end %>
50 50

  
51
<% if authorize_for('issue_relations', 'new') || @issue.relations.any? %>
52
<%= hidden_field_tag 'relation_to', '', :size => 4, :id => nil, :value => params[:relation_to] %>
53
<%= hidden_field_tag 'relation_type', '', :size => 10, :id => nil, :value => params[:relation_type] %>
54
<% end %>
55

  
51 56
<%= wikitoolbar_for 'issue_description' %>
    (1-1/1)