@@ -0,0 +1,8 | |||||
|
1 | <h3><%=l(:label_my_account)%></h3> | |||
|
2 | ||||
|
3 | <p><%=l(:field_login)%>: <strong><%= @user.login %></strong><br /> | |||
|
4 | <%=l(:field_created_on)%>: <%= format_time(@user.created_on) %></p> | |||
|
5 | <% if @user.rss_token %> | |||
|
6 | <p><%= l(:label_feeds_access_key_created_on, distance_of_time_in_words(Time.now, @user.rss_token.created_on)) %> | |||
|
7 | (<%= link_to l(:button_reset), {:action => 'reset_rss_key'}, :method => :post %>)</p> | |||
|
8 | <% end %> |
@@ -0,0 +1,22 | |||||
|
1 | <h2><%=l(:button_change_password)%></h2> | |||
|
2 | ||||
|
3 | <%= error_messages_for 'user' %> | |||
|
4 | ||||
|
5 | <% form_tag({}, :class => "tabular") do %> | |||
|
6 | <div class="box"> | |||
|
7 | <p><label for="password"><%=l(:field_password)%> <span class="required">*</span></label> | |||
|
8 | <%= password_field_tag 'password', nil, :size => 25 %></p> | |||
|
9 | ||||
|
10 | <p><label for="new_password"><%=l(:field_new_password)%> <span class="required">*</span></label> | |||
|
11 | <%= password_field_tag 'new_password', nil, :size => 25 %><br /> | |||
|
12 | <em><%= l(:text_length_between, 4, 12) %></em></p> | |||
|
13 | ||||
|
14 | <p><label for="new_password_confirmation"><%=l(:field_password_confirmation)%> <span class="required">*</span></label> | |||
|
15 | <%= password_field_tag 'new_password_confirmation', nil, :size => 25 %></p> | |||
|
16 | </div> | |||
|
17 | <%= submit_tag l(:button_apply) %> | |||
|
18 | <% end %> | |||
|
19 | ||||
|
20 | <% content_for :sidebar do %> | |||
|
21 | <%= render :partial => 'sidebar' %> | |||
|
22 | <% end %> |
@@ -0,0 +1,9 | |||||
|
1 | class AddMembersMailNotification < ActiveRecord::Migration | |||
|
2 | def self.up | |||
|
3 | add_column :members, :mail_notification, :boolean, :default => false, :null => false | |||
|
4 | end | |||
|
5 | ||||
|
6 | def self.down | |||
|
7 | remove_column :members, :mail_notification | |||
|
8 | end | |||
|
9 | end |
@@ -50,32 +50,44 class MyController < ApplicationController | |||||
50 |
|
50 | |||
51 | # Edit user's account |
|
51 | # Edit user's account | |
52 | def account |
|
52 | def account | |
53 | @user = self.logged_in_user |
|
53 | @user = User.current | |
54 | @pref = @user.pref |
|
54 | @pref = @user.pref | |
55 | @user.attributes = params[:user] |
|
55 | if request.post? | |
56 |
@user |
|
56 | @user.attributes = params[:user] | |
57 | if request.post? && @user.save && @user.pref.save |
|
57 | @user.mail_notification = (params[:notification_option] == 'all') | |
58 | flash[:notice] = l(:notice_account_updated) |
|
58 | @user.pref.attributes = params[:pref] | |
59 | redirect_to :action => 'account' |
|
59 | if @user.save | |
|
60 | @user.pref.save | |||
|
61 | @user.notified_project_ids = (params[:notification_option] == 'selected' ? params[:notified_project_ids] : []) | |||
|
62 | set_language_if_valid @user.language | |||
|
63 | flash[:notice] = l(:notice_account_updated) | |||
|
64 | redirect_to :action => 'account' | |||
|
65 | return | |||
|
66 | end | |||
60 | end |
|
67 | end | |
|
68 | @notification_options = [[l(:label_user_mail_option_all), 'all'], | |||
|
69 | [l(:label_user_mail_option_none), 'none']] | |||
|
70 | # Only users that belong to more than 1 project can select projects for which they are notified | |||
|
71 | # Note that @user.membership.size would fail since AR ignores :include association option when doing a count | |||
|
72 | @notification_options.insert 1, [l(:label_user_mail_option_selected), 'selected'] if @user.memberships.length > 1 | |||
|
73 | @notification_option = @user.mail_notification? ? 'all' : (@user.notified_projects_ids.empty? ? 'none' : 'selected') | |||
61 | end |
|
74 | end | |
62 |
|
75 | |||
63 |
# |
|
76 | # Manage user's password | |
64 |
def |
|
77 | def password | |
65 | @user = self.logged_in_user |
|
78 | @user = self.logged_in_user | |
66 | flash[:error] = l(:notice_can_t_change_password) and redirect_to :action => 'account' and return if @user.auth_source_id |
|
79 | flash[:error] = l(:notice_can_t_change_password) and redirect_to :action => 'account' and return if @user.auth_source_id | |
67 | if @user.check_password?(params[:password]) |
|
80 | if request.post? | |
68 | @user.password, @user.password_confirmation = params[:new_password], params[:new_password_confirmation] |
|
81 | if @user.check_password?(params[:password]) | |
69 | if @user.save |
|
82 | @user.password, @user.password_confirmation = params[:new_password], params[:new_password_confirmation] | |
70 | flash[:notice] = l(:notice_account_password_updated) |
|
83 | if @user.save | |
|
84 | flash[:notice] = l(:notice_account_password_updated) | |||
|
85 | redirect_to :action => 'account' | |||
|
86 | end | |||
71 | else |
|
87 | else | |
72 | render :action => 'account' |
|
88 | flash[:error] = l(:notice_account_wrong_password) | |
73 | return |
|
|||
74 | end |
|
89 | end | |
75 | else |
|
|||
76 | flash[:error] = l(:notice_account_wrong_password) |
|
|||
77 | end |
|
90 | end | |
78 | redirect_to :action => 'account' |
|
|||
79 | end |
|
91 | end | |
80 |
|
92 | |||
81 | # Create a new feeds key |
|
93 | # Create a new feeds key |
@@ -143,6 +143,15 class Issue < ActiveRecord::Base | |||||
143 | project.assignable_users |
|
143 | project.assignable_users | |
144 | end |
|
144 | end | |
145 |
|
145 | |||
|
146 | # Returns the mail adresses of users that should be notified for the issue | |||
|
147 | def recipients | |||
|
148 | recipients = project.recipients | |||
|
149 | # Author and assignee are always notified | |||
|
150 | recipients << author.mail if author | |||
|
151 | recipients << assigned_to.mail if assigned_to | |||
|
152 | recipients.compact.uniq | |||
|
153 | end | |||
|
154 | ||||
146 | def spent_hours |
|
155 | def spent_hours | |
147 | @spent_hours ||= time_entries.sum(:hours) || 0 |
|
156 | @spent_hours ||= time_entries.sum(:hours) || 0 | |
148 | end |
|
157 | end |
@@ -30,13 +30,7 class Mailer < ActionMailer::Base | |||||
30 |
|
30 | |||
31 | def issue_add(issue) |
|
31 | def issue_add(issue) | |
32 | set_language_if_valid(Setting.default_language) |
|
32 | set_language_if_valid(Setting.default_language) | |
33 | # Sends to all project members |
|
33 | @recipients = issue.recipients | |
34 | @recipients = issue.project.members.collect { |m| m.user.mail if m.user.mail_notification }.compact |
|
|||
35 | # Sends to author and assignee (even if they turned off mail notification) |
|
|||
36 | @recipients << issue.author.mail if issue.author |
|
|||
37 | @recipients << issue.assigned_to.mail if issue.assigned_to |
|
|||
38 | @recipients.compact! |
|
|||
39 | @recipients.uniq! |
|
|||
40 | @from = Setting.mail_from |
|
34 | @from = Setting.mail_from | |
41 | @subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] #{issue.status.name} - #{issue.subject}" |
|
35 | @subject = "[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] #{issue.status.name} - #{issue.subject}" | |
42 | @body['issue'] = issue |
|
36 | @body['issue'] = issue | |
@@ -44,14 +38,8 class Mailer < ActionMailer::Base | |||||
44 |
|
38 | |||
45 | def issue_edit(journal) |
|
39 | def issue_edit(journal) | |
46 | set_language_if_valid(Setting.default_language) |
|
40 | set_language_if_valid(Setting.default_language) | |
47 | # Sends to all project members |
|
|||
48 | issue = journal.journalized |
|
41 | issue = journal.journalized | |
49 | @recipients = issue.project.members.collect { |m| m.user.mail if m.user.mail_notification }.compact |
|
42 | @recipients = issue.recipients | |
50 | # Sends to author and assignee (even if they turned off mail notification) |
|
|||
51 | @recipients << issue.author.mail if issue.author |
|
|||
52 | @recipients << issue.assigned_to.mail if issue.assigned_to |
|
|||
53 | @recipients.compact! |
|
|||
54 | @recipients.uniq! |
|
|||
55 | # Watchers in cc |
|
43 | # Watchers in cc | |
56 | @cc = issue.watcher_recipients - @recipients |
|
44 | @cc = issue.watcher_recipients - @recipients | |
57 | @from = Setting.mail_from |
|
45 | @from = Setting.mail_from | |
@@ -62,7 +50,7 class Mailer < ActionMailer::Base | |||||
62 |
|
50 | |||
63 | def document_added(document) |
|
51 | def document_added(document) | |
64 | set_language_if_valid(Setting.default_language) |
|
52 | set_language_if_valid(Setting.default_language) | |
65 | @recipients = document.project.users.collect { |u| u.mail if u.mail_notification }.compact |
|
53 | @recipients = document.project.recipients | |
66 | @from = Setting.mail_from |
|
54 | @from = Setting.mail_from | |
67 | @subject = "[#{document.project.name}] #{l(:label_document_new)}: #{document.title}" |
|
55 | @subject = "[#{document.project.name}] #{l(:label_document_new)}: #{document.title}" | |
68 | @body['document'] = document |
|
56 | @body['document'] = document | |
@@ -81,7 +69,7 class Mailer < ActionMailer::Base | |||||
81 | url = {:only_path => false, :host => Setting.host_name, :controller => 'documents', :action => 'show', :id => container.id} |
|
69 | url = {:only_path => false, :host => Setting.host_name, :controller => 'documents', :action => 'show', :id => container.id} | |
82 | added_to = "#{l(:label_document)}: #{container.title}" |
|
70 | added_to = "#{l(:label_document)}: #{container.title}" | |
83 | end |
|
71 | end | |
84 | @recipients = container.project.users.collect { |u| u.mail if u.mail_notification }.compact |
|
72 | @recipients = container.project.recipients | |
85 | @from = Setting.mail_from |
|
73 | @from = Setting.mail_from | |
86 | @subject = "[#{container.project.name}] #{l(:label_attachment_new)}" |
|
74 | @subject = "[#{container.project.name}] #{l(:label_attachment_new)}" | |
87 | @body['attachments'] = attachments |
|
75 | @body['attachments'] = attachments | |
@@ -91,7 +79,7 class Mailer < ActionMailer::Base | |||||
91 |
|
79 | |||
92 | def news_added(news) |
|
80 | def news_added(news) | |
93 | set_language_if_valid(Setting.default_language) |
|
81 | set_language_if_valid(Setting.default_language) | |
94 | @recipients = news.project.users.collect { |u| u.mail if u.mail_notification }.compact |
|
82 | @recipients = news.project.recipients | |
95 | @from = Setting.mail_from |
|
83 | @from = Setting.mail_from | |
96 | @subject = "[#{news.project.name}] #{l(:label_news)}: #{news.title}" |
|
84 | @subject = "[#{news.project.name}] #{l(:label_news)}: #{news.title}" | |
97 | @body['news'] = news |
|
85 | @body['news'] = news |
@@ -118,6 +118,11 class Project < ActiveRecord::Base | |||||
118 | members.select {|m| m.role.assignable?}.collect {|m| m.user} |
|
118 | members.select {|m| m.role.assignable?}.collect {|m| m.user} | |
119 | end |
|
119 | end | |
120 |
|
120 | |||
|
121 | # Returns the mail adresses of users that should be always notified on project events | |||
|
122 | def recipients | |||
|
123 | members.select {|m| m.mail_notification? || m.user.mail_notification?}.collect {|m| m.user.mail} | |||
|
124 | end | |||
|
125 | ||||
121 | # Returns an array of all custom fields enabled for project issues |
|
126 | # Returns an array of all custom fields enabled for project issues | |
122 | # (explictly associated custom fields and custom fields enabled for all projects) |
|
127 | # (explictly associated custom fields and custom fields enabled for all projects) | |
123 | def custom_fields_for_issues(tracker) |
|
128 | def custom_fields_for_issues(tracker) |
@@ -50,6 +50,11 class User < ActiveRecord::Base | |||||
50 | validates_confirmation_of :password, :allow_nil => true |
|
50 | validates_confirmation_of :password, :allow_nil => true | |
51 | validates_associated :custom_values, :on => :update |
|
51 | validates_associated :custom_values, :on => :update | |
52 |
|
52 | |||
|
53 | def before_create | |||
|
54 | self.mail_notification = false | |||
|
55 | true | |||
|
56 | end | |||
|
57 | ||||
53 | def before_save |
|
58 | def before_save | |
54 | # update hashed_password if password was set |
|
59 | # update hashed_password if password was set | |
55 | self.hashed_password = User.hash_password(self.password) if self.password |
|
60 | self.hashed_password = User.hash_password(self.password) if self.password | |
@@ -131,6 +136,18 class User < ActiveRecord::Base | |||||
131 | token.value |
|
136 | token.value | |
132 | end |
|
137 | end | |
133 |
|
138 | |||
|
139 | # Return an array of project ids for which the user has explicitly turned mail notifications on | |||
|
140 | def notified_projects_ids | |||
|
141 | @notified_projects_ids ||= memberships.select {|m| m.mail_notification?}.collect(&:project_id) | |||
|
142 | end | |||
|
143 | ||||
|
144 | def notified_project_ids=(ids) | |||
|
145 | Member.update_all("mail_notification = #{connection.quoted_false}", ['user_id = ?', id]) | |||
|
146 | Member.update_all("mail_notification = #{connection.quoted_true}", ['user_id = ? AND project_id IN (?)', id, ids]) if ids && !ids.empty? | |||
|
147 | @notified_projects_ids = nil | |||
|
148 | notified_projects_ids | |||
|
149 | end | |||
|
150 | ||||
134 | def self.find_by_rss_key(key) |
|
151 | def self.find_by_rss_key(key) | |
135 | token = Token.find_by_value(key) |
|
152 | token = Token.find_by_value(key) | |
136 | token && token.user.active? ? token.user : nil |
|
153 | token && token.user.active? ? token.user : nil |
@@ -1,55 +1,41 | |||||
|
1 | <div class="contextual"> | |||
|
2 | <%= link_to(l(:button_change_password), :action => 'password') unless @user.auth_source_id %> | |||
|
3 | </div> | |||
1 | <h2><%=l(:label_my_account)%></h2> |
|
4 | <h2><%=l(:label_my_account)%></h2> | |
2 |
|
||||
3 | <%= error_messages_for 'user' %> |
|
5 | <%= error_messages_for 'user' %> | |
4 |
|
6 | |||
5 | <div class="box"> |
|
7 | <% form_for :user, @user, :url => { :action => "account" }, :builder => TabularFormBuilder, :lang => current_language do |f| %> | |
|
8 | <div class="splitcontentleft"> | |||
6 | <h3><%=l(:label_information_plural)%></h3> |
|
9 | <h3><%=l(:label_information_plural)%></h3> | |
7 |
|
10 | <div class="box tabular"> | ||
8 | <% labelled_tabular_form_for :user, @user, :url => { :action => "account" } do |f| %> |
|
|||
9 |
|
||||
10 | <p><%= f.text_field :firstname, :required => true %></p> |
|
11 | <p><%= f.text_field :firstname, :required => true %></p> | |
11 | <p><%= f.text_field :lastname, :required => true %></p> |
|
12 | <p><%= f.text_field :lastname, :required => true %></p> | |
12 |
<p><%= f.text_field :mail, :required => true |
|
13 | <p><%= f.text_field :mail, :required => true %></p> | |
13 | <p><%= f.select :language, lang_options_for_select %></p> |
|
14 | <p><%= f.select :language, lang_options_for_select %></p> | |
14 | <p><%= f.check_box :mail_notification %></p> |
|
|||
15 |
|
15 | |||
16 | <% fields_for :pref, @user.pref, :builder => TabularFormBuilder, :lang => current_language do |pref_fields| %> |
|
16 | <% fields_for :pref, @user.pref, :builder => TabularFormBuilder, :lang => current_language do |pref_fields| %> | |
17 | <p><%= pref_fields.check_box :hide_mail %></p> |
|
17 | <p><%= pref_fields.check_box :hide_mail %></p> | |
18 | <% end %> |
|
18 | <% end %> | |
19 |
|
||||
20 | <center><%= submit_tag l(:button_save) %></center> |
|
|||
21 | <% end %> |
|
|||
22 | </div> |
|
19 | </div> | |
23 |
|
20 | |||
|
21 | <%= submit_tag l(:button_save) %> | |||
|
22 | </div> | |||
24 |
|
23 | |||
25 | <% unless @user.auth_source_id %> |
|
24 | <div class="splitcontentright"> | |
26 | <div class="box"> |
|
25 | <h3><%=l(:field_mail_notification)%></h3> | |
27 | <h3><%=l(:field_password)%></h3> |
|
26 | <div class="box"> | |
28 |
|
27 | <%= select_tag 'notification_option', options_for_select(@notification_options, @notification_option), | ||
29 | <% form_tag({:action => 'change_password'}, :class => "tabular") do %> |
|
28 | :onchange => 'if ($("notification_option").value == "selected") {Element.show("notified-projects")} else {Element.hide("notified-projects")}' %> | |
30 |
|
29 | <% content_tag 'div', :id => 'notified-projects', :style => (@notification_option == 'selected' ? '' : 'display:none;') do %> | ||
31 | <p><label for="password"><%=l(:field_password)%> <span class="required">*</span></label> |
|
30 | <p><% User.current.projects.each do |project| %> | |
32 | <%= password_field_tag 'password', nil, :size => 25 %></p> |
|
31 | <label><%= check_box_tag 'notified_project_ids[]', project.id, @user.notified_projects_ids.include?(project.id) %> <%= project.name %></label><br /> | |
33 |
|
32 | <% end %></p> | ||
34 | <p><label for="new_password"><%=l(:field_new_password)%> <span class="required">*</span></label> |
|
33 | <p><em><%= l(:text_user_mail_option) %></em></p> | |
35 | <%= password_field_tag 'new_password', nil, :size => 25 %><br /> |
|
34 | <% end %> | |
36 | <em><%= l(:text_length_between, 4, 12) %></em></p> |
|
35 | </div> | |
37 |
|
36 | </div> | ||
38 | <p><label for="new_password_confirmation"><%=l(:field_password_confirmation)%> <span class="required">*</span></label> |
|
|||
39 | <%= password_field_tag 'new_password_confirmation', nil, :size => 25 %></p> |
|
|||
40 |
|
||||
41 | <center><%= submit_tag l(:button_save) %></center> |
|
|||
42 | <% end %> |
|
|||
43 | </div> |
|
|||
44 | <% end %> |
|
37 | <% end %> | |
45 |
|
38 | |||
46 | <% content_for :sidebar do %> |
|
39 | <% content_for :sidebar do %> | |
47 | <h3><%=l(:label_my_account)%></h3> |
|
40 | <%= render :partial => 'sidebar' %> | |
48 |
|
||||
49 | <p><%=l(:field_login)%>: <strong><%= @user.login %></strong><br /> |
|
|||
50 | <%=l(:field_created_on)%>: <%= format_time(@user.created_on) %></p> |
|
|||
51 | <% if @user.rss_token %> |
|
|||
52 | <p><%= l(:label_feeds_access_key_created_on, distance_of_time_in_words(Time.now, @user.rss_token.created_on)) %> |
|
|||
53 | (<%= link_to l(:button_reset), {:action => 'reset_rss_key'}, :method => :post %>)</p> |
|
|||
54 | <% end %> |
|
|||
55 | <% end %> |
|
41 | <% end %> |
@@ -14,7 +14,6 | |||||
14 | <% end if @custom_values%> |
|
14 | <% end if @custom_values%> | |
15 |
|
15 | |||
16 | <p><%= f.check_box :admin %></p> |
|
16 | <p><%= f.check_box :admin %></p> | |
17 | <p><%= f.check_box :mail_notification %></p> |
|
|||
18 | </div> |
|
17 | </div> | |
19 |
|
18 | |||
20 | <div class="box"> |
|
19 | <div class="box"> |
@@ -284,7 +284,7 class Setup < ActiveRecord::Migration | |||||
284 | Permission.create :controller => "versions", :action => "destroy_file", :description => "button_delete", :sort => 1322 |
|
284 | Permission.create :controller => "versions", :action => "destroy_file", :description => "button_delete", :sort => 1322 | |
285 |
|
285 | |||
286 | # create default administrator account |
|
286 | # create default administrator account | |
287 |
user = User.create :firstname => " |
|
287 | user = User.create :firstname => "Redmine", :lastname => "Admin", :mail => "admin@somenet.foo", :mail_notification => true, :language => "en" | |
288 | user.login = "admin" |
|
288 | user.login = "admin" | |
289 | user.password = "admin" |
|
289 | user.password = "admin" | |
290 | user.admin = true |
|
290 | user.admin = true |
@@ -526,3 +526,8 label_theme: Тема | |||||
526 | label_default: По подразбиране |
|
526 | label_default: По подразбиране | |
527 | label_search_titles_only: Само в заглавията |
|
527 | label_search_titles_only: Само в заглавията | |
528 | label_nobody: nobody |
|
528 | label_nobody: nobody | |
|
529 | button_change_password: Change password | |||
|
530 | text_user_mail_option: "For unselected projects, you will only receive notifications about things you watch or you're involved in (eg. issues you're the author or assignee)." | |||
|
531 | label_user_mail_option_selected: "For any event on the selected projects only..." | |||
|
532 | label_user_mail_option_all: "For any event on all my projects" | |||
|
533 | label_user_mail_option_none: "Only for things I watch or I'm involved in" |
@@ -526,3 +526,8 label_theme: Theme | |||||
526 | label_default: Default |
|
526 | label_default: Default | |
527 | label_search_titles_only: Search titles only |
|
527 | label_search_titles_only: Search titles only | |
528 | label_nobody: nobody |
|
528 | label_nobody: nobody | |
|
529 | button_change_password: Change password | |||
|
530 | text_user_mail_option: "For unselected projects, you will only receive notifications about things you watch or you're involved in (eg. issues you're the author or assignee)." | |||
|
531 | label_user_mail_option_selected: "For any event on the selected projects only..." | |||
|
532 | label_user_mail_option_all: "For any event on all my projects" | |||
|
533 | label_user_mail_option_none: "Only for things I watch or I'm involved in" |
@@ -526,3 +526,8 label_theme: Theme | |||||
526 | label_default: Default |
|
526 | label_default: Default | |
527 | label_search_titles_only: Search titles only |
|
527 | label_search_titles_only: Search titles only | |
528 | label_nobody: nobody |
|
528 | label_nobody: nobody | |
|
529 | button_change_password: Change password | |||
|
530 | text_user_mail_option: "For unselected projects, you will only receive notifications about things you watch or you're involved in (eg. issues you're the author or assignee)." | |||
|
531 | label_user_mail_option_selected: "For any event on the selected projects only..." | |||
|
532 | label_user_mail_option_all: "For any event on all my projects" | |||
|
533 | label_user_mail_option_none: "Only for things I watch or I'm involved in" |
@@ -127,7 +127,7 field_parent: Subproject of | |||||
127 | field_is_in_chlog: Issues displayed in changelog |
|
127 | field_is_in_chlog: Issues displayed in changelog | |
128 | field_is_in_roadmap: Issues displayed in roadmap |
|
128 | field_is_in_roadmap: Issues displayed in roadmap | |
129 | field_login: Login |
|
129 | field_login: Login | |
130 |
field_mail_notification: |
|
130 | field_mail_notification: Email notifications | |
131 | field_admin: Administrator |
|
131 | field_admin: Administrator | |
132 | field_last_login_on: Last connection |
|
132 | field_last_login_on: Last connection | |
133 | field_language: Language |
|
133 | field_language: Language | |
@@ -174,7 +174,7 setting_login_required: Authent. required | |||||
174 | setting_self_registration: Self-registration enabled |
|
174 | setting_self_registration: Self-registration enabled | |
175 | setting_attachment_max_size: Attachment max. size |
|
175 | setting_attachment_max_size: Attachment max. size | |
176 | setting_issues_export_limit: Issues export limit |
|
176 | setting_issues_export_limit: Issues export limit | |
177 | setting_mail_from: Emission mail address |
|
177 | setting_mail_from: Emission email address | |
178 | setting_host_name: Host name |
|
178 | setting_host_name: Host name | |
179 | setting_text_formatting: Text formatting |
|
179 | setting_text_formatting: Text formatting | |
180 | setting_wiki_compression: Wiki history compression |
|
180 | setting_wiki_compression: Wiki history compression | |
@@ -437,6 +437,9 label_bulk_edit_selected_issues: Bulk edit selected issues | |||||
437 | label_theme: Theme |
|
437 | label_theme: Theme | |
438 | label_default: Default |
|
438 | label_default: Default | |
439 | label_search_titles_only: Search titles only |
|
439 | label_search_titles_only: Search titles only | |
|
440 | label_user_mail_option_all: "For any event on all my projects" | |||
|
441 | label_user_mail_option_selected: "For any event on the selected projects only..." | |||
|
442 | label_user_mail_option_none: "Only for things I watch or I'm involved in" | |||
440 |
|
443 | |||
441 | button_login: Login |
|
444 | button_login: Login | |
442 | button_submit: Submit |
|
445 | button_submit: Submit | |
@@ -470,12 +473,13 button_archive: Archive | |||||
470 | button_unarchive: Unarchive |
|
473 | button_unarchive: Unarchive | |
471 | button_reset: Reset |
|
474 | button_reset: Reset | |
472 | button_rename: Rename |
|
475 | button_rename: Rename | |
|
476 | button_change_password: Change password | |||
473 |
|
477 | |||
474 | status_active: active |
|
478 | status_active: active | |
475 | status_registered: registered |
|
479 | status_registered: registered | |
476 | status_locked: locked |
|
480 | status_locked: locked | |
477 |
|
481 | |||
478 | text_select_mail_notifications: Select actions for which mail notifications should be sent. |
|
482 | text_select_mail_notifications: Select actions for which email notifications should be sent. | |
479 | text_regexp_info: eg. ^[A-Z0-9]+$ |
|
483 | text_regexp_info: eg. ^[A-Z0-9]+$ | |
480 | text_min_max_length_info: 0 means no restriction |
|
484 | text_min_max_length_info: 0 means no restriction | |
481 | text_project_destroy_confirmation: Are you sure you want to delete this project and all related data ? |
|
485 | text_project_destroy_confirmation: Are you sure you want to delete this project and all related data ? | |
@@ -500,6 +504,7 text_wiki_destroy_confirmation: Are you sure you want to delete this wiki and al | |||||
500 | text_issue_category_destroy_question: Some issues (%d) are assigned to this category. What do you want to do ? |
|
504 | text_issue_category_destroy_question: Some issues (%d) are assigned to this category. What do you want to do ? | |
501 | text_issue_category_destroy_assignments: Remove category assignments |
|
505 | text_issue_category_destroy_assignments: Remove category assignments | |
502 | text_issue_category_reassign_to: Reassign issues to this category |
|
506 | text_issue_category_reassign_to: Reassign issues to this category | |
|
507 | text_user_mail_option: "For unselected projects, you will only receive notifications about things you watch or you're involved in (eg. issues you're the author or assignee)." | |||
503 |
|
508 | |||
504 | default_role_manager: Manager |
|
509 | default_role_manager: Manager | |
505 | default_role_developper: Developer |
|
510 | default_role_developper: Developer |
@@ -529,3 +529,8 label_theme: Theme | |||||
529 | label_default: Default |
|
529 | label_default: Default | |
530 | label_search_titles_only: Search titles only |
|
530 | label_search_titles_only: Search titles only | |
531 | label_nobody: nobody |
|
531 | label_nobody: nobody | |
|
532 | button_change_password: Change password | |||
|
533 | text_user_mail_option: "For unselected projects, you will only receive notifications about things you watch or you're involved in (eg. issues you're the author or assignee)." | |||
|
534 | label_user_mail_option_selected: "For any event on the selected projects only..." | |||
|
535 | label_user_mail_option_all: "For any event on all my projects" | |||
|
536 | label_user_mail_option_none: "Only for things I watch or I'm involved in" |
@@ -437,6 +437,9 label_bulk_edit_selected_issues: Modifier les demandes sélectionnées | |||||
437 | label_theme: Thème |
|
437 | label_theme: Thème | |
438 | label_default: Défaut |
|
438 | label_default: Défaut | |
439 | label_search_titles_only: Uniquement dans les titres |
|
439 | label_search_titles_only: Uniquement dans les titres | |
|
440 | label_user_mail_option_all: "Pour tous les événements de tous mes projets" | |||
|
441 | label_user_mail_option_selected: "Pour tous les événements des projets sélectionnés..." | |||
|
442 | label_user_mail_option_none: "Seulement pour ce que je surveille ou à quoi je participe" | |||
440 |
|
443 | |||
441 | button_login: Connexion |
|
444 | button_login: Connexion | |
442 | button_submit: Soumettre |
|
445 | button_submit: Soumettre | |
@@ -470,6 +473,7 button_archive: Archiver | |||||
470 | button_unarchive: Désarchiver |
|
473 | button_unarchive: Désarchiver | |
471 | button_reset: Réinitialiser |
|
474 | button_reset: Réinitialiser | |
472 | button_rename: Renommer |
|
475 | button_rename: Renommer | |
|
476 | button_change_password: Changer de mot de passe | |||
473 |
|
477 | |||
474 | status_active: actif |
|
478 | status_active: actif | |
475 | status_registered: enregistré |
|
479 | status_registered: enregistré | |
@@ -500,6 +504,7 text_wiki_destroy_confirmation: Etes-vous sûr de vouloir supprimer ce wiki et t | |||||
500 | text_issue_category_destroy_question: Des demandes (%d) sont affectées à cette catégories. Que voulez-vous faire ? |
|
504 | text_issue_category_destroy_question: Des demandes (%d) sont affectées à cette catégories. Que voulez-vous faire ? | |
501 | text_issue_category_destroy_assignments: N'affecter les demandes à aucune autre catégorie |
|
505 | text_issue_category_destroy_assignments: N'affecter les demandes à aucune autre catégorie | |
502 | text_issue_category_reassign_to: Réaffecter les demandes à cette catégorie |
|
506 | text_issue_category_reassign_to: Réaffecter les demandes à cette catégorie | |
|
507 | text_user_mail_option: "Pour les projets non sélectionnés, vous recevrez seulement des notifications pour ce que vous surveillez ou à quoi vous participez (exemple: demandes dont vous êtes l'auteur ou la personne assignée)." | |||
503 |
|
508 | |||
504 | default_role_manager: Manager |
|
509 | default_role_manager: Manager | |
505 | default_role_developper: Développeur |
|
510 | default_role_developper: Développeur |
@@ -526,3 +526,8 enumeration_doc_categories: קטגוריות מסמכים | |||||
526 | enumeration_activities: פעילויות (מעקב אחר זמנים) |
|
526 | enumeration_activities: פעילויות (מעקב אחר זמנים) | |
527 | label_search_titles_only: Search titles only |
|
527 | label_search_titles_only: Search titles only | |
528 | label_nobody: nobody |
|
528 | label_nobody: nobody | |
|
529 | button_change_password: Change password | |||
|
530 | text_user_mail_option: "For unselected projects, you will only receive notifications about things you watch or you're involved in (eg. issues you're the author or assignee)." | |||
|
531 | label_user_mail_option_selected: "For any event on the selected projects only..." | |||
|
532 | label_user_mail_option_all: "For any event on all my projects" | |||
|
533 | label_user_mail_option_none: "Only for things I watch or I'm involved in" |
@@ -526,3 +526,8 label_theme: Theme | |||||
526 | label_default: Default |
|
526 | label_default: Default | |
527 | label_search_titles_only: Search titles only |
|
527 | label_search_titles_only: Search titles only | |
528 | label_nobody: nobody |
|
528 | label_nobody: nobody | |
|
529 | button_change_password: Change password | |||
|
530 | text_user_mail_option: "For unselected projects, you will only receive notifications about things you watch or you're involved in (eg. issues you're the author or assignee)." | |||
|
531 | label_user_mail_option_selected: "For any event on the selected projects only..." | |||
|
532 | label_user_mail_option_all: "For any event on all my projects" | |||
|
533 | label_user_mail_option_none: "Only for things I watch or I'm involved in" |
@@ -527,3 +527,8 label_theme: テーマ | |||||
527 | label_default: 既定 |
|
527 | label_default: 既定 | |
528 | label_search_titles_only: Search titles only |
|
528 | label_search_titles_only: Search titles only | |
529 | label_nobody: nobody |
|
529 | label_nobody: nobody | |
|
530 | button_change_password: Change password | |||
|
531 | text_user_mail_option: "For unselected projects, you will only receive notifications about things you watch or you're involved in (eg. issues you're the author or assignee)." | |||
|
532 | label_user_mail_option_selected: "For any event on the selected projects only..." | |||
|
533 | label_user_mail_option_all: "For any event on all my projects" | |||
|
534 | label_user_mail_option_none: "Only for things I watch or I'm involved in" |
@@ -527,3 +527,8 label_theme: Theme | |||||
527 | label_default: Default |
|
527 | label_default: Default | |
528 | label_search_titles_only: Search titles only |
|
528 | label_search_titles_only: Search titles only | |
529 | label_nobody: nobody |
|
529 | label_nobody: nobody | |
|
530 | button_change_password: Change password | |||
|
531 | text_user_mail_option: "For unselected projects, you will only receive notifications about things you watch or you're involved in (eg. issues you're the author or assignee)." | |||
|
532 | label_user_mail_option_selected: "For any event on the selected projects only..." | |||
|
533 | label_user_mail_option_all: "For any event on all my projects" | |||
|
534 | label_user_mail_option_none: "Only for things I watch or I'm involved in" |
@@ -526,3 +526,8 label_theme: Temat | |||||
526 | label_default: Domyślne |
|
526 | label_default: Domyślne | |
527 | label_search_titles_only: Przeszukuj tylko tytuły |
|
527 | label_search_titles_only: Przeszukuj tylko tytuły | |
528 | label_nobody: nobody |
|
528 | label_nobody: nobody | |
|
529 | button_change_password: Change password | |||
|
530 | text_user_mail_option: "For unselected projects, you will only receive notifications about things you watch or you're involved in (eg. issues you're the author or assignee)." | |||
|
531 | label_user_mail_option_selected: "For any event on the selected projects only..." | |||
|
532 | label_user_mail_option_all: "For any event on all my projects" | |||
|
533 | label_user_mail_option_none: "Only for things I watch or I'm involved in" |
@@ -526,3 +526,8 label_theme: Theme | |||||
526 | label_default: Default |
|
526 | label_default: Default | |
527 | label_search_titles_only: Search titles only |
|
527 | label_search_titles_only: Search titles only | |
528 | label_nobody: nobody |
|
528 | label_nobody: nobody | |
|
529 | button_change_password: Change password | |||
|
530 | text_user_mail_option: "For unselected projects, you will only receive notifications about things you watch or you're involved in (eg. issues you're the author or assignee)." | |||
|
531 | label_user_mail_option_selected: "For any event on the selected projects only..." | |||
|
532 | label_user_mail_option_all: "For any event on all my projects" | |||
|
533 | label_user_mail_option_none: "Only for things I watch or I'm involved in" |
@@ -526,3 +526,8 label_theme: Theme | |||||
526 | label_default: Default |
|
526 | label_default: Default | |
527 | label_search_titles_only: Search titles only |
|
527 | label_search_titles_only: Search titles only | |
528 | label_nobody: nobody |
|
528 | label_nobody: nobody | |
|
529 | button_change_password: Change password | |||
|
530 | text_user_mail_option: "For unselected projects, you will only receive notifications about things you watch or you're involved in (eg. issues you're the author or assignee)." | |||
|
531 | label_user_mail_option_selected: "For any event on the selected projects only..." | |||
|
532 | label_user_mail_option_all: "For any event on all my projects" | |||
|
533 | label_user_mail_option_none: "Only for things I watch or I'm involved in" |
@@ -526,3 +526,8 label_theme: Theme | |||||
526 | label_default: Default |
|
526 | label_default: Default | |
527 | label_search_titles_only: Search titles only |
|
527 | label_search_titles_only: Search titles only | |
528 | label_nobody: nobody |
|
528 | label_nobody: nobody | |
|
529 | button_change_password: Change password | |||
|
530 | text_user_mail_option: "For unselected projects, you will only receive notifications about things you watch or you're involved in (eg. issues you're the author or assignee)." | |||
|
531 | label_user_mail_option_selected: "For any event on the selected projects only..." | |||
|
532 | label_user_mail_option_all: "For any event on all my projects" | |||
|
533 | label_user_mail_option_none: "Only for things I watch or I'm involved in" |
@@ -527,3 +527,8 label_theme: Theme | |||||
527 | label_default: Default |
|
527 | label_default: Default | |
528 | label_search_titles_only: Search titles only |
|
528 | label_search_titles_only: Search titles only | |
529 | label_nobody: nobody |
|
529 | label_nobody: nobody | |
|
530 | button_change_password: Change password | |||
|
531 | text_user_mail_option: "For unselected projects, you will only receive notifications about things you watch or you're involved in (eg. issues you're the author or assignee)." | |||
|
532 | label_user_mail_option_selected: "For any event on the selected projects only..." | |||
|
533 | label_user_mail_option_all: "For any event on all my projects" | |||
|
534 | label_user_mail_option_none: "Only for things I watch or I'm involved in" |
@@ -529,3 +529,8 label_theme: Theme | |||||
529 | label_default: Default |
|
529 | label_default: Default | |
530 | label_search_titles_only: Search titles only |
|
530 | label_search_titles_only: Search titles only | |
531 | label_nobody: nobody |
|
531 | label_nobody: nobody | |
|
532 | button_change_password: Change password | |||
|
533 | text_user_mail_option: "For unselected projects, you will only receive notifications about things you watch or you're involved in (eg. issues you're the author or assignee)." | |||
|
534 | label_user_mail_option_selected: "For any event on the selected projects only..." | |||
|
535 | label_user_mail_option_all: "For any event on all my projects" | |||
|
536 | label_user_mail_option_none: "Only for things I watch or I'm involved in" |
@@ -116,6 +116,7 textarea.wiki-edit { width: 99%; } | |||||
116 | li p {margin-top: 0;} |
|
116 | li p {margin-top: 0;} | |
117 | div.issue {background:#ffffdd; padding:6px; margin-bottom:6px;border: 1px solid #d7d7d7;} |
|
117 | div.issue {background:#ffffdd; padding:6px; margin-bottom:6px;border: 1px solid #d7d7d7;} | |
118 | .autoscroll {overflow-x: auto; padding:1px; width:100%;} |
|
118 | .autoscroll {overflow-x: auto; padding:1px; width:100%;} | |
|
119 | #user_firstname, #user_lastname, #user_mail, #notification_option { width: 90%; } | |||
119 |
|
120 | |||
120 | /***** Tabular forms ******/ |
|
121 | /***** Tabular forms ******/ | |
121 | .tabular p{ |
|
122 | .tabular p{ |
@@ -61,29 +61,30 class MyControllerTest < Test::Unit::TestCase | |||||
61 | end |
|
61 | end | |
62 |
|
62 | |||
63 | def test_change_password |
|
63 | def test_change_password | |
64 |
get : |
|
64 | get :password | |
65 | assert_response :success |
|
65 | assert_response :success | |
66 |
assert_template ' |
|
66 | assert_template 'password' | |
67 |
|
67 | |||
68 | # non matching password confirmation |
|
68 | # non matching password confirmation | |
69 |
post : |
|
69 | post :password, :password => 'jsmith', | |
70 |
|
|
70 | :new_password => 'hello', | |
71 |
|
|
71 | :new_password_confirmation => 'hello2' | |
72 | assert_response :success |
|
72 | assert_response :success | |
73 |
assert_template ' |
|
73 | assert_template 'password' | |
74 | assert_tag :tag => "div", :attributes => { :class => "errorExplanation" } |
|
74 | assert_tag :tag => "div", :attributes => { :class => "errorExplanation" } | |
75 |
|
75 | |||
76 | # wrong password |
|
76 | # wrong password | |
77 |
post : |
|
77 | post :password, :password => 'wrongpassword', | |
78 |
|
|
78 | :new_password => 'hello', | |
79 |
|
|
79 | :new_password_confirmation => 'hello' | |
80 | assert_redirected_to 'my/account' |
|
80 | assert_response :success | |
|
81 | assert_template 'password' | |||
81 | assert_equal 'Wrong password', flash[:error] |
|
82 | assert_equal 'Wrong password', flash[:error] | |
82 |
|
83 | |||
83 | # good password |
|
84 | # good password | |
84 |
post : |
|
85 | post :password, :password => 'jsmith', | |
85 |
|
|
86 | :new_password => 'hello', | |
86 |
|
|
87 | :new_password_confirmation => 'hello' | |
87 | assert_redirected_to 'my/account' |
|
88 | assert_redirected_to 'my/account' | |
88 | assert User.try_to_login('jsmith', 'hello') |
|
89 | assert User.try_to_login('jsmith', 'hello') | |
89 | end |
|
90 | end |
@@ -105,4 +105,28 class UserTest < Test::Unit::TestCase | |||||
105 | # user with no role |
|
105 | # user with no role | |
106 | assert !@dlopper.role_for_project(Project.find(2)).member? |
|
106 | assert !@dlopper.role_for_project(Project.find(2)).member? | |
107 | end |
|
107 | end | |
|
108 | ||||
|
109 | def test_mail_notification_all | |||
|
110 | @jsmith.mail_notification = true | |||
|
111 | @jsmith.notified_project_ids = [] | |||
|
112 | @jsmith.save | |||
|
113 | @jsmith.reload | |||
|
114 | assert @jsmith.projects.first.recipients.include?(@jsmith.mail) | |||
|
115 | end | |||
|
116 | ||||
|
117 | def test_mail_notification_selected | |||
|
118 | @jsmith.mail_notification = false | |||
|
119 | @jsmith.notified_project_ids = [@jsmith.projects.first.id] | |||
|
120 | @jsmith.save | |||
|
121 | @jsmith.reload | |||
|
122 | assert @jsmith.projects.first.recipients.include?(@jsmith.mail) | |||
|
123 | end | |||
|
124 | ||||
|
125 | def test_mail_notification_none | |||
|
126 | @jsmith.mail_notification = false | |||
|
127 | @jsmith.notified_project_ids = [] | |||
|
128 | @jsmith.save | |||
|
129 | @jsmith.reload | |||
|
130 | assert !@jsmith.projects.first.recipients.include?(@jsmith.mail) | |||
|
131 | end | |||
108 | end |
|
132 | end |
General Comments 0
You need to be logged in to leave comments.
Login now