Project

General

Profile

Patch #214 » code_id.diff

Ted Wise, 2008-02-03 11:00

View differences:

app/controllers/issues_controller.rb (working copy)
def find_project
@issue = Issue.find(params[:id], :include => [:project, :tracker, :status, :author, :priority, :category])
@project = @issue.project
@html_title = "#{@project.name} - #{@issue.tracker.name} ##{@issue.id}"
@html_title = "#{@project.name} - #{@issue.tracker.name} #{@issue.code_id}"
rescue ActiveRecord::RecordNotFound
render_404
end
app/controllers/projects_controller.rb (working copy)
csv << headers.collect {|c| ic.iconv(c) }
# csv lines
@issues.each do |issue|
fields = [issue.id, issue.status.name,
fields = [issue.code_id, issue.status.name,
issue.tracker.name,
issue.priority.name,
issue.subject,
app/controllers/timelog_controller.rb (working copy)
fields = [l_date(entry.spent_on),
entry.user.name,
entry.activity.name,
(entry.issue ? entry.issue.id : nil),
(entry.issue ? entry.issue.code_id : nil),
entry.hours,
entry.comment
]
app/models/issue.rb (working copy)
def long_id
"%05d" % self.id
end
def code_id
"#{self.project.code}-#{self.id}"
end
def custom_value_for(custom_field)
self.custom_values.each {|v| return v if v.custom_field_id == custom_field.id }
app/models/mailer.rb (working copy)
# Sends to all project members
@recipients = issue.project.members.collect { |m| m.user.mail if m.user.mail_notification }.compact
@from = Setting.mail_from
@subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] #{issue.status.name} - #{issue.subject}"
@subject = "[#{issue.project.name} - #{issue.tracker.name} #{issue.code_id}] #{issue.status.name} - #{issue.subject}"
@body['issue'] = issue
end
......
issue = journal.journalized
@recipients = issue.project.members.collect { |m| m.user.mail if m.user.mail_notification }.compact
@from = Setting.mail_from
@subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] #{issue.status.name} - #{issue.subject}"
@subject = "[#{issue.project.name} - #{issue.tracker.name} #{issue.code_id}] #{issue.status.name} - #{issue.subject}"
@body['issue'] = issue
@body['journal']= journal
end
......
added_to = "#{l(:label_document)}: #{container.title}"
when 'Issue'
url << "issues/show/#{container.id}"
added_to = "#{container.tracker.name} ##{container.id}: #{container.subject}"
added_to = "#{container.tracker.name} #{container.code_id}: #{container.subject}"
end
@recipients = container.project.users.collect { |u| u.mail if u.mail_notification }.compact
@from = Setting.mail_from
app/models/project.rb (working copy)
has_and_belongs_to_many :custom_fields, :class_name => 'IssueCustomField', :join_table => "#{table_name_prefix}custom_fields_projects#{table_name_suffix}", :association_foreign_key => 'custom_field_id'
acts_as_tree :order => "name", :counter_cache => true
validates_presence_of :name, :description
validates_uniqueness_of :name
validates_presence_of :name, :description, :code
validates_uniqueness_of :name, :code
validates_associated :custom_values, :on => :update
validates_associated :repository, :wiki
validates_format_of :name, :with => /^[\w\s\'\-]*$/i
app/views/admin/projects.rhtml (working copy)
<tbody>
<% for project in @projects %>
<tr class="<%= cycle("odd", "even") %>">
<td><%= link_to project.name, :controller => 'projects', :action => 'settings', :id => project %>
<td><%= link_to "#{project.name} (#{project.code})", :controller => 'projects', :action => 'settings', :id => project %>
<td><%=h project.description %>
<td align="center"><%= image_tag 'true.png' if project.is_public? %>
<td align="center"><%= project.children.size %>
app/views/feeds/history.rxml (working copy)
@journals.each do |journal|
issue = journal.issue
xml.item do
xml.title "#{issue.project.name} - #{issue.tracker.name} ##{issue.id}: #{issue.subject}"
xml.title "#{issue.project.name} - #{issue.tracker.name} #{issue.code_id}: #{issue.subject}"
url = url_for(:controller => 'issues' , :action => 'show', :id => issue, :only_path => false)
xml.link url
xml.description do
app/views/feeds/history_atom.rxml (working copy)
@journals.each do |journal|
issue = journal.issue
xml.entry do
xml.title "#{issue.project.name} - #{issue.tracker.name} ##{issue.id}: #{issue.subject}"
xml.title "#{issue.project.name} - #{issue.tracker.name} #{issue.code_id}: #{issue.subject}"
xml.link "rel" => "alternate", "href" => url_for(:controller => 'issues' , :action => 'show', :id => issue, :only_path => false)
xml.id url_for(:controller => 'issues' , :action => 'show', :id => issue, :only_path => false)
xml.updated CGI.rfc1123_date(journal.created_on)
app/views/feeds/issues.rxml (working copy)
xml.description l(:label_reported_issues)
@issues.each do |issue|
xml.item do
xml.title "#{issue.project.name} - #{issue.tracker.name} ##{issue.id}: #{issue.subject}"
xml.title "#{issue.project.name} - #{issue.tracker.name} #{issue.code_id}: #{issue.subject}"
url = url_for(:controller => 'issues' , :action => 'show', :id => issue, :only_path => false)
xml.link url
xml.description h(issue.description)
app/views/feeds/issues_atom.rxml (working copy)
xml.author { xml.name "#{Setting.app_title}" }
@issues.each do |issue|
xml.entry do
xml.title "#{issue.project.name} - #{issue.tracker.name} ##{issue.id}: #{issue.subject}"
xml.title "#{issue.project.name} - #{issue.tracker.name} #{issue.code_id}: #{issue.subject}"
xml.link "rel" => "alternate", "href" => url_for(:controller => 'issues' , :action => 'show', :id => issue, :only_path => false)
xml.id url_for(:controller => 'issues' , :action => 'show', :id => issue, :only_path => false)
xml.updated CGI.rfc1123_date(issue.updated_on)
app/views/issues/_list_simple.rhtml (working copy)
<% for issue in issues %>
<tr class="<%= cycle("odd", "even") %>">
<th align="center">
<%= link_to issue.id, :controller => 'issues', :action => 'show', :id => issue %>
<%= link_to issue.code_id, :controller => 'issues', :action => 'show', :id => issue %>
</th>
<td><p class="small"><%= issue.project.name %> - <%= issue.tracker.name %><br />
<%= issue.status.name %> - <%= format_time(issue.updated_on) %></p></td>
app/views/issues/_pdf.rfpdf (working copy)
<% pdf.SetFontStyle('B',11)
pdf.Cell(190,10, "#{issue.project.name} - #{issue.tracker.name} # #{issue.long_id} - #{issue.subject}")
pdf.Cell(190,10, "#{issue.project.name} - #{issue.tracker.name} #{issue.code_id} - #{issue.subject}")
pdf.Ln
y0 = pdf.GetY
app/views/issues/_tooltip.rhtml (working copy)
<%= link_to "#{issue.tracker.name} ##{issue.id}", { :controller => 'issues', :action => 'show', :id => issue } %></strong>: <%=h issue.subject %><br />
<%= link_to "#{issue.tracker.name} #{issue.code_id}", { :controller => 'issues', :action => 'show', :id => issue } %></strong>: <%=h issue.subject %><br />
<br />
<strong><%= l(:field_start_date) %></strong>: <%= format_date(issue.start_date) %><br />
<strong><%= l(:field_due_date) %></strong>: <%= format_date(issue.due_date) %><br />
app/views/issues/change_status.rhtml (working copy)
<h2><%=l(:label_issue)%> #<%= @issue.id %>: <%=h @issue.subject %></h2>
<h2><%=l(:label_issue)%> #<%= @issue.code_id %>: <%=h @issue.subject %></h2>
<%= error_messages_for 'issue' %>
<% form_tag({:action => 'change_status', :id => @issue}, :class => "tabular") do %>
app/views/issues/edit.rhtml (working copy)
<h2><%= @issue.tracker.name %> #<%= @issue.id %> - <%=h @issue.subject %></h2>
<h2><%= @issue.tracker.name %> #<%= @issue.code_id %> - <%=h @issue.subject %></h2>
<% labelled_tabular_form_for :issue, @issue, :url => {:action => 'edit'} do |f| %>
<%= error_messages_for 'issue' %>
app/views/issues/export_pdf.rfpdf (working copy)
<% pdf=IfpdfHelper::IFPDF.new(current_language)
pdf.SetTitle("#{@project.name} - ##{@issue.tracker.name} #{@issue.id}")
pdf.SetTitle("#{@project.name} - ##{@issue.tracker.name} #{@issue.code_id}")
pdf.AliasNbPages
pdf.footer_date = format_date(Date.today)
pdf.AddPage
app/views/issues/show.rhtml (working copy)
<%= l(:label_export_to) %><%= link_to 'PDF', {:action => 'export_pdf', :id => @issue}, :class => 'icon icon-pdf' %>
</div>
<h2><%= @issue.tracker.name %> #<%= @issue.id %> - <%=h @issue.subject %></h2>
<h2><%= @issue.tracker.name %> <%= @issue.code_id %> - <%=h @issue.subject %></h2>
<div class="box">
<table width="100%">
app/views/mailer/_issue.rhtml (working copy)
<%=l(:label_issue)%> #<%= issue.id %> - <%= issue.subject %>
<%=l(:label_issue)%> <%= issue.code_id %> - <%= issue.subject %>
<%=l(:field_author)%>: <%= issue.author.display_name %>
<%=l(:field_status)%>: <%= issue.status.name %>
app/views/mailer/issue_add_de.rhtml (working copy)
Ticket Nr. #<%= @issue.id %> wurde erstellt.
Ticket Nr. #<%= @issue.code_id %> wurde erstellt.
----------------------------------------
<%= render :file => "_issue", :use_full_path => true, :locals => { :issue => @issue } %>
app/views/mailer/issue_add_en.rhtml (working copy)
Issue #<%= @issue.id %> has been reported.
Issue #<%= @issue.code_id %> has been reported.
----------------------------------------
<%= render :file => "_issue", :use_full_path => true, :locals => { :issue => @issue } %>
app/views/mailer/issue_add_es.rhtml (working copy)
Issue #<%= @issue.id %> has been reported.
Issue #<%= @issue.code_id %> has been reported.
----------------------------------------
<%= render :file => "_issue", :use_full_path => true, :locals => { :issue => @issue } %>
app/views/mailer/issue_add_fr.rhtml (working copy)
Une nouvelle demande (#<%= @issue.id %>) a été soumise.
Une nouvelle demande (#<%= @issue.code_id %>) a été soumise.
----------------------------------------
<%= render :file => "_issue", :use_full_path => true, :locals => { :issue => @issue } %>
app/views/mailer/issue_add_it.rhtml (working copy)
E' stata segnalata l'anomalia #<%= @issue.id %>.
E' stata segnalata l'anomalia #<%= @issue.code_id %>.
----------------------------------------
<%= render :file => "_issue", :use_full_path => true, :locals => { :issue => @issue } %>
app/views/mailer/issue_add_ja.rhtml (working copy)
問題 #<%= @issue.id %> が報告されました。
問題 #<%= @issue.code_id %> が報告されました。
----------------------------------------
<%= render :file => "_issue", :use_full_path => true, :locals => { :issue => @issue } %>
app/views/mailer/issue_edit_de.rhtml (working copy)
Ticket #<%= @issue.id %> wurde aktualisiert.
Ticket #<%= @issue.code_id %> wurde aktualisiert.
<%= @journal.user.name %>
<% for detail in @journal.details %>
<%= show_detail(detail, true) %>
app/views/mailer/issue_edit_en.rhtml (working copy)
Issue #<%= @issue.id %> has been updated.
Issue #<%= @issue.code_id %> has been updated.
<%= @journal.user.name %>
<% for detail in @journal.details %>
<%= show_detail(detail, true) %>
app/views/mailer/issue_edit_es.rhtml (working copy)
Issue #<%= @issue.id %> has been updated.
Issue #<%= @issue.code_id %> has been updated.
<%= @journal.user.name %>
<% for detail in @journal.details %>
<%= show_detail(detail, true) %>
app/views/mailer/issue_edit_fr.rhtml (working copy)
La demande #<%= @issue.id %> a été mise à jour.
La demande #<%= @issue.code_id %> a été mise à jour.
<%= @journal.user.name %>
<% for detail in @journal.details %>
<%= show_detail(detail, true) %>
app/views/mailer/issue_edit_it.rhtml (working copy)
L'anomalia #<%= @issue.id %> e' stata aggiornata.
L'anomalia #<%= @issue.code_id %> e' stata aggiornata.
<%= @journal.user.name %>
<% for detail in @journal.details %>
<%= show_detail(detail, true) %>
app/views/mailer/issue_edit_ja.rhtml (working copy)
問題 #<%= @issue.id %> が更新されました。
問題 #<%= @issue.code_id %> が更新されました。
<%= @journal.user.name %>
<% for detail in @journal.details %>
<%= show_detail(detail, true) %>
app/views/my/blocks/_calendar.rhtml (working copy)
elsif day == i.due_date
image_tag('arrow_to.png')
end %>
<small><%= link_to "#{i.tracker.name} ##{i.id}", :controller => 'issues', :action => 'show', :id => i %>: <%=h i.subject.sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)') %></small><br />
<small><%= link_to "#{i.tracker.name} #{i.code_id}", :controller => 'issues', :action => 'show', :id => i %>: <%=h i.subject.sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)') %></small><br />
<% end %>
</td>
<%= '</tr><tr height="100">' if day.cwday >= 7 and day!=@date_to %>
app/views/projects/_form.rhtml (working copy)
<div class="box">
<!--[form:project]-->
<p><%= f.text_field :name, :required => true %></p>
<p><%= f.text_field :code, :size => 10, :required => true %></p>
<% if admin_loggedin? and !@root_projects.empty? %>
<p><%= f.select :parent_id, (@root_projects.collect {|p| [p.name, p.id]}), { :include_blank => true } %></p>
app/views/projects/activity.rhtml (working copy)
<% @events_by_day[day].sort {|x,y| y.created_on <=> x.created_on }.each do |e| %>
<li><p>
<% if e.is_a? Issue %>
<%= e.created_on.strftime("%H:%M") %> <%= link_to "#{e.tracker.name} ##{e.id}", :controller => 'issues', :action => 'show', :id => e %> (<%= e.status.name %>): <%=h e.subject %><br />
<%= e.created_on.strftime("%H:%M") %> <%= link_to "#{e.tracker.name} #{e.code_id}", :controller => 'issues', :action => 'show', :id => e %> (<%= e.status.name %>): <%=h e.subject %><br />
<i><%= e.author.name %></i>
<% elsif e.is_a? News %>
<%= e.created_on.strftime("%H:%M") %> <%=l(:label_news)%>: <%= link_to h(e.title), :controller => 'news', :action => 'show', :id => e %><br />
app/views/projects/calendar.rhtml (working copy)
elsif day == i.due_date
image_tag('arrow_to.png')
end %>
<small><%= link_to "#{i.tracker.name} ##{i.id}", { :controller => 'issues', :action => 'show', :id => i } %>: <%=h i.subject.sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)') %></small>
<small><%= link_to "#{i.tracker.name} #{i.code_id}", { :controller => 'issues', :action => 'show', :id => i } %>: <%=h i.subject.sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)') %></small>
<span class="tip">
<%= render :partial => "issues/tooltip", :locals => { :issue => i }%>
</span>
app/views/projects/changelog.rhtml (working copy)
<ul>
<% ver_id = issue.fixed_version_id
end %>
<li><%= link_to "#{issue.tracker.name} #{issue.id}", :controller => 'issues', :action => 'show', :id => issue %>: <%=h issue.subject %></li>
<li><%= link_to "#{issue.tracker.name} #{issue.code_id}", :controller => 'issues', :action => 'show', :id => issue %>: <%=h issue.subject %></li>
<% end %>
</div>
app/views/projects/export_issues_pdf.rfpdf (working copy)
pdf.SetFontStyle('',9)
pdf.SetFillColor(255, 255, 255)
@issues.each do |issue|
pdf.Cell(15, row_height, issue.id.to_s, 0, 0, 'L', 1)
pdf.Cell(15, row_height, issue.code_id, 0, 0, 'L', 1)
pdf.Cell(30, row_height, issue.tracker.name, 0, 0, 'L', 1)
pdf.Cell(30, row_height, issue.status.name, 0, 0, 'L', 1)
pdf.Cell(30, row_height, issue.priority.name, 0, 0, 'L', 1)
app/views/projects/gantt.rhtml (working copy)
top = headers_heigth + 8
@issues.each do |i| %>
<div style="position: absolute;line-height:1.2em;height:16px;top:<%= top %>px;left:4px;overflow:hidden;">
<small><%= link_to "#{i.tracker.name} ##{i.id}", { :controller => 'issues', :action => 'show', :id => i }, :title => "#{i.subject}" %>:
<small><%= link_to "#{i.tracker.name} #{i.code_id}", { :controller => 'issues', :action => 'show', :id => i }, :title => "#{i.subject}" %>:
<%=h i.subject.sub(/^(.{30}[^\s]*\s).*$/, '\1 (...)') %></small>
</div>
<% top = top + 20
app/views/projects/list.rhtml (working copy)
<tbody>
<% for project in @projects %>
<tr class="<%= cycle("odd", "even") %>">
<td><%= link_to project.name, :action => 'show', :id => project %></td>
<td><%= link_to "#{project.name} (#{project.code})", :action => 'show', :id => project %></td>
<td><%=h project.description %></td>
<td align="center"><%= format_date(project.created_on) %></td>
</tr>
app/views/projects/list_issues.rhtml (working copy)
<% for issue in @issues %>
<tr class="<%= cycle("odd", "even") %>">
<th style="width:15px;"><%= check_box_tag "issue_ids[]", issue.id, false, :id => "issue_#{issue.id}" %></th>
<td align="center"><%= link_to issue.id, :controller => 'issues', :action => 'show', :id => issue %></td>
<td align="center"><%= link_to issue.code_id, :controller => 'issues', :action => 'show', :id => issue %></td>
<td align="center"><%= issue.tracker.name %></td>
<td><div class="square" style="background:#<%= issue.status.html_color %>;"></div> <%= issue.status.name %></td>
<td align="center"><%= issue.priority.name %></td>
app/views/projects/roadmap.rhtml (working copy)
<% else %>
<% issues.each do |issue| %>
<li>
<%= link = link_to("#{issue.tracker.name} ##{issue.id}", :controller => 'issues', :action => 'show', :id => issue)
<%= link = link_to("#{issue.tracker.name} #{issue.code_id}", :controller => 'issues', :action => 'show', :id => issue)
issue.status.is_closed? ? content_tag("del", link) : link %>
: <%=h issue.subject %>
<%= content_tag "em", "(#{l(:label_closed_issues)})" if issue.status.is_closed? %>
app/views/projects/search.rhtml (working copy)
<% @results.each do |e| %>
<li><p>
<% if e.is_a? Issue %>
<%= link_to "#{e.tracker.name} ##{e.id}", :controller => 'issues', :action => 'show', :id => e %>: <%= highlight_tokens(h(e.subject), @tokens) %><br />
<%= link_to "#{e.tracker.name} #{e.code_id}", :controller => 'issues', :action => 'show', :id => e %>: <%= highlight_tokens(h(e.subject), @tokens) %><br />
<%= highlight_tokens(e.description, @tokens) %><br />
<i><%= e.author.name %>, <%= format_time(e.created_on) %></i>
<% elsif e.is_a? News %>
app/views/timelog/details.rhtml (working copy)
<h2><%= l(:label_spent_time) %></h2>
<h3><%= link_to(@project.name, {:action => 'details', :project_id => @project}) if @project %>
<%= "/ " + link_to("#{@issue.tracker.name} ##{@issue.id}", {:action => 'details', :issue_id => @issue }) + ": #{h(@issue.subject)}" if @issue %></h3>
<%= "/ " + link_to("#{@issue.tracker.name} #{@issue.code_id}", {:action => 'details', :issue_id => @issue }) + ": #{h(@issue.subject)}" if @issue %></h3>
<h3 class="textright"><%= l(:label_total) %>: <%= lwr(:label_f_hour, @total_hours) %></h3>
......
<td align="center">
<% if entry.issue %>
<div class="tooltip">
<%= link_to "#{entry.issue.tracker.name} ##{entry.issue.id}", {:action => 'details', :issue_id => entry.issue } %>
<%= link_to "#{entry.issue.tracker.name} #{entry.issue.code_id}", {:action => 'details', :issue_id => entry.issue } %>
<span class="tip">
<%= render :partial => "issues/tooltip", :locals => { :issue => entry.issue }%>
</span>
app/views/timelog/edit.rhtml (working copy)
<%= error_messages_for 'time_entry' %>
<div class="box">
<p><%= f.text_field :issue_id, :size => 6 %> <em><%= h("#{@time_entry.issue.tracker.name} ##{@time_entry.issue.id}: #{@time_entry.issue.subject}") if @time_entry.issue %></em></p>
<p><%= f.text_field :issue_id, :size => 6 %> <em><%= h("#{@time_entry.issue.tracker.name} #{@time_entry.issue.code_id}: #{@time_entry.issue.subject}") if @time_entry.issue %></em></p>
<p><%= f.text_field :spent_on, :size => 10, :required => true %><%= calendar_for('time_entry_spent_on') %></p>
<p><%= f.text_field :hours, :size => 6, :required => true %></p>
<p><%= f.text_field :comment, :size => 100 %></p>
config/database.yml (working copy)
adapter: mysql
database: redmine_development
host: localhost
username: root
password:
username: redmine
password: redmine
test:
adapter: mysql
db/migrate/037_add_project_code.rb (revision 0)
class AddProjectCode < ActiveRecord::Migration
def self.up
add_column :projects, :code, :string, :length => 10, :null => false
add_index :projects, :code, :unique => true, :name => :projects_code
end
def self.down
remove_column :projects, :code
end
end
lang/en.yml (working copy)
gui_validation_error_plural: %d errors
field_name: Name
field_code: Code
field_description: Description
field_summary: Summary
field_is_required: Required
    (1-1/1)