]> source.dussan.org Git - redmine.git/commitdiff
Adds a setting that allows to reference/fix issues of all projects (#3087).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 2 Feb 2012 18:09:37 +0000 (18:09 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Thu, 2 Feb 2012 18:09:37 +0000 (18:09 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8750 e93f8b46-1217-0410-a6f0-8f06a7374b81

49 files changed:
app/models/changeset.rb
app/views/settings/_repositories.html.erb
config/locales/ar.yml
config/locales/bg.yml
config/locales/bs.yml
config/locales/ca.yml
config/locales/cs.yml
config/locales/da.yml
config/locales/de.yml
config/locales/el.yml
config/locales/en-GB.yml
config/locales/en.yml
config/locales/es.yml
config/locales/eu.yml
config/locales/fa.yml
config/locales/fi.yml
config/locales/fr.yml
config/locales/gl.yml
config/locales/he.yml
config/locales/hr.yml
config/locales/hu.yml
config/locales/id.yml
config/locales/it.yml
config/locales/ja.yml
config/locales/ko.yml
config/locales/lt.yml
config/locales/lv.yml
config/locales/mk.yml
config/locales/mn.yml
config/locales/nl.yml
config/locales/no.yml
config/locales/pl.yml
config/locales/pt-BR.yml
config/locales/pt.yml
config/locales/ro.yml
config/locales/ru.yml
config/locales/sk.yml
config/locales/sl.yml
config/locales/sr-YU.yml
config/locales/sr.yml
config/locales/sv.yml
config/locales/th.yml
config/locales/tr.yml
config/locales/uk.yml
config/locales/vi.yml
config/locales/zh-TW.yml
config/locales/zh.yml
config/settings.yml
test/unit/changeset_test.rb

index e90901ef5a3a317c42f8911573387db045902fa8..d017ad03bd5cb98974c86dc5dda4cd16cf1c8a61 100644 (file)
@@ -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))
index 978aebe85cec5362198458827b043599e03ad37f..12631c0ccb5744d8a983204ac8454e51db08fefc 100644 (file)
@@ -81,6 +81,8 @@
                                                        :label => false %>
 <br /><em><%= l(:text_comma_separated) %></em></p>
 
+<p><%= setting_check_box :commit_cross_project_ref %></p>
+
 <p><%= 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'); }"%></p>
index 40e558deaa26f348e8334b68fdff6b5503346af7..5f7e321af7a5df939bbba523cce15a838eab78a1 100644 (file)
@@ -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.<br />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
index c046f38e9d53bab6774e7e2e10d4b0a455fbb7fd..ac67c8bfbe53ac33644cab0764aaa4296a7aeabb 100644 (file)
@@ -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
index 2c41a7a73a05982251d903b4c16d349b11916a93..b452eba889f3e1926c7a57c25c4b031f52685e18 100644 (file)
@@ -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.<br />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
index ba235ad574e57bfb37902b8b1dcdb0dd1bc0cc69..29290160f315607f14bf83d52b7af4e0964d90bf 100644 (file)
@@ -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.<br />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
index 5b509217eb79e6486d545eef99b937d4325a36bc..af74ee244b6702b1ab73806212775f608d85f877 100644 (file)
@@ -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.<br />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
index 82f45801e9a2e5e6f197c7c4590043e76e8b107e..2471d1187a87ba2fccd26486d11de96ff83ceae1 100644 (file)
@@ -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.<br />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
index 47b546960660553827e7b89473a794559783e4ff..8588ab8c275374a070d7ec46179a3b69bf589ab8 100644 (file)
@@ -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
index df916089a9190b7812a2fc7696d2c7b403d4066f..e3cb20932b54db4d03a5273b719845a663dc2832 100644 (file)
@@ -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.<br />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
index 3d16c4437c783afd8c877b13fc4ee7bf3e321200..a64c3fc2eb6fb92c1ce72c862ec46b1bc22e5e94 100644 (file)
@@ -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
index 90266c2ca1ca5dc01c853962fa8586eca82240cc..a000d60dfec79a0f291d9b9d21ba8ddc875a3d35 100644 (file)
@@ -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
index 8ed16d2ece91632a5389758067d574a223d5e32b..018831f75986d2707e1d9112f6718a698570270c 100644 (file)
@@ -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.<br />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
index 5d61f2f2ebb58b10fc88483645fe112497d33f91..a02157a52568c3147885f275bca6b232c05683bf 100644 (file)
@@ -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.<br />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
index e36576ab5c2e45753838fb4791a22104c024d488..1a8ca71a53836dbfa3ebc46e2aa957d3862b5e35 100644 (file)
@@ -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.<br />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
index bddd95e3b93cf2b4ce6213005b7390450478ba39..2ad1e9884194b2926fd5ea0ff2f68ee922fbf2e1 100644 (file)
@@ -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.<br />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
index 17dc8a9be342f5afcb47dc1a55ca7d91d3e8cdb3..ebed747afb8e425ef7ee64c66e99b3015f3d6bbf 100644 (file)
@@ -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
index 5dd41cc551c9212bff07e3e9be6ba6e5381e81c2..12331b29bff2d8e16104a022b8ded5c8efb08361 100644 (file)
@@ -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.<br />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
index 3576dfc5aca77a3435edbfede3894d2310aa5ef6..c877adf3c992c70c1f9ba7f0748ab72ace7a6b70 100644 (file)
@@ -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.<br />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
index cda30733ccbe08a0bad3149403321eeab8455d24..3d09f1b18f65ba53da779839c65834504bf728f8 100644 (file)
@@ -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.<br />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
index 8b9156f766442fda5b2a6df55fe74a1ced32c94b..ddff9f76457a59fc402f87b646fcce7ed9a50707 100644 (file)
   label_completed_versions: Completed versions
   text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.<br />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
index e66b36d0605154794405d60ef3dbb54b73418d0e..6ebd43b174e9e4ad11f04ebdeeb45bde89f34b3f 100644 (file)
@@ -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.<br />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
index 302d1e4ba5addd2224697ed78ff4f1d5e8d6eecb..309d878caee9f27aed79195d9284ea73e5e3975a 100644 (file)
@@ -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.<br />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
index 2e741effb29284ba5a57413665382373cbfd823f..b2306d8c88fde8b35b0d215516485e5f8b221197 100644 (file)
@@ -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.<br />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
index 6b079b184c50fcadf10ed0b906df5a5a5a43edbf..0b7d8710b4e50a20456bcdd0d588a759dd2c8b35 100644 (file)
@@ -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.<br />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
index 12b5f6f9238d6c66df939ffa756b819e1a472ea2..c1529496fb6cf9eb07ff1b8af8e16055db6b18df 100644 (file)
@@ -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.<br />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
index 596a16c7a402e8ccda65f414577e26fde367d921..4d36e90824ddc50b19264c5eefee8d797fa77d0a 100644 (file)
@@ -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.<br />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
index 7fff1db6bb3a9d0162cd75b3809b6e7d16f8127b..95e756fd09f8e772d6c9477331cd4045ed54c7ae 100644 (file)
@@ -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.<br />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
index 867e63831aa87b603162f49f0293e97453348fad..9082312ce42e89d8250bc9366d9397533ad6a0c7 100644 (file)
@@ -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.<br />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
index ceefb3a442ac5811e6c65682174fbc0bebade149..d7420078fd4bd10eaf7025ee8a91eb46420ba474 100644 (file)
@@ -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
index 8cda6600c0c96cde391a2ae0967d2059ea64aeac..c12deac591e7dfb1042370cab8d35406be96d32f 100644 (file)
   label_completed_versions: Completed versions
   text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.<br />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
index 2b819e79e60c5efc1bcf7052faa864cc5fedc43b..eddba2036eeda3d763d7b552f75a573780ae130a 100644 (file)
@@ -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.<br />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
index 30354acb33a0487817fabca31f937bfa59d07e5a..e44340d6f79dbe755299292f3fb51a1879fa0d8f 100644 (file)
@@ -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.<br />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
index 42aa87cce5379a95ff0fad04efb55e13953e2911..4218d1272b07d598d37b7ffd1cd9b770f013f302 100644 (file)
@@ -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.<br />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
index 56287a1bac9bcccf4b9635c89e495cba528a4192..40d8de4a5982f21f7c3cf73991643c56fd620976 100644 (file)
@@ -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.<br />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
index 01f344e4be8afdaa48eb572052ab46c7279eff13..f2246ab6b515534a10314728ed7e07c8e796eac6 100644 (file)
@@ -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.<br />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
index 0c2cdafe93099dd0180692803e806f353ef6ed8f..8c10a393dd12dfcf4451369ca8cbeb8dbccff2ee 100644 (file)
@@ -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.<br />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
index b204998fa42febcdc18974282968a1e82acda197..b129d8d457e5a0dec5a50ce5e39120c3ef3adec4 100644 (file)
@@ -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.<br />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
index fd7995a6368f4e0784bd7ff8b4ed5a84a0f822a4..f63491422fad04665ea3281dca29a42ab8c79a1f 100644 (file)
@@ -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.<br />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
index f007152df7737ab30667b30cd633789cf0a6b516..e56dbcc18bec27ea8eff765cdd73b0f618cb4982 100644 (file)
@@ -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.<br />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
index ff650440a03f55054cc0a8e72396422de23f2df1..e894dd6216d018c44a9d79089397d068ed022dd7 100644 (file)
@@ -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.<br />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
index 86e086babf902d8c03802eda63e362776ef60e0b..0c52f74c0769c023386632a4245c091be4a85ed6 100644 (file)
@@ -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.<br />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
index 2985c66ae1bf512a5f518dde006af6962cd8f5e8..c2200b973ba07d90e23cdbfa42e9676f73993fe8 100644 (file)
@@ -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.<br />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
index a3bc8283f53cc963ea7486f8a9465255be6e95f4..418db9119cf08e56d31c7f5e64a810081c86055d 100644 (file)
@@ -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.<br />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
index 87b48f441ee421ab53814c3af4026d610afaa948..e7eba7d0068c56add42f68fcbfb3c527d13976c1 100644 (file)
@@ -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.<br />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
index 1698d99dfea6abc707a51246a82cdcbdd6e8aace..57399bcc71f2d39bede497e8df925592c17fe003 100644 (file)
   label_completed_versions: Completed versions
   text_project_identifier_info: Only lower case letters (a-z), numbers, dashes and underscores are allowed.<br />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
index cc2122293711b37d2eef887a6862f1210e4cc1df..9995b3ce869b89ce52b2d734479d394946c32021 100644 (file)
@@ -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.<br />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
index d46f8f792fa0d0582ae09277886d1050b4a9ab22..28948fffed38937422c5345c6318cf293836ed7e 100644 (file)
@@ -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:
index cee7d4fd652f58f83f0481ac26513fff5d5a8087..9b929a0fc71e6ea54339bf2b6b1d28e95768d08d 100644 (file)
@@ -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