Compare commits

..
1 Commits
Author SHA1 Message Date
Jean-Philippe Lang 908dcc4eb4 tagged version 0.8.2
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/tags/0.8.2@2570 e93f8b46-1217-0410-a6f0-8f06a7374b81
2009-03-08 14:33:29 +00:00
47 changed files with 85 additions and 237 deletions
-1
View File
@@ -63,7 +63,6 @@ class AccountController < ApplicationController
token = Token.create(:user => user, :action => 'autologin') token = Token.create(:user => user, :action => 'autologin')
cookies[:autologin] = { :value => token.value, :expires => 1.year.from_now } cookies[:autologin] = { :value => token.value, :expires => 1.year.from_now }
end end
call_hook(:controller_account_success_authentication_after, {:user => user })
redirect_back_or_default :controller => 'my', :action => 'page' redirect_back_or_default :controller => 'my', :action => 'page'
end end
end end
@@ -46,7 +46,6 @@ class CustomFieldsController < ApplicationController
end end
if request.post? and @custom_field.save if request.post? and @custom_field.save
flash[:notice] = l(:notice_successful_create) flash[:notice] = l(:notice_successful_create)
call_hook(:controller_custom_fields_new_after_save, :params => params, :custom_field => @custom_field)
redirect_to :action => 'list', :tab => @custom_field.class.name redirect_to :action => 'list', :tab => @custom_field.class.name
end end
@trackers = Tracker.find(:all, :order => 'position') @trackers = Tracker.find(:all, :order => 'position')
@@ -59,7 +58,6 @@ class CustomFieldsController < ApplicationController
@custom_field.trackers = params[:tracker_ids] ? Tracker.find(params[:tracker_ids]) : [] @custom_field.trackers = params[:tracker_ids] ? Tracker.find(params[:tracker_ids]) : []
end end
flash[:notice] = l(:notice_successful_update) flash[:notice] = l(:notice_successful_update)
call_hook(:controller_custom_fields_edit_after_save, :params => params, :custom_field => @custom_field)
redirect_to :action => 'list', :tab => @custom_field.class.name redirect_to :action => 'list', :tab => @custom_field.class.name
end end
@trackers = Tracker.find(:all, :order => 'position') @trackers = Tracker.find(:all, :order => 'position')
+3 -5
View File
@@ -23,7 +23,7 @@ class IssuesController < ApplicationController
before_filter :find_project, :only => [:new, :update_form, :preview] before_filter :find_project, :only => [:new, :update_form, :preview]
before_filter :authorize, :except => [:index, :changes, :gantt, :calendar, :preview, :update_form, :context_menu] before_filter :authorize, :except => [:index, :changes, :gantt, :calendar, :preview, :update_form, :context_menu]
before_filter :find_optional_project, :only => [:index, :changes, :gantt, :calendar] before_filter :find_optional_project, :only => [:index, :changes, :gantt, :calendar]
accept_key_auth :index, :show, :changes accept_key_auth :index, :changes
helper :journals helper :journals
helper :projects helper :projects
@@ -343,12 +343,10 @@ class IssuesController < ApplicationController
@gantt.events = events @gantt.events = events
end end
basename = (@project ? "#{@project.identifier}-" : '') + 'gantt'
respond_to do |format| respond_to do |format|
format.html { render :template => "issues/gantt.rhtml", :layout => !request.xhr? } format.html { render :template => "issues/gantt.rhtml", :layout => !request.xhr? }
format.png { send_data(@gantt.to_image, :disposition => 'inline', :type => 'image/png', :filename => "#{basename}.png") } if @gantt.respond_to?('to_image') format.png { send_data(@gantt.to_image, :disposition => 'inline', :type => 'image/png', :filename => "#{@project.identifier}-gantt.png") } if @gantt.respond_to?('to_image')
format.pdf { send_data(gantt_to_pdf(@gantt, @project), :type => 'application/pdf', :filename => "#{basename}.pdf") } format.pdf { send_data(gantt_to_pdf(@gantt, @project), :type => 'application/pdf', :filename => "#{@project.nil? ? '' : "#{@project.identifier}-" }gantt.pdf") }
end end
end end
-2
View File
@@ -38,8 +38,6 @@ module IssuesHelper
s = "issue status-#{issue.status.position} priority-#{issue.priority.position}" s = "issue status-#{issue.status.position} priority-#{issue.priority.position}"
s << ' closed' if issue.closed? s << ' closed' if issue.closed?
s << ' overdue' if issue.overdue? s << ' overdue' if issue.overdue?
s << ' created-by-me' if User.current.logged? && issue.author_id == User.current.id
s << ' assigned-to-me' if User.current.logged? && issue.assigned_to_id == User.current.id
s s
end end
+1 -7
View File
@@ -40,14 +40,8 @@ module QueriesHelper
else else
case column.name case column.name
when :subject when :subject
h((!@project.nil? && @project != issue.project) ? "#{issue.project.name} - " : '') + h((@project.nil? || @project != issue.project) ? "#{issue.project.name} - " : '') +
link_to(h(value), :controller => 'issues', :action => 'show', :id => issue) link_to(h(value), :controller => 'issues', :action => 'show', :id => issue)
when :project
link_to(h(value), :controller => 'projects', :action => 'show', :id => value)
when :assigned_to
link_to(h(value), :controller => 'account', :action => 'show', :id => value)
when :author
link_to(h(value), :controller => 'account', :action => 'show', :id => value)
when :done_ratio when :done_ratio
progress_bar(value, :width => '80px') progress_bar(value, :width => '80px')
when :fixed_version when :fixed_version
+1 -1
View File
@@ -147,7 +147,7 @@ module RepositoriesHelper
def subversion_field_tags(form, repository) def subversion_field_tags(form, repository)
content_tag('p', form.text_field(:url, :size => 60, :required => true, :disabled => (repository && !repository.root_url.blank?)) + content_tag('p', form.text_field(:url, :size => 60, :required => true, :disabled => (repository && !repository.root_url.blank?)) +
'<br />(file:///, http://, https://, svn://, svn+[tunnelscheme]://)') + '<br />(http://, https://, svn://, file:///)') +
content_tag('p', form.text_field(:login, :size => 30)) + content_tag('p', form.text_field(:login, :size => 30)) +
content_tag('p', form.password_field(:password, :size => 30, :name => 'ignore', content_tag('p', form.password_field(:password, :size => 30, :name => 'ignore',
:value => ((repository.new_record? || repository.password.blank?) ? '' : ('x'*15)), :value => ((repository.new_record? || repository.password.blank?) ? '' : ('x'*15)),
+1 -5
View File
@@ -35,11 +35,7 @@ module TimelogHelper
end end
def select_hours(data, criteria, value) def select_hours(data, criteria, value)
if value.to_s.empty? data.select {|row| row[criteria] == value}
data.select {|row| row[criteria].blank? }
else
data.select {|row| row[criteria] == value}
end
end end
def sum_hours(data) def sum_hours(data)
+11 -10
View File
@@ -33,7 +33,7 @@ class Attachment < ActiveRecord::Base
:author_key => :author_id, :author_key => :author_id,
:find_options => {:select => "#{Attachment.table_name}.*", :find_options => {:select => "#{Attachment.table_name}.*",
:joins => "LEFT JOIN #{Version.table_name} ON #{Attachment.table_name}.container_type='Version' AND #{Version.table_name}.id = #{Attachment.table_name}.container_id " + :joins => "LEFT JOIN #{Version.table_name} ON #{Attachment.table_name}.container_type='Version' AND #{Version.table_name}.id = #{Attachment.table_name}.container_id " +
"LEFT JOIN #{Project.table_name} ON #{Version.table_name}.project_id = #{Project.table_name}.id OR ( #{Attachment.table_name}.container_type='Project' AND #{Attachment.table_name}.container_id = #{Project.table_name}.id )"} "LEFT JOIN #{Project.table_name} ON #{Version.table_name}.project_id = #{Project.table_name}.id"}
acts_as_activity_provider :type => 'documents', acts_as_activity_provider :type => 'documents',
:permission => :view_documents, :permission => :view_documents,
@@ -65,20 +65,14 @@ class Attachment < ActiveRecord::Base
nil nil
end end
# Copies the temporary file to its final location # Copy temp file to its final location
# and computes its MD5 hash
def before_save def before_save
if @temp_file && (@temp_file.size > 0) if @temp_file && (@temp_file.size > 0)
logger.debug("saving '#{self.diskfile}'") logger.debug("saving '#{self.diskfile}'")
md5 = Digest::MD5.new
File.open(diskfile, "wb") do |f| File.open(diskfile, "wb") do |f|
buffer = "" f.write(@temp_file.read)
while (buffer = @temp_file.read(8192))
f.write(buffer)
md5.update(buffer)
end
end end
self.digest = md5.hexdigest self.digest = self.class.digest(diskfile)
end end
# Don't save the content type if it's longer than the authorized length # Don't save the content type if it's longer than the authorized length
if self.content_type && self.content_type.length > 255 if self.content_type && self.content_type.length > 255
@@ -147,4 +141,11 @@ private
end end
df df
end end
# Returns the MD5 digest of the file at given path
def self.digest(filename)
File.open(filename, 'rb') do |f|
Digest::MD5.hexdigest(f.read)
end
end
end end
+1 -1
View File
@@ -38,7 +38,7 @@ class Journal < ActiveRecord::Base
:conditions => "#{Journal.table_name}.journalized_type = 'Issue' AND" + :conditions => "#{Journal.table_name}.journalized_type = 'Issue' AND" +
" (#{JournalDetail.table_name}.prop_key = 'status_id' OR #{Journal.table_name}.notes <> '')"} " (#{JournalDetail.table_name}.prop_key = 'status_id' OR #{Journal.table_name}.notes <> '')"}
def save(*args) def save
# Do not save an empty journal # Do not save an empty journal
(details.empty? && notes.blank?) ? false : super (details.empty? && notes.blank?) ? false : super
end end
+1 -3
View File
@@ -207,9 +207,7 @@ class Mailer < ActionMailer::Base
# Common headers # Common headers
headers 'X-Mailer' => 'Redmine', headers 'X-Mailer' => 'Redmine',
'X-Redmine-Host' => Setting.host_name, 'X-Redmine-Host' => Setting.host_name,
'X-Redmine-Site' => Setting.app_title, 'X-Redmine-Site' => Setting.app_title
'Precedence' => 'bulk',
'Auto-Submitted' => 'auto-generated'
end end
# Appends a Redmine header field (name is prepended with 'X-Redmine-') # Appends a Redmine header field (name is prepended with 'X-Redmine-')
+1 -1
View File
@@ -24,7 +24,7 @@ class News < ActiveRecord::Base
validates_length_of :title, :maximum => 60 validates_length_of :title, :maximum => 60
validates_length_of :summary, :maximum => 255 validates_length_of :summary, :maximum => 255
acts_as_searchable :columns => ['title', 'summary', "#{table_name}.description"], :include => :project acts_as_searchable :columns => ['title', "#{table_name}.description"], :include => :project
acts_as_event :url => Proc.new {|o| {:controller => 'news', :action => 'show', :id => o.id}} acts_as_event :url => Proc.new {|o| {:controller => 'news', :action => 'show', :id => o.id}}
acts_as_activity_provider :find_options => {:include => [:project, :author]}, acts_as_activity_provider :find_options => {:include => [:project, :author]},
:author_key => :author_id :author_key => :author_id
+1 -1
View File
@@ -60,7 +60,7 @@ class Project < ActiveRecord::Base
validates_associated :repository, :wiki validates_associated :repository, :wiki
validates_length_of :name, :maximum => 30 validates_length_of :name, :maximum => 30
validates_length_of :homepage, :maximum => 255 validates_length_of :homepage, :maximum => 255
validates_length_of :identifier, :in => 1..20 validates_length_of :identifier, :in => 2..20
validates_format_of :identifier, :with => /^[a-z0-9\-]*$/ validates_format_of :identifier, :with => /^[a-z0-9\-]*$/
before_destroy :delete_all_members before_destroy :delete_all_members
+1 -5
View File
@@ -93,7 +93,6 @@ class Query < ActiveRecord::Base
cattr_reader :operators_by_filter_type cattr_reader :operators_by_filter_type
@@available_columns = [ @@available_columns = [
QueryColumn.new(:project, :sortable => "#{Project.table_name}.name"),
QueryColumn.new(:tracker, :sortable => "#{Tracker.table_name}.position"), QueryColumn.new(:tracker, :sortable => "#{Tracker.table_name}.position"),
QueryColumn.new(:status, :sortable => "#{IssueStatus.table_name}.position"), QueryColumn.new(:status, :sortable => "#{IssueStatus.table_name}.position"),
QueryColumn.new(:priority, :sortable => "#{Enumeration.table_name}.position", :default_order => 'desc'), QueryColumn.new(:priority, :sortable => "#{Enumeration.table_name}.position", :default_order => 'desc'),
@@ -235,10 +234,7 @@ class Query < ActiveRecord::Base
def columns def columns
if has_default_columns? if has_default_columns?
available_columns.select do |c| available_columns.select {|c| Setting.issue_list_default_columns.include?(c.name.to_s) }
# Adds the project column by default for cross-project lists
Setting.issue_list_default_columns.include?(c.name.to_s) || (c.name == :project && project.nil?)
end
else else
# preserve the column_names order # preserve the column_names order
column_names.collect {|name| available_columns.find {|col| col.name == name}}.compact column_names.collect {|name| available_columns.find {|col| col.name == name}}.compact
+4 -4
View File
@@ -20,7 +20,7 @@ require 'redmine/scm/adapters/subversion_adapter'
class Repository::Subversion < Repository class Repository::Subversion < Repository
attr_protected :root_url attr_protected :root_url
validates_presence_of :url validates_presence_of :url
validates_format_of :url, :with => /^(http|https|svn(\+[^\s:\/\\]+)?|file):\/\/.+/i validates_format_of :url, :with => /^(http|https|svn|svn\+ssh|file):\/\/.+/i
def scm_adapter def scm_adapter
Redmine::Scm::Adapters::SubversionAdapter Redmine::Scm::Adapters::SubversionAdapter
@@ -54,8 +54,8 @@ class Repository::Subversion < Repository
# loads changesets by batches of 200 # loads changesets by batches of 200
identifier_to = [identifier_from + 199, scm_revision].min identifier_to = [identifier_from + 199, scm_revision].min
revisions = scm.revisions('', identifier_to, identifier_from, :with_paths => true) revisions = scm.revisions('', identifier_to, identifier_from, :with_paths => true)
revisions.reverse_each do |revision| transaction do
transaction do revisions.reverse_each do |revision|
changeset = Changeset.create(:repository => self, changeset = Changeset.create(:repository => self,
:revision => revision.identifier, :revision => revision.identifier,
:committer => revision.author, :committer => revision.author,
@@ -68,7 +68,7 @@ class Repository::Subversion < Repository
:path => change[:path], :path => change[:path],
:from_path => change[:from_path], :from_path => change[:from_path],
:from_revision => change[:from_revision]) :from_revision => change[:from_revision])
end unless changeset.new_record? end
end end
end unless revisions.nil? end unless revisions.nil?
identifier_from = identifier_to + 1 identifier_from = identifier_to + 1
+4 -5
View File
@@ -15,11 +15,8 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require 'rails_generator/secret_key_generator'
class Token < ActiveRecord::Base class Token < ActiveRecord::Base
belongs_to :user belongs_to :user
validates_uniqueness_of :value
@@validity_time = 1.day @@validity_time = 1.day
@@ -39,7 +36,9 @@ class Token < ActiveRecord::Base
private private
def self.generate_token_value def self.generate_token_value
s = Rails::SecretKeyGenerator.new(object_id).generate_secret chars = ("a".."z").to_a + ("A".."Z").to_a + ("0".."9").to_a
s[0, 40] token_value = ''
40.times { |i| token_value << chars[rand(chars.size-1)] }
token_value
end end
end end
+2 -8
View File
@@ -175,14 +175,8 @@ class User < ActiveRecord::Base
end end
def self.find_by_autologin_key(key) def self.find_by_autologin_key(key)
tokens = Token.find_all_by_action_and_value('autologin', key) token = Token.find_by_action_and_value('autologin', key)
# Make sure there's only 1 token that matches the key token && (token.created_on > Setting.autologin.to_i.day.ago) && token.user.active? ? token.user : nil
if tokens.size == 1
token = tokens.first
if (token.created_on > Setting.autologin.to_i.day.ago) && token.user && token.user.active?
token.user
end
end
end end
# Makes find_by_mail case-insensitive # Makes find_by_mail case-insensitive
-1
View File
@@ -22,7 +22,6 @@ class WikiContent < ActiveRecord::Base
belongs_to :page, :class_name => 'WikiPage', :foreign_key => 'page_id' belongs_to :page, :class_name => 'WikiPage', :foreign_key => 'page_id'
belongs_to :author, :class_name => 'User', :foreign_key => 'author_id' belongs_to :author, :class_name => 'User', :foreign_key => 'author_id'
validates_presence_of :text validates_presence_of :text
validates_length_of :comments, :maximum => 255, :allow_nil => true
acts_as_versioned acts_as_versioned
class Version class Version
+1 -1
View File
@@ -11,7 +11,7 @@ while day <= calendar.enddt %>
<p class="day-num"><%= day.day %></p> <p class="day-num"><%= day.day %></p>
<% calendar.events_on(day).each do |i| %> <% calendar.events_on(day).each do |i| %>
<% if i.is_a? Issue %> <% if i.is_a? Issue %>
<div class="<%= css_issue_classes(i) %> tooltip"> <div class="tooltip">
<%= if day == i.start_date && day == i.due_date <%= if day == i.start_date && day == i.due_date
image_tag('arrow_bw.png') image_tag('arrow_bw.png')
elsif day == i.start_date elsif day == i.start_date
+2 -2
View File
@@ -1,8 +1,8 @@
xml.instruct! xml.instruct!
xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
xml.title truncate_single_line(@title, 100) xml.title truncate_single_line(@title, 100)
xml.link "rel" => "self", "href" => url_for(params.merge(:only_path => false)) xml.link "rel" => "self", "href" => url_for(params.merge({:format => nil, :only_path => false}))
xml.link "rel" => "alternate", "href" => url_for(params.merge(:only_path => false, :format => nil, :key => nil)) xml.link "rel" => "alternate", "href" => url_for(:controller => 'welcome', :only_path => false)
xml.id url_for(:controller => 'welcome', :only_path => false) xml.id url_for(:controller => 'welcome', :only_path => false)
xml.updated((@items.first ? @items.first.event_datetime : Time.now).xmlschema) xml.updated((@items.first ? @items.first.event_datetime : Time.now).xmlschema)
xml.author { xml.name "#{Setting.app_title}" } xml.author { xml.name "#{Setting.app_title}" }
-2
View File
@@ -82,7 +82,6 @@ function deleteValueField(e) {
<% end %> <% end %>
</p> </p>
<p><%= @custom_field.field_format == 'bool' ? f.check_box(:default_value) : f.text_field(:default_value) %></p> <p><%= @custom_field.field_format == 'bool' ? f.check_box(:default_value) : f.text_field(:default_value) %></p>
<%= call_hook(:view_custom_fields_form_upper_box, :custom_field => @custom_field, :form => f) %>
</div> </div>
<div class="box"> <div class="box">
@@ -110,6 +109,5 @@ when "IssueCustomField" %>
<p><%= f.check_box :is_required %></p> <p><%= f.check_box :is_required %></p>
<% end %> <% end %>
<%= call_hook(:"view_custom_fields_form_#{@custom_field.type.to_s.underscore}", :custom_field => @custom_field, :form => f) %>
</div> </div>
<%= javascript_tag "toggle_custom_field_format();" %> <%= javascript_tag "toggle_custom_field_format();" %>
+1 -3
View File
@@ -11,7 +11,5 @@
<p><label for="issue_status_is_default"><%=l(:field_is_default)%></label> <p><label for="issue_status_is_default"><%=l(:field_is_default)%></label>
<%= check_box 'issue_status', 'is_default' %></p> <%= check_box 'issue_status', 'is_default' %></p>
<%= call_hook(:view_issue_statuses_form, :issue_status => @issue_status) %>
<!--[eoform:issue_status]--> <!--[eoform:issue_status]-->
</div> </div>
+2 -2
View File
@@ -7,8 +7,8 @@
<%= call_hook(:view_issues_sidebar_issues_bottom) %> <%= call_hook(:view_issues_sidebar_issues_bottom) %>
<% planning_links = [] <% planning_links = []
planning_links << link_to(l(:label_calendar), :controller => 'issues', :action => 'calendar', :project_id => @project) if User.current.allowed_to?(:view_calendar, @project, :global => true) planning_links << link_to(l(:label_calendar), :action => 'calendar', :project_id => @project) if User.current.allowed_to?(:view_calendar, @project, :global => true)
planning_links << link_to(l(:label_gantt), :controller => 'issues', :action => 'gantt', :project_id => @project) if User.current.allowed_to?(:view_gantt, @project, :global => true) planning_links << link_to(l(:label_gantt), :action => 'gantt', :project_id => @project) if User.current.allowed_to?(:view_gantt, @project, :global => true)
%> %>
<% unless planning_links.empty? %> <% unless planning_links.empty? %>
<h3><%= l(:label_planning) %></h3> <h3><%= l(:label_planning) %></h3>
-4
View File
@@ -1,6 +1,4 @@
<ul> <ul>
<%= call_hook(:view_issues_context_menu_start, {:issues => @issues, :can => @can, :back => @back }) %>
<% if !@issue.nil? -%> <% if !@issue.nil? -%>
<li><%= context_menu_link l(:button_edit), {:controller => 'issues', :action => 'edit', :id => @issue}, <li><%= context_menu_link l(:button_edit), {:controller => 'issues', :action => 'edit', :id => @issue},
:class => 'icon-edit', :disabled => !@can[:edit] %></li> :class => 'icon-edit', :disabled => !@can[:edit] %></li>
@@ -89,6 +87,4 @@
:class => 'icon-move', :disabled => !@can[:move] %></li> :class => 'icon-move', :disabled => !@can[:move] %></li>
<li><%= context_menu_link l(:button_delete), {:controller => 'issues', :action => 'destroy', :ids => @issues.collect(&:id)}, <li><%= context_menu_link l(:button_delete), {:controller => 'issues', :action => 'destroy', :ids => @issues.collect(&:id)},
:method => :post, :confirm => l(:text_issues_destroy_confirmation), :class => 'icon-del', :disabled => !@can[:delete] %></li> :method => :post, :confirm => l(:text_issues_destroy_confirmation), :class => 'icon-del', :disabled => !@can[:delete] %></li>
<%= call_hook(:view_issues_context_menu_end, {:issues => @issues, :can => @can, :back => @back }) %>
</ul> </ul>
+2 -4
View File
@@ -9,7 +9,7 @@
<h2><%= @issue.tracker.name %> #<%= @issue.id %></h2> <h2><%= @issue.tracker.name %> #<%= @issue.id %></h2>
<div class="<%= css_issue_classes(@issue) %> details"> <div class="<%= css_issue_classes(@issue) %>">
<%= avatar(@issue.author, :size => "64") %> <%= avatar(@issue.author, :size => "64") %>
<h3><%=h @issue.subject %></h3> <h3><%=h @issue.subject %></h3>
<p class="author"> <p class="author">
@@ -45,7 +45,7 @@
</tr> </tr>
<tr> <tr>
<% n = 0 -%> <% n = 0 -%>
<% @issue.custom_field_values.each do |value| -%> <% @issue.custom_values.each do |value| -%>
<td valign="top"><b><%=h value.custom_field.name %>:</b></td><td valign="top"><%= simple_format(h(show_value(value))) %></td> <td valign="top"><b><%=h value.custom_field.name %>:</b></td><td valign="top"><%= simple_format(h(show_value(value))) %></td>
<% n = n + 1 <% n = n + 1
if (n > 1) if (n > 1)
@@ -69,8 +69,6 @@ end %>
<%= link_to_attachments @issue %> <%= link_to_attachments @issue %>
<%= call_hook(:view_issues_show_description_bottom, :issue => @issue) %>
<% if authorize_for('issue_relations', 'new') || @issue.relations.any? %> <% if authorize_for('issue_relations', 'new') || @issue.relations.any? %>
<hr /> <hr />
<div id="relations"> <div id="relations">
+1 -1
View File
@@ -1,3 +1,3 @@
<%= yield %> <%= yield %>
-- ----------------------------------------
<%= Setting.emails_footer %> <%= Setting.emails_footer %>
-1
View File
@@ -15,7 +15,6 @@
<p><%= f.text_field :lastname, :required => true %></p> <p><%= f.text_field :lastname, :required => true %></p>
<p><%= f.text_field :mail, :required => true %></p> <p><%= f.text_field :mail, :required => true %></p>
<p><%= f.select :language, lang_options_for_select %></p> <p><%= f.select :language, lang_options_for_select %></p>
<%= call_hook(:view_my_account, :user => @user, :form => f) %>
</div> </div>
<%= submit_tag l(:button_save) %> <%= submit_tag l(:button_save) %>
+1 -1
View File
@@ -11,7 +11,7 @@
<p><%= f.text_area :description, :rows => 5, :class => 'wiki-edit' %></p> <p><%= f.text_area :description, :rows => 5, :class => 'wiki-edit' %></p>
<p><%= f.text_field :identifier, :required => true, :disabled => @project.identifier_frozen? %> <p><%= f.text_field :identifier, :required => true, :disabled => @project.identifier_frozen? %>
<% unless @project.identifier_frozen? %> <% unless @project.identifier_frozen? %>
<br /><em><%= l(:text_length_between, 1, 20) %> <%= l(:text_project_identifier_info) %></em> <br /><em><%= l(:text_length_between, 2, 20) %> <%= l(:text_project_identifier_info) %></em>
<% end %></p> <% end %></p>
<p><%= f.text_field :homepage, :size => 60 %></p> <p><%= f.text_field :homepage, :size => 60 %></p>
<p><%= f.check_box :is_public %></p> <p><%= f.check_box :is_public %></p>
-5
View File
@@ -1,8 +1,6 @@
<h2><%=l(:label_settings)%></h2> <h2><%=l(:label_settings)%></h2>
<% tabs = project_settings_tabs %> <% tabs = project_settings_tabs %>
<% if tabs.any? %>
<% selected_tab = params[:tab] ? params[:tab].to_s : tabs.first[:name] %> <% selected_tab = params[:tab] ? params[:tab].to_s : tabs.first[:name] %>
<div class="tabs"> <div class="tabs">
@@ -22,8 +20,5 @@
:style => (tab[:name] != selected_tab ? 'display:none' : nil), :style => (tab[:name] != selected_tab ? 'display:none' : nil),
:class => 'tab-content') %> :class => 'tab-content') %>
<% end -%> <% end -%>
<% else %>
<p class="nodata"><%= l(:label_no_data) %></p>
<% end %>
<% html_title(l(:label_settings)) -%> <% html_title(l(:label_settings)) -%>
-2
View File
@@ -32,7 +32,6 @@
<p><%= link_to l(:label_issue_view_all), :controller => 'issues', :action => 'index', :project_id => @project, :set_filter => 1 %></p> <p><%= link_to l(:label_issue_view_all), :controller => 'issues', :action => 'index', :project_id => @project, :set_filter => 1 %></p>
</div> </div>
<% end %> <% end %>
<%= call_hook(:view_projects_show_left, :project => @project) %>
</div> </div>
<div class="splitcontentright"> <div class="splitcontentright">
@@ -54,7 +53,6 @@
<p><%= link_to l(:label_news_view_all), :controller => 'news', :action => 'index', :project_id => @project %></p> <p><%= link_to l(:label_news_view_all), :controller => 'news', :action => 'index', :project_id => @project %></p>
</div> </div>
<% end %> <% end %>
<%= call_hook(:view_projects_show_right, :project => @project) %>
</div> </div>
<% content_for :sidebar do %> <% content_for :sidebar do %>
+1 -1
View File
@@ -7,7 +7,7 @@
<h2><%= l(:label_spent_time) %></h2> <h2><%= l(:label_spent_time) %></h2>
<% form_remote_tag( :url => {}, :method => :get, :update => 'content' ) do %> <% form_remote_tag( :url => {}, :method => :get, :update => 'content' ) do %>
<%= hidden_field_tag('project_id', params[:project_id]) if @project %> <%= hidden_field_tag 'project_id', params[:project_id] %>
<%= hidden_field_tag 'issue_id', params[:issue_id] if @issue %> <%= hidden_field_tag 'issue_id', params[:issue_id] if @issue %>
<%= render :partial => 'date_range' %> <%= render :partial => 'date_range' %>
<% end %> <% end %>
+1 -1
View File
@@ -10,7 +10,7 @@
<% @criterias.each do |criteria| %> <% @criterias.each do |criteria| %>
<%= hidden_field_tag 'criterias[]', criteria, :id => nil %> <%= hidden_field_tag 'criterias[]', criteria, :id => nil %>
<% end %> <% end %>
<%= hidden_field_tag('project_id', params[:project_id]) if @project %> <%= hidden_field_tag 'project_id', params[:project_id] %>
<%= render :partial => 'date_range' %> <%= render :partial => 'date_range' %>
<p><%= l(:label_details) %>: <%= select_tag 'columns', options_for_select([[l(:label_year), 'year'], <p><%= l(:label_details) %>: <%= select_tag 'columns', options_for_select([[l(:label_year), 'year'],
-1
View File
@@ -13,7 +13,6 @@
<% end %> <% end %>
<p><%= f.check_box :admin, :disabled => (@user == User.current) %></p> <p><%= f.check_box :admin, :disabled => (@user == User.current) %></p>
<%= call_hook(:view_users_form, :user => @user, :form => f) %>
</div> </div>
<div class="box"> <div class="box">
-2
View File
@@ -9,7 +9,6 @@
<%= link_to l(:label_news_view_all), :controller => 'news' %> <%= link_to l(:label_news_view_all), :controller => 'news' %>
</div> </div>
<% end %> <% end %>
<%= call_hook(:view_welcome_index_left, :projects => @projects) %>
</div> </div>
<div class="splitcontentright"> <div class="splitcontentright">
@@ -26,7 +25,6 @@
</ul> </ul>
</div> </div>
<% end %> <% end %>
<%= call_hook(:view_welcome_index_right, :projects => @projects) %>
</div> </div>
<% content_for :header_tags do %> <% content_for :header_tags do %>
-2
View File
@@ -31,7 +31,6 @@
<%= link_to_attachments @page %> <%= link_to_attachments @page %>
<% if @editable && authorize_for('wiki', 'add_attachment') %> <% if @editable && authorize_for('wiki', 'add_attachment') %>
<div id="wiki_add_attachment">
<p><%= link_to l(:label_attachment_new), {}, :onclick => "Element.show('add_attachment_form'); Element.hide(this); Element.scrollTo('add_attachment_form'); return false;", <p><%= link_to l(:label_attachment_new), {}, :onclick => "Element.show('add_attachment_form'); Element.hide(this); Element.scrollTo('add_attachment_form'); return false;",
:id => 'attach_files_link' %></p> :id => 'attach_files_link' %></p>
<% form_tag({ :controller => 'wiki', :action => 'add_attachment', :page => @page.title }, :multipart => true, :id => "add_attachment_form", :style => "display:none;") do %> <% form_tag({ :controller => 'wiki', :action => 'add_attachment', :page => @page.title }, :multipart => true, :id => "add_attachment_form", :style => "display:none;") do %>
@@ -41,7 +40,6 @@
<%= submit_tag l(:button_add) %> <%= submit_tag l(:button_add) %>
<%= link_to l(:button_cancel), {}, :onclick => "Element.hide('add_attachment_form'); Element.show('attach_files_link'); return false;" %> <%= link_to l(:button_cancel), {}, :onclick => "Element.hide('add_attachment_form'); Element.show('attach_files_link'); return false;" %>
<% end %> <% end %>
</div>
<% end %> <% end %>
<p class="other-formats"> <p class="other-formats">
-35
View File
@@ -5,41 +5,6 @@ Copyright (C) 2006-2009 Jean-Philippe Lang
http://www.redmine.org/ http://www.redmine.org/
== 2009-05-17 v0.8.4
* Allow textile mailto links
* Fixed: memory consumption when uploading file
* Fixed: Mercurial integration doesn't work if Redmine is installed in folder path containing space
* Fixed: an error is raised when no tab is available on project settings
* Fixed: insert image macro corrupts urls with excalamation marks
* Fixed: error on cross-project gantt PNG export
* Fixed: self and alternate links in atom feeds do not respect Atom specs
* Fixed: accept any svn tunnel scheme in repository URL
* Fixed: issues/show should accept user's rss key
* Fixed: consistency of custom fields display on the issue detail view
* Fixed: wiki comments length validation is missing
* Fixed: weak autologin token generation algorithm causes duplicate tokens
== 2009-04-05 v0.8.3
* Separate project field and subject in cross-project issue view
* Ability to set language for redmine:load_default_data task using REDMINE_LANG environment variable
* Rescue Redmine::DefaultData::DataAlreadyLoaded in redmine:load_default_data task
* CSS classes to highlight own and assigned issues
* Hide "New file" link on wiki pages from printing
* Flush buffer when asking for language in redmine:load_default_data task
* Minimum project identifier length set to 1
* Include headers so that emails don't trigger vacation auto-responders
* Fixed: Time entries csv export links for all projects are malformed
* Fixed: Files without Version aren't visible in the Activity page
* Fixed: Commit logs are centered in the repo browser
* Fixed: News summary field content is not searchable
* Fixed: Journal#save has a wrong signature
* Fixed: Email footer signature convention
* Fixed: Timelog report do not show time for non-versioned issues
== 2009-03-07 v0.8.2 == 2009-03-07 v0.8.2
* Send an email to the user when an administrator activates a registered user * Send an email to the user when an administrator activates a registered user
+2 -2
View File
@@ -792,7 +792,7 @@ class RedCloth3 < String
(?:\(([^)]+?)\)(?="))? # $title (?:\(([^)]+?)\)(?="))? # $title
": ":
( # $url ( # $url
(\/|[a-zA-Z]+:\/\/|www\.|mailto:) # $proto (\/|[a-zA-Z]+:\/\/|www\.) # $proto
[\w\/]\S+? [\w\/]\S+?
) )
(\/)? # $slash (\/)? # $slash
@@ -907,7 +907,7 @@ class RedCloth3 < String
end end
IMAGE_RE = / IMAGE_RE = /
(<p>|\s|^) # start of line? (<p>|.|^) # start of line?
\! # opening \! # opening
(\<|\=|\>)? # optional alignment atts (\<|\=|\>)? # optional alignment atts
(#{C}) # optional style,class atts (#{C}) # optional style,class atts
@@ -105,7 +105,7 @@ module Redmine
# makes Mercurial produce a xml output. # makes Mercurial produce a xml output.
def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={}) def revisions(path=nil, identifier_from=nil, identifier_to=nil, options={})
revisions = Revisions.new revisions = Revisions.new
cmd = "#{HG_BIN} --debug --encoding utf8 -R #{target('')} log -C --style #{shell_quote self.class.template_path}" cmd = "#{HG_BIN} --debug --encoding utf8 -R #{target('')} log -C --style #{self.class.template_path}"
if identifier_from && identifier_to if identifier_from && identifier_to
cmd << " -r #{identifier_from.to_i}:#{identifier_to.to_i}" cmd << " -r #{identifier_from.to_i}:#{identifier_to.to_i}"
elsif identifier_from elsif identifier_from
+1 -1
View File
@@ -4,7 +4,7 @@ module Redmine
module VERSION #:nodoc: module VERSION #:nodoc:
MAJOR = 0 MAJOR = 0
MINOR = 8 MINOR = 8
TINY = 4 TINY = 2
# Branch values: # Branch values:
# * official release: nil # * official release: nil
+12 -18
View File
@@ -1,32 +1,26 @@
desc 'Load Redmine default configuration data. Language is chosen interactively or by setting REDMINE_LANG environment variable.' desc 'Load Redmine default configuration data'
namespace :redmine do namespace :redmine do
task :load_default_data => :environment do task :load_default_data => :environment do
include GLoc include GLoc
set_language_if_valid('en') set_language_if_valid('en')
puts
envlang = ENV['REDMINE_LANG'] while true
if !envlang || !set_language_if_valid(envlang) print "Select language: "
puts print GLoc.valid_languages.sort {|x,y| x.to_s <=> y.to_s }.join(", ")
while true print " [#{GLoc.current_language}] "
print "Select language: " lang = STDIN.gets.chomp!
print GLoc.valid_languages.sort {|x,y| x.to_s <=> y.to_s }.join(", ") break if lang.empty?
print " [#{GLoc.current_language}] " break if set_language_if_valid(lang)
STDOUT.flush puts "Unknown language!"
lang = STDIN.gets.chomp!
break if lang.empty?
break if set_language_if_valid(lang)
puts "Unknown language!"
end
STDOUT.flush
puts "===================================="
end end
puts "===================================="
begin begin
Redmine::DefaultData::Loader.load(current_language) Redmine::DefaultData::Loader.load(current_language)
puts "Default configuration data loaded." puts "Default configuration data loaded."
rescue Redmine::DefaultData::DataAlreadyLoaded => error
puts error
rescue => error rescue => error
puts "Error: " + error puts "Error: " + error
puts "Default configuration data was not loaded." puts "Default configuration data was not loaded."
+2 -7
View File
@@ -195,13 +195,8 @@ task :migrate_from_mantis => :environment do
file_type file_type
end end
def read(*args) def read
if @read_finished content
nil
else
@read_finished = true
content
end
end end
end end
+14 -25
View File
@@ -135,15 +135,8 @@ namespace :redmine do
File.file? trac_fullpath File.file? trac_fullpath
end end
def open def read
File.open("#{trac_fullpath}", 'rb') {|f| File.open("#{trac_fullpath}", 'rb').read
@file = f
yield self
}
end
def read(*args)
@file.read(*args)
end end
def description def description
@@ -513,14 +506,12 @@ namespace :redmine do
# Attachments # Attachments
ticket.attachments.each do |attachment| ticket.attachments.each do |attachment|
next unless attachment.exist? next unless attachment.exist?
attachment.open { a = Attachment.new :created_on => attachment.time
a = Attachment.new :created_on => attachment.time a.file = attachment
a.file = attachment a.author = find_or_create_user(attachment.author)
a.author = find_or_create_user(attachment.author) a.container = i
a.container = i a.description = attachment.description
a.description = attachment.description migrated_ticket_attachments += 1 if a.save
migrated_ticket_attachments += 1 if a.save
}
end end
# Custom fields # Custom fields
@@ -565,14 +556,12 @@ namespace :redmine do
page.attachments.each do |attachment| page.attachments.each do |attachment|
next unless attachment.exist? next unless attachment.exist?
next if p.attachments.find_by_filename(attachment.filename.gsub(/^.*(\\|\/)/, '').gsub(/[^\w\.\-]/,'_')) #add only once per page next if p.attachments.find_by_filename(attachment.filename.gsub(/^.*(\\|\/)/, '').gsub(/[^\w\.\-]/,'_')) #add only once per page
attachment.open { a = Attachment.new :created_on => attachment.time
a = Attachment.new :created_on => attachment.time a.file = attachment
a.file = attachment a.author = find_or_create_user(attachment.author)
a.author = find_or_create_user(attachment.author) a.description = attachment.description
a.description = attachment.description a.container = p
a.container = p migrated_wiki_attachments += 1 if a.save
migrated_wiki_attachments += 1 if a.save
}
end end
end end
+3 -4
View File
@@ -104,9 +104,9 @@ tr.entry.file td.filename a { margin-left: 16px; }
tr.changeset td.author { text-align: center; width: 15%; } tr.changeset td.author { text-align: center; width: 15%; }
tr.changeset td.committed_on { text-align: center; width: 15%; } tr.changeset td.committed_on { text-align: center; width: 15%; }
table.files tr.file td { text-align: center; } tr.file td { text-align: center; }
table.files tr.file td.filename { text-align: left; padding-left: 24px; } tr.file td.filename { text-align: left; padding-left: 24px; }
table.files tr.file td.digest { font-size: 80%; } tr.file td.digest { font-size: 80%; }
tr.message { height: 2.6em; } tr.message { height: 2.6em; }
tr.message td.last_message { font-size: 80%; } tr.message td.last_message { font-size: 80%; }
@@ -683,5 +683,4 @@ h2 img { vertical-align:middle; }
#top-menu, #header, #main-menu, #sidebar, #footer, .contextual, .other-formats { display:none; } #top-menu, #header, #main-menu, #sidebar, #footer, .contextual, .other-formats { display:none; }
#main { background: #fff; } #main { background: #fff; }
#content { width: 99%; margin: 0; padding: 0; border: 0; background: #fff; overflow: visible !important;} #content { width: 99%; margin: 0; padding: 0; border: 0; background: #fff; overflow: visible !important;}
#wiki_add_attachment { display:none; }
} }
@@ -51,8 +51,6 @@ class IssuesControllerTest < Test::Unit::TestCase
end end
def test_index def test_index
Setting.default_language = 'en'
get :index get :index
assert_response :success assert_response :success
assert_template 'index.rhtml' assert_template 'index.rhtml'
@@ -63,8 +61,6 @@ class IssuesControllerTest < Test::Unit::TestCase
# private projects hidden # private projects hidden
assert_no_tag :tag => 'a', :content => /Issue of a private subproject/ assert_no_tag :tag => 'a', :content => /Issue of a private subproject/
assert_no_tag :tag => 'a', :content => /Issue on project 2/ assert_no_tag :tag => 'a', :content => /Issue on project 2/
# project column
assert_tag :tag => 'th', :content => /Project/
end end
def test_index_should_not_list_issues_when_module_disabled def test_index_should_not_list_issues_when_module_disabled
+1 -13
View File
@@ -18,7 +18,7 @@
require File.dirname(__FILE__) + '/../test_helper' require File.dirname(__FILE__) + '/../test_helper'
class ActivityTest < Test::Unit::TestCase class ActivityTest < Test::Unit::TestCase
fixtures :projects, :versions, :attachments, :users, :roles, :members, :issues, :journals, :journal_details, fixtures :projects, :versions, :users, :roles, :members, :issues, :journals, :journal_details,
:trackers, :projects_trackers, :issue_statuses, :enabled_modules, :enumerations, :boards, :messages :trackers, :projects_trackers, :issue_statuses, :enabled_modules, :enumerations, :boards, :messages
def setup def setup
@@ -72,18 +72,6 @@ class ActivityTest < Test::Unit::TestCase
assert_nil(events.detect {|e| e.event_author != user}) assert_nil(events.detect {|e| e.event_author != user})
end end
def test_files_activity
f = Redmine::Activity::Fetcher.new(User.anonymous, :project => Project.find(1))
f.scope = ['files']
events = f.events
assert_kind_of Array, events
assert events.include?(Attachment.find_by_container_type_and_container_id('Project', 1))
assert events.include?(Attachment.find_by_container_type_and_container_id('Version', 1))
assert_equal [Attachment], events.collect(&:class).uniq
assert_equal %w(Project Version), events.collect(&:container_type).uniq.sort
end
private private
def find_events(user, options={}) def find_events(user, options={})
+4 -13
View File
@@ -22,19 +22,6 @@ class AttachmentTest < Test::Unit::TestCase
def setup def setup
end end
def test_create
a = Attachment.new(:container => Issue.find(1),
:file => test_uploaded_file("testfile.txt", "text/plain"),
:author => User.find(1))
assert a.save
assert_equal 'testfile.txt', a.filename
assert_equal 59, a.filesize
assert_equal 'text/plain', a.content_type
assert_equal 0, a.downloads
assert_equal Digest::MD5.hexdigest(test_uploaded_file("testfile.txt", "text/plain").read), a.digest
assert File.exist?(a.diskfile)
end
def test_diskfilename def test_diskfilename
assert Attachment.disk_filename("test_file.txt") =~ /^\d{12}_test_file.txt$/ assert Attachment.disk_filename("test_file.txt") =~ /^\d{12}_test_file.txt$/
@@ -43,4 +30,8 @@ class AttachmentTest < Test::Unit::TestCase
assert_equal 'f8139524ebb8f32e51976982cd20a85d', Attachment.disk_filename("test_accentué")[13..-1] assert_equal 'f8139524ebb8f32e51976982cd20a85d', Attachment.disk_filename("test_accentué")[13..-1]
assert_equal 'cbb5b0f30978ba03731d61f9f6d10011', Attachment.disk_filename("test_accentué.ça")[13..-1] assert_equal 'cbb5b0f30978ba03731d61f9f6d10011', Attachment.disk_filename("test_accentué.ça")[13..-1]
end end
def test_digest
assert_equal '1478adae0d4eb06d35897518540e25d6', Attachment.digest(Test::Unit::TestCase.fixture_path + "/files/testfile.txt")
end
end end
+1 -7
View File
@@ -55,8 +55,6 @@ class ApplicationHelperTest < HelperTestCase
'ftp://foo.bar' => '<a class="external" href="ftp://foo.bar">ftp://foo.bar</a>', 'ftp://foo.bar' => '<a class="external" href="ftp://foo.bar">ftp://foo.bar</a>',
'ftps://foo.bar' => '<a class="external" href="ftps://foo.bar">ftps://foo.bar</a>', 'ftps://foo.bar' => '<a class="external" href="ftps://foo.bar">ftps://foo.bar</a>',
'sftp://foo.bar' => '<a class="external" href="sftp://foo.bar">sftp://foo.bar</a>', 'sftp://foo.bar' => '<a class="external" href="sftp://foo.bar">sftp://foo.bar</a>',
# two exclamation marks
'http://example.net/path!602815048C7B5C20!302.html' => '<a class="external" href="http://example.net/path!602815048C7B5C20!302.html">http://example.net/path!602815048C7B5C20!302.html</a>',
} }
to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) } to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) }
end end
@@ -107,11 +105,7 @@ class ApplicationHelperTest < HelperTestCase
'"link (Link title with "double-quotes")":http://foo.bar' => '<a href="http://foo.bar" title="Link title with &quot;double-quotes&quot;" class="external">link</a>', '"link (Link title with "double-quotes")":http://foo.bar' => '<a href="http://foo.bar" title="Link title with &quot;double-quotes&quot;" class="external">link</a>',
"This is not a \"Link\":\n\nAnother paragraph" => "This is not a \"Link\":</p>\n\n\n\t<p>Another paragraph", "This is not a \"Link\":\n\nAnother paragraph" => "This is not a \"Link\":</p>\n\n\n\t<p>Another paragraph",
# no multiline link text # no multiline link text
"This is a double quote \"on the first line\nand another on a second line\":test" => "This is a double quote \"on the first line<br />\nand another on a second line\":test", "This is a double quote \"on the first line\nand another on a second line\":test" => "This is a double quote \"on the first line<br />\nand another on a second line\":test"
# mailto link
"\"system administrator\":mailto:sysadmin@example.com?subject=redmine%20permissions" => "<a href=\"mailto:sysadmin@example.com?subject=redmine%20permissions\">system administrator</a>",
# two exclamation marks
'"a link":http://example.net/path!602815048C7B5C20!302.html' => '<a href="http://example.net/path!602815048C7B5C20!302.html" class="external">a link</a>',
} }
to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) } to_test.each { |text, result| assert_equal "<p>#{result}</p>", textilizable(text) }
end end
-10
View File
@@ -86,16 +86,6 @@ class MailerTest < Test::Unit::TestCase
# restore it # restore it
ActionController::AbstractRequest.relative_url_root = relative_url_root ActionController::AbstractRequest.relative_url_root = relative_url_root
end end
def test_email_headers
ActionMailer::Base.deliveries.clear
issue = Issue.find(1)
Mailer.deliver_issue_add(issue)
mail = ActionMailer::Base.deliveries.last
assert_not_nil mail
assert_equal 'bulk', mail.header_string('Precedence')
assert_equal 'auto-generated', mail.header_string('Auto-Submitted')
end
def test_plain_text_mail def test_plain_text_mail
Setting.plain_text_mail = 1 Setting.plain_text_mail = 1