diff options
author | Dave Lawrence <dlawrence@mozilla.com> | 2012-03-19 04:11:53 +0100 |
---|---|---|
committer | Dave Lawrence <dlawrence@mozilla.com> | 2012-03-19 04:11:53 +0100 |
commit | 8f0cc43947fd5d93178b7f98c9548e1c4974d0b3 (patch) | |
tree | 48b837d8586d8f53bc32237bd7fb7ac518585421 | |
parent | 0709dae3eca4422295ad979b85dd8758e2426b76 (diff) | |
parent | 16ca329e85e1a36a4808cc088ebc8f5d18f22dae (diff) | |
download | bugzilla-8f0cc43947fd5d93178b7f98c9548e1c4974d0b3.tar.gz bugzilla-8f0cc43947fd5d93178b7f98c9548e1c4974d0b3.tar.xz |
merge with bugzilla/4.2
-rw-r--r-- | Bugzilla/Hook.pm | 24 | ||||
-rw-r--r-- | Bugzilla/Search.pm | 2 | ||||
-rw-r--r-- | docs/en/xml/installation.xml | 134 | ||||
-rwxr-xr-x | editusers.cgi | 3 | ||||
-rw-r--r-- | extensions/Example/Extension.pm | 14 | ||||
-rwxr-xr-x | report.cgi | 23 | ||||
-rw-r--r-- | template/en/default/email/bugmail.html.tmpl | 6 | ||||
-rw-r--r-- | template/en/default/email/bugmail.txt.tmpl | 12 | ||||
-rw-r--r-- | template/en/default/filterexceptions.pl | 1 | ||||
-rw-r--r-- | template/en/default/pages/release-notes.html.tmpl | 3 | ||||
-rw-r--r-- | template/en/default/reports/report-table.html.tmpl | 23 |
11 files changed, 161 insertions, 84 deletions
diff --git a/Bugzilla/Hook.pm b/Bugzilla/Hook.pm index b2ea820c7..564c5bc49 100644 --- a/Bugzilla/Hook.pm +++ b/Bugzilla/Hook.pm @@ -1354,6 +1354,30 @@ name), you can get it from here. =back +=head2 admin_editusers_action + +This hook allows you to add additional actions to the admin Users page. + +Params: + +=over + +=item C<vars> + +You can add as many new key/value pairs as you want to this hashref. +It will be passed to the template. + +=item C<action> + +A text which indicates the different behaviors that edit_users.cgi will have. +With this hook you can change the behavior of an action or add new actions. + +=item C<user> + +This is a Bugzilla::User object of the user. + +=back + =head2 user_preferences This hook allows you to add additional panels to the User Preferences page, diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index 0c5b65acf..55a14d9e0 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -809,7 +809,7 @@ sub _extra_columns { my ($self) = @_; # Everything that's going to be in the ORDER BY must also be # in the SELECT. - $self->{extra_columns} ||= [ $self->_input_order_columns ]; + push(@{ $self->{extra_columns} }, $self->_input_order_columns); return @{ $self->{extra_columns} }; } diff --git a/docs/en/xml/installation.xml b/docs/en/xml/installation.xml index cfd9f14f3..e9830e29c 100644 --- a/docs/en/xml/installation.xml +++ b/docs/en/xml/installation.xml @@ -2021,21 +2021,22 @@ pid-file=/home/foo/mymysql/the.pid <section id="upgrade"> <title>Upgrading to New Releases</title> - + <para>Upgrading to new Bugzilla releases is very simple. There is - a script included with Bugzilla that will automatically - do all of the database migration for you.</para> - + a script named <filename>checksetup.pl</filename> included with + Bugzilla that will automatically do all of the database migration + for you.</para> + <para>The following sections explain how to upgrade from one version of Bugzilla to another. Whether you are upgrading - from one bug-fix version to another (such as 3.0.1 to 3.0.2) - or from one major version to another (such as from 3.0 to 3.2), + from one bug-fix version to another (such as 4.2 to 4.2.1) + or from one major version to another (such as from 4.0 to 4.2), the instructions are always the same.</para> <note> <para> Any examples in the following sections are written as though the - user were updating to version 2.22.1, but the procedures are the + user were updating to version 4.2.1, but the procedures are the same no matter what version you're updating to. Also, in the examples, the user's Bugzilla installation is found at <filename>/var/www/html/bugzilla</filename>. If that is not the @@ -2131,10 +2132,10 @@ pid-file=/home/foo/mymysql/the.pid <variablelist> <varlistentry> - <term>CVS (<xref linkend="upgrade-cvs"/>)</term> + <term>Bzr (<xref linkend="upgrade-bzr"/>)</term> <listitem> <para> - If have <command>cvs</command> installed on your machine + If you have <command>bzr</command> installed on your machine and you have Internet access, this is the easiest way to upgrade, particularly if you have made modifications to the code or templates of Bugzilla. @@ -2159,12 +2160,12 @@ pid-file=/home/foo/mymysql/the.pid <para> If you have made modifications to your Bugzilla, and you don't have Internet access or you don't want to use - cvs, then this is the best way to upgrade. + bzr, then this is the best way to upgrade. </para> - + <para> - You can only do minor upgrades (such as 3.0 to 3.0.1 or - 3.0.1 to 3.0.2) with patches. + You can only do minor upgrades (such as 4.2 to 4.2.1 or + 4.2.1 to 4.2.2) with patches. </para> </listitem> </varlistentry> @@ -2184,8 +2185,8 @@ pid-file=/home/foo/mymysql/the.pid <para> The larger the jump you are trying to make, the more difficult it is going to be to upgrade if you have made local customizations. - Upgrading from 3.0 to 3.0.1 should be fairly painless even if - you are heavily customized, but going from 2.18 to 3.0 is going + Upgrading from 4.2 to 4.2.1 should be fairly painless even if + you are heavily customized, but going from 2.18 to 4.2 is going to mean a fair bit of work re-writing your local changes to use the new files, logic, templates, etc. If you have done no local changes at all, however, then upgrading should be approximately @@ -2194,41 +2195,53 @@ pid-file=/home/foo/mymysql/the.pid </para> </section> - <section id="upgrade-cvs"> - <title>Upgrading using CVS</title> + <section id="upgrade-bzr"> + <title>Upgrading using Bzr</title> <para> - This requires that you have cvs installed (most Unix machines do), - and requires that you are able to access cvs-mirror.mozilla.org - on port 2401, which may not be an option if you are behind a - highly restrictive firewall or don't have Internet access. + This requires that you have bzr installed (most Unix machines do), + and requires that you are able to access + <ulink url="http://bzr.mozilla.org/bugzilla/">bzr.mozilla.org</ulink>, + which may not be an option if you don't have Internet access. </para> <para> The following shows the sequence of commands needed to update a - Bugzilla installation via CVS, and a typical series of results. + Bugzilla installation via Bzr, and a typical series of results. + These commands assume that you already have Bugzilla installed + using Bzr. </para> + <warning> + <para> + If your installation is still using CVS, you must first convert + it to Bzr. A very detailed step by step documentation can be + found on <ulink url="https://wiki.mozilla.org/Bugzilla:Moving_From_CVS_To_Bazaar">wiki.mozilla.org</ulink>. + </para> + </warning> + <programlisting> bash$ <command>cd /var/www/html/bugzilla</command> -bash$ <command>cvs login</command> -Logging in to :pserver:anonymous@cvs-mirror.mozilla.org:2401/cvsroot -CVS password: <emphasis>('anonymous', or just leave it blank)</emphasis> -bash$ <command>cvs -q update -r BUGZILLA-2_22_1 -dP</command> -P checksetup.pl -P collectstats.pl -P docs/rel_notes.txt -P template/en/default/list/quips.html.tmpl -<emphasis>(etc.)</emphasis> +bash$ <command>bzr switch 4.2</command> (only run this command when not yet running 4.2) +bash$ <command>bzr up -r tag:bugzilla-4.2.1</command> ++N extensions/MoreBugUrl/ ++N extensions/MoreBugUrl/Config.pm ++N extensions/MoreBugUrl/Extension.pm +... + M Bugzilla/Attachment.pm + M Bugzilla/Attachment/PatchReader.pm + M Bugzilla/Bug.pm +... +All changes applied successfully. </programlisting> <caution> <para> - If a line in the output from <command>cvs update</command> begins - with a <computeroutput>C</computeroutput>, then that represents a - file with local changes that CVS was unable to properly merge. You - need to resolve these conflicts manually before Bugzilla (or at - least the portion using that file) will be usable. + If a line in the output from <command>bzr up</command> mentions + a conflict, then that represents a file with local changes that + Bzr was unable to properly merge. You need to resolve these + conflicts manually before Bugzilla (or at least the portion using + that file) will be usable. </para> </caution> </section> @@ -2237,7 +2250,7 @@ P template/en/default/list/quips.html.tmpl <title>Upgrading using the tarball</title> <para> - If you are unable (or unwilling) to use CVS, another option that's + If you are unable (or unwilling) to use Bzr, another option that's always available is to obtain the latest tarball from the <ulink url="http://www.bugzilla.org/download/">Download Page</ulink> and create a new Bugzilla installation from that. @@ -2254,18 +2267,18 @@ P template/en/default/list/quips.html.tmpl <programlisting> bash$ <command>cd /var/www/html</command> -bash$ <command>wget http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-2.22.1.tar.gz</command> +bash$ <command>wget http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-4.2.1.tar.gz</command> <emphasis>(Output omitted)</emphasis> -bash$ <command>tar xzvf bugzilla-2.22.1.tar.gz</command> -bugzilla-2.22.1/ -bugzilla-2.22.1/.cvsignore +bash$ <command>tar xzvf bugzilla-4.2.1.tar.gz</command> +bugzilla-4.2.1/ +bugzilla-4.2.1/colchange.cgi <emphasis>(Output truncated)</emphasis> -bash$ <command>cd bugzilla-2.22.1</command> +bash$ <command>cd bugzilla-4.2.1</command> bash$ <command>cp ../bugzilla/localconfig* .</command> bash$ <command>cp -r ../bugzilla/data .</command> bash$ <command>cd ..</command> bash$ <command>mv bugzilla bugzilla.old</command> -bash$ <command>mv bugzilla-2.22.1 bugzilla</command> +bash$ <command>mv bugzilla-4.2.1 bugzilla</command> </programlisting> <warning> @@ -2276,6 +2289,15 @@ bash$ <command>mv bugzilla-2.22.1 bugzilla</command> </para> </warning> + <caution> + <para> + If you have some extensions installed, you will have to copy them + to the new bugzilla directory too. Extensions are located in + <filename>bugzilla/extensions/</filename>. Only copy those you + installed, not those managed by the Bugzilla team. + </para> + </caution> + <para> This upgrade method will give you a clean install of Bugzilla. That's fine if you don't have any local customizations that you @@ -2291,15 +2313,15 @@ bash$ <command>mv bugzilla-2.22.1 bugzilla</command> A patch is a collection of all the bug fixes that have been made since the last bug-fix release. </para> - + <para> If you are doing a bug-fix upgrade—that is, one where only the - last number of the revision changes, such as from 2.22 to - 2.22.1—then you have the option of obtaining and applying a + last number of the revision changes, such as from 4.2 to + 4.2.1—then you have the option of obtaining and applying a patch file from the <ulink url="http://www.bugzilla.org/download/">Download Page</ulink>. </para> - + <para> As above, this example starts with obtaining the file via the command line. If you have already downloaded it, you can omit the @@ -2308,21 +2330,21 @@ bash$ <command>mv bugzilla-2.22.1 bugzilla</command> <programlisting> bash$ <command>cd /var/www/html/bugzilla</command> -bash$ <command>wget http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-2.22-to-2.22.1.diff.gz</command> +bash$ <command>wget http://ftp.mozilla.org/pub/mozilla.org/webtools/bugzilla-4.2-to-4.2.1.diff.gz</command> <emphasis>(Output omitted)</emphasis> -bash$ <command>gunzip bugzilla-2.22-to-2.22.1.diff.gz</command> -bash$ <command>patch -p1 < bugzilla-2.22-to-2.22.1.diff</command> -patching file checksetup.pl -patching file collectstats.pl +bash$ <command>gunzip bugzilla-4.2-to-4.2.1.diff.gz</command> +bash$ <command>patch -p1 < bugzilla-4.2-to-4.2.1.diff</command> +patching file Bugzilla/Constants.pm +patching file enter_bug.cgi <emphasis>(etc.)</emphasis> </programlisting> <warning> <para> Be aware that upgrading from a patch file does not change the - entries in your <filename class="directory">CVS</filename> directory. - This could make it more difficult to upgrade using CVS - (<xref linkend="upgrade-cvs"/>) in the future. + entries in your <filename class="directory">.bzr</filename> directory. + This could make it more difficult to upgrade using Bzr + (<xref linkend="upgrade-bzr"/>) in the future. </para> </warning> @@ -2382,7 +2404,7 @@ bash$ <command>./checksetup.pl</command> <caution> <para> - If this is a major upgrade (say, 2.22 to 3.0 or similar), + If this is a major upgrade (say, 3.6 to 4.2 or similar), running <command>checksetup.pl</command> on a large installation (75,000 or more bugs) can take a long time, possibly several hours. diff --git a/editusers.cgi b/editusers.cgi index fb8238d4b..bd643e893 100755 --- a/editusers.cgi +++ b/editusers.cgi @@ -64,6 +64,9 @@ my $token = $cgi->param('token'); $vars->{'editusers'} = $editusers; mirrorListSelectionValues(); +Bugzilla::Hook::process('admin_editusers_action', + { vars => $vars, user => $user, action => $action }); + ########################################################################### if ($action eq 'search') { # Allow to restrict the search to any group the user is allowed to bless. diff --git a/extensions/Example/Extension.pm b/extensions/Example/Extension.pm index 4498d2b22..af56b506b 100644 --- a/extensions/Example/Extension.pm +++ b/extensions/Example/Extension.pm @@ -822,6 +822,20 @@ sub bug_check_can_change_field { } } +sub admin_editusers_action { + my ($self, $args) = @_; + my ($vars, $action, $user) = @$args{qw(vars action user)}; + my $template = Bugzilla->template; + + if ($action eq 'my_action') { + # Allow to restrict the search to any group the user is allowed to bless. + $vars->{'restrictablegroups'} = $user->bless_groups(); + $template->process('admin/users/search.html.tmpl', $vars) + || ThrowTemplateError($template->error()); + exit; + } +} + sub user_preferences { my ($self, $args) = @_; my $tab = $args->{current_tab}; diff --git a/report.cgi b/report.cgi index dccc470a7..1ec3ac864 100755 --- a/report.cgi +++ b/report.cgi @@ -36,7 +36,6 @@ use List::MoreUtils qw(uniq); my $cgi = Bugzilla->cgi; my $template = Bugzilla->template; my $vars = {}; -my $buffer = $cgi->query_string(); # Go straight back to query.cgi if we are adding a boolean chart. if (grep(/^cmd-/, $cgi->param())) { @@ -49,9 +48,6 @@ if (grep(/^cmd-/, $cgi->param())) { } Bugzilla->login(); - -my $dbh = Bugzilla->switch_to_shadow_db(); - my $action = $cgi->param('action') || 'menu'; if ($action eq "menu") { @@ -62,6 +58,9 @@ if ($action eq "menu") { exit; } +# Sanitize the URL, to make URLs shorter. +$cgi->clean_search_url; + my $col_field = $cgi->param('x_axis_field') || ''; my $row_field = $cgi->param('y_axis_field') || ''; my $tbl_field = $cgi->param('z_axis_field') || ''; @@ -135,6 +134,7 @@ my $query = $search->sql; $::SIG{TERM} = 'DEFAULT'; $::SIG{PIPE} = 'DEFAULT'; +my $dbh = Bugzilla->switch_to_shadow_db(); my $results = $dbh->selectall_arrayref($query); # We have a hash of hashes for the data itself, and a hash to hold the @@ -243,10 +243,10 @@ if ($action eq "wrap") { # We need to keep track of the defined restrictions on each of the # axes, because buglistbase, below, throws them away. Without this, we # get buglistlinks wrong if there is a restriction on an axis field. - $vars->{'col_vals'} = join("&", $buffer =~ /[&?]($col_field=[^&]+)/g); - $vars->{'row_vals'} = join("&", $buffer =~ /[&?]($row_field=[^&]+)/g); - $vars->{'tbl_vals'} = join("&", $buffer =~ /[&?]($tbl_field=[^&]+)/g); - + $vars->{'col_vals'} = get_field_restrictions($col_field); + $vars->{'row_vals'} = get_field_restrictions($row_field); + $vars->{'tbl_vals'} = get_field_restrictions($tbl_field); + # We need a number of different variants of the base URL for different # URLs in the HTML. $vars->{'buglistbase'} = $cgi->canonicalise_query( @@ -346,3 +346,10 @@ sub check_value { } return $value; } + +sub get_field_restrictions { + my $field = shift; + my $cgi = Bugzilla->cgi; + + return join('&', map {"$field=$_"} $cgi->param($field)); +} diff --git a/template/en/default/email/bugmail.html.tmpl b/template/en/default/email/bugmail.html.tmpl index ac4727811..fa3a447d7 100644 --- a/template/en/default/email/bugmail.html.tmpl +++ b/template/en/default/email/bugmail.html.tmpl @@ -59,10 +59,10 @@ [% BLOCK generate_diffs %] [% SET in_table = 0 %] - [% last_changer = "" %] + [% last_changer = 0 %] [% FOREACH change = diffs %] - [% IF !isnew && change.who.login != last_changer %] - [% last_changer = change.who.login %] + [% IF !isnew && changer.id != last_changer %] + [% last_changer = changer.id %] [% IF in_table == 1 %] </table> [% SET in_table = 0 %] diff --git a/template/en/default/email/bugmail.txt.tmpl b/template/en/default/email/bugmail.txt.tmpl index ff2e6b8fa..c3657ad9f 100644 --- a/template/en/default/email/bugmail.txt.tmpl +++ b/template/en/default/email/bugmail.txt.tmpl @@ -54,21 +54,17 @@ You are receiving this mail because: [% BLOCK generate_diffs %] [% urlbase %]show_bug.cgi?id=[% bug.id %] -[%+ last_changer = "" %] +[%+ last_changer = 0 %] [% FOREACH change = diffs %] - [% IF !isnew && change.who.login != last_changer %] - [% last_changer = change.who.login %] + [% IF !isnew && changer.id != last_changer %] + [% last_changer = changer.id %] [% IF change.blocker %] [% terms.Bug %] [%+ bug.id %] depends on [% terms.bug %] [%+ change.blocker.id %], which changed state. [%+ terms.Bug %] [%+ change.blocker.id %] Summary: [% change.blocker.short_desc %] [%+ urlbase %]show_bug.cgi?id=[% change.blocker.id %] [% ELSE %] - [%~ IF change.who.name %] - [% change.who.name _ " <" _ change.who.login _ ">" %] - [% ELSE %] - [% change.who.login %] - [% END %] changed: + [%~ changer.identity %] changed: [% END %] What |Removed |Added diff --git a/template/en/default/filterexceptions.pl b/template/en/default/filterexceptions.pl index 7a542f427..c755fa1ed 100644 --- a/template/en/default/filterexceptions.pl +++ b/template/en/default/filterexceptions.pl @@ -87,7 +87,6 @@ ], 'reports/report-table.html.tmpl' => [ - '"&$tbl_vals" IF tbl_vals', '"&$col_vals" IF col_vals', '"&$row_vals" IF row_vals', 'classes.$row_idx.$col_idx', diff --git a/template/en/default/pages/release-notes.html.tmpl b/template/en/default/pages/release-notes.html.tmpl index 03df6911c..6402814e1 100644 --- a/template/en/default/pages/release-notes.html.tmpl +++ b/template/en/default/pages/release-notes.html.tmpl @@ -358,6 +358,9 @@ <li>YUI has been upgraded to 2.9.0.</li> <li>Due to the major code refactor of <kbd>B[%%]ugzilla/Search.pm</kbd>, any customization made against this file will probably need to be rewritten.</li> + <li>The [% terms.Bugzilla %]-specific <kbd>url_quote</kbd> filter used in templates + has been removed and replaced by the <kbd>uri</kbd> filter from Template::Toolkit + as they are now similar.</li> <li><kbd>long_list.cgi</kbd>, <kbd>showattachment.cgi</kbd> and <kbd>xml.cgi</kbd> have been removed from the codebase. As <a href="#v40_code_changes">announced</a> in the release notes of [% terms.Bugzilla %] 4.0, these scripts were deprecated diff --git a/template/en/default/reports/report-table.html.tmpl b/template/en/default/reports/report-table.html.tmpl index 561d0517e..8a3ab9524 100644 --- a/template/en/default/reports/report-table.html.tmpl +++ b/template/en/default/reports/report-table.html.tmpl @@ -36,13 +36,14 @@ [% col_field_disp = field_descs.$col_field || col_field %] [% row_field_disp = field_descs.$row_field || row_field %] - + +[% urlbase = BLOCK %]buglist.cgi?[% buglistbase FILTER html %][% END %] [% IF tbl == "-total-" %] - [% urlbase = BLOCK %]buglist.cgi?[% buglistbase FILTER html %] - [% "&$tbl_vals" IF tbl_vals %][% END %] -[% ELSE %] - [% urlbase = BLOCK %]buglist.cgi?[% buglistbase FILTER html %]& - [% tbl_field FILTER uri %]=[% tbl FILTER uri %][% END %] + [% IF tbl_vals %] + [% urlbase = urlbase _ "&" _ tbl_vals %] + [% END %] +[% ELSIF tbl_field %] + [% urlbase = BLOCK %][% urlbase %]&[% tbl_field FILTER uri %]=[% tbl FILTER uri %][% END %] [% END %] <script type="text/javascript"> @@ -50,6 +51,10 @@ YAHOO.util.Event.addListener(window, "load", function() { this.Linkify = function(elLiner, oRecord, oColumn, oData) { if (oData == 0) elLiner.innerHTML = "."; + else if (oRecord.getData("row_title") == "Total") + elLiner.innerHTML = "<a href='[% urlbase %]&[% col_field FILTER js %]=" + + oColumn.field + "[% '&' _ row_vals IF row_vals %]'>" + + oData + "</a>"; else elLiner.innerHTML = "<a href='[% urlbase %]&[% row_field FILTER js %]=" + oRecord.getData("row_title").replace(/\s+$/,"") @@ -60,6 +65,10 @@ YAHOO.util.Event.addListener(window, "load", function() { this.LinkifyTotal = function(elLiner, oRecord, oColumn, oData) { if (oData == 0) elLiner.innerHTML = "."; + else if (oRecord.getData("row_title") == "Total") + elLiner.innerHTML = "<a href='[% urlbase %][% '&' _ row_vals IF row_vals %] + [%~ '&' _ col_vals IF col_vals %]'>" + + oData + "</a>"; else elLiner.innerHTML = "<a href='[% urlbase %]&[% row_field FILTER js %]=" + oRecord.getData("row_title").replace(/\s+$/,"") @@ -93,7 +102,7 @@ YAHOO.util.Event.addListener(window, "load", function() { var myColumnDefs = [ {key:"row_title", label:"", sortable:true, sortOptions: { sortFunction:totalNumberSorter }}, [% FOREACH col = col_names %] - {key:"[% col FILTER js %]", label:"[% col FILTER js %]", sortable:true, + {key:"[% col FILTER js %]", label:"[% display_value(col_field, col) FILTER js %]", sortable:true, formatter:this.Linkify, sortOptions: { defaultDir: YAHOO.widget.DataTable.CLASS_DESC, sortFunction:totalNumberSorter }}, [% END %] {key:"total", label:"Total", sortable:true, formatter:this.LinkifyTotal, |