Commit 9bcf5758 authored by Holger Just's avatar Holger Just

Merge branch 'release-v2.3.0' into stable

parents 296de668 9af56d07
...@@ -14,8 +14,8 @@ group :test do ...@@ -14,8 +14,8 @@ group :test do
gem 'edavis10-object_daddy', :require => 'object_daddy' gem 'edavis10-object_daddy', :require => 'object_daddy'
gem 'mocha' gem 'mocha'
platforms :mri_18 do gem 'ruby-debug' end platforms :mri_18, :mingw_18 do gem 'ruby-debug' end
platforms :mri_19 do gem 'ruby-debug19', :require => 'ruby-debug' end platforms :mri_19, :mingw_19 do gem 'ruby-debug19', :require => 'ruby-debug' end
end end
group :openid do group :openid do
...@@ -32,7 +32,7 @@ end ...@@ -32,7 +32,7 @@ end
# orders of magnitude compared to their native counterparts. You have been # orders of magnitude compared to their native counterparts. You have been
# warned. # warned.
platforms :mri do platforms :mri, :mingw do
group :mysql do group :mysql do
gem "mysql" gem "mysql"
# gem "ruby-mysql" # gem "ruby-mysql"
...@@ -48,13 +48,13 @@ platforms :mri do ...@@ -48,13 +48,13 @@ platforms :mri do
end end
end end
platforms :mri_18 do platforms :mri_18, :mingw_18 do
group :sqlite do group :sqlite do
gem "sqlite3-ruby", "< 1.3", :require => "sqlite3" gem "sqlite3-ruby", "< 1.3", :require => "sqlite3"
end end
end end
platforms :mri_19 do platforms :mri_19, :mingw_19 do
group :sqlite do group :sqlite do
gem "sqlite3" gem "sqlite3"
end end
......
...@@ -286,7 +286,7 @@ private ...@@ -286,7 +286,7 @@ private
render_error l(:error_no_tracker_in_project) render_error l(:error_no_tracker_in_project)
return false return false
end end
@issue.start_date ||= User.current.today @issue.start_date ||= User.current.today if Setting.issue_startdate_is_adddate?
if params[:issue].is_a?(Hash) if params[:issue].is_a?(Hash)
@issue.safe_attributes = params[:issue] @issue.safe_attributes = params[:issue]
if User.current.allowed_to?(:add_issue_watchers, @project) && @issue.new_record? if User.current.allowed_to?(:add_issue_watchers, @project) && @issue.new_record?
......
...@@ -208,7 +208,10 @@ class Query < ActiveRecord::Base ...@@ -208,7 +208,10 @@ class Query < ActiveRecord::Base
@available_filters["assigned_to_role"] = { :type => :list_optional, :order => 7, :values => role_values } unless role_values.empty? @available_filters["assigned_to_role"] = { :type => :list_optional, :order => 7, :values => role_values } unless role_values.empty?
if User.current.logged? if User.current.logged?
@available_filters["watcher_id"] = { :type => :list, :order => 15, :values => [["<< #{l(:label_me)} >>", "me"]] } # populate the watcher list with the same user list as other user filters if the user has the :view_issue_watchers permission in at least one project
# TODO: this could be differentiated more, e.g. all users could watch issues in public projects, but won't necessarily be shown here
watcher_values = User.current.allowed_to_globally?(:view_issue_watchers, {}) ? user_values : [["<< #{l(:label_me)} >>", "me"]]
@available_filters["watcher_id"] = { :type => :list, :order => 15, :values => watcher_values }
end end
if project if project
...@@ -442,8 +445,21 @@ class Query < ActiveRecord::Base ...@@ -442,8 +445,21 @@ class Query < ActiveRecord::Base
elsif field == 'watcher_id' elsif field == 'watcher_id'
db_table = Watcher.table_name db_table = Watcher.table_name
db_field = 'user_id' db_field = 'user_id'
sql << "#{Issue.table_name}.id #{ operator == '=' ? 'IN' : 'NOT IN' } (SELECT #{db_table}.watchable_id FROM #{db_table} WHERE #{db_table}.watchable_type='Issue' AND " if User.current.admin?
sql << sql_for_field(field, '=', v, db_table, db_field) + ')' # Admins can always see all watchers
sql << "#{Issue.table_name}.id #{operator == '=' ? 'IN' : 'NOT IN'} (SELECT #{db_table}.watchable_id FROM #{db_table} WHERE #{db_table}.watchable_type='Issue' AND #{sql_for_field field, '=', v, db_table, db_field})"
else
sql_parts = []
if User.current.logged? && user_id = v.delete(User.current.id.to_s)
# a user can always see his own watched issues
sql_parts << "#{Issue.table_name}.id #{operator == '=' ? 'IN' : 'NOT IN'} (SELECT #{db_table}.watchable_id FROM #{db_table} WHERE #{db_table}.watchable_type='Issue' AND #{sql_for_field field, '=', [user_id], db_table, db_field})"
end
# filter watchers only in projects the user has the permission to view watchers in
project_ids = User.current.projects_by_role.collect {|r,p| p if r.permissions.include? :view_issue_watchers}.flatten.compact.collect(&:id).uniq
sql_parts << "#{Issue.table_name}.id #{operator == '=' ? 'IN' : 'NOT IN'} (SELECT #{db_table}.watchable_id FROM #{db_table} WHERE #{db_table}.watchable_type='Issue' AND #{sql_for_field field, '=', v, db_table, db_field})"\
" AND #{Project.table_name}.id IN (#{project_ids.join(',')})" unless project_ids.empty?
sql << "(#{sql_parts.join(' OR ')})"
end
elsif field == "member_of_group" # named field elsif field == "member_of_group" # named field
if operator == '*' # Any group if operator == '*' # Any group
groups = Group.all groups = Group.all
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
</div> </div>
<% if @project.new_record? %> <% if @project.new_record? %>
<fieldset class="box"><legend><%= l(:label_module_plural) %></legend> <fieldset class="box" id="project_modules"><legend><%= l(:label_module_plural) %> <span style="font-size:0.9em">(<%= check_all_links 'project_modules' %>)</span></legend>
<% Redmine::AccessControl.available_project_modules.each do |m| %> <% Redmine::AccessControl.available_project_modules.each do |m| %>
<label class="floating"> <label class="floating">
<%= check_box_tag 'project[enabled_module_names][]', m, @project.module_enabled?(m), :id => "project_enabled_module_names_#{m}" %> <%= check_box_tag 'project[enabled_module_names][]', m, @project.module_enabled?(m), :id => "project_enabled_module_names_#{m}" %>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
<% if @project.new_record? || @project.module_enabled?('issue_tracking') %> <% if @project.new_record? || @project.module_enabled?('issue_tracking') %>
<% unless @trackers.empty? %> <% unless @trackers.empty? %>
<fieldset class="box" id="project_trackers"><legend><%=l(:label_tracker_plural)%></legend> <fieldset class="box" id="project_trackers"><legend><%=l(:label_tracker_plural)%> <span style="font-size:0.9em">(<%= check_all_links 'project_trackers' %>)</span></legend>
<% @trackers.each do |tracker| %> <% @trackers.each do |tracker| %>
<label class="floating"> <label class="floating">
<%= check_box_tag 'project[tracker_ids][]', tracker.id, @project.trackers.include?(tracker) %> <%= check_box_tag 'project[tracker_ids][]', tracker.id, @project.trackers.include?(tracker) %>
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
<% end %> <% end %>
<% unless @issue_custom_fields.empty? %> <% unless @issue_custom_fields.empty? %>
<fieldset class="box" id="project_issue_custom_fields"><legend><%=l(:label_custom_field_plural)%></legend> <fieldset class="box" id="project_issue_custom_fields"><legend><%=l(:label_custom_field_plural)%> <span style="font-size:0.9em">(<%= check_all_links 'project_issue_custom_fields' %>)</span></legend>
<% @issue_custom_fields.each do |custom_field| %> <% @issue_custom_fields.each do |custom_field| %>
<label class="floating"> <label class="floating">
<%= check_box_tag 'project[issue_custom_field_ids][]', custom_field.id, (@project.all_issue_custom_fields.include? custom_field), (custom_field.is_for_all? ? {:disabled => "disabled"} : {}) %> <%= check_box_tag 'project[issue_custom_field_ids][]', custom_field.id, (@project.all_issue_custom_fields.include? custom_field), (custom_field.is_for_all? ? {:disabled => "disabled"} : {}) %>
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
<p><%= setting_check_box :display_subprojects_issues %></p> <p><%= setting_check_box :display_subprojects_issues %></p>
<p><%= setting_check_box :issue_startdate_is_adddate %></p>
<p><%= setting_select :issue_done_ratio, Issue::DONE_RATIO_OPTIONS.collect {|i| [l("setting_issue_done_ratio_#{i}"), i]} %></p> <p><%= setting_select :issue_done_ratio, Issue::DONE_RATIO_OPTIONS.collect {|i| [l("setting_issue_done_ratio_#{i}"), i]} %></p>
<p><%= setting_text_field :issues_export_limit, :size => 6 %></p> <p><%= setting_text_field :issues_export_limit, :size => 6 %></p>
......
...@@ -6,10 +6,10 @@ ...@@ -6,10 +6,10 @@
<p> <p>
<%= l(:label_version) %> <%= link_to @diff.content_from.version, :action => 'show', :id => @page.title, :project_id => @page.project, :version => @diff.content_from.version %> <%= l(:label_version) %> <%= link_to @diff.content_from.version, :action => 'show', :id => @page.title, :project_id => @page.project, :version => @diff.content_from.version %>
<em>(<%= @diff.content_from.author ? link_to_user(@diff.content_from.author) : l(:label_user_anonymous) %>, <%= format_time(@diff.content_from.updated_on) %>)</em> <em>(<%= @diff.content_from.user ? link_to_user(@diff.content_from.user) : l(:label_user_anonymous) %>, <%= format_time(@diff.content_from.updated_on) %>)</em>
&#8594; &#8594;
<%= l(:label_version) %> <%= link_to @diff.content_to.version, :action => 'show', :id => @page.title, :project_id => @page.project, :version => @diff.content_to.version %>/<%= @page.content.version %> <%= l(:label_version) %> <%= link_to @diff.content_to.version, :action => 'show', :id => @page.title, :project_id => @page.project, :version => @diff.content_to.version %>/<%= @page.content.version %>
<em>(<%= @diff.content_to.author ? link_to_user(@diff.content_to.author) : l(:label_user_anonymous) %>, <%= format_time(@diff.content_to.updated_on) %>)</em> <em>(<%= @diff.content_to.user ? link_to_user(@diff.content_to.user) : l(:label_user_anonymous) %>, <%= format_time(@diff.content_to.updated_on) %>)</em>
</p> </p>
<div class="text-diff"> <div class="text-diff">
......
...@@ -964,3 +964,4 @@ bg: ...@@ -964,3 +964,4 @@ bg:
label_path_encoding: Кодиране на пътищата label_path_encoding: Кодиране на пътищата
text_mercurial_repo_example: локално хранилище (например /hgrepo, c:\hgrepo) text_mercurial_repo_example: локално хранилище (например /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -978,3 +978,4 @@ bs: ...@@ -978,3 +978,4 @@ bs:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -967,3 +967,4 @@ ca: ...@@ -967,3 +967,4 @@ ca:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -1188,3 +1188,4 @@ cs: ...@@ -1188,3 +1188,4 @@ cs:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -980,3 +980,4 @@ da: ...@@ -980,3 +980,4 @@ da:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -370,6 +370,7 @@ de: ...@@ -370,6 +370,7 @@ de:
setting_start_of_week: Wochenanfang setting_start_of_week: Wochenanfang
setting_rest_api_enabled: REST-Schnittstelle aktivieren setting_rest_api_enabled: REST-Schnittstelle aktivieren
setting_cache_formatted_text: Formatierten Text im Cache speichern setting_cache_formatted_text: Formatierten Text im Cache speichern
setting_issue_startdate_is_adddate: Neue Tickets haben "Heute" als Anfangsdatum
permission_add_project: Projekt erstellen permission_add_project: Projekt erstellen
permission_add_subprojects: Unterprojekte erstellen permission_add_subprojects: Unterprojekte erstellen
......
...@@ -964,3 +964,4 @@ el: ...@@ -964,3 +964,4 @@ el:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -370,6 +370,7 @@ en-GB: ...@@ -370,6 +370,7 @@ en-GB:
setting_commit_logtime_enabled: Enable time logging setting_commit_logtime_enabled: Enable time logging
setting_commit_logtime_activity_id: Activity for logged time setting_commit_logtime_activity_id: Activity for logged time
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
setting_issue_startdate_is_adddate: Use current date as start date for new issues
permission_add_project: Create project permission_add_project: Create project
permission_add_subprojects: Create subprojects permission_add_subprojects: Create subprojects
......
...@@ -366,6 +366,7 @@ en: ...@@ -366,6 +366,7 @@ en:
setting_commit_logtime_enabled: Enable time logging setting_commit_logtime_enabled: Enable time logging
setting_commit_logtime_activity_id: Activity for logged time setting_commit_logtime_activity_id: Activity for logged time
setting_gantt_items_limit: Maximum number of items displayed on the gantt chart setting_gantt_items_limit: Maximum number of items displayed on the gantt chart
setting_issue_startdate_is_adddate: Use current date as start date for new issues
permission_add_project: Create project permission_add_project: Create project
permission_add_subprojects: Create subprojects permission_add_subprojects: Create subprojects
......
...@@ -1001,3 +1001,4 @@ es: ...@@ -1001,3 +1001,4 @@ es:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -968,3 +968,4 @@ eu: ...@@ -968,3 +968,4 @@ eu:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -967,3 +967,4 @@ fa: ...@@ -967,3 +967,4 @@ fa:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -985,3 +985,4 @@ fi: ...@@ -985,3 +985,4 @@ fi:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -367,6 +367,7 @@ fr: ...@@ -367,6 +367,7 @@ fr:
setting_commit_logtime_enabled: Permettre la saisie de temps setting_commit_logtime_enabled: Permettre la saisie de temps
setting_commit_logtime_activity_id: Activité pour le temps saisi setting_commit_logtime_activity_id: Activité pour le temps saisi
setting_gantt_items_limit: Nombre maximum d'éléments affichés sur le gantt setting_gantt_items_limit: Nombre maximum d'éléments affichés sur le gantt
setting_issue_startdate_is_adddate: Utiliser "aujourd'hui" comme début pour les nouvelles demandes
permission_add_project: Créer un projet permission_add_project: Créer un projet
permission_add_subprojects: Créer des sous-projets permission_add_subprojects: Créer des sous-projets
......
...@@ -976,3 +976,4 @@ gl: ...@@ -976,3 +976,4 @@ gl:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -969,3 +969,4 @@ he: ...@@ -969,3 +969,4 @@ he:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -971,3 +971,4 @@ hr: ...@@ -971,3 +971,4 @@ hr:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -983,3 +983,4 @@ ...@@ -983,3 +983,4 @@
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -972,3 +972,4 @@ id: ...@@ -972,3 +972,4 @@ id:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -965,3 +965,4 @@ it: ...@@ -965,3 +965,4 @@ it:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -986,3 +986,4 @@ ja: ...@@ -986,3 +986,4 @@ ja:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -1016,3 +1016,4 @@ ko: ...@@ -1016,3 +1016,4 @@ ko:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -1024,3 +1024,4 @@ lt: ...@@ -1024,3 +1024,4 @@ lt:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -959,3 +959,4 @@ lv: ...@@ -959,3 +959,4 @@ lv:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -964,3 +964,4 @@ mk: ...@@ -964,3 +964,4 @@ mk:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -965,3 +965,4 @@ mn: ...@@ -965,3 +965,4 @@ mn:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -946,3 +946,4 @@ nl: ...@@ -946,3 +946,4 @@ nl:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -951,3 +951,4 @@ ...@@ -951,3 +951,4 @@
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -981,3 +981,4 @@ pl: ...@@ -981,3 +981,4 @@ pl:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -909,6 +909,7 @@ pt-BR: ...@@ -909,6 +909,7 @@ pt-BR:
setting_rest_api_enabled: Habilitar REST web service setting_rest_api_enabled: Habilitar REST web service
label_missing_api_access_key: Chave de acesso a API faltando label_missing_api_access_key: Chave de acesso a API faltando
label_missing_feeds_access_key: Chave de acesso ao RSS faltando label_missing_feeds_access_key: Chave de acesso ao RSS faltando
setting_issue_startdate_is_adddate: Usar data corrente como data inicial para novas tarefas
text_line_separated: Múltiplos valores permitidos (uma linha para cada valor). text_line_separated: Múltiplos valores permitidos (uma linha para cada valor).
setting_mail_handler_body_delimiters: Truncar e-mails após uma destas linhas setting_mail_handler_body_delimiters: Truncar e-mails após uma destas linhas
permission_add_subprojects: Criar subprojetos permission_add_subprojects: Criar subprojetos
......
...@@ -968,3 +968,4 @@ pt: ...@@ -968,3 +968,4 @@ pt:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -957,3 +957,4 @@ ro: ...@@ -957,3 +957,4 @@ ro:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
This diff is collapsed.
...@@ -959,3 +959,4 @@ sk: ...@@ -959,3 +959,4 @@ sk:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -960,3 +960,4 @@ sl: ...@@ -960,3 +960,4 @@ sl:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -964,3 +964,4 @@ sr-YU: ...@@ -964,3 +964,4 @@ sr-YU:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -965,3 +965,4 @@ sr: ...@@ -965,3 +965,4 @@ sr:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -1006,3 +1006,4 @@ sv: ...@@ -1006,3 +1006,4 @@ sv:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -961,3 +961,4 @@ th: ...@@ -961,3 +961,4 @@ th:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -983,3 +983,4 @@ tr: ...@@ -983,3 +983,4 @@ tr:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -960,3 +960,4 @@ uk: ...@@ -960,3 +960,4 @@ uk:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -1015,3 +1015,4 @@ vi: ...@@ -1015,3 +1015,4 @@ vi:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -1046,3 +1046,4 @@ ...@@ -1046,3 +1046,4 @@
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -978,3 +978,4 @@ zh: ...@@ -978,3 +978,4 @@ zh:
label_path_encoding: Path encoding label_path_encoding: Path encoding
text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo) text_mercurial_repo_example: local repository (e.g. /hgrepo, c:\hgrepo)
label_diff: diff label_diff: diff
setting_issue_startdate_is_adddate: Use current date as start date for new issues
...@@ -178,3 +178,5 @@ default_notification_option: ...@@ -178,3 +178,5 @@ default_notification_option:
default: 'only_my_events' default: 'only_my_events'
emails_header: emails_header:
default: '' default: ''
issue_startdate_is_adddate:
default: 1
\ No newline at end of file
...@@ -12,18 +12,24 @@ ...@@ -12,18 +12,24 @@
#++ #++
class MergeWikiVersionsWithJournals < ActiveRecord::Migration class MergeWikiVersionsWithJournals < ActiveRecord::Migration
def self.up # This is provided here for migrating up after the WikiContent::Version class has been removed
# This is provided here for migrating up after the WikiContent::Version class has been removed class WikiContent < ActiveRecord::Base
unless WikiContent.const_defined?("Version") class Version < ActiveRecord::Base
WikiContent.const_set("Version", Class.new(ActiveRecord::Base))
end end
end
def self.up
# avoid touching WikiContent on journal creation # avoid touching WikiContent on journal creation
WikiContentJournal.class_exec { WikiContentJournal.class_exec {
def touch_journaled_after_creation def touch_journaled_after_creation
end end
} }
# assign all wiki_contents w/o author to the anonymous user - they used to
# work w/o author but don't any more.
WikiContent.update_all({:author_id => User.anonymous.id}, :author_id => nil)
WikiContent::Version.update_all({:author_id => User.anonymous.id}, :author_id => nil)
WikiContent::Version.find_by_sql("SELECT * FROM wiki_content_versions").each do |wv| WikiContent::Version.find_by_sql("SELECT * FROM wiki_content_versions").each do |wv|
journal = WikiContentJournal.create!(:journaled_id => wv.wiki_content_id, :user_id => wv.author_id, journal = WikiContentJournal.create!(:journaled_id => wv.wiki_content_id, :user_id => wv.author_id,
:notes => wv.comments, :created_at => wv.updated_on, :activity_type => "wiki_edits") :notes => wv.comments, :created_at => wv.updated_on, :activity_type => "wiki_edits")
......
= ChiliProject changelog = ChiliProject changelog
== 2011-10-04 v2.3.0
* Bug #594: Wiki Diff somehow off
* Bug #617: Gemfile: Missing database related platform block for Windows + RubyInstaller
* Bug #619: Redmine.pm allows anonymous read access to repositories even if Anonymous role prohibits it
* Bug #633: Update from 1.x to 2.x impossible under rare but valid circumstances
* Feature #355: Turn on/off the if the start date will autofill by default
* Feature #566: The "Watcher" filter should show all users.
* Feature #644: Add Check/Uncheck all links to project form
== 2011-08-27 v2.2.0 == 2011-08-27 v2.2.0
* Bug #256: requires_redmine_plugin should defer loading plugins if not all dependencies are met * Bug #256: requires_redmine_plugin should defer loading plugins if not all dependencies are met
......
...@@ -318,7 +318,7 @@ sub access_handler { ...@@ -318,7 +318,7 @@ sub access_handler {
my $project_id = get_project_identifier($r); my $project_id = get_project_identifier($r);
$r->set_handlers(PerlAuthenHandler => [\&OK]) $r->set_handlers(PerlAuthenHandler => [\&OK])
if is_public_project($project_id, $r); if is_public_project($project_id, $r) && anonymous_role_allows_browse_repository($r);
return OK return OK
} }
...@@ -390,6 +390,29 @@ sub is_public_project { ...@@ -390,6 +390,29 @@ sub is_public_project {
$ret; $ret;
} }
sub anonymous_role_allows_browse_repository {
my $r = shift;
my $dbh = connect_database($r);
my $sth = $dbh->prepare(
"SELECT permissions FROM roles WHERE builtin = 2;"
);
$sth->execute();
my $ret = 0;
if (my @row = $sth->fetchrow_array) {
if ($row[0] =~ /:browse_repository/) {
$ret = 1;
}
}
$sth->finish();
undef $sth;
$dbh->disconnect();
undef $dbh;
$ret;
}
# perhaps we should use repository right (other read right) to check public access. # perhaps we should use repository right (other read right) to check public access.
# it could be faster BUT it doesn't work for the moment. # it could be faster BUT it doesn't work for the moment.
# sub is_public_project_by_file { # sub is_public_project_by_file {
......
...@@ -17,7 +17,7 @@ module ChiliProject ...@@ -17,7 +17,7 @@ module ChiliProject
module VERSION #:nodoc: module VERSION #:nodoc:
MAJOR = 2 MAJOR = 2
MINOR = 2 MINOR = 3
PATCH = 0 PATCH = 0
TINY = PATCH # Redmine compat TINY = PATCH # Redmine compat
......
...@@ -444,6 +444,101 @@ class QueryTest < ActiveSupport::TestCase ...@@ -444,6 +444,101 @@ class QueryTest < ActiveSupport::TestCase
end end
context "'watcher_id' filter" do
context "globally" do
context "for an anonymous user" do
should "not be present" do
assert ! @query.available_filters.keys.include?("watcher_id")
end
end
context "for a logged in user" do
setup do
User.current = User.find 1
end
teardown do
User.current = nil
end
should "be present" do
assert @query.available_filters.keys.include?("watcher_id")
end
should "be a list" do
assert_equal :list, @query.available_filters["watcher_id"][:type]
end
should "have a list of active users as values" do
assert @query.available_filters["watcher_id"][:values].include?(["<< me >>", "me"])
assert @query.available_filters["watcher_id"][:values].include?(["John Smith", "2"])
assert @query.available_filters["watcher_id"][:values].include?(["Dave Lopper", "3"])
assert @query.available_filters["watcher_id"][:values].include?(["redMine Admin", "1"])
assert @query.available_filters["watcher_id"][:values].include?(["User Misc", "8"])
end
should "not include active users not member of any project" do
assert ! @query.available_filters["watcher_id"][:values].include?(['Robert Hill','4'])
end
should "not include locked users as values" do
assert ! @query.available_filters["watcher_id"][:values].include?(['Dave2 Lopper2','5'])
end
should "not include the anonymous user as values" do
assert ! @query.available_filters["watcher_id"][:values].include?(['Anonymous','6'])
end
end
end
context "in a project" do
setup do
@query.project = Project.find(1)
end
context "for an anonymous user" do
should "not be present" do
assert ! @query.available_filters.keys.include?("watcher_id")
end
end
context "for a logged in user" do
setup do
User.current = User.find 1
end
teardown do
User.current = nil
end
should "be present" do
assert @query.available_filters.keys.include?("watcher_id")
end
should "be a list" do
assert_equal :list, @query.available_filters["watcher_id"][:type]
end
should "have a list of the project members as values" do
assert @query.available_filters["watcher_id"][:values].include?(["<< me >>", "me"])
assert @query.available_filters["watcher_id"][:values].include?(["John Smith", "2"])
assert @query.available_filters["watcher_id"][:values].include?(["Dave Lopper", "3"])
end
should "not include non-project members as values" do
assert ! @query.available_filters["watcher_id"][:values].include?(["redMine Admin", "1"])
end
should "not include locked project members as values" do
assert ! @query.available_filters["watcher_id"][:values].include?(['Dave2 Lopper2','5'])
end
should "not include the anonymous user as values" do
assert ! @query.available_filters["watcher_id"][:values].include?(['Anonymous','6'])
end
end
end
end
end end
context "#statement" do context "#statement" do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment