aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2015-05-24 01:59:45 -0400
committerMike Frysinger <vapier@gentoo.org>2016-02-25 05:25:34 +0900
commit711d93ef417796e29586dee53135a049f79f84a1 (patch)
treec2860460f32875ddb7db74aa7e2e2bc6a87decad
parentenable MoreBugUrl extension (diff)
downloadbugzilla-711d93ef417796e29586dee53135a049f79f84a1.tar.gz
bugzilla-711d93ef417796e29586dee53135a049f79f84a1.tar.bz2
bugzilla-711d93ef417796e29586dee53135a049f79f84a1.zip
BugUrl: add Flyspray support
Arch Linux uses this tracker. X-Gentoo-Bug: 549392 X-Gentoo-Bug-URL: https://bugs.gentoo.org/549392
-rw-r--r--Bugzilla/BugUrl.pm1
-rw-r--r--Bugzilla/BugUrl/Flyspray.pm36
-rw-r--r--template/en/default/global/user-error.html.tmpl1
3 files changed, 38 insertions, 0 deletions
diff --git a/Bugzilla/BugUrl.pm b/Bugzilla/BugUrl.pm
index 1e836ca1e..285441807 100644
--- a/Bugzilla/BugUrl.pm
+++ b/Bugzilla/BugUrl.pm
@@ -56,6 +56,7 @@ use constant SUB_CLASSES => qw(
Bugzilla::BugUrl::Bugzilla::Local
Bugzilla::BugUrl::Bugzilla
Bugzilla::BugUrl::Launchpad
+ Bugzilla::BugUrl::Flyspray
Bugzilla::BugUrl::Google
Bugzilla::BugUrl::Debian
Bugzilla::BugUrl::JIRA
diff --git a/Bugzilla/BugUrl/Flyspray.pm b/Bugzilla/BugUrl/Flyspray.pm
new file mode 100644
index 000000000..86583fc4b
--- /dev/null
+++ b/Bugzilla/BugUrl/Flyspray.pm
@@ -0,0 +1,36 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+# This Source Code Form is "Incompatible With Secondary Licenses", as
+# defined by the Mozilla Public License, v. 2.0.
+
+package Bugzilla::BugUrl::Flyspray;
+use strict;
+use base qw(Bugzilla::BugUrl);
+
+###############################
+#### Methods ####
+###############################
+
+sub should_handle {
+ my ($class, $uri) = @_;
+
+ # Flyspray URLs look like the following:
+ # https://bugs.flyspray.org/task/1237
+ # https://bugs.archlinux.org/task/44825
+ return ($uri->path_query =~ m|/task/\d+$|) ? 1 : 0;
+}
+
+sub _check_value {
+ my $class = shift;
+
+ my $uri = $class->SUPER::_check_value(@_);
+
+ # Remove any # part if there is one.
+ $uri->fragment(undef);
+
+ return $uri;
+}
+
+1;
diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl
index eb6641f0b..b5d2daf70 100644
--- a/template/en/default/global/user-error.html.tmpl
+++ b/template/en/default/global/user-error.html.tmpl
@@ -291,6 +291,7 @@
<li>A b[% %]ug in a MantisBT installation.</li>
<li>A b[% %]ug on sourceforge.net.</li>
<li>An issue/pull request on github.com.</li>
+ <li>A task on a Flyspray tracking system.</li>
[% Hook.process('bug_url_invalid_tracker') %]
</ul>
[% END %]