Project

General

Profile

Feature #13985 » RM_13985_list_status_roles_RM_V1.2.1.diff

Jérôme BATAILLE, 2013-05-06 18:48

View differences:

app/views/issue_statuses/edit.rhtml (copie de travail)
4 4
  <%= render :partial => 'form' %>
5 5
  <%= submit_tag l(:button_save) %>
6 6
<% end %>
7

  
8
<br/>
9
<br/>
10

  
11
<h3><%= l(:label_workflow) %></h3>
12
<%
13
  prev_role_name = nil
14
  prev_tracker_id = nil
15
  tracker = nil
16
  workflows = @issue_status.workflows
17

  
18
  workflows.each_with_index do |w, i|
19
    next_role = workflows[i].role.name
20
    if i < (workflows.size - 1)
21
      next_role_name = workflows[i+1].role.name
22
      next_tracker_id = workflows[i+1].tracker_id
23
    else
24
      next_role_name = nil
25
      next_tracker_id = nil
26
    end
27

  
28
    if tracker.nil? || prev_tracker_id.nil? || (prev_tracker_id != w.tracker_id)
29
      tracker = Tracker.find_by_id(w.tracker_id)
30
    end
31

  
32
    # Begin of role block
33
    if prev_role_name.nil? || (prev_role_name != w.role.name)
34
-%>
35
  <fieldset class="box role">
36
    <legend><%= "#{l('label_role')} #{h(w.role.name)}" %></legend>
37
<%
38
    end
39

  
40
    # Begin of tracker block
41
    if (prev_tracker_id != w.tracker_id) || (prev_role_name != w.role.name)
42
-%>
43
    <fieldset class="box tracker">
44
      <legend><%= "#{l('label_tracker')} #{h(tracker.name)}" %></legend>
45
<%
46
    end
47

  
48
-%>
49
      <%= link_to "#{w.old_status.name} -> #{w.new_status.name}", {:controller => :workflows, :action => :edit, :role_id => w.role_id, :tracker_id => w.tracker_id, } %><br/>
50
<%
51
    # End of tracker block
52
    if (next_tracker_id != w.tracker_id) || (next_role_name != w.role.name)
53
-%>
54
    </fieldset class="tracker">
55
<%
56
    end
57

  
58
    # End of role block
59
    if next_role_name != w.role.name
60

  
61
-%>
62
  </fieldset class="role">
63
<%
64
    end
65

  
66
    prev_role_name = w.role.name
67
    prev_tracker_id = w.tracker_id
68
  end
69
-%>
(2-2/2)