redmine-0.6.3.diff

sunday walker, 2008-02-23 11:01

Download (41.9 KB)

View differences:

app/helpers/projects_helper.rb (???R?s?[)
14 14
# You should have received a copy of the GNU General Public License
15 15
# along with this program; if not, write to the Free Software
16 16
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17
module ProjectsHelper
18
  include IssuesHelper
17 19

  
18
module ProjectsHelper
19 20
  def link_to_version(version, options = {})
20 21
    return '' unless version && version.is_a?(Version)
21 22
    link_to version.name, {:controller => 'projects',
......
148 149
    gc.stroke('transparent')
149 150
    events.each do |i|      
150 151
      if i.is_a?(Issue)       
151
        i_start_date = (i.start_date >= date_from ? i.start_date : date_from )
152
        i_end_date = (i.due_date <= date_to ? i.due_date : date_to )        
153
        i_done_date = i.start_date + ((i.due_date - i.start_date+1)*i.done_ratio/100).floor
152
        i_start_date = (i.total('start_date') >= date_from ? i.total('start_date') : date_from )
153
        i_end_date = (i.total('due_date') <= date_to ? i.total('due_date') : date_to )        
154
        i_done_date = i.total('start_date') + i.total('actual_days')
154 155
        i_done_date = (i_done_date <= date_from ? date_from : i_done_date )
155 156
        i_done_date = (i_done_date >= date_to ? date_to : i_done_date )        
156 157
        i_late_date = [i_end_date, Date.today].min if i_start_date < Date.today
......
167 168
        gc.fill('blue')
168 169
        gc.rectangle(i_left, top, i_left + d_width, top - 6) if d_width > 0
169 170
        gc.fill('black')
170
        gc.text(i_left + i_width + 5,top + 1, "#{i.status.name} #{i.done_ratio}%")
171
        gc.text(i_left + i_width + 5,top + 1, "#{i.total('status').name} #{i.total('done_ratio')}%")
171 172
      else
172 173
        i_left = subject_width + ((i.start_date - date_from)*zoom).floor
173 174
        gc.fill('green')
app/helpers/issues_helper.rb (???R?s?[)
27 27
    @cached_label_priority ||= l(:field_priority)
28 28
    
29 29
    link_to_issue(issue) + ": #{h(issue.subject)}<br /><br />" +
30
      "<strong>#{@cached_label_start_date}</strong>: #{format_date(issue.start_date)}<br />" +
31
      "<strong>#{@cached_label_due_date}</strong>: #{format_date(issue.due_date)}<br />" +
30
      "<strong>#{@cached_label_start_date}</strong>: #{format_date(issue.total('start_date'))}<br />" +
31
      "<strong>#{@cached_label_due_date}</strong>: #{format_date(issue.total('due_date'))}<br />" +
32 32
      "<strong>#{@cached_label_assigned_to}</strong>: #{issue.assigned_to}<br />" +
33
      "<strong>#{@cached_label_priority}</strong>: #{issue.priority.name}"
33
      "<strong>#{@cached_label_priority}</strong>: #{issue.total('priority').name}"
34 34
  end
35 35

  
36 36
  def show_detail(detail, no_html=false)
......
104 104
      end
105 105
    end
106 106
  end
107
    
108
  def  linklist_add_child(elements, no_my, no_child)
109
    if elements[no_my]["child"] == -1 #edge
110
      elements[no_my]["child"] = no_child
111
      
112
      elements[no_child]["parent"] = no_my
113
      my_previous = elements[no_my]["previous"]
114
      my_next = elements[no_my]["next"]
115
      child_previous = elements[no_child]["previous"]
116
      child_next = elements[no_child]["next"]
117
      elements[no_my]["previous"] = child_previous
118
      elements[no_my]["next"] = child_next
119
      elements[child_previous]["next"] = no_my if child_previous != -1
120
      elements[child_next]["previous"] = no_my if child_next != -1
121
      elements[my_previous]["next"] = my_next if my_previous != -1
122
      elements[my_next]["previous"] = my_previous if my_next != -1
123
      elements[no_child]["previous"] = -1
124
      elements[no_child]["next"] = -1
125
    else
126
      no_element = elements[no_my]["child"]
127
      while elements[no_element]["next"] != -1 #until last
128
        no_element = elements[no_element]["next"]
129
      end
130
      elements[no_element]["next"] = no_child
131
      
132
      elements[no_child]["parent"] = no_my
133
      child_previous = elements[no_child]["previous"]
134
      child_next = elements[no_child]["next"]
135
      elements[child_previous]["next"] = child_next if child_previous != -1
136
      elements[child_next]["previous"] = child_previous if child_next != -1
137
      elements[no_child]["previous"] = no_element
138
      elements[no_child]["next"] = -1
139
    end
140
      
141
    elements
142
  end
107 143
  
144
  def make_outline(elements, outline_level, no_my)
145
    no_next = no_my
146
    while no_next != -1
147
      elements[0]["no"] += 1
148
      elements[no_next]["no"] = elements[0]["no"]
149
      elements[no_next]["issue"].outline_level(outline_level)
150
      if elements[no_next]["child"] != -1
151
        elements = make_outline(elements, outline_level+1, elements[no_next]["child"])
152
      end
153
      no_next = elements[no_next]["next"]
154
    end
155
    elements
156
  end
157
  
158
  def issues_to_outlines(issues)
159
    no_used = 0
160
    outlines = []
161
    outlines << {"no"=>0,"previous"=>-1,"next"=>-1,"parent"=>-1,"child"=>-1}
162
    # add edges
163
    issues.each do |issue|
164
      unless issue.childs && issue.childs.size > 0
165
        outlines[no_used]["next"] = no_used + 1
166
        outlines << {"no"=>0,"previous"=>no_used,"next"=>-1,"parent"=>-1,"child"=>-1,"issue"=>issue}
167
        no_used += 1
168
      end
169
    end
170
    # add non edges
171
    issues.each do |issue|
172
      if issue.childs && issue.childs.size > 0
173
        outlines[no_used]["next"] = no_used + 1
174
        outlines << {"no"=>0,"previous"=>no_used,"next"=>-1,"parent"=>-1,"child"=>-1,"issue"=>issue}
175
        no_used += 1
176
      end
177
    end
178
    # link family
179
    1.upto(outlines.size-1) do |i|
180
      (i+1).upto(outlines.size-1) do |j|
181
        if outlines[i]["issue"].parents && (outlines[i]["issue"].parents.size > 0) && (outlines[i]["issue"].parents[0].id == outlines[j]["issue"].id)
182
          outlines = linklist_add_child(outlines, j, i)
183
        elsif  outlines[j]["issue"].parents && (outlines[j]["issue"].parents.size > 0) && (outlines[j]["issue"].parents[0].id == outlines[i]["issue"].id)
184
          outlines = linklist_add_child(outlines, i, j)
185
        end
186
      end
187
    end
188
    # make outline
189
    outlines2 = make_outline(outlines, 1, outlines[0]["next"])
190
    # sort
191
    outlines2.shift
192
    issues = []
193
    1.upto(outlines2.size) do |no|
194
      outlines2.each do |outline|
195
        if outline["no"] == no
196
          issues << outline["issue"]
197
          break
198
        end
199
      end
200
    end
201
    0.upto(issues.size-1) do |no|
202
      if (no >= issues.size-1) || (issues[no].outline_level >= issues[no+1].outline_level)
203
        issues[no].edge(1)
204
      end
205
    end
206
    issues
207
  end
208
  
108 209
  def issues_to_csv(issues, project = nil)
109 210
    ic = Iconv.new(l(:general_csv_encoding), 'UTF-8')    
110 211
    export = StringIO.new
......
115 216
                  l(:field_project),
116 217
                  l(:field_tracker),
117 218
                  l(:field_priority),
219
                  l(:field_outline),
118 220
                  l(:field_subject),
119 221
                  l(:field_assigned_to),
120 222
                  l(:field_category),
......
131 233
      custom_fields = project.nil? ? IssueCustomField.for_all : project.all_custom_fields
132 234
      custom_fields.each {|f| headers << f.name}
133 235
      csv << headers.collect {|c| begin; ic.iconv(c.to_s); rescue; c.to_s; end }
236
      issues = issues_to_outlines(issues)
134 237
      # csv lines
135 238
      issues.each do |issue|
136 239
        fields = [issue.id,
137
                  issue.status.name, 
240
                  issue.total('status').name, 
138 241
                  issue.project.name,
139 242
                  issue.tracker.name, 
140
                  issue.priority.name,
243
                  issue.total('priority').name,
244
                  issue.outline_level,
141 245
                  issue.subject,
142 246
                  issue.assigned_to,
143 247
                  issue.category,
144 248
                  issue.fixed_version,
145 249
                  issue.author.name,
146
                  format_date(issue.start_date),
147
                  format_date(issue.due_date),
148
                  issue.done_ratio,
250
                  format_date(issue.total('start_date')),
251
                  format_date(issue.total('due_date')),
252
                  issue.total('done_ratio'),
149 253
                  format_time(issue.created_on),  
150 254
                  format_time(issue.updated_on)
151 255
                  ]
app/helpers/queries_helper.rb (???R?s?[)
30 30
      cv = issue.custom_values.detect {|v| v.custom_field_id == column.custom_field.id}
31 31
      show_value(cv)
32 32
    else
33
      value = issue.send(column.name)
33
#      value = issue.send(column.name)
34
      value = issue.total(column.name)
34 35
      if value.is_a?(Date)
35 36
        format_date(value)
36 37
      elsif value.is_a?(Time)
app/models/issue.rb (???R?s?[)
215 215
    (start_date && due_date) ? due_date - start_date : 0
216 216
  end
217 217
  
218
  def duration1
219
    (start_date && due_date) ? (due_date - start_date + 1) : 0
220
  end
221
  
218 222
  def soonest_start
219 223
    @soonest_start ||= relations_to.collect{|relation| relation.successor_soonest_start}.compact.min
220 224
  end
225
  
226
  def total(filed)
227
    filed = filed.to_s
228
    if filed == 'done_ratio' || filed == 'planned_days' || filed == 'actual_days'
229
      @total_planned_days ||= self.duration1
230
      @total_actual_days ||= done_ratio ?  (@total_planned_days * done_ratio / 100).floor : 0
231
      @total_done_ratio ||= done_ratio
232
    else
233
      eval("@total_#{filed} ||= #{filed}")
234
    end
235
    if filed == 'estimated_hours' || filed == 'spent_hours'
236
      type = 'sum'
237
    elsif filed == 'start_date'
238
      type = 'min'
239
    elsif filed == 'due_date'
240
      type = 'max'
241
    elsif filed == 'priority' || filed == 'fixed_version'
242
      type = 'max_id'
243
    elsif filed == 'status'
244
      type = 'min_id'
245
    elsif filed == 'done_ratio' || filed == 'planned_days' || filed == 'actual_days'
246
      type = 'done_ratio'
247
    else
248
      return(eval("@total_#{filed}"))
249
    end
250
    if !eval("@total_#{filed}") || (eval("@total_#{filed}") == 0) || (type == 'max_id') || (type == 'min_id')
251
      relations_to.each do |relation|
252
        if relation.relation_type == IssueRelation::TYPE_PARENTS
253
          othertotal = relation.other_issue(self).total(filed)
254
          if ! eval("@total_#{filed}")
255
            eval("@total_#{filed} = othertotal")
256
          elsif type == 'done_ratio' || type == 'planned_days' || type == 'actual_days'
257
            planned_days = relation.other_issue(self).total('duration1')
258
            actual_days = relation.other_issue(self).total('done_ratio') ?  (planned_days * relation.other_issue(self).total('done_ratio') / 100).floor : 0
259
            @total_planned_days += planned_days
260
            @total_actual_days += actual_days
261
            @total_done_ratio = @total_planned_days != 0 ? (@total_actual_days * 100 / @total_planned_days).floor : 0
262
          elsif type == 'max_id'
263
            if othertotal && eval("@total_#{filed}.id") < othertotal.id
264
              eval("@total_#{filed} = othertotal")
265
            end
266
          elsif type == 'min_id'
267
            if othertotal && eval("@total_#{filed}.id") > othertotal.id
268
              eval("@total_#{filed} = othertotal")
269
            end
270
          elsif type == 'sum'
271
            if othertotal
272
              eval("@total_#{filed} += othertotal")
273
            end
274
          elsif type == 'max'
275
            if othertotal && eval("@total_#{filed}") < othertotal
276
              eval("@total_#{filed} = othertotal")
277
            end
278
          elsif type == 'min'
279
            if othertotal && eval("@total_#{filed}") > othertotal
280
              eval("@total_#{filed} = othertotal")
281
            end
282
          end
283
        end
284
      end
285
    end
286
    eval("@total_#{filed}")
287
  end
288
  
289
  def childs
290
    childs = []
291
    relations_to.each do |relation|
292
      if relation.relation_type == IssueRelation::TYPE_PARENTS
293
        childs << relation.other_issue(self)
294
      end
295
    end
296
    childs
297
  end
298
  
299
  def parents
300
    parents = []
301
    relations_from.each do |relation|
302
      if relation.relation_type == IssueRelation::TYPE_PARENTS
303
        parents << relation.other_issue(self)
304
      end
305
    end
306
    parents
307
  end
308
  
309
  def outline_level(outline_level=0)
310
    
311
    @outline_level = outline_level if outline_level != 0
312
    @outline_level ? @outline_level : 1
313
  end
314
  
315
  def edge(edge=false)
316
    @edge = edge if edge
317
    @edge ? @edge : false
318
  end
221 319
end
app/models/issue_relation.rb (???R?s?[)
23 23
  TYPE_DUPLICATES   = "duplicates"
24 24
  TYPE_BLOCKS       = "blocks"
25 25
  TYPE_PRECEDES     = "precedes"
26
  TYPE_PARENTS     = "parents"
26 27
  
27 28
  TYPES = { TYPE_RELATES =>     { :name => :label_relates_to, :sym_name => :label_relates_to, :order => 1 },
28 29
            TYPE_DUPLICATES =>  { :name => :label_duplicates, :sym_name => :label_duplicates, :order => 2 },
29 30
            TYPE_BLOCKS =>      { :name => :label_blocks, :sym_name => :label_blocked_by, :order => 3 },
30 31
            TYPE_PRECEDES =>    { :name => :label_precedes, :sym_name => :label_follows, :order => 4 },
32
            TYPE_PARENTS =>    { :name => :label_parents, :sym_name => :label_children, :order => 5 },
31 33
          }.freeze
32 34
  
33 35
  validates_presence_of :issue_from, :issue_to, :relation_type
app/controllers/projects_controller.rb (???R?s?[)
512 512
                           :conditions => ["(((start_date>=? and start_date<=?) or (due_date>=? and due_date<=?) or (start_date<? and due_date>?)) and start_date is not null and due_date is not null and #{Issue.table_name}.tracker_id in (#{@selected_tracker_ids.join(',')}))", @date_from, @date_to, @date_from, @date_to, @date_from, @date_to]
513 513
                           ) unless @selected_tracker_ids.empty?
514 514
    end
515
  
515 516
    @events += @project.versions.find(:all, :conditions => ["effective_date BETWEEN ? AND ?", @date_from, @date_to])
516 517
    @events.sort! {|x,y| x.start_date <=> y.start_date }
518

  
519
    parent_ids = []
520
    my_ids = []
521
    @events.each do |i|
522
      my_ids << i.id
523
      while i.parents && (i.parents.size > 0)
524
        @selected_tracker_ids.each do |tracker_id|
525
          parent_ids |= [i.parents[0].id] if tracker_id.to_i == i.parents[0].tracker_id
526
        end
527
        i = i.parents[0]
528
      end
529
    end
530
    parent_ids.sort
531
    my_ids.sort
532
    parent_ids = parent_ids - my_ids
533
    @events += Issue.find(:all, :include => [:tracker, :status, :assigned_to, :priority, :project], :conditions => ["#{Issue.table_name}.id in (#{parent_ids.join(',')}) and #{Issue.table_name}.tracker_id in (#{@selected_tracker_ids.join(',')})"])  unless @selected_tracker_ids.empty? || parent_ids.empty?
534
    @events = issues_to_outlines(@events)
517 535
    
518 536
    if params[:format]=='pdf'
519 537
      @options_for_rfpdf ||= {}
app/views/projects/gantt.rhtml (???R?s?[)
72 72
@events.each do |i| %>
73 73
    <div style="position: absolute;line-height:1.2em;height:16px;top:<%= top %>px;left:4px;overflow:hidden;"><small>    
74 74
    <% if i.is_a? Issue %>
75
        <% indent = "" %>
76
        <% (2).upto(i.outline_level) do |j| %>
77
            <% indent += image_tag('white.png') %>
78
 	      <% end %>  	
79
        <% indent += (i.edge ? image_tag('white.png'):image_tag('expanded.png')) %>
80
        <%= indent %>
75 81
      	<%= h("#{i.project.name} -") unless @project && @project == i.project %>
76 82
      	<%= link_to_issue i %>:	<%=h i.subject %>
77 83
  	<% else %>
......
128 134
		width = (week_f + 6 <= @date_to) ? 7 * zoom -1 : (@date_to - week_f + 1) * zoom-1
129 135
		%>
130 136
		<div style="left:<%= left %>px;top:19px;width:<%= width %>px;height:<%= height %>px;" class="gantt_hdr">
131
		<small><%= week_f.cweek if width >= 16 %></small>
137
  	<small><% week_f.cweek if width >= 16 %><%= week_f.day if width >= 16 %></small>
132 138
		</div>
133 139
		<% 
134 140
		left = left + width+1
......
164 170
top = headers_height + 10
165 171
@events.each do |i| 
166 172
  if i.is_a? Issue 
167
	i_start_date = (i.start_date >= @date_from ? i.start_date : @date_from )
168
	i_end_date = (i.due_date <= @date_to ? i.due_date : @date_to )
173
	i_start_date = (i.total('start_date') >= @date_from ? i.total('start_date') : @date_from )
174
	i_end_date = (i.total('due_date') <= @date_to ? i.total('due_date') : @date_to )
169 175
	
170
	i_done_date = i.start_date + ((i.due_date - i.start_date+1)*i.done_ratio/100).floor
176
	i_done_date = i.total('start_date') + i.total('actual_days')
171 177
	i_done_date = (i_done_date <= @date_from ? @date_from : i_done_date )
172 178
	i_done_date = (i_done_date >= @date_to ? @date_to : i_done_date )
173 179
	
......
186 192
	    <div style="top:<%= top %>px;left:<%= i_left %>px;width:<%= d_width %>px;" class="task task_done">&nbsp;</div>
187 193
	<% end %>
188 194
	<div style="top:<%= top %>px;left:<%= i_left + i_width + 5 %>px;background:#fff;" class="task">
189
	<%= i.status.name %>
190
	<%= (i.done_ratio).to_i %>%
195
	<%= i.total('status').name %>
196
	<%= (i.total('done_ratio')).to_i %>%
191 197
	</div>
192 198
	<% # === tooltip === %>
193 199
	<div class="tooltip" style="position: absolute;top:<%= top %>px;left:<%= i_left %>px;width:<%= i_width %>px;height:12px;">
......
195 201
    <%= render_issue_tooltip i %>
196 202
	</span></div>
197 203
<% else 
198
    i_left = ((i.start_date - @date_from)*zoom).floor
204
    i_left = ((i.total('start_date') - @date_from)*zoom).floor
199 205
    %>
200 206
    <div style="top:<%= top %>px;left:<%= i_left %>px;width:15px;" class="task milestone">&nbsp;</div>
201 207
	<div style="top:<%= top %>px;left:<%= i_left + 12 %>px;background:#fff;" class="task">
app/views/projects/gantt.rfpdf (???R?s?[)
71 71
		width = (week_f + 6 <= @date_to) ? 7 * zoom : (@date_to - week_f + 1) * zoom
72 72
		pdf.SetY(y_start + header_heigth)
73 73
		pdf.SetX(left)
74
		pdf.Cell(width, height, (width >= 5 ? week_f.cweek.to_s : ""), "LTR", 0, "C")
74
#		pdf.Cell(width, height, (width >= 5 ? week_f.cweek.to_s : ""), "LTR", 0, "C")
75
		pdf.Cell(width, height, (width >= 5 ? week_f.day.to_s : ""), "LTR", 0, "C")
75 76
		left = left + width
76 77
		week_f = week_f+7
77 78
	end
......
111 112
	pdf.SetX(15)
112 113
	
113 114
	if i.is_a? Issue
114
		pdf.Cell(subject_width-15, 5, "#{i.tracker.name} #{i.id}: #{i.subject}".sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)'), "LR")
115
    pdf.Image('public/images/expanded.png', pdf.GetX+3*(i.outline_level-1)+0.5, pdf.GetY+1, 3, 3) unless i.edge
116
    pdf.Cell(3*i.outline_level+1,5,'',0)
117
		pdf.Cell(subject_width-15-(3*i.outline_level+1), 5, "#{i.tracker.name} #{i.id}: #{i.subject}".sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)'), 0)
118
    pdf.SetX(15)
119
		pdf.Cell(subject_width-15, 5, '', "LR")
115 120
	else
116 121
		pdf.Cell(subject_width-15, 5, "#{l(:label_version)}: #{i.name}", "LR")
117 122
	end
......
123 128
	pdf.SetY(top+1.5)
124 129
	
125 130
	if i.is_a? Issue
126
		i_start_date = (i.start_date >= @date_from ? i.start_date : @date_from )
127
		i_end_date = (i.due_date <= @date_to ? i.due_date : @date_to )
131
		i_start_date = (i.total('start_date') >= @date_from ? i.total('start_date') : @date_from )
132
		i_end_date = (i.total('due_date') <= @date_to ? i.total('due_date') : @date_to )
128 133
		
129
		i_done_date = i.start_date + ((i.due_date - i.start_date+1)*i.done_ratio/100).floor
134
		i_done_date = i.total('start_date') + i.total('actual_days')
130 135
		i_done_date = (i_done_date <= @date_from ? @date_from : i_done_date )
131 136
		i_done_date = (i_done_date >= @date_to ? @date_to : i_done_date )
132 137
		
......
157 162
		
158 163
		pdf.SetY(top+1.5)
159 164
		pdf.SetX(subject_width + i_left + i_width)
160
		pdf.Cell(30, 2, "#{i.status.name} #{i.done_ratio}%")
165
		pdf.Cell(30, 2, "#{i.total('status').name} #{i.total('done_ratio')}%")
161 166
	else
162
		i_left = ((i.start_date - @date_from)*zoom) 
167
		i_left = ((i.total('start_date') - @date_from)*zoom) 
163 168
		
164 169
		pdf.SetX(subject_width + i_left)
165 170
		pdf.SetFillColor(50,200,50)
app/views/issues/_relations.rhtml (???R?s?[)
12 12
<tr>
13 13
<td><%= l(relation.label_for(@issue)) %> <%= "(#{lwr(:actionview_datehelper_time_in_words_day, relation.delay)})" if relation.delay && relation.delay != 0 %> <%= link_to_issue relation.other_issue(@issue) %></td>
14 14
<td><%=h relation.other_issue(@issue).subject %></td>
15
<td><%= relation.other_issue(@issue).status.name %></td>
16
<td><%= format_date(relation.other_issue(@issue).start_date) %></td>
17
<td><%= format_date(relation.other_issue(@issue).due_date) %></td>
15
<td><%= relation.other_issue(@issue).total('status').name %></td>
16
<td><%= format_date(relation.other_issue(@issue).total('start_date')) %></td>
17
<td><%= format_date(relation.other_issue(@issue).total('due_date')) %></td>
18 18
<td><%= link_to_remote(image_tag('delete.png'), { :url => {:controller => 'issue_relations', :action => 'destroy', :issue_id => @issue, :id => relation},                                              
19 19
                                                  :method => :post
20 20
                                                }, :title => l(:label_relation_delete)) if authorize_for('issue_relations', 'destroy') %></td>
app/views/issues/_list.rhtml (???R?s?[)
12 12
        <% end %>
13 13
	</tr></thead>
14 14
	<tbody>
15
  <% issues = issues_to_outlines(issues) %>
15 16
	<% issues.each do |issue| %>
17
  <% indent = "" %>
18
  <% (2).upto(issue.outline_level) do |j| %>
19
  <% indent += image_tag('white.png') %>
20
  <% end %>
21
  <% indent += (issue.edge ? image_tag('white.png'):image_tag('expanded.png')) %>
22

  
16 23
	<tr id="issue-<%= issue.id %>" class="issue hascontextmenu <%= cycle('odd', 'even') %> <%= "status-#{issue.status.position} priority-#{issue.priority.position}" %>">
17 24
	    <td class="checkbox"><%= check_box_tag("issue_ids[]", issue.id, false, :id => "issue_#{issue.id}", :disabled => (!@project || @project != issue.project)) %></td>
18 25
		<td><%= link_to issue.id, :controller => 'issues', :action => 'show', :id => issue %></td>
19 26
        <% query.columns.each do |column| %>
20
          <%= content_tag 'td', column_content(column, issue), :class => column.name %>
27
          <%= content_tag 'td', (column.name.to_s == "subject" ? indent : "") + " " + column_content(column, issue), :class => column.name %>
21 28
        <% end %>
22 29
	</tr>
23 30
	<% end %>
app/views/issues/show.rhtml (???R?s?[)
19 19

  
20 20
<table width="100%">
21 21
<tr>
22
    <td style="width:15%"><b><%=l(:field_status)%> :</b></td><td style="width:35%"><%= @issue.status.name %></td>
23
    <td style="width:15%"><b><%=l(:field_start_date)%> :</b></td><td style="width:35%"><%= format_date(@issue.start_date) %></td>
22
    <td style="width:15%"><b><%=l(:field_status)%> :</b></td><td style="width:35%"><%= @issue.total('status').name %></td>
23
    <td style="width:15%"><b><%=l(:field_start_date)%> :</b></td><td style="width:35%"><%= format_date(@issue.total('start_date')) %></td>
24 24
</tr>
25 25
<tr>
26
    <td><b><%=l(:field_priority)%> :</b></td><td><%= @issue.priority.name %></td>
27
    <td><b><%=l(:field_due_date)%> :</b></td><td><%= format_date(@issue.due_date) %></td>
26
    <td><b><%=l(:field_priority)%> :</b></td><td><%= @issue.total('priority').name %></td>
27
    <td><b><%=l(:field_due_date)%> :</b></td><td><%= format_date(@issue.total('due_date')) %></td>
28 28
</tr>
29 29
<tr>
30 30
    <td><b><%=l(:field_assigned_to)%> :</b></td><td><%= @issue.assigned_to ? link_to_user(@issue.assigned_to) : "-" %></td>
31
    <td><b><%=l(:field_done_ratio)%> :</b></td><td><%= progress_bar @issue.done_ratio, :width => '80px', :legend => "#{@issue.done_ratio}%" %></td>
31
    <td><b><%=l(:field_done_ratio)%> :</b></td><td><%= progress_bar @issue.total('done_ratio'), :width => '80px', :legend => "#{@issue.total('done_ratio')}%" %></td>
32 32
</tr>
33 33
<tr>
34 34
    <td><b><%=l(:field_category)%> :</b></td><td><%=h @issue.category ? @issue.category.name : "-" %></td>
35 35
    <% if User.current.allowed_to?(:view_time_entries, @project) %>
36 36
    <td><b><%=l(:label_spent_time)%> :</b></td>
37
    <td><%= @issue.spent_hours > 0 ? (link_to lwr(:label_f_hour, @issue.spent_hours), {:controller => 'timelog', :action => 'details', :issue_id => @issue}, :class => 'icon icon-time') : "-" %></td>
37
    <td><%= @issue.total('spent_hours') > 0 ? (link_to lwr(:label_f_hour, @issue.total('spent_hours')), {:controller => 'timelog', :action => 'details', :issue_id => @issue}, :class => 'icon icon-time') : "-" %></td>
38 38
    <% end %>
39 39
</tr>
40 40
<tr>
41 41
    <td><b><%=l(:field_fixed_version)%> :</b></td><td><%= @issue.fixed_version ? link_to_version(@issue.fixed_version) : "-" %></td>
42
    <% if @issue.estimated_hours %>
43
    <td><b><%=l(:field_estimated_hours)%> :</b></td><td><%= lwr(:label_f_hour, @issue.estimated_hours) %></td>
42
    <% if @issue.total('estimated_hours') %>
43
    <td><b><%=l(:field_estimated_hours)%> :</b></td><td><%= lwr(:label_f_hour, @issue.total('estimated_hours')) %></td>
44 44
    <% end %>
45 45
</tr>
46 46
<tr>
app/views/issues/index.rfpdf (???R?s?[)
18 18
	#	
19 19
	pdf.SetFontStyle('B',10)
20 20
	pdf.SetFillColor(230, 230, 230)
21
   	pdf.Cell(15, row_height, "#", 0, 0, 'L', 1)
21
   	pdf.Cell(15, row_height, "#", 0, 0, 'R', 1)
22 22
   	pdf.Cell(30, row_height, l(:field_tracker), 0, 0, 'L', 1)
23 23
   	pdf.Cell(30, row_height, l(:field_status), 0, 0, 'L', 1)
24 24
   	pdf.Cell(30, row_height, l(:field_priority), 0, 0, 'L', 1)
......
33 33
	#
34 34
	# rows
35 35
	#
36
  @issues = issues_to_outlines(@issues)
36 37
	pdf.SetFontStyle('',9)
37 38
	pdf.SetFillColor(255, 255, 255)
38 39
	@issues.each do |issue|		
39
	   	pdf.Cell(15, row_height, issue.id.to_s, 0, 0, 'L', 1)
40
	   	pdf.Cell(15, row_height, issue.id.to_s, 0, 0, 'R', 1)
40 41
	   	pdf.Cell(30, row_height, issue.tracker.name, 0, 0, 'L', 1)
41
	   	pdf.Cell(30, row_height, issue.status.name, 0, 0, 'L', 1)
42
	   	pdf.Cell(30, row_height, issue.priority.name, 0, 0, 'L', 1)
42
	   	pdf.Cell(30, row_height, issue.total('status').name, 0, 0, 'L', 1)
43
	   	pdf.Cell(30, row_height, issue.total('priority').name, 0, 0, 'L', 1)
43 44
	   	pdf.Cell(40, row_height, issue.assigned_to ? issue.assigned_to.name : '', 0, 0, 'L', 1)
44 45
	   	pdf.Cell(25, row_height, format_date(issue.updated_on), 0, 0, 'L', 1)
46
      pdf.Image('public/images/expanded.png', pdf.GetX+3*(issue.outline_level-1)+0.5, pdf.GetY+2, 3, 3) unless issue.edge
47
      pdf.Cell(3*issue.outline_level+1,row_height,'',0)
45 48
	   	pdf.MultiCell(0, row_height, (@project == issue.project ? issue.subject : "#{issue.project.name} - #{issue.subject}"))
46 49
   		pdf.Line(10, pdf.GetY, 287, pdf.GetY)
47 50
   		pdf.SetY(pdf.GetY() + 1)
app/views/issues/_pdf.rfpdf (???R?s?[)
7 7
    pdf.SetFontStyle('B',9)
8 8
    pdf.Cell(35,5, l(:field_status) + ":","LT")
9 9
    pdf.SetFontStyle('',9)
10
    pdf.Cell(60,5, issue.status.name,"RT")
10
    pdf.Cell(60,5, issue.total('status').name,"RT")
11 11
    pdf.SetFontStyle('B',9)
12 12
    pdf.Cell(35,5, l(:field_priority) + ":","LT")
13 13
    pdf.SetFontStyle('',9)
14
    pdf.Cell(60,5, issue.priority.name,"RT")        
14
    pdf.Cell(60,5, issue.total('priority').name,"RT")        
15 15
    pdf.Ln
16 16
    
17 17
    pdf.SetFontStyle('B',9)
......
41 41
    pdf.SetFontStyle('B',9)
42 42
    pdf.Cell(35,5, l(:field_due_date) + ":","LB")
43 43
    pdf.SetFontStyle('',9)
44
    pdf.Cell(60,5, format_date(issue.due_date),"RB")
44
    pdf.Cell(60,5, format_date(issue.total('due_date')),"RB")
45 45
    pdf.Ln
46 46
    
47 47
	for custom_value in issue.custom_values
app/views/issues/_list_simple.rhtml (???R?s?[)
11 11
			<td class="id">
12 12
				<%= link_to issue.id, :controller => 'issues', :action => 'show', :id => issue %>
13 13
			</td>
14
			<td><%=h issue.project.name %> - <%= issue.tracker.name %><br />
15
                <%= issue.status.name %> - <%= format_time(issue.updated_on) %></td>
14
			<td><%=h issue.total('project').name %> - <%= issue.tracker.name %><br />
15
                <%= issue.total('status').name %> - <%= format_time(issue.updated_on) %></td>
16 16
			<td class="subject">
17 17
                <%= link_to h(issue.subject), :controller => 'issues', :action => 'show', :id => issue %>
18 18
            </td>
lang/ro.yml (???R?s?[)
115 115
field_due_date: Data finalizarii 
116 116
field_assigned_to: Atribuit pentru
117 117
field_priority: Prioritate
118
field_outline: Outline
118 119
field_fixed_version: Versiune rezolvata 
119 120
field_user: Utilizator
120 121
field_role: Rol
......
390 391
label_blocked_by: blocat de
391 392
label_precedes: precedes
392 393
label_follows: follows
394
label_parents: parents
395
label_children: children
393 396
label_end_to_start: de la sfarsit la capat
394 397
label_end_to_end: de la sfarsit la sfarsit
395 398
label_start_to_start: de la capat la capat
lang/zh.yml (???R?s?[)
118 118
field_due_date: 到期日
119 119
field_assigned_to: 指派
120 120
field_priority: 优先级
121
field_outline: Outline
121 122
field_fixed_version: 修订版本
122 123
field_user: 用户
123 124
field_role: 角色
......
394 395
label_blocked_by: blocked by
395 396
label_precedes: precedes
396 397
label_follows: follows
398
label_parents: parents
399
label_children: children
397 400
label_end_to_start: end to start
398 401
label_end_to_end: end to end
399 402
label_start_to_start: start to start
lang/pt.yml (???R?s?[)
115 115
field_due_date: Data final
116 116
field_assigned_to: Atribuído para
117 117
field_priority: Prioridade
118
field_outline: Outline
118 119
field_fixed_version: Versão corrigida
119 120
field_user: Usuário
120 121
field_role: Regra
......
392 393
label_blocked_by: bloqueado por
393 394
label_precedes: procede
394 395
label_follows: segue
396
label_parents: parents
397
label_children: children
395 398
label_end_to_start: fim ao início
396 399
label_end_to_end: fim ao fim
397 400
label_start_to_start: ínícia ao inícia
lang/pt-br.yml (???R?s?[)
115 115
field_due_date: Data devida
116 116
field_assigned_to: Atribuido para
117 117
field_priority: Prioridade
118
field_outline: Outline
118 119
field_fixed_version: Versao corrigida
119 120
field_user: Usuario
120 121
field_role: Regra
......
392 393
label_blocked_by: blocked by
393 394
label_precedes: precedes
394 395
label_follows: follows
396
label_parents: parents
397
label_children: children
395 398
label_end_to_start: end to start
396 399
label_end_to_end: end to end
397 400
label_start_to_start: start to start
lang/sr.yml (???R?s?[)
119 119
field_due_date: Do datuma
120 120
field_assigned_to: Dodeljeno
121 121
field_priority: Prioritet
122
field_outline: Outline
122 123
field_fixed_version: Ispravljena verzija
123 124
field_user: Korisnik
124 125
field_role: Uloga
......
402 403
label_blocked_by: blokiran od strane
403 404
label_precedes: prethodi
404 405
label_follows: sledi
406
label_parents: parents
407
label_children: children
405 408
label_end_to_start: od kraja do početka
406 409
label_end_to_end: od kraja do kraja
407 410
label_start_to_start: od početka do pocetka
lang/ru.yml (???R?s?[)
119 119
field_due_date: Дата выполнения
120 120
field_assigned_to: Назначена
121 121
field_priority: Приоритет
122
field_outline: Outline
122 123
field_fixed_version: Фиксированная версия
123 124
field_user: Пользователь
124 125
field_role: Роль
......
404 405
label_blocked_by: заблокировано 
405 406
label_precedes: предшествует
406 407
label_follows: следующий
408
label_parents: parents
409
label_children: children
407 410
label_end_to_start: с конца к началу
408 411
label_end_to_end: с конца к концу
409 412
label_start_to_start: с начала к началу
lang/de.yml (???R?s?[)
115 115
field_due_date: Abgabedatum
116 116
field_assigned_to: Zugewiesen an
117 117
field_priority: Priorität
118
field_outline: Outline
118 119
field_fixed_version: Erledigt in Version
119 120
field_user: Benutzer
120 121
field_role: Rolle
......
392 393
label_blocked_by: Blockiert durch
393 394
label_precedes: Vorgänger von
394 395
label_follows: folgt
396
label_parents: parents
397
label_children: children
395 398
label_end_to_start: Ende - Anfang
396 399
label_end_to_end: Ende - Ende
397 400
label_start_to_start: Anfang - Anfang
lang/bg.yml (???R?s?[)
115 115
field_due_date: Крайна дата
116 116
field_assigned_to: Възложена на
117 117
field_priority: Приоритет
118
field_outline: Outline
118 119
field_fixed_version: Версия
119 120
field_user: Потребител
120 121
field_role: Роля
......
392 393
label_blocked_by: блокирана от
393 394
label_precedes: предшества
394 395
label_follows: изпълнява се след
396
label_parents: parents
397
label_children: children
395 398
label_end_to_start: end to start
396 399
label_end_to_end: end to end
397 400
label_start_to_start: start to start
lang/sv.yml (???R?s?[)
115 115
field_due_date: Färdigdatum
116 116
field_assigned_to: Tilldelad
117 117
field_priority: Prioritet
118
field_outline: Outline
118 119
field_fixed_version: Fixed version
119 120
field_user: Användare
120 121
field_role: Roll
......
392 393
label_blocked_by: blocked by
393 394
label_precedes: precedes
394 395
label_follows: follows
396
label_parents: parents
397
label_children: children
395 398
label_end_to_start: end to start
396 399
label_end_to_end: end to end
397 400
label_start_to_start: start to start
lang/ja.yml (???R?s?[)
116 116
field_due_date: 期限日
117 117
field_assigned_to: 担当者
118 118
field_priority: 優先度
119
field_outline: アウトライン
119 120
field_fixed_version: 修正されたバージョン
120 121
field_user: ユーザ
121 122
field_role: 役割
......
393 394
label_blocked_by: ブロックされている
394 395
label_precedes: 先行する
395 396
label_follows: 後続する
397
label_parents: 親
398
label_children: 子
396 399
label_end_to_start: end to start
397 400
label_end_to_end: end to end
398 401
label_start_to_start: start to start
lang/he.yml (???R?s?[)
117 117
field_due_date: תאריך סיום
118 118
field_assigned_to: מוצב ל
119 119
field_priority: עדיפות
120
field_outline: Outline
120 121
field_fixed_version: גירסא מקובעת
121 122
field_user: מתשמש
122 123
field_role: תפקיד
......
397 398
label_blocked_by: חסום ע"י
398 399
label_precedes: מקדים את
399 400
label_follows: עוקב אחרי
401
label_parents: parents
402
label_children: children
400 403
label_end_to_start: מהתחלה לסוף
401 404
label_end_to_end: מהסוף לסוף
402 405
label_start_to_start: מהתחלה להתחלה
lang/en.yml (???R?s?[)
122 122
field_due_date: Due date
123 123
field_assigned_to: Assigned to
124 124
field_priority: Priority
125
field_outline: Outline
125 126
field_fixed_version: Fixed version
126 127
field_user: User
127 128
field_role: Role
......
411 412
label_blocked_by: blocked by
412 413
label_precedes: precedes
413 414
label_follows: follows
415
label_parents: parents
416
label_children: children
414 417
label_end_to_start: end to start
415 418
label_end_to_end: end to end
416 419
label_start_to_start: start to start
lang/cs.yml (???R?s?[)
115 115
field_due_date: Po lhůtě
116 116
field_assigned_to: Přiřazeno
117 117
field_priority: Priorita
118
field_outline: Outline
118 119
field_fixed_version: Pevná verze
119 120
field_user: Uživatel
120 121
field_role: Role
......
390 391
label_blocked_by: zamčeno
391 392
label_precedes: předchází
392 393
label_follows: následuje
394
label_parents: parents
395
label_children: children
393 396
label_end_to_start: od konce do začátku
394 397
label_end_to_end: od konce do konce
395 398
label_start_to_start: od začátku do začátku
lang/fr.yml (???R?s?[)
122 122
field_due_date: Date d'échéance
123 123
field_assigned_to: Assigné à
124 124
field_priority: Priorité
125
field_outline: Outline
125 126
field_fixed_version: Version corrigée
126 127
field_user: Utilisateur
127 128
field_role: Rôle
......
411 412
label_blocked_by: bloqué par
412 413
label_precedes: précède
413 414
label_follows: suit
415
label_parents: parents
416
label_children: children
414 417
label_end_to_start: fin à début
415 418
label_end_to_end: fin à fin
416 419
label_start_to_start: début à début
lang/es.yml (???R?s?[)
112 112
field_due_date: Fecha fin
113 113
field_assigned_to: Asignado a
114 114
field_priority: Prioridad
115
field_outline: Outline
115 116
field_fixed_version: Versión corregida
116 117
field_user: Usuario
117 118
field_role: Perfil
......
383 384
label_blocked_by: bloqueado por
384 385
label_precedes: anteriores
385 386
label_follows: siguientes
387
label_parents: parents
388
label_children: children
386 389
label_end_to_start: fin a principio
387 390
label_end_to_end: fin a fin
388 391
label_start_to_start: principio a principio
lang/nl.yml (???R?s?[)
115 115
field_due_date: Verwachte datum gereed
116 116
field_assigned_to: Toegewezen aan
117 117
field_priority: Prioriteit
118
field_outline: Outline
118 119
field_fixed_version: Opgeloste versie
119 120
field_user: Gebruiker
120 121
field_role: Rol
......
392 393
label_blocked_by: geblokkeerd door
393 394
label_precedes: gaat vooraf aan
394 395
label_follows: volgt op
396
label_parents: parents
397
label_children: children
395 398
label_end_to_start: eind tot start
396 399
label_end_to_end: eind tot eind
397 400
label_start_to_start: start tot start
lang/ko.yml (???R?s?[)
117 117
field_due_date: 완료 기한
118 118
field_assigned_to: 담당자
119 119
field_priority: 심각도
120
field_outline: Outline
120 121
field_fixed_version: 고쳐진 버전
121 122
field_user: 유저
122 123
field_role: 역할
......
399 400
label_blocked_by: blocked by
400 401
label_precedes: precedes
401 402
label_follows: follows
403
label_parents: parents
404
label_children: children
402 405
label_end_to_start: end to start
403 406
label_end_to_end: end to end
404 407
label_start_to_start: start to start
lang/zh-tw.yml (???R?s?[)
122 122
field_due_date: 完成日期
123 123
field_assigned_to: 分派給
124 124
field_priority: 重要性
125
field_outline: Outline
125 126
field_fixed_version: 版本
126 127
field_user: 用戶
127 128
field_role: 角色
......
410 411
label_blocked_by: 被阻擋
411 412
label_precedes: 優先於
412 413
label_follows: 跟隨於
414
label_parents: parents
415
label_children: children
413 416
label_end_to_start: end to start
414 417
label_end_to_end: end to end
415 418
label_start_to_start: start to start
lang/pl.yml (???R?s?[)
112 112
field_due_date: Data oddania
113 113
field_assigned_to: Przydzielony do
114 114
field_priority: Priorytet
115
field_outline: Outline
115 116
field_fixed_version: Wersja
116 117
field_user: Użytkownik
117 118
field_role: Rola
......
383 384
label_blocked_by: zablokowane przez
384 385
label_precedes: poprzedza
385 386
label_follows: podąża
387
label_parents: parents
388
label_children: children
386 389
label_end_to_start: koniec do początku
387 390
label_end_to_end: koniec do końca
388 391
label_start_to_start: początek do początku
lang/it.yml (???R?s?[)
115 115
field_due_date: Data ultima
116 116
field_assigned_to: Assegnato a
117 117
field_priority: Priorita'
118
field_outline: Outline
118 119
field_fixed_version: Versione di fix
119 120
field_user: Utente
120 121
field_role: Ruolo
......
392 393
label_blocked_by: blocked by
393 394
label_precedes: precedes
394 395
label_follows: follows
396
label_parents: parents
397
label_children: children
395 398
label_end_to_start: end to start
396 399
label_end_to_end: end to end
397 400
label_start_to_start: start to start