1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## 05_webpath.dpatch by <alexis@sitadelle.com>
4
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: Upstream patch: #280180 - Templates should provide a [% webpath %] token for a non standalone Bugzilla websites.
8
diff -urNad ./Bugzilla/Config.pm /tmp/dpep-work.6epPdO/bugzilla-2.18/Bugzilla/Config.pm
9
--- ./Bugzilla/Config.pm 2005-04-27 14:54:26.846604096 +0200
10
+++ /tmp/dpep-work.6epPdO/bugzilla-2.18/Bugzilla/Config.pm 2005-04-27 14:54:37.515982104 +0200
13
$Bugzilla::Config::VERSION = "2.18";
18
use vars qw(@param_list);
20
+# This is for Debian compat, in order to be able to use [% webpath %] in templates.
21
+our $WEBPATH = "/bugzilla/";
23
# Data::Dumper is required as needed, below. The problem is that then when
24
# the code locally sets $Data::Dumper::Foo, this triggers 'used only once'
29
# Load in the param defintions
30
-unless (my $ret = do 'defparams.pl') {
31
+unless (my $ret = do '/usr/share/bugzilla/defparams.pl') {
32
die "Couldn't parse defparams.pl: $@" if $@;
33
die "Couldn't do defparams.pl: $!" unless defined $ret;
34
die "Couldn't run defparams.pl" unless $ret;
35
diff -urNad ./Bugzilla/Template.pm /tmp/dpep-work.6epPdO/bugzilla-2.18/Bugzilla/Template.pm
36
--- ./Bugzilla/Template.pm 2005-04-27 14:41:13.000000000 +0200
37
+++ /tmp/dpep-work.6epPdO/bugzilla-2.18/Bugzilla/Template.pm 2005-04-27 14:54:37.516981952 +0200
40
# This could be made a ref, or even a CONSTANT with TT2.08
41
'VERSION' => $Bugzilla::Config::VERSION ,
43
+ # This is for Debian compat, in order to be able to use [% webpath %] in templates.
44
+ 'webpath' => $Bugzilla::Config::WEBPATH,
47
}) || die("Template creation failed: " . $class->error());
48
diff -urNad ./template/en/default/global/header.html.tmpl /tmp/dpep-work.6epPdO/bugzilla-2.18/template/en/default/global/header.html.tmpl
49
--- ./template/en/default/global/header.html.tmpl 2005-04-27 14:41:14.000000000 +0200
50
+++ /tmp/dpep-work.6epPdO/bugzilla-2.18/template/en/default/global/header.html.tmpl 2005-04-27 14:54:37.517981800 +0200
53
[%+ INCLUDE "global/help-header.html.tmpl" %]
55
- <link href="css/global.css" rel="stylesheet" type="text/css">
56
+ <link href="[% webpath %]css/global.css" rel="stylesheet" type="text/css">
59
<style type="text/css">
63
[% FOREACH style_url = style_urls %]
64
- <link href="[% style_url %]" rel="stylesheet" type="text/css">
65
+ <link href="[% webpath %][% style_url %]" rel="stylesheet" type="text/css">
69
diff -urNad ./template/en/default/index.html.tmpl /tmp/dpep-work.6epPdO/bugzilla-2.18/template/en/default/index.html.tmpl
70
--- ./template/en/default/index.html.tmpl 2005-04-27 14:41:13.000000000 +0200
71
+++ /tmp/dpep-work.6epPdO/bugzilla-2.18/template/en/default/index.html.tmpl 2005-04-27 14:54:37.516981952 +0200
76
- <td align="right"><img src="ant.jpg" width="329" height="220" border="2" alt="ant.jpg [8.5k]"></td>
77
+ <td align="right"><img src="[% webpath %]ant.jpg" width="329" height="220" border="2" alt="ant.jpg [8.5k]"></td>
80
-<script type="text/javascript" language="JavaScript" src="localconfig.js"></script>
81
-<script type="text/javascript" language="JavaScript" src="quicksearch.js"></script>
82
+<script type="text/javascript" language="JavaScript" src="[% webpath %]localconfig.js"></script>
83
+<script type="text/javascript" language="JavaScript" src="[% webpath %]quicksearch.js"></script>
84
<script type="text/javascript">
86
document.forms['f'].id.focus();
87
diff -urNad ./template/en/default/sidebar.xul.tmpl /tmp/dpep-work.6epPdO/bugzilla-2.18/template/en/default/sidebar.xul.tmpl
88
--- ./template/en/default/sidebar.xul.tmpl 2005-04-27 14:41:13.000000000 +0200
89
+++ /tmp/dpep-work.6epPdO/bugzilla-2.18/template/en/default/sidebar.xul.tmpl 2005-04-27 14:54:37.517981800 +0200
91
onload="document.getElementById('query-field').addEventListener('keypress', initial_keypress_handler, true)">
93
<!-- Load QuickSearch libraries -->
94
-<script type="application/x-javascript" src="localconfig.js"/>
95
-<script type="application/x-javascript" src="quicksearch.js"/>
96
+<script type="application/x-javascript" src="[% webpath %]localconfig.js"/>
97
+<script type="application/x-javascript" src="[% webpath %]quicksearch.js"/>
98
<script type="application/x-javascript"><![CDATA[
100
// Tell QuickSearch that the source of this is the sidebar