From d02f6a8e32d1e09e5303d36f09788a2d19ac413a Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Thu, 2 Feb 2012 18:09:37 +0000 Subject: [PATCH] Adds a setting that allows to reference/fix issues of all projects (#3087). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8750 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/changeset.rb | 6 +++-- app/views/settings/_repositories.html.erb | 2 ++ config/locales/ar.yml | 1 + config/locales/bg.yml | 1 + config/locales/bs.yml | 1 + config/locales/ca.yml | 1 + config/locales/cs.yml | 1 + config/locales/da.yml | 1 + config/locales/de.yml | 1 + config/locales/el.yml | 1 + config/locales/en-GB.yml | 1 + config/locales/en.yml | 1 + config/locales/es.yml | 1 + config/locales/eu.yml | 1 + config/locales/fa.yml | 1 + config/locales/fi.yml | 1 + config/locales/fr.yml | 1 + config/locales/gl.yml | 1 + config/locales/he.yml | 1 + config/locales/hr.yml | 1 + config/locales/hu.yml | 1 + config/locales/id.yml | 1 + config/locales/it.yml | 1 + config/locales/ja.yml | 1 + config/locales/ko.yml | 1 + config/locales/lt.yml | 1 + config/locales/lv.yml | 1 + config/locales/mk.yml | 1 + config/locales/mn.yml | 1 + config/locales/nl.yml | 1 + config/locales/no.yml | 1 + config/locales/pl.yml | 1 + config/locales/pt-BR.yml | 1 + config/locales/pt.yml | 1 + config/locales/ro.yml | 1 + config/locales/ru.yml | 1 + config/locales/sk.yml | 1 + config/locales/sl.yml | 1 + config/locales/sr-YU.yml | 1 + config/locales/sr.yml | 1 + config/locales/sv.yml | 1 + config/locales/th.yml | 1 + config/locales/tr.yml | 1 + config/locales/uk.yml | 1 + config/locales/vi.yml | 1 + config/locales/zh-TW.yml | 1 + config/locales/zh.yml | 1 + config/settings.yml | 2 ++ test/unit/changeset_test.rb | 30 +++++++++++++++++++++++ 49 files changed, 83 insertions(+), 2 deletions(-) diff --git a/app/models/changeset.rb b/app/models/changeset.rb index e90901ef5..d017ad03b 100644 --- a/app/models/changeset.rb +++ b/app/models/changeset.rb @@ -187,11 +187,13 @@ class Changeset < ActiveRecord::Base private # Finds an issue that can be referenced by the commit message - # i.e. an issue that belong to the repository project, a subproject or a parent project def find_referenced_issue_by_id(id) return nil if id.blank? issue = Issue.find_by_id(id.to_i, :include => :project) - if issue + if Setting.commit_cross_project_ref? + # all issues can be referenced/fixed + elsif issue + # issue that belong to the repository project, a subproject or a parent project only unless issue.project && (project == issue.project || project.is_ancestor_of?(issue.project) || project.is_descendant_of?(issue.project)) diff --git a/app/views/settings/_repositories.html.erb b/app/views/settings/_repositories.html.erb index 978aebe85..12631c0cc 100644 --- a/app/views/settings/_repositories.html.erb +++ b/app/views/settings/_repositories.html.erb @@ -81,6 +81,8 @@ :label => false %>
<%= l(:text_comma_separated) %>

+

<%= setting_check_box :commit_cross_project_ref %>

+

<%= setting_check_box :commit_logtime_enabled, :onclick => "if (this.checked) { Form.Element.enable('settings_commit_logtime_activity_id'); } else { Form.Element.disable('settings_commit_logtime_activity_id'); }"%>

diff --git a/config/locales/ar.yml b/config/locales/ar.yml index 40e558dea..5f7e321af 100644 --- a/config/locales/ar.yml +++ b/config/locales/ar.yml @@ -1017,3 +1017,4 @@ ar: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/bg.yml b/config/locales/bg.yml index c046f38e9..ac67c8bfb 100644 --- a/config/locales/bg.yml +++ b/config/locales/bg.yml @@ -1015,3 +1015,4 @@ bg: description_date_range_interval: Изберете диапазон чрез задаване на начална и крайна дати description_date_from: Въведете начална дата description_date_to: Въведете крайна дата + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/bs.yml b/config/locales/bs.yml index 2c41a7a73..b452eba88 100644 --- a/config/locales/bs.yml +++ b/config/locales/bs.yml @@ -1031,3 +1031,4 @@ bs: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/ca.yml b/config/locales/ca.yml index ba235ad57..29290160f 100644 --- a/config/locales/ca.yml +++ b/config/locales/ca.yml @@ -1019,3 +1019,4 @@ ca: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/cs.yml b/config/locales/cs.yml index 5b509217e..af74ee244 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -1020,3 +1020,4 @@ cs: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/da.yml b/config/locales/da.yml index 82f45801e..2471d1187 100644 --- a/config/locales/da.yml +++ b/config/locales/da.yml @@ -1034,3 +1034,4 @@ da: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/de.yml b/config/locales/de.yml index 47b546960..8588ab8c2 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -1037,3 +1037,4 @@ de: label_item_position: "%{position}/%{count}" label_completed_versions: Completed versions field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/el.yml b/config/locales/el.yml index df916089a..e3cb20932 100644 --- a/config/locales/el.yml +++ b/config/locales/el.yml @@ -1017,3 +1017,4 @@ el: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/en-GB.yml b/config/locales/en-GB.yml index 3d16c4437..a64c3fc2e 100644 --- a/config/locales/en-GB.yml +++ b/config/locales/en-GB.yml @@ -1019,3 +1019,4 @@ en-GB: label_item_position: "%{position} of %{count}" label_completed_versions: Completed versions field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/en.yml b/config/locales/en.yml index 90266c2ca..a000d60df 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -380,6 +380,7 @@ en: setting_gantt_items_limit: Maximum number of items displayed on the gantt chart setting_issue_group_assignment: Allow issue assignment to groups setting_default_issue_start_date_to_creation_date: Use current date as start date for new issues + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed permission_add_project: Create project permission_add_subprojects: Create subprojects diff --git a/config/locales/es.yml b/config/locales/es.yml index 8ed16d2ec..018831f75 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -1054,3 +1054,4 @@ es: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/eu.yml b/config/locales/eu.yml index 5d61f2f2e..a02157a52 100644 --- a/config/locales/eu.yml +++ b/config/locales/eu.yml @@ -1020,3 +1020,4 @@ eu: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/fa.yml b/config/locales/fa.yml index e36576ab5..1a8ca71a5 100644 --- a/config/locales/fa.yml +++ b/config/locales/fa.yml @@ -1019,3 +1019,4 @@ fa: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/fi.yml b/config/locales/fi.yml index bddd95e3b..2ad1e9884 100644 --- a/config/locales/fi.yml +++ b/config/locales/fi.yml @@ -1038,3 +1038,4 @@ fi: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 17dc8a9be..ebed747af 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -376,6 +376,7 @@ fr: setting_gantt_items_limit: Nombre maximum d'éléments affichés sur le gantt setting_issue_group_assignment: Permettre l'assignement des demandes aux groupes setting_default_issue_start_date_to_creation_date: Donner à la date de début d'une nouvelle demande la valeur de la date du jour + setting_commit_cross_project_ref: Permettre le référencement et la résolution des demandes de tous les autres projets permission_add_project: Créer un projet permission_add_subprojects: Créer des sous-projets diff --git a/config/locales/gl.yml b/config/locales/gl.yml index 5dd41cc55..12331b29b 100644 --- a/config/locales/gl.yml +++ b/config/locales/gl.yml @@ -1028,3 +1028,4 @@ gl: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/he.yml b/config/locales/he.yml index 3576dfc5a..c877adf3c 100644 --- a/config/locales/he.yml +++ b/config/locales/he.yml @@ -1022,3 +1022,4 @@ he: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/hr.yml b/config/locales/hr.yml index cda30733c..3d09f1b18 100644 --- a/config/locales/hr.yml +++ b/config/locales/hr.yml @@ -1023,3 +1023,4 @@ hr: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/hu.yml b/config/locales/hu.yml index 8b9156f76..ddff9f764 100644 --- a/config/locales/hu.yml +++ b/config/locales/hu.yml @@ -1036,3 +1036,4 @@ label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/id.yml b/config/locales/id.yml index e66b36d06..6ebd43b17 100644 --- a/config/locales/id.yml +++ b/config/locales/id.yml @@ -1023,3 +1023,4 @@ id: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/it.yml b/config/locales/it.yml index 302d1e4ba..309d878ca 100644 --- a/config/locales/it.yml +++ b/config/locales/it.yml @@ -1018,3 +1018,4 @@ it: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/ja.yml b/config/locales/ja.yml index 2e741effb..b2306d8c8 100644 --- a/config/locales/ja.yml +++ b/config/locales/ja.yml @@ -1047,3 +1047,4 @@ ja: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/ko.yml b/config/locales/ko.yml index 6b079b184..0b7d8710b 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -1069,3 +1069,4 @@ ko: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/lt.yml b/config/locales/lt.yml index 12b5f6f92..c1529496f 100644 --- a/config/locales/lt.yml +++ b/config/locales/lt.yml @@ -1077,3 +1077,4 @@ lt: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/lv.yml b/config/locales/lv.yml index 596a16c7a..4d36e9082 100644 --- a/config/locales/lv.yml +++ b/config/locales/lv.yml @@ -1011,3 +1011,4 @@ lv: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/mk.yml b/config/locales/mk.yml index 7fff1db6b..95e756fd0 100644 --- a/config/locales/mk.yml +++ b/config/locales/mk.yml @@ -1017,3 +1017,4 @@ mk: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/mn.yml b/config/locales/mn.yml index 867e63831..9082312ce 100644 --- a/config/locales/mn.yml +++ b/config/locales/mn.yml @@ -1017,3 +1017,4 @@ mn: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/nl.yml b/config/locales/nl.yml index ceefb3a44..d7420078f 100644 --- a/config/locales/nl.yml +++ b/config/locales/nl.yml @@ -999,3 +999,4 @@ nl: label_item_position: "%{position}/%{count}" label_completed_versions: Completed versions field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/no.yml b/config/locales/no.yml index 8cda6600c..c12deac59 100644 --- a/config/locales/no.yml +++ b/config/locales/no.yml @@ -1007,3 +1007,4 @@ label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/pl.yml b/config/locales/pl.yml index 2b819e79e..eddba2036 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -1034,3 +1034,4 @@ pl: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index 30354acb3..e44340d6f 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -1040,3 +1040,4 @@ pt-BR: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/pt.yml b/config/locales/pt.yml index 42aa87cce..4218d1272 100644 --- a/config/locales/pt.yml +++ b/config/locales/pt.yml @@ -1022,3 +1022,4 @@ pt: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/ro.yml b/config/locales/ro.yml index 56287a1ba..40d8de4a5 100644 --- a/config/locales/ro.yml +++ b/config/locales/ro.yml @@ -1014,3 +1014,4 @@ ro: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 01f344e4b..f2246ab6b 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -1130,3 +1130,4 @@ ru: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/sk.yml b/config/locales/sk.yml index 0c2cdafe9..8c10a393d 100644 --- a/config/locales/sk.yml +++ b/config/locales/sk.yml @@ -1017,3 +1017,4 @@ sk: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/sl.yml b/config/locales/sl.yml index b204998fa..b129d8d45 100644 --- a/config/locales/sl.yml +++ b/config/locales/sl.yml @@ -1017,3 +1017,4 @@ sl: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/sr-YU.yml b/config/locales/sr-YU.yml index fd7995a63..f63491422 100644 --- a/config/locales/sr-YU.yml +++ b/config/locales/sr-YU.yml @@ -1017,3 +1017,4 @@ sr-YU: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/sr.yml b/config/locales/sr.yml index f007152df..e56dbcc18 100644 --- a/config/locales/sr.yml +++ b/config/locales/sr.yml @@ -1018,3 +1018,4 @@ sr: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/sv.yml b/config/locales/sv.yml index ff650440a..e894dd621 100644 --- a/config/locales/sv.yml +++ b/config/locales/sv.yml @@ -1058,3 +1058,4 @@ sv: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/th.yml b/config/locales/th.yml index 86e086bab..0c52f74c0 100644 --- a/config/locales/th.yml +++ b/config/locales/th.yml @@ -1014,3 +1014,4 @@ th: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/tr.yml b/config/locales/tr.yml index 2985c66ae..c2200b973 100644 --- a/config/locales/tr.yml +++ b/config/locales/tr.yml @@ -1036,3 +1036,4 @@ tr: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/uk.yml b/config/locales/uk.yml index a3bc8283f..418db9119 100644 --- a/config/locales/uk.yml +++ b/config/locales/uk.yml @@ -1014,3 +1014,4 @@ uk: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/vi.yml b/config/locales/vi.yml index 87b48f441..e7eba7d00 100644 --- a/config/locales/vi.yml +++ b/config/locales/vi.yml @@ -1068,3 +1068,4 @@ vi: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/zh-TW.yml b/config/locales/zh-TW.yml index 1698d99df..57399bcc7 100644 --- a/config/locales/zh-TW.yml +++ b/config/locales/zh-TW.yml @@ -1097,3 +1097,4 @@ label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/locales/zh.yml b/config/locales/zh.yml index cc2122293..9995b3ce8 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1019,3 +1019,4 @@ zh: label_completed_versions: Completed versions text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.
Once saved, the identifier cannot be changed. field_multiple: Multiple values + setting_commit_cross_project_ref: Allow issues of all the other projects to be referenced and fixed diff --git a/config/settings.yml b/config/settings.yml index d46f8f792..28948fffe 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -92,6 +92,8 @@ sys_api_enabled: default: 0 sys_api_key: default: '' +commit_cross_project_ref: + default: 0 commit_ref_keywords: default: 'refs,references,IssueID' commit_fix_keywords: diff --git a/test/unit/changeset_test.rb b/test/unit/changeset_test.rb index cee7d4fd6..9b929a0fc 100644 --- a/test/unit/changeset_test.rb +++ b/test/unit/changeset_test.rb @@ -192,6 +192,36 @@ class ChangesetTest < ActiveSupport::TestCase assert c.issues.first.project != c.project end + def test_commit_referencing_a_project_with_commit_cross_project_ref_disabled + r = Repository::Subversion.create!( + :project => Project.find(3), + :url => 'svn://localhost/test') + + with_settings :commit_cross_project_ref => '0' do + c = Changeset.new(:repository => r, + :committed_on => Time.now, + :comments => 'refs #4, an issue of a different project', + :revision => '12345') + assert c.save + assert_equal [], c.issue_ids + end + end + + def test_commit_referencing_a_project_with_commit_cross_project_ref_enabled + r = Repository::Subversion.create!( + :project => Project.find(3), + :url => 'svn://localhost/test') + + with_settings :commit_cross_project_ref => '1' do + c = Changeset.new(:repository => r, + :committed_on => Time.now, + :comments => 'refs #4, an issue of a different project', + :revision => '12345') + assert c.save + assert_equal [4], c.issue_ids + end + end + def test_text_tag_revision c = Changeset.new(:revision => '520') assert_equal 'r520', c.text_tag