Feature #2716 » auto_watch_assignee.patch
| app/models/journal.rb | ||
|---|---|---|
| 354 | 354 |
!Watcher.any_watched?(Array.wrap(journalized), user) |
| 355 | 355 |
journalized.set_watcher(user, true) |
| 356 | 356 |
end |
| 357 | ||
| 358 |
assignee = journalized.assigned_to |
|
| 359 |
if assignee.is_a?(User) && assignee&.active? && |
|
| 360 |
assignee.allowed_to?(:add_issue_watchers, project) && |
|
| 361 |
assignee.pref.auto_watch_on?('issue_assigned_to_me') &&
|
|
| 362 |
!Watcher.any_watched?(Array.wrap(journalized), assignee) |
|
| 363 |
journalized.set_watcher(assignee, true) |
|
| 364 |
end |
|
| 357 | 365 |
end |
| 358 | 366 | |
| 359 | 367 |
def send_notification |
| app/models/user_preference.rb | ||
|---|---|---|
| 44 | 44 | |
| 45 | 45 |
TEXTAREA_FONT_OPTIONS = ['monospace', 'proportional'] |
| 46 | 46 |
DEFAULT_TOOLBAR_LANGUAGE_OPTIONS = %w[c cpp csharp css diff go groovy html java javascript objc perl php python r ruby sass scala shell sql swift xml yaml] |
| 47 |
AUTO_WATCH_ON_OPTIONS = %w[issue_created issue_contributed_to] |
|
| 47 |
AUTO_WATCH_ON_OPTIONS = %w[issue_created issue_contributed_to issue_assigned_to_me]
|
|
| 48 | 48 | |
| 49 | 49 |
def initialize(attributes=nil, *args) |
| 50 | 50 |
super |
| config/locales/en.yml | ||
|---|---|---|
| 993 | 993 |
label_auto_watch_on: Auto watch |
| 994 | 994 |
label_auto_watch_on_issue_created: Issues I created |
| 995 | 995 |
label_auto_watch_on_issue_contributed_to: Issues I contributed to |
| 996 |
label_auto_watch_on_issue_assigned_to_me: Issues assigned to me |
|
| 996 | 997 |
label_preferences: Preferences |
| 997 | 998 |
label_chronological_order: In chronological order |
| 998 | 999 |
label_reverse_chronological_order: In reverse chronological order |