summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDexter Morgan <dmorgan@mageia.org>2013-02-21 08:36:33 +0000
committerDexter Morgan <dmorgan@mageia.org>2013-02-21 08:36:33 +0000
commit549bd6b0e3fa182d3eff47e67d4f1ab2729dd21d (patch)
tree4d8248e158f2f38a3b78758caae40b93a750656e
downloadbugzilla-549bd6b0e3fa182d3eff47e67d4f1ab2729dd21d.tar
bugzilla-549bd6b0e3fa182d3eff47e67d4f1ab2729dd21d.tar.gz
bugzilla-549bd6b0e3fa182d3eff47e67d4f1ab2729dd21d.tar.bz2
bugzilla-549bd6b0e3fa182d3eff47e67d4f1ab2729dd21d.tar.xz
bugzilla-549bd6b0e3fa182d3eff47e67d4f1ab2729dd21d.zip
Add mageia extension, from Frederic Buclin
-rw-r--r--Config.pm19
-rw-r--r--Extension.pm32
-rw-r--r--lib/Util.pm20
-rw-r--r--template/en/default/global/banner.html.tmpl18
-rw-r--r--template/en/default/hook/README5
-rw-r--r--template/en/default/hook/index-additional_links.html.tmpl13
-rw-r--r--template/en/default/mageia/README16
-rw-r--r--web/README7
8 files changed, 130 insertions, 0 deletions
diff --git a/Config.pm b/Config.pm
new file mode 100644
index 0000000..4dbbda1
--- /dev/null
+++ b/Config.pm
@@ -0,0 +1,19 @@
+# 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::Extension::Mageia;
+use strict;
+
+use constant NAME => 'Mageia';
+
+use constant REQUIRED_MODULES => [
+];
+
+use constant OPTIONAL_MODULES => [
+];
+
+__PACKAGE__->NAME;
diff --git a/Extension.pm b/Extension.pm
new file mode 100644
index 0000000..1ebd30b
--- /dev/null
+++ b/Extension.pm
@@ -0,0 +1,32 @@
+# 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::Extension::Mageia;
+use strict;
+use base qw(Bugzilla::Extension);
+
+use Bugzilla::User;
+use Bugzilla::Extension::Mageia::Util;
+
+use Email::Address;
+
+our $VERSION = '0.02';
+
+sub mailer_before_send {
+ my ($self, $args) = @_;
+ my $email = $args->{email};
+
+ # Include the changer's name in the "From:" field.
+ if (my $changer = $email->header('X-Bugzilla-Who')) {
+ $changer = Bugzilla::User->new({ name => $changer });
+ my $changer_name = $changer ? $changer->name : undef;
+ my $address = Email::Address->new($changer_name, $email->header('From'));
+ $email->header_set('From', $address->format);
+ }
+}
+
+__PACKAGE__->NAME;
diff --git a/lib/Util.pm b/lib/Util.pm
new file mode 100644
index 0000000..7aa8b86
--- /dev/null
+++ b/lib/Util.pm
@@ -0,0 +1,20 @@
+# 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::Extension::Mageia::Util;
+use strict;
+use base qw(Exporter);
+our @EXPORT = qw(
+
+);
+
+# This file can be loaded by your extension via
+# "use Bugzilla::Extension::Mageia::Util". You can put functions
+# used by your extension in here. (Make sure you also list them in
+# @EXPORT.)
+
+1; \ No newline at end of file
diff --git a/template/en/default/global/banner.html.tmpl b/template/en/default/global/banner.html.tmpl
new file mode 100644
index 0000000..d06f794
--- /dev/null
+++ b/template/en/default/global/banner.html.tmpl
@@ -0,0 +1,18 @@
+[%# 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.
+ #%]
+
+<script src="//nav.mageia.org/js/"></script>
+<style>
+body { margin: 0; padding-top: 0; background-color: #fff; }
+div#wrap { background-color: #fff; }
+#header,
+#bugzilla-body {
+ margin: 0 1em 1em 1em;
+}
+</style>
+<br>
diff --git a/template/en/default/hook/README b/template/en/default/hook/README
new file mode 100644
index 0000000..e6c4add
--- /dev/null
+++ b/template/en/default/hook/README
@@ -0,0 +1,5 @@
+Template hooks go in this directory. Template hooks are called in normal
+Bugzilla templates like [% Hook.process('some-hook') %].
+More information about them can be found in the documentation of
+Bugzilla::Extension. (Do "perldoc Bugzilla::Extension" from the main
+Bugzilla directory to see that documentation.) \ No newline at end of file
diff --git a/template/en/default/hook/index-additional_links.html.tmpl b/template/en/default/hook/index-additional_links.html.tmpl
new file mode 100644
index 0000000..695cd1f
--- /dev/null
+++ b/template/en/default/hook/index-additional_links.html.tmpl
@@ -0,0 +1,13 @@
+[%# 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.
+ #%]
+
+[% UNLESS user.id %]
+ <p style="border: solid 1px; background-color: #ffd386; color: #9b1a1a; padding: 1em;">
+ Don't have an account on [% terms.Bugzilla %]? Click <a href="http://identity.mageia.org/register">here</a> to create one.
+ </p>
+[% END %] \ No newline at end of file
diff --git a/template/en/default/mageia/README b/template/en/default/mageia/README
new file mode 100644
index 0000000..099d1a4
--- /dev/null
+++ b/template/en/default/mageia/README
@@ -0,0 +1,16 @@
+Normal templates go in this directory. You can load them in your
+code like this:
+
+use Bugzilla::Error;
+my $template = Bugzilla->template;
+$template->process('mageia/some-template.html.tmpl')
+ or ThrowTemplateError($template->error());
+
+That would be how to load a file called some-template.html.tmpl that
+was in this directory.
+
+Note that you have to be careful that the full path of your template
+never conflicts with a template that exists in Bugzilla or in
+another extension, or your template might override that template. That's why
+we created this directory called 'mageia' for you, so you
+can put your templates in here to help avoid conflicts. \ No newline at end of file
diff --git a/web/README b/web/README
new file mode 100644
index 0000000..2345641
--- /dev/null
+++ b/web/README
@@ -0,0 +1,7 @@
+Web-accessible files, like JavaScript, CSS, and images go in this
+directory. You can reference them directly in your HTML. For example,
+if you have a file called "style.css" and your extension is called
+"Foo", you would put it in "extensions/Foo/web/style.css", and then
+you could link to it in HTML like:
+
+<link href="extensions/Foo/web/style.css" rel="stylesheet" type="text/css"> \ No newline at end of file