diff options
author | Christian Ruppert <idl0r@gentoo.org> | 2015-07-11 16:08:11 +0200 |
---|---|---|
committer | Christian Ruppert <idl0r@gentoo.org> | 2015-07-11 16:08:11 +0200 |
commit | bf1988c8169ed4c5c50eb8bfda1dd2736d39cb33 (patch) | |
tree | 077237f351d9f9bb5616ce7b2edb8187e29715c3 | |
parent | Remove files no longer kept in the upstream repo (diff) | |
parent | Vanilla 4.4.9 to 5.0 without history due to massive merge conflicts (diff) | |
download | bugzilla-bf1988c8169ed4c5c50eb8bfda1dd2736d39cb33.tar.gz bugzilla-bf1988c8169ed4c5c50eb8bfda1dd2736d39cb33.tar.bz2 bugzilla-bf1988c8169ed4c5c50eb8bfda1dd2736d39cb33.zip |
Merge branch '4.4.9-to-5.0-vanilla-nohist' into 5.0-migration
Move @gentoo.org restriction for new accounts into the Gentoo extentions.
Reset some templates to vanilla/default. We'll use custom ones from now on
677 files changed, 33905 insertions, 28150 deletions
diff --git a/.bzrignore b/.bzrignore index 7ab83e7ad..f30e8f9ae 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1,10 +1,8 @@ .htaccess /lib/* /template/en/custom -/docs/bugzilla.ent -/docs/en/xml/bugzilla.ent -/docs/en/txt /docs/en/html +/docs/en/txt /docs/en/pdf /skins/custom /graphs @@ -12,21 +10,5 @@ /localconfig /index.html -/skins/contrib/Dusk/IE-fixes.css /skins/contrib/Dusk/admin.css -/skins/contrib/Dusk/attachment.css -/skins/contrib/Dusk/create_attachment.css -/skins/contrib/Dusk/dependency-tree.css -/skins/contrib/Dusk/duplicates.css -/skins/contrib/Dusk/editusers.css -/skins/contrib/Dusk/enter_bug.css -/skins/contrib/Dusk/help.css -/skins/contrib/Dusk/panel.css -/skins/contrib/Dusk/page.css -/skins/contrib/Dusk/params.css -/skins/contrib/Dusk/reports.css -/skins/contrib/Dusk/show_bug.css -/skins/contrib/Dusk/search_form.css -/skins/contrib/Dusk/show_multiple.css -/skins/contrib/Dusk/summarize-time.css -.DS_Store +/skins/contrib/Dusk/bug.css diff --git a/.gitignore b/.gitignore index 7ab83e7ad..f30e8f9ae 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,8 @@ .htaccess /lib/* /template/en/custom -/docs/bugzilla.ent -/docs/en/xml/bugzilla.ent -/docs/en/txt /docs/en/html +/docs/en/txt /docs/en/pdf /skins/custom /graphs @@ -12,21 +10,5 @@ /localconfig /index.html -/skins/contrib/Dusk/IE-fixes.css /skins/contrib/Dusk/admin.css -/skins/contrib/Dusk/attachment.css -/skins/contrib/Dusk/create_attachment.css -/skins/contrib/Dusk/dependency-tree.css -/skins/contrib/Dusk/duplicates.css -/skins/contrib/Dusk/editusers.css -/skins/contrib/Dusk/enter_bug.css -/skins/contrib/Dusk/help.css -/skins/contrib/Dusk/panel.css -/skins/contrib/Dusk/page.css -/skins/contrib/Dusk/params.css -/skins/contrib/Dusk/reports.css -/skins/contrib/Dusk/show_bug.css -/skins/contrib/Dusk/search_form.css -/skins/contrib/Dusk/show_multiple.css -/skins/contrib/Dusk/summarize-time.css -.DS_Store +/skins/contrib/Dusk/bug.css @@ -2,7 +2,7 @@ <FilesMatch (\.pm|\.pl|\.tmpl|localconfig.*)$> <IfModule mod_version.c> <IfVersion < 2.4> - Deny from all + Deny from all </IfVersion> <IfVersion >= 2.4> <IfModule mod_perl.c> @@ -42,6 +42,12 @@ Options -Indexes </IfModule> </IfModule> +<IfModule mod_rewrite.c> + RewriteEngine On + RewriteOptions inherit + RewriteRule ^rest/(.*)$ rest.cgi/$1 [NE] +</IfModule> + <FilesMatch ^custom_buglist.cgi$> allow from 127.0.0.1 94.100.119.160/28 deny from all diff --git a/.travis.yml b/.travis.yml index 1bbf29483..01ecfcfb4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,8 @@ addons: perl: - 5.10 - 5.12 + - 5.14 + - 5.16 env: - TEST_SUITE=sanity @@ -17,19 +19,39 @@ env: matrix: exclude: + - perl: 5.10 + env: TEST_SUITE=docs - perl: 5.12 env: TEST_SUITE=docs + - perl: 5.14 + env: TEST_SUITE=docs - perl: 5.10 env: TEST_SUITE=webservices DB=mysql - - perl: 5.12 + - perl: 5.10 + env: TEST_SUITE=webservices DB=pg + - perl: 5.10 env: TEST_SUITE=selenium DB=mysql - perl: 5.10 + env: TEST_SUITE=selenium DB=pg + - perl: 5.12 + env: TEST_SUITE=webservices DB=mysql + - perl: 5.12 env: TEST_SUITE=webservices DB=pg - perl: 5.12 + env: TEST_SUITE=selenium DB=mysql + - perl: 5.12 + env: TEST_SUITE=selenium DB=pg + - perl: 5.14 + env: TEST_SUITE=webservices DB=mysql + - perl: 5.14 + env: TEST_SUITE=webservices DB=pg + - perl: 5.14 + env: TEST_SUITE=selenium DB=mysql + - perl: 5.14 env: TEST_SUITE=selenium DB=pg before_install: - - git clone https://github.com/bugzilla/qa.git -b 4.4 qa + - git clone https://github.com/bugzilla/qa.git -b 5.0 qa install: true diff --git a/Bugzilla.pm b/Bugzilla.pm index 6e31ba71a..e3184fdb8 100644 --- a/Bugzilla.pm +++ b/Bugzilla.pm @@ -7,7 +7,9 @@ package Bugzilla; +use 5.10.1; use strict; +use warnings; # We want any compile errors to get to the browser, if possible. BEGIN { @@ -18,23 +20,24 @@ BEGIN { } } -use Bugzilla::Config; -use Bugzilla::Constants; use Bugzilla::Auth; use Bugzilla::Auth::Persist::Cookie; use Bugzilla::CGI; -use Bugzilla::Extension; +use Bugzilla::Config; +use Bugzilla::Constants; use Bugzilla::DB; +use Bugzilla::Error; +use Bugzilla::Extension; +use Bugzilla::Field; +use Bugzilla::Flag; use Bugzilla::Install::Localconfig qw(read_localconfig); -use Bugzilla::Install::Requirements qw(OPTIONAL_MODULES); +use Bugzilla::Install::Requirements qw(OPTIONAL_MODULES have_vers); use Bugzilla::Install::Util qw(init_console include_languages); +use Bugzilla::Memcached; use Bugzilla::Template; +use Bugzilla::Token; use Bugzilla::User; -use Bugzilla::Error; use Bugzilla::Util; -use Bugzilla::Field; -use Bugzilla::Flag; -use Bugzilla::Token; use File::Basename; use File::Spec::Functions; @@ -119,8 +122,8 @@ sub init_page { # # This code must go here. It cannot go anywhere in Bugzilla::CGI, because # it uses Template, and that causes various dependency loops. - if (Bugzilla->params->{"shutdownhtml"} - && !grep { $_ eq $script } SHUTDOWNHTML_EXEMPT) + if (!grep { $_ eq $script } SHUTDOWNHTML_EXEMPT + and Bugzilla->params->{'shutdownhtml'}) { # Allow non-cgi scripts to exit silently (without displaying any # message), if desired. At this point, no DBI call has been made @@ -163,10 +166,8 @@ sub init_page { print Bugzilla->cgi->header(-status => 503, -retry_after => SHUTDOWNHTML_RETRY_AFTER); } - my $t_output; - $template->process("global/message.$extension.tmpl", $vars, \$t_output) + $template->process("global/message.$extension.tmpl", $vars) || ThrowTemplateError($template->error); - print $t_output . "\n"; exit; } } @@ -176,9 +177,7 @@ sub init_page { ##################################################################### sub template { - my $class = shift; - $class->request_cache->{template} ||= Bugzilla::Template->create(); - return $class->request_cache->{template}; + return $_[0]->request_cache->{template} ||= Bugzilla::Template->create(); } sub template_inner { @@ -186,9 +185,7 @@ sub template_inner { my $cache = $class->request_cache; my $current_lang = $cache->{template_current_lang}->[0]; $lang ||= $current_lang || ''; - $class->request_cache->{"template_inner_$lang"} - ||= Bugzilla::Template->create(language => $lang); - return $class->request_cache->{"template_inner_$lang"}; + return $cache->{"template_inner_$lang"} ||= Bugzilla::Template->create(language => $lang); } our $extension_packages; @@ -223,7 +220,7 @@ sub feature { foreach my $package (@{ OPTIONAL_MODULES() }) { foreach my $f (@{ $package->{feature} }) { $feature_map->{$f} ||= []; - push(@{ $feature_map->{$f} }, $package->{module}); + push(@{ $feature_map->{$f} }, $package); } } $cache->{feature_map} = $feature_map; @@ -234,22 +231,15 @@ sub feature { } my $success = 1; - foreach my $module (@{ $feature_map->{$feature} }) { - # We can't use a string eval and "use" here (it kills Template-Toolkit, - # see https://rt.cpan.org/Public/Bug/Display.html?id=47929), so we have - # to do a block eval. - $module =~ s{::}{/}g; - $module .= ".pm"; - eval { require $module; 1; } or $success = 0; + foreach my $package (@{ $feature_map->{$feature} }) { + have_vers($package) or $success = 0; } $cache->{feature}->{$feature} = $success; return $success; } sub cgi { - my $class = shift; - $class->request_cache->{cgi} ||= new Bugzilla::CGI(); - return $class->request_cache->{cgi}; + return $_[0]->request_cache->{cgi} ||= new Bugzilla::CGI(); } sub input_params { @@ -273,15 +263,11 @@ sub localconfig { } sub params { - my $class = shift; - $class->request_cache->{params} ||= Bugzilla::Config::read_param_file(); - return $class->request_cache->{params}; + return $_[0]->request_cache->{params} ||= Bugzilla::Config::read_param_file(); } sub user { - my $class = shift; - $class->request_cache->{user} ||= new Bugzilla::User; - return $class->request_cache->{user}; + return $_[0]->request_cache->{user} ||= new Bugzilla::User; } sub set_user { @@ -290,8 +276,7 @@ sub set_user { } sub sudoer { - my $class = shift; - return $class->request_cache->{sudoer}; + return $_[0]->request_cache->{sudoer}; } sub sudo_request { @@ -413,28 +398,20 @@ sub logout_request { } sub job_queue { - my $class = shift; require Bugzilla::JobQueue; - $class->request_cache->{job_queue} ||= Bugzilla::JobQueue->new(); - return $class->request_cache->{job_queue}; + return $_[0]->request_cache->{job_queue} ||= Bugzilla::JobQueue->new(); } sub dbh { - my $class = shift; # If we're not connected, then we must want the main db - $class->request_cache->{dbh} ||= $class->dbh_main; - - return $class->request_cache->{dbh}; + return $_[0]->request_cache->{dbh} ||= $_[0]->dbh_main; } sub dbh_main { - my $class = shift; - $class->request_cache->{dbh_main} ||= Bugzilla::DB::connect_main(); - return $class->request_cache->{dbh_main}; + return $_[0]->request_cache->{dbh_main} ||= Bugzilla::DB::connect_main(); } sub languages { - my $class = shift; return Bugzilla::Install::Util::supported_languages(); } @@ -487,6 +464,9 @@ sub usage_mode { elsif ($newval == USAGE_MODE_TEST) { $class->error_mode(ERROR_MODE_TEST); } + elsif ($newval == USAGE_MODE_REST) { + $class->error_mode(ERROR_MODE_REST); + } else { ThrowCodeError('usage_mode_invalid', {'invalid_usage_mode', $newval}); @@ -550,6 +530,11 @@ sub switch_to_main_db { return $class->dbh_main; } +sub is_shadow_db { + my $class = shift; + return $class->request_cache->{dbh} != $class->dbh_main; +} + sub fields { my ($class, $criteria) = @_; $criteria ||= {}; @@ -618,13 +603,8 @@ sub has_flags { } sub local_timezone { - my $class = shift; - - if (!defined $class->process_cache->{local_timezone}) { - $class->process_cache->{local_timezone} = - DateTime::TimeZone->new(name => 'local'); - } - return $class->process_cache->{local_timezone}; + return $_[0]->process_cache->{local_timezone} + ||= DateTime::TimeZone->new(name => 'local'); } # This creates the request cache for non-mod_perl installations. @@ -666,18 +646,27 @@ sub process_cache { return $_process_cache; } +# This is a memcached wrapper, which provides cross-process and cross-system +# caching. +sub memcached { + return $_[0]->process_cache->{memcached} ||= Bugzilla::Memcached->_new(); +} + # Private methods # Per-process cleanup. Note that this is a plain subroutine, not a method, # so we don't have $class available. sub _cleanup { - my $main = Bugzilla->request_cache->{dbh_main}; - my $shadow = Bugzilla->request_cache->{dbh_shadow}; + my $cache = Bugzilla->request_cache; + my $main = $cache->{dbh_main}; + my $shadow = $cache->{dbh_shadow}; foreach my $dbh ($main, $shadow) { next if !$dbh; $dbh->bz_rollback_transaction() if $dbh->bz_in_transaction; $dbh->disconnect; } + my $smtp = $cache->{smtp}; + $smtp->disconnect if $smtp; clear_request_cache(); # These are both set by CGI.pm but need to be undone so that @@ -769,7 +758,7 @@ If you ever need a L<Bugzilla::Template> object while you're already processing a template, use this. Also use it if you want to specify the language to use. If no argument is passed, it uses the last language set. If the argument is "" (empty string), the language is -reset to the current one (the one used by Bugzilla->template). +reset to the current one (the one used by C<Bugzilla-E<gt>template>). =item C<cgi> @@ -846,7 +835,7 @@ default), LOGOUT_ALL or LOGOUT_KEEP_CURRENT. =item C<logout_user($user)> -Logs out the specified user (invalidating all his sessions), taking a +Logs out the specified user (invalidating all their sessions), taking a Bugzilla::User instance. =item C<logout_by_id($id)> @@ -887,8 +876,8 @@ specify this argument, all fields will be returned. =item C<error_mode> -Call either C<Bugzilla->error_mode(Bugzilla::Constants::ERROR_MODE_DIE)> -or C<Bugzilla->error_mode(Bugzilla::Constants::ERROR_MODE_DIE_SOAP_FAULT)> to +Call either C<Bugzilla-E<gt>error_mode(Bugzilla::Constants::ERROR_MODE_DIE)> +or C<Bugzilla-E<gt>error_mode(Bugzilla::Constants::ERROR_MODE_DIE_SOAP_FAULT)> to change this flag's default of C<Bugzilla::Constants::ERROR_MODE_WEBPAGE> and to indicate that errors should be passed to error mode specific error handlers rather than being sent to a browser and finished with an exit(). @@ -897,24 +886,24 @@ This is useful, for example, to keep C<eval> blocks from producing wild HTML on errors, making it easier for you to catch them. (Remember to reset the error mode to its previous value afterwards, though.) -C<Bugzilla->error_mode> will return the current state of this flag. +C<Bugzilla-E<gt>error_mode> will return the current state of this flag. -Note that C<Bugzilla->error_mode> is being called by C<Bugzilla->usage_mode> on +Note that C<Bugzilla-E<gt>error_mode> is being called by C<Bugzilla-E<gt>usage_mode> on usage mode changes. =item C<usage_mode> -Call either C<Bugzilla->usage_mode(Bugzilla::Constants::USAGE_MODE_CMDLINE)> -or C<Bugzilla->usage_mode(Bugzilla::Constants::USAGE_MODE_XMLRPC)> near the +Call either C<Bugzilla-E<gt>usage_mode(Bugzilla::Constants::USAGE_MODE_CMDLINE)> +or C<Bugzilla-E<gt>usage_mode(Bugzilla::Constants::USAGE_MODE_XMLRPC)> near the beginning of your script to change this flag's default of C<Bugzilla::Constants::USAGE_MODE_BROWSER> and to indicate that Bugzilla is being called in a non-interactive manner. This influences error handling because on usage mode changes, C<usage_mode> -calls C<Bugzilla->error_mode> to set an error mode which makes sense for the +calls C<Bugzilla-E<gt>error_mode> to set an error mode which makes sense for the usage mode. -C<Bugzilla->usage_mode> will return the current state of this flag. +C<Bugzilla-E<gt>usage_mode> will return the current state of this flag. =item C<installation_mode> @@ -951,11 +940,17 @@ Switch from using the main database to using the shadow database. Change the database object to refer to the main database. +=item C<is_shadow_db> + +Returns true if the currently active database is the shadow database. +Returns false if a the currently active database is the man database, or if a +shadow database is not configured or enabled. + =item C<params> -The current Parameters of Bugzilla, as a hashref. If C<data/params> -does not exist, then we return an empty hashref. If C<data/params> -is unreadable or is not valid perl, we C<die>. +The current Parameters of Bugzilla, as a hashref. If C<data/params.json> +does not exist, then we return an empty hashref. If C<data/params.json> +is unreadable or is not valid, we C<die>. =item C<local_timezone> @@ -975,3 +970,99 @@ Tells you whether or not a specific feature is enabled. For names of features, see C<OPTIONAL_MODULES> in C<Bugzilla::Install::Requirements>. =back + +=head1 B<CACHING> + +Bugzilla has several different caches available which provide different +capabilities and lifetimes. + +The keys of all caches are unregulated; use of prefixes is suggested to avoid +collisions. + +=over + +=item B<Request Cache> + +The request cache is a hashref which supports caching any perl variable for the +duration of the current request. At the end of the current request the contents +of this cache are cleared. + +Examples of its use include caching objects to avoid re-fetching the same data +from the database, and passing data between otherwise unconnected parts of +Bugzilla. + +=over + +=item C<request_cache> + +Returns a hashref which can be checked and modified to store any perl variable +for the duration of the current request. + +=item C<clear_request_cache> + +Removes all entries from the C<request_cache>. + +=back + +=item B<Process Cache> + +The process cache is a hashref which support caching of any perl variable. If +Bugzilla is configured to run using Apache mod_perl, the contents of this cache +are persisted across requests for the lifetime of the Apache worker process +(which varies depending on the SizeLimit configuration in mod_perl.pl). + +If Bugzilla isn't running under mod_perl, the process cache's contents are +cleared at the end of the request. + +The process cache is only suitable for items which never change while Bugzilla +is running (for example the path where Bugzilla is installed). + +=over + +=item C<process_cache> + +Returns a hashref which can be checked and modified to store any perl variable +for the duration of the current process (mod_perl) or request (mod_cgi). + +=back + +=item B<Memcached> + +If Memcached is installed and configured, Bugzilla can use it to cache data +across requests and between webheads. Unlike the request and process caches, +only scalars, hashrefs, and arrayrefs can be stored in Memcached. + +Memcached integration is only required for large installations of Bugzilla -- if +you have multiple webheads then configuring Memcached is recommended. + +=over + +=item C<memcached> + +Returns a C<Bugzilla::Memcached> object. An object is always returned even if +Memcached is not available. + +See the documentation for the C<Bugzilla::Memcached> module for more +information. + +=back + +=back + +=head1 B<Methods in need of POD> + +=over + +=item init_page + +=item extensions + +=item logout_user_by_id + +=item localconfig + +=item active_custom_fields + +=item has_flags + +=back diff --git a/Bugzilla/Attachment.pm b/Bugzilla/Attachment.pm index cd8316a91..932fb6b17 100644 --- a/Bugzilla/Attachment.pm +++ b/Bugzilla/Attachment.pm @@ -5,10 +5,12 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -use strict; - package Bugzilla::Attachment; +use 5.10.1; +use strict; +use warnings; + =head1 NAME Bugzilla::Attachment - Bugzilla attachment class. @@ -44,8 +46,9 @@ use Bugzilla::Hook; use File::Copy; use List::Util qw(max); +use Storable qw(dclone); -use base qw(Bugzilla::Object); +use parent qw(Bugzilla::Object); ############################### #### Initialization #### @@ -58,22 +61,19 @@ use constant LIST_ORDER => ID_FIELD; use constant AUDIT_CREATES => 0; use constant AUDIT_UPDATES => 0; -sub DB_COLUMNS { - my $dbh = Bugzilla->dbh; - - return qw( - attach_id - bug_id - description - filename - isobsolete - ispatch - isprivate - mimetype - modification_time - submitter_id), - $dbh->sql_date_format('attachments.creation_ts', '%Y.%m.%d %H:%i') . ' AS creation_ts'; -} +use constant DB_COLUMNS => qw( + attach_id + bug_id + creation_ts + description + filename + isobsolete + ispatch + isprivate + mimetype + modification_time + submitter_id +); use constant REQUIRED_FIELD_MAP => { bug_id => 'bug', @@ -99,7 +99,8 @@ use constant VALIDATORS => { }; use constant VALIDATOR_DEPENDENCIES => { - mimetype => ['ispatch'], + content_type => ['ispatch'], + mimetype => ['ispatch'], }; use constant UPDATE_VALIDATORS => { @@ -125,8 +126,7 @@ the ID of the bug to which the attachment is attached =cut sub bug_id { - my $self = shift; - return $self->{bug_id}; + return $_[0]->{bug_id}; } =over @@ -140,11 +140,8 @@ the bug object to which the attachment is attached =cut sub bug { - my $self = shift; - require Bugzilla::Bug; - $self->{bug} ||= Bugzilla::Bug->new($self->bug_id); - return $self->{bug}; + return $_[0]->{bug} //= Bugzilla::Bug->new({ id => $_[0]->bug_id, cache => 1 }); } =over @@ -158,8 +155,7 @@ user-provided text describing the attachment =cut sub description { - my $self = shift; - return $self->{description}; + return $_[0]->{description}; } =over @@ -173,8 +169,7 @@ the attachment's MIME media type =cut sub contenttype { - my $self = shift; - return $self->{mimetype}; + return $_[0]->{mimetype}; } =over @@ -188,10 +183,8 @@ the user who attached the attachment =cut sub attacher { - my $self = shift; - return $self->{attacher} if exists $self->{attacher}; - $self->{attacher} = new Bugzilla::User($self->{submitter_id}); - return $self->{attacher}; + return $_[0]->{attacher} + //= new Bugzilla::User({ id => $_[0]->{submitter_id}, cache => 1 }); } =over @@ -205,8 +198,7 @@ the date and time on which the attacher attached the attachment =cut sub attached { - my $self = shift; - return $self->{creation_ts}; + return $_[0]->{creation_ts}; } =over @@ -220,8 +212,7 @@ the date and time on which the attachment was last modified. =cut sub modification_time { - my $self = shift; - return $self->{modification_time}; + return $_[0]->{modification_time}; } =over @@ -235,8 +226,7 @@ the name of the file the attacher attached =cut sub filename { - my $self = shift; - return $self->{filename}; + return $_[0]->{filename}; } =over @@ -250,8 +240,7 @@ whether or not the attachment is a patch =cut sub ispatch { - my $self = shift; - return $self->{ispatch}; + return $_[0]->{ispatch}; } =over @@ -265,8 +254,7 @@ whether or not the attachment is obsolete =cut sub isobsolete { - my $self = shift; - return $self->{isobsolete}; + return $_[0]->{isobsolete}; } =over @@ -280,8 +268,7 @@ whether or not the attachment is private =cut sub isprivate { - my $self = shift; - return $self->{isprivate}; + return $_[0]->{isprivate}; } =over @@ -298,8 +285,7 @@ matches, because this will return a value even if it's matched by the generic =cut sub is_viewable { - my $self = shift; - my $contenttype = $self->contenttype; + my $contenttype = $_[0]->contenttype; my $cgi = Bugzilla->cgi; # We assume we can view all text and image types. @@ -373,7 +359,7 @@ the length (in bytes) of the attachment content sub datasize { my $self = shift; - return $self->{datasize} if exists $self->{datasize}; + return $self->{datasize} if defined $self->{datasize}; # If we have already retrieved the data, return its size. return length($self->{data}) if exists $self->{data}; @@ -416,11 +402,8 @@ flags that have been set on the attachment =cut sub flags { - my $self = shift; - # Don't cache it as it must be in sync with ->flag_types. - $self->{flags} = [map { @{$_->{flags}} } @{$self->flag_types}]; - return $self->{flags}; + return $_[0]->{flags} = [map { @{$_->{flags}} } @{$_[0]->flag_types}]; } =over @@ -443,8 +426,7 @@ sub flag_types { component_id => $self->bug->component_id, attach_id => $self->id }; - $self->{flag_types} = Bugzilla::Flag->_flag_types($vars); - return $self->{flag_types}; + return $self->{flag_types} = Bugzilla::Flag->_flag_types($vars); } ############################### @@ -674,23 +656,27 @@ sub get_attachments_by_bug { my $attachments = Bugzilla::Attachment->new_from_list($attach_ids); $_->{bug} = $bug foreach @$attachments; - # To avoid $attachment->flags to run SQL queries itself for each - # attachment listed here, we collect all the data at once and - # populate $attachment->{flags} ourselves. - # We also load all attachers at once for the same reason. + # To avoid $attachment->flags and $attachment->flag_types running SQL queries + # themselves for each attachment listed here, we collect all the data at once and + # populate $attachment->{flag_types} ourselves. We also load all attachers and + # datasizes at once for the same reason. if ($vars->{preload}) { - # Preload flags. - $_->{flags} = [] foreach @$attachments; - my %att = map { $_->id => $_ } @$attachments; - - my $flags = Bugzilla::Flag->match({ bug_id => $bug->id, - target_type => 'attachment' }); - - # Exclude flags for private attachments you cannot see. - @$flags = grep {exists $att{$_->attach_id}} @$flags; + # Preload flag types and flags + my $vars = { target_type => 'attachment', + product_id => $bug->product_id, + component_id => $bug->component_id, + attach_id => $attach_ids }; + my $flag_types = Bugzilla::Flag->_flag_types($vars); - push(@{$att{$_->attach_id}->{flags}}, $_) foreach @$flags; - $attachments = [sort {$a->id <=> $b->id} values %att]; + foreach my $attachment (@$attachments) { + $attachment->{flag_types} = []; + my $new_types = dclone($flag_types); + foreach my $new_type (@$new_types) { + $new_type->{flags} = [ grep($_->attach_id == $attachment->id, + @{ $new_type->{flags} }) ]; + push(@{ $attachment->{flag_types} }, $new_type); + } + } # Preload attachers. my %user_ids = map { $_->{submitter_id} => 1 } @$attachments; @@ -699,34 +685,44 @@ sub get_attachments_by_bug { foreach my $attachment (@$attachments) { $attachment->{attacher} = $user_map{$attachment->{submitter_id}}; } + + # Preload datasizes. + my $sizes = + $dbh->selectall_hashref('SELECT attach_id, LENGTH(thedata) AS datasize + FROM attachments LEFT JOIN attach_data ON attach_id = id + WHERE bug_id = ?', + 'attach_id', undef, $bug->id); + + # Force the size of attachments not in the DB to be recalculated. + $_->{datasize} = $sizes->{$_->id}->{datasize} || undef foreach @$attachments; } + return $attachments; } =pod -=item C<validate_can_edit($attachment, $product_id)> +=item C<validate_can_edit> Description: validates if the user is allowed to view and edit the attachment. Only the submitter or someone with editbugs privs can edit it. Only the submitter and users in the insider group can view private attachments. -Params: $attachment - the attachment object being edited. - $product_id - the product ID the attachment belongs to. +Params: none Returns: 1 on success, 0 otherwise. =cut sub validate_can_edit { - my ($attachment, $product_id) = @_; + my $attachment = shift; my $user = Bugzilla->user; # The submitter can edit their attachments. return ($attachment->attacher->id == $user->id || ((!$attachment->isprivate || $user->is_insider) - && $user->in_group('editbugs', $product_id))) ? 1 : 0; + && $user->in_group('editbugs', $attachment->bug->product_id))) ? 1 : 0; } =item C<validate_obsolete($bug, $attach_ids)> @@ -734,7 +730,7 @@ sub validate_can_edit { Description: validates if attachments the user wants to mark as obsolete really belong to the given bug and are not already obsolete. Moreover, a user cannot mark an attachment as obsolete if - he cannot view it (due to restrictions on it). + they cannot view it (due to restrictions on it). Params: $bug - The bug object obsolete attachments should belong to. $attach_ids - The list of attachments to mark as obsolete. @@ -763,7 +759,7 @@ sub validate_obsolete { || ThrowUserError('invalid_attach_id', $vars); # Check that the user can view and edit this attachment. - $attachment->validate_can_edit($bug->product_id) + $attachment->validate_can_edit || ThrowUserError('illegal_attachment_edit', { attach_id => $attachment->id }); if ($attachment->bug_id != $bug->bug_id) { @@ -904,10 +900,14 @@ sub update { } if (scalar(keys %$changes)) { - $dbh->do('UPDATE attachments SET modification_time = ? WHERE attach_id = ?', - undef, ($timestamp, $self->id)); - $dbh->do('UPDATE bugs SET delta_ts = ? WHERE bug_id = ?', - undef, ($timestamp, $self->bug_id)); + $dbh->do('UPDATE attachments SET modification_time = ? WHERE attach_id = ?', + undef, ($timestamp, $self->id)); + $dbh->do('UPDATE bugs SET delta_ts = ? WHERE bug_id = ?', + undef, ($timestamp, $self->bug_id)); + $self->{modification_time} = $timestamp; + # because we updated the attachments table after SUPER::update(), we + # need to ensure the cache is flushed. + Bugzilla->memcached->clear({ table => 'attachments', id => $self->id }); } return $changes; @@ -932,7 +932,10 @@ sub remove_from_db { my $dbh = Bugzilla->dbh; $dbh->bz_start_transaction(); - $dbh->do('DELETE FROM flags WHERE attach_id = ?', undef, $self->id); + my $flag_ids = $dbh->selectcol_arrayref( + 'SELECT id FROM flags WHERE attach_id = ?', undef, $self->id); + $dbh->do('DELETE FROM flags WHERE ' . $dbh->sql_in('id', $flag_ids)) + if @$flag_ids; $dbh->do('DELETE FROM attach_data WHERE id = ?', undef, $self->id); $dbh->do('UPDATE attachments SET mimetype = ?, ispatch = ?, isobsolete = ? WHERE attach_id = ?', undef, ('text/plain', 0, 1, $self->id)); @@ -942,6 +945,13 @@ sub remove_from_db { if (-e $filename) { unlink $filename or warn "Couldn't unlink $filename: $!"; } + + # As we don't call SUPER->remove_from_db we need to manually clear + # memcached here. + Bugzilla->memcached->clear({ table => 'attachments', id => $self->id }); + foreach my $flag_id (@$flag_ids) { + Bugzilla->memcached->clear({ table => 'flags', id => $flag_id }); + } } ############################### @@ -985,3 +995,29 @@ sub get_content_type { 1; + +=head1 B<Methods in need of POD> + +=over + +=item set_filename + +=item set_is_obsolete + +=item DB_COLUMNS + +=item set_is_private + +=item set_content_type + +=item set_description + +=item get_content_type + +=item set_flags + +=item set_is_patch + +=item update + +=back diff --git a/Bugzilla/Attachment/PatchReader.pm b/Bugzilla/Attachment/PatchReader.pm index e75a660f2..d0e221220 100644 --- a/Bugzilla/Attachment/PatchReader.pm +++ b/Bugzilla/Attachment/PatchReader.pm @@ -5,29 +5,38 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +package Bugzilla::Attachment::PatchReader; + +use 5.10.1; use strict; +use warnings; -package Bugzilla::Attachment::PatchReader; +use Config; +use IO::Select; +use IPC::Open3; +use Symbol 'gensym'; use Bugzilla::Error; use Bugzilla::Attachment; use Bugzilla::Util; +use constant PERLIO_IS_ENABLED => $Config{useperlio}; + sub process_diff { - my ($attachment, $format, $context) = @_; + my ($attachment, $format) = @_; my $dbh = Bugzilla->dbh; my $cgi = Bugzilla->cgi; my $lc = Bugzilla->localconfig; my $vars = {}; - my ($reader, $last_reader) = setup_patch_readers(undef, $context); + require PatchReader::Raw; + my $reader = new PatchReader::Raw; if ($format eq 'raw') { require PatchReader::DiffPrinter::raw; - $last_reader->sends_data_to(new PatchReader::DiffPrinter::raw()); + $reader->sends_data_to(new PatchReader::DiffPrinter::raw()); # Actually print out the patch. - print $cgi->header(-type => 'text/plain', - -expires => '+3M'); + print $cgi->header(-type => 'text/plain'); disable_utf8(); $reader->iterate_string('Attachment ' . $attachment->id, $attachment->data); } @@ -63,7 +72,7 @@ sub process_diff { $vars->{'description'} = $attachment->description; $vars->{'other_patches'} = \@other_patches; - setup_template_patch_reader($last_reader, $format, $context, $vars); + setup_template_patch_reader($reader, $vars); # The patch is going to be displayed in a HTML page and if the utf8 # param is enabled, we have to encode attachment data as utf8. if (Bugzilla->params->{'utf8'}) { @@ -75,11 +84,13 @@ sub process_diff { } sub process_interdiff { - my ($old_attachment, $new_attachment, $format, $context) = @_; + my ($old_attachment, $new_attachment, $format) = @_; my $cgi = Bugzilla->cgi; my $lc = Bugzilla->localconfig; my $vars = {}; + require PatchReader::Raw; + # Encode attachment data as utf8 if it's going to be displayed in a HTML # page using the UTF-8 encoding. if ($format ne 'raw' && Bugzilla->params->{'utf8'}) { @@ -98,23 +109,87 @@ sub process_interdiff { # Send through interdiff, send output directly to template. # Must hack path so that interdiff will work. - $ENV{'PATH'} = $lc->{diffpath}; - open my $interdiff_fh, '-|', "$lc->{interdiffbin} $old_filename $new_filename"; - binmode $interdiff_fh; - my ($reader, $last_reader) = setup_patch_readers("", $context); + local $ENV{'PATH'} = $lc->{diffpath}; + + # Open the interdiff pipe, reading from both STDOUT and STDERR + # To avoid deadlocks, we have to read the entire output from all handles + my ($stdout, $stderr) = ('', ''); + my ($pid, $interdiff_stdout, $interdiff_stderr, $use_select); + if ($ENV{MOD_PERL}) { + require Apache2::RequestUtil; + require Apache2::SubProcess; + my $request = Apache2::RequestUtil->request; + (undef, $interdiff_stdout, $interdiff_stderr) = $request->spawn_proc_prog( + $lc->{interdiffbin}, [$old_filename, $new_filename] + ); + $use_select = !PERLIO_IS_ENABLED; + } else { + $interdiff_stderr = gensym; + $pid = open3(gensym, $interdiff_stdout, $interdiff_stderr, + $lc->{interdiffbin}, $old_filename, $new_filename); + $use_select = 1; + } + + if ($format ne 'raw' && Bugzilla->params->{'utf8'}) { + binmode $interdiff_stdout, ':utf8'; + binmode $interdiff_stderr, ':utf8'; + } else { + binmode $interdiff_stdout; + binmode $interdiff_stderr; + } + + if ($use_select) { + my $select = IO::Select->new(); + $select->add($interdiff_stdout, $interdiff_stderr); + while (my @handles = $select->can_read) { + foreach my $handle (@handles) { + my $line = <$handle>; + if (!defined $line) { + $select->remove($handle); + next; + } + if ($handle == $interdiff_stdout) { + $stdout .= $line; + } else { + $stderr .= $line; + } + } + } + waitpid($pid, 0) if $pid; + + } else { + local $/ = undef; + $stdout = <$interdiff_stdout>; + $stdout //= ''; + $stderr = <$interdiff_stderr>; + $stderr //= ''; + } + + close($interdiff_stdout), + close($interdiff_stderr); + + # Tidy up + unlink($old_filename) or warn "Could not unlink $old_filename: $!"; + unlink($new_filename) or warn "Could not unlink $new_filename: $!"; + + # Any output on STDERR means interdiff failed to full process the patches. + # Interdiff's error messages are generic and not useful to end users, so we + # show a generic failure message. + if ($stderr) { + warn($stderr); + $warning = 'interdiff3'; + } + + my $reader = new PatchReader::Raw; if ($format eq 'raw') { require PatchReader::DiffPrinter::raw; - $last_reader->sends_data_to(new PatchReader::DiffPrinter::raw()); + $reader->sends_data_to(new PatchReader::DiffPrinter::raw()); # Actually print out the patch. - print $cgi->header(-type => 'text/plain', - -expires => '+3M'); + print $cgi->header(-type => 'text/plain'); disable_utf8(); } else { - # In case the HTML page is displayed with the UTF-8 encoding. - binmode $interdiff_fh, ':utf8' if Bugzilla->params->{'utf8'}; - $vars->{'warning'} = $warning if $warning; $vars->{'bugid'} = $new_attachment->bug_id; $vars->{'oldid'} = $old_attachment->id; @@ -122,16 +197,10 @@ sub process_interdiff { $vars->{'newid'} = $new_attachment->id; $vars->{'new_desc'} = $new_attachment->description; - setup_template_patch_reader($last_reader, $format, $context, $vars); + setup_template_patch_reader($reader, $vars); } - $reader->iterate_fh($interdiff_fh, 'interdiff #' . $old_attachment->id . - ' #' . $new_attachment->id); - close $interdiff_fh; - $ENV{'PATH'} = ''; - - # Delete temporary files. - unlink($old_filename) or warn "Could not unlink $old_filename: $!"; - unlink($new_filename) or warn "Could not unlink $new_filename: $!"; + $reader->iterate_string('interdiff #' . $old_attachment->id . + ' #' . $new_attachment->id, $stdout); } ###################### @@ -143,7 +212,6 @@ sub get_unified_diff { # Bring in the modules we need. require PatchReader::Raw; - require PatchReader::FixPatchRoot; require PatchReader::DiffPrinter::raw; require PatchReader::PatchInfoGrabber; require File::Temp; @@ -155,14 +223,6 @@ sub get_unified_diff { my $reader = new PatchReader::Raw; my $last_reader = $reader; - # Fixes patch root (makes canonical if possible). - if (Bugzilla->params->{'cvsroot'}) { - my $fix_patch_root = - new PatchReader::FixPatchRoot(Bugzilla->params->{'cvsroot'}); - $last_reader->sends_data_to($fix_patch_root); - $last_reader = $fix_patch_root; - } - # Grabs the patch file info. my $patch_info_grabber = new PatchReader::PatchInfoGrabber(); $last_reader->sends_data_to($patch_info_grabber); @@ -209,46 +269,8 @@ sub warn_if_interdiff_might_fail { return undef; } -sub setup_patch_readers { - my ($diff_root, $context) = @_; - - # Parameters: - # format=raw|html - # context=patch|file|0-n - # collapsed=0|1 - # headers=0|1 - - # Define the patch readers. - # The reader that reads the patch in (whatever its format). - require PatchReader::Raw; - my $reader = new PatchReader::Raw; - my $last_reader = $reader; - # Fix the patch root if we have a cvs root. - if (Bugzilla->params->{'cvsroot'}) { - require PatchReader::FixPatchRoot; - $last_reader->sends_data_to(new PatchReader::FixPatchRoot(Bugzilla->params->{'cvsroot'})); - $last_reader->sends_data_to->diff_root($diff_root) if defined($diff_root); - $last_reader = $last_reader->sends_data_to; - } - - # Add in cvs context if we have the necessary info to do it - if ($context ne 'patch' && Bugzilla->localconfig->{cvsbin} - && Bugzilla->params->{'cvsroot_get'}) - { - require PatchReader::AddCVSContext; - # We need to set $cvsbin as global, because PatchReader::CVSClient - # needs it in order to find 'cvs'. - $main::cvsbin = Bugzilla->localconfig->{cvsbin}; - $last_reader->sends_data_to( - new PatchReader::AddCVSContext($context, Bugzilla->params->{'cvsroot_get'})); - $last_reader = $last_reader->sends_data_to; - } - - return ($reader, $last_reader); -} - sub setup_template_patch_reader { - my ($last_reader, $format, $context, $vars) = @_; + my ($last_reader, $vars) = @_; my $cgi = Bugzilla->cgi; my $template = Bugzilla->template; @@ -263,24 +285,33 @@ sub setup_template_patch_reader { } $vars->{'collapsed'} = $cgi->param('collapsed'); - $vars->{'context'} = $context; - $vars->{'do_context'} = Bugzilla->localconfig->{cvsbin} - && Bugzilla->params->{'cvsroot_get'} && !$vars->{'newid'}; # Print everything out. print $cgi->header(-type => 'text/html'); $last_reader->sends_data_to(new PatchReader::DiffPrinter::template($template, - "attachment/diff-header.$format.tmpl", - "attachment/diff-file.$format.tmpl", - "attachment/diff-footer.$format.tmpl", - { %{$vars}, - bonsai_url => Bugzilla->params->{'bonsai_url'}, - lxr_url => Bugzilla->params->{'lxr_url'}, - lxr_root => Bugzilla->params->{'lxr_root'}, - })); + 'attachment/diff-header.html.tmpl', + 'attachment/diff-file.html.tmpl', + 'attachment/diff-footer.html.tmpl', + $vars)); } 1; __END__ + +=head1 B<Methods in need of POD> + +=over + +=item get_unified_diff + +=item process_diff + +=item warn_if_interdiff_might_fail + +=item setup_template_patch_reader + +=item process_interdiff + +=back diff --git a/Bugzilla/Auth.pm b/Bugzilla/Auth.pm index 09a2c1da4..c830f0506 100644 --- a/Bugzilla/Auth.pm +++ b/Bugzilla/Auth.pm @@ -7,7 +7,10 @@ package Bugzilla::Auth; +use 5.10.1; use strict; +use warnings; + use fields qw( _info_getter _verifier @@ -29,7 +32,7 @@ sub new { my $self = fields::new($class); $params ||= {}; - $params->{Login} ||= Bugzilla->params->{'user_info_class'} . ',Cookie'; + $params->{Login} ||= Bugzilla->params->{'user_info_class'} . ',Cookie,APIKey'; $params->{Verify} ||= Bugzilla->params->{'user_verify_class'}; $self->{_info_getter} = new Bugzilla::Auth::Login::Stack($params->{Login}); @@ -43,7 +46,6 @@ sub new { sub login { my ($self, $type) = @_; - my $dbh = Bugzilla->dbh; # Get login info from the cookie, form, environment variables, etc. my $login_info = $self->{_info_getter}->get_login_info(); @@ -52,7 +54,7 @@ sub login { return $self->_handle_login_result($login_info, $type); } - # Now verify his username and password against the DB, LDAP, etc. + # Now verify their username and password against the DB, LDAP, etc. if ($self->{_info_getter}->{successful}->requires_verification) { $login_info = $self->{_verifier}->check_credentials($login_info); if ($login_info->{failure}) { @@ -177,7 +179,7 @@ sub _handle_login_result { elsif ($fail_code == AUTH_LOGINFAILED or $fail_code == AUTH_NO_SUCH_USER) { my $remaining_attempts = MAX_LOGIN_ATTEMPTS - ($result->{failure_count} || 0); - ThrowUserError("invalid_username_or_password", + ThrowUserError("invalid_login_or_password", { remaining => $remaining_attempts }); } # The account may be disabled @@ -296,7 +298,7 @@ An incorrect username or password was given. The hashref may also contain a C<failure_count> element, which specifies how many times the account has failed to log in within the lockout period (see L</AUTH_LOCKOUT>). This is used to warn the user when -he is getting close to being locked out. +they are getting close to being locked out. =head2 C<AUTH_NO_SUCH_USER> diff --git a/Bugzilla/Auth/Login.pm b/Bugzilla/Auth/Login.pm index 290cb42ff..a5f089777 100644 --- a/Bugzilla/Auth/Login.pm +++ b/Bugzilla/Auth/Login.pm @@ -7,7 +7,10 @@ package Bugzilla::Auth::Login; +use 5.10.1; use strict; +use warnings; + use fields qw(); # Determines whether or not a user can logout. It's really a subroutine, diff --git a/Bugzilla/Auth/Login/APIKey.pm b/Bugzilla/Auth/Login/APIKey.pm new file mode 100644 index 000000000..63e35578a --- /dev/null +++ b/Bugzilla/Auth/Login/APIKey.pm @@ -0,0 +1,53 @@ +# 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::Auth::Login::APIKey; + +use 5.10.1; +use strict; +use warnings; + +use base qw(Bugzilla::Auth::Login); + +use Bugzilla::Constants; +use Bugzilla::User::APIKey; +use Bugzilla::Util; +use Bugzilla::Error; + +use constant requires_persistence => 0; +use constant requires_verification => 0; +use constant can_login => 0; +use constant can_logout => 0; + +# This method is only available to web services. An API key can never +# be used to authenticate a Web request. +sub get_login_info { + my ($self) = @_; + my $params = Bugzilla->input_params; + my ($user_id, $login_cookie); + + my $api_key_text = trim(delete $params->{'Bugzilla_api_key'}); + if (!i_am_webservice() || !$api_key_text) { + return { failure => AUTH_NODATA }; + } + + my $api_key = Bugzilla::User::APIKey->new({ name => $api_key_text }); + + if (!$api_key or $api_key->api_key ne $api_key_text) { + # The second part checks the correct capitalisation. Silly MySQL + ThrowUserError("api_key_not_valid"); + } + elsif ($api_key->revoked) { + ThrowUserError('api_key_revoked'); + } + + $api_key->update_last_used(); + + return { user_id => $api_key->user_id }; +} + +1; diff --git a/Bugzilla/Auth/Login/CGI.pm b/Bugzilla/Auth/Login/CGI.pm index f29e8c9c1..6003d62a5 100644 --- a/Bugzilla/Auth/Login/CGI.pm +++ b/Bugzilla/Auth/Login/CGI.pm @@ -6,8 +6,12 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Auth::Login::CGI; + +use 5.10.1; use strict; -use base qw(Bugzilla::Auth::Login); +use warnings; + +use parent qw(Bugzilla::Auth::Login); use constant user_can_create_account => 1; use Bugzilla::Constants; diff --git a/Bugzilla/Auth/Login/Cookie.pm b/Bugzilla/Auth/Login/Cookie.pm index b20357307..c09f08d24 100644 --- a/Bugzilla/Auth/Login/Cookie.pm +++ b/Bugzilla/Auth/Login/Cookie.pm @@ -7,12 +7,16 @@ package Bugzilla::Auth::Login::Cookie; +use 5.10.1; use strict; +use warnings; use base qw(Bugzilla::Auth::Login); use fields qw(_login_token); use Bugzilla::Constants; +use Bugzilla::Error; +use Bugzilla::Token; use Bugzilla::Util; use List::Util qw(first); @@ -47,6 +51,20 @@ sub get_login_info { @{$cgi->{'Bugzilla_cookie_list'}}; $user_id = $cookie->value if $cookie; } + + # If the call is for a web service, and an api token is provided, check + # it is valid. + if (i_am_webservice() && Bugzilla->input_params->{Bugzilla_api_token}) { + my $api_token = Bugzilla->input_params->{Bugzilla_api_token}; + my ($token_user_id, undef, undef, $token_type) + = Bugzilla::Token::GetTokenData($api_token); + if (!defined $token_type + || $token_type ne 'api_token' + || $user_id != $token_user_id) + { + ThrowUserError('auth_invalid_token', { token => $api_token }); + } + } } # If no cookies were provided, we also look for a login token @@ -73,7 +91,9 @@ sub get_login_info { AND (ipaddr = ? OR ipaddr IS NULL)', undef, ($login_cookie, $user_id, $ip_addr)); - # If the cookie is valid, return a valid username. + # If the cookie or token is valid, return a valid username. + # If they were not valid and we are using a webservice, then + # throw an error notifying the client. if (defined $db_cookie && $login_cookie eq $db_cookie) { # If we logged in successfully, then update the lastused # time on the login cookie @@ -81,12 +101,16 @@ sub get_login_info { WHERE cookie = ?", undef, $login_cookie); return { user_id => $user_id }; } + elsif (i_am_webservice()) { + ThrowUserError('invalid_cookies_or_token'); + } } - # Either the he cookie is invalid, or we got no cookie. We don't want - # to ever return AUTH_LOGINFAILED, because we don't want Bugzilla to - # actually throw an error when it gets a bad cookie. It should just - # look like there was no cookie to begin with. + # Either the cookie or token is invalid and we are not authenticating + # via a webservice, or we did not receive a cookie or token. We don't + # want to ever return AUTH_LOGINFAILED, because we don't want Bugzilla to + # actually throw an error when it gets a bad cookie or token. It should just + # look like there was no cookie or token to begin with. return { failure => AUTH_NODATA }; } @@ -97,9 +121,7 @@ sub login_token { return $self->{'_login_token'} if exists $self->{'_login_token'}; - if ($usage_mode ne USAGE_MODE_XMLRPC - && $usage_mode ne USAGE_MODE_JSON) - { + if (!i_am_webservice()) { return $self->{'_login_token'} = undef; } diff --git a/Bugzilla/Auth/Login/Env.pm b/Bugzilla/Auth/Login/Env.pm index 393ac600d..653df2bb3 100644 --- a/Bugzilla/Auth/Login/Env.pm +++ b/Bugzilla/Auth/Login/Env.pm @@ -6,8 +6,12 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Auth::Login::Env; + +use 5.10.1; use strict; -use base qw(Bugzilla::Auth::Login); +use warnings; + +use parent qw(Bugzilla::Auth::Login); use Bugzilla::Constants; use Bugzilla::Error; @@ -21,7 +25,6 @@ use constant extern_id_used => 1; sub get_login_info { my ($self) = @_; - my $dbh = Bugzilla->dbh; my $env_id = $ENV{Bugzilla->params->{"auth_env_id"}} || ''; my $env_email = $ENV{Bugzilla->params->{"auth_env_email"}} || ''; diff --git a/Bugzilla/Auth/Login/Stack.pm b/Bugzilla/Auth/Login/Stack.pm index 17a5855b6..dc35998e4 100644 --- a/Bugzilla/Auth/Login/Stack.pm +++ b/Bugzilla/Auth/Login/Stack.pm @@ -6,7 +6,11 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Auth::Login::Stack; + +use 5.10.1; use strict; +use warnings; + use base qw(Bugzilla::Auth::Login); use fields qw( _stack diff --git a/Bugzilla/Auth/Persist/Cookie.pm b/Bugzilla/Auth/Persist/Cookie.pm index b0aeb4f0f..2d1291f3b 100644 --- a/Bugzilla/Auth/Persist/Cookie.pm +++ b/Bugzilla/Auth/Persist/Cookie.pm @@ -6,7 +6,11 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Auth::Persist::Cookie; + +use 5.10.1; use strict; +use warnings; + use fields qw(); use Bugzilla::Constants; @@ -108,7 +112,7 @@ sub logout { if ($cookie) { push(@login_cookies, $cookie->value); } - elsif ($cookie = $cgi->cookie("Bugzilla_logincookie")) { + elsif ($cookie = $cgi->cookie('Bugzilla_logincookie')) { push(@login_cookies, $cookie); } @@ -147,6 +151,7 @@ sub logout { if ($type != LOGOUT_KEEP_CURRENT) { clear_browser_cookies(); } + } sub clear_browser_cookies { diff --git a/Bugzilla/Auth/Verify.pm b/Bugzilla/Auth/Verify.pm index ae256dd8c..e44fb06ae 100644 --- a/Bugzilla/Auth/Verify.pm +++ b/Bugzilla/Auth/Verify.pm @@ -7,7 +7,10 @@ package Bugzilla::Auth::Verify; +use 5.10.1; use strict; +use warnings; + use fields qw(); use Bugzilla::Constants; @@ -88,6 +91,7 @@ sub create_or_update_user { if ($extern_id && $username_user_id && !$extern_user_id) { $dbh->do('UPDATE profiles SET extern_id = ? WHERE userid = ?', undef, $extern_id, $username_user_id); + Bugzilla->memcached->clear({ table => 'profiles', id => $username_user_id }); } # Finally, at this point, one of these will give us a valid user id. @@ -233,3 +237,11 @@ edit the extern_id for all users. The default value is C<false>. =back + +=head1 B<Methods in need of POD> + +=over + +=item can_change_password + +=back diff --git a/Bugzilla/Auth/Verify/DB.pm b/Bugzilla/Auth/Verify/DB.pm index 99dc48ddc..28a9310c9 100644 --- a/Bugzilla/Auth/Verify/DB.pm +++ b/Bugzilla/Auth/Verify/DB.pm @@ -6,8 +6,12 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Auth::Verify::DB; + +use 5.10.1; use strict; -use base qw(Bugzilla::Auth::Verify); +use warnings; + +use parent qw(Bugzilla::Auth::Verify); use Bugzilla::Constants; use Bugzilla::Token; @@ -52,10 +56,19 @@ sub check_credentials { }; } - # Force the user to type a longer password if it's too short. - if (length($password) < USER_PASSWORD_MIN_LENGTH) { - return { failure => AUTH_ERROR, user_error => 'password_current_too_short', - details => { locked_user => $user } }; + # Force the user to change their password if it does not meet the current + # criteria. This should usually only happen if the criteria has changed. + if (Bugzilla->usage_mode == USAGE_MODE_BROWSER && + Bugzilla->params->{password_check_on_login}) + { + my $check = validate_password_check($password); + if ($check) { + return { + failure => AUTH_ERROR, + user_error => $check, + details => { locked_user => $user } + } + } } # The user's credentials are okay, so delete any outstanding @@ -63,11 +76,22 @@ sub check_credentials { Bugzilla::Token::DeletePasswordTokens($user->id, "user_logged_in"); $user->clear_login_failures(); + my $update_password = 0; + # If their old password was using crypt() or some different hash # than we're using now, convert the stored password to using # whatever hashing system we're using now. my $current_algorithm = PASSWORD_DIGEST_ALGORITHM; - if ($real_password_crypted !~ /{\Q$current_algorithm\E}$/) { + $update_password = 1 if ($real_password_crypted !~ /{\Q$current_algorithm\E}$/); + + # If their old password was using a different length salt than what + # we're using now, update the password to use the new salt length. + if ($real_password_crypted =~ /^([^,]+),/) { + $update_password = 1 if (length($1) != PASSWORD_SALT_LENGTH); + } + + # If needed, update the user's password. + if ($update_password) { # We can't call $user->set_password because we don't want the password # complexity rules to apply here. $user->{cryptpassword} = bz_crypt($password); @@ -83,6 +107,7 @@ sub change_password { my $cryptpassword = bz_crypt($password); $dbh->do("UPDATE profiles SET cryptpassword = ? WHERE userid = ?", undef, $cryptpassword, $user->id); + Bugzilla->memcached->clear({ table => 'profiles', id => $user->id }); } 1; diff --git a/Bugzilla/Auth/Verify/LDAP.pm b/Bugzilla/Auth/Verify/LDAP.pm index 5704c5848..e37f55793 100644 --- a/Bugzilla/Auth/Verify/LDAP.pm +++ b/Bugzilla/Auth/Verify/LDAP.pm @@ -6,7 +6,11 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Auth::Verify::LDAP; + +use 5.10.1; use strict; +use warnings; + use base qw(Bugzilla::Auth::Verify); use fields qw( ldap @@ -149,7 +153,7 @@ sub _bind_ldap_for_search { # We can't just do this in new(), because we're not allowed to throw any # error from anywhere under Bugzilla::Auth::new -- otherwise we # could create a situation where the admin couldn't get to editparams -# to fix his mistake. (Because Bugzilla->login always calls +# to fix their mistake. (Because Bugzilla->login always calls # Bugzilla::Auth->new, and almost every page calls Bugzilla->login.) sub ldap { my ($self) = @_; diff --git a/Bugzilla/Auth/Verify/RADIUS.pm b/Bugzilla/Auth/Verify/RADIUS.pm index d6c4db8e8..283d9b466 100644 --- a/Bugzilla/Auth/Verify/RADIUS.pm +++ b/Bugzilla/Auth/Verify/RADIUS.pm @@ -6,8 +6,12 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Auth::Verify::RADIUS; + +use 5.10.1; use strict; -use base qw(Bugzilla::Auth::Verify); +use warnings; + +use parent qw(Bugzilla::Auth::Verify); use Bugzilla::Constants; use Bugzilla::Error; diff --git a/Bugzilla/Auth/Verify/Stack.pm b/Bugzilla/Auth/Verify/Stack.pm index 0930d57ed..3e5db3cec 100644 --- a/Bugzilla/Auth/Verify/Stack.pm +++ b/Bugzilla/Auth/Verify/Stack.pm @@ -6,7 +6,11 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Auth::Verify::Stack; + +use 5.10.1; use strict; +use warnings; + use base qw(Bugzilla::Auth::Verify); use fields qw( _stack diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index b390c12d4..bfc2fe0d9 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -7,7 +7,9 @@ package Bugzilla::Bug; +use 5.10.1; use strict; +use warnings; use Bugzilla::Attachment; use Bugzilla::Constants; @@ -27,15 +29,14 @@ use Bugzilla::Group; use Bugzilla::Status; use Bugzilla::Comment; use Bugzilla::BugUrl; +use Bugzilla::BugUserLastVisit; use List::MoreUtils qw(firstidx uniq part); use List::Util qw(min max first); use Storable qw(dclone); -use URI; -use URI::QueryParam; use Scalar::Util qw(blessed); -use base qw(Bugzilla::Object Exporter); +use parent qw(Bugzilla::Object Exporter); @Bugzilla::Bug::EXPORT = qw( bug_alias_to_id LogActivityEntry @@ -48,11 +49,13 @@ use base qw(Bugzilla::Object Exporter); use constant DB_TABLE => 'bugs'; use constant ID_FIELD => 'bug_id'; -use constant NAME_FIELD => 'alias'; +use constant NAME_FIELD => 'bug_id'; use constant LIST_ORDER => ID_FIELD; # Bugs have their own auditing table, bugs_activity. use constant AUDIT_CREATES => 0; use constant AUDIT_UPDATES => 0; +# This will be enabled later +use constant USE_MEMCACHED => 0; # This is a sub because it needs to call other subroutines. sub DB_COLUMNS { @@ -62,7 +65,6 @@ sub DB_COLUMNS { my @custom_names = map {$_->name} @custom; my @columns = (qw( - alias assigned_to bug_file_loc bug_id @@ -70,6 +72,7 @@ sub DB_COLUMNS { bug_status cclist_accessible component_id + creation_ts delta_ts estimated_time everconfirmed @@ -88,7 +91,6 @@ sub DB_COLUMNS { version ), 'reporter AS reporter_id', - $dbh->sql_date_format('creation_ts', '%Y.%m.%d %H:%i') . ' AS creation_ts', $dbh->sql_date_format('deadline', '%Y-%m-%d') . ' AS deadline', @custom_names); @@ -145,6 +147,9 @@ sub VALIDATORS { elsif ($field->type == FIELD_TYPE_DATETIME) { $validator = \&_check_datetime_field; } + elsif ($field->type == FIELD_TYPE_DATE) { + $validator = \&_check_date_field; + } elsif ($field->type == FIELD_TYPE_FREETEXT) { $validator = \&_check_freetext_field; } @@ -154,6 +159,9 @@ sub VALIDATORS { elsif ($field->type == FIELD_TYPE_TEXTAREA) { $validator = \&_check_textarea_field; } + elsif ($field->type == FIELD_TYPE_INTEGER) { + $validator = \&_check_integer_field; + } else { $validator = \&_check_default_field; } @@ -199,7 +207,6 @@ sub UPDATE_COLUMNS { Bugzilla->active_custom_fields; my @custom_names = map {$_->name} @custom; my @columns = qw( - alias assigned_to bug_file_loc bug_severity @@ -232,7 +239,9 @@ use constant NUMERIC_COLUMNS => qw( ); sub DATE_COLUMNS { - my @fields = @{ Bugzilla->fields({ type => FIELD_TYPE_DATETIME }) }; + my @fields = (@{ Bugzilla->fields({ type => [FIELD_TYPE_DATETIME, + FIELD_TYPE_DATE] }) + }); return map { $_->name } @fields; } @@ -263,10 +272,6 @@ use constant FIELD_MAP => { summary => 'short_desc', url => 'bug_file_loc', whiteboard => 'status_whiteboard', - - # These are special values for the WebService Bug.search method. - limit => 'LIMIT', - offset => 'OFFSET', }; use constant REQUIRED_FIELD_MAP => { @@ -294,21 +299,11 @@ use constant EXTRA_REQUIRED_FIELDS => qw(creation_ts target_milestone cc qa_cont ##################################################################### -# This and "new" catch every single way of creating a bug, so that we -# can call _create_cf_accessors. -sub _do_list_select { - my $invocant = shift; - $invocant->_create_cf_accessors(); - return $invocant->SUPER::_do_list_select(@_); -} - sub new { my $invocant = shift; my $class = ref($invocant) || $invocant; my $param = shift; - $class->_create_cf_accessors(); - # Remove leading "#" mark if we've just been passed an id. if (!ref $param && $param =~ /^#(\d+)$/) { $param = $1; @@ -316,9 +311,22 @@ sub new { # If we get something that looks like a word (not a number), # make it the "name" param. - if (!defined $param || (!ref($param) && $param !~ /^\d+$/)) { + if (!defined $param + || (!ref($param) && $param !~ /^\d+$/) + || (ref($param) && $param->{id} !~ /^\d+$/)) + { if ($param) { - $param = { name => $param }; + my $alias = ref($param) ? $param->{id} : $param; + my $bug_id = bug_alias_to_id($alias); + if (! $bug_id) { + my $error_self = {}; + bless $error_self, $class; + $error_self->{'bug_id'} = $alias; + $error_self->{'error'} = 'InvalidBugId'; + return $error_self; + } + $param = { id => $bug_id, + cache => ref($param) ? $param->{cache} : 0 }; } else { # We got something that's not a number. @@ -352,6 +360,17 @@ sub new { return $self; } +sub initialize { + $_[0]->_create_cf_accessors(); +} + +sub object_cache_key { + my $class = shift; + my $key = $class->SUPER::object_cache_key(@_) + || return; + return $key . ',' . Bugzilla->user->id; +} + sub check { my $class = shift; my ($param, $field) = @_; @@ -486,8 +505,9 @@ sub preload { # to the more complex method. my @all_dep_ids; foreach my $bug (@$bugs) { - push(@all_dep_ids, @{ $bug->blocked }, @{ $bug->dependson }); - push(@all_dep_ids, @{ $bug->duplicate_ids }); + push @all_dep_ids, @{ $bug->blocked }, @{ $bug->dependson }; + push @all_dep_ids, @{ $bug->duplicate_ids }; + push @all_dep_ids, @{ $bug->_preload_referenced_bugs }; } @all_dep_ids = uniq @all_dep_ids; # If we don't do this, can_see_bug will do one call per bug in @@ -495,6 +515,60 @@ sub preload { $user->visible_bugs(\@all_dep_ids); } +# Helps load up bugs referenced in comments by retrieving them with a single +# query from the database and injecting bug objects into the object-cache. +sub _preload_referenced_bugs { + my $self = shift; + + # inject current duplicates into the object-cache first + foreach my $bug (@{ $self->duplicates }) { + $bug->object_cache_set() unless Bugzilla::Bug->object_cache_get($bug->id); + } + + # preload bugs from comments + my $referenced_bug_ids = _extract_bug_ids($self->comments); + my @ref_bug_ids = grep { !Bugzilla::Bug->object_cache_get($_) } @$referenced_bug_ids; + + # inject into object-cache + my $referenced_bugs = Bugzilla::Bug->new_from_list(\@ref_bug_ids); + $_->object_cache_set() foreach @$referenced_bugs; + + return $referenced_bug_ids +} + +# Extract bug IDs mentioned in comments. This is much faster than calling quoteUrls(). +sub _extract_bug_ids { + my $comments = shift; + my @bug_ids; + + my $params = Bugzilla->params; + my @urlbases = ($params->{'urlbase'}); + push(@urlbases, $params->{'sslbase'}) if $params->{'sslbase'}; + my $urlbase_re = '(?:' . join('|', map { qr/$_/ } @urlbases) . ')'; + my $bug_word = template_var('terms')->{bug}; + my $bugs_word = template_var('terms')->{bugs}; + + foreach my $comment (@$comments) { + if ($comment->type == CMT_HAS_DUPE || $comment->type == CMT_DUPE_OF) { + push @bug_ids, $comment->extra_data; + next; + } + my $s = $comment->already_wrapped ? qr/\s/ : qr/\h/; + my $text = $comment->body; + # Full bug links + push @bug_ids, $text =~ /\b$urlbase_re\Qshow_bug.cgi?id=\E(\d+)(?:\#c\d+)?/g; + # bug X + my $bug_re = qr/\Q$bug_word\E$s*\#?$s*(\d+)/i; + push @bug_ids, $text =~ /\b$bug_re/g; + # bugs X, Y, Z + my $bugs_re = qr/\Q$bugs_word\E$s*\#?$s*(\d+)(?:$s*,$s*\#?$s*(\d+))+/i; + push @bug_ids, $text =~ /\b$bugs_re/g; + # Old duplicate markers + push @bug_ids, $text =~ /(?<=^\*\*\*\ This\ bug\ has\ been\ marked\ as\ a\ duplicate\ of\ )(\d+)(?=\ \*\*\*\Z)/; + } + return [uniq @bug_ids]; +} + sub possible_duplicates { my ($class, $params) = @_; my $short_desc = $params->{summary}; @@ -635,12 +709,14 @@ sub create { # These are not a fields in the bugs table, so we don't pass them to # insert_create_data. + my $bug_aliases = delete $params->{alias}; my $cc_ids = delete $params->{cc}; my $groups = delete $params->{groups}; my $depends_on = delete $params->{dependson}; my $blocked = delete $params->{blocked}; my $keywords = delete $params->{keywords}; my $creation_comment = delete $params->{comment}; + my $see_also = delete $params->{see_also}; # We don't want the bug to appear in the system until it's correctly # protected by groups. @@ -704,6 +780,25 @@ sub create { } } + # Insert any see_also values + if ($see_also) { + my $see_also_array = $see_also; + if (!ref $see_also_array) { + $see_also = trim($see_also); + $see_also_array = [ split(/[\s,]+/, $see_also) ]; + } + foreach my $value (@$see_also_array) { + $bug->add_see_also($value); + } + foreach my $see_also (@{ $bug->see_also }) { + $see_also->insert_create_data($see_also); + } + foreach my $ref_bug (@{ $bug->{_update_ref_bugs} || [] }) { + $ref_bug->update(); + } + delete $bug->{_update_ref_bugs}; + } + # Comment #0 handling... # We now have a bug id so we can fill this out @@ -713,6 +808,13 @@ sub create { # but sometimes it's blank. Bugzilla::Comment->insert_create_data($creation_comment); + # Set up aliases + my $sth_aliases = $dbh->prepare('INSERT INTO bugs_aliases (alias, bug_id) VALUES (?, ?)'); + foreach my $alias (@$bug_aliases) { + trick_taint($alias); + $sth_aliases->execute($alias, $bug->bug_id); + } + Bugzilla::Hook::process('bug_end_of_create', { bug => $bug, timestamp => $timestamp, }); @@ -776,8 +878,9 @@ sub run_create_validators { sub update { my $self = shift; + my $dbh = Bugzilla->dbh; + my $user = Bugzilla->user; - my $dbh = Bugzilla->dbh; # XXX This is just a temporary hack until all updating happens # inside this function. my $delta_ts = shift || $dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)'); @@ -831,7 +934,26 @@ sub update { my $added_names = join(', ', (map {$_->login} @$added_users)); $changes->{cc} = [$removed_names, $added_names]; } - + + # Aliases + my $old_aliases = $old_bug->alias; + my $new_aliases = $self->alias; + my ($removed_aliases, $added_aliases) = diff_arrays($old_aliases, $new_aliases); + + foreach my $alias (@$removed_aliases) { + $dbh->do('DELETE FROM bugs_aliases WHERE bug_id = ? AND alias = ?', + undef, $self->id, $alias); + } + foreach my $alias (@$added_aliases) { + trick_taint($alias); + $dbh->do('INSERT INTO bugs_aliases (bug_id, alias) VALUES (?,?)', + undef, $self->id, $alias); + } + # If any changes were found, record it in the activity log + if (scalar @$removed_aliases || scalar @$added_aliases) { + $changes->{alias} = [join(', ', @$removed_aliases), join(', ', @$added_aliases)]; + } + # Keywords my @old_kw_ids = map { $_->id } @{$old_bug->keyword_objects}; my @new_kw_ids = map { $_->id } @{$self->keyword_objects}; @@ -868,7 +990,7 @@ sub update { # Add an activity entry for the other bug. LogActivityEntry($removed_id, $other, $self->id, '', - Bugzilla->user->id, $delta_ts); + $user->id, $delta_ts); # Update delta_ts on the other bug so that we trigger mid-airs. $dbh->do('UPDATE bugs SET delta_ts = ? WHERE bug_id = ?', undef, $delta_ts, $removed_id); @@ -879,7 +1001,7 @@ sub update { # Add an activity entry for the other bug. LogActivityEntry($added_id, $other, '', $self->id, - Bugzilla->user->id, $delta_ts); + $user->id, $delta_ts); # Update delta_ts on the other bug so that we trigger mid-airs. $dbh->do('UPDATE bugs SET delta_ts = ? WHERE bug_id = ?', undef, $delta_ts, $added_id); @@ -921,7 +1043,7 @@ sub update { $comment = Bugzilla::Comment->insert_create_data($comment); if ($comment->work_time) { LogActivityEntry($self->id, "work_time", "", $comment->work_time, - Bugzilla->user->id, $delta_ts); + $user->id, $delta_ts); } } @@ -932,7 +1054,7 @@ sub update { my ($from, $to) = $comment->is_private ? (0, 1) : (1, 0); LogActivityEntry($self->id, "longdescs.isprivate", $from, $to, - Bugzilla->user->id, $delta_ts, $comment->id); + $user->id, $delta_ts, $comment->id); } # Clear the cache of comments @@ -986,8 +1108,8 @@ sub update { my $change = $changes->{$field}; my $from = defined $change->[0] ? $change->[0] : ''; my $to = defined $change->[1] ? $change->[1] : ''; - LogActivityEntry($self->id, $field, $from, $to, Bugzilla->user->id, - $delta_ts); + LogActivityEntry($self->id, $field, $from, $to, + $user->id, $delta_ts); } # Check if we have to update the duplicates table and the other bug. @@ -1001,7 +1123,7 @@ sub update { $update_dup->update(); } } - + $changes->{'dup_id'} = [$old_dup || undef, $cur_dup || undef]; } @@ -1018,6 +1140,37 @@ sub update { $self->{delta_ts} = $delta_ts; } + # Update last-visited + if ($user->is_involved_in_bug($self)) { + $self->update_user_last_visit($user, $delta_ts); + } + + # If a user is no longer involved, remove their last visit entry + my $last_visits = + Bugzilla::BugUserLastVisit->match({ bug_id => $self->id }); + foreach my $lv (@$last_visits) { + $lv->remove_from_db() unless $lv->user->is_involved_in_bug($self); + } + + # Update bug ignore data if user wants to ignore mail for this bug + if (exists $self->{'bug_ignored'}) { + my $bug_ignored_changed; + if ($self->{'bug_ignored'} && !$user->is_bug_ignored($self->id)) { + $dbh->do('INSERT INTO email_bug_ignore + (user_id, bug_id) VALUES (?, ?)', + undef, $user->id, $self->id); + $bug_ignored_changed = 1; + + } + elsif (!$self->{'bug_ignored'} && $user->is_bug_ignored($self->id)) { + $dbh->do('DELETE FROM email_bug_ignore + WHERE user_id = ? AND bug_id = ?', + undef, $user->id, $self->id); + $bug_ignored_changed = 1; + } + delete $user->{bugs_ignored} if $bug_ignored_changed; + } + $dbh->bz_commit_transaction(); # The only problem with this here is that update() is often called @@ -1035,7 +1188,7 @@ sub update { # Also flush the visible_bugs cache for this bug as the user's # relationship with this bug may have changed. - delete Bugzilla->user->{_visible_bugs_cache}->{$self->id}; + delete $user->{_visible_bugs_cache}->{$self->id}; return $changes; } @@ -1214,32 +1367,38 @@ sub _send_bugmail { ##################################################################### sub _check_alias { - my ($invocant, $alias) = @_; - $alias = trim($alias); - return undef if (!$alias); - - # Make sure the alias isn't too long. - if (length($alias) > 20) { - ThrowUserError("alias_too_long"); - } - # Make sure the alias isn't just a number. - if ($alias =~ /^\d+$/) { - ThrowUserError("alias_is_numeric", { alias => $alias }); - } - # Make sure the alias has no commas or spaces. - if ($alias =~ /[, ]/) { - ThrowUserError("alias_has_comma_or_space", { alias => $alias }); - } - # Make sure the alias is unique, or that it's already our alias. - my $other_bug = new Bugzilla::Bug($alias); - if (!$other_bug->{error} - && (!ref $invocant || $other_bug->id != $invocant->id)) - { - ThrowUserError("alias_in_use", { alias => $alias, - bug_id => $other_bug->id }); + my ($invocant, $aliases) = @_; + $aliases = ref $aliases ? $aliases : [split(/[\s,]+/, $aliases)]; + + # Remove empty aliases + @$aliases = grep { $_ } @$aliases; + + foreach my $alias (@$aliases) { + $alias = trim($alias); + + # Make sure the alias isn't too long. + if (length($alias) > 40) { + ThrowUserError("alias_too_long"); + } + # Make sure the alias isn't just a number. + if ($alias =~ /^\d+$/) { + ThrowUserError("alias_is_numeric", { alias => $alias }); + } + # Make sure the alias has no commas or spaces. + if ($alias =~ /[, ]/) { + ThrowUserError("alias_has_comma_or_space", { alias => $alias }); + } + # Make sure the alias is unique, or that it's already our alias. + my $other_bug = new Bugzilla::Bug($alias); + if (!$other_bug->{error} + && (!ref $invocant || $other_bug->id != $invocant->id)) + { + ThrowUserError("alias_in_use", { alias => $alias, + bug_id => $other_bug->id }); + } } - return $alias; + return $aliases; } sub _check_assigned_to { @@ -1591,9 +1750,9 @@ sub _check_dup_id { } # Should we add the reporter to the CC list of the new bug? - # If he can see the bug... + # If they can see the bug... if ($self->reporter->can_see_bug($dupe_of)) { - # We only add him if he's not the reporter of the other bug. + # We only add them if they're not the reporter of the other bug. $self->{_add_dup_cc} = 1 if $dupe_of_bug->reporter->id != $self->reporter->id; } @@ -1608,11 +1767,11 @@ sub _check_dup_id { $self->{_add_dup_cc} = $add_confirmed; } else { - # Note that here we don't check if he user is already the reporter - # of the dupe_of bug, since we already checked if he can *see* + # Note that here we don't check if the user is already the reporter + # of the dupe_of bug, since we already checked if they can *see* # the bug, above. People might have reporter_accessible turned # off, but cclist_accessible turned on, so they might want to - # add the reporter even though he's already the reporter of the + # add the reporter even though they're already the reporter of the # dup_of bug. my $vars = {}; my $template = Bugzilla->template; @@ -1680,13 +1839,7 @@ sub _check_keywords { $keywords_in = trim($keywords_in); $keyword_array = [split(/[\s,]+/, $keywords_in)]; } - - # On creation, only editbugs users can set keywords. - if (!ref $invocant) { - my $product = $params->{product}; - return [] if !Bugzilla->user->in_group('editbugs', $product->id); - } - + my %keywords; foreach my $keyword (@$keyword_array) { next unless $keyword; @@ -1761,7 +1914,7 @@ sub _check_reporter { } else { # On bug creation, the reporter is the logged in user - # (meaning that he must be logged in first!). + # (meaning that they must be logged in first!). Bugzilla->login(LOGIN_REQUIRED); $reporter = Bugzilla->user->id; } @@ -1992,8 +2145,13 @@ sub _check_field_is_mandatory { } } +sub _check_date_field { + my ($invocant, $date) = @_; + return $invocant->_check_datetime_field($date, undef, {date_only => 1}); +} + sub _check_datetime_field { - my ($invocant, $date_time) = @_; + my ($invocant, $date_time, $field, $params) = @_; # Empty datetimes are empty strings or strings only containing # 0's, whitespace, and punctuation. @@ -2007,6 +2165,10 @@ sub _check_datetime_field { ThrowUserError('illegal_date', { date => $date, format => 'YYYY-MM-DD' }); } + if ($time && $params->{date_only}) { + ThrowUserError('illegal_date', { date => $date_time, + format => 'YYYY-MM-DD' }); + } if ($time && !validate_time($time)) { ThrowUserError('illegal_time', { 'time' => $time, format => 'HH:MM:SS' }); @@ -2082,6 +2244,27 @@ sub _check_textarea_field { return $text; } +sub _check_integer_field { + my ($invocant, $value, $field) = @_; + $value = defined($value) ? trim($value) : ''; + + if ($value eq '') { + return 0; + } + + my $orig_value = $value; + if (!detaint_signed($value)) { + ThrowUserError("number_not_integer", + {field => $field, num => $orig_value}); + } + elsif ($value > MAX_INT_32) { + ThrowUserError("number_too_large", + {field => $field, num => $orig_value, max_num => MAX_INT_32}); + } + + return $value; +} + sub _check_relationship_loop { # Generates a dependency tree for a given bug. Calls itself recursively # to generate sub-trees for the bug's dependencies. @@ -2161,8 +2344,8 @@ sub _set_global_validator { my $can = $self->check_can_change_field($field, $current, $value, \$privs); if (!$can) { if ($field eq 'assigned_to' || $field eq 'qa_contact') { - $value = user_id_to_login($value); - $current = user_id_to_login($current); + $value = Bugzilla::User->new($value)->login; + $current = Bugzilla::User->new($current)->login; } ThrowUserError('illegal_change', { field => $field, oldvalue => $current, @@ -2255,6 +2438,15 @@ sub set_all { work_time => $params->{'work_time'} }); } + if (exists $params->{alias} && $params->{alias}{set}) { + my ($removed_aliases, $added_aliases) = diff_arrays( + $self->alias, $params->{alias}{set}); + $params->{alias} = { + add => $added_aliases, + remove => $removed_aliases, + }; + } + my %normal_set_all; foreach my $name (keys %$params) { # These are handled separately below. @@ -2279,13 +2471,14 @@ sub set_all { } $self->_add_remove($params, 'cc'); + $self->_add_remove($params, 'alias'); # Theoretically you could move a product without ever specifying # a new assignee or qa_contact, or adding/removing any CCs. So, # we have to check that the current assignee, qa, and CCs are still # valid if we've switched products, under strict_isolation. We can only # do that here, because if they *did* change the assignee, qa, or CC, - # then we don't want to check the original ones, only the new ones. + # then we don't want to check the original ones, only the new ones. $self->_check_strict_isolation() if $product_changed; } @@ -2295,14 +2488,13 @@ sub _add_remove { my ($self, $params, $name) = @_; my @add = @{ $params->{$name}->{add} || [] }; my @remove = @{ $params->{$name}->{remove} || [] }; - $name =~ s/s$//; + $name =~ s/s$// if $name ne 'alias'; my $add_method = "add_$name"; my $remove_method = "remove_$name"; $self->$add_method($_) foreach @add; $self->$remove_method($_) foreach @remove; } -sub set_alias { $_[0]->set('alias', $_[1]); } sub set_assigned_to { my ($self, $value) = @_; $self->set('assigned_to', $value); @@ -2315,30 +2507,36 @@ sub reset_assigned_to { my $comp = $self->component_obj; $self->set_assigned_to($comp->default_assignee); } +sub set_bug_ignored { $_[0]->set('bug_ignored', $_[1]); } sub set_cclist_accessible { $_[0]->set('cclist_accessible', $_[1]); } + sub set_comment_is_private { - my ($self, $comment_id, $isprivate) = @_; + my ($self, $comments, $isprivate) = @_; + $self->{comment_isprivate} ||= []; + my $is_insider = Bugzilla->user->is_insider; + + $comments = { $comments => $isprivate } unless ref $comments; + + foreach my $comment (@{$self->comments}) { + # Skip unmodified comment privacy. + next unless exists $comments->{$comment->id}; - # We also allow people to pass in a hash of comment ids to update. - if (ref $comment_id) { - while (my ($id, $is) = each %$comment_id) { - $self->set_comment_is_private($id, $is); + my $isprivate = delete $comments->{$comment->id} ? 1 : 0; + if ($isprivate != $comment->is_private) { + ThrowUserError('user_not_insider') unless $is_insider; + $comment->set_is_private($isprivate); + push @{$self->{comment_isprivate}}, $comment; } - return; } - my ($comment) = grep($comment_id == $_->id, @{ $self->comments }); - ThrowUserError('comment_invalid_isprivate', { id => $comment_id }) - if !$comment; + # If there are still entries in $comments, then they are illegal. + ThrowUserError('comment_invalid_isprivate', { id => join(', ', keys %$comments) }) + if scalar keys %$comments; - $isprivate = $isprivate ? 1 : 0; - if ($isprivate != $comment->is_private) { - ThrowUserError('user_not_insider') if !Bugzilla->user->is_insider; - $self->{comment_isprivate} ||= []; - $comment->set_is_private($isprivate); - push @{$self->{comment_isprivate}}, $comment; - } + # If no comment privacy has been modified, remove this key. + delete $self->{comment_isprivate} unless scalar @{$self->{comment_isprivate}}; } + sub set_component { my ($self, $name) = @_; my $old_comp = $self->component_obj; @@ -2718,6 +2916,32 @@ sub remove_cc { @$cc_users = grep { $_->id != $user->id } @$cc_users; } +sub add_alias { + my ($self, $alias) = @_; + return if !$alias; + my $aliases = $self->_check_alias($alias); + $alias = $aliases->[0]; + my @new_aliases; + my $found = 0; + foreach my $old_alias (@{ $self->alias }) { + if (lc($old_alias) eq lc($alias)) { + push(@new_aliases, $alias); + $found = 1; + } + else { + push(@new_aliases, $old_alias); + } + } + push(@new_aliases, $alias) if !$found; + $self->{alias} = \@new_aliases; +} + +sub remove_alias { + my ($self, $alias) = @_; + my $bug_aliases = $self->alias; + @$bug_aliases = grep { $_ ne $alias } @$bug_aliases; +} + # $bug->add_comment("comment", {isprivate => 1, work_time => 10.5, # type => CMT_NORMAL, extra_data => $data}); sub add_comment { @@ -3045,7 +3269,6 @@ sub tags { # These are accessors that don't need to access the database. # Keep them in alphabetical order. -sub alias { return $_[0]->{alias} } sub bug_file_loc { return $_[0]->{bug_file_loc} } sub bug_id { return $_[0]->{bug_id} } sub bug_severity { return $_[0]->{bug_severity} } @@ -3128,7 +3351,7 @@ sub _resolve_ultimate_dup_id { # If $dupes{$this_dup} is already set to 1, then a loop # already exists which does not involve this bug. # As the user is not responsible for this loop, do not - # prevent him from marking this bug as a duplicate. + # prevent them from marking this bug as a duplicate. return $last_dup if exists $dupes{$this_dup}; $dupes{$this_dup} = 1; $last_dup = $this_dup; @@ -3155,6 +3378,19 @@ sub actual_time { return $self->{'actual_time'}; } +sub alias { + my ($self) = @_; + return $self->{'alias'} if exists $self->{'alias'}; + return [] if $self->{'error'}; + + my $dbh = Bugzilla->dbh; + $self->{'alias'} = $dbh->selectcol_arrayref( + q{SELECT alias FROM bugs_aliases WHERE bug_id = ? ORDER BY alias}, + undef, $self->bug_id); + + return $self->{'alias'}; +} + sub any_flags_requesteeble { my ($self) = @_; return $self->{'any_flags_requesteeble'} @@ -3178,6 +3414,7 @@ sub attachments { $self->{'attachments'} = Bugzilla::Attachment->get_attachments_by_bug($self, {preload => 1}); + $_->object_cache_set() foreach @{ $self->{'attachments'} }; return $self->{'attachments'}; } @@ -3185,7 +3422,7 @@ sub assigned_to { my ($self) = @_; return $self->{'assigned_to_obj'} if exists $self->{'assigned_to_obj'}; $self->{'assigned_to'} = 0 if $self->{'error'}; - $self->{'assigned_to_obj'} ||= new Bugzilla::User($self->{'assigned_to'}); + $self->{'assigned_to_obj'} ||= new Bugzilla::User({ id => $self->{'assigned_to'}, cache => 1 }); return $self->{'assigned_to_obj'}; } @@ -3248,11 +3485,8 @@ sub cc_users { sub component { my ($self) = @_; - return $self->{component} if exists $self->{component}; return '' if $self->{error}; - ($self->{component}) = Bugzilla->dbh->selectrow_array( - 'SELECT name FROM components WHERE id = ?', - undef, $self->{component_id}); + $self->{component} //= $self->component_obj->name; return $self->{component}; } @@ -3261,27 +3495,22 @@ sub component_obj { my ($self) = @_; return $self->{component_obj} if defined $self->{component_obj}; return {} if $self->{error}; - $self->{component_obj} = new Bugzilla::Component($self->{component_id}); + $self->{component_obj} = + new Bugzilla::Component({ id => $self->{component_id}, cache => 1 }); return $self->{component_obj}; } sub classification_id { my ($self) = @_; - return $self->{classification_id} if exists $self->{classification_id}; return 0 if $self->{error}; - ($self->{classification_id}) = Bugzilla->dbh->selectrow_array( - 'SELECT classification_id FROM products WHERE id = ?', - undef, $self->{product_id}); + $self->{classification_id} //= $self->product_obj->classification_id; return $self->{classification_id}; } sub classification { my ($self) = @_; - return $self->{classification} if exists $self->{classification}; return '' if $self->{error}; - ($self->{classification}) = Bugzilla->dbh->selectrow_array( - 'SELECT name FROM classifications WHERE id = ?', - undef, $self->classification_id); + $self->{classification} //= $self->product_obj->classification->name; return $self->{classification}; } @@ -3362,7 +3591,10 @@ sub flags { sub isopened { my $self = shift; - return is_open_state($self->{bug_status}) ? 1 : 0; + unless (exists $self->{isopened}) { + $self->{isopened} = is_open_state($self->{bug_status}) ? 1 : 0; + } + return $self->{isopened}; } sub keywords { @@ -3391,11 +3623,21 @@ sub comments { if (!defined $self->{'comments'}) { $self->{'comments'} = Bugzilla::Comment->match({ bug_id => $self->id }); my $count = 0; + state $is_mysql = Bugzilla->dbh->isa('Bugzilla::DB::Mysql') ? 1 : 0; foreach my $comment (@{ $self->{'comments'} }) { $comment->{count} = $count++; $comment->{bug} = $self; + # XXX - hack for MySQL. Convert [U+....] back into its Unicode + # equivalent for characters above U+FFFF as MySQL older than 5.5.3 + # cannot store them, see Bugzilla::Comment::_check_thetext(). + if ($is_mysql) { + # Perl 5.13.8 and older complain about non-characters. + no warnings 'utf8'; + $comment->{thetext} =~ s/\x{FDD0}\[U\+((?:[1-9A-F]|10)[0-9A-F]{4})\]\x{FDD1}/chr(hex $1)/eg + } } - Bugzilla::Comment->preload($self->{'comments'}); + # Some bugs may have no comments when upgrading old installations. + Bugzilla::Comment->preload($self->{'comments'}) if $count; } my @comments = @{ $self->{'comments'} }; @@ -3457,11 +3699,8 @@ sub percentage_complete { sub product { my ($self) = @_; - return $self->{product} if exists $self->{product}; return '' if $self->{error}; - ($self->{product}) = Bugzilla->dbh->selectrow_array( - 'SELECT name FROM products WHERE id = ?', - undef, $self->{product_id}); + $self->{product} //= $self->product_obj->name; return $self->{product}; } @@ -3469,7 +3708,8 @@ sub product { sub product_obj { my $self = shift; return {} if $self->{error}; - $self->{product_obj} ||= new Bugzilla::Product($self->{product_id}); + $self->{product_obj} ||= + new Bugzilla::Product({ id => $self->{product_id}, cache => 1 }); return $self->{product_obj}; } @@ -3479,7 +3719,7 @@ sub qa_contact { return undef if $self->{'error'}; if (Bugzilla->params->{'useqacontact'} && $self->{'qa_contact'}) { - $self->{'qa_contact_obj'} = new Bugzilla::User($self->{'qa_contact'}); + $self->{'qa_contact_obj'} = new Bugzilla::User({ id => $self->{'qa_contact'}, cache => 1 }); } else { $self->{'qa_contact_obj'} = undef; } @@ -3490,7 +3730,7 @@ sub reporter { my ($self) = @_; return $self->{'reporter'} if exists $self->{'reporter'}; $self->{'reporter_id'} = 0 if $self->{'error'}; - $self->{'reporter'} = new Bugzilla::User($self->{'reporter_id'}); + $self->{'reporter'} = new Bugzilla::User({ id => $self->{'reporter_id'}, cache => 1 }); return $self->{'reporter'}; } @@ -3732,6 +3972,11 @@ sub choices { my @resolutions = grep($_->name, @{ $resolution_field->legal_values }); $choices{'resolution'} = \@resolutions; + foreach my $key (keys %choices) { + my $value = $self->$key; + $choices{$key} = [grep { $_->is_active || $_->name eq $value } @{ $choices{$key} }]; + } + $self->{'choices'} = \%choices; return $self->{'choices'}; } @@ -3746,7 +3991,7 @@ sub bug_alias_to_id { my $dbh = Bugzilla->dbh; trick_taint($alias); return $dbh->selectrow_array( - "SELECT bug_id FROM bugs WHERE alias = ?", undef, $alias); + "SELECT bug_id FROM bugs_aliases WHERE alias = ?", undef, $alias); } ##################################################################### @@ -3770,9 +4015,7 @@ sub editable_bug_fields { # Ensure field exists before attempting to remove it. splice(@fields, $location, 1) if ($location > -1); } - # Sorted because the old @::log_columns variable, which this replaces, - # was sorted. - return sort(@fields); + return @fields; } # XXX - When Bug::update() will be implemented, we should make this routine @@ -3803,16 +4046,48 @@ sub EmitDependList { # Creates a lot of bug objects in the same order as the input array. sub _bugs_in_order { my ($self, $bug_ids) = @_; - my $bugs = $self->new_from_list($bug_ids); - my %bug_map = map { $_->id => $_ } @$bugs; - my @result = map { $bug_map{$_} } @$bug_ids; - return \@result; + return [] unless @$bug_ids; + + my %bug_map; + my $dbh = Bugzilla->dbh; + + # there's no need to load bugs from the database if they are already in the + # object-cache + my @missing_ids; + foreach my $bug_id (@$bug_ids) { + if (my $bug = Bugzilla::Bug->object_cache_get($bug_id)) { + $bug_map{$bug_id} = $bug; + } + else { + push @missing_ids, $bug_id; + } + } + if (@missing_ids) { + my $bugs = Bugzilla::Bug->new_from_list(\@missing_ids); + $bug_map{$_->id} = $_ foreach @$bugs; + } + + # Dependencies are often displayed using their aliases instead of their + # bug ID. Load them all at once. + my $rows = $dbh->selectall_arrayref( + 'SELECT bug_id, alias FROM bugs_aliases WHERE ' . + $dbh->sql_in('bug_id', $bug_ids) . ' ORDER BY alias'); + + foreach my $row (@$rows) { + my ($bug_id, $alias) = @$row; + $bug_map{$bug_id}->{alias} ||= []; + push @{ $bug_map{$bug_id}->{alias} }, $alias; + } + # Make sure all bugs have their alias attribute set. + $bug_map{$_}->{alias} ||= [] foreach @$bug_ids; + + return [ map { $bug_map{$_} } @$bug_ids ]; } # Get the activity of a bug, starting from $starttime (if given). # This routine assumes Bugzilla::Bug->check has been previously called. sub get_activity { - my ($self, $attach_id, $starttime) = @_; + my ($self, $attach_id, $starttime, $include_comment_tags) = @_; my $dbh = Bugzilla->dbh; my $user = Bugzilla->user; @@ -3824,7 +4099,7 @@ sub get_activity { if (defined $starttime) { trick_taint($starttime); push (@args, $starttime); - $datepart = "AND bugs_activity.bug_when > ?"; + $datepart = "AND bug_when > ?"; } my $attachpart = ""; @@ -3844,7 +4119,7 @@ sub get_activity { my $query = "SELECT fielddefs.name, bugs_activity.attach_id, " . $dbh->sql_date_format('bugs_activity.bug_when', '%Y.%m.%d %H:%i:%s') . - ", bugs_activity.removed, bugs_activity.added, profiles.login_name, + " AS bug_when, bugs_activity.removed, bugs_activity.added, profiles.login_name, bugs_activity.comment_id FROM bugs_activity $suppjoins @@ -3855,8 +4130,42 @@ sub get_activity { WHERE bugs_activity.bug_id = ? $datepart $attachpart - $suppwhere - ORDER BY bugs_activity.bug_when, bugs_activity.id"; + $suppwhere "; + + if (Bugzilla->params->{'comment_taggers_group'} + && $include_comment_tags + && !$attach_id) + { + # Only includes comment tag activity for comments the user is allowed to see. + $suppjoins = ""; + $suppwhere = ""; + if (!Bugzilla->user->is_insider) { + $suppjoins = "INNER JOIN longdescs + ON longdescs.comment_id = longdescs_tags_activity.comment_id"; + $suppwhere = "AND longdescs.isprivate = 0"; + } + + $query .= " + UNION ALL + SELECT 'comment_tag' AS name, + NULL AS attach_id," . + $dbh->sql_date_format('longdescs_tags_activity.bug_when', '%Y.%m.%d %H:%i:%s') . " AS bug_when, + longdescs_tags_activity.removed, + longdescs_tags_activity.added, + profiles.login_name, + longdescs_tags_activity.comment_id as comment_id + FROM longdescs_tags_activity + INNER JOIN profiles ON profiles.userid = longdescs_tags_activity.who + $suppjoins + WHERE longdescs_tags_activity.bug_id = ? + $datepart + $suppwhere + "; + push @args, $self->id; + push @args, $starttime if defined $starttime; + } + + $query .= "ORDER BY bug_when, comment_id"; my $list = $dbh->selectall_arrayref($query, undef, @args); @@ -3943,9 +4252,13 @@ sub get_activity { # Update the bugs_activity table to reflect changes made in bugs. sub LogActivityEntry { - my ($i, $col, $removed, $added, $whoid, $timestamp, $comment_id, + my ($bug_id, $field, $removed, $added, $user_id, $timestamp, $comment_id, $attach_id) = @_; - my $dbh = Bugzilla->dbh; + my $sth = Bugzilla->dbh->prepare_cached( + 'INSERT INTO bugs_activity + (bug_id, who, bug_when, fieldid, removed, added, comment_id, attach_id) + VALUES (?, ?, ?, ?, ?, ?, ?, ?)'); + # in the case of CCs, deps, and keywords, there's a possibility that someone # might try to add or remove a lot of them at once, which might take more # space than the activity table allows. We'll solve this by splitting it @@ -3968,14 +4281,26 @@ sub LogActivityEntry { } trick_taint($addstr); trick_taint($removestr); - my $fieldid = get_field_id($col); - $dbh->do( - "INSERT INTO bugs_activity - (bug_id, who, bug_when, fieldid, removed, added, comment_id, attach_id) - VALUES (?, ?, ?, ?, ?, ?, ?, ?)", - undef, - ($i, $whoid, $timestamp, $fieldid, $removestr, $addstr, $comment_id, - $attach_id)); + my $fieldid = get_field_id($field); + $sth->execute($bug_id, $user_id, $timestamp, $fieldid, $removestr, + $addstr, $comment_id, $attach_id); + } +} + +# Update bug_user_last_visit table +sub update_user_last_visit { + my ($self, $user, $last_visit_ts) = @_; + my $lv = Bugzilla::BugUserLastVisit->match({ bug_id => $self->id, + user_id => $user->id })->[0]; + + if ($lv) { + $lv->set(last_visit_ts => $last_visit_ts); + $lv->update; + } + else { + Bugzilla::BugUserLastVisit->create({ bug_id => $self->id, + user_id => $user->id, + last_visit_ts => $last_visit_ts }); } } @@ -4059,7 +4384,7 @@ sub check_can_change_field { return 1; } - # If the user isn't allowed to change a field, we must tell him who can. + # If the user isn't allowed to change a field, we must tell them who can. # We store the required permission set into the $PrivilegesRequired # variable which gets passed to the error template. # @@ -4067,9 +4392,10 @@ sub check_can_change_field { # $PrivilegesRequired = PRIVILEGES_REQUIRED_REPORTER : the reporter, assignee or an empowered user; # $PrivilegesRequired = PRIVILEGES_REQUIRED_ASSIGNEE : the assignee or an empowered user; # $PrivilegesRequired = PRIVILEGES_REQUIRED_EMPOWERED : an empowered user. - - # Only users in the time-tracking group can change time-tracking fields. - if ( grep($_ eq $field, TIMETRACKING_FIELDS) ) { + + # Only users in the time-tracking group can change time-tracking fields, + # including the deadline. + if (grep { $_ eq $field } (TIMETRACKING_FIELDS, 'deadline')) { if (!$user->is_timetracker) { $$PrivilegesRequired = PRIVILEGES_REQUIRED_EMPOWERED; return 0; @@ -4110,7 +4436,7 @@ sub check_can_change_field { # is not allowed to change. # The reporter may not: - # - reassign bugs, unless the bugs are assigned to him; + # - reassign bugs, unless the bugs are assigned to them; # in that case we will have already returned 1 above # when checking for the assignee of the bug. if ($field eq 'assigned_to') { @@ -4127,7 +4453,7 @@ sub check_can_change_field { $$PrivilegesRequired = PRIVILEGES_REQUIRED_ASSIGNEE; return 0; } - # - change the priority (unless he could have set it originally) + # - change the priority (unless they could have set it originally) if ($field eq 'priority' && !Bugzilla->params->{'letsubmitterchoosepriority'}) { @@ -4197,6 +4523,10 @@ sub ValidateDependencies { my $dbh = Bugzilla->dbh; my %deps; my %deptree; + my %sth; + $sth{dependson} = $dbh->prepare('SELECT dependson FROM dependencies WHERE blocked = ?'); + $sth{blocked} = $dbh->prepare('SELECT blocked FROM dependencies WHERE dependson = ?'); + foreach my $pair (["blocked", "dependson"], ["dependson", "blocked"]) { my ($me, $target) = @{$pair}; $deptree{$target} = []; @@ -4221,10 +4551,7 @@ sub ValidateDependencies { my @stack = @{$deps{$target}}; while (@stack) { my $i = shift @stack; - my $dep_list = - $dbh->selectcol_arrayref("SELECT $target - FROM dependencies - WHERE $me = ?", undef, $i); + my $dep_list = $dbh->selectcol_arrayref($sth{$target}, undef, $i); foreach my $t (@$dep_list) { # ignore any _current_ dependencies involving this bug, # as they will be overwritten with data from the form. @@ -4303,3 +4630,295 @@ sub _multi_select_accessor { } 1; + +__END__ +=head1 B<Methods> + +=over + +=item C<initialize> + +Ensures the accessors for custom fields are always created. + +=item C<add_alias($alias)> + +Adds an alias to the internal respresentation of the bug. You will need to +call L<update> to make the changes permanent. + +=item C<remove_alias($alias)> + +Removes an alias from the internal respresentation of the bug. You will need to +call L<update> to make the changes permanent. + +=item C<update_user_last_visit($user, $last_visit)> + +Creates or updates a L<Bugzilla::BugUserLastVisit> for this bug and the supplied +$user, the timestamp given as $last_visit. + +=back + +=head1 B<Methods in need of POD> + +=over + +=item remove_cc + +=item add_see_also + +=item choices + +=item keywords + +=item blocked + +=item qa_contact + +=item add_comment + +=item bug_severity + +=item dup_id + +=item set_priority + +=item any_flags_requesteeble + +=item set_bug_status + +=item estimated_time + +=item set_platform + +=item statuses_available + +=item set_custom_field + +=item remove_see_also + +=item remove_from_db + +=item product_obj + +=item reporter_accessible + +=item set_summary + +=item LogActivityEntry + +=item set_assigned_to + +=item add_group + +=item bug_file_loc + +=item DATE_COLUMNS + +=item set_component + +=item delta_ts + +=item set_resolution + +=item version + +=item deadline + +=item fields + +=item dependson + +=item check_can_change_field + +=item update + +=item set_op_sys + +=item object_cache_key + +=item bug_group + +=item comments + +=item map_fields + +=item assigned_to + +=item user + +=item ValidateDependencies + +=item short_desc + +=item duplicate_ids + +=item isopened + +=item remaining_time + +=item set_deadline + +=item preload + +=item groups_in + +=item clear_resolution + +=item set_estimated_time + +=item in_group + +=item status + +=item get_activity + +=item reporter + +=item rep_platform + +=item DB_COLUMNS + +=item flag_types + +=item bug_status + +=item attachments + +=item flags + +=item set_flags + +=item actual_time + +=item component + +=item UPDATE_COLUMNS + +=item set_cclist_accessible + +=item set_bug_ignored + +=item product + +=item VALIDATORS + +=item show_attachment_flags + +=item set_comment_is_private + +=item set_severity + +=item send_changes + +=item add_tag + +=item bug_id + +=item reset_qa_contact + +=item remove_group + +=item set_dup_id + +=item set_target_milestone + +=item cc_users + +=item everconfirmed + +=item check_is_visible + +=item check_for_edit + +=item match + +=item VALIDATOR_DEPENDENCIES + +=item possible_duplicates + +=item set_url + +=item add_cc + +=item blocks_obj + +=item set_status_whiteboard + +=item product_id + +=item error + +=item reset_assigned_to + +=item status_whiteboard + +=item create + +=item set_all + +=item set_reporter_accessible + +=item classification_id + +=item tags + +=item modify_keywords + +=item priority + +=item keyword_objects + +=item set_dependencies + +=item depends_on_obj + +=item cclist_accessible + +=item cc + +=item duplicates + +=item component_obj + +=item see_also + +=item groups + +=item default_bug_status + +=item related_bugs + +=item editable_bug_fields + +=item resolution + +=item lastdiffed + +=item classification + +=item alias + +=item op_sys + +=item remove_tag + +=item percentage_complete + +=item EmitDependList + +=item bug_alias_to_id + +=item set_qa_contact + +=item creation_ts + +=item set_version + +=item component_id + +=item new_bug_statuses + +=item set_remaining_time + +=item target_milestone + +=back diff --git a/Bugzilla/BugMail.pm b/Bugzilla/BugMail.pm index 5a2c9b788..9ebf3ea7d 100644 --- a/Bugzilla/BugMail.pm +++ b/Bugzilla/BugMail.pm @@ -5,10 +5,12 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -use strict; - package Bugzilla::BugMail; +use 5.10.1; +use strict; +use warnings; + use Bugzilla::Error; use Bugzilla::User; use Bugzilla::Constants; @@ -22,6 +24,7 @@ use Date::Parse; use Date::Format; use Scalar::Util qw(blessed); use List::MoreUtils qw(uniq); +use Storable qw(dclone); use constant BIT_DIRECT => 1; use constant BIT_WATCHING => 2; @@ -35,9 +38,6 @@ sub relationships { return %relationships; } -# This is a bit of a hack, basically keeping the old system() -# cmd line interface. Should clean this up at some point. -# # args: bug_id, and an optional hash ref which may have keys for: # changer, owner, qa, reporter, cc # Optional hash contains values of people which will be forced to those @@ -85,6 +85,8 @@ sub Send { @diffs = _get_new_bugmail_fields($bug); } + my $comments = []; + if ($params->{dep_only}) { push(@diffs, { field_name => 'bug_status', old => $params->{changes}->{bug_status}->[0], @@ -101,11 +103,14 @@ sub Send { } else { push(@diffs, _get_diffs($bug, $end, \%user_cache)); - } - my $comments = $bug->comments({ after => $start, to => $end }); - # Skip empty comments. - @$comments = grep { $_->type || $_->body =~ /\S/ } @$comments; + $comments = $bug->comments({ after => $start, to => $end }); + # Skip empty comments. + @$comments = grep { $_->type || $_->body =~ /\S/ } @$comments; + + # If no changes have been made, there is no need to process further. + return {'sent' => []} unless scalar(@diffs) || scalar(@$comments); + } ########################################################################### # Start of email filtering code @@ -114,7 +119,10 @@ sub Send { # A user_id => roles hash to keep track of people. my %recipients; my %watching; - + + # We also record bugs that are referenced + my @referenced_bug_ids = (); + # Now we work out all the people involved with this bug, and note all of # the relationships in a hash. The keys are userids, the values are an # array of role constants. @@ -158,8 +166,17 @@ sub Send { $recipients{$uid}->{+REL_ASSIGNEE} = BIT_DIRECT if $uid; } } + + if ($change->{field_name} eq 'dependson' || $change->{field_name} eq 'blocked') { + push @referenced_bug_ids, split(/[\s,]+/, $change->{old}); + push @referenced_bug_ids, split(/[\s,]+/, $change->{new}); + } } + my $referenced_bugs = scalar(@referenced_bug_ids) + ? Bugzilla::Bug->new_from_list([uniq @referenced_bug_ids]) + : []; + # Make sure %user_cache has every user in it so far referenced foreach my $user_id (keys %recipients) { $user_cache{$user_id} ||= new Bugzilla::User($user_id); @@ -169,21 +186,24 @@ sub Send { { bug => $bug, recipients => \%recipients, users => \%user_cache, diffs => \@diffs }); - # Find all those user-watching anyone on the current list, who is not - # on it already themselves. - my $involved = join(",", keys %recipients); - - my $userwatchers = - $dbh->selectall_arrayref("SELECT watcher, watched FROM watch - WHERE watched IN ($involved)"); - - # Mark these people as having the role of the person they are watching - foreach my $watch (@$userwatchers) { - while (my ($role, $bits) = each %{$recipients{$watch->[1]}}) { - $recipients{$watch->[0]}->{$role} |= BIT_WATCHING - if $bits & BIT_DIRECT; + # We should not assume %recipients to have any entries. + if (scalar keys %recipients) { + # Find all those user-watching anyone on the current list, who is not + # on it already themselves. + my $involved = join(",", keys %recipients); + + my $userwatchers = + $dbh->selectall_arrayref("SELECT watcher, watched FROM watch + WHERE watched IN ($involved)"); + + # Mark these people as having the role of the person they are watching + foreach my $watch (@$userwatchers) { + while (my ($role, $bits) = each %{$recipients{$watch->[1]}}) { + $recipients{$watch->[0]}->{$role} |= BIT_WATCHING + if $bits & BIT_DIRECT; + } + push(@{$watching{$watch->[0]}}, $watch->[1]); } - push(@{$watching{$watch->[0]}}, $watch->[1]); } # Global watcher @@ -198,7 +218,6 @@ sub Send { # the bug in question. However, we are not necessarily going to mail them # all - there are preferences, permissions checks and all sorts to do yet. my @sent; - my @excluded; # The email client will display the Date: header in the desired timezone, # so we can always use UTC here. @@ -207,12 +226,14 @@ sub Send { foreach my $user_id (keys %recipients) { my %rels_which_want; - my $sent_mail = 0; - $user_cache{$user_id} ||= new Bugzilla::User($user_id); - my $user = $user_cache{$user_id}; + my $user = $user_cache{$user_id} ||= new Bugzilla::User($user_id); # Deleted users must be excluded. next unless $user; + # If email notifications are disabled for this account, or the bug + # is ignored, there is no need to do additional checks. + next if ($user->email_disabled || $user->is_bug_ignored($id)); + if ($user->can_see_bug($id)) { # Go through each role the user has and see if they want mail in # that role. @@ -229,7 +250,7 @@ sub Send { } } } - + if (scalar(%rels_which_want)) { # So the user exists, can see the bug, and wants mail in at least # one role. But do we want to send it to them? @@ -242,29 +263,24 @@ sub Send { $dep_ok = $user->can_see_bug($params->{blocker}->id) ? 1 : 0; } - # Make sure the user isn't in the nomail list, and the dep check passed. - if ($user->email_enabled && $dep_ok) { - # OK, OK, if we must. Email the user. - $sent_mail = sendMail( - { to => $user, - bug => $bug, - comments => $comments, - date => $date, - changer => $changer, - watchers => exists $watching{$user_id} ? - $watching{$user_id} : undef, - diffs => \@diffs, + # Email the user if the dep check passed. + if ($dep_ok) { + my $sent_mail = sendMail( + { to => $user, + bug => $bug, + comments => $comments, + date => $date, + changer => $changer, + watchers => exists $watching{$user_id} ? + $watching{$user_id} : undef, + diffs => \@diffs, rels_which_want => \%rels_which_want, + dep_only => $params->{dep_only}, + referenced_bugs => $referenced_bugs, }); + push(@sent, $user->login) if $sent_mail; } } - - if ($sent_mail) { - push(@sent, $user->login); - } - else { - push(@excluded, $user->login); - } } # When sending bugmail about a blocker being reopened or resolved, @@ -276,27 +292,29 @@ sub Send { $bug->{lastdiffed} = $end; } - return {'sent' => \@sent, 'excluded' => \@excluded}; + return {'sent' => \@sent}; } sub sendMail { my $params = shift; - - my $user = $params->{to}; - my $bug = $params->{bug}; - my @send_comments = @{ $params->{comments} }; - my $date = $params->{date}; - my $changer = $params->{changer}; - my $watchingRef = $params->{watchers}; - my @diffs = @{ $params->{diffs} }; - my $relRef = $params->{rels_which_want}; + + my $user = $params->{to}; + my $bug = $params->{bug}; + my @send_comments = @{ $params->{comments} }; + my $date = $params->{date}; + my $changer = $params->{changer}; + my $watchingRef = $params->{watchers}; + my @diffs = @{ $params->{diffs} }; + my $relRef = $params->{rels_which_want}; + my $dep_only = $params->{dep_only}; + my $referenced_bugs = $params->{referenced_bugs}; # Only display changes the user is allowed see. my @display_diffs; foreach my $diff (@diffs) { my $add_diff = 0; - + if (grep { $_ eq $diff->{field_name} } TIMETRACKING_FIELDS) { $add_diff = 1 if $user->is_timetracker; } @@ -326,41 +344,98 @@ sub sendMail { my @watchingrel = map { $relationships{$_} } @reasons_watch; push(@headerrel, 'None') unless @headerrel; push(@watchingrel, 'None') unless @watchingrel; - push @watchingrel, map { user_id_to_login($_) } @$watchingRef; + push @watchingrel, map { Bugzilla::User->new($_)->login } @$watchingRef; my @changedfields = uniq map { $_->{field_name} } @display_diffs; - + # Add attachments.created to changedfields if one or more # comments contain information about a new attachment if (grep($_->type == CMT_ATTACHMENT_CREATED, @send_comments)) { push(@changedfields, 'attachments.created'); } + my $bugmailtype = "changed"; + $bugmailtype = "new" if !$bug->lastdiffed; + $bugmailtype = "dep_changed" if $dep_only; + my $vars = { - date => $date, - to_user => $user, - bug => $bug, - reasons => \@reasons, - reasons_watch => \@reasons_watch, - reasonsheader => join(" ", @headerrel), + date => $date, + to_user => $user, + bug => $bug, + reasons => \@reasons, + reasons_watch => \@reasons_watch, + reasonsheader => join(" ", @headerrel), reasonswatchheader => join(" ", @watchingrel), - changer => $changer, - diffs => \@display_diffs, - changedfields => \@changedfields, - new_comments => \@send_comments, - threadingmarker => build_thread_marker($bug->id, $user->id, !$bug->lastdiffed), + changer => $changer, + diffs => \@display_diffs, + changedfields => \@changedfields, + referenced_bugs => $user->visible_bugs($referenced_bugs), + new_comments => \@send_comments, + threadingmarker => build_thread_marker($bug->id, $user->id, !$bug->lastdiffed), + bugmailtype => $bugmailtype, }; - my $msg = _generate_bugmail($user, $vars); - MessageToMTA($msg); + if (Bugzilla->params->{'use_mailer_queue'}) { + enqueue($vars); + } else { + MessageToMTA(_generate_bugmail($vars)); + } return 1; } +sub enqueue { + my ($vars) = @_; + # we need to flatten all objects to a hash before pushing to the job queue. + # the hashes need to be inflated in the dequeue method. + $vars->{bug} = _flatten_object($vars->{bug}); + $vars->{to_user} = _flatten_object($vars->{to_user}); + $vars->{changer} = _flatten_object($vars->{changer}); + $vars->{new_comments} = [ map { _flatten_object($_) } @{ $vars->{new_comments} } ]; + foreach my $diff (@{ $vars->{diffs} }) { + $diff->{who} = _flatten_object($diff->{who}); + if (exists $diff->{blocker}) { + $diff->{blocker} = _flatten_object($diff->{blocker}); + } + } + Bugzilla->job_queue->insert('bug_mail', { vars => $vars }); +} + +sub dequeue { + my ($payload) = @_; + # clone the payload so we can modify it without impacting TheSchwartz's + # ability to process the job when we've finished + my $vars = dclone($payload); + # inflate objects + $vars->{bug} = Bugzilla::Bug->new_from_hash($vars->{bug}); + $vars->{to_user} = Bugzilla::User->new_from_hash($vars->{to_user}); + $vars->{changer} = Bugzilla::User->new_from_hash($vars->{changer}); + $vars->{new_comments} = [ map { Bugzilla::Comment->new_from_hash($_) } @{ $vars->{new_comments} } ]; + foreach my $diff (@{ $vars->{diffs} }) { + $diff->{who} = Bugzilla::User->new_from_hash($diff->{who}); + if (exists $diff->{blocker}) { + $diff->{blocker} = Bugzilla::Bug->new_from_hash($diff->{blocker}); + } + } + # generate bugmail and send + MessageToMTA(_generate_bugmail($vars), 1); +} + +sub _flatten_object { + my ($object) = @_; + # nothing to do if it's already flattened + return $object unless blessed($object); + # the same objects are used for each recipient, so cache the flattened hash + my $cache = Bugzilla->request_cache->{bugmail_flat_objects} ||= {}; + my $key = blessed($object) . '-' . $object->id; + return $cache->{$key} ||= $object->flatten_to_hash; +} + sub _generate_bugmail { - my ($user, $vars) = @_; + my ($vars) = @_; + my $user = $vars->{to_user}; my $template = Bugzilla->template_inner($user->setting('lang')); my ($msg_text, $msg_html, $msg_header); - + $template->process("email/bugmail-header.txt.tmpl", $vars, \$msg_header) || ThrowTemplateError($template->error()); $template->process("email/bugmail.txt.tmpl", $vars, \$msg_text) @@ -446,8 +521,8 @@ sub _get_diffs { && $diff->{field_name} eq $changes[-1]->{field_name} && $diff->{bug_when} eq $changes[-1]->{bug_when} && $diff->{who} eq $changes[-1]->{who} - && ($diff->{attach_id} || 0) == ($changes[-1]->{attach_id} || 0) - && ($diff->{comment_id} || 0) == ($changes[-1]->{comment_id} || 0) + && ($diff->{attach_id} // 0) == ($changes[-1]->{attach_id} // 0) + && ($diff->{comment_id} // 0) == ($changes[-1]->{comment_id} // 0) ) { my $old_change = pop @changes; $diff->{old} = join_activity_entries($diff->{field_name}, $old_change->{old}, $diff->{old}); @@ -506,3 +581,36 @@ sub _get_new_bugmail_fields { } 1; + +=head1 NAME + +BugMail - Routines to generate email notifications when a bug is created or +modified. + +=head1 METHODS + +=over 4 + +=item C<enqueue> + +Serialises the variables required to generate bugmail and pushes the result to +the job-queue for processing by TheSchwartz. + +=item C<dequeue> + +When given serialised variables from the job-queue, recreates the objects from +the flattened hashes, generates the bugmail, and sends it. + +=back + +=head1 B<Methods in need of POD> + +=over + +=item relationships + +=item sendMail + +=item Send + +=back diff --git a/Bugzilla/BugUrl.pm b/Bugzilla/BugUrl.pm index 8689e8a35..1e836ca1e 100644 --- a/Bugzilla/BugUrl.pm +++ b/Bugzilla/BugUrl.pm @@ -6,14 +6,19 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::BugUrl; + +use 5.10.1; use strict; -use base qw(Bugzilla::Object); +use warnings; + +use parent qw(Bugzilla::Object); use Bugzilla::Util; use Bugzilla::Error; use Bugzilla::Constants; use Bugzilla::Hook; +use URI; use URI::QueryParam; ############################### @@ -198,3 +203,17 @@ sub _check_value { } 1; + +=head1 B<Methods in need of POD> + +=over + +=item should_handle + +=item class_for + +=item class + +=item bug_id + +=back diff --git a/Bugzilla/BugUrl/Bugzilla.pm b/Bugzilla/BugUrl/Bugzilla.pm index 4db37eb7f..402ff1509 100644 --- a/Bugzilla/BugUrl/Bugzilla.pm +++ b/Bugzilla/BugUrl/Bugzilla.pm @@ -6,8 +6,12 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::BugUrl::Bugzilla; + +use 5.10.1; use strict; -use base qw(Bugzilla::BugUrl); +use warnings; + +use parent qw(Bugzilla::BugUrl); use Bugzilla::Error; use Bugzilla::Util; diff --git a/Bugzilla/BugUrl/Bugzilla/Local.pm b/Bugzilla/BugUrl/Bugzilla/Local.pm index 9631716ae..7b9cb6a4f 100644 --- a/Bugzilla/BugUrl/Bugzilla/Local.pm +++ b/Bugzilla/BugUrl/Bugzilla/Local.pm @@ -6,8 +6,12 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::BugUrl::Bugzilla::Local; + +use 5.10.1; use strict; -use base qw(Bugzilla::BugUrl::Bugzilla); +use warnings; + +use parent qw(Bugzilla::BugUrl::Bugzilla); use Bugzilla::Error; use Bugzilla::Util; diff --git a/Bugzilla/BugUrl/Debian.pm b/Bugzilla/BugUrl/Debian.pm index cce4c25fd..2b611aa57 100644 --- a/Bugzilla/BugUrl/Debian.pm +++ b/Bugzilla/BugUrl/Debian.pm @@ -6,8 +6,12 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::BugUrl::Debian; + +use 5.10.1; use strict; -use base qw(Bugzilla::BugUrl); +use warnings; + +use parent qw(Bugzilla::BugUrl); ############################### #### Methods #### diff --git a/Bugzilla/BugUrl/GitHub.pm b/Bugzilla/BugUrl/GitHub.pm index eeffa2ed6..f14f1d6b0 100644 --- a/Bugzilla/BugUrl/GitHub.pm +++ b/Bugzilla/BugUrl/GitHub.pm @@ -6,8 +6,12 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::BugUrl::GitHub; + +use 5.10.1; use strict; -use base qw(Bugzilla::BugUrl); +use warnings; + +use parent qw(Bugzilla::BugUrl); ############################### #### Methods #### @@ -18,8 +22,10 @@ sub should_handle { # GitHub issue URLs have only one form: # https://github.com/USER_OR_TEAM_OR_ORGANIZATION_NAME/REPOSITORY_NAME/issues/111 + # GitHub pull request URLs have only one form: + # https://github.com/USER_OR_TEAM_OR_ORGANIZATION_NAME/REPOSITORY_NAME/pull/111 return (lc($uri->authority) eq 'github.com' - and $uri->path =~ m|^/[^/]+/[^/]+/issues/\d+$|) ? 1 : 0; + and $uri->path =~ m!^/[^/]+/[^/]+/(?:issues|pull)/\d+$!) ? 1 : 0; } sub _check_value { diff --git a/Bugzilla/BugUrl/Google.pm b/Bugzilla/BugUrl/Google.pm index 9c49f0dcc..71a9c46fb 100644 --- a/Bugzilla/BugUrl/Google.pm +++ b/Bugzilla/BugUrl/Google.pm @@ -6,8 +6,12 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::BugUrl::Google; + +use 5.10.1; use strict; -use base qw(Bugzilla::BugUrl); +use warnings; + +use parent qw(Bugzilla::BugUrl); ############################### #### Methods #### diff --git a/Bugzilla/BugUrl/JIRA.pm b/Bugzilla/BugUrl/JIRA.pm index f5f7ee5fa..e9d2a2d2a 100644 --- a/Bugzilla/BugUrl/JIRA.pm +++ b/Bugzilla/BugUrl/JIRA.pm @@ -6,8 +6,12 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::BugUrl::JIRA; + +use 5.10.1; use strict; -use base qw(Bugzilla::BugUrl); +use warnings; + +use parent qw(Bugzilla::BugUrl); ############################### #### Methods #### diff --git a/Bugzilla/BugUrl/Launchpad.pm b/Bugzilla/BugUrl/Launchpad.pm index 2ae2c383d..0362747a2 100644 --- a/Bugzilla/BugUrl/Launchpad.pm +++ b/Bugzilla/BugUrl/Launchpad.pm @@ -6,8 +6,12 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::BugUrl::Launchpad; + +use 5.10.1; use strict; -use base qw(Bugzilla::BugUrl); +use warnings; + +use parent qw(Bugzilla::BugUrl); ############################### #### Methods #### diff --git a/Bugzilla/BugUrl/MantisBT.pm b/Bugzilla/BugUrl/MantisBT.pm index 3d49ede69..60d3b578e 100644 --- a/Bugzilla/BugUrl/MantisBT.pm +++ b/Bugzilla/BugUrl/MantisBT.pm @@ -6,8 +6,12 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::BugUrl::MantisBT; + +use 5.10.1; use strict; -use base qw(Bugzilla::BugUrl); +use warnings; + +use parent qw(Bugzilla::BugUrl); ############################### #### Methods #### diff --git a/Bugzilla/BugUrl/SourceForge.pm b/Bugzilla/BugUrl/SourceForge.pm index fcc720049..acba0df28 100644 --- a/Bugzilla/BugUrl/SourceForge.pm +++ b/Bugzilla/BugUrl/SourceForge.pm @@ -6,8 +6,12 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::BugUrl::SourceForge; + +use 5.10.1; use strict; -use base qw(Bugzilla::BugUrl); +use warnings; + +use parent qw(Bugzilla::BugUrl); ############################### #### Methods #### diff --git a/Bugzilla/BugUrl/Trac.pm b/Bugzilla/BugUrl/Trac.pm index 8f6e9cd0e..fe74abf33 100644 --- a/Bugzilla/BugUrl/Trac.pm +++ b/Bugzilla/BugUrl/Trac.pm @@ -6,8 +6,12 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::BugUrl::Trac; + +use 5.10.1; use strict; -use base qw(Bugzilla::BugUrl); +use warnings; + +use parent qw(Bugzilla::BugUrl); ############################### #### Methods #### diff --git a/Bugzilla/BugUserLastVisit.pm b/Bugzilla/BugUserLastVisit.pm new file mode 100644 index 000000000..d043b121a --- /dev/null +++ b/Bugzilla/BugUserLastVisit.pm @@ -0,0 +1,93 @@ +# 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::BugUserLastVisit; + +use 5.10.1; +use strict; +use warnings; + +use parent qw(Bugzilla::Object); + +##################################################################### +# Overriden Constants that are used as methods +##################################################################### + +use constant DB_TABLE => 'bug_user_last_visit'; +use constant DB_COLUMNS => qw( id user_id bug_id last_visit_ts ); +use constant UPDATE_COLUMNS => qw( last_visit_ts ); +use constant VALIDATORS => {}; +use constant LIST_ORDER => 'id'; +use constant NAME_FIELD => 'id'; + +# turn off auditing and exclude these objects from memcached +use constant { AUDIT_CREATES => 0, + AUDIT_UPDATES => 0, + AUDIT_REMOVES => 0, + USE_MEMCACHED => 0 }; + +##################################################################### +# Provide accessors for our columns +##################################################################### + +sub id { return $_[0]->{id} } +sub bug_id { return $_[0]->{bug_id} } +sub user_id { return $_[0]->{user_id} } +sub last_visit_ts { return $_[0]->{last_visit_ts} } + +sub user { + my $self = shift; + + $self->{user} //= Bugzilla::User->new({ id => $self->user_id, cache => 1 }); + return $self->{user}; +} + +1; +__END__ + +=head1 NAME + +Bugzilla::BugUserLastVisit - Model for BugUserLastVisit bug search data + +=head1 SYNOPSIS + + use Bugzilla::BugUserLastVisit; + + my $lv = Bugzilla::BugUserLastVisit->new($id); + + # Class Functions + $user = Bugzilla::BugUserLastVisit->create({ + bug_id => $bug_id, + user_id => $user_id, + last_visit_ts => $last_visit_ts + }); + +=head1 DESCRIPTION + +This package handles Bugzilla BugUserLastVisit. + +C<Bugzilla::BugUserLastVisit> is an implementation of L<Bugzilla::Object>, and +thus provides all the methods of L<Bugzilla::Object> in addition to the methods +listed below. + +=head1 METHODS + +=head2 Accessor Methods + +=over + +=item C<id> + +=item C<bug_id> + +=item C<user_id> + +=item C<last_visit_ts> + +=item C<user> + +=back diff --git a/Bugzilla/CGI.pm b/Bugzilla/CGI.pm index 7df916b0c..0b8a48697 100644 --- a/Bugzilla/CGI.pm +++ b/Bugzilla/CGI.pm @@ -6,12 +6,17 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::CGI; + +use 5.10.1; use strict; -use base qw(CGI); +use warnings; + +use parent qw(CGI); use Bugzilla::Constants; use Bugzilla::Error; use Bugzilla::Util; +use Bugzilla::Hook; use Bugzilla::Search::Recent; use File::Basename; @@ -53,7 +58,7 @@ sub new { # the rendering of pages. my $script = basename($0); if (my $path_info = $self->path_info) { - my @whitelist; + my @whitelist = ("rest.cgi"); Bugzilla::Hook::process('path_info_whitelist', { whitelist => \@whitelist }); if (!grep($_ eq $script, @whitelist)) { # IIS includes the full path to the script in PATH_INFO, @@ -120,7 +125,8 @@ sub canonicalise_query { my $esc_key = url_quote($key); foreach my $value ($self->param($key)) { - if (defined($value)) { + # Omit params with an empty value + if (defined($value) && $value ne '') { my $esc_value = url_quote($value); push(@parameters, "$esc_key=$esc_value"); @@ -233,11 +239,11 @@ sub check_etag { $possible_etag =~ s/^\"//g; $possible_etag =~ s/\"$//g; if ($possible_etag eq $valid_etag or $possible_etag eq '*') { - print $self->header(-ETag => $possible_etag, - -status => '304 Not Modified'); - exit; + return 1; } } + + return 0; } # Have to add the cookies in. @@ -270,28 +276,35 @@ sub multipart_start { } sub close_standby_message { - my ($self, $contenttype, $disposition) = @_; + my ($self, $contenttype, $disp, $disp_prefix, $extension) = @_; + $self->set_dated_content_disp($disp, $disp_prefix, $extension); if ($self->{_multipart_in_progress}) { print $self->multipart_end(); - print $self->multipart_start(-type => $contenttype, - -content_disposition => $disposition); + print $self->multipart_start(-type => $contenttype); } else { - print $self->header(-type => $contenttype, - -content_disposition => $disposition); + print $self->header($contenttype); } } # Override header so we can add the cookies in sub header { my $self = shift; + + my %headers; my $user = Bugzilla->user; # If there's only one parameter, then it's a Content-Type. if (scalar(@_) == 1) { - # Since we're adding parameters below, we have to name it. - unshift(@_, '-type' => shift(@_)); + %headers = ('-type' => shift(@_)); + } + else { + %headers = @_; + } + + if ($self->{'_content_disp'}) { + $headers{'-content_disposition'} = $self->{'_content_disp'}; } if (!$user->id && $user->authorizer->can_login @@ -308,7 +321,7 @@ sub header { # Add the cookies in if we have any if (scalar(@{$self->{Bugzilla_cookie_list}})) { - unshift(@_, '-cookie' => $self->{Bugzilla_cookie_list}); + $headers{'-cookie'} = $self->{Bugzilla_cookie_list}; } # Add Strict-Transport-Security (STS) header if this response @@ -322,24 +335,29 @@ sub header { { $sts_opts .= '; includeSubDomains'; } - unshift(@_, '-strict_transport_security' => $sts_opts); + + $headers{'-strict_transport_security'} = $sts_opts; } # Add X-Frame-Options header to prevent framing and subsequent # possible clickjacking problems. unless ($self->url_is_attachment_base) { - unshift(@_, '-x_frame_options' => 'SAMEORIGIN'); + $headers{'-x_frame_options'} = 'SAMEORIGIN'; } # Add X-XSS-Protection header to prevent simple XSS attacks # and enforce the blocking (rather than the rewriting) mode. - unshift(@_, '-x_xss_protection' => '1; mode=block'); + $headers{'-x_xss_protection'} = '1; mode=block'; # Add X-Content-Type-Options header to prevent browsers sniffing # the MIME type away from the declared Content-Type. - unshift(@_, '-x_content_type_options' => 'nosniff'); + $headers{'-x_content_type_options'} = 'nosniff'; - return $self->SUPER::header(@_) || ""; + Bugzilla::Hook::process('cgi_headers', + { cgi => $self, headers => \%headers } + ); + + return $self->SUPER::header(%headers) || ""; } sub param { @@ -356,10 +374,7 @@ sub param { if (!scalar(@result) && $self->request_method && $self->request_method eq 'POST') { - # Some servers fail to set the QUERY_STRING parameter, which - # causes undef issues - $ENV{'QUERY_STRING'} = '' unless exists $ENV{'QUERY_STRING'}; - @result = $self->SUPER::url_param(@_); + @result = $self->url_param(@_); } # Fix UTF-8-ness of input parameters. @@ -384,6 +399,14 @@ sub param { return $self->SUPER::param(@_); } +sub url_param { + my $self = shift; + # Some servers fail to set the QUERY_STRING parameter, which + # causes undef issues + $ENV{'QUERY_STRING'} //= ''; + return $self->SUPER::url_param(@_); +} + sub _fix_utf8 { my $input = shift; # The is_utf8 is here in case CGI gets smart about utf8 someday. @@ -554,6 +577,22 @@ sub url_is_attachment_base { return ($self->url =~ $regex) ? 1 : 0; } +sub set_dated_content_disp { + my ($self, $type, $prefix, $ext) = @_; + + my @time = localtime(time()); + my $date = sprintf "%04d-%02d-%02d", 1900+$time[5], $time[4]+1, $time[3]; + my $filename = "$prefix-$date.$ext"; + + $filename =~ s/\s/_/g; # Remove whitespace to avoid HTTP header tampering + $filename =~ s/\\/_/g; # Remove backslashes as well + $filename =~ s/"/\\"/g; # escape quotes + + my $disposition = "$type; filename=\"$filename\""; + + $self->{'_content_disp'} = $disposition; +} + ########################## # Vars TIEHASH Interface # ########################## @@ -628,7 +667,9 @@ I<Bugzilla::CGI> also includes additional functions. =item C<canonicalise_query(@exclude)> -This returns a sorted string of the parameters, suitable for use in a url. +This returns a sorted string of the parameters whose values are non-empty, +suitable for use in a url. + Values in C<@exclude> are not included in the result. =item C<send_cookie> @@ -670,8 +711,35 @@ If not specified, text/html is assumed. Ends a part of the multipart document, and starts another part. +=item C<set_dated_content_disp> + +Sets an appropriate date-dependent value for the Content Disposition header +for a downloadable resource. + =back =head1 SEE ALSO L<CGI|CGI>, L<CGI::Cookie|CGI::Cookie> + +=head1 B<Methods in need of POD> + +=over + +=item check_etag + +=item clean_search_url + +=item url_is_attachment_base + +=item should_set + +=item redirect_search_url + +=item param + +=item url_param + +=item header + +=back diff --git a/Bugzilla/Chart.pm b/Bugzilla/Chart.pm index e343a0535..3c69006aa 100644 --- a/Bugzilla/Chart.pm +++ b/Bugzilla/Chart.pm @@ -5,8 +5,6 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -use strict; - # This module represents a chart. # # Note that it is perfectly legal for the 'lines' member variable of this @@ -15,6 +13,10 @@ use strict; # the same points. package Bugzilla::Chart; +use 5.10.1; +use strict; +use warnings; + use Bugzilla::Error; use Bugzilla::Util; use Bugzilla::Series; @@ -426,3 +428,29 @@ sub dump { } 1; + +=head1 B<Methods in need of POD> + +=over + +=item remove + +=item add + +=item dump + +=item readData + +=item getSeriesIDs + +=item data + +=item init + +=item getVisibleSeries + +=item generateDateProgression + +=item sum + +=back diff --git a/Bugzilla/Classification.pm b/Bugzilla/Classification.pm index 2b35a8839..09f71baaf 100644 --- a/Bugzilla/Classification.pm +++ b/Bugzilla/Classification.pm @@ -5,23 +5,27 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -use strict; - package Bugzilla::Classification; +use 5.10.1; +use strict; +use warnings; + use Bugzilla::Constants; use Bugzilla::Field; use Bugzilla::Util; use Bugzilla::Error; use Bugzilla::Product; -use base qw(Bugzilla::Field::ChoiceInterface Bugzilla::Object Exporter); +use parent qw(Bugzilla::Field::ChoiceInterface Bugzilla::Object Exporter); @Bugzilla::Classification::EXPORT = qw(sort_products_by_classification); ############################### #### Initialization #### ############################### +use constant IS_CONFIG => 1; + use constant DB_TABLE => 'classifications'; use constant LIST_ORDER => 'sortkey, name'; @@ -47,6 +51,7 @@ use constant VALIDATORS => { ############################### #### Constructors ##### ############################### + sub remove_from_db { my $self = shift; my $dbh = Bugzilla->dbh; @@ -54,9 +59,19 @@ sub remove_from_db { ThrowUserError("classification_not_deletable") if ($self->id == 1); $dbh->bz_start_transaction(); + # Reclassify products to the default classification, if needed. - $dbh->do("UPDATE products SET classification_id = 1 - WHERE classification_id = ?", undef, $self->id); + my $product_ids = $dbh->selectcol_arrayref( + 'SELECT id FROM products WHERE classification_id = ?', undef, $self->id); + + if (@$product_ids) { + $dbh->do('UPDATE products SET classification_id = 1 WHERE ' + . $dbh->sql_in('id', $product_ids)); + foreach my $id (@$product_ids) { + Bugzilla->memcached->clear({ table => 'products', id => $id }); + } + Bugzilla->memcached->clear_config(); + } $self->SUPER::remove_from_db(); @@ -259,3 +274,21 @@ A Classification is a higher-level grouping of Products. =back =cut + +=head1 B<Methods in need of POD> + +=over + +=item set_description + +=item sortkey + +=item set_name + +=item description + +=item remove_from_db + +=item set_sortkey + +=back diff --git a/Bugzilla/Comment.pm b/Bugzilla/Comment.pm index 30ec1cb82..b036907d7 100644 --- a/Bugzilla/Comment.pm +++ b/Bugzilla/Comment.pm @@ -5,18 +5,22 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -use strict; - package Bugzilla::Comment; -use base qw(Bugzilla::Object); +use 5.10.1; +use strict; +use warnings; + +use parent qw(Bugzilla::Object); use Bugzilla::Attachment; +use Bugzilla::Comment::TagWeights; use Bugzilla::Constants; use Bugzilla::Error; use Bugzilla::User; use Bugzilla::Util; +use List::Util qw(first); use Scalar::Util qw(blessed); ############################### @@ -78,21 +82,94 @@ use constant VALIDATOR_DEPENDENCIES => { sub update { my $self = shift; - my $changes = $self->SUPER::update(@_); - $self->bug->_sync_fulltext( update_comments => 1); + my ($changes, $old_comment) = $self->SUPER::update(@_); + + if (exists $changes->{'thetext'} || exists $changes->{'isprivate'}) { + $self->bug->_sync_fulltext( update_comments => 1); + } + + my @old_tags = @{ $old_comment->tags }; + my @new_tags = @{ $self->tags }; + my ($removed_tags, $added_tags) = diff_arrays(\@old_tags, \@new_tags); + + if (@$removed_tags || @$added_tags) { + my $dbh = Bugzilla->dbh; + my $when = $dbh->selectrow_array("SELECT LOCALTIMESTAMP(0)"); + my $sth_delete = $dbh->prepare( + "DELETE FROM longdescs_tags WHERE comment_id = ? AND tag = ?" + ); + my $sth_insert = $dbh->prepare( + "INSERT INTO longdescs_tags(comment_id, tag) VALUES (?, ?)" + ); + my $sth_activity = $dbh->prepare( + "INSERT INTO longdescs_tags_activity + (bug_id, comment_id, who, bug_when, added, removed) + VALUES (?, ?, ?, ?, ?, ?)" + ); + + foreach my $tag (@$removed_tags) { + my $weighted = Bugzilla::Comment::TagWeights->new({ name => $tag }); + if ($weighted) { + if ($weighted->weight == 1) { + $weighted->remove_from_db(); + } else { + $weighted->set_weight($weighted->weight - 1); + $weighted->update(); + } + } + trick_taint($tag); + $sth_delete->execute($self->id, $tag); + $sth_activity->execute( + $self->bug_id, $self->id, Bugzilla->user->id, $when, '', $tag); + } + + foreach my $tag (@$added_tags) { + my $weighted = Bugzilla::Comment::TagWeights->new({ name => $tag }); + if ($weighted) { + $weighted->set_weight($weighted->weight + 1); + $weighted->update(); + } else { + Bugzilla::Comment::TagWeights->create({ tag => $tag, weight => 1 }); + } + trick_taint($tag); + $sth_insert->execute($self->id, $tag); + $sth_activity->execute( + $self->bug_id, $self->id, Bugzilla->user->id, $when, $tag, ''); + } + } + return $changes; } -# Speeds up displays of comment lists by loading all ->author objects -# at once for a whole list. +# Speeds up displays of comment lists by loading all author objects and tags at +# once for a whole list. sub preload { my ($class, $comments) = @_; + # Author my %user_ids = map { $_->{who} => 1 } @$comments; my $users = Bugzilla::User->new_from_list([keys %user_ids]); my %user_map = map { $_->id => $_ } @$users; foreach my $comment (@$comments) { $comment->{author} = $user_map{$comment->{who}}; } + # Tags + if (Bugzilla->params->{'comment_taggers_group'}) { + my $dbh = Bugzilla->dbh; + my @comment_ids = map { $_->id } @$comments; + my %comment_map = map { $_->id => $_ } @$comments; + my $rows = $dbh->selectall_arrayref( + "SELECT comment_id, " . $dbh->sql_group_concat('tag', "','") . " + FROM longdescs_tags + WHERE " . $dbh->sql_in('comment_id', \@comment_ids) . ' ' . + $dbh->sql_group_by('comment_id')); + foreach my $row (@$rows) { + $comment_map{$row->[0]}->{tags} = [ split(/,/, $row->[1]) ]; + } + # Also sets the 'tags' attribute for comments which have no entry + # in the longdescs_tags table, else calling $comment->tags will + # trigger another SQL query again. + $comment_map{$_}->{tags} ||= [] foreach @comment_ids; + } } ############################### @@ -112,6 +189,43 @@ sub work_time { sub type { return $_[0]->{'type'}; } sub extra_data { return $_[0]->{'extra_data'} } +sub tags { + my ($self) = @_; + state $comment_taggers_group = Bugzilla->params->{'comment_taggers_group'}; + return [] unless $comment_taggers_group; + $self->{'tags'} ||= Bugzilla->dbh->selectcol_arrayref( + "SELECT tag + FROM longdescs_tags + WHERE comment_id = ? + ORDER BY tag", + undef, $self->id); + return $self->{'tags'}; +} + +sub collapsed { + my ($self) = @_; + state $comment_taggers_group = Bugzilla->params->{'comment_taggers_group'}; + return 0 unless $comment_taggers_group; + return $self->{collapsed} if exists $self->{collapsed}; + + state $collapsed_comment_tags = Bugzilla->params->{'collapsed_comment_tags'}; + $self->{collapsed} = 0; + Bugzilla->request_cache->{comment_tags_collapsed} + ||= [ split(/\s*,\s*/, $collapsed_comment_tags) ]; + my @collapsed_tags = @{ Bugzilla->request_cache->{comment_tags_collapsed} }; + foreach my $my_tag (@{ $self->tags }) { + $my_tag = lc($my_tag); + foreach my $collapsed_tag (@collapsed_tags) { + if ($my_tag eq lc($collapsed_tag)) { + $self->{collapsed} = 1; + last; + } + } + last if $self->{collapsed}; + } + return $self->{collapsed}; +} + sub bug { my $self = shift; require Bugzilla::Bug; @@ -129,13 +243,15 @@ sub is_about_attachment { sub attachment { my ($self) = @_; return undef if not $self->is_about_attachment; - $self->{attachment} ||= new Bugzilla::Attachment($self->extra_data); + $self->{attachment} ||= + new Bugzilla::Attachment({ id => $self->extra_data, cache => 1 }); return $self->{attachment}; } sub author { my $self = shift; - $self->{'author'} ||= new Bugzilla::User($self->{'who'}); + $self->{'author'} + ||= new Bugzilla::User({ id => $self->{'who'}, cache => 1 }); return $self->{'author'}; } @@ -167,6 +283,26 @@ sub set_is_private { $_[0]->set('isprivate', $_[1]); } sub set_type { $_[0]->set('type', $_[1]); } sub set_extra_data { $_[0]->set('extra_data', $_[1]); } +sub add_tag { + my ($self, $tag) = @_; + $tag = $self->_check_tag($tag); + + my $tags = $self->tags; + return if grep { lc($tag) eq lc($_) } @$tags; + push @$tags, $tag; + $self->{'tags'} = [ sort @$tags ]; +} + +sub remove_tag { + my ($self, $tag) = @_; + $tag = $self->_check_tag($tag); + + my $tags = $self->tags; + my $index = first { lc($tags->[$_]) eq lc($tag) } 0..scalar(@$tags) - 1; + return unless defined $index; + splice(@$tags, $index, 1); +} + ############## # Validators # ############## @@ -297,6 +433,18 @@ sub _check_thetext { $thetext =~ s/\s*$//s; $thetext =~ s/\r\n?/\n/g; # Get rid of \r. + # Characters above U+FFFF cannot be stored by MySQL older than 5.5.3 as they + # require the new utf8mb4 character set. Other DB servers are handling them + # without any problem. So we need to replace these characters if we use MySQL, + # else the comment is truncated. + # XXX - Once we use utf8mb4 for comments, this hack for MySQL can go away. + state $is_mysql = Bugzilla->dbh->isa('Bugzilla::DB::Mysql') ? 1 : 0; + if ($is_mysql) { + # Perl 5.13.8 and older complain about non-characters. + no warnings 'utf8'; + $thetext =~ s/([\x{10000}-\x{10FFFF}])/"\x{FDD0}[" . uc(sprintf('U+%04x', ord($1))) . "]\x{FDD1}"/eg; + } + ThrowUserError('comment_too_long') if length($thetext) > MAX_COMMENT_LENGTH; return $thetext; } @@ -309,6 +457,17 @@ sub _check_isprivate { return $isprivate ? 1 : 0; } +sub _check_tag { + my ($invocant, $tag) = @_; + length($tag) < MIN_COMMENT_TAG_LENGTH + and ThrowUserError('comment_tag_too_short', { tag => $tag }); + length($tag) > MAX_COMMENT_TAG_LENGTH + and ThrowUserError('comment_tag_too_long', { tag => $tag }); + $tag =~ /^[\w\d\._-]+$/ + or ThrowUserError('comment_tag_invalid', { tag => $tag }); + return $tag; +} + sub count { my ($self) = @_; @@ -323,7 +482,7 @@ sub count { undef, $self->bug_id, $self->creation_ts); return --$self->{'count'}; -} +} 1; @@ -369,7 +528,7 @@ C<string> Time spent as related to this comment. =item C<is_private> -C<boolean> Comment is marked as private +C<boolean> Comment is marked as private. =item C<already_wrapped> @@ -384,6 +543,54 @@ L<Bugzilla::User> who created the comment. C<int> The position this comment is located in the full list of comments for a bug starting from 0. +=item C<collapsed> + +C<boolean> Comment should be displayed as collapsed by default. + +=item C<tags> + +C<array of strings> The tags attached to the comment. + +=item C<add_tag> + +=over + +=item B<Description> + +Attaches the specified tag to the comment. + +=item B<Params> + +=over + +=item C<tag> + +C<string> The tag to attach. + +=back + +=back + +=item C<remove_tag> + +=over + +=item B<Description> + +Detaches the specified tag from the comment. + +=item B<Params> + +=over + +=item C<tag> + +C<string> The tag to detach. + +=back + +=back + =item C<body_full> =over @@ -417,3 +624,29 @@ A string, the full text of the comment as it would be displayed to an end-user. =back =cut + +=head1 B<Methods in need of POD> + +=over + +=item set_type + +=item bug + +=item set_extra_data + +=item set_is_private + +=item attachment + +=item is_about_attachment + +=item extra_data + +=item preload + +=item type + +=item update + +=back diff --git a/Bugzilla/Comment/TagWeights.pm b/Bugzilla/Comment/TagWeights.pm new file mode 100644 index 000000000..7dba53e34 --- /dev/null +++ b/Bugzilla/Comment/TagWeights.pm @@ -0,0 +1,78 @@ +# 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::Comment::TagWeights; + +use 5.10.1; +use strict; +use warnings; + +use parent qw(Bugzilla::Object); + +use Bugzilla::Constants; + +# No auditing required +use constant AUDIT_CREATES => 0; +use constant AUDIT_UPDATES => 0; +use constant AUDIT_REMOVES => 0; + +use constant DB_COLUMNS => qw( + id + tag + weight +); + +use constant UPDATE_COLUMNS => qw( + weight +); + +use constant DB_TABLE => 'longdescs_tags_weights'; +use constant ID_FIELD => 'id'; +use constant NAME_FIELD => 'tag'; +use constant LIST_ORDER => 'weight DESC'; +use constant VALIDATORS => { }; + +# There's no gain to caching these objects +use constant USE_MEMCACHED => 0; + +sub tag { return $_[0]->{'tag'} } +sub weight { return $_[0]->{'weight'} } + +sub set_weight { $_[0]->set('weight', $_[1]); } + +1; + +=head1 NAME + +Comment::TagWeights - Bugzilla comment weighting class. + +=head1 DESCRIPTION + +TagWeights.pm represents a Comment::TagWeight object. It is an implementation +of L<Bugzilla::Object>, and thus provides all methods that L<Bugzilla::Object> +provides. + +TagWeights is used to quickly find tags and order by their usage count. + +=head1 PROPERTIES + +=over + +=item C<tag> + +C<getter string> The tag + +=item C<weight> + +C<getter int> The tag's weight. The value returned corresponds to the number of +comments with this tag attached. + +=item C<set_weight> + +C<setter int> Set the tag's weight. + +=back diff --git a/Bugzilla/Component.pm b/Bugzilla/Component.pm index 1ce4e02ea..9bc0a4493 100644 --- a/Bugzilla/Component.pm +++ b/Bugzilla/Component.pm @@ -6,8 +6,12 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Component; + +use 5.10.1; use strict; -use base qw(Bugzilla::Field::ChoiceInterface Bugzilla::Object); +use warnings; + +use parent qw(Bugzilla::Field::ChoiceInterface Bugzilla::Object); use Bugzilla::Constants; use Bugzilla::Util; @@ -339,23 +343,16 @@ sub bug_ids { sub default_assignee { my $self = shift; - if (!defined $self->{'default_assignee'}) { - $self->{'default_assignee'} = - new Bugzilla::User($self->{'initialowner'}); - } - return $self->{'default_assignee'}; + return $self->{'default_assignee'} + ||= new Bugzilla::User({ id => $self->{'initialowner'}, cache => 1 }); } sub default_qa_contact { my $self = shift; - return if !$self->{'initialqacontact'}; - - if (!defined $self->{'default_qa_contact'}) { - $self->{'default_qa_contact'} = - new Bugzilla::User($self->{'initialqacontact'}); - } - return $self->{'default_qa_contact'}; + return unless $self->{'initialqacontact'}; + return $self->{'default_qa_contact'} + ||= new Bugzilla::User({id => $self->{'initialqacontact'}, cache => 1 }); } sub flag_types { @@ -650,3 +647,19 @@ Component.pm represents a Product Component object. =back =cut + +=head1 B<Methods in need of POD> + +=over + +=item is_set_on_bug + +=item product_id + +=item set_is_active + +=item description + +=item is_active + +=back diff --git a/Bugzilla/Config.pm b/Bugzilla/Config.pm index 150996e05..1e22b5239 100644 --- a/Bugzilla/Config.pm +++ b/Bugzilla/Config.pm @@ -7,14 +7,21 @@ package Bugzilla::Config; +use 5.10.1; use strict; +use warnings; + +use parent qw(Exporter); +use autodie qw(:default); -use base qw(Exporter); use Bugzilla::Constants; use Bugzilla::Hook; -use Bugzilla::Install::Filesystem qw(fix_file_permissions); -use Data::Dumper; +use Bugzilla::Util qw(trick_taint); + +use JSON::XS; +use File::Slurp; use File::Temp; +use File::Basename; # Don't export localvars by default - people should have to explicitly # ask for it, as a (probably futile) attempt to stop code using it @@ -91,8 +98,35 @@ sub SetParam { sub update_params { my ($params) = @_; my $answer = Bugzilla->installation_answers; + my $datadir = bz_locations()->{'datadir'}; + my $param; + + # If the old data/params file using Data::Dumper output still exists, + # read it. It will be deleted once the parameters are stored in the new + # data/params.json file. + my $old_file = "$datadir/params"; + + if (-e $old_file) { + require Safe; + my $s = new Safe; + + $s->rdo($old_file); + die "Error reading $old_file: $!" if $!; + die "Error evaluating $old_file: $@" if $@; + + # Now read the param back out from the sandbox. + $param = \%{ $s->varglob('param') }; + } + else { + # Rename params.js to params.json if checksetup.pl + # was executed with an earlier version of this change + rename "$old_file.js", "$old_file.json" + if -e "$old_file.js" && !-e "$old_file.json"; + + # Read the new data/params.json file. + $param = read_param_file(); + } - my $param = read_param_file(); my %new_params; # If we didn't return any param values, then this is a new installation. @@ -151,16 +185,19 @@ sub update_params { } # Old mail_delivery_method choices contained no uppercase characters - if (exists $param->{'mail_delivery_method'} - && $param->{'mail_delivery_method'} !~ /[A-Z]/) { - my $method = $param->{'mail_delivery_method'}; - my %translation = ( - 'sendmail' => 'Sendmail', - 'smtp' => 'SMTP', - 'qmail' => 'Qmail', - 'testfile' => 'Test', - 'none' => 'None'); - $param->{'mail_delivery_method'} = $translation{$method}; + my $mta = $param->{'mail_delivery_method'}; + if ($mta) { + if ($mta !~ /[A-Z]/) { + my %translation = ( + 'sendmail' => 'Sendmail', + 'smtp' => 'SMTP', + 'qmail' => 'Qmail', + 'testfile' => 'Test', + 'none' => 'None'); + $param->{'mail_delivery_method'} = $translation{$mta}; + } + # This will force the parameter to be reset to its default value. + delete $param->{'mail_delivery_method'} if $param->{'mail_delivery_method'} eq 'Qmail'; } # Convert the old "ssl" parameter to the new "ssl_redirect" parameter. @@ -196,6 +233,9 @@ sub update_params { $param->{'utf8'} = 1 if $new_install; + # Bug 452525: OR based groups are on by default for new installations + $param->{'or_groups'} = 1 if $new_install; + # --- REMOVE OLD PARAMS --- my %oldparams; @@ -207,7 +247,6 @@ sub update_params { } # Write any old parameters to old-params.txt - my $datadir = bz_locations()->{'datadir'}; my $old_param_file = "$datadir/old-params.txt"; if (scalar(keys %oldparams)) { my $op_file = new IO::File($old_param_file, '>>', 0600) @@ -217,12 +256,9 @@ sub update_params { " and so have been\nmoved from your parameters file into", " $old_param_file:\n"; - local $Data::Dumper::Terse = 1; - local $Data::Dumper::Indent = 0; - my $comma = ""; foreach my $item (keys %oldparams) { - print $op_file "\n\n$item:\n" . Data::Dumper->Dump([$oldparams{$item}]) . "\n"; + print $op_file "\n\n$item:\n" . $oldparams{$item} . "\n"; print "${comma}$item"; $comma = ", "; } @@ -253,6 +289,11 @@ sub update_params { write_params($param); + if (-e $old_file) { + unlink $old_file; + say "$old_file has been converted into $old_file.json, using the JSON format."; + } + # Return deleted params and values so that checksetup.pl has a chance # to convert old params to new data. return %oldparams; @@ -261,24 +302,15 @@ sub update_params { sub write_params { my ($param_data) = @_; $param_data ||= Bugzilla->params; + my $param_file = bz_locations()->{'datadir'} . '/params.json'; - my $datadir = bz_locations()->{'datadir'}; - my $param_file = "$datadir/params"; - - local $Data::Dumper::Sortkeys = 1; - - my ($fh, $tmpname) = File::Temp::tempfile('params.XXXXX', - DIR => $datadir ); - - print $fh (Data::Dumper->Dump([$param_data], ['*param'])) - || die "Can't write param file: $!"; + my $json_data = JSON::XS->new->canonical->pretty->encode($param_data); + write_file($param_file, { binmode => ':utf8', atomic => 1 }, \$json_data); - close $fh; - - rename $tmpname, $param_file - or die "Can't rename $tmpname to $param_file: $!"; - - fix_file_permissions($param_file); + # It's not common to edit parameters and loading + # Bugzilla::Install::Filesystem is slow. + require Bugzilla::Install::Filesystem; + Bugzilla::Install::Filesystem::fix_file_permissions($param_file); # And now we have to reset the params cache so that Bugzilla will re-read # them. @@ -287,21 +319,25 @@ sub write_params { sub read_param_file { my %params; - my $datadir = bz_locations()->{'datadir'}; - if (-e "$datadir/params") { - # Note that checksetup.pl sets file permissions on '$datadir/params' - - # Using Safe mode is _not_ a guarantee of safety if someone does - # manage to write to the file. However, it won't hurt... - # See bug 165144 for not needing to eval this at all - my $s = new Safe; - - $s->rdo("$datadir/params"); - die "Error reading $datadir/params: $!" if $!; - die "Error evaluating $datadir/params: $@" if $@; - - # Now read the param back out from the sandbox - %params = %{$s->varglob('param')}; + my $file = bz_locations()->{'datadir'} . '/params.json'; + + if (-e $file) { + my $data; + read_file($file, binmode => ':utf8', buf_ref => \$data); + + # If params.json has been manually edited and e.g. some quotes are + # missing, we don't want JSON::XS to leak the content of the file + # to all users in its error message, so we have to eval'uate it. + %params = eval { %{JSON::XS->new->decode($data)} }; + if ($@) { + my $error_msg = (basename($0) eq 'checksetup.pl') ? + $@ : 'run checksetup.pl to see the details.'; + die "Error parsing $file: $error_msg"; + } + # JSON::XS doesn't detaint data for us. + foreach my $key (keys %params) { + trick_taint($params{$key}) if defined $params{$key}; + } } elsif ($ENV{'SERVER_SOFTWARE'}) { # We're in a CGI, but the params file doesn't exist. We can't @@ -311,7 +347,7 @@ sub read_param_file { # so that the user sees the error. require CGI::Carp; CGI::Carp->import('fatalsToBrowser'); - die "The $datadir/params file does not exist." + die "The $file file does not exist." . ' You probably need to run checksetup.pl.', } return \%params; @@ -367,7 +403,7 @@ specified. Description: Writes the parameters to disk. Params: C<$params> (optional) - A hashref to write to the disk - instead of C<Bugzilla->params>. Used only by + instead of C<Bugzilla-E<gt>params>. Used only by C<update_params>. Returns: nothing @@ -375,11 +411,13 @@ Returns: nothing =item C<read_param_file()> Description: Most callers should never need this. This is used - by C<Bugzilla->params> to directly read C<$datadir/params> - and load it into memory. Use C<Bugzilla->params> instead. + by C<Bugzilla-E<gt>params> to directly read C<$datadir/params.json> + and load it into memory. Use C<Bugzilla-E<gt>params> instead. Params: none -Returns: A hashref containing the current params in C<$datadir/params>. +Returns: A hashref containing the current params in C<$datadir/params.json>. + +=item C<param_panels()> =back diff --git a/Bugzilla/Config/Admin.pm b/Bugzilla/Config/Admin.pm index 7be3e54d1..41d929298 100644 --- a/Bugzilla/Config/Admin.pm +++ b/Bugzilla/Config/Admin.pm @@ -7,7 +7,9 @@ package Bugzilla::Config::Admin; +use 5.10.1; use strict; +use warnings; use Bugzilla::Config::Common; @@ -32,6 +34,13 @@ sub get_param_list { name => 'allowuserdeletion', type => 'b', default => 0 + }, + + { + name => 'last_visit_keep_days', + type => 't', + default => 10, + checker => \&check_numeric }); return @param_list; } diff --git a/Bugzilla/Config/Advanced.pm b/Bugzilla/Config/Advanced.pm index fa5b7d249..8356c3361 100644 --- a/Bugzilla/Config/Advanced.pm +++ b/Bugzilla/Config/Advanced.pm @@ -6,7 +6,10 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Config::Advanced; + +use 5.10.1; use strict; +use warnings; use Bugzilla::Config::Common; diff --git a/Bugzilla/Config/Attachment.pm b/Bugzilla/Config/Attachment.pm index ba19f7782..580ec46d9 100644 --- a/Bugzilla/Config/Attachment.pm +++ b/Bugzilla/Config/Attachment.pm @@ -7,7 +7,9 @@ package Bugzilla::Config::Attachment; +use 5.10.1; use strict; +use warnings; use Bugzilla::Config::Common; diff --git a/Bugzilla/Config/Auth.pm b/Bugzilla/Config/Auth.pm index 19ba59b0c..78d719b15 100644 --- a/Bugzilla/Config/Auth.pm +++ b/Bugzilla/Config/Auth.pm @@ -7,7 +7,9 @@ package Bugzilla::Config::Auth; +use 5.10.1; use strict; +use warnings; use Bugzilla::Config::Common; @@ -73,9 +75,15 @@ sub get_param_list { }, { + name => 'webservice_email_filter', + type => 'b', + default => 0 + }, + + { name => 'emailregexp', type => 't', - default => q:^[\\w\\.\\+\\-=]+@[\\w\\.\\-]+\\.[\\w\\-]+$:, + default => q:^[\\w\\.\\+\\-=']+@[\\w\\.\\-]+\\.[\\w\\-]+$:, checker => \&check_regexp }, @@ -106,7 +114,14 @@ sub get_param_list { 'letters_numbers_specialchars' ], default => 'no_constraints', checker => \&check_multi - } ); + }, + + { + name => 'password_check_on_login', + type => 'b', + default => '1' + }, + ); return @param_list; } diff --git a/Bugzilla/Config/BugChange.pm b/Bugzilla/Config/BugChange.pm index 68cfe5676..0acdc0ce4 100644 --- a/Bugzilla/Config/BugChange.pm +++ b/Bugzilla/Config/BugChange.pm @@ -7,7 +7,9 @@ package Bugzilla::Config::BugChange; +use 5.10.1; use strict; +use warnings; use Bugzilla::Config::Common; use Bugzilla::Status; diff --git a/Bugzilla/Config/BugFields.pm b/Bugzilla/Config/BugFields.pm index 7ae9ae355..ef2faa64b 100644 --- a/Bugzilla/Config/BugFields.pm +++ b/Bugzilla/Config/BugFields.pm @@ -7,7 +7,9 @@ package Bugzilla::Config::BugFields; +use 5.10.1; use strict; +use warnings; use Bugzilla::Config::Common; use Bugzilla::Field; @@ -83,7 +85,13 @@ sub get_param_list { choices => ['', @legal_OS], default => '', checker => \&check_opsys - } ); + }, + + { + name => 'collapsed_comment_tags', + type => 't', + default => 'obsolete, spam', + }); return @param_list; } diff --git a/Bugzilla/Config/Common.pm b/Bugzilla/Config/Common.pm index e1c2c8c40..414894773 100644 --- a/Bugzilla/Config/Common.pm +++ b/Bugzilla/Config/Common.pm @@ -7,7 +7,9 @@ package Bugzilla::Config::Common; +use 5.10.1; use strict; +use warnings; use Email::Address; use Socket; @@ -18,15 +20,16 @@ use Bugzilla::Field; use Bugzilla::Group; use Bugzilla::Status; -use base qw(Exporter); +use parent qw(Exporter); @Bugzilla::Config::Common::EXPORT = qw(check_multi check_numeric check_regexp check_url check_group check_sslbase check_priority check_severity check_platform check_opsys check_shadowdb check_urlbase check_webdotbase - check_user_verify_class check_ip check_smtp_server + check_user_verify_class check_ip check_font_file check_mail_delivery_method check_notification check_utf8 check_bug_status check_smtp_auth check_theschwartz_available check_maxattachmentsize check_email check_smtp_ssl + check_comment_taggers_group check_smtp_server ); # Checking functions for the various values @@ -97,7 +100,7 @@ sub check_sslbase { my $iaddr = inet_aton($host) || return "The host $host cannot be resolved"; my $sin = sockaddr_in($port, $iaddr); if (!connect(SOCK, $sin)) { - return "Failed to connect to $host:$port; unable to enable SSL"; + return "Failed to connect to $host:$port ($!); unable to enable SSL"; } close(SOCK); } @@ -241,6 +244,20 @@ sub check_webdotbase { return ""; } +sub check_font_file { + my ($font) = @_; + $font = trim($font); + return '' unless $font; + + if ($font !~ /\.ttf$/) { + return "The file must point to a TrueType font file (its extension must be .ttf)" + } + if (! -f $font) { + return "The file '$font' cannot be found. Make sure you typed the full path to the file" + } + return ''; +} + sub check_user_verify_class { # doeditparams traverses the list of params, and for each one it checks, # then updates. This means that if one param checker wants to look at @@ -335,7 +352,21 @@ sub check_smtp_server { return "Invalid port. It must be an integer (typically 25, 465 or 587)"; } } - return ""; + trick_taint($host); + # Let's first try to connect using SSL. If this fails, we fall back to + # an unencrypted connection. + foreach my $method (['Net::SMTP::SSL', 465], ['Net::SMTP', 25]) { + my ($class, $default_port) = @$method; + next if $class eq 'Net::SMTP::SSL' && !Bugzilla->feature('smtp_ssl'); + eval "require $class"; + my $smtp = $class->new($host, Port => $port || $default_port, Timeout => 5); + if ($smtp) { + # The connection works! + $smtp->quit; + return ''; + } + } + return "Cannot connect to $host" . ($port ? " using port $port" : ""); } sub check_smtp_auth { @@ -365,6 +396,14 @@ sub check_theschwartz_available { return ""; } +sub check_comment_taggers_group { + my $group_name = shift; + if ($group_name && !Bugzilla->feature('jsonrpc')) { + return "Comment tagging requires installation of the JSONRPC feature"; + } + return check_group($group_name); +} + # OK, here are the parameter definitions themselves. # # Each definition is a hash with keys: @@ -463,4 +502,63 @@ Checks that the value is a valid number Checks that the value is a valid regexp +=item C<check_comment_taggers_group> + +Checks that the required modules for comment tagging are installed, and that a +valid group is provided. + +=back + +=head1 B<Methods in need of POD> + +=over + +=item check_notification + +=item check_priority + +=item check_ip + +=item check_user_verify_class + +=item check_bug_status + +=item check_shadowdb + +=item check_smtp_server + +=item check_smtp_auth + +=item check_url + +=item check_urlbase + +=item check_email + +=item check_webdotbase + +=item check_font_file + +=item get_param_list + +=item check_maxattachmentsize + +=item check_utf8 + +=item check_group + +=item check_opsys + +=item check_platform + +=item check_severity + +=item check_sslbase + +=item check_mail_delivery_method + +=item check_theschwartz_available + +=item check_smtp_ssl + =back diff --git a/Bugzilla/Config/Core.pm b/Bugzilla/Config/Core.pm index f2510d2b2..654e569ba 100644 --- a/Bugzilla/Config/Core.pm +++ b/Bugzilla/Config/Core.pm @@ -7,7 +7,9 @@ package Bugzilla::Config::Core; +use 5.10.1; use strict; +use warnings; use Bugzilla::Config::Common; diff --git a/Bugzilla/Config/DependencyGraph.pm b/Bugzilla/Config/DependencyGraph.pm index cc61e3588..c815822f3 100644 --- a/Bugzilla/Config/DependencyGraph.pm +++ b/Bugzilla/Config/DependencyGraph.pm @@ -7,7 +7,9 @@ package Bugzilla::Config::DependencyGraph; +use 5.10.1; use strict; +use warnings; use Bugzilla::Config::Common; @@ -19,9 +21,16 @@ sub get_param_list { { name => 'webdotbase', type => 't', - default => 'http://www.research.att.com/~north/cgi-bin/webdot.cgi/%urlbase%', + default => '', checker => \&check_webdotbase - } ); + }, + + { + name => 'font_file', + type => 't', + default => '', + checker => \&check_font_file + }); return @param_list; } diff --git a/Bugzilla/Config/General.pm b/Bugzilla/Config/General.pm index 6e00b202a..380680590 100644 --- a/Bugzilla/Config/General.pm +++ b/Bugzilla/Config/General.pm @@ -6,7 +6,11 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Config::General; + +use 5.10.1; use strict; +use warnings; + use Bugzilla::Config::Common; our $sortkey = 150; @@ -21,13 +25,6 @@ use constant get_param_list => ( }, { - name => 'docs_urlbase', - type => 't', - default => 'docs/%lang%/html/', - checker => \&check_url - }, - - { name => 'utf8', type => 'b', default => '0', diff --git a/Bugzilla/Config/GroupSecurity.pm b/Bugzilla/Config/GroupSecurity.pm index f0b4ac808..e827834a0 100644 --- a/Bugzilla/Config/GroupSecurity.pm +++ b/Bugzilla/Config/GroupSecurity.pm @@ -7,7 +7,9 @@ package Bugzilla::Config::GroupSecurity; +use 5.10.1; use strict; +use warnings; use Bugzilla::Config::Common; use Bugzilla::Group; @@ -55,7 +57,15 @@ sub get_param_list { default => 'editbugs', checker => \&check_group }, - + + { + name => 'comment_taggers_group', + type => 's', + choices => \&_get_all_group_names, + default => 'editbugs', + checker => \&check_comment_taggers_group + }, + { name => 'debug_group', type => 's', @@ -74,6 +84,12 @@ sub get_param_list { name => 'strict_isolation', type => 'b', default => 0 + }, + + { + name => 'or_groups', + type => 'b', + default => 0 } ); return @param_list; } @@ -83,4 +99,5 @@ sub _get_all_group_names { unshift(@group_names, ''); return \@group_names; } + 1; diff --git a/Bugzilla/Config/LDAP.pm b/Bugzilla/Config/LDAP.pm index daa7f72bb..0bc8240df 100644 --- a/Bugzilla/Config/LDAP.pm +++ b/Bugzilla/Config/LDAP.pm @@ -7,7 +7,9 @@ package Bugzilla::Config::LDAP; +use 5.10.1; use strict; +use warnings; use Bugzilla::Config::Common; diff --git a/Bugzilla/Config/MTA.pm b/Bugzilla/Config/MTA.pm index e6e9505a3..467bdab3f 100644 --- a/Bugzilla/Config/MTA.pm +++ b/Bugzilla/Config/MTA.pm @@ -7,16 +7,11 @@ package Bugzilla::Config::MTA; +use 5.10.1; use strict; +use warnings; use Bugzilla::Config::Common; -# Return::Value 1.666002 pollutes the error log with warnings about this -# deprecated module. We have to set NO_CLUCK = 1 before loading Email::Send -# to disable these warnings. -BEGIN { - $Return::Value::NO_CLUCK = 1; -} -use Email::Send; our $sortkey = 1200; @@ -26,9 +21,7 @@ sub get_param_list { { name => 'mail_delivery_method', type => 's', - # Bugzilla is not ready yet to send mails to newsgroups, and 'IO' - # is of no use for now as we already have our own 'Test' mode. - choices => [grep {$_ ne 'NNTP' && $_ ne 'IO'} Email::Send->new()->all_mailers(), 'None'], + choices => ['Sendmail', 'SMTP', 'Test', 'None'], default => 'Sendmail', checker => \&check_mail_delivery_method }, diff --git a/Bugzilla/Config/Memcached.pm b/Bugzilla/Config/Memcached.pm new file mode 100644 index 000000000..292803d86 --- /dev/null +++ b/Bugzilla/Config/Memcached.pm @@ -0,0 +1,33 @@ +# 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::Config::Memcached; + +use 5.10.1; +use strict; +use warnings; + +use Bugzilla::Config::Common; + +our $sortkey = 1550; + +sub get_param_list { + return ( + { + name => 'memcached_servers', + type => 't', + default => '' + }, + { + name => 'memcached_namespace', + type => 't', + default => 'bugzilla:', + }, + ); +} + +1; diff --git a/Bugzilla/Config/PatchViewer.pm b/Bugzilla/Config/PatchViewer.pm deleted file mode 100644 index 08e8028f3..000000000 --- a/Bugzilla/Config/PatchViewer.pm +++ /dev/null @@ -1,51 +0,0 @@ -# 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::Config::PatchViewer; - -use strict; - -use Bugzilla::Config::Common; - -our $sortkey = 1300; - -sub get_param_list { - my $class = shift; - my @param_list = ( - { - name => 'cvsroot', - type => 't', - default => '', - }, - - { - name => 'cvsroot_get', - type => 't', - default => '', - }, - - { - name => 'bonsai_url', - type => 't', - default => '' - }, - - { - name => 'lxr_url', - type => 't', - default => '' - }, - - { - name => 'lxr_root', - type => 't', - default => '', - } ); - return @param_list; -} - -1; diff --git a/Bugzilla/Config/Query.pm b/Bugzilla/Config/Query.pm index fe54d67ab..f18bb90df 100644 --- a/Bugzilla/Config/Query.pm +++ b/Bugzilla/Config/Query.pm @@ -7,7 +7,9 @@ package Bugzilla::Config::Query; +use 5.10.1; use strict; +use warnings; use Bugzilla::Config::Common; @@ -25,13 +27,6 @@ sub get_param_list { }, { - name => 'mostfreqthreshold', - type => 't', - default => '2', - checker => \&check_numeric - }, - - { name => 'mybugstemplate', type => 't', default => 'buglist.cgi?resolution=---&emailassigned_to1=1&emailreporter1=1&emailtype1=exact&email1=%userid%' diff --git a/Bugzilla/Config/RADIUS.pm b/Bugzilla/Config/RADIUS.pm index 312be1ded..8e30b07a9 100644 --- a/Bugzilla/Config/RADIUS.pm +++ b/Bugzilla/Config/RADIUS.pm @@ -7,7 +7,9 @@ package Bugzilla::Config::RADIUS; +use 5.10.1; use strict; +use warnings; use Bugzilla::Config::Common; diff --git a/Bugzilla/Config/ShadowDB.pm b/Bugzilla/Config/ShadowDB.pm index c0ff59096..5dbbb5202 100644 --- a/Bugzilla/Config/ShadowDB.pm +++ b/Bugzilla/Config/ShadowDB.pm @@ -7,7 +7,9 @@ package Bugzilla::Config::ShadowDB; +use 5.10.1; use strict; +use warnings; use Bugzilla::Config::Common; diff --git a/Bugzilla/Config/UserMatch.pm b/Bugzilla/Config/UserMatch.pm index 5b98a25ea..3f74a7c44 100644 --- a/Bugzilla/Config/UserMatch.pm +++ b/Bugzilla/Config/UserMatch.pm @@ -7,7 +7,9 @@ package Bugzilla::Config::UserMatch; +use 5.10.1; use strict; +use warnings; use Bugzilla::Config::Common; diff --git a/Bugzilla/Constants.pm b/Bugzilla/Constants.pm index 2530c4ceb..7d30d7544 100644 --- a/Bugzilla/Constants.pm +++ b/Bugzilla/Constants.pm @@ -6,8 +6,12 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Constants; + +use 5.10.1; use strict; -use base qw(Exporter); +use warnings; + +use parent qw(Exporter); # For bz_locations use File::Basename; @@ -15,12 +19,15 @@ use Memoize; @Bugzilla::Constants::EXPORT = qw( BUGZILLA_VERSION + REST_DOC REMOTE_FILE LOCAL_FILE bz_locations + CONCATENATE_ASSETS + IS_NULL NOT_NULL @@ -66,6 +73,9 @@ use Memoize; COMMENT_COLS MAX_COMMENT_LENGTH + MIN_COMMENT_TAG_LENGTH + MAX_COMMENT_TAG_LENGTH + CMT_NORMAL CMT_DUPE_OF CMT_HAS_DUPE @@ -101,9 +111,12 @@ use Memoize; FIELD_TYPE_MULTI_SELECT FIELD_TYPE_TEXTAREA FIELD_TYPE_DATETIME + FIELD_TYPE_DATE FIELD_TYPE_BUG_ID FIELD_TYPE_BUG_URLS FIELD_TYPE_KEYWORDS + FIELD_TYPE_INTEGER + FIELD_TYPE_HIGHEST_PLUS_ONE EMPTY_DATETIME_REGEX @@ -117,12 +130,14 @@ use Memoize; USAGE_MODE_EMAIL USAGE_MODE_JSON USAGE_MODE_TEST + USAGE_MODE_REST ERROR_MODE_WEBPAGE ERROR_MODE_DIE ERROR_MODE_DIE_SOAP_FAULT ERROR_MODE_JSON_RPC ERROR_MODE_TEST + ERROR_MODE_REST COLOR_ERROR COLOR_SUCCESS @@ -162,6 +177,7 @@ use Memoize; MAX_POSSIBLE_DUPLICATES MAX_ATTACH_FILENAME_LENGTH MAX_QUIP_LENGTH + MAX_WEBDOT_BUGS PASSWORD_DIGEST_ALGORITHM PASSWORD_SALT_LENGTH @@ -175,6 +191,8 @@ use Memoize; AUDIT_CREATE AUDIT_REMOVE + + MOST_FREQUENT_THRESHOLD ); @Bugzilla::Constants::EXPORT_OK = qw(contenttypes); @@ -182,12 +200,21 @@ use Memoize; # CONSTANTS # # Bugzilla version -use constant BUGZILLA_VERSION => "4.4.9"; +use constant BUGZILLA_VERSION => "5.0"; + +# A base link to the current REST Documentation. We place it here +# as it will need to be updated to whatever the current release is. +use constant REST_DOC => "http://www.bugzilla.org/docs/tip/en/html/api/"; # Location of the remote and local XML files to track new releases. use constant REMOTE_FILE => 'http://updates.bugzilla.org/bugzilla-update.xml'; use constant LOCAL_FILE => 'bugzilla-update.xml'; # Relative to datadir. +# When true CSS and JavaScript assets will be concatanted and minified at +# run-time, to reduce the number of requests required to render a page. +# Setting this to a false value can help debugging. +use constant CONCATENATE_ASSETS => 1; + # These are unique values that are unlikely to match a string or a number, # to be used in criteria for match() functions and other things. They start # and end with spaces because most Bugzilla stuff has trim() called on it, @@ -283,6 +310,10 @@ use constant COMMENT_COLS => 80; # Used in _check_comment(). Gives the max length allowed for a comment. use constant MAX_COMMENT_LENGTH => 16384; +# The minimum and maximum length of comment tags. +use constant MIN_COMMENT_TAG_LENGTH => 3; +use constant MAX_COMMENT_TAG_LENGTH => 24; + # The type of bug comments. use constant CMT_NORMAL => 0; use constant CMT_DUPE_OF => 1; @@ -382,6 +413,11 @@ use constant FIELD_TYPE_DATETIME => 5; use constant FIELD_TYPE_BUG_ID => 6; use constant FIELD_TYPE_BUG_URLS => 7; use constant FIELD_TYPE_KEYWORDS => 8; +use constant FIELD_TYPE_DATE => 9; +use constant FIELD_TYPE_INTEGER => 10; +# Add new field types above this line, and change the below value in the +# obvious fashion +use constant FIELD_TYPE_HIGHEST_PLUS_ONE => 11; use constant EMPTY_DATETIME_REGEX => qr/^[0\-:\sA-Za-z]+$/; @@ -396,8 +432,7 @@ use constant ABNORMAL_SELECTS => { # The fields from fielddefs that are blocked from non-timetracking users. # work_time is sometimes called actual_time. use constant TIMETRACKING_FIELDS => - qw(estimated_time remaining_time work_time actual_time - percentage_complete deadline); + qw(estimated_time remaining_time work_time actual_time percentage_complete); # The maximum number of days a token will remain valid. use constant MAX_TOKEN_AGE => 3; @@ -412,8 +447,8 @@ use constant MAX_LOGIN_ATTEMPTS => 5; # account is locked. use constant LOGIN_LOCKOUT_INTERVAL => 30; -# The time in minutes a user must wait before he can request another email to -# create a new account or change his password. +# The time in minutes a user must wait before they can request another email to +# create a new account or change their password. use constant ACCOUNT_CHANGE_INTERVAL => 10; # The maximum number of seconds the Strict-Transport-Security header @@ -450,6 +485,7 @@ use constant USAGE_MODE_XMLRPC => 2; use constant USAGE_MODE_EMAIL => 3; use constant USAGE_MODE_JSON => 4; use constant USAGE_MODE_TEST => 5; +use constant USAGE_MODE_REST => 6; # Error modes. Default set by Bugzilla->usage_mode (so ERROR_MODE_WEBPAGE # usually). Use with Bugzilla->error_mode. @@ -458,6 +494,7 @@ use constant ERROR_MODE_DIE => 1; use constant ERROR_MODE_DIE_SOAP_FAULT => 2; use constant ERROR_MODE_JSON_RPC => 3; use constant ERROR_MODE_TEST => 4; +use constant ERROR_MODE_REST => 5; # The ANSI colors of messages that command-line scripts use use constant COLOR_ERROR => 'red'; @@ -562,13 +599,16 @@ use constant MAX_ATTACH_FILENAME_LENGTH => 255; # Maximum length of a quip. use constant MAX_QUIP_LENGTH => 512; +# Maximum number of bugs to display in a dependency graph +use constant MAX_WEBDOT_BUGS => 2000; + # This is the name of the algorithm used to hash passwords before storing # them in the database. This can be any string that is valid to pass to # Perl's "Digest" module. Note that if you change this, it won't take -# effect until a user changes his password. +# effect until a user logs in or changes their password. use constant PASSWORD_DIGEST_ALGORITHM => 'SHA-256'; -# How long of a salt should we use? Note that if you change this, none -# of your users will be able to log in until they reset their passwords. +# How long of a salt should we use? Note that if you change this, it +# won't take effect until a user logs in or changes their password. use constant PASSWORD_SALT_LENGTH => 8; # Certain scripts redirect to GET even if the form was submitted originally @@ -577,7 +617,7 @@ use constant PASSWORD_SALT_LENGTH => 8; # See http://support.microsoft.com/kb/208427 for why MSIE is different use constant CGI_URI_LIMIT => ($ENV{'HTTP_USER_AGENT'} || '') =~ /MSIE/ ? 2083 : 8000; -# If the user isn't allowed to change a field, we must tell him who can. +# If the user isn't allowed to change a field, we must tell them who can. # We store the required permission set into the $PrivilegesRequired # variable which gets passed to the error template. @@ -591,6 +631,10 @@ use constant PRIVILEGES_REQUIRED_EMPOWERED => 3; use constant AUDIT_CREATE => '__create__'; use constant AUDIT_REMOVE => '__remove__'; +# The minimum number of duplicates a bug needs to show up +# on the "Most frequently reported bugs" page. +use constant MOST_FREQUENT_THRESHOLD => 2; + sub bz_locations { # Force memoize() to re-compute data per project, to avoid # sharing the same data across different installations. @@ -651,6 +695,7 @@ sub _bz_locations { # The script should really generate these graphs directly... 'webdotdir' => "$datadir/webdot", 'extensionsdir' => "$libpath/extensions", + 'assetsdir' => "$datadir/assets", }; } @@ -659,3 +704,15 @@ sub _bz_locations { BEGIN { memoize('_bz_locations') }; 1; + +=head1 B<Methods in need of POD> + +=over + +=item DB_MODULE + +=item contenttypes + +=item bz_locations + +=back diff --git a/Bugzilla/DB.pm b/Bugzilla/DB.pm index 248312e12..c9eaf6e9e 100644 --- a/Bugzilla/DB.pm +++ b/Bugzilla/DB.pm @@ -7,20 +7,24 @@ package Bugzilla::DB; +use 5.10.1; use strict; +use warnings; use DBI; # Inherit the DB class from DBI::db. -use base qw(DBI::db); +use parent -norequire, qw(DBI::db); use Bugzilla::Constants; +use Bugzilla::Mailer; use Bugzilla::Install::Requirements; -use Bugzilla::Install::Util qw(vers_cmp install_string); +use Bugzilla::Install::Util qw(install_string); use Bugzilla::Install::Localconfig; use Bugzilla::Util; use Bugzilla::Error; use Bugzilla::DB::Schema; +use Bugzilla::Version; use List::Util qw(max); use Storable qw(dclone); @@ -1210,12 +1214,13 @@ sub bz_start_transaction { sub bz_commit_transaction { my ($self) = @_; - + if ($self->{private_bz_transaction_count} > 1) { $self->{private_bz_transaction_count}--; } elsif ($self->bz_in_transaction) { $self->commit(); $self->{private_bz_transaction_count} = 0; + Bugzilla::Mailer->send_staged_mail(); } else { ThrowCodeError('not_in_transaction'); } @@ -1251,11 +1256,9 @@ sub db_new { ShowErrorStatement => 1, HandleError => \&_handle_error, TaintIn => 1, - FetchHashKeyName => 'NAME', - # Note: NAME_lc causes crash on ActiveState Perl - # 5.8.4 (see Bug 253696) - # XXX - This will likely cause problems in DB - # back ends that twiddle column case (Oracle?) + # See https://rt.perl.org/rt3/Public/Bug/Display.html?id=30933 + # for the reason to use NAME instead of NAME_lc (bug 253696). + FetchHashKeyName => 'NAME', }; if ($override_attrs) { @@ -1365,14 +1368,19 @@ sub _bz_real_schema { my ($self) = @_; return $self->{private_real_schema} if exists $self->{private_real_schema}; - my ($data, $version) = $self->selectrow_array( - "SELECT schema_data, version FROM bz_schema"); + my $bz_schema; + unless ($bz_schema = Bugzilla->memcached->get({ key => 'bz_schema' })) { + $bz_schema = $self->selectrow_arrayref( + "SELECT schema_data, version FROM bz_schema" + ); + Bugzilla->memcached->set({ key => 'bz_schema', value => $bz_schema }); + } (die "_bz_real_schema tried to read the bz_schema table but it's empty!") - if !$data; + if !$bz_schema; - $self->{private_real_schema} = - $self->_bz_schema->deserialize_abstract($data, $version); + $self->{private_real_schema} = + $self->_bz_schema->deserialize_abstract($bz_schema->[0], $bz_schema->[1]); return $self->{private_real_schema}; } @@ -1414,6 +1422,8 @@ sub _bz_store_real_schema { $sth->bind_param(1, $store_me, $self->BLOB_TYPE); $sth->bind_param(2, $schema_version); $sth->execute(); + + Bugzilla->memcached->clear({ key => 'bz_schema' }); } # For bz_populate_enum_tables @@ -2685,3 +2695,63 @@ our check for implementation of C<new> by derived class useless. L<DBI> L<Bugzilla::Constants/DB_MODULE> + +=head1 B<Methods in need of POD> + +=over + +=item bz_add_fks + +=item bz_add_fk + +=item bz_drop_index_raw + +=item bz_table_info + +=item bz_add_index_raw + +=item bz_get_related_fks + +=item quote + +=item bz_drop_fk + +=item bz_drop_field_tables + +=item bz_drop_related_fks + +=item bz_table_columns + +=item bz_drop_foreign_keys + +=item bz_alter_column_raw + +=item bz_table_list_real + +=item bz_fk_info + +=item bz_setup_database + +=item bz_setup_foreign_keys + +=item bz_table_indexes + +=item bz_check_regexp + +=item bz_enum_initial_values + +=item bz_alter_fk + +=item bz_set_next_serial_value + +=item bz_table_list + +=item bz_table_columns_real + +=item bz_check_server_version + +=item bz_server_version + +=item bz_add_field_tables + +=back diff --git a/Bugzilla/DB/Mysql.pm b/Bugzilla/DB/Mysql.pm index dc93b7406..d0915f1e6 100644 --- a/Bugzilla/DB/Mysql.pm +++ b/Bugzilla/DB/Mysql.pm @@ -20,8 +20,12 @@ For interface details see L<Bugzilla::DB> and L<DBI>. =cut package Bugzilla::DB::Mysql; + +use 5.10.1; use strict; -use base qw(Bugzilla::DB); +use warnings; + +use parent qw(Bugzilla::DB); use Bugzilla::Constants; use Bugzilla::Install::Util qw(install_string); @@ -55,6 +59,18 @@ sub new { mysql_auto_reconnect => 1, ); + # MySQL SSL options + my ($ssl_ca_file, $ssl_ca_path, $ssl_cert, $ssl_key) = + @$params{qw(db_mysql_ssl_ca_file db_mysql_ssl_ca_path + db_mysql_ssl_client_cert db_mysql_ssl_client_key)}; + if ($ssl_ca_file || $ssl_ca_path || $ssl_cert || $ssl_key) { + $attrs{'mysql_ssl'} = 1; + $attrs{'mysql_ssl_ca_file'} = $ssl_ca_file if $ssl_ca_file; + $attrs{'mysql_ssl_ca_path'} = $ssl_ca_path if $ssl_ca_path; + $attrs{'mysql_ssl_client_cert'} = $ssl_cert if $ssl_cert; + $attrs{'mysql_ssl_client_key'} = $ssl_key if $ssl_key; + } + my $self = $class->db_new({ dsn => $dsn, user => $user, pass => $pass, attrs => \%attrs }); @@ -111,10 +127,13 @@ sub bz_last_key { } sub sql_group_concat { - my ($self, $column, $separator, $sort) = @_; + my ($self, $column, $separator, $sort, $order_by) = @_; $separator = $self->quote(', ') if !defined $separator; $sort = 1 if !defined $sort; - if ($sort) { + if ($order_by) { + $column .= " ORDER BY $order_by"; + } + elsif ($sort) { my $sort_order = $column; $sort_order =~ s/^DISTINCT\s+//i; $column = "$column ORDER BY $sort_order"; @@ -165,15 +184,19 @@ sub sql_fulltext_search { if ($text =~ /(?:^|\W)[+\-<>~"()]/ || $text =~ /[()"*](?:$|\W)/) { $mode = 'IN BOOLEAN MODE'; - # quote un-quoted compound words - my @words = quotewords('[\s()]+', 'delimiters', $text); - foreach my $word (@words) { - # match words that have non-word chars in the middle of them - if ($word =~ /\w\W+\w/ && $word !~ m/"/) { - $word = '"' . $word . '"'; + my @terms = split(quotemeta(FULLTEXT_OR), $text); + foreach my $term (@terms) { + # quote un-quoted compound words + my @words = quotewords('[\s()]+', 'delimiters', $term); + foreach my $word (@words) { + # match words that have non-word chars in the middle of them + if ($word =~ /\w\W+\w/ && $word !~ m/"/) { + $word = '"' . $word . '"'; + } } + $term = join('', @words); } - $text = join('', @words); + $text = join(FULLTEXT_OR, @terms); } # quote the text for use in the MATCH AGAINST expression @@ -1035,3 +1058,49 @@ sub _bz_build_schema_from_disk { } 1; + +=head1 B<Methods in need of POD> + +=over + +=item sql_date_format + +=item bz_explain + +=item bz_last_key + +=item sql_position + +=item sql_fulltext_search + +=item sql_iposition + +=item bz_enum_initial_values + +=item sql_group_by + +=item sql_limit + +=item sql_not_regexp + +=item sql_string_concat + +=item sql_date_math + +=item sql_to_days + +=item bz_check_server_version + +=item sql_from_days + +=item sql_regexp + +=item sql_istring + +=item sql_group_concat + +=item bz_setup_database + +=item bz_db_is_utf8 + +=back diff --git a/Bugzilla/DB/Oracle.pm b/Bugzilla/DB/Oracle.pm index 6511242dc..7424019ac 100644 --- a/Bugzilla/DB/Oracle.pm +++ b/Bugzilla/DB/Oracle.pm @@ -20,8 +20,12 @@ For interface details see L<Bugzilla::DB> and L<DBI>. =cut package Bugzilla::DB::Oracle; + +use 5.10.1; use strict; -use base qw(Bugzilla::DB); +use warnings; + +use parent qw(Bugzilla::DB); use DBD::Oracle; use DBD::Oracle qw(:ora_types); @@ -41,8 +45,6 @@ use constant BLOB_TYPE => { ora_type => ORA_BLOB }; use constant MIN_LONG_READ_LEN => 32 * 1024; use constant FULLTEXT_OR => ' OR '; -our $fulltext_label = 0; - sub new { my ($class, $params) = @_; my ($user, $pass, $host, $dbname, $port) = @@ -161,10 +163,11 @@ sub sql_from_days{ sub sql_fulltext_search { my ($self, $column, $text) = @_; + state $label = 0; $text = $self->quote($text); trick_taint($text); - $fulltext_label++; - return "CONTAINS($column,$text,$fulltext_label) > 0", "SCORE($fulltext_label)"; + $label++; + return "CONTAINS($column,$text,$label) > 0", "SCORE($label)"; } sub sql_date_format { @@ -716,7 +719,12 @@ sub _get_create_trigger_ddl { ############################################################################ package Bugzilla::DB::Oracle::st; -use base qw(DBI::st); + +use 5.10.1; +use strict; +use warnings; + +use parent -norequire, qw(DBI::st); sub fetchrow_arrayref { my $self = shift; @@ -781,3 +789,69 @@ sub fetch { return $row; } 1; + +=head1 B<Methods in need of POD> + +=over + +=item adjust_statement + +=item bz_check_regexp + +=item bz_drop_table + +=item bz_explain + +=item bz_last_key + +=item bz_setup_database + +=item bz_table_columns_real + +=item bz_table_list_real + +=item do + +=item prepare + +=item prepare_cached + +=item quote_identifier + +=item selectall_arrayref + +=item selectall_hashref + +=item selectcol_arrayref + +=item selectrow_array + +=item selectrow_arrayref + +=item selectrow_hashref + +=item sql_date_format + +=item sql_date_math + +=item sql_from_days + +=item sql_fulltext_search + +=item sql_group_concat + +=item sql_in + +=item sql_limit + +=item sql_not_regexp + +=item sql_position + +=item sql_regexp + +=item sql_string_concat + +=item sql_to_days + +=back diff --git a/Bugzilla/DB/Pg.pm b/Bugzilla/DB/Pg.pm index cd5fed581..a950c575f 100644 --- a/Bugzilla/DB/Pg.pm +++ b/Bugzilla/DB/Pg.pm @@ -21,13 +21,16 @@ For interface details see L<Bugzilla::DB> and L<DBI>. package Bugzilla::DB::Pg; +use 5.10.1; use strict; +use warnings; use Bugzilla::Error; +use Bugzilla::Version; use DBD::Pg; # This module extends the DB interface via inheritance -use base qw(Bugzilla::DB); +use parent qw(Bugzilla::DB); use constant BLOB_TYPE => { pg_type => DBD::Pg::PG_BYTEA }; @@ -78,14 +81,37 @@ sub bz_last_key { } sub sql_group_concat { - my ($self, $text, $separator, $sort) = @_; + my ($self, $text, $separator, $sort, $order_by) = @_; $sort = 1 if !defined $sort; $separator = $self->quote(', ') if !defined $separator; - my $sql = "array_accum($text)"; - if ($sort) { - $sql = "array_sort($sql)"; + + # PostgreSQL 8.x doesn't support STRING_AGG + if (vers_cmp($self->bz_server_version, 9) < 0) { + my $sql = "ARRAY_ACCUM($text)"; + if ($sort) { + $sql = "ARRAY_SORT($sql)"; + } + return "ARRAY_TO_STRING($sql, $separator)"; + } + + if ($order_by && $text =~ /^DISTINCT\s*(.+)$/i) { + # Since Postgres (quite rightly) doesn't support "SELECT DISTINCT x + # ORDER BY y", we need to sort the list, and then get the unique + # values + return "ARRAY_TO_STRING(ANYARRAY_UNIQ(ARRAY_AGG($1 ORDER BY $order_by)), $separator)"; } - return "array_to_string($sql, $separator)"; + + # Determine the ORDER BY clause (if any) + if ($order_by) { + $order_by = " ORDER BY $order_by"; + } + elsif ($sort) { + # We don't include the DISTINCT keyword in an order by + $text =~ /^(?:DISTINCT\s*)?(.+)$/i; + $order_by = " ORDER BY $1"; + } + + return "STRING_AGG(${text}::text, $separator${order_by}::text)" } sub sql_istring { @@ -209,21 +235,25 @@ sub bz_setup_database { my $self = shift; $self->SUPER::bz_setup_database(@_); - # Custom Functions - my $function = 'array_accum'; - my $array_accum = $self->selectrow_array( - 'SELECT 1 FROM pg_proc WHERE proname = ?', undef, $function); - if (!$array_accum) { - print "Creating function $function...\n"; - $self->do("CREATE AGGREGATE array_accum ( - SFUNC = array_append, - BASETYPE = anyelement, - STYPE = anyarray, - INITCOND = '{}' - )"); - } + my ($has_plpgsql) = $self->selectrow_array("SELECT COUNT(*) FROM pg_language WHERE lanname = 'plpgsql'"); + $self->do('CREATE LANGUAGE plpgsql') unless $has_plpgsql; + + if (vers_cmp($self->bz_server_version, 9) < 0) { + # Custom Functions for Postgres 8 + my $function = 'array_accum'; + my $array_accum = $self->selectrow_array( + 'SELECT 1 FROM pg_proc WHERE proname = ?', undef, $function); + if (!$array_accum) { + print "Creating function $function...\n"; + $self->do("CREATE AGGREGATE array_accum ( + SFUNC = array_append, + BASETYPE = anyelement, + STYPE = anyarray, + INITCOND = '{}' + )"); + } - $self->do(<<'END'); + $self->do(<<'END'); CREATE OR REPLACE FUNCTION array_sort(ANYARRAY) RETURNS ANYARRAY LANGUAGE SQL IMMUTABLE STRICT @@ -236,6 +266,57 @@ SELECT ARRAY( ); $$; END + } + else { + # Custom functions for Postgres 9.0+ + + # -Copyright © 2013 Joshua D. Burns (JDBurnZ) and Message In Action LLC + # JDBurnZ: https://github.com/JDBurnZ + # Message In Action: https://www.messageinaction.com + # + #Permission is hereby granted, free of charge, to any person obtaining a copy of + #this software and associated documentation files (the "Software"), to deal in + #the Software without restriction, including without limitation the rights to + #use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + #the Software, and to permit persons to whom the Software is furnished to do so, + #subject to the following conditions: + # + #The above copyright notice and this permission notice shall be included in all + #copies or substantial portions of the Software. + # + #THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + #IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + #FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + #COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + #IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + #CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + $self->do(q| + DROP FUNCTION IF EXISTS anyarray_uniq(anyarray); + CREATE OR REPLACE FUNCTION anyarray_uniq(with_array anyarray) + RETURNS anyarray AS $BODY$ + DECLARE + -- The variable used to track iteration over "with_array". + loop_offset integer; + + -- The array to be returned by this function. + return_array with_array%TYPE := '{}'; + BEGIN + IF with_array IS NULL THEN + return NULL; + END IF; + + -- Iterate over each element in "concat_array". + FOR loop_offset IN ARRAY_LOWER(with_array, 1)..ARRAY_UPPER(with_array, 1) LOOP + IF NOT with_array[loop_offset] = ANY(return_array) THEN + return_array = ARRAY_APPEND(return_array, with_array[loop_offset]); + END IF; + END LOOP; + + RETURN return_array; + END; + $BODY$ LANGUAGE plpgsql; + |); + } # PostgreSQL doesn't like having *any* index on the thetext # field, because it can't have index data longer than 2770 @@ -366,3 +447,43 @@ sub bz_table_list_real { } 1; + +=head1 B<Methods in need of POD> + +=over + +=item sql_date_format + +=item bz_explain + +=item bz_sequence_exists + +=item bz_last_key + +=item sql_position + +=item sql_limit + +=item sql_not_regexp + +=item sql_string_concat + +=item sql_date_math + +=item sql_to_days + +=item bz_check_server_version + +=item sql_from_days + +=item bz_table_list_real + +=item sql_regexp + +=item sql_istring + +=item sql_group_concat + +=item bz_setup_database + +=back diff --git a/Bugzilla/DB/Schema.pm b/Bugzilla/DB/Schema.pm index 80c57a3df..d1c1dc7e9 100644 --- a/Bugzilla/DB/Schema.pm +++ b/Bugzilla/DB/Schema.pm @@ -15,7 +15,10 @@ package Bugzilla::DB::Schema; # ########################################################################### +use 5.10.1; use strict; +use warnings; + use Bugzilla::Error; use Bugzilla::Hook; use Bugzilla::Util; @@ -252,7 +255,7 @@ use constant ABSTRACT_SCHEMA => { REFERENCES => {TABLE => 'profiles', COLUMN => 'userid'}}, version => {TYPE => 'varchar(64)', NOTNULL => 1}, - component_id => {TYPE => 'INT2', NOTNULL => 1, + component_id => {TYPE => 'INT3', NOTNULL => 1, REFERENCES => {TABLE => 'components', COLUMN => 'id'}}, resolution => {TYPE => 'varchar(64)', @@ -275,11 +278,8 @@ use constant ABSTRACT_SCHEMA => { remaining_time => {TYPE => 'decimal(7,2)', NOTNULL => 1, DEFAULT => '0'}, deadline => {TYPE => 'DATETIME'}, - alias => {TYPE => 'varchar(20)'}, ], INDEXES => [ - bugs_alias_idx => {FIELDS => ['alias'], - TYPE => 'UNIQUE'}, bugs_assigned_to_idx => ['assigned_to'], bugs_creation_ts_idx => ['creation_ts'], bugs_delta_ts_idx => ['delta_ts'], @@ -356,6 +356,21 @@ use constant ABSTRACT_SCHEMA => { ], }, + bugs_aliases => { + FIELDS => [ + alias => {TYPE => 'varchar(40)', NOTNULL => 1}, + bug_id => {TYPE => 'INT3', + REFERENCES => {TABLE => 'bugs', + COLUMN => 'bug_id', + DELETE => 'CASCADE'}}, + ], + INDEXES => [ + bugs_aliases_bug_id_idx => ['bug_id'], + bugs_aliases_alias_idx => {FIELDS => ['alias'], + TYPE => 'UNIQUE'}, + ], + }, + cc => { FIELDS => [ bug_id => {TYPE => 'INT3', NOTNULL => 1, @@ -404,6 +419,54 @@ use constant ABSTRACT_SCHEMA => { ], }, + longdescs_tags => { + FIELDS => [ + id => { TYPE => 'MEDIUMSERIAL', NOTNULL => 1, PRIMARYKEY => 1 }, + comment_id => { TYPE => 'INT4', + REFERENCES => { TABLE => 'longdescs', + COLUMN => 'comment_id', + DELETE => 'CASCADE' }}, + tag => { TYPE => 'varchar(24)', NOTNULL => 1 }, + ], + INDEXES => [ + longdescs_tags_idx => { FIELDS => ['comment_id', 'tag'], TYPE => 'UNIQUE' }, + ], + }, + + longdescs_tags_weights => { + FIELDS => [ + id => { TYPE => 'MEDIUMSERIAL', NOTNULL => 1, PRIMARYKEY => 1 }, + tag => { TYPE => 'varchar(24)', NOTNULL => 1 }, + weight => { TYPE => 'INT3', NOTNULL => 1 }, + ], + INDEXES => [ + longdescs_tags_weights_tag_idx => { FIELDS => ['tag'], TYPE => 'UNIQUE' }, + ], + }, + + longdescs_tags_activity => { + FIELDS => [ + id => { TYPE => 'MEDIUMSERIAL', NOTNULL => 1, PRIMARYKEY => 1 }, + bug_id => { TYPE => 'INT3', NOTNULL => 1, + REFERENCES => { TABLE => 'bugs', + COLUMN => 'bug_id', + DELETE => 'CASCADE' }}, + comment_id => { TYPE => 'INT4', + REFERENCES => { TABLE => 'longdescs', + COLUMN => 'comment_id', + DELETE => 'CASCADE' }}, + who => { TYPE => 'INT3', NOTNULL => 1, + REFERENCES => { TABLE => 'profiles', + COLUMN => 'userid' }}, + bug_when => { TYPE => 'DATETIME', NOTNULL => 1 }, + added => { TYPE => 'varchar(24)' }, + removed => { TYPE => 'varchar(24)' }, + ], + INDEXES => [ + longdescs_tags_activity_bug_id_idx => ['bug_id'], + ], + }, + dependencies => { FIELDS => [ blocked => {TYPE => 'INT3', NOTNULL => 1, @@ -632,7 +695,7 @@ use constant ABSTRACT_SCHEMA => { REFERENCES => {TABLE => 'products', COLUMN => 'id', DELETE => 'CASCADE'}}, - component_id => {TYPE => 'INT2', + component_id => {TYPE => 'INT3', REFERENCES => {TABLE => 'components', COLUMN => 'id', DELETE => 'CASCADE'}}, @@ -653,7 +716,7 @@ use constant ABSTRACT_SCHEMA => { REFERENCES => {TABLE => 'products', COLUMN => 'id', DELETE => 'CASCADE'}}, - component_id => {TYPE => 'INT2', + component_id => {TYPE => 'INT3', REFERENCES => {TABLE => 'components', COLUMN => 'id', DELETE => 'CASCADE'}}, @@ -943,6 +1006,23 @@ use constant ABSTRACT_SCHEMA => { ], }, + email_bug_ignore => { + FIELDS => [ + user_id => {TYPE => 'INT3', NOTNULL => 1, + REFERENCES => {TABLE => 'profiles', + COLUMN => 'userid', + DELETE => 'CASCADE'}}, + bug_id => {TYPE => 'INT3', NOTNULL => 1, + REFERENCES => {TABLE => 'bugs', + COLUMN => 'bug_id', + DELETE => 'CASCADE'}}, + ], + INDEXES => [ + email_bug_ignore_user_id_idx => {FIELDS => [qw(user_id bug_id)], + TYPE => 'UNIQUE'}, + ], + }, + watch => { FIELDS => [ watcher => {TYPE => 'INT3', NOTNULL => 1, @@ -1050,7 +1130,7 @@ use constant ABSTRACT_SCHEMA => { REFERENCES => {TABLE => 'profiles', COLUMN => 'userid', DELETE => 'CASCADE'}}, - component_id => {TYPE => 'INT2', NOTNULL => 1, + component_id => {TYPE => 'INT3', NOTNULL => 1, REFERENCES => {TABLE => 'components', COLUMN => 'id', DELETE => 'CASCADE'}}, @@ -1110,7 +1190,7 @@ use constant ABSTRACT_SCHEMA => { issuedate => {TYPE => 'DATETIME', NOTNULL => 1} , token => {TYPE => 'varchar(16)', NOTNULL => 1, PRIMARYKEY => 1}, - tokentype => {TYPE => 'varchar(8)', NOTNULL => 1} , + tokentype => {TYPE => 'varchar(16)', NOTNULL => 1} , eventdata => {TYPE => 'TINYTEXT'}, ], INDEXES => [ @@ -1328,7 +1408,7 @@ use constant ABSTRACT_SCHEMA => { components => { FIELDS => [ - id => {TYPE => 'SMALLSERIAL', NOTNULL => 1, + id => {TYPE => 'MEDIUMSERIAL', NOTNULL => 1, PRIMARYKEY => 1}, name => {TYPE => 'varchar(64)', NOTNULL => 1}, product_id => {TYPE => 'INT2', NOTNULL => 1, @@ -1549,6 +1629,16 @@ use constant ABSTRACT_SCHEMA => { ], }, + # BUGMAIL + # ------- + + mail_staging => { + FIELDS => [ + id => {TYPE => 'INTSERIAL', PRIMARYKEY => 1, NOTNULL => 1}, + message => {TYPE => 'LONGBLOB', NOTNULL => 1}, + ], + }, + # THESCHWARTZ TABLES # ------------------ # Note: In the standard TheSchwartz schema, most integers are unsigned, @@ -1646,6 +1736,46 @@ use constant ABSTRACT_SCHEMA => { ], }, + bug_user_last_visit => { + FIELDS => [ + id => {TYPE => 'INTSERIAL', NOTNULL => 1, + PRIMARYKEY => 1}, + user_id => {TYPE => 'INT3', NOTNULL => 1, + REFERENCES => {TABLE => 'profiles', + COLUMN => 'userid', + DELETE => 'CASCADE'}}, + bug_id => {TYPE => 'INT3', NOTNULL => 1, + REFERENCES => {TABLE => 'bugs', + COLUMN => 'bug_id', + DELETE => 'CASCADE'}}, + last_visit_ts => {TYPE => 'DATETIME', NOTNULL => 1}, + ], + INDEXES => [ + bug_user_last_visit_idx => {FIELDS => ['user_id', 'bug_id'], + TYPE => 'UNIQUE'}, + bug_user_last_visit_last_visit_ts_idx => ['last_visit_ts'], + ], + }, + + user_api_keys => { + FIELDS => [ + id => {TYPE => 'INTSERIAL', NOTNULL => 1, + PRIMARYKEY => 1}, + user_id => {TYPE => 'INT3', NOTNULL => 1, + REFERENCES => {TABLE => 'profiles', + COLUMN => 'userid', + DELETE => 'CASCADE'}}, + api_key => {TYPE => 'VARCHAR(40)', NOTNULL => 1}, + description => {TYPE => 'VARCHAR(255)'}, + revoked => {TYPE => 'BOOLEAN', NOTNULL => 1, + DEFAULT => 'FALSE'}, + last_used => {TYPE => 'DATETIME'}, + ], + INDEXES => [ + user_api_keys_api_key_idx => {FIELDS => ['api_key'], TYPE => 'UNIQUE'}, + user_api_keys_user_id_idx => ['user_id'], + ], + }, }; # Foreign Keys are added in Bugzilla::DB::bz_add_field_tables @@ -3011,3 +3141,19 @@ L<Bugzilla::DB> L<http://www.bugzilla.org/docs/developer.html#sql-schema> =cut + +=head1 B<Methods in need of POD> + +=over + +=item get_table_indexes_abstract + +=item get_create_database_sql + +=item get_add_fks_sql + +=item get_fk_ddl + +=item get_drop_fk_sql + +=back diff --git a/Bugzilla/DB/Schema/Mysql.pm b/Bugzilla/DB/Schema/Mysql.pm index 020549a89..0195fcb06 100644 --- a/Bugzilla/DB/Schema/Mysql.pm +++ b/Bugzilla/DB/Schema/Mysql.pm @@ -13,10 +13,13 @@ package Bugzilla::DB::Schema::Mysql; # ############################################################################### +use 5.10.1; use strict; +use warnings; + use Bugzilla::Error; -use base qw(Bugzilla::DB::Schema); +use parent qw(Bugzilla::DB::Schema); # This is for column_info_to_column, to know when a tinyint is a # boolean and when it's really a tinyint. This only has to be accurate @@ -104,7 +107,7 @@ sub _initialize { LONGBLOB => 'longblob', DATETIME => 'datetime', - + DATE => 'date', }; $self->_adjust_schema; @@ -381,3 +384,27 @@ sub get_rename_column_ddl { } 1; + +=head1 B<Methods in need of POD> + +=over + +=item get_rename_column_ddl + +=item get_create_database_sql + +=item get_drop_index_ddl + +=item get_set_serial_sql + +=item get_rename_indexes_ddl + +=item get_drop_fk_sql + +=item MYISAM_TABLES + +=item column_info_to_column + +=item get_alter_column_ddl + +=back diff --git a/Bugzilla/DB/Schema/Oracle.pm b/Bugzilla/DB/Schema/Oracle.pm index a97929726..8fb5479b1 100644 --- a/Bugzilla/DB/Schema/Oracle.pm +++ b/Bugzilla/DB/Schema/Oracle.pm @@ -13,9 +13,11 @@ package Bugzilla::DB::Schema::Oracle; # ############################################################################### +use 5.10.1; use strict; +use warnings; -use base qw(Bugzilla::DB::Schema); +use parent qw(Bugzilla::DB::Schema); use Carp qw(confess); use Bugzilla::Util; @@ -55,7 +57,7 @@ sub _initialize { LONGBLOB => 'blob', DATETIME => 'date', - + DATE => 'date', }; $self->_adjust_schema; @@ -503,3 +505,33 @@ sub get_set_serial_sql { } 1; + +=head1 B<Methods in need of POD> + +=over + +=item get_rename_column_ddl + +=item get_add_fks_sql + +=item get_drop_index_ddl + +=item get_rename_table_sql + +=item get_add_column_ddl + +=item get_set_serial_sql + +=item get_drop_column_ddl + +=item get_drop_table_ddl + +=item get_drop_fk_sql + +=item get_table_ddl + +=item get_alter_column_ddl + +=item get_fk_ddl + +=back diff --git a/Bugzilla/DB/Schema/Pg.pm b/Bugzilla/DB/Schema/Pg.pm index 3dc0fe85e..55a932272 100644 --- a/Bugzilla/DB/Schema/Pg.pm +++ b/Bugzilla/DB/Schema/Pg.pm @@ -13,8 +13,11 @@ package Bugzilla::DB::Schema::Pg; # ############################################################################### +use 5.10.1; use strict; -use base qw(Bugzilla::DB::Schema); +use warnings; + +use parent qw(Bugzilla::DB::Schema); use Storable qw(dclone); #------------------------------------------------------------------------------ @@ -64,7 +67,7 @@ sub _initialize { LONGBLOB => 'bytea', DATETIME => 'timestamp(0) without time zone', - + DATE => 'date', }; $self->_adjust_schema; @@ -186,3 +189,17 @@ sub _get_alter_type_sql { } 1; + +=head1 B<Methods in need of POD> + +=over + +=item get_rename_column_ddl + +=item get_rename_table_sql + +=item get_create_database_sql + +=item get_set_serial_sql + +=back diff --git a/Bugzilla/DB/Schema/Sqlite.pm b/Bugzilla/DB/Schema/Sqlite.pm index 4cfc2b052..ccdbfd8aa 100644 --- a/Bugzilla/DB/Schema/Sqlite.pm +++ b/Bugzilla/DB/Schema/Sqlite.pm @@ -5,9 +5,13 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -use strict; package Bugzilla::DB::Schema::Sqlite; -use base qw(Bugzilla::DB::Schema); + +use 5.10.1; +use strict; +use warnings; + +use parent qw(Bugzilla::DB::Schema); use Bugzilla::Error; use Bugzilla::Util qw(generate_random_password); @@ -43,6 +47,7 @@ sub _initialize { LONGBLOB => 'blob', DATETIME => 'DATETIME', + DATE => 'DATETIME', }; $self->_adjust_schema; @@ -296,3 +301,25 @@ sub get_drop_fk_sql { 1; + +=head1 B<Methods in need of POD> + +=over + +=item get_rename_column_ddl + +=item get_add_fks_sql + +=item get_drop_fk_sql + +=item get_create_database_sql + +=item get_alter_column_ddl + +=item get_add_column_ddl + +=item get_type_ddl + +=item get_drop_column_ddl + +=back diff --git a/Bugzilla/DB/Sqlite.pm b/Bugzilla/DB/Sqlite.pm index 47cb0cd25..ddafc1696 100644 --- a/Bugzilla/DB/Sqlite.pm +++ b/Bugzilla/DB/Sqlite.pm @@ -5,9 +5,13 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -use strict; package Bugzilla::DB::Sqlite; -use base qw(Bugzilla::DB); + +use 5.10.1; +use strict; +use warnings; + +use parent qw(Bugzilla::DB); use Bugzilla::Constants; use Bugzilla::Error; @@ -296,3 +300,39 @@ SQLite-specific implementation. It is instantiated by the Bugzilla::DB module and should never be used directly. For interface details see L<Bugzilla::DB> and L<DBI>. + +=head1 B<Methods in need of POD> + +=over + +=item sql_date_format + +=item bz_explain + +=item sql_position + +=item sql_iposition + +=item sql_group_by + +=item sql_not_regexp + +=item sql_limit + +=item sql_date_math + +=item sql_to_days + +=item sql_from_days + +=item bz_table_list_real + +=item sql_regexp + +=item sql_group_concat + +=item sql_istring + +=item bz_setup_database + +=back diff --git a/Bugzilla/Error.pm b/Bugzilla/Error.pm index 32c7715b4..ef6320d15 100644 --- a/Bugzilla/Error.pm +++ b/Bugzilla/Error.pm @@ -7,8 +7,11 @@ package Bugzilla::Error; +use 5.10.1; use strict; -use base qw(Exporter); +use warnings; + +use parent qw(Exporter); @Bugzilla::Error::EXPORT = qw(ThrowCodeError ThrowTemplateError ThrowUserError); @@ -93,7 +96,7 @@ sub _throw_error { if (Bugzilla->error_mode == ERROR_MODE_WEBPAGE) { my $cgi = Bugzilla->cgi; - $cgi->close_standby_message('text/html', 'inline'); + $cgi->close_standby_message('text/html', 'inline', 'error', 'html'); print $message; print $cgi->multipart_final() if $cgi->{_multipart_in_progress}; } @@ -104,7 +107,8 @@ sub _throw_error { die("$message\n"); } elsif (Bugzilla->error_mode == ERROR_MODE_DIE_SOAP_FAULT - || Bugzilla->error_mode == ERROR_MODE_JSON_RPC) + || Bugzilla->error_mode == ERROR_MODE_JSON_RPC + || Bugzilla->error_mode == ERROR_MODE_REST) { # Clone the hash so we aren't modifying the constant. my %error_map = %{ WS_ERROR_CODE() }; @@ -121,13 +125,20 @@ sub _throw_error { } else { my $server = Bugzilla->_json_server; + + my $status_code = 0; + if (Bugzilla->error_mode == ERROR_MODE_REST) { + my %status_code_map = %{ REST_STATUS_CODE_MAP() }; + $status_code = $status_code_map{$code} || $status_code_map{'_default'}; + } # Technically JSON-RPC isn't allowed to have error numbers # higher than 999, but we do this to avoid conflicts with # the internal JSON::RPC error codes. - $server->raise_error(code => 100000 + $code, - message => $message, - id => $server->{_bz_request_id}, - version => $server->version); + $server->raise_error(code => 100000 + $code, + status_code => $status_code, + message => $message, + id => $server->{_bz_request_id}, + version => $server->version); # Most JSON-RPC Throw*Error calls happen within an eval inside # of JSON::RPC. So, in that circumstance, instead of exiting, # we die with no message. JSON::RPC checks raise_error before @@ -182,24 +193,18 @@ sub ThrowTemplateError { my $maintainer = Bugzilla->params->{'maintainer'}; my $error = html_quote($vars->{'template_error_msg'}); my $error2 = html_quote($template->error()); + my $url = html_quote(Bugzilla->cgi->self_url); + print <<END; - <tt> <p> Bugzilla has suffered an internal error. Please save this page and send it to $maintainer with details of what you were doing at the time this message appeared. </p> - <script type="text/javascript"> <!-- - document.write("<p>URL: " + - document.location.href.replace(/&/g,"&") - .replace(/</g,"<") - .replace(/>/g,">") + "</p>"); - // --> - </script> + <p>URL: $url</p> <p>Template->process() failed twice.<br> First error: $error<br> Second error: $error2</p> - </tt> END } exit; diff --git a/Bugzilla/Extension.pm b/Bugzilla/Extension.pm index 49422eca3..e24ceb9eb 100644 --- a/Bugzilla/Extension.pm +++ b/Bugzilla/Extension.pm @@ -6,7 +6,10 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Extension; + +use 5.10.1; use strict; +use warnings; use Bugzilla::Constants; use Bugzilla::Error; @@ -238,7 +241,7 @@ F<extensions/Foo.pm>: package Bugzilla::Extension::Foo use strict; - use base qw(Bugzilla::Extension); + use parent qw(Bugzilla::Extension); our $VERSION = '0.02'; use constant NAME => 'Foo'; @@ -648,6 +651,21 @@ So, for example, if you had a CSS file called F<style.css> and your extension was called F<Foo>, your file would go into F<extensions/Foo/web/style.css>. +=head2 Documenting Extensions + +Documentation goes in F<extensions/Foo/docs/en/rst/>, if it's in English, or +change "en" to something else if it's not. The user documentation index file +must be called index-user.rst; the admin documentation must be called +index-admin.rst. These will end up in the User Guide and the Administration +Guide respectively. Both documentation types are optional. You can use various +Sphinx constructs such as :toctree: or :include: to include further reST files +if you need more than one page of docs. + +When documenting extensions to the Bugzilla API, if your extension provides +them, the index file would be F<extensions/Foo/docs/en/rst/api/v1/index.rst>. +When and if your API has more than one version, increment the version number. +These docs will get included in the WebService API Reference. + =head2 Disabling Your Extension If you want your extension to be totally ignored by Bugzilla (it will @@ -807,3 +825,13 @@ package name of the loaded extension. Calls L</load> for every enabled extension installed into Bugzilla, and returns an arrayref of all the package names that were loaded. + +=head1 B<Methods in need of POD> + +=over + +=item modify_inc + +=item my_inc + +=back diff --git a/Bugzilla/Field.pm b/Bugzilla/Field.pm index 0c9da9b56..761f7b94e 100644 --- a/Bugzilla/Field.pm +++ b/Bugzilla/Field.pm @@ -57,9 +57,11 @@ in addition to what is documented here. package Bugzilla::Field; +use 5.10.1; use strict; +use warnings; -use base qw(Exporter Bugzilla::Object); +use parent qw(Exporter Bugzilla::Object); @Bugzilla::Field::EXPORT = qw(check_field get_field_id get_legal_field_values); use Bugzilla::Constants; @@ -73,6 +75,8 @@ use Scalar::Util qw(blessed); #### Initialization #### ############################### +use constant IS_CONFIG => 1; + use constant DB_TABLE => 'fielddefs'; use constant LIST_ORDER => 'sortkey, name'; @@ -150,7 +154,9 @@ use constant SQL_DEFINITIONS => { FIELD_TYPE_TEXTAREA, { TYPE => 'MEDIUMTEXT', NOTNULL => 1, DEFAULT => "''"}, FIELD_TYPE_DATETIME, { TYPE => 'DATETIME' }, + FIELD_TYPE_DATE, { TYPE => 'DATE' }, FIELD_TYPE_BUG_ID, { TYPE => 'INT3' }, + FIELD_TYPE_INTEGER, { TYPE => 'INT4', NOTNULL => 1, DEFAULT => 0 }, }; # Field definitions for the fields that ship with Bugzilla. @@ -204,9 +210,9 @@ use constant DEFAULT_FIELDS => ( in_new_bugmail => 0, buglist => 1}, {name => 'cc', desc => 'CC', in_new_bugmail => 1}, {name => 'dependson', desc => 'Depends on', in_new_bugmail => 1, - is_numeric => 1}, + is_numeric => 1, buglist => 1}, {name => 'blocked', desc => 'Blocks', in_new_bugmail => 1, - is_numeric => 1}, + is_numeric => 1, buglist => 1}, {name => 'attachments.description', desc => 'Attachment description'}, {name => 'attachments.filename', desc => 'Attachment filename'}, @@ -220,7 +226,7 @@ use constant DEFAULT_FIELDS => ( {name => 'attachments.submitter', desc => 'Attachment creator'}, {name => 'target_milestone', desc => 'Target Milestone', - buglist => 1}, + in_new_bugmail => 1, buglist => 1}, {name => 'creation_ts', desc => 'Creation date', buglist => 1}, {name => 'delta_ts', desc => 'Last changed date', @@ -257,8 +263,11 @@ use constant DEFAULT_FIELDS => ( {name => "owner_idle_time", desc => "Time Since Assignee Touched"}, {name => 'see_also', desc => "See Also", type => FIELD_TYPE_BUG_URLS}, - {name => 'tag', desc => 'Tags', buglist => 1, + {name => 'tag', desc => 'Personal Tags', buglist => 1, type => FIELD_TYPE_KEYWORDS}, + {name => 'last_visit_ts', desc => 'Last Visit', buglist => 1, + type => FIELD_TYPE_DATETIME}, + {name => 'comment_tag', desc => 'Comment Tag'}, ); ################ @@ -354,9 +363,7 @@ sub _check_sortkey { sub _check_type { my ($invocant, $type, undef, $params) = @_; my $saved_type = $type; - # The constant here should be updated every time a new, - # higher field type is added. - (detaint_natural($type) && $type <= FIELD_TYPE_KEYWORDS) + (detaint_natural($type) && $type < FIELD_TYPE_HIGHEST_PLUS_ONE) || ThrowCodeError('invalid_customfield_type', { type => $saved_type }); my $custom = blessed($invocant) ? $invocant->custom : $params->{custom}; @@ -957,7 +964,10 @@ sub remove_from_db { } else { $bugs_query = "SELECT COUNT(*) FROM bugs WHERE $name IS NOT NULL"; - if ($self->type != FIELD_TYPE_BUG_ID && $self->type != FIELD_TYPE_DATETIME) { + if ($self->type != FIELD_TYPE_BUG_ID + && $self->type != FIELD_TYPE_DATE + && $self->type != FIELD_TYPE_DATETIME) + { $bugs_query .= " AND $name != ''"; } # Ignore the default single select value @@ -1055,6 +1065,7 @@ sub create { $field->_update_visibility_values(); $dbh->bz_commit_transaction(); + Bugzilla->memcached->clear_config(); if ($field->custom) { my $name = $field->name; @@ -1077,6 +1088,9 @@ sub create { # Restore the original obsolete state of the custom field. $dbh->do('UPDATE fielddefs SET obsolete = 0 WHERE id = ?', undef, $field->id) unless $is_obsolete; + + Bugzilla->memcached->clear({ table => 'fielddefs', id => $field->id }); + Bugzilla->memcached->clear_config(); } return $field; @@ -1090,6 +1104,7 @@ sub update { $dbh->do("UPDATE " . $self->name . " SET visibility_value_id = NULL"); } $self->_update_visibility_values(); + Bugzilla->memcached->clear_config(); return $changes; } @@ -1327,7 +1342,7 @@ sub check_field { Description: Returns the ID of the specified field name and throws an error if this field does not exist. -Params: $name - a field name +Params: $fieldname - a field name Returns: the corresponding field ID or an error if the field name does not exist. @@ -1337,17 +1352,24 @@ Returns: the corresponding field ID or an error if the field name =cut sub get_field_id { - my ($name) = @_; - my $dbh = Bugzilla->dbh; + my $field = Bugzilla->fields({ by_name => 1 })->{$_[0]} + or ThrowCodeError('invalid_field_name', {field => $_[0]}); - trick_taint($name); - my $id = $dbh->selectrow_array('SELECT id FROM fielddefs - WHERE name = ?', undef, $name); - - ThrowCodeError('invalid_field_name', {field => $name}) unless $id; - return $id + return $field->id; } 1; __END__ + +=head1 B<Methods in need of POD> + +=over + +=item match + +=item set_is_numeric + +=item update + +=back diff --git a/Bugzilla/Field/Choice.pm b/Bugzilla/Field/Choice.pm index a292185c4..a66f69cee 100644 --- a/Bugzilla/Field/Choice.pm +++ b/Bugzilla/Field/Choice.pm @@ -5,11 +5,13 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -use strict; - package Bugzilla::Field::Choice; -use base qw(Bugzilla::Field::ChoiceInterface Bugzilla::Object); +use 5.10.1; +use strict; +use warnings; + +use parent qw(Bugzilla::Field::ChoiceInterface Bugzilla::Object); use Bugzilla::Config qw(SetParam write_params); use Bugzilla::Constants; @@ -23,6 +25,8 @@ use Scalar::Util qw(blessed); # Initialization # ################## +use constant IS_CONFIG => 1; + use constant DB_COLUMNS => qw( id value @@ -94,7 +98,7 @@ sub type { if (!defined *{"${package}::DB_TABLE"}) { eval <<EOC; package $package; - use base qw(Bugzilla::Field::Choice); + use parent qw(Bugzilla::Field::Choice); use constant DB_TABLE => '$field_name'; EOC } @@ -333,3 +337,23 @@ must call C<type> to get a class you can call methods on. This class implements mutators for all of the settable accessors in L<Bugzilla::Field::ChoiceInterface>. + +=head1 B<Methods in need of POD> + +=over + +=item create + +=item remove_from_db + +=item set_is_active + +=item set_sortkey + +=item set_name + +=item update + +=item set_visibility_value + +=back diff --git a/Bugzilla/Field/ChoiceInterface.pm b/Bugzilla/Field/ChoiceInterface.pm index b2f1bffd2..634d36ad1 100644 --- a/Bugzilla/Field/ChoiceInterface.pm +++ b/Bugzilla/Field/ChoiceInterface.pm @@ -6,7 +6,10 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Field::ChoiceInterface; + +use 5.10.1; use strict; +use warnings; use Bugzilla::Constants; use Bugzilla::Error; @@ -269,3 +272,13 @@ I<any> of the currently selected values are this value. Returns C<0> otherwise. =back + +=head1 B<Methods in need of POD> + +=over + +=item FIELD_NAME + +=item controlled_values_array + +=back diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm index affeaee68..50474b885 100644 --- a/Bugzilla/Flag.pm +++ b/Bugzilla/Flag.pm @@ -5,10 +5,12 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -use strict; - package Bugzilla::Flag; +use 5.10.1; +use strict; +use warnings; + =head1 NAME Bugzilla::Flag - A module to deal with Bugzilla flag values. @@ -49,7 +51,7 @@ use Bugzilla::Mailer; use Bugzilla::Constants; use Bugzilla::Field; -use base qw(Bugzilla::Object Exporter); +use parent qw(Bugzilla::Object Exporter); @Bugzilla::Flag::EXPORT = qw(SKIP_REQUESTEE_ON_ERROR); ############################### @@ -180,22 +182,20 @@ is an attachment flag, else undefined. sub type { my $self = shift; - $self->{'type'} ||= new Bugzilla::FlagType($self->{'type_id'}); - return $self->{'type'}; + return $self->{'type'} ||= new Bugzilla::FlagType($self->{'type_id'}); } sub setter { my $self = shift; - $self->{'setter'} ||= new Bugzilla::User($self->{'setter_id'}); - return $self->{'setter'}; + return $self->{'setter'} ||= new Bugzilla::User({ id => $self->{'setter_id'}, cache => 1 }); } sub requestee { my $self = shift; if (!defined $self->{'requestee'} && $self->{'requestee_id'}) { - $self->{'requestee'} = new Bugzilla::User($self->{'requestee_id'}); + $self->{'requestee'} = new Bugzilla::User({ id => $self->{'requestee_id'}, cache => 1 }); } return $self->{'requestee'}; } @@ -205,16 +205,15 @@ sub attachment { return undef unless $self->attach_id; require Bugzilla::Attachment; - $self->{'attachment'} ||= new Bugzilla::Attachment($self->attach_id); - return $self->{'attachment'}; + return $self->{'attachment'} + ||= new Bugzilla::Attachment({ id => $self->attach_id, cache => 1 }); } sub bug { my $self = shift; require Bugzilla::Bug; - $self->{'bug'} ||= new Bugzilla::Bug($self->bug_id); - return $self->{'bug'}; + return $self->{'bug'} ||= new Bugzilla::Bug({ id => $self->bug_id, cache => 1 }); } ################################ @@ -464,6 +463,7 @@ sub update { undef, ($timestamp, $self->id)); $self->{'modification_date'} = format_time($timestamp, '%Y.%m.%d %T', Bugzilla->local_timezone); + Bugzilla->memcached->clear({ table => 'flags', id => $self->id }); } return $changes; } @@ -610,6 +610,7 @@ sub force_retarget { if ($is_retargetted) { $dbh->do('UPDATE flags SET type_id = ? WHERE id = ?', undef, ($flag->type_id, $flag->id)); + Bugzilla->memcached->clear({ table => 'flags', id => $flag->id }); } else { # Track deleted attachment flags. @@ -670,10 +671,15 @@ sub _check_requestee { # Make sure the user didn't specify a requestee unless the flag # is specifically requestable. For existing flags, if the requestee # was set before the flag became specifically unrequestable, the - # user can either remove him or leave him alone. - ThrowUserError('flag_requestee_disabled', { type => $self->type }) + # user can either remove them or leave them alone. + ThrowUserError('flag_type_requestee_disabled', { type => $self->type }) if !$self->type->is_requesteeble; + # You can't ask a disabled account, as they don't have the ability to + # set the flag. + ThrowUserError('flag_requestee_disabled', { requestee => $requestee }) + if !$requestee->is_enabled; + # Make sure the requestee can see the bug. # Note that can_see_bug() will query the DB, so if the bug # is being added/removed from some groups and these changes @@ -821,7 +827,7 @@ sub extract_flags_from_cgi { # Extract a list of existing flag IDs. my @flag_ids = map(/^flag-(\d+)$/ ? $1 : (), $cgi->param()); - return () if (!scalar(@flagtype_ids) && !scalar(@flag_ids)); + return ([], []) unless (scalar(@flagtype_ids) || scalar(@flag_ids)); my (@new_flags, @flags); foreach my $flag_id (@flag_ids) { @@ -927,6 +933,117 @@ sub extract_flags_from_cgi { =over +=item C<multi_extract_flags_from_cgi($bug, $hr_vars)> + +Checks whether or not there are new flags to create and returns an +array of hashes. This array is then passed to Flag::create(). This differs +from the previous sub-routine as it is called for changing multiple bugs + +=back + +=cut + +sub multi_extract_flags_from_cgi { + my ($class, $bug, $vars, $skip) = @_; + my $cgi = Bugzilla->cgi; + + my $match_status = Bugzilla::User::match_field({ + '^requestee(_type)?-(\d+)$' => { 'type' => 'multi' }, + }, undef, $skip); + + $vars->{'match_field'} = 'requestee'; + if ($match_status == USER_MATCH_FAILED) { + $vars->{'message'} = 'user_match_failed'; + } + elsif ($match_status == USER_MATCH_MULTIPLE) { + $vars->{'message'} = 'user_match_multiple'; + } + + # Extract a list of flag type IDs from field names. + my @flagtype_ids = map(/^flag_type-(\d+)$/ ? $1 : (), $cgi->param()); + + my (@new_flags, @flags); + + # Get a list of active flag types available for this product/component. + my $flag_types = Bugzilla::FlagType::match( + { 'product_id' => $bug->{'product_id'}, + 'component_id' => $bug->{'component_id'}, + 'is_active' => 1 }); + + foreach my $flagtype_id (@flagtype_ids) { + # Checks if there are unexpected flags for the product/component. + if (!scalar(grep { $_->id == $flagtype_id } @$flag_types)) { + $vars->{'message'} = 'unexpected_flag_types'; + last; + } + } + + foreach my $flag_type (@$flag_types) { + my $type_id = $flag_type->id; + + # Bug flags are only valid for bugs + next unless ($flag_type->target_type eq 'bug'); + + # We are only interested in flags the user tries to create. + next unless scalar(grep { $_ == $type_id } @flagtype_ids); + + # Get the flags of this type already set for this bug. + my $current_flags = $class->match( + { 'type_id' => $type_id, + 'target_type' => 'bug', + 'bug_id' => $bug->bug_id }); + + # We will update existing flags (instead of creating new ones) + # if the flag exists and the user has not chosen the 'always add' + # option + my $update = scalar(@$current_flags) && ! $cgi->param("flags_add-$type_id"); + + my $status = $cgi->param("flag_type-$type_id"); + trick_taint($status); + + my @logins = $cgi->param("requestee_type-$type_id"); + if ($status eq "?" && scalar(@logins)) { + foreach my $login (@logins) { + if ($update) { + foreach my $current_flag (@$current_flags) { + push (@flags, { id => $current_flag->id, + status => $status, + requestee => $login, + skip_roe => $skip }); + } + } + else { + push (@new_flags, { type_id => $type_id, + status => $status, + requestee => $login, + skip_roe => $skip }); + } + + last unless $flag_type->is_multiplicable; + } + } + else { + if ($update) { + foreach my $current_flag (@$current_flags) { + push (@flags, { id => $current_flag->id, + status => $status }); + } + } + else { + push (@new_flags, { type_id => $type_id, + status => $status }); + } + } + } + + # Return the list of flags to update and/or to create. + return (\@flags, \@new_flags); +} + +=pod + +=over + =item C<notify($flag, $old_flag, $object, $timestamp)> Sends an email notification about a flag being created, fulfilled @@ -1087,3 +1204,29 @@ sub _flag_types { } 1; + +=head1 B<Methods in need of POD> + +=over + +=item update_activity + +=item setter_id + +=item bug + +=item requestee_id + +=item DB_COLUMNS + +=item set_flag + +=item type_id + +=item snapshot + +=item update_flags + +=item update + +=back diff --git a/Bugzilla/FlagType.pm b/Bugzilla/FlagType.pm index 9e7ab09de..72b3f64c1 100644 --- a/Bugzilla/FlagType.pm +++ b/Bugzilla/FlagType.pm @@ -5,10 +5,12 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -use strict; - package Bugzilla::FlagType; +use 5.10.1; +use strict; +use warnings; + =head1 NAME Bugzilla::FlagType - A module to deal with Bugzilla flag types. @@ -41,7 +43,7 @@ use Bugzilla::Group; use Email::Address; use List::MoreUtils qw(uniq); -use base qw(Bugzilla::Object); +use parent qw(Bugzilla::Object); ############################### #### Initialization #### @@ -185,8 +187,16 @@ sub update { # Silently remove requestees from flags which are no longer # specifically requestable. if (!$self->is_requesteeble) { - $dbh->do('UPDATE flags SET requestee_id = NULL WHERE type_id = ?', - undef, $self->id); + my $ids = $dbh->selectcol_arrayref( + 'SELECT id FROM flags WHERE type_id = ? AND requestee_id IS NOT NULL', + undef, $self->id); + + if (@$ids) { + $dbh->do('UPDATE flags SET requestee_id = NULL WHERE ' . $dbh->sql_in('id', $ids)); + foreach my $id (@$ids) { + Bugzilla->memcached->clear({ table => 'flags', id => $id }); + } + } } $dbh->bz_commit_transaction(); @@ -650,9 +660,19 @@ sub sqlify_criteria { my @criteria = ("1=1"); if ($criteria->{name}) { - my $name = $dbh->quote($criteria->{name}); - trick_taint($name); # Detaint data as we have quoted it. - push(@criteria, "flagtypes.name = $name"); + if (ref($criteria->{name}) eq 'ARRAY') { + my @names = map { $dbh->quote($_) } @{$criteria->{name}}; + # Detaint data as we have quoted it. + foreach my $name (@names) { + trick_taint($name); + } + push @criteria, $dbh->sql_in('flagtypes.name', \@names); + } + else { + my $name = $dbh->quote($criteria->{name}); + trick_taint($name); # Detaint data as we have quoted it. + push(@criteria, "flagtypes.name = $name"); + } } if ($criteria->{target_type}) { # The target type is stored in the database as a one-character string @@ -716,3 +736,43 @@ sub sqlify_criteria { } 1; + +=head1 B<Methods in need of POD> + +=over + +=item exclusions_as_hash + +=item request_group_id + +=item set_is_active + +=item set_is_multiplicable + +=item inclusions_as_hash + +=item set_sortkey + +=item grant_group_id + +=item set_cc_list + +=item set_request_group + +=item set_name + +=item set_is_specifically_requestable + +=item set_grant_group + +=item create + +=item set_clusions + +=item set_description + +=item set_is_requestable + +=item update + +=back diff --git a/Bugzilla/Group.pm b/Bugzilla/Group.pm index 5404dec7e..07b78e366 100644 --- a/Bugzilla/Group.pm +++ b/Bugzilla/Group.pm @@ -5,11 +5,13 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -use strict; - package Bugzilla::Group; -use base qw(Bugzilla::Object); +use 5.10.1; +use strict; +use warnings; + +use parent qw(Bugzilla::Object); use Bugzilla::Constants; use Bugzilla::Util; @@ -20,6 +22,8 @@ use Bugzilla::Config qw(:admin); ##### Module Initialization ### ############################### +use constant IS_CONFIG => 1; + use constant DB_COLUMNS => qw( groups.id groups.name @@ -52,8 +56,10 @@ use constant UPDATE_COLUMNS => qw( ); # Parameters that are lists of groups. -use constant GROUP_PARAMS => qw(chartgroup insidergroup timetrackinggroup - querysharegroup debug_group); +use constant GROUP_PARAMS => qw( + chartgroup comment_taggers_group debug_group insidergroup + querysharegroup timetrackinggroup +); ############################### #### Accessors ###### @@ -92,7 +98,8 @@ sub members_non_inherited { sub _get_members { my ($self, $grant_type) = @_; my $dbh = Bugzilla->dbh; - my $grant_clause = $grant_type ? "AND grant_type = $grant_type" : ""; + my $grant_clause = defined($grant_type) ? "AND grant_type = $grant_type" + : ""; my $user_ids = $dbh->selectcol_arrayref( "SELECT DISTINCT user_id FROM user_group_map @@ -213,6 +220,7 @@ sub update { Bugzilla::Hook::process('group_end_of_update', { group => $self, changes => $changes }); $dbh->bz_commit_transaction(); + Bugzilla->memcached->clear_config(); return $changes; } @@ -647,3 +655,47 @@ user_group_map for any user with DIRECT or REGEXP membership IN() the list of groups returned. =back + +=head1 B<Methods in need of POD> + +=over + +=item icon_url + +=item set_name + +=item bugs + +=item granted_by_direct + +=item set_user_regexp + +=item flag_types + +=item products + +=item set_icon_url + +=item set_description + +=item set_is_active + +=item user_regexp + +=item members_direct + +=item is_bug_group + +=item grant_direct + +=item description + +=item is_active + +=item remove_from_db + +=item is_active_bug_group + +=item update + +=back diff --git a/Bugzilla/Hook.pm b/Bugzilla/Hook.pm index b75b329d5..d6ba5e1d0 100644 --- a/Bugzilla/Hook.pm +++ b/Bugzilla/Hook.pm @@ -6,7 +6,10 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Hook; + +use 5.10.1; use strict; +use warnings; sub process { my ($name, $args) = @_; @@ -585,7 +588,7 @@ about, and the value should always be C<1>. The "relationships" are described by the various C<REL_> constants in L<Bugzilla::Constants>. Here's an example of adding userid C<123> to the recipient list -as though he were on the CC list: +as though they were on the CC list: $recipients->{123}->{+REL_CC} = 1 @@ -639,6 +642,33 @@ spaces. =back +=head2 cgi_headers + +This allows you to modify the HTTP headers sent out on every Bugzilla +response. + +Params: + +=over + +=item C<headers> + +A hashref, where the keys are header names and the values are header +values. Keys need to be lower-case, and begin with a "-". If you use +the "_" character it will be converted to "-", and the library will +also fix the casing to Camel-Case. + +You can delete (some) headers that Bugzilla adds by deleting entries +from the hash. + +=item C<cgi> + +The CGI object, which may tell you useful things about the response on +which to base a decision of whether or not to add a header. + +=back + + =head2 config_add_panels If you want to add new panels to the Parameters administrative interface, @@ -1003,9 +1033,6 @@ Params: =item C<email> - The C<Email::MIME> object that's about to be sent. -=item C<mailer_args> - An arrayref that's passed as C<mailer_args> to -L<Email::Send/new>. - =back =head2 object_before_create @@ -1499,6 +1526,24 @@ name), you can get it from here. =back +=head2 user_check_account_creation + +This hook permits you to do extra checks before the creation of a new user +account. This hook is called after email address validation has been done. +Note that this hook can also access the IP address of the requester thanks +to the C<remote_ip()> subroutine exported by C<Bugzilla::Util>. + +Params: + +=over + +=item C<login> + +The login of the new account. This is usually an email address, unless the +C<emailsuffix> parameter is not empty. + +=back + =head2 user_preferences This hook allows you to add additional panels to the User Preferences page, @@ -1594,6 +1639,109 @@ See L<Bugzilla::WebService::Constants/WS_ERROR_CODE> for an example. =back +=head2 webservice_fix_credentials + +This hook allows for altering the credential parameters provided by the client +before authentication actually occurs. For example, this can be used to allow mapping +of custom parameters to the standard Bugzilla_login and Bugzilla_password parameters. + +Params: + +=over + +=item C<params> + +A hash ref containing the parameters passed into the webservice after +they have been obtained from the URL or body of the request. + +=back + +=head2 webservice_rest_request + +This hook allows for altering any of the parameters provided by the client +after authentication has occured. You are able to change things like renaming +of keys, removing values, or adding additional information. + +Params: + +=over + +=item C<params> + +A hash ref containing the parameters passed into the webservice after +they have been obtained from the URL or body of the request. + +=item C<rpc> + +The current JSONRPC, XMLRPC, or REST object. + +=back + +=head2 webservice_rest_resources + +This hook allows for altering of the REST resources data allowing you to +add additional paths to perform additional operations or to override the +resources already provided by the webservice modules. + +Params: + +=over + +=item C<resources> + +A hash returned from each module loaded that is used to determine +which code handler to use based on a regex match of the CGI path. + +=item C<rpc> + +The current JSONRPC, XMLRPC, or REST object. + +=back + +=head2 webservice_rest_response + +This hook allows for altering the result data or response object +that is being returned by the current REST webservice call. + +Params: + +=over + +=item C<response> + +The HTTP response object generated by JSON-RPC library. You can use this +to add headers, etc. + +=item C<result> + +A reference to a hash that contains the result data. + +=item C<rpc> + +The current JSONRPC, XMLRPC, or REST object. + +=back + +=head2 webservice_status_code_map + +This hook allows an extension to change the status codes returned by +specific webservice errors. The valid internal error codes that Bugzilla +generates, and the status codes they map to by default, are defined in the +C<WS_ERROR_CODE> constant in C<Bugzilla::WebService::Constants>. When +remapping an error, you may wish to use an existing status code constant. +Such constants are also in C<Bugzilla::WebService::Constants> and start +with C<STATUS_*> such as C<STATUS_BAD_REQUEST>. + +Params: + +=over + +=item C<status_code_map> + +A hash reference containing the current status code mapping. + +=back + =head1 SEE ALSO L<Bugzilla::Extension> diff --git a/Bugzilla/Install.pm b/Bugzilla/Install.pm index 4954dbfd0..07bc9d6c3 100644 --- a/Bugzilla/Install.pm +++ b/Bugzilla/Install.pm @@ -15,7 +15,9 @@ package Bugzilla::Install; # make those assumptions, then it should go into one of the # packages under the Bugzilla::Install namespace. +use 5.10.1; use strict; +use warnings; use Bugzilla::Component; use Bugzilla::Config qw(:admin); @@ -25,7 +27,7 @@ use Bugzilla::Group; use Bugzilla::Product; use Bugzilla::User; use Bugzilla::User::Setting; -use Bugzilla::Util qw(get_text say); +use Bugzilla::Util qw(get_text); use Bugzilla::Version; use constant STATUS_WORKFLOW => ( @@ -86,6 +88,8 @@ sub SETTINGS { requestee_cc => { options => ['on', 'off'], default => 'on' }, # 2012-04-30 glob@mozilla.com -- Bug 663747 bugmail_new_prefix => { options => ['on', 'off'], default => 'on' }, + # 2013-07-26 joshi_sunil@in.com -- Bug 669535 + possible_duplicates => { options => ['on', 'off'], default => 'on' }, } }; @@ -492,3 +496,19 @@ Params: none Returns: nothing =back + +=head1 B<Methods in need of POD> + +=over + +=item update_system_groups + +=item reset_password + +=item make_admin + +=item create_admin + +=item init_workflow + +=back diff --git a/Bugzilla/Install/CPAN.pm b/Bugzilla/Install/CPAN.pm index 8a880df80..094784e1a 100644 --- a/Bugzilla/Install/CPAN.pm +++ b/Bugzilla/Install/CPAN.pm @@ -6,8 +6,12 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Install::CPAN; + +use 5.10.1; use strict; -use base qw(Exporter); +use warnings; + +use parent qw(Exporter); our @EXPORT = qw( BZ_LIB @@ -161,20 +165,9 @@ sub install_module { if (!$module) { die install_string('no_such_module', { module => $name }) . "\n"; } - my $version = $module->cpan_version; - my $module_name = $name; - - if ($name eq 'LWP::UserAgent' && $^V lt v5.8.8) { - # LWP 6.x requires Perl 5.8.8 or newer. - # As PAUSE only indexes the very last version of each module, - # we have to specify the path to the tarball ourselves. - $name = 'GAAS/libwww-perl-5.837.tar.gz'; - # This tarball contains LWP::UserAgent 5.835. - $version = '5.835'; - } print install_string('install_module', - { module => $module_name, version => $version }) . "\n"; + { module => $name, version => $module->cpan_version }) . "\n"; if ($test) { CPAN::Shell->force('install', $name); @@ -336,3 +329,11 @@ Note that calling this function prints a B<lot> of information to STDOUT and STDERR. =back + +=head1 B<Methods in need of POD> + +=over + +=item check_cpan_requirements + +=back diff --git a/Bugzilla/Install/DB.pm b/Bugzilla/Install/DB.pm index 023ef7523..96f14ec0f 100644 --- a/Bugzilla/Install/DB.pm +++ b/Bugzilla/Install/DB.pm @@ -10,7 +10,9 @@ package Bugzilla::Install::DB; # NOTE: This package may "use" any modules that it likes, # localconfig is available, and params are up to date. +use 5.10.1; use strict; +use warnings; use Bugzilla::Constants; use Bugzilla::Hook; @@ -23,6 +25,7 @@ use Bugzilla::Field; use Date::Parse; use Date::Format; +use Digest; use IO::File; use List::MoreUtils qw(uniq); use URI; @@ -270,10 +273,6 @@ sub update_table_definitions { $dbh->bz_add_column('attachments', 'isprivate', {TYPE => 'BOOLEAN', NOTNULL => 1, DEFAULT => 'FALSE'}); - $dbh->bz_add_column("bugs", "alias", {TYPE => "varchar(20)"}); - $dbh->bz_add_index('bugs', 'bugs_alias_idx', - {TYPE => 'UNIQUE', FIELDS => [qw(alias)]}); - _move_quips_into_db(); $dbh->bz_drop_column("namedqueries", "watchfordiffs"); @@ -700,12 +699,36 @@ sub update_table_definitions { # 2012-08-01 koosha.khajeh@gmail.com - Bug 187753 _shorten_long_quips(); - # 2012-12-23 LpSolit@gmail.com - Bug 824361 + # 2012-12-29 reed@reedloden.com - Bug 785283 + _add_password_salt_separator(); + + # 2013-01-02 LpSolit@gmail.com - Bug 824361 _fix_longdescs_indexes(); # 2013-02-04 dkl@mozilla.com - Bug 824346 _fix_flagclusions_indexes(); + # 2013-08-26 sgreen@redhat.com - Bug 903895 + _fix_components_primary_key(); + + # 2014-06-09 dylan@mozilla.com - Bug 1022923 + $dbh->bz_add_index('bug_user_last_visit', + 'bug_user_last_visit_last_visit_ts_idx', + ['last_visit_ts']); + + # 2014-07-14 sgreen@redhat.com - Bug 726696 + $dbh->bz_alter_column('tokens', 'tokentype', + {TYPE => 'varchar(16)', NOTNULL => 1}); + + # 2014-07-27 LpSolit@gmail.com - Bug 1044561 + _fix_user_api_keys_indexes(); + + # 2014-08-11 sgreen@redhat.com - Bug 1012506 + _update_alias(); + + # 2014-11-10 dkl@mozilla.com - Bug 1093928 + $dbh->bz_drop_column('longdescs', 'is_markdown'); + ################################################################ # New --TABLE-- changes should go *** A B O V E *** this point # ################################################################ @@ -863,8 +886,8 @@ sub _populate_longdescs { if (!$who) { # This username doesn't exist. Maybe someone - # renamed him or something. Invent a new profile - # entry disabled, just to represent him. + # renamed them or something. Invent a new profile + # entry disabled, just to represent them. $dbh->do("INSERT INTO profiles (login_name, cryptpassword, disabledtext) VALUES (?,?,?)", undef, $name, '*', @@ -1424,9 +1447,9 @@ sub _use_ids_for_products_and_components { print "Updating the database to use component IDs.\n"; $dbh->bz_add_column("components", "id", - {TYPE => 'SMALLSERIAL', NOTNULL => 1, PRIMARYKEY => 1}); + {TYPE => 'MEDIUMSERIAL', NOTNULL => 1, PRIMARYKEY => 1}); $dbh->bz_add_column("bugs", "component_id", - {TYPE => 'INT2', NOTNULL => 1}, 0); + {TYPE => 'INT3', NOTNULL => 1}, 0); my %components; $sth = $dbh->prepare("SELECT id, value, product_id FROM components"); @@ -2537,7 +2560,7 @@ sub _fix_whine_queries_title_and_op_sys_value { undef, "Other", "other"); if (Bugzilla->params->{'defaultopsys'} eq 'other') { # We can't actually fix the param here, because WriteParams() will - # make $datadir/params unwriteable to the webservergroup. + # make $datadir/params.json unwriteable to the webservergroup. # It's too much of an ugly hack to copy the permission-fixing code # down to here. (It would create more potential future bugs than # it would solve problems.) @@ -3785,6 +3808,39 @@ sub _shorten_long_quips { $dbh->bz_alter_column('quips', 'quip', { TYPE => 'varchar(512)', NOTNULL => 1}); } +sub _add_password_salt_separator { + my $dbh = Bugzilla->dbh; + + $dbh->bz_start_transaction(); + + my $profiles = $dbh->selectall_arrayref("SELECT userid, cryptpassword FROM profiles WHERE (" + . $dbh->sql_regexp("cryptpassword", "'^[^,]+{'") . ")"); + + if (@$profiles) { + say "Adding salt separator to password hashes..."; + + my $query = $dbh->prepare("UPDATE profiles SET cryptpassword = ? WHERE userid = ?"); + my %algo_sizes; + + foreach my $profile (@$profiles) { + my ($userid, $hash) = @$profile; + my ($algorithm) = $hash =~ /{([^}]+)}$/; + + $algo_sizes{$algorithm} ||= length(Digest->new($algorithm)->b64digest); + + # Calculate the salt length by taking the stored hash and + # subtracting the combined lengths of the hash size, the + # algorithm name, and 2 for the {} surrounding the name. + my $not_salt_len = $algo_sizes{$algorithm} + length($algorithm) + 2; + my $salt_len = length($hash) - $not_salt_len; + + substr($hash, $salt_len, 0, ','); + $query->execute($hash, $userid); + } + } + $dbh->bz_commit_transaction(); +} + sub _fix_flagclusions_indexes { my $dbh = Bugzilla->dbh; foreach my $table ('flaginclusions', 'flagexclusions') { @@ -3814,6 +3870,50 @@ sub _fix_flagclusions_indexes { } } +sub _fix_components_primary_key { + my $dbh = Bugzilla->dbh; + if ($dbh->bz_column_info('components', 'id')->{TYPE} ne 'MEDIUMSERIAL') { + $dbh->bz_drop_related_fks('components', 'id'); + $dbh->bz_alter_column("components", "id", + {TYPE => 'MEDIUMSERIAL', NOTNULL => 1, PRIMARYKEY => 1}); + $dbh->bz_alter_column("flaginclusions", "component_id", + {TYPE => 'INT3'}); + $dbh->bz_alter_column("flagexclusions", "component_id", + {TYPE => 'INT3'}); + $dbh->bz_alter_column("bugs", "component_id", + {TYPE => 'INT3', NOTNULL => 1}); + $dbh->bz_alter_column("component_cc", "component_id", + {TYPE => 'INT3', NOTNULL => 1}); + } +} + +sub _fix_user_api_keys_indexes { + my $dbh = Bugzilla->dbh; + + if ($dbh->bz_index_info('user_api_keys', 'user_api_keys_key')) { + $dbh->bz_drop_index('user_api_keys', 'user_api_keys_key'); + $dbh->bz_add_index('user_api_keys', 'user_api_keys_api_key_idx', + { FIELDS => ['api_key'], TYPE => 'UNIQUE' }); + } + if ($dbh->bz_index_info('user_api_keys', 'user_api_keys_user_id')) { + $dbh->bz_drop_index('user_api_keys', 'user_api_keys_user_id'); + $dbh->bz_add_index('user_api_keys', 'user_api_keys_user_id_idx', ['user_id']); + } +} + +sub _update_alias { + my $dbh = Bugzilla->dbh; + return unless $dbh->bz_column_info('bugs', 'alias'); + + # We need to move the aliases from the bugs table to the bugs_aliases table + $dbh->do(q{ + INSERT INTO bugs_aliases (bug_id, alias) + SELECT bug_id, alias FROM bugs WHERE alias IS NOT NULL + }); + + $dbh->bz_drop_column('bugs', 'alias'); +} + 1; __END__ diff --git a/Bugzilla/Install/Filesystem.pm b/Bugzilla/Install/Filesystem.pm index 9721c1702..5003047c3 100644 --- a/Bugzilla/Install/Filesystem.pm +++ b/Bugzilla/Install/Filesystem.pm @@ -15,7 +15,9 @@ package Bugzilla::Install::Filesystem; # * Files do not have the correct permissions. # * The database does not exist. +use 5.10.1; use strict; +use warnings; use Bugzilla::Constants; use Bugzilla::Error; @@ -28,10 +30,12 @@ use File::Find; use File::Path; use File::Basename; use File::Copy qw(move); +use File::Spec; +use File::Slurp; use IO::File; use POSIX (); -use base qw(Exporter); +use parent qw(Exporter); our @EXPORT = qw( update_filesystem create_htaccess @@ -57,7 +61,7 @@ use constant HT_DEFAULT_DENY => <<EOT; </IfVersion> </IfModule> <IfModule !mod_version.c> - Deny from all + Deny from all </IfModule> EOT @@ -130,6 +134,7 @@ sub FILESYSTEM { my $localconfig = bz_locations()->{'localconfig'}; my $template_cache = bz_locations()->{'template_cache'}; my $graphsdir = bz_locations()->{'graphsdir'}; + my $assetsdir = bz_locations()->{'assetsdir'}; # We want to set the permissions the same for all localconfig files # across all PROJECTs, so we do something special with $localconfig, @@ -165,6 +170,7 @@ sub FILESYSTEM { 'jobqueue.pl' => { perms => WS_EXECUTE }, 'migrate.pl' => { perms => OWNER_EXECUTE }, 'install-module.pl' => { perms => OWNER_EXECUTE }, + 'clean-bug-user-last-visit.pl' => { perms => WS_EXECUTE }, 'Bugzilla.pm' => { perms => CGI_READ }, "$localconfig*" => { perms => CGI_READ }, @@ -181,7 +187,7 @@ sub FILESYSTEM { 'docs/style.css' => { perms => WS_SERVE }, 'docs/*/rel_notes.txt' => { perms => WS_SERVE }, 'docs/*/README.docs' => { perms => OWNER_WRITE }, - "$datadir/params" => { perms => CGI_WRITE }, + "$datadir/params.json" => { perms => CGI_WRITE }, "$datadir/old-params.txt" => { perms => OWNER_WRITE }, "$extensionsdir/create.pl" => { perms => OWNER_EXECUTE }, "$extensionsdir/*/*.pl" => { perms => WS_EXECUTE }, @@ -211,6 +217,8 @@ sub FILESYSTEM { dirs => DIR_CGI_WRITE | DIR_ALSO_WS_SERVE }, "$datadir/db" => { files => CGI_WRITE, dirs => DIR_CGI_WRITE }, + $assetsdir => { files => WS_SERVE, + dirs => DIR_CGI_OVERWRITE | DIR_ALSO_WS_SERVE }, # Readable directories "$datadir/mining" => { files => CGI_READ, @@ -270,7 +278,8 @@ sub FILESYSTEM { # The name of each directory that we should actually *create*, # pointing at its default permissions. my %create_dirs = ( - # This is DIR_ALSO_WS_SERVE because it contains $webdotdir. + # This is DIR_ALSO_WS_SERVE because it contains $webdotdir and + # $assetsdir. $datadir => DIR_CGI_OVERWRITE | DIR_ALSO_WS_SERVE, # Directories that are read-only for cgi scripts "$datadir/mining" => DIR_CGI_READ, @@ -281,6 +290,7 @@ sub FILESYSTEM { $attachdir => DIR_CGI_WRITE, $graphsdir => DIR_CGI_WRITE | DIR_ALSO_WS_SERVE, $webdotdir => DIR_CGI_WRITE | DIR_ALSO_WS_SERVE, + $assetsdir => DIR_CGI_WRITE | DIR_ALSO_WS_SERVE, # Directories that contain content served directly by the web server. "$skinsdir/custom" => DIR_WS_SERVE, "$skinsdir/contrib" => DIR_WS_SERVE, @@ -409,8 +419,8 @@ EOT </IfModule> </FilesMatch> -# Allow access to .png files created by a local copy of 'dot' -<FilesMatch \\.png\$> + # Allow access to .png files created by a local copy of 'dot' + <FilesMatch \\.png\$> <IfModule mod_version.c> <IfVersion < 2.4> Allow from all @@ -448,6 +458,48 @@ EOT </IfModule> EOT }, + + "$assetsdir/.htaccess" => { perms => WS_SERVE, contents => <<EOT +# Allow access to .css files +<FilesMatch \\.(css|js)\$> + <IfModule mod_version.c> + <IfVersion < 2.4> + Allow from all + </IfVersion> + <IfVersion >= 2.4> + <IfModule mod_perl.c> + Allow from all + </IfModule> + <IfModule !mod_perl.c> + Require all granted + </IfModule> + </IfVersion> + </IfModule> + <IfModule !mod_version.c> + Allow from all + </IfModule> +</FilesMatch> + +# And no directory listings, either. +<IfModule mod_version.c> + <IfVersion < 2.4> + Deny from all + </IfVersion> + <IfVersion >= 2.4> + <IfModule mod_perl.c> + Deny from all + </IfModule> + <IfModule !mod_perl.c> + Require all denied + </IfModule> + </IfVersion> +</IfModule> +<IfModule !mod_version.c> + Deny from all +</IfModule> +EOT + }, + ); Bugzilla::Hook::process('install_filesystem', { @@ -482,6 +534,7 @@ sub update_filesystem { my $datadir = bz_locations->{'datadir'}; my $graphsdir = bz_locations->{'graphsdir'}; + my $assetsdir = bz_locations->{'assetsdir'}; # If the graphs/ directory doesn't exist, we're upgrading from # a version old enough that we need to update the $datadir/mining # format. @@ -489,6 +542,13 @@ sub update_filesystem { _update_old_charts($datadir); } + # If there is a file named '-All-' in $datadir/mining, then we're still + # having mining files named by product name, and we need to convert them to + # files named by product ID. + if (-e File::Spec->catfile($datadir, 'mining', '-All-')) { + _update_old_mining_filenames(File::Spec->catdir($datadir, 'mining')); + } + # By sorting the dirs, we assure that shorter-named directories # (meaning parent directories) are always created before their # child directories. @@ -515,6 +575,13 @@ sub update_filesystem { _rename_file($oldparamsfile, "$datadir/$oldparamsfile"); } + # Remove old assets htaccess file to force recreation with correct values. + if (-e "$assetsdir/.htaccess") { + if (read_file("$assetsdir/.htaccess") =~ /<FilesMatch \\\.css\$>/) { + unlink("$assetsdir/.htaccess"); + } + } + _create_files(%files); if ($params->{index_html}) { _create_files(%{$fs->{index_html}}); @@ -558,6 +625,7 @@ EOT _remove_empty_css_files(); _convert_single_file_skins(); + _remove_dynamic_assets(); } sub _remove_empty_css_files { @@ -602,6 +670,27 @@ sub _convert_single_file_skins { } } +# delete all automatically generated css/js files to force recreation at the +# next request. +sub _remove_dynamic_assets { + my @files = ( + glob(bz_locations()->{assetsdir} . '/*.css'), + glob(bz_locations()->{assetsdir} . '/*.js'), + ); + foreach my $file (@files) { + unlink($file); + } + + # remove old skins/assets directory + my $old_path = bz_locations()->{skinsdir} . '/assets'; + if (-d $old_path) { + foreach my $file (glob("$old_path/*.css")) { + unlink($file); + } + rmdir($old_path); + } +} + sub create_htaccess { _create_files(%{FILESYSTEM()->{htaccess}}); @@ -730,6 +819,59 @@ sub _update_old_charts { } } +# The old naming scheme has product names as mining file names; we rename them +# to product IDs. +sub _update_old_mining_filenames { + my ($miningdir) = @_; + my @conversion_errors; + + require Bugzilla::Product; + + # We use a dummy product instance with ID 0, representing all products + my $product_all = {id => 0, name => '-All-'}; + bless($product_all, 'Bugzilla::Product'); + + print "Updating old charting data file names..."; + my @products = Bugzilla::Product->get_all(); + push(@products, $product_all); + foreach my $product (@products) { + if (-e File::Spec->catfile($miningdir, $product->id)) { + push(@conversion_errors, + { product => $product, + message => 'A file named "' . $product->id . + '" already exists.' }); + } + } + + if (! @conversion_errors) { + # Renaming mining files should work now without a hitch. + foreach my $product (@products) { + if (! rename(File::Spec->catfile($miningdir, $product->name), + File::Spec->catfile($miningdir, $product->id))) { + push(@conversion_errors, + { product => $product, + message => $! }); + } + } + } + + # Error reporting + if (! @conversion_errors) { + print " done.\n"; + } + else { + print " FAILED:\n"; + foreach my $error (@conversion_errors) { + printf "Cannot rename charting data file for product %d (%s): %s\n", + $error->{product}->id, $error->{product}->name, + $error->{message}; + } + print "You need to empty the \"$miningdir\" directory, then run\n", + " collectstats.pl --regenerate\n", + "in order to clean this up.\n"; + } +} + sub fix_dir_permissions { my ($dir) = @_; return if ON_WINDOWS; @@ -961,3 +1103,29 @@ how they are supposed to be set in Bugzilla's current configuration. If it fails to set the permissions, a warning will be printed to STDERR. =back + +=head1 B<Methods in need of POD> + +=over + +=item CGI_WRITE + +=item DIR_WS_SERVE + +=item DIR_ALSO_WS_SERVE + +=item WS_SERVE + +=item FILESYSTEM + +=item WS_EXECUTE + +=item CGI_READ + +=item DIR_CGI_READ + +=item DIR_CGI_WRITE + +=item DIR_CGI_OVERWRITE + +=back diff --git a/Bugzilla/Install/Localconfig.pm b/Bugzilla/Install/Localconfig.pm index 881f6c956..7f473cc77 100644 --- a/Bugzilla/Install/Localconfig.pm +++ b/Bugzilla/Install/Localconfig.pm @@ -15,7 +15,9 @@ package Bugzilla::Install::Localconfig; # * Files do not have the correct permissions # * The database is not up to date +use 5.10.1; use strict; +use warnings; use Bugzilla::Constants; use Bugzilla::Install::Util qw(bin_loc install_string); @@ -26,7 +28,7 @@ use File::Basename qw(dirname); use Safe; use Term::ANSIColor; -use base qw(Exporter); +use parent qw(Exporter); our @EXPORT_OK = qw( read_localconfig @@ -79,12 +81,24 @@ use constant LOCALCONFIG_VARS => ( default => 1, }, { - name => 'index_html', - default => 0, + name => 'db_mysql_ssl_ca_file', + default => '', + }, + { + name => 'db_mysql_ssl_ca_path', + default => '', + }, + { + name => 'db_mysql_ssl_client_cert', + default => '', }, { - name => 'cvsbin', - default => sub { bin_loc('cvs') }, + name => 'db_mysql_ssl_client_key', + default => '', + }, + { + name => 'index_html', + default => 0, }, { name => 'interdiffbin', diff --git a/Bugzilla/Install/Requirements.pm b/Bugzilla/Install/Requirements.pm index fbd7d7882..f723543b8 100644 --- a/Bugzilla/Install/Requirements.pm +++ b/Bugzilla/Install/Requirements.pm @@ -13,23 +13,17 @@ package Bugzilla::Install::Requirements; # Subroutines may "require" and "import" from modules, but they # MUST NOT "use." +use 5.10.1; use strict; -use version; +use warnings; use Bugzilla::Constants; -use Bugzilla::Install::Util qw(vers_cmp install_string bin_loc +use Bugzilla::Install::Util qw(install_string bin_loc extension_requirement_packages); use List::Util qw(max); use Term::ANSIColor; -# Return::Value 1.666002 pollutes the error log with warnings about this -# deprecated module. We have to set NO_CLUCK = 1 before loading Email::Send -# in have_vers() to disable these warnings. -BEGIN { - $Return::Value::NO_CLUCK = 1; -} - -use base qw(Exporter); +use parent qw(Exporter); our @EXPORT = qw( REQUIRED_MODULES OPTIONAL_MODULES @@ -55,6 +49,8 @@ use constant APACHE_MODULES => { mod_headers => 'headers_module', mod_env => 'env_module', mod_expires => 'expires_module', + mod_rewrite => 'rewrite_module', + mod_version => 'version_module' }; # These are all of the binaries that we could possibly use that can @@ -86,7 +82,6 @@ use constant APACHE_PATH => [qw( # are 'blacklisted'--that is, even if the version is high enough, Bugzilla # will refuse to say that it's OK to run with that version. sub REQUIRED_MODULES { - my $perl_ver = sprintf('%vd', $^V); my @modules = ( { package => 'CGI.pm', @@ -106,40 +101,36 @@ sub REQUIRED_MODULES { module => 'Date::Format', version => '2.23' }, - # 0.28 fixed some important bugs in DateTime. + # 0.75 fixes a warning thrown with Perl 5.17 and newer. { package => 'DateTime', module => 'DateTime', - version => '0.28' + version => '0.75' }, - # 0.79 is required to work on Windows Vista and Windows Server 2008. - # As correctly detecting the flavor of Windows is not easy, - # we require this version for all Windows installations. - # 0.71 fixes a major bug affecting all platforms. + # 1.64 fixes a taint issue preventing the local timezone from + # being determined on some systems. { package => 'DateTime-TimeZone', module => 'DateTime::TimeZone', - version => ON_WINDOWS ? '0.79' : '0.71' + version => '1.64' }, # 1.54 is required for Perl 5.10+. It also makes DBD::Oracle happy. { package => 'DBI', module => 'DBI', - version => (vers_cmp($perl_ver, '5.13.3') > -1) ? '1.614' : '1.54' + version => ($^V >= v5.13.3) ? '1.614' : '1.54' }, - # 2.22 fixes various problems related to UTF8 strings in hash keys, - # as well as line endings on Windows. + # 2.24 contains several useful text virtual methods. { package => 'Template-Toolkit', module => 'Template', - version => '2.22' + version => '2.24' }, - # 2.04 implement the "Test" method (to write to data/mailer.testfile). + # 1.300011 has a debug mode for SMTP and automatically pass -i to sendmail. { - package => 'Email-Send', - module => 'Email::Send', - version => ON_WINDOWS ? '2.16' : '2.04', - blacklist => ['^2\.196$'] + package => 'Email-Sender', + module => 'Email::Sender', + version => '1.300011', }, { package => 'Email-MIME', @@ -150,9 +141,8 @@ sub REQUIRED_MODULES { { package => 'URI', module => 'URI', - # This version properly handles a semicolon as the delimiter - # in a URL query string. - version => '1.37', + # Follows RFC 3986 to escape characters in URI::Escape. + version => '1.55', }, # 0.32 fixes several memory leaks in the XS version of some functions. { @@ -165,10 +155,22 @@ sub REQUIRED_MODULES { module => 'Math::Random::ISAAC', version => '1.0.1', }, + { + package => 'File-Slurp', + module => 'File::Slurp', + version => '9999.13', + }, + { + package => 'JSON-XS', + module => 'JSON::XS', + # 2.0 is the first version that will work with JSON::RPC. + version => '2.01', + }, ); if (ON_WINDOWS) { - push(@modules, { + push(@modules, + { package => 'Win32', module => 'Win32', # 0.35 fixes a memory leak in GetOSVersion, which we use. @@ -179,7 +181,14 @@ sub REQUIRED_MODULES { module => 'Win32::API', # 0.55 fixes a bug with char* that might affect Bugzilla::RNG. version => '0.55', - }); + }, + { + package => 'DateTime-TimeZone-Local-Win32', + module => 'DateTime::TimeZone::Local::Win32', + # We require DateTime::TimeZone 1.64, so this version must match. + version => '1.64', + } + ); } my $extra_modules = _get_extension_requirements('REQUIRED_MODULES'); @@ -188,7 +197,6 @@ sub REQUIRED_MODULES { }; sub OPTIONAL_MODULES { - my $perl_ver = sprintf('%vd', $^V); my @modules = ( { package => 'GD', @@ -199,10 +207,9 @@ sub OPTIONAL_MODULES { { package => 'Chart', module => 'Chart::Lines', - # Versions below 2.1 cannot be detected accurately. - # There is no 2.1.0 release (it was 2.1), but .0 is required to fix + # Versions below 2.4.1 cannot be compared accurately, see # https://rt.cpan.org/Public/Bug/Display.html?id=28218. - version => '2.1.0', + version => '2.4.1', feature => [qw(new_charts old_charts)], }, { @@ -283,6 +290,8 @@ sub OPTIONAL_MODULES { # Fixes various bugs, including 542931 and 552353 + stops # throwing warnings with Perl 5.12. version => '0.712', + # SOAP::Transport::HTTP 1.12 is bogus. + blacklist => ['^1\.12$'], feature => ['xmlrpc'], }, # Since SOAP::Lite 1.0, XMLRPC::Lite is no longer included @@ -297,26 +306,20 @@ sub OPTIONAL_MODULES { package => 'JSON-RPC', module => 'JSON::RPC', version => 0, - feature => ['jsonrpc'], - }, - { - package => 'JSON-XS', - module => 'JSON::XS', - # 2.0 is the first version that will work with JSON::RPC. - version => '2.0', - feature => ['jsonrpc_faster'], + feature => ['jsonrpc', 'rest'], }, { package => 'Test-Taint', module => 'Test::Taint', - version => 0, - feature => ['jsonrpc', 'xmlrpc'], + # 1.06 no longer throws warnings with Perl 5.10+. + version => 1.06, + feature => ['jsonrpc', 'xmlrpc', 'rest'], }, { # We need the 'utf8_mode' method of HTML::Parser, for HTML::Scrubber. package => 'HTML-Parser', module => 'HTML::Parser', - version => (vers_cmp($perl_ver, '5.13.3') > -1) ? '3.67' : '3.40', + version => ($^V >= v5.13.3) ? '3.67' : '3.40', feature => ['html_desc'], }, { @@ -368,12 +371,6 @@ sub OPTIONAL_MODULES { version => 0, feature => ['jobqueue'], }, - { - package => 'File-Slurp', - module => 'File::Slurp', - version => '9999.13', - feature => ['jobqueue'], - }, # mod_perl { @@ -403,6 +400,22 @@ sub OPTIONAL_MODULES { version => '0', feature => ['typesniffer'], }, + + # memcached + { + package => 'Cache-Memcached', + module => 'Cache::Memcached', + version => '0', + feature => ['memcached'], + }, + + # Documentation + { + package => 'File-Copy-Recursive', + module => 'File::Copy::Recursive', + version => 0, + feature => ['documentation'], + } ); my $extra_modules = _get_extension_requirements('OPTIONAL_MODULES'); @@ -416,14 +429,18 @@ use constant FEATURE_FILES => ( jsonrpc => ['Bugzilla/WebService/Server/JSONRPC.pm', 'jsonrpc.cgi'], xmlrpc => ['Bugzilla/WebService/Server/XMLRPC.pm', 'xmlrpc.cgi', 'Bugzilla/WebService.pm', 'Bugzilla/WebService/*.pm'], + rest => ['Bugzilla/WebService/Server/REST.pm', 'rest.cgi', + 'Bugzilla/WebService/Server/REST/Resources/*.pm'], moving => ['importxml.pl'], auth_ldap => ['Bugzilla/Auth/Verify/LDAP.pm'], auth_radius => ['Bugzilla/Auth/Verify/RADIUS.pm'], + documentation => ['docs/makedocs.pl'], inbound_email => ['email_in.pl'], jobqueue => ['Bugzilla/Job/*', 'Bugzilla/JobQueue.pm', 'Bugzilla/JobQueue/*', 'jobqueue.pl'], patch_viewer => ['Bugzilla/Attachment/PatchReader.pm'], updates => ['Bugzilla/Update.pm'], + memcached => ['Bugzilla/Memcache.pm'], ); # This implements the REQUIRED_MODULES and OPTIONAL_MODULES stuff @@ -506,7 +523,7 @@ sub _missing_apache_modules { return []; } my @missing; - foreach my $module (keys %$modules) { + foreach my $module (sort keys %$modules) { my $ok = _check_apache_module($module, $modules->{$module}, $cmd_info, $output); push(@missing, $module) if !$ok; @@ -940,3 +957,11 @@ Returns a hashref where file names are the keys and the value is the feature that must be enabled in order to compile that file. =back + +=head1 B<Methods in need of POD> + +=over + +=item print_module_instructions + +=back diff --git a/Bugzilla/Install/Util.pm b/Bugzilla/Install/Util.pm index cbc41db32..c05037061 100644 --- a/Bugzilla/Install/Util.pm +++ b/Bugzilla/Install/Util.pm @@ -11,7 +11,9 @@ package Bugzilla::Install::Util; # module may require *only* Bugzilla::Constants and built-in # perl modules. +use 5.10.1; use strict; +use warnings; use Bugzilla::Constants; @@ -23,7 +25,7 @@ use Scalar::Util qw(tainted); use Term::ANSIColor qw(colored); use PerlIO; -use base qw(Exporter); +use parent qw(Exporter); our @EXPORT_OK = qw( bin_loc get_version_and_os @@ -37,7 +39,6 @@ our @EXPORT_OK = qw( include_languages success template_include_path - vers_cmp init_console ); @@ -475,49 +476,6 @@ sub template_include_path { return \@include_path; } -# This is taken straight from Sort::Versions 1.5, which is not included -# with perl by default. -sub vers_cmp { - my ($a, $b) = @_; - - # Remove leading zeroes - Bug 344661 - $a =~ s/^0*(\d.+)/$1/; - $b =~ s/^0*(\d.+)/$1/; - - my @A = ($a =~ /([-.]|\d+|[^-.\d]+)/g); - my @B = ($b =~ /([-.]|\d+|[^-.\d]+)/g); - - my ($A, $B); - while (@A and @B) { - $A = shift @A; - $B = shift @B; - if ($A eq '-' and $B eq '-') { - next; - } elsif ( $A eq '-' ) { - return -1; - } elsif ( $B eq '-') { - return 1; - } elsif ($A eq '.' and $B eq '.') { - next; - } elsif ( $A eq '.' ) { - return -1; - } elsif ( $B eq '.' ) { - return 1; - } elsif ($A =~ /^\d+$/ and $B =~ /^\d+$/) { - if ($A =~ /^0/ || $B =~ /^0/) { - return $A cmp $B if $A cmp $B; - } else { - return $A <=> $B if $A <=> $B; - } - } else { - $A = uc $A; - $B = uc $B; - return $A cmp $B if $A cmp $B; - } - } - @A <=> @B; -} - sub no_checksetup_from_cgi { print "Content-Type: text/html; charset=UTF-8\r\n\r\n"; print install_string('no_checksetup_from_cgi'); @@ -893,26 +851,36 @@ Used by L<Bugzilla::Template> to determine the languages' list which are compiled with the browser's I<Accept-Language> and the languages of installed templates. -=item C<vers_cmp> +=back + +=head1 B<Methods in need of POD> =over -=item B<Description> +=item supported_languages -This is a comparison function, like you would use in C<sort>, except that -it compares two version numbers. So, for example, 2.10 would be greater -than 2.2. +=item extension_template_directory -It's based on versioncmp from L<Sort::Versions>, with some Bugzilla-specific -fixes. +=item extension_code_files -=item B<Params>: C<$a> and C<$b> - The versions you want to compare. +=item extension_web_directory -=item B<Returns> +=item trick_taint -C<-1> if C<$a> is less than C<$b>, C<0> if they are equal, or C<1> if C<$a> -is greater than C<$b>. +=item success -=back +=item trim + +=item extension_package_directory + +=item set_output_encoding + +=item extension_requirement_packages + +=item prevent_windows_dialog_boxes + +=item sortQvalue + +=item no_checksetup_from_cgi =back diff --git a/Bugzilla/Job/BugMail.pm b/Bugzilla/Job/BugMail.pm new file mode 100644 index 000000000..e0b7f5448 --- /dev/null +++ b/Bugzilla/Job/BugMail.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::Job::BugMail; + +use 5.10.1; +use strict; +use warnings; + +use Bugzilla::BugMail; +BEGIN { eval "use parent qw(Bugzilla::Job::Mailer)"; } + +sub work { + my ($class, $job) = @_; + my $success = eval { + Bugzilla::BugMail::dequeue($job->arg->{vars}); + 1; + }; + if (!$success) { + $job->failed($@); + undef $@; + } + else { + $job->completed; + } +} + +1; diff --git a/Bugzilla/Job/Mailer.pm b/Bugzilla/Job/Mailer.pm index 958089e45..cd1c23445 100644 --- a/Bugzilla/Job/Mailer.pm +++ b/Bugzilla/Job/Mailer.pm @@ -6,9 +6,13 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Job::Mailer; + +use 5.10.1; use strict; +use warnings; + use Bugzilla::Mailer; -BEGIN { eval "use base qw(TheSchwartz::Worker)"; } +BEGIN { eval "use parent qw(TheSchwartz::Worker)"; } # The longest we expect a job to possibly take, in seconds. use constant grab_for => 300; diff --git a/Bugzilla/JobQueue.pm b/Bugzilla/JobQueue.pm index 2c3d8a773..d5ceda8e9 100644 --- a/Bugzilla/JobQueue.pm +++ b/Bugzilla/JobQueue.pm @@ -7,7 +7,9 @@ package Bugzilla::JobQueue; +use 5.10.1; use strict; +use warnings; use Bugzilla::Constants; use Bugzilla::Error; @@ -21,6 +23,7 @@ use fields qw(_worker_pidfile); # If you add new types of jobs, you should add a mapping here. use constant JOB_MAP => { send_mail => 'Bugzilla::Job::Mailer', + bug_mail => 'Bugzilla::Job::BugMail', }; # Without a driver cache TheSchwartz opens a new database connection @@ -28,6 +31,10 @@ use constant JOB_MAP => { # across requests. use constant DRIVER_CACHE_TIME => 300; # 5 minutes +# To avoid memory leak/fragmentation, a worker process won't process more than +# MAX_MESSAGES messages. +use constant MAX_MESSAGES => 1000; + sub job_map { if (!defined(Bugzilla->request_cache->{job_map})) { my $job_map = JOB_MAP; @@ -153,6 +160,16 @@ sub work_once { return $self->SUPER::work_once(@_); } +# Never process more than MAX_MESSAGES in one batch, to avoid memory +# leak/fragmentation issues. +sub work_until_done { + my $self = shift; + my $count = 0; + while ($count++ < MAX_MESSAGES) { + $self->work_once or last; + } +} + 1; __END__ @@ -178,3 +195,19 @@ Bugzilla to use some sort of service to schedule jobs to happen asyncronously. See the synopsis above for an easy to follow example on how to insert a job into the queue. Give it a name and some arguments and the job will be sent away to be done later. + +=head1 B<Methods in need of POD> + +=over + +=item insert + +=item bz_databases + +=item job_map + +=item set_pidfile + +=item kill_worker + +=back diff --git a/Bugzilla/JobQueue/Runner.pm b/Bugzilla/JobQueue/Runner.pm index 8b5cf9b6b..104a97b0b 100644 --- a/Bugzilla/JobQueue/Runner.pm +++ b/Bugzilla/JobQueue/Runner.pm @@ -11,7 +11,10 @@ package Bugzilla::JobQueue::Runner; +use 5.10.1; use strict; +use warnings; + use Cwd qw(abs_path); use File::Basename; use File::Copy; @@ -20,7 +23,7 @@ use Pod::Usage; use Bugzilla::Constants; use Bugzilla::JobQueue; use Bugzilla::Util qw(get_text); -BEGIN { eval "use base qw(Daemon::Generic)"; } +BEGIN { eval "use parent qw(Daemon::Generic)"; } our $VERSION = BUGZILLA_VERSION; @@ -235,3 +238,33 @@ job queue. This is a subclass of L<Daemon::Generic> that is used by L<jobqueue> to run the Bugzilla job queue. + +=head1 B<Methods in need of POD> + +=over + +=item gd_check + +=item gd_run + +=item gd_can_install + +=item gd_quit_event + +=item gd_other_cmd + +=item gd_more_opt + +=item gd_postconfig + +=item gd_usage + +=item gd_getopt + +=item gd_preconfig + +=item gd_can_uninstall + +=item gd_setup_signals + +=back diff --git a/Bugzilla/Keyword.pm b/Bugzilla/Keyword.pm index 3f3213be4..afa93e1e9 100644 --- a/Bugzilla/Keyword.pm +++ b/Bugzilla/Keyword.pm @@ -5,11 +5,13 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -use strict; - package Bugzilla::Keyword; -use base qw(Bugzilla::Object); +use 5.10.1; +use strict; +use warnings; + +use parent qw(Bugzilla::Object); use Bugzilla::Error; use Bugzilla::Util; @@ -18,6 +20,8 @@ use Bugzilla::Util; #### Initialization #### ############################### +use constant IS_CONFIG => 1; + use constant DB_COLUMNS => qw( keyworddefs.id keyworddefs.name @@ -165,3 +169,17 @@ implements. =back =cut + +=head1 B<Methods in need of POD> + +=over + +=item set_description + +=item bug_count + +=item set_name + +=item description + +=back diff --git a/Bugzilla/Mailer.pm b/Bugzilla/Mailer.pm index 64640150b..0b82ded41 100644 --- a/Bugzilla/Mailer.pm +++ b/Bugzilla/Mailer.pm @@ -7,9 +7,11 @@ package Bugzilla::Mailer; +use 5.10.1; use strict; +use warnings; -use base qw(Exporter); +use parent qw(Exporter); @Bugzilla::Mailer::EXPORT = qw(MessageToMTA build_thread_marker); use Bugzilla::Constants; @@ -21,22 +23,20 @@ use Date::Format qw(time2str); use Encode qw(encode); use Encode::MIME::Header; -use Email::Address; use Email::MIME; -# Return::Value 1.666002 pollutes the error log with warnings about this -# deprecated module. We have to set NO_CLUCK = 1 before loading Email::Send -# to disable these warnings. -BEGIN { - $Return::Value::NO_CLUCK = 1; -} -use Email::Send; +use Email::Sender::Simple qw(sendmail); +use Email::Sender::Transport::SMTP::Persistent; +use Bugzilla::Sender::Transport::Sendmail; sub MessageToMTA { my ($msg, $send_now) = (@_); my $method = Bugzilla->params->{'mail_delivery_method'}; return if $method eq 'None'; - if (Bugzilla->params->{'use_mailer_queue'} and !$send_now) { + if (Bugzilla->params->{'use_mailer_queue'} + && ! $send_now + && ! Bugzilla->dbh->bz_in_transaction() + ) { Bugzilla->job_queue->insert('send_mail', { msg => $msg }); return; } @@ -50,12 +50,22 @@ sub MessageToMTA { # Email::MIME doesn't do this for us. We use \015 (CR) and \012 (LF) # directly because Perl translates "\n" depending on what platform # you're running on. See http://perldoc.perl.org/perlport.html#Newlines - # We check for multiple CRs because of this Template-Toolkit bug: - # https://rt.cpan.org/Ticket/Display.html?id=43345 $msg =~ s/(?:\015+)?\012/\015\012/msg; $email = new Email::MIME($msg); } + # If we're called from within a transaction, we don't want to send the + # email immediately, in case the transaction is rolled back. Instead we + # insert it into the mail_staging table, and bz_commit_transaction calls + # send_staged_mail() after the transaction is committed. + if (! $send_now && Bugzilla->dbh->bz_in_transaction()) { + # The e-mail string may contain tainted values. + my $string = $email->as_string; + trick_taint($string); + Bugzilla->dbh->do("INSERT INTO mail_staging (message) VALUES(?)", undef, $string); + return; + } + # We add this header to uniquely identify all email that we # send as coming from this Bugzilla installation. # @@ -63,7 +73,7 @@ sub MessageToMTA { # *always* be the same for this Bugzilla, in every email, # even if the admin changes the "ssl_redirect" parameter some day. $email->header_set('X-Bugzilla-URL', Bugzilla->params->{'urlbase'}); - + # We add this header to mark the mail as "auto-generated" and # thus to hopefully avoid auto replies. $email->header_set('Auto-Submitted', 'auto-generated'); @@ -91,21 +101,14 @@ sub MessageToMTA { my $from = $email->header('From'); - my ($hostname, @args); - my $mailer_class = $method; + my $hostname; + my $transport; if ($method eq "Sendmail") { - $mailer_class = 'Bugzilla::Send::Sendmail'; if (ON_WINDOWS) { - $Email::Send::Sendmail::SENDMAIL = SENDMAIL_EXE; + $transport = Bugzilla::Sender::Transport::Sendmail->new({ sendmail => SENDMAIL_EXE }); } - push @args, "-i"; - # We want to make sure that we pass *only* an email address. - if ($from) { - my ($email_obj) = Email::Address->parse($from); - if ($email_obj) { - my $from_email = $email_obj->address; - push(@args, "-f$from_email") if $from_email; - } + else { + $transport = Bugzilla::Sender::Transport::Sendmail->new(); } } else { @@ -113,7 +116,7 @@ sub MessageToMTA { # address, but other mailers won't. my $urlbase = Bugzilla->params->{'urlbase'}; $urlbase =~ m|//([^:/]+)[:/]?|; - $hostname = $1; + $hostname = $1 || 'localhost'; $from .= "\@$hostname" if $from !~ /@/; $email->header_set('From', $from); @@ -124,16 +127,21 @@ sub MessageToMTA { } if ($method eq "SMTP") { - push @args, Host => Bugzilla->params->{"smtpserver"}, - username => Bugzilla->params->{"smtp_username"}, - password => Bugzilla->params->{"smtp_password"}, - Hello => $hostname, - ssl => Bugzilla->params->{'smtp_ssl'}, - Debug => Bugzilla->params->{'smtp_debug'}; + my ($host, $port) = split(/:/, Bugzilla->params->{'smtpserver'}, 2); + $transport = Bugzilla->request_cache->{smtp} //= + Email::Sender::Transport::SMTP::Persistent->new({ + host => $host, + defined($port) ? (port => $port) : (), + sasl_username => Bugzilla->params->{'smtp_username'}, + sasl_password => Bugzilla->params->{'smtp_password'}, + helo => $hostname, + ssl => Bugzilla->params->{'smtp_ssl'}, + debug => Bugzilla->params->{'smtp_debug'} }); } - Bugzilla::Hook::process('mailer_before_send', - { email => $email, mailer_args => \@args }); + Bugzilla::Hook::process('mailer_before_send', { email => $email }); + + return if $email->header('to') eq ''; $email->walk_parts(sub { my ($part) = @_; @@ -166,13 +174,12 @@ sub MessageToMTA { close TESTFILE; } else { - # This is useful for both Sendmail and Qmail, so we put it out here. + # This is useful for Sendmail, so we put it out here. local $ENV{PATH} = SENDMAIL_PATH; - my $mailer = Email::Send->new({ mailer => $mailer_class, - mailer_args => \@args }); - my $retval = $mailer->send($email); - ThrowCodeError('mail_send_error', { msg => $retval, mail => $email }) - if !$retval; + eval { sendmail($email, { transport => $transport }) }; + if ($@) { + ThrowCodeError('mail_send_error', { msg => $@->message, mail => $email }); + } } } @@ -205,4 +212,50 @@ sub build_thread_marker { return $threadingmarker; } +sub send_staged_mail { + my $dbh = Bugzilla->dbh; + my @ids; + my $emails + = $dbh->selectall_arrayref("SELECT id, message FROM mail_staging"); + + foreach my $row (@$emails) { + MessageToMTA($row->[1]); + push(@ids, $row->[0]); + } + + if (@ids) { + $dbh->do("DELETE FROM mail_staging WHERE " . $dbh->sql_in('id', \@ids)); + } +} + 1; + +__END__ + +=head1 NAME + +Bugzilla::Mailer - Provides methods for sending email + +=head1 METHODS + +=over + +=item C<MessageToMTA> + +Sends the passed message to the mail transfer agent. + +The actual behaviour depends on a number of factors: if called from within a +database transaction, the message will be staged and sent when the transaction +is committed. If email queueing is enabled, the message will be sent to +TheSchwartz job queue where it will be processed by the jobqueue daemon, else +the message is sent immediately. + +=item C<build_thread_marker> + +Builds header suitable for use as a threading marker in email notifications. + +=item C<send_staged_mail> + +Sends all staged messages -- called after a database transaction is committed. + +=back diff --git a/Bugzilla/Memcached.pm b/Bugzilla/Memcached.pm new file mode 100644 index 000000000..df90fef93 --- /dev/null +++ b/Bugzilla/Memcached.pm @@ -0,0 +1,483 @@ +# 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::Memcached; + +use 5.10.1; +use strict; +use warnings; + +use Bugzilla::Error; +use Bugzilla::Util qw(trick_taint); +use Scalar::Util qw(blessed); +use URI::Escape; + +# memcached keys have a maximum length of 250 bytes +use constant MAX_KEY_LENGTH => 250; + +sub _new { + my $invocant = shift; + my $class = ref($invocant) || $invocant; + my $self = {}; + + # always return an object to simplify calling code when memcached is + # disabled. + if (Bugzilla->feature('memcached') + && Bugzilla->params->{memcached_servers}) + { + require Cache::Memcached; + $self->{namespace} = Bugzilla->params->{memcached_namespace} || ''; + $self->{memcached} = + Cache::Memcached->new({ + servers => [ split(/[, ]+/, Bugzilla->params->{memcached_servers}) ], + namespace => $self->{namespace}, + }); + } + return bless($self, $class); +} + +sub enabled { + return $_[0]->{memcached} ? 1 : 0; +} + +sub set { + my ($self, $args) = @_; + return unless $self->{memcached}; + + # { key => $key, value => $value } + if (exists $args->{key}) { + $self->_set($args->{key}, $args->{value}); + } + + # { table => $table, id => $id, name => $name, data => $data } + elsif (exists $args->{table} && exists $args->{id} && exists $args->{name}) { + # For caching of Bugzilla::Object, we have to be able to clear the + # cached values when given either the object's id or name. + my ($table, $id, $name, $data) = @$args{qw(table id name data)}; + $self->_set("$table.id.$id", $data); + if (defined $name) { + $self->_set("$table.name_id.$name", $id); + $self->_set("$table.id_name.$id", $name); + } + } + + else { + ThrowCodeError('params_required', { function => "Bugzilla::Memcached::set", + params => [ 'key', 'table' ] }); + } +} + +sub get { + my ($self, $args) = @_; + return unless $self->{memcached}; + + # { key => $key } + if (exists $args->{key}) { + return $self->_get($args->{key}); + } + + # { table => $table, id => $id } + elsif (exists $args->{table} && exists $args->{id}) { + my ($table, $id) = @$args{qw(table id)}; + return $self->_get("$table.id.$id"); + } + + # { table => $table, name => $name } + elsif (exists $args->{table} && exists $args->{name}) { + my ($table, $name) = @$args{qw(table name)}; + return unless my $id = $self->_get("$table.name_id.$name"); + return $self->_get("$table.id.$id"); + } + + else { + ThrowCodeError('params_required', { function => "Bugzilla::Memcached::get", + params => [ 'key', 'table' ] }); + } +} + +sub set_config { + my ($self, $args) = @_; + return unless $self->{memcached}; + + if (exists $args->{key}) { + return $self->_set($self->_config_prefix . '.' . $args->{key}, $args->{data}); + } + else { + ThrowCodeError('params_required', { function => "Bugzilla::Memcached::set_config", + params => [ 'key' ] }); + } +} + +sub get_config { + my ($self, $args) = @_; + return unless $self->{memcached}; + + if (exists $args->{key}) { + return $self->_get($self->_config_prefix . '.' . $args->{key}); + } + else { + ThrowCodeError('params_required', { function => "Bugzilla::Memcached::get_config", + params => [ 'key' ] }); + } +} + +sub clear { + my ($self, $args) = @_; + return unless $self->{memcached}; + + # { key => $key } + if (exists $args->{key}) { + $self->_delete($args->{key}); + } + + # { table => $table, id => $id } + elsif (exists $args->{table} && exists $args->{id}) { + my ($table, $id) = @$args{qw(table id)}; + my $name = $self->_get("$table.id_name.$id"); + $self->_delete("$table.id.$id"); + $self->_delete("$table.name_id.$name") if defined $name; + $self->_delete("$table.id_name.$id"); + } + + # { table => $table, name => $name } + elsif (exists $args->{table} && exists $args->{name}) { + my ($table, $name) = @$args{qw(table name)}; + return unless my $id = $self->_get("$table.name_id.$name"); + $self->_delete("$table.id.$id"); + $self->_delete("$table.name_id.$name"); + $self->_delete("$table.id_name.$id"); + } + + else { + ThrowCodeError('params_required', { function => "Bugzilla::Memcached::clear", + params => [ 'key', 'table' ] }); + } +} + +sub clear_all { + my ($self) = @_; + return unless $self->{memcached}; + $self->_inc_prefix("global"); +} + +sub clear_config { + my ($self, $args) = @_; + return unless $self->{memcached}; + if ($args && exists $args->{key}) { + $self->_delete($self->_config_prefix . '.' . $args->{key}); + } + else { + $self->_inc_prefix("config"); + } +} + +# in order to clear all our keys, we add a prefix to all our keys. when we +# need to "clear" all current keys, we increment the prefix. +sub _prefix { + my ($self, $name) = @_; + # we don't want to change prefixes in the middle of a request + my $request_cache = Bugzilla->request_cache; + my $request_cache_key = "memcached_prefix_$name"; + if (!$request_cache->{$request_cache_key}) { + my $memcached = $self->{memcached}; + my $prefix = $memcached->get($name); + if (!$prefix) { + $prefix = time(); + if (!$memcached->add($name, $prefix)) { + # if this failed, either another process set the prefix, or + # memcached is down. assume we lost the race, and get the new + # value. if that fails, memcached is down so use a dummy + # prefix for this request. + $prefix = $memcached->get($name) || 0; + } + } + $request_cache->{$request_cache_key} = $prefix; + } + return $request_cache->{$request_cache_key}; +} + +sub _inc_prefix { + my ($self, $name) = @_; + my $memcached = $self->{memcached}; + if (!$memcached->incr($name, 1)) { + $memcached->add($name, time()); + } + delete Bugzilla->request_cache->{"memcached_prefix_$name"}; +} + +sub _global_prefix { + return $_[0]->_prefix("global"); +} + +sub _config_prefix { + return $_[0]->_prefix("config"); +} + +sub _encode_key { + my ($self, $key) = @_; + $key = $self->_global_prefix . '.' . uri_escape_utf8($key); + return length($self->{namespace} . $key) > MAX_KEY_LENGTH + ? undef + : $key; +} + +sub _set { + my ($self, $key, $value) = @_; + if (blessed($value)) { + # we don't support blessed objects + ThrowCodeError('param_invalid', { function => "Bugzilla::Memcached::set", + param => "value" }); + } + + $key = $self->_encode_key($key) + or return; + return $self->{memcached}->set($key, $value); +} + +sub _get { + my ($self, $key) = @_; + + $key = $self->_encode_key($key) + or return; + my $value = $self->{memcached}->get($key); + return unless defined $value; + + # detaint returned values + # hashes and arrays are detainted just one level deep + if (ref($value) eq 'HASH') { + _detaint_hashref($value); + } + elsif (ref($value) eq 'ARRAY') { + foreach my $value (@$value) { + next unless defined $value; + # arrays of hashes and arrays are common + if (ref($value) eq 'HASH') { + _detaint_hashref($value); + } + elsif (ref($value) eq 'ARRAY') { + _detaint_arrayref($value); + } + elsif (!ref($value)) { + trick_taint($value); + } + } + } + elsif (!ref($value)) { + trick_taint($value); + } + return $value; +} + +sub _detaint_hashref { + my ($hashref) = @_; + foreach my $value (values %$hashref) { + if (defined($value) && !ref($value)) { + trick_taint($value); + } + } +} + +sub _detaint_arrayref { + my ($arrayref) = @_; + foreach my $value (@$arrayref) { + if (defined($value) && !ref($value)) { + trick_taint($value); + } + } +} + +sub _delete { + my ($self, $key) = @_; + $key = $self->_encode_key($key) + or return; + return $self->{memcached}->delete($key); +} + +1; + +__END__ + +=head1 NAME + +Bugzilla::Memcached - Interface between Bugzilla and Memcached. + +=head1 SYNOPSIS + + use Bugzilla; + + my $memcached = Bugzilla->memcached; + + # grab data from the cache. there is no need to check if memcached is + # available or enabled. + my $data = $memcached->get({ key => 'data_key' }); + if (!defined $data) { + # not in cache, generate the data and populate the cache for next time + $data = some_long_process(); + $memcached->set({ key => 'data_key', value => $data }); + } + # do something with $data + + # updating the profiles table directly shouldn't be attempted unless you know + # what you're doing. if you do update a table directly, you need to clear that + # object from memcached. + $dbh->do("UPDATE profiles SET request_count=10 WHERE login_name=?", undef, $login); + $memcached->clear({ table => 'profiles', name => $login }); + +=head1 DESCRIPTION + +If Memcached is installed and configured, Bugzilla can use it to cache data +across requests and between webheads. Unlike the request and process caches, +only scalars, hashrefs, and arrayrefs can be stored in Memcached. + +Memcached integration is only required for large installations of Bugzilla -- +if you have multiple webheads then configuring Memcache is recommended. + +L<Bugzilla::Memcached> provides an interface to a Memcached server/servers, with +the ability to get, set, or clear entries from the cache. + +The stored value must be an unblessed hashref, unblessed array ref, or a +scalar. Currently nested data structures are supported but require manual +de-tainting after reading from Memcached (flat data structures are automatically +de-tainted). + +All values are stored in the Memcached systems using the prefix configured with +the C<memcached_namespace> parameter, as well as an additional prefix managed +by this class to allow all values to be cleared when C<checksetup.pl> is +executed. + +Do not create an instance of this object directly, instead use +L<Bugzilla-E<gt>memcached()|Bugzilla/memcached>. + +=head1 METHODS + +=over + +=item C<enabled> + +Returns true if Memcached support is available and enabled. + +=back + +=head2 Setting + +Adds a value to Memcached. + +=over + +=item C<set({ key =E<gt> $key, value =E<gt> $value })> + +Adds the C<value> using the specific C<key>. + +=item C<set({ table =E<gt> $table, id =E<gt> $id, name =E<gt> $name, data =E<gt> $data })> + +Adds the C<data> using a keys generated from the C<table>, C<id>, and C<name>. +All three parameters must be provided, however C<name> can be provided but set +to C<undef>. + +This is a convenience method which allows cached data to be later retrieved by +specifying the C<table> and either the C<id> or C<name>. + +=item C<set_config({ key =E<gt> $key, data =E<gt> $data })> + +Adds the C<data> using the C<key> while identifying the data as part of +Bugzilla's configuration (such as fields, products, components, groups, etc). +Values set with C<set_config> are automatically cleared when changes are made +to Bugzilla's configuration. + +=back + +=head2 Getting + +Retrieves a value from Memcached. Returns C<undef> if no matching values were +found in the cache. + +=over + +=item C<get({ key =E<gt> $key })> + +Return C<value> with the specified C<key>. + +=item C<get({ table =E<gt> $table, id =E<gt> $id })> + +Return C<value> with the specified C<table> and C<id>. + +=item C<get({ table =E<gt> $table, name =E<gt> $name })> + +Return C<value> with the specified C<table> and C<name>. + +=item C<get_config({ key =E<gt> $key })> + +Return C<value> with the specified C<key> from the configuration cache. See +C<set_config> for more information. + +=back + +=head2 Clearing + +Removes the matching value from Memcached. + +=over + +=item C<clear({ key =E<gt> $key })> + +Removes C<value> with the specified C<key>. + +=item C<clear({ table =E<gt> $table, id =E<gt> $id })> + +Removes C<value> with the specified C<table> and C<id>, as well as the +corresponding C<table> and C<name> entry. + +=item C<clear({ table =E<gt> $table, name =E<gt> $name })> + +Removes C<value> with the specified C<table> and C<name>, as well as the +corresponding C<table> and C<id> entry. + +=item C<clear_config({ key =E<gt> $key })> + +Remove C<value> with the specified C<key> from the configuration cache. See +C<set_config> for more information. + +=item C<clear_config> + +Removes all configuration related values from the cache. See C<set_config> for +more information. + +=item C<clear_all> + +Removes all values from the cache. + +=back + +=head1 Bugzilla::Object CACHE + +The main driver for Memcached integration is to allow L<Bugzilla::Object> based +objects to be automatically cached in Memcache. This is enabled on a +per-package basis by setting the C<USE_MEMCACHED> constant to any true value. + +The current implementation is an opt-in (USE_MEMCACHED is false by default), +however this will change to opt-out once further testing has been completed +(USE_MEMCACHED will be true by default). + +=head1 DIRECT DATABASE UPDATES + +If an object is cached and the database is updated directly (instead of via +C<$object-E<gt>update()>), then it's possible for the data in the cache to be +out of sync with the database. + +As an example let's consider an extension which adds a timestamp field +C<last_activitiy_ts> to the profiles table and user object which contains the +user's last activity. If the extension were to call C<$user-E<gt>update()>, +then an audit entry would be created for each change to the C<last_activity_ts> +field, which is undesirable. + +To remedy this, the extension updates the table directly. It's critical with +Memcached that it then clears the cache: + + $dbh->do("UPDATE profiles SET last_activity_ts=? WHERE userid=?", + undef, $timestamp, $user_id); + Bugzilla->memcached->clear({ table => 'profiles', id => $user_id }); + diff --git a/Bugzilla/Migrate.pm b/Bugzilla/Migrate.pm index 75552c203..0731d4fed 100644 --- a/Bugzilla/Migrate.pm +++ b/Bugzilla/Migrate.pm @@ -6,7 +6,10 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Migrate; + +use 5.10.1; use strict; +use warnings; use Bugzilla::Attachment; use Bugzilla::Bug qw(LogActivityEntry); @@ -16,7 +19,7 @@ use Bugzilla::Error; use Bugzilla::Install::Requirements (); use Bugzilla::Install::Util qw(indicate_progress); use Bugzilla::Product; -use Bugzilla::Util qw(get_text trim generate_random_password say); +use Bugzilla::Util qw(get_text trim generate_random_password); use Bugzilla::User (); use Bugzilla::Status (); use Bugzilla::Version; @@ -151,6 +154,7 @@ sub do_migration { } $dbh->bz_start_transaction(); + $self->before_read(); # Read Other Database my $users = $self->users; my $products = $self->products; @@ -445,8 +449,11 @@ sub translate_value { } my $field_obj = $self->bug_fields->{$field}; - if ($field eq 'creation_ts' or $field eq 'delta_ts' - or ($field_obj and $field_obj->type == FIELD_TYPE_DATETIME)) + if ($field eq 'creation_ts' + or $field eq 'delta_ts' + or ($field_obj and + ($field_obj->type == FIELD_TYPE_DATETIME + or $field_obj->type == FIELD_TYPE_DATE))) { $value = trim($value); return undef if !$value; @@ -539,6 +546,7 @@ sub write_config { sub after_insert {} sub before_insert {} sub after_read {} +sub before_read {} ############# # Inserters # @@ -749,7 +757,7 @@ sub insert_bugs { # File the bug as the reporter. my $super_user = Bugzilla->user; my $reporter = Bugzilla::User->check($bug->{reporter}); - # Allow the user to file a bug in any product, no matter his current + # Allow the user to file a bug in any product, no matter their current # permissions. $reporter->{groups} = $super_user->groups; Bugzilla->set_user($reporter); @@ -1142,6 +1150,11 @@ and yet shouldn't be added to the initial description of the bug when translating bugs, then they should be listed here. See L</translate_bug> for more detail. +=head2 before_read + +This is called before any data is read from the "other bug-tracker". +The default implementation does nothing. + =head2 after_read This is run after all data is read from the other bug-tracker, but @@ -1158,3 +1171,49 @@ or any custom fields are created. The default implementation does nothing. This is run after all data is inserted into Bugzilla. The default implementation does nothing. + +=head1 B<Methods in need of POD> + +=over + +=item do_migration + +=item verbose + +=item bug_fields + +=item insert_users + +=item users + +=item check_requirements + +=item bugs + +=item map_value + +=item insert_products + +=item products + +=item translate_all_bugs + +=item config_file_name + +=item dry_run + +=item name + +=item create_custom_fields + +=item reset_serial_values + +=item read_config + +=item write_config + +=item insert_bugs + +=item create_legal_values + +=back diff --git a/Bugzilla/Migrate/Gnats.pm b/Bugzilla/Migrate/Gnats.pm index 05d3b3739..5feda4b8d 100644 --- a/Bugzilla/Migrate/Gnats.pm +++ b/Bugzilla/Migrate/Gnats.pm @@ -6,8 +6,12 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Migrate::Gnats; + +use 5.10.1; use strict; -use base qw(Bugzilla::Migrate); +use warnings; + +use parent qw(Bugzilla::Migrate); use Bugzilla::Constants; use Bugzilla::Install::Util qw(indicate_progress); @@ -696,3 +700,23 @@ sub translate_value { } 1; + +=head1 B<Methods in need of POD> + +=over + +=item user_map + +=item user_to_email + +=item add_user + +=item translate_value + +=item before_insert + +=item translate_bug + +=item CONFIG_VARS + +=back diff --git a/Bugzilla/Milestone.pm b/Bugzilla/Milestone.pm index b4ddaeafe..cf7e3e35f 100644 --- a/Bugzilla/Milestone.pm +++ b/Bugzilla/Milestone.pm @@ -5,11 +5,13 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -use strict; - package Bugzilla::Milestone; -use base qw(Bugzilla::Object); +use 5.10.1; +use strict; +use warnings; + +use parent qw(Bugzilla::Object); use Bugzilla::Constants; use Bugzilla::Util; @@ -112,8 +114,10 @@ sub update { $dbh->do('UPDATE products SET defaultmilestone = ? WHERE id = ? AND defaultmilestone = ?', undef, ($self->name, $self->product_id, $changes->{value}->[0])); + Bugzilla->memcached->clear({ table => 'products', id => $self->product_id }); } $dbh->bz_commit_transaction(); + Bugzilla->memcached->clear_config(); return $changes; } @@ -376,3 +380,13 @@ Milestone.pm represents a Product Milestone object. Returns: A Bugzilla::Milestone object. =back + +=head1 B<Methods in need of POD> + +=over + +=item set_is_active + +=item is_active + +=back diff --git a/Bugzilla/Object.pm b/Bugzilla/Object.pm index 47b935664..8f25e2b20 100644 --- a/Bugzilla/Object.pm +++ b/Bugzilla/Object.pm @@ -5,10 +5,12 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -use strict; - package Bugzilla::Object; +use 5.10.1; +use strict; +use warnings; + use Bugzilla::Constants; use Bugzilla::Hook; use Bugzilla::Util; @@ -33,6 +35,15 @@ use constant AUDIT_CREATES => 1; use constant AUDIT_UPDATES => 1; use constant AUDIT_REMOVES => 1; +# When USE_MEMCACHED is true, the class is suitable for serialisation to +# Memcached. See documentation in Bugzilla::Memcached for more information. +use constant USE_MEMCACHED => 1; + +# When IS_CONFIG is true, the class is used to track seldom changed +# configuration objects. This includes, but is not limited to, fields, field +# values, keywords, products, classifications, priorities, severities, etc. +use constant IS_CONFIG => 0; + # This allows the JSON-RPC interface to return Bugzilla::Object instances # as though they were hashes. In the future, this may be modified to return # less information. @@ -45,17 +56,52 @@ sub TO_JSON { return { %{ $_[0] } }; } sub new { my $invocant = shift; my $class = ref($invocant) || $invocant; - my $object = $class->_init(@_); - bless($object, $class) if $object; + my $param = shift; + + my $object = $class->_object_cache_get($param); + return $object if $object; + + my ($data, $set_memcached); + if (Bugzilla->memcached->enabled + && $class->USE_MEMCACHED + && ref($param) eq 'HASH' && $param->{cache}) + { + if (defined $param->{id}) { + $data = Bugzilla->memcached->get({ + table => $class->DB_TABLE, + id => $param->{id}, + }); + } + elsif (defined $param->{name}) { + $data = Bugzilla->memcached->get({ + table => $class->DB_TABLE, + name => $param->{name}, + }); + } + $set_memcached = $data ? 0 : 1; + } + $data ||= $class->_load_from_db($param); + + if ($data && $set_memcached) { + Bugzilla->memcached->set({ + table => $class->DB_TABLE, + id => $data->{$class->ID_FIELD}, + name => $data->{$class->NAME_FIELD}, + data => $data, + }); + } + + $object = $class->new_from_hash($data); + $class->_object_cache_set($param, $object); + return $object; } - # Note: Because this uses sql_istrcmp, if you make a new object use # Bugzilla::Object, make sure that you modify bz_setup_database # in Bugzilla::DB::Pg appropriately, to add the right LOWER # index. You can see examples already there. -sub _init { +sub _load_from_db { my $class = shift; my ($param) = @_; my $dbh = Bugzilla->dbh; @@ -68,19 +114,19 @@ sub _init { if (ref $param eq 'HASH') { $id = $param->{id}; } - my $object; + my $object_data; if (defined $id) { # We special-case if somebody specifies an ID, so that we can # validate it as numeric. detaint_natural($id) || ThrowCodeError('param_must_be_numeric', - {function => $class . '::_init'}); + {function => $class . '::_load_from_db'}); # Too large integers make PostgreSQL crash. return if $id > MAX_INT_32; - $object = $dbh->selectrow_hashref(qq{ + $object_data = $dbh->selectrow_hashref(qq{ SELECT $columns FROM $table WHERE $id_field = ?}, undef, $id); } else { @@ -107,11 +153,110 @@ sub _init { } map { trick_taint($_) } @values; - $object = $dbh->selectrow_hashref( + $object_data = $dbh->selectrow_hashref( "SELECT $columns FROM $table WHERE $condition", undef, @values); } + return $object_data; +} - return $object; +sub new_from_list { + my $invocant = shift; + my $class = ref($invocant) || $invocant; + my ($id_list) = @_; + my $id_field = $class->ID_FIELD; + + my @detainted_ids; + foreach my $id (@$id_list) { + detaint_natural($id) || + ThrowCodeError('param_must_be_numeric', + {function => $class . '::new_from_list'}); + # Too large integers make PostgreSQL crash. + next if $id > MAX_INT_32; + push(@detainted_ids, $id); + } + + # We don't do $invocant->match because some classes have + # their own implementation of match which is not compatible + # with this one. However, match() still needs to have the right $invocant + # in order to do $class->DB_TABLE and so on. + return match($invocant, { $id_field => \@detainted_ids }); +} + +sub new_from_hash { + my $invocant = shift; + my $class = ref($invocant) || $invocant; + my $object_data = shift || return; + $class->_serialisation_keys($object_data); + bless($object_data, $class); + $object_data->initialize(); + return $object_data; +} + +sub initialize { + # abstract +} + +# Provides a mechanism for objects to be cached in the request_cache + +sub object_cache_get { + my ($class, $id) = @_; + return $class->_object_cache_get( + { id => $id, cache => 1}, + $class + ); +} + +sub object_cache_set { + my $self = shift; + return $self->_object_cache_set( + { id => $self->id, cache => 1 }, + $self + ); +} + +sub _object_cache_get { + my $class = shift; + my ($param) = @_; + my $cache_key = $class->object_cache_key($param) + || return; + return Bugzilla->request_cache->{$cache_key}; +} + +sub _object_cache_set { + my $class = shift; + my ($param, $object) = @_; + my $cache_key = $class->object_cache_key($param) + || return; + Bugzilla->request_cache->{$cache_key} = $object; +} + +sub _object_cache_remove { + my $class = shift; + my ($param) = @_; + $param->{cache} = 1; + my $cache_key = $class->object_cache_key($param) + || return; + delete Bugzilla->request_cache->{$cache_key}; +} + +sub object_cache_key { + my $class = shift; + my ($param) = @_; + if (ref($param) && $param->{cache} && ($param->{id} || $param->{name})) { + $class = blessed($class) if blessed($class); + return $class . ',' . ($param->{id} || $param->{name}); + } else { + return; + } +} + +# To support serialisation, we need to capture the keys in an object's default +# hashref. +sub _serialisation_keys { + my ($class, $object) = @_; + my $cache = Bugzilla->request_cache->{serialisation_keys} ||= {}; + $cache->{$class} = [ keys %$object ] if $object && !exists $cache->{$class}; + return @{ $cache->{$class} }; } sub check { @@ -147,28 +292,6 @@ sub check { return $obj; } -sub new_from_list { - my $invocant = shift; - my $class = ref($invocant) || $invocant; - my ($id_list) = @_; - my $id_field = $class->ID_FIELD; - - my @detainted_ids; - foreach my $id (@$id_list) { - detaint_natural($id) || - ThrowCodeError('param_must_be_numeric', - {function => $class . '::new_from_list'}); - # Too large integers make PostgreSQL crash. - next if $id > MAX_INT_32; - push(@detainted_ids, $id); - } - # We don't do $invocant->match because some classes have - # their own implementation of match which is not compatible - # with this one. However, match() still needs to have the right $invocant - # in order to do $class->DB_TABLE and so on. - return match($invocant, { $id_field => \@detainted_ids }); -} - # Note: Future extensions to this could be: # * Add a MATCH_JOIN constant so that we can join against # certain other tables for the WHERE criteria. @@ -252,23 +375,46 @@ sub _do_list_select { my $cols = join(',', $class->_get_db_columns); my $order = $class->LIST_ORDER; - my $sql = "SELECT $cols FROM $table"; - if (defined $where) { - $sql .= " WHERE $where "; + # Unconditional requests for configuration data are cacheable. + my ($objects, $set_memcached, $memcached_key); + if (!defined $where + && Bugzilla->memcached->enabled + && $class->IS_CONFIG) + { + $memcached_key = "$class:get_all"; + $objects = Bugzilla->memcached->get_config({ key => $memcached_key }); + $set_memcached = $objects ? 0 : 1; } - $sql .= " ORDER BY $order"; - - $sql .= " $postamble" if $postamble; - - my $dbh = Bugzilla->dbh; - # Sometimes the values are tainted, but we don't want to untaint them - # for the caller. So we copy the array. It's safe to untaint because - # they're only used in placeholders here. - my @untainted = @{ $values || [] }; - trick_taint($_) foreach @untainted; - my $objects = $dbh->selectall_arrayref($sql, {Slice=>{}}, @untainted); - bless ($_, $class) foreach @$objects; - return $objects + + if (!$objects) { + my $sql = "SELECT $cols FROM $table"; + if (defined $where) { + $sql .= " WHERE $where "; + } + $sql .= " ORDER BY $order"; + $sql .= " $postamble" if $postamble; + + my $dbh = Bugzilla->dbh; + # Sometimes the values are tainted, but we don't want to untaint them + # for the caller. So we copy the array. It's safe to untaint because + # they're only used in placeholders here. + my @untainted = @{ $values || [] }; + trick_taint($_) foreach @untainted; + $objects = $dbh->selectall_arrayref($sql, {Slice=>{}}, @untainted); + $class->_serialisation_keys($objects->[0]) if @$objects; + } + + if ($objects && $set_memcached) { + Bugzilla->memcached->set_config({ + key => $memcached_key, + data => $objects + }); + } + + foreach my $object (@$objects) { + $object = $class->new_from_hash($object); + } + return $objects; } ############################### @@ -392,6 +538,13 @@ sub update { $self->audit_log(\%changes) if $self->AUDIT_UPDATES; $dbh->bz_commit_transaction(); + if ($self->USE_MEMCACHED && @values) { + Bugzilla->memcached->clear({ table => $table, id => $self->id }); + Bugzilla->memcached->clear_config() + if $self->IS_CONFIG; + } + $self->_object_cache_remove({ id => $self->id }); + $self->_object_cache_remove({ name => $self->name }) if $self->name; if (wantarray) { return (\%changes, $old_self); @@ -410,6 +563,13 @@ sub remove_from_db { $self->audit_log(AUDIT_REMOVE) if $self->AUDIT_REMOVES; $dbh->do("DELETE FROM $table WHERE $id_field = ?", undef, $self->id); $dbh->bz_commit_transaction(); + if ($self->USE_MEMCACHED) { + Bugzilla->memcached->clear({ table => $table, id => $self->id }); + Bugzilla->memcached->clear_config() + if $self->IS_CONFIG; + } + $self->_object_cache_remove({ id => $self->id }); + $self->_object_cache_remove({ name => $self->name }) if $self->name; undef $self; } @@ -444,6 +604,13 @@ sub audit_log { } } +sub flatten_to_hash { + my $self = shift; + my $class = blessed($self); + my %hash = map { $_ => $self->{$_} } $class->_serialisation_keys; + return \%hash; +} + ############################### #### Subroutines ###### ############################### @@ -467,6 +634,13 @@ sub create { my $object = $class->insert_create_data($field_values); $dbh->bz_commit_transaction(); + if (Bugzilla->memcached->enabled + && $class->USE_MEMCACHED + && $class->IS_CONFIG) + { + Bugzilla->memcached->clear_config(); + } + return $object; } @@ -562,7 +736,7 @@ sub insert_create_data { sub get_all { my $class = shift; - return @{$class->_do_list_select()}; + return @{ $class->_do_list_select() }; } ############################### @@ -971,6 +1145,17 @@ database matching the parameters you passed in. =back +=item C<initialize> + +=over + +=item B<Description> + +Abstract method to allow subclasses to perform initialization tasks after an +object has been created. + +=back + =item C<check> =over @@ -1010,6 +1195,13 @@ template. Returns: A reference to an array of objects. +=item C<new_from_hash($hashref)> + + Description: Create an object from the given hash. + + Params: $hashref - A reference to a hash which was created by + flatten_to_hash. + =item C<match> =over @@ -1247,6 +1439,17 @@ that should be passed to the C<set_> function that is called. =back +=head2 Simple Methods + +=over + +=item C<flatten_to_hash> + +Returns a hashref suitable for serialisation and re-inflation with C<new_from_hash>. + +=back + + =head2 Simple Validators You can use these in your subclass L</VALIDATORS> or L</UPDATE_VALIDATORS>. @@ -1261,6 +1464,58 @@ Returns C<1> if the passed-in value is true, C<0> otherwise. =back +=head2 CACHE FUNCTIONS + +=over + +=item C<object_cache_get> + +=over + +=item B<Description> + +Class function which returns an object from the object-cache for the provided +C<$id>. + +=item B<Params> + +Takes an integer C<$id> of the object to retrieve. + +=item B<Returns> + +Returns the object from the cache if found, otherwise returns C<undef>. + +=item B<Example> + +my $bug_from_cache = Bugzilla::Bug->object_cache_get(35); + +=back + +=item C<object_cache_set> + +=over + +=item B<Description> + +Object function which injects the object into the object-cache, using the +object's C<id> as the key. + +=item B<Params> + +(none) + +=item B<Returns> + +(nothing) + +=item B<Example> + +$bug->object_cache_set(); + +=back + +=back + =head1 CLASS FUNCTIONS =over @@ -1285,3 +1540,19 @@ C<0> otherwise. =back =cut + +=head1 B<Methods in need of POD> + +=over + +=item object_cache_key + +=item check_time + +=item id + +=item TO_JSON + +=item audit_log + +=back diff --git a/Bugzilla/Product.pm b/Bugzilla/Product.pm index fdebc6b00..30ebc7c6c 100644 --- a/Bugzilla/Product.pm +++ b/Bugzilla/Product.pm @@ -6,8 +6,12 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Product; + +use 5.10.1; use strict; -use base qw(Bugzilla::Field::ChoiceInterface Bugzilla::Object); +use warnings; + +use parent qw(Bugzilla::Field::ChoiceInterface Bugzilla::Object); use Bugzilla::Constants; use Bugzilla::Util; @@ -31,6 +35,8 @@ use constant DEFAULT_CLASSIFICATION_ID => 1; #### Initialization #### ############################### +use constant IS_CONFIG => 1; + use constant DB_TABLE => 'products'; use constant DB_COLUMNS => qw( @@ -97,6 +103,7 @@ sub create { Bugzilla::Hook::process('product_end_of_create', { product => $product }); $dbh->bz_commit_transaction(); + Bugzilla->memcached->clear_config(); return $product; } @@ -253,6 +260,7 @@ sub update { # Changes have been committed. delete $self->{check_group_controls}; Bugzilla->user->clear_product_cache(); + Bugzilla->memcached->clear_config(); return $changes; } @@ -270,8 +278,8 @@ sub remove_from_db { if (Bugzilla->params->{'allowbugdeletion'}) { require Bugzilla::Bug; foreach my $bug_id (@{$self->bug_ids}) { - # Note that we allow the user to delete bugs he can't see, - # which is okay, because he's deleting the whole Product. + # Note that we allow the user to delete bugs they can't see, + # which is okay, because they're deleting the whole Product. my $bug = new Bugzilla::Bug($bug_id); $bug->remove_from_db(); } @@ -311,6 +319,7 @@ sub remove_from_db { $self->SUPER::remove_from_db(); $dbh->bz_commit_transaction(); + Bugzilla->memcached->clear_config(); # We have to delete these internal variables, else we get # the old lists of products and classifications again. @@ -807,8 +816,8 @@ sub flag_types { sub classification { my $self = shift; - $self->{'classification'} ||= - new Bugzilla::Classification($self->classification_id); + $self->{'classification'} ||= + new Bugzilla::Classification({ id => $self->classification_id, cache => 1 }); return $self->{'classification'}; } @@ -1022,7 +1031,7 @@ a group is valid in a particular product.) Params: C<$user> - A Bugzilla::User object. - Returns C<1> If this user's groups allow him C<entry> access to + Returns C<1> If this user's groups allow them C<entry> access to this Product, C<0> otherwise. =item C<flag_types()> @@ -1067,3 +1076,37 @@ C<Bugzilla::Product::preload($products)>. L<Bugzilla::Object> =cut + +=head1 B<Methods in need of POD> + +=over + +=item set_allows_unconfirmed + +=item allows_unconfirmed + +=item set_name + +=item set_default_milestone + +=item set_group_controls + +=item create + +=item set_description + +=item set_is_active + +=item classification_id + +=item description + +=item default_milestone + +=item remove_from_db + +=item is_active + +=item update + +=back diff --git a/Bugzilla/RNG.pm b/Bugzilla/RNG.pm index 457d2cae0..96e442fa0 100644 --- a/Bugzilla/RNG.pm +++ b/Bugzilla/RNG.pm @@ -6,8 +6,12 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::RNG; + +use 5.10.1; use strict; -use base qw(Exporter); +use warnings; + +use parent qw(Exporter); use Bugzilla::Constants qw(ON_WINDOWS); use Math::Random::ISAAC; @@ -216,3 +220,15 @@ sub _win2k_seed { } 1; + +=head1 B<Methods in need of POD> + +=over + +=item srand + +=item rand + +=item irand + +=back diff --git a/Bugzilla/Report.pm b/Bugzilla/Report.pm index 4c9f33226..10af2ea9e 100644 --- a/Bugzilla/Report.pm +++ b/Bugzilla/Report.pm @@ -5,11 +5,13 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -use strict; - package Bugzilla::Report; -use base qw(Bugzilla::Object); +use 5.10.1; +use strict; +use warnings; + +use parent qw(Bugzilla::Object); use Bugzilla::CGI; use Bugzilla::Constants; @@ -132,3 +134,17 @@ of L<Bugzilla::Object>, and thus provides all methods that L<Bugzilla::Object> provides. =cut + +=head1 B<Methods in need of POD> + +=over + +=item create + +=item query + +=item set_query + +=item set_name + +=back diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm index d67df03dd..8097d5fb8 100644 --- a/Bugzilla/Search.pm +++ b/Bugzilla/Search.pm @@ -5,10 +5,13 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +package Bugzilla::Search; + +use 5.10.1; use strict; +use warnings; -package Bugzilla::Search; -use base qw(Exporter); +use parent qw(Exporter); @Bugzilla::Search::EXPORT = qw( IsValidQueryType split_order_term @@ -107,6 +110,7 @@ use Time::HiRes qw(gettimeofday tv_interval); # When doing searches, NULL datetimes are treated as this date. use constant EMPTY_DATETIME => '1970-01-01 00:00:00'; +use constant EMPTY_DATE => '1970-01-01'; # This is the regex for real numbers from Regexp::Common, modified to be # more readable. @@ -157,6 +161,8 @@ use constant OPERATORS => { changedfrom => \&_changedfrom_changedto, changedto => \&_changedfrom_changedto, changedby => \&_changedby, + isempty => \&_isempty, + isnotempty => \&_isnotempty, }; # Some operators are really just standard SQL operators, and are @@ -183,6 +189,8 @@ use constant OPERATOR_REVERSE => { lessthaneq => 'greaterthan', greaterthan => 'lessthaneq', greaterthaneq => 'lessthan', + isempty => 'isnotempty', + isnotempty => 'isempty', # The following don't currently have reversals: # casesubstring, anyexact, allwords, allwordssubstr }; @@ -198,6 +206,12 @@ use constant NON_NUMERIC_OPERATORS => qw( notregexp ); +# These operators ignore the entered value +use constant NO_VALUE_OPERATORS => qw( + isempty + isnotempty +); + use constant MULTI_SELECT_OVERRIDE => { notequals => \&_multiselect_negative, notregexp => \&_multiselect_negative, @@ -251,7 +265,7 @@ use constant OPERATOR_FIELD_OVERRIDE => { }, # General Bug Fields - alias => { _non_changed => \&_nullable }, + alias => { _non_changed => \&_alias_nonchanged }, 'attach_data.thedata' => MULTI_SELECT_OVERRIDE, # We check all attachment fields against this. attachments => MULTI_SELECT_OVERRIDE, @@ -303,7 +317,8 @@ use constant OPERATOR_FIELD_OVERRIDE => { _non_changed => \&_product_nonchanged, }, tag => MULTI_SELECT_OVERRIDE, - + comment_tag => MULTI_SELECT_OVERRIDE, + # Timetracking Fields deadline => { _non_changed => \&_deadline }, percentage_complete => { @@ -315,11 +330,16 @@ use constant OPERATOR_FIELD_OVERRIDE => { changedafter => \&_work_time_changedbefore_after, _default => \&_work_time, }, + last_visit_ts => { + _non_changed => \&_last_visit_ts, + _default => \&_last_visit_ts_invalid_operator, + }, # Custom Fields FIELD_TYPE_FREETEXT, { _non_changed => \&_nullable }, FIELD_TYPE_BUG_ID, { _non_changed => \&_nullable_int }, FIELD_TYPE_DATETIME, { _non_changed => \&_nullable_datetime }, + FIELD_TYPE_DATE, { _non_changed => \&_nullable_date }, FIELD_TYPE_TEXTAREA, { _non_changed => \&_nullable }, FIELD_TYPE_MULTI_SELECT, MULTI_SELECT_OVERRIDE, FIELD_TYPE_BUG_URLS, MULTI_SELECT_OVERRIDE, @@ -340,13 +360,19 @@ sub SPECIAL_PARSING { 'requestees.login_name' => \&_contact_pronoun, # Date Fields that accept the 1d, 1w, 1m, 1y, etc. format. - creation_ts => \&_timestamp_translate, - deadline => \&_timestamp_translate, - delta_ts => \&_timestamp_translate, + creation_ts => \&_datetime_translate, + deadline => \&_date_translate, + delta_ts => \&_datetime_translate, + + # last_visit field that accept both a 1d, 1w, 1m, 1y format and the + # %last_changed% pronoun. + last_visit_ts => \&_last_visit_datetime, }; foreach my $field (Bugzilla->active_custom_fields) { if ($field->type == FIELD_TYPE_DATETIME) { - $map->{$field->name} = \&_timestamp_translate; + $map->{$field->name} = \&_datetime_translate; + } elsif ($field->type == FIELD_TYPE_DATE) { + $map->{$field->name} = \&_date_translate; } } return $map; @@ -391,6 +417,7 @@ use constant FIELD_MAP => { bugidtype => 'bug_id_type', changedin => 'days_elapsed', long_desc => 'longdesc', + tags => 'tag', }; # Some fields are not sorted on themselves, but on other fields. @@ -429,6 +456,10 @@ sub COLUMN_JOINS { . ' FROM longdescs GROUP BY bug_id)', join => 'INNER', }, + alias => { + table => 'bugs_aliases', + as => 'map_alias', + }, assigned_to => { from => 'assigned_to', to => 'userid', @@ -484,6 +515,14 @@ sub COLUMN_JOINS { to => 'id', }, }, + blocked => { + table => 'dependencies', + to => 'dependson', + }, + dependson => { + table => 'dependencies', + to => 'blocked', + }, 'longdescs.count' => { table => 'longdescs', join => 'INNER', @@ -498,7 +537,14 @@ sub COLUMN_JOINS { from => 'map_bug_tag.tag_id', to => 'id', }, - } + }, + last_visit_ts => { + as => 'bug_user_last_visit', + table => 'bug_user_last_visit', + extra => ['bug_user_last_visit.user_id = ' . $user->id], + from => 'bug_id', + to => 'bug_id', + }, }; return $joins; }; @@ -544,6 +590,7 @@ sub COLUMNS { # like "bugs.bug_id". my $total_time = "(map_actual_time.total + bugs.remaining_time)"; my %special_sql = ( + alias => $dbh->sql_group_concat('DISTINCT map_alias.alias'), deadline => $dbh->sql_date_format('bugs.deadline', '%Y-%m-%d'), actual_time => 'map_actual_time.total', @@ -558,13 +605,18 @@ sub COLUMNS { . " END)", 'flagtypes.name' => $dbh->sql_group_concat('DISTINCT ' - . $dbh->sql_string_concat('map_flagtypes.name', 'map_flags.status')), + . $dbh->sql_string_concat('map_flagtypes.name', 'map_flags.status'), + undef, undef, 'map_flagtypes.sortkey, map_flagtypes.name'), 'keywords' => $dbh->sql_group_concat('DISTINCT map_keyworddefs.name'), + + blocked => $dbh->sql_group_concat('DISTINCT map_blocked.blocked'), + dependson => $dbh->sql_group_concat('DISTINCT map_dependson.dependson'), 'longdescs.count' => 'COUNT(DISTINCT map_longdescs_count.comment_id)', tag => $dbh->sql_group_concat('DISTINCT map_tag.name'), + last_visit_ts => 'bug_user_last_visit.last_visit_ts', ); # Backward-compatibility for old field names. Goes new_name => old_name. @@ -635,12 +687,7 @@ sub REPORT_COLUMNS { # or simply don't work with the current reporting system. my @no_report_columns = qw(bug_id alias short_short_desc opendate changeddate - flagtypes.name keywords relevance); - - # Multi-select fields are not currently supported. - my @multi_selects = @{Bugzilla->fields( - { obsolete => 0, type => FIELD_TYPE_MULTI_SELECT })}; - push(@no_report_columns, map { $_->name } @multi_selects); + flagtypes.name relevance); # If you're not a time-tracker, you can't use time-tracking # columns. @@ -658,7 +705,10 @@ sub REPORT_COLUMNS { # is here because it *always* goes into the GROUP BY as the first item, # so it should be skipped when determining extra GROUP BY columns. use constant GROUP_BY_SKIP => qw( + alias + blocked bug_id + dependson flagtypes.name keywords longdescs.count @@ -712,7 +762,7 @@ sub data { my @orig_fields = $self->_input_columns; my $all_in_bugs_table = 1; foreach my $field (@orig_fields) { - next if $self->COLUMNS->{$field}->{name} =~ /^bugs\.\w+$/; + next if ($self->COLUMNS->{$field}->{name} // $field) =~ /^bugs\.\w+$/; $self->{fields} = ['bug_id']; $all_in_bugs_table = 0; last; @@ -964,10 +1014,16 @@ sub _sql_select { my ($self) = @_; my @sql_fields; foreach my $column ($self->_display_columns) { - my $alias = $column; - # Aliases cannot contain dots in them. We convert them to underscores. - $alias =~ s/\./_/g; - my $sql = $self->COLUMNS->{$column}->{name} . " AS $alias"; + my $sql = $self->COLUMNS->{$column}->{name} // ''; + if ($sql) { + my $alias = $column; + # Aliases cannot contain dots in them. We convert them to underscores. + $alias =~ tr/./_/; + $sql .= " AS $alias"; + } + else { + $sql = $column; + } push(@sql_fields, $sql); } return @sql_fields; @@ -1210,9 +1266,12 @@ sub _standard_joins { push(@joins, $security_join); if ($user->id) { - $security_join->{extra} = - ["NOT (" . $user->groups_in_sql('security_map.group_id') . ")"]; - + # See also _standard_joins for the other half of the below statement + if (!Bugzilla->params->{'or_groups'}) { + $security_join->{extra} = + ["NOT (" . $user->groups_in_sql('security_map.group_id') . ")"]; + } + my $security_cc_join = { table => 'cc', as => 'security_cc', @@ -1286,10 +1345,17 @@ sub _standard_where { # until their group controls are set. So if a bug has a NULL creation_ts, # it shouldn't show up in searches at all. my @where = ('bugs.creation_ts IS NOT NULL'); - - my $security_term = 'security_map.group_id IS NULL'; my $user = $self->_user; + my $security_term = ''; + # See also _standard_joins for the other half of the below statement + if (Bugzilla->params->{'or_groups'}) { + $security_term .= " (security_map.group_id IS NULL OR security_map.group_id IN (" . $user->groups_as_string . "))"; + } + else { + $security_term = 'security_map.group_id IS NULL'; + } + if ($user->id) { my $userid = $user->id; # This indentation makes the resulting SQL more readable. @@ -1334,7 +1400,7 @@ sub _sql_group_by { my @extra_group_by; foreach my $column ($self->_select_columns) { next if $self->_skip_group_by->{$column}; - my $sql = $self->COLUMNS->{$column}->{name}; + my $sql = $self->COLUMNS->{$column}->{name} // $column; push(@extra_group_by, $sql); } @@ -1536,9 +1602,8 @@ sub _special_parse_chfield { sub _special_parse_deadline { my ($self) = @_; - return if !$self->_user->is_timetracker; my $params = $self->_params; - + my $clause = new Bugzilla::Search::Clause(); if (my $from = $params->{'deadlinefrom'}) { $clause->add('deadline', 'greaterthaneq', $from); @@ -1680,6 +1745,8 @@ sub _boolean_charts { my $field = $params->{"field$identifier"}; my $operator = $params->{"type$identifier"}; my $value = $params->{"value$identifier"}; + # no-value operators ignore the value, however a value needs to be set + $value = ' ' if $operator && grep { $_ eq $operator } NO_VALUE_OPERATORS; $or_clause->add($field, $operator, $value); } $and_clause->add($or_clause); @@ -1726,6 +1793,8 @@ sub _custom_search { my $operator = $params->{"o$id"}; my $value = $params->{"v$id"}; + # no-value operators ignore the value, however a value needs to be set + $value = ' ' if $operator && grep { $_ eq $operator } NO_VALUE_OPERATORS; my $condition = condition($field, $operator, $value); $condition->negate($params->{"n$id"}); $current_clause->add($condition); @@ -1755,20 +1824,30 @@ sub _handle_chart { my ($field, $operator, $value) = $condition->fov; return if (!defined $field or !defined $operator or !defined $value); $field = FIELD_MAP->{$field} || $field; - - my $string_value; + + my ($string_value, $orig_value); + state $is_mysql = $dbh->isa('Bugzilla::DB::Mysql') ? 1 : 0; + if (ref $value eq 'ARRAY') { # Trim input and ignore blank values. @$value = map { trim($_) } @$value; @$value = grep { defined $_ and $_ ne '' } @$value; return if !@$value; + $orig_value = join(',', @$value); + if ($field eq 'longdesc' && $is_mysql) { + @$value = map { _convert_unicode_characters($_) } @$value; + } $string_value = join(',', @$value); } else { return if $value eq ''; + $orig_value = $value; + if ($field eq 'longdesc' && $is_mysql) { + $value = _convert_unicode_characters($value); + } $string_value = $value; } - + $self->_chart_fields->{$field} or ThrowCodeError("invalid_field_name", { field => $field }); trick_taint($field); @@ -1812,7 +1891,7 @@ sub _handle_chart { # do_search_function modified them. $self->search_description({ field => $field, type => $operator, - value => $string_value, term => $search_args{term}, + value => $orig_value, term => $search_args{term}, }); foreach my $join (@{ $search_args{joins} }) { @@ -1823,6 +1902,18 @@ sub _handle_chart { $condition->translated(\%search_args); } +# XXX - This is a hack for MySQL which doesn't understand Unicode characters +# above U+FFFF, see Bugzilla::Comment::_check_thetext(). This hack can go away +# once we require MySQL 5.5.3 and use utf8mb4. +sub _convert_unicode_characters { + my $string = shift; + + # Perl 5.13.8 and older complain about non-characters. + no warnings 'utf8'; + $string =~ s/([\x{10000}-\x{10FFFF}])/"\x{FDD0}[" . uc(sprintf('U+%04x', ord($1))) . "]\x{FDD1}"/eg; + return $string; +} + ################################## # do_search_function And Helpers # ################################## @@ -2075,22 +2166,44 @@ sub _word_terms { ##################################### sub _timestamp_translate { - my ($self, $args) = @_; + my ($self, $ignore_time, $args) = @_; my $value = $args->{value}; my $dbh = Bugzilla->dbh; return if $value !~ /^(?:[\+\-]?\d+[hdwmy]s?|now)$/i; - # By default, the time is appended to the date, which we don't want - # for deadlines. $value = SqlifyDate($value); - if ($args->{field} eq 'deadline') { + # By default, the time is appended to the date, which we don't always want. + if ($ignore_time) { ($value) = split(/\s/, $value); } $args->{value} = $value; $args->{quoted} = $dbh->quote($value); } +sub _datetime_translate { + return shift->_timestamp_translate(0, @_); +} + +sub _last_visit_datetime { + my ($self, $args) = @_; + my $value = $args->{value}; + + $self->_datetime_translate($args); + if ($value eq $args->{value}) { + # Failed to translate a datetime. let's try the pronoun expando. + if ($value eq '%last_changed%') { + $self->_add_extra_column('changeddate'); + $args->{value} = $args->{quoted} = 'bugs.delta_ts'; + } + } +} + + +sub _date_translate { + return shift->_timestamp_translate(1, @_); +} + sub SqlifyDate { my ($str) = @_; my $fmt = "%Y-%m-%d %H:%M:%S"; @@ -2178,7 +2291,8 @@ sub pronoun { if ($noun eq "%qacontact%") { return "COALESCE(bugs.qa_contact,0)"; } - return 0; + + ThrowUserError('illegal_pronoun', { pronoun => $noun }); } sub _contact_pronoun { @@ -2354,7 +2468,7 @@ sub _user_nonchanged { # For negative operators, the system we're using here # only works properly if we reverse the operator and check IS NULL # in the WHERE. - my $is_negative = $operator =~ /^no/ ? 1 : 0; + my $is_negative = $operator =~ /^(?:no|isempty)/ ? 1 : 0; if ($is_negative) { $args->{operator} = $self->_reverse_operator($operator); } @@ -2442,6 +2556,11 @@ sub _long_desc_nonchanged { my ($self, $args) = @_; my ($chart_id, $operator, $value, $joins, $bugs_table) = @$args{qw(chart_id operator value joins bugs_table)}; + + if ($operator =~ /^is(not)?empty$/) { + $args->{term} = $self->_multiselect_isempty($args, $operator eq 'isnotempty'); + return; + } my $dbh = Bugzilla->dbh; my $table = "longdescs_$chart_id"; @@ -2583,6 +2702,21 @@ sub _percentage_complete { $self->_add_extra_column('actual_time'); } +sub _last_visit_ts { + my ($self, $args) = @_; + + $args->{full_field} = $self->COLUMNS->{last_visit_ts}->{name}; + $self->_add_extra_column('last_visit_ts'); +} + +sub _last_visit_ts_invalid_operator { + my ($self, $args) = @_; + + ThrowUserError('search_field_operator_invalid', + { field => $args->{field}, + operator => $args->{operator} }); +} + sub _days_elapsed { my ($self, $args) = @_; my $dbh = Bugzilla->dbh; @@ -2612,6 +2746,15 @@ sub _product_nonchanged { "products.id", "products", $term); } +sub _alias_nonchanged { + my ($self, $args) = @_; + + $args->{full_field} = "bugs_aliases.alias"; + $self->_do_operator_function($args); + $args->{term} = build_subselect("bugs.bug_id", + "bugs_aliases.bug_id", "bugs_aliases", $args->{term}); +} + sub _classification_nonchanged { my ($self, $args) = @_; my $joins = $args->{joins}; @@ -2646,6 +2789,13 @@ sub _nullable_datetime { $args->{full_field} = "COALESCE($field, $empty)"; } +sub _nullable_date { + my ($self, $args) = @_; + my $field = $args->{full_field}; + my $empty = Bugzilla->dbh->quote(EMPTY_DATE); + $args->{full_field} = "COALESCE($field, $empty)"; +} + sub _deadline { my ($self, $args) = @_; my $field = $args->{full_field}; @@ -2734,6 +2884,12 @@ sub _flagtypes_nonchanged { my ($self, $args) = @_; my ($chart_id, $operator, $value, $joins, $bugs_table, $condition) = @$args{qw(chart_id operator value joins bugs_table condition)}; + + if ($operator =~ /^is(not)?empty$/) { + $args->{term} = $self->_multiselect_isempty($args, $operator eq 'isnotempty'); + return; + } + my $dbh = Bugzilla->dbh; # For 'not' operators, we need to negate the whole term. @@ -2838,10 +2994,12 @@ sub _multiselect_table { return "attachments INNER JOIN attach_data " . " ON attachments.attach_id = attach_data.id" } - elsif ($field eq 'flagtypes.name') { - $args->{full_field} = $dbh->sql_string_concat("flagtypes.name", - "flags.status"); - return "flags INNER JOIN flagtypes ON flags.type_id = flagtypes.id"; + elsif ($field eq 'comment_tag') { + $args->{_extra_where} = " AND longdescs.isprivate = 0" + if !$self->_user->is_insider; + $args->{full_field} = 'longdescs_tags.tag'; + return "longdescs INNER JOIN longdescs_tags". + " ON longdescs.comment_id = longdescs_tags.comment_id"; } my $table = "bug_$field"; $args->{full_field} = "bug_$field.value"; @@ -2850,6 +3008,11 @@ sub _multiselect_table { sub _multiselect_term { my ($self, $args, $not) = @_; + my ($operator) = $args->{operator}; + my $value = $args->{value} || ''; + # 'empty' operators require special handling + return $self->_multiselect_isempty($args, $not) + if ($operator =~ /^is(not)?empty$/ || $value eq '---'); my $table = $self->_multiselect_table($args); $self->_do_operator_function($args); my $term = $args->{term}; @@ -2858,6 +3021,125 @@ sub _multiselect_term { return build_subselect("$args->{bugs_table}.bug_id", $select, $table, $term, $not); } +# We can't use the normal operator_functions to build isempty queries which +# join to different tables. +sub _multiselect_isempty { + my ($self, $args, $not) = @_; + my ($field, $operator, $joins, $chart_id) = @$args{qw(field operator joins chart_id)}; + my $dbh = Bugzilla->dbh; + $operator = $self->_reverse_operator($operator) if $not; + $not = $operator eq 'isnotempty' ? 'NOT' : ''; + + if ($field eq 'keywords') { + push @$joins, { + table => 'keywords', + as => "keywords_$chart_id", + from => 'bug_id', + to => 'bug_id', + }; + return "keywords_$chart_id.bug_id IS $not NULL"; + } + elsif ($field eq 'bug_group') { + push @$joins, { + table => 'bug_group_map', + as => "bug_group_map_$chart_id", + from => 'bug_id', + to => 'bug_id', + }; + return "bug_group_map_$chart_id.bug_id IS $not NULL"; + } + elsif ($field eq 'flagtypes.name') { + push @$joins, { + table => 'flags', + as => "flags_$chart_id", + from => 'bug_id', + to => 'bug_id', + }; + return "flags_$chart_id.bug_id IS $not NULL"; + } + elsif ($field eq 'blocked' or $field eq 'dependson') { + my $to = $field eq 'blocked' ? 'dependson' : 'blocked'; + push @$joins, { + table => 'dependencies', + as => "dependencies_$chart_id", + from => 'bug_id', + to => $to, + }; + return "dependencies_$chart_id.$to IS $not NULL"; + } + elsif ($field eq 'longdesc') { + my @extra = ( "longdescs_$chart_id.type != " . CMT_HAS_DUPE ); + push @extra, "longdescs_$chart_id.isprivate = 0" + unless $self->_user->is_insider; + push @$joins, { + table => 'longdescs', + as => "longdescs_$chart_id", + from => 'bug_id', + to => 'bug_id', + extra => \@extra, + }; + return $not + ? "longdescs_$chart_id.thetext != ''" + : "longdescs_$chart_id.thetext = ''"; + } + elsif ($field eq 'longdescs.isprivate') { + ThrowUserError('search_field_operator_invalid', { field => $field, + operator => $operator }); + } + elsif ($field =~ /^attachments\.(.+)/) { + my $sub_field = $1; + if ($sub_field eq 'description' || $sub_field eq 'filename' || $sub_field eq 'mimetype') { + # can't be null/empty + return $not ? '1=1' : '1=2'; + } else { + # all other fields which get here are boolean + ThrowUserError('search_field_operator_invalid', { field => $field, + operator => $operator }); + } + } + elsif ($field eq 'attach_data.thedata') { + push @$joins, { + table => 'attachments', + as => "attachments_$chart_id", + from => 'bug_id', + to => 'bug_id', + extra => [ $self->_user->is_insider ? '' : "attachments_$chart_id.isprivate = 0" ], + }; + push @$joins, { + table => 'attach_data', + as => "attach_data_$chart_id", + from => "attachments_$chart_id.attach_id", + to => 'id', + }; + return "attach_data_$chart_id.thedata IS $not NULL"; + } + elsif ($field eq 'tag') { + push @$joins, { + table => 'bug_tag', + as => "bug_tag_$chart_id", + from => 'bug_id', + to => 'bug_id', + }; + push @$joins, { + table => 'tag', + as => "tag_$chart_id", + from => "bug_tag_$chart_id.tag_id", + to => 'id', + extra => [ "tag_$chart_id.user_id = " . ($self->_sharer_id || $self->_user->id) ], + }; + return "tag_$chart_id.id IS $not NULL"; + } + elsif ($self->_multi_select_fields->{$field}) { + push @$joins, { + table => "bug_$field", + as => "bug_${field}_$chart_id", + from => 'bug_id', + to => 'bug_id', + }; + return "bug_${field}_$chart_id.bug_id IS $not NULL"; + } +} + ############################### # Standard Operator Functions # ############################### @@ -3074,6 +3356,27 @@ sub _changed_security_check { } } +sub _isempty { + my ($self, $args) = @_; + my $full_field = $args->{full_field}; + $args->{term} = "$full_field IS NULL OR $full_field = " . $self->_empty_value($args->{field}); +} + +sub _isnotempty { + my ($self, $args) = @_; + my $full_field = $args->{full_field}; + $args->{term} = "$full_field IS NOT NULL AND $full_field != " . $self->_empty_value($args->{field}); +} + +sub _empty_value { + my ($self, $field) = @_; + my $field_obj = $self->_chart_fields->{$field}; + return "0" if $field_obj->type == FIELD_TYPE_BUG_ID; + return Bugzilla->dbh->quote(EMPTY_DATETIME) if $field_obj->type == FIELD_TYPE_DATETIME; + return Bugzilla->dbh->quote(EMPTY_DATE) if $field_obj->type == FIELD_TYPE_DATE; + return "''"; +} + ###################### # Public Subroutines # ###################### @@ -3177,7 +3480,7 @@ value for this field. At least one search criteria must be defined if the =item C<sharer> -When a saved search is shared by a user, this is his user ID. +When a saved search is shared by a user, this is their user ID. =item C<user> @@ -3228,3 +3531,35 @@ two hashes if two SQL queries have been executed sequentially to get all the required data. =back + +=head1 B<Methods in need of POD> + +=over + +=item invalid_order_columns + +=item COLUMN_JOINS + +=item split_order_term + +=item SqlifyDate + +=item REPORT_COLUMNS + +=item pronoun + +=item COLUMNS + +=item order + +=item search_description + +=item IsValidQueryType + +=item build_subselect + +=item do_search_function + +=item boolean_charts_to_custom_search + +=back diff --git a/Bugzilla/Search/Clause.pm b/Bugzilla/Search/Clause.pm index 6214ab197..1d7872c78 100644 --- a/Bugzilla/Search/Clause.pm +++ b/Bugzilla/Search/Clause.pm @@ -6,7 +6,10 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Search::Clause; + +use 5.10.1; use strict; +use warnings; use Bugzilla::Error; use Bugzilla::Search::Condition qw(condition); @@ -131,3 +134,27 @@ sub as_params { } 1; + +=head1 B<Methods in need of POD> + +=over + +=item has_translated_conditions + +=item as_string + +=item add + +=item children + +=item negate + +=item update_search_args + +=item walk_conditions + +=item joiner + +=item as_params + +=back diff --git a/Bugzilla/Search/ClauseGroup.pm b/Bugzilla/Search/ClauseGroup.pm index 83961e12b..590c737fa 100644 --- a/Bugzilla/Search/ClauseGroup.pm +++ b/Bugzilla/Search/ClauseGroup.pm @@ -7,9 +7,11 @@ package Bugzilla::Search::ClauseGroup; +use 5.10.1; use strict; +use warnings; -use base qw(Bugzilla::Search::Clause); +use parent qw(Bugzilla::Search::Clause); use Bugzilla::Error; use Bugzilla::Search::Condition qw(condition); @@ -97,3 +99,13 @@ sub update_search_args { } 1; + +=head1 B<Methods in need of POD> + +=over + +=item add + +=item update_search_args + +=back diff --git a/Bugzilla/Search/Condition.pm b/Bugzilla/Search/Condition.pm index fb899afbc..306a63eed 100644 --- a/Bugzilla/Search/Condition.pm +++ b/Bugzilla/Search/Condition.pm @@ -6,8 +6,12 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Search::Condition; + +use 5.10.1; use strict; -use base qw(Exporter); +use warnings; + +use parent qw(Exporter); our @EXPORT_OK = qw(condition); sub new { @@ -73,3 +77,27 @@ sub condition { } 1; + +=head1 B<Methods in need of POD> + +=over + +=item as_string + +=item fov + +=item value + +=item negate + +=item translated + +=item operator + +=item as_params + +=item condition + +=item field + +=back diff --git a/Bugzilla/Search/Quicksearch.pm b/Bugzilla/Search/Quicksearch.pm index 16772c2b2..f062161d8 100644 --- a/Bugzilla/Search/Quicksearch.pm +++ b/Bugzilla/Search/Quicksearch.pm @@ -7,8 +7,9 @@ package Bugzilla::Search::Quicksearch; -# Make it harder for us to do dangerous things in Perl. +use 5.10.1; use strict; +use warnings; use Bugzilla::Error; use Bugzilla::Constants; @@ -21,7 +22,7 @@ use List::Util qw(min max); use List::MoreUtils qw(firstidx); use Text::ParseWords qw(parse_line); -use base qw(Exporter); +use parent qw(Exporter); @Bugzilla::Search::Quicksearch::EXPORT = qw(quicksearch); # Custom mappings for some fields. @@ -103,6 +104,17 @@ use constant FIELD_OPERATOR => { owner_idle_time => 'greaterthan', }; +# Mappings for operators symbols to support operators other than "substring" +use constant OPERATOR_SYMBOLS => { + ':' => 'substring', + '=' => 'equals', + '!=' => 'notequals', + '>=' => 'greaterthaneq', + '<=' => 'lessthaneq', + '>' => 'greaterthan', + '<' => 'lessthan', +}; + # We might want to put this into localconfig or somewhere use constant PRODUCT_EXCEPTIONS => ( 'row', # [Browser] @@ -196,6 +208,7 @@ sub quicksearch { foreach my $qsword (@qswords) { my @or_operand = _parse_line('\|', 1, $qsword); foreach my $term (@or_operand) { + next unless defined $term; my $negate = substr($term, 0, 1) eq '-'; if ($negate) { $term = substr($term, 1); @@ -262,6 +275,8 @@ sub quicksearch { sub _parse_line { my ($delim, $keep, $line) = @_; + return () unless defined $line; + # parse_line always treats ' as a quote character, making it impossible # to sanely search for contractions. As this behavour isn't # configurable, we replace ' with a placeholder to hide it from the @@ -276,7 +291,7 @@ sub _parse_line { my @words = parse_line($delim, $keep, $line); foreach my $word (@words) { - $word =~ tr/\000/'/; + $word =~ tr/\000/'/ if defined $word; } return @words; } @@ -287,7 +302,7 @@ sub _bug_numbers_only { # Allow separation by comma or whitespace. $searchstring =~ s/[,\s]+/,/g; - if ($searchstring !~ /,/) { + if ($searchstring !~ /,/ && !i_am_webservice()) { # Single bug number; shortcut to show_bug.cgi. print $cgi->redirect( -uri => correct_urlbase() . "show_bug.cgi?id=$searchstring"); @@ -307,9 +322,10 @@ sub _handle_alias { my $alias = $1; # We use this direct SQL because we want quicksearch to be VERY fast. my $bug_id = Bugzilla->dbh->selectrow_array( - q{SELECT bug_id FROM bugs WHERE alias = ?}, undef, $alias); - # If the user cannot see the bug, do not resolve its alias. - if ($bug_id && Bugzilla->user->can_see_bug($bug_id)) { + q{SELECT bug_id FROM bugs_aliases WHERE alias = ?}, undef, $alias); + # If the user cannot see the bug or if we are using a webservice, + # do not resolve its alias. + if ($bug_id && Bugzilla->user->can_see_bug($bug_id) && !i_am_webservice()) { $alias = url_quote($alias); print Bugzilla->cgi->redirect( -uri => correct_urlbase() . "show_bug.cgi?id=$alias"); @@ -348,6 +364,7 @@ sub _handle_status_and_resolution { sub _handle_special_first_chars { my ($qsword, $negate) = @_; + return 0 if !defined $qsword || length($qsword) <= 1; my $firstChar = substr($qsword, 0, 1); my $baseWord = substr($qsword, 1); @@ -386,8 +403,13 @@ sub _handle_field_names { # Generic field1,field2,field3:value1,value2 notation. # We have to correctly ignore commas and colons in quotes. - my @field_values = _parse_line(':', 1, $or_operand); - if (scalar @field_values == 2) { + # Longer operators must be tested first as we don't want single character + # operators such as <, > and = to be tested before <=, >= and !=. + my @operators = sort { length($b) <=> length($a) } keys %{ OPERATOR_SYMBOLS() }; + + foreach my $symbol (@operators) { + my @field_values = _parse_line($symbol, 1, $or_operand); + next unless scalar @field_values == 2; my @fields = _parse_line(',', 1, $field_values[0]); my @values = _parse_line(',', 1, $field_values[1]); foreach my $field (@fields) { @@ -406,7 +428,9 @@ sub _handle_field_names { $bug_status_set = 1; } foreach my $value (@values) { - my $operator = FIELD_OPERATOR->{$translated} || 'substring'; + my $operator = FIELD_OPERATOR->{$translated} + || OPERATOR_SYMBOLS->{$symbol} + || 'substring'; # If the string was quoted to protect some special # characters such as commas and colons, we need # to remove quotes. @@ -448,7 +472,7 @@ sub _handle_flags { # are unable to run queries of the form (a AND b) OR c. In our case: # (flag name is foo AND requestee is bar) OR (any other criteria). # But this has never been possible, so this is not a regression. If one - # needs to run such queries, he must use the Custom Search section of + # needs to run such queries, they must use the Custom Search section of # the Advanced Search page. $chart++; $and = $or = 0; @@ -654,3 +678,21 @@ sub makeChart { } 1; + +=head1 B<Methods in need of POD> + +=over + +=item FIELD_MAP + +=item quicksearch + +=item negateComparisonType + +=item makeChart + +=item addChart + +=item matchPrefixes + +=back diff --git a/Bugzilla/Search/Recent.pm b/Bugzilla/Search/Recent.pm index 1ff56c7e3..e774c7fe0 100644 --- a/Bugzilla/Search/Recent.pm +++ b/Bugzilla/Search/Recent.pm @@ -6,8 +6,12 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Search::Recent; + +use 5.10.1; use strict; -use base qw(Bugzilla::Object); +use warnings; + +use parent qw(Bugzilla::Object); use Bugzilla::Constants; use Bugzilla::Error; @@ -39,6 +43,9 @@ use constant VALIDATORS => { use constant UPDATE_COLUMNS => qw(bug_list list_order); +# There's no gain to caching these objects +use constant USE_MEMCACHED => 0; + ################### # DB Manipulation # ################### @@ -157,3 +164,27 @@ Bugzilla::Search::Recent - A search recently run by a logged-in user. This is an implementation of L<Bugzilla::Object>, and so has all the same methods available as L<Bugzilla::Object>, in addition to what is documented below. + +=head1 B<Methods in need of POD> + +=over + +=item create + +=item list_order + +=item check_quietly + +=item new_from_cookie + +=item create_placeholder + +=item bug_list + +=item set_bug_list + +=item user_id + +=item set_list_order + +=back diff --git a/Bugzilla/Search/Saved.pm b/Bugzilla/Search/Saved.pm index c9885c9ce..50a9cdd67 100644 --- a/Bugzilla/Search/Saved.pm +++ b/Bugzilla/Search/Saved.pm @@ -5,11 +5,13 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -use strict; - package Bugzilla::Search::Saved; -use base qw(Bugzilla::Object); +use 5.10.1; +use strict; +use warnings; + +use parent qw(Bugzilla::Object); use Bugzilla::CGI; use Bugzilla::Constants; @@ -186,6 +188,7 @@ sub rename_field_value { } $dbh->do("UPDATE $table SET query = ? WHERE $id_field = ?", undef, $query, $id); + Bugzilla->memcached->clear({ table => $table, id => $id }); } $dbh->bz_commit_transaction(); @@ -288,9 +291,8 @@ sub url { return $_[0]->{'query'}; } sub user { my ($self) = @_; - return $self->{user} if defined $self->{user}; - $self->{user} = new Bugzilla::User($self->{userid}); - return $self->{user}; + return $self->{user} ||= + Bugzilla::User->new({ id => $self->{userid}, cache => 1 }); } ############ @@ -385,3 +387,21 @@ Returns how many users (besides the author of the saved search) are using the saved search, i.e. have it displayed in their footer. =back + +=head1 B<Methods in need of POD> + +=over + +=item create + +=item set_name + +=item set_url + +=item rename_field_value + +=item user + +=item used_in_whine + +=back diff --git a/Bugzilla/Send/Sendmail.pm b/Bugzilla/Sender/Transport/Sendmail.pm index 012cd6f28..49f00777f 100644 --- a/Bugzilla/Send/Sendmail.pm +++ b/Bugzilla/Sender/Transport/Sendmail.pm @@ -5,56 +5,49 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -package Bugzilla::Send::Sendmail; +package Bugzilla::Sender::Transport::Sendmail; +use 5.10.1; use strict; +use warnings; -use base qw(Email::Send::Sendmail); +use parent qw(Email::Sender::Transport::Sendmail); -use Return::Value; -use Symbol qw(gensym); +use Email::Sender::Failure; -sub send { - my ($class, $message, @args) = @_; - my $mailer = $class->_find_sendmail; +sub send_email { + my ($self, $email, $envelope) = @_; - return failure "Couldn't find 'sendmail' executable in your PATH" - ." and Email::Send::Sendmail::SENDMAIL is not set" - unless $mailer; + my $pipe = $self->_sendmail_pipe($envelope); - return failure "Found $mailer but cannot execute it" - unless -x $mailer; - - local $SIG{'CHLD'} = 'DEFAULT'; + my $string = $email->as_string; + $string =~ s/\x0D\x0A/\x0A/g unless $^O eq 'MSWin32'; - my $pipe = gensym; + print $pipe $string + or Email::Sender::Failure->throw("couldn't send message to sendmail: $!"); - open($pipe, "|-", "$mailer -t -oi @args") - || return failure "Error executing $mailer: $!"; - print($pipe $message->as_string) - || return failure "Error printing via pipe to $mailer: $!"; unless (close $pipe) { - return failure "error when closing pipe to $mailer: $!" if $!; + Email::Sender::Failure->throw("error when closing pipe to sendmail: $!") if $!; my ($error_message, $is_transient) = _map_exitcode($? >> 8); if (Bugzilla->params->{'use_mailer_queue'}) { # Return success for errors which are fatal so Bugzilla knows to - # remove them from the queue + # remove them from the queue. if ($is_transient) { - return failure "error when closing pipe to $mailer: $error_message"; + Email::Sender::Failure->throw("error when closing pipe to sendmail: $error_message"); } else { - warn "error when closing pipe to $mailer: $error_message\n"; - return success; + warn "error when closing pipe to sendmail: $error_message\n"; + return $self->success; } } else { - return failure "error when closing pipe to $mailer: $error_message"; + Email::Sender::Failure->throw("error when closing pipe to sendmail: $error_message"); } } - return success; + return $self->success; } sub _map_exitcode { # Returns (error message, is_transient) - # from the sendmail source (sendmail/sysexit.h) + # from the sendmail source (sendmail/sysexits.h) my $code = shift; if ($code == 64) { return ("Command line usage error (EX_USAGE)", 1); @@ -93,3 +86,10 @@ sub _map_exitcode { 1; +=head1 B<Methods in need of POD> + +=over + +=item send_email + +=back diff --git a/Bugzilla/Series.pm b/Bugzilla/Series.pm index f2ed9a4af..22202c6f1 100644 --- a/Bugzilla/Series.pm +++ b/Bugzilla/Series.pm @@ -5,8 +5,6 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -use strict; - # This module implements a series - a set of data to be plotted on a chart. # # This Series is in the database if and only if self->{'series_id'} is defined. @@ -16,6 +14,10 @@ use strict; package Bugzilla::Series; +use 5.10.1; +use strict; +use warnings; + use Bugzilla::Error; use Bugzilla::Util; @@ -269,3 +271,29 @@ sub remove_from_db { } 1; + +=head1 B<Methods in need of POD> + +=over + +=item creator + +=item existsInDatabase + +=item name + +=item getCategoryID + +=item initFromParameters + +=item initFromCGI + +=item initFromDatabase + +=item remove_from_db + +=item writeToDatabase + +=item id + +=back diff --git a/Bugzilla/Status.pm b/Bugzilla/Status.pm index 2821f7c6e..275510216 100644 --- a/Bugzilla/Status.pm +++ b/Bugzilla/Status.pm @@ -5,16 +5,17 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -use strict; - package Bugzilla::Status; -use Bugzilla::Error; +use 5.10.1; +use strict; +use warnings; + # This subclasses Bugzilla::Field::Choice instead of implementing # ChoiceInterface, because a bug status literally is a special type # of Field::Choice, not just an object that happens to have the same # methods. -use base qw(Bugzilla::Field::Choice Exporter); +use parent qw(Bugzilla::Field::Choice Exporter); @Bugzilla::Status::EXPORT = qw( BUG_STATE_OPEN SPECIAL_STATUS_WORKFLOW_ACTIONS @@ -23,6 +24,8 @@ use base qw(Bugzilla::Field::Choice Exporter); closed_bug_statuses ); +use Bugzilla::Error; + ################################ ##### Initialization ##### ################################ @@ -106,11 +109,21 @@ sub _check_value { sub BUG_STATE_OPEN { my $dbh = Bugzilla->dbh; - my $cache = Bugzilla->request_cache; - $cache->{status_bug_state_open} ||= - $dbh->selectcol_arrayref('SELECT value FROM bug_status - WHERE is_open = 1'); - return @{ $cache->{status_bug_state_open} }; + my $request_cache = Bugzilla->request_cache; + my $cache_key = 'status_bug_state_open'; + return @{ $request_cache->{$cache_key} } + if exists $request_cache->{$cache_key}; + + my $rows = Bugzilla->memcached->get_config({ key => $cache_key }); + if (!$rows) { + $rows = $dbh->selectcol_arrayref( + 'SELECT value FROM bug_status WHERE is_open = 1' + ); + Bugzilla->memcached->set_config({ key => $cache_key, data => $rows }); + } + + $request_cache->{$cache_key} = $rows; + return @$rows; } # Tells you whether or not the argument is a valid "open" state. @@ -295,3 +308,27 @@ C<1> if a comment is required on this change, C<0> if not. =back =cut + +=head1 B<Methods in need of POD> + +=over + +=item create + +=item BUG_STATE_OPEN + +=item is_static + +=item is_open_state + +=item is_active + +=item remove_from_db + +=item DB_COLUMNS + +=item is_open + +=item VALIDATORS + +=back diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm index 019809c60..cd33efd89 100644 --- a/Bugzilla/Template.pm +++ b/Bugzilla/Template.pm @@ -8,7 +8,9 @@ package Bugzilla::Template; +use 5.10.1; use strict; +use warnings; use Bugzilla::Constants; use Bugzilla::WebService::Constants; @@ -16,6 +18,7 @@ use Bugzilla::Hook; use Bugzilla::Install::Requirements; use Bugzilla::Install::Util qw(install_string template_include_path include_languages); +use Bugzilla::Classification; use Bugzilla::Keyword; use Bugzilla::Util; use Bugzilla::Error; @@ -25,15 +28,17 @@ use Bugzilla::Token; use Cwd qw(abs_path); use MIME::Base64; use Date::Format (); +use Digest::MD5 qw(md5_hex); use File::Basename qw(basename dirname); use File::Find; use File::Path qw(rmtree mkpath); +use File::Slurp; use File::Spec; use IO::Dir; use List::MoreUtils qw(firstidx); use Scalar::Util qw(blessed); -use base qw(Template); +use parent qw(Template); use constant FORMAT_TRIPLE => '%19s|%-28s|%-28s'; use constant FORMAT_3_SIZE => [19,28,28]; @@ -95,8 +100,8 @@ sub get_format { my $self = shift; my ($template, $format, $ctype) = @_; - $ctype ||= 'html'; - $format ||= ''; + $ctype //= 'html'; + $format //= ''; # ctype and format can have letters and a hyphen only. if ($ctype =~ /[^a-zA-Z\-]/ || $format =~ /[^a-zA-Z\-]/) { @@ -157,6 +162,10 @@ sub quoteUrls { # until we require Perl 5.13.9 or newer. no warnings 'utf8'; + # If the comment is already wrapped, we should ignore newlines when + # looking for matching regexps. Else we should take them into account. + my $s = ($comment && $comment->already_wrapped) ? qr/\s/ : qr/\h/; + # However, note that adding the title (for buglinks) can affect things # In particular, attachment matches go before bug titles, so that titles # with 'attachment 1' don't double match. @@ -223,7 +232,7 @@ sub quoteUrls { ~<a href=\"mailto:$2\">$1$2</a>~igx; # attachment links - $text =~ s~\b(attachment\s*\#?\s*(\d+)(?:\s+\[details\])?) + $text =~ s~\b(attachment$s*\#?$s*(\d+)(?:$s+\[details\])?) ~($things[$count++] = get_attachment_link($2, $1, $user)) && ("\x{FDD2}" . ($count-1) . "\x{FDD3}") ~egmxi; @@ -236,14 +245,40 @@ sub quoteUrls { # Also, we can't use $bug_re?$comment_re? because that will match the # empty string my $bug_word = template_var('terms')->{bug}; - my $bug_re = qr/\Q$bug_word\E\s*\#?\s*(\d+)/i; - my $comment_re = qr/comment\s*\#?\s*(\d+)/i; - $text =~ s~\b($bug_re(?:\s*,?\s*$comment_re)?|$comment_re) + my $bug_re = qr/\Q$bug_word\E$s*\#?$s*(\d+)/i; + my $comment_word = template_var('terms')->{comment}; + my $comment_re = qr/(?:\Q$comment_word\E|comment)$s*\#?$s*(\d+)/i; + $text =~ s~\b($bug_re(?:$s*,?$s*$comment_re)?|$comment_re) ~ # We have several choices. $1 here is the link, and $2-4 are set # depending on which part matched (defined($2) ? get_bug_link($2, $1, { comment_num => $3, user => $user }) : "<a href=\"$current_bugurl#c$4\">$1</a>") - ~egox; + ~egx; + + # Handle a list of bug ids: bugs 1, #2, 3, 4 + # Currently, the only delimiter supported is comma. + # Concluding "and" and "or" are not supported. + my $bugs_word = template_var('terms')->{bugs}; + + my $bugs_re = qr/\Q$bugs_word\E$s*\#?$s* + \d+(?:$s*,$s*\#?$s*\d+)+/ix; + + $text =~ s{($bugs_re)}{ + my $match = $1; + $match =~ s/((?:#$s*)?(\d+))/get_bug_link($2, $1);/eg; + $match; + }eg; + + my $comments_word = template_var('terms')->{comments}; + + my $comments_re = qr/(?:comments|\Q$comments_word\E)$s*\#?$s* + \d+(?:$s*,$s*\#?$s*\d+)+/ix; + + $text =~ s{($comments_re)}{ + my $match = $1; + $match =~ s|((?:#$s*)?(\d+))|<a href="$current_bugurl#c$2">$1</a>|g; + $match; + }eg; # Old duplicate markers. These don't use $bug_word because they are old # and were never customizable. @@ -264,10 +299,9 @@ sub quoteUrls { # Creates a link to an attachment, including its title. sub get_attachment_link { my ($attachid, $link_text, $user) = @_; - my $dbh = Bugzilla->dbh; $user ||= Bugzilla->user; - my $attachment = new Bugzilla::Attachment($attachid); + my $attachment = new Bugzilla::Attachment({ id => $attachid, cache => 1 }); if ($attachment) { my $title = ""; @@ -324,12 +358,11 @@ sub get_bug_link { my ($bug, $link_text, $options) = @_; $options ||= {}; $options->{user} ||= Bugzilla->user; - my $dbh = Bugzilla->dbh; - if (defined $bug) { + if (defined $bug && $bug ne '') { if (!blessed($bug)) { require Bugzilla::Bug; - $bug = new Bugzilla::Bug($bug); + $bug = new Bugzilla::Bug({ id => $bug, cache => 1 }); } return $link_text if $bug->{error}; } @@ -395,18 +428,18 @@ sub mtime_filter { # Set up the skin CSS cascade: # -# 1. YUI CSS -# 2. Standard Bugzilla stylesheet set (persistent) -# 3. Third-party "skin" stylesheet set, per user prefs (persistent) -# 4. Page-specific styles -# 5. Custom Bugzilla stylesheet set (persistent) +# 1. standard/global.css +# 2. YUI CSS +# 3. Standard Bugzilla stylesheet set +# 4. Third-party "skin" stylesheet set, per user prefs +# 5. Inline css passed to global/header.html.tmpl +# 6. Custom Bugzilla stylesheet set sub css_files { my ($style_urls, $yui, $yui_css) = @_; - - # global.css goes on every page, and so does IE-fixes.css. - my @requested_css = ('skins/standard/global.css', @$style_urls, - 'skins/standard/IE-fixes.css'); + + # global.css goes on every page. + my @requested_css = ('skins/standard/global.css', @$style_urls); my @yui_required_css; foreach my $yui_name (@$yui) { @@ -423,7 +456,12 @@ sub css_files { push(@{ $by_type{$key} }, $set->{$key}); } } - + + # build unified + $by_type{unified_standard_skin} = _concatenate_css($by_type{standard}, + $by_type{skin}); + $by_type{unified_custom} = _concatenate_css($by_type{custom}); + return \%by_type; } @@ -431,30 +469,137 @@ sub _css_link_set { my ($file_name) = @_; my %set = (standard => mtime_filter($file_name)); - - # We use (^|/) to allow Extensions to use the skins system if they - # want. - if ($file_name !~ m{(^|/)skins/standard/}) { + + # We use (?:^|/) to allow Extensions to use the skins system if they want. + if ($file_name !~ m{(?:^|/)skins/standard/}) { return \%set; } my $skin = Bugzilla->user->settings->{skin}->{value}; my $cgi_path = bz_locations()->{'cgi_path'}; my $skin_file_name = $file_name; - $skin_file_name =~ s{(^|/)skins/standard/}{skins/contrib/$skin/}; + $skin_file_name =~ s{(?:^|/)skins/standard/}{skins/contrib/$skin/}; if (my $mtime = _mtime("$cgi_path/$skin_file_name")) { $set{skin} = mtime_filter($skin_file_name, $mtime); } my $custom_file_name = $file_name; - $custom_file_name =~ s{(^|/)skins/standard/}{skins/custom/}; + $custom_file_name =~ s{(?:^|/)skins/standard/}{skins/custom/}; if (my $custom_mtime = _mtime("$cgi_path/$custom_file_name")) { $set{custom} = mtime_filter($custom_file_name, $custom_mtime); } - + return \%set; } +sub _concatenate_css { + my @sources = map { @$_ } @_; + return unless @sources; + + my %files = + map { + (my $file = $_) =~ s/(^[^\?]+)\?.+/$1/; + $_ => $file; + } @sources; + + my $cgi_path = bz_locations()->{cgi_path}; + my $skins_path = bz_locations()->{assetsdir}; + + # build minified files + my @minified; + foreach my $source (@sources) { + next unless -e "$cgi_path/$files{$source}"; + my $file = $skins_path . '/' . md5_hex($source) . '.css'; + if (!-e $file) { + my $content = read_file("$cgi_path/$files{$source}"); + + # minify + $content =~ s{/\*.*?\*/}{}sg; # comments + $content =~ s{(^\s+|\s+$)}{}mg; # leading/trailing whitespace + $content =~ s{\n}{}g; # single line + + # rewrite urls + $content =~ s{url\(([^\)]+)\)}{_css_url_rewrite($source, $1)}eig; + + write_file($file, "/* $files{$source} */\n" . $content . "\n"); + } + push @minified, $file; + } + + # concat files + my $file = $skins_path . '/' . md5_hex(join(' ', @sources)) . '.css'; + if (!-e $file) { + my $content = ''; + foreach my $source (@minified) { + $content .= read_file($source); + } + write_file($file, $content); + } + + $file =~ s/^\Q$cgi_path\E\///o; + return mtime_filter($file); +} + +sub _css_url_rewrite { + my ($source, $url) = @_; + # rewrite relative urls as the unified stylesheet lives in a different + # directory from the source + $url =~ s/(^['"]|['"]$)//g; + if (substr($url, 0, 1) eq '/' || substr($url, 0, 5) eq 'data:') { + return 'url(' . $url . ')'; + } + return 'url(../../' . ($ENV{'PROJECT'} ? '../' : '') . dirname($source) . '/' . $url . ')'; +} + +sub _concatenate_js { + return @_ unless CONCATENATE_ASSETS; + my ($sources) = @_; + return [] unless $sources; + $sources = ref($sources) ? $sources : [ $sources ]; + + my %files = + map { + (my $file = $_) =~ s/(^[^\?]+)\?.+/$1/; + $_ => $file; + } @$sources; + + my $cgi_path = bz_locations()->{cgi_path}; + my $skins_path = bz_locations()->{assetsdir}; + + # build minified files + my @minified; + foreach my $source (@$sources) { + next unless -e "$cgi_path/$files{$source}"; + my $file = $skins_path . '/' . md5_hex($source) . '.js'; + if (!-e $file) { + my $content = read_file("$cgi_path/$files{$source}"); + + # minimal minification + $content =~ s#/\*.*?\*/##sg; # block comments + $content =~ s#(^ +| +$)##gm; # leading/trailing spaces + $content =~ s#^//.+$##gm; # single line comments + $content =~ s#\n{2,}#\n#g; # blank lines + $content =~ s#(^\s+|\s+$)##g; # whitespace at the start/end of file + + write_file($file, ";/* $files{$source} */\n" . $content . "\n"); + } + push @minified, $file; + } + + # concat files + my $file = $skins_path . '/' . md5_hex(join(' ', @$sources)) . '.js'; + if (!-e $file) { + my $content = ''; + foreach my $source (@minified) { + $content .= read_file($source); + } + write_file($file, $content); + } + + $file =~ s/^\Q$cgi_path\E\///o; + return [ $file ]; +} + # YUI dependency resolution sub yui_resolve_deps { my ($yui, $yui_deps) = @_; @@ -519,6 +664,21 @@ $Template::Stash::LIST_OPS->{ clone } = return [@$list]; }; +# Allow us to sort the list of fields correctly +$Template::Stash::LIST_OPS->{ sort_by_field_name } = + sub { + sub field_name { + if ($_[0] eq 'noop') { + # Sort --- first + return ''; + } + # Otherwise sort by field_desc or description + return $_[1]{$_[0]} || $_[0]; + } + my ($list, $field_desc) = @_; + return [ sort { lc field_name($a, $field_desc) cmp lc field_name($b, $field_desc) } @$list ]; + }; + # Allow us to still get the scalar if we use the list operation ".0" on it, # as we often do for defaults in query.cgi and other places. $Template::Stash::SCALAR_OPS->{ 0 } = @@ -531,10 +691,9 @@ $Template::Stash::SCALAR_OPS->{ 0 } = $Template::Stash::SCALAR_OPS->{ truncate } = sub { my ($string, $length, $ellipsis) = @_; - $ellipsis ||= ""; - return $string if !$length || length($string) <= $length; - + + $ellipsis ||= ''; my $strlen = $length - length($ellipsis); my $newstr = substr($string, 0, $strlen) . $ellipsis; return $newstr; @@ -640,6 +799,8 @@ sub create { $var =~ s/([\\\'\"\/])/\\$1/g; $var =~ s/\n/\\n/g; $var =~ s/\r/\\r/g; + $var =~ s/\x{2028}/\\u2028/g; # unicode line separator + $var =~ s/\x{2029}/\\u2029/g; # unicode paragraph separator $var =~ s/\@/\\x40/g; # anti-spam for email addresses $var =~ s/</\\x3c/g; $var =~ s/>/\\x3e/g; @@ -655,9 +816,10 @@ sub create { # Strips out control characters excepting whitespace strip_control_chars => sub { my ($data) = @_; + state $use_utf8 = Bugzilla->params->{'utf8'}; # Only run for utf8 to avoid issues with other multibyte encodings # that may be reassigning meaning to ascii characters. - if (Bugzilla->params->{'utf8'}) { + if ($use_utf8) { $data =~ s/(?![\t\r\n])[[:cntrl:]]//g; } return $data; @@ -677,14 +839,6 @@ sub create { return $var; }, - # Prevents line break on hyphens and whitespaces. - no_break => sub { - my ($var) = @_; - $var =~ s/ /\ /g; - $var =~ s/-/\‑/g; - return $var; - }, - xml => \&Bugzilla::Util::xml_quote , # This filter is similar to url_quote but used a \ instead of a % @@ -821,9 +975,7 @@ sub create { # (Wrapping the message in the WebService is unnecessary # and causes awkward things like \n's appearing in error # messages in JSON-RPC.) - unless (Bugzilla->usage_mode == USAGE_MODE_JSON - or Bugzilla->usage_mode == USAGE_MODE_XMLRPC) - { + unless (i_am_webservice()) { $var = wrap_comment($var, 72); } $var =~ s/\ / /g; @@ -881,17 +1033,45 @@ sub create { # started the session. 'sudoer' => sub { return Bugzilla->sudoer; }, - # Allow templates to access the "corect" URLBase value + # Allow templates to access the "correct" URLBase value 'urlbase' => sub { return Bugzilla::Util::correct_urlbase(); }, 'httpbase' => sub { return Bugzilla->params->{'urlbase'}; }, 'sslbase' => sub { return Bugzilla->params->{'sslbase'}; }, 'ssl_redirect' => sub { return Bugzilla->params->{'ssl_redirect'}; }, # Allow templates to access docs url with users' preferred language - 'docs_urlbase' => sub { - my $language = Bugzilla->current_language; - my $docs_urlbase = Bugzilla->params->{'docs_urlbase'}; - $docs_urlbase =~ s/\%lang\%/$language/; + # We fall back to English if documentation in the preferred + # language is not available + 'docs_urlbase' => sub { + my $docs_urlbase; + my $lang = Bugzilla->current_language; + # Translations currently available on readthedocs.org + my @rtd_translations = ('en', 'fr'); + + if ($lang ne 'en' && -f "docs/$lang/html/index.html") { + $docs_urlbase = "docs/$lang/html/"; + } + elsif (-f "docs/en/html/index.html") { + $docs_urlbase = "docs/en/html/"; + } + else { + if (!grep { $_ eq $lang } @rtd_translations) { + $lang = "en"; + } + + my $version = BUGZILLA_VERSION; + $version =~ /^(\d+)\.(\d+)/; + if ($2 % 2 == 1) { + # second number is odd; development version + $version = 'latest'; + } + else { + $version = "$1.$2"; + } + + $docs_urlbase = "https://bugzilla.readthedocs.org/$lang/$version/"; + } + return $docs_urlbase; }, @@ -916,6 +1096,12 @@ sub create { return $cookie ? issue_hash_token(['login_request', $cookie]) : ''; }, + 'get_api_token' => sub { + return '' unless Bugzilla->user->id; + my $cache = Bugzilla->request_cache; + return $cache->{api_token} //= issue_api_token(); + }, + # A way for all templates to get at Field data, cached. 'bug_fields' => sub { my $cache = Bugzilla->request_cache; @@ -934,6 +1120,12 @@ sub create { 'css_files' => \&css_files, yui_resolve_deps => \&yui_resolve_deps, + concatenate_js => \&_concatenate_js, + + # All classifications (sorted by sortkey, name) + 'all_classifications' => sub { + return [map { $_->name } Bugzilla::Classification->get_all()]; + }, # Whether or not keywords are enabled, in this Bugzilla. 'use_keywords' => sub { return Bugzilla::Keyword->any_exist; }, @@ -1172,3 +1364,29 @@ Returns: nothing =head1 SEE ALSO L<Bugzilla>, L<Template> + +=head1 B<Methods in need of POD> + +=over + +=item multiline_sprintf + +=item create + +=item css_files + +=item mtime_filter + +=item yui_resolve_deps + +=item process + +=item get_bug_link + +=item quoteUrls + +=item get_attachment_link + +=item SAFE_URL_REGEXP + +=back diff --git a/Bugzilla/Template/Context.pm b/Bugzilla/Template/Context.pm index 9dc1f08f9..470e6a9ee 100644 --- a/Bugzilla/Template/Context.pm +++ b/Bugzilla/Template/Context.pm @@ -7,8 +7,12 @@ # This exists to implement the template-before_process hook. package Bugzilla::Template::Context; + +use 5.10.1; use strict; -use base qw(Template::Context); +use warnings; + +use parent qw(Template::Context); use Bugzilla::Hook; use Scalar::Util qw(blessed); @@ -81,6 +85,14 @@ sub stash { return $stash; } +sub filter { + my ($self, $name, $args) = @_; + # If we pass an alias for the filter name, the filter code is cached + # instead of looking for it at each call. + # If the filter has arguments, then we can't cache it. + $self->SUPER::filter($name, $args, $args ? undef : $name); +} + # We need a DESTROY sub for the same reason that Bugzilla::CGI does. sub DESTROY { my $self = shift; @@ -88,3 +100,15 @@ sub DESTROY { }; 1; + +=head1 B<Methods in need of POD> + +=over + +=item stash + +=item filter + +=item process + +=back diff --git a/Bugzilla/Template/Plugin/Bugzilla.pm b/Bugzilla/Template/Plugin/Bugzilla.pm index e2b59c7a8..806dd903b 100644 --- a/Bugzilla/Template/Plugin/Bugzilla.pm +++ b/Bugzilla/Template/Plugin/Bugzilla.pm @@ -7,9 +7,11 @@ package Bugzilla::Template::Plugin::Bugzilla; +use 5.10.1; use strict; +use warnings; -use base qw(Template::Plugin); +use parent qw(Template::Plugin); use Bugzilla; diff --git a/Bugzilla/Template/Plugin/Hook.pm b/Bugzilla/Template/Plugin/Hook.pm index f1de7a602..669c77614 100644 --- a/Bugzilla/Template/Plugin/Hook.pm +++ b/Bugzilla/Template/Plugin/Hook.pm @@ -6,8 +6,12 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Template::Plugin::Hook; + +use 5.10.1; use strict; -use base qw(Template::Plugin); +use warnings; + +use parent qw(Template::Plugin); use Bugzilla::Constants; use Bugzilla::Install::Util qw(template_include_path); diff --git a/Bugzilla/Token.pm b/Bugzilla/Token.pm index c7e9f645f..84d86b8c6 100644 --- a/Bugzilla/Token.pm +++ b/Bugzilla/Token.pm @@ -5,15 +5,11 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -################################################################################ -# Module Initialization -################################################################################ +package Bugzilla::Token; -# Make it harder for us to do dangerous things in Perl. +use 5.10.1; use strict; - -# Bundle the functions in this file together into the "Bugzilla::Token" package. -package Bugzilla::Token; +use warnings; use Bugzilla::Constants; use Bugzilla::Error; @@ -26,15 +22,30 @@ use Date::Parse; use File::Basename; use Digest::SHA qw(hmac_sha256_base64); -use base qw(Exporter); +use parent qw(Exporter); -@Bugzilla::Token::EXPORT = qw(issue_session_token check_token_data delete_token +@Bugzilla::Token::EXPORT = qw(issue_api_token issue_session_token + check_token_data delete_token issue_hash_token check_hash_token); ################################################################################ # Public Functions ################################################################################ +# Create a token used for internal API authentication +sub issue_api_token { + # Generates a random token, adds it to the tokens table if one does not + # already exist, and returns the token to the caller. + my $dbh = Bugzilla->dbh; + my $user = Bugzilla->user; + my ($token) = $dbh->selectrow_array(" + SELECT token FROM tokens + WHERE userid = ? AND tokentype = 'api_token' + AND (" . $dbh->sql_date_math('issuedate', '+', (MAX_TOKEN_AGE * 24 - 12), 'HOUR') . ") > NOW()", + undef, $user->id); + return $token // _create_token($user->id, 'api_token', ''); +} + # Creates and sends a token to create a new user account. # It assumes that the login has the correct format and is not already in use. sub issue_new_user_account_token { @@ -44,7 +55,7 @@ sub issue_new_user_account_token { my $vars = {}; # Is there already a pending request for this login name? If yes, do not throw - # an error because the user may have lost his email with the token inside. + # an error because the user may have lost their email with the token inside. # But to prevent using this way to mailbomb an email address, make sure # the last request is old enough before sending a new email (default: 10 minutes). @@ -71,7 +82,7 @@ sub issue_new_user_account_token { # In 99% of cases, the user getting the confirmation email is the same one # who made the request, and so it is reasonable to send the email in the same - # language used to view the "Create a New Account" page (we cannot use his + # language used to view the "Create a New Account" page (we cannot use their # user prefs as the user has no account yet!). MessageToMTA($message); } @@ -127,16 +138,18 @@ sub IssuePasswordToken { ThrowUserError('too_soon_for_new_token', {'type' => 'password'}) if $too_soon; - my ($token, $token_ts) = _create_token($user->id, 'password', remote_ip()); + my $ip_addr = remote_ip(); + my ($token, $token_ts) = _create_token($user->id, 'password', $ip_addr); # Mail the user the token along with instructions for using it. my $template = Bugzilla->template_inner($user->setting('lang')); my $vars = {}; $vars->{'token'} = $token; + $vars->{'ip_addr'} = $ip_addr; $vars->{'emailaddress'} = $user->email; $vars->{'expiration_ts'} = ctime($token_ts + MAX_TOKEN_AGE * 86400); - # The user is not logged in (else he wouldn't request a new password). + # The user is not logged in (else they wouldn't request a new password). # So we have to pass this information to the template. $vars->{'timezone'} = $user->timezone; @@ -377,7 +390,7 @@ sub check_token_data { { # Something is going wrong. Ask confirmation before processing. # It is possible that someone tried to trick an administrator. - # In this case, we want to know his name! + # In this case, we want to know their name! require Bugzilla::User; my $vars = {}; @@ -419,6 +432,9 @@ sub _create_token { trick_taint($tokentype); trick_taint($eventdata); + my $is_shadow = Bugzilla->is_shadow_db; + $dbh = Bugzilla->switch_to_main_db() if $is_shadow; + $dbh->bz_start_transaction(); my $token = GenerateUniqueToken(); @@ -431,8 +447,10 @@ sub _create_token { if (wantarray) { my (undef, $token_ts, undef) = GetTokenData($token); $token_ts = str2time($token_ts); + Bugzilla->switch_to_shadow_db() if $is_shadow; return ($token, $token_ts); } else { + Bugzilla->switch_to_shadow_db() if $is_shadow; return $token; } } @@ -469,12 +487,20 @@ Bugzilla::Token - Provides different routines to manage tokens. =over +=item C<issue_api_token($login_name)> + + Description: Creates a token that can be used for API calls on the web page. + + Params: None. + + Returns: The token. + =item C<issue_new_user_account_token($login_name)> Description: Creates and sends a token per email to the email address requesting a new user account. It doesn't check whether the user account already exists. The user will have to - use this token to confirm the creation of his user account. + use this token to confirm the creation of their user account. Params: $login_name - The new login name requested by the user. @@ -497,7 +523,7 @@ Bugzilla::Token - Provides different routines to manage tokens. Description: Sends a token per email to the given user. This token can be used to change the password (e.g. in case the user - cannot remember his password and wishes to enter a new one). + cannot remember their password and wishes to enter a new one). Params: $user - User object of the user requesting a new password. @@ -527,7 +553,7 @@ Bugzilla::Token - Provides different routines to manage tokens. Description: Invalidates an existing token, generally when the token is used for an action which is not the one expected. An email is sent - to the user who originally requested this token to inform him + to the user who originally requested this token to inform them that this token has been invalidated (e.g. because an hacker tried to use this token for some malicious action). @@ -540,7 +566,7 @@ Bugzilla::Token - Provides different routines to manage tokens. =item C<DeletePasswordTokens($user_id, $reason)> Description: Cancels all password tokens for the given user. Emails are sent - to the user to inform him about this action. + to the user to inform them about this action. Params: $user_id: The user ID of the user account whose password tokens are canceled. @@ -618,3 +644,13 @@ although they can be used separately. =back =cut + +=head1 B<Methods in need of POD> + +=over + +=item check_hash_token + +=item issue_hash_token + +=back diff --git a/Bugzilla/Update.pm b/Bugzilla/Update.pm index 29133ecce..72a7108a8 100644 --- a/Bugzilla/Update.pm +++ b/Bugzilla/Update.pm @@ -7,7 +7,9 @@ package Bugzilla::Update; +use 5.10.1; use strict; +use warnings; use Bugzilla::Constants; diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm index 48c25fc35..e63be93dd 100644 --- a/Bugzilla/User.pm +++ b/Bugzilla/User.pm @@ -5,15 +5,11 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -################################################################################ -# Module Initialization -################################################################################ +package Bugzilla::User; -# Make it harder for us to do dangerous things in Perl. +use 5.10.1; use strict; - -# This module implements utilities for dealing with Bugzilla users. -package Bugzilla::User; +use warnings; use Bugzilla::Error; use Bugzilla::Util; @@ -24,16 +20,20 @@ use Bugzilla::Product; use Bugzilla::Classification; use Bugzilla::Field; use Bugzilla::Group; +use Bugzilla::BugUserLastVisit; +use Bugzilla::Hook; use DateTime::TimeZone; use List::Util qw(max); +use List::MoreUtils qw(any); use Scalar::Util qw(blessed); +use Storable qw(dclone); use URI; use URI::QueryParam; -use base qw(Bugzilla::Object Exporter); +use parent qw(Bugzilla::Object Exporter); @Bugzilla::User::EXPORT = qw(is_available_username - login_to_id user_id_to_login validate_password + login_to_id validate_password validate_password_check USER_MATCH_MULTIPLE USER_MATCH_FAILED USER_MATCH_SUCCESS MATCH_SKIP_CONFIRM ); @@ -147,12 +147,80 @@ sub super_user { return $user; } +sub _update_groups { + my $self = shift; + my $group_changes = shift; + my $changes = shift; + my $dbh = Bugzilla->dbh; + + # Update group settings. + my $sth_add_mapping = $dbh->prepare( + qq{INSERT INTO user_group_map ( + user_id, group_id, isbless, grant_type + ) VALUES ( + ?, ?, ?, ? + ) + }); + my $sth_remove_mapping = $dbh->prepare( + qq{DELETE FROM user_group_map + WHERE user_id = ? + AND group_id = ? + AND isbless = ? + AND grant_type = ? + }); + + foreach my $is_bless (keys %$group_changes) { + my ($removed, $added) = @{$group_changes->{$is_bless}}; + + foreach my $group (@$removed) { + $sth_remove_mapping->execute( + $self->id, $group->id, $is_bless, GRANT_DIRECT + ); + } + foreach my $group (@$added) { + $sth_add_mapping->execute( + $self->id, $group->id, $is_bless, GRANT_DIRECT + ); + } + + if (! $is_bless) { + my $query = qq{ + INSERT INTO profiles_activity + (userid, who, profiles_when, fieldid, oldvalue, newvalue) + VALUES ( ?, ?, now(), ?, ?, ?) + }; + + $dbh->do( + $query, undef, + $self->id, Bugzilla->user->id, + get_field_id('bug_group'), + join(', ', map { $_->name } @$removed), + join(', ', map { $_->name } @$added) + ); + } + else { + # XXX: should create profiles_activity entries for blesser changes. + } + + Bugzilla->memcached->clear_config({ key => 'user_groups.' . $self->id }); + + my $type = $is_bless ? 'bless_groups' : 'groups'; + $changes->{$type} = [ + [ map { $_->name } @$removed ], + [ map { $_->name } @$added ], + ]; + } +} + sub update { my $self = shift; my $options = shift; - + + my $group_changes = delete $self->{_group_changes}; + my $changes = $self->SUPER::update(@_); my $dbh = Bugzilla->dbh; + $self->_update_groups($group_changes, $changes); if (exists $changes->{login_name}) { # Delete all the tokens related to the userid @@ -246,8 +314,9 @@ sub _check_is_enabled { # Mutators ################################################################################ -sub set_disable_mail { $_[0]->set('disable_mail', $_[1]); } -sub set_extern_id { $_[0]->set('extern_id', $_[1]); } +sub set_disable_mail { $_[0]->set('disable_mail', $_[1]); } +sub set_email_enabled { $_[0]->set('disable_mail', !$_[1]); } +sub set_extern_id { $_[0]->set('extern_id', $_[1]); } sub set_login { my ($self, $login) = @_; @@ -269,6 +338,112 @@ sub set_disabledtext { $_[0]->set('is_enabled', $_[1] ? 0 : 1); } +sub set_groups { + my $self = shift; + $self->_set_groups(GROUP_MEMBERSHIP, @_); +} + +sub set_bless_groups { + my $self = shift; + + # The person making the change needs to be in the editusers group + Bugzilla->user->in_group('editusers') + || ThrowUserError("auth_failure", {group => "editusers", + reason => "cant_bless", + action => "edit", + object => "users"}); + + $self->_set_groups(GROUP_BLESS, @_); +} + +sub _set_groups { + my $self = shift; + my $is_bless = shift; + my $changes = shift; + my $dbh = Bugzilla->dbh; + + # The person making the change is $user, $self is the person being changed + my $user = Bugzilla->user; + + # Input is a hash of arrays. Key is 'set', 'add' or 'remove'. The array + # is a list of group ids and/or names. + + # First turn the arrays into group objects. + $changes = $self->_set_groups_to_object($changes); + + # Get a list of the groups the user currently is a member of + my $ids = $dbh->selectcol_arrayref( + q{SELECT DISTINCT group_id + FROM user_group_map + WHERE user_id = ? AND isbless = ? AND grant_type = ?}, + undef, $self->id, $is_bless, GRANT_DIRECT); + + my $current_groups = Bugzilla::Group->new_from_list($ids); + my $new_groups = dclone($current_groups); + + # Record the changes + if (exists $changes->{set}) { + $new_groups = $changes->{set}; + + # We need to check the user has bless rights on the existing groups + # If they don't, then we need to add them back to new_groups + foreach my $group (@$current_groups) { + if (! $user->can_bless($group->id)) { + push @$new_groups, $group + unless grep { $_->id eq $group->id } @$new_groups; + } + } + } + else { + foreach my $group (@{$changes->{remove} // []}) { + @$new_groups = grep { $_->id ne $group->id } @$new_groups; + } + foreach my $group (@{$changes->{add} // []}) { + push @$new_groups, $group + unless grep { $_->id eq $group->id } @$new_groups; + } + } + + # Stash the changes, so self->update can actually make them + my @diffs = diff_arrays($current_groups, $new_groups, 'id'); + if (scalar(@{$diffs[0]}) || scalar(@{$diffs[1]})) { + $self->{_group_changes}{$is_bless} = \@diffs; + } +} + +sub _set_groups_to_object { + my $self = shift; + my $changes = shift; + my $user = Bugzilla->user; + + foreach my $key (keys %$changes) { + # Check we were given an array + unless (ref($changes->{$key}) eq 'ARRAY') { + ThrowCodeError( + 'param_invalid', + { param => $changes->{$key}, function => $key } + ); + } + + # Go through the array, and turn items into group objects + my @groups = (); + foreach my $value (@{$changes->{$key}}) { + my $type = $value =~ /^\d+$/ ? 'id' : 'name'; + my $group = Bugzilla::Group->new({$type => $value}); + + if (! $group || ! $user->can_bless($group->id)) { + ThrowUserError('auth_failure', + { group => $value, reason => 'cant_bless', + action => 'edit', object => 'users' }); + } + push @groups, $group; + } + $changes->{$key} = \@groups; + } + + return $changes; +} + sub update_last_seen_date { my $self = shift; return unless $self->id; @@ -283,6 +458,7 @@ sub update_last_seen_date { # pending changes $dbh->do("UPDATE profiles SET last_seen_date = ? WHERE userid = ?", undef, $date, $self->id); + Bugzilla->memcached->clear({ table => 'profiles', id => $self->id }); } } @@ -325,7 +501,7 @@ sub authorizer { } # Generate a string to identify the user by name + login if the user -# has a name or by login only if she doesn't. +# has a name or by login only if they don't. sub identity { my $self = shift; @@ -433,6 +609,31 @@ sub tags { return $self->{tags}; } +sub bugs_ignored { + my ($self) = @_; + my $dbh = Bugzilla->dbh; + if (!defined $self->{'bugs_ignored'}) { + $self->{'bugs_ignored'} = $dbh->selectall_arrayref( + 'SELECT bugs.bug_id AS id, + bugs.bug_status AS status, + bugs.short_desc AS summary + FROM bugs + INNER JOIN email_bug_ignore + ON bugs.bug_id = email_bug_ignore.bug_id + WHERE user_id = ?', + { Slice => {} }, $self->id); + # Go ahead and load these into the visible bugs cache + # to speed up can_see_bug checks later + $self->visible_bugs([ map { $_->{'id'} } @{ $self->{'bugs_ignored'} } ]); + } + return $self->{'bugs_ignored'}; +} + +sub is_bug_ignored { + my ($self, $bug_id) = @_; + return (grep {$_->{'id'} == $bug_id} @{$self->bugs_ignored}) ? 1 : 0; +} + ########################## # Saved Recent Bug Lists # ########################## @@ -648,56 +849,100 @@ sub groups { return $self->{groups} if defined $self->{groups}; return [] unless $self->id; - my $dbh = Bugzilla->dbh; - my $groups_to_check = $dbh->selectcol_arrayref( - q{SELECT DISTINCT group_id - FROM user_group_map - WHERE user_id = ? AND isbless = 0}, undef, $self->id); + my $user_groups_key = "user_groups." . $self->id; + my $groups = Bugzilla->memcached->get_config({ + key => $user_groups_key + }); - my $rows = $dbh->selectall_arrayref( - "SELECT DISTINCT grantor_id, member_id - FROM group_group_map - WHERE grant_type = " . GROUP_MEMBERSHIP); + if (!$groups) { + my $dbh = Bugzilla->dbh; + my $groups_to_check = $dbh->selectcol_arrayref( + "SELECT DISTINCT group_id + FROM user_group_map + WHERE user_id = ? AND isbless = 0", undef, $self->id); + + my $grant_type_key = 'group_grant_type_' . GROUP_MEMBERSHIP; + my $membership_rows = Bugzilla->memcached->get_config({ + key => $grant_type_key, + }); + if (!$membership_rows) { + $membership_rows = $dbh->selectall_arrayref( + "SELECT DISTINCT grantor_id, member_id + FROM group_group_map + WHERE grant_type = " . GROUP_MEMBERSHIP); + Bugzilla->memcached->set_config({ + key => $grant_type_key, + data => $membership_rows, + }); + } - my %group_membership; - foreach my $row (@$rows) { - my ($grantor_id, $member_id) = @$row; - push (@{ $group_membership{$member_id} }, $grantor_id); - } - - # Let's walk the groups hierarchy tree (using FIFO) - # On the first iteration it's pre-filled with direct groups - # membership. Later on, each group can add its own members into the - # FIFO. Circular dependencies are eliminated by checking - # $checked_groups{$member_id} hash values. - # As a result, %groups will have all the groups we are the member of. - my %checked_groups; - my %groups; - while (scalar(@$groups_to_check) > 0) { - # Pop the head group from FIFO - my $member_id = shift @$groups_to_check; - - # Skip the group if we have already checked it - if (!$checked_groups{$member_id}) { - # Mark group as checked - $checked_groups{$member_id} = 1; - - # Add all its members to the FIFO check list - # %group_membership contains arrays of group members - # for all groups. Accessible by group number. - my $members = $group_membership{$member_id}; - my @new_to_check = grep(!$checked_groups{$_}, @$members); - push(@$groups_to_check, @new_to_check); - - $groups{$member_id} = 1; + my %group_membership; + foreach my $row (@$membership_rows) { + my ($grantor_id, $member_id) = @$row; + push (@{ $group_membership{$member_id} }, $grantor_id); } - } - $self->{groups} = Bugzilla::Group->new_from_list([keys %groups]); + # Let's walk the groups hierarchy tree (using FIFO) + # On the first iteration it's pre-filled with direct groups + # membership. Later on, each group can add its own members into the + # FIFO. Circular dependencies are eliminated by checking + # $checked_groups{$member_id} hash values. + # As a result, %groups will have all the groups we are the member of. + my %checked_groups; + my %groups; + while (scalar(@$groups_to_check) > 0) { + # Pop the head group from FIFO + my $member_id = shift @$groups_to_check; + + # Skip the group if we have already checked it + if (!$checked_groups{$member_id}) { + # Mark group as checked + $checked_groups{$member_id} = 1; + + # Add all its members to the FIFO check list + # %group_membership contains arrays of group members + # for all groups. Accessible by group number. + my $members = $group_membership{$member_id}; + my @new_to_check = grep(!$checked_groups{$_}, @$members); + push(@$groups_to_check, @new_to_check); + + $groups{$member_id} = 1; + } + } + $groups = [ keys %groups ]; + + Bugzilla->memcached->set_config({ + key => $user_groups_key, + data => $groups, + }); + } + $self->{groups} = Bugzilla::Group->new_from_list($groups); return $self->{groups}; } +sub last_visited { + my ($self) = @_; + + return Bugzilla::BugUserLastVisit->match({ user_id => $self->id }); +} + +sub is_involved_in_bug { + my ($self, $bug) = @_; + my $user_id = $self->id; + my $user_login = $self->login; + + return unless $user_id; + return 1 if $user_id == $bug->assigned_to->id; + return 1 if $user_id == $bug->reporter->id; + + if (Bugzilla->params->{'useqacontact'} and $bug->qa_contact) { + return 1 if $user_id == $bug->qa_contact->id; + } + + return any { $user_login eq $_ } @{ $bug->cc }; +} + # It turns out that calling ->id on objects a few hundred thousand # times is pretty slow. (It showed up as a significant time contributor # when profiling xt/search.t.) So we cache the group ids separately from @@ -734,34 +979,42 @@ sub bless_groups { return $self->{'bless_groups'}; } + if (Bugzilla->params->{usevisibilitygroups} + && !@{ $self->visible_groups_inherited }) { + return []; + } + my $dbh = Bugzilla->dbh; - # Get all groups for the user where: - # + They have direct bless privileges - # + They are a member of a group that inherits bless privs. - my @group_ids = map {$_->id} @{ $self->groups }; - @group_ids = (-1) if !@group_ids; - my $query = - 'SELECT DISTINCT groups.id - FROM groups, user_group_map, group_group_map AS ggm - WHERE user_group_map.user_id = ? - AND ( (user_group_map.isbless = 1 - AND groups.id=user_group_map.group_id) - OR (groups.id = ggm.grantor_id - AND ggm.grant_type = ' . GROUP_BLESS . ' - AND ' . $dbh->sql_in('ggm.member_id', \@group_ids) - . ') )'; - - # If visibilitygroups are used, restrict the set of groups. - if (Bugzilla->params->{'usevisibilitygroups'}) { - return [] if !$self->visible_groups_as_string; - # Users need to see a group in order to bless it. + # Get all groups for the user where they have direct bless privileges. + my $query = " + SELECT DISTINCT group_id + FROM user_group_map + WHERE user_id = ? + AND isbless = 1"; + if (Bugzilla->params->{usevisibilitygroups}) { $query .= " AND " - . $dbh->sql_in('groups.id', $self->visible_groups_inherited); + . $dbh->sql_in('group_id', $self->visible_groups_inherited); + } + + # Get all groups for the user where they are a member of a group that + # inherits bless privs. + my @group_ids = map { $_->id } @{ $self->groups }; + if (@group_ids) { + $query .= " + UNION + SELECT DISTINCT grantor_id + FROM group_group_map + WHERE grant_type = " . GROUP_BLESS . " + AND " . $dbh->sql_in('member_id', \@group_ids); + if (Bugzilla->params->{usevisibilitygroups}) { + $query .= " AND " + . $dbh->sql_in('grantor_id', $self->visible_groups_inherited); + } } my $ids = $dbh->selectcol_arrayref($query, undef, $self->id); - return $self->{'bless_groups'} = Bugzilla::Group->new_from_list($ids); + return $self->{bless_groups} = Bugzilla::Group->new_from_list($ids); } sub in_group { @@ -804,8 +1057,7 @@ sub in_group_id { sub groups_with_icon { my $self = shift; - my @groups = grep { $_->icon_url } @{ $self->groups }; - return \@groups; + return $self->{groups_with_icon} //= [grep { $_->icon_url } @{ $self->groups }]; } sub get_products_by_permission { @@ -856,15 +1108,34 @@ sub can_edit_product { my ($self, $prod_id) = @_; my $dbh = Bugzilla->dbh; - my $has_external_groups = - $dbh->selectrow_array('SELECT 1 - FROM group_control_map - WHERE product_id = ? - AND canedit != 0 - AND group_id NOT IN(' . $self->groups_as_string . ')', - undef, $prod_id); + if (Bugzilla->params->{'or_groups'}) { + my $groups = $self->groups_as_string; + # For or-groups, we check if there are any can_edit groups for the + # product, and if the user is in any of them. If there are none or + # the user is in at least one of them, they can edit the product + my ($cnt_can_edit, $cnt_group_member) = $dbh->selectrow_array( + "SELECT SUM(p.cnt_can_edit), + SUM(p.cnt_group_member) + FROM (SELECT CASE WHEN canedit = 1 THEN 1 ELSE 0 END AS cnt_can_edit, + CASE WHEN canedit = 1 AND group_id IN ($groups) THEN 1 ELSE 0 END AS cnt_group_member + FROM group_control_map + WHERE product_id = $prod_id) AS p"); + return (!$cnt_can_edit or $cnt_group_member); + } + else { + # For and-groups, a user needs to be in all canedit groups. Therefore + # if the user is not in a can_edit group for the product, they cannot + # edit the product. + my $has_external_groups = + $dbh->selectrow_array('SELECT 1 + FROM group_control_map + WHERE product_id = ? + AND canedit != 0 + AND group_id NOT IN(' . $self->groups_as_string . ')', + undef, $prod_id); - return !$has_external_groups; + return !$has_external_groups; + } } sub can_see_bug { @@ -885,9 +1156,6 @@ sub visible_bugs { my @check_ids = grep(!exists $visible_cache->{$_}, @bug_ids); if (@check_ids) { - my $dbh = Bugzilla->dbh; - my $user_id = $self->id; - foreach my $id (@check_ids) { my $orig_id = $id; detaint_natural($id) @@ -895,56 +1163,113 @@ sub visible_bugs { function => 'Bugzilla::User->visible_bugs'}); } - my $sth; - # Speed up the can_see_bug case. - if (scalar(@check_ids) == 1) { - $sth = $self->{_sth_one_visible_bug}; - } - $sth ||= $dbh->prepare( - # This checks for groups that the bug is in that the user - # *isn't* in. Then, in the Perl code below, we check if - # the user can otherwise access the bug (for example, by being - # the assignee or QA Contact). - # - # The DISTINCT exists because the bug could be in *several* - # groups that the user isn't in, but they will all return the - # same result for bug_group_map.bug_id (so DISTINCT filters - # out duplicate rows). - "SELECT DISTINCT bugs.bug_id, reporter, assigned_to, qa_contact, - reporter_accessible, cclist_accessible, cc.who, - bug_group_map.bug_id - FROM bugs - LEFT JOIN cc - ON cc.bug_id = bugs.bug_id - AND cc.who = $user_id - LEFT JOIN bug_group_map - ON bugs.bug_id = bug_group_map.bug_id - AND bug_group_map.group_id NOT IN (" - . $self->groups_as_string . ') - WHERE bugs.bug_id IN (' . join(',', ('?') x @check_ids) . ') - AND creation_ts IS NOT NULL '); - if (scalar(@check_ids) == 1) { - $self->{_sth_one_visible_bug} = $sth; - } - - $sth->execute(@check_ids); - my $use_qa_contact = Bugzilla->params->{'useqacontact'}; - while (my $row = $sth->fetchrow_arrayref) { - my ($bug_id, $reporter, $owner, $qacontact, $reporter_access, - $cclist_access, $isoncclist, $missinggroup) = @$row; - $visible_cache->{$bug_id} ||= - ((($reporter == $user_id) && $reporter_access) - || ($use_qa_contact - && $qacontact && ($qacontact == $user_id)) - || ($owner == $user_id) - || ($isoncclist && $cclist_access) - || !$missinggroup) ? 1 : 0; - } + Bugzilla->params->{'or_groups'} + ? $self->_visible_bugs_check_or(\@check_ids) + : $self->_visible_bugs_check_and(\@check_ids); } return [grep { $visible_cache->{blessed $_ ? $_->id : $_} } @$bugs]; } +sub _visible_bugs_check_or { + my ($self, $check_ids) = @_; + my $visible_cache = $self->{_visible_bugs_cache}; + my $dbh = Bugzilla->dbh; + my $user_id = $self->id; + + my $sth; + # Speed up the can_see_bug case. + if (scalar(@$check_ids) == 1) { + $sth = $self->{_sth_one_visible_bug}; + } + my $query = qq{ + SELECT DISTINCT bugs.bug_id + FROM bugs + LEFT JOIN bug_group_map AS security_map ON bugs.bug_id = security_map.bug_id + LEFT JOIN cc AS security_cc ON bugs.bug_id = security_cc.bug_id AND security_cc.who = $user_id + WHERE bugs.bug_id IN (} . join(',', ('?') x @$check_ids) . qq{) + AND ((security_map.group_id IS NULL OR security_map.group_id IN (} . $self->groups_as_string . qq{)) + OR (bugs.reporter_accessible = 1 AND bugs.reporter = $user_id) + OR (bugs.cclist_accessible = 1 AND security_cc.who IS NOT NULL) + OR bugs.assigned_to = $user_id + }; + + if (Bugzilla->params->{'useqacontact'}) { + $query .= " OR bugs.qa_contact = $user_id"; + } + $query .= ')'; + + $sth ||= $dbh->prepare($query); + if (scalar(@$check_ids) == 1) { + $self->{_sth_one_visible_bug} = $sth; + } + + # Set all bugs as non visible + foreach my $bug_id (@$check_ids) { + $visible_cache->{$bug_id} = 0; + } + + # Now get the bugs the user can see + my $visible_bug_ids = $dbh->selectcol_arrayref($sth, undef, @$check_ids); + foreach my $bug_id (@$visible_bug_ids) { + $visible_cache->{$bug_id} = 1; + } +} + +sub _visible_bugs_check_and { + my ($self, $check_ids) = @_; + my $visible_cache = $self->{_visible_bugs_cache}; + my $dbh = Bugzilla->dbh; + my $user_id = $self->id; + + my $sth; + # Speed up the can_see_bug case. + if (scalar(@$check_ids) == 1) { + $sth = $self->{_sth_one_visible_bug}; + } + $sth ||= $dbh->prepare( + # This checks for groups that the bug is in that the user + # *isn't* in. Then, in the Perl code below, we check if + # the user can otherwise access the bug (for example, by being + # the assignee or QA Contact). + # + # The DISTINCT exists because the bug could be in *several* + # groups that the user isn't in, but they will all return the + # same result for bug_group_map.bug_id (so DISTINCT filters + # out duplicate rows). + "SELECT DISTINCT bugs.bug_id, reporter, assigned_to, qa_contact, + reporter_accessible, cclist_accessible, cc.who, + bug_group_map.bug_id + FROM bugs + LEFT JOIN cc + ON cc.bug_id = bugs.bug_id + AND cc.who = $user_id + LEFT JOIN bug_group_map + ON bugs.bug_id = bug_group_map.bug_id + AND bug_group_map.group_id NOT IN (" + . $self->groups_as_string . ') + WHERE bugs.bug_id IN (' . join(',', ('?') x @$check_ids) . ') + AND creation_ts IS NOT NULL '); + if (scalar(@$check_ids) == 1) { + $self->{_sth_one_visible_bug} = $sth; + } + + $sth->execute(@$check_ids); + my $use_qa_contact = Bugzilla->params->{'useqacontact'}; + while (my $row = $sth->fetchrow_arrayref) { + my ($bug_id, $reporter, $owner, $qacontact, $reporter_access, + $cclist_access, $isoncclist, $missinggroup) = @$row; + $visible_cache->{$bug_id} ||= + ((($reporter == $user_id) && $reporter_access) + || ($use_qa_contact + && $qacontact && ($qacontact == $user_id)) + || ($owner == $user_id) + || ($isoncclist && $cclist_access) + || !$missinggroup) ? 1 : 0; + } + +} + sub clear_product_cache { my $self = shift; delete $self->{enterable_products}; @@ -964,15 +1289,24 @@ sub get_selectable_products { my $class_restricted = Bugzilla->params->{'useclassification'} && $class_id; if (!defined $self->{selectable_products}) { - my $query = "SELECT id " . - " FROM products " . - "LEFT JOIN group_control_map " . - "ON group_control_map.product_id = products.id " . - " AND group_control_map.membercontrol = " . CONTROLMAPMANDATORY . - " AND group_id NOT IN(" . $self->groups_as_string . ") " . - " WHERE group_id IS NULL " . - "ORDER BY name"; - + my $query = "SELECT id + FROM products + LEFT JOIN group_control_map + ON group_control_map.product_id = products.id + AND group_control_map.membercontrol = " . CONTROLMAPMANDATORY; + + if (Bugzilla->params->{'or_groups'}) { + # Either the user is in at least one of the MANDATORY groups, or + # there are no such groups for the product. + $query .= " WHERE group_id IN (" . $self->groups_as_string . ") + OR group_id IS NULL"; + } + else { + # There must be no MANDATORY groups that the user is not in. + $query .= " AND group_id NOT IN (" . $self->groups_as_string . ") + WHERE group_id IS NULL"; + } + my $prod_ids = Bugzilla->dbh->selectcol_arrayref($query); $self->{selectable_products} = Bugzilla::Product->new_from_list($prod_ids); } @@ -1065,14 +1399,21 @@ sub get_enterable_products { } # All products which the user has "Entry" access to. - my $enterable_ids = $dbh->selectcol_arrayref( + my $query = 'SELECT products.id FROM products - LEFT JOIN group_control_map - ON group_control_map.product_id = products.id - AND group_control_map.entry != 0 - AND group_id NOT IN (' . $self->groups_as_string . ') - WHERE group_id IS NULL - AND products.isactive = 1'); + LEFT JOIN group_control_map + ON group_control_map.product_id = products.id + AND group_control_map.entry != 0'; + + if (Bugzilla->params->{'or_groups'}) { + $query .= " WHERE (group_id IN (" . $self->groups_as_string . ")" . + " OR group_id IS NULL)"; + } else { + $query .= " AND group_id NOT IN (" . $self->groups_as_string . ")" . + " WHERE group_id IS NULL" + } + $query .= " AND products.isactive = 1"; + my $enterable_ids = $dbh->selectcol_arrayref($query); if (scalar @$enterable_ids) { # And all of these products must have at least one component @@ -1110,6 +1451,30 @@ sub get_accessible_products { return [ sort { $a->name cmp $b->name } values %products ]; } +sub can_administer { + my $self = shift; + + if (not defined $self->{can_administer}) { + my $can_administer = 0; + + $can_administer = 1 if $self->in_group('admin') + || $self->in_group('tweakparams') + || $self->in_group('editusers') + || $self->can_bless + || (Bugzilla->params->{'useclassification'} && $self->in_group('editclassifications')) + || $self->in_group('editcomponents') + || scalar(@{$self->get_products_by_permission('editcomponents')}) + || $self->in_group('creategroups') + || $self->in_group('editkeywords') + || $self->in_group('bz_canusewhines'); + + Bugzilla::Hook::process('user_can_administer', { can_administer => \$can_administer }); + $self->{can_administer} = $can_administer; + } + + return $self->{can_administer}; +} + sub check_can_admin_product { my ($self, $product_name) = @_; @@ -1143,7 +1508,7 @@ sub check_can_admin_flagtype { my $e = $flagtype->exclusions_as_hash; # If there is at least one product for which the user doesn't have - # editcomponents privs, then don't allow him to do everything with + # editcomponents privs, then don't allow them to do everything with # this flagtype, independently of whether this product is in the # exclusion list or not. my %product_ids; @@ -1297,6 +1662,8 @@ sub derive_regexp_groups { $group_delete->execute($id, $group, GRANT_REGEXP) if $present; } } + + Bugzilla->memcached->clear_config({ key => "user_groups.$id" }); } sub product_responsibilities { @@ -1832,6 +2199,17 @@ sub is_timetracker { return $self->{'is_timetracker'}; } +sub can_tag_comments { + my $self = shift; + + if (!defined $self->{'can_tag_comments'}) { + my $group = Bugzilla->params->{'comment_taggers_group'}; + $self->{'can_tag_comments'} = + ($group && $self->in_group($group)) ? 1 : 0; + } + return $self->{'can_tag_comments'}; +} + sub get_userlist { my $self = shift; @@ -2033,7 +2411,8 @@ sub check_and_send_account_creation_confirmation { ThrowUserError('account_creation_restricted'); } - ThrowUserError('restricted_email_address', {addr => $login}) if $login =~ m/.+\@gentoo\.org$/; + # Allow extensions to do extra checks. + Bugzilla::Hook::process('user_check_account_creation', { login => $login }); # Create and send a token for this new account. require Bugzilla::Token; @@ -2074,41 +2453,36 @@ sub login_to_id { } } -sub user_id_to_login { - my $user_id = shift; - my $dbh = Bugzilla->dbh; - - return '' unless ($user_id && detaint_natural($user_id)); - - my $login = $dbh->selectrow_array('SELECT login_name FROM profiles - WHERE userid = ?', undef, $user_id); - return $login || ''; +sub validate_password { + my $check = validate_password_check(@_); + ThrowUserError($check) if $check; + return 1; } -sub validate_password { +sub validate_password_check { my ($password, $matchpassword) = @_; if (length($password) < USER_PASSWORD_MIN_LENGTH) { - ThrowUserError('password_too_short'); + return 'password_too_short'; } elsif ((defined $matchpassword) && ($password ne $matchpassword)) { - ThrowUserError('passwords_dont_match'); + return 'passwords_dont_match'; } - + my $complexity_level = Bugzilla->params->{password_complexity}; if ($complexity_level eq 'letters_numbers_specialchars') { - ThrowUserError('password_not_complex') + return 'password_not_complex' if ($password !~ /[[:alpha:]]/ || $password !~ /\d/ || $password !~ /[[:punct:]]/); } elsif ($complexity_level eq 'letters_numbers') { - ThrowUserError('password_not_complex') + return 'password_not_complex' if ($password !~ /[[:lower:]]/ || $password !~ /[[:upper:]]/ || $password !~ /\d/); } elsif ($complexity_level eq 'mixed_letters') { - ThrowUserError('password_not_complex') + return 'password_not_complex' if ($password !~ /[[:lower:]]/ || $password !~ /[[:upper:]]/); } # Having done these checks makes us consider the password untainted. trick_taint($_[0]); - return 1; + return; } @@ -2226,6 +2600,34 @@ groups. Returns a hashref with tag IDs as key, and a hashref with tag 'id', 'name' and 'bug_count' as value. +=item C<bugs_ignored> + +Returns an array of hashrefs containing information about bugs currently +being ignored by the user. + +Each hashref contains the following information: + +=over + +=item C<id> + +C<int> The id of the bug. + +=item C<status> + +C<string> The current status of the bug. + +=item C<summary> + +C<string> The current summary of the bug. + +=back + +=item C<is_bug_ignored> + +Returns true if the user does not want email notifications for the +specified bug ID, else returns false. + =back =head2 Saved Recent Bug Lists @@ -2278,6 +2680,10 @@ This notes that this account has failed to log in, and stores the fact in the database. The storing happens immediately, it does not wait for you to call C<update>. +=item C<set_email_enabled> + +C<bool> - Sets C<disable_mail> to the inverse of the boolean provided. + =back =head2 Other Methods @@ -2303,7 +2709,7 @@ Returns the 'real' name for this user, if any. =item C<showmybugslink> -Returns C<1> if the user has set his preference to show the 'My Bugs' link in +Returns C<1> if the user has set their preference to show the 'My Bugs' link in the page footer, and C<0> otherwise. =item C<identity> @@ -2407,7 +2813,7 @@ that you need to be able to see a group in order to bless it. =item C<get_products_by_permission($group)> Returns a list of product objects for which the user has $group privileges -and which he can access. +and which they can access. $group must be one of the groups defined in PER_PRODUCT_PRIVILEGES. =item C<can_see_user(user)> @@ -2420,6 +2826,12 @@ Returns 1 if the specified user account exists and is visible to the user, Determines if, given a product id, the user can edit bugs in this product at all. +=item C<visible_bugs($bugs)> + +Description: Determines if a list of bugs are visible to the user. +Params: C<$bugs> - An arrayref of Bugzilla::Bug objects or bug ids +Returns: An arrayref of the bug ids that the user can see + =item C<can_see_bug(bug_id)> Determines if the user can see the specified bug. @@ -2506,6 +2918,10 @@ not be aware of the existence of the product. Returns: an array of product objects. +=item C<can_administer> + +Returns 1 if the user can see the admin menu. Otherwise, returns 0 + =item C<check_can_admin_product($product_name)> Description: Checks whether the user is allowed to administrate the product. @@ -2519,7 +2935,7 @@ not be aware of the existence of the product. Description: Checks whether the user is allowed to edit properties of the flag type. If the flag type is also used by some products for which the user hasn't editcomponents privs, then the user is only allowed to edit - the inclusion and exclusion lists for products he can administrate. + the inclusion and exclusion lists for products they can administrate. Params: $flagtype_id - a flag type ID. @@ -2602,6 +3018,72 @@ i.e. if the 'insidergroup' parameter is set and the user belongs to this group. Returns true if the user is a global watcher, i.e. if the 'globalwatchers' parameter contains the user. +=item C<can_tag_comments> + +Returns true if the user can attach tags to comments. +i.e. if the 'comment_taggers_group' parameter is set and the user belongs to +this group. + +=item C<last_visited> + +Returns an arrayref L<Bugzilla::BugUserLastVisit> objects. + +=item C<is_involved_in_bug($bug)> + +Returns true if any of the following conditions are met, false otherwise. + +=over + +=item * + +User is the assignee of the bug + +=item * + +User is the reporter of the bug + +=item * + +User is the QA contact of the bug (if Bugzilla is configured to use a QA +contact) + +=item * + +User is in the cc list for the bug. + +=back + +=item C<set_groups> + +C<hash> These specify the groups that this user is directly a member of. +To set these, you should pass a hash as the value. The hash may contain +the following fields: + +=over + +=item C<add> An array of C<int>s or C<string>s. The group ids or group names +that the user should be added to. + +=item C<remove> An array of C<int>s or C<string>s. The group ids or group names +that the user should be removed from. + +=item C<set> An array of C<int>s or C<string>s. An exact set of group ids +and group names that the user should be a member of. NOTE: This does not +remove groups from the user where the person making the change does not +have the bless privilege for. + +If you specify C<set>, then C<add> and C<remove> will be ignored. A group in +both the C<add> and C<remove> list will be added. Specifying a group that the +user making the change does not have bless rights will generate an error. + +=back + +=item C<set_bless_groups> + +C<hash> - This is the same as set_groups, but affects what groups a user +has direct membership to bless that group. It takes the same inputs as +set_groups. + =back =head1 CLASS FUNCTIONS @@ -2622,7 +3104,7 @@ Params: login_name - B<Required> The login name for the new user. a plain-text password. If you specify '*', the user will not be able to log in using DB authentication. disabledtext - The disable-text for the new user. If given, the user - will be disabled, meaning he cannot log in. Defaults to an + will be disabled, meaning they cannot log in. Defaults to an empty string. disable_mail - If 1, bug-related mail will not be sent to this user; if 0, mail will be sent depending on the user's email preferences. @@ -2652,8 +3134,8 @@ Params: $username (scalar, string) - The full login name of the username that you are checking. $old_username (scalar, string) - If you are checking an email-change token, insert the "old" username that the user is changing from, - here. Then, as long as it's the right user for that token, he - can change his username to $username. (That is, this function + here. Then, as long as it's the right user for that token, they + can change their username to $username. (That is, this function will return a boolean true value). =item C<login_to_id($login, $throw_error)> @@ -2672,21 +3154,26 @@ of a user, but you don't want the full weight of Bugzilla::User. However, consider using a Bugzilla::User object instead of this function if you need more information about the user than just their ID. -=item C<user_id_to_login($user_id)> - -Returns the login name of the user account for the given user ID. If no -valid user ID is given or the user has no entry in the profiles table, -we return an empty string. - =item C<validate_password($passwd1, $passwd2)> Returns true if a password is valid (i.e. meets Bugzilla's -requirements for length and content), else returns false. +requirements for length and content), else throws an error. Untaints C<$passwd1> if successful. If a second password is passed in, this function also verifies that the two passwords match. +=item C<validate_password_check($passwd1, $passwd2)> + +This sub routine is similair to C<validate_password>, except that it allows +the calling code to handle its own errors. + +Returns undef and untaints C<$passwd1> if a password is valid (i.e. meets +Bugzilla's requirements for length and content), else returns the error. + +If a second password is passed in, this function also verifies that +the two passwords match. + =item C<match_field($data, $fields, $behavior)> =over @@ -2735,3 +3222,55 @@ is done with the data. =head1 SEE ALSO L<Bugzilla|Bugzilla> + +=head1 B<Methods in need of POD> + +=over + +=item email_enabled + +=item cryptpassword + +=item clear_login_failures + +=item set_disable_mail + +=item has_audit_entries + +=item groups_with_icon + +=item check_login_name + +=item set_extern_id + +=item mail_settings + +=item email_disabled + +=item update + +=item is_timetracker + +=item is_enabled + +=item queryshare_groups_as_string + +=item set_login + +=item set_password + +=item last_seen_date + +=item set_disabledtext + +=item update_last_seen_date + +=item set_name + +=item DB_COLUMNS + +=item extern_id + +=item UPDATE_COLUMNS + +=back diff --git a/Bugzilla/User/APIKey.pm b/Bugzilla/User/APIKey.pm new file mode 100644 index 000000000..d268a0a93 --- /dev/null +++ b/Bugzilla/User/APIKey.pm @@ -0,0 +1,155 @@ +# 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::User::APIKey; + +use 5.10.1; +use strict; +use warnings; + +use parent qw(Bugzilla::Object); + +use Bugzilla::User; +use Bugzilla::Util qw(generate_random_password trim); + +##################################################################### +# Overriden Constants that are used as methods +##################################################################### + +use constant DB_TABLE => 'user_api_keys'; +use constant DB_COLUMNS => qw( + id + user_id + api_key + description + revoked + last_used +); + +use constant UPDATE_COLUMNS => qw(description revoked last_used); +use constant VALIDATORS => { + api_key => \&_check_api_key, + description => \&_check_description, + revoked => \&Bugzilla::Object::check_boolean, +}; +use constant LIST_ORDER => 'id'; +use constant NAME_FIELD => 'api_key'; + +# turn off auditing and exclude these objects from memcached +use constant { AUDIT_CREATES => 0, + AUDIT_UPDATES => 0, + AUDIT_REMOVES => 0, + USE_MEMCACHED => 0 }; + +# Accessors +sub id { return $_[0]->{id} } +sub user_id { return $_[0]->{user_id} } +sub api_key { return $_[0]->{api_key} } +sub description { return $_[0]->{description} } +sub revoked { return $_[0]->{revoked} } +sub last_used { return $_[0]->{last_used} } + +# Helpers +sub user { + my $self = shift; + $self->{user} //= Bugzilla::User->new({name => $self->user_id, cache => 1}); + return $self->{user}; +} + +sub update_last_used { + my $self = shift; + my $timestamp = shift + || Bugzilla->dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)'); + $self->set('last_used', $timestamp); + $self->update; +} + +# Setters +sub set_description { $_[0]->set('description', $_[1]); } +sub set_revoked { $_[0]->set('revoked', $_[1]); } + +# Validators +sub _check_api_key { return generate_random_password(40); } +sub _check_description { return trim($_[1]) || ''; } +1; + +__END__ + +=head1 NAME + +Bugzilla::User::APIKey - Model for an api key belonging to a user. + +=head1 SYNOPSIS + + use Bugzilla::User::APIKey; + + my $api_key = Bugzilla::User::APIKey->new($id); + my $api_key = Bugzilla::User::APIKey->new({ name => $api_key }); + + # Class Functions + $user_api_key = Bugzilla::User::APIKey->create({ + description => $description, + }); + +=head1 DESCRIPTION + +This package handles Bugzilla User::APIKey. + +C<Bugzilla::User::APIKey> is an implementation of L<Bugzilla::Object>, and +thus provides all the methods of L<Bugzilla::Object> in addition to the methods +listed below. + +=head1 METHODS + +=head2 Accessor Methods + +=over + +=item C<id> + +The internal id of the api key. + +=item C<user> + +The Bugzilla::User object that this api key belongs to. + +=item C<user_id> + +The user id that this api key belongs to. + +=item C<api_key> + +The API key, which is a random string. + +=item C<description> + +An optional string that lets the user describe what a key is used for. +For example: "Dashboard key", "Application X key". + +=item C<revoked> + +If true, this api key cannot be used. + +=item C<last_used> + +The date that this key was last used. undef if never used. + +=item C<update_last_used> + +Updates the last used value to the current timestamp. This is updated even +if the RPC call resulted in an error. It is not updated when the description +or the revoked flag is changed. + +=item C<set_description> + +Sets the new description + +=item C<set_revoked> + +Sets the revoked flag + +=back diff --git a/Bugzilla/User/Setting.pm b/Bugzilla/User/Setting.pm index 6fadfb352..ea3bbfb54 100644 --- a/Bugzilla/User/Setting.pm +++ b/Bugzilla/User/Setting.pm @@ -8,13 +8,20 @@ package Bugzilla::User::Setting; +use 5.10.1; use strict; -use base qw(Exporter); +use warnings; + +use parent qw(Exporter); # Module stuff -@Bugzilla::User::Setting::EXPORT = qw(get_all_settings get_defaults - add_setting); +@Bugzilla::User::Setting::EXPORT = qw( + get_all_settings + get_defaults + add_setting + clear_settings_cache +); use Bugzilla::Error; use Bugzilla::Util qw(trick_taint get_text); @@ -157,15 +164,20 @@ sub get_all_settings { my $settings = {}; my $dbh = Bugzilla->dbh; - my $rows = $dbh->selectall_arrayref( - q{SELECT name, default_value, is_enabled, setting_value, subclass - FROM setting - LEFT JOIN profile_setting - ON setting.name = profile_setting.setting_name - AND profile_setting.user_id = ?}, undef, ($user_id)); + my $cache_key = "user_settings.$user_id"; + my $rows = Bugzilla->memcached->get_config({ key => $cache_key }); + if (!$rows) { + $rows = $dbh->selectall_arrayref( + q{SELECT name, default_value, is_enabled, setting_value, subclass + FROM setting + LEFT JOIN profile_setting + ON setting.name = profile_setting.setting_name + AND profile_setting.user_id = ?}, undef, ($user_id)); + Bugzilla->memcached->set_config({ key => $cache_key, data => $rows }); + } foreach my $row (@$rows) { - my ($name, $default_value, $is_enabled, $value, $subclass) = @$row; + my ($name, $default_value, $is_enabled, $value, $subclass) = @$row; my $is_default; @@ -177,13 +189,18 @@ sub get_all_settings { } $settings->{$name} = new Bugzilla::User::Setting( - $name, $user_id, $is_enabled, + $name, $user_id, $is_enabled, $default_value, $value, $is_default, $subclass); } return $settings; } +sub clear_settings_cache { + my ($user_id) = @_; + Bugzilla->memcached->clear_config({ key => "user_settings.$user_id" }); +} + sub get_defaults { my ($user_id) = @_; my $dbh = Bugzilla->dbh; @@ -366,6 +383,13 @@ Params: C<$setting_name> - string - the name of the setting C<$is_enabled> - boolean - if false, all users must use the global default Returns: nothing +=item C<clear_settings_cache($user_id)> + +Description: Clears cached settings data for the specified user. Must be + called after updating any user's setting. +Params: C<$user_id> - integer - the user id. +Returns: nothing + =begin private =item C<_setting_exists> diff --git a/Bugzilla/User/Setting/Lang.pm b/Bugzilla/User/Setting/Lang.pm index 71b01d62f..d980b7a92 100644 --- a/Bugzilla/User/Setting/Lang.pm +++ b/Bugzilla/User/Setting/Lang.pm @@ -7,9 +7,11 @@ package Bugzilla::User::Setting::Lang; +use 5.10.1; use strict; +use warnings; -use base qw(Bugzilla::User::Setting); +use parent qw(Bugzilla::User::Setting); use Bugzilla::Constants; diff --git a/Bugzilla/User/Setting/Skin.pm b/Bugzilla/User/Setting/Skin.pm index c75ce7568..7b0688c0c 100644 --- a/Bugzilla/User/Setting/Skin.pm +++ b/Bugzilla/User/Setting/Skin.pm @@ -8,9 +8,11 @@ package Bugzilla::User::Setting::Skin; +use 5.10.1; use strict; +use warnings; -use base qw(Bugzilla::User::Setting); +use parent qw(Bugzilla::User::Setting); use Bugzilla::Constants; use File::Spec::Functions; diff --git a/Bugzilla/User/Setting/Timezone.pm b/Bugzilla/User/Setting/Timezone.pm index 91f997774..8959d1dda 100644 --- a/Bugzilla/User/Setting/Timezone.pm +++ b/Bugzilla/User/Setting/Timezone.pm @@ -7,11 +7,13 @@ package Bugzilla::User::Setting::Timezone; +use 5.10.1; use strict; +use warnings; use DateTime::TimeZone; -use base qw(Bugzilla::User::Setting); +use parent qw(Bugzilla::User::Setting); use Bugzilla::Constants; diff --git a/Bugzilla/UserAgent.pm b/Bugzilla/UserAgent.pm index 5615f86ee..6ceb9d3c5 100644 --- a/Bugzilla/UserAgent.pm +++ b/Bugzilla/UserAgent.pm @@ -7,8 +7,11 @@ package Bugzilla::UserAgent; +use 5.10.1; use strict; -use base qw(Exporter); +use warnings; + +use parent qw(Exporter); our @EXPORT = qw(detect_platform detect_op_sys); use Bugzilla::Field; diff --git a/Bugzilla/Util.pm b/Bugzilla/Util.pm index 4bd10e16c..670f5f8f2 100644 --- a/Bugzilla/Util.pm +++ b/Bugzilla/Util.pm @@ -7,21 +7,23 @@ package Bugzilla::Util; +use 5.10.1; use strict; +use warnings; -use base qw(Exporter); +use parent qw(Exporter); @Bugzilla::Util::EXPORT = qw(trick_taint detaint_natural detaint_signed html_quote url_quote xml_quote css_class_quote html_light_quote i_am_cgi i_am_webservice correct_urlbase remote_ip validate_ip do_ssl_redirect_if_required use_attachbase - diff_arrays on_main_db say + diff_arrays on_main_db trim wrap_hard wrap_comment find_wrap_point format_time validate_date validate_time datetime_from is_7bit_clean bz_crypt generate_random_password validate_email_syntax check_email_syntax clean_text - get_text template_var disable_utf8 - detect_encoding + get_text template_var display_value disable_utf8 + detect_encoding email_filter join_activity_entries); use Bugzilla::Constants; @@ -34,7 +36,6 @@ use Digest; use Email::Address; use List::Util qw(first); use Scalar::Util qw(tainted blessed); -use Template::Filters; use Text::Wrap; use Encode qw(encode decode resolve_alias); use Encode::Guess; @@ -64,10 +65,17 @@ sub detaint_signed { # visible strings. # Bug 319331: Handle BiDi disruptions. sub html_quote { - my ($var) = Template::Filters::html_filter(@_); + my $var = shift; + $var =~ s/&/&/g; + $var =~ s/</</g; + $var =~ s/>/>/g; + $var =~ s/"/"/g; # Obscure '@'. $var =~ s/\@/\@/g; - if (Bugzilla->params->{'utf8'}) { + + state $use_utf8 = Bugzilla->params->{'utf8'}; + + if ($use_utf8) { # Remove control characters if the encoding is utf8. # Other multibyte encodings may be using this range; so ignore if not utf8. $var =~ s/(?![\t\r\n])[[:cntrl:]]//g; @@ -93,7 +101,7 @@ sub html_quote { # |U+200e|Left-To-Right Mark |0xe2 0x80 0x8e | # |U+200f|Right-To-Left Mark |0xe2 0x80 0x8f | # -------------------------------------------------------- - $var =~ s/[\x{202a}-\x{202e}]//g; + $var =~ tr/\x{202a}-\x{202e}//d; } return $var; } @@ -237,7 +245,8 @@ sub i_am_cgi { sub i_am_webservice { my $usage_mode = Bugzilla->usage_mode; return $usage_mode == USAGE_MODE_XMLRPC - || $usage_mode == USAGE_MODE_JSON; + || $usage_mode == USAGE_MODE_JSON + || $usage_mode == USAGE_MODE_REST; } # This exists as a separate function from Bugzilla::CGI::redirect_to_https @@ -418,13 +427,6 @@ sub diff_arrays { return (\@removed, \@added); } -# XXX - This is a temporary subroutine till we require Perl 5.10.1. -# This will happen before Bugzilla 5.0rc1. -sub say (@) { - print @_; - print "\n"; -} - sub trim { my ($str) = @_; if ($str) { @@ -451,11 +453,6 @@ sub wrap_comment { $wrappedcomment .= ($line . "\n"); } else { - # Due to a segfault in Text::Tabs::expand() when processing tabs with - # Unicode (see http://rt.perl.org/rt3/Public/Bug/Display.html?id=52104), - # we have to remove tabs before processing the comment. This restriction - # can go away when we require Perl 5.8.9 or newer. - $line =~ s/\t/ /g; $wrappedcomment .= (wrap('', '', $line) . "\n"); } } @@ -555,9 +552,14 @@ sub datetime_from { # In the database, this is the "0" date. return undef if $date =~ /^0000/; - # strptime($date) returns an empty array if $date has an invalid - # date format. - my @time = strptime($date); + my @time; + # Most dates will be in this format, avoid strptime's generic parser + if ($date =~ /^(\d{4})[\.-](\d{2})[\.-](\d{2})(?: (\d{2}):(\d{2}):(\d{2}))?$/) { + @time = ($6, $5, $4, $3, $2 - 1, $1 - 1900, undef); + } + else { + @time = strptime($date); + } unless (scalar @time) { # If an unknown timezone is passed (such as MSK, for Moskow), @@ -641,20 +643,13 @@ sub bz_crypt { if (!$algorithm) { # Crypt the password. $crypted_password = crypt($password, $salt); - - # HACK: Perl has bug where returned crypted password is considered - # tainted. See http://rt.perl.org/rt3/Public/Bug/Display.html?id=59998 - unless(tainted($password) || tainted($salt)) { - trick_taint($crypted_password); - } } else { my $hasher = Digest->new($algorithm); - # We only want to use the first characters of the salt, no - # matter how long of a salt we may have been passed. - $salt = substr($salt, 0, PASSWORD_SALT_LENGTH); + # Newly created salts won't yet have a comma. + ($salt) = $salt =~ /^([^,]+),?/; $hasher->add($password, $salt); - $crypted_password = $salt . $hasher->b64digest . "{$algorithm}"; + $crypted_password = $salt . ',' . $hasher->b64digest . "{$algorithm}"; } # Return the crypted password. @@ -767,10 +762,12 @@ sub get_text { sub template_var { my $name = shift; - my $cache = Bugzilla->request_cache->{util_template_var} ||= {}; - my $template = Bugzilla->template_inner; - my $lang = $template->context->{bz_language}; + my $request_cache = Bugzilla->request_cache; + my $cache = $request_cache->{util_template_var} ||= {}; + my $lang = $request_cache->{template_current_lang}->[0] || ''; return $cache->{$lang}->{$name} if defined $cache->{$lang}; + + my $template = Bugzilla->template_inner($lang); my %vars; # Note: If we suddenly start needing a lot of template_var variables, # they should move into their own template, not field-descs. @@ -784,11 +781,7 @@ sub template_var { sub display_value { my ($field, $value) = @_; - my $value_descs = template_var('value_descs'); - if (defined $value_descs->{$field}->{$value}) { - return $value_descs->{$field}->{$value}; - } - return $value; + return template_var('value_descs')->{$field}->{$value} // $value; } sub disable_utf8 { @@ -1007,7 +1000,7 @@ in a command-line script. =item C<i_am_webservice()> Tells you whether or not the current usage mode is WebServices related -such as JSONRPC or XMLRPC. +such as JSONRPC, XMLRPC, or REST. =item C<correct_urlbase()> @@ -1152,7 +1145,7 @@ template. Just pass in the name of the variable that you want the value of. Takes a time and converts it to the desired format and timezone. If no format is given, the routine guesses the correct one and returns an empty array if it cannot. If no timezone is given, the user's timezone -is used, as defined in his preferences. +is used, as defined in their preferences. This routine is mainly called from templates to filter dates, see "FILTER time" in L<Bugzilla::Template>. @@ -1238,3 +1231,19 @@ if Bugzilla is currently using the shadowdb or not. Used like: } =back + +=head1 B<Methods in need of POD> + +=over + +=item do_ssl_redirect_if_required + +=item validate_time + +=item is_ipv4 + +=item is_ipv6 + +=item display_value + +=back diff --git a/Bugzilla/Version.pm b/Bugzilla/Version.pm index 7c341b654..4b332ff2b 100644 --- a/Bugzilla/Version.pm +++ b/Bugzilla/Version.pm @@ -5,13 +5,16 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +package Bugzilla::Version; + +use 5.10.1; use strict; +use warnings; -package Bugzilla::Version; +use parent qw(Bugzilla::Object Exporter); -use base qw(Bugzilla::Object); +@Bugzilla::Version::EXPORT = qw(vers_cmp); -use Bugzilla::Install::Util qw(vers_cmp); use Bugzilla::Util; use Bugzilla::Error; @@ -172,8 +175,8 @@ sub product { # Validators ################################ -sub set_name { $_[0]->set('value', $_[1]); } -sub set_is_active { $_[0]->set('isactive', $_[1]); } +sub set_value { $_[0]->set('value', $_[1]); } +sub set_isactive { $_[0]->set('isactive', $_[1]); } sub _check_value { my ($invocant, $name, undef, $params) = @_; @@ -199,6 +202,53 @@ sub _check_product { return Bugzilla->user->check_can_admin_product($product->name); } +############################### +##### Functions #### +############################### + +# This is taken straight from Sort::Versions 1.5, which is not included +# with perl by default. +sub vers_cmp { + my ($a, $b) = @_; + + # Remove leading zeroes - Bug 344661 + $a =~ s/^0*(\d.+)/$1/; + $b =~ s/^0*(\d.+)/$1/; + + my @A = ($a =~ /([-.]|\d+|[^-.\d]+)/g); + my @B = ($b =~ /([-.]|\d+|[^-.\d]+)/g); + + my ($A, $B); + while (@A and @B) { + $A = shift @A; + $B = shift @B; + if ($A eq '-' and $B eq '-') { + next; + } elsif ( $A eq '-' ) { + return -1; + } elsif ( $B eq '-') { + return 1; + } elsif ($A eq '.' and $B eq '.') { + next; + } elsif ( $A eq '.' ) { + return -1; + } elsif ( $B eq '.' ) { + return 1; + } elsif ($A =~ /^\d+$/ and $B =~ /^\d+$/) { + if ($A =~ /^0/ || $B =~ /^0/) { + return $A cmp $B if $A cmp $B; + } else { + return $A <=> $B if $A <=> $B; + } + } else { + $A = uc $A; + $B = uc $B; + return $A cmp $B if $A cmp $B; + } + } + return @A <=> @B; +} + 1; __END__ @@ -222,7 +272,7 @@ Bugzilla::Version - Bugzilla product version class. my $version = Bugzilla::Version->create( { value => $name, product => $product_obj }); - $version->set_name($new_name); + $version->set_value($new_name); $version->update(); $version->remove_from_db; @@ -242,12 +292,74 @@ below. =item C<bug_count()> - Description: Returns the total of bugs that belong to the version. +=over + +=item B<Description> - Params: none. +Returns the total of bugs that belong to the version. - Returns: Integer with the number of bugs. +=item B<Params> + +none + +=item B<Returns> + +Integer with the number of bugs. + +=back + +=back + +=head1 FUNCTIONS + +=over + +=item C<vers_cmp($a, $b)> + +=over + +=item B<Description> + +This is a comparison function, like you would use in C<sort>, except that +it compares two version numbers. So, for example, 2.10 would be greater +than 2.2. + +It's based on versioncmp from L<Sort::Versions>, with some Bugzilla-specific +fixes. + +=item B<Params> + +C<$a> and C<$b> - The versions you want to compare. + +=item B<Returns> + +C<-1> if C<$a> is less than C<$b>, C<0> if they are equal, or C<1> if C<$a> +is greater than C<$b>. + +=back =back =cut + +=head1 B<Methods in need of POD> + +=over + +=item DEFAULT_VERSION + +=item set_isactive + +=item set_value + +=item product_id + +=item is_active + +=item remove_from_db + +=item product + +=item update + +=back diff --git a/Bugzilla/WebService.pm b/Bugzilla/WebService.pm index 5646e381d..f80813744 100644 --- a/Bugzilla/WebService.pm +++ b/Bugzilla/WebService.pm @@ -8,7 +8,11 @@ # This is the base class for $self in WebService method calls. For the # actual RPC server, see Bugzilla::WebService::Server and its subclasses. package Bugzilla::WebService; + +use 5.10.1; use strict; +use warnings; + use Bugzilla::WebService::Server; # Used by the JSON-RPC server to convert incoming date fields apprpriately. @@ -46,15 +50,20 @@ This is the standard API for external programs that want to interact with Bugzilla. It provides various methods in various modules. You can interact with this API via -L<XML-RPC|Bugzilla::WebService::Server::XMLRPC> or -L<JSON-RPC|Bugzilla::WebService::Server::JSONRPC>. +L<XML-RPC|Bugzilla::WebService::Server::XMLRPC>, +L<JSON-RPC|Bugzilla::WebService::Server::JSONRPC> or +L<REST|Bugzilla::WebService::Server::REST>. =head1 CALLING METHODS -Methods are grouped into "packages", like C<Bug> for +Methods are grouped into "packages", like C<Bug> for L<Bugzilla::WebService::Bug>. So, for example, L<Bugzilla::WebService::Bug/get>, is called as C<Bug.get>. +For REST, the "package" is more determined by the path +used to access the resource. See each relevant method +for specific details on how to access via REST. + =head1 PARAMETERS The Bugzilla API takes the following various types of parameters: @@ -73,6 +82,11 @@ A floating-point number. May be null. A string. May be null. +=item C<email> + +A string representing an email address. This value, when returned, +may be filtered based on if the user is logged in or not. May be null. + =item C<dateTime> A date/time. Represented differently in different interfaces to this API. @@ -125,14 +139,22 @@ how this is implemented for those frontends. =head1 LOGGING IN -There are various ways to log in: +Some methods do not require you to log in. An example of this is Bug.get. +However, authenticating yourself allows you to see non public information. For +example, a bug that is not publicly visible. + +There are two ways to authenticate yourself: =over -=item C<User.login> +=item C<Bugzilla_api_key> -You can use L<Bugzilla::WebService::User/login> to log in as a Bugzilla -user. This issues a token that you must then use in future calls. +B<Added in Bugzilla 5.0> + +You can specify C<Bugzilla_api_key> as an argument to any WebService method, and +you will be logged in as that user if the key is correct, and has not been +revoked. You can set up an API key by using the 'API Key' tab in the +Preferences pages. =item C<Bugzilla_login> and C<Bugzilla_password> @@ -155,18 +177,39 @@ then your login will only be valid for your IP address. =back The C<Bugzilla_restrictlogin> option is only used when you have also -specified C<Bugzilla_login> and C<Bugzilla_password>. +specified C<Bugzilla_login> and C<Bugzilla_password>. This value will be +deprecated in the release after Bugzilla 5.0 and you will be required to +pass the Bugzilla_login and Bugzilla_password for every call. + +For REST, you may also use the C<login> and C<password> variable +names instead of C<Bugzilla_login> and C<Bugzilla_password> as a +convenience. You may also use C<token> instead of C<Bugzilla_token>. + +=back + +There are also two deprecreated methods of authentications. This will be +removed in the version after Bugzilla 5.0. + +=over + +=item C<User.login> + +You can use L<Bugzilla::WebService::User/login> to log in as a Bugzilla +user. This issues a token that you must then use in future calls. =item C<Bugzilla_token> -B<Added in Bugzilla 5.0 and backported to 4.4.3> +B<Added in Bugzilla 4.4.3> You can specify C<Bugzilla_token> as argument to any WebService method, and you will be logged in as that user if the token is correct. This is the token returned when calling C<User.login> mentioned above. -Support for using login cookies for authentication has been dropped -for security reasons. +An error is thrown if you pass an invalid token and you will need to log +in again to get a new token. + +Token support was added in Bugzilla B<5.0> and support for login cookies +has been dropped for security reasons. =back @@ -262,6 +305,9 @@ would return something like: { users => [{ id => 1, name => 'user@domain.com' }] } +Note for REST, C<include_fields> may instead be a comma delimited string +for GET type requests. + =item C<exclude_fields> C<array> An array of strings, representing the (case-sensitive) names of @@ -291,6 +337,37 @@ would return something like: { users => [{ id => 1, real_name => 'John Smith' }] } +Note for REST, C<exclude_fields> may instead be a comma delimited string +for GET type requests. + +=back + +There are several shortcut identifiers to ask for only certain groups of +fields to be returned or excluded. + +=over + +=item C<_all> + +All possible fields are returned if C<_all> is specified in C<include_fields>. + +=item C<_default> + +These fields are returned if C<include_fields> is empty or C<_default> +is specified. All fields described in the documentation are returned +by default unless specified otherwise. + +=item C<_extra> + +These fields are not returned by default and need to be manually specified +in C<include_fields> either by field name, or using C<_extra>. + +=item C<_custom> + +Only custom fields are returned if C<_custom> is specified in C<include_fields>. +This is normally specific to bug objects and not relevant for other returned +objects. + =back =head1 SEE ALSO @@ -315,6 +392,10 @@ would return something like: =item L<Bugzilla::WebService::Classification> +=item L<Bugzilla::WebService::FlagType> + +=item L<Bugzilla::WebService::Component> + =item L<Bugzilla::WebService::Group> =item L<Bugzilla::WebService::Product> @@ -322,3 +403,11 @@ would return something like: =item L<Bugzilla::WebService::User> =back + +=head1 B<Methods in need of POD> + +=over + +=item login_exempt + +=back diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm index 006925994..127ea40bb 100644 --- a/Bugzilla/WebService/Bug.pm +++ b/Bugzilla/WebService/Bug.pm @@ -7,22 +7,34 @@ package Bugzilla::WebService::Bug; +use 5.10.1; use strict; -use base qw(Bugzilla::WebService); +use warnings; + +use parent qw(Bugzilla::WebService); use Bugzilla::Comment; +use Bugzilla::Comment::TagWeights; use Bugzilla::Constants; use Bugzilla::Error; use Bugzilla::Field; use Bugzilla::WebService::Constants; -use Bugzilla::WebService::Util qw(filter filter_wants validate); +use Bugzilla::WebService::Util qw(extract_flags filter filter_wants validate translate); use Bugzilla::Bug; use Bugzilla::BugMail; -use Bugzilla::Util qw(trick_taint trim diff_arrays); +use Bugzilla::Util qw(trick_taint trim diff_arrays detaint_natural); use Bugzilla::Version; use Bugzilla::Milestone; use Bugzilla::Status; use Bugzilla::Token qw(issue_hash_token); +use Bugzilla::Search; +use Bugzilla::Product; +use Bugzilla::FlagType; +use Bugzilla::Search::Quicksearch; + +use List::Util qw(max); +use List::MoreUtils qw(uniq); +use Storable qw(dclone); ############# # Constants # @@ -32,6 +44,7 @@ use constant PRODUCT_SPECIFIC_FIELDS => qw(version target_milestone component); use constant DATE_FIELDS => { comments => ['new_since'], + history => ['new_since'], search => ['last_change_time', 'creation_time'], }; @@ -57,28 +70,32 @@ use constant PUBLIC_METHODS => qw( create fields get - get_bugs - get_history history legal_values possible_duplicates render_comment search + search_comment_tags update + update_attachment + update_comment_tags update_see_also update_tags ); -###################################################### -# Add aliases here for old method name compatibility # -###################################################### +use constant ATTACHMENT_MAPPED_SETTERS => { + file_name => 'filename', + summary => 'description', +}; -BEGIN { - # In 3.0, get was called get_bugs - *get_bugs = \&get; - # Before 3.4rc1, "history" was get_history. - *get_history = \&history; -} +use constant ATTACHMENT_MAPPED_RETURNS => { + description => 'summary', + ispatch => 'is_patch', + isprivate => 'is_private', + isobsolete => 'is_obsolete', + filename => 'file_name', + mimetype => 'content_type', +}; ########### # Methods # @@ -312,16 +329,40 @@ sub comments { return { bugs => \%bugs, comments => \%comments }; } +sub render_comment { + my ($self, $params) = @_; + + unless (defined $params->{text}) { + ThrowCodeError('params_required', + { function => 'Bug.render_comment', + params => ['text'] }); + } + + Bugzilla->switch_to_shadow_db(); + my $bug = $params->{id} ? Bugzilla::Bug->check($params->{id}) : undef; + + my $tmpl = '[% text FILTER quoteUrls(bug) %]'; + my $html; + my $template = Bugzilla->template; + $template->process( + \$tmpl, + { bug => $bug, text => $params->{text}}, + \$html + ); + + return { html => $html }; +} + # Helper for Bug.comments sub _translate_comment { - my ($self, $comment, $filters) = @_; + my ($self, $comment, $filters, $types, $prefix) = @_; my $attach_id = $comment->is_about_attachment ? $comment->extra_data : undef; - return filter $filters, { + + my $comment_hash = { id => $self->type('int', $comment->id), bug_id => $self->type('int', $comment->bug_id), - creator => $self->type('string', $comment->author->login), - author => $self->type('string', $comment->author->login), + creator => $self->type('email', $comment->author->login), time => $self->type('dateTime', $comment->creation_ts), creation_time => $self->type('dateTime', $comment->creation_ts), is_private => $self->type('boolean', $comment->is_private), @@ -329,18 +370,33 @@ sub _translate_comment { attachment_id => $self->type('int', $attach_id), count => $self->type('int', $comment->count), }; + + # Don't load comment tags unless enabled + if (Bugzilla->params->{'comment_taggers_group'}) { + $comment_hash->{tags} = [ + map { $self->type('string', $_) } + @{ $comment->tags } + ]; + } + + return filter($filters, $comment_hash, $types, $prefix); } sub get { my ($self, $params) = validate(@_, 'ids'); - Bugzilla->switch_to_shadow_db(); + Bugzilla->switch_to_shadow_db() unless Bugzilla->user->id; my $ids = $params->{ids}; defined $ids || ThrowCodeError('param_required', { param => 'ids' }); - my @bugs; - my @faults; + my (@bugs, @faults, @hashes); + + # Cache permissions for bugs. This highly reduces the number of calls to the DB. + # visible_bugs() is only able to handle bug IDs, so we have to skip aliases. + my @int = grep { $_ =~ /^\d+$/ } @$ids; + Bugzilla->user->visible_bugs(\@int); + foreach my $bug_id (@$ids) { my $bug; if ($params->{permissive}) { @@ -358,10 +414,18 @@ sub get { else { $bug = Bugzilla::Bug->check($bug_id); } - push(@bugs, $self->_bug_to_hash($bug, $params)); + push(@bugs, $bug); + push(@hashes, $self->_bug_to_hash($bug, $params)); } - return { bugs => \@bugs, faults => \@faults }; + # Set the ETag before inserting the update tokens + # since the tokens will always be unique even if + # the data has not changed. + $self->bz_etag(\@hashes); + + $self->_add_update_tokens($params, \@bugs, \@hashes); + + return { bugs => \@hashes, faults => \@faults }; } # this is a function that gets bug activity for list of bug ids @@ -385,7 +449,7 @@ sub history { $bug_id = $bug->id; $item{id} = $self->type('int', $bug_id); - my ($activity) = $bug->get_activity; + my ($activity) = $bug->get_activity(undef, $params->{new_since}); my @history; foreach my $changeset (@$activity) { @@ -414,7 +478,7 @@ sub history { # alias is returned in case users passes a mixture of ids and aliases # then they get to know which bug activity relates to which value # they passed - $item{alias} = $self->type('string', $bug->alias); + $item{alias} = [ map { $self->type('string', $_) } @{ $bug->alias } ]; push(@return, \%item); } @@ -424,77 +488,110 @@ sub history { sub search { my ($self, $params) = @_; + my $user = Bugzilla->user; + my $dbh = Bugzilla->dbh; Bugzilla->switch_to_shadow_db(); - if ( defined($params->{offset}) and !defined($params->{limit}) ) { - ThrowCodeError('param_required', + my $match_params = dclone($params); + delete $match_params->{include_fields}; + delete $match_params->{exclude_fields}; + + # Determine whether this is a quicksearch query + if (exists $match_params->{quicksearch}) { + my $quicksearch = quicksearch($match_params->{'quicksearch'}); + my $cgi = Bugzilla::CGI->new($quicksearch); + $match_params = $cgi->Vars; + } + + if ( defined($match_params->{offset}) and !defined($match_params->{limit}) ) { + ThrowCodeError('param_required', { param => 'limit', function => 'Bug.search()' }); } my $max_results = Bugzilla->params->{max_search_results}; - unless (defined $params->{limit} && $params->{limit} == 0) { - if (!defined $params->{limit} || $params->{limit} > $max_results) { - $params->{limit} = $max_results; + unless (defined $match_params->{limit} && $match_params->{limit} == 0) { + if (!defined $match_params->{limit} || $match_params->{limit} > $max_results) { + $match_params->{limit} = $max_results; } } else { - delete $params->{limit}; - delete $params->{offset}; + delete $match_params->{limit}; + delete $match_params->{offset}; } - $params = Bugzilla::Bug::map_fields($params); - delete $params->{WHERE}; + $match_params = Bugzilla::Bug::map_fields($match_params); - unless (Bugzilla->user->is_timetracker) { - delete $params->{$_} foreach qw(estimated_time remaining_time deadline); - } + my %options = ( fields => ['bug_id'] ); + + # Find the highest custom field id + my @field_ids = grep(/^f(\d+)$/, keys %$match_params); + my $last_field_id = @field_ids ? max @field_ids + 1 : 1; # Do special search types for certain fields. - if ( my $bug_when = delete $params->{delta_ts} ) { - $params->{WHERE}->{'delta_ts >= ?'} = $bug_when; + if (my $change_when = delete $match_params->{'delta_ts'}) { + $match_params->{"f${last_field_id}"} = 'delta_ts'; + $match_params->{"o${last_field_id}"} = 'greaterthaneq'; + $match_params->{"v${last_field_id}"} = $change_when; + $last_field_id++; + } + if (my $creation_when = delete $match_params->{'creation_ts'}) { + $match_params->{"f${last_field_id}"} = 'creation_ts'; + $match_params->{"o${last_field_id}"} = 'greaterthaneq'; + $match_params->{"v${last_field_id}"} = $creation_when; + $last_field_id++; } - if (my $when = delete $params->{creation_ts}) { - $params->{WHERE}->{'creation_ts >= ?'} = $when; + + # Some fields require a search type such as short desc, keywords, etc. + foreach my $param (qw(short_desc longdesc status_whiteboard bug_file_loc)) { + if (defined $match_params->{$param} && !defined $match_params->{$param . '_type'}) { + $match_params->{$param . '_type'} = 'allwordssubstr'; + } } - if (my $summary = delete $params->{short_desc}) { - my @strings = ref $summary ? @$summary : ($summary); - my @likes = ("short_desc LIKE ?") x @strings; - my $clause = join(' OR ', @likes); - $params->{WHERE}->{"($clause)"} = [map { "\%$_\%" } @strings]; + if (defined $match_params->{'keywords'} && !defined $match_params->{'keywords_type'}) { + $match_params->{'keywords_type'} = 'allwords'; } - if (my $whiteboard = delete $params->{status_whiteboard}) { - my @strings = ref $whiteboard ? @$whiteboard : ($whiteboard); - my @likes = ("status_whiteboard LIKE ?") x @strings; - my $clause = join(' OR ', @likes); - $params->{WHERE}->{"($clause)"} = [map { "\%$_\%" } @strings]; + + # Backwards compatibility with old method regarding role search + $match_params->{'reporter'} = delete $match_params->{'creator'} if $match_params->{'creator'}; + foreach my $role (qw(assigned_to reporter qa_contact longdesc cc)) { + next if !exists $match_params->{$role}; + my $value = delete $match_params->{$role}; + $match_params->{"f${last_field_id}"} = $role; + $match_params->{"o${last_field_id}"} = "anywordssubstr"; + $match_params->{"v${last_field_id}"} = ref $value ? join(" ", @{$value}) : $value; + $last_field_id++; } # If no other parameters have been passed other than limit and offset - # and a WHERE parameter was not created earlier, then we throw error - # if system is configured to do so. - if (!$params->{WHERE} - && !grep(!/(limit|offset)/i, keys %$params) + # then we throw error if system is configured to do so. + if (!grep(!/^(limit|offset)$/, keys %$match_params) && !Bugzilla->params->{search_allow_no_criteria}) { ThrowUserError('buglist_parameters_required'); } - # We want include_fields and exclude_fields to be passed to - # _bug_to_hash but not to Bugzilla::Bug->match so we copy the - # params and delete those before passing to Bugzilla::Bug->match. - my %match_params = %{ $params }; - delete $match_params{'include_fields'}; - delete $match_params{'exclude_fields'}; + $options{order} = [ split(/\s*,\s*/, delete $match_params->{order}) ] if $match_params->{order}; + $options{params} = $match_params; - my $bugs = Bugzilla::Bug->match(\%match_params); - my $visible = Bugzilla->user->visible_bugs($bugs); - my @hashes = map { $self->_bug_to_hash($_, $params) } @$visible; - return { bugs => \@hashes }; + my $search = new Bugzilla::Search(%options); + my ($data) = $search->data; + + if (!scalar @$data) { + return { bugs => [] }; + } + + # Search.pm won't return bugs that the user shouldn't see so no filtering is needed. + my @bug_ids = map { $_->[0] } @$data; + my %bug_objects = map { $_->id => $_ } @{ Bugzilla::Bug->new_from_list(\@bug_ids) }; + my @bugs = map { $bug_objects{$_} } @bug_ids; + @bugs = map { $self->_bug_to_hash($_, $params) } @bugs; + + return { bugs => \@bugs }; } sub possible_duplicates { - my ($self, $params) = validate(@_, 'product'); + my ($self, $params) = validate(@_, 'products'); my $user = Bugzilla->user; Bugzilla->switch_to_shadow_db(); @@ -504,7 +601,7 @@ sub possible_duplicates { { function => 'Bug.possible_duplicates', param => 'summary' }); my @products; - foreach my $name (@{ $params->{'product'} || [] }) { + foreach my $name (@{ $params->{'products'} || [] }) { my $object = $user->can_enter_product($name, THROW_ERROR); push(@products, $object); } @@ -513,6 +610,7 @@ sub possible_duplicates { { summary => $params->{summary}, products => \@products, limit => $params->{limit} }); my @hashes = map { $self->_bug_to_hash($_, $params) } @$possible_dupes; + $self->_add_update_tokens($params, $possible_dupes, \@hashes); return { bugs => \@hashes }; } @@ -543,10 +641,25 @@ sub update { # have valid "set_" functions in Bugzilla::Bug, but shouldn't be # called using those field names. delete $values{dependencies}; - delete $values{flags}; + + # For backwards compatibility, treat alias string or array as a set action + if (exists $values{alias}) { + if (not ref $values{alias}) { + $values{alias} = { set => [ $values{alias} ] }; + } + elsif (ref $values{alias} eq 'ARRAY') { + $values{alias} = { set => $values{alias} }; + } + } + + my $flags = delete $values{flags}; foreach my $bug (@bugs) { $bug->set_all(\%values); + if ($flags) { + my ($old_flags, $new_flags) = extract_flags($flags, $bug); + $bug->set_flags($old_flags, $new_flags); + } } my %all_changes; @@ -555,7 +668,7 @@ sub update { $all_changes{$bug->id} = $bug->update(); } $dbh->bz_commit_transaction(); - + foreach my $bug (@bugs) { $bug->send_changes($all_changes{$bug->id}); } @@ -576,7 +689,7 @@ sub update { # alias is returned in case users pass a mixture of ids and aliases, # so that they can know which set of changes relates to which value # they passed. - $hash{alias} = $self->type('string', $bug->alias); + $hash{alias} = [ map { $self->type('string', $_) } @{ $bug->alias } ]; my %changes = %{ $all_changes{$bug->id} }; foreach my $field (keys %changes) { @@ -601,10 +714,31 @@ sub update { sub create { my ($self, $params) = @_; + my $dbh = Bugzilla->dbh; + Bugzilla->login(LOGIN_REQUIRED); + $params = Bugzilla::Bug::map_fields($params); + + my $flags = delete $params->{flags}; + + # We start a nested transaction in case flag setting fails + # we want the bug creation to roll back as well. + $dbh->bz_start_transaction(); + my $bug = Bugzilla::Bug->create($params); - Bugzilla::BugMail::Send($bug->bug_id, { changer => $bug->reporter }); + + # Set bug flags + if ($flags) { + my ($flags, $new_flags) = extract_flags($flags, $bug); + $bug->set_flags($flags, $new_flags); + $bug->update($bug->creation_ts); + } + + $dbh->bz_commit_transaction(); + + $bug->send_changes(); + return { id => $self->type('int', $bug->bug_id) }; } @@ -677,6 +811,8 @@ sub add_attachment { $dbh->bz_start_transaction(); my $timestamp = $dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)'); + my $flags = delete $params->{flags}; + foreach my $bug (@bugs) { my $attachment = Bugzilla::Attachment->create({ bug => $bug, @@ -688,6 +824,13 @@ sub add_attachment { ispatch => $params->{is_patch}, isprivate => $params->{is_private}, }); + + if ($flags) { + my ($old_flags, $new_flags) = extract_flags($flags, $bug, $attachment); + $attachment->set_flags($old_flags, $new_flags); + } + + $attachment->update($timestamp); my $comment = $params->{comment} || ''; $attachment->bug->add_comment($comment, { isprivate => $attachment->isprivate, @@ -705,6 +848,119 @@ sub add_attachment { return { ids => \@created_ids }; } +sub update_attachment { + my ($self, $params) = validate(@_, 'ids'); + + my $user = Bugzilla->login(LOGIN_REQUIRED); + my $dbh = Bugzilla->dbh; + + my $ids = delete $params->{ids}; + defined $ids || ThrowCodeError('param_required', { param => 'ids' }); + + # Some fields cannot be sent to set_all + foreach my $key (qw(login password token)) { + delete $params->{$key}; + } + + $params = translate($params, ATTACHMENT_MAPPED_SETTERS); + + # Get all the attachments, after verifying that they exist and are editable + my @attachments = (); + my %bugs = (); + foreach my $id (@$ids) { + my $attachment = Bugzilla::Attachment->new($id) + || ThrowUserError("invalid_attach_id", { attach_id => $id }); + my $bug = $attachment->bug; + $attachment->_check_bug; + + push @attachments, $attachment; + $bugs{$bug->id} = $bug; + } + + my $flags = delete $params->{flags}; + my $comment = delete $params->{comment}; + + # Update the values + foreach my $attachment (@attachments) { + my ($update_flags, $new_flags) = $flags + ? extract_flags($flags, $attachment->bug, $attachment) + : ([], []); + if ($attachment->validate_can_edit) { + $attachment->set_all($params); + $attachment->set_flags($update_flags, $new_flags) if $flags; + } + elsif (scalar @$update_flags && !scalar(@$new_flags) && !scalar keys %$params) { + # Requestees can set flags targetted to them, even if they cannot + # edit the attachment. Flag setters can edit their own flags too. + my %flag_list = map { $_->{id} => $_ } @$update_flags; + my $flag_objs = Bugzilla::Flag->new_from_list([ keys %flag_list ]); + my @editable_flags; + foreach my $flag_obj (@$flag_objs) { + if ($flag_obj->setter_id == $user->id + || ($flag_obj->requestee_id && $flag_obj->requestee_id == $user->id)) + { + push(@editable_flags, $flag_list{$flag_obj->id}); + } + } + if (!scalar @editable_flags) { + ThrowUserError("illegal_attachment_edit", { attach_id => $attachment->id }); + } + $attachment->set_flags(\@editable_flags, []); + } + else { + ThrowUserError("illegal_attachment_edit", { attach_id => $attachment->id }); + } + } + + $dbh->bz_start_transaction(); + + # Do the actual update and get information to return to user + my @result; + foreach my $attachment (@attachments) { + my $changes = $attachment->update(); + + if ($comment = trim($comment)) { + $attachment->bug->add_comment($comment, + { isprivate => $attachment->isprivate, + type => CMT_ATTACHMENT_UPDATED, + extra_data => $attachment->id }); + } + + $changes = translate($changes, ATTACHMENT_MAPPED_RETURNS); + + my %hash = ( + id => $self->type('int', $attachment->id), + last_change_time => $self->type('dateTime', $attachment->modification_time), + changes => {}, + ); + + foreach my $field (keys %$changes) { + my $change = $changes->{$field}; + + # We normalize undef to an empty string, so that the API + # stays consistent for things like Deadline that can become + # empty. + $hash{changes}->{$field} = { + removed => $self->type('string', $change->[0] // ''), + added => $self->type('string', $change->[1] // '') + }; + } + + push(@result, \%hash); + } + + $dbh->bz_commit_transaction(); + + # Email users about the change + foreach my $bug (values %bugs) { + $bug->update(); + $bug->send_changes(); + } + + # Return the information to the user + return { attachments => \@result }; +} + sub add_comment { my ($self, $params) = @_; @@ -784,7 +1040,7 @@ sub update_see_also { sub attachments { my ($self, $params) = validate(@_, 'ids', 'attachment_ids'); - Bugzilla->switch_to_shadow_db(); + Bugzilla->switch_to_shadow_db() unless Bugzilla->user->id; if (!(defined $params->{ids} or defined $params->{attachment_ids})) @@ -860,6 +1116,73 @@ sub update_tags { return { changes => \%changes }; } +sub update_comment_tags { + my ($self, $params) = @_; + + my $user = Bugzilla->login(LOGIN_REQUIRED); + Bugzilla->params->{'comment_taggers_group'} + || ThrowUserError("comment_tag_disabled"); + $user->can_tag_comments + || ThrowUserError("auth_failure", + { group => Bugzilla->params->{'comment_taggers_group'}, + action => "update", + object => "comment_tags" }); + + my $comment_id = $params->{comment_id} + // ThrowCodeError('param_required', + { function => 'Bug.update_comment_tags', + param => 'comment_id' }); + + my $comment = Bugzilla::Comment->new($comment_id) + || return []; + $comment->bug->check_is_visible(); + if ($comment->is_private && !$user->is_insider) { + ThrowUserError('comment_is_private', { id => $comment_id }); + } + + my $dbh = Bugzilla->dbh; + $dbh->bz_start_transaction(); + foreach my $tag (@{ $params->{add} || [] }) { + $comment->add_tag($tag) if defined $tag; + } + foreach my $tag (@{ $params->{remove} || [] }) { + $comment->remove_tag($tag) if defined $tag; + } + $comment->update(); + $dbh->bz_commit_transaction(); + + return $comment->tags; +} + +sub search_comment_tags { + my ($self, $params) = @_; + + Bugzilla->login(LOGIN_REQUIRED); + Bugzilla->params->{'comment_taggers_group'} + || ThrowUserError("comment_tag_disabled"); + Bugzilla->user->can_tag_comments + || ThrowUserError("auth_failure", { group => Bugzilla->params->{'comment_taggers_group'}, + action => "search", + object => "comment_tags"}); + + my $query = $params->{query}; + $query + // ThrowCodeError('param_required', { param => 'query' }); + my $limit = $params->{limit} || 7; + detaint_natural($limit) + || ThrowCodeError('param_must_be_numeric', { param => 'limit', + function => 'Bug.search_comment_tags' }); + + + my $tags = Bugzilla::Comment::TagWeights->match({ + WHERE => { + 'tag LIKE ?' => "\%$query\%", + }, + LIMIT => $limit, + }); + return [ map { $_->tag } @$tags ]; +} + ############################## # Private Helper Subroutines # ############################## @@ -875,12 +1198,12 @@ sub _bug_to_hash { # All the basic bug attributes are here, in alphabetical order. # A bug attribute is "basic" if it doesn't require an additional # database call to get the info. - my %item = ( - alias => $self->type('string', $bug->alias), - creation_time => $self->type('dateTime', $bug->creation_ts), + my %item = %{ filter $params, { + # No need to format $bug->deadline specially, because Bugzilla::Bug + # already does it for us. + deadline => $self->type('string', $bug->deadline), id => $self->type('int', $bug->bug_id), is_confirmed => $self->type('boolean', $bug->everconfirmed), - last_change_time => $self->type('dateTime', $bug->delta_ts), op_sys => $self->type('string', $bug->op_sys), platform => $self->type('string', $bug->rep_platform), priority => $self->type('string', $bug->priority), @@ -892,14 +1215,16 @@ sub _bug_to_hash { url => $self->type('string', $bug->bug_file_loc), version => $self->type('string', $bug->version), whiteboard => $self->type('string', $bug->status_whiteboard), - ); - + } }; - # First we handle any fields that require extra SQL calls. - # We don't do the SQL calls at all if the filter would just - # eliminate them anyway. + # First we handle any fields that require extra work (such as date parsing + # or SQL calls). + if (filter_wants $params, 'alias') { + $item{alias} = [ map { $self->type('string', $_) } @{ $bug->alias } ]; + } if (filter_wants $params, 'assigned_to') { - $item{'assigned_to'} = $self->type('string', $bug->assigned_to->login); + $item{'assigned_to'} = $self->type('email', $bug->assigned_to->login); + $item{'assigned_to_detail'} = $self->_user_to_hash($bug->assigned_to, $params, undef, 'assigned_to'); } if (filter_wants $params, 'blocks') { my @blocks = map { $self->type('int', $_) } @{ $bug->blocked }; @@ -912,11 +1237,16 @@ sub _bug_to_hash { $item{component} = $self->type('string', $bug->component); } if (filter_wants $params, 'cc') { - my @cc = map { $self->type('string', $_) } @{ $bug->cc }; + my @cc = map { $self->type('email', $_) } @{ $bug->cc }; $item{'cc'} = \@cc; + $item{'cc_detail'} = [ map { $self->_user_to_hash($_, $params, undef, 'cc') } @{ $bug->cc_users } ]; + } + if (filter_wants $params, 'creation_time') { + $item{'creation_time'} = $self->type('dateTime', $bug->creation_ts); } if (filter_wants $params, 'creator') { - $item{'creator'} = $self->type('string', $bug->reporter->login); + $item{'creator'} = $self->type('email', $bug->reporter->login); + $item{'creator_detail'} = $self->_user_to_hash($bug->reporter, $params, undef, 'creator'); } if (filter_wants $params, 'depends_on') { my @depends_on = map { $self->type('int', $_) } @{ $bug->dependson }; @@ -938,12 +1268,18 @@ sub _bug_to_hash { @{ $bug->keyword_objects }; $item{'keywords'} = \@keywords; } + if (filter_wants $params, 'last_change_time') { + $item{'last_change_time'} = $self->type('dateTime', $bug->delta_ts); + } if (filter_wants $params, 'product') { $item{product} = $self->type('string', $bug->product); } if (filter_wants $params, 'qa_contact') { my $qa_login = $bug->qa_contact ? $bug->qa_contact->login : ''; - $item{'qa_contact'} = $self->type('string', $qa_login); + $item{'qa_contact'} = $self->type('email', $qa_login); + if ($bug->qa_contact) { + $item{'qa_contact_detail'} = $self->_user_to_hash($bug->qa_contact, $params, undef, 'qa_contact'); + } } if (filter_wants $params, 'see_also') { my @see_also = map { $self->type('string', $_->name) } @@ -953,16 +1289,21 @@ sub _bug_to_hash { if (filter_wants $params, 'flags') { $item{'flags'} = [ map { $self->_flag_to_hash($_) } @{$bug->flags} ]; } + if (filter_wants $params, 'tags', 'extra') { + $item{'tags'} = $bug->tags; + } # And now custom fields my @custom_fields = Bugzilla->active_custom_fields; foreach my $field (@custom_fields) { my $name = $field->name; - next if !filter_wants $params, $name; + next if !filter_wants($params, $name, ['default', 'custom']); if ($field->type == FIELD_TYPE_BUG_ID) { $item{$name} = $self->type('int', $bug->$name); } - elsif ($field->type == FIELD_TYPE_DATETIME) { + elsif ($field->type == FIELD_TYPE_DATETIME + || $field->type == FIELD_TYPE_DATE) + { $item{$name} = $self->type('dateTime', $bug->$name); } elsif ($field->type == FIELD_TYPE_MULTI_SELECT) { @@ -976,34 +1317,42 @@ sub _bug_to_hash { # Timetracking fields are only sent if the user can see them. if (Bugzilla->user->is_timetracker) { - $item{'estimated_time'} = $self->type('double', $bug->estimated_time); - $item{'remaining_time'} = $self->type('double', $bug->remaining_time); - # No need to format $bug->deadline specially, because Bugzilla::Bug - # already does it for us. - $item{'deadline'} = $self->type('string', $bug->deadline); - + if (filter_wants $params, 'estimated_time') { + $item{'estimated_time'} = $self->type('double', $bug->estimated_time); + } + if (filter_wants $params, 'remaining_time') { + $item{'remaining_time'} = $self->type('double', $bug->remaining_time); + } if (filter_wants $params, 'actual_time') { $item{'actual_time'} = $self->type('double', $bug->actual_time); } } - if (Bugzilla->user->id) { - my $token = issue_hash_token([$bug->id, $bug->delta_ts]); - $item{'update_token'} = $self->type('string', $token); - } - # The "accessible" bits go here because they have long names and it # makes the code look nicer to separate them out. - $item{'is_cc_accessible'} = $self->type('boolean', - $bug->cclist_accessible); - $item{'is_creator_accessible'} = $self->type('boolean', - $bug->reporter_accessible); + if (filter_wants $params, 'is_cc_accessible') { + $item{'is_cc_accessible'} = $self->type('boolean', $bug->cclist_accessible); + } + if (filter_wants $params, 'is_creator_accessible') { + $item{'is_creator_accessible'} = $self->type('boolean', $bug->reporter_accessible); + } + + return \%item; +} - return filter $params, \%item; +sub _user_to_hash { + my ($self, $user, $filters, $types, $prefix) = @_; + my $item = filter $filters, { + id => $self->type('int', $user->id), + real_name => $self->type('string', $user->name), + name => $self->type('email', $user->login), + email => $self->type('email', $user->email), + }, $types, $prefix; + return $item; } sub _attachment_to_hash { - my ($self, $attach, $filters) = @_; + my ($self, $attach, $filters, $types, $prefix) = @_; my $item = filter $filters, { creation_time => $self->type('dateTime', $attach->attached), @@ -1012,30 +1361,27 @@ sub _attachment_to_hash { bug_id => $self->type('int', $attach->bug_id), file_name => $self->type('string', $attach->filename), summary => $self->type('string', $attach->description), - description => $self->type('string', $attach->description), content_type => $self->type('string', $attach->contenttype), is_private => $self->type('int', $attach->isprivate), is_obsolete => $self->type('int', $attach->isobsolete), is_patch => $self->type('int', $attach->ispatch), - }; + }, $types, $prefix; - # creator/attacher require an extra lookup, so we only send them if + # creator requires an extra lookup, so we only send them if # the filter wants them. - foreach my $field (qw(creator attacher)) { - if (filter_wants $filters, $field) { - $item->{$field} = $self->type('string', $attach->attacher->login); - } + if (filter_wants $filters, 'creator', $types, $prefix) { + $item->{'creator'} = $self->type('email', $attach->attacher->login); } - if (filter_wants $filters, 'data') { + if (filter_wants $filters, 'data', $types, $prefix) { $item->{'data'} = $self->type('base64', $attach->data); } - if (filter_wants $filters, 'size') { + if (filter_wants $filters, 'size', $types, $prefix) { $item->{'size'} = $self->type('int', $attach->datasize); } - if (filter_wants $filters, 'flags') { + if (filter_wants $filters, 'flags', $types, $prefix) { $item->{'flags'} = [ map { $self->_flag_to_hash($_) } @{$attach->flags} ]; } @@ -1056,13 +1402,25 @@ sub _flag_to_hash { foreach my $field (qw(setter requestee)) { my $field_id = $field . "_id"; - $item->{$field} = $self->type('string', $flag->$field->login) + $item->{$field} = $self->type('email', $flag->$field->login) if $flag->$field_id; } return $item; } +sub _add_update_tokens { + my ($self, $params, $bugs, $hashes) = @_; + + return if !Bugzilla->user->id; + return if !filter_wants($params, 'update_token'); + + for(my $i = 0; $i < @$bugs; $i++) { + my $token = issue_hash_token([$bugs->[$i]->id, $bugs->[$i]->delta_ts]); + $hashes->[$i]->{'update_token'} = $self->type('string', $token); + } +} + 1; __END__ @@ -1082,6 +1440,10 @@ or get information about bugs that have already been filed. See L<Bugzilla::WebService> for a description of how parameters are passed, and what B<STABLE>, B<UNSTABLE>, and B<EXPERIMENTAL> mean. +Although the data input and output is the same for JSONRPC, XMLRPC and REST, +the directions for how to access the data via REST is noted in each method +where applicable. + =head1 Utility Functions =head2 fields @@ -1095,11 +1457,26 @@ B<UNSTABLE> Get information about valid bug fields, including the lists of legal values for each field. +=item B<REST> + +You have several options for retreiving information about fields. The first +part is the request method and the rest is the related path needed. + +To get information about all fields: + +GET /rest/field/bug + +To get information related to a single field: + +GET /rest/field/bug/<id_or_name> + +The returned data format is the same as below. + =item B<Params> You can pass either field ids or field names. -B<Note>: If neither C<ids> nor C<names> is specified, then all +B<Note>: If neither C<ids> nor C<names> is specified, then all non-obsolete fields will be returned. In addition to the parameters below, this method also accepts the @@ -1147,6 +1524,12 @@ C<int> The number of the fieldtype. The following values are defined: =item C<7> Bug URLs ("See Also") +=item C<8> Keywords + +=item C<9> Date + +=item C<10> Integer value + =back =item C<is_custom> @@ -1295,10 +1678,11 @@ You specified an invalid field name or id. =item C<is_active> return key for C<values> was added in Bugzilla B<4.4>. -=back +=item REST API call added in Bugzilla B<5.0> =back +=back =head2 legal_values @@ -1310,6 +1694,18 @@ B<DEPRECATED> - Use L</fields> instead. Tells you what values are allowed for a particular field. +=item B<REST> + +To get information on the values for a field based on field name: + +GET /rest/field/bug/<field_name>/values + +To get information based on field name and a specific product: + +GET /rest/field/bug/<field_name>/<product_id>/values + +The returned data format is the same as below. + =item B<Params> =over @@ -1342,6 +1738,14 @@ You specified a field that doesn't exist or isn't a drop-down field. =back +=item B<History> + +=over + +=item REST API call added in Bugzilla B<5.0>. + +=back + =back =head1 Bug Information @@ -1360,6 +1764,18 @@ and/or attachment ids. B<Note>: Private attachments will only be returned if you are in the insidergroup or if you are the submitter of the attachment. +=item B<REST> + +To get all current attachments for a bug: + +GET /rest/bug/<bug_id>/attachment + +To get a specific attachment based on attachment ID: + +GET /rest/bug/attachment/<attachment_id> + +The returned data format is the same as below. + =item B<Params> B<Note>: At least one of C<ids> or C<attachment_ids> is required. @@ -1448,10 +1864,6 @@ C<string> The file name of the attachment. C<string> A short string describing the attachment. -Also returned as C<description>, for backwards-compatibility with older -Bugzillas. (However, this backwards-compatibility will go away in Bugzilla -5.0.) - =item C<content_type> C<string> The MIME type of the attachment. @@ -1473,10 +1885,6 @@ C<boolean> True if the attachment is a patch, False otherwise. C<string> The login name of the user that created the attachment. -Also returned as C<attacher>, for backwards-compatibility with older -Bugzillas. (However, this backwards-compatibility will go away in Bugzilla -5.0.) - =item C<flags> An array of hashes containing the information about flags currently set @@ -1557,6 +1965,8 @@ C<summary>. =item The C<flags> array was added in Bugzilla B<4.4>. +=item REST API call added in Bugzilla B<5.0>. + =back =back @@ -1573,6 +1983,18 @@ B<STABLE> This allows you to get data about comments, given a list of bugs and/or comment ids. +=item B<REST> + +To get all comments for a particular bug using the bug ID or alias: + +GET /rest/bug/<id_or_alias>/comment + +To get a specific comment based on the comment ID: + +GET /rest/bug/comment/<comment_id> + +The returned data format is the same as below. + =item B<Params> B<Note>: At least one of C<ids> or C<comment_ids> is required. @@ -1660,10 +2082,6 @@ C<string> The actual text of the comment. C<string> The login name of the comment's author. -Also returned as C<author>, for backwards-compatibility with older -Bugzillas. (However, this backwards-compatibility will go away in Bugzilla -5.0.) - =item time C<dateTime> The time (in Bugzilla's timezone) that the comment was added. @@ -1718,6 +2136,8 @@ C<creator>. =item C<creation_time> was added in Bugzilla B<4.4>. +=item REST API call added in Bugzilla B<5.0>. + =back =back @@ -1733,7 +2153,13 @@ B<STABLE> Gets information about particular bugs in the database. -Note: Can also be called as "get_bugs" for compatibilty with Bugzilla 3.0 API. +=item B<REST> + +To get information about a particular bug using its ID or alias: + +GET /rest/bug/<id_or_alias> + +The returned data format is the same as below. =item B<Params> @@ -1773,6 +2199,9 @@ Two items are returned: An array of hashes that contains information about the bugs with the valid ids. Each hash contains the following items: +These fields are returned by default or by specifying C<_default> +in C<include_fields>. + =over =item C<actual_time> @@ -1784,12 +2213,18 @@ in the return value. =item C<alias> -C<string> The unique alias of this bug. +C<array> of C<string>s The unique aliases of this bug. An empty array will be +returned if this bug has no aliases. =item C<assigned_to> C<string> The login name of the user to whom the bug is assigned. +=item C<assigned_to_detail> + +C<hash> A hash containing detailed user information for the assigned_to. To see the +keys included in the user detail hash, see below. + =item C<blocks> C<array> of C<int>s. The ids of bugs that are "blocked" by this bug. @@ -1799,6 +2234,11 @@ C<array> of C<int>s. The ids of bugs that are "blocked" by this bug. C<array> of C<string>s. The login names of users on the CC list of this bug. +=item C<cc_detail> + +C<array> of hashes containing detailed user information for each of the cc list +members. To see the keys included in the user detail hash, see below. + =item C<classification> C<string> The name of the current classification the bug is in. @@ -1815,14 +2255,16 @@ C<dateTime> When the bug was created. C<string> The login name of the person who filed this bug (the reporter). +=item C<creator_detail> + +C<hash> A hash containing detailed user information for the creator. To see the +keys included in the user detail hash, see below. + =item C<deadline> C<string> The day that this bug is due to be completed, in the format C<YYYY-MM-DD>. -If you are not in the time-tracking group, this field will not be included -in the return value. - =item C<depends_on> C<array> of C<int>s. The ids of bugs that this bug "depends on". @@ -1908,7 +2350,7 @@ C<boolean> True if this bug is open, false if it is closed. =item C<is_creator_accessible> C<boolean> If true, this bug can be accessed by the creator (reporter) -of the bug, even if he or she is not a member of the groups the bug +of the bug, even if they are not a member of the groups the bug is restricted to. =item C<keywords> @@ -1939,6 +2381,11 @@ C<string> The name of the product this bug is in. C<string> The login name of the current QA Contact on the bug. +=item C<qa_contact_detail> + +C<hash> A hash containing detailed user information for the qa_contact. To see the +keys included in the user detail hash, see below. + =item C<remaining_time> C<double> The number of hours of work remaining until work on this bug @@ -2002,7 +2449,11 @@ C<string> The value of the "status whiteboard" field on the bug. Every custom field in this installation will also be included in the return value. Most fields are returned as C<string>s. However, some -field types have different return values: +field types have different return values. + +Normally custom fields are returned by default similar to normal bug +fields or you can specify only custom fields by using C<_custom> in +C<include_fields>. =over @@ -2014,6 +2465,42 @@ field types have different return values: =back +=item I<user detail hashes> + +Each user detail hash contains the following items: + +=over + +=item C<id> + +C<int> The user id for this user. + +=item C<real_name> + +C<string> The 'real' name for this user, if any. + +=item C<name> + +C<string> The user's Bugzilla login. + +=item C<email> + +C<string> The user's email address. Currently this is the same value as the name. + +=back + +=back + +These fields are returned only by specifying "_extra" or the field name in "include_fields". + +=over + +=item C<tags> + +C<array> of C<string>s. Each array item is a tag name. + +Note that tags are personal to the currently logged in user. + =back =item C<faults> B<EXPERIMENTAL> @@ -2065,7 +2552,7 @@ You do not have access to the bug_id you specified. =over -=item C<permissive> argument added to this method's params in Bugzilla B<3.4>. +=item C<permissive> argument added to this method's params in Bugzilla B<3.4>. =item The following properties were added to this method's return values in Bugzilla B<3.4>: @@ -2113,6 +2600,10 @@ and all custom fields. =item The C<actual_time> item was added to the C<bugs> return value in Bugzilla B<4.4>. +=item REST API call added in Bugzilla B<5.0>. + +=item In Bugzilla B<5.0>, the following items were added to the bugs return value: C<assigned_to_detail>, C<creator_detail>, C<qa_contact_detail>. + =back =back @@ -2127,6 +2618,14 @@ B<EXPERIMENTAL> Gets the history of changes for particular bugs in the database. +=item B<REST> + +To get the history for a specific bug ID: + +GET /rest/bug/<bug_id>/history + +The returned data format will be the same as below. + =item B<Params> =over @@ -2138,7 +2637,12 @@ An array of numbers and strings. If an element in the array is entirely numeric, it represents a bug_id from the Bugzilla database to fetch. If it contains any non-numeric characters, it is considered to be a bug alias instead, and the data bug -with that alias will be loaded. +with that alias will be loaded. + +item C<new_since> + +C<dateTime> If specified, the method will only return changes I<newer> +than this time. =back @@ -2155,7 +2659,8 @@ C<int> The numeric id of the bug. =item alias -C<string> The alias of this bug. If there is no alias, this will be undef. +C<array> of C<string>s The unique aliases of this bug. An empty array will be +returned if this bug has no aliases. =item history @@ -2218,6 +2723,10 @@ The same as L</get>. consistent with other methods. Since Bugzilla B<4.4>, they now match names used by L<Bug.update|/"update"> for consistency. +=item REST API call added Bugzilla B<5.0>. + +=item Added C<new_since> parameter if Bugzilla B<5.0>. + =back =back @@ -2241,7 +2750,7 @@ narrowed down to specific products. =item C<summary> (string) B<Required> - A string of keywords defining the type of bug you are trying to report. -=item C<product> (array) - One or more product names to narrow the +=item C<products> (array) - One or more product names to narrow the duplicate search to. If omitted, all bugs are searched. =back @@ -2272,6 +2781,9 @@ search for duplicates. =item Added in Bugzilla B<4.0>. +=item The C<product> parameter has been renamed to C<products> in +Bugzilla B<5.0>. + =back =back @@ -2286,6 +2798,14 @@ B<UNSTABLE> Allows you to search for bugs based on particular criteria. +=item <REST> + +To search for bugs: + +GET /bug + +The URL parameters and the returned data format are the same as below. + =item B<Params> Unless otherwise specified in the description of a parameter, bugs are @@ -2306,15 +2826,25 @@ the "Foo" or "Bar" products, you'd pass: product => ['Foo', 'Bar'] Some Bugzillas may treat your arguments case-sensitively, depending -on what database system they are using. Most commonly, though, Bugzilla is -not case-sensitive with the arguments passed (because MySQL is the +on what database system they are using. Most commonly, though, Bugzilla is +not case-sensitive with the arguments passed (because MySQL is the most-common database to use with Bugzilla, and MySQL is not case sensitive). +In addition to the fields listed below, you may also use criteria that +is similar to what is used in the Advanced Search screen of the Bugzilla +UI. This includes fields specified by C<Search by Change History> and +C<Custom Search>. The easiest way to determine what the field names are and what +format Bugzilla expects, is to first construct your query using the +Advanced Search UI, execute it and use the query parameters in they URL +as your key/value pairs for the WebService call. With REST, you can +just reuse the query parameter portion in the REST call itself. + =over =item C<alias> -C<string> The unique alias for this bug. +C<array> of C<string>s The unique aliases of this bug. An empty array will be +returned if this bug has no aliases. =item C<assigned_to> @@ -2403,6 +2933,13 @@ on spaces. So searching for C<foo bar> will match "This is a foo bar" but not "This foo is a bar". C<['foo', 'bar']>, would, however, match the second item. +=item C<tags> + +C<string> Searches for a bug with the specified tag. If you specify an +array, then any bugs that match I<any> of the tags will be returned. + +Note that tags are personal to the currently logged in user. + =item C<target_milestone> C<string> The Target Milestone field of a bug. Note that even if this @@ -2432,6 +2969,10 @@ C<string> Search the "Status Whiteboard" field on bugs for a substring. Works the same as the C<summary> field described above, but searches the Status Whiteboard field. +=item C<quicksearch> + +C<string> Search for bugs using quicksearch syntax. + =back =item B<Returns> @@ -2471,6 +3012,13 @@ in Bugzilla B<4.0>. C<limit> is set equal to zero. Otherwise maximum results returned are limited by system configuration. +=item REST API call added in Bugzilla B<5.0>. + +=item Updated to allow for full search capability similar to the Bugzilla UI +in Bugzilla B<5.0>. + +=item Updated to allow quicksearch capability in Bugzilla B<5.0>. + =back =back @@ -2497,10 +3045,19 @@ The WebService interface may allow you to set things other than those listed here, but realize that anything undocumented is B<UNSTABLE> and will very likely change in the future. +=item B<REST> + +To create a new bug in Bugzilla: + +POST /rest/bug + +The params to include in the POST body as well as the returned data format, +are the same as below. + =item B<Params> Some params must be set, or an error will be thrown. These params are -marked B<Required>. +marked B<Required>. Some parameters can have defaults set in Bugzilla, by the administrator. If these parameters have defaults set, you can omit them. These parameters @@ -2544,7 +3101,7 @@ in by the developer, compared to the developer's other bugs. =item C<severity> (string) B<Defaulted> - How severe the bug is. -=item C<alias> (string) - A brief alias for the bug that can be used +=item C<alias> (array) - A brief alias for the bug that can be used instead of a bug number when accessing this bug. Must be unique in all of this Bugzilla. @@ -2579,6 +3136,32 @@ with L</update>. =item C<target_milestone> (string) - A valid target milestone for this product. +=item C<flags> + +C<array> An array of hashes with flags to add to the bug. To create a flag, +at least the status and the type_id or name must be provided. An optional +requestee can be passed if the flag type is requestable to a specific user. + +=over + +=item C<name> + +C<string> The name of the flag type. + +=item C<type_id> + +C<int> The internal flag type id. + +=item C<status> + +C<string> The flags new status (i.e. "?", "+", "-" or "X" to clear a flag). + +=item C<requestee> + +C<string> The login of the requestee if the flag type is requestable to a specific user. + +=back + =back In addition to the above parameters, if your installation has any custom @@ -2631,6 +3214,28 @@ that would cause a circular dependency between bugs. You tried to restrict the bug to a group which does not exist, or which you cannot use with this product. +=item 129 (Flag Status Invalid) + +The flag status is invalid. + +=item 130 (Flag Modification Denied) + +You tried to request, grant, or deny a flag but only a user with the required +permissions may make the change. + +=item 131 (Flag not Requestable from Specific Person) + +You can't ask a specific person for the flag. + +=item 133 (Flag Type not Unique) + +The flag type specified matches several flag types. You must specify +the type id value to update or add a flag. + +=item 134 (Inactive Flag Type) + +The flag type is inactive and cannot be used to create new flags. + =item 504 (Invalid User) Either the QA Contact, Assignee, or CC lists have some invalid user @@ -2661,6 +3266,8 @@ loop errors had a generic code of C<32000>. =item The ability to file new bugs with a C<resolution> was added in Bugzilla B<4.4>. +=item REST API call added in Bugzilla B<5.0>. + =back =back @@ -2676,6 +3283,16 @@ B<STABLE> This allows you to add an attachment to a bug in Bugzilla. +=item B<REST> + +To create attachment on a current bug: + +POST /rest/bug/<bug_id>/attachment + +The params to include in the POST body, as well as the returned +data format are the same as below. The C<ids> param will be +overridden as it it pulled from the URL path. + =item B<Params> =over @@ -2727,6 +3344,32 @@ to the "insidergroup"), False if the attachment should be public. Defaults to False if not specified. +=item C<flags> + +C<array> An array of hashes with flags to add to the attachment. to create a flag, +at least the status and the type_id or name must be provided. An optional requestee +can be passed if the flag type is requestable to a specific user. + +=over + +=item C<name> + +C<string> The name of the flag type. + +=item C<type_id> + +C<int> The internal flag type id. + +=item C<status> + +C<string> The flags new status (i.e. "?", "+", "-" or "X" to clear a flag). + +=item C<requestee> + +C<string> The login of the requestee if the flag type is requestable to a specific user. + +=back + =back =item B<Returns> @@ -2740,6 +3383,28 @@ This method can throw all the same errors as L</get>, plus: =over +=item 129 (Flag Status Invalid) + +The flag status is invalid. + +=item 130 (Flag Modification Denied) + +You tried to request, grant, or deny a flag but only a user with the required +permissions may make the change. + +=item 131 (Flag not Requestable from Specific Person) + +You can't ask a specific person for the flag. + +=item 133 (Flag Type not Unique) + +The flag type specified matches several flag types. You must specify +the type id value to update or add a flag. + +=item 134 (Inactive Flag Type) + +The flag type is inactive and cannot be used to create new flags. + =item 600 (Attachment Too Large) You tried to attach a file that was larger than Bugzilla will accept. @@ -2773,10 +3438,229 @@ You set the "data" field to an empty string. =item The return value has changed in Bugzilla B<4.4>. +=item REST API call added in Bugzilla B<5.0>. + +=back + +=back + + +=head2 update_attachment + +B<UNSTABLE> + +=over + +=item B<Description> + +This allows you to update attachment metadata in Bugzilla. + +=item B<REST> + +To update attachment metadata on a current attachment: + +PUT /rest/bug/attachment/<attach_id> + +The params to include in the POST body, as well as the returned +data format are the same as below. The C<ids> param will be +overridden as it it pulled from the URL path. + +=item B<Params> + +=over + +=item C<ids> + +B<Required> C<array> An array of integers -- the ids of the attachments you +want to update. + +=item C<file_name> + +C<string> The "file name" that will be displayed +in the UI for this attachment. + +=item C<summary> + +C<string> A short string describing the +attachment. + +=item C<comment> + +C<string> An optional comment to add to the attachment's bug. + +=item C<content_type> + +C<string> The MIME type of the attachment, like +C<text/plain> or C<image/png>. + +=item C<is_patch> + +C<boolean> True if Bugzilla should treat this attachment as a patch. +If you specify this, you do not need to specify a C<content_type>. +The C<content_type> of the attachment will be forced to C<text/plain>. + +=item C<is_private> + +C<boolean> True if the attachment should be private (restricted +to the "insidergroup"), False if the attachment should be public. + +=item C<is_obsolete> + +C<boolean> True if the attachment is obsolete, False otherwise. + +=item C<flags> + +C<array> An array of hashes with changes to the flags. The following values +can be specified. At least the status and one of type_id, id, or name must +be specified. If a type_id or name matches a single currently set flag, +the flag will be updated unless new is specified. + +=over + +=item C<name> + +C<string> The name of the flag that will be created or updated. + +=item C<type_id> + +C<int> The internal flag type id that will be created or updated. You will +need to specify the C<type_id> if more than one flag type of the same name exists. + +=item C<status> + +C<string> The flags new status (i.e. "?", "+", "-" or "X" to clear a flag). + +=item C<requestee> + +C<string> The login of the requestee if the flag type is requestable to a specific user. + +=item C<id> + +C<int> Use id to specify the flag to be updated. You will need to specify the C<id> +if more than one flag is set of the same name. + +=item C<new> + +C<boolean> Set to true if you specifically want a new flag to be created. + +=back + +=item B<Returns> + +A C<hash> with a single field, "attachments". This points to an array of hashes +with the following fields: + +=over + +=item C<id> + +C<int> The id of the attachment that was updated. + +=item C<last_change_time> + +C<dateTime> The exact time that this update was done at, for this attachment. +If no update was done (that is, no fields had their values changed and +no comment was added) then this will instead be the last time the attachment +was updated. + +=item C<changes> + +C<hash> The changes that were actually done on this bug. The keys are +the names of the fields that were changed, and the values are a hash +with two keys: + +=over + +=item C<added> (C<string>) The values that were added to this field. +possibly a comma-and-space-separated list if multiple values were added. + +=item C<removed> (C<string>) The values that were removed from this +field. + =back =back +Here's an example of what a return value might look like: + + { + attachments => [ + { + id => 123, + last_change_time => '2010-01-01T12:34:56', + changes => { + summary => { + removed => 'Sample ptach', + added => 'Sample patch' + }, + is_obsolete => { + removed => '0', + added => '1', + } + }, + } + ] + } + +=item B<Errors> + +This method can throw all the same errors as L</get>, plus: + +=over + +=item 129 (Flag Status Invalid) + +The flag status is invalid. + +=item 130 (Flag Modification Denied) + +You tried to request, grant, or deny a flag but only a user with the required +permissions may make the change. + +=item 131 (Flag not Requestable from Specific Person) + +You can't ask a specific person for the flag. + +=item 132 (Flag not Unique) + +The flag specified has been set multiple times. You must specify the id +value to update the flag. + +=item 133 (Flag Type not Unique) + +The flag type specified matches several flag types. You must specify +the type id value to update or add a flag. + +=item 134 (Inactive Flag Type) + +The flag type is inactive and cannot be used to create new flags. + +=item 601 (Invalid MIME Type) + +You specified a C<content_type> argument that was blank, not a valid +MIME type, or not a MIME type that Bugzilla accepts for attachments. + +=item 603 (File Name Not Specified) + +You did not specify a valid for the C<file_name> argument. + +=item 604 (Summary Required) + +You did not specify a value for the C<summary> argument. + +=back + +=item B<History> + +=over + +=item Added in Bugzilla B<5.0>. + +=back + +=back + +=back =head2 add_comment @@ -2788,6 +3672,15 @@ B<STABLE> This allows you to add a comment to a bug in Bugzilla. +=item B<REST> + +To create a comment on a current bug: + +POST /rest/bug/<bug_id>/comment + +The params to include in the POST body as well as the returned data format, +are the same as below. + =item B<Params> =over @@ -2863,6 +3756,8 @@ purposes if you wish. =item Before Bugzilla B<3.6>, error 54 and error 114 had a generic error code of 32000. +=item REST API call added in Bugzilla B<5.0>. + =back =back @@ -2879,6 +3774,16 @@ B<UNSTABLE> Allows you to update the fields of a bug. Automatically sends emails out about the changes. +=item B<REST> + +To update the fields of a current bug: + +PUT /rest/bug/<bug_id> + +The params to include in the PUT body as well as the returned data format, +are the same as below. The C<ids> param will be overridden as it is +pulled from the URL path. + =item B<Params> =over @@ -2897,9 +3802,29 @@ bugs you are updating. =item C<alias> -(string) The alias of the bug. You can only set this if you are modifying -a single bug. If there is more than one bug specified in C<ids>, passing in -a value for C<alias> will cause an error to be thrown. +C<hash> These specify the aliases of a bug that can be used instead of a bug +number when acessing this bug. To set these, you should pass a hash as the +value. The hash may contain the following fields: + +=over + +=item C<add> An array of C<string>s. Aliases to add to this field. + +=item C<remove> An array of C<string>s. Aliases to remove from this field. +If the aliases are not already in the field, they will be ignored. + +=item C<set> An array of C<string>s. An exact set of aliases to set this +field to, overriding the current value. If you specify C<set>, then C<add> +and C<remove> will be ignored. + +=back + +You can only set this if you are modifying a single bug. If there is more +than one bug specified in C<ids>, passing in a value for C<alias> will cause +an error to be thrown. + +For backwards compatibility, you can also specify a single string. This will +be treated as if you specified the set key above. =item C<assigned_to> @@ -2998,6 +3923,43 @@ duplicate bugs. C<double> The total estimate of time required to fix the bug, in hours. This is the I<total> estimate, not the amount of time remaining to fix it. +=item C<flags> + +C<array> An array of hashes with changes to the flags. The following values +can be specified. At least the status and one of type_id, id, or name must +be specified. If a type_id or name matches a single currently set flag, +the flag will be updated unless new is specified. + +=over + +=item C<name> + +C<string> The name of the flag that will be created or updated. + +=item C<type_id> + +C<int> The internal flag type id that will be created or updated. You will +need to specify the C<type_id> if more than one flag type of the same name exists. + +=item C<status> + +C<string> The flags new status (i.e. "?", "+", "-" or "X" to clear a flag). + +=item C<requestee> + +C<string> The login of the requestee if the flag type is requestable to a specific user. + +=item C<id> + +C<int> Use id to specify the flag to be updated. You will need to specify the C<id> +if more than one flag is set of the same name. + +=item C<new> + +C<boolean> Set to true if you specifically want a new flag to be created. + +=back + =item C<groups> C<hash> The groups a bug is in. To modify this field, pass a hash, which @@ -3075,7 +4037,7 @@ C<string> The full login name of the bug's QA Contact. =item C<is_creator_accessible> C<boolean> Whether or not the bug's reporter is allowed to access -the bug, even if he or she isn't in a group that can normally access +the bug, even if they aren't in a group that can normally access the bug. =item C<remaining_time> @@ -3181,7 +4143,8 @@ C<int> The id of the bug that was updated. =item C<alias> -C<string> The alias of the bug that was updated, if this bug has an alias. +C<array> of C<string>s The aliases of the bug that was updated, if this bug +has any alias. =item C<last_change_time> @@ -3215,7 +4178,7 @@ Here's an example of what a return value might look like: bugs => [ { id => 123, - alias => 'foo', + alias => [ 'foo' ], last_change_time => '2010-01-01T12:34:56', changes => { status => { @@ -3315,6 +4278,33 @@ field. You tried to change from one status to another, but the status workflow rules don't allow that change. +=item 129 (Flag Status Invalid) + +The flag status is invalid. + +=item 130 (Flag Modification Denied) + +You tried to request, grant, or deny a flag but only a user with the required +permissions may make the change. + +=item 131 (Flag not Requestable from Specific Person) + +You can't ask a specific person for the flag. + +=item 132 (Flag not Unique) + +The flag specified has been set multiple times. You must specify the id +value to update the flag. + +=item 133 (Flag Type not Unique) + +The flag type specified matches several flag types. You must specify +the type id value to update or add a flag. + +=item 134 (Inactive Flag Type) + +The flag type is inactive and cannot be used to create new flags. + =back =item B<History> @@ -3323,6 +4313,8 @@ rules don't allow that change. =item Added in Bugzilla B<4.0>. +=item REST API call added Bugzilla B<5.0>. + =back =back @@ -3503,3 +4495,176 @@ This method can throw the same errors as L</get>. =back =back + +=head2 search_comment_tags + +B<UNSTABLE> + +=over + +=item B<Description> + +Searches for tags which contain the provided substring. + +=item B<REST> + +To search for comment tags: + +GET /rest/bug/comment/tags/<query> + +=item B<Params> + +=over + +=item C<query> + +B<Required> C<string> Only tags containg this substring will be returned. + +=item C<limit> + +C<int> If provided will return no more than C<limit> tags. Defaults to C<10>. + +=back + +=item B<Returns> + +An C<array of strings> of matching tags. + +=item B<Errors> + +This method can throw all of the errors that L</get> throws, plus: + +=over + +=item 125 (Comment Tagging Disabled) + +Comment tagging support is not available or enabled. + +=back + +=item B<History> + +=over + +=item Added in Bugzilla B<5.0>. + +=back + +=back + +=head2 update_comment_tags + +B<UNSTABLE> + +=over + +=item B<Description> + +Adds or removes tags from a comment. + +=item B<REST> + +To update the tags comments attached to a comment: + +PUT /rest/bug/comment/tags + +The params to include in the PUT body as well as the returned data format, +are the same as below. + +=item B<Params> + +=over + +=item C<comment_id> + +B<Required> C<int> The ID of the comment to update. + +=item C<add> + +C<array of strings> The tags to attach to the comment. + +=item C<remove> + +C<array of strings> The tags to detach from the comment. + +=back + +=item B<Returns> + +An C<array of strings> containing the comment's updated tags. + +=item B<Errors> + +This method can throw all of the errors that L</get> throws, plus: + +=over + +=item 125 (Comment Tagging Disabled) + +Comment tagging support is not available or enabled. + +=item 126 (Invalid Comment Tag) + +The comment tag provided was not valid (eg. contains invalid characters). + +=item 127 (Comment Tag Too Short) + +The comment tag provided is shorter than the minimum length. + +=item 128 (Comment Tag Too Long) + +The comment tag provided is longer than the maximum length. + +=back + +=item B<History> + +=over + +=item Added in Bugzilla B<5.0>. + +=back + +=back + +=head2 render_comment + +B<UNSTABLE> + +=over + +=item B<Description> + +Returns the HTML rendering of the provided comment text. + +=item B<Params> + +=over + +=item C<text> + +B<Required> C<strings> Text comment text to render. + +=item C<id> + +C<int> The ID of the bug to render the comment against. + +=back + +=item B<Returns> + +C<html> containing the HTML rendering. + +=item B<Errors> + +This method can throw all of the errors that L</get> throws. + +=item B<History> + +=over + +=item Added in Bugzilla B<5.0>. + +=back + +=back diff --git a/Bugzilla/WebService/BugUserLastVisit.pm b/Bugzilla/WebService/BugUserLastVisit.pm new file mode 100644 index 000000000..19a56ff46 --- /dev/null +++ b/Bugzilla/WebService/BugUserLastVisit.pm @@ -0,0 +1,207 @@ +# 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::WebService::BugUserLastVisit; + +use 5.10.1; +use strict; +use warnings; + +use parent qw(Bugzilla::WebService); + +use Bugzilla::Bug; +use Bugzilla::Error; +use Bugzilla::WebService::Util qw( validate filter ); +use Bugzilla::Constants; + +use constant PUBLIC_METHODS => qw( + get + update +); + +sub update { + my ($self, $params) = validate(@_, 'ids'); + my $user = Bugzilla->user; + my $dbh = Bugzilla->dbh; + + $user->login(LOGIN_REQUIRED); + + my $ids = $params->{ids} // []; + ThrowCodeError('param_required', { param => 'ids' }) unless @$ids; + + # Cache permissions for bugs. This highly reduces the number of calls to the + # DB. visible_bugs() is only able to handle bug IDs, so we have to skip + # aliases. + $user->visible_bugs([grep /^[0-9]$/, @$ids]); + + $dbh->bz_start_transaction(); + my @results; + my $last_visit_ts = $dbh->selectrow_array('SELECT NOW()'); + foreach my $bug_id (@$ids) { + my $bug = Bugzilla::Bug->check({ id => $bug_id, cache => 1 }); + + ThrowUserError('user_not_involved', { bug_id => $bug->id }) + unless $user->is_involved_in_bug($bug); + + $bug->update_user_last_visit($user, $last_visit_ts); + + push( + @results, + $self->_bug_user_last_visit_to_hash( + $bug, $last_visit_ts, $params + )); + } + $dbh->bz_commit_transaction(); + + return \@results; +} + +sub get { + my ($self, $params) = validate(@_, 'ids'); + my $user = Bugzilla->user; + my $ids = $params->{ids}; + + $user->login(LOGIN_REQUIRED); + + if ($ids) { + # Cache permissions for bugs. This highly reduces the number of calls to + # the DB. visible_bugs() is only able to handle bug IDs, so we have to + # skip aliases. + $user->visible_bugs([grep /^[0-9]$/, @$ids]); + } + + my @last_visits = @{ $user->last_visited }; + + if ($ids) { + # remove bugs that we are not interested in if ids is passed in. + my %id_set = map { ($_ => 1) } @$ids; + @last_visits = grep { $id_set{ $_->bug_id } } @last_visits; + } + + return [ + map { + $self->_bug_user_last_visit_to_hash($_->bug_id, $_->last_visit_ts, + $params) + } @last_visits + ]; +} + +sub _bug_user_last_visit_to_hash { + my ($self, $bug_id, $last_visit_ts, $params) = @_; + + my %result = (id => $self->type('int', $bug_id), + last_visit_ts => $self->type('dateTime', $last_visit_ts)); + + return filter($params, \%result); +} + +1; + +__END__ +=head1 NAME + +Bugzilla::WebService::BugUserLastVisit - Find and Store the last time a user +visited a bug. + +=head1 METHODS + +See L<Bugzilla::WebService> for a description of how parameters are passed, +and what B<STABLE>, B<UNSTABLE>, and B<EXPERIMENTAL> mean. + +Although the data input and output is the same for JSONRPC, XMLRPC and REST, +the directions for how to access the data via REST is noted in each method +where applicable. + +=head2 update + +B<EXPERIMENTAL> + +=over + +=item B<Description> + +Update the last visit time for the specified bug and current user. + +=item B<REST> + +To add a single bug id: + + POST /rest/bug_user_last_visit/<bug-id> + +Tp add one or more bug ids at once: + + POST /rest/bug_user_last_visit + +The returned data format is the same as below. + +=item B<Params> + +=over + +=item C<ids> (array) - One or more bug ids to add. + +=back + +=item B<Returns> + +=over + +=item C<array> - An array of hashes containing the following: + +=over + +=item C<id> - (int) The bug id. + +=item C<last_visit_ts> - (string) The timestamp the user last visited the bug. + +=back + +=back + +=back + +=head2 get + +B<EXPERIMENTAL> + +=over + +=item B<Description> + +Get the last visited timestamp for one or more specified bug ids. + +=item B<REST> + +To return the last visited timestamp for a single bug id: + + GET /rest/bug_user_last_visit/<bug-id> + +=item B<Params> + +=over + +=item C<ids> (integer) - One or more optional bug ids to get. + +=back + +=item B<Returns> + +=over + +=item C<array> - An array of hashes containing the following: + +=over + +=item C<id> - (int) The bug id. + +=item C<last_visit_ts> - (string) The timestamp the user last visited the bug. + +=back + +=back + +=back diff --git a/Bugzilla/WebService/Bugzilla.pm b/Bugzilla/WebService/Bugzilla.pm index a6037e67e..848cffd30 100644 --- a/Bugzilla/WebService/Bugzilla.pm +++ b/Bugzilla/WebService/Bugzilla.pm @@ -7,8 +7,11 @@ package Bugzilla::WebService::Bugzilla; +use 5.10.1; use strict; -use base qw(Bugzilla::WebService); +use warnings; + +use parent qw(Bugzilla::WebService); use Bugzilla::Constants; use Bugzilla::Util qw(datetime_from); use Bugzilla::WebService::Util qw(validate filter_wants); @@ -128,12 +131,12 @@ sub time { sub last_audit_time { my ($self, $params) = validate(@_, 'class'); my $dbh = Bugzilla->dbh; - + my $sql_statement = "SELECT MAX(at_time) FROM audit_log"; my $class_values = $params->{class}; my @class_values_quoted; foreach my $class_value (@$class_values) { - push (@class_values_quoted, $dbh->quote($class_value)) + push (@class_values_quoted, $dbh->quote($class_value)) if $class_value =~ /^Bugzilla(::[a-zA-Z0-9_]+)*$/; } @@ -142,11 +145,11 @@ sub last_audit_time { } my $last_audit_time = $dbh->selectrow_array("$sql_statement"); - + # All Webservices return times in UTC; Use UTC here for backwards compat. # Hardcode values where appropriate $last_audit_time = datetime_from($last_audit_time, 'UTC'); - + return { last_audit_time => $self->type('dateTime', $last_audit_time) }; @@ -154,7 +157,7 @@ sub last_audit_time { sub parameters { my ($self, $args) = @_; - my $user = Bugzilla->login(); + my $user = Bugzilla->login(LOGIN_OPTIONAL); my $params = Bugzilla->params; $args ||= {}; @@ -188,6 +191,10 @@ This provides functions that tell you about Bugzilla in general. See L<Bugzilla::WebService> for a description of how parameters are passed, and what B<STABLE>, B<UNSTABLE>, and B<EXPERIMENTAL> mean. +Although the data input and output is the same for JSONRPC, XMLRPC and REST, +the directions for how to access the data via REST is noted in each method +where applicable. + =head2 version B<STABLE> @@ -198,6 +205,12 @@ B<STABLE> Returns the current version of Bugzilla. +=item B<REST> + +GET /rest/version + +The returned data format is the same as below. + =item B<Params> (none) =item B<Returns> @@ -207,6 +220,14 @@ string. =item B<Errors> (none) +=item B<History> + +=over + +=item REST API call added in Bugzilla B<5.0>. + +=back + =back =head2 extensions @@ -220,6 +241,12 @@ B<EXPERIMENTAL> Gets information about the extensions that are currently installed and enabled in this Bugzilla. +=item B<REST> + +GET /rest/extensions + +The returned data format is the same as below. + =item B<Params> (none) =item B<Returns> @@ -250,6 +277,8 @@ The return value looks something like this: that the extensions define themselves. Before 3.6, the names of the extensions depended on the directory they were in on the Bugzilla server. +=item REST API call added in Bugzilla B<5.0>. + =back =back @@ -265,6 +294,12 @@ Use L</time> instead. Returns the timezone that Bugzilla expects dates and times in. +=item B<REST> + +GET /rest/timezone + +The returned data format is the same as below. + =item B<Params> (none) =item B<Returns> @@ -279,6 +314,8 @@ string in (+/-)XXXX (RFC 2822) format. =item As of Bugzilla B<3.6>, the timezone returned is always C<+0000> (the UTC timezone). +=item REST API call added in Bugzilla B<5.0>. + =back =back @@ -295,6 +332,12 @@ B<STABLE> Gets information about what time the Bugzilla server thinks it is, and what timezone it's running in. +=item B<REST> + +GET /rest/time + +The returned data format is the same as below. + =item B<Params> (none) =item B<Returns> @@ -305,7 +348,7 @@ A struct with the following items: =item C<db_time> -C<dateTime> The current time in UTC, according to the Bugzilla +C<dateTime> The current time in UTC, according to the Bugzilla I<database server>. Note that Bugzilla assumes that the database and the webserver are running @@ -315,7 +358,7 @@ rely on for doing searches and other input to the WebService. =item C<web_time> -C<dateTime> This is the current time in UTC, according to Bugzilla's +C<dateTime> This is the current time in UTC, according to Bugzilla's I<web server>. This might be different by a second from C<db_time> since this comes from @@ -331,7 +374,7 @@ versions of Bugzilla before 3.6.) =item C<tz_name> C<string> The literal string C<UTC>. (Exists only for backwards-compatibility -with versions of Bugzilla before 3.6.) +with versions of Bugzilla before 3.6.) =item C<tz_short_name> @@ -355,6 +398,8 @@ with versions of Bugzilla before 3.6.) were in the UTC timezone, instead of returning information in the server's local timezone. +=item REST API call added in Bugzilla B<5.0>. + =back =back @@ -369,6 +414,12 @@ B<UNSTABLE> Returns parameter values currently used in this Bugzilla. +=item B<REST> + +GET /rest/parameters + +The returned data format is the same as below. + =item B<Params> (none) =item B<Returns> @@ -426,6 +477,8 @@ never be stable. =item Added in Bugzilla B<4.4>. +=item REST API call added in Bugzilla B<5.0>. + =back =back @@ -440,9 +493,15 @@ B<EXPERIMENTAL> Gets the latest time of the audit_log table. +=item B<REST> + +GET /rest/last_audit_time + +The returned data format is the same as below. + =item B<Params> -You can pass the optional parameter C<class> to get the maximum for only +You can pass the optional parameter C<class> to get the maximum for only the listed classes. =over @@ -467,6 +526,8 @@ at_time from the audit_log. =item Added in Bugzilla B<4.4>. +=item REST API call added in Bugzilla B<5.0>. + =back =back diff --git a/Bugzilla/WebService/Classification.pm b/Bugzilla/WebService/Classification.pm index f2c3ec51e..cee597b68 100644 --- a/Bugzilla/WebService/Classification.pm +++ b/Bugzilla/WebService/Classification.pm @@ -7,9 +7,11 @@ package Bugzilla::WebService::Classification; +use 5.10.1; use strict; +use warnings; -use base qw (Bugzilla::WebService); +use parent qw (Bugzilla::WebService); use Bugzilla::Classification; use Bugzilla::Error; @@ -44,39 +46,37 @@ sub get { @classification_objs = grep { $selectable_class{$_->id} } @classification_objs; } - my @classifications = map { filter($params, $self->_classification_to_hash($_)) } @classification_objs; + my @classifications = map { $self->_classification_to_hash($_, $params) } @classification_objs; return { classifications => \@classifications }; } sub _classification_to_hash { - my ($self, $classification) = @_; + my ($self, $classification, $params) = @_; my $user = Bugzilla->user; return unless (Bugzilla->params->{'useclassification'} || $user->in_group('editclassifications')); my $products = $user->in_group('editclassifications') ? $classification->products : $user->get_selectable_products($classification->id); - my %hash = ( + + return filter $params, { id => $self->type('int', $classification->id), name => $self->type('string', $classification->name), description => $self->type('string', $classification->description), sort_key => $self->type('int', $classification->sortkey), - products => [ map { $self->_product_to_hash($_) } @$products ], - ); - - return \%hash; + products => [ map { $self->_product_to_hash($_, $params) } @$products ], + }; } sub _product_to_hash { - my ($self, $product) = @_; - my %hash = ( + my ($self, $product, $params) = @_; + + return filter $params, { id => $self->type('int', $product->id), name => $self->type('string', $product->name), description => $self->type('string', $product->description), - ); - - return \%hash; + }, undef, 'products'; } 1; @@ -89,7 +89,7 @@ Bugzilla::Webservice::Classification - The Classification API =head1 DESCRIPTION -This part of the Bugzilla API allows you to deal with the available Classifications. +This part of the Bugzilla API allows you to deal with the available Classifications. You will be able to get information about them as well as manipulate them. =head1 METHODS @@ -97,6 +97,10 @@ You will be able to get information about them as well as manipulate them. See L<Bugzilla::WebService> for a description of how parameters are passed, and what B<STABLE>, B<UNSTABLE>, and B<EXPERIMENTAL> mean. +Although the data input and output is the same for JSONRPC, XMLRPC and REST, +the directions for how to access the data via REST is noted in each method +where applicable. + =head1 Classification Retrieval =head2 get @@ -109,13 +113,21 @@ B<EXPERIMENTAL> Returns a hash containing information about a set of classifications. +=item B<REST> + +To return information on a single classification: + +GET /rest/classification/<classification_id_or_name> + +The returned data format will be the same as below. + =item B<Params> In addition to the parameters below, this method also accepts the standard L<include_fields|Bugzilla::WebService/include_fields> and L<exclude_fields|Bugzilla::WebService/exclude_fields> arguments. -You could get classifications info by supplying their names and/or ids. +You could get classifications info by supplying their names and/or ids. So, this method accepts the following parameters: =over @@ -130,10 +142,10 @@ An array of classification names. =back -=item B<Returns> +=item B<Returns> A hash with the key C<classifications> and an array of hashes as the corresponding value. -Each element of the array represents a classification that the user is authorized to see +Each element of the array represents a classification that the user is authorized to see and has the following keys: =over @@ -193,6 +205,8 @@ Classification is not enabled on this installation. =item Added in Bugzilla B<4.4>. +=item REST API call added in Bugzilla B<5.0>. + =back =back diff --git a/Bugzilla/WebService/Component.pm b/Bugzilla/WebService/Component.pm new file mode 100644 index 000000000..4d6723d8b --- /dev/null +++ b/Bugzilla/WebService/Component.pm @@ -0,0 +1,153 @@ +# 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::WebService::Component; + +use 5.10.1; +use strict; +use warnings; + +use base qw(Bugzilla::WebService); + +use Bugzilla::Component; +use Bugzilla::Constants; +use Bugzilla::Error; +use Bugzilla::WebService::Constants; +use Bugzilla::WebService::Util qw(translate params_to_objects validate); + +use constant PUBLIC_METHODS => qw( + create +); + +use constant MAPPED_FIELDS => { + default_assignee => 'initialowner', + default_qa_contact => 'initialqacontact', + default_cc => 'initial_cc', + is_open => 'isactive', +}; + +sub create { + my ($self, $params) = @_; + + my $user = Bugzilla->login(LOGIN_REQUIRED); + + $user->in_group('editcomponents') + || scalar @{ $user->get_products_by_permission('editcomponents') } + || ThrowUserError('auth_failure', { group => 'editcomponents', + action => 'edit', + object => 'components' }); + + my $product = $user->check_can_admin_product($params->{product}); + + # Translate the fields + my $values = translate($params, MAPPED_FIELDS); + $values->{product} = $product; + + # Create the component and return the newly created id. + my $component = Bugzilla::Component->create($values); + return { id => $self->type('int', $component->id) }; +} + +1; + +__END__ + +=head1 NAME + +Bugzilla::Webservice::Component - The Component API + +=head1 DESCRIPTION + +This part of the Bugzilla API allows you to deal with the available product components. +You will be able to get information about them as well as manipulate them. + +=head1 METHODS + +See L<Bugzilla::WebService> for a description of how parameters are passed, +and what B<STABLE>, B<UNSTABLE>, and B<EXPERIMENTAL> mean. + +=head1 Component Creation and Modification + +=head2 create + +B<EXPERIMENTAL> + +=over + +=item B<Description> + +This allows you to create a new component in Bugzilla. + +=item B<Params> + +Some params must be set, or an error will be thrown. These params are +marked B<Required>. + +=over + +=item C<name> + +B<Required> C<string> The name of the new component. + +=item C<product> + +B<Required> C<string> The name of the product that the component must be +added to. This product must already exist, and the user have the necessary +permissions to edit components for it. + +=item C<description> + +B<Required> C<string> The description of the new component. + +=item C<default_assignee> + +B<Required> C<string> The login name of the default assignee of the component. + +=item C<default_cc> + +C<array> An array of strings with each element representing one login name of the default CC list. + +=item C<default_qa_contact> + +C<string> The login name of the default QA contact for the component. + +=item C<is_open> + +C<boolean> 1 if you want to enable the component for bug creations. 0 otherwise. Default is 1. + +=back + +=item B<Returns> + +A hash with one key: C<id>. This will represent the ID of the newly-added +component. + +=item B<Errors> + +=over + +=item 304 (Authorization Failure) + +You are not authorized to create a new component. + +=item 1200 (Component already exists) + +The name that you specified for the new component already exists in the +specified product. + +=back + +=item B<History> + +=over + +=item Added in Bugzilla B<5.0>. + +=back + +=back + diff --git a/Bugzilla/WebService/Constants.pm b/Bugzilla/WebService/Constants.pm index f289caef4..0bdd3517e 100644 --- a/Bugzilla/WebService/Constants.pm +++ b/Bugzilla/WebService/Constants.pm @@ -7,14 +7,30 @@ package Bugzilla::WebService::Constants; +use 5.10.1; use strict; -use base qw(Exporter); +use warnings; + +use parent qw(Exporter); our @EXPORT = qw( WS_ERROR_CODE + + STATUS_OK + STATUS_CREATED + STATUS_ACCEPTED + STATUS_NO_CONTENT + STATUS_MULTIPLE_CHOICES + STATUS_BAD_REQUEST + STATUS_NOT_FOUND + STATUS_GONE + REST_STATUS_CODE_MAP + ERROR_UNKNOWN_FATAL ERROR_UNKNOWN_TRANSIENT + XMLRPC_CONTENT_TYPE_WHITELIST + REST_CONTENT_TYPE_WHITELIST WS_DISPATCH ); @@ -66,8 +82,9 @@ use constant WS_ERROR_CODE => { illegal_field => 104, freetext_too_long => 104, # Component errors - require_component => 105, - component_name_too_long => 105, + require_component => 105, + component_name_too_long => 105, + product_unknown_component => 105, # Invalid Product no_products => 106, entry_access_denied => 106, @@ -83,7 +100,12 @@ use constant WS_ERROR_CODE => { comment_is_private => 110, comment_id_invalid => 111, comment_too_long => 114, - comment_invalid_isprivate => 117, + comment_invalid_isprivate => 117, + # Comment tagging + comment_tag_disabled => 125, + comment_tag_invalid => 126, + comment_tag_too_long => 127, + comment_tag_too_short => 128, # See Also errors bug_url_invalid => 112, bug_url_too_long => 112, @@ -106,14 +128,25 @@ use constant WS_ERROR_CODE => { missing_resolution => 121, resolution_not_allowed => 122, illegal_bug_status_transition => 123, + # Flag errors + flag_status_invalid => 129, + flag_update_denied => 130, + flag_type_requestee_disabled => 131, + flag_not_unique => 132, + flag_type_not_unique => 133, + flag_type_inactive => 134, # Authentication errors are usually 300-400. - invalid_username_or_password => 300, + invalid_login_or_password => 300, account_disabled => 301, auth_invalid_email => 302, extern_id_conflict => -303, auth_failure => 304, - password_current_too_short => 305, + password_too_short => 305, + password_not_complex => 305, + api_key_not_valid => 306, + api_key_revoked => 306, + auth_invalid_token => 307, # Except, historically, AUTH_NODATA, which is 410. login_required => 410, @@ -157,6 +190,7 @@ use constant WS_ERROR_CODE => { empty_group_description => 802, invalid_regexp => 803, invalid_group_name => 804, + group_cannot_view => 805, # Classification errors are 900-1000 auth_classification_not_enabled => 900, @@ -164,14 +198,73 @@ use constant WS_ERROR_CODE => { # Search errors are 1000-1100 buglist_parameters_required => 1000, + # Flag type errors are 1100-1200 + flag_type_name_invalid => 1101, + flag_type_description_invalid => 1102, + flag_type_cc_list_invalid => 1103, + flag_type_sortkey_invalid => 1104, + flag_type_not_editable => 1105, + + # Component errors are 1200-1300 + component_already_exists => 1200, + component_is_last => 1201, + component_has_bugs => 1202, + # Errors thrown by the WebService itself. The ones that are negative # conform to http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php xmlrpc_invalid_value => -32600, unknown_method => -32601, json_rpc_post_only => 32610, json_rpc_invalid_callback => 32611, - xmlrpc_illegal_content_type => 32612, - json_rpc_illegal_content_type => 32613, + xmlrpc_illegal_content_type => 32612, + json_rpc_illegal_content_type => 32613, + rest_invalid_resource => 32614, +}; + +# RESTful webservices use the http status code +# to describe whether a call was successful or +# to describe the type of error that occurred. +use constant STATUS_OK => 200; +use constant STATUS_CREATED => 201; +use constant STATUS_ACCEPTED => 202; +use constant STATUS_NO_CONTENT => 204; +use constant STATUS_MULTIPLE_CHOICES => 300; +use constant STATUS_BAD_REQUEST => 400; +use constant STATUS_NOT_AUTHORIZED => 401; +use constant STATUS_NOT_FOUND => 404; +use constant STATUS_GONE => 410; + +# The integer value is the error code above returned by +# the related webvservice call. We choose the appropriate +# http status code based on the error code or use the +# default STATUS_BAD_REQUEST. +sub REST_STATUS_CODE_MAP { + my $status_code_map = { + 51 => STATUS_NOT_FOUND, + 101 => STATUS_NOT_FOUND, + 102 => STATUS_NOT_AUTHORIZED, + 106 => STATUS_NOT_AUTHORIZED, + 109 => STATUS_NOT_AUTHORIZED, + 110 => STATUS_NOT_AUTHORIZED, + 113 => STATUS_NOT_AUTHORIZED, + 115 => STATUS_NOT_AUTHORIZED, + 120 => STATUS_NOT_AUTHORIZED, + 300 => STATUS_NOT_AUTHORIZED, + 301 => STATUS_NOT_AUTHORIZED, + 302 => STATUS_NOT_AUTHORIZED, + 303 => STATUS_NOT_AUTHORIZED, + 304 => STATUS_NOT_AUTHORIZED, + 410 => STATUS_NOT_AUTHORIZED, + 504 => STATUS_NOT_AUTHORIZED, + 505 => STATUS_NOT_AUTHORIZED, + 32614 => STATUS_NOT_FOUND, + _default => STATUS_BAD_REQUEST + }; + + Bugzilla::Hook::process('webservice_status_code_map', + { status_code_map => $status_code_map }); + + return $status_code_map; }; # These are the fallback defaults for errors not in ERROR_CODE. @@ -185,6 +278,14 @@ use constant XMLRPC_CONTENT_TYPE_WHITELIST => qw( application/xml ); +# The first content type specified is used as the default. +use constant REST_CONTENT_TYPE_WHITELIST => qw( + application/json + application/javascript + text/javascript + text/html +); + sub WS_DISPATCH { # We "require" here instead of "use" above to avoid a dependency loop. require Bugzilla::Hook; @@ -192,15 +293,28 @@ sub WS_DISPATCH { Bugzilla::Hook::process('webservice', { dispatch => \%hook_dispatch }); my $dispatch = { - 'Bugzilla' => 'Bugzilla::WebService::Bugzilla', - 'Bug' => 'Bugzilla::WebService::Bug', - 'Classification' => 'Bugzilla::WebService::Classification', - 'Group' => 'Bugzilla::WebService::Group', - 'Product' => 'Bugzilla::WebService::Product', - 'User' => 'Bugzilla::WebService::User', + 'Bugzilla' => 'Bugzilla::WebService::Bugzilla', + 'Bug' => 'Bugzilla::WebService::Bug', + 'Classification' => 'Bugzilla::WebService::Classification', + 'Component' => 'Bugzilla::WebService::Component', + 'FlagType' => 'Bugzilla::WebService::FlagType', + 'Group' => 'Bugzilla::WebService::Group', + 'Product' => 'Bugzilla::WebService::Product', + 'User' => 'Bugzilla::WebService::User', + 'BugUserLastVisit' => 'Bugzilla::WebService::BugUserLastVisit', %hook_dispatch }; return $dispatch; }; 1; + +=head1 B<Methods in need of POD> + +=over + +=item REST_STATUS_CODE_MAP + +=item WS_DISPATCH + +=back diff --git a/Bugzilla/WebService/FlagType.pm b/Bugzilla/WebService/FlagType.pm new file mode 100644 index 000000000..9723d4735 --- /dev/null +++ b/Bugzilla/WebService/FlagType.pm @@ -0,0 +1,834 @@ +# 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::WebService::FlagType; + +use 5.10.1; +use strict; +use warnings; + +use parent qw(Bugzilla::WebService); +use Bugzilla::Component; +use Bugzilla::Constants; +use Bugzilla::Error; +use Bugzilla::FlagType; +use Bugzilla::Product; +use Bugzilla::Util qw(trim); + +use List::MoreUtils qw(uniq); + +use constant PUBLIC_METHODS => qw( + create + get + update +); + +sub get { + my ($self, $params) = @_; + my $dbh = Bugzilla->switch_to_shadow_db(); + my $user = Bugzilla->user; + + defined $params->{product} + || ThrowCodeError('param_required', + { function => 'Bug.flag_types', + param => 'product' }); + + my $product = delete $params->{product}; + my $component = delete $params->{component}; + + $product = Bugzilla::Product->check({ name => $product, cache => 1 }); + $component = Bugzilla::Component->check( + { name => $component, product => $product, cache => 1 }) if $component; + + my $flag_params = { product_id => $product->id }; + $flag_params->{component_id} = $component->id if $component; + my $matched_flag_types = Bugzilla::FlagType::match($flag_params); + + my $flag_types = { bug => [], attachment => [] }; + foreach my $flag_type (@$matched_flag_types) { + push(@{ $flag_types->{bug} }, $self->_flagtype_to_hash($flag_type, $product)) + if $flag_type->target_type eq 'bug'; + push(@{ $flag_types->{attachment} }, $self->_flagtype_to_hash($flag_type, $product)) + if $flag_type->target_type eq 'attachment'; + } + + return $flag_types; +} + +sub create { + my ($self, $params) = @_; + + my $dbh = Bugzilla->dbh; + my $user = Bugzilla->user; + + Bugzilla->user->in_group('editcomponents') + || scalar(@{$user->get_products_by_permission('editcomponents')}) + || ThrowUserError("auth_failure", { group => "editcomponents", + action => "add", + object => "flagtypes" }); + + $params->{name} || ThrowCodeError('param_required', { param => 'name' }); + $params->{description} || ThrowCodeError('param_required', { param => 'description' }); + + my %args = ( + sortkey => 1, + name => undef, + inclusions => ['0:0'], # Default to __ALL__:__ALL__ + cc_list => '', + description => undef, + is_requestable => 'on', + exclusions => [], + is_multiplicable => 'on', + request_group => '', + is_active => 'on', + is_specifically_requestable => 'on', + target_type => 'bug', + grant_group => '', + ); + + foreach my $key (keys %args) { + $args{$key} = $params->{$key} if defined($params->{$key}); + } + + $args{name} = trim($params->{name}); + $args{description} = trim($params->{description}); + + # Is specifically requestable is actually is_requesteeable + if (exists $args{is_specifically_requestable}) { + $args{is_requesteeble} = delete $args{is_specifically_requestable}; + } + + # Default is on for the tickbox flags. + # If the user has set them to 'off' then undefine them so the flags are not ticked + foreach my $arg_name (qw(is_requestable is_multiplicable is_active is_requesteeble)) { + if (defined($args{$arg_name}) && ($args{$arg_name} eq '0')) { + $args{$arg_name} = undef; + } + } + + # Process group inclusions and exclusions + $args{inclusions} = _process_lists($params->{inclusions}) if defined $params->{inclusions}; + $args{exclusions} = _process_lists($params->{exclusions}) if defined $params->{exclusions}; + + my $flagtype = Bugzilla::FlagType->create(\%args); + + return { id => $self->type('int', $flagtype->id) }; +} + +sub update { + my ($self, $params) = @_; + + my $dbh = Bugzilla->dbh; + my $user = Bugzilla->user; + + Bugzilla->login(LOGIN_REQUIRED); + $user->in_group('editcomponents') + || scalar(@{$user->get_products_by_permission('editcomponents')}) + || ThrowUserError("auth_failure", { group => "editcomponents", + action => "edit", + object => "flagtypes" }); + + defined($params->{names}) || defined($params->{ids}) + || ThrowCodeError('params_required', + { function => 'FlagType.update', params => ['ids', 'names'] }); + + # Get the list of unique flag type ids we are updating + my @flag_type_ids = defined($params->{ids}) ? @{$params->{ids}} : (); + if (defined $params->{names}) { + push @flag_type_ids, map { $_->id } + @{ Bugzilla::FlagType::match({ name => $params->{names} }) }; + } + @flag_type_ids = uniq @flag_type_ids; + + # We delete names and ids to keep only new values to set. + delete $params->{names}; + delete $params->{ids}; + + # Process group inclusions and exclusions + # We removed them from $params because these are handled differently + my $inclusions = _process_lists(delete $params->{inclusions}) if defined $params->{inclusions}; + my $exclusions = _process_lists(delete $params->{exclusions}) if defined $params->{exclusions}; + + $dbh->bz_start_transaction(); + my %changes = (); + + foreach my $flag_type_id (@flag_type_ids) { + my ($flagtype, $can_fully_edit) = $user->check_can_admin_flagtype($flag_type_id); + + if ($can_fully_edit) { + $flagtype->set_all($params); + } + elsif (scalar keys %$params) { + ThrowUserError('flag_type_not_editable', { flagtype => $flagtype }); + } + + # Process the clusions + foreach my $type ('inclusions', 'exclusions') { + my $clusions = $type eq 'inclusions' ? $inclusions : $exclusions; + next if not defined $clusions; + + my @extra_clusions = (); + if (!$user->in_group('editcomponents')) { + my $products = $user->get_products_by_permission('editcomponents'); + # Bring back the products the user cannot edit. + foreach my $item (values %{$flagtype->$type}) { + my ($prod_id, $comp_id) = split(':', $item); + push(@extra_clusions, $item) unless grep { $_->id == $prod_id } @$products; + } + } + + $flagtype->set_clusions({ + $type => [@$clusions, @extra_clusions], + }); + } + + my $returned_changes = $flagtype->update(); + $changes{$flagtype->id} = { + name => $flagtype->name, + changes => $returned_changes, + }; + } + $dbh->bz_commit_transaction(); + + my @result; + foreach my $flag_type_id (keys %changes) { + my %hash = ( + id => $self->type('int', $flag_type_id), + name => $self->type('string', $changes{$flag_type_id}{name}), + changes => {}, + ); + + foreach my $field (keys %{ $changes{$flag_type_id}{changes} }) { + my $change = $changes{$flag_type_id}{changes}{$field}; + $hash{changes}{$field} = { + removed => $self->type('string', $change->[0]), + added => $self->type('string', $change->[1]) + }; + } + + push(@result, \%hash); + } + + return { flagtypes => \@result }; +} + +sub _flagtype_to_hash { + my ($self, $flagtype, $product) = @_; + my $user = Bugzilla->user; + + my @values = ('X'); + push(@values, '?') if ($flagtype->is_requestable && $user->can_request_flag($flagtype)); + push(@values, '+', '-') if $user->can_set_flag($flagtype); + + my $item = { + id => $self->type('int' , $flagtype->id), + name => $self->type('string' , $flagtype->name), + description => $self->type('string' , $flagtype->description), + type => $self->type('string' , $flagtype->target_type), + values => \@values, + is_active => $self->type('boolean', $flagtype->is_active), + is_requesteeble => $self->type('boolean', $flagtype->is_requesteeble), + is_multiplicable => $self->type('boolean', $flagtype->is_multiplicable) + }; + + if ($product) { + my $inclusions = $self->_flagtype_clusions_to_hash($flagtype->inclusions, $product->id); + my $exclusions = $self->_flagtype_clusions_to_hash($flagtype->exclusions, $product->id); + # if we have both inclusions and exclusions, the exclusions are redundant + $exclusions = [] if @$inclusions && @$exclusions; + # no need to return anything if there's just "any component" + $item->{inclusions} = $inclusions if @$inclusions && $inclusions->[0] ne ''; + $item->{exclusions} = $exclusions if @$exclusions && $exclusions->[0] ne ''; + } + + return $item; +} + +sub _flagtype_clusions_to_hash { + my ($self, $clusions, $product_id) = @_; + my $result = []; + foreach my $key (keys %$clusions) { + my ($prod_id, $comp_id) = split(/:/, $clusions->{$key}, 2); + if ($prod_id == 0 || $prod_id == $product_id) { + if ($comp_id) { + my $component = Bugzilla::Component->new({ id => $comp_id, cache => 1 }); + push @$result, $component->name; + } + else { + return [ '' ]; + } + } + } + return $result; +} + +sub _process_lists { + my $list = shift; + my $user = Bugzilla->user; + + my @products; + if ($user->in_group('editcomponents')) { + @products = Bugzilla::Product->get_all; + } + else { + @products = @{$user->get_products_by_permission('editcomponents')}; + } + + my @component_list; + + foreach my $item (@$list) { + # A hash with products as the key and component names as the values + if(ref($item) eq 'HASH') { + while (my ($product_name, $component_names) = each %$item) { + my $product = Bugzilla::Product->check({name => $product_name}); + unless (grep { $product->name eq $_->name } @products) { + ThrowUserError('product_access_denied', { name => $product_name }); + } + my @component_ids; + + foreach my $comp_name (@$component_names) { + my $component = Bugzilla::Component->check({product => $product, name => $comp_name}); + ThrowCodeError('param_invalid', { param => $comp_name}) unless defined $component; + push @component_list, $product->id . ':' . $component->id; + } + } + } + elsif(!ref($item)) { + # These are whole products + my $product = Bugzilla::Product->check({name => $item}); + unless (grep { $product->name eq $_->name } @products) { + ThrowUserError('product_access_denied', { name => $item }); + } + push @component_list, $product->id . ':0'; + } + else { + # The user has passed something invalid + ThrowCodeError('param_invalid', { param => $item }); + } + } + + return \@component_list; +} + +1; + +__END__ + +=head1 NAME + +Bugzilla::WebService::FlagType - API for creating flags. + +=head1 DESCRIPTION + +This part of the Bugzilla API allows you to create new flags + +=head1 METHODS + +See L<Bugzilla::WebService> for a description of what B<STABLE>, B<UNSTABLE>, +and B<EXPERIMENTAL> mean, and for more description about error codes. + +=head2 Get Flag Types + +=over + +=item C<get> B<UNSTABLE> + +=item B<Description> + +Get information about valid flag types that can be set for bugs and attachments. + +=item B<REST> + +You have several options for retreiving information about flag types. The first +part is the request method and the rest is the related path needed. + +To get information about all flag types for a product: + +GET /rest/flag_type/<product> + +To get information about flag_types for a product and component: + +GET /rest/flag_type/<product>/<component> + +The returned data format is the same as below. + +=item B<Params> + +You must pass a product name and an optional component name. + +=over + +=item C<product> (string) - The name of a valid product. + +=item C<component> (string) - An optional valid component name associated with the product. + +=back + +=item B<Returns> + +A hash containing two keys, C<bug> and C<attachment>. Each key value is an array of hashes, +containing the following keys: + +=over + +=item C<id> + +C<int> An integer id uniquely identifying this flag type. + +=item C<name> + +C<string> The name for the flag type. + +=item C<type> + +C<string> The target of the flag type which is either C<bug> or C<attachment>. + +=item C<description> + +C<string> The description of the flag type. + +=item C<values> + +C<array> An array of string values that the user can set on the flag type. + +=item C<is_requesteeble> + +C<boolean> Users can ask specific other users to set flags of this type. + +=item C<is_multiplicable> + +C<boolean> Multiple flags of this type can be set for the same bug or attachment. + +=back + +=item B<Errors> + +=over + +=item 106 (Product Access Denied) + +Either the product does not exist or you don't have access to it. + +=item 51 (Invalid Component) + +The component provided does not exist in the product. + +=back + +=item B<History> + +=over + +=item Added in Bugzilla B<5.0>. + +=back + +=back + +=head2 Create Flag + +=over + +=item C<create> B<UNSTABLE> + +=item B<Description> + +Creates a new FlagType + +=item B<REST> + +POST /rest/flag_type + +The params to include in the POST body as well as the returned data format, +are the same as below. + +=item B<Params> + +At a minimum the following two arguments must be supplied: + +=over + +=item C<name> (string) - The name of the new Flag Type. + +=item C<description> (string) - A description for the Flag Type object. + +=back + +=item B<Returns> + +C<int> flag_id + +The ID of the new FlagType object is returned. + +=item B<Params> + +=over + +=item name B<required> + +C<string> A short name identifying this type. + +=item description B<required> + +C<string> A comprehensive description of this type. + +=item inclusions B<optional> + +An array of strings or a hash containing product names, and optionally +component names. If you provide a string, the flag type will be shown on +all bugs in that product. If you provide a hash, the key represents the +product name, and the value is the components of the product to be included. + +For example: + + [ 'FooProduct', + { + BarProduct => [ 'C1', 'C3' ], + BazProduct => [ 'C7' ] + } + ] + +This flag will be added to B<All> components of I<FooProduct>, +components C1 and C3 of I<BarProduct>, and C7 of I<BazProduct>. + +=item exclusions B<optional> + +An array of strings or hashes containing product names. This uses the same +fromat as inclusions. + +This will exclude the flag from all products and components specified. + +=item sortkey B<optional> + +C<int> A number between 1 and 32767 by which this type will be sorted when +displayed to users in a list; ignore if you don't care what order the types +appear in or if you want them to appear in alphabetical order. + +=item is_active B<optional> + +C<boolean> Flag of this type appear in the UI and can be set. Default is B<true>. + +=item is_requestable B<optional> + +C<boolean> Users can ask for flags of this type to be set. Default is B<true>. + +=item cc_list B<optional> + +C<array> An array of strings. If the flag type is requestable, who should +receive e-mail notification of requests. This is an array of e-mail addresses +which do not need to be Bugzilla logins. + +=item is_specifically_requestable B<optional> + +C<boolean> Users can ask specific other users to set flags of this type as +opposed to just asking the wind. Default is B<true>. + +=item is_multiplicable B<optional> + +C<boolean> Multiple flags of this type can be set on the same bug. Default is B<true>. + +=item grant_group B<optional> + +C<string> The group allowed to grant/deny flags of this type (to allow all +users to grant/deny these flags, select no group). Default is B<no group>. + +=item request_group B<optional> + +C<string> If flags of this type are requestable, the group allowed to request +them (to allow all users to request these flags, select no group). Note that +the request group alone has no effect if the grant group is not defined! +Default is B<no group>. + +=back + +=item B<Errors> + +=over + +=item 51 (Group Does Not Exist) + +The group name you entered does not exist, or you do not have access to it. + +=item 105 (Unknown component) + +The component does not exist for this product. + +=item 106 (Product Access Denied) + +Either the product does not exist or you don't have editcomponents privileges +to it. + +=item 501 (Illegal Email Address) + +One of the e-mail address in the CC list is invalid. An e-mail in the CC +list does NOT need to be a valid Bugzilla user. + +=item 1101 (Flag Type Name invalid) + +You must specify a non-blank name for this flag type. It must +no contain spaces or commas, and must be 50 characters or less. + +=item 1102 (Flag type must have description) + +You must specify a description for this flag type. + +=item 1103 (Flag type CC list is invalid + +The CC list must be 200 characters or less. + +=item 1104 (Flag Type Sort Key Not Valid) + +The sort key is not a valid number. + +=item 1105 (Flag Type Not Editable) + +This flag type is not available for the products you can administer. Therefore +you can not edit attributes of the flag type, other than the inclusion and +exclusion list. + +=back + +=item B<History> + +=over + +=item Added in Bugzilla B<5.0>. + +=back + +=back + +=head2 update + +B<EXPERIMENTAL> + +=over + +=item B<Description> + +This allows you to update a flag type in Bugzilla. + +=item B<REST> + +PUT /rest/flag_type/<product_id_or_name> + +The params to include in the PUT body as well as the returned data format, +are the same as below. The C<ids> and C<names> params will be overridden as +it is pulled from the URL path. + +=item B<Params> + +B<Note:> The following parameters specify which products you are updating. +You must set one or both of these parameters. + +=over + +=item C<ids> + +C<array> of C<int>s. Numeric ids of the flag types that you wish to update. + +=item C<names> + +C<array> of C<string>s. Names of the flag types that you wish to update. If +many flag types have the same name, this will change ALL of them. + +=back + +B<Note:> The following parameters specify the new values you want to set for +the products you are updating. + +=over + +=item name + +C<string> A short name identifying this type. + +=item description + +C<string> A comprehensive description of this type. + +=item inclusions B<optional> + +An array of strings or a hash containing product names, and optionally +component names. If you provide a string, the flag type will be shown on +all bugs in that product. If you provide a hash, the key represents the +product name, and the value is the components of the product to be included. + +for example + + [ 'FooProduct', + { + BarProduct => [ 'C1', 'C3' ], + BazProduct => [ 'C7' ] + } + ] + +This flag will be added to B<All> components of I<FooProduct>, +components C1 and C3 of I<BarProduct>, and C7 of I<BazProduct>. + +=item exclusions B<optional> + +An array of strings or hashes containing product names. +This uses the same fromat as inclusions. + +This will exclude the flag from all products and components specified. + +=item sortkey + +C<int> A number between 1 and 32767 by which this type will be sorted when +displayed to users in a list; ignore if you don't care what order the types +appear in or if you want them to appear in alphabetical order. + +=item is_active + +C<boolean> Flag of this type appear in the UI and can be set. + +=item is_requestable + +C<boolean> Users can ask for flags of this type to be set. + +=item cc_list + +C<array> An array of strings. If the flag type is requestable, who should +receive e-mail notification of requests. This is an array of e-mail addresses +which do not need to be Bugzilla logins. + +=item is_specifically_requestable + +C<boolean> Users can ask specific other users to set flags of this type as +opposed to just asking the wind. + +=item is_multiplicable + +C<boolean> Multiple flags of this type can be set on the same bug. + +=item grant_group + +C<string> The group allowed to grant/deny flags of this type (to allow all +users to grant/deny these flags, select no group). + +=item request_group + +C<string> If flags of this type are requestable, the group allowed to request +them (to allow all users to request these flags, select no group). Note that +the request group alone has no effect if the grant group is not defined! + +=back + +=item B<Returns> + +A C<hash> with a single field "flagtypes". This points to an array of hashes +with the following fields: + +=over + +=item C<id> + +C<int> The id of the product that was updated. + +=item C<name> + +C<string> The name of the product that was updated. + +=item C<changes> + +C<hash> The changes that were actually done on this product. The keys are +the names of the fields that were changed, and the values are a hash +with two keys: + +=over + +=item C<added> + +C<string> The value that this field was changed to. + +=item C<removed> + +C<string> The value that was previously set in this field. + +=back + +Note that booleans will be represented with the strings '1' and '0'. + +Here's an example of what a return value might look like: + + { + products => [ + { + id => 123, + changes => { + name => { + removed => 'FooFlagType', + added => 'BarFlagType' + }, + is_requestable => { + removed => '1', + added => '0', + } + } + } + ] + } + +=back + +=item B<Errors> + +=over + +=item 51 (Group Does Not Exist) + +The group name you entered does not exist, or you do not have access to it. + +=item 105 (Unknown component) + +The component does not exist for this product. + +=item 106 (Product Access Denied) + +Either the product does not exist or you don't have editcomponents privileges +to it. + +=item 501 (Illegal Email Address) + +One of the e-mail address in the CC list is invalid. An e-mail in the CC +list does NOT need to be a valid Bugzilla user. + +=item 1101 (Flag Type Name invalid) + +You must specify a non-blank name for this flag type. It must +no contain spaces or commas, and must be 50 characters or less. + +=item 1102 (Flag type must have description) + +You must specify a description for this flag type. + +=item 1103 (Flag type CC list is invalid + +The CC list must be 200 characters or less. + +=item 1104 (Flag Type Sort Key Not Valid) + +The sort key is not a valid number. + +=item 1105 (Flag Type Not Editable) + +This flag type is not available for the products you can administer. Therefore +you can not edit attributes of the flag type, other than the inclusion and +exclusion list. + +=back + +=item B<History> + +=over + +=item Added in Bugzilla B<5.0>. + +=back + +=back diff --git a/Bugzilla/WebService/Group.pm b/Bugzilla/WebService/Group.pm index 72c948aa4..468575a35 100644 --- a/Bugzilla/WebService/Group.pm +++ b/Bugzilla/WebService/Group.pm @@ -7,14 +7,18 @@ package Bugzilla::WebService::Group; +use 5.10.1; use strict; -use base qw(Bugzilla::WebService); +use warnings; + +use parent qw(Bugzilla::WebService); use Bugzilla::Constants; use Bugzilla::Error; use Bugzilla::WebService::Util qw(validate translate params_to_objects); use constant PUBLIC_METHODS => qw( create + get update ); @@ -97,6 +101,125 @@ sub update { return { groups => \@result }; } +sub get { + my ($self, $params) = validate(@_, 'ids', 'names', 'type'); + + Bugzilla->login(LOGIN_REQUIRED); + + # Reject access if there is no sense in continuing. + my $user = Bugzilla->user; + my $all_groups = $user->in_group('editusers') || $user->in_group('creategroups'); + if (!$all_groups && !$user->can_bless) { + ThrowUserError('group_cannot_view'); + } + + Bugzilla->switch_to_shadow_db(); + + my $groups = []; + + if (defined $params->{ids}) { + # Get the groups by id + $groups = Bugzilla::Group->new_from_list($params->{ids}); + } + + if (defined $params->{names}) { + # Get the groups by name. Check will throw an error if a bad name is given + foreach my $name (@{$params->{names}}) { + # Skip if we got this from params->{id} + next if grep { $_->name eq $name } @$groups; + + push @$groups, Bugzilla::Group->check({ name => $name }); + } + } + + if (!defined $params->{ids} && !defined $params->{names}) { + if ($all_groups) { + @$groups = Bugzilla::Group->get_all; + } + else { + # Get only groups the user has bless groups too + $groups = $user->bless_groups; + } + } + + # Now create a result entry for each. + my @groups = map { $self->_group_to_hash($params, $_) } @$groups; + return { groups => \@groups }; +} + +sub _group_to_hash { + my ($self, $params, $group) = @_; + my $user = Bugzilla->user; + + my $field_data = { + id => $self->type('int', $group->id), + name => $self->type('string', $group->name), + description => $self->type('string', $group->description), + }; + + if ($user->in_group('creategroups')) { + $field_data->{is_active} = $self->type('boolean', $group->is_active); + $field_data->{is_bug_group} = $self->type('boolean', $group->is_bug_group); + $field_data->{user_regexp} = $self->type('string', $group->user_regexp); + } + + if ($params->{membership}) { + $field_data->{membership} = $self->_get_group_membership($group, $params); + } + return $field_data; +} + +sub _get_group_membership { + my ($self, $group, $params) = @_; + my $user = Bugzilla->user; + + my %users_only; + my $dbh = Bugzilla->dbh; + my $editusers = $user->in_group('editusers'); + + my $query = 'SELECT userid FROM profiles'; + my $visibleGroups; + + if (!$editusers && Bugzilla->params->{'usevisibilitygroups'}) { + # Show only users in visible groups. + $visibleGroups = $user->visible_groups_inherited; + + if (scalar @$visibleGroups) { + $query .= qq{, user_group_map AS ugm + WHERE ugm.user_id = profiles.userid + AND ugm.isbless = 0 + AND } . $dbh->sql_in('ugm.group_id', $visibleGroups); + } + } elsif ($editusers || $user->can_bless($group->id) || $user->in_group('creategroups')) { + $visibleGroups = 1; + $query .= qq{, user_group_map AS ugm + WHERE ugm.user_id = profiles.userid + AND ugm.isbless = 0 + }; + } + if (!$visibleGroups) { + ThrowUserError('group_not_visible', { group => $group }); + } + + my $grouplist = Bugzilla::Group->flatten_group_membership($group->id); + $query .= ' AND ' . $dbh->sql_in('ugm.group_id', $grouplist); + + my $userids = $dbh->selectcol_arrayref($query); + my $user_objects = Bugzilla::User->new_from_list($userids); + my @users = + map {{ + id => $self->type('int', $_->id), + real_name => $self->type('string', $_->name), + name => $self->type('string', $_->login), + email => $self->type('string', $_->email), + can_login => $self->type('boolean', $_->is_enabled), + email_enabled => $self->type('boolean', $_->email_enabled), + login_denied_text => $self->type('string', $_->disabledtext), + }} @$user_objects; + + return \@users; +} + 1; __END__ @@ -116,6 +239,10 @@ get information about them. See L<Bugzilla::WebService> for a description of how parameters are passed, and what B<STABLE>, B<UNSTABLE>, and B<EXPERIMENTAL> mean. +Although the data input and output is the same for JSONRPC, XMLRPC and REST, +the directions for how to access the data via REST is noted in each method +where applicable. + =head1 Group Creation and Modification =head2 create @@ -128,9 +255,16 @@ B<UNSTABLE> This allows you to create a new group in Bugzilla. -=item B<Params> +=item B<REST> + +POST /rest/group + +The params to include in the POST body as well as the returned data format, +are the same as below. + +=item B<Params> -Some params must be set, or an error will be thrown. These params are +Some params must be set, or an error will be thrown. These params are marked B<Required>. =over @@ -151,7 +285,7 @@ name of the group. C<string> A regular expression. Any user whose Bugzilla username matches this regular expression will automatically be granted membership in this group. -=item C<is_active> +=item C<is_active> C<boolean> C<True> if new group can be used for bugs, C<False> if this is a group that will only contain users and no bugs will be restricted @@ -165,7 +299,7 @@ if they are in this group. =back -=item B<Returns> +=item B<Returns> A hash with one element, C<id>. This is the id of the newly-created group. @@ -191,7 +325,15 @@ You specified an invalid regular expression in the C<user_regexp> field. =back -=back +=item B<History> + +=over + +=item REST API call added in Bugzilla B<5.0>. + +=back + +=back =head2 update @@ -203,6 +345,14 @@ B<UNSTABLE> This allows you to update a group in Bugzilla. +=item B<REST> + +PUT /rest/group/<group_name_or_id> + +The params to include in the PUT body as well as the returned data format, +are the same as below. The C<ids> param will be overridden as it is pulled +from the URL path. + =item B<Params> At least C<ids> or C<names> must be set, or an error will be thrown. @@ -281,6 +431,176 @@ comma-and-space-separated list if multiple values were removed. The same as L</create>. +=item B<History> + +=over + +=item REST API call added in Bugzilla B<5.0>. + +=back + +=back + +=head1 Group Information + +=head2 get + +B<UNSTABLE> + +=over + +=item B<Description> + +Returns information about L<Bugzilla::Group|Groups>. + +=item B<REST> + +To return information about a specific group by C<id> or C<name>: + +GET /rest/group/<group_id_or_name> + +You can also return information about more than one specific group +by using the following in your query string: + +GET /rest/group?ids=1&ids=2&ids=3 or GET /group?names=ProductOne&names=Product2 + +the returned data format is same as below. + +=item B<Params> + +If neither ids or names is passed, and you are in the creategroups or +editusers group, then all groups will be retrieved. Otherwise, only groups +that you have bless privileges for will be returned. + +=over + +=item C<ids> + +C<array> Contain ids of groups to update. + +=item C<names> + +C<array> Contain names of groups to update. + +=item C<membership> + +C<boolean> Set to 1 then a list of members of the passed groups' names and +ids will be returned. + +=back + +=item B<Returns> + +If the user is a member of the "creategroups" group they will receive +information about all groups or groups matching the criteria that they passed. +You have to be in the creategroups group unless you're requesting membership +information. + +If the user is not a member of the "creategroups" group, but they are in the +"editusers" group or have bless privileges to the groups they require +membership information for, the is_active, is_bug_group and user_regexp values +are not supplied. + +The return value will be a hash containing group names as the keys, each group +name will point to a hash that describes the group and has the following items: + +=over + +=item id + +C<int> The unique integer ID that Bugzilla uses to identify this group. +Even if the name of the group changes, this ID will stay the same. + +=item name + +C<string> The name of the group. + +=item description + +C<string> The description of the group. + +=item is_bug_group + +C<int> Whether this groups is to be used for bug reports or is only administrative specific. + +=item user_regexp + +C<string> A regular expression that allows users to be added to this group if their login matches. + +=item is_active + +C<int> Whether this group is currently active or not. + +=item users + +C<array> An array of hashes, each hash contains a user object for one of the +members of this group, only returned if the user sets the C<membership> +parameter to 1, the user hash has the following items: + +=over + +=item id + +C<int> The id of the user. + +=item real_name + +C<string> The actual name of the user. + +=item email + +C<string> The email address of the user. + +=item name + +C<string> The login name of the user. Note that in some situations this is +different than their email. + +=item can_login + +C<boolean> A boolean value to indicate if the user can login into bugzilla. + +=item email_enabled + +C<boolean> A boolean value to indicate if bug-related mail will be sent +to the user or not. + +=item disabled_text + +C<string> A text field that holds the reason for disabling a user from logging +into bugzilla, if empty then the user account is enabled otherwise it is +disabled/closed. + +=back + +=back + +=item B<Errors> + +=over + +=item 51 (Invalid Object) + +A non existing group name was passed to the function, as a result no +group object existed for that invalid name. + +=item 805 (Cannot view groups) + +Logged-in users are not authorized to edit bugzilla groups as they are not +members of the creategroups group in bugzilla, or they are not authorized to +access group member's information as they are not members of the "editusers" +group or can bless the group. + +=back + +=item B<History> + +=over + +=item This function was added in Bugzilla B<5.0>. + +=back + =back =cut diff --git a/Bugzilla/WebService/Product.pm b/Bugzilla/WebService/Product.pm index 1c8d75bb4..f38972bc1 100644 --- a/Bugzilla/WebService/Product.pm +++ b/Bugzilla/WebService/Product.pm @@ -7,8 +7,11 @@ package Bugzilla::WebService::Product; +use 5.10.1; use strict; -use base qw(Bugzilla::WebService); +use warnings; + +use parent qw(Bugzilla::WebService); use Bugzilla::Product; use Bugzilla::User; use Bugzilla::Error; @@ -57,64 +60,92 @@ BEGIN { *get_products = \&get } # Get the ids of the products the user can search sub get_selectable_products { Bugzilla->switch_to_shadow_db(); - return {ids => [map {$_->id} @{Bugzilla->user->get_selectable_products}]}; + return {ids => [map {$_->id} @{Bugzilla->user->get_selectable_products}]}; } # Get the ids of the products the user can enter bugs against sub get_enterable_products { Bugzilla->switch_to_shadow_db(); - return {ids => [map {$_->id} @{Bugzilla->user->get_enterable_products}]}; + return {ids => [map {$_->id} @{Bugzilla->user->get_enterable_products}]}; } # Get the union of the products the user can search and enter bugs against. sub get_accessible_products { Bugzilla->switch_to_shadow_db(); - return {ids => [map {$_->id} @{Bugzilla->user->get_accessible_products}]}; + return {ids => [map {$_->id} @{Bugzilla->user->get_accessible_products}]}; } # Get a list of actual products, based on list of ids or names sub get { - my ($self, $params) = validate(@_, 'ids', 'names'); + my ($self, $params) = validate(@_, 'ids', 'names', 'type'); + my $user = Bugzilla->user; - defined $params->{ids} || defined $params->{names} + defined $params->{ids} || defined $params->{names} || defined $params->{type} || ThrowCodeError("params_required", { function => "Product.get", - params => ['ids', 'names'] }); + params => ['ids', 'names', 'type'] }); Bugzilla->switch_to_shadow_db(); - # Only products that are in the users accessible products, - # can be allowed to be returned - my $accessible_products = Bugzilla->user->get_accessible_products; + my $products = []; + if (defined $params->{type}) { + my %product_hash; + foreach my $type (@{ $params->{type} }) { + my $result = []; + if ($type eq 'accessible') { + $result = $user->get_accessible_products(); + } + elsif ($type eq 'enterable') { + $result = $user->get_enterable_products(); + } + elsif ($type eq 'selectable') { + $result = $user->get_selectable_products(); + } + else { + ThrowUserError('get_products_invalid_type', + { type => $type }); + } + map { $product_hash{$_->id} = $_ } @$result; + } + $products = [ values %product_hash ]; + } + else { + $products = $user->get_accessible_products; + } - my @requested_accessible; + my @requested_products; if (defined $params->{ids}) { # Create a hash with the ids the user wants my %ids = map { $_ => 1 } @{$params->{ids}}; - - # Return the intersection of this, by grepping the ids from - # accessible products. - push(@requested_accessible, - grep { $ids{$_->id} } @$accessible_products); + + # Return the intersection of this, by grepping the ids from $products. + push(@requested_products, + grep { $ids{$_->id} } @$products); } if (defined $params->{names}) { # Create a hash with the names the user wants my %names = map { lc($_) => 1 } @{$params->{names}}; - - # Return the intersection of this, by grepping the names from - # accessible products, union'ed with products found by ID to + + # Return the intersection of this, by grepping the names + # from $products, union'ed with products found by ID to # avoid duplicates foreach my $product (grep { $names{lc $_->name} } - @$accessible_products) { + @$products) { next if grep { $_->id == $product->id } - @requested_accessible; - push @requested_accessible, $product; + @requested_products; + push @requested_products, $product; } } + # If we just requested a specific type of products without + # specifying ids or names, then return the entire list. + if (!defined $params->{ids} && !defined $params->{names}) { + @requested_products = @$products; + } + # Now create a result entry for each. my @products = map { $self->_product_to_hash($params, $_) } - @requested_accessible; + @requested_products; return { products => \@products }; } @@ -122,7 +153,7 @@ sub create { my ($self, $params) = @_; Bugzilla->login(LOGIN_REQUIRED); - Bugzilla->user->in_group('editcomponents') + Bugzilla->user->in_group('editcomponents') || ThrowUserError("auth_failure", { group => "editcomponents", action => "add", object => "products"}); @@ -158,7 +189,7 @@ sub update { object => "products" }); defined($params->{names}) || defined($params->{ids}) - || ThrowCodeError('params_required', + || ThrowCodeError('params_required', { function => 'Product.update', params => ['ids', 'names'] }); my $product_objects = params_to_objects($params, 'Bugzilla::Product'); @@ -177,10 +208,10 @@ sub update { my %changes; foreach my $product (@$product_objects) { my $returned_changes = $product->update(); - $changes{$product->id} = translate($returned_changes, MAPPED_RETURNS); + $changes{$product->id} = translate($returned_changes, MAPPED_RETURNS); } $dbh->bz_commit_transaction(); - + my @result; foreach my $product (@$product_objects) { my %hash = ( @@ -192,7 +223,7 @@ sub update { my $change = $changes{$product->id}->{$field}; $hash{changes}{$field} = { removed => $self->type('string', $change->[0]), - added => $self->type('string', $change->[1]) + added => $self->type('string', $change->[1]) }; } @@ -234,7 +265,7 @@ sub _product_to_hash { sub _component_to_hash { my ($self, $component, $params) = @_; - my $field_data = { + my $field_data = filter $params, { id => $self->type('int', $component->id), name => @@ -242,17 +273,17 @@ sub _component_to_hash { description => $self->type('string' , $component->description), default_assigned_to => - $self->type('string' , $component->default_assignee->login), - default_qa_contact => - $self->type('string' , $component->default_qa_contact ? - $component->default_qa_contact->login : ''), + $self->type('email', $component->default_assignee->login), + default_qa_contact => + $self->type('email', $component->default_qa_contact ? + $component->default_qa_contact->login : ""), sort_key => # sort_key is returned to match Bug.fields 0, is_active => $self->type('boolean', $component->is_active), - }; + }, undef, 'components'; - if (filter_wants($params, 'flag_types', 'components')) { + if (filter_wants($params, 'flag_types', undef, 'components')) { $field_data->{flag_types} = { bug => [map { @@ -264,12 +295,13 @@ sub _component_to_hash { } @{$component->flag_types->{'attachment'}}], }; } - return filter($params, $field_data, 'components'); + + return $field_data; } sub _flag_type_to_hash { - my ($self, $flag_type) = @_; - return { + my ($self, $flag_type, $params) = @_; + return filter $params, { id => $self->type('int', $flag_type->id), name => @@ -292,12 +324,12 @@ sub _flag_type_to_hash { $self->type('int', $flag_type->grant_group_id), request_group => $self->type('int', $flag_type->request_group_id), - }; + }, undef, 'flag_types'; } sub _version_to_hash { my ($self, $version, $params) = @_; - my $field_data = { + return filter $params, { id => $self->type('int', $version->id), name => @@ -306,13 +338,12 @@ sub _version_to_hash { 0, is_active => $self->type('boolean', $version->is_active), - }; - return filter($params, $field_data, 'versions'); + }, undef, 'versions'; } sub _milestone_to_hash { my ($self, $milestone, $params) = @_; - my $field_data = { + return filter $params, { id => $self->type('int', $milestone->id), name => @@ -321,8 +352,7 @@ sub _milestone_to_hash { $self->type('int', $milestone->sortkey), is_active => $self->type('boolean', $milestone->is_active), - }; - return filter($params, $field_data, 'milestones'); + }, undef, 'milestones'; } 1; @@ -343,6 +373,10 @@ get information about them. See L<Bugzilla::WebService> for a description of how parameters are passed, and what B<STABLE>, B<UNSTABLE>, and B<EXPERIMENTAL> mean. +Although the data input and output is the same for JSONRPC, XMLRPC and REST, +the directions for how to access the data via REST is noted in each method +where applicable. + =head1 List Products =head2 get_selectable_products @@ -355,15 +389,29 @@ B<EXPERIMENTAL> Returns a list of the ids of the products the user can search on. +=item B<REST> + +GET /rest/product_selectable + +the returned data format is same as below. + =item B<Params> (none) -=item B<Returns> +=item B<Returns> A hash containing one item, C<ids>, that contains an array of product ids. =item B<Errors> (none) +=item B<History> + +=over + +=item REST API call added in Bugzilla B<5.0>. + +=back + =back =head2 get_enterable_products @@ -377,6 +425,12 @@ B<EXPERIMENTAL> Returns a list of the ids of the products the user can enter bugs against. +=item B<REST> + +GET /rest/product_enterable + +the returned data format is same as below. + =item B<Params> (none) =item B<Returns> @@ -386,6 +440,14 @@ ids. =item B<Errors> (none) +=item B<History> + +=over + +=item REST API call added in Bugzilla B<5.0>. + +=back + =back =head2 get_accessible_products @@ -399,6 +461,12 @@ B<UNSTABLE> Returns a list of the ids of the products the user can search or enter bugs against. +=item B<REST> + +GET /rest/product_accessible + +the returned data format is same as below. + =item B<Params> (none) =item B<Returns> @@ -408,6 +476,14 @@ ids. =item B<Errors> (none) +=item B<History> + +=over + +=item REST API call added in Bugzilla B<5.0>. + +=back + =back =head2 get @@ -424,6 +500,24 @@ B<Note>: You must at least specify one of C<ids> or C<names>. B<Note>: Can also be called as "get_products" for compatibilty with Bugzilla 3.0 API. +=item B<REST> + +To return information about a specific groups of products such as +C<accessible>, C<selectable>, or C<enterable>: + +GET /rest/product?type=accessible + +To return information about a specific product by C<id> or C<name>: + +GET /rest/product/<product_id_or_name> + +You can also return information about more than one specific product +by using the following in your query string: + +GET /rest/product?ids=1&ids=2&ids=3 or GET /product?names=ProductOne&names=Product2 + +the returned data format is same as below. + =item B<Params> In addition to the parameters below, this method also accepts the @@ -442,9 +536,15 @@ An array of product ids An array of product names +=item C<type> + +The group of products to return. Valid values are: C<accessible> (default), +C<selectable>, and C<enterable>. C<type> can be a single value or an array +of values if more than one group is needed with duplicates removed. + =back -=item B<Returns> +=item B<Returns> A hash containing one item, C<products>, that is an array of hashes. Each hash describes a product, and has the following items: @@ -524,7 +624,7 @@ components are not enabled for new bugs. =item C<flag_types> -A hash containing the two items C<bug> and C<attachment> that each contains an +A hash containing the two items C<bug> and C<attachment> that each contains an array of hashes, where each hash describes a flagtype, and has the following items: @@ -578,8 +678,8 @@ flagtype. =item C<request_group> -C<int> the group id that is allowed to request the flag if the flag -is of the type requestable. If the item is not included all users +C<int> the group id that is allowed to request the flag if the flag +is of the type requestable. If the item is not included all users are allowed request this flagtype. =back @@ -619,6 +719,8 @@ been removed. =item In Bugzilla B<4.4>, C<flag_types> was added to the fields returned by C<get>. +=item REST API call added in Bugzilla B<5.0>. + =back =back @@ -635,9 +737,16 @@ B<EXPERIMENTAL> This allows you to create a new product in Bugzilla. -=item B<Params> +=item B<REST> + +POST /rest/product + +The params to include in the POST body as well as the returned data format, +are the same as below. + +=item B<Params> -Some params must be set, or an error will be thrown. These params are +Some params must be set, or an error will be thrown. These params are marked B<Required>. =over @@ -651,11 +760,11 @@ within Bugzilla. B<Required> C<string> A description for this product. Allows some simple HTML. -=item C<version> +=item C<version> B<Required> C<string> The default version for this product. -=item C<has_unconfirmed> +=item C<has_unconfirmed> C<boolean> Allow the UNCONFIRMED status to be set on bugs in this product. Default: true. @@ -664,11 +773,11 @@ Default: true. C<string> The name of the Classification which contains this product. -=item C<default_milestone> +=item C<default_milestone> C<string> The default milestone for this product. Default '---'. -=item C<is_open> +=item C<is_open> C<boolean> True if the product is currently allowing bugs to be entered into it. Default: true. @@ -680,7 +789,7 @@ new product. Default: true. =back -=item B<Returns> +=item B<Returns> A hash with one element, id. This is the id of the newly-filed product. @@ -716,6 +825,14 @@ You must specify a version for this product. =back +=item B<History> + +=over + +=item REST API call added in Bugzilla B<5.0>. + +=back + =back =head2 update @@ -728,6 +845,14 @@ B<EXPERIMENTAL> This allows you to update a product in Bugzilla. +=item B<REST> + +PUT /rest/product/<product_id_or_name> + +The params to include in the PUT body as well as the returned data format, +are the same as below. The C<ids> and C<names> params will be overridden as +it is pulled from the URL path. + =item B<Params> B<Note:> The following parameters specify which products you are updating. @@ -808,7 +933,7 @@ Note that booleans will be represented with the strings '1' and '0'. Here's an example of what a return value might look like: - { + { products => [ { id => 123, @@ -862,6 +987,16 @@ You must define a default milestone. =item Added in Bugzilla B<4.4>. +=item REST API call added in Bugzilla B<5.0>. + +=back + =back +=head1 B<Methods in need of POD> + +=over + +=item get_products + =back diff --git a/Bugzilla/WebService/README b/Bugzilla/WebService/README index bbe320979..eb4799cfc 100644 --- a/Bugzilla/WebService/README +++ b/Bugzilla/WebService/README @@ -11,7 +11,7 @@ When XMLRPC::Lite calls a method, $self is the name of the *class* the method is in. For example, if we call Bugzilla.version(), the first argument is Bugzilla::WebService::Bugzilla. So in order to have $self (our first argument) act correctly in XML-RPC, we make all WebService -classes use base qw(Bugzilla::WebService). +classes use parent qw(Bugzilla::WebService). When JSON::RPC calls a method, $self is the JSON-RPC *server object*. In other words, it's an instance of Bugzilla::WebService::Server::JSONRPC. So we have diff --git a/Bugzilla/WebService/Server.pm b/Bugzilla/WebService/Server.pm index 15bc4bcca..7950c7a3b 100644 --- a/Bugzilla/WebService/Server.pm +++ b/Bugzilla/WebService/Server.pm @@ -6,12 +6,18 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::WebService::Server; + +use 5.10.1; use strict; +use warnings; use Bugzilla::Error; use Bugzilla::Util qw(datetime_from); use Scalar::Util qw(blessed); +use Digest::MD5 qw(md5_base64); + +use Storable qw(freeze); sub handle_login { my ($self, $class, $method, $full_method) = @_; @@ -23,11 +29,15 @@ sub handle_login { return if ($class->login_exempt($method) and !defined Bugzilla->input_params->{Bugzilla_login}); Bugzilla->login(); + + Bugzilla::Hook::process( + 'webservice_before_call', + { 'method' => $method, full_method => $full_method }); } sub datetime_format_inbound { my ($self, $time) = @_; - + my $converted = datetime_from($time, Bugzilla->local_timezone); if (!defined $converted) { ThrowUserError('illegal_date', { date => $time }); @@ -53,4 +63,71 @@ sub datetime_format_outbound { return $time->iso8601(); } +# ETag support +sub bz_etag { + my ($self, $data) = @_; + my $cache = Bugzilla->request_cache; + if (defined $data) { + # Serialize the data if passed a reference + local $Storable::canonical = 1; + $data = freeze($data) if ref $data; + + # Wide characters cause md5_base64() to die. + utf8::encode($data) if utf8::is_utf8($data); + + # Append content_type to the end of the data + # string as we want the etag to be unique to + # the content_type. We do not need this for + # XMLRPC as text/xml is always returned. + if (blessed($self) && $self->can('content_type')) { + $data .= $self->content_type if $self->content_type; + } + + $cache->{'bz_etag'} = md5_base64($data); + } + return $cache->{'bz_etag'}; +} + 1; + +=head1 NAME + +Bugzilla::WebService::Server - Base server class for the WebService API + +=head1 DESCRIPTION + +Bugzilla::WebService::Server is the base class for the individual WebService API +servers such as XMLRPC, JSONRPC, and REST. You never actually create a +Bugzilla::WebService::Server directly, you only make subclasses of it. + +=head1 FUNCTIONS + +=over + +=item C<bz_etag> + +This function is used to store an ETag value that will be used when returning +the data by the different API server modules such as XMLRPC, or REST. The individual +webservice methods can also set the value earlier in the process if needed such as +before a unique update token is added. If a value is not set earlier, an etag will +automatically be created using the returned data except in some cases when an error +has occurred. + +=back + +=head1 SEE ALSO + +L<Bugzilla::WebService::Server::XMLRPC|XMLRPC>, L<Bugzilla::WebService::Server::JSONRPC|JSONRPC>, +and L<Bugzilla::WebService::Server::REST|REST>. + +=head1 B<Methods in need of POD> + +=over + +=item handle_login + +=item datetime_format_outbound + +=item datetime_format_inbound + +=back diff --git a/Bugzilla/WebService/Server/JSONRPC.pm b/Bugzilla/WebService/Server/JSONRPC.pm index 0a0afd400..70b8fd96c 100644 --- a/Bugzilla/WebService/Server/JSONRPC.pm +++ b/Bugzilla/WebService/Server/JSONRPC.pm @@ -7,7 +7,10 @@ package Bugzilla::WebService::Server::JSONRPC; +use 5.10.1; use strict; +use warnings; + use Bugzilla::WebService::Server; BEGIN { our @ISA = qw(Bugzilla::WebService::Server); @@ -24,7 +27,7 @@ BEGIN { use Bugzilla::Error; use Bugzilla::WebService::Constants; use Bugzilla::WebService::Util qw(taint_data fix_credentials); -use Bugzilla::Util qw(correct_urlbase trim disable_utf8); +use Bugzilla::Util; use HTTP::Message; use MIME::Base64 qw(decode_base64 encode_base64); @@ -74,6 +77,7 @@ sub response_header { sub response { my ($self, $response) = @_; + my $cgi = $self->cgi; # Implement JSONP. if (my $callback = $self->_bz_callback) { @@ -95,9 +99,18 @@ sub response { push(@header_args, "-$name", $value); } } - my $cgi = $self->cgi; - print $cgi->header(-status => $response->code, @header_args); - print $response->content; + + # ETag support + my $etag = $self->bz_etag; + if ($etag && $cgi->check_etag($etag)) { + push(@header_args, "-ETag", $etag); + print $cgi->header(-status => '304 Not Modified', @header_args); + } + else { + push(@header_args, "-ETag", $etag) if $etag; + print $cgi->header(-status => $response->code, @header_args); + print $response->content; + } } # The JSON-RPC 1.1 GET specification is not so great--you can't specify @@ -209,6 +222,9 @@ sub type { utf8::encode($value) if utf8::is_utf8($value); $retval = encode_base64($value, ''); } + elsif ($type eq 'email' && Bugzilla->params->{'webservice_email_filter'}) { + $retval = email_filter($value); + } return $retval; } @@ -254,7 +270,17 @@ sub _handle { my $self = shift; my ($obj) = @_; $self->{_bz_request_id} = $obj->{id}; - return $self->SUPER::_handle(@_); + + my $result = $self->SUPER::_handle(@_); + + # Set the ETag if not already set in the webservice methods. + my $etag = $self->bz_etag; + if (!$etag && ref $result) { + my $data = $self->json->decode($result)->{'result'}; + $self->bz_etag($data); + } + + return $result; } # Make all error messages returned by JSON::RPC go into the 100000 @@ -577,3 +603,25 @@ the JSON-RPC library that Bugzilla uses, not by Bugzilla. =head1 SEE ALSO L<Bugzilla::WebService> + +=head1 B<Methods in need of POD> + +=over + +=item response + +=item response_header + +=item cgi + +=item retrieve_json_from_get + +=item create_json_coder + +=item type + +=item handle_login + +=item datetime_format_outbound + +=back diff --git a/Bugzilla/WebService/Server/REST.pm b/Bugzilla/WebService/Server/REST.pm new file mode 100644 index 000000000..8450a7a28 --- /dev/null +++ b/Bugzilla/WebService/Server/REST.pm @@ -0,0 +1,689 @@ +# 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::WebService::Server::REST; + +use 5.10.1; +use strict; +use warnings; + +use parent qw(Bugzilla::WebService::Server::JSONRPC); + +use Bugzilla::Constants; +use Bugzilla::Error; +use Bugzilla::Hook; +use Bugzilla::Util qw(correct_urlbase html_quote); +use Bugzilla::WebService::Constants; +use Bugzilla::WebService::Util qw(taint_data fix_credentials); + +# Load resource modules +use Bugzilla::WebService::Server::REST::Resources::Bug; +use Bugzilla::WebService::Server::REST::Resources::Bugzilla; +use Bugzilla::WebService::Server::REST::Resources::Classification; +use Bugzilla::WebService::Server::REST::Resources::Component; +use Bugzilla::WebService::Server::REST::Resources::FlagType; +use Bugzilla::WebService::Server::REST::Resources::Group; +use Bugzilla::WebService::Server::REST::Resources::Product; +use Bugzilla::WebService::Server::REST::Resources::User; +use Bugzilla::WebService::Server::REST::Resources::BugUserLastVisit; + +use List::MoreUtils qw(uniq); +use Scalar::Util qw(blessed reftype); +use MIME::Base64 qw(decode_base64); + +########################### +# Public Method Overrides # +########################### + +sub handle { + my ($self) = @_; + + # Determine how the data should be represented. We do this early so + # errors will also be returned with the proper content type. + # If no accept header was sent or the content types specified were not + # matched, we default to the first type in the whitelist. + $self->content_type($self->_best_content_type(REST_CONTENT_TYPE_WHITELIST())); + + # Using current path information, decide which class/method to + # use to serve the request. Throw error if no resource was found + # unless we were looking for OPTIONS + if (!$self->_find_resource($self->cgi->path_info)) { + if ($self->request->method eq 'OPTIONS' + && $self->bz_rest_options) + { + my $response = $self->response_header(STATUS_OK, ""); + my $options_string = join(', ', @{ $self->bz_rest_options }); + $response->header('Allow' => $options_string, + 'Access-Control-Allow-Methods' => $options_string); + return $self->response($response); + } + + ThrowUserError("rest_invalid_resource", + { path => $self->cgi->path_info, + method => $self->request->method }); + } + + # Dispatch to the proper module + my $class = $self->bz_class_name; + my ($path) = $class =~ /::([^:]+)$/; + $self->path_info($path); + delete $self->{dispatch_path}; + $self->dispatch({ $path => $class }); + + my $params = $self->_retrieve_json_params; + + fix_credentials($params); + + # Fix includes/excludes for each call + rest_include_exclude($params); + + # Set callback name if exists + $self->_bz_callback($params->{'callback'}) if $params->{'callback'}; + + Bugzilla->input_params($params); + + # Set the JSON version to 1.1 and the id to the current urlbase + # also set up the correct handler method + my $obj = { + version => '1.1', + id => correct_urlbase(), + method => $self->bz_method_name, + params => $params + }; + + # Execute the handler + my $result = $self->_handle($obj); + + if (!$self->error_response_header) { + return $self->response( + $self->response_header($self->bz_success_code || STATUS_OK, $result)); + } + + $self->response($self->error_response_header); +} + +sub response { + my ($self, $response) = @_; + + # If we have thrown an error, the 'error' key will exist + # otherwise we use 'result'. JSONRPC returns other data + # along with the result/error such as version and id which + # we will strip off for REST calls. + my $content = $response->content; + my $json_data = {}; + if ($content) { + $json_data = $self->json->decode($content); + } + + my $result = {}; + if (exists $json_data->{error}) { + $result = $json_data->{error}; + $result->{error} = $self->type('boolean', 1); + $result->{documentation} = REST_DOC; + delete $result->{'name'}; # Remove JSONRPCError + } + elsif (exists $json_data->{result}) { + $result = $json_data->{result}; + } + + # The result needs to be a valid JSON data structure + # and not a undefined or scalar value. + if (!ref $result + || blessed($result) + || (ref $result ne 'HASH' && ref $result ne 'ARRAY')) + { + $result = { result => $result }; + } + + Bugzilla::Hook::process('webservice_rest_response', + { rpc => $self, result => \$result, response => $response }); + + # Access Control + $response->header("Access-Control-Allow-Origin", "*"); + $response->header("Access-Control-Allow-Headers", "origin, content-type, accept, x-requested-with"); + + # ETag support + my $etag = $self->bz_etag; + $self->bz_etag($result) if !$etag; + + # If accessing through web browser, then display in readable format + if ($self->content_type eq 'text/html') { + $result = $self->json->pretty->canonical->allow_nonref->encode($result); + + my $template = Bugzilla->template; + $content = ""; + $template->process("rest.html.tmpl", { result => $result }, \$content) + || ThrowTemplateError($template->error()); + + $response->content_type('text/html'); + } + else { + $content = $self->json->encode($result); + } + + $response->content($content); + + $self->SUPER::response($response); +} + +####################################### +# Bugzilla::WebService Implementation # +####################################### + +sub handle_login { + my $self = shift; + + # If we're being called using GET, we don't allow cookie-based or Env + # login, because GET requests can be done cross-domain, and we don't + # want private data showing up on another site unless the user + # explicitly gives that site their username and password. (This is + # particularly important for JSONP, which would allow a remote site + # to use private data without the user's knowledge, unless we had this + # protection in place.) We do allow this for GET /login as we need to + # for Bugzilla::Auth::Persist::Cookie to create a login cookie that we + # can also use for Bugzilla_token support. This is OK as it requires + # a login and password to be supplied and will fail if they are not + # valid for the user. + if (!grep($_ eq $self->request->method, ('POST', 'PUT')) + && !($self->bz_class_name eq 'Bugzilla::WebService::User' + && $self->bz_method_name eq 'login')) + { + # XXX There's no particularly good way for us to get a parameter + # to Bugzilla->login at this point, so we pass this information + # around using request_cache, which is a bit of a hack. The + # implementation of it is in Bugzilla::Auth::Login::Stack. + Bugzilla->request_cache->{'auth_no_automatic_login'} = 1; + } + + my $class = $self->bz_class_name; + my $method = $self->bz_method_name; + my $full_method = $class . "." . $method; + + # Bypass JSONRPC::handle_login + Bugzilla::WebService::Server->handle_login($class, $method, $full_method); +} + +############################ +# Private Method Overrides # +############################ + +# We do not want to run Bugzilla::WebService::Server::JSONRPC->_find_prodedure +# as it determines the method name differently. +sub _find_procedure { + my $self = shift; + if ($self->isa('JSON::RPC::Server::CGI')) { + return JSON::RPC::Server::_find_procedure($self, @_); + } + else { + return JSON::RPC::Legacy::Server::_find_procedure($self, @_); + } +} + +sub _argument_type_check { + my $self = shift; + my $params; + + if ($self->isa('JSON::RPC::Server::CGI')) { + $params = JSON::RPC::Server::_argument_type_check($self, @_); + } + else { + $params = JSON::RPC::Legacy::Server::_argument_type_check($self, @_); + } + + # JSON-RPC 1.0 requires all parameters to be passed as an array, so + # we just pull out the first item and assume it's an object. + my $params_is_array; + if (ref $params eq 'ARRAY') { + $params = $params->[0]; + $params_is_array = 1; + } + + taint_data($params); + + # Now, convert dateTime fields on input. + my $method = $self->bz_method_name; + my $pkg = $self->{dispatch_path}->{$self->path_info}; + my @date_fields = @{ $pkg->DATE_FIELDS->{$method} || [] }; + foreach my $field (@date_fields) { + if (defined $params->{$field}) { + my $value = $params->{$field}; + if (ref $value eq 'ARRAY') { + $params->{$field} = + [ map { $self->datetime_format_inbound($_) } @$value ]; + } + else { + $params->{$field} = $self->datetime_format_inbound($value); + } + } + } + my @base64_fields = @{ $pkg->BASE64_FIELDS->{$method} || [] }; + foreach my $field (@base64_fields) { + if (defined $params->{$field}) { + $params->{$field} = decode_base64($params->{$field}); + } + } + + # This is the best time to do login checks. + $self->handle_login(); + + # Bugzilla::WebService packages call internal methods like + # $self->_some_private_method. So we have to inherit from + # that class as well as this Server class. + my $new_class = ref($self) . '::' . $pkg; + my $isa_string = 'our @ISA = qw(' . ref($self) . " $pkg)"; + eval "package $new_class;$isa_string;"; + bless $self, $new_class; + + # Allow extensions to modify the params post login + Bugzilla::Hook::process('webservice_rest_request', + { rpc => $self, params => $params }); + + if ($params_is_array) { + $params = [$params]; + } + + return $params; +} + +################### +# Utility Methods # +################### + +sub bz_method_name { + my ($self, $method) = @_; + $self->{_bz_method_name} = $method if $method; + return $self->{_bz_method_name}; +} + +sub bz_class_name { + my ($self, $class) = @_; + $self->{_bz_class_name} = $class if $class; + return $self->{_bz_class_name}; +} + +sub bz_success_code { + my ($self, $value) = @_; + $self->{_bz_success_code} = $value if $value; + return $self->{_bz_success_code}; +} + +sub bz_rest_params { + my ($self, $params) = @_; + $self->{_bz_rest_params} = $params if $params; + return $self->{_bz_rest_params}; +} + +sub bz_rest_options { + my ($self, $options) = @_; + $self->{_bz_rest_options} = $options if $options; + return $self->{_bz_rest_options}; +} + +sub rest_include_exclude { + my ($params) = @_; + + if ($params->{'include_fields'} && !ref $params->{'include_fields'}) { + $params->{'include_fields'} = [ split(/[\s+,]/, $params->{'include_fields'}) ]; + } + if ($params->{'exclude_fields'} && !ref $params->{'exclude_fields'}) { + $params->{'exclude_fields'} = [ split(/[\s+,]/, $params->{'exclude_fields'}) ]; + } + + return $params; +} + +########################## +# Private Custom Methods # +########################## + +sub _retrieve_json_params { + my $self = shift; + + # Make a copy of the current input_params rather than edit directly + my $params = {}; + %{$params} = %{ Bugzilla->input_params }; + + # First add any parameters we were able to pull out of the path + # based on the resource regexp and combine with the normal URL + # parameters. + if (my $rest_params = $self->bz_rest_params) { + foreach my $param (keys %$rest_params) { + # If the param does not already exist or if the + # rest param is a single value, add it to the + # global params. + if (!exists $params->{$param} || !ref $rest_params->{$param}) { + $params->{$param} = $rest_params->{$param}; + } + # If rest_param is a list then add any extra values to the list + elsif (ref $rest_params->{$param}) { + my @extra_values = ref $params->{$param} + ? @{ $params->{$param} } + : ($params->{$param}); + $params->{$param} + = [ uniq (@{ $rest_params->{$param} }, @extra_values) ]; + } + } + } + + # Any parameters passed in in the body of a non-GET request will override + # any parameters pull from the url path. Otherwise non-unique keys are + # combined. + if ($self->request->method ne 'GET') { + my $extra_params = {}; + # We do this manually because CGI.pm doesn't understand JSON strings. + my $json = delete $params->{'POSTDATA'} || delete $params->{'PUTDATA'}; + if ($json) { + eval { $extra_params = $self->json->decode($json); }; + if ($@) { + ThrowUserError('json_rpc_invalid_params', { err_msg => $@ }); + } + } + + # Allow parameters in the query string if request was non-GET. + # Note: parameters in query string body override any matching + # parameters in the request body. + foreach my $param ($self->cgi->url_param()) { + $extra_params->{$param} = $self->cgi->url_param($param); + } + + %{$params} = (%{$params}, %{$extra_params}) if %{$extra_params}; + } + + return $params; +} + +sub _find_resource { + my ($self, $path) = @_; + + # Load in the WebService module from the dispatch map and then call + # $module->rest_resources to get the resources array ref. + my $resources = {}; + foreach my $module (values %{ $self->{dispatch_path} }) { + eval("require $module") || die $@; + next if !$module->can('rest_resources'); + $resources->{$module} = $module->rest_resources; + } + + Bugzilla::Hook::process('webservice_rest_resources', + { rpc => $self, resources => $resources }); + + # Use the resources hash from each module loaded earlier to determine + # which handler to use based on a regex match of the CGI path. + # Also any matches found in the regex will be passed in later to the + # handler for possible use. + my $request_method = $self->request->method; + + my (@matches, $handler_found, $handler_method, $handler_class); + foreach my $class (keys %{ $resources }) { + # The resource data for each module needs to be + # an array ref with an even number of elements + # to work correctly. + next if (ref $resources->{$class} ne 'ARRAY' + || scalar @{ $resources->{$class} } % 2 != 0); + + while (my $regex = shift @{ $resources->{$class} }) { + my $options_data = shift @{ $resources->{$class} }; + next if ref $options_data ne 'HASH'; + + if (@matches = ($path =~ $regex)) { + # If a specific path is accompanied by a OPTIONS request + # method, the user is asking for a list of possible request + # methods for a specific path. + $self->bz_rest_options([ keys %{ $options_data } ]); + + if ($options_data->{$request_method}) { + my $resource_data = $options_data->{$request_method}; + $self->bz_class_name($class); + + # The method key/value can be a simple scalar method name + # or a anonymous subroutine so we execute it here. + my $method = ref $resource_data->{method} eq 'CODE' + ? $resource_data->{method}->($self) + : $resource_data->{method}; + $self->bz_method_name($method); + + # Pull out any parameters parsed from the URL path + # and store them for use by the method. + if ($resource_data->{params}) { + $self->bz_rest_params($resource_data->{params}->(@matches)); + } + + # If a special success code is needed for this particular + # method, then store it for later when generating response. + if ($resource_data->{success_code}) { + $self->bz_success_code($resource_data->{success_code}); + } + $handler_found = 1; + } + } + last if $handler_found; + } + last if $handler_found; + } + + return $handler_found; +} + +sub _best_content_type { + my ($self, @types) = @_; + return ($self->_simple_content_negotiation(@types))[0] || '*/*'; +} + +sub _simple_content_negotiation { + my ($self, @types) = @_; + my @accept_types = $self->_get_content_prefs(); + # Return the types as-is if no accept header sent, since sorting will be a no-op. + if (!@accept_types) { + return @types; + } + my $score = sub { $self->_score_type(shift, @accept_types) }; + return sort {$score->($b) <=> $score->($a)} @types; +} + +sub _score_type { + my ($self, $type, @accept_types) = @_; + my $score = scalar(@accept_types); + for my $accept_type (@accept_types) { + return $score if $type eq $accept_type; + $score--; + } + return 0; +} + +sub _get_content_prefs { + my $self = shift; + my $default_weight = 1; + my @prefs; + + # Parse the Accept header, and save type name, score, and position. + my @accept_types = split /,/, $self->cgi->http('accept') || ''; + my $order = 0; + for my $accept_type (@accept_types) { + my ($weight) = ($accept_type =~ /q=(\d\.\d+|\d+)/); + my ($name) = ($accept_type =~ m#(\S+/[^;]+)#); + next unless $name; + push @prefs, { name => $name, order => $order++}; + if (defined $weight) { + $prefs[-1]->{score} = $weight; + } else { + $prefs[-1]->{score} = $default_weight; + $default_weight -= 0.001; + } + } + + # Sort the types by score, subscore by order, and pull out just the name + @prefs = map {$_->{name}} sort {$b->{score} <=> $a->{score} || + $a->{order} <=> $b->{order}} @prefs; + return @prefs; +} + +1; + +__END__ + +=head1 NAME + +Bugzilla::WebService::Server::REST - The REST Interface to Bugzilla + +=head1 DESCRIPTION + +This documentation describes things about the Bugzilla WebService that +are specific to REST. For a general overview of the Bugzilla WebServices, +see L<Bugzilla::WebService>. The L<Bugzilla::WebService::Server::REST> +module is a sub-class of L<Bugzilla::WebService::Server::JSONRPC> so any +method documentation not found here can be viewed in it's POD. + +Please note that I<everything> about this REST interface is +B<EXPERIMENTAL>. If you want a fully stable API, please use the +C<Bugzilla::WebService::Server::XMLRPC|XML-RPC> interface. + +=head1 CONNECTING + +The endpoint for the REST interface is the C<rest.cgi> script in +your Bugzilla installation. For example, if your Bugzilla is at +C<bugzilla.yourdomain.com>, to access the API and load a bug, +you would use C<http://bugzilla.yourdomain.com/rest.cgi/bug/35>. + +If using Apache and mod_rewrite is installed and enabled, you can +simplify the endpoint by changing /rest.cgi/ to something like /rest/ +or something similar. So the same example from above would be: +C<http://bugzilla.yourdomain.com/rest/bug/35> which is simpler to remember. + +Add this to your .htaccess file: + + <IfModule mod_rewrite.c> + RewriteEngine On + RewriteRule ^rest/(.*)$ rest.cgi/$1 [NE] + </IfModule> + +=head1 BROWSING + +If the Accept: header of a request is set to text/html (as it is by an +ordinary web browser) then the API will return the JSON data as a HTML +page which the browser can display. In other words, you can play with the +API using just your browser and see results in a human-readable form. +This is a good way to try out the various GET calls, even if you can't use +it for POST or PUT. + +=head1 DATA FORMAT + +The REST API only supports JSON input, and either JSON and JSONP output. +So objects sent and received must be in JSON format. Basically since +the REST API is a sub class of the JSONRPC API, you can refer to +L<JSONRPC|Bugzilla::WebService::Server::JSONRPC> for more information +on data types that are valid for REST. + +On every request, you must set both the "Accept" and "Content-Type" HTTP +headers to the MIME type of the data format you are using to communicate with +the API. Content-Type tells the API how to interpret your request, and Accept +tells it how you want your data back. "Content-Type" must be "application/json". +"Accept" can be either that, or "application/javascript" for JSONP - add a "callback" +parameter to name your callback. + +Parameters may also be passed in as part of the query string for non-GET requests +and will override any matching parameters in the request body. + +=head1 AUTHENTICATION + +Along with viewing data as an anonymous user, you may also see private information +if you have a Bugzilla account by providing your login credentials. + +=over + +=item Login name and password + +Pass in as query parameters of any request: + +login=fred@example.com&password=ilovecheese + +Remember to URL encode any special characters, which are often seen in passwords and to +also enable SSL support. + +=item Login token + +By calling GET /login?login=fred@example.com&password=ilovecheese, you get back +a C<token> value which can then be passed to each subsequent call as +authentication. This is useful for third party clients that cannot use cookies +and do not want to store a user's login and password in the client. You can also +pass in "token" as a convenience. + +=back + +=head1 ERRORS + +When an error occurs over REST, a hash structure is returned with the key C<error> +set to C<true>. + +The error contents look similar to: + + { "error": true, "message": "Some message here", "code": 123 } + +Every error has a "code", as described in L<Bugzilla::WebService/ERRORS>. +Errors with a numeric C<code> higher than 100000 are errors thrown by +the JSON-RPC library that Bugzilla uses, not by Bugzilla. + +=head1 UTILITY FUNCTIONS + +=over + +=item B<handle> + +This method overrides the handle method provided by JSONRPC so that certain +actions related to REST such as determining the proper resource to use, +loading query parameters, etc. can be done before the proper WebService +method is executed. + +=item B<response> + +This method overrides the response method provided by JSONRPC so that +the response content can be altered for REST before being returned to +the client. + +=item B<handle_login> + +This method determines the proper WebService all to make based on class +and method name determined earlier. Then calls L<Bugzilla::WebService::Server::handle_login> +which will attempt to authenticate the client. + +=item B<bz_method_name> + +The WebService method name that matches the path used by the client. + +=item B<bz_class_name> + +The WebService class containing the method that matches the path used by the client. + +=item B<bz_rest_params> + +Each REST resource contains a hash key called C<params> that is a subroutine reference. +This subroutine will return a hash structure based on matched values from the path +information that is formatted properly for the WebService method that will be called. + +=item B<bz_rest_options> + +When a client uses the OPTIONS request method along with a specific path, they are +requesting the list of request methods that are valid for the path. Such as for the +path /bug, the valid request methods are GET (search) and POST (create). So the +client would receive in the response header, C<Access-Control-Allow-Methods: GET, POST>. + +=item B<bz_success_code> + +Each resource can specify a specific SUCCESS CODE if the operation completes successfully. +OTherwise STATUS OK (200) is the default returned. + +=item B<rest_include_exclude> + +Normally the WebService methods required C<include_fields> and C<exclude_fields> to be an +array of field names. REST allows for the values for these to be instead comma delimited +string of field names. This method converts the latter into the former so the WebService +methods will not complain. + +=back + +=head1 SEE ALSO + +L<Bugzilla::WebService> diff --git a/Bugzilla/WebService/Server/REST/Resources/Bug.pm b/Bugzilla/WebService/Server/REST/Resources/Bug.pm new file mode 100644 index 000000000..3fa8b65cf --- /dev/null +++ b/Bugzilla/WebService/Server/REST/Resources/Bug.pm @@ -0,0 +1,179 @@ +# 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::WebService::Server::REST::Resources::Bug; + +use 5.10.1; +use strict; +use warnings; + +use Bugzilla::WebService::Constants; +use Bugzilla::WebService::Bug; + +BEGIN { + *Bugzilla::WebService::Bug::rest_resources = \&_rest_resources; +}; + +sub _rest_resources { + my $rest_resources = [ + qr{^/bug$}, { + GET => { + method => 'search', + }, + POST => { + method => 'create', + status_code => STATUS_CREATED + } + }, + qr{^/bug/$}, { + GET => { + method => 'get' + } + }, + qr{^/bug/([^/]+)$}, { + GET => { + method => 'get', + params => sub { + return { ids => [ $_[0] ] }; + } + }, + PUT => { + method => 'update', + params => sub { + return { ids => [ $_[0] ] }; + } + } + }, + qr{^/bug/([^/]+)/comment$}, { + GET => { + method => 'comments', + params => sub { + return { ids => [ $_[0] ] }; + } + }, + POST => { + method => 'add_comment', + params => sub { + return { id => $_[0] }; + }, + success_code => STATUS_CREATED + } + }, + qr{^/bug/comment/([^/]+)$}, { + GET => { + method => 'comments', + params => sub { + return { comment_ids => [ $_[0] ] }; + } + } + }, + qr{^/bug/comment/tags/([^/]+)$}, { + GET => { + method => 'search_comment_tags', + params => sub { + return { query => $_[0] }; + }, + }, + }, + qr{^/bug/comment/([^/]+)/tags$}, { + PUT => { + method => 'update_comment_tags', + params => sub { + return { comment_id => $_[0] }; + }, + }, + }, + qr{^/bug/([^/]+)/history$}, { + GET => { + method => 'history', + params => sub { + return { ids => [ $_[0] ] }; + }, + } + }, + qr{^/bug/([^/]+)/attachment$}, { + GET => { + method => 'attachments', + params => sub { + return { ids => [ $_[0] ] }; + } + }, + POST => { + method => 'add_attachment', + params => sub { + return { ids => [ $_[0] ] }; + }, + success_code => STATUS_CREATED + } + }, + qr{^/bug/attachment/([^/]+)$}, { + GET => { + method => 'attachments', + params => sub { + return { attachment_ids => [ $_[0] ] }; + } + }, + PUT => { + method => 'update_attachment', + params => sub { + return { ids => [ $_[0] ] }; + } + } + }, + qr{^/field/bug$}, { + GET => { + method => 'fields', + } + }, + qr{^/field/bug/([^/]+)$}, { + GET => { + method => 'fields', + params => sub { + my $value = $_[0]; + my $param = 'names'; + $param = 'ids' if $value =~ /^\d+$/; + return { $param => [ $_[0] ] }; + } + } + }, + qr{^/field/bug/([^/]+)/values$}, { + GET => { + method => 'legal_values', + params => sub { + return { field => $_[0] }; + } + } + }, + qr{^/field/bug/([^/]+)/([^/]+)/values$}, { + GET => { + method => 'legal_values', + params => sub { + return { field => $_[0], + product_id => $_[1] }; + } + } + }, + ]; + return $rest_resources; +} + +1; + +__END__ + +=head1 NAME + +Bugzilla::Webservice::Server::REST::Resources::Bug - The REST API for creating, +changing, and getting the details of bugs. + +=head1 DESCRIPTION + +This part of the Bugzilla REST API allows you to file a new bug in Bugzilla, +or get information about bugs that have already been filed. + +See L<Bugzilla::WebService::Bug> for more details on how to use this part of +the REST API. diff --git a/Bugzilla/WebService/Server/REST/Resources/BugUserLastVisit.pm b/Bugzilla/WebService/Server/REST/Resources/BugUserLastVisit.pm new file mode 100644 index 000000000..8502d6b3b --- /dev/null +++ b/Bugzilla/WebService/Server/REST/Resources/BugUserLastVisit.pm @@ -0,0 +1,52 @@ +# 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::WebService::Server::REST::Resources::BugUserLastVisit; + +use 5.10.1; +use strict; +use warnings; + +BEGIN { + *Bugzilla::WebService::BugUserLastVisit::rest_resources = \&_rest_resources; +} + +sub _rest_resources { + return [ + # bug-id + qr{^/bug_user_last_visit/(\d+)$}, { + GET => { + method => 'get', + params => sub { + return { ids => [$_[0]] }; + }, + }, + POST => { + method => 'update', + params => sub { + return { ids => [$_[0]] }; + }, + }, + }, + ]; +} + +1; +__END__ + +=head1 NAME + +Bugzilla::Webservice::Server::REST::Resources::BugUserLastVisit - The +BugUserLastVisit REST API + +=head1 DESCRIPTION + +This part of the Bugzilla REST API allows you to lookup and update the last time +a user visited a bug. + +See L<Bugzilla::WebService::BugUserLastVisit> for more details on how to use +this part of the REST API. diff --git a/Bugzilla/WebService/Server/REST/Resources/Bugzilla.pm b/Bugzilla/WebService/Server/REST/Resources/Bugzilla.pm new file mode 100644 index 000000000..a8f3f9330 --- /dev/null +++ b/Bugzilla/WebService/Server/REST/Resources/Bugzilla.pm @@ -0,0 +1,70 @@ +# 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::WebService::Server::REST::Resources::Bugzilla; + +use 5.10.1; +use strict; +use warnings; + +use Bugzilla::WebService::Constants; +use Bugzilla::WebService::Bugzilla; + +BEGIN { + *Bugzilla::WebService::Bugzilla::rest_resources = \&_rest_resources; +}; + +sub _rest_resources { + my $rest_resources = [ + qr{^/version$}, { + GET => { + method => 'version' + } + }, + qr{^/extensions$}, { + GET => { + method => 'extensions' + } + }, + qr{^/timezone$}, { + GET => { + method => 'timezone' + } + }, + qr{^/time$}, { + GET => { + method => 'time' + } + }, + qr{^/last_audit_time$}, { + GET => { + method => 'last_audit_time' + } + }, + qr{^/parameters$}, { + GET => { + method => 'parameters' + } + } + ]; + return $rest_resources; +} + +1; + +__END__ + +=head1 NAME + +Bugzilla::WebService::Bugzilla - Global functions for the webservice interface. + +=head1 DESCRIPTION + +This provides functions that tell you about Bugzilla in general. + +See L<Bugzilla::WebService::Bugzilla> for more details on how to use this part +of the REST API. diff --git a/Bugzilla/WebService/Server/REST/Resources/Classification.pm b/Bugzilla/WebService/Server/REST/Resources/Classification.pm new file mode 100644 index 000000000..3f8d32a03 --- /dev/null +++ b/Bugzilla/WebService/Server/REST/Resources/Classification.pm @@ -0,0 +1,50 @@ +# 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::WebService::Server::REST::Resources::Classification; + +use 5.10.1; +use strict; +use warnings; + +use Bugzilla::WebService::Constants; +use Bugzilla::WebService::Classification; + +BEGIN { + *Bugzilla::WebService::Classification::rest_resources = \&_rest_resources; +}; + +sub _rest_resources { + my $rest_resources = [ + qr{^/classification/([^/]+)$}, { + GET => { + method => 'get', + params => sub { + my $param = $_[0] =~ /^\d+$/ ? 'ids' : 'names'; + return { $param => [ $_[0] ] }; + } + } + } + ]; + return $rest_resources; +} + +1; + +__END__ + +=head1 NAME + +Bugzilla::Webservice::Server::REST::Resources::Classification - The Classification REST API + +=head1 DESCRIPTION + +This part of the Bugzilla REST API allows you to deal with the available Classifications. +You will be able to get information about them as well as manipulate them. + +See L<Bugzilla::WebService::Classification> for more details on how to use this part +of the REST API. diff --git a/Bugzilla/WebService/Server/REST/Resources/Component.pm b/Bugzilla/WebService/Server/REST/Resources/Component.pm new file mode 100644 index 000000000..198c09332 --- /dev/null +++ b/Bugzilla/WebService/Server/REST/Resources/Component.pm @@ -0,0 +1,48 @@ +# 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::WebService::Server::REST::Resources::Component; + +use 5.10.1; +use strict; +use warnings; + +use Bugzilla::WebService::Constants; +use Bugzilla::WebService::Component; + +use Bugzilla::Error; + +BEGIN { + *Bugzilla::WebService::Component::rest_resources = \&_rest_resources; +}; + +sub _rest_resources { + my $rest_resources = [ + qr{^/component$}, { + POST => { + method => 'create', + success_code => STATUS_CREATED + } + }, + ]; + return $rest_resources; +} + +1; + +__END__ + +=head1 NAME + +Bugzilla::Webservice::Server::REST::Resources::Component - The Component REST API + +=head1 DESCRIPTION + +This part of the Bugzilla REST API allows you create Components. + +See L<Bugzilla::WebService::Component> for more details on how to use this +part of the REST API. diff --git a/Bugzilla/WebService/Server/REST/Resources/FlagType.pm b/Bugzilla/WebService/Server/REST/Resources/FlagType.pm new file mode 100644 index 000000000..21dad0f73 --- /dev/null +++ b/Bugzilla/WebService/Server/REST/Resources/FlagType.pm @@ -0,0 +1,72 @@ +# 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::WebService::Server::REST::Resources::FlagType; + +use 5.10.1; +use strict; +use warnings; + +use Bugzilla::WebService::Constants; +use Bugzilla::WebService::FlagType; + +use Bugzilla::Error; + +BEGIN { + *Bugzilla::WebService::FlagType::rest_resources = \&_rest_resources; +}; + +sub _rest_resources { + my $rest_resources = [ + qr{^/flag_type$}, { + POST => { + method => 'create', + success_code => STATUS_CREATED + } + }, + qr{^/flag_type/([^/]+)/([^/]+)$}, { + GET => { + method => 'get', + params => sub { + return { product => $_[0], + component => $_[1] }; + } + } + }, + qr{^/flag_type/([^/]+)$}, { + GET => { + method => 'get', + params => sub { + return { product => $_[0] }; + } + }, + PUT => { + method => 'update', + params => sub { + my $param = $_[0] =~ /^\d+$/ ? 'ids' : 'names'; + return { $param => [ $_[0] ] }; + } + } + }, + ]; + return $rest_resources; +} + +1; + +__END__ + +=head1 NAME + +Bugzilla::Webservice::Server::REST::Resources::FlagType - The Flag Type REST API + +=head1 DESCRIPTION + +This part of the Bugzilla REST API allows you to create and update Flag types. + +See L<Bugzilla::WebService::FlagType> for more details on how to use this +part of the REST API. diff --git a/Bugzilla/WebService/Server/REST/Resources/Group.pm b/Bugzilla/WebService/Server/REST/Resources/Group.pm new file mode 100644 index 000000000..b052e384b --- /dev/null +++ b/Bugzilla/WebService/Server/REST/Resources/Group.pm @@ -0,0 +1,60 @@ +# 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::WebService::Server::REST::Resources::Group; + +use 5.10.1; +use strict; +use warnings; + +use Bugzilla::WebService::Constants; +use Bugzilla::WebService::Group; + +BEGIN { + *Bugzilla::WebService::Group::rest_resources = \&_rest_resources; +}; + +sub _rest_resources { + my $rest_resources = [ + qr{^/group$}, { + GET => { + method => 'get' + }, + POST => { + method => 'create', + success_code => STATUS_CREATED + } + }, + qr{^/group/([^/]+)$}, { + PUT => { + method => 'update', + params => sub { + my $param = $_[0] =~ /^\d+$/ ? 'ids' : 'names'; + return { $param => [ $_[0] ] }; + } + } + } + ]; + return $rest_resources; +} + +1; + +__END__ + +=head1 NAME + +Bugzilla::Webservice::Server::REST::Resources::Group - The REST API for +creating, changing, and getting information about Groups. + +=head1 DESCRIPTION + +This part of the Bugzilla REST API allows you to create Groups and +get information about them. + +See L<Bugzilla::WebService::Group> for more details on how to use this part +of the REST API. diff --git a/Bugzilla/WebService/Server/REST/Resources/Product.pm b/Bugzilla/WebService/Server/REST/Resources/Product.pm new file mode 100644 index 000000000..607b94b53 --- /dev/null +++ b/Bugzilla/WebService/Server/REST/Resources/Product.pm @@ -0,0 +1,83 @@ +# 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::WebService::Server::REST::Resources::Product; + +use 5.10.1; +use strict; +use warnings; + +use Bugzilla::WebService::Constants; +use Bugzilla::WebService::Product; + +use Bugzilla::Error; + +BEGIN { + *Bugzilla::WebService::Product::rest_resources = \&_rest_resources; +}; + +sub _rest_resources { + my $rest_resources = [ + qr{^/product_accessible$}, { + GET => { + method => 'get_accessible_products' + } + }, + qr{^/product_enterable$}, { + GET => { + method => 'get_enterable_products' + } + }, + qr{^/product_selectable$}, { + GET => { + method => 'get_selectable_products' + } + }, + qr{^/product$}, { + GET => { + method => 'get' + }, + POST => { + method => 'create', + success_code => STATUS_CREATED + } + }, + qr{^/product/([^/]+)$}, { + GET => { + method => 'get', + params => sub { + my $param = $_[0] =~ /^\d+$/ ? 'ids' : 'names'; + return { $param => [ $_[0] ] }; + } + }, + PUT => { + method => 'update', + params => sub { + my $param = $_[0] =~ /^\d+$/ ? 'ids' : 'names'; + return { $param => [ $_[0] ] }; + } + } + }, + ]; + return $rest_resources; +} + +1; + +__END__ + +=head1 NAME + +Bugzilla::Webservice::Server::REST::Resources::Product - The Product REST API + +=head1 DESCRIPTION + +This part of the Bugzilla REST API allows you to list the available Products and +get information about them. + +See L<Bugzilla::WebService::Product> for more details on how to use this part of +the REST API. diff --git a/Bugzilla/WebService/Server/REST/Resources/User.pm b/Bugzilla/WebService/Server/REST/Resources/User.pm new file mode 100644 index 000000000..a83109e73 --- /dev/null +++ b/Bugzilla/WebService/Server/REST/Resources/User.pm @@ -0,0 +1,81 @@ +# 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::WebService::Server::REST::Resources::User; + +use 5.10.1; +use strict; +use warnings; + +use Bugzilla::WebService::Constants; +use Bugzilla::WebService::User; + +BEGIN { + *Bugzilla::WebService::User::rest_resources = \&_rest_resources; +}; + +sub _rest_resources { + my $rest_resources = [ + qr{^/login$}, { + GET => { + method => 'login' + } + }, + qr{^/logout$}, { + GET => { + method => 'logout' + } + }, + qr{^/valid_login$}, { + GET => { + method => 'valid_login' + } + }, + qr{^/user$}, { + GET => { + method => 'get' + }, + POST => { + method => 'create', + success_code => STATUS_CREATED + } + }, + qr{^/user/([^/]+)$}, { + GET => { + method => 'get', + params => sub { + my $param = $_[0] =~ /^\d+$/ ? 'ids' : 'names'; + return { $param => [ $_[0] ] }; + } + }, + PUT => { + method => 'update', + params => sub { + my $param = $_[0] =~ /^\d+$/ ? 'ids' : 'names'; + return { $param => [ $_[0] ] }; + } + } + } + ]; + return $rest_resources; +} + +1; + +__END__ + +=head1 NAME + +Bugzilla::Webservice::Server::REST::Resources::User - The User Account REST API + +=head1 DESCRIPTION + +This part of the Bugzilla REST API allows you to get User information as well +as create User Accounts. + +See L<Bugzilla::WebService::User> for more details on how to use this part of +the REST API. diff --git a/Bugzilla/WebService/Server/XMLRPC.pm b/Bugzilla/WebService/Server/XMLRPC.pm index 5f9cb4515..98a0ee405 100644 --- a/Bugzilla/WebService/Server/XMLRPC.pm +++ b/Bugzilla/WebService/Server/XMLRPC.pm @@ -7,7 +7,10 @@ package Bugzilla::WebService::Server::XMLRPC; +use 5.10.1; use strict; +use warnings; + use XMLRPC::Transport::HTTP; use Bugzilla::WebService::Server; if ($ENV{MOD_PERL}) { @@ -18,11 +21,12 @@ if ($ENV{MOD_PERL}) { use Bugzilla::WebService::Constants; use Bugzilla::Error; +use Bugzilla::Util; use List::MoreUtils qw(none); -# Allow WebService methods to call XMLRPC::Lite's type method directly BEGIN { + # Allow WebService methods to call XMLRPC::Lite's type method directly *Bugzilla::WebService::type = sub { my ($self, $type, $value) = @_; if ($type eq 'dateTime') { @@ -31,8 +35,19 @@ BEGIN { $value = Bugzilla::WebService::Server->datetime_format_outbound($value); $value =~ s/-//g; } + elsif ($type eq 'email') { + $type = 'string'; + if (Bugzilla->params->{'webservice_email_filter'}) { + $value = email_filter($value); + } + } return XMLRPC::Data->type($type)->value($value); }; + + # Add support for ETags into XMLRPC WebServices + *Bugzilla::WebService::bz_etag = sub { + return Bugzilla::WebService::Server->bz_etag($_[1]); + }; } sub initialize { @@ -46,22 +61,38 @@ sub initialize { sub make_response { my $self = shift; + my $cgi = Bugzilla->cgi; $self->SUPER::make_response(@_); # XMLRPC::Transport::HTTP::CGI doesn't know about Bugzilla carrying around # its cookies in Bugzilla::CGI, so we need to copy them over. - foreach my $cookie (@{Bugzilla->cgi->{'Bugzilla_cookie_list'}}) { + foreach my $cookie (@{$cgi->{'Bugzilla_cookie_list'}}) { $self->response->headers->push_header('Set-Cookie', $cookie); } # Copy across security related headers from Bugzilla::CGI - foreach my $header (split(/[\r\n]+/, Bugzilla->cgi->header)) { + foreach my $header (split(/[\r\n]+/, $cgi->header)) { my ($name, $value) = $header =~ /^([^:]+): (.*)/; if (!$self->response->headers->header($name)) { $self->response->headers->header($name => $value); } } + + # ETag support + my $etag = $self->bz_etag; + if (!$etag) { + my $data = $self->response->as_string; + $etag = $self->bz_etag($data); + } + + if ($etag && $cgi->check_etag($etag)) { + $self->response->headers->push_header('ETag', $etag); + $self->response->headers->push_header('status', '304 Not Modified'); + } + elsif ($etag) { + $self->response->headers->push_header('ETag', $etag); + } } sub handle_login { @@ -85,8 +116,12 @@ sub handle_login { # This exists to validate input parameters (which XMLRPC::Lite doesn't do) # and also, in some cases, to more-usefully decode them. package Bugzilla::XMLRPC::Deserializer; + +use 5.10.1; use strict; -# We can't use "use base" because XMLRPC::Serializer doesn't return +use warnings; + +# We can't use "use parent" because XMLRPC::Serializer doesn't return # a true value. use XMLRPC::Lite; our @ISA = qw(XMLRPC::Deserializer); @@ -96,6 +131,15 @@ use Bugzilla::WebService::Constants qw(XMLRPC_CONTENT_TYPE_WHITELIST); use Bugzilla::WebService::Util qw(fix_credentials); use Scalar::Util qw(tainted); +sub new { + my $self = shift->SUPER::new(@_); + # Initialise XML::Parser to not expand references to entities, to prevent DoS + require XML::Parser; + my $parser = XML::Parser->new( NoExpand => 1, Handlers => { Default => sub {} } ); + $self->{_parser}->parser($parser, $parser); + return $self; +} + sub deserialize { my $self = shift; @@ -123,6 +167,7 @@ sub deserialize { fix_credentials($params); Bugzilla->input_params($params); + return $som; } @@ -186,7 +231,11 @@ sub _validation_subs { 1; package Bugzilla::XMLRPC::SOM; + +use 5.10.1; use strict; +use warnings; + use XMLRPC::Lite; our @ISA = qw(XMLRPC::SOM); use Bugzilla::WebService::Util qw(taint_data); @@ -209,9 +258,13 @@ sub paramsin { # This package exists to fix a UTF-8 bug in SOAP::Lite. # See http://rt.cpan.org/Public/Bug/Display.html?id=32952. package Bugzilla::XMLRPC::Serializer; -use Scalar::Util qw(blessed); + +use 5.10.1; use strict; -# We can't use "use base" because XMLRPC::Serializer doesn't return +use warnings; + +use Scalar::Util qw(blessed reftype); +# We can't use "use parent" because XMLRPC::Serializer doesn't return # a true value. use XMLRPC::Lite; our @ISA = qw(XMLRPC::Serializer); @@ -244,8 +297,8 @@ sub envelope { my $self = shift; my ($type, $method, $data) = @_; # If the type isn't a successful response we don't want to change the values. - if ($type eq 'response'){ - $data = _strip_undefs($data); + if ($type eq 'response') { + _strip_undefs($data); } return $self->SUPER::envelope($type, $method, $data); } @@ -256,7 +309,9 @@ sub envelope { # so it cannot be recursed like the other hash type objects. sub _strip_undefs { my ($initial) = @_; - if (ref $initial eq "HASH" || (blessed $initial && $initial->isa("HASH"))) { + my $type = reftype($initial) or return; + + if ($type eq "HASH") { while (my ($key, $value) = each(%$initial)) { if ( !defined $value || (blessed $value && $value->isa('XMLRPC::Data') && !defined $value->value) ) @@ -265,11 +320,11 @@ sub _strip_undefs { delete $initial->{$key}; } else { - $initial->{$key} = _strip_undefs($value); + _strip_undefs($value); } } } - if (ref $initial eq "ARRAY" || (blessed $initial && $initial->isa("ARRAY"))) { + elsif ($type eq "ARRAY") { for (my $count = 0; $count < scalar @{$initial}; $count++) { my $value = $initial->[$count]; if ( !defined $value @@ -280,11 +335,10 @@ sub _strip_undefs { $count--; } else { - $initial->[$count] = _strip_undefs($value); + _strip_undefs($value); } } } - return $initial; } sub BEGIN { @@ -386,3 +440,15 @@ perl-SOAP-Lite package in versions 0.68-1 and above. =head1 SEE ALSO L<Bugzilla::WebService> + +=head1 B<Methods in need of POD> + +=over + +=item make_response + +=item initialize + +=item handle_login + +=back diff --git a/Bugzilla/WebService/User.pm b/Bugzilla/WebService/User.pm index 5a7f25036..0ae76d70f 100644 --- a/Bugzilla/WebService/User.pm +++ b/Bugzilla/WebService/User.pm @@ -7,20 +7,20 @@ package Bugzilla::WebService::User; +use 5.10.1; use strict; -use base qw(Bugzilla::WebService); +use warnings; + +use parent qw(Bugzilla::WebService); -use Bugzilla; use Bugzilla::Constants; use Bugzilla::Error; use Bugzilla::Group; use Bugzilla::User; use Bugzilla::Util qw(trim detaint_natural); -use Bugzilla::WebService::Util qw(filter validate translate params_to_objects); - -use List::Util qw(min); +use Bugzilla::WebService::Util qw(filter filter_wants validate translate params_to_objects); -use List::Util qw(first); +use List::Util qw(first min); # Don't need auth to login use constant LOGIN_EXEMPT => { @@ -39,20 +39,19 @@ use constant PUBLIC_METHODS => qw( logout offer_account_by_email update + valid_login ); use constant MAPPED_FIELDS => { email => 'login', full_name => 'name', login_denied_text => 'disabledtext', - email_enabled => 'disable_mail' }; use constant MAPPED_RETURNS => { login_name => 'email', realname => 'full_name', disabledtext => 'login_denied_text', - disable_mail => 'email_enabled' }; ############## @@ -83,6 +82,17 @@ sub logout { Bugzilla->logout; } +sub valid_login { + my ($self, $params) = @_; + defined $params->{login} + || ThrowCodeError('param_required', { param => 'login' }); + Bugzilla->login(); + if (Bugzilla->user->id && Bugzilla->user->login eq $params->{login}) { + return $self->type('boolean', 1); + } + return $self->type('boolean', 0); +} + ################# # User Creation # ################# @@ -127,7 +137,7 @@ sub create { # $call = $rpc->call( 'User.get', { ids => [1,2,3], # names => ['testusera@redhat.com', 'testuserb@redhat.com'] }); sub get { - my ($self, $params) = validate(@_, 'names', 'ids'); + my ($self, $params) = validate(@_, 'names', 'ids', 'match', 'group_ids', 'groups'); Bugzilla->switch_to_shadow_db(); @@ -157,11 +167,11 @@ sub get { } my $in_group = $self->_filter_users_by_group( \@user_objects, $params); - @users = map {filter $params, { + @users = map { filter $params, { id => $self->type('int', $_->id), - real_name => $self->type('string', $_->name), - name => $self->type('string', $_->login), - }} @$in_group; + real_name => $self->type('string', $_->name), + name => $self->type('email', $_->login), + } } @$in_group; return { users => \@users }; } @@ -169,7 +179,7 @@ sub get { my $obj_by_ids; $obj_by_ids = Bugzilla::User->new_from_list($params->{ids}) if $params->{ids}; - # obj_by_ids are only visible to the user if he can see + # obj_by_ids are only visible to the user if they can see # the otheruser, for non visible otheruser throw an error foreach my $obj (@$obj_by_ids) { if (Bugzilla->user->can_see_user($obj)){ @@ -207,15 +217,13 @@ sub get { } } - my $in_group = $self->_filter_users_by_group( - \@user_objects, $params); - + my $in_group = $self->_filter_users_by_group(\@user_objects, $params); foreach my $user (@$in_group) { - my $user_info = { + my $user_info = filter $params, { id => $self->type('int', $user->id), real_name => $self->type('string', $user->name), - name => $self->type('string', $user->login), - email => $self->type('string', $user->email), + name => $self->type('email', $user->login), + email => $self->type('email', $user->email), can_login => $self->type('boolean', $user->is_enabled ? 1 : 0), }; @@ -225,18 +233,30 @@ sub get { } if (Bugzilla->user->id == $user->id) { - $user_info->{saved_searches} = [map { $self->_query_to_hash($_) } @{ $user->queries }]; - $user_info->{saved_reports} = [map { $self->_report_to_hash($_) } @{ $user->reports }]; + if (filter_wants($params, 'saved_searches')) { + $user_info->{saved_searches} = [ + map { $self->_query_to_hash($_) } @{ $user->queries } + ]; + } + if (filter_wants($params, 'saved_reports')) { + $user_info->{saved_reports} = [ + map { $self->_report_to_hash($_) } @{ $user->reports } + ]; + } } - if (Bugzilla->user->id == $user->id || Bugzilla->user->in_group('editusers')) { - $user_info->{groups} = [map {$self->_group_to_hash($_)} @{ $user->groups }]; - } - else { - $user_info->{groups} = $self->_filter_bless_groups($user->groups); + if (filter_wants($params, 'groups')) { + if (Bugzilla->user->id == $user->id || Bugzilla->user->in_group('editusers')) { + $user_info->{groups} = [ + map { $self->_group_to_hash($_) } @{ $user->groups } + ]; + } + else { + $user_info->{groups} = $self->_filter_bless_groups($user->groups); + } } - push(@users, filter($params, $user_info)); + push(@users, $user_info); } return { users => \@users }; @@ -296,6 +316,10 @@ sub update { # stays consistent for things that can become empty. $change->[0] = '' if !defined $change->[0]; $change->[1] = '' if !defined $change->[1]; + # We also flatten arrays (used by groups and blessed_groups) + $change->[0] = join(',', @{$change->[0]}) if ref $change->[0]; + $change->[1] = join(',', @{$change->[1]}) if ref $change->[1]; + $hash{changes}{$field} = { removed => $self->type('string', $change->[0]), added => $self->type('string', $change->[1]) @@ -413,11 +437,19 @@ log in/out using an existing account. See L<Bugzilla::WebService> for a description of how parameters are passed, and what B<STABLE>, B<UNSTABLE>, and B<EXPERIMENTAL> mean. +Although the data input and output is the same for JSONRPC, XMLRPC and REST, +the directions for how to access the data via REST is noted in each method +where applicable. + =head1 Logging In and Out +These method are now deprecated, and will be removed in the release after +Bugzilla 5.0. The correct way of use these REST and RPC calls is noted in +L<Bugzilla::WebService> + =head2 login -B<STABLE> +B<DEPRECATED> =over @@ -431,7 +463,7 @@ etc. This method logs in an user. =over -=item C<login> (string) - The user's login name. +=item C<login> (string) - The user's login name. =item C<password> (string) - The user's password. @@ -444,10 +476,10 @@ which called this method. =item B<Returns> On success, a hash containing two items, C<id>, the numeric id of the -user that was logged in, and a C<token> which can be passed in the parameters -as authentication in other calls. The token can be sent along with any future -requests to the webservice, for the duration of the session, i.e. till -L<User.logout|/logout> is called. +user that was logged in, and a C<token> which can be passed in +the parameters as authentication in other calls. The token can be sent +along with any future requests to the webservice, for the duration of the +session, i.e. till L<User.logout|/logout> is called. =item B<Errors> @@ -465,7 +497,7 @@ specified with the error. =item 305 (New Password Required) The current password is correct, but the user is asked to change -his password. +their password. =item 50 (Param Required) @@ -477,12 +509,14 @@ A login or password parameter was not provided. =over -=item C<remember> was removed in Bugzilla B<4.4> as this method no longer +=item C<remember> was removed in Bugzilla B<5.0> as this method no longer creates a login cookie. -=item C<restrict_login> was added in Bugzilla B<4.4>. +=item C<restrict_login> was added in Bugzilla B<5.0>. + +=item C<token> was added in Bugzilla B<4.4.3>. -=item C<token> was added in Bugzilla B<4.4>. +=item This function will be removed in the release after Bugzilla 5.0, in favour of API keys. =back @@ -490,7 +524,7 @@ creates a login cookie. =head2 logout -B<STABLE> +B<DEPRECATED> =over @@ -506,6 +540,52 @@ Log out the user. Does nothing if there is no user logged in. =back +=head2 valid_login + +B<DEPRECATED> + +=over + +=item B<Description> + +This method will verify whether a client's cookies or current login +token is still valid or have expired. A valid username must be provided +as well that matches. + +=item B<Params> + +=over + +=item C<login> + +The login name that matches the provided cookies or token. + +=item C<token> + +(string) Persistent login token current being used for authentication (optional). +Cookies passed by client will be used before the token if both provided. + +=back + +=item B<Returns> + +Returns true/false depending on if the current cookies or token are valid +for the provided username. + +=item B<Errors> (none) + +=item B<History> + +=over + +=item Added in Bugzilla B<5.0>. + +=item This function will be removed in the release after Bugzilla 5.0, in favour of API keys. + +=back + +=back + =head1 Account Creation and Modification =head2 offer_account_by_email @@ -565,6 +645,13 @@ actually receive an email. This function does not check that. You must be logged in and have the C<editusers> privilege in order to call this function. +=item B<REST> + +POST /rest/user + +The params to include in the POST body as well as the returned data format, +are the same as below. + =item B<Params> =over @@ -608,6 +695,8 @@ password is under three characters.) =item Error 503 (Password Too Long) removed in Bugzilla B<3.6>. +=item REST API call added in Bugzilla B<5.0>. + =back =back @@ -622,6 +711,14 @@ B<EXPERIMENTAL> Updates user accounts in Bugzilla. +=item B<REST> + +PUT /rest/user/<user_id_or_name> + +The params to include in the PUT body as well as the returned data format, +are the same as below. The C<ids> and C<names> params are overridden as they +are pulled from the URL path. + =item B<Params> =over @@ -659,6 +756,37 @@ C<string> A text field that holds the reason for disabling a user from logging into bugzilla, if empty then the user account is enabled otherwise it is disabled/closed. +=item C<groups> + +C<hash> These specify the groups that this user is directly a member of. +To set these, you should pass a hash as the value. The hash may contain +the following fields: + +=over + +=item C<add> An array of C<int>s or C<string>s. The group ids or group names +that the user should be added to. + +=item C<remove> An array of C<int>s or C<string>s. The group ids or group names +that the user should be removed from. + +=item C<set> An array of C<int>s or C<string>s. An exact set of group ids +and group names that the user should be a member of. NOTE: This does not +remove groups from the user where the person making the change does not +have the bless privilege for. + +If you specify C<set>, then C<add> and C<remove> will be ignored. A group in +both the C<add> and C<remove> list will be added. Specifying a group that the +user making the change does not have bless rights will generate an error. + +=back + +=item C<bless_groups> + +C<hash> - This is the same as groups, but affects what groups a user +has direct membership to bless that group. It takes the same inputs as +groups. + =back =item B<Returns> @@ -708,6 +836,14 @@ Logged-in users are not authorized to edit other users. =back +=item B<History> + +=over + +=item REST API call added in Bugzilla B<5.0>. + +=back + =back =head1 User Info @@ -722,6 +858,18 @@ B<STABLE> Gets information about user accounts in Bugzilla. +=item B<REST> + +To get information about a single user: + +GET /rest/user/<user_id_or_name> + +To search for users by name, group using URL params same as below: + +GET /rest/user + +The returned data format is the same as below. + =item B<Params> B<Note>: At least one of C<ids>, C<names>, or C<match> must be specified. @@ -832,7 +980,7 @@ disabled/closed. =item groups C<array> An array of group hashes the user is a member of. If the currently -logged in user is querying his own account or is a member of the 'editusers' +logged in user is querying their own account or is a member of the 'editusers' group, the array will contain all the groups that the user is a member of. Otherwise, the array will only contain groups that the logged in user can bless. Each hash describes the group and contains the following items: @@ -916,7 +1064,7 @@ group ID in the C<group_ids> argument. =item 52 (Invalid Parameter) -The value used must be an integer greater then zero. +The value used must be an integer greater than zero. =item 304 (Authorization Required) @@ -952,6 +1100,8 @@ illegal to pass a group name you don't belong to. =item C<groups>, C<saved_searches>, and C<saved_reports> were added in Bugzilla B<4.4>. +=item REST API call added in Bugzilla B<5.0>. + =back =back diff --git a/Bugzilla/WebService/Util.pm b/Bugzilla/WebService/Util.pm index c7d63b336..a0a51a8de 100644 --- a/Bugzilla/WebService/Util.pm +++ b/Bugzilla/WebService/Util.pm @@ -6,14 +6,25 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::WebService::Util; + +use 5.10.1; use strict; -use base qw(Exporter); +use warnings; + +use Bugzilla::Flag; +use Bugzilla::FlagType; +use Bugzilla::Error; + +use Storable qw(dclone); + +use parent qw(Exporter); # We have to "require", not "use" this, because otherwise it tries to # use features of Test::More during import(). require Test::Taint; our @EXPORT_OK = qw( + extract_flags filter filter_wants taint_data @@ -23,19 +34,93 @@ our @EXPORT_OK = qw( fix_credentials ); -sub filter ($$;$) { - my ($params, $hash, $prefix) = @_; +sub extract_flags { + my ($flags, $bug, $attachment) = @_; + my (@new_flags, @old_flags); + + my $flag_types = $attachment ? $attachment->flag_types : $bug->flag_types; + my $current_flags = $attachment ? $attachment->flags : $bug->flags; + + # Copy the user provided $flags as we may call extract_flags more than + # once when editing multiple bugs or attachments. + my $flags_copy = dclone($flags); + + foreach my $flag (@$flags_copy) { + my $id = $flag->{id}; + my $type_id = $flag->{type_id}; + + my $new = delete $flag->{new}; + my $name = delete $flag->{name}; + + if ($id) { + my $flag_obj = grep($id == $_->id, @$current_flags); + $flag_obj || ThrowUserError('object_does_not_exist', + { class => 'Bugzilla::Flag', id => $id }); + } + elsif ($type_id) { + my $type_obj = grep($type_id == $_->id, @$flag_types); + $type_obj || ThrowUserError('object_does_not_exist', + { class => 'Bugzilla::FlagType', id => $type_id }); + if (!$new) { + my @flag_matches = grep($type_id == $_->type->id, @$current_flags); + @flag_matches > 1 && ThrowUserError('flag_not_unique', + { value => $type_id }); + if (!@flag_matches) { + delete $flag->{id}; + } + else { + delete $flag->{type_id}; + $flag->{id} = $flag_matches[0]->id; + } + } + } + elsif ($name) { + my @type_matches = grep($name eq $_->name, @$flag_types); + @type_matches > 1 && ThrowUserError('flag_type_not_unique', + { value => $name }); + @type_matches || ThrowUserError('object_does_not_exist', + { class => 'Bugzilla::FlagType', name => $name }); + if ($new) { + delete $flag->{id}; + $flag->{type_id} = $type_matches[0]->id; + } + else { + my @flag_matches = grep($name eq $_->type->name, @$current_flags); + @flag_matches > 1 && ThrowUserError('flag_not_unique', { value => $name }); + if (@flag_matches) { + $flag->{id} = $flag_matches[0]->id; + } + else { + delete $flag->{id}; + $flag->{type_id} = $type_matches[0]->id; + } + } + } + + if ($flag->{id}) { + push(@old_flags, $flag); + } + else { + push(@new_flags, $flag); + } + } + + return (\@old_flags, \@new_flags); +} + +sub filter($$;$$) { + my ($params, $hash, $types, $prefix) = @_; my %newhash = %$hash; foreach my $key (keys %$hash) { - delete $newhash{$key} if !filter_wants($params, $key, $prefix); + delete $newhash{$key} if !filter_wants($params, $key, $types, $prefix); } return \%newhash; } -sub filter_wants ($$;$) { - my ($params, $field, $prefix) = @_; +sub filter_wants($$;$$) { + my ($params, $field, $types, $prefix) = @_; # Since this is operation is resource intensive, we will cache the results # This assumes that $params->{*_fields} doesn't change between calls @@ -46,28 +131,58 @@ sub filter_wants ($$;$) { return $cache->{$field}; } + # Mimic old behavior if no types provided + my %field_types = map { $_ => 1 } (ref $types ? @$types : ($types || 'default')); + my %include = map { $_ => 1 } @{ $params->{'include_fields'} || [] }; my %exclude = map { $_ => 1 } @{ $params->{'exclude_fields'} || [] }; - my $wants = 1; - if (defined $params->{exclude_fields} && $exclude{$field}) { - $wants = 0; + my %include_types; + my %exclude_types; + + # Only return default fields if nothing is specified + $include_types{default} = 1 if !%include; + + # Look for any field types requested + foreach my $key (keys %include) { + next if $key !~ /^_(.*)$/; + $include_types{$1} = 1; + delete $include{$key}; } - elsif (defined $params->{include_fields} && !$include{$field}) { - if ($prefix) { - # Include the field if the parent is include (and this one is not excluded) - $wants = 0 if !$include{$prefix}; - } - else { - # We want to include this if one of the sub keys is included - my $key = $field . '.'; - my $len = length($key); - $wants = 0 if ! grep { substr($_, 0, $len) eq $key } keys %include; - } + foreach my $key (keys %exclude) { + next if $key !~ /^_(.*)$/; + $exclude_types{$1} = 1; + delete $exclude{$key}; + } + + # Explicit inclusion/exclusion + return $cache->{$field} = 0 if $exclude{$field}; + return $cache->{$field} = 1 if $include{$field}; + + # If the user has asked to include all or exclude all + return $cache->{$field} = 0 if $exclude_types{'all'}; + return $cache->{$field} = 1 if $include_types{'all'}; + + # If the user has not asked for any fields specifically or if the user has asked + # for one or more of the field's types (and not excluded them) + foreach my $type (keys %field_types) { + return $cache->{$field} = 0 if $exclude_types{$type}; + return $cache->{$field} = 1 if $include_types{$type}; } - $cache->{$field} = $wants; - return $wants; + my $wants = 0; + if ($prefix) { + # Include the field if the parent is include (and this one is not excluded) + $wants = 1 if $include{$prefix}; + } + else { + # We want to include this if one of the sub keys is included + my $key = $field . '.'; + my $len = length($key); + $wants = 1 if grep { substr($_, 0, $len) eq $key } keys %include; + } + + return $cache->{$field} = $wants; } sub taint_data { @@ -87,8 +202,9 @@ sub _delete_bad_keys { # Making something a hash key always untaints it, in Perl. # However, we need to validate our argument names in some way. # We know that all hash keys passed in to the WebService will - # match \w+, so we delete any key that doesn't match that. - if ($key !~ /^\w+$/) { + # match \w+, contain '.' or '-', so we delete any key that + # doesn't match that. + if ($key !~ /^[\w\.\-]+$/) { delete $item->{$key}; } } @@ -147,17 +263,25 @@ sub params_to_objects { sub fix_credentials { my ($params) = @_; # Allow user to pass in login=foo&password=bar as a convenience - # even if not calling User.login. We also do not delete them as - # User.login requires "login" and "password". + # even if not calling GET /login. We also do not delete them as + # GET /login requires "login" and "password". if (exists $params->{'login'} && exists $params->{'password'}) { $params->{'Bugzilla_login'} = delete $params->{'login'}; $params->{'Bugzilla_password'} = delete $params->{'password'}; } + # Allow user to pass api_key=12345678 as a convenience which becomes + # "Bugzilla_api_key" which is what the auth code looks for. + if (exists $params->{api_key}) { + $params->{Bugzilla_api_key} = delete $params->{api_key}; + } # Allow user to pass token=12345678 as a convenience which becomes # "Bugzilla_token" which is what the auth code looks for. if (exists $params->{'token'}) { $params->{'Bugzilla_token'} = delete $params->{'token'}; } + + # Allow extensions to modify the credential data before login + Bugzilla::Hook::process('webservice_fix_credentials', { params => $params }); } __END__ @@ -228,3 +352,17 @@ by both "ids" and "names". Returns an arrayref of objects. Allows for certain parameters related to authentication such as Bugzilla_login, Bugzilla_password, and Bugzilla_token to have shorter named equivalents passed in. This function converts the shorter versions to their respective internal names. + +=head2 extract_flags + +Subroutine that takes a list of hashes that are potential flag changes for +both bugs and attachments. Then breaks the list down into two separate lists +based on if the change is to add a new flag or to update an existing flag. + +=head1 B<Methods in need of POD> + +=over + +=item taint_data + +=back diff --git a/Bugzilla/Whine.pm b/Bugzilla/Whine.pm index 379619822..eeaea6da4 100644 --- a/Bugzilla/Whine.pm +++ b/Bugzilla/Whine.pm @@ -5,11 +5,13 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -use strict; - package Bugzilla::Whine; -use base qw(Bugzilla::Object); +use 5.10.1; +use strict; +use warnings; + +use parent qw(Bugzilla::Object); use Bugzilla::Constants; use Bugzilla::Error; diff --git a/Bugzilla/Whine/Query.pm b/Bugzilla/Whine/Query.pm index e52cad66e..b2a2c9e07 100644 --- a/Bugzilla/Whine/Query.pm +++ b/Bugzilla/Whine/Query.pm @@ -7,9 +7,11 @@ package Bugzilla::Whine::Query; +use 5.10.1; use strict; +use warnings; -use base qw(Bugzilla::Object); +use parent qw(Bugzilla::Object); use Bugzilla::Constants; use Bugzilla::Search::Saved; @@ -121,3 +123,11 @@ bugs or one email per bug. The title of this object as it appears in the user forms and emails. =back + +=head1 B<Methods in need of POD> + +=over + +=item eventid + +=back diff --git a/Bugzilla/Whine/Schedule.pm b/Bugzilla/Whine/Schedule.pm index 102b5d825..11f0bf16f 100644 --- a/Bugzilla/Whine/Schedule.pm +++ b/Bugzilla/Whine/Schedule.pm @@ -5,11 +5,13 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -use strict; - package Bugzilla::Whine::Schedule; -use base qw(Bugzilla::Object); +use 5.10.1; +use strict; +use warnings; + +use parent qw(Bugzilla::Object); use Bugzilla::Constants; @@ -155,3 +157,11 @@ the group is still active, otherwise it will contain a single array element for the L<Bugzilla::User> in L</mailto>. =back + +=head1 B<Methods in need of POD> + +=over + +=item eventid + +=back @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,9 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; use lib qw(. lib); @@ -20,16 +22,7 @@ my $user = Bugzilla->login(LOGIN_REQUIRED); print $cgi->header(); -$user->in_group('admin') - || $user->in_group('tweakparams') - || $user->in_group('editusers') - || $user->can_bless - || (Bugzilla->params->{'useclassification'} && $user->in_group('editclassifications')) - || $user->in_group('editcomponents') - || scalar(@{$user->get_products_by_permission('editcomponents')}) - || $user->in_group('creategroups') - || $user->in_group('editkeywords') - || $user->in_group('bz_canusewhines') +$user->can_administer || ThrowUserError('auth_failure', {action => 'access', object => 'administrative_pages'}); $template->process('admin/admin.html.tmpl') diff --git a/attachment.cgi b/attachment.cgi index 5902bcc46..c16e0f012 100755 --- a/attachment.cgi +++ b/attachment.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,12 +6,9 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -################################################################################ -# Script Initialization -################################################################################ - -# Make it harder for us to do dangerous things in Perl. +use 5.10.1; use strict; +use warnings; use lib qw(. lib); @@ -24,11 +21,9 @@ use Bugzilla::FlagType; use Bugzilla::User; use Bugzilla::Util; use Bugzilla::Bug; -use Bugzilla::Field; use Bugzilla::Attachment; use Bugzilla::Attachment::PatchReader; use Bugzilla::Token; -use Bugzilla::Keyword; use Encode qw(encode find_encoding); @@ -40,10 +35,6 @@ local our $cgi = Bugzilla->cgi; local our $template = Bugzilla->template; local our $vars = {}; -################################################################################ -# Main Body Execution -################################################################################ - # All calls to this script should contain an "action" variable whose # value determines what the user wants to do. The code below checks # the value of that variable and runs the appropriate code. If none is @@ -151,7 +142,7 @@ sub validateID { { attach_id => scalar $cgi->param($param) }); # Make sure the attachment exists in the database. - my $attachment = new Bugzilla::Attachment($attach_id) + my $attachment = new Bugzilla::Attachment({ id => $attach_id, cache => 1 }) || ThrowUserError("invalid_attach_id", { attach_id => $attach_id }); return $attachment if ($dont_validate_access || check_can_access($attachment)); @@ -163,7 +154,7 @@ sub check_can_access { my $user = Bugzilla->user; # Make sure the user is authorized to access this attachment's bug. - Bugzilla::Bug->check($attachment->bug_id); + Bugzilla::Bug->check({ id => $attachment->bug_id, cache => 1 }); if ($attachment->isprivate && $user->id != $attachment->attacher->id && !$user->is_insider) { @@ -199,20 +190,6 @@ sub validateFormat { return $format; } -# Validates context of a diff/interdiff. Will throw an error if the context -# is not number, "file" or "patch". Returns the validated, detainted context. -sub validateContext -{ - my $context = $cgi->param('context') || "patch"; - if ($context ne "file" && $context ne "patch") { - my $orig_context = $context; - detaint_natural($context) - || ThrowUserError("invalid_context", { context => $orig_context }); - } - - return $context; -} - # Gets the attachment object(s) generated by validateID, while ensuring # attachbase and token authentication is used when required. sub get_attachment { @@ -401,17 +378,15 @@ sub interdiff { $old_attachment = validateID('oldid'); $new_attachment = validateID('newid'); } - my $context = validateContext(); Bugzilla::Attachment::PatchReader::process_interdiff( - $old_attachment, $new_attachment, $format, $context); + $old_attachment, $new_attachment, $format); } sub diff { # Retrieve and validate parameters my $format = validateFormat('html', 'raw'); my $attachment = $format eq 'raw' ? get_attachment() : validateID(); - my $context = validateContext(); # If it is not a patch, view normally. if (!$attachment->ispatch) { @@ -419,14 +394,14 @@ sub diff { return; } - Bugzilla::Attachment::PatchReader::process_diff($attachment, $format, $context); + Bugzilla::Attachment::PatchReader::process_diff($attachment, $format); } # Display all attachments for a given bug in a series of IFRAMEs within one # HTML page. sub viewall { # Retrieve and validate parameters - my $bug = Bugzilla::Bug->check(scalar $cgi->param('bugid')); + my $bug = Bugzilla::Bug->check({ id => scalar $cgi->param('bugid'), cache => 1 }); my $attachments = Bugzilla::Attachment->get_attachments_by_bug($bug); # Ignore deleted attachments. @@ -557,49 +532,50 @@ sub insert { type => CMT_ATTACHMENT_CREATED, extra_data => $attachment->id }); - # Assign the bug to the user, if they are allowed to take it - my $owner = ""; - if ($cgi->param('takebug') && $user->in_group('editbugs', $bug->product_id)) { - # When taking a bug, we have to follow the workflow. - my $bug_status = $cgi->param('bug_status') || ''; - ($bug_status) = grep {$_->name eq $bug_status} @{$bug->status->can_change_to}; - - if ($bug_status && $bug_status->is_open - && ($bug_status->name ne 'UNCONFIRMED' - || $bug->product_obj->allows_unconfirmed)) - { - $bug->set_bug_status($bug_status->name); - $bug->clear_resolution(); - } - # Make sure the person we are taking the bug from gets mail. - $owner = $bug->assigned_to->login; - $bug->set_assigned_to($user); - } + # Assign the bug to the user, if they are allowed to take it + my $owner = ""; + if ($cgi->param('takebug') && $user->in_group('editbugs', $bug->product_id)) { + # When taking a bug, we have to follow the workflow. + my $bug_status = $cgi->param('bug_status') || ''; + ($bug_status) = grep { $_->name eq $bug_status } + @{ $bug->status->can_change_to }; + + if ($bug_status && $bug_status->is_open + && ($bug_status->name ne 'UNCONFIRMED' + || $bug->product_obj->allows_unconfirmed)) + { + $bug->set_bug_status($bug_status->name); + $bug->clear_resolution(); + } + # Make sure the person we are taking the bug from gets mail. + $owner = $bug->assigned_to->login; + $bug->set_assigned_to($user); + } - $bug->add_cc($user) if $cgi->param('addselfcc'); - $bug->update($timestamp); + $bug->add_cc($user) if $cgi->param('addselfcc'); + $bug->update($timestamp); - # We have to update the attachment after updating the bug, to ensure new - # comments are available. - $attachment->update($timestamp); + # We have to update the attachment after updating the bug, to ensure new + # comments are available. + $attachment->update($timestamp); - $dbh->bz_commit_transaction; + $dbh->bz_commit_transaction; - # Define the variables and functions that will be passed to the UI template. - $vars->{'attachment'} = $attachment; - # We cannot reuse the $bug object as delta_ts has eventually been updated - # since the object was created. - $vars->{'bugs'} = [new Bugzilla::Bug($bugid)]; - $vars->{'header_done'} = 1; - $vars->{'contenttypemethod'} = $cgi->param('contenttypemethod'); + # Define the variables and functions that will be passed to the UI template. + $vars->{'attachment'} = $attachment; + # We cannot reuse the $bug object as delta_ts has eventually been updated + # since the object was created. + $vars->{'bugs'} = [new Bugzilla::Bug($bugid)]; + $vars->{'header_done'} = 1; + $vars->{'contenttypemethod'} = $cgi->param('contenttypemethod'); - my $recipients = { 'changer' => $user, 'owner' => $owner }; - $vars->{'sent_bugmail'} = Bugzilla::BugMail::Send($bugid, $recipients); + my $recipients = { 'changer' => $user, 'owner' => $owner }; + $vars->{'sent_bugmail'} = Bugzilla::BugMail::Send($bugid, $recipients); - print $cgi->header(); - # Generate and return the UI (HTML page) from the appropriate template. - $template->process("attachment/created.html.tmpl", $vars) - || ThrowTemplateError($template->error()); + print $cgi->header(); + # Generate and return the UI (HTML page) from the appropriate template. + $template->process("attachment/created.html.tmpl", $vars) + || ThrowTemplateError($template->error()); } # Displays a form for editing attachment properties. @@ -607,25 +583,25 @@ sub insert { # is private and the user does not belong to the insider group. # Validations are done later when the user submits changes. sub edit { - my $attachment = validateID(); + my $attachment = validateID(); - my $bugattachments = - Bugzilla::Attachment->get_attachments_by_bug($attachment->bug); + my $bugattachments = + Bugzilla::Attachment->get_attachments_by_bug($attachment->bug); - my $any_flags_requesteeble = - grep { $_->is_requestable && $_->is_requesteeble } @{$attachment->flag_types}; - # Useful in case a flagtype is no longer requestable but a requestee - # has been set before we turned off that bit. - $any_flags_requesteeble ||= grep { $_->requestee_id } @{$attachment->flags}; - $vars->{'any_flags_requesteeble'} = $any_flags_requesteeble; - $vars->{'attachment'} = $attachment; - $vars->{'attachments'} = $bugattachments; + my $any_flags_requesteeble = grep { $_->is_requestable && $_->is_requesteeble } + @{ $attachment->flag_types }; + # Useful in case a flagtype is no longer requestable but a requestee + # has been set before we turned off that bit. + $any_flags_requesteeble ||= grep { $_->requestee_id } @{ $attachment->flags }; + $vars->{'any_flags_requesteeble'} = $any_flags_requesteeble; + $vars->{'attachment'} = $attachment; + $vars->{'attachments'} = $bugattachments; - print $cgi->header(); + print $cgi->header(); - # Generate and return the UI (HTML page) from the appropriate template. - $template->process("attachment/edit.html.tmpl", $vars) - || ThrowTemplateError($template->error()); + # Generate and return the UI (HTML page) from the appropriate template. + $template->process("attachment/edit.html.tmpl", $vars) + || ThrowTemplateError($template->error()); } # Updates an attachment record. Only users with "editbugs" privileges, @@ -642,7 +618,7 @@ sub update { my $attachment = validateID(); my $bug = $attachment->bug; $attachment->_check_bug; - my $can_edit = $attachment->validate_can_edit($bug->product_id); + my $can_edit = $attachment->validate_can_edit; if ($can_edit) { $attachment->set_description(scalar $cgi->param('description')); @@ -696,11 +672,33 @@ sub update { $bug->add_cc($user) if $cgi->param('addselfcc'); + my ($flags, $new_flags) = + Bugzilla::Flag->extract_flags_from_cgi($bug, $attachment, $vars); + if ($can_edit) { - my ($flags, $new_flags) = - Bugzilla::Flag->extract_flags_from_cgi($bug, $attachment, $vars); $attachment->set_flags($flags, $new_flags); } + # Requestees can set flags targetted to them, even if they cannot + # edit the attachment. Flag setters can edit their own flags too. + elsif (scalar @$flags) { + my %flag_list = map { $_->{id} => $_ } @$flags; + my $flag_objs = Bugzilla::Flag->new_from_list([keys %flag_list]); + + my @editable_flags; + foreach my $flag_obj (@$flag_objs) { + if ($flag_obj->setter_id == $user->id + || ($flag_obj->requestee_id && $flag_obj->requestee_id == $user->id)) + { + push(@editable_flags, $flag_list{$flag_obj->id}); + } + } + + if (scalar @editable_flags) { + $attachment->set_flags(\@editable_flags, []); + # Flag changes must be committed. + $can_edit = 1; + } + } # Figure out when the changes were made. my $timestamp = $dbh->selectrow_array('SELECT LOCALTIMESTAMP(0)'); diff --git a/buglist.cgi b/buglist.cgi index e3d8fe711..daee34c9b 100755 --- a/buglist.cgi +++ b/buglist.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,12 +6,9 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -################################################################################ -# Script Initialization -################################################################################ - -# Make it harder for us to do dangerous things in Perl. +use 5.10.1; use strict; +use warnings; use lib qw(. lib); @@ -264,10 +261,10 @@ sub GetGroups { my %legal_groups; foreach my $product_name (@$product_names) { - my $product = new Bugzilla::Product({name => $product_name}); + my $product = Bugzilla::Product->new({name => $product_name, cache => 1}); foreach my $gid (keys %{$product->group_controls}) { - # The user can only edit groups he belongs to. + # The user can only edit groups they belong to. next unless $user->in_group_id($gid); # The user has no control on groups marked as NA or MANDATORY. @@ -284,6 +281,37 @@ sub GetGroups { return [values %legal_groups]; } +sub _get_common_flag_types { + my $component_ids = shift; + my $user = Bugzilla->user; + + # Get all the different components in the bug list + my $components = Bugzilla::Component->new_from_list($component_ids); + my %flag_types; + my @flag_types_ids; + foreach my $component (@$components) { + foreach my $flag_type (@{$component->flag_types->{'bug'}}) { + push @flag_types_ids, $flag_type->id; + $flag_types{$flag_type->id} = $flag_type; + } + } + + # We only want flags that appear in all components + my %common_flag_types; + foreach my $id (keys %flag_types) { + my $flag_type_count = scalar grep { $_ == $id } @flag_types_ids; + $common_flag_types{$id} = $flag_types{$id} + if $flag_type_count == scalar @$components; + } + + # We only show flags that a user can request. + my @show_flag_types + = grep { $user->can_request_flag($_) } values %common_flag_types; + my $any_flags_requesteeble = grep { $_->is_requesteeble } @show_flag_types; + + return(\@show_flag_types, $any_flags_requesteeble); +} + ################################################################################ # Command Execution ################################################################################ @@ -311,17 +339,10 @@ $params ||= new Bugzilla::CGI($cgi); # if available. We have to do this now, even though we return HTTP headers # at the end, because the fact that there is a remembered query gets # forgotten in the process of retrieving it. -my @time = localtime(time()); -my $date = sprintf "%04d-%02d-%02d", 1900+$time[5],$time[4]+1,$time[3]; -my $filename = "bugs-$date.$format->{extension}"; +my $disp_prefix = "bugs"; if ($cmdtype eq "dorem" && $remaction =~ /^run/) { - $filename = $cgi->param('namedcmd') . "-$date.$format->{extension}"; - # Remove white-space from the filename so the user cannot tamper - # with the HTTP headers. - $filename =~ s/\s/_/g; + $disp_prefix = $cgi->param('namedcmd'); } -$filename =~ s/\\/\\\\/g; # escape backslashes -$filename =~ s/"/\\"/g; # escape quotes # Take appropriate action based on user's request. if ($cmdtype eq "dorem") { @@ -381,7 +402,7 @@ if ($cmdtype eq "dorem") { ($buffer, $query_id) = LookupNamedQuery(scalar $cgi->param("namedcmd"), $user->id); if ($query_id) { - # Make sure the user really wants to delete his saved search. + # Make sure the user really wants to delete their saved search. my $token = $cgi->param('token'); check_hash_token($token, [$query_id, $qname]); @@ -394,6 +415,7 @@ if ($cmdtype eq "dorem") { $dbh->do('DELETE FROM namedquery_group_map WHERE namedquery_id = ?', undef, $query_id); + Bugzilla->memcached->clear({ table => 'namedqueries', id => $query_id }); } # Now reset the cached queries @@ -509,11 +531,9 @@ else { # Remove the timetracking columns if they are not a part of the group # (happens if a user had access to time tracking and it was revoked/disabled) if (!$user->is_timetracker) { - @displaycolumns = grep($_ ne 'estimated_time', @displaycolumns); - @displaycolumns = grep($_ ne 'remaining_time', @displaycolumns); - @displaycolumns = grep($_ ne 'actual_time', @displaycolumns); - @displaycolumns = grep($_ ne 'percentage_complete', @displaycolumns); - @displaycolumns = grep($_ ne 'deadline', @displaycolumns); + foreach my $tt_field (TIMETRACKING_FIELDS) { + @displaycolumns = grep($_ ne $tt_field, @displaycolumns); + } } # Remove the relevance column if the user is not doing a fulltext search. @@ -521,7 +541,6 @@ if (grep('relevance', @displaycolumns) && !$fulltext) { @displaycolumns = grep($_ ne 'relevance', @displaycolumns); } - ################################################################################ # Select Column Determination ################################################################################ @@ -562,10 +581,14 @@ foreach my $col (@displaycolumns) { # has for modifying the bugs. if ($dotweak) { push(@selectcolumns, "bug_status") if !grep($_ eq 'bug_status', @selectcolumns); + push(@selectcolumns, "bugs.component_id"); } if ($format->{'extension'} eq 'ics') { push(@selectcolumns, "opendate") if !grep($_ eq 'opendate', @selectcolumns); + if (Bugzilla->params->{'timetrackinggroup'}) { + push(@selectcolumns, "deadline") if !grep($_ eq 'deadline', @selectcolumns); + } } if ($format->{'extension'} eq 'atom') { @@ -761,9 +784,11 @@ my $time_info = { 'estimated_time' => 0, 'time_present' => ($estimated_time || $remaining_time || $actual_time || $percentage_complete), }; - + my $bugowners = {}; my $bugproducts = {}; +my $bugcomponentids = {}; +my $bugcomponents = {}; my $bugstatuses = {}; my @bugidlist; @@ -796,6 +821,8 @@ foreach my $row (@$data) { # Record the assignee, product, and status in the big hashes of those things. $bugowners->{$bug->{'assigned_to'}} = 1 if $bug->{'assigned_to'}; $bugproducts->{$bug->{'product'}} = 1 if $bug->{'product'}; + $bugcomponentids->{$bug->{'bugs.component_id'}} = 1 if $bug->{'bugs.component_id'}; + $bugcomponents->{$bug->{'component'}} = 1 if $bug->{'component'}; $bugstatuses->{$bug->{'bug_status'}} = 1 if $bug->{'bug_status'}; $bug->{'secure_mode'} = undef; @@ -859,7 +886,6 @@ else { # remaining_time <= 0 $vars->{'bugs'} = \@bugs; $vars->{'buglist'} = \@bugidlist; -$vars->{'buglist_joined'} = join(',', @bugidlist); $vars->{'columns'} = $columns; $vars->{'displaycolumns'} = \@displaycolumns; @@ -883,7 +909,7 @@ $vars->{'time_info'} = $time_info; if (!$user->in_group('editbugs')) { foreach my $product (keys %$bugproducts) { - my $prod = new Bugzilla::Product({name => $product}); + my $prod = Bugzilla::Product->new({name => $product, cache => 1}); if (!$user->in_group('editbugs', $prod->id)) { $vars->{'caneditbugs'} = 0; last; @@ -903,7 +929,10 @@ if (scalar(@bugowners) > 1 && $user->in_group('editbugs')) { # the list more compact. $vars->{'splitheader'} = $cgi->cookie('SPLITHEADER') ? 1 : 0; -$vars->{'quip'} = GetQuip(); +if ($user->settings->{'display_quips'}->{'value'} eq 'on') { + $vars->{'quip'} = GetQuip(); +} + $vars->{'currenttime'} = localtime(time()); # See if there's only one product in all the results (or only one product @@ -911,12 +940,12 @@ $vars->{'currenttime'} = localtime(time()); my @products = keys %$bugproducts; my $one_product; if (scalar(@products) == 1) { - $one_product = new Bugzilla::Product({ name => $products[0] }); + $one_product = Bugzilla::Product->new({ name => $products[0], cache => 1 }); } # This is used in the "Zarroo Boogs" case. elsif (my @product_input = $cgi->param('product')) { if (scalar(@product_input) == 1 and $product_input[0] ne '') { - $one_product = new Bugzilla::Product({ name => $product_input[0] }); + $one_product = Bugzilla::Product->new({ name => $product_input[0], cache => 1 }); } } # We only want the template to use it if the user can actually @@ -925,6 +954,20 @@ if ($one_product && $user->can_enter_product($one_product)) { $vars->{'one_product'} = $one_product; } +# See if there's only one component in all the results (or only one component +# that we searched for), which allows us to provide more helpful links. +my @components = keys %$bugcomponents; +my $one_component; +if (scalar(@components) == 1) { + $vars->{one_component} = $components[0]; +} +# This is used in the "Zarroo Boogs" case. +elsif (my @component_input = $cgi->param('component')) { + if (scalar(@component_input) == 1 and $component_input[0] ne '') { + $vars->{one_component}= $cgi->param('component'); + } +} + # The following variables are used when the user is making changes to multiple bugs. if ($dotweak && scalar @bugs) { if (!$vars->{'caneditbugs'}) { @@ -946,6 +989,9 @@ if ($dotweak && scalar @bugs) { $vars->{'severities'} = get_legal_field_values('bug_severity'); $vars->{'resolutions'} = get_legal_field_values('resolution'); + ($vars->{'flag_types'}, $vars->{any_flags_requesteeble}) + = _get_common_flag_types([keys %$bugcomponentids]); + # Convert bug statuses to their ID. my @bug_statuses = map {$dbh->quote($_)} keys %$bugstatuses; my $bug_status_ids = @@ -985,10 +1031,47 @@ if ($dotweak && scalar @bugs) { $vars->{'versions'} = [map($_->name, grep($_->is_active, @{ $one_product->versions }))]; $vars->{'components'} = [map($_->name, grep($_->is_active, @{ $one_product->components }))]; if (Bugzilla->params->{'usetargetmilestone'}) { - $vars->{'targetmilestones'} = [map($_->name, grep($_->is_active, + $vars->{'milestones'} = [map($_->name, grep($_->is_active, @{ $one_product->milestones }))]; } } + else { + # We will only show the values at are active in all products. + my %values = (); + my @fields = ('components', 'versions'); + if (Bugzilla->params->{'usetargetmilestone'}) { + push @fields, 'milestones'; + } + + # Go through each product and count the number of times each field + # is used + foreach my $product_name (@products) { + my $product = Bugzilla::Product->new({name => $product_name, cache => 1}); + foreach my $field (@fields) { + my $list = $product->$field; + foreach my $item (@$list) { + ++$values{$field}{$item->name} if $item->is_active; + } + } + } + + # Now we get the list of each field and see which values have + # $product_count (i.e. appears in every product) + my $product_count = scalar(@products); + foreach my $field (@fields) { + my @values = grep { $values{$field}{$_} == $product_count } keys %{$values{$field}}; + if (scalar @values) { + @{$vars->{$field}} = $field eq 'version' + ? sort { vers_cmp(lc($a), lc($b)) } @values + : sort { lc($a) cmp lc($b) } @values + } + + # Do we need to show a warning about limited visiblity? + if (@values != scalar keys %{$values{$field}}) { + $vars->{excluded_values} = 1; + } + } + } } # If we're editing a stored query, use the existing query name as default for @@ -1034,10 +1117,7 @@ if ($format->{'extension'} eq "csv") { $vars->{'human'} = $cgi->param('human'); } -# Suggest a name for the bug list if the user wants to save it as a file. -$disposition .= "; filename=\"$filename\""; - -$cgi->close_standby_message($contenttype, $disposition); +$cgi->close_standby_message($contenttype, $disposition, $disp_prefix, $format->{'extension'}); ################################################################################ # Content Generation @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -27,7 +27,10 @@ # Bonus: # Offer subscription when you get a "series already exists" error? +use 5.10.1; use strict; +use warnings; + use lib qw(. lib); use Bugzilla; @@ -37,7 +40,6 @@ use Bugzilla::Error; use Bugzilla::Util; use Bugzilla::Chart; use Bugzilla::Series; -use Bugzilla::User; use Bugzilla::Token; # For most scripts we don't make $cgi and $template global variables. But @@ -65,7 +67,7 @@ if (grep(/^cmd-/, $cgi->param())) { my $action = $cgi->param('action'); my $series_id = $cgi->param('series_id'); -$vars->{'doc_section'} = 'reporting.html#charts'; +$vars->{'doc_section'} = 'using/reports-and-charts.html#charts'; # Because some actions are chosen by buttons, we can't encode them as the value # of the action param, because that value is localization-dependent. So, we @@ -291,6 +293,7 @@ sub edit { $vars->{'category'} = Bugzilla::Chart::getVisibleSeries(); $vars->{'default'} = $series; + $vars->{'message'} = 'series_updated' if $vars->{'changes_saved'}; print $cgi->header(); $template->process("reports/edit-series.html.tmpl", $vars) diff --git a/checksetup.pl b/checksetup.pl index b2b941d37..cf124b8e2 100755 --- a/checksetup.pl +++ b/checksetup.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl # 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/. @@ -12,8 +12,10 @@ # Initialization ###################################################################### +use 5.10.1; use strict; -use 5.008001; +use warnings; + use File::Basename; BEGIN { chdir dirname($0); } use lib qw(. lib); @@ -108,7 +110,7 @@ my $lc_hash = Bugzilla->localconfig; # At this point, localconfig is defined and is readable. So we know # everything we need to create the DB. We have to create it early, -# because some data required to populate data/params is stored in the DB. +# because some data required to populate data/params.json is stored in the DB. Bugzilla::DB::bz_check_requirements(!$silent); Bugzilla::DB::bz_create_database() if $lc_hash->{'db_check'}; @@ -207,6 +209,9 @@ Bugzilla::Hook::process('install_before_final_checks', { silent => $silent }); # Final checks ########################################################################### +# Clear all keys from Memcached +Bugzilla->memcached->clear_all(); + # Check if the default parameter for urlbase is still set, and if so, give # notification that they should go and visit editparams.cgi if (Bugzilla->params->{'urlbase'} eq '') { @@ -360,7 +365,7 @@ L<Bugzilla::Install::Filesystem/create_htaccess>. =item 9 -Updates the system parameters (stored in F<data/params>), using +Updates the system parameters (stored in F<data/params.json>), using L<Bugzilla::Config/update_params>. =item 10 diff --git a/clean-bug-user-last-visit.pl b/clean-bug-user-last-visit.pl new file mode 100755 index 000000000..57486bfed --- /dev/null +++ b/clean-bug-user-last-visit.pl @@ -0,0 +1,38 @@ +#!/usr/bin/perl +# 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. + +=head1 NAME + +clean-bug-user-last-visit.pl + +=head1 DESCRIPTION + +This utility script cleans out entries from the bug_user_last_visit table that +are older than (a configurable) number of days. + +It takes no arguments and produces no output except in the case of errors. + +=cut + +use 5.10.1; +use strict; +use warnings; +use lib qw(. lib); + +use Bugzilla; +use Bugzilla::Constants; + +Bugzilla->usage_mode(USAGE_MODE_CMDLINE); + +my $dbh = Bugzilla->dbh; +my $sql = 'DELETE FROM bug_user_last_visit WHERE last_visit_ts < ' + . $dbh->sql_date_math('NOW()', + '-', + Bugzilla->params->{last_visit_keep_days}, + 'DAY'); +$dbh->do($sql); diff --git a/colchange.cgi b/colchange.cgi index 835a8ef34..77d9f11ee 100755 --- a/colchange.cgi +++ b/colchange.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,10 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; + use lib qw(. lib); use Bugzilla; @@ -15,7 +18,6 @@ use Bugzilla::Util; use Bugzilla::CGI; use Bugzilla::Search::Saved; use Bugzilla::Error; -use Bugzilla::User; use Bugzilla::Token; use Storable qw(dclone); @@ -26,6 +28,7 @@ use constant COLUMN_PARAMS => { 'usetargetmilestone' => ['target_milestone'], 'useqacontact' => ['qa_contact', 'qa_contact_realname'], 'usestatuswhiteboard' => ['status_whiteboard'], + 'timetrackinggroup' => ['deadline'], }; # We only show these columns if an object of this type exists in the diff --git a/collectstats.pl b/collectstats.pl index d2b6b74d3..339e428bc 100755 --- a/collectstats.pl +++ b/collectstats.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl # 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/. @@ -6,7 +6,10 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; + use lib qw(. lib); use Getopt::Long qw(:config bundling); @@ -37,6 +40,10 @@ $| = 1; my $datadir = bz_locations()->{'datadir'}; my $graphsdir = bz_locations()->{'graphsdir'}; +# We use a dummy product instance with ID 0, representing all products +my $product_all = {id => 0, name => '-All-'}; +bless($product_all, 'Bugzilla::Product'); + # Tidy up after graphing module my $cwd = Cwd::getcwd(); if (chdir($graphsdir)) { @@ -119,7 +126,7 @@ if ($switch{'regenerate'}) { my $tstart = time; my @myproducts = Bugzilla::Product->get_all; -unshift(@myproducts, "-All-"); +unshift(@myproducts, $product_all); my $dir = "$datadir/mining"; if (!-d $dir) { @@ -148,18 +155,8 @@ sub collect_stats { my $product = shift; my $when = localtime (time); my $dbh = Bugzilla->dbh; - my $product_id; - if (ref $product) { - $product_id = $product->id; - $product = $product->name; - } - - # NB: Need to mangle the product for the filename, but use the real - # product name in the query - my $file_product = $product; - $file_product =~ s/\//-/gs; - my $file = join '/', $dir, $file_product; + my $file = join '/', $dir, $product->id; my $exists = -f $file; # if the file exists, get the old status and resolution list for that product. @@ -185,7 +182,7 @@ sub collect_stats { my $status_sql = q{SELECT COUNT(*) FROM bugs WHERE bug_status = ?}; my $reso_sql = q{SELECT COUNT(*) FROM bugs WHERE resolution = ?}; - if ($product ne '-All-') { + if ($product->id) { $status_sql .= q{ AND product_id = ?}; $reso_sql .= q{ AND product_id = ?}; } @@ -196,26 +193,27 @@ sub collect_stats { my @values ; foreach my $status (@statuses) { @values = ($status); - push (@values, $product_id) if ($product ne '-All-'); + push (@values, $product->id) if ($product->id); my $count = $dbh->selectrow_array($sth_status, undef, @values); push(@row, $count); } foreach my $resolution (@resolutions) { @values = ($resolution); - push (@values, $product_id) if ($product ne '-All-'); + push (@values, $product->id) if ($product->id); my $count = $dbh->selectrow_array($sth_reso, undef, @values); push(@row, $count); } if (!$exists || scalar(@data)) { my $fields = join('|', ('DATE', @statuses, @resolutions)); + my $product_name = $product->name; print DATA <<FIN; # Bugzilla Daily Bug Stats # # Do not edit me! This file is generated. # # fields: $fields -# Product: $product +# Product: $product_name # Created: $when FIN } @@ -284,24 +282,14 @@ sub regenerate_stats { my $when = localtime(time()); my $tstart = time(); - # NB: Need to mangle the product for the filename, but use the real - # product name in the query - if (ref $product) { - $product = $product->name; - } - my $file_product = $product; - $file_product =~ s/\//-/gs; - my $file = join '/', $dir, $file_product; + my $file = join '/', $dir, $product->id; my $and_product = ""; - my $from_product = ""; my @values = (); - if ($product ne '-All-') { - $and_product = q{ AND products.name = ?}; - $from_product = q{ INNER JOIN products - ON bugs.product_id = products.id}; - push (@values, $product); + if ($product->id) { + $and_product = q{ AND product_id = ?}; + push (@values, $product->id); } # Determine the start date from the date the first bug in the @@ -311,7 +299,7 @@ sub regenerate_stats { $dbh->sql_to_days('creation_ts') . q{ AS start_day, } . $dbh->sql_to_days('current_date') . q{ AS end_day, } . $dbh->sql_to_days("'1970-01-01'") . - qq{ FROM bugs $from_product + qq{ FROM bugs WHERE } . $dbh->sql_to_days('creation_ts') . qq{ IS NOT NULL $and_product ORDER BY start_day } . $dbh->sql_limit(1); @@ -323,13 +311,14 @@ sub regenerate_stats { if (open DATA, ">", $file) { my $fields = join('|', ('DATE', @statuses, @resolutions)); + my $product_name = $product->name; print DATA <<FIN; # Bugzilla Daily Bug Stats # # Do not edit me! This file is generated. # # fields: $fields -# Product: $product +# Product: $product_name # Created: $when FIN # For each day, generate a line of statistics. @@ -338,12 +327,13 @@ FIN for (my $day = $start + 1; $day <= $end; $day++) { # Some output feedback my $percent_done = ($day - $start - 1) * 100 / $total_days; - printf "\rRegenerating $product \[\%.1f\%\%]", $percent_done; + printf "\rRegenerating %s \[\%.1f\%\%]", $product_name, + $percent_done; # Get a list of bugs that were created the previous day, and # add those bugs to the list of bugs for this product. $query = qq{SELECT bug_id - FROM bugs $from_product + FROM bugs WHERE bugs.creation_ts < } . $dbh->sql_from_days($day - 1) . q{ AND bugs.creation_ts >= } . @@ -386,7 +376,8 @@ FIN # Finish up output feedback for this product. my $tend = time; - say "\rRegenerating $product \[100.0\%] - " . delta_time($tstart, $tend); + say "\rRegenerating " . $product_name . ' [100.0%] - ' . + delta_time($tstart, $tend); close DATA; } diff --git a/config.cgi b/config.cgi index 7dc2e3afb..56a9a3f8a 100755 --- a/config.cgi +++ b/config.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,12 +6,9 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -################################################################################ -# Script Initialization -################################################################################ - -# Make it harder for us to do dangerous things in Perl. +use 5.10.1; use strict; +use warnings; use lib qw(. lib); @@ -105,7 +102,9 @@ $vars->{'closed_status'} = \@closed_status; my @fields = @{Bugzilla::Field->match({obsolete => 0})}; # Exclude fields the user cannot query. if (!$user->is_timetracker) { - @fields = grep { $_->name !~ /^(estimated_time|remaining_time|work_time|percentage_complete|deadline)$/ } @fields; + foreach my $tt_field (TIMETRACKING_FIELDS) { + @fields = grep { $_->name ne $tt_field } @fields; + } } my %FIELD_PARAMS = ( @@ -145,7 +144,11 @@ sub display_data { utf8::encode($digest_data) if utf8::is_utf8($digest_data); my $digest = md5_base64($digest_data); - $cgi->check_etag($digest); + if ($cgi->check_etag($digest)) { + print $cgi->header(-ETag => $digest, + -status => '304 Not Modified'); + exit; + } print $cgi->header (-ETag => $digest, -type => $format->{'ctype'}); diff --git a/contrib/Bugzilla.pm b/contrib/Bugzilla.pm index 6bfc07e2a..31e0a0f6d 100644 --- a/contrib/Bugzilla.pm +++ b/contrib/Bugzilla.pm @@ -4,7 +4,9 @@ package Bugzilla; +use 5.10.1; use strict; +use warnings; ####################################################################### # The goal of this tiny module is to let Bugzilla packagers of # diff --git a/contrib/README b/contrib/README index f4e40e4a3..f82062925 100644 --- a/contrib/README +++ b/contrib/README @@ -20,10 +20,6 @@ bz_webservice_demo.pl -- An example script that demonstrates how to talk to cmdline/ -- Various commands for querying your Bugzilla installation. - cvs-update.pl -- Script to keep a record of all CVS updates made - from a given directory. The log is useful when - changes need to be backed out. - jb2bz.py -- Script to import bugs from JitterBug to Bugzilla. merge-users.pl -- Script to merge two user accounts. The activities diff --git a/contrib/bz_webservice_demo.pl b/contrib/bz_webservice_demo.pl index 8850d642a..6c8c21dfa 100755 --- a/contrib/bz_webservice_demo.pl +++ b/contrib/bz_webservice_demo.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl # 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/. @@ -18,7 +18,10 @@ C<bz_webservice_demo.pl --help> for detailed help =cut +use 5.10.1; use strict; +use warnings; + use lib qw(lib); use Getopt::Long; use Pod::Usage; @@ -256,8 +259,6 @@ if ($fetch_extension_info) { Call C<Bug.get> with the ID of the bug you want to know more of. The call will return a C<Bugzilla::Bug> object. -Note: You can also use "Bug.get_bugs" for compatibility with Bugzilla 3.0 API. - =cut if ($bug_id) { diff --git a/contrib/bzdbcopy.pl b/contrib/bzdbcopy.pl index f50002e85..fcdbefd56 100755 --- a/contrib/bzdbcopy.pl +++ b/contrib/bzdbcopy.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl # 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/. @@ -6,7 +6,10 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; + use lib qw(. lib); use Bugzilla; use Bugzilla::Constants; diff --git a/contrib/console.pl b/contrib/console.pl index dbd514ebd..fe2342cd9 100755 --- a/contrib/console.pl +++ b/contrib/console.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl # 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/. @@ -6,6 +6,8 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use warnings; + use File::Basename; BEGIN { chdir dirname($0) . "/.."; } use lib qw(. lib); @@ -51,7 +53,7 @@ sub d { # p: print as a single string (normal behavior puts list items on separate lines) sub p { - local $^W=0; # suppress possible undefined var message + no warnings; # suppress possible undefined var message print(@_, "\n"); return (); } diff --git a/contrib/convert-workflow.pl b/contrib/convert-workflow.pl index fdcab977f..d9bffb7bb 100755 --- a/contrib/convert-workflow.pl +++ b/contrib/convert-workflow.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl # 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/. @@ -6,7 +6,10 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; + use lib qw(. lib); use Bugzilla; @@ -151,6 +154,7 @@ if ($enable_unconfirmed) { $dbh->do('UPDATE products SET allows_unconfirmed = 1'); } $dbh->bz_commit_transaction(); +Bugzilla->memcached->clear_all(); print <<END; Done. There are some things you may want to fix, now: diff --git a/contrib/cvs-update.pl b/contrib/cvs-update.pl deleted file mode 100755 index 773019efd..000000000 --- a/contrib/cvs-update.pl +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/perl -w -# 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. - -# Keep a record of all cvs updates made from a given directory. -# -# Later, if changes need to be backed out, look at the log file -# and run the cvs command with the date that you want to back -# out to. (Probably the second to last entry). - -# Because this script lives in contrib, you may want to -# ln -s contrib/cvs-update.pl cvs-update.pl -# from your bugzilla install directory so you can run -# the script easily from there (./cvs-update.pl) - -#DATE=`date +%e/%m/%Y\ %k:%M:%S\ %Z` - -my ($second, $minute, $hour, $day, $month, $year) = gmtime; -my $date = sprintf("%04d-%02d-%02d %d:%02d:%02dZ", - $year+1900, $month+1, $day, $hour, $minute, $second); -my $cmd = "cvs -q update -dP"; -open LOG, ">>cvs-update.log" or die("Couldn't open cvs update log!"); -print LOG "$cmd -D \"$date\"\n"; -close LOG; -system("$cmd -A"); - -# sample log file -#cvs update -P -D "11/04/2000 20:22:08 PDT" -#cvs update -P -D "11/05/2000 20:22:22 PDT" -#cvs update -P -D "11/07/2000 20:26:29 PDT" -#cvs update -P -D "11/08/2000 20:27:10 PDT" diff --git a/contrib/extension-convert.pl b/contrib/extension-convert.pl index 457f40f07..91a77b839 100755 --- a/contrib/extension-convert.pl +++ b/contrib/extension-convert.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl # 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/. @@ -6,8 +6,10 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; use warnings; + use lib qw(. lib); use Bugzilla; @@ -68,6 +70,8 @@ my ($modules, $subs) = code_files_to_subroutines($to_dir); my $config_pm = <<END; package Bugzilla::Extension::$extension_name; use strict; +use warnings; + use constant NAME => '$extension_name'; $install_requirements __PACKAGE__->NAME; @@ -76,7 +80,9 @@ END my $extension_pm = <<END; package Bugzilla::Extension::$extension_name; use strict; -use base qw(Bugzilla::Extension); +use warnings; + +use parent qw(Bugzilla::Extension); $modules diff --git a/contrib/fixperms.pl b/contrib/fixperms.pl index b9ac2059c..33b042c66 100755 --- a/contrib/fixperms.pl +++ b/contrib/fixperms.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl # 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/. @@ -6,8 +6,10 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; use warnings; + use lib qw(. lib); use Bugzilla; diff --git a/contrib/merge-users.pl b/contrib/merge-users.pl index 19cb8d4c9..86b209ab2 100755 --- a/contrib/merge-users.pl +++ b/contrib/merge-users.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,9 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; =head1 NAME @@ -145,6 +147,25 @@ $dbh->bz_start_transaction(); $dbh->do('DELETE FROM logincookies WHERE userid = ?', undef, $old_id); $dbh->do('DELETE FROM tokens WHERE userid = ?', undef, $old_id); +# Special care needs to be done with bug_user_last_visit table as the +# source user and destination user may have visited the same bug id at one time. +# In this case we remove the one with the oldest timestamp. +my $dupe_ids = $dbh->selectcol_arrayref(" + SELECT earlier.id + FROM bug_user_last_visit as earlier + INNER JOIN bug_user_last_visit as later + ON (earlier.user_id != later.user_id + AND earlier.last_visit_ts < later.last_visit_ts + AND earlier.bug_id = later.bug_id) + WHERE (earlier.user_id = ? OR earlier.user_id = ?) + AND (later.user_id = ? OR later.user_id = ?)", + undef, $old_id, $new_id, $old_id, $new_id); + +if (@$dupe_ids) { + $dbh->do("DELETE FROM bug_user_last_visit WHERE " . + $dbh->sql_in('id', $dupe_ids)); +} + # Migrate records from old user to new user. foreach my $table (keys %changes) { foreach my $column_list (@{ $changes{$table} }) { @@ -222,4 +243,9 @@ $user->derive_regexp_groups(); # Commit the transaction $dbh->bz_commit_transaction(); +# It's complex to determine which items now need to be flushed from memcached. +# As user merge is expected to be a rare event, we just flush the entire cache +# when users are merged. +Bugzilla->memcached->clear_all(); + print "Done.\n"; diff --git a/contrib/mysqld-watcher.pl b/contrib/mysqld-watcher.pl index 08a87b5fe..be93dcbb5 100755 --- a/contrib/mysqld-watcher.pl +++ b/contrib/mysqld-watcher.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl # 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/. @@ -9,7 +9,9 @@ # mysqld-watcher.pl - a script that watches the running instance of # mysqld and kills off any long-running SELECTs against the shadow_db # +use 5.10.1; use strict; +use warnings; # some configurables: diff --git a/contrib/recode.pl b/contrib/recode.pl index de204f155..e6da47b92 100755 --- a/contrib/recode.pl +++ b/contrib/recode.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl # 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/. @@ -6,7 +6,10 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; + use lib qw(. lib); use Bugzilla; diff --git a/contrib/sendbugmail.pl b/contrib/sendbugmail.pl index c015810b0..223d91f6c 100755 --- a/contrib/sendbugmail.pl +++ b/contrib/sendbugmail.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl -T # 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/. @@ -6,6 +6,10 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; +use strict; +use warnings; + use lib qw(. lib); use Bugzilla; @@ -16,7 +20,7 @@ use Bugzilla::User; my $dbh = Bugzilla->dbh; sub usage { - print STDERR "Usage: $0 bug_id user_email\n"; + say STDERR "Usage: $0 bug_id user_email"; exit; } @@ -30,7 +34,7 @@ my $changer = $ARGV[1]; # Validate the bug number. if (!($bugnum =~ /^(\d+)$/)) { - print STDERR "Bug number \"$bugnum\" not numeric.\n"; + say STDERR "Bug number \"$bugnum\" not numeric."; usage(); } @@ -40,19 +44,19 @@ my ($id) = $dbh->selectrow_array("SELECT bug_id FROM bugs WHERE bug_id = ?", undef, $bugnum); if (!$id) { - print STDERR "Bug number $bugnum does not exist.\n"; + say STDERR "Bug number $bugnum does not exist."; usage(); } # Validate the changer address. my $match = Bugzilla->params->{'emailregexp'}; if ($changer !~ /$match/) { - print STDERR "Changer \"$changer\" doesn't match email regular expression.\n"; + say STDERR "Changer \"$changer\" doesn't match email regular expression."; usage(); } my $changer_user = new Bugzilla::User({ name => $changer }); unless ($changer_user) { - print STDERR "\"$changer\" is not a valid user.\n"; + say STDERR "\"$changer\" is not a valid user."; usage(); } @@ -61,26 +65,15 @@ my $outputref = Bugzilla::BugMail::Send($bugnum, {'changer' => $changer_user }); # Report the results. my $sent = scalar(@{$outputref->{sent}}); -my $excluded = scalar(@{$outputref->{excluded}}); if ($sent) { - print "email sent to $sent recipients:\n"; + say "email sent to $sent recipients:"; } else { - print "No email sent.\n"; + say "No email sent."; } foreach my $sent (@{$outputref->{sent}}) { - print " $sent\n"; -} - -if ($excluded) { - print "$excluded recipients excluded:\n"; -} else { - print "No recipients excluded.\n"; -} - -foreach my $excluded (@{$outputref->{excluded}}) { - print " $excluded\n"; + say " $sent"; } # This document is copyright (C) 2004 Perforce Software, Inc. All rights diff --git a/contrib/sendunsentbugmail.pl b/contrib/sendunsentbugmail.pl index 46105776f..b9034aa8d 100755 --- a/contrib/sendunsentbugmail.pl +++ b/contrib/sendunsentbugmail.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,9 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; use lib qw(. lib); @@ -24,28 +26,21 @@ my $list = $dbh->selectcol_arrayref( ' ORDER BY bug_id'); if (scalar(@$list) > 0) { - print "OK, now attempting to send unsent mail\n"; - print scalar(@$list) . " bugs found with possibly unsent mail.\n\n"; + say "OK, now attempting to send unsent mail"; + say scalar(@$list) . " bugs found with possibly unsent mail.\n"; foreach my $bugid (@$list) { my $start_time = time; - print "Sending mail for bug $bugid...\n"; + say "Sending mail for bug $bugid..."; my $outputref = Bugzilla::BugMail::Send($bugid); if ($ARGV[0] && $ARGV[0] eq "--report") { - print "Mail sent to:\n"; - foreach (sort @{$outputref->{sent}}) { - print $_ . "\n"; - } - - print "Excluded:\n"; - foreach (sort @{$outputref->{excluded}}) { - print $_ . "\n"; - } + say "Mail sent to:"; + say $_ foreach (sort @{$outputref->{sent}}); } else { - my ($sent, $excluded) = (scalar(@{$outputref->{sent}}),scalar(@{$outputref->{excluded}})); - print "$sent mails sent, $excluded people excluded.\n"; - print "Took " . (time - $start_time) . " seconds.\n\n"; - } + my $sent = scalar @{$outputref->{sent}}; + say "$sent mails sent."; + say "Took " . (time - $start_time) . " seconds.\n"; + } } - print "Unsent mail has been sent.\n"; + say "Unsent mail has been sent."; } diff --git a/contrib/syncLDAP.pl b/contrib/syncLDAP.pl index 6ad96477b..f618624ec 100755 --- a/contrib/syncLDAP.pl +++ b/contrib/syncLDAP.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,9 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; use lib qw(. lib); diff --git a/createaccount.cgi b/createaccount.cgi index e3b83205b..a15396384 100755 --- a/createaccount.cgi +++ b/createaccount.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,9 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; use lib qw(. lib); @@ -21,7 +23,7 @@ use Bugzilla::Token; my $user = Bugzilla->login(LOGIN_OPTIONAL); my $cgi = Bugzilla->cgi; my $template = Bugzilla->template; -my $vars = { doc_section => 'myaccount.html' }; +my $vars = { doc_section => 'using/creating-an-account.html' }; print $cgi->header(); diff --git a/describecomponents.cgi b/describecomponents.cgi index 3a70f29bb..f74dc75f4 100755 --- a/describecomponents.cgi +++ b/describecomponents.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,10 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; + use lib qw(. lib); use Bugzilla; @@ -39,7 +42,7 @@ unless ($product && $user->can_access_product($product->name)) { # If there is only one product available but the user entered # another product name, we display a list with this single # product only, to not confuse the user with components of a - # product he didn't request. + # product they didn't request. elsif (scalar(@products) > 1 || $product_name) { $vars->{'classifications'} = sort_products_by_classification(\@products); $vars->{'target'} = "describecomponents.cgi"; diff --git a/describekeywords.cgi b/describekeywords.cgi index b67b9c3d9..31bf0c13e 100755 --- a/describekeywords.cgi +++ b/describekeywords.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,12 +6,14 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; + use lib qw(. lib); use Bugzilla; use Bugzilla::Error; -use Bugzilla::User; use Bugzilla::Keyword; my $user = Bugzilla->login(); @@ -24,7 +26,9 @@ my $vars = {}; Bugzilla->switch_to_shadow_db; $vars->{'keywords'} = Bugzilla::Keyword->get_all_with_bug_count(); -$vars->{'caneditkeywords'} = $user->in_group("editkeywords"); +if (!@{$vars->{keywords}}) { + ThrowUserError("no_keywords"); +} print $cgi->header(); $template->process("reports/keywords.html.tmpl", $vars) diff --git a/docs/TODO b/docs/TODO new file mode 100644 index 000000000..25d5e2a7b --- /dev/null +++ b/docs/TODO @@ -0,0 +1,16 @@ +RST files: + +* Produce simple style guide and canonicalise usages to follow it +* Get rid of, or use proper Sphinx markup for, glossary + +HTML Output: + +* Styling for Cautions and Tips +* Stop replacement of "--" with em-dash +* Auto-highlighter thinks # in "bash#" is a comment char +* Style definition lists to have the term in bold +* Fix bug lifecycle image original doc link + +Topics to cover: + +* email_in.pl diff --git a/docs/bugzilla.ent.tmpl b/docs/bugzilla.ent.tmpl deleted file mode 100644 index 20259c5be..000000000 --- a/docs/bugzilla.ent.tmpl +++ /dev/null @@ -1,7 +0,0 @@ -<!ENTITY bz-ver "4.4.9"> -<!ENTITY bz-date "2015-04-15"> -<!ENTITY current-year "2015"> - -<!ENTITY min-perl-ver "5.8.1"> -<!ENTITY landfillbase "http://landfill.bugzilla.org/bugzilla-4.4-branch/"> -<!ENTITY bzg-bugs "http://bugzilla.mozilla.org/enter_bug.cgi?product=Bugzilla;component=Documentation"> diff --git a/docs/en/Makefile b/docs/en/Makefile new file mode 100644 index 000000000..fc9af11e0 --- /dev/null +++ b/docs/en/Makefile @@ -0,0 +1,158 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = . + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) rst +# the i18n builder cannot share the environment and doctrees with the others +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) rst + +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext + +help: + @echo "Please use \`make <target>' where <target> is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " texinfo to make Texinfo files" + @echo " info to make Texinfo files and run them through makeinfo" + @echo " gettext to make PO message catalogs" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + +clean: + -rm -rf $(BUILDDIR)/* + +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Bugzilla.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Bugzilla.qhc" + +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/Bugzilla" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Bugzilla" + @echo "# devhelp" + +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' to have that step done automatically)." + +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/pdf + @echo "Running LaTeX files through pdflatex..." + $(MAKE) -C $(BUILDDIR)/pdf all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/pdf." + +pdf: + $(SPHINXBUILD) -b pdf -t enable_rst2pdf $(ALLSPHINXOPTS) $(BUILDDIR)/pdf + @echo + @echo "Build finished. The PDF file is in $(BUILDDIR)/pdf." + +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/txt + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/txt." + +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +texinfo: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo" \ + "(use \`make info' here to do that automatically)." + +info: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo "Running Texinfo files through makeinfo..." + make -C $(BUILDDIR)/texinfo info + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." + +gettext: + $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale + @echo + @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." + +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." diff --git a/docs/en/README.docs b/docs/en/README.docs deleted file mode 100644 index f041ef044..000000000 --- a/docs/en/README.docs +++ /dev/null @@ -1,42 +0,0 @@ -Welcome to the Bugzilla documentation project! -You'll find these directories and files here: - -README.docs # This README file -html/ # The compiled HTML docs from XML sources (do not edit) -txt/ # The compiled text docs from XML sources (do not edit) -pdf/ # The compiled PDF docs from XML sources (do not edit) -xml/ # The original XML doc sources (edit these) - -A note about the XML: - The documentation is written in DocBook 4.2, and attempts to adhere -to the LinuxDoc standards where applicable (http://www.tldp.org). -If you need to edit the documentation, feel free to use any text editor -to make the changes. XML is not rocket science -- simply make sure your -text appears between appropriate tags (like <para>This is a paragraph</para>) -and we'll be fine. If you are making more extensive changes, please ensure -you at least validate your XML before checking it in by running makedocs.pl. - - Thanks for taking the time to read these notes and consulting the -documentation. Please address comments and questions to the newsgroup: -news://news.mozilla.org/mozilla.support.bugzilla. - -========== -HOW TO SET UP YOUR OWN XML EDITING ENVIRONMENT: -========== - -All you need to compile the documentation are the xmlto and dblatex -scripts. All major Linux distributions have these packages and so -it's very easy to install them. If these packages are correctly configured, -all required dependencies such as xsltproc and pdftex will be installed -at the same time, and so you don't have to worry about them. - -Once these applications are installed, all you need to do to compile -the documentation is to run either: - - makedocs.pl - -to compile the documentation in HTML and text formats only, or: - - makedocs.pl --with-pdf - -to also compile the documentation in PDF format. diff --git a/docs/en/images/bugzilla.png b/docs/en/images/bugzilla.png Binary files differnew file mode 100644 index 000000000..eb973b43e --- /dev/null +++ b/docs/en/images/bugzilla.png diff --git a/docs/en/images/callouts/1.gif b/docs/en/images/callouts/1.gif Binary files differdeleted file mode 100644 index 79fd388a8..000000000 --- a/docs/en/images/callouts/1.gif +++ /dev/null diff --git a/docs/en/images/callouts/2.gif b/docs/en/images/callouts/2.gif Binary files differdeleted file mode 100644 index b9be050e4..000000000 --- a/docs/en/images/callouts/2.gif +++ /dev/null diff --git a/docs/en/images/callouts/3.gif b/docs/en/images/callouts/3.gif Binary files differdeleted file mode 100644 index 73635e3f7..000000000 --- a/docs/en/images/callouts/3.gif +++ /dev/null diff --git a/docs/en/images/caution.gif b/docs/en/images/caution.gif Binary files differdeleted file mode 100644 index a48223013..000000000 --- a/docs/en/images/caution.gif +++ /dev/null diff --git a/docs/en/images/note.gif b/docs/en/images/note.gif Binary files differdeleted file mode 100644 index 613bc7f70..000000000 --- a/docs/en/images/note.gif +++ /dev/null diff --git a/docs/en/images/tip.gif b/docs/en/images/tip.gif Binary files differdeleted file mode 100644 index c8d5ae9bd..000000000 --- a/docs/en/images/tip.gif +++ /dev/null diff --git a/docs/en/images/warning.gif b/docs/en/images/warning.gif Binary files differdeleted file mode 100644 index 693ffc3e8..000000000 --- a/docs/en/images/warning.gif +++ /dev/null diff --git a/docs/en/make.bat b/docs/en/make.bat new file mode 100644 index 000000000..c12f0a720 --- /dev/null +++ b/docs/en/make.bat @@ -0,0 +1,197 @@ +@ECHO OFF + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set BUILDDIR=. +set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% rst +set I18NSPHINXOPTS=%SPHINXOPTS% rst +if NOT "%PAPER%" == "" ( + set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% + set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% +) + +if "%1" == "" goto help + +if "%1" == "help" ( + :help + echo.Please use `make ^<target^>` where ^<target^> is one of + echo. html to make standalone HTML files + echo. dirhtml to make HTML files named index.html in directories + echo. singlehtml to make a single large HTML file + echo. pickle to make pickle files + echo. json to make JSON files + echo. htmlhelp to make HTML files and a HTML help project + echo. qthelp to make HTML files and a qthelp project + echo. devhelp to make HTML files and a Devhelp project + echo. epub to make an epub + echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter + echo. text to make text files + echo. man to make manual pages + echo. texinfo to make Texinfo files + echo. gettext to make PO message catalogs + echo. changes to make an overview over all changed/added/deprecated items + echo. linkcheck to check all external links for integrity + echo. doctest to run all doctests embedded in the documentation if enabled + goto end +) + +if "%1" == "clean" ( + for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i + del /q /s %BUILDDIR%\* + goto end +) + +if "%1" == "html" ( + %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/html. + goto end +) + +if "%1" == "dirhtml" ( + %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. + goto end +) + +if "%1" == "singlehtml" ( + %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. + goto end +) + +if "%1" == "pickle" ( + %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the pickle files. + goto end +) + +if "%1" == "json" ( + %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can process the JSON files. + goto end +) + +if "%1" == "htmlhelp" ( + %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run HTML Help Workshop with the ^ +.hhp project file in %BUILDDIR%/htmlhelp. + goto end +) + +if "%1" == "qthelp" ( + %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; now you can run "qcollectiongenerator" with the ^ +.qhcp project file in %BUILDDIR%/qthelp, like this: + echo.^> qcollectiongenerator %BUILDDIR%\qthelp\Bugzilla.qhcp + echo.To view the help file: + echo.^> assistant -collectionFile %BUILDDIR%\qthelp\Bugzilla.ghc + goto end +) + +if "%1" == "devhelp" ( + %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. + goto end +) + +if "%1" == "epub" ( + %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The epub file is in %BUILDDIR%/epub. + goto end +) + +if "%1" == "latex" ( + %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex + if errorlevel 1 exit /b 1 + echo. + echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. + goto end +) + +if "%1" == "text" ( + %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/txt + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The text files are in %BUILDDIR%/txt. + goto end +) + +if "%1" == "man" ( + %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The manual pages are in %BUILDDIR%/man. + goto end +) + +if "%1" == "texinfo" ( + %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. + goto end +) + +if "%1" == "gettext" ( + %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale + if errorlevel 1 exit /b 1 + echo. + echo.Build finished. The message catalogs are in %BUILDDIR%/locale. + goto end +) + +if "%1" == "changes" ( + %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes + if errorlevel 1 exit /b 1 + echo. + echo.The overview file is in %BUILDDIR%/changes. + goto end +) + +if "%1" == "linkcheck" ( + %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck + if errorlevel 1 exit /b 1 + echo. + echo.Link check complete; look for any errors in the above output ^ +or in %BUILDDIR%/linkcheck/output.txt. + goto end +) + +if "%1" == "doctest" ( + %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest + if errorlevel 1 exit /b 1 + echo. + echo.Testing of doctests in the sources finished, look at the ^ +results in %BUILDDIR%/doctest/output.txt. + goto end +) + +if "%1" == "pdf" ( + %SPHINXBUILD% -b pdf -t enable_rst2pdf %ALLSPHINXOPTS% %BUILDDIR%/pdf + echo. + echo.Build finished. The PDF file is in %BUILDDIR%/pdf + goto end +) + +:end diff --git a/docs/en/rel_notes.txt b/docs/en/rel_notes.txt deleted file mode 100644 index 4014951f0..000000000 --- a/docs/en/rel_notes.txt +++ /dev/null @@ -1,3028 +0,0 @@ -Release Notes for Bugzilla version 3.0 and higher are available in HTML -format, either on the bugzilla.org website, or in your current installation, -linked from the index page. - -bugzilla.org links for release notes ------------------------------------- -3.0.2: http://www.bugzilla.org/releases/3.0.2/release-notes.html - -*************************************** -*** The Bugzilla 2.22 Release Notes *** -*************************************** - -Table of Contents -***************** - -- Introduction -- Important Updates In This Point Release -- Minimum Requirements - * Perl - * For MySQL Users - * For PostgreSQL Users - * Required Perl Modules - * Optional Perl Modules -- What's New? - * Complete PostgreSQL Support - * Parameters In Sections - * One Codebase, Multiple Databases - * UTF-8 for New Installations - * Admins Can Impersonate Users - * Bug Import and Moving Improvements - * Adding Individual Bugs to Saved Searches - * Attach URLs - * Optional "Strict Isolation" for Groups - * "editcomponents" Change - * "shutdownhtml" Change - * Miscellaneous Improvements - * All Changes -- Deprecated Features -- Outstanding Issues (<======================== IMPORTANT, PLEASE READ) -- How to Upgrade From An Older Bugzilla - * Steps for Upgrading -- Code Changes Which May Affect Customizations - * CGI.pl is Gone - * Other Changes -- Security Fixes In 2.22 Releases -- Release Notes for Previous Versions - -Introduction -************ -Bugzilla 2.22 is one of our most polished releases. We did a lot of -small cleanups to make Bugzilla easier to use and more useful in -many, many small ways, in addition to adding some major new features. - -This document contains the release notes for Bugzilla 2.22. -In this document, recently added, changed, and removed features -of Bugzilla are described. If you are upgrading from an older version, -you will definitely want to read these release notes in detail, so that -you have an idea of what has changed. - -If you are upgrading from a version before 2.20, also read the 2.20 -release notes (lower in this file) and any previous release notes. - -If you are installing a new Bugzilla, you will still want to look over -the release notes to see if there is any particularly important -information that affects your installation. - -If you would like to contribute code to Bugzilla, read our -Contributor's Guide at: - -http://www.bugzilla.org/docs/contributor.html - - -Important Updates In This Point Release -*************************************** - -This section describes bugs fixed in releases after the original 2.22 -release. - -Version 2.22.2 --------------- - -+ Make Bugzilla compatible with Template Toolkit 2.15 (bug 357374) - -+ Make Bugzilla compatible with versions of MySQL higher than 5.0.25 - (bug 321645) - -+ Sanity Check can now only be run by people with the "admin" privilege. - (bug 91761) - -Version 2.22.1 --------------- - -+ When sending mail, Bugzilla could throw the error "Insecure dependency in - exec while running with -T switch" (bug 340538). - -+ Using the public webdot server (for dependency graphs) should work - again (bug 351243). - -+ The "I'm added to or removed from this capacity" email preference - wasn't working for new bugs (bug 349852). - -+ The original release of 2.22 incorrectly said it required Template-Toolkit - version 2.08. In actual fact, Bugzilla requires version 2.10 (bug 351478). - -+ votes.cgi would crash if your bug was the one confirming a bug (bug 351300). - -+ checksetup.pl now correctly reports if your Template::Plugin::GD module - is missing. If missing, it could lead to charts and graphs not working - (bug 345389). - -+ The "Keyword" field on buglist.cgi was not sorted alphabetically, so - it wasn't very useful for sorting (bug 342828). - -+ Sendmail will no longer complain about there being a newline in the - email address, when Bugzilla sends mail (bug 331365). - -+ contrib/bzdbcopy.pl would try to insert an invalid value into the - database, unnecessarily (bug 335572). - -+ Deleting a bug now correctly deletes its attachments from the database - (bug 339667). - - -Minimum Requirements -******************** - -Perl ----- - - Perl v5.6.1 (Non-Windows platforms) - ActiveState Perl v5.8.1 (Windows only) - - Note that this is the last release of Bugzilla to support perl 5.6.x-- - future versions will require perl 5.8. - -For MySQL Users ---------------- - - MySQL v4.0.14 (changed from 2.20) - perl module: DBD::mysql v2.9003 (changed from 2.18) - -For PostgreSQL Users --------------------- - - PostgreSQL 7.3.x - perl module: DBD::Pg 1.31 (1.41 required for PostgreSQL 8+) - - WARNING: DBD::Pg 1.43 has a bug which causes checksetup.pl to fail - and corrupt the database. If you are using DBD::Pg 1.43, either downgrade - to 1.41 or upgrade to 1.45 (1.42 and 1.44 seem broken somehow too). - - Note that this is the last release of Bugzilla to support PostgreSQL 7.x. - Future versions will require PostgreSQL 8.0 and DBD::Pg 1.45. - -Required Perl Modules ---------------------- - - AppConfig v1.52 - CGI v2.93 - Data::Dumper (any) - Date::Format v2.21 - DBI v1.38 - File::Spec v0.84 - File::Temp (any) - Template Toolkit v2.10 (changed from 2.20) - Text::Wrap v2001.0131 - Mail::Mailer v1.67 (changed from 2.20) - MIME::Base64 v3.01 (new in 2.22) - MIME::Parser v5.406 (new in 2.22) - Storable (any) - - Note: The SMTP support in Mail::Mailer 1.73 (the most recent version) - is broken. The last known working version is 1.67. - -Optional Perl Modules ---------------------- - - Chart::Base v1.0 - GD v1.20 - GD::Graph (any) - GD::Text::Align (any) - Net::LDAP (any) - PatchReader v0.9.4 - XML::Twig (any) (new in 2.22) - Image::Magick (new in 2.22) - - -What's New? -*********** - -Complete PostgreSQL Support ---------------------------- -Bugzilla 2.20 contained experimental support for PostgreSQL. -In Bugzilla 2.22, PostgreSQL support is fully complete and stable. Using -PostgreSQL with Bugzilla should be as stable as using MySQL, and if -you experience any problems they will be taken as seriously as if you -were running MySQL. - -There are no known remaining major problems with Bugzilla on PostgreSQL. -All features of Bugzilla have been tested and work. - - -Parameters In Sections ----------------------- -Long-time users of Bugzilla know that over time the parameter list has -grown quite large. It has now been split into sections to make it easier -to use. - - -One Codebase, Multiple Databases --------------------------------- -There is now limited support for having multiple projects use the -same Bugzilla codebase, but all have separate databases. - -The different projects can have their own templates and their own -bug database, but all use the same set of Bugzilla code in the same -directory. - -To enable this, set an environment variable called PROJECT when -calling the Bugzilla CGIs. Then for each project, you can have -a localconfig.PROJECT (where "PROJECT" is the value of the PROJECT -environment variable) file for the database parameters, and a -template/en/PROJECT directory (where "PROJECT" is the value of the -PROJECT environment variable) - -This feature isn't documented yet, but we hope to have documentation for -it soon. - - -UTF-8 For New Installations ---------------------------- -If this is the first time you're installing Bugzilla, it will now use -UTF-8 encoding for all pages, automatically. It will also send emails -in UTF-8. This eliminates most of the internationalization problems -users have experienced, as one Bugzilla page may now contain any number -of languages simultaneously. - -If you are upgrading and you want to use UTF-8, just turn on the "utf8" -Parameter. However, realize that if you have non-UTF-8 data in your -Bugzilla, it will appear unreadable. (If you just have ASCII in your -database, you're safe to turn on the "utf8" parameter, definitely.) - - -Admins Can Impersonate Users ----------------------------- -User impersonation (think of the su/sudo command on Unix) allows you -to view pages and perform actions as if you are logged in as someone else, -without having to know their password. - -A user in the new "bz_sudoers" group has the option of "becoming" -any user in Bugzilla. Once they "become" that user, they *are* that user -for the rest of the session, until they decide to switch back to being -themselves. - -However, they cannot "become" any user in the "bz_sudo_protect" group. -This group includes everybody in the "admin" and "bz_sudoers" groups by -default. - -Any time a user is impersonated, they will get an email notifying them -who has impersonated them. - - -Bug Import and Moving Improvements ----------------------------------- -The XML Import script, importxml.pl, has been completely re-written. - -It now: - - * Correctly imports the "priority" field - * Understands when the "Reporter" or "CC List" security boxes - are unchecked on the bug. - * Places bugs in the appropriate groups - * Allows attachments to be imported - * Is much more forgiving about small problems in the XML - - -Adding Individual Bugs to Saved Searches (Tagging) --------------------------------------------------- -Users now have the option of adding an individual bug to any -particular Saved Search. Individual users that disagree with the site -default can add or remove this feature (which appears as an entry box -visible in the footer) by changing the General Preferences setting -called "Enable tags for bugs". - - -Attach URLs ------------ -Instead of attaching a file, you can now also attach a URL to a bug. -This will show up just like an attachment on show_bug.cgi, but when -you click on it, it will take you to the URL. - -To enable this, turn on the "allow_attach_url" parameter. - - -Optional "Strict Isolation" for Groups --------------------------------------- -If you turn on the "strict_isolation" parameter in Bugzilla, you -will *not* be able to add any user to the CC field (or set them -as an Assignee or QA Contact) unless that user could normally see -the bug. That is, you will no longer be able to "accidentally" -(or intentionally) give somebody access to a bug that they -otherwise couldn't see. - - -"editcomponents" Change ------------------------ -Previously, all users who had "editcomponents" could see every Product, -using the editcomponents.cgi script. Now, users with "editcomponents" -can only see Products that they normally have access to. - -This restriction also affects editversions.cgi, editmilestones.cgi and -editproducts.cgi. - - -"shutdownhtml" Change ---------------------- -All of Bugzilla is now affected by the "shutdownhtml" parameter, -including command-line scripts. checksetup.pl is exempt. Many scripts -(such as collectstats.pl and whine.pl) will just exit silently when -"shutdownhtml" is turned on. - - -Miscellaneous Improvements --------------------------- - -- Added a frequently-requested user preference for whether or not to go - to the next bug in your list after submitting changes to a bug. - -- The ability to do relative date searches (like "1d" for "1 day" or "1w" - for "1 week") by hour now, in addition to days and other units of time. - -- "Alias" added to the New Bug form, for users with editbugs. - -- Users can now actually see the descriptions of flags that you enter - in editflagtypes.cgi. The description will appear as a tooltip - when a user places their mouse over the flag name on show_bug.cgi. - -- Bugzilla will optionally convert BMP attachments into PNGs for you. - See the "convert_uncompressed_images" in the "Attachments" section - of the Parameters. - -- You can now edit the Status Whiteboard when you are changing multiple - bugs at once. - -- The way that groups work in the database has changed, and large-scale - Bugzilla use with many concurrent users should be much faster, as a - result. (Technical Details: The need for Bugzilla to "derive groups" - has gone away pretty much entirely.) - -- Performance improvements on searching attachment information that's not - the actual content of the attachment (such as searching the Attachment - Description or the Attachment MIME Type) - -- You can now specify multiple email addresses, comma-separated, when - setting the requestee of a flag, and it will set the flag once for each - of those email addresses - -- "Bug Creation Time" is now searchable in the Boolean Charts. - -- When you mark a comment on a bug as private, the background color - of the comment will change immediately. However, in order for - Bugzilla to register that the comment is now private, you still - have to "submit" the changes. - -- Emails sent from Bugzilla now have "X-Bugzilla-Keywords" and - "X-Bugzilla-Severity" by default, containing the information - from the related Bugzilla fields. - -- You can now change the assignee and QA contact on multiple bugs at - once even when those bugs are in different products. - -- contrib/merge-users.pl allows you to merge two user accounts. This is - particulary useful when a user opened several accounts and only one should - be kept. It also lets you merge a deleted account with an existing one. - -All Changes ------------ - -If you'd like to see all the changes between Bugzilla 2.20 and Bugzilla -2.22, see: - -http://tinyurl.com/9p2tm - - -Deprecated Features -******************* - -- This is the last release of Bugzilla to support perl 5.6.x. All future - versions of Bugzilla will require at least perl 5.8. - - This is the last release of Bugzilla to support PostgreSQL 7.x. Future - releases using PostgreSQL will require PostgreSQL 8.0 and DBD::Pg 1.45. - -Outstanding Issues -****************** - -- bug 305836: PostgreSQL users: do not use DBD::Pg version 1.43 with - Bugzilla. It has a bug which can corrupt the database. Version 1.41 - is fine. Version 1.45 or higher is fine too. - -- (No Bug Number) VERY IMPORTANT: If you have customized the values in - your Status/Resolution field, you must edit checksetup.pl BEFORE YOU - RUN IT. Find the line that starts like this: - - bug_status => ["UNCONFIRMED", - - That's where you set the values for the Status field. - - resolution => ["","FIXED", - - And that's where you set values for the Resolution field. - - Those are both near line 1826 in checksetup.pl. - - If you forget to do this, you will have to manually edit the "bug_status" - and "resolution" tables in the database to contain the correct values. - -- bug 276230: The support for restricting access to particular Categories of - New Charts is not complete. You should treat the 'chartgroup' Param as the - only access mechanism available. However, additionally, charts migrated from - Old Charts will be restricted to the groups that are marked MANDATORY for - the corresponding Product. There is currently no way to change this - restriction, and the groupings will not be updated if the group configuration - for the Product changes. - -- bug 37765: If you use the "sendmail" support of Bugzilla, - and you use an MTA which is *not* Sendmail (such as Postfix, Exim, etc.) - make sure the "sendmailnow" parameter is ON or Bugzilla will not send - e-mail correctly. - -- bug 69621: If you rename or remove a keyword that is in use on bugs, you will - need to rebuild the "keyword cache" by running sanitycheck.cgi and choosing - the option to rebuild the cache when it asks. Otherwise keywords may not show - up properly in search results. - -- (No Bug Number) If you have a lot of non-ASCII data in your Bugzilla (for - example, if you use a translation of Bugzilla), don't enable the XS::Stash - option when you install the Template Toolkit, or your Bugzilla installation - may become slow. This problem is fixed in a not-yet-released version of the - Template Toolkit (after 2.14). - -- Bug 99215: Flags are not protected by "mid-air collision" detection. - Nor are any attachment changes. - -- Bug 89822: When changing multiple bugs at the same time, there is no - "mid-air collision" protection. - -- bug 322955: The email interface (bug_mail.pl) in the contrib/ directory - has not been maintained (as it has no maintainer), and does not work - properly. We hope to have this fixed in our next major release of - Bugzilla; however, any help or contributions in this area are very - welcome. - - -How to Upgrade From An Older Bugzilla -************************************* - -NOTE: Upgrading from a large installation (over 10,000 bugs) running 2.18 - or before may take a significant amount of time. checksetup will - try to let you know how long it will take, but expect downtime - of an hour or more if you have many bugs, many attachments, - or many users. - -Steps for Upgrading -------------------- - -1) Read these entire Release Notes, particularly the "Outstanding Issues" - and "Security Fixes" sections. - -2) View the Sanity Check (sanitycheck.cgi) page on your installation before - upgrading. Attempt to fix all warnings that the page produces before - you go any further, or you may experience problems during your upgrade. - -3) Make a backup of the Bugzilla database before you upgrade, perhaps - by using mysqldump. THIS IS VERY IMPORTANT. If anything goes wrong - during the upgrade, your installation can be corrupted beyond - recovery. Having a backup keeps you safe. - - Example: - - mysqldump -u root -p bugs > bugs-db.sql - -4) Replace the files in your installation with the new version of Bugzilla, - or you can try to use CVS to upgrade. The bugzilla.org website has - instructions on how to do the actual installation. - - You can also use a brand-new Bugzilla directory, as long as you - copy over the old data/ directory and the "localconfig" file to the - new installation. - -5) Run checksetup.pl after you install the new version. - -7) View the Sanity Check page again after you run checksetup.pl. - -8) It is recommended that, if possible, you fix any problems you find - immediately. Failure to do this may mean that Bugzilla will not work - correctly. Be aware that if the sanity check page contains more errors after - an upgrade, it doesn't necessarily mean there are more errors in your - database, as additional tests are added to the sanity check over time, and - it is possible that those errors weren't being checked for in the old - version. - -9) This version of Bugzilla contains improvements to the email that - Bugzilla sends when a bug is changed. The template for that email - is contained in the "newchangedmail" parameter. If you would like - to take advantage of the email enhancements in this version of - Bugzilla, reset that parameter to its default. (You can customize - it after that again, if you want.) - - -Code Changes Which May Affect Customizations -******************************************** - -CGI.pl is Gone --------------- -The CGI.pl file, which used to contain many global functions, and which -also contained initialization code for every CGI, is gone. The functions -have been moved to various places and sometimes renamed. - -The initialization code that used to happen inside CGI.pl is now inside -of Bugzilla.pm. All CGIs must "use Bugzilla" in one way or another. (Some -CGIs "use Bugzilla" by doing "require globals.pl".) - - -Deriving Groups No Longer Happens ---------------------------------- -Bugzilla no longer needs to "derive groups" in advance. That is, previously -Bugzilla used to flatten the group heirarchy into the user_group_map -table. (That is, show that a user was in every group they were in, -even if they were only in that group because they belonged to *another* -group.) Now the table only contains groups that the user is in directly, -and groups that they are in because of a regexp. - -Instead, The Bugzilla::User->group function determines the groups a user -is in when called. - -We did this because the group derivation was causing a lot of complexity -in the code, and also deriving the groups was a slow process that -frequently had to happen inside of a database lock while sending mail -or viewing a bug list. - -See https://bugzilla.mozilla.org/show_bug.cgi?id=304583 for details. - - -Other Changes -------------- - -- The move.pl script's functionality has been merged into process_bug.cgi. - -- $::template and $::vars are gone from globals.pl. Instead of $::template, - use Bugzilla->template. Every script creates the $vars variable by itself - instead of using a global $::vars variable. - -- $::userid is gone. Instead use Bugzilla->user->id. - -- QuickSearch is now in perl instead of in JavaScript. The code is in - Bugzilla/Search/QuickSearch.pm. This makes it much easier to customize, - and it also fixes some long-standing issues that QuickSearch had. - -- Attachment data is now in the attach_data table. Other information - about attachments is still in the "attachments" table. - -- Much like the 2.20 release, many functions have been removed from - globals.pl and CGI.pl. They were moved elsewhere and renamed. - Search RESOLVED bugs in bugzilla.mozilla.org for the old - version of the function name, and that will usually show you - the bug where we moved the function, allowing you to find out - what the new name and location is. - -- This is the last release that contains the deprecated - SendSQL, SqlQuote, FetchSqlData, MoreSqlData, and FetchOneColumn - functions. Instead, you should use DBI functions. For a very brief - example, see: - - http://www.bugzilla.org/docs/developer.html#sql-sendreceive - - -Security Fixes in 2.22 Releases -******************************* - -A long-standing, well-known security issue is finally resolved in Bugzilla -2.22: Previously, the "Session ID" of each user could be easily guessed, -given enough time. This could have allowed an attacker to take over a -user's account, in certain circumstances. Now, the "Session ID" is totally -random, resolving this issue. See bug 119524 in bugzilla.mozilla.org for -details. - -If you are very concerned about the security of your Bugzilla installation, -it would be a very good idea to run the following command on your -database immediately after upgrading: - -TRUNCATE TABLE logincookies; - -This is actually safe to do at any time--it just forces a logout of -every single user, even those with saved sessions. (It invalidates -every login cookie Bugzilla has ever given out.) - -Version 2.22.2 --------------- - -A Cross-Site Scripting vulnerability is fixed in Bugzilla 2.22.2. You can -read the details of the fix at: - -http://www.bugzilla.org/security/2.20.3/ - -Version 2.22.1 --------------- - -The Bugzilla team fixed two Information Leaks and three Cross-Site -Scripting vulnerabilities that existed in versions of Bugzilla -prior to 2.22.1. We strongly recommend that you update any 2.22 -installation to 2.22.1, to be protected from these vulnerabilities. - -In addition, we have made an enhancement to security in this version -of Bugzilla. In previous versions, it was possible for malicious -users to exploit administrators in certain ways. Although this has -never happened (to our knowledge) in the real world, we thought it -was important that we protect administrators from this sort of attack. - -You can see details on all the vulnerabilities and enhancements at: - -http://www.bugzilla.org/security/2.18.5/ - - -Release Notes For Previous Versions -************************************ - -*************************************** -*** The Bugzilla 2.20 Release Notes *** -*************************************** - -Table of Contents -***************** - -- Introduction -- Important Updates in this Point Release - * Version 2.20.1 - * Version 2.20.2 -- Minimum Requirements - * Perl - * For MySQL Users - * For PostgreSQL Users - * Required Perl Modules - * Optional Perl Modules -- What's New? - * Experimental PostgreSQL Support - * New User-Interface Color/Style - * Higher-Level Categorization of Bugs (above "Product") - * Regular Reports by Email of Complex Queries ("Whining") - * "Environment Variable" Authentication Method - * User-List Drop-Down Menus - * Server-Side Comment Wrapping - * UI for Editing Priority, OS, Platform, and Severity - * Bugzilla Queries as RSS - * Choice of E-Mail Sending Methods - * "User Preferences" - * "Large Attachment" Storage - * "User Visibility" Controls - * Miscellaneous Improvements - * All Changes -- Deprecated Features -- Outstanding Issues (<======================== IMPORTANT, PLEASE READ) -- How to Upgrade From An Older Bugzilla - * Steps for Upgrading -- Code Changes Which May Affect Customizations - * The New Database-Compatibility Layer - * If You Customize Your Database... - * Many Functions Renamed - * User Preferences - * Other Changes -- Security Fixes In 2.20 Releases -- Release Notes for Previous Versions - - -Introduction -************ - -This document contains the release notes for Bugzilla 2.20. -In this document, recently added, changed, and removed features -of Bugzilla are described. If you are upgrading from an older version, -you will definitely want to read these release notes in detail, so that -you have an idea of what has changed. - -If you are upgrading from a version before 2.18, also read the 2.18 release -notes (lower in this file) and any previous release notes. - -If you are installing a new Bugzilla, you will still want to look over -the release notes to see if there is any particularly important information -that affects your installation. - -The 2.20 release has had about nine months of development since 2.18, but -they were nearly the most active nine months in Bugzilla's history. We hope -that users will appreciate our many external changes, and that Bugzilla -administators will find that our internal changes make their lives easier. - -If you would like to contribute code to Bugzilla, read our -Contributor's Guide at: - -http://www.bugzilla.org/docs/contributor.html - - -Important Updates In This Point Release -*************************************** - -Version 2.20.1 --------------- - -+ Many PostgreSQL fixes, including fixing whine.pl on Pg 8 - (bug 301062) and fixing the --regenerate option of collectstats.pl - for all versions of Pg (bug 316971). However, users who want full - PostgreSQL support are encouraged to use the 2.22 series, as - certain PostgreSQL bugs were discovered that will not be fixed - in 2.20 (their fixes were too complex). - -+ In Bugzilla 2.20, the "administrator" user created by checksetup.pl - would not ever be sent email, because their email preferences were - left blank. This has been fixed for 2.20.1. However, if you created - this administrative user with Bugzilla 2.20, make sure to go back - and enable their Email Preferences. (bug 317489) - -+ The bzdbcopy.pl script mentioned in these release notes - has now actually been checked-in to the 2.20 branch, and so - it's included in this release. (bug 291776) - -+ When there's only one Classification, you now won't be required - to pick a Classification on bug entry. (bug 311489) - -+ You can no longer add dependencies on bugs you can't see. - (bug 141593) - -+ The CC list is included in "New" bug emails, again. (bug 313661) - -+ In the original 2.20, certain scripts were not correctly using - the "shadow database," if it was specified. This has been fixed - in 2.20.1. (bug 313695) - -+ "Saved Searches" that were saved before Bugzilla 2.20, would throw - an error if they contained "Days Since Bug Changed." as part of their - criteria. This has been fixed in Bugzilla 2.20.1. (bug 302599) - -+ You can now successfully delete a product even when Target Milestones - are turned off. (bug 317025) - -+ checksetup.pl now correctly pre-compiles templates for languages other - than English. (bug 304417) - -+ The "All Closed" chart that is created by default in New Charts - now actually represents all closed bugs, and not all bugs in the - product. (bug 300473) - -+ CSV bug lists with more than 1000 dates now work properly. (bug 257813) - -+ Various bugs with upgrading from previous versions of Bugzilla - have been fixed. (bug 307662, bug 311047, bug 310108) - -+ Many, many other bug fixes. See http://www.bugzilla.org/status/changes.html - for details on what was fixed between 2.20 and 2.20.1. - - -Version 2.20.2 --------------- - -+ Adding a new attachment and taking the bug at the same time does not - create a referential integrity problem anymore if the bug was marked as - a duplicate (bug 332705). - -+ Some additional admin links have been added to the sidebar (bug 282613). - -+ A new test has been added to our test suite, named 012throwables.t. - It will now make sure that all tags used in ThrowUserError() and - ThrowCodeError() are defined, and that there are no unused tags (bug 312042). - -+ whine.pl now works correctly on MySQL 4.0. MySQL 4.1 is not affected - (bug 327348). - -+ contrib/merge-users.pl allows you to merge two user accounts. This is - especially useful when a user opened several accounts and only one - should be kept (bug 188264). - -+ The login form on index.cgi again works correctly on a fresh installation - (bug 328108). - -+ Email preferences are now set correctly when creating a new user account - using the ENV method (bug 327355). - - -Minimum Requirements -******************** - -Perl ----- - - Perl v5.6.1 (changed from 2.18) (Non-Windows platforms) - ActiveState Perl v5.8.1 (Windows only) - -For MySQL Users ---------------- - - MySQL v3.23.41 (Note: 2.22 will require MySQL 4.x) - perl module: DBD::mysql v2.9003 (changed from 2.18) - -For PostgreSQL Users (new in 2.20) --------------------- - - PostgreSQL 7.3.x (8.x has received less testing) - perl module: DBD::Pg 1.31 (1.41 required for PostgreSQL 8+) - -Required Perl Modules ---------------------- - - AppConfig v1.52 - CGI v2.93 - Data::Dumper (any) - Date::Format v2.21 - DBI v1.38 (changed from 2.18) - File::Spec v0.84 (changed from 2.18) - File::Temp (any) - Template Toolkit v2.08 - Text::Wrap v2001.0131 - Mail::Mailer 1.65 (new in 2.20) - Storable (any) (new in 2.20) - -Optional Perl Modules ---------------------- - - Chart::Base v1.0 - GD v1.20 - GD::Graph (any) - GD::Text::Align (any) - Net::LDAP (any) - PatchReader v0.9.4 - XML::Parser (any) - - -What's New? -*********** - -Experimental PostgreSQL Support -------------------------------- - -In addition to MySQL, Bugzilla now also supports PostgreSQL. PostgreSQL -support is still somewhat experimental. Although most major features of -Bugzilla work on PostgreSQL in 2.20, there are probably still a few bugs -that need to be worked out. - -PostgreSQL support in 2.20 is acceptable for smaller production -environments that don't mind running into a bug or two now and then. - - -New User-Interface Color/Style ------------------------------- - -You'll notice that Bugzilla looks a bit nicer, now! We've made a few -color and style changes to update the overall "feel" of Bugzilla's -User Inteface. We plan to do even more work on the UI for 2.22. - - -Higher-Level Categorization of Bugs (above "Product") ------------------------------------------------------ - -Previous Bugzillas had "Products" that you could file bugs in, -and "Components" for those products. Now, "Products" can be grouped -into "Classifications." - -To enable this, a Bugzilla administrator can turn on the -"useclassification" parameter, using editparams.cgi. - - -Regular Reports by Email of Complex Queries ("Whining") -------------------------------------------------------- - -You can now tell Bugzilla to do a specific query (or set of queries) -every X minutes/hours/days, and send you the results by email. This is -great for keeping track on a daily basis of what's going on in -your Bugzilla. - - -"Environment Variable" Authentication Method --------------------------------------------- - -You can now tell Bugzilla to accept a certain value passed in from -Apache as authentication for Bugzilla users. This means that Bugzilla -now "supports" any type of authentication that Apache supports. - -To use this, set the "user_info_class" parameter to "ENV" and, at a -minimum, set the "auth_env_email" parameter to the name of the -Environment variable that passes the authenticated user (usually -"REMOTE_USER"). If your webserver knows users' real names as well, also -set the "auth_env_realname" parameter. If you are using a true -single-signon system that assigns an identifier uniquely to an -individual, even across changes of email address, then set -"auth_env_id" to the name of that variable. - - -User-List Drop-Down Menus -------------------------- - -Now, anywhere in Bugzilla where you previously had to type in an -email address by hand, you have the choice of having Bugzilla instead -display a drop-down menu of users to pick from. - -This feature is best for small installations with few users, because -on large installations the list grows too large to be useful. - -To enable the feature, turn on the "usemenuforusers" parameter in -editparams.cgi. - - -Server-Side Comment Wrapping ----------------------------- - -In older Bugzillas, comments were wrapped to 80 characters by the -user's web browser, and then stored in the database that way. This caused -problems because some browsers did not wrap comments properly. - -Now, Bugzilla stores comments unwrapped and wraps them at display time, so -all new comments should be properly wrapped. Also, when you upgrade, Bugzilla -will look for old "mis-wrapped" comments and attempt to wrap them properly. - -Lines beginning with the ">" character are assumed to be quotes, and are -*not* wrapped. - - -UI for Editing Priority, OS, Platform, and Severity ---------------------------------------------------- - -Bugzilla now has a User Interface for adding and removing values -from the OS, Platform, Priority, and Severity fields. You can also -rename values. Any user in the "editcomponents" group can click -on the "Field Values" link in their page footer to edit these fields. - -Also, the default list of choices for OS and Platform for new -installations is now much smaller. Old installations will keep -the same list they have now. - - -Bugzilla Queries as RSS ------------------------ - -You can now view a Bugzilla query as valid RSS 1.0. This means that you -could add a particular query to your RSS aggregator, if you wanted, to -keep track of changes in Bugzilla. - -To see a query as RSS, just click on the "RSS" link on the bottom of -your query results. Your query must return at least 1 result in order -for you to see the link. - - -Choice of E-Mail Sending Methods --------------------------------- - -Bugzilla now uses perl's Mail::Mailer to send e-mail. This means that -you have several choices of how Bugzilla can send email. By default, it -still uses sendmail, but it can also use SMTP, qmail, or send all email -to a file instead of out to users. - -A Bugzilla administrator can change which method is used by setting the -"mail_delivery_method" parameter in editparams.cgi. - - -"User Preferences" ------------------- - -Bugzilla users will now notice a section in their Preferences called -"General Preferences." Administrators will notice a new link called -"User Preferences." - -The Preferences system allows Bugzilla developers to specify arbitrary -"user preferences" that change the behavior of certain parts of Bugzilla. -Administrators can control whether or not users are allowed to use these -preferences, and what the default settings are for a user who is not -logged in. - -The first two preferences that we have implemented are: - + "Show a quip at the top of each bug list" - + "When viewing a bug, show comments in this order..." - -We plan to implement more preferences in the future. - - -"Large Attachment" Storage --------------------------- - -Bugzilla can now store very large attachments on disk instead of in the -database. These attachments can't be searched with Boolean Charts, but -they also don't take up database space, and they can be deleted individually -by the admin. - -When uploading an attachment, a user chooses if it's a "Big File." If so, -it's stored on the disk instead of in the database. - -To enable this feature, set the "maxlocalattachmentsize" parameter to -a non-zero value, in editparams.cgi. - - -"User Visibility" Controls --------------------------- - -It is now possible to prevent users from encountering all other users when -using user-matching or drop-down userlists. To enable this restriction, -enable the "usevisibilitygroups" parameter. Once this is enabled, each -group's permissions will include a new column for "visible." The members -of any group for which the group being edited is visible will be -able to user-match this groups's users or see them in dropdown lists. - -This does not control who a user can CC on a bug, only who they can -see in the user-matching lists or drop-downs. - -Miscellaneous Improvements --------------------------- - -- Marking an attachment as obsolete will now cancel all pending flag - requests for that attachment. That is, any flag that was set to "?" - on that attachment will be cleared. - -- You can now see which users are "watching" you, on the email - preferences page. - -- You can tell Bugzilla to mark certain comments in a different - color by adding "&mark=1,2,3,5-7" to the end of the show_bug.cgi URL, - where "1,2,3,5-7" means "highlight comment 1, comment 2, comment 3, and - comments 5 through 7." - -- "QA Contact" now also appears on the New Bug page, if QA Contacts are - enabled on your installation. - -- Bugzilla email now has the "In-Reply-To" header added to it, so if - you use an email client that supports threads, you can view your - Bugzilla email in threads. If you are upgrading to a new version of - Bugzilla, and you want this support, please see the instructions at: - https://bugzilla.mozilla.org/attachment.cgi?id=172267 - -- The email preferences system has been slightly updated. You will notice - the changes on your Email Preferences page. - -- You can now negate individual "boolean charts" (in the - "Advanced Searching" section at the bottom of the "Advanced - Search" page). That is, you can add "NOT" to the front of them. - -- You can add the words %assignee%, %reporter%, %user% (yourself), or - %qacontact% on the right-hand side of a Boolean Chart. For example, you - could make a Boolean Chart which said "Reporter" "does not equal" - "%assignee%". That would give you all bugs where the Reporter was not - the same as the Assignee. - -- You can now search Boolean Charts by "commenter." - -- If you have a group with no name, it will be re-named to "group_#" where - "#" is the numeric Bugzilla Group ID for that group. - -- If you are using time-tracking, you can now see a report of time spent - on bugs using summarize_time.cgi. - -- If you are using time-tracking, bugzilla will now set "hours remaining" - to "0" automatically if you RESOLVE a bug, whether you are in the - time-tracking group or not. - - -Deprecated Features -******************* - -- Bugzilla 2.20 is the last Bugzilla version to support MySQL 3.23.x. - Starting with Bugzilla 2.22, Bugzilla will require MySQL 4.0.x. This will - allow Bugzilla to take advantage of the advanced features of MySQL 4. - - -Outstanding Issues -****************** - -- (No Bug Number) VERY IMPORTANT: If you have customized the values in - your Status/Resolution field, you must edit checksetup.pl BEFORE YOU - RUN IT. Find the line that starts like this: - - bug_status => ["UNCONFIRMED", - - That's where you set the values for the Status field. - - resolution => ["","FIXED", - - And that's where you set values for the Resolution field. - - Those are both near line 1826 in checksetup.pl. - - If you forget to do this, you will have to manually edit the "bug_status" - and "resolution" tables in the database to contain the correct values. - -- bug 37765: VERY IMPORTANT: If you use the "sendmail" support of Bugzilla, - and you use an MTA which is *not* Sendmail (such as Postfix, Exim, etc.) - you MUST turn on the "sendmailnow" parameter or Bugzilla will not send - e-mail correctly. - -- (No Bug Number) If you close your web browser while the process_bug.cgi - or post_bug.cgi screen is running, not all emails will be sent, and - the next time that that bug is updated, there will be two updates. This - is because of a behavior of Apache that is beyond our control. - -- bug 276230: The support for restricting access to particular Categories of - New Charts is not complete. You should treat the 'chartgroup' Param as the - only access mechanism available. However, additionally, charts migrated from - Old Charts will be restricted to the groups that are marked MANDATORY for - the corresponding Product. There is currently no way to change this - restriction, and the groupings will not be updated if the group configuration - for the Product changes. This will not be fixed in the 2.20 branch. - -- bug 69621: If you rename or remove a keyword that is in use on bugs, you will - need to rebuild the "keyword cache" by running sanitycheck.cgi and choosing - the option to rebuild the cache when it asks. Otherwise keywords may not show - up properly in search results. - -- (No Bug Number) If you have a lot of non-ASCII data in your Bugzilla (for - example, if you use a translation of Bugzilla), don't enable the XS::Stash - option when you install the Template Toolkit, or your Bugzilla installation - may become slow. This problem is fixed in a not-yet-released version of the - Template Toolkit (after 2.14). - -- If at any time you upgraded from a version of Bugzilla between 2.17.4 - - 2.17.7 to either 2.18rc3 or 2.19.1, you must manually fix your New Charts in - order for them to work. See the following link for instructions on how to do - this: https://bugzilla.mozilla.org/show_bug.cgi?id=276237#c18 - If you are using 2.18rc3, but did not upgrade from version 2.17.4 or newer, - then you don't need to do this. - -- (No Bug Number) If your DBI is really, really old, Bugzilla might fail - with a strange error message when you try to run checksetup.pl. Try - upgrading your DBI using: perl -MCPAN -e'install DBI' - -- Bug 126266: Bugzilla does not use UTF-8 to display pages. This means - that if you enter non-ASCII characters into Bugzilla, they may - display strangely, or Bugzilla may have other problems. For a workaround, - see: http://www.bugzilla.org/docs/tip/html/security-bugzilla.html - This has been fixed in the 2.22 series. - -- Bug 99215: Flags are not protected by "mid-air collision" detection. - Nor are any attachment changes. - -- Bug 89822: When changing multiple bugs at the same time, there is no - "mid-air collision" protection. - -- Bug 285614: importxml.pl may be broken in many different ways. - It has been fixed and completely re-written in the 2.22 series. - -- (No Bug Number) Note that the email interface (bug_mail.pl) in the - contrib/ directory has not been maintained (as it has no maintainer), - and so may not be working properly. Contributions are welcome, if - anybody would like to work on it. - - -Upgrading From An Older Bugzilla -************************************ - -NOTE: Running checksetup.pl to upgrade a large installation (over 10,000 bugs) - may take a significant amount of time. checksetup will try to let - you know how long it will take, but expect downtime of an hour or - more if you have many bugs, many attachments, or many users. - -Steps for Upgrading -------------------- - -1) View the Sanity Check (sanitycheck.cgi) page on your installation before - upgrading. Attempt to fix all warnings that the page produces before - you go any further, or you may experience problems during your upgrade. - -2) Make a backup of the Bugzilla database before you upgrade, perhaps - by using mysqldump. - - Example: - - mysqldump -u root -p --databases bugs > bugs.db.backup - -3) Replace the files in your installation with the new version of Bugzilla, - or you can try to use CVS to upgrade. The Bugzilla.org website has - instructions on how to do the actual installation. - -4) Make sure that you run checksetup.pl after you install the new version. - -5) View the Sanity Check page again after you run checksetup.pl. - -6) It is recommended that, if possible, you fix any problems you find - immediately. Failure to do this may mean that Bugzilla will not work - correctly. Be aware that if the sanity check page contains more errors after - an upgrade, it doesn't necessarily mean there are more errors in your - database, as additional tests are added to the sanity check over time, and - it is possible that those errors weren't being checked for in the old - version. - -7) If you want threading support on your Bugzilla email (see the - "Miscellaneous Improvements" section above for a description), - you need to follow the instructions at: - https://bugzilla.mozilla.org/attachment.cgi?id=172267 - - -Code Changes Which May Affect Customizations -******************************************** - -The New Database-Compatibility Layer ------------------------------------- - -For most customizations, this should have no effect. However, you should -be aware that Bugzilla->dbh is now an instance of "Bugzilla::DB" instead -of being a DBI object directly. In fact, it's actually a -Bugzilla::DB::Mysql for MySQL users, and a Bugzilla::DB::Pg for -PostgreSQL users. - -Anything called from $dbh (like $dbh->bz_last_key) that starts with -"bz_" or "sql_" is a custom Bugzilla function. Anything *not* starting -with those two prefixes is a normal DBI function. - -Methods whose names start with "sql_" generate a piece of a SQL statement. -They generate the correct version of the statement for whichever database -you are using. - -Methods whose names start with "bz_" do something directly. - -You can see more documentation about this at: - -http://www.bugzilla.org/docs/2.20/pod/Bugzilla/DB.pm - - -If You Customize Your Database... ---------------------------------- - -In order to support multiple databases, we had to do something sort of -tricky. Bugzilla now stores what it *thinks* the current database schema -is, in a table called bz_schema. - -This means that when checksetup changes the database, it updates the -bz_schema table. When *you* update the database, without using -checksetup to do it, the bz_schema table is *not* updated. - -So, if you're going to add/remove a new column/table to Bugzilla, or if you're -going to change the definition of a column, try to do it by adding code to -checksetup in the correct place. (It's one of the places where you find -the word "--TABLE--".) - -You can see the documentation on the $dbh functions used to do this at: - -http://www.bugzilla.org/docs/2.20/pod/Bugzilla/DB.pm#schema_modification_methods - - -Many Functions Renamed ----------------------- - -We are reorganizing the Bugzilla code so that it can support mod_perl. As -part of this, we are moving all functions out of globals.pl and CGI.pl, and -into modules in the Bugzilla/ directory. - -Sometimes when we moved them, we also renamed them. The new Bugzilla standard -is to have functions_named_like_this, instead of FunctionsNamedLikeThis. - -So if you were using a FunctionNamedLikeThis that no longer works, try just -using it as function_named_like_this. If that doesn't work, you may have to -search for where we put it, and what we renamed it to. Most of the functions -moved to logical places. - -If you really can't find it, search bugzilla.mozilla.org using the name -of the old function. We usually moved one function per bug, so the new -name will be somewhere in a bug report. - - -User Preferences ----------------- - -Bugzilla now has a "User Preferences" system! These preferences are stored -in the database, and specified by a Bugzilla developer. The Bugzilla -developers actually call these "settings," but we called them "User -Preferences" in the UI to make things clearer. - -You access a user's settings differently depending on if you are in a -.cgi file or in a template file: - -CGI: Bugzilla->user->settings->{'setting_name'}->value -Template: Bugzilla.user.settings.setting_name.value - -Where "setting_name" is the name of the setting. You can see the current -setting names in the "setting" table in the database. - -Remember that sometimes you may want to check a user's settings when -making a customization. - -To see how to add new settings, search for "add_setting" in checksetup.pl. -Also see the template: template/en/default/global/setting-descs.none.tmpl. - -Other Changes -------------- - -- The $::unconfirmedstate variable has been replaced by the actual string - "UNCONFIRMED" everywhere in Bugzilla code. - -- The %::FORM and %::MFORM variables are no longer used to access form - data. Instead, use $cgi->param(). There are many examples of how to do - this, all over the Bugzilla code. - -- SendSQL() and related calls are deprecated, and the various $dbh methods - should be used instead, such as $dbh->prepare() and $dbh->execute(). - Bugzilla->dbh is the $dbh handle to use. For more information on how - to use the $dbh methods, see: http://search.cpan.org/dist/DBI/DBI.pm - -- The $::userid variable will be going away. Use Bugzilla->user->id instead. - -- All global variables (any that start with $::, @::, or %::) will - be entirely gone by Bugzilla 2.24. - - -Security Fixes in 2.20 Releases -******************************* - -2.20.1 ------- - -There were three security issues discovered after the release of -Bugzilla 2.20 that we resolved for Bugzilla 2.20.1. One SQL Injection -(from an administrator only), one Cross-Site Scripting vulnerability -(that mostly affects only the user who can exploit it), and one minor, -extremely specific information leak. - -To see details on the vulnerabilities that were fixed, see the -Security Advisory at: - -http://www.bugzilla.org/security/2.16.10/ - - -Release Notes for Previous Versions -*********************************** - -***************************************** -*** The Bugzilla 2.18.x Release Notes *** -***************************************** - -Table of Contents -***************** - -- Introduction -- Important Updates In This Point Release - * Version 2.18.1 - * Version 2.18.2 -- Requirements - * Dependency Requirements -- What's New? - * Generic Reporting - * Generic Charting - * Request System - * Enterprise Group Support - * User Wildcard Matching - * Support for "Insiders" - * Time Tracking - * Authentication module/LDAP improvements - * Improved localization support - * Patch Viewer - * Comment Reply Links - * Full-Text Search - * Email Address Munging - * Simple Search - * Miscellaneous Improvements - * All Changes -- What's Changed? - * Flag Names - * New Saved Search User Interface - * Rules for changing fields -- Removed Features -- Code Changes Which May Affect Customizations -- Recommended Practice for the Upgrade - * Note About Upgrading From MySQL With ISAM Tables - * Steps for Upgrading -- Outstanding Issues (<======================== IMPORTANT, PLEASE READ) -- Security Fixes In 2.18 Releases -- Detailed Version-To-Version Release Notes - - -Introduction -************ - -This document contains the release notes for Bugzilla 2.18 and -the bugfix releases after 2.18. In this document, recently added, -changed, and removed features of Bugzilla are described. - -The 2.18 release is our current stable series, containing the results -of over two years of hard and dedicated work by volunteers all over -the world under the lead of Dave Miller. - - -Important Updates In This Point Release -*************************************** - -There are usually many other bug fixes than those listed below, -but the below fixes are the ones that we thought System Administrators -would like to specifically know about. - -To see a listing of all changes in this release, you can use the -table available at: - -http://www.bugzilla.org/status/changes.html - -Version 2.18.1 --------------- - -+ You can now enter a negative time for "Hours Worked" - in the time-tracking area. (Bug 271276) - -+ The BugMail.pm customization required for Windows (as - described in the Bugzilla Guide) now actually works. (Bug 280911) - -+ Users who were using Bugzilla 2.8 can now successfully upgrade - to 2.18.1 (they couldn't upgrade to 2.18). (Bug 283403) - -+ Dependency mails are now properly sent during a mass-change of bugs. - (Bug 178157) - - -Version 2.18.2 --------------- - -+ You can now create accounts with createaccount.cgi even - when the "requirelogin" parameter is turned on. (Bug 294778) - -+ Bugs that are in disabled groups may not show a padlock - on the bug list, or may otherwise behave strangely. You - can now fix this using sanitycheck.cgi. (Bug 277454) - -+ If sendmail dies while you are marking a bug - as a duplicate, the duplicates table will no longer become - corrupted. (Bug 225042) - - -Requirements -************ - -Dependency Requirements ------------------------ - -Minimum software requirements: - - MySQL v3.23.41 (changed from 2.16) - Perl v5.6.0 (changed from 2.16) (Non-Windows platforms) - ActiveState Perl v5.8.1 (Windows only) - -Required Perl modules: - - AppConfig v1.52 - CGI v2.93 (new since 2.16) (changed from 2.17.7) - Data::Dumper (any) - Date::Format v2.21 (changed from 2.16) - DBI v1.36 (changed from 2.16) (changed from 2.17.7) - DBD::mysql v2.1010 (changed from 2.16) - File::Spec v0.82 - File::Temp (any) - Template Toolkit v2.08 (changed from 2.16) - Text::Wrap v2001.0131 - -Optional Perl modules: - - Chart::Base v1.0 (changed from 2.16) (changed from 2.17.7) - GD v1.20 (changed from 2.16) - GD::Graph (any) (new since 2.16) - GD::Text::Align (any) (new since 2.16) - Net::LDAP (any) (new since 2.16) - PatchReader v0.9.4 (new since 2.16) (changed from 2.17.7) - XML::Parser (any) - - -What's New? -*********** - -Generic Reporting ------------------ - -Bugzilla has a new mechanism for generating reports of the current state of -the bug database. It has two related parts: a table-based view, and several -graphical views. - -The table-based view allows you to specify an x, y and z (multiple tables of -data) axis to plot, and then restrict the bugs plotted using the standard -query form. You can view the resulting data as an HTML or CSV export (e.g.: -for importing into a spreadsheet). - -There are also bar, line and pie charts, which are defined in a very similar -way. These views may be more appropriate for particular data types, and are -suitable for saving and then putting into presentations or web pages. - - -Generic Charting ----------------- - -Bugzilla has a new mechanism for generating charts (graphs over time) of any -arbitrary search. This is known as "New Charts." Legacy data from the previous -charting mechanism ("Old Charts") is migrated into the "New Charts" when you -upgrade. The Old Charts mechanism remains, but is deprecated and will be -removed in a future version of Bugzilla. - -Individual users can see/create charts as long as they are a member of the -group specified in the Param 'chartgroup'. Data can be collected for -personal charts every seven days (or a longer period, as set by the user). -Charts created by an administrator can be made public (visible to all). Data -is collected for administrator charts every day (or a longer period, as set -by the admin). - -The data is collected by the collectstats.pl script, which an administrator -will need to arrange to be run once every day (see the manual). Chart data can -be plotted in a number of different ways, and different data sets can be -plotted on the same graph for comparison. - -Please see the Known Bugs section for some important limitations relating to -access controls on charts. - - -Request System ---------------- - -The Request System (RS) is a set of enhancements that adds powerful flag -(superset of the old attachment status) features to the bugs. - -RS allows for four states: off, granted, denied, and (optionally) requested, -where "granted" is the equivalent of "on". These additions mean it is no -longer necessary to define a status to negate another status (e.g. -"needs-work" to negate "has-review") because negation is built into each -status via the status' "denied" state. Bug statuses: Previously only -attachments could have these kinds of statuses. RS enables them for bugs as -well. This feature can be used to request and grant/deny certain properties -for a bug, such as inclusion for a specific milestone or approval for checkin. -This way, Bugzilla supports the natural decision-making process in your -organization. - -- Requests: Flags can now optionally be made requestable, which means users - can ask other users to set them. When a user requests a flag, Bugzilla - emails the requestee and adds the request to a browsable queue so both the - requester and the requestee can keep track of its status. Once the - requestee fulfills the request by setting the flag to either granted or - denied, Bugzilla emails the requestee and removes the request from the - queue. This feature supports workflow like the mozilla.org code review - and milestone approval processes, whereby code is peer reviewed before - being committed and patches get approved by product release managers for - inclusion in specific product releases. - -- Product/component specificity: Previously flags were product-specific, and - if you wanted the same flag for multiple products you had to define - multiple flags with the same name. Flags are now - product/component-specific, and a single flag can be enabled or disabled - for multiple product/component combinations via inclusions and exclusions - lists. Flags are enabled for all combinations on their inclusions list - except those that appear on their exclusions list. - - -Enterprise Group Support ------------------------- - -Bugzilla is no longer limited to 55 access control groups. Administrators can -define an arbitrary number of access groups composed of individual users or -other groups. The groups can be configured via the web interface to achieve a -wide variety of access control policies. See the documentation section on -'Groups And Group Controls' for details. - - -User Wildcard Matching ----------------------- - -Sites can now enable the use of wildcards and substrings in bug entry and -editing forms. If the user enters an incomplete username, he'll get a list of -users that matched the given username. - - -Support for "Insiders" ----------------------- - -If the 'insidergroup' parameter is defined, a specific group of users can be -designated insiders who can designate comments and attachments as private to -other insiders. These comments and attachments will be invisible to other -users who are not members of the insiders group even if the bugs to which they -apply are visible. Other insiders will see the comments and attachments with a -visual tinting indicating that they are private. - - -Time Tracking -------------- - -Controls for tracking time spent fixing bugs are included in the bug form for -members of the group specified by the 'timetrackinggroup' parameter. Any time -comments are added to the bug, members of the time tracking group can add an -amount of time they spent, and it's figured into the total and displayed at -the top of the bug. Shown in the bug are your original estimate, the amount of -time spent so far, the revised estimate of how much time is remaining, and -your gain/loss on the original estimate. - - -Authentication module/LDAP improvements ---------------------------------------- - -Bugzilla's authentication mechanisms have been modularized, making pluggable -authentication schemes for Bugzilla a reality. Both the existing database and -LDAP systems were ported as part of modularization process. Additionally, the -CGI portion of the backend was redesigned to allow for authentication from -other sources, including (theoretically) email, which will help Bug 94850. - -As part of this conversion, LDAP logins now use Perl's standard Net::LDAP -module, which has no external library dependencies. - - -Improved localization support ------------------------------ - -Bugzilla administrators can now configure which languages are supported by -their installations and automatically serve correct, localized content to -users based on the HTTP 'Accept-Language' header sent from users' browsers. - -There are currently localized templates available for: Arabic, Belarusian, -Chinese, French, German, Italian, Korean, Portuguese (Brazil) Spanish (Spain -or Mexico) and Russian. These localized template packs are third-party -contributions, may only be available for specific versions, and may not be -supported in the future. (http://www.bugzilla.org/download/#localizations) - - -Patch Viewer ------------- - -Viewing and reviewing patches in Bugzilla is often difficult due to lack of -context, improper format and the inherent readability issues that raw patches -present. Patch Viewer is an enhancement to Bugzilla designed to fix that by -offering increased context, linking to sections, and integrating with Bonsai, -LXR and CVS. - - -Comment Reply Links -------------------- - -In Edit Bug, each bug comment now includes a convenient (reply) link that -quotes the comment text into the textarea. This feature is only enabled in -Javascript-capable browsers, but causes no inconvenience to other user agents. - - -Full-Text Search ----------------- - -It is now possible to query the Bugzilla database using full-text searching, -which spans comments and summaries, and which searches for substrings and stem -variations of the search term. Basically, it's like using Google. - - -Email Address Munging ---------------------- - -The fact that raw email addresses are displayed in Bugzilla makes it trivial -for bots that spamharvest to spider through Bugzilla, in particular, through -Bugzilla's buglists. This change adds HTML obfuscation of email addresses as -they appear in the Bugzilla web pages. - - -Google-like Bug Search ----------------------- - -Bugzilla now includes a very simple, Google-like "Find a Specific Bug" page, -in addition to its advanced search page. - - -Miscellaneous Improvements --------------------------- - -- The "Assigned To" field on the new bug page is now prefilled with the default - component owner. - -- A bug alias column is now available in the buglist page. - -- Lists of bugs containing errors in the sanity check page now have a "view as - buglist" link in addition to the individual bug links. - -- Autolinkification Page - It's now possible to apply Bugzilla's comment - hyperlinking algorithm to any text you like. This should be useful for status - updates and other web pages which give lists of bugs. The bug links created - include the subject, status and resolution of the bug as a tooltip. - -- There are more <link> tags on the links toolbar for navigating quickly between - different areas. - -- Buglists are now available as comma-separated value files (CSV) and JavaScript - (JS) as well as HTML and RDF. - -- Keywords and dependencies can now be entered during initial bug entry. - -- A CSS id signature unique to each Bugzilla installation is now added to the - <body> tag on Bugzilla pages to allow custom end-user CSS to explicitly affect - Bugzilla. - -- Perl's path has been changed to a normal /usr/bin/perl from the original - legacy "bonsaitools" path specifier. - -- A new "always-require-login" parameter allows administrators to require a - login before being able to view any page, except the front page. - -- A developer may add an attachment, and also reassign a bug to himself as part - of that single action. - -- Bugzilla is now able to use the replication facilities provided by the - MySQL database to handle updates from the main database to the secondaries. - -- Mail handling is now between 125% to 175% faster. - -- Guided Bug Entry: You can see a sample enter_bug.cgi template at - enter_bug.cgi?format=guided that "guides" users through the process of - filing a "good" bug. It needs to be modified before use in your organization. - -- There is now a "Give me some help" link on the Advanced Search page that will - enable pop-up help for every field on the page. - -- The Bugzilla administrator can now forbid users from marking bugs RESOLVED - when there are unresolved dependencies. - - -All Changes ------------ - -To see a list of EVERY bug that was fixed between 2.16 and 2.18 (over 1000), -see: http://tinyurl.com/6m3e4 - - -What's Changed? -*************** - - -Flag names ----------- - -Prerelease versions of Bugzilla 2.17 and 2.18 inadvertantly allowed -commas and spaces in the names of flags, which due to the way they're -processed, caused lots of internal havoc if you named flags to have -any commas or spaces in them. Having commas or spaces in the names -can cause errors in the notification emails and in the bug activity -log. The ability to create new flags with these characters has been -removed. If you have any existing flags that you named that way, -running checksetup will attempt to automatically rename them by -replacing commas and spaces with underscores. - - -New Saved Search User Interface -------------------------------- - -In previous Bugzilla versions, you could specify on the search page that you -wanted to save a search and store it as a link in your footer. This option has -now moved to the search results page (buglist.cgi), where you will see a -"Remember search" button with a box next to it to enter the name of the search. - -You can manage your saved searches on the Preferences page. - - -Rules for changing fields -------------------------- - -There have been some changes to the rules governing who can change which fields -of a bug report. The rules for Bugzilla version 2.16 and 2.18, along with -differences between them, are listed below. Bear in mind that there are other -restrictions on bug manipulation besides the ones listed below. In particular, -the groups system enforces restrictions on who can create, edit, or even see -any given bug. - -Bugzilla 2.16 rules: - -- anyone can make a null change; -- anyone can add a comment; -- anyone in the editbugs group can make any change; -- the reporter can make any change to the status; -- anyone in the canconfirm group can change the status - to any opened state (NEW, REOPENED, ASSIGNED). -- anyone can change the status to any opened state - if the everconfirmed flag is set; -- the owner, QA contact, or reporter can make any change - *except* changing the status to an opened state; -- No other changes are permitted. - -[Note that these rules combine to allow the reporter to make any change -to the bug.] - -Bugzilla 2.18 rules: - -- anyone can make a null change; -- anyone can add a comment; -- anyone in the editbugs group can make any change; -- anyone in the canconfirm group can change the status - from UNCONFIRMED to any opened state; -- the owner or QA contact can make any change; -- the reporter can make any change *except*: - - changing the status from UNCONFIRMED to any opened state; or - - changing the target milestone; or - - changing the priority (unless the letsubmitterchoosepriority - parameter is set). -- No other changes are permitted. - -The effective differences in the rules: - -- In 2.16, the reporter could always change anything about a bug. - - In 2.18, the reporter can't: - - - confirm the bug unless he is in the canconfirm group; - - change the target milestone; - - change the priority (unless the 'letsubmitterchoosepriority' - parameter is set; - - (unless he is also the owner, the QA contact, or in the editbugs - group, in which case he can do all these things). - -- In 2.16, the owner or QA contact (if the 'useqacontact' parameter - is set) can't change the bug status to an opened status unless they - are also the reporter, or have editbugs or canconfirm, or the - everconfirmed flag is set on the bug). - - In 2.18 the owner or QA contact can make any change to a bug. - -- In 2.16, a member of the canconfirm group can set the status - to any opened status. - - In 2.18 this is only possible if the status was previously - the unconfirmed status. - -- In 2.16, the status can be set to anything by anybody - if the 'everconfirmed' flag is set. - - In 2.18, this authorization code does not pay any attention - to the 'everconfirmed' flag. - - -Removed Features -**************** - -- Please note that Bugzilla no longer supports MySQL 3.22. The minimum required - version is now 3.23.41. - -- The "shadow database" mechanism is no longer used. Instead, use MySQL's - built-in replication feature. - -- If you have placed any comments in the localconfig file, they may be removed - by checksetup.pl. - - -Code Changes Which May Affect Customizations -******************************************** - -- A mechanism (called "Template Hooks") for third party extensions to plug into - existing templates without having to patch or replace distributed templates - has been added. More information on this can be found in the documentation. - -- Header output now uses CGI.pm, in a step towards enabling mod_perl - compatibility. This change will affect users that had customized charsets in - their CGI files: previously the charset had to be added everywhere that - printed the Content-Type header; now it only needs changing in one spot, in - Bugzilla/CGI.pm. - -- $::FORM{} and $::COOKIE{} are deprecated. Use the $cgi methods to access - them. - -- $::userid is gone in favor of Bugzilla->user->id - -- ConnectToDatabase() is gone (it's done automatically when you initialize the - Bugzilla object) - -- quietly_check_login() and confirm_login() are gone, use Bugzilla->login() - with parameters for whether the login is required or not. - -- Use Bugzilla->user->login in place of $::COOKIE{Bugzilla_login} - -- You can tell if there's a user logged in or not by using - Bugzilla->user rather than looking for $::userid==0. - In new 2.18 code, use defined(Bugzilla->user) && (Bugzilla->user->id) - In 2.20, this will become just (Bugzilla->user->id) - In templates, always test [% IF user.id %] rather than [% IF user %] - -- SendSQL() and related calls are deprecated, and the various $dbh methods - should be used instead, such as $dbh->prepare() and $dbh->execute(). - Bugzilla->dbh is the $dbh handle to use. - - -Recommended Practice for the Upgrade -************************************ - -Note About Upgrading From MySQL With ISAM Tables ------------------------------------------------- -As previously noted in the Dependency Requirements MySQL is now required -to be at least version 3.23.41. This implies that all tables of type ISAM will -be converted by the checksetup.pl script to MyISAM. - - -Steps for Upgrading -------------------- - -1) View the Sanity Check (sanitycheck.cgi) page on your installation before - upgrading. - -2) As with any upgrade it is recommended that you make a backup of the - Bugzilla database before you upgrade, perhaps by using mysqldump. - - Example: - - mysqldump -u root -p --databases bugs > bugs.db.backup - -3) Replace the files in your installation, or you can try to use CVS to upgrade. - The Bugzilla.org website has instructions on how to do the actual - installation. - -4) Make sure that you run checksetup.pl after you install the new version. - -5) View the Sanity Check page again after you run checksetup.pl. - -6) It is recommended that, if possible, you fix any problems you find - immediately. Failure to do this may mean that Bugzilla will not work - correctly. Be aware that if the sanity check page contains more errors after - an upgrade, it doesn't necessarily mean there are more errors in your - database, as additional tests are added to the sanity check over time, and - it is possible that those errors weren't being checked for in the old - version. - - -Outstanding Issues -****************** - -These are known problems with the release that we think you should know about. -They each have a bug number for http://bugzilla.mozilla.org/ - -- If at any time you upgraded from a version of Bugzilla between 2.17.4 - - 2.17.7 to either 2.18rc3 or 2.19.1, you must manually fix your New Charts in - order for them to work. See the following link for instructions on how to do - this: https://bugzilla.mozilla.org/show_bug.cgi?id=276237#c18 - If you are using 2.18rc3, but did not upgrade from version 2.17.4 or newer, - then you don't need to do this. - -- bug 37765: If you use an MTA other than sendmail (such as Postfix, Exim, - etc.) you MUST turn on the "sendmailnow" parameter or Bugzilla will not send - e-mail correctly. - -- bug 276230: The support for restricting access to particular Categories of - New Charts is not complete. You should treat the 'chartgroup' Param as the - only access mechanism available. However, additionally, charts migrated from - Old Charts will be restricted to the groups that are marked MANDATORY for - the corresponding Product. There is currently no way to change this - restriction, and the groupings will not be updated if the group configuration - for the Product changes. - -- bug 69621: If you rename or remove a keyword that is in use on bugs, you will - need to rebuild the "keyword cache" by running sanitycheck.cgi and choosing - the option to rebuild the cache when it asks. Otherwise keywords may not show - up properly in search results. - -- (No Bug Number) If you have a lot of non-ASCII data in your Bugzilla (for - example, if you use a translation of Bugzilla), don't enable the XS::Stash - option when you install the Template Toolkit, or your Bugzilla installation - may become slow. This problem is fixed in a not-yet-released version of the - Template Toolkit (after 2.14). - -- bug 266579: Users may be able to circumvent not having "canconfirm" privileges - in some circumstances. This is fixed starting with 2.19.3, but will not - be fixed in any 2.18 release, as the changes required to fix it are quite - large. - -- bug 99215: Attachment changes have no mid-air collision detection, unlike bug - changes. - -- bug 57350: Searching using the "commenter is" option may be VERY slow. Note - that searching for "field: comment, changed by: user@domain.com" is fast, - though. - -- bug 151509: Using the boolean chart option "contains the string" with the - "flag name" field or certain other fields will cause Bugzilla to emit an - error. This is fixed in 2.20rc1, but will not be fixed in the 2.18 series. - -- bug 234159: Bugzilla may sometimes send multiple notices in one email. - -- bug 237107: If you search for attachment information using the Boolean Charts - at the bottom of the Advanced Query page, bugs without attachments will not - show up in the result list. - - -Security Fixes In 2.18 Releases -******************************* - -Version 2.18 ------------- - -Summary: XSS in Internal Error messages in Bugzilla 2.16.7 and 2.18rc3 -CVE Name: CAN-2004-1061 -Reference: https://bugzilla.mozilla.org/show_bug.cgi?id=272620 -Details: - It is possible to send a carefully crafted URL to Bugzilla designed to -trigger an error message. The Internal Error message includes javascript code -which displays the URL the user is visiting. The javascript code does not -escape the URL before displaying it, allowing scripts contained in the URL to -be executed by the browser. Many browsers do not allow unescaped URLs to be -sent to a webserver (thus complying with RFC 2616 section 2.3.1 and RFC 2396 -section 2.4.3), and are thus immune to this issue. - Browsers which are known to be immune: Firefox 1.0, Mozilla 1.7.5, -Camino 0.8.2, Netscape 7.2, Safari 1.2.4 - Browsers known to be susceptible: Internet Explorer 6 SP2, -Konqueror 3.2 - Browsers not listed here have not been tested. - - -Version 2.18.1 --------------- - -Two security issues were fixed in Bugzilla 2.18.1, neither of them -critical. - -See http://www.bugzilla.org/security/2.16.8/ for details. - - -Version 2.18.2 --------------- - -Two security issues were fixed in Bugzilla 2.18.2. One of them -is a major Information Leak/Unauthorized Bug Change. The other -is a minor Information Leak. - -See http://www.bugzilla.org/security/2.18.1/ for details. - - -Detailed Version-To-Version Release Notes -***************************************** - -********************************************************* -*** USERS UPGRADING FROM ALL VERSIONS PRIOR TO 2.16.7 *** -********************************************************* - -*** Security fixes *** - -- It is possible to send a carefully crafted HTTP POST message to - process_bug.cgi which will remove keywords from a bug even if you don't have - permissions to edit all bug fields (the "editbugs" permission). Such changes - are reported in "bug changed" email notifications, so they are easily - detected and reversed if someone abuses it. Users are now prevented from - making changes to keywords if they do not have editbugs privileges. (bug - 252638) - -*** Bug fixes of note *** - -- Enforce a minimum of 10 minutes between attempts to reset a password, so - we don't mailbomb the user if someone submits the form many times in a - row. (bug 250897) - -- Put products in alphabetical order on the create attachment status page. - (bug 251427) - -- Specify MyISAM as the table type when creating new tables. MySQL 4.1 and - up default to InnoDB, which doesn't support some of the indexing methods - that we use. (bug 263165) - -********************************************************* -*** USERS UPGRADING FROM ALL VERSIONS PRIOR TO 2.16.6 *** -********************************************************* - -*** Security fixes *** - -- If Bugzilla is configured to hide entire products from some users, both - duplicates.cgi and the form for mass-editing a list of bugs in buglist.cgi - can disclose the names of those hidden products to such users. - (bugs 234825 and 234855) - -- Several administration CGIs echo invalid data back to the user without - escaping it. (bug 235265) - -- A user with privileges to grant membership to any group (i.e. usually an - administrator) can trick editusers.cgi into executing arbitrary SQL. - (bug 244272) - -*** Bug fixes of note *** - -- Allow XML import to function when there are regexp metacharacters in product - names (bug 237591) - -- Allow the bug_email.pl contrib script to work with useqacontact (bug 239912) - -- Improve the error message used by checksetup.pl when the MySQL requirements - are not met (bug 240228) - -- Elimnate the warning in checksetup.pl about the minimum sendmail version (bug - 240060) - -- $webservergroup now defaults to group 'apache' in new installations (bug - 224477) - -- Correct a situation where a bugmail message could be sent twice to a user - being added to the CC list if the address was entered in a different case - than the user registered with. (bug 117297) - -- Various documentation updates - -********************************************************* -*** USERS UPGRADING FROM ALL VERSIONS PRIOR TO 2.16.4 *** -********************************************************* - -*** Bug fixes of note *** - -- Fix a "used only once" warning that ocurred only in perl 5.00503 - (bug 2321691) - -- When a user is creating a new account and enters an invalid email - address, the error page sent the "Content-type" header twice, causing - the second one to be visible at the top of the page. - (bug 137121) - -- An HTML encoding issue which only affected Internet Explorer was - corrected in the "Change several bugs at once" page. - (bug 181106) - -- During initial setup, using invalid characters in the administrator - password would present an error message stating your password was - too long or too short instead of telling you it had invalid - characters. - (bug 166755) - -- When a user reset their own password via an emailed token, the new - password in the first field would be accepted if the second password - field was left blank. - (bug 123077) - -- Reopening bugs from the "change several bugs at once" page now works. - (bug 95430) - -- Fix a regression in xml.cgi caused by the previous bugfix for MySQL - SUM() changes. The original fix didn't work properly either. - (bug 225474) - -- No longer use server push with the "Safari" browser, which claims to - use the Mozilla layout engine but doesn't. - (bug 188712) - -- Creating a shadow database no longer fails with taint mode errors. - (bug 227510) - -- If you change your cookiepath setting at some stage (because you have - moved the directory Bugzilla resides on your webserver), users can - have login cookies with the old cookiepath, and their browsers will - send multiple logincookies. Bugzilla now uses the first rather than - the last in order to get the most specific cookie which will be the - correct one. - (bug 121419) - -- Fixed a regression caused by the previous DBD::mysql fixes, that - caused older versions of DBD::mysql to break due to not supporting - the new DBI syntax. - (bug 224815) - -- Bugzilla no longer sends out invalid dates for cookie expiry. This - bug had no known user visible ramifications. - (bug 228706) - -- Update the shadow database parameters description to tell the user - about permissions requirements for creating a shadow database. - (bug 227513) - -- Various documentation updates. - -********************************************************* -*** USERS UPGRADING FROM ALL VERSIONS PRIOR TO 2.16.3 *** -********************************************************* - -*** SECURITY ISSUES RESOLVED *** - -- A user with 'editproducts' privileges (i.e. usually an administrator) - can select arbitrary SQL to be run by the nightly statistics cron job - (collectstats.pl), by giving a product a special name. - (bug 214290) - -- A user with 'editkeywords' privileges (i.e. usually an administrator) - can inject arbitrary SQL via the URL used to edit an existing keyword. - (bug 219044) - -- When deleting products and the 'usebuggroups' parameter is on, the - privilege which allows someone to add people to the group which is - being deleted does not get removed, allowing people with that - privilege to get that privilege for the next group that is created - which reuses that group ID. Note that this only allows someone who - had been granted privileges in the past to retain them. - (bug 219690) - -- If you know the email address of someone who has voted on a secure - bug, you can access the summary of that bug even if you do not have - sufficient permissions to view the bug itself. - (bug 209376) - -*** Bug fixes of note *** - -Perl 5.8.0 Compatibility fixes: - -- Two taint errors were fixed, one in process_bug.cgi, and - another in post_bug.cgi. - (bugs 220332 and 177828) - -MySQL 4.0 Compatibility fixes: - -- A cosmetic fix was applied to votes.cgi (if there were no - votes, the "0" was not displayed) due to a change in semantics - in SUM() in MySQL 4.0. - (bug 217422) - -DBD::mysql > 2.1026 Compatibility fixes: - -- DBD::mysql versions after 2.1026 return the table list quoted, which - broke the existing "table exists" check in checksetup.pl, which caused - the second and subsequent attempts to run checksetup.pl to fail. - (bug 212095) - -Miscellaneous bug fixes: - -- A Mozilla-specific reference was removed from one of the report - templates. - (bug 221626) - -- It was possible to enter a situation where you were unable to get to - editparams.cgi to turn the shutdownhtml param back off after you - turned it on when Apache was configured to run Bugzilla in suexec - mode. - (bug 213384) - -- The processmail rescanall task would not send e-mails about more than - one bug to the same address. - (bug 219508) - -- If Bugzilla hadn't been accessed in the last hour when the - collectstats.pl or whineatnews.pl cron jobs ran, the versioncache - would get recreated with the file owner being the user the cron job - was running as (usually not the webserver user), causing subsequent - access to Bugzilla by the webserver to fail until the permissions were - fixed. Now if versioncache isn't readable when accessing from the - webserver, we pretend it doesn't exist and recreate it again. - (bug 160422) - -- The 'sendmailnow' param is now on by default in new installations - (this does not affect existing installations). - (bug 146087) - -- The 008filter.t test would fail if you had multiple language packs - installed. It now properly tests all of the installed language packs. - (bug 203318) - -- A few minor documentation changes were committed. - -********************************************************* -*** USERS UPGRADING FROM ALL VERSIONS PRIOR TO 2.16.2 *** -********************************************************* - -*** SECURITY ISSUES RESOLVED *** - -- A cross site scripting (XSS) vulnerability was fixed in which bug - summaries were not properly filtered when a user viewed a dependency graph - allowing JavaScript to be embedded on that page. - (bug 192661) - -- Several XSS vulnerabilities were fixed in which user - input was not escaped when being displayed. A new - test has been added to warn about unfiltered data in template - files (t/008filter.t). - (bug 192677) - -- An issue was fixed in which the QA contact was still treated as the QA - contact even after the 'useqacontact' setting was turned off. This also - allowed the QA contact to edit the security groups and view secured bugs that - he/she was allowed to access prior to the 'useqacontact' setting being - deactivated. - (bug 194394) - -- Fixed a situation where an attacker (with local access to the webserver) - could overwrite any file on the webserver to which the webserver user - has write access by creating appropriately named symbolic links in the - data and webdot directories (world-writable in many configurations). - Bugzilla now uses File::Temp to create secure temporary files. File::Temp - is part of the Perl distribution for Perl 5.6.1 and later, but if you're - using an older version of Perl you'll need to install it with CPAN. - (bug 197153) - -** IMPORTANT CHANGES *** - -- New module requirement: File::Temp, as mentioned above. - -*** Bug fixes of note *** - -- An issue was fixed in which administrator rights could be removed from an - administrator who deleted a product while the 'usebuggroups' setting is - activated. - (bug 157704) - -- Fixed an issue in which importxml.pl would fail the test suite when running - under perl 5.8.0 with the optional XML::Parse module. - (bug 172331) - -- There was previously a bug in CGI.pl in which the following warning - would be given under certain conditions: - "Character in "c" format wrapped at CGI.pl..." - This is now fixed. In some cases the warning was filling up web server log - files. - (bug 194125) - -- Fixed a bug in which long component names (in excess of 50 characters) would - be accepted when creating the component but would cause problems when trying - to use that component on a bug because it would get truncated. It is now no - longer possible to create components with names in excess of 50 characters. - (bug 197180) - -- Fixed a bug in checksetup.pl in which permissions were not being fixed - on the 'data/comments' file, the quip file. - (bug 160279) - -***************************************************************** -*** USERS UPGRADING FROM 2.16.1 OR EARLIER, 2.14.4 OR EARLIER *** -***************************************************************** - -*** SECURITY ISSUES RESOLVED *** - -- Fixed a cross site scriptability issue in quips. This is only a problem - if quips with HTML could have been inserted into your quips files. Bugzilla - has not allowed this since 2.12. - (bug 179329) -- checksetup.pl will now attempt to prevent access to "editor backups" of - localconfig. - (bug 186383) -- collectstats.pl no longer makes data/mining (which contains graphing - information) world writeable. - (bug 183188) - -*********************************************** -*** USERS UPGRADING FROM 2.16.0 OR EARLIER *** -*********************************************** - -*** SECURITY ISSUES RESOLVED *** - -- Apostrophes were not properly handled in email addresses. This was a - regression introduced in 2.16. It is not known whether this was - exploitable. - (bug 165221) - -See also next major section. - -*** Bug fixes of note *** - -- The VERSION cookie which allowed the previously entered version of a product - to be remembered was not correctly set. It was only set as a session - cookie, and under some circumstances could interfere with other cookies - (such as the login information) send at the same time. - (bug 160227) - -- importxml.pl would fail if the versioncache needed to be updated. - (bug 164464) - -- Bug changes going through intermediate pages would munge fields with - multiple fields, such as CCs. - (bug 161203) - -- On failure in template->new, Bugzilla will now die rather than futilely - attempt to use an error template. - (bug 166023) - -- Fixed a problem where checksetup had problems converting old installations - that didn't have a duplicates table. - (bug 151619) - -- Fixed a problem that caused taint errors when viewing or editing user - preferences with Perl 5.005 and Template 2.08. - (bug 160710) - -See also next section. - -****************************************************** -*** USERS UPGRADING FROM 2.16.0, 2.14.3 OR EARLIER *** -****************************************************** - -*** SECURITY ISSUES RESOLVED *** - -- When a new product is added to an installation with 47 groups or more and - "usebuggroups" is enabled, the new group will be assigned a groupset bit - using Perl math that is not exact beyond 2^48. This results in the new - group being defined with a "bit" that has several bits set. As users are - given access to the new group, those users will also gain access to - spurious lower group privileges. Also, group bits were not always reused - when groups were deleted. - (bug 167485) - -- The email interface had another insecure single parameter system call. This - could potentially allow arbitrary shell commands to be run. This file is - not supported at this time, but as long as we knew about the problem, we - couldn't overlook it. - (bug 163024) - -*** Bug fixes of note *** - -- The email interface was broken. This was a 2.14.3 regression. This file - is not supported at this time, but as long as we knew about the problem, we - couldn't overlook it. - (bug 160631) - -*********************************************** -*** USERS UPGRADING FROM 2.14.5 OR EARLIER *** -*********************************************** - -*** SECURITY ISSUES RESOLVED *** - -- The bug reporter could set the priority even when - 'letsubmitterchoosepriority' was off. - (bug 63018) - -- Most CGIs are now templatized. This helps to make it - easier to remember to HTML filter values and easier to spot - when they are not, preventing cross site scripting attacks. - (bug 86168) - -- Most CGIs now run in taint mode. This helps to prevent - failure to validate errors. - (bug 108982) - -*** IMPORTANT CHANGES *** - -- 2.16 introduces "templatization", a new feature that allows - administrators to easily customize the HTML output (the "look and feel") - of Bugzilla without altering Perl code. Bugzilla uses the - "Template Toolkit" for this. Please see the "Template Customization" - section of the Bugzilla Guide for more details. - - Administrators who ran the 2.15 development version with custom - templates should check the templates are still valid, as file names - and file paths have changed. - - Most output is now templatized. This process will be complete next - milestone. - - For speed, compiled templates are cached on disk. If you modify the - templates, the toolkit will normally detect the changes, and recompile the - changed templates. - - Adding new directories anywhere inside the template directory may cause - permission errors if you don't have a webservergroup specified in - localconfig. If you see these, rerun checksetup.pl as root. If you do not - have root access, or cannot get someone who does to do this for you, you can - rename the data/template directory to data/template.old (or any other name - Bugzilla doesn't use). Then rerun checksetup.pl to regenerate the compiled - templates. - (bug 86168, 97832) - -- Administrators can now configure maximum attachment sizes. These - should remain below the maximum size for your MySQL server, or you - will get obscure MySQL errors if you attach a bigger attachment. - - To find out the current size attachment that MySQL can accept, type - the command 'mysqladmin variables' and find out the value of the - 'max_allowed_packet' varible in bytes. - - To change the maximum size that MySQL can accept you can alter this - variable in your 'my.cnf' file. - (bug 91664) - -- Perl 5.004 is no longer supported because the Template Toolkit - requires 5.005. - (bug 97721) - -- New module requirements: Text::Wrap, Template [requires AppConfig], - File::Spec. - (bugs 97784, 84338, 103778) - -- The index page is now a CGI instead of an HTML page. You should remove - any existing index.html file and make sure your web server allows index.cgi - to be the default page in a directory. If you are not able to do that you - can instead set index_html in the 'localconfig' file to 1 and checksetup.pl - will create a redirect page for you. - (bug 80183) - -- It is now recommended that administrators run "processmail rescanall" - after upgrading to 2.16 or beyond. - - This will send out notification emails for changes that were - made but not emailed, due to Bugzilla bugs. All known - causes of this have been fixed in this version (bug 104589 and 99519). - - It is also recommended that this be run nightly to avoid - lengthy delays in future if this problem reoccurs. - (bug 106377) - -- In parallel with templatization, a lot of changes have been made to the HTML - output of the Bugzilla CGIs. This could break code that attempts to parse - such code. For example, this breaks mozbot. - (no bug number) - -- The "HTML template" parameters (headerhtml, bodyhtml, footerhtml, - errorhtml, bannerhtml, blurbhtml, mostfreqhtml, entryheaderhtml) have now - been moved to Template Toolkit templates. If you have modified these - parameters you will need to make corresponding changes to the corresponding - templates. Your old parameter values will be moved to a file called - old-params.txt by checksetup.pl. - - The old parameters correspond to files in template/en/default as follows: - - headerhtml: global/header.html.tmpl - footerhtml: global/footer.html.tmpl - bannerhtml: global/banner.html.tmpl - blurbhtml: global/banner.html.tmpl - mostfreqhtml: reports/duplicates*.html.tmpl - entryheaderhtml: bug/create/user-message.html.tmpl - - (bug 140437) - -*** Other changes of note *** - -- The query page has been redesigned for better user friendliness. - (bug 98707) -- Users can now change their email account. - (bug 23067) -- "Dependent Bug Changed" notification emails now contain the - dependent bug's summary and URL. - (bug 28736, 113383) -- Bugs with severity "critical", "blocker", and "enhancement" are - visually differentiated on bug lists for browsers with sufficient - CSS support. - (bug 28884) -- Bugzilla now has a sidebar for the Mozilla browser. - (bug 37339) -- A link to just created attachments now appears in notification - email. - (bug 66651) -- Comments now have numbers and can be referenced with - autohyperlinkifying similar to bugs. - (bug 71840) -- The attachment system has been rewritten, supporting new - "attachment statuses" (like keywords, but for attachments), - the ability to obsolete attachments, edit attachment MIME type, - and edit whether the attachment is a patch. - (bugs 84338, 75176) -- syncshadowdb now supports a configurable temp file location, - and properly shuts down Bugzilla while running. - (bug 75840) -- Dependency tree now lets you exclude resolved bugs and bugs - below a specified depth. - (bugs 83058) -- The "strictvaluechecks" parameter has gone away. These checks - are now always done. - (bug 119715) -- The midair collision page now shows all changes since the bug - page was loaded, not just the last one. - (bug 108312) -- Added support for making dependency graphs with 'dot', which - is better at creating complex graphs than 'webdot'. - (bug 120537) - -*** Bug fixes of note *** - -- Bugzilla scripts are now usually not terminated when the browser - window they are running in is closed. This caused hard to - reproduce bugs. - (bug 104589) -- On browsers that "reflow" the page, large component / milestone / - version fields were extremely slow to reflow when you altered - the product field. - (bug 96534) -- The selection in the component / milestone / version fields is - no longer lost when you change the selection in the product - field or use the back/forward buttons in your browser to return - to the page. - (bug 97966) -- You could not reverse dependencies in one step. - (bug 82143) -- Mass reassignment of non-open bugs will no longer reopen them. - (bug 30731) -- Attempting to bulk change no bugs will now give a user-friendly - error message. - (bug 90333) -- If you make a change to a bug where you only add yourself to CC, - email notifications are now properly sent out for MySQL 3.23. - (bug 99519) -- Bug entry now properly validates the data it has been sent. - (bug 107743) -- Midair collision checks will now properly work in all situations - where dependencies have changed. - (bug 73502) -- Browsers can no longer corrupt the params file if they use the "wrong" - end-of-line markers. - (bug 92500) -- The MySQL port defined in localconfig is now properly honoured. - (bug 98368) -- Apostrophes in component/milestone/version names no longer cause - a problem on the query page. - (bug 30689/42810) -- File attachment comments will now wrap. - (bug 52060) -- Saved queries are no longer mangled if you need to log in again, - for example if you had cookies off. - (bug 38835) -- Bug counts (on reports.cgi) were very slow if you had to - count a lot of bugs. - (bug 63249) -- 2.14 introduced options to let people see a bug when their name - is on it but who aren't in the groups the bug is restricted - to. These only allowed the people to view the bugs directly, - and not see them on buglists and receive email about them. - (bugs 95024, 97469) -- A new 'cookiepath' parameter on editparams.cgi allows multiple - Bugzilla installations to exist on one host without problems. - (bug 19910) -- whineatnews.pl now respects the 'sendmailnow' parameter. - (bug 52782) -- The query page came up even when Bugzilla was shut down. - (bug 121747) -- Quicksearch gave a weird error message when Bugzilla was - shut down. - (bug 121741) -- Operating system detection fixes. - (bugs 92763, 135666) -- QA contacts now receive emails when a new bug is created and - their only email preference was being added or removed from QA. - (bug 143091) - -*********************************************** -*** USERS UPGRADING FROM 2.14.4 OR EARLIER *** -*********************************************** - -See section above about users upgrading from 2.16.1 or earlier, -2.14.4 or earlier. - -*********************************************** -*** USERS UPGRADING FROM 2.14.3 OR EARLIER *** -*********************************************** - -See section above about users upgrading from 2.16.0 or earlier. - -*********************************************** -*** USERS UPGRADING FROM 2.14.2 OR EARLIER *** -*********************************************** - -*** SECURITY ISSUES RESOLVED *** - -- Basic maintenance on contrib/bug_email.pl and - contrib/bugzilla_email_append.pl which also fixes a - possible security hole with a misuse of a system() call. - These files are not supported at this time, but as long - as we knew about the problem, we couldn't overlook it. - (bug 154008) - -*** Bug fixes of note *** - -- The fix for bug 130821 in 2.14.2 broke being able to sort - bug lists on more than one field. buglist.cgi now allows - you to sort on more than one field again. - (bug 152138) - -*********************************************** -*** USERS UPGRADING FROM 2.14.1 OR EARLIER *** -*********************************************** - -*** SECURITY ISSUES RESOLVED *** - -- queryhelp.cgi no longer shows confidential products to - people it shouldn't. - (bug 126801) - -- It was possible for a user to bypass the IP check by - setting up a fake reverse DNS, if the Bugzilla web server - was configured to do reverse DNS lookups. Apache is not - configured as such by default. This is not a complete - exploit, as the user's login cookie would also need to - be divulged for this to be a problem. - (bug 129466) - -- In some situations the data directory became world writeable. - (bug 134575) - -- Any user with access to editusers.cgi could delete a user - regardless of whether 'allowuserdeletion' is on. - (bug 141557) - -- Real names were not HTML filtered, causing possible cross - site scripting attacks. - (bug 146447, 147486) - -- Mass change would set the groupset of every bug to be the - groupset of the first bug. - (bug 107718) - -- Some browsers (eg NetPositive) interacted with Bugzilla - badly and could have various form problems, including - removing group restrictions on bugs. - (bug 148674) - -- It was possible for random confidential information to be - divulged, if the shadow database was in use and became - corrupted. - (bug 92263) - -- The bug list sort order is now stricter about the SQL it will accept, - ensuring you use correct column name syntax. Before this, there were - some syntax checks, so it is not known whether this problem was - exploitable. - (bug 130821) - -******************************************** -*** USERS UPGRADING FROM 2.14 OR EARLIER *** -******************************************** - -The 2.14.1 release fixes several security issues that became -known to us after the Bugzilla 2.14 release. - -*** SECURITY ISSUES RESOLVED *** - -- If LDAP Authentication was being used, Bugzilla would allow - you to log in as anyone if you left the password blank. - (bug 54901) - -- It was possible to add comments or file a bug as someone else - by editing the HTML on the appropriate submission page before - submitting the form. User identity is checked now, and the - form values suggesting the user are now ignored. - (bug 108385, 108516) - -- The Product popup menu on the show_bug form listed all - products, even if the user didn't have access to all of them. - It now only shows products the user has access to (and the - product the bug is in, if the user is viewing it because of - some other override). - (bug 102141) - -- If a user had any blessgroupset privileges (the ability to - change only specific privileges for other users), it was - possible to change your own groupset (privileges) by - altering the page HTML before submitting on editusers.cgi. - (bug 108821) - -- An untrusted variable was echoed back to user in the HTML - output if there was a login error while editing votes. - (bug 98146) - -- buglist.cgi had an undocumented parameter that allowed you - to pass arbitrary SQL for the "WHERE" part of a query. - This has been disabled. - (bug 108812) - -- It was possible for a user to send arbitrary SQL by inserting - single quotes in the "mybugslink" field in the user - preferences. - (bug 108822) - -- buglist.cgi was not validating that the field names being - passed from the "boolean chart" query form were valid field - names, thus allowing arbitrary SQL to be inserted if you - edited the HTML by hand before submitting the form. - (bug 109679) - -- long_list.cgi was not validating that the bug ID parameter - was actually a number, allowing arbitrary SQL to be inserted - if you edited the HTML by hand. - (bug 109690) - -******************************************** -*** USERS UPGRADING FROM 2.12 OR EARLIER *** -******************************************** - -*** SECURITY ISSUES RESOLVED *** - -- Multiple instances of unauthorized access to confidential - bugs have been fixed. - (bug 39524, 39526, 39527, 39531, 39533, 70189, 82781) - -- Multiple instances of untrusted parameters not being - checked/escaped was fixed. These included definite security - holes. - (bug 38854, 38855, 38859, 39536, 87701, 95235) - -- After logging in passwords no longer appear in the URL. - (bug 15980) - -- Procedures to prevent unauthorized access to confidential - files are now simpler. In particular the shadow directory - no longer exists and the data/comments file no longer needs - to be directly accessible, so the entire data directory can - be blocked. However, no changes are required here if you - have a properly secured 2.12 installation as no new files - must be protected. - (bug 71552, 73191) - -- If they do not already exist, checksetup.pl will attempt to - write Apache .htaccess files by default, to prevent - unauthorized access to confidential files. You can turn this - off in the localconfig file. - (bug 76154) - -- Sanity check can now only be run by people in the 'editbugs' - group. Although it would be better to have a separate - group, this is not possible until the limitation on the - number of groups allowed has been removed. - (bug 54556) - -- The password is no longer stored in plaintext form. It will - be eradicated next time you run checksetup.pl. A user must - now change their password via a password change request that - gets validated at their e-mail account, rather than have it - mailed to them. - (bug 74032) - -- When you are using product groups and you move a bug between - products (single or mass change), the bug will no longer be - restricted to the old product's group (if it was) and will - be restricted to the new product's group. - (bug 66235) - -- There are now options on a bug to choose whether the - reporter, and CCs can access a bug even if they aren't in - groups the bug it is restricted to. - (bug 39816) - -- You can no longer mark a bug as a duplicate of a bug you - can't see, and if you mark a bug a duplicate of a bug - the reporter cannot see you will be given options as to - what to do regarding adding the reporter of the resolved - bug to the CC of the open bug. - (bug 96085) - -*** IMPORTANT CHANGES *** - -- Bugzilla 2.14 no longer supports old email tech. Upon - upgrading, all users will be moved over to new email tech. - This should speed up upgrading for installations with - a large number of bugs. - (bug 71552) - -- There is new functionality for people to see why they are - receiving notification mails. - - Previously, some people filtered old email tech - notifications depending on whether they were in the To or the - CC header, in order to get a limited way of determining why - they were receiving the notification for filtering purposes. - - Existing installations will need to make changes to support - this feature. The receive reasons can be added to the - notifications as a header and/or in the body. To add these - you will need to modify your newchangedmail parameter on - editparams.cgi, either by resetting it or appropriately - modifying it. The header value is specified by - %reasonsheader% and the body by %reasonsbody%. For example, - the new default parameter is: - - -------------------------------------------------- - From: bugzilla-daemon - To: %to% - Subject: [Bug %bugid%] %neworchanged%%summary% - X-Bugzilla-Reason: %reasonsheader% - - %urlbase%show_bug.cgi?id=%bugid% - - %diffs% - - - - %reasonsbody% - -------------------------------------------------- - - (bug 26194) - -- Very long fields (especially multi-valued fields like keywords, - CCs, dependencies) on bug activity and notifications previously - could get truncated, resulting in useless notifications and data - loss on bug activity. Now the multi-valued fields only show - changes, and very big changes are split into multiple lines. - Where data loss has already occurred on bug activity, it is - indicated using question marks. - (bug 55161, 92266) - -- Previously, when a product's voting preferences changed all - votes were removed from all the bugs in the product. Also, - when a bug was moved to another product, all of its votes - were removed. This no longer occurs. - - Instead, if the action would leave one or more bugs with - greater than the maximum number of votes per person per bug, - the number of votes will be reduced to the maximum. The - person will still be notified of this as before. - - If the action would leave a user with more votes in a product - than is allowed, the limit will be breached so as to not lose - votes. However the user will not be able to update their - votes except to fix this situation. No further action is taken - in this version to make sure that the user does this. - (bug 28882, 92593) - -*** Other changes of note *** - -- Groups can now be marked inactive, so you can't add a new - restriction on that group to a bug, while leaving bugs that - were previously restricted on that group alone. - (bug 75482) -- backdoor.cgi has been removed from the installation. It was - old code that was Netscape-specific and its name was scaring - people. - (bug 87983) -- You can now add or remove from CC on the bulk change page. - (bug 12819) -- New users created by administrators are now automatically - inserted into groups according to the group's regular - expression. Administrators must edit the user in a second - step to override these choices. Previously the - administrator specified these explicitly which could lead - to incorrect settings. - (bug 45164) -- The userregexp of system groups can now be edited without - resorting to direct database access. - (bug 65290) - -*** Bug fixes of note *** - -- The bug list page was sometimes bringing up a not logged in - footer when the user was logged in and the installation was - using a shadow database. - (bug 47914) -- You can now view the bug summary in your browser title for - a group-restricted bug if you have proper permissions. - (bug 71767) -- Quick search for search terms did not work in IE5. - This has been worked around. - (bug 77699) -- Quick search for search terms crashed NN4.76/4.77 for Unix. - This has been worked around. - (bug 83619) -- Queries on bugs you have commented on using the "added - comment" feature should be a lot faster and not time out - on large installations due to the addition of an index. - (bug 57350) -- You can now alter group settings on bulk change for groups - that aren't on for all bugs or off for all bugs. - (bug 84714) -- New bug notifications now include the CC and QA fields. - (bug 28458) -- Bugzilla is now more Windows friendly, although it is still - not an official platform. - (bug 88179, 29064) -- Passwords are now encrypted using Perl's encrypt function. - This makes Bugzilla more portable to more operating systems. - (bug 77473) -- Bugzilla didn't properly shut down when told to - some - queries could still be sent to the database. - (bug 95082) - -******************************************** -*** USERS UPGRADING FROM 2.10 OR EARLIER *** -******************************************** - -*** SECURITY ISSUES RESOLVED *** - -- Some security holes have been fixed where shell escape characters - could be passed to Bugzilla, allowing remote users to execute - system commands on the web server. - -*** IMPORTANT CHANGES *** - -- There is now a facility for users to choose the sort of - notifications they wish to receive. This facility will - probably be improved in future versions. - (bug 17464) - -- "Changed" will no longer appear on the subject line of - change notification emails. Because of this, you should - change the subject line in your 'changedmail' and - 'newchangedmail' params on editparams.cgi. The subject - line needs to be changed from - - Subject: [Bug %bugid%] %neworchanged% - %summary% - - to: - - Subject: [Bug %bugid%] %neworchanged%%summary% - - or whatever is appropriate for the subject you are using - on your system. Note the removal of the " - " in the - middle. - (bug 29820) - -*** Other changes of note *** - -- Bug titles now appear in the page title, and will hence - display in the user's browser's bookmarks and history. - (bug 22041) -- Edit groups functionality (editgroups.cgi). - (bug 25010) -- Support for moving bugs to other Bugzilla databases. - (bug 36133) -- Bugzilla now can generate a frequently reported bugs list - based on what duplicates you receive. - (bug 25693) -- When installing Bugzilla fresh, the administrator account is - now created in checksetup.pl. - (bug 17773) -- Stored queries now show their name above the bug list, which - helps the user when they have multiple bug lists in multiple - browser windows. It also appears in the page title, and will - hence display in the user's browser's bookmarks and history. - (bug 52228) -- All states and resolutions can now be collected for charting. - (bug 6682) -- A new search-engine-like "quick search" feature appears on - the front page to try and making searching easier. - (bug 69793) -- Querying on dependencies now works in the advanced query - section of the query page. - (bug 30823) -- When a bug is marked as a duplicate, the reporter of the - resolved bug is automatically added to the CC list of the - open bug. - (bug 28676) - -*** Bug fixes of note *** - -- Notification emails will now always be sent to QA contacts. - Previously they wouldn't if you were using new email tech. - (bug 30826) -- When marking a bug as a duplicate, the duplicate stamp marked - on the open bug will no longer be written too early (such as - on mid-air collisions). - (bug 7873) -- Various bug fixes were made to the initial assignee and QA - of a component. It is no longer possible to enter an - invalid address. They will also now properly update when - a user's email address is changed. Sanity check will now - check these. - (bug 66876) -- Administrators can no longer create an email accounts that do - not match the global email regular expression parameter. - Previously this could occur and would cause sanity check - errors. - (bug 32971) -- The resolution field can no longer become empty when the - bug is resolved. This occurred because of midair collisions. - (bug 49306) - -******************************************* -*** USERS UPGRADING FROM 2.8 OR EARLIER *** -******************************************* - -This version of Bugzilla cannot upgrade from version 2.8 (released -November 19, 1999). You will first have to upgrade to Bugzilla 3.6 and -then upgrade to the latest release. - -If you are upgrading from a version earlier than 2.8, See the -PGRADING-pre-2.8 file in Bugzilla 3.0 for information -on upgrading from a version that is earlier than 2.8. diff --git a/docs/en/rst/_static/bugzilla.css b/docs/en/rst/_static/bugzilla.css new file mode 100644 index 000000000..06f5c8375 --- /dev/null +++ b/docs/en/rst/_static/bugzilla.css @@ -0,0 +1,21 @@ +@import 'default.css'; + +dt { font-weight: bold; } + +/* Custom roles */ +.param { font-weight: bold; } +.paramval { font-family: monospace; } +.group { font-family: monospace; } +.field { font-weight: bold; } +.command { font-family: monospace; font-size: 130% } + +.admonition-todo { + background-color: lightpink; + border: 2px darkred solid; +} + +/* Make Buggie's antenna not take up so much space */ +.logo { + display: block; + margin-top: -20px; +} diff --git a/docs/en/rst/about/index.rst b/docs/en/rst/about/index.rst new file mode 100644 index 000000000..239c6ecea --- /dev/null +++ b/docs/en/rst/about/index.rst @@ -0,0 +1,128 @@ +.. _about: + +======================== +About This Documentation +======================== + +This is the documentation for version |version| of Bugzilla, a bug-tracking +system from Mozilla. Bugzilla is an enterprise-class piece of software +that tracks millions of bugs and issues for thousands of organizations around +the world. + +The most current version of this document can always be found on the +`Bugzilla website <http://www.bugzilla.org/docs/>`_. + +.. _evaluating: + +Evaluating Bugzilla +################### + +If you want to try out Bugzilla to see if it meets your needs, you can do so +on `Landfill <https://landfill.bugzilla.org/bugzilla-4.4-branch/>`_, our test +server. The `Bugzilla FAQ <https://wiki.mozilla.org/Bugzilla:FAQ>`_ may also +be helpful, as it answers a number of questions people sometimes have about +whether Bugzilla is for them. + +.. _getting-help: + +Getting More Help +################# + +If this document does not answer your questions, we run a +`Mozilla forum <https://www.mozilla.org/about/forums/#support-bugzilla>`_ +which can be accessed as a newsgroup, mailing list, or over the web as a +Google Group. Please +`search it <https://groups.google.com/forum/#!forum/mozilla.support.bugzilla>`_ +first, and then ask your question there. + +If you need a guaranteed response, commercial support is +`available <http://www.bugzilla.org/support/consulting.html>`_ for Bugzilla +from a number of people and organizations. + +.. _conventions: + +Document Conventions +#################### + +This document uses the following conventions: + +.. warning:: This is a warning—something you should be aware of. + +.. note:: This is just a note, for your information. + +A filename or a path to a filename is displayed like this: +:file:`/path/to/filename.ext` + +A command to type in the shell is displayed like this: +:command:`command --arguments` + +A sample of code is illustrated like this: + +:: + + First Line of Code + Second Line of Code + ... + +This documentation is maintained in +`reStructured Text +<http://docutils.sourceforge.net/docs/user/rst/quickstart.html>`_ format using +the `Sphinx <http://www.sphinx-doc.org/>`_ documentation system. It has +recently been rewritten, so it undoubtedly has bugs. Please file any you find, in +the `Bugzilla Documentation +<https://bugzilla.mozilla.org/enter_bug.cgi?product=Bugzilla;component=Documentation>`_ +component in Mozilla's installation of Bugzilla. If you also want to make a +patch, that would be wonderful. Changes are best submitted as diffs, attached +to a bug. There is a :ref:`Style Guide <style-guide>` to help you write any +new text and markup. + +.. _license: + +License +####### + +Bugzilla is `free <http://www.gnu.org/philosophy/free-sw.html>`_ and +`open source <http://opensource.org/osd>`_ software, which means (among other +things) that you can download it, install it, and run it for any purpose +whatsoever without the need for license or payment. Isn't that refreshing? + +Bugzilla's code is made available under the +`Mozilla Public License 2.0 <http://www.mozilla.org/MPL/2.0/>`_ (MPL), +specifically the variant which is Incompatible with Secondary Licenses. +However, again, if you only want to install and run Bugzilla, you don't need +to worry about that; it's only relevant if you redistribute the code or any +changes you make. + +Bugzilla's documentation is made available under the +`Creative Commons CC-BY-SA International License 4.0 +<https://creativecommons.org/licenses/by-sa/4.0/>`_, +or any later version. + +.. _credits: + +Credits +####### + +The people listed below have made significant contributions to the +creation of this documentation: + +Andrew Pearson, +Ben FrantzDale, +Byron Jones, +Dave Lawrence, +Dave Miller, +Dawn Endico, +Eric Hanson, +Gervase Markham, +Jacob Steenhagen, +Joe Robins, +Kevin Brannen, +Martin Wulffeld, +Matthew P. Barnson, +Ron Teitelbaum, +Shane Travis, +Spencer Smith, +Tara Hernandez, +Terry Weissman, +Vlad Dascalu, +Zach Lipton. diff --git a/docs/en/rst/administering/categorization.rst b/docs/en/rst/administering/categorization.rst new file mode 100644 index 000000000..383b9341d --- /dev/null +++ b/docs/en/rst/administering/categorization.rst @@ -0,0 +1,416 @@ +.. _categorization: + +=============================================================== +Classifications, Products, Components, Versions, and Milestones +=============================================================== + +Bugs in Bugzilla are classified into one of a set of admin-defined Components. +Components are themselves each part of a single Product. Optionally, Products +can be part of a single Classification, adding a third level to the hierarchy. + +.. _classifications: + +Classifications +############### + +Classifications are used to group several related products into one +distinct entity. + +For example, if a company makes computer games, +they could have a classification of "Games", and a separate +product for each game. This company might also have a +``Common`` classification, containing products representing units of +technology used in multiple games, and perhaps an ``Other`` classification +containing a few special products that represent items that are not actually +shipping products (for example, "Website", or "Administration"). + +The classifications layer is disabled by default; it can be turned +on or off using the :param:`useclassification` parameter +in the *Bug Fields* section of :ref:`parameters`. + +Access to the administration of classifications is controlled using +the *editclassifications* system group, which defines +a privilege for creating, destroying, and editing classifications. + +When activated, classifications will introduce an additional +step when filling bugs (dedicated to classification selection), and they +will also appear in the advanced search form. + +.. _products: + +Products +######## + +Products usually represent real-world shipping products. +Many of Bugzilla's settings are configurable on a per-product basis. + +When creating or editing products the following options are +available: + +Product + The name of the product + +Description + A brief description of the product + +Open for bug entry + Deselect this box to prevent new bugs from being + entered against this product. + +Enable the UNCONFIRMED status in this product + Select this option if you want to use the UNCONFIRMED status + (see :ref:`workflow`) + +Default milestone + Select the default milestone for this product. + +Version + Specify the default version for this product. + +Create chart datasets for this product + Select to make chart datasets available for this product. + +It is compulsory to create at least one :ref:`component <components>` in a product, and +so you will be asked for the details of that too. + +When editing a product you can change all of the above, and there is also a +link to edit Group Access Controls; see :ref:`product-group-controls`. + +.. _create-product: + +Creating New Products +===================== + +To create a new product: + +#. Select ``Administration`` from the footer and then + choose ``Products`` from the main administration page. + +#. Select the ``Add`` link in the bottom right. + +#. Enter the details as outlined above. + +.. _edit-products: + +Editing Products +================ + +To edit an existing product, click the "Products" link from the +"Administration" page. If the :param:`useclassification` parameter is +turned on, a table of existing classifications is displayed, +including an "Unclassified" category. The table indicates how many products +are in each classification. Click on the classification name to see its +products. If the :param:`useclassification` parameter is not in use, the table +lists all products directly. The product table summarizes the information +defined when the product was created. Click on the product name to edit these +properties, and to access links to other product attributes such as the +product's components, versions, milestones, and group access controls. + +.. _comps-vers-miles-products: + +Adding or Editing Components, Versions and Target Milestones +============================================================ + +To add new or edit existing Components, Versions, or Target Milestones +to a Product, select the "Edit Components", "Edit Versions", or "Edit +Milestones" links from the "Edit Product" page. A table of existing +Components, Versions, or Milestones is displayed. Click on an item name +to edit the properties of that item. Below the table is a link to add +a new Component, Version, or Milestone. + +For more information on components, see :ref:`components`. + +For more information on versions, see :ref:`versions`. + +For more information on milestones, see :ref:`milestones`. + +.. _product-group-controls: + +Assigning Group Controls to Products +==================================== + +On the ``Edit Product`` page, there is a link called +``Edit Group Access Controls``. The settings on this page +control the relationship of the groups to the product being edited. + +Group Access Controls are an important aspect of using groups for +isolating products and restricting access to bugs filed against those +products. For more information on groups, including how to create, edit, +add users to, and alter permission of, see :ref:`groups`. + +After selecting the "Edit Group Access Controls" link from the "Edit +Product" page, a table containing all user-defined groups for this +Bugzilla installation is displayed. The system groups that are created +when Bugzilla is installed are not applicable to Group Access Controls. +Below is description of what each of these fields means. + +Groups may be applicable (i.e. bugs in this product can be associated +with this group), default (i.e. bugs in this product are in this group +by default), and mandatory (i.e. bugs in this product must be associated +with this group) for each product. Groups can also control access +to bugs for a given product, or be used to make bugs for a product +totally read-only unless the group restrictions are met. The best way to +understand these relationships is by example. See +:ref:`group-control-examples` for examples of +product and group relationships. + +.. note:: Products and Groups are not limited to a one-to-one relationship. + Multiple groups can be associated with the same product, and groups + can be associated with more than one product. + +If any group has *Entry* selected, then the +product will restrict bug entry to only those users +who are members of *all* the groups with +*Entry* selected. + +If any group has *Canedit* selected, +then the product will be read-only for any users +who are not members of *all* of the groups with +*Canedit* selected. *Only* users who +are members of all the *Canedit* groups +will be able to edit bugs for this product. This is an additional +restriction that enables finer-grained control over products rather +than just all-or-nothing access levels. + +The following settings let you +choose privileges on a *per-product basis*. +This is a convenient way to give privileges to +some users for some products only, without having +to give them global privileges which would affect +all products. + +Any group having *editcomponents* +selected allows users who are in this group to edit all +aspects of this product, including components, milestones, +and versions. + +Any group having *canconfirm* selected +allows users who are in this group to confirm bugs +in this product. + +Any group having *editbugs* selected allows +users who are in this group to edit all fields of +bugs in this product. + +The *MemberControl* and +*OtherControl* are used in tandem to determine which +bugs will be placed in this group. The only allowable combinations of +these two parameters are listed in a table on the "Edit Group Access Controls" +page. Consult this table for details on how these fields can be used. +Examples of different uses are described below. + +.. _group-control-examples: + +Common Applications of Group Controls +===================================== + +The use of groups is best explained by providing examples that illustrate +configurations for common use cases. The examples follow a common syntax: +*Group: Entry, MemberControl, OtherControl, CanEdit, +EditComponents, CanConfirm, EditBugs*, where "Group" is the name +of the group being edited for this product. The other fields all +correspond to the table on the "Edit Group Access Controls" page. If any +of these options are not listed, it means they are not checked. + +Basic Product/Group Restriction +------------------------------- + +Suppose there is a product called "Bar". You would like to make it so that only +users in the group "Foo" can enter bugs in the "Bar" product. Additionally, +bugs filed in product "Bar" must be visible only to users in "Foo" (plus, by +default, the reporter, assignee, and CC list of each bug) at all times. +Furthermore, only members of group "Foo" should be able to edit bugs filed +against product "Bar", even if other users could see the bug. This arrangement +would achieved by the following: + +:: + + Product Bar: + foo: ENTRY, MANDATORY/MANDATORY, CANEDIT + +Perhaps such strict restrictions are not needed for product "Bar". Instead, +you would like to make it so that only members of group "Foo" can +enter bugs in product "Bar", but bugs in "Bar" are not required to be +restricted in visibility to people in "Foo". Anyone with permission +to edit a particular bug in product "Bar" can put the bug in group "Foo", even +if they themselves are not in "Foo". + +Furthermore, anyone in group "Foo" can edit all aspects of the components of +product "Bar", can confirm bugs in product "Bar", and can edit all fields of +any bug in product "Bar". That would be done like this: + +:: + + Product Bar: + foo: ENTRY, SHOWN/SHOWN, EDITCOMPONENTS, CANCONFIRM, EDITBUGS + +General User Access With Security Group +--------------------------------------- + +To permit any user to file bugs against "Product A", +and to permit any user to submit those bugs into a +group called "Security": + +:: + + Product A: + security: SHOWN/SHOWN + +General User Access With A Security Product +------------------------------------------- + +To permit any user to file bugs against product called "Security" +while keeping those bugs from becoming visible to anyone +outside the group "SecurityWorkers" (unless a member of the +"SecurityWorkers" group removes that restriction): + +:: + + Product Security: + securityworkers: DEFAULT/MANDATORY + +Product Isolation With a Common Group +------------------------------------- + +To permit users of "Product A" to access the bugs for +"Product A", users of "Product B" to access the bugs for +"Product B", and support staff, who are members of the "Support +Group" to access both, three groups are needed: + +#. Support Group: Contains members of the support staff. + +#. AccessA Group: Contains users of product A and the Support group. + +#. AccessB Group: Contains users of product B and the Support group. + +Once these three groups are defined, the product group controls +can be set to: + +:: + + Product A: + AccessA: ENTRY, MANDATORY/MANDATORY + Product B: + AccessB: ENTRY, MANDATORY/MANDATORY + +Perhaps the "Support Group" wants more control. For example, +the "Support Group" could be permitted to make bugs inaccessible to +users of both groups "AccessA" and "AccessB". +Then, the "Support Group" could be permitted to publish +bugs relevant to all users in a third product (let's call it +"Product Common") that is read-only +to anyone outside the "Support Group". In this way the "Support Group" +could control bugs that should be seen by both groups. +That configuration would be: + +:: + + Product A: + AccessA: ENTRY, MANDATORY/MANDATORY + Support: SHOWN/NA + Product B: + AccessB: ENTRY, MANDATORY/MANDATORY + Support: SHOWN/NA + Product Common: + Support: ENTRY, DEFAULT/MANDATORY, CANEDIT + +Make a Product Read Only +------------------------ + +Sometimes a product is retired and should no longer have +new bugs filed against it (for example, an older version of a software +product that is no longer supported). A product can be made read-only +by creating a group called "readonly" and adding products to the +group as needed: + +:: + + Product A: + ReadOnly: ENTRY, NA/NA, CANEDIT + +.. note:: For more information on Groups outside of how they relate to products + see :ref:`groups`. + +.. _components: + +Components +########## + +Components are subsections of a Product. E.g. the computer game +you are designing may have a "UI" +component, an "API" component, a "Sound System" component, and a +"Plugins" component, each overseen by a different programmer. It +often makes sense to divide Components in Bugzilla according to the +natural divisions of responsibility within your Product or +company. + +Each component has a default assignee and, if you turned it on in the :ref:`parameters`, +a QA Contact. The default assignee should be the primary person who fixes bugs in +that component. The QA Contact should be the person who will ensure +these bugs are completely fixed. The Assignee, QA Contact, and Reporter +will get email when new bugs are created in this Component and when +these bugs change. Default Assignee and Default QA Contact fields only +dictate the *default assignments*; +these can be changed on bug submission, or at any later point in +a bug's life. + +To create a new Component: + +#. Select the ``Edit components`` link + from the ``Edit product`` page. + +#. Select the ``Add`` link in the bottom right. + +#. Fill out the ``Component`` field, a + short ``Description``, the + ``Default Assignee``, ``Default CC List``, + and ``Default QA Contact`` (if enabled). + The ``Component Description`` field may contain a + limited subset of HTML tags. The ``Default Assignee`` + field must be a login name already existing in the Bugzilla database. + +.. _versions: + +Versions +######## + +Versions are the revisions of the product, such as "Flinders +3.1", "Flinders 95", and "Flinders 2000". Version is not a multi-select +field; the usual practice is to select the earliest version known to have +the bug. + +To create and edit Versions: + +#. From the "Edit product" screen, select "Edit Versions". + +#. You will notice that the product already has the default + version "undefined". Click the "Add" link in the bottom right. + +#. Enter the name of the Version. This field takes text only. + Then click the "Add" button. + +.. _milestones: + +Milestones +########## + +Milestones are "targets" that you plan to get a bug fixed by. For +example, if you have a bug that you plan to fix for your 3.0 release, it +would be assigned the milestone of 3.0. + +.. note:: Milestone options will only appear for a Product if you turned + on the :param:`usetargetmilestone` parameter in the "Bug Fields" tab of + the :ref:`parameters` page. + +To create new Milestones and set Default Milestones: + +#. Select "Edit milestones" from the "Edit product" page. + +#. Select "Add" in the bottom right corner. + +#. Enter the name of the Milestone in the "Milestone" field. You + can optionally set the "sortkey", which is a positive or negative + number (-32768 to 32767) that defines where in the list this particular + milestone appears. This is because milestones often do not + occur in alphanumeric order; for example, "Future" might be + after "Release 1.2". Select "Add". diff --git a/docs/en/rst/administering/custom-fields.rst b/docs/en/rst/administering/custom-fields.rst new file mode 100644 index 000000000..29cc72e62 --- /dev/null +++ b/docs/en/rst/administering/custom-fields.rst @@ -0,0 +1,149 @@ +.. _custom-fields: + +Custom Fields +############# + +Custom Fields are fields defined by the administrator, in addition to those +which come with Bugzilla by default. Custom Fields are treated like any other +field—they can be set in bugs and used for search queries. + +Administrators should keep in mind that +adding too many fields can make the user interface more complicated and +harder to use. Custom Fields should be added only when necessary and with +careful consideration. + +.. note:: Before adding a Custom Field, make sure that Bugzilla cannot already + do the desired behavior. Many Bugzilla options are not enabled by + default, and many times Administrators find that simply enabling + certain options that already exist is sufficient. + +Administrators can manage Custom Fields using the +``Custom Fields`` link on the Administration page. The Custom +Fields administration page displays a list of Custom Fields, if any exist, +and a link to "Add a new custom field". + +.. _add-custom-fields: + +Adding Custom Fields +==================== + +To add a new Custom Field, click the "Add a new custom field" link. This +page displays several options for the new field, described below. + +The following attributes must be set for each new custom field: + +- *Name:* + The name of the field in the database, used internally. This name + MUST begin with ``cf_`` to prevent confusion with + standard fields. If this string is omitted, it will + be automatically added to the name entered. + +- *Description:* + A brief string used as the label for this Custom Field. + That is the string that users will see, and it should be + short and explicit. + +- *Type:* + The type of field to create. There are + several types available: + + Bug ID: + A field where you can enter the ID of another bug from + the same Bugzilla installation. To point to a bug in a remote + installation, use the See Also field instead. + Large Text Box: + A multiple line box for entering free text. + Free Text: + A single line box for entering free text. + Multiple-Selection Box: + A list box where multiple options + can be selected. After creating this field, it must be edited + to add the selection options. See + :ref:`edit-values-list` for information about + editing legal values. + Drop Down: + A list box where only one option can be selected. + After creating this field, it must be edited to add the + selection options. See + :ref:`edit-values-list` for information about + editing legal values. + Date/Time: + A date field. This field appears with a + calendar widget for choosing the date. + +- *Sortkey:* + Integer that determines in which order Custom Fields are + displayed in the User Interface, especially when viewing a bug. + Fields with lower values are displayed first. + +- *Reverse Relationship Description:* + When the custom field is of type ``Bug ID``, you can + enter text here which will be used as label in the referenced + bug to list bugs which point to it. This gives you the ability + to have a mutual relationship between two bugs. + +- *Can be set on bug creation:* + Boolean that determines whether this field can be set on + bug creation. If not selected, then a bug must be created + before this field can be set. See :ref:`filing` + for information about filing bugs. + +- *Displayed in bugmail for new bugs:* + Boolean that determines whether the value set on this field + should appear in bugmail when the bug is filed. This attribute + has no effect if the field cannot be set on bug creation. + +- *Is obsolete:* + Boolean that determines whether this field should + be displayed at all. Obsolete Custom Fields are hidden. + +- *Is mandatory:* + Boolean that determines whether this field must be set. + For single and multi-select fields, this means that a (non-default) + value must be selected; for text and date fields, some text + must be entered. + +- *Field only appears when:* + A custom field can be made visible when some criteria is met. + For instance, when the bug belongs to one or more products, + or when the bug is of some given severity. If left empty, then + the custom field will always be visible, in all bugs. + +- *Field that controls the values that appear in this field:* + When the custom field is of type ``Drop Down`` or + ``Multiple-Selection Box``, you can restrict the + availability of the values of the custom field based on the + value of another field. This criteria is independent of the + criteria used in the ``Field only appears when`` + setting. For instance, you may decide that some given value + ``valueY`` is only available when the bug status + is RESOLVED while the value ``valueX`` should + always be listed. + Once you have selected the field that should control the + availability of the values of this custom field, you can + edit values of this custom field to set the criteria; see + :ref:`edit-values-list`. + +.. _edit-custom-fields: + +Editing Custom Fields +===================== + +As soon as a Custom Field is created, its name and type cannot be +changed. If this field is a drop-down menu, its legal values can +be set as described in :ref:`edit-values-list`. All +other attributes can be edited as described above. + +.. _delete-custom-fields: + +Deleting Custom Fields +====================== + +Only custom fields that are marked as obsolete, and that have never +been used, can be deleted completely (else the integrity +of the bug history would be compromised). For custom fields marked +as obsolete, a "Delete" link will appear in the ``Action`` +column. If the custom field has been used in the past, the deletion +will be rejected. Marking the field as obsolete, however, is sufficient +to hide it from the user interface entirely. + diff --git a/docs/en/rst/administering/extensions.rst b/docs/en/rst/administering/extensions.rst new file mode 100644 index 000000000..2c54b8463 --- /dev/null +++ b/docs/en/rst/administering/extensions.rst @@ -0,0 +1,18 @@ +.. _installed-extensions-admin: + +Installed Extensions +==================== + +Bugzilla can be enhanced using extensions (see :ref:`extensions`). If an +extension comes with documentation in the appropriate format, and you build +your own copy of the Bugzilla documentation using :file:`makedocs.pl`, then +the documentation for your installed extensions will show up here. + +Your Bugzilla installation has the following extensions available (as of the +last time you compiled the documentation): + +.. toctree:: + :maxdepth: 1 + :glob: + + ../extensions/*/index-admin diff --git a/docs/en/rst/administering/field-values.rst b/docs/en/rst/administering/field-values.rst new file mode 100644 index 000000000..b7380cbdf --- /dev/null +++ b/docs/en/rst/administering/field-values.rst @@ -0,0 +1,45 @@ +.. _field-values: + +Field Values +############ + +Legal values for the operating system, platform, bug priority and +severity, and custom fields of type ``Drop Down`` and +``Multiple-Selection Box`` (see :ref:`custom-fields`), +as well as the list of valid bug statuses and resolutions, can be +customized from the same interface. You can add, edit, disable, and +remove the values that can be used with these fields. + +.. _edit-values-list: + +Viewing/Editing Legal Values +============================ + +Editing legal values requires ``admin`` privileges. +Select "Field Values" from the Administration page. A list of all +fields, both system and Custom, for which legal values +can be edited appears. Click a field name to edit its legal values. + +There is no limit to how many values a field can have, but each value +must be unique to that field. The sortkey is important to display these +values in the desired order. + +When the availability of the values of a custom field is controlled +by another field, you can select from here which value of the other field +must be set for the value of the custom field to appear. + +.. _edit-values-delete: + +Deleting Legal Values +===================== + +Legal values from Custom Fields can be deleted, but only if the +following two conditions are respected: + +#. The value is not set as the default for the field. + +#. No bug is currently using this value. + +If any of these conditions is not respected, the value cannot be deleted. +The only way to delete these values is to reassign bugs to another value +and to set another value as default for the field. diff --git a/docs/en/rst/administering/flags.rst b/docs/en/rst/administering/flags.rst new file mode 100644 index 000000000..0b13690a3 --- /dev/null +++ b/docs/en/rst/administering/flags.rst @@ -0,0 +1,155 @@ +.. _flags-admin: + +Flags +##### + +If you have the :group:`editcomponents` permission, you can +edit Flag Types from the main administration page. Clicking the +:guilabel:`Flags` link will bring you to the :guilabel:`Administer +Flag Types` page. Here, you can select whether you want +to create (or edit) a Bug flag or an Attachment flag. + +The two flag types have the same administration interface, and the interface +for creating a flag and editing a flag have the same set of fields. + +.. _flags-edit: + +Flag Properties +=============== + +Name + This is the name of the flag. This will be displayed + to Bugzilla users who are looking at or setting the flag. + The name may contain any valid Unicode characters except commas + and spaces. + +Description + The description describes the flag in more detail. It is visible + in a tooltip when hovering over a flag either in the :guilabel:`Show Bug` + or :guilabel:`Edit Attachment` pages. This field can be as + long as you like and can contain any character you want. + +Category + You can set a flag to be visible or not visible on any combination of + products and components. + + Default behaviour for a newly created flag is to appear on all + products and all components, which is why ``__Any__:__Any__`` + is already entered in the :guilabel:`Inclusions` box. + If this is not your desired behaviour, you must either set some + exclusions (for products on which you don't want the flag to appear), + or you must remove ``__Any__:__Any__`` from the :guilabel:`Inclusions` box + and define products/components specifically for this flag. + + To create an Inclusion, select a Product from the top drop-down box. + You may also select a specific component from the bottom drop-down box. + (Setting ``__Any__`` for Product translates to + "all the products in this Bugzilla". + Selecting ``__Any__`` in the Component field means + "all components in the selected product.") + Selections made, press :guilabel:`Include`, and your + Product/Component pairing will show up in the :guilabel:`Inclusions` box on the right. + + To create an Exclusion, the process is the same: select a Product from the + top drop-down box, select a specific component if you want one, and press + :guilabel:`Exclude`. The Product/Component pairing will show up in the + :guilabel:`Exclusions` box on the right. + + This flag *will* appear and *can* be set for any + products/components appearing in the :guilabel:`Inclusions` box + (or which fall under the appropriate ``__Any__``). + This flag *will not* appear (and therefore *cannot* be set) on + any products appearing in the :guilabel:`Exclusions` box. + *IMPORTANT: Exclusions override inclusions.* + + You may select a Product without selecting a specific Component, + but you cannot select a Component without a Product. If you do so, + Bugzilla will display an error message, even if all your products + have a component by that name. You will also see an error if you + select a Component that does not belong to the selected Product. + + *Example:* Let's say you have a product called + ``Jet Plane`` that has thousands of components. You want + to be able to ask if a problem should be fixed in the next model of + plane you release. We'll call the flag ``fixInNext``. + However, one component in ``Jet Plane`` is + called ``Pilot``, and it doesn't make sense to release a + new pilot, so you don't want to have the flag show up in that component. + So, you include ``Jet Plane:__Any__`` and you exclude + ``Jet Plane:Pilot``. + +Sort Key + Flags normally show up in alphabetical order. If you want them to + show up in a different order, you can use this key set the order on each flag. + Flags with a lower sort key will appear before flags with a higher + sort key. Flags that have the same sort key will be sorted alphabetically. + +Active + Sometimes you might want to keep old flag information in the + Bugzilla database but stop users from setting any new flags of this type. + To do this, uncheck :guilabel:`active`. Deactivated + flags will still show up in the UI if they are ``?``, ``+``, or ``-``, but + they may only be cleared (unset) and cannot be changed to a new value. + Once a deactivated flag is cleared, it will completely disappear from a + bug/attachment and cannot be set again. + +Requestable + New flags are, by default, "requestable", meaning that they + offer users the ``?`` option, as well as ``+`` + and ``-``. + To remove the ``?`` option, uncheck "requestable". + +Specifically Requestable + By default this box is checked for new flags, meaning that users may make + flag requests of specific individuals. Unchecking this box will remove the + text box next to a flag; if it is still requestable, then requests + cannot target specific users and are open to anyone (called a + request "to the wind" in Bugzilla). Removing this after specific + requests have been made will not remove those requests; that data will + stay in the database (though it will no longer appear to the user). + +Multiplicable + Any flag with :guilabel:`Multiplicable:guilabel:` set (default for new flags + is 'on') may be set more than once. After being set once, an unset flag + of the same type will appear below it with "addl." (short for + "additional") before the name. There is no limit to the number of + times a Multiplicable flags may be set on the same bug/attachment. + +CC List + If you want certain users to be notified every time this flag is + set to ``?``, ``-``, or ``+``, or is unset, add them here. This is a comma-separated + list of email addresses that need not be restricted to Bugzilla usernames. + +Grant Group + When this field is set to some given group, only users in the group + can set the flag to ``+`` and ``-``. This + field does not affect who can request or cancel the flag. For that, + see the :guilabel:`Request Group` field below. If this field + is left blank, all users can set or delete this flag. This field is + useful for restricting which users can approve or reject requests. + +Request Group + When this field is set to some given group, only users in the group + can request or cancel this flag. Note that this field has no effect + if the :guilabel:`Grant Group` field is empty. You can set the + value of this field to a different group, but both fields have to be + set to a group for this field to have an effect. + +.. _flags-delete: + +Deleting a Flag +=============== + +When you are at the :guilabel:`Administer Flag Types` screen, +you will be presented with a list of Bug flags and a list of Attachment +Flags. + +To delete a flag, click on the :guilabel:`Delete` link next to +the flag description. + +.. warning:: Once you delete a flag, it is *gone* from + your Bugzilla. All the data for that flag will be deleted. + Everywhere that flag was set, it will disappear, + and you cannot get that data back. If you want to keep flag data, + but don't want anybody to set any new flags or change current flags, + unset :guilabel:`active` in the flag Edit form. diff --git a/docs/en/rst/administering/groups.rst b/docs/en/rst/administering/groups.rst new file mode 100644 index 000000000..a14bb689e --- /dev/null +++ b/docs/en/rst/administering/groups.rst @@ -0,0 +1,191 @@ +.. _groups: + +Groups and Security +################### + +Groups allow for separating bugs into logical divisions. +Groups are typically used +to isolate bugs that should only be seen by certain people. For +example, a company might create a different group for each one of its customers +or partners. Group permissions could be set so that each partner or customer would +only have access to their own bugs. Or, groups might be used to create +variable access controls for different departments within an organization. +Another common use of groups is to associate groups with products, +creating isolation and access control on a per-product basis. + +Groups and group behaviors are controlled in several places: + +#. The group configuration page. To view or edit existing groups, or to + create new groups, access the "Groups" link from the "Administration" + page. This section of the manual deals primarily with the aspect of + group controls accessed on this page. + +#. Global configuration parameters. Bugzilla has several parameters + that control the overall default group behavior and restriction + levels. For more information on the parameters that control + group behavior globally, see :ref:`param-group-security`. + +#. Product association with groups. Most of the functionality of groups + and group security is controlled at the product level. Some aspects + of group access controls for products are discussed in this section, + but for more detail see :ref:`product-group-controls`. + +#. Group access for users. See :ref:`users-and-groups` for + details on how users are assigned group access. + +Group permissions are such that if a bug belongs to a group, only members +of that group can see the bug. If a bug is in more than one group, only +members of *all* the groups that the bug is in can see +the bug. For information on granting read-only access to certain people and +full edit access to others, see :ref:`product-group-controls`. + +.. note:: By default, bugs can also be seen by the Assignee, the Reporter, and + everyone on the CC List, regardless of whether or not the bug would + typically be viewable by them. Visibility to the Reporter and CC List can + be overridden (on a per-bug basis) by bringing up the bug, finding the + section that starts with ``Users in the roles selected below...`` + and un-checking the box next to either 'Reporter' or 'CC List' (or both). + +.. _create-groups: + +Creating Groups +=============== + +To create a new group, follow the steps below: + +#. Select the ``Administration`` link in the page footer, + and then select the ``Groups`` link from the + Administration page. + +#. A table of all the existing groups is displayed. Below the table is a + description of all the fields. To create a new group, select the + ``Add Group`` link under the table of existing groups. + +#. There are five fields to fill out. These fields are documented below + the form. Choose a name and description for the group. Decide whether + this group should be used for bugs (in all likelihood this should be + selected). Optionally, choose a regular expression that will + automatically add any matching users to the group, and choose an + icon that will help identify user comments for the group. The regular + expression can be useful, for example, to automatically put all users + from the same company into one group (if the group is for a specific + customer or partner). + + .. note:: If ``User RegExp`` is filled out, users whose email + addresses match the regular expression will automatically be + members of the group as long as their email addresses continue + to match the regular expression. If their email address changes + and no longer matches the regular expression, they will be removed + from the group. Versions 2.16 and older of Bugzilla did not automatically + remove users whose email addresses no longer matched the RegExp. + + .. warning:: If specifying a domain in the regular expression, end + the regexp with a "$". Otherwise, when granting access to + "@mycompany\\.com", access will also be granted to + 'badperson@mycompany.com.cracker.net'. Use the syntax, + '@mycompany\\.com$' for the regular expression. + +#. After the new group is created, it can be edited for additional options. + The "Edit Group" page allows for specifying other groups that should be included + in this group and which groups should be permitted to add and delete + users from this group. For more details, see :ref:`edit-groups`. + +.. _edit-groups: + +Editing Groups and Assigning Group Permissions +============================================== + +To access the "Edit Groups" page, select the +``Administration`` link in the page footer, +and then select the ``Groups`` link from the Administration page. +A table of all the existing groups is displayed. Click on a group name +you wish to edit or control permissions for. + +The "Edit Groups" page contains the same five fields present when +creating a new group. Below that are two additional sections, "Group +Permissions" and "Mass Remove". The "Mass Remove" option simply removes +all users from the group who match the regular expression entered. The +"Group Permissions" section requires further explanation. + +The "Group Permissions" section on the "Edit Groups" page contains four sets +of permissions that control the relationship of this group to other +groups. If the :param:`usevisibilitygroups` parameter is in use (see +:ref:`parameters`) two additional sets of permissions are displayed. +Each set consists of two select boxes. On the left, a select box +with a list of all existing groups. On the right, a select box listing +all groups currently selected for this permission setting (this box will +be empty for new groups). The way these controls allow groups to relate +to one another is called *inheritance*. +Each of the six permissions is described below. + +*Groups That Are a Member of This Group* + Members of any groups selected here will automatically have + membership in this group. In other words, members of any selected + group will inherit membership in this group. + +*Groups That This Group Is a Member Of* + Members of this group will inherit membership to any group + selected here. For example, suppose the group being edited is + an Admin group. If there are two products (Product1 and Product2) + and each product has its + own group (Group1 and Group2), and the Admin group + should have access to both products, + simply select both Group1 and Group2 here. + +*Groups That Can Grant Membership in This Group* + The members of any group selected here will be able add users + to this group, even if they themselves are not in this group. + +*Groups That This Group Can Grant Membership In* + Members of this group can add users to any group selected here, + even if they themselves are not in the selected groups. + +*Groups That Can See This Group* + Members of any selected group can see the users in this group. + This setting is only visible if the :param:`usevisibilitygroups` parameter + is enabled on the Bugzilla Configuration page. See + :ref:`parameters` for information on configuring Bugzilla. + +*Groups That This Group Can See* + Members of this group can see members in any of the selected groups. + This setting is only visible if the :param:`usevisibilitygroups` parameter + is enabled on the the Bugzilla Configuration page. See + :ref:`parameters` for information on configuring Bugzilla. + +.. _users-and-groups: + +Assigning Users to Groups +========================= + +A User can become a member of a group in several ways: + +#. The user can be explicitly placed in the group by editing + the user's profile. This can be done by accessing the "Users" page + from the "Administration" page. Use the search form to find the user + you want to edit group membership for, and click on their email + address in the search results to edit their profile. The profile + page lists all the groups and indicates if the user is a member of + the group either directly or indirectly. More information on indirect + group membership is below. For more details on User Administration, + see :ref:`users`. + +#. The group can include another group of which the user is + a member. This is indicated by square brackets around the checkbox + next to the group name in the user's profile. + See :ref:`edit-groups` for details on group inheritance. + +#. The user's email address can match the regular expression + that has been specified to automatically grant membership to + the group. This is indicated by "\*" around the check box by the + group name in the user's profile. + See :ref:`create-groups` for details on + the regular expression option when creating groups. + +Assigning Group Controls to Products +==================================== + +The primary functionality of groups is derived from the relationship of +groups to products. The concepts around segregating access to bugs with +product group controls can be confusing. For details and examples on this +topic, see :ref:`product-group-controls`. + diff --git a/docs/en/rst/administering/index.rst b/docs/en/rst/administering/index.rst new file mode 100644 index 000000000..c47819323 --- /dev/null +++ b/docs/en/rst/administering/index.rst @@ -0,0 +1,26 @@ +.. _administering: + +==================== +Administration Guide +==================== + +For those with :group:`admin` privileges, Bugzilla can be administered using +the :guilabel:`Administration` link in the header. The administrative +controls are divided into several sections: + +.. toctree:: + :maxdepth: 2 + + parameters + preferences + users + categorization + flags + custom-fields + field-values + workflow + groups + keywords + whining + quips + extensions diff --git a/docs/en/rst/administering/keywords.rst b/docs/en/rst/administering/keywords.rst new file mode 100644 index 000000000..245bcbe4c --- /dev/null +++ b/docs/en/rst/administering/keywords.rst @@ -0,0 +1,16 @@ +.. _keywords: + +Keywords +######## + +The administrator can define keywords which can be used to tag and +categorise bugs. For example, the keyword "regression" is commonly used. +A company might have a policy stating all regressions +must be fixed by the next release—this keyword can make tracking those +bugs much easier. Keywords are global, rather than per product. + +Keywords can be created, edited, or deleted by clicking the "Keywords" +link in the admin page. There are two fields for each keyword—the keyword +itself and a brief description. Currently keywords cannot be marked obsolete +to prevent future usage. + diff --git a/docs/en/rst/administering/parameters.rst b/docs/en/rst/administering/parameters.rst new file mode 100644 index 000000000..7f376bbf2 --- /dev/null +++ b/docs/en/rst/administering/parameters.rst @@ -0,0 +1,794 @@ +.. _parameters: + +Parameters +########## + +Bugzilla is configured by changing various parameters, accessed +from the :guilabel:`Parameters` link, which is found on the Administration +page. The parameters are divided into several categories, +accessed via the menu on the left. + +.. _param-required-settings: + +Required Settings +================= + +The core required parameters for any Bugzilla installation are set +here. :param:`urlbase` is always required; the other parameters should be +set, or it must be explicitly decided not to +set them, before the new Bugzilla installation starts to be used. + +urlbase + Defines the fully qualified domain name and web + server path to this Bugzilla installation. + For example, if the Bugzilla query page is + :file:`http://www.foo.com/bugzilla/query.cgi`, + the :param:`urlbase` should be set + to :paramval:`http://www.foo.com/bugzilla/`. + +ssl_redirect + If enabled, Bugzilla will force HTTPS (SSL) connections, by + automatically redirecting any users who try to use a non-SSL + connection. Also, when this is enabled, Bugzilla will send out links + using :param:`sslbase` in emails instead of :param:`urlbase`. + +sslbase + Defines the fully qualified domain name and web + server path for HTTPS (SSL) connections to this Bugzilla installation. + For example, if the Bugzilla main page is + :file:`https://www.foo.com/bugzilla/index.cgi`, + the :param:`sslbase` should be set + to :paramval:`https://www.foo.com/bugzilla/`. + +cookiepath + Defines a path, relative to the web document root, that Bugzilla + cookies will be restricted to. For example, if the + :param:`urlbase` is set to + :file:`http://www.foo.com/bugzilla/`, the + :param:`cookiepath` should be set to + :paramval:`/bugzilla/`. Setting it to :paramval:`/` will allow all sites + served by this web server or virtual host to read Bugzilla cookies. + +.. _param-general: + +General +======= + +maintainer + Email address of the person + responsible for maintaining this Bugzilla installation. + The address need not be that of a valid Bugzilla account. + +utf8 + Use UTF-8 (Unicode) encoding for all text in Bugzilla. Installations where + this parameter is set to :paramval:`off` should set it to :paramval:`on` only + after the data has been converted from existing legacy character + encodings to UTF-8, using the + :file:`contrib/recode.pl` script. + + .. note:: If you turn this parameter from :paramval:`off` to :paramval:`on`, + you must re-run :file:`checksetup.pl` immediately afterward. + +shutdownhtml + If there is any text in this field, this Bugzilla installation will + be completely disabled and this text will appear instead of all + Bugzilla pages for all users, including Admins. Used in the event + of site maintenance or outage situations. + +announcehtml + Any text in this field will be displayed at the top of every HTML + page in this Bugzilla installation. The text is not wrapped in any + tags. For best results, wrap the text in a ``<div>`` + tag. Any style attributes from the CSS can be applied. For example, + to make the text green inside of a red box, add ``id=message`` + to the ``<div>`` tag. + +upgrade_notification + Enable or disable a notification on the homepage of this Bugzilla + installation when a newer version of Bugzilla is available. This + notification is only visible to administrators. Choose :paramval:`disabled` + to turn off the notification. Otherwise, choose which version of + Bugzilla you want to be notified about: :paramval:`development_snapshot` is the + latest release from the master branch, :paramval:`latest_stable_release` is the most + recent release available on the most recent stable branch, and + :paramval:`stable_branch_release` is the most recent release on the branch + this installation is based on. + +.. _param-administrative-policies: + +Administrative Policies +======================= + +This page contains parameters for basic administrative functions. +Options include whether to allow the deletion of bugs and users, +and whether to allow users to change their email address. + +allowbugdeletion + The pages to edit products and components can delete all associated bugs when you delete a product (or component). Since that is a pretty scary idea, you have to turn on this option before any such deletions will ever happen. + +allowemailchange + Users can change their own email address through the preferences. Note that the change is validated by emailing both addresses, so switching this option on will not let users use an invalid address. + +allowuserdeletion + The user editing pages are capable of letting you delete user accounts. Bugzilla will issue a warning in case you'd run into inconsistencies when you're about to do so, but such deletions still remain scary. So, you have to turn on this option before any such deletions will ever happen. + +last_visit_keep_days + This option controls how many days Bugzilla will remember that users have visited specific bugs. + +.. _param-user-authentication: + +User Authentication +=================== + +This page contains the settings that control how this Bugzilla +installation will do its authentication. Choose what authentication +mechanism to use (the Bugzilla database, or an external source such +as LDAP), and set basic behavioral parameters. For example, choose +whether to require users to login to browse bugs, the management +of authentication cookies, and the regular expression used to +validate email addresses. Some parameters are highlighted below. + +auth_env_id + Environment variable used by external authentication system to store a unique identifier for each user. Leave it blank if there isn't one or if this method of authentication is not being used. + +auth_env_email + Environment variable used by external authentication system to store each user's email address. This is a required field for environmental authentication. Leave it blank if you are not going to use this feature. + +auth_env_realname + Environment variable used by external authentication system to store the user's real name. Leave it blank if there isn't one or if this method of authentication is not being used. + +user_info_class + Mechanism(s) to be used for gathering a user's login information. More than one may be selected. If the first one returns nothing, the second is tried, and so on. The types are: + + * :paramval:`CGI`: asks for username and password via CGI form interface. + * :paramval:`Env`: info for a pre-authenticated user is passed in system environment variables. + +user_verify_class + Mechanism(s) to be used for verifying (authenticating) information gathered by user_info_class. More than one may be selected. If the first one cannot find the user, the second is tried, and so on. The types are: + + * :paramval:`DB`: Bugzilla's built-in authentication. This is the most common choice. + * :paramval:`RADIUS`: RADIUS authentication using a RADIUS server. Using this method requires additional parameters to be set. Please see :ref:`param-radius` for more information. + * :paramval:`LDAP`: LDAP authentication using an LDAP server. Using this method requires additional parameters to be set. Please see :ref:`param-ldap` for more information. + +rememberlogin + Controls management of session cookies. + + * :paramval:`on` - Session cookies never expire (the user has to login only once per browser). + * :paramval:`off` - Session cookies last until the users session ends (the user will have to login in each new browser session). + * :paramval:`defaulton`/:paramval:`defaultoff` - Default behavior as described above, but user can choose whether Bugzilla will remember their login or not. + +requirelogin + If this option is set, all access to the system beyond the front page will require a login. No anonymous users will be permitted. + +webservice_email_filter + Filter email addresses returned by the WebService API depending on if the user is logged in or not. This works similarly to how the web UI currently filters email addresses. If requirelogin is enabled, then this parameter has no effect as users must be logged in to use Bugzilla anyway. + +emailregexp + Defines the regular expression used to validate email addresses + used for login names. The default attempts to match fully + qualified email addresses (i.e. 'user\@example.com') in a slightly + more restrictive way than what is allowed in RFC 2822. + Another popular value to put here is :paramval:`^[^@]+`, which means 'local usernames, no @ allowed.' + +emailregexpdesc + This description is shown to the user to explain which email addresses are allowed by the :param:`emailregexp` param. + +emailsuffix + This is a string to append to any email addresses when actually sending mail to that address. It is useful if you have changed the :param:`emailregexp` param to only allow local usernames, but you want the mail to be delivered to username\@my.local.hostname. + +createemailregexp + This defines the (case-insensitive) regexp to use for email addresses that are permitted to self-register. The default (:paramval:`.*`) permits any account matching the emailregexp to be created. If this parameter is left blank, no users will be permitted to create their own accounts and all accounts will have to be created by an administrator. + +password_complexity + Set the complexity required for passwords. In all cases must the passwords be at least 6 characters long. + + * :paramval:`no_constraints` - No complexity required. + * :paramval:`mixed_letters` - Passwords must contain at least one UPPER and one lower case letter. + * :paramval:`letters_numbers` - Passwords must contain at least one UPPER and one lower case letter and a number. + * :paramval:`letters_numbers_specialchars` - Passwords must contain at least one letter, a number and a special character. + +password_check_on_login + If set, Bugzilla will check that the password meets the current complexity rules and minimum length requirements when the user logs into the Bugzilla web interface. If it doesn't, the user would not be able to log in, and will receive a message to reset their password. + +.. _param-attachments: + +Attachments +=========== + +This page allows for setting restrictions and other parameters +regarding attachments to bugs. For example, control size limitations +and whether to allow pointing to external files via a URI. + +allow_attachment_display + If this option is on, users will be able to view attachments from their browser, if their browser supports the attachment's MIME type. If this option is off, users are forced to download attachments, even if the browser is able to display them. + + If you do not trust your users (e.g. if your Bugzilla is public), you should either leave this option off, or configure and set the :param:`attachment_base` parameter (see below). Untrusted users may upload attachments that could be potentially damaging if viewed directly in the browser. + +attachment_base + When the :param:`allow_attachment_display` parameter is on, it is possible for a malicious attachment to steal your cookies or perform an attack on Bugzilla using your credentials. + + If you would like additional security on attachments to avoid this, set this parameter to an alternate URL for your Bugzilla that is not the same as :param:`urlbase` or :param:`sslbase`. That is, a different domain name that resolves to this exact same Bugzilla installation. + + Note that if you have set the :param:`cookiedomain` parameter, you should set :param:`attachment_base` to use a domain that would not be matched by :param:`cookiedomain`. + + For added security, you can insert ``%bugid%`` into the URL, which will be replaced with the ID of the current bug that the attachment is on, when you access an attachment. This will limit attachments to accessing only other attachments on the same bug. Remember, though, that all those possible domain names (such as 1234.your.domain.com) must point to this same Bugzilla instance. To set this up you need to investigate wildcard DNS. + +allow_attachment_deletion + If this option is on, administrators will be able to delete the contents + of attachments (i.e. replace the attached file with a 0 byte file), + leaving only the metadata. + +maxattachmentsize + The maximum size (in kilobytes) of attachments to be stored in the database. If a file larger than this size is attached to a bug, Bugzilla will look at the :param:`maxlocalattachment` parameter to determine if the file can be stored locally on the web server. If the file size exceeds both limits, then the attachment is rejected. Setting both parameters to 0 will prevent attaching files to bugs. + + Some databases have default limits which prevent storing larger attachments in the database. E.g. MySQL has a parameter called `max_allowed_packet <http://dev.mysql.com/doc/refman/5.1/en/packet-too-large.html>`_, whose default varies by distribution. Setting :param:`maxattachmentsize` higher than your current setting for this value will produce an error. + +maxlocalattachment + The maximum size (in megabytes) of attachments to be stored locally on the web server. If set to a value lower than the :param:`maxattachmentsize` parameter, attachments will never be kept on the local filesystem. + + Whether you use this feature or not depends on your environment. Reasons to store some or all attachments as files might include poor database performance for large binary blobs, ease of backup/restore/browsing, or even filesystem-level deduplication support. However, you need to be aware of any limits on how much data your webserver environment can store. If in doubt, leave the value at 0. + + Note that changing this value does not affect any already-submitted attachments. + +.. _param-bug-change-policies: + +Bug Change Policies +=================== + +Set policy on default behavior for bug change events. For example, +choose which status to set a bug to when it is marked as a duplicate, +and choose whether to allow bug reporters to set the priority or +target milestone. Also allows for configuration of what changes +should require the user to make a comment, described below. + +duplicate_or_move_bug_status + When a bug is marked as a duplicate of another one, use this bug status. + +letsubmitterchoosepriority + If this is on, then people submitting bugs can choose an initial priority for that bug. If off, then all bugs initially have the default priority selected here. + +letsubmitterchoosemilestone + If this is on, then people submitting bugs can choose the Target Milestone for that bug. If off, then all bugs initially have the default milestone for the product being filed in. + +musthavemilestoneonaccept + If you are using Target Milestone, do you want to require that the milestone be set in order for a user to set a bug's status to IN_PROGRESS? + +commenton* + All these fields allow you to dictate what changes can pass + without comment and which must have a comment from the + person who changed them. Often, administrators will allow + users to add themselves to the CC list, accept bugs, or + change the Status Whiteboard without adding a comment as to + their reasons for the change, yet require that most other + changes come with an explanation. + Set the "commenton" options according to your site policy. It + is a wise idea to require comments when users resolve, reassign, or + reopen bugs at the very least. + + .. note:: It is generally far better to require a developer comment + when resolving bugs than not. Few things are more annoying to bug + database users than having a developer mark a bug "fixed" without + any comment as to what the fix was (or even that it was truly + fixed!) + +noresolveonopenblockers + This option will prevent users from resolving bugs as FIXED if + they have unresolved dependencies. Only the FIXED resolution + is affected. Users will be still able to resolve bugs to + resolutions other than FIXED if they have unresolved dependent + bugs. + +.. _param-bugfields: + +Bug Fields +========== + +The parameters in this section determine the default settings of +several Bugzilla fields for new bugs and whether +certain fields are used. For example, choose whether to use the +:field:`Target Milestone` field or the :field:`Status Whiteboard` field. + +useclassification + If this is on, Bugzilla will associate each product with a specific + classification. But you must have :group:`editclassification` permissions + enabled in order to edit classifications. + +usetargetmilestone + Do you wish to use the :field:`Target Milestone` field? + +useqacontact + This allows you to define an email address for each component, + in addition to that of the default assignee, that will be sent + carbon copies of incoming bugs. + +usestatuswhiteboard + This defines whether you wish to have a free-form, overwritable field + associated with each bug. The advantage of the :field:`Status Whiteboard` + is that it can be deleted or modified with ease and provides an + easily searchable field for indexing bugs that have some trait in + common. + +use_see_also + Do you wish to use the :field:`See Also` field? It allows you mark bugs + in other bug tracker installations as being related. Disabling this field + prevents addition of new relationships, but existing ones will continue to + appear. + +defaultpriority + This is the priority that newly entered bugs are set to. + +defaultseverity + This is the severity that newly entered bugs are set to. + +defaultplatform + This is the platform that is preselected on the bug entry form. + You can leave this empty; Bugzilla will then use the platform that the + browser is running on as the default. + +defaultopsys + This is the operating system that is preselected on the bug entry form. + You can leave this empty; Bugzilla will then use the operating system + that the browser reports to be running on as the default. + +collapsed_comment_tags + A comma-separated list of tags which, when applied to comments, will + cause them to be collapsed by default. + +.. _param-dependency-graphs: + +Graphs +====== + +Bugzilla can draw graphs of bug-dependency relationships, using a tool called +:file:`dot` (from the `GraphViz project <http://graphviz.org/>`_) or a web +service called Web Dot. This page allows you to set the location of the binary +or service. If no Web Dot server or binary is specified, then dependency +graphs will be disabled. + +webdotbase + You may set this parameter to any of the following: + + * A complete file path to :command:`dot` (part of GraphViz), which will + generate the graphs locally. + * A URL prefix pointing to an installation of the Web Dot package, which + will generate the graphs remotely. + * A blank value, which will disable dependency graphing. + + The default value is blank. We recommend using a local install of + :file:`dot`. If you change this value to a web service, make certain that + the Web Dot server can read files from your Web Dot directory. On Apache + you do this by editing the :file:`.htaccess` file; for other systems the + needed measures may vary. You can run :command:`checksetup.pl` to + recreate the :file:`.htaccess` file if it has been lost. + +font_file + You can specify the full path to a TrueType font file which will be used + to display text (labels, legends, ...) in charts and graphical reports. + To support as many languages as possible, we recommend to specify a + TrueType font such as Unifont which supports all printable characters in + the Basic Multilingual Plane. If you leave this parameter empty, a default + font will be used, but its support is limited to English characters only + and so other characters will be displayed incorrectly. + +.. _param-group-security: + +Group Security +============== + +Bugzilla allows for the creation of different groups, with the +ability to restrict the visibility of bugs in a group to a set of +specific users. Specific products can also be associated with +groups, and users restricted to only see products in their groups. +Several parameters are described in more detail below. Most of the +configuration of groups and their relationship to products is done +on the :guilabel:`Groups` and :guilabel:`Product` pages of the +:guilabel:`Administration` area. +The options on this page control global default behavior. +For more information on Groups and Group Security, see +:ref:`groups`. + +makeproductgroups + Determines whether or not to automatically create groups + when new products are created. If this is on, the groups will be + used for querying bugs. + + .. todo:: This is spectacularly unclear. I have no idea what makeproductgroups + does - can someone explain it to me? Convert this item into a bug on checkin. + +chartgroup + The name of the group of users who can use the 'New Charts' feature. Administrators should ensure that the public categories and series definitions do not divulge confidential information before enabling this for an untrusted population. If left blank, no users will be able to use New Charts. + +insidergroup + The name of the group of users who can see/change private comments and attachments. + +timetrackinggroup + The name of the group of users who can see/change time tracking information. + +querysharegroup + The name of the group of users who are allowed to share saved + searches with one another. For more information on using + saved searches, see :ref:`saved-searches`. + +comment_taggers_group + The name of the group of users who can tag comments. Setting this to empty disables comment tagging. + +debug_group + The name of the group of users who can view the actual SQL query generated when viewing bug lists and reports. Do not expose this information to untrusted users. + +usevisibilitygroups + If selected, user visibility will be restricted to members of + groups, as selected in the group configuration settings. + Each user-defined group can be allowed to see members of selected + other groups. + For details on configuring groups (including the visibility + restrictions) see :ref:`edit-groups`. + +or_groups + Define the visibility of a bug which is in multiple groups. If + this is on (recommended), a user only needs to be a member of one + of the bug's groups in order to view it. If it is off, a user + needs to be a member of all the bug's groups. Note that in either + case, a user's role on the bug (e.g. reporter), if any, may also + affect their permissions. + +.. _param-ldap: + +LDAP +==== + +LDAP authentication is a module for Bugzilla's plugin +authentication architecture. This page contains all the parameters +necessary to configure Bugzilla for use with LDAP authentication. + +The existing authentication +scheme for Bugzilla uses email addresses as the primary user ID and a +password to authenticate that user. All places within Bugzilla that +require a user ID (e.g assigning a bug) use the email +address. The LDAP authentication builds on top of this scheme, rather +than replacing it. The initial log-in is done with a username and +password for the LDAP directory. Bugzilla tries to bind to LDAP using +those credentials and, if successful, tries to map this account to a +Bugzilla account. If an LDAP mail attribute is defined, the value of this +attribute is used; otherwise, the :param:`emailsuffix` parameter is appended to +the LDAP username to form a full email address. If an account for this address +already exists in the Bugzilla installation, it will log in to that account. +If no account for that email address exists, one is created at the time +of login. (In this case, Bugzilla will attempt to use the "displayName" +or "cn" attribute to determine the user's full name.) After +authentication, all other user-related tasks are still handled by email +address, not LDAP username. For example, bugs are still assigned by +email address and users are still queried by email address. + +.. warning:: Because the Bugzilla account is not created until the first time + a user logs in, a user who has not yet logged is unknown to Bugzilla. + This means they cannot be used as an assignee or QA contact (default or + otherwise), added to any CC list, or any other such operation. One + possible workaround is the :file:`bugzilla_ldapsync.rb` + script in the :file:`contrib` + directory. Another possible solution is fixing :bug:`201069`. + +Parameters required to use LDAP Authentication: + +user_verify_class (in the Authentication section) + If you want to list :paramval:`LDAP` here, + make sure to have set up the other parameters listed below. + Unless you have other (working) authentication methods listed as + well, you may otherwise not be able to log back in to Bugzilla once + you log out. + If this happens to you, you will need to manually edit + :file:`data/params.json` and set :param:`user_verify_class` to + :paramval:`DB`. + +LDAPserver + This parameter should be set to the name (and optionally the + port) of your LDAP server. If no port is specified, it assumes + the default LDAP port of 389. + For example: :paramval:`ldap.company.com` + or :paramval:`ldap.company.com:3268` + You can also specify a LDAP URI, so as to use other + protocols, such as LDAPS or LDAPI. If the port was not specified in + the URI, the default is either 389 or 636 for 'LDAP' and 'LDAPS' + schemes respectively. + + .. note:: In order to use SSL with LDAP, specify a URI with "ldaps://". + This will force the use of SSL over port 636. + For example, normal LDAP :paramval:`ldap://ldap.company.com`, LDAP over + SSL :paramval:`ldaps://ldap.company.com`, or LDAP over a UNIX + domain socket :paramval:`ldapi://%2fvar%2flib%2fldap_sock`. + +LDAPstarttls + Whether to require encrypted communication once a normal LDAP connection + is achieved with the server. + +LDAPbinddn [Optional] + Some LDAP servers will not allow an anonymous bind to search + the directory. If this is the case with your configuration you + should set the :param:`LDAPbinddn` parameter to the user account Bugzilla + should use instead of the anonymous bind. + Ex. :paramval:`cn=default,cn=user:password` + +LDAPBaseDN + The location in + your LDAP tree that you would like to search for email addresses. + Your uids should be unique under the DN specified here. + Ex. :paramval:`ou=People,o=Company` + +LDAPuidattribute + The attribute + which contains the unique UID of your users. The value retrieved + from this attribute will be used when attempting to bind as the + user to confirm their password. + Ex. :paramval:`uid` + +LDAPmailattribute + The name of the + attribute which contains the email address your users will enter + into the Bugzilla login boxes. + Ex. :paramval:`mail` + +LDAPfilter + LDAP filter to AND with the LDAPuidattribute for filtering the list of + valid users. + +.. _param-radius: + +RADIUS +====== + +RADIUS authentication is a module for Bugzilla's plugin +authentication architecture. This page contains all the parameters +necessary for configuring Bugzilla to use RADIUS authentication. + +.. note:: Most caveats that apply to LDAP authentication apply to RADIUS + authentication as well. See :ref:`param-ldap` for details. + +Parameters required to use RADIUS Authentication: + +user_verify_class (in the Authentication section) + If you want to list :paramval:`RADIUS` here, + make sure to have set up the other parameters listed below. + Unless you have other (working) authentication methods listed as + well, you may otherwise not be able to log back in to Bugzilla once + you log out. + If this happens to you, you will need to manually edit + :file:`data/params.json` and set :param:`user_verify_class` to + :paramval:`DB`. + +RADIUS_server + The name (and optionally the port) of your RADIUS server. + +RADIUS_secret + The RADIUS server's secret. + +RADIUS_NAS_IP + The NAS-IP-Address attribute to be used when exchanging data with your + RADIUS server. If unspecified, 127.0.0.1 will be used. + +RADIUS_email_suffix + Bugzilla needs an email address for each user account. + Therefore, it needs to determine the email address corresponding + to a RADIUS user. + Bugzilla offers only a simple way to do this: it can concatenate + a suffix to the RADIUS user name to convert it into an email + address. + You can specify this suffix in the :param:`RADIUS_email_suffix` parameter. + If this simple solution does not work for you, you'll + probably need to modify + :file:`Bugzilla/Auth/Verify/RADIUS.pm` to match your + requirements. + +.. _param-email: + +Email +===== + +This page contains all of the parameters for configuring how +Bugzilla deals with the email notifications it sends. See below +for a summary of important options. + +mail_delivery_method + This is used to specify how email is sent, or if it is sent at + all. There are several options included for different MTAs, + along with two additional options that disable email sending. + :paramval:`Test` does not send mail, but instead saves it in + :file:`data/mailer.testfile` for later review. + :paramval:`None` disables email sending entirely. + +mailfrom + This is the email address that will appear in the "From" field + of all emails sent by this Bugzilla installation. Some email + servers require mail to be from a valid email address; therefore, + it is recommended to choose a valid email address here. + +use_mailer_queue + In a large Bugzilla installation, updating bugs can be very slow because Bugzilla sends all email at once. If you enable this parameter, Bugzilla will queue all mail and then send it in the background. This requires that you have installed certain Perl modules (as listed by :file:`checksetup.pl` for this feature), and that you are running the :file:`jobqueue.pl` daemon (otherwise your mail won't get sent). This affects all mail sent by Bugzilla, not just bug updates. + +smtpserver + The SMTP server address, if the :param:`mail_delivery_method` + parameter is set to :paramval:`SMTP`. Use :paramval:`localhost` if you have a local MTA + running; otherwise, use a remote SMTP server. Append ":" and the port + number if a non-default port is needed. + +smtp_username + Username to use for SASL authentication to the SMTP server. Leave + this parameter empty if your server does not require authentication. + +smtp_password + Password to use for SASL authentication to the SMTP server. This + parameter will be ignored if the :param:`smtp_username` + parameter is left empty. + +smtp_ssl + Enable SSL support for connection to the SMTP server. + +smtp_debug + This parameter allows you to enable detailed debugging output. + Log messages are printed the web server's error log. + +whinedays + Set this to the number of days you want to let bugs go + in the CONFIRMED state before notifying people they have + untouched new bugs. If you do not plan to use this feature, simply + do not set up the :ref:`whining cron job <installation-whining>` described + in the installation instructions, or set this value to "0" (never whine). + +globalwatchers + This allows you to define specific users who will + receive notification each time any new bug in entered, or when + any existing bug changes, subject to the normal groupset + permissions. It may be useful for sending notifications to a + mailing list, for instance. + +.. _param-querydefaults: + +Query Defaults +============== + +This page controls the default behavior of Bugzilla in regards to +several aspects of querying bugs. Options include what the default +query options are, what the "My Bugs" page returns, whether users +can freely add bugs to the quip list, and how many duplicate bugs are +needed to add a bug to the "most frequently reported" list. + +quip_list_entry_control + Controls how easily users can add entries to the quip list. + + * :paramval:`open` - Users may freely add to the quip list, and their entries will immediately be available for viewing. + * :paramval:`moderated` - Quips can be entered but need to be approved by a moderator before they will be shown. + * :paramval:`closed` - No new additions to the quips list are allowed. + +mybugstemplate + This is the URL to use to bring up a simple 'all of my bugs' list + for a user. %userid% will get replaced with the login name of a + user. Special characters must be URL encoded. + +defaultquery + This is the default query that initially comes up when you access + the advanced query page. It's in URL-parameter format. + +search_allow_no_criteria + When turned off, a query must have some criteria specified to limit the number of bugs returned to the user. When turned on, a user is allowed to run a query with no criteria and get all bugs in the entire installation that they can see. Turning this parameter on is not recommended on large installations. + +default_search_limit + By default, Bugzilla limits searches done in the web interface to returning only this many results, for performance reasons. (This only affects the HTML format of search results—CSV, XML, and other formats are exempted.) Users can click a link on the search result page to see all the results. + + Usually you should not have to change this—the default value should be acceptable for most installations. + +max_search_results + The maximum number of bugs that a search can ever return. Tabular and graphical reports are exempted from this limit, however. + + + +.. _param-shadowdatabase: + +Shadow Database +=============== + +This page controls whether a shadow database is used. If your Bugzilla is +not large, you will not need these options. + +A standard large database setup involves a single master server and a pool of +read-only slaves (which Bugzilla calls the "shadowdb"). Queries which are not +updating data can be directed to the slave pool, removing the load/locking +from the master, freeing it up to handle writes. Bugzilla will switch to the +shadowdb when it knows it doesn't need to update the database (e.g. when +searching, or displaying a bug to a not-logged-in user). + +Bugzilla does not make sure the shadowdb is kept up to date, so, if you use +one, you will need to set up replication in your database server. + +If your shadowdb is on a different machine, specify :param:`shadowdbhost` +and :param:`shadowdbport`. If it's on the same machine, specify +:param:`shadowdbsock`. + +shadowdbhost + The host the shadow database is on. + +shadowdbport + The port the shadow database is on. + +shadowdbsock + The socket used to connect to the shadow database, if the host is the + local machine. + +shadowdb + The database name of the shadow database. + +.. _admin-memcached: + +Memcached +========= + +memcached_servers + If this option is set, Bugzilla will integrate with `Memcached + <http://www.memcached.org/>`_. Specify one or more servers, separated by + spaces, using hostname:port notation (for example: + :paramval:`127.0.0.1:11211`). + +memcached_namespace + Specify a string to prefix each key on Memcached. + +.. _admin-usermatching: + +User Matching +============= + +The settings on this page control how users are selected and queried +when adding a user to a bug. For example, users need to be selected +when assigning the bug, adding to the CC list, or +selecting a QA contact. With the :param:`usemenuforusers` parameter, it is +possible to configure Bugzilla to +display a list of users in the fields instead of an empty text field. +If users are selected via a text box, this page also +contains parameters for how user names can be queried and matched +when entered. + +usemenuforusers + If this option is set, Bugzilla will offer you a list to select from (instead of a text entry field) where a user needs to be selected. This option should not be enabled on sites where there are a large number of users. + +ajax_user_autocompletion + If this option is set, typing characters in a certain user fields + will display a list of matches that can be selected from. It is + recommended to only turn this on if you are using mod_perl; + otherwise, the response will be irritatingly slow. + +maxusermatches + Provide no more than this many matches when a user is searched for. + If set to '1', no users will be displayed on ambiguous + matches. This is useful for user-privacy purposes. A value of zero + means no limit. + +confirmuniqueusermatch + Whether a confirmation screen should be displayed when only one user matches a search entry. + +.. _admin-advanced: + +Advanced +======== + +cookiedomain + Defines the domain for Bugzilla cookies. This is typically left blank. + If there are multiple hostnames that point to the same webserver, which + require the same cookie, then this parameter can be utilized. For + example, If your website is at + ``https://bugzilla.example.com/``, setting this to + :paramval:`.example.com/` will also allow + ``attachments.example.com/`` to access Bugzilla cookies. + +inbound_proxies + When inbound traffic to Bugzilla goes through a proxy, Bugzilla thinks that the IP address of the proxy is the IP address of every single user. If you enter a comma-separated list of IPs in this parameter, then Bugzilla will trust any ``X-Forwarded-For`` header sent from those IPs, and use the value of that header as the end user's IP address. + +proxy_url + If this Bugzilla installation is behind a proxy, enter the proxy + information here to enable Bugzilla to access the Internet. Bugzilla + requires Internet access to utilize the + :param:`upgrade_notification` parameter. If the + proxy requires authentication, use the syntax: + :paramval:`http://user:pass@proxy_url/`. + +strict_transport_security + Enables the sending of the Strict-Transport-Security header along with HTTP responses on SSL connections. This adds greater security to your SSL connections by forcing the browser to always access your domain over SSL and never accept an invalid certificate. However, it should only be used if you have the :param:`ssl_redirect` parameter turned on, Bugzilla is the only thing running on its domain (i.e., your :param:`urlbase` is something like :paramval:`http://bugzilla.example.com/`), and you never plan to stop supporting SSL. + + * :paramval:`off` - Don't send the Strict-Transport-Security header with requests. + * :paramval:`this_domain_only` - Send the Strict-Transport-Security header with all requests, but only support it for the current domain. + * :paramval:`include_subdomains` - Send the Strict-Transport-Security header along with the includeSubDomains flag, which will apply the security change to all subdomains. This is especially useful when combined with an :param:`attachment_base` that exists as (a) subdomain(s) under the main Bugzilla domain. diff --git a/docs/en/rst/administering/preferences.rst b/docs/en/rst/administering/preferences.rst new file mode 100644 index 000000000..0b89c7b13 --- /dev/null +++ b/docs/en/rst/administering/preferences.rst @@ -0,0 +1,10 @@ +.. _default-preferences: + +Default Preferences +################### + +Each user of Bugzilla can set certain preferences about how they want +Bugzilla to behave. Here, you can say whether or not each of the possible +preferences is available to the user and, if it is, what the default value +is. + diff --git a/docs/en/rst/administering/quips.rst b/docs/en/rst/administering/quips.rst new file mode 100644 index 000000000..789304a33 --- /dev/null +++ b/docs/en/rst/administering/quips.rst @@ -0,0 +1,38 @@ +.. _quips: + +Quips +##### + +Quips are small user-defined messages (often quotes or witty sayings) that +can be configured to appear at the top of search results. Each Bugzilla +installation has its own specific quips. Whenever a quip needs to be +displayed, a random selection is made from the pool of already existing quips. + +Quip submission is controlled by :param:`quip_list_entry_control` +parameter. It has several possible values: open, moderated, or closed. +In order to enable quips approval you need to set this parameter to +"moderated". In this way, users are free to submit quips for addition, +but an administrator must explicitly approve them before they are +actually used. + +In order to see the user interface for the quips, you can +click on a quip when it is displayed together with the search +results. You can also go directly to the quips.cgi URL +(prefixed with the usual web location of the Bugzilla installation). +Once the quip interface is displayed, the "view and edit the whole +quip list" link takes you to the quips administration page, which +lists all quips available in the database. + +Next to each quip there is a checkbox, under the +"Approved" column. Quips that have this checkbox checked are +already approved and will appear next to the search results. +The ones that have it unchecked are still preserved in the +database but will not appear on search results pages. +User submitted quips have initially the checkbox unchecked. + +Also, there is a delete link next to each quip, +which can be used in order to permanently delete a quip. + +Display of quips is controlled by the *display_quips* +user preference. Possible values are "on" and "off". + diff --git a/docs/en/rst/administering/users.rst b/docs/en/rst/administering/users.rst new file mode 100644 index 000000000..b8657e5d9 --- /dev/null +++ b/docs/en/rst/administering/users.rst @@ -0,0 +1,244 @@ +.. _users: + +Users +##### + +.. _defaultuser: + +Creating Admin Users +==================== + +When you first run checksetup.pl after installing Bugzilla, it will +prompt you for the username (email address) and password for the first +admin user. If for some reason you delete all the admin users, +re-running checksetup.pl will again prompt you for a username and +password and make a new admin. + +If you wish to add more administrative users, add them to the "admin" group. + +.. _user-account-search: + +Searching For Users +=================== + +If you have ``editusers`` privileges or if you are allowed +to grant privileges for some groups, the :guilabel:`Users` link +will appear in the Administration page. + +The first screen is a search form to search for existing user +accounts. You can run searches based either on the user ID, real +name or login name (i.e. the email address, or just the first part +of the email address if the :param:`emailsuffix` parameter is set). +The search can be conducted +in different ways using the listbox to the right of the text entry +box. You can match by case-insensitive substring (the default), +regular expression, a *reverse* regular expression +match (which finds every user name which does NOT match the regular +expression), or the exact string if you know exactly who you are +looking for. The search can be restricted to users who are in a +specific group. By default, the restriction is turned off. + +The search returns a list of +users matching your criteria. User properties can be edited by clicking +the login name. The Account History of a user can be viewed by clicking +the "View" link in the Account History column. The Account History +displays changes that have been made to the user account, the time of +the change and the user who made the change. For example, the Account +History page will display details of when a user was added or removed +from a group. + +.. _modifyusers: + +Modifying Users +=============== + +Once you have found your user, you can change the following +fields: + +- *Login Name*: + This is generally the user's full email address. However, if you + have are using the :param:`emailsuffix` parameter, this may + just be the user's login name. Unless you turn off the + :param:`allowemailchange` parameter, users can change their + login names themselves (to any valid email address). + +- *Real Name*: The user's real name. Note that + Bugzilla does not require this to create an account. + +- *Password*: + You can change the user's password here. Users can automatically + request a new password, so you shouldn't need to do this often. + If you want to disable an account, see Disable Text below. + +- *Bugmail Disabled*: + Mark this checkbox to disable bugmail and whinemail completely + for this account. This checkbox replaces the data/nomail file + which existed in older versions of Bugzilla. + +- *Disable Text*: + If you type anything in this box, including just a space, the + user is prevented from logging in and from making any changes to + bugs via the web interface. + The HTML you type in this box is presented to the user when + they attempt to perform these actions and should explain + why the account was disabled. + Users with disabled accounts will continue to receive + mail from Bugzilla; furthermore, they will not be able + to log in themselves to change their own preferences and + stop it. If you want an account (disabled or active) to + stop receiving mail, simply check the + ``Bugmail Disabled`` checkbox above. + + .. note:: Even users whose accounts have been disabled can still + submit bugs via the email gateway, if one exists. + The email gateway should *not* be + enabled for secure installations of Bugzilla. + + .. warning:: Don't disable all the administrator accounts! + +- *<groupname>*: + If you have created some groups, e.g. "securitysensitive", then + checkboxes will appear here to allow you to add users to, or + remove them from, these groups. The first checkbox gives the + user the ability to add and remove other users as members of + this group. The second checkbox adds the user himself as a member + of the group. + +- *canconfirm*: + This field is only used if you have enabled the "unconfirmed" + status. If you enable this for a user, + that user can then move bugs from "Unconfirmed" to a "Confirmed" + status (e.g.: "New" status). + +- *creategroups*: + This option will allow a user to create and destroy groups in + Bugzilla. + +- *editbugs*: + Unless a user has this bit set, they can only edit those bugs + for which they are the assignee or the reporter. Even if this + option is unchecked, users can still add comments to bugs. + +- *editcomponents*: + This flag allows a user to create new products and components, + modify existing products and components, and destroy those that have + no bugs associated with them. If a product or component has bugs + associated with it, those bugs must be moved to a different product + or component before Bugzilla will allow them to be destroyed. + +- *editkeywords*: + If you use Bugzilla's keyword functionality, enabling this + feature allows a user to create and destroy keywords. A keyword + must be removed from any bugs upon which it is currently set + before it can be destroyed. + +- *editusers*: + This flag allows a user to do what you're doing right now: edit + other users. This will allow those with the right to do so to + remove administrator privileges from other users or grant them to + themselves. Enable with care. + +- *tweakparams*: + This flag allows a user to change Bugzilla's Params + (using :file:`editparams.cgi`.) + +- *<productname>*: + This allows an administrator to specify the products + in which a user can see bugs. If you turn on the + :param:`makeproductgroups` parameter in + the Group Security Panel in the Parameters page, + then Bugzilla creates one group per product (at the time you create + the product), and this group has exactly the same name as the + product itself. Note that for products that already exist when + the parameter is turned on, the corresponding group will not be + created. The user must still have the :group:`editbugs` + privilege to edit bugs in these products. + +.. _createnewusers: + +Creating New Users +================== + +.. _self-registration: + +Self-Registration +----------------- + +By default, users can create their own user accounts by clicking the +``New Account`` link at the bottom of each page (assuming +they aren't logged in as someone else already). If you want to disable +this self-registration, or if you want to restrict who can create their +own user account, you have to edit the :param:`createemailregexp` +parameter in the ``Configuration`` page; see +:ref:`parameters`. + +.. _user-account-creation: + +Administrator Registration +-------------------------- + +Users with ``editusers`` privileges, such as administrators, +can create user accounts for other users: + +#. After logging in, click the "Users" link at the footer of + the query page, and then click "Add a new user". + +#. Fill out the form presented. This page is self-explanatory. + When done, click "Submit". + + .. note:: Adding a user this way will *not* + send an email informing them of their username and password. + While useful for creating dummy accounts (watchers which + shuttle mail to another system, for instance, or email + addresses which are a mailing list), in general it is + preferable to log out and use the ``New Account`` + button to create users, as it will pre-populate all the + required fields and also notify the user of her account name + and password. + +.. _user-account-deletion: + +Deleting Users +============== + +If the :param:`allowuserdeletion` parameter is turned on (see +:ref:`parameters`) then you can also delete user accounts. +Note that, most of the time, this is not the best thing to do. If only +a warning in a yellow box is displayed, then the deletion is safe. +If a warning is also displayed in a red box, then you should NOT try +to delete the user account, else you will get referential integrity +problems in your database, which can lead to unexpected behavior, +such as bugs not appearing in bug lists anymore, or data displaying +incorrectly. You have been warned! + +.. _impersonatingusers: + +Impersonating Users +=================== + +There may be times when an administrator would like to do something as +another user. The :command:`sudo` feature may be used to do +this. + +.. note:: To use the sudo feature, you must be in the + *bz_sudoers* group. By default, all + administrators are in this group. + +If you have access to this feature, you may start a session by +going to the Edit Users page, Searching for a user and clicking on +their login. You should see a link below their login name titled +"Impersonate this user". Click on the link. This will take you +to a page where you will see a description of the feature and +instructions for using it. After reading the text, simply +enter the login of the user you would like to impersonate, provide +a short message explaining why you are doing this, and press the +button. + +As long as you are using this feature, everything you do will be done +as if you were logged in as the user you are impersonating. + +.. warning:: The user you are impersonating will not be told about what you are + doing. If you do anything that results in mail being sent, that + mail will appear to be from the user you are impersonating. You + should be extremely careful while using this feature. + diff --git a/docs/en/rst/administering/whining.rst b/docs/en/rst/administering/whining.rst new file mode 100644 index 000000000..dc101ab9b --- /dev/null +++ b/docs/en/rst/administering/whining.rst @@ -0,0 +1,145 @@ +.. _whining: + +Whining +####### + +Whining is a feature in Bugzilla that can regularly annoy users at +specified times. Using this feature, users can execute saved searches +at specific times (e.g. the 15th of the month at midnight) or at +regular intervals (e.g. every 15 minutes on Sundays). The results of the +searches are sent to the user, either as a single email or as one email +per bug, along with some descriptive text. + +.. warning:: Throughout this section it will be assumed that all users are members + of the bz_canusewhines group, membership in which is required in order + to use the Whining system. You can easily make all users members of + the bz_canusewhines group by setting the User RegExp to ".*" (without + the quotes). + + Also worth noting is the bz_canusewhineatothers group. Members of this + group can create whines for any user or group in Bugzilla using an + extended form of the whining interface. Features only available to + members of the bz_canusewhineatothers group will be noted in the + appropriate places. + +.. note:: For whining to work, a special Perl script must be executed at regular + intervals. More information on this is available in :ref:`installation-whining`. + +.. note:: This section does not cover the whineatnews.pl script. + See :ref:`installation-whining-cron` for more information on + The Whining Cron. + +.. _whining-overview: + +The Event +========= + +The whining system defines an "Event" as one or more queries being +executed at regular intervals, with the results of said queries (if +there are any) being emailed to the user. Events are created by +clicking on the "Add new event" button. + +Once a new event is created, the first thing to set is the "Email +subject line". The contents of this field will be used in the subject +line of every email generated by this event. In addition to setting a +subject, space is provided to enter some descriptive text that will be +included at the top of each message (to help you in understanding why +you received the email in the first place). + +The next step is to specify when the Event is to be run (the Schedule) +and what searches are to be performed (the Searches). + +.. _whining-schedule: + +Whining Schedule +================ + +Each whining event is associated with zero or more schedules. A +schedule is used to specify when the search (specified below) is to be +run. A new event starts out with no schedules (which means it will +never run, as it is not scheduled to run). To add a schedule, press +the "Add a new schedule" button. + +Each schedule includes an interval, which you use to tell Bugzilla +when the event should be run. An event can be run on certain days of +the week, certain days of the month, during weekdays (defined as +Monday through Friday), or every day. + +.. warning:: Be careful if you set your event to run on the 29th, 30th, or 31st of + the month, as your event may not run exactly when expected. If you + want your event to run on the last day of the month, select "Last day + of the month" as the interval. + +Once you have specified the day(s) on which the event is to be run, you +should now specify the time at which the event is to be run. You can +have the event run at a certain hour on the specified day(s), or +every hour, half-hour, or quarter-hour on the specified day(s). + +If a single schedule does not execute an event as many times as you +would want, you can create another schedule for the same event. For +example, if you want to run an event on days whose numbers are +divisible by seven, you would need to add four schedules to the event, +setting the schedules to run on the 7th, 14th, 21st, and 28th (one day +per schedule) at whatever time (or times) you choose. + +.. note:: If you are a member of the bz_canusewhineatothers group, then you + will be presented with another option: "Mail to". Using this you + can control who will receive the emails generated by this event. You + can choose to send the emails to a single user (identified by email + address) or a single group (identified by group name). To send to + multiple users or groups, create a new schedule for each additional + user/group. + +.. _whining-query: + +Whining Searches +================ + +Each whining event is associated with zero or more searches. A search +is any saved search to be run as part of the specified schedule (see +above). You start out without any searches associated with the event +(which means that the event will not run, as there will never be any +results to return). To add a search, press the "Add a search" button. + +The first field to examine in your newly added search is the Sort field. +Searches are run, and results included, in the order specified by the +Sort field. Searches with smaller Sort values will run before searches +with bigger Sort values. + +The next field to examine is the Search field. This is where you +choose the actual search that is to be run. Instead of defining search +parameters here, you are asked to choose from the list of saved +searches (the same list that appears at the bottom of every Bugzilla +page). You are only allowed to choose from searches that you have +saved yourself (the default saved search, "My Bugs", is not a valid +choice). If you do not have any saved searches, you can take this +opportunity to create one (see :ref:`list`). + +.. note:: When running searches, the whining system acts as if you are the user + executing the search. This means that the whining system will ignore + bugs that match your search but that you cannot access. + +Once you have chosen the saved search to be executed, give the search a +descriptive title. This title will appear in the email, above the +results of the search. If you choose "One message per bug", the search +title will appear at the top of each email that contains a bug matching +your search. + +Finally, decide if the results of the search should be sent in a single +email, or if each bug should appear in its own email. + +.. warning:: Think carefully before checking the "One message per bug" box. If + you create a search that matches thousands of bugs, you will receive + thousands of emails! + +Saving Your Changes +=================== + +Once you have defined at least one schedule and created at least one +search, go ahead and "Update/Commit". This will save your Event and make +it available for immediate execution. + +.. note:: If you ever feel like deleting your event, you may do so using the + "Remove Event" button in the upper-right corner of each Event. You + can also modify an existing event, so long as you "Update/Commit" + after completing your modifications. diff --git a/docs/en/rst/administering/workflow.rst b/docs/en/rst/administering/workflow.rst new file mode 100644 index 000000000..7ce5b7a87 --- /dev/null +++ b/docs/en/rst/administering/workflow.rst @@ -0,0 +1,34 @@ +.. _workflow: + +Workflow +######## + +The bug status workflow—which statuses are valid transitions from which +other statuses—can be customized. + +You need to begin by defining the statuses and resolutions you want to use +(see :ref:`field-values`). By convention, these are in all capital letters. + +Only one bug status, UNCONFIRMED, can never be renamed nor deleted. However, +it can be disabled entirely on a per-product basis (see :ref:`categorization`). +The status referred to by the :param:`duplicate_or_move_bug_status` parameter, if +set, is also undeletable. To make it deletable, +simply set the value of that parameter to a different status. + +Aside from the empty value, two resolutions, DUPLICATE and FIXED, cannot be +renamed or deleted. (FIXED could be if we fixed +`bug 1007605 <https://bugzilla.mozilla.org/show_bug.cgi?id=1007605>`_.) + +Once you have defined your statuses, you can configure the workflow of +how a bug moves between them. The workflow configuration +page displays all existing bug statuses twice: first on the left for the +starting status, and on the top for the target status in the transition. +If the checkbox is checked, then the transition from the left to the top +status is legal; if it's unchecked, that transition is forbidden. + +The status used as the :param:`duplicate_or_move_bug_status` parameter +(normally RESOLVED or its equivalent) is required to be a legal transition +from every other bug status, and so this is enforced on the page. + +The "View Comments Required on Status Transitions" link below the table +lets you set which transitions require a comment from the user. diff --git a/docs/en/rst/api/core/v1/attachment.rst b/docs/en/rst/api/core/v1/attachment.rst new file mode 100644 index 000000000..f89b6c23e --- /dev/null +++ b/docs/en/rst/api/core/v1/attachment.rst @@ -0,0 +1,351 @@ +Attachments +=========== + +The Bugzilla API for creating, changing, and getting the details of attachments. + +.. _rest_attachments: + +Get Attachment +-------------- + +This allows you to get data about attachments, given a list of bugs and/or +attachment IDs. Private attachments will only be returned if you are in the +appropriate group or if you are the submitter of the attachment. + +**Request** + +To get all current attachments for a bug: + +.. code-block:: text + + GET /rest/bug/(bug_id)/attachment + +To get a specific attachment based on attachment ID: + +.. code-block:: text + + GET /rest/bug/attachment/(attachment_id) + +One of the below must be specified. + +================= ==== ====================================================== +name type description +================= ==== ====================================================== +**bug_id** int Integer bug ID. +**attachment_id** int Integer attachment ID. +================= ==== ====================================================== + +**Response** + +.. code-block:: js + + { + "bugs" : { + "1345" : [ + { (attachment) }, + { (attachment) } + ], + "9874" : [ + { (attachment) }, + { (attachment) } + ], + }, + "attachments" : { + "234" : { (attachment) }, + "123" : { (attachment) }, + } + } + +An object containing two elements: ``bugs`` and ``attachments``. + +The attachments for the bug that you specified in the ``bug_id`` argument in +input are returned in ``bugs`` on output. ``bugs`` is a object that has integer +bug IDs for keys and the values are arrays of objects as attachments. +(Fields for attachments are described below.) + +For the attachment that you specified directly in ``attachment_id``, they +are returned in ``attachments`` on output. This is a object where the attachment +ids point directly to objects describing the individual attachment. + +The fields for each attachment (where it says ``(attachment)`` in the +sample response above) are: + +================ ======== ===================================================== +name type description +================ ======== ===================================================== +data base64 The raw data of the attachment, encoded as Base64. +size int The length (in bytes) of the attachment. +creation_time datetime The time the attachment was created. +last_change_time datetime The last time the attachment was modified. +id int The numeric ID of the attachment. +bug_id int The numeric ID of the bug that the attachment is + attached to. +file_name string The file name of the attachment. +summary string A short string describing the attachment. +content_type string The MIME type of the attachment. +is_private boolean ``true`` if the attachment is private (only visible + to a certain group called the "insidergroup", + ``false`` otherwise. +is_obsolete boolean ``true`` if the attachment is obsolete, ``false`` + otherwise. +is_patch boolean ``true`` if the attachment is a patch, ``false`` + otherwise. +creator string The login name of the user that created the + attachment. +flags array Array of objects, each containing the information + about the flag currently set for each attachment. + Each flag object contains items descibed in the + Flag object below. +================ ======== ===================================================== + +Flag object: + +================= ======== ==================================================== +name type description +================= ======== ==================================================== +id int The ID of the flag. +name string The name of the flag. +type_id int The type ID of the flag. +creation_date datetime The timestamp when this flag was originally created. +modification_date datetime The timestamp when the flag was last modified. +status string The current status of the flag such as ?, +, or -. +setter string The login name of the user who created or last + modified the flag. +requestee string The login name of the user this flag has been + requested to be granted or denied. Note, this field + is only returned if a requestee is set. +================= ======== ==================================================== + +.. _rest_add_attachment: + +Create Attachment +----------------- + +This allows you to add an attachment to a bug in Bugzilla. + +**Request** + +To create attachment on a current bug: + +.. code-block:: text + + POST /rest/bug/(bug_id)/attachment + +.. code-block:: js + + { + "ids" : [ 35 ], + "is_patch" : true, + "comment" : "This is a new attachment comment", + "summary" : "Test Attachment", + "content_type" : "text/plain", + "data" : "(Some patch content)", + "file_name" : "test_attachment.patch", + "obsoletes" : [], + "is_private" : false, + "flags" : [ + { + "name" : "review", + "status" : "?", + "requestee" : "user@bugzilla.org", + "new" : true + } + ] + } + + +The params to include in the POST body, as well as the returned +data format, are the same as below. The ``bug_id`` param will be +overridden as it it pulled from the URL path. + +================ ======= ====================================================== +name type description +================ ======= ====================================================== +**ids** array The IDs or aliases of bugs that you want to add this + attachment to. The same attachment and comment will be + added to all these bugs. +**data** string The content of the attachment. If the content of the + attachment is not ASCII text such as + ``application/octet-stream`` you must encode it in + base64 using an appropriate client library such as + ``MIME::Base64`` for Perl. +**file_name** string The "file name" that will be displayed in the UI for + this attachment and also downloaded copies will be + given. +**summary** string A short string describing the attachment. +**content_type** string The MIME type of the attachment, like ``text/plain`` + or ``image/png``. +comment string A comment to add along with this attachment. +is_patch boolean ``true`` if Bugzilla should treat this attachment as a + patch. If you specify this, you do not need to specify + a ``content_type``. The ``content_type`` of the + attachment will be forced to ``text/plain``. Defaults + to ``false`` if not specified. +is_private boolean ``true`` if the attachment should be private + (restricted to the "insidergroup"), ``false`` if the + attachment should be public. Defaults to ``false`` if + not specified. +flags array Flags objects to add to the attachment. The object + format is described in the Flag object below. +================ ======= ====================================================== + +Flag object: + +To create a flag, at least the ``status`` and the ``type_id`` or ``name`` must +be provided. An optional requestee can be passed if the flag type is requestable +to a specific user. + +========= ====== ============================================================== +name type description +========= ====== ============================================================== +name string The name of the flag type. +type_id int The internal flag type ID. +status string The flags new status (i.e. "?", "+", "-" or "X" to clear a + flag). +requestee string The login of the requestee if the flag type is requestable to + a specific user. +========= ====== ============================================================== + +**Response** + +.. code-block:: js + + { + "ids" : [ + "2797" + ] + } + +==== ===== ========================= +name type description +==== ===== ========================= +ids array Attachment IDs created. +==== ===== ========================= + +.. _rest_update_attachment: + +Update Attachment +----------------- + +This allows you to update attachment metadata in Bugzilla. + +**Request** + +To update attachment metadata on a current attachment: + +.. code-block:: text + + PUT /rest/bug/attachment/(attachment_id) + +.. code-block:: js + + { + "ids" : [ 2796 ], + "summary" : "Test XML file", + "comment" : "Changed this from a patch to a XML file", + "content_type" : "text/xml", + "is_patch" : 0 + } + +================= ===== ======================================================= +name type description +================= ===== ======================================================= +**attachment_id** int Integer attachment ID. +**ids** array The IDs of the attachments you want to update. +================= ===== ======================================================= + +============ ======= ========================================================== +name type description +============ ======= ========================================================== +file_name string The "file name" that will be displayed in the UI for this + attachment. +summary string A short string describing the attachment. +comment string An optional comment to add to the attachment's bug. +content_type string The MIME type of the attachment, like ``text/plain`` + or ``image/png``. +is_patch boolean ``true`` if Bugzilla should treat this attachment as a + patch. If you specify this, you do not need to specify a + ``content_type``. The ``content_type`` of the attachment + will be forced to ``text/plain``. +is_private boolean ``true`` if the attachment should be private (restricted + to the "insidergroup"), ``false`` if the attachment + should be public. +is_obsolete boolean ``true`` if the attachment is obsolete, ``false`` + otherwise. +flags array An array of Flag objects with changes to the flags. The + object format is described in the Flag object below. +============ ======= ========================================================== + +Flag object: + +The following values can be specified. At least the ``status`` and one of +``type_id``, ``id``, or ``name`` must be specified. If a type_id or name matches +a single currently set flag, the flag will be updated unless ``new`` is specified. + +========= ======= ============================================================= +name type description +========= ======= ============================================================= +name string The name of the flag that will be created or updated. +type_id int The internal flag type ID that will be created or updated. + You will need to specify the ``type_id`` if more than one + flag type of the same name exists. +status string The flags new status (i.e. "?", "+", "-" or "X" to clear a + flag). +requestee string The login of the requestee if the flag type is requestable + to a specific user. +id int Use ID to specify the flag to be updated. You will need to + specify the ``id`` if more than one flag is set of the same + name. +new boolean Set to true if you specifically want a new flag to be + created. +========= ======= ============================================================= + +**Response** + +.. code-block:: js + + { + "attachments" : [ + { + "changes" : { + "content_type" : { + "added" : "text/xml", + "removed" : "text/plain" + }, + "is_patch" : { + "added" : "0", + "removed" : "1" + }, + "summary" : { + "added" : "Test XML file", + "removed" : "test patch" + } + }, + "id" : 2796, + "last_change_time" : "2014-09-29T14:41:53Z" + } + ] + } + +``attachments`` (array) Change objects with the following items: + +================ ======== ===================================================== +name type description +================ ======== ===================================================== +id int The ID of the attachment that was updated. +last_change_time datetime The exact time that this update was done at, for this + attachment. If no update was done (that is, no fields + had their values changed and no comment was added) + then this will instead be the last time the + attachment was updated. +changes object The changes that were actually done on this + attachment. The keys are the names of the fields that + were changed, and the values are an object with two + items: + + * added: (string) The values that were added to this + field. Possibly a comma-and-space-separated list + if multiple values were added. + * removed: (string) The values that were removed from + this field. +================ ======== ===================================================== diff --git a/docs/en/rst/api/core/v1/bug-user-last-visit.rst b/docs/en/rst/api/core/v1/bug-user-last-visit.rst new file mode 100644 index 000000000..919744968 --- /dev/null +++ b/docs/en/rst/api/core/v1/bug-user-last-visit.rst @@ -0,0 +1,111 @@ +Bug User Last Visited +===================== + +.. _rest-bug-user-last-visit-update: + +Update Last Visited +------------------- + +Update the last-visited time for the specified bug and current user. + +**Request** + +To update the time for a single bug id: + +.. code-block:: text + + POST /rest/bug_user_last_visit/(id) + +To update one or more bug ids at once: + +.. code-block:: text + + POST /rest/bug_user_last_visit + +.. code-block:: js + + { + "ids" : [35,36,37] + } + +======= ===== ============================== +name type description +======= ===== ============================== +**id** int An integer bug id. +**ids** array One or more bug ids to update. +======= ===== ============================== + +**Response** + +.. code-block:: js + + [ + { + "id" : 100, + "last_visit_ts" : "2014-10-16T17:38:24Z" + } + ] + +An array of objects containing the items: + +============= ======== ============================================ +name type description +============= ======== ============================================ +id int The bug id. +last_visit_ts datetime The timestamp the user last visited the bug. +============= ======== ============================================ + +.. _rest-bug-user-last-visit-get: + +Get Last Visited +---------------- + +**Request** + +Get the last-visited timestamp for one or more specified bug ids or get a +list of the last 20 visited bugs and their timestamps. + +To return the last-visited timestamp for a single bug id: + +.. code-block:: text + + GET /rest/bug_user_last_visit/(id) + +To return more than one specific bug timestamps: + +.. code-block:: text + + GET /rest/bug_user_last_visit/123?ids=234&ids=456 + +To return just the most recent 20 timestamps: + +.. code-block:: text + + GET /rest/bug_user_last_visit + +======= ===== ============================================ +name type description +======= ===== ============================================ +**id** int An integer bug id. +**ids** array One or more optional bug ids to get. +======= ===== ============================================ + +**Response** + +.. code-block:: js + + [ + { + "id" : 100, + "last_visit_ts" : "2014-10-16T17:38:24Z" + } + ] + +An array of objects containing the following items: + +============= ======== ============================================ +name type description +============= ======== ============================================ +id int The bug id. +last_visit_ts datetime The timestamp the user last visited the bug. +============= ======== ============================================ diff --git a/docs/en/rst/api/core/v1/bug.rst b/docs/en/rst/api/core/v1/bug.rst new file mode 100644 index 000000000..1bf2a2006 --- /dev/null +++ b/docs/en/rst/api/core/v1/bug.rst @@ -0,0 +1,986 @@ +Bugs +==== + +The REST API for creating, changing, and getting the details of bugs. + +This part of the Bugzilla REST API allows you to file new bugs in Bugzilla and +to get information about existing bugs. + +.. _rest_single_bug: + +Get Bug +------- + +Gets information about particular bugs in the database. + +**Request** + +To get information about a particular bug using its ID or alias: + +.. code-block:: text + + GET /rest/bug/(id_or_alias) + +You can also use :ref:`rest_search_bugs` to return more than one bug at a time +by specifying bug IDs as the search terms. + +.. code-block:: text + + GET /rest/bug?id=12434,43421 + +================ ===== ====================================================== +name type description +================ ===== ====================================================== +**id_or_alias** mixed An integer bug ID or a bug alias string. +================ ===== ====================================================== + +**Response** + +.. code-block:: js + + { + "faults": [], + "bugs": [ + { + "assigned_to_detail": { + "id": 2, + "real_name": "Test User", + "name": "user@bugzilla.org", + "email": "user@bugzilla.org" + }, + "flags": [ + { + "type_id": 11, + "modification_date": "2014-09-28T21:03:47Z", + "name": "blocker", + "status": "?", + "id": 2906, + "setter": "user@bugzilla.org", + "creation_date": "2014-09-28T21:03:47Z" + } + ], + "resolution": "INVALID", + "id": 35, + "qa_contact": "", + "version": "1.0", + "status": "RESOLVED", + "creator": "user@bugzilla.org", + "cf_drop_down": "---", + "summary": "test bug", + "last_change_time": "2014-09-23T19:12:17Z", + "platform": "All", + "url": "", + "classification": "Unclassified", + "cc_detail": [ + { + "id": 786, + "real_name": "Foo Bar", + "name": "foo@bar.com", + "email": "foo@bar.com" + }, + ], + "priority": "P1", + "is_confirmed": true, + "creation_time": "2000-07-25T13:50:04Z", + "assigned_to": "user@bugzilla.org", + "flags": [], + "alias": [], + "cf_large_text": "", + "groups": [], + "op_sys": "All", + "cf_bug_id": null, + "depends_on": [], + "is_cc_accessible": true, + "is_open": false, + "cf_qa_list_4": "---", + "keywords": [], + "cc": [ + "foo@bar.com", + ], + "see_also": [], + "deadline": null, + "is_creator_accessible": true, + "whiteboard": "", + "dupe_of": null, + "target_milestone": "---", + "cf_mulitple_select": [], + "component": "SaltSprinkler", + "severity": "critical", + "cf_date": null, + "product": "FoodReplicator", + "creator_detail": { + "id": 28, + "real_name": "hello", + "name": "user@bugzilla.org", + "email": "namachi@netscape.com" + }, + "cf_free_text": "", + "blocks": [] + } + ] + } + +``bugs`` (array) Each bug object contains information about the bugs with valid +ids containing the following items: + +These fields are returned by default or by specifying ``_default`` in +``include_fields``. + +===================== ======== ================================================ +name type description +===================== ======== ================================================ +actual_time double The total number of hours that this bug has + taken so far. If you are not in the time-tracking + group, this field will not be included in the + return value. +alias array The unique aliases of this bug. An empty array + will be returned if this bug has no aliases. +assigned_to string The login name of the user to whom the bug is + assigned. +assigned_to_detail object An object containing detailed user information + for the assigned_to. To see the keys included + in the user detail object, see below. +blocks array The IDs of bugs that are "blocked" by this bug. +cc array The login names of users on the CC list of this + bug. +cc_detail array Array of objects containing detailed user + information for each of the cc list members. + To see the keys included in the user detail + object, see below. +classification string The name of the current classification the bug + is in. +component string The name of the current component of this bug. +creation_time datetime When the bug was created. +creator string The login name of the person who filed this bug + (the reporter). +creator_detail object An object containing detailed user information + for the creator. To see the keys included in the + user detail object, see below. +deadline string The day that this bug is due to be completed, in + the format ``YYYY-MM-DD``. +depends_on array The IDs of bugs that this bug "depends on". +dupe_of int The bug ID of the bug that this bug is a + duplicate of. If this bug isn't a duplicate of + any bug, this will be null. +estimated_time double The number of hours that it was estimated that + this bug would take. If you are not in the + time-tracking group, this field will not be + included in the return value. +flags array An array of objects containing the information + about flags currently set for the bug. Each flag + objects contains the following items +groups array The names of all the groups that this bug is in. +id int The unique numeric ID of this bug. +is_cc_accessible boolean If true, this bug can be accessed by members of + the CC list, even if they are not in the groups + the bug is restricted to. +is_confirmed boolean ``true`` if the bug has been confirmed. Usually + this means that the bug has at some point been + moved out of the ``UNCONFIRMED`` status and into + another open status. +is_open boolean ``true`` if this bug is open, ``false`` if it + is closed. +is_creator_accessible boolean If ``true``, this bug can be accessed by the + creator of the bug, even if they are not a + member of the groups the bug is restricted to. +keywords array Each keyword that is on this bug. +last_change_time datetime When the bug was last changed. +op_sys string The name of the operating system that the bug + was filed against. +platform string The name of the platform (hardware) that the bug + was filed against. +priority string The priority of the bug. +product string The name of the product this bug is in. +qa_contact string The login name of the current QA Contact on the + bug. +qa_contact_detail object An object containing detailed user information + for the qa_contact. To see the keys included in + the user detail object, see below. +remaining_time double The number of hours of work remaining until work + on this bug is complete. If you are not in the + time-tracking group, this field will not be + included in the return value. +resolution string The current resolution of the bug, or an empty + string if the bug is open. +see_also array The URLs in the See Also field on the bug. +severity string The current severity of the bug. +status string The current status of the bug. +summary string The summary of this bug. +target_milestone string The milestone that this bug is supposed to be + fixed by, or for closed bugs, the milestone that + it was fixed for. +update_token string The token that you would have to pass to the + ``process_bug.cgi`` page in order to update this + bug. This changes every time the bug is updated. + This field is not returned to logged-out users. +url string A URL that demonstrates the problem described in + the bug, or is somehow related to the bug report. +version string The version the bug was reported against. +whiteboard string The value of the "status whiteboard" field on + the bug. +===================== ======== ================================================ + +Custom fields: + +Every custom field in this installation will also be included in the +return value. Most fields are returned as strings. However, some field types have +different return values. + +Normally custom fields are returned by default similar to normal bug fields or +you can specify only custom fields by using ``_custom`` in ``include_fields``. + +Extra fields: + +These fields are returned only by specifying ``_extra`` or the field name in +``include_fields``. + +==== ===== ==================================================================== +name type description +==== ===== ==================================================================== +tags array Each array item is a tag name. Note that tags are + personal to the currently logged in user and are not the same as + comment tags. +==== ===== ==================================================================== + +User object: + +========= ====== ============================================================== +name type description +========= ====== ============================================================== +id int The user ID for this user. +real_name string The 'real' name for this user, if any. +name string The user's Bugzilla login. +email string The user's email address. Currently this is the same value as + the name. +========= ====== ============================================================== + +Flag object: + +================= ======== ==================================================== +name type description +================= ======== ==================================================== +id int The ID of the flag. +name string The name of the flag. +type_id int The type ID of the flag. +creation_date datetime The timestamp when this flag was originally created. +modification_date datetime The timestamp when the flag was last modified. +status string The current status of the flag. +setter string The login name of the user who created or last + modified the flag. +requestee string The login name of the user this flag has been + requested to be granted or denied. Note, this field + is only returned if a requestee is set. +================= ======== ==================================================== + +Custom field object: + +You can specify to only return custom fields by specifying ``_custom`` or the +field name in ``include_fields``. + +* Bug ID Fields: (int) +* Multiple-Selection Fields: (array of strings) +* Date/Time Fields: (datetime) + +.. _rest_history: + +Bug History +----------- + +Gets the history of changes for particular bugs in the database. + +**Request** + +To get the history for a specific bug ID: + +.. code-block:: text + + GET /rest/bug/(id)/history + +To get the history for a bug since a specific date: + +.. code-block:: text + + GET /rest/bug/(id)/history?new_since=YYYY-MM-DD + +========= ======== ============================================================ +name type description +========= ======== ============================================================ +**id** mixed An integer bug ID or alias. +new_since datetime A datetime timestamp to only show history since. +========= ======== ============================================================ + +**Response** + +.. code-block:: js + + { + "bugs": [ + { + "alias": [], + "history": [ + { + "when": "2014-09-23T19:12:17Z", + "who": "user@bugzilla.org", + "changes": [ + { + "added": "P1", + "field_name": "priority", + "removed": "P2" + }, + { + "removed": "blocker", + "field_name": "severity", + "added": "critical" + } + ] + }, + { + "when": "2014-09-28T21:03:47Z", + "who": "user@bugzilla.org", + "changes": [ + { + "added": "blocker?", + "removed": "", + "field_name": "flagtypes.name" + } + ] + } + ], + "id": 35 + } + ] + } + +``bugs`` (array) Bug objects each containing the following items: + +======= ===== ================================================================= +name type description +======= ===== ================================================================= +id int The numeric ID of the bug. +alias array The unique aliases of this bug. An empty array will be returned + if this bug has no aliases. +history array An array of History objects. +======= ===== ================================================================= + +History object: + +======= ======== ============================================================== +name type description +======= ======== ============================================================== +when datetime The date the bug activity/change happened. +who string The login name of the user who performed the bug change. +changes array An array of Change objects which contain all the changes that + happened to the bug at this time (as specified by ``when``). +======= ======== ============================================================== + +Change object: + +============= ====== ========================================================== +name type description +============= ====== ========================================================== +field_name string The name of the bug field that has changed. +removed string The previous value of the bug field which has been + deleted by the change. +added string The new value of the bug field which has been added + by the change. +attachment_id int The ID of the attachment that was changed. + This only appears if the change was to an attachment, + otherwise ``attachment_id`` will not be present in this + object. +============= ====== ========================================================== + +.. _rest_search_bugs: + +Search Bugs +----------- + +Allows you to search for bugs based on particular criteria. + +**Request** + +To search for bugs: + +.. code-block:: text + + GET /rest/bug + +Unless otherwise specified in the description of a parameter, bugs are +returned if they match *exactly* the criteria you specify in these +parameters. That is, we don't match against substrings--if a bug is in +the "Widgets" product and you ask for bugs in the "Widg" product, you +won't get anything. + +Criteria are joined in a logical AND. That is, you will be returned +bugs that match *all* of the criteria, not bugs that match *any* of +the criteria. + +Each parameter can be either the type it says, or a list of the types +it says. If you pass an array, it means "Give me bugs with *any* of +these values." For example, if you wanted bugs that were in either +the "Foo" or "Bar" products, you'd pass: + +.. code-block:: text + + GET /rest/bug?product=Foo&product=Bar + +Some Bugzillas may treat your arguments case-sensitively, depending +on what database system they are using. Most commonly, though, Bugzilla is +not case-sensitive with the arguments passed (because MySQL is the +most-common database to use with Bugzilla, and MySQL is not case sensitive). + +In addition to the fields listed below, you may also use criteria that +is similar to what is used in the Advanced Search screen of the Bugzilla +UI. This includes fields specified by ``Search by Change History`` and +``Custom Search``. The easiest way to determine what the field names are and what +format Bugzilla expects is to first construct your query using the +Advanced Search UI, execute it and use the query parameters in they URL +as your query for the REST call. + +================ ======== ===================================================== +name type description +================ ======== ===================================================== +alias array The unique aliases of this bug. An empty array will + be returned if this bug has no aliases. +assigned_to string The login name of a user that a bug is assigned to. +component string The name of the Component that the bug is in. Note + that if there are multiple Components with the same + name, and you search for that name, bugs in *all* + those Components will be returned. If you don't want + this, be sure to also specify the ``product`` argument. +creation_time datetime Searches for bugs that were created at this time or + later. May not be an array. +creator string The login name of the user who created the bug. You + can also pass this argument with the name + ``reporter``, for backwards compatibility with + older Bugzillas. +id int The numeric ID of the bug. +last_change_time datetime Searches for bugs that were modified at this time + or later. May not be an array. +limit int Limit the number of results returned. If the limit + is more than zero and higher than the maximum limit + set by the administrator, then the maximum limit will + be used instead. If you set the limit equal to zero, + then all matching results will be returned instead. +offset int Used in conjunction with the ``limit`` argument, + ``offset`` defines the starting position for the + search. For example, given a search that would + return 100 bugs, setting ``limit`` to 10 and + ``offset`` to 10 would return bugs 11 through 20 + from the set of 100. +op_sys string The "Operating System" field of a bug. +platform string The Platform (sometimes called "Hardware") field of + a bug. +priority string The Priority field on a bug. +product string The name of the Product that the bug is in. +resolution string The current resolution--only set if a bug is closed. + You can find open bugs by searching for bugs with an + empty resolution. +severity string The Severity field on a bug. +status string The current status of a bug (not including its + resolution, if it has one, which is a separate field + above). +summary string Searches for substrings in the single-line Summary + field on bugs. If you specify an array, then bugs + whose summaries match *any* of the passed substrings + will be returned. Note that unlike searching in the + Bugzilla UI, substrings are not split on spaces. So + searching for ``foo bar`` will match "This is a foo + bar" but not "This foo is a bar". ``['foo', 'bar']``, + would, however, match the second item. +tags string Searches for a bug with the specified tag. If you + specify an array, then any bugs that match *any* of + the tags will be returned. Note that tags are + personal to the currently logged in user. +target_milestone string The Target Milestone field of a bug. Note that even + if this Bugzilla does not have the Target Milestone + field enabled, you can still search for bugs by + Target Milestone. However, it is likely that in that + case, most bugs will not have a Target Milestone set + (it defaults to "---" when the field isn't enabled). +qa_contact string The login name of the bug's QA Contact. Note that + even if this Bugzilla does not have the QA Contact + field enabled, you can still search for bugs by QA + Contact (though it is likely that no bug will have a + QA Contact set, if the field is disabled). +url string The "URL" field of a bug. +version string The Version field of a bug. +whiteboard string Search the "Status Whiteboard" field on bugs for a + substring. Works the same as the ``summary`` field + described above, but searches the Status Whiteboard + field. +quicksearch string Search for bugs using quicksearch syntax. +================ ======== ===================================================== + +**Response** + +The same as :ref:`rest_single_bug`. + +.. _rest_create_bug: + +Create Bug +---------- + +This allows you to create a new bug in Bugzilla. If you specify any +invalid fields, an error will be thrown stating which field is invalid. +If you specify any fields you are not allowed to set, they will just be +set to their defaults or ignored. + +You cannot currently set all the items here that you can set on enter_bug.cgi. + +The WebService interface may allow you to set things other than those listed +here, but realize that anything undocumented here may likely change in the +future. + +**Request** + +To create a new bug in Bugzilla. + +.. code-block:: text + + POST /rest/bug + +.. code-block:: js + + { + "product" : "TestProduct", + "component" : "TestComponent", + "version" : "unspecified", + "summary" : "'This is a test bug - please disregard", + "alias" : "SomeAlias", + "op_sys" : "All", + "priority" : "P1", + "rep_platform" : "All" + } + +Some params must be set, or an error will be thrown. These params are +marked in **bold**. + +Some parameters can have defaults set in Bugzilla, by the administrator. +If these parameters have defaults set, you can omit them. These parameters +are marked (defaulted). + +Clients that want to be able to interact uniformly with multiple +Bugzillas should always set both the params marked required and those +marked (defaulted), because some Bugzillas may not have defaults set +for (defaulted) parameters, and then this method will throw an error +if you don't specify them. + +================== ======= ==================================================== +name type description +================== ======= ==================================================== +**product** string The name of the product the bug is being filed + against. +**component** string The name of a component in the product above. +**summary** string A brief description of the bug being filed. +**version** string A version of the product above; the version the + bug was found in. +description string (defaulted) The initial description for this bug. + Some Bugzilla installations require this to not be + blank. +op_sys string (defaulted) The operating system the bug was + discovered on. +platform string (defaulted) What type of hardware the bug was + experienced on. +priority string (defaulted) What order the bug will be fixed in by + the developer, compared to the developer's other + bugs. +severity string (defaulted) How severe the bug is. +alias array One or more brief aliases for the bug that can be + used instead of a bug number when accessing this bug. + Must be unique in all of this Bugzilla. +assigned_to string A user to assign this bug to, if you don't want it + to be assigned to the component owner. +cc array An array of usernames to CC on this bug. +comment_is_private boolean If set to true, the description is private, + otherwise it is assumed to be public. +groups array An array of group names to put this bug into. You + can see valid group names on the Permissions tab of + the Preferences screen, or, if you are an + administrator, in the Groups control panel. If you + don't specify this argument, then the bug will be + added into all the groups that are set as being + "Default" for this product. (If you want to avoid + that, you should specify ``groups`` as an empty + array.) +qa_contact string If this installation has QA Contacts enabled, you + can set the QA Contact here if you don't want to + use the component's default QA Contact. +status string The status that this bug should start out as. Note + that only certain statuses can be set on bug + creation. +resolution string If you are filing a closed bug, then you will have + to specify a resolution. You cannot currently + specify a resolution of ``DUPLICATE`` for new + bugs, though. That must be done with + :ref:`rest_update_bug`. +target_milestone string A valid target milestone for this product. +flags array Flags objects to add to the bug. The object format + is described in the Flag object below. +================== ======= ==================================================== + +Flag object: + +To create a flag, at least the ``status`` and the ``type_id`` or ``name`` must +be provided. An optional requestee can be passed if the flag type is requestable +to a specific user. + +========= ====== ============================================================== +name type description +========= ====== ============================================================== +name string The name of the flag type. +type_id int The internal flag type ID. +status string The flags new status (i.e. "?", "+", "-" or "X" to clear flag). +requestee string The login of the requestee if the flag type is requestable + to a specific user. +========= ====== ============================================================== + +In addition to the above parameters, if your installation has any custom +fields, you can set them just by passing in the name of the field and +its value as a string. + +**Response** + +.. code-block:: js + + { + "id" : 12345 + } + +==== ==== ====================================== +name type description +==== ==== ====================================== +id int This is the ID of the newly-filed bug. +==== ==== ====================================== + +.. _rest_update_bug: + +Update Bug +---------- + +Allows you to update the fields of a bug. Automatically sends emails +out about the changes. + +**Request** + +To update the fields of a current bug. + +.. code-block:: text + + PUT /rest/bug/(id_or_alias) + +.. code-block:: js + + { + "ids" : [35], + "status" : "IN_PROGRESS", + "keywords" : { + "add" : ["funny", "stupid"] + } + } + +The params to include in the PUT body as well as the returned data format, +are the same as below. You can specify the ID or alias of the bug to update +either in the URL path and/or in the ``ids`` param. You can use both and they +will be combined so you can edit more than one bug at a time. + +=============== ===== ========================================================= +name type description +=============== ===== ========================================================= +**id_or_alias** mixed An integer bug ID or alias. +**ids** array The IDs or aliases of the bugs that you want to modify. +=============== ===== ========================================================= + +All following fields specify the values you want to set on the bugs you are +updating. + +===================== ======= ================================================= +name type description +===================== ======= ================================================= +alias object These specify the aliases of a bug that can be + used instead of a bug number when acessing this + bug. To set these, you should pass a hash as the + value. The object may contain the following + items: + + * ``add`` (array) Aliases to add to this field. + * ``remove`` (array) Aliases to remove from this + field. If the aliases are not already in the + field, they will be ignored. + * ``set`` (array) An exact set of aliases to set + this field to, overriding the current value. + If you specify ``set``, then ``add`` and + ``remove`` will be ignored. + + You can only set this if you are modifying a + single bug. If there is more than one bug + specified in ``ids``, passing in a value for + ``alias`` will cause an error to be thrown. + + For backwards compatibility, you can also + specify a single string. This will be treated as + if you specified the set key above. +assigned_to string The full login name of the user this bug is + assigned to. +blocks object (Same as ``depends_on`` below) +depends_on object These specify the bugs that this bug blocks or + depends on, respectively. To set these, you + should pass an object as the value. The object + may contain the following items: + + * ``add`` (array) Bug IDs to add to this field. + * ``remove`` (array) Bug IDs to remove from this + field. If the bug IDs are not already in the + field, they will be ignored. + * ``set`` (array of) An exact set of bug IDs to + set this field to, overriding the current + value. If you specify ``set``, then ``add`` + and ``remove`` will be ignored. +cc object The users on the cc list. To modify this field, + pass an object, which may have the following + items: + + * ``add`` (array) User names to add to the CC + list. They must be full user names, and an + error will be thrown if you pass in an invalid + user name. + * ``remove`` (array) User names to remove from + the CC list. They must be full user names, and + an error will be thrown if you pass in an + invalid user name. +is_cc_accessible boolean Whether or not users in the CC list are allowed + to access the bug, even if they aren't in a group + that can normally access the bug. +comment object A comment on the change. The object may contain + the following items: + + * ``body`` (string) The actual text of the + comment. For compatibility with the parameters + to :ref:`rest_add_comment`, you can also call + this field ``comment``, if you want. + * ``is_private`` (boolean) Whether the comment is + private or not. If you try to make a comment + private and you don't have the permission to, + an error will be thrown. +comment_is_private object This is how you update the privacy of comments + that are already on a bug. This is a object, + where the keys are the ``int`` ID of comments + (not their count on a bug, like #1, #2, #3, but + their globally-unique ID, as returned by + :ref:`rest_comments` and the value is a + ``boolean`` which specifies whether that comment + should become private (``true``) or public + (``false``). + + The comment IDs must be valid for the bug being + updated. Thus, it is not practical to use this + while updating multiple bugs at once, as a single + comment ID will never be valid on multiple bugs. +component string The Component the bug is in. +deadline date The Deadline field is a date specifying when the + bug must be completed by, in the format + ``YYYY-MM-DD``. +dupe_of int The bug that this bug is a duplicate of. If you + want to mark a bug as a duplicate, the safest + thing to do is to set this value and *not* set + the ``status`` or ``resolutio`` fields. They will + automatically be set by Bugzilla to the + appropriate values for duplicate bugs. +estimated_time double The total estimate of time required to fix the + bug, in hours. This is the *total* estimate, not + the amount of time remaining to fix it. +flags array An array of Flag change objects. The items needed + are described below. +groups object The groups a bug is in. To modify this field, + pass an object, which may have the following + items: + + * ``add`` (array) The names of groups to add. + Passing in an invalid group name or a group + that you cannot add to this bug will cause an + error to be thrown. + * ``remove`` (array) The names of groups to + remove. Passing in an invalid group name or a + group that you cannot remove from this bug + will cause an error to be thrown. +keywords object Keywords on the bug. To modify this field, pass + an object, which may have the following items: + + * ``add`` (array) The names of keywords to add + to the field on the bug. Passing something that + isn't a valid keyword name will cause an error + to be thrown. + * ``remove`` (array) The names of keywords to + remove from the field on the bug. Passing + something that isn't a valid keyword name will + cause an error to be thrown. + * ``set`` (array) An exact set of keywords to set + the field to, on the bug. Passing something + that isn't a valid keyword name will cause an + error to be thrown. Specifying ``set`` + overrides ``add`` and ``remove``. +op_sys string The Operating System ("OS") field on the bug. +platform string The Platform or "Hardware" field on the bug. +priority string The Priority field on the bug. +product string The name of the product that the bug is in. If + you change this, you will probably also want to + change ``target_milestone``, ``version``, and + ``component``, since those have different legal + values in every product. + + If you cannot change the ``target_milestone`` + field, it will be reset to the default for the + product, when you move a bug to a new product. + + You may also wish to add or remove groups, as + which groups are + valid on a bug depends on the product. Groups + that are not valid in the new product will be + automatically removed, and groups which are + mandatory in the new product will be automaticaly + added, but no other automatic group changes will + be done. + + .. note:: + Users can only move a bug into a product if + they would normally have permission to file + new bugs in that product. +qa_contact string The full login name of the bug's QA Contact. +is_creator_accessible boolean Whether or not the bug's reporter is allowed + to access the bug, even if they aren't in a group + that can normally access the bug. +remaining_time double How much work time is remaining to fix the bug, + in hours. If you set ``work_time`` but don't + explicitly set ``remaining_time``, then the + ``work_time`` will be deducted from the bug's + ``remaining_time``. +reset_assigned_to boolean If true, the ``assigned_to`` field will be + reset to the default for the component that the + bug is in. (If you have set the component at the + same time as using this, then the component used + will be the new component, not the old one.) +reset_qa_contact boolean If true, the ``qa_contact`` field will be reset + to the default for the component that the bug is + in. (If you have set the component at the same + time as using this, then the component used will + be the new component, not the old one.) +resolution string The current resolution. May only be set if you + are closing a bug or if you are modifying an + already-closed bug. Attempting to set the + resolution to *any* value (even an empty or null + string) on an open bug will cause an error to be + thrown. + + .. note:: + If you change the ``status`` field to an open + status, the resolution field will automatically + be cleared, so you don't have to clear it + manually. +see_also object The See Also field on a bug, specifying URLs to + bugs in other bug trackers. To modify this field, + pass an object, which may have the following + items: + + * ``add`` (array) URLs to add to the field. Each + URL must be a valid URL to a bug-tracker, or + an error will be thrown. + * ``remove`` (array) URLs to remove from the + field. Invalid URLs will be ignored. +severity string The Severity field of a bug. +status string The status you want to change the bug to. Note + that if a bug is changing from open to closed, + you should also specify a ``resolution``. +summary string The Summary field of the bug. +target_milestone string The bug's Target Milestone. +url string The "URL" field of a bug. +version string The bug's Version field. +whiteboard string The Status Whiteboard field of a bug. +work_time double The number of hours worked on this bug as part + of this change. + If you set ``work_time`` but don't explicitly + set ``remaining_time``, then the ``work_time`` + will be deducted from the bug's ``remaining_time``. +===================== ======= ================================================= + +You can also set the value of any custom field by passing its name as +a parameter, and the value to set the field to. For multiple-selection +fields, the value should be an array of strings. + +Flag change object: + +The following values can be specified. At least the ``status`` and one of +``type_id``, ``id``, or ``name`` must be specified. If a ``type_id`` or +``name`` matches a single currently set flag, the flag will be updated unless +``new`` is specified. + +========== ======= ============================================================ +name type description +========== ======= ============================================================ +name string The name of the flag that will be created or updated. +type_id int The internal flag type ID that will be created or updated. + You will need to specify the ``type_id`` if more than one + flag type of the same name exists. +**status** string The flags new status (i.e. "?", "+", "-" or "X" to clear a + flag). +requestee string The login of the requestee if the flag type is requestable + to a specific user. +id int Use ID to specify the flag to be updated. You will need to + specify the ``id`` if more than one flag is set of the same + name. +new boolean Set to true if you specifically want a new flag to be + created. +========== ======= ============================================================ + +**Response** + +.. code-block:: js + + { + "bugs" : [ + { + "alias" : [], + "changes" : { + "keywords" : { + "added" : "funny, stupid", + "removed" : "" + }, + "status" : { + "added" : "IN_PROGRESS", + "removed" : "CONFIRMED" + } + }, + "id" : 35, + "last_change_time" : "2014-09-29T14:25:35Z" + } + ] + } + +``bugs`` (array) This points to an array of objects with the following items: + +================ ======== ===================================================== +name type description +================ ======== ===================================================== +id int The ID of the bug that was updated. +alias array The aliases of the bug that was updated, if this bug + has any alias. +last_change_time datetime The exact time that this update was done at, for + this bug. If no update was done (that is, no fields + had their values changed and no comment was added) + then this will instead be the last time the bug was + updated. +changes object The changes that were actually done on this bug. The + keys are the names of the fields that were changed, + and the values are an object with two keys: + + * ``added`` (string) The values that were added to + this field, possibly a comma-and-space-separated + list if multiple values were added. + * ``removed`` (string) The values that were removed + from this field, possibly a + comma-and-space-separated list if multiple values + were removed. +================ ======== ===================================================== + +Currently, some fields are not tracked in changes: ``comment``, +``comment_is_private``, and ``work_time``. This means that they will not +show up in the return value even if they were successfully updated. +This may change in a future version of Bugzilla. diff --git a/docs/en/rst/api/core/v1/bugzilla.rst b/docs/en/rst/api/core/v1/bugzilla.rst new file mode 100644 index 000000000..2dd40e0cb --- /dev/null +++ b/docs/en/rst/api/core/v1/bugzilla.rst @@ -0,0 +1,302 @@ +Bugzilla Information +==================== + +These methods are used to get general configuration information about this +Bugzilla instance. + +Version +------- + +Returns the current version of Bugzilla. Normally in the format of ``X.X`` or +``X.X.X``. For example, ``4.4`` for the initial release of a new branch. Or +``4.4.6`` for a minor release on the same branch. + +**Request** + +.. code-block:: text + + GET /rest/version + +**Response** + +.. code-block:: js + + { + "version": "4.5.5+" + } + +======= ====== ========================================= +name type description +======= ====== ========================================= +version string The current version of this Bugzilla +======= ====== ========================================= + +Extensions +---------- + +Gets information about the extensions that are currently installed and enabled +in this Bugzilla. + +**Request** + +.. code-block:: text + + GET /rest/extensions + +**Response** + +.. code-block:: js + + { + "extensions": { + "Voting": { + "version": "4.5.5+" + }, + "BmpConvert": { + "version": "1.0" + } + } + } + +========== ====== ==================================================== +name type description +========== ====== ==================================================== +extensions object An object containing the extensions enabled as keys. + Each extension object contains the following keys: + + * ``version`` (string) The version of the extension. +========== ====== ==================================================== + +Timezone +-------- + +Returns the timezone in which Bugzilla expects to receive dates and times on the API. +Currently hard-coded to UTC ("+0000"). This is unlikely to change. + +**Request** + +.. code-block:: text + + GET /rest/timezone + +.. code-block:: js + + { + "timezone": "+0000" + } + +**Response** + +======== ====== =============================================================== +name type description +======== ====== =============================================================== +timezone string The timezone offset as a string in (+/-)XXXX (RFC 2822) format. +======== ====== =============================================================== + +Time +---- + +Gets information about what time the Bugzilla server thinks it is, and +what timezone it's running in. + +**Request** + +.. code-block:: text + + GET /rest/time + +**Response** + +.. code-block:: js + + { + "web_time_utc": "2014-09-26T18:01:30Z", + "db_time": "2014-09-26T18:01:30Z", + "web_time": "2014-09-26T18:01:30Z", + "tz_offset": "+0000", + "tz_short_name": "UTC", + "tz_name": "UTC" + } + +============= ====== ========================================================== +name type description +============= ====== ========================================================== +db_time string The current time in UTC, according to the Bugzilla + database server. + + Note that Bugzilla assumes that the database and the + webserver are running in the same time zone. However, + if the web server and the database server aren't + synchronized or some reason, *this* is the time that + you should rely on or doing searches and other input + to the WebService. +web_time string This is the current time in UTC, according to + Bugzilla's web server. + + This might be different by a second from ``db_time`` + since this comes from a different source. If it's any + more different than a second, then there is likely + some problem with this Bugzilla instance. In this + case you should rely on the ``db_time``, not the + ``web_time``. +web_time_utc string Identical to ``web_time``. (Exists only for + backwards-compatibility with versions of Bugzilla + before 3.6.) +tz_name string The literal string ``UTC``. (Exists only for + backwards-compatibility with versions of Bugzilla + before 3.6.) +tz_short_name string The literal string ``UTC``. (Exists only for + backwards-compatibility with versions of Bugzilla + before 3.6.) +tz_offset string The literal string ``+0000``. (Exists only for + backwards-compatibility with versions of Bugzilla + before 3.6.) +============= ====== ========================================================== + +Parameters +---------- + +Returns parameter values currently used in this Bugzilla. + +**Request** + +.. code-block:: text + + GET /rest/parameters + +**Response** + +Example response for anonymous user: + +.. code-block:: js + + { + "parameters" : { + "maintainer" : "admin@example.com", + "requirelogin" : "0" + } + } + +Example response for authenticated user: + +.. code-block:: js + + { + "parameters" : { + "allowemailchange" : "1", + "attachment_base" : "http://bugzilla.example.com/", + "commentonchange_resolution" : "0", + "commentonduplicate" : "0", + "cookiepath" : "/", + "createemailregexp" : ".*", + "defaultopsys" : "", + "defaultplatform" : "", + "defaultpriority" : "--", + "defaultseverity" : "normal", + "duplicate_or_move_bug_status" : "RESOLVED", + "emailregexp" : "^[\\w\\.\\+\\-=']+@[\\w\\.\\-]+\\.[\\w\\-]+$", + "emailsuffix" : "", + "letsubmitterchoosemilestone" : "1", + "letsubmitterchoosepriority" : "1", + "mailfrom" : "bugzilla-daemon@example.com", + "maintainer" : "admin@example.com", + "maxattachmentsize" : "1000", + "maxlocalattachment" : "0", + "musthavemilestoneonaccept" : "0", + "noresolveonopenblockers" : "0", + "password_complexity" : "no_constraints", + "rememberlogin" : "on", + "requirelogin" : "0", + "urlbase" : "http://bugzilla.example.com/", + "use_see_also" : "1", + "useclassification" : "1", + "usemenuforusers" : "0", + "useqacontact" : "1", + "usestatuswhiteboard" : "1", + "usetargetmilestone" : "1", + } + } + +A logged-out user can only access the ``maintainer`` and ``requirelogin`` +parameters. + +A logged-in user can access the following parameters (listed alphabetically): + +* allowemailchange +* attachment_base +* commentonchange_resolution +* commentonduplicate +* cookiepath +* defaultopsys +* defaultplatform +* defaultpriority +* defaultseverity +* duplicate_or_move_bug_status +* emailregexpdesc +* emailsuffix +* letsubmitterchoosemilestone +* letsubmitterchoosepriority +* mailfrom +* maintainer +* maxattachmentsize +* maxlocalattachment +* musthavemilestoneonaccept +* noresolveonopenblockers +* password_complexity +* rememberlogin +* requirelogin +* search_allow_no_criteria +* urlbase +* use_see_also +* useclassification +* usemenuforusers +* useqacontact +* usestatuswhiteboard +* usetargetmilestone + +A user in the tweakparams group can access all existing parameters. +New parameters can appear or obsolete parameters can disappear depending +on the version of Bugzilla and on extensions being installed. +The list of parameters returned by this method is not stable and will +never be stable. + +Last Audit Time +--------------- + +Gets the most recent timestamp among all of the events recorded in the audit_log +table. + +**Request** + +To get most recent audit timestamp for all classes: + +.. code-block:: text + + GET /rest/last_audit_time + +To get the the most recent audit timestamp for the ``Bugzilla::Product`` class: + +.. code-block:: text + + GET /rest/last_audit_time?class=Bugzilla::Product + +===== ===== =================================================================== +name type description +===== ===== =================================================================== +class array The class names are defined as ``Bugzilla::<class_name>"`` such as + Bugzilla:Product`` for products. +===== ===== =================================================================== + +**Response** + +.. code-block:: js + + { + "last_audit_time": "2014-09-23T18:03:38Z" + } + +=============== ====== ==================================================== +name type description +=============== ====== ==================================================== +last_audit_time string The maximum of the at_time from the audit_log. +=============== ====== ==================================================== diff --git a/docs/en/rst/api/core/v1/classification.rst b/docs/en/rst/api/core/v1/classification.rst new file mode 100644 index 000000000..ef5e58d1b --- /dev/null +++ b/docs/en/rst/api/core/v1/classification.rst @@ -0,0 +1,80 @@ +Classifications +=============== + +This part of the Bugzilla API allows you to deal with the available +classifications. You will be able to get information about them as well as +manipulate them. + +.. _rest_get_classification: + +Get Classification +------------------ + +Returns an object containing information about a set of classifications. + +**Request** + +To return information on a single classification using the ID or name: + +.. code-block:: text + + GET /rest/classification/(id_or_name) + +============== ===== ===================================== +name type description +============== ===== ===================================== +**id_or_name** mixed An Integer classification ID or name. +============== ===== ===================================== + +**Response** + +.. code-block:: js + + { + "classifications": [ + { + "sort_key": 0, + "description": "Unassigned to any classifications", + "products": [ + { + "id": 2, + "name": "FoodReplicator", + "description": "Software that controls a piece of hardware that will create any food item through a voice interface." + }, + { + "description": "Silk, etc.", + "name": "Spider Secretions", + "id": 4 + } + ], + "id": 1, + "name": "Unclassified" + } + ] + } + +``classifications`` (array) Each object is a classification that the user is +authorized to see and has the following items: + +=========== ====== ============================================================ +name type description +=========== ====== ============================================================ +id int The ID of the classification. +name string The name of the classification. +description string The description of the classificaion. +sort_key int The value which determines the order the classification is + sorted. +products array Products the user is authorized to + access within the classification. Each hash has the + following keys: +=========== ====== ============================================================ + +Product object: + +=========== ====== ================================ +name type description +=========== ====== ================================ +name string The name of the product. +id int The ID of the product. +description string The description of the product. +=========== ====== ================================ diff --git a/docs/en/rst/api/core/v1/comment.rst b/docs/en/rst/api/core/v1/comment.rst new file mode 100644 index 000000000..60fabb93b --- /dev/null +++ b/docs/en/rst/api/core/v1/comment.rst @@ -0,0 +1,242 @@ +Comments +======== + +.. _rest_comments: + +Get Comments +------------ + +This allows you to get data about comments, given a bug ID or comment ID. + +**Request** + +To get all comments for a particular bug using the bug ID or alias: + +.. code-block:: text + + GET /rest/bug/(id_or_alias)/comment + +To get a specific comment based on the comment ID: + +.. code-block:: text + + GET /rest/bug/comment/(comment_id) + +=============== ======== ====================================================== +name type description +=============== ======== ====================================================== +**id_or_alias** mixed A single integer bug ID or alias. +**comment_id** int A single integer comment ID. +new_since datetime If specified, the method will only return comments + *newer* than this time. This only affects comments + returned from the ``ids`` argument. You will always be + returned all comments you request in the + ``comment_ids`` argument, even if they are older than + this date. +=============== ======== ====================================================== + +**Response** + +.. code-block:: js + + { + "bugs": { + "35": { + "comments": [ + { + "time": "2000-07-25T13:50:04Z", + "text": "test bug to fix problem in removing from cc list.", + "bug_id": 35, + "count": 0, + "attachment_id": null, + "is_private": false, + "tags": [], + "creator": "user@bugzilla.org", + "creation_time": "2000-07-25T13:50:04Z", + "id": 75 + } + ] + } + }, + "comments": {} + } + +Two items are returned: + +``bugs`` This is used for bugs specified in ``ids``. This is an object, +where the keys are the numeric IDs of the bugs, and the value is +a object with a single key, ``comments``, which is an array of comments. +(The format of comments is described below.) + +Any individual bug will only be returned once, so if you specify an ID +multiple times in ``ids``, it will still only be returned once. + +``comments`` Each individual comment requested in ``comment_ids`` is +returned here, in a object where the numeric comment ID is the key, +and the value is the comment. (The format of comments is described below.) + +A "comment" as described above is a object that contains the following items: + +============= ======== ======================================================== +name type description +============= ======== ======================================================== +id int The globally unique ID for the comment. +bug_id int The ID of the bug that this comment is on. +attachment_id int If the comment was made on an attachment, this will be + the ID of that attachment. Otherwise it will be null. +count int The number of the comment local to the bug. The + Description is 0, comments start with 1. +text string The actual text of the comment. +creator string The login name of the comment's author. +time datetime The time (in Bugzilla's timezone) that the comment was + added. +creation_time datetime This is exactly same as the ``time`` key. Use this + field instead of ``time`` for consistency with other + methods including :ref:`rest_single_bug` and + :ref:`rest_attachments`. + + For compatibility, ``time`` is still usable. However, + please note that ``time`` may be deprecated and removed + in a future release. + +is_private boolean ``true`` if this comment is private (only visible to a + certain group called the "insidergroup"), ``false`` + otherwise. +============= ======== ======================================================== + +.. _rest_add_comment: + +Create Comments +--------------- + +This allows you to add a comment to a bug in Bugzilla. + +**Request** + +To create a comment on a current bug. + +.. code-block:: text + + POST /rest/bug/(id)/comment + +.. code-block:: js + + { + "ids" : [123,..], + "comment" : "This is an additional comment", + "is_private" : false + } + +``ids`` is optional in the data example above and can be used to specify adding +a comment to more than one bug at the same time. + +=========== ======= =========================================================== +name type description +=========== ======= =========================================================== +**id** int The ID or alias of the bug to append a comment to. +ids array List of integer bug IDs to add the comment to. +**comment** string The comment to append to the bug. If this is empty + or all whitespace, an error will be thrown saying that you + did not set the ``comment`` parameter. +is_private boolean If set to true, the comment is private, otherwise it is + assumed to be public. +work_time double Adds this many hours to the "Hours Worked" on the bug. + If you are not in the time tracking group, this value will + be ignored. +=========== ======= =========================================================== + +**Response** + +.. code-block:: js + + { + "id" : 789 + } + +==== ==== ================================= +name type description +==== ==== ================================= +id int ID of the newly-created comment. +==== ==== ================================= + +.. _rest_search_comment_tags: + +Search Comment Tags +------------------- + +Searches for tags which contain the provided substring. + +**Request** + +To search for comment tags: + +.. code-block:: text + + GET /rest/bug/comment/tags/(query) + +Example: + +.. code-block:: text + + GET /rest/bug/comment/tags/spa + +========= ====== ==================================================== +name type description +========= ====== ==================================================== +**query** string Only tags containg this substring will be returned. +limit int If provided will return no more than ``limit`` tags. + Defaults to ``10``. +========= ====== ==================================================== + +**Response** + +.. code-block:: js + + [ + "spam" + ] + +An array of matching tags. + +.. _rest_update_comment_tags: + +Update Comment Tags +------------------- + +Adds or removes tags from a comment. + +**Request** + +To update the tags comments attached to a comment: + +.. code-block:: text + + PUT /rest/bug/comment/(comment_id)/tags + +Example: + +.. code-block:: js + + { + "comment_id" : 75, + "add" : ["spam", "bad"] + } + +============== ===== ==================================== +name type description +============== ===== ==================================== +**comment_id** int The ID of the comment to update. +add array The tags to attach to the comment. +remove array The tags to detach from the comment. +============== ===== ==================================== + +**Response** + +.. code-block:: js + + [ + "bad", + "spam" + ] + +An array of strings containing the comment's updated tags. diff --git a/docs/en/rst/api/core/v1/component.rst b/docs/en/rst/api/core/v1/component.rst new file mode 100644 index 000000000..aceada1a7 --- /dev/null +++ b/docs/en/rst/api/core/v1/component.rst @@ -0,0 +1,65 @@ +Components +========== + +This part of the Bugzilla API allows you to deal with the available product +components. You will be able to get information about them as well as manipulate +them. + +Create Component +---------------- + +This allows you to create a new component in Bugzilla. You must be authenticated +and be in the *editcomponents* group to perform this action. + +**Request** + +To create a new component: + +.. code-block:: text + + POST /rest/component + +.. code-block:: js + + { + "product" : "TestProduct", + "name" : "New Component", + "description" : "This is a new component", + "default_assignee" : "dkl@mozilla.com" + } + +Some params must be set, or an error will be thrown. These params are +shown in **bold**. + +==================== ======= ================================================== +name type description +==================== ======= ================================================== +**name** string The name of the new component. +**product** string The name of the product that the component must + be added to. This product must already exist, and + the user have the necessary permissions to edit + components for it. +**description** string The description of the new component. +**default_assignee** string The login name of the default assignee of the + component. +default_cc array Each string representing one login name of the + default CC list. +default_qa_contact string The login name of the default QA contact for the + component. +is_open boolean 1 if you want to enable the component for bug + creations. 0 otherwise. Default is 1. +==================== ======= ================================================== + +**Response** + +.. code-block:: js + + { + "id": 27 + } + +==== ==== ======================================== +name type description +==== ==== ======================================== +id int The ID of the newly-added component. +==== ==== ======================================== diff --git a/docs/en/rst/api/core/v1/field.rst b/docs/en/rst/api/core/v1/field.rst new file mode 100644 index 000000000..d97aa3050 --- /dev/null +++ b/docs/en/rst/api/core/v1/field.rst @@ -0,0 +1,240 @@ +Bug Fields +========== + +The Bugzilla API for getting details about bug fields. + +.. _rest_fields: + +Fields +------ + +Get information about valid bug fields, including the lists of legal values +for each field. + +**Request** + +To get information about all fields: + +.. code-block:: text + + GET /rest/field/bug + +To get information related to a single field: + +.. code-block:: text + + GET /rest/field/bug/(id_or_name) + +========== ===== ========================================================== +name type description +========== ===== ========================================================== +id_or_name mixed An integer field ID or string representing the field name. +========== ===== ========================================================== + +**Response** + +.. code-block:: js + + { + "fields": [ + { + "display_name": "Priority", + "name": "priority", + "type": 2, + "is_mandatory": false, + "value_field": null, + "values": [ + { + "sortkey": 100, + "sort_key": 100, + "visibility_values": [], + "name": "P1" + }, + { + "sort_key": 200, + "name": "P2", + "visibility_values": [], + "sortkey": 200 + }, + { + "sort_key": 300, + "visibility_values": [], + "name": "P3", + "sortkey": 300 + }, + { + "sort_key": 400, + "name": "P4", + "visibility_values": [], + "sortkey": 400 + }, + { + "name": "P5", + "visibility_values": [], + "sort_key": 500, + "sortkey": 500 + } + ], + "visibility_values": [], + "visibility_field": null, + "is_on_bug_entry": false, + "is_custom": false, + "id": 13 + } + ] + } + +``field`` (array) Field objects each containing the following items: + +================= ======= ===================================================== +name type description +================= ======= ===================================================== +id int An integer ID uniquely identifying this field in this + installation only. +type int The number of the fieldtype. The following values are + defined: + + * ``0`` Field type unknown + * ``1`` Single-line string field + * ``2`` Single value field + * ``3`` Multiple value field + * ``4`` Multi-line text value + * ``5`` Date field with time + * ``6`` Bug ID field + * ``7`` See Also field + * ``8`` Keywords field + * ``9`` Date field + * ``10`` Integer field + +is_custom boolean ``true`` when this is a custom field, ``false`` + otherwise. +name string The internal name of this field. This is a unique + identifier for this field. If this is not a custom + field, then this name will be the same across all + Bugzilla installations. +display_name string The name of the field, as it is shown in the user + interface. +is_mandatory boolean ``true`` if the field must have a value when filing + new bugs. Also, mandatory fields cannot have their + value cleared when updating bugs. +is_on_bug_entry boolean For custom fields, this is ``true`` if the field is + shown when you enter a new bug. For standard fields, + this is currently always ``false``, even if the field + shows up when entering a bug. (To know whether or not + a standard field is valid on bug entry, see + :ref:`rest_create_bug`. +visibility_field string The name of a field that controls the visibility of + this field in the user interface. This field only + appears in the user interface when the named field is + equal to one of the values is ``visibility_values``. + Can be null. +visibility_values array This field is only shown when ``visibility_field`` + matches one of these string values. When + ``visibility_field`` is null, then this is an empty + array. +value_field string The name of the field that controls whether or not + particular values of the field are shown in the user + interface. Can be null. +values array Objects representing the legal values for + select-type (drop-down and multiple-selection) + fields. This is also populated for the + ``component``, ``version``, ``target_milestone``, + and ``keywords`` fields, but not for the ``product`` + field (you must use ``get_accessible_products`` for + that). For fields that aren't select-type fields, + this will simply be an empty array. Each object + contains the items described in the Value object + below. +================= ======= ===================================================== + +Value object: + +================= ======= ===================================================== +name type description +================= ======= ===================================================== +name string The actual value--this is what you would specify for + this field in ``create``, etc. +sort_key int Values, when displayed in a list, are sorted first by + this integer and then secondly by their name. +visibility_values array If ``value_field`` is defined for this field, then + this value is only shown if the ``value_field`` is + set to one of the values listed in this array. Note + that for per-product fields, ``value_field`` is set + to ``product`` and ``visibility_values`` will reflect + which product(s) this value appears in. +is_active boolean This value is defined only for certain + product-specific fields such as version, + target_milestone or component. When true, the value + is active; otherwise the value is not active. +description string The description of the value. This item is only + included for the ``keywords`` field. +is_open boolean For ``bug_status`` values, determines whether this + status specifies that the bug is "open" (``true``) + or "closed" (``false``). This item is only included + for the ``bug_status`` field. +can_change_to array For ``bug_status`` values, this is an array of + objects that determine which statuses you can + transition to from this status. (This item is only + included for the ``bug_status`` field.) + + Each object contains the following items: + + * name: (string) The name of the new status + * comment_required: (boolean) ``true`` if a comment + is required when you change a bug into this status + using this transition. +================= ======= ===================================================== + +.. _rest_legal_values: + +Legal Values +------------ + +**DEPRECATED** Use ''Fields'' instead. + +Tells you what values are allowed for a particular field. + +**Request** + +To get information on the values for a field based on field name: + +.. code-block:: text + + GET /rest/field/bug/(field)/values + +To get information based on field name and a specific product: + +.. code-block:: text + + GET /rest/field/bug/(field)/(product_id)/values + +========== ====== ============================================================= +name type description +========== ====== ============================================================= +field string The name of the field you want information about. + This should be the same as the name you would use in + :ref:`rest_create_bug`, below. +product_id int If you're picking a product-specific field, you have to + specify the ID of the product you want the values for. +========== ====== ============================================================= + +**Resppnse** + +.. code-block:: js + + { + "values": [ + "P1", + "P2", + "P3", + "P4", + "P5" + ] + } + +========== ====== ============================================================= +name type description +========== ====== ============================================================= +values array The legal values for this field. The values will be sorted + as they normally would be in Bugzilla. +========== ====== ============================================================= diff --git a/docs/en/rst/api/core/v1/flagtype.rst b/docs/en/rst/api/core/v1/flagtype.rst new file mode 100644 index 000000000..994ac27c8 --- /dev/null +++ b/docs/en/rst/api/core/v1/flagtype.rst @@ -0,0 +1,373 @@ +Flag Types +========== + +This part of the Bugzilla API allows you to get and create bug and attachment +flags. + +.. _rest_flagtype_get: + +Get Flag Type +------------- + +Get information about valid flag types that can be set for bugs and attachments. + +**Request** + +To get information about all flag types for a product: + +.. code-block:: text + + GET /rest/flag_type/(product) + +To get information about flag_types for a product and component: + +.. code-block:: text + + GET /rest/flag_type/(product)/(component) + +.. code-block:: js + + { + "bug": [ + { + "is_multiplicable": false, + "is_requesteeble": false, + "values": [ + "X", + "?", + "+", + "-" + ], + "id": 11, + "type": "bug", + "is_active": true, + "description": "Blocks the next release", + "name": "blocker" + }, + { + "is_requesteeble": false, + "is_multiplicable": false, + "is_active": true, + "description": "Regression found?", + "name": "regression", + "id": 10, + "type": "bug", + "values": [ + "X", + "?", + "+", + "-" + ] + }, + ], + "attachment": [ + { + "is_requesteeble": true, + "is_multiplicable": true, + "name": "review", + "is_active": true, + "description": "Review the patch for correctness and applicability to the problem.", + "type": "attachment", + "id": 1, + "values": [ + "X", + "?", + "+", + "-" + ] + }, + { + "name": "approval", + "description": "Approve the patch for check-in to the tree.", + "is_active": true, + "values": [ + "X", + "?", + "+", + "-" + ], + "type": "attachment", + "id": 3, + "is_multiplicable": false, + "is_requesteeble": false + } + ] + } + +You must pass a product name and an optional component name. If the product or +component names contains a ``/`` character, up will need to url encode it. + +=========== ====== ============================================================ +name type description +=========== ====== ============================================================ +**product** string The name of a valid product. +component string An optional valid component name associated with the + product. +=========== ====== ============================================================ + +**Response** + +An object containing two items, ``bug`` and ``attachment``. Each value is an +array of objects, containing the following items: + +================ ======= ====================================================== +name type description +================ ======= ====================================================== +id int An integer ID uniquely identifying this flag type. +name string The name for the flag type. +type string The target of the flag type which is either ``bug`` + or ``attachment``. +description string The description of the flag type. +values array String values that the user can set on the flag type. +is_requesteeble boolean Users can ask specific other users to set flags of + this type. +is_multiplicable boolean Multiple flags of this type can be set for the same + bug or attachment. +================ ======= ====================================================== + +Create Flag Type +---------------- + +Create a new flag type. You must be authenticated and be in the *editcomponents* +group to perform this action. + +**Request** + +.. code-block:: text + + POST /rest/flag_type + +.. code-block:: js + + { + "name" : "feedback", + "description" : "This attachment needs feedback", + "inclusions" : [ "WorldControl "], + "target_type" : "attachment" + } + +Some params must be set, or an error will be thrown. The required params are +marked in **bold**. + +=========================== ======= =========================================== +name type description +=========================== ======= =========================================== +**name** string The name of the new flag type. +**description** string A description for the flag type. +target_type string The new flag is either for a ``bug`` or an + ``attachment``. +inclusions array An array of strings or an object containing + product names, and optionally component + names. If you provide a string, the flag + type will be shown on all bugs in that + product. If you provide an object, the key + represents the product name, and the value + is the components of the product to be + included. +exclusions array An array of strings or an object containing + product names. This uses the same format as + ``inclusions``. This will exclude the flag + from all products and components specified. +sortkey int A number between 1 and 32767 by which this + type will be sorted when displayed to users + in a list; ignore if you don't care what + order the types appear in or if you want + them to appear in alphabetical order. +is_active boolean Flag of this type appear in the UI and can + be set. Default is ``true``. +is_requestable boolean Users can ask for flags of this type to be + set. Default is ``true``. +cc_list array If the flag type is requestable, who should + receive e-mail notification of requests. + This is an array of e-mail addresses which\ + do not need to be Bugzilla logins. +is_specifically_requestable boolean Users can ask specific other users to + set flags of this type as opposed to just + asking the wind. Default is ``true``. +is_multiplicable boolean Multiple flags of this type can be set on + the same bug. Default is ``true``. +grant_group string The group allowed to grant/deny flags of + this type (to allow all users to grant/deny + these flags, select no group). Default is + no group. +request_group string If flags of this type are requestable, the + group allowed to request them (to allow all + users to request these flags, select no + group). Note that the request group alone + has no effect if the grant group is not + defined! Default is no group. +=========================== ======= =========================================== + +An example for ``inclusions`` and/or ``exclusions``: + +.. code-block:: js + + [ + "FooProduct" + ] + + { + "BarProduct" : [ "C1", "C3" ], + "BazProduct" : [ "C7" ] + } + +This flag will be added to **all** components of ``FooProduct``, components C1 +and C3 of ``BarProduct``, and C7 of ``BazProduct``. + +**Response** + +.. code-block:: js + + { + "id": 13 + } + +======= ==== ============================================== +name type description +======= ==== ============================================== +flag_id int ID of the new FlagType object is returned. +======= ==== ============================================== + +.. _rest_flagtype_update: + +Update Flag Type +---------------- + +This allows you to update a flag type in Bugzilla. You must be authenticated +and be in the *editcomponents* group to perform this action. + +**Request** + +.. code-block:: text + + PUT /rest/flag_type/(id_or_name) + +.. code-block:: js + + { + "ids" : [13], + "name" : "feedback-new", + "is_requestable" : false + } + +You can edit a single flag type by passing the ID or name of the flag type +in the URL. To edit more than one flag type, you can specify addition IDs or +flag type names using the ``ids`` or ``names`` parameters respectively. + +One of the below must be specified. + +============== ===== ========================================================== +name type description +============== ===== ========================================================== +**id_or_name** mixed Integer flag type ID or name. +**ids** array Numeric IDs of the flag types that you wish to update. +**names** array Names of the flag types that you wish to update. If many + flag types have the same name, this will change **all** + of them. +============== ===== ========================================================== + +The following parameters specify the new values you want to set for the flag +types you are updating. + +=========================== ======= =========================================== +name type description +=========================== ======= =========================================== +name string A short name identifying this type. +description string A comprehensive description of this type. +inclusions array An array of strings or an object containing + product names, and optionally component + names. If you provide a string, the flag + type will be shown on all bugs in that + product. If you provide an object, the key + represents the product name, and the value + is the components of the product to be + included. +exclusions array An array of strings or an object containing + product names. This uses the same format as + ``inclusions``. This will exclude the flag + from all products and components specified. +sortkey int A number between 1 and 32767 by which this + type will be sorted when displayed to users + in a list; ignore if you don't care what + order the types appear in or if you want + them to appear in alphabetical order. +is_active boolean Flag of this type appear in the UI and can + be set. +is_requestable boolean Users can ask for flags of this type to be + set. +cc_list array If the flag type is requestable, who should + receive e-mail notification of requests. + This is an array of e-mail addresses + which do not need to be Bugzilla logins. +is_specifically_requestable boolean Users can ask specific other users to set + flags of this type as opposed to just + asking the wind. +is_multiplicable boolean Multiple flags of this type can be set on + the same bug. +grant_group string The group allowed to grant/deny flags of + this type (to allow all users to grant/deny + these flags, select no group). +request_group string If flags of this type are requestable, the + group allowed to request them (to allow all + users to request these flags, select no + group). Note that the request group alone + has no effect if the grant group is not + defined! +=========================== ======= =========================================== + +An example for ``inclusions`` and/or ``exclusions``: + +.. code-block:: js + + [ + "FooProduct", + ] + + { + "BarProduct" : [ "C1", "C3" ], + "BazProduct" : [ "C7" ] + } + +This flag will be added to **all** components of ``FooProduct``, +components C1 and C3 of ``BarProduct``, and C7 of ``BazProduct``. + +**Response** + +.. code-block:: js + + { + "flagtypes": [ + { + "name": "feedback-new", + "changes": { + "is_requestable": { + "added": "0", + "removed": "1" + }, + "name": { + "removed": "feedback", + "added": "feedback-new" + } + }, + "id": 13 + } + ] + } + +``flagtypes`` (array) Flag change objects containing the following items: + +======= ====== ================================================================ +name type description +======= ====== ================================================================ +id int The ID of the flag type that was updated. +name string The name of the flag type that was updated. +changes object The changes that were actually done on this flag type. + The keys are the names of the fields that were changed, and the + values are an object with two items: + + * added: (string) The value that this field was changed to. + * removed: (string) The value that was previously set in this + field. +======= ====== ================================================================ + +Booleans changes will be represented with the strings '1' and '0'. diff --git a/docs/en/rst/api/core/v1/general.rst b/docs/en/rst/api/core/v1/general.rst new file mode 100644 index 000000000..06ef5b2fb --- /dev/null +++ b/docs/en/rst/api/core/v1/general.rst @@ -0,0 +1,255 @@ +General +======= + +This is the standard REST API for external programs that want to interact +with Bugzilla. It provides a REST interface to various Bugzilla functions. + +Basic Information +----------------- + +**Browsing** + +If the ``Accept`` header of a request is set to ``text/html`` (as it is by an +ordinary web browser) then the API will return the JSON data as a HTML +page which the browser can display. In other words, you can play with the +API using just your browser to see results in a human-readable form. +This is a good way to try out the various GET calls, even if you can't use +it for POST or PUT. + +**Data Format** + +The REST API only supports JSON input, and either JSON or JSONP output. +So objects sent and received must be in JSON format. + +On every request, you must set both the ``Accept`` and ``Content-Type`` HTTP +headers to the MIME type of the data format you are using to communicate with +the API. ``Content-Type`` tells the API how to interpret your request, and +``Accept`` tells it how you want your data back. ``Content-Type`` must be +``application/json``. ``Accept`` can be either that, or +``application/javascript`` for JSONP. In the latter`case, add a ``callback`` +parameter to name your callback. + +Parameters may also be passed in as part of the query string for non-GET +requests and will override any matching parameters in the request body. + +Example request which returns the current version of Bugzilla: + +.. code-block:: http + + GET /rest/version HTTP/1.1 + Host: bugzilla.example.com + Accept: application/json + +Example response: + +.. code-block:: http + + HTTP/1.1 200 OK + Vary: Accept + Content-Type: application/json + + { + "version" : "4.2.9+" + } + +**Errors** + +When an error occurs over REST, an object is returned with the key ``error`` +set to ``true``. + +The error contents look similar to: + +.. code-block:: js + + { + "error": true, + "message": "Some message here", + "code": 123 + } + +Common Data Types +----------------- + +The Bugzilla API uses the following various types of parameters: + +======== ====================================================================== + type description +======== ====================================================================== +int Integer. +double A floating-point number. +string A string. +email A string representing an email address. This value, when returned, + may be filtered based on if the user is logged in or not. +date A specific date. Example format: ``YYYY-MM-DD``. +datetime A date/time. Timezone should be in UTC unless otherwise noted. + Example format: ``YYYY-MM-DDTHH24:MI:SSZ``. +boolean ``true`` or ``false``. +base64 A base64-encoded string. This is the only way to transfer + binary data via the API. +array An array. There may be mixed types in an array. ``[`` and ``]`` are + used to represent the beginning and end of arrays. +object A mapping of keys to values. Called a "hash", "dict", or "map" in + some other programming languages. The keys are strings, and the + values can be any type. ``{`` and ``}`` are used to represent the + beginning and end of objects. +======== ====================================================================== + +Parameters that are required will be displayed in **bold** in the parameters +table for each API method. + +Authentication +-------------- + +Some methods do not require you to log in. An example of this is +:ref:`rest_single_bug`. However, authenticating yourself allows you to see +non-public information, for example, a bug that is not publicly visible. + +There are two ways to authenticate yourself: + +**API Keys** + +You can specify ``Bugzilla_api_key`` or simply ``api_key`` as an argument to +any call, and you will be logged in as that user if the key is correct and has +not been revoked. You can set up an API key by using the 'API Key' tab in the +Preferences pages. + +**Login and Password** + +You can specify ``Bugzilla_login`` and ``Bugzilla_password`` or simply +``login`` and ``password`` respectively, as arguments to any call, and you will +be logged in as that user if your credentials are correct. + +====================== ======= ============================================== +name type description +====================== ======= ============================================== +**Bugzilla_login** string A user's login name. +**Bugzilla_password** string That user's password. +Bugzilla_restrictlogin boolean If true, then your login will only be + valid for your IP address. +====================== ======= ============================================== + +The ``Bugzilla_restrictlogin`` option is only used when you have also +specified ``Bugzilla_login`` and ``Bugzilla_password``. + +There is also a deprecated method of authentication described below that will be +removed in the version after Bugzilla 5.0. + +**Bugzilla Tokens** + +You can use :ref:`rest_user_login` to log in as a Bugzilla user. This issues a +token that you must then use in future calls. Just use the value for ``token`` +and pass as either ``Bugzilla_token`` or simply ``token`` as arguments to an +API call. + +================== ====== =================================================== +name type description +================== ====== =================================================== +**Bugzilla_token** string You can specify this as argument to any call, + and you will be logged in as that user if the + token is correct. This is the token returned + when calling :ref:`rest_user_login` mentioned + above. +================== ====== =================================================== + +An error is thrown if you pass an invalid token; you will need to log in again +to get a new token. + +Also starting with Bugzilla 5.0, login cookies are no longer returned by +:ref:`rest_user_login` due to security concerns. + +Useful Parameters +----------------- + +Many calls take common arguments. These are documented below and linked from +the individual calls where these parameters are used. + +**Including Fields** + +Many calls return an array of objects with various fields in the objects. (For +example, :ref:`rest_single_bug` returns a list of ``bugs`` that have fields like +``id``, ``summary``, ``creation_time``, etc.) + +These parameters allow you to limit what fields are present in the objects, to +improve performance or save some bandwidth. + +``include_fields``: The (case-sensitive) names of fields in the response data. +Only the fields specified in the object will be returned, the rest will not be +included. Fields should be comma delimited. + +Invalid field names are ignored. + +Example request to :ref:`rest_user_get`: + +.. code-block:: text + + GET /rest/user/1?include_fields=id,name + +would return something like: + +.. code-block:: js + + { + "users" : [ + { + "id" : 1, + "name" : "user@domain.com" + } + ] + } + +**Excluding Fields** + +``exclude_fields``: The (case-sensitive) names of fields in the return value. The\ +fields specified will not be included in the returned hashes. Fields should +be comma delimited. + +Invalid field names are ignored. + +Specifying fields here overrides ``include_fields``, so if you specify a +field in both, it will be excluded, not included. + +Example request to :ref:`rest_user_get`: + +.. code-block:: js + + GET /rest/user/1?exclude_fields=name + +would return something like: + +.. code-block:: js + + { + "users" : [ + { + "id" : 1, + "real_name" : "John Smith" + } + ] + } + +Some calls support specifying "subfields". If a call states that it supports +"subfield" restrictions, you can restrict what information is returned within +the first field. For example, if you call :ref:`rest_product_get` with an +``include_fields`` of ``components.name``, then only the component name would be +returned (and nothing else). You can include the main field, and exclude a +subfield. + +There are several shortcut identifiers to ask for only certain groups of +fields to be returned or excluded: + +========= ===================================================================== +value description +========= ===================================================================== +_all All possible fields are returned if this is specified in + ``include_fields``. +_default Default fields are returned if ``include_fields`` is empty or + this is specified. This is useful if you want the default + fields in addition to a field that is not normally returned. +_extra Extra fields are not returned by default and need to be manually + specified in ``include_fields`` either by exact field name, or adding + ``_extra``. + _custom Custom fields are normally returned by default unless this is added + to ``exclude_fields``. Also you can use it in ``include_fields`` if + for example you want specific field names plus all custom fields. + Custom fields are normally only relevant to bug objects. +========= ===================================================================== diff --git a/docs/en/rst/api/core/v1/group.rst b/docs/en/rst/api/core/v1/group.rst new file mode 100644 index 000000000..e2c595240 --- /dev/null +++ b/docs/en/rst/api/core/v1/group.rst @@ -0,0 +1,278 @@ +Groups +====== + +The API for creating, changing, and getting information about groups. + +.. _rest_group_create: + +Create Group +------------ + +This allows you to create a new group in Bugzilla. You must be authenticated and +be in the *creategroups* group to perform this action. + +**Request** + +.. code-block:: text + + POST /rest/group + +.. code-block:: js + + { + "name" : "secret-group", + "description" : "Too secret for you!", + "is_active" : true + } + +Some params must be set, or an error will be thrown. The required params are +marked in **bold**. + +=============== ======= ======================================================= +name type description +=============== ======= ======================================================= +**name** string A short name for this group. Must be unique. This + is not usually displayed in the user interface, except + in a few places. +**description** string A human-readable name for this group. Should be + relatively short. This is what will normally appear in + the UI as the name of the group. +user_regexp string A regular expression. Any user whose Bugzilla username + matches this regular expression will automatically be + granted membership in this group. +is_active boolean ``true`` if new group can be used for bugs, ``false`` + if this is a group that will only contain users and no + bugs will be restricted to it. +icon_url string A URL pointing to a small icon used to identify the + group. This icon will show up next to users' names in + various parts of Bugzilla if they are in this group. +=============== ======= ======================================================= + +**Response** + +.. code-block:: js + + { + "id": 22 + } + +==== ==== ============================== +name type description +==== ==== ============================== +id int ID of the newly-created group. +==== ==== ============================== + +.. _rest_group_update: + +Update Group +------------ + +This allows you to update a group in Bugzilla. You must be authenticated and be +in the *creategroups* group to perform this action. + +**Request** + +To update a group using the group ID or name: + +.. code-block:: text + + PUT /rest/group/(id_or_name) + +.. code-block:: js + + { + "name" : "secret-group", + "description" : "Too secret for you! (updated description)", + "is_active" : false + } + +You can edit a single group by passing the ID or name of the group +in the URL. To edit more than one group, you can specify addition IDs or +group names using the ``ids`` or ``names`` parameters respectively. + +One of the below must be specified. + +============== ===== ========================================================== +name type description +============== ===== ========================================================== +**id_or_name** mixed Integer group or name. +**ids** array IDs of groups to update. +**names** array Names of groups to update. +============== ===== ========================================================== + +The following parameters specify the new values you want to set for the group(s) +you are updating. + +=========== ======= =========================================================== +name type description +=========== ======= =========================================================== +name string A new name for the groups. If you try to set this while + updating more than one group, an error will occur, as + group names must be unique. +description string A new description for the groups. This is what will appear + in the UI as the name of the groups. +user_regexp string A new regular expression for email. Will automatically + grant membership to these groups to anyone with an email + address that matches this perl regular expression. +is_active boolean Set if groups are active and eligible to be used for bugs. + ``true`` if bugs can be restricted to this group, ``false`` + otherwise. +icon_url string A URL pointing to an icon that will appear next to the name + of users who are in this group. +=========== ======= =========================================================== + +**Response** + +.. code-block:: js + + { + "groups": [ + { + "changes": { + "description": { + "added": "Too secret for you! (updated description)", + "removed": "Too secret for you!" + }, + "is_active": { + "removed": "1", + "added": "0" + } + }, + "id": "22" + } + ] + } + +``groups`` (array) Group change objects, each containing the following items: + +======= ====== ================================================================ +name type description +======= ====== ================================================================ +id int The ID of the group that was updated. +changes object The changes that were actually done on this group. The + keys are the names of the fields that were changed, and the + values are an object with two items: + + * added: (string) The values that were added to this field, + possibly a comma-and-space-separated list if multiple values + were added. + * removed: (string) The values that were removed from this + field, possibly a comma-and-space-separated list if multiple + values were removed. +======= ====== ================================================================ + +.. _rest_group_get: + +Get Group +--------- + +Returns information about Bugzilla groups. + +**Request** + +To return information about a specific group ID or name: + +.. code-block:: text + + GET /rest/group/(id_or_name) + +You can also return information about more than one specific group by using the +following in your query string: + +.. code-block:: text + + GET /rest/group?ids=1&ids=2&ids=3 + GET /group?names=ProductOne&names=Product2 + +If neither IDs nor names are passed, and you are in the creategroups or +editusers group, then all groups will be retrieved. Otherwise, only groups +that you have bless privileges for will be returned. + +========== ======= ============================================================ +name type description +========== ======= ============================================================ +id_or_name mixed Integer group ID or name. +ids array Integer IDs of groups. +names array Names of groups. +membership boolean Set to 1 then a list of members of the passed groups names + and IDs will be returned. +========== ======= ============================================================ + +**Response** + +.. code-block:: js + + { + "groups": [ + { + "membership": [ + { + "real_name": "Bugzilla User", + "can_login": true, + "name": "user@bugzilla.org", + "login_denied_text": "", + "id": 85, + "email_enabled": false, + "email": "user@bugzilla.org" + }, + ], + "is_active": true, + "description": "Test Group", + "user_regexp": "", + "is_bug_group": true, + "name": "TestGroup", + "id": 9 + } + ] + } + +If the user is a member of the *creategroups* group they will receive +information about all groups or groups matching the criteria that they passed. +You have to be in the creategroups group unless you're requesting membership +information. + +If the user is not a member of the *creategroups* group, but they are in the +"editusers" group or have bless privileges to the groups they require +membership information for, the is_active, is_bug_group and user_regexp values +are not supplied. + +The return value will be an object containing group names as the keys; each +value will be an object that describes the group and has the following items: + +============ ====== =========================================================== +name type description +============ ====== =========================================================== +id int The unique integer ID that Bugzilla uses to identify this + group. Even if the name of the group changes, this ID will + stay the same. +name string The name of the group. +description string The description of the group. +is_bug_group int Whether this group is to be used for bug reports or is + only administrative specific. +user_regexp string A regular expression that allows users to be added to + this group if their login matches. +is_active int Whether this group is currently active or not. +users array User objects that are members of this group; only + returned if the user sets the ``membership`` parameter to + 1. Each user object has the items describe in the User + object below. +============ ====== =========================================================== + +User object: + +============= ======= ========================================================= +name type description +============= ======= ========================================================= +id int The ID of the user. +real_name string The actual name of the user. +email string The email address of the user. +name string The login name of the user. Note that in some situations + this is different than their email. +can_login boolean A boolean value to indicate if the user can login into + bugzilla. +email_enabled boolean A boolean value to indicate if bug-related mail will + be sent to the user or not. +disabled_text string A text field that holds the reason for disabling a user + from logging into Bugzilla. If empty, then the user + account is enabled; otherwise it is disabled/closed. +============= ======= ========================================================= diff --git a/docs/en/rst/api/core/v1/index.rst b/docs/en/rst/api/core/v1/index.rst new file mode 100644 index 000000000..933aeed96 --- /dev/null +++ b/docs/en/rst/api/core/v1/index.rst @@ -0,0 +1,18 @@ +Core API v1 +=========== + +.. toctree:: + + general + attachment + bug + bug-user-last-visit + bugzilla + classification + comment + component + field + flagtype + group + product + user diff --git a/docs/en/rst/api/core/v1/product.rst b/docs/en/rst/api/core/v1/product.rst new file mode 100644 index 000000000..95726a3a8 --- /dev/null +++ b/docs/en/rst/api/core/v1/product.rst @@ -0,0 +1,416 @@ +Products +======== + +This part of the Bugzilla API allows you to list the available products and +get information about them. + +.. _rest_product_list: + +List Products +------------- + +Returns a list of the IDs of the products the user can search on. + +**Request** + +To get a list of product IDs a user can select such as for querying bugs: + +.. code-block:: text + + GET /rest/product_selectable + +To get a list of product IDs a user can enter a bug against: + +.. code-block:: text + + GET /rest/product_enterable + +To get a list of product IDs a user can search or enter bugs against. + +.. code-block:: text + + GET /rest/product_accessible + +**Response** + +.. code-block:: js + + { + "ids": [ + "2", + "3", + "19", + "1", + "4" + ] + } + +==== ===== ====================================== +name type description +==== ===== ====================================== +ids array List of integer product IDs. +==== ===== ====================================== + +.. _rest_product_get: + +Get Product +----------- + +Returns a list of information about the products passed to it. + +**Request** + +To return information about a specific type of products such as +``accessible``, ``selectable``, or ``enterable``: + +.. code-block:: text + + GET /rest/product?type=accessible + +To return information about a specific product by ``id`` or ``name``: + +.. code-block:: text + + GET /rest/product/(id_or_name) + +You can also return information about more than one product by using the +following parameters in your query string: + +.. code-block:: text + + GET /rest/product?ids=1&ids=2&ids=3 + GET /rest/product?names=ProductOne&names=Product2 + +========== ====== ============================================================= +name type description +========== ====== ============================================================= +id_or_name mixed Integer product ID or product name. +ids array Product IDs +names array Product names +type string The group of products to return. Valid values are + ``accessible`` (default), ``selectable``, and ``enterable``. + ``type`` can be a single value or an array of values if more + than one group is needed with duplicates removed. +========== ====== ============================================================= + +**Response** + +.. code-block:: js + + { + "products": [ + { + "id": 1, + "default_milestone": "---", + "components": [ + { + "is_active": true, + "default_assigned_to": "admin@bugzilla.org", + "id": 1, + "sort_key": 0, + "name": "TestComponent", + "flag_types": { + "bug": [ + { + "is_active": true, + "grant_group": null, + "cc_list": "", + "is_requestable": true, + "id": 3, + "is_multiplicable": true, + "name": "needinfo", + "request_group": null, + "is_requesteeble": true, + "sort_key": 0, + "description": "needinfo" + } + ], + "attachment": [ + { + "description": "Review", + "is_multiplicable": true, + "name": "review", + "is_requesteeble": true, + "request_group": null, + "sort_key": 0, + "cc_list": "", + "grant_group": null, + "is_requestable": true, + "id": 2, + "is_active": true + } + ] + }, + "default_qa_contact": "", + "description": "This is a test component." + } + ], + "is_active": true, + "classification": "Unclassified", + "versions": [ + { + "id": 1, + "name": "unspecified", + "is_active": true, + "sort_key": 0 + } + ], + "description": "This is a test product.", + "has_unconfirmed": true, + "milestones": [ + { + "name": "---", + "is_active": true, + "sort_key": 0, + "id": 1 + } + ], + "name": "TestProduct" + } + ] + } + +``products`` (array) Each product object has the following items: + +================= ======= ===================================================== +name type description +================= ======= ===================================================== +id int An integer ID uniquely identifying the product in + this installation only. +name string The name of the product. This is a unique identifier + for the product. +description string A description of the product, which may contain HTML. +is_active boolean A boolean indicating if the product is active. +default_milestone string The name of the default milestone for the product. +has_unconfirmed boolean Indicates whether the UNCONFIRMED bug status is + available for this product. +classification string The classification name for the product. +components array Each component object has the items described in the + Component object below. +versions array Each object describes a version, and has the + following items: ``name``, ``sort_key`` and + ``is_active``. +milestones array Each object describes a milestone, and has the + following items: ``name``, ``sort_key`` and + ``is_active``. +================= ======= ===================================================== + +If the user tries to access a product that is not in the list of accessible +products for the user, or a product that does not exist, that is silently +ignored, and no information about that product is returned. + +Component object: + +=================== ======= =================================================== +name type description +=================== ======= =================================================== +id int An integer ID uniquely identifying the component in + this installation only. +name string The name of the component. This is a unique + identifier for this component. +description string A description of the component, which may contain + HTML. +default_assigned_to string The login name of the user to whom new bugs + will be assigned by default. +default_qa_contact string The login name of the user who will be set as + the QA Contact for new bugs by default. Empty + string if the QA contact is not defined. +sort_key int Components, when displayed in a list, are sorted + first by this integer and then secondly by their + name. +is_active boolean A boolean indicating if the component is active. + Inactive components are not enabled for new bugs. +flag_types object An object containing two items ``bug`` and + ``attachment`` that each contains an array of + objects, where each describes a flagtype. The + flagtype items are described in the Flagtype + object below. +=================== ======= =================================================== + +Flagtype object: + +================ ======= ====================================================== +name type description +================ ======= ====================================================== +id int Returns the ID of the flagtype. +name string Returns the name of the flagtype. +description string Returns the description of the flagtype. +cc_list string Returns the concatenated CC list for the flagtype, as + a single string. +sort_key int Returns the sortkey of the flagtype. +is_active boolean Returns whether the flagtype is active or disabled. + Flags being in a disabled flagtype are not deleted. + It only prevents you from adding new flags to it. +is_requestable boolean Returns whether you can request for the given + flagtype (i.e. whether the '?' flag is available or + not). +is_requesteeble boolean Returns whether you can ask someone specifically + or not. +is_multiplicable boolean Returns whether you can have more than one + flag for the given flagtype in a given bug/attachment. +grant_group int the group ID that is allowed to grant/deny flags of + this type. If the item is not included all users are + allowed to grant/deny this flagtype. +request_group int The group ID that is allowed to request the flag if + the flag is of the type requestable. If the item is + not included all users are allowed request this + flagtype. +================ ======= ====================================================== + +.. _rest_product_create: + +Create Product +-------------- + +This allows you to create a new product in Bugzilla. + +**Request** + +.. code-block:: text + + POST /rest/product + +.. code-block:: js + + { + "name" : "AnotherProduct", + "description" : "Another Product", + "classification" : "Unclassified", + "is_open" : false, + "has_unconfirmed" : false, + "version" : "unspecified" + } + +Some params must be set, or an error will be thrown. The required params are +marked in bold. + +================= ======= ===================================================== +name type description +================= ======= ===================================================== +**name** string The name of this product. Must be globally unique + within Bugzilla. +**description** string A description for this product. Allows some simple + HTML. +**version** string The default version for this product. +has_unconfirmed boolean Allow the UNCONFIRMED status to be set on bugs in + this product. Default: true. +classification string The name of the Classification which contains this + product. +default_milestone string The default milestone for this product. Default + '---'. +is_open boolean ``true`` if the product is currently allowing bugs + to be entered into it. Default: ``true``. +create_series boolean ``true`` if you want series for New Charts to be + created for this new product. Default: ``true``. +================= ======= ===================================================== + +**Response** + +.. code-block:: js + + { + "id": 20 + } + +Returns an object with the following items: + +==== ==== ===================================== +name type description +==== ==== ===================================== +id int ID of the newly-filed product. +==== ==== ===================================== + +.. _rest_product_update: + +Update Product +-------------- + +This allows you to update a product in Bugzilla. + +**Request** + +.. code-block:: text + + PUT /rest/product/(id_or_name) + +You can edit a single product by passing the ID or name of the product +in the URL. To edit more than one product, you can specify addition IDs or +product names using the ``ids`` or ``names`` parameters respectively. + +.. code-block:: js + + { + "ids" : [123], + "name" : "BarName", + "has_unconfirmed" : false + } + +One of the below must be specified. + +============== ===== ========================================================== +name type description +============== ===== ========================================================== +**id_or_name** mixed Integer product ID or name. +**ids** array Numeric IDs of the products that you wish to update. +**names** array Names of the products that you wish to update. +============== ===== ========================================================== + +The following parameters specify the new values you want to set for the product(s) +you are updating. + +================= ======= ===================================================== +name type description +================= ======= ===================================================== +name string A new name for this product. If you try to set this + while updating more than one product, an error will + occur, as product names must be unique. +default_milestone string When a new bug is filed, what milestone does it + get by default if the user does not choose one? Must + represent a milestone that is valid for this product. +description string Update the long description for these products to + this value. +has_unconfirmed boolean Allow the UNCONFIRMED status to be set on bugs in + products. +is_open boolean ``true`` if the product is currently allowing bugs + to be entered into it, ``false`` otherwise. +================= ======= ===================================================== + +**Response** + +.. code-block:: js + + { + "products" : [ + { + "id" : 123, + "changes" : { + "name" : { + "removed" : "FooName", + "added" : "BarName" + }, + "has_unconfirmed" : { + "removed" : "1", + "added" : "0" + } + } + } + ] + } + +``products`` (array) Product change objects containing the following items: + +======= ====== ================================================================ +name type description +======= ====== ================================================================ +id int The ID of the product that was updated. +changes object The changes that were actually done on this product. The + keys are the names of the fields that were changed, and the + values are an object with two items: + + * added: (string) The value that this field was changed to. + * removed: (string) The value that was previously set in this + field. +======= ====== ================================================================ + +Booleans will be represented with the strings '1' and '0' for changed values +as they are stored as strings in the database currently. diff --git a/docs/en/rst/api/core/v1/user.rst b/docs/en/rst/api/core/v1/user.rst new file mode 100644 index 000000000..e27211a7f --- /dev/null +++ b/docs/en/rst/api/core/v1/user.rst @@ -0,0 +1,380 @@ +Users +===== + +This part of the Bugzilla API allows you to create user accounts, get information +about user accounts and to log in or out using an existing account. + +.. _rest_user_login: + +Login +----- + +Logging in with a username and password is required for many Bugzilla +installations, in order to search for private bugs, post new bugs, etc. This +method allows you to retrieve a token that can be used as authentication for +subsequent API calls. Otherwise yuou will need to pass your ``login`` and +``password`` with each call. + +This method will be going away in the future in favor of using *API keys*. + +**Request** + +.. code-block:: text + + GET /rest/login?login=foo@example.com&password=toosecrettoshow + +============== ======= ======================================================== +name type description +============== ======= ======================================================== +**login** string The user's login name. +**password** string The user's password. +restrict_login boolean If set to a true value, the token returned by this + method will only be valid from the IP address which + called this method. +============== ======= ======================================================== + +**Response** + +.. code-block:: js + + { + "token": "786-OLaWfBisMY", + "id": 786 + } + +======== ====== =============================================================== +name type description +======== ====== =============================================================== +id int Numeric ID of the user that was logged in. +token string Token which can be passed in the parameters as + authentication in other calls. The token can be sent along + with any future requests to the webservice, for the duration + of the session, i.e. til :ref:`rest_user_logout` is called. +======== ====== =============================================================== + +.. _rest_user_logout: + +Logout +------ + +Log out the user. Basically it invalidates the token provided so it cannot be +re-used. Does nothing if the token is not in use. Will also clear any existing +authentication cookies the client may still have stored. + +**Request** + +.. code-block:: text + + GET /rest/logout?token=1234-VWvO51X69r + +===== ====== =================================================== +name type description +===== ====== =================================================== +token string The user's token used for authentication. +===== ====== =================================================== + +.. _rest_user_valid_login: + +Valid Login +----------- + +This method will verify whether a client's cookies or current login token is +still valid or have expired. A valid username that matches must be provided as +well. + +**Request** + +.. code-block:: text + + GET /rest/valid_login?login=foo@example.com&token=1234-VWvO51X69r + +========= ======= ============================================================= +name type description +========= ======= ============================================================= +**login** string The login name that matches the provided cookies or token. +token string Persistent login token currently being used for + authentication. +========= ======= ============================================================= + +**Response** + +Returns true/false depending on if the current token is valid for the provided +username. + +.. _rest_user_create: + +Create User +----------- + +Creates a user account directly in Bugzilla, password and all. Instead of this, +you should use **Offer Account by Email** when possible because that makes sure +that the email address specified can actually receive an email. This function +does not check that. You must be authenticated and be in the *editusers* group +to perform this action. + +**Request** + +.. code-block:: text + + POST /rest/user + +.. code-block:: js + + { + "email" : "user@bugzilla.org", + "full_name" : "Test User", + "password" : "K16ldRr922I1" + } + +========== ====== ============================================================= +name type description +========== ====== ============================================================= +**email** string The email address for the new user. +full_name string The user's full name. Will be set to empty if not specified. +password string The password for the new user account, in plain text. It + will be stripped of leading and trailing whitespace. If + blank or not specified, the new created account will + exist in Bugzilla but will not be allowed to log in + using DB authentication until a password is set either + by the user (through resetting their password) or by the + administrator. +========== ====== ============================================================= + +**Response** + +.. code-block:: js + + { + "id": 58707 + } + +==== ==== ============================================ +name type desciption +==== ==== ============================================ +id int The numeric ID of the user that was created. +==== ==== ============================================ + +.. _rest_user_update: + +Update User +----------- + +Updates an existing user account in Bugzilla. You must be authenticated and be +in the *editusers* group to perform this action. + +**Request** + +.. code-block:: text + + PUT /rest/user/(id_or_name) + +You can edit a single user by passing the ID or login name of the user +in the URL. To edit more than one user, you can specify addition IDs or +login names using the ``ids`` or ``names`` parameters respectively. + +================= ======= ===================================================== + name type description +================= ======= ===================================================== +**id_or_name** mixed Either the ID or the login name of the user to + update. +**ids** array Additional IDs of users to update. +**names** array Additional login names of users to update. +full_name string The new name of the user. +email string The email of the user. Note that email used to + login to bugzilla. Also note that you can only + update one user at a time when changing the login + name / email. (An error will be thrown if you try to + update this field for multiple users at once.) +password string The password of the user. +email_enabled boolean A boolean value to enable/disable sending + bug-related mail to the user. +login_denied_text string A text field that holds the reason for disabling a + user from logging into Bugzilla. If empty, then the + user account is enabled; otherwise it is + disabled/closed. +groups object These specify the groups that this user is directly + a member of. To set these, you should pass an object + as the value. The object's items are described in + the Groups update objects below. +bless_groups object This is the same as groups but affects what groups + a user has direct membership to bless that group. + It takes the same inputs as groups. +================= ======= ===================================================== + +Groups and bless groups update object: + +====== ===== ================================================================== +name type description +====== ===== ================================================================== +add array The group IDs or group names that the user should be added to. +remove array The group IDs or group names that the user should be removed from. +set array Integers or strings which are an exact set of group IDs and group + names that the user should be a member of. This does not remove + groups from the user when the person making the change does not + have the bless privilege for the group. +====== ===== ================================================================== + +If you specify ``set``, then ``add`` and ``remove`` will be ignored. A group in +both the ``add`` and ``remove`` list will be added. Specifying a group that the +user making the change does not have bless rights will generate an error. + +**Response** + +* users: (array) List of user change objects with the following items: + +======= ====== ================================================================ +name type description +======= ====== ================================================================ +id int The ID of the user that was updated. +changes object The changes that were actually done on this user. The keys + are the names of the fields that were changed, and the values + are an object with two items: + + * added: (string) The values that were added to this field, + possibly a comma-and-space-separated list if multiple values + were added. + * removed: (string) The values that were removed from this + field, possibly a comma-and-space-separated list if multiple + values were removed. +======= ====== ================================================================ + +.. _rest_user_get: + +Get User +-------- + +Gets information about user accounts in Bugzilla. + +**Request** + +To get information about a single user in Bugzilla: + +.. code-block:: text + + GET /rest/user/(id_or_name) + +To get multiple users by name or ID: + +.. code-block:: text + + GET /rest/user?names=foo@bar.com&name=test@bugzilla.org + GET /rest/user?ids=123&ids=321 + +To get user matching a search string: + +.. code-block:: text + + GET /rest/user?match=foo + +To get user by using an integer ID value or by using ``match``, you must be +authenticated. + +================ ======= ====================================================== +name type description +================ ======= ====================================================== +id_or_name mixed An integer user ID or login name of the user. +ids array Integer user IDs. Logged=out users cannot pass + this parameter to this function. If they try, + they will get an error. Logged=in users will get + an error if they specify the ID of a user they + cannot see. +names array Login names. +match array This works just like "user matching" in Bugzilla + itself. Users will be returned whose real name + or login name contains any one of the specified + strings. Users that you cannot see will not be + included in the returned list. + + Most installations have a limit on how many + matches are returned for each string; the default + is 1000 but can be changed by the Bugzilla + administrator. + + Logged-out users cannot use this argument, and + an error will be thrown if they try. (This is to + make it harder for spammers to harvest email + addresses from Bugzilla, and also to enforce the + user visibility restrictions that are + implemented on some Bugzillas.) +limit int Limit the number of users matched by the + ``match`` parameter. If the value is greater than the + system limit, the system limit will be used. + This parameter is only valid when using the ``match`` + parameter. +group_ids array Numeric IDs for groups that a user can be in. +groups array Names of groups that a user can be in. If + ``group_ids`` or ``groups`` are specified, they + limit the return value to users who are in *any* + of the groups specified. +include_disabled boolean By default, when using the ``match`` parameter, + disabled users are excluded from the returned + results unless their full username is identical + to the match string. Setting ``include_disabled`` to + ``true`` will include disabled users in the returned + results even if their username doesn't fully match + the input string. +================ ======= ====================================================== + +**Response** + +* users: (array) Each object describes a user and has the following items: + +================= ======= ===================================================== +name type description +================= ======= ===================================================== +id int The unique integer ID that Bugzilla uses to represent + this user. Even if the user's login name changes, + this will not change. +real_name string The actual name of the user. May be blank. +email string The email address of the user. +name string The login name of the user. Note that in some + situations this is different than their email. +can_login boolean A boolean value to indicate if the user can login + into bugzilla. +email_enabled boolean A boolean value to indicate if bug-related mail will + be sent to the user or not. +login_denied_text string A text field that holds the reason for disabling a + user from logging into Bugzilla. If empty then the + user account is enabled; otherwise it is + disabled/closed. +groups array Groups the user is a member of. If the currently + logged in user is querying their own account or is a + member of the 'editusers' group, the array will + contain all the groups that the user is a member of. + Otherwise, the array will only contain groups that + the logged in user can bless. Each object describes + the group and contains the items described in the + Group object below. +saved_searches array User's saved searches, each having the following + Search object items described below. +saved_reports array User's saved reports, each having the following + Search object items described below. +================= ======= ===================================================== + +Group object: + +=========== ====== ============================================================ +name type description +=========== ====== ============================================================ +id int The group ID +name string The name of the group +description string The description for the group +=========== ====== ============================================================ + +Search object: + +===== ====== ================================================================== +name type description +===== ====== ================================================================== +id int An integer ID uniquely identifying the saved report. +name string The name of the saved report. +query string The CGI parameters for the saved report. +===== ====== ================================================================== + +If you are not authenticated when you call this function, you will only be +returned the ``id``, ``name``, and ``real_name`` items. If you are authenticated +and not in 'editusers' group, you will only be returned the ``id``, ``name``, +``real_name``, ``email``, ``can_login``, and ``groups`` items. The groups +returned are filtered based on your permission to bless each group. The +``saved_searches`` and ``saved_reports`` items are only returned if you are +querying your own account, even if you are in the editusers group. diff --git a/docs/en/rst/api/index.rst b/docs/en/rst/api/index.rst new file mode 100644 index 000000000..45055eba1 --- /dev/null +++ b/docs/en/rst/api/index.rst @@ -0,0 +1,13 @@ +.. _apis: + +WebService API Reference +======================== + +This Bugzilla installation has the following WebService APIs available +(as of the last time you compiled the documentation): + +.. toctree:: + :glob: + + core/v*/index + ../extensions/*/api/v*/index diff --git a/docs/en/rst/conf.py b/docs/en/rst/conf.py new file mode 100644 index 000000000..3330ca76d --- /dev/null +++ b/docs/en/rst/conf.py @@ -0,0 +1,386 @@ +# -*- coding: utf-8 -*- +# +# Bugzilla documentation build configuration file, created by +# sphinx-quickstart on Tue Sep 3 16:11:00 2013. +# +# This file is execfile()d with the current directory set to its containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys, os, re + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +#sys.path.insert(0, os.path.abspath('.')) + +# -- General configuration ----------------------------------------------------- + +# If your documentation needs a minimal Sphinx version, state it here. +needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be extensions +# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +extensions = ['sphinx.ext.todo', 'sphinx.ext.extlinks'] + +if tags.has('enable_rst2pdf'): + extensions.append('rst2pdf.pdfbuilder') + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The encoding of source files. +#source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'Bugzilla' +copyright = u'2014, The Bugzilla Team' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = 'Unknown' +# The full version, including alpha/beta/rc tags. +release = 'Unknown' + +for line in open("../../../Bugzilla/Constants.pm"): + match = re.search(r'BUGZILLA_VERSION\s+=>\s+"([^"]+)"', line) + if (match): + release = match.group(1) + match = re.search(r'^\d+\.\d+', release) + if (match): + version = match.group(0) + else: + version = release + break + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +#language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ['**.inc.rst'] + +# The reST default role (used for this markup: `text`) to use for all documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +#modindex_common_prefix = [] + +rst_prolog = """ +.. role:: param + :class: param + +.. role:: paramval + :class: paramval + +.. role:: group + :class: group + +.. role:: field + :class: field + +.. |min-perl-ver| replace:: 5.10.1 +""" + +rst_epilog = """ + +---------- + +This documentation undoubtedly has bugs; if you find some, please file +them `here <https://bugzilla.mozilla.org/enter_bug.cgi?product=Bugzilla&component=Documentation>`_. +""" + +# -- Options for HTML output --------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = 'default' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +#html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +#html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# "<project> v<release> documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +html_style = "bugzilla.css" + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +html_logo = "../images/bugzilla.png" + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +html_favicon = '../../../images/favicon.ico' + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +# Switched off because it converted --long-option to –long-option +html_use_smartypants = False + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_domain_indices = True + +# If false, no index is generated. +html_use_index = False + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, links to the reST sources are added to the pages. +html_show_sourcelink = False + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +#html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +html_show_copyright = False + +# If true, an OpenSearch description file will be output, and all pages will +# contain a <link> tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = None + +# Output file base name for HTML help builder. +htmlhelp_basename = 'Bugzilladoc' + +# -- Options for LaTeX output -------------------------------------------------- + +latex_elements = { +# The paper size ('letterpaper' or 'a4paper'). +#'papersize': 'letterpaper', + +# The font size ('10pt', '11pt' or '12pt'). +#'pointsize': '10pt', + +# Additional stuff for the LaTeX preamble. +#'preamble': '', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, author, documentclass [howto/manual]). +latex_documents = [ + ('index', 'Bugzilla.tex', u'Bugzilla Documentation', + u'The Bugzilla Team', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# If true, show page references after internal links. +#latex_show_pagerefs = False + +# If true, show URL addresses after external links. +#latex_show_urls = False + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_domain_indices = True + + +# -- Options for manual page output -------------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ('index', 'bugzilla', u'Bugzilla Documentation', + [u'The Bugzilla Team'], 1) +] + +# If true, show URL addresses after external links. +#man_show_urls = False + + +# -- Options for Texinfo output ------------------------------------------------ + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + ('index', 'Bugzilla', u'Bugzilla Documentation', + u'The Bugzilla Team', 'Bugzilla', 'One line description of project.', + 'Miscellaneous'), +] + +# Documents to append as an appendix to all manuals. +#texinfo_appendices = [] + +# If false, no module index is generated. +#texinfo_domain_indices = True + +# How to display URL addresses: 'footnote', 'no', or 'inline'. +#texinfo_show_urls = 'footnote' + +# -- Options for PDF output -------------------------------------------------- + +# Grouping the document tree into PDF files. List of tuples +# (source start file, target name, title, author, options). +# +# If there is more than one author, separate them with \\. +# For example: r'Guido van Rossum\\Fred L. Drake, Jr., editor' +# +# The options element is a dictionary that lets you override +# this config per-document. +# For example, +# ('index', u'MyProject', u'My Project', u'Author Name', +# dict(pdf_compressed = True)) +# would mean that specific document would be compressed +# regardless of the global pdf_compressed setting. + +pdf_documents = [ +('index', u'Bugzilla', u'Bugzilla Documentation', u'The Bugzilla Team'), +] + +# A comma-separated list of custom stylesheets. Example: +pdf_stylesheets = ['sphinx','kerning','a4'] + +# A list of folders to search for stylesheets. Example: +pdf_style_path = ['.', '_styles'] + +# Create a compressed PDF +# Use True/False or 1/0 +# Example: compressed=True +pdf_compressed = True + +# A colon-separated list of folders to search for fonts. Example: +# pdf_font_path = ['/usr/share/fonts', '/usr/share/texmf-dist/fonts/'] + +# Language to be used for hyphenation support +#pdf_language = "en_US" + +# Mode for literal blocks wider than the frame. Can be +# overflow, shrink or truncate +pdf_fit_mode = "shrink" + +# Section level that forces a break page. +# For example: 1 means top-level sections start in a new page +# 0 means disabled +pdf_break_level = 2 + +# When a section starts in a new page, force it to be 'even', 'odd', +# or just use 'any' +#pdf_breakside = 'any' + +# Insert footnotes where they are defined instead of +# at the end. +#pdf_inline_footnotes = True + +# verbosity level. 0 1 or 2 +pdf_verbosity = 0 + +# If false, no index is generated. +pdf_use_index = False + +# If false, no modindex is generated. +pdf_use_modindex = False + +# If false, no coverpage is generated. +#pdf_use_coverpage = True + +# Name of the cover page template to use +#pdf_cover_template = 'sphinxcover.tmpl' + +# Documents to append as an appendix to all manuals. +#pdf_appendices = [] + +# Enable experimental feature to split table cells. Use it +# if you get "DelayedTable too big" errors +#pdf_splittables = False + +# Set the default DPI for images +#pdf_default_dpi = 72 + +# Enable rst2pdf extension modules (default is only vectorpdf) +# you need vectorpdf if you want to use sphinx's graphviz support +pdf_extensions = ['vectorpdf', 'dotted_toc'] + +# Page template name for "regular" pages +#pdf_page_template = 'cutePage' + +# Show Table Of Contents at the beginning? +pdf_use_toc = True + +# How many levels deep should the table of contents be? +pdf_toc_depth = 5 + +# Add section number to section references +pdf_use_numbered_links = True + +# Background images fitting mode +pdf_fit_background_mode = 'scale' + +# -- Options for Sphinx extensions ------------------------------------------- + +# Temporary highlighting of TODO items +todo_include_todos = False + +extlinks = {'bug': ('https://bugzilla.mozilla.org/show_bug.cgi?id=%s', 'bug ')} diff --git a/docs/en/rst/index.rst b/docs/en/rst/index.rst new file mode 100644 index 000000000..b877920c6 --- /dev/null +++ b/docs/en/rst/index.rst @@ -0,0 +1,31 @@ +====================== +Bugzilla Documentation +====================== + +.. toctree:: + :maxdepth: 1 + :numbered: 4 + + about/index + using/index + installing/index + administering/index + integrating/index + api/index + +.. toctree:: + :hidden: + + installing/mysql + installing/postgresql + installing/oracle + installing/sqlite + +.. toctree:: + :hidden: + + installing/apache + installing/apache-windows + installing/iis + +.. todolist:: diff --git a/docs/en/rst/installing/apache-windows.rst b/docs/en/rst/installing/apache-windows.rst new file mode 100644 index 000000000..5e8ac8928 --- /dev/null +++ b/docs/en/rst/installing/apache-windows.rst @@ -0,0 +1,128 @@ +.. _apache-windows: + +Apache +###### + +These instructions require editing the Apache configuration file, which is +at :file:`C:\\Program Files\\Apache Group\\Apache2\\conf\\httpd.conf`. + +Installing +========== + +Download the Apache HTTP Server, version 2.2.x or higher, from +`the Apache website <http://httpd.apache.org/download.cgi>`_. + +Apache uses a standard Windows installer. Just follow the prompts, making sure +you "Install for All Users". Be aware the Apache will always install itself +into an :file:`Apache2` directory under what ever path you specify. The +default install path will be displayed as +:file:`C:\\Program Files\\Apache Group`, which will result in Apache being +installed to :file:`C:\\Program Files\\Apache Group\\Apache2`. + +If you are already running IIS on your machine, you must configure Apache to +run on a port other than 80, which IIS is using. However you aren't asked the +port to listen on at install time. Choose "All Users" (which says port 80), +and we'll change the port later. + +The remainder of this document assumes you have installed Apache into +the default location, :file:`C:\\Program Files\\Apache Group\\Apache2`. + +Apache Account Permissions +========================== + +By default Apache installs itself to run as the SYSTEM account. For security +reasons it's better the reconfigure the service to run as an Apache user. +Create a new Windows user that is a member of **no** groups, and reconfigure +the Apache2 service to run as that account. + +Whichever account you are running Apache as, SYSTEM or otherwise, needs write +and modify access to the following directories and all their subdirectories. +Depending on your version of Windows, this access may already be granted. + +* :file:`C:\\Bugzilla\\data` +* :file:`C:\\Program Files\\Apache Group\\Apache2\\logs` +* :file:`C:\\Temp` +* :file:`C:\\Windows\\Temp` + +Note that :file:`C:\\Bugzilla\\data` is created the first time you run +:file:`checksetup.pl`. + +Port and DocumentRoot +===================== + +Edit the Apache configuration file (see above). + +If you need to change the port that Apache runs on (listens on, or binds to), +for example because another web server such as IIS is running on the same +machine, edit the ``Listen`` option and change the value after the colon. + +Change the ``DocumentRoot`` setting to point to :file:`C:/Bugzilla`. There +are two locations in :file:`httpd.conf` that need to be updated (search for +``DocumentRoot``). You need to use ``/`` instead of ``\`` as a path separator. + +Enable CGI Support +================== + +Edit the Apache configuration file (see above). + +To enable CGI support in Apache, you need to enable the CGI handler, by +uncommenting the ``AddHandler cgi-script .cgi`` line. + +Teach Apache About Bugzilla +=========================== + +Edit the Apache configuration file (see above). + +Add the following stanza: + +.. code-block:: apache + + <Directory "C:/Bugzilla"> + ScriptInterpreterSource Registry-Strict + Options +ExecCGI +FollowSymLinks + DirectoryIndex index.cgi index.html + AllowOverride Limit FileInfo Indexes Options + </Directory> + +In order for ``ScriptInterpreterSource Registry-Strict`` to work, you also +need to add an entry to the Registry so Apache will use Perl to execute .cgi +files. + +Create a key ``HKEY_CLASSES_ROOT\.cgi\Shell\ExecCGI\Command`` with the +default value of the full path of :file:`perl.exe` with a ``-T`` parameter. +For example :file:`C:\\Perl\\bin\\perl.exe -T`. + +Logging +======= + +Unless you want to keep statistics on how many hits your Bugzilla install is +getting, it's a good idea to disable logging by commenting out the +``CustomLog`` directive in the Apache config file. + +If you don't disable logging, you should at least disable logging of "query +strings". When external systems interact with Bugzilla via webservices +(REST/XMLRPC/JSONRPC) they include the user's credentials as part of the URL +(in the query string). Therefore, to avoid storing passwords in clear text +on the server we recommend configuring Apache to not include the query string +in its log files. + +#. Find the following line in the Apache config file, which defines the + logging format for ``vhost_combined``: + + .. code-block:: apache + + LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined + +#. Replace ``%r`` with ``%m %U``. + +(If you have configured Apache differently, a different log line might apply. +Adjust these instructions accordingly.) + +Restart Apache +============== + +Finally, restart Apache to get it pick up the changes: + +:command:`net stop apache2` + +:command:`net start apache2` diff --git a/docs/en/rst/installing/apache.rst b/docs/en/rst/installing/apache.rst new file mode 100644 index 000000000..fe734b222 --- /dev/null +++ b/docs/en/rst/installing/apache.rst @@ -0,0 +1,137 @@ +.. This document is shared among all non-Windows OSes. + +.. _apache: + +Apache +###### + +You have two options for running Bugzilla under Apache - mod_cgi (the +default) and mod_perl. mod_perl is faster but takes more resources. You +should probably only consider mod_perl if your Bugzilla is going to be heavily +used. + +These instructions require editing the Apache configuration file, which is: + +* Fedora/Red Hat: :file:`/etc/httpd/conf/httpd.conf` +* Debian/Ubuntu: :file:`/etc/apache2/apache2.conf` +* Mac OS X: :file:`/etc/apache2/httpd.conf` + +Alternatively, on Debian or Ubuntu, you can instead put the below code into a +separate file in the directory :file:`/etc/apache2/sites-enabled/`. + +In these instructions, when asked to restart Apache, the command is: + +:command:`sudo apachectl start` + +(or run it as root if your OS installation does not use sudo). + +Securing Apache +=============== + +When external systems interact with Bugzilla via webservices +(REST/XMLRPC/JSONRPC) they include the user's credentials as part of the URL +(in the "query string"). Therefore, to avoid storing passwords in clear text +on the server we recommend configuring Apache to not include the query string +in its log files. + +#. Edit the Apache configuration file (see above). + +#. Find the following line in the above mentioned file, which defines the + logging format for ``vhost_combined``: + + .. code-block:: apache + + LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined + +#. Replace ``%r`` with ``%m %U``. + +#. Restart Apache. + +.. _apache-mod_cgi: + +Apache with mod_cgi +=================== + +To configure your Apache web server to work with Bugzilla while using +mod_cgi, do the following: + +#. Edit the Apache configuration file (see above). + +#. Create a ``<Directory>`` directive that applies to the location + of your Bugzilla installation. In this example, Bugzilla has + been installed at :file:`/var/www/html/bugzilla`. On Mac OS X, use + :file:`/Library/WebServer/Documents/bugzilla`. + +.. code-block:: apache + + <Directory /var/www/html/bugzilla> + AddHandler cgi-script .cgi + Options +ExecCGI +FollowSymLinks + DirectoryIndex index.cgi index.html + AllowOverride Limit FileInfo Indexes Options + </Directory> + +These instructions allow Apache to run .cgi files found within the Bugzilla +directory; instructs the server to look for a file called :file:`index.cgi` +or, if not found, :file:`index.html` if someone only types the directory name +into the browser; and allows Bugzilla's :file:`.htaccess` files to override +some global permissions. + +.. _apache-mod_perl: + +Apache with mod_perl +==================== + +Some configuration is required to make Bugzilla work with Apache +and mod_perl. + +.. note:: It is not known whether anyone has even tried mod_perl on Mac OS X. + +#. Edit the Apache configuration file (see above). + +#. Add the following information, substituting where appropriate with your + own local paths. + + .. code-block:: apache + + PerlSwitches -w -T + PerlConfigRequire /var/www/html/bugzilla/mod_perl.pl + + .. note:: This should be used instead of the <Directory> block + shown above. This should also be above any other ``mod_perl`` + directives within the :file:`httpd.conf` and the directives must be + specified in the order above. + + .. warning:: You should also ensure that you have disabled ``KeepAlive`` + support in your Apache install when utilizing Bugzilla under mod_perl + or you may suffer a + `performance penalty <http://modperlbook.org/html/11-4-KeepAlive.html>`_. + +On restarting Apache, Bugzilla should now be running within the +mod_perl environment. + +Please bear the following points in mind when considering using Bugzilla +under mod_perl: + +* mod_perl support in Bugzilla can take up a HUGE amount of RAM - easily + 30MB per httpd child. The more RAM you can get, the better. mod_perl is + basically trading RAM for speed. At least 2GB total system RAM is + recommended for running Bugzilla under mod_perl. + +* Under mod_perl, you have to restart Apache if you make any manual change to + any Bugzilla file. You can't just reload--you have to actually + *restart* the server (as in make sure it stops and starts + again). You *can* change :file:`localconfig` and the :file:`params` file + manually, if you want, because those are re-read every time you load a page. + +* You must run in Apache's Prefork MPM (this is the default). The Worker MPM + may not work -- we haven't tested Bugzilla's mod_perl support under threads. + (And, in fact, we're fairly sure it *won't* work.) + +* Bugzilla generally expects to be the only mod_perl application running on + your entire server. It may or may not work if there are other applications also + running under mod_perl. It does try its best to play nice with other mod_perl + applications, but it still may have conflicts. + +* It is recommended that you have one Bugzilla instance running under mod_perl + on your server. Bugzilla has not been tested with more than one instance running. diff --git a/docs/en/rst/installing/backups.rst b/docs/en/rst/installing/backups.rst new file mode 100644 index 000000000..4b1953c44 --- /dev/null +++ b/docs/en/rst/installing/backups.rst @@ -0,0 +1,38 @@ +.. _backups: + +Backups +####### + +Database +======== + +Here are some sample commands you could use to backup +your database, depending on what database system you're +using. You may have to modify these commands for your +particular setup. Replace the $VARIABLEs with appropriate values for your +setup. + +MySQL +----- + +:command:`mysqldump --max-allowed-packet=32M -u $USERNAME -p $DATABASENAME > backup.sql` + +The value for :command:`max-allowed-packet` should be the value you've set in +your :ref:`MySQL configuration file <mysql>`, and should be larger than the +largest attachment in your database. See the +`mysqldump documentation <http://dev.mysql.com/doc/mysql/en/mysqldump.html>`_ +for more information on :file:`mysqldump`. + +PostgreSQL +---------- + +:command:`pg_dump --no-privileges --no-owner -h localhost -U $USERNAME > bugs.sql` + +Bugzilla +======== + +The Bugzilla directory contains some data files and configuration files which +you would want to retain. A simple recursive copy will do the job here. + +:command:`cp -rp $BUGZILLA_HOME /var/backups/bugzilla` + diff --git a/docs/en/rst/installing/essential-post-install-config.rst b/docs/en/rst/installing/essential-post-install-config.rst new file mode 100644 index 000000000..c5e9c0bc1 --- /dev/null +++ b/docs/en/rst/installing/essential-post-install-config.rst @@ -0,0 +1,172 @@ +.. _essential-post-install-config: + +Essential Post-Installation Configuration +######################################### + +Bugzilla is configured in the Administration Parameters. Log in with the +administrator account you defined in the last :file:`checksetup.pl` run, +then click :guilabel:`Administration` in the header, and then +:guilabel:`Parameters`. You will see the different parameter sections +down the left hand side of the page. + +.. _config-essential-params: + +Parameters +========== + +There are a few parameters which it is very important to define (or +explicitly decide not to change). + +The first set of these are in the :guilabel:`Required Settings` section. + +* :param:`urlbase`: this is the URL by which people should access + Bugzilla's front page. +* :param:`sslbase`: if you have configured SSL on your Bugzilla server, + this is the SSL URL by which people should access Bugzilla's front page. +* :param:`ssl_redirect`: Set this if you want everyone to be redirected + to use the SSL version. Recommended if you have set up SSL. +* :param:`cookiebase`: Bugzilla uses cookies to remember who each user is. + In order to set those cookies in the correct scope, you may need to set a + cookiebase. If your Bugzilla is at the root of your domain, you don't need + to change the default value. + +You may want to put your email address in the :param:`maintainer` +parameter in the :guilabel:`General` section. This will then let people +know who to contact if they see problems or hit errors. + +If you don't want just anyone able to read your Bugzilla, set the +:param:`requirelogin` parameter in the :guilabel:`User Authentication` +section, and change or clear the :param:`createemailregexp` parameter. + +.. _email: + +Email +===== + +Bugzilla requires the ability to set up email. You have a number of choices +here. The simplest is to get Gmail or some other email provider to do the +work for you, but you can also hand the mail off to a local email server, +or run one yourself on the Bugzilla machine. + +Bugzilla's approach to email is configured in the :guilabel:`Email` section +of the Parameters. + +.. _install-MTA: + +Use Another Mail Server +----------------------- + +This section corresponds to choosing a :param:`mail_delivery_method` of +:paramval:`SMTP`. + +This method passes the email off to an existing mail server. Your +organization may well already have one running for their internal email, and +may prefer to use it for confidentiality reasons. If so, you need the +following information about it: + +* The domain name of the server (Parameter: :param:`smtpserver`) +* The username and password to use (Parameters: :param:`smtp_username` and + :param:`smtp_password`) +* Whether the server uses SSL (Parameter: :param:`smtp_ssl`) +* The address you should be sending mail 'From' (Parameter: + :param:`mailfrom`) + +If your organization does not run its own mail server, you can use the +services of one of any number of popular email providers. + +Gmail +''''' + +Visit https://gmail.com and create a new Gmail account for your Bugzilla to +use. Then, set the following parameter values in the "Email" section: + +* :param:`mail_delivery_method`: :paramval:`SMTP` +* :param:`mailfrom`: :paramval:`new_gmail_address@gmail.com` +* :param:`smtpserver`: :paramval:`smtp.gmail.com:465` +* :param:`smtp_username`: :paramval:`new_gmail_address@gmail.com` +* :param:`smtp_password`: :paramval:`new_gmail_password` +* :param:`smtp_ssl`: :paramval:`On` + +Run Your Own Mail Server +------------------------ + +This section corresponds to choosing a :param:`mail_delivery_method` of +:paramval:`Sendmail`. + +Unless you know what you are doing, and can deal with the possible problems +of spam, bounces and blacklists, it is probably unwise to set up your own +mail server just for Bugzilla. However, if you wish to do so, some guidance +follows. + +On Linux, any Sendmail-compatible MTA (Mail Transfer Agent) will +suffice. Sendmail, Postfix, qmail and Exim are examples of common +MTAs. Sendmail is the original Unix MTA, but the others are easier to +configure, and therefore many people replace Sendmail with Postfix or +Exim. They are drop-in replacements, so Bugzilla will not +distinguish between them. + +If you are using Sendmail, version 8.7 or higher is required. If you are +using a Sendmail-compatible MTA, it must be compatible with at least version +8.7 of Sendmail. + +On Mac OS X 10.3 and later, `Postfix <http://www.postfix.org/>`_ +is used as the built-in email server. Postfix provides an executable +that mimics sendmail enough to satisfy Bugzilla. + +On Windows, if you find yourself unable to use Bugzilla's built-in SMTP +support (e.g. because the necessary Perl modules are not available), you can +use :paramval:`Sendmail` with a little application called +`sendmail.exe <http://glob.com.au/sendmail/>`_, which provides +sendmail-compatible calling conventions and encapsulates the SMTP +communication to another mail server. Like Bugzilla, :command:`sendmail.exe` +can be configured to log SMTP communication to a file in case of problems. + +Detailed information on configuring an MTA is outside the scope of this +document. Consult the manual for the specific MTA you choose for detailed +installation instructions. Each of these programs will have their own +configuration files where you must configure certain parameters to +ensure that the mail is delivered properly. They are implemented +as services, and you should ensure that the MTA is in the auto-start +list of services for the machine. + +If a simple mail sent with the command-line :file:`mail` program +succeeds, then Bugzilla should also be fine. + +Troubleshooting +--------------- + +If you are having trouble, check that any configured SMTP server can be +reached from your Bugzilla server and that any given authentication +credentials are valid. If these things seem correct and your mails are still +not sending, check if your OS uses SELinux or AppArmor. Either of these +may prevent your web server from sending email. The SELinux boolean +`httpd_can_sendmail <http://selinuxproject.org/page/ApacheRecipes#Allow_the_Apache_HTTP_Server_to_send_mail>`_ +may need to be set to True. + +If all those things don't help, activate the :param:`smtp_debug` parameter +and check your webserver logs. + +.. _config-products: + +Products, Components, Versions and Milestones +============================================= + +Bugs in Bugzilla are categorised into Products and, inside those Products, +Components (and, optionally, if you turn on the :param:`useclassifications` +parameter, Classifications as a level above Products). + +Bugzilla comes with a single Product, called "TestProduct", which contains a +single component, imaginatively called "TestComponent". You will want to +create your own Products and their Components. It's OK to have just one +Component inside a Product. Products have Versions (which represents the +version of the software in which a bug was found) and Target Milestones +(which represent the future version of the product in which the bug is +hopefully to be fixed - or, for RESOLVED bugs, was fixed. You may also want +to add some of those. + +Once you've created your own, you will want to delete TestProduct (which +will delete TestComponent automatically). Note that if you've filed a bug in +TestProduct to try Bugzilla out, you'll need to move it elsewhere before it's +possible to delete TestProduct. + +Now, you may want to do some of the :ref:`optional-post-install-config`. diff --git a/docs/en/rst/installing/iis.rst b/docs/en/rst/installing/iis.rst new file mode 100644 index 000000000..6a1a7ab53 --- /dev/null +++ b/docs/en/rst/installing/iis.rst @@ -0,0 +1,109 @@ +.. _iis: + +Microsoft IIS +############# + +Bugzilla works with IIS as a normal CGI application. These instructions assume +that you are using Windows 7. Procedures for other versions are probably similar. + +Begin by starting Internet Information Services (IIS) Manager. +:guilabel:`Start` --> :guilabel:`Administrators Tools` --> +:guilabel:`Internet Information Services (IIS) Manager`. Or run the command: + +:command:`inetmgr` + +Create a New Application +======================== + +Expand your :guilabel:`Server` until the :guilabel:`Default Web Site` shows +its children. + +Right-click :guilabel:`Default Web Site` and select +:guilabel:`Add Application` from the menu. + +Unde :guilabel:`Alias`, enter the alias for the website. This is the path +below the domain where you want Bugzilla to appear. + +Under :guilabel:`Physical Path`, enter the path to Bugzilla, +:file:`C:\\Bugzilla`. + +When finished, click :guilabel:`OK`. + +Configure the Default Document +============================== + +Click on the Application that you just created. Double-click on +:guilabel:`Default Document`, and click :guilabel:`Add` underneath the +Actions menu. + +Under :guilabel:`Name`, enter ``index.cgi``. + +All other default documents can be removed for this application. + +.. warning:: Do not delete the default document from the :guilabel:`Default Website`. + +Add Handler Mappings +==================== + +Ensure that you are at the Default Website. Under :guilabel:`IIS`, +double-click :guilabel:`Handler Mappings`. Under :guilabel:`Actions`, click +:guilabel:`Add Script Map`. You need to do this twice. + +For the first one, set the following values (replacing paths if necessary): + +* :guilabel:`Request Path`: ``*.pl`` +* :guilabel:`Executable`: ``C:\Perl\bin\perl.exe "%s" %s`` +* :guilabel:`Name`: ``Perl Script Map`` + +At the prompt select :guilabel:`Yes`. + +.. note:: The ActiveState Perl installer may have already created an entry for + .pl files that is limited to ``GET,HEAD,POST``. If so, this mapping should + be removed, as Bugzilla's .pl files are not designed to be run via a web + server. + +For the second one, set the following values (replacing paths if necessary): + +* :guilabel:`Request Path`: ``*.cgi`` +* :guilabel:`Executable`: ``C:\Perl\bin\perl.exe "%s" %s`` +* :guilabel:`Name`: ``CGI Script Map`` + +At the prompt select :guilabel:`Yes`. + +Bugzilla Application +==================== + +Ensure that you are at the Bugzilla Application. Under :guilabel:`IIS`, +double-click :guilabel:`Handler Mappings`. Under :guilabel:`Actions`, click +:guilabel:`Add Script Map`. + +Set the following values (replacing paths if necessary): + +* :guilabel:`Request Path`: ``*.cgi`` +* :guilabel:`Executable`: ``C:\Perl\bin\perl.exe -x"C:\Bugzilla" -wT "%s" %s`` +* :guilabel:`Name`: ``Bugzilla`` + +At the prompt select :guilabel:`Yes`. + +Now it's time to restart the IIS server to take these changes into account. +From the top-level menu, which contains the name of your machine, click +:guilabel:`Restart` under :guilabel:`Manage Server`. Or run the command: + +:command:`iisreset` + +Common Problems +=============== + +Bugzilla runs but it's not possible to log in + You've probably configured IIS to use ActiveState's ISAPI DLL -- in other + words you're using PerlEx, or the executable IIS is configured to use is + :file:`PerlS.dll` or :file:`Perl30.dll`. + + Reconfigure IIS to use :file:`perl.exe`. + +IIS returns HTTP 502 errors + You probably forgot the ``-T`` argument to :file:`perl` when configuring the + executable in IIS. + +XMLRPC interface not working with IIS + This is a known issue. See :bug:`708252`. diff --git a/docs/en/rst/installing/index.rst b/docs/en/rst/installing/index.rst new file mode 100644 index 000000000..91a81bede --- /dev/null +++ b/docs/en/rst/installing/index.rst @@ -0,0 +1,36 @@ +.. highlight:: console + +.. _installing: + +================================== +Installation and Maintenance Guide +================================== + +.. note:: If you just want to *use* Bugzilla, + you do not need to install it. None of this chapter is relevant to + you. Ask your Bugzilla administrator for the URL to access it from + your web browser. You may want to read the :ref:`using`. + +Bugzilla can be installed under Linux, Windows, Mac OS X, and perhaps other +operating systems. However, if you are setting it up on a dedicated machine +and you have control of the operating system to use, the Bugzilla team +wholeheartedly recommends Linux as an extremely versatile, stable, and robust +operating system that provides an ideal environment for Bugzilla. In that +case, you may want to read the :ref:`Quick Start instructions <quick-start>`. + +.. toctree:: + :maxdepth: 1 + + quick-start + linux + windows + mac-os-x + essential-post-install-config + optional-post-install-config + migrating + moving + upgrading + backups + sanity-check + merging-accounts + multiple-bugzillas diff --git a/docs/en/rst/installing/installing-end.inc.rst b/docs/en/rst/installing/installing-end.inc.rst new file mode 100644 index 000000000..6e34395ac --- /dev/null +++ b/docs/en/rst/installing/installing-end.inc.rst @@ -0,0 +1,66 @@ +localconfig +=========== + +You should now change into the Bugzilla directory and run +:file:`checksetup.pl`, without any parameters: + +|checksetupcommand| + +:file:`checksetup.pl` will write out a file called :file:`localconfig`. +This file contains the default settings for a number of +Bugzilla parameters, the most important of which are the group your web +server runs as, and information on how to connect to your database. + +Load this file in your editor. You will need to check/change ``$db_driver`` +and ``$db_pass``, which are respectively the type of the database you are +using and the password for the ``bugs`` database user you have created. +``$db_driver`` can be either ``mysql``, ``Pg`` (PostgreSQL), ``Oracle`` or +``Sqlite``. All values are case sensitive. + +Set the value of ``$webservergroup`` to the group your web server runs as. + +* Fedora/Red Hat: ``apache`` +* Debian/Ubuntu: ``www-data`` +* Mac OS X: ``_www`` +* Windows: ignore this setting; it does nothing + +The other options in the :file:`localconfig` file are documented by their +accompanying comments. If you have a non-standard database setup, you may +need to change one or more of the other ``$db_*`` parameters. + +.. note:: If you are using Oracle, ``$db_name`` should be set to + the SID name of your database (e.g. ``XE`` if you are using Oracle XE). + +checksetup.pl +============= + +Next, run :file:`checksetup.pl` an additional time: + +|checksetupcommand| + +It reconfirms that all the modules are present, and notices the altered +localconfig file, which it assumes you have edited to your +satisfaction. It compiles the UI templates, +connects to the database using the ``bugs`` +user you created and the password you defined, and creates the +``bugs`` database and the tables therein. + +After that, it asks for details of an administrator account. Bugzilla +can have multiple administrators - you can create more later - but +it needs one to start off with. +Enter the email address of an administrator, his or her full name, +and a suitable Bugzilla password. + +:file:`checksetup.pl` will then finish. You may rerun +:file:`checksetup.pl` at any time if you wish. + +Success +======= + +Your Bugzilla should now be working. Check by running: + +|testservercommand| + +If that passes, access ``http://<your-bugzilla-server>/`` in your browser - +you should see the Bugzilla front page. Of course, if you installed Bugzilla +in a subdirectory, make sure that's in the URL. diff --git a/docs/en/rst/installing/linux.rst b/docs/en/rst/installing/linux.rst new file mode 100644 index 000000000..b434f9e8e --- /dev/null +++ b/docs/en/rst/installing/linux.rst @@ -0,0 +1,214 @@ +.. _linux: + +Linux +##### + +Some Linux distributions include Bugzilla and its dependencies in their +package management systems. If you have root access, installing Bugzilla on +any Linux system could be as simple as finding the Bugzilla package in the +package management application and installing it. There may be a small bit +of additional configuration required. + +If you are installing your machine from scratch, :ref:`quick-start` may be +the best instructions for you. + +.. _linux-install-packages: + +Install Packages +================ + +Use your distribution's package manager to install Perl, your preferred +database engine (MySQL if in doubt), and a webserver (Apache if in doubt). +Some distributions even have a Bugzilla package, although that will vary +in age. + +The commands below will install those things and some of Bugzilla's other +prerequisites as well. If you find a package doesn't install or the name +is not found, just remove it from the list and reissue the command. If you +want to use a different database or webserver, substitute the package +names as appropriate. + +Fedora and Red Hat +------------------ + +The following command will install Red Hat's packaged version of Bugzilla: + +:command:`yum install bugzilla httpd mysql-server` + +However, if you go this route, you need to read :bug:`415605`, which details +some problems with the Email::Send package. Then, you can skip to +:ref:`configuring your database <linux-config-database>`. It may be useful to +know that Fedora stores the Bugzilla files in :file:`/usr/share/bugzilla`, so +that's where you'll run :file:`checksetup.pl`. + +If you want to install a version of Bugzilla from the Bugzilla project, you +will instead need: + +:command:`yum install httpd mysql-server mod_perl mod_perl-devel httpd-devel +graphviz patchutils gcc 'perl(Apache2::SizeLimit)' 'perl(Authen::Radius)' +'perl(Authen::SASL)' 'perl(Cache::Memcached)' 'perl(CGI)' 'perl(Chart::Lines)' +'perl(Daemon::Generic)' 'perl(Date::Format)' 'perl(DateTime)' +'perl(DateTime::TimeZone)' 'perl(DBI)' 'perl(Digest::SHA)' 'perl(Email::MIME)' +'perl(Email::MIME::Attachment::Stripper)' 'perl(Email::Reply)' +'perl(Email::Sender)' 'perl(Encode)' 'perl(Encode::Detect)' +'perl(File::MimeInfo::Magic)' 'perl(File::Slurp)' 'perl(GD)' 'perl(GD::Graph)' +'perl(GD::Text)' 'perl(HTML::FormatText::WithLinks)' 'perl(HTML::Parser)' +'perl(HTML::Scrubber)' 'perl(IO::Scalar)' 'perl(JSON::RPC)' 'perl(JSON::XS)' +'perl(List::MoreUtils)' 'perl(LWP::UserAgent)' 'perl(Math::Random::ISAAC)' +'perl(MIME::Parser)' 'perl(mod_perl2)' 'perl(Net::LDAP)' 'perl(Net::SMTP::SSL)' +'perl(PatchReader)' 'perl(SOAP::Lite)' 'perl(Template)' +'perl(Template::Plugin::GD::Image)' 'perl(Test::Taint)' 'perl(TheSchwartz)' +'perl(URI)' 'perl(XMLRPC::Lite)' 'perl(XML::Twig)'` + +If you are running RHEL6, you will have to enable the "RHEL Server Optional" +channel in RHN to get some of those packages. + +If you plan to use SQlite as your database, you will need to also install +the appropriate packages for that. + +Ubuntu and Debian +----------------- + +:command:`apt-get install git nano` + +:command:`apt-get install apache2 mysql-server libappconfig-perl +libdate-calc-perl libtemplate-perl libmime-perl build-essential +libdatetime-timezone-perl libdatetime-perl libemail-sender-perl +libemail-mime-perl libemail-mime-modifier-perl libdbi-perl libdbd-mysql-perl +libcgi-pm-perl libmath-random-isaac-perl libmath-random-isaac-xs-perl +apache2-mpm-prefork libapache2-mod-perl2 libapache2-mod-perl2-dev +libchart-perl libxml-perl libxml-twig-perl perlmagick libgd-graph-perl +libtemplate-plugin-gd-perl libsoap-lite-perl libhtml-scrubber-perl +libjson-rpc-perl libdaemon-generic-perl libtheschwartz-perl +libtest-taint-perl libauthen-radius-perl libfile-slurp-perl +libencode-detect-perl libmodule-build-perl libnet-ldap-perl +libauthen-sasl-perl libtemplate-perl-doc libfile-mimeinfo-perl +libhtml-formattext-withlinks-perl libgd-dev lynx-cur graphviz python-sphinx` + +If you plan to use SQlite as your database, you will need to also install +the appropriate packages for that. + +Gentoo +------ + +:command:`emerge -av bugzilla` + +will install Bugzilla and all its dependencies. If you don't have the vhosts +USE flag enabled, Bugzilla will end up in :file:`/var/www/localhost/bugzilla`. + +Then, you can skip to :ref:`configuring your database +<linux-config-database>`. + +.. _linux-install-perl: + +Perl +==== + +Test which version of Perl you have installed with: +:: + + $ perl -v + +Bugzilla requires at least Perl |min-perl-ver|. + +.. _linux-install-bzfiles: + +Bugzilla +======== + +The best way to get Bugzilla is to check it out from git: + +:command:`git clone --branch bugzilla-X.X-stable https://git.mozilla.org/bugzilla/bugzilla` + +Run the above command in your home directory, replacing "X.X" with the 2-digit +version number of the stable release of Bugzilla that you want - e.g. "4.4". + +If that's not possible, you can +`download a tarball of Bugzilla <http://www.bugzilla.org/download/>`_. + +Place Bugzilla in a suitable directory, accessible by the default web server +user (probably ``apache`` or ``www-data``). +Good locations are either directly in the web server's document directory +(often :file:`/var/www/html`) or in :file:`/usr/local`, either with a +symbolic link to the web server's document directory or an alias in the web +server's configuration. + +.. warning:: The default Bugzilla distribution is NOT designed to be placed + in a :file:`cgi-bin` directory. This + includes any directory which is configured using the + ``ScriptAlias`` directive of Apache. + +.. _linux-install-perl-modules: + +Perl Modules +============ + +Bugzilla requires a number of Perl modules. You can install these globally +using your system's package manager, or install Bugzilla-only copies. At +times, Bugzilla may require a version of a Perl module newer than the one +your distribution packages, in which case you will need to install a +Bugzilla-only copy of the newer version. + +At this point you probably need to become ``root``, e.g. by using +:command:`su`. You should remain as root until the end of the install. This +can be avoided in some circumstances if you are a member of your webserver's +group, but being root is easier and will always work. + +To check whether you have all the required modules, run: + +:command:`./checksetup.pl --check-modules` + +You can run this command as many times as necessary. + +If you have not already installed the necessary modules, and want to do it +system-wide, invoke your package manager appropriately at this point. +Alternatively, you can install all missing modules locally (i.e. just for +Bugzilla) like this: + +:command:`./install-module.pl --all` + +Or, you can pass an individual module name: + +:command:`./install-module.pl <modulename>` + +.. note:: If you are using a package-based distribution, and attempting to + install the Perl modules from CPAN (e.g. by using :file:`install-module.pl`), + you may need to install the "development" + packages for MySQL and GD before attempting to install the related Perl + modules. The names of these packages will vary depending on the specific + distribution you are using, but are often called :file:`<packagename>-devel`. + + .. todo:: Give examples for Debian/Ubuntu and RedHat. + Convert this item to a bug after checkin. + +.. _linux-config-webserver: + +Web Server +========== + +Any web server that is capable of running CGI scripts can be made to work. +We have specific configuration instructions for the following: + +* :ref:`apache` + +.. _linux-config-database: + +Database Engine +=============== + +Bugzilla supports MySQL, PostgreSQL, Oracle and SQLite as database servers. +You only require one of these systems to make use of Bugzilla. MySQL is +most commonly used. SQLite is good for trial installations as it requires no +setup. Configure your server according to the instructions below: + +* :ref:`mysql` +* :ref:`postgresql` +* :ref:`oracle` +* :ref:`sqlite` + +.. |checksetupcommand| replace:: :command:`./checksetup.pl` +.. |testservercommand| replace:: :command:`./testserver.pl http://<your-bugzilla-server>/` + +.. include:: installing-end.inc.rst + +Next, do the :ref:`essential-post-install-config`. diff --git a/docs/en/rst/installing/mac-os-x.rst b/docs/en/rst/installing/mac-os-x.rst new file mode 100644 index 000000000..545d2fa27 --- /dev/null +++ b/docs/en/rst/installing/mac-os-x.rst @@ -0,0 +1,130 @@ +.. _mac-os-x: + +Mac OS X +######## + +.. _macosx-install-packages: + +.. note:: The Bugzilla team has very little Mac expertise and we've not been + able to do a successful install of the latest version. We got + close, though. If you've managed it, tell us how and we can update + these docs! + +Install Packages +================ + +OS X 10.7 provides Perl 5.12 and Apache 2.2. Install the following additional +packages: + +* git: Download an installer from + `the git website <http://www.git-scm.com/downloads>`_. +* MySQL: Download an installer from + `the MySQL website <http://dev.mysql.com/downloads/mysql/>`_. + +.. _macosx-install-bzfiles: + +Bugzilla +======== + +The best way to get Bugzilla is to check it out from git: + +:command:`git clone --branch bugzilla-X.X-stable https://git.mozilla.org/bugzilla/bugzilla` + +Run the above command in your home directory, replacing "X.X" with the 2-digit +version number of the stable release of Bugzilla that you want - e.g. "4.4". +This will place Bugzilla in the directory :file:`$HOME/bugzilla`. + +If that's not possible, you can +`download a tarball of Bugzilla <http://www.bugzilla.org/download/>`_. + +.. _macosx-libraries: + +Additional System Libraries +=========================== + +Apple does not include the GD library with Mac OS X. Bugzilla needs this if +you want to display bug graphs, and you need to install it before you try +installing the GD Perl module. + +You can use `MacPorts <http://www.macports.org/>`_, `Homebrew <http://brew.sh/>`_ or +`Fink <http://sourceforge.net/projects/fink/>`_, all of which can install common +Unix programs on Mac OS X. + +If you don't have one of the above installed already, pick one and follow the +instructions for setting it up. Then, use it to install the :file:`gd2` package +(MacPorts/Fink) or the :file:`gd` package (Brew). + +The package manager may prompt you to install a number of dependencies; you +will need to agree to this. + +.. note:: To prevent creating conflicts with the software that Apple + installs by default, Fink creates its own directory tree at :file:`/sw` + where it installs most of + the software that it installs. This means your libraries and headers + will be at :file:`/sw/lib` and :file:`/sw/include` instead + of :file:`/usr/lib` and :file:`/usr/include`. When the + Perl module config script for the GD module asks where your :file:`libgd` + is, be sure to tell it :file:`/sw/lib`. + +.. _macosx-install-perl-modules: + +Perl Modules +============ + +Bugzilla requires a number of Perl modules. On Mac OS X, the easiest thing to +do is to install local copies (rather than system-wide copies) of any ones +that you don't already have. However, if you do want to install them +system-wide, run the below commands as root with the :command:`--global` +option. + +To check whether you have all the required modules and what is still missing, +run: + +:command:`perl checksetup.pl --check-modules` + +You can run this command as many times as necessary. + +Install all missing modules locally like this: + +:command:`perl install-module.pl --all` + +.. _macosx-config-webserver: + +Web Server +========== + +Any web server that is capable of running CGI scripts can be made to work. +We have specific configuration instructions for the following: + +* :ref:`apache` + +You'll need to create a symbolic link so the webserver can see Bugzilla: + +:command:`cd /Library/WebServer/Documents` + +:command:`sudo ln -s $HOME/bugzilla bugzilla` + +In :guilabel:`System Preferences` --> :guilabel:`Sharing`, enable the +:guilabel:`Web Sharing` checkbox to start Apache. + +.. _macosx-config-database: + +Database Engine +=============== + +Bugzilla supports MySQL, PostgreSQL, Oracle and SQLite as database servers. +You only require one of these systems to make use of Bugzilla. MySQL is +most commonly used on Mac OS X. (In fact, we have no reports of anyone using +anything else.) Configure your server according to the instructions below: + +* :ref:`mysql` +* :ref:`postgresql` +* :ref:`oracle` +* :ref:`sqlite` + +.. |checksetupcommand| replace:: :command:`perl checksetup.pl` +.. |testservercommand| replace:: :command:`perl testserver.pl http://<your-bugzilla-server>/` + +.. include:: installing-end.inc.rst + +Next, do the :ref:`essential-post-install-config`. diff --git a/docs/en/rst/installing/merging-accounts.rst b/docs/en/rst/installing/merging-accounts.rst new file mode 100644 index 000000000..4dbdb807f --- /dev/null +++ b/docs/en/rst/installing/merging-accounts.rst @@ -0,0 +1,14 @@ +Merging Accounts +################ + +Sometimes, users create a second account, perhaps because they don't realise +they can change the email address associated with their original account. +And then, once they discover this, they don't want to abandon the history +associated with either account. + +The best way forward in this case would be to merge one of their accounts +into the other one, so it looked like the target account had done all the +actions of both. In Bugzilla's :file:`contrib` directory, there is a script +called :file:`merge-users.pl`. While code in this directory is not officially +supported by the Bugzilla team, this script may be useful to you in +solving the above problem. diff --git a/docs/en/rst/installing/migrating-from-1.inc.rst b/docs/en/rst/installing/migrating-from-1.inc.rst new file mode 100644 index 000000000..d834a8605 --- /dev/null +++ b/docs/en/rst/installing/migrating-from-1.inc.rst @@ -0,0 +1,7 @@ +.. This file is included in multiple places, so can't have labels as they + appear as duplicates. + +The procedure to migrate to Git is as follows. The idea is to switch version +control systems without changing the version of Bugzilla you are using, +to minimise the risk of conflict or problems. Any upgrade can then +happen as a separate step. diff --git a/docs/en/rst/installing/migrating-from-2.inc.rst b/docs/en/rst/installing/migrating-from-2.inc.rst new file mode 100644 index 000000000..c9328077f --- /dev/null +++ b/docs/en/rst/installing/migrating-from-2.inc.rst @@ -0,0 +1,149 @@ +.. This file is included in multiple places, so can't have labels as they + appear as duplicates. + +Download Code from Git +====================== + +First, you need to find what version of Bugzilla you are using. It should be +in the top right corner of the front page but, if not, open the file +:file:`Bugzilla/Constants.pm` in your Bugzilla directory and search for +``BUGZILLA_VERSION``. + +Then, you need to download an additional copy of your *current* version of +Bugzilla from the git repository, and place it in a separate directory +alongside your existing Bugzilla installation (which we will assume is in a +directory called :file:`bugzilla`). + +To do this, you will need a copy of the :command:`git` program. All Linux +distributions have it; search your package manager for "git". On Windows or +Mac OS X, you can +`download the official build <http://www.git-scm.com/downloads>`_. + +Once git is installed, run these commands to pull a copy of Bugzilla: + +:command:`git clone https://git.mozilla.org/bugzilla/bugzilla bugzilla-new` + +:command:`cd bugzilla-new` + +:command:`git checkout release-$VERSION` + +Replace $VERSION with the three-digit version number of your current Bugzilla, +e.g. "4.2.2". (If the the final digit would have been a 0, omit it - so use +"4.4" for the first release in the 4.4 series.) + +You will get a message about a 'detached HEAD'. Don't worry; your head is +still firmly attached to your shoulders. + +Save Any Local Customizations +============================= + +Go into your original Bugzilla directory and run this command: + +|diffcommand| + +If you have made customizations to your Bugzilla, and you made them by +changing the Bugzilla code itself (rather than using the Extension system), +then :file:`patch.diff` will have significant content. You will want to keep a copy +of those changes by keeping a copy of this file and any files referenced in it +by "Only in" lines. If the file has zero size or only insignificant content, +you haven't made any local customizations of this sort. + +Shut Down Bugzilla +================== + +At this point, you should shut down Bugzilla to make sure nothing changes +while you make the switch. Go into the administrative interface and put an +appropriate message into the :param:`shutdownhtml` parameter, which is in the +"General" section of the administration parameters. As the name implies, HTML +is allowed. + +This would be a good time to make :ref:`backups`. We shouldn't be affecting +the database, but you can't be too careful. + +Copy Across Data and Modules +============================ + +Copy the contents of the following directories from your current installation +of Bugzilla into the corresponding directory in :file:`bugzilla-new/`: + +.. code-block:: none + + lib/ + data/ + template/en/custom (may or may not exist) + +You also need to copy any extensions you have written or installed, which are +in the :file:`extensions/` directory. |extstatusinfo| + +Lastly, copy the following file from your current installation of Bugzilla +into the corresponding place in :file:`bugzilla-new/`: + +.. code-block:: none + + localconfig + +This file contains your database password and access details. Because your +two versions of Bugzilla are the same, this should all work fine. + +Reapply Local Customizations +============================ + +If your :file:`patch.diff` file was zero sized, you can +jump to the next step. Otherwise, you have to apply the patch to your new +installation. If you are on Windows and you don’t have the :command:`patch` +program, you can download it from +`GNUWin <http://gnuwin32.sourceforge.net/packages/patch.htm>`_. Once +downloaded, you must copy patch.exe into the Windows directory. + +Copy :file:`patch.diff` into the :file:`bugzilla-new` directory and then do: + +:command:`patch -p0 --dry-run < patch.diff` + +The patch should apply cleanly because you have exactly the same version of +Bugzilla in both directories. If it does, remove the :command:`--dry-run` and +rerun the command to apply it for real. If it does not apply cleanly, it is +likely that you have managed to get a Bugzilla version mismatch between the +two directories. + +Swap The New Version In +======================= + +Now we swap the directories over, and run checksetup.pl to confirm that all +is well. From the directory containing the :file:`bugzilla` and +:file:`bugzilla-new` directories, run: + +:command:`mv bugzilla bugzilla-old` + +:command:`mv bugzilla-new bugzilla` + +:command:`cd bugzilla` + +:command:`./checksetup.pl` + +Running :file:`checksetup.pl` should not result in any changes to your database at +the end of the run. If it does, then it's most likely that the two versions +of Bugzilla you have are not, in fact, the same. + +Re-enable Bugzilla +================== + +Go into the administrative interface and clear the contents of the +:param:`shutdownhtml` parameter. + +Test Bugzilla +============= + +Use your Bugzilla for several days to check that the switch has had no +detrimental effects. Then, if necessary, follow the instructions in +:ref:`upgrading-with-git` to upgrade to the latest version of Bugzilla. + +Rolling Back +============ + +If something goes wrong at any stage of the switching process (e.g. your +patch doesn't apply, or checksetup doesn't complete), you can always just +switch the directories back (if you've got that far) and re-enable Bugzilla +(if you disabled it) and then seek help. Even if you have re-enabled Bugzilla, +and find a problem a little while down the road, you are still using the same +version so there would be few side effects to switching the directories back +a day or three later. diff --git a/docs/en/rst/installing/migrating-from-a-tarball.rst b/docs/en/rst/installing/migrating-from-a-tarball.rst new file mode 100644 index 000000000..852cb8dbe --- /dev/null +++ b/docs/en/rst/installing/migrating-from-a-tarball.rst @@ -0,0 +1,15 @@ +.. _migrating-from-a-tarball: + +Migrating from a Tarball +######################## + +.. |diffcommand| replace:: :command:`diff -ru -x data -x lib -x docs -x .git -x CVS -x .cvsignore -x .bzr -x .bzrignore -x .bzrrev ../bugzilla-new . > ../patch.diff` + +.. |extstatusinfo| replace:: Copy across any subdirectories which do not exist + in your new install. + +The procedure to migrate to Git is as follows. The idea is to switch without +changing the version of Bugzilla you are using, to minimise the risk of +conflict or problems. Any upgrade can then happen as a separate step. + +.. include:: migrating-from-2.inc.rst diff --git a/docs/en/rst/installing/migrating-from-bzr.rst b/docs/en/rst/installing/migrating-from-bzr.rst new file mode 100644 index 000000000..da6809a01 --- /dev/null +++ b/docs/en/rst/installing/migrating-from-bzr.rst @@ -0,0 +1,11 @@ +.. _migrating-from-bazaar: + +Migrating from Bazaar +##################### + +.. |updatecommand| replace:: :command:`bzr up -r tag:bugzilla-$VERSION` +.. |diffcommand| replace:: :command:`bzr diff > patch.diff` +.. |extstatusinfo| replace:: The command :command:`bzr status extensions/` should help you work out what you added, if anything. + +.. include:: migrating-from-1.inc.rst +.. include:: migrating-from-2.inc.rst diff --git a/docs/en/rst/installing/migrating-from-cvs.rst b/docs/en/rst/installing/migrating-from-cvs.rst new file mode 100644 index 000000000..76f6253f2 --- /dev/null +++ b/docs/en/rst/installing/migrating-from-cvs.rst @@ -0,0 +1,13 @@ +.. _migrating-from-cvs: + +Migrating from CVS +################## + +.. |updatecommand| replace:: :command:`cvs update -rBUGZILLA-$VERSION-STABLE -dP` +.. |diffcommand| replace:: :command:`cvs diff -puN > patch.diff` +.. |extstatusinfo| replace:: The command :command:`cvs status extensions/` should help you work out what you added, if anything. + +.. include:: migrating-from-1.inc.rst +.. include:: migrating-from-2.inc.rst + + diff --git a/docs/en/rst/installing/migrating.rst b/docs/en/rst/installing/migrating.rst new file mode 100644 index 000000000..5b842dd3d --- /dev/null +++ b/docs/en/rst/installing/migrating.rst @@ -0,0 +1,23 @@ +.. _migrating-from-other-btses: + +Migrating From Other Bug-Tracking Systems +######################################### + +Bugzilla has a framework you can use for migrating from other bug-tracking +systems - +`Bugzilla::Migrate <http://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/Migrate.html>`_. +It provides the infrastructure you will need, +but requires a module to be written to define the specifics of the system you +are coming from. One exists for +`Gnats <https://www.gnu.org/software/gnats/>`_. If you write one for a +popular system, please share your code with us. + +Alternatively, Bugzilla comes with a script, :file:`importxml.pl`, which +imports bugs in Bugzilla's XML format. You can see examples of this format +by clicking the :guilabel:`XML` link at the bottom of a bug in a running +Bugzilla. You would need to read the script to see how it handles errors, +default values, creating non-existing values and so on. + +Bugzilla::Migrate is preferred if possible. + + diff --git a/docs/en/rst/installing/moving.rst b/docs/en/rst/installing/moving.rst new file mode 100644 index 000000000..966acda07 --- /dev/null +++ b/docs/en/rst/installing/moving.rst @@ -0,0 +1,66 @@ +.. _moving: + +Moving Bugzilla Between Machines +################################ + +Sometimes it's necessary to take a working installation of Bugzilla and move +it to new hardware. This page explains how to do that, assuming that you +have Bugzilla's webserver and database on the same machine, and you are moving +both of them. + +You are advised to install the same version of Bugzilla on the new +machine as the old machine - any :ref:`upgrade <upgrading>` you also need to +do can then be done as a separate step. But if you do install a newer version, +things should still work. + +1. Shut down your Bugzilla by loading the front page, going to + :guilabel:`Administration` | :guilabel:`Parameters` | :guilabel:`General` + and putting some explanatory text into the :param:`shutdownhtml` parameter. + +2. Make a :ref:`backup <backups>` of the bugs database. + +3. On your new machine, install Bugzilla using the instructions at + :ref:`installing`. Look at the old machine if you need to know what values + you used for configuring e.g. MySQL. + +4. Copy the :file:`data` directory and the :file:`localconfig` file from the + old Bugzilla installation to the new one. + +5. If anything about your database configuration changed (location of the + server, username, password, etc.) as part of the move, update the + appropriate variables in :file:`localconfig`. + +6. If the new URL to your new Bugzilla installation is different from the old + one, update the :param:`urlbase` parameter in :file:`data/params.json` + using a text editor. + +7. Copy the database backup file from your old server to the new one. + +8. Create an empty ``bugs`` database on the new server. For MySQL, that would + look like this: + + :command:`mysql -u root -p -e "CREATE DATABASE bugs DEFAULT CHARACTER SET utf8;"` + +9. Import your backup file into your new ``bugs`` database. Again, for MySQL: + + :command:`mysql -u root -p bugs < $BACKUP_FILE_NAME` + + If you get an error about "packet too large" or "MySQL server has gone + away", you need to adjust the ``max_allowed_packet`` setting in + your :file:`my.cnf` file (usually :file:`/etc/my.cnf`) file to match or + exceed the value configured in the same file in your old version of MySQL. + + If there are *any* errors during this step, you have to work out what + went wrong, and then drop the database, create it again using the step + above, and run the import again. + +10. Run :file:`checksetup.pl` to make sure all is OK. + (Unless you are using a newer version of Bugzilla on your new server, this + should not make any changes.) + + :command:`./checksetup.pl` + +11. Activate your new Bugzilla by loading the front page on the new server, + going to :guilabel:`Administration` | :guilabel:`Parameters` | + :guilabel:`General` and removing the text from the :param:`shutdownhtml` + parameter. diff --git a/docs/en/rst/installing/multiple-bugzillas.rst b/docs/en/rst/installing/multiple-bugzillas.rst new file mode 100644 index 000000000..1e2d7951f --- /dev/null +++ b/docs/en/rst/installing/multiple-bugzillas.rst @@ -0,0 +1,41 @@ +.. _multiple-bz-dbs: + +One Installation, Multiple Instances +#################################### + +This is a somewhat specialist feature; if you don't know whether you need it, +you don't. It is useful to admins who want to run many separate instances of +Bugzilla from a single installed codebase. + +This is possible by using the ``PROJECT`` environment variable. When accessed, +Bugzilla checks for the existence of this variable, and if present, uses +its value to check for an alternative configuration file named +:file:`localconfig.<PROJECT>` in the same location as +the default one (:file:`localconfig`). It also checks for +customized templates in a directory named +:file:`<PROJECT>` in the same location as the +default one (:file:`template/<langcode>`). By default +this is :file:`template/en/default` so ``PROJECT``'s templates +would be located at :file:`template/en/PROJECT`. + +To set up an alternate installation, just export ``PROJECT=foo`` before +running :command:`checksetup.pl` for the first time. It will +result in a file called :file:`localconfig.foo` instead of +:file:`localconfig`. Edit this file as described above, with +reference to a new database, and re-run :command:`checksetup.pl` +to populate it. That's all. + +Now you have to configure the web server to pass this environment +variable when accessed via an alternate URL, such as virtual host for +instance. The following is an example of how you could do it in Apache, +other Webservers may differ. + +.. code-block:: apache + + <VirtualHost 12.34.56.78:80> + ServerName bugzilla.example.com + SetEnv PROJECT foo + </VirtualHost> + +Don't forget to also export this variable before accessing Bugzilla +by other means, such as repeating tasks like those above. diff --git a/docs/en/rst/installing/mysql.rst b/docs/en/rst/installing/mysql.rst new file mode 100644 index 000000000..1107547a6 --- /dev/null +++ b/docs/en/rst/installing/mysql.rst @@ -0,0 +1,143 @@ +.. _mysql: + +MySQL +##### + +You need MySQL version 5.0.15 or higher. + +It's possible to test which version of MySQL you have installed with: + +:command:`mysql -V` + +Installing +========== + +Windows +------- + +Download the MySQL 32-bit or 64-bit MSI installer from the +`MySQL website <http://www.mysql.com/downloads/mysql/>`_ (~28 MB). + +MySQL has a standard Windows installer. It's ok to select a Typical MySQL +install (the default). The rest of this documentation assumes assume you +have installed MySQL into :file:`C:\\mysql`. Adjust paths appropriately if not. + +Linux/Mac OS X +-------------- + +The package install instructions given previously should have installed MySQL +on your machine, if it didn't come with it already. Run: + +:command:`mysql_secure_installation` + +and follow its advice. + +If you did install MySQL manually rather than from a package, make sure the +server is started when the machine boots. + +.. _mysql-add-user: + +Add a User +========== + +You need to add a new MySQL user for Bugzilla to use. Run the :file:`mysql` +command-line client and enter: + +:: + + GRANT SELECT, INSERT, + UPDATE, DELETE, INDEX, ALTER, CREATE, LOCK TABLES, + CREATE TEMPORARY TABLES, DROP, REFERENCES ON bugs.* + TO bugs@localhost IDENTIFIED BY '$DB_PASS'; + + FLUSH PRIVILEGES; + +You need to replace ``$DB_PASS`` with a strong password you have chosen. +Write that password down somewhere. + +The above command permits an account called ``bugs`` +to connect from the local machine, ``localhost``. Modify the command to +reflect your setup if you will be connecting from another +machine or as a different user. + +Change Configuration +==================== + +To change MySQL's configuration, you need to edit your MySQL +configuration file, which is: + +* Red Hat/Fedora: :file:`/etc/my.cnf` +* Debian/Ubuntu: :file:`/etc/mysql/my.cnf` +* Windows: :file:`C:\\mysql\\bin\\my.ini` +* Mac OS X: :file:`/etc/my/cnf` + +.. _mysql-max-allowed-packet: + +Allow Large Attachments and Many Comments +----------------------------------------- + +By default on some systems, MySQL will only allow you to insert things +into the database that are smaller than 1MB. + +Bugzilla attachments +may be larger than this. Also, Bugzilla combines all comments +on a single bug into one field for full-text searching, and the +combination of all comments on a single bug could in some cases +be larger than 1MB. + +We recommend that you allow at least 16MB packets by +adding or altering the ``max_allowed_packet`` parameter in your MySQL +configuration in the ``[mysqld]`` section, so that the number is at least +16M, like this (note that it's ``M``, not ``MB``): + +:: + + [mysqld] + # Allow packets up to 16M + max_allowed_packet=16M + +.. _mysql-small-words: + +Allow Small Words in Full-Text Indexes +-------------------------------------- + +By default, words must be at least four characters in length +in order to be indexed by MySQL's full-text indexes. This causes +a lot of Bugzilla-specific words to be missed, including "cc", +"ftp" and "uri". + +MySQL can be configured to index those words by setting the +``ft_min_word_len`` param to the minimum size of the words to index. + +:: + + [mysqld] + # Allow small words in full-text indexes + ft_min_word_len=2 + +.. _mysql-attach-table-size: + +Permit Attachments Table to Grow Beyond 4GB +=========================================== + +This is optional configuration for Bugzillas which are expected to become +very large, and needs to be done after Bugzilla is fully installed. + +By default, MySQL will limit the size of a table to 4GB. +This limit is present even if the underlying filesystem +has no such limit. To set a higher limit, run the :file:`mysql` +command-line client and enter the following, replacing ``$bugs_db`` +with your Bugzilla database name (which is ``bugs`` by default): + +.. code-block:: sql + + USE $bugs_db; + + ALTER TABLE attachments AVG_ROW_LENGTH=1000000, MAX_ROWS=20000; + +The above command will change the limit to 20GB. MySQL will have +to make a temporary copy of your entire table to do this, so ideally +you should do this when your attachments table is still small. + +.. note:: If you have set the setting in Bugzilla which allows large + attachments to be stored on disk, the above change does not affect that. diff --git a/docs/en/rst/installing/optional-post-install-config.rst b/docs/en/rst/installing/optional-post-install-config.rst new file mode 100644 index 000000000..91d5245d1 --- /dev/null +++ b/docs/en/rst/installing/optional-post-install-config.rst @@ -0,0 +1,154 @@ +.. _optional-post-install-config: + +Optional Post-Install Configuration +################################### + +Bugzilla has a number of optional features. This section describes how +to configure or enable them. + +.. _recurring-tasks: + +Recurring Tasks +=============== + +Several of the below features require you to set up a script to run at +recurring intervals. The method of doing this varies by operating system. + +Linux +----- + +Run: + +:command:`crontab -e` + +This should bring up the crontab file in your editor. Add the relevant +cron line from the sections below in order to enable the corresponding +feature. + +Windows +------- + +Windows comes with a Task Scheduler. To run a particular script, do the +following: + +#. :guilabel:`Control Panel` --> :guilabel:`Scheduled Tasks` --> + :guilabel:`Add Scheduled Task` + +#. Next + +#. Browse + +#. Find :file:`perl.exe` (normally :file:`C:\\Perl\\bin\\perl.exe`) + +#. Give the task a name, such as "Bugzilla <scriptname>" + +#. Request the task be performed at your desired time and interval + +#. If you're running Apache as a user, not as SYSTEM, enter that user + here. Otherwise you're best off creating an account that has write access + to the Bugzilla directory and using that + +#. Tick "Open Advanced Properties.." and click Finish + +#. Append the script name to the end of the "Run" field. eg + :command:`C:\\Perl\\bin\\perl.exe C:\\Bugzilla\\<scriptname>` + +#. Change "start in" to the Bugzilla directory + +.. _installation-bug-graphs: + +Bug Graphs +========== + +If you have installed the necessary Perl modules, as indicated by +:file:`checksetup.pl`, you can ask Bugzilla to regularly collect statistics +so that you can see graphs and charts. + +On Linux, use a cron line as follows: + +.. code-block:: none + + 5 0 * * * cd <your-bugzilla-directory> && ./collectstats.pl + +On Windows, schedule the :file:`collectstats.pl` script to run daily. + +After two days have passed you'll be able to view bug graphs from +the Reports page. + +.. _installation-whining: + +Whining +======= + +Users can configure Bugzilla to annoy them at regular intervals, by having +Bugzilla execute saved searches at certain times and emailing the results to +the user. This is known as "Whining". The details of how a user configures +Whining is described in :ref:`whining`, but for it to work a Perl script must +be executed at regular intervals. + +On Linux, use a cron line as follows: + +.. code-block:: none + + */15 * * * * cd <your-bugzilla-directory> && ./whine.pl + +On Windows, schedule the :file:`whine.pl` script to run every 15 minutes. + +.. _installation-whining-cron: + +Whining at Untriaged Bugs +========================= + +It's possible for bugs to languish in an untriaged state. Bugzilla has a +specific system to issue complaints about this particular problem to all the +relevant engineers automatically by email. + +On Linux, use a cron line as follows: + +.. code-block:: none + + 55 0 * * * cd <your-bugzilla-directory> && ./whineatnews.pl + +On Windows, schedule the :file:`whineatnews.pl` script to run daily. + +Dependency Graphs +================= + +Bugzilla can draw graphs of the dependencies (depends on/blocks relationships) +between bugs, if you install a package called :file:`dot`. + +Linux +----- + +Put the complete path to the :file:`dot` command (from the ``graphviz`` +package) in the :param:`webdotbase` parameter. E.g. :paramval:`/usr/bin/dot`. + +Windows +------- + +Download and install Graphviz from +`the Graphviz website <http://www.graphviz.org/Download_windows.php>`_. Put +the complete path to :file:`dot.exe` in the :param:`webdotbase` parameter, +using forward slashes as path separators. E.g. +:paramval:`C:/Program Files/ATT/Graphviz/bin/dot.exe`. + +Documentation +============= + +Bugzilla has extensive documentation and help, written in +`reStructured Text <http://sphinx-doc.org/rest.html>`_ +format. A generic compiled copy exists on +`bugzilla.readthedocs.org <https://bugzilla.readthedocs.org/>`_, and +:guilabel:`Help` links point to it by default. If you want to build and use a +local copy of the documentation, perhaps because you have added Bugzilla +extensions which come with documentation, or because your users don't have +Internet access from their machines, then: + +* Install `Sphinx <http://sphinx-doc.org/>`_ + (:file:`python-sphinx` package on Debian/Ubuntu) + +Then run :command:`docs/makedocs.pl` in your Bugzilla directory. + +Bugzilla will automatically detect that you've compiled the documentation +and link to it in preference to the copy on the Internet. Don't forget to +recompile it when you upgrade Bugzilla or install new extensions. diff --git a/docs/en/rst/installing/oracle.rst b/docs/en/rst/installing/oracle.rst new file mode 100644 index 000000000..860b61fe6 --- /dev/null +++ b/docs/en/rst/installing/oracle.rst @@ -0,0 +1,69 @@ +.. _oracle: + +Oracle +###### + +.. warning:: Bugzilla supports Oracle, but none of the current developers run + it. Your mileage may vary. + +You need Oracle version 10.02.0 or later. + +.. _oracle-tablespace: + +Create a New Tablespace +======================= + +You can use the existing tablespace or create a new one for Bugzilla. +To create a new tablespace, run the following command: + +:: + + CREATE TABLESPACE bugs + DATAFILE '*$path_to_datafile*' SIZE 500M + AUTOEXTEND ON NEXT 30M MAXSIZE UNLIMITED + +Here, the name of the tablespace is 'bugs', but you can +choose another name. *$path_to_datafile* is +the path to the file containing your database, for instance +:file:`/u01/oradata/bugzilla.dbf`. +The initial size of the database file is set in this example to 500 Mb, +with an increment of 30 Mb everytime we reach the size limit of the file. + +.. _oracle-add-user: + +Add a User to Oracle +==================== + +The user name and password must match what you set in :file:`localconfig` +(``$db_user`` and ``$db_pass``, respectively). Here, we assume that +the user name is 'bugs' and the tablespace name is the same +as above. + +:: + + CREATE USER bugs + IDENTIFIED BY "$db_pass" + DEFAULT TABLESPACE bugs + TEMPORARY TABLESPACE TEMP + PROFILE DEFAULT; + -- GRANT/REVOKE ROLE PRIVILEGES + GRANT CONNECT TO bugs; + GRANT RESOURCE TO bugs; + -- GRANT/REVOKE SYSTEM PRIVILEGES + GRANT UNLIMITED TABLESPACE TO bugs; + GRANT EXECUTE ON CTXSYS.CTX_DDL TO bugs; + +.. _oracle_webserver: + +Configure the Web Server +======================== + +If you use Apache, append these lines to :file:`httpd.conf` +to set ORACLE_HOME and LD_LIBRARY_PATH. For instance: + +.. code-block:: apache + + SetEnv ORACLE_HOME /u01/app/oracle/product/10.2.0/ + SetEnv LD_LIBRARY_PATH /u01/app/oracle/product/10.2.0/lib/ + +When this is done, restart your web server. diff --git a/docs/en/rst/installing/postgresql.rst b/docs/en/rst/installing/postgresql.rst new file mode 100644 index 000000000..1d0ec1d49 --- /dev/null +++ b/docs/en/rst/installing/postgresql.rst @@ -0,0 +1,58 @@ +.. _postgresql: + +PostgreSQL +########## + +Test which version of PostgreSQL you have installed with: + +:command:`psql -V` + +You need PostgreSQL version 8.03.0000 or higher. + +If you install PostgreSQL manually rather than from a package, make sure the +server is started when the machine boots. + +.. _posgresql-add-user: + +Add a User +========== + +You need to add a new user to PostgreSQL for the Bugzilla +application to use when accessing the database. The following instructions +assume the defaults in :file:`localconfig`; if you +changed those, you need to modify the commands appropriately. + +On most systems, to create a user in PostgreSQL, login as the root user, and +then switch to being the postgres (Unix) user: + +:command:`su - postgres` + +As the postgres user, you then need to create a new user: + +:command:`createuser -U postgres -dRSP bugs` + +When asked for a password, provide one and write it down for later reference. + +The created user will not be a superuser (-S) and will not be able to create +new users (-R). He will only have the ability to create databases (-d). + +.. _postgresql-access: + +Permit Access +============= + +Edit the file :file:`pg_hba.conf` which is +usually located in :file:`/var/lib/pgsql/data/`. In this file, +you will need to add a new line to it as follows: + +:: + + host all bugs 127.0.0.1 255.255.255.255 md5 + +This means that for TCP/IP (host) connections, allow connections from +'127.0.0.1' to 'all' databases on this server from the 'bugs' user, and use +password authentication ('md5') for that user. + +Now, you will need to stop and start PostgreSQL fully. (Do not use any +'restart' command, due to the possibility of a change to +:file:`postgresql.conf`.) diff --git a/docs/en/rst/installing/quick-start.rst b/docs/en/rst/installing/quick-start.rst new file mode 100644 index 000000000..ace2106ee --- /dev/null +++ b/docs/en/rst/installing/quick-start.rst @@ -0,0 +1,223 @@ +.. _quick-start: + +Quick Start (Ubuntu Linux 14.04) +################################ + +This quick start guide makes installing Bugzilla as simple as possible for +those who are able to choose their environment. It creates a system using +Ubuntu Linux 14.04 LTS, Apache and MySQL, and installs Bugzilla as the default +home page. It requires a little familiarity with Linux and the command line. + +Obtain Your Hardware +==================== + +Ubuntu 14.04 LTS Server requires a 64-bit processor. +Bugzilla itself has no prerequisites beyond that, although you should pick +reliable hardware. You can also probably use any 64-bit virtual machine +or cloud instance that you have root access on. + +Install the OS +============== + +Get `Ubuntu Server 14.04 LTS <http://www.ubuntu.com/download/server>`_ +and follow the `installation instructions <http://www.ubuntu.com/download/server/install-ubuntu-server>`_. +Here are some tips: + +* Choose any server name you like. +* When creating the initial Linux user, call it ``bugzilla``, give it a + strong password, and write that password down. +* You do not need an encrypted home directory. +* Choose all the defaults for the "partitioning" part (excepting of course + where the default is "No" and you need to press "Yes" to continue). +* Choose "install security updates automatically" unless you want to do + them manually. +* From the install options, choose "OpenSSH Server" and "LAMP Server". +* Set the password for the MySQL root user to a strong password, and write + that password down. +* Install the Grub boot loader to the Master Boot Record. + +Reboot when the installer finishes. + +Become root +=========== + +ssh to the machine as the 'bugzilla' user, or start a console. Then: + +:command:`sudo su` + +Install Prerequisites +===================== + +:command:`apt-get install git nano` + +:command:`apt-get install apache2 mysql-server libappconfig-perl libdate-calc-perl libtemplate-perl libmime-perl build-essential libdatetime-timezone-perl libdatetime-perl libemail-sender-perl libemail-mime-perl libemail-mime-modifier-perl libdbi-perl libdbd-mysql-perl libcgi-pm-perl libmath-random-isaac-perl libmath-random-isaac-xs-perl apache2-mpm-prefork libapache2-mod-perl2 libapache2-mod-perl2-dev libchart-perl libxml-perl libxml-twig-perl perlmagick libgd-graph-perl libtemplate-plugin-gd-perl libsoap-lite-perl libhtml-scrubber-perl libjson-rpc-perl libdaemon-generic-perl libtheschwartz-perl libtest-taint-perl libauthen-radius-perl libfile-slurp-perl libencode-detect-perl libmodule-build-perl libnet-ldap-perl libauthen-sasl-perl libtemplate-perl-doc libfile-mimeinfo-perl libhtml-formattext-withlinks-perl libgd-dev lynx-cur python-sphinx` + +This will take a little while. It's split into two commands so you can do +the next steps (up to step 7) in another terminal while you wait for the +second command to finish. If you start another terminal, you will need to +:command:`sudo su` again. + +Download Bugzilla +================= + +Get it from our Git repository: + +:command:`cd /var/www` + +:command:`rm -rf html` + +:command:`git clone --branch bugzilla-X.X-stable https://git.mozilla.org/bugzilla/bugzilla html` + +(where "X.X" is the 2-digit version number of the stable release of Bugzilla +that you want - e.g. 4.4) + +:command:`cd html` + +Configure MySQL +=============== + +The following instructions use the simple :file:`nano` editor, but feel +free to use any text editor you are comfortable with. + +:command:`nano /etc/mysql/my.cnf` + +Set the following values, which increase the maximum attachment size and +make it possible to search for short words and terms: + +* Alter on Line 52: ``max_allowed_packet=100M`` +* Add as new line 31, in the ``[mysqld]`` section: ``ft_min_word_len=2`` + +Save and exit. + +Then, add a user to MySQL for Bugzilla to use: + +:command:`mysql -u root -p -e "GRANT ALL PRIVILEGES ON bugs.* TO bugs@localhost IDENTIFIED BY '$db_pass'"` + +Replace ``$db_pass`` with a strong password you have generated. Write it down. +When you run the above command, it will prompt you for the MySQL root password +that you configured when you installed Ubuntu. You should make ``$db_pass`` +different to that password. + +Restart MySQL: + +:command:`service mysql restart` + +Configure Apache +================ + +:command:`nano /etc/apache2/sites-available/bugzilla.conf` + +Paste in the following and save: + +.. code-block:: apache + + ServerName localhost + + <Directory /var/www/html> + AddHandler cgi-script .cgi + Options +ExecCGI + DirectoryIndex index.cgi index.html + AllowOverride Limit FileInfo Indexes Options + </Directory> + +:command:`a2ensite bugzilla` + +:command:`a2enmod cgi headers expires` + +:command:`service apache2 restart` + +Check Setup +=========== + +Bugzilla comes with a :file:`checksetup.pl` script which helps with the +installation process. It will need to be run twice. The first time, it +generates a config file (called :file:`localconfig`) for the database +access information, and the second time (step 10) +it uses the info you put in the config file to set up the database. + +:command:`cd /var/www/html` + +:command:`./checksetup.pl` + +Edit :file:`localconfig` +======================== + +:command:`nano localconfig` + +You will need to set the following values: + +* Line 29: set ``$webservergroup`` to ``www-data`` +* Line 67: set ``$db_pass`` to the password for the ``bugs`` user you created + in MySQL a few steps ago + +Check Setup (again) +=================== + +Run the :file:`checksetup.pl` script again to set up the database. + +:command:`./checksetup.pl` + +It will ask you to give an email address, real name and password for the +first Bugzilla account to be created, which will be an administrator. +Write down the email address and password you set. + +Test Server +=========== + +:command:`./testserver.pl http://localhost/` + +All the tests should pass. You will get warnings about deprecation from +the ``Chart::Base`` Perl module; just ignore those. + +.. todo:: Chart::Base gives confusing deprecation warnings :-| + https://rt.cpan.org/Public/Bug/Display.html?id=79658 , unfixed for + 2 years. :bug:`1070117`. + +Access Via Web Browser +====================== + +Access the front page: + +:command:`lynx http://localhost/` + +It's not really possible to use Bugzilla for real through Lynx, but you +can view the front page to validate visually that it's up and running. + +You might well need to configure your DNS such that the server has, and +is reachable by, a name rather than IP address. Doing so is out of scope +of this document. In the mean time, it is available on your local network +at ``http://<ip address>/``, where ``<ip address>`` is (unless you have +a complex network setup) the "inet addr" value displayed when you run +:command:`ifconfig eth0`. + +Configure Bugzilla +================== + +Once you have worked out how to access your Bugzilla in a graphical +web browser, bring up the front page, click :guilabel:`Log In` in the +header, and log in as the admin user you defined in step 10. + +Click the :guilabel:`Parameters` link on the page it gives you, and set +the following parameters in the :guilabel:`Required Settings` section: + +* :param:`urlbase`: + :paramval:`http://<servername>/` or :paramval:`http://<ip address>/` + +Click :guilabel:`Save Changes` at the bottom of the page. + +There are several ways to get Bugzilla to send email. The easiest is to +use Gmail, so we do that here so you have it working. Visit +https://gmail.com and create a new Gmail account for your Bugzilla to use. +Then, open the :guilabel:`Email` section of the Parameters using the link +in the left column, and set the following parameter values: + +* :param:`mail_delivery_method`: :paramval:`SMTP` +* :param:`mailfrom`: :paramval:`new_gmail_address@gmail.com` +* :param:`smtpserver`: :paramval:`smtp.gmail.com:465` +* :param:`smtp_username`: :paramval:`new_gmail_address@gmail.com` +* :param:`smtp_password`: :paramval:`new_gmail_password` +* :param:`smtp_ssl`: :paramval:`On` + +Click :guilabel:`Save Changes` at the bottom of the page. + +And you're all ready to go. :-) diff --git a/docs/en/rst/installing/sanity-check.rst b/docs/en/rst/installing/sanity-check.rst new file mode 100644 index 000000000..4f8fb11c6 --- /dev/null +++ b/docs/en/rst/installing/sanity-check.rst @@ -0,0 +1,26 @@ +.. _sanity-check: + +Sanity Check +############ + +Over time it is possible for the Bugzilla database to become corrupt +or to have anomalies. This could happen through manual database +administration outside of the Bugzilla user interface, or from some +other unexpected event. Bugzilla includes a "Sanity Check" that +can perform several basic database checks, and repair certain problems or +inconsistencies. + +To run a Sanity Check, log in as an Administrator and click the +:guilabel:`Sanity Check` link in the admin page. Any problems that are found +will be displayed in red letters. If the script is capable of fixing a +problem, it will present a link to initiate the fix. If the script cannot +fix the problem it will require manual database administration or recovery. + +Sanity Check can also be run from the command line via the perl +script :file:`sanitycheck.pl`. The script can also be run as +a :command:`cron` job. Results will be delivered by email to an address +specified on the command line. + +Sanity Check should be run on a regular basis as a matter of +best practice. + diff --git a/docs/en/rst/installing/sqlite.rst b/docs/en/rst/installing/sqlite.rst new file mode 100644 index 000000000..bf5953666 --- /dev/null +++ b/docs/en/rst/installing/sqlite.rst @@ -0,0 +1,14 @@ +.. _sqlite: + +SQLite +###### + +.. warning:: Due to SQLite's `concurrency + limitations <http://sqlite.org/faq.html#q5>`_ we recommend SQLite only for + small and development Bugzilla installations. + +Once you have SQLite installed, no additional configuration is required to +run Bugzilla. + +The database will be stored in :file:`$BUGZILLA_HOME/data/db/$db_name`, where +``$db_name`` is the database name defined in :file:`localconfig`. diff --git a/docs/en/rst/installing/upgrading-customizations.rst b/docs/en/rst/installing/upgrading-customizations.rst new file mode 100644 index 000000000..c99c6a9f7 --- /dev/null +++ b/docs/en/rst/installing/upgrading-customizations.rst @@ -0,0 +1,20 @@ +.. _upgrading-customizations: + +Upgrading a Customized or Extended Bugzilla +########################################### + +If your Bugzilla has been customized or uses extensions, you will need to +make your customizations or extensions work with your new version of Bugzilla. +If this is the case, you are particularly strongly recommended to do a test +upgrade on a test system and use that to help you port forward your +customizations. + +If your extension came from a third party, look to see if an updated version +is available for the version of Bugzilla you are upgrading to. If not, and +you want to continue using it, you'll need to port it forward yourself. + +If you are upgrading from a version of Bugzilla earlier than 3.6 and have +extensions for which a newer version is not available from an upstream source, +then you need to convert them. This is because the extension format changed +in version 3.6. There is a file called :file:`extension-convert.pl` in the +:file:`contrib` directory which may be able to help you with that. diff --git a/docs/en/rst/installing/upgrading-with-1.inc.rst b/docs/en/rst/installing/upgrading-with-1.inc.rst new file mode 100644 index 000000000..4861f6ea9 --- /dev/null +++ b/docs/en/rst/installing/upgrading-with-1.inc.rst @@ -0,0 +1,41 @@ +Before You Upgrade +================== + +Before you start your upgrade, there are a few important +steps to take: + +#. Read the + `Release Notes <http://www.bugzilla.org/releases/>`_ of the version you're + upgrading to and all intermediate versions, particularly the "Notes for + Upgraders" sections, if present. They may make you aware of additional + considerations. + +#. Run the :ref:`sanity-check` on your installation. Attempt to fix all + warnings that the page produces before you start, or it's + possible that you may experience problems during your upgrade. + +#. Work out how to :ref:`back up <backups>` your Bugzilla entirely, and + how to restore from a backup if need be. + +Customized Bugzilla? +-------------------- + +If you have modified the code or templates of your Bugzilla, +then upgrading requires a bit more thought and effort than the simple process +below. See :ref:`template-method` for a discussion of the various methods of +code customization that may have been used. + +The larger the jump you are trying to make, the more difficult it +is going to be to upgrade if you have made local code customizations. +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 +the same amount of work regardless of how long it has been since +your version was released. + +If you have made customizations, you should do the upgrade on a test system +with the same configuration and make sure all your customizations still work. +If not, port and test them so you have them ready to reapply once you do +the upgrade for real. diff --git a/docs/en/rst/installing/upgrading-with-2.inc.rst b/docs/en/rst/installing/upgrading-with-2.inc.rst new file mode 100644 index 000000000..d8e2dbfaa --- /dev/null +++ b/docs/en/rst/installing/upgrading-with-2.inc.rst @@ -0,0 +1,32 @@ +Upgrading the Database +====================== + +Run :file:`checksetup.pl`. This will do everything required to convert +your existing database and settings to the new version. + +:command:`cd $BUGZILLA_HOME` + +:command:`./checksetup.pl` + + .. warning:: For some upgrades, running :file:`checksetup.pl` on a large + installation (75,000 or more bugs) can take a long time, + possibly several hours, if e.g. indexes need to be rebuilt. If this + length of downtime would be a problem for you, you can determine + timings for your particular situation by doing a test upgrade on a + development server with the production data. + +:file:`checksetup.pl` may also tell you that you need some additional +Perl modules, or newer versions of the ones you have. You will need to +install these, either system-wide or using the :file:`install-module.pl` +script that :file:`checksetup.pl` recommends. + +Finishing The Upgrade +===================== + +#. Reactivate Bugzilla by clear the text that you put into the + :param:`shutdownhtml` parameter. + +#. Run another :ref:`sanity-check` on your + upgraded Bugzilla. It is recommended that you fix any problems + you see immediately. Failure to do this may mean that Bugzilla + may not work entirely correctly. diff --git a/docs/en/rst/installing/upgrading-with-a-tarball.rst b/docs/en/rst/installing/upgrading-with-a-tarball.rst new file mode 100644 index 000000000..2bbfb3158 --- /dev/null +++ b/docs/en/rst/installing/upgrading-with-a-tarball.rst @@ -0,0 +1,74 @@ +.. _upgrading-with-a-tarball: + +Upgrading with a Tarball +######################## + +If you are unable (or unwilling) to use Git, another option is to obtain a +tarball of the latest version from our website and upgrade your Bugzilla +installation using that. + +Without a source code management system to help you, the process may be +trickier. + +.. include:: upgrading-with-1.inc.rst + +As you are using a tarball and not an SCM, it's not at all easy to see if +you've made local code customizations. You may have to use institutional +knowledge, or download a fresh copy of your *current* version of Bugzilla +and compare the two directories. If you find that you have, you'll need +to turn them into a patch file, perhaps by diffing the two directories, +and then reapply that patch file later. If you are customizing Bugzilla +locally, please consider +:ref:`rebasing your install on top of git <migrating-from-a-tarball>`. + +.. _upgrade-files-tarball: + +Getting The New Bugzilla +======================== + +Download a copy of the latest version of Bugzilla from the +`Download Page <http://www.bugzilla.org/download/>`_ into a separate +directory (which we will call :file:`bugzilla-new`) alongside your existing +Bugzilla installation (which we will assume is in a directory called +:file:`bugzilla`). + +Copy Across Data and Modules +============================ + +Copy the contents of the following directories from your current installation +of Bugzilla into the corresponding directory in :file:`bugzilla-new/`: + +.. code-block:: none + + lib/ + data/ + template/en/custom (may or may not exist) + +You also need to copy any extensions you have written or installed, which are +in the :file:`extensions/` directory. Bugzilla ships with some extensions, +so again if you want to know if any of the installed extensions are yours, +you may have to compare with a clean copy of your current version. You can +disregard any which have a :file:`disabled` file - those are not enabled. + +Lastly, copy the following file from your current installation of Bugzilla +into the corresponding place in :file:`bugzilla-new/`: + +.. code-block:: none + + localconfig + +This file contains your database password and access details. + +Swap The New Version In +======================= + +Now we swap the directories over. From the directory containing the +:file:`bugzilla` and :file:`bugzilla-new` directories, run: + +:command:`mv bugzilla bugzilla-old` + +:command:`mv bugzilla-new bugzilla` + +:command:`cd bugzilla` + +.. include:: upgrading-with-2.inc.rst diff --git a/docs/en/rst/installing/upgrading-with-git.rst b/docs/en/rst/installing/upgrading-with-git.rst new file mode 100644 index 000000000..78b4fb1e0 --- /dev/null +++ b/docs/en/rst/installing/upgrading-with-git.rst @@ -0,0 +1,69 @@ +.. _upgrading-with-git: + +Upgrading with Git +################## + +Upgrading to new Bugzilla releases is very simple, and you can upgrade +from any version to any later version in one go - there is no need for +intermediate steps. There is a script named :file:`checksetup.pl` included +with Bugzilla that will automatically do all of the database migration +for you. + +.. include:: upgrading-with-1.inc.rst + +You can see if you have local code customizations using: + +:command:`git diff` + +If that comes up empty, then run: + +:command:`git log | head` + +and see if the last commit looks like one made by the Bugzilla team, or +by you. If it looks like it was made by us, then you have made no local +code customizations. + +.. _start-upgrade-git: + +Starting the Upgrade +==================== + +When you are ready to go: + +#. Shut down your Bugzilla installation by putting some explanatory text + in the :param:`shutdownhtml` parameter. + +#. Make all necessary :ref:`backups <backups>`. + *THIS IS VERY IMPORTANT*. If anything goes wrong during the upgrade, + having a backup allows you to roll back to a known good state. + +.. _upgrade-files-git: + +Getting The New Bugzilla +======================== + +In the commands below, ``$BUGZILLA_HOME`` represents the directory +in which Bugzilla is installed. Assuming you followed the installation +instructions and your Bugzilla is a checkout of a stable branch, +you can get the latest point release of your current version by simply doing: + +:command:`cd $BUGZILLA_HOME` + +:command:`git pull` + +If you want to upgrade to a newer release of Bugzilla, then you will +additionally need to do: + +:command:`git checkout bugzilla-X.X-stable` + +where "X.X" is the 2-digit version number of the stable version you want to +upgrade to (e.g. "4.4"). + +.. note:: Do not attempt to downgrade Bugzilla this way - it won't work. + +If you have local code customizations, git will attempt to merge them. If +it fails, then you should implement the plan you came up with when you +detected these customizations in the step above, before you started the +upgrade. + +.. include:: upgrading-with-2.inc.rst diff --git a/docs/en/rst/installing/upgrading.rst b/docs/en/rst/installing/upgrading.rst new file mode 100644 index 000000000..f43897fb3 --- /dev/null +++ b/docs/en/rst/installing/upgrading.rst @@ -0,0 +1,70 @@ +.. _upgrading: + +Upgrading +######### + +You can upgrade Bugzilla from any version to any later version in one go - +there is no need to pass through intermediate versions unless you are changing +the method by which you obtain the code along the way. + +.. warning:: Upgrading is a one-way process. You cannot "downgrade" an + upgraded Bugzilla. If you wish to revert to the old Bugzilla + version for any reason, you will have to restore your system + from a backup. Those with critical data or large installations may wish + to test the upgrade on a development server first, using a copy of the + production data and configuration. + +Bugzilla uses the Git version control system to store its code. A modern +Bugzilla installation consists of a checkout of a stable version of the code +from our Git repository. This makes upgrading much easier. If this is +already true of your installation, see :ref:`upgrading-with-git`. + +Before Git, we used to use Bazaar and, before that, CVS. If your installation +of Bugzilla consists of a checkout from one of those two systems, you need to +upgrade in three steps: + +1. Upgrade to the latest point release of your current Bugzilla version. +2. Move to Git while staying on exactly the same release. +3. Upgrade to the latest Bugzilla using the instructions for :ref:`upgrading-with-git`. + +See :ref:`migrating-from-bazaar` or :ref:`migrating-from-cvs` as appropriate. + +Some Bugzillas were installed simply by downloading a copy of the code as +an archive file ("tarball"). However, recent tarballs have included source +code management system information, so you may be able to use the Git, Bzr +or CVS instructions. + +If you aren't sure which of these categories you fall into, to find out which +version control system your copy of Bugzilla recognizes, look for the +following subdirectories in your root Bugzilla directory: + +* :file:`.git`: you installed using Git - follow :ref:`upgrading-with-git`. +* :file:`.bzr`: you installed using Bazaar - follow :ref:`migrating-from-bazaar`. +* :file:`CVS`: you installed using CVS - follow :ref:`migrating-from-cvs`. +* None of the above: you installed using an old tarball - follow + :ref:`migrating-from-a-tarball`. + +It is also possible, particularly if your server machine does not have and +cannot be configured to have access to the public internet, to upgrade using +a tarball. See :ref:`upgrading-with-a-tarball`. + +Whichever path you use, you may need help with +:ref:`upgrading-customizations`. + +.. toctree:: + :maxdepth: 1 + + upgrading-with-git + migrating-from-bzr + migrating-from-cvs + migrating-from-a-tarball + upgrading-with-a-tarball + upgrading-customizations + +Bugzilla can automatically notify administrators when new releases are +available if the :param:`upgrade_notification` parameter is set. +Administrators will see these notifications when they access the Bugzilla home +page. Bugzilla will check once per day for new releases. If you are behind a +proxy, you may have to set the :param:`proxy_url` parameter accordingly. If +the proxy requires authentication, use the +:paramval:`http://user:pass@proxy_url/` syntax. diff --git a/docs/en/rst/installing/windows.rst b/docs/en/rst/installing/windows.rst new file mode 100644 index 000000000..c182bd084 --- /dev/null +++ b/docs/en/rst/installing/windows.rst @@ -0,0 +1,174 @@ +.. _windows: + +Windows +####### + +Making Bugzilla work on Windows is more difficult than making it work on Unix, +fewer Bugzilla developers use it and so it's less well supported. We would +particularly recommend against doing it for a large site. However, if +you are still determined to go ahead, here's how. + +.. windows-install-perl: + +ActiveState Perl +================ + +ActiveState make a popular distribution of Perl for Windows. + +Download the ActiveState Perl 5.12.4 or higher MSI installer from the +`ActiveState website <http://www.activestate.com/activeperl/downloads>`_. + +ActiveState Perl uses a standard Windows Installer. Install, sticking with +the defaults, which will install Perl into :file:`C:\\Perl`. It is not +recommended to install Perl into a directory containing a space, such as +:file:`C:\\Program Files`. + +Once the install has completed, log out and log in again to pick up the +changes to the ``PATH`` environment variable. + +.. _windows-install-bzfiles: + +Bugzilla +======== + +The best way to get Bugzilla is to check it out from git. Download and install +git from the `git website <http://git-scm.com/download>`_, and then run: + +:command:`git clone --branch bugzilla-X.X-stable https://git.mozilla.org/bugzilla/bugzilla C:\\bugzilla` + +where "X.X" is the 2-digit version number of the stable release of Bugzilla +that you want (e.g. 4.4). + +The rest of this documentation assumes you have installed Bugzilla into +:file:`C:\\bugzilla`. Adjust paths appropriately if not. + +If it's not possible to use git (e.g. because your Bugzilla machine has no +internet access), you can +`download a tarball of Bugzilla <http://www.bugzilla.org/download/>`_ and +copy it across. Bugzilla comes as a 'tarball' (:file:`.tar.gz` extension), +which any competent Windows archiving tool should be able to open. + +.. windows-install-perl-modules: + +Perl Modules +============ + +Bugzilla requires a number of perl modules to be installed. They are +available in the ActiveState repository, and are installed with the +:file:`ppm` tool. You can either use it on the command line, as below, +or just type :command:`ppm`, and you will get a GUI. + +If you use a proxy server or a firewall you may have trouble running PPM. +This is covered in the +`ActivePerl FAQ <http://aspn.activestate.com/ASPN/docs/ActivePerl/faq/ActivePerl-faq2.html#ppm_and_proxies>`_. + +Install the following modules with: + +:command:`ppm install <modulename>` + +* CGI.pm +* Digest-SHA +* TimeDate +* DateTime +* DateTime-TimeZone +* DBI +* Template-Toolkit +* Email-Sender +* Email-MIME +* URI +* List-MoreUtils +* Math-Random-ISAAC +* File-Slurp +* JSON-XS +* Win32 +* Win32-API + +The following modules enable various optional Bugzilla features; try and +install them, but don't worry too much to begin with if you can't get them +installed: + +* GD +* Chart +* Template-GD +* GDTextUtil +* GDGraph +* MIME-tools +* libwww-perl +* XML-Twig +* PatchReader +* perl-ldap +* Authen-SASL +* Net-SMTP-SSL +* RadiusPerl +* SOAP-Lite +* XMLRPC-Lite +* JSON-RPC +* Test-Taint +* HTML-Parser +* HTML-Scrubber +* Encode +* Encode-Detect +* Email-Reply +* HTML-FormatText-WithLinks +* TheSchwartz +* Daemon-Generic +* mod_perl +* Apache-SizeLimit +* File-MimeInfo +* IO-stringy +* Cache-Memcached +* File-Copy-Recursive +* GraphViz + +.. warning:: These lists have been extracted from Bugzilla's source code and + have not been tested. Please let us know if you find errors in it + of any sort. + +.. note:: The :file:`install-module.pl` script doesn't work with ActivePerl + on Windows. + +.. _windows-config-webserver: + +Web Server +========== + +Any web server that is capable of running CGI scripts can be made to work. +We have specific instructions for the following: + +* :ref:`apache-windows` +* :ref:`iis` + +.. windows-config-database: + +Database Engine +=============== + +Bugzilla supports MySQL, PostgreSQL, Oracle and SQLite as database servers. +You only require one of these systems to make use of Bugzilla. MySQL is +most commonly used, and is the only one for which Windows instructions have +been tested. SQLite is good for trial installations as it requires no +setup. Configure your server according to the instructions below: + +* :ref:`mysql` +* :ref:`postgresql` +* :ref:`oracle` +* :ref:`sqlite` + +.. |checksetupcommand| replace:: :command:`checksetup.pl` +.. |testservercommand| replace:: :command:`testserver.pl http://<your-bugzilla-server>/` + +.. include:: installing-end.inc.rst + +If you don't see the main Bugzilla page, but instead see "It works!!!", +then somehow your Apache has not picked up your modifications to +:file:`httpd.conf`. If you are on Windows 7 or later, this could be due to a +new feature called "VirtualStore". `This blog post +<http://blog.netscraps.com/bugs/apache-httpd-conf-changes-ignored-in-windows-7.html>`_ +may help to solve the problem. + +If you get an "Internal Error..." message, it could be that +``ScriptInterpreterSource Registry-Strict`` is not set in your +:ref:`Apache configuration <apache-windows>`. Check again if it is set +properly. + +Next, do the :ref:`essential-post-install-config`. diff --git a/docs/en/rst/integrating/apis.rst b/docs/en/rst/integrating/apis.rst new file mode 100644 index 000000000..6067c12df --- /dev/null +++ b/docs/en/rst/integrating/apis.rst @@ -0,0 +1,72 @@ +.. _api-list: + +APIs +#### + +Bugzilla has a number of APIs that you can call in your code to extract +information from and put information into Bugzilla. Some are deprecated and +will soon be removed. Which one to use? Short answer: the +:ref:`REST WebService API v1 <apis>` +should be used for all new integrations, but keep an eye out for version 2, +coming soon. + +The APIs currently available are as follows: + +Ad-Hoc APIs +=========== + +Various pages on Bugzilla are available in machine-parseable formats as well +as HTML. For example, bugs can be downloaded as XML, and buglists as CSV. +CSV is useful for spreadsheet import. There should be links on the HTML page +to alternate data formats where they are available. + +XML-RPC +======= + +Bugzilla has an `XML-RPC API +<http://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Server/XMLRPC.html>`_. +This will receive no further updates and will be removed in a future version +of Bugzilla. + +Endpoint: :file:`/xmlrpc.cgi` + +JSON-RPC +======== + +Bugzilla has a `JSON-RPC API +<http://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/Server/JSONRPC.html>`_. +This will receive no further updates and will be removed in a future version +of Bugzilla. + +Endpoint: :file:`/jsonrpc.cgi` + +REST +==== + +Bugzilla has a :ref:`REST API <apis>` which is the currently-recommended API +for integrating with Bugzilla. The current REST API is version 1. It is stable, +and so will not be changed in a backwardly-incompatible way. + +**This is the currently-recommended API for new development.** + +Endpoint: :file:`/rest` + +BzAPI/BzAPI-Compatible REST +=========================== + +The first ever REST API for Bugzilla was implemented using an external proxy +called `BzAPI <https://wiki.mozilla.org/Bugzilla:BzAPI>`_. This became popular +enough that a BzAPI-compatible shim on top of the (native) REST API has been +written, to allow code which used the BzAPI API to take advantage of the +speed improvements of direct integration without needing to be rewritten. +The shim is an extension which you would need to install in your Bugzilla. + +Neither BzAPI nor this BzAPI-compatible API shim will receive any further +updates, and they should not be used for new code. + +REST v2 +======= + +The future of Bugzilla's APIs is version 2 of the REST API, which will take +the best of the current REST API and the BzAPI API. It is still under +development. diff --git a/docs/en/rst/integrating/extensions.rst b/docs/en/rst/integrating/extensions.rst new file mode 100644 index 000000000..18c5341d3 --- /dev/null +++ b/docs/en/rst/integrating/extensions.rst @@ -0,0 +1,199 @@ +.. _extensions: + +Extensions +########## + +One of the best ways to customize Bugzilla is by using a Bugzilla +Extension. Extensions can modify both the code and UI of Bugzilla in a way +that can be distributed to other Bugzilla users and ported forward to future +versions of Bugzilla with minimal effort. We maintain a +`list of available extensions <https://wiki.mozilla.org/Bugzilla:Addons>`_ +written by other people on our wiki. You would need to +make sure that the extension in question works with your version of Bugzilla. + +Or, you can write your own extension. See the `Bugzilla Extension +documentation <http://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/Extension.html>`_ +for the core documentation on how to do that. It would make sense to read +the section on :ref:`templates`. There is also a sample extension in +:file:`$BUGZILLA_HOME/extensions/Example/` which gives examples of how to +use all the code hooks. + +This section explains how to achieve some common tasks using the Extension APIs. + +Adding A New Page to Bugzilla +============================= + +There are occasions where it's useful to add a new page to Bugzilla which +has little or no relation to other pages, and perhaps doesn't use very much +Bugzilla data. A help page, or a custom report for example. The best mechanism +for this is to use :file:`page.cgi` and the ``page_before_template`` hook. + +Altering Data On An Existing Page +================================= + +The ``template_before_process`` hook can be used to tweak the data displayed +on a particular existing page, if you know what template is used. It has +access to all the template variables before they are passed to the templating +engine. + +Adding New Fields To Bugs +========================= + +To add new fields to a bug, you need to do the following: + +* Add an ``install_update_db`` hook to add the fields by calling + ``Bugzilla::Field->create`` (only if the field doesn't already exist). + Here's what it might look like for a single field: + + .. code-block:: perl + + my $field = new Bugzilla::Field({ name => $name }); + return if $field; + + $field = Bugzilla::Field->create({ + name => $name, + description => $description, + type => $type, # From list in Constants.pm + enter_bug => 0, + buglist => 0, + custom => 1, + }); + +* Push the name of the field onto the relevant arrays in the ``bug_columns`` + and ``bug_fields`` hooks. + +* If you want direct accessors, or other functions on the object, you need to + add a BEGIN block to your Extension.pm: + + .. code-block:: perl + + BEGIN { + *Bugzilla::Bug::is_foopy = \&_bug_is_foopy; + } + + ... + + sub _bug_is_foopy { + return $_[0]->{'is_foopy'}; + } + +* You don't have to change ``Bugzilla/DB/Schema.pm``. + +* You can use ``bug_end_of_create``, ``bug_end_of_create_validators``, and + ``bug_end_of_update`` to create or update the values for your new field. + +Adding New Fields To Other Things +================================= + +If you are adding the new fields to an object other than a bug, you need to +go a bit lower-level. With reference to the instructions above: + +* In ``install_update_db``, use ``bz_add_column`` instead + +* Push on the columns in ``object_columns`` and ``object_update_columns`` + instead of ``bug_columns``. + +* Add validators for the values in ``object_validators`` + +The process for adding accessor functions is the same. + +You can use the hooks ``object_end_of_create``, +``object_end_of_create_validators``, ``object_end_of_set_all``, and +``object_end_of_update`` to create or update the values for the new object +fields you have added. In the hooks you can check the object type being +operated on and skip any objects you don't care about. For example, if you +added a new field to the ``products`` table: + +.. code-block:: perl + + sub object_end_of_create { + my ($self, $args) = @_; + my $class = $args->{'class'}; + my $object = $args->{'object'}; + if ($class->isa('Bugzilla::Product') { + [...] + } + } + +You will need to do this filtering for most of the hooks whose names begin with +``object_``. + +Adding Admin Configuration Panels +================================= + +If you add new functionality to Bugzilla, it may well have configurable +options or parameters. The way to allow an administrator to set those +is to add a new configuration panel. + +As well as using the ``config_add_panels`` hook, you will need a template to +define the UI strings for the panel. See the templates in +:file:`template/en/default/admin/params` for examples, and put your own +template in :file:`template/en/default/admin/params` in your extension's +directory. + +You can access param values from Templates using:: + + [% Param('param_name') %] + +and from code using: + +.. code-block:: perl + + Bugzilla->params->{'param_name'} + +Adding User Preferences +======================= + +To add a new user preference: + +* Call ``add_setting('setting_name', ['some_option', 'another_option'], + 'some_option')`` in the ``install_before_final_checks`` hook. (The last + parameter is the name of the option which should be the default.) + +* Add descriptions for the identifiers for your setting and choices + (setting_name, some_option etc.) to the hash defined in + :file:`global/setting-descs.none.tmpl`. Do this in a template hook: + :file:`hook/global/setting-descs-settings.none.tmpl`. Your code can see the + hash variable; just set more members in it. + +* To change behaviour based on the setting, reference it in templates using + ``[% user.settings.setting_name.value %]``. Reference it in code using + ``$user->settings->{'setting_name'}->{'value'}``. The value will be one of + the option tag names (e.g. some_option). + +.. _who-can-change-what: + +Altering Who Can Change What +============================ + +Companies often have rules about which employees, or classes of employees, +are allowed to change certain things in the bug system. For example, +only the bug's designated QA Contact may be allowed to VERIFY the bug. +Bugzilla has been +designed to make it easy for you to write your own custom rules to define +who is allowed to make what sorts of value transition. + +By default, assignees, QA owners and users +with *editbugs* privileges can edit all fields of bugs, +except group restrictions (unless they are members of the groups they +are trying to change). Bug reporters also have the ability to edit some +fields, but in a more restrictive manner. Other users, without +*editbugs* privileges, cannot edit +bugs, except to comment and add themselves to the CC list. + +Because this kind of change is such a common request, we have added a +specific hook for it that :ref:`extensions` can call. It's called +``bug_check_can_change_field``, and it's documented `in the Hooks +documentation <http://www.bugzilla.org/docs/tip/en/html/api/Bugzilla/Hook.html#bug_check_can_change_field>`_. + +Checking Syntax +=============== + +It's not immediately obvious how to check the syntax of your extension's +Perl modules, if it contains any. Running :command:`checksetup.pl` might do +some of it, but the errors aren't necessarily massively informative. + +:command:`perl -Mlib=lib -MBugzilla -e 'BEGIN { Bugzilla->extensions; } use Bugzilla::Extension::ExtensionName::Class;'` + +(run from ``$BUGZILLA_HOME``) is what you need. + diff --git a/docs/en/rst/integrating/faq.rst b/docs/en/rst/integrating/faq.rst new file mode 100644 index 000000000..19f8b59ff --- /dev/null +++ b/docs/en/rst/integrating/faq.rst @@ -0,0 +1,27 @@ + +.. _customization-faq: + +Customization FAQ +================= + +How do I... + +...add a new field on a bug? + Use :ref:`custom-fields` or, if you just want new form fields on bug entry + but don't need Bugzilla to track the field seperately thereafter, you can + use a :ref:`custom bug entry form <custom-bug-entry>`. + +...change the name of a built-in bug field? + :ref:`Edit <templates>` the relevant value in the template + :file:`template/en/default/global/field-descs.none.tmpl`. + +...use a word other than 'bug' to describe bugs? + :ref:`Edit or override <templates>` the appropriate values in the template + :file:`template/en/default/global/variables.none.tmpl`. + +...call the system something other than 'Bugzilla'? + :ref:`Edit or override <templates>` the appropriate value in the template + :file:`template/en/default/global/variables.none.tmpl`. + +...alter who can change what field when? + See :ref:`who-can-change-what`. diff --git a/docs/en/rst/integrating/index.rst b/docs/en/rst/integrating/index.rst new file mode 100644 index 000000000..816ffe8e5 --- /dev/null +++ b/docs/en/rst/integrating/index.rst @@ -0,0 +1,22 @@ +.. highlight:: perl + +.. _integrating: + +=================================== +Integration and Customization Guide +=================================== + +You may find that Bugzilla already does what you want it to do, you just +need to configure it correctly. Read the :ref:`administering` sections +carefully to see if that's the case for you. If not, then this chapter +explains how to use the available mechanisms for integration and customization. + +.. toctree:: + :maxdepth: 2 + + faq + languages + skins + templates + extensions + apis diff --git a/docs/en/rst/integrating/languages.rst b/docs/en/rst/integrating/languages.rst new file mode 100644 index 000000000..01586d3fe --- /dev/null +++ b/docs/en/rst/integrating/languages.rst @@ -0,0 +1,19 @@ +Languages +========= + +Bugzilla's templates can be localized, although it's a `big job +<https://wiki.mozilla.org/Bugzilla:L10n:Guide>`_. If you have +a localized set of templates for your version of Bugzilla, Bugzilla can +support multiple languages at once. In that case, Bugzilla honours the user's +``Accept-Language`` HTTP header when deciding which language to serve. If +multiple languages are installed, a menu will display in the header allowing +the user to manually select a different language. If they do this, their +choice will override the ``Accept-Language`` header. + +Many language templates can be obtained from +`the localization section of the Bugzilla website +<http://www.bugzilla.org/download.html#localizations>`_. Instructions +for submitting new languages are also available from that location. There's +also a `list of localization teams +<https://wiki.mozilla.org/Bugzilla:L10n:Localization_Teams>`_; you might +want to contact someone to ask about the status of their localization. diff --git a/docs/en/rst/integrating/skins.rst b/docs/en/rst/integrating/skins.rst new file mode 100644 index 000000000..2cd08b4c0 --- /dev/null +++ b/docs/en/rst/integrating/skins.rst @@ -0,0 +1,27 @@ +.. _skins: + +Skins +===== + +Bugzilla supports skins - ways of changing the look of the UI without altering +its underlying structure. It ships with two - "Classic" and "Dusk". You can +find some more listed +`on the wiki <https://wiki.mozilla.org/Bugzilla:Addons#Skins>`_, and there +are a couple more which are part of +`bugzilla.mozilla.org <http://git.mozilla.org/?p=webtools/bmo/bugzilla.git>`_. +However, in each +case you may need to check that the skin supports the version of Bugzilla +you have. + +To create a new custom skin, make a directory that contains all the same CSS +file names as :file:`skins/standard/`, and put your directory in +:file:`skins/contrib/`. Then, add your CSS to the appropriate files. + +After you put the directory there, make sure to run :file:`checksetup.pl` so +that it can set the file permissions correctly. + +After you have installed the new skin, it will show up as an option in the +user's :guilabel:`Preferences`, on the :guilabel:`General` tab. If you would +like to force a particular skin on all users, just select that skin in the +:guilabel:`Default Preferences` in the :guilabel:`Administration` UI, and +then uncheck "Enabled" on the preference, so users cannot change it. diff --git a/docs/en/rst/integrating/templates.rst b/docs/en/rst/integrating/templates.rst new file mode 100644 index 000000000..f30b4a848 --- /dev/null +++ b/docs/en/rst/integrating/templates.rst @@ -0,0 +1,289 @@ +.. _templates: + +Templates +######### + +Bugzilla uses a system of templates to define its user interface. The standard +templates can be modified, replaced or overridden. You can also use template +hooks in an :ref:`extension <extensions>` to add or modify the +behaviour of templates using a stable interface. + +.. _template-directory: + +Template Directory Structure +============================ + +The template directory structure starts with top level directory +named :file:`template`, which contains a directory +for each installed localization. Bugzilla comes with English +templates, so the directory name is :file:`en`, +and we will discuss :file:`template/en` throughout +the documentation. Below :file:`template/en` is the +:file:`default` directory, which contains all the +standard templates shipped with Bugzilla. + +.. warning:: A directory :file:`data/template` also exists; + this is where Template Toolkit puts the compiled versions (i.e. Perl code) + of the templates. *Do not* directly edit the files in this + directory, or all your changes will be lost the next time + Template Toolkit recompiles the templates. + +.. _template-method: + +Choosing a Customization Method +=============================== + +If you want to edit Bugzilla's templates, the first decision +you must make is how you want to go about doing so. There are three +choices, and which you use depends mainly on the scope of your +modifications, and the method you plan to use to upgrade Bugzilla. + +#. You can directly edit the templates found in :file:`template/en/default`. + +#. You can copy the templates to be modified into a mirrored directory + structure under :file:`template/en/custom`. Templates in this + directory structure automatically override any identically-named + and identically-located templates in the + :file:`template/en/default` directory. (The :file:`custom` directory does + not exist by default and must be created if you want to use it.) + +#. You can use the hooks built into many of the templates to add or modify + the UI from an :ref:`extension <extensions>`. Hooks generally don't go away + and have a stable interface. + +The third method is the best if there are hooks in the appropriate places +and the change you want to do is possible using hooks. It's not very easy +to modify existing UI using hooks; they are most commonly used for additions. +You can make modifications if you add JS code which then makes the +modifications when the page is loaded. You can remove UI by adding CSS to hide +it. + +Unlike code hooks, there is no requirement to document template hooks, so +you just have to open up the template and see (search for ``Hook.process``). + +If there are no hooks available, then the second method of customization +should be used if you are going to make major changes, because it is +guaranteed that the contents of the :file:`custom` directory will not be +touched during an upgrade, and you can then decide whether +to revert to the standard templates, continue using yours, or make the effort +to merge your changes into the new versions by hand. It's also good for +entirely new files, and for a few files like +:file:`bug/create/user-message.html.tmpl` which are designed to be entirely +replaced. + +Using the second method, your user interface may break if incompatible +changes are made to the template interface. Templates do change regularly +and so interface changes are not individually documented, and you would +need to work out what had changed and adapt your template accordingly. + +For minor changes, the convenience of the first method is hard to beat. When +you upgrade Bugzilla, :command:`git` will merge your changes into the new +version for you. On the downside, if the merge fails then Bugzilla will not +work properly until you have fixed the problem and re-integrated your code. + +Also, you can see what you've changed using :command:`git diff`, which you +can't if you fork the file into the :file:`custom` directory. + +.. _template-edit: + +How To Edit Templates +===================== + +.. note:: If you are making template changes that you intend on submitting + back for inclusion in standard Bugzilla, you should read the relevant + sections of the + `Developers' Guide <http://www.bugzilla.org/docs/developer.html>`_. + +Bugzilla uses a templating system called Template Toolkit. The syntax of the +language is beyond the scope of this guide. It's reasonably easy to pick up by +looking at the current templates; or, you can read the manual, available on +the `Template Toolkit home page <http://www.template-toolkit.org>`_. + +One thing you should take particular care about is the need +to properly HTML filter data that has been passed into the template. +This means that if the data can possibly contain special HTML characters +such as ``<``, and the data was not intended to be HTML, they need to be +converted to entity form, i.e. ``<``. You use the ``html`` filter in the +Template Toolkit to do this (or the ``uri`` filter to encode special +characters in URLs). If you forget, you may open up your installation +to cross-site scripting attacks. + + +You should run :command:`./checksetup.pl` after editing any templates. Failure +to do so may mean either that your changes are not picked up, or that the +permissions on the edited files are wrong so the webserver can't read them. + +.. _template-formats: + +Template Formats and Types +========================== + +Some CGI's have the ability to use more than one template. For example, +:file:`buglist.cgi` can output itself as two formats of HTML (complex and +simple). Each of these is a separate template. The mechanism that provides +this feature is extensible - you can create new templates to add new formats. + +You might use this feature to e.g. add a custom bug entry form for a +particular subset of users or a particular type of bug. + +Bugzilla can also support different types of output - e.g. bugs are available +as HTML and as XML, and this mechanism is extensible also to add new content +types. However, instead of using such interfaces or enhancing Bugzilla to add +more, you would be better off using the :ref:`apis` to integrate with +Bugzilla. + +To see if a CGI supports multiple output formats and types, grep the +CGI for ``get_format``. If it's not present, adding +multiple format/type support isn't too hard - see how it's done in +other CGIs, e.g. :file:`config.cgi`. + +To make a new format template for a CGI which supports this, +open a current template for +that CGI and take note of the INTERFACE comment (if present.) This +comment defines what variables are passed into this template. If +there isn't one, I'm afraid you'll have to read the template and +the code to find out what information you get. + +Write your template in whatever markup or text style is appropriate. + +You now need to decide what content type you want your template +served as. The content types are defined in the +:file:`Bugzilla/Constants.pm` file in the :file:`contenttypes` +constant. If your content type is not there, add it. Remember +the three- or four-letter tag assigned to your content type. +This tag will be part of the template filename. + +Save your new template as +:file:`<stubname>-<formatname>.<contenttypetag>.tmpl`. +Try out the template by calling the CGI as +``<cginame>.cgi?format=<formatname>``. Add ``&ctype=<type>`` if the type is +not HTML. + +.. _template-specific: + +Particular Templates +==================== + +There are a few templates you may be particularly interested in +customizing for your installation. + +:file:`index.html.tmpl`: + This is the Bugzilla front page. + +:file:`global/header.html.tmpl`: + This defines the header that goes on all Bugzilla pages. + The header includes the banner, which is what appears to users + and is probably what you want to edit instead. However the + header also includes the HTML HEAD section, so you could for + example add a stylesheet or META tag by editing the header. + +:file:`global/banner.html.tmpl`: + This contains the ``banner``, the part of the header that appears + at the top of all Bugzilla pages. The default banner is reasonably + barren, so you'll probably want to customize this to give your + installation a distinctive look and feel. It is recommended you + preserve the Bugzilla version number in some form so the version + you are running can be determined, and users know what docs to read. + +:file:`global/footer.html.tmpl`: + This defines the footer that goes on all Bugzilla pages. Editing + this is another way to quickly get a distinctive look and feel for + your Bugzilla installation. + +:file:`global/variables.none.tmpl`: + This allows you to change the word 'bug' to something else (e.g. "issue") + throughout the interface, and also to change the name Bugzilla to something + else (e.g. "FooCorp Bug Tracker"). + +:file:`list/table.html.tmpl`: + This template controls the appearance of the bug lists created + by Bugzilla. Editing this template allows per-column control of + the width and title of a column, the maximum display length of + each entry, and the wrap behaviour of long entries. + For long bug lists, Bugzilla inserts a 'break' every 100 bugs by + default; this behaviour is also controlled by this template, and + that value can be modified here. + +:file:`bug/create/user-message.html.tmpl`: + This is a message that appears near the top of the bug reporting page. + By modifying this, you can tell your users how they should report + bugs. + +:file:`bug/process/midair.html.tmpl`: + This is the page used if two people submit simultaneous changes to the + same bug. The second person to submit their changes will get this page + to tell them what the first person did, and ask if they wish to + overwrite those changes or go back and revisit the bug. The default + title and header on this page read "Mid-air collision detected!" If + you work in the aviation industry, or other environment where this + might be found offensive (yes, we have true stories of this happening) + you'll want to change this to something more appropriate for your + environment. + +.. _custom-bug-entry: + +:file:`bug/create/create.html.tmpl` and :file:`bug/create/comment.txt.tmpl`: + You may not wish to go to the effort of creating custom fields in + Bugzilla, yet you want to make sure that each bug report contains + a number of pieces of important information for which there is not + a special field. The bug entry system has been designed in an + extensible fashion to enable you to add arbitrary HTML widgets, + such as drop-down lists or textboxes, to the bug entry page + and have their values appear formatted in the initial comment. + + An example of this is the `guided bug submission form + <http://landfill.bugzilla.org/bugzilla-tip/enter_bug.cgi?product=WorldControl;format=guided>`_. + The code for this comes with the Bugzilla distribution as an example for + you to copy. It can be found in the files + :file:`create-guided.html.tmpl` and :file:`comment-guided.html.tmpl`. + + A hidden field that indicates the format should be added inside + the form in order to make the template functional. Its value should + be the suffix of the template filename. For example, if the file + is called :file:`create-guided.html.tmpl`, then + + :: + + <input type="hidden" name="format" value="guided"> + + is used inside the form. + + So to use this feature, create a custom template for + :file:`enter_bug.cgi`. The default template, on which you + could base it, is + :file:`default/bug/create/create.html.tmpl`. + Call it :file:`custom/bug/create/create-<formatname>.html.tmpl`, and + in it, add form inputs for each piece of information you'd like + collected - such as a build number, or set of steps to reproduce. + + Then, create a template based on + :file:`default/bug/create/comment.txt.tmpl`, and call it + :file:`custom/bug/create/comment-<formatname>.txt.tmpl`. + It needs a couple of lines of boilerplate at the top like this:: + + [% USE Bugzilla %] + [% cgi = Bugzilla.cgi % + + Then, this template can reference the form fields you have created using + the syntax ``[% cgi.param("field_name") %]``. When a bug report is + submitted, the initial comment attached to the bug report will be + formatted according to the layout of this template. + + For example, if your custom enter_bug template had a field:: + + <input type="text" name="buildid" size="30"> + + and then your comment.txt.tmpl had:: + + [% USE Bugzilla %] + [% cgi = Bugzilla.cgi %] + Build Identifier: [%+ cgi.param("buildid") %] + + then something like:: + + Build Identifier: 20140303 + + would appear in the initial comment. + + This system allows you to gather structured data in bug reports without + the overhead and UI complexity of a large number of custom fields. diff --git a/docs/en/rst/style.rst b/docs/en/rst/style.rst new file mode 100644 index 000000000..aa3957b95 --- /dev/null +++ b/docs/en/rst/style.rst @@ -0,0 +1,122 @@ +:orphan: + +.. _style-guide: + +============================== +Writing Bugzilla Documentation +============================== + +The Bugzilla documentation uses +`reStructured Text (reST) <http://docutils.sourceforge.net/rst.html>`_, +as extended by our documentation compilation tool, +`Sphinx <http://sphinx-doc.org/>`_. This document is a reST document for +demonstration purposes. To learn from it, you need to read it in reST form. + +When you build the docs, this document gets built (at least in +the HTML version) as a standalone file, although it isn't as useful in that +form because some of the directives discussed are invisible or change when +rendered. + +`The Sphinx documentation <http://sphinx-doc.org/latest/rest.html>`_ +gives a good introduction to reST and the Sphinx-specific extensions. Reading +that one immediately-linked page should be enough to get started. Later, the +`inline markup section <http://sphinx-doc.org/latest/markup/inline.html>`_ +is worth a read. + +Bugzilla's particular documentation conventions are as follows: + +Block Directives +################ + +Chapter headings use the double-equals, page title headings the #, and then +the three other levels are headings within a page. Every heading should be +preceded by an anchor, with a globally-unique name with no spaces. Now, we +demonstrate the available heading levels we haven't used yet: + +.. _uniqueanchorname: + +Third Level Heading +=================== + +Fourth Level Heading +-------------------- + +Fifth Level Heading +~~~~~~~~~~~~~~~~~~~ + +(Although try not to use headings as deep as the 5th level.) + +Make links to anchors like this: :ref:`uniqueanchorname`. It'll pick up the +following heading name automatically and use it as the link text. Don't use +standard reST internal links like `uniqueanchorname`_ - they don't work +across files. + +Comments are done like this: + +.. This is a comment. It can go on to multiple lines. Follow-on lines need to + be indented. + +Other block types: + +.. note:: This is just a note, for your information. Like all double-dot + blocks, follow-on lines need to be indented. + +.. warning:: This is a warning of a potential serious problem you should be + aware of. + +.. todo:: This is some documentation-related task that still needs doing. + +Use both of the above block types sparingly. Consider putting the information +in the main text, omitting it, or (if long) placing it in a subsidiary file. + +Code gets highlighted using Pygments. Choose the highlighter at the top of +each file using: + +.. highlight:: console + +You can change the highlighter for a particular block by introducing it like +this: + +.. code-block:: perl + + # This is some Perl code + print "Hello"; + +There is a +`list of all available lexer names <http://pygments.org/docs/lexers/>`_ +available. We currently use ``console``, ``perl``, and ``sql``. ``none`` is +also a valid value. + +Use 4-space indentation, except where a different value is better so that +things line up. So normally two spaces for bulleted lists, and 3 spaces +for .. blocks. + +Inline Directives +################# + +.. warning:: Remember that reST does not support nested inline markup. So you + can't have a substitution inside a link, or bold inside italics. + +* A filename or a path to a filename: + :file:`/path/to/{variable-bit-of-path}/filename.ext` + +* A command to type in the shell: + :command:`command --arguments` + +* A parameter name: + :param:`shutdownhtml` + +* A parameter value: + :paramval:`DB` + +* A group name: + :group:`editbugs` + +* A bug field name: + :field:`Summary` + +* Any string from the UI: + :guilabel:`Administration` + +* A specific BMO bug: + :bug:`201069` diff --git a/docs/en/rst/using/creating-an-account.rst b/docs/en/rst/using/creating-an-account.rst new file mode 100644 index 000000000..0ea42ee5d --- /dev/null +++ b/docs/en/rst/using/creating-an-account.rst @@ -0,0 +1,39 @@ +.. _creating-an-account: + +Creating an Account +################### + +If you want to use a particular installation of Bugzilla, first you need to +create an account. Ask the administrator responsible for your installation +for the URL you should use to access it. If you're test-driving Bugzilla, +you can use one of the installations on +`Landfill <http://landfill.bugzilla.org/>`_. + +The process of creating an account is similar to many other websites. + +#. On the home page, click the :guilabel:`New Account` link in the header. + Enter your email address, then click the ``Send`` + button. + + .. note:: If the :guilabel:`New Account` link is not available, this means that the + administrator of the installation has disabled self-registration. + Speak to the administrator to find out how to get an account. + +#. Within moments, you should + receive an email to the address you provided, which contains your + login name (generally the same as the email address), and a URL to + click to confirm your registration. + +#. Once you confirm your registration, Bugzilla will ask you your real name + (optional, but recommended) and ask you to choose a password. Depending + on how your Bugzilla is configured, there may be minimum complexity + requirements for the password. + +#. Now all you need to do is to click the :guilabel:`Log In` + link in the header or footer, + enter your email address and the password you just chose into the + login form, and click the :guilabel:`Log in` button. + +You are now logged in. Bugzilla uses cookies to remember you are +logged in, so, unless you have cookies disabled or your IP address changes, +you should not have to log in again during your session. diff --git a/docs/en/rst/using/editing.rst b/docs/en/rst/using/editing.rst new file mode 100644 index 000000000..c147d9d3b --- /dev/null +++ b/docs/en/rst/using/editing.rst @@ -0,0 +1,98 @@ +.. _editing: + +Editing a Bug +############# + +.. _attachments: + +Attachments +=========== + +Attachments are used to attach relevant files to bugs - patches, screenshots, +test cases, debugging aids or logs, or anything else binary or too large to +fit into a comment. + +You should use attachments, rather than comments, for large chunks of plain +text data, such as trace, debugging output files, or log files. That way, it +doesn't bloat the bug for everyone who wants to read it, and cause people to +receive large, useless mails. + +You should make sure to trim screenshots. There's no need to show the +whole screen if you are pointing out a single-pixel problem. + +Bugzilla stores and uses a Content-Type for each attachment +(e.g. text/html). To download an attachment as a different +Content-Type (e.g. application/xhtml+xml), you can override this +using a 'content_type' parameter on the URL, e.g. +:file:`&content_type=text/plain`. + +Also, you can enter the URL pointing to the attachment instead of +uploading the attachment itself. For example, this is useful if you want to +point to an external application, a website or a very large file. + +It's also possible to create an attachment by pasting text directly in a text +field; Bugzilla will convert it into an attachment. This is pretty useful +when you are copying and pasting, to avoid the extra step of saving the text +in a temporary file. + +.. _editing-flags: + +Flags +===== + +To set a flag, select either :guilabel:`+` or :guilabel:`-` from the drop-down +menu next to the name of the flag in the :guilabel:`Flags` list. The meaning +of these values are flag-specific and thus cannot be described in this +documentation, but by way of example, setting a flag named :guilabel:`review` +:guilabel:`+` may indicate that the bug/attachment has passed review, while +setting it to :guilabel:`-` may indicate that the bug/attachment has failed +review. + +To unset a flag, click its drop-down menu and select the blank value. +Note that marking an attachment as obsolete automatically cancels all +pending requests for the attachment. + +If your administrator has enabled requests for a flag, request a flag +by selecting :guilabel:`?` from the drop-down menu and then entering the +username of the user you want to set the flag in the text field next to the +menu. + +.. _time-tracking: + +Time Tracking +============= + +Users who belong to the group specified by the ``timetrackinggroup`` +parameter have access to time-related fields. Developers can see +deadlines and estimated times to fix bugs, and can provide time spent +on these bugs. Users who do not belong to this group can only see the deadline +but not edit it. Other time-related fields remain invisible to them. + +At any time, a summary of the time spent by developers on bugs is +accessible either from bug lists when clicking the ``Time Summary`` +button or from individual bugs when clicking the ``Summarize time`` +link in the time tracking table. The :file:`summarize_time.cgi` +page lets you view this information either per developer or per bug +and can be split on a month basis to have greater details on how time +is spent by developers. + +As soon as a bug is marked as RESOLVED, the remaining time expected +to fix the bug is set to zero. This lets QA people set it again for +their own usage, and it will be set to zero again when the bug is +marked as VERIFIED. + +.. _lifecycle: + +Life Cycle of a Bug +=================== + +The life cycle of a bug, also known as workflow, is customizable to match +the needs of your organization (see :ref:`workflow`). +The image below contains a graphical representation of +the default workflow using the default bug statuses. If you wish to +customize this image for your site, the +`diagram file <../../images/bzLifecycle.xml>`_ +is available in `Dia's <http://www.gnome.org/projects/dia>`_ +native XML format. + +.. image:: ../../images/bzLifecycle.png diff --git a/docs/en/rst/using/extensions.rst b/docs/en/rst/using/extensions.rst new file mode 100644 index 000000000..752b50b9a --- /dev/null +++ b/docs/en/rst/using/extensions.rst @@ -0,0 +1,18 @@ +.. _installed-extensions-user: + +Installed Extensions +==================== + +Bugzilla can be enhanced using extensions (see :ref:`extensions`). If an +extension comes with documentation in the appropriate format, and you build +your own copy of the Bugzilla documentation using :file:`makedocs.pl`, then +the documentation for your installed extensions will show up here. + +Your Bugzilla installation has the following extensions available (as of the +last time you compiled the documentation): + +.. toctree:: + :maxdepth: 1 + :glob: + + ../extensions/*/index-user diff --git a/docs/en/rst/using/filing.rst b/docs/en/rst/using/filing.rst new file mode 100644 index 000000000..788cebbd5 --- /dev/null +++ b/docs/en/rst/using/filing.rst @@ -0,0 +1,82 @@ +.. _filing: + +Filing a Bug +############ + +Reporting a New Bug +=================== + +Years of bug writing experience has been distilled for your +reading pleasure into the +`Bug Writing Guidelines <http://landfill.bugzilla.org/bugzilla-tip/page.cgi?id=bug-writing.html>`_. +While some of the advice is Mozilla-specific, the basic principles of +reporting Reproducible, Specific bugs and isolating the Product you are +using, the Version of the Product, the Component which failed, the Hardware +Platform, and Operating System you were using at the time of the failure go a +long way toward ensuring accurate, responsible fixes for the bug that bit you. + +.. note:: If you want to file a test bug to see how Bugzilla works, + you can do it on one of our test installations on + `Landfill <http://landfill.bugzilla.org/>`_. Please don't do it on anyone's + production Bugzilla installation. + +The procedure for filing a bug is as follows: + +#. Click the :guilabel:`New` link available in the header or footer + of pages, or the :guilabel:`File a Bug` link on the home page. + +#. First, you have to select the product in which you found a bug. + +#. You now see a form where you can specify the component (part of + the product which is affected by the bug you discovered; if you have + no idea, just select :guilabel:`General` if such a component exists), + the version of the program you were using, the operating system and + platform your program is running on and the severity of the bug (if the + bug you found crashes the program, it's probably a major or a critical + bug; if it's a typo somewhere, that's something pretty minor; if it's + something you would like to see implemented, then that's an enhancement). + +#. You also need to provide a short but descriptive summary of the bug you found. + "My program is crashing all the time" is a very poor summary + and doesn't help developers at all. Try something more meaningful or + your bug will probably be ignored due to a lack of precision. + In the Description, give a detailed list of steps to reproduce + the problem you encountered. Try to limit these steps to a minimum set + required to reproduce the problem. This will make the life of + developers easier, and the probability that they consider your bug in + a reasonable timeframe will be much higher. + + .. note:: Try to make sure that everything in the Summary is also in the + Description. Summaries are often updated and this will ensure your original + information is easily accessible. + +#. As you file the bug, you can also attach a document (testcase, patch, + or screenshot of the problem). + +#. Depending on the Bugzilla installation you are using and the product in + which you are filing the bug, you can also request developers to consider + your bug in different ways (such as requesting review for the patch you + just attached, requesting your bug to block the next release of the + product, and many other product-specific requests). + +#. Now is a good time to read your bug report again. Remove all misspellings; + otherwise, your bug may not be found by developers running queries for some + specific words, and so your bug would not get any attention. + Also make sure you didn't forget any important information developers + should know in order to reproduce the problem, and make sure your + description of the problem is explicit and clear enough. + When you think your bug report is ready to go, the last step is to + click the :guilabel:`Submit Bug` button to add your report into the database. + +.. _cloning-a-bug: + +Clone an Existing Bug +===================== + +Bugzilla allows you to "clone" an existing bug. The newly created bug will +inherit most settings from the old bug. This allows you to track similar +concerns that require different handling in a new bug. To use this, go to +the bug that you want to clone, then click the :guilabel:`Clone This Bug` +link on the bug page. This will take you to the :guilabel:`Enter Bug` +page that is filled with the values that the old bug has. +You can then change the values and/or text if needed. diff --git a/docs/en/rst/using/finding.rst b/docs/en/rst/using/finding.rst new file mode 100644 index 000000000..a8e18eef2 --- /dev/null +++ b/docs/en/rst/using/finding.rst @@ -0,0 +1,259 @@ +.. _finding: + +Finding Bugs +############ + +Bugzilla has a number of different search options. + +.. note:: Bugzilla queries are case-insensitive and accent-insensitive when + used with either MySQL or Oracle databases. When using Bugzilla with + PostgreSQL, however, some queries are case sensitive. This is due to + the way PostgreSQL handles case and accent sensitivity. + +.. _quicksearch: + +Quicksearch +=========== + +Quicksearch is a single-text-box query tool. You'll find it in +Bugzilla's header or footer. + +Quicksearch uses +metacharacters to indicate what is to be searched. For example, typing + + ``foo|bar`` + +into Quicksearch would search for "foo" or "bar" in the +summary and status whiteboard of a bug; adding + + ``:BazProduct`` + +would search only in that product. + +You can also use it to go directly to a bug by entering its number or its +alias. + +Simple Search +============= + +Simple Search is good for finding one particular bug. It works like internet +search engines - just enter some keywords and off you go. + +Advanced Search +=============== + +The Advanced Search page is used to produce a list of all bugs fitting +exact criteria. `You can play with it on +Landfill <http://landfill.bugzilla.org/bugzilla-tip/query.cgi?format=advanced>`_. + +Advanced Search has controls for selecting different possible +values for all of the fields in a bug, as described above. For some +fields, multiple values can be selected. In those cases, Bugzilla +returns bugs where the content of the field matches any one of the selected +values. If none is selected, then the field can take any value. + +After a search is run, you can save it as a Saved Search, which +will appear in the page footer. If you are in the group defined +by the "querysharegroup" parameter, you may share your queries +with other users; see :ref:`saved-searches` for more details. + +.. _custom-search: + +Custom Search +============= + +Highly advanced querying is done using the :guilabel:`Custom Search` feature +of the :guilabel:`Advanced Search` page. + +The search criteria here further restrict the set of results +returned by a query, over and above those defined in the fields at the top +of the page. It is thereby possible to search for bugs +based on elaborate combinations of criteria. + +The simplest custom searches have only one term. These searches +permit the selected *field* +to be compared using a +selectable *operator* to a +specified *value.* Much of this could be reproduced using the standard +fields. However, you can then combine terms using "Match ANY" or "Match ALL", +using parentheses for combining and priority, in order to construct searches +of almost arbitrary complexity. + +There are three fields in each row (known as a "term") of a custom search: + +- *Field:* + the name of the field being searched + +- *Operator:* + the comparison operator + +- *Value:* + the value to which the field is being compared + +The list of available *fields* contains all the fields defined for a bug, +including any custom fields, and then also some pseudofields like +:guilabel:`Assignee Real Name`, :guilabel:`Days Since Bug Changed`, +:guilabel:`Time Since Assignee Touched` and other things it may be useful to +search on. + +There are a wide range of *operators* available, not all of which may make +sense for a particular field. There are various string-matching operations +(including regular expressions), numerical comparisons (which also work for +dates), and also the ability to search for change information—when a field +changed, what it changed from or to, and who did it. There are special +operators for :guilabel:`is empty` and :guilabel:`is not empty`, because +Bugzilla can't tell the difference between a value field left blank on +purpose and one left blank by accident. + +You can have an arbitrary number of rows, and the dropdown box above them +defines how they relate—:guilabel:`Match ALL of the following separately`, +:guilabel:`Match ANY of the following separately`, or :guilabel:`Match ALL of +the following against the same field`. The difference between the first and +the third can be illustrated with a comment search. If you have a search:: + + Comment contains the string "Fred" + Comment contains the string "Barney" + +then under the first regime (match separately) the search would return bugs +where "Fred" appeared in one comment and "Barney" in the same or any other +comment, whereas under the second (match against the same field), both strings +would need to occur in exactly the same comment. + +.. _advanced-features: + +Advanced Features +----------------- + +If you click :guilabel:`Show Advanced Features`, then more capabilities appear. +You can negate any row with a checkbox (see below) and also group lines of the +search with parentheses to determine how different search terms relate. Within +each bracketed set, you get the choice of combining them using ALL (i.e. AND) +or ANY (i.e. OR). + +Negation +-------- + +At first glance, negation seems redundant. Rather than +searching for:: + + NOT ( summary contains the string "foo" ) + +one could search for:: + + summary does not contain the string "foo" + +However, the search:: + + CC does not contain the string "@mozilla.org" + +would find every bug where anyone on the CC list did not contain +"@mozilla.org" while:: + + NOT ( CC contains the string "@mozilla.org" ) + +would find every bug where there was nobody on the CC list who +did contain the string. Similarly, the use of negation also permits +complex expressions to be built using terms OR'd together and then +negated. Negation permits queries such as:: + + NOT ( ( product equals "Update" ) + OR + ( component equals "Documentation" ) + ) + +to find bugs that are neither +in the :guilabel:`Update` product or in the :guilabel:`Documentation` component +or:: + + NOT ( ( commenter equals "%assignee%" ) + OR + (component equals "Documentation" ) + ) + +to find non-documentation bugs on which the assignee has never commented. + +.. _pronouns: + +Pronoun Substitution +-------------------- + +Sometimes, a query needs to compare a user-related field +(such as :guilabel:`Reporter`) with a role-specific user (such as the +user running the query or the user to whom each bug is assigned). For +example, you may want to find all bugs that are assigned to the person +who reported them. + +When the :guilabel:`Custom Search` operator is either :guilabel:`equals` or +:guilabel:`notequals`, the value can be "%reporter%", "%assignee%", +"%qacontact%", or "%user%". These are known as "pronouns". The user pronoun +refers to the user who is executing the query or, in the case +of whining reports, the user who will be the recipient +of the report. The reporter, assignee, and qacontact +pronouns refer to the corresponding fields in the bug. + +This feature also lets you search by a user's group memberships. If the +operator is either :guilabel:`equals`, :guilabel:`notequals` or +:guilabel:`anyexact`, you can search for +whether a user belongs (or not) to the specified group. The group name must be +entered using "%group.foo%" syntax, where "foo" is the group name. +So if you are looking for bugs reported by any user being in the +"editbugs" group, then you can use:: + + reporter equals "%group.editbugs%" + +.. _list: + +Bug Lists +========= + +The result of a search is a list of matching bugs. + +The format of the list is configurable. For example, it can be +sorted by clicking the column headings. Other useful features can be +accessed using the links at the bottom of the list: + +Long Format: + this gives you a large page with a non-editable summary of the fields + of each bug. + +XML (icon): + get the buglist in an XML format. + +CSV (icon): + get the buglist as comma-separated values, for import into e.g. + a spreadsheet. + +Feed (icon): + get the buglist as an Atom feed. Copy this link into your + favorite feed reader. If you are using Firefox, you can also + save the list as a live bookmark by clicking the live bookmark + icon in the status bar. To limit the number of bugs in the feed, + add a limit=n parameter to the URL. + +iCalendar (icon): + Get the buglist as an iCalendar file. Each bug is represented as a + to-do item in the imported calendar. + +Change Columns: + change the bug attributes which appear in the list. + +Change Several Bugs At Once: + If your account is sufficiently empowered, and more than one bug + appears in the bug list, this link is displayed and lets you easily make + the same change to all the bugs in the list - for example, changing + their assignee. + +Send Mail to Bug Assignees: + If more than one bug appear in the bug list and there are at least + two distinct bug assignees, this links is displayed which lets you + easily send a mail to the assignees of all bugs on the list. + +Edit Search: + If you didn't get exactly the results you were looking for, you can + return to the Query page through this link and make small revisions + to the query you just made so you get more accurate results. + +Remember Search As: + You can give a search a name and remember it; a link will appear + in your page footer giving you quick access to run it again later. + diff --git a/docs/en/rst/using/index.rst b/docs/en/rst/using/index.rst new file mode 100644 index 000000000..73aa707c3 --- /dev/null +++ b/docs/en/rst/using/index.rst @@ -0,0 +1,19 @@ +.. _using: + +========== +User Guide +========== + +.. toctree:: + :maxdepth: 2 + + creating-an-account + filing + understanding + editing + finding + reports-and-charts + tips + preferences + extensions + diff --git a/docs/en/rst/using/preferences.rst b/docs/en/rst/using/preferences.rst new file mode 100644 index 000000000..d61dc4f8a --- /dev/null +++ b/docs/en/rst/using/preferences.rst @@ -0,0 +1,195 @@ +.. _user-preferences: + +User Preferences +################ + +Once logged in, you can customize various aspects of +Bugzilla via the "Preferences" link in the page footer. +The preferences are split into a number of tabs, detailed in the sections +below. + +.. _generalpreferences: + +General Preferences +=================== + +This tab allows you to change several default settings of Bugzilla. +Administrators have the power to remove preferences from this list, so you +may not see all the preferences available. + +Each preference should be self-explanatory. + +.. _emailpreferences: + +Email Preferences +================= + +This tab allows you to enable or disable email notification on +specific events. + +In general, users have almost complete control over how much (or +how little) email Bugzilla sends them. If you want to receive the +maximum amount of email possible, click the ``Enable All +Mail`` button. If you don't want to receive any email from +Bugzilla at all, click the ``Disable All Mail`` button. + +.. note:: A Bugzilla administrator can stop a user from receiving + bugmail by clicking the ``Bugmail Disabled`` checkbox + when editing the user account. This is a drastic step + best taken only for disabled accounts, as it overrides + the user's individual mail preferences. + +There are two global options -- ``Email me when someone +asks me to set a flag`` and ``Email me when someone +sets a flag I asked for``. These define how you want to +receive bugmail with regards to flags. Their use is quite +straightforward: enable the checkboxes if you want Bugzilla to +send you mail under either of the above conditions. + +If you'd like to set your bugmail to something besides +'Completely ON' and 'Completely OFF', the +``Field/recipient specific options`` table +allows you to do just that. The rows of the table +define events that can happen to a bug -- things like +attachments being added, new comments being made, the +priority changing, etc. The columns in the table define +your relationship with the bug - reporter, assignee, QA contact (if enabled) +or CC list member. + +To fine-tune your bugmail, decide the events for which you want +to receive bugmail; then decide if you want to receive it all +the time (enable the checkbox for every column) or only when +you have a certain relationship with a bug (enable the checkbox +only for those columns). For example, if you didn't want to +receive mail when someone added themselves to the CC list, you +could uncheck all the boxes in the ``CC Field Changes`` +line. As another example, if you never wanted to receive email +on bugs you reported unless the bug was resolved, you would +uncheck all boxes in the ``Reporter`` column +except for the one on the ``The bug is resolved or +verified`` row. + +.. note:: Bugzilla adds the ``X-Bugzilla-Reason`` header to + all bugmail it sends, describing the recipient's relationship + (AssignedTo, Reporter, QAContact, CC, or Voter) to the bug. + This header can be used to do further client-side filtering. + +Bugzilla has a feature called ``User Watching``. +When you enter one or more comma-delineated user accounts (usually email +addresses) into the text entry box, you will receive a copy of all the +bugmail those users are sent (security settings permitting). +This powerful functionality enables seamless transitions as developers +change projects or users go on holiday. + +Each user listed in the ``Users watching you`` field +has you listed in their ``Users to watch`` list +and can get bugmail according to your relationship to the bug and +their ``Field/recipient specific options`` setting. + +Lastly, you can define a list of bugs on which you no longer wish to receive +any email, ever. (You can also add bugs to this list individually by checking +the "Ignore Bug Mail" checkbox on the bug page for that bug.) This is useful +for ignoring bugs where you are the reporter, as that's a role it's not +possible to stop having. + +.. _saved-searches: + +Saved Searches +============== + +On this tab you can view and run any Saved Searches that you have +created, and any Saved Searches that other members of the group +defined in the :param:`querysharegroup` parameter have shared. +Saved Searches can be added to the page footer from this screen. +If somebody is sharing a Search with a group they are allowed to +:ref:`assign users to <groups>`, the sharer may opt to have +the Search show up in the footer of the group's direct members by default. + +.. _account-information: + +Account Information +=================== + +On this tab, you can change your basic account information, +including your password, email address and real name. For security +reasons, in order to change anything on this page you must type your +*current* password into the ``Password`` +field at the top of the page. +If you attempt to change your email address, a confirmation +email is sent to both the old and new addresses with a link to use to +confirm the change. This helps to prevent account hijacking. + +.. _api-keys: + +API Keys +======== + +API keys allow you to give a "token" to some external software so it can log +in to the WebService API as you without knowing your password. You can then +revoke that token if you stop using the web service, and you don't need to +change your password everywhere. + +You can create more than one API key if required. Each API key has an optional +description which can help you record what it is used for. + +On this page, you can unrevoke, revoke and change the description of existing +API keys for your login. A revoked key means that it cannot be used. The +description is optional and purely for your information. + +You can also create a new API key by selecting the checkbox under the 'New +API key' section of the page. + +.. _permissions: + +Permissions +=========== + +This is a purely informative page which outlines your current +permissions on this installation of Bugzilla. + +A complete list of permissions in a default install of Bugzilla is below. +Your administrator may have defined other permissions. Only users with +*editusers* privileges can change the permissions of other users. + +admin + Indicates user is an Administrator. + +bz_canusewhineatothers + Indicates user can configure whine reports for other users. + +bz_canusewhines + Indicates user can configure whine reports for self. + +bz_quip_moderators + Indicates user can moderate quips. + +bz_sudoers + Indicates user can perform actions as other users. + +bz_sudo_protect + Indicates user cannot be impersonated by other users. + +canconfirm + Indicates user can confirm a bug or mark it a duplicate. + +creategroups + Indicates user can create and destroy groups. + +editbugs + Indicates user can edit all bug fields. + +editclassifications + Indicates user can create, destroy and edit classifications. + +editcomponents + Indicates user can create, destroy and edit products, components, + versions, milestones and flag types. + +editkeywords + Indicates user can create, destroy and edit keywords. + +editusers + Indicates user can create, disable and edit users. + +tweakparams + Indicates user can change :ref:`Parameters <parameters>`. diff --git a/docs/en/rst/using/reports-and-charts.rst b/docs/en/rst/using/reports-and-charts.rst new file mode 100644 index 000000000..659cd5cbd --- /dev/null +++ b/docs/en/rst/using/reports-and-charts.rst @@ -0,0 +1,120 @@ +.. _reports-and-charts: + +Reports and Charts +################## + +As well as the standard buglist, Bugzilla has two more ways of +viewing sets of bugs. These are the reports (which give different +views of the current state of the database) and charts (which plot +the changes in particular sets of bugs over time). + +.. _reports: + +Reports +======= + +A report is a view of the current state of the bug database. + +You can run either an HTML-table-based report, or a graphical +line/pie/bar-chart-based one. The two have different pages to +define them but are close cousins - once you've defined and +viewed a report, you can switch between any of the different +views of the data at will. + +Both report types are based on the idea of defining a set of bugs +using the standard search interface and then choosing some +aspect of that set to plot on the horizontal and/or vertical axes. +You can also get a form of 3-dimensional report by choosing to have +multiple images or tables. + +So, for example, you could use the search form to choose "all +bugs in the WorldControl product" and then plot their severity +against their component to see which component had had the largest +number of bad bugs reported against it. + +Once you've defined your parameters and hit :guilabel:`Generate Report`, +you can switch between HTML, CSV, Bar, Line and Pie. (Note: Pie +is only available if you didn't define a vertical axis, as pie +charts don't have one.) The other controls are fairly self-explanatory; +you can change the size of the image if you find text is overwriting +other text, or the bars are too thin to see. + +.. _charts: + +Charts +====== + +A chart is a view of the state of the bug database over time. + +Bugzilla currently has two charting systems - Old Charts and New +Charts. Old Charts have been part of Bugzilla for a long time; they +chart each status and resolution for each product, and that's all. +They are deprecated, and going away soon - we won't say any more +about them. +New Charts are the future - they allow you to chart anything you +can define as a search. + +.. note:: Both charting forms require the administrator to set up the + data-gathering script. If you can't see any charts, ask them whether + they have done so. + +An individual line on a chart is called a data set. +All data sets are organised into categories and subcategories. The +data sets that Bugzilla defines automatically use the Product name +as a :guilabel:`Category` and Component names as :guilabel:`Subcategories`, +but there is no need for you to follow that naming scheme with your own +charts if you don't want to. + +Data sets may be public or private. Everyone sees public data sets in +the list, but only their creator sees private data sets. Only +administrators can make data sets public. +No two data sets, even two private ones, can have the same set of +category, subcategory and name. So if you are creating private data +sets, one idea is to have the :guilabel:`Category` be your username. + +Creating Charts +--------------- + +You create a chart by selecting a number of data sets from the +list and pressing :guilabel:`Add To List` for each. In the +:guilabel:`List Of Data Sets To Plot`, you can define the label that data +set will have in the chart's legend and also ask Bugzilla to :guilabel:`Sum` +a number of data sets (e.g. you could :guilabel:`Sum` data sets representing +:guilabel:`RESOLVED`, :guilabel:`VERIFIED` and :guilabel:`CLOSED` in a +particular product to get a data set representing all the resolved bugs in +that product.) + +If you've erroneously added a data set to the list, select it +using the checkbox and click :guilabel:`Remove`. Once you add more than one +data set, a :guilabel:`Grand Total` line +automatically appears at the bottom of the list. If you don't want +this, simply remove it as you would remove any other line. + +You may also choose to plot only over a certain date range, and +to cumulate the results, that is, to plot each one using the +previous one as a baseline so the top line gives a sum of all +the data sets. It's easier to try than to explain :-) + +Once a data set is in the list, you can also perform certain +actions on it. For example, you can edit the +data set's parameters (name, frequency etc.) if it's one you +created or if you are an administrator. + +Once you are happy, click :guilabel:`Chart This List` to see the chart. + +.. _charts-new-series: + +Creating New Data Sets +---------------------- + +You may also create new data sets of your own. To do this, +click the :guilabel:`create a new data set` link on the +:guilabel:`Create Chart` page. This takes you to a search-like interface +where you can define the search that Bugzilla will plot. At the bottom of the +page, you choose the category, sub-category and name of your new +data set. + +If you have sufficient permissions, you can make the data set public, +and reduce the frequency of data collection to less than the default +of seven days. + diff --git a/docs/en/rst/using/tips.rst b/docs/en/rst/using/tips.rst new file mode 100644 index 000000000..34274f728 --- /dev/null +++ b/docs/en/rst/using/tips.rst @@ -0,0 +1,65 @@ +.. _pro-tips: + +Pro Tips +######## + +This section distills some Bugzilla tips and best practices +that have been developed. + +Autolinkification +================= + +Bugzilla comments are plain text - so typing <U> will +produce less-than, U, greater-than rather than underlined text. +However, Bugzilla will automatically make hyperlinks out of certain +sorts of text in comments. For example, the text +``http://www.bugzilla.org`` will be turned into a link: +`<http://www.bugzilla.org>`_. +Other strings which get linkified in the obvious manner are: + ++ bug 12345 + ++ bugs 123, 456, 789 + ++ comment 7 + ++ comments 1, 2, 3, 4 + ++ bug 23456, comment 53 + ++ attachment 4321 + ++ mailto\:george\@example.com + ++ george\@example.com + ++ ftp\://ftp.mozilla.org + ++ Most other sorts of URL + +A corollary here is that if you type a bug number in a comment, +you should put the word "bug" before it, so it gets autolinkified +for the convenience of others. + +.. _commenting: + +Comments +======== + +If you are changing the fields on a bug, only comment if +either you have something pertinent to say or Bugzilla requires it. +Otherwise, you may spam people unnecessarily with bugmail. +To take an example: a user can set up their account to filter out messages +where someone just adds themselves to the CC field of a bug +(which happens a lot). If you come along, add yourself to the CC field, +and add a comment saying "Adding self to CC", then that person +gets a pointless piece of mail they would otherwise have avoided. + +Don't use sigs in comments. Signing your name ("Bill") is acceptable, +if you do it out of habit, but full mail/news-style +four line ASCII art creations are not. + +If you feel a bug you filed was incorrectly marked as a +DUPLICATE of another, please question it in your bug, not +the bug it was duped to. Feel free to CC the person who duped it +if they are not already CCed. diff --git a/docs/en/rst/using/understanding.rst b/docs/en/rst/using/understanding.rst new file mode 100644 index 000000000..c52bd2167 --- /dev/null +++ b/docs/en/rst/using/understanding.rst @@ -0,0 +1,303 @@ +.. _understanding: + +Understanding a Bug +################### + +The core of Bugzilla is the screen which displays a particular +bug. Note that the labels for most fields are hyperlinks; +clicking them will take you to context-sensitive help on that +particular field. Fields marked * may not be present on every +installation of Bugzilla. + +*Summary:* + A one-sentence summary of the problem, displayed in the header next to + the bug number. + +*Status (and Resolution):* + These define exactly what state the bug is in—from not even + being confirmed as a bug, through to being fixed and the fix + confirmed by Quality Assurance. The different possible values for + Status and Resolution on your installation should be documented in the + context-sensitive help for those items. + +*Alias:* + A unique short text name for the bug, which can be used instead of the + bug number. + +*Product and Component*: + Bugs are divided up by Product and Component, with a Product + having one or more Components in it. + +*Version:* + The "Version" field usually contains the numbers or names of released + versions of the product. It is used to indicate the version(s) affected by + the bug report. + +*Hardware (Platform and OS):* + These indicate the computing environment where the bug was + found. + +*Importance (Priority and Severity):* + The Priority field is used to prioritize bugs, either by the assignee, + or someone else with authority to direct their time such as a project + manager. It's a good idea not to change this on other people's bugs. The + default values are P1 to P5. + + The Severity field indicates how severe the problem is—from blocker + ("application unusable") to trivial ("minor cosmetic issue"). You + can also use this field to indicate whether a bug is an enhancement + request. + +*\*Target Milestone:* + A future version by which the bug is to + be fixed. e.g. The Bugzilla Project's milestones for future + Bugzilla versions are 4.4, 5.0, 6.0, etc. Milestones are not + restricted to numbers, though—you can use any text strings, such + as dates. + +*Assigned To:* + The person responsible for fixing the bug. + +*\*QA Contact:* + The person responsible for quality assurance on this bug. + +*URL:* + A URL associated with the bug, if any. + +*\*Whiteboard:* + A free-form text area for adding short notes and tags to a bug. + +*Keywords:* + The administrator can define keywords which you can use to tag and + categorise bugs—e.g. ``crash`` or ``regression``. + +*Personal Tags:* + Unlike Keywords which are global and visible by all users, Personal Tags + are personal and can only be viewed and edited by their author. Editing + them won't send any notifications to other users. Use them to tag and keep + track of sets of bugs that you personally care about, using your own + classification system. + +*Dependencies (Depends On and Blocks):* + If this bug cannot be fixed unless other bugs are fixed (depends + on), or this bug stops other bugs being fixed (blocks), their + numbers are recorded here. + + Clicking the :guilabel:`Dependency tree` link shows + the dependency relationships of the bug as a tree structure. + You can change how much depth to show, and you can hide resolved bugs + from this page. You can also collapse/expand dependencies for + each non-terminal bug on the tree view, using the [-]/[+] buttons that + appear before the summary. + +*Reported:* + The person who filed the bug, and the date and time they did it. + +*Modified:* + The date and time the bug was last changed. + +*CC List:* + A list of people who get mail when the bug changes, in addition to the + Reporter, Assignee and QA Contact (if enabled). + +*Ignore Bug Mail:* + Set this if you want never to get bugmail from this bug again. See also + :ref:`emailpreferences`. + +*\*See Also:* + Bugs, in this Bugzilla, other Bugzillas, or other bug trackers, that are + related to this one. + +*Flags:* + A flag is a kind of status that can be set on bugs or attachments + to indicate that the bugs/attachments are in a certain state. + Each installation can define its own set of flags that can be set + on bugs or attachments. See :ref:`flags`. + +*\*Time Tracking:* + This form can be used for time tracking. + To use this feature, you have to be a member of the group + specified by the :param:`timetrackinggroup` parameter. See + :ref:`time-tracking` for more information. + + Orig. Est.: + This field shows the original estimated time. + Current Est.: + This field shows the current estimated time. + This number is calculated from ``Hours Worked`` + and ``Hours Left``. + Hours Worked: + This field shows the number of hours worked. + Hours Left: + This field shows the ``Current Est.`` - + ``Hours Worked``. + This value + ``Hours Worked`` will become the + new Current Est. + %Complete: + This field shows what percentage of the task is complete. + Gain: + This field shows the number of hours that the bug is ahead of the + ``Orig. Est.``. + Deadline: + This field shows the deadline for this bug. + +*Attachments:* + You can attach files (e.g. test cases or patches) to bugs. If there + are any attachments, they are listed in this section. See + :ref:`attachments` for more information. + +*Additional Comments:* + You can add your two cents to the bug discussion here, if you have + something worthwhile to say. + +.. _flags: + +Flags +===== + +Flags are a way to attach a specific status to a bug or attachment, +either ``+`` or ``-``. The meaning of these symbols depends on the name of +the flag itself, but contextually they could mean pass/fail, +accept/reject, approved/denied, or even a simple yes/no. If your site +allows requestable flags, then users may set a flag to ``?`` as a +request to another user that they look at the bug/attachment and set +the flag to its correct status. + +A set flag appears in bug reports and on "edit attachment" pages with the +abbreviated username of the user who set the flag prepended to the +flag name. For example, if Jack sets a "review" flag to ``+``, it appears +as :guilabel:`Jack: review [ + ]`. + +A requested flag appears with the user who requested the flag prepended +to the flag name and the user who has been requested to set the flag +appended to the flag name within parentheses. For example, if Jack +asks Jill for review, it appears as :guilabel:`Jack: review [ ? ] (Jill)`. + +You can browse through open requests made of you and by you by selecting +:guilabel:`My Requests` from the footer. You can also look at open requests +limited by other requesters, requestees, products, components, and flag names. +Note that you can use '-' for requestee to specify flags with no requestee +set. + +.. _flags-simpleexample: + +A Simple Example +---------------- + +A developer might want to ask their manager, +"Should we fix this bug before we release version 2.0?" +They might want to do this for a *lot* of bugs, +so they decide to streamline the process. So: + +#. The Bugzilla administrator creates a flag type called blocking2.0 for bugs + in your product. It shows up on the :guilabel:`Show Bug` screen as the text + :guilabel:`blocking2.0` with a drop-down box next to it. The drop-down box + contains four values: an empty space, ``?``, ``-``, and ``+``. + +#. The developer sets the flag to ``?``. + +#. The manager sees the :guilabel:`blocking2.0` + flag with a ``?`` value. + +#. If the manager thinks the feature should go into the product + before version 2.0 can be released, they set the flag to + ``+``. Otherwise, they set it to ``-``. + +#. Now, every Bugzilla user who looks at the bug knows whether or + not the bug needs to be fixed before release of version 2.0. + +.. _flags-about: + +About Flags +----------- + +Flags can have four values: + +``?`` + A user is requesting that a status be set. (Think of it as 'A question is being asked'.) + +``-`` + The status has been set negatively. (The question has been answered ``no``.) + +``+`` + The status has been set positively. + (The question has been answered ``yes``.) + +``_`` + ``unset`` actually shows up as a blank space. This just means that nobody + has expressed an opinion (or asked someone else to express an opinion) + about the matter covered by this flag. + +.. _flag-askto: + +Flag Requests +------------- + +If a flag has been defined as :guilabel:`requestable`, and a user has enough +privileges to request it (see below), the user can set the flag's status to +``?``. This status indicates that someone (a.k.a. "the requester") is asking +someone else to set the flag to either ``+`` or ``-``. + +If a flag has been defined as :guilabel:`specifically requestable`, +a text box will appear next to the flag into which the requester may +enter a Bugzilla username. That named person (a.k.a. "the requestee") +will receive an email notifying them of the request, and pointing them +to the bug/attachment in question. + +If a flag has *not* been defined as :guilabel:`specifically requestable`, +then no such text box will appear. A request to set this flag cannot be made +of any specific individual; these requests are open for anyone to answer. In +Bugzilla this is known as "asking the wind". A requester may ask the wind on +any flag simply by leaving the text box blank. + +.. _flag-types: + +.. _flag-type-attachment: + +Attachment Flags +---------------- + +There are two types of flags: bug flags and attachment flags. + +Attachment flags are used to ask a question about a specific +attachment on a bug. + +Many Bugzilla installations use this to +request that one developer review another +developer's code before they check it in. They attach the code to +a bug report, and then set a flag on that attachment called +:guilabel:`review` to +:guilabel:`review? reviewer@example.com`. +reviewer\@example.com is then notified by email that +they have to check out that attachment and approve it or deny it. + +For a Bugzilla user, attachment flags show up in three places: + +#. On the list of attachments in the :guilabel:`Show Bug` + screen, you can see the current state of any flags that + have been set to ``?``, ``+``, or ``-``. You can see who asked about + the flag (the requester), and who is being asked (the + requestee). + +#. When you edit an attachment, you can + see any settable flag, along with any flags that have + already been set. The :guilabel:`Edit Attachment` + screen is where you set flags to ``?``, ``-``, ``+``, or unset them. + +#. Requests are listed in the :guilabel:`Request Queue`, which + is accessible from the :guilabel:`My Requests` link (if you are + logged in) or :guilabel:`Requests` link (if you are logged out) + visible on all pages. + +.. _flag-type-bug: + +Bug Flags +--------- + +Bug flags are used to set a status on the bug itself. You can +see Bug Flags in the :guilabel:`Show Bug` and :guilabel:`Requests` +screens, as described above. + +Only users with enough privileges (see below) may set flags on bugs. +This doesn't necessarily include the assignee, reporter, or users with the +:group:`editbugs` permission. diff --git a/docs/en/xml/Bugzilla-Guide.xml b/docs/en/xml/Bugzilla-Guide.xml deleted file mode 100644 index cd99a063b..000000000 --- a/docs/en/xml/Bugzilla-Guide.xml +++ /dev/null @@ -1,134 +0,0 @@ -<!-- 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. ---> -<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" - "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ - <!ENTITY % myents SYSTEM "bugzilla.ent"> - %myents; -]> - -<!-- Coding standards for this document - -* Other than the GFDL, please use the "section" tag instead of "sect1", - "sect2", etc. -* Use Entities to include files for new chapters in Bugzilla-Guide.xml. -* Try to use Entities for frequently-used passages of text as well. -* Ensure all documents compile cleanly to HTML after modification. - The warning, "DTDDECL catalog types not supported" is normal. -* Try to index important terms wherever possible. -* Use "glossterm" whenever you introduce a new term. -* Follow coding standards at http://www.tldp.org, and - check out the KDE guidelines (they are nice, too) - http://i18n.kde.org/doc/markup.html -* All tags should be lowercase. -* Please use sensible spacing. The comments at the very end of each - file define reasonable defaults for PSGML mode in EMACS. -* Double-indent tags, use double spacing whenever possible, and - try to avoid clutter and feel free to waste space in the code to make it - more readable. - ---> - -<book id="index"> - -<!-- Header --> - - <bookinfo> - <title>The Bugzilla Guide - &bz-ver; - Release</title> - - <authorgroup> - <corpauthor>The Bugzilla Team</corpauthor> - </authorgroup> - - <pubdate>&bz-date;</pubdate> - - <abstract> - <para> - This is the documentation for Bugzilla, a - bug-tracking system from mozilla.org. - Bugzilla is an enterprise-class piece of software - that tracks millions of bugs and issues for hundreds of - organizations around the world. - </para> - - <para> - The most current version of this document can always be found on the - <ulink url="http://www.bugzilla.org/docs/">Bugzilla - Documentation Page</ulink>. - </para> - - </abstract> - - <keywordset> - <keyword>Bugzilla</keyword> - <keyword>Guide</keyword> - <keyword>installation</keyword> - <keyword>FAQ</keyword> - <keyword>administration</keyword> - <keyword>integration</keyword> - <keyword>MySQL</keyword> - <keyword>Mozilla</keyword> - <keyword>webtools</keyword> - </keywordset> - </bookinfo> - -<!-- About This Guide --> -<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="about.xml"/> - -<!-- Installing Bugzilla --> -<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="installation.xml"/> - -<!-- Administering Bugzilla --> -<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="administration.xml"/> - -<!-- Securing Bugzilla --> -<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="security.xml"/> - -<!-- Using Bugzilla --> -<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="using.xml"/> - -<!-- Customizing Bugzilla --> -<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="customization.xml"/> - -<!-- Appendix: Troubleshooting --> -<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="troubleshooting.xml"/> - -<!-- Appendix: Custom Patches --> -<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="patches.xml"/> - -<!-- Appendix: Manually Installing Perl Modules --> -<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="modules.xml"/> - -<!-- Appendix: GNU Free Documentation License --> -<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="gfdl.xml"/> - -<!-- Glossary --> -<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="glossary.xml"/> - -</book> - -<!-- Keep this comment at the end of the file -Local variables: -mode: sgml -sgml-always-quote-attributes:t -sgml-auto-insert-required-elements:t -sgml-balanced-tag-edit:t -sgml-exposed-tags:nil -sgml-general-insert-case:lower -sgml-indent-data:t -sgml-indent-step:2 -sgml-local-catalogs:nil -sgml-local-ecat-files:nil -sgml-minimize-attributes:nil -sgml-namecase-general:t -sgml-omittag:t -sgml-parent-document:("Bugzilla-Guide.xml" "book" "chapter") -sgml-shorttag:t -sgml-tag-region-if-active:t -End: ---> diff --git a/docs/en/xml/about.xml b/docs/en/xml/about.xml deleted file mode 100644 index 4d5d2a4d7..000000000 --- a/docs/en/xml/about.xml +++ /dev/null @@ -1,223 +0,0 @@ -<?xml version="1.0"?> -<!-- 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. ---> -<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" - "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ - <!ENTITY % myents SYSTEM "bugzilla.ent"> - %myents; -]> - -<chapter id="about"> -<title>About This Guide</title> - - <section id="copyright"> - <title>Copyright Information</title> - - <para>This document is copyright (c) 2000-¤t-year; by the various - Bugzilla contributors who wrote it.</para> - - <blockquote> - <para> - Permission is granted to copy, distribute and/or modify this - document under the terms of the GNU Free Documentation - License, Version 1.1 or any later version published by the - Free Software Foundation; with no Invariant Sections, no - Front-Cover Texts, and with no Back-Cover Texts. A copy of - the license is included in <xref linkend="gfdl"/>. - </para> - </blockquote> - <para> - If you have any questions regarding this document, its - copyright, or publishing this document in non-electronic form, - please contact the Bugzilla Team. - </para> - </section> - - <section id="disclaimer"> - <title>Disclaimer</title> - <para> - No liability for the contents of this document can be accepted. - Follow the instructions herein at your own risk. - This document may contain errors - and inaccuracies that may damage your system, cause your partner - to leave you, your boss to fire you, your cats to - pee on your furniture and clothing, and global thermonuclear - war. Proceed with caution. - </para> - <para> - Naming of particular products or brands should not be seen as - endorsements, with the exception of the term "GNU/Linux". We - wholeheartedly endorse the use of GNU/Linux; it is an extremely - versatile, stable, - and robust operating system that offers an ideal operating - environment for Bugzilla. - </para> - <para> - Although the Bugzilla development team has taken great care to - ensure that all exploitable bugs have been fixed, security holes surely - exist in any piece of code. Great care should be taken both in - the installation and usage of this software. The Bugzilla development - team members assume no liability for your use of Bugzilla. You have - the source code, and are responsible for auditing it yourself to ensure - your security needs are met. - </para> - </section> - -<!-- Section 2: New Versions --> - - <section id="newversions"> - <title>New Versions</title> - <para> - This is the &bz-ver; version of The Bugzilla Guide. It is so named - to match the current version of Bugzilla. - </para> - <para> - The latest version of this guide can always be found at <ulink - url="http://www.bugzilla.org/docs/"/>. However, you should read - the version which came with the Bugzilla release you are using. - </para> - - <para> - In addition, there are Bugzilla template localization projects in - <ulink url="http://www.bugzilla.org/download/#localizations">several languages</ulink>. - They may have translated documentation available. If you would like to - volunteer to translate the Guide into additional languages, please visit the - <ulink url="https://wiki.mozilla.org/Bugzilla:L10n">Bugzilla L10n team</ulink> - page. - </para> - </section> - - <section id="credits"> - <title>Credits</title> - <para> - The people listed below have made enormous contributions to the - creation of this Guide, through their writing, dedicated hacking efforts, - numerous e-mail and IRC support sessions, and overall excellent - contribution to the Bugzilla community: - </para> - - <!-- TODO: This is evil... there has to be a valid way to get this look --> - <variablelist> - <varlistentry> - <term>Matthew P. Barnson <email>mbarnson@sisna.com</email></term> - <listitem> - <para>for the Herculean task of pulling together the Bugzilla Guide - and shepherding it to 2.14. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>Terry Weissman <email>terry@mozilla.org</email></term> - <listitem> - <para>for initially writing Bugzilla and creating the README upon - which the UNIX installation documentation is largely based. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>Tara Hernandez <email>tara@tequilarists.org</email></term> - <listitem> - <para>for keeping Bugzilla development going strong after Terry left - mozilla.org and for running landfill. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>Dave Lawrence <email>dkl@redhat.com</email></term> - <listitem> - <para>for providing insight into the key differences between Red - Hat's customized Bugzilla. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>Dawn Endico <email>endico@mozilla.org</email></term> - <listitem> - <para>for being a hacker extraordinaire and putting up with Matthew's - incessant questions and arguments on irc.mozilla.org in #mozwebtools - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>Jacob Steenhagen <email>jake@bugzilla.org</email></term> - <listitem> - <para>for taking over documentation during the 2.17 development - period. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>Dave Miller <email>justdave@bugzilla.org</email></term> - <listitem> - <para>for taking over as project lead when Tara stepped down and - continually pushing for the documentation to be the best it can be. - </para> - </listitem> - </varlistentry> - - </variablelist> - - - <para> - Thanks also go to the following people for significant contributions - to this documentation: - <simplelist type="inline"> - <member>Kevin Brannen</member> - <member>Vlad Dascalu</member> - <member>Ben FrantzDale</member> - <member>Eric Hanson</member> - <member>Zach Lipton</member> - <member>Gervase Markham</member> - <member>Andrew Pearson</member> - <member>Joe Robins</member> - <member>Spencer Smith</member> - <member>Ron Teitelbaum</member> - <member>Shane Travis</member> - <member>Martin Wulffeld</member> - </simplelist>. - </para> - - <para> - Also, thanks are due to the members of the - <ulink url="news://news.mozilla.org/mozilla.support.bugzilla"> - mozilla.support.bugzilla</ulink> - newsgroup (and its predecessor, netscape.public.mozilla.webtools). - Without your discussions, insight, suggestions, and patches, - this could never have happened. - </para> - </section> - - <!-- conventions used here (didn't want to give it a chapter of its own) --> - <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="conventions.xml" /> -</chapter> - -<!-- Keep this comment at the end of the file -Local variables: -mode: sgml -sgml-always-quote-attributes:t -sgml-auto-insert-required-elements:t -sgml-balanced-tag-edit:t -sgml-exposed-tags:nil -sgml-general-insert-case:lower -sgml-indent-data:t -sgml-indent-step:2 -sgml-local-catalogs:nil -sgml-local-ecat-files:nil -sgml-minimize-attributes:nil -sgml-namecase-general:t -sgml-omittag:t -sgml-parent-document:("Bugzilla-Guide.xml" "book" "chapter") -sgml-shorttag:t -sgml-tag-region-if-active:t -End: --> diff --git a/docs/en/xml/administration.xml b/docs/en/xml/administration.xml deleted file mode 100644 index d803beb10..000000000 --- a/docs/en/xml/administration.xml +++ /dev/null @@ -1,3207 +0,0 @@ -<?xml version="1.0"?> -<!-- 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. ---> -<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" - "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ - <!ENTITY % myents SYSTEM "bugzilla.ent"> - %myents; -]> - -<chapter id="administration"> - <title>Administering Bugzilla</title> - - <section id="parameters"> - <title>Bugzilla Configuration</title> - - <para> - Bugzilla is configured by changing various parameters, accessed - from the "Parameters" link in the Administration page (the - Administration page can be found by clicking the "Administration" - link in the footer). The parameters are divided into several categories, - accessed via the menu on the left. Following is a description of the - different categories and important parameters within those categories. - </para> - - <section id="param-requiredsettings"> - <title>Required Settings</title> - - <para> - The core required parameters for any Bugzilla installation are set - here. These parameters must be set before a new Bugzilla installation - can be used. Administrators should review this list before - deploying a new Bugzilla installation. - </para> - - <variablelist> - - <varlistentry> - <term> - maintainer - </term> - <listitem> - <para> - Email address of the person - responsible for maintaining this Bugzilla installation. - The address need not be that of a valid Bugzilla account. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - urlbase - </term> - <listitem> - <para> - Defines the fully qualified domain name and web - server path to this Bugzilla installation. - </para> - <para> - For example, if the Bugzilla query page is - <filename>http://www.foo.com/bugzilla/query.cgi</filename>, - the <quote>urlbase</quote> should be set - to <filename>http://www.foo.com/bugzilla/</filename>. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - docs_urlbase - </term> - <listitem> - <para> - Defines path to the Bugzilla documentation. This can be a fully - qualified domain name, or a path relative to "urlbase". - </para> - <para> - For example, if the "Bugzilla Configuration" page - of the documentation is - <filename>http://www.foo.com/bugzilla/docs/html/parameters.html</filename>, - set the <quote>docs_urlbase</quote> - to <filename>http://www.foo.com/bugzilla/docs/html/</filename>. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - sslbase - </term> - <listitem> - <para> - Defines the fully qualified domain name and web - server path for HTTPS (SSL) connections to this Bugzilla installation. - </para> - <para> - For example, if the Bugzilla main page is - <filename>https://www.foo.com/bugzilla/index.cgi</filename>, - the <quote>sslbase</quote> should be set - to <filename>https://www.foo.com/bugzilla/</filename>. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - ssl_redirect - </term> - <listitem> - <para> - If enabled, Bugzilla will force HTTPS (SSL) connections, by - automatically redirecting any users who try to use a non-SSL - connection. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - cookiedomain - </term> - <listitem> - <para> - Defines the domain for Bugzilla cookies. This is typically left blank. - If there are multiple hostnames that point to the same webserver, which - require the same cookie, then this parameter can be utilized. For - example, If your website is at - <filename>https://www.foo.com/</filename>, setting this to - <filename>.foo.com/</filename> will also allow - <filename>bar.foo.com/</filename> to access Bugzilla cookies. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - cookiepath - </term> - <listitem> - <para> - Defines a path, relative to the web server root, that Bugzilla - cookies will be restricted to. For example, if the - <command>urlbase</command> is set to - <filename>http://www.foo.com/bugzilla/</filename>, the - <command>cookiepath</command> should be set to - <filename>/bugzilla/</filename>. Setting it to "/" will allow all sites - served by this web server or virtual host to read Bugzilla cookies. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - utf8 - </term> - <listitem> - <para> - Determines whether to use UTF-8 (Unicode) encoding for all text in - Bugzilla. New installations should set this to true to avoid character - encoding problems. Existing databases should set this to true only - after the data has been converted from existing legacy character - encoding to UTF-8, using the - <filename>contrib/recode.pl</filename> script. - </para> - <note> - <para> - If you turn this parameter from "off" to "on", you must re-run - <filename>checksetup.pl</filename> immediately afterward. - </para> - </note> - </listitem> - </varlistentry> - - <varlistentry> - <term> - shutdownhtml - </term> - <listitem> - <para> - If there is any text in this field, this Bugzilla installation will - be completely disabled and this text will appear instead of all - Bugzilla pages for all users, including Admins. Used in the event - of site maintenance or outage situations. - </para> - <note> - <para> - Although regular log-in capability is disabled while - <command>shutdownhtml</command> - is enabled, safeguards are in place to protect the unfortunate - admin who loses connection to Bugzilla. Should this happen to you, - go directly to the <filename>editparams.cgi</filename> (by typing - the URL in manually, if necessary). Doing this will prompt you to - log in, and your name/password will be accepted here (but nowhere - else). - </para> - </note> - </listitem> - </varlistentry> - - <varlistentry> - <term> - announcehtml - </term> - <listitem> - <para> - Any text in this field will be displayed at the top of every HTML - page in this Bugzilla installation. The text is not wrapped in any - tags. For best results, wrap the text in a <quote><div></quote> - tag. Any style attributes from the CSS can be applied. For example, - to make the text green inside of a red box, add <quote>id=message</quote> - to the <quote><div></quote> tag. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - proxy_url - </term> - <listitem> - <para> - If this Bugzilla installation is behind a proxy, enter the proxy - information here to enable Bugzilla to access the Internet. Bugzilla - requires Internet access to utilize the - <command>upgrade_notification</command> parameter (below). If the - proxy requires authentication, use the syntax: - <filename>http://user:pass@proxy_url/</filename>. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - upgrade_notification - </term> - <listitem> - <para> - Enable or disable a notification on the homepage of this Bugzilla - installation when a newer version of Bugzilla is available. This - notification is only visible to administrators. Choose "disabled", - to turn off the notification. Otherwise, choose which version of - Bugzilla you want to be notified about: "development_snapshot" is the - latest release on the trunk; "latest_stable_release" is the most - recent release available on the most recent stable branch; - "stable_branch_release" the most recent release on the branch - this installation is based on. - </para> - </listitem> - </varlistentry> - - </variablelist> - - </section> - - <section id="param-admin-policies"> - <title>Administrative Policies</title> - <para> - This page contains parameters for basic administrative functions. - Options include whether to allow the deletion of bugs and users, - and whether to allow users to change their email address. - </para> - </section> - - <section id="param-user-authentication"> - <title>User Authentication</title> - <para> - This page contains the settings that control how this Bugzilla - installation will do its authentication. Choose what authentication - mechanism to use (the Bugzilla database, or an external source such - as LDAP), and set basic behavioral parameters. For example, choose - whether to require users to login to browse bugs, the management - of authentication cookies, and the regular expression used to - validate email addresses. Some parameters are highlighted below. - </para> - - <variablelist> - - <varlistentry> - <term> - emailregexp - </term> - <listitem> - <para> - Defines the regular expression used to validate email addresses - used for login names. The default attempts to match fully - qualified email addresses (i.e. 'user@example.com') in a slightly - more restrictive way than what is allowed in RFC 2822. - Some Bugzilla installations allow only local user names (i.e 'user' - instead of 'user@example.com'). In that case, this parameter - should be used to define the email domain. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - emailsuffix - </term> - <listitem> - <para> - This string is appended to login names when actually sending - email to a user. For example, - If <command>emailregexp</command> has been set to allow - local usernames, - then this parameter would contain the email domain for all users - (i.e. '@example.com'). - </para> - </listitem> - </varlistentry> - - </variablelist> - - </section> - - <section id="param-attachments"> - <title>Attachments</title> - <para> - This page allows for setting restrictions and other parameters - regarding attachments to bugs. For example, control size limitations - and whether to allow pointing to external files via a URI. - </para> - </section> - - <section id="param-bug-change-policies"> - <title>Bug Change Policies</title> - <para> - Set policy on default behavior for bug change events. For example, - choose which status to set a bug to when it is marked as a duplicate, - and choose whether to allow bug reporters to set the priority or - target milestone. Also allows for configuration of what changes - should require the user to make a comment, described below. - </para> - - <variablelist> - - <varlistentry> - <term> - commenton* - </term> - <listitem> - <para> - All these fields allow you to dictate what changes can pass - without comment, and which must have a comment from the - person who changed them. Often, administrators will allow - users to add themselves to the CC list, accept bugs, or - change the Status Whiteboard without adding a comment as to - their reasons for the change, yet require that most other - changes come with an explanation. - </para> - - <para> - Set the "commenton" options according to your site policy. It - is a wise idea to require comments when users resolve, reassign, or - reopen bugs at the very least. - </para> - - <note> - <para> - It is generally far better to require a developer comment - when resolving bugs than not. Few things are more annoying to bug - database users than having a developer mark a bug "fixed" without - any comment as to what the fix was (or even that it was truly - fixed!) - </para> - </note> - </listitem> - </varlistentry> - <varlistentry> - <term> - noresolveonopenblockers - </term> - <listitem> - <para> - This option will prevent users from resolving bugs as FIXED if - they have unresolved dependencies. Only the FIXED resolution - is affected. Users will be still able to resolve bugs to - resolutions other than FIXED if they have unresolved dependent - bugs. - </para> - </listitem> - </varlistentry> - - </variablelist> - - </section> - - <section id="param-bugfields"> - <title>Bug Fields</title> - <para> - The parameters in this section determine the default settings of - several Bugzilla fields for new bugs, and also control whether - certain fields are used. For example, choose whether to use the - "target milestone" field or the "status whiteboard" field. - </para> - - <variablelist> - - <varlistentry> - <term> - useqacontact - </term> - <listitem> - <para> - This allows you to define an email address for each component, - in addition to that of the default assignee, who will be sent - carbon copies of incoming bugs. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - usestatuswhiteboard - </term> - <listitem> - <para> - This defines whether you wish to have a free-form, overwritable field - associated with each bug. The advantage of the Status Whiteboard is - that it can be deleted or modified with ease, and provides an - easily-searchable field for indexing some bugs that have some trait - in common. - </para> - </listitem> - </varlistentry> - - </variablelist> - - </section> - - <section id="param-bugmoving"> - <title>Bug Moving</title> - <para> - This page controls whether this Bugzilla installation allows certain - users to move bugs to an external database. If bug moving is enabled, - there are a number of parameters that control bug moving behaviors. - For example, choose which users are allowed to move bugs, the location - of the external database, and the default product and component that - bugs moved <emphasis>from</emphasis> other bug databases to this - Bugzilla installation are assigned to. - </para> - - </section> - - <section id="param-dependency-graphs"> - <title>Dependency Graphs</title> - <para> - This page has one parameter that sets the location of a Web Dot - server, or of the Web Dot binary on the local system, that is used - to generate dependency graphs. Web Dot is a CGI program that creates - images from <filename>.dot</filename> graphic description files. If - no Web Dot server or binary is specified, then dependency graphs will - be disabled. - </para> - </section> - - <section id="param-group-security"> - <title>Group Security</title> - <para> - Bugzilla allows for the creation of different groups, with the - ability to restrict the visibility of bugs in a group to a set of - specific users. Specific products can also be associated with - groups, and users restricted to only see products in their groups. - Several parameters are described in more detail below. Most of the - configuration of groups and their relationship to products is done - on the "Groups" and "Product" pages of the "Administration" area. - The options on this page control global default behavior. - For more information on Groups and Group Security, see - <xref linkend="groups"/> - </para> - - <variablelist> - - <varlistentry> - <term> - makeproductgroups - </term> - <listitem> - <para> - Determines whether or not to automatically create groups - when new products are created. If this is on, the groups will be - used for querying bugs. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - usevisibilitygroups - </term> - <listitem> - <para> - If selected, user visibility will be restricted to members of - groups, as selected in the group configuration settings. - Each user-defined group can be allowed to see members of selected - other groups. - For details on configuring groups (including the visibility - restrictions) see <xref linkend="edit-groups"/>. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - querysharegroup - </term> - <listitem> - <para> - The name of the group of users who are allowed to share saved - searches with one another. For more information on using - saved searches, see <xref linkend="savedsearches"/>. - </para> - </listitem> - </varlistentry> - - </variablelist> - - </section> - - <section id="bzldap"> - <title>LDAP Authentication</title> - - <para>LDAP authentication is a module for Bugzilla's plugin - authentication architecture. This page contains all the parameters - necessary to configure Bugzilla for use with LDAP authentication. - </para> - - <para> - The existing authentication - scheme for Bugzilla uses email addresses as the primary user ID, and a - password to authenticate that user. All places within Bugzilla that - require a user ID (e.g assigning a bug) use the email - address. The LDAP authentication builds on top of this scheme, rather - than replacing it. The initial log-in is done with a username and - password for the LDAP directory. Bugzilla tries to bind to LDAP using - those credentials and, if successful, tries to map this account to a - Bugzilla account. If an LDAP mail attribute is defined, the value of this - attribute is used, otherwise the "emailsuffix" parameter is appended to LDAP - username to form a full email address. If an account for this address - already exists in the Bugzilla installation, it will log in to that account. - If no account for that email address exists, one is created at the time - of login. (In this case, Bugzilla will attempt to use the "displayName" - or "cn" attribute to determine the user's full name.) After - authentication, all other user-related tasks are still handled by email - address, not LDAP username. For example, bugs are still assigned by - email address and users are still queried by email address. - </para> - - <caution> - <para>Because the Bugzilla account is not created until the first time - a user logs in, a user who has not yet logged is unknown to Bugzilla. - This means they cannot be used as an assignee or QA contact (default or - otherwise), added to any CC list, or any other such operation. One - possible workaround is the <filename>bugzilla_ldapsync.rb</filename> - script in the - <glossterm linkend="gloss-contrib"> - <filename class="directory">contrib</filename></glossterm> - directory. Another possible solution is fixing - <ulink url="https://bugzilla.mozilla.org/show_bug.cgi?id=201069">bug - 201069</ulink>. - </para> - </caution> - - <para>Parameters required to use LDAP Authentication:</para> - - <variablelist> - <varlistentry id="param-user_verify_class_for_ldap"> - <term>user_verify_class</term> - <listitem> - <para>If you want to list <quote>LDAP</quote> here, - make sure to have set up the other parameters listed below. - Unless you have other (working) authentication methods listed as - well, you may otherwise not be able to log back in to Bugzilla once - you log out. - If this happens to you, you will need to manually edit - <filename>data/params</filename> and set user_verify_class to - <quote>DB</quote>. - </para> - </listitem> - </varlistentry> - - <varlistentry id="param-LDAPserver"> - <term>LDAPserver</term> - <listitem> - <para>This parameter should be set to the name (and optionally the - port) of your LDAP server. If no port is specified, it assumes - the default LDAP port of 389. - </para> - <para>For example: <quote>ldap.company.com</quote> - or <quote>ldap.company.com:3268</quote> - </para> - <para>You can also specify a LDAP URI, so as to use other - protocols, such as LDAPS or LDAPI. If port was not specified in - the URI, the default is either 389 or 636 for 'LDAP' and 'LDAPS' - schemes respectively. - </para> - <tip> - <para> - In order to use SSL with LDAP, specify a URI with "ldaps://". - This will force the use of SSL over port 636. - </para> - </tip> - <para>For example, normal LDAP: - <quote>ldap://ldap.company.com</quote>, LDAP over SSL: - <quote>ldaps://ldap.company.com</quote> or LDAP over a UNIX - domain socket <quote>ldapi://%2fvar%2flib%2fldap_sock</quote>. - </para> - </listitem> - </varlistentry> - - <varlistentry id="param-LDAPbinddn"> - <term>LDAPbinddn [Optional]</term> - <listitem> - <para>Some LDAP servers will not allow an anonymous bind to search - the directory. If this is the case with your configuration you - should set the LDAPbinddn parameter to the user account Bugzilla - should use instead of the anonymous bind. - </para> - <para>Ex. <quote>cn=default,cn=user:password</quote></para> - </listitem> - </varlistentry> - - <varlistentry id="param-LDAPBaseDN"> - <term>LDAPBaseDN</term> - <listitem> - <para>The LDAPBaseDN parameter should be set to the location in - your LDAP tree that you would like to search for email addresses. - Your uids should be unique under the DN specified here. - </para> - <para>Ex. <quote>ou=People,o=Company</quote></para> - </listitem> - </varlistentry> - - <varlistentry id="param-LDAPuidattribute"> - <term>LDAPuidattribute</term> - <listitem> - <para>The LDAPuidattribute parameter should be set to the attribute - which contains the unique UID of your users. The value retrieved - from this attribute will be used when attempting to bind as the - user to confirm their password. - </para> - <para>Ex. <quote>uid</quote></para> - </listitem> - </varlistentry> - - <varlistentry id="param-LDAPmailattribute"> - <term>LDAPmailattribute</term> - <listitem> - <para>The LDAPmailattribute parameter should be the name of the - attribute which contains the email address your users will enter - into the Bugzilla login boxes. - </para> - <para>Ex. <quote>mail</quote></para> - </listitem> - </varlistentry> - </variablelist> - - </section> - - <section id="bzradius"> - <title>RADIUS Authentication</title> - - <para> - RADIUS authentication is a module for Bugzilla's plugin - authentication architecture. This page contains all the parameters - necessary for configuring Bugzilla to use RADIUS authentication. - </para> - <note> - <para> - Most caveats that apply to LDAP authentication apply to RADIUS - authentication as well. See <xref linkend="bzldap"/> for details. - </para> - </note> - - <para>Parameters required to use RADIUS Authentication:</para> - - <variablelist> - <varlistentry id="param-user_verify_class_for_radius"> - <term>user_verify_class</term> - <listitem> - <para>If you want to list <quote>RADIUS</quote> here, - make sure to have set up the other parameters listed below. - Unless you have other (working) authentication methods listed as - well, you may otherwise not be able to log back in to Bugzilla once - you log out. - If this happens to you, you will need to manually edit - <filename>data/params</filename> and set user_verify_class to - <quote>DB</quote>. - </para> - </listitem> - </varlistentry> - - <varlistentry id="param-RADIUS_server"> - <term>RADIUS_server</term> - <listitem> - <para>This parameter should be set to the name (and optionally the - port) of your RADIUS server. - </para> - </listitem> - </varlistentry> - - <varlistentry id="param-RADIUS_secret"> - <term>RADIUS_secret</term> - <listitem> - <para>This parameter should be set to the RADIUS server's secret. - </para> - </listitem> - </varlistentry> - - <varlistentry id="param-RADIUS_email_suffix"> - <term>RADIUS_email_suffix</term> - <listitem> - <para>Bugzilla needs an e-mail address for each user account. - Therefore, it needs to determine the e-mail address corresponding - to a RADIUS user. - Bugzilla offers only a simple way to do this: it can concatenate - a suffix to the RADIUS user name to convert it into an e-mail - address. - You can specify this suffix in the RADIUS_email_suffix parameter. - </para> - <para>If this simple solution does not work for you, you'll - probably need to modify - <filename>Bugzilla/Auth/Verify/RADIUS.pm</filename> to match your - requirements. - </para> - </listitem> - </varlistentry> - </variablelist> - - </section> - - <section id="param-email"> - <title>Email</title> - <para> - This page contains all of the parameters for configuring how - Bugzilla deals with the email notifications it sends. See below - for a summary of important options. - </para> - - <variablelist> - - <varlistentry> - <term> - mail_delivery_method - </term> - <listitem> - <para> - This is used to specify how email is sent, or if it is sent at - all. There are several options included for different MTAs, - along with two additional options that disable email sending. - "Test" does not send mail, but instead saves it in - <filename>data/mailer.testfile</filename> for later review. - "None" disables email sending entirely. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - mailfrom - </term> - <listitem> - <para> - This is the email address that will appear in the "From" field - of all emails sent by this Bugzilla installation. Some email - servers require mail to be from a valid email address, therefore - it is recommended to choose a valid email address here. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - smtpserver - </term> - <listitem> - <para> - This is the SMTP server address, if the <quote>mail_delivery_method</quote> - parameter is set to SMTP. Use "localhost" if you have a local MTA - running, otherwise use a remote SMTP server. Append ":" and the port - number, if a non-default port is needed. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - smtp_username - </term> - <listitem> - <para> - Username to use for SASL authentication to the SMTP server. Leave - this parameter empty if your server does not require authentication. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - smtp_password - </term> - <listitem> - <para> - Password to use for SASL authentication to the SMTP server. This - parameter will be ignored if the <quote>smtp_username</quote> - parameter is left empty. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - smtp_ssl - </term> - <listitem> - <para> - Enable SSL support for connection to the SMTP server. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - smtp_debug - </term> - <listitem> - <para> - This parameter allows you to enable detailed debugging output. - Log messages are printed the web server's error log. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - whinedays - </term> - <listitem> - <para> - Set this to the number of days you want to let bugs go - in the CONFIRMED state before notifying people they have - untouched new bugs. If you do not plan to use this feature, simply - do not set up the whining cron job described in the installation - instructions, or set this value to "0" (never whine). - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - globalwatcher - </term> - <listitem> - <para> - This allows you to define specific users who will - receive notification each time a new bug in entered, or when - an existing bug changes, according to the normal groupset - permissions. It may be useful for sending notifications to a - mailing-list, for instance. - </para> - </listitem> - </varlistentry> - - </variablelist> - - </section> - - <section id="param-patchviewer"> - <title>Patch Viewer</title> - <para> - This page contains configuration parameters for the CVS server, - Bonsai server and LXR server that Bugzilla will use to enable the - features of the Patch Viewer. Bonsai is a tool that enables queries - to a CVS tree. LXR is a tool that can cross reference and index source - code. - </para> - </section> - - <section id="param-querydefaults"> - <title>Query Defaults</title> - <para> - This page controls the default behavior of Bugzilla in regards to - several aspects of querying bugs. Options include what the default - query options are, what the "My Bugs" page returns, whether users - can freely add bugs to the quip list, and how many duplicate bugs are - needed to add a bug to the "most frequently reported" list. - </para> - </section> - - <section id="param-shadowdatabase"> - <title>Shadow Database</title> - <para> - This page controls whether a shadow database is used, and all the - parameters associated with the shadow database. Versions of Bugzilla - prior to 3.2 used the MyISAM table type, which supports - only table-level write locking. With MyISAM, any time someone is making a change to - a bug, the entire table is locked until the write operation is complete. - Locking for write also blocks reads until the write is complete. - </para> - <para> - The <quote>shadowdb</quote> parameter was designed to get around - this limitation. While only a single user is allowed to write to - a table at a time, reads can continue unimpeded on a read-only - shadow copy of the database. - </para> - - <note> - <para> - As of version 3.2, Bugzilla no longer uses the MyISAM table type. - Instead, InnoDB is used, which can do transaction-based locking. - Therefore, the limitations the Shadow Database feature was designed - to workaround no longer exist. - </para> - </note> - - </section> - - <section id="admin-usermatching"> - <title>User Matching</title> - <para> - The settings on this page control how users are selected and queried - when adding a user to a bug. For example, users need to be selected - when choosing who the bug is assigned to, adding to the CC list or - selecting a QA contact. With the "usemenuforusers" parameter, it is - possible to configure Bugzilla to - display a list of users in the fields instead of an empty text field. - This should only be used in Bugzilla installations with a small number - of users. If users are selected via a text box, this page also - contains parameters for how user names can be queried and matched - when entered. - </para> - <para> - Another setting called 'ajax_user_autocompletion' enables certain - user fields to display a list of matched user names as a drop down after typing - a few characters. Note that it is recommended to use mod_perl when - enabling 'ajax_user_autocompletion'. - </para> - </section> - - </section> - - <section id="useradmin"> - <title>User Administration</title> - - <section id="defaultuser"> - <title>Creating the Default User</title> - - <para>When you first run checksetup.pl after installing Bugzilla, it - will prompt you for the administrative username (email address) and - password for this "super user". If for some reason you delete - the "super user" account, re-running checksetup.pl will again prompt - you for this username and password.</para> - - <tip> - <para>If you wish to add more administrative users, add them to - the "admin" group and, optionally, edit the tweakparams, editusers, - creategroups, editcomponents, and editkeywords groups to add the - entire admin group to those groups (which is the case by default). - </para> - </tip> - </section> - - <section id="manageusers"> - <title>Managing Other Users</title> - - <section id="user-account-search"> - <title>Searching for existing users</title> - - <para> - If you have <quote>editusers</quote> privileges or if you are allowed - to grant privileges for some groups, the <quote>Users</quote> link - will appear in the Administration page. - </para> - - <para> - The first screen is a search form to search for existing user - accounts. You can run searches based either on the user ID, real - name or login name (i.e. the email address, or just the first part - of the email address if the "emailsuffix" parameter is set). - The search can be conducted - in different ways using the listbox to the right of the text entry - box. You can match by case-insensitive substring (the default), - regular expression, a <emphasis>reverse</emphasis> regular expression - match (which finds every user name which does NOT match the regular - expression), or the exact string if you know exactly who you are - looking for. The search can be restricted to users who are in a - specific group. By default, the restriction is turned off. - </para> - - <para> - The search returns a list of - users matching your criteria. User properties can be edited by clicking - the login name. The Account History of a user can be viewed by clicking - the "View" link in the Account History column. The Account History - displays changes that have been made to the user account, the time of - the change and the user who made the change. For example, the Account - History page will display details of when a user was added or removed - from a group. - </para> - </section> - - <section id="createnewusers"> - <title>Creating new users</title> - - <section id="self-registration"> - <title>Self-registration</title> - - <para> - By default, users can create their own user accounts by clicking the - <quote>New Account</quote> link at the bottom of each page (assuming - they aren't logged in as someone else already). If you want to disable - this self-registration, or if you want to restrict who can create his - own user account, you have to edit the <quote>createemailregexp</quote> - parameter in the <quote>Configuration</quote> page, see - <xref linkend="parameters" />. - </para> - </section> - - <section id="user-account-creation"> - <title>Accounts created by an administrator</title> - - <para> - Users with <quote>editusers</quote> privileges, such as administrators, - can create user accounts for other users: - </para> - - <orderedlist> - <listitem> - <para>After logging in, click the "Users" link at the footer of - the query page, and then click "Add a new user".</para> - </listitem> - - <listitem> - <para>Fill out the form presented. This page is self-explanatory. - When done, click "Submit".</para> - - <note> - <para>Adding a user this way will <emphasis>not</emphasis> - send an email informing them of their username and password. - While useful for creating dummy accounts (watchers which - shuttle mail to another system, for instance, or email - addresses which are a mailing list), in general it is - preferable to log out and use the <quote>New Account</quote> - button to create users, as it will pre-populate all the - required fields and also notify the user of her account name - and password.</para> - </note> - </listitem> - </orderedlist> - </section> - </section> - - <section id="modifyusers"> - <title>Modifying Users</title> - - <para>Once you have found your user, you can change the following - fields:</para> - - <itemizedlist> - <listitem> - <para> - <emphasis>Login Name</emphasis>: - This is generally the user's full email address. However, if you - are using the <quote>emailsuffix</quote> parameter, this may - just be the user's login name. Note that users can now change their - login names themselves (to any valid email address). - </para> - </listitem> - - <listitem> - <para> - <emphasis>Real Name</emphasis>: The user's real name. Note that - Bugzilla does not require this to create an account.</para> - </listitem> - - <listitem> - <para> - <emphasis>Password</emphasis>: - You can change the user's password here. Users can automatically - request a new password, so you shouldn't need to do this often. - If you want to disable an account, see Disable Text below. - </para> - </listitem> - - <listitem> - <para> - <emphasis>Bugmail Disabled</emphasis>: - Mark this checkbox to disable bugmail and whinemail completely - for this account. This checkbox replaces the data/nomail file - which existed in older versions of Bugzilla. - </para> - </listitem> - - <listitem> - <para> - <emphasis>Disable Text</emphasis>: - If you type anything in this box, including just a space, the - user is prevented from logging in, or making any changes to - bugs via the web interface. - The HTML you type in this box is presented to the user when - they attempt to perform these actions, and should explain - why the account was disabled. - </para> - <para> - Users with disabled accounts will continue to receive - mail from Bugzilla; furthermore, they will not be able - to log in themselves to change their own preferences and - stop it. If you want an account (disabled or active) to - stop receiving mail, simply check the - <quote>Bugmail Disabled</quote> checkbox above. - </para> - <note> - <para> - Even users whose accounts have been disabled can still - submit bugs via the e-mail gateway, if one exists. - The e-mail gateway should <emphasis>not</emphasis> be - enabled for secure installations of Bugzilla. - </para> - </note> - <warning> - <para> - Don't disable all the administrator accounts! - </para> - </warning> - </listitem> - - <listitem> - <para> - <emphasis><groupname></emphasis>: - If you have created some groups, e.g. "securitysensitive", then - checkboxes will appear here to allow you to add users to, or - remove them from, these groups. The first checkbox gives the - user the ability to add and remove other users as members of - this group. The second checkbox adds the user himself as a member - of the group. - </para> - </listitem> - - <listitem> - <para> - <emphasis>canconfirm</emphasis>: - This field is only used if you have enabled the "unconfirmed" - status. If you enable this for a user, - that user can then move bugs from "Unconfirmed" to a "Confirmed" - status (e.g.: "New" status).</para> - </listitem> - - <listitem> - <para> - <emphasis>creategroups</emphasis>: - This option will allow a user to create and destroy groups in - Bugzilla.</para> - </listitem> - - <listitem> - <para> - <emphasis>editbugs</emphasis>: - Unless a user has this bit set, they can only edit those bugs - for which they are the assignee or the reporter. Even if this - option is unchecked, users can still add comments to bugs. - </para> - </listitem> - - <listitem> - <para> - <emphasis>editcomponents</emphasis>: - This flag allows a user to create new products and components, - as well as modify and destroy those that have no bugs associated - with them. If a product or component has bugs associated with it, - those bugs must be moved to a different product or component - before Bugzilla will allow them to be destroyed. - </para> - </listitem> - - <listitem> - <para> - <emphasis>editkeywords</emphasis>: - If you use Bugzilla's keyword functionality, enabling this - feature allows a user to create and destroy keywords. As always, - the keywords for existing bugs containing the keyword the user - wishes to destroy must be changed before Bugzilla will allow it - to die.</para> - </listitem> - - <listitem> - <para> - <emphasis>editusers</emphasis>: - This flag allows a user to do what you're doing right now: edit - other users. This will allow those with the right to do so to - remove administrator privileges from other users or grant them to - themselves. Enable with care.</para> - </listitem> - - - <listitem> - <para> - <emphasis>tweakparams</emphasis>: - This flag allows a user to change Bugzilla's Params - (using <filename>editparams.cgi</filename>.)</para> - </listitem> - - <listitem> - <para> - <emphasis><productname></emphasis>: - This allows an administrator to specify the products - in which a user can see bugs. If you turn on the - <quote>makeproductgroups</quote> parameter in - the Group Security Panel in the Parameters page, - then Bugzilla creates one group per product (at the time you create - the product), and this group has exactly the same name as the - product itself. Note that for products that already exist when - the parameter is turned on, the corresponding group will not be - created. The user must still have the <quote>editbugs</quote> - privilege to edit bugs in these products.</para> - </listitem> - </itemizedlist> - </section> - - <section id="user-account-deletion"> - <title>Deleting Users</title> - <para> - If the <quote>allowuserdeletion</quote> parameter is turned on, see - <xref linkend="parameters" />, then you can also delete user accounts. - Note that this is most of the time not the best thing to do. If only - a warning in a yellow box is displayed, then the deletion is safe. - If a warning is also displayed in a red box, then you should NOT try - to delete the user account, else you will get referential integrity - problems in your database, which can lead to unexpected behavior, - such as bugs not appearing in bug lists anymore, or data displaying - incorrectly. You have been warned! - </para> - </section> - - <section id="impersonatingusers"> - <title>Impersonating Users</title> - - <para> - There may be times when an administrator would like to do something as - another user. The <command>sudo</command> feature may be used to do - this. - </para> - - <note> - <para> - To use the sudo feature, you must be in the - <emphasis>bz_sudoers</emphasis> group. By default, all - administrators are in this group.</para> - </note> - - <para> - If you have access to this feature, you may start a session by - going to the Edit Users page, Searching for a user and clicking on - their login. You should see a link below their login name titled - "Impersonate this user". Click on the link. This will take you - to a page where you will see a description of the feature and - instructions for using it. After reading the text, simply - enter the login of the user you would like to impersonate, provide - a short message explaining why you are doing this, and press the - button.</para> - - <para> - As long as you are using this feature, everything you do will be done - as if you were logged in as the user you are impersonating.</para> - - <warning> - <para> - The user you are impersonating will not be told about what you are - doing. If you do anything that results in mail being sent, that - mail will appear to be from the user you are impersonating. You - should be extremely careful while using this feature.</para> - </warning> - </section> - </section> - </section> - - <section id="classifications" xreflabel="Classifications"> - <title>Classifications</title> - - <para>Classifications tend to be used in order to group several related - products into one distinct entity.</para> - - <para>The classifications layer is disabled by default; it can be turned - on or off using the useclassification parameter, - in the <emphasis>Bug Fields</emphasis> section of the edit parameters screen.</para> - - <para>Access to the administration of classifications is controlled using - the <emphasis>editclassifications</emphasis> system group, which defines - a privilege for creating, destroying, and editing classifications.</para> - - <para>When activated, classifications will introduce an additional - step when filling bugs (dedicated to classification selection), and they - will also appear in the advanced search form.</para> - </section> - - <section id="products" xreflabel="Products"> - <title>Products</title> - - <para> - <glossterm linkend="gloss-product" baseform="product"> - Products</glossterm> typically represent real-world - shipping products. Products can be given - <xref linkend="classifications"/>. - For example, if a company makes computer games, - they could have a classification of "Games", and a separate - product for each game. This company might also have a - <quote>Common</quote> product for units of technology used - in multiple games, and perhaps a few special products that - represent items that are not actually shipping products - (for example, "Website", or "Administration"). - </para> - - <para> - Many of Bugzilla's settings are configurable on a per-product - basis. The number of <quote>votes</quote> available to - users is set per-product, as is the number of votes - required to move a bug automatically from the UNCONFIRMED - status to the CONFIRMED status. - </para> - - <para> - When creating or editing products the following options are - available: - </para> - - <variablelist> - - <varlistentry> - <term> - Product - </term> - <listitem> - <para> - The name of the product - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - Description - </term> - <listitem> - <para> - A brief description of the product - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - Default milestone - </term> - <listitem> - <para> - Select the default milestone for this product. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - Closed for bug entry - </term> - <listitem> - <para> - Select this box to prevent new bugs from being - entered against this product. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - Maximum votes per person - </term> - <listitem> - <para> - Maximum votes a user is allowed to give for this - product - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - Maximum votes a person can put on a single bug - </term> - <listitem> - <para> - Maximum votes a user is allowed to give for this - product in a single bug - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - Confirmation threshold - </term> - <listitem> - <para> - Number of votes needed to automatically remove any - bug against this product from the UNCONFIRMED state - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - Version - </term> - <listitem> - <para> - Specify which version of the product bugs will be - entered against. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - Create chart datasets for this product - </term> - <listitem> - <para> - Select to make chart datasets available for this product. - </para> - </listitem> - </varlistentry> - - </variablelist> - - <para> - When editing a product there is also a link to edit Group Access Controls, - see <xref linkend="product-group-controls"/>. - </para> - - <section id="create-product"> - <title>Creating New Products</title> - - <para> - To create a new product: - </para> - - <orderedlist> - <listitem> - <para> - Select <quote>Administration</quote> from the footer and then - choose <quote>Products</quote> from the main administration page. - </para> - </listitem> - - <listitem> - <para> - Select the <quote>Add</quote> link in the bottom right. - </para> - </listitem> - - <listitem> - <para> - Enter the name of the product and a description. The - Description field may contain HTML. - </para> - </listitem> - - <listitem> - <para> - When the product is created, Bugzilla will give a message - stating that a component must be created before any bugs can - be entered against the new product. Follow the link to create - a new component. See <xref linkend="components"/> for more - information. - </para> - </listitem> - </orderedlist> - - </section> - - <section id="edit-products"> - <title>Editing Products</title> - - <para> - To edit an existing product, click the "Products" link from the - "Administration" page. If the 'useclassification' parameter is - turned on, a table of existing classifications is displayed, - including an "Unclassified" category. The table indicates how many products - are in each classification. Click on the classification name to see its - products. If the 'useclassification' parameter is not in use, the table - lists all products directly. The product table summarizes the information - about the product defined - when the product was created. Click on the product name to edit these - properties, and to access links to other product attributes such as the - product's components, versions, milestones, and group access controls. - </para> - - </section> - - <section id="comps-vers-miles-products"> - <title>Adding or Editing Components, Versions and Target Milestones</title> - <para> - To edit existing, or add new, Components, Versions or Target Milestones - to a Product, select the "Edit Components", "Edit Versions" or "Edit - Milestones" links from the "Edit Product" page. A table of existing - Components, Versions or Milestones is displayed. Click on a item name - to edit the properties of that item. Below the table is a link to add - a new Component, Version or Milestone. - </para> - <para> - For more information on components, see <xref linkend="components"/>. - </para> - <para> - For more information on versions, see <xref linkend="versions"/>. - </para> - <para> - For more information on milestones, see <xref linkend="milestones"/>. - </para> - </section> - - <section id="product-group-controls"> - <title>Assigning Group Controls to Products</title> - - <para> - On the <quote>Edit Product</quote> page, there is a link called - <quote>Edit Group Access Controls</quote>. The settings on this page - control the relationship of the groups to the product being edited. - </para> - - <para> - Group Access Controls are an important aspect of using groups for - isolating products and restricting access to bugs filed against those - products. For more information on groups, including how to create, edit - add users to, and alter permission of, see <xref linkend="groups"/>. - </para> - - <para> - After selecting the "Edit Group Access Controls" link from the "Edit - Product" page, a table containing all user-defined groups for this - Bugzilla installation is displayed. The system groups that are created - when Bugzilla is installed are not applicable to Group Access Controls. - Below is description of what each of these fields means. - </para> - - <para> - Groups may be applicable (e.g bugs in this product can be associated - with this group) , default (e.g. bugs in this product are in this group - by default), and mandatory (e.g. bugs in this product must be associated - with this group) for each product. Groups can also control access - to bugs for a given product, or be used to make bugs for a product - totally read-only unless the group restrictions are met. The best way to - understand these relationships is by example. See - <xref linkend="group-control-examples"/> for examples of - product and group relationships. - </para> - - <note> - <para> - Products and Groups are not limited to a one-to-one relationship. - Multiple groups can be associated with the same product, and groups - can be associated with more than one product. - </para> - </note> - - <para> - If any group has <emphasis>Entry</emphasis> selected, then the - product will restrict bug entry to only those users - who are members of <emphasis>all</emphasis> the groups with - <emphasis>Entry</emphasis> selected. - </para> - - <para> - If any group has <emphasis>Canedit</emphasis> selected, - then the product will be read-only for any users - who are not members of <emphasis>all</emphasis> of the groups with - <emphasis>Canedit</emphasis> selected. <emphasis>Only</emphasis> users who - are members of all the <emphasis>Canedit</emphasis> groups - will be able to edit bugs for this product. This is an additional - restriction that enables finer-grained control over products rather - than just all-or-nothing access levels. - </para> - - <para> - The following settings let you - choose privileges on a <emphasis>per-product basis</emphasis>. - This is a convenient way to give privileges to - some users for some products only, without having - to give them global privileges which would affect - all products. - </para> - - <para> - Any group having <emphasis>editcomponents</emphasis> - selected allows users who are in this group to edit all - aspects of this product, including components, milestones - and versions. - </para> - - <para> - Any group having <emphasis>canconfirm</emphasis> selected - allows users who are in this group to confirm bugs - in this product. - </para> - - <para> - Any group having <emphasis>editbugs</emphasis> selected allows - users who are in this group to edit all fields of - bugs in this product. - </para> - - <para> - The <emphasis>MemberControl</emphasis> and - <emphasis>OtherControl</emphasis> are used in tandem to determine which - bugs will be placed in this group. The only allowable combinations of - these two parameters are listed in a table on the "Edit Group Access Controls" - page. Consult this table for details on how these fields can be used. - Examples of different uses are described below. - </para> - - <section id="group-control-examples"> - <title>Common Applications of Group Controls</title> - - <para> - The use of groups is best explained by providing examples that illustrate - configurations for common use cases. The examples follow a common syntax: - <emphasis>Group: Entry, MemberControl, OtherControl, CanEdit, - EditComponents, CanConfirm, EditBugs</emphasis>. Where "Group" is the name - of the group being edited for this product. The other fields all - correspond to the table on the "Edit Group Access Controls" page. If any - of these options are not listed, it means they are not checked. - </para> - - <para> - Basic Product/Group Restriction - </para> - - <para> - Suppose there is a product called "Bar". The - "Bar" product can only have bugs entered against it by users in the - group "Foo". Additionally, bugs filed against product "Bar" must stay - restricted to users to "Foo" at all times. Furthermore, only members - of group "Foo" can edit bugs filed against product "Bar", even if other - users could see the bug. This arrangement would achieved by the - following: - </para> - - <programlisting> -Product Bar: -foo: ENTRY, MANDATORY/MANDATORY, CANEDIT - </programlisting> - - <para> - Perhaps such strict restrictions are not needed for product "Bar". A - more lenient way to configure product "Bar" and group "Foo" would be: - </para> - - <programlisting> -Product Bar: -foo: ENTRY, SHOWN/SHOWN, EDITCOMPONENTS, CANCONFIRM, EDITBUGS - </programlisting> - - <para> - The above indicates that for product "Bar", members of group "Foo" can - enter bugs. Any one with permission to edit a bug against product "Bar" - can put the bug - in group "Foo", even if they themselves are not in "Foo". Anyone in group - "Foo" can edit all aspects of the components of product "Bar", can confirm - bugs against product "Bar", and can edit all fields of any bug against - product "Bar". - </para> - - <para> - General User Access With Security Group - </para> - - <para> - To permit any user to file bugs against "Product A", - and to permit any user to submit those bugs into a - group called "Security": - </para> - - <programlisting> -Product A: -security: SHOWN/SHOWN - </programlisting> - - <para> - General User Access With A Security Product - </para> - - <para> - To permit any user to file bugs against product called "Security" - while keeping those bugs from becoming visible to anyone - outside the group "SecurityWorkers" (unless a member of the - "SecurityWorkers" group removes that restriction): - </para> - - <programlisting> -Product Security: -securityworkers: DEFAULT/MANDATORY - </programlisting> - - <para> - Product Isolation With a Common Group - </para> - - <para> - To permit users of "Product A" to access the bugs for - "Product A", users of "Product B" to access the bugs for - "Product B", and support staff, who are members of the "Support - Group" to access both, three groups are needed: - </para> - - <orderedlist> - - <listitem> - <para>Support Group: Contains members of the support staff.</para> - </listitem> - - <listitem> - <para>AccessA Group: Contains users of product A and the Support group.</para> - </listitem> - - <listitem> - <para>AccessB Group: Contains users of product B and the Support group.</para> - </listitem> - - </orderedlist> - - <para> - Once these three groups are defined, the product group controls - can be set to: - </para> - - <programlisting> -Product A: -AccessA: ENTRY, MANDATORY/MANDATORY -Product B: -AccessB: ENTRY, MANDATORY/MANDATORY - </programlisting> - - <para> - Perhaps the "Support Group" wants more control. For example, - the "Support Group" could be permitted to make bugs inaccessible to - users of both groups "AccessA" and "AccessB". - Then, the "Support Group" could be permitted to publish - bugs relevant to all users in a third product (let's call it - "Product Common") that is read-only - to anyone outside the "Support Group". In this way the "Support Group" - could control bugs that should be seen by both groups. - That configuration would be: - </para> - - <programlisting> -Product A: -AccessA: ENTRY, MANDATORY/MANDATORY -Support: SHOWN/NA -Product B: -AccessB: ENTRY, MANDATORY/MANDATORY -Support: SHOWN/NA -Product Common: -Support: ENTRY, DEFAULT/MANDATORY, CANEDIT - </programlisting> - - <para> - Make a Product Read Only - </para> - - <para> - Sometimes a product is retired and should no longer have - new bugs filed against it (for example, an older version of a software - product that is no longer supported). A product can be made read-only - by creating a group called "readonly" and adding products to the - group as needed: - </para> - - <programlisting> -Product A: -ReadOnly: ENTRY, NA/NA, CANEDIT - </programlisting> - - <note> - <para> - For more information on Groups outside of how they relate to products - see <xref linkend="groups"/>. - </para> - </note> - - </section> - - </section> - - </section> - - <section id="components" xreflabel="Components"> - <title>Components</title> - - <para>Components are subsections of a Product. E.g. the computer game - you are designing may have a "UI" - component, an "API" component, a "Sound System" component, and a - "Plugins" component, each overseen by a different programmer. It - often makes sense to divide Components in Bugzilla according to the - natural divisions of responsibility within your Product or - company.</para> - - <para> - Each component has a default assignee and (if you turned it on in the parameters), - a QA Contact. The default assignee should be the primary person who fixes bugs in - that component. The QA Contact should be the person who will ensure - these bugs are completely fixed. The Assignee, QA Contact, and Reporter - will get email when new bugs are created in this Component and when - these bugs change. Default Assignee and Default QA Contact fields only - dictate the - <emphasis>default assignments</emphasis>; - these can be changed on bug submission, or at any later point in - a bug's life.</para> - - <para>To create a new Component:</para> - - <orderedlist> - <listitem> - <para>Select the <quote>Edit components</quote> link - from the <quote>Edit product</quote> page</para> - </listitem> - - <listitem> - <para>Select the <quote>Add</quote> link in the bottom right.</para> - </listitem> - - <listitem> - <para>Fill out the <quote>Component</quote> field, a - short <quote>Description</quote>, the - <quote>Default Assignee</quote>, <quote>Default CC List</quote> - and <quote>Default QA Contact</quote> (if enabled). - The <quote>Component Description</quote> field may contain a - limited subset of HTML tags. The <quote>Default Assignee</quote> - field must be a login name already existing in the Bugzilla database. - </para> - </listitem> - </orderedlist> - </section> - - <section id="versions"> - <title>Versions</title> - - <para>Versions are the revisions of the product, such as "Flinders - 3.1", "Flinders 95", and "Flinders 2000". Version is not a multi-select - field; the usual practice is to select the earliest version known to have - the bug. - </para> - - <para>To create and edit Versions:</para> - - <orderedlist> - <listitem> - <para>From the "Edit product" screen, select "Edit Versions"</para> - </listitem> - - <listitem> - <para>You will notice that the product already has the default - version "undefined". Click the "Add" link in the bottom right.</para> - </listitem> - - <listitem> - <para>Enter the name of the Version. This field takes text only. - Then click the "Add" button.</para> - </listitem> - - </orderedlist> - </section> - - <section id="milestones"> - <title>Milestones</title> - - <para>Milestones are "targets" that you plan to get a bug fixed by. For - example, you have a bug that you plan to fix for your 3.0 release, it - would be assigned the milestone of 3.0.</para> - - <note> - <para>Milestone options will only appear for a Product if you turned - on the "usetargetmilestone" parameter in the "Bug Fields" tab of the - "Parameters" page. - </para> - </note> - - <para>To create new Milestones, and set Default Milestones:</para> - - <orderedlist> - <listitem> - <para>Select "Edit milestones" from the "Edit product" page.</para> - </listitem> - - <listitem> - <para>Select "Add" in the bottom right corner.</para> - </listitem> - - <listitem> - <para>Enter the name of the Milestone in the "Milestone" field. You - can optionally set the "sortkey", which is a positive or negative - number (-32768 to 32767) that defines where in the list this particular - milestone appears. This is because milestones often do not - occur in alphanumeric order For example, "Future" might be - after "Release 1.2". Select "Add".</para> - </listitem> - </orderedlist> - </section> - - <section id="flags-overview"> - <title>Flags</title> - - <para> - Flags are a way to attach a specific status to a bug or attachment, - either <quote>+</quote> or <quote>-</quote>. The meaning of these symbols depends on the text - the flag itself, but contextually they could mean pass/fail, - accept/reject, approved/denied, or even a simple yes/no. If your site - allows requestable flags, then users may set a flag to <quote>?</quote> as a - request to another user that they look at the bug/attachment, and set - the flag to its correct status. - </para> - - <section id="flags-simpleexample"> - <title>A Simple Example</title> - - <para> - A developer might want to ask their manager, - <quote>Should we fix this bug before we release version 2.0?</quote> - They might want to do this for a <emphasis>lot</emphasis> of bugs, - so it would be nice to streamline the process... - </para> - <para> - In Bugzilla, it would work this way: - <orderedlist> - <listitem> - <para> - The Bugzilla administrator creates a flag type called - <quote>blocking2.0</quote> that shows up on all bugs in - your product. - </para> - - <para> - It shows up on the <quote>Show Bug</quote> screen - as the text <quote>blocking2.0</quote> with a drop-down box next - to it. The drop-down box contains four values: an empty space, - <quote>?</quote>, <quote>-</quote>, and <quote>+</quote>. - </para> - </listitem> - <listitem> - <para>The developer sets the flag to <quote>?</quote>.</para> - </listitem> - <listitem> - <para> - The manager sees the <computeroutput>blocking2.0</computeroutput> - flag with a <quote>?</quote> value. - </para> - </listitem> - <listitem> - <para> - If the manager thinks the feature should go into the product - before version 2.0 can be released, he sets the flag to - <quote>+</quote>. Otherwise, he sets it to <quote>-</quote>. - </para> - </listitem> - <listitem> - <para> - Now, every Bugzilla user who looks at the bug knows whether or - not the bug needs to be fixed before release of version 2.0. - </para> - </listitem> - </orderedlist> - </para> - - </section> - - <section id="flags-about"> - <title>About Flags</title> - - <section id="flag-values"> - <title>Values</title> - <para> - Flags can have three values: - <variablelist> - <varlistentry> - <term><computeroutput>?</computeroutput></term> - <listitem><simpara> - A user is requesting that a status be set. (Think of it as 'A question is being asked'.) - </simpara></listitem> - </varlistentry> - <varlistentry> - <term><computeroutput>-</computeroutput></term> - <listitem><simpara> - The status has been set negatively. (The question has been answered <quote>no</quote>.) - </simpara></listitem> - </varlistentry> - <varlistentry> - <term><computeroutput>+</computeroutput></term> - <listitem><simpara> - The status has been set positively. - (The question has been answered <quote>yes</quote>.) - </simpara></listitem> - </varlistentry> - </variablelist> - </para> - <para> - Actually, there's a fourth value a flag can have -- - <quote>unset</quote> -- which shows up as a blank space. This - just means that nobody has expressed an opinion (or asked - someone else to express an opinion) about this bug or attachment. - </para> - </section> - </section> - - <section id="flag-askto"> - <title>Using flag requests</title> - <para> - If a flag has been defined as 'requestable', and a user has enough privileges - to request it (see below), the user can set the flag's status to <quote>?</quote>. - This status indicates that someone (a.k.a. <quote>the requester</quote>) is asking - someone else to set the flag to either <quote>+</quote> or <quote>-</quote>. - </para> - <para> - If a flag has been defined as 'specifically requestable', - a text box will appear next to the flag into which the requester may - enter a Bugzilla username. That named person (a.k.a. <quote>the requestee</quote>) - will receive an email notifying them of the request, and pointing them - to the bug/attachment in question. - </para> - <para> - If a flag has <emphasis>not</emphasis> been defined as 'specifically requestable', - then no such text-box will appear. A request to set this flag cannot be made of - any specific individual, but must be asked <quote>to the wind</quote>. - A requester may <quote>ask the wind</quote> on any flag simply by leaving the text-box blank. - </para> - </section> - - <section id="flag-types"> - <title>Two Types of Flags</title> - - <para> - Flags can go in two places: on an attachment, or on a bug. - </para> - - <section id="flag-type-attachment"> - <title>Attachment Flags</title> - - <para> - Attachment flags are used to ask a question about a specific - attachment on a bug. - </para> - <para> - Many Bugzilla installations use this to - request that one developer <quote>review</quote> another - developer's code before they check it in. They attach the code to - a bug report, and then set a flag on that attachment called - <quote>review</quote> to - <computeroutput>review?boss@domain.com</computeroutput>. - boss@domain.com is then notified by email that - he has to check out that attachment and approve it or deny it. - </para> - - <para> - For a Bugzilla user, attachment flags show up in three places: - <orderedlist> - <listitem> - <para> - On the list of attachments in the <quote>Show Bug</quote> - screen, you can see the current state of any flags that - have been set to ?, +, or -. You can see who asked about - the flag (the requester), and who is being asked (the - requestee). - </para> - </listitem> - <listitem> - <para> - When you <quote>Edit</quote> an attachment, you can - see any settable flag, along with any flags that have - already been set. This <quote>Edit Attachment</quote> - screen is where you set flags to ?, -, +, or unset them. - </para> - </listitem> - <listitem> - <para> - Requests are listed in the <quote>Request Queue</quote>, which - is accessible from the <quote>My Requests</quote> link (if you are - logged in) or <quote>Requests</quote> link (if you are logged out) - visible in the footer of all pages. - </para> - </listitem> - </orderedlist> - </para> - - </section> - - <section id="flag-type-bug"> - <title>Bug Flags</title> - - <para> - Bug flags are used to set a status on the bug itself. You can - see Bug Flags in the <quote>Show Bug</quote> and <quote>Requests</quote> - screens, as described above. - </para> - <para> - Only users with enough privileges (see below) may set flags on bugs. - This doesn't necessarily include the assignee, reporter, or users with the - <computeroutput>editbugs</computeroutput> permission. - </para> - </section> - - </section> - - <section id="flags-admin"> - <title>Administering Flags</title> - - <para> - If you have the <quote>editcomponents</quote> permission, you can - edit Flag Types from the main administration page. Clicking the - <quote>Flags</quote> link will bring you to the <quote>Administer - Flag Types</quote> page. Here, you can select whether you want - to create (or edit) a Bug flag, or an Attachment flag. - </para> - <para> - No matter which you choose, the interface is the same, so we'll - just go over it once. - </para> - - <section id="flags-edit"> - <title>Editing a Flag</title> - <para> - To edit a flag's properties, just click the flag's name. - That will take you to the same - form as described below (<xref linkend="flags-create"/>). - </para> - </section> - - <section id="flags-create"> - <title>Creating a Flag</title> - - <para> - When you click on the <quote>Create a Flag Type for...</quote> - link, you will be presented with a form. Here is what the fields in - the form mean: - </para> - - <section id="flags-create-field-name"> - <title>Name</title> - <para> - This is the name of the flag. This will be displayed - to Bugzilla users who are looking at or setting the flag. - The name may contain any valid Unicode characters except commas - and spaces. - </para> - </section> - - <section id="flags-create-field-description"> - <title>Description</title> - <para> - The description describes the flag in more detail. It is visible - in a tooltip when hovering over a flag either in the <quote>Show Bug</quote> - or <quote>Edit Attachment</quote> pages. This field can be as - long as you like, and can contain any character you want. - </para> - </section> - - <section id="flags-create-field-category"> - <title>Category</title> - - <para> - Default behaviour for a newly-created flag is to appear on - products and all components, which is why <quote>__Any__:__Any__</quote> - is already entered in the <quote>Inclusions</quote> box. - If this is not your desired behaviour, you must either set some - exclusions (for products on which you don't want the flag to appear), - or you must remove <quote>__Any__:__Any__</quote> from the Inclusions box - and define products/components specifically for this flag. - </para> - - <para> - To create an Inclusion, select a Product from the top drop-down box. - You may also select a specific component from the bottom drop-down box. - (Setting <quote>__Any__</quote> for Product translates to, - <quote>all the products in this Bugzilla</quote>. - Selecting <quote>__Any__</quote> in the Component field means - <quote>all components in the selected product.</quote>) - Selections made, press <quote>Include</quote>, and your - Product/Component pairing will show up in the <quote>Inclusions</quote> box on the right. - </para> - - <para> - To create an Exclusion, the process is the same; select a Product from the - top drop-down box, select a specific component if you want one, and press - <quote>Exclude</quote>. The Product/Component pairing will show up in the - <quote>Exclusions</quote> box on the right. - </para> - - <para> - This flag <emphasis>will</emphasis> and <emphasis>can</emphasis> be set for any - products/components that appearing in the <quote>Inclusions</quote> box - (or which fall under the appropriate <quote>__Any__</quote>). - This flag <emphasis>will not</emphasis> appear (and therefore cannot be set) on - any products appearing in the <quote>Exclusions</quote> box. - <emphasis> IMPORTANT: Exclusions override inclusions.</emphasis> - </para> - - <para> - You may select a Product without selecting a specific Component, - but you can't select a Component without a Product, or to select a - Component that does not belong to the named Product. If you do so, - Bugzilla will display an error message, even if all your products - have a component by that name. - </para> - - <para><emphasis>Example:</emphasis> Let's say you have a product called - <quote>Jet Plane</quote> that has thousands of components. You want - to be able to ask if a problem should be fixed in the next model of - plane you release. We'll call the flag <quote>fixInNext</quote>. - But, there's one component in <quote>Jet Plane,</quote> - called <quote>Pilot.</quote> It doesn't make sense to release a - new pilot, so you don't want to have the flag show up in that component. - So, you include <quote>Jet Plane:__Any__</quote> and you exclude - <quote>Jet Plane:Pilot</quote>. - </para> - </section> - - <section id="flags-create-field-sortkey"> - <title>Sort Key</title> - <para> - Flags normally show up in alphabetical order. If you want them to - show up in a different order, you can use this key set the order on each flag. - Flags with a lower sort key will appear before flags with a higher - sort key. Flags that have the same sort key will be sorted alphabetically, - but they will still be after flags with a lower sort key, and before flags - with a higher sort key. - </para> - <para> - <emphasis>Example:</emphasis> I have AFlag (Sort Key 100), BFlag (Sort Key 10), - CFlag (Sort Key 10), and DFlag (Sort Key 1). These show up in - the order: DFlag, BFlag, CFlag, AFlag. - </para> - </section> - - <section id="flags-create-field-active"> - <title>Active</title> - <para> - Sometimes, you might want to keep old flag information in the - Bugzilla database, but stop users from setting any new flags of this type. - To do this, uncheck <quote>active</quote>. Deactivated - flags will still show up in the UI if they are ?, +, or -, but they - may only be cleared (unset), and cannot be changed to a new value. - Once a deactivated flag is cleared, it will completely disappear from a - bug/attachment, and cannot be set again. - </para> - </section> - - <section id="flags-create-field-requestable"> - <title>Requestable</title> - <para> - New flags are, by default, <quote>requestable</quote>, meaning that they - offer users the <quote>?</quote> option, as well as <quote>+</quote> - and <quote>-</quote>. - To remove the ? option, uncheck <quote>requestable</quote>. - </para> - </section> - - <section id="flags-create-field-specific"> - <title>Specifically Requestable</title> - <para> - By default this box is checked for new flags, meaning that users may make - flag requests of specific individuals. Unchecking this box will remove the - text box next to a flag; if it is still requestable, then requests may - only be made <quote>to the wind.</quote> Removing this after specific - requests have been made will not remove those requests; that data will - stay in the database (though it will no longer appear to the user). - </para> - </section> - - <section id="flags-create-field-multiplicable"> - <title>Multiplicable</title> - <para> - Any flag with <quote>Multiplicable</quote> set (default for new flags is 'on') - may be set more than once. After being set once, an unset flag - of the same type will appear below it with <quote>addl.</quote> (short for - <quote>additional</quote>) before the name. There is no limit to the number of - times a Multiplicable flags may be set on the same bug/attachment. - </para> - </section> - - <section id="flags-create-field-cclist"> - <title>CC List</title> - - <para> - If you want certain users to be notified every time this flag is - set to ?, -, +, or unset, add them here. This is a comma-separated - list of email addresses that need not be restricted to Bugzilla usernames. - </para> - </section> - - <section id="flags-create-grant-group"> - <title>Grant Group</title> - <para> - When this field is set to some given group, only users in the group - can set the flag to <quote>+</quote> and <quote>-</quote>. This - field does not affect who can request or cancel the flag. For that, - see the <quote>Request Group</quote> field below. If this field - is left blank, all users can set or delete this flag. This field is - useful for restricting which users can approve or reject requests. - </para> - </section> - - <section id="flags-create-request-group"> - <title>Request Group</title> - <para> - When this field is set to some given group, only users in the group - can request or cancel this flag. Note that this field has no effect - if the <quote>grant group</quote> field is empty. You can set the - value of this field to a different group, but both fields have to be - set to a group for this field to have an effect. - </para> - </section> - </section> <!-- flags-create --> - - <section id="flags-delete"> - <title>Deleting a Flag</title> - - <para> - When you are at the <quote>Administer Flag Types</quote> screen, - you will be presented with a list of Bug flags and a list of Attachment - Flags. - </para> - <para> - To delete a flag, click on the <quote>Delete</quote> link next to - the flag description. - </para> - <warning> - <para> - Once you delete a flag, it is <emphasis>gone</emphasis> from - your Bugzilla. All the data for that flag will be deleted. - Everywhere that flag was set, it will disappear, - and you cannot get that data back. If you want to keep flag data, - but don't want anybody to set any new flags or change current flags, - unset <quote>active</quote> in the flag Edit form. - </para> - </warning> - </section> - - </section> <!-- flags-admin --> - - <!-- XXX We should add a "Uses of Flags" section, here, with examples. --> - - </section> <!-- flags --> - - <section id="keywords"> - <title>Keywords</title> - - <para> - The administrator can define keywords which can be used to tag and - categorise bugs. For example, the keyword "regression" is commonly used. - A company might have a policy stating all regressions - must be fixed by the next release - this keyword can make tracking those - bugs much easier. - </para> - <para> - Keywords are global, rather than per-product. If the administrator changes - a keyword currently applied to any bugs, the keyword cache must be rebuilt - using the <xref linkend="sanitycheck"/> script. Currently keywords cannot - be marked obsolete to prevent future usage. - </para> - <para> - Keywords can be created, edited or deleted by clicking the "Keywords" - link in the admin page. There are two fields for each keyword - the keyword - itself and a brief description. Once created, keywords can be selected - and applied to individual bugs in that bug's "Details" section. - </para> - </section> - - <section id="custom-fields"> - <title>Custom Fields</title> - - <para> - The release of Bugzilla 3.0 added the ability to create Custom Fields. - Custom Fields are treated like any other field - they can be set in bugs - and used for search queries. Administrators should keep in mind that - adding too many fields can make the user interface more complicated and - harder to use. Custom Fields should be added only when necessary and with - careful consideration. - </para> - <tip> - <para> - Before adding a Custom Field, make sure that Bugzilla cannot already - do the desired behavior. Many Bugzilla options are not enabled by - default, and many times Administrators find that simply enabling - certain options that already exist is sufficient. - </para> - </tip> - <para> - Administrators can manage Custom Fields using the - <quote>Custom Fields</quote> link on the Administration page. The Custom - Fields administration page displays a list of Custom Fields, if any exist, - and a link to "Add a new custom field". - </para> - - <section id="add-custom-fields"> - <title>Adding Custom Fields</title> - - <para> - To add a new Custom Field, click the "Add a new custom field" link. This - page displays several options for the new field, described below. - </para> - - <para> - The following attributes must be set for each new custom field: - <itemizedlist> - <listitem> - <para> - <emphasis>Name:</emphasis> - The name of the field in the database, used internally. This name - MUST begin with <quote>cf_</quote> to prevent confusion with - standard fields. If this string is omitted, it will - be automatically added to the name entered. - </para> - </listitem> - - <listitem> - <para> - <emphasis>Description:</emphasis> - A brief string which is used as the label for this Custom Field. - That is the string that users will see, and should be - short and explicit. - </para> - </listitem> - - <listitem> - <para> - <emphasis>Type:</emphasis> - The type of field to create. There are - several types available: - <variablelist> - <varlistentry> - <term>Bug ID:</term> - <listitem> - <para> - A field where you can enter the ID of another bug from - the same Bugzilla installation. To point to a bug in a remote - installation, use the See Also field instead. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>Large Text Box:</term> - <listitem> - <para> - A multiple line box for entering free text. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>Free Text:</term> - <listitem> - <para> - A single line box for entering free text. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>Multiple-Selection Box:</term> - <listitem> - <para> - A list box where multiple options - can be selected. After creating this field, it must be edited - to add the selection options. See - <xref linkend="edit-values-list" /> for information about - editing legal values. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>Drop Down:</term> - <listitem> - <para> - A list box where only one option can be selected. - After creating this field, it must be edited to add the - selection options. See - <xref linkend="edit-values-list" /> for information about - editing legal values. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>Date/Time:</term> - <listitem> - <para> - A date field. This field appears with a - calendar widget for choosing the date. - </para> - </listitem> - </varlistentry> - </variablelist> - </para> - </listitem> - - <listitem> - <para> - <emphasis>Sortkey:</emphasis> - Integer that determines in which order Custom Fields are - displayed in the User Interface, especially when viewing a bug. - Fields with lower values are displayed first. - </para> - </listitem> - - <listitem> - <para> - <emphasis>Reverse Relationship Description:</emphasis> - When the custom field is of type <quote>Bug ID</quote>, you can - enter text here which will be used as label in the referenced - bug to list bugs which point to it. This gives you the ability - to have a mutual relationship between two bugs. - </para> - </listitem> - - <listitem> - <para> - <emphasis>Can be set on bug creation:</emphasis> - Boolean that determines whether this field can be set on - bug creation. If not selected, then a bug must be created - before this field can be set. See <xref linkend="bugreports" /> - for information about filing bugs. - </para> - </listitem> - - <listitem> - <para> - <emphasis>Displayed in bugmail for new bugs:</emphasis> - Boolean that determines whether the value set on this field - should appear in bugmail when the bug is filed. This attribute - has no effect if the field cannot be set on bug creation. - </para> - </listitem> - - <listitem> - <para> - <emphasis>Is obsolete:</emphasis> - Boolean that determines whether this field should - be displayed at all. Obsolete Custom Fields are hidden. - </para> - </listitem> - - <listitem> - <para> - <emphasis>Is mandatory:</emphasis> - Boolean that determines whether this field must be set. - For single and multi-select fields, this means that a (non-default) - value must be selected, and for text and date fields, some text - must be entered. - </para> - </listitem> - - <listitem> - <para> - <emphasis>Field only appears when:</emphasis> - A custom field can be made visible when some criteria is met. - For instance, when the bug belongs to one or more products, - or when the bug is of some given severity. If left empty, then - the custom field will always be visible, in all bugs. - </para> - </listitem> - - <listitem> - <para> - <emphasis>Field that controls the values that appear in this field:</emphasis> - When the custom field is of type <quote>Drop Down</quote> or - <quote>Multiple-Selection Box</quote>, you can restrict the - availability of the values of the custom field based on the - value of another field. This criteria is independent of the - criteria used in the <quote>Field only appears when</quote> - setting. For instance, you may decide that some given value - <quote>valueY</quote> is only available when the bug status - is RESOLVED while the value <quote>valueX</quote> should - always be listed. - Once you have selected the field which should control the - availability of the values of this custom field, you can - edit values of this custom field to set the criteria, see - <xref linkend="edit-values-list" />. - </para> - </listitem> - </itemizedlist> - </para> - </section> - - <section id="edit-custom-fields"> - <title>Editing Custom Fields</title> - - <para> - As soon as a Custom Field is created, its name and type cannot be - changed. If this field is a drop down menu, its legal values can - be set as described in <xref linkend="edit-values-list" />. All - other attributes can be edited as described above. - </para> - </section> - - <section id="delete-custom-fields"> - <title>Deleting Custom Fields</title> - - <para> - Only custom fields which are marked as obsolete, and which never - have been used, can be deleted completely (else the integrity - of the bug history would be compromised). For custom fields marked - as obsolete, a "Delete" link will appear in the <quote>Action</quote> - column. If the custom field has been used in the past, the deletion - will be rejected. But marking the field as obsolete is sufficient - to hide it from the user interface entirely. - </para> - </section> - </section> - - <section id="edit-values"> - <title>Legal Values</title> - - <para> - Legal values for the operating system, platform, bug priority and - severity, custom fields of type <quote>Drop Down</quote> and - <quote>Multiple-Selection Box</quote> (see <xref linkend="custom-fields" />), - as well as the list of valid bug statuses and resolutions can be - customized from the same interface. You can add, edit, disable and - remove values which can be used with these fields. - </para> - - <section id="edit-values-list"> - <title>Viewing/Editing legal values</title> - <para> - Editing legal values requires <quote>admin</quote> privileges. - Select "Field Values" from the Administration page. A list of all - fields, both system fields and Custom Fields, for which legal values - can be edited appears. Click a field name to edit its legal values. - </para> - <para> - There is no limit to how many values a field can have, but each value - must be unique to that field. The sortkey is important to display these - values in the desired order. - </para> - <para> - When the availability of the values of a custom field is controlled - by another field, you can select from here which value of the other field - must be set for the value of the custom field to appear. - </para> - </section> - - <section id="edit-values-delete"> - <title>Deleting legal values</title> - <para> - Legal values from Custom Fields can be deleted, but only if the - following two conditions are respected: - </para> - - <orderedlist> - <listitem> - <para>The value is not used by default for the field.</para> - </listitem> - - <listitem> - <para>No bug is currently using this value.</para> - </listitem> - </orderedlist> - - <para> - If any of these conditions is not respected, the value cannot be deleted. - The only way to delete these values is to reassign bugs to another value - and to set another value as default for the field. - </para> - </section> - </section> - - <section id="bug_status_workflow"> - <title>Bug Status Workflow</title> - - <para> - The bug status workflow is no longer hardcoded but can be freely customized - from the web interface. Only one bug status cannot be renamed nor deleted, - UNCONFIRMED, but the workflow involving it is free. The configuration - page displays all existing bug statuses twice, first on the left for bug - statuses we come from and on the top for bug statuses we move to. - If the checkbox is checked, then the transition between the two bug statuses - is legal, else it's forbidden independently of your privileges. The bug status - used for the "duplicate_or_move_bug_status" parameter must be part of the - workflow as that is the bug status which will be used when duplicating or - moving a bug, so it must be available from each bug status. - </para> - <para> - When the workflow is set, the "View Current Triggers" link below the table - lets you set which transitions require a comment from the user. - </para> - </section> - - <section id="voting"> - <title>Voting</title> - - <para>All of the code for voting in Bugzilla has been moved into an - extension, called "Voting", in the <filename>extensions/Voting/</filename> - directory. To enable it, you must remove the <filename>disabled</filename> - file from that directory, and run <filename>checksetup.pl</filename>.</para> - - <para>Voting allows users to be given a pot of votes which they can allocate - to bugs, to indicate that they'd like them fixed. - This allows developers to gauge - user need for a particular enhancement or bugfix. By allowing bugs with - a certain number of votes to automatically move from "UNCONFIRMED" to - "CONFIRMED", users of the bug system can help high-priority bugs garner - attention so they don't sit for a long time awaiting triage.</para> - - <para>To modify Voting settings:</para> - - <orderedlist> - <listitem> - <para>Navigate to the "Edit product" screen for the Product you - wish to modify</para> - </listitem> - - <listitem> - <para><emphasis>Maximum Votes per person</emphasis>: - Setting this field to "0" disables voting.</para> - </listitem> - - <listitem> - <para><emphasis>Maximum Votes a person can put on a single - bug</emphasis>: - It should probably be some number lower than the - "Maximum votes per person". Don't set this field to "0" if - "Maximum votes per person" is non-zero; that doesn't make - any sense.</para> - </listitem> - - <listitem> - <para><emphasis>Number of votes a bug in this product needs to - automatically get out of the UNCONFIRMED state</emphasis>: - Setting this field to "0" disables the automatic move of - bugs from UNCONFIRMED to CONFIRMED. - </para> - </listitem> - - <listitem> - <para>Once you have adjusted the values to your preference, click - "Update".</para> - </listitem> - </orderedlist> - </section> - - <section id="quips"> - <title>Quips</title> - - <para> - Quips are small text messages that can be configured to appear - next to search results. A Bugzilla installation can have its own specific - quips. Whenever a quip needs to be displayed, a random selection - is made from the pool of already existing quips. - </para> - - <para> - Quip submission is controlled by the <emphasis>quip_list_entry_control</emphasis> - parameter. It has several possible values: open, moderated, or closed. - In order to enable quips approval you need to set this parameter to - "moderated". In this way, users are free to submit quips for addition - but an administrator must explicitly approve them before they are - actually used. - </para> - - <para> - In order to see the user interface for the quips, it is enough to click - on a quip when it is displayed together with the search results. Or - it can be seen directly in the browser by visiting the quips.cgi URL - (prefixed with the usual web location of the Bugzilla installation). - Once the quip interface is displayed, it is enough to click the - "view and edit the whole quip list" in order to see the administration - page. A page with all the quips available in the database will - be displayed. - </para> - - <para> - Next to each quip there is a checkbox, under the - "Approved" column. Quips who have this checkbox checked are - already approved and will appear next to the search results. - The ones that have it unchecked are still preserved in the - database but they will not appear on search results pages. - User submitted quips have initially the checkbox unchecked. - </para> - - <para> - Also, there is a delete link next to each quip, - which can be used in order to permanently delete a quip. - </para> - - <para> - Display of quips is controlled by the <emphasis>display_quips</emphasis> - user preference. Possible values are "on" and "off". - </para> - </section> - - <section id="groups"> - <title>Groups and Group Security</title> - - <para> - Groups allow for separating bugs into logical divisions. - Groups are typically used - to isolate bugs that should only be seen by certain people. For - example, a company might create a different group for each one of its customers - or partners. Group permissions could be set so that each partner or customer would - only have access to their own bugs. Or, groups might be used to create - variable access controls for different departments within an organization. - Another common use of groups is to associate groups with products, - creating isolation and access control on a per-product basis. - </para> - - <para> - Groups and group behaviors are controlled in several places: - </para> - - <orderedlist> - - <listitem> - <para> - The group configuration page. To view or edit existing groups, or to - create new groups, access the "Groups" link from the "Administration" - page. This section of the manual deals primarily with the aspect of - group controls accessed on this page. - </para> - </listitem> - - <listitem> - <para> - Global configuration parameters. Bugzilla has several parameters - that control the overall default group behavior and restriction - levels. For more information on the parameters that control - group behavior globally, see <xref linkend="param-group-security"/>. - </para> - - </listitem> - - <listitem> - <para> - Product association with groups. Most of the functionality of groups - and group security is controlled at the product level. Some aspects - of group access controls for products are discussed in this section, - but for more detail see <xref linkend="product-group-controls"/>. - </para> - </listitem> - - <listitem> - <para> - Group access for users. See <xref linkend="users-and-groups"/> for - details on how users are assigned group access. - </para> - </listitem> - - </orderedlist> - - <para> - Group permissions are such that if a bug belongs to a group, only members - of that group can see the bug. If a bug is in more than one group, only - members of <emphasis>all</emphasis> the groups that the bug is in can see - the bug. For information on granting read-only access to certain people and - full edit access to others, see <xref linkend="product-group-controls"/>. - </para> - - <note> - <para> - By default, bugs can also be seen by the Assignee, the Reporter, and - by everyone on the CC List, regardless of whether or not the bug would - typically be viewable by them. Visibility to the Reporter and CC List can - be overridden (on a per-bug basis) by bringing up the bug, finding the - section that starts with <quote>Users in the roles selected below...</quote> - and un-checking the box next to either 'Reporter' or 'CC List' (or both). - </para> - </note> - - <section id="create-groups"> - <title>Creating Groups</title> - - <para> - To create a new group, follow the steps below: - </para> - - <orderedlist> - - <listitem> - <para> - Select the <quote>Administration</quote> link in the page footer, - and then select the <quote>Groups</quote> link from the - Administration page. - </para> - </listitem> - - <listitem> - <para> - A table of all the existing groups is displayed. Below the table is a - description of all the fields. To create a new group, select the - <quote>Add Group</quote> link under the table of existing groups. - </para> - </listitem> - - <listitem> - <para> - There are five fields to fill out. These fields are documented below - the form. Choose a name and description for the group. Decide whether - this group should be used for bugs (in all likelihood this should be - selected). Optionally, choose a regular expression that will - automatically add any matching users to the group, and choose an - icon that will help identify user comments for the group. The regular - expression can be useful, for example, to automatically put all users - from the same company into one group (if the group is for a specific - customer or partner). - </para> - <note> - <para> - If <quote>User RegExp</quote> is filled out, users whose email - addresses match the regular expression will automatically be - members of the group as long as their email addresses continue - to match the regular expression. If their email address changes - and no longer matches the regular expression, they will be removed - from the group. Versions 2.16 and older of Bugzilla did not automatically - remove users who's email addresses no longer matched the RegExp. - </para> - </note> - <warning> - <para> - If specifying a domain in the regular expression, end - the regexp with a "$". Otherwise, when granting access to - "@mycompany\.com", access will also be granted to - 'badperson@mycompany.com.cracker.net'. Use the syntax, - '@mycompany\.com$' for the regular expression. - </para> - </warning> - </listitem> - - <listitem> - <para> - After the new group is created, it can be edited for additional options. - The "Edit Group" page allows for specifying other groups that should be included - in this group and which groups should be permitted to add and delete - users from this group. For more details, see <xref linkend="edit-groups"/>. - </para> - </listitem> - </orderedlist> - - </section> - - <section id="edit-groups"> - <title>Editing Groups and Assigning Group Permissions</title> - - <para> - To access the "Edit Groups" page, select the - <quote>Administration</quote> link in the page footer, - and then select the <quote>Groups</quote> link from the Administration page. - A table of all the existing groups is displayed. Click on a group name - you wish to edit or control permissions for. - </para> - - <para> - The "Edit Groups" page contains the same five fields present when - creating a new group. Below that are two additional sections, "Group - Permissions," and "Mass Remove". The "Mass Remove" option simply removes - all users from the group who match the regular expression entered. The - "Group Permissions" section requires further explanation. - </para> - - <para> - The "Group Permissions" section on the "Edit Groups" page contains four sets - of permissions that control the relationship of this group to other - groups. If the 'usevisibilitygroups' parameter is in use (see - <xref linkend="parameters"/>) two additional sets of permissions are displayed. - Each set consists of two select boxes. On the left, a select box - with a list of all existing groups. On the right, a select box listing - all groups currently selected for this permission setting (this box will - be empty for new groups). The way these controls allow groups to relate - to one another is called <emphasis>inheritance</emphasis>. - Each of the six permissions is described below. - </para> - - <variablelist> - - <varlistentry> - - <term> - <emphasis>Groups That Are a Member of This Group</emphasis> - </term> - - <listitem> - <para> - Members of any groups selected here will automatically have - membership in this group. In other words, members of any selected - group will inherit membership in this group. - </para> - </listitem> - - </varlistentry> - - <varlistentry> - - <term> - <emphasis>Groups That This Group Is a Member Of</emphasis> - </term> - - <listitem> - <para> - Members of this group will inherit membership to any group - selected here. For example, suppose the group being edited is - an Admin group. If there are two products (Product1 and Product2) - and each product has its - own group (Group1 and Group2), and the Admin group - should have access to both products, - simply select both Group1 and Group2 here. - </para> - </listitem> - - </varlistentry> - - <varlistentry> - - <term> - <emphasis>Groups That Can Grant Membership in This Group</emphasis> - </term> - - <listitem> - <para> - The members of any group selected here will be able add users - to this group, even if they themselves are not in this group. - </para> - </listitem> - - </varlistentry> - - <varlistentry> - - <term> - <emphasis>Groups That This Group Can Grant Membership In</emphasis> - </term> - - <listitem> - <para> - Members of this group can add users to any group selected here, - even if they themselves are not in the selected groups. - </para> - </listitem> - - </varlistentry> - - <varlistentry> - - <term> - <emphasis>Groups That Can See This Group</emphasis> - </term> - - <listitem> - <para> - Members of any selected group can see the users in this group. - This setting is only visible if the 'usevisibilitygroups' parameter - is enabled on the Bugzilla Configuration page. See - <xref linkend="parameters"/> for information on configuring Bugzilla. - </para> - </listitem> - - </varlistentry> - - <varlistentry> - - <term> - <emphasis>Groups That This Group Can See</emphasis> - </term> - - <listitem> - <para> - Members of this group can see members in any of the selected groups. - This setting is only visible if the 'usevisibilitygroups' parameter - is enabled on the the Bugzilla Configuration page. See - <xref linkend="parameters"/> for information on configuring Bugzilla. - </para> - </listitem> - - </varlistentry> - - </variablelist> - - </section> - - <section id="users-and-groups"> - <title>Assigning Users to Groups</title> - - <para> - A User can become a member of a group in several ways: - </para> - - <orderedlist> - - <listitem> - <para> - The user can be explicitly placed in the group by editing - the user's profile. This can be done by accessing the "Users" page - from the "Administration" page. Use the search form to find the user - you want to edit group membership for, and click on their email - address in the search results to edit their profile. The profile - page lists all the groups, and indicates if the user is a member of - the group either directly or indirectly. More information on indirect - group membership is below. For more details on User administration, - see <xref linkend="useradmin"/>. - </para> - </listitem> - - <listitem> - <para> - The group can include another group of which the user is - a member. This is indicated by square brackets around the checkbox - next to the group name in the user's profile. - See <xref linkend="edit-groups"/> for details on group inheritance. - </para> - </listitem> - - <listitem> - <para> - The user's email address can match the regular expression - that has been specified to automatically grant membership to - the group. This is indicated by "*" around the check box by the - group name in the user's profile. - See <xref linkend="create-groups"/> for details on - the regular expression option when creating groups. - </para> - </listitem> - - </orderedlist> - - </section> - - <section> - <title>Assigning Group Controls to Products</title> - - <para> - The primary functionality of groups is derived from the relationship of - groups to products. The concepts around segregating access to bugs with - product group controls can be confusing. For details and examples on this - topic, see <xref linkend="product-group-controls" />. - </para> - - </section> - </section> - - <section id="sanitycheck"> - <title>Checking and Maintaining Database Integrity</title> - - <para> - Over time it is possible for the Bugzilla database to become corrupt - or to have anomalies. - This could happen through normal usage of Bugzilla, manual database - administration outside of the Bugzilla user interface, or from some - other unexpected event. Bugzilla includes a "Sanity Check" script that - can perform several basic database checks, and repair certain problems or - inconsistencies. - </para> - <para> - To run the "Sanity Check" script, log in as an Administrator and click the - "Sanity Check" link in the admin page. Any problems that are found will be - displayed in red letters. If the script is capable of fixing a problem, - it will present a link to initiate the fix. If the script cannot - fix the problem it will require manual database administration or recovery. - </para> - <para> - The "Sanity Check" script can also be run from the command line via the perl - script <filename>sanitycheck.pl</filename>. The script can also be run as - a <command>cron</command> job. Results will be delivered by email. - </para> - <para> - The "Sanity Check" script should be run on a regular basis as a matter of - best practice. - </para> - <warning> - <para> - The "Sanity Check" script is no substitute for a competent database - administrator. It is only designed to check and repair basic database - problems. - </para> - </warning> - - </section> - - -</chapter> - -<!-- Keep this comment at the end of the file -Local variables: -mode: sgml -sgml-always-quote-attributes:t -sgml-auto-insert-required-elements:t -sgml-balanced-tag-edit:t -sgml-exposed-tags:nil -sgml-general-insert-case:lower -sgml-indent-data:t -sgml-indent-step:2 -sgml-local-catalogs:nil -sgml-local-ecat-files:nil -sgml-minimize-attributes:nil -sgml-namecase-general:t -sgml-omittag:t -sgml-parent-document:("Bugzilla-Guide.xml" "book" "chapter") -sgml-shorttag:t -sgml-tag-region-if-active:t -End: ---> diff --git a/docs/en/xml/conventions.xml b/docs/en/xml/conventions.xml deleted file mode 100644 index 707146551..000000000 --- a/docs/en/xml/conventions.xml +++ /dev/null @@ -1,91 +0,0 @@ -<?xml version="1.0"?> -<!-- 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. ---> -<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" - "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ - <!ENTITY % myents SYSTEM "bugzilla.ent"> - %myents; -]> - -<section id="conventions"> - <title>Document Conventions</title> - - <para>This document uses the following conventions:</para> - - <caution> - <para>This is a caution. Make sure to read this to not be in trouble!</para> - </caution> - - <tip> - <para>This is a hint or tip, especially about some configuration tweaks.</para> - </tip> - - <note> - <para>This is just a note, for your information.</para> - </note> - - <warning> - <para>This is a warning, something you should take care of.</para> - </warning> - - <para> - A filename or a path to a filename is displayed like this: - <filename>/path/to/filename.ext</filename> - </para> - - <para> - A command to type in the shell is displayed like this: - <command>command --arguments</command> - </para> - - <para>bash$ represents a normal user's prompt under bash shell</para> - - <para>bash# represents a root user's prompt under bash shell</para> - - <para> - A word which is in the glossary will appear like this: - <glossterm linkend="gloss-bugzilla">Bugzilla</glossterm> - </para> - - <para> - A sample of code is illustrated like this: - <programlisting> -First Line of Code -Second Line of Code -... - </programlisting> - </para> - - <para> - This documentation is maintained in DocBook 4.2 XML format. - Changes are best submitted as plain text or XML diffs, attached - to a bug filed in the <ulink url="&bzg-bugs;">Bugzilla Documentation</ulink> - component. - </para> -</section> - -<!-- Keep this comment at the end of the file -Local variables: -mode: sgml -sgml-always-quote-attributes:t -sgml-auto-insert-required-elements:t -sgml-balanced-tag-edit:t -sgml-exposed-tags:nil -sgml-general-insert-case:lower -sgml-indent-data:t -sgml-indent-step:2 -sgml-local-catalogs:nil -sgml-local-ecat-files:nil -sgml-minimize-attributes:nil -sgml-namecase-general:t -sgml-omittag:t -sgml-parent-document:("Bugzilla-Guide.xml" "book" "chapter") -sgml-shorttag:t -sgml-tag-region-if-active:t -End: ---> diff --git a/docs/en/xml/customization.xml b/docs/en/xml/customization.xml deleted file mode 100644 index c140acf77..000000000 --- a/docs/en/xml/customization.xml +++ /dev/null @@ -1,612 +0,0 @@ -<?xml version="1.0"?> -<!-- 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. ---> -<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" - "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ - <!ENTITY % myents SYSTEM "bugzilla.ent"> - %myents; -]> - -<chapter id="customization"> - <title>Customizing Bugzilla</title> - - <section id="extensions"> - <title>Bugzilla Extensions</title> - - <para> - One of the best ways to customize Bugzilla is by writing a Bugzilla - Extension. Bugzilla Extensions let you modify both the code and - UI of Bugzilla in a way that can be distributed to other Bugzilla - users and ported forward to future versions of Bugzilla with minimal - effort. - </para> - - <para> - See the <ulink url="../html/api/Bugzilla/Extension.html">Bugzilla Extension - documentation</ulink> for information on how to write an Extension. - </para> - </section> - - <section id="cust-skins"> - <title>Custom Skins</title> - - <para> - Bugzilla allows you to have multiple skins. These are custom CSS and possibly - also custom images for Bugzilla. To create a new custom skin, you have two - choices: - <itemizedlist> - <listitem> - <para> - Make a single CSS file, and put it in the - <filename>skins/contrib</filename> directory. - </para> - </listitem> - <listitem> - <para> - Make a directory that contains all the same CSS file - names as <filename>skins/standard/</filename>, and put - your directory in <filename>skins/contrib/</filename>. - </para> - </listitem> - </itemizedlist> - </para> - - <para> - After you put the file or the directory there, make sure to run checksetup.pl - so that it can reset the file permissions correctly. - </para> - <para> - After you have installed the new skin, it will show up as an option in the - user's General Preferences. If you would like to force a particular skin on all - users, just select it in the Default Preferences and then uncheck "Enabled" on - the preference. - </para> - </section> - - <section id="cust-templates"> - <title>Template Customization</title> - - <para> - Administrators can configure the look and feel of Bugzilla without - having to edit Perl files or face the nightmare of massive merge - conflicts when they upgrade to a newer version in the future. - </para> - - <para> - Templatization also makes localized versions of Bugzilla possible, - for the first time. It's possible to have Bugzilla's UI language - determined by the user's browser. More information is available in - <xref linkend="template-http-accept"/>. - </para> - - <section id="template-directory"> - <title>Template Directory Structure</title> - <para> - The template directory structure starts with top level directory - named <filename>template</filename>, which contains a directory - for each installed localization. The next level defines the - language used in the templates. Bugzilla comes with English - templates, so the directory name is <filename>en</filename>, - and we will discuss <filename>template/en</filename> throughout - the documentation. Below <filename>template/en</filename> is the - <filename>default</filename> directory, which contains all the - standard templates shipped with Bugzilla. - </para> - - <warning> - <para> - A directory <filename>data/templates</filename> also exists; - this is where Template Toolkit puts the compiled versions of - the templates from either the default or custom directories. - <emphasis>Do not</emphasis> directly edit the files in this - directory, or all your changes will be lost the next time - Template Toolkit recompiles the templates. - </para> - </warning> - </section> - - <section id="template-method"> - <title>Choosing a Customization Method</title> - <para> - If you want to edit Bugzilla's templates, the first decision - you must make is how you want to go about doing so. There are two - choices, and which you use depends mainly on the scope of your - modifications, and the method you plan to use to upgrade Bugzilla. - </para> - - <para> - The first method of making customizations is to directly edit the - templates found in <filename>template/en/default</filename>. - This is probably the best way to go about it if you are going to - be upgrading Bugzilla through Bzr, because if you then execute - a <command>bzr update</command>, any changes you have made will - be merged automagically with the updated versions. - </para> - - <note> - <para> - If you use this method, and Bzr conflicts occur during an - update, the conflicted templates (and possibly other parts - of your installation) will not work until they are resolved. - </para> - </note> - - <para> - The second method is to copy the templates to be modified - into a mirrored directory structure under - <filename>template/en/custom</filename>. Templates in this - directory structure automatically override any identically-named - and identically-located templates in the - <filename>default</filename> directory. - </para> - - <note> - <para> - The <filename>custom</filename> directory does not exist - at first and must be created if you want to use it. - </para> - </note> - - <para> - The second method of customization should be used if you - use the overwriting method of upgrade, because otherwise - your changes will be lost. This method may also be better if - you are using the Bzr method of upgrading and are going to make major - changes, because it is guaranteed that the contents of this directory - will not be touched during an upgrade, and you can then decide whether - to continue using your own templates, or make the effort to merge your - changes into the new versions by hand. - </para> - - <para> - Using this method, your installation may break if incompatible - changes are made to the template interface. Such changes should - be documented in the release notes, provided you are using a - stable release of Bugzilla. If you use using unstable code, you will - need to deal with this one yourself, although if possible the changes - will be mentioned before they occur in the deprecations section of the - previous stable release's release notes. - </para> - - <note> - <para> - Regardless of which method you choose, it is recommended that - you run <command>./checksetup.pl</command> after - editing any templates in the <filename>template/en/default</filename> - directory, and after creating or editing any templates in the - <filename>custom</filename> directory. - </para> - </note> - - <warning> - <para> - It is <emphasis>required</emphasis> that you run - <command>./checksetup.pl</command> after creating a new - template in the <filename>custom</filename> directory. Failure - to do so will raise an incomprehensible error message. - </para> - </warning> - </section> - - <section id="template-edit"> - <title>How To Edit Templates</title> - - <note> - <para> - If you are making template changes that you intend on submitting back - for inclusion in standard Bugzilla, you should read the relevant - sections of the - <ulink url="http://www.bugzilla.org/docs/developer.html">Developers' - Guide</ulink>. - </para> - </note> - - <para> - The syntax of the Template Toolkit language is beyond the scope of - this guide. It's reasonably easy to pick up by looking at the current - templates; or, you can read the manual, available on the - <ulink url="http://www.template-toolkit.org">Template Toolkit home - page</ulink>. - </para> - - <para> - One thing you should take particular care about is the need - to properly HTML filter data that has been passed into the template. - This means that if the data can possibly contain special HTML characters - such as <, and the data was not intended to be HTML, they need to be - converted to entity form, i.e. &lt;. You use the 'html' filter in the - Template Toolkit to do this (or the 'uri' filter to encode special - characters in URLs). If you forget, you may open up your installation - to cross-site scripting attacks. - </para> - - <para> - Editing templates is a good way of doing a <quote>poor man's custom - fields</quote>. - For example, if you don't use the Status Whiteboard, but want to have - a free-form text entry box for <quote>Build Identifier</quote>, - then you can just - edit the templates to change the field labels. It's still be called - status_whiteboard internally, but your users don't need to know that. - </para> - - </section> - - - <section id="template-formats"> - <title>Template Formats and Types</title> - - <para> - Some CGI's have the ability to use more than one template. For example, - <filename>buglist.cgi</filename> can output itself as RDF, or as two - formats of HTML (complex and simple). The mechanism that provides this - feature is extensible. - </para> - - <para> - Bugzilla can support different types of output, which again can have - multiple formats. In order to request a certain type, you can append - the &ctype=<contenttype> (such as rdf or html) to the - <filename><cginame>.cgi</filename> URL. If you would like to - retrieve a certain format, you can use the &format=<format> - (such as simple or complex) in the URL. - </para> - - <para> - To see if a CGI supports multiple output formats and types, grep the - CGI for <quote>get_format</quote>. If it's not present, adding - multiple format/type support isn't too hard - see how it's done in - other CGIs, e.g. config.cgi. - </para> - - <para> - To make a new format template for a CGI which supports this, - open a current template for - that CGI and take note of the INTERFACE comment (if present.) This - comment defines what variables are passed into this template. If - there isn't one, I'm afraid you'll have to read the template and - the code to find out what information you get. - </para> - - <para> - Write your template in whatever markup or text style is appropriate. - </para> - - <para> - You now need to decide what content type you want your template - served as. The content types are defined in the - <filename>Bugzilla/Constants.pm</filename> file in the - <filename>contenttypes</filename> - constant. If your content type is not there, add it. Remember - the three- or four-letter tag assigned to your content type. - This tag will be part of the template filename. - </para> - - <note> - <para> - After adding or changing a content type, it's suitable to edit - <filename>Bugzilla/Constants.pm</filename> in order to reflect - the changes. Also, the file should be kept up to date after an - upgrade if content types have been customized in the past. - </para> - </note> - - <para> - Save the template as <filename><stubname>-<formatname>.<contenttypetag>.tmpl</filename>. - Try out the template by calling the CGI as - <filename><cginame>.cgi?format=<formatname>&ctype=<type></filename> . - </para> - </section> - - - <section id="template-specific"> - <title>Particular Templates</title> - - <para> - There are a few templates you may be particularly interested in - customizing for your installation. - </para> - - <para> - <command>index.html.tmpl</command>: - This is the Bugzilla front page. - </para> - - <para> - <command>global/header.html.tmpl</command>: - This defines the header that goes on all Bugzilla pages. - The header includes the banner, which is what appears to users - and is probably what you want to edit instead. However the - header also includes the HTML HEAD section, so you could for - example add a stylesheet or META tag by editing the header. - </para> - - <para> - <command>global/banner.html.tmpl</command>: - This contains the <quote>banner</quote>, the part of the header - that appears - at the top of all Bugzilla pages. The default banner is reasonably - barren, so you'll probably want to customize this to give your - installation a distinctive look and feel. It is recommended you - preserve the Bugzilla version number in some form so the version - you are running can be determined, and users know what docs to read. - </para> - - <para> - <command>global/footer.html.tmpl</command>: - This defines the footer that goes on all Bugzilla pages. Editing - this is another way to quickly get a distinctive look and feel for - your Bugzilla installation. - </para> - - <para> - <command>global/variables.none.tmpl</command>: - This defines a list of terms that may be changed in order to - <quote>brand</quote> the Bugzilla instance In this way, terms - like <quote>bugs</quote> can be replaced with <quote>issues</quote> - across the whole Bugzilla installation. The name - <quote>Bugzilla</quote> and other words can be customized as well. - </para> - - <para> - <command>list/table.html.tmpl</command>: - This template controls the appearance of the bug lists created - by Bugzilla. Editing this template allows per-column control of - the width and title of a column, the maximum display length of - each entry, and the wrap behaviour of long entries. - For long bug lists, Bugzilla inserts a 'break' every 100 bugs by - default; this behaviour is also controlled by this template, and - that value can be modified here. - </para> - - <para> - <command>bug/create/user-message.html.tmpl</command>: - This is a message that appears near the top of the bug reporting page. - By modifying this, you can tell your users how they should report - bugs. - </para> - - <para> - <command>bug/process/midair.html.tmpl</command>: - This is the page used if two people submit simultaneous changes to the - same bug. The second person to submit their changes will get this page - to tell them what the first person did, and ask if they wish to - overwrite those changes or go back and revisit the bug. The default - title and header on this page read "Mid-air collision detected!" If - you work in the aviation industry, or other environment where this - might be found offensive (yes, we have true stories of this happening) - you'll want to change this to something more appropriate for your - environment. - </para> - - <para> - <command>bug/create/create.html.tmpl</command> and - <command>bug/create/comment.txt.tmpl</command>: - You may not wish to go to the effort of creating custom fields in - Bugzilla, yet you want to make sure that each bug report contains - a number of pieces of important information for which there is not - a special field. The bug entry system has been designed in an - extensible fashion to enable you to add arbitrary HTML widgets, - such as drop-down lists or textboxes, to the bug entry page - and have their values appear formatted in the initial comment. - A hidden field that indicates the format should be added inside - the form in order to make the template functional. Its value should - be the suffix of the template filename. For example, if the file - is called <filename>create-cust.html.tmpl</filename>, then - <programlisting><input type="hidden" name="format" value="cust"></programlisting> - should be used inside the form. - </para> - - <para> - An example of this is the mozilla.org - <ulink url="http://landfill.bugzilla.org/bugzilla-tip/enter_bug.cgi?product=WorldControl;format=guided">guided - bug submission form</ulink>. The code for this comes with the Bugzilla - distribution as an example for you to copy. It can be found in the - files - <filename>create-guided.html.tmpl</filename> and - <filename>comment-guided.html.tmpl</filename>. - </para> - - <para> - So to use this feature, create a custom template for - <filename>enter_bug.cgi</filename>. The default template, on which you - could base it, is - <filename>custom/bug/create/create.html.tmpl</filename>. - Call it <filename>create-<formatname>.html.tmpl</filename>, and - in it, add widgets for each piece of information you'd like - collected - such as a build number, or set of steps to reproduce. - </para> - - <para> - Then, create a template like - <filename>custom/bug/create/comment.txt.tmpl</filename>, and call it - <filename>comment-<formatname>.txt.tmpl</filename>. This - template should reference the form fields you have created using - the syntax <filename>[% form.<fieldname> %]</filename>. When a - bug report is - submitted, the initial comment attached to the bug report will be - formatted according to the layout of this template. - </para> - - <para> - For example, if your custom enter_bug template had a field - <programlisting><input type="text" name="buildid" size="30"></programlisting> - and then your comment.txt.tmpl had - <programlisting>BuildID: [% form.buildid %]</programlisting> - then something like - <programlisting>BuildID: 20020303</programlisting> - would appear in the initial comment. - </para> - </section> - - - <section id="template-http-accept"> - <title>Configuring Bugzilla to Detect the User's Language</title> - - <para>Bugzilla honours the user's Accept: HTTP header. You can install - templates in other languages, and Bugzilla will pick the most appropriate - according to a priority order defined by you. Many - language templates can be obtained from <ulink - url="http://www.bugzilla.org/download.html#localizations"/>. Instructions - for submitting new languages are also available from that location. - </para> - </section> - - </section> - - <section id="cust-change-permissions"> - <title>Customizing Who Can Change What</title> - - <warning> - <para> - This feature should be considered experimental; the Bugzilla code you - will be changing is not stable, and could change or move between - versions. Be aware that if you make modifications as outlined here, - you may have - to re-make them or port them if Bugzilla changes internally between - versions, and you upgrade. - </para> - </warning> - - <para> - Companies often have rules about which employees, or classes of employees, - are allowed to change certain things in the bug system. For example, - only the bug's designated QA Contact may be allowed to VERIFY the bug. - Bugzilla has been - designed to make it easy for you to write your own custom rules to define - who is allowed to make what sorts of value transition. - </para> - - <para> - By default, assignees, QA owners and users - with <emphasis>editbugs</emphasis> privileges can edit all fields of bugs, - except group restrictions (unless they are members of the groups they - are trying to change). Bug reporters also have the ability to edit some - fields, but in a more restrictive manner. Other users, without - <emphasis>editbugs</emphasis> privileges, cannot edit - bugs, except to comment and add themselves to the CC list. - </para> - - <para> - For maximum flexibility, customizing this means editing Bugzilla's Perl - code. This gives the administrator complete control over exactly who is - allowed to do what. The relevant method is called - <filename>check_can_change_field()</filename>, - and is found in <filename>Bug.pm</filename> in your - Bugzilla/ directory. If you open that file and search for - <quote>sub check_can_change_field</quote>, you'll find it. - </para> - - <para> - This function has been carefully commented to allow you to see exactly - how it works, and give you an idea of how to make changes to it. - Certain marked sections should not be changed - these are - the <quote>plumbing</quote> which makes the rest of the function work. - In between those sections, you'll find snippets of code like: - <programlisting> # Allow the assignee to change anything. - if ($ownerid eq $whoid) { - return 1; - }</programlisting> - It's fairly obvious what this piece of code does. - </para> - - <para> - So, how does one go about changing this function? Well, simple changes - can be made just by removing pieces - for example, if you wanted to - prevent any user adding a comment to a bug, just remove the lines marked - <quote>Allow anyone to change comments.</quote> If you don't want the - Reporter to have any special rights on bugs they have filed, just - remove the entire section that deals with the Reporter. - </para> - - <para> - More complex customizations are not much harder. Basically, you add - a check in the right place in the function, i.e. after all the variables - you are using have been set up. So, don't look at $ownerid before - $ownerid has been obtained from the database. You can either add a - positive check, which returns 1 (allow) if certain conditions are true, - or a negative check, which returns 0 (deny.) E.g.: - <programlisting> if ($field eq "qacontact") { - if (Bugzilla->user->in_group("quality_assurance")) { - return 1; - } - else { - return 0; - } - }</programlisting> - This says that only users in the group "quality_assurance" can change - the QA Contact field of a bug. - </para> - - <para> - Getting more weird: - <programlisting><![CDATA[ if (($field eq "priority") && - (Bugzilla->user->email =~ /.*\@example\.com$/)) - { - if ($oldvalue eq "P1") { - return 1; - } - else { - return 0; - } - }]]></programlisting> - This says that if the user is trying to change the priority field, - and their email address is @example.com, they can only do so if the - old value of the field was "P1". Not very useful, but illustrative. - </para> - - <warning> - <para> - If you are modifying <filename>process_bug.cgi</filename> in any - way, do not change the code that is bounded by DO_NOT_CHANGE blocks. - Doing so could compromise security, or cause your installation to - stop working entirely. - </para> - </warning> - - <para> - For a list of possible field names, look at the bugs table in the - database. If you need help writing custom rules for your organization, - ask in the newsgroup. - </para> - </section> - - <section id="integration"> - <title>Integrating Bugzilla with Third-Party Tools</title> - - <para> - Many utilities and applications can integrate with Bugzilla, - either on the client- or server-side. None of them are maintained - by the Bugzilla community, nor are they tested during our - QA tests, so use them at your own risk. They are listed at - <ulink url="https://wiki.mozilla.org/Bugzilla:Addons" />. - </para> - </section> - -</chapter> - -<!-- Keep this comment at the end of the file -Local variables: -mode: sgml -sgml-always-quote-attributes:t -sgml-auto-insert-required-elements:t -sgml-balanced-tag-edit:t -sgml-exposed-tags:nil -sgml-general-insert-case:lower -sgml-indent-data:t -sgml-indent-step:2 -sgml-local-catalogs:nil -sgml-local-ecat-files:nil -sgml-minimize-attributes:nil -sgml-namecase-general:t -sgml-omittag:t -sgml-parent-document:("Bugzilla-Guide.xml" "book" "chapter") -sgml-shorttag:t -sgml-tag-region-if-active:t -End: ---> diff --git a/docs/en/xml/gfdl.xml b/docs/en/xml/gfdl.xml deleted file mode 100644 index 4d10f28f0..000000000 --- a/docs/en/xml/gfdl.xml +++ /dev/null @@ -1,457 +0,0 @@ -<?xml version="1.0"?> -<!-- 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. ---> -<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" - "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ - <!ENTITY % myents SYSTEM "bugzilla.ent"> - %myents; -]> - -<appendix id="gfdl"> - <title>GNU Free Documentation License</title> - -<!-- - GNU Project - Free Software Foundation (FSF) --> -<!-- LINK REV="made" HREF="mailto:webmasters@gnu.org" --> -<!-- section> - <title>GNU Free Documentation License</title --> - <para>Version 1.1, March 2000</para> - - <blockquote> - <para>Copyright (C) 2000 Free Software Foundation, Inc. 51 Franklin Street, - Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and - distribute verbatim copies of this license document, but changing it is - not allowed.</para> - </blockquote> - - <section label="0" id="gfdl-0"> - <title>Preamble</title> - - <para>The purpose of this License is to make a manual, textbook, or other - written document "free" in the sense of freedom: to assure everyone the - effective freedom to copy and redistribute it, with or without modifying - it, either commercially or noncommercially. Secondarily, this License - preserves for the author and publisher a way to get credit for their - work, while not being considered responsible for modifications made by - others.</para> - - <para>This License is a kind of "copyleft", which means that derivative - works of the document must themselves be free in the same sense. It - complements the GNU General Public License, which is a copyleft license - designed for free software.</para> - - <para>We have designed this License in order to use it for manuals for - free software, because free software needs free documentation: a free - program should come with manuals providing the same freedoms that the - software does. But this License is not limited to software manuals; it - can be used for any textual work, regardless of subject matter or whether - it is published as a printed book. We recommend this License principally - for works whose purpose is instruction or reference.</para> - </section> - - <section label="1" id="gfdl-1"> - <title>Applicability and Definition</title> - - <para>This License applies to any manual or other work that contains a - notice placed by the copyright holder saying it can be distributed under - the terms of this License. The "Document", below, refers to any such - manual or work. Any member of the public is a licensee, and is addressed - as "you".</para> - - <para>A "Modified Version" of the Document means any work containing the - Document or a portion of it, either copied verbatim, or with - modifications and/or translated into another language.</para> - - <para>A "Secondary Section" is a named appendix or a front-matter section - of the Document that deals exclusively with the relationship of the - publishers or authors of the Document to the Document's overall subject - (or to related matters) and contains nothing that could fall directly - within that overall subject. (For example, if the Document is in part a - textbook of mathematics, a Secondary Section may not explain any - mathematics.) The relationship could be a matter of historical connection - with the subject or with related matters, or of legal, commercial, - philosophical, ethical or political position regarding them.</para> - - <para>The "Invariant Sections" are certain Secondary Sections whose - titles are designated, as being those of Invariant Sections, in the - notice that says that the Document is released under this License.</para> - - <para>The "Cover Texts" are certain short passages of text that are - listed, as Front-Cover Texts or Back-Cover Texts, in the notice that says - that the Document is released under this License.</para> - - <para>A "Transparent" copy of the Document means a machine-readable copy, - represented in a format whose specification is available to the general - public, whose contents can be viewed and edited directly and - straightforwardly with generic text editors or (for images composed of - pixels) generic paint programs or (for drawings) some widely available - drawing editor, and that is suitable for input to text formatters or for - automatic translation to a variety of formats suitable for input to text - formatters. A copy made in an otherwise Transparent file format whose - markup has been designed to thwart or discourage subsequent modification - by readers is not Transparent. A copy that is not "Transparent" is called - "Opaque".</para> - - <para>Examples of suitable formats for Transparent copies include plain - ASCII without markup, Texinfo input format, LaTeX input format, SGML or - XML using a publicly available DTD, and standard-conforming simple HTML - designed for human modification. Opaque formats include PostScript, PDF, - proprietary formats that can be read and edited only by proprietary word - processors, SGML or XML for which the DTD and/or processing tools are not - generally available, and the machine-generated HTML produced by some word - processors for output purposes only.</para> - - <para>The "Title Page" means, for a printed book, the title page itself, - plus such following pages as are needed to hold, legibly, the material - this License requires to appear in the title page. For works in formats - which do not have any title page as such, "Title Page" means the text - near the most prominent appearance of the work's title, preceding the - beginning of the body of the text.</para> - </section> - - <section label="2" id="gfdl-2"> - <title>Verbatim Copying</title> - - <para>You may copy and distribute the Document in any medium, either - commercially or noncommercially, provided that this License, the - copyright notices, and the license notice saying this License applies to - the Document are reproduced in all copies, and that you add no other - conditions whatsoever to those of this License. You may not use technical - measures to obstruct or control the reading or further copying of the - copies you make or distribute. However, you may accept compensation in - exchange for copies. If you distribute a large enough number of copies - you must also follow the conditions in section 3.</para> - - <para>You may also lend copies, under the same conditions stated above, - and you may publicly display copies.</para> - </section> - - <section label="3" id="gfdl-3"> - <title>Copying in Quantity</title> - - <para>If you publish printed copies of the Document numbering more than - 100, and the Document's license notice requires Cover Texts, you must - enclose the copies in covers that carry, clearly and legibly, all these - Cover Texts: Front-Cover Texts on the front cover, and Back-Cover Texts - on the back cover. Both covers must also clearly and legibly identify you - as the publisher of these copies. The front cover must present the full - title with all words of the title equally prominent and visible. You may - add other material on the covers in addition. Copying with changes - limited to the covers, as long as they preserve the title of the Document - and satisfy these conditions, can be treated as verbatim copying in other - respects.</para> - - <para>If the required texts for either cover are too voluminous to fit - legibly, you should put the first ones listed (as many as fit reasonably) - on the actual cover, and continue the rest onto adjacent pages.</para> - - <para>If you publish or distribute Opaque copies of the Document - numbering more than 100, you must either include a machine-readable - Transparent copy along with each Opaque copy, or state in or with each - Opaque copy a publicly-accessible computer-network location containing a - complete Transparent copy of the Document, free of added material, which - the general network-using public has access to download anonymously at no - charge using public-standard network protocols. If you use the latter - option, you must take reasonably prudent steps, when you begin - distribution of Opaque copies in quantity, to ensure that this - Transparent copy will remain thus accessible at the stated location until - at least one year after the last time you distribute an Opaque copy - (directly or through your agents or retailers) of that edition to the - public.</para> - - <para>It is requested, but not required, that you contact the authors of - the Document well before redistributing any large number of copies, to - give them a chance to provide you with an updated version of the - Document.</para> - </section> - - <section label="4" id="gfdl-4"> - <title>Modifications</title> - - <para>You may copy and distribute a Modified Version of the Document - under the conditions of sections 2 and 3 above, provided that you release - the Modified Version under precisely this License, with the Modified - Version filling the role of the Document, thus licensing distribution and - modification of the Modified Version to whoever possesses a copy of it. - In addition, you must do these things in the Modified Version:</para> - - <orderedlist numeration="upperalpha"> - <listitem> - <para>Use in the Title Page (and on the covers, if any) a title - distinct from that of the Document, and from those of previous - versions (which should, if there were any, be listed in the History - section of the Document). You may use the same title as a previous - version if the original publisher of that version gives - permission.</para> - </listitem> - - <listitem> - <para>List on the Title Page, as authors, one or more persons or - entities responsible for authorship of the modifications in the - Modified Version, together with at least five of the principal - authors of the Document (all of its principal authors, if it has less - than five).</para> - </listitem> - - <listitem> - <para>State on the Title page the name of the publisher of the - Modified Version, as the publisher.</para> - </listitem> - - <listitem> - <para>Preserve all the copyright notices of the Document.</para> - </listitem> - - <listitem> - <para>Add an appropriate copyright notice for your modifications - adjacent to the other copyright notices.</para> - </listitem> - - <listitem> - <para>Include, immediately after the copyright notices, a license - notice giving the public permission to use the Modified Version under - the terms of this License, in the form shown in the Addendum - below.</para> - </listitem> - - <listitem> - <para>Preserve in that license notice the full lists of Invariant - Sections and required Cover Texts given in the Document's license - notice.</para> - </listitem> - - <listitem> - <para>Include an unaltered copy of this License.</para> - </listitem> - - <listitem> - <para>Preserve the section entitled "History", and its title, and add - to it an item stating at least the title, year, new authors, and - publisher of the Modified Version as given on the Title Page. If - there is no section entitled "History" in the Document, create one - stating the title, year, authors, and publisher of the Document as - given on its Title Page, then add an item describing the Modified - Version as stated in the previous sentence.</para> - </listitem> - - <listitem> - <para>Preserve the network location, if any, given in the Document - for public access to a Transparent copy of the Document, and likewise - the network locations given in the Document for previous versions it - was based on. These may be placed in the "History" section. You may - omit a network location for a work that was published at least four - years before the Document itself, or if the original publisher of the - version it refers to gives permission.</para> - </listitem> - - <listitem> - <para>In any section entitled "Acknowledgements" or "Dedications", - preserve the section's title, and preserve in the section all the - substance and tone of each of the contributor acknowledgements and/or - dedications given therein.</para> - </listitem> - - <listitem> - <para>Preserve all the Invariant Sections of the Document, unaltered - in their text and in their titles. Section numbers or the equivalent - are not considered part of the section titles.</para> - </listitem> - - <listitem> - <para>Delete any section entitled "Endorsements". Such a section may - not be included in the Modified Version.</para> - </listitem> - - <listitem> - <para>Do not retitle any existing section as "Endorsements" or to - conflict in title with any Invariant Section.</para> - </listitem> - </orderedlist> - - <para>If the Modified Version includes new front-matter sections or - appendices that qualify as Secondary Sections and contain no material - copied from the Document, you may at your option designate some or all of - these sections as invariant. To do this, add their titles to the list of - Invariant Sections in the Modified Version's license notice. These titles - must be distinct from any other section titles.</para> - - <para>You may add a section entitled "Endorsements", provided it contains - nothing but endorsements of your Modified Version by various parties--for - example, statements of peer review or that the text has been approved by - an organization as the authoritative definition of a standard.</para> - - <para>You may add a passage of up to five words as a Front-Cover Text, - and a passage of up to 25 words as a Back-Cover Text, to the end of the - list of Cover Texts in the Modified Version. Only one passage of - Front-Cover Text and one of Back-Cover Text may be added by (or through - arrangements made by) any one entity. If the Document already includes a - cover text for the same cover, previously added by you or by arrangement - made by the same entity you are acting on behalf of, you may not add - another; but you may replace the old one, on explicit permission from the - previous publisher that added the old one.</para> - - <para>The author(s) and publisher(s) of the Document do not by this - License give permission to use their names for publicity for or to assert - or imply endorsement of any Modified Version.</para> - </section> - - <section label="5" id="gfdl-5"> - <title>Combining Documents</title> - - <para>You may combine the Document with other documents released under - this License, under the terms defined in section 4 above for modified - versions, provided that you include in the combination all of the - Invariant Sections of all of the original documents, unmodified, and list - them all as Invariant Sections of your combined work in its license - notice.</para> - - <para>The combined work need only contain one copy of this License, and - multiple identical Invariant Sections may be replaced with a single copy. - If there are multiple Invariant Sections with the same name but different - contents, make the title of each such section unique by adding at the end - of it, in parentheses, the name of the original author or publisher of - that section if known, or else a unique number. Make the same adjustment - to the section titles in the list of Invariant Sections in the license - notice of the combined work.</para> - - <para>In the combination, you must combine any sections entitled - "History" in the various original documents, forming one section entitled - "History"; likewise combine any sections entitled "Acknowledgements", and - any sections entitled "Dedications". You must delete all sections - entitled "Endorsements."</para> - </section> - - <section label="6" id="gfdl-6"> - <title>Collections of Documents</title> - - <para>You may make a collection consisting of the Document and other - documents released under this License, and replace the individual copies - of this License in the various documents with a single copy that is - included in the collection, provided that you follow the rules of this - License for verbatim copying of each of the documents in all other - respects.</para> - - <para>You may extract a single document from such a collection, and - distribute it individually under this License, provided you insert a copy - of this License into the extracted document, and follow this License in - all other respects regarding verbatim copying of that document.</para> - </section> - - <section label="7" id="gfdl-7"> - <title>Aggregation with Independent Works</title> - - <para>A compilation of the Document or its derivatives with other - separate and independent documents or works, in or on a volume of a - storage or distribution medium, does not as a whole count as a Modified - Version of the Document, provided no compilation copyright is claimed for - the compilation. Such a compilation is called an "aggregate", and this - License does not apply to the other self-contained works thus compiled - with the Document, on account of their being thus compiled, if they are - not themselves derivative works of the Document.</para> - - <para>If the Cover Text requirement of section 3 is applicable to these - copies of the Document, then if the Document is less than one quarter of - the entire aggregate, the Document's Cover Texts may be placed on covers - that surround only the Document within the aggregate. Otherwise they must - appear on covers around the whole aggregate.</para> - </section> - - <section label="8" id="gfdl-8"> - <title>Translation</title> - - <para>Translation is considered a kind of modification, so you may - distribute translations of the Document under the terms of section 4. - Replacing Invariant Sections with translations requires special - permission from their copyright holders, but you may include translations - of some or all Invariant Sections in addition to the original versions of - these Invariant Sections. You may include a translation of this License - provided that you also include the original English version of this - License. In case of a disagreement between the translation and the - original English version of this License, the original English version - will prevail.</para> - </section> - - <section label="9" id="gfdl-9"> - <title>Termination</title> - - <para>You may not copy, modify, sublicense, or distribute the Document - except as expressly provided for under this License. Any other attempt to - copy, modify, sublicense or distribute the Document is void, and will - automatically terminate your rights under this License. However, parties - who have received copies, or rights, from you under this License will not - have their licenses terminated so long as such parties remain in full - compliance.</para> - </section> - - <section label="10" id="gfdl-10"> - <title>Future Revisions of this License</title> - - <para>The Free Software Foundation may publish new, revised versions of - the GNU Free Documentation License from time to time. Such new versions - will be similar in spirit to the present version, but may differ in - detail to address new problems or concerns. See - <ulink url="http://www.gnu.org/copyleft/"/>.</para> - - <para>Each version of the License is given a distinguishing version - number. If the Document specifies that a particular numbered version of - this License "or any later version" applies to it, you have the option of - following the terms and conditions either of that specified version or of - any later version that has been published (not as a draft) by the Free - Software Foundation. If the Document does not specify a version number of - this License, you may choose any version ever published (not as a draft) - by the Free Software Foundation.</para> - </section> - - <section label="" id="gfdl-howto"> - <title>How to use this License for your documents</title> - - <para>To use this License in a document you have written, include a copy - of the License in the document and put the following copyright and - license notices just after the title page:</para> - - <blockquote> - <para>Copyright (c) YEAR YOUR NAME. Permission is granted to copy, - distribute and/or modify this document under the terms of the GNU Free - Documentation License, Version 1.1 or any later version published by - the Free Software Foundation; with the Invariant Sections being LIST - THEIR TITLES, with the Front-Cover Texts being LIST, and with the - Back-Cover Texts being LIST. A copy of the license is included in the - section entitled "GNU Free Documentation License".</para> - </blockquote> - - <para>If you have no Invariant Sections, write "with no Invariant - Sections" instead of saying which ones are invariant. If you have no - Front-Cover Texts, write "no Front-Cover Texts" instead of "Front-Cover - Texts being LIST"; likewise for Back-Cover Texts.</para> - - <para>If your document contains nontrivial examples of program code, we - recommend releasing these examples in parallel under your choice of free - software license, such as the GNU General Public License, to permit their - use in free software.</para> - </section> -</appendix> - -<!-- Keep this comment at the end of the file -Local variables: -mode: sgml -sgml-always-quote-attributes:t -sgml-auto-insert-required-elements:t -sgml-balanced-tag-edit:t -sgml-exposed-tags:nil -sgml-general-insert-case:lower -sgml-indent-data:t -sgml-indent-step:2 -sgml-local-catalogs:nil -sgml-local-ecat-files:nil -sgml-minimize-attributes:nil -sgml-namecase-general:t -sgml-omittag:t -sgml-parent-document:("Bugzilla-Guide.xml" "book" "chapter") -sgml-shorttag:t -sgml-tag-region-if-active:t -End: ---> diff --git a/docs/en/xml/glossary.xml b/docs/en/xml/glossary.xml deleted file mode 100644 index 5458fa32d..000000000 --- a/docs/en/xml/glossary.xml +++ /dev/null @@ -1,561 +0,0 @@ -<?xml version="1.0"?> -<!-- 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. ---> -<!DOCTYPE glossary PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" - "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ - <!ENTITY % myents SYSTEM "bugzilla.ent"> - %myents; -]> - -<glossary id="glossary"> - <glossdiv> - <title>0-9, high ascii</title> - - <glossentry id="gloss-htaccess"> - <glossterm>.htaccess</glossterm> - - <glossdef> - <para>Apache web server, and other NCSA-compliant web servers, - observe the convention of using files in directories called - <filename>.htaccess</filename> - - to restrict access to certain files. In Bugzilla, they are used - to keep secret files which would otherwise - compromise your installation - e.g. the - <filename>localconfig</filename> - file contains the password to your database. - curious.</para> - </glossdef> - </glossentry> - </glossdiv> - - <glossdiv id="gloss-a"> - <title>A</title> - - <glossentry id="gloss-apache"> - <glossterm>Apache</glossterm> - - <glossdef> - <para>In this context, Apache is the web server most commonly used - for serving up Bugzilla - pages. Contrary to popular belief, the apache web server has nothing - to do with the ancient and noble Native American tribe, but instead - derived its name from the fact that it was - <quote>a patchy</quote> - version of the original - <acronym>NCSA</acronym> - world-wide-web server.</para> - - <variablelist> - <title>Useful Directives when configuring Bugzilla</title> - - <varlistentry> - <term><computeroutput><ulink url="http://httpd.apache.org/docs/2.0/mod/mod_mime.html#addhandler">AddHandler</ulink></computeroutput></term> - <listitem> - <para>Tell Apache that it's OK to run CGI scripts.</para> - </listitem> - </varlistentry> - <varlistentry> - <term><computeroutput><ulink url="http://httpd.apache.org/docs-2.0/mod/core.html#allowoverride">AllowOverride</ulink></computeroutput></term> - <term><computeroutput><ulink url="http://httpd.apache.org/docs-2.0/mod/core.html#options">Options</ulink></computeroutput></term> - <listitem> - <para>These directives are used to tell Apache many things about - the directory they apply to. For Bugzilla's purposes, we need - them to allow script execution and <filename>.htaccess</filename> - overrides. - </para> - </listitem> - </varlistentry> - <varlistentry> - <term><computeroutput><ulink url="http://httpd.apache.org/docs-2.0/mod/mod_dir.html#directoryindex">DirectoryIndex</ulink></computeroutput></term> - <listitem> - <para>Used to tell Apache what files are indexes. If you can - not add <filename>index.cgi</filename> to the list of valid files, - you'll need to set <computeroutput>$index_html</computeroutput> to - 1 in <filename>localconfig</filename> so - <command>./checksetup.pl</command> will create an - <filename>index.html</filename> that redirects to - <filename>index.cgi</filename>. - </para> - </listitem> - </varlistentry> - <varlistentry> - <term><computeroutput><ulink url="http://httpd.apache.org/docs-2.0/mod/core.html#scriptinterpretersource">ScriptInterpreterSource</ulink></computeroutput></term> - <listitem> - <para>Used when running Apache on windows so the shebang line - doesn't have to be changed in every Bugzilla script. - </para> - </listitem> - </varlistentry> - </variablelist> - - <para>For more information about how to configure Apache for Bugzilla, - see <xref linkend="http-apache"/>. - </para> - </glossdef> - </glossentry> - </glossdiv> - - <glossdiv id="gloss-b"> - <title>B</title> - - <glossentry> - <glossterm>Bug</glossterm> - - <glossdef> - <para>A - <quote>bug</quote> - - in Bugzilla refers to an issue entered into the database which has an - associated number, assignments, comments, etc. Some also refer to a - <quote>tickets</quote> - or - <quote>issues</quote>; - in the context of Bugzilla, they are synonymous.</para> - </glossdef> - </glossentry> - - <glossentry> - <glossterm>Bug Number</glossterm> - - <glossdef> - <para>Each Bugzilla bug is assigned a number that uniquely identifies - that bug. The bug associated with a bug number can be pulled up via a - query, or easily from the very front page by typing the number in the - "Find" box.</para> - </glossdef> - </glossentry> - - <glossentry id="gloss-bugzilla"> - <glossterm>Bugzilla</glossterm> - - <glossdef> - <para>Bugzilla is the world-leading free software bug tracking system. - </para> - </glossdef> - </glossentry> - </glossdiv> - - <glossdiv id="gloss-c"> - <title>C</title> - - <glossentry id="gloss-cgi"> - <glossterm>Common Gateway Interface</glossterm> - <acronym>CGI</acronym> - <glossdef> - <para><acronym>CGI</acronym> is an acronym for Common Gateway Interface. This is - a standard for interfacing an external application with a web server. Bugzilla - is an example of a <acronym>CGI</acronym> application. - </para> - </glossdef> - </glossentry> - - <glossentry id="gloss-component"> - <glossterm>Component</glossterm> - - <glossdef> - <para>A Component is a subsection of a Product. It should be a narrow - category, tailored to your organization. All Products must contain at - least one Component (and, as a matter of fact, creating a Product - with no Components will create an error in Bugzilla).</para> - </glossdef> - </glossentry> - - <glossentry id="gloss-cpan"> - <glossterm>Comprehensive Perl Archive Network</glossterm> - <acronym>CPAN</acronym> - - <!-- TODO: Rewrite def for CPAN --> - <glossdef> - <para> - <acronym>CPAN</acronym> - - stands for the - <quote>Comprehensive Perl Archive Network</quote>. - CPAN maintains a large number of extremely useful - <glossterm>Perl</glossterm> - modules - encapsulated chunks of code for performing a - particular task.</para> - </glossdef> - </glossentry> - - <glossentry id="gloss-contrib"> - <glossterm><filename class="directory">contrib</filename></glossterm> - - <glossdef> - <para>The <filename class="directory">contrib</filename> directory is - a location to put scripts that have been contributed to Bugzilla but - are not a part of the official distribution. These scripts are written - by third parties and may be in languages other than perl. For those - that are in perl, there may be additional modules or other requirements - than those of the official distribution. - <note> - <para>Scripts in the <filename class="directory">contrib</filename> - directory are not officially supported by the Bugzilla team and may - break in between versions. - </para> - </note> - </para> - </glossdef> - </glossentry> - </glossdiv> - - <glossdiv id="gloss-d"> - <title>D</title> - - <glossentry id="gloss-daemon"> - <glossterm>daemon</glossterm> - - <glossdef> - <para>A daemon is a computer program which runs in the background. In - general, most daemons are started at boot time via System V init - scripts, or through RC scripts on BSD-based systems. - <glossterm>mysqld</glossterm>, - the MySQL server, and - <glossterm>apache</glossterm>, - a web server, are generally run as daemons.</para> - </glossdef> - </glossentry> - - <glossentry id="gloss-dos"> - <glossterm>DOS Attack</glossterm> - - <glossdef> - <para>A DOS, or Denial of Service attack, is when a user attempts to - deny access to a web server by repeatedly accessing a page or sending - malformed requests to a webserver. A D-DOS, or - Distributed Denial of Service attack, is when these requests come - from multiple sources at the same time. Unfortunately, these are much - more difficult to defend against. - </para> - </glossdef> - </glossentry> - - </glossdiv> - - <glossdiv id="gloss-g"> - <title>G</title> - - <glossentry id="gloss-groups"> - <glossterm>Groups</glossterm> - - <glossdef> - <para>The word - <quote>Groups</quote> - - has a very special meaning to Bugzilla. Bugzilla's main security - mechanism comes by placing users in groups, and assigning those - groups certain privileges to view bugs in particular - <glossterm>Products</glossterm> - in the - <glossterm>Bugzilla</glossterm> - database.</para> - </glossdef> - </glossentry> - </glossdiv> - - <glossdiv id="gloss-j"> - <title>J</title> - - <glossentry id="gloss-javascript"> - <glossterm>JavaScript</glossterm> - <glossdef> - <para>JavaScript is cool, we should talk about it. - </para> - </glossdef> - </glossentry> - </glossdiv> - - <glossdiv id="gloss-m"> - <title>M</title> - - <glossentry id="gloss-mta"> - <glossterm>Message Transport Agent</glossterm> - <acronym>MTA</acronym> - - <glossdef> - <para>A Message Transport Agent is used to control the flow of email on a system. - The <ulink url="http://search.cpan.org/dist/Email-Send/lib/Email/Send.pm">Email::Send</ulink> - Perl module, which Bugzilla uses to send email, can be configured to - use many different underlying implementations for actually sending the - mail using the <option>mail_delivery_method</option> parameter. - </para> - </glossdef> - </glossentry> - - <glossentry id="gloss-mysql"> - <glossterm>MySQL</glossterm> - - <glossdef> - <para>MySQL is one of the supported - <glossterm linkend="gloss-rdbms">RDBMS</glossterm> for Bugzilla. MySQL - can be downloaded from <ulink url="http://www.mysql.com"/>. While you - should familiarize yourself with all of the documentation, some high - points are: - </para> - <variablelist> - <varlistentry> - <term><ulink url="http://www.mysql.com/doc/en/Backup.html">Backup</ulink></term> - <listitem> - <para>Methods for backing up your Bugzilla database. - </para> - </listitem> - </varlistentry> - <varlistentry> - <term><ulink url="http://www.mysql.com/doc/en/Option_files.html">Option Files</ulink></term> - <listitem> - <para>Information about how to configure MySQL using - <filename>my.cnf</filename>. - </para> - </listitem> - </varlistentry> - <varlistentry> - <term><ulink url="http://www.mysql.com/doc/en/Privilege_system.html">Privilege System</ulink></term> - <listitem> - <para>Information about how to protect your MySQL server. - </para> - </listitem> - </varlistentry> - </variablelist> - </glossdef> - </glossentry> - </glossdiv> - - <glossdiv id="gloss-p"> - <title>P</title> - - <glossentry id="gloss-ppm"> - <glossterm>Perl Package Manager</glossterm> - <acronym>PPM</acronym> - - <glossdef> - <para><ulink url="http://aspn.activestate.com/ASPN/Downloads/ActivePerl/PPM/"/> - </para> - </glossdef> - </glossentry> - - <glossentry> - <glossterm id="gloss-product">Product</glossterm> - - <glossdef> - <para>A Product is a broad category of types of bugs, normally - representing a single piece of software or entity. In general, - there are several Components to a Product. A Product may define a - group (used for security) for all bugs entered into - its Components.</para> - </glossdef> - </glossentry> - - <glossentry> - <glossterm>Perl</glossterm> - - <glossdef> - <para>First written by Larry Wall, Perl is a remarkable program - language. It has the benefits of the flexibility of an interpreted - scripting language (such as shell script), combined with the speed - and power of a compiled language, such as C. - <glossterm>Bugzilla</glossterm> - - is maintained in Perl.</para> - </glossdef> - </glossentry> - </glossdiv> - - <glossdiv id="gloss-q"> - <title>Q</title> - - <glossentry> - <glossterm>QA</glossterm> - - <glossdef> - <para> - <quote>QA</quote>, - <quote>Q/A</quote>, and - <quote>Q.A.</quote> - are short for - <quote>Quality Assurance</quote>. - In most large software development organizations, there is a team - devoted to ensuring the product meets minimum standards before - shipping. This team will also generally want to track the progress of - bugs over their life cycle, thus the need for the - <quote>QA Contact</quote> - - field in a bug.</para> - </glossdef> - </glossentry> - </glossdiv> - - <glossdiv id="gloss-r"> - <title>R</title> - - <glossentry id="gloss-rdbms"> - <glossterm>Relational DataBase Management System</glossterm> - <acronym>RDBMS</acronym> - - <glossdef> - <para>A relational database management system is a database system - that stores information in tables that are related to each other. - </para> - </glossdef> - </glossentry> - - <glossentry id="gloss-regexp"> - <glossterm>Regular Expression</glossterm> - <acronym>regexp</acronym> - - <glossdef> - <para>A regular expression is an expression used for pattern matching. - <ulink url="http://perldoc.com/perl5.6/pod/perlre.html#Regular-Expressions">Documentation</ulink> - </para> - </glossdef> - </glossentry> - </glossdiv> - - <glossdiv id="gloss-s"> - <title>S</title> - - <glossentry id="gloss-service"> - <glossterm>Service</glossterm> - - <glossdef> - <para>In Windows NT environment, a boot-time background application - is referred to as a service. These are generally managed through the - control panel while logged in as an account with - <quote>Administrator</quote> level capabilities. For more - information, consult your Windows manual or the MSKB. - </para> - </glossdef> - </glossentry> - - <glossentry> - <glossterm> - <acronym>SGML</acronym> - </glossterm> - - <glossdef> - <para> - <acronym>SGML</acronym> - - stands for - <quote>Standard Generalized Markup Language</quote>. - Created in the 1980's to provide an extensible means to maintain - documentation based upon content instead of presentation, - <acronym>SGML</acronym> - - has withstood the test of time as a robust, powerful language. - <glossterm> - <acronym>XML</acronym> - </glossterm> - - is the - <quote>baby brother</quote> - - of SGML; any valid - <acronym>XML</acronym> - - document it, by definition, a valid - <acronym>SGML</acronym> - - document. The document you are reading is written and maintained in - <acronym>SGML</acronym>, - and is also valid - <acronym>XML</acronym> - - if you modify the Document Type Definition.</para> - </glossdef> - </glossentry> - </glossdiv> - - <glossdiv id="gloss-t"> - <title>T</title> - - <glossentry id="gloss-target-milestone" xreflabel="Target Milestone"> - <glossterm>Target Milestone</glossterm> - - <glossdef> - <para>Target Milestones are Product goals. They are configurable on a - per-Product basis. Most software development houses have a concept of - - <quote>milestones</quote> - - where the people funding a project expect certain functionality on - certain dates. Bugzilla facilitates meeting these milestones by - giving you the ability to declare by which milestone a bug will be - fixed, or an enhancement will be implemented.</para> - </glossdef> - </glossentry> - - <glossentry id="gloss-tcl"> - <glossterm>Tool Command Language</glossterm> - <acronym>TCL</acronym> - <glossdef> - <para>TCL is an open source scripting language available for Windows, - Macintosh, and Unix based systems. Bugzilla 1.0 was written in TCL but - never released. The first release of Bugzilla was 2.0, which was when - it was ported to perl. - </para> - </glossdef> - </glossentry> - </glossdiv> - - <glossdiv id="gloss-z"> - <title>Z</title> - - <glossentry id="gloss-zarro"> - <glossterm>Zarro Boogs Found</glossterm> - - <glossdef> - <para>This is just a goofy way of saying that there were no bugs - found matching your query. When asked to explain this message, - Terry had the following to say: - </para> - - <blockquote> - <attribution>Terry Weissman</attribution> - <para>I've been asked to explain this ... way back when, when - Netscape released version 4.0 of its browser, we had a release - party. Naturally, there had been a big push to try and fix every - known bug before the release. Naturally, that hadn't actually - happened. (This is not unique to Netscape or to 4.0; the same thing - has happened with every software project I've ever seen.) Anyway, - at the release party, T-shirts were handed out that said something - like "Netscape 4.0: Zarro Boogs". Just like the software, the - T-shirt had no known bugs. Uh-huh. - </para> - - <para>So, when you query for a list of bugs, and it gets no results, - you can think of this as a friendly reminder. Of *course* there are - bugs matching your query, they just aren't in the bugsystem yet... - </para> - </blockquote> - - </glossdef> - </glossentry> - </glossdiv> -</glossary> - -<!-- Keep this comment at the end of the file -Local variables: -mode: sgml -sgml-always-quote-attributes:t -sgml-auto-insert-required-elements:t -sgml-balanced-tag-edit:t -sgml-exposed-tags:nil -sgml-general-insert-case:lower -sgml-indent-data:t -sgml-indent-step:2 -sgml-local-catalogs:nil -sgml-local-ecat-files:nil -sgml-minimize-attributes:nil -sgml-namecase-general:t -sgml-omittag:t -sgml-parent-document:("Bugzilla-Guide.xml" "book" "chapter") -sgml-shorttag:t -sgml-tag-region-if-active:t -End: ---> diff --git a/docs/en/xml/index.xml b/docs/en/xml/index.xml deleted file mode 100644 index e71a504a8..000000000 --- a/docs/en/xml/index.xml +++ /dev/null @@ -1,27 +0,0 @@ -<!-- 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. ---> -<!-- Keep this comment at the end of the file -Local variables: -mode: sgml -sgml-always-quote-attributes:t -sgml-auto-insert-required-elements:t -sgml-balanced-tag-edit:t -sgml-exposed-tags:nil -sgml-general-insert-case:lower -sgml-indent-data:t -sgml-indent-step:2 -sgml-local-catalogs:nil -sgml-local-ecat-files:nil -sgml-minimize-attributes:nil -sgml-namecase-general:t -sgml-omittag:t -sgml-parent-document:("Bugzilla-Guide.xml" "book" "chapter") -sgml-shorttag:t -sgml-tag-region-if-active:t -End: ---> diff --git a/docs/en/xml/installation.xml b/docs/en/xml/installation.xml deleted file mode 100644 index 5ef6be582..000000000 --- a/docs/en/xml/installation.xml +++ /dev/null @@ -1,2453 +0,0 @@ -<?xml version="1.0"?> -<!-- 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. ---> -<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" - "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ - <!ENTITY % myents SYSTEM "bugzilla.ent"> - %myents; -]> - -<chapter id="installing-bugzilla"> - <title>Installing Bugzilla</title> - - <section id="installation"> - <title>Installation</title> - - <note> - <para>If you just want to <emphasis>use</emphasis> Bugzilla, - you do not need to install it. None of this chapter is relevant to - you. Ask your Bugzilla administrator for the URL to access it from - your web browser. - </para> - </note> - - <para>The Bugzilla server software is usually installed on Linux or - Solaris. - If you are installing on another OS, check <xref linkend="os-specific"/> - before you start your installation to see if there are any special - instructions. - </para> - - <para>This guide assumes that you have administrative access to the - Bugzilla machine. It not possible to - install and run Bugzilla itself without administrative access except - in the very unlikely event that every single prerequisite is - already installed. - </para> - - <warning> - <para>The installation process may make your machine insecure for - short periods of time. Make sure there is a firewall between you - and the Internet. - </para> - </warning> - - <para> - You are strongly recommended to make a backup of your system - before installing Bugzilla (and at regular intervals thereafter :-). - </para> - - <para>In outline, the installation proceeds as follows: - </para> - - <procedure> - <step> - <para><link linkend="install-perl">Install Perl</link> - (&min-perl-ver; or above) - </para> - </step> - <step> - <para><link linkend="install-database">Install a Database Engine</link> - </para> - </step> - <step> - <para><link linkend="install-webserver">Install a Webserver</link> - </para> - </step> - <step> - <para><link linkend="install-bzfiles">Install Bugzilla</link> - </para> - </step> - <step> - <para><link linkend="install-perlmodules">Install Perl modules</link> - </para> - </step> - <step> - <para> - <link linkend="install-MTA">Install a Mail Transfer Agent</link> - (Sendmail 8.7 or above, or an MTA that is Sendmail-compatible with at least this version) - </para> - </step> - <step> - <para>Configure all of the above. - </para> - </step> - </procedure> - - <section id="install-perl"> - <title>Perl</title> - - <para>Installed Version Test: <programlisting>perl -v</programlisting></para> - - <para>Any machine that doesn't have Perl on it is a sad machine indeed. - If you don't have it and your OS doesn't provide official packages, - visit <ulink url="http://www.perl.org"/>. - Although Bugzilla runs with Perl &min-perl-ver;, - it's a good idea to be using the latest stable version. - </para> - </section> - - <section id="install-database"> - <title>Database Engine</title> - - <para> - Bugzilla supports MySQL, PostgreSQL and Oracle as database servers. - You only require one of these systems to make use of Bugzilla. - </para> - - <section id="install-mysql"> - <title>MySQL</title> - <para>Installed Version Test: <programlisting>mysql -V</programlisting></para> - - <para> - If you don't have it and your OS doesn't provide official packages, - visit <ulink url="http://www.mysql.com"/>. You need MySQL version - &min-mysql-ver; or higher. - </para> - - <note> - <para> Many of the binary - versions of MySQL store their data files in - <filename class="directory">/var</filename>. - On some Unix systems, this is part of a smaller root partition, - and may not have room for your bug database. To change the data - directory, you have to build MySQL from source yourself, and - set it as an option to <filename>configure</filename>.</para> - </note> - - <para>If you install from something other than a packaging/installation - system, such as .rpm (RPM Package Manager), .deb (Debian Package), .exe - (Windows Executable), or .msi (Windows Installer), make sure the MySQL - server is started when the machine boots. - </para> - </section> - - <section id="install-pg"> - <title>PostgreSQL</title> - <para>Installed Version Test: <programlisting>psql -V</programlisting></para> - - <para> - If you don't have it and your OS doesn't provide official packages, - visit <ulink url="http://www.postgresql.org/"/>. You need PostgreSQL - version &min-pg-ver; or higher. - </para> - - <para>If you install from something other than a packaging/installation - system, such as .rpm (RPM Package Manager), .deb (Debian Package), .exe - (Windows Executable), or .msi (Windows Installer), make sure the - PostgreSQL server is started when the machine boots. - </para> - </section> - - <section id="install-oracle"> - <title>Oracle</title> - <para> - Installed Version Test: <programlisting>select * from v$version</programlisting> - (you first have to log in into your DB) - </para> - - <para> - If you don't have it and your OS doesn't provide official packages, - visit <ulink url="http://www.oracle.com/"/>. You need Oracle - version &min-oracle-ver; or higher. - </para> - - <para> - If you install from something other than a packaging/installation - system, such as .rpm (RPM Package Manager), .deb (Debian Package), .exe - (Windows Executable), or .msi (Windows Installer), make sure the - Oracle server is started when the machine boots. - </para> - </section> - </section> - - <section id="install-webserver"> - <title>Web Server</title> - - <para>Installed Version Test: view the default welcome page at - http://<your-machine>/</para> - - <para> - You have freedom of choice here, pretty much any web server that - is capable of running <glossterm linkend="gloss-cgi">CGI</glossterm> - scripts will work. - However, we strongly recommend using the Apache web server - (either 1.3.x or 2.x), and the installation instructions usually assume - you are using it. If you have got Bugzilla working using another web server, - please share your experiences with us by filing a bug in - <ulink url="&bzg-bugs;">Bugzilla Documentation</ulink>. - </para> - - <para> - If you don't have Apache and your OS doesn't provide official packages, - visit <ulink url="http://httpd.apache.org/"/>. - </para> - - </section> - - <section id="install-bzfiles"> - <title>Bugzilla</title> - - <para> - <ulink url="http://www.bugzilla.org/download/">Download a Bugzilla tarball</ulink> - (or <ulink url="https://wiki.mozilla.org/Bugzilla:Bzr">check it out from Bzr</ulink>) - and place it in a suitable directory, accessible by the default web server user - (probably <quote>apache</quote> or <quote>www</quote>). - Good locations are either directly in the web server's document directories or - in <filename>/usr/local</filename> with a symbolic link to the web server's - document directories or an alias in the web server's configuration. - </para> - - <caution> - <para>The default Bugzilla distribution is NOT designed to be placed - in a <filename class="directory">cgi-bin</filename> directory. This - includes any directory which is configured using the - <option>ScriptAlias</option> directive of Apache. - </para> - </caution> - - <para>Once all the files are in a web accessible directory, make that - directory writable by your web server's user. This is a temporary step - until you run the - <filename>checksetup.pl</filename> - script, which locks down your installation.</para> - </section> - - <section id="install-perlmodules"> - <title>Perl Modules</title> - - <para>Bugzilla's installation process is based - on a script called <filename>checksetup.pl</filename>. - The first thing it checks is whether you have appropriate - versions of all the required - Perl modules. The aim of this section is to pass this check. - When it passes, proceed to <xref linkend="configuration"/>. - </para> - - <para> - At this point, you need to <filename>su</filename> to root. You should - remain as root until the end of the install. To check you have the - required modules, run: - </para> - - <screen><prompt>bash#</prompt> ./checksetup.pl --check-modules</screen> - - <para> - <filename>checksetup.pl</filename> will print out a list of the - required and optional Perl modules, together with the versions - (if any) installed on your machine. - The list of required modules is reasonably long; however, you - may already have several of them installed. - </para> - - <para> - The preferred way to install missing Perl modules is to use the package - manager provided by your operating system (e.g <quote>rpm</quote> or - <quote>yum</quote> on Linux distros, or <quote>ppm</quote> on Windows - if using ActivePerl, see <xref linkend="win32-perl-modules"/>). - If some Perl modules are still missing or are too old, then we recommend - using the <filename>install-module.pl</filename> script (doesn't work - with ActivePerl on Windows). If for some reason you really need to - install the Perl modules manually, see - <xref linkend="install-perlmodules-manual"/>. For instance, on Unix, - you invoke <filename>install-module.pl</filename> as follows: - </para> - - <screen><prompt>bash#</prompt> perl install-module.pl <modulename></screen> - - <tip> - <para>Many people complain that Perl modules will not install for - them. Most times, the error messages complain that they are missing a - file in - <quote>@INC</quote>. - Virtually every time, this error is due to permissions being set too - restrictively for you to compile Perl modules or not having the - necessary Perl development libraries installed on your system. - Consult your local UNIX systems administrator for help solving these - permissions issues; if you - <emphasis>are</emphasis> - the local UNIX sysadmin, please consult the newsgroup/mailing list - for further assistance or hire someone to help you out.</para> - </tip> - - <note> - <para>If you are using a package-based system, and attempting to install the - Perl modules from CPAN, you may need to install the "development" packages for - MySQL and GD before attempting to install the related Perl modules. The names of - these packages will vary depending on the specific distribution you are using, - but are often called <filename><packagename>-devel</filename>.</para> - </note> - - <para> - Here is a complete list of modules and their minimum versions. - Some modules have special installation notes, which follow. - </para> - - <para>Required Perl modules: - <orderedlist> - - <listitem> - <para> - CGI (&min-cgi-ver;) - </para> - </listitem> - - <listitem> - <para> - Date::Format (&min-date-format-ver;) - </para> - </listitem> - - <listitem> - <para> - DateTime (&min-datetime-ver;) - </para> - </listitem> - - <listitem> - <para> - DateTime::TimeZone (&min-datetime-timezone-ver;) - </para> - </listitem> - - <listitem> - <para> - DBI (&min-dbi-ver;) - </para> - </listitem> - - <listitem> - <para> - DBD::mysql (&min-dbd-mysql-ver;) if using MySQL - </para> - </listitem> - - <listitem> - <para> - DBD::Pg (&min-dbd-pg-ver;) if using PostgreSQL - </para> - </listitem> - - <listitem> - <para> - DBD::Oracle (&min-dbd-oracle-ver;) if using Oracle - </para> - </listitem> - - <listitem> - <para> - Digest::SHA (&min-digest-sha-ver;) - </para> - </listitem> - - <listitem> - <para> - Email::Send (&min-email-send-ver;) - </para> - </listitem> - - <listitem> - <para> - Email::MIME (&min-email-mime-ver;) - </para> - </listitem> - - <listitem> - <para> - Template (&min-template-ver;) - </para> - </listitem> - - <listitem> - <para> - URI (&min-uri-ver;) - </para> - </listitem> - </orderedlist> - - Optional Perl modules: - <orderedlist> - <listitem> - <para> - GD (&min-gd-ver;) for bug charting - </para> - </listitem> - - <listitem> - <para> - Template::Plugin::GD::Image - (&min-template-plugin-gd-image-ver;) for Graphical Reports - </para> - </listitem> - - <listitem> - <para> - Chart::Lines (&min-chart-lines-ver;) for bug charting - </para> - </listitem> - - <listitem> - <para> - GD::Graph (&min-gd-graph-ver;) for bug charting - </para> - </listitem> - - <listitem> - <para> - GD::Text (&min-gd-text-ver;) for bug charting - </para> - </listitem> - - <listitem> - <para> - XML::Twig (&min-xml-twig-ver;) for bug import/export - </para> - </listitem> - - <listitem> - <para> - MIME::Parser (&min-mime-parser-ver;) for bug import/export - </para> - </listitem> - - <listitem> - <para> - LWP::UserAgent - (&min-lwp-useragent-ver;) for Automatic Update Notifications - </para> - </listitem> - - <listitem> - <para> - PatchReader (&min-patchreader-ver;) for pretty HTML view of patches - </para> - </listitem> - - <listitem> - <para> - Net::LDAP - (&min-net-ldap-ver;) for LDAP Authentication - </para> - </listitem> - - <listitem> - <para> - Authen::SASL - (&min-authen-sasl-ver;) for SASL Authentication - </para> - </listitem> - - <listitem> - <para> - Authen::Radius - (&min-authen-radius-ver;) for RADIUS Authentication - </para> - </listitem> - - <listitem> - <para> - SOAP::Lite (&min-soap-lite-ver;) for the web service interface - </para> - </listitem> - - <listitem> - <para> - JSON::RPC - (&min-json-rpc-ver;) for the JSON-RPC interface - </para> - </listitem> - - <listitem> - <para> - Test::Taint - (&min-test-taint-ver;) for the web service interface - </para> - </listitem> - - <listitem> - <para> - HTML::Parser - (&min-html-parser-ver;) for More HTML in Product/Group Descriptions - </para> - </listitem> - - <listitem> - <para> - HTML::Scrubber - (&min-html-scrubber-ver;) for More HTML in Product/Group Descriptions - </para> - </listitem> - - <listitem> - <para> - Email::Reply - (&min-email-reply-ver;) for Inbound Email - </para> - </listitem> - - <listitem> - <para> - TheSchwartz - (&min-theschwartz-ver;) for Mail Queueing - </para> - </listitem> - - <listitem> - <para> - Daemon::Generic - (&min-daemon-generic-ver;) for Mail Queueing - </para> - </listitem> - - <listitem> - <para> - mod_perl2 - (&min-mod_perl2-ver;) for mod_perl - </para> - </listitem> - </orderedlist> - </para> - </section> - - <section id="install-MTA"> - <title>Mail Transfer Agent (MTA)</title> - - <para> - Bugzilla is dependent on the availability of an e-mail system for its - user authentication and for other tasks. - </para> - - <note> - <para> - This is not entirely true. It is possible to completely disable - email sending, or to have Bugzilla store email messages in a - file instead of sending them. However, this is mainly intended - for testing, as disabling or diverting email on a production - machine would mean that users could miss important events (such - as bug changes or the creation of new accounts). - </para> - - <para> - For more information, see the <quote>mail_delivery_method</quote> parameter - in <xref linkend="parameters" />. - </para> - </note> - - <para> - On Linux, any Sendmail-compatible MTA (Mail Transfer Agent) will - suffice. Sendmail, Postfix, qmail and Exim are examples of common - MTAs. Sendmail is the original Unix MTA, but the others are easier to - configure, and therefore many people replace Sendmail with Postfix or - Exim. They are drop-in replacements, so Bugzilla will not - distinguish between them. - </para> - - <para> - If you are using Sendmail, version 8.7 or higher is required. - If you are using a Sendmail-compatible MTA, it must be congruent with - at least version 8.7 of Sendmail. - </para> - - <para> - Consult the manual for the specific MTA you choose for detailed - installation instructions. Each of these programs will have their own - configuration files where you must configure certain parameters to - ensure that the mail is delivered properly. They are implemented - as services, and you should ensure that the MTA is in the auto-start - list of services for the machine. - </para> - - <para> - If a simple mail sent with the command-line 'mail' program - succeeds, then Bugzilla should also be fine. - </para> - - </section> - <section id="using-mod_perl-with-bugzilla"> - <title>Installing Bugzilla on mod_perl</title> - <para>It is now possible to run the Bugzilla software under <literal>mod_perl</literal> on - Apache. <literal>mod_perl</literal> has some additional requirements to that of running - Bugzilla under <literal>mod_cgi</literal> (the standard and previous way).</para> - - <para>Bugzilla requires <literal>mod_perl</literal> to be installed, which can be - obtained from <ulink url="http://perl.apache.org"/> - Bugzilla requires - version &min-mod_perl2-ver; (AKA 2.0.0-RC5) to be installed.</para> - </section> - </section> - - <section id="configuration"> - <title>Configuration</title> - - <warning> - <para> - Poorly-configured MySQL and Bugzilla installations have - given attackers full access to systems in the past. Please take the - security parts of these guidelines seriously, even for Bugzilla - machines hidden away behind your firewall. Be certain to read - <xref linkend="security"/> for some important security tips. - </para> - </warning> - - <section id="localconfig"> - <title>localconfig</title> - - <para> - You should now run <filename>checksetup.pl</filename> again, this time - without the <literal>--check-modules</literal> switch. - </para> - <screen><prompt>bash#</prompt> ./checksetup.pl</screen> - <para> - This time, <filename>checksetup.pl</filename> should tell you that all - the correct modules are installed and will display a message about, and - write out a file called, <filename>localconfig</filename>. This file - contains the default settings for a number of Bugzilla parameters. - </para> - - <para> - Load this file in your editor. The only two values you - <emphasis>need</emphasis> to change are $db_driver and $db_pass, - respectively the type of the database and the password for - the user you will create for your database. Pick a strong - password (for simplicity, it should not contain single quote - characters) and put it here. $db_driver can be either 'mysql', - 'Pg', 'Oracle' or 'Sqlite'. - </para> - - <note> - <para> - In Oracle, <literal>$db_name</literal> should actually be - the SID name of your database (e.g. "XE" if you are using Oracle XE). - </para> - </note> - - <para> - You may need to change the value of - <emphasis>webservergroup</emphasis> if your web server does not - run in the "apache" group. On Debian, for example, Apache runs in - the "www-data" group. If you are going to run Bugzilla on a - machine where you do not have root access (such as on a shared web - hosting account), you will need to leave - <emphasis>webservergroup</emphasis> empty, ignoring the warnings - that <filename>checksetup.pl</filename> will subsequently display - every time it is run. - </para> - - <caution> - <para> - If you are using suexec, you should use your own primary group - for <emphasis>webservergroup</emphasis> rather than leaving it - empty, and see the additional directions in the suexec section - <xref linkend="suexec" />. - </para> - </caution> - - <para> - The other options in the <filename>localconfig</filename> file - are documented by their accompanying comments. If you have a slightly - non-standard database setup, you may wish to change one or more of - the other "$db_*" parameters. - </para> - </section> - - <section id="database-engine"> - <title>Database Server</title> - <para> - This section deals with configuring your database server for use - with Bugzilla. Currently, MySQL (<xref linkend="mysql"/>), - PostgreSQL (<xref linkend="postgresql"/>), Oracle (<xref linkend="oracle"/>) - and SQLite (<xref linkend="sqlite"/>) are available. - </para> - - <section id="database-schema"> - <title>Bugzilla Database Schema</title> - - <para> - The Bugzilla database schema is available at - <ulink url="http://www.ravenbrook.com/project/p4dti/tool/cgi/bugzilla-schema/">Ravenbrook</ulink>. - This very valuable tool can generate a written description of - the Bugzilla database schema for any version of Bugzilla. It - can also generate a diff between two versions to help someone - see what has changed. - </para> - </section> - - <section id="mysql"> - <title>MySQL</title> - - <caution> - <para> - MySQL's default configuration is insecure. - We highly recommend to run <filename>mysql_secure_installation</filename> - on Linux or the MySQL installer on Windows, and follow the instructions. - Important points to note are: - <orderedlist> - <listitem> - <para>Be sure that the root account has a secure password set.</para> - </listitem> - <listitem> - <para>Do not create an anonymous account, and if it exists, say "yes" - to remove it.</para> - </listitem> - <listitem> - <para>If your web server and MySQL server are on the same machine, - you should disable the network access.</para> - </listitem> - </orderedlist> - </para> - </caution> - - <section id="mysql-max-allowed-packet"> - <title>Allow large attachments and many comments</title> - - <para>By default, MySQL will only allow you to insert things - into the database that are smaller than 1MB. Attachments - may be larger than this. Also, Bugzilla combines all comments - on a single bug into one field for full-text searching, and the - combination of all comments on a single bug could in some cases - be larger than 1MB.</para> - - <para>To change MySQL's default, you need to edit your MySQL - configuration file, which is usually <filename>/etc/my.cnf</filename> - on Linux. We recommend that you allow at least 4MB packets by - adding the "max_allowed_packet" parameter to your MySQL - configuration in the "[mysqld]" section, like this:</para> - - <screen>[mysqld] -# Allow packets up to 4MB -max_allowed_packet=4M - </screen> - </section> - - <section> - <title>Allow small words in full-text indexes</title> - - <para>By default, words must be at least four characters in length - in order to be indexed by MySQL's full-text indexes. This causes - a lot of Bugzilla specific words to be missed, including "cc", - "ftp" and "uri".</para> - - <para>MySQL can be configured to index those words by setting the - ft_min_word_len param to the minimum size of the words to index. - This can be done by modifying the <filename>/etc/my.cnf</filename> - according to the example below:</para> - - <screen>[mysqld] -# Allow small words in full-text indexes -ft_min_word_len=2</screen> - - <para>Rebuilding the indexes can be done based on documentation found at - <ulink url="http://www.mysql.com/doc/en/Fulltext_Fine-tuning.html"/>. - </para> - </section> - - <section id="install-setupdatabase-adduser"> - <title>Add a user to MySQL</title> - - <para> - You need to add a new MySQL user for Bugzilla to use. - (It's not safe to have Bugzilla use the MySQL root account.) - The following instructions assume the defaults in - <filename>localconfig</filename>; if you changed those, - you need to modify the SQL command appropriately. You will - need the <replaceable>$db_pass</replaceable> password you - set in <filename>localconfig</filename> in - <xref linkend="localconfig"/>. - </para> - - <para> - We use an SQL <command>GRANT</command> command to create - a <quote>bugs</quote> user. This also restricts the - <quote>bugs</quote>user to operations within a database - called <quote>bugs</quote>, and only allows the account - to connect from <quote>localhost</quote>. Modify it to - reflect your setup if you will be connecting from another - machine or as a different user. - </para> - - <para> - Run the <filename>mysql</filename> command-line client and enter: - </para> - - <screen> -<prompt>mysql></prompt> GRANT SELECT, INSERT, - UPDATE, DELETE, INDEX, ALTER, CREATE, LOCK TABLES, - CREATE TEMPORARY TABLES, DROP, REFERENCES ON bugs.* - TO bugs@localhost IDENTIFIED BY '<replaceable>$db_pass</replaceable>'; -<prompt>mysql></prompt> FLUSH PRIVILEGES; - </screen> - </section> - - <section> - <title>Permit attachments table to grow beyond 4GB</title> - - <para> - By default, MySQL will limit the size of a table to 4GB. - This limit is present even if the underlying filesystem - has no such limit. To set a higher limit, follow these - instructions. - </para> - - <para> - After you have completed the rest of the installation (or at least the - database setup parts), you should run the <filename>MySQL</filename> - command-line client and enter the following, replacing <literal>$bugs_db</literal> - with your Bugzilla database name (<emphasis>bugs</emphasis> by default): - </para> - - <screen> -<prompt>mysql></prompt> use <replaceable>$bugs_db</replaceable> -<prompt>mysql></prompt> ALTER TABLE attachments - AVG_ROW_LENGTH=1000000, MAX_ROWS=20000; - </screen> - - <para> - The above command will change the limit to 20GB. Mysql will have - to make a temporary copy of your entire table to do this. Ideally, - you should do this when your attachments table is still small. - </para> - - <note> - <para> - This does not affect Big Files, attachments that are stored directly - on disk instead of in the database. - </para> - </note> - </section> - </section> - - <section id="postgresql"> - <title>PostgreSQL</title> - <section> - <title>Add a User to PostgreSQL</title> - - <para>You need to add a new user to PostgreSQL for the Bugzilla - application to use when accessing the database. The following instructions - assume the defaults in <filename>localconfig</filename>; if you - changed those, you need to modify the commands appropriately. You will - need the <replaceable>$db_pass</replaceable> password you - set in <filename>localconfig</filename> in - <xref linkend="localconfig"/>.</para> - - <para>On most systems, to create the user in PostgreSQL, you will need to - login as the root user, and then</para> - - <screen><prompt>bash#</prompt> su - postgres</screen> - - <para>As the postgres user, you then need to create a new user: </para> - - <screen><prompt>bash$</prompt> createuser -U postgres -dRSP bugs</screen> - - <para>When asked for a password, provide the password which will be set as - <replaceable>$db_pass</replaceable> in <filename>localconfig</filename>. - The created user will not be a superuser (-S) and will not be able to create - new users (-R). He will only have the ability to create databases (-d).</para> - </section> - - <section> - <title>Configure PostgreSQL</title> - - <para>Now, you will need to edit <filename>pg_hba.conf</filename> which is - usually located in <filename>/var/lib/pgsql/data/</filename>. In this file, - you will need to add a new line to it as follows:</para> - - <para> - <computeroutput>host all bugs 127.0.0.1 255.255.255.255 md5</computeroutput> - </para> - - <para>This means that for TCP/IP (host) connections, allow connections from - '127.0.0.1' to 'all' databases on this server from the 'bugs' user, and use - password authentication (md5) for that user.</para> - - <para>Now, you will need to restart PostgreSQL, but you will need to fully - stop and start the server rather than just restarting due to the possibility - of a change to <filename>postgresql.conf</filename>. After the server has - restarted, you will need to edit <filename>localconfig</filename>, finding - the <literal>$db_driver</literal> variable and setting it to - <literal>Pg</literal> and changing the password in <literal>$db_pass</literal> - to the one you picked previously, while setting up the account.</para> - </section> - </section> - - <section id="oracle"> - <title>Oracle</title> - <section> - <title>Create a New Tablespace</title> - - <para> - You can use the existing tablespace or create a new one for Bugzilla. - To create a new tablespace, run the following command: - </para> - - <programlisting> -CREATE TABLESPACE bugs -DATAFILE '<replaceable>$path_to_datafile</replaceable>' SIZE 500M -AUTOEXTEND ON NEXT 30M MAXSIZE UNLIMITED - </programlisting> - - <para> - Here, the name of the tablespace is 'bugs', but you can - choose another name. <replaceable>$path_to_datafile</replaceable> is - the path to the file containing your database, for instance - <filename>/u01/oradata/bugzilla.dbf</filename>. - The initial size of the database file is set in this example to 500 Mb, - with an increment of 30 Mb everytime we reach the size limit of the file. - </para> - </section> - - <section> - <title>Add a User to Oracle</title> - - <para> - The user name and password must match what you set in - <filename>localconfig</filename> (<literal>$db_user</literal> - and <literal>$db_pass</literal>, respectively). Here, we assume that - the user name is 'bugs' and the tablespace name is the same - as above. - </para> - - <programlisting> -CREATE USER bugs -IDENTIFIED BY "<replaceable>$db_pass</replaceable>" -DEFAULT TABLESPACE bugs -TEMPORARY TABLESPACE TEMP -PROFILE DEFAULT; --- GRANT/REVOKE ROLE PRIVILEGES -GRANT CONNECT TO bugs; -GRANT RESOURCE TO bugs; --- GRANT/REVOKE SYSTEM PRIVILEGES -GRANT UNLIMITED TABLESPACE TO bugs; -GRANT EXECUTE ON CTXSYS.CTX_DDL TO bugs; - </programlisting> - </section> - - <section> - <title>Configure the Web Server</title> - - <para> - If you use Apache, append these lines to <filename>httpd.conf</filename> - to set ORACLE_HOME and LD_LIBRARY_PATH. For instance: - </para> - - <programlisting> -SetEnv ORACLE_HOME /u01/app/oracle/product/10.2.0/ -SetEnv LD_LIBRARY_PATH /u01/app/oracle/product/10.2.0/lib/ - </programlisting> - - <para> - When this is done, restart your web server. - </para> - </section> - </section> - - <section id="sqlite"> - <title>SQLite</title> - - <caution> - <para> - Due to SQLite's <ulink url="http://sqlite.org/faq.html#q5">concurrency - limitations</ulink> we recommend SQLite only for small and development - Bugzilla installations. - </para> - </caution> - - <para> - No special configuration is required to run Bugzilla on SQLite. - The database will be stored in <filename>data/db/$db_name</filename>, - where <literal>$db_name</literal> is the database name defined - in <filename>localconfig</filename>. - </para> - </section> - </section> - - <section> - <title>checksetup.pl</title> - - <para> - Next, rerun <filename>checksetup.pl</filename>. It reconfirms - that all the modules are present, and notices the altered - localconfig file, which it assumes you have edited to your - satisfaction. It compiles the UI templates, - connects to the database using the 'bugs' - user you created and the password you defined, and creates the - 'bugs' database and the tables therein. - </para> - - <para> - After that, it asks for details of an administrator account. Bugzilla - can have multiple administrators - you can create more later - but - it needs one to start off with. - Enter the email address of an administrator, his or her full name, - and a suitable Bugzilla password. - </para> - - <para> - <filename>checksetup.pl</filename> will then finish. You may rerun - <filename>checksetup.pl</filename> at any time if you wish. - </para> - </section> - - - <section id="http"> - <title>Web server</title> - <para> - Configure your web server according to the instructions in the - appropriate section. (If it makes a difference in your choice, - the Bugzilla Team recommends Apache.) To check whether your web server - is correctly configured, try to access <filename>testagent.cgi</filename> - from your web server. If "OK" is displayed, then your configuration - is successful. Regardless of which web server - you are using, however, ensure that sensitive information is - not remotely available by properly applying the access controls in - <xref linkend="security-webserver-access"/>. You can run - <filename>testserver.pl</filename> to check if your web server serves - Bugzilla files as expected. - </para> - - <section id="http-apache"> - <title>Bugzilla using Apache</title> - <para>You have two options for running Bugzilla under Apache - - <link linkend="http-apache-mod_cgi">mod_cgi</link> (the default) and - <link linkend="http-apache-mod_perl">mod_perl</link> (new in Bugzilla - 2.23) - </para> - <section id="http-apache-mod_cgi"> - <title>Apache <productname>httpd</productname> with mod_cgi</title> - - <para> - To configure your Apache web server to work with Bugzilla while using - mod_cgi, do the following: - </para> - - <procedure> - <step> - <para> - Load <filename>httpd.conf</filename> in your editor. - In Fedora and Red Hat Linux, this file is found in - <filename class="directory">/etc/httpd/conf</filename>. - </para> - </step> - - <step> - <para> - Apache uses <computeroutput><Directory></computeroutput> - directives to permit fine-grained permission setting. Add the - following lines to a directive that applies to the location - of your Bugzilla installation. (If such a section does not - exist, you'll want to add one.) In this example, Bugzilla has - been installed at - <filename class="directory">/var/www/html/bugzilla</filename>. - </para> - - <programlisting> -<Directory /var/www/html/bugzilla> -AddHandler cgi-script .cgi -Options +ExecCGI -DirectoryIndex index.cgi index.html -AllowOverride Limit FileInfo Indexes Options -</Directory> - </programlisting> - - <para> - These instructions: allow apache to run .cgi files found - within the bugzilla directory; instructs the server to look - for a file called <filename>index.cgi</filename> or, if not - found, <filename>index.html</filename> if someone - only types the directory name into the browser; and allows - Bugzilla's <filename>.htaccess</filename> files to override - some global permissions. - </para> - - <note> - <para> - It is possible to make these changes globally, or to the - directive controlling Bugzilla's parent directory (e.g. - <computeroutput><Directory /var/www/html/></computeroutput>). - Such changes would also apply to the Bugzilla directory... - but they would also apply to many other places where they - may or may not be appropriate. In most cases, including - this one, it is better to be as restrictive as possible - when granting extra access. - </para> - </note> - - <note> - <para> - On Windows, you may have to also add the - <computeroutput>ScriptInterpreterSource Registry-Strict</computeroutput> - line, see <link linkend="win32-http">Windows specific notes</link>. - </para> - </note> - </step> - - <step> - <para> - <filename>checksetup.pl</filename> can set tighter permissions - on Bugzilla's files and directories if it knows what group the - web server runs as. Find the <computeroutput>Group</computeroutput> - line in <filename>httpd.conf</filename>, place the value found - there in the <replaceable>$webservergroup</replaceable> variable - in <filename>localconfig</filename>, then rerun - <filename>checksetup.pl</filename>. - </para> - </step> - - <step> - <para> - Optional: If Bugzilla does not actually reside in the webspace - directory, but instead has been symbolically linked there, you - will need to add the following to the - <computeroutput>Options</computeroutput> line of the Bugzilla - <computeroutput><Directory></computeroutput> directive - (the same one as in the step above): - </para> - - <programlisting>+FollowSymLinks</programlisting> - - <para> - Without this directive, Apache will not follow symbolic links - to places outside its own directory structure, and you will be - unable to run Bugzilla. - </para> - </step> - </procedure> - </section> - <section id="http-apache-mod_perl"> - <title>Apache <productname>httpd</productname> with mod_perl</title> - - <para>Some configuration is required to make Bugzilla work with Apache - and mod_perl</para> - - <procedure> - <step> - <para> - Load <filename>httpd.conf</filename> in your editor. - In Fedora and Red Hat Linux, this file is found in - <filename class="directory">/etc/httpd/conf</filename>. - </para> - </step> - - <step> - <para>Add the following information to your httpd.conf file, substituting - where appropriate with your own local paths.</para> - - <note> - <para>This should be used instead of the <Directory> block - shown above. This should also be above any other <literal>mod_perl</literal> - directives within the <filename>httpd.conf</filename> and must be specified - in the order as below.</para> - </note> - <warning> - <para>You should also ensure that you have disabled <literal>KeepAlive</literal> - support in your Apache install when utilizing Bugzilla under mod_perl</para> - </warning> - - <programlisting> -PerlSwitches -w -T -PerlConfigRequire /var/www/html/bugzilla/mod_perl.pl - </programlisting> - </step> - - <step> - <para> - <filename>checksetup.pl</filename> can set tighter permissions - on Bugzilla's files and directories if it knows what group the - web server runs as. Find the <computeroutput>Group</computeroutput> - line in <filename>httpd.conf</filename>, place the value found - there in the <replaceable>$webservergroup</replaceable> variable - in <filename>localconfig</filename>, then rerun - <filename>checksetup.pl</filename>. - </para> - </step> - </procedure> - - <para>On restarting Apache, Bugzilla should now be running within the - mod_perl environment. Please ensure you have run checksetup.pl to set - permissions before you restart Apache.</para> - - <note> - <para>Please bear the following points in mind when looking at using - Bugzilla under mod_perl: - <itemizedlist> - <listitem> - <para> - mod_perl support in Bugzilla can take up a HUGE amount of RAM. You could be - looking at 30MB per httpd child, easily. Basically, you just need a lot of RAM. - The more RAM you can get, the better. mod_perl is basically trading RAM for - speed. At least 2GB total system RAM is recommended for running Bugzilla under - mod_perl. - </para> - </listitem> - <listitem> - <para> - Under mod_perl, you have to restart Apache if you make any manual change to - any Bugzilla file. You can't just reload--you have to actually - <emphasis>restart</emphasis> the server (as in make sure it stops and starts - again). You <emphasis>can</emphasis> change localconfig and the params file - manually, if you want, because those are re-read every time you load a page. - </para> - </listitem> - <listitem> - <para> - You must run in Apache's Prefork MPM (this is the default). The Worker MPM - may not work--we haven't tested Bugzilla's mod_perl support under threads. - (And, in fact, we're fairly sure it <emphasis>won't</emphasis> work.) - </para> - </listitem> - <listitem> - <para> - Bugzilla generally expects to be the only mod_perl application running on - your entire server. It may or may not work if there are other applications also - running under mod_perl. It does try its best to play nice with other mod_perl - applications, but it still may have conflicts. - </para> - </listitem> - <listitem> - <para> - It is recommended that you have one Bugzilla instance running under mod_perl - on your server. Bugzilla has not been tested with more than one instance running. - </para> - </listitem> - </itemizedlist> - </para> - </note> - </section> - </section> - - <section id="http-iis"> - <title>Microsoft <productname>Internet Information Services</productname></title> - - <para> - If you are running Bugzilla on Windows and choose to use - Microsoft's <productname>Internet Information Services</productname> - or <productname>Personal Web Server</productname> you will need - to perform a number of other configuration steps as explained below. - You may also want to refer to the following Microsoft Knowledge - Base articles: - <ulink url="http://support.microsoft.com/default.aspx?scid=kb;en-us;245225">245225</ulink> - <quote>HOW TO: Configure and Test a PERL Script with IIS 4.0, - 5.0, and 5.1</quote> (for <productname>Internet Information - Services</productname>) and - <ulink url="http://support.microsoft.com/default.aspx?scid=kb;en-us;231998">231998</ulink> - <quote>HOW TO: FP2000: How to Use Perl with Microsoft Personal Web - Server on Windows 95/98</quote> (for <productname>Personal Web - Server</productname>). - </para> - - <para> - You will need to create a virtual directory for the Bugzilla - install. Put the Bugzilla files in a directory that is named - something <emphasis>other</emphasis> than what you want your - end-users accessing. That is, if you want your users to access - your Bugzilla installation through - <quote>http://<yourdomainname>/Bugzilla</quote>, then do - <emphasis>not</emphasis> put your Bugzilla files in a directory - named <quote>Bugzilla</quote>. Instead, place them in a different - location, and then use the IIS Administration tool to create a - Virtual Directory named "Bugzilla" that acts as an alias for the - actual location of the files. When creating that virtual directory, - make sure you add the <quote>Execute (such as ISAPI applications or - CGI)</quote> access permission. - </para> - - <para> - You will also need to tell IIS how to handle Bugzilla's - .cgi files. Using the IIS Administration tool again, open up - the properties for the new virtual directory and select the - Configuration option to access the Script Mappings. Create an - entry mapping .cgi to: - </para> - - <programlisting> -<full path to perl.exe >\perl.exe -x<full path to Bugzilla> -wT "%s" %s - </programlisting> - - <para> - For example: - </para> - - <programlisting> -c:\perl\bin\perl.exe -xc:\bugzilla -wT "%s" %s - </programlisting> - - <note> - <para> - The ActiveState install may have already created an entry for - .pl files that is limited to <quote>GET,HEAD,POST</quote>. If - so, this mapping should be <emphasis>removed</emphasis> as - Bugzilla's .pl files are not designed to be run via a web server. - </para> - </note> - - <para> - IIS will also need to know that the index.cgi should be treated - as a default document. On the Documents tab page of the virtual - directory properties, you need to add index.cgi as a default - document type. If you wish, you may remove the other default - document types for this particular virtual directory, since Bugzilla - doesn't use any of them. - </para> - - <para> - Also, and this can't be stressed enough, make sure that files - such as <filename>localconfig</filename> and your - <filename class="directory">data</filename> directory are - secured as described in <xref linkend="security-webserver-access"/>. - </para> - - </section> - - </section> - - <section id="install-config-bugzilla"> - <title>Bugzilla</title> - - <para> - Your Bugzilla should now be working. Access - <filename>http://<your-bugzilla-server>/</filename> - - you should see the Bugzilla - front page. If not, consult the Troubleshooting section, - <xref linkend="troubleshooting"/>. - </para> - - <note> - <para> - The URL above may be incorrect if you installed Bugzilla into a - subdirectory or used a symbolic link from your web site root to - the Bugzilla directory. - </para> - </note> - - <para> - Log in with the administrator account you defined in the last - <filename>checksetup.pl</filename> run. You should go through - the Parameters page and see if there are any you wish to change. - They key parameters are documented in <xref linkend="parameters"/>; - you should certainly alter - <command>maintainer</command> and <command>urlbase</command>; - you may also want to alter - <command>cookiepath</command> or <command>requirelogin</command>. - </para> - - <para> - Bugzilla has several optional features which require extra - configuration. You can read about those in - <xref linkend="extraconfig"/>. - </para> - </section> - </section> - - <section id="extraconfig"> - <title>Optional Additional Configuration</title> - - <para> - Bugzilla has a number of optional features. This section describes how - to configure or enable them. - </para> - - <section> - <title>Bug Graphs</title> - - <para>If you have installed the necessary Perl modules you - can start collecting statistics for the nifty Bugzilla - graphs.</para> - - <screen><prompt>bash#</prompt> <command>crontab -e</command></screen> - - <para> - This should bring up the crontab file in your editor. - Add a cron entry like this to run - <filename>collectstats.pl</filename> - daily at 5 after midnight: - </para> - - <programlisting>5 0 * * * cd <your-bugzilla-directory> && ./collectstats.pl</programlisting> - - <para> - After two days have passed you'll be able to view bug graphs from - the Reports page. - </para> - - <note> - <para> - Windows does not have 'cron', but it does have the Task - Scheduler, which performs the same duties. There are also - third-party tools that can be used to implement cron, such as - <ulink url="http://www.nncron.ru/">nncron</ulink>. - </para> - </note> - </section> - - <section id="installation-whining-cron"> - <title>The Whining Cron</title> - - <para>What good are - bugs if they're not annoying? To help make them more so you - can set up Bugzilla's automatic whining system to complain at engineers - which leave their bugs in the CONFIRMED state without triaging them. - </para> - <para> - This can be done by adding the following command as a daily - crontab entry, in the same manner as explained above for bug - graphs. This example runs it at 12.55am. - </para> - - <programlisting>55 0 * * * cd <your-bugzilla-directory> && ./whineatnews.pl</programlisting> - - <note> - <para> - Windows does not have 'cron', but it does have the Task - Scheduler, which performs the same duties. There are also - third-party tools that can be used to implement cron, such as - <ulink url="http://www.nncron.ru/">nncron</ulink>. - </para> - </note> - </section> - - <section id="installation-whining"> - <title>Whining</title> - - <para> - As of Bugzilla 2.20, users can configure Bugzilla to regularly annoy - them at regular intervals, by having Bugzilla execute saved searches - at certain times and emailing the results to the user. This is known - as "Whining". The process of configuring Whining is described - in <xref linkend="whining"/>, but for it to work a Perl script must be - executed at regular intervals. - </para> - - <para> - This can be done by adding the following command as a daily - crontab entry, in the same manner as explained above for bug - graphs. This example runs it every 15 minutes. - </para> - - <programlisting>*/15 * * * * cd <your-bugzilla-directory> && ./whine.pl</programlisting> - - <note> - <para> - Whines can be executed as often as every 15 minutes, so if you specify - longer intervals between executions of whine.pl, some users may not - be whined at as often as they would expect. Depending on the person, - this can either be a very Good Thing or a very Bad Thing. - </para> - </note> - - <note> - <para> - Windows does not have 'cron', but it does have the Task - Scheduler, which performs the same duties. There are also - third-party tools that can be used to implement cron, such as - <ulink url="http://www.nncron.ru/">nncron</ulink>. - </para> - </note> - </section> - - <section id="apache-addtype"> - <title>Serving Alternate Formats with the right MIME type</title> - - <para> - Some Bugzilla pages have alternate formats, other than just plain - <acronym>HTML</acronym>. In particular, a few Bugzilla pages can - output their contents as either <acronym>XUL</acronym> (a special - Mozilla format, that looks like a program <acronym>GUI</acronym>) - or <acronym>RDF</acronym> (a type of structured <acronym>XML</acronym> - that can be read by various programs). - </para> - <para> - In order for your users to see these pages correctly, Apache must - send them with the right <acronym>MIME</acronym> type. To do this, - add the following lines to your Apache configuration, either in the - <computeroutput><VirtualHost></computeroutput> section for your - Bugzilla, or in the <computeroutput><Directory></computeroutput> - section for your Bugzilla: - </para> - <para> - <screen>AddType application/vnd.mozilla.xul+xml .xul -AddType application/rdf+xml .rdf</screen> - </para> - </section> - </section> - - <section id="multiple-bz-dbs"> - <title>Multiple Bugzilla databases with a single installation</title> - - <para>The previous instructions referred to a standard installation, with - one unique Bugzilla database. However, you may want to host several - distinct installations, without having several copies of the code. This is - possible by using the PROJECT environment variable. When accessed, - Bugzilla checks for the existence of this variable, and if present, uses - its value to check for an alternative configuration file named - <filename>localconfig.<PROJECT></filename> in the same location as - the default one (<filename>localconfig</filename>). It also checks for - customized templates in a directory named - <filename><PROJECT></filename> in the same location as the - default one (<filename>template/<langcode></filename>). By default - this is <filename>template/en/default</filename> so PROJECT's templates - would be located at <filename>template/en/PROJECT</filename>.</para> - - <para>To set up an alternate installation, just export PROJECT=foo before - running <command>checksetup.pl</command> for the first time. It will - result in a file called <filename>localconfig.foo</filename> instead of - <filename>localconfig</filename>. Edit this file as described above, with - reference to a new database, and re-run <command>checksetup.pl</command> - to populate it. That's all.</para> - - <para>Now you have to configure the web server to pass this environment - variable when accessed via an alternate URL, such as virtual host for - instance. The following is an example of how you could do it in Apache, - other Webservers may differ. -<programlisting> -<VirtualHost 212.85.153.228:80> - ServerName foo.bar.baz - SetEnv PROJECT foo - Alias /bugzilla /var/www/bugzilla -</VirtualHost> -</programlisting> - </para> - - <para>Don't forget to also export this variable before accessing Bugzilla - by other means, such as cron tasks for instance.</para> - </section> - - <section id="os-specific"> - <title>OS-Specific Installation Notes</title> - - <para>Many aspects of the Bugzilla installation can be affected by the - operating system you choose to install it on. Sometimes it can be made - easier and others more difficult. This section will attempt to help you - understand both the difficulties of running on specific operating systems - and the utilities available to make it easier. - </para> - - <para>If you have anything to add or notes for an operating system not covered, - please file a bug in <ulink url="&bzg-bugs;">Bugzilla Documentation</ulink>. - </para> - - <section id="os-win32"> - <title>Microsoft Windows</title> - <para> - Making Bugzilla work on Windows is more difficult than making it - work on Unix. For that reason, we still recommend doing so on a Unix - based system such as GNU/Linux. That said, if you do want to get - Bugzilla running on Windows, you will need to make the following - adjustments. A detailed step-by-step - <ulink url="https://wiki.mozilla.org/Bugzilla:Win32Install"> - installation guide for Windows</ulink> is also available - if you need more help with your installation. - </para> - - <section id="win32-perl"> - <title>Win32 Perl</title> - <para> - Perl for Windows can be obtained from - <ulink url="http://www.activestate.com/">ActiveState</ulink>. - You should be able to find a compiled binary at <ulink - url="http://aspn.activestate.com/ASPN/Downloads/ActivePerl/" />. - The following instructions assume that you are using version - 5.8.1 of ActiveState. - </para> - - <note> - <para> - These instructions are for 32-bit versions of Windows. If you are - using a 64-bit version of Windows, you will need to install 32-bit - Perl in order to install the 32-bit modules as described below. - </para> - </note> - - </section> - - <section id="win32-perl-modules"> - <title>Perl Modules on Win32</title> - - <para> - Bugzilla on Windows requires the same perl modules found in - <xref linkend="install-perlmodules"/>. The main difference is that - windows uses <glossterm linkend="gloss-ppm">PPM</glossterm> instead - of CPAN. ActiveState provides a GUI to manage Perl modules. We highly - recommend that you use it. If you prefer to use ppm from the - command-line, type: - </para> - - <programlisting> -C:\perl> <command>ppm install <module name></command> - </programlisting> - - <note> - <para> - The PPM repository stores modules in 'packages' that may have - a slightly different name than the module. If retrieving these - modules from there, you will need to pay attention to the information - provided when you run <command>checksetup.pl</command> as it will - tell you what package you'll need to install. - </para> - </note> - - <tip> - <para> - If you are behind a corporate firewall, you will need to let the - ActiveState PPM utility know how to get through it to access - the repositories by setting the HTTP_proxy system environmental - variable. For more information on setting that variable, see - the ActiveState documentation. - </para> - </tip> - </section> - - <section id="win32-http"> - <title>Serving the web pages</title> - - <para> - As is the case on Unix based systems, any web server should - be able to handle Bugzilla; however, the Bugzilla Team still - recommends Apache whenever asked. No matter what web server - you choose, be sure to pay attention to the security notes - in <xref linkend="security-webserver-access"/>. More - information on configuring specific web servers can be found - in <xref linkend="http"/>. - </para> - - <note> - <para> - The web server looks at <filename>/usr/bin/perl</filename> to - call Perl. If you are using Apache on windows, you can set the - <ulink url="http://httpd.apache.org/docs-2.0/mod/core.html#scriptinterpretersource">ScriptInterpreterSource</ulink> - directive in your Apache config file to make it look at the - right place: insert the line - <programlisting>ScriptInterpreterSource Registry-Strict</programlisting> - into your <filename>httpd.conf</filename> file, and create the key - <programlisting>HKEY_CLASSES_ROOT\.cgi\Shell\ExecCGI\Command</programlisting> - with <option>C:\Perl\bin\perl.exe -T</option> as value (adapt to your - path if needed) in the registry. When this is done, restart Apache. - </para> - </note> - - </section> - - <section id="win32-email"> - <title>Sending Email</title> - - <para> - To enable Bugzilla to send email on Windows, the server running the - Bugzilla code must be able to connect to, or act as, an SMTP server. - </para> - - </section> - </section> - - <section id="os-macosx"> - <title><productname>Mac OS X</productname></title> - - <para>Making Bugzilla work on Mac OS X requires the following - adjustments.</para> - - <section id="macosx-sendmail"> - <title>Sendmail</title> - - <para>In Mac OS X 10.3 and later, - <ulink url="http://www.postfix.org/">Postfix</ulink> - is used as the built-in email server. Postfix provides an executable - that mimics sendmail enough to fool Bugzilla, as long as Bugzilla can - find it. Bugzilla is able to find the fake sendmail executable without - any assistance.</para> - - </section> - - <section id="macosx-libraries"> - <title>Libraries & Perl Modules on Mac OS X</title> - - <para>Apple does not include the GD library with Mac OS X. Bugzilla - needs this for bug graphs.</para> - - <para>You can use MacPorts (<ulink url="http://www.macports.org/"/>) - or Fink (<ulink url="http://sourceforge.net/projects/fink/"/>), both - of which are similar in nature to the CPAN installer, but install - common unix programs.</para> - - <para>Follow the instructions for setting up MacPorts or Fink. - Once you have one installed, you'll want to use it to install the - <filename>gd2</filename> package. - </para> - - <para>Fink will prompt you for a number of dependencies, type 'y' and hit - enter to install all of the dependencies and then watch it work. You will - then be able to use <glossterm linkend="gloss-cpan">CPAN</glossterm> to - install the GD Perl module. - </para> - - <note> - <para>To prevent creating conflicts with the software that Apple - installs by default, Fink creates its own directory tree at - <filename class="directory">/sw</filename> where it installs most of - the software that it installs. This means your libraries and headers - will be at <filename class="directory">/sw/lib</filename> and - <filename class="directory">/sw/include</filename> instead of - <filename class="directory">/usr/lib</filename> and - <filename class="directory">/usr/include</filename>. When the - Perl module config script asks where your <filename>libgd</filename> - is, be sure to tell it - <filename class="directory">/sw/lib</filename>. - </para> - </note> - - <para>Also available via MacPorts and Fink is - <filename>expat</filename>. After installing the expat package, you - will be able to install XML::Parser using CPAN. If you use fink, there - is one caveat. Unlike recent versions of - the GD module, XML::Parser doesn't prompt for the location of the - required libraries. When using CPAN, you will need to use the following - command sequence: - </para> - - <screen> -# perl -MCPAN -e'look XML::Parser' -# perl Makefile.PL EXPATLIBPATH=/sw/lib EXPATINCPATH=/sw/include -# make; make test; make install -# exit - </screen> - <para> - The <command>look</command> command will download the module and spawn - a new shell with the extracted files as the current working directory. - </para> - <para> - You should watch the output from these <command>make</command> commands, - especially <quote>make test</quote> as errors may prevent - XML::Parser from functioning correctly with Bugzilla. - </para> - <para> - The <command>exit</command> command will return you to your original shell. - </para> - </section> - </section> - - <section id="os-linux"> - <title>Linux/BSD Distributions</title> - <para>Many Linux/BSD distributions include Bugzilla and its - dependencies in their native package management systems. - Installing Bugzilla with root access on any Linux/BSD system - should be as simple as finding the Bugzilla package in the - package management application and installing it using the - normal command syntax. Several distributions also perform - the proper web server configuration automatically on installation. - </para> - <para>Please consult the documentation of your Linux/BSD - distribution for instructions on how to install packages, - or for specific instructions on installing Bugzilla with - native package management tools. There is also a - <ulink url="https://wiki.mozilla.org/Bugzilla:Prerequisites"> - Bugzilla Wiki Page</ulink> for distro-specific installation - notes. - </para> - </section> - </section> - - - <section id="nonroot"> - <title>UNIX (non-root) Installation Notes</title> - - <section> - <title>Introduction</title> - - <para>If you are running a *NIX OS as non-root, either due - to lack of access (web hosts, for example) or for security - reasons, this will detail how to install Bugzilla on such - a setup. It is recommended that you read through the - <xref linkend="installation" /> - first to get an idea on the installation steps required. - (These notes will reference to steps in that guide.)</para> - - </section> - - <section> - <title>MySQL</title> - - <para>You may have MySQL installed as root. If you're - setting up an account with a web host, a MySQL account - needs to be set up for you. From there, you can create - the bugs account, or use the account given to you.</para> - - <warning> - <para>You may have problems trying to set up - <command>GRANT</command> permissions to the database. - If you're using a web host, chances are that you have a - separate database which is already locked down (or one big - database with limited/no access to the other areas), but you - may want to ask your system administrator what the security - settings are set to, and/or run the <command>GRANT</command> - command for you.</para> - - <para>Also, you will probably not be able to change the MySQL - root user password (for obvious reasons), so skip that - step.</para> - </warning> - - <section> - <title>Running MySQL as Non-Root</title> - <section> - <title>The Custom Configuration Method</title> - <para>Create a file .my.cnf in your - home directory (using /home/foo in this example) - as follows....</para> - <programlisting> -[mysqld] -datadir=/home/foo/mymysql -socket=/home/foo/mymysql/thesock -port=8081 - -[mysql] -socket=/home/foo/mymysql/thesock -port=8081 - -[mysql.server] -user=mysql -basedir=/var/lib - -[safe_mysqld] -err-log=/home/foo/mymysql/the.log -pid-file=/home/foo/mymysql/the.pid - </programlisting> - </section> - <section> - <title>The Custom Built Method</title> - - <para>You can install MySQL as a not-root, if you really need to. - Build it with PREFIX set to <filename class="directory">/home/foo/mysql</filename>, - or use pre-installed executables, specifying that you want - to put all of the data files in <filename class="directory">/home/foo/mysql/data</filename>. - If there is another MySQL server running on the system that you - do not own, use the -P option to specify a TCP port that is not - in use.</para> - </section> - - <section> - <title>Starting the Server</title> - <para>After your mysqld program is built and any .my.cnf file is - in place, you must initialize the databases (ONCE).</para> - <screen> -<prompt>bash$</prompt> <command>mysql_install_db</command> - </screen> - <para>Then start the daemon with</para> - <screen> -<prompt>bash$</prompt> <command>safe_mysql &</command> - </screen> - <para>After you start mysqld the first time, you then connect to - it as "root" and <command>GRANT</command> permissions to other - users. (Again, the MySQL root account has nothing to do with - the *NIX root account.)</para> - - <note> - <para>You will need to start the daemons yourself. You can either - ask your system administrator to add them to system startup files, or - add a crontab entry that runs a script to check on these daemons - and restart them if needed.</para> - </note> - - <warning> - <para>Do NOT run daemons or other services on a server without first - consulting your system administrator! Daemons use up system resources - and running one may be in violation of your terms of service for any - machine on which you are a user!</para> - </warning> - </section> - </section> - </section> - - <section> - <title>Perl</title> - - <para> - On the extremely rare chance that you don't have Perl on - the machine, you will have to build the sources - yourself. The following commands should get your system - installed with your own personal version of Perl: - </para> - - <screen> -<prompt>bash$</prompt> <command>wget http://perl.org/CPAN/src/stable.tar.gz</command> -<prompt>bash$</prompt> <command>tar zvxf stable.tar.gz</command> -<prompt>bash$</prompt> <command>cd perl-&min-perl-ver;</command> -<prompt>bash$</prompt> <command>sh Configure -de -Dprefix=/home/foo/perl</command> -<prompt>bash$</prompt> <command>make && make test && make install</command> - </screen> - - <para> - Once you have Perl installed into a directory (probably - in <filename class="directory">~/perl/bin</filename>), you will need to - install the Perl Modules, described below. - </para> - </section> - - <section id="install-perlmodules-nonroot"> - <title>Perl Modules</title> - - <para> - Installing the Perl modules as a non-root user is accomplished by - running the <filename>install-module.pl</filename> - script. For more details on this script, see - <ulink url="../html/api/install-module.html"><filename>install-module.pl</filename> - documentation</ulink> - </para> - </section> - - <section> - <title>HTTP Server</title> - - <para>Ideally, this also needs to be installed as root and - run under a special web server account. As long as - the web server will allow the running of *.cgi files outside of a - cgi-bin, and a way of denying web access to certain files (such as a - .htaccess file), you should be good in this department.</para> - - <section> - <title>Running Apache as Non-Root</title> - - <para>You can run Apache as a non-root user, but the port will need - to be set to one above 1024. If you type <command>httpd -V</command>, - you will get a list of the variables that your system copy of httpd - uses. One of those, namely HTTPD_ROOT, tells you where that - installation looks for its config information.</para> - - <para>From there, you can copy the config files to your own home - directory to start editing. When you edit those and then use the -d - option to override the HTTPD_ROOT compiled into the web server, you - get control of your own customized web server.</para> - - <note> - <para>You will need to start the daemons yourself. You can either - ask your system administrator to add them to system startup files, or - add a crontab entry that runs a script to check on these daemons - and restart them if needed.</para> - </note> - - <warning> - <para>Do NOT run daemons or other services on a server without first - consulting your system administrator! Daemons use up system resources - and running one may be in violation of your terms of service for any - machine on which you are a user!</para> - </warning> - </section> - </section> - - <section> - <title>Bugzilla</title> - - <para> - When you run <command>./checksetup.pl</command> to create - the <filename>localconfig</filename> file, it will list the Perl - modules it finds. If one is missing, go back and double-check the - module installation from <xref linkend="install-perlmodules-nonroot"/>, - then delete the <filename>localconfig</filename> file and try again. - </para> - - <warning> - <para>One option in <filename>localconfig</filename> you - might have problems with is the web server group. If you can't - successfully browse to the <filename>index.cgi</filename> (like - a Forbidden error), you may have to relax your permissions, - and blank out the web server group. Of course, this may pose - as a security risk. Having a properly jailed shell and/or - limited access to shell accounts may lessen the security risk, - but use at your own risk.</para> - </warning> - - <section id="suexec"> - <title>suexec or shared hosting</title> - - <para>If you are running on a system that uses suexec (most shared - hosting environments do this), you will need to set the - <emphasis>webservergroup</emphasis> value in <filename>localconfig</filename> - to match <emphasis>your</emphasis> primary group, rather than the one - the web server runs under. You will need to run the following - shell commands after running <command>./checksetup.pl</command>, - every time you run it (or modify <filename>checksetup.pl</filename> - to do them for you via the system() command). - <programlisting> -for i in docs graphs images js skins; do find $i -type d -exec chmod o+rx {} \; ; done -for i in jpg gif css js png html rdf xul; do find . -name \*.$i -exec chmod o+r {} \; ; done -find . -name .htaccess -exec chmod o+r {} \; -chmod o+x . data data/webdot - </programlisting> - Pay particular attention to the number of semicolons and dots. - They are all important. A future version of Bugzilla will - hopefully be able to do this for you out of the box.</para> - </section> - </section> - </section> - - - <section id="upgrade"> - <title>Upgrading to New Releases</title> - - <para>Upgrading to new Bugzilla releases is very simple. There is - 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 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 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 - same as the location of your Bugzilla installation, simply - substitute the proper paths where appropriate. - </para> - </note> - - <section id="upgrade-before"> - <title>Before You Upgrade</title> - - <para>Before you start your upgrade, there are a few important - steps to take:</para> - - <orderedlist> - <listitem> - <para> - Read the <ulink url="http://www.bugzilla.org/releases/">Release - Notes</ulink> of the version you're upgrading to, - particularly the "Notes for Upgraders" section. - </para> - </listitem> - - <listitem> - <para> - View the Sanity Check (<xref linkend="sanitycheck"/>) page - on your installation before upgrading. Attempt to fix all warnings - that the page produces before you go any further, or you may - experience problems during your upgrade. - </para> - </listitem> - - <listitem> - <para> - Shut down your Bugzilla installation by putting some HTML or - text in the shutdownhtml parameter - (see <xref linkend="parameters"/>). - </para> - </listitem> - - <listitem> - <para> - Make a backup of the Bugzilla database. - <emphasis>THIS IS VERY IMPORTANT</emphasis>. If - anything goes wrong during the upgrade, your installation - can be corrupted beyond recovery. Having a backup keeps you safe. - </para> - - <warning> - <para> - Upgrading is a one-way process. You cannot "downgrade" an - upgraded Bugzilla. If you wish to revert to the old Bugzilla - version for any reason, you will have to restore your database - from this backup. - </para> - </warning> - - <para>Here are some sample commands you could use to backup - your database, depending on what database system you're - using. You may have to modify these commands for your - particular setup.</para> - - <variablelist> - <varlistentry> - <term>MySQL:</term> - <listitem> - <para> - <command>mysqldump --opt -u bugs -p bugs > bugs.sql</command> - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>PostgreSQL:</term> - <listitem> - <para> - <command>pg_dump --no-privileges --no-owner -h localhost -U bugs - > bugs.sql</command> - </para> - </listitem> - </varlistentry> - </variablelist> - </listitem> - </orderedlist> - </section> - - <section id="upgrade-files"> - <title>Getting The New Bugzilla</title> - - <para>There are three ways to get the new version of Bugzilla. - We'll list them here briefly and then explain them - more later.</para> - - <variablelist> - <varlistentry> - <term>Bzr (<xref linkend="upgrade-bzr"/>)</term> - <listitem> - <para> - 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. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>Download the tarball (<xref linkend="upgrade-tarball"/>)</term> - <listitem> - <para> - This is a very simple way to upgrade, and good if you - haven't made many (or any) modifications to the code or - templates of your Bugzilla. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>Patches (<xref linkend="upgrade-patches"/>)</term> - <listitem> - <para> - If you have made modifications to your Bugzilla, and - you don't have Internet access or you don't want to use - bzr, then this is the best way to upgrade. - </para> - - <para> - 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> - </variablelist> - - <section id="upgrade-modified"> - <title>If you have modified your Bugzilla</title> - - <para> - If you have modified the code or templates of your Bugzilla, - then upgrading requires a bit more thought and effort. - A discussion of the various methods of updating compared with - degree and methods of local customization can be found in - <xref linkend="template-method"/>. - </para> - - <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 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 - the same amount of work regardless of how long it has been since - your version was released. - </para> - </section> - - <section id="upgrade-bzr"> - <title>Upgrading using Bzr</title> - - <para> - 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 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>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>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> - - <section id="upgrade-tarball"> - <title>Upgrading using the tarball</title> - - <para> - 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. - </para> - - <para> - This sequence of commands shows how to get the tarball from the - command-line; it is also possible to download it from the site - directly in a web browser. If you go that route, save the file - to the <filename class="directory">/var/www/html</filename> - directory (or its equivalent, if you use something else) and - omit the first three lines of the example. - </para> - - <programlisting> -bash$ <command>cd /var/www/html</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-4.2.1.tar.gz</command> -bugzilla-4.2.1/ -bugzilla-4.2.1/colchange.cgi -<emphasis>(Output truncated)</emphasis> -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-4.2.1 bugzilla</command> - </programlisting> - - <warning> - <para> - The <command>cp</command> commands both end with periods which - is a very important detail--it means that the destination - directory is the current working directory. - </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 - want to maintain. If you do have customizations, then you will - need to reapply them by hand to the appropriate files. - </para> - </section> - - <section id="upgrade-patches"> - <title>Upgrading using patches</title> - - <para> - 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 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 - first two commands. - </para> - - <programlisting> -bash$ <command>cd /var/www/html/bugzilla</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-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">.bzr</filename> directory. - This could make it more difficult to upgrade using Bzr - (<xref linkend="upgrade-bzr"/>) in the future. - </para> - </warning> - - </section> - </section> - - <section id="upgrade-completion"> - <title>Completing Your Upgrade</title> - - <para> - Now that you have the new Bugzilla code, there are a few final - steps to complete your upgrade. - </para> - - <orderedlist> - <listitem> - <para> - If your new Bugzilla installation is in a different - directory or on a different machine than your old Bugzilla - installation, make sure that you have copied the - <filename>data</filename> directory and the - <filename>localconfig</filename> file from your old Bugzilla - installation. (If you followed the tarball instructions - above, this has already happened.) - </para> - </listitem> - - <listitem> - <para> - If this is a major update, check that the configuration - (<xref linkend="configuration"/>) for your new Bugzilla is - up-to-date. Sometimes the configuration requirements change - between major versions. - </para> - </listitem> - - <listitem> - <para> - If you didn't do it as part of the above configuration step, - now you need to run <command>checksetup.pl</command>, which - will do everything required to convert your existing database - and settings for the new version: - </para> - - <programlisting> -bash$ <command>cd /var/www/html/bugzilla</command> -bash$ <command>./checksetup.pl</command> - </programlisting> - - <warning> - <para> - The period at the beginning of the command - <command>./checksetup.pl</command> is important and cannot - be omitted. - </para> - </warning> - - <caution> - <para> - 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. - </para> - </caution> - </listitem> - - <listitem> - <para> - Clear any HTML or text that you put into the shutdownhtml - parameter, to re-activate Bugzilla. - </para> - </listitem> - - <listitem> - <para> - View the Sanity Check (<xref linkend="sanitycheck"/>) page in your - upgraded Bugzilla. - </para> - <para> - It is recommended that, if possible, you fix any problems - you see, immediately. Failure to do this may mean that Bugzilla - will not work correctly. Be aware that if the sanity check page - contains more errors after an upgrade, it doesn't necessarily - mean there are more errors in your database than there were - before, as additional tests are added to the sanity check over - time, and it is possible that those errors weren't being - checked for in the old version. - </para> - </listitem> - </orderedlist> - - </section> - - <section id="upgrade-notifications"> - <title>Automatic Notifications of New Releases</title> - - <para> - Bugzilla 3.0 introduced the ability to automatically notify - administrators when new releases are available, based on the - <literal>upgrade_notification</literal> parameter, see - <xref linkend="parameters"/>. Administrators will see these - notifications when they access the <filename>index.cgi</filename> - page, i.e. generally when logging in. Bugzilla will check once per - day for new releases, unless the parameter is set to - <quote>disabled</quote>. If you are behind a proxy, you may have to set - the <literal>proxy_url</literal> parameter accordingly. If the proxy - requires authentication, use the - <literal>http://user:pass@proxy_url/</literal> syntax. - </para> - </section> - </section> - -</chapter> - -<!-- Keep this comment at the end of the file -Local variables: -mode: sgml -sgml-always-quote-attributes:t -sgml-auto-insert-required-elements:t -sgml-balanced-tag-edit:t -sgml-exposed-tags:nil -sgml-general-insert-case:lower -sgml-indent-data:t -sgml-indent-step:2 -sgml-local-catalogs:nil -sgml-local-ecat-files:nil -sgml-minimize-attributes:nil -sgml-namecase-general:t -sgml-omittag:t -sgml-parent-document:("Bugzilla-Guide.xml" "book" "chapter") -sgml-shorttag:t -sgml-tag-region-if-active:t -End: ---> diff --git a/docs/en/xml/modules.xml b/docs/en/xml/modules.xml deleted file mode 100644 index 2e7a65182..000000000 --- a/docs/en/xml/modules.xml +++ /dev/null @@ -1,188 +0,0 @@ -<?xml version="1.0"?> -<!-- 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. ---> -<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" - "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ - <!ENTITY % myents SYSTEM "bugzilla.ent"> - %myents; -]> - -<appendix id="install-perlmodules-manual"> - <title>Manual Installation of Perl Modules</title> - - <section id="modules-manual-instructions"> - <title>Instructions</title> - <para> - If you need to install Perl modules manually, here's how it's done. - Download the module using the link given in the next section, and then - apply this magic incantation, as root: - </para> - - <para> - <screen><prompt>bash#</prompt> tar -xzvf <module>.tar.gz -<prompt>bash#</prompt> cd <module> -<prompt>bash#</prompt> perl Makefile.PL -<prompt>bash#</prompt> make -<prompt>bash#</prompt> make test -<prompt>bash#</prompt> make install</screen> - </para> - <note> - <para> - In order to compile source code under Windows you will need to obtain - a 'make' utility. The <command>nmake</command> utility provided with - Microsoft Visual C++ may be used. As an alternative, there is a - utility called <command>dmake</command> available from CPAN which is - written entirely in Perl. - </para> - <para> - As described in <xref linkend="modules-manual-download" />, however, most - packages already exist and are available from ActiveState or theory58S. - We highly recommend that you install them using the ppm GUI available with - ActiveState and to add the theory58S repository to your list of repositories. - </para> - </note> - </section> - - <section id="modules-manual-download"> - <title>Download Locations</title> - - <note> - <para> - Running Bugzilla on Windows requires the use of ActiveState - Perl 5.8.1 or higher. Many modules already exist in the core - distribution of ActiveState Perl. If some modules are missing, upgrade - ActiveState Perl to at least 5.12; it has all the required modules. - </para> - </note> - - <para> - CGI: - <literallayout> - CPAN Download Page: <ulink url="http://search.cpan.org/dist/CGI.pm/"/> - Documentation: <ulink url="http://perldoc.perl.org/CGI.html"/> - </literallayout> - </para> - - <para> - Data-Dumper: - <literallayout> - CPAN Download Page: <ulink url="http://search.cpan.org/dist/Data-Dumper/"/> - Documentation: <ulink url="http://search.cpan.org/dist/Data-Dumper/Dumper.pm"/> - </literallayout> - </para> - - <para> - Date::Format (part of TimeDate): - <literallayout> - CPAN Download Page: <ulink url="http://search.cpan.org/dist/TimeDate/"/> - Documentation: <ulink url="http://search.cpan.org/dist/TimeDate/lib/Date/Format.pm"/> - </literallayout> - </para> - - <para> - DBI: - <literallayout> - CPAN Download Page: <ulink url="http://search.cpan.org/dist/DBI/"/> - Documentation: <ulink url="http://dbi.perl.org/docs/"/> - </literallayout> - </para> - - <para> - DBD::mysql: - <literallayout> - CPAN Download Page: <ulink url="http://search.cpan.org/dist/DBD-mysql/"/> - Documentation: <ulink url="http://search.cpan.org/dist/DBD-mysql/lib/DBD/mysql.pm"/> - </literallayout> - </para> - - <para> - DBD::Pg: - <literallayout> - CPAN Download Page: <ulink url="http://search.cpan.org/dist/DBD-Pg/"/> - Documentation: <ulink url="http://search.cpan.org/dist/DBD-Pg/Pg.pm"/> - </literallayout> - </para> - - <para> - Template-Toolkit: - <literallayout> - CPAN Download Page: <ulink url="http://search.cpan.org/dist/Template-Toolkit/"/> - Documentation: <ulink url="http://www.template-toolkit.org/docs.html"/> - </literallayout> - </para> - - <para> - GD: - <literallayout> - CPAN Download Page: <ulink url="http://search.cpan.org/dist/GD/"/> - Documentation: <ulink url="http://search.cpan.org/dist/GD/GD.pm"/> - </literallayout> - </para> - - <para> - Template::Plugin::GD: - <literallayout> - CPAN Download Page: <ulink url="http://search.cpan.org/dist/Template-GD/" /> - Documentation: <ulink url="http://www.template-toolkit.org/docs/aqua/Modules/index.html" /> - </literallayout> - </para> - - <para> - MIME::Parser (part of MIME-tools): - <literallayout> - CPAN Download Page: <ulink url="http://search.cpan.org/dist/MIME-tools/"/> - Documentation: <ulink url="http://search.cpan.org/dist/MIME-tools/lib/MIME/Parser.pm"/> - </literallayout> - </para> - - </section> - - <section id="modules-manual-optional"> - <title>Optional Modules</title> - - <para> - Chart::Lines: - <literallayout> - CPAN Download Page: <ulink url="http://search.cpan.org/dist/Chart/"/> - Documentation: <ulink url="http://search.cpan.org/dist/Chart/Chart.pod"/> - </literallayout> - </para> - - <para> - GD::Graph: - <literallayout> - CPAN Download Page: <ulink url="http://search.cpan.org/dist/GDGraph/"/> - Documentation: <ulink url="http://search.cpan.org/dist/GDGraph/Graph.pm"/> - </literallayout> - </para> - - <para> - GD::Text::Align (part of GD::Text::Util): - <literallayout> - CPAN Download Page: <ulink url="http://search.cpan.org/dist/GDTextUtil/"/> - Documentation: <ulink url="http://search.cpan.org/dist/GDTextUtil/Text/Align.pm"/> - </literallayout> - </para> - - <para> - XML::Twig: - <literallayout> - CPAN Download Page: <ulink url="http://search.cpan.org/dist/XML-Twig/"/> - Documentation: <ulink url="http://standards.ieee.org/resources/spasystem/twig/twig_stable.html"/> - </literallayout> - </para> - - <para> - PatchReader: - <literallayout> - CPAN Download Page: <ulink url="http://search.cpan.org/author/JKEISER/PatchReader/"/> - Documentation: <ulink url="http://www.johnkeiser.com/mozilla/Patch_Viewer.html"/> - </literallayout> - </para> - </section> -</appendix> diff --git a/docs/en/xml/patches.xml b/docs/en/xml/patches.xml deleted file mode 100644 index ed7d304c7..000000000 --- a/docs/en/xml/patches.xml +++ /dev/null @@ -1,143 +0,0 @@ -<?xml version="1.0"?> -<!-- 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. ---> -<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" - "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ - <!ENTITY % myents SYSTEM "bugzilla.ent"> - %myents; -]> - -<appendix id="patches" xreflabel="Useful Patches and Utilities for Bugzilla"> - <title>Contrib</title> - - <para> - There are a number of unofficial Bugzilla add-ons in the - <filename class="directory">$BUGZILLA_ROOT/contrib/</filename> - directory. This section documents them. - </para> - - <section id="cmdline"> - <title>Command-line Search Interface</title> - - <para> - There are a suite of Unix utilities for searching Bugzilla from the - command line. They live in the - <filename class="directory">contrib/cmdline</filename> directory. - There are three files - <filename>query.conf</filename>, - <filename>buglist</filename> and <filename>bugs</filename>. - </para> - - <warning> - <para> - These files pre-date the templatization work done as part of the - 2.16 release, and have not been updated. - </para> - </warning> - - <para> - <filename>query.conf</filename> contains the mapping from - options to field names and comparison types. Quoted option names - are <quote>grepped</quote> for, so it should be easy to edit this - file. Comments (#) have no effect; you must make sure these lines - do not contain any quoted <quote>option</quote>. - </para> - - <para> - <filename>buglist</filename> is a shell script that submits a - Bugzilla query and writes the resulting HTML page to stdout. - It supports both short options, (such as <quote>-Afoo</quote> - or <quote>-Rbar</quote>) and long options (such - as <quote>--assignedto=foo</quote> or <quote>--reporter=bar</quote>). - If the first character of an option is not <quote>-</quote>, it is - treated as if it were prefixed with <quote>--default=</quote>. - </para> - - <para> - The column list is taken from the COLUMNLIST environment variable. - This is equivalent to the <quote>Change Columns</quote> option - that is available when you list bugs in buglist.cgi. If you have - already used Bugzilla, grep for COLUMNLIST in your cookies file - to see your current COLUMNLIST setting. - </para> - - <para> - <filename>bugs</filename> is a simple shell script which calls - <filename>buglist</filename> and extracts the - bug numbers from the output. Adding the prefix - <quote>http://bugzilla.mozilla.org/buglist.cgi?bug_id=</quote> - turns the bug list into a working link if any bugs are found. - Counting bugs is easy. Pipe the results through - <command>sed -e 's/,/ /g' | wc | awk '{printf $2 "\n"}'</command> - </para> - - <para> - Akkana Peck says she has good results piping - <filename>buglist</filename> output through - <command>w3m -T text/html -dump</command> - </para> - - </section> - - <section id="cmdline-bugmail"> - <title>Command-line 'Send Unsent Bug-mail' tool</title> - - <para> - Within the <filename class="directory">contrib</filename> directory - exists a utility with the descriptive (if compact) name - of <filename>sendunsentbugmail.pl</filename>. The purpose of this - script is, simply, to send out any bug-related mail that should - have been sent by now, but for one reason or another has not. - </para> - - <para> - To accomplish this task, <filename>sendunsentbugmail.pl</filename> uses - the same mechanism as the <filename>sanitycheck.cgi</filename> script; - it scans through the entire database looking for bugs with changes that - were made more than 30 minutes ago, but where there is no record of - anyone related to that bug having been sent mail. Having compiled a list, - it then uses the standard rules to determine who gets mail, and sends it - out. - </para> - - <para> - As the script runs, it indicates the bug for which it is currently - sending mail; when it has finished, it gives a numerical count of how - many mails were sent and how many people were excluded. (Individual - user names are not recorded or displayed.) If the script produces - no output, that means no unsent mail was detected. - </para> - - <para> - <emphasis>Usage</emphasis>: move the sendunsentbugmail.pl script - up into the main directory, ensure it has execute permission, and run it - from the command line (or from a cron job) with no parameters. - </para> - </section> - -</appendix> - -<!-- Keep this comment at the end of the file -Local variables: -mode: sgml -sgml-always-quote-attributes:t -sgml-auto-insert-required-elements:t -sgml-balanced-tag-edit:t -sgml-exposed-tags:nil -sgml-general-insert-case:lower -sgml-indent-data:t -sgml-indent-step:2 -sgml-local-catalogs:nil -sgml-local-ecat-files:nil -sgml-minimize-attributes:nil -sgml-namecase-general:t -sgml-omittag:t -sgml-parent-document:("Bugzilla-Guide.xml" "book" "chapter") -sgml-shorttag:t -sgml-tag-region-if-active:t -End: ---> diff --git a/docs/en/xml/security.xml b/docs/en/xml/security.xml deleted file mode 100644 index 582604029..000000000 --- a/docs/en/xml/security.xml +++ /dev/null @@ -1,281 +0,0 @@ -<?xml version="1.0"?> -<!-- 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. ---> -<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" - "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ - <!ENTITY % myents SYSTEM "bugzilla.ent"> - %myents; -]> - -<chapter id="security"> -<title>Bugzilla Security</title> - - <para>While some of the items in this chapter are related to the operating - system Bugzilla is running on or some of the support software required to - run Bugzilla, it is all related to protecting your data. This is not - intended to be a comprehensive guide to securing Linux, Apache, MySQL, or - any other piece of software mentioned. There is no substitute for active - administration and monitoring of a machine. The key to good security is - actually right in the middle of the word: <emphasis>U R It</emphasis>. - </para> - - <para>While programmers in general always strive to write secure code, - accidents can and do happen. The best approach to security is to always - assume that the program you are working with isn't 100% secure and restrict - its access to other parts of your machine as much as possible. - </para> - - <section id="security-os"> - <title>Operating System</title> - - <section id="security-os-ports"> - <title>TCP/IP Ports</title> - - <!-- TODO: Get exact number of ports --> - <para>The TCP/IP standard defines more than 65,000 ports for sending - and receiving traffic. Of those, Bugzilla needs exactly one to operate - (different configurations and options may require up to 3). You should - audit your server and make sure that you aren't listening on any ports - you don't need to be. It's also highly recommended that the server - Bugzilla resides on, along with any other machines you administer, be - placed behind some kind of firewall. - </para> - - </section> - - <section id="security-os-accounts"> - <title>System User Accounts</title> - - <para>Many <glossterm linkend="gloss-daemon">daemons</glossterm>, such - as Apache's <filename>httpd</filename> or MySQL's - <filename>mysqld</filename>, run as either <quote>root</quote> or - <quote>nobody</quote>. This is even worse on Windows machines where the - majority of <glossterm linkend="gloss-service">services</glossterm> - run as <quote>SYSTEM</quote>. While running as <quote>root</quote> or - <quote>SYSTEM</quote> introduces obvious security concerns, the - problems introduced by running everything as <quote>nobody</quote> may - not be so obvious. Basically, if you run every daemon as - <quote>nobody</quote> and one of them gets compromised it can - compromise every other daemon running as <quote>nobody</quote> on your - machine. For this reason, it is recommended that you create a user - account for each daemon. - </para> - - <note> - <para>You will need to set the <option>webservergroup</option> option - in <filename>localconfig</filename> to the group your web server runs - as. This will allow <filename>./checksetup.pl</filename> to set file - permissions on Unix systems so that nothing is world-writable. - </para> - </note> - - </section> - - <section id="security-os-chroot"> - <title>The <filename>chroot</filename> Jail</title> - - <para> - If your system supports it, you may wish to consider running - Bugzilla inside of a <filename>chroot</filename> jail. This option - provides unprecedented security by restricting anything running - inside the jail from accessing any information outside of it. If you - wish to use this option, please consult the documentation that came - with your system. - </para> - - </section> - - </section> - - <section id="security-webserver"> - <title>Web server</title> - - <section id="security-webserver-access"> - <title>Disabling Remote Access to Bugzilla Configuration Files</title> - - <para> - There are many files that are placed in the Bugzilla directory - area that should not be accessible from the web server. Because of the way - Bugzilla is currently layed out, the list of what should and should not - be accessible is rather complicated. A quick way is to run - <filename>testserver.pl</filename> to check if your web server serves - Bugzilla files as expected. If not, you may want to follow the few - steps below. - </para> - - <tip> - <para>Bugzilla ships with the ability to create - <glossterm linkend="gloss-htaccess"><filename>.htaccess</filename></glossterm> - files that enforce these rules. Instructions for enabling these - directives in Apache can be found in <xref linkend="http-apache"/> - </para> - </tip> - - <itemizedlist spacing="compact"> - <listitem> - <para>In the main Bugzilla directory, you should:</para> - <itemizedlist spacing="compact"> - <listitem> - <para>Block: - <simplelist type="inline"> - <member><filename>*.pl</filename></member> - <member><filename>*localconfig*</filename></member> - </simplelist> - </para> - </listitem> - </itemizedlist> - </listitem> - - <listitem> - <para>In <filename class="directory">data</filename>:</para> - <itemizedlist spacing="compact"> - <listitem> - <para>Block everything</para> - </listitem> - </itemizedlist> - </listitem> - - <listitem> - <para>In <filename class="directory">data/webdot</filename>:</para> - <itemizedlist spacing="compact"> - <listitem> - <para>If you use a remote webdot server:</para> - <itemizedlist spacing="compact"> - <listitem> - <para>Block everything</para> - </listitem> - <listitem> - <para>But allow - <simplelist type="inline"> - <member><filename>*.dot</filename></member> - </simplelist> - only for the remote webdot server</para> - </listitem> - </itemizedlist> - </listitem> - <listitem> - <para>Otherwise, if you use a local GraphViz:</para> - <itemizedlist spacing="compact"> - <listitem> - <para>Block everything</para> - </listitem> - <listitem> - <para>But allow: - <simplelist type="inline"> - <member><filename>*.png</filename></member> - <member><filename>*.gif</filename></member> - <member><filename>*.jpg</filename></member> - <member><filename>*.map</filename></member> - </simplelist> - </para> - </listitem> - </itemizedlist> - </listitem> - <listitem> - <para>And if you don't use any dot:</para> - <itemizedlist spacing="compact"> - <listitem> - <para>Block everything</para> - </listitem> - </itemizedlist> - </listitem> - </itemizedlist> - </listitem> - - <listitem> - <para>In <filename class="directory">Bugzilla</filename>:</para> - <itemizedlist spacing="compact"> - <listitem> - <para>Block everything</para> - </listitem> - </itemizedlist> - </listitem> - - <listitem> - <para>In <filename class="directory">template</filename>:</para> - <itemizedlist spacing="compact"> - <listitem> - <para>Block everything</para> - </listitem> - </itemizedlist> - </listitem> - </itemizedlist> - - <para>Be sure to test that data that should not be accessed remotely is - properly blocked. Of particular interest is the localconfig file which - contains your database password. Also, be aware that many editors - create temporary and backup files in the working directory and that - those should also not be accessible. For more information, see - <ulink url="http://bugzilla.mozilla.org/show_bug.cgi?id=186383">bug 186383</ulink> - or - <ulink url="http://online.securityfocus.com/bid/6501">Bugtraq ID 6501</ulink>. - To test, simply run <filename>testserver.pl</filename>, as said above. - </para> - - <tip> - <para>Be sure to check <xref linkend="http"/> for instructions - specific to the web server you use. - </para> - </tip> - - </section> - - - </section> - - - <section id="security-bugzilla"> - <title>Bugzilla</title> - - <section id="security-bugzilla-charset"> - <title>Prevent users injecting malicious Javascript</title> - - <para>If you installed Bugzilla version 2.22 or later from scratch, - then the <emphasis>utf8</emphasis> parameter is switched on by default. - This makes Bugzilla explicitly set the character encoding, following - <ulink - url="http://www.cert.org/tech_tips/malicious_code_mitigation.html#3">a - CERT advisory</ulink> recommending exactly this. - The following therefore does not apply to you; just keep - <emphasis>utf8</emphasis> turned on. - </para> - - <para>If you've upgraded from an older version, then it may be possible - for a Bugzilla user to take advantage of character set encoding - ambiguities to inject HTML into Bugzilla comments. - This could include malicious scripts. - This is because due to internationalization concerns, we are unable to - turn the <emphasis>utf8</emphasis> parameter on by default for upgraded - installations. - Turning it on manually will prevent this problem. - </para> - </section> - - </section> - -</chapter> - -<!-- Keep this comment at the end of the file -Local variables: -mode: sgml -sgml-always-quote-attributes:t -sgml-auto-insert-required-elements:t -sgml-balanced-tag-edit:t -sgml-exposed-tags:nil -sgml-general-insert-case:lower -sgml-indent-data:t -sgml-indent-step:2 -sgml-local-catalogs:nil -sgml-local-ecat-files:nil -sgml-minimize-attributes:nil -sgml-namecase-general:t -sgml-omittag:t -sgml-parent-document:("Bugzilla-Guide.xml" "book" "chapter") -sgml-shorttag:t -sgml-tag-region-if-active:t -End: --> diff --git a/docs/en/xml/troubleshooting.xml b/docs/en/xml/troubleshooting.xml deleted file mode 100644 index 7dcf75238..000000000 --- a/docs/en/xml/troubleshooting.xml +++ /dev/null @@ -1,287 +0,0 @@ -<?xml version="1.0"?> -<!-- 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. ---> -<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" - "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ - <!ENTITY % myents SYSTEM "bugzilla.ent"> - %myents; -]> - -<appendix id="troubleshooting"> -<title>Troubleshooting</title> - - <para>This section gives solutions to common Bugzilla installation - problems. If none of the section headings seems to match your - problem, read the general advice. - </para> - - <section id="general-advice"> - <title>General Advice</title> - <para>If you can't get <filename>checksetup.pl</filename> to run to - completion, it normally explains what's wrong and how to fix it. - If you can't work it out, or if it's being uncommunicative, post - the errors in the - <ulink url="news://news.mozilla.org/mozilla.support.bugzilla">mozilla.support.bugzilla</ulink> - newsgroup. - </para> - - <para>If you have made it all the way through - <xref linkend="installation"/> (Installation) and - <xref linkend="configuration"/> (Configuration) but accessing the Bugzilla - URL doesn't work, the first thing to do is to check your web server error - log. For Apache, this is often located at - <filename>/etc/logs/httpd/error_log</filename>. The error messages - you see may be self-explanatory enough to enable you to diagnose and - fix the problem. If not, see below for some commonly-encountered - errors. If that doesn't help, post the errors to the newsgroup. - </para> - - <para> - Bugzilla can also log all user-based errors (and many code-based errors) - that occur, without polluting the web server's error log. To enable - Bugzilla error logging, create a file that Bugzilla can write to, named - <filename>errorlog</filename>, in the Bugzilla <filename>data</filename> - directory. Errors will be logged as they occur, and will include the type - of the error, the IP address and username (if available) of the user who - triggered the error, and the values of all environment variables; if a - form was being submitted, the data in the form will also be included. - To disable error logging, delete or rename the - <filename>errorlog</filename> file. - </para> - </section> - - <section id="trbl-testserver"> - <title>The Apache web server is not serving Bugzilla pages</title> - <para>After you have run <command>checksetup.pl</command> twice, - run <command>testserver.pl http://yoursite.yourdomain/yoururl</command> - to confirm that your web server is configured properly for - Bugzilla. - </para> - <programlisting> -<prompt>bash$</prompt> ./testserver.pl http://landfill.bugzilla.org/bugzilla-tip -TEST-OK Webserver is running under group id in $webservergroup. -TEST-OK Got ant picture. -TEST-OK Webserver is executing CGIs. -TEST-OK Webserver is preventing fetch of http://landfill.bugzilla.org/bugzilla-tip/localconfig. -</programlisting> - </section> - - <section id="trbl-perlmodule"> - <title>I installed a Perl module, but - <filename>checksetup.pl</filename> claims it's not installed!</title> - - <para>This could be caused by one of two things:</para> - <orderedlist> - <listitem> - <para>You have two versions of Perl on your machine. You are installing - modules into one, and Bugzilla is using the other. Rerun the CPAN - commands (or manual compile) using the full path to Perl from the - top of <filename>checksetup.pl</filename>. This will make sure you - are installing the modules in the right place. - </para> - </listitem> - <listitem> - <para>The permissions on your library directories are set incorrectly. - They must, at the very least, be readable by the web server user or - group. It is recommended that they be world readable. - </para> - </listitem> - </orderedlist> - </section> - - <section id="trbl-dbdSponge"> - <title>DBD::Sponge::db prepare failed</title> - - <para>The following error message may appear due to a bug in DBD::mysql - (over which the Bugzilla team have no control): - </para> - -<programlisting><![CDATA[ DBD::Sponge::db prepare failed: Cannot determine NUM_OF_FIELDS at D:/Perl/site/lib/DBD/mysql.pm line 248. - SV = NULL(0x0) at 0x20fc444 - REFCNT = 1 - FLAGS = (PADBUSY,PADMY) -]]></programlisting> - - <para>To fix this, go to - <filename><path-to-perl>/lib/DBD/sponge.pm</filename> - in your Perl installation and replace - </para> - -<programlisting><![CDATA[ my $numFields; - if ($attribs->{'NUM_OF_FIELDS'}) { - $numFields = $attribs->{'NUM_OF_FIELDS'}; - } elsif ($attribs->{'NAME'}) { - $numFields = @{$attribs->{NAME}}; -]]></programlisting> - - <para>with</para> - -<programlisting><![CDATA[ my $numFields; - if ($attribs->{'NUM_OF_FIELDS'}) { - $numFields = $attribs->{'NUM_OF_FIELDS'}; - } elsif ($attribs->{'NAMES'}) { - $numFields = @{$attribs->{NAMES}}; -]]></programlisting> - - <para>(note the S added to NAME.)</para> - </section> - - <section id="paranoid-security"> - <title>cannot chdir(/var/spool/mqueue)</title> - - <para>If you are installing Bugzilla on SuSE Linux, or some other - distributions with <quote>paranoid</quote> security options, it is - possible that the checksetup.pl script may fail with the error: -<programlisting><![CDATA[cannot chdir(/var/spool/mqueue): Permission denied -]]></programlisting> - </para> - - <para>This is because your <filename>/var/spool/mqueue</filename> - directory has a mode of <computeroutput>drwx------</computeroutput>. - Type <command>chmod 755 <filename>/var/spool/mqueue</filename></command> - as root to fix this problem. This will allow any process running on your - machine the ability to <emphasis>read</emphasis> the - <filename>/var/spool/mqueue</filename> directory. - </para> - </section> - - <section id="trbl-relogin-everyone"> - <title>Everybody is constantly being forced to relogin</title> - - <para>The most-likely cause is that the <quote>cookiepath</quote> parameter - is not set correctly in the Bugzilla configuration. You can change this (if - you're a Bugzilla administrator) from the editparams.cgi page via the web interface. - </para> - - <para>The value of the cookiepath parameter should be the actual directory - containing your Bugzilla installation, <emphasis>as seen by the end-user's - web browser</emphasis>. Leading and trailing slashes are mandatory. You can - also set the cookiepath to any directory which is a parent of the Bugzilla - directory (such as '/', the root directory). But you can't put something - that isn't at least a partial match or it won't work. What you're actually - doing is restricting the end-user's browser to sending the cookies back only - to that directory. - </para> - - <para>How do you know if you want your specific Bugzilla directory or the - whole site? - </para> - - <para>If you have only one Bugzilla running on the server, and you don't - mind having other applications on the same server with it being able to see - the cookies (you might be doing this on purpose if you have other things on - your site that share authentication with Bugzilla), then you'll want to have - the cookiepath set to "/", or to a sufficiently-high enough directory that - all of the involved apps can see the cookies. - </para> - - <example id="trbl-relogin-everyone-share"> - <title>Examples of urlbase/cookiepath pairs for sharing login cookies</title> - - <blockquote> - <literallayout> -urlbase is http://bugzilla.mozilla.org/ -cookiepath is / - -urlbase is http://tools.mysite.tld/bugzilla/ - but you have http://tools.mysite.tld/someotherapp/ which shares - authentication with your Bugzilla -cookiepath is / - </literallayout> - </blockquote> - </example> - - <para>On the other hand, if you have more than one Bugzilla running on the - server (some people do - we do on landfill) then you need to have the - cookiepath restricted enough so that the different Bugzillas don't - confuse their cookies with one another. - </para> - - - <example id="trbl-relogin-everyone-restrict"> - <title>Examples of urlbase/cookiepath pairs to restrict the login cookie</title> - <blockquote> - <literallayout> -urlbase is http://landfill.bugzilla.org/bugzilla-tip/ -cookiepath is /bugzilla-tip/ - -urlbase is http://landfill.bugzilla.org/bugzilla-4.0-branch/ -cookiepath is /bugzilla-4.0-branch/ - </literallayout> - </blockquote> - </example> - - <para>If you had cookiepath set to <quote>/</quote> at any point in the - past and need to set it to something more restrictive - (i.e. <quote>/bugzilla/</quote>), you can safely do this without - requiring users to delete their Bugzilla-related cookies in their - browser (this is true starting with Bugzilla 2.18 and Bugzilla 2.16.5). - </para> - </section> - - <section id="trbl-index"> - <title><filename>index.cgi</filename> doesn't show up unless specified in the URL</title> - <para> - You probably need to set up your web server in such a way that it - will serve the index.cgi page as an index page. - </para> - <para> - If you are using Apache, you can do this by adding - <filename>index.cgi</filename> to the end of the - <computeroutput>DirectoryIndex</computeroutput> line - as mentioned in <xref linkend="http-apache"/>. - </para> - - </section> - - <section id="trbl-passwd-encryption"> - <title> - checksetup.pl reports "Client does not support authentication protocol - requested by server..." - </title> - - <para> - This error is occurring because you are using the new password - encryption that comes with MySQL 4.1, while your - <filename>DBD::mysql</filename> module was compiled against an - older version of MySQL. If you recompile <filename>DBD::mysql</filename> - against the current MySQL libraries (or just obtain a newer version - of this module) then the error may go away. - </para> - - <para> - If that does not fix the problem, or if you cannot recompile the - existing module (e.g. you're running Windows) and/or don't want to - replace it (e.g. you want to keep using a packaged version), then a - workaround is available from the MySQL docs: - <ulink url="http://dev.mysql.com/doc/mysql/en/Old_client.html"/> - </para> - - </section> - -</appendix> - -<!-- Keep this comment at the end of the file -Local variables: -mode: sgml -sgml-always-quote-attributes:t -sgml-auto-insert-required-elements:t -sgml-balanced-tag-edit:t -sgml-exposed-tags:nil -sgml-general-insert-case:lower -sgml-indent-data:t -sgml-indent-step:2 -sgml-local-catalogs:nil -sgml-local-ecat-files:nil -sgml-minimize-attributes:nil -sgml-namecase-general:t -sgml-omittag:t -sgml-parent-document:("Bugzilla-Guide.xml" "book" "chapter") -sgml-shorttag:t -sgml-tag-region-if-active:t -End: --> diff --git a/docs/en/xml/using.xml b/docs/en/xml/using.xml deleted file mode 100644 index c806da269..000000000 --- a/docs/en/xml/using.xml +++ /dev/null @@ -1,2072 +0,0 @@ -<?xml version="1.0"?> -<!-- 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. ---> -<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" - "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [ - <!ENTITY % myents SYSTEM "bugzilla.ent"> - %myents; -]> - -<chapter id="using"> - <title>Using Bugzilla</title> - - <section id="using-intro"> - <title>Introduction</title> - <para>This section contains information for end-users of Bugzilla. There - is a Bugzilla test installation, called - <ulink url="http://landfill.bugzilla.org/">Landfill</ulink>, which you are - welcome to play with (if it's up). However, not all of the Bugzilla - installations there will necessarily have all Bugzilla features enabled, - and different installations run different versions, so some things may not - quite work as this document describes.</para> - - <para> - Frequently Asked Questions (FAQ) are available and answered on - <ulink url="http://wiki.mozilla.org/Bugzilla:FAQ">wiki.mozilla.org</ulink>. - They may cover some questions you have which are left unanswered. - </para> - </section> - - <section id="myaccount"> - <title>Create a Bugzilla Account</title> - - <para>If you want to use Bugzilla, first you need to create an account. - Consult with the administrator responsible for your installation of - Bugzilla for the URL you should use to access it. If you're - test-driving Bugzilla, use this URL: - <ulink url="&landfillbase;"/>. - </para> - - <orderedlist> - <listitem> - <para> - On the home page <filename>index.cgi</filename>, click the - <quote>Open a new Bugzilla account</quote> link, or the - <quote>New Account</quote> link available in the footer of pages. - Now enter your email address, then click the <quote>Send</quote> - button. - </para> - - <note> - <para> - If none of these links is available, this means that the - administrator of the installation has disabled self-registration. - This means that only an administrator can create accounts - for other users. One reason could be that this installation is - private. - </para> - </note> - - <note> - <para> - Also, if only some users are allowed to create an account on - the installation, you may see these links but your registration - may fail if your email address doesn't match the ones accepted - by the installation. This is another way to restrict who can - access and edit bugs in this installation. - </para> - </note> - </listitem> - - <listitem> - <para> - Within moments, and if your registration is accepted, you should - receive an email to the address you provided, which contains your - login name (generally the same as the email address), and two URLs - with a token (a random string generated by the installation) to - confirm, respectively cancel, your registration. This is a way to - prevent users from abusing the generation of user accounts, for - instance by entering inexistent email addresses, or email addresses - which do not belong to them. - </para> - </listitem> - - <listitem> - <para> - By default, you have 3 days to confirm your registration. Past this - timeframe, the token is invalidated and the registration is - automatically canceled. You can also cancel this registration sooner - by using the appropriate URL in the email you got. - </para> - </listitem> - - <listitem> - <para> - If you confirm your registration, Bugzilla will ask you your real name - (optional, but recommended) and your password, which must be between - 3 and 16 characters long. - </para> - </listitem> - - <listitem> - <para> - Now all you need to do is to click the <quote>Log In</quote> - link in the footer at the bottom of the page in your browser, - enter your email address and password you just chose into the - login form, and click the <quote>Log in</quote> button. - </para> - </listitem> - </orderedlist> - - <para> - You are now logged in. Bugzilla uses cookies to remember you are - logged in so, unless you have cookies disabled or your IP address changes, - you should not have to log in again during your session. - </para> - </section> - - <section id="bug_page"> - <title>Anatomy of a Bug</title> - - <para>The core of Bugzilla is the screen which displays a particular - bug. It's a good place to explain some Bugzilla concepts. - <ulink - url="&landfillbase;show_bug.cgi?id=1"> - Bug 1 on Landfill</ulink> - - is a good example. Note that the labels for most fields are hyperlinks; - clicking them will take you to context-sensitive help on that - particular field. Fields marked * may not be present on every - installation of Bugzilla.</para> - - <orderedlist> - <listitem> - <para> - <emphasis>Product and Component</emphasis>: - Bugs are divided up by Product and Component, with a Product - having one or more Components in it. For example, - bugzilla.mozilla.org's "Bugzilla" Product is composed of several - Components: - <variablelist> - <varlistentry> - <term>Administration:</term> - <listitem> - <para> - Administration of a Bugzilla installation. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>Bugzilla-General:</term> - <listitem> - <para> - Anything that doesn't fit in the other components, or spans - multiple components. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>Creating/Changing Bugs:</term> - <listitem> - <para> - Creating, changing, and viewing bugs. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>Documentation:</term> - <listitem> - <para> - The Bugzilla documentation, including The Bugzilla Guide. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>Email:</term> - <listitem> - <para> - Anything to do with email sent by Bugzilla. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>Installation:</term> - <listitem> - <para> - The installation process of Bugzilla. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>Query/Buglist:</term> - <listitem> - <para> - Anything to do with searching for bugs and viewing the - buglists. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>Reporting/Charting:</term> - <listitem> - <para> - Getting reports from Bugzilla. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>User Accounts:</term> - <listitem> - <para> - Anything about managing a user account from the user's perspective. - Saved queries, creating accounts, changing passwords, logging in, - etc. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>User Interface:</term> - <listitem> - <para> - General issues having to do with the user interface cosmetics (not - functionality) including cosmetic issues, HTML templates, - etc. - </para> - </listitem> - </varlistentry> - </variablelist> - </para> - </listitem> - - <listitem> - <para> - <emphasis>Status and Resolution:</emphasis> - - These define exactly what state the bug is in - from not even - being confirmed as a bug, through to being fixed and the fix - confirmed by Quality Assurance. The different possible values for - Status and Resolution on your installation should be documented in the - context-sensitive help for those items.</para> - </listitem> - - <listitem> - <para> - <emphasis>Assigned To:</emphasis> - The person responsible for fixing the bug.</para> - </listitem> - - <listitem> - <para> - <emphasis>*QA Contact:</emphasis> - The person responsible for quality assurance on this bug.</para> - </listitem> - - <listitem> - <para> - <emphasis>*URL:</emphasis> - A URL associated with the bug, if any.</para> - </listitem> - - <listitem> - <para> - <emphasis>Summary:</emphasis> - A one-sentence summary of the problem.</para> - </listitem> - - <listitem> - <para> - <emphasis>*Status Whiteboard:</emphasis> - (a.k.a. Whiteboard) A free-form text area for adding short notes - and tags to a bug.</para> - </listitem> - - <listitem> - <para> - <emphasis>*Keywords:</emphasis> - The administrator can define keywords which you can use to tag and - categorise bugs - e.g. The Mozilla Project has keywords like crash - and regression.</para> - </listitem> - - <listitem> - <para> - <emphasis>Platform and OS:</emphasis> - These indicate the computing environment where the bug was - found.</para> - </listitem> - - <listitem> - <para> - <emphasis>Version:</emphasis> - The "Version" field is usually used for versions of a product which - have been released, and is set to indicate which versions of a - Component have the particular problem the bug report is - about.</para> - </listitem> - - <listitem> - <para> - <emphasis>Priority:</emphasis> - The bug assignee uses this field to prioritize his or her bugs. - It's a good idea not to change this on other people's bugs.</para> - </listitem> - - <listitem> - <para> - <emphasis>Severity:</emphasis> - This indicates how severe the problem is - from blocker - ("application unusable") to trivial ("minor cosmetic issue"). You - can also use this field to indicate whether a bug is an enhancement - request.</para> - </listitem> - - <listitem> - <para> - <emphasis>*Target:</emphasis> - (a.k.a. Target Milestone) A future version by which the bug is to - be fixed. e.g. The Bugzilla Project's milestones for future - Bugzilla versions are 2.18, 2.20, 3.0, etc. Milestones are not - restricted to numbers, thought - you can use any text strings, such - as dates.</para> - </listitem> - - <listitem> - <para> - <emphasis>Reporter:</emphasis> - The person who filed the bug.</para> - </listitem> - - <listitem> - <para> - <emphasis>CC list:</emphasis> - A list of people who get mail when the bug changes.</para> - </listitem> - - <listitem> - <para> - <emphasis>*Time Tracking:</emphasis> - This form can be used for time tracking. - To use this feature, you have to be blessed group membership - specified by the <quote>timetrackinggroup</quote> parameter. - <variablelist> - <varlistentry> - <term>Orig. Est.:</term> - <listitem> - <para> - This field shows the original estimated time. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>Current Est.:</term> - <listitem> - <para> - This field shows the current estimated time. - This number is calculated from <quote>Hours Worked</quote> - and <quote>Hours Left</quote>. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>Hours Worked:</term> - <listitem> - <para> - This field shows the number of hours worked. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>Hours Left:</term> - <listitem> - <para> - This field shows the <quote>Current Est.</quote> - - <quote>Hours Worked</quote>. - This value + <quote>Hours Worked</quote> will become the - new Current Est. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>%Complete:</term> - <listitem> - <para> - This field shows what percentage of the task is complete. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>Gain:</term> - <listitem> - <para> - This field shows the number of hours that the bug is ahead of the - <quote>Orig. Est.</quote>. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>Deadline:</term> - <listitem> - <para> - This field shows the deadline for this bug. - </para> - </listitem> - </varlistentry> - </variablelist> - </para> - </listitem> - - <listitem> - <para> - <emphasis>Attachments:</emphasis> - You can attach files (e.g. testcases or patches) to bugs. If there - are any attachments, they are listed in this section. - </para> - </listitem> - - <listitem> - <para> - <emphasis>*Dependencies:</emphasis> - If this bug cannot be fixed unless other bugs are fixed (depends - on), or this bug stops other bugs being fixed (blocks), their - numbers are recorded here.</para> - </listitem> - - <listitem> - <para> - <emphasis>*Votes:</emphasis> - Whether this bug has any votes.</para> - </listitem> - - <listitem> - <para> - <emphasis>Additional Comments:</emphasis> - You can add your two cents to the bug discussion here, if you have - something worthwhile to say.</para> - </listitem> - </orderedlist> - </section> - - <section id="lifecycle"> - <title>Life Cycle of a Bug</title> - - <para> - The life cycle of a bug, also known as workflow, is customizable to match - the needs of your organization, see <xref linkend="bug_status_workflow"/>. - <xref linkend="lifecycle-image"/> contains a graphical representation of - the default workflow using the default bug statuses. If you wish to - customize this image for your site, the - <ulink url="../images/bzLifecycle.xml">diagram file</ulink> - is available in <ulink url="http://www.gnome.org/projects/dia">Dia's</ulink> - native XML format. - </para> - - <figure id="lifecycle-image"> - <title>Lifecycle of a Bugzilla Bug</title> - <mediaobject> - <imageobject> - <imagedata fileref="../images/bzLifecycle.png"/> - </imageobject> - </mediaobject> - </figure> - </section> - - <section id="query"> - <title>Searching for Bugs</title> - - <para>The Bugzilla Search page is the interface where you can find - any bug report, comment, or patch currently in the Bugzilla system. You - can play with it here: - <ulink url="&landfillbase;query.cgi"/>.</para> - - <para>The Search page has controls for selecting different possible - values for all of the fields in a bug, as described above. For some - fields, multiple values can be selected. In those cases, Bugzilla - returns bugs where the content of the field matches any one of the selected - values. If none is selected, then the field can take any value.</para> - - <para> - After a search is run, you can save it as a Saved Search, which - will appear in the page footer. If you are in the group defined - by the "querysharegroup" parameter, you may share your queries - with other users, see <xref linkend="savedsearches"/> for more details. - </para> - - <section id="boolean"> - <title>Boolean Charts</title> - <para> - Highly advanced querying is done using Boolean Charts. - </para> - <para> - The boolean charts further restrict the set of results - returned by a query. It is possible to search for bugs - based on elaborate combinations of criteria. - </para> - <para> - The simplest boolean searches have only one term. These searches - permit the selected left <emphasis>field</emphasis> - to be compared using a - selectable <emphasis>operator</emphasis> to a - specified <emphasis>value.</emphasis> - Using the "And," "Or," and "Add Another Boolean Chart" buttons, - additional terms can be included in the query, further - altering the list of bugs returned by the query. - </para> - <para> - There are three fields in each row of a boolean search. - </para> - <itemizedlist> - <listitem> - <para> - <emphasis>Field:</emphasis> - the items being searched - </para> - </listitem> - <listitem> - <para> - <emphasis>Operator:</emphasis> - the comparison operator - </para> - </listitem> - <listitem> - <para> - <emphasis>Value:</emphasis> - the value to which the field is being compared - </para> - </listitem> - </itemizedlist> - <section id="pronouns"> - <title>Pronoun Substitution</title> - <para> - Sometimes, a query needs to compare a user-related field - (such as ReportedBy) with a role-specific user (such as the - user running the query or the user to whom each bug is assigned). - When the operator is either "is equal to" or "is not equal to", the value - can be "%reporter%", "%assignee%", "%qacontact%", or "%user%". - The user pronoun - refers to the user who is executing the query or, in the case - of whining reports, the user who will be the recipient - of the report. The reporter, assignee, and qacontact - pronouns refer to the corresponding fields in the bug. - </para> - <para> - Boolean charts also let you type a group name in any user-related - field if the operator is either "is equal to", "is not equal to" or - "contains the string (exact case)". This will let you query for - any member belonging (or not) to the specified group. The group name - must be entered following the "%group.foo%" syntax, where "foo" is - the group name. So if you are looking for bugs reported by any user - being in the "editbugs" group, then you can type "%group.editbugs%". - </para> - </section> - <section id="negation"> - <title>Negation</title> - <para> - At first glance, negation seems redundant. Rather than - searching for - <blockquote> - <para> - NOT("summary" "contains the string" "foo"), - </para> - </blockquote> - one could search for - <blockquote> - <para> - ("summary" "does not contain the string" "foo"). - </para> - </blockquote> - However, the search - <blockquote> - <para> - ("CC" "does not contain the string" "@mozilla.org") - </para> - </blockquote> - would find every bug where anyone on the CC list did not contain - "@mozilla.org" while - <blockquote> - <para> - NOT("CC" "contains the string" "@mozilla.org") - </para> - </blockquote> - would find every bug where there was nobody on the CC list who - did contain the string. Similarly, the use of negation also permits - complex expressions to be built using terms OR'd together and then - negated. Negation permits queries such as - <blockquote> - <para> - NOT(("product" "is equal to" "update") OR - ("component" "is equal to" "Documentation")) - </para> - </blockquote> - to find bugs that are neither - in the update product or in the documentation component or - <blockquote> - <para> - NOT(("commenter" "is equal to" "%assignee%") OR - ("component" "is equal to" "Documentation")) - </para> - </blockquote> - to find non-documentation - bugs on which the assignee has never commented. - </para> - </section> - <section id="multiplecharts"> - <title>Multiple Charts</title> - <para> - The terms within a single row of a boolean chart are all - constraints on a single piece of data. If you are looking for - a bug that has two different people cc'd on it, then you need - to use two boolean charts. A search for - <blockquote> - <para> - ("cc" "contains the string" "foo@") AND - ("cc" "contains the string" "@mozilla.org") - </para> - </blockquote> - would return only bugs with "foo@mozilla.org" on the cc list. - If you wanted bugs where there is someone on the cc list - containing "foo@" and someone else containing "@mozilla.org", - then you would need two boolean charts. - <blockquote> - <para> - First chart: ("cc" "contains the string" "foo@") - </para> - <para> - Second chart: ("cc" "contains the string" "@mozilla.org") - </para> - </blockquote> - The bugs listed will be only the bugs where ALL the charts are true. - </para> - </section> - </section> - - <section id="quicksearch"> - <title>Quicksearch</title> - - <para> - Quicksearch is a single-text-box query tool which uses - metacharacters to indicate what is to be searched. For example, typing - "<literal>foo|bar</literal>" - into Quicksearch would search for "foo" or "bar" in the - summary and status whiteboard of a bug; adding - "<literal>:BazProduct</literal>" would - search only in that product. - You can use it to find a bug by its number or its alias, too. - </para> - - <para> - You'll find the Quicksearch box in Bugzilla's footer area. - On Bugzilla's front page, there is an additional - <ulink url="../../page.cgi?id=quicksearch.html">Help</ulink> - link which details how to use it. - </para> - </section> - <section id="casesensitivity"> - <title>Case Sensitivity in Searches</title> - <para> - Bugzilla queries are case-insensitive and accent-insensitive, when - used with either MySQL or Oracle databases. When using Bugzilla with - PostgreSQL, however, some queries are case-sensitive. This is due to - the way PostgreSQL handles case and accent sensitivity. - </para> - </section> - <section id="list"> - <title>Bug Lists</title> - - <para>If you run a search, a list of matching bugs will be returned. - </para> - - <para>The format of the list is configurable. For example, it can be - sorted by clicking the column headings. Other useful features can be - accessed using the links at the bottom of the list: - <variablelist> - <varlistentry> - <term>Long Format:</term> - <listitem> - <para> - this gives you a large page with a non-editable summary of the fields - of each bug. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>XML:</term> - <listitem> - <para> - get the buglist in the XML format. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>CSV:</term> - <listitem> - <para> - get the buglist as comma-separated values, for import into e.g. - a spreadsheet. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>Feed:</term> - <listitem> - <para> - get the buglist as an Atom feed. Copy this link into your - favorite feed reader. If you are using Firefox, you can also - save the list as a live bookmark by clicking the live bookmark - icon in the status bar. To limit the number of bugs in the feed, - add a limit=n parameter to the URL. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>iCalendar:</term> - <listitem> - <para> - Get the buglist as an iCalendar file. Each bug is represented as a - to-do item in the imported calendar. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>Change Columns:</term> - <listitem> - <para> - change the bug attributes which appear in the list. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>Change several bugs at once:</term> - <listitem> - <para> - If your account is sufficiently empowered, and more than one bug - appear in the bug list, this link is displayed which lets you make - the same change to all the bugs in the list - for example, changing - their assignee. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>Send mail to bug assignees:</term> - <listitem> - <para> - If more than one bug appear in the bug list and there are at least - two distinct bug assignees, this links is displayed which lets you - easily send a mail to the assignees of all bugs on the list. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>Edit Search:</term> - <listitem> - <para> - If you didn't get exactly the results you were looking for, you can - return to the Query page through this link and make small revisions - to the query you just made so you get more accurate results. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term>Remember Search As:</term> - <listitem> - <para> - You can give a search a name and remember it; a link will appear - in your page footer giving you quick access to run it again later. - </para> - </listitem> - </varlistentry> - </variablelist> - </para> - </section> - - <section id="individual-buglists"> - <title>Adding/removing tags to/from bugs</title> - <para> - You can add and remove tags from individual bugs, which let you find and - manage bugs more easily. Tags are per-user and so are only visible and editable - by the user who created them. You can then run queries using tags as a criteria, - either by using the Advanced Search form, or simply by typing "tag:my_tag_name" - in the QuickSearch box at the top (or bottom) of the page. Tags can also be - displayed in buglists. - </para> - - <para> - This feature is useful when you want to keep track of several bugs, but - for different reasons. Instead of adding yourself to the CC list of all - these bugs and mixing all these reasons, you can now store these bugs in - separate lists, e.g. <quote>Keep in mind</quote>, <quote>Interesting bugs</quote>, - or <quote>Triage</quote>. One big advantage of this way to manage bugs - is that you can easily add or remove tags from bugs one by one. - </para> - </section> - </section> - - <section id="bugreports"> - <title>Filing Bugs</title> - - <section id="fillingbugs"> - <title>Reporting a New Bug</title> - - <para>Years of bug writing experience has been distilled for your - reading pleasure into the - <ulink - url="&landfillbase;page.cgi?id=bug-writing.html"> - Bug Writing Guidelines</ulink>. - While some of the advice is Mozilla-specific, the basic principles of - reporting Reproducible, Specific bugs, isolating the Product you are - using, the Version of the Product, the Component which failed, the - Hardware Platform, and Operating System you were using at the time of - the failure go a long way toward ensuring accurate, responsible fixes - for the bug that bit you.</para> - - <para>The procedure for filing a bug is as follows:</para> - - <orderedlist> - <listitem> - <para> - Click the <quote>New</quote> link available in the footer - of pages, or the <quote>Enter a new bug report</quote> link - displayed on the home page of the Bugzilla installation. - </para> - - <note> - <para> - If you want to file a test bug to see how Bugzilla works, - you can do it on one of our test installations on - <ulink url="&landfillbase;">Landfill</ulink>. - </para> - </note> - </listitem> - - <listitem> - <para> - You first have to select the product in which you found a bug. - </para> - </listitem> - - <listitem> - <para> - You now see a form where you can specify the component (part of - the product which is affected by the bug you discovered; if you have - no idea, just select <quote>General</quote> if such a component exists), - the version of the program you were using, the Operating System and - platform your program is running on and the severity of the bug (if the - bug you found crashes the program, it's probably a major or a critical - bug; if it's a typo somewhere, that's something pretty minor; if it's - something you would like to see implemented, then that's an enhancement). - </para> - </listitem> - - <listitem> - <para> - You now have to give a short but descriptive summary of the bug you found. - <quote>My program is crashing all the time</quote> is a very poor summary - and doesn't help developers at all. Try something more meaningful or - your bug will probably be ignored due to a lack of precision. - The next step is to give a very detailed list of steps to reproduce - the problem you encountered. Try to limit these steps to a minimum set - required to reproduce the problem. This will make the life of - developers easier, and the probability that they consider your bug in - a reasonable timeframe will be much higher. - </para> - - <note> - <para> - Try to make sure that everything in the summary is also in the first - comment. Summaries are often updated and this will ensure your original - information is easily accessible. - </para> - </note> - </listitem> - - <listitem> - <para> - As you file the bug, you can also attach a document (testcase, patch, - or screenshot of the problem). - </para> - </listitem> - - <listitem> - <para> - Depending on the Bugzilla installation you are using and the product in - which you are filing the bug, you can also request developers to consider - your bug in different ways (such as requesting review for the patch you - just attached, requesting your bug to block the next release of the - product, and many other product specific requests). - </para> - </listitem> - - <listitem> - <para> - Now is a good time to read your bug report again. Remove all misspellings, - otherwise your bug may not be found by developers running queries for some - specific words, and so your bug would not get any attention. - Also make sure you didn't forget any important information developers - should know in order to reproduce the problem, and make sure your - description of the problem is explicit and clear enough. - When you think your bug report is ready to go, the last step is to - click the <quote>Commit</quote> button to add your report into the database. - </para> - </listitem> - </orderedlist> - - <para> - You do not need to put "any" or similar strings in the URL field. - If there is no specific URL associated with the bug, leave this - field blank. - </para> - - <para>If you feel a bug you filed was incorrectly marked as a - DUPLICATE of another, please question it in your bug, not - the bug it was duped to. Feel free to CC the person who duped it - if they are not already CCed. - </para> - </section> - - <section id="cloningbugs"> - <title>Clone an Existing Bug</title> - - <para> - Starting with version 2.20, Bugzilla has a feature that allows you - to clone an existing bug. The newly created bug will inherit - most settings from the old bug. This allows you to track more - easily similar concerns in a new bug. To use this, go to the bug - that you want to clone, then click the <quote>Clone This Bug</quote> - link on the bug page. This will take you to the <quote>Enter Bug</quote> - page that is filled with the values that the old bug has. - You can change those values and/or texts if needed. - </para> - </section> - - </section> - - <section id="attachments"> - <title>Attachments</title> - - <para> - You should use attachments, rather than comments, for large chunks of ASCII - data, such as trace, debugging output files, or log files. That way, it - doesn't bloat the bug for everyone who wants to read it, and cause people to - receive fat, useless mails. - </para> - - <para>You should make sure to trim screenshots. There's no need to show the - whole screen if you are pointing out a single-pixel problem. - </para> - - <para>Bugzilla stores and uses a Content-Type for each attachment - (e.g. text/html). To download an attachment as a different - Content-Type (e.g. application/xhtml+xml), you can override this - using a 'content_type' parameter on the URL, e.g. - <filename>&content_type=text/plain</filename>. - </para> - - <para> - Also, you can enter the URL pointing to the attachment instead of - uploading the attachment itself. For example, this is useful if you want to - point to an external application, a website or a very large file. Note that - there is no guarantee that the source file will always be available, nor - that its content will remain unchanged. - </para> - - <para> - Another way to attach data is to paste text directly in the text field, - and Bugzilla will convert it into an attachment. This is pretty useful - when you do copy and paste, and you don't want to put the text in a temporary - file first. - </para> - - <section id="patchviewer"> - <title>Patch Viewer</title> - - <para>Viewing and reviewing patches in Bugzilla is often difficult due to - lack of context, improper format and the inherent readability issues that - raw patches present. Patch Viewer is an enhancement to Bugzilla designed - to fix that by offering increased context, linking to sections, and - integrating with Bonsai, LXR and CVS.</para> - - <para>Patch viewer allows you to:</para> - - <simplelist> - <member>View patches in color, with side-by-side view rather than trying - to interpret the contents of the patch.</member> - <member>See the difference between two patches.</member> - <member>Get more context in a patch.</member> - <member>Collapse and expand sections of a patch for easy - reading.</member> - <member>Link to a particular section of a patch for discussion or - review</member> - <member>Go to Bonsai or LXR to see more context, blame, and - cross-references for the part of the patch you are looking at</member> - <member>Create a rawtext unified format diff out of any patch, no - matter what format it came from</member> - </simplelist> - - <section id="patchviewer_view"> - <title>Viewing Patches in Patch Viewer</title> - <para>The main way to view a patch in patch viewer is to click on the - "Diff" link next to a patch in the Attachments list on a bug. You may - also do this within the edit window by clicking the "View Attachment As - Diff" button in the Edit Attachment screen.</para> - </section> - - <section id="patchviewer_diff"> - <title>Seeing the Difference Between Two Patches</title> - <para>To see the difference between two patches, you must first view the - newer patch in Patch Viewer. Then select the older patch from the - dropdown at the top of the page ("Differences between [dropdown] and - this patch") and click the "Diff" button. This will show you what - is new or changed in the newer patch.</para> - </section> - - <section id="patchviewer_context"> - <title>Getting More Context in a Patch</title> - <para>To get more context in a patch, you put a number in the textbox at - the top of Patch Viewer ("Patch / File / [textbox]") and hit enter. - This will give you that many lines of context before and after each - change. Alternatively, you can click on the "File" link there and it - will show each change in the full context of the file. This feature only - works against files that were diffed using "cvs diff".</para> - </section> - - <section id="patchviewer_collapse"> - <title>Collapsing and Expanding Sections of a Patch</title> - <para>To view only a certain set of files in a patch (for example, if a - patch is absolutely huge and you want to only review part of it at a - time), you can click the "(+)" and "(-)" links next to each file (to - expand it or collapse it). If you want to collapse all files or expand - all files, you can click the "Collapse All" and "Expand All" links at the - top of the page.</para> - </section> - - <section id="patchviewer_link"> - <title>Linking to a Section of a Patch</title> - <para>To link to a section of a patch (for example, if you want to be - able to give someone a URL to show them which part you are talking - about) you simply click the "Link Here" link on the section header. The - resulting URL can be copied and used in discussion.</para> - </section> - - <section id="patchviewer_bonsai_lxr"> - <title>Going to Bonsai and LXR</title> - <para>To go to Bonsai to get blame for the lines you are interested in, - you can click the "Lines XX-YY" link on the section header you are - interested in. This works even if the patch is against an old - version of the file, since Bonsai stores all versions of the file.</para> - - <para>To go to LXR, you click on the filename on the file header - (unfortunately, since LXR only does the most recent version, line - numbers are likely to rot).</para> - </section> - - <section id="patchviewer_unified_diff"> - <title>Creating a Unified Diff</title> - <para>If the patch is not in a format that you like, you can turn it - into a unified diff format by clicking the "Raw Unified" link at the top - of the page.</para> - </section> - </section> - </section> - - <section id="hintsandtips"> - <title>Hints and Tips</title> - - <para>This section distills some Bugzilla tips and best practices - that have been developed.</para> - - <section> - <title>Autolinkification</title> - <para>Bugzilla comments are plain text - so typing <U> will - produce less-than, U, greater-than rather than underlined text. - However, Bugzilla will automatically make hyperlinks out of certain - sorts of text in comments. For example, the text - "http://www.bugzilla.org" will be turned into a link: - <ulink url="http://www.bugzilla.org"/>. - Other strings which get linkified in the obvious manner are: - <simplelist> - <member>bug 12345</member> - <member>comment 7</member> - <member>bug 23456, comment 53</member> - <member>attachment 4321</member> - <member>mailto:george@example.com</member> - <member>george@example.com</member> - <member>ftp://ftp.mozilla.org</member> - <member>Most other sorts of URL</member> - </simplelist> - </para> - - <para>A corollary here is that if you type a bug number in a comment, - you should put the word "bug" before it, so it gets autolinkified - for the convenience of others. - </para> - </section> - - <section id="commenting"> - <title>Comments</title> - - <para>If you are changing the fields on a bug, only comment if - either you have something pertinent to say, or Bugzilla requires it. - Otherwise, you may spam people unnecessarily with bug mail. - To take an example: a user can set up their account to filter out messages - where someone just adds themselves to the CC field of a bug - (which happens a lot.) If you come along, add yourself to the CC field, - and add a comment saying "Adding self to CC", then that person - gets a pointless piece of mail they would otherwise have avoided. - </para> - - <para> - Don't use sigs in comments. Signing your name ("Bill") is acceptable, - if you do it out of habit, but full mail/news-style - four line ASCII art creations are not. - </para> - </section> - - <section id="comment-wrapping"> - <title>Server-Side Comment Wrapping</title> - <para> - Bugzilla stores comments unwrapped and wraps them at display time. This - ensures proper wrapping in all browsers. Lines beginning with the ">" - character are assumed to be quotes, and are not wrapped. - </para> - </section> - - <section id="dependencytree"> - <title>Dependency Tree</title> - - <para> - On the <quote>Dependency tree</quote> page linked from each bug - page, you can see the dependency relationship from the bug as a - tree structure. - </para> - - <para> - You can change how much depth to show, and you can hide resolved bugs - from this page. You can also collaps/expand dependencies for - each bug on the tree view, using the [-]/[+] buttons that appear - before its summary. This option is not available for terminal - bugs in the tree (that don't have further dependencies). - </para> - </section> - </section> - - <section id="timetracking"> - <title>Time Tracking Information</title> - - <para> - Users who belong to the group specified by the <quote>timetrackinggroup</quote> - parameter have access to time-related fields. Developers can see - deadlines and estimated times to fix bugs, and can provide time spent - on these bugs. - </para> - - <para> - At any time, a summary of the time spent by developers on bugs is - accessible either from bug lists when clicking the <quote>Time Summary</quote> - button or from individual bugs when clicking the <quote>Summarize time</quote> - link in the time tracking table. The <filename>summarize_time.cgi</filename> - page lets you view this information either per developer or per bug, - and can be split on a month basis to have greater details on how time - is spent by developers. - </para> - - <para> - As soon as a bug is marked as RESOLVED, the remaining time expected - to fix the bug is set to zero. This lets QA people set it again for - their own usage, and it will be set to zero again when the bug will - be marked as CLOSED. - </para> - </section> - - <section id="userpreferences"> - <title>User Preferences</title> - - <para> - Once logged in, you can customize various aspects of - Bugzilla via the "Preferences" link in the page footer. - The preferences are split into five tabs:</para> - - <section id="generalpreferences" xreflabel="General Preferences"> - <title>General Preferences</title> - - <para> - This tab allows you to change several default settings of Bugzilla. - </para> - - <itemizedlist spacing="compact"> - <listitem> - <para> - Bugzilla's general appearance (skin) - select which skin to use. - Bugzilla supports adding custom skins. - </para> - </listitem> - <listitem> - <para> - Quote the associated comment when you click on its reply link - sets - the behavior of the comment "Reply" link. Options include quoting the - full comment, just reference the comment number, or turn the link off. - </para> - </listitem> - <listitem> - <para> - Language used in email - select which language email will be sent in, - from the list of available languages. - </para> - </listitem> - <listitem> - <para> - After changing a bug - This controls what page is displayed after - changes to a bug are submitted. The options include to show the bug - just modified, to show the next bug in your list, or to do nothing. - </para> - </listitem> - <listitem> - <para> - Zoom textareas large when in use (requires JavaScript) - enable or - disable the automatic expanding of text areas when text is being - entered into them. - </para> - </listitem> - <listitem> - <para> - Field separator character for CSV files - - Select between a comma and semi-colon for exported CSV bug lists. - </para> - </listitem> - <listitem> - <para> - Automatically add me to the CC list of bugs I change - set default - behavior of CC list. Options include "Always", "Never", and "Only - if I have no role on them". - </para> - </listitem> - <listitem> - <para> - When viewing a bug, show comments in this order - - controls the order of comments. Options include "Oldest - to Newest", "Newest to Oldest" and "Newest to Oldest, but keep the - bug description at the top". - </para> - </listitem> - <listitem> - <para> - Show a quip at the top of each bug list - controls - whether a quip will be shown on the Bug list page. - </para> - </listitem> - </itemizedlist> - </section> - - <section id="emailpreferences"> - <title>Email Preferences</title> - - <para> - This tab allows you to enable or disable email notification on - specific events. - </para> - - <para> - In general, users have almost complete control over how much (or - how little) email Bugzilla sends them. If you want to receive the - maximum amount of email possible, click the <quote>Enable All - Mail</quote> button. If you don't want to receive any email from - Bugzilla at all, click the <quote>Disable All Mail</quote> button. - </para> - - <note> - <para> - A Bugzilla administrator can stop a user from receiving - bugmail by clicking the <quote>Bugmail Disabled</quote> checkbox - when editing the user account. This is a drastic step - best taken only for disabled accounts, as it overrides - the user's individual mail preferences. - </para> - </note> - - <para> - There are two global options -- <quote>Email me when someone - asks me to set a flag</quote> and <quote>Email me when someone - sets a flag I asked for</quote>. These define how you want to - receive bugmail with regards to flags. Their use is quite - straightforward; enable the checkboxes if you want Bugzilla to - send you mail under either of the above conditions. - </para> - - <para> - If you'd like to set your bugmail to something besides - 'Completely ON' and 'Completely OFF', the - <quote>Field/recipient specific options</quote> table - allows you to do just that. The rows of the table - define events that can happen to a bug -- things like - attachments being added, new comments being made, the - priority changing, etc. The columns in the table define - your relationship with the bug: - </para> - - <itemizedlist spacing="compact"> - <listitem> - <para> - Reporter - Where you are the person who initially - reported the bug. Your name/account appears in the - <quote>Reporter:</quote> field. - </para> - </listitem> - <listitem> - <para> - Assignee - Where you are the person who has been - designated as the one responsible for the bug. Your - name/account appears in the <quote>Assigned To:</quote> - field of the bug. - </para> - </listitem> - <listitem> - <para> - QA Contact - You are one of the designated - QA Contacts for the bug. Your account appears in the - <quote>QA Contact:</quote> text-box of the bug. - </para> - </listitem> - <listitem> - <para> - CC - You are on the list CC List for the bug. - Your account appears in the <quote>CC:</quote> text box - of the bug. - </para> - </listitem> - <listitem> - <para> - Voter - You have placed one or more votes for the bug. - Your account appears only if someone clicks on the - <quote>Show votes for this bug</quote> link on the bug. - </para> - </listitem> - </itemizedlist> - - <note> - <para> - Some columns may not be visible for your installation, depending - on your site's configuration. - </para> - </note> - - <para> - To fine-tune your bugmail, decide the events for which you want - to receive bugmail; then decide if you want to receive it all - the time (enable the checkbox for every column), or only when - you have a certain relationship with a bug (enable the checkbox - only for those columns). For example: if you didn't want to - receive mail when someone added themselves to the CC list, you - could uncheck all the boxes in the <quote>CC Field Changes</quote> - line. As another example, if you never wanted to receive email - on bugs you reported unless the bug was resolved, you would - un-check all boxes in the <quote>Reporter</quote> column - except for the one on the <quote>The bug is resolved or - verified</quote> row. - </para> - - <note> - <para> - Bugzilla adds the <quote>X-Bugzilla-Reason</quote> header to - all bugmail it sends, describing the recipient's relationship - (AssignedTo, Reporter, QAContact, CC, or Voter) to the bug. - This header can be used to do further client-side filtering. - </para> - </note> - - <para> - Bugzilla has a feature called <quote>Users Watching</quote>. - When you enter one or more comma-delineated user accounts (usually email - addresses) into the text entry box, you will receive a copy of all the - bugmail those users are sent (security settings permitting). - This powerful functionality enables seamless transitions as developers - change projects or users go on holiday. - </para> - - <note> - <para> - The ability to watch other users may not be available in all - Bugzilla installations. If you don't see this feature, and feel - that you need it, speak to your administrator. - </para> - </note> - - <para> - Each user listed in the <quote>Users watching you</quote> field - has you listed in their <quote>Users to watch</quote> list - and can get bugmail according to your relationship to the bug and - their <quote>Field/recipient specific options</quote> setting. - </para> - - </section> - - <section id="savedsearches" xreflabel="Saved Searches"> - <title>Saved Searches</title> - <para> - On this tab you can view and run any Saved Searches that you have - created, and also any Saved Searches that other members of the group - defined in the "querysharegroup" parameter have shared. - Saved Searches can be added to the page footer from this screen. - If somebody is sharing a Search with a group she or he is allowed to - <link linkend="groups">assign users to</link>, the sharer may opt to have - the Search show up in the footer of the group's direct members by default. - </para> - </section> - - <section id="accountpreferences" xreflabel="Name and Password"> - <title>Name and Password</title> - - <para>On this tab, you can change your basic account information, - including your password, email address and real name. For security - reasons, in order to change anything on this page you must type your - <emphasis>current</emphasis> password into the <quote>Password</quote> - field at the top of the page. - If you attempt to change your email address, a confirmation - email is sent to both the old and new addresses, with a link to use to - confirm the change. This helps to prevent account hijacking.</para> - </section> - - <section id="permissionsettings"> - <title>Permissions</title> - - <para> - This is a purely informative page which outlines your current - permissions on this installation of Bugzilla. - </para> - - <para> - A complete list of permissions is below. Only users with - <emphasis>editusers</emphasis> privileges can change the permissions - of other users. - </para> - - <variablelist> - <varlistentry> - <term> - admin - </term> - <listitem> - <para> - Indicates user is an Administrator. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - bz_canusewhineatothers - </term> - <listitem> - <para> - Indicates user can configure whine reports for other users. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - bz_canusewhines - </term> - <listitem> - <para> - Indicates user can configure whine reports for self. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - bz_quip_moderators - </term> - <listitem> - <para> - Indicates user can moderate quips. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - bz_sudoers - </term> - <listitem> - <para> - Indicates user can perform actions as other users. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - bz_sudo_protect - </term> - <listitem> - <para> - Indicates user cannot be impersonated by other users. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - canconfirm - </term> - <listitem> - <para> - Indicates user can confirm a bug or mark it a duplicate. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - creategroups - </term> - <listitem> - <para> - Indicates user can create and destroy groups. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - editbugs - </term> - <listitem> - <para> - Indicates user can edit all bug fields. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - editclassifications - </term> - <listitem> - <para> - Indicates user can create, destroy, and edit classifications. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - editcomponents - </term> - <listitem> - <para> - Indicates user can create, destroy, and edit components. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - editkeywords - </term> - <listitem> - <para> - Indicates user can create, destroy, and edit keywords. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - editusers - </term> - <listitem> - <para> - Indicates user can edit or disable users. - </para> - </listitem> - </varlistentry> - - <varlistentry> - <term> - tweakparams - </term> - <listitem> - <para> - Indicates user can change Parameters. - </para> - </listitem> - </varlistentry> - - </variablelist> - - <note> - <para> - For more information on how permissions work in Bugzilla (i.e. who can - change what), see <xref linkend="cust-change-permissions"/>. - </para> - </note> - - </section> - </section> - - - <section id="reporting"> - <title>Reports and Charts</title> - - <para>As well as the standard buglist, Bugzilla has two more ways of - viewing sets of bugs. These are the reports (which give different - views of the current state of the database) and charts (which plot - the changes in particular sets of bugs over time.)</para> - - <section id="reports"> - <title>Reports</title> - - <para> - A report is a view of the current state of the bug database. - </para> - - <para> - You can run either an HTML-table-based report, or a graphical - line/pie/bar-chart-based one. The two have different pages to - define them, but are close cousins - once you've defined and - viewed a report, you can switch between any of the different - views of the data at will. - </para> - - <para> - Both report types are based on the idea of defining a set of bugs - using the standard search interface, and then choosing some - aspect of that set to plot on the horizontal and/or vertical axes. - You can also get a form of 3-dimensional report by choosing to have - multiple images or tables. - </para> - - <para> - So, for example, you could use the search form to choose "all - bugs in the WorldControl product", and then plot their severity - against their component to see which component had had the largest - number of bad bugs reported against it. - </para> - - <para> - Once you've defined your parameters and hit "Generate Report", - you can switch between HTML, CSV, Bar, Line and Pie. (Note: Pie - is only available if you didn't define a vertical axis, as pie - charts don't have one.) The other controls are fairly self-explanatory; - you can change the size of the image if you find text is overwriting - other text, or the bars are too thin to see. - </para> - - </section> - - <section id="charts"> - <title>Charts</title> - - <para> - A chart is a view of the state of the bug database over time. - </para> - - <para> - Bugzilla currently has two charting systems - Old Charts and New - Charts. Old Charts have been part of Bugzilla for a long time; they - chart each status and resolution for each product, and that's all. - They are deprecated, and going away soon - we won't say any more - about them. - New Charts are the future - they allow you to chart anything you - can define as a search. - </para> - - <note> - <para> - Both charting forms require the administrator to set up the - data-gathering script. If you can't see any charts, ask them whether - they have done so. - </para> - </note> - - <para> - An individual line on a chart is called a data set. - All data sets are organised into categories and subcategories. The - data sets that Bugzilla defines automatically use the Product name - as a Category and Component names as Subcategories, but there is no - need for you to follow that naming scheme with your own charts if - you don't want to. - </para> - - <para> - Data sets may be public or private. Everyone sees public data sets in - the list, but only their creator sees private data sets. Only - administrators can make data sets public. - No two data sets, even two private ones, can have the same set of - category, subcategory and name. So if you are creating private data - sets, one idea is to have the Category be your username. - </para> - - <section> - <title>Creating Charts</title> - - <para> - You create a chart by selecting a number of data sets from the - list, and pressing Add To List for each. In the List Of Data Sets - To Plot, you can define the label that data set will have in the - chart's legend, and also ask Bugzilla to Sum a number of data sets - (e.g. you could Sum data sets representing RESOLVED, VERIFIED and - CLOSED in a particular product to get a data set representing all - the resolved bugs in that product.) - </para> - - <para> - If you've erroneously added a data set to the list, select it - using the checkbox and click Remove. Once you add more than one - data set, a "Grand Total" line - automatically appears at the bottom of the list. If you don't want - this, simply remove it as you would remove any other line. - </para> - - <para> - You may also choose to plot only over a certain date range, and - to cumulate the results - that is, to plot each one using the - previous one as a baseline, so the top line gives a sum of all - the data sets. It's easier to try than to explain :-) - </para> - - <para> - Once a data set is in the list, one can also perform certain - actions on it. For example, one can edit the - data set's parameters (name, frequency etc.) if it's one you - created or if you are an administrator. - </para> - - <para> - Once you are happy, click Chart This List to see the chart. - </para> - - </section> - - <section id="charts-new-series"> - <title>Creating New Data Sets</title> - - <para> - You may also create new data sets of your own. To do this, - click the "create a new data set" link on the Create Chart page. - This takes you to a search-like interface where you can define - the search that Bugzilla will plot. At the bottom of the page, - you choose the category, sub-category and name of your new - data set. - </para> - - <para> - If you have sufficient permissions, you can make the data set public, - and reduce the frequency of data collection to less than the default - seven days. - </para> - </section> - - </section> - - </section> - - <section id="flags"> - <title>Flags</title> - - <para> - A flag is a kind of status that can be set on bugs or attachments - to indicate that the bugs/attachments are in a certain state. - Each installation can define its own set of flags that can be set - on bugs or attachments. - </para> - - <para> - If your installation has defined a flag, you can set or unset that flag, - and if your administrator has enabled requesting of flags, you can submit - a request for another user to set the flag. - </para> - - <para> - To set a flag, select either "+" or "-" from the drop-down menu next to - the name of the flag in the "Flags" list. The meaning of these values are - flag-specific and thus cannot be described in this documentation, - but by way of example, setting a flag named "review" to "+" may indicate - that the bug/attachment has passed review, while setting it to "-" - may indicate that the bug/attachment has failed review. - </para> - - <para> - To unset a flag, click its drop-down menu and select the blank value. - Note that marking an attachment as obsolete automatically cancels all - pending requests for the attachment. - </para> - - <para> - If your administrator has enabled requests for a flag, request a flag - by selecting "?" from the drop-down menu and then entering the username - of the user you want to set the flag in the text field next to the menu. - </para> - - <para> - A set flag appears in bug reports and on "edit attachment" pages with the - abbreviated username of the user who set the flag prepended to the - flag name. For example, if Jack sets a "review" flag to "+", it appears - as Jack: review [ + ] - </para> - - <para> - A requested flag appears with the user who requested the flag prepended - to the flag name and the user who has been requested to set the flag - appended to the flag name within parentheses. For example, if Jack - asks Jill for review, it appears as Jack: review [ ? ] (Jill). - </para> - - <para> - You can browse through open requests made of you and by you by selecting - 'My Requests' from the footer. You can also look at open requests limited - by other requesters, requestees, products, components, and flag names from - this page. Note that you can use '-' for requestee to specify flags with - 'no requestee' set. - </para> - </section> - - <section id="whining"> - <title>Whining</title> - - <para> - Whining is a feature in Bugzilla that can regularly annoy users at - specified times. Using this feature, users can execute saved searches - at specific times (i.e. the 15th of the month at midnight) or at - regular intervals (i.e. every 15 minutes on Sundays). The results of the - searches are sent to the user, either as a single email or as one email - per bug, along with some descriptive text. - </para> - - <warning> - <para> - Throughout this section it will be assumed that all users are members - of the bz_canusewhines group, membership in which is required in order - to use the Whining system. You can easily make all users members of - the bz_canusewhines group by setting the User RegExp to ".*" (without - the quotes). - </para> - - <para> - Also worth noting is the bz_canusewhineatothers group. Members of this - group can create whines for any user or group in Bugzilla using a - extended form of the whining interface. Features only available to - members of the bz_canusewhineatothers group will be noted in the - appropriate places. - </para> - </warning> - - <note> - <para> - For whining to work, a special Perl script must be executed at regular - intervals. More information on this is available in - <xref linkend="installation-whining"/>. - </para> - </note> - - <note> - <para> - This section does not cover the whineatnews.pl script. See - <xref linkend="installation-whining-cron"/> for more information on - The Whining Cron. - </para> - </note> - - <section id="whining-overview"> - <title>The Event</title> - - <para> - The whining system defines an "Event" as one or more queries being - executed at regular intervals, with the results of said queries (if - there are any) being emailed to the user. Events are created by - clicking on the "Add new event" button. - </para> - - <para> - Once a new event is created, the first thing to set is the "Email - subject line". The contents of this field will be used in the subject - line of every email generated by this event. In addition to setting a - subject, space is provided to enter some descriptive text that will be - included at the top of each message (to help you in understanding why - you received the email in the first place). - </para> - - <para> - The next step is to specify when the Event is to be run (the Schedule) - and what searches are to be performed (the Searches). - </para> - - </section> - - <section id="whining-schedule"> - <title>Whining Schedule</title> - - <para> - Each whining event is associated with zero or more schedules. A - schedule is used to specify when the query (specified below) is to be - run. A new event starts out with no schedules (which means it will - never run, as it is not scheduled to run). To add a schedule, press - the "Add a new schedule" button. - </para> - - <para> - Each schedule includes an interval, which you use to tell Bugzilla - when the event should be run. An event can be run on certain days of - the week, certain days of the month, during weekdays (defined as - Monday through Friday), or every day. - </para> - - <warning> - <para> - Be careful if you set your event to run on the 29th, 30th, or 31st of - the month, as your event may not run exactly when expected. If you - want your event to run on the last day of the month, select "Last day - of the month" as the interval. - </para> - </warning> - - <para> - Once you have specified the day(s) on which the event is to be run, you - should now specify the time at which the event is to be run. You can - have the event run at a certain hour on the specified day(s), or - every hour, half-hour, or quarter-hour on the specified day(s). - </para> - - <para> - If a single schedule does not execute an event as many times as you - would want, you can create another schedule for the same event. For - example, if you want to run an event on days whose numbers are - divisible by seven, you would need to add four schedules to the event, - setting the schedules to run on the 7th, 14th, 21st, and 28th (one day - per schedule) at whatever time (or times) you choose. - </para> - - <note> - <para> - If you are a member of the bz_canusewhineatothers group, then you - will be presented with another option: "Mail to". Using this you - can control who will receive the emails generated by this event. You - can choose to send the emails to a single user (identified by email - address) or a single group (identified by group name). To send to - multiple users or groups, create a new schedule for each additional - user/group. - </para> - </note> - </section> - - <section id="whining-query"> - <title>Whining Searches</title> - - <para> - Each whining event is associated with zero or more searches. A search - is any saved search to be run as part of the specified schedule (see - above). You start out without any searches associated with the event - (which means that the event will not run, as there will never be any - results to return). To add a search, press the "Include search" button. - </para> - - <para> - The first field to examine in your newly added search is the Sort field. - Searches are run, and results included, in the order specified by the - Sort field. Searches with smaller Sort values will run before searches - with bigger Sort values. - </para> - - <para> - The next field to examine is the Search field. This is where you - choose the actual search that is to be run. Instead of defining search - parameters here, you are asked to choose from the list of saved - searches (the same list that appears at the bottom of every Bugzilla - page). You are only allowed to choose from searches that you have - saved yourself (the default saved search, "My Bugs", is not a valid - choice). If you do not have any saved searches, you can take this - opportunity to create one (see <xref linkend="list"/>). - </para> - - <note> - <para> - When running queries, the whining system acts as if you are the user - executing the query. This means that the whining system will ignore - bugs that match your query, but that you cannot access. - </para> - </note> - - <para> - Once you have chosen the saved search to be executed, give the query a - descriptive title. This title will appear in the email, above the - results of the query. If you choose "One message per bug", the query - title will appear at the top of each email that contains a bug matching - your query. - </para> - - <para> - Finally, decide if the results of the query should be sent in a single - email, or if each bug should appear in its own email. - </para> - - <warning> - <para> - Think carefully before checking the "One message per bug" box. If - you create a query that matches thousands of bugs, you will receive - thousands of emails! - </para> - </warning> - </section> - - <section> - <title>Saving Your Changes</title> - - <para> - Once you have defined at least one schedule, and created at least one - query, go ahead and "Update/Commit". This will save your Event and make - it available for immediate execution. - </para> - - <note> - <para> - If you ever feel like deleting your event, you may do so using the - "Remove Event" button in the upper-right corner of each Event. You - can also modify an existing event, so long as you "Update/Commit" - after completing your modifications. - </para> - </note> - </section> - - </section> - -</chapter> - -<!-- Keep this comment at the end of the file -Local variables: -mode: sgml -sgml-always-quote-attributes:t -sgml-auto-insert-required-elements:t -sgml-balanced-tag-edit:t -sgml-exposed-tags:nil -sgml-general-insert-case:lower -sgml-indent-data:t -sgml-indent-step:2 -sgml-local-catalogs:nil -sgml-local-ecat-files:nil -sgml-minimize-attributes:nil -sgml-namecase-general:t -sgml-omittag:t -sgml-parent-document:("Bugzilla-Guide.xml" "book" "chapter") -sgml-shorttag:t -sgml-tag-region-if-active:t -End: ---> diff --git a/docs/lib/Pod/Simple/HTML/Bugzilla.pm b/docs/lib/Pod/Simple/HTML/Bugzilla.pm index cc607be7c..ffbd0775c 100644 --- a/docs/lib/Pod/Simple/HTML/Bugzilla.pm +++ b/docs/lib/Pod/Simple/HTML/Bugzilla.pm @@ -7,8 +7,11 @@ package Pod::Simple::HTML::Bugzilla; +use 5.10.1; use strict; -use base qw(Pod::Simple::HTML); +use warnings; + +use parent qw(Pod::Simple::HTML); # Without this constant, HTMLBatch will throw undef warnings. use constant VERSION => $Pod::Simple::HTML::VERSION; diff --git a/docs/lib/Pod/Simple/HTMLBatch/Bugzilla.pm b/docs/lib/Pod/Simple/HTMLBatch/Bugzilla.pm index 366ceb7a0..cb61082df 100644 --- a/docs/lib/Pod/Simple/HTMLBatch/Bugzilla.pm +++ b/docs/lib/Pod/Simple/HTMLBatch/Bugzilla.pm @@ -7,8 +7,11 @@ package Pod::Simple::HTMLBatch::Bugzilla; +use 5.10.1; use strict; -use base qw(Pod::Simple::HTMLBatch); +use warnings; + +use parent qw(Pod::Simple::HTMLBatch); # This is the same hack that HTMLBatch does to "import" this subroutine. BEGIN { *esc = \&Pod::Simple::HTML::esc } diff --git a/docs/makedocs.pl b/docs/makedocs.pl index 4bf1fb4a0..6f353dc6d 100755 --- a/docs/makedocs.pl +++ b/docs/makedocs.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl # 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/. @@ -7,96 +7,59 @@ # defined by the Mozilla Public License, v. 2.0. # This script compiles all the documentation. +# +# Required software: +# +# 1) Sphinx documentation builder (python-sphinx package on Debian/Ubuntu) +# +# 2a) rst2pdf +# or +# 2b) pdflatex, which means the following Debian/Ubuntu packages: +# * texlive-latex-base +# * texlive-latex-recommended +# * texlive-latex-extra +# * texlive-fonts-recommended +# +# All these TeX packages together are close to a gig :-| But after you've +# installed them, you can remove texlive-latex-extra-doc to save 400MB. +use 5.10.1; use strict; -use Cwd; +use warnings; -# We need to be in this directory to use our libraries. -BEGIN { - require File::Basename; - import File::Basename qw(dirname); - chdir dirname($0); -} +use File::Basename; +BEGIN { chdir dirname($0); } use lib qw(.. ../lib lib); -# We only compile our POD if Pod::Simple is installed. We do the checks -# this way so that if there's a compile error in Pod::Simple::HTML::Bugzilla, -# makedocs doesn't just silently fail, but instead actually tells us there's -# a compile error. -my $pod_simple; -if (eval { require Pod::Simple }) { - require Pod::Simple::HTMLBatch::Bugzilla; - require Pod::Simple::HTML::Bugzilla; - $pod_simple = 1; -}; - -use Bugzilla::Install::Requirements - qw(REQUIRED_MODULES OPTIONAL_MODULES); -use Bugzilla::Constants qw(DB_MODULE BUGZILLA_VERSION); - -############################################################################### -# Generate minimum version list -############################################################################### - -my $modules = REQUIRED_MODULES; -my $opt_modules = OPTIONAL_MODULES; - -my $template; -{ - open(TEMPLATE, '<', 'bugzilla.ent.tmpl') - or die('Could not open bugzilla.ent.tmpl: ' . $!); - local $/; - $template = <TEMPLATE>; - close TEMPLATE; -} -open(ENTITIES, '>', 'bugzilla.ent') or die('Could not open bugzilla.ent: ' . $!); -print ENTITIES "$template\n"; -print ENTITIES '<!-- Module Versions -->' . "\n"; -foreach my $module (@$modules, @$opt_modules) -{ - my $name = $module->{'module'}; - $name =~ s/::/-/g; - $name = lc($name); - #This needs to be a string comparison, due to the modules having - #version numbers like 0.9.4 - my $version = $module->{'version'} eq 0 ? 'any' : $module->{'version'}; - print ENTITIES '<!ENTITY min-' . $name . '-ver "'.$version.'">' . "\n"; -} +use Cwd; +use File::Copy::Recursive qw(rcopy); +use File::Find; +use File::Path qw(rmtree); +use File::Which qw(which); +use Pod::Simple; -print ENTITIES "\n <!-- Database Versions --> \n"; - -my $db_modules = DB_MODULE; -foreach my $db (keys %$db_modules) { - my $dbd = $db_modules->{$db}->{dbd}; - my $name = $dbd->{module}; - $name =~ s/::/-/g; - $name = lc($name); - my $version = $dbd->{version} || 'any'; - my $db_version = $db_modules->{$db}->{'db_version'}; - print ENTITIES '<!ENTITY min-' . $name . '-ver "'.$version.'">' . "\n"; - print ENTITIES '<!ENTITY min-' . lc($db) . '-ver "'.$db_version.'">' . "\n"; -} -close(ENTITIES); +use Bugzilla::Constants qw(BUGZILLA_VERSION bz_locations); +use Pod::Simple::HTMLBatch::Bugzilla; +use Pod::Simple::HTML::Bugzilla; ############################################################################### # Subs ############################################################################### +my $error_found = 0; sub MakeDocs { - my ($name, $cmdline) = @_; - print "Creating $name documentation ...\n" if defined $name; - print "$cmdline\n\n"; - system $cmdline; + say "Creating $name documentation ..." if defined $name; + say "make $cmdline\n"; + system('make', $cmdline) == 0 + or $error_found = 1; print "\n"; - } sub make_pod { - - print "Creating API documentation...\n"; + say "Creating API documentation..."; my $converter = Pod::Simple::HTMLBatch::Bugzilla->new; # Don't output progress information. @@ -123,6 +86,8 @@ END_HTML $converter->add_css('./../../../style.css'); $converter->javascript_flurry(0); $converter->css_flurry(0); + mkdir("html"); + mkdir("html/api"); $converter->batch_convert(['../../'], 'html/api/'); print "\n"; @@ -133,11 +98,11 @@ END_HTML ############################################################################### my @langs; -# search for sub directories which have a 'xml' sub-directory +# search for sub directories which have a 'rst' sub-directory opendir(LANGS, './'); foreach my $dir (readdir(LANGS)) { next if (($dir eq '.') || ($dir eq '..') || (! -d $dir)); - if (-d "$dir/xml") { + if (-d "$dir/rst") { push(@langs, $dir); } } @@ -146,34 +111,54 @@ closedir(LANGS); my $docparent = getcwd(); foreach my $lang (@langs) { chdir "$docparent/$lang"; - MakeDocs(undef, 'cp ../bugzilla.ent ./xml/'); - if (!-d 'txt') { - unlink 'txt'; - mkdir 'txt', 0755; - } - if (!-d 'pdf') { - unlink 'pdf'; - mkdir 'pdf', 0755; - } - if (!-d 'html') { - unlink 'html'; - mkdir 'html', 0755; - } - if (!-d 'html/api') { - unlink 'html/api'; - mkdir 'html/api', 0755; + make_pod(); + + next if grep { $_ eq '--pod-only' } @ARGV; + + chdir $docparent; + + # Generate extension documentation, both normal and API + my $ext_dir = bz_locations()->{'extensionsdir'}; + my @ext_paths = grep { $_ !~ /\/create\.pl$/ && ! -e "$_/disabled" } + glob("$ext_dir/*"); + my %extensions; + foreach my $item (@ext_paths) { + my $basename = basename($item); + if (-d "$item/docs/$lang/rst") { + $extensions{$basename} = "$item/docs/$lang/rst"; + } } - make_pod() if $pod_simple; + # Collect up local extension documentation into the extensions/ dir. + rmtree("$lang/rst/extensions", 0, 1); - MakeDocs('separate HTML', 'xmlto -m ../xsl/chunks.xsl -o html html xml/Bugzilla-Guide.xml'); - MakeDocs('big HTML', 'xmlto -m ../xsl/nochunks.xsl -o html html-nochunks xml/Bugzilla-Guide.xml'); - MakeDocs('big text', 'lynx -dump -justify=off -nolist html/Bugzilla-Guide.html > txt/Bugzilla-Guide.txt'); + foreach my $ext_name (keys %extensions) { + my $src = $extensions{$ext_name} . "/*"; + my $dst = "$docparent/$lang/rst/extensions/$ext_name"; + mkdir($dst) unless -d $dst; + rcopy($src, $dst); + } - if (! grep($_ eq "--with-pdf", @ARGV)) { - next; + chdir "$docparent/$lang"; + + MakeDocs('HTML', 'html'); + MakeDocs('TXT', 'text'); + + if (grep { $_ eq '--with-pdf' } @ARGV) { + if (which('pdflatex')) { + MakeDocs('PDF', 'latexpdf'); + } + elsif (which('rst2pdf')) { + rmtree('pdf', 0, 1); + MakeDocs('PDF', 'pdf'); + } + else { + say 'pdflatex or rst2pdf not found. Skipping PDF file creation'; + } } - MakeDocs('PDF', 'dblatex -p ../xsl/pdf.xsl -o pdf/Bugzilla-Guide.pdf xml/Bugzilla-Guide.xml'); + rmtree('doctrees', 0, 1); } + +die "Error occurred building the documentation\n" if $error_found; diff --git a/docs/style.css b/docs/style.css index 8604b5b67..fa85b6c41 100644 --- a/docs/style.css +++ b/docs/style.css @@ -6,6 +6,8 @@ * defined by the Mozilla Public License, v. 2.0. */ +/* This style file is used by the API documentation */ + body { background: white; color: #111; @@ -92,4 +94,4 @@ pre.code, pre.programlisting, pre.screen { background-color: #eee; } -.pod_desc_table +.pod_desc_table diff --git a/docs/xsl/bugzilla-docs.xsl b/docs/xsl/bugzilla-docs.xsl deleted file mode 100644 index f791087e6..000000000 --- a/docs/xsl/bugzilla-docs.xsl +++ /dev/null @@ -1,36 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- 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. ---> -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> - <!-- Nicer Filenames --> - <xsl:param name="use.id.as.filename" select="1"/> - - <!-- Label sections if they aren't automatically labeled --> - <xsl:param name="section.autolabel" select="1"/> - <xsl:param name="section.label.includes.component.label" select="1"/> - - <!-- Table of Contents Depth --> - <xsl:param name="toc.section.depth">2</xsl:param> - <xsl:param name="generate.section.toc.level" select="0"/> - - <!-- Show titles of next/previous page --> - <xsl:param name="navig.showtitles">1</xsl:param> - - <!-- Tidy up the HTML a bit... --> - <xsl:param name="html.cleanup" select="1"/> - <xsl:param name="make.valid.html" select="1"/> - <xsl:param name="html.stylesheet">../../style.css</xsl:param> - <xsl:param name="highlight.source" select="1"/> - - <!-- Use Graphics, specify their Path and Extension --> - <xsl:param name="admon.graphics" select="1"/> - <xsl:param name="admon.graphics.path">../images/</xsl:param> - <xsl:param name="admon.graphics.extension">.gif</xsl:param> - <xsl:param name="admon.textlabel" select="0"/> - <xsl:param name="admon.style">margin-left: 1em; margin-right: 1em</xsl:param> -</xsl:stylesheet> diff --git a/docs/xsl/chunks.xsl b/docs/xsl/chunks.xsl deleted file mode 100644 index 1389dd5e0..000000000 --- a/docs/xsl/chunks.xsl +++ /dev/null @@ -1,19 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- 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. ---> -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> - <!-- Include default bugzilla XSL --> - <xsl:include href="bugzilla-docs.xsl"/> - <!-- Set Chunk Specific XSL Params --> - <xsl:param name="chunker.output.doctype-public">-//W3C//DTD HTML 4.01 Transitional//EN</xsl:param> - <xsl:param name="chunker.output.doctype-system">http://www.w3.org/TR/html4/loose.dtd</xsl:param> - <xsl:param name="chunk.section.depth" select="1"/> - <xsl:param name="chunk.first.sections" select="1"/> - <xsl:param name="chunker.output.encoding" select="UTF-8"/> - <xsl:param name="chunk.quietly" select="1"/> -</xsl:stylesheet> diff --git a/docs/xsl/nochunks.xsl b/docs/xsl/nochunks.xsl deleted file mode 100644 index 2b10a0d85..000000000 --- a/docs/xsl/nochunks.xsl +++ /dev/null @@ -1,16 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- 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. ---> -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> - <xsl:output method="html" encoding="UTF-8" indent="no" - doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" - doctype-system="http://www.w3.org/TR/html4/loose.dtd"/> - <!-- Include default bugzilla XSL --> - <xsl:include href="bugzilla-docs.xsl"/> - <!-- No other params necessary --> -</xsl:stylesheet> diff --git a/docs/xsl/pdf.xsl b/docs/xsl/pdf.xsl deleted file mode 100644 index d1febf748..000000000 --- a/docs/xsl/pdf.xsl +++ /dev/null @@ -1,42 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- 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. ---> -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - xmlns:fo="http://www.w3.org/1999/XSL/Format" - version="1.0"> - <!-- Some layout parameters --> - <xsl:param name="generate.index" select="0"/> - <xsl:param name="doc.collab.show" select="0"/> - <xsl:param name="latex.output.revhistory" select="0"/> - <xsl:param name="doc.lot.show"></xsl:param> - <xsl:param name="latex.encoding">utf8</xsl:param> - <xsl:param name="imagedata.default.scale">pagebound</xsl:param> - <xsl:param name="latex.hyperparam">colorlinks,linkcolor=blue,urlcolor=blue</xsl:param> - - <!-- Show <ulink>s as footnotes --> - <xsl:param name="ulink.footnotes" select="1"/> - <xsl:param name="ulink.show" select="1"/> - - <!-- Don't use Graphics --> - <xsl:param name="admon.graphics" select="0"/> - <xsl:param name="callout.graphics" select="0"/> - - <!-- Make pdflatex shut up about <prompt> and <command> within <programlisting>, --> - <!-- see http://dblatex.sourceforge.net/doc/manual/sec-verbatim.html --> - <xsl:template match="prompt|command" mode="latex.programlisting"> - <xsl:param name="co-tagin" select="'<:'"/> - <xsl:param name="rnode" select="/"/> - <xsl:param name="probe" select="0"/> - - <xsl:call-template name="verbatim.boldseq"> - <xsl:with-param name="co-tagin" select="$co-tagin"/> - <xsl:with-param name="rnode" select="$rnode"/> - <xsl:with-param name="probe" select="$probe"/> - </xsl:call-template> - </xsl:template> -</xsl:stylesheet> diff --git a/duplicates.cgi b/duplicates.cgi index cfb55b12c..88159539d 100755 --- a/duplicates.cgi +++ b/duplicates.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,10 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; + use lib qw(. lib); use Bugzilla; @@ -172,10 +175,9 @@ my %since_dups = @{$dbh->selectcol_arrayref( $reso_field_id, $changedsince)}; add_indirect_dups(\%since_dups, \%dupe_relation); -# Enforce the mostfreqthreshold parameter and the "bug_id" cgi param. -my $mostfreq = Bugzilla->params->{'mostfreqthreshold'}; +# Enforce the MOST_FREQUENT_THRESHOLD constant and the "bug_id" cgi param. foreach my $id (keys %total_dups) { - if ($total_dups{$id} < $mostfreq) { + if ($total_dups{$id} < MOST_FREQUENT_THRESHOLD) { delete $total_dups{$id}; next; } diff --git a/editclassifications.cgi b/editclassifications.cgi index 3a2647af6..ea4b139da 100755 --- a/editclassifications.cgi +++ b/editclassifications.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -7,7 +7,10 @@ # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; + use lib qw(. lib); use Bugzilla; @@ -31,7 +34,7 @@ sub LoadTemplate { if ($action eq 'select'); # There is currently only one section about classifications, # so all pages point to it. Let's define it here. - $vars->{'doc_section'} = 'classifications.html'; + $vars->{'doc_section'} = 'administering/categorization.html#classifications'; $action =~ /(\w+)/; $action = $1; @@ -187,9 +190,10 @@ if ($action eq 'update') { if ($action eq 'reclassify') { my $classification = Bugzilla::Classification->check($class_name); - + my $sth = $dbh->prepare("UPDATE products SET classification_id = ? WHERE name = ?"); + my @names; if (defined $cgi->param('add_products')) { check_token_data($token, 'reclassify_classifications'); @@ -197,6 +201,7 @@ if ($action eq 'reclassify') { foreach my $prod ($cgi->param("prodlist")) { trick_taint($prod); $sth->execute($classification->id, $prod); + push @names, $prod; } } delete_token($token); @@ -205,7 +210,8 @@ if ($action eq 'reclassify') { if (defined $cgi->param('myprodlist')) { foreach my $prod ($cgi->param("myprodlist")) { trick_taint($prod); - $sth->execute(1,$prod); + $sth->execute(1, $prod); + push @names, $prod; } } delete_token($token); @@ -215,6 +221,11 @@ if ($action eq 'reclassify') { $vars->{'classification'} = $classification; $vars->{'token'} = issue_session_token('reclassify_classifications'); + foreach my $name (@names) { + Bugzilla->memcached->clear({ table => 'products', name => $name }); + } + Bugzilla->memcached->clear_config(); + LoadTemplate($action); } diff --git a/editcomponents.cgi b/editcomponents.cgi index 7ff1dae81..aebc0b647 100755 --- a/editcomponents.cgi +++ b/editcomponents.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,10 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; + use lib qw(. lib); use Bugzilla; @@ -22,7 +25,7 @@ my $template = Bugzilla->template; my $vars = {}; # There is only one section about components in the documentation, # so all actions point to the same page. -$vars->{'doc_section'} = 'components.html'; +$vars->{'doc_section'} = 'administering/categorization.html#components'; # # Preliminary checks: diff --git a/editfields.cgi b/editfields.cgi index 5d9e05367..e8351bdd6 100755 --- a/editfields.cgi +++ b/editfields.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,10 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; + use lib qw(. lib); use Bugzilla; diff --git a/editflagtypes.cgi b/editflagtypes.cgi index aa789fc74..d848d250a 100755 --- a/editflagtypes.cgi +++ b/editflagtypes.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,15 +6,12 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -################################################################################ -# Script Initialization -################################################################################ - -# Make it harder for us to do dangerous things in Perl. +use 5.10.1; use strict; +use warnings; + use lib qw(. lib); -# Use Bugzilla's flag modules for handling flag types. use Bugzilla; use Bugzilla::Constants; use Bugzilla::Flag; @@ -73,7 +70,7 @@ if (my ($category_action) = grep { $_ =~ /^categoryAction-(?:\w+)$/ } $cgi->para my @categories; if ($category_action =~ /^(in|ex)clude$/) { if (!$user->in_group('editcomponents') && !$product) { - # The user can only add the flag type to products he can administrate. + # The user can only add the flag type to products they can administrate. foreach my $prod (@products) { push(@categories, $prod->id . ':0') } diff --git a/editgroups.cgi b/editgroups.cgi index e3b9f60d1..287ac1114 100755 --- a/editgroups.cgi +++ b/editgroups.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,10 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; + use lib qw(. lib); use Bugzilla; diff --git a/editkeywords.cgi b/editkeywords.cgi index ab86a2f4f..41496f362 100755 --- a/editkeywords.cgi +++ b/editkeywords.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,10 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; + use lib qw(. lib); use Bugzilla; diff --git a/editmilestones.cgi b/editmilestones.cgi index 93152cd50..8052bd1ab 100755 --- a/editmilestones.cgi +++ b/editmilestones.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,10 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; + use lib qw(. lib); use Bugzilla; @@ -22,7 +25,7 @@ my $template = Bugzilla->template; my $vars = {}; # There is only one section about milestones in the documentation, # so all actions point to the same page. -$vars->{'doc_section'} = 'milestones.html'; +$vars->{'doc_section'} = 'administering/categorization.html#milestones'; # # Preliminary checks: diff --git a/editparams.cgi b/editparams.cgi index b522fd414..ae569c2eb 100755 --- a/editparams.cgi +++ b/editparams.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,10 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; + use lib qw(. lib); use Bugzilla; diff --git a/editproducts.cgi b/editproducts.cgi index b4f164995..62aa1206d 100755 --- a/editproducts.cgi +++ b/editproducts.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,10 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; + use lib qw(. lib); use Bugzilla; @@ -32,7 +35,7 @@ my $template = Bugzilla->template; my $vars = {}; # Remove this as soon as the documentation about products has been # improved and each action has its own section. -$vars->{'doc_section'} = 'products.html'; +$vars->{'doc_section'} = 'administering/categorization.html#products'; print $cgi->header(); diff --git a/editsettings.cgi b/editsettings.cgi index 17740cd5c..b10a497ba 100755 --- a/editsettings.cgi +++ b/editsettings.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,10 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; + use lib qw(. lib); use Bugzilla; @@ -52,6 +55,7 @@ if ($action eq 'update') { } $vars->{'message'} = 'default_settings_updated'; $vars->{'changes_saved'} = $changed; + Bugzilla->memcached->clear_config(); delete_token($token); } diff --git a/editusers.cgi b/editusers.cgi index 9778aa808..a38195a4b 100755 --- a/editusers.cgi +++ b/editusers.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,10 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; + use lib qw(. lib); use Bugzilla; @@ -20,6 +23,7 @@ use Bugzilla::Flag; use Bugzilla::Field; use Bugzilla::Group; use Bugzilla::Token; +use Bugzilla::Mailer; my $user = Bugzilla->login(LOGIN_REQUIRED); @@ -66,7 +70,7 @@ if ($action eq 'search') { my $matchstr = trim($cgi->param('matchstr')); my $matchtype = $cgi->param('matchtype'); my $grouprestrict = $cgi->param('grouprestrict') || '0'; - my $enabled_only = $cgi->param('enabled_only') || '0'; + my $is_enabled = scalar $cgi->param('is_enabled'); my $query = 'SELECT DISTINCT userid, login_name, realname, is_enabled, ' . $dbh->sql_date_format('last_seen_date', '%Y-%m-%d') . ' AS last_seen_date ' . 'FROM profiles'; @@ -158,11 +162,12 @@ if ($action eq 'search') { $query .= " $nextCondition ugm.group_id IN($grouplist) "; } - if ($enabled_only eq '1') { - $query .= " $nextCondition profiles.is_enabled = 1 "; + detaint_natural($is_enabled); + if ($is_enabled == 0 || $is_enabled == 1) { + $query .= " $nextCondition profiles.is_enabled = ?"; $nextCondition = 'AND'; + push(@bindValues, $is_enabled); } - $query .= ' ORDER BY profiles.login_name'; $vars->{'users'} = $dbh->selectall_arrayref($query, @@ -217,6 +222,15 @@ if ($action eq 'search') { delete_token($token); + if ($cgi->param('notify_user')) { + $vars->{'new_user'} = $new_user; + my $message; + + $template->process('email/new-user-details.txt.tmpl', $vars, \$message) + || ThrowTemplateError($template->error()); + MessageToMTA($message); + } + # We already display the updated page. We have to recreate a token now. $vars->{'token'} = issue_session_token('edit_user'); $vars->{'message'} = 'account_created'; @@ -236,7 +250,7 @@ if ($action eq 'search') { # Lock tables during the check+update session. $dbh->bz_start_transaction(); - + $editusers || $user->can_see_user($otherUser) || ThrowUserError('auth_failure', {reason => "not_visible", action => "modify", @@ -244,6 +258,10 @@ if ($action eq 'search') { $vars->{'loginold'} = $otherUser->login; + # Update groups + my @group_ids = grep { s/group_// } keys %{ Bugzilla->cgi->Vars }; + $otherUser->set_groups({ set => \@group_ids }); + # Update profiles table entry; silently skip doing this if the user # is not authorized. my $changes = {}; @@ -256,86 +274,12 @@ if ($action eq 'search') { $otherUser->set_disable_mail($cgi->param('disable_mail')); $otherUser->set_extern_id($cgi->param('extern_id')) if defined($cgi->param('extern_id')); - $changes = $otherUser->update(); - } - - # Update group settings. - my $sth_add_mapping = $dbh->prepare( - qq{INSERT INTO user_group_map ( - user_id, group_id, isbless, grant_type - ) VALUES ( - ?, ?, ?, ? - ) - }); - my $sth_remove_mapping = $dbh->prepare( - qq{DELETE FROM user_group_map - WHERE user_id = ? - AND group_id = ? - AND isbless = ? - AND grant_type = ? - }); - - my @groupsAddedTo; - my @groupsRemovedFrom; - my @groupsGrantedRightsToBless; - my @groupsDeniedRightsToBless; - - # Regard only groups the user is allowed to bless and skip all others - # silently. - # XXX: checking for existence of each user_group_map entry - # would allow to display a friendlier error message on page reloads. - userDataToVars($otherUserID); - my $permissions = $vars->{'permissions'}; - foreach my $blessable (@{$user->bless_groups()}) { - my $id = $blessable->id; - my $name = $blessable->name; - - # Change memberships. - my $groupid = $cgi->param("group_$id") || 0; - if ($groupid != $permissions->{$id}->{'directmember'}) { - if (!$groupid) { - $sth_remove_mapping->execute( - $otherUserID, $id, 0, GRANT_DIRECT); - push(@groupsRemovedFrom, $name); - } else { - $sth_add_mapping->execute( - $otherUserID, $id, 0, GRANT_DIRECT); - push(@groupsAddedTo, $name); - } - } - # Only members of the editusers group may change bless grants. - # Skip silently if this is not the case. - if ($editusers) { - my $groupid = $cgi->param("bless_$id") || 0; - if ($groupid != $permissions->{$id}->{'directbless'}) { - if (!$groupid) { - $sth_remove_mapping->execute( - $otherUserID, $id, 1, GRANT_DIRECT); - push(@groupsDeniedRightsToBless, $name); - } else { - $sth_add_mapping->execute( - $otherUserID, $id, 1, GRANT_DIRECT); - push(@groupsGrantedRightsToBless, $name); - } - } - } + # Update bless groups + my @bless_ids = grep { s/bless_// } keys %{ Bugzilla->cgi->Vars }; + $otherUser->set_bless_groups({ set => \@bless_ids }); } - if (@groupsAddedTo || @groupsRemovedFrom) { - $dbh->do(qq{INSERT INTO profiles_activity ( - userid, who, - profiles_when, fieldid, - oldvalue, newvalue - ) VALUES ( - ?, ?, now(), ?, ?, ? - ) - }, - undef, - ($otherUserID, $userid, - get_field_id('bug_group'), - join(', ', @groupsRemovedFrom), join(', ', @groupsAddedTo))); - } - # XXX: should create profiles_activity entries for blesser changes. + $changes = $otherUser->update(); $dbh->bz_commit_transaction(); @@ -344,11 +288,7 @@ if ($action eq 'search') { delete_token($token); $vars->{'message'} = 'account_updated'; - $vars->{'changed_fields'} = [keys %$changes]; - $vars->{'groups_added_to'} = \@groupsAddedTo; - $vars->{'groups_removed_from'} = \@groupsRemovedFrom; - $vars->{'groups_granted_rights_to_bless'} = \@groupsGrantedRightsToBless; - $vars->{'groups_denied_rights_to_bless'} = \@groupsDeniedRightsToBless; + $vars->{'changes'} = \%$changes; # We already display the updated page. We have to recreate a token now. $vars->{'token'} = issue_session_token('edit_user'); @@ -633,6 +573,11 @@ if ($action eq 'search') { $dbh->bz_commit_transaction(); delete_token($token); + # It's complex to determine which items now need to be flushed from + # memcached. As user deletion is expected to be a rare event, we just + # flush the entire cache when a user is deleted. + Bugzilla->memcached->clear_all(); + $vars->{'message'} = 'account_deleted'; $vars->{'otheruser'}{'login'} = $otherUser->login; $vars->{'restrictablegroups'} = $user->bless_groups(); @@ -705,7 +650,7 @@ sub mirrorListSelectionValues { my $cgi = Bugzilla->cgi; if (defined($cgi->param('matchtype'))) { foreach ('matchvalue', 'matchstr', 'matchtype', - 'grouprestrict', 'groupid', 'enabled_only') + 'grouprestrict', 'groupid', 'is_enabled') { $vars->{'listselectionvalues'}{$_} = $cgi->param($_); } diff --git a/editvalues.cgi b/editvalues.cgi index 60c39c9ea..75ebee0fc 100755 --- a/editvalues.cgi +++ b/editvalues.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,11 +6,10 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -# This is a script to edit the values of fields that have drop-down -# or select boxes. It is largely a copy of editmilestones.cgi, but -# with some cleanup. - +use 5.10.1; use strict; +use warnings; + use lib qw(. lib); use Bugzilla; @@ -48,7 +47,7 @@ my $vars = {}; # Replace this entry by separate entries in templates when # the documentation about legal values becomes bigger. -$vars->{'doc_section'} = 'edit-values.html'; +$vars->{'doc_section'} = 'administering/field-values.html'; print $cgi->header(); diff --git a/editversions.cgi b/editversions.cgi index 4951c272a..1d4e17d41 100755 --- a/editversions.cgi +++ b/editversions.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,10 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; + use lib qw(. lib); use Bugzilla; @@ -22,7 +25,7 @@ my $template = Bugzilla->template; my $vars = {}; # There is only one section about versions in the documentation, # so all actions point to the same page. -$vars->{'doc_section'} = 'versions.html'; +$vars->{'doc_section'} = 'administering/categorization.html#versions'; # # Preliminary checks: @@ -187,8 +190,10 @@ if ($action eq 'update') { $dbh->bz_start_transaction(); - $version->set_name($version_name); - $version->set_is_active($isactive); + $version->set_all({ + value => $version_name, + isactive => $isactive + }); my $changes = $version->update(); $dbh->bz_commit_transaction(); diff --git a/editwhines.cgi b/editwhines.cgi index 537c159dc..b11c44949 100755 --- a/editwhines.cgi +++ b/editwhines.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -10,7 +10,9 @@ # Script Initialization ################################################################################ +use 5.10.1; use strict; +use warnings; use lib qw(. lib); diff --git a/editworkflow.cgi b/editworkflow.cgi index 36b8ab8f9..71b14af77 100755 --- a/editworkflow.cgi +++ b/editworkflow.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,9 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; use lib qw(. lib); diff --git a/email_in.pl b/email_in.pl index 6be7be8cf..a936791b7 100755 --- a/email_in.pl +++ b/email_in.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,6 +6,7 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; use warnings; @@ -250,7 +251,6 @@ sub process_bug { foreach my $field (keys %fields) { $cgi->param(-name => $field, -value => $fields{$field}); } - $cgi->param('longdesclength', scalar @{ $bug->comments }); $cgi->param('token', issue_hash_token([$bug->id, $bug->delta_ts])); require 'process_bug.cgi'; @@ -469,7 +469,7 @@ sub die_handler { # If this is inside an eval, then we should just act like...we're # in an eval (instead of printing the error and exiting). - die(@_) if $^S; + die @_ if ($^S // Bugzilla::Error::_in_eval()); # We can't depend on the MTA to send an error message, so we have # to generate one properly. diff --git a/enter_bug.cgi b/enter_bug.cgi index 1f80501d5..e03a88528 100755 --- a/enter_bug.cgi +++ b/enter_bug.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -16,7 +16,9 @@ # ############################################################################## +use 5.10.1; use strict; +use warnings; use lib qw(. lib); @@ -45,7 +47,7 @@ my $template = Bugzilla->template; my $vars = {}; # All pages point to the same part of the documentation. -$vars->{'doc_section'} = 'bugreports.html'; +$vars->{'doc_section'} = 'using/filing.html'; my $product_name = trim($cgi->param('product') || ''); # Will contain the product object the bug is created in. @@ -75,8 +77,6 @@ if ($product_name eq '') { $vars->{'classifications'} = [map {$_->{'object'}} @classifications]; $vars->{'target'} = "enter_bug.cgi"; - $vars->{'format'} = $cgi->param('format'); - $vars->{'cloned_bug_id'} = $cgi->param('cloned_bug_id'); print $cgi->header(); $template->process("global/choose-classification.html.tmpl", $vars) @@ -107,8 +107,6 @@ if ($product_name eq '') { elsif (scalar(@enterable_products) > 1) { $vars->{'classifications'} = \@classifications; $vars->{'target'} = "enter_bug.cgi"; - $vars->{'format'} = $cgi->param('format'); - $vars->{'cloned_bug_id'} = $cgi->param('cloned_bug_id'); print $cgi->header(); $template->process("global/choose-product.html.tmpl", $vars) @@ -149,9 +147,16 @@ if ($cloned_bug_id) { $cloned_bug_id = $cloned_bug->id; } -if (scalar(@{$product->components}) == 1) { - # Only one component; just pick it. - $cgi->param('component', $product->components->[0]->name); +# If there is only one active component, choose it +my @active = grep { $_->is_active } @{$product->components}; +if (scalar(@active) == 1) { + $cgi->param('component', $active[0]->name); +} + +# If there is only one active version, choose it +@active = grep { $_->is_active } @{$product->versions}; +if (scalar(@active) == 1) { + $cgi->param('version', $active[0]->name); } my %default; @@ -213,10 +218,14 @@ if ($cloned_bug_id) { } else { $vars->{'cc'} = formvalue('cc'); } - - if ($cloned_bug->reporter->id != $user->id - && none { $_ eq $cloned_bug->reporter->login } @{$cloned_bug->cc}) { - $vars->{'cc'} = join (", ", $cloned_bug->reporter->login, $vars->{'cc'}); + + foreach my $role (qw(reporter assigned_to qa_contact)) { + if (defined($cloned_bug->$role) + && $cloned_bug->$role->id != $user->id + && none { $_ eq $cloned_bug->$role->login } @{$cloned_bug->cc}) + { + $vars->{'cc'} = join (", ", $cloned_bug->$role->login, $vars->{'cc'}); + } } foreach my $field (@enter_bug_fields) { @@ -259,6 +268,7 @@ else { $vars->{'blocked'} = formvalue('blocked'); $vars->{'deadline'} = formvalue('deadline'); $vars->{'estimated_time'} = formvalue('estimated_time'); + $vars->{'see_also'} = formvalue('see_also'); $vars->{'cc'} = join(', ', $cgi->param('cc')); diff --git a/extensions/BmpConvert/Config.pm b/extensions/BmpConvert/Config.pm index 42fb3ceab..4984f19a9 100644 --- a/extensions/BmpConvert/Config.pm +++ b/extensions/BmpConvert/Config.pm @@ -6,7 +6,11 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Extension::BmpConvert; + +use 5.10.1; use strict; +use warnings; + use constant NAME => 'BmpConvert'; use constant REQUIRED_MODULES => [ { diff --git a/extensions/BmpConvert/Extension.pm b/extensions/BmpConvert/Extension.pm index 87ec5f5fd..b8201f106 100644 --- a/extensions/BmpConvert/Extension.pm +++ b/extensions/BmpConvert/Extension.pm @@ -6,8 +6,12 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Extension::BmpConvert; + +use 5.10.1; use strict; -use base qw(Bugzilla::Extension); +use warnings; + +use parent qw(Bugzilla::Extension); use Image::Magick; diff --git a/extensions/Example/Config.pm b/extensions/Example/Config.pm index b40ed9906..e7782ef6c 100644 --- a/extensions/Example/Config.pm +++ b/extensions/Example/Config.pm @@ -6,7 +6,11 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Extension::Example; + +use 5.10.1; use strict; +use warnings; + use constant NAME => 'Example'; use constant REQUIRED_MODULES => [ { diff --git a/extensions/Example/Extension.pm b/extensions/Example/Extension.pm index 08a5144f4..dbc84df72 100644 --- a/extensions/Example/Extension.pm +++ b/extensions/Example/Extension.pm @@ -6,17 +6,22 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Extension::Example; + +use 5.10.1; use strict; -use base qw(Bugzilla::Extension); +use warnings; + +use parent qw(Bugzilla::Extension); use Bugzilla::Constants; use Bugzilla::Error; use Bugzilla::Group; use Bugzilla::User; use Bugzilla::User::Setting; -use Bugzilla::Util qw(diff_arrays html_quote); +use Bugzilla::Util qw(diff_arrays html_quote remote_ip); use Bugzilla::Status qw(is_open_state); use Bugzilla::Install::Filesystem; +use Bugzilla::WebService::Constants; # This is extensions/Example/lib/Util.pm. I can load this here in my # Extension.pm only because I have a Config.pm. @@ -29,6 +34,18 @@ use constant REL_EXAMPLE => -127; our $VERSION = '1.0'; +sub user_can_administer { + my ($self, $args) = @_; + my $can_administer = $args->{can_administer}; + + # If you add an option to the admin pages (e.g. by using the Hooks in + # template/en/default/admin/admin.html.tmpl), you may want to allow + # users in another group view admin.cgi + #if (Bugzilla->user->in_group('other_group')) { + # $$can_administer = 1; + #} +} + sub admin_editusers_action { my ($self, $args) = @_; my ($vars, $action, $user) = @$args{qw(vars action user)}; @@ -322,8 +339,8 @@ sub bugmail_recipients { # were on the CC list. #$recipients->{$user->id}->{+REL_CC} = 1; - # And this line adds the maintainer as though he had the "REL_EXAMPLE" - # relationship from the bugmail_relationships hook below. + # And this line adds the maintainer as though they had the + # "REL_EXAMPLE" relationship from the bugmail_relationships hook below. #$recipients->{$user->id}->{+REL_EXAMPLE} = 1; } } @@ -334,6 +351,13 @@ sub bugmail_relationships { $relationships->{+REL_EXAMPLE} = 'Example'; } +sub cgi_headers { + my ($self, $args) = @_; + my $headers = $args->{'headers'}; + + $headers->{'-x_test_header'} = "Test header from Example extension"; +} + sub config_add_panels { my ($self, $args) = @_; @@ -397,8 +421,8 @@ sub email_in_after_parse { # No other check needed if this is a valid regular user. return if login_to_id($reporter); - # The reporter is not a regular user. We create an account for him, - # but he can only comment on existing bugs. + # The reporter is not a regular user. We create an account for them, + # but they can only comment on existing bugs. # This is useful for people who reply by email to bugmails received # in mailing-lists. if ($args->{fields}->{bug_id}) { @@ -906,6 +930,26 @@ sub template_before_process { } } +sub user_check_account_creation { + my ($self, $args) = @_; + + my $login = $args->{login}; + my $ip = remote_ip(); + + # Log all requests. + warn "USER ACCOUNT CREATION REQUEST FOR $login ($ip)"; + + # Reject requests based on their email address. + if ($login =~ /\@evil\.com$/) { + ThrowUserError('account_creation_restricted'); + } + + # Reject requests based on their IP address. + if ($ip =~ /^192\.168\./) { + ThrowUserError('account_creation_restricted'); + } +} + sub user_preferences { my ($self, $args) = @_; my $tab = $args->{current_tab}; @@ -935,10 +979,85 @@ sub webservice { sub webservice_error_codes { my ($self, $args) = @_; - + my $error_map = $args->{error_map}; $error_map->{'example_my_error'} = 10001; } +sub webservice_status_code_map { + my ($self, $args) = @_; + + my $status_code_map = $args->{status_code_map}; + # Uncomment this line to override the status code for the + # error 'object_does_not_exist' to STATUS_BAD_REQUEST + #$status_code_map->{51} = STATUS_BAD_REQUEST; +} + +sub webservice_before_call { + my ($self, $args) = @_; + + # This code doesn't actually *do* anything, it's just here to show you + # how to use this hook. + my $method = $args->{method}; + my $full_method = $args->{full_method}; + + # Uncomment this line to see a line in your webserver's error log whenever + # a webservice call is made + #warn "RPC call $full_method made by ", + # Bugzilla->user->login || 'an anonymous user', "\n"; +} + +sub webservice_fix_credentials { + my ($self, $args) = @_; + my $rpc = $args->{'rpc'}; + my $params = $args->{'params'}; + # Allow user to pass in username=foo&password=bar + if (exists $params->{'username'} && exists $params->{'password'}) { + $params->{'Bugzilla_login'} = $params->{'username'}; + $params->{'Bugzilla_password'} = $params->{'password'}; + } +} + +sub webservice_rest_request { + my ($self, $args) = @_; + my $rpc = $args->{'rpc'}; + my $params = $args->{'params'}; + # Internally we may have a field called 'cf_test_field' but we allow users + # to use the shorter 'test_field' name. + if (exists $params->{'test_field'}) { + $params->{'test_field'} = delete $params->{'cf_test_field'}; + } +} + +sub webservice_rest_resources { + my ($self, $args) = @_; + my $rpc = $args->{'rpc'}; + my $resources = $args->{'resources'}; + # Add a new resource that allows for /rest/example/hello + # to call Example.hello + $resources->{'Bugzilla::Extension::Example::WebService'} = [ + qr{^/example/hello$}, { + GET => { + method => 'hello', + } + } + ]; +} + +sub webservice_rest_response { + my ($self, $args) = @_; + my $rpc = $args->{'rpc'}; + my $result = $args->{'result'}; + my $response = $args->{'response'}; + # Convert a list of bug hashes to a single bug hash if only one is + # being returned. + if (ref $$result eq 'HASH' + && exists $$result->{'bugs'} + && scalar @{ $$result->{'bugs'} } == 1) + { + $$result = $$result->{'bugs'}->[0]; + } +} + # This must be the last line of your extension. __PACKAGE__->NAME; diff --git a/extensions/Example/docs/en/rst/api/v1/index.rst b/extensions/Example/docs/en/rst/api/v1/index.rst new file mode 100644 index 000000000..02186bb0b --- /dev/null +++ b/extensions/Example/docs/en/rst/api/v1/index.rst @@ -0,0 +1,4 @@ +Example API v1 +============== + +Here is where you place your API docs for the Example extension. diff --git a/extensions/Example/docs/en/rst/index-admin.rst b/extensions/Example/docs/en/rst/index-admin.rst new file mode 100644 index 000000000..220319f99 --- /dev/null +++ b/extensions/Example/docs/en/rst/index-admin.rst @@ -0,0 +1,12 @@ +Example +####### + +This is a sample Adminstration documentation file for the Example extension. +Like all of the Bugzilla docs, it's written in +`reStructured Text (reST) format <http://sphinx-doc.org/latest/rest.html>`_ +and will be compiled by `Sphinx <http://sphinx-doc.org/>`_. + +If you build the docs yourself using :file:`makedocs.pl`, this file will get +incorporated into the Administration Guide. If you need more than one file's +worth of admin documentation, include others using the Sphinx `toctree +directive <http://sphinx-doc.org/markup/toctree.html>`_. diff --git a/extensions/Example/docs/en/rst/index-user.rst b/extensions/Example/docs/en/rst/index-user.rst new file mode 100644 index 000000000..192075d10 --- /dev/null +++ b/extensions/Example/docs/en/rst/index-user.rst @@ -0,0 +1,11 @@ +Example +####### + +This is a sample User documentation file for the Example extension. +Like all of the Bugzilla docs, it's written in +`reStructured Text (reST) format <http://sphinx-doc.org/latest/rest.html>`_ +and will be compiled by `Sphinx <http://sphinx-doc.org/>`_. + +If you build the docs yourself using :file:`makedocs.pl`, this file will get +incorporated into the User Guide. If you need more than one file's worth of +user documentation, include others using the Sphinx `toctree directive <http://sphinx-doc.org/markup/toctree.html>`_. diff --git a/extensions/Example/lib/Auth/Login.pm b/extensions/Example/lib/Auth/Login.pm index f87831157..15c58a881 100644 --- a/extensions/Example/lib/Auth/Login.pm +++ b/extensions/Example/lib/Auth/Login.pm @@ -6,8 +6,12 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Extension::Example::Auth::Login; + +use 5.10.1; use strict; -use base qw(Bugzilla::Auth::Login); +use warnings; + +use parent qw(Bugzilla::Auth::Login); use constant user_can_create_account => 0; use Bugzilla::Constants; diff --git a/extensions/Example/lib/Auth/Verify.pm b/extensions/Example/lib/Auth/Verify.pm index 0d068b2e1..49fd9fbb7 100644 --- a/extensions/Example/lib/Auth/Verify.pm +++ b/extensions/Example/lib/Auth/Verify.pm @@ -6,8 +6,12 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Extension::Example::Auth::Verify; + +use 5.10.1; use strict; -use base qw(Bugzilla::Auth::Verify); +use warnings; + +use parent qw(Bugzilla::Auth::Verify); use Bugzilla::Constants; # A verifier that always fails. diff --git a/extensions/Example/lib/Config.pm b/extensions/Example/lib/Config.pm index b0497a783..fac0046af 100644 --- a/extensions/Example/lib/Config.pm +++ b/extensions/Example/lib/Config.pm @@ -6,6 +6,8 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Extension::Example::Config; + +use 5.10.1; use strict; use warnings; diff --git a/extensions/Example/lib/Util.pm b/extensions/Example/lib/Util.pm index b4ed3e0a4..ccc349c9c 100644 --- a/extensions/Example/lib/Util.pm +++ b/extensions/Example/lib/Util.pm @@ -6,6 +6,8 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Extension::Example::Util; + +use 5.10.1; use strict; use warnings; diff --git a/extensions/Example/lib/WebService.pm b/extensions/Example/lib/WebService.pm index 56adc8cb8..d8a96b5f5 100644 --- a/extensions/Example/lib/WebService.pm +++ b/extensions/Example/lib/WebService.pm @@ -6,9 +6,11 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Extension::Example::WebService; + +use 5.10.1; use strict; use warnings; -use base qw(Bugzilla::WebService); +use parent qw(Bugzilla::WebService); use Bugzilla::Error; use constant PUBLIC_METHODS => qw( diff --git a/extensions/Example/template/en/default/hook/global/footer-end.html.tmpl b/extensions/Example/template/en/default/hook/global/footer-end.html.tmpl index f4cb1e006..fd4ec8639 100644 --- a/extensions/Example/template/en/default/hook/global/footer-end.html.tmpl +++ b/extensions/Example/template/en/default/hook/global/footer-end.html.tmpl @@ -8,7 +8,7 @@ [% USE date %] -<p align="center"> +<p class="center"> <em>[% component.callers.first FILTER html %]</em> processed on [% date.format(date.now, '%b %d, %Y at %H:%M:%S') FILTER html %]. <br> diff --git a/extensions/Example/template/en/default/hook/search/tabs-search_tabs.html.tmpl b/extensions/Example/template/en/default/hook/search/tabs-search_tabs.html.tmpl new file mode 100644 index 000000000..bf522f7dd --- /dev/null +++ b/extensions/Example/template/en/default/hook/search/tabs-search_tabs.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. + #%] + +[% + tabs.push({ name => 'newsearch', label => "New Search", + link => "query.cgi?format=newsearch" }) +%] + diff --git a/extensions/Gentoo/Extension.pm b/extensions/Gentoo/Extension.pm index cc80a1007..93301cbdd 100644 --- a/extensions/Gentoo/Extension.pm +++ b/extensions/Gentoo/Extension.pm @@ -59,4 +59,12 @@ sub template_before_create { $constants->{GENTOO_APPEND_VERSION} = "+"; } +sub user_check_account_creation { + my ($self, $args) = @_; + + my $login = $args->{login}; + + ThrowUserError('restricted_email_address', {addr => $login}) if $login =~ m/.+\@gentoo\.org$/; +} + __PACKAGE__->NAME; diff --git a/extensions/MoreBugUrl/Config.pm b/extensions/MoreBugUrl/Config.pm index b5af9c00e..e0eac5f8a 100644 --- a/extensions/MoreBugUrl/Config.pm +++ b/extensions/MoreBugUrl/Config.pm @@ -6,7 +6,10 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Extension::MoreBugUrl; + +use 5.10.1; use strict; +use warnings; use constant NAME => 'MoreBugUrl'; diff --git a/extensions/MoreBugUrl/Extension.pm b/extensions/MoreBugUrl/Extension.pm index 52b6e61c3..18507f8d1 100644 --- a/extensions/MoreBugUrl/Extension.pm +++ b/extensions/MoreBugUrl/Extension.pm @@ -6,15 +6,22 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Extension::MoreBugUrl; + +use 5.10.1; use strict; -use base qw(Bugzilla::Extension); +use warnings; + +use parent qw(Bugzilla::Extension); use constant MORE_SUB_CLASSES => qw( + Bugzilla::Extension::MoreBugUrl::BitBucket Bugzilla::Extension::MoreBugUrl::ReviewBoard Bugzilla::Extension::MoreBugUrl::Rietveld Bugzilla::Extension::MoreBugUrl::RT Bugzilla::Extension::MoreBugUrl::GetSatisfaction Bugzilla::Extension::MoreBugUrl::PHP + Bugzilla::Extension::MoreBugUrl::Redmine + Bugzilla::Extension::MoreBugUrl::Savane ); # We need to update bug_see_also table because both diff --git a/extensions/MoreBugUrl/lib/BitBucket.pm b/extensions/MoreBugUrl/lib/BitBucket.pm new file mode 100644 index 000000000..dcc85992d --- /dev/null +++ b/extensions/MoreBugUrl/lib/BitBucket.pm @@ -0,0 +1,41 @@ +# 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::MoreBugUrl::BitBucket; + +use 5.10.1; +use strict; +use warnings; + +use parent qw(Bugzilla::BugUrl); + +############################### +#### Methods #### +############################### + +sub should_handle { + my ($class, $uri) = @_; + + # BitBucket issues have the form of + # bitbucket.org/user/project/issue/1234 + return (lc($uri->authority) eq "bitbucket.org" + && $uri->path =~ m|[^/]+/[^/]+/issue/\d+|i) ? 1 : 0; +} + +sub _check_value { + my $class = shift; + + my $uri = $class->SUPER::_check_value(@_); + + my ($path) = $uri->path =~ m|([^/]+/[^/]+/issue/\d+)|i; + $uri = new URI("https://bitbucket.org/$path"); + + return $uri; +} + +1; + diff --git a/extensions/MoreBugUrl/lib/GetSatisfaction.pm b/extensions/MoreBugUrl/lib/GetSatisfaction.pm index e4548563f..74951735b 100644 --- a/extensions/MoreBugUrl/lib/GetSatisfaction.pm +++ b/extensions/MoreBugUrl/lib/GetSatisfaction.pm @@ -6,8 +6,12 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Extension::MoreBugUrl::GetSatisfaction; + +use 5.10.1; use strict; -use base qw(Bugzilla::BugUrl); +use warnings; + +use parent qw(Bugzilla::BugUrl); ############################### #### Methods #### diff --git a/extensions/MoreBugUrl/lib/PHP.pm b/extensions/MoreBugUrl/lib/PHP.pm index c17a49998..6f201d7b1 100644 --- a/extensions/MoreBugUrl/lib/PHP.pm +++ b/extensions/MoreBugUrl/lib/PHP.pm @@ -6,8 +6,12 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Extension::MoreBugUrl::PHP; + +use 5.10.1; use strict; -use base qw(Bugzilla::BugUrl); +use warnings; + +use parent qw(Bugzilla::BugUrl); ############################### #### Methods #### diff --git a/extensions/MoreBugUrl/lib/RT.pm b/extensions/MoreBugUrl/lib/RT.pm index 724c773a2..acb90cf39 100644 --- a/extensions/MoreBugUrl/lib/RT.pm +++ b/extensions/MoreBugUrl/lib/RT.pm @@ -6,8 +6,12 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Extension::MoreBugUrl::RT; + +use 5.10.1; use strict; -use base qw(Bugzilla::BugUrl); +use warnings; + +use parent qw(Bugzilla::BugUrl); ############################### #### Methods #### diff --git a/extensions/MoreBugUrl/lib/Redmine.pm b/extensions/MoreBugUrl/lib/Redmine.pm new file mode 100644 index 000000000..57a071239 --- /dev/null +++ b/extensions/MoreBugUrl/lib/Redmine.pm @@ -0,0 +1,41 @@ +# 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::MoreBugUrl::Redmine; + +use 5.10.1; +use strict; +use warnings; + +use parent qw(Bugzilla::BugUrl); + +############################### +#### Methods #### +############################### + +sub should_handle { + my ($class, $uri) = @_; + return ($uri->path =~ m|/issues/\d+$|) ? 1 : 0; +} + +sub _check_value { + my $class = shift; + + my $uri = $class->SUPER::_check_value(@_); + + # Redmine URLs have only one form: + # http://demo.redmine.com/issues/111 + + # Make sure there are no query parameters. + $uri->query(undef); + # And remove any # part if there is one. + $uri->fragment(undef); + + return $uri; +} + +1; diff --git a/extensions/MoreBugUrl/lib/ReviewBoard.pm b/extensions/MoreBugUrl/lib/ReviewBoard.pm index 7628dd314..af5ff0684 100644 --- a/extensions/MoreBugUrl/lib/ReviewBoard.pm +++ b/extensions/MoreBugUrl/lib/ReviewBoard.pm @@ -6,8 +6,12 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Extension::MoreBugUrl::ReviewBoard; + +use 5.10.1; use strict; -use base qw(Bugzilla::BugUrl); +use warnings; + +use parent qw(Bugzilla::BugUrl); ############################### #### Methods #### diff --git a/extensions/MoreBugUrl/lib/Rietveld.pm b/extensions/MoreBugUrl/lib/Rietveld.pm index 0c52892e2..a4bf08492 100644 --- a/extensions/MoreBugUrl/lib/Rietveld.pm +++ b/extensions/MoreBugUrl/lib/Rietveld.pm @@ -6,8 +6,12 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Extension::MoreBugUrl::Rietveld; + +use 5.10.1; use strict; -use base qw(Bugzilla::BugUrl); +use warnings; + +use parent qw(Bugzilla::BugUrl); ############################### #### Methods #### diff --git a/extensions/MoreBugUrl/lib/Savane.pm b/extensions/MoreBugUrl/lib/Savane.pm new file mode 100644 index 000000000..efda1fa4f --- /dev/null +++ b/extensions/MoreBugUrl/lib/Savane.pm @@ -0,0 +1,40 @@ +# 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::MoreBugUrl::Savane; + +use 5.10.1; +use strict; +use warnings; + +use parent qw(Bugzilla::BugUrl); + +############################### +#### Methods #### +############################### + +sub should_handle { + my ($class, $uri) = @_; + return ($uri->as_string =~ m|/bugs/(index\.php)?\?\d+$|) ? 1 : 0; +} + +sub _check_value { + my $class = shift; + + my $uri = $class->SUPER::_check_value(@_); + + # Savane URLs have only two forms: + # http://gna.org/bugs/index.php?12345 + # http://gna.org/bugs/?12345 + + # And remove any # part if there is one. + $uri->fragment(undef); + + return $uri; +} + +1; diff --git a/extensions/MoreBugUrl/template/en/default/hook/global/user-error-bug_url_invalid_tracker.html.tmpl b/extensions/MoreBugUrl/template/en/default/hook/global/user-error-bug_url_invalid_tracker.html.tmpl index 7683e4299..7e544ef21 100644 --- a/extensions/MoreBugUrl/template/en/default/hook/global/user-error-bug_url_invalid_tracker.html.tmpl +++ b/extensions/MoreBugUrl/template/en/default/hook/global/user-error-bug_url_invalid_tracker.html.tmpl @@ -6,8 +6,11 @@ # defined by the Mozilla Public License, v. 2.0. #%] +<li>An issue on bitbucket.org.</li> <li>A Review Board review request.</li> <li>An issue in a Rietveld installation.</li> <li>A ticket in an RT installation.</li> <li>A topic on getsatisfaction.com.</li> <li>A b[% %]ug on b[% %]ugs.php.net.</li> +<li>An issue in a Redmine installation.</li> +<li>A b[% %]ug in a Savane installation.</li> diff --git a/extensions/OldBugMove/Config.pm b/extensions/OldBugMove/Config.pm index 95648610e..681cbae2d 100644 --- a/extensions/OldBugMove/Config.pm +++ b/extensions/OldBugMove/Config.pm @@ -6,6 +6,10 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Extension::OldBugMove; + +use 5.10.1; use strict; +use warnings; + use constant NAME => 'OldBugMove'; __PACKAGE__->NAME; diff --git a/extensions/OldBugMove/Extension.pm b/extensions/OldBugMove/Extension.pm index 9a499d5d0..375707fd2 100644 --- a/extensions/OldBugMove/Extension.pm +++ b/extensions/OldBugMove/Extension.pm @@ -6,8 +6,12 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Extension::OldBugMove; + +use 5.10.1; use strict; -use base qw(Bugzilla::Extension); +use warnings; + +use parent qw(Bugzilla::Extension); use Bugzilla::Constants; use Bugzilla::Error; use Bugzilla::Field::Choice; diff --git a/extensions/OldBugMove/lib/Params.pm b/extensions/OldBugMove/lib/Params.pm index dbb1eb21d..05e3ed277 100644 --- a/extensions/OldBugMove/lib/Params.pm +++ b/extensions/OldBugMove/lib/Params.pm @@ -7,7 +7,9 @@ package Bugzilla::Extension::OldBugMove::Params; +use 5.10.1; use strict; +use warnings; use Bugzilla::Config::Common; diff --git a/extensions/Voting/Config.pm b/extensions/Voting/Config.pm index 4fefe957a..97c44933e 100644 --- a/extensions/Voting/Config.pm +++ b/extensions/Voting/Config.pm @@ -6,7 +6,10 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Extension::Voting; + +use 5.10.1; use strict; +use warnings; use constant NAME => 'Voting'; diff --git a/extensions/Voting/Extension.pm b/extensions/Voting/Extension.pm index d186e442a..8009f16bb 100644 --- a/extensions/Voting/Extension.pm +++ b/extensions/Voting/Extension.pm @@ -6,8 +6,12 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::Extension::Voting; + +use 5.10.1; use strict; -use base qw(Bugzilla::Extension); +use warnings; + +use parent qw(Bugzilla::Extension); use Bugzilla::Bug; use Bugzilla::BugMail; @@ -389,7 +393,7 @@ sub _page_user { # If a bug_id is given, and we're editing, we'll add it to the votes list. my $bug_id = $input->{bug_id}; - my $bug = Bugzilla::Bug->check($bug_id) if $bug_id; + my $bug = Bugzilla::Bug->check({ id => $bug_id, cache => 1 }) if $bug_id; my $who_id = $input->{user_id} || $user->id; # Logged-out users must specify a user_id. @@ -626,7 +630,7 @@ sub _update_votes { # Set header_done to 1 only after the first bug. $vars->{'header_done'} = 1; } - $vars->{'votes_recorded'} = 1; + $vars->{'message'} = 'votes_recorded'; } ###################### @@ -654,8 +658,8 @@ sub _modify_bug_votes { # If some votes are removed, _remove_votes() returns a list # of messages to send to voters. push(@msgs, _remove_votes($id, $who, 'votes_too_many_per_bug')); - my $name = user_id_to_login($who); - + my $name = Bugzilla::User->new($who)->login; + push(@toomanyvotes_list, {id => $id, name => $name}); } } @@ -695,12 +699,12 @@ sub _modify_bug_votes { AND votes.who = ?', undef, $product->id, $who); + my $name = Bugzilla::User->new($who)->login; foreach my $bug_id (@$bug_ids) { # _remove_votes returns a list of messages to send # in case some voters had too many votes. push(@msgs, _remove_votes($bug_id, $who, 'votes_too_many_per_user')); - my $name = user_id_to_login($who); push(@toomanytotalvotes_list, {id => $bug_id, name => $name}); } @@ -824,7 +828,7 @@ sub _remove_votes { # confirm a bug has been reduced, check if the bug is now confirmed. sub _confirm_if_vote_confirmed { my $id = shift; - my $bug = ref $id ? $id : new Bugzilla::Bug($id); + my $bug = ref $id ? $id : new Bugzilla::Bug({ id => $id, cache => 1 }); my $ret = 0; if (!$bug->everconfirmed diff --git a/extensions/Voting/template/en/default/hook/admin/products/edit-common-rows.html.tmpl b/extensions/Voting/template/en/default/hook/admin/products/edit-common-rows.html.tmpl index 9a8373bac..c46da75ae 100644 --- a/extensions/Voting/template/en/default/hook/admin/products/edit-common-rows.html.tmpl +++ b/extensions/Voting/template/en/default/hook/admin/products/edit-common-rows.html.tmpl @@ -11,16 +11,16 @@ product.votesperuser = 0 product.votestoconfirm = 0 %] - + <tr> - <th align="right">Maximum votes per person:</th> + <th>Maximum votes per person:</th> <td><input size="5" maxlength="5" name="votesperuser" id="votesperuser" value="[% product.votesperuser FILTER html %]"> </td> </tr> <tr> - <th align="right"> + <th> Maximum votes a person can put on a single [% terms.bug %]: </th> <td><input size="5" maxlength="5" name="maxvotesperbug" id="maxvotesperbug" @@ -30,7 +30,7 @@ <tr id="votes_to_confirm_container" [%- ' class="bz_default_hidden"' IF !product.allows_unconfirmed %]> - <th align="right"> + <th> Confirm [% terms.abug %] if it gets this many votes: </th> <td> diff --git a/extensions/Voting/template/en/default/hook/global/messages-messages.html.tmpl b/extensions/Voting/template/en/default/hook/global/messages-messages.html.tmpl new file mode 100644 index 000000000..e6e5f22c7 --- /dev/null +++ b/extensions/Voting/template/en/default/hook/global/messages-messages.html.tmpl @@ -0,0 +1,16 @@ +[%# This Source Code Form is subject to th e 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. + #%] + +[%# This is a list of all the possible messages. Please keep them in + # alphabetical order by message tag, and leave a blank line between messages. + #%] + +[% IF message_tag == "votes_recorded" %] + The changes to your votes have been saved. +[% END %] + diff --git a/extensions/Voting/template/en/default/hook/global/user-error-errors.html.tmpl b/extensions/Voting/template/en/default/hook/global/user-error-errors.html.tmpl index 55c32d460..644c827a6 100644 --- a/extensions/Voting/template/en/default/hook/global/user-error-errors.html.tmpl +++ b/extensions/Voting/template/en/default/hook/global/user-error-errors.html.tmpl @@ -30,14 +30,14 @@ [% admindocslinks = {'voting.html' => 'Setting up the voting feature'} %] You may only use at most [% max FILTER html %] votes for a single [%+ terms.bug %] in the - <tt>[% product FILTER html %]</tt> product, but you are trying to + <em>[% product FILTER html %]</em> product, but you are trying to use [% votes FILTER html %]. [% ELSIF error == "voting_too_many_votes_for_product" %] [% title = "Illegal Vote" %] [% admindocslinks = {'voting.html' => 'Setting up the voting feature'} %] You tried to use [% votes FILTER html %] votes in the - <tt>[% product FILTER html %]</tt> product, which exceeds the maximum of + <em>[% product FILTER html %]</em> product, which exceeds the maximum of [%+ max FILTER html %] votes for this product. [% END %] diff --git a/extensions/Voting/template/en/default/pages/voting/bug.html.tmpl b/extensions/Voting/template/en/default/pages/voting/bug.html.tmpl index 2ba784f77..cb1d2380e 100644 --- a/extensions/Voting/template/en/default/pages/voting/bug.html.tmpl +++ b/extensions/Voting/template/en/default/pages/voting/bug.html.tmpl @@ -20,10 +20,11 @@ [% PROCESS global/header.html.tmpl title = "Show Votes" subheader = subheader + style_urls = [ "extensions/Voting/web/style.css" ] %] [% total = 0 %] -<table cellspacing="4"> +<table id="bug_votes"> <tr> <th>Who</th> <th>Number of votes</th> @@ -38,7 +39,7 @@ [% voter.login_name FILTER email FILTER html %] </a> </td> - <td align="right"> + <td class="right"> [% voter.vote_count FILTER html %] </td> </tr> diff --git a/extensions/Voting/template/en/default/pages/voting/user.html.tmpl b/extensions/Voting/template/en/default/pages/voting/user.html.tmpl index 8777e036b..b5e8fc9bc 100644 --- a/extensions/Voting/template/en/default/pages/voting/user.html.tmpl +++ b/extensions/Voting/template/en/default/pages/voting/user.html.tmpl @@ -47,25 +47,15 @@ <hr> [% END %] -[% IF votes_recorded %] - <p> - <font color="red"> - The changes to your votes have been saved. - </font> - </p> -[% ELSE %] - <br> -[% END %] - [% IF products.size %] <form name="voting_form" method="post" action="page.cgi?id=voting/user.html"> <input type="hidden" name="action" value="vote"> <input type="hidden" name="token" value="[% issue_hash_token(['vote']) FILTER html %]"> - <table cellspacing="4"> + <table id="user_votes"> <tr> - <td></td> + <th></th> <th>Votes</th> - <th>[% terms.Bug %] #</th> + <th>[% terms.Bug %] #</th> <th>Summary</th> </tr> @@ -105,7 +95,8 @@ [% END %] [%- END %] </td> - <td align="right"><a name="vote_[% bug.id FILTER none %]"> + <td> + <a name="vote_[% bug.id FILTER none %]"> [% IF canedit %] [% IF product.onevoteonly %] <input type="checkbox" name="[% bug.id FILTER none %]" value="1" @@ -117,8 +108,9 @@ [% ELSE %] [% bug.count FILTER html %] [% END %] - </a></td> - <td align="center"> + </a> + </td> + <td class="right"> [% PROCESS bug/link.html.tmpl bug = bug, link_text = bug.id %] </td> <td> diff --git a/extensions/Voting/web/style.css b/extensions/Voting/web/style.css index 3f06200ca..22458fd90 100644 --- a/extensions/Voting/web/style.css +++ b/extensions/Voting/web/style.css @@ -19,3 +19,12 @@ tr.bz_bug_being_voted_on td { #votes_container { white-space: nowrap; } + +#user_votes th { + text-align: center; +} + +#user_votes th, #user_votes td, +#bug_votes th, #bug_votes td { + padding: 0.2em; +} diff --git a/extensions/create.pl b/extensions/create.pl index 7bcf10373..7c8693e28 100755 --- a/extensions/create.pl +++ b/extensions/create.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl # 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/. @@ -6,8 +6,15 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; -use lib qw(. lib); +use warnings; + +use File::Basename; +BEGIN { chdir dirname($0); } + +use lib qw(.. ../lib); + use Bugzilla; use Bugzilla::Constants; use Bugzilla::Error; @@ -28,7 +35,7 @@ mkpath($extension_dir) || die "$extension_dir already exists or cannot be created.\n"; my $lcname = lc($name); -foreach my $path (qw(lib web template/en/default/hook), +foreach my $path (qw(lib docs/en/rst web template/en/default/hook), "template/en/default/$lcname") { mkpath("$extension_dir/$path") || die "$extension_dir/$path: $!"; @@ -43,6 +50,8 @@ my %create_files = ( 'web-readme.txt.tmpl' => 'web/README', 'hook-readme.txt.tmpl' => 'template/en/default/hook/README', 'name-readme.txt.tmpl' => "template/en/default/$lcname/README", + 'index-admin.rst.tmpl' => "docs/en/rst/index-admin.rst", + 'index-user.rst.tmpl' => "docs/en/rst/index-user.rst", ); foreach my $template_file (keys %create_files) { @@ -50,12 +59,13 @@ foreach my $template_file (keys %create_files) { my $output; $template->process("extensions/$template_file", $vars, \$output) or ThrowTemplateError($template->error()); - open(my $fh, '>', "$extension_dir/$target"); - print $fh $output; - close($fh); + open(my $fh, '>', "$extension_dir/$target") + or die "extension_dir/$target: $!"; + print $fh $output; + close($fh); } -print get_text('extension_created', $vars), "\n"; +say get_text('extension_created', $vars); __END__ diff --git a/images/csv.png b/images/csv.png Binary files differnew file mode 100644 index 000000000..cb29bd7b4 --- /dev/null +++ b/images/csv.png diff --git a/images/ical.png b/images/ical.png Binary files differnew file mode 100644 index 000000000..aa198578b --- /dev/null +++ b/images/ical.png diff --git a/images/rss.png b/images/rss.png Binary files differnew file mode 100644 index 000000000..79dcc704d --- /dev/null +++ b/images/rss.png diff --git a/images/rss_small.png b/images/rss_small.png Binary files differnew file mode 100644 index 000000000..1679ab05b --- /dev/null +++ b/images/rss_small.png diff --git a/images/xml.png b/images/xml.png Binary files differnew file mode 100644 index 000000000..685300d25 --- /dev/null +++ b/images/xml.png diff --git a/importxml.pl b/importxml.pl index e7dc9761b..12831e0b9 100755 --- a/importxml.pl +++ b/importxml.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -10,7 +10,9 @@ # a new bug into bugzilla. Everything before the beginning <?xml line # is removed so you can pipe in email messages. +use 5.10.1; use strict; +use warnings; ##################################################################### # @@ -1023,6 +1025,15 @@ sub process_bug { push(@query, $custom_field); push(@values, $value); } + } elsif ($field->type == FIELD_TYPE_DATE) { + eval { $value = Bugzilla::Bug->_check_date_field($value); }; + if ($@) { + $err .= "Skipping illegal value \"$value\" in $custom_field.\n" ; + } + else { + push(@query, $custom_field); + push(@values, $value); + } } else { $err .= "Type of custom field $custom_field is an unhandled FIELD_TYPE: " . $field->type . "\n"; @@ -1164,7 +1175,7 @@ sub process_bug { if (!$attacher) { if ($att->{'attacher'}) { $err .= "The original submitter of attachment $att_id was\n "; - $err .= $att->{'attacher'} . ", but he doesn't have an account here.\n"; + $err .= $att->{'attacher'} . ", but they don't have an account here.\n"; } else { $err .= "The original submitter of attachment $att_id is unknown.\n"; @@ -1264,6 +1275,9 @@ my $twig = XML::Twig->new( }, start_tag_handlers => { bugzilla => \&init } ); +# Prevent DoS using the billion laughs attack. +$twig->{NoExpand} = 1; + $twig->parse($xml); my $root = $twig->root; my $maintainer = $root->{'att'}->{'maintainer'}; @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,14 +6,10 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -############################################################################### -# Script Initialization -############################################################################### - -# Make it harder for us to do dangerous things in Perl. +use 5.10.1; use strict; +use warnings; -# Include the Bugzilla CGI and general utility library. use lib qw(. lib); use Bugzilla; @@ -37,10 +33,6 @@ if ($cgi->param('logout')) { $cgi->delete('logout'); } -############################################################################### -# Main Body Execution -############################################################################### - # Return the appropriate HTTP response headers. print $cgi->header(); @@ -55,6 +47,19 @@ if ($user->in_group('admin')) { $vars->{'release'} = Bugzilla::Update::get_notifications(); } +if ($user->id) { + my $dbh = Bugzilla->dbh; + $vars->{assignee_count} = + $dbh->selectrow_array("SELECT COUNT(*) FROM bugs WHERE assigned_to = ? + AND resolution = ''", undef, $user->id); + $vars->{reporter_count} = + $dbh->selectrow_array("SELECT COUNT(*) FROM bugs WHERE reporter = ? + AND resolution = ''", undef, $user->id); + $vars->{requestee_count} = + $dbh->selectrow_array('SELECT COUNT(DISTINCT bug_id) FROM flags + WHERE requestee_id = ?', undef, $user->id); +} + # Generate and return the UI (HTML page) from the appropriate template. $template->process("index.html.tmpl", $vars) || ThrowTemplateError($template->error()); diff --git a/install-module.pl b/install-module.pl index 466377759..365f10bbf 100755 --- a/install-module.pl +++ b/install-module.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl # 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/. @@ -6,6 +6,7 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; use warnings; @@ -22,7 +23,7 @@ use Bugzilla::Install::CPAN; use Bugzilla::Constants; use Bugzilla::Install::Requirements; -use Bugzilla::Install::Util qw(bin_loc init_console vers_cmp); +use Bugzilla::Install::Util qw(bin_loc init_console); use Data::Dumper; use Getopt::Long; diff --git a/jobqueue.pl b/jobqueue.pl index 3b96b8dde..f6722467c 100755 --- a/jobqueue.pl +++ b/jobqueue.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl # 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/. @@ -6,7 +6,9 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; use Cwd qw(abs_path); use File::Basename; @@ -44,7 +46,7 @@ jobqueue.pl - Runs jobs in the background for Bugzilla. restart Stops a running jobqueue if one is running, and then starts a new one. once Checks the job queue once, executes the first item found (if - any) and then exits + any, up to a limit of 1000 items) and then exits onepass Checks the job queue, executes all items found, and then exits check Report the current status of the daemon. install On some *nix systems, this automatically installs and diff --git a/js/attachment.js b/js/attachment.js index d9bdabc4e..09401f07d 100644 --- a/js/attachment.js +++ b/js/attachment.js @@ -236,11 +236,6 @@ function viewRaw(patchviewerinstalled) function switchToMode(mode, patchviewerinstalled) { - if (mode == current_mode) { - alert('switched to same mode! This should not happen.'); - return; - } - // Switch out of current mode if (current_mode == 'edit') { hideElementById('editFrame'); @@ -22,6 +22,7 @@ YAHOO.bugzilla.dupTable = { method : "Bug.possible_duplicates", id : YAHOO.bugzilla.dupTable.counter, params : { + Bugzilla_api_token: BUGZILLA.api_token, product : product_name, summary : summary_field.value, limit : 7, @@ -118,3 +119,125 @@ YAHOO.bugzilla.dupTable = { [dt, data.product_name]); } }; + +function set_assign_to(use_qa_contact) { + // Based on the selected component, fill the "Assign To:" field + // with the default component owner, and the "QA Contact:" field + // with the default QA Contact. It also selectively enables flags. + var form = document.Create; + var assigned_to = form.assigned_to.value; + + if (use_qa_contact) { + var qa_contact = form.qa_contact.value; + } + + var index = -1; + if (form.component.type == 'select-one') { + index = form.component.selectedIndex; + } else if (form.component.type == 'hidden') { + // Assume there is only one component in the list + index = 0; + } + if (index != -1) { + var owner = initialowners[index]; + var component = components[index]; + if (assigned_to == last_initialowner + || assigned_to == owner + || assigned_to == '') { + form.assigned_to.value = owner; + last_initialowner = owner; + } + + document.getElementById('initial_cc').innerHTML = initialccs[index]; + document.getElementById('comp_desc').innerHTML = comp_desc[index]; + + if (use_qa_contact) { + var contact = initialqacontacts[index]; + if (qa_contact == last_initialqacontact + || qa_contact == contact + || qa_contact == '') { + form.qa_contact.value = contact; + last_initialqacontact = contact; + } + } + + // We show or hide the available flags depending on the selected component. + var flag_rows = YAHOO.util.Dom.getElementsByClassName('bz_flag_type', 'tbody'); + for (var i = 0; i < flag_rows.length; i++) { + // Each flag table row should have one flag form select element + // We get the flag type id from the id attribute of the select. + var flag_select = YAHOO.util.Dom.getElementsByClassName('flag_select', + 'select', + flag_rows[i])[0]; + var type_id = flag_select.id.split('-')[1]; + var can_set = flag_select.options.length > 1 ? 1 : 0; + var show = 0; + // Loop through the allowed flag ids for the selected component + // and if we match, then show the row, otherwise hide the row. + for (var j = 0; j < flags[index].length; j++) { + if (flags[index][j] == type_id) { + show = 1; + break; + } + } + if (show && can_set) { + flag_select.disabled = false; + YAHOO.util.Dom.removeClass(flag_rows[i], 'bz_default_hidden'); + } else { + flag_select.disabled = true; + YAHOO.util.Dom.addClass(flag_rows[i], 'bz_default_hidden'); + } + } + } +} + +(function(){ + 'use strict'; + var JSON = YAHOO.lang.JSON; + + YAHOO.bugzilla.bugUserLastVisit = { + update: function(bug_id) { + var args = JSON.stringify({ + version: "1.1", + method: 'BugUserLastVisit.update', + params: { + Bugzilla_api_token: BUGZILLA.api_token, + ids: bug_id + } + }); + var callbacks = { + failure: function(res) { + if (console) + console.log("failed to update last visited: " + + res.responseText); + } + }; + + YAHOO.util.Connect.setDefaultPostHeader('application/json', true); + YAHOO.util.Connect.asyncRequest('POST', 'jsonrpc.cgi', callbacks, + args) + }, + + get: function(done) { + var args = JSON.stringify({ + version: "1.1", + method: 'BugUserLastVisit.get', + params: { + Bugzilla_api_token: BUGZILLA.api_token + } + }); + var callbacks = { + success: function(res) { done(JSON.parse(res.responseText)) }, + failure: function(res) { + if (console) + console.log("failed to get last visited: " + + res.responseText); + } + }; + + YAHOO.util.Connect.setDefaultPostHeader('application/json', true); + YAHOO.util.Connect.asyncRequest('POST', 'jsonrpc.cgi', callbacks, + args) + } + }; +})(); diff --git a/js/comment-tagging.js b/js/comment-tagging.js new file mode 100644 index 000000000..b6f02f00e --- /dev/null +++ b/js/comment-tagging.js @@ -0,0 +1,387 @@ +/* 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. */ + +var Dom = YAHOO.util.Dom; + +YAHOO.bugzilla.commentTagging = { + ctag_div : false, + ctag_add : false, + counter : 0, + min_len : 3, + max_len : 24, + tags_by_no: {}, + nos_by_tag: {}, + current_id: 0, + current_no: -1, + can_edit : false, + pending : {}, + + label : '', + min_len_error: '', + max_len_error: '', + + init : function(can_edit) { + this.can_edit = can_edit; + this.ctag_div = Dom.get('bz_ctag_div'); + this.ctag_add = Dom.get('bz_ctag_add'); + YAHOO.util.Event.on(this.ctag_add, 'keypress', this.onKeyPress); + YAHOO.util.Event.onDOMReady(function() { + YAHOO.bugzilla.commentTagging.updateCollapseControls(); + }); + if (!can_edit) return; + + var ds = new YAHOO.util.XHRDataSource("jsonrpc.cgi"); + ds.connTimeout = 30000; + ds.connMethodPost = true; + ds.connXhrMode = "cancelStaleRequests"; + ds.maxCacheEntries = 5; + ds.responseSchema = { + metaFields : { error: "error", jsonRpcId: "id"}, + resultsList : "result" + }; + + var ac = new YAHOO.widget.AutoComplete('bz_ctag_add', 'bz_ctag_autocomp', ds); + ac.maxResultsDisplayed = 7; + ac.generateRequest = function(query) { + query = YAHOO.lang.trim(query); + YAHOO.bugzilla.commentTagging.last_query = query; + YAHOO.bugzilla.commentTagging.counter = YAHOO.bugzilla.commentTagging.counter + 1; + YAHOO.util.Connect.setDefaultPostHeader('application/json', true); + return YAHOO.lang.JSON.stringify({ + version: "1.1", + method : "Bug.search_comment_tags", + id : YAHOO.bugzilla.commentTagging.counter, + params : { + Bugzilla_api_token: BUGZILLA.api_token, + query : query, + limit : 10 + } + }); + }; + ac.minQueryLength = this.min_len; + ac.autoHighlight = false; + ac.typeAhead = true; + ac.queryDelay = 0.5; + ac.dataReturnEvent.subscribe(function(type, args) { + args[0].autoHighlight = args[2].length == 1; + }); + }, + + toggle : function(comment_id, comment_no) { + if (!this.ctag_div) return; + var tags_container = Dom.get('ct_' + comment_no); + + if (this.current_id == comment_id) { + // hide + this.current_id = 0; + this.current_no = -1; + Dom.addClass(this.ctag_div, 'bz_default_hidden'); + this.hideError(); + window.focus(); + + } else { + // show or move + this.rpcRefresh(comment_id, comment_no); + this.current_id = comment_id; + this.current_no = comment_no; + this.ctag_add.value = ''; + tags_container.parentNode.insertBefore(this.ctag_div, tags_container); + Dom.removeClass(this.ctag_div, 'bz_default_hidden'); + Dom.removeClass(tags_container, 'bz_default_hidden'); + var comment = Dom.get('comment_text_' + comment_no); + if (Dom.hasClass(comment, 'collapsed')) { + var link = Dom.get('comment_link_' + comment_no); + expand_comment(link, comment, comment_no); + } + window.setTimeout(function() { + YAHOO.bugzilla.commentTagging.ctag_add.focus(); + }, 50); + } + }, + + hideInput : function() { + if (this.current_id != 0) { + this.toggle(this.current_id, this.current_no); + } + this.hideError(); + }, + + showError : function(comment_id, comment_no, error) { + var bz_ctag_error = Dom.get('bz_ctag_error'); + var tags_container = Dom.get('ct_' + comment_no); + tags_container.parentNode.appendChild(bz_ctag_error, tags_container); + Dom.get('bz_ctag_error_msg').innerHTML = YAHOO.lang.escapeHTML(error); + Dom.removeClass(bz_ctag_error, 'bz_default_hidden'); + }, + + hideError : function() { + Dom.addClass('bz_ctag_error', 'bz_default_hidden'); + }, + + onKeyPress : function(evt) { + evt = evt || window.event; + var charCode = evt.charCode || evt.keyCode; + if (evt.keyCode == 27) { + // escape + YAHOO.bugzilla.commentTagging.hideInput(); + YAHOO.util.Event.stopEvent(evt); + + } else if (evt.keyCode == 13) { + // return + YAHOO.util.Event.stopEvent(evt); + var tags = YAHOO.bugzilla.commentTagging.ctag_add.value.split(/[ ,]/); + var comment_id = YAHOO.bugzilla.commentTagging.current_id; + var comment_no = YAHOO.bugzilla.commentTagging.current_no; + YAHOO.bugzilla.commentTagging.hideInput(); + try { + YAHOO.bugzilla.commentTagging.add(comment_id, comment_no, tags); + } catch(e) { + YAHOO.bugzilla.commentTagging.showError(comment_id, comment_no, e.message); + } + } + }, + + showTags : function(comment_id, comment_no, tags) { + // remove existing tags + var tags_container = Dom.get('ct_' + comment_no); + while (tags_container.hasChildNodes()) { + tags_container.removeChild(tags_container.lastChild); + } + // add tags + if (tags != '') { + if (typeof(tags) == 'string') { + tags = tags.split(','); + } + for (var i = 0, l = tags.length; i < l; i++) { + tags_container.appendChild(this.buildTagHtml(comment_id, comment_no, tags[i])); + } + } + // update tracking array + this.tags_by_no['c' + comment_no] = tags; + this.updateCollapseControls(); + }, + + updateCollapseControls : function() { + var container = Dom.get('comment_tags_collapse_expand_container'); + if (!container) return; + // build list of tags + this.nos_by_tag = {}; + for (var id in this.tags_by_no) { + if (this.tags_by_no.hasOwnProperty(id)) { + for (var i = 0, l = this.tags_by_no[id].length; i < l; i++) { + var tag = this.tags_by_no[id][i].toLowerCase(); + if (!this.nos_by_tag.hasOwnProperty(tag)) { + this.nos_by_tag[tag] = []; + } + this.nos_by_tag[tag].push(id); + } + } + } + var tags = []; + for (var tag in this.nos_by_tag) { + if (this.nos_by_tag.hasOwnProperty(tag)) { + tags.push(tag); + } + } + tags.sort(); + if (tags.length) { + var div = document.createElement('div'); + div.appendChild(document.createTextNode(this.label)); + var ul = document.createElement('ul'); + ul.id = 'comment_tags_collapse_expand'; + div.appendChild(ul); + for (var i = 0, l = tags.length; i < l; i++) { + var tag = tags[i]; + var li = document.createElement('li'); + ul.appendChild(li); + var a = document.createElement('a'); + li.appendChild(a); + Dom.setAttribute(a, 'href', '#'); + YAHOO.util.Event.addListener(a, 'click', function(evt, tag) { + YAHOO.bugzilla.commentTagging.toggleCollapse(tag); + YAHOO.util.Event.stopEvent(evt); + }, tag); + li.appendChild(document.createTextNode(' (' + this.nos_by_tag[tag].length + ')')); + a.innerHTML = YAHOO.lang.escapeHTML(tag); + } + while (container.hasChildNodes()) { + container.removeChild(container.lastChild); + } + container.appendChild(div); + } else { + while (container.hasChildNodes()) { + container.removeChild(container.lastChild); + } + } + }, + + toggleCollapse : function(tag) { + var nos = this.nos_by_tag[tag]; + if (!nos) return; + toggle_all_comments('collapse'); + for (var i = 0, l = nos.length; i < l; i++) { + var comment_no = nos[i].match(/\d+$/)[0]; + var comment = Dom.get('comment_text_' + comment_no); + var link = Dom.get('comment_link_' + comment_no); + expand_comment(link, comment, comment_no); + } + }, + + buildTagHtml : function(comment_id, comment_no, tag) { + var el = document.createElement('span'); + Dom.setAttribute(el, 'id', 'ct_' + comment_no + '_' + tag); + Dom.addClass(el, 'bz_comment_tag'); + if (this.can_edit) { + var a = document.createElement('a'); + Dom.setAttribute(a, 'href', '#'); + YAHOO.util.Event.addListener(a, 'click', function(evt, args) { + YAHOO.bugzilla.commentTagging.remove(args[0], args[1], args[2]) + YAHOO.util.Event.stopEvent(evt); + }, [comment_id, comment_no, tag]); + a.appendChild(document.createTextNode('x')); + el.appendChild(a); + el.appendChild(document.createTextNode("\u00a0")); + } + el.appendChild(document.createTextNode(tag)); + return el; + }, + + add : function(comment_id, comment_no, add_tags) { + // build list of current tags from html + var tags = new Array(); + var spans = Dom.getElementsByClassName('bz_comment_tag', undefined, 'ct_' + comment_no); + for (var i = 0, l = spans.length; i < l; i++) { + tags.push(spans[i].textContent.substr(2)); + } + // add new tags + var new_tags = new Array(); + for (var i = 0, l = add_tags.length; i < l; i++) { + var tag = YAHOO.lang.trim(add_tags[i]); + // validation + if (tag == '') + continue; + if (tag.length < YAHOO.bugzilla.commentTagging.min_len) + throw new Error(this.min_len_error) + if (tag.length > YAHOO.bugzilla.commentTagging.max_len) + throw new Error(this.max_len_error) + // append new tag + if (bz_isValueInArrayIgnoreCase(tags, tag)) + continue; + new_tags.push(tag); + tags.push(tag); + } + tags.sort(); + // update + this.showTags(comment_id, comment_no, tags); + this.rpcUpdate(comment_id, comment_no, new_tags, undefined); + }, + + remove : function(comment_id, comment_no, tag) { + var el = Dom.get('ct_' + comment_no + '_' + tag); + if (el) { + el.parentNode.removeChild(el); + this.rpcUpdate(comment_id, comment_no, undefined, [ tag ]); + } + }, + + // If multiple updates are triggered quickly, overlapping refresh events + // are generated. We ignore all events except the last one. + incPending : function(comment_id) { + if (this.pending['c' + comment_id] == undefined) { + this.pending['c' + comment_id] = 1; + } else { + this.pending['c' + comment_id]++; + } + }, + + decPending : function(comment_id) { + if (this.pending['c' + comment_id] != undefined) + this.pending['c' + comment_id]--; + }, + + hasPending : function(comment_id) { + return this.pending['c' + comment_id] != undefined + && this.pending['c' + comment_id] > 0; + }, + + rpcRefresh : function(comment_id, comment_no, noRefreshOnError) { + this.incPending(comment_id); + YAHOO.util.Connect.setDefaultPostHeader('application/json', true); + YAHOO.util.Connect.asyncRequest('POST', 'jsonrpc.cgi', + { + success: function(res) { + YAHOO.bugzilla.commentTagging.decPending(comment_id); + data = YAHOO.lang.JSON.parse(res.responseText); + if (data.error) { + YAHOO.bugzilla.commentTagging.handleRpcError( + comment_id, comment_no, data.error.message, noRefreshOnError); + return; + } + + if (!YAHOO.bugzilla.commentTagging.hasPending(comment_id)) + YAHOO.bugzilla.commentTagging.showTags( + comment_id, comment_no, data.result.comments[comment_id].tags); + }, + failure: function(res) { + YAHOO.bugzilla.commentTagging.decPending(comment_id); + YAHOO.bugzilla.commentTagging.handleRpcError( + comment_id, comment_no, res.responseText, noRefreshOnError); + } + }, + YAHOO.lang.JSON.stringify({ + version: "1.1", + method: 'Bug.comments', + params: { + Bugzilla_api_token: BUGZILLA.api_token, + comment_ids: [ comment_id ], + include_fields: [ 'tags' ] + } + }) + ); + }, + + rpcUpdate : function(comment_id, comment_no, add, remove) { + this.incPending(comment_id); + YAHOO.util.Connect.setDefaultPostHeader('application/json', true); + YAHOO.util.Connect.asyncRequest('POST', 'jsonrpc.cgi', + { + success: function(res) { + YAHOO.bugzilla.commentTagging.decPending(comment_id); + data = YAHOO.lang.JSON.parse(res.responseText); + if (data.error) { + YAHOO.bugzilla.commentTagging.handleRpcError(comment_id, comment_no, data.error.message); + return; + } + + if (!YAHOO.bugzilla.commentTagging.hasPending(comment_id)) + YAHOO.bugzilla.commentTagging.showTags(comment_id, comment_no, data.result); + }, + failure: function(res) { + YAHOO.bugzilla.commentTagging.decPending(comment_id); + YAHOO.bugzilla.commentTagging.handleRpcError(comment_id, comment_no, res.responseText); + } + }, + YAHOO.lang.JSON.stringify({ + version: "1.1", + method: 'Bug.update_comment_tags', + params: { + Bugzilla_api_token: BUGZILLA.api_token, + comment_id: comment_id, + add: add, + remove: remove + } + }) + ); + }, + + handleRpcError : function(comment_id, comment_no, message, noRefreshOnError) { + YAHOO.bugzilla.commentTagging.showError(comment_id, comment_no, message); + if (!noRefreshOnError) { + YAHOO.bugzilla.commentTagging.rpcRefresh(comment_id, comment_no, true); + } + } +} diff --git a/js/comments.js b/js/comments.js index acf5dbf9b..43e6fe96e 100644 --- a/js/comments.js +++ b/js/comments.js @@ -23,11 +23,11 @@ function updateCommentPrivacy(checkbox, id) { function toggle_comment_display(link, comment_id) { var comment = document.getElementById('comment_text_' + comment_id); - var re = new RegExp(/\bcollapsed\b/); - if (comment.className.match(re)) - expand_comment(link, comment); - else - collapse_comment(link, comment); + if (YAHOO.util.Dom.hasClass(comment, 'collapsed')) { + expand_comment(link, comment, comment_id); + } else { + collapse_comment(link, comment, comment_id); + } } function toggle_all_comments(action) { @@ -40,24 +40,31 @@ function toggle_all_comments(action) { var comment = comments[i]; if (!comment) continue; - - var id = comments[i].id.match(/\d*$/); + var id = comment.id.match(/^comment_text_(\d*)$/); + if (!id) + continue; + id = id[1]; var link = document.getElementById('comment_link_' + id); - if (action == 'collapse') - collapse_comment(link, comment); - else - expand_comment(link, comment); + if (action == 'collapse') { + collapse_comment(link, comment, id); + } else { + expand_comment(link, comment, id); + } } } -function collapse_comment(link, comment) { +function collapse_comment(link, comment, comment_id) { link.innerHTML = "[+]"; YAHOO.util.Dom.addClass(comment, 'collapsed'); + YAHOO.util.Dom.addClass('comment_tag_' + comment_id, 'collapsed'); } -function expand_comment(link, comment) { +function expand_comment(link, comment, comment_id) { link.innerHTML = "[−]"; + YAHOO.util.Dom.addClass('cr' + comment_id, 'collapsed'); + YAHOO.util.Dom.removeClass('c' + comment_id, 'bz_default_collapsed'); YAHOO.util.Dom.removeClass(comment, 'collapsed'); + YAHOO.util.Dom.removeClass('comment_tag_' + comment_id, 'collapsed'); } function wrapReplyText(text) { @@ -110,11 +117,12 @@ function wrapReplyText(text) { /* This way, we are sure that browsers which do not support JS * won't display this link */ -function addCollapseLink(count, title) { +function addCollapseLink(count, collapsed, title) { document.write(' <a href="#" class="bz_collapse_comment"' + ' id="comment_link_' + count + '" onclick="toggle_comment_display(this, ' + count + - '); return false;" title="' + title + '">[−]<\/a> '); + '); return false;" title="' + title + '">[' + + (collapsed ? '+' : '−') + ']<\/a> '); } function goto_add_comments( anchor ){ diff --git a/js/field.js b/js/field.js index 356c0cd5a..2193c40eb 100644 --- a/js/field.js +++ b/js/field.js @@ -42,7 +42,7 @@ function validateEnterBug(theform) { // These are checked in the reverse order that they appear on the page, // so that the one closest to the top of the form will be focused. - if (attach_data.value && YAHOO.lang.trim(attach_desc.value) == '') { + if (attach_data && attach_data.value && YAHOO.lang.trim(attach_desc.value) == '') { _errorFor(attach_desc, 'attach_desc'); focus_me = attach_desc; } @@ -218,14 +218,14 @@ function setupEditLink(id) { } /* Hide input/select fields and show the text with (edit) next to it */ -function hideEditableField( container, input, action, field_id, original_value, new_value ) { +function hideEditableField( container, input, action, field_id, original_value, new_value, hide_input ) { YAHOO.util.Dom.removeClass(container, 'bz_default_hidden'); YAHOO.util.Dom.addClass(input, 'bz_default_hidden'); YAHOO.util.Event.addListener(action, 'click', showEditableField, new Array(container, input, field_id, new_value)); if(field_id != ""){ YAHOO.util.Event.addListener(window, 'load', checkForChangedFieldValues, - new Array(container, input, field_id, original_value)); + new Array(container, input, field_id, original_value, hide_input )); } } @@ -273,7 +273,7 @@ function showEditableField (e, ContainerInputArray) { } // focus on the first field, this makes it easier to edit inputs[0].focus(); - if ( type == "input" ) { + if ( type == "input" || type == "textarea" ) { inputs[0].select(); } } @@ -297,8 +297,10 @@ function checkForChangedFieldValues(e, ContainerInputArray ) { var el = document.getElementById(ContainerInputArray[2]); var unhide = false; if ( el ) { - if ( el.value != ContainerInputArray[3] || - ( el.value == "" && el.id != "alias" && el.id != 'qa_contact') ) { + if ( !ContainerInputArray[4] + && (el.value != ContainerInputArray[3] + || (el.value == "" && el.id != "qa_contact")) ) + { unhide = true; } else { @@ -307,7 +309,7 @@ function checkForChangedFieldValues(e, ContainerInputArray ) { if ( set_default ) { if(set_default.checked){ unhide = true; - } + } } } } @@ -318,17 +320,6 @@ function checkForChangedFieldValues(e, ContainerInputArray ) { } -function hideAliasAndSummary(short_desc_value, alias_value) { - // check the short desc field - hideEditableField( 'summary_alias_container','summary_alias_input', - 'editme_action','short_desc', short_desc_value); - // check that the alias hasn't changed - var bz_alias_check_array = new Array('summary_alias_container', - 'summary_alias_input', 'alias', alias_value); - YAHOO.util.Event.addListener( window, 'load', checkForChangedFieldValues, - bz_alias_check_array); -} - function showPeopleOnChange( field_id_list ) { for(var i = 0; i < field_id_list.length; i++) { YAHOO.util.Event.addListener( field_id_list[i],'change', showEditableField, @@ -827,6 +818,7 @@ YAHOO.bugzilla.userAutocomplete = { method : "User.get", id : YAHOO.bugzilla.userAutocomplete.counter, params : [ { + Bugzilla_api_token: BUGZILLA.api_token, match : [ decodeURIComponent(enteredText) ], include_fields : [ "name", "real_name" ] } ] @@ -985,3 +977,104 @@ function initDirtyFieldTracking() { }); } } + +/** + * Comment preview + */ + +var last_comment_text = ''; + +function show_comment_preview(bug_id) { + var Dom = YAHOO.util.Dom; + var comment = document.getElementById('comment'); + var preview = document.getElementById('comment_preview'); + + if (!comment || !preview) return; + if (Dom.hasClass('comment_preview_tab', 'active_comment_tab')) return; + + preview.style.width = (comment.clientWidth - 4) + 'px'; + preview.style.height = comment.offsetHeight + 'px'; + + var comment_tab = document.getElementById('comment_tab'); + Dom.addClass(comment, 'bz_default_hidden'); + Dom.removeClass(comment_tab, 'active_comment_tab'); + comment_tab.setAttribute('aria-selected', 'false'); + + var preview_tab = document.getElementById('comment_preview_tab'); + Dom.removeClass(preview, 'bz_default_hidden'); + Dom.addClass(preview_tab, 'active_comment_tab'); + preview_tab.setAttribute('aria-selected', 'true'); + + Dom.addClass('comment_preview_error', 'bz_default_hidden'); + + if (last_comment_text == comment.value) + return; + + Dom.addClass('comment_preview_text', 'bz_default_hidden'); + Dom.removeClass('comment_preview_loading', 'bz_default_hidden'); + + YAHOO.util.Connect.setDefaultPostHeader('application/json', true); + YAHOO.util.Connect.asyncRequest('POST', 'jsonrpc.cgi', + { + success: function(res) { + data = YAHOO.lang.JSON.parse(res.responseText); + if (data.error) { + Dom.addClass('comment_preview_loading', 'bz_default_hidden'); + Dom.removeClass('comment_preview_error', 'bz_default_hidden'); + Dom.get('comment_preview_error').innerHTML = + YAHOO.lang.escapeHTML(data.error.message); + } else { + document.getElementById('comment_preview_text').innerHTML = data.result.html; + Dom.addClass('comment_preview_loading', 'bz_default_hidden'); + Dom.removeClass('comment_preview_text', 'bz_default_hidden'); + last_comment_text = comment.value; + } + }, + failure: function(res) { + Dom.addClass('comment_preview_loading', 'bz_default_hidden'); + Dom.removeClass('comment_preview_error', 'bz_default_hidden'); + Dom.get('comment_preview_error').innerHTML = + YAHOO.lang.escapeHTML(res.responseText); + } + }, + YAHOO.lang.JSON.stringify({ + version: "1.1", + method: 'Bug.render_comment', + params: { + Bugzilla_api_token: BUGZILLA.api_token, + id: bug_id, + text: comment.value + } + }) + ); +} + +function show_comment_edit() { + var comment = document.getElementById('comment'); + var preview = document.getElementById('comment_preview'); + if (!comment || !preview) return; + if (YAHOO.util.Dom.hasClass(comment, 'active_comment_tab')) return; + + var preview_tab = document.getElementById('comment_preview_tab'); + YAHOO.util.Dom.addClass(preview, 'bz_default_hidden'); + YAHOO.util.Dom.removeClass(preview_tab, 'active_comment_tab'); + preview_tab.setAttribute('aria-selected', 'false'); + + var comment_tab = document.getElementById('comment_tab'); + YAHOO.util.Dom.removeClass(comment, 'bz_default_hidden'); + YAHOO.util.Dom.addClass(comment_tab, 'active_comment_tab'); + comment_tab.setAttribute('aria-selected', 'true'); +} + +function adjustRemainingTime() { + // subtracts time spent from remaining time + // prevent negative values if work_time > bz_remaining_time + var new_time = Math.max(bz_remaining_time - document.changeform.work_time.value, 0.0); + // get upto 2 decimal places + document.changeform.remaining_time.value = Math.round(new_time * 100)/100; +} + +function updateRemainingTime() { + // if the remaining time is changed manually, update bz_remaining_time + bz_remaining_time = document.changeform.remaining_time.value; +} diff --git a/js/global.js b/js/global.js index 265ade46b..ea1a11dd3 100644 --- a/js/global.js +++ b/js/global.js @@ -6,8 +6,6 @@ * defined by the Mozilla Public License, v. 2.0. */ -var mini_login_constants; - function show_mini_login_form( suffix ) { var login_link = document.getElementById('login_link' + suffix); var login_form = document.getElementById('mini_login' + suffix); @@ -54,53 +52,6 @@ function hide_forgot_form( suffix ) { return false; } -function init_mini_login_form( suffix ) { - var mini_login = document.getElementById('Bugzilla_login' + suffix ); - var mini_password = document.getElementById('Bugzilla_password' + suffix ); - var mini_dummy = document.getElementById( - 'Bugzilla_password_dummy' + suffix); - // If the login and password are blank when the page loads, we display - // "login" and "password" in the boxes by default. - if (mini_login.value == "" && mini_password.value == "") { - mini_login.value = mini_login_constants.login; - YAHOO.util.Dom.addClass(mini_login, "bz_mini_login_help"); - YAHOO.util.Dom.addClass(mini_password, 'bz_default_hidden'); - YAHOO.util.Dom.removeClass(mini_dummy, 'bz_default_hidden'); - } - else { - show_mini_login_form(suffix); - } -} - -// Clear the words "login" and "password" from the form when you click -// in one of the boxes. We clear them both when you click in either box -// so that the browser's password-autocomplete can work. -function mini_login_on_focus( suffix ) { - var mini_login = document.getElementById('Bugzilla_login' + suffix ); - var mini_password = document.getElementById('Bugzilla_password' + suffix ); - var mini_dummy = document.getElementById( - 'Bugzilla_password_dummy' + suffix); - - YAHOO.util.Dom.removeClass(mini_login, "bz_mini_login_help"); - if (mini_login.value == mini_login_constants.login) { - mini_login.value = ''; - } - YAHOO.util.Dom.removeClass(mini_password, 'bz_default_hidden'); - YAHOO.util.Dom.addClass(mini_dummy, 'bz_default_hidden'); -} - -function check_mini_login_fields( suffix ) { - var mini_login = document.getElementById('Bugzilla_login' + suffix ); - var mini_password = document.getElementById('Bugzilla_password' + suffix ); - if( (mini_login.value != "" && mini_password.value != "") - && mini_login.value != mini_login_constants.login ) - { - return true; - } - window.alert( mini_login_constants.warning ); - return false; -} - function set_language( value ) { YAHOO.util.Cookie.set('LANG', value, { diff --git a/js/util.js b/js/util.js index 6d1f88938..d3a34477b 100644 --- a/js/util.js +++ b/js/util.js @@ -125,10 +125,7 @@ function bz_overlayBelow(item, parent) { */ function bz_isValueInArray(aArray, aValue) { - var run = 0; - var len = aArray.length; - - for ( ; run < len; run++) { + for (var run = 0, len = aArray.length ; run < len; run++) { if (aArray[run] == aValue) { return true; } @@ -138,6 +135,26 @@ function bz_isValueInArray(aArray, aValue) } /** + * Checks if a specified value is in the specified array by performing a + * case-insensitive comparison. + * + * @param aArray Array to search for the value. + * @param aValue Value to search from the array. + * @return Boolean; true if value is found in the array and false if not. + */ +function bz_isValueInArrayIgnoreCase(aArray, aValue) +{ + var re = new RegExp(aValue.replace(/([^A-Za-z0-9])/g, "\\$1"), 'i'); + for (var run = 0, len = aArray.length ; run < len; run++) { + if (aArray[run].match(re)) { + return true; + } + } + + return false; +} + +/** * Create wanted options in a select form control. * * @param aSelect Select form control to manipulate. diff --git a/jsonrpc.cgi b/jsonrpc.cgi index acafaa13b..2c93585b0 100755 --- a/jsonrpc.cgi +++ b/jsonrpc.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,10 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; + use lib qw(. lib); use Bugzilla; diff --git a/migrate.pl b/migrate.pl index de4265b0b..eb2a84b59 100755 --- a/migrate.pl +++ b/migrate.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl # 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/. @@ -6,7 +6,10 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; + use File::Basename; BEGIN { chdir dirname($0); } use lib qw(. lib); diff --git a/mod_perl.pl b/mod_perl.pl index 3f563417f..5c5ed82ff 100644 --- a/mod_perl.pl +++ b/mod_perl.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -7,6 +7,8 @@ # defined by the Mozilla Public License, v. 2.0. package Bugzilla::ModPerl; + +use 5.10.1; use strict; use warnings; @@ -108,9 +110,14 @@ foreach my $file (glob "$cgi_path/*.cgi") { } package Bugzilla::ModPerl::ResponseHandler; + +use 5.10.1; use strict; -use base qw(ModPerl::Registry); +use warnings; + +use parent qw(ModPerl::Registry); use Bugzilla; +use Bugzilla::Constants qw(USAGE_MODE_REST); sub handler : method { my $class = shift; @@ -128,12 +135,23 @@ sub handler : method { use warnings; Bugzilla::init_page(); - return $class->SUPER::handler(@_); + my $result = $class->SUPER::handler(@_); + + # When returning data from the REST api we must only return 200 or 304, + # which tells Apache not to append its error html documents to the + # response. + return Bugzilla->usage_mode == USAGE_MODE_REST && $result != 304 + ? Apache2::Const::OK + : $result; } package Bugzilla::ModPerl::CleanupHandler; + +use 5.10.1; use strict; +use warnings; + use Apache2::Const -compile => qw(OK); sub handler { @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -13,7 +13,9 @@ # a content-type, e.g. html. ############################################################################### +use 5.10.1; use strict; +use warnings; use lib qw(. lib); diff --git a/post_bug.cgi b/post_bug.cgi index 0a0f8562c..ca029c01a 100755 --- a/post_bug.cgi +++ b/post_bug.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,10 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; + use lib qw(. lib); use Bugzilla; @@ -17,14 +20,12 @@ use Bugzilla::Util; use Bugzilla::Error; use Bugzilla::Bug; use Bugzilla::User; -use Bugzilla::Field; use Bugzilla::Hook; -use Bugzilla::Product; -use Bugzilla::Component; -use Bugzilla::Keyword; use Bugzilla::Token; use Bugzilla::Flag; +use List::MoreUtils qw(uniq); + my $user = Bugzilla->login(LOGIN_REQUIRED); my $cgi = Bugzilla->cgi; @@ -63,8 +64,6 @@ if (defined $cgi->param('maketemplate')) { exit; } -umask 0; - # The format of the initial comment can be structured by adding fields to the # enter_bug template and then referencing them in the comment template. my $comment; @@ -104,7 +103,7 @@ push(@bug_fields, qw( version target_milestone status_whiteboard - + see_also estimated_time deadline )); @@ -210,12 +209,21 @@ my $bug_sent = Bugzilla::BugMail::Send($id, $recipients); $bug_sent->{type} = 'created'; $bug_sent->{id} = $id; my @all_mail_results = ($bug_sent); + foreach my $dep (@{$bug->dependson || []}, @{$bug->blocked || []}) { my $dep_sent = Bugzilla::BugMail::Send($dep, $recipients); $dep_sent->{type} = 'dep'; $dep_sent->{id} = $dep; push(@all_mail_results, $dep_sent); } + +# Sending emails for any referenced bugs. +foreach my $ref_bug_id (uniq @{ $bug->{see_also_changes} || [] }) { + my $ref_sent = Bugzilla::BugMail::Send($ref_bug_id, $recipients); + $ref_sent->{id} = $ref_bug_id; + push(@all_mail_results, $ref_sent); +} + $vars->{sentmail} = \@all_mail_results; $format = $template->get_format("bug/create/created", diff --git a/process_bug.cgi b/process_bug.cgi index e063c3db4..b3ed2d36a 100755 --- a/process_bug.cgi +++ b/process_bug.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,19 +6,9 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -# Implementation notes for this file: -# -# 1) the 'id' form parameter is validated early on, and if it is not a valid -# bugid an error will be reported, so it is OK for later code to simply check -# for a defined form 'id' value, and it can assume a valid bugid. -# -# 2) If the 'id' form parameter is not defined (after the initial validation), -# then we are processing multiple bugs, and @idlist will contain the ids. -# -# 3) If we are processing just the one id, then it is stored in @idlist for -# later processing. - +use 5.10.1; use strict; +use warnings; use lib qw(. lib); @@ -122,16 +112,14 @@ if ($delta_ts) { if ($first_delta_tz_z ne $delta_ts_z) { ($vars->{'operations'}) = $first_bug->get_activity(undef, $delta_ts); - my $start_at = $cgi->param('longdesclength') - or ThrowCodeError('undefined_field', { field => 'longdesclength' }); - # Always sort midair collision comments oldest to newest, # regardless of the user's personal preference. - my $comments = $first_bug->comments({ order => "oldest_to_newest" }); + my $comments = $first_bug->comments({ order => 'oldest_to_newest', + after => $delta_ts }); # Show midair if previous changes made other than CC # and/or one or more comments were made - my $do_midair = scalar @$comments > $start_at ? 1 : 0; + my $do_midair = scalar @$comments ? 1 : 0; if (!$do_midair) { foreach my $operation (@{ $vars->{'operations'} }) { @@ -147,7 +135,6 @@ if ($delta_ts) { if ($do_midair) { $vars->{'title_tag'} = "mid_air"; - $vars->{'start_at'} = $start_at; $vars->{'comments'} = $comments; $vars->{'bug'} = $first_bug; # The token contains the old delta_ts. We need a new one. @@ -215,9 +202,9 @@ my @set_fields = qw(op_sys rep_platform priority bug_severity bug_file_loc status_whiteboard short_desc deadline remaining_time estimated_time work_time set_default_assignee set_default_qa_contact - cclist_accessible reporter_accessible + cclist_accessible reporter_accessible product confirm_product_change - bug_status resolution dup_id); + bug_status resolution dup_id bug_ignored); push(@set_fields, 'assigned_to') if !$cgi->param('set_default_assignee'); push(@set_fields, 'qa_contact') if !$cgi->param('set_default_qa_contact'); my %field_translation = ( @@ -247,13 +234,13 @@ if (should_set('keywords')) { } if (should_set('comment')) { $set_all_fields{comment} = { - body => scalar $cgi->param('comment'), - is_private => scalar $cgi->param('comment_is_private'), + body => scalar $cgi->param('comment'), + is_private => scalar $cgi->param('comment_is_private'), }; } if (should_set('see_also')) { $set_all_fields{'see_also'}->{add} = - [split(/[\s,]+/, $cgi->param('see_also'))]; + [split(/[\s]+/, $cgi->param('see_also'))]; } if (should_set('remove_see_also')) { $set_all_fields{'see_also'}->{remove} = [$cgi->param('remove_see_also')]; @@ -302,8 +289,17 @@ if (defined $cgi->param('newcc') if (defined $cgi->param('id')) { # Since aliases are unique (like bug numbers), they can only be changed # for one bug at a time. - if (defined $cgi->param('alias')) { - $set_all_fields{alias} = $cgi->param('alias'); + if (defined $cgi->param('newalias') || defined $cgi->param('removealias')) { + my @alias_add = split /[, ]+/, $cgi->param('newalias'); + + # We came from bug_form which uses a select box to determine what + # aliases need to be removed... + my @alias_remove = (); + if ($cgi->param('removealias') && $cgi->param('alias')) { + @alias_remove = $cgi->param('alias'); + } + + $set_all_fields{alias} = { add => \@alias_add, remove => \@alias_remove }; } } @@ -358,6 +354,17 @@ if (defined $cgi->param('id')) { $first_bug->add_tag($_) foreach @$tags_added; } } +else { + # Update flags on multiple bugs. The cgi params are slightly different + # than on a single bug, so we need to call a different sub. We also + # need to call this per bug, since we might be updating a flag in one + # bug, but adding it to a second bug + foreach my $b (@bug_objects) { + my ($flags, $new_flags) + = Bugzilla::Flag->multi_extract_flags_from_cgi($b, $vars); + $b->set_flags($flags, $new_flags); + } +} ############################## # Do Actual Database Updates # @@ -399,6 +406,10 @@ elsif ($action eq 'next_bug' or $action eq 'same_bug') { if ($action eq 'next_bug') { $vars->{'nextbug'} = $bug->id; } + # For performance reasons, preload visibility of dependencies + # and duplicates related to this bug. + Bugzilla::Bug->preload([$bug]); + $template->process("bug/show.html.tmpl", $vars) || ThrowTemplateError($template->error()); exit; @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,20 +6,24 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; + use lib qw(. lib); use Bugzilla; use Bugzilla::Bug; use Bugzilla::Constants; use Bugzilla::Search; +use Bugzilla::Search::Saved; use Bugzilla::User; use Bugzilla::Util; use Bugzilla::Error; use Bugzilla::Product; +use Bugzilla::Version; use Bugzilla::Keyword; use Bugzilla::Field; -use Bugzilla::Install::Util qw(vers_cmp); use Bugzilla::Token; ############### @@ -75,9 +79,11 @@ if ($cgi->param('nukedefaultquery')) { if ($userid) { my $token = $cgi->param('token'); check_hash_token($token, ['nukedefaultquery']); - $dbh->do("DELETE FROM namedqueries" . - " WHERE userid = ? AND name = ?", - undef, ($userid, DEFAULT_QUERY_NAME)); + my $named_queries = Bugzilla::Search::Saved->match( + { userid => $userid, name => DEFAULT_QUERY_NAME }); + if (@$named_queries) { + $named_queries->[0]->remove_from_db(); + } } $buffer = ""; } @@ -189,9 +195,9 @@ foreach my $val (editable_bug_fields()) { if ($user->is_timetracker) { push @chfields, "work_time"; } else { - @chfields = grep($_ ne "deadline", @chfields); - @chfields = grep($_ ne "estimated_time", @chfields); - @chfields = grep($_ ne "remaining_time", @chfields); + foreach my $tt_field (TIMETRACKING_FIELDS) { + @chfields = grep($_ ne $tt_field, @chfields); + } } @chfields = (sort(@chfields)); $vars->{'chfield'} = \@chfields; @@ -205,13 +211,27 @@ $vars->{'resolution'} = Bugzilla::Field->new({name => 'resolution'})->legal_valu # Boolean charts my @fields = @{ Bugzilla->fields({ obsolete => 0 }) }; +my %exclude_fields = (); + # If we're not in the time-tracking group, exclude time-tracking fields. if (!$user->is_timetracker) { foreach my $tt_field (TIMETRACKING_FIELDS) { - @fields = grep($_->name ne $tt_field, @fields); + $exclude_fields{$tt_field} = 1; } } +# Exclude fields turned off by params +my %param_controlled_fields = ('useqacontact' => 'qa_contact', + 'usetargetmilestone' => 'target_milestone', + 'useclassification' => 'classification', + 'usestatuswhiteboard' => 'status_whiteboard'); + +while (my ($param, $field) = each %param_controlled_fields) { + $exclude_fields{$field} = 1 unless Bugzilla->params->{$param}; +} + +@fields = grep(!$exclude_fields{$_->name}, @fields); + @fields = sort {lc($a->description) cmp lc($b->description)} @fields; unshift(@fields, { name => "noop", description => "---" }); $vars->{'fields'} = \@fields; @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,9 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; use lib qw(. lib); @@ -75,6 +77,7 @@ if ($action eq "add") { undef, ($user->id, $comment, $approved)); $vars->{'added_quip'} = $comment; + $vars->{'message'} = 'quips_added'; } if ($action eq 'approve') { @@ -115,6 +118,7 @@ if ($action eq 'approve') { join(",", @unapproved) . ")") if($#unapproved > -1); $vars->{ 'approved' } = \@approved; $vars->{ 'unapproved' } = \@unapproved; + $vars->{'message'} = 'quips_approved_unapproved'; } if ($action eq "delete") { @@ -130,6 +134,7 @@ if ($action eq "delete") { "SELECT quip FROM quips WHERE quipid = ?", undef, $quipid); $dbh->do("DELETE FROM quips WHERE quipid = ?", undef, $quipid); + $vars->{'message'} = 'quips_deleted'; } print $cgi->header(); diff --git a/relogin.cgi b/relogin.cgi index b86463bb8..c4aae8d0b 100755 --- a/relogin.cgi +++ b/relogin.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,10 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; + use lib qw(. lib); use Bugzilla; diff --git a/report.cgi b/report.cgi index f4f015b92..2a8317d7a 100755 --- a/report.cgi +++ b/report.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,10 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; + use lib qw(. lib); use Bugzilla; @@ -184,20 +187,64 @@ my $col_isnumeric = 1; my $row_isnumeric = 1; my $tbl_isnumeric = 1; +# define which fields are multiselect +my @multi_selects = map { $_->name } @{Bugzilla->fields( + { + obsolete => 0, + type => [FIELD_TYPE_MULTI_SELECT, FIELD_TYPE_KEYWORDS] + } +)}; +my $col_ismultiselect = scalar grep {$col_field eq $_} @multi_selects; +my $row_ismultiselect = scalar grep {$row_field eq $_} @multi_selects; +my $tbl_ismultiselect = scalar grep {$tbl_field eq $_} @multi_selects; + + foreach my $result (@$results) { # handle empty dimension member names - my $row = check_value($row_field, $result); - my $col = check_value($col_field, $result); - my $tbl = check_value($tbl_field, $result); - - $data{$tbl}{$col}{$row}++; - $names{"col"}{$col}++; - $names{"row"}{$row}++; - $names{"tbl"}{$tbl}++; - $col_isnumeric &&= ($col =~ /^-?\d+(\.\d+)?$/o); - $row_isnumeric &&= ($row =~ /^-?\d+(\.\d+)?$/o); - $tbl_isnumeric &&= ($tbl =~ /^-?\d+(\.\d+)?$/o); + my @rows = check_value($row_field, $result, $row_ismultiselect); + my @cols = check_value($col_field, $result, $col_ismultiselect); + my @tbls = check_value($tbl_field, $result, $tbl_ismultiselect); + + my %in_total_row; + my %in_total_col; + for my $tbl (@tbls) { + my %in_row_total; + for my $col (@cols) { + for my $row (@rows) { + $data{$tbl}{$col}{$row}++; + $names{"row"}{$row}++; + $row_isnumeric &&= ($row =~ /^-?\d+(\.\d+)?$/o); + if ($formatparam eq "table") { + if (!$in_row_total{$row}) { + $data{$tbl}{'-total-'}{$row}++; + $in_row_total{$row} = 1; + } + if (!$in_total_row{$row}) { + $data{'-total-'}{'-total-'}{$row}++; + $in_total_row{$row} = 1; + } + } + } + if ($formatparam eq "table") { + $data{$tbl}{$col}{'-total-'}++; + if (!$in_total_col{$col}) { + $data{'-total-'}{$col}{'-total-'}++; + $in_total_col{$col} = 1; + } + } + $names{"col"}{$col}++; + $col_isnumeric &&= ($col =~ /^-?\d+(\.\d+)?$/o); + } + $names{"tbl"}{$tbl}++; + $tbl_isnumeric &&= ($tbl =~ /^-?\d+(\.\d+)?$/o); + if ($formatparam eq "table") { + $data{$tbl}{'-total-'}{'-total-'}++; + } + } + if ($formatparam eq "table") { + $data{'-total-'}{'-total-'}{'-total-'}++; + } } my @col_names = get_names($names{"col"}, $col_isnumeric, $col_field); @@ -241,6 +288,7 @@ $vars->{'time'} = localtime(time()); $vars->{'col_names'} = \@col_names; $vars->{'row_names'} = \@row_names; $vars->{'tbl_names'} = \@tbl_names; +$vars->{'note_multi_select'} = $row_ismultiselect || $col_ismultiselect; # Below a certain width, we don't see any bars, so there needs to be a minimum. if ($formatparam eq "bar") { @@ -313,11 +361,8 @@ my $format = $template->get_format("reports/report", $formatparam, # set debug=1 to always get an HTML content-type, and view the error. $format->{'ctype'} = "text/html" if $cgi->param('debug'); -my @time = localtime(time()); -my $date = sprintf "%04d-%02d-%02d", 1900+$time[5],$time[4]+1,$time[3]; -my $filename = "report-$date.$format->{extension}"; -print $cgi->header(-type => $format->{'ctype'}, - -content_disposition => "inline; filename=$filename"); +$cgi->set_dated_content_disp("inline", "report", $format->{extension}); +print $cgi->header($format->{'ctype'}); # Problems with this CGI are often due to malformed data. Setting debug=1 # prints out both data structures. @@ -330,7 +375,7 @@ if ($cgi->param('debug')) { } # All formats point to the same section of the documentation. -$vars->{'doc_section'} = 'reporting.html#reports'; +$vars->{'doc_section'} = 'using/reports-and-charts.html#reports'; disable_utf8() if ($format->{'ctype'} =~ /^image\//); @@ -354,7 +399,8 @@ sub get_names { foreach my $value (@{$field->legal_values}) { push(@sorted, $value->name) if $names->{$value->name}; } - unshift(@sorted, '---') if $field_name eq 'resolution'; + unshift(@sorted, '---') if ($field_name eq 'resolution' + || $field->type == FIELD_TYPE_MULTI_SELECT); @sorted = uniq @sorted; } elsif ($isnumeric) { @@ -371,7 +417,7 @@ sub get_names { } sub check_value { - my ($field, $result) = @_; + my ($field, $result, $ismultiselect) = @_; my $value; if (!defined $field) { @@ -383,9 +429,15 @@ sub check_value { else { $value = shift @$result; $value = ' ' if (!defined $value || $value eq ''); - $value = '---' if ($field eq 'resolution' && $value eq ' '); + $value = '---' if (($field eq 'resolution' || $ismultiselect ) && + $value eq ' '); + } + if ($ismultiselect) { + # Some DB servers have a space after the comma, some others don't. + return split(/, ?/, $value); + } else { + return ($value); } - return $value; } sub get_field_restrictions { diff --git a/reports.cgi b/reports.cgi index 7b7c59478..89dee1c9a 100755 --- a/reports.cgi +++ b/reports.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,9 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; use lib qw(. lib); @@ -26,6 +28,10 @@ my $cgi = Bugzilla->cgi; my $template = Bugzilla->template; my $vars = {}; +# We use a dummy product instance with ID 0, representing all products +my $product_all = {id => 0}; +bless($product_all, 'Bugzilla::Product'); + if (!Bugzilla->feature('old_charts')) { ThrowUserError('feature_disabled', { feature => 'old_charts' }); } @@ -33,11 +39,11 @@ if (!Bugzilla->feature('old_charts')) { my $dir = bz_locations()->{'datadir'} . "/mining"; my $graph_dir = bz_locations()->{'graphsdir'}; my $graph_url = basename($graph_dir); -my $product_name = $cgi->param('product') || ''; +my $product_id = $cgi->param('product_id'); Bugzilla->switch_to_shadow_db(); -if (!$product_name) { +if (! defined($product_id)) { # Can we do bug charts? (-d $dir && -d $graph_dir) || ThrowCodeError('chart_dir_nonexistent', @@ -55,27 +61,26 @@ if (!$product_name) { push(@datasets, $datasets); } - # We only want those products that the user has permissions for. - my @myproducts = ('-All-'); - # Extract product names from objects and add them to the list. - push( @myproducts, map { $_->name } @{$user->get_selectable_products} ); - $vars->{'datasets'} = \@datasets; - $vars->{'products'} = \@myproducts; print $cgi->header(); } else { - # For security and correctness, validate the value of the "product" form variable. - # Valid values are those products for which the user has permissions which appear - # in the "product" drop-down menu on the report generation form. - my ($product) = grep { $_->name eq $product_name } @{$user->get_selectable_products}; - ($product || $product_name eq '-All-') - || ThrowUserError('invalid_product_name', {product => $product_name}); - - # Product names can change over time. Their ID cannot; so use the ID - # to generate the filename. - my $prod_id = $product ? $product->id : 0; + my $product; + # For security and correctness, validate the value of the "product_id" form + # variable. Valid values are IDs of those products for which the user has + # permissions which appear in the "product_id" drop-down menu on the report + # generation form. The product_id 0 is a special case, meaning "All + # Products". + if ($product_id) { + $product = Bugzilla::Product->new($product_id); + $product && $user->can_see_product($product->name) + || ThrowUserError('product_access_denied', + {id => $product_id}); + } + else { + $product = $product_all; + } # Make sure there is something to plot. my @datasets = $cgi->param('datasets'); @@ -87,9 +92,9 @@ else { # Filenames must not be guessable as they can point to products # you are not allowed to see. Also, different projects can have - # the same product names. + # the same product IDs. my $project = bz_locations()->{'project'} || ''; - my $image_file = join(':', ($project, $prod_id, @datasets)); + my $image_file = join(':', ($project, $product->id, @datasets)); my $key = Bugzilla->localconfig->{'site_wide_secret'}; $image_file = hmac_sha256_base64($image_file, $key) . '.png'; $image_file =~ s/\+/-/g; @@ -116,8 +121,8 @@ sub get_data { my $dir = shift; my @datasets; - open(DATA, '<', "$dir/-All-") - || ThrowCodeError('chart_file_open_fail', {filename => "$dir/-All-"}); + open(DATA, '<', "$dir/0") + || ThrowCodeError('chart_file_open_fail', {filename => "$dir/0"}); while (<DATA>) { if (/^# fields?: (.+)\s*$/) { @@ -131,18 +136,13 @@ sub get_data { sub generate_chart { my ($dir, $image_file, $product, $datasets) = @_; - $product = $product ? $product->name : '-All-'; - my $data_file = $product; - $data_file =~ s/\//-/gs; - $data_file = $dir . '/' . $data_file; + my $data_file = $dir . '/' . $product->id; if (!open(FILE, '<', $data_file)) { - if ($product eq '-All-') { - $product = ''; - } ThrowCodeError('chart_data_not_generated', {'product' => $product}); } + my $product_in_title = $product->id ? $product->name : 'All Products'; my @fields; my @labels = qw(DATE); my %datasets = map { $_ => 1 } @$datasets; @@ -205,7 +205,7 @@ sub generate_chart { my %settings = ( - "title" => "Status Counts for $product", + "title" => "Status Counts for $product_in_title", "x_label" => "Dates", "y_label" => "Bug Counts", "legend_labels" => \@labels, diff --git a/request.cgi b/request.cgi index bbed1c79b..566781a0c 100755 --- a/request.cgi +++ b/request.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,12 +6,9 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -################################################################################ -# Script Initialization -################################################################################ - -# Make it harder for us to do dangerous things in Perl. +use 5.10.1; use strict; +use warnings; use lib qw(. lib); @@ -31,16 +28,16 @@ my $cgi = Bugzilla->cgi; Bugzilla->switch_to_shadow_db; my $template = Bugzilla->template; my $action = $cgi->param('action') || ''; +my $format = $template->get_format('request/queue', + scalar($cgi->param('format')), + scalar($cgi->param('ctype'))); -print $cgi->header(); - -################################################################################ -# Main Body Execution -################################################################################ +$cgi->set_dated_content_disp("inline", "requests", $format->{extension}); +print $cgi->header($format->{'ctype'}); my $fields; $fields->{'requester'}->{'type'} = 'single'; -# If the user doesn't restrict his search to requests from the wind +# If the user doesn't restrict their search to requests from the wind # (requestee ne '-'), include the requestee for completion. unless (defined $cgi->param('requestee') && $cgi->param('requestee') eq '-') @@ -51,7 +48,7 @@ unless (defined $cgi->param('requestee') Bugzilla::User::match_field($fields); if ($action eq 'queue') { - queue(); + queue($format); } else { my $flagtypes = get_flag_types(); @@ -69,7 +66,7 @@ else { } $vars->{'components'} = [ sort { $a cmp $b } keys %components ]; - $template->process('request/queue.html.tmpl', $vars) + $template->process($format->{'template'}, $vars) || ThrowTemplateError($template->error()); } exit; @@ -79,6 +76,7 @@ exit; ################################################################################ sub queue { + my $format = shift; my $cgi = Bugzilla->cgi; my $dbh = Bugzilla->dbh; my $template = Bugzilla->template; @@ -122,20 +120,27 @@ sub queue { ON bugs.product_id = products.id INNER JOIN components ON bugs.component_id = components.id - LEFT JOIN bug_group_map AS bgmap - ON bgmap.bug_id = bugs.bug_id - AND bgmap.group_id NOT IN (" . - $user->groups_as_string . ") LEFT JOIN bug_group_map AS privs ON privs.bug_id = bugs.bug_id LEFT JOIN cc AS ccmap ON ccmap.who = $userid AND ccmap.bug_id = bugs.bug_id - " . + LEFT JOIN bug_group_map AS bgmap + ON bgmap.bug_id = bugs.bug_id + "; + + if (Bugzilla->params->{or_groups}) { + $query .= " AND bgmap.group_id IN (" . $user->groups_as_string . ")"; + $query .= " WHERE (privs.group_id IS NULL OR bgmap.group_id IS NOT NULL OR"; + } + else { + $query .= " AND bgmap.group_id NOT IN (" . $user->groups_as_string . ")"; + $query .= " WHERE (bgmap.group_id IS NULL OR"; + } # Weed out bug the user does not have access to - " WHERE ((bgmap.group_id IS NULL) OR - (ccmap.who IS NOT NULL AND cclist_accessible = 1) OR + $query .= + " (ccmap.who IS NOT NULL AND cclist_accessible = 1) OR (bugs.reporter = $userid AND bugs.reporter_accessible = 1) OR (bugs.assigned_to = $userid) " . (Bugzilla->params->{'useqacontact'} ? "OR @@ -308,8 +313,10 @@ sub queue { } $vars->{'components'} = [ sort { $a cmp $b } keys %components ]; + $vars->{'urlquerypart'} = $cgi->canonicalise_query('ctype'); + # Generate and return the UI (HTML page) from the appropriate template. - $template->process("request/queue.html.tmpl", $vars) + $template->process($format->{'template'}, $vars) || ThrowTemplateError($template->error()); } diff --git a/rest.cgi b/rest.cgi new file mode 100755 index 000000000..f12fb64c4 --- /dev/null +++ b/rest.cgi @@ -0,0 +1,31 @@ +#!/usr/bin/perl -T +# 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. + +use 5.10.1; +use strict; +use warnings; + +use lib qw(. lib); + +use Bugzilla; +use Bugzilla::Constants; +use Bugzilla::Error; +use Bugzilla::WebService::Constants; +BEGIN { + if (!Bugzilla->feature('rest') + || !Bugzilla->feature('jsonrpc')) + { + ThrowUserError('feature_disabled', { feature => 'rest' }); + } +} +use Bugzilla::WebService::Server::REST; +Bugzilla->usage_mode(USAGE_MODE_REST); +local @INC = (bz_locations()->{extensionsdir}, @INC); +my $server = new Bugzilla::WebService::Server::REST; +$server->version('1.1'); +$server->handle(); diff --git a/runtests.pl b/runtests.pl index 09963e84e..52de88e10 100755 --- a/runtests.pl +++ b/runtests.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl # 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/. @@ -6,9 +6,11 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. -# Make it harder for us to do dangerous things in Perl. +use 5.10.1; use diagnostics; use strict; +use warnings; + use lib qw(lib); use Test::Harness qw(&runtests $verbose); diff --git a/sanitycheck.cgi b/sanitycheck.cgi index 0e6f7cc8d..889d7f3e6 100755 --- a/sanitycheck.cgi +++ b/sanitycheck.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,9 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; use lib qw(. lib); @@ -73,6 +75,7 @@ else { } } my $vars = {}; +my $clear_memcached = 0; print $cgi->header() unless Bugzilla->usage_mode == USAGE_MODE_CMDLINE; @@ -149,6 +152,7 @@ if ($cgi->param('createmissinggroupcontrolmapentries')) { } Status('group_control_map_entries_repaired', {counter => $counter}); + $clear_memcached = 1 if $counter; } ########################################################################### @@ -175,6 +179,7 @@ if ($cgi->param('repair_creation_date')) { $sth_UpdateDate->execute($date, $bugid); } Status('bug_creation_date_fixed', {bug_count => scalar(@$bug_ids)}); + $clear_memcached = 1 if @$bug_ids; } ########################################################################### @@ -191,6 +196,7 @@ if ($cgi->param('repair_everconfirmed')) { $dbh->do("UPDATE bugs SET everconfirmed = 1 WHERE bug_status IN ($confirmed_open_states)"); Status('everconfirmed_end'); + $clear_memcached = 1; } ########################################################################### @@ -206,11 +212,12 @@ if ($cgi->param('repair_bugs_fulltext')) { ON bugs_fulltext.bug_id = bugs.bug_id WHERE bugs_fulltext.bug_id IS NULL'); - foreach my $bugid (@$bug_ids) { - Bugzilla::Bug->new($bugid)->_sync_fulltext( new_bug => 1 ); - } + foreach my $bugid (@$bug_ids) { + Bugzilla::Bug->new($bugid)->_sync_fulltext( new_bug => 1 ); + } - Status('bugs_fulltext_fixed', {bug_count => scalar(@$bug_ids)}); + Status('bugs_fulltext_fixed', {bug_count => scalar(@$bug_ids)}); + $clear_memcached = 1 if @$bug_ids; } ########################################################################### @@ -246,7 +253,10 @@ if ($cgi->param('rescanallBugMail')) { Bugzilla::BugMail::Send($bugid, $vars); } - Status('send_bugmail_end') if scalar(@$list); + if (@$list) { + Status('send_bugmail_end'); + Bugzilla->memcached->clear_all(); + } unless (Bugzilla->usage_mode == USAGE_MODE_CMDLINE) { $template->process('global/footer.html.tmpl', $vars) @@ -280,6 +290,7 @@ if ($cgi->param('remove_invalid_bug_references')) { if (scalar(@$bug_ids)) { $dbh->do("DELETE FROM $table WHERE $field IN (" . join(',', @$bug_ids) . ")"); + $clear_memcached = 1; } } @@ -310,6 +321,7 @@ if ($cgi->param('remove_invalid_attach_references')) { $dbh->bz_commit_transaction(); Status('attachment_reference_deletion_end'); + $clear_memcached = 1 if @$attach_ids; } ########################################################################### @@ -336,12 +348,17 @@ if ($cgi->param('remove_old_whine_targets')) { $dbh->do("DELETE FROM whine_schedules WHERE mailto_type = $type AND mailto IN (" . join(',', @$old_ids) . ")"); + $clear_memcached = 1; } } $dbh->bz_commit_transaction(); Status('whines_obsolete_target_deletion_end'); } +# If any repairs were attempted or made, we need to clear memcached to ensure +# state is consistent. +Bugzilla->memcached->clear_all() if $clear_memcached; + ########################################################################### # Repair hook ########################################################################### @@ -717,6 +734,7 @@ if (scalar(@invalid_flags)) { # Silently delete these flags, with no notification to requesters/setters. $dbh->do('DELETE FROM flags WHERE id IN (' . join(',', @flag_ids) .')'); Status('flag_deletion_end'); + Bugzilla->memcached->clear_all(); } else { foreach my $flag (@$invalid_flags) { diff --git a/sanitycheck.pl b/sanitycheck.pl index a360bf8c0..7fd12b176 100755 --- a/sanitycheck.pl +++ b/sanitycheck.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl # 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/. @@ -6,7 +6,9 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; use lib qw(. lib); diff --git a/search_plugin.cgi b/search_plugin.cgi index ca515bfae..0b628f32e 100755 --- a/search_plugin.cgi +++ b/search_plugin.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,10 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; + use lib qw(. lib); use Bugzilla; diff --git a/show_activity.cgi b/show_activity.cgi index d161382f7..7df10fcb8 100755 --- a/show_activity.cgi +++ b/show_activity.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,9 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; use lib qw(. lib); @@ -38,7 +40,7 @@ my $bug = Bugzilla::Bug->check($id); # visible immediately due to replication lag. Bugzilla->switch_to_shadow_db; -($vars->{'operations'}, $vars->{'incomplete_data'}) = $bug->get_activity; +($vars->{'operations'}, $vars->{'incomplete_data'}) = $bug->get_activity(undef, undef, 1); $vars->{'bug'} = $bug; diff --git a/show_bug.cgi b/show_bug.cgi index 18128f1a7..9e31fc4a7 100755 --- a/show_bug.cgi +++ b/show_bug.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,9 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; use lib qw(. lib); @@ -39,14 +41,14 @@ if (!$cgi->param('id') && $single) { my (@bugs, @illegal_bugs); my %marks; -# If the user isn't logged in, we use data from the shadow DB. If he plans -# to edit the bug(s), he will have to log in first, meaning that the data +# If the user isn't logged in, we use data from the shadow DB. If they plan +# to edit the bug(s), they will have to log in first, meaning that the data # will be reloaded anyway, from the main DB. Bugzilla->switch_to_shadow_db unless $user->id; if ($single) { my $id = $cgi->param('id'); - push @bugs, Bugzilla::Bug->check($id); + push @bugs, Bugzilla::Bug->check({ id => $id, cache => 1 }); if (defined $cgi->param('mark')) { foreach my $range (split ',', $cgi->param('mark')) { if ($range =~ /^(\d+)-(\d+)$/) { @@ -68,7 +70,7 @@ if ($single) { foreach my $bug_id (@ids) { last if $count == 100; next unless $bug_id; - my $bug = new Bugzilla::Bug($bug_id); + my $bug = new Bugzilla::Bug({ id => $bug_id, cache => 1 }); if (!$bug->{error}) { push(@check_bugs, $bug); } @@ -113,7 +115,7 @@ if ($cgi->param("field")) { } unless ($user->is_timetracker) { - @fieldlist = grep($_ !~ /(^deadline|_time)$/, @fieldlist); + @fieldlist = grep($_ !~ /_time$/, @fieldlist); } foreach (@fieldlist) { diff --git a/showdependencygraph.cgi b/showdependencygraph.cgi index 4187bdd4e..e3e54c4d8 100755 --- a/showdependencygraph.cgi +++ b/showdependencygraph.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,9 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; use lib qw(. lib); @@ -29,7 +31,8 @@ my $vars = {}; # performance. my $dbh = Bugzilla->switch_to_shadow_db(); -local our (%seen, %edgesdone, %bugtitles); +our (%seen, %edgesdone, %bugtitles); +our $bug_count = 0; # CreateImagemap: This sub grabs a local filename as a parameter, reads the # dot-generated image map datafile residing in that file and turns it into @@ -76,6 +79,7 @@ sub AddLink { if (!exists $edgesdone{$key}) { $edgesdone{$key} = 1; print $fh "$dependson -> $blocked\n"; + $bug_count++; $seen{$blocked} = 1; $seen{$dependson} = 1; } @@ -108,10 +112,10 @@ chmod Bugzilla::Install::Filesystem::CGI_WRITE, $filename my $urlbase = correct_urlbase(); print $fh "digraph G {"; -print $fh qq{ +print $fh qq( graph [URL="${urlbase}query.cgi", rankdir=$rankdir] node [URL="${urlbase}show_bug.cgi?id=\\N", style=filled, color=lightgrey] -}; +); my %baselist; @@ -178,7 +182,7 @@ foreach my $k (@bug_ids) { # Resolution and summary are shown only if user can see the bug if (!$user->can_see_bug($k)) { - $resolution = $summary = ''; + $summary = ''; } $vars->{'short_desc'} = $summary if ($k eq $cgi->param('id')); @@ -211,7 +215,9 @@ foreach my $k (@bug_ids) { # Push the bug tooltip texts into a global hash so that # CreateImagemap sub (used with local dot installations) can # use them later on. - $bugtitles{$k} = trim("$stat $resolution"); + my $stat_display = display_value('bug_status', $stat); + my $resolution_display = display_value('resolution', $resolution); + $bugtitles{$k} = trim("$stat_display $resolution_display"); # Show the bug summary in tooltips only if not shown on # the graph and it is non-empty (the user can see the bug) @@ -224,6 +230,11 @@ foreach my $k (@bug_ids) { print $fh "}\n"; close $fh; +if ($bug_count > MAX_WEBDOT_BUGS) { + unlink($filename); + ThrowUserError("webdot_too_large"); +} + my $webdotbase = Bugzilla->params->{'webdotbase'}; if ($webdotbase =~ /^https?:/) { diff --git a/showdependencytree.cgi b/showdependencytree.cgi index 4235b1be2..9e193df02 100755 --- a/showdependencytree.cgi +++ b/showdependencytree.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,9 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; use lib qw(. lib); diff --git a/skins/README b/skins/README index 111c00f03..d649350b9 100644 --- a/skins/README +++ b/skins/README @@ -1,20 +1,18 @@ There are three directories here, standard/, custom/, and contrib/. -standard/ holds the standard stylesheets. These are used no matter -what skin the user selects. If the user selects the "Classic" skin, -then *only* the standard/ stylesheets are used. +standard/ holds the standard stylesheets. These are used no matter what skin +the user selects. If the user selects the "Classic" skin, then *only* the +standard/ stylesheets are used. -contrib/ holds "skins" that the user can select in their preferences. -skins are in directories, and they contain files with the same names -as the files in skins/standard/. Simply putting a new directory -into the contrib/ directory adds a new skin as an option in users' -preferences. +contrib/ holds "skins" that the user can select in their preferences. skins +are in directories, and they contain files with the same names as the files in +skins/standard/. Simply putting a new directory into the contrib/ directory +adds a new skin as an option in users' preferences. -custom/ allows you to locally override the standard/ and contrib/ CSS. -If you put files into the custom/ directory with the same names as the CSS -files in skins/standard/, you can override the standard/ and contrib/ -CSS. For example, if you want to override some CSS in -skins/standard/global.css, then you should create a file called "global.css" -in custom/ and put some CSS in it. The CSS you put into files in custom/ will -be used *in addition* to the CSS in skins/standard/ or the CSS in -skins/contrib/. It will apply to every skin. +custom/ allows you to locally override the standard/ and contrib/ CSS. If you +put files into the custom/ directory with the same names as the CSS files in +skins/standard/, you can override the standard/ and contrib/ CSS. For example, +if you want to override some CSS in skins/standard/global.css, then you should +create a file called "global.css" in custom/ and put some CSS in it. The CSS +you put into files in custom/ will be used *in addition* to the CSS in +skins/standard/ or the CSS in skins/contrib/. It will apply to every skin. diff --git a/skins/contrib/Dusk/global.css b/skins/contrib/Dusk/global.css index f051a3b58..7ffb91014 100644 --- a/skins/contrib/Dusk/global.css +++ b/skins/contrib/Dusk/global.css @@ -66,12 +66,6 @@ hr { /* edit */ -#bugzilla-body th { - font-weight: bold; - vertical-align: top; - white-space: nowrap; -} - #bug-form td { padding-top: 2px; } @@ -218,6 +212,10 @@ hr { background-color: #f0f0f0; } +#page-index .outro { + clear:both; +} + /* Rules specific for printing */ @media print { #header, diff --git a/skins/contrib/Dusk/index.css b/skins/contrib/Dusk/index.css deleted file mode 100644 index 8ea90b5ee..000000000 --- a/skins/contrib/Dusk/index.css +++ /dev/null @@ -1,12 +0,0 @@ -/* 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. - */ - - div#page-index .outro - { - clear:both; - } diff --git a/skins/standard/IE-fixes.css b/skins/standard/IE-fixes.css deleted file mode 100644 index 65f33a637..000000000 --- a/skins/standard/IE-fixes.css +++ /dev/null @@ -1,58 +0,0 @@ -/* 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. - */ - -.bz_comment_text, .uneditable_textarea, tbody.file pre { - white-space: pre; - word-wrap: break-word; -} - -.component_table { - margin-top: .5em; -} - -form#Create #comp_desc { - margin: .5em 1em; -} - -#footer #useful-links li { - padding-bottom: 0.8ex; -} - -#footer .label { - display: block; - float: left; - width: 8.2em; - padding-bottom: 0.1ex; -} - -#footer #links-actions .label { - padding-top: 0.35em; -} - -#footer .links { - display: inline; -} - -#bug_id_container, .search_field_grid, -.search_email_fields, ul.bug_changes li { - zoom: 1; - display: inline; -} - -#keywords_container .yui-ac-content { - _height: 30em; /* ie6 */ -} - -.bz_short_desc_column a, .bz_short_short_desc_column a { - /* color:inherit */ - color: expression(this.parentNode.currentStyle['color']); -} - -#graphical_report { - width: auto\9; /* IE6-8 */ -} diff --git a/skins/standard/admin.css b/skins/standard/admin.css index c2b822bbe..cdf75ac2c 100644 --- a/skins/standard/admin.css +++ b/skins/standard/admin.css @@ -8,8 +8,7 @@ .warningmessages, .criticalmessages { background-color: white; - border-style: solid; - border-width: 1px; + border: 1px solid; padding: 1ex 1ex 1ex 4ex; margin: 1ex; } @@ -39,7 +38,27 @@ p.areyoureallyreallysure { font-weight: bold; } -tr.param_disabled { +#admin_table, #flag_types_bugs, #flag_types_attachments { + border-collapse: collapse; + border: 1px solid black; +} + +#admin_table th, #admin_table td, +#flag_types_bugs th , #flag_types_bugs td, +#flag_types_attachments th, #flag_types_attachments td { + border: 1px solid black; + padding: 0.3em; +} + +table.no-border th, table.no-border td { + border: 0 !important; +} + +table.no-border th { + text-align: left; +} + +tr.disabled { background-color: lightgrey; } @@ -65,12 +84,18 @@ td.admin_links dt.forbidden a, td.admin_links dd.forbidden a { cursor: default; } -.col-header { - width: 8em; +div.table { + display: inline-table; +} + +div.cell { + display: table-cell; + vertical-align: top; } -.checkbox-cell { - border: 1px black solid; +.open-status, .closed-status { + width: 8em; + padding: 0.3em; } /* Grey-green color */ @@ -113,14 +138,168 @@ th.title { vertical-align: middle; } -#edit_custom_field tr { - vertical-align: top; +td.max-width { + width: 100%; +} + +#flag_types_bugs .inactive, #flag_types_attachments .inactive { + color: #787878; +} + +#flag_types_bugs .multiplicable, #flag_types_attachments .multiplicable { + display: block; +} + +#flagtype_form div.inline { + white-space: nowrap; +} + +#flagtype_form label, #grant_table label { + font-weight:bold; } -#edit_custom_field th { +table.whining_list, #group_settings_desc { + border: 1px solid black; + border-collapse: collapse; + width: 100%; +} + +#group_settings_desc th, #group_settings_desc td { + border: 1px solid black; + padding: 0.3em; +} + +table.whining_list th, table.whining_list td, +#admin_table_edit th, #admin_table_edit td { + padding: 0.3em; +} + +table.whining_list th { text-align: right; + font-weight: normal !important; +} + +table.whining_list th.subtitle { + font-weight: bold !important; + text-align: left !important; +} + +table.schedule_list th, table.search_list th { + text-align: center; + font-weight: bold !important; +} + +#settings #update { + margin-top: 2em; +} + +#grant_table td, #grant_table th { + text-align: center; + padding: 0.5em; +} + +#grant_table th { + padding: 2em 3em 0.5em 3em; +} + +#grant_table tr:first-child th { + padding-top: 0.5em; +} + +#mass-remove { + max-width: 50%; +} + +#mass-remove legend { + white-space: nowrap; +} + +#workflow { + border-collapse: collapse; +} + +#workflow td { + border: 1px dotted black; + text-align: center; +} + +#group_membership tr.indirect { + background-color: #cccccc; +} + +#group_membership th { + text-align: left; + padding: 0 1ex; +} + +#group_membership th.checkbox, #group_membership td.checkbox { + text-align: center; + white-space: nowrap; +} + +#user_responsibilities th { + text-align: center; + padding: 0 1em 1em; +} + +#user_responsibilities th.product { + text-align: left; + padding: 1em 0 0; +} + +#menu { + width: 10em; + margin-right: 0.5em; + border: solid thin; + border-spacing: 0px; + border-collapse: collapse; + text-align: center; + color: black; + background-color: #edf2f2; + font-weight: normal; +} + +#menu a:link, #menu a:visited { + color: #039; + background-color: transparent; +} + +#menu a:hover, #menu a:active { + color: red; + background-color: transparent; +} + +#menu td { + border: solid thin; + padding: 0.2em 0.5em; +} + +#menu td.selected_section { + color: #090; + background-color: white; +} + +#menu td.index { + color: black; + background-color: #edf; +} + +#params_index { + padding-left: 1em; +} + +#edit_params dd { + margin-bottom: 1.5em; +} + +.sortlist_separator { + font-weight: bold; + font-size: 80%; + background-color: #dddddd; } -#edit_custom_field th.narrow_label { - white-space: normal; +#contribute { + border: 1px dotted black; + padding: .5em; + font-size: small; } diff --git a/skins/standard/attachment.css b/skins/standard/attachment.css deleted file mode 100644 index 3f037c956..000000000 --- a/skins/standard/attachment.css +++ /dev/null @@ -1,236 +0,0 @@ -/* 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. - */ - -table.attachment_entry th { - text-align: right; - vertical-align: baseline; - white-space: nowrap; -} - -table.attachment_entry td { - text-align: left; - vertical-align: baseline; - padding-bottom: 5px; -} - -table#flags th, -table#flags td { - text-align: left; - vertical-align: baseline; - font-size: small; -} - -/* Rules used to view patches in diff mode. */ - -.file_head { - font-weight: bold; - font-size: 1em; - background-color: #c3c3c3; - border: 1px solid black; -} - -.file_head a { - text-decoration: none; - font-family: monospace; - font-size: 1.1em; -} - -.file_collapse { - display: none; -} - -.section_head { - background-color: #f0f0f0; - border: 1px solid black; - text-align: left; -} - -table.file_table { - table-layout: fixed; - width: 100%; - empty-cells: show; - border-spacing: 0px; - border-collapse: collapse; - /* draw border below last open context section in listing */ - border-bottom: 1px solid black; -} - -tbody.file pre { - display: inline; - font-size: 0.9em; -} - -tbody.file pre:empty { - display: block; -} - -.changed { - background-color: lightblue; -} - -.added { - background-color: lightgreen; -} - -.removed { - background-color: #FFCC99; -} - -.num { - background-color: #ffe9ae; - text-align:right; - padding: 0 0.3em; - width: 3em; -} - -table.attachment_info th { - text-align: right; - vertical-align: top; -} - -table.attachment_info td { - text-align: left; - vertical-align: top; -} - -/* Text displayed when the attachment is not viewable by the web browser */ -#noview { - text-align: left; - vertical-align: middle; -} - -#attachment_attributes div { - padding-bottom: 0.4em; -} - -#attachment_attributes label, -#attachment_attributes span.label, -#attachment_actions span.label -{ - font-weight: bold; -} - -#attachment_attributes .block { - display: block; -} - -#smallCommentFrame, #attachment_flags { - float: left; -} - -#smallCommentFrame { - margin-right: 1.5em; -} - -#attachment_comments_and_flags, #attachment_actions { - clear: both; - margin-bottom: 1ex; -} - -#attachment_information_read_only .title { - font-weight: bold; - font-size: 1.5em; - padding: 0; - margin: 0; -} - -#attachment_information_read_only .title #bz_edit { - font-size: 0.7em; -} - -#attachment_information_read_only .details { - font-size: 90%; -} - -#attachment_info.read #attachment_information_edit { - display: none; -} - -#attachment_info.edit #attachment_information_read_only { - display: none; -} - -#attachment_info.edit #attachment_view_window { - float: left; - width: 80%; -} - -#attachment_info.edit #attachment_information_edit { - width: 20%; -} - -#attachment_info.edit #attachment_information_edit input.text, -#attachment_info.edit #attachment_information_edit textarea { - width: 90%; -} - -#attachment_isobsolete { - padding-right: 1em; -} - -#attachment_information_edit { - float: left; -} - -#smallCommentFrame textarea { - display: block; -} - -textarea.bz_private { - border: 1px solid #F8C8BA; -} - -#update { - clear: both; - display: block; -} - -div#update_container { - clear: both; - padding: 1.5em 0; -} - -#attachment_flags { - margin-bottom: 1em; -} - -#attachment_flags p { - padding-bottom: 0; - margin-bottom: 0; -} - -#editFrame, #viewDiffFrame, #viewFrame { - height: 400px; - width: 95%; - margin-left: 2%; -} - -.viewall_frame { - width: 75%; - height: 350px; -} - -.details span.bz_private{ - border-left: 1px solid darkred; - padding-left: 0.5em; -} - -.no_javascript .bz_hide, .no_javascript .bz_edit { - display: none; -} - -#hidden_obsolete_message { - text-align: left; - width: 75%; - margin: 0 auto; - font-weight: bold -} - -#description { - resize: vertical; -} diff --git a/skins/standard/bug.css b/skins/standard/bug.css new file mode 100644 index 000000000..851b1bdba --- /dev/null +++ b/skins/standard/bug.css @@ -0,0 +1,597 @@ +/* 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. + */ + +/* enter_bug.cgi (start) */ + +/* These are specified using the class instead of the id so that they + don't override the YUI CSS. */ +.enter_bug_form table { + border-spacing: 0; + border-width: 0; +} + +.enter_bug_form td, .enter_bug_form th { + padding: .25em; +} + +.enter_bug_form th { + text-align: right; +} + +/* This makes the "component" column as small as possible (since it + * contains only fixed-width content) and the Reporter column + * as large as possible, which makes the form not jump around + * when the Component Description changes size. This works + * pretty well on all browsers except IE 8. + */ +#Create #field_container_component { + width: 1px; +} + +#Create #field_container_reporter { + width: 100%; +} + +#Create .comment, #guided_form #description { + vertical-align: top; + overflow: auto; + color: green; +} + +#guided_form #description { + display: inline; + margin-left: 10px; +} + +#Create #comp_desc_container td { + padding: 0; +} + +#Create #comp_desc { + height: 11ex; +} + +#Create #os_guess_note { + padding-top: 0; +} + +#Create #os_guess_note div { + max-width: 35em; +} + +#Create .field_value .text_input { + max-width: 50em; +} + +#possible_duplicates th { + text-align: center; + background: none; + border-collapse: collapse; +} + +#possible_duplicates td { + vertical-align: middle; +} + +/* Make the Add Me to CC button never wrap. */ +#possible_duplicates .yui-dt-col-update_token { + white-space: nowrap; +} + +table#flags th, table#flags td, +table#bug_flags th, table#bug_flags td, +table#attachment_flags th, table#attachment_flags td { + text-align: left; + vertical-align: baseline; + font-size: small; +} + +/* CSS rules for the guided form. */ + +.guided_form_field { + background-color: #ffc; +} + +#somebugs { + width: 100%; + height: 500px; +} + +.good { + color: #090; +} + +.bad { + color: #900; +} + +/* enter_bug.cgi (end) */ + +/* show_bug.cgi (start) */ + +.bz_short_desc_container { + margin: 8px 0; + padding: 0.3em; + background-color: rgb(208, 208, 208); + border-radius: 0.5em; + font-size: 125%; + font-weight: bold; +} + +.bz_bug .edit_form { + width: 100%; +} +.bz_bug .edit_form table { + width: 100%; +} +.bz_bug #alias { + min-width: 0; + width: 10em; +} + +table#flags { + width: auto; +} + +.bz_column_spacer { + width: 0.5em; +} + +.related_actions { + font-size: 0.85em; + float: right; + list-style-type: none; + white-space: nowrap; + margin: 0; + padding: 0; +} + +.related_actions li { + display: inline; +} + +.navigation_link { + color: #777; + font-style: italic; +} + +.bz_show_bug_column { + vertical-align: top; +} + +.bz_section_spacer { + height: 1em; +} + +#duplicate_settings { + white-space: nowrap; +} + +#bz_big_form_parts td { + vertical-align: top; +} + +.bz_group_visibility_section { + margin-left: 1em; +} + +.bz_group_visibility_section .instructions { + font-style: italic; +} + +#bz_restrict_group_visibility_help .instructions { + margin-top: 0; +} + +#bz_enable_role_visibility_help { + margin-top: 1em; +} + +.bz_time_tracking_table { + border-collapse: collapse; +} + +.bz_time_tracking_table th { + text-align: center; +} + +.bz_time_tracking_table td { + text-align: center; +} + +.bz_time_tracking_table th, +.bz_time_tracking_table td { + padding: 4px; +} + +.bz_time_tracking_table .bz_summarize_time { + text-align: right; +} +.bz_time_tracking_table #deadline { + width: 7em; +} + +#summary tr td { + vertical-align:top; +} + +#status { + margin-bottom: 3ex; +} + +.knob-buttons { + float: right; +} + +.text_input, .bz_userfield, #keywords_container, #tag_container { + width: 100%; +} +.bz_bug .bz_short_desc_container { + width: inherit; +} + +.bz_comment_tags { + margin-top: 3px; +} + +.bz_comment_tag { + border: 1px solid #c8c8ba; + padding: 1px 3px; + margin-right: 2px; + border-radius: 0.5em; + background-color: #eee; + color: #000; +} + +#bz_ctag_div { + display: inline-block; +} + +#bz_ctag_error { + border: 1px solid #ff6666; + padding: 0px 2px; + border-radius: 0.5em; + margin: 2px; + display: inline-block; +} + +#comment_tags_collapse_expand_container { + padding-top: 1em; +} + +#comment_tags_collapse_expand { + list-style-type: none; + padding-left: 1em; +} + +#comment_tags_collapse_expand li { + margin-bottom: 0px; +} + +/* show_bug.cgi (end) */ + +/* showdependencytree.cgi (start) */ + +ul.tree { + padding-left: 0em; + margin-left: 1em; + display: block; +} + +ul.tree ul { + padding-top: 3px; + display: block; +} + +ul.tree li { + /* see http://www.kryogenix.org/code/browser/aqlists/ for idea */ + padding-top: 3px; + text-indent: -1.2em; + padding-left: 0.5em; + padding-bottom: 3px; + list-style-type: none; + background: url("dependency-tree/bug-item.png") no-repeat; +} + +ul.tree li a.b { + padding-left: 30px; + margin-right: -14px; + text-decoration: none; +} + +ul.tree li a.b_open { + background: url("dependency-tree/tree-open.png") center no-repeat; + cursor: pointer; +} + +ul.tree li a.b_closed { + background: url("dependency-tree/tree-closed.png") center no-repeat; + cursor: pointer; +} + +ul.tree a.tree_link img { + border: 0; +} + +.summ_info { + /* change to inline if you would like to see the full bug details + * displayed in the list */ + display: none; + font-size: 75%; +} + +.hint { + font-size: 90%; + margin: 0.2em; + padding: 0.1em; +} + +.hint h3, .hint ul { + margin-top: 0.1em; + margin-bottom: 0.1em; +} + +.summ A, .summ_deep A { + text-decoration: none; + color: darkblue; +} + +.summ_h A { + background-color: #ffffaa; + color: #333; + font-weight: bold; +} + +.dependency_tree_controls input[type=submit] { + min-width: 3em; +} + +/* showdependencytree.cgi (end) */ + +/* attachment.cgi (start) */ + +table.attachment_entry th { + text-align: right; + vertical-align: baseline; + white-space: nowrap; +} + +table.attachment_entry td { + text-align: left; + vertical-align: baseline; + padding-bottom: 5px; +} + +/* Rules used to view patches in diff mode. */ + +.file_head { + font-weight: bold; + font-size: 1em; + background-color: #c3c3c3; + border: 1px solid black; +} + +.file_head a { + text-decoration: none; + font-family: monospace; + font-size: 1.1em; +} + +.file_collapse { + display: none; +} + +.section_head { + background-color: #f0f0f0; + border: 1px solid black; + text-align: left; + padding: 0.2em; +} + +.section_head .link_here { + float: right; + padding-left: 1em; + padding-right: 0.5em; +} + +.lines_count a { + padding-left: 0.5em; + padding-right: 1em; +} + +table.file_table { + table-layout: fixed; + width: 100%; + empty-cells: show; + border-spacing: 0px; + border-collapse: collapse; + /* draw border below last open context section in listing */ + border-bottom: 1px solid black; +} + +tbody.file pre { + display: inline; + font-size: 0.9em; +} + +tbody.file pre:empty { + display: block; +} + +.changed { + background-color: lightblue; +} + +.added { + background-color: lightgreen; +} + +.removed { + background-color: #FFCC99; +} + +.num { + background-color: #ffe9ae; + text-align:right; + padding: 0 0.3em; + width: 3em; +} + +table.attachment_info th { + text-align: right; + vertical-align: top; +} + +table.attachment_info td { + text-align: left; + vertical-align: top; +} + +/* Text displayed when the attachment is not viewable by the web browser */ +#noview { + text-align: left; + vertical-align: middle; +} + +#attachment_attributes div { + padding-bottom: 0.4em; +} + +#attachment_attributes label { + font-weight: bold; +} + +#attachment_attributes .block { + display: block; +} + +#smallCommentFrame, #attachment_flags { + float: left; +} + +#smallCommentFrame { + margin-right: 1.5em; +} + +#attachment_comments_and_flags, #attachment_actions { + clear: both; + margin-bottom: 1ex; +} + +#attachment_information_read_only .title { + font-weight: bold; + font-size: 1.5em; + padding: 0; + margin: 0; +} + +#attachment_information_read_only .title #bz_edit { + font-size: 0.7em; +} + +#attachment_information_read_only .details { + font-size: 90%; +} + +#attachment_info.read #attachment_information_edit { + display: none; +} + +#attachment_info.edit #attachment_information_read_only { + display: none; +} + +#attachment_info.edit #attachment_view_window { + float: left; + width: 80%; +} + +#attachment_info.edit #attachment_information_edit { + width: 20%; +} + +#attachment_info.edit #attachment_information_edit input.text, +#attachment_info.edit #attachment_information_edit textarea { + width: 90%; +} + +#attachment_isobsolete { + padding-right: 1em; +} + +#attachment_information_edit { + float: left; +} + +#smallCommentFrame textarea { + display: block; +} + +textarea.bz_private { + border: 1px solid #F8C8BA; +} + +#update { + clear: both; + display: block; +} + +div#update_container { + clear: both; + padding: 1.5em 0; +} + +#attachment_flags { + margin-bottom: 1em; +} + +#attachment_flags p { + padding-bottom: 0; + margin-bottom: 0; +} + +#editFrame, #viewDiffFrame, #viewFrame { + height: 400px; + width: 95%; + margin-left: 2%; +} + +.viewall_frame_container { + width: 75%; + margin: 2em auto; +} + +.viewall_desc { + width: 100%; + border: 1px solid black; + border-spacing: 0px; + border-collapse: collapse; +} + +.viewall_desc th, .viewall_desc td { + border: 1px solid black; + padding: 0.3em; +} + +.viewall_frame { + width: 100%; + height: 350px; +} + +.no_javascript .bz_hide, .no_javascript .bz_edit { + display: none; +} + +#hidden_obsolete_message { + text-align: left; + width: 75%; + margin: 0 auto; + font-weight: bold; +} + +/* attachment.cgi (end) */ diff --git a/skins/standard/buglist.css b/skins/standard/buglist.css index 6d23fc8bb..e58baabfd 100644 --- a/skins/standard/buglist.css +++ b/skins/standard/buglist.css @@ -5,7 +5,8 @@ * This Source Code Form is "Incompatible With Secondary Licenses", as * defined by the Mozilla Public License, v. 2.0. */ -.bz_query_head { + +#groups_edit_multiple th, .bz_query_head { text-align: center; } @@ -41,6 +42,32 @@ .bz_sort_order_primary { color: black; } .bz_sort_order_secondary { color: #777; } +.bz_query_buttons #xml { + vertical-align: middle; + padding: 0; +} + +.bz_query_buttons button { + border: 0px; + background: transparent; +} + +.bz_query_buttons form { + display: inline; +} + +.bz_query_links a img { + vertical-align: bottom; + border: 0; +} + +.bz_query_links a { + text-decoration: none; +} + +.bz_query_links button, .bz_query_edit button { + font-size: small; +} .bz_id_column { } @@ -63,7 +90,13 @@ /* Align columns in the "change multiple bugs" form to the right. */ table#form tr th { text-align: right; } -table.bz_buglist td, table.bz_buglist th { +table.bz_buglist { + border-collapse: collapse; + width: 100%; +} + +table.bz_buglist td, table.bz_buglist th { + padding: 0.4em; } /* we use a first-child class and not the pseudo-class because IE @@ -76,7 +109,7 @@ tr.bz_secure td.first-child, a.bz_secure { } th.first-child, td.first-child, a.bz_secure { - padding-left: 20px; + padding-left: 20px !important; } tr.bz_secure_mode_implied td.first-child { @@ -115,6 +148,38 @@ td.bz_total { color: inherit; } +.buglist_menu { + margin-top: 1em; +} + +.buglist_menu div { + display: inline-block; + vertical-align: middle; +} + +.buglist_menu .bz_query_buttons { + display: inline; +} + +div.bz_query_buttons { + max-width: 15em; +} + +#groups_edit_multiple, #quips { + border: 1px solid black; + border-collapse: collapse; +} + +#groups_edit_multiple th, #groups_edit_multiple td, +#quips th, #quips td { + border: 1px solid; + padding: 0.3em; +} + +#groups_edit_multiple th.narrow_column { + width: 8em; +} + /* The "filtering" table is specific to request.cgi. * Same for the "requests" class used for tables. */ @@ -126,6 +191,398 @@ td.bz_total { text-align: right; } +table.requests { + border: 1px solid black; + border-collapse: collapse; + width: 100%; +} + +table.requests th, table.requests td { + border: 1px solid; + padding: 0.5em; +} + table.requests th { text-align: left; } + +/* query.cgi (start) */ + +#summary_field { + padding: 1em; + margin: 1em; + border: 1px solid black; + background-color: #eee; + white-space: nowrap; +} + +#bug_id_container { + display: inline-block; + vertical-align: middle; + padding-bottom: 1ex; +} + +#bug_id_container input { + width: 9em; +} + +#bug_id_container .field_help { + font-size: 0.75em +} + +.search_field_grid { + margin-top: 1em; + display: inline-block; +} + +.search_field_grid .field_help_link, +.history_query .field_help_link { + display: block; + text-align: left; +} + +#chart .section_help { + font-size: 0.8em; + font-weight: normal +} + +.search_field_row { + white-space: nowrap; + margin-bottom: 0.5em; +} + +.search_field_row .field_label, #field_label_short_desc { + width: 14em; + display: inline-block; + line-height: 2em; + margin-right: 0.8em; +} + +.field_label_sup { + font-weight: normal; +} + +#keywords_container { + padding-bottom: 0; +} + +.search_field_grid .field_label, +.search_field_grid .field_label { + display: block; + padding-bottom: 1ex; +} + +.search_field_grid select { + width: 17em; + height: 15ex; +} + +.search_field_grid, .search_field_row { + padding-left: 1.5em; +} + +.search_email_fields { + display: inline-block; + width: 14.5em; + padding-left: 1.5em; +} + +ul.bug_changes { + margin: 0; + padding: 0; +} + +ul.bug_changes li { + display: inline-block; + width: 14.5em; + vertical-align: top; + padding-left: 1.5em; +} + +ul.bug_changes select { + width: 15em; +} + +ul.bug_changes li label { + display: block; +} + +div.bz_section_title { + display: block; + margin-top: 2em; + font-size: 1.2em; +} + +div.bz_section_title a { + font-weight: bold; +} + +div.bz_section_title span { + font-size: 0.75em; + margin-left: 1em; +} + +#queryform, #reportform { + margin-bottom: 2em; +} + +#knob { + margin-top: 2em; +} + +.arrow { + display: inline; + width: 16px; + height: 16px; +} + +.bz_search_section, ul.bz_search_section { + margin-top: 1em; +} + +/* query.cgi (end) */ + +/* describecomponents.cgi (start) */ + +#product_desc { + padding: 0 2em; + font-style: italic; + max-height: 8em; + overflow: auto; +} + +#component_table th { + padding-right: 1em; + text-align: left; +} + +#component_table td { + border-bottom: 1px dotted gray; +} + +#component_table td.component_assignee, +#component_table td.component_qa_contact { + border: none; + padding-top: 0.5em; +} + +.component_name { + font-size: 115%; + font-weight: bold; + padding-right: 1em; + vertical-align: middle; + min-width: 8em; +} + +.component_description { + padding-bottom: 0.5em; + color: #333; +} + +/* describecomponents.cgi (end) */ + +/* Series & reports (start) */ + +.t1 { + background-color: #ffffff; /* white */ +} + +.t2 { + background-color: #dfefff; /* light blue */ +} + +.t3 { + background-color: #dddddd; /* grey */ +} + +.t4 { + background-color: #c3d3ed; /* darker blue */ +} + +.ttotal, .ttotal td { + background-color: #cfffdf; /* light green */ +} + +.tabular_report_container { + /* Force tables to be horizontally centered */ + margin-left: auto; + margin-right: auto; + text-align: center; +} + +.tabular_report { + border: 1px dotted black; + border-collapse: collapse; + text-align: center; +} + +.tabular_report th, .tabular_report td { + border: 1px dotted; + padding: 0.2em; +} + +#graphical_report { + max-width: 100%; + height: auto; +} + +.extra_info { + font-size: smaller; + font-style: italic; +} + +#edit_series th, #create_chart th, #edit_charts th { + text-align: center; +} + +#edit_series th, #edit_series td, +#create_chart th, #create_chart td { + vertical-align: top; + padding: 0.5em; +} + +#edit_series select, #create_chart select { + width: 15em; +} + +#edit_series input { + width: 95%; +} + +#edit_series input#frequency { + width: 3em; +} + +#edit_charts input#action-sum, #edit_charts input#action-remove { + width: 7em; +} + +#tabular_reports_menu, #graphical_reports_menu { + width: 30em; + margin: 2em auto; +} + +#tabular_reports_menu th, #graphical_reports_menu th { + vertical-align: middle; + white-space: nowrap; + padding: 0.3em; +} + +#tabular_reports_menu th { + text-align: center; +} + +#graphical_reports_menu th { + text-align: left; +} + +#graphical_reports_menu label { + font-weight: normal; +} + +th#reports_menu_multiple_tables { + text-align: center; + width: 15em; + height: 15em; + border: 1px solid black; + border-collapse: collapse; +} + +/* Series & reports (end) */ + +/* Show multiple bugs (start) */ + +.bugfields { + font-size: small; + background: #eee; + padding: 0.3em; + border: 1px solid silver; + width: 100%; +} + +.bugfields tr { + vertical-align: top; +} + +.bugfields th { + max-width: 10em; + text-align: left; +} + +.bugfields a { + color: black; + text-decoration: none; +} + +.bugfields .rightcell { + padding-left: 1em; +} + +.bugfields table.timetracking th, .bugfields table.timetracking td { + max-width: 10em; +} + +/* Show multiple bugs (end) */ + +/* summarize_time.cgi (start) */ + +table.zeroitems, table.realitems { + margin-left: 2.0em; + margin-top: 2px; + border: 1px solid black; + border: 1px solid black; +} + +tr.section_total { + background: #000000; + color: #ffffff; +} + +td.subtotal { + background: #B0C0D9; + text-align: right; + font-weight: bold; + width: 8em; +} + +.zeroitems .bug_header { background: #d0e0f0 } +.zeroitems .bug_header2 { background: #f9f9f9 } + +/* the fixed headers -- .number uses bug_header so hack it here */ +.number .bug_header, .number .bug_header2 { background: #d0e0f0 } +.owner_header { background: #d0e0f0 } + + +/* the details headers */ +.number .owner_header, .owner .bug_header { background: #ffffff } +.number .owner_header2, .owner .bug_header2 { background: #EFEFEF } + +table.owner, table.number, table.zeroitems { + width: 90%; + border-collapse: collapse; +} + +.owner th, .owner td, .number th, .number td, +.zeroitems th, .zeroitems td { + padding: 0.2em; +} + +.warning_swapped_data { + border: 1px solid red; + margin: 1em; + padding: 0.5em; +} + +.realitems th.bug_id, .realitems th.bug_status, +.zeroitems th.bug_id, .zeroitems th.bug_status { + white-space: nowrap; + text-align: left; + padding-right: 2em; + width: 6em; +} + +.time_info { + padding-right: 3em; +} + +/* summarize_time.cgi (end) */ diff --git a/skins/standard/dependency-tree.css b/skins/standard/dependency-tree.css deleted file mode 100644 index 0051fca36..000000000 --- a/skins/standard/dependency-tree.css +++ /dev/null @@ -1,80 +0,0 @@ -/* 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. - */ - -ul.tree { - padding-left: 0em; - margin-left: 1em; - display: block; -} - -ul.tree ul { - padding-top: 3px; - display: block; -} - -ul.tree li { - /* see http://www.kryogenix.org/code/browser/aqlists/ for idea */ - padding-top: 3px; - text-indent: -1.2em; - padding-left: 0.5em; - padding-bottom: 3px; - list-style-type: none; - background: url("dependency-tree/bug-item.png") no-repeat; -} - -ul.tree li a.b { - padding-left: 30px; - margin-right: -14px; - text-decoration: none; -} - -ul.tree li a.b_open { - background: url("dependency-tree/tree-open.png") center no-repeat; - cursor: pointer; -} - -ul.tree li a.b_closed { - background: url("dependency-tree/tree-closed.png") center no-repeat; - cursor: pointer; -} - -ul.tree a.tree_link img { - border: 0; -} - -.summ_info { - /* change to inline if you would like to see the full bug details - * displayed in the list */ - display: none; - font-size: 75%; -} - -.hint { - font-size: 90%; - margin: 0.2em; - padding: 0.1em; -} - -.hint h3, .hint ul { - margin-top: 0.1em; - margin-bottom: 0.1em; -} - -.summ A, .summ_deep A { - text-decoration: none; - color: darkblue; -} - -.summ_deep { -} - -.summ_h A { - background-color: #ffffaa; - color: #333; - font-weight: bold; -} diff --git a/skins/standard/duplicates.css b/skins/standard/duplicates.css deleted file mode 100644 index b531597a4..000000000 --- a/skins/standard/duplicates.css +++ /dev/null @@ -1,37 +0,0 @@ -/* 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. - */ - -#duplicates_table { - border-collapse: collapse; -} - -#duplicates_table .resolved { - background-color: #d9d9d9; - color: black; -} - -#duplicates_table thead tr { - background-color: #ccc; - color: black; -} - -#duplicates_table thead tr th { - vertical-align: middle; -} - -#duplicates_table td, #duplicates_table th { - border: 1px solid black; - padding: .1em .25em; -} - -#duplicates_table tbody td { - text-align: center; -} -#duplicates_table tbody td.short_desc { - text-align: left; -} diff --git a/skins/standard/editusers.css b/skins/standard/editusers.css deleted file mode 100644 index fb38af67d..000000000 --- a/skins/standard/editusers.css +++ /dev/null @@ -1,64 +0,0 @@ -/* 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. - */ - -table.main { - border-spacing: 1em; -} -table.main tr { - vertical-align: top; - border-top: solid thin black; -} -table.main th { - text-align: right; - white-space: nowrap; -} -table.main th, -table.main td { - padding: 0; -} -table.main ul { - list-style-type: none; - padding-left: 0 -} - -table.groups { - border-spacing: 1px; -} -table.groups tr.indirect { - background-color: #cccccc; -} -table.groups th { - text-align: left; - padding: 0 0 0 1ex; -} -table.groups td { - padding: 2px; -} -table.groups td.checkbox { - text-align: center; - white-space: nowrap; -} - -table#user_responsibilities th { - text-align: center; - padding: 0 1em 1em; -} - -table#user_responsibilities th.product { - text-align: left; - padding: 1em 0 0; -} - -table#user_responsibilities td.center { - text-align: center; -} - -.missing { - color: red; - border-color: inherit; -} diff --git a/skins/standard/enter_bug.css b/skins/standard/enter_bug.css deleted file mode 100644 index e0f1ab656..000000000 --- a/skins/standard/enter_bug.css +++ /dev/null @@ -1,55 +0,0 @@ -/* 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. - */ - -/* These are specified using the class instead of the id so that they - don't override the YUI CSS. */ -.enter_bug_form table { - border-spacing: 0; - border-width: 0; -} -.enter_bug_form td, .enter_bug_form th { padding: .25em; } -.enter_bug_form th { text-align: right; } - -/* This makes the "component" column as small as possible (since it - * contains only fixed-width content) and the Reporter column - * as large as possible, which makes the form not jump around - * when the Component Description changes size. This works - * pretty well on all browsers except IE 8. - */ -#Create #field_container_component { width: 1px; } -#Create #field_container_reporter { width: 100%; } - -#Create .comment { - vertical-align: top; - overflow: auto; - color: green; -} -#Create #comp_desc_container td { padding: 0; } -#Create #comp_desc { height: 11ex; } -#Create #os_guess_note { - padding-top: 0; -} -#Create #os_guess_note div { - max-width: 35em; -} - -/* Text inputs need to be a little shorter on enter_bug - * than the 100% that they are on show_bug. - */ -#Create .field_value .text_input { max-width: 50em; } - -/* The Possible Duplicates table on enter_bug. */ -#possible_duplicates th { - text-align: center; - background: none; - border-collapse: collapse; -} -/* Make the Add Me to CC button never wrap. */ -#possible_duplicates .yui-dt-col-update_token { white-space: nowrap; } - -form#Create #possible_duplicates td { vertical-align: middle; } diff --git a/skins/standard/global.css b/skins/standard/global.css index 7bac17659..37af44b3e 100644 --- a/skins/standard/global.css +++ b/skins/standard/global.css @@ -12,7 +12,7 @@ color: #000; background: #fff url("global/body-back.gif") repeat-x; } - body, td, th, input { + body, td, th, input, dt, #titles { font-family: Verdana, sans-serif; font-size: small; } @@ -20,6 +20,16 @@ pre, code, kbd { font-size: medium; } + + #bugzilla-body { + clear: both; + } + + #bugzilla-body th { + font-weight: bold; + vertical-align: top; + } + /* global (end) */ /* header (begin) */ @@ -45,7 +55,9 @@ #lang_links_container { float: right; + white-space: nowrap; } + #lang_links_container .links { border: none; padding: .5em; @@ -71,9 +83,6 @@ form.mini_login input.bz_remember { margin: 0; } - .bz_mini_login_help { - color: #777; - } /* header (end) */ @@ -90,10 +99,9 @@ color: #fff; border-top-left-radius: 5px; border-top-right-radius: 5px; - font-size: 110%; margin: 0; - padding: 0.5em; vertical-align: bottom; + display: table; } #titles a { @@ -107,20 +115,25 @@ #titles #title { font-weight: bold; + padding: 0.5em; white-space: nowrap; + display: table-cell; } #titles #subtitle { font-weight: normal; - width: 100%; text-align: center; - } + padding: 0.5em; + display: table-cell; + } #titles #information { font-weight: normal; text-align: right; font-size: 90%; + padding: 0.5em; white-space: nowrap; + display: table-cell; } /* titles (end) */ @@ -177,6 +190,14 @@ /* link lists (end) */ /* tabs (begin) */ + table.tabs { + width: 100%; + } + + .tabs th, .tabs td { + padding: 1em; + } + .tabs td { background: #eee; text-align: center; @@ -184,7 +205,7 @@ border-color: black; border-width: 0px 0px 2px 0px; } - + .tabs td.selected { background: white; border-width: 2px 2px 0px 2px; @@ -237,6 +258,12 @@ div#docslinks { margin: 0; } +.rss { + background: transparent url(../../images/rss_small.png) no-repeat; + padding-left: 16px; + line-height: 1.5em; +} + /**************************/ /* Bug links and statuses */ /**************************/ @@ -245,7 +272,7 @@ div#docslinks { /* Catch-all if you want common styles for all bug links */ } -.bz_bug_link .bz_status_UNCONFIRMED { +.bz_bug_link.bz_status_UNCONFIRMED { font-style: italic; } @@ -289,6 +316,14 @@ div#docslinks { width: 50em; } +.bz_comment_text span.quote { + color: #65379c; + /* Make quoted text not wrap. */ + white-space: pre; + overflow: auto; + display: block; +} + .bz_comment_user, .bz_comment_time, .bz_comment_number, .bz_private_checkbox, .bz_comment_actions { @@ -333,6 +368,11 @@ div#docslinks { padding: 1em 0; } +.bz_comment_collapse_reason, +.bz_default_collapsed .bz_comment_number { + font-weight: normal; +} + /** End Comments **/ .bz_default_hidden, .bz_tui_hidden, .bz_hidden_field, .bz_hidden_option { @@ -342,18 +382,71 @@ div#docslinks { display: none !important; } -.bz_comment_text span.quote { - color: #65379c; - /* Make quoted text not wrap. */ - white-space: pre-wrap; -} - table#flags th, table#flags td { vertical-align: middle; text-align: left; } +#email_prefs, #saved_search_prefs, #shared_search_prefs, +#bug_activity { + border: 1px solid black; + border-collapse: collapse; +} + +#email_prefs th, +#shared_search_prefs th, +#saved_search_prefs th { + text-align: center; +} + +#email_prefs th, #email_prefs td, +#shared_search_prefs th, #shared_search_prefs td, +#saved_search_prefs th, #saved_search_prefs td, +#bug_activity td { + border: 1px solid; + padding: 0.3em; +} + +#email_prefs th.role_header { + width: 10%; +} + +#bug_activity td { + vertical-align: top; +} + +#user_prefs th, #user_prefs td { + padding: 0.5em; +} + +#permissions { + margin-left: auto; + margin-right: auto; + width: 40em; +} + +#permissions p { + margin-top: 2em; + margin-bottom: 0.5em; +} + +#permissions li { + list-style-type: none; +} + +#permissions table td { + vertical-align: top; +} + +.column_header { + background-color: #66f; +} + +.column_header th { + text-align: center; +} + .flag_select { min-width: 3em; } @@ -366,16 +459,29 @@ input.requestee { font-size: x-large; } +#post_err_msg, form#check { + clear: both; +} + .warning { color: red; } .throw_error { - background-color: #ff0000; + background-color: red; color: black; font-size: 120%; - margin: 1em; + margin-bottom: 2em; padding: 0.5em 1em; + float: left; +} + +.label { + font-weight: bold; +} + +.throw_error a:visited { + color: darkblue ; } dt { @@ -388,10 +494,6 @@ dl dl > dt { border-top: none; } -#admin_table th { - white-space: normal !important; -} - /* Arrow buttons are buttons with only ↑, ↓, ← or → on * them. We want these to look a little less spidery. */ .arrow_button { @@ -404,7 +506,8 @@ dl dl > dt { border: 1px solid #333333; } -#attachment_table th, .bz_attach_footer, .bz_time_tracking_table th { +#attachment_table th, .bz_attach_footer, .bz_time_tracking_table th, +.dependency_tree_controls { background-color: #E0E0E0; color: black; } @@ -413,11 +516,15 @@ dl dl > dt { border: 1px solid #333333; } -.bz_attach_extra_info { +#attachment_table th, #attachment_table td { + padding: 0.3em; +} + +.bz_attach_extra_info, .bz_info { font-size: smaller; } -.bz_attach_flags, .bz_attach_footer { +.bz_attach_flags, .bz_attach_footer, .bz_flags, .nowrap { white-space: nowrap; } @@ -426,10 +533,24 @@ dl dl > dt { padding-left: 1em; } +#user_match_table { + border-collapse: collapse; +} + +#user_match_table td { + vertical-align: top; + border-bottom: 1px solid black; + padding: 1em 0.5em; +} + div.user_match { margin-bottom: 1em; } +.indented { + margin-left: 3em; +} + .box { border: 1px solid black; color: black; @@ -438,10 +559,24 @@ div.user_match { padding: 0.5em 1em; } -.collapsed { +.collapsed, +.bz_default_collapsed .bz_private_checkbox, +.bz_default_collapsed .bz_comment_user, +.bz_default_collapsed .bz_comment_user_images, +.bz_default_collapsed .bz_comment_time, +.bz_default_collapsed .bz_comment_tags, +.bz_default_collapsed .bz_comment_text, +.bz_default_collapsed .bz_collapsed_actions +{ display: none; } +#serverpush_msg { + margin-top: 20%; + text-align: center; + font-size: xx-large; +} + /* Rules specific for printing */ @media print { #header, #footer { @@ -474,16 +609,21 @@ div.user_match { .field_help_link { cursor: help; } -.field_value, form#Create th, form#Create td { +.field_value, form#Create th, form#Create td, .top { vertical-align: top; } + +.bottom { + vertical-align: bottom; +} + .field_value .text_input { - width: 100%; - min-width: 25em; + width: 100%; + min-width: 25em; } .uneditable_textarea { - width: 30em; + max-width: 30em; font-size: medium; } @@ -507,20 +647,35 @@ input.required, select.required, span.required_explanation { .calendar_button span { display: none } /* These classes are set by YUI. */ .yui-calcontainer { - display: none; - background-color: white; + display: none; + background-color: white; padding: 10px; border: 1px solid #404D6C; } .bug_urls { - margin: 0 0 1em 0; + margin: 0; padding: 0; list-style-type: none; } +.field_textarea_readonly { + margin: 2px; + padding: 4px; + overflow: auto; + float: left; + max-width: 30em; + max-height: 7em; + border: 1px solid #CCC; +} + +.field_textarea_readonly pre { + font-family: monospace; + white-space: pre-wrap; +} + /* custom styles for inline instances of autocomplete input fields */ -.yui-skin-sam .yui-ac-input { position:static !important; +.yui-skin-sam .yui-ac-input { position:static !important; vertical-align:middle !important; } .yui-skin-sam .yui-ac-container { left:0px !important; } .yui-skin-sam .yui-ac { display: inline-block; } @@ -539,6 +694,43 @@ input.required, select.required, span.required_explanation { margin-left: -1px; } +#comment_tabs { + border-spacing: 0; +} + +.comment_tab { + display: table-cell; + border: 1px solid silver; + padding: 2px 1em; + cursor: pointer; + background: transparent; +} + +.active_comment_tab { + background: #fff; + font-weight: bold; +} + +#comment_preview { + border: 1px solid silver; + padding: 1px; + overflow: auto; + margin: 0px; +} + +#comment_preview_text { + margin: 0px; + width: auto; +} + +#comment_preview_loading { + font-style: italic; +} + +#comment { + margin: 0px 0px 1em 0px; +} + /*******************/ /* Form Validation */ /*******************/ @@ -554,6 +746,7 @@ input.required, select.required, span.required_explanation { background-color: #FFEBEB; } +<<<<<<< HEAD /* Gentoo bar */ body { margin: 1em; @@ -618,3 +811,277 @@ body.bz_product_Gentoo_Security #add_comment:after { body.bz_product_Gentoo_Security #add_comment { margin-bottom: 2em; } +======= +form th { + text-align: right; +} + +.left { + text-align: left; +} + +.center { + text-align: center; +} + +.right { + text-align: right; +} + +.middle { + vertical-align: middle; +} + +.inline { + display: inline; +} + +tr.shared_search { + background-color: #fff7cd; + color: #000; +} + +.multi-columns { + columns: 3; + -moz-columns: 3; + -webkit-columns: 3; +} + +/* index.cgi (begin) */ + +#page-index { + padding: 0.2em 0.2em 0.15em 0.2em; + max-width: 1000px; +} + +/* By default these contain nothing, but these CSS rules make things + easier on customizers. */ +.intro, .outro { + text-align: center; +} + +#new_release { + border: 2px solid red; + padding: 0.5em 1em; + margin: 1em; + font-weight: bold; +} + +#new_release .notice { + font-size: 80%; + font-weight: normal; +} + +#welcome-admin a { + font-weight: bold; +} + +.bz_common_actions { + text-align: center; +} + +.bz_common_actions ul { + list-style-type: none; + padding: 0; +} + +.bz_common_actions ul li { + display: inline; + vertical-align: top; +} + +.bz_common_actions ul li a { + display: inline-block; + height: 170px; + width: 145px; + margin: 0 2ex 2em 0; +} + +.bz_common_actions ul li a span { + position: relative; + top: 90%; + font-weight: bold; +} + +.bz_common_actions a, +.bz_common_actions a:visited, +.bz_common_actions a:hover { + text-decoration: none; +} + +#enter_bug { background: url(index/file-a-bug.png) no-repeat; } +#query { background: url(index/search.png) no-repeat; } +#account { background: url(index/new-account.png) no-repeat; } +#help { background: url(index/help.png) no-repeat; } + +#quicksearchForm { + clear: both; + text-align: center; + margin-bottom: 2em; +} + +#quicksearchForm #quicksearch_main { + width: 27em; +} + +#quicksearchForm { + margin: 0; + padding: 0; +} + +#page-index table { + border-collapse: collapse; + margin: auto; +} + +#welcome { + font-size: x-large; + font-weight: bold; + text-align: center; + margin: 0 0 0.8em 0; + padding: 0; +} + +#common_queries ul { + list-style: none; + padding-left: 1.5em; +} + +#common_queries li a { + text-decoration: none; +} + +ul#quicksearch_links { + margin-bottom: 1em; +} + +ul.additional_links { + list-style: none; + margin: 0; + padding: 0; +} + +ul.additional_links li { + display: inline; +} + +ul.additional_links li.bz_default_hidden { + display: none; +} + +/* index.cgi (end) */ + +/* page.cgi (begin) */ + +body.narrow_page #bugzilla-body > * { + /* People have an easier time reading narrower columns of text. */ + max-width: 45em; +} + +/*****************/ +/* Release Notes */ +/*****************/ + +.req_new { + color: red; +} + +.req_table { + border-collapse: collapse; +} + +.req_table td, .req_table th { + border: 1px solid black; + padding: .25em; +} + +/********************/ +/* QuickSearch Help */ +/********************/ + +.qs_help li { + margin-top: 1ex; +} + +.qs_fields th { + padding: 0 .25em; +} +.qs_fields th.field_nickname { + text-align: left; +} +.qs_fields td { + padding: .25em; + border-top: 1px solid gray; +} +.qs_fields .field_name { + width: 10em; +} + +/***************/ +/* fields.html */ +/***************/ + +table.field_value_explanation { + table-layout: fixed; + border-collapse: collapse; +} + +.field_value_explanation thead h2 { + margin: 0; +} + +.field_value_explanation .header_row td { + text-align: center; + font-size: 120%; + font-weight: bold; +} + +.field_value_explanation tbody td { + border: 1px solid black; + padding: 1em; +} + +.field_value_explanation dt, .field_descriptions dt { + margin-top: 1em; +} + +.field_descriptions dt { + font-size: 120%; +} + +/* page.cgi (end) */ + +/* duplicates.cgi (start) */ + +#duplicates_table { + border-collapse: collapse; +} + +#duplicates_table .resolved { + background-color: #d9d9d9; + color: black; +} + +#duplicates_table thead tr { + background-color: #ccc; + color: black; +} + +#duplicates_table thead tr th { + vertical-align: middle; +} + +#duplicates_table td, #duplicates_table th { + border: 1px solid black; + padding: .1em .25em; +} + +#duplicates_table tbody td { + text-align: center; +} + +#duplicates_table tbody td.short_desc { + text-align: left; +} + +/* duplicates.cgi (end) */ diff --git a/skins/standard/index.css b/skins/standard/index.css deleted file mode 100644 index 595692025..000000000 --- a/skins/standard/index.css +++ /dev/null @@ -1,135 +0,0 @@ -/* 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. - */ - -/* index page (begin) */ - - #page-index - { - padding: 0.2em 0.2em 0.15em 0.2em; - max-width: 1000px; - } - - /* By default these contain nothing, but these CSS rules make things - easier on customizers. */ - .intro, .outro { - text-align: center; - } - - /* Hide from NN4 */ - - #new_release - { - border: 2px solid red; - padding: 0.5em 1em; - margin: 1em; - font-weight: bold; - } - - #new_release .notice - { - font-size: 80%; - font-weight: normal; - } - - #welcome-admin a - { - font-weight: bold; - } - - .bz_common_actions { - text-align: center; - } - .bz_common_actions ul { - list-style-type: none; - padding: 0; - } - .bz_common_actions ul li { - display: inline; - vertical-align: top; - } - .bz_common_actions ul li a { - display: inline-block; - height: 170px; - width: 145px; - margin: 0 2ex 2em 0; - } - .bz_common_actions ul li a span { - position: relative; - top: 90%; - font-weight: bold; - } - .bz_common_actions a, - .bz_common_actions a:visited, - .bz_common_actions a:hover { - text-decoration: none; - } - #enter_bug { background: url(index/file-a-bug.png) no-repeat; } - #query { background: url(index/search.png) no-repeat; } - #account { - background: url(index/new-account.png) no-repeat; - margin-right: 0; - } - - #quicksearchForm - { - clear: both; - text-align: center; - margin-bottom: 2em; - } - - #quicksearchForm #quicksearch_main - { - width: 27em; - } - - #quicksearchForm - { - margin: 0; - padding: 0; - } - - #page-index table{ - border-collapse: collapse; - margin: auto; - } - - #welcome - { - font-size: x-large; - font-weight: bold; - text-align: center; - margin: 0 0 0.8em 0; - padding: 0; - } - - ul.additional_links - { - list-style: none; - margin: 0; - padding: 0; - } - - ul#quicksearch_links{ - margin-bottom: 1em; - } - - ul.additional_links li - { - display: inline; - } - - ul.additional_links li.bz_default_hidden - { - display: none; - } - - input.quicksearch_help_text - { - color: #ccc; - } -/* index page (end) */ diff --git a/skins/standard/page.css b/skins/standard/page.css deleted file mode 100644 index f4037f3de..000000000 --- a/skins/standard/page.css +++ /dev/null @@ -1,92 +0,0 @@ -/* 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. - */ - -/* This CSS is used by various informational pages in the - template/en/default/pages/ directory. */ - -#bugzilla-body { - padding: 0 1em; -} - -#bugzilla-body > * { - /* People have an easier time reading narrower columns of text. */ - max-width: 45em; -} - -/*****************/ -/* Release Notes */ -/*****************/ - -.req_new { - color: red; -} - -.req_table { - border-collapse: collapse; -} - -.req_table td, .req_table th { - border: 1px solid black; - padding: .25em; -} - -/********************/ -/* QuickSearch Help */ -/********************/ - -.qs_help li { - margin-top: 1ex; -} - -.qs_fields th { - padding: 0 .25em; -} -.qs_fields th.field_nickname { - text-align: left; -} -.qs_fields td { - padding: .25em; - border-top: 1px solid gray; -} -.qs_fields .field_name { - width: 10em; -} - -/***************/ -/* fields.html */ -/***************/ - -table.field_value_explanation { - table-layout: fixed; - border-collapse: collapse; -} - -.field_value_explanation thead h2 { - margin: 0; -} - -.field_value_explanation .header_row td { - text-align: center; - font-size: 120%; - font-weight: bold; -} - -.field_value_explanation tbody td { - border: 1px solid black; - padding: 1em; -} - -.field_value_explanation dt, -.field_descriptions dt -{ - margin-top: 1em; -} - -.field_descriptions dt { - font-size: 120%; -} diff --git a/skins/standard/params.css b/skins/standard/params.css deleted file mode 100644 index 92bd6d0e1..000000000 --- a/skins/standard/params.css +++ /dev/null @@ -1,69 +0,0 @@ -/* 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. - */ - -#menu { - width: 10em; - margin-top: 1em; - margin-right: 0.5em; - border: solid thin; - border-spacing: 0px; - border-collapse: collapse; - text-align: center; - color: black; - background-color: #edf2f2; - font-weight: normal; -} - -#menu a:link, #menu a:visited { - color: #039; - background-color: transparent; -} - -#menu a:hover, #menu a:active { - color: red; - background-color: transparent; -} - -#menu td { - border: solid thin; - padding: 0.2em 0.5em; -} - -table td { - vertical-align: top; -} - -td.selected_section { - color: #090; - background-color: white; -} - -td.index { - color: black; - background-color: #edf; -} - -dt { - font-weight: bold; -} - -dd { - margin-bottom: 1.5em; -} - -.sortlist_separator { - font-weight: bold; - font-size: 80%; - background-color: #dddddd; -} - -.contribute { - border: 1px dotted black; - padding: .5em; - font-size: small; -} diff --git a/skins/standard/reports.css b/skins/standard/reports.css deleted file mode 100644 index 97ef316ba..000000000 --- a/skins/standard/reports.css +++ /dev/null @@ -1,104 +0,0 @@ -/* 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. - */ - -/* describecomponents.cgi */ - -#components_header_table { - margin-bottom: 1em; -} - -.product_container { - width: 65%; -} - -.product_name { - font-weight: bold; - font-size: 150%; - margin: 0; -} - -.product_desc { - /* This is padding instead of margin because it looks better - * with the scrollbar. */ - padding: 0 2em; - font-style: italic; - max-height: 5em; - overflow: auto; -} - -.instructions { - font-weight: bold; - font-size: 105%; - padding-right: 1em; -} - -.components_header { - margin: 0; - font-size: 140%; - font-weight: bold; -} - -.component_table { - margin-top: -1em; - margin-left: 2em; -} - -.component_table thead th { - padding-right: 1em; - vertical-align: bottom; - text-align: left; -} - -.component_table td { - border-bottom: 1px dotted gray; -} - -.component_table td.component_assignee, -.component_table td.component_qa_contact -{ - border: none; - padding-top: .5em; -} - -.component_name { - font-size: 115%; - font-weight: bold; - padding-right: 1em; - vertical-align: middle; - min-width: 8em; -} - -.component_description { - padding-bottom: .5em; - color: #333; -} - -.t1 { - background-color: #ffffff; /* white */ -} - -.t2 { - background-color: #dfefff; /* light blue */ -} - -.t3 { - background-color: #dddddd; /* grey */ -} - -.t4 { - background-color: #c3d3ed; /* darker blue */ -} - -.ttotal, .ttotal td { - background-color: #cfffdf; /* light green */ -} - -#graphical_report { - max-width: 100%; - height: auto; -} diff --git a/skins/standard/search_form.css b/skins/standard/search_form.css deleted file mode 100644 index ff97dbcbc..000000000 --- a/skins/standard/search_form.css +++ /dev/null @@ -1,190 +0,0 @@ -/* 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. - */ - -#summary_field { - padding: 1em; - margin: 1em; - border: 1px solid black; - background-color: #eee; - white-space: nowrap; -} - -#bug_id_container { - display: inline-block; - vertical-align: middle; - padding-bottom: 1ex; -} - -#bug_id_container input { - width: 9em; -} - -.container_date_from, -.container_date_to { - width: 14em; - padding-bottom: 1ex; -} -.container_date_from input, -.container_date_to input { - width: 8em; -} - -#bug_id_type{ - width: inherit; -} - -.search_field_grid { - margin-top: 1em; - display: inline-block; -} - -.search_field_grid .field_help_link, -.history_query .field_help_link -{ - display: block; - text-align: left; -} - -#chart .section_help { - font-size: 0.8em; - font-weight: normal -} - -#bug_id_container .field_help { - font-size: 0.75em -} - -.search_field_row { - white-space: nowrap; - margin-bottom: 0.5em; -} - -.search_field_row .container_date_from, .search_field_row .container_date_to { - display: inline; -} - -#summary_field.search_field_row { - display: block; -} - -#summary_field.search_field_row input, -#summary_field.search_field_row select -{ - display: inline; - padding-bottom: 0; - vertical-align: middle; -} - -.search_field_row .field_label, #field_label_short_desc { - width: 14em; - display: inline-block; - line-height: 2em; - margin-right: 0.8em; -} - -#field_label_short_desc { - text-align: right; -} - -#summary_field.search_field_row { - width: inherit; -} - -#keywords_container { - padding-bottom: 0; -} - -.search_field_grid .field_label, -.search_field_grid .field_label - { - display: block; - padding-bottom: 1ex; -} - -.search_field_grid select { - width: 17em; - height: 15ex; -} - -.search_field_grid, .search_field_row { - padding-left: 1.5em; -} - -.search_email_fields { - display: inline-block; - width: 14.5em; - padding-left: 1.5em; -} - -ul.bug_changes { - margin: 0; - padding: 0; -} - -ul.bug_changes li { - display: inline-block; - width: 14.5em; - vertical-align: top; - padding-left: 1.5em; -} - -ul.bug_changes select { - width: 15em; -} - -ul.bug_changes li label { - display: block; -} - -div.bz_section_title { - display: block; - margin-top: 2em; - font-size: 1.2em; -} - -div.bz_section_title a { - font-weight: bold; -} - -div.bz_section_title span { - font-size: 0.75em; - margin-left: 1em; -} - -#summary_field label { - font-weight: bold; -} - -#queryform, #reportform { - margin-bottom: 2em; -} - -#knob { - margin-top: 2em; -} - -.hide_people_filter #people_filter_section, -.hide_history_filter #history_filter_section, -.hide_detailed_information #detailed_information_section -{ - display: none; -} - -.arrow { - display: inline; - width: 16px; - height: 16px; -} - -.bz_search_section, ul.bz_search_section { - margin-top: 1em; -} - -.bz_simple_search_form th { - text-align: right; -} diff --git a/skins/standard/show_bug.css b/skins/standard/show_bug.css deleted file mode 100644 index 2d5ba4309..000000000 --- a/skins/standard/show_bug.css +++ /dev/null @@ -1,123 +0,0 @@ -/* 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. - */ - -.bz_alias_short_desc_container { - margin: 8px 0; - padding: 0.3em; - background-color: rgb(208, 208, 208); - border-radius: 0.5em; - font-size: 125%; - font-weight: bold; -} - -.bz_bug .edit_form { - width: 100%; -} -.bz_bug .edit_form table { - width: 100%; -} -.bz_bug #alias { - min-width: 0; - width: 10em; -} - -table#flags { - width: auto; -} - -.bz_column_spacer { - width: 0.5em; -} - -.related_actions { - font-size: 0.85em; - float: right; - list-style-type: none; - white-space: nowrap; - margin: 0; - padding: 0; -} - -.related_actions li { - display: inline; -} - -.bz_show_bug_column { - vertical-align: top; -} - -.bz_section_spacer { - height: 1em; -} - -#duplicate_settings { - white-space: nowrap; -} - -#bz_big_form_parts td { - vertical-align: top; -} - -.bz_group_visibility_section { - margin-left: 1em; -} - -.bz_group_visibility_section .instructions { - font-style: italic; -} - -#bz_restrict_group_visibility_help .instructions { - margin-top: 0; -} - -#bz_enable_role_visibility_help { - margin-top: 1em; -} - -.bz_time_tracking_table { - border-collapse: collapse; -} - -.bz_time_tracking_table th { - text-align: center; -} - -.bz_time_tracking_table td { - text-align: center; -} - -.bz_time_tracking_table th, -.bz_time_tracking_table td { - padding: 4px; -} - -.bz_time_tracking_table .bz_summarize_time { - text-align: right; -} -.bz_time_tracking_table #deadline { - width: 7em; -} - -#summary tr td { - vertical-align:top; -} - -#status { - margin-bottom: 3ex; -} - -.knob-buttons { - float: right; -} - -.text_input, .bz_userfield, #keywords_container, #tag_container { - width: 100%; -} -.bz_bug .bz_alias_short_desc_container { - width: inherit; -} diff --git a/skins/standard/show_multiple.css b/skins/standard/show_multiple.css deleted file mode 100644 index dbfa6eb19..000000000 --- a/skins/standard/show_multiple.css +++ /dev/null @@ -1,60 +0,0 @@ -/* 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. - */ - -hr {margin: 20px auto 40px} - -.bz_private { color:darkred } - -h1 { - font-size: 2em; - margin-bottom: 10px; -} - -/* bugfields is table of all fields and values */ -.bugfields { - font-size: small; - background: #eee; - padding: 5px; - border: 1px solid silver; - width: 100%; -} - -.bugfields tr { - vertical-align: top; -} - -.bugfields th { - width: 10em; - text-align: left; - font-weight: normal; - line-height: 150%; -} - -.bugfields td { - font-weight: bold; - line-height: 150%; -} - -.bugfields .rightcell { - padding-left: 10px; -} - -/* set line-height to normal for nested tables of bugfields table */ -.bugfields table th, .bugfields table td { - line-height: 100%; - width: auto; -} - -.bugfields table.timetracking th, .bugfields table.timetracking td { - width: 10em; -} - -.error { - color: red; - font-weight: bold; -} diff --git a/skins/standard/summarize-time.css b/skins/standard/summarize-time.css deleted file mode 100644 index bb42da6fe..000000000 --- a/skins/standard/summarize-time.css +++ /dev/null @@ -1,37 +0,0 @@ -/* 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. - */ - -td { vertical-align: top } - -table.zeroitems, table.realitems { - margin-left: 2.0em; - margin-top: 2px; - border: 1px solid black; - border: 1px solid black; -} - -tr.section_total { - background: #000000; - color: #ffffff; -} - -td.subtotal { - background: #B0C0D9; -} - -.zeroitems .bug_header { background: #d0e0f0 } -.zeroitems .bug_header2 { background: #f9f9f9 } - -/* the fixed headers -- .number uses bug_header so hack it here */ -.number .bug_header, .number .bug_header2 { background: #d0e0f0 } -.owner_header { background: #d0e0f0 } - - -/* the details headers */ -.number .owner_header, .owner .bug_header { background: #ffffff } -.number .owner_header2, .owner .bug_header2 { background: #EFEFEF } diff --git a/summarize_time.cgi b/summarize_time.cgi index 5e0df959d..3bdf8ee52 100755 --- a/summarize_time.cgi +++ b/summarize_time.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,9 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; use lib qw(. lib); @@ -254,7 +256,7 @@ $user->is_timetracker my @ids = split(",", $cgi->param('id') || ''); @ids = map { Bugzilla::Bug->check($_)->id } @ids; -scalar(@ids) || ThrowUserError('no_bugs_chosen', {action => 'view'}); +scalar(@ids) || ThrowUserError('no_bugs_chosen', {action => 'summarize'}); my $group_by = $cgi->param('group_by') || "number"; my $monthly = $cgi->param('monthly'); diff --git a/t/001compile.t b/t/001compile.t index a82b30a9e..7097ad361 100644 --- a/t/001compile.t +++ b/t/001compile.t @@ -10,12 +10,15 @@ #Bugzilla Test 1# ###Compilation### +use 5.10.1; use strict; -use 5.008001; +use warnings; + use lib qw(. lib t); use Config; use Support::Files; -use Test::More tests => scalar(@Support::Files::testitems); +use Test::More tests => scalar(@Support::Files::testitems) + + scalar(@Support::Files::test_files); BEGIN { use_ok('Bugzilla::Constants'); @@ -51,7 +54,7 @@ sub compile_file { $libs = join " ", map { "-I\"$_\"" } split /$Config{path_sep}/, $ENV{PERL5LIB}; } my $perl = qq{"$^X"}; - my $output = `$perl $libs -wc$T $file 2>&1`; + my $output = `$perl $libs -c$T $file 2>&1`; chomp($output); my $return_val = $?; $output =~ s/^\Q$file\E syntax OK$//ms; @@ -59,7 +62,7 @@ sub compile_file { ok(!$return_val, $file) or diag('--ERROR'); } -my @testitems = @Support::Files::testitems; +my @testitems = (@Support::Files::testitems, @Support::Files::test_files); my $file_features = map_files_to_features(); # Test the scripts by compiling them diff --git a/t/002goodperl.t b/t/002goodperl.t index 2cbee8ef5..d1858361f 100644 --- a/t/002goodperl.t +++ b/t/002goodperl.t @@ -10,15 +10,19 @@ #Bugzilla Test 2# ####GoodPerl##### +use 5.10.1; use strict; +use warnings; use lib 't'; use Support::Files; -use Test::More tests => (scalar(@Support::Files::testitems) * 4); +use Test::More tests => (scalar(@Support::Files::testitems) + + scalar(@Support::Files::test_files)) * 6; -my @testitems = @Support::Files::testitems; # get the files to test. +my @testitems = (@Support::Files::test_files, @Support::Files::testitems); +my @require_taint = qw(email_in.pl importxml.pl mod_perl.pl whine.pl); foreach my $file (@testitems) { $file =~ s/\s.*$//; # nuke everything after the first space (#comment) @@ -33,28 +37,38 @@ foreach my $file (@testitems) { my $ext = $1; if ($file_line1 !~ m/^#\!/) { - ok(1,"$file does not have a shebang"); + ok(1,"$file does not have a shebang"); } else { my $flags; if (!defined $ext || $ext eq "pl") { # standalone programs aren't taint checked yet - $flags = "w"; + if (grep { $file eq $_ } @require_taint) { + $flags = 'T'; + } + else { + $flags = ''; + } } elsif ($ext eq "pm") { ok(0, "$file is a module, but has a shebang"); next; } elsif ($ext eq "cgi") { # cgi files must be taint checked - $flags = "wT"; + $flags = 'T'; } else { ok(0, "$file has shebang but unknown extension"); next; } - if ($file_line1 =~ m#^\#\!/usr/bin/perl\s#) { - if ($file_line1 =~ m#\s-$flags#) { - ok(1,"$file uses standard perl location and -$flags"); - } else { - ok(0,"$file is MISSING -$flags --WARNING"); + if ($file_line1 =~ m#^\#\!/usr/bin/perl(?:\s-(\w+))?$#) { + my $file_flags = $1 || ''; + if ($flags eq $file_flags) { + ok(1, "$file uses standard perl location" . ($flags ? " and -$flags flag" : "")); + } + elsif ($flags) { + ok(0, "$file is MISSING -$flags flag --WARNING"); + } + else { + ok(0, "$file has unexpected -$file_flags flag --WARNING"); } } else { ok(0,"$file uses non-standard perl location"); @@ -63,7 +77,10 @@ foreach my $file (@testitems) { } foreach my $file (@testitems) { + my $found_use_perl = 0; my $found_use_strict = 0; + my $found_use_warnings = 0; + $file =~ s/\s.*$//; # nuke everything after the first space (#comment) next if (!$file); # skip null entries if (! open (FILE, $file)) { @@ -71,17 +88,29 @@ foreach my $file (@testitems) { next; } while (my $file_line = <FILE>) { - if ($file_line =~ m/^\s*use strict/) { - $found_use_strict = 1; - last; - } + $found_use_perl = 1 if $file_line =~ m/^\s*use 5.10.1/; + $found_use_strict = 1 if $file_line =~ m/^\s*use strict/; + $found_use_warnings = 1 if $file_line =~ m/^\s*use warnings/; + last if ($found_use_perl && $found_use_strict && $found_use_warnings); } close (FILE); + if ($found_use_perl) { + ok(1,"$file requires Perl 5.10.1"); + } else { + ok(0,"$file DOES NOT require Perl 5.10.1 --WARNING"); + } + if ($found_use_strict) { ok(1,"$file uses strict"); } else { ok(0,"$file DOES NOT use strict --WARNING"); } + + if ($found_use_warnings) { + ok(1,"$file uses warnings"); + } else { + ok(0,"$file DOES NOT use warnings --WARNING"); + } } # Check to see that all error messages use tags (for l10n reasons.) diff --git a/t/003safesys.t b/t/003safesys.t index 17593fbe7..443f96415 100644 --- a/t/003safesys.t +++ b/t/003safesys.t @@ -10,7 +10,9 @@ #Bugzilla Test 3# ###Safesystem#### +use 5.10.1; use strict; +use warnings; use lib 't'; @@ -22,7 +24,7 @@ use Test::More tests => scalar(@Support::Files::testitems); # This will handle verbosity for us automatically. my $fh; { - local $^W = 0; # Don't complain about non-existent filehandles + no warnings qw(unopened); # Don't complain about non-existent filehandles if (-e \*Test::More::TESTOUT) { $fh = \*Test::More::TESTOUT; } elsif (-e \*Test::Builder::TESTOUT) { diff --git a/t/004template.t b/t/004template.t index 604559dc0..0a6f0e0aa 100644 --- a/t/004template.t +++ b/t/004template.t @@ -9,7 +9,9 @@ #Bugzilla Test 4# ####Templates#### +use 5.10.1; use strict; +use warnings; use lib 't'; @@ -26,7 +28,7 @@ use Test::More tests => ( scalar(@referenced_files) + 2 * $num_actual_files ); # This will handle verbosity for us automatically. my $fh; { - local $^W = 0; # Don't complain about non-existent filehandles + no warnings qw(unopened); # Don't complain about non-existent filehandles if (-e \*Test::More::TESTOUT) { $fh = \*Test::More::TESTOUT; } elsif (-e \*Test::Builder::TESTOUT) { @@ -69,7 +71,6 @@ foreach my $include_path (@include_paths) { FILTERS => { html_linebreak => sub { return $_; }, - no_break => sub { return $_; } , js => sub { return $_ } , base64 => sub { return $_ } , inactive => [ sub { return sub { return $_; } }, 1] , diff --git a/t/005whitespace.t b/t/005whitespace.t index 624df69f6..b6de8cee3 100644 --- a/t/005whitespace.t +++ b/t/005whitespace.t @@ -9,7 +9,9 @@ #Bugzilla Test 5# #####no_tabs##### +use 5.10.1; use strict; +use warnings; use lib 't'; @@ -17,10 +19,11 @@ use Support::Files; use Support::Templates; use File::Spec; -use Test::More tests => ( scalar(@Support::Files::testitems) +use Test::More tests => (scalar(@Support::Files::testitems) + + scalar(@Support::Files::test_files) + $Support::Templates::num_actual_files) * 3; -my @testitems = @Support::Files::testitems; +my @testitems = (@Support::Files::testitems, @Support::Files::test_files); for my $path (@Support::Templates::include_paths) { push(@testitems, map(File::Spec->catfile($path, $_), Support::Templates::find_actual_files($path))); diff --git a/t/006spellcheck.t b/t/006spellcheck.t index 07cd3ea8c..24e00242d 100644 --- a/t/006spellcheck.t +++ b/t/006spellcheck.t @@ -10,38 +10,22 @@ #Bugzilla Test 6# ####Spelling##### +use 5.10.1; +use strict; +use warnings; + use lib 't'; use Support::Files; -BEGIN { # yes the indenting is off, deal with it -#add the words to check here: -@evilwords = qw( -anyways -appearence -arbitary -cancelled -critera -databasa -dependan -existance -existant -paramater -refered -repsentation -suported -varsion -); - -$testcount = scalar(@Support::Files::testitems); -} - -use Test::More tests => $testcount; +# -1 because 006spellcheck.t must not be checked. +use Test::More tests => scalar(@Support::Files::testitems) + + scalar(@Support::Files::test_files) - 1; # Capture the TESTOUT from Test::More or Test::Builder for printing errors. # This will handle verbosity for us automatically. my $fh; { - local $^W = 0; # Don't complain about non-existent filehandles + no warnings qw(unopened); # Don't complain about non-existent filehandles if (-e \*Test::More::TESTOUT) { $fh = \*Test::More::TESTOUT; } elsif (-e \*Test::Builder::TESTOUT) { @@ -51,14 +35,34 @@ my $fh; } } -my @testitems = @Support::Files::testitems; +my @testitems = (@Support::Files::testitems, @Support::Files::test_files); + +#add the words to check here: +my @evilwords = qw( + anyways + appearence + arbitary + cancelled + critera + databasa + dependan + existance + existant + paramater + refered + repsentation + suported + varsion +); -# at last, here we actually run the test... my $evilwordsregexp = join('|', @evilwords); foreach my $file (@testitems) { $file =~ s/\s.*$//; # nuke everything after the first space (#comment) next if (!$file); # skip null entries + # Do not try to validate this file as it obviously contains a list + # of wrongly spelled words. + next if ($file eq 't/006spellcheck.t'); if (open (FILE, $file)) { # open the file for reading diff --git a/t/007util.t b/t/007util.t index 495102ffa..66c2df032 100644 --- a/t/007util.t +++ b/t/007util.t @@ -9,14 +9,18 @@ #Bugzilla Test 7# #####Util.pm##### +use 5.10.1; +use strict; +use warnings; + use lib 't'; use Support::Files; use Test::More tests => 17; use DateTime; BEGIN { - use_ok(Bugzilla); - use_ok(Bugzilla::Util); + use_ok('Bugzilla'); + use_ok('Bugzilla::Util'); } # We need to override user preferences so we can get an expected value when diff --git a/t/008filter.t b/t/008filter.t index 4977658bb..f0a26d13f 100644 --- a/t/008filter.t +++ b/t/008filter.t @@ -15,10 +15,11 @@ # Sample exploit code: '>"><script>alert('Oh dear...')</script> +use 5.10.1; use strict; -use lib qw(. lib t); +use warnings; -use vars qw(%safe); +use lib qw(. lib t); use Bugzilla::Constants; use Support::Templates; @@ -30,6 +31,7 @@ use Cwd; my $oldrecsep = $/; my $topdir = cwd; $/ = undef; +our %safe; foreach my $path (@Support::Templates::include_paths) { $path =~ s|\\|/|g if ON_WINDOWS; # convert \ to / in path if on windows @@ -80,13 +82,13 @@ foreach my $path (@Support::Templates::include_paths) { foreach my $file (@testitems) { # There are some files we don't check, because there is no need to # filter their contents due to their content-type. - if ($file =~ /\.(pm|txt|png)\.tmpl$/) { + if ($file =~ /\.(pm|txt|rst|png)\.tmpl$/) { ok(1, "($lang/$flavor) $file is filter-safe"); next; } - + # Read the entire file into a string - open (FILE, "<$file") || die "Can't open $file: $!\n"; + open (FILE, "<$file") || die "Can't open $file: $!\n"; my $slurp = <FILE>; close (FILE); diff --git a/t/009bugwords.t b/t/009bugwords.t index 66262655c..e36651edb 100644 --- a/t/009bugwords.t +++ b/t/009bugwords.t @@ -15,7 +15,9 @@ # "[% terms.bug %]". This test makes sure the relevant words aren't used # bare. +use 5.10.1; use strict; +use warnings; use lib 't'; @@ -60,15 +62,6 @@ foreach my $file (@testitems) { next; } } - - # "Bugzilla" - if (grep /(?<!X\-)Bugzilla(?!_|::|->|\.pm)/, $text) { - # Exclude JS comments, hyperlinks, USE, and variable assignment. - unless (grep /(\/\/.*|org.*>|api\/|USE |= )Bugzilla/, $text) { - push(@errors, [$lineno, $text]); - next; - } - } } if (scalar(@errors)) { diff --git a/t/010dependencies.t b/t/010dependencies.t index d84688a7e..afd29a652 100644 --- a/t/010dependencies.t +++ b/t/010dependencies.t @@ -10,7 +10,10 @@ #Bugzilla Test 10# ## dependencies ## +use 5.10.1; use strict; +use warnings; + use lib qw(. lib t); use Support::Files; @@ -27,7 +30,7 @@ use constant MODULE_REGEX => qr/ ['"]? ([\w:\.\\]+) /x; -use constant BASE_REGEX => qr/^use base qw\(([^\)]+)/; +use constant BASE_REGEX => qr/^use (?:base|parent) (?:-norequire, )?qw\(([^\)]+)/; # Extract all Perl modules. foreach my $file (@Support::Files::testitems) { @@ -59,7 +62,7 @@ foreach my $module (keys %mods) { } elsif ($line =~ BASE_REGEX or $line =~ MODULE_REGEX) { my $used_string = $1; - # "use base" can have multiple modules + # "use base"/"use parent" can have multiple modules my @used_array = split(/\s+/, $used_string); foreach my $used (@used_array) { next if $used !~ /^Bugzilla/; diff --git a/t/011pod.t b/t/011pod.t index c638dbcde..cba9111d1 100644 --- a/t/011pod.t +++ b/t/011pod.t @@ -10,20 +10,53 @@ #Bugzilla Test 11# ##POD validation## +use 5.10.1; use strict; +use warnings; use lib 't'; use Support::Files; use Pod::Checker; +use Pod::Coverage; -use Test::More tests => scalar(@Support::Files::testitems); +use Test::More tests => scalar(@Support::Files::testitems) + + scalar(@Support::Files::module_files); + +# These methods do not need to be documented by default. +use constant DEFAULT_WHITELIST => qr/^(?:new|new_from_list|check|run_create_validators)$/; + +# These subroutines do not need to be documented, generally because +# you shouldn't call them yourself. No need to include subroutines +# of the form _foo(); they are already treated as private. +use constant SUB_WHITELIST => ( + 'Bugzilla::Flag' => qr/^(?:(force_)?retarget|force_cleanup)$/, + 'Bugzilla::FlagType' => qr/^sqlify_criteria$/, + 'Bugzilla::JobQueue' => qr/(?:^work_once|work_until_done|subprocess_worker)$/, + 'Bugzilla::Search' => qr/^SPECIAL_PARSING$/, + 'Bugzilla::Template' => qr/^field_name$/, +); + +# These modules do not need to be documented, generally because they +# are subclasses of another module which already has all the relevant +# documentation. Partial names are allowed. +use constant MODULE_WHITELIST => qw( + Bugzilla::Auth::Login:: + Bugzilla::Auth::Persist:: + Bugzilla::Auth::Verify:: + Bugzilla::BugUrl:: + Bugzilla::Config:: + Bugzilla::Extension:: + Bugzilla::Job:: + Bugzilla::Migrate:: + docs::lib::Pod::Simple:: +); # Capture the TESTOUT from Test::More or Test::Builder for printing errors. # This will handle verbosity for us automatically. my $fh; { - local $^W = 0; # Don't complain about non-existent filehandles + no warnings qw(unopened); # Don't complain about non-existent filehandles if (-e \*Test::More::TESTOUT) { $fh = \*Test::More::TESTOUT; } elsif (-e \*Test::Builder::TESTOUT) { @@ -48,4 +81,50 @@ foreach my $file (@testitems) { } } +my %sub_whitelist = SUB_WHITELIST; +my @module_files = sort @Support::Files::module_files; + +foreach my $file (@module_files) { + my $module = $file; + $module =~ s/\.pm$//; + $module =~ s#/#::#g; + $module =~ s/^extensions/Bugzilla::Extension/; + + my @whitelist = (DEFAULT_WHITELIST); + push(@whitelist, $sub_whitelist{$module}) if $sub_whitelist{$module}; + + # XXX Once all methods are correctly documented, nonwhitespace should + # be set to 1. + my $cover = Pod::Coverage->new(package => $module, nonwhitespace => 0, + trustme => \@whitelist); + my $coverage = $cover->coverage; + my $reason = $cover->why_unrated; + + if (defined $coverage) { + if ($coverage == 1) { + ok(1, "$file has POD for all methods"); + } + else { + ok(0, "$file POD coverage is " . sprintf("%u%%", 100 * $coverage) . + ". Undocumented methods: " . join(', ', $cover->uncovered)); + } + } + # These errors are thrown when the module couldn't be loaded due to + # a missing dependency. + elsif ($reason =~ /^(?:no public symbols defined|requiring '[^']+' failed)$/) { + ok(1, "$file cannot be loaded"); + } + elsif ($reason eq "couldn't find pod") { + if (grep { $module =~ /^\Q$_\E/ } MODULE_WHITELIST) { + ok(1, "$file does not contain any POD (whitelisted)"); + } + else { + ok(0, "$file POD coverage is 0%"); + } + } + else { + ok(0, "$file: $reason"); + } +} + exit 0; diff --git a/t/012throwables.t b/t/012throwables.t index 7600cbd02..0ef043fa5 100644 --- a/t/012throwables.t +++ b/t/012throwables.t @@ -11,7 +11,10 @@ #Bugzilla Test 12# ######Errors###### +use 5.10.1; use strict; +use warnings; + use lib qw(. lib t); use Bugzilla::Constants; diff --git a/t/013dbschema.t b/t/013dbschema.t new file mode 100644 index 000000000..217176ff2 --- /dev/null +++ b/t/013dbschema.t @@ -0,0 +1,87 @@ +# 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. + +################## +#Bugzilla Test 13# +#####schema####### + +# Check the Bugzilla database schema to ensure no field names conflict +# with SQL reserved words. + +use 5.10.1; +use strict; +use warnings; + +use lib qw(. t lib); +use Bugzilla; +use Bugzilla::DB::Schema; + + +# SQL reserved words +use constant RESERVED_WORDS => qw( + ABSOLUTE ACTION ACTOR ADD AFTER ALL ALLOCATE ALTER ANY AND ARE AS ASC ASSERTION ASYNC AT + ATTRIBUTES BEFORE BEGIN BETWEEN BIT BIT_LENGTH BOOLEAN BOTH BREADTH BY CALL CASCADE + CASCADED CASE CAST CATALOG CHAR CHARACTER_LENGTH CHAR_LENGTH COLLATE + COLLATION COLUMN COMPLETION CONNECT CONNECTION CONSTRAINT CONSTRAINTS + CONVERT CORRESPONDING CREATE CROSS CURRENT_DATE CURRENT_PATH CURRENT_TIME + CURRENT_TIMESTAMP CURRENT_USER CYCLE DATA DATE DAY DEALLOCATE DECLARE DEFAULT DEFERRABLE + DEFERRED DELETE DEPTH DESC DESCRIBE DESCRIPTOR DESTROY DIAGNOSTICS DICTIONARY + DISCONNECT DISTINCT DO DOMAIN DROP EACH ELEMENT ELSE ELSEIF END END-EXEC EQUALS EXCEPT + EXCEPTION EXECUTE EXTERNAL EXTRACT FACTOR FALSE FIRST FOR FROM FULL GENERAL GET + GLOBAL GRANT GROUP HAVING HOLD HOUR IDENTITY IF IGNORE IMMEDIATE IN INITIALLY INNER INPUT + INSENSITIVE INSERT INSTEAD INTERSECT INTERVAL IS ISOLATION JOIN LAST LEADING LEAVE + LEFT LESS LEVEL LIMIT LIST LOCAL LOOP LOWER MATCH MINUTE MODIFY MONTH NAMES + NATIONAL NATURAL NCHAR NEW NEW_TABLE NEXT NO NONE NOT NULL NULLIF OBJECT + OCTET_LENGTH OFF OID OLD OLD_TABLE ONLY OPERATION OPERATOR OPERATORS OR ORDER OTHERS + OUTER OUTPUT OVERLAPS PAD PARAMETERS PARTIAL PATH PENDANT POSITION POSTFIX + PREFIX PREORDER PREPARE PRESERVE PRIOR PRIVATE PROTECTED READ RECURSIVE REF + REFERENCING RELATIVE REPLACE RESIGNAL RESTRICT RETURN RETURNS REVOKE RIGHT + ROLE ROUTINE ROW ROWS SAVEPOINT SCROLL SEARCH SECOND SELECT SENSITIVE SEQUENCE + SESSION SESSION_USER SIGNAL SIMILAR SIZE SPACE SQLEXCEPTION SQLSTATE + SQLWARNING START STATE STRUCTURE SUBSTRING SYMBOL SYSTEM_USER TABLE TEMPORARY + TERM TEST THEN THERE TIME TIMESTAMP TIMEZONE_HOUR TIMEZONE_MINUTE TRAILING + TRANSACTION TRANSLATE TRANSLATION TRIGGER TRIM TRUE TUPLE UNDER + UNKNOWN UNION UNIQUE UPDATE UPPER USAGE USING VARCHAR VARIABLE VARYING VIEW VIRTUAL VISIBLE + WAIT WHEN WHERE WHILE WITH WITHOUT WRITE YEAR ZONE +); + +# Few Exceptions are removed from the above list +# i.e. VALUE, TYPE, ALIAS, COALESCE + +our $dbh; +our $schema; +our @tables; + +BEGIN { + $schema = Bugzilla::DB::Schema->new("Mysql"); + @tables = $schema->get_table_list(); +} + +use Test::More tests => scalar(@tables); + +foreach my $table (@tables) { + my @reserved; + + if (grep { uc($table) eq $_ } RESERVED_WORDS) { + push(@reserved, $table); + } + + foreach my $column ($schema->get_table_columns($table)) { + if (grep { uc($column) eq $_ } RESERVED_WORDS) { + push(@reserved, $column); + } + } + + if (scalar @reserved) { + ok(0, "Table $table use reserved words: " . join(", ", @reserved)); + } + else { + ok(1, "Table $table does not use reserved words"); + } +} + +exit 0; diff --git a/t/Support/Files.pm b/t/Support/Files.pm index 63a99cab7..f3fae58fc 100644 --- a/t/Support/Files.pm +++ b/t/Support/Files.pm @@ -8,15 +8,19 @@ package Support::Files; +use 5.10.1; +use strict; +use warnings; + use File::Find; -@additional_files = (); +our @additional_files = (); -@files = glob('*'); -find(sub { push(@files, $File::Find::name) if $_ =~ /\.pm$/;}, 'Bugzilla'); -push(@files, 'extensions/create.pl'); +our @files = glob('*'); +find(sub { push(@files, $File::Find::name) if $_ =~ /\.pm$/;}, qw(Bugzilla docs)); +push(@files, 'extensions/create.pl', 'docs/makedocs.pl'); -@extensions = +our @extensions = grep { $_ ne 'extensions/create.pl' && ! -e "$_/disabled" } glob('extensions/*'); @@ -24,6 +28,8 @@ foreach my $extension (@extensions) { find(sub { push(@files, $File::Find::name) if $_ =~ /\.pm$/;}, $extension); } +our @test_files = glob('t/*.t'); + sub isTestingFile { my ($file) = @_; my $exclude; @@ -38,10 +44,13 @@ sub isTestingFile { return undef; } -foreach $currentfile (@files) { +our (@testitems, @module_files); + +foreach my $currentfile (@files) { if (isTestingFile($currentfile)) { - push(@testitems,$currentfile); + push(@testitems, $currentfile); } + push(@module_files, $currentfile) if $currentfile =~ /\.pm$/; } diff --git a/t/Support/Systemexec.pm b/t/Support/Systemexec.pm index 620cce25e..e73763f8f 100644 --- a/t/Support/Systemexec.pm +++ b/t/Support/Systemexec.pm @@ -6,14 +6,20 @@ # defined by the Mozilla Public License, v. 2.0. package Support::Systemexec; -require Exporter; -@ISA = qw(Exporter); -@EXPORT = qw(system exec); -@EXPORT_OK = qw(); + +use 5.10.1; +use strict; +use warnings; + +use parent qw(Exporter); +@Support::Systemexec::EXPORT = qw(system exec); + sub system($$@) { 1; } + sub exec($$@) { 1; } + 1; diff --git a/t/Support/Templates.pm b/t/Support/Templates.pm index a6242bbcf..d17c7334b 100644 --- a/t/Support/Templates.pm +++ b/t/Support/Templates.pm @@ -7,15 +7,15 @@ package Support::Templates; +use 5.10.1; use strict; +use warnings; use lib 't'; -use base qw(Exporter); -@Support::Templates::EXPORT = - qw(@languages @include_paths @english_default_include_paths - %include_path @referenced_files %actual_files $num_actual_files); -use vars qw(@languages @include_paths @english_default_include_paths - %include_path @referenced_files %actual_files $num_actual_files); +use parent qw(Exporter); +@Support::Templates::EXPORT = + qw(@languages @include_paths @english_default_include_paths + @referenced_files %actual_files $num_actual_files); use Bugzilla; use Bugzilla::Constants; @@ -25,18 +25,9 @@ use Support::Files; use File::Find; use File::Spec; -# The available template languages -@languages = (); - -# The colon separated includepath per language -%include_path = (); - -# All include paths -@include_paths = (); - # English default include paths -push @english_default_include_paths, - File::Spec->catdir(bz_locations()->{'templatedir'}, 'en', 'default'); +our @english_default_include_paths = + (File::Spec->catdir(bz_locations()->{'templatedir'}, 'en', 'default')); # And the extensions too foreach my $extension (@Support::Files::extensions) { @@ -47,19 +38,19 @@ foreach my $extension (@Support::Files::extensions) { } # Files which are referenced in the cgi files -@referenced_files = (); +our @referenced_files = (); # All files sorted by include_path -%actual_files = (); +our %actual_files = (); # total number of actual_files -$num_actual_files = 0; +our $num_actual_files = 0; # Set the template available languages and include paths -@languages = @{ Bugzilla->languages }; -@include_paths = @{ template_include_path({ language => Bugzilla->languages }) }; +our @languages = @{ Bugzilla->languages }; +our @include_paths = @{ template_include_path({ language => Bugzilla->languages }) }; -my @files; +our @files; # Local subroutine used with File::Find sub find_templates { diff --git a/taskgraph.json b/taskgraph.json index 6d8b77d6e..6d507fb20 100644 --- a/taskgraph.json +++ b/taskgraph.json @@ -3,7 +3,7 @@ "name": "Bugzilla Task Graph", "description": "A suite of tests to check the quality of the Bugzilla codebase.", "owner": "dlawrence@mozilla.com", - "source": "https://raw.githubusercontent.com/bugzilla/bugzilla/4.4/taskgraph.json" + "source": "https://raw.githubusercontent.com/bugzilla/bugzilla/5.0/taskgraph.json" }, "tasks": [ { @@ -32,7 +32,7 @@ "extra": { "treeherder": { "machine": { - "platform": "4.4" + "platform": "5.0" }, "symbol": "San" } @@ -65,7 +65,7 @@ "extra": { "treeherder": { "machine": { - "platform": "4.4" + "platform": "5.0" }, "symbol": "Doc" } @@ -103,7 +103,7 @@ "extra": { "treeherder": { "machine": { - "platform": "4.4" + "platform": "5.0" }, "symbol": "API" } @@ -146,7 +146,7 @@ "extra": { "treeherder": { "machine": { - "platform": "4.4" + "platform": "5.0" }, "symbol": "Sel" } @@ -184,7 +184,7 @@ "extra": { "treeherder": { "machine": { - "platform": "4.4" + "platform": "5.0" }, "symbol": "API-Pg" } @@ -227,7 +227,7 @@ "extra": { "treeherder": { "machine": { - "platform": "4.4" + "platform": "5.0" }, "symbol": "Sel-Pg" } diff --git a/template/en/default/account/auth/login-small.html.tmpl b/template/en/default/account/auth/login-small.html.tmpl index 818aa6b72..790c135bf 100644 --- a/template/en/default/account/auth/login-small.html.tmpl +++ b/template/en/default/account/auth/login-small.html.tmpl @@ -9,6 +9,9 @@ [%# Use the current script name. If an empty name is returned, # then we are accessing the home page. %] +[% USE Bugzilla %] +[% cgi = Bugzilla.cgi %] + [% login_target = cgi.url("-relative" => 1, "-query" => 1) %] [% IF !login_target OR login_target.match("^token.cgi") %] [% login_target = "index.cgi" %] @@ -25,76 +28,31 @@ onclick="return show_mini_login_form('[% qs_suffix %]')">Log In</a> [% Hook.process('additional_methods') %] - - <form action="[% login_target FILTER html %]" method="POST" + + <form action="[% login_target FILTER html %]" method="POST" class="mini_login bz_default_hidden" - id="mini_login[% qs_suffix FILTER html %]" - onsubmit="return check_mini_login_fields( '[% qs_suffix FILTER html %]' );" - > - <input id="Bugzilla_login[% qs_suffix FILTER html %]" - class="bz_login" - name="Bugzilla_login" - title="Login" - onfocus="mini_login_on_focus('[% qs_suffix FILTER js %]')" - > - <input class="bz_password" - id="Bugzilla_password[% qs_suffix FILTER html %]" - name="Bugzilla_password" - type="password" - title="Password" - > - <input class="bz_password bz_default_hidden bz_mini_login_help" type="text" - id="Bugzilla_password_dummy[% qs_suffix %]" value="password" - title="Password" - onfocus="mini_login_on_focus('[% qs_suffix FILTER js %]')" - > + id="mini_login[% qs_suffix FILTER html %]"> + <input id="Bugzilla_login[% qs_suffix FILTER html %]" required + name="Bugzilla_login" class="bz_login" + [% IF Param('emailsuffix') %] + placeholder="Login" + [% ELSE %] + type="email" placeholder="Email Address" + [% END %]> + <input class="bz_password" name="Bugzilla_password" type="password" + id="Bugzilla_password[% qs_suffix FILTER html %]" required + placeholder="Password"> [% IF Param('rememberlogin') == 'defaulton' || - Param('rememberlogin') == 'defaultoff' - %] + Param('rememberlogin') == 'defaultoff' %] <input type="checkbox" id="Bugzilla_remember[% qs_suffix %]" name="Bugzilla_remember" value="on" class="bz_remember" - [%+ "checked" IF Param('rememberlogin') == "defaulton" %]> + [%+ "checked" IF Param('rememberlogin') == "defaulton" %]> <label for="Bugzilla_remember[% qs_suffix %]">Remember</label> [% END %] <input type="hidden" name="Bugzilla_login_token" value="[% get_login_request_token() FILTER html %]"> <input type="submit" name="GoAheadAndLogIn" value="Log in" id="log_in[% qs_suffix %]"> - <script type="text/javascript"> - mini_login_constants = { - "login" : "login", - "warning" : "You must set the login and password before logging in." - }; - [%# We need this event to fire after autocomplete, because it does - # something different depending on whether or not there's already - # data in the login and password box. - # However, autocomplete happens at all sorts of different times in - # different browsers (before or after onDOMReady, before or after - # window.onload, in almost all combinations you can imagine). - # The only good solution I found is to time the event 200 - # milliseconds after window.onload for WebKit (doing it immediately - # at onload works in Chrome but not in Safari, but I can't detect - # them separately using YUI), and right after onDOMReady in Gecko. - # The WebKit solution is also fairly guaranteed to work on any - # browser (it's just strange, since the fields only populate 200 ms - # after the page loads), so it's the default. IE doesn't even - # recognize our forms as login forms, so I made it use the Gecko - # method also (since it's nicer visually). Opera never autocompletes - # forms without user interaction, so it also uses the Gecko method. - #%] - if (YAHOO.env.ua.gecko || YAHOO.env.ua.ie || YAHOO.env.ua.opera) { - YAHOO.util.Event.onDOMReady(function() { - init_mini_login_form('[% qs_suffix FILTER html %]'); - }); - } - else { - YAHOO.util.Event.on(window, 'load', function () { - window.setTimeout(function() { - init_mini_login_form('[% qs_suffix FILTER html %]'); - }, 200); - }); - } - </script> <a href="#" onclick="return hide_mini_login_form('[% qs_suffix %]')">[x]</a> </form> </li> @@ -105,11 +63,17 @@ <form action="token.cgi" method="post" id="forgot_form[% qs_suffix %]" class="mini_forgot bz_default_hidden"> <label for="login[% qs_suffix FILTER html %]">Login:</label> - <input type="text" name="loginname" size="20" id="login[% qs_suffix FILTER html %]"> + <input name="loginname" size="20" id="login[% qs_suffix FILTER html %]" required + [% IF Param('emailsuffix') %] + placeholder="Your Login" + [% ELSE %] + type="email" placeholder="Your Email Address" + [% END %]> <input id="forgot_button[% qs_suffix %]" value="Reset Password" type="submit"> <input type="hidden" name="a" value="reqpw"> - <input type="hidden" id="token[% qs_suffix FILTER html %]" name="token" value="[% issue_hash_token(['reqpw']) FILTER html %]"> + <input type="hidden" id="token[% qs_suffix FILTER html %]" name="token" + value="[% issue_hash_token(['reqpw']) FILTER html %]"> <a href="#" onclick="return hide_forgot_form('[% qs_suffix %]')">[x]</a> </form> </li> diff --git a/template/en/default/account/auth/login.html.tmpl b/template/en/default/account/auth/login.html.tmpl index 77a1ba2d6..0af84542d 100644 --- a/template/en/default/account/auth/login.html.tmpl +++ b/template/en/default/account/auth/login.html.tmpl @@ -15,8 +15,7 @@ [% END %] [% PROCESS global/header.html.tmpl - title = "Log in to $terms.Bugzilla", - onload = "document.forms['login'].Bugzilla_login.focus()" + title = "Log in to $terms.Bugzilla" %] [% USE Bugzilla %] @@ -25,20 +24,29 @@ [% terms.Bugzilla %] needs a legitimate login and password to continue. </p> -<form name="login" action="[% target FILTER html %]" method="POST" +<form name="login" action="[% urlbase FILTER html %][% target FILTER html %]" method="POST" [%- IF Bugzilla.cgi.param("data") %] enctype="multipart/form-data"[% END %]> <table> <tr> - <th align="right"><label for="Bugzilla_login">Login:</label></th> + <th> + <label for="Bugzilla_login"> + [% IF Param('emailsuffix') %] + Login: + [% ELSE %] + Your Email Address: + [% END %] + </label> + </th> <td> - <input size="35" id="Bugzilla_login" name="Bugzilla_login"> + <input size="35" id="Bugzilla_login" name="Bugzilla_login" + [%- ' type="email"' UNLESS Param('emailsuffix') %] autofocus required> [% Param('emailsuffix') FILTER html %] </td> </tr> <tr> - <th align="right"><label for="Bugzilla_password">Password:</label></th> + <th><label for="Bugzilla_password">Password:</label></th> <td> - <input type="password" size="35" id="Bugzilla_password" name="Bugzilla_password"> + <input type="password" size="35" id="Bugzilla_password" name="Bugzilla_password" required> </td> </tr> @@ -91,7 +99,7 @@ If you don't have a [% terms.Bugzilla %] account, you can <a href="createaccount.cgi">create a new account</a>. [% IF Param("requirelogin") %] - A user account is required because this [% terms.Bugzilla %] + A user account is required because this Bugzilla installation is only accessible to authenticated users. [% ELSIF target.match("_bug\.cgi$") %] A user account is required to file a new [% terms.bug %] or to comment @@ -109,7 +117,7 @@ If you have an account, but have forgotten your password, enter your login name below and submit a request to change your password.<br> - <input size="35" name="loginname"> + <input size="35" name="loginname" required> <input type="hidden" id="token" name="token" value="[% issue_hash_token(['reqpw']) FILTER html %]"> <input type="submit" id="request" value="Reset Password"> </form> diff --git a/template/en/default/account/cancel-token.txt.tmpl b/template/en/default/account/cancel-token.txt.tmpl index b9a7dd82e..384f2cfe0 100644 --- a/template/en/default/account/cancel-token.txt.tmpl +++ b/template/en/default/account/cancel-token.txt.tmpl @@ -11,7 +11,7 @@ To: [% emailaddress %] Subject: [% PROCESS subject %] X-Bugzilla-Type: admin -A request was canceled from [% remoteaddress %]. +[% PROCESS subject %] from [% remoteaddress %]. If you did not request this, it could be either an honest mistake or someone attempting to break into your [% terms.Bugzilla %] account. @@ -81,7 +81,7 @@ Canceled Because: [% PROCESS cancelactionmessage %] [% ELSE %] [%# Give sensible error if the cancel-token function is used incorrectly. #%] - You are using [% terms.Bugzilla %]'s cancel-token function incorrectly. You + You are using Bugzilla's cancel-token function incorrectly. You passed in the string '[% cancelaction %]'. The correct use is to pass in a tag, and define that tag in the file <kbd>cancel-token.txt.tmpl</kbd>. diff --git a/template/en/default/account/create.html.tmpl b/template/en/default/account/create.html.tmpl index b5193c2f6..fe266e7e0 100644 --- a/template/en/default/account/create.html.tmpl +++ b/template/en/default/account/create.html.tmpl @@ -13,13 +13,9 @@ # Param("emailsuffix") is used to pre-fill the email field. #%] -[% title = BLOCK %] - Create a new [% terms.Bugzilla %] account -[% END %] - [% PROCESS global/header.html.tmpl - title = title - onload = "document.forms['account_creation_form'].login.focus();" %] + title = "Create a new $terms.Bugzilla account" +%] <p> To create a [% terms.Bugzilla %] account, all you need to do is to enter @@ -32,16 +28,28 @@ You will receive an email at this address to confirm the creation of your account. <b>You will not be able to log in until you receive the email.</b> If it doesn't arrive within a reasonable amount of time, you may contact - the maintainer of this [% terms.Bugzilla %] installation + the maintainer of this Bugzilla installation at <a href="mailto:[% Param("maintainer") %]">[% Param("maintainer") %]</a>. </p> +[% IF Param('allowemailchange') %] +<p> + If you already have an account and want to change your + [% IF Param('emailsuffix') == '' %] + email address, + [% ELSE %] + login name, + [% END %] + you can change it from the Preferences page after logging in. +</p> +[% END %] + <p> A user account is required to report new [% terms.bugs %] or to comment into existing ones, as you may be contacted for more information if needed. This also lets other users clearly identify who is the author of comments or changes made into [% terms.bugs %]. <b>Note that your email address will - <u>never</u> be displayed to logged out users. Only registered users will be + <em>never</em> be displayed to logged out users. Only registered users will be able to see it.</b> </p> @@ -60,18 +68,16 @@ too many mail bounces later when developers follow up bugs.</b> [% END %] <form id="account_creation_form" method="get" action="createaccount.cgi"> - <table> - <tr> - <td align="right"> - <b>Email address:</b> - </td> - <td> - <input size="35" id="login" name="login"> - [% Param('emailsuffix') FILTER html %] - </td> - </tr> - </table> - <br> + <span class="label"> + [% IF Param('emailsuffix') %] + Login: + [% ELSE %] + Email address: + [% END %] + </span> + <input size="35" id="login" name="login" autofocus + [%- ' type="email"' UNLESS Param('emailsuffix') %] required> + [% Param('emailsuffix') FILTER html %] <input type="hidden" id="token" name="token" value="[% issue_hash_token(['create_account']) FILTER html %]"> <input type="submit" id="send" value="Send"> </form> diff --git a/template/en/default/account/email/confirm-new.html.tmpl b/template/en/default/account/email/confirm-new.html.tmpl index 0fb9b7e7d..3b9866004 100644 --- a/template/en/default/account/email/confirm-new.html.tmpl +++ b/template/en/default/account/email/confirm-new.html.tmpl @@ -15,7 +15,9 @@ [% title = BLOCK %]Create a new user account for '[% email FILTER html %]'[% END %] [% PROCESS "global/header.html.tmpl" title = title - onload = "document.forms['confirm_account_form'].realname.focus();" %] +%] + +[% password_complexity = Param('password_complexity') %] <p> To create your account, you must enter a password in the form below. @@ -28,26 +30,34 @@ <input type="hidden" name="a" value="confirm_new_account"> <table> <tr> - <th align="right">Email Address:</th> + <th>Email Address:</th> <td>[% email FILTER html %]</td> </tr> <tr> - <th align="right"><small><i>(OPTIONAL)</i></small> <label for="realname">Real Name</label>:</th> - <td><input type="text" id="realname" name="realname" value=""></td> + <th><small><i>(OPTIONAL)</i></small> <label for="realname">Real Name</label>:</th> + <td><input id="realname" name="realname" autofocus></td> </tr> <tr> - <th align="right"><label for="passwd1">Type your password</label>:</th> + <th><label for="passwd1">Type your password</label>:</th> <td> - <input type="password" id="passwd1" name="passwd1" value=""> - (minimum [% constants.USER_PASSWORD_MIN_LENGTH FILTER none %] characters) + <input type="password" id="passwd1" name="passwd1" value="" required> + (Password should be a minimum of [% constants.USER_PASSWORD_MIN_LENGTH FILTER none %] characters long + [% IF password_complexity == "mixed_letters" %] + and must contain at least one UPPER and one lowercase letter + [% ELSIF password_complexity == "letters_numbers" %] + and must contain at least one UPPER and one lowercase letter and a number + [% ELSIF password_complexity == "letters_numbers_specialchars" %] + and must contain at least one letter, a number and a special character + [% END ~%] + .) </td> </tr> <tr> - <th align="right"><label for="passwd2">Confirm your password</label>:</th> - <td><input type="password" id="passwd2" name="passwd2" value=""></td> + <th><label for="passwd2">Confirm your password</label>:</th> + <td><input type="password" id="passwd2" name="passwd2" value="" required></td> </tr> <tr> - <th align="right"> </th> + <th> </th> <td><input type="submit" id="confirm" value="Create"></td> </tr> </table> @@ -55,7 +65,7 @@ <p> This account will not be created if this form is not completed by - <u>[% expiration_ts FILTER time("%B %e, %Y at %H:%M %Z") %]</u>. + <b>[% expiration_ts FILTER time("%B %e, %Y at %H:%M %Z") %]</b>. </p> <p> diff --git a/template/en/default/account/email/confirm.html.tmpl b/template/en/default/account/email/confirm.html.tmpl index 5b547782d..8edc7a9ba 100644 --- a/template/en/default/account/email/confirm.html.tmpl +++ b/template/en/default/account/email/confirm.html.tmpl @@ -22,11 +22,11 @@ <input type="hidden" name="a" value="chgem"> <table> <tr> - <th align="right">Password:</th> - <td><input type="password" name="password" size="36"></td> + <th>Password:</th> + <td><input type="password" name="password" size="36" required></td> </tr> <tr> - <th align="right"> </th> + <th> </th> <td><input type="submit" id="confirm" value="Submit"></td> </tr> </table> diff --git a/template/en/default/account/password/forgotten-password.txt.tmpl b/template/en/default/account/password/forgotten-password.txt.tmpl index 0c135a9ed..de2e79596 100644 --- a/template/en/default/account/password/forgotten-password.txt.tmpl +++ b/template/en/default/account/password/forgotten-password.txt.tmpl @@ -12,7 +12,9 @@ Subject: [% terms.Bugzilla %] Change Password Request X-Bugzilla-Type: admin You have (or someone impersonating you has) requested to change your -[%+ terms.Bugzilla %] password. To complete the change, visit the following link: +[%+ terms.Bugzilla %] password. The request originated from [% ip_addr %]. + +To complete the change, visit the following link: [%+ urlbase %]token.cgi?t=[% token FILTER uri %]&a=cfmpw @@ -24,3 +26,7 @@ this request, visit the following link: If you do nothing, the request will lapse after [% constants.MAX_TOKEN_AGE %] days (on [% expiration_ts FILTER time("%B %e, %Y at %H:%M %Z", timezone) %]) or when you log in successfully. + +If you think someone tried to compromise your account, please inform +[%+ Param('maintainer') %] with the IP address reported above +and the exact time when you got this email. diff --git a/template/en/default/account/password/set-forgotten-password.html.tmpl b/template/en/default/account/password/set-forgotten-password.html.tmpl index 95e4d3fcf..eca11174f 100644 --- a/template/en/default/account/password/set-forgotten-password.html.tmpl +++ b/template/en/default/account/password/set-forgotten-password.html.tmpl @@ -28,21 +28,21 @@ <input type="hidden" name="a" value="chgpw"> <table> <tr> - <th align="right">New Password:</th> + <th>New password:</th> <td> - <input type="password" name="password"> + <input type="password" name="password" required> </td> </tr> <tr> - <th align="right">New Password Again:</th> + <th>Confirm new password:</th> <td> - <input type="password" name="matchpassword"> + <input type="password" name="matchpassword" required> </td> </tr> - + <tr> - <th align="right"> </th> + <th> </th> <td> <input type="submit" id="update" value="Submit"> </td> diff --git a/template/en/default/account/prefs/account.html.tmpl b/template/en/default/account/prefs/account.html.tmpl index 59e4ab76a..af1df315e 100644 --- a/template/en/default/account/prefs/account.html.tmpl +++ b/template/en/default/account/prefs/account.html.tmpl @@ -21,7 +21,7 @@ </td> </tr> <tr> - <th align="right">Password:</th> + <th>Password:</th> <td> <input type="hidden" name="old_login" value="[% user.login FILTER html %]"> <input type="password" name="old_password"> @@ -34,22 +34,22 @@ [% IF user.authorizer.can_change_password %] <tr> - <th align="right">New password:</th> + <th>New password:</th> <td> <input type="password" name="new_password1"> </td> - </tr> + </tr> <tr> - <th align="right">Confirm new password:</th> + <th>Confirm new password:</th> <td> <input type="password" name="new_password2"> </td> - </tr> + </tr> [% END %] <tr> - <th align="right">Your real name (optional, but encouraged):</th> + <th>Your real name (optional, but encouraged):</th> <td> <input size="35" name="realname" value="[% realname FILTER html %]"> </td> @@ -59,28 +59,35 @@ [% IF login_change_date %] [% IF new_login_name %] <tr> - <th align="right">Pending email address:</th> + <th>Pending email address:</th> <td>[% new_login_name FILTER html %]</td> </tr> <tr> - <th align="right">Change request expires:</th> + <th>Change request expires:</th> <td>[% login_change_date FILTER time %]</td> </tr> [% ELSE %] <tr> - <th align="right">Confirmed email address:</th> + <th>Confirmed email address:</th> <td>[% user.login FILTER html %]</td> </tr> <tr> - <th align="right">Completion date:</th> + <th>Completion date:</th> <td>[% login_change_date FILTER time %]</td> </tr> [% END %] [% ELSE %] <tr> - <th align="right">New email address:</th> + <th> + [% IF Param('emailsuffix') %] + New login: + [% ELSE %] + New email address: + [% END %] + </th> <td> - <input size="35" name="new_login_name"> + <input size="35" id="new_login_name" name="new_login_name" + [%- ' type="email"' UNLESS Param('emailsuffix') %]> </td> </tr> [% END %] diff --git a/template/en/default/account/prefs/apikey.html.tmpl b/template/en/default/account/prefs/apikey.html.tmpl new file mode 100644 index 000000000..bed3f3809 --- /dev/null +++ b/template/en/default/account/prefs/apikey.html.tmpl @@ -0,0 +1,84 @@ +[%# 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. + #%] + +[%# INTERFACE: + # api_keys: array. Array of api keys this user has. + # any_revoked: boolean. True is any keys have been revoked. + #%] + +<p> + API keys are used to authenticate WebService API calls. You can create more than + one API key if required. Each API key has an optional description which can help + you record what each key is used for. Documentation on how to log in is + available from + <a href="[% docs_urlbase FILTER html %]api/Bugzilla/WebService.html#LOGGING_IN">here</a>. +</p> + +<h3>Existing API keys</h3> + +<p>You can update the description, and revoke or unrevoke existing API keys +here.</p> + +<table id="email_prefs"> + <tr class="column_header"> + <th>API key</th> + <th>Description (optional)</th> + <th>Last used</th> + <th>Revoked</th> + </tr> + + [% FOREACH api_key IN api_keys %] + <tr[% IF api_key.revoked %] class="apikey_revoked"[% END %]> + <td>[% api_key.api_key FILTER html %]</td> + <td> + <input name="description_[% api_key.id FILTER html %]" + id="description_[% api_key.id FILTER html %]" + value="[% api_key.description FILTER html %]"> + </td> + [% IF api_key.last_used %] + <td>[% api_key.last_used FILTER time %]</td> + [% ELSE %] + <td class="center"><i>never used</i></td> + [% END %] + <td class="center"> + <input type="checkbox" value="1" + name="revoked_[% api_key.id FILTER html %]" + id="revoked_[% api_key.id FILTER html %]" + [% IF api_key.revoked %] checked="checked" [% END %]> + </td> + </tr> + [% END %] + [% UNLESS api_keys.size %] + <tr><td colspan="4">You don't have any API keys.</td></tr> + [% END %] +</table> + +[% IF any_revoked %] + <a id="apikey_revoked_controller" class="bz_default_hidden" + href="javascript:TUI_toggle_class('apikey_revoked')">Hide Revoked Keys</a> + [%# Show the link if the browser supports JS %] + <script type="text/javascript"> + TUI_hide_default('apikey_revoked'); + TUI_alternates['apikey_revoked'] = 'Show Revoked Keys'; + YAHOO.util.Dom.removeClass('apikey_revoked_controller', + 'bz_default_hidden'); + </script> +[% END %] + +<h3>New API key</h3> + +<p>You can generate a new API key by ticking the check box below and optionally +providing a description for the API key. The API key will be randomly +generated for you.</p> + +<p> + <input type="checkbox" name="new_key" id="new_key"> + Generate a new API key with optional description + <input name="new_description" id="new_description"> +</p> + diff --git a/template/en/default/account/prefs/email.html.tmpl b/template/en/default/account/prefs/email.html.tmpl index 57fa60f3b..052484174 100644 --- a/template/en/default/account/prefs/email.html.tmpl +++ b/template/en/default/account/prefs/email.html.tmpl @@ -47,7 +47,10 @@ function SetCheckboxes(setting) { for (var count = 0; count < document.userprefsform.elements.length; count++) { var theinput = document.userprefsform.elements[count]; - if (theinput.type == "checkbox" && !theinput.disabled) { + if (theinput.type == "checkbox" + && !theinput.disabled + && !theinput.name.match("remove_ignored_bug")) + { if (theinput.name.match("neg")) { theinput.checked = !setting; } @@ -57,61 +60,36 @@ function SetCheckboxes(setting) { } } } - -document.write('<input type="button" value="Enable All Mail" onclick="SetCheckboxes(true); return false;">\n'); -document.write('<input type="button" value="Disable All Mail" onclick="SetCheckboxes(false); return false;">\n'); // --> </script> +<input type="button" value="Enable All Mail" onclick="SetCheckboxes(true); return false;"> +<input type="button" value="Disable All Mail" onclick="SetCheckboxes(false); return false;"> + <hr> -<table> - <tr> - <td colspan="2"> - <b>Global options:</b> - </td> - </tr> +<h3>Global options</h3> + +[% prefname = "email-$constants.REL_ANY-$constants.EVT_FLAG_REQUESTED" %] +<input type="checkbox" name="[% prefname %]" id="[% prefname %]" value="1" + [%+ 'checked="checked"' IF user.mail_settings.${constants.REL_ANY}.${constants.EVT_FLAG_REQUESTED} %]> +<label for="[% prefname %]">Email me when someone asks me to set a flag</label> +<br> +[% prefname = "email-$constants.REL_ANY-$constants.EVT_REQUESTED_FLAG" %] +<input type="checkbox" name="[% prefname %]" id="[% prefname %]" value="1" + [%+ 'checked="checked"' IF user.mail_settings.${constants.REL_ANY}.${constants.EVT_REQUESTED_FLAG} %]> +<label for="[% prefname %]">Email me when someone sets a flag I asked for</label> - <tr> - <td width="150"></td> - <td> - [% prefname = "email-$constants.REL_ANY-$constants.EVT_FLAG_REQUESTED" %] - <input type="checkbox" name="[% prefname %]" id="[% prefname %]" - value="1" - [% " checked" - IF user.mail_settings.${constants.REL_ANY}.${constants.EVT_FLAG_REQUESTED} %]> - <label for="[% prefname %]">Email me when someone asks me to set a flag</label> - <br> - </td> - </tr> - <tr> - <td width="150"></td> - <td> - [% prefname = "email-$constants.REL_ANY-$constants.EVT_REQUESTED_FLAG" %] - <input type="checkbox" name="[% prefname %]" id="[% prefname %]" - value="1" - [% " checked" - IF user.mail_settings.${constants.REL_ANY}.${constants.EVT_REQUESTED_FLAG} %]> - <label for="[% prefname %]">Email me when someone sets a flag I asked for</label> - <br> - </td> - </tr> [% IF user.is_global_watcher %] - <tr> - <td width="150"></td> - <td> - You are watching all [% terms.bugs %]. To be removed from this role, - contact - <a href="mailto:[% Param("maintainer") %]">[% Param("maintainer") %]</a>. - </td> - </tr> + <p> + You are watching all [% terms.bugs %]. To be removed from this role, contact + <a href="mailto:[% Param("maintainer") %]">[% Param("maintainer") %]</a>. + </p> [% END %] -</table> <hr> -<b>Field/recipient specific options:</b> -<br> -<br> + +<h3>Field/recipient specific options</h3> [% events = [ { id = constants.EVT_ADDED_REMOVED, @@ -129,7 +107,7 @@ document.write('<input type="button" value="Disable All Mail" onclick="SetCheckb { id = constants.EVT_ATTACHMENT, description = "New attachments are added" }, { id = constants.EVT_ATTACHMENT_DATA, - description = "Some attachment data changes" }, + description = "Attachment details changes" }, { id = constants.EVT_KEYWORD, description = "The keywords field changes" }, { id = constants.EVT_CC, @@ -169,40 +147,34 @@ document.write('<input type="button" value="Disable All Mail" onclick="SetCheckb [% num_columns = relationships.size %] -<table class="bz_emailprefs" border="1"> - <tr> - <td colspan="[% num_columns FILTER html %]" align="center" width="50%"> - <b>When my relationship to this [% terms.bug %] is:</b> - </td> - <td rowspan="2" width="40%"> - <b>I want to receive mail when:</b> - </td> +<table id="email_prefs"> + <tr class="column_header"> + <th colspan="[% num_columns FILTER html %]"> + When my relationship to this [% terms.bug %] is: + </th> + <th>I want to receive mail when:</th> </tr> <tr> [% FOREACH relationship = relationships %] - <th align="center" width="9%"> - [% relationship.description FILTER html %] - </th> + <th class="role_header">[% relationship.description FILTER html %]</th> [% END %] </tr> - + [% FOREACH event = events %] [% count = loop.count() %] <tr class="bz_row_[% count % 2 == 1 ? "odd" : "even" %]"> [% FOREACH relationship = relationships %] - <td align="center"> - <input type="checkbox" - name="email-[% relationship.id %]-[% event.id %]" - value="1" - [%# The combinations don't always make sense; disable a couple %] - [% IF event.id == constants.EVT_ADDED_REMOVED AND - no_added_removed.contains(relationship.id) - %] - disabled - [% ELSIF user.mail_settings.${relationship.id}.${event.id} %] - checked - [% END %]> + <td class="center"> + <input type="checkbox" value="1" + name="email-[% relationship.id %]-[% event.id %]" + [%# The combinations don't always make sense; disable a couple %] + [% IF event.id == constants.EVT_ADDED_REMOVED + AND no_added_removed.contains(relationship.id) %] + disabled="disabled" + [% ELSIF user.mail_settings.${relationship.id}.${event.id} %] + checked="checked" + [% END %]> </td> [% END %] <td> @@ -210,62 +182,54 @@ document.write('<input type="button" value="Disable All Mail" onclick="SetCheckb </td> </tr> [% END %] - - <tr> - <td colspan="[% num_columns FILTER html %]" - align="center" width="50%"> - - </td> - <td width="40%"> - <b>but not when (overrides above):</b> - </td> + + <tr class="column_header"> + <th colspan="[% num_columns FILTER html %]"> </th> + <th>but not when (overrides above):</th> </tr> [% FOREACH event = neg_events %] [% count = loop.count() %] <tr class="bz_row_[% count % 2 == 1 ? "odd" : "even" %]"> [% FOREACH relationship = relationships %] - <td align="center"> - <input type="checkbox" - name="neg-email-[% relationship.id %]-[% event.id %]" - value="1" - [% " checked" IF NOT user.mail_settings.${relationship.id}.${event.id} %]> + <td class="center"> + <input type="checkbox" value="1" + name="neg-email-[% relationship.id %]-[% event.id %]" + [%+ 'checked="checked"' IF NOT user.mail_settings.${relationship.id}.${event.id} %]> </td> [% END %] - <td> - [% event.description FILTER html %] - </td> + <td>[% event.description FILTER html %]</td> </tr> [% END %] - </table> <hr> -<b>User Watching</b> + +<h3>User Watching</h3> <p> If you watch a user, it is as if you are standing in their shoes for the -purposes of getting email. Email is sent or not according to <u>your</u> -preferences for <u>their</u> relationship to the [% terms.bug %] +purposes of getting email. Email is sent or not according to <em>your</em> +preferences for <em>their</em> relationship to the [% terms.bug %] (e.g. Assignee). </p> -<p> [% IF watchedusers.size %] -You are watching everyone in the following list: - </p> + <p>You are watching everyone in the following list:</p> <p> <select id="watched_by_you" name="watched_by_you" multiple="multiple" size="5"> [% FOREACH w = watchedusers %] <option value="[% w FILTER html %]">[% w FILTER html %]</option> [% END %] - </select> <br /> + </select> + <br> <input type="checkbox" id="remove_watched_users" name="remove_watched_users"> <label for="remove_watched_users">Remove selected users from my watch list</label> + </p> [% ELSE %] -You are currently not watching any users. + <p>You are currently not watching any users.</p> [% END %] -</p> + <p id="new_watched_by_you">Add users to my watch list (comma separated list): [% INCLUDE global/userselect.html.tmpl @@ -275,7 +239,7 @@ You are currently not watching any users. size => 60 multiple => 5 %] -</p> +</p> <p id="watching_you">Users watching you:<br> [% IF watchers.size %] @@ -289,4 +253,42 @@ You are currently not watching any users. <hr> -<br> +<h3>Ignore [% terms.Bugs %]</h3> + +<p> + You can specify a list of [% terms.bugs %] from which you never want to get + any email notification of any kind by adding their ID(s) as a comma-separated + list. Removing [% terms.abug %] by selecting it from the current ignored list + will re-enable email notifications for the [% terms.bug %]. +</p> +[% IF user.bugs_ignored.size %] + <p> + You are currently ignoring: + <table> + [% FOREACH bug = user.bugs_ignored %] + <tr> + <td> + <input type="checkbox" name="remove_ignored_bug_[% bug.id FILTER html %]" value="1"> + </td> + <td><a href="[% urlbase FILTER html %]show_bug.cgi?id=[% bug.id FILTER uri %]"> + [% bug.id FILTER html %]</a> + </td> + <td>[% bug.status FILTER html %]</td> + <td> + [% IF user.can_see_bug(bug.id) %] + - [% bug.summary FILTER html %] + [% ELSE %] + (private) + [% END %] + </td> + </tr> + [% END %] + </table> + </p> +[% END %] + +<p> + Add [% terms.bugs %]:<br> + <input type="text" id="add_ignored_bugs" + name="add_ignored_bugs" size="60"> +</p> diff --git a/template/en/default/account/prefs/permissions.html.tmpl b/template/en/default/account/prefs/permissions.html.tmpl index 450765afc..53583f35b 100644 --- a/template/en/default/account/prefs/permissions.html.tmpl +++ b/template/en/default/account/prefs/permissions.html.tmpl @@ -17,12 +17,11 @@ # other people. #%] -<table align="center"> - <tr> - <td> + <div id="permissions"> [% IF has_bits.size %] - You have the following permission bits set on your account: - <table align="center"> + <p>You have the following permission bits set on your account:</p> + + <table> [% FOREACH bit_description = has_bits %] <tr> <td>[% bit_description.name FILTER html %]</td> @@ -34,46 +33,47 @@ [% FOREACH privs = ["editcomponents", "canconfirm", "editbugs"] %] [% SET products = ${"local_$privs"} %] [% IF products && products.size %] - <br> <p> You also have local '[% privs FILTER html %]' privileges for the following products: </p> - <p> + <ul> [% FOREACH product = products %] - [% product.name FILTER html %]<br> + <li>[% product.name FILTER html %]</li> [% END %] - </p> + </ul> [% END %] [% END %] [% ELSE %] - There are no permission bits set on your account. + <p>There are no permission bits set on your account.</p> [% END %] [% IF user.in_group('editusers') %] - <br> - You have editusers privileges. You can turn on and off - all permissions for all users. + <p> + You have editusers privileges. You can turn on and off all + permissions for all users. + </p> [% ELSIF set_bits.size %] - <br> - And you can turn on or off the following bits for - <a href="editusers.cgi">other users</a>: - <table align="center"> + <p> + And you can turn on or off the following bits for + <a href="editusers.cgi">other users</a>: + </p> + + <table> [% FOREACH bit_description = set_bits %] <tr> <td>[% bit_description.name FILTER html %]</td> <td>[% bit_description.desc FILTER html_light %]</td> </tr> [% END %] - </table> + </table> [% END %] [% IF user.in_group('bz_sudoers') %] - <br> - You are a member of the <b>bz_sudoers</b> group, so you can - <a href="relogin.cgi?action=prepare-sudo">impersonate someone else</a>. + <p> + You are a member of the <b>bz_sudoers</b> group, so you can + <a href="relogin.cgi?action=prepare-sudo">impersonate someone else</a>. + </p> [% END %] - </td> - </tr> -</table> + </div> diff --git a/template/en/default/account/prefs/prefs.html.tmpl b/template/en/default/account/prefs/prefs.html.tmpl index 4416c95dd..8875eb26f 100644 --- a/template/en/default/account/prefs/prefs.html.tmpl +++ b/template/en/default/account/prefs/prefs.html.tmpl @@ -23,25 +23,25 @@ #%] [% filtered_login = user.login FILTER html %] -[% PROCESS global/header.html.tmpl - title = "User Preferences" - subheader = filtered_login - style_urls = ['skins/standard/admin.css'] - javascript_urls = ['js/util.js', 'js/field.js'] - doc_section = "userpreferences.html" - yui = ['autocomplete'] - %] [% tabs = [{ name => "settings", label => "General Preferences", - link => "userprefs.cgi?tab=settings", saveable => "1" }, - { name => "email", label => "Email Preferences", - link => "userprefs.cgi?tab=email", saveable => "1" }, - { name => "saved-searches", label => "Saved Searches", - link => "userprefs.cgi?tab=saved-searches", saveable => "1" }, + link => "userprefs.cgi?tab=settings", saveable => "1", + doc_section => "using/preferences.html#general-preferences" }, + { name => "email", label => "Email Preferences", + link => "userprefs.cgi?tab=email", saveable => "1", + doc_section => "using/preferences.html#email-preferences" }, + { name => "saved-searches", label => "Saved Searches", + link => "userprefs.cgi?tab=saved-searches", saveable => "1", + doc_section => "using/preferences.html#saved-searches" }, { name => "account", label => "Account Information", - link => "userprefs.cgi?tab=account", saveable => "1" }, - { name => "permissions", label => "Permissions", - link => "userprefs.cgi?tab=permissions", saveable => "0" } ] %] + link => "userprefs.cgi?tab=account", saveable => "1", + doc_section => "using/preferences.html#account-information" }, + { name => "apikey", label => "API Keys", + link => "userprefs.cgi?tab=apikey", saveable => "1", + doc_section => "using/preferences.html#api-keys" }, + { name => "permissions", label => "Permissions", + link => "userprefs.cgi?tab=permissions", saveable => "0", + doc_section => "using/preferences.html#permissions" } ] %] [% Hook.process('tabs') %] @@ -52,6 +52,16 @@ [% END %] [% END %] +[% PROCESS global/header.html.tmpl + title = current_tab.label + subheader = filtered_login + generate_api_token = 1 + style_urls = ['skins/standard/admin.css'] + javascript_urls = ['js/util.js', 'js/field.js', 'js/TUI.js'] + doc_section = current_tab.doc_section + yui = ['autocomplete'] + %] + [% WRAPPER global/tabs.html.tmpl tabs = tabs current_tab = current_tab @@ -63,8 +73,9 @@ [% IF email_changes_saved %] <p> - An email has been sent to both old and new email - addresses to confirm the change of email address. + In order to confirm your request, we have sent an email to your + new email address. As a precaution, an email has also been sent + to your old address allowing you to cancel this change if needed. </p> [% END %] </div> @@ -83,16 +94,10 @@ [% IF current_tab.saveable %] <input type="hidden" name="dosave" value="1"> - [% UNLESS dont_show_button %] - <table> - <tr> - <td width="150"> </td> - <td> - <input type="submit" id="update" value="Submit Changes"> - </td> - </tr> - </table> + <p> + <input type="submit" id="update" value="Submit Changes"> + </p> [% END %] </form> [% END %] diff --git a/template/en/default/account/prefs/saved-searches.html.tmpl b/template/en/default/account/prefs/saved-searches.html.tmpl index 11d7ef868..9b0447a83 100644 --- a/template/en/default/account/prefs/saved-searches.html.tmpl +++ b/template/en/default/account/prefs/saved-searches.html.tmpl @@ -30,58 +30,40 @@ <p>Your saved searches are as follows:</p> -<blockquote> - <table border="1" cellpadding="3"> - <tr> - <th> - Search - </th> - <th> - Run - </th> - <th> - Edit - </th> - <th> - Forget - </th> - <th> - Show in - Footer - </th> + <table id="saved_search_prefs"> + <tr class="column_header"> + <th>Search</th> + <th>Run</th> + <th>Edit</th> + <th>Forget</th> + <th>Show in Footer</th> [% may_share = user.in_group(Param('querysharegroup')) && queryshare_groups.size %] [% IF may_share %] - <th> - Share With a Group - </th> + <th>Share With a Group</th> [% END %] + [% Hook.process('saved-header') %] </tr> + <tr> <td>My [% terms.Bugs %]</td> <td> [% filtered_username = user.login FILTER uri %] <a href="[% Param('mybugstemplate').replace('%userid%', filtered_username) %]">Run</a> </td> - <td> - - </td> - <td> - - </td> - <td align="center"> - <input type="checkbox" - name="showmybugslink" - value="1" - [% " checked" IF user.showmybugslink %]> + <td></td> + <td></td> + <td class="center"> + <input type="checkbox" name="showmybugslink" value="1" + [%+ 'checked="checked"' IF user.showmybugslink %]> </td> [% IF may_share %] - <td> - — - </td> + <td>—</td> [% END %] + [% Hook.process('saved-row') %] </tr> + [% FOREACH q = user.queries %] - <tr> + <tr [% 'class="shared_search"' IF q.shared_with_group.id %]> <td>[% q.name FILTER html %]</td> <td> <a href="buglist.cgi?cmdtype=dorem&remaction=run&namedcmd=[% q.name FILTER uri %] @@ -100,7 +82,7 @@ [% issue_hash_token([q.id, q.name]) FILTER uri %]">Forget</a> [% END %] </td> - <td align="center"> + <td class="center"> <input type="checkbox" name="link_in_footer_[% q.id FILTER html %]" value="1" @@ -119,6 +101,11 @@ >[% group.name FILTER html %]</option> [% END %] </select> + [% IF q.shared_with_group.id %] + (<a href="buglist.cgi?cmdtype=dorem&remaction=run&namedcmd= + [% q.name FILTER uri %]&sharer_id= + [% user.id FILTER uri %]">Link</a>) + [% END %] [% IF user.can_bless %] <span [% IF !bless_group_ids.grep("^$q.shared_with_group.id\$").0 %]class="bz_default_hidden"[% END %]> @@ -133,41 +120,30 @@ [% END %] </td> [% END %] + [% Hook.process('saved-row') %] </tr> [% END %] </table> + [% IF user.can_bless %] <p>Note that for every search that has the "Add to footer" selected, a link to the shared search is added to the footer of every user that is a direct member of the group at the time you click Submit Changes.</p> [% END %] -</blockquote> [% IF user.queries_available.size %] <p>You may use these searches saved and shared by others:</p> - <table border="1" cellpadding="3"> - <tr> - <th> - Search - </th> - <th> - Shared By - </th> - <th> - Shared To - </th> - <th> - Run - </th> - <th> - Edit - </th> - <th> - Show in - Footer - </th> + <table id="shared_search_prefs"> + <tr class="column_header"> + <th>Search</th> + <th>Shared By</th> + <th>Shared To</th> + <th>Run</th> + <th>Edit</th> + <th>Show in Footer</th> </tr> + [% FOREACH q = user.queries_available %] <tr> <td>[% q.name FILTER html %]</td> @@ -182,7 +158,7 @@ <a href="query.cgi?[% q.edit_link FILTER html %]&known_name= [% q.name FILTER uri %]">Edit</a> </td> - <td align="center"> + <td class="center"> <input type="checkbox" name="link_in_footer_[% q.id FILTER html %]" value="1" diff --git a/template/en/default/account/prefs/settings.html.tmpl b/template/en/default/account/prefs/settings.html.tmpl index 580795835..a7055c67f 100644 --- a/template/en/default/account/prefs/settings.html.tmpl +++ b/template/en/default/account/prefs/settings.html.tmpl @@ -29,12 +29,12 @@ </p> [% END %] - <table border="0" cellpadding="8"> + <table id="user_prefs"> [% FOREACH name = setting_names %] [% default_name = name _ '-isdefault' %] [% default_val = settings.${name}.default_value %] <tr> - <td align="right"> + <td class="right"> [% setting_descs.$name OR name FILTER html %] </td> <td> diff --git a/template/en/default/account/profile-activity.html.tmpl b/template/en/default/account/profile-activity.html.tmpl index 3f8030a0e..ff989c6a5 100644 --- a/template/en/default/account/profile-activity.html.tmpl +++ b/template/en/default/account/profile-activity.html.tmpl @@ -22,12 +22,13 @@ #%] [% title = BLOCK %] - Account History for '[% otheruser.login FILTER html %]' + Account History for '[% otheruser.identity FILTER html %]' [% END %] [% PROCESS global/header.html.tmpl title = title + style_urls = ['skins/standard/admin.css'] %] [% PROCESS admin/users/listselectvars.html.tmpl diff --git a/template/en/default/admin/admin.html.tmpl b/template/en/default/admin/admin.html.tmpl index 38194e963..7e3e5a157 100644 --- a/template/en/default/admin/admin.html.tmpl +++ b/template/en/default/admin/admin.html.tmpl @@ -7,13 +7,13 @@ #%] [% title = BLOCK %] - Administer your installation ([% terms.Bugzilla %] + Administer your installation (Bugzilla [%+ constants.BUGZILLA_VERSION FILTER html %]) [% END %] [% PROCESS global/header.html.tmpl title = title style_urls = ['skins/standard/admin.css'] - doc_section = "administration.html" + doc_section = "administering/index.html" %] <div> @@ -44,7 +44,7 @@ <dt id="sanitycheck" class="[% class %]"><a href="sanitycheck.cgi">Sanity Check</a></dt> <dd class="[% class %]">Run sanity checks to locate problems in your database. This may take several tens of minutes depending on the size of your installation. - You can also automate this check by running <tt>sanitycheck.pl</tt> from a cron job. + You can also automate this check by running <kbd>sanitycheck.pl</kbd> from a cron job. A notification will be sent per email to the specified user if errors are detected.</dd> [% class = (user.in_group('editusers') || user.can_bless) ? "" : "forbidden" %] @@ -83,7 +83,7 @@ <dl> [% class = user.in_group('admin') ? "" : "forbidden" %] <dt id="custom_fields" class="[% class %]"><a href="editfields.cgi">Custom Fields</a></dt> - <dd class="[% class %]">[% terms.Bugzilla %] lets you define fields which are + <dd class="[% class %]">Bugzilla lets you define fields which are not implemented by default, based on your local and specific requirements. These fields can then be used as any other field, meaning that you can set them in [% terms.bugs %] and run any search involving them.<br> @@ -118,6 +118,16 @@ and time, and get the result of these queries directly per email. This is a good way to create reminders and to keep track of the activity in your installation.</dd> + [% IF Param('use_mailer_queue') %] + [% class = user.in_group('admin') ? "" : "forbidden" %] + <dt id="view_job_queue" class="[% class %]"><a href="view_job_queue.cgi">Job Queue</a></dt> + <dd class="[% class %]">View the queue of undelivered/deferred jobs/emails.</dd> + [% END %] + + <dt id="release_notes"> + <a href="page.cgi?id=release-notes.html">Release Notes</a></dt> + <dd>Detailed information related to this release of Bugzilla.</dd> + [% Hook.process('end_links_right') %] </dl> </td> diff --git a/template/en/default/admin/classifications/add.html.tmpl b/template/en/default/admin/classifications/add.html.tmpl index d818d3166..d56275aa2 100644 --- a/template/en/default/admin/classifications/add.html.tmpl +++ b/template/en/default/admin/classifications/add.html.tmpl @@ -8,10 +8,11 @@ [% PROCESS global/header.html.tmpl title = "Add new classification" + style_urls = ['skins/standard/admin.css'] %] <form method=post action="editclassifications.cgi"> - <table border=0 cellpadding=4 cellspacing=0> + <table id="admin_table_edit"> [% PROCESS "admin/classifications/edit-common.html.tmpl" %] diff --git a/template/en/default/admin/classifications/del.html.tmpl b/template/en/default/admin/classifications/del.html.tmpl index 215db848f..24a39b4b6 100644 --- a/template/en/default/admin/classifications/del.html.tmpl +++ b/template/en/default/admin/classifications/del.html.tmpl @@ -8,32 +8,32 @@ [% PROCESS global/header.html.tmpl title = "Delete classification" + style_urls = ['skins/standard/admin.css'] %] -<table border=1 cellpadding=4 cellspacing=0> -<tr bgcolor="#6666ff"> - <th valign="top" align="left">Part</th> - <th valign="top" align="left">Value</th> - -</tr><tr> - <td valign="top">Classification:</td> - <td valign="top">[% classification.name FILTER html %]</td> - -</tr><tr> - <td valign="top">Description:</td> - <td valign="top"> - [% IF classification.description %] - [% classification.description FILTER html_light %] - [% ELSE %] - <font color="red">description missing</font> - [% END %] - </td> - -</tr><tr> - <td valign="top">Sortkey:</td> - <td valign="top">[% classification.sortkey FILTER html %]</td> - -</tr> +<table id="admin_table"> + <tr class="column_header"> + <th>Field</th> + <th>Value</th> + </tr> + <tr> + <td>Classification</td> + <td>[% classification.name FILTER html %]</td> + </tr> + <tr> + <td>Description</td> + <td> + [% IF classification.description %] + [% classification.description FILTER html_light %] + [% ELSE %] + <span class="warning">description missing</span> + [% END %] + </td> + </tr> + <tr> + <td>Sortkey</td> + <td>[% classification.sortkey FILTER html %]</td> + </tr> </table> <h2>Confirmation</h2> diff --git a/template/en/default/admin/classifications/edit-common.html.tmpl b/template/en/default/admin/classifications/edit-common.html.tmpl index 6f038fceb..c2bae5c42 100644 --- a/template/en/default/admin/classifications/edit-common.html.tmpl +++ b/template/en/default/admin/classifications/edit-common.html.tmpl @@ -11,12 +11,12 @@ #%] <tr> - <th align="right">Classification:</th> + <th>Classification:</th> <td><input size=64 maxlength=64 name="classification" - value="[% classification.name FILTER html %]"></td> + value="[% classification.name FILTER html %]" required></td> </tr> <tr> - <th align="right">Description:</th> + <th>Description:</th> <td> [% INCLUDE global/textarea.html.tmpl name = 'description' @@ -27,7 +27,7 @@ </td> </tr> <tr> - <th align="right"><label for="sortkey">Sortkey:</label></th> + <th><label for="sortkey">Sortkey:</label></th> <td><input id="sortkey" size="20" maxlength="20" name="sortkey" value="[%- classification.sortkey FILTER html %]"></td> </tr> diff --git a/template/en/default/admin/classifications/edit.html.tmpl b/template/en/default/admin/classifications/edit.html.tmpl index 429eefc69..b1f6ce225 100644 --- a/template/en/default/admin/classifications/edit.html.tmpl +++ b/template/en/default/admin/classifications/edit.html.tmpl @@ -8,15 +8,16 @@ [% PROCESS global/header.html.tmpl title = "Edit classification" + style_urls = ['skins/standard/admin.css'] %] <form method=post action="editclassifications.cgi"> - <table border=0 cellpadding=4 cellspacing=0> + <table id="admin_table_edit"> [% PROCESS "admin/classifications/edit-common.html.tmpl" %] - <tr valign=top> - <th align="right"> + <tr> + <th> <a href="editproducts.cgi?classification=[% classification.name FILTER uri %]"> Edit Products</a>: </th> @@ -25,19 +26,13 @@ <table> [% FOREACH product = classification.products %] <tr> - <th align=right valign=top>[% product.name FILTER html %]</th> - <td valign=top> - [% IF product.description %] - [% product.description FILTER html_light %] - [% ELSE %] - <font color="red">description missing</font> - [% END %] - </td> + <th>[% product.name FILTER html %]</th> + <td>[% product.description FILTER html_light %]</td> </tr> [% END %] </table> [% ELSE %] - <font color="red">none</font> + <span class="warning">none</span> [% END %] </td> </tr> diff --git a/template/en/default/admin/classifications/reclassify.html.tmpl b/template/en/default/admin/classifications/reclassify.html.tmpl index 13fb3a3bf..b230d670c 100644 --- a/template/en/default/admin/classifications/reclassify.html.tmpl +++ b/template/en/default/admin/classifications/reclassify.html.tmpl @@ -8,38 +8,39 @@ [% PROCESS global/header.html.tmpl title = "Reclassify products" + style_urls = ['skins/standard/admin.css'] %] <form method=post action="editclassifications.cgi"> - <table border=0 cellpadding=4 cellspacing=0> + <table id="admin_table_edit"> <tr> - <th align="right">Classification:</th> - <td valign="top" colspan=3>[% classification.name FILTER html %]</td> - - </tr><tr> - <th align="right">Description:</th> - <td valign="top" colspan=3> + <th>Classification:</th> + <td colspan=3>[% classification.name FILTER html %]</td> + </tr> + <tr> + <th>Description:</th> + <td colspan=3> [% IF classification.description %] [% classification.description FILTER html_light %] [% ELSE %] - <font color="red">description missing</font> + <span class="warning">description missing</span> [% END %] </td> - - </tr><tr> - <th align="right">Sortkey:</th> - <td valign="top" colspan=3>[% classification.sortkey FILTER html %]</td> - - </tr><tr> - <th align="right">Products:</th> - <td valign="top">Other Classifications</td> + </tr> + <tr> + <th>Sortkey:</th> + <td colspan=3>[% classification.sortkey FILTER html %]</td> + </tr> + <tr> + <th>Products:</th> + <td>Other Classifications</td> <td></td> - <td valign="top">This Classification</td> - - </tr><tr> + <td>This Classification</td> + </tr> + <tr> <td></td> - <td valign="top"> - <select name="prodlist" id="prodlist" multiple="multiple" size="20"> + <td> + <select name="prodlist" id="prodlist" multiple="multiple" size="20"> [% FOREACH class = classifications %] [% IF class.id != classification.id %] [% FOREACH product = class.products %] @@ -49,21 +50,23 @@ [% END %] [% END %] [% END %] - </select></td> + </select> + </td> - <td align="center"> + <td> <input type=submit value=" Add >> " name="add_products"><br><br> <input type=submit value="<< Remove" name="remove_products"> </td> - <td valign="middle" rowspan=2> + <td rowspan=2 class="max-width"> <select name="myprodlist" id="myprodlist" multiple="multiple" size="20"> [% FOREACH product = classification.products %] <option value="[% product.name FILTER html %]"> [% product.name FILTER html %] </option> [% END %] - </select></td> + </select> + </td> </tr> </table> diff --git a/template/en/default/admin/classifications/select.html.tmpl b/template/en/default/admin/classifications/select.html.tmpl index 541ded918..ffe183cfa 100644 --- a/template/en/default/admin/classifications/select.html.tmpl +++ b/template/en/default/admin/classifications/select.html.tmpl @@ -8,39 +8,49 @@ [% PROCESS global/header.html.tmpl title = "Select classification" + style_urls = ['skins/standard/admin.css'] %] -<table border=1 cellpadding=4 cellspacing=0> - <tr bgcolor="#6666ff"> - <th align="left">Edit Classification ...</th> - <th align="left">Description</th> - <th align="left">Sortkey</th> - <th align="left">Products</th> - <th align="left">Action</th> +<table id="admin_table"> + <tr class="column_header"> + <th>Edit Classification...</th> + <th>Description</th> + <th>Sortkey</th> + <th>Products</th> + <th>Action</th> </tr> [% FOREACH cl = classifications %] <tr> - <td valign="top"><a href="editclassifications.cgi?action=edit&classification=[% cl.name FILTER uri %]"><b>[% cl.name FILTER html %]</b></a></td> - <td valign="top"> + <td> + <a href="editclassifications.cgi?action=edit&classification=[% cl.name FILTER uri %]"> + <b>[% cl.name FILTER html %]</b> + </a> + </td> + <td> [% IF cl.description %] [% cl.description FILTER html_light %] [% ELSE %] - <font color="red">none</font> + <span class="warning">none</span> [% END %] </td> - <td valign="top">[% cl.sortkey FILTER html %]</td> + <td>[% cl.sortkey FILTER html %]</td> [% IF (cl.id == 1) %] - <td valign="top">[% cl.product_count FILTER html %]</td> + <td>[% cl.product_count FILTER html %]</td> [% ELSE %] - <td valign="top"><a href="editclassifications.cgi?action=reclassify&classification=[% cl.name FILTER uri %]">reclassify ([% cl.product_count FILTER html %])</a></td> + <td> + <a href="editclassifications.cgi?action=reclassify&classification=[% cl.name FILTER uri %]"> + reclassify ([% cl.product_count FILTER html %])</a> + </td> [% END %] [%# don't allow user to delete the default id. %] [% IF (cl.id == 1) %] - <td valign="top"> </td> + <td></td> [% ELSE %] - <td valign="top"><a href="editclassifications.cgi?action=del&classification=[% cl.name FILTER uri %]">delete</a></td> + <td> + <a href="editclassifications.cgi?action=del&classification=[% cl.name FILTER uri %]">delete</a> + </td> [% END %] </tr> [% END %] diff --git a/template/en/default/admin/components/confirm-delete.html.tmpl b/template/en/default/admin/components/confirm-delete.html.tmpl index 82bf018b3..9018dcda2 100644 --- a/template/en/default/admin/components/confirm-delete.html.tmpl +++ b/template/en/default/admin/components/confirm-delete.html.tmpl @@ -22,101 +22,96 @@ from '[% product.name FILTER html %]' product style_urls = ['skins/standard/admin.css'] %] -<table border="1" cellpadding="4" cellspacing="0"> -<tr bgcolor="#6666FF"> - <th valign="top" align="left">Field</th> - <th valign="top" align="left">Value</th> -</tr> -<tr> - <td valign="top">Component:</td> - <td valign="top">[% comp.name FILTER html %]</td> -</tr> -<tr> - <td valign="top">Component Description:</td> - <td valign="top">[% comp.description FILTER html_light %]</td> -</tr> -<tr> - <td valign="top">Default assignee:</td> - <td valign="top">[% comp.default_assignee.login FILTER html %]</td> - -[% IF Param('useqacontact') %] -</tr> -<tr> - <td valign="top">Default QA contact:</td> - <td valign="top">[% comp.default_qa_contact.login FILTER html %]</td> -[% END %] - -</tr> -<tr> - <td valign="top">Component of Product:</td> - <td valign="top">[% product.name FILTER html %]</td> - -[% IF product.description %] -</tr> -<tr> - <td valign="top">Product Description:</td> - <td valign="top">[% product.description FILTER html_light %]</td> -[% END %] +<table id="admin_table"> + <tr class="column_header"> + <th>Field</th> + <th>Value</th> + </tr> + <tr> + <td>Component</td> + <td>[% comp.name FILTER html %]</td> + </tr> + <tr> + <td>Component Description</td> + <td>[% comp.description FILTER html_light %]</td> + </tr> + <tr> + <td>Default assignee</td> + <td>[% comp.default_assignee.login FILTER html %]</td> + </tr> + + [% IF Param('useqacontact') %] + <tr> + <td>Default QA contact</td> + <td>[% comp.default_qa_contact.login FILTER html %]</td> + </tr> + [% END %] -[% IF Param('usetargetmilestone') %] -</tr> -<tr> - <td valign="top">Product Milestone URL:</td> - <td valign="top"> - <a href="[% product.milestone_url FILTER html %]"> - [% product.milestone_url FILTER html %] - </a> - </td> -[% END %] + <tr> + <td>Component of Product</td> + <td>[% product.name FILTER html %]</td> + </tr> -</tr> -<tr> - <TD VALIGN="top">Open for [% terms.bugs %]:</TD> - <TD VALIGN="top">[% IF product.is_active && comp.isactive %]Yes[% ELSE %]No[% END %]</td> -</tr> -<tr> - <td valign="top">[% terms.Bugs %]:</td> - <td valign="top"> -[% IF comp.bug_count %] - <a title="List of [% terms.bugs %] for component '[% comp.name FILTER html %]'" - href="buglist.cgi?component=[% comp.name FILTER uri %]&product= - [%- product.name FILTER uri %]">[% comp.bug_count %]</a> -[% ELSE %] - None -[% END %] - </td> -</tr> + [% IF product.description %] + <tr> + <td>Product Description</td> + <td>[% product.description FILTER html_light %]</td> + </tr> + [% END %] + + [% IF Param('usetargetmilestone') %] + <tr> + <td>Product Milestone URL</td> + <td> + <a href="[% product.milestone_url FILTER html %]"> + [% product.milestone_url FILTER html %]</a> + </td> + </tr> + [% END %] + + <tr> + <td>Open for [% terms.bugs %]</td> + <td>[% IF product.is_active && comp.isactive %]Yes[% ELSE %]No[% END %]</td> + </tr> + <tr> + <td>[% terms.Bugs %]</td> + <td> + [% IF comp.bug_count %] + <a title="List of [% terms.bugs %] for component '[% comp.name FILTER html %]'" + href="buglist.cgi?component=[% comp.name FILTER uri %]&product= + [%- product.name FILTER uri %]">[% comp.bug_count %]</a> + [% ELSE %] + None + [% END %] + </td> + </tr> </table> <h2>Confirmation</h2> - + [% IF comp.bug_count %] [% IF !Param("allowbugdeletion") %] - <p class="confirmation"> - Sorry, there - - [% IF comp.bug_count > 1 %] - are [% comp.bug_count %] [%+ terms.bugs %] - [% ELSE %] - is [% comp.bug_count %] [%+ terms.bug %] - [% END %] - - outstanding for this component. You must reassign - - [% IF comp.bug_count > 1 %] - those [% terms.bugs %] - [% ELSE %] - that [% terms.bug %] - [% END %] + <p class="confirmation"> + Sorry, there + [% IF comp.bug_count > 1 %] + are [% comp.bug_count %] [%+ terms.bugs %] + [% ELSE %] + is 1 [% terms.bug %] + [% END %] + outstanding for this component. You must reassign - to another component before you can delete this one. - </p> + [% IF comp.bug_count > 1 %] + those [% terms.bugs %] + [% ELSE %] + that [% terms.bug %] + [% END %] + to another component before you can delete this one. + </p> [% ELSE %] - - <table border="0" cellpadding="20" width="70%" bgcolor="red"><tr><td> - - There [% IF comp.bug_count > 1 %] + <p class="confirmation"> + There + [% IF comp.bug_count > 1 %] are [% comp.bug_count %] [%+ terms.bugs %] [% ELSE %] is 1 [% terms.bug %] @@ -124,8 +119,7 @@ from '[% product.name FILTER html %]' product entered for this component! When you delete this component, <b>ALL</b> stored [% terms.bugs %] and their history will be deleted too. - </td></tr></table> - + </p> [% END %] [% END %] diff --git a/template/en/default/admin/components/create.html.tmpl b/template/en/default/admin/components/create.html.tmpl index f281160c0..96c9ce384 100644 --- a/template/en/default/admin/components/create.html.tmpl +++ b/template/en/default/admin/components/create.html.tmpl @@ -10,21 +10,23 @@ # product: object; Bugzilla::Product object representing the product to # which the component belongs. #%] - + [% title = BLOCK %]Add component to the [% product.name FILTER html %] product[% END %] [% PROCESS global/header.html.tmpl + title = title + generate_api_token = 1 + style_urls = ['skins/standard/admin.css'] yui = [ 'autocomplete' ] javascript_urls = [ "js/field.js" ] - title = title %] <form method="post" action="editcomponents.cgi"> - <table border="0" cellpadding="4" cellspacing="0"> + <table id="admin_table_edit"> [% PROCESS "admin/components/edit-common.html.tmpl" %] - + </table> - <hr> + <input type="submit" id="create" value="Add"> <input type="hidden" name="action" value="new"> <input type="hidden" name='product' value="[% product.name FILTER html %]"> diff --git a/template/en/default/admin/components/edit-common.html.tmpl b/template/en/default/admin/components/edit-common.html.tmpl index 6ff4e07e6..72300af79 100644 --- a/template/en/default/admin/components/edit-common.html.tmpl +++ b/template/en/default/admin/components/edit-common.html.tmpl @@ -15,12 +15,12 @@ [% DEFAULT desc_name = "description" %] <tr> - <th class="field_label"><label for="component">Component:</label></th> + <th><label for="component">Component:</label></th> <td><input size="64" maxlength="64" name="component" id="component" - value="[%- comp.name FILTER html %]"></td> + value="[%- comp.name FILTER html %]" required></td> </tr> <tr> - <th class="field_label"><label for="[% desc_name FILTER html %]">Component Description:</label></th> + <th><label for="[% desc_name FILTER html %]">Component Description:</label></th> <td> [% INCLUDE global/textarea.html.tmpl name = desc_name @@ -29,23 +29,25 @@ cols = 64 wrap = 'virtual' defaultcontent = comp.description + mandatory = 1 %] </td> </tr> <tr> - <th class="field_label"><label for="initialowner">Default Assignee:</label></th> + <th><label for="initialowner">Default Assignee:</label></th> <td> [% INCLUDE global/userselect.html.tmpl name => "initialowner" id => "initialowner" value => comp.default_assignee.login size => 64 + mandatory => 1 %] </td> </tr> [% IF Param('useqacontact') %] <tr> - <th class="field_label"><label for="initialqacontact">Default QA contact:</label></th> + <th><label for="initialqacontact">Default QA contact:</label></th> <td> [% INCLUDE global/userselect.html.tmpl name => "initialqacontact" @@ -58,7 +60,7 @@ </tr> [% END %] <tr> - <th class="field_label"><label for="initialcc">Default CC List:</label></th> + <th><label for="initialcc">Default CC List:</label></th> <td> [% INCLUDE global/userselect.html.tmpl name => "initialcc" @@ -69,7 +71,7 @@ %] <br> [% IF !Param("usemenuforusers") %] - <em>Enter user names for the CC list as a comma-separated list.</em> + <span class="bz_info">Enter user names for the CC list as a comma-separated list.</span> [% END %] </td> </tr> diff --git a/template/en/default/admin/components/edit.html.tmpl b/template/en/default/admin/components/edit.html.tmpl index 748175b75..c4da1181b 100644 --- a/template/en/default/admin/components/edit.html.tmpl +++ b/template/en/default/admin/components/edit.html.tmpl @@ -18,45 +18,45 @@ [% END %] [% PROCESS global/header.html.tmpl title = title + generate_api_token = 1 + style_urls = ['skins/standard/admin.css'] yui = [ 'autocomplete' ] javascript_urls = [ "js/field.js" ] %] <form method="post" action="editcomponents.cgi"> - <table border="0" cellpadding="4" cellspacing="0"> + <table id="admin_table_edit"> [% PROCESS "admin/components/edit-common.html.tmpl" %] <tr> - <th class="field_label"><label for="isactive">Enabled For [% terms.Bugs %]:</label></th> + <th><label for="isactive">Enabled For [% terms.Bugs %]:</label></th> <td><input id="isactive" name="isactive" type="checkbox" value="1" [% 'checked="checked"' IF comp.isactive %]></td> </tr> <tr> - <th class="field_label">[% terms.Bugs %]:</th> + <th>[% terms.Bugs %]:</th> <td> -[% IF comp.bug_count > 0 %] - <a title="[% terms.Bugs %] in component '[% comp.name FILTER html %]'" - href="buglist.cgi?component= - [%- comp.name FILTER uri %]&product= - [%- product.name FILTER uri %]">[% comp.bug_count %]</a> -[% ELSE %] - None -[% END %] + [% IF comp.bug_count > 0 %] + <a title="[% terms.Bugs %] in component '[% comp.name FILTER html %]'" + href="buglist.cgi?component= + [%- comp.name FILTER uri %]&product= + [%- product.name FILTER uri %]">[% comp.bug_count %]</a> + [% ELSE %] + None + [% END %] </td> </tr> - </table> <input type="hidden" name="action" value="update"> <input type="hidden" name="componentold" value="[% comp.name FILTER html %]"> <input type="hidden" name="product" value="[% product.name FILTER html %]"> <input type="hidden" name="token" value="[% token FILTER html %]"> - <input type="submit" value="Save Changes" id="update"> or <a - href="editcomponents.cgi?action=del&product= - [%- product.name FILTER uri %]&component= - [%- comp.name FILTER uri %]">Delete</a> this component. - + <input type="submit" value="Save Changes" id="update"> or + <a href="editcomponents.cgi?action=del&product= + [%- product.name FILTER uri %]&component= + [%- comp.name FILTER uri %]">Delete</a> this component. </form> [% PROCESS admin/components/footer.html.tmpl diff --git a/template/en/default/admin/components/list.html.tmpl b/template/en/default/admin/components/list.html.tmpl index fc36bcdd2..91808fbae 100644 --- a/template/en/default/admin/components/list.html.tmpl +++ b/template/en/default/admin/components/list.html.tmpl @@ -16,6 +16,7 @@ '[% product.name FILTER html %]'[% END %] [% PROCESS global/header.html.tmpl title = title + style_urls = ['skins/standard/admin.css'] %] [% edit_contentlink = BLOCK %]editcomponents.cgi?action=edit&product= @@ -68,7 +69,7 @@ [% columns.push({ name => 'bug_count' heading => "$terms.Bugs" - align => "right" + class => "right" contentlink => bug_count_contentlink }) %] diff --git a/template/en/default/admin/components/select-product.html.tmpl b/template/en/default/admin/components/select-product.html.tmpl index 55600d9cd..a152415c3 100644 --- a/template/en/default/admin/components/select-product.html.tmpl +++ b/template/en/default/admin/components/select-product.html.tmpl @@ -13,6 +13,7 @@ [% PROCESS global/header.html.tmpl title = "Edit components for which product?" + style_urls = ['skins/standard/admin.css'] %] [% columns = [ @@ -34,7 +35,7 @@ [% columns.push({ name => 'bug_count' heading => "$terms.Bugs" - align => "right" + class => "right" contentlink => "buglist.cgi?product=%%name%%" }) %] diff --git a/template/en/default/admin/confirm-action.html.tmpl b/template/en/default/admin/confirm-action.html.tmpl index e3b9ef5f7..6dda0d014 100644 --- a/template/en/default/admin/confirm-action.html.tmpl +++ b/template/en/default/admin/confirm-action.html.tmpl @@ -12,52 +12,43 @@ # expected_action: the action the user was going to do. # script_name: the script generating this warning. # alternate_script: the suggested script to redirect the user to - # if he declines submission. + # if they decline submission. #%] -[% PROCESS global/header.html.tmpl title = "Suspicious Action" - style_urls = ['skins/standard/global.css'] %] +[% PROCESS global/header.html.tmpl + title = "Suspicious Action" +%] [% IF abuser %] <div class="throw_error"> - <p>When you view an administrative form in [% terms.Bugzilla %], a token string + <p>When you view an administrative form in Bugzilla, a token string is randomly generated and stored both in the database and in the form you loaded, to make sure that the requested changes are being made as a result of submitting - a form generated by [% terms.Bugzilla %]. Unfortunately, the token used right now + a form generated by Bugzilla. Unfortunately, the token used right now is incorrect, meaning that it looks like you didn't come from the right page. The following token has been used :</p> - <table border="0" cellpadding="5" cellspacing="0"> - [% IF token_action != expected_action %] - <tr> - <th>Action stored:</th> - <td>[% token_action FILTER html %]</td> - </tr> - <tr> - <th> </th> - <td> - This action doesn't match the one expected ([% expected_action FILTER html %]). - </td> - </tr> - [% END %] + [% IF token_action != expected_action %] + <p> + <span class="label">Action stored:</span> + [%+ token_action FILTER html %] + <br> + This action doesn't match the one expected ([% expected_action FILTER html %]). + </p> + [% END %] - [% IF abuser != user.identity %] - <tr> - <th>Generated by:</th> - <td>[% abuser FILTER html %]</td> - </tr> - <tr> - <th> </th> - <td> - This token has not been generated by you. It is possible that someone - tried to trick you! - </td> - </tr> - [% END %] - </table> - - <p>Please report this problem to [%+ Param("maintainer") FILTER html %].</p> + [% IF abuser != user.identity %] + <p> + <span class="label">Generated by:</span> + [%+ abuser FILTER html %] + <br> + This token has not been generated by you. It is possible that someone + tried to trick you! + </p> + [% END %] </div> + + <p>Please report this problem to [% Param("maintainer") FILTER html %].</p> [% ELSE %] <div class="throw_error"> It looks like you didn't come from the right page (you have no valid token for diff --git a/template/en/default/admin/custom_fields/confirm-delete.html.tmpl b/template/en/default/admin/custom_fields/confirm-delete.html.tmpl index 85338c003..1d2348a0f 100644 --- a/template/en/default/admin/custom_fields/confirm-delete.html.tmpl +++ b/template/en/default/admin/custom_fields/confirm-delete.html.tmpl @@ -20,26 +20,26 @@ [% PROCESS global/header.html.tmpl title = title style_urls = ['skins/standard/admin.css'] - doc_section = "custom-fields.html#delete-custom-fields" + doc_section = "administering/custom-fields.html#deleting-custom-fields" %] -<table border="1" cellpadding="4" cellspacing="0"> -<tr bgcolor="#6666FF"> - <th valign="top" align="left">Field</th> - <th valign="top" align="left">Value</th> -</tr> -<tr> - <td valign="top">Custom Field:</td> - <td valign="top">[% field.name FILTER html %]</td> -</tr> -<tr> - <td valign="top">Description:</td> - <td valign="top">[% field.description FILTER html %]</td> -</tr> -<tr> - <td valign="top">Type:</td> - <td valign="top">[% field_types.${field.type} FILTER html %]</td> -</tr> +<table id="admin_table"> + <tr class="column_header"> + <th>Field</th> + <th>Value</th> + </tr> + <tr> + <td>Custom Field</td> + <td>[% field.name FILTER html %]</td> + </tr> + <tr> + <td>Description</td> + <td>[% field.description FILTER html %]</td> + </tr> + <tr> + <td>Type</td> + <td>[% field_types.${field.type} FILTER html %]</td> + </tr> </table> <h2>Confirmation</h2> diff --git a/template/en/default/admin/custom_fields/create.html.tmpl b/template/en/default/admin/custom_fields/create.html.tmpl index fb7f06f86..71ba08f46 100644 --- a/template/en/default/admin/custom_fields/create.html.tmpl +++ b/template/en/default/admin/custom_fields/create.html.tmpl @@ -10,8 +10,6 @@ # none #%] -[% PROCESS "global/field-descs.none.tmpl" %] - [% javascript = BLOCK %] [% INCLUDE "admin/custom_fields/cf-js.js.tmpl" %] [% END %] @@ -20,21 +18,21 @@ title = "Add a new Custom Field" onload = "document.getElementById('new_bugmail').disabled = true;" javascript_urls = [ 'js/util.js' ] - doc_section = "custom-fields.html#add-custom-fields" + doc_section = "administering/custom-fields.html#adding-custom-fields" style_urls = ['skins/standard/admin.css'] %] [%# set initial editability of fields such as Reverse Relationship Description %] <script type="text/javascript"> -YAHOO.util.Event.onDOMReady(function() {onChangeType(document.getElementById('type'))}); + YAHOO.util.Event.onDOMReady(function() {onChangeType(document.getElementById('type'))}); </script> <p> - Adding custom fields can make the interface of [% terms.Bugzilla %] very - complicated. Many admins who are new to [% terms.Bugzilla %] start off + Adding custom fields can make the interface of Bugzilla very + complicated. Many admins who are new to Bugzilla start off adding many custom fields, and then their users complain that the interface is "too complex". Please think carefully before adding any custom fields. - It may be the case that [% terms.Bugzilla %] already does what you need, + It may be the case that Bugzilla already does what you need, and you just haven't enabled the correct feature yet. </p> @@ -47,129 +45,11 @@ YAHOO.util.Event.onDOMReady(function() {onChangeType(document.getElementById('ty </ul> <form id="add_field" action="editfields.cgi" method="GET"> - <table border="0" cellspacing="0" cellpadding="5" id="edit_custom_field"> - <tr> - <th class="narrow_label"><label for="name">Name:</label></th> - <td> - <input type="text" id="name" name="name" value="cf_" size="40" maxlength="64"> - </td> - - <th> - <label for="enter_bug">Can be set on [% terms.bug %] creation:</label> - </th> - <td> - <input type="checkbox" id="enter_bug" name="enter_bug" value="1" - onchange="toggleCheckbox(this, 'new_bugmail');"> - </td> - </tr> - <tr> - <th class="narrow_label"><label for="desc">Description:</label></th> - <td><input type="text" id="desc" name="desc" value="" size="40"></td> - - <th> - <label for="new_bugmail">Displayed in [% terms.bug %]mail for new [% terms.bugs %]:</label> - </th> - <td><input type="checkbox" id="new_bugmail" name="new_bugmail" value="1"></td> - </tr> - <tr> - <th class="narrow_label"><label for="type">Type:</label></th> - <td> - <select id="type" name="type" onchange="onChangeType(this)"> - [% FOREACH type = field_types.keys %] - [% NEXT IF type == constants.FIELD_TYPE_UNKNOWN %] - <option value="[% type FILTER html %]">[% field_types.$type FILTER html %]</option> - [% END %] - </select> - </td> - - <th><label for="obsolete">Is obsolete:</label></th> - <td><input type="checkbox" id="obsolete" name="obsolete" value="1"></td> - </tr> - <tr> - <th class="narrow_label"><label for="sortkey">Sortkey:</label></th> - <td> - <input type="text" id="sortkey" name="sortkey" size="6" maxlength="6"> - </td> - - <th align="right"><label for="is_mandatory">Is mandatory:</label></th> - <td><input type="checkbox" id="is_mandatory" name="is_mandatory" value="1"></td> - </tr> - - <tr> - <th class="narrow_label">Long Description:</th> - <td> - [% INCLUDE global/textarea.html.tmpl - name = 'long_desc' - id = 'long_desc' - minrows = 3 - maxrows = 5 - cols = 46 - defaultcontent = defaultcontent - %] - </td> - <th> - <label for="visibility_field_id">Field only appears when:</label> - </th> - <td> - <select name="visibility_field_id" id="visibility_field_id" - onchange="onChangeVisibilityField()"> - <option></option> - [% FOREACH sel_field = Bugzilla.fields({ is_select => 1 }) %] - <option value="[% sel_field.id FILTER html %]"> - [% sel_field.description FILTER html %] - ([% sel_field.name FILTER html %]) - </option> - [% END %] - </select> - <label for="visibility_values"> - <strong>is set to any of:</strong> - </label> - <select multiple="multiple" size="5" name="visibility_values" - id="visibility_values" class="field_value"> - <option value=""></option> - </select> - </td> - </tr> - - <tr> - <th class="narrow_label"> - <label for="reverse_desc">Reverse Relationship Description:</label> - </th> - <td> - <input type="text" id="reverse_desc" name="reverse_desc" value="" size="40" disabled="disabled"> - <br/> - Use this label for the list of [% terms.bugs %] that link to - [%+ terms.abug %] with this - [%+ field_types.${constants.FIELD_TYPE_BUG_ID} FILTER html %] - field. For example, if the description is "Is a duplicate of", - the reverse description would be "Duplicates of this [% terms.bug %]". - Leave blank to disable the list for this field. - </td> - <th> - <label for="value_field_id"> - Field that controls the values<br> - that appear in this field: - </label> - </th> + [% PROCESS "admin/custom_fields/edit-common.html.tmpl" %] - <td> - <select disabled="disabled" name="value_field_id" id="value_field_id"> - <option></option> - [% FOREACH sel_field = Bugzilla.fields({ is_select => 1 }) %] - <option value="[% sel_field.id FILTER html %]"> - [% sel_field.description FILTER html %] - ([% sel_field.name FILTER html %]) - </option> - [% END %] - </select> - </td> - </tr> - </table> - <p> - <input type="hidden" name="action" value="new"> - <input type="hidden" name="token" value="[% token FILTER html %]"> - <input type="submit" id="create" value="Create"> - </p> + <input type="hidden" name="action" value="new"> + <input type="hidden" name="token" value="[% token FILTER html %]"> + <input type="submit" id="create" value="Create"> </form> <p> diff --git a/template/en/default/admin/custom_fields/edit-common.html.tmpl b/template/en/default/admin/custom_fields/edit-common.html.tmpl new file mode 100644 index 000000000..6c22bb81f --- /dev/null +++ b/template/en/default/admin/custom_fields/edit-common.html.tmpl @@ -0,0 +1,193 @@ +[%# 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. + #%] + +[%# INTERFACE: + # field: Bugzila::Field; the current field being edited + #%] + +[% PROCESS "global/field-descs.none.tmpl" %] + +<table id="admin_table_edit"> + <tr> + <th><label for="name">Name:</label></th> + <td> + [% IF field %] + [% field.name FILTER html %] + [% ELSE %] + <input type="text" id="name" name="name" value="cf_" size="40" maxlength="64" required> + [% END %] + </td> + + <th> + <label for="enter_bug">Can be set on [% terms.bug %] creation:</label> + </th> + <td> + <input type="checkbox" id="enter_bug" name="enter_bug" value="1" + [%- " checked" IF field.enter_bug %] + onchange="toggleCheckbox(this, 'new_bugmail');"> + </td> + </tr> + + <tr> + <th><label for="desc">Description:</label></th> + <td> + <input type="text" id="desc" name="desc" size="40" + value="[% field.description FILTER html %]" required> + </td> + + <th> + <label for="new_bugmail">Displayed in [% terms.bug %]mail for new [% terms.bugs %]:</label> + </th> + <td> + <input type="checkbox" id="new_bugmail" name="new_bugmail" value="1" + [%- " checked" IF field.mailhead %]> + </td> + </tr> + + <tr> + <th><label for="type">Type:</label></th> + <td> + [% IF field %] + [% field_types.${field.type} FILTER html %] + [% ELSE %] + <select id="type" name="type" onchange="onChangeType(this)"> + [% FOREACH type = field_types.keys %] + [% NEXT IF type == constants.FIELD_TYPE_UNKNOWN %] + <option value="[% type FILTER html %]">[% field_types.$type FILTER html %]</option> + [% END %] + </select> + [% END %] + </td> + + <th><label for="obsolete">Is obsolete:</label></th> + <td> + <input type="checkbox" id="obsolete" name="obsolete" value="1" + [%- " checked" IF field.obsolete %]> + </td> + </tr> + + <tr> + <th><label for="sortkey">Sortkey:</label></th> + <td> + <input type="text" id="sortkey" name="sortkey" size="6" maxlength="6" + value="[% field.sortkey FILTER html %]"> + </td> + + <th><label for="is_mandatory">Is mandatory:</label></th> + <td> + <input type="checkbox" id="is_mandatory" name="is_mandatory" value="1" + [%- ' checked="checked"' IF field.is_mandatory %]> + </td> + </tr> + + <tr> + <th>Long Description:</th> + <td> + [% INCLUDE global/textarea.html.tmpl + name = 'long_desc' + id = 'long_desc' + minrows = 3 + maxrows = 5 + cols = 46 + defaultcontent = field.long_desc + %] + </td> + + <th> + <label for="visibility_field_id">Field only appears when:</label> + </th> + <td> + <select name="visibility_field_id" id="visibility_field_id" + onchange="onChangeVisibilityField()"> + <option></option> + [% FOREACH sel_field = Bugzilla.fields({ is_select => 1 }) %] + [% NEXT IF field && sel_field.id == field.id %] + <option value="[% sel_field.id FILTER html %]" + [% ' selected="selected"' + IF field && sel_field.id == field.visibility_field.id %]> + [% sel_field.description FILTER html %] + ([% sel_field.name FILTER html %]) + </option> + [% END %] + </select> + <br> + <label for="visibility_values"> + <strong>is set to any of:</strong> + </label> + <br> + <select multiple="multiple" size="5" name="visibility_values" + id="visibility_values" class="field_value"> + [% IF field %] + [% FOREACH value = field.visibility_field.legal_values %] + <option value="[% value.id FILTER html %]" + [% " selected" IF field.visibility_values.contains(value) %]> + [% IF field.visibility_field.name == 'component' %] + [% display_value('product', value.product.name) FILTER html %]: + [% END %] + [%+ display_value(field.visibility_field.name, value.name) FILTER html %] + </option> + [% END %] + [% ELSE %] + <option value=""></option> + [% END %] + </select> + </td> + </tr> + + [% IF !field || field.is_select || field.type == constants.FIELD_TYPE_BUG_ID %] + <tr> + [% IF field.is_select %] + <th> </th> + <td> + <a href="editvalues.cgi?field=[% field.name FILTER uri %]">Edit legal values for this field</a>. + </td> + [% ELSE %] + <th> + <label for="reverse_desc">Reverse Relationship Description:</label> + </th> + <td> + <input type="text" id="reverse_desc" name="reverse_desc" size="40" + value="[% field.reverse_desc FILTER html %]" + [% ' disabled="disabled"' IF !field %]> + <br> + Use this label for the list of [% terms.bugs %] that link to [% terms.abug %] + with this [% field_types.${constants.FIELD_TYPE_BUG_ID} FILTER html %] field. + For example, if the description is "Is a duplicate of", the reverse description + would be "Duplicates of this [% terms.bug %]". Leave blank to disable the list + for this field. + </td> + [% END %] + + [% IF !field || field.is_select %] + <th> + <label for="value_field_id"> + Field that controls the values<br> + that appear in this field: + </label> + </th> + <td> + <select name="value_field_id" id="value_field_id" + [% ' disabled="disabled"' IF !field %]> + <option></option> + [% FOREACH sel_field = Bugzilla.fields({ is_select => 1 }) %] + [% NEXT IF field && sel_field.id == field.id %] + <option value="[% sel_field.id FILTER html %]" + [% ' selected="selected"' IF field && sel_field.id == field.value_field.id %]> + [% sel_field.description FILTER html %] + ([% sel_field.name FILTER html %]) + </option> + [% END %] + </select> + </td> + [% ELSE %] + <th></th> + <td></td> + [% END %] + </tr> + [% END %] +</table> diff --git a/template/en/default/admin/custom_fields/edit.html.tmpl b/template/en/default/admin/custom_fields/edit.html.tmpl index a1d739365..6f7389d05 100644 --- a/template/en/default/admin/custom_fields/edit.html.tmpl +++ b/template/en/default/admin/custom_fields/edit.html.tmpl @@ -10,8 +10,6 @@ # field: Bugzila::Field; the current field being edited #%] -[% PROCESS "global/field-descs.none.tmpl" %] - [% title = BLOCK %] Edit the Custom Field '[% field.name FILTER html %]' ([% field.description FILTER html %]) [% END %] @@ -24,7 +22,7 @@ title = title onload = "toggleCheckbox(document.getElementById('enter_bug'), 'new_bugmail');" javascript_urls = [ 'js/util.js' ] - doc_section = "custom-fields.html#edit-custom-fields" + doc_section = "administering/custom-fields.html#editing-custom-fields" style_urls = ['skins/standard/admin.css'] %] @@ -34,145 +32,8 @@ </p> <form id="edit_field" action="editfields.cgi" method="GET"> - <table border="0" cellspacing="0" cellpadding="5" id="edit_custom_field"> - <tr> - <th class="narrow_label">Name:</th> - <td>[% field.name FILTER html %]</td> - - <th> - <label for="enter_bug">Can be set on [% terms.bug %] creation:</label> - </th> - <td><input type="checkbox" id="enter_bug" name="enter_bug" value="1" - [%- " checked" IF field.enter_bug %] - onchange="toggleCheckbox(this, 'new_bugmail');"></td> - </tr> - <tr> - <th class="narrow_label"><label for="desc">Description:</label></th> - <td><input type="text" id="desc" name="desc" size="40" - value="[% field.description FILTER html %]"></td> - - <th> - <label for="new_bugmail">Displayed in [% terms.bug %]mail for new [% terms.bugs %]:</label> - </th> - <td><input type="checkbox" id="new_bugmail" name="new_bugmail" value="1" - [%- " checked" IF field.mailhead %]></td> - </tr> - <tr> - <th class="narrow_label">Type:</th> - <td>[% field_types.${field.type} FILTER html %]</td> - - <th><label for="obsolete">Is obsolete:</label></th> - <td><input type="checkbox" id="obsolete" name="obsolete" value="1" - [%- " checked" IF field.obsolete %]></td> - </tr> - <tr> - <th class="narrow_label"><label for="sortkey">Sortkey:</label></th> - <td> - <input type="text" id="sortkey" name="sortkey" size="6" maxlength="6" - value="[% field.sortkey FILTER html %]"> - </td> - <th align="right"><label for="is_mandatory">Is mandatory:</label></th> - <td><input type="checkbox" id="is_mandatory" name="is_mandatory" value="1" - [%- ' checked="checked"' IF field.is_mandatory %]></td> - </tr> - <tr> - <th class="narrow_label">Long Description:</th> - <td> - [% INCLUDE global/textarea.html.tmpl - name = 'long_desc' - id = 'long_desc' - minrows = 3 - maxrows = 5 - cols = 46 - defaultcontent = field.long_desc - %] - </td> - <th> - <label for="visibility_field_id">Field only appears when:</label> - </th> - <td> - <select name="visibility_field_id" id="visibility_field_id" - onchange="onChangeVisibilityField()"> - <option></option> - [% FOREACH sel_field = Bugzilla.fields({ is_select => 1 }) %] - [% NEXT IF sel_field.id == field.id %] - <option value="[% sel_field.id FILTER html %]" - [% ' selected="selected"' - IF sel_field.id == field.visibility_field.id %]> - [% sel_field.description FILTER html %] - ([% sel_field.name FILTER html %]) - </option> - [% END %] - </select> - <label for="visibility_values"> - <strong>is set to any of:</strong> - </label> - <select multiple="multiple" size="5" name="visibility_values" - id="visibility_values" class="field_value"> - [% FOREACH value = field.visibility_field.legal_values %] - <option value="[% value.id FILTER html %]" - [% " selected" IF field.visibility_values.contains(value) %]> - [% IF field.visibility_field.name == 'component' %] - [% display_value('product', value.product.name) FILTER html %]: - [% END %] - [%+ display_value(field.visibility_field.name, value.name) FILTER html %] - </option> - [% END %] - </select> - </td> - </tr> - [% IF field.type == constants.FIELD_TYPE_BUG_ID %] - <tr> - <th class="narrow_label"> - <label for="reverse_desc">Reverse Relationship Description:</label> - </th> - <td> - <input type="text" id="reverse_desc" name="reverse_desc" size="40" - value="[% field.reverse_desc FILTER html %]"> - <br/> - Use this label for the list of [% terms.bugs %] that link to - [%+ terms.abug %] with this - [%+ field_types.${constants.FIELD_TYPE_BUG_ID} FILTER html %] field. - For example, if the description is "Is a duplicate of", - the reverse description would be "Duplicates of this [% terms.bug %]". - Leave blank to disable the list for this field. - </td> - <td colspan="2"> </td> - </tr> - [% END %] - [% IF field.is_select %] - <tr> - <th> </th> - <td> - <a href="editvalues.cgi?field=[% field.name FILTER uri %]">Edit - legal values for this field</a>. - </td> - - <th> - <label for="value_field_id"> - Field that controls the values<br> - that appear in this field: - </label> - </th> + [% PROCESS "admin/custom_fields/edit-common.html.tmpl" field = field %] - <td> - <select name="value_field_id" id="value_field_id"> - <option></option> - [% FOREACH sel_field = Bugzilla.fields({ is_select => 1 }) %] - [% NEXT IF sel_field.id == field.id %] - <option value="[% sel_field.id FILTER html %]" - [% ' selected="selected"' - IF sel_field.id == field.value_field.id %]> - [% sel_field.description FILTER html %] - ([% sel_field.name FILTER html %]) - </option> - [% END %] - </select> - </td> - </tr> - [% END %] - </table> - <br> <input type="hidden" name="action" value="update"> <input type="hidden" name="name" value="[% field.name FILTER html %]"> <input type="hidden" name="token" value="[% token FILTER html %]"> diff --git a/template/en/default/admin/custom_fields/list.html.tmpl b/template/en/default/admin/custom_fields/list.html.tmpl index e6ec0c283..5e9183e56 100644 --- a/template/en/default/admin/custom_fields/list.html.tmpl +++ b/template/en/default/admin/custom_fields/list.html.tmpl @@ -14,7 +14,8 @@ [% PROCESS global/header.html.tmpl title = "Custom Fields" - doc_section = "custom-fields.html" + style_urls = ['skins/standard/admin.css'] + doc_section = "administering/custom-fields.html" %] [% delete_contentlink = BLOCK %]editfields.cgi?action=del&name=%%name%%[% END %] diff --git a/template/en/default/admin/fieldvalues/confirm-delete.html.tmpl b/template/en/default/admin/fieldvalues/confirm-delete.html.tmpl index 122df3612..579d07cdc 100644 --- a/template/en/default/admin/fieldvalues/confirm-delete.html.tmpl +++ b/template/en/default/admin/fieldvalues/confirm-delete.html.tmpl @@ -22,34 +22,34 @@ style_urls = ['skins/standard/admin.css'] %] -<table border="1" cellpadding="4" cellspacing="0"> -<tr bgcolor="#6666FF"> - <th valign="top" align="left">Field</th> - <th valign="top" align="left">Value</th> -</tr> -<tr> - <td valign="top">Field Name:</td> - <td valign="top">[% field.description FILTER html %]</td> -</tr> -<tr> - <td valign="top">Field Value:</td> - <td valign="top">[% value.name FILTER html %]</td> -</tr> -<tr> - <td valign="top">[% terms.Bugs %]:</td> - <td valign="top"> -[% IF value.bug_count %] - <a title="List of [% terms.bugs %] where ' - [%- field.description FILTER html %]' is ' - [%- value.name FILTER html %]'" - href="buglist.cgi?[% field.name FILTER uri %]= - [%- value.name FILTER uri %]"> - [%- value.bug_count FILTER html %]</a> -[% ELSE %] - None -[% END %] - </td> -</tr> +<table id="admin_table"> + <tr class="column_header"> + <th>Field</th> + <th>Value</th> + </tr> + <tr> + <td>Field Name</td> + <td>[% field.description FILTER html %]</td> + </tr> + <tr> + <td>Field Value</td> + <td>[% value.name FILTER html %]</td> + </tr> + <tr> + <td>[% terms.Bugs %]</td> + <td> + [% IF value.bug_count %] + <a title="List of [% terms.bugs %] where ' + [%- field.description FILTER html %]' is ' + [%- value.name FILTER html %]'" + href="buglist.cgi?[% field.name FILTER uri %]= + [%- value.name FILTER uri %]"> + [%- value.bug_count FILTER html %]</a> + [% ELSE %] + None + [% END %] + </td> + </tr> </table> <h2>Confirmation</h2> @@ -149,6 +149,6 @@ [% PROCESS admin/fieldvalues/footer.html.tmpl no_edit_link = 1 - +%] +%] [% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/admin/fieldvalues/create.html.tmpl b/template/en/default/admin/fieldvalues/create.html.tmpl index f9f0f7e54..8d1dbc8b9 100644 --- a/template/en/default/admin/fieldvalues/create.html.tmpl +++ b/template/en/default/admin/fieldvalues/create.html.tmpl @@ -15,6 +15,7 @@ [% END %] [% PROCESS global/header.html.tmpl title = title + style_urls = ['skins/standard/admin.css'] %] <p> @@ -23,21 +24,21 @@ </p> <form method="post" action="editvalues.cgi"> - <table border="0" cellpadding="4" cellspacing="0"> + <table id="admin_table_edit"> <tr> - <th align="right"><label for="value">Value:</label></th> + <th><label for="value">Value:</label></th> <td> <input id="value" name="value" size="30" - maxlength="[% constants.MAX_FIELD_VALUE_SIZE FILTER none %]"> + maxlength="[% constants.MAX_FIELD_VALUE_SIZE FILTER none %]" required> </td> </tr> <tr> - <th align="right"><label for="sortkey">Sortkey:</label></th> + <th><label for="sortkey">Sortkey:</label></th> <td><input id="sortkey" name="sortkey" size="6" maxlength="6"></td> </tr> [% IF field.name == "bug_status" %] <tr> - <th align="right"><label for="is_open">Status Type:</label></th> + <th><label for="is_open">Status Type:</label></th> <td> <input type="radio" id="open_status" name="is_open" value="1" checked="checked"> @@ -56,7 +57,7 @@ [% END %] [% IF field.value_field %] <tr> - <th align="right"> + <th> <label for="visibility_value_id">Only appears when [%+ field.value_field.description FILTER html %] is set to: </label> @@ -74,7 +75,7 @@ </option> [% END %] </select> - <small>(Leave unset to have this value always appear.)</small> + <span class="bz_info">(Leave unset to have this value always appear.)</span> </td> </tr> [% END %] diff --git a/template/en/default/admin/fieldvalues/edit.html.tmpl b/template/en/default/admin/fieldvalues/edit.html.tmpl index ab6418552..2630fee92 100644 --- a/template/en/default/admin/fieldvalues/edit.html.tmpl +++ b/template/en/default/admin/fieldvalues/edit.html.tmpl @@ -17,15 +17,13 @@ [% END %] [% PROCESS global/header.html.tmpl title = title + style_urls = ['skins/standard/admin.css'] %] <form method="post" action="editvalues.cgi"> - <table border="0" cellpadding="4" cellspacing="0"> - + <table id="admin_table_edit"> <tr> - <th valign="top" align="right"> - <label for="value_new">Field Value:</label> - </th> + <th><label for="value_new">Field Value:</label></th> <td> [% IF value.is_static %] <input type="hidden" name="value_new" id="value_new" @@ -34,24 +32,24 @@ [% ELSE %] <input id="value_new" name="value_new" size="20" maxlength="[% constants.MAX_FIELD_VALUE_SIZE FILTER none %]" - value="[% value.name FILTER html %]"> + value="[% value.name FILTER html %]" required> [% END %] </td> </tr> <tr> - <th align="right"><label for="sortkey">Sortkey:</label></th> + <th><label for="sortkey">Sortkey:</label></th> <td><input id="sortkey" size="6" maxlength="6" name="sortkey" value="[%- value.sortkey FILTER html %]"></td> </tr> [% IF field.name == "bug_status" %] <tr> - <th align="right"><label for="is_open">Status Type:</label></th> + <th><label for="is_open">Status Type:</label></th> <td>[% IF value.is_open %]Open[% ELSE %]Closed[% END %]</td> </tr> [% END %] [% IF field.value_field %] <tr> - <th align="right"> + <th> <label for="visibility_value_id">Only appears when [%+ field.value_field.description FILTER html %] is set to: </label> @@ -71,12 +69,12 @@ </option> [% END %] </select> - <small>(Leave unset to have this value always appear.)</small> + <span class="bz_info">(Leave unset to have this value always appear.)</span> </td> </tr> [% END %] <tr> - <th align="right"><label for="is_active">Enabled for [% terms.bugs %]:</label></th> + <th><label for="is_active">Enabled for [% terms.bugs %]:</label></th> <td><input id="is_active" name="is_active" type="checkbox" value="1" [%+ 'checked="checked"' IF value.is_active %] [%+ 'disabled="disabled"' IF value.is_default OR value.is_static %]> diff --git a/template/en/default/admin/fieldvalues/list.html.tmpl b/template/en/default/admin/fieldvalues/list.html.tmpl index 01c5717b8..109665131 100644 --- a/template/en/default/admin/fieldvalues/list.html.tmpl +++ b/template/en/default/admin/fieldvalues/list.html.tmpl @@ -23,6 +23,7 @@ ([% field.name FILTER html %]) field[% END %] [% PROCESS global/header.html.tmpl title = title + style_urls = ['skins/standard/admin.css'] %] [% edit_contentlink = BLOCK %]editvalues.cgi?action=edit&field= diff --git a/template/en/default/admin/fieldvalues/select-field.html.tmpl b/template/en/default/admin/fieldvalues/select-field.html.tmpl index 099eebab6..b3e1d97b6 100644 --- a/template/en/default/admin/fieldvalues/select-field.html.tmpl +++ b/template/en/default/admin/fieldvalues/select-field.html.tmpl @@ -17,6 +17,7 @@ [% PROCESS global/header.html.tmpl title = "Edit values for which field?" + style_urls = ['skins/standard/admin.css'] %] [% columns = [ diff --git a/template/en/default/admin/flag-type/confirm-delete.html.tmpl b/template/en/default/admin/flag-type/confirm-delete.html.tmpl index 70f5efb3d..a05e857d2 100644 --- a/template/en/default/admin/flag-type/confirm-delete.html.tmpl +++ b/template/en/default/admin/flag-type/confirm-delete.html.tmpl @@ -10,7 +10,8 @@ [% PROCESS global/header.html.tmpl title = title - doc_section = "flags-overview.html#flags-delete" + style_urls = ['skins/standard/admin.css'] + doc_section = "administering/flags.html#deleting-a-flag" %] <p> @@ -23,27 +24,17 @@ <a href="editflagtypes.cgi?action=deactivate&id=[% flag_type.id %]&token= [%- token FILTER html %]">deactivate it</a>, in which case the type [% IF flag_type.flag_count %] and its flags [% END %] will remain - in the database but will not appear in the [% terms.Bugzilla %] UI. + in the database but will not appear in the Bugzilla UI. </p> -<table> - <tr> - <td colspan="2"> - Do you really want to delete this type? - </td> - </tr> - <tr> - <td> - <a href="editflagtypes.cgi?action=delete&id=[% flag_type.id %]&token= - [%- token FILTER html %]">Yes, delete - </a> - </td> - <td align="right"> - <a href="editflagtypes.cgi"> - No, don't delete - </a> - </td> - </tr> -</table> +<p class="confirmation"> + Do you really want to delete this type? +</p> + +<p> + <a href="editflagtypes.cgi?action=delete&id=[% flag_type.id %]&token= + [%- token FILTER html %]">Yes, delete</a> - + <a href="editflagtypes.cgi">No, don't delete</a> +</p> [% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/admin/flag-type/edit.html.tmpl b/template/en/default/admin/flag-type/edit.html.tmpl index ab70e232b..6c0e0cb78 100644 --- a/template/en/default/admin/flag-type/edit.html.tmpl +++ b/template/en/default/admin/flag-type/edit.html.tmpl @@ -15,22 +15,17 @@ Based on [% type.name FILTER html %] [% END %] [% END %] - [% doc_section = "flags-overview.html#flags-create" %] [% ELSE %] [% title = BLOCK %]Edit Flag Type [% type.name FILTER html %][% END %] - [% doc_section = "flags-overview.html#flags-edit" %] [% END %] [% PROCESS global/header.html.tmpl title = title - style = " - table#form th { text-align: right; vertical-align: baseline; white-space: nowrap; } - table#form td { text-align: left; vertical-align: baseline; } - " + style_urls = ['skins/standard/admin.css'] onload="var f = document.forms['flagtype_properties']; selectProduct(f.product, f.component, null, null, '__Any__');" javascript_urls=["js/productform.js"] - doc_section = doc_section + doc_section = "administering/flags.html" %] <form id="flagtype_properties" method="post" action="editflagtypes.cgi"> @@ -49,15 +44,15 @@ [%# Add a hidden button at the top of the form so that the user pressing "return" # really submit the form, as expected. %] - <input type="submit" id="commit" value="Submit" style="display: none;"> + <input type="submit" id="commit" value="Submit" class="bz_default_hidden"> - <table id="form" cellspacing="0" cellpadding="4" border="0"> + <table id="admin_table_edit"> <tr> <th>Name:</th> <td> a short name identifying this type.<br> <input type="text" name="name" value="[% type.name FILTER html %]" size="50" - maxlength="50" [%- ' disabled="disabled"' UNLESS can_fully_edit %]> + maxlength="50" [%- ' disabled="disabled"' UNLESS can_fully_edit %] required> </td> </tr> @@ -71,6 +66,7 @@ cols = 80 defaultcontent = type.description disabled = !can_fully_edit + mandatory = 1 %] </td> </tr> @@ -90,14 +86,15 @@ [% END %] <table> <tr> - <td style="vertical-align: top;"> - <b>Product/Component:</b><br> - <select name="product" onchange="selectProduct(this, this.form.component, null, null, '__Any__');"> - <option value="">__Any__</option> - [% FOREACH prod = products %] - <option value="[% prod.name FILTER html %]">[% prod.name FILTER html %]</option> - [% END %] - </select><br> + <th class="top left"> + Product/Component:<br> + [% INCLUDE "global/product-select.html.tmpl" + id => "product" + name => "product" + add => "__Any__" + onchange => "selectProduct(this, this.form.component, null, null, '__Any__');" + products => products + %]<br> <select name="component"> <option value="">__Any__</option> [% FOREACH comp = components %] @@ -108,19 +105,19 @@ name="categoryAction-include" value="Include"> <input type="submit" id="categoryAction-exclude" name="categoryAction-exclude" value="Exclude"> - </td> - <td style="vertical-align: top;"> - <b>Inclusions:</b><br> + </th> + <th class="top left"> + Inclusions:<br> [% PROCESS category_select name="inclusion_to_remove" categories = inclusions %]<br> <input type="submit" id="categoryAction-removeInclusion" name="categoryAction-removeInclusion" value="Remove Inclusion"> - </td> - <td style="vertical-align: top;"> - <b>Exclusions:</b><br> + </th> + <th class="top left"> + Exclusions:<br> [% PROCESS category_select name="exclusion_to_remove" categories = exclusions %]<br> <input type="submit" id="categoryAction-removeExclusion" name="categoryAction-removeExclusion" value="Remove Exclusion"> - </td> + </th> </tr> </table> </td> @@ -129,12 +126,12 @@ <tr> <th>Sort Key:</th> <td> - a number between 1 and [% constants.MAX_SMALLINT FILTER none %] by which + a number between 0 and [% constants.MAX_SMALLINT FILTER none %] by which this type will be sorted when displayed to users in a list; ignore if you don't care what order the types appear in or if you want them to appear in alphabetical order.<br> - <input type="text" name="sortkey" value="[% type.sortkey || 1 FILTER html %]" size="5" - maxlength="5" [% ' disabled="disabled"' UNLESS can_fully_edit %]> + <input type="text" name="sortkey" value="[% type.sortkey || 0 FILTER html %]" size="5" + maxlength="5" [% ' disabled="disabled"' UNLESS can_fully_edit %] required> </td> </tr> diff --git a/template/en/default/admin/flag-type/list.html.tmpl b/template/en/default/admin/flag-type/list.html.tmpl index 7a0293866..b91b49199 100644 --- a/template/en/default/admin/flag-type/list.html.tmpl +++ b/template/en/default/admin/flag-type/list.html.tmpl @@ -10,15 +10,10 @@ [% PROCESS global/header.html.tmpl title = 'Administer Flag Types' - style = " - table#flag_types_bugs tr th, - table#flag_types_attachments tr th { text-align: left; } - .inactive { color: #787878; } - .multiplicable { display: block; } - " + style_urls = ['skins/standard/admin.css'] onload="var f = document.flagtype_form; selectProduct(f.product, f.component, null, null, '__All__');" javascript_urls=["js/productform.js"] - doc_section = "flags-overview.html#flag-types" + doc_section = "administering/flags.html" %] <p> @@ -42,38 +37,36 @@ </p> <form id="flagtype_form" name="flagtype_form" action="editflagtypes.cgi" method="get"> - <table> - <tr> - <th><label for="product">Product:</label></th> - <td> - <select name="product" onchange="selectProduct(this, this.form.component, null, null, '__Any__');"> - <option value="">__Any__</option> - [% FOREACH prod = products %] - <option value="[% prod.name FILTER html %]" - [% " selected" IF selected_product == prod.name %]> - [% prod.name FILTER html %]</option> - [% END %] - </select> - </td> - <th><label for="component">Component:</label></th> - <td> - <select name="component"> - <option value="">__Any__</option> - [% FOREACH comp = components %] - <option value="[% comp FILTER html %]" - [% " selected" IF selected_component == comp %]> - [% comp FILTER html %]</option> - [% END %] - </select> - </td> - <td> - <input type="checkbox" id="show_flag_counts" name="show_flag_counts" value="1" - [%+ 'checked="checked"' IF show_flag_counts %]> - <label for="show_flag_counts">Show flag counts</label> - </td> - <td><input type="submit" id="submit" value="Filter"></td> - </tr> - </table> + <div class="inline"> + <label for="product">Product:</label> + [% INCLUDE "global/product-select.html.tmpl" + id => "product" + name => "product" + add => "__Any__" + onchange => "selectProduct(this, this.form.component, null, null, '__Any__');" + products => products + %] + </div> + + <div class="inline"> + <label for="component">Component:</label> + <select name="component"> + <option value="">__Any__</option> + [% FOREACH comp = components %] + <option value="[% comp FILTER html %]" + [%+ 'selected="selected"' IF selected_component == comp %]> + [%- comp FILTER html %]</option> + [% END %] + </select> + </div> + + <div class="inline"> + <input type="checkbox" id="show_flag_counts" name="show_flag_counts" value="1" + [%+ 'checked="checked"' IF show_flag_counts %]> + <label for="show_flag_counts">Show flag counts</label> + </div> + + <input type="submit" id="submit" value="Filter"> </form> <h3>Flag Types for [% terms.Bugs %]</h3> @@ -96,9 +89,9 @@ [% BLOCK display_flag_types %] - <table id="flag_types_[% types_id FILTER html %]" cellspacing="0" cellpadding="4" border="1"> + <table id="flag_types_[% types_id FILTER html %]"> - <tr> + <tr class="column_header"> <th>Edit name ...</th> <th>Description</th> <th>Sortkey</th> @@ -116,9 +109,11 @@ [% FOREACH type = types %] <tr class="[% IF type.is_active %]active[% ELSE %]inactive[% END %]"> - <td><a href="editflagtypes.cgi?action=edit&id=[% type.id %]">[% type.name FILTER html FILTER no_break %]</a></td> + <td class="nowrap"> + <a href="editflagtypes.cgi?action=edit&id=[% type.id %]">[% type.name FILTER html %]</a> + </td> <td>[% type.description FILTER html %]</td> - <td align="right">[% type.sortkey FILTER html %]</td> + <td class="right">[% type.sortkey FILTER html %]</td> <td> [% IF type.is_requestable %] <span class="requestable">requestable</span> diff --git a/template/en/default/admin/groups/confirm-remove.html.tmpl b/template/en/default/admin/groups/confirm-remove.html.tmpl index a9aa7e132..3249ee384 100644 --- a/template/en/default/admin/groups/confirm-remove.html.tmpl +++ b/template/en/default/admin/groups/confirm-remove.html.tmpl @@ -19,7 +19,7 @@ [% PROCESS global/header.html.tmpl title = title - doc_section = "groups.html" + doc_section = "administering/groups.html" %] [% IF regexp %] @@ -32,7 +32,7 @@ [% END %] <p>Generally, you will only need to do this when upgrading groups - created with [% terms.Bugzilla %] versions 2.16 and earlier. Use + created with Bugzilla versions 2.16 and earlier. Use this option with <b>extreme care</b> and consult the documentation for further information. </p> diff --git a/template/en/default/admin/groups/create.html.tmpl b/template/en/default/admin/groups/create.html.tmpl index db65629d0..3827fb0e3 100644 --- a/template/en/default/admin/groups/create.html.tmpl +++ b/template/en/default/admin/groups/create.html.tmpl @@ -13,30 +13,35 @@ [% PROCESS global/header.html.tmpl title = "Add group" subheader = "This page allows you to define a new user group." - doc_section = "groups.html#create-groups" + style_urls = ['skins/standard/admin.css'] + doc_section = "administering/groups.html#creating-groups" %] <form method="post" action="editgroups.cgi"> - <table border="1" cellpadding="4" cellspacing="0"><tr> - <th>New Name</th> - <th>New Description</th> - <th>New User RegExp</th> - <th>Use For [% terms.Bugs %]</th> - </tr><tr> - <td><input size="20" name="name"></td> - <td><input size="40" name="desc"></td> - <td><input size="30" name="regexp"></td> - <td><input type="checkbox" name="isactive" value="1" checked></td> - </tr> - <tr> - <th>Icon URL:</th> - <td colspan="3"><input type="text" size="70" maxlength="255" id="icon_url" name="icon_url"></td> - </tr> - [% Hook.process('field') %] + <table id="admin_table_edit"> + <tr> + <th>Group Name:</th> + <td><input size="60" maxlength="255" name="name" required></td> + </tr> + <tr> + <th>Description:</th> + <td><input size="60" name="desc" required></td> + </tr> + <tr> + <th>User Regexp:</th> + <td><input size="60" name="regexp"></td> + </tr> + <tr> + <th>Icon URL:</th> + <td><input type="text" size="60" id="icon_url" name="icon_url"></td> + </tr> + <tr> + <th>Use For [% terms.Bugs %]:</th> + <td><input type="checkbox" name="isactive" value="1" checked></td> + </tr> + [% Hook.process('field') %] </table> - <hr> - <input type="checkbox" id="insertnew" name="insertnew" value="1" [% IF Param("makeproductgroups") %] checked[% END %]> <label for="insertnew">Insert new group into all existing products.</label> @@ -46,7 +51,9 @@ <input type="hidden" name="token" value="[% token FILTER html %]"> </form> -<p><b>Name</b> is what is used with the B<!-- blah -->ugzilla->user->in_group() +<hr> + +<p><b>Group Name</b> is what is used with the B[%%]ugzilla->user->in_group() function in any customized cgi files you write that use a given group. It can also be used by people submitting [% terms.bugs %] by email to limit [% terms.abug %] to a certain set of groups.</p> @@ -55,15 +62,6 @@ limit [% terms.abug %] to a certain set of groups.</p> to members of the group where they can choose whether the [% terms.bug %] will be restricted to others in the same group.</p> -<p>The <b>Use For [% terms.Bugs %]</b> flag determines whether or not the -group is eligible to be used for [% terms.bugs %]. If you clear this, it will -no longer be possible for users to add [% terms.bugs %] to this group, -although [% terms.bugs %] already in the group will remain in the group. -Doing so is a much less drastic way to stop a group from growing -than deleting the group would be. <b>Note: If you are creating -a group, you probably want it to be usable for [% terms.bugs %], in which -case you should leave this checked.</b></p> - <p><b>User RegExp</b> is optional, and if filled in, will automatically grant membership to this group to anyone with an email address that matches this regular expression.</p> @@ -75,6 +73,15 @@ email address that matches this regular expression.</p> in comments in [% terms.bugs %] besides the name of the author of comments. </p> +<p>The <b>Use For [% terms.Bugs %]</b> flag determines whether or not the +group is eligible to be used for [% terms.bugs %]. If you clear this, it will +no longer be possible for users to add [% terms.bugs %] to this group, +although [% terms.bugs %] already in the group will remain in the group. +Doing so is a much less drastic way to stop a group from growing +than deleting the group would be. <b>Note: If you are creating +a group, you probably want it to be usable for [% terms.bugs %], in which +case you should leave this checked.</b></p> + [% IF Param("makeproductgroups") %] <p>By default, the new group will be associated with existing products. Unchecking the "Insert new group into all existing products" option will @@ -87,8 +94,6 @@ email address that matches this regular expression.</p> a product.</p> [% END %] -<p>Back to the <a href="./">main [% terms.bugs %] page</a> - -or to the <a href="editgroups.cgi">group list</a>. +<p>Back to the <a href="editgroups.cgi">group list</a>.</p> [% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/admin/groups/delete.html.tmpl b/template/en/default/admin/groups/delete.html.tmpl index 5ae0ce92d..465860761 100644 --- a/template/en/default/admin/groups/delete.html.tmpl +++ b/template/en/default/admin/groups/delete.html.tmpl @@ -13,21 +13,28 @@ # group. #%] - +[% title = BLOCK %]Delete group '[% group.name FILTER html %]'[% END %] [% PROCESS global/header.html.tmpl - title = "Delete group" - doc_section = "groups.html" + title = title + style_urls = ['skins/standard/admin.css'] + doc_section = "administering/groups.html" %] -<table border="1"> - <tr> - <th>Id</th> - <th>Name</th> - <th>Description</th> +<table id="admin_table"> + <tr class="column_header"> + <th>Field</th> + <th>Value</th> </tr> <tr> + <td>Id</td> <td>[% group.id FILTER html %]</td> + </tr> + <tr> + <td>Name</td> <td>[% group.name FILTER html %]</td> + </tr> + <tr> + <td>Description</td> <td>[% group.description FILTER html_light %]</td> </tr> </table> @@ -151,7 +158,9 @@ <h2>Confirmation</h2> - <p>Do you really want to delete this group?</p> + <p class="confirmation"> + Do you really want to delete this group? + </p> [% IF group.users.size || group.bugs.size || group.products.size || group.flags.size %] diff --git a/template/en/default/admin/groups/edit.html.tmpl b/template/en/default/admin/groups/edit.html.tmpl index 2f4101a13..3e64fa7c4 100644 --- a/template/en/default/admin/groups/edit.html.tmpl +++ b/template/en/default/admin/groups/edit.html.tmpl @@ -18,30 +18,21 @@ [% PROCESS global/header.html.tmpl title = title - doc_section = "groups.html#edit-groups" - style = " - .grant_table { border-collapse: collapse; } - .grant_table td, .grant_table th { - padding-left: .5em; - } - .grant_table td.one, .grant_table th.one { - border-right: 1px solid black; - padding-right: .5em; - } - " + style_urls = ['skins/standard/admin.css'] + doc_section = "administering/groups.html#editing-groups-and-assigning-group-permissions" %] <form method="post" action="editgroups.cgi"> <input type="hidden" name="action" value="postchanges"> <input type="hidden" name="group_id" value="[% group.id FILTER html %]"> - <table border="1" cellpadding="4"> + <table id="admin_table_edit"> <tr> <th>Group:</th> <td> [% IF group.is_bug_group %] - <input type="text" name="name" size="60" - value="[% group.name FILTER html %]"> + <input type="text" name="name" size="60" maxlength="255" + value="[% group.name FILTER html %]" required> [% ELSE %] [% group.name FILTER html %] [% END %] @@ -52,8 +43,8 @@ <th>Description:</th> <td> [% IF group.is_bug_group %] - <input type="text" name="desc" size="70" - value="[% group.description FILTER html %]"> + <input type="text" name="desc" size="60" + value="[% group.description FILTER html %]" required> [% ELSE %] [% group.description FILTER html %] [% END %] @@ -63,7 +54,7 @@ <tr> <th>User Regexp:</th> <td> - <input type="text" name="regexp" size="40" + <input type="text" name="regexp" size="60" value="[% group.user_regexp FILTER html %]"> </td> </tr> @@ -76,7 +67,7 @@ [% END %] </th> <td> - <input type="text" name="icon_url" size="70" maxlength="255" + <input type="text" name="icon_url" size="60" value="[% group.icon_url FILTER html %]"> </td> </tr> @@ -95,78 +86,72 @@ <h4>Group Permissions</h4> - <table class="grant_table"> + <table id="grant_table"> <tr> - <th class="one">Groups That Are a Member of This Group<br> - ("Users in <var>X</var> are automatically in - [%+ group.name FILTER html %]")</th> - <th>Groups That This Group Is a Member Of<br> - ("If you are in [% group.name FILTER html %], you are - automatically also in...")</th> + <th colspan="2"> + Groups That Are a Member of This Group<br> + ("Users in <var>X</var> are automatically in [% group.name FILTER html %]") + </th> + <th colspan="2"> + Groups That This Group Is a Member Of<br> + ("If you are in [% group.name FILTER html %], you are automatically also in...") + </th> </tr> + <tr> - <td class="one"> - [% PROCESS select_pair name = "members" size = 10 - items_available = members_available - items_current = members_current %] - </td> - - <td>[% PROCESS select_pair name = "member_of" size = 10 - items_available = member_of_available - items_current = member_of_current %]</td> + [% PROCESS select_pair name = "members" size = 10 + items_available = members_available + items_current = members_current %] + + [% PROCESS select_pair name = "member_of" size = 10 + items_available = member_of_available + items_current = member_of_current %] </tr> - </table> - <table class="grant_table"> <tr> - <th class="one"> + <th colspan="2"> Groups That Can Grant Membership in This Group<br> - ("Users in <var>X</var> can add other users to - [%+ group.name FILTER html %]") - + ("Users in <var>X</var> can add other users to [% group.name FILTER html %]") + </th> + <th colspan="2"> + Groups That This Group Can Grant Membership In<br> + ("Users in [% group.name FILTER html %] can add users to...") </th> - <th>Groups That This Group Can Grant Membership In<br> - ("Users in [% group.name FILTER html %] can add users to...") - </th> </tr> + <tr> - <td class="one"> - [% PROCESS select_pair name = "bless_from" size = 10 - items_available = bless_from_available - items_current = bless_from_current %] - </td> - <td>[% PROCESS select_pair name = "bless_to" size = 10 - items_available = bless_to_available - items_current = bless_to_current %] - </td> + [% PROCESS select_pair name = "bless_from" size = 10 + items_available = bless_from_available + items_current = bless_from_current %] + + [% PROCESS select_pair name = "bless_to" size = 10 + items_available = bless_to_available + items_current = bless_to_current %] </tr> - </table> - [% IF Param('usevisibilitygroups') %] - <table class="grant_table"> + [% IF Param('usevisibilitygroups') %] <tr> - <th class="one"> + <th colspan="2"> Groups That Can See This Group<br> - ("Users in <var>X</var> can see users in - [%+ group.name FILTER html %]") + ("Users in <var>X</var> can see users in [% group.name FILTER html %]") + </th> + <th colspan="2"> + Groups That This Group Can See<br> + ("Users in [% group.name FILTER html %] can see users in...") </th> - <th>Groups That This Group Can See<br> - ("Users in [% group.name FILTER html %] can see users in...") - </th> </tr> + <tr> - <td class="one"> - [% PROCESS select_pair name = "visible_from" size = 10 - items_available = visible_from_available - items_current = visible_from_current %] - </td> - <td>[% PROCESS select_pair name = "visible_to_me" size = 10 - items_available = visible_to_me_available - items_current = visible_to_me_current %] - </td> + [% PROCESS select_pair name = "visible_from" size = 10 + items_available = visible_from_available + items_current = visible_from_current %] + + [% PROCESS select_pair name = "visible_to_me" size = 10 + items_available = visible_to_me_available + items_current = visible_to_me_current %] </tr> - </table> - [% END %] + [% END %] + </table> <input type="submit" id="update-group" value="Update Group"> <input type="hidden" name="token" value="[% token FILTER html %]"> @@ -175,12 +160,11 @@ <h4>Mass Remove</h4> <p>You can use this form to do mass-removal of users from groups. - This is often very useful if you upgraded from [% terms.Bugzilla %] + This is often very useful if you upgraded from Bugzilla 2.16.</p> -<table><tr><td> <form method="post" action="editgroups.cgi"> - <fieldset> + <fieldset id="mass-remove"> <legend>Remove all explicit memberships from users whose login names match the following regular expression:</legend> <input type="text" size="20" name="regexp"> @@ -193,41 +177,35 @@ <input type="hidden" name="group_id" value="[% group.id FILTER html %]"> </fieldset> </form> -</td></tr></table> - + <p>Back to the <a href="editgroups.cgi">group list</a>.</p> [% PROCESS global/footer.html.tmpl %] [% BLOCK select_pair %] - <table class="select_pair"> - <tr> - <th><label for="[% "${name}_add" FILTER html %]">Add<br> - (select to add)</label></th> - <th><label for="[% "${name}_remove" FILTER html %]">Current<br> - (select to remove)</label></th> - </tr> - <tr> - <td> - <select multiple="multiple" size="[% size FILTER html %]" - name="[% "${name}_add" FILTER html %]" - id="[% "${name}_add" FILTER html %]"> - [% FOREACH item = items_available %] - <option value="[% item.id FILTER html %]"> - [% item.name FILTER html %]</option> - [% END %] - </select> - </td> - <td> - <select multiple="multiple" size="[% size FILTER html %]" - name="[% "${name}_remove" FILTER html %]" - id="[% "${name}_remove" FILTER html %]"> - [% FOREACH item = items_current %] - <option value="[% item.id FILTER html %]"> - [% item.name FILTER html %]</option> - [% END %] - </select> - </td> - </tr> - </table> + <td> + <label for="[% "${name}_add" FILTER html %]">Add<br>(select to add)</label> + <br> + <select multiple="multiple" size="[% size FILTER html %]" + name="[% "${name}_add" FILTER html %]" + id="[% "${name}_add" FILTER html %]"> + [% FOREACH item = items_available %] + <option value="[% item.id FILTER html %]"> + [% item.name FILTER html %]</option> + [% END %] + </select> + </td> + + <td> + <label for="[% "${name}_remove" FILTER html %]">Current<br>(select to remove)</label> + <br> + <select multiple="multiple" size="[% size FILTER html %]" + name="[% "${name}_remove" FILTER html %]" + id="[% "${name}_remove" FILTER html %]"> + [% FOREACH item = items_current %] + <option value="[% item.id FILTER html %]"> + [% item.name FILTER html %]</option> + [% END %] + </select> + </td> [% END %] diff --git a/template/en/default/admin/groups/list.html.tmpl b/template/en/default/admin/groups/list.html.tmpl index 859f26205..673c053cb 100644 --- a/template/en/default/admin/groups/list.html.tmpl +++ b/template/en/default/admin/groups/list.html.tmpl @@ -19,7 +19,8 @@ [% PROCESS global/header.html.tmpl title = "Edit Groups" subheader = "This lets you edit the groups available to put users in." - doc_section = "groups.html" + style_urls = ['skins/standard/admin.css'] + doc_section = "administering/groups.html" %] [% edit_contentlink = "editgroups.cgi?action=changeform&group=%%id%%" %] @@ -74,8 +75,8 @@ } %] -[% FOREACH group IN ["chartgroup", "insidergroup", "timetrackinggroup", - "querysharegroup", "debug_group"] %] +[% FOREACH group IN ["chartgroup", "comment_taggers_group", "debug_group", + "insidergroup", "querysharegroup", "timetrackinggroup"] %] [% special_group = Param(group) %] [% IF special_group %] diff --git a/template/en/default/admin/keywords/confirm-delete.html.tmpl b/template/en/default/admin/keywords/confirm-delete.html.tmpl index 718a32ec5..9f59cc57f 100644 --- a/template/en/default/admin/keywords/confirm-delete.html.tmpl +++ b/template/en/default/admin/keywords/confirm-delete.html.tmpl @@ -12,26 +12,29 @@ [% PROCESS global/header.html.tmpl title = "Delete Keyword" + style_urls = ['skins/standard/admin.css'] %] -<p> +<h2>Confirmation</h2> + +<p class="confirmation"> [% IF keyword.bug_count == 1 %] - There is one [% terms.bug %] with this keyword set. + There is one [% terms.bug %] [% ELSIF keyword.bug_count > 1 %] - There are [% keyword.bug_count FILTER html %] [%+ terms.bugs %] with - this keyword set. + There are [% keyword.bug_count FILTER html %] [%+ terms.bugs %] [% END %] - - Are you <b>sure</b> you want to delete - the <code>[% keyword.name FILTER html %]</code> keyword? + with the <em>[% keyword.name FILTER html %]</em> keyword set. +</p> + +<p> + Do you really want to delete this keyword? </p> <form method="post" action="editkeywords.cgi"> <input type="hidden" name="id" value="[% keyword.id FILTER html %]"> <input type="hidden" name="action" value="delete"> <input type="hidden" name="token" value="[% token FILTER html %]"> - <input type="submit" id="delete" - value="Yes, really delete the keyword"> + <input type="submit" id="delete" value="Yes, delete"> </form> <p><a href="editkeywords.cgi">Edit other keywords</a>.</p> diff --git a/template/en/default/admin/keywords/create.html.tmpl b/template/en/default/admin/keywords/create.html.tmpl index e29db400c..21ecaf920 100644 --- a/template/en/default/admin/keywords/create.html.tmpl +++ b/template/en/default/admin/keywords/create.html.tmpl @@ -9,37 +9,41 @@ [%# INTERFACE: # none #%] - + [% PROCESS global/header.html.tmpl title = "Add keyword" subheader = "This page allows you to add a new keyword." + style_urls = ['skins/standard/admin.css'] %] <form method="post" action="editkeywords.cgi"> - <table border="0" cellpadding="4" cellspacing="0"> + <table id="admin_table_edit"> <tr> - <th align="right">Name:</th> - <td><input size="64" maxlength="64" name="name" value=""></td> + <th>Name:</th> + <td><input size="64" maxlength="64" name="name" value="" required></td> </tr> <tr> - <th align="right">Description:</th> + <th>Description:</th> <td> [% INCLUDE global/textarea.html.tmpl name = 'description' minrows = 4 cols = 64 wrap = 'virtual' + mandatory = 1 %] </td> </tr> </table> - <hr> + <input type="hidden" name="id" value="-1"> <input type="submit" id="create" value="Add"> <input type="hidden" name="action" value="new"> <input type="hidden" name="token" value="[% token FILTER html %]"> </form> +<hr> + <p><a href="editkeywords.cgi">Edit other keywords</a>.</p> [% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/admin/keywords/edit.html.tmpl b/template/en/default/admin/keywords/edit.html.tmpl index 07603e1de..23158d36f 100644 --- a/template/en/default/admin/keywords/edit.html.tmpl +++ b/template/en/default/admin/keywords/edit.html.tmpl @@ -12,17 +12,18 @@ [% PROCESS global/header.html.tmpl title = "Edit keyword" + style_urls = ['skins/standard/admin.css'] %] <form method="post" action="editkeywords.cgi"> - <table border="0" cellpadding="4" cellspacing="0"> + <table id="admin_table_edit"> <tr> - <th align="right">Name:</th> + <th>Name:</th> <td><input size="64" maxlength="64" name="name" - value="[% keyword.name FILTER html %]"></td> + value="[% keyword.name FILTER html %]" required></td> </tr> <tr> - <th align="right">Description:</th> + <th>Description:</th> <td> [% INCLUDE global/textarea.html.tmpl name = 'description' @@ -30,11 +31,12 @@ cols = 64 wrap = 'virtual' defaultcontent = keyword.description + mandatory = 1 %] </td> </tr> <tr> - <th align="right">[% terms.Bugs %]:</th> + <th>[% terms.Bugs %]:</th> <td> [% IF keyword.bug_count > 0 %] <a href="buglist.cgi?keywords=[% keyword.name FILTER uri %]"> diff --git a/template/en/default/admin/keywords/list.html.tmpl b/template/en/default/admin/keywords/list.html.tmpl index ea98ca773..c3f4a5292 100644 --- a/template/en/default/admin/keywords/list.html.tmpl +++ b/template/en/default/admin/keywords/list.html.tmpl @@ -16,6 +16,7 @@ [% PROCESS global/header.html.tmpl title = "Select keyword" + style_urls = ['skins/standard/admin.css'] %] [% columns = [ @@ -32,7 +33,7 @@ { name => "bug_count" heading => "$terms.Bugs" - align => "right" + class => "right" contentlink => "buglist.cgi?keywords=%%name%%" }, { diff --git a/template/en/default/admin/milestones/confirm-delete.html.tmpl b/template/en/default/admin/milestones/confirm-delete.html.tmpl index cc30f164f..bc8b4eee3 100644 --- a/template/en/default/admin/milestones/confirm-delete.html.tmpl +++ b/template/en/default/admin/milestones/confirm-delete.html.tmpl @@ -21,33 +21,33 @@ style_urls = ['skins/standard/admin.css'] %] -<table border="1" cellpadding="4" cellspacing="0"> -<tr bgcolor="#6666FF"> - <th valign="top" align="left">Field</th> - <th valign="top" align="left">Value</th> -</tr> -<tr> - <td valign="top">Milestone:</td> - <td valign="top">[% milestone.name FILTER html %]</td> -</tr> -<tr> - <td valign="top">Milestone of Product:</td> - <td valign="top">[% product.name FILTER html %]</td> -</tr> -<tr> - <td valign="top">[% terms.Bugs %]:</td> - <td valign="top"> -[% IF milestone.bug_count %] - <a title="List of [% terms.bugs %] targetted at milestone ' - [% milestone.name FILTER html %]'" - href="buglist.cgi?target_milestone=[% milestone.name FILTER uri %]&product= - [%- product.name FILTER uri %]"> +<table id="admin_table"> + <tr class="column_header"> + <th>Field</th> + <th>Value</th> + </tr> + <tr> + <td>Milestone</td> + <td>[% milestone.name FILTER html %]</td> + </tr> + <tr> + <td>Milestone of Product</td> + <td>[% product.name FILTER html %]</td> + </tr> + <tr> + <td>[% terms.Bugs %]</td> + <td> + [% IF milestone.bug_count %] + <a title="List of [% terms.bugs %] targetted at milestone ' + [%- milestone.name FILTER html %]'" + href="buglist.cgi?target_milestone=[% milestone.name FILTER uri %]&product= + [%- product.name FILTER uri %]"> [% milestone.bug_count FILTER none %]</a> -[% ELSE %] - None -[% END %] - </td> -</tr> + [% ELSE %] + None + [% END %] + </td> + </tr> </table> <h2>Confirmation</h2> diff --git a/template/en/default/admin/milestones/create.html.tmpl b/template/en/default/admin/milestones/create.html.tmpl index 8006c0cd0..4f1a24144 100644 --- a/template/en/default/admin/milestones/create.html.tmpl +++ b/template/en/default/admin/milestones/create.html.tmpl @@ -17,20 +17,19 @@ [% PROCESS global/header.html.tmpl title = title subheader = subheader - onload = "document.forms['f'].milestone.focus()" + style_urls = ['skins/standard/admin.css'] %] <form name="f" method="post" action="editmilestones.cgi"> - <table border="0" cellpadding="4" cellspacing="0"> + <table id="admin_table_edit"> <tr> - <th align="right"><label for="milestone">Milestone:</label></th> + <th><label for="milestone">Milestone:</label></th> <td><input id="milestone" size="64" maxlength="64" name="milestone" - value=""></td> + autofocus required></td> </tr> <tr> - <th align="right"><label for="sortkey">Sortkey:</label></th> - <td><input id="sortkey" size="20" maxlength="20" name="sortkey" - value=""></td> + <th><label for="sortkey">Sortkey:</label></th> + <td><input id="sortkey" size="20" maxlength="20" name="sortkey"></td> </tr> </table> <input type="submit" id="create" value="Add"> diff --git a/template/en/default/admin/milestones/edit.html.tmpl b/template/en/default/admin/milestones/edit.html.tmpl index 759bd708a..cbc7330fe 100644 --- a/template/en/default/admin/milestones/edit.html.tmpl +++ b/template/en/default/admin/milestones/edit.html.tmpl @@ -17,24 +17,24 @@ [%- product.name FILTER html %]'[% END %] [% PROCESS global/header.html.tmpl title = title + style_urls = ['skins/standard/admin.css'] onload = "document.forms['f'].milestone.select()" %] <form name="f" method="post" action="editmilestones.cgi"> - <table border="0" cellpadding="4" cellspacing="0"> - + <table id="admin_table_edit"> <tr> - <th class="field_label"><label for="milestone">Milestone:</label></th> + <th><label for="milestone">Milestone:</label></th> <td><input id="milestone" size="64" maxlength="64" name="milestone" value=" - [%- milestone.name FILTER html %]"></td> + [%- milestone.name FILTER html %]" required></td> </tr> <tr> - <th class="field_label"><label for="sortkey">Sortkey:</label></th> + <th><label for="sortkey">Sortkey:</label></th> <td><input id="sortkey" size="20" maxlength="20" name="sortkey" value=" [%- milestone.sortkey FILTER html %]"></td> </tr> <tr> - <th class="field_label"><label for="isactive">Enabled For [% terms.Bugs %]:</label></th> + <th><label for="isactive">Enabled For [% terms.Bugs %]:</label></th> <td><input id="isactive" name="isactive" type="checkbox" value="1" [% 'checked="checked"' IF milestone.isactive %]></td> </tr> diff --git a/template/en/default/admin/milestones/list.html.tmpl b/template/en/default/admin/milestones/list.html.tmpl index 16382799f..aa377d88e 100644 --- a/template/en/default/admin/milestones/list.html.tmpl +++ b/template/en/default/admin/milestones/list.html.tmpl @@ -19,6 +19,7 @@ '[% product.name FILTER html %]'[% END %] [% PROCESS global/header.html.tmpl title = title + style_urls = ['skins/standard/admin.css'] %] [% edit_contentlink = BLOCK %]editmilestones.cgi?action=edit&product= @@ -52,7 +53,7 @@ [% columns.push({ name => "bug_count" heading => "$terms.Bugs" - align => "right" + class => "right" contentlink => bug_count_contentlink }) %] diff --git a/template/en/default/admin/milestones/select-product.html.tmpl b/template/en/default/admin/milestones/select-product.html.tmpl index 18bb88c7e..e2784127e 100644 --- a/template/en/default/admin/milestones/select-product.html.tmpl +++ b/template/en/default/admin/milestones/select-product.html.tmpl @@ -13,6 +13,7 @@ [% PROCESS global/header.html.tmpl title = "Edit milestones for which product?" + style_urls = ['skins/standard/admin.css'] %] [% columns = [ @@ -34,7 +35,7 @@ [% columns.push({ name => 'bug_count' heading => "$terms.Bugs" - align => "right" + class => "right" contentlink => "buglist.cgi?product=%%name%%" }) %] diff --git a/template/en/default/admin/params/admin.html.tmpl b/template/en/default/admin/params/admin.html.tmpl index c63329cae..f172a6316 100644 --- a/template/en/default/admin/params/admin.html.tmpl +++ b/template/en/default/admin/params/admin.html.tmpl @@ -21,8 +21,11 @@ "switching this option on will not let users use an invalid address.", allowuserdeletion => "The user editing pages are capable of letting you delete user accounts. " _ - "$terms.Bugzilla will issue a warning in case you'd run into inconsistencies " _ + "Bugzilla will issue a warning in case you'd run into inconsistencies " _ "when you're about to do so, but such deletions remain kinda scary. " _ "So, you have to turn on this option before any such deletions " _ - "will ever happen." } + "will ever happen." + + last_visit_keep_days => "This option controls how many days $terms.Bugzilla will " _ + "remember when users visit specific ${terms.bugs}."} %] diff --git a/template/en/default/admin/params/advanced.html.tmpl b/template/en/default/admin/params/advanced.html.tmpl index 076d2dc7b..1f24c7d06 100644 --- a/template/en/default/admin/params/advanced.html.tmpl +++ b/template/en/default/admin/params/advanced.html.tmpl @@ -18,7 +18,7 @@ security to your SSL connections by forcing the browser to always access your domain over SSL and never accept an invalid certificate. However, it should only be used if you have the <code>ssl_redirect</code> - parameter turned on, [% terms.Bugzilla %] is the only thing running + parameter turned on, Bugzilla is the only thing running on its domain (i.e., your <code>urlbase</code> is something like <code>http://bugzilla.example.com/</code>), and you never plan to disable the <code>ssl_redirect</code> parameter. @@ -35,7 +35,7 @@ with the <code>includeSubDomains</code> flag, which will apply the security change to all subdomains. This is especially useful when combined with an <code>attachment_base</code> that exists as (a) - subdomain(s) under the main [% terms.Bugzilla %] domain. + subdomain(s) under the main Bugzilla domain. </li> </ul> [% END %] @@ -44,22 +44,22 @@ cookiedomain => "If your website is at 'www.foo.com', setting this to" _ " '.foo.com' will also allow 'bar.foo.com' to access" - _ " $terms.Bugzilla cookies. This is useful if you have more than" + _ " Bugzilla cookies. This is useful if you have more than" _ " one hostname pointing at the same web server, and you" - _ " want them to share the $terms.Bugzilla cookie.", + _ " want them to share the Bugzilla cookie.", inbound_proxies => - "When inbound traffic to $terms.Bugzilla goes through a proxy," - _ " $terms.Bugzilla thinks that the IP address of every single" + "When inbound traffic to Bugzilla goes through a proxy," + _ " Bugzilla thinks that the IP address of every single" _ " user is the IP address of the proxy. If you enter a comma-separated" - _ " list of IPs in this parameter, then $terms.Bugzilla will trust any" + _ " list of IPs in this parameter, then Bugzilla will trust any" _ " <code>X-Forwarded-For</code> header sent from those IPs," _ " and use the value of that header as the end user's IP address.", proxy_url => - "$terms.Bugzilla may have to access the web to get notifications about" - _ " new releases (see the <tt>upgrade_notification</tt> parameter)." - _ " If your $terms.Bugzilla server is behind a proxy, it may be" + "Bugzilla may have to access the web to get notifications about" + _ " new releases (see the <var>upgrade_notification</var> parameter)." + _ " If your Bugzilla server is behind a proxy, it may be" _ " necessary to enter its URL if the web server cannot access the" _ " HTTP_PROXY environment variable. If you have to authenticate," _ " use the <code>http://user:pass@proxy_url/</code> syntax.", diff --git a/template/en/default/admin/params/attachment.html.tmpl b/template/en/default/admin/params/attachment.html.tmpl index c0c32a4d5..5efcc1106 100644 --- a/template/en/default/admin/params/attachment.html.tmpl +++ b/template/en/default/admin/params/attachment.html.tmpl @@ -19,44 +19,44 @@ _ "<p>This is a security restriction for installations where untrusted" _ " users may upload attachments that could be potentially damaging if" _ " viewed directly in the browser.</p>" - _ "<p>It is highly recommended that you set the <tt>attachment_base</tt>" + _ "<p>It is highly recommended that you set the <var>attachment_base</var>" _ " parameter if you turn this parameter on.", attachment_base => - "When the <tt>allow_attachment_display</tt> parameter is on, it is " + "When the <var>allow_attachment_display</var> parameter is on, it is " _ " possible for a malicious attachment to steal your cookies or" - _ " perform an attack on $terms.Bugzilla using your credentials." + _ " perform an attack on Bugzilla using your credentials." _ "<p>If you would like additional security on attachments to avoid" - _ " this, set this parameter to an alternate URL for your $terms.Bugzilla" - _ " that is not the same as <tt>urlbase</tt> or <tt>sslbase</tt>." + _ " this, set this parameter to an alternate URL for your Bugzilla" + _ " that is not the same as <var>urlbase</var> or <var>sslbase</var>." _ " That is, a different domain name that resolves to this exact" - _ " same $terms.Bugzilla installation.</p>" + _ " same Bugzilla installation.</p>" _ "<p>Note that if you have set the" - _ " <a href=\"editparams.cgi?section=advanced#cookiedomain_desc\"><tt>cookiedomain</tt>" - _" parameter</a>, you should set <tt>attachment_base</tt> to use a" + _ " <a href=\"editparams.cgi?section=advanced#cookiedomain_desc\"><var>cookiedomain</var>" + _" parameter</a>, you should set <var>attachment_base</var> to use a" _ " domain that would <em>not</em> be matched by" - _ " <tt>cookiedomain</tt>.</p>" - _ "<p>For added security, you can insert <tt>%bugid%</tt> into the URL," + _ " <var>cookiedomain</var>.</p>" + _ "<p>For added security, you can insert <var>%bugid%</var> into the URL," _ " which will be replaced with the ID of the current $terms.bug that" _ " the attachment is on, when you access an attachment. This will limit" _ " attachments to accessing only other attachments on the same" _ " ${terms.bug}. Remember, though, that all those possible domain names " - _ " (such as <tt>1234.your.domain.com</tt>) must point to this same" - _ " $terms.Bugzilla instance.", + _ " (such as <kbd>1234.your.domain.com</kbd>) must point to this same" + _ " Bugzilla instance.", allow_attachment_deletion => "If this option is on, administrators will be able to delete " _ "the content of attachments.", maxattachmentsize => "The maximum size (in kilobytes) of attachments to be stored " _ "in the database. If a file larger than this size is attached " _ - "to ${terms.abug}, $terms.Bugzilla will look at the " _ - "<a href=\"#maxlocalattachment\"><tt>maxlocalattachment</tt> parameter</a> " _ + "to ${terms.abug}, Bugzilla will look at the " _ + "<a href=\"#maxlocalattachment\"><var>maxlocalattachment</var> parameter</a> " _ "to determine if the file can be stored locally on the web server. " _ "If the file size exceeds both limits, then the attachment is rejected. " _ "Settings both parameters to 0 will prevent attaching files to ${terms.bugs}.", maxlocalattachment => "The maximum size (in megabytes) of attachments to be stored " _ "locally on the web server. If set to a value lower than the " _ - "<a href=\"#maxattachmentsize\"><tt>maxattachmentsize</tt> parameter</a>, " _ + "<a href=\"#maxattachmentsize\"><var>maxattachmentsize</var> parameter</a>, " _ "attachments will never be kept on the local filesystem." } %] diff --git a/template/en/default/admin/params/auth.html.tmpl b/template/en/default/admin/params/auth.html.tmpl index 0a72938ca..902d2fc82 100644 --- a/template/en/default/admin/params/auth.html.tmpl +++ b/template/en/default/admin/params/auth.html.tmpl @@ -50,13 +50,13 @@ <dl> <dt>DB</dt> <dd> - ${terms.Bugzilla}'s built-in authentication. This is the most common + Bugzilla's built-in authentication. This is the most common choice. </dd> <dt>RADIUS</dt> <dd> RADIUS authentication using a RADIUS server. - Please see the $terms.Bugzilla documentation for + Please see the Bugzilla documentation for more information. Using this method requires <a href=\"?section=radius\">additional @@ -65,7 +65,7 @@ <dt>LDAP</dt> <dd> LDAP authentication using an LDAP server. - Please see the $terms.Bugzilla documentation + Please see the Bugzilla documentation for more information. Using this method requires <a href=\"?section=ldap\">additional parameters</a> to be set. @@ -84,8 +84,8 @@ </li> <li> defaulton/defaultoff - Default behavior as described - above, but user can choose whether $terms.Bugzilla will remember his - login or not. + above, but user can choose whether Bugzilla will + remember their login or not. </li> </ul>", @@ -93,20 +93,27 @@ "front page will require a login. No anonymous users will " _ "be permitted.", + webservice_email_filter => + "Filter email addresses returned by the WebService API depending on " _ + "if the user is logged in or not. This works similarly to how the " _ + "web UI currently filters email addresses. If <var>requirelogin</var> " _ + "is enabled, then this parameter has no effect as users must be logged " _ + "in to use Bugzilla.", + emailregexp => "This defines the regular expression to use for legal email addresses. " _ "The default tries to match fully qualified email addresses. " _ - "Use <tt>.*</tt> to accept any email address following the " _ + "Use <kbd>.*</kbd> to accept any email address following the " _ "<a href=\"http://tools.ietf.org/html/rfc2822#section-3.4.1\">RFC 2822</a> " _ - "specification. Another popular value to put here is <tt>^[^@]+$</tt>, " _ + "specification. Another popular value to put here is <kbd>^[^@]+$</kbd>, " _ "which means 'local usernames, no @ allowed.'", - emailregexpdesc => "This describes in English words what kinds of legal addresses " _ - "are allowed by the <tt>emailregexp</tt> param.", + emailregexpdesc => "This description explains valid addresses that " _ + "are allowed by the <var>emailregexp</var> param.", emailsuffix => "This is a string to append to any email addresses when actually " _ "sending mail to that address. It is useful if you have changed " _ - "the <tt>emailregexp</tt> param to only allow local usernames, " _ + "the <var>emailregexp</var> param to only allow local usernames, " _ "but you want the mail to be delivered to username@my.local.hostname.", createemailregexp => "This defines the (case-insensitive) regexp to use for email addresses that are " _ @@ -126,5 +133,11 @@ "lower case letter and a number.</li>" _ "<li>letters_numbers_specialchars - Passwords must contain at least one " _ "letter, a number and a special character.</li></ul>" + + password_check_on_login => + "If set, $terms.Bugzilla will check that the password meets the current " _ + "complexity rules and minimum length requirements when the user logs " _ + "into the $terms.Bugzilla web interface. If it doesn't, the user would " _ + "not be able to log in, and recieve a message to reset their password." } %] diff --git a/template/en/default/admin/params/bugfields.html.tmpl b/template/en/default/admin/params/bugfields.html.tmpl index 07b200825..1f177067a 100644 --- a/template/en/default/admin/params/bugfields.html.tmpl +++ b/template/en/default/admin/params/bugfields.html.tmpl @@ -11,7 +11,7 @@ %] [% param_descs = { - useclassification => "If this is on, $terms.Bugzilla will associate each product with a " _ + useclassification => "If this is on, Bugzilla will associate each product with a " _ "specific classification. But you must have 'editclassification' " _ "permissions enabled in order to edit classifications.", @@ -34,12 +34,16 @@ defaultplatform => "This is the platform that is preselected on the $terms.bug " _ "entry form.<br> " _ "You can leave this empty: " _ - "$terms.Bugzilla will then use the platform that the browser " _ + "Bugzilla will then use the platform that the browser " _ "reports to be running on as the default.", defaultopsys => "This is the operating system that is preselected on the $terms.bug " _ "entry form.<br> " _ "You can leave this empty: " _ - "$terms.Bugzilla will then use the operating system that the browser " _ - "reports to be running on as the default." } + "Bugzilla will then use the operating system that the browser " _ + "reports to be running on as the default.", + + collapsed_comment_tags => "A comma separated list of tags which, when applied " _ + "to comments, will cause them to be collapsed by default", + } %] diff --git a/template/en/default/admin/params/common.html.tmpl b/template/en/default/admin/params/common.html.tmpl index bf2675b16..db3bde777 100644 --- a/template/en/default/admin/params/common.html.tmpl +++ b/template/en/default/admin/params/common.html.tmpl @@ -69,14 +69,14 @@ [% END %] </select> </td> - <td style="vertical-align: bottom"> + <td class="bottom"> <button type="button" onClick="sortedList_moveItem('[% param.name FILTER html %]', -1, '[% sortlist_separator %]');">↑</button> </td> </tr> <tr> - <td style="vertical-align: top"> + <td class="top"> <button type="button" onClick="sortedList_moveItem('[% param.name FILTER html %]', +1, '[% sortlist_separator %]');">↓</button> </td> @@ -107,10 +107,10 @@ [% END %] </select> [% ELSE %] - <font color="red"> + <span class="warning"> Unknown param type [% param.type FILTER html %]!!! - </font> - [% END %] + </span> + [% END %] </p> [% UNLESS param.no_reset %] <p> diff --git a/template/en/default/admin/params/core.html.tmpl b/template/en/default/admin/params/core.html.tmpl index fd839ed9b..d7703b5b8 100644 --- a/template/en/default/admin/params/core.html.tmpl +++ b/template/en/default/admin/params/core.html.tmpl @@ -8,7 +8,7 @@ [% title = "Required Settings" - desc = "Settings that are required for proper operation of $terms.Bugzilla" + desc = "Settings that are required for proper operation of Bugzilla" %] [% param_descs = { @@ -19,17 +19,17 @@ "(SSL) $terms.Bugzilla URLs.", ssl_redirect => - "When this is enabled, $terms.Bugzilla will ensure that every page is" + "When this is enabled, Bugzilla will ensure that every page is" _ " accessed over SSL, by redirecting any plain HTTP requests to HTTPS" - _ " using the <tt>sslbase</tt> parameter. Also, when this is enabled," - _ " $terms.Bugzilla will send out links using <tt>sslbase</tt> in emails" - _ " instead of <tt>urlbase</tt>.", + _ " using the <var>sslbase</var> parameter. Also, when this is enabled," + _ " Bugzilla will send out links using <var>sslbase</var> in emails" + _ " instead of <var>urlbase</var>.", cookiepath => "Path, relative to your web document root, to which to restrict " _ - "$terms.Bugzilla cookies. Normally this is the URI portion of your URL " _ + "Bugzilla cookies. Normally this is the URI portion of your URL " _ "base. Begin with a / (single slash mark). For instance, if " _ - "$terms.Bugzilla serves from 'http://www.somedomain.com/bugzilla/', set " _ + "Bugzilla serves from 'http://www.somedomain.com/bugzilla/', set " _ "this parameter to /bugzilla/. Setting it to / will allow " _ "all sites served by this web server or virtual host to read " _ - "$terms.Bugzilla cookies.", + "Bugzilla cookies.", } %] diff --git a/template/en/default/admin/params/dependencygraph.html.tmpl b/template/en/default/admin/params/dependencygraph.html.tmpl index e8baf4572..64a334a20 100644 --- a/template/en/default/admin/params/dependencygraph.html.tmpl +++ b/template/en/default/admin/params/dependencygraph.html.tmpl @@ -6,8 +6,8 @@ # defined by the Mozilla Public License, v. 2.0. #%] [% - title = "Dependency Graphs" - desc = "Optional setup for dependency graphing" + title = "Graphs" + desc = "Optional setup to generate graphs" %] [% param_descs = { @@ -32,5 +32,15 @@ this value, make certain that the webdot server can read files from your webdot directory. On Apache you do this by editing the .htaccess file, for other systems the needed measures may vary. You can run <kbd>checksetup.pl</kbd> - to recreate the .htaccess file if it has been lost."} + to recreate the .htaccess file if it has been lost.", + + font_file => "You can specify the full path to a TrueType font file which will be used " _ + "to display text (labels, legends, ...) in charts and graphical reports. " _ + "To support as many languages as possible, we recommend to specify a TrueType " _ + "font such as <a href=\"http://unifoundry.com/unifont.html\">Unifont</a> " _ + "which supports all printable characters in the Basic Multilingual Plane. " _ + "If you leave this parameter empty, a default font will be used, but " _ + "its support is limited to English characters only and so other characters " _ + "will be displayed incorrectly.", + } %] diff --git a/template/en/default/admin/params/editparams.html.tmpl b/template/en/default/admin/params/editparams.html.tmpl index 3febbaba4..4e1946dd8 100644 --- a/template/en/default/admin/params/editparams.html.tmpl +++ b/template/en/default/admin/params/editparams.html.tmpl @@ -35,14 +35,13 @@ [% PROCESS global/header.html.tmpl title = title message = message - style_urls = ['skins/standard/params.css'] + style_urls = ['skins/standard/admin.css'] javascript_urls = ['js/params.js', 'js/util.js'] - doc_section = "parameters.html" + doc_section = "administering/parameters.html" %] -<table border="0" width="100%"> - <tr> - <td> +<div class="table"> + <div class="cell"> [%# NAVIGATION BAR %] <table id="menu"> <tr> @@ -66,38 +65,37 @@ </tr> [% END %] </table> - </td> - <td> - [% IF curpanel == -1 %] - [% PROCESS admin/params/index.html.tmpl panels = panels %] - [% ELSE %] + </div> - <div class="contribute"><strong>Note:</strong> - B[% %]ugzilla is developed entirely by volunteers. - The best way to give back to the B[% %]ugzilla project is to - <a href="http://www.bugzilla.org/contribute/">contribute</a> - yourself! - You don't have to be a programmer to contribute, there are lots of - things that we need. - </div> + <div class="cell"> + <div id="contribute"> + <strong>Note:</strong> + Bugzilla is developed entirely by volunteers. + The best way to give back to the Bugzilla project is to + <a href="http://www.bugzilla.org/contribute/">contribute</a> yourself! + You don't have to be a programmer to contribute, there are lots of + things that we need. + </div> + [% IF curpanel == -1 %] + [% PROCESS admin/params/index.html.tmpl panels = panels %] + [% ELSE %] <p> - This lets you edit the basic operating parameters of [% terms.Bugzilla %]. + This lets you edit the basic operating parameters of Bugzilla. Be careful!<br> Any item you check "Reset" on will get reset to its default value. </p> [%# CONTENT PANEL %] - <form method="post" action="editparams.cgi"> + <form id="edit_params" method="post" action="editparams.cgi"> [% PROCESS admin/params/common.html.tmpl panel = current_panel %] <input type="hidden" name="section" value="[% current_panel.name FILTER html %]"> <input type="hidden" name="action" value="save"> <input type="hidden" name="token" value="[% token FILTER html %]"> <input type="submit" id="save-params" value="Save Changes"> </form> - [% END %] - </td> - </tr> -</table> + [% END %] + </div> +</div> [% INCLUDE global/footer.html.tmpl %] diff --git a/template/en/default/admin/params/general.html.tmpl b/template/en/default/admin/params/general.html.tmpl index daa1f359e..6ebef8ea2 100644 --- a/template/en/default/admin/params/general.html.tmpl +++ b/template/en/default/admin/params/general.html.tmpl @@ -14,15 +14,7 @@ [% param_descs = { maintainer => "The email address of the person who maintains this installation " - _ " of ${terms.Bugzilla}.", - - docs_urlbase => - "The URL that is the common initial leading part of all" - _ " $terms.Bugzilla documentation URLs. It may be an absolute URL," - _ " or a URL relative to the <tt>urlbase</tt> parameter. Leave this" - _ " empty to suppress links to the documentation." - _ "'%lang%' will be replaced by user's preferred language (if" - _ " documentation is available in that language).", + _ " of Bugzilla.", utf8 => "Use UTF-8 (Unicode) encoding for all text in ${terms.Bugzilla}. New" @@ -36,24 +28,23 @@ _ " afterward.</p>", shutdownhtml => - "If this field is non-empty, then $terms.Bugzilla will be completely" + "If this field is non-empty, then Bugzilla will be completely" _ " disabled and this text will be displayed instead of all the" _ " $terms.Bugzilla pages.", announcehtml => - "If this field is non-empty, then $terms.Bugzilla will" + "If this field is non-empty, then Bugzilla will" _ " display whatever is in this field at the top of every" _ " HTML page. The HTML you put in this field is not wrapped or" _ " enclosed in anything. You might want to wrap it inside a" - _ "<tt><div></tt>. Give the div <em>id=\"message\"</em> to get" + _ "<code><div></code>. Give the div <em>id=\"message\"</em> to get" _ " green text inside a red box, or <em>class=\"bz_private\"</em> for" _ " dark red on a red background. Anything defined in " - _ " <tt>skins/standard/global.css</tt> or <tt>skins/custom/global.css</tt>" - _ " will work. To get centered text, use <em>style=\"text-align: " - _ " center;\"</em>.", + _ " <code>skins/standard/global.css</code> or <code>skins/custom/global.css</code>" + _ " will work. To get centered text, use <em>class=\"center\"</em>.", upgrade_notification => - "$terms.Bugzilla can inform you when a new release is available." + "Bugzilla can inform you when a new release is available." _ " The notification will appear on the $terms.Bugzilla homepage," _ " for administrators only." _ " <ul><li>'development_snapshot' notifies you about the development " @@ -67,7 +58,7 @@ _ " for newer release candidates too.</li>" _ " <li>'disabled' will never notify you about new releases and no" _ " connection will be established to a remote server.</li></ul>" - _ " <p>Note that if your $terms.Bugzilla server requires a proxy to" - _ " access the Internet, you may also need to set the <tt>proxy_url</tt>" + _ " <p>Note that if your Bugzilla server requires a proxy to" + _ " access the Internet, you may also need to set the <var>proxy_url</var>" _ " parameter in the Advanced section.</p>", } %] diff --git a/template/en/default/admin/params/groupsecurity.html.tmpl b/template/en/default/admin/params/groupsecurity.html.tmpl index 7e30f0723..590f4da02 100644 --- a/template/en/default/admin/params/groupsecurity.html.tmpl +++ b/template/en/default/admin/params/groupsecurity.html.tmpl @@ -11,7 +11,7 @@ %] [% param_descs = { - makeproductgroups => "If this is on, $terms.Bugzilla will associate $terms.abug group " _ + makeproductgroups => "If this is on, Bugzilla will associate $terms.abug group " _ "with each product in the database, and use it for querying ${terms.bugs}.", chartgroup => "The name of the group of users who can use the 'New Charts' " _ @@ -29,18 +29,28 @@ querysharegroup => "The name of the group of users who can share their " _ "saved searches with others.", + comment_taggers_group => "The name of the group of users who can tag comment." _ + " Setting this to empty disables comment tagging.", + debug_group => "The name of the group of users who can view the actual " _ "SQL query generated when viewing $terms.bug lists and reports.", usevisibilitygroups => "Do you wish to restrict visibility of users to members of " _ "specific groups?", - + strict_isolation => "Don't allow users to be assigned to, " _ "be qa-contacts on, " _ "be added to CC list, " _ "or make or remove dependencies " _ "involving any bug that is in a product on which that " _ - "user is forbidden to edit.", - + "user is forbidden to edit.", + + or_groups => "Define the visibility of $terms.abug which is in multiple " _ + "groups. If this is on (recommended), a user only needs to " _ + "be a member of one of the $terms.bug's groups in order to " _ + "view it. If it is off, a user needs to be a member of all " _ + "the $terms.bug's groups. Note that in either case, if the " _ + "user has a role on the $terms.bug (e.g. reporter) that may " _ + "also affect their permissions." } %] diff --git a/template/en/default/admin/params/index.html.tmpl b/template/en/default/admin/params/index.html.tmpl index 65aa398eb..ee64eca9f 100644 --- a/template/en/default/admin/params/index.html.tmpl +++ b/template/en/default/admin/params/index.html.tmpl @@ -6,33 +6,23 @@ # defined by the Mozilla Public License, v. 2.0. #%] -<p> - All parameters are displayed below, per section. - If you cannot find one from here, then the parameter does not exist. -</p> +<div id="params_index"> + <p> + All parameters are displayed below, per section. + If you cannot find one from here, then the parameter does not exist. + </p> -<div align="center"> - <table> - <tr> - <th>Parameter</th> - <th>Section</th> - </tr> - [% FOREACH panel = panels %] + [% FOREACH panel = panels %] + <h3>[% panel.title FILTER html %]</h3> + + <ul> [% FOREACH param = panel.param_list.sort('name') %] - <tr> - <td> - <a href="editparams.cgi?section= - [%- panel.name FILTER uri %]#[% param.name FILTER uri %]_desc"> - [% param.name FILTER html %]</a> - </td> - <td> - [% panel.title FILTER html %] - </td> - </tr> + <li> + <a href="editparams.cgi?section= + [%- panel.name FILTER uri %]#[% param.name FILTER uri %]_desc"> + [% param.name FILTER html %]</a> + </li> [% END %] - <tr> - <td> </td><td> </td> - </tr> - [% END %] - </table> + </ul> + [% END %] </div> diff --git a/template/en/default/admin/params/ldap.html.tmpl b/template/en/default/admin/params/ldap.html.tmpl index 64b3dbd52..ab3521f27 100644 --- a/template/en/default/admin/params/ldap.html.tmpl +++ b/template/en/default/admin/params/ldap.html.tmpl @@ -35,11 +35,11 @@ LDAPmailattribute => "The name of the attribute of a user in your " _ "directory that contains the email address, to be " _ - "used as $terms.Bugzilla username. If this parameter " _ - "is empty, $terms.Bugzilla will use the LDAP username"_ - " as the $terms.Bugzilla username. You may also want" _ + "used as Bugzilla username. If this parameter " _ + "is empty, Bugzilla will use the LDAP username"_ + " as the Bugzilla username. You may also want" _ " to set the \"emailsuffix\" parameter, in this case.", - LDAPfilter => "LDAP filter to AND with the <tt>LDAPuidattribute</tt> for " _ + LDAPfilter => "LDAP filter to AND with the <var>LDAPuidattribute</var> for " _ "filtering the list of valid users." } %] diff --git a/template/en/default/admin/params/memcached.html.tmpl b/template/en/default/admin/params/memcached.html.tmpl new file mode 100644 index 000000000..50ec435fb --- /dev/null +++ b/template/en/default/admin/params/memcached.html.tmpl @@ -0,0 +1,22 @@ +[%# 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. + #%] +[% + title = "Memcached" + desc = "Set up Memcached integration" +%] + +[% param_descs = { + memcached_servers => + "If this option is set, Bugzilla will integrate with Memcached. " _ + "Specify one or more servers, separated by spaces, using hostname:port " _ + "notation (for example: 127.0.0.1:11211).", + + memcached_namespace => + "Specify a string to prefix to each key on Memcached.", + } +%] diff --git a/template/en/default/admin/params/mta.html.tmpl b/template/en/default/admin/params/mta.html.tmpl index f491a3035..bd93a3ee9 100644 --- a/template/en/default/admin/params/mta.html.tmpl +++ b/template/en/default/admin/params/mta.html.tmpl @@ -14,7 +14,12 @@ mail_delivery_method => "Defines how email is sent, or if it is sent at all.<br> <ul> <li> - 'Sendmail', 'SMTP' and 'Qmail' are all MTAs. + 'SMTP' means use the SMTP protocol to talk to a remote + mail server. + </li> + <li> + 'Sendmail' means use the sendmail-compatible MTA + installed on the Bugzilla machine. You need to install a third-party sendmail replacement if you want to use sendmail on Windows. </li> @@ -23,7 +28,7 @@ in 'data/mailer.testfile' instead of being sent. </li> <li> - 'none' will completely disable email. $terms.Bugzilla continues + 'None' will completely disable email. Bugzilla continues to act as though it is sending mail, but nothing is sent or stored. </li> @@ -32,17 +37,18 @@ mailfrom => "The email address of the $terms.Bugzilla mail daemon. Some email systems " _ "require this to be a valid email address.", - use_mailer_queue => "In a large $terms.Bugzilla installation, updating" - _ " $terms.bugs can be very slow, because $terms.Bugzilla sends all" - _ " email at once. If you enable this parameter, $terms.Bugzilla will" + use_mailer_queue => "In a large Bugzilla installation, updating" + _ " $terms.bugs can be very slow, because Bugzilla sends all" + _ " email at once. If you enable this parameter, Bugzilla will" _ " queue all mail and then send it in the background. This requires" _ " that you have installed certain Perl modules (as listed by" _ " <kbd>checksetup.pl</kbd> for this feature), and that you are" _ " running the <code>jobqueue.pl</code> daemon (otherwise your mail" - _ " won't get sent). This affects all mail sent by $terms.Bugzilla," + _ " won't get sent). This affects all mail sent by Bugzilla," _ " not just $terms.bug updates.", - smtpserver => "The SMTP server address (if using SMTP for mail delivery).", + smtpserver => "The SMTP server address with optional port number (if using SMTP" _ + " for mail delivery). eg: example.com or example.com:1234", smtp_username => "The username to pass to the SMTP server for SMTP authentication. " _ "Leave this field empty if your SMTP server doesn't require authentication.", @@ -54,7 +60,7 @@ smtp_debug => "If enabled, this will print detailed information to your" _ " web server's error log about the communication between" _ - " $terms.Bugzilla and your SMTP server. You can use this to" _ + " Bugzilla and your SMTP server. You can use this to" _ " troubleshoot email problems.", whinedays => "The number of days that we'll let a $terms.bug sit untouched in a CONFIRMED " _ diff --git a/template/en/default/admin/params/patchviewer.html.tmpl b/template/en/default/admin/params/patchviewer.html.tmpl deleted file mode 100644 index 61d32a07b..000000000 --- a/template/en/default/admin/params/patchviewer.html.tmpl +++ /dev/null @@ -1,51 +0,0 @@ -[%# 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. - #%] -[% - title = "Patch Viewer" - desc = "Set up third-party applications to run with PatchViewer" -%] - -[% param_descs = { - cvsroot => "The <a href=\"http://www.cvshome.org\">CVS</a> root that most " _ - "users of your system will be using for 'cvs diff'. Used in " _ - "Patch Viewer ('Diff' option on patches) to figure out where " _ - "patches are rooted even if users did the 'cvs diff' from " _ - "different places in the directory structure. (NOTE: if your " _ - "CVS repository is remote and requires a password, you must " _ - "either ensure the $terms.Bugzilla user has done a 'cvs login' or " _ - "specify the password " _ - "<a href=\"http://www.cvshome.org/docs/manual/cvs_2.html#SEC26\">as " _ - "part of the CVS root</a>.) Leave this blank if you have no " _ - "CVS repository.", - - cvsroot_get => "The CVS root $terms.Bugzilla will be using to get patches from. " _ - "Some installations may want to mirror their CVS repository on " _ - "the $terms.Bugzilla server or even have it on that same server, and " _ - "thus the repository can be the local file system (and much " _ - "faster). Make this the same as cvsroot if you don't " _ - "understand what this is (if cvsroot is blank, make this blank too).", - - bonsai_url => "The URL to a <a href=\"http://www.mozilla.org/bonsai.html\">Bonsai</a> " _ - "server containing information about your CVS repository. " _ - "Patch Viewer will use this information to create links to " _ - "bonsai's blame for each section of a patch (it will append " _ - "'/cvsblame.cgi?...' to this url). Leave this blank if you " _ - "don't understand what this is.", - - lxr_url => "The URL to an <a href=\"http://sourceforge.net/projects/lxr\">LXR</a> server " _ - "that indexes your CVS repository. Patch Viewer will use this " _ - "information to create links to LXR for each file in a patch. " _ - "Leave this blank if you don't understand what this is.", - - lxr_root => "Some LXR installations do not index the CVS repository from the root -- " _ - "<a href=\"http://lxr.mozilla.org/mozilla\">Mozilla's</a>, for " _ - "example, starts indexing under <code>mozilla/</code>. This " _ - "means URLs are relative to that extra path under the root. " _ - "Enter this if you have a similar situation. Leave it blank " _ - "if you don't know what this is." } -%] diff --git a/template/en/default/admin/params/query.html.tmpl b/template/en/default/admin/params/query.html.tmpl index 52a960b44..d8a510282 100644 --- a/template/en/default/admin/params/query.html.tmpl +++ b/template/en/default/admin/params/query.html.tmpl @@ -26,29 +26,24 @@ </li> </ul>", - mostfreqthreshold => "The minimum number of duplicates $terms.abug needs to show up on the " _ - "<a href=\"duplicates.cgi\">most frequently reported $terms.bugs page</a>. " _ - "If you have a large database and this page takes a long time to " _ - "load, try increasing this number.", - mybugstemplate => "This is the URL to use to bring up a simple 'all of my $terms.bugs' " _ - "list for a user. %userid% will get replaced with the login name of a user.", + "list for a user. %userid% will get replaced with the login name of a user. " _ + "Special characters must be URL-encoded.", defaultquery => "This is the default query that initially comes up when you " _ - "access the advanced query page. It's in URL parameter " _ - "format, which makes it hard to read. Sorry!", + "access the advanced query page. It's in URL parameter format.", search_allow_no_criteria => "Unless the code explicitly allows all $terms.bugs to be returned, this " _ "parameter permits to block the execution of queries with no criteria. " _ "When turned off, a query must have some criteria specified to limit " _ "the number of $terms.bugs returned to the user. When turned on, a user " _ - "is allowed to run a query with no criteria and get all $terms.bugs he can " _ - "see in his list. Turning this parameter on is not recommended on large " _ + "is allowed to run a query with no criteria and get all $terms.bugs they can " _ + "see in their list. Turning this parameter on is not recommended on large " _ "installations.", default_search_limit => - "By default, $terms.Bugzilla limits searches done in the web" + "By default, Bugzilla limits searches done in the web" _ " interface to returning only this many results, for performance" _ " reasons. (This only affects the HTML format of search results--CSV," _ " XML, and other formats are exempted.) Users can click a link on the" diff --git a/template/en/default/admin/params/shadowdb.html.tmpl b/template/en/default/admin/params/shadowdb.html.tmpl index 9f9f31491..2d5fced3b 100644 --- a/template/en/default/admin/params/shadowdb.html.tmpl +++ b/template/en/default/admin/params/shadowdb.html.tmpl @@ -14,7 +14,7 @@ shadowdbhost => "The host the shadow database is on.", shadowdbport => "The port the shadow database is on. Ignored if " _ - "<tt>shadowdbhost</tt> is blank. Note: if the host is the local " _ + "<var>shadowdbhost</var> is blank. Note: if the host is the local " _ "machine, then MySQL will ignore this setting, and you must " _ "specify a socket below.", @@ -23,14 +23,14 @@ "ignores the port specified by the client and connects using " _ "its compiled-in socket path (on unix machines) when connecting " _ "from a client to a local server. If you leave this blank, and " _ - "have the database on localhost, then the <tt>shadowdbport</tt> " _ + "have the database on localhost, then the <var>shadowdbport</var> " _ "will be ignored.", shadowdb => "If non-empty, then this is the name of another database in " _ - "which $terms.Bugzilla will use as a read-only copy of everything. " _ + "which Bugzilla will use as a read-only copy of everything. " _ "This is done so that long slow read-only operations can be used " _ "against this db, and not lock up things for everyone else. This " _ - "database is on the <tt>shadowdbhost</tt>, and must exist. " _ - "$terms.Bugzilla does not update it, if you use this parameter, then " _ + "database is on the <var>shadowdbhost</var>, and must exist. " _ + "Bugzilla does not update it, if you use this parameter, then " _ "you need to set up replication for your database." } %] diff --git a/template/en/default/admin/params/usermatch.html.tmpl b/template/en/default/admin/params/usermatch.html.tmpl index ebbc363b3..ad13f3864 100644 --- a/template/en/default/admin/params/usermatch.html.tmpl +++ b/template/en/default/admin/params/usermatch.html.tmpl @@ -11,7 +11,7 @@ %] [% param_descs = { - usemenuforusers => "If this option is set, $terms.Bugzilla will offer you a list " _ + usemenuforusers => "If this option is set, Bugzilla will offer you a list " _ "to select from (instead of a text entry field) where a user " _ "needs to be selected. This option should not be enabled on " _ "sites where there are a large number of users.", diff --git a/template/en/default/admin/products/confirm-delete.html.tmpl b/template/en/default/admin/products/confirm-delete.html.tmpl index eb1094fce..2e02068a4 100644 --- a/template/en/default/admin/products/confirm-delete.html.tmpl +++ b/template/en/default/admin/products/confirm-delete.html.tmpl @@ -24,53 +24,45 @@ style_urls = ['skins/standard/admin.css'] %] -<table border="1" cellpadding="4" cellspacing="0"> - <tr bgcolor="#6666FF"> - <th valign="top" align="left">Field</th> - <th valign="top" align="left">Value</th> +<table id="admin_table"> + <tr class="column_header"> + <th>Field</th> + <th>Value</th> </tr> [% IF Param('useclassification') %] <tr> - <td>Classification:</td> + <td>Classification</td> <td>[% classification.name FILTER html %]</td> </tr> <tr> - <td>Classification Description:</td> - [%# descriptions are intentionally not filtered to allow html content %] + <td>Classification Description</td> <td> [% IF classification.description %] [% classification.description FILTER html_light %] [% ELSE %] - <span style="color: red">missing</span> + <span class="warning">missing</span> [% END %] </td> </tr> [% END %] <tr> - <td valign="top">Product:</td> - <td valign="top"> + <td>Product</td> + <td> <a href="editproducts.cgi?product=[% product.name FILTER uri %]"> [% product.name FILTER html %] </a> </td> </tr> <tr> - <td valign="top">Description:</td> - [%# descriptions are intentionally not filtered to allow html content %] - <td valign="top"> - [% IF product.description %] - [% product.description FILTER html_light %] - [% ELSE %] - <span style="color: red">missing</span> - [% END %] - </td> + <td>Description</td> + <td>[% product.description FILTER html_light %]</td> </tr> [% IF Param('usetargetmilestone') %] <tr> - <td>Milestone URL:</td> + <td>Milestone URL</td> <td> [% IF product.milestone_url %] <a href="[% product.milestone_url FILTER html %]"> @@ -84,7 +76,7 @@ [% END %] <tr> - <td>Closed for [% terms.bugs %]:</td> + <td>Closed for [% terms.bugs %]</td> <td> [% IF product.is_active %] open @@ -99,26 +91,19 @@ [% IF product.components.size > 0 %] <a href="editcomponents.cgi?product=[% product.name FILTER uri %]" title="Edit components for product '[% product.name FILTER html %]'"> - Components: + Components </a> [% ELSE %] - Components: + Components [% END %] </td> <td> [% IF product.components.size > 0 %] - <table> + <table class="no-border"> [% FOREACH c = product.components %] <tr> - <th align="right">[% c.name FILTER html %]:</th> - [%# descriptions are intentionally not filtered to allow html content %] - <td> - [% IF c.description %] - [% c.description FILTER html_light %] - [% ELSE %] - <span style="color: red">missing</span> - [% END %] - </td> + <th>[% c.name FILTER html %]:</th> + <td>[% c.description FILTER html_light %]</td> </tr> [% END %] </table> @@ -132,17 +117,19 @@ <td> [% IF product.versions.size > 0 %] <a href="editversions.cgi?product=[%- product.name FILTER uri %]"> - Versions: + Versions </a> [% ELSE %] - Versions: + Versions [% END %] </td> <td> [% IF product.versions.size > 0 %] - [% FOREACH v = product.versions %] - [% v.name FILTER html %]<br> - [% END %] + <div class="multi-columns"> + [% FOREACH v = product.versions %] + [% v.name FILTER html %]<br> + [% END %] + </div> [% ELSE %] none [% END %] @@ -152,20 +139,22 @@ [% IF Param('usetargetmilestone') %] <tr> - <td valign="top"> + <td> [% IF product.milestones.size > 0 %] <a href="editmilestones.cgi?product=[%- product.name FILTER uri %]"> - Milestones: + Milestones </a> [% ELSE %] - Milestones: + Milestones [% END %] </td> <td> [% IF product.milestones.size > 0 %] - [% FOREACH m = product.milestones %] - [% m.name FILTER html %]<br> - [% END %] + <div class="multi-columns"> + [% FOREACH m = product.milestones %] + [% m.name FILTER html %]<br> + [% END %] + </div> [% ELSE %] none [% END %] @@ -174,7 +163,7 @@ [% END %] <tr> - <td>[% terms.Bugs %]:</td> + <td>[% terms.Bugs %]</td> <td> [% IF product.bug_count %] <a href="buglist.cgi?product=[% product.name FILTER uri %]" @@ -194,41 +183,34 @@ [% IF !Param("allowbugdeletion") %] - <p class="confirmation">Sorry, there - - [% IF product.bug_count > 1 %] - are [% product.bug_count FILTER html %] [%+ terms.bugs %] - [% ELSE %] - is 1 [% terms.bug %] - [% END %] - - outstanding for this product. You must reassign - - [% IF product.bug_count > 1 %] - those [% terms.bugs %] - [% ELSE %] - that [% terms.bug %] - [% END %] - - to another product before you can delete this one.</p> + <p class="confirmation"> + Sorry, there + [% IF product.bug_count > 1 %] + are [% product.bug_count FILTER html %] [%+ terms.bugs %] + [% ELSE %] + is 1 [% terms.bug %] + [% END %] + outstanding for this product. You must reassign + [% IF product.bug_count > 1 %] + those [% terms.bugs %] + [% ELSE %] + that [% terms.bug %] + [% END %] + to another product before you can delete this one. + </p> [% ELSE %] - <table border="0" cellpadding="20" width="70%" bgcolor="red"> - <tr> - <td> - There - [% IF product.bug_count > 1 %] - are [% product.bug_count FILTER html %] [%+ terms.bugs %] - [% ELSE %] - is 1 [% terms.bug %] - [% END %] - entered for this product! When you delete this - product, <b>ALL</b> stored [% terms.bugs %] and - their history will be deleted, too. - </td> - </tr> - </table> + <p class="confirmation"> + There + [% IF product.bug_count > 1 %] + are [% product.bug_count FILTER html %] [%+ terms.bugs %] + [% ELSE %] + is 1 [% terms.bug %] + [% END %] + entered for this product! When you delete this product, <b>ALL</b> + stored [% terms.bugs %] and their history will be deleted, too. + </p> [% END %] diff --git a/template/en/default/admin/products/create.html.tmpl b/template/en/default/admin/products/create.html.tmpl index 6d4009586..0dcfd7283 100644 --- a/template/en/default/admin/products/create.html.tmpl +++ b/template/en/default/admin/products/create.html.tmpl @@ -17,6 +17,7 @@ [% PROCESS global/header.html.tmpl title = title + generate_api_token = 1 style_urls = ['skins/standard/admin.css'] javascript_urls = ['js/util.js', 'js/field.js'] yui = [ 'autocomplete' ] @@ -30,18 +31,18 @@ %] <form method="post" action="editproducts.cgi"> - <table border="0" cellpadding="4" cellspacing="0"> + <table id="admin_table_edit"> [% PROCESS "admin/products/edit-common.html.tmpl" %] <tr> - <th align="right">Version:</th> + <th>Version:</th> <td><input size="20" maxlength="64" name="version" - value="[% version FILTER html %]"> + value="[% version FILTER html %]" required> </td> </tr> <tr> - <th align="right">Create chart datasets for this product:</th> + <th>Create chart datasets for this product:</th> <td> <input type="checkbox" name="createseries" value="1" checked="checked"> </td> diff --git a/template/en/default/admin/products/edit-common.html.tmpl b/template/en/default/admin/products/edit-common.html.tmpl index 2b76c44ac..baf5015ae 100644 --- a/template/en/default/admin/products/edit-common.html.tmpl +++ b/template/en/default/admin/products/edit-common.html.tmpl @@ -14,32 +14,32 @@ [% IF Param('useclassification') %] <tr> - <th align="right">Classification:</th> + <th>Classification:</th> <td><b>[% classification.name FILTER html %]</b></td> </tr> [% END %] <tr> - <th align="right">Product:</th> + <th>Product:</th> <td><input size="64" maxlength="64" name="product" - value="[% product.name FILTER html %]"> + value="[% product.name FILTER html %]" required> </td> </tr> <tr> - <th align="right">Description:</th> - <td><textarea rows="4" cols="64" wrap="virtual" name="description"> + <th>Description:</th> + <td><textarea rows="4" cols="64" wrap="virtual" name="description" required> [% product.description FILTER html %]</textarea> </td> </tr> <tr> - <th align="right">Open for [% terms.bug %] entry:</th> + <th>Open for [% terms.bug %] entry:</th> <td><input type="checkbox" name="is_active" value="1" [% ' checked="checked"' IF product.is_active %]> </td> </tr> <tr> - <th align="right"> + <th> <label for="allows_unconfirmed">Enable the [%+ display_value('bug_status', 'UNCONFIRMED') FILTER html %] status in this product:</label> @@ -51,7 +51,7 @@ [% IF Param('usetargetmilestone') -%] <tr> - <th align="right">Default milestone:</th> + <th>Default milestone:</th> <td> [% IF product.milestones.size %] <select name="defaultmilestone"> diff --git a/template/en/default/admin/products/edit.html.tmpl b/template/en/default/admin/products/edit.html.tmpl index a4fcd188f..8e1f5d87b 100644 --- a/template/en/default/admin/products/edit.html.tmpl +++ b/template/en/default/admin/products/edit.html.tmpl @@ -30,12 +30,12 @@ %] <form method="post" action="editproducts.cgi"> - <table border="0" cellpadding="4" cellspacing="0"> + <table id="admin_table_edit"> [% PROCESS "admin/products/edit-common.html.tmpl" %] <tr> - <th align="right" valign="top"> + <th> <a href="editcomponents.cgi?product=[% product.name FILTER uri %]"> Edit components: </a> @@ -45,55 +45,52 @@ [% FOREACH comp = product.components %] <a href="editcomponents.cgi?action=edit&product= [%- product.name FILTER uri %]&component= - [%- comp.name FILTER uri %]">[% comp.name FILTER html %]</a>: - [% IF comp.description %] - [% comp.description FILTER html_light %] - [% ELSE %] - <font color="red">description missing</font> - [% END %] + [%- comp.name FILTER uri %]">[% comp.name FILTER html %]</a>: + [% comp.description FILTER html_light %] <br> [% END %] [% ELSE %] - <font color="red">missing</font> + <span class="warning">missing</span> [% END %] </td> </tr> <tr> - <th align="right" valign="top"> - <a href="editversions.cgi?product=[% product.name FILTER uri %]">Edit -versions:</a> + <th> + <a href="editversions.cgi?product=[% product.name FILTER uri %]">Edit versions:</a> </th> <td> [%- IF product.versions.size -%] - [% FOREACH v = product.versions %] - [% v.name FILTER html %] - <br> - [% END %] + <div class="multi-columns"> + [% FOREACH v = product.versions %] + [% v.name FILTER html %]<br> + [% END %] + </div> [% ELSE %] - <font color="red">missing</font> + <span class="warning">missing</span> [% END %] </td> </tr> [% IF Param('usetargetmilestone') %] <tr> - <th align="right" valign="top"> + <th> <a href="editmilestones.cgi?product=[% product.name FILTER uri %]"> Edit milestones:</a> </th> <td> [%- IF product.milestones.size -%] - [%- FOREACH m = product.milestones -%] - [% m.name FILTER html %] - <br> - [% END %] + <div class="multi-columns"> + [%- FOREACH m = product.milestones -%] + [% m.name FILTER html %]<br> + [% END %] + </div> [% ELSE %] - <font color="red">missing</font> + <span class="warning">missing</span> [% END %] </td> </tr> [% END %] <tr> - <th align="right" valign="top"> + <th> <a href="editproducts.cgi?action=editgroupcontrols&product= [%- product.name FILTER uri %]"> Edit Group Access Controls: @@ -102,7 +99,7 @@ versions:</a> <td> [% IF product.group_controls.size %] [% FOREACH g = product.group_controls.values.sort("name") %] - <b>[% g.group.name FILTER html %]:</b> + <b>[% g.group.name FILTER html %]:</b> [% IF g.group.isactive %] [% group_control.${g.membercontrol} FILTER html %]/ [% group_control.${g.othercontrol} FILTER html %] @@ -122,9 +119,11 @@ versions:</a> </td> </tr> <tr> - <th align="right">[% terms.Bugs %]:</th> - <td><a href="buglist.cgi?product=[% product.name FILTER uri %]"> - [% product.bug_count FILTER html %]</a></td> + <th>[% terms.Bugs %]:</th> + <td> + <a href="buglist.cgi?product=[% product.name FILTER uri %]"> + [% product.bug_count FILTER html %]</a> + </td> </tr> </table> diff --git a/template/en/default/admin/products/groupcontrol/confirm-edit.html.tmpl b/template/en/default/admin/products/groupcontrol/confirm-edit.html.tmpl index fc3ad9b82..354673c3d 100644 --- a/template/en/default/admin/products/groupcontrol/confirm-edit.html.tmpl +++ b/template/en/default/admin/products/groupcontrol/confirm-edit.html.tmpl @@ -11,32 +11,41 @@ [% END %] [% PROCESS global/header.html.tmpl title = title %] + [% FOREACH group = mandatory_groups %] -<P> -group '[% group.name FILTER html %]' impacts [% group.count %] -[%+ terms.bugs %] for -which the group is newly mandatory and will be added. + <p> + Group '[% group.name FILTER html %]' impacts + [% IF group.count == 1 %] + one [%+ terms.bug %] + [% ELSE %] + [% group.count %] [%+ terms.bugs %] + [% END %] + for which this group is mandatory and will be added. + </p> [% END %] [% FOREACH group = na_groups %] -<P> -group '[% group.name FILTER html %]' impacts [% group.count %] -[% terms.bugs %] for which the group is no longer applicable and will -be removed.[% END %] -<form action="editproducts.cgi" method="post" > + <p> + Group '[% group.name FILTER html %]' impacts + [% IF group.count == 1 %] + one [%+ terms.bug %] + [% ELSE %] + [% group.count %] [%+ terms.bugs %] + [% END %] + for which this group is no longer applicable and will be removed. + </p> +[% END %] +<form action="editproducts.cgi" method="post" > [% PROCESS "global/hidden-fields.html.tmpl" exclude="^Bugzilla_(login|password)$" %] - - <br> - Click "Continue" to proceed with the change including the changes - indicated above. If you do not want these changes, use "back" to - return to the previous page. <p> - <input type="hidden" name="confirmed" value="confirmed"> - <input type="submit" id="update" value="Continue"> + <br> + Click "Continue" to proceed with the change including the changes + indicated above. If you do not want these changes, use "back" to + return to the previous page. </p> - + <input type="hidden" name="confirmed" value="confirmed"> + <input type="submit" id="update" value="Continue"> </form> - [% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/admin/products/groupcontrol/edit.html.tmpl b/template/en/default/admin/products/groupcontrol/edit.html.tmpl index 889647e7e..876d95f92 100644 --- a/template/en/default/admin/products/groupcontrol/edit.html.tmpl +++ b/template/en/default/admin/products/groupcontrol/edit.html.tmpl @@ -10,7 +10,8 @@ Edit Group Controls for [% product.name FILTER html %] [% END %] [% PROCESS global/header.html.tmpl - title = title + title = title + style_urls = ['skins/standard/admin.css'] %] [% display_headers = 1 %] @@ -23,8 +24,8 @@ <input type="hidden" name="product" value="[% product.name FILTER html %]"> <input type="hidden" name="token" value="[% token FILTER html %]"> - <table id="form" cellspacing="0" cellpadding="4" border="1"> - <tr bgcolor="#6666ff"> + <table id="admin_table"> + <tr class="column_header"> <th>Group</th> <th>Entry</th> <th>MemberControl</th> @@ -37,9 +38,9 @@ </tr> [% END %] [% IF !group.group.isactive %] - <tr bgcolor="#bbbbbb"> + <tr class="disabled"> <td>[% group.group.name FILTER html %]</td> - <td align="center" colspan="7">Disabled</td> + <td class="center" colspan="7">Disabled</td> <td>[% group.bug_count FILTER html %]</td> </tr> [% ELSE %] @@ -129,15 +130,17 @@ product. </p> <p> If any group has <b>Entry</b> selected, then this product will -restrict [% terms.bug %] entry to only those users who are members of all the -groups with entry selected. +restrict [% terms.bug %] entry to only those users who are members of +[%+ IF Param('or_groups') %]at least one of[% ELSE %]all[% END %] the groups +with entry selected. </p> <p> If any group has <b>Canedit</b> selected, then this product -will be read-only for any users who are not members of all of -the groups with Canedit selected. ONLY users who are members of -all the canedit groups will be able to edit. This is an additional -restriction that further restricts what can be edited by a user. +will be read-only for any users who are not members of +[%+ IF Param('or_groups') %]one[% ELSE %]all[% END %] of the groups with +Canedit selected. ONLY users who are members of +[%+ IF Param('or_groups') %]at least one of[% ELSE %]all[% END %] the canedit groups +will be able to edit. This is an additional restriction that further restricts what can be edited by a user. </p> <p> The following settings control let you choose privileges on a <b>per-product basis</b>. @@ -164,7 +167,7 @@ indicate which [% terms.bugs %] will be placed in this group according to the following definitions. </p> -<table border=1> +<table id="group_settings_desc"> <tr> <th> MemberControl diff --git a/template/en/default/admin/products/groupcontrol/updated.html.tmpl b/template/en/default/admin/products/groupcontrol/updated.html.tmpl index 5ee066c86..1294754fb 100644 --- a/template/en/default/admin/products/groupcontrol/updated.html.tmpl +++ b/template/en/default/admin/products/groupcontrol/updated.html.tmpl @@ -18,24 +18,36 @@ [% PROCESS global/header.html.tmpl title = title %] -<p> + [% IF changes._group_controls.now_na.size %] [% FOREACH g = changes._group_controls.now_na %] - Removing [% terms.bugs %] from group '[% g.name FILTER html %]' which - no longer applies to this product<p> - [% g.bug_count FILTER html %] [%+ terms.bugs %] removed<p> + <p> + Removing [% terms.bugs %] from group '[% g.name FILTER html %]' which is + no longer applicable to this product.<br> + [% IF g.bug_count == 1 %] + One [% terms.bug %] removed. + [% ELSE %] + [% g.bug_count FILTER html %] [%+ terms.bugs %] removed. + [% END %] + </p> [% END %] [% END %] [% IF changes._group_controls.now_mandatory.size %] [% FOREACH g = changes._group_controls.now_mandatory %] + <p> Adding [% terms.bugs %] to group '[% g.name FILTER html %]' which is - mandatory for this product<p> - [% g.bug_count FILTER html %] [%+ terms.bugs %] added<p> + now mandatory for this product.<br> + [% IF g.bug_count == 1 %] + One [% terms.bug %] added. + [% ELSE %] + [% g.bug_count FILTER html %] [%+ terms.bugs %] added. + [% END %] + </p> [% END %] [% END %] -Group control updates done<p> +<p>Group control updated.</p> [% PROCESS admin/products/footer.html.tmpl %] diff --git a/template/en/default/admin/products/list-classifications.html.tmpl b/template/en/default/admin/products/list-classifications.html.tmpl index ea32a0057..39f3ee1c1 100644 --- a/template/en/default/admin/products/list-classifications.html.tmpl +++ b/template/en/default/admin/products/list-classifications.html.tmpl @@ -16,6 +16,7 @@ [% PROCESS global/header.html.tmpl title = "Select Classification" + style_urls = ['skins/standard/admin.css'] %] [% columns = [ @@ -31,7 +32,7 @@ }, { name => "product_count" - align => "right" + class => "right" heading => "Product Count" } ] diff --git a/template/en/default/admin/products/list.html.tmpl b/template/en/default/admin/products/list.html.tmpl index a5126afc3..58edaa7bd 100644 --- a/template/en/default/admin/products/list.html.tmpl +++ b/template/en/default/admin/products/list.html.tmpl @@ -26,24 +26,31 @@ [% PROCESS global/header.html.tmpl title = "Select product $classification_title" + style_urls = ['skins/standard/admin.css'] %] [% columns = [ - { + { name => "name" heading => "Edit product..." contentlink => 'editproducts.cgi?action=edit&product=%%name%%' }, - { + { name => "description" heading => "Description" allow_html_content => 1 }, - { + { name => "is_active" heading => "Open For New $terms.Bugs" yesno_field => 1 }, + { + name => "allows_unconfirmed" + heading => "Allow " _ display_value('bug_status', 'UNCONFIRMED') _ + " " _ terms.Bugs + yesno_field => 1 + }, ] %] [% IF showbugcounts %] @@ -51,7 +58,7 @@ [% columns.push({ name => "bug_count" heading => "$terms.Bug Count" - align => 'right' + class => 'right' contentlink => 'buglist.cgi?product=%%name%%' }) %] diff --git a/template/en/default/admin/products/updated.html.tmpl b/template/en/default/admin/products/updated.html.tmpl index 4d2280163..cc0c9f8ea 100644 --- a/template/en/default/admin/products/updated.html.tmpl +++ b/template/en/default/admin/products/updated.html.tmpl @@ -39,7 +39,7 @@ <p> Updated description to: </p> - <p style="margin: 1em 3em 1em 3em">[% product.description FILTER html_light %]</p> + <p class="indented">[% product.description FILTER html_light %]</p> [% END %] [% IF changes.isactive.defined %] diff --git a/template/en/default/admin/sanitycheck/list.html.tmpl b/template/en/default/admin/sanitycheck/list.html.tmpl index 681466262..5da6b8735 100644 --- a/template/en/default/admin/sanitycheck/list.html.tmpl +++ b/template/en/default/admin/sanitycheck/list.html.tmpl @@ -11,7 +11,7 @@ <div> <p> - [% terms.Bugzilla %] is checking the referential integrity of your database. + Bugzilla is checking the referential integrity of your database. This may take several minutes to complete. </p> diff --git a/template/en/default/admin/settings/edit.html.tmpl b/template/en/default/admin/settings/edit.html.tmpl index 411c527a6..86fb79e7b 100644 --- a/template/en/default/admin/settings/edit.html.tmpl +++ b/template/en/default/admin/settings/edit.html.tmpl @@ -16,41 +16,38 @@ #%] [% PROCESS global/header.html.tmpl - title = "Default Preferences" - %] + title = "Default Preferences" + style_urls = ['skins/standard/admin.css'] +%] [% PROCESS "global/setting-descs.none.tmpl" %] <p> -This lets you edit the default preferences values. + This lets you edit the default preferences values. The Default Value displayed + for each preference will apply to all users who do not choose their own value, + and to anyone who is not logged in. </p> -<p> -The Default Value displayed for each preference will apply to all users who -do not choose their own value, and to anyone who is not logged in. -</p> -<p> -The 'Enabled' checkbox controls whether or not this preference is available -to users.<br> -If it is checked, users will see this preference on their User Preferences page, -and will be allowed to choose their own value if they desire.<br> -If it is not checked, this preference will not appear on the User Preference -page, and the Default Value will automatically apply to everyone. -</p> -<hr> -[% IF settings.size %] - <form name="adminsettingform" method="post" action="editsettings.cgi"> - <table border="1" cellpadding="4"> - <tr> - <th>Preference Text</th> - <th>Default Value</th> - <th>Enabled</th> - </tr> +<div> + The 'Enabled' checkbox controls whether or not this preference is available to users: + <ul> + <li>If it is checked, users will be allowed to choose their own value if they desire.</li> + <li>If it is not checked, the Default Value will automatically apply to everyone.</li> + </ul> +</div> + + <form id="settings" method="post" action="editsettings.cgi"> + <table id="admin_table"> + <tr class="column_header"> + <th>Preference Text</th> + <th>Default Value</th> + <th>Enabled</th> + </tr> - [% FOREACH name = settings.keys %] + [% FOREACH name = settings.keys %] [% checkbox_name = name _ '-enabled' %] <tr> - <td align="right"> + <td> [% setting_descs.$name OR name FILTER html %] </td> <td> @@ -63,31 +60,19 @@ page, and the Default Value will automatically apply to everyone. [% END %] </select> </td> - <td align="center"> + <td class="center"> <input type="checkbox" name="[% checkbox_name FILTER html %]" id="[% checkbox_name FILTER html %]" [% " checked=\"checked\"" IF settings.${name}.is_enabled %]> - <br> </td> </tr> - [% END %] + [% END %] </table> <input type="hidden" name="action" value="update"> <input type="hidden" name="token" value="[% token FILTER html %]"> - <table> - <tr> - <td width="150"></td> - <td> - <input type="submit" id="update" value="Submit Changes"> - </td> - </tr> - </table> - + <input type="submit" id="update" value="Submit Changes"> </form> -[% ELSE %] - There are no preferences to edit. -[% END %] [% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/admin/sudo.html.tmpl b/template/en/default/admin/sudo.html.tmpl index 4d072f114..8cdfb5204 100644 --- a/template/en/default/admin/sudo.html.tmpl +++ b/template/en/default/admin/sudo.html.tmpl @@ -8,14 +8,15 @@ [% PROCESS global/header.html.tmpl title = "Begin sudo session" + generate_api_token = 1 style_urls = ['skins/standard/admin.css'] - doc_section = "useradmin.html#impersonatingusers" + doc_section = "administering/users.html#impersonating-users" %] [% DEFAULT target_login = "" %] <p> - The <b>sudo</b> feature of [% terms.Bugzilla %] allows you to impersonate a + The <b>sudo</b> feature of Bugzilla allows you to impersonate a user for a short time While an sudo session is in progress, every action you perform will be taking place as if you had logged in as the user whom will be impersonating. @@ -41,6 +42,7 @@ value => target_login_default accesskey => "u" size => 30 + mandatory => 1 %] </p> @@ -68,7 +70,7 @@ Finally, enter <label for="Bugzilla_password">your [% terms.Bugzilla %] password</label>: <input type="hidden" name="Bugzilla_login" value="[% user.login FILTER html %]"> - <input type="password" id="Bugzilla_password" name="Bugzilla_password" size="20"> + <input type="password" id="Bugzilla_password" name="Bugzilla_password" size="20" required> <input type="hidden" name="Bugzilla_login_token" value="[% login_request_token FILTER html %]"> <br> diff --git a/template/en/default/admin/table.html.tmpl b/template/en/default/admin/table.html.tmpl index 80f6417a3..993181c7f 100644 --- a/template/en/default/admin/table.html.tmpl +++ b/template/en/default/admin/table.html.tmpl @@ -25,8 +25,6 @@ # field_descs hash will be used instead of "content." # See fieldvalues/select-field for an example of use. # This content WILL be HTML-filtered in this case. - # align: left/center/right. Controls the horizontal alignment of the - # text in the column. # allow_html_content: if defined, then this column allows some html content # and so it will be only partially filtered. # yesno_field: Turn the data from 0/!0 into Yes/No @@ -67,11 +65,11 @@ [%################### TABLE HEADER ######################%] -<table id="admin_table" border="1" cellpadding="4" cellspacing="0"> - <tr bgcolor="#6666FF"> +<table id="admin_table"> + <tr class="column_header"> [% FOREACH c = columns %] [%# Default to align left for headers %] - <th align="[% (c.align || 'left') FILTER html %]"> + <th class="[% (c.align || 'left') FILTER css_class_quote %]"> [% c.heading FILTER html %] </th> [% END %] @@ -89,7 +87,6 @@ [% contentlink = c.contentlink content = c.content content_use_field = c.content_use_field - align = c.align class = c.class allow_html_content = c.allow_html_content yesno_field = c.yesno_field @@ -121,8 +118,7 @@ [% END %] [% END %] - <td [% IF align %] align="[% align FILTER html %]" [% END %] - [% IF class %] class="[% class FILTER html %]" [% END %]> + <td [% IF class %] class="[% class FILTER html %]"[% END %]> [% IF contentlink %] [% FOREACH m = contentlink.match('%%(.+?)%%', 1) %] @@ -155,7 +151,7 @@ [% END %] [% IF data.size == 0 %] - <tr><td colspan="[% columns.size %]" align="center"><i><none></i></td></tr> + <tr><td colspan="[% columns.size %]" class="center"><i><none></i></td></tr> [% END %] diff --git a/template/en/default/admin/users/confirm-delete.html.tmpl b/template/en/default/admin/users/confirm-delete.html.tmpl index 73a72d08d..4dab8b471 100644 --- a/template/en/default/admin/users/confirm-delete.html.tmpl +++ b/template/en/default/admin/users/confirm-delete.html.tmpl @@ -38,16 +38,19 @@ [% PROCESS global/header.html.tmpl title = title - style_urls = ['skins/standard/admin.css', - 'skins/standard/editusers.css'] - doc_section = "useradmin.html#user-account-deletion" + style_urls = ['skins/standard/admin.css'] + doc_section = "administering/users.html#deleting-users" %] [% PROCESS admin/users/listselectvars.html.tmpl listselectionvalues = listselectionvalues %] -<table class="main"> +<table id="admin_table"> + <tr class="column_header"> + <th>Field</th> + <th>Value</th> + </tr> <tr> <th>Login name:</th> <td>[% otheruser.login FILTER html %]</td> @@ -426,7 +429,7 @@ The user has performed audited administrative tasks that are logged in the database. If you delete this user account, the audit log entries - will no longer be indentifiable. + will no longer be identifiable. </li> [% END %] [% Hook.process('warn_safe') %] @@ -441,9 +444,9 @@ <form method="post" action="editusers.cgi"> <p> - <input type="submit" id="delete" value="Yes, delete"/> - <input type="hidden" name="action" value="delete" /> - <input type="hidden" name="userid" value="[% otheruser.id %]" /> + <input type="submit" id="delete" value="Yes, delete"> + <input type="hidden" name="action" value="delete"> + <input type="hidden" name="userid" value="[% otheruser.id %]"> <input type="hidden" name="token" value="[% token FILTER html %]"> [% INCLUDE listselectionhiddenfields %] </p> diff --git a/template/en/default/admin/users/create.html.tmpl b/template/en/default/admin/users/create.html.tmpl index 354ba5f2d..6fbd1dc2f 100644 --- a/template/en/default/admin/users/create.html.tmpl +++ b/template/en/default/admin/users/create.html.tmpl @@ -14,29 +14,28 @@ [% PROCESS global/header.html.tmpl title = "Add user" - style_urls = ['skins/standard/editusers.css'] - onload = "document.forms['f'].login.focus()" - doc_section = "useradmin.html#createnewusers" + style_urls = ['skins/standard/admin.css'] + doc_section = "administering/users.html#creating-new-users" %] [% PROCESS admin/users/listselectvars.html.tmpl listselectionvalues = listselectionvalues %] -<form name="f" method="post" action="editusers.cgi"> -<table class="main"> - [% PROCESS admin/users/userdata.html.tmpl - editform = 0 - editusers = editusers - otheruser = [] - %] -</table> -<p> - <input type="submit" id="add" value="Add"/> - <input type="hidden" name="action" value="new" /> - <input type="hidden" name="token" value="[% token FILTER html %]"> - [% INCLUDE listselectionhiddenfields %] -</p> +<form method="post" action="editusers.cgi"> + <table id="admin_table_edit"> + [% PROCESS admin/users/userdata.html.tmpl + editform = 0 + editusers = editusers + otheruser = [] + %] + </table> + <p> + <input type="submit" id="add" value="Add"> + <input type="hidden" name="action" value="new"> + <input type="hidden" name="token" value="[% token FILTER html %]"> + [% INCLUDE listselectionhiddenfields %] + </p> </form> <p> diff --git a/template/en/default/admin/users/edit.html.tmpl b/template/en/default/admin/users/edit.html.tmpl index 6672b92cc..144ab0bae 100644 --- a/template/en/default/admin/users/edit.html.tmpl +++ b/template/en/default/admin/users/edit.html.tmpl @@ -22,8 +22,8 @@ [% PROCESS global/header.html.tmpl title = title message = message - style_urls = ['skins/standard/admin.css', 'skins/standard/editusers.css'] - doc_section = "useradmin.html#modifyusers" + style_urls = ['skins/standard/admin.css'] + doc_section = "administering/users.html#modifying-users" javascript_urls = [ 'js/field.js' ] %] @@ -32,7 +32,7 @@ %] <form method="post" action="editusers.cgi"> -<table class="main"> +<table id="admin_table_edit"> [% PROCESS admin/users/userdata.html.tmpl editform = 1 editusers = editusers @@ -42,7 +42,7 @@ <tr> <th>Group access:</th> <td> - <table class="groups"> + <table id="group_membership"> <tr> [% IF editusers %] <th colspan="3"> @@ -52,7 +52,7 @@ </tr> <tr> [% IF editusers %] - <td style="text-align: center; font-weight: bold">|</td> + <th class="checkbox">|</th> [% END %] <th colspan="2">User is a member of these groups</th> </tr> @@ -65,7 +65,7 @@ [% %]<input type="checkbox" name="bless_[% group.id %]" value="1" - [% ' checked="checked"' IF perms.directbless %] /> + [% ' checked="checked"' IF perms.directbless %]> [% ']' IF perms.indirectbless %]</td> [% END %] <td class="checkbox"> @@ -75,7 +75,7 @@ id="group_[% group.id %]" name="group_[% group.id %]" value="1" - [% ' checked="checked"' IF perms.directmember %] /> + [% ' checked="checked"' IF perms.directmember %]> [% '*' IF perms.regexpmember %] [% ']' IF perms.derivedmember %]</td> <td class="groupname"> @@ -115,9 +115,9 @@ </table> <p> - <input type="submit" id="update" value="Save Changes" /> - <input type="hidden" name="userid" value="[% otheruser.id %]" /> - <input type="hidden" name="action" value="update" /> + <input type="submit" id="update" value="Save Changes"> + <input type="hidden" name="userid" value="[% otheruser.id %]"> + <input type="hidden" name="action" value="update"> <input type="hidden" name="token" value="[% token FILTER html %]"> [% INCLUDE listselectionhiddenfields %] @@ -130,7 +130,7 @@ </p> </form> <p> - User is a member of any groups shown with a check or grey bar. + User is a member of all groups shown with a check or grey bar. A grey bar indicates indirect membership, either derived from other groups (marked with square brackets) or via regular expression (marked with '*'). @@ -146,9 +146,9 @@ [% IF Param('allowuserdeletion') && editusers %] <form method="post" action="editusers.cgi"> <p> - <input type="submit" id="delete" value="Delete User" /> - <input type="hidden" name="action" value="del" /> - <input type="hidden" name="userid" value="[% otheruser.id %]" /> + <input type="submit" id="delete" value="Delete User"> + <input type="hidden" name="action" value="del"> + <input type="hidden" name="userid" value="[% otheruser.id %]"> [% INCLUDE listselectionhiddenfields %] </p> </form> diff --git a/template/en/default/admin/users/list.html.tmpl b/template/en/default/admin/users/list.html.tmpl index f66735386..36d8ad137 100644 --- a/template/en/default/admin/users/list.html.tmpl +++ b/template/en/default/admin/users/list.html.tmpl @@ -16,8 +16,8 @@ [% PROCESS global/header.html.tmpl title = "Select user" - style_urls = ['skins/standard/editusers.css'] - doc_section = "useradmin.html" + style_urls = ['skins/standard/admin.css'] + doc_section = "administering/users.html" %] [% PROCESS admin/users/listselectvars.html.tmpl @@ -69,11 +69,11 @@ [% FOREACH thisuser = users %] [% IF !thisuser.realname %] [%# We cannot pass one class now and one class later. %] - [% SET classes = (thisuser.is_enabled ? "missing" : "bz_inactive missing") %] + [% SET classes = (thisuser.is_enabled ? "warning" : "bz_inactive warning") %] [% overrides.realname.login_name.${thisuser.login_name} = { content => "missing" override_content => 1 - class => "$classes" + class => classes override_class => 1 } %] diff --git a/template/en/default/admin/users/listselectvars.html.tmpl b/template/en/default/admin/users/listselectvars.html.tmpl index bd03113d5..d738b254c 100644 --- a/template/en/default/admin/users/listselectvars.html.tmpl +++ b/template/en/default/admin/users/listselectvars.html.tmpl @@ -21,6 +21,6 @@ [% BLOCK listselectionhiddenfields %] [% FOREACH field = listselectionvalues.keys %] <input type="hidden" name="[% field FILTER html %]" - value="[% listselectionvalues.$field FILTER html %]" /> + value="[% listselectionvalues.$field FILTER html %]"> [% END %] [% END %] diff --git a/template/en/default/admin/users/responsibilities.html.tmpl b/template/en/default/admin/users/responsibilities.html.tmpl index 67ea7d294..defe47173 100644 --- a/template/en/default/admin/users/responsibilities.html.tmpl +++ b/template/en/default/admin/users/responsibilities.html.tmpl @@ -7,7 +7,7 @@ #%] [% hidden_products = 0 %] -<table id="user_responsibilities" border="0"> +<table id="user_responsibilities"> [% FOREACH item = otheruser.product_responsibilities %] [% IF !user.can_see_product(item.product.name) %] [% hidden_products = 1 %] @@ -15,7 +15,7 @@ [% END %] <tbody> <tr> - <th colspan="3" class="product">Product: [% item.product.name FILTER html %]</th> + <th colspan="4" class="product">Product: [% item.product.name FILTER html %]</th> </tr> <tr> <th>Component</th> diff --git a/template/en/default/admin/users/search.html.tmpl b/template/en/default/admin/users/search.html.tmpl index c66af4c5c..17477a012 100644 --- a/template/en/default/admin/users/search.html.tmpl +++ b/template/en/default/admin/users/search.html.tmpl @@ -17,9 +17,8 @@ [% PROCESS global/header.html.tmpl title = "Search users" - style_urls = ['skins/standard/editusers.css'] - onload = "document.forms['f'].matchstr.focus()" - doc_section = "useradmin.html#user-account-search" + style_urls = ['skins/standard/admin.css'] + doc_section = "administering/users.html" %] [% PROCESS admin/users/listselectvars.html.tmpl @@ -27,7 +26,7 @@ %] <form name="f" method="get" action="editusers.cgi"> -<input type="hidden" name="action" value="list" /> +<input type="hidden" name="action" value="list"> <p><label for="matchvalue">List users with</label> <select id="matchvalue" name="matchvalue"> <option value="login_name">login name</option> @@ -35,17 +34,18 @@ <option value="userid">user id</option> </select> <label for="matchstr">matching</label> -<input size="32" name="matchstr" id="matchstr" /> +<input size="32" name="matchstr" id="matchstr" autofocus> <select name="matchtype"> <option value="substr" selected="selected">case-insensitive substring</option> <option value="regexp">case-insensitive regexp</option> <option value="notregexp">not (case-insensitive regexp)</option> <option value="exact">exact (find this user)</option> </select> -<input type="submit" id="search" value="Search" /></p> +<input type="submit" id="search" value="Search"> +</p> [% IF restrictablegroups.size %] - <p><input type="checkbox" name="grouprestrict" value="1" id="grouprestrict" /> + <p><input type="checkbox" name="grouprestrict" value="1" id="grouprestrict"> <label for="grouprestrict">Restrict to users belonging to group</label> <select name="groupid" onchange="document.forms['f'].grouprestrict.checked=true"> @@ -56,9 +56,13 @@ [% END %] <p> - <input type="checkbox" name="enabled_only" value="1" id="enabled_only" - checked="checked"> - <label for="enabled_only">Enabled user accounts only</label> + Restrict search to + <select name="is_enabled"> + <option value="2">All</option> + <option value="1" selected>Enabled</option> + <option value="0">Disabled</option> + </select> + users. </p> [% Hook.process('end') %] diff --git a/template/en/default/admin/users/userdata.html.tmpl b/template/en/default/admin/users/userdata.html.tmpl index ae952d151..c08cd0018 100644 --- a/template/en/default/admin/users/userdata.html.tmpl +++ b/template/en/default/admin/users/userdata.html.tmpl @@ -21,11 +21,12 @@ <th><label for="login">Login name:</label></th> <td> [% IF editusers %] - <input size="64" maxlength="255" name="login" - id="login" value="[% otheruser.login FILTER html %]" /> + <input size="64" maxlength="255" id="login" name="login" + value="[% otheruser.login FILTER html %]" + [%- " autofocus" UNLESS editform %] required> [% IF editform %] [% IF !otheruser.in_group('bz_sudo_protect') %] - <br /> + <br> <a href="relogin.cgi?action=prepare-sudo&target_login= [%- otheruser.login FILTER uri %]">Impersonate this user</a> [% END %] @@ -52,9 +53,8 @@ <th><label for="name">Real name:</label></th> <td> [% IF editusers %] - <input size="64" maxlength="255" name="name" - autocomplete="off" - id="name" value="[% otheruser.name FILTER html %]" /> + <input size="64" maxlength="255" id="name" name="name" + autocomplete="off" value="[% otheruser.name FILTER html %]"> [% ELSE %] [% otheruser.name FILTER html %] [% END %] @@ -65,15 +65,22 @@ # if we ever have a login system that can create accounts through # createaccount.cgi but can't change passwords. #%] - + [% password_complexity = Param('password_complexity') %] [% IF editusers %] [% IF user.authorizer.can_change_password %] <tr> <th><label for="password">Password:</label></th> <td> <input type="password" size="16" name="password" id="password" - value="" autocomplete="off" /> - [% IF editform %]<br /> + value="" autocomplete="off" [% 'required' IF !editform %]> + [% IF password_complexity == "mixed_letters" %] + (Password must contain at least one UPPER and one lowercase letter.) + [% ELSIF password_complexity == "letters_numbers" %] + (Password must contain at least one UPPER and one lower case letter and a number.) + [% ELSIF password_complexity == "letters_numbers_specialchars" %] + (Password must contain at least one letter, a number and a special character.) + [% END %] + [% IF editform %]<br> (Enter new password to change.) [% END %] </td> @@ -107,3 +114,12 @@ </td> </tr> [% END %] +[% UNLESS editform %] + <tr> + <th><label for="notify_user">Notify User:</label></th> + <td> + <input type="checkbox" name="notify_user" id="notify_user" value="1"> + (Email this user their account information. The password will not be included.) + </td> + </tr> +[% END %] diff --git a/template/en/default/admin/versions/confirm-delete.html.tmpl b/template/en/default/admin/versions/confirm-delete.html.tmpl index e6f39226f..928170f50 100644 --- a/template/en/default/admin/versions/confirm-delete.html.tmpl +++ b/template/en/default/admin/versions/confirm-delete.html.tmpl @@ -21,33 +21,33 @@ style_urls = ['skins/standard/admin.css'] %] -<table border="1" cellpadding="4" cellspacing="0"> -<tr bgcolor="#6666FF"> - <th valign="top" align="left">Field</th> - <th valign="top" align="left">Value</th> -</tr> -<tr> - <td valign="top">Version:</td> - <td valign="top">[% version.name FILTER html %]</td> -</tr> -<tr> - <td valign="top">Version of Product:</td> - <td valign="top">[% product.name FILTER html %]</td> -</tr> -<tr> - <td valign="top">[% terms.Bugs %]:</td> - <td valign="top"> -[% IF version.bug_count %] - <a title="List of [% terms.bugs %] targetted at version ' - [%- version.name FILTER html %]'" - href="buglist.cgi?version=[% version.name FILTER uri %]&product= - [%- product.name FILTER uri %]"> - [%- version.bug_count FILTER none %]</a> -[% ELSE %] - None -[% END %] - </td> -</tr> +<table id="admin_table"> + <tr class="column_header"> + <th>Field</th> + <th>Value</th> + </tr> + <tr> + <td>Version</td> + <td>[% version.name FILTER html %]</td> + </tr> + <tr> + <td>Version of Product</td> + <td>[% product.name FILTER html %]</td> + </tr> + <tr> + <td>[% terms.Bugs %]</td> + <td> + [% IF version.bug_count %] + <a title="List of [% terms.bugs %] targetted at version ' + [%- version.name FILTER html %]'" + href="buglist.cgi?version=[% version.name FILTER uri %]&product= + [%- product.name FILTER uri %]"> + [%- version.bug_count FILTER none %]</a> + [% ELSE %] + None + [% END %] + </td> + </tr> </table> <h2>Confirmation</h2> diff --git a/template/en/default/admin/versions/create.html.tmpl b/template/en/default/admin/versions/create.html.tmpl index af7258238..648adcebd 100644 --- a/template/en/default/admin/versions/create.html.tmpl +++ b/template/en/default/admin/versions/create.html.tmpl @@ -17,14 +17,15 @@ [% PROCESS global/header.html.tmpl title = title subheader = subheader + style_urls = ['skins/standard/admin.css'] %] <form method="post" action="editversions.cgi"> - <table border="0" cellpadding="4" cellspacing="0"> + <table id="admin_table_edit"> <tr> - <th align="right"><label for="version">Version:</label></th> + <th><label for="version">Version:</label></th> <td><input id="version" size="64" maxlength="64" name="version" - value=""></td> + value="" required></td> </tr> </table> <input type="submit" id="create" value="Add"> diff --git a/template/en/default/admin/versions/edit.html.tmpl b/template/en/default/admin/versions/edit.html.tmpl index 195a94c26..1ef0b2f66 100644 --- a/template/en/default/admin/versions/edit.html.tmpl +++ b/template/en/default/admin/versions/edit.html.tmpl @@ -17,20 +17,24 @@ [%- product.name FILTER html %]'[% END %] [% PROCESS global/header.html.tmpl title = title + style_urls = ['skins/standard/admin.css'] %] <form method="post" action="editversions.cgi"> - <table border="0" cellpadding="4" cellspacing="0"> - + <table id="admin_table_edit"> <tr> - <th class="field_label"><label for="version">Version:</label></th> - <td><input id="version" size="64" maxlength="64" name="version" value=" - [%- version.name FILTER html %]"></td> + <th><label for="version">Version:</label></th> + <td> + <input id="version" size="64" maxlength="64" name="version" + value="[% version.name FILTER html %]" required> + </td> </tr> <tr> - <th class="field_label"><label for="isactive">Enabled For [% terms.Bugs %]:</label></th> - <td><input id="isactive" name="isactive" type="checkbox" value="1" - [% 'checked="checked"' IF version.isactive %]></td> + <th><label for="isactive">Enabled For [% terms.Bugs %]:</label></th> + <td> + <input id="isactive" name="isactive" type="checkbox" value="1" + [% 'checked="checked"' IF version.isactive %]> + </td> </tr> </table> diff --git a/template/en/default/admin/versions/list.html.tmpl b/template/en/default/admin/versions/list.html.tmpl index 1cf3e8643..43a14f9ee 100644 --- a/template/en/default/admin/versions/list.html.tmpl +++ b/template/en/default/admin/versions/list.html.tmpl @@ -15,6 +15,7 @@ '[% product.name FILTER html %]'[% END %] [% PROCESS global/header.html.tmpl title = title + style_urls = ['skins/standard/admin.css'] %] [% edit_contentlink = BLOCK %]editversions.cgi?action=edit&product= @@ -44,7 +45,7 @@ [% columns.push({ name => "bug_count" heading => "$terms.Bugs" - align => "right" + class => "right" contentlink => bug_count_contentlink }) %] diff --git a/template/en/default/admin/versions/select-product.html.tmpl b/template/en/default/admin/versions/select-product.html.tmpl index e40e4086c..119ec9a71 100644 --- a/template/en/default/admin/versions/select-product.html.tmpl +++ b/template/en/default/admin/versions/select-product.html.tmpl @@ -13,6 +13,7 @@ [% PROCESS global/header.html.tmpl title = "Edit versions for which product?" + style_urls = ['skins/standard/admin.css'] %] [% columns = [ @@ -34,7 +35,7 @@ [% columns.push({ name => 'bug_count' heading => "$terms.Bugs" - align => "right" + class => "right" contentlink => "buglist.cgi?product=%%name%%" }) %] diff --git a/template/en/default/admin/workflow/comment.html.tmpl b/template/en/default/admin/workflow/comment.html.tmpl index b5907d1d0..19762d154 100644 --- a/template/en/default/admin/workflow/comment.html.tmpl +++ b/template/en/default/admin/workflow/comment.html.tmpl @@ -15,9 +15,9 @@ <!-- function toggle_cell(cell) { if (cell.checked) - cell.parentNode.className = "checkbox-cell checked"; + cell.parentNode.className = "checked"; else - cell.parentNode.className = "checkbox-cell"; + cell.parentNode.className = ""; } //--> </script> @@ -28,7 +28,7 @@ </p> <form id="workflow_form" method="POST" action="editworkflow.cgi"> -<table> +<table id="workflow"> <tr> <th colspan="2"> </th> <th colspan="[% statuses.size FILTER html %]" class="title">To</th> @@ -38,7 +38,7 @@ <th rowspan="[% statuses.size + 2 FILTER html %]" class="title">From</th> <th> </th> [% FOREACH status = statuses %] - <th class="col-header[% status.is_open ? " open-status" : " closed-status" %]"> + <th class="[% status.is_open ? "open-status" : "closed-status" %] center"> [% display_value("bug_status", status.name) FILTER html %] </th> [% END %] @@ -48,28 +48,27 @@ [% p = [{id => 0, name => "{Start}", is_open => 1}] %] [% FOREACH status = p.merge(statuses) %] <tr class="highlight"> - <th align="right" class="[% status.is_open ? "open-status" : "closed-status" %]"> + <th class="[% status.is_open ? "open-status" : "closed-status" %]"> [% display_value("bug_status", status.name) FILTER html %] </th> [% FOREACH new_status = statuses %] [% IF workflow.${status.id}.${new_status.id}.defined %] - <td align="center" class="checkbox-cell - [% " checked" IF workflow.${status.id}.${new_status.id} %]" + <td class="[% "checked" IF workflow.${status.id}.${new_status.id} %]" title="From [% status.name FILTER html %] to [% new_status.name FILTER html %]"> <input type="checkbox" name="c_[% status.id %]_[% new_status.id %]" id="c_[% status.id %]_[% new_status.id %]" onclick="toggle_cell(this)" [% " checked='checked'" IF workflow.${status.id}.${new_status.id} %]> </td> [% ELSE %] - <td class="checkbox-cell forbidden"> </td> + <td class="forbidden"> </td> [% END %] [% END %] </tr> [% END %] </table> -<p align="center"> +<p class="center"> <input type="hidden" name="action" value="update_comment"> <input type="hidden" name="token" value="[% token FILTER html %]"> <input type="submit" id="update_comment" value="Commit Changes"> - diff --git a/template/en/default/admin/workflow/edit.html.tmpl b/template/en/default/admin/workflow/edit.html.tmpl index 403405b16..a85db2339 100644 --- a/template/en/default/admin/workflow/edit.html.tmpl +++ b/template/en/default/admin/workflow/edit.html.tmpl @@ -15,25 +15,25 @@ <!-- function toggle_cell(cell) { if (cell.checked) - cell.parentNode.className = "checkbox-cell checked"; + cell.parentNode.className = "checked"; else - cell.parentNode.className = "checkbox-cell"; + cell.parentNode.className = ""; } //--> </script> <p> This page allows you to define which status transitions are valid in your workflow. - For compatibility with older versions of [% terms.Bugzilla %], reopening [% terms.abug %] + For compatibility with older versions of Bugzilla, reopening [% terms.abug %] will only display either [% display_value("bug_status", "UNCONFIRMED") FILTER html %] or [%+ display_value("bug_status", "REOPENED") FILTER html %] (if allowed by your workflow) but not both. The decision depends on whether the [% terms.bug %] has ever been confirmed or not. - So it is a good idea to allow both transitions and let [% terms.Bugzilla %] select the + So it is a good idea to allow both transitions and let Bugzilla select the correct one. </p> <form id="workflow_form" method="POST" action="editworkflow.cgi"> -<table> +<table id="workflow"> <tr> <th colspan="2"> </th> <th colspan="[% statuses.size FILTER html %]" class="title">To</th> @@ -43,7 +43,7 @@ <th rowspan="[% statuses.size + 2 FILTER html %]" class="title">From</th> <th> </th> [% FOREACH status = statuses %] - <th class="col-header[% status.is_open ? " open-status" : " closed-status" %]"> + <th class="[% status.is_open ? "open-status" : "closed-status" %] center"> [% display_value("bug_status", status.name) FILTER html %] </th> [% END %] @@ -53,7 +53,7 @@ [% p = [{id => 0, name => "{Start}", is_open => 1}] %] [% FOREACH status = p.merge(statuses) %] <tr class="highlight"> - <th align="right" class="[% status.is_open ? "open-status" : "closed-status" %]"> + <th class="[% status.is_open ? "open-status" : "closed-status" %]"> [% display_value("bug_status", status.name) FILTER html %] </th> @@ -61,7 +61,7 @@ [% IF status.id != new_status.id %] [% checked = workflow.${status.id}.${new_status.id}.defined ? 1 : 0 %] [% mandatory = (status.id && new_status.name == Param("duplicate_or_move_bug_status")) ? 1 : 0 %] - <td align="center" class="checkbox-cell[% " checked" IF checked || mandatory %]" + <td class="[% "checked" IF checked || mandatory %]" title="From [% status.name FILTER html %] to [% new_status.name FILTER html %]"> <input type="checkbox" name="w_[% status.id %]_[% new_status.id %]" id="w_[% status.id %]_[% new_status.id %]" onclick="toggle_cell(this)" @@ -69,7 +69,7 @@ [%+ "disabled='disabled'" IF mandatory %]> </td> [% ELSE %] - <td class="checkbox-cell forbidden"> </td> + <td class="forbidden"> </td> [% END %] [% END %] </tr> @@ -87,7 +87,7 @@ page and editing the <i>duplicate_or_move_bug_status</i> parameter. </p> -<p align="center"> +<p class="center"> <input type="hidden" name="action" value="update"> <input type="hidden" name="token" value="[% token FILTER html %]"> <input type="submit" id="update_workflow" value="Commit Changes"> - diff --git a/template/en/default/attachment/choose.html.tmpl b/template/en/default/attachment/choose.html.tmpl index c6b94d792..f20facd90 100644 --- a/template/en/default/attachment/choose.html.tmpl +++ b/template/en/default/attachment/choose.html.tmpl @@ -7,23 +7,28 @@ #%] [% PROCESS global/header.html.tmpl - title = "Locate attachment", - onload = "document.forms['choose-id'].id.focus()" - %] + title = "Locate or Create Attachment" +%] <form name="choose-id" method="get" action="attachment.cgi"> <p>Access an attachment by entering its ID into the form below:</p> - <p>Attachment ID: <input name="id" size="6"> + <p>Attachment ID: <input name="id" size="6" autofocus required> <button name="action" value="edit" id="edit">Details</button> <button name="action" value="view" id="view">View</button> </p> </form> <form method="get" action="show_bug.cgi"> - <p>Or, access it from the list of attachments in its associated [% terms.bug %] report:</p> - <p>[% terms.Bug %] ID: <input name="id" size="6"> + <p>Or, Access it from the list of attachments in its associated [% terms.bug %] report:</p> + <p>[% terms.Bug %] ID: <input name="id" size="6" required> <input type="submit" name="action" value="View" id="action"> </p> </form> +<form method="get" action="attachment.cgi"> + <p>Or, Create a new attachment by entering its [% terms.bug %] Id below:</p> + <p>[% terms.Bug %] ID: <input name="bugid" size="6" required> + <button name="action" value="enter" id="action">New Attachment</button> + </p> +</form> [% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/attachment/confirm-delete.html.tmpl b/template/en/default/attachment/confirm-delete.html.tmpl index 4557af616..5108692a8 100644 --- a/template/en/default/attachment/confirm-delete.html.tmpl +++ b/template/en/default/attachment/confirm-delete.html.tmpl @@ -17,51 +17,48 @@ [% PROCESS global/header.html.tmpl title = title - doc_section = "attachments.html" + style_urls = ['skins/standard/admin.css'] + doc_section = "using/editing.html#attachments" %] -<table border="1" cellpadding="4" cellspacing="0"> - <tr bgcolor="#6666FF"> - <th valign="top" align="left">Field</th> - <th valign="top" align="left">Value</th> +<table id="admin_table"> + <tr class="column_header"> + <th>Field</th> + <th>Value</th> </tr> <tr> - <td valign="top">Attachment ID:</td> - <td valign="top"> + <td>Attachment ID</td> + <td> <a href="attachment.cgi?id=[% a.id FILTER html %]">[% a.id FILTER html %]</a> </td> </tr> <tr> - <td valign="top">File name:</td> - <td valign="top">[% a.filename FILTER html %]</td> + <td>File name</td> + <td>[% a.filename FILTER html %]</td> </tr> <tr> - <td valign="top">Description:</td> - <td valign="top">[% a.description FILTER html %]</td> + <td>Description</td> + <td>[% a.description FILTER html %]</td> </tr> <tr> - <td valign="top">Contained in [% terms.Bug %]:</td> - <td valign="top">[% a.bug_id FILTER bug_link(a.bug_id) FILTER none %]</td> + <td>Contained in [% terms.Bug %]</td> + <td>[% a.bug_id FILTER bug_link(a.bug_id) FILTER none %]</td> </tr> <tr> - <td valign="top">Creator:</td> - <td valign="top">[% a.attacher.identity FILTER html %]</td> + <td>Creator</td> + <td>[% a.attacher.identity FILTER html %]</td> </tr> <tr> - <td valign="top">Creation Date:</td> - <td valign="top">[% a.attached FILTER time %]</td> + <td>Creation Date</td> + <td>[% a.attached FILTER time %]</td> </tr> </table> <h2>Confirmation</h2> -<table border="0" cellpadding="20" width="70%" bgcolor="red"> - <tr> - <td> - The content of this attachment will be deleted in an <b>irreversible</b> way. - </td> - </tr> -</table> +<p class="confirmation"> + The content of this attachment will be deleted in an <b>irreversible</b> way. +</p> <p>Do you really want to delete this attachment?</p> diff --git a/template/en/default/attachment/create.html.tmpl b/template/en/default/attachment/create.html.tmpl index abc0f97bf..e566b428e 100644 --- a/template/en/default/attachment/create.html.tmpl +++ b/template/en/default/attachment/create.html.tmpl @@ -16,10 +16,11 @@ title = title header = header subheader = subheader - style_urls = [ 'skins/standard/attachment.css' ] + generate_api_token = 1 + style_urls = ['skins/standard/bug.css'] yui = [ 'autocomplete' ] javascript_urls = [ "js/attachment.js", 'js/field.js', "js/util.js", "js/TUI.js" ] - doc_section = "attachments.html" + doc_section = "using/editing.html#attachments" %] <script type="text/javascript"> @@ -84,13 +85,11 @@ TUI_hide_default('attachment_text_field'); <th><label for="comment">Comment:</label></th> <td> <em>(optional) Add a comment about this attachment to the [% terms.bug %].</em><br> - [% INCLUDE global/textarea.html.tmpl - name = 'comment' - id = 'comment' - minrows = 6 - maxrows = 15 - cols = constants.COMMENT_COLS - wrap = 'soft' + [% INCLUDE bug/comment.html.tmpl + minrows = 6 + maxrows = 15 + cols = constants.COMMENT_COLS + wrap = 'soft' %] [% IF NOT bug.cc.contains(user.login) %] <br> diff --git a/template/en/default/attachment/created.html.tmpl b/template/en/default/attachment/created.html.tmpl index cbfd260f8..98ede5b6f 100644 --- a/template/en/default/attachment/created.html.tmpl +++ b/template/en/default/attachment/created.html.tmpl @@ -28,13 +28,13 @@ [% PROCESS "bug/process/bugmail.html.tmpl" mailing_bugid = attachment.bug_id %] [% IF convertedbmp %] <p> - <b>Note:</b> [% terms.Bugzilla %] automatically converted your BMP image file to a + <b>Note:</b> Bugzilla automatically converted your BMP image file to a compressed PNG format. </p> [% END %] [% IF contenttypemethod == 'autodetect' %] <p> - <b>Note:</b> [% terms.Bugzilla %] automatically detected the content type + <b>Note:</b> Bugzilla automatically detected the content type <em>[% attachment.contenttype FILTER html %]</em> for this attachment. If this is incorrect, correct the value by editing the attachment's <a href="attachment.cgi?id=[% attachment.id %]&action=edit">details</a>. diff --git a/template/en/default/attachment/diff-file.html.tmpl b/template/en/default/attachment/diff-file.html.tmpl index 815b6de1b..af99761a6 100644 --- a/template/en/default/attachment/diff-file.html.tmpl +++ b/template/en/default/attachment/diff-file.html.tmpl @@ -14,12 +14,12 @@ # considers the first row to determine column widths. If a colspan is found, # it then share the width equally among all columns, which we don't want. #%] -<table class="file_table"><thead><tr><td class="num"></td><td></td><td class="num"></td><td></td></tr><tr><td class="file_head" colspan="4"><a href="#" onclick="return twisty_click(this)">[% collapsed ? '(+)' : '(-)' %]</a><input type="checkbox" name="[% file.filename FILTER html %]"[% collapsed ? '' : ' checked' %] style="display: none"> - [% IF lxr_prefix && !file.is_add %] - <a href="[% lxr_prefix %]">[% file.filename FILTER html %]</a> - [% ELSE %] - [% file.filename FILTER html %] - [% END %] +<table class="file_table"><thead><tr><td class="num"></td><td></td><td + class="num"></td><td></td></tr><tr><td class="file_head" colspan="4"><a href="#" + onclick="return twisty_click(this)">[% collapsed ? '(+)' : '(-)' %]</a><input + type="checkbox" name="[% file.filename FILTER html %]"[% collapsed ? '' : ' checked' %] + class="bz_default_hidden"> + [% file.filename FILTER html %] [% IF file.plus_lines %] [% IF file.minus_lines %] (-[% file.minus_lines %] / +[% file.plus_lines %] lines) @@ -39,36 +39,27 @@ incremental_restore() [% section_num = 0 %] [% FOREACH section = sections %] [% section_num = section_num + 1 %] - <tr><th colspan="4" class="section_head"> - <table id="[% file.filename FILTER html %]_sec[% section_num %]" cellpadding="0" cellspacing="0"> - <tr><th width="95%" align="left"> - [% IF file.is_add %] - Added - [% ELSIF file.is_remove %] - [% IF bonsai_prefix %] - <a href="[% bonsai_prefix %]">Removed</a> - [% ELSE %] - Removed - [% END %] - [% ELSE %] - [% IF bonsai_prefix %] - <a href="[% bonsai_prefix %]#[% section.old_start %]"> - [% END %] - [% IF section.old_lines > 1 %] - Lines [% section.old_start %]-[% section.old_start + - section.old_lines - 1 %] - [% ELSE %] - Line [% section.old_start %] - [% END %] - [% IF bonsai_prefix %] - </a> - [% END %] - [% section.func_info FILTER html IF section.func_info %] - [% END %] - </th><th> - <a href="#[% file.filename FILTER html %]_sec[% section_num %]">Link Here</a> - </th></tr></table> - </th></tr> + <tr> + <th colspan="4" class="section_head"> + <span id="[% file.filename FILTER html %]_sec[% section_num %]" class="lines_count"> + [% IF file.is_add %] + Added + [% ELSIF file.is_remove %] + Removed + [% ELSE %] + [% IF section.old_lines > 1 %] + Lines [% section.old_start %]-[% section.old_start + section.old_lines - 1 %] + [% ELSE %] + Line [% section.old_start %] + [% END %] + [%+ section.func_info FILTER html IF section.func_info %] + [% END %] + </span> + <span class="link_here"> + <a href="#[% file.filename FILTER html %]_sec[% section_num %]">Link Here</a> + </span> + </th> + </tr> [% current_line_old = section.old_start %] [% current_line_new = section.new_start %] [% FOREACH group = section.groups %] diff --git a/template/en/default/attachment/diff-header.html.tmpl b/template/en/default/attachment/diff-header.html.tmpl index ed4d44e25..2b3e0d75d 100644 --- a/template/en/default/attachment/diff-header.html.tmpl +++ b/template/en/default/attachment/diff-header.html.tmpl @@ -37,33 +37,36 @@ Interdiff of #[% oldid %] and #[% newid %] for [% terms.bug %] #[% bugid %] [% subheader = BLOCK %] [% bugsummary FILTER html %] [% END %] - [% PROCESS global/header.html.tmpl doc_section = "attachments.html#patchviewer" - javascript_urls = "js/attachment.js" - style_urls = ['skins/standard/attachment.css'] %] + [% PROCESS global/header.html.tmpl javascript_urls = [ "js/attachment.js" ] + style_urls = ['skins/standard/bug.css'] %] [% ELSE %] + <!DOCTYPE html> <html> - <head> - <link href="[% 'skins/standard/attachment.css' FILTER mtime %]" - rel="stylesheet" type="text/css"> - <script src="[% 'js/attachment.js' FILTER mtime %]" - type="text/javascript"></script> - </head> - <body onload="[% onload FILTER html %]"> + <head> + <link href="[% 'skins/standard/global.css' FILTER mtime %]" + rel="stylesheet" type="text/css"> + <link href="[% 'skins/standard/bug.css' FILTER mtime %]" + rel="stylesheet" type="text/css"> + <script src="[% 'js/attachment.js' FILTER mtime %]" + type="text/javascript"></script> + </head> + <body onload="[% onload FILTER html %]"> [% END %] - + [%# If we have attachid, we are in diff, otherwise we're in interdiff %] [% IF attachid %] [%# HEADER %] [% IF headers %] <a href="[% PROCESS viewurl id=attachid %]">View</a> | <a href="[% PROCESS editurl id=attachid %]">Details</a> - | <a href="[% PROCESS diffurl id=attachid %]&context=[% context FILTER uri %]&collapsed=[% collapsed FILTER uri %]&headers=[% headers FILTER uri %]&format=raw">Raw Unified</a> + | <a href="[% PROCESS diffurl id=attachid %]&collapsed=[% collapsed FILTER uri %]&headers=[% + headers FILTER uri %]&format=raw">Raw Unified</a> | Return to [% "$terms.bug $bugid" FILTER bug_link(bugid) FILTER none %] [% END %] [% IF other_patches.size > 0 %] [% IF headers %] |[%END%] Differences between - <form style="display: inline" action="attachment.cgi"> + <form class="inline" action="attachment.cgi"> <select name="oldid"> [% FOREACH patch = other_patches %] <option value="[% patch.id %]" @@ -97,37 +100,19 @@ Interdiff of #[% oldid %] and #[% newid %] for [% terms.bug %] #[% bugid %] onmouseout="window.status = lastStatus; return true" onclick="return expand_all()">Expand All</a> -[% IF do_context %] - [%# only happens for normal viewing, not interdiff %] - | <span style='font-weight: bold'>Context:</span> - [% IF context == "patch" %] - (<strong>Patch</strong> / - [% ELSE %] - (<a href="[% PROCESS diffurl id=attachid %]&headers=[% headers FILTER uri %]">Patch</a> / - [% END %] - [% IF context == "file" %] - <strong>File</strong> / - [% ELSE %] - <a href="[% PROCESS diffurl id=attachid %]&headers=[% headers FILTER uri %]&context=file">File</a> / - [% END %] - - [% IF context == "patch" || context == "file" %] - [% context = 3 %] - [% END %] - [%# textbox for context %] - <form style="display: inline" action="attachment.cgi"><input type="hidden" name="action" value="diff"><input type="hidden" name="id" value="[% attachid %]"><input type="hidden" name="collapsed" value="[% collapsed FILTER html %]"><input type="hidden" name="headers" value="[% headers FILTER html %]"><input type="text" name="context" value="[% context FILTER html %]" size="3"></form>) -[% END %] - [% IF warning %] -<h2 class="warning">Warning: +<h2 class="warning"> + Warning: [% IF warning == "interdiff1" %] - this difference between two patches may show things in the wrong places due - to a limitation in [% terms.Bugzilla %] when comparing patches with different - sets of files. - [% END %] - [% IF warning == "interdiff2" %] - this difference between two patches may be inaccurate due to a limitation in - [%+ terms.Bugzilla %] when comparing patches made against different revisions. + this difference between two patches may show things in the wrong places due + to a limitation in Bugzilla when comparing patches with + different sets of files. + [% ELSIF warning == "interdiff2" %] + this difference between two patches may be inaccurate due to a limitation + in Bugzilla when comparing patches made against different + revisions. + [% ELSIF warning == "interdiff3" %] + interdiff encountered errors while comparing these patches. [% END %] </h2> [% ELSE %] @@ -136,4 +121,4 @@ Interdiff of #[% oldid %] and #[% newid %] for [% terms.bug %] #[% bugid %] [%# Restore Stuff %] <form name="checkboxform" action="attachment.cgi"> -<input type="checkbox" name="restore_indicator" style="display: none"> +<input type="checkbox" name="restore_indicator" class="bz_default_hidden"> diff --git a/template/en/default/attachment/edit.html.tmpl b/template/en/default/attachment/edit.html.tmpl index a887e77cd..8a149cb01 100644 --- a/template/en/default/attachment/edit.html.tmpl +++ b/template/en/default/attachment/edit.html.tmpl @@ -9,6 +9,7 @@ [%# Define strings that will serve as the title and header of this page %] [% title = BLOCK %] Attachment [% attachment.id %] Details for [% terms.Bug %] [%+ attachment.bug_id %] + – [% attachment.description FILTER html %] [% END %] [% header = BLOCK %] Attachment [% attachment.id %] Details for @@ -20,15 +21,16 @@ title = title header = header subheader = subheader - doc_section = "attachments.html" + generate_api_token = 1 + doc_section = "using/editing.html#attachments" javascript_urls = ['js/attachment.js', 'js/field.js'] - style_urls = ['skins/standard/attachment.css'] + style_urls = ['skins/standard/bug.css'] yui = [ 'autocomplete' ] bodyclasses = "no_javascript" %] [%# No need to display the Diff button and iframe if the attachment is not a patch. %] -[% use_patchviewer = (feature_enabled('patch_viewer') && attachment.ispatch) %] +[% use_patchviewer = (feature_enabled('patch_viewer') && attachment.ispatch) ? 1 : 0 %] [% can_edit = attachment.validate_can_edit %] [% editable_or_hide = can_edit ? "" : " bz_hidden_option" %] @@ -197,35 +199,38 @@ readonly = 'readonly' %] [% ELSE %] - <iframe id="viewFrame" src="attachment.cgi?id=[% attachment.id %]"> + <iframe id="viewFrame" src="attachment.cgi?id=[% attachment.id %]" sandbox> <b>You cannot view the attachment while viewing its details because your browser does not support IFRAMEs. <a href="attachment.cgi?id=[% attachment.id %]">View the attachment on a separate page</a>.</b> </iframe> [% END %] + + [% IF use_patchviewer %] + <iframe id="viewDiffFrame" class="bz_default_hidden"></iframe> + [% END %] + + [% IF user.id %] + <button type="button" id="editButton" class="bz_default_hidden" + onclick="editAsComment([% use_patchviewer %]);">Edit Attachment As Comment</button> + <button type="button" id="undoEditButton" class="bz_default_hidden" + onclick="undoEditAsComment([% use_patchviewer %]);">Undo Edit As Comment</button> + <button type="button" id="redoEditButton" class="bz_default_hidden" + onclick="redoEditAsComment([% use_patchviewer %]);">Redo Edit As Comment</button> + [% END %] + + [% IF use_patchviewer %] + <button type="button" id="viewDiffButton" class="bz_default_hidden" + onclick="viewDiff([% attachment.id %], [% use_patchviewer %]);">View Attachment As Diff</button> + [% END %] + <button type="button" id="viewRawButton" class="bz_default_hidden" + onclick="viewRaw([% use_patchviewer %]);">View Attachment As Raw</button> + <script type="text/javascript"> - <!-- - var patchviewerinstalled = 0; - var attachment_id = [% attachment.id %]; - if (typeof document.getElementById == "function") { - [% IF use_patchviewer %] - var patchviewerinstalled = 1; - document.write('<iframe id="viewDiffFrame" class="bz_default_hidden"><\/iframe>'); - [% END %] - [% IF user.id %] - document.write('<button type="button" id="editButton" onclick="editAsComment(patchviewerinstalled);">Edit Attachment As Comment<\/button>'); - document.write('<button type="button" id="undoEditButton" onclick="undoEditAsComment(patchviewerinstalled);" class="bz_default_hidden">Undo Edit As Comment<\/button>'); - document.write('<button type="button" id="redoEditButton" onclick="redoEditAsComment(patchviewerinstalled);" class="bz_default_hidden">Redo Edit As Comment<\/button>'); - var editFrame = document.getElementById('editFrame'); - if (editFrame) { - editFrame.disabled = false; - } - [% END %] - [% IF use_patchviewer %] - document.write('<button type="button" id="viewDiffButton" onclick="viewDiff(attachment_id, patchviewerinstalled);">View Attachment As Diff<\/button>'); - [% END %] - document.write('<button type="button" id="viewRawButton" onclick="viewRaw(patchviewerinstalled);" class="bz_default_hidden">View Attachment As Raw<\/button>'); - } - //--> + [% IF user.id %] + document.getElementById('editFrame').disabled = false; + YAHOO.util.Dom.removeClass("editButton", "bz_default_hidden"); + [% END %] + YAHOO.util.Dom.removeClass("viewDiffButton", "bz_default_hidden"); </script> </div> [% ELSE %] @@ -247,13 +252,12 @@ <label for="comment">Comment (on the [% terms.bug %]):</label> [% classNames = 'block' %] [% classNames = "$classes bz_private" IF attachment.isprivate %] - [% INCLUDE global/textarea.html.tmpl - id = 'comment' - name = 'comment' - minrows = 10 - cols = 80 - wrap = 'soft' - classes = classNames + [% INCLUDE bug/comment.html.tmpl + bug = attachment.bug + minrows = 10 + cols = 80 + classes = classNames + wrap = 'soft' %] [% IF NOT attachment.bug.cc.contains(user.login) %] <input type="checkbox" id="addselfcc" name="addselfcc" @@ -263,6 +267,7 @@ && user.settings.state_addselfcc.value == 'cc_unless_role') %]> <label for="addselfcc">Add me to CC list</label> [% END %] + [% Hook.process('after_comment_textarea') %] </div> [% END %] <div id="attachment_flags"> diff --git a/template/en/default/attachment/list.html.tmpl b/template/en/default/attachment/list.html.tmpl index e30492c36..9676dd67b 100644 --- a/template/en/default/attachment/list.html.tmpl +++ b/template/en/default/attachment/list.html.tmpl @@ -42,9 +42,9 @@ function toggle_display(link) { </script> <br> -<table id="attachment_table" cellspacing="0" cellpadding="4"> +<table id="attachment_table"> <tr id="a0"> - <th colspan="[% show_attachment_flags ? 3 : 2 %]" align="left"> + <th colspan="[% show_attachment_flags ? 3 : 2 %]" class="left"> Attachments </th> </tr> @@ -65,7 +65,7 @@ function toggle_display(link) { [% " bz_private" IF attachment.isprivate %] [% " bz_tr_obsolete bz_default_hidden" IF attachment.isobsolete %]"> - <td valign="top"> + <td> [% IF attachment.datasize %] <a href="attachment.cgi?id=[% attachment.id %]" title="View the content of the attachment"> @@ -88,7 +88,7 @@ function toggle_display(link) { <br> <a href="#attach_[% attachment.id %]" title="Go to the comment associated with the attachment"> - [%- attachment.attached FILTER time %]</a>, + [%- attachment.attached FILTER time("%Y-%m-%d %H:%M %Z") %]</a>, [%# No need to recreate the exact same template if we already have it. %] [% attacher_id = attachment.attacher.id %] @@ -102,7 +102,7 @@ function toggle_display(link) { </td> [% IF show_attachment_flags %] - <td class="bz_attach_flags" valign="top"> + <td class="bz_attach_flags"> [% IF attachment.flags.size == 0 %] <i>no flags</i> [% ELSE %] @@ -114,7 +114,7 @@ function toggle_display(link) { [% ELSE %] [% flag.setter.nick FILTER html %]: [% END %] - [%+ flag.type.name FILTER html FILTER no_break %][% flag.status %] + [%+ flag.type.name FILTER html %][% flag.status %] [%+ IF flag.status == "?" && flag.requestee %] [% IF user.id %] (<span title="[% flag.requestee.identity FILTER html %]">[% flag.requestee.nick FILTER html %]</span>) @@ -129,7 +129,7 @@ function toggle_display(link) { </td> [% END %] - <td valign="top"> + <td> <a href="attachment.cgi?id=[% attachment.id %]&action=edit">Details</a> [% IF attachment.ispatch && feature_enabled('patch_viewer') %] | <a href="attachment.cgi?id=[% attachment.id %]&action=diff">Diff</a> diff --git a/template/en/default/attachment/show-multiple.html.tmpl b/template/en/default/attachment/show-multiple.html.tmpl index 8791e0dfe..e2c95cb80 100644 --- a/template/en/default/attachment/show-multiple.html.tmpl +++ b/template/en/default/attachment/show-multiple.html.tmpl @@ -18,7 +18,7 @@ title = title header = header subheader = filtered_summary - style_urls = ['skins/standard/attachment.css'] + style_urls = ['skins/standard/bug.css'] %] [% IF hide_obsolete %] <div id="hidden_obsolete_message"> @@ -26,23 +26,17 @@ <a href="attachment.cgi?bugid=[% bug.id FILTER html %]&action=viewall">click here</a>. </div> [% END %] -<br> [% FOREACH a = attachments %] - - <div align="center"> - <table class="attachment_info" cellspacing="0" cellpadding="4" border="1" width="75%"> +<div class="viewall_frame_container"> + <table class="viewall_desc"> <tr> - <td valign="top" bgcolor="#cccccc" colspan="6"> - <big><b>Attachment #[% a.id %]</b></big> - </td> + <th colspan="6" class="bz_attach_footer">Attachment #[% a.id %]</th> </tr> <tr> - <td valign="top"> - [% a.description FILTER html FILTER obsolete(a.isobsolete) %] - </td> + <td>[% a.description FILTER html FILTER obsolete(a.isobsolete) %]</td> - <td valign="top"> + <td> [% IF a.ispatch %] <i>patch</i> [% ELSE %] @@ -50,10 +44,10 @@ [% END %] </td> - <td valign="top">[% a.attached FILTER time %]</td> - <td valign="top">[% a.datasize FILTER unitconvert %]</td> + <td>[% a.attached FILTER time %]</td> + <td>[% a.datasize FILTER unitconvert %]</td> - <td valign="top"> + <td> [% IF a.flags.size == 0 %] <i>no flags</i> [% ELSE %] @@ -68,9 +62,7 @@ [% END %] </td> - <td valign="top"> - <a href="attachment.cgi?id=[% a.id %]&action=edit">Details</a> - </td> + <td><a href="attachment.cgi?id=[% a.id %]&action=edit">Details</a></td> </tr> </table> @@ -86,7 +78,7 @@ classes = 'viewall_frame' %] [% ELSE %] - <iframe src="attachment.cgi?id=[% a.id %]" class="viewall_frame"> + <iframe src="attachment.cgi?id=[% a.id %]" class="viewall_frame" sandbox> <b>You cannot view the attachment on this page because your browser does not support IFRAMEs. <a href="attachment.cgi?id=[% a.id %]">View the attachment on a separate page</a>.</b> </iframe> @@ -97,10 +89,7 @@ <a href="attachment.cgi?id=[% a.id %]">Download the attachment instead</a>. </b></p> [% END %] - </div> - - <br><br> - +</div> [% END %] [% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/bug/activity/show.html.tmpl b/template/en/default/bug/activity/show.html.tmpl index a442abd4b..0d4f06323 100644 --- a/template/en/default/bug/activity/show.html.tmpl +++ b/template/en/default/bug/activity/show.html.tmpl @@ -21,14 +21,14 @@ %] <p> - [% "Back to $terms.bug $bug.bug_id" FILTER bug_link(bug) FILTER none %] + Back to [% "$terms.bug $bug.bug_id" FILTER bug_link(bug) FILTER none %] </p> [% PROCESS bug/activity/table.html.tmpl %] [% IF operations.size > 0 %] <p> - [% "Back to $terms.bug $bug.bug_id" FILTER bug_link(bug) FILTER none %] + Back to [% "$terms.bug $bug.bug_id" FILTER bug_link(bug) FILTER none %] </p> [% END %] diff --git a/template/en/default/bug/activity/table.html.tmpl b/template/en/default/bug/activity/table.html.tmpl index 253d16109..8b371f0b5 100644 --- a/template/en/default/bug/activity/table.html.tmpl +++ b/template/en/default/bug/activity/table.html.tmpl @@ -33,8 +33,8 @@ [% END %] [% IF operations.size > 0 %] - <table border cellpadding="4"> - <tr> + <table id="bug_activity"> + <tr class="column_header"> <th>Who</th> <th>When</th> <th>What</th> @@ -44,10 +44,10 @@ [% FOREACH operation = operations %] <tr> - <td rowspan="[% operation.changes.size %]" valign="top"> + <td rowspan="[% operation.changes.size %]"> [% operation.who FILTER email FILTER html %] </td> - <td rowspan="[% operation.changes.size %]" valign="top"> + <td rowspan="[% operation.changes.size %]"> [% operation.when FILTER time %] </td> [% FOREACH change = operation.changes %] @@ -94,7 +94,7 @@ change.fieldname == 'flagtypes.name' %] [% display_value(change.fieldname, change_type) FILTER email FILTER html %] [% ELSE %] - [% display_value(change.fieldname, change_type) FILTER html %] + [% display_value(change.fieldname, change_type) FILTER html FILTER html_line_break %] [% END %] [% ELSE %] diff --git a/template/en/default/bug/comment.html.tmpl b/template/en/default/bug/comment.html.tmpl new file mode 100644 index 000000000..96cbb63ed --- /dev/null +++ b/template/en/default/bug/comment.html.tmpl @@ -0,0 +1,37 @@ +[%# 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. + #%] + +[%# INTERFACE: + # + # This template supports the same parameters as global/textarea.html.tmpl + # with the exception of "name" and "id", which will always be "comment". + #%] + +[% IF feature_enabled('jsonrpc') %] + <div id="comment_tabs" role="tablist"> + <div id="comment_tab" class="comment_tab active_comment_tab" + role="tab" aria-selected="true" + onclick="show_comment_edit()">Comment</div> + <div id="comment_preview_tab" class="comment_tab" + role="tab" aria-selected="false" + onclick="show_comment_preview([% bug.id FILTER none %])">Preview</div> + </div> +[% END %] + +[% INCLUDE global/textarea.html.tmpl + name = "comment" + id = "comment" +%] + +[% IF feature_enabled('jsonrpc') %] + <div id="comment_preview" class="bz_default_hidden bz_comment"> + <div id="comment_preview_loading" class="bz_default_hidden">Generating Preview...</div> + <div id="comment_preview_error" class="bz_default_hidden"></div> + <pre id="comment_preview_text" class="bz_comment_text"></pre> + </div> +[% END %] diff --git a/template/en/default/bug/comments.html.tmpl b/template/en/default/bug/comments.html.tmpl index 61d1c67e0..f4f79ec5c 100644 --- a/template/en/default/bug/comments.html.tmpl +++ b/template/en/default/bug/comments.html.tmpl @@ -13,7 +13,7 @@ <script type="text/javascript"> <!-- - /* Adds the reply text to the `comment' textarea */ + /* Adds the reply text to the 'comment' textarea */ function replyToComment(id, real_id, name) { var prefix = "(In reply to " + name + " from comment #" + id + ")\n"; var replytext = ""; @@ -44,27 +44,17 @@ //--> </script> -[% DEFAULT start_at = 0 mode = "show" %] -[% sort_order = user.settings.comment_sort_order.value %] +[% DEFAULT mode = "show" %] [% user_cache = template_cache.users %] - -[%# NOTE: (start_at > 0) means we came here from a midair collision, - # in which case we don't care what the user's preference is. - %] -[% IF (start_at > 0) %] - [% sort_order = "oldest_to_newest" %] -[% END %] +[% can_edit_comments = bug.check_can_change_field('longdesc', 0, 1) %] <!-- This auto-sizes the comments and positions the collapse/expand links to the right. --> -<table class="bz_comment_table" cellpadding="0" cellspacing="0"><tr> +<table class="bz_comment_table"> +<tr> <td> -[% FOREACH comment = comments %] - [% IF comment.count >= start_at %] - [% PROCESS a_comment %] - [% END %] -[% END %] +[% PROCESS display_comments %] [% IF mode == "edit" && user.id && user.settings.comment_box_position.value == "before_comments" %] @@ -84,15 +74,18 @@ <td> [% IF mode == "edit" %] <ul class="bz_collapse_expand_comments"> - <li><a href="#" onclick="toggle_all_comments('collapse'); + <li><a href="#" onclick="toggle_all_comments('collapse'); return false;">Collapse All Comments</a></li> <li><a href="#" onclick="toggle_all_comments('expand'); return false;">Expand All Comments</a></li> + [% IF Param('comment_taggers_group') %] + <li><div id="comment_tags_collapse_expand_container"></div></li> + [% END %] [% IF user.settings.comment_box_position.value == "after_comments" && user.id %] <li class="bz_add_comment"><a href="#" onclick="return goto_add_comments('bug_status_bottom');"> Add Comment</a></li> - [% END %] + [% END %] </ul> [% END %] </td> @@ -102,12 +95,14 @@ [%# Block for individual comments #%] [%############################################################################%] -[% BLOCK a_comment %] - [% RETURN IF comment.is_private AND NOT (user.is_insider || user.id == comment.author.id) %] - [% comment_text = comment.body_full %] - [% RETURN IF comment_text == '' AND (comment.work_time - 0) != 0 AND !user.is_timetracker %] +[% BLOCK display_comments %] + [% FOREACH comment = comments %] + [% NEXT IF comment.is_private AND NOT (user.is_insider || user.id == comment.author.id) %] + [% comment_text = comment.body_full %] + [% NEXT IF comment_text == '' AND (comment.work_time - 0) != 0 AND !user.is_timetracker %] <div id="c[% comment.count %]" class="bz_comment[% " bz_private" IF comment.is_private %] + [% " bz_default_collapsed" IF comment.collapsed %] [% " bz_comment_hilite" IF marks.${comment.count} %] [% " bz_first_comment" IF comment.count == 0 %]"> [% IF comment.count == 0 %] @@ -119,23 +114,38 @@ [% END %] <div class="[% class_name FILTER html %]"> - [% IF mode == "edit" %] <span class="bz_comment_actions"> - [% IF bug.check_can_change_field('longdesc', 0, 1) %] + [% IF comment.collapsed %] + <span class="bz_collapsed_actions"> + [% END %] + [% IF can_edit_comments %] + [% IF user.can_tag_comments %] + [<a href="#" + onclick="YAHOO.bugzilla.commentTagging.toggle([% comment.id %], [% comment.count %]);return false">tag</a>] + [% END %] [<a class="bz_reply_link" href="#add_comment" [% IF user.settings.quote_replies.value != 'off' %] onclick="replyToComment('[% comment.count %]', '[% comment.id %]', '[% comment.author.name || comment.author.nick FILTER html FILTER js %]'); return false;" [% END %] >reply</a>] [% END %] - <script type="text/javascript"><!-- - addCollapseLink([% comment.count %], 'Toggle comment display'); // --> + [% IF comment.collapsed %] + </span> + [% END %] + <script type="text/javascript"> + addCollapseLink([% comment.count %], [% comment.collapsed FILTER js %], 'Toggle comment display'); + </script> + </span> + [% ELSIF comment.collapsed %] + <span class="bz_comment_actions"> + <script type="text/javascript"> + addCollapseLink([% comment.count %], [% comment.collapsed FILTER js %], 'Toggle comment display'); </script> </span> [% END %] - [% IF mode == "edit" && user.is_insider && bug.check_can_change_field('longdesc', 0, 1) %] + [% IF mode == "edit" && can_edit_comments && user.is_insider %] <div class="bz_private_checkbox"> <input type="hidden" value="1" name="defined_isprivate_[% comment.id %]"> @@ -176,6 +186,14 @@ <span class="bz_comment_time"> [%+ comment.creation_ts FILTER time %] </span> + + [% IF comment.collapsed %] + <span id="cr[% comment.count %]" class="bz_comment_collapse_reason" + title="[% comment.author.name || comment.author.login FILTER html %] + [%~ %] [[% comment.creation_ts FILTER time %]]"> + Comment hidden ([% comment.tags.join(', ') FILTER html %]) + </span> + [% END %] </div> [% IF user.is_timetracker && @@ -185,12 +203,35 @@ [% PROCESS formattimeunit time_unit=comment.work_time %] [% END %] + [% IF user.id && Param('comment_taggers_group') %] + <div id="comment_tag_[% comment.count FILTER html %]" + class="bz_comment_tags"> + <span id="ct_[% comment.count %]" + class="[% 'bz_default_hidden' UNLESS comment.tags.size %]"> + [% IF comment.tags.size %] + <script> + YAHOO.bugzilla.commentTagging.showTags([% comment.id FILTER none %], + [% comment.count FILTER none %], [ + [% FOREACH tag = comment.tags %] + [%~%]'[% tag FILTER js %]'[% "," UNLESS loop.last %] + [% END %] + [%~%]]); + </script> + [% END %] + </span> + </div> + [% END %] + [%# Don't indent the <pre> block, since then the spaces are displayed in the # generated HTML #%] -<pre class="bz_comment_text" - [% ' id="comment_text_' _ comment.count _ '"' IF mode == "edit" %]> +<pre class="bz_comment_text[% " collapsed" IF comment.collapsed %]" + [% IF mode == "edit" || comment.collapsed %] + id="comment_text_[% comment.count FILTER none %]" + [% END %]> [%- comment_text FILTER quoteUrls(bug, comment) -%] </pre> + [% Hook.process('a_comment-end', 'bug/comments.html.tmpl') %] </div> + [% END %] [% END %] diff --git a/template/en/default/bug/create/create-guided.html.tmpl b/template/en/default/bug/create/create-guided.html.tmpl index b56c4b073..1adae4588 100644 --- a/template/en/default/bug/create/create-guided.html.tmpl +++ b/template/en/default/bug/create/create-guided.html.tmpl @@ -16,12 +16,9 @@ [% PROCESS global/header.html.tmpl title = "Enter $terms.ABug" onload = "PutDescription()" - style = "#somebugs { width: 100%; height: 500px }" + style_urls = ['skins/standard/bug.css'] %] -[% style = "" %] -[% tablecolour = "#FFFFCC" %] - [%# This script displays the descriptions for selected components. %] <script type="text/javascript"> var descriptions = [ @@ -32,52 +29,41 @@ var descriptions = [ ]; function PutDescription() { - if ((document.getElementById) && (document.body.innerHTML)) { - var componentIndex = document.getElementById('component').selectedIndex; - if (componentIndex != -1) { - var description = document.getElementById('description'); - description.innerHTML = descriptions[componentIndex]; - } - } + var description = document.getElementById('description'); + var componentIndex = document.getElementById('component').selectedIndex; + YAHOO.util.Dom.removeClass("description", "bz_default_hidden"); + if (componentIndex != -1) { + description.innerHTML = descriptions[componentIndex]; + } } </script> -[% INCLUDE 'bug/create/user-message.html.tmpl' %] - <h3 id="step1">Step 1 of 3 - has your [% terms.bug %] already been reported?</h3> -<p> - <font color="red">Please don't skip this step - half of all - [% terms.bugs %] filed are - reported already.</font> - Check the two lists of frequently-reported [% terms.bugs %]: +<p class="warning"> + Please don't skip this step - half of all [% terms.bugs %] filed are + reported already. </p> -[%# Include other products if sensible %] -[% IF product.name == "Firefox" %] - [% productstring = "product=Mozilla%20Application%20Suite&product=Firefox" %] -[% ELSIF product.name == "Thunderbird" %] - [% productstring = "product=Mozilla%20Application%20Suite&product=Thunderbird" %] -[% ELSE %] - [% productstring = BLOCK %]product=[% product.name FILTER uri %][% END %] -[% END %] +<p>Check the two lists of frequently-reported [% terms.bugs %]:</p> <p> - <a href="duplicates.cgi?[% productstring %]&format=simple" target="somebugs">All-time Top 100</a> (loaded initially) | - <a href="duplicates.cgi?[% productstring %]&format=simple&sortby=delta&reverse=1&maxrows=100&changedsince=14" target="somebugs">Hot in the last two weeks</a> + <a href="duplicates.cgi?product=[% product.name FILTER uri %]&format=simple" + target="somebugs">All-time Top 100</a> (loaded initially) | + <a href="duplicates.cgi?product=[% product.name FILTER uri %]&format=simple&sortby=delta&reverse=1&maxrows=100&changedsince=14" + target="somebugs">Hot in the last two weeks</a> </p> <iframe name="somebugs" id="somebugs" - style="border: 2px black solid" - src="duplicates.cgi?[% productstring %]&format=simple"> + src="duplicates.cgi?product=[% product.name FILTER uri %]&format=simple"> </iframe> <p> If your [% terms.bug %] isn't there, search [% terms.Bugzilla %] by entering a few key words having to do with your [% terms.bug %] in this box. - For example: <tt><b>pop3 mail</b></tt> or <tt><b>copy paste</b></tt>. + For example: <kbd><b>pop3 mail</b></kbd> or <kbd><b>copy paste</b></kbd>. The results will appear above. - </p> +</p> [%# All bugs opened inside the past six months %] <form action="buglist.cgi" method="get" target="somebugs"> @@ -85,16 +71,6 @@ function PutDescription() { <input type="hidden" name="order" value="relevance desc"> <input type="hidden" name="bug_status" value="__all__"> <input type="hidden" name="product" value="[% product.name FILTER html %]"> - [% IF product.name == "Firefox" OR - product.name == "Thunderbird" OR - product.name == "Mozilla Application Suite" OR - product.name == "Camino" %] - <input type="hidden" name="product" value="Core"> - <input type="hidden" name="product" value="Toolkit"> - <input type="hidden" name="product" value="PSM"> - <input type="hidden" name="product" value="NSPR"> - <input type="hidden" name="product" value="NSS"> - [% END %] <input type="hidden" name="chfieldfrom" value="-6m"> <input type="hidden" name="chfieldto" value="Now"> <input type="hidden" name="chfield" value="[Bug creation]"> @@ -104,7 +80,7 @@ function PutDescription() { <p> Look through the search results. If you get the - <tt><b>[% terms.zeroSearchResults %]</b></tt> message, [% terms.Bugzilla %] + <kbd><b>[% terms.zeroSearchResults %]</b></kbd> message, [% terms.Bugzilla %] found no [% terms.bugs %] that match. Check for typing mistakes, or try fewer or different keywords. If you find [% terms.abug %] that looks the same as yours, please add @@ -119,7 +95,7 @@ function PutDescription() { there, tell us all about it. </p> -<form method="post" action="post_bug.cgi"> +<form id="guided_form" method="post" action="post_bug.cgi"> <input type="hidden" name="format" value="guided"> <input type="hidden" name="assigned_to" value=""> <input type="hidden" name="priority" @@ -128,161 +104,150 @@ function PutDescription() { value="[% default.version FILTER html %]"> <input type="hidden" name="token" value="[% token FILTER html %]"> -<table valign="top" cellpadding="5" cellspacing="5" border="0"> - - <tr bgcolor="[% tablecolour %]"> - <td align="right" valign="top"> - <b>Product</b> - </td> - <td valign="top"> +<table> + <tr class="guided_form_field"> + <th>Product</th> + <td> <input type="hidden" name="product" value="[% product.name FILTER html %]"> [% product.name FILTER html %] </td> </tr> <tr> - <td align="right" valign="top"> - <b>Component</b> - </td> - <td valign="top"> - <table border="0" cellpadding="0" cellspacing="0"> - <tr> - <td valign="top"> - <select name="component" id="component" - size="5" onchange="PutDescription()"> - [% IF NOT default.component_ %] - [%# Various b.m.o. products have a "General" component, - which is a useful default. %] - [% default.component_ = "General" %] - [% END %] - [% FOREACH c = product.components %] - [% NEXT IF NOT c.is_active %] - <option value="[% c.name FILTER html %]" - [% " selected=\"selected\"" IF c.name == default.component_ %]> - [% c.name FILTER html %] - </option> - [% END %] - </select> - </td> - <td valign="top" width="100%"> - <div id="description" style="color: green; margin-left: 10px; - height: 5em; overflow: auto;"> - <script type="text/javascript"> - if ((document.getElementById) && (document.body.innerHTML)) { - document.write("\ - Select a component to see its description here."); - } - </script> - </div> - </td> - </tr> - </table> - + <th>Component</th> + <td> + <select name="component" id="component" size="5" onchange="PutDescription()"> + [% IF NOT default.component_ %] + [% default.component_ = "General" %] + [% END %] + [% FOREACH c = product.components %] + [% NEXT IF NOT c.is_active %] + <option value="[% c.name FILTER html %]" + [%+ 'selected="selected"' IF c.name == default.component_ %]> + [% c.name FILTER html %] + </option> + [% END %] + </select> + + <div id="description" class="comment bz_default_hidden"> + Select a component to see its description here. + </div> + <p> The area where the problem occurs. To pick the right component, you could use the same one as similar [% terms.bugs %] you found in your search, or read the full list of - <a target="_blank" href="describecomponents.cgi?product= - [% product.name FILTER uri %]">component - descriptions</a> (opens in new window) if you need more help. + <a href="describecomponents.cgi?product=[% product.name FILTER uri %]" + target="_blank" >component descriptions</a> (opens in new window) if + you need more help. </p> </td> </tr> - <tr bgcolor="[% tablecolour %]"> - <td align="right" valign="top"> - <b>[% field_descs.rep_platform FILTER html %]</b> - </td> - <td valign="top"> + [%# We override rep_platform and op_sys for simplicity. %] + [% rep_platform = [ "PC", "Macintosh", "All", "Other" ] %] + + <tr class="guided_form_field"> + <th>[% field_descs.rep_platform FILTER html %]</th> + <td> [% PROCESS select sel = 'rep_platform' %] </td> </tr> + [% op_sys = [ "Windows XP", "Windows Vista", "Windows 7", "Windows 8", + "Mac OS X", "Linux", "All", "Other" ] %] + <tr> - <td align="right" valign="top"> - <b>Operating System</b> - </td> - <td valign="top"> + <th>Operating System</th> + <td> [% PROCESS select sel = 'op_sys' %] </td> </tr> - <tr bgcolor="[% tablecolour %]"> - <td align="right" valign="top"> - <b>URL</b> + [%# Accept URL parameter build ID for non-browser products %] + [% IF cgi.param("buildid") %] + [% buildid = cgi.param("buildid") %] + [% END %] + + <tr class="guided_form_field"> + <th>Build Identifier</th> + <td> + <input type="text" size="80" name="buildid" value="[% buildid FILTER html %]"> + <p> + This should identify the exact version of the product you were using. + If the above field is blank or you know it is incorrect, copy the + version text from the product's Help | + About menu (for browsers this will begin with "Mozilla/5.0..."). + If the product won't start, instead paste the complete URL you downloaded + it from. + </p> </td> - <td valign="top"> + </tr> + + <tr> + <th>URL</th> + <td> <input type="text" size="80" name="bug_file_loc" value="http://"> <p> - URL that demonstrates the problem you are seeing (optional).<br> - <span style="color: red">You should never use URL to point to pastebins - for error messages, logs, emerge --info output, screenshots or similar - information.<br>Instead, these should always be attached to the - bug.</span> + URL that demonstrates the problem you are seeing (optional). </p> </td> </tr> - <tr> - <td align="right" valign="top"> - <b>Summary</b> - </td> - <td valign="top"> + <tr class="guided_form_field"> + <th>Summary</th> + <td> <input type="text" size="80" name="short_desc" id="short_desc" maxlength="255" spellcheck="true"> <p> A sentence which summarises the problem. Please be descriptive and use lots of keywords. - Include the <b>full</b> package atom with the version! </p> <p> - <tt> - <font color="#990000">Bad example</font>: mail crashed - </tt> + <kbd> + <span class="bad">Bad example</span>: mail crashed + </kbd> <br> - <tt> - <font color="#009900">Good example</font>: - mail-client/evolution-2.8.3-r2: crash if I close the mail window while checking for new POP mail - </tt> + <kbd> + <span class="good">Good example</span>: + crash if I close the mail window while checking for new POP mail + </kbd> </p> </td> </tr> - <tr bgcolor="[% tablecolour %]"> - <td align="right" valign="top"> - <b>Description</b> - </td> - <td valign="top"> + <tr> + <th>Details</th> + <td> [% INCLUDE global/textarea.html.tmpl - name = 'comment' - minrows = 6 - cols = constants.COMMENT_COLS + name = 'comment' + minrows = 6 + cols = constants.COMMENT_COLS + mandatory = 1 %] <p> Expand on the Summary. Please be as specific as possible about what is wrong. </p> <p> - <tt> - <font color="#990000">Bad example</font>: Mozilla crashed. + <kbd> + <span class="bad">Bad example</span>: Mozilla crashed. You suck! - </tt> + </kbd> <br> - <tt> - <font color="#009900">Good example</font>: After a crash which + <kbd> + <span class="good">Good example</span>: After a crash which happened when I was sorting in the Bookmark Manager,<br> all of my top-level bookmark folders beginning with the letters Q to Z are no longer present. - </tt> + </kbd> </p> </td> </tr> - <tr> - <td align="right" valign="top"> - <b>Reproducibility</b> - </td> - <td valign="top"> + <tr class="guided_form_field"> + <th>Reproducibility</th> + <td> <select name="reproducible"> <option name="AlwaysReproducible" value="Always"> Happens every time. @@ -300,11 +265,9 @@ function PutDescription() { </td> </tr> - <tr bgcolor="[% tablecolour %]"> - <td align="right" valign="top"> - <b>Steps to Reproduce</b> - </td> - <td valign="top"> + <tr> + <th>Steps to Reproduce</th> + <td> [% INCLUDE global/textarea.html.tmpl name = 'reproduce_steps' minrows = 4 @@ -318,11 +281,9 @@ function PutDescription() { </td> </tr> - <tr> - <td valign="top" align="right"> - <b>Actual Results</b> - </td> - <td valign="top"> + <tr class="guided_form_field"> + <th>Actual Results</th> + <td> [% INCLUDE global/textarea.html.tmpl name = 'actual_results' minrows = 4 @@ -334,11 +295,9 @@ function PutDescription() { </td> </tr> - <tr bgcolor="[% tablecolour %]"> - <td valign="top" align="right"> - <b>Expected Results</b> - </td> - <td valign="top"> + <tr> + <th>Expected Results</th> + <td> [% INCLUDE global/textarea.html.tmpl name = 'expected_results' minrows = 4 @@ -350,36 +309,39 @@ function PutDescription() { </td> </tr> - <tr> - <td valign="top" align="right"> - <b>Additional Information</b> - </td> - <td valign="top"> + <tr class="guided_form_field"> + <th>Additional Information</th> + <td> [% INCLUDE global/textarea.html.tmpl name = 'additional_info' minrows = 8 cols = constants.COMMENT_COLS %] <p> - Add any additional information you feel may be relevant to this - [% terms.bug %], such as what other <b>programs you had running</b>, and/or - information about <b>your computer's configuration</b>. Any information longer - than a few lines, such as a <b>stack trace</b>, should be added using the - "Create a new Attachment" link on the bug, after it is filed.<br /> - <b>Please paste all information from 'emerge --info' in this section!</b> + Add any additional information you feel may be + relevant to this [% terms.bug %], such as the <b>theme</b> you were + using (does the [% terms.bug %] still occur + with the default theme?), or special + information about <b>your computer's configuration</b>. Any information + longer than a few lines, such as a <b>stack trace</b> or <b>HTML + testcase</b>, should be added + using the "Add an Attachment" link on the [% terms.bug %], after + it is filed. If you believe that it's relevant, please also include + your build configuration, obtained by typing <kbd>about:buildconfig</kbd> + into your URL bar. + <br> + <br> + If you are reporting a crash, note the module in + which the software crashed (e.g., <kbd>Application Violation in + gkhtml.dll</kbd>). </p> </td> </tr> - <tr bgcolor="[% tablecolour %]"> - <td valign="top" align="right"> - <b>[% field_descs.bug_severity FILTER html %]</b> - </td> - <td valign="top"> + <tr> + <th>[% field_descs.bug_severity FILTER html %]</th> + <td> <select name="bug_severity"> - <option name="blocker" value="blocker"> - Blocker: Blocks development and/or testing work of Gentoo as a whole - </option> <option name="critical" value="critical"> Critical: The software crashes, hangs, or causes you to lose data. @@ -398,8 +360,7 @@ function PutDescription() { misaligned text. </option> <option name="enhancement" value="enhancement"> - Enhancement: Request for new feature or enhancement, including ebuild - submissions. + Enhancement: Request for new feature or enhancement. </option> </select> <p> @@ -416,11 +377,7 @@ function PutDescription() { <h3 id="step3">Step 3 of 3 - submit the [% terms.bug %] report</h3> <p> - <input type="submit" id="report" value=" Submit [% terms.Bug %] Report " - onclick="if (this.form.comment.value == '') - { alert('Please enter some details about this [% terms.bug %].'); - this.form.comment.focus(); - return false; } return true;"> + <input type="submit" id="report" value="Submit [% terms.Bug %] Report"> </p> <p> diff --git a/template/en/default/bug/create/create.html.tmpl b/template/en/default/bug/create/create.html.tmpl index 4b0911f0e..3e25e9c29 100644 --- a/template/en/default/bug/create/create.html.tmpl +++ b/template/en/default/bug/create/create.html.tmpl @@ -7,15 +7,16 @@ #%] [% title = BLOCK %]Enter [% terms.Bug %]: [% product.name FILTER html %][% END %] +[% use_qa_contact = Param("useqacontact") %] [% PROCESS global/header.html.tmpl title = title + generate_api_token = 1 yui = [ 'autocomplete', 'calendar', 'datatable', 'button' ] - style_urls = [ 'skins/standard/attachment.css', - 'skins/standard/enter_bug.css' ] + style_urls = ['skins/standard/bug.css'] javascript_urls = [ "js/attachment.js", "js/util.js", "js/field.js", "js/TUI.js", "js/bug.js" ] - onload = "set_assign_to(); hideElementById('attachment_true'); + onload = "set_assign_to($use_qa_contact); hideElementById('attachment_true'); showElementById('attachment_false'); showElementById('btn_no_attachment');" %] @@ -61,77 +62,6 @@ var flags = new Array([% product.components.size %]); [% count = count + 1 %] [%- END %] -function set_assign_to() { - // Based on the selected component, fill the "Assign To:" field - // with the default component owner, and the "QA Contact:" field - // with the default QA Contact. It also selectively enables flags. - var form = document.Create; - var assigned_to = form.assigned_to.value; - -[% IF Param("useqacontact") %] - var qa_contact = form.qa_contact.value; -[% END %] - - var index = -1; - if (form.component.type == 'select-one') { - index = form.component.selectedIndex; - } else if (form.component.type == 'hidden') { - // Assume there is only one component in the list - index = 0; - } - if (index != -1) { - var owner = initialowners[index]; - var component = components[index]; - if (assigned_to == last_initialowner - || assigned_to == owner - || assigned_to == '') { - form.assigned_to.value = owner; - last_initialowner = owner; - } - - document.getElementById('initial_cc').innerHTML = initialccs[index]; - document.getElementById('comp_desc').innerHTML = comp_desc[index]; - - [% IF Param("useqacontact") %] - var contact = initialqacontacts[index]; - if (qa_contact == last_initialqacontact - || qa_contact == contact - || qa_contact == '') { - form.qa_contact.value = contact; - last_initialqacontact = contact; - } - [% END %] - - // We show or hide the available flags depending on the selected component. - var flag_rows = YAHOO.util.Dom.getElementsByClassName('bz_flag_type', 'tbody'); - for (var i = 0; i < flag_rows.length; i++) { - // Each flag table row should have one flag form select element - // We get the flag type id from the id attribute of the select. - var flag_select = YAHOO.util.Dom.getElementsByClassName('flag_select', - 'select', - flag_rows[i])[0]; - var type_id = flag_select.id.split('-')[1]; - var can_set = flag_select.options.length > 1 ? 1 : 0; - var show = 0; - // Loop through the allowed flag ids for the selected component - // and if we match, then show the row, otherwise hide the row. - for (var j = 0; j < flags[index].length; j++) { - if (flags[index][j] == type_id) { - show = 1; - break; - } - } - if (show && can_set) { - flag_select.disabled = false; - YAHOO.util.Dom.removeClass(flag_rows[i], 'bz_default_hidden'); - } else { - flag_select.disabled = true; - YAHOO.util.Dom.addClass(flag_rows[i], 'bz_default_hidden'); - } - } - } -} - var status_comment_required = new Array(); [% FOREACH status = bug_status %] status_comment_required['[% status.name FILTER js %]'] = @@ -200,7 +130,7 @@ TUI_hide_default('attachment_text_field'); desc_url = component_desc_url %] <td id="field_container_component"> - <select name="component" id="component" onchange="set_assign_to();" + <select name="component" id="component" onchange="set_assign_to([% Param("useqacontact") %]);" size="7" aria-required="true" class="required"> [%# Build the lists of assignees and QA contacts if "usemenuforusers" is enabled. %] [% IF Param("usemenuforusers") %] @@ -212,7 +142,7 @@ TUI_hide_default('attachment_text_field'); [% NEXT IF NOT c.is_active %] <option value="[% c.name FILTER html %]" id="v[% c.id FILTER html %]_component" - [% IF c.name == default.component_ %] + [% IF c.name.lower == default.component_.lower %] [%# This is for bug/field.html.tmpl, for visibility-related # controls. %] [% default.component_id = c.id %] @@ -255,9 +185,9 @@ TUI_hide_default('attachment_text_field'); <tr> [% INCLUDE "bug/field-label.html.tmpl" - field = bug_fields.version editable = 1 rowspan = 3 + field = bug_fields.version editable = 1 rowspan = 4 %] - <td rowspan="3"> + <td rowspan="4"> <select name="version" id="version" size="5" aria-required="true" class="required"> [%- FOREACH v = version %] @@ -274,6 +204,16 @@ TUI_hide_default('attachment_text_field'); value = default.bug_severity %] </tr> + <tr class="expert_fields"> + [% IF Param('letsubmitterchoosepriority') %] + [% INCLUDE bug/field.html.tmpl + bug = default, field = bug_fields.priority, editable = 1, + value = default.priority %] + [% ELSE %] + <td colspan="2"> </td> + [% END %] + </tr> + <tr> [% INCLUDE bug/field.html.tmpl bug = default, field = bug_fields.rep_platform, editable = 1, @@ -287,7 +227,8 @@ TUI_hide_default('attachment_text_field'); </tr> [% IF (!Param('defaultplatform') || !Param('defaultopsys')) && !cloned_bug_id %] <tr> - <th colspan="3"> </th> + <td colspan="2" class="expert_fields"> </td> + <td> </td> <td id="os_guess_note" class="comment"> <div>We've made a guess at your [% IF Param('defaultplatform') %] @@ -311,13 +252,7 @@ TUI_hide_default('attachment_text_field'); <td colspan="2"> </td> [% END %] - [% IF Param('letsubmitterchoosepriority') %] - [% INCLUDE bug/field.html.tmpl - bug = default, field = bug_fields.priority, editable = 1, - value = default.priority %] - [% ELSE %] - <td colspan="2"> </td> - [% END %] + <td colspan="2"> </td> </tr> </tbody> @@ -334,7 +269,7 @@ TUI_hide_default('attachment_text_field'); <td> </td> [%# Calculate the number of rows we can use for flags %] - [% num_rows = 7 + (Param("useqacontact") ? 1 : 0) + + [% num_rows = 6 + (Param("useqacontact") ? 1 : 0) + (user.is_timetracker ? 3 : 0) %] @@ -460,7 +395,7 @@ TUI_hide_default('attachment_text_field'); [% INCLUDE "bug/field-label.html.tmpl" field = bug_fields.bug_file_loc editable = 1 %] - <td colspan="2" class="field_value"> + <td colspan="3" class="field_value"> <input name="bug_file_loc" id="bug_file_loc" class="text_input" size="40" value="[% bug_file_loc FILTER html %]"> </td> @@ -494,7 +429,8 @@ TUI_hide_default('attachment_text_field'); </td> </tr> - [% IF feature_enabled('jsonrpc') AND !cloned_bug_id %] + [% IF feature_enabled('jsonrpc') AND !cloned_bug_id + AND user.settings.possible_duplicates.value == 'on' %] <tr id="possible_duplicates_container" class="bz_default_hidden"> <th>Possible<br>Duplicates:</th> <td colspan="3"> @@ -543,9 +479,7 @@ TUI_hide_default('attachment_text_field'); # by global/textarea.html.tmpl. So we must not escape the comment here. %] [% comment FILTER none %] [%- END %] - [% INCLUDE global/textarea.html.tmpl - name = 'comment' - id = 'comment' + [% INCLUDE bug/comment.html.tmpl minrows = 10 maxrows = 25 cols = constants.COMMENT_COLS @@ -567,11 +501,11 @@ TUI_hide_default('attachment_text_field'); Make description and any new attachment private (visible only to members of the <strong>[% Param('insidergroup') FILTER html %]</strong> group) </label> - <script> - updateCommentTagControl(document.getElementById('comment_is_private'), 'comment'); - </script> </td> </tr> + <script> + updateCommentTagControl(document.getElementById('comment_is_private'), 'comment'); + </script> [% END %] [% IF Param("maxattachmentsize") || Param("maxlocalattachment") %] @@ -601,17 +535,17 @@ TUI_hide_default('attachment_text_field'); </tbody> <tbody class="expert_fields"> + [% IF use_keywords %] + <tr> + [% INCLUDE bug/field.html.tmpl + bug = default, field = bug_fields.keywords, editable = 1, + value = keywords, possible_values = all_keywords, + desc_url = "describekeywords.cgi", value_span = 3 + %] + </tr> + [% END %] + [% IF user.in_group('editbugs', product.id) %] - [% IF use_keywords %] - <tr> - [% INCLUDE bug/field.html.tmpl - bug = default, field = bug_fields.keywords, editable = 1, - value = keywords, possible_values = all_keywords, - desc_url = "describekeywords.cgi", value_span = 2 - %] - </tr> - [% END %] - <tr> [% INCLUDE "bug/field-label.html.tmpl" field = bug_fields.dependson editable = 1 @@ -629,6 +563,17 @@ TUI_hide_default('attachment_text_field'); </td> </tr> [% END %] + + [% IF Param('use_see_also') %] + <tr> + [% INCLUDE bug/field.html.tmpl + bug = default + field = bug_fields.see_also + editable = 1 + value = see_also + %] + </tr> + [% END %] </tbody> <tbody class="expert_fields"> @@ -638,13 +583,13 @@ TUI_hide_default('attachment_text_field'); <td colspan="3"> <br> <strong> - Only users in all of the selected groups can view this + Only users in [%+ IF Param('or_groups') %]at least one[% ELSE %]all[% END %] of the selected groups can view this [%+ terms.bug %]: </strong> <br> - <font size="-1"> + <span class="bz_info"> (Leave all boxes unchecked to make this a public [% terms.bug %].) - </font> + </span> <br> <br> diff --git a/template/en/default/bug/create/make-template.html.tmpl b/template/en/default/bug/create/make-template.html.tmpl index 4b1b0c084..31f255f81 100644 --- a/template/en/default/bug/create/make-template.html.tmpl +++ b/template/en/default/bug/create/make-template.html.tmpl @@ -12,7 +12,7 @@ #%] [% PROCESS global/header.html.tmpl - title = "Bookmarks are your friend" + title = "Bookmark For $terms.Bug Entry" header = "Template constructed" %] diff --git a/template/en/default/bug/dependency-graph.html.tmpl b/template/en/default/bug/dependency-graph.html.tmpl index 153cebdfa..69afa2ddf 100644 --- a/template/en/default/bug/dependency-graph.html.tmpl +++ b/template/en/default/bug/dependency-graph.html.tmpl @@ -51,7 +51,7 @@ <form action="showdependencygraph.cgi" method="GET"> <table> <tr> - <th align="left"><label for="id">[% terms.Bug %] numbers</label>:</th> + <th><label for="id">[% terms.Bug %] numbers</label>:</th> <td><input id="id" name="id" value="[% bug_id %]"></td> <td> <input type="checkbox" id="showsummary" name="showsummary" [% " checked" IF showsummary %]> @@ -60,7 +60,7 @@ </tr> <tr> - <th align="left"><label for="display">Display:</label></th> + <th><label for="display">Display:</label></th> <td colspan="2"> <select id="display" name="display"> <option value="tree"[% 'selected="selected"' IF (!display || display == "tree") %]> @@ -72,7 +72,7 @@ </tr> <tr> - <th align="left"><label for="rankdir">Orientation:</label></th> + <th><label for="rankdir">Orientation:</label></th> <td colspan="2"> <select id="rankdir" name="rankdir"> <option value="TB"[% " selected" IF rankdir == "TB" %]>Top to bottom</option> diff --git a/template/en/default/bug/dependency-tree.html.tmpl b/template/en/default/bug/dependency-tree.html.tmpl index f53663685..606ab78f7 100644 --- a/template/en/default/bug/dependency-tree.html.tmpl +++ b/template/en/default/bug/dependency-tree.html.tmpl @@ -12,9 +12,9 @@ header = "Dependency tree for <a href=\"show_bug.cgi?id=$bugid\">$terms.Bug $bugid</a>" javascript_urls = ["js/expanding-tree.js"] - style_urls = ["skins/standard/dependency-tree.css"] - subheader = filtered_desc - doc_section = "hintsandtips.html#dependencytree" + style_urls = ['skins/standard/bug.css'] + subheader = filtered_desc + doc_section = "using/understanding.html" %] [% PROCESS depthControlToolbar %] @@ -165,13 +165,12 @@ [%###########################################################################%] [% BLOCK depthControlToolbar %] - <table cellpadding="3" border="0" cellspacing="0" bgcolor="#e0e0e0"> + <table class="dependency_tree_controls"> <tr> [%# Hide/show resolved button Swaps text depending on the state of hide_resolved %] - <td align="center"> - <form method="get" action="showdependencytree.cgi" - style="display: inline; margin: 0px;"> + <td> + <form method="get" action="showdependencytree.cgi"> <input name="id" type="hidden" value="[% bugid %]"> [% IF maxdepth %] <input name="maxdepth" type="hidden" value="[% maxdepth %]"> @@ -191,11 +190,9 @@ </td> <td> - <form method="get" action="showdependencytree.cgi" - style="display: inline; margin: 0px;"> + <form method="get" action="showdependencytree.cgi"> [%# set to one form %] - <input type="submit" id="change_maxdepth" - value=" 1 " + <input type="submit" id="change_maxdepth" value="1" [% "disabled" IF realdepth < 2 || maxdepth == 1 %]> <input name="id" type="hidden" value="[% bugid %]"> <input name="maxdepth" type="hidden" value="1"> @@ -204,8 +201,7 @@ </td> <td> - <form method="get" action="showdependencytree.cgi" - style="display: inline; margin: 0px;"> + <form method="get" action="showdependencytree.cgi"> [%# Minus one form Allow subtracting only when realdepth and maxdepth > 1 %] <input name="id" type="hidden" value="[% bugid %]"> @@ -214,14 +210,13 @@ : ( maxdepth ? maxdepth - 1 : realdepth - 1 ) %]"> <input name="hide_resolved" type="hidden" value="[% hide_resolved %]"> - <input type="submit" id="decrease_depth" value=" < " + <input type="submit" id="decrease_depth" value="<" [% "disabled" IF realdepth < 2 || ( maxdepth && maxdepth < 2 ) %]> </form> </td> <td> - <form method="get" action="showdependencytree.cgi" - style="display: inline; margin: 0px;"> + <form method="get" action="showdependencytree.cgi"> [%# Limit entry form: the button cannot do anything when total depth is less than two, so disable it %] <input name="maxdepth" size="4" maxlength="4" value="[% @@ -237,8 +232,7 @@ </td> <td> - <form method="get" action="showdependencytree.cgi" - style="display: inline; margin: 0px;"> + <form method="get" action="showdependencytree.cgi"> [%# plus one form Disable button if total depth < 2, or if depth set to unlimited %] <input name="id" type="hidden" value="[% bugid %]"> @@ -246,19 +240,18 @@ <input name="maxdepth" type="hidden" value="[% maxdepth + 1 %]"> [% END %] <input name="hide_resolved" type="hidden" value="[% hide_resolved %]"> - <input type="submit" id="increase_depth" value=" > " + <input type="submit" id="increase_depth" value=">" [% "disabled" IF realdepth < 2 || !maxdepth || maxdepth >= realdepth %]> </form> </td> <td> - <form method="get" action="showdependencytree.cgi" - style="display: inline; margin: 0px;"> + <form method="get" action="showdependencytree.cgi"> [%# Unlimited button %] <input name="id" type="hidden" value="[% bugid %]"> <input name="hide_resolved" type="hidden" value="[% hide_resolved %]"> <input type="submit" id="remove_limit" - value=" Unlimited " + value="Unlimited" [% "disabled" IF maxdepth == 0 || maxdepth == realdepth %]> </form> </td> diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl index 49e443f6a..e1ce3fffe 100644 --- a/template/en/default/bug/edit.html.tmpl +++ b/template/en/default/bug/edit.html.tmpl @@ -8,26 +8,42 @@ [% PROCESS bug/time.html.tmpl %] +[% IF Param('comment_taggers_group') %] + [% IF user.can_tag_comments %] + <div id="bz_ctag_div" class="bz_default_hidden"> + <a href="javascript:void(0)" onclick="YAHOO.bugzilla.commentTagging.hideInput()">x</a> + <div> + <input id="bz_ctag_add" size="10" placeholder="add tag" + maxlength="[% constants.MAX_COMMENT_TAG_LENGTH FILTER html %]"> + <span id="bz_ctag_autocomp"></span> + </div> + + </div> + <div id="bz_ctag_error" class="bz_default_hidden"> + <a href="javascript:void(0)" onclick="YAHOO.bugzilla.commentTagging.hideError()">x</a> + <span id="bz_ctag_error_msg"></span> + </div> + [% END %] + [% IF user.id %] + <script type="text/javascript"> + YAHOO.bugzilla.commentTagging.init([% user.can_tag_comments ? 'true' : 'false' %]); + YAHOO.bugzilla.commentTagging.min_len = [% constants.MIN_COMMENT_TAG_LENGTH FILTER js %]; + YAHOO.bugzilla.commentTagging.max_len = [% constants.MAX_COMMENT_TAG_LENGTH FILTER js %]; + YAHOO.bugzilla.commentTagging.label = 'Comment Tags:'; + YAHOO.bugzilla.commentTagging.min_len_error = + 'Comment tags must be at least + [%~ " " _ constants.MIN_COMMENT_TAG_LENGTH FILTER js %] characters.'; + YAHOO.bugzilla.commentTagging.max_len_error = + 'Comment tags cannot be longer than + [%~ " " _ constants.MAX_COMMENT_TAG_LENGTH FILTER js %] characters.'; + </script> + [% END %] +[% END %] + <script type="text/javascript"> <!-- [% IF user.is_timetracker %] - var fRemainingTime = [% bug.remaining_time %]; // holds the original value - function adjustRemainingTime() { - // subtracts time spent from remaining time - var new_time; - - // prevent negative values if work_time > fRemainingTime - new_time = - Math.max(fRemainingTime - document.changeform.work_time.value, 0.0); - // get upto 2 decimal places - document.changeform.remaining_time.value = - Math.round(new_time * 100)/100; - } - - function updateRemainingTime() { - // if the remaining time is changed manually, update fRemainingTime - fRemainingTime = document.changeform.remaining_time.value; - } + var bz_remaining_time = [% bug.remaining_time %]; [% END %] [% IF user.id %] @@ -46,7 +62,6 @@ <form name="changeform" id="changeform" method="post" action="process_bug.cgi"> <input type="hidden" name="delta_ts" value="[% bug.delta_ts %]"> - <input type="hidden" name="longdesclength" value="[% bug.comments.size %]"> <input type="hidden" name="id" value="[% bug.bug_id %]"> <input type="hidden" name="token" value="[% issue_hash_token([bug.id, bug.delta_ts]) FILTER html %]"> @@ -58,15 +73,19 @@ <table> [%# *** ID, product, component, status, resolution, Hardware, and OS *** %] [% PROCESS section_status %] - + [% PROCESS section_spacer %] - + + [% PROCESS section_aliases %] + + [% PROCESS section_spacer %] + [% PROCESS section_details1 %] [% PROCESS section_spacer %] - [%# *** severity, priority, version and milestone *** %] - [% PROCESS section_details2 %] + [%# *** severity, priority, version, milestone, and deadline *** %] + [% PROCESS section_details2 %] [%# *** assigned to and qa contact *** %] [% PROCESS section_people %] @@ -89,22 +108,24 @@ </td> [%# 2nd Column %] <td id="bz_show_bug_column_2" class="bz_show_bug_column"> - <table cellpadding="3" cellspacing="1"> + <table> [%# *** Reported and modified dates *** %] [% PROCESS section_dates %] - + [% PROCESS section_cclist %] - + + [% PROCESS section_bug_ignored %] + [% PROCESS section_spacer %] [% PROCESS section_see_also %] - + [% PROCESS section_customfields %] - + [% PROCESS section_spacer %] - + [% Hook.process("after_custom_fields") %] - + [% PROCESS section_flags %] </table> @@ -117,7 +138,8 @@ </tr> </table> - <table id="bz_big_form_parts" cellspacing="0" cellpadding="0"><tr> + <table id="bz_big_form_parts"> + <tr> <td> [% IF user.is_timetracker %] [% PROCESS section_timetracking %] @@ -162,61 +184,38 @@ [% BLOCK section_title %] [%# That's the main table, which contains all editable fields. %] - <div class="bz_alias_short_desc_container edit_form"> + <div class="bz_short_desc_container edit_form"> [% PROCESS commit_button id="_top"%] <a href="show_bug.cgi?id=[% bug.bug_id %]"> [%-# %]<b>[% terms.Bug %] [% bug.bug_id FILTER html %]</b> - [%-# %]</a> -<span id="summary_alias_container" class="bz_default_hidden"> - [% IF bug.alias != "" %] - (<span id="alias_nonedit_display">[% bug.alias FILTER html %]</span>) + [%-# %]</a> <span id="summary_container" class="bz_default_hidden"> + [% IF bug.alias.size > 0 %] + (<span id="alias_nonedit_display">[% bug.alias.join(', ') FILTER html %]</span>) [% END %] - <span id="short_desc_nonedit_display">[% bug.short_desc FILTER quoteUrls(bug) %]</span> - [% IF bug.check_can_change_field('short_desc', 0, 1) || - bug.check_can_change_field('alias', 0, 1) %] - <small class="editme">(<a href="#" id="editme_action">edit</a>)</small> + - <span id="short_desc_nonedit_display">[% bug.short_desc FILTER quoteUrls(bug) %]</span> + [% can_edit_short_desc = bug.check_can_change_field('short_desc', 0, 1) %] + [% IF can_edit_short_desc %] + <small>(<a href="#" id="summary_edit_action">edit</a>)</small> [% END %] </span> - - - <div id="summary_alias_input"> - <table id="summary"> - <tr> - [% IF bug.check_can_change_field('alias', 0, 1) %] - [% INCLUDE "bug/field-label.html.tmpl" - field = bug_fields.alias - editable = 1 - %] - <td> - [% ELSIF bug.alias %] - <td colspan="2">( - [% ELSE %] - <td colspan="2"> - [% END %] - [% PROCESS input inputname => "alias" - size => "20" - maxlength => "20" - no_td => 1 - %][% ")" IF NOT bug.check_can_change_field('alias', 0, 1) - && bug.alias %] - </td> - </tr> - [%# *** Summary *** %] - <tr> - [% INCLUDE "bug/field-label.html.tmpl" - field = bug_fields.short_desc - editable = 1 - accesskey = "s" - %] - <td> - [% PROCESS input inputname => "short_desc" size => "80" colspan => 2 - maxlength => 255 spellcheck => "true" no_td => 1 %] - </td> - </tr> - </table> + + <div id="summary_input"> + [% INCLUDE "bug/field-label.html.tmpl" + field = bug_fields.short_desc + editable = can_edit_short_desc + accesskey = "s" + tag_name = 'span' + %] + [% PROCESS input inputname => "short_desc" size => "80" + maxlength => 255 spellcheck => "true" no_td => 1 %] </div> </div> <script type="text/javascript"> - hideAliasAndSummary('[% bug.short_desc FILTER js %]', '[% bug.alias FILTER js %]'); + hideEditableField('summary_container', + 'summary_input', + 'summary_edit_action', + 'short_desc', + '[% bug.short_desc FILTER js %]' ); </script> [% END %] @@ -230,11 +229,20 @@ [%# PRODUCT #%] [%#############%] <tr> - [% INCLUDE bug/field.html.tmpl - bug = bug, field = bug_fields.product, - override_legal_values = bug.choices.product - desc_url = 'describecomponents.cgi', value = bug.product - editable = bug.check_can_change_field('product', 0, 1) %] + [% INCLUDE "bug/field-label.html.tmpl" + field = bug_fields.product + desc_url = 'describecomponents.cgi' + value = bug.product + %] + <td class="field_value" id="field_container_product"> + [% INCLUDE "global/product-select.html.tmpl" + id => "product" + name => "product" + value => bug.product + products => bug.choices.product + isselect => bug.check_can_change_field('product', 0, 1) + %] + </td> </tr> [%# Classification is here so that it can be used in value controllers @@ -262,22 +270,26 @@ </tr> <tr> [% INCLUDE "bug/field-label.html.tmpl" - field = bug_fields.version editable = 1 %] - + field = bug_fields.version + editable = bug.check_can_change_field('version', 0, 1) %] + [% PROCESS select selname => "version" %] </tr> [%############%] [%# PLATFORM #%] [%############%] <tr> + [% can_edit_rep_platform = bug.check_can_change_field('rep_platform', 0, 1) %] [% INCLUDE "bug/field-label.html.tmpl" - field = bug_fields.rep_platform, editable = 1, accesskey = "h" %] + field = bug_fields.rep_platform, + editable = can_edit_rep_platform, + accesskey = "h" %] <td class="field_value"> - [% INCLUDE bug/field.html.tmpl + [% INCLUDE bug/field.html.tmpl bug = bug, field = bug_fields.rep_platform, no_tds = 1, value = bug.rep_platform - editable = bug.check_can_change_field('rep_platform', 0, 1) %] - [%+ INCLUDE bug/field.html.tmpl + editable = can_edit_rep_platform %] + [%+ INCLUDE bug/field.html.tmpl bug = bug, field = bug_fields.op_sys, no_tds = 1, value = bug.op_sys editable = bug.check_can_change_field('op_sys', 0, 1) %] @@ -326,14 +338,15 @@ [%###############################################################%] <tr> <th class="field_label"> - <label for="priority" accesskey="i"> + [% can_edit_priority = bug.check_can_change_field('priority', 0, 1) %] + <label [% IF can_edit_priority %]for="priority"[% END %] accesskey="i"> <a href="page.cgi?id=fields.html#importance"><u>I</u>mportance</a></label>: </th> <td> [% INCLUDE bug/field.html.tmpl bug = bug, field = bug_fields.priority, no_tds = 1, value = bug.priority - editable = bug.check_can_change_field('priority', 0, 1) %] + editable = can_edit_priority %] [%+ INCLUDE bug/field.html.tmpl bug = bug, field = bug_fields.bug_severity, no_tds = 1, value = bug.bug_severity @@ -344,15 +357,22 @@ [% IF Param("usetargetmilestone") && bug.target_milestone %] <tr> + [% INCLUDE "bug/field-label.html.tmpl" + field = bug_fields.target_milestone + editable = bug.check_can_change_field('target_milestone', 0, 1) + %] + [% PROCESS select selname = "target_milestone" %] + </tr> + [% END %] + + [% IF Param("timetrackinggroup") && bug.deadline %] + <tr> <th class="field_label"> - <label for="target_milestone"> - <a href="page.cgi?id=fields.html#target_milestone"> - Target Milestone</a></label>: + <a href="page.cgi?id=fields.html#deadline">Deadline</a>: </th> - [% PROCESS select selname = "target_milestone" %] + <td>[% bug.deadline FILTER html %]</td> </tr> [% END %] - [% END %] [%############################################################################%] @@ -362,11 +382,13 @@ [% BLOCK section_people %] <tr> - <th class="field_label"> - <a href="page.cgi?id=fields.html#assigned_to">Assigned To</a>: - </th> + [% can_edit_assigned_to = bug.check_can_change_field("assigned_to", 0, 1) %] + [% INCLUDE "bug/field-label.html.tmpl" + field = bug_fields.assigned_to + editable = can_edit_assigned_to + %] <td> - [% IF bug.check_can_change_field("assigned_to", 0, 1) %] + [% IF can_edit_assigned_to %] <div id="bz_assignee_edit_container" class="bz_default_hidden"> <span> [% INCLUDE global/user.html.tmpl who = bug.assigned_to %] @@ -411,13 +433,14 @@ [% IF Param('useqacontact') %] <tr> + [% can_edit_qa_contact = bug.check_can_change_field("qa_contact", 0, 1) %] [% INCLUDE "bug/field-label.html.tmpl" field = bug_fields.qa_contact - editable = 1 + editable = can_edit_qa_contact accesskey = "q" %] <td> - [% IF bug.check_can_change_field("qa_contact", 0, 1) %] + [% IF can_edit_qa_contact %] <div id="bz_qa_contact_edit_container" class="bz_default_hidden"> <span> [% INCLUDE global/user.html.tmpl who = bug.qa_contact %] @@ -473,17 +496,18 @@ [%############################################################################%] [% BLOCK section_url_keyword_whiteboard %] <tr> + [% can_edit_bug_file_loc = bug.check_can_change_field("bug_file_loc", 0, 1) %] [% INCLUDE "bug/field-label.html.tmpl" field = bug_fields.bug_file_loc - editable = 1 + editable = can_edit_bug_file_loc accesskey = "u" %] <td> - [% IF bug.check_can_change_field("bug_file_loc", 0, 1) %] + [% IF can_edit_bug_file_loc %] <span id="bz_url_edit_container" class="bz_default_hidden"> [% IF is_safe_url(bug.bug_file_loc) %] <a href="[% bug.bug_file_loc FILTER html %]" target="_blank" - title="[% bug.bug_file_loc FILTER html %]"> + rel="noreferrer" title="[% bug.bug_file_loc FILTER html %]"> [% bug.bug_file_loc FILTER truncate(40) FILTER html %]</a> [% ELSE %] [% bug.bug_file_loc FILTER html %] @@ -491,10 +515,11 @@ (<a href="#" id="bz_url_edit_action">edit</a>)</span> [% END %] <span id="bz_url_input_area"> - [% url_output = PROCESS input no_td=1 inputname => "bug_file_loc" size => "40" colspan => 2 %] + [% url_output = INCLUDE input no_td = 1 inputname = "bug_file_loc" size = 40 %] [% IF NOT bug.check_can_change_field("bug_file_loc", 0, 1) AND is_safe_url(bug.bug_file_loc) %] - <a href="[% bug.bug_file_loc FILTER html %]">[% url_output FILTER none %]</a> + <a href="[% bug.bug_file_loc FILTER html %]" + rel="noreferrer">[% url_output FILTER none %]</a> [% ELSE %] [% url_output FILTER none %] [% END %] @@ -510,31 +535,25 @@ [% END %] </td> </tr> - + [% IF Param('usestatuswhiteboard') %] <tr> [% INCLUDE "bug/field-label.html.tmpl" field = bug_fields.status_whiteboard - editable = 1 + editable = bug.check_can_change_field("status_whiteboard", 0, 1) accesskey = "w" %] - [% PROCESS input inputname => "status_whiteboard" size => "40" colspan => 2 %] + [% INCLUDE input inputname = "status_whiteboard" size = 40 %] </tr> [% END %] - + [% IF use_keywords %] <tr> - <th class="field_label"> - <label for="keywords" accesskey="k"> - <a href="describekeywords.cgi"><u>K</u>eywords</a></label>: - </th> - <td class="field_value" colspan="2"> [% INCLUDE bug/field.html.tmpl - bug = bug, field = bug_fields.keywords, value = bug.keywords - editable = bug.check_can_change_field("keywords", 0, 1), - no_tds = 1, possible_values = all_keywords + bug = bug, field = bug_fields.keywords, value = bug.keywords + editable = bug.check_can_change_field("keywords", 0, 1), + desc_url = "describekeywords.cgi", possible_values = all_keywords %] - </td> </tr> [% END %] @@ -556,12 +575,12 @@ [% RETURN UNLESS bug.duplicates.size %] <tr> <th class="field_label"> - <label for="duplicates">Duplicates</label>: + <label>Duplicates ([% bug.duplicates.size %])</label>: </th> - <td class="field_value" colspan="2"> + <td class="field_value"> <span id="duplicates"> [% FOREACH dupe = bug.duplicates %] - [% dupe.id FILTER bug_link(dupe, use_alias => 1) FILTER none %][% " " %] + [% INCLUDE bug/link.html.tmpl bug = dupe, link_text = dupe.id, use_alias = 1 %][% " " %] [% END %] </span> (<a href="buglist.cgi?bug_id=[% bug.duplicate_ids.join(",") FILTER html %]"> @@ -584,18 +603,20 @@ [% INCLUDE dependencies field = bug_fields.blocked deps = bug.blocks_obj %] </tr> - - <tr> - <th> </th> - - <td colspan="2" align="left" id="show_dependency_tree_or_graph"> - Show dependency <a href="showdependencytree.cgi?id=[% bug.bug_id %]&hide_resolved=1">tree</a> - - [% IF Param('webdotbase') %] - / <a href="showdependencygraph.cgi?id=[% bug.bug_id %]">graph</a> - [% END %] - </td> - </tr> + + [% IF bug.dependson.size || bug.blocked.size %] + <tr> + <th> </th> + + <td id="show_dependency_tree_or_graph"> + Show dependency <a href="showdependencytree.cgi?id=[% bug.bug_id %]&hide_resolved=1">tree</a> + + [% IF Param('webdotbase') %] + / <a href="showdependencygraph.cgi?id=[% bug.bug_id %]">graph</a> + [% END %] + </td> + </tr> + [% END %] [% END %] @@ -620,8 +641,9 @@ [% IF NOT emitted_description %] [% emitted_description = 1 %] <div id="bz_restrict_group_visibility_help"> - <b>Only users in all of the selected groups can view this - [%+ terms.bug %]:</b> + <b>Only users in + [%+ IF Param('or_groups') %]at least one[% ELSE %]all[% END %] + of the selected groups can view this [% terms.bug %]:</b> <p class="instructions"> Unchecking all boxes makes this a more public [% terms.bug %]. </p> @@ -705,7 +727,7 @@ Reported: </th> <td> - [% bug.creation_ts FILTER time %] by [% INCLUDE global/user.html.tmpl who = bug.reporter %] + [% bug.creation_ts FILTER time("%Y-%m-%d %H:%M %Z") %] by [% INCLUDE global/user.html.tmpl who = bug.reporter %] </td> </tr> @@ -714,7 +736,7 @@ Modified: </th> <td> - [% bug.delta_ts FILTER time FILTER replace(':\d\d$', '') FILTER replace(':\d\d ', ' ')%] + [% bug.delta_ts FILTER time("%Y-%m-%d %H:%M %Z") %] (<a href="show_activity.cgi?id=[% bug.bug_id %]">[%# terms.Bug %]History</a>) </td> @@ -727,7 +749,9 @@ [% BLOCK section_cclist %] <tr> <th class="field_label"> - <label for="newcc" accesskey="a">CC List:</label> + <label [% IF user.id %]for="newcc"[% END %] accesskey="a"> + CC List: + </label> </th> <td> [% IF user.id %] @@ -774,8 +798,7 @@ [% Hook.process("after_cc_field", 'bug/edit.html.tmpl') %] [% END %] [% IF bug.cc.size %] - <select id="cc" multiple="multiple" size="5" - [% IF bug.user.canedit %]name="cc"[% END %]> + <select id="cc" multiple="multiple" size="5" [% 'name="cc"' IF bug.user.canedit %]> [% FOREACH c = bug.cc %] <option value="[% c FILTER email FILTER html %]"> [% c FILTER email FILTER html %]</option> @@ -812,6 +835,29 @@ [% END %] [%############################################################################%] +[%# Block for Bug Ignored #%] +[%############################################################################%] +[% BLOCK section_bug_ignored %] + [% IF user.id %] + <tr> + <th class="field_label"> + <label for="bug_ignored" title="Ignore all email for this [% terms.bug %]"> + Ignore [% terms.Bug %] Mail: + </label> + </th> + <td> + <input type="hidden" name="defined_bug_ignored" value="1"> + <span title="You will still receive emails for flag requests directed at you."> + <input type="checkbox" name="bug_ignored" id="bug_ignored" value="1" + [% ' checked="checked"' IF user.is_bug_ignored(bug.id) %]> + (never email me about this [% terms.bug %]) + </span> + </td> + </tr> + [% END %] +[% END %] + +[%############################################################################%] [%# Block for See Also #%] [%############################################################################%] [% BLOCK section_see_also %] @@ -826,6 +872,50 @@ [% END %] [% END %] +[% BLOCK section_aliases %] + <tr> + [% INCLUDE "bug/field-label.html.tmpl" field = bug_fields.alias %] + <td> + [% IF bug.alias.size %] + [% bug.alias.join(', ') FILTER html %] + [% ELSE %] + None + [% END %] + [% IF bug.check_can_change_field('alias', 0, 1) %] + <span id="alias_edit_area_showhide_container" class="bz_default_hidden"> + (<a href="#" id="alias_edit_area_showhide">edit</a>) + </span> + <br> + <div id="alias_edit_area"> + <div> + <label for="newalias" class="field_label">Add</label> + <br> + <input name="newalias" id="newalias" size="20"> + </div> + [% IF bug.alias.size %] + <select id="alias" name="alias" multiple="multiple" size="5"> + [% FOREACH a = bug.alias %] + <option value="[% a FILTER html %]">[% a FILTER html %]</option> + [% END %] + </select> + <br> + + <input type="checkbox" id="removealias" name="removealias"> + <label for="removealias">Remove selected aliases</label> + [% END %] + </div> + <script type="text/javascript"> + hideEditableField( 'alias_edit_area_showhide_container', + 'alias_edit_area', + 'alias_edit_area_showhide', + '', + ''); + </script> + [% END %] + </td> + </tr> +[% END %] + [%############################################################################%] [%# Block for FLAGS #%] [%############################################################################%] @@ -893,9 +983,10 @@ [% USE Bugzilla %] [% FOREACH field = Bugzilla.active_custom_fields %] <tr> + [%# Use PROCESS instead of INCLUDE, because extra_field_item is defined + # in the template and must be returned back. INCLUDE cannot do that. %] [% PROCESS bug/field.html.tmpl value = bug.${field.name} - editable = bug.check_can_change_field(field.name, 0, 1) - value_span = 2 %] + editable = bug.check_can_change_field(field.name, 0, 1) %] </tr> [% IF extra_field_item %] <tr> @@ -935,10 +1026,9 @@ value="[% bug.${field.name}.join(', ') FILTER html %]"> [% END %] </span> - + [% FOREACH dep_bug = deps %] - [% dep_bug.id FILTER bug_link(dep_bug, use_alias => 1) - FILTER none %][% " " %] + [% INCLUDE bug/link.html.tmpl bug = dep_bug, link_text = dep_bug.id, use_alias = 1 %][% " " %] [% END %] [% IF bug.check_can_change_field(field.name, 0, 1) %] <span id="[% field.name FILTER html %]_edit_container" @@ -980,7 +1070,7 @@ field = bug_fields.remaining_time, editable = 1 %] [% INCLUDE "bug/field-label.html.tmpl" - field = bug_fields.percentage_complete, editable = 1 + field = bug_fields.percentage_complete %] <th> Gain: @@ -1065,9 +1155,7 @@ <!-- This table keeps the submit button aligned with the box. --> <table><tr><td> [% IF bug.check_can_change_field('longdesc', 0, 1) %] - [% INCLUDE global/textarea.html.tmpl - name = 'comment' - id = 'comment' + [% INCLUDE bug/comment.html.tmpl minrows = 10 maxrows = 25 cols = constants.COMMENT_COLS @@ -1084,8 +1172,9 @@ <br> [% PROCESS commit_button id=""%] - <table id="bug_status_bottom" - class="status" cellspacing="0" cellpadding="0"> + [% Hook.process("after_comment_commit_button", 'bug/edit.html.tmpl') %] + + <table id="bug_status_bottom" class="status"> <tr> <th class="field_label"> <a href="page.cgi?id=fields.html#bug_status">Status</a>: @@ -1127,7 +1216,6 @@ <input type="hidden" id="[% selname %]_dirty"> <select id="[% selname %]" name="[% selname %]"> [% FOREACH x = bug.choices.${selname} %] - [% NEXT IF NOT x.is_active AND x.name != bug.${selname} %] <option value="[% x.name FILTER html %]" [% " selected" IF x.name == bug.${selname} %]> [%- x.name FILTER html %] diff --git a/template/en/default/bug/field-help.none.tmpl b/template/en/default/bug/field-help.none.tmpl index c07ee5792..2b6096547 100644 --- a/template/en/default/bug/field-help.none.tmpl +++ b/template/en/default/bug/field-help.none.tmpl @@ -23,7 +23,7 @@ alias => "A short, unique name assigned to $terms.abug in order to assist with - looking it up and referring to it in other places in ${terms.Bugzilla}.", + looking it up and referring to it in other places in Bugzilla.", assigned_to => "The person in charge of resolving the ${terms.bug}.", @@ -38,7 +38,7 @@ bug_file_loc => bug_id => "The numeric id of $terms.abug, unique within this entire installation" - _ " of ${terms.Bugzilla}.", + _ " of Bugzilla.", bug_severity => "How severe the $terms.bug is, or whether it's an enhancement.", @@ -85,7 +85,7 @@ keywords => _ " to easily identify and group them.", longdesc => - "$terms.Bugs have comments added to them by $terms.Bugzilla users." + "$terms.Bugs have comments added to them by Bugzilla users." _ " You can search for some text in those comments.", op_sys => @@ -126,7 +126,7 @@ see_also => "This allows you to refer to $terms.bugs in other installations. You can enter a URL to $terms.abug in the 'Add $terms.Bug URLs' field to note that that $terms.bug is related to this one. You can - enter multiple URLs at once by separating them with a comma. + enter multiple URLs at once by separating them with whitespace. <p>You should normally use this field to refer to $terms.bugs in <em>other</em> installations. For $terms.bugs in this @@ -227,7 +227,7 @@ email1 => [%- END %] [% vars.help_html.${help_field} = "A custom $field_type_desc field in this installation" - _ " of ${terms.Bugzilla}." %] + _ " of Bugzilla." %] [% END %] [% END %] diff --git a/template/en/default/bug/field-label.html.tmpl b/template/en/default/bug/field-label.html.tmpl index 95ac28acb..94e2728fc 100644 --- a/template/en/default/bug/field-label.html.tmpl +++ b/template/en/default/bug/field-label.html.tmpl @@ -8,6 +8,7 @@ [%# INTERFACE: # field: a Bugzilla::Field object + # editable: if true, a label pointing to the editable field will be added. # desc_url: An alternate link to help for the field. # hidden: True if the field label should start hidden. # rowspan: a "rowspan" value for the label's <th>. diff --git a/template/en/default/bug/field.html.tmpl b/template/en/default/bug/field.html.tmpl index e05bcede8..f1ddf633f 100644 --- a/template/en/default/bug/field.html.tmpl +++ b/template/en/default/bug/field.html.tmpl @@ -9,6 +9,7 @@ [%# INTERFACE: # field: a Bugzilla::Field object # value: The value of the field for this bug. + # field_hidden (optional): boolean; if true, the field is hidden by default. # override_legal_values (optional): The list of legal values, for select fields. # editable: Whether the field should be displayed as an editable # <input> or as just the plain text of its value. @@ -35,17 +36,20 @@ [% Hook.process('start_field_column') %] [% IF editable %] [% SWITCH field.type %] - [% CASE constants.FIELD_TYPE_FREETEXT %] + [% CASE [ constants.FIELD_TYPE_FREETEXT + constants.FIELD_TYPE_INTEGER ] %] <input id="[% field.name FILTER html %]" class="text_input" name="[% field.name FILTER html %]" value="[% value FILTER html %]" size="40" maxlength="[% constants.MAX_FREETEXT_LENGTH FILTER none %]" - [% ' aria-required="true"' IF field.is_mandatory %]> - [% CASE constants.FIELD_TYPE_DATETIME %] - <input name="[% field.name FILTER html %]" size="20" + [% IF field.type == constants.FIELD_TYPE_INTEGER %] pattern="\d+[% IF dontchange %]|[% dontchange FILTER html %][% END %]" [% END %] + [% ' aria-required="true" required' IF field.is_mandatory %]> + [% CASE [constants.FIELD_TYPE_DATETIME, constants.FIELD_TYPE_DATE] %] + [% size = (field.type == constants.FIELD_TYPE_DATE) ? 10 : 20 %] + <input name="[% field.name FILTER html %]" size="[% size FILTER none %]" id="[% field.name FILTER html %]" value="[% value FILTER html %]" - [% ' aria-required="true"' IF field.is_mandatory %] + [% ' aria-required="true" required' IF field.is_mandatory %] onchange="updateCalendarFromField(this)"> <button type="button" class="calendar_button" id="button_calendar_[% field.name FILTER html %]" @@ -63,7 +67,7 @@ <span id="[% field.name FILTER html %]_input_area"> <input name="[% field.name FILTER html %]" id="[% field.name FILTER html %]" value="[% value FILTER html %]" size="7" - [% ' aria-required="true"' IF field.is_mandatory %]> + [% ' aria-required="true" required' IF field.is_mandatory %]> </span> @@ -91,7 +95,7 @@ [% SET field_size = field.legal_values.size %] [% END %] size="[% field_size FILTER html %]" multiple="multiple" - [% ' aria-required="true"' IF field.is_mandatory %] + [% ' aria-required="true" required' IF field.is_mandatory %] [% END %] > [% IF allow_dont_change %] @@ -141,36 +145,56 @@ </script> [% CASE constants.FIELD_TYPE_TEXTAREA %] - [% INCLUDE global/textarea.html.tmpl - id = field.name name = field.name minrows = 4 maxrows = 8 - cols = 60 defaultcontent = value mandatory = field.is_mandatory %] + <div id="[% field.name FILTER html %]_edit_container" class="bz_default_hidden"> + <div> + (<a href="#" id="[% field.name FILTER html %]_edit_action">edit</a>) + </div> + [% IF value %] + <pre class="field_textarea_readonly">[% value FILTER html %]</pre> + [% END %] + </div> + <div id="[% field.name FILTER html %]_input"> + [% INCLUDE global/textarea.html.tmpl + id = field.name name = field.name minrows = 4 maxrows = 8 + cols = 60 defaultcontent = value mandatory = field.is_mandatory %] + </div> + <script type="text/javascript"> + hideEditableField('[% field.name FILTER js %]_edit_container', + '[% field.name FILTER js %]_input', + '[% field.name FILTER js %]_edit_action', + '[% field.name FILTER js %]', + '[% value FILTER js %]', + '', + true); + </script> [% CASE constants.FIELD_TYPE_BUG_URLS %] - [% '<ul class="bug_urls">' IF value.size %] - [% FOREACH bug_url = value %] - <li> - [% PROCESS bug_url_link bug_url = bug_url %] - <label><input type="checkbox" value="[% bug_url.name FILTER html %]" - name="remove_[% field.name FILTER html %]"> - Remove</label> - </li> + [% IF bug.id && value.size %] + <ul class="bug_urls"> + [% FOREACH bug_url = value %] + <li> + [% PROCESS bug_url_link bug_url = bug_url %] + <label><input type="checkbox" value="[% bug_url.name FILTER html %]" + name="remove_[% field.name FILTER html %]"> + Remove</label> + </li> + [% END %] + </ul> [% END %] - [% '</ul>' IF value.size %] - [% IF Param('use_see_also') %] <span id="container_showhide_[% field.name FILTER html %]" class="bz_default_hidden"> (<a href="#" id="showhide_[% field.name FILTER html %]">add</a>) </span> <div id="container_[% field.name FILTER html %]"> - <label for="[% field.name FILTER html %]"> - <strong>Add [% terms.Bug %] URLs:</strong> - </label><br> <input type="text" id="[% field.name FILTER html %]" size="40" - class="text_input" name="[% field.name FILTER html %]"> + class="text_input" name="[% field.name FILTER html %]" + [% IF !bug.id %]value="[% value FILTER html %]"[% END %]> </div> - <script type="text/javascript"> + [% IF bug.id %] + <script type="text/javascript"> setupEditLink('[% field.name FILTER js %]'); - </script> + </script> + [% END %] [% END %] [% CASE constants.FIELD_TYPE_KEYWORDS %] <div id="[% field.name FILTER html %]_container"> @@ -179,7 +203,7 @@ value="[% value FILTER html %]"> <div id="[% field.name FILTER html %]_autocomplete"></div> </div> - <script type="text/javascript" defer="defer"> + <script type="text/javascript"> if (typeof YAHOO.bugzilla.field_array === "undefined") YAHOO.bugzilla.field_array = []; YAHOO.bugzilla.field_array["[% field.name FILTER js %]"] = [ @@ -216,6 +240,12 @@ [% value.join(', ') FILTER html %] [% END %] [% END %] + +[% IF bug && field.name == 'component' %] + (<a href="buglist.cgi?component=[% bug.component FILTER uri %]&product=[% bug.product FILTER uri %]&bug_status=__open__" + target="_blank">show other [% terms.bugs %]</a>) +[% END %] + [% Hook.process('end_field_column') %] [% '</td>' IF NOT no_tds %] diff --git a/template/en/default/bug/link.html.tmpl b/template/en/default/bug/link.html.tmpl index 40031e16f..f1e8d041a 100644 --- a/template/en/default/bug/link.html.tmpl +++ b/template/en/default/bug/link.html.tmpl @@ -8,6 +8,8 @@ [%# INTERFACE: # bug: a Bugzilla::Bug object + # user: the Bugzilla::User object to which this template is addressed. + # If not set, the currently logged in user object is used. # link_text: the text that we're highlighting. # use_alias: boolean; If true, we display the bug's alias as the link # text instead of link_text. @@ -32,8 +34,8 @@ [% IF user.can_see_bug(bug) %] [% link_title = link_title _ ' - ' _ bug.short_desc %] - [% IF use_alias && bug.alias %] - [% link_text = bug.alias %] + [% IF use_alias && bug.alias.size %] + [% link_text = bug.alias.join(', ') %] [% END %] [% END %] diff --git a/template/en/default/bug/navigate.html.tmpl b/template/en/default/bug/navigate.html.tmpl index 22d8c4799..b5e3ba7a2 100644 --- a/template/en/default/bug/navigate.html.tmpl +++ b/template/en/default/bug/navigate.html.tmpl @@ -21,24 +21,32 @@ [% Hook.process("links") %] <li> - <a href="#">Top of page </a></li> </ul> -[% END %] - +[% END %] -<div class="navigation"> [% SET my_search = user.recent_search_for(bug) %] [% IF my_search %] + <div class="navigation"> [% SET last_bug_list = my_search.bug_list %] [% SET this_bug_idx = lsearch(last_bug_list, bug.id) %] <b>[% terms.Bug %] List:</b> ([% this_bug_idx + 1 %] of [% last_bug_list.size %]) - <a href="show_bug.cgi?id= - [%- last_bug_list.first FILTER uri %]&list_id= - [%- my_search.id FILTER uri %]">First</a> - <a href="show_bug.cgi?id= - [%- last_bug_list.last FILTER uri %]&list_id= - [%- my_search.id FILTER uri %]">Last</a> + [% IF this_bug_idx > 0 %] + <a href="show_bug.cgi?id= + [%- last_bug_list.first FILTER uri %]&list_id= + [%- my_search.id FILTER uri %]">First</a> + [% ELSE %] + <span class="navigation_link">First</span> + [% END %] + + [% IF this_bug_idx + 1 < last_bug_list.size %] + <a href="show_bug.cgi?id= + [%- last_bug_list.last FILTER uri %]&list_id= + [%- my_search.id FILTER uri %]">Last</a> + [% ELSE %] + <span class="navigation_link">Last</span> + [% END %] [% IF this_bug_idx > 0 %] [% prev_bug = this_bug_idx - 1 %] @@ -46,7 +54,7 @@ [%- last_bug_list.$prev_bug FILTER uri %]&list_id= [%- my_search.id FILTER uri %]">Prev</a> [% ELSE %] - <i><font color="#777777">Prev</font></i> + <span class="navigation_link">Prev</span> [% END %] [% IF this_bug_idx + 1 < last_bug_list.size %] @@ -55,19 +63,10 @@ [%- last_bug_list.$next_bug FILTER uri %]&list_id= [%- my_search.id FILTER uri %]">Next</a> [% ELSE %] - <i><font color="#777777">Next</font></i> + <span class="navigation_link">Next</span> [% END %] <a href="buglist.cgi?regetlastlist= [%- my_search.id FILTER uri %]">Show last search results</a> -[% ELSE %] - [%# With no list, don't show link to search results %] - <i><font color="#777777">First</font></i> - <i><font color="#777777">Last</font></i> - <i><font color="#777777">Prev</font></i> - <i><font color="#777777">Next</font></i> - - <i><font color="#777777">This [% terms.bug %] is not in your last - search results.</font></i> + </div> [% END %] -</div> diff --git a/template/en/default/bug/process/bugmail.html.tmpl b/template/en/default/bug/process/bugmail.html.tmpl index b1c38da96..0d77e6f66 100644 --- a/template/en/default/bug/process/bugmail.html.tmpl +++ b/template/en/default/bug/process/bugmail.html.tmpl @@ -12,27 +12,11 @@ #%] <dl> -[% PROCESS emails - description = "Email sent to" - names = sent_bugmail.sent -%] - -[% PROCESS emails - description = "Excluding" - names = sent_bugmail.excluded -%] -</dl> - -[%############################################################################%] -[%# Block for a set of email addresses #%] -[%############################################################################%] - -[% BLOCK emails %] - <dt>[% description FILTER html %]:</dt> + <dt>Email sent to:</dt> <dd> [% IF user.can_see_bug(mailing_bugid) %] - [% IF names.size > 0 %] - [%+ FOREACH name = names %] + [% IF sent_bugmail.sent.size %] + [% FOREACH name = sent_bugmail.sent %] <code>[% name FILTER html %]</code>[% ", " UNLESS loop.last() %] [% END %] [% ELSE %] @@ -42,4 +26,4 @@ (list of e-mails not available) [% END %] </dd> -[% END %] +</dl> diff --git a/template/en/default/bug/process/confirm-duplicate.html.tmpl b/template/en/default/bug/process/confirm-duplicate.html.tmpl index da1580ed1..c6161d824 100644 --- a/template/en/default/bug/process/confirm-duplicate.html.tmpl +++ b/template/en/default/bug/process/confirm-duplicate.html.tmpl @@ -33,7 +33,7 @@ [% ELSE %] might, in the future, [% END %] - allow him/her access to view this [% terms.bug %].</b> + allow them access to view this [% terms.bug %].</b> Do you wish to do this? </p> diff --git a/template/en/default/bug/process/header.html.tmpl b/template/en/default/bug/process/header.html.tmpl index f7f61a737..55de0c324 100644 --- a/template/en/default/bug/process/header.html.tmpl +++ b/template/en/default/bug/process/header.html.tmpl @@ -17,7 +17,7 @@ [% IF title_tag == "bug_processed" %] [% title = BLOCK %] [% IF Bugzilla.cgi.param('id') %] - [% terms.Bug %] [%+ id FILTER html %] + [%+ id FILTER html %] [% ELSE %] [% terms.Bugs %] [% END %] diff --git a/template/en/default/bug/process/midair.html.tmpl b/template/en/default/bug/process/midair.html.tmpl index 684b99639..17025fee7 100644 --- a/template/en/default/bug/process/midair.html.tmpl +++ b/template/en/default/bug/process/midair.html.tmpl @@ -11,10 +11,6 @@ # used by bug/activity/table.html.tmpl to display recent changes that will # be overwritten if the user submits these changes. See that template # for further documentation. - # start_at: number; the comment at which show/comments.tmpl should begin - # displaying comments, either the index of the last comment (if the user - # entered a comment along with their change) or a number less than that - # (if they didn't), in which case no comments are displayed. # comments: array; all the comments on the bug. # bug: Bugzilla::Bug; the bug being changed. #%] @@ -40,7 +36,7 @@ [% PROCESS "bug/activity/table.html.tmpl" incomplete_data=0 %] </p> -[% IF comments.size > start_at %] +[% IF comments.size %] <p> Added the comment(s): <blockquote> @@ -71,7 +67,7 @@ You have the following choices: exclude="^Bugzilla_login|Bugzilla_password|delta_ts$" %] <input type="submit" id="process" value="Submit my changes anyway"> This will cause all of the above changes to be overwritten - [% ", except for the added comment(s)" IF comments.size > start_at %]. + [% ", except for the added comment(s)" IF comments.size %]. </form> </li> [% IF cgi.param("comment") %] @@ -82,7 +78,6 @@ You have the following choices: <input type="hidden" name="comment" value="[% cgi.param("comment") FILTER html %]"> <input type="hidden" name="comment_is_private" value="[% cgi.param("comment_is_private") FILTER html %]"> - <input type="hidden" name="longdesclength" value="[% bug.comments.size %]"> <input type="hidden" name="token" value="[% cgi.param("token") FILTER html %]"> <input type="submit" id="process_comment" value="Submit only my new comment"> </form> diff --git a/template/en/default/bug/process/results.html.tmpl b/template/en/default/bug/process/results.html.tmpl index cdebfed5e..c5c451907 100644 --- a/template/en/default/bug/process/results.html.tmpl +++ b/template/en/default/bug/process/results.html.tmpl @@ -20,23 +20,22 @@ [% DEFAULT type="bug" %] -[% Link = BLOCK %][% "$terms.Bug $id" FILTER bug_link(id) %][% END %] -[% link = BLOCK %][% "$terms.bug $id" FILTER bug_link(id) %][% END %] +[% link = BLOCK %][% terms.bug %] [%+ id FILTER bug_link(id) FILTER none %][% END %] [% title = { 'bug' => "Changes submitted for $link" , 'dupe' => "Duplicate notation added to $link" , 'dep' => "Checking for dependency changes on $link" , - 'created' => "$Link has been added to the database" , - 'move' => "$Link has been moved to another database" , + 'created' => "$link has been successfully created" , + 'move' => "$link has been moved to another database" , } %] [% Hook.process('title') %] <dl> - <dt>[% title.$type %]</dt> + <dt>[% title.$type.ucfirst %]</dt> <dd> [% PROCESS "bug/process/bugmail.html.tmpl" mailing_bugid = id %] [%# Links to more information about the changed bug. %] diff --git a/template/en/default/bug/process/verify-new-product.html.tmpl b/template/en/default/bug/process/verify-new-product.html.tmpl index a1a9539f2..c562bf54d 100644 --- a/template/en/default/bug/process/verify-new-product.html.tmpl +++ b/template/en/default/bug/process/verify-new-product.html.tmpl @@ -18,7 +18,9 @@ #%] [% PROCESS global/header.html.tmpl - title = 'Verify New Product Details...' %] + title = 'Verify New Product Details...' + style_urls = ['skins/standard/buglist.css'] +%] <form action="process_bug.cgi" method="post"> @@ -150,23 +152,23 @@ } </script> - <table border="1"> + <table id="groups_edit_multiple"> <tr> - <th>Remove<br>[% terms.bugs %]<br>from this<br>group</th> - <th>Add<br>[% terms.bugs %]<br>to this<br>group</th> - <th>Group Name:</th> + <th class="narrow_column">Remove [% terms.bugs %] from this group</th> + <th class="narrow_column">Add [% terms.bugs %] to this group</th> + <th>Group Name</th> </tr> [% FOREACH group = optional_groups %] <tr> - <td align="center"> + <td class="center"> <input type="checkbox" name="defined_groups" id="defined_group_[% group.group.id FILTER html %]" value="[% group.group.name FILTER html %]" [% IF cgi.param("defined_groups").contains(group.group.name) %] checked="checked"[% END %] onchange="turn_off(this, 'group_[% group.group.id FILTER html %]')"> </td> - <td align="center"> + <td class="center"> <input type="checkbox" name="groups" id="group_[% group.group.id FILTER html %]" value="[% group.group.name FILTER html %]" diff --git a/template/en/default/bug/show-header.html.tmpl b/template/en/default/bug/show-header.html.tmpl index c026dc3e3..9ce59130c 100644 --- a/template/en/default/bug/show-header.html.tmpl +++ b/template/en/default/bug/show-header.html.tmpl @@ -13,21 +13,36 @@ # be overridden by the calling templates. #%] +[% filtered_alias = bug.alias.join(', ') FILTER html %] [% filtered_desc = bug.short_desc FILTER html %] -[% subheader = filtered_desc %] [% filtered_timestamp = bug.delta_ts FILTER time %] -[% title = "$terms.Bug $bug.bug_id – $filtered_desc" %] + +[% subheader = filtered_desc %] +[% title = "$bug.bug_id – " %] +[% IF bug.alias.size %] + [% title = title _ "($filtered_alias) " %] +[% END %] +[% title = title _ filtered_desc %] +[% generate_api_token = 1 %] [% yui = ['autocomplete', 'calendar'] %] +[% yui.push('container') IF user.can_tag_comments %] [% javascript_urls = [ "js/util.js", "js/field.js" ] %] +[% javascript_urls.push("js/bug.js") IF user.id %] +[% javascript_urls.push('js/comment-tagging.js') + IF user.id && Param('comment_taggers_group') %] [% IF bug.defined %] [% header = "$terms.Bug $bug.bug_id" %] [% header_addl_info = "Last modified: $filtered_timestamp node ${constants.GENTOO_NODE}" %] - [% unfiltered_title = "$terms.Bug $bug.bug_id – $bug.short_desc" %] + [% unfiltered_title = "$bug.bug_id – " %] + [% IF bug.alias.size %] + [% unfiltered_title = unfiltered_title _ "(" _ bug.alias.join(', ') _ ") " %] + [% END %] + [% unfiltered_title = unfiltered_title _ bug.short_desc %] [% javascript = BLOCK %] if (history && history.replaceState) { if(!document.location.href.match(/show_bug\.cgi/)) { - history.replaceState( null, - "[% unfiltered_title FILTER js %]", + history.replaceState( null, + "[% unfiltered_title FILTER js %]", "show_bug.cgi?id=[% bug.bug_id FILTER js %]" ); document.title = "[% unfiltered_title FILTER js %]"; } @@ -39,12 +54,16 @@ } YAHOO.util.Event.onDOMReady(function() { initDirtyFieldTracking(); + + [% IF user.id AND user.is_involved_in_bug(bug) %] + YAHOO.bugzilla.bugUserLastVisit.update([% bug.bug_id FILTER none %]); + [% END %] }); [% javascript FILTER none %] [% END %] [% END %] -[% style_urls = [ "skins/standard/show_bug.css" ] %] -[% doc_section = "bug_page.html" %] +[% style_urls = ['skins/standard/bug.css'] %] +[% doc_section = "using/understanding.html" %] [% bodyclasses = ['bz_bug', "bz_status_$bug.bug_status", "bz_product_$bug.product", diff --git a/template/en/default/bug/show-multiple.html.tmpl b/template/en/default/bug/show-multiple.html.tmpl index fb11bf010..8babdf04a 100644 --- a/template/en/default/bug/show-multiple.html.tmpl +++ b/template/en/default/bug/show-multiple.html.tmpl @@ -9,10 +9,12 @@ [% PROCESS global/header.html.tmpl title = "Full Text $terms.Bug Listing" h1 = "" - style_urls = ["skins/standard/show_multiple.css", - "skins/standard/buglist.css"] - doc_section = "bug_page.html" + style_urls = ['skins/standard/buglist.css'] + doc_section = "using/understanding.html" %] + +[% USE Bugzilla %] + [% PROCESS bug/time.html.tmpl %] [% IF bugs.first %] [% ids = [] %] @@ -46,16 +48,17 @@ <h1> [% terms.Bug %] <a href="show_bug.cgi?id=[% bug.bug_id FILTER html %]">[% bug.bug_id FILTER html %]</a> - [% IF bug.alias AND NOT bug.error %] - (<a href="show_bug.cgi?id=[% bug.alias FILTER uri %]"> - [% bug.alias FILTER html %]</a>) + [% IF bug.alias.size AND NOT bug.error %] ( + [%- FOREACH alias IN bug.alias %]<a href="show_bug.cgi?id=[% alias FILTER uri %]"> + [% alias FILTER html %]</a>[% UNLESS loop.last %], [% END %] + [%- END %]) [% END %] </h1> <table class="bugfields"> [% IF bug.error %] <tr> - <td class="error"> + <td class="warning"> [% IF bug.error == "InvalidBugId" %] '[%+ bug.bug_id FILTER html %]' is not a valid [% terms.bug %] number nor a known [% terms.bug %] alias. @@ -145,7 +148,7 @@ <th>[% field_descs.bug_file_loc FILTER html %]:</th> <td colspan="3"> [% IF is_safe_url(bug.bug_file_loc) %] - <a href="[% bug.bug_file_loc FILTER html %]"> + <a href="[% bug.bug_file_loc FILTER html %]" rel="noreferrer"> [% bug.bug_file_loc FILTER html %]</a> [% ELSE %] [% bug.bug_file_loc FILTER html %] @@ -170,7 +173,6 @@ [% PROCESS row cell = "status_whiteboard" fullrow = 1 %] [% END %] - [% USE Bugzilla %] [% field_counter = 0 %] [% FOREACH field = Bugzilla.active_custom_fields %] [% field_counter = field_counter + 1 %] @@ -233,6 +235,8 @@ </table> </td> </tr> + [% END %] + [% IF Param("timetrackinggroup") && bug.deadline %] [% PROCESS row cell="deadline" %] [% END %] @@ -259,7 +263,7 @@ [% ELSE %] [% FOREACH flag = attachment.flags %] [% flag.setter.nick FILTER html %]: - [%+ flag.type.name FILTER html FILTER no_break %][% flag.status %] + <span class="nowrap">[%+ flag.type.name FILTER html %][% flag.status %]</span> [% IF flag.status == "?" && flag.requestee %] ([% flag.requestee.nick FILTER html %]) [% END %][% ", " IF not loop.last() %] @@ -348,7 +352,7 @@ [% FOREACH type = bug.flag_types %] [% FOREACH flag = type.flags %] [% flag.setter.nick FILTER html %]: - [%+ flag.type.name FILTER html FILTER no_break %][% flag.status %] + <span class="nowrap">[%+ flag.type.name FILTER html %][% flag.status %]</span> [%+ IF flag.status == "?" && flag.requestee %] ([% flag.requestee.nick FILTER html %]) [% END %]<br> diff --git a/template/en/default/bug/summarize-time.html.tmpl b/template/en/default/bug/summarize-time.html.tmpl index 932a6e3f4..8bfe3c1c6 100644 --- a/template/en/default/bug/summarize-time.html.tmpl +++ b/template/en/default/bug/summarize-time.html.tmpl @@ -18,10 +18,10 @@ [% END %] [% PROCESS global/header.html.tmpl - title = title - header = header - style_urls = ["skins/standard/summarize-time.css"] - doc_section = "timetracking.html" + title = title + header = header + style_urls = ['skins/standard/buglist.css'] + doc_section = "using/editing.html#time-tracking" yui = ['calendar'] javascript_urls = [ "js/util.js", "js/field.js" ] %] @@ -35,15 +35,13 @@ [% FOREACH workdata = part_list %] [%# parts contains date ranges (from, to). %] [% part = parts.shift %] - <div align="right"> - <h4 style="padding-right: 2em; margin: 0;"> - [% IF part.0 or part.1 %] - [% part.0 OR "Up" FILTER html %] to [% part.1 OR "now" FILTER html %] - [% ELSE %] - Full summary (no period specified) - [% END %] - </h4> - </div> + <h4> + [% IF part.0 or part.1 %] + [% part.0 OR "Up" FILTER html %] to [% part.1 OR "now" FILTER html %] + [% ELSE %] + Full summary (no period specified) + [% END %] + </h4> [% IF group_by == "number" %] [% INCLUDE number_report %] [% ELSE %] @@ -52,7 +50,7 @@ [% END %] [% IF detailed %] - <h4 style="margin: 0"> + <h4> Total of [% global.remaining FILTER format("%.2f") %]h remains from original estimate of [% global.estimated FILTER format("%.2f") %]h [% IF global.deadline %] @@ -62,13 +60,13 @@ [% END %] [% IF monthly %] - <h4 style="margin: 0">Total of [% global.grand_total FILTER format("%.2f") %] hours worked</h4> - <hr noshade size="1"> + <h4>Total of [% global.grand_total FILTER format("%.2f") %] hours worked</h4> + <hr> [% END %] [% IF null.size > 0 %] [% INCLUDE inactive_report %] - <h4 style="margin: 0">Total of [% null.size %] inactive [% terms.bugs %]</h4> + <h4>Total of [% null.size %] inactive [% terms.bugs %]</h4> [% END %] [% END %] @@ -83,7 +81,7 @@ [% BLOCK owner_report %] [% global.total = 0 global.bug_count = {} global.owner_count = {} %] - <table cellpadding="4" cellspacing="0" width="90%" class="realitems owner"> + <table class="realitems owner"> [% FOREACH owner = workdata.keys.sort %] [% INCLUDE do_one_owner owner=owner ownerdata=workdata.$owner detailed=detailed %] @@ -112,11 +110,10 @@ [% subtotal = subtotal + bugdata.total_time %] [% END %] <tr> - <td colspan="4" align="right"><b>Total</b>:</td> - <td align="right" class="subtotal" width="100"> - <b>[% subtotal FILTER format("%.2f") %]</b></td> - [% global.total = global.total + subtotal %] + <th colspan="4" class="right">Total:</th> + <td class="subtotal">[% subtotal FILTER format("%.2f") %]</td> </tr> + [% global.total = global.total + subtotal %] [% END %] [%# @@ -128,7 +125,7 @@ [% BLOCK number_report %] [% global.total = 0 global.owner_count = {} global.bug_count = {} %] - <table cellpadding="4" cellspacing="0" width="90%" class="realitems number"> + <table class="realitems number"> [% FOREACH bug = workdata.keys.nsort %] [% INCLUDE do_one_bug id=bug bugdata=workdata.$bug detailed=detailed %] @@ -156,51 +153,42 @@ <tr class="owner_header[% 2 FILTER none IF cid % 2 %]"> <td> </td> <td colspan="2"><b>[% login_name FILTER html %]</b></td> - <td align="right"> + <td class="right"> [% work_time FILTER format("%.2f") %]</td> </tr> [% END %] [% END %] <tr> - <td colspan="2"> </td> - <td align="right"> - <b>Total</b>: - </td> - <td align="right" class="subtotal" width="100"> - <b>[% subtotal FILTER format("%.2f") %]</b> - </td> + <th colspan="3" class="right">Total:</th> + <td class="subtotal">[% subtotal FILTER format("%.2f") %]</td> </tr> [% global.total = global.total + subtotal %] [% END %] [% BLOCK bug_header %] <tr class="bug_header[% '2' IF cid % 2 %]"> - <td width="80" valign="top"> - <b>[% "$terms.Bug $id" FILTER bug_link(id) FILTER none %]</b> - </td> - <td width="100"><b>[% display_value("bug_status", bugs.$id.bug_status) FILTER html %]</b></td> + <th class="bug_id">[% "$terms.Bug $id" FILTER bug_link(id) FILTER none %]</th> + <th class="bug_status"> + [% display_value("bug_status", bugs.$id.bug_status) FILTER html %] + </th> <td colspan="2">[% bugs.$id.short_desc FILTER html %]</td> [% IF extra %] - <td align="right" valign="top">[% bugdata.total_time FILTER html %]</td> + <td class="right">[% bugdata.total_time FILTER html %]</td> [% END %] </tr> [% IF detailed %] <tr class="bug_header[% '2' IF cid % 2 %]"> <td> </td> <td colspan="3"> - <table width="100%" cellpadding="0" cellspacing="0"> - <tr> - <td width="33%"> - Estimated: [% bugs.$id.estimated_time FILTER format("%.2f") %]h - </td> - <td width="33%"> - Remaining: [% bugs.$id.remaining_time FILTER format("%.2f") %]h - </td> - <td width="33%"> - Deadline: [% bugs.$id.deadline || "<b>Not set</b>" %] - </td> - </tr> - </table> + <span class="time_info"> + Estimated: [% bugs.$id.estimated_time FILTER format("%.2f") %]h + </span> + <span class="time_info"> + Remaining: [% bugs.$id.remaining_time FILTER format("%.2f") %]h + </span> + <span class="time_info"> + Deadline: [% bugs.$id.deadline || "<b>Not set</b>" %] + </span> </td> [% IF extra %] <td> </td> @@ -222,7 +210,7 @@ [% BLOCK inactive_report %] <h3>Inactive [% terms.bugs %]</h3> - <table cellpadding="4" cellspacing="0" width="90%" class="zeroitems"> + <table class="zeroitems"> [% cid = 0 %] [% FOREACH bug_id = null.nsort %] [% INCLUDE bug_header id=bug_id cid=cid %] @@ -236,8 +224,8 @@ [% IF global.total > 0 %] <tr class="section_total"> <td><b>Totals</b></td> - <td colspan="[% colspan FILTER html %]" align="right"><b>[% additional FILTER html %]</b></td> - <td align="right"><b>[% global.total FILTER format("%.2f") %]</b></td> + <th colspan="[% colspan FILTER html %]" class="right">[% additional FILTER html %]</th> + <th class="right">[% global.total FILTER format("%.2f") %]</th> </tr> [% ELSE %] <tr> @@ -254,88 +242,88 @@ #%] [% BLOCK query_form %] -<hr noshade size=1> -<form method="post" name="summary" style="display: inline" action="summarize_time.cgi"> +<hr> +<form method="post" name="summary" action="summarize_time.cgi"> <input type="hidden" name="do_depends" value="[% do_depends FILTER html %]"> <input type="hidden" name="id" value="[% ids.join(",") FILTER html %]"> <input type="hidden" name="do_report" value="1"> [% IF warn_swap_dates %] - <h4 style="border: 1px solid red; margin: 1em; padding: 0.5em">The - end date specified occurs before the start date, which doesn't - make sense; the dates below have therefore been swapped.</h4> + <p class="warning_swapped_data"> + The end date specified occurs before the start date, which doesn't + make sense; the dates below have therefore been swapped. + </p> [% END %] <table> -<tr> -<td align="right"> - <b><label accesskey="s" - for="start_date">Period <u>s</u>tarting</label></b>: -</td><td colspan="3"> - <input type="text" id="start_date" name="start_date" size="11" - align="right" value="[% start_date FILTER html %]" maxlength="10" - onchange="updateCalendarFromField(this)"> - <button type="button" class="calendar_button" - id="button_calendar_start_date" - onclick="showCalendar('start_date')"><span>Calendar</span> - </button> - <div id="con_calendar_start_date"></div> - - <b>and <label accesskey="e" for="end_date"><u>e</u>nding</label></b>: - <input type="text" name="end_date" size="11" id="end_date" - align="right" value ="[% end_date FILTER html %]" maxlength="10" - onchange="updateCalendarFromField(this)"> - <button type="button" class="calendar_button" - id="button_calendar_end_date" - onclick="showCalendar('end_date')"><span>Calendar</span> - </button> - <div id="con_calendar_end_date"></div> -</td><td align="right"> - <input type="submit" id="summarize" value="Summarize"> -</td></tr> -<tr> -<td> </td><td colspan="4"> - <small>(Dates are optional, and in YYYY-MM-DD format)</small> -</td> -<tr><td align="right"> - <b>Group by</b>: -</td><td colspan="2"> - <input type="radio" name="group_by" id="number" value="number" [%+ - 'checked="checked"' IF group_by == "number" - %]><label - for="number" accesskey="n">[% terms.Bug %] <u>N</u>umber</label> - <input type="radio" name="group_by" id="owner" value="owner" [%+ - 'checked="checked"' IF group_by == "owner" - %]><label - for="owner" accesskey="d"><u>D</u>eveloper</label> -</td><td colspan="2"> - <label for="ctype"><b>Format</b></label>: <select name="ctype" id="ctype"> - <option value="html">HTML Report</option> - </select> -</td></tr><tr> -<td> </td><td colspan="4"> - <input type="checkbox" name="monthly" [% 'checked="checked"' IF - monthly %] id="monthly"> - <label for="monthly" accesskey="m">Split by <u>m</u>onth</label> - [%# XXX: allow splitting by other intervals %] - - <input type="checkbox" name="detailed" [% 'checked="checked"' IF - detailed %] id="detailed"> - <label for="detailed" accesskey="t">De<u>t</u>ailed summaries</label> - - <input type="checkbox" name="inactive" [% 'checked="checked"' IF - inactive %] id="inactive"> - <label for="inactive" accesskey="i">Also show <u>i</u>nactive - [%+ terms.bugs %]</label> -</td> -</tr></table> + <tr> + <th> + <label accesskey="s" for="start_date">Period <u>s</u>tarting</label>: + </th> + <td> + <input id="start_date" name="start_date" size="10" autofocus + value="[% start_date FILTER html %]" maxlength="10" + onchange="updateCalendarFromField(this)"> + <button type="button" class="calendar_button" id="button_calendar_start_date" + onclick="showCalendar('start_date')"><span>Calendar</span> + </button> + <span class="label"> + and <label accesskey="e" for="end_date"><u>e</u>nding</label>: + </span> + <input type="text" name="end_date" size="10" id="end_date" + value ="[% end_date FILTER html %]" maxlength="10" + onchange="updateCalendarFromField(this)"> + <button type="button" class="calendar_button" id="button_calendar_end_date" + onclick="showCalendar('end_date')"><span>Calendar</span> + </button> + <br> + <span class="bz_info">(Dates are optional, and in YYYY-MM-DD format)</span> + </td> + <th><input type="submit" id="summarize" value="Summarize"></th> + </tr> + + <tr> + <th>Group by:</th> + <td> + <input type="radio" name="group_by" id="number" value="number" + [% 'checked="checked"' IF group_by == "number" %]> + <label for="number" accesskey="n">[% terms.Bug %] <u>N</u>umber</label> + <input type="radio" name="group_by" id="owner" value="owner" + [% 'checked="checked"' IF group_by == "owner" %]> + <label for="owner" accesskey="d"><u>D</u>eveloper</label> + </td> + <th> + <label for="ctype">Format</label>: + <select name="ctype" id="ctype"> + <option value="html">HTML Report</option> + </select> + </th> + </tr> + + <tr> + <th> </th> + <td colspan="2"> + <input type="checkbox" name="monthly" id="monthly" + [% 'checked="checked"' IF monthly %]> + <label for="monthly" accesskey="m">Split by <u>m</u>onth</label> + [%# XXX: allow splitting by other intervals %] + <input type="checkbox" name="detailed" id="detailed" + [% 'checked="checked"' IF detailed %]> + <label for="detailed" accesskey="t">De<u>t</u>ailed summaries</label> + <input type="checkbox" name="inactive" id="inactive" + [% 'checked="checked"' IF inactive %]> + <label for="inactive" accesskey="i">Also show <u>i</u>nactive + [%+ terms.bugs %]</label> + </td> + </tr> +</table> </form> <script type="text/javascript"> <!-- [%+ PROCESS "global/calendar.js.tmpl" id = 'start_date' %] [% PROCESS "global/calendar.js.tmpl" id = 'end_date' %] - document.forms['summary'].start_date.focus(); - //--></script> -<hr noshade size=1> + //--> +</script> +<hr> [% END %] diff --git a/template/en/default/bug/time.html.tmpl b/template/en/default/bug/time.html.tmpl index 370aad679..317c19cde 100644 --- a/template/en/default/bug/time.html.tmpl +++ b/template/en/default/bug/time.html.tmpl @@ -5,7 +5,7 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. #%] - + [% BLOCK formattimeunit %] [%# INTERFACE: # time_unit: the number converting, converts to 2 decimal places @@ -13,11 +13,7 @@ # 1 decimal place #%] [% time_unit = time_unit FILTER format('%.2f') %] - [% IF time_unit.match('0\Z') %] - [% time_unit FILTER format('%.1f') %] - [% ELSE %] - [% time_unit FILTER format('%.2f') %] - [% END %] + [% time_unit.replace('0\Z', '') %] [% END %] [% BLOCK calculatepercentage %] diff --git a/template/en/default/email/bugmail-header.txt.tmpl b/template/en/default/email/bugmail-header.txt.tmpl index e9c1cf46f..52e24563e 100644 --- a/template/en/default/email/bugmail-header.txt.tmpl +++ b/template/en/default/email/bugmail-header.txt.tmpl @@ -21,22 +21,9 @@ Subject: [[% terms.Bug %] [%+ bug.id %]] [% 'New: ' IF show_new %][%+ bug.short_ Date: [% date %] Reply-To: DO NOT REPLY <devnull@localhost.invalid> X-Bugzilla-Reason: [% reasonsheader %] -X-Bugzilla-Type: [% isnew ? 'new' : 'changed' %] +X-Bugzilla-Type: [% bugmailtype %] X-Bugzilla-Watch-Reason: [% reasonswatchheader %] -[% IF Param('useclassification') %] -X-Bugzilla-Classification: [% bug.classification %] -[% END %] -X-Bugzilla-Product: [% bug.product %] -X-Bugzilla-Component: [% bug.component %] -X-Bugzilla-Version: [% bug.version %] -X-Bugzilla-Keywords: [% bug.keywords %] -X-Bugzilla-Severity: [% bug.bug_severity %] -X-Bugzilla-Who: [% changer.login %] -X-Bugzilla-Status: [% bug.bug_status %] -X-Bugzilla-Priority: [% bug.priority %] -X-Bugzilla-Assigned-To: [% bug.assigned_to.login %] -X-Bugzilla-Target-Milestone: [% bug.target_milestone %] -X-Bugzilla-Flags:[% FOREACH flag = bug.flags %] [%+ flag.name %][% flag.status %][% END %] +[%+ INCLUDE "email/header-common.txt.tmpl" %] X-Bugzilla-Changed-Fields: [% changedfields.join(" ") %] X-Bugzilla-Reporter: [% bug.reporter.login_name %] X-Bugzilla-CC: [% cc.join(", ") %] diff --git a/template/en/default/email/bugmail.html.tmpl b/template/en/default/email/bugmail.html.tmpl index b361b0889..fd348a656 100644 --- a/template/en/default/email/bugmail.html.tmpl +++ b/template/en/default/email/bugmail.html.tmpl @@ -11,7 +11,7 @@ [% isnew = bug.lastdiffed ? 0 : 1 %] <html> <head> - <base href="[% urlbase FILTER html %]" /> + <base href="[% urlbase FILTER html %]"> </head> <body> [% Hook.process('start') %] @@ -20,18 +20,36 @@ [% FOREACH comment = new_comments.reverse %] <div> [% IF comment.count %] - <b>[% "Comment # ${comment.count}" FILTER bug_link(bug, - {comment_num => comment.count, full_url => 1, user => to_user}) FILTER none %] - on [% "$terms.bug $bug.id" FILTER bug_link(bug, { full_url => 1, user => to_user }) FILTER none %] - from [% INCLUDE global/user.html.tmpl who = comment.author %]</b> + <b>[% INCLUDE bug/link.html.tmpl bug = bug, link_text = "Comment # ${comment.count}", + comment_num = comment.count, full_url = 1, user = to_user %] + on [% INCLUDE bug/link.html.tmpl bug = bug, link_text = "$terms.bug $bug.id", + full_url = 1, user = to_user %] + from [% INCLUDE global/user.html.tmpl user = to_user, who = comment.author %]</b> [% END %] <pre>[% comment.body_full({ wrap => 1 }) FILTER quoteUrls(bug, comment, to_user) %]</pre> </div> [% END %] </p> + + [% IF referenced_bugs.size %] + <div id="referenced"> + <hr style="border: 1px dashed #969696"> + <b>Referenced [% terms.Bugs %]:</b> + <ul> + [% FOREACH ref_bug = referenced_bugs %] + <li> + [[% "${terms.Bug} ${ref_bug.id}" FILTER bug_link(ref_bug, {full_url => 1, user => to_user}) FILTER none %]] + [% ref_bug.short_desc FILTER html %] + </li> + [% END %] + </ul> + </div> + <br> + [% END %] + <hr> <span>You are receiving this mail because:</span> - + <ul> [% FOREACH reason = reasons %] [% IF reason_descs.$reason %] @@ -58,14 +76,14 @@ [% SET in_table = 0 %] [% END %] [% IF change.blocker %] - [% "${terms.Bug} ${bug.id}" FILTER bug_link(bug, {full_url => 1, user => to_user}) FILTER none %] - depends on - [%+ "${terms.bug} ${change.blocker.id}" - FILTER bug_link(change.blocker, {full_url => 1, user => to_user}) FILTER none %], - which changed state. + [% INCLUDE bug/link.html.tmpl bug = bug, link_text = "$terms.Bug $bug.id", full_url = 1, user = to_user %] + depends on + [%+ INCLUDE bug/link.html.tmpl bug = change.blocker, link_text = "$terms.bug $change.blocker.id", + full_url = 1, user = to_user %], + which changed state. [% ELSE %] - [% INCLUDE global/user.html.tmpl who = change.who %] changed - [%+ "${terms.bug} ${bug.id}" FILTER bug_link(bug, {full_url => 1, user => to_user}) FILTER none %] + [% INCLUDE global/user.html.tmpl user = to_user, who = change.who %] changed + [%+ INCLUDE bug/link.html.tmpl bug = bug, link_text = "$terms.bug $bug.id", full_url = 1, user = to_user %] [% END %] <br> [% IF in_table == 0 %] @@ -89,7 +107,7 @@ <th>[% field_label FILTER html %]</th> <td> [% IF change.field_name == "bug_id" %] - [% new_value FILTER bug_link(bug, {full_url => 1, user => to_user}) FILTER none %] + [% INCLUDE bug/link.html.tmpl bug = bug, link_text = new_value, full_url = 1, user = to_user %] [% ELSE %] [% new_value FILTER html %] [% END %] diff --git a/template/en/default/email/bugmail.txt.tmpl b/template/en/default/email/bugmail.txt.tmpl index b3c652fcc..1f04db7b1 100644 --- a/template/en/default/email/bugmail.txt.tmpl +++ b/template/en/default/email/bugmail.txt.tmpl @@ -22,6 +22,15 @@ [%+ comment.body_full({ is_bugmail => 1, wrap => 1 }) FILTER strip_control_chars %] [% END %] +[% IF referenced_bugs.size %] + +Referenced [% terms.Bugs %]: + +[% FOREACH ref_bug = referenced_bugs %] +[%+ urlbase %]show_bug.cgi?id=[% ref_bug.id %] +[%+ "[" _ terms.Bug _ " " _ ref_bug.id _ "] " _ ref_bug.short_desc FILTER wrap_comment %] +[% END %] +[% END %] -- [%# Protect the trailing space of the signature marker %] You are receiving this mail because: [% SET reason_lines = [] %] diff --git a/template/en/default/email/flagmail.txt.tmpl b/template/en/default/email/flagmail.txt.tmpl index 037673dfc..cf64d9661 100644 --- a/template/en/default/email/flagmail.txt.tmpl +++ b/template/en/default/email/flagmail.txt.tmpl @@ -27,6 +27,9 @@ [% ELSE %] [% IF old_flag && old_flag.status == '?' %] [% to_identity = old_flag.setter.identity _ "'s request for" %] + [% IF old_flag.requestee.defined %] + [% requestee_identity = old_flag.requestee.identity _ "'s" %] + [% END %] [% END %] [% subject_status = statuses.$action %] [% END %] @@ -37,16 +40,17 @@ Subject: [% flagtype_name %] [%+ subject_status %]: [[% terms.Bug %] [%+ bug.bug [Attachment [% attachment.id %]] [% attachment.description FILTER clean_text %][% END %] Date: [% date %] X-Bugzilla-Type: request +[%+ INCLUDE "email/header-common.txt.tmpl" %] [%+ threadingmarker %] [%+ USE wrap -%] [%- FILTER bullet = wrap(80) -%] [% IF on_behalf_of %] -[% user.identity %] has reassigned [% flag.setter.identity %]'s request for [% flagtype_name %] +[% user.identity %] has reassigned [% flag.setter.identity %]'s request for [% IF requestee_identity %] [%+ requestee_identity %] [% END %] [% flagtype_name %] [% to_identity %]: [% ELSE %] -[% user.identity %] has [% statuses.$action %] [%+ to_identity %] [%+ flagtype_name %]: +[% user.identity %] has [% statuses.$action %] [%+ to_identity %] [% IF requestee_identity %] [%+ requestee_identity %] [% END %] [%+ flagtype_name %]: [% END %] [% terms.Bug %] [%+ bugidsummary %] diff --git a/template/en/default/email/header-common.txt.tmpl b/template/en/default/email/header-common.txt.tmpl new file mode 100644 index 000000000..02bd38e13 --- /dev/null +++ b/template/en/default/email/header-common.txt.tmpl @@ -0,0 +1,24 @@ +[%# 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. + #%] +[% IF Param('useclassification') %] +X-Bugzilla-Classification: [% bug.classification %] +[% END %] +X-Bugzilla-Product: [% bug.product %] +X-Bugzilla-Component: [% bug.component %] +X-Bugzilla-Version: [% bug.version %] +X-Bugzilla-Keywords: [% bug.keywords %] +X-Bugzilla-Severity: [% bug.bug_severity %] +X-Bugzilla-Who: [% changer.login %] +X-Bugzilla-Status: [% bug.bug_status %] +X-Bugzilla-Resolution: [% bug.resolution %] +X-Bugzilla-Priority: [% bug.priority %] +X-Bugzilla-Assigned-To: [% bug.assigned_to.login %] +[% IF Param('usetargetmilestone') %] +X-Bugzilla-Target-Milestone: [% bug.target_milestone %] +[% END %] +X-Bugzilla-Flags:[% FOREACH flag = bug.flags %] [%+ flag.name %][% flag.status %][% END %] diff --git a/template/en/default/email/new-api-key.txt.tmpl b/template/en/default/email/new-api-key.txt.tmpl new file mode 100644 index 000000000..cfccefdcc --- /dev/null +++ b/template/en/default/email/new-api-key.txt.tmpl @@ -0,0 +1,33 @@ +[%# 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. + #%] + +[%# INTERFACE: + # user: The Bugzilla::User object of the user being created + # new_key: The API key created + #%] + +From: [% Param('mailfrom') %] +To: [% user.email %] +Subject: [% terms.Bugzilla %]: New API key created +X-Bugzilla-Type: admin + +[This e-mail has been automatically generated] + +A new [% terms.Bugzilla %] API key[% IF new_key.description %], with the +description '[% new_key.description %]'[% END %] has been created. You can view +or update the key at the following URL: + +[%+ urlbase %]userprefs.cgi?tab=apikey + +IMPORTANT: If you did not request a new key, your [% terms.Bugzilla %] account +may have been compromised. In this case, please disable the key at the above +URL, and change your password immediately. + +For security reasons, we have not included your new key in this e-mail. + +If you have any issues regarding your account, please contact [% Param('maintainer') %]. diff --git a/template/en/default/email/new-user-details.txt.tmpl b/template/en/default/email/new-user-details.txt.tmpl new file mode 100644 index 000000000..b1b43caf2 --- /dev/null +++ b/template/en/default/email/new-user-details.txt.tmpl @@ -0,0 +1,31 @@ +[%# 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. + #%] + +[%# INTERFACE: + # new_user: The Bugzilla::User object of the user being created + #%] + +From: [% Param('mailfrom') %] +To: [% new_user.email %] +Subject: [% terms.Bugzilla %]: New account created +X-Bugzilla-Type: admin + +[This e-mail has been automatically generated] + +A new [% terms.Bugzilla %] user account has been created at [% urlbase %]: + +Login: [% new_user.login %] +[% IF new_user.realname %] +Real name: [% new_user.realname %] +[% END %] + +For security reasons, we have not included your new password in this e-mail. +If you have not being given it via other means, you can use the 'Forgot +Password' link to set a new password. + +If you have any issues regarding your account, please contact [% Param('maintainer') %]. diff --git a/template/en/default/extensions/config.pm.tmpl b/template/en/default/extensions/config.pm.tmpl index cb7195767..68ed260c1 100644 --- a/template/en/default/extensions/config.pm.tmpl +++ b/template/en/default/extensions/config.pm.tmpl @@ -12,8 +12,11 @@ [% PROCESS extensions/license.txt.tmpl %] -package B[% %]ugzilla::Extension::[% name %]; +package Bugzilla::Extension::[% name %]; + +use 5.10.1; use strict; +use warnings; use constant NAME => '[% name %]'; diff --git a/template/en/default/extensions/extension.pm.tmpl b/template/en/default/extensions/extension.pm.tmpl index 206ea88f4..823440421 100644 --- a/template/en/default/extensions/extension.pm.tmpl +++ b/template/en/default/extensions/extension.pm.tmpl @@ -12,16 +12,20 @@ [% PROCESS extensions/license.txt.tmpl %] -package B[% %]ugzilla::Extension::[% name %]; +package Bugzilla::Extension::[% name %]; + +use 5.10.1; use strict; -use base qw(B[% %]ugzilla::Extension); +use warnings; + +use parent qw(Bugzilla::Extension); # This code for this is in [% path %]/lib/Util.pm -use B[% %]ugzilla::Extension::[% name %]::Util; +use Bugzilla::Extension::[% name %]::Util; our $VERSION = '0.01'; -# See the documentation of B[% %]ugzilla::Hook ("perldoc B[% %]ugzilla::Hook" +# See the documentation of Bugzilla::Hook ("perldoc Bugzilla::Hook" # in the bugzilla directory) for a list of all available hooks. sub install_update_db { my ($self, $args) = @_; diff --git a/template/en/default/extensions/hook-readme.txt.tmpl b/template/en/default/extensions/hook-readme.txt.tmpl index 63e09e419..86ace3f51 100644 --- a/template/en/default/extensions/hook-readme.txt.tmpl +++ b/template/en/default/extensions/hook-readme.txt.tmpl @@ -7,7 +7,7 @@ #%] Template hooks go in this directory. Template hooks are called in normal -[%+ terms.Bugzilla %] templates like [[% '%' %] Hook.process('some-hook') %]. +Bugzilla templates like [[% '%' %] Hook.process('some-hook') %]. More information about them can be found in the documentation of -B[% %]ugzilla::Extension. (Do "perldoc B[% %]ugzilla::Extension" from the main -[%+ terms.Bugzilla %] directory to see that documentation.) +Bugzilla::Extension. (Do "perldoc Bugzilla::Extension" from the main +Bugzilla directory to see that documentation.) diff --git a/template/en/default/extensions/index-admin.rst.tmpl b/template/en/default/extensions/index-admin.rst.tmpl new file mode 100644 index 000000000..508937710 --- /dev/null +++ b/template/en/default/extensions/index-admin.rst.tmpl @@ -0,0 +1,23 @@ +[%# 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. + #%] + +[%# INTERFACE: + # name: string; the name of the extension. + #%] + +[% USE String('#') %] +[% name %] +[%+ String.repeat(name.length) %] + +This is a sample Adminstrator documentation file for the [% name %] extension. +Like all of the Bugzilla docs, it's written in +`reStructured Text (reST) format <http://sphinx-doc.org/latest/rest.html>`_ +and will be compiled by `Sphinx <http://sphinx-doc.org/>`_. + +If you build the docs yourself using :file:`makedocs.pl`, this file will get +incorporated into the Installed Extensions chapter of the Administration Guide. diff --git a/template/en/default/extensions/index-user.rst.tmpl b/template/en/default/extensions/index-user.rst.tmpl new file mode 100644 index 000000000..b09fc1cd1 --- /dev/null +++ b/template/en/default/extensions/index-user.rst.tmpl @@ -0,0 +1,23 @@ +[%# 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. + #%] + +[%# INTERFACE: + # name: string; the name of the extension. + #%] + +[% USE String('#') %] +[% name %] +[%+ String.repeat(name.length) %] + +This is a sample User documentation file for the [% name %] extension. +Like all of the Bugzilla docs, it's written in +`reStructured Text (reST) format <http://sphinx-doc.org/latest/rest.html>`_ +and will be compiled by `Sphinx <http://sphinx-doc.org/>`_. + +If you build the docs yourself using :file:`makedocs.pl`, this file will get +incorporated into the Installed Extensions chapter of the User Guide. diff --git a/template/en/default/extensions/name-readme.txt.tmpl b/template/en/default/extensions/name-readme.txt.tmpl index 22fbad4df..e792512b5 100644 --- a/template/en/default/extensions/name-readme.txt.tmpl +++ b/template/en/default/extensions/name-readme.txt.tmpl @@ -9,8 +9,8 @@ Normal templates go in this directory. You can load them in your code like this: -use B[% %]ugzilla::Error; -my $template = B[% %]ugzilla->template; +use Bugzilla::Error; +my $template = Bugzilla->template; $template->process('[% name FILTER lower %]/some-template.html.tmpl') or ThrowTemplateError($template->error()); @@ -18,7 +18,7 @@ That would be how to load a file called <kbd>some-template.html.tmpl</kbd> 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 [% terms.Bugzilla %] or in +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 '[% name FILTER lower %]' for you, so you can put your templates in here to help avoid conflicts. diff --git a/template/en/default/extensions/util.pm.tmpl b/template/en/default/extensions/util.pm.tmpl index 6c9fe3795..3baab57fd 100644 --- a/template/en/default/extensions/util.pm.tmpl +++ b/template/en/default/extensions/util.pm.tmpl @@ -12,15 +12,19 @@ [% PROCESS extensions/license.txt.tmpl %] -package B[% %]ugzilla::Extension::[% name %]::Util; +package Bugzilla::Extension::[% name %]::Util; + +use 5.10.1; use strict; -use base qw(Exporter); +use warnings; + +use parent qw(Exporter); our @EXPORT = qw( ); # This file can be loaded by your extension via -# "use B[% %]ugzilla::Extension::[% name %]::Util". You can put functions +# "use Bugzilla::Extension::[% name %]::Util". You can put functions # used by your extension in here. (Make sure you also list them in # @EXPORT.) diff --git a/template/en/default/filterexceptions.pl b/template/en/default/filterexceptions.pl index e37fec1a7..6adbbcb95 100644 --- a/template/en/default/filterexceptions.pl +++ b/template/en/default/filterexceptions.pl @@ -78,9 +78,6 @@ 'classes.$row_idx.$col_idx', 'urlbase', 'data.$tbl.$col.$row', - 'row_total', - 'col_totals.$col', - 'grand_total', ], 'reports/report.html.tmpl' => [ @@ -192,10 +189,6 @@ 'script', ], -'global/site-navigation.html.tmpl' => [ - 'bug.bug_id', -], - 'bug/comments.html.tmpl' => [ 'comment.id', 'comment.count', @@ -261,16 +254,13 @@ 'bug/time.html.tmpl' => [ - 'time_unit FILTER format(\'%.1f\')', - 'time_unit FILTER format(\'%.2f\')', + "time_unit.replace('0\\Z', '')", '(act / (act + rem)) * 100 FILTER format("%d")', ], 'bug/process/results.html.tmpl' => [ - 'title.$type', - '"$terms.Bug $id" FILTER bug_link(id)', - '"$terms.bug $id" FILTER bug_link(id)', + 'title.$type.ucfirst', ], 'bug/create/create.html.tmpl' => [ @@ -278,9 +268,7 @@ ], 'bug/create/create-guided.html.tmpl' => [ - 'tablecolour', 'sel', - 'productstring', ], 'bug/activity/table.html.tmpl' => [ @@ -301,6 +289,7 @@ 'attachment.id', 'attachment.bug_id', 'editable_or_hide', + 'use_patchviewer', ], 'attachment/list.html.tmpl' => [ @@ -333,10 +322,8 @@ ], 'attachment/diff-file.html.tmpl' => [ - 'lxr_prefix', 'file.minus_lines', 'file.plus_lines', - 'bonsai_prefix', 'section.old_start', 'section_num', 'current_line_old', diff --git a/template/en/default/flag/list.html.tmpl b/template/en/default/flag/list.html.tmpl index 4d7eefb48..169cf8a51 100644 --- a/template/en/default/flag/list.html.tmpl +++ b/template/en/default/flag/list.html.tmpl @@ -6,7 +6,7 @@ # defined by the Mozilla Public License, v. 2.0. #%] -[% IF user.id && !read_only_flags && (!bug || bug.check_can_change_field('flagtypes.name', 0, 1)) %] +[% IF user.id && (!bug || bug.check_can_change_field('flagtypes.name', 0, 1)) %] [%# We list flags by looping twice over the flag types relevant for the bug. # In the first loop, we display existing flags and then, for active types, @@ -23,13 +23,12 @@ <table id="[% flag_table_id FILTER html %]"> [% UNLESS flag_no_header %] <tr> - <th colspan="3"> - Flags: - </th> + <th colspan="3">Flags:</th> [% IF any_flags_requesteeble %] - <th> - Requestee: - </th> + <th>Requestee:</th> + [% END %] + [% IF edit_multiple_bugs %] + <th> </th> [% END %] </tr> [% END %] @@ -41,7 +40,9 @@ [% FOREACH flag = type.flags %] [% PROCESS flag_row flag = flag type = type %] [% END -%] + [% SET flag = "" %] + [% NEXT IF read_only_flags %] [%-# Step 1b: Display UI for setting flag. %] [% IF (!type.flags || type.flags.size == 0) && type.is_active %] @@ -49,16 +50,21 @@ [% END %] [% END %] - [%# Step 2: Display flag type again (if type is multiplicable). %] - [% FOREACH type = flag_types %] - [% NEXT UNLESS type.flags && type.flags.size > 0 && type.is_multiplicable && type.is_active %] - [% IF !separator_displayed %] - <tbody class="bz_flag_type"> - <tr><td colspan="3"><hr></td></tr> - </tbody> - [% separator_displayed = 1 %] + [% IF !read_only_flags %] + [%# Step 2: Display flag type again (if type is multiplicable). %] + [% FOREACH type = flag_types %] + [% NEXT UNLESS type.flags && type.flags.size > 0 && type.is_multiplicable && type.is_active %] + [% IF !separator_displayed %] + <tbody class="bz_flag_type"> + [% sep_length = 3 + (any_flags_requesteeble ? 1 : 0) + (edit_multiple_bugs ? 1 : 0) %] + <tr> + <td colspan="[% sep_length FILTER html %]"><hr></td> + </tr> + </tbody> + [% separator_displayed = 1 %] + [% END %] + [% PROCESS flag_row type = type addl_text = "addl." %] [% END %] - [% PROCESS flag_row type = type addl_text = "addl." %] [% END %] </table> @@ -76,7 +82,7 @@ [% ELSE %] [% flag.setter.nick FILTER html %]: [% END %] - [%+ type.name FILTER html FILTER no_break %][% flag.status %] + <span class="nowrap">[%+ type.name FILTER html %][% flag.status %]</span> [% IF flag.requestee %] [% IF flag.requestee.name %] (<span title="[% flag.requestee.name FILTER html %]">[% flag.requestee.nick FILTER html %]</span>) @@ -93,6 +99,7 @@ [% BLOCK flag_row %] [% RETURN IF !flag && !((type.is_requestable && user.can_request_flag(type)) || user.can_set_flag(type)) %] [% SET fid = flag ? "flag-$flag.id" : "flag_type-$type.id" %] + [% can_edit_flag = (!read_only_flags || (flag && (flag.setter_id == user.id || (flag.requestee_id && flag.requestee_id == user.id)))) ? 1 : 0 %] <tbody[% ' class="bz_flag_type"' IF !flag %]> <tr> <td> @@ -102,21 +109,25 @@ [% addl_text FILTER html %] [% END %] </td> - <td> + <td class="nowrap"> <label title="[% type.description FILTER html %]" for="[% fid FILTER html %]"> - [%- type.name FILTER html FILTER no_break -%]</label> + [%- type.name FILTER html %]</label> </td> <td> <input type="hidden" id="[% fid FILTER html %]_dirty"> <select id="[% fid FILTER html %]" name="[% fid FILTER html %]" title="[% type.description FILTER html %]" onchange="toggleRequesteeField(this);" - class="flag_select flag_type-[% type.id %]"> + class="flag_select flag_type-[% type.id %]" + [% IF !can_edit_flag %] disabled="disabled"[% END %]> [%# Only display statuses the user is allowed to set. %] - [% IF !flag || user.can_request_flag(type) || flag.setter_id == user.id %] - <option value="X"></option> + [% IF edit_multiple_bugs %] + <option value="--do_not_change--">--do_not_change--</option> + [% END %] + [% IF !flag || (can_edit_flag && user.can_request_flag(type)) || flag.setter_id == user.id %] + <option value="X" label="X"></option> [% END %] - [% IF type.is_active %] + [% IF type.is_active && can_edit_flag %] [% IF (type.is_requestable && user.can_request_flag(type)) || (flag && flag.status == "?") %] <option value="?" [% "selected" IF flag && flag.status == "?" %]>?</option> [% END %] @@ -132,17 +143,17 @@ </select> </td> [% IF any_flags_requesteeble %] - <td> + <td class="bz_flags"> [% IF (type.is_active && type.is_requestable && type.is_requesteeble) || (flag && flag.requestee) %] - <span style="white-space: nowrap;"> [% SET grant_list = [] %] [% IF Param('usemenuforusers') %] - [% grant_list = type.grant_list %] - [% IF flag && !(type.is_active && type.is_requestable && type.is_requesteeble) %] + [% IF !can_edit_flag || (flag && !(type.is_active && type.is_requestable && type.is_requesteeble)) %] [%# We are here only because there was already a requestee. In this case, the only valid action is to remove the requestee or leave it alone; nothing else. %] [% grant_list = [flag.requestee] %] + [% ELSE %] + [% grant_list = type.grant_list %] [% END %] [% END %] [% SET flag_name = flag ? "requestee-$flag.id" : "requestee_type-$type.id" %] @@ -157,11 +168,24 @@ emptyok => flag_empty_ok classes => ["requestee"] custom_userlist => grant_list + disabled => !can_edit_flag %] - </span> [% END %] </td> [% END %] + [% IF edit_multiple_bugs %] + <td> + [% IF type.is_multiplicable %] + <input type="checkbox" name="flags_add-[% type.id %]" + id="flags_add-[% type.id %]" value="1"> + <label for="flags_add-[% type.id %]" + title="If ticked, always create a new flag. Leaving it unchecked will + update existing flag(s) and add a new flag if it does not exist"> + Always add + </label> + [% END %] + </td> + [% END %] </tr> </tbody> [% END %] diff --git a/template/en/default/global/choose-classification.html.tmpl b/template/en/default/global/choose-classification.html.tmpl index 76789a2fc..8433380ea 100644 --- a/template/en/default/global/choose-classification.html.tmpl +++ b/template/en/default/global/choose-classification.html.tmpl @@ -12,23 +12,26 @@ #%] [% IF target == "enter_bug.cgi" %] - [% title = "Select Classification" %] - [% subheader = "Please select the classification." %] + [% title = "Enter $terms.Bug" %] + [% subheader = "Select Classification" %] [% END %] [% DEFAULT title = "Choose the classification" %] [% PROCESS global/header.html.tmpl %] -<table> +[% USE Bugzilla %] +[% previous_params = Bugzilla.cgi.canonicalise_query('classification') %] + +<h2>First, you must pick a classification on which to enter [% terms.abug %]:</h2> +<table id="choose_classification"> <tr> - <th align="right"> + <th class="right"> <a href="[% target FILTER uri %]?classification=__all - [% IF cloned_bug_id %]&cloned_bug_id=[% cloned_bug_id FILTER uri %][% END -%] - [%- IF format %]&format=[% format FILTER uri %][% END %]"> + [%- IF previous_params %]&[% previous_params FILTER none %][% END -%]"> All</a>: </th> - <td valign="top"> Show all products</td> + <td>Show all products</td> </tr> <tr> <th colspan="2"> </th> @@ -36,15 +39,14 @@ [% FOREACH class = classifications %] <tr> - <th align="right"> + <th class="right"> <a href="[% target FILTER uri %]?classification=[% class.name FILTER uri -%] - [%- IF cloned_bug_id %]&cloned_bug_id=[% cloned_bug_id FILTER uri %][% END -%] - [%- IF format %]&format=[% format FILTER uri %][% END %]"> + [%- IF previous_params %]&[% previous_params FILTER none %][% END -%]"> [% class.name FILTER html %]</a>: </th> [% IF class.description %] - <td valign="top"> [% class.description FILTER html_light %]</td> + <td>[% class.description FILTER html_light %]</td> [% END %] </tr> [% END %] diff --git a/template/en/default/global/choose-product.html.tmpl b/template/en/default/global/choose-product.html.tmpl index 944ceb15d..a1582532a 100644 --- a/template/en/default/global/choose-product.html.tmpl +++ b/template/en/default/global/choose-product.html.tmpl @@ -11,13 +11,15 @@ # classification object and 'products' the list of # product objects the user can enter bugs into. # target: the script that displays this template. - # cloned_bug_id: ID of the bug being cloned. - # format: the desired format to display the target. #%] [% IF target == "enter_bug.cgi" %] [% title = "Enter $terms.Bug" %] - [% h2 = BLOCK %]First, you must pick a product on which to enter [% terms.abug %]: [% END %] + [% subheader = "Select Product" %] + [% h2 = BLOCK %] + [% IF Param('useclassification') %]Next[% ELSE %]First[% END %], + you must pick a product on which to enter [% terms.abug %]: + [% END %] [% ELSIF target == "describecomponents.cgi" %] [% title = "Browse" %] [% h2 = "Select a product category to browse:" %] @@ -26,78 +28,30 @@ [% DEFAULT title = "Choose a Product" %] [% PROCESS global/header.html.tmpl %] -<h2>[% h2 FILTER html %]</h2> - -[% IF target == "enter_bug.cgi" %] -<div class="important-message"> - Please consult the <a href="http://www.gentoo.org/doc/en/bugzilla-howto.xml#doc_chap6">Bug Reporting Guide</a> - on how to choose the proper product for your issue. -</div> -[% END %] +[% USE Bugzilla %] +[% previous_params = Bugzilla.cgi.canonicalise_query('classification', 'product') %] +<h2>[% h2 FILTER html %]</h2> -<table> -[% IF target == "enter_bug.cgi" %] - <tr><td colspan="2">If you are <strong>unsure</strong>, please file your bug in this product:</td></tr> - <tr class="hilight"> - <th align="right" valign="top"> - <a href="[% target %]?product=Gentoo%20Linux - [%- IF cloned_bug_id %]&cloned_bug_id=[% cloned_bug_id FILTER uri %][% END -%] - [%- IF format %]&format=[% format FILTER uri %][% END %]"> - Gentoo Linux</a>: - </th> - <td valign="top"><b>The Gentoo Linux Distribution – Ebuilds and System related issues</b></td> - </tr> - <tr class="vspace"> - <td> </td> - <td> - <strong>Always attach the output of <tt>emerge --info</tt> to your bug report!</strong> - <br /><br /> - Before reporting a bug, please make sure the issue you are about to file - is not the result of a misconfiguration on your part.<br /> - Our other support venues (for instance the - <a href="http://forums.gentoo.org/">Forums</a> or - <a href="http://www.gentoo.org/main/en/irc.xml">IRC channels</a>) - can help you find out whether the issue warrants a bug report. - <br /><br /> - Examples for bugs in this product: - <ul> - <li>New package and version bump requests</li> - <li>Compile errors (please follow the instructions contained in the error message!)</li> - <li>Application crashes (be sure to have a <a href="http://www.gentoo.org/proj/en/qa/backtraces.xml">backtrace</a> available)</li> - <li>General issues regarding your Gentoo system</li> - </ul> +<table id="choose_product"> - Examples for bugs that should <span style="color: #a40000;">NOT</span> be filed here: - <ul> - <li>Security updates (use <em>Gentoo Security</em> below)</li> - <li>Documentation updates (use <em>Documentation</em> below)</li> - <li>Issues regarding our website and infrastructure (use <em>Gentoo Infrastructure</em> or <em>Website www.gentoo.org</em> below)</li> - <li>Issues about <em>OpenRC</em>, <em>genkernel</em>, or <em>catalyst</em> (use <em>Hosted projects</em> below)</li> - </ul> - </td></tr> - <tr> - <td colspan="2"><hr />Or, use one of the following products <strong>if you know that your choice is correct:</strong></td> - </tr> -[% END %] [% FOREACH c = classifications %] [% IF c.object %] <tr> - <th colspan="2" align="left">[% c.object.name FILTER html %]: + <th colspan="2" class="left">[% c.object.name FILTER html %]: [%+ c.object.description FILTER html_light %]</th> </tr> [% END %] [% FOREACH p = c.products %] <tr> - <th align="right" valign="top"> + <th class="right nowrap"> <a href="[% target %]?product=[% p.name FILTER uri -%] - [%- IF cloned_bug_id %]&cloned_bug_id=[% cloned_bug_id FILTER uri %][% END -%] - [%- IF format %]&format=[% format FILTER uri %][% END %]"> - [% p.name FILTER html FILTER no_break %]</a>: + [%- IF previous_params %]&[% previous_params FILTER none %][% END -%]"> + [% p.name FILTER html %]</a>: </th> - <td valign="top">[% p.description FILTER html_light %]</td> + <td>[% p.description FILTER html_light %]</td> </tr> [% END %] diff --git a/template/en/default/global/code-error.html.tmpl b/template/en/default/global/code-error.html.tmpl index e4416326b..d73d75e13 100644 --- a/template/en/default/global/code-error.html.tmpl +++ b/template/en/default/global/code-error.html.tmpl @@ -50,8 +50,8 @@ [% ELSIF error == "chart_data_not_generated" %] [% admindocslinks = {'extraconfig.html' => 'Setting up Charting'} %] - [% IF product %] - Charts for the <em>[% product FILTER html %]</em> product are not + [% IF product.id %] + Charts for the <em>[% product.name FILTER html %]</em> product are not available yet because no charting data has been collected for it since it was created. [% ELSE %] @@ -64,13 +64,13 @@ [% ELSIF error == "chart_datafile_corrupt" %] The chart data file [% file FILTER html %] is corrupt. - + [% ELSIF error == "chart_dir_nonexistent" %] - One of the directories <tt>[% dir FILTER html %]</tt> and - <tt>[% graph_dir FILTER html %]</tt> does not exist. - + One of the directories <kbd>[% dir FILTER html %]</kbd> and + <kbd>[% graph_dir FILTER html %]</kbd> does not exist. + [% ELSIF error == "chart_file_open_fail" %] - Unable to open the chart datafile <tt>[% filename FILTER html %]</tt>. + Unable to open the chart datafile <kbd>[% filename FILTER html %]</kbd>. [% ELSIF error == "column_alter_nonexistent_fk" %] You attempted to modify the foreign key for @@ -112,7 +112,7 @@ Every cookie must have a value. [% ELSIF error == "env_no_email" %] - [% terms.Bugzilla %] did not receive an email address from the + Bugzilla did not receive an email address from the environment. [% IF Param("auth_env_email") %] This means that the '[% Param("auth_env_email") FILTER html %]' @@ -386,7 +386,7 @@ [% ELSIF error == "search_field_operator_unsupported" %] [% title = "Invalid Search Type" %] - [% terms.Bugzilla %] does not support the search type + Bugzilla does not support the search type "[% operator.truncate(30, "...") FILTER html %]". [% ELSE %] @@ -394,7 +394,7 @@ [% error_message = Hook.process("errors") %] [% IF NOT error_message %] [% title = "Internal error" %] - An internal error has occurred, but [% terms.Bugzilla %] doesn't know + An internal error has occurred, but Bugzilla doesn't know what <code>[% error FILTER html %]</code> means. If you are a [% terms.Bugzilla %] end-user seeing this message, please save @@ -432,25 +432,18 @@ with details of what you were doing at the time this message appeared. </p> -<tt> - <script type="text/javascript"> <!-- - document.write("<p>URL: " + - document.location.href.replace(/&/g,"&") - .replace(/</g,"<") - .replace(/>/g,">") + "</p>"); - // --> - </script> -</tt> - -<table cellpadding="20"> - <tr> - <td id="error_msg" class="throw_error"> - [% error_message FILTER none %] - </td> - </tr> -</table> +<p> + <samp>URL: [% Bugzilla.cgi.self_url FILTER html %]</samp> +</p> + +<div id="error_msg" class="throw_error"> + [% error_message FILTER none %] +</div> + +<p id="post_err_msg"> + Traceback: +</p> -<p>Traceback:</p> <pre>[% traceback FILTER html %]</pre> [% IF variables %] diff --git a/template/en/default/global/common-links.html.tmpl b/template/en/default/global/common-links.html.tmpl index 1c135cf01..e256bb619 100644 --- a/template/en/default/global/common-links.html.tmpl +++ b/template/en/default/global/common-links.html.tmpl @@ -49,13 +49,11 @@ [% END %] [%-# Work around FF bug: keep this on one line %]</li> + [% Hook.process('action-links') %] + [% IF user.login %] <li><span class="separator">| </span><a href="userprefs.cgi">Preferences</a></li> - [% IF user.in_group('tweakparams') || user.in_group('editusers') || user.can_bless - || (Param('useclassification') && user.in_group('editclassifications')) - || user.in_group('editcomponents') || user.in_group('admin') || user.in_group('creategroups') - || user.in_group('editkeywords') || user.in_group('bz_canusewhines') - || user.get_products_by_permission("editcomponents").size %] + [% IF user.can_administer %] <li><span class="separator">| </span><a href="admin.cgi">Administration</a></li> [% END %] @@ -102,7 +100,7 @@ [% Hook.process("link-row") %] [% BLOCK link_to_documentation %] - [% IF doc_section && Param('docs_urlbase') %] + [% IF doc_section %] <li> <span class="separator">| </span> <a href="[% docs_urlbase _ doc_section FILTER html %]" target="_blank">Help</a> diff --git a/template/en/default/global/confirm-user-match.html.tmpl b/template/en/default/global/confirm-user-match.html.tmpl index c31567a9c..613f097e1 100644 --- a/template/en/default/global/confirm-user-match.html.tmpl +++ b/template/en/default/global/confirm-user-match.html.tmpl @@ -54,7 +54,7 @@ <p> [% IF matchmultiple %] - [% terms.Bugzilla %] cannot make a conclusive match for one or more + Bugzilla cannot make a conclusive match for one or more of the names and/or email addresses you entered on the previous page. <br>Please examine the lists of potential matches below and select the ones you want, @@ -69,7 +69,7 @@ [% ELSE %] [% PROCESS global/header.html.tmpl title="Match Failed" %] <p> - [% terms.Bugzilla %] was unable to make any match at all for one or more of + Bugzilla was unable to make any match at all for one or more of the names and/or email addresses you entered on the previous page. [% IF !user.id %] <b>Note: You are currently logged out. Only exact matches against e-mail @@ -79,30 +79,22 @@ <p>Please go back and try other names or email addresses.</p> [% END %] - <table border="0"> - <tr> - <td colspan="2"> - <hr width="100%" size="1"> - </td> - </tr> - - [%# this is messy to allow later expansion %] - +<table id="user_match_table"> [% FOREACH field = matches %] <tr> - <td align="left" valign="top"> + <td> [% PROCESS field_names field_name=field.key %]: </td> - <td align="left" valign="top"> + <td> [% FOREACH query = field.value %] <div class="user_match"> <b>[% query.key FILTER html %]</b> [% IF query.value.users.size %] [% IF query.value.users.size > 1 %] [% IF query.value.status == 'fail' %] - <font color="#FF0000"> + <span class="warning"> matches multiple users. - </font> + </span> Please go back and try again with a more specific name/address. [% ELSE %] @@ -136,31 +128,26 @@ <b>[% query.value.users.0.identity FILTER html %]</b> [% END %] [% ELSE %] + <span class="warning"> [% IF query.key.length < 3 %] - <font color="#FF0000">was too short for substring match - (minimum 3 characters)</font> + was too short for substring match (minimum 3 characters) [% ELSE %] - <font color="#FF0000">did not match anything</font> + did not match anything [% END %] + </span> [% END %] </div> [% END %] </td> </tr> - <tr> - <td colspan="2"> - <hr width="100%" size="1"> - </td> - </tr> [% END %] - - </table> +</table> [% IF matchsuccess == 1 %] [% SET exclude_these = ['Bugzilla_login', 'Bugzilla_password'] %] [% FOREACH key IN matches.keys %] - [% exclude_these.push(key) IF cgi.param(key) == '' %] + [% exclude_these.push(key) IF Bugzilla.cgi.param(key) == '' %] [% END %] [% SET exclude = '^' _ exclude_these.join('|') _ '$' %] [% PROCESS "global/hidden-fields.html.tmpl" exclude = exclude %] diff --git a/template/en/default/global/docslinks.html.tmpl b/template/en/default/global/docslinks.html.tmpl index c2cc830fa..e33aa3b17 100644 --- a/template/en/default/global/docslinks.html.tmpl +++ b/template/en/default/global/docslinks.html.tmpl @@ -22,8 +22,7 @@ # members of the admin group. #%] -[% IF Param('docs_urlbase') && - docslinks.keys.size || (admindocslinks.keys.size && user.in_group('admin')) %] +[% IF docslinks.keys.size || (admindocslinks.keys.size && user.in_group('admin')) %] <div id="docslinks"> <h2>Related documentation</h2> <ul> diff --git a/template/en/default/global/field-descs.none.tmpl b/template/en/default/global/field-descs.none.tmpl index f1e0747da..f4e17c3f8 100644 --- a/template/en/default/global/field-descs.none.tmpl +++ b/template/en/default/global/field-descs.none.tmpl @@ -34,15 +34,19 @@ "changedto" => "changed to", "changedby" => "changed by", "matches" => "matches", - "notmatches" => "does not match", + "notmatches" => "does not match", + "isempty" => "is empty", + "isnotempty" => "is not empty", } %] [% field_types = { ${constants.FIELD_TYPE_UNKNOWN} => "Unknown Type", ${constants.FIELD_TYPE_FREETEXT} => "Free Text", + ${constants.FIELD_TYPE_INTEGER} => "Integer", ${constants.FIELD_TYPE_SINGLE_SELECT} => "Drop Down", ${constants.FIELD_TYPE_MULTI_SELECT} => "Multiple-Selection Box", ${constants.FIELD_TYPE_TEXTAREA} => "Large Text Box", ${constants.FIELD_TYPE_DATETIME} => "Date/Time", + ${constants.FIELD_TYPE_DATE} => "Date", ${constants.FIELD_TYPE_BUG_ID} => "$terms.Bug ID", } %] @@ -92,6 +96,7 @@ "everconfirmed" => "Ever confirmed", "flagtypes.name" => "Flags", "keywords" => "Keywords", + "last_visit_ts" => "Last Visit", "longdesc" => "Comment", "longdescs.count" => "Number of Comments", "longdescs.isprivate" => "Comment is private", @@ -119,7 +124,7 @@ "short_desc" => "Summary", "short_short_desc" => "Summary", "status_whiteboard" => "Whiteboard", - "tag" => "Tags", + "tag" => "Personal Tags", "target_milestone" => "Target Milestone", "version" => "Version", "work_time" => "Hours Worked", diff --git a/template/en/default/global/footer.html.tmpl b/template/en/default/global/footer.html.tmpl index e161a061c..7cc5e1b44 100644 --- a/template/en/default/global/footer.html.tmpl +++ b/template/en/default/global/footer.html.tmpl @@ -11,26 +11,17 @@ # global/useful-links.html.tmpl. #%] - [% Hook.process('main-end') %] -</div> + [% Hook.process('main-end') %] + </div> -[%# Migration note: below this point, this file corresponds to the old Param - # 'footerhtml' - #%] - -<div id="footer"> - <div class="intro">[% Hook.process('intro') %]</div> - -[%# Migration note: the old param 'blurbhtml' goes here %] - -[%# Migration note: useful-links.html.tmpl corresponds to %commandmenu% %] - - [% PROCESS "global/useful-links.html.tmpl" %] + <div id="footer"> + <div class="intro">[% Hook.process('intro') %]</div> - <div class="outro">[% Hook.process('outro') %]</div> -</div> + [% PROCESS "global/useful-links.html.tmpl" %] -[% Hook.process("end") %] + <div class="outro">[% Hook.process('outro') %]</div> + </div> -</body> + [% Hook.process("end") %] + </body> </html> diff --git a/template/en/default/global/header.html.tmpl b/template/en/default/global/header.html.tmpl index cfa4202bc..f91c55626 100644 --- a/template/en/default/global/header.html.tmpl +++ b/template/en/default/global/header.html.tmpl @@ -20,6 +20,7 @@ # style_urls: list. List of URLs to CSS style sheets. # message: string. A message to display to the user. May contain HTML. # atomlink: Atom link URL, May contain HTML + # generate_api_token: generate a token which can be used to make authenticated webservice calls #%] [% IF message %] @@ -32,6 +33,7 @@ onload = "" style_urls = [] yui = [] + generate_api_token = 0 %] [% SET yui_css = { @@ -75,8 +77,7 @@ # set header's default value here only if it is undefined. %] [% IF !header.defined %][% header = title %][% END %] -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" - "http://www.w3.org/TR/html4/loose.dtd"> +<!DOCTYPE html> <html lang="en"> <head> [% Hook.process("start") %] @@ -86,42 +87,34 @@ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> [% END %] -[%# Migration note: contents of the old Param 'headerhtml' would go here %] - - [% PROCESS "global/site-navigation.html.tmpl" %] - - [% PROCESS 'global/setting-descs.none.tmpl' %] - [% SET yui = yui_resolve_deps(yui, yui_deps) %] - [% SET css_sets = css_files(style_urls, yui, yui_css) %] - [%# CSS cascade, parts 1 & 2: YUI & Standard Bugzilla stylesheet set (persistent). - # Always present. %] - <link href="[% 'skins/standard/global.css' FILTER mtime FILTER html %]" - rel="alternate stylesheet" - title="[% setting_descs.standard FILTER html %]"> - [% FOREACH style_url = css_sets.standard %] - [% PROCESS format_css_link css_set_name = 'standard' %] - [% END %] - - [%# CSS cascade, part 3: Third-party stylesheet set, per user prefs. %] - [% FOREACH style_url = css_sets.skin %] - [% PROCESS format_css_link css_set_name = user.settings.skin.value %] + [% SET css_sets = css_files(style_urls, yui, yui_css) %] + [% IF constants.CONCATENATE_ASSETS %] + [% PROCESS format_css_link asset_url = css_sets.unified_standard_skin %] + [% ELSE %] + [% FOREACH asset_url = css_sets.standard %] + [% PROCESS format_css_link %] + [% END %] + [% FOREACH asset_url = css_sets.skin %] + [% PROCESS format_css_link %] + [% END %] [% END %] - [%# CSS cascade, part 4: page-specific styles. %] [% IF style %] <style type="text/css"> [% style %] </style> [% END %] - [%# CSS cascade, part 5: Custom Bugzilla stylesheet set (persistent). - # Always present. Site administrators may override all other style - # definitions, including skins, using custom stylesheets. - #%] - [% FOREACH style_url = css_sets.custom %] - [% PROCESS format_css_link css_set_name = 'standard' %] + [% IF css_sets.unified_custom %] + [% IF constants.CONCATENATE_ASSETS %] + [% PROCESS format_css_link asset_url = css_sets.unified_custom %] + [% ELSE %] + [% FOREACH asset_url = css_sets.custom %] + [% PROCESS format_css_link %] + [% END %] + [% END %] [% END %] [%# YUI Scripts %] @@ -130,7 +123,7 @@ [% END %] [% starting_js_urls.push('js/global.js') %] - [% FOREACH javascript_url = starting_js_urls %] + [% FOREACH asset_url = concatenate_js(starting_js_urls) %] [% PROCESS format_js_link %] [% END %] @@ -174,16 +167,19 @@ [%# Please keep these in alphabetical order. %] attach_desc_required: - 'You must enter a Description for this attachment.', + "You must enter a Description for this attachment.", component_required: - 'You must select a Component for this [% terms.bug %].', + "You must select a Component for this [% terms.bug %].", description_required: - 'You must enter a Description for this [% terms.bug %].', + "You must enter a Description for this [% terms.bug %].", short_desc_required: - 'You must enter a Summary for this [% terms.bug %].', + "You must enter a Summary for this [% terms.bug %].", version_required: - 'You must select a Version for this [% terms.bug %].' + "You must select a Version for this [% terms.bug %]." } + [% IF generate_api_token %] + , api_token: '[% get_api_token FILTER js FILTER html %]' + [% END %] }; [% FOREACH yui_name = yui %] @@ -197,7 +193,7 @@ // --> </script> - [% FOREACH javascript_url = javascript_urls %] + [% FOREACH asset_url = concatenate_js(javascript_urls) %] [% PROCESS format_js_link %] [% END %] @@ -215,101 +211,66 @@ [% Hook.process("additional_header") %] </head> -[%# Migration note: contents of the old Param 'bodyhtml' go in the body tag, - # but set the onload attribute in the DEFAULT directive above. - #%] - - <body onload="[% onload %]" + <body [% IF onload %] onload="[% onload %]"[% END %] class="[% urlbase.replace('^https?://','').replace('/$','').replace('[-~@:/.]+','-') FILTER css_class_quote %] [% FOREACH class = bodyclasses %] - [% ' ' %][% class FILTER css_class_quote %] + [%+ class FILTER css_class_quote %] [% END %] yui-skin-sam"> [% Hook.process("after_body_start") %] -[%# Migration note: the following file corresponds to the old Param - # 'bannerhtml' - #%] - -<div id="header"> - -[% INCLUDE global/banner.html.tmpl %] - -<table border="0" cellspacing="0" cellpadding="0" id="titles"> -<tr> - <td id="title"> - <p>[% terms.Bugzilla %] - [% " – $header" IF header %]</p> - </td> - - [% IF subheader %] - <td id="subtitle"> - <p class="subheader">[% subheader %]</p> - </td> - [% END %] - - [% IF header_addl_info %] - <td id="information"> - <p class="header_addl_info">[% header_addl_info %]</p> - </td> - [% END %] -</tr> -</table> - -<table id="lang_links_container" cellpadding="0" cellspacing="0" - class="bz_default_hidden"><tr><td> -[% IF Bugzilla.languages.size > 1 %] - <ul class="links"> - [% FOREACH lang = Bugzilla.languages.sort %] - <li>[% IF NOT loop.first %]<span class="separator"> | </span>[% END %] - [% IF lang == current_language %] - <span class="lang_current">[% lang FILTER html FILTER upper %]</span> - [% ELSE %] - <a href="#" onclick="set_language('[% lang FILTER none %]');"> - [%- lang FILTER html FILTER upper %]</a> + <div id="header"> + [% INCLUDE global/banner.html.tmpl %] + + <div id="titles"> + <span id="title">[% terms.Bugzilla %][% " – $header" IF header %]</span> + + [% IF subheader %] + <span id="subtitle" class="subheader">[% subheader %]</span> + [% END %] + + [% IF header_addl_info %] + <span id="information" class="header_addl_info">[% header_addl_info %]</span> + [% END %] + </div> + + [% USE Bugzilla %] + [% IF Bugzilla.languages.size > 1 %] + <div id="lang_links_container" class="bz_default_hidden"> + <ul class="links"> + [% FOREACH lang = Bugzilla.languages.sort %] + <li> + [% IF NOT loop.first %]<span class="separator"> | </span>[% END %] + [% IF lang == current_language %] + <span class="lang_current">[% lang FILTER html FILTER upper %]</span> + [% ELSE %] + <a href="#" onclick="set_language('[% lang FILTER none %]');"> + [%- lang FILTER html FILTER upper %]</a> + [% END %] + </li> + [% END %] + </ul> + </div> [% END %] - </li> - [% END %] - </ul> -[% END %] -</td></tr></table> - -[% PROCESS "global/common-links.html.tmpl" qs_suffix = "_top" %] -</div> [%# header %] - -<div id="bugzilla-body"> - -[% IF Param('announcehtml') %] -[% Param('announcehtml') FILTER none %] -[% END %] -[% IF message %] - <div id="message">[% message %]</div> -[% END %] + <div id="common_links"> + [% PROCESS "global/common-links.html.tmpl" qs_suffix = "_top" %] + </div> + </div> -[% BLOCK format_css_link %] - [% IF style_url.match('/IE-fixes\.css') %] - <!--[if lte IE 7]> - [%# Internet Explorer treats [if IE] HTML comments as uncommented. - # We use it to import CSS fixes so that Bugzilla looks decent on IE 7 - # and below. - #%] - [% END %] - - [% IF css_set_name == 'standard' %] - [% SET css_title_link = '' %] - [% ELSE %] - [% css_title_link = BLOCK ~%] - title="[% setting_descs.${user.settings.skin.value} || user.settings.skin.value FILTER html %]" + <div id="bugzilla-body"> + [% IF Param('announcehtml') %] + [% Param('announcehtml') FILTER none %] [% END %] - [% END %] - <link href="[% style_url FILTER html %]" rel="stylesheet" - type="text/css" [% css_title_link FILTER none %]> + [% IF message %] + <div id="message">[% message %]</div> + [% END %] - [% '<![endif]-->' IF style_url.match('/IE-fixes\.css') %] +[% BLOCK format_css_link %] + <link href="[% asset_url FILTER html %]" rel="stylesheet" type="text/css"> [% END %] [% BLOCK format_js_link %] - <script type="text/javascript" src="[% javascript_url FILTER mtime FILTER html %]"></script> + <script type="text/javascript" src="[% asset_url FILTER mtime FILTER html %]"></script> [% END %] diff --git a/template/en/default/global/messages.html.tmpl b/template/en/default/global/messages.html.tmpl index ba961c392..3a8aa1ada 100644 --- a/template/en/default/global/messages.html.tmpl +++ b/template/en/default/global/messages.html.tmpl @@ -26,14 +26,12 @@ canceled. [% ELSIF message_tag == "account_updated" %] - [% IF changed_fields.size - + groups_added_to.size + groups_removed_from.size - + groups_granted_rights_to_bless.size + groups_denied_rights_to_bless.size %] + [% IF changes.size %] [% title = "User $loginold updated" %] The following changes have been made to the user account [%+ loginold FILTER html %]: <ul> - [% FOREACH field = changed_fields %] + [% FOREACH field = changes.keys %] <li> [% IF field == 'login_name' %] The login is now [% otheruser.login FILTER html %]. @@ -53,35 +51,31 @@ [% ELSE %] [% terms.Bug %]mail has been enabled. [% END %] + [% ELSIF field == 'groups' %] + [% IF changes.groups.1.size %] + The account has been added to the + [%+ changes.groups.1.join(', ') FILTER html %] + group[% 's' IF changes.groups.1.size > 1 %]. + [% END %] + [% IF changes.groups.0.size %] + The account has been removed from the + [%+ changes.groups.0.join(', ') FILTER html %] + group[% 's' IF changes.groups.0.size > 1 %]. + [% END %] + [% ELSIF field == 'bless_groups' %] + [% IF changes.bless_groups.1.size %] + The account has been granted rights to bless the + [%+ changes.bless_groups.1.join(', ') FILTER html %] + group[% 's' IF changes.bless_groups.1.size > 1 %]. + [% END %] + [% IF changes.bless_groups.0.size %] + The account has been denied rights to bless the + [%+ changes.bless_groups.0.join(', ') FILTER html %] + group[% 's' IF changes.bless_groups.0.size > 1 %]. + [% END %] [% END %] </li> [% END %] - [% IF groups_added_to.size %] - <li> - The account has been added to the following group[% 's' IF groups_added_to.size > 1 %]: - [%+ groups_added_to.join(', ') FILTER html %] - </li> - [% END %] - [% IF groups_removed_from.size %] - <li> - The account has been removed from the following group[% 's' IF groups_removed_from.size > 1 %]: - [%+ groups_removed_from.join(', ') FILTER html %] - </li> - [% END %] - [% IF groups_granted_rights_to_bless.size %] - <li> - The account has been granted rights to bless the - [%+ groups_granted_rights_to_bless.join(', ') FILTER html %] - group[% 's' IF groups_granted_rights_to_bless.size > 1 %]. - </li> - [% END %] - [% IF groups_denied_rights_to_bless.size %] - <li> - The account has been denied rights to bless the - [%+ groups_denied_rights_to_bless.join(', ') FILTER html %] - group[% 's' IF groups_denied_rights_to_bless.size > 1 %]. - </li> - [% END %] </ul> [% ELSE %] [% title = "User $otheruser.login not changed" %] @@ -569,7 +563,8 @@ [% ELSIF message_tag == "password_change_request" %] [% title = "Request to Change Password" %] - A token for changing your password has been emailed to you. + A token for changing your password has been emailed to + <em>[% login_name FILTER html %]</em>. Follow the instructions in that email to change your password. [% ELSIF message_tag == "password_changed" %] @@ -733,7 +728,7 @@ Renaming the '[% old FILTER html %]' table to '[% new FILTER html %]'... [% ELSIF message_tag == "install_urlbase_default" %] - Now that you have installed [% terms.Bugzilla %], you should visit the + Now that you have installed Bugzilla, you should visit the 'Parameters' page (linked in the footer of the Administrator account) to ensure it is set up as you wish - this includes setting the 'urlbase' option to the correct URL. @@ -752,7 +747,7 @@ other files (including the localconfig file which stores your database password) must be world readable. This means that _anyone_ who can obtain local access to this machine can do whatever they want to your - [%+ terms.Bugzilla %] installation, and is probably also able to run + Bugzilla installation, and is probably also able to run arbitrary Perl code as the user that the web server runs as. You really, really, really need to change this setting. @@ -762,7 +757,7 @@ Warning: you have entered a value for the "webservergroup" parameter in localconfig, but you are not either a) running this script as [% constants.ROOT_USER FILTER html %]; or b) a member of this group. This can cause permissions problems and - decreased security. If you experience problems running [% terms.Bugzilla %] + decreased security. If you experience problems running Bugzilla scripts, log in as [% constants.ROOT_USER FILTER html %] and re-run this script, become a member of the group, or remove the value of the "webservergroup" parameter. @@ -770,7 +765,7 @@ Warning: You have set webservergroup in [% constants.bz_locations.localconfig FILTER html %] Please understand that this does not bring you any security when running under Windows. - Verify that the file permissions in your [% terms.Bugzilla %] directory are + Verify that the file permissions in your Bugzilla directory are suitable for your system. Avoid unnecessary write access. [% ELSIF message_tag == "install_workflow_init" %] @@ -795,6 +790,30 @@ or you don't have access to it. The following is a list of the products you can choose from. + [% ELSIF message_tag == "quips_added" %] + Your quip <em>[% added_quip FILTER html %]</em> has been added. + [% IF Param("quip_list_entry_control") == "moderated" AND + !user.in_group('bz_quip_moderators') %] + It will be used as soon as it gets approved. + [% END %] + + [% ELSIF message_tag == "quips_deleted" %] + The quip <em>[% deleted_quip FILTER html %]</em> has been deleted. + + [% ELSIF message_tag == "quips_approved_unapproved" %] + [% IF approved.size == 1 %] + One quip + [% ELSE %] + [% approved.size %] quips + [% END %] + approved and + [% IF unapproved.size == 1 %] + one quip + [% ELSE %] + [%+ unapproved.size %] quips + [% END %] + unapproved. + [% ELSIF message_tag == "report_created" %] OK, you have a new saved report named <em>[% reportname FILTER html %]</em>. @@ -850,6 +869,12 @@ [%+ series.name FILTER html %]</em> has been deleted. + [% ELSIF message_tag == "series_updated" %] + [% title = "Series Updated" %] + The series <em>[% default.category FILTER html %] / + [%+ default.subcategory FILTER html %] / + [%+ default.name FILTER html %]</em> has been updated. + [% ELSIF message_tag == "shutdown" %] [% title = "$terms.Bugzilla is Down" %] [% Param("shutdownhtml") %] @@ -917,7 +942,7 @@ [%# Give sensible error if the message function is used incorrectly. #%] [% IF !message %] [% message = BLOCK %] - You are using [% terms.Bugzilla %]'s messaging functions incorrectly. You + You are using Bugzilla's messaging functions incorrectly. You passed in the string '[% message_tag FILTER html %]'. The correct use is to pass in a tag, and define that tag in the file <kbd>messages.html.tmpl</kbd>.<br> <br> diff --git a/template/en/default/global/product-select.html.tmpl b/template/en/default/global/product-select.html.tmpl new file mode 100644 index 000000000..23a7b3d58 --- /dev/null +++ b/template/en/default/global/product-select.html.tmpl @@ -0,0 +1,92 @@ +[%# 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. + #%] + +[%# INTERFACE: + # name: mandatory; field name + # id: optional; field id + # value: optional; default field value/selection + # classes: optional; an array of classes to be added + # onchange: optional; onchange attribute value + # disabled: optional; if true, the field is disabled + # accesskey: optional; accesskey attribute value + # add: optional; prepend menu option for value specified to start of select + # dontchange: optional; prepend menu option for "dontchange" to start of select + # multiple: optional; do multiselect box, value is size (height) of box + # title: optional; extra information to display as a tooltip + # products: optional; an array of custom product names + # isselect: optional; whether the product list should be displayed as a <select> + # or as just the plain text of its value. + # valueattribute: optional; the product attribute to be used for <option value="">, + # defaults to product name + #%] + +[% IF !isselect.defined %] + [% isselect = 1 %] +[% END %] +[% DEFAULT valueattribute = "name" %] +[% IF isselect %] + <select name="[% name FILTER html %]" + [% IF id %] id="[% id FILTER html %]" [% END %] + [% IF classes %] class="[% classes.join(' ') FILTER html %]" [% END %] + [% IF onchange %] onchange="[% onchange FILTER html %]" [% END %] + [% IF disabled %] disabled="[% disabled FILTER html %]" [% END %] + [% IF accesskey %] accesskey="[% accesskey FILTER html %]" [% END %] + [% IF multiple %] multiple="multiple" size="[% multiple FILTER html %]" [% END %] + [% IF title %] title="[% title FILTER html %]" [% END %] + > + [% IF add %] + <option value="">[% add FILTER html %]</option> + [% END %] + [% IF dontchange %] + <option value="[% dontchange FILTER html %]">[% dontchange FILTER html %]</option> + [% END %] + + [% IF Param('useclassification') %] + [% classifications = {} %] + [% IF products %] + [% FOREACH p = products %] + [% IF NOT classifications.${p.classification.name}.defined %] + [% classifications.${p.classification.name} = [] %] + [% END %] + [% classifications.${p.classification.name}.push(p) %] + [% END %] + [% ELSE %] + [% FOREACH c = user.get_selectable_classifications %] + [% classifications.${c.name} = [] %] + [% FOREACH p = user.get_selectable_products(c.id) %] + [% classifications.${c.name}.push(p) %] + [% END %] + [% END %] + [% END %] + + [% FOREACH c = all_classifications %] + [% NEXT UNLESS classifications.${c}.size %] + <optgroup label="[% c FILTER html %]"> + [% FOREACH p = classifications.$c %] + <option value="[% p.$valueattribute FILTER html %]" + [% " selected" IF (cgi.param(name) == p.name) || (value.contains(p.name)) %]> + [% p.name FILTER html %] + </option> + [% END %] + </optgroup> + [% END %] + [% ELSE %] + [% IF NOT products.defined %] + [% products = user.get_selectable_products %] + [% END %] + [% FOREACH p = products %] + <option value="[% p.$valueattribute FILTER html %]" + [% " selected" IF (cgi.param(name) == p.name) || (value.contains(p.name)) %]> + [% p.name FILTER html %] + </option> + [% END %] + [% END %] + </select> +[% ELSE %] + [% value.join(', ') FILTER html %] +[% END %] diff --git a/template/en/default/global/setting-descs.none.tmpl b/template/en/default/global/setting-descs.none.tmpl index d20068306..6e3358782 100644 --- a/template/en/default/global/setting-descs.none.tmpl +++ b/template/en/default/global/setting-descs.none.tmpl @@ -43,6 +43,7 @@ "text_only" => "Text Only", "requestee_cc" => "Automatically add me to the CC list of $terms.bugs I am requested to review", "bugmail_new_prefix" => "Add 'New:' to subject line of email sent when a new $terms.bug is filed", + "possible_duplicates" => "Display possible duplicates when reporting a new $terms.bug", } %] diff --git a/template/en/default/global/site-navigation.html.tmpl b/template/en/default/global/site-navigation.html.tmpl deleted file mode 100644 index 5c68ad7f6..000000000 --- a/template/en/default/global/site-navigation.html.tmpl +++ /dev/null @@ -1,75 +0,0 @@ -[%# 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. - #%] - -[%# INTERFACE: - # bug.bug_id: integer. Number of current bug (for navigation purposes) - #%] - -[% USE Bugzilla %] -[% cgi = Bugzilla.cgi %] - -[% IF NOT (cgi.user_agent("MSIE [1-6]") OR cgi.user_agent("Mozilla/4")) %] - <link rel="Top" href="[% urlbase FILTER html %]"> - - [%# *** Attachment *** %] - [% IF attachment && attachment.bug_id %] - <link rel="Up" href="show_bug.cgi?id=[% attachment.bug_id FILTER none %]"> - [% END %] - - - [%# *** Dependencies, Activity, Print-version *** %] - [% IF bug %] - <link rel="Show" title="Dependency Tree" - href="showdependencytree.cgi?id=[% bug.bug_id %]&hide_resolved=1"> - [% IF Param('webdotbase') %] - <link rel="Show" title="Dependency Graph" - href="showdependencygraph.cgi?id=[% bug.bug_id %]"> - [% END %] - - <link rel="Show" title="[% terms.Bug %] Activity" - href="show_activity.cgi?id=[% bug.bug_id %]"> - <link rel="Show" title="Printer-Friendly Version" - href="show_bug.cgi?format=multiple&id=[% bug.bug_id %]"> - [% END %] - - - [%# *** Saved Searches *** %] - [% IF user.showmybugslink %] - [% user_login = user.login FILTER uri %] - <link rel="Saved Searches" title="My [% terms.Bugs %]" - href="[% Param('mybugstemplate').replace('%userid%', user_login) %]"> - [% END %] - - [% FOREACH q = user.queries_subscribed %] - <link rel="Saved Search" - title="[% q.name FILTER html %] ([% q.user.login FILTER html %])" - href="buglist.cgi?cmdtype=dorem&remaction=run&namedcmd= - [% q.name FILTER uri %]&sharer_id= - [% q.user.id FILTER uri %]"> - [% END %] - - [%# *** Bugzilla Administration Tools *** %] - [% IF user.login %] - [% '<link rel="Administration" title="Parameters" - href="editparams.cgi">' IF user.in_group('tweakparams') %] - [% '<link rel="Administration" title="Users" - href="editusers.cgi">' IF user.in_group('editusers') %] - [% '<link rel="Administration" title="Products" href="editproducts.cgi">' - IF user.in_group('editcomponents') || user.get_products_by_permission("editcomponents").size %] - [% '<link rel="Administration" title="Flag Types" - href="editflagtypes.cgi">' IF user.in_group('editcomponents') %] - [% '<link rel="Administration" title="Groups" - href="editgroups.cgi">' IF user.in_group('creategroups') %] - [% '<link rel="Administration" title="Keywords" - href="editkeywords.cgi">' IF user.in_group('editkeywords') %] - [% '<link rel="Administration" title="Whining" - href="editwhines.cgi">' IF user.in_group('bz_canusewhines') %] - [% '<link rel="Administration" title="Sanity Check" - href="sanitycheck.cgi">' IF user.in_group('editcomponents') %] - [% END %] -[% END %] diff --git a/template/en/default/global/tabs.html.tmpl b/template/en/default/global/tabs.html.tmpl index 454066889..9cf5a897b 100644 --- a/template/en/default/global/tabs.html.tmpl +++ b/template/en/default/global/tabs.html.tmpl @@ -15,7 +15,7 @@ #%] <div class="tabbed"> - <table class="tabs" cellspacing="0" cellpadding="10" border="0" width="100%"> + <table class="tabs"> <tr> <td class="spacer"> </td> diff --git a/template/en/default/global/textarea.html.tmpl b/template/en/default/global/textarea.html.tmpl index 216f2ddbf..f3e23dd3f 100644 --- a/template/en/default/global/textarea.html.tmpl +++ b/template/en/default/global/textarea.html.tmpl @@ -11,7 +11,6 @@ # id: (optional) The "id"-attribute of the textarea. # name: (optional) The "name"-attribute of the textarea. # accesskey: (optional) The "accesskey"-attribute of the textarea. - # style: (optional) The "style"-attribute of the textarea. # classes: (optional) The "class"-attribute of the textarea. # wrap: (deprecated; optional) The "wrap"-attribute of the textarea. # disabled: (optional) Disable the textarea. @@ -33,7 +32,6 @@ <textarea [% IF name %]name="[% name FILTER html %]"[% END %] [% IF id %] id="[% id FILTER html %]"[% END %] [% IF accesskey %] accesskey="[% accesskey FILTER html %]"[% END %] - [% IF style %] style="[% style FILTER html %]"[% END %] [% IF classes %] class="[% classes FILTER html %]"[% END %] [% IF wrap %] wrap="[% wrap FILTER html %]"[% END %] [% IF disabled %] disabled="disabled"[% END %] @@ -48,7 +46,7 @@ onFocus="this.rows=[% maxrows FILTER html %]" [% END %] [% IF mandatory %] - aria-required="true" + aria-required="true" required [% END %] [% IF onchange %] onchange="[% onchange FILTER html %]" diff --git a/template/en/default/global/useful-links.html.tmpl b/template/en/default/global/useful-links.html.tmpl index 5959ab656..5c5bfc316 100644 --- a/template/en/default/global/useful-links.html.tmpl +++ b/template/en/default/global/useful-links.html.tmpl @@ -6,51 +6,48 @@ # defined by the Mozilla Public License, v. 2.0. #%] -[%# Migration note: this whole file corresponds to the old %commandmenu% - substitution param in 'footerhtml' %] - <ul id="useful-links"> <li id="links-actions"> [% PROCESS "global/common-links.html.tmpl" qs_suffix = "_bottom" %] </li> [%# Saved searches %] - - [% IF user.showmybugslink OR user.queries.size - OR user.queries_subscribed.size - %] - [% print_pipe = 0 %] + + [% IF user.showmybugslink OR user.queries.size %] <li id="links-saved"> <ul class="links"> + [% print_pipe = 0 %] [% IF user.showmybugslink %] [% filtered_username = user.login FILTER uri %] - <li><a href="[% Param('mybugstemplate').replace('%userid%', filtered_username) %]">My [% terms.Bugs %]</a></li> + <li> + <a href="[% Param('mybugstemplate').replace('%userid%', filtered_username) %]">My [% terms.Bugs %]</a> + </li> [% print_pipe = 1 %] [% END %] [% FOREACH q = user.queries %] - [% IF q.link_in_footer %] - <li>[% '<span class="separator">| </span>' IF print_pipe %] - <a href="buglist.cgi?cmdtype=runnamed&namedcmd=[% q.name FILTER uri %]">[% q.name FILTER html %]</a></li> - [% print_pipe = 1 %] - [% END %] + [% NEXT UNLESS q.link_in_footer %] + <li> + [% '<span class="separator">| </span>' IF print_pipe %] + <a href="buglist.cgi?cmdtype=runnamed&namedcmd=[% q.name FILTER uri %]">[% q.name FILTER html %]</a> + </li> + [% print_pipe = 1 %] [% END %] - [% new_line = print_pipe %] - [% print_pipe = 0 %] + </ul> + </li> + [% END %] + + [% IF user.queries_subscribed.size %] + <li id="links-shared"> + <ul class="links"> [% FOREACH q = user.queries_subscribed %] - [% IF new_line %] - <br> - [% new_line = 0 %] - [% END %] <li> - [% '<span class="separator">| </span>' IF print_pipe %] + [% '<span class="separator">| </span>' UNLESS loop.first %] <a href="buglist.cgi?cmdtype=dorem&remaction=run&namedcmd= - [% q.name FILTER uri %]&sharer_id= - [% q.user.id FILTER uri %]" - class="shared" - title="Shared by [% q.user.identity FILTER html %]" - >[% q.name FILTER html FILTER no_break %]</a></li> - [% print_pipe = 1 %] + [%- q.name FILTER uri %]&sharer_id=[% q.user.id FILTER uri %]" + class="shared" title="Shared by [% q.user.identity FILTER html %]"> + [%- q.name FILTER html %]</a> + </li> [% END %] </ul> </li> @@ -60,10 +57,11 @@ <li id="reports-saved"> <ul class="links"> [% FOREACH r = user.reports %] - <li>[% '<span class="separator">| </span>' IF print_pipe %] - <a href="report.cgi?[% r.query FILTER html %]&saved_report_id= - [%~ r.id FILTER uri %]">[% r.name FILTER html %]</a></li> - [% print_pipe = 1 %] + <li> + [% '<span class="separator">| </span>' UNLESS loop.first %] + <a href="report.cgi?[% r.query FILTER html %]&saved_report_id= + [%~ r.id FILTER uri %]">[% r.name FILTER html %]</a> + </li> [% END %] </ul> </li> diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index 79aa35527..c60875f9e 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -97,6 +97,15 @@ [% terms.Bug %] aliases cannot be longer than 20 characters. Please choose a shorter alias. + [% ELSIF error == "api_key_not_valid" %] + [% title = "Invalid API key" %] + The API key you specified is invalid. Please check that you typed it + correctly. + + [% ELSIF error == "api_key_revoked" %] + [% title = "Invalid API key" %] + The API key you specified has been revoked by the user that created it. + [% ELSIF error == "attachment_bug_id_mismatch" %] [% title = "Invalid Attachments" %] You tried to perform an action on attachments from different [% terms.bugs %]. @@ -170,6 +179,8 @@ classifications [% ELSIF object == "components" %] components + [% ELSIF object == "comment_tags" %] + comment tags [% ELSIF object == "custom_fields" %] custom fields [% ELSIF object == "field_values" %] @@ -217,6 +228,11 @@ [% Hook.process("auth_failure") %] + [% ELSIF error == "auth_invalid_token" %] + [% title = 'A token error occurred' %] + The token '[% token FILTER html %]' is not valid. It could be because + you loaded this page more than 3 days ago. + [% ELSIF error == "auth_untrusted_request" %] [% title = "Untrusted Authentication Request" %] You tried to log in using the <em>[% login FILTER html %]</em> account, @@ -240,12 +256,12 @@ valid page identifier. [% ELSIF error == "bug_access_denied" %] - [% title = "Access Denied" %] + [% title = "$terms.Bug Access Denied" %] [% admindocslinks = {'groups.html' => 'Group Security'} %] You are not authorized to access [% terms.bug %] #[% bug_id FILTER html %]. [% ELSIF error == "bug_access_query" %] - [% title = "Access Denied" %] + [% title = "$terms.Bug Access Denied" %] [% docslinks = {'myaccount.html' => 'Creating an account'} %] You are not authorized to access [% terms.bug %] #[% bug_id FILTER html %]. To see this [% terms.bug %], you must @@ -265,7 +281,7 @@ [% ELSE %] [%+ field_descs.see_also FILTER html %] URLs should point to one of: <ul> - <li><code>show_bug.cgi</code> in a [% terms.Bugzilla %] + <li><code>show_bug.cgi</code> in a Bugzilla installation.</li> <li>A b[% %]ug on launchpad.net</li> <li>An issue on code.google.com.</li> @@ -274,7 +290,7 @@ <li>A ticket in a Trac installation.</li> <li>A b[% %]ug in a MantisBT installation.</li> <li>A b[% %]ug on sourceforge.net.</li> - <li>An issue on github.com.</li> + <li>An issue/pull request on github.com.</li> [% Hook.process('bug_url_invalid_tracker') %] </ul> [% END %] @@ -328,6 +344,25 @@ [%+ constants.MAX_COMMENT_LENGTH FILTER html %] characters. If you need to post contents of files or logs, use the attachment feature instead. + [% ELSIF error == "comment_tag_disabled" %] + [% title = "Comment Tagging Disabled" %] + The comment tagging is not enabled. + + [% ELSIF error == "comment_tag_invalid" %] + [% title = "Invalid Comment Tag" %] + The comment tag "[% tag FILTER html %]" contains invalid characters or + words. + + [% ELSIF error == "comment_tag_too_long" %] + [% title = "Comment Tag Too Long" %] + Comment tags cannot be longer than + [%+ constants.MAX_COMMENT_TAG_LENGTH FILTER html %] characters. + + [% ELSIF error == "comment_tag_too_short" %] + [% title = "Comment Tag Too Short" %] + Comment tags must be at least + [%+ constants.MIN_COMMENT_TAG_LENGTH FILTER html %] characters. + [% ELSIF error == "auth_classification_not_enabled" %] [% title = "Classification Not Enabled" %] Sorry, classification is not enabled. @@ -482,7 +517,7 @@ [% ELSIF error == "feature_disabled" %] The [% install_string("feature_$feature") FILTER html %] feature is not - available in this [% terms.Bugzilla %]. + available in this Bugzilla. [% IF user.in_group('admin') %] If you would like to enable this feature, please run <kbd>checksetup.pl</kbd> to see how to install the necessary @@ -645,10 +680,15 @@ <br>Alternately, if your attachment is an image, you could convert it to a compressible format like JPG or PNG and try again. - [% ELSIF error == "flag_requestee_disabled" %] + [% ELSIF error == "flag_type_requestee_disabled" %] [% title = "Flag not Requestable from Specific Person" %] You can't ask a specific person for <em>[% type.name FILTER html %]</em>. + [% ELSIF error == "flag_requestee_disabled" %] + [% title = "Flag Requestee Disabled" %] + You can't ask <em>[% requestee.identity FILTER html %]</em> because that + account is disabled. + [% ELSIF error == "flag_requestee_needs_privs" %] [% title = "Flag Requestee Needs Privileges" %] [% requestee.identity FILTER html %] does not have permission to set the @@ -730,6 +770,16 @@ You are not allowed to edit properties of the '[% flagtype.name FILTER html %]' flag type, because this flag type is not available for the products you can administer. + [% ELSIF error == "flag_not_unique" %] + [% title = "Flag not Unique" %] + The flag '[% value FILTER html %]' has been set multiple times. + You must specify the id value to update the flag. + + [% ELSIF error == "flag_type_not_unique" %] + [% title = "Flag Type not Unique" %] + The flag type '[% value FILTER html %]' matches several flag types. + You must specify the type id value to update or add a flag. + [% ELSIF error == "flag_type_not_multiplicable" %] [% docslinks = {'flags-overview.html' => 'An overview on Flags', 'flags.html' => 'Using Flags'} %] @@ -778,6 +828,11 @@ in the database which refer to it. All references to this group must be removed before you can remove it. + [% ELSIF error == "group_cannot_view" %] + [% title = "Cannot View Groups" %] + In order to view groups, you need to be a member of the 'editusers' or + 'creategroups' group, or have bless privileges to at least one group. + [% ELSIF error == "group_exists" %] [% title = "The group already exists" %] The group [% name FILTER html %] already exists. @@ -870,9 +925,9 @@ [% ELSIF error == "illegal_date" %] [% title = "Illegal Date" %] - '<tt>[% date FILTER html %]</tt>' is not a legal date. + '<kbd>[% date FILTER html %]</kbd>' is not a legal date. [% IF format %] - Please use the format '<tt>[% format FILTER html %]</tt>'. + Please use the format '<code>[% format FILTER html %]</code>'. [% END %] [% ELSIF error == "illegal_email_address" %] @@ -898,6 +953,13 @@ Your group control combination for group " [% groupname FILTER html %]" is illegal. + [% ELSIF error == "illegal_pronoun" %] + [% title = "Illegal Pronoun" %] + The pronoun you used ([% pronoun FILTER html %]) is illegal. You must use + one of the approved pronouns. Please see + <a href="[% docs_urlbase FILTER html %]query.html#pronouns">Pronoun Substitution</a> + for a complete list. + [% ELSIF error == "illegal_query_name" %] [% title = "Illegal Search Name" %] The name of your search cannot contain any of the following characters: @@ -916,9 +978,9 @@ [% ELSIF error == "illegal_time" %] [% title = "Illegal Time" %] - '<tt>[% time FILTER html %]</tt>' is not a legal time. + '<kbd>[% time FILTER html %]</kbd>' is not a legal time. [% IF format %] - Please use the format '<tt>[% format FILTER html %]</tt>'. + Please use the format '<code>[% format FILTER html %]</code>'. [% END %] [% ELSIF error == "illegal_regexp" %] @@ -965,11 +1027,6 @@ is one of <em>[% constants.LEGAL_CONTENT_TYPES.join(', ') FILTER html %]</em> and <em>bar</em> must not contain any special characters (such as "=", "?", ...). - [% ELSIF error == "invalid_context" %] - [% title = "Invalid Context" %] - The context [% context FILTER html %] is invalid (must be a number, - "file" or "patch"). - [% ELSIF error == "invalid_datasets" %] [% title = "Invalid Datasets" %] Invalid datasets <em>[% datasets.join(":") FILTER html %]</em>. Only digits, @@ -1007,10 +1064,6 @@ [% title = "Invalid Parameter" %] The new value for [% name FILTER html %] is invalid: [% err FILTER html %]. - [% ELSIF error == "invalid_product_name" %] - [% title = "Invalid Product Name" %] - The product name '[% product FILTER html %]' is invalid or does not exist. - [% ELSIF error == "invalid_regexp" %] [% title = "Invalid regular expression" %] The regular expression you entered is invalid. @@ -1046,13 +1099,13 @@ [% ELSIF error == "invalid_username" %] [% title = "Invalid Username" %] - The name <tt>[% name FILTER html %]</tt> is not a valid username. + The name <kbd>[% name FILTER html %]</kbd> is not a valid username. Either you misspelled it, or the person has not registered for a [% terms.Bugzilla %] account. - [% ELSIF error == "invalid_username_or_password" %] - [% title = "Invalid Username Or Password" %] - The username or password you entered is not valid. + [% ELSIF error == "invalid_login_or_password" %] + [% title = "Invalid Login Or Password" %] + The login or password you entered is not valid. [%# People get two login attempts before being warned about # being locked out. #%] @@ -1065,6 +1118,11 @@ the "Forgot Password" link. [% END %] + [% ELSIF error == "invalid_cookies_or_token" %] + [% title = "Invalid Cookies or Token" %] + The cookies or token provide were not valid or have expired. + You may login again to get new cookies or a new token. + [% ELSIF error == "json_rpc_get_method_required" %] When using JSON-RPC over GET, you must specify a 'method' parameter. See the documentation at @@ -1089,6 +1147,13 @@ For security reasons, you must use HTTP POST to call the '[% method FILTER html %]' method. + [% ELSIF error == "rest_invalid_resource" %] + A REST API resource was not found for '[% method FILTER html +%] [%+ path FILTER html %]'. + + [% ELSIF error == "get_products_invalid_type" %] + The product type '[% type FILTER html %]' is invalid. Valid choices + are 'accessible', 'selectable', and 'enterable'. + [% ELSIF error == "keyword_already_exists" %] [% title = "Keyword Already Exists" %] A keyword with the name [% name FILTER html %] already exists. @@ -1124,7 +1189,7 @@ [% ELSIF error == "migrate_from_invalid" %] '[% from FILTER html %]' is not a valid type of [% terms.bug %]-tracker - to migrate from. See the contents of the <kbd>B[% %]ugzilla/Migrate/</kbd> + to migrate from. See the contents of the <kbd>Bugzilla/Migrate/</kbd> directory for a list of valid [% terms.bug %]-trackers. [% ELSIF error == "milestone_already_exists" %] @@ -1291,6 +1356,8 @@ to modify. [% ELSIF action == "view" %] to view. + [% ELSIF action == 'summarize' %] + for viewing time summaries. [% END %] [% ELSIF error == "no_tag_to_edit" %] @@ -1301,6 +1368,11 @@ [% title = "No Initial $terms.Bug Status" %] No [% terms.bug %] status is available on [% terms.bug %] creation. Please report the problem to [% Param("maintainer") %]. + + [% ELSIF error == "no_keywords" %] + [% title = "No Keywords" %] + [% admindocslinks = {'keywords.html' => 'Setting up a keyword'} %] + No keywords have been defined for this installation. [% ELSIF error == "no_new_quips" %] [% title = "No New Quips" %] @@ -1319,6 +1391,12 @@ Either no products have been defined to enter [% terms.bugs %] against or you have not been given access to any. + [% ELSIF error == "number_not_integer" %] + [% title = "Integer Value Required" %] + The value '[% num FILTER html %]' in the + <em>[% field_descs.$field FILTER html %]</em> field + is not an integer value (i.e. a whole number). + [% ELSIF error == "number_not_numeric" %] [% title = "Numeric Value Required" %] The value '[% num FILTER html %]' in the @@ -1359,8 +1437,7 @@ Either you mis-typed the name or that user has not yet registered for a [% terms.Bugzilla %] account. [% ELSIF class == "Bugzilla::Keyword" %] - The legal keyword names are <a href="describekeywords.cgi">listed - here</a>. + See the list of available <a href="describekeywords.cgi">keywords</a>. [% END %] [% ELSIF error == "old_password_incorrect" %] @@ -1379,18 +1456,14 @@ [% title = "Passwords Don't Match" %] The two passwords you entered did not match. - [% ELSIF error == "password_current_too_short" %] - [% title = "New Password Required" %] - Your password is currently less than - [%+ constants.USER_PASSWORD_MIN_LENGTH FILTER html %] characters long, - which is the new minimum length required for passwords. - You must <a href="token.cgi?a=reqpw&loginname=[% locked_user.email FILTER uri %]"> - request a new password</a> in order to log in again. - [% ELSIF error == "password_too_short" %] [% title = "Password Too Short" %] The password must be at least [%+ constants.USER_PASSWORD_MIN_LENGTH FILTER html %] characters long. + [% IF locked_user %] + You must <a href="token.cgi?a=reqpw&loginname=[% locked_user.email FILTER uri %]&token=[% issue_hash_token(['reqpw']) FILTER uri %]"> + request a new password</a> in order to log in again. + [% END %] [% ELSIF error == "password_not_complex" %] [% title = "Password Fails Requirements" %] @@ -1408,6 +1481,10 @@ <li>digit</li> [% END %] </ul> + [% IF locked_user %] + You must <a href="token.cgi?a=reqpw&loginname=[% locked_user.email FILTER uri %]&token=[% issue_hash_token(['reqpw']) FILTER uri %]"> + request a new password</a> in order to log in again. + [% END %] [% ELSIF error == "product_access_denied" %] [% title = "Product Access Denied" %] @@ -1521,7 +1598,7 @@ [% ELSIF error == "quicksearch_unbalanced_quotes" %] [% title = "Badly Formatted Query" %] - [% terms.Bugzilla %] is unable to parse your query correctly: + Bugzilla is unable to parse your query correctly: <em>[% string FILTER html %]</em>.<br> If you use quotes to enclose strings, make sure both quotes are present. If you really want to look for a quote in a string, type \" instead of ". @@ -1620,7 +1697,7 @@ field. [% ELSIF error == "search_grouped_field_invalid" %] - [% terms.Bugzilla %] does not support using the + Bugzilla does not support using the "[%+ field_descs.$field FILTER html %]" ([% field FILTER html %]) field with grouped search conditions. @@ -1631,7 +1708,7 @@ All conditions under a groups search must use the same field. [% ELSIF error == "search_field_operator_invalid" %] - [% terms.Bugzilla %] does not support using the + Bugzilla does not support using the "[%+ field_descs.$field FILTER html %]" ([% field FILTER html %]) field with the "[% search_descs.$operator FILTER html %]" ([% operator FILTER html %]) search type. @@ -1706,7 +1783,7 @@ [% ELSIF error == "tag_name_too_long" %] [% title = "Tag Name Too Long" %] - The tag name must be less than [% constants.MAX_LEN_QUERY_NAME FILTER html %] + The tag must be less than [% constants.MAX_LEN_QUERY_NAME FILTER html %] characters long. [% ELSIF error == "token_does_not_exist" %] @@ -1736,7 +1813,7 @@ [% ELSIF error == "unknown_tab" %] [% title = "Unknown Tab" %] - <code>[% current_tab_name FILTER html %]</code> is not a legal tab name. + There is no tab named <code>[% current_tab_name FILTER html %]</code>. [% ELSIF error == "value_inactive" %] [% title = "Value is Not Active" %] @@ -1797,12 +1874,12 @@ [% ELSIF error == "user_match_failed" %] [% title = "Match Failed" %] - <tt>[% name FILTER html %]</tt> does not exist or you are not allowed + <kbd>[% name FILTER html %]</kbd> does not exist or you are not allowed to see that user. [% ELSIF error == "user_match_too_many" %] [% title = "No Conclusive Match" %] - [% terms.Bugzilla %] cannot make a conclusive match for one or more + Bugzilla cannot make a conclusive match for one or more of the names and/or email addresses you entered for the [% fields.join(', ') FILTER html %] field(s). @@ -1811,6 +1888,16 @@ Sorry, but you are not allowed to (un)mark comments or attachments as private. + [% ELSIF error == "user_not_involved" %] + [% title = "User Not Involved with $terms.Bug" %] + Sorry, but you are not involved with [% terms.Bug %] [%+ + bug_id FILTER bug_link(bug_id) FILTER none %]. + + [% ELSIF error == "webdot_too_large" %] + [% title = "Dependency Graph Too Large" %] + The dependency graph contains too many [% terms.bugs %] to display (more + than [% constants.MAX_WEBDOT_BUGS FILTER html %] [%+ terms.bugs %]). + [% ELSIF error == "wrong_token_for_cancelling_email_change" %] [% title = "Wrong Token" %] That token cannot be used to cancel an email address change. @@ -1890,15 +1977,11 @@ admindocslinks = admindocslinks %] -<table cellpadding="20"> - <tr> - <td id="error_msg" class="throw_error"> - [% error_message FILTER none %] - </td> - </tr> -</table> +<div id="error_msg" class="throw_error"> + [% error_message FILTER none %] +</div> -<p> +<p id="post_err_msg"> Please press <b>Back</b> and try again. </p> diff --git a/template/en/default/global/userselect.html.tmpl b/template/en/default/global/userselect.html.tmpl index 828c4bb58..e2210c6f2 100644 --- a/template/en/default/global/userselect.html.tmpl +++ b/template/en/default/global/userselect.html.tmpl @@ -20,6 +20,7 @@ # multiple: optional, do multiselect box, value is size (height) of box # custom_userlist: optional, specify a limited list of users to use # field_title: optional, extra information to display as a tooltip + # mandatory: optional; if true, the field cannot be empty. #%] [% IF Param("usemenuforusers") %] @@ -31,6 +32,7 @@ [% IF accesskey %] accesskey="[% accesskey FILTER html %]" [% END %] [% IF multiple %] multiple="multiple" size="[% multiple FILTER html %]" [% END %] [% IF field_title %] title="[% field_title FILTER html %]" [% END %] + [% IF mandatory %] required [% END %] > [% IF emptyok %] <option value=""></option> @@ -83,6 +85,7 @@ [% IF field_title %] title="[% field_title FILTER html %]" [% END %] [% IF size %] size="[% size FILTER html %]" [% END %] [% IF id %] id="[% id FILTER html %]" [% END %] + [% IF mandatory %] required [% END %] > [% IF feature_enabled('jsonrpc') && Param('ajax_user_autocompletion') && id %] <div id="[% id FILTER html %]_autocomplete_container"></div> diff --git a/template/en/default/global/variables.none.tmpl b/template/en/default/global/variables.none.tmpl index 9fb7c7bc6..e624c9f96 100644 --- a/template/en/default/global/variables.none.tmpl +++ b/template/en/default/global/variables.none.tmpl @@ -24,6 +24,8 @@ "ABug" => "A Bug", "bugs" => "bugs", "Bugs" => "Bugs", + "comment" => "comment", + "comments" => "comments", "zeroSearchResults" => "Zarro Boogs found", "Bugzilla" => "Gentoo's Bugzilla" } diff --git a/template/en/default/index.html.tmpl b/template/en/default/index.html.tmpl index 930888695..ad8c94d2f 100644 --- a/template/en/default/index.html.tmpl +++ b/template/en/default/index.html.tmpl @@ -14,57 +14,18 @@ title = "$terms.Bugzilla Main Page" header = "Main Page" header_addl_info = "version ${constants.BUGZILLA_VERSION}${constants.GENTOO_APPEND_VERSION} node ${constants.GENTOO_NODE}" - style_urls = [ 'skins/standard/index.css' ] %] - -<script type="text/javascript"> -<!-- -function onLoadActions() { - quicksearchHelpText('quicksearch_main', 'show'); - if( window.external.AddSearchProvider ){ - YAHOO.util.Dom.removeClass('quicksearch_plugin', 'bz_default_hidden'); - } - document.getElementById('quicksearch_top').focus(); -} -var quicksearch_message = "Enter [% terms.abug %] # or some search terms"; - -function checkQuicksearch( form ) { - if (form.quicksearch.value == '' || form.quicksearch.value == quicksearch_message ) { - alert('Please enter one or more search terms first.'); - return false; - } - return true; -} - -function quicksearchHelpText(el_id, action){ - var el = document.getElementById(el_id); - if ( action == "show") { - if( el.value == "" ) { - el.value = quicksearch_message - YAHOO.util.Dom.addClass(el, "quicksearch_help_text"); - } - } else { - if( el.value == quicksearch_message ) { - el.value = ""; - YAHOO.util.Dom.removeClass(el, "quicksearch_help_text"); - } - } -} -YAHOO.util.Event.onDOMReady(onLoadActions); -//--> -</script> - [% IF release %] <div id="new_release"> [% IF release.data %] [% IF release.deprecated %] - <p>[% terms.Bugzilla %] [%+ release.deprecated FILTER html %] is no longer + <p>Bugzilla [%+ release.deprecated FILTER html %] is no longer supported. You are highly encouraged to upgrade in order to keep your system secure.</p> [% END %] - <p>A new [% terms.Bugzilla %] version ([% release.data.latest_ver FILTER html %]) + <p>A new Bugzilla version ([% release.data.latest_ver FILTER html %]) is available at <a href="[% release.data.url FILTER html %]">[% release.data.url FILTER html %]</a>.<br> Release date: [% release.data.date FILTER html %]</p> @@ -101,73 +62,102 @@ YAHOO.util.Event.onDOMReady(onLoadActions); [% END %] <div id="page-index"> - <table> - <tr> - <td> - <h1 id="welcome"> Welcome to [% terms.Bugzilla %]</h1> - <div class="intro">[% Hook.process('intro') %]</div> + <h1 id="welcome"> Welcome to [% terms.Bugzilla %]</h1> + <div class="intro">[% Hook.process('intro') %]</div> + + <div class="bz_common_actions"> + <ul> + <li> + <a id="enter_bug" href="enter_bug.cgi"><span>File [% terms.aBug %]</span></a> + </li> + <li> + <a id="query" href="query.cgi"><span>Search</span></a> + </li> + <li> + <a id="account" + [% IF user.id %] + href="userprefs.cgi"><span>User Preferences</span></a> + [% ELSIF Param('createemailregexp') && user.authorizer.user_can_create_account %] + href="createaccount.cgi"><span>Open a New Account</span></a> + [% ELSE %] + href="?GoAheadAndLogIn=1"><span>Log In</span></a> + [% END %] + </li> + <li> + <a id="help" href="[% docs_urlbase FILTER html %]using/index.html"><span>Documentation</span></a> + </li> + </ul> + </div> - <div class="bz_common_actions"> - <ul> - <li> - <a id="enter_bug" href="enter_bug.cgi"><span>File - [%= terms.aBug %]</span></a> - </li> - <li> - <a id="query" href="query.cgi"><span>Search</span></a> - </li> - <li> - <a id="account" - [% IF user.id %] - href="userprefs.cgi"><span>User Preferences</span></a> - [% ELSIF Param('createemailregexp') - && user.authorizer.user_can_create_account - %] - href="createaccount.cgi"><span>New Account</span></a> - [% ELSE %] - href="?GoAheadAndLogIn=1"><span>Log In</span></a> - [% END %] - </li> - </ul> - </div> + <div> + <form id="quicksearchForm" name="quicksearchForm" action="buglist.cgi"> + <input id="quicksearch_main" name="quicksearch" title="Quick Search" + placeholder="Enter [% terms.abug %] # or some search terms" + autofocus required> + <input id="find" type="submit" value="Quick Search"> + <a href="page.cgi?id=quicksearch.html" title="Quick Search help">[?]</a> + </form> + + <ul class="additional_links"> + [% Hook.process('additional_links') %] + </ul> + </div> + + <div id="common_queries"> + <h4>Common Queries:</h4> + <ul> + [% IF user.id %] + <li> + [% title = BLOCK %]Open [% terms.bugs %] assigned to me[% END %] + <a href="buglist.cgi?f1=assigned_to&o1=equals&v1=%25user%25&resolution=---"> + [% title FILTER html %]</a> ([% assignee_count FILTER html %]) + <a href="buglist.cgi?f1=assigned_to&o1=equals&v1=%25user%25&resolution=---&ctype=atom&title=[% title FILTER uri %]" + class="rss"> </a> + </li> + <li> + [% title = BLOCK %]Open [% terms.bugs %] reported by me[% END %] + <a href="buglist.cgi?f1=reporter&o1=equals&v1=%25user%25&resolution=---"> + [% title FILTER html %]</a> ([% reporter_count FILTER html %]) + <a href="buglist.cgi?f1=reporter&o1=equals&v1=%25user%25&resolution=---&ctype=atom&title=[% title FILTER uri %]" + class="rss"> </a> + </li> + [% IF Bugzilla.has_flags %] + <li> + [% title = BLOCK %]Requests addressed to me[% END %] + <a href="request.cgi?action=queue&requestee=[% user.login FILTER uri %]&group=type&do_union=0"> + [% title FILTER html %]</a> ([% requestee_count FILTER html %]) + <a href="buglist.cgi?f1=requestees.login_name&o1=equals&v1=%25user%25&ctype=atom&title=[% title FILTER uri %]" + class="rss"> </a> + </li> + [% END %] + [% END %] + + <li> + [% terms.Bugs %] reported in the + <a href="buglist.cgi?chfield=%5BBug%20creation%5D&chfieldfrom=24h">last 24 hours</a> + [% title = BLOCK %][% terms.Bugs %] reported in the last 24 hours[% END %] + <a href="buglist.cgi?chfield=%5BBug%20creation%5D&chfieldfrom=24h&ctype=atom&title=[% title FILTER uri %]" + class="rss"> </a> + | <a href="buglist.cgi?chfield=%5BBug%20creation%5D&chfieldfrom=7d">last 7 days</a> + [% title = BLOCK %][% terms.Bugs %] reported in the last 7 days[% END %] + <a href="buglist.cgi?chfield=%5BBug%20creation%5D&chfieldfrom=7d&ctype=atom&title=[% title FILTER uri %]" + class="rss"> </a> + </li> + <li> + [% terms.Bugs %] changed in the + <a href="buglist.cgi?chfieldfrom=24h">last 24 hours</a> + [% title = BLOCK %][% terms.Bugs %] changed in the last 24 hours[% END %] + <a href="buglist.cgi?chfieldfrom=24h&ctype=atom&title=[% title FILTER uri %]" + class="rss"> </a> + | <a href="buglist.cgi?chfieldfrom=7d">last 7 days</a> + [% title = BLOCK %][% terms.Bugs %] changed in the last 7 days[% END %] + <a href="buglist.cgi?chfieldfrom=7d&ctype=atom&title=[% title FILTER uri %]" + class="rss"> </a> + </li> + </ul> + </div> - <form id="quicksearchForm" name="quicksearchForm" action="buglist.cgi" - onsubmit="return checkQuicksearch(this);"> - <div> - <input id="quicksearch_main" type="text" name="quicksearch" - title="Quick Search" - onfocus="quicksearchHelpText(this.id, 'hide');" - onblur="quicksearchHelpText(this.id, 'show');" - > - <input id="find" type="submit" value="Quick Search"> - <ul class="additional_links" id="quicksearch_links"> - <li> - <a href="page.cgi?id=quicksearch.html">Quick Search help</a> - </li> - <li class="bz_default_hidden" id="quicksearch_plugin"> - | - <a href="javascript:window.external.AddSearchProvider('[% urlbase FILTER html %]search_plugin.cgi')"> - Install the Quick Search plugin - </a> - </li> - </ul> - <ul class="additional_links"> - <li> - <a href="[% docs_urlbase FILTER html %]using.html"> - [%- terms.Bugzilla %] User's Guide</a> - </li> - <li> - | - <a href="page.cgi?id=release-notes.html">Release Notes</a> - </li> - [% Hook.process('additional_links') %] - </ul> - </div> - </form> - <div class="outro">[% Hook.process('outro') %]</div> - </td> - </tr> - </table> + <div class="outro">[% Hook.process('outro') %]</div> </div> [% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/list/change-columns.html.tmpl b/template/en/default/list/change-columns.html.tmpl index 17d711eec..c0279803c 100644 --- a/template/en/default/list/change-columns.html.tmpl +++ b/template/en/default/list/change-columns.html.tmpl @@ -8,7 +8,7 @@ [% PROCESS global/header.html.tmpl title = "Change Columns" - javascript_urls = "js/change-columns.js" + javascript_urls = [ "js/change-columns.js" ] onload = "initChangeColumns()" %] diff --git a/template/en/default/list/edit-multiple.html.tmpl b/template/en/default/list/edit-multiple.html.tmpl index 465578a31..e581f0892 100644 --- a/template/en/default/list/edit-multiple.html.tmpl +++ b/template/en/default/list/edit-multiple.html.tmpl @@ -10,6 +10,11 @@ <input type="hidden" name="dontchange" value="[% dontchange FILTER html %]"> <input type="hidden" name="token" value="[% token FILTER html %]"> +<input type="button" id="uncheck_all" value="Uncheck All" + class="bz_default_hidden" onclick="SetCheckboxes(false);"> +<input type="button" id="check_all" value="Check All" + class="bz_default_hidden" onclick="SetCheckboxes(true);"> + <script type="text/javascript"> function SetCheckboxes(value) { var elements = document.forms.changeform.getElementsByTagName('input'), @@ -22,30 +27,38 @@ } } } - document.write(' <input type="button" name="uncheck_all" value="Uncheck All" onclick="SetCheckboxes(false);">'); - document.write(' <input type="button" name="check_all" value="Check All" onclick="SetCheckboxes(true);">'); + YAHOO.util.Dom.removeClass("check_all", "bz_default_hidden"); + YAHOO.util.Dom.removeClass("uncheck_all", "bz_default_hidden"); </script> <hr> -<p style="font-size:smaller"> - To change multiple [% terms.bugs %]:</p> -<ol style="font-size:smaller"> - <li>Check the [% terms.bugs %] you want to change above.</li> - <li>Make your changes in the form fields below. If the change - you are making requires an explanation, include it in - the comments box.</li> - <li>Click the <em>Commit</em> button.</li> -</ol> +<div class="bz_info"> + To change multiple [% terms.bugs %]: + <ol> + <li>Check the [% terms.bugs %] you want to change above.</li> + <li>Make your changes in the form fields below. If the change + you are making requires an explanation, include it in + the comments box.</li> + <li>Click the <em>Commit</em> button.</li> + </ol> +</div> + +[% IF excluded_values %] + <p class="extra_info">Only values that are available for all products of the above + [%+ terms.bugs %] are shown.</p> +[% END %] <table id="form"> <tr> <th><label for="product">Product:</label></th> <td> - [% PROCESS selectmenu menuname = "product" - menuitems = products - property = "name" %] + [% INCLUDE "global/product-select.html.tmpl" + id => "product" + name => "product" + dontchange => dontchange + %] </td> <th><label for="version">Version:</label></th> @@ -116,7 +129,7 @@ <th><label for="target_milestone">Target Milestone:</label></th> <td> [% PROCESS selectmenu menuname = "target_milestone" - menuitems = targetmilestones %] + menuitems = milestones %] </td> [% END %] </tr> @@ -259,11 +272,11 @@ [% IF Param('usestatuswhiteboard') %] <tr> - <td align="right"> - <b>Status Whiteboard:</b> - </td> + <th> + <label for="status_whiteboard">Status Whiteboard:</label> + </th> <td colspan="7"> - <input name="status_whiteboard" + <input name="status_whiteboard" id="status_whiteboard" value="[% dontchange FILTER html %]" size="60"> </td> </tr> @@ -288,7 +301,7 @@ [% IF user.is_insider %] <input type="checkbox" name="comment_is_private" value="1" id="newcommentprivacy" - onClick="updateCommentTagControl(this, 'comment')"/> + onClick="updateCommentTagControl(this, 'comment')"> <label for="newcommentprivacy"> Make comment private (visible only to members of the <strong>[% Param('insidergroup') FILTER html %]</strong> group) @@ -308,6 +321,13 @@ </script> [% END %] +[% IF flag_types %] +<b><label for="flags">Flags:</label></b><br> +[% PROCESS "flag/list.html.tmpl" + edit_multiple_bugs = 1 + flag_no_header = 1 %] +[% END %] + [% Hook.process('before_groups') %] [% IF groups.size > 0 %] @@ -322,23 +342,23 @@ </script> <b>Groups:</b><br> - <table border="1"> + <table id="groups_edit_multiple"> <tr> - <th>Remove<br>[% terms.bugs %]<br>from this<br>group</th> - <th>Add<br>[% terms.bugs %]<br>to this<br>group</th> - <th>Group Name:</th> + <th class="narrow_column">Remove [% terms.bugs %] from this group</th> + <th class="narrow_column">Add [% terms.bugs %] to this group</th> + <th>Group Name</th> </tr> [% FOREACH group = groups %] <tr> - <td align="center"> + <td class="center"> <input type="checkbox" name="defined_groups" id="defined_group_[% group.id %]" value="[% group.name FILTER html %]" onchange="turn_off(this, 'group_[% group.id %]')"> </td> [% IF group.is_active %] - <td align="center"> + <td class="center"> <input type="checkbox" name="groups" id="group_[% group.id FILTER html %]" value="[% group.name FILTER html %]" @@ -360,7 +380,7 @@ </table> [% IF foundinactive %] - <p style="font-size:smaller">(Note: [% terms.Bugs %] may not be added to [% FILTER inactive %]inactive + <p class="bz_info">(Note: [% terms.Bugs %] may not be added to [% FILTER inactive %]inactive groups[% END %], only removed.)</p> [% END %] diff --git a/template/en/default/list/list-simple.html.tmpl b/template/en/default/list/list-simple.html.tmpl index 24e2bcf5a..01f784d59 100644 --- a/template/en/default/list/list-simple.html.tmpl +++ b/template/en/default/list/list-simple.html.tmpl @@ -12,8 +12,8 @@ [% DEFAULT title = "$terms.Bug List" %] +<!DOCTYPE html> <html> - <head> <title>[% title FILTER html %]</title> <base href="[% urlbase FILTER html %]"> @@ -28,5 +28,4 @@ [% PROCESS list/table.html.tmpl %] [% END %] </body> - </html> diff --git a/template/en/default/list/list.html.tmpl b/template/en/default/list/list.html.tmpl index e179a90e4..65065bf32 100644 --- a/template/en/default/list/list.html.tmpl +++ b/template/en/default/list/list.html.tmpl @@ -59,12 +59,12 @@ [% PROCESS global/header.html.tmpl title = title - style = style + generate_api_token = dotweak atomlink = "buglist.cgi?$urlquerypart&title=$title&ctype=atom" yui = [ 'autocomplete', 'calendar' ] javascript_urls = [ "js/util.js", "js/field.js", "js/TUI.js" ] style_urls = [ "skins/standard/buglist.css" ] - doc_section = "query.html#list" + doc_section = "using/finding.html" %] <div class="bz_query_head"> @@ -76,7 +76,7 @@ <div class="bz_query_debug"> <p>Total execution time: [% query_time FILTER html %] seconds</p> [% FOREACH query = queries %] - <p>[% query.sql FILTER html %]</p> + <pre>[% query.sql FILTER html %]</pre> <p>Execution time: [% query.time FILTER html %] seconds</p> [% IF query.explain %] <pre>[% query.explain FILTER html %]</pre> @@ -86,7 +86,7 @@ [% END %] [% IF user.settings.display_quips.value == 'on' %] - [% DEFAULT quip = "$terms.Bugzilla would like to put a random quip here, but no one has entered any." %] + [% DEFAULT quip = "Bugzilla would like to put a random quip here, but no one has entered any." %] <span class="bz_quip"> <a href="quips.cgi"><em>[% quip FILTER html %]</em></a> </span> @@ -96,7 +96,7 @@ [% IF toolong %] <h2 class="bz_smallminded"> - This list is too long for [% terms.Bugzilla %]'s little mind; the + This list is too long for Bugzilla's little mind; the Next/Prev/First/Last buttons won't appear on individual [% terms.bugs %]. </h2> [% END %] @@ -105,7 +105,7 @@ 'notequals', 'regexp', 'notregexp', 'lessthan', 'lessthaneq', 'greaterthan', 'greaterthaneq', 'changedbefore', 'changedafter', 'changedfrom', 'changedto', 'changedby', 'notsubstring', 'nowords', - 'nowordssubstr', 'notmatches', + 'nowordssubstr', 'notmatches', 'isempty', 'isnotempty' ] %] <a id="search_description_controller" class="bz_default_hidden" href="javascript:TUI_toggle_class('search_description')">Hide Search Description</a> @@ -175,8 +175,6 @@ </ul> [% END %] -<br> - [%############################################################################%] [%# Rest of Change Form #%] [%############################################################################%] @@ -191,24 +189,15 @@ [%# Navigation Bar #%] [%############################################################################%] -<table> - <tr> + <div class="buglist_menu"> [% IF bugs.size > 0 %] - <td valign="middle" class="bz_query_buttons"> + <div class="bz_query_buttons"> <form method="post" action="show_bug.cgi"> - [% id = buglist.join(",") %] - <input type="hidden" name="id" value="[% id FILTER html %]"> + [% buglist_joined = buglist.join(",") %] + <input type="hidden" name="id" value="[% buglist_joined FILTER html %]"> <input type="hidden" name="format" value="multiple"> <input type="submit" id="long_format" value="Long Format"> </form> - <form method="post" action="show_bug.cgi"> - <input type="hidden" name="ctype" value="xml"> - [% FOREACH id = buglist %] - <input type="hidden" name="id" value="[% id FILTER html %]"> - [% END %] - <input type="hidden" name="excludefield" value="attachmentdata"> - <input type="submit" value="XML" id="xml"> - </form> [% IF user.is_timetracker %] <form method="post" action="summarize_time.cgi"> @@ -216,77 +205,89 @@ <input type="submit" id="timesummary" value="Time Summary"> </form> [% IF time_summary_limited %] - <small> - Time Summary will only include the [% terms.bugs %] shown above. In order to - to see a time summary for all [% terms.bugs %] found by the search, you can + <span class="bz_info"> + Time Summary will only include the [% terms.bugs %] shown above. + In order to see a time summary for all [% terms.bugs %] found + by the search, you can <a href="buglist.cgi?[% urlquerypart FILTER html %] [%- "&order=$qorder" FILTER html IF order %]&limit=0"> - Show all search results</a>.</small> + show all search results</a>. + </span> [% END %] [% END %] - </td> - - <td> </td> - - <td valign="middle" class="bz_query_links"> - <a href="buglist.cgi? - [% urlquerypart FILTER html %]&ctype=csv&human=1">CSV</a> | - <a href="buglist.cgi? - [% urlquerypart FILTER html %]&title= - [%- title FILTER html %]&ctype=atom">Feed</a> | - <a href="buglist.cgi? - [% urlquerypart FILTER html %]&ctype=ics">iCalendar</a> | - <a href="colchange.cgi? - [% urlquerypart FILTER html %]&query_based_on= - [% defaultsavename OR searchname FILTER uri %]">Change Columns</a> | + + <form method="post" action="show_bug.cgi"> + <input type="hidden" name="ctype" value="xml"> + [% FOREACH id = buglist %] + <input type="hidden" name="id" value="[% id FILTER html %]"> + [% END %] + <input type="hidden" name="excludefield" value="attachmentdata"> + <button type="submit" id="xml"> + <img src="images/xml.png" width="24" height="24" alt="XML" title="XML Format"> + </button> + </form> + </div> + <div class="bz_query_links"> + <a href="buglist.cgi?[% urlquerypart FILTER html %]&ctype=csv&human=1" + ><img title="CSV Format" alt="CSV" src="images/csv.png" height="24" width="24"></a> + <a href="buglist.cgi?[% urlquerypart FILTER html %]&title= + [%- title FILTER uri %]&ctype=atom" + ><img title="Feed Format" alt="Feed" src="images/rss.png" height="24" width="24"></a> + <a href="buglist.cgi?[% urlquerypart FILTER html %]&ctype=ics" + ><img title="iCal Format" alt="iCal" src="images/ical.png" height="24" width="24"></a> + <button type="button" id="change_columns" + onclick="document.location='colchange.cgi?[% urlquerypart FILTER html %]&query_based_on= + [%~ defaultsavename OR searchname FILTER uri %]'"> + Change Columns</button> + [% IF bugs.size > 1 && caneditbugs && !dotweak %] - <a href="buglist.cgi?[% urlquerypart FILTER html %] - [%- "&order=$qorder" FILTER html IF order %]&tweak=1" - >Change Several [% terms.Bugs %] at Once</a> - | + <button type="button" id="mass_change" + onclick="document.location='buglist.cgi?[% urlquerypart FILTER html %] + [%- "&order=$qorder" FILTER html IF order %]&tweak=1'"> + Change Several [% terms.Bugs %] at Once</button> [% END %] [% IF bugowners && user.id %] - <a href="mailto: - [% bugowners FILTER html %]">Send Mail to [% terms.Bug %] Assignees</a> | + <button type="button" id="email_assignees" + onclick="document.location='mailto:[% bugowners FILTER html %]'"> + Send Mail to [% terms.Bug %] Assignees</button> [% END %] [%# Links to more things users can do with this bug list. %] [% Hook.process("links") %] - </td> + </div> + <br> [% END %] - - <td valign="middle" class="bz_query_edit"> - <a href="[% PROCESS edit_search_url %]">Edit Search</a> - </td> - + <div class="bz_query_edit"> + <button type="button" id="edit_search" + onclick="document.location='[% PROCESS edit_search_url %]'"> + Edit Search</button> + </div> + [% IF searchtype == "saved" %] - <td valign="middle" nowrap="nowrap" class="bz_query_forget"> - | - <a href="buglist.cgi?cmdtype=dorem&remaction=forget&namedcmd= - [% searchname FILTER uri %]&token= - [% issue_hash_token([search_id, searchname]) FILTER uri %]"> - Forget Search '[% searchname FILTER html %]'</a> - </td> + <div class="bz_query_forget"> + <button type="button" id="forget_search" + onclick="document.location='buglist.cgi?cmdtype=dorem&remaction=forget&namedcmd= + [%- searchname FILTER uri %]&token= + [%- issue_hash_token([search_id, searchname]) FILTER uri %]'"> + Forget Search '[% searchname FILTER html %]'</button> + </div> [% ELSE %] - <td> </td> - - <td valign="middle" class="bz_query_remember"> + <div class="bz_query_remember"> <form method="get" action="buglist.cgi"> - <input type="submit" id="remember" value="Remember search"> as - <input type="hidden" name="newquery" + <input type="submit" id="remember" value="Remember search"> as + <input type="hidden" name="newquery" value="[% urlquerypart FILTER html %][% "&order=$qorder" FILTER html IF order %]"> <input type="hidden" name="cmdtype" value="doit"> <input type="hidden" name="remtype" value="asnamed"> <input type="hidden" name="token" value="[% issue_hash_token(['savedsearch']) FILTER html %]"> <input type="text" id="save_newqueryname" name="newqueryname" size="20" - title="New query name" value="[% defaultsavename FILTER html %]"> - </form> - </td> - [% END %] - </tr> -</table> + title="New query name" value="[% defaultsavename FILTER html %]"> + </form> + </div> + [% END %] + </div> [% IF one_product.defined && bugs.size %] <p class="bz_query_single_product"> @@ -315,10 +316,16 @@ [% BLOCK enter_bug_link %] <a href="enter_bug.cgi [%- IF one_product.defined %]?product= - [%- one_product.name FILTER uri %][% END %]">File + [%- one_product.name FILTER uri %] + [%- IF one_component.defined %]&component= + [%- one_component FILTER uri %][% END %][% END %]">File a new [% terms.bug %] [% IF one_product.defined %] - in the "[% one_product.name FILTER html %]" product + in the + [% IF one_component.defined %] + "[% one_component FILTER html %]" component of the + [% END %] + "[% one_product.name FILTER html %]" product [% END %]</a> [% END %] diff --git a/template/en/default/list/list.ics.tmpl b/template/en/default/list/list.ics.tmpl index 4295b4642..327ae171c 100644 --- a/template/en/default/list/list.ics.tmpl +++ b/template/en/default/list/list.ics.tmpl @@ -21,6 +21,9 @@ BEGIN:VTODO [% IF bug.changeddate %] [%+ bug.changedtime FILTER time("%Y%m%dT%H%M%SZ", "UTC") FILTER ics('LAST-MODIFIED') +%] [% END %] +[% IF bug.deadline %] +[%+ bug.deadline FILTER time("%Y%m%dT%H%M%SZ", "UTC") FILTER ics('DUE') +%] +[% END %] [% IF bug.percentage_complete %] [%+ bug.percentage_complete FILTER format('%d') FILTER ics('PERCENT-COMPLETE') +%] [% END %] diff --git a/template/en/default/list/quips.html.tmpl b/template/en/default/list/quips.html.tmpl index 31e766a9b..e928cf0c5 100644 --- a/template/en/default/list/quips.html.tmpl +++ b/template/en/default/list/quips.html.tmpl @@ -15,36 +15,13 @@ #%] [% PROCESS global/header.html.tmpl - title = "$terms.Bugzilla Quip System" + title = "Bugzilla Quip System" header = "Add your own clever headline" + style_urls = ['skins/standard/buglist.css'] %] -[% IF added_quip %] - <p> - <font color="red"> - Your quip '<tt>[% added_quip FILTER html %]</tt>' has been added. - [% IF Param("quip_list_entry_control") == "moderated" AND !user.in_group('bz_quip_moderators') %] - It will be used as soon as it gets approved. - [% END %] - </font> - </p> -[% END %] - -[% IF deleted_quip %] - <p> - <font color="red"> - The quip '<tt>[% deleted_quip FILTER html %]</tt>' has been deleted. - </font> - </p> -[% END %] - -[% IF approved or unapproved %] - <p>[% approved.size %] quips approved and [% unapproved.size %] quips unapproved</p> -[% END %] - - <p> - [% terms.Bugzilla %] will pick a random quip for the headline on each + Bugzilla will pick a random quip for the headline on each [% terms.bug %] list. </p> @@ -61,7 +38,7 @@ <input type="hidden" name="action" value="add"> <input type="hidden" name="token" value="[% issue_hash_token(['create-quips']) FILTER html %]"> - <input size="80" name="quip" maxlength="512"> + <input size="80" name="quip" maxlength="512" required> <p> <input type="submit" id="add" value="Add This Quip"> </p> @@ -93,13 +70,17 @@ <input type="hidden" name="action" value="approve"> <input type="hidden" name="token" value="[% issue_hash_token(['approve-quips']) FILTER html %]"> - <table border="1"> - <thead><tr> + <table id="quips"> + <thead> + <tr class="column_header"> <th>Quip</th> <th>Author</th> <th>Action</th> <th>Approved</th> - </tr></thead><tbody> + </tr> + </thead> + + <tbody> [% FOREACH quipid = quipids %] <tr> <td>[% quips.$quipid.quip FILTER html %]</td> @@ -114,7 +95,7 @@ Delete </a> </td> - <td> + <td class="center"> <input type="hidden" name="defined_quipid_[% quipid FILTER html %]" id="defined_quipid_[% quipid FILTER html %]" value="1"> @@ -126,7 +107,15 @@ [% END %] </tbody> </table> - <script type="text/javascript"><!-- + + <input type="button" id="uncheck_all" value="Uncheck All" + class="bz_default_hidden" onclick="SetCheckboxes(false);"> + <input type="button" id="check_all" value="Check All" + class="bz_default_hidden" onclick="SetCheckboxes(true);"> + <input type="submit" id="update" value="Save Changes"> + + <script type="text/javascript"> + <!-- var numelements = document.forms.editform.elements.length; function SetCheckboxes(value) { var item; @@ -135,13 +124,10 @@ item.checked = value; } } - document.write(' <input type="button" name="uncheck_all" ' - +'value="Uncheck All" onclick="SetCheckboxes(false);">'); - document.write(' <input type="button" name="check_all" ' - +'value="Check All" onclick="SetCheckboxes(true);">'); - //--></script> - - <input type="submit" id="update" value="Save Changes"> + YAHOO.util.Dom.removeClass("check_all", "bz_default_hidden"); + YAHOO.util.Dom.removeClass("uncheck_all", "bz_default_hidden"); + //--> + </script> </form> <br> [% END %] diff --git a/template/en/default/list/server-push.html.tmpl b/template/en/default/list/server-push.html.tmpl index c4a3a8455..65358e6cd 100644 --- a/template/en/default/list/server-push.html.tmpl +++ b/template/en/default/list/server-push.html.tmpl @@ -11,6 +11,7 @@ # query: string. The SQL query which makes the buglist. #%] +<!DOCTYPE html> <html> <head> <title>[% terms.Bugzilla %] is pondering your search</title> @@ -18,7 +19,11 @@ rel="stylesheet" type="text/css"> </head> <body> - <h1 style="margin-top: 20%; text-align: center; font-size: xx-large;">Please stand by ...</h1> + <h1 id="serverpush_msg">Please stand by ...</h1> + + <p class="center"> + <progress>Data is being retrieved...</progress> + </p> [% IF debug %] <p>[% query FILTER html %]</p> diff --git a/template/en/default/list/table.html.tmpl b/template/en/default/list/table.html.tmpl index 96f4ea342..d3abc9b21 100644 --- a/template/en/default/list/table.html.tmpl +++ b/template/en/default/list/table.html.tmpl @@ -28,6 +28,7 @@ [% field_descs.reporter_realname = field_descs.reporter %] [% field_descs.qa_contact_realname = field_descs.qa_contact %] +[%# Setting maxlength => 0 means no limit. We set it for performance reasons. %] [% abbrev = { "bug_severity" => { maxlength => 3 , title => "Sev" } , @@ -41,19 +42,22 @@ "qa_contact" => { maxlength => 30 , ellipsis => "..." , title => "QAContact" } , "qa_contact_realname" => { maxlength => 20 , ellipsis => "..." , title => "QAContact" } , "resolution" => { maxlength => 4 } , - "short_desc" => { wrap => 1 } , + "short_desc" => { maxlength => 0, wrap => 1 } , "short_short_desc" => { maxlength => 60 , ellipsis => "..." , wrap => 1 } , - "status_whiteboard" => { title => "Whiteboard" , wrap => 1 } , - "keywords" => { wrap => 1 } , - "flagtypes.name" => { wrap => 1 } , + "status_whiteboard" => { maxlength => 0, title => "Whiteboard" , wrap => 1 } , + "keywords" => { maxlength => 0, wrap => 1 } , + "tags" => { maxlength => 0, title => "Tags", wrap => 1}, + "dependson" => { maxlength => 0, wrap => 1 } , + "blocked" => { maxlength => 0, wrap => 1 } , + "flagtypes.name" => { maxlength => 0, wrap => 1 } , "component" => { maxlength => 8 , title => "Comp" } , "product" => { maxlength => 8 } , "version" => { maxlength => 5 , title => "Vers" } , - "op_sys" => { maxlength => 4 } , + "op_sys" => { maxlength => 12 } , "bug_file_loc" => { maxlength => 30 } , - "target_milestone" => { title => "TargetM" } , - "longdescs.count" => { title => "# Comments" }, - "percentage_complete" => { format_value => "%d %%" } , + "target_milestone" => { maxlength => 0, title => "TargetM" } , + "longdescs.count" => { maxlength => 0, title => "# Comments" }, + "percentage_complete" => { maxlength => 0, format_value => "%d %%" } , } %] @@ -66,7 +70,7 @@ [%############################################################################%] [% tableheader = BLOCK %] - <table class="bz_buglist" cellspacing="0" cellpadding="4" width="100%"> + <table class="bz_buglist"> <tr class="bz_buglist_header bz_first_buglist_header"> [% IF dotweak %] <th> </th> @@ -137,13 +141,13 @@ [% END %] [% BLOCK order_arrow %] - [% IF order.match("^$id DESC") %] + [% IF order.search("^$id DESC") %] <span class="bz_sort_order_primary">▼</span> - [% ELSIF order.match("^$id(,\\s*|\$)") %] + [% ELSIF order.search("^$id(,\\s*|\$)") %] <span class="bz_sort_order_primary">▲</span> - [% ELSIF order.match("\\b$id DESC") %] + [% ELSIF order.search("\\b$id DESC") %] <span class="bz_sort_order_secondary">▼</span> - [% ELSIF order.match("\\b$id(,\\s*|\$)") %] + [% ELSIF order.search("\\b$id(,\\s*|\$)") %] <span class="bz_sort_order_secondary">▲</span> [% END %] [% END %] @@ -174,45 +178,58 @@ [% END %] <td class="first-child bz_id_column"> <a href="show_bug.cgi?id=[% bug.bug_id %]">[% bug.bug_id %]</a> - <span style="display: none">[%+ '[SEC]' IF bug.secure_mode %]</span> + <span class="bz_default_hidden">[%+ '[SEC]' IF bug.secure_mode %]</span> </td> [% FOREACH column = displaycolumns %] - <td [% 'style="white-space: nowrap"' IF NOT abbrev.$column.wrap %] - class="bz_[% column FILTER css_class_quote %]_column"> - [% IF abbrev.$column.maxlength %] + [% col_abbrev = abbrev.$column %] + <td class="bz_[% column FILTER css_class_quote %]_column + [%~ ' nowrap' UNLESS col_abbrev.wrap + OR bug_fields.$column.type == constants.FIELD_TYPE_FREETEXT + OR bug_fields.$column.type == constants.FIELD_TYPE_TEXTAREA %]"> + [% IF col_abbrev.maxlength %] <span title="[%- display_value(column, bug.$column) FILTER html %]"> [% END %] - [% IF abbrev.$column.format_value %] - [%- bug.$column FILTER format(abbrev.$column.format_value) FILTER html -%] + [% IF col_abbrev.format_value %] + [%- bug.$column FILTER format(col_abbrev.format_value) FILTER html -%] [% ELSIF column == 'actual_time' || column == 'remaining_time' || column == 'estimated_time' %] [% PROCESS formattimeunit time_unit=bug.$column %] [%# Display the login name of the user if their real name is empty. %] - [% ELSIF column.match('_realname$') && bug.$column == '' %] + [% ELSIF column.search('_realname$') && bug.$column == '' %] [% SET login_column = column.remove('_realname$') %] - [% bug.${login_column}.truncate(abbrev.$column.maxlength, - abbrev.$column.ellipsis) FILTER html %] + [% bug.${login_column}.truncate(col_abbrev.maxlength, + col_abbrev.ellipsis) FILTER html %] [% ELSIF column == 'short_desc' || column == "short_short_desc" %] <a href="show_bug.cgi?id=[% bug.bug_id FILTER html %]"> - [%- bug.$column.truncate(abbrev.$column.maxlength, abbrev.$column.ellipsis) FILTER html -%] + [%- bug.$column.truncate(col_abbrev.maxlength, col_abbrev.ellipsis) FILTER html -%] + </a> + [% ELSIF bug_fields.$column.type == constants.FIELD_TYPE_BUG_ID %] + <a href="show_bug.cgi?id=[% bug.$column FILTER html %]"> + [%- bug.$column.truncate(col_abbrev.maxlength, col_abbrev.ellipsis) FILTER html -%] + </a> + [% ELSIF bug_fields.$column.type == constants.FIELD_TYPE_TEXTAREA %] + [%- bug.$column.truncate(256, '...') FILTER html -%] + [% ELSIF column == 'bug_file_loc' && is_safe_url(bug.bug_file_loc) %] + <a href="[% bug.bug_file_loc FILTER html %]" target="_blank" + rel="noreferrer" title="[% bug.bug_file_loc FILTER html %]"> + [%- display_value(column, bug.$column).truncate(col_abbrev.maxlength, col_abbrev.ellipsis) FILTER html -%] </a> [% ELSE %] - [%- display_value(column, bug.$column).truncate(abbrev.$column.maxlength, abbrev.$column.ellipsis) FILTER html -%] + [%- display_value(column, bug.$column).truncate(col_abbrev.maxlength, col_abbrev.ellipsis) FILTER html -%] [% END %] - [% IF abbrev.$column.maxlength %] + [% IF col_abbrev.maxlength %] </span> [% END %] </td> [% END %] </tr> +[% END %] - [% IF loop.last() && time_info.time_present == 1 %] - [% PROCESS time_summary_line %] - [% END %] - +[% IF time_info.time_present %] + [% PROCESS time_summary_line %] [% END %] </table> diff --git a/template/en/default/pages/bug-writing.html.tmpl b/template/en/default/pages/bug-writing.html.tmpl index 1fc097eda..22dd652a7 100644 --- a/template/en/default/pages/bug-writing.html.tmpl +++ b/template/en/default/pages/bug-writing.html.tmpl @@ -66,10 +66,10 @@ no-one else appears to have reported it, then:</p> A good summary should <b>quickly and uniquely identify [% terms.abug %] report</b>. It should explain the problem, not your suggested solution.<br> <ul> - <li>Good: "<tt>Cancelling a File Copy dialog crashes - File Manager</tt>"</li> - <li>Bad: "<tt>Software crashes</tt>"</li> - <li>Bad: "<tt>Browser should work with my web site</tt>"</li> + <li>Good: "<kbd>Cancelling a File Copy dialog crashes + File Manager</kbd>"</li> + <li>Bad: "<kbd>Software crashes</kbd>"</li> + <li>Bad: "<kbd>Browser should work with my web site</kbd>"</li> </ul> <b>Description:</b> diff --git a/template/en/default/pages/bugzilla.dtd.tmpl b/template/en/default/pages/bugzilla.dtd.tmpl index ee4492c61..56e7773e3 100644 --- a/template/en/default/pages/bugzilla.dtd.tmpl +++ b/template/en/default/pages/bugzilla.dtd.tmpl @@ -6,15 +6,15 @@ # defined by the Mozilla Public License, v. 2.0. #%] [% USE Bugzilla %] -<!ELEMENT [% "bugzilla" %] (bug+)> -<!ATTLIST [% "bugzilla" %] +<!ELEMENT bugzilla (bug+)> +<!ATTLIST bugzilla version CDATA #REQUIRED urlbase CDATA #REQUIRED maintainer CDATA #REQUIRED exporter CDATA #IMPLIED > <!ELEMENT [% "bug" %] (bug_id, - (alias?, + (alias*, creation_ts, short_desc, delta_ts, diff --git a/template/en/default/pages/fields.html.tmpl b/template/en/default/pages/fields.html.tmpl index 48b09aee0..8db61c519 100644 --- a/template/en/default/pages/fields.html.tmpl +++ b/template/en/default/pages/fields.html.tmpl @@ -6,9 +6,9 @@ # defined by the Mozilla Public License, v. 2.0. #%] -[% PROCESS global/header.html.tmpl - title = "$terms.Bug Fields" - style_urls = ['skins/standard/page.css'] +[% PROCESS global/header.html.tmpl + title = "$terms.Bug Fields" + bodyclasses = ['narrow_page'] %] <p>This page describes the various fields that you see diff --git a/template/en/default/pages/linked.html.tmpl b/template/en/default/pages/linked.html.tmpl index 92d0f5920..3fcf87952 100644 --- a/template/en/default/pages/linked.html.tmpl +++ b/template/en/default/pages/linked.html.tmpl @@ -25,7 +25,7 @@ <hr> <p> - If you place it in <tt><pre></tt> tags, + If you place it in <code><pre></code> tags, the text will end up looking like this: </p> diff --git a/template/en/default/pages/linkify.html.tmpl b/template/en/default/pages/linkify.html.tmpl index e02ca8d57..eaf45ddd8 100644 --- a/template/en/default/pages/linkify.html.tmpl +++ b/template/en/default/pages/linkify.html.tmpl @@ -10,7 +10,7 @@ <p> If you enter some text, this form will return it marked up like a - standard [% terms.Bugzilla %] comment. That is, valid [% terms.bug %] numbers, + standard Bugzilla comment. That is, valid [% terms.bug %] numbers, URLs, email addresses and so on will be replaced with appropriate HTML links. </p> diff --git a/template/en/default/pages/quicksearch.html.tmpl b/template/en/default/pages/quicksearch.html.tmpl index f3794e1ed..8564f64d0 100644 --- a/template/en/default/pages/quicksearch.html.tmpl +++ b/template/en/default/pages/quicksearch.html.tmpl @@ -7,9 +7,8 @@ #%] [% INCLUDE global/header.html.tmpl - title = "$terms.Bugzilla QuickSearch", - style_urls = ['skins/standard/page.css'] - onload = 'document.forms[\'f\'].quicksearch.focus()' + title = "$terms.Bugzilla QuickSearch" + bodyclasses = ['narrow_page'] %] [% USE Bugzilla %] @@ -17,11 +16,8 @@ <p><label for="quicksearch">Type in one or more words (or pieces of words) to search for:</label></p> -<form name="f" action="buglist.cgi" method="get" - onsubmit="if (this.quicksearch.value == '') - { alert('Please enter one or more search terms first.'); - return false; } return true;"> - <input type="text" size="40" name="quicksearch" id="quicksearch"> +<form name="f" action="buglist.cgi" method="get"> + <input size="40" name="quicksearch" id="quicksearch" autofocus required> <input type="submit" value="Search" id="find"> </form> @@ -38,7 +34,7 @@ <ul class="qs_help"> <li>If you just put a word or series of words in the search box, - [%+ terms.Bugzilla %] will search the + Bugzilla will search the [%+ field_descs.product FILTER html %], [%+ field_descs.component FILTER html %], [%+ IF use_keywords %][%+ field_descs.keywords FILTER html %],[% END %] @@ -53,14 +49,14 @@ </li> <li>Adding more terms <strong>narrows down</strong> the search, it does not - expand it. (In other words, [% terms.Bugzilla %] searches for + expand it. (In other words, Bugzilla searches for [%+ terms.bugs %] that match <em>all</em> your criteria, not [%+ terms.bugs %] that match <em>any</em> of your criteria.)</li> <li>Searching is <strong>case-insensitive</strong>. So <kbd>table</kbd>, <kbd>Table</kbd>, and <kbd>TABLE</kbd> are all the same.</li> - <li>[% terms.Bugzilla %] does not just search for the exact word you put in, + <li>Bugzilla does not just search for the exact word you put in, but also for any word that <strong>contains</strong> that word. So, for example, searching for "cat" would also find [% terms.bugs %] that contain it as part of other words—for example, [% terms.abug %] @@ -128,7 +124,7 @@ referred to as <kbd>[% first_field.name.replace('^cf_') FILTER html %]</kbd>, also. However, if this causes a conflict between the standard - [%+ terms.Bugzilla %] field names and the custom field names, the + Bugzilla field names and the custom field names, the standard field names always take precedence.</p> [% END %] @@ -139,7 +135,7 @@ [% END %] -<table cellspacing="0" cellpadding="0" border="0" class="qs_fields"> +<table class="qs_fields"> <thead> <tr> <th class="field_name">Field</th> @@ -213,6 +209,52 @@ (<kbd>url</kbd> OR <kbd>location</kbd>) AND (<kbd>bar</kbd> OR <kbd>field</kbd>) AND (NOT <kbd>focus</kbd>)</p> </li> + + <li> + The default operator, colon (:), performs a <strong>substring</strong> + match of the value. The following operators are supported: + <ul> + <li> + <strong>:</strong> (substring):<br> + <kbd><em>summary:foo</em></kbd> will search for [% terms.bugs %] + where the <kbd>summary</kbd> contains <kbd>foo</kbd>. + </li> + <li> + <strong>=</strong> (equals):<br> + <kbd><em>summary=foo</em></kbd> will search for [% terms.bugs %] + where the <kbd>summary</kbd> is exactly <kbd>foo</kbd>. + </li> + <li> + <strong>!=</strong> (notequals):<br> + <kbd><em>summary!=foo</em></kbd> will search for [% terms.bugs %] + where the <kbd>summary</kbd> is not <kbd>foo</kbd>. + </li> + <li> + <strong>></strong> (greaterthan):<br> + <kbd><em>creation_ts>-2w</em></kbd> will search for [% terms.bugs %] + where that were created between two weeks ago and now, excluding [% + terms.bugs %] exactly two weeks old. + </li> + <li> + <strong>>=</strong> (greaterthaneq):<br> + <kbd><em>creation_ts>=-2w</em></kbd> will search for [% terms.bugs %] + where that were created between two weeks ago and now, including [% + terms.bugs %] exactly two weeks old. + </li> + <li> + <strong><</strong> (lessthan):<br> + <kbd><em>creation_ts<-2w</em></kbd> will search for [% terms.bugs %] + where that were created more than two weeks ago, excluding [% + terms.bugs %] exactly two weeks old. + </li> + <li> + <strong><=</strong> (lessthaneq):<br> + <kbd><em>creation_ts<=-2w</em></kbd> will search for [% terms.bugs %] + where that were created more than two weeks ago, including [% + terms.bugs %] exactly two weeks old. + </li> + </ul> + </li> </ul> <h2 id="shortcuts">Advanced Shortcuts</h2> @@ -221,7 +263,7 @@ specific fields, there are certain characters or words that you can use as a "shortcut" for searching certain fields:</p> -<table cellspacing="0" cellpadding="0" border="0" class="qs_fields"> +<table class="qs_fields"> <thead> <tr> <th class="field_name">Field</th> @@ -304,7 +346,7 @@ <a href="query.cgi?format=advanced">Advanced Search</a> form.</p> <ul class="qs_help"> - <li>All [% terms.bugs %] reported by userA@company.com or assigned to him + <li>All [% terms.bugs %] reported by userA@company.com or assigned to them (the initial @ is a shortcut for the assignee, see the <a href="#shortcuts">Advanced Shortcuts</a> section above):<br> <kbd>ALL @userA@company.com OR reporter:userA@company.com</kbd></li> diff --git a/template/en/default/pages/release-notes.html.tmpl b/template/en/default/pages/release-notes.html.tmpl index 5ac57bdfc..d4bf1c596 100644 --- a/template/en/default/pages/release-notes.html.tmpl +++ b/template/en/default/pages/release-notes.html.tmpl @@ -6,286 +6,91 @@ # defined by the Mozilla Public License, v. 2.0. #%] -[% SET title = "$terms.Bugzilla 4.4 Release Notes" %] -[% INCLUDE global/header.html.tmpl +[% SET title = "Bugzilla 5.0 Release Notes" %] +[% INCLUDE global/header.html.tmpl title = title - style_urls = ['skins/standard/page.css'] + bodyclasses = ['narrow_page'] %] <h1>[% title FILTER html %]</h1> <ul class="bz_toc"> - <li><a href="#v44_introduction">Introduction</a></li> - <li><a href="#v44_point">Updates in this 4.4.x Release</a></li> - <li><a href="#v44_req">Minimum Requirements</a></li> - <li><a href="#v44_feat">New Features and Improvements</a></li> - <li><a href="#v44_issues">Outstanding Issues</a></li> - <li><a href="#v44_upgrading">Notes On Upgrading From a Previous Version</a></li> - <li><a href="#v44_code_changes">Code Changes Which May Affect + <li><a href="#introduction">Introduction</a></li> + <li><a href="#point">Updates in this 5.0.x Release</a></li> + <li><a href="#req">Minimum Requirements</a></li> + <li><a href="#feat">New Features and Improvements</a></li> + <li><a href="#issues">Outstanding Issues</a></li> + <li><a href="#code_changes">Code Changes Which May Affect Customizations and Extensions</a></li> - <li><a href="#v44_previous">Release Notes for Previous Versions</a></li> + <li><a href="https://bugzilla.readthedocs.org/en/latest/installing/upgrading.html"> + Notes On Upgrading From a Previous Version</a></li> + <li><a href="http://www.bugzilla.org/releases/">Release Notes for Previous Versions</a></li> </ul> -<h2 id="v44_introduction">Introduction</h2> +<h2 id="introduction">Introduction</h2> -<p>Welcome to [% terms.Bugzilla %] 4.4! It has been over a year since we - released [% terms.Bugzilla %] 4.2 on February 2012, and this new major - release comes with several new features and improvements. This release - contains major improvements to WebServices, which were our main target in - this release, a rewritten tagging system, a real MIME type auto-detection for - attachments, improved support for Oracle, performance improvements and lots - of other enhancements.</p> +<p>Welcome to Bugzilla 5.0! It has been slightly over two years since we released + Bugzilla 4.4 in May of 2013. This new major release comes with many new features + and improvements to WebServices and performance.</p> -<p>If you're upgrading, make sure to read <a href="#v44_upgrading">Notes On - Upgrading From a Previous Version</a>. If you are upgrading from a release - before 4.2, make sure to read the release notes for all the - <a href="#v44_previous">previous versions</a> in between your version and - this one, <strong>particularly the Upgrading section of each version's - release notes</strong>.</p> - -<h2 id="v44_point">Updates in this 4.4.x Release</h2> - -<h3>4.4.9</h3> - -<p>This release contains the following [% terms.bug %] fixes:</p> - -<ul> - <li>Users who are not in the insidergroup were able to determine if some - specific user made a private comment in [% terms.bugs %]. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1151290">[% terms.Bug %] 1151290</a>)</li> - <li>Due to a regression caused by <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1090275"> - [% terms.bug %] 1090275</a>, the WebService methods <kbd>B[%%]ug.get_bugs</kbd> and - <kbd>B[%%]ug.get_history</kbd> were no longer allowed. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1154099">[% terms.Bug %] 1154099</a>)</li> - <li>[% terms.Bugzilla %] now supports the new <kbd>.htaccess</kbd> format from Apache 2.4. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1121477">[% terms.Bug %] 1121477</a>)</li> - <li>A regression in [% terms.Bugzilla %] 4.4.3 due to CVE-2014-1517 caused the admin's password - to be ignored when starting a sudo session. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1132887">[% terms.Bug %] 1132887</a>)</li> -</ul> - -<h3>4.4.8</h3> - -<p>This release contains the following [% terms.bug %] fix:</p> - -<ul> - <li>Fixing a regression caused by <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1090275"> - [% terms.bug %] 1090275</a>, <kbd>JSON-RPC</kbd> API calls could crash in - certain cases instead of displaying the proper error message. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1124716">[% terms.Bug %] 1124716</a>)</li> -</ul> - -<h3>4.4.7</h3> - -<p>This release contains fixes for a couple of security issues. - See the <a href="https://www.bugzilla.org/security/4.0.15/"> - Security Advisory</a> for details.</p> - -<p>In addition, the following important fixes have been made in the release:</p> - -<ul> - <li>The <kbd>B[%%]ug.add_comment</kbd> WebService method now returns the correct - ID for the newly created [% terms.bug %] comment. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1111043">[% terms.Bug %] 1111043</a>)</li> - <li>Fixing a regression caused by CVE-2014-1571 - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1064140">[% terms.bug %] 1064140</a>), - comments made while setting a flag from the attachment details page are again - included in the flag notification email. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1082887">[% terms.Bug %] 1082887</a>)</li> -</ul> - -<h3>4.4.6</h3> - -<p>This release fixes several security issues. See the - <a href="http://www.bugzilla.org/security/4.0.14/">Security Advisory</a> - for details.</p> - -<h3>4.4.5</h3> - -<p>This release fixes a security issue. See the - <a href="http://www.bugzilla.org/security/4.0.13/">Security Advisory</a> - for details.</p> - -<h3>4.4.4</h3> - -<p>This release fixes one regression introduced in [% terms.Bugzilla %] 4.4.3 by - <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=968576">security [% terms.bug %] 968576</a>: - URLs in [% terms.bug %] comments are displayed correctly again. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=998323">[% terms.Bug %] 998323</a>)</p> - -<h3>4.4.3</h3> - -<p>This release fixes two security issues. See the - <a href="http://www.bugzilla.org/security/4.0.11/">Security Advisory</a> - for details.</p> - -<p>In addition, the following important fixes/changes have been made in this release:</p> - -<ul> - <li>The <kbd>User.login</kbd> WebService method now also returns a - <kbd>token</kbd> argument containing a login token which you can use in - subsequent calls to authenticate. For security reasons, this method - no longer generates login cookies. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=893195">[% terms.Bug %] 893195</a>)</li> - <li>The <kbd>User.get</kbd> WebService method now correctly takes the - <kbd>maxusermatches</kbd> parameter into account when the <kbd>match</kbd> - argument is passed. Previously, it was returning all matching accounts. - To further limit the number of accounts returned by <kbd>User.get</kbd>, - you can now pass the <kbd>limit</kbd> argument. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=962060">[% terms.Bug %] 962060</a>)</li> - <li>The sudo cookie is no longer accessible from JavaScript. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=966676">[% terms.Bug %] 966676</a>)</li> - <li>Large dependency trees with lots of resolved [% terms.bugs %] now load - much faster. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=961789">[% terms.Bug %] 961789</a>)</li> -</ul> - -<h3>4.4.2</h3> - -<p>The following [% terms.bugs %] have been fixed in this release:</p> - -<ul> - <li><kbd>checksetup.pl</kbd> was incorrectly reporting DBI 1.630 (1.63) as - being older than 1.614, preventing the upgrade to complete. - If you still use Perl 5.10.0 or older, make sure you have the - <a href="http://search.cpan.org/~jpeacock/version/lib/version.pod">version</a> - module installed before running <kbd>checksetup.pl</kbd>. - If you use Perl 5.10.1 or newer, this module is already available and - no special action is required. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=938300">[% terms.Bug %] 938300</a>)</li> - <li>An error about <kbd>longdescs.comment_id</kbd> was thrown by MySQL 5.0 - and 5.1 when upgrading to [% terms.Bugzilla %] 4.4 or 4.4.1. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=870369">[% terms.Bug %] 870369</a>)</li> - <li>Saved searches containing Unicode characters in their name could not - be run if Digest::SHA 5.82 or newer is installed. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=964113">[% terms.Bug %] 964113</a>)</li> - <li>A regression in [% terms.Bugzilla %] 4.4.1 caused <kbd>email_in.pl</kbd> - to fail with an "invalid token" error message. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=928331">[% terms.Bug %] 928331</a> and - <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=930013">[% terms.bug %] 930013</a>)</li> - <li>The PROJECT environment variable is now correctly taken into account - when mod_perl is enabled (this variable allows several installations to - share the same codebase). - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=843457">[% terms.Bug %] 843457</a>)</li> - <li>Mandatory custom fields whose visibility depends on a component are now - correctly required on [% terms.bug %] creation. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=895813">[% terms.Bug %] 895813</a>)</li> - <li>Windows 8.1 is now recognized when reporting new [% terms.bugs %]. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=928092">[% terms.Bug %] 928092</a>)</li> - <li>[% terms.Bugzilla %] no longer crashes when the <kbd>shutdownhtml</kbd> - parameter is set and using a non-cookie based authentication method. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=748095">[% terms.Bug %] 748095</a>)</li> - <li><kbd>importxml.pl</kbd> no longer ignores the <kbd>maxattachmentsize</kbd> - and <kbd>maxlocalattachment</kbd> parameters when importing [% terms.bugs %]. - This means that large attachments are now stored locally in - <kbd>data/attachments/</kbd> if parameters are configured this way. - The script must now be run as the webserver user (e.g. apache) to make these - attachments readable from web browsers. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=360231">[% terms.Bug %] 360231</a>)</li> - <li>The default date and time format used for SQLite has been fixed. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=938161">[% terms.Bug %] 938161</a>)</li> -</ul> - -<h3>4.4.1</h3> - -<p>This release fixes several security issues. See the - <a href="http://www.bugzilla.org/security/4.0.10/">Security Advisory</a> - for details.</p> - -<p>In addition, the following [% terms.bugs %] have been fixed in this release:</p> - -<ul> - <li><kbd>checksetup.pl</kbd> no longer fails with "Invalid version format (non-numeric data)" - when a Perl module contains an invalid version number. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=781672">[% terms.Bug %] 781672</a>)</li> - <li>Internet Explorer 11 and KHTML-based browsers such as Konqueror can now - display buglists correctly. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=902515">[% terms.Bug %] 902515</a> and - <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=914262">[% terms.bug %] 914262</a>)</li> - <li>When editing several [% terms.bugs %] at once and moving them into a new - product, [% terms.bugs %] restricted to a group in the old product could - loose these group restrictions in the new product. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=769134">[% terms.Bug %] 769134</a>)</li> - <li>When the <kbd>password_complexity</kbd> parameter was set to - 'letters_numbers_specialchars', passwords containing numbers and special - characters only were accepted. Now it makes sure that a letter is also present. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=897264">[% terms.Bug %] 897264</a>)</li> - <li>Large dependency trees are now displayed much faster. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=917370">[% terms.Bug %] 917370</a>)</li> - <li>When a user has set many votes, the "Votes" page is now displayed much faster. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=851267">[% terms.Bug %] 851267</a>)</li> - <li>The "My Requests" page now correctly uses the AND/OR operator for the - requester and requestee fields only instead of using it for all fields. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=891311">[% terms.Bug %] 891311</a>)</li> - <li>With DB servers doing case-insensitive comparisons, such as MySQL, tokens - and login cookies were not correctly validated as the case was ignored. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=906745">[% terms.Bug %] 906745</a> and - <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=907438">[% terms.bug %] 907438</a>)</li> - <li>All security headers (such as X-Frame-Options) are now returned when using XML-RPC. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=787328">[% terms.Bug %] 787328</a>)</li> - <li>Oracle crashed when reporting a new [% terms.bug %] if a custom free-text field - was non-mandatory and left empty. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=919475">[% terms.Bug %] 919475</a>)</li> - <li>It was not possible to import [% terms.bugs %] using <kbd>importxml.pl</kbd> with Oracle. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=848063">[% terms.Bug %] 848063</a>)</li> -</ul> +<p>If you're upgrading, make sure to read + <a href="https://bugzilla.readthedocs.org/en/latest/installing/upgrading.html"> + Notes On Upgrading From a Previous Version</a>. If you are upgrading from a + release before 4.4, make sure to read the release notes for all the + <a href="http://www.bugzilla.org/releases/">previous versions</a> in between + your version and this one, <strong>particularly the Upgrading section of each + version's release notes</strong>.</p> -<h2 id="v44_req">Minimum Requirements</h2> +<h2 id="req">Minimum Requirements</h2> -<p>Any requirements that are new since 4.2 will look like +<p>Any requirements that are new since 4.4 will look like <span class="req_new">this</span>.</p> <ul> - <li><a href="#v44_req_perl">Perl</a></li> - <li><a href="#v44_req_mysql">For MySQL Users</a></li> - <li><a href="#v44_req_pg">For PostgreSQL Users</a></li> - <li><a href="#v44_req_oracle">For Oracle Users</a></li> - <li><a href="#v44_req_sqlite">For SQLite Users</a></li> - <li><a href="#v44_req_modules">Required Perl Modules</a></li> - <li><a href="#v44_req_optional_mod">Optional Perl Modules</a></li> - <li><a href="#v44_req_apache">Optional Apache Modules</a></li> + <li><a href="#req_perl">Perl</a></li> + <li><a href="#req_mysql">For MySQL Users</a></li> + <li><a href="#req_pg">For PostgreSQL Users</a></li> + <li><a href="#req_oracle">For Oracle Users</a></li> + <li><a href="#req_sqlite">For SQLite Users</a></li> + <li><a href="#req_modules">Required Perl Modules</a></li> + <li><a href="#req_optional_mod">Optional Perl Modules</a></li> + <li><a href="#req_apache">Optional Apache Modules</a></li> </ul> -<h3 id="v44_req_perl">Perl</h3> - -<p>Perl v5.8.1</p> +<h3 id="req_perl">Perl</h3> -<p><strong>IMPORTANT:</strong> This is the last major release to support - Perl 5.8.x! The next major release, [% terms.Bugzilla %] 5.0, will require - Perl 5.10.1 as a minimum.</p> +<p>Perl <span class="req_new">v5.10.1</span></p> [% INCLUDE db_req db='mysql' %] -[% INCLUDE db_req db='pg' dbd_new => 1 %] +[% INCLUDE db_req db='pg' %] [% INCLUDE db_req db='oracle' %] [% INCLUDE db_req db='sqlite' %] -<h3 id="v44_req_modules">Required Perl Modules</h3> +<h3 id="req_modules">Required Perl Modules</h3> [% INCLUDE req_table reqs = REQUIRED_MODULES - updated = ['TimeDate', 'DBI', 'Email-Send', 'List-MoreUtils'] %] + new = ['File-Slurp','JSON-XS', 'Email-Sender'] + updated = ['DateTime', 'DateTime-TimeZone', + 'Template-Toolkit', 'URI'] %] -<h3 id="v44_req_optional_mod">Optional Perl Modules</h3> +<h3 id="req_optional_mod">Optional Perl Modules</h3> <p>The following perl modules, if installed, enable various - features of [% terms.Bugzilla %]:</p> + features of Bugzilla:</p> [% INCLUDE req_table reqs = OPTIONAL_MODULES - new = ['Net-SMTP-SSL', 'HTML-FormatText-WithLinks', - 'File-MimeInfo', 'IO-stringy'] - updated = ['TheSchwartz'] + new = ['Cache-Memcached','File-Copy-Recursive'] + updated = ['Chart', 'Test-Taint'] include_feature = 1 %] -<h3 id="v44_req_apache">Optional Apache Modules</h3> +<h3 id="req_apache">Optional Apache Modules</h3> -<p>If you are using Apache as your webserver, [% terms.Bugzilla %] can +<p>If you are using Apache as your webserver, Bugzilla can take advantage of some Apache features if you have the below Apache - modules installed and enabled. Currently, - <a href="#v40_feat_js_css_update">certain [% terms.Bugzilla %] features</a> - are enabled only if you have all of the following modules installed - and enabled:</p> + modules installed and enabled.</p> <ul> <li>mod_headers</li> @@ -298,2075 +103,246 @@ you.</p> -<h2 id="v44_feat">New Features and Improvements</h2> +<h2 id="feat">New Features and Improvements</h2> <ul> - <li><a href="#v44_feat_search">Allow Multiple Search Criteria to Match one Field</a></li> - <li><a href="#v44_feat_search_perf">Improved Performance for Searches</a></li> - <li><a href="#v44_feat_bug_tags">Overhaul of the Tagging System</a></li> - <li><a href="#v44_feat_mimetype_autodetect">Auto-Detection of the Attachment MIME Type</a></li> - <li><a href="#v44_feat_saved_reports">Saving Tabular and Graphical Reports</a></li> - <li><a href="#v44_feat_whining">Custom Columns in Whine Emails</a></li> - <li><a href="#v44_feat_webservices">Improved WebServices</a></li> - <li><a href="#v44_feat_apache_config">New Apache Configuration</a></li> - <li><a href="#v44_feat_other">Other Enhancements and Changes</a></li> + <li><a href="#feat_webservices">Improved WebServices</a></li> + <li><a href="#feat_caching_performance">Improved Caching using Memcached</a></li> + <li><a href="#feat_comment_tags">Abililty to Tag [% terms.Bug %] Comments</a></li> + <li><a href="#feat_bug_groups">Improved [% terms.Bug %] Group Membership Checking</a></li> + <li><a href="#feat_documentation">Improved Documentation for Users and Administrators</a></li> + <li><a href="#feat_other">Other Enhancements and Changes</a></li> </ul> -<h3 id="v44_feat_search">Allow Multiple Search Criteria to Match one Field</h3> - -<p> - In the "Advanced Search" page, it is now possible to build queries using - multiple custom search criteria against the same field. In [% terms.Bugzilla %] - 4.2 and older, queries of the form - <br><br> - <kbd>"Status changed to VERIFIED" AND "Status changed by foo@bar.com"</kbd> - <br><br> - were returning all [% terms.bugs %] which had their status changed to VERIFIED - by some user and which were edited by foo@bar.com once, but both actions could - be independent. In [% terms.Bugzilla %] 4.4, you can now decide if both - criteria must match the exact same action or not, i.e. if you want - [%+ terms.bugs %] whose status has been set to VERIFIED by foo@bar.com himself. - In the same way, queries of the form - <br><br> - <kbd>"Flags changed to approval+" AND "Flags changed by foo@bar.com"</kbd> - <br><br> - can now return [% terms.bugs %] for which the approval flag has been set to - "+" by foo@bar.com himself. In previous versions, both actions were treated - independently and [% terms.bugs %] for which foo@bar.com set the approval flag - to "?" and which is then set to "+" by someone else were also returned. -</p> -<p> - This new feature gives you the ability to build more accurate queries and to - get more relevant results. -</p> - -<h3 id="v44_feat_search_perf">Improved Performance for Searches</h3> +<h3 id="feat_webservices">Improved WebServices</h3> <p> - The search system got a performance boost which in some cases decreases the - time spent to run queries from several minutes to a few seconds only. - The more complex your queries are, the more visible the performance win - should be. -</p> - -<h3 id="v44_feat_bug_tags">Overhaul of the Tagging System</h3> - -<p> - The old tagging system which was in the footer of all pages had severe design - and usability limitations and has been replaced by a shiny new one which lets - you tag [% terms.bugs %] from the [% terms.bug %] report directly. Tags now - mostly work like keywords, but with two major differences. First of all, they - are personal, meaning that tags you set on [% terms.bugs %] are only visible - by you, and nobody else is notified nor can see which tags you set. This - behavior is the same as the old tagging system and so this feature didn't - change. The second major difference is that the list of available tags is - unlimited and is in no way hardcoded by administrators. You can type either - a new tag of your choice, or you can select one from an auto-generated list - of tags which you already used in other [% terms.bugs %]. Again, this feature - was already present in the old tagging system, but its usability has been - greatly improved. In particular, this means that tags are now displayed in - [%+ terms.bug %] reports directly, so that you immediately know which tags - you already set for that [% terms.bug %]. This feature is new in this release. + This release has major improvements in the WebServices interface. One big + addition is a new REST-like endpoint alongside the existing XML-RPC and JSON-RPC + endpoints. This will allow clients to access Bugzilla data using standard HTTP + calls for easy development. <strong>Note:</strong> XML-RPC and JSON-RPC are + deprecated in favor of REST and will likely be removed in the Bugzilla 7.0 release. </p> <p> - Another new feature is that your personal tags can now be listed in buglists. - They can also be used as search criteria in your queries. If you decide to - share a saved search which uses tags as criteria, this will work too! Note - that when you add a new tag, no saved search based on this tag is created - anymore, as you can easily create it yourself if you really need it. + Also API key support has been added so that API calls will no longer need to use + cookies or a user's login and password. Users can create a different API key for + each application and revoke API keys that have been compromised or are no longer + needed. The API key will simply be passed to each call as credentials. </p> <p> - The tags set with the old tagging system are automatically migrated to the - new system. + Several methods have been added and existing ones improved to allow returning + data that was not available before such as <kbd>Group.get</kbd>. <kbd>B[%%]ug.search</kbd> + is now as full featured as the Advanced Query UI allowing for the same searches + to be executed. Attachment data such as flags and other metadata can now be + updated through the API. Other WebService changes are detailed + <a href="#feat_webservices_other">below</a>. </p> -<h3 id="v44_feat_mimetype_autodetect">Auto-Detection of the Attachment MIME Type</h3> +<h3 id="feat_caching_performance">Improved Caching using Memcached</h3> <p> - When a user uploads a new attachment and lets the "Content Type" field set to - "auto-detect", [% terms.Bugzilla %] now does its own MIME type detection - if the web browser tells him that the attachment is of type - "application/octet-stream", in an attempt to make a better guess than the web - browser. In all other cases, [% terms.Bugzilla %] still trusts what the browser - tells him. -</p> -<p> - Check the <a href="#v44_req_optional_mod">list of optional Perl modules</a> to - know which modules to install in order to enable MIME type sniffing. + Bugzilla now has the ability to connect to a Memcached server running either + locally or on the network to allow fast access to different types of data. + This cuts down on the amount of database hits and can improve performance. Other + areas have been improved as well to take advantage of caching in memory for + objects that are retrieved multiple times during a request such as user data, etc. </p> -<h3 id="v44_feat_saved_reports">Saving Tabular and Graphical Reports</h3> +<h3 id="feat_comment_tags">Ability to Tag [% terms.Bug %] Comments</h3> <p> - It is now possible to save tabular and graphical reports in the same way as - you save searches. Saved reports will appear in the footer of pages, below - saved searches. -</p> -<p> - Unlike saved searches, it is not yet possible to share saved reports with - other users. + Users can add tags, visible to other users, to [% terms.bug %] comments. This + gives the users the ability to thread conversations, mark comments as spam, + identify important comments, etc. Users can hide comments that contain specific + tags if desired. The tag input field also supports autocompletion so commonly + used tags can be selected. Administrators can make specifically tagged comments + be automatically hidden from view. </p> -<h3 id="v44_feat_whining">Custom Columns in Whine Emails</h3> +<h3 id="feat_bug_groups">Improved [% terms.Bug %] Group Membership Checking</h3> <p> - The list of columns to display in buglists contained in emails sent by the - whining system on a regular basis is no longer hardcoded. If the saved - search used for whining emails contains a list of columns, these columns are - used to be displayed in the emails. If no custom list is found, the default - column list is used instead. + In the past, Bugzilla restricted who can view [% terms.abug %] to everyone + who was a member of ALL the groups the [% terms.bug %] was in. That is, the + groups were ANDed together. This made some access control scenarios rather + difficult to achieve. So now, Bugzilla defaults to (and can be switched to, + in existing installations) a mode where the [% terms.bug %] can be viewed by + everyone who is a member of ANY group the [% terms.bug %] is in. That is, the + groups are ORed together. This give more flexibility in the way [% terms.bugs %] + are made private to specific groups of users. </p> <p> - This means that depending on the kind of email notifications you want, you - can fully customize data to return, on a per saved search basis! + <strong>Note:</strong> Group memberships for [% terms.bugs %] and users are + not changed at all when this setting is switched. When switching from AND to + OR, this means that [% terms.bugs %] may be more widely viewable than previously. + It is the responsibility of the administrator to make sure that no [% terms.bugs %] + are accidentally revealed to the wrong people when changing this setting. </p> -<h3 id="v44_feat_webservices">Improved WebServices</h3> +<h3 id="feat_documentation">Improved Documentation for Users and Administrators</h3> <p> - This release got major improvements in its WebServices interface. Many new - methods have been implemented to let third-party applications interact with - [%+ terms.Bugzilla %] even more closely. For instance, it is now possible to - know what parameters are set to using <kbd>B[%%]ugzilla.parameters</kbd>. - It is now also possible to update tags, products, groups or user accounts - using our API. -<p> -<p> - Several existing methods have also been improved to return data which - weren't available till now, such as [% terms.bug %] and attachment flags - using <kbd>B[%%]ug.get</kbd>, <kbd>B[%%]ug.attachments</kbd> or - <kbd>Product.get</kbd>. Users can also get their saved searches and reports - using <kbd>User.get</kbd>; and much more, see the - <a href="#v44_feat_webservices_details">detailed list</a> below. -</p> - -<h3 id="v44_feat_apache_config">New Apache Configuration</h3> - -<p> - For improved security, [% terms.Bugzilla %] now prevents directory browsing - by default. If you run [% terms.Bugzilla %] under Apache (as most people do), - you most likely require a <strong>new Apache configuration</strong> for this - version of [% terms.Bugzilla %]. See the - <a href="#v44_upgrading">Notes On Upgrading From a Previous Version</a> - section for details. + The standard documentation that is shipped along with the Bugzilla code has been + rewritten and improved using the reStructuredText format. This allows the + documentation to be easily hosted at sites such as ReadTheDocs.org and can + also be more easily converted into different formats such as HTML and PDF. + A new section dedicated to the new REST WebService API has also been added, + significantly improving on the old WebService documentation. </p> -<h3 id="v44_feat_other">Other Enhancements and Changes</h3> - -<h4>Enhancements for Users</h4> - -<ul> - <li><strong>[% terms.Bugs %]:</strong> It is now possible to add yourself to - the CC list when uploading an attachment and when editing an existing one.</li> - <li><strong>[% terms.Bugs %]:</strong> There is a new user preference to be - automatically added to the CC list of [% terms.bugs %] for which a flag - request is addressed to you (the flag has you as the requestee).</li> - <li><strong>[% terms.Bugs %]:</strong> Changes to the CC list no longer - causes midair collisions.</li> - <li><strong>[% terms.Bugs %]:</strong> There is now a <em>(take)</em> link - besides the QA Contact field to easily set yourself as QA contact.</li> - <li><strong>[% terms.Bugs %]:</strong> [% terms.Bugs %] are no longer - reassigned to the default assignee when moving the [% terms.bug %] into - another product or component if the current assignee is not the default - one. Same goes for the QA contact.</li> - <li><strong>[% terms.Bugs %]:</strong> When reporting a new [% terms.bug %], - flags which are not available for the selected component and those which - the reporter cannot edit are now hidden instead of being disabled. For - existing [% terms.bugs %], unset flags are also hidden by default. Clicking - the <em>(set flags)</em> or <em>(more flags)</em> link will make them - appear.</li> - <li><strong>[% terms.Bugs %]:</strong> When viewing [% terms.abug %], the list - of duplicated [% terms.bugs %] is now listed near the top of the page.</li> - <li><strong>[% terms.Bugs %]:</strong> Private comments now always remain - visible to their author. Previously, the author of a comment couldn't see - it anymore if the comment was marked private and the author isn't in the - insider group.</li> - <li><strong>[% terms.Bugs %]:</strong> The See Also field now supports URLs - pointing to GitHub by default. If the new MoreBugUrl extension included in - this release is enabled, then you can also add URLs pointing to: - b[%%]ugs.php.net, RT, appspot.com (Rietveld), Review Board, and - getsatisfaction.com.</li> - <li><strong>Searches:</strong> The alias of [% terms.bugs %] you cannot see - are no longer resolved to their [% terms.bug %] ID, meaning that it is no - longer possible to connect an alias with its ID unless you can see the - [%+ terms.bug %].</li> - <li><strong>Searches:</strong> Custom multi-select fields are now available - in the "Search By Change History" section of the query page.</li> - <li><strong>Searches:</strong> The <em>changed by</em> operator in boolean - charts now accepts pronouns.</li> - <li><strong>Searches:</strong> The requester and requestee fields in boolean - charts now accept pronouns.</li> - <li><strong>Searches:</strong> It is now possible to hide the description of - queries appearing at the top of buglists.</li> - <li><strong>Requests:</strong> The "My Requests" page now displays an AND/OR - radio button to define the interaction between the requester and requestee - fields.</li> - <li><strong>Email Notifications:</strong> There is a new user preference to - not prepend "New:" to the subject of [% terms.bug %]mails when reporting - a new [% terms.bug %]. Some email clients couldn't thread emails correctly - due to this.</li> - <li><strong>Email Notifications:</strong> There is a new email event to get - notifications when the product or component of [% terms.abug %] changes.</li> - <li><strong>Email Notifications:</strong> All [% terms.bug %]mails now have - a <em>X-Bugzilla-Flags</em> email header, listing currently set flags.</li> - <li><strong>Email Notifications:</strong> All [% terms.bug %]mails now have - a <em>X-Bugzilla-Version</em> email header with the current product - version.</li> - <li><strong>Whining:</strong> The sort order of the saved search is used to - sort [% terms.bugs %] in the emails.</li> - <li><strong>User Accounts:</strong> To confirm an email address change, the - password is now requested instead of the old email address.</li> - <li><strong>Graphical Reports:</strong> The size of graphical reports is now - set dynamically to fit within the window of the web browser. - The Taller/Thinner/Fatter/Shorter links are now gone.</li> - <li><strong>Incoming Emails:</strong> <kbd>email_in.pl</kbd> now accepts - HTML-only emails to create and edit [% terms.bugs %] by email.</li> - <li><strong>Incoming Emails:</strong> When creating a new [% terms.bug %], - <kbd>email_in.pl</kbd> will look at the <em>Importance</em> and - <em>X-Priority</em> email headers to increase or decrease the initial - priority of the [% terms.bug %], unless the priority is already explicitly - set in the email itself.</li> - <li><strong>Skins:</strong> [% terms.Bugzilla %] no longer fetches all skins - available when viewing a page. It only loads the skin selected by the user - in his preferences, which results in less requests to the server.</li> -</ul> - -<h4>Enhancements for Administrators and Developers</h4> - -<ul> - <li><strong>License:</strong> The [% terms.Bugzilla %] code is now released - under the MPL 2.0 license (previously was MPL 1.1).</li> - <li><strong>Installation:</strong> On mod_perl, templates now remain in - memory for one hour, which can cause an increase in memory requirements. - This also means that it can take up to one hour before changes in templates - become active (unless you restart Apache).</li> - <li><strong>Installation:</strong> Running - <kbd>checksetup.pl --make-admin=foo@bar.com</kbd> now automatically - re-enables the user account if it was disabled.</li> - <li><strong>Configuration:</strong> A new parameter <em>smtp_ssl</em> can be - turned on to enable SSL connections to the SMTP server to send email - notifications.</li> - <li><strong>Administration:</strong> Custom fields now have a new <em>Long - description</em> attribute to better describe what the custom field is - about. This description then appears as a tooltip when hovering the custom - field in [% terms.bug %] reports.</li> - <li><strong>Administration:</strong> When creating a new product, the form - lets you add a component at the same time.</li> - <li><strong>Administration:</strong> When viewing a user account in - <kbd>editusers.cgi</kbd>, the date of the last login is displayed. Users - who did not log in since you upgraded to 4.4 will have this field empty.</li> - <li><strong>Administration:</strong> It is now possible to exclude disabled - user accounts when running a query in <kbd>editusers.cgi</kbd>.</li> - <li><strong>Administration:</strong> The default CC list is now also displayed - when listing components in <kbd>editcomponents.cgi</kbd>.</li> - <li><strong>Administration:</strong> Target milestones can now be 64 characters - long, for consistency with versions (previously was limited to 20 characters - only).</li> - <li><strong>Administration:</strong> The result code returned by - <kbd>contrib/bugzilla-queue.rhel</kbd> when it's not running is now 2 - instead of 0.</li> - <li><strong>Database:</strong> Support for MySQL 5.6 has been added.</li> - <li><strong>Database:</strong> Support for Oracle has been greatly improved.</li> - <li><strong>Security:</strong> For improved security, the - "X-Content-Type-Options: nosniff" and "X-XSS-Protection: block" - headers are now sent with every response.</li> - <li><strong>Security:</strong> Tokens are now generated using HMAC SHA-256 - instead of MD5.</li> - <li><strong>Documentation:</strong> The documentation is now generated with - <kbd>xmlto</kbd> and <kbd>dblatex</kbd> instead of <kbd>jade</kbd>.</li> -</ul> - -<h4 id="v44_feat_webservices_details">WebService Changes</h4> - -<ul> - <li>Several new methods have been added: <kbd>B[%%]ug.update_tags</kbd>, - <kbd>B[%%]ugzilla.parameters</kbd>, <kbd>B[%%]ugzilla.last_audit_time</kbd>, - <kbd>Classification.get</kbd>, <kbd>Group.update</kbd>, - <kbd>Product.update</kbd>, <kbd>User.update</kbd>.</li> - <li><kbd>B[%%]ug.add_attachment</kbd> now only returns the ID of the newly - created attachments instead of all the attachment data.</li> - <li><kbd>B[%%]ug.attachments</kbd> now also returns the <kbd>size</kbd> field - containing the size of the attachment.</li> - <li><kbd>B[%%]ug.attachments</kbd> and <kbd>B[%%]ug.get</kbd> now return - data about flags.</li> - <li><kbd>B[%%]ug.comments</kbd> now also returns <kbd>creation_time</kbd> - which is exactly the same as <kbd>time</kbd>, but is provided for - consistency with <kbd>B[%%]ug.get</kbd> and <kbd>B[%%]ug.attachments</kbd>. - The <kbd>time</kbd> field may be deprecated and removed in a future release, - so you should use <kbd>creation_time</kbd> instead.</li> - <li><kbd>B[%%]ug.comments</kbd> now also returns the <kbd>count</kbd> field - containing the comment ID relative to the [% terms.bug %] it belongs to. - This is the same comment ID as the one you can see in [% terms.bug %] - reports.</li> - <li>It is now possible to create new [% terms.bugs %] with a closed status with - <kbd>B[%%]ug.create</kbd>.</li> - <li>The <kbd>bug_status</kbd> field returned by <kbd>B[%%]ug.fields</kbd> now - also includes [% terms.bug %] statuses available on [% terms.bug %] creation.</li> - <li><kbd>B[%%]ug.fields</kbd> now also returns keyword descriptions, not only - their names.</li> - <li><kbd>B[%%]ug.fields</kbd> now also returns the <kbd>is_active</kbd> field - for product-specific fields.</li> - <li>For users in the timetracking group, <kbd>B[%%]ug.get</kbd> now also - returns the <kbd>actual_time</kbd> field with the total number of hours - spent in the [% terms.bug %].</li> - <li>Field names returned in the <kbd>field_name</kbd> field of the - <kbd>B[%%]ug.history</kbd> method have changed to be consistent with other - methods.</li> - <li>The <kbd>B[%%]ug.search</kbd> method was returning all visible [% terms.bugs %] - when called with no arguments, ignoring the <kbd>max_search_results</kbd> - and <kbd>search_allow_no_criteria</kbd> parameters. This has been fixed.</li> - <li><kbd>Product.get</kbd> now also returns the <kbd>flag_types</kbd> field - containing all the relevant data for attachment and [% terms.bug %] flag types.</li> - <li><kbd>Product.get</kbd> now throws an error if neither <kbd>ids</kbd> nor - <kbd>names</kbd> is passed to the method.</li> - <li>When requesting data for your own account using <kbd>User.get</kbd>, - this method now returns two additional fields: <kbd>saved_searches</kbd> - and <kbd>saved_reports</kbd> containing all your saved searches and - graphical and tabular reports.</li> - <li><kbd>User.get</kbd> now also returns the <kbd>groups</kbd> field - containing the list of groups the user belongs to. The list is filtered - based on your privileges.</li> -</ul> - - -<h2 id="v44_issues">Outstanding Issues</h2> - -<ul> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=89822"> - [%- terms.Bug %] 89822</a>: When changing multiple [% terms.bugs %] at - the same time, there is no "mid-air collision" protection.</li> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=276230"> - [%- terms.Bug %] 276230</a>: The support for restricting access to - particular Categories of New Charts is not complete. You should treat the - <em>chartgroup</em> parameter as the only access mechanism available.</li> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=584742"> - [%- terms.Bug %] 584742</a>: When viewing [% terms.abug %], WebKit-based - browsers can automatically reset a field's selected value when the field - has disabled values.</li> -</ul> - - -<h2 id="v44_upgrading">Notes On Upgrading From a Previous Version</h2> - -<h3>IMPORTANT: Apache Configuration Change</h3> - -<p> - For improved security, [% terms.Bugzilla %] now prevents directory browsing - by default. In order to do that, the root <kbd>bugzilla/.htaccess</kbd> file - now contains the <kbd>Options -Indexes</kbd> directive. By default, this - directive is not allowed in <kbd>.htaccess</kbd> and so you must configure - Apache to allow it. To do that, add <kbd>Options</kbd> to the - <kbd>AllowOverride</kbd> directive in <kbd>httpd.conf</kbd>. This means you - should now have something like this: - <p> - <kbd>AllowOverride Limit FileInfo Indexes Options</kbd> - </p> - Check the - <a href="http://www.bugzilla.org/docs/4.4/en/html/configuration.html#http-apache">documentation</a> - for more information about how to configure Apache. -</p> - -<h2 id="v44_code_changes">Code Changes Which May Affect Customizations and Extensions</h2> - -<ul> - <li>The <em>usebugaliases</em> parameter has been removed. Aliases are now - always available.</li> - <li>There is a new code hook <kbd>admin_editusers_action</kbd> to alter the - way <kbd>editusers.cgi</kbd> works.</li> - <li>There is a new code hook <kbd>buglist_column_joins</kbd> to alter the way - tables and columns are joined in queries. In combination with the - <kbd>buglist_columns</kbd> hook, this permits to customize the list of - columns to display in buglists.</li> - <li>There is a new code hook <kbd>bug_start_of_update</kbd> which is called - after <kbd>object_end_of_update</kbd> but before <kbd>bug_end_of_update</kbd> - for a better control on how to update [% terms.bugs %].</li> - <li>There is a new code hook <kbd>bug_url_sub_classes</kbd> to support - additional URLs in the See Also field.</li> - <li>There is a new code hook <kbd>error_catch</kbd> to catch errors thrown - by [% terms.Bugzilla %] and to take the appropriate actions.</li> - <li>There is a new code hook <kbd>path_info_whitelist</kbd> to whitelist - scripts which should still get the Path-Info information from URLs. By - default, Path-Info is now removed before being passed to CGI scripts.</li> - <li>It is now illegal to have a product with no components and no versions. - Trying to delete the last component or version of a product is now - rejected.</li> - <li>Trying to set the component, target milestone or version of [% terms.abug %] - to a disabled value is no longer accepted. The change will be rejected.</li> - <li>The comment box now checks the returned value of check_can_change_field() - to determine if it should be displayed or not. This means its visibility - can now be controlled by the <kbd>bug_check_can_change_field</kbd> hook.</li> - <li>Flags now checks the returned value of check_can_change_field() to - determine if they should appear as editable or not. This means their - visibility can now be controlled by the <kbd>bug_check_can_change_field</kbd> - hook.</li> - <li>Quips can no longer exceed 512 characters. Existing quips longer than - that are automatically truncated when upgrading.</li> - <li>The static <kbd>bugzilla.dtd</kbd> file has been replaced by a dynamic - one to take custom fields into account. The old - <em><urlbase>/bugzilla.dtd</em> URL is now - <em><urlbase>/page.cgi?id=bugzilla.dtd</em>.</li> - <li>There is a new extension located at <kbd>extensions/MoreBugUrl/</kbd> - which permits to add new classes of URLs in the See Also field. It uses - the <kbd>bug_url_sub_classes</kbd> hook mentioned above.</li> - <li>There is a new <kbd>B[%%]ugzilla->process_cache</kbd> method to store - data which should remain available for the lifetime of the worker process, - on mod_perl. On mod_cgi, it behaves the same way as - <kbd>B[%%]ugzilla->request_cache</kbd>.</li> - <li>In the RDF output of <kbd>config.cgi</kbd>, URIs used to identify - versions and target milestones have been changed to be unique across - products.</li> - <li>The RDF output of <kbd>config.cgi</kbd> now also returns data about - classifications.</li> - <li>It is now legal to call <kbd>B[%%]ugzilla::Version->check({ id => $id })</kbd> - and <kbd>B[%%]ugzilla::Milestone->check({ id => $id })</kbd> to validate - and get an object using its ID.</li> - <li>Rows in the <kbd>dependencies</kbd>, <kbd>flaginclusions</kbd> and - <kbd>flagexclusions</kbd> DB tables are now enforced to be unique.</li> - <li>The <kbd>b[%%]ugs_activity</kbd> and <kbd>profiles_activity</kbd> DB - tables now have an auto-incremented primary key named <kbd>id</kbd>.</li> - <li>A custom <kbd>B[%%]ugzilla.pm</kbd> module has been added into - <kbd>contrib/</kbd> to help packagers to package B[%%]ugzilla in their - Linux distros.</li> -</ul> - - -<h1 id="v44_previous">[% terms.Bugzilla %] 4.2 Release Notes</h1> - -<ul class="bz_toc"> - <li><a href="#v42_introduction">Introduction</a></li> - <li><a href="#v42_point">Updates in this 4.2.x Release</a></li> - <li><a href="#v42_req">Minimum Requirements</a></li> - <li><a href="#v42_feat">New Features and Improvements</a></li> - <li><a href="#v42_issues">Outstanding Issues</a></li> - <li><a href="#v42_code_changes">Code Changes Which May Affect - Customizations and Extensions</a></li> - <li><a href="#v42_previous">Release Notes for Previous Versions</a></li> -</ul> - -<h2 id="v42_introduction">Introduction</h2> - -<p>Welcome to [% terms.Bugzilla %] 4.2! It has been almost a year since we - released [% terms.Bugzilla %] 4.0 on February 2011, and this new major - release comes with several new features and improvements. This release - contains major improvements to search, support for SQLite, improved - WebServices, and lots of other enhancements.</p> - -<p>If you are upgrading from a release before 4.0, make sure to read the - release notes for all the <a href="#v42_previous">previous versions</a> - in between your version and this one, <strong>particularly the Upgrading - section of each version's release notes</strong>.</p> - -<h2 id="v42_point">Updates in this 4.2.x Release</h2> - -<h3>4.2.3</h3> - -<p>This release fixes two security issues. See the - <a href="http://www.bugzilla.org/security/3.6.10/">Security Advisory</a> - for details.</p> - -<p>In addition, the following important fixes/changes have been made in this - release:</p> - -<ul> - <li>Attaching a file to [% terms.abug %] was broken due to a change in - Perl 5.16. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=771100">[% terms.Bug %] 771100</a>)</li> - <li>A regression in [% terms.Bugzilla %] 4.2.2 made Oracle crash when - displaying a buglist. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=780028">[% terms.Bug %] 780028</a>)</li> - <li>It was possible to search on history for comments and attachments you - cannot see (though these private comments and attachments are never disclosed). - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=779709">[% terms.Bug %] 779709</a>)</li> - <li>PostgreSQL databases could be created with the wrong encoding despite - the utf8 parameter being enabled. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=783786">[% terms.Bug %] 783786</a>)</li> - <li>Scheduled whines could be sent at the wrong time on Oracle. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=559539">[% terms.Bug %] 559539</a>)</li> - <li>Tokens are no longer included in saved queries. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=772953">[% terms.Bug %] 772953</a>)</li> - <li>An admin could unintentionally break the display of buglists if a custom - field description contains a < or > character, because these characters - were not filtered. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=785917">[% terms.Bug %] 785917</a>)</li> - <li>Adding or removing a DB column in Oracle didn't handle SERIAL columns - correctly. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=731156">[% terms.Bug %] 731156</a>)</li> - <li>A minor CSRF vulnerability in token.cgi allowed possible unauthorized - password reset e-mail requests. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=706271">[% terms.Bug %] 706271</a>)</li> -</ul> - -<h3>4.2.2</h3> - -<p>This release fixes two security issues. See the - <a href="http://www.bugzilla.org/security/3.6.9/">Security Advisory</a> - for details.</p> - -<p>In addition, the following important fixes/changes have been made in this - release:</p> - -<ul> - <li>A regression introduced in [% terms.Bugzilla %] 4.0 caused some login - names to be ignored when entered in the CC list of [% terms.bugs %]. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=756314">[% terms.Bug %] 756314</a>)</li> - <li>Some queries could trigger an invalid SQL query if strings entered by - the user contained leading or trailing whitespaces. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=760075">[% terms.Bug %] 760075</a>)</li> - <li>The auto-completion form for keywords no longer automatically selects - the first keyword in the list when the field is empty. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=764517">[% terms.Bug %] 764517</a>)</li> - <li>A regression in [% terms.Bugzilla %] 4.2 prevented classifications - from being used in graphical and tabular reports in the "Multiple Tables" - field. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=753688">[% terms.Bug %] 753688</a>)</li> - <li>Attachments created by the <kbd>email_in.pl</kbd> script were associated - to the wrong comment. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=762785">[% terms.Bug %] 762785</a>)</li> - <li>Very long dependency lists can now be viewed correctly. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=762783">[% terms.Bug %] 762783</a>)</li> - <li>Keywords are now correctly escaped in the auto-completion form to prevent - any XSS abuse. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=754561">[% terms.Bug %] 754561</a>)</li> - <li>A regression introduced in [% terms.Bugzilla %] 4.0rc2 when fixing - CVE-2011-0046 caused the "Un-forget the search" link to not work correctly - anymore when restoring a deleted saved search, because this link was - lacking a valid token. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=768870">[% terms.Bug %] 768870</a>)</li> - <li>Two minor CSRF vulnerabilities have been fixed which could let an attacker - alter your default search criteria in the Advanced Search page. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=754672">[% terms.Bugs %] 754672</a> - and <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=754673">754673</a>)</li> -</ul> - -<h3>4.2.1</h3> - -<p>This release fixes one security issue. See the - <a href="http://www.bugzilla.org/security/3.6.8/">Security Advisory</a> - for details.</p> - -<p>In addition, the following important fixes/changes have been made in this - release:</p> - -<ul> - <li>Due to a regression introduced when fixing CVE-2012-0453, if an XML-RPC - client sets the charset as part of its Content-Type header, we were - incorrectly rejecting the request. The header is now correctly parsed. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=731219">[% terms.Bug %] 731219</a>)</li> - <li>Email notifications about status changes in blockers were incorrectly - formatted. Several pieces of text were missing in the emails. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=731586">[% terms.Bug %] 731586</a>)</li> - <li>Many [% terms.bugs %] related to the searching system have been fixed. - (<a href="https://bugzilla.mozilla.org/buglist.cgi?bug_id=58179,715270,730984,731163,737436"> - [% terms.Bugs %] 58179, 715270, 730984, 731163 and 737436</a>)</li> - <li>When using the QuickSearch box, complex queries are now parsed correctly. - It also behaves correctly with non-ASCII characters (such as é, ä, ü, etc.). - (<a href="https://bugzilla.mozilla.org/buglist.cgi?bug_id=554819,663377,730207"> - [% terms.Bugs %] 554819, 663377 and 730207</a>)</li> - <li>The 'take' link besides the assignee field now works correctly when - the <kbd>usemenuforusers</kbd> parameter is turned on. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=734997">[% terms.Bug %] 734997</a>)</li> - <li>URLs in the 'Total' row at the bottom of tabular reports were broken - when JavaScript was enabled and a user field was used for the vertical - axis. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=731323">[% terms.Bug %] 731323</a>)</li> - <li>Some performance problems have been fixed for installations with many - products, components or versions. - (<a href="https://bugzilla.mozilla.org/buglist.cgi?bug_id=695514,731055"> - [% terms.Bugs %] 695514 and 731055</a>)</li> - <li>A new hook named <kbd>buglist_column_joins</kbd> has been added to let - extensions alter the <kbd>Bugzilla::Search::COLUMN_JOINS</kbd> hash. - Now more fields can be displayed as columns in buglists, in combination - with the already existing <kbd>buglist_columns</kbd> hook. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=743991">[% terms.Bug %] 743991</a>)</li> - <li>A new hook named <kbd>admin_editusers_action</kbd> has been added to let - extensions alter the behavior of <kbd>editusers.cgi</kbd>. This lets you add - new features to this script very easily. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=730794">[% terms.Bug %] 730794</a>)</li> -</ul> - -<h2 id="v42_req">Minimum Requirements</h2> - -<p>Any requirements that are new since 4.0.2 will look like - <span class="req_new">this</span>.</p> - -<ul> - <li><a href="#v42_req_perl">Perl</a></li> - <li><a href="#v42_req_mysql">For MySQL Users</a></li> - <li><a href="#v42_req_pg">For PostgreSQL Users</a></li> - <li><a href="#v42_req_oracle">For Oracle Users</a></li> - <li><a href="#v42_req_sqlite">For SQLite Users</a></li> - <li><a href="#v42_req_modules">Required Perl Modules</a></li> - <li><a href="#v42_req_optional_mod">Optional Perl Modules</a></li> - <li><a href="#v42_req_apache">Optional Apache Modules</a></li> -</ul> - -<h3 id="v42_req_perl">Perl</h3> - -<p>Perl v5.8.1</p> - -<h3 id="v42_req_mysql">For MySQL Users</h3> - -<ul> - <li>MySQL <span class="req_new">v5.0.15</span></li> - <li><strong>perl module:</strong> DBD::mysql <span class="req_new">v4.001</span></li> -</ul> - -<h3 id="v42_req_pg">For PostgreSQL Users</h3> - -<ul> - <li>PostgreSQL <span class="req_new">v8.03.0000</span></li> - <li><strong>perl module:</strong> DBD::Pg v1.45</li> -</ul> - -<h3 id="v42_req_oracle">For Oracle Users</h3> - -<ul> - <li>Oracle v10.02.0</li> - <li><strong>perl module:</strong> DBD::Oracle v1.19</li> -</ul> - -<h3 id="v42_req_sqlite">For SQLite Users</h3> - -<ul> - <li>SQLite v3.6.22</li> - <li><strong>perl module:</strong> DBD::SQLite v1.29</li> -</ul> - -<h3 id="v42_req_modules">Required Perl Modules</h3> - - -<table class="req_table" border="0" cellpadding="0" cellspacing="0"> - <tbody> - <tr> - <th>Module</th> - <th>Version</th> - </tr> - <tr> - <td>CGI</td> - <td>3.51</td> - </tr> - <tr> - <td>Digest::SHA</td> - <td>(Any)</td> - </tr> - <tr> - <td>Date::Format</td> - <td>2.21</td> - </tr> - <tr> - <td>DateTime</td> - <td>0.28</td> - </tr> - <tr> - <td>DateTime::TimeZone</td> - <td>0.71</td> - </tr> - <tr> - <td>DBI</td> - <td>1.614</td> - </tr> - <tr> - <td>Template</td> - <td>2.22</td> - </tr> - <tr> - <td>Email::Send</td> - <td>2.00</td> - </tr> - <tr> - <td>Email::MIME</td> - <td>1.904</td> - </tr> - <tr> - <td>URI</td> - <td class="req_new">1.37</td> - </tr> - <tr> - <td>List::MoreUtils</td> - <td>0.22</td> - </tr> - <tr> - <td class="req_new">Math::Random::ISAAC</td> - <td class="req_new">1.0.1</td> - </tr> - </tbody> -</table> - -<h3 id="v42_req_optional_mod">Optional Perl Modules</h3> - -<p>The following perl modules, if installed, enable various - features of [% terms.Bugzilla %]:</p> - - -<table class="req_table" border="0" cellpadding="0" cellspacing="0"> - <tbody> - <tr> - <th>Module</th> - <th>Version</th> - <th>Enables Feature</th> - </tr> - <tr> - <td>GD</td> - <td>1.20</td> - <td>Graphical Reports, New Charts, Old Charts</td> - </tr> - <tr> - <td>Chart::Lines</td> - <td>2.1</td> - <td>New Charts, Old Charts</td> - </tr> - <tr> - <td>Template::Plugin::GD::Image</td> - <td>(Any)</td> - <td>Graphical Reports</td> - </tr> - <tr> - <td>GD::Text</td> - <td>(Any)</td> - <td>Graphical Reports</td> - </tr> - <tr> - <td>GD::Graph</td> - <td>(Any)</td> - <td>Graphical Reports</td> - </tr> - <tr> - <td>MIME::Parser</td> - <td>5.406</td> - <td>Move [% terms.Bugs %] Between Installations</td> - </tr> - <tr> - <td>LWP::UserAgent</td> - <td>(Any)</td> - <td>Automatic Update Notifications</td> - </tr> - <tr> - <td>XML::Twig</td> - <td>(Any)</td> - <td>Move [% terms.Bugs %] Between Installations, Automatic Update Notifications</td> - </tr> - <tr> - <td>PatchReader</td> - <td class="req_new">0.9.6</td> - <td>Patch Viewer</td> - </tr> - <tr> - <td>Net::LDAP</td> - <td>(Any)</td> - <td>LDAP Authentication</td> - </tr> - <tr> - <td>Authen::SASL</td> - <td>(Any)</td> - <td>SMTP Authentication</td> - </tr> - <tr> - <td>Authen::Radius</td> - <td>(Any)</td> - <td>RADIUS Authentication</td> - </tr> - <tr> - <td>SOAP::Lite</td> - <td>0.712</td> - <td>XML-RPC Interface</td> - </tr> - <tr> - <td>JSON::RPC</td> - <td>(Any)</td> - <td>JSON-RPC Interface</td> - </tr> - <tr> - <td>JSON::XS</td> - <td>2.0</td> - <td>Make JSON-RPC Faster</td> - </tr> - <tr> - <td>Test::Taint</td> - <td>(Any)</td> - <td>JSON-RPC Interface, XML-RPC Interface</td> - </tr> - <tr> - <td>HTML::Parser</td> - <td>3.67</td> - <td>More HTML in Product/Group Descriptions</td> - </tr> - <tr> - <td>HTML::Scrubber</td> - <td>(Any)</td> - <td>More HTML in Product/Group Descriptions</td> - </tr> - <tr> - <td class="req_new">Encode</td> - <td class="req_new">2.21</td> - <td>Automatic charset detection for text attachments</td> - </tr> - <tr> - <td class="req_new">Encode::Detect</td> - <td class="req_new">(Any)</td> - <td>Automatic charset detection for text attachments</td> - </tr> - <tr> - <td>Email::MIME::Attachment::Stripper</td> - <td>(Any)</td> - <td>Inbound Email</td> - </tr> - <tr> - <td>Email::Reply</td> - <td>(Any)</td> - <td>Inbound Email</td> - </tr> - <tr> - <td>TheSchwartz</td> - <td>(Any)</td> - <td>Mail Queueing</td> - </tr> - <tr> - <td>Daemon::Generic</td> - <td>(Any)</td> - <td>Mail Queueing</td> - </tr> - <tr> - <td>mod_perl2</td> - <td>1.999022</td> - <td>mod_perl</td> - </tr> - <tr> - <td>Apache2::SizeLimit</td> - <td class="req_new">0.96</td> - <td>mod_perl</td> - </tr> - </tbody> -</table> - -<h3 id="v42_req_apache">Optional Apache Modules</h3> - -<p>If you are using Apache as your webserver, [% terms.Bugzilla %] can - take advantage of some Apache features if you have the below Apache - modules installed and enabled. Currently, - <a href="#v40_feat_js_css_update">certain [% terms.Bugzilla %] features</a> - are enabled only if you have all of the following modules installed - and enabled:</p> - -<ul> - <li>mod_headers</li> - <li>mod_expires</li> - <li>mod_env</li> -</ul> - -<p>On most systems (but not on Windows), <kbd>checksetup.pl</kbd> is able to - tell whether or not you have these modules installed, and it will tell - you.</p> - - -<h2 id="v42_feat">New Features and Improvements</h2> - -<ul> - <li><a href="#v42_feat_sqlite">Experimental SQLite Support</a></li> - <li><a href="#v42_feat_attach">Creating an Attachment by Pasting Text Into - a Text Field</a></li> - <li><a href="#v42_feat_email">HTML [% terms.Bug %]mail</a></li> - <li><a href="#v42_feat_search">Improved Searching System</a></li> - <li><a href="#v42_feat_product">Disabling Old Components, Versions and Milestones</a></li> - <li><a href="#v42_feat_custom">Displaying a Custom Field Value Based on Multiple - Values of Another Field</a></li> - <li><a href="#v42_feat_audit">Auditing of All Changes Within [% terms.Bugzilla %]</a></li> - <li><a href="#v42_feat_wai">Accessibility Improvements</a></li> - <li><a href="#v42_feat_other">Other Enhancements and Changes</a></li> -</ul> - -<h3 id="v42_feat_sqlite">Experimental SQLite Support</h3> - -<p>SQLite is now supported by [% terms.Bugzilla %] and becomes the 4th supported - database besides MySQL, PostgreSQL and Oracle. SQLite support must be considered - as experimental, at least till the next major release.</p> - -<p>Note that use of SQLite is only recommended for small installations. Larger - installations should use MySQL, PostgreSQL, or Oracle.</p> - -<h3 id="v42_feat_attach">Creating an Attachment by Pasting Text Into a Text Field</h3> - -<p>You can now create a new attachment simply by pasting some text into a text - field, in addition to the normal upload process for attachments.</p> - -<h3 id="v42_feat_email">HTML [% terms.Bug %]mail</h3> - -<p>By default, [% terms.bug %]mails (email notifications about changes to - [%+ terms.bugs %]) are now sent in an HTML format that is more readable than - the old text format. Those who prefer the old text format can still choose it - in their Preferences, however.</p> - -<h3 id="v42_feat_search">Improved Searching System</h3> - -<p>The Custom Search section in the Advanced Search page has been redesigned - to work in a more sensible way. Complex queries are easier to build and have - more sensible results, as they are built using a more intuitive logic. - Some very complicated queries are still impossible to generate, though. - Things should improve in future releases.</p> - -<h3 id="v42_feat_product">Disabling Old Components, Versions and Milestones</h3> - -<p>Older components, versions and milestones can now be disabled. [% terms.Bugs %] - already using them are not affected, but these values will no longer be - available for new [% terms.bugs %].</p> - -<h3 id="v42_feat_custom">Displaying a Custom Field Value Based on Multiple Values - of Another Field</h3> - -<p>A custom field can now be displayed based on multiple values of another field. - (For example, one custom field could now appear in multiple products.) - Previously, you could only display a custom field based on a single value of - another field.</p> - -<h3 id="v42_feat_audit">Auditing of All Changes Within [% terms.Bugzilla %]</h3> - -<p>Most changes made through the admin interface are now logged to the database, - in the <kbd>audit_log</kbd> table. There is no UI to access this table yet, - but developers are free to create their own tools to track changes made into - their installation. This is only a first step, and improvements are expected - in future releases.</p> - -<h3 id="v42_feat_wai">Accessibility Improvements</h3> - -<p>A project has started thanks to Francisco Donalisio from IBM to make - [%+ terms.Bugzilla %] compliant with the W3C Web Accessibility Initiative - standards. A lot more work still needs to be done, but we expect a much - better compatibility for the next major release.</p> - -<h3 id="v42_feat_other">Other Enhancements and Changes</h3> +<h3 id="feat_other">Other Enhancements and Changes</h3> <h4>Enhancements for Users</h4> <ul> - <li><strong>[% terms.Bugs %]:</strong> Users without editbugs privileges can - no longer remove other users from the CC list of [% terms.bugs %].</li> - <li><strong>[% terms.Bugs %]:</strong> Local [% terms.bug %] IDs are now valid - in the See Also field. Adding such an ID will also add a reciprocal link in - the other [% terms.bug %].</li> - <li><strong>[% terms.Bugs %]:</strong> After editing [% terms.abug %] or an - attachment, the URL is automatically changed to <kbd>show_bug.cgi</kbd> - instead of <kbd>post_bug.cgi</kbd>, <kbd>process_bug.cgi</kbd> or - <kbd>attachment.cgi</kbd> so that reloading the page (for instance when - restarting the web browser) displays the right page. This feature is supported - by Firefox, Chrome and Safari, but not by Internet Explorer 9.</li> - <li><strong>[% terms.Bugs %]:</strong> Inactive accounts are no longer - displayed in user fields when user-autocompletion is enabled.</li> - <li><strong>[% terms.Bugs %]:</strong> User-autocompletion is now much faster - on installations with many user accounts.</li> - <li><strong>[% terms.Bugs %]:</strong> The See Also field now accepts URLs - pointing to MantisBT, Trac, JIRA and the sourceforge.net b[%%]ug trackers.</li> - <li><strong>[% terms.Bugs %]:</strong> Displaying [% terms.abug %] with many - dependencies is now much faster.</li> - <li><strong>Attachments:</strong> The encoding of text files can be automatically - detected when uploading them as attachments.</li> - <li><strong>Attachments:</strong> Clickjacking could possibly occur in an attachment - Details page if a user attached a specially formatted HTML file. To fix this - potential problem, the Details page always displays the HTML source instead and - users can see rendered page by clicking on View.</li> - <li><strong>Flags:</strong> Changing the requestee of a flag no longer changes - the requester.</li> - <li><strong>Reports:</strong> If JavaScript is enabled in your web browser, - tabular reports are now sortable based on any displayed column.</li> - <li><strong>Dependency graphs:</strong> The <em>Show every [% terms.bug %] in - the system with dependencies</em> option has been removed.</li> - <li><strong>Searches:</strong> The columns displayed by default in - [%+ terms.bug %]lists have changed. These columns are now displayed by default - unless otherwise specified:<br> - <kbd>product | component | assignee | [% terms.bug %] status | resolution | - [%+ terms.bug %] summary | last change date</kbd><br> - This means that the priority, severity and operating system columns are no - longer displayed by default.</li> - <li><strong>Searches:</strong> [% terms.Bug %]lists will now only display the - first 500 [% terms.bugs %] by default. It is still possible to display the - whole list, though.</li> - <li><strong>Searches:</strong> When using relative dates and times, <kbd>-1w</kbd> - is now a synonym for <kbd>-7d</kbd> and means exactly 7 days. Previously, - <kbd>-1w</kbd> meant the beginning of the week, which was confusing some users. - The same confusion existed for <kbd>-1d</kbd> which was different from - <kbd>-24h</kbd>, and for <kbd>-1m</kbd> which was different from <kbd>-30d</kbd>. - Now if you really want the beginning of the day, week or month, you must use - <kbd>-1ds</kbd>, <kbd>-1ws</kbd>, and <kbd>-1ms</kbd> respectively, where - "s" means "start of". This change will affect existing saved searches using - relative dates.</li> - <li><strong>Searches:</strong> A new <em>Include fulltext when performing quick - searches</em> user preference has been added which permits users to include - or exclude comments when using quicksearches.</li> - <li><strong>Searches:</strong> It is now possible to query for [% terms.bugs %] - based on personal tags in the Custom Search section in the Advanced Search - page.</li> - <li><strong>Email notifications: </strong> The date and time of comments are no - longer displayed in the comment header in [% terms.bug%]mails. This information - is already available in the email header itself.</li> + <li><strong>[% terms.Bugs %]:</strong> The deadline field is now visible to users + not in the the <kbd>timetracking</kbd> group.</li> + <li><strong>[% terms.Bugs %]:</strong> There is now a "Preview" mode when + creating a new comment that allows you to see how the comment will look + before committing to the database.</li> + <li><strong>[% terms.Bugs %]:</strong> The reporter is now allowed to enter + keywords at time of [% terms.bug %] creation.</li> + <li><strong>[% terms.Bugs %]:</strong> "See Also" now allows spaces as well as + commas to delimit multiple values.</li> + <li><strong>[% terms.Bugs %]:</strong> Auto linkification in comments of [% terms.bug %] + IDs and comment IDs has been improved.</li> + <li><strong>[% terms.Bugs %]:</strong> [% terms.Bugs %] can now have multiple + aliases assigned to them. Before each [% terms.bug %] could only have a single + value. Also, aliases are now visible in the browser's title bar.</li> + <li><strong>[% terms.Bugs %]:</strong> Users can now change the flags of multiple + [%+ terms.bugs %] at once using the mass-edit form.</li> + <li><strong>Charts and Reports:</strong> UTF-8 characters are now correctly + displayed in "New Charts" and graphical reports.</li> + <li><strong>Charts and Reports:</strong> Custom multi-select fields are now + available as report axis options. This makes them usable for categorizing + [%+ terms.bugs %] in reports.</li> + <li><strong>Email:</strong> You can now choose to not receive any mail at all + about a particular [% terms.bug %], even if you continue to have a role on + that [% terms.bug %] (e.g. reporter).</li> + <li><strong>Email:</strong> When adding or removing [% terms.abug %] as a + dependency, the summary of the [% terms.bug %] is included in the email + notification.</li> + <li><strong>Requests:</strong> <kbd>request.cgi</kbd> can now output results in + CSV format.</li> + <li><strong>Requests:</strong><kbd> X-Bugzilla-*</kbd> headers are now included + in flag notification emails.</li> + <li><strong>Searches:</strong> Some useful searches have been added to the + Bugzilla home page.</li> + <li><strong>Searches:</strong> Quicksearch now allows for use of comparison + operators such as !=, >=, >, <, etc., in addition to substring searches.</li> + <li><strong>Searches:</strong> The "Blocks" and "Depends On" values can now be + displayed as columns in [% terms.abug %] list.</li> + <li><strong>Searches:</strong> The "is empty" and "is not empty" search operators + have been added to the Advanced Search UI. This allows searching for null + and not null values for certain fields.</li> </ul> <h4>Enhancements for Administrators and Developers</h4> <ul> - <li><strong>Installation:</strong> <kbd>checksetup.pl</kbd> is now much quieter - when creating a new database.</li> - <li><strong>Security:</strong> [% terms.Bugzilla %] 4.0 is using - <kbd>Math::Random::Secure</kbd> to generate cryptographically secure - pseudorandom numbers, but it appeared that installing this Perl module from - CPAN caused a lot of trouble for some people due to its numerous dependencies. - So the RNG code has been rewritten to only depend on <kbd>Math::Random::ISAAC</kbd>, - which was already in use in previous versions of [% terms.Bugzilla %].</li> - <li><strong>Security:</strong> <kbd>X-Frame-Options = SAMEORIGIN</kbd> is now - passed to all page headers (except when viewing attachments, as they can be - on a different host) to protect users from framing and subsequent possible - clickjacking problems.</li> - <li><strong>Configuration:</strong> A new parameter <em>password_complexity</em> - has been added (default: no_constraints) which allows admins to force users - to use passwords with a higher complexity, such as a combination of uppercase - and lowercase letters, numbers and special characters, or a subset of them.</li> - <li><strong>Configuration:</strong> A new parameter <em>search_allow_no_criteria</em> - has been added (default: on) which allows admins to forbid queries with no - criteria. This is particularly useful for large installations with several - tens of thousands [% terms.bugs %] where returning all [% terms.bugs %] - doesn't make sense and would have a performance impact on the database.</li> - <li><strong>Configuration:</strong> A new parameter <em>default_search_limit</em> - has been added (default: 500) which limits the number of [% terms.bugs %] - displayed by default in a [% terms.bug%]list. The user can ask to see a larger - list, though.</li> - <li><strong>Configuration:</strong> A new parameter <em>max_search_results</em> - has been added (default: 10000) which limits the number of [% terms.bugs %] - a user can request at once in a [% terms.bug%]list. This is a hard limit and - a user cannot bypass this value.</li> - <li><strong>Configuration:</strong> A new parameter <em>ajax_user_autocompletion</em> - has been added (default: on) to allow administrators to disable auto-completion - when typing characters in user fields. This parameter should only be disabled - if your installation is unable to support the load generated by this feature.</li> - <li><strong>Configuration:</strong> The <em>config_modify_panels</em> hook now - lets you add additional parameters to existing parameters panels.</li> - <li><strong>Flags:</strong> Users with local editcomponents privileges can now - edit flag types for products they can administer.</li> - <li><strong>Quips:</strong> A new system group <em>bz_quip_moderators</em> has - been created to moderate quips. Till now, you had to be in the <em>admin</em> - group to do that.</li> - <li><kbd>importxml.pl</kbd> now inserts each comment separately into the imported - [%+ terms.bug %] instead of concatenating them all into a single comment.</li> - <li><kbd>email_in.pl</kbd> now ignores auto-submitted incoming emails (for - instance, all these "out of office" emails).</li> - <li>New code hooks: email_in_before_parse, email_in_after_parse, - install_filesystem, install_update_db_fielddefs, job_map, object_end_of_create, - quicksearch_map, user_preferences.</li> -</ul> - -<h4>WebService Changes</h4> - -<ul> - <li>Two new methods have been added: <kbd>Product.create</kbd> and - <kbd>Group.create</kbd>.</li> - <li><kbd>B[%%]ug.update</kbd> no longer throws an error when passing an empty - string to <kbd>see_also</kbd>. It now simply ignores this empty value.</li> - <li><kbd>Product.get</kbd> now also returns data about the classification it - belongs to as well as its components, milestones and versions. It also - returns the <kbd>default_milestone</kbd> and <kbd>has_unconfirmed</kbd> - attributes.</li> - <li>In <kbd>B[%%]ug.fields</kbd>, the <kbd>sortkey</kbd> attribute used in - <kbd>values</kbd> has been renamed to <kbd>sort_key</kbd>.</li> - <li>In <kbd>B[%%]ug.attachments</kbd> and <kbd>B[%%]ug.add_attachment</kbd>, - the <kbd>is_url</kbd> attribute no longer exists.</li> -</ul> - - -<h2 id="v42_issues">Outstanding Issues</h2> - -<ul> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=89822"> - [%- terms.Bug %] 89822</a>: When changing multiple [% terms.bugs %] at - the same time, there is no "mid-air collision" protection.</li> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=276230"> - [%- terms.Bug %] 276230</a>: The support for restricting access to - particular Categories of New Charts is not complete. You should treat the - <em>chartgroup</em> parameter as the only access mechanism available.</li> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=584742"> - [%- terms.Bug %] 584742</a>: When viewing [% terms.abug %], WebKit-based - browsers can automatically reset a field's selected value when the field - has disabled values.</li> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=780053"> - [%- terms.Bug %] 780053</a>: Oracle crashes when listing keywords, tags - or flags in buglists.</li> -</ul> - - -<h2 id="v42_code_changes">Code Changes Which May Affect Customizations and Extensions</h2> - -<ul> - <li>The <kbd>email/newchangedmail.txt.tmpl</kbd> template is now fully templatized, - meaning that the diff table displaying changes in [% terms.bug %] fields is - now generated in the template itself. This means [% terms.bug %]mails are now - fully localizable.</li> - <li>The bugmail_recipients hook has been modified to pass <kbd>diffs</kbd> with - changes made to the [% terms.bug %] as well as <kbd>users</kbd> including - recipients of the email notification.</li> - <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 - since [% terms.Bugzilla %] 2.19.</li> - <li><kbd>sidebar.cgi</kbd> has been removed, because Gecko-based browsers no - longer support remote XUL, and its popularity is very low.</li> - <li><kbd>contrib/yp_nomail.sh</kbd> has been removed. This script is no longer - useful since [% terms.Bugzilla %] 3.0.</li> - <li><kbd>contrib/bugzilla_ldapsync.rb</kbd> has been removed. This script didn't - work for a long time.</li> -</ul> - - -<h1 id="v42_previous">[% terms.Bugzilla %] 4.0 Release Notes</h1> - -<ul class="bz_toc"> - <li><a href="#v40_introduction">Introduction</a></li> - <li><a href="#v40_point">Updates in this 4.0.x Release</a></li> - <li><a href="#v40_req">Minimum Requirements</a></li> - <li><a href="#v40_feat">New Features and Improvements</a></li> - <li><a href="#v40_issues">Outstanding Issues</a></li> - <li><a href="#v40_upgrading">Notes On Upgrading From a Previous Version</a></li> - <li><a href="#v40_code_changes">Code Changes Which May Affect - Customizations and Extensions</a></li> - <li><a href="#v40_previous">Release Notes for Previous Versions</a></li> -</ul> - -<h2 id="v40_introduction">Introduction</h2> - -<p>This is [% terms.Bugzilla %] 4.0! Since 3.6 (our previous major - release) we've come a long way, and we've come even further compared to - 3.0 in 2007! Since [% terms.Bugzilla %] 3.0, almost every major user - interface in [% terms.Bugzilla %] has been redesigned, the WebServices have - evolved enormously, there's a great new Extensions system, and there - are hundreds of other new features. With the major redesigns that come - particularly in this release compared to 3.6, we felt that it was time to - call this release 4.0.</p> - -<p>It's not just major WebService and UI enhancements that are new in - [%+ terms.Bugzilla %] 4.0—there are many other exciting new features, - including automatic duplicate detection, enhanced custom field - functionality, autocomplete for users, search improvements, and much - more. Overall, 4.0 is far and away the best version of [% terms.Bugzilla %] - we've ever released.</p> - -<p>If you're upgrading, make sure to read <a href="#v40_upgrading">Notes - On Upgrading From a Previous Version</a>. If you are upgrading from a release - before 3.6, make sure to read the release notes for all the - <a href="#v40_previous">previous versions</a> in between your version - and this one, <strong>particularly the Upgrading section of each - version's release notes</strong>.</p> - -<p>We would like to thank - <a href="http://www.itasoftware.com/">ITA Software</a>, - the <a href="http://www.ibm.com/linux/ltc/">IBM Linux Technology Center</a>, - and <a href="http://www.redhat.com/">Red Hat</a> for funding the development - of certain features and improvements in this release of - [%+ terms.Bugzilla %].</p> - -<h2 id="v40_point">Updates in this 4.0.x Release</h2> - -<h3>4.0.2</h3> - -<p>This release fixes several security issues. See the - <a href="http://www.bugzilla.org/security/3.4.11/">Security Advisory</a> - for details.</p> - -<p>In addition, the following important fixes/changes have been made in this - release:</p> - -<ul> - <li>The <kbd>B[% %]ug.create</kbd> WebService method now throws an error if you - pass a group name which doesn't exist. In [% terms.Bugzilla %] 4.0 and 4.0.1, - this group name was silently ignored, leaving your [% terms.bug %] unsecure - if no other group applied. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=653341">[% terms.Bug %] 653341</a>)</li> - <li>Moving several [% terms.bugs %] at once into another product displayed the - same confirmation page again and again, and changes were never committed - (regressed in 4.0). - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=663208">[% terms.Bug %] 663208</a>)</li> - <li>Marking [% terms.abug %] as a duplicate now works in Internet Explorer 9. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=656769">[% terms.Bug %] 656769</a>)</li> - <li><kbd>importxml.pl</kbd> no longer crashes when importing keywords (regressed - in 4.0). - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=657707">[% terms.Bug %] 657707</a>)</li> - <li>Data entered while reporting a new [% terms.bug %] could be lost if you had - to click the "Back" button of your web browser. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=652427">[% terms.Bug %] 652427</a>)</li> - <li>WebServices methods will return undefined [% terms.bug %] fields as undefined - instead of as an empty string. This change is consistent with how - [%+ terms.Bugzilla %] 4.2 behaves. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=657561">[% terms.Bug %] 657561</a>)</li> - <li>The XML-RPC interface now works with SOAP::Lite 0.711 and 0.712 under mod_perl. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=600810">[% terms.Bug %] 600810</a>)</li> - <li>LWP 6.00 and newer require Perl 5.8.8 and above. When installing this module - using <kbd>install-module.pl</kbd> on a Perl installation older than 5.8.8, - LWP 5.837 will be installed instead. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=655912">[% terms.Bug %] 655912</a>)</li> - <li>Viewing [% terms.abug %] report should be significantly faster when your - installation has many custom fields. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=634812">[% terms.Bug %] 634812</a>)</li> -</ul> - -<h3>4.0.1</h3> - -<ul> - <li>During installation, the CPAN module Math::Random::Secure would - sometimes fail to install properly and give an error about - <kbd>Math::Random::Secure::irand</kbd>. Now, when using - <kbd>install-module.pl</kbd> to install Math::Random::Secure, this - will no longer happen. If you are currently experiencing this b[% %]ug - and it prevented you from installing 4.0, remove Math::Random::Secure - from your <kbd>lib/</kbd> directory, like: - <p><kbd>rm -rf lib/Math/Random/Secure*</kbd></p> - <p>(<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=646578">[% terms.Bug %] 646578</a>)</p></li> - <li>The "Remember values as bookmarkable template" button on the - [%+ terms.bug %] entry page will now work even when some required fields - are empty. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=640719">[% terms.Bug %] 640719</a>)</li> - <li>Email notifications about dependencies and flags had the wrong - timestamp. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=643910">[% terms.Bug %] 643910</a> - and (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=652165">[% terms.Bug %] 652165</a>)</li> - <li>You can now select "UTC" as a valid timezone in General Preferences. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=646209">[% terms.Bug %] 646209</a>)</li> - <li>Automatic duplicate detection now works on PostgreSQL (although - it is not as high-quality as on other DB platforms). - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=634144">[% terms.Bug %] 634144</a>)</li> - <li>Autcomplete for users now works even if you are using the - "emailsuffix" option. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=641519">[% terms.Bug %] 641519</a>)</li> - <li>Javascript errors during series creation in New Charts have been - fixed. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=644285">[% terms.Bug %] 644285</a>)</li> - <li>The "Show Votes" page now works, for installations using the Voting - extension. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=652381">[% terms.Bug %] 652381</a>)</li> -</ul> - -<h2 id="v40_req">Minimum Requirements</h2> - -<p>Any requirements that are new since 3.6.3 will look like - <span class="req_new">this</span>.</p> - -<ul> - <li><a href="#v40_req_perl">Perl</a></li> - <li><a href="#v40_req_mysql">For MySQL Users</a></li> - <li><a href="#v40_req_pg">For PostgreSQL Users</a></li> - <li><a href="#v40_req_oracle">For Oracle Users</a></li> - <li><a href="#v40_req_modules">Required Perl Modules</a></li> - <li><a href="#v40_req_optional_mod">Optional Perl Modules</a></li> - <li><a href="#v40_req_apache">Optional Apache Modules</a></li> + <li><strong>Administration:</strong> There are now <kbd>INTEGER</kbd> and + <kbd>DATE</kbd> custom field types.</li> + <li><strong>Administration:</strong> Filenames used to store product data for + "Old Charts" are now based on product IDs to avoid data loss when changing + product names.</li> + <li><strong>Administration:</strong> JavaScript and CSS files are now minified + and concatenated to improve page load performance. When changes are made, + <kbd>checksetup.pl</kbd> should be run to regenerate the combined files.</li> + <li><strong>[% terms.Bugs %]:</strong> Bugzilla now keeps track of the last + time each user visited (that is, loaded the show_bug page in a web browser) + each [% terms.bug %]. This could be useful for dashboards or API clients.</li> + <li><strong>Database:</strong> Text that contained unicode + supplementary characters (outside BMP) was cut off when using MySQL as backend. + This has been fixed to prevent data loss.</li> + <li><strong>Database:</strong> SSL connections are now possible when using + MySQL as backend.</li> + <li><strong>Database:</strong> For version 8.x of PostgreSQL, <kbd>plpgsql</kbd> + was not always installed by default and <kbd>checksetup.pl</kbd> would + generate an error. This has been fixed.</li> + <li><strong>Development:</strong> Bugzilla is now HTML5 compliant. As a + consequence, Internet Explorer 6 and 7 are no longer supported.</li> + <li><strong>Email:</strong> Email generation originally was done before the + jobqueue job was inserted. This is now delayed and done by + <kbd>jobqueue.pl</kbd> right before sending the email which can improve + responsiveness when processing [% terms.bug %] changes.</li> + <li><strong>Email:</strong> When a site administrator creates a new user, an + email is sent to the user.</li> + <li><strong>Email:</strong> For dependency email notifications, the header + <kbd>X-B[%%]ugzilla-Type: dep_changed</kbd> is set.</li> + <li><strong>Email:</strong> <kbd>whine.pl</kbd> emails now use + <kbd>DEFAULT_COLUMN_LIST</kbd> (the same default columns seen in the buglist + page) instead of hard coded column list.</li> + <li><strong>Security:</strong> Support for increased values for + <kbd>PASSWORD_SALT_LENGTH</kbd> without breaking compatibility with old + hashes.</li> +</ul> + +<h4 id="feat_webservices_other">WebService Changes</h4> + +<ul> + <li><kbd>B[%%]ug.search</kbd> now allows for full search functionality + similar to what is possible using the Advanced Query UI.</li> + <li>Basic support for eTag headers has been added to all WebServices + to allow for better network performance.</li> + <li>Administrators can now change a parameter that filters all email + addresses returned in WebService calls similar to filtering that + happens in the web UI.</li> + <li>WebService calls now support use of API keys for authentication. + Usernames and passwords remain supported.</li> + <li>Invalid or expired authentication cookies and tokens now throw + errors instead of being silently ignored. <kbd>User.valid_login</kbd> + can be used to determine if they are still valid or not.</li> + <li>WebService calls that are used to create and update [% terms.bugs %] + and attachments now support setting and updating of flags.</li> + <li><kbd>B[%%]ug.update_attachment</kbd> can update an attachment's + metadata as well as its flags.</li> + <li>The <kbd>product</kbd> parameter for <kbd>B[%%]ug.possible_duplicates</kbd> + has been renamed to <kbd>products</kbd>.</li> + <li>Some compatibility fields included in returned data that were marked + to be removed in this release are now gone.</li> + <li><kbd>Group.get</kbd> has been added to get information about a group and + its members.</li> + <li><kbd>FlagType.get</kbd> has been added to get information about valid + flag types for a given product and component.</li> + <li>The deprecated <kbd>B[%%]ug.get_bugs</kbd> and <kbd>B[%%]ug.get_history</kbd> + methods are no longer supported. They have been renamed to <kbd>B[%%]ug.get</kbd> + and <kbd>B[%%]ug.history</kbd> respectively.</li> +</ul> + +<h2 id="code_changes">Code Changes Which May Affect Customizations and Extensions</h2> + +<ul> + <li>Support for CVS, Bonsai and LXR has been removed entirely when viewing + attachments. This means that the <kbd>cvsroot</kbd>, <kbd>cvsroot_get</kbd>, + <kbd>bonsai_url</kbd>, <kbd>lxr_url</kbd> and <kbd>lxr_root</kbd> parameters + are all gone, as well as <kbd>cvsbin</kbd> from the <kbd>localconfig</kbd> + file.</li> + <li>The <kbd>docs_urlbase</kbd> parameter has been removed. If documentation + has not been compiled locally, the "Help" links and other documentation links + will redirect to <a href="https://bugzilla.readthedocs.org">bugzilla.readthedocs.org</a> + automatically.</li> + <li>The <kbd>mostfreqthreshold</kbd> parameter has also been removed.</li> + <li>All extensions which define new public WebService methods must list them + in a <kbd>PUBLIC_METHODS</kbd> constant. Methods which are not listed there + will not be accessible remotely.</li> + <li><kbd>JSON::XS</kbd> is now used instead of <kbd>Data::Dumper</kbd> for + storage on configuration values in <kbd>data/params</kbd>. This should + improve performance when loading the file.</li> + <li>A new test has been added to check for reserved words in SQL schema.</li> + <li><kbd>Pod::Coverage</kbd> is now used to ensure subroutines are documented.</li> + <li>Bugzilla code now uses <kbd>use parent</kbd> instead of <kbd>use base</kbd> + in all places applicable.</li> + <li>A new hook called <kbd>cgi_headers</kbd> has been added to allow + customization of the HTTP headers returned.</kbd> + <li>A new hook called <kbd>user_check_account_creation</kbd> has been added + to add extra checks before accepting the creation of a new user account.</li> </ul> -<h3 id="v40_req_perl">Perl</h3> - -<p>Perl v5.8.1</p> -<h3 id="v40_req_mysql">For MySQL Users</h3> - - <ul> - <li>MySQL v4.1.2</li> - <li><strong>perl module:</strong> DBD::mysql v4.00</li> - </ul> - -<h3 id="v40_req_pg">For PostgreSQL Users</h3> - - <ul> - <li>PostgreSQL v8.00.0000</li> - <li><strong>perl module:</strong> DBD::Pg v1.45</li> - </ul> - -<h3 id="v40_req_oracle">For Oracle Users</h3> - - <ul> - <li>Oracle v10.02.0</li> - <li><strong>perl module:</strong> DBD::Oracle v1.19</li> - </ul> - -<h3 id="v40_req_modules">Required Perl Modules</h3> - - <table cellspacing="0" cellpadding="0" border="0" class="req_table"> - <tbody> - <tr> - <th>Module</th><th>Version</th> - </tr> - <tr> - <td>CGI</td> - <td class="req_new">3.51</td> - </tr> - <tr> - <td>Digest::SHA</td> - <td>(Any)</td> - </tr> - <tr> - <td>Date::Format</td> - <td>2.21</td> - </tr> - <tr> - <td>DateTime</td> - <td>0.28</td> - </tr> - <tr> - <td>DateTime::TimeZone</td> - <td>0.71</td> - </tr> - <tr> - <td>DBI</td> - <td>1.41</td> - </tr> - <tr> - <td>Template</td> - <td>2.22</td> - </tr> - <tr> - <td>Email::Send</td> - <td>2.00</td> - </tr> - - <tr> - <td>Email::MIME</td> - <td class="req_new">1.904</td> - </tr> - <tr> - <td>URI</td> - <td>(Any)</td> - </tr> - <tr> - <td class="req_new">List::MoreUtils</td> - <td class="req_new">0.22</td> - </tr> - </tbody> - </table> - -<h3 id="v40_req_optional_mod">Optional Perl Modules</h3> - -<p>The following perl modules, if installed, enable various - features of [% terms.Bugzilla %]:</p> - - <table cellspacing="0" cellpadding="0" border="0" class="req_table"> - <tbody> - <tr> - <th>Module</th><th>Version</th><th>Enables Feature</th> - </tr> - <tr> - <td>GD</td> - <td>1.20</td> - <td>Graphical Reports, New Charts, Old Charts</td> - </tr> - <tr> - <td>Chart::Lines</td> - <td>2.1</td> - <td>New Charts, Old Charts</td> - </tr> - <tr> - <td>Template::Plugin::GD::Image</td> - <td>(Any)</td> - <td>Graphical Reports</td> - </tr> - <tr> - <td>GD::Text</td> - <td>(Any)</td> - <td>Graphical Reports</td> - </tr> - <tr> - <td>GD::Graph</td> - <td>(Any)</td> - <td>Graphical Reports</td> - </tr> - <tr> - <td>MIME::Parser</td> - <td>5.406</td> - <td>Move [% terms.Bugs %] Between Installations</td> - </tr> - <tr> - <td>LWP::UserAgent</td> - <td>(Any)</td> - <td>Automatic Update Notifications</td> - </tr> - <tr> - <td>XML::Twig</td> - <td>(Any)</td> - <td>Move [% terms.Bugs %] Between Installations, Automatic Update - Notifications</td> - </tr> - <tr> - <td>PatchReader</td> - <td>0.9.4</td> - <td>Patch Viewer</td> - </tr> - <tr> - <td>Net::LDAP</td> - <td>(Any)</td> - <td>LDAP Authentication</td> - </tr> - <tr> - <td>Authen::SASL</td> - <td>(Any)</td> - <td>SMTP Authentication</td> - </tr> - <tr> - <td>Authen::Radius</td> - <td>(Any)</td> - <td>RADIUS Authentication</td> - </tr> - <tr> - <td>SOAP::Lite</td> - <td class="req_new">0.712</td> - <td>XML-RPC Interface</td> - </tr> - <tr> - <td>JSON::RPC</td> - <td>(Any)</td> - <td>JSON-RPC Interface</td> - </tr> - <tr> - <td class="req_new">JSON::XS</td> - <td class="req_new">2.0</td> - <td>Make JSON-RPC Faster</td> - </tr> - <tr> - <td>Test::Taint</td> - <td>(Any)</td> - <td>JSON-RPC Interface, XML-RPC Interface</td> - </tr> - <tr> - <td>HTML::Parser</td> - <td>3.40</td> - <td>More HTML in Product/Group Descriptions</td> - </tr> - <tr> - <td>HTML::Scrubber</td> - <td>(Any)</td> - <td>More HTML in Product/Group Descriptions</td> - </tr> - <tr> - <td>Email::MIME::Attachment::Stripper</td> - <td>(Any)</td> - <td>Inbound Email</td> - </tr> - <tr> - <td>Email::Reply</td> - <td>(Any)</td> - <td>Inbound Email</td> - </tr> - <tr> - <td>TheSchwartz</td> - <td>(Any)</td> - <td>Mail Queueing</td> - </tr> - <tr> - <td>Daemon::Generic</td> - <td>(Any)</td> - <td>Mail Queueing</td> - </tr> - <tr> - <td>mod_perl2</td> - <td>1.999022</td> - <td>mod_perl</td> - </tr> - <tr> - <td>Apache2::SizeLimit</td> - <td class="req_new">0.93</td> - <td>mod_perl</td> - </tr> - <tr> - <td class="req_new">Math::Random::Secure</td> - <td class="req_new">0.05</td> - <td>Improve cookie and token security</td> - </tr> - </tbody> - </table> - -<h3 id="v40_req_apache">Optional Apache Modules</h3> - -<p>If you are using Apache as your webserver, [% terms.Bugzilla %] can - now take advantage of some Apache features if you have the below Apache - modules installed and enabled. Currently, - <a href="#v40_feat_js_css_update">certain [% terms.Bugzilla %] features</a> - are enabled only if you have all of the following modules installed - and enabled:</p> - -<ul> - <li>mod_headers</li> - <li>mod_expires</li> - <li>mod_env</li> -</ul> - -<p>On most systems (but not on Windows), <kbd>checksetup.pl</kbd> is able to - tell whether or not you have these modules installed, and it will tell - you.</p> - -<h2 id="v40_feat">New Features and Improvements</h2> - -<ul> - <li><a href="#v40_feat_dup">Automatic Duplicate Detection When Filing - [%+ terms.Bugs %]</a></li> - <li><a href="#v40_feat_search_ui">New Advanced Search UI</a></li> - <li><a href="#v40_feat_attach_ui">New Attachment Details UI</a></li> - <li><a href="#v40_feat_autocomplete">Autocomplete for Users and - Keywords</a></li> - <li><a href="#v40_feat_ui">General Usability Improvements</a></li> - <li><a href="#v40_feat_workflow">New Default Status Workflow</a></li> - <li><a href="#v40_feat_lists">"Last Search" Now Remembers Multiple - Searches</a></li> - <li><a href="#v40_feat_jsonp">Cross-Domain WebServices with JSONP</a></li> - <li><a href="#v40_feat_ws">Major WebService Enhancements</a></li> - <li><a href="#v40_feat_mandatory">Mandatory Custom Fields</a></li> - <li><a href="#v40_feat_vot_ext">Voting Is Now An Extension</a></li> - <li><a href="#v40_feat_js_css_update">Users Get New CSS and Javascript - Automatically</a></li> - <li><a href="#v40_feat_hooks">Many New Hooks</a></li> - <li><a href="#v40_feat_apache_config">New Apache Configuration</a></li> - <li><a href="#v40_feat_other">Other Enhancements and Changes</a></li> -</ul> - -<h3 id="v40_feat_dup">Automatic Duplicate Detection When Filing - [%+ terms.Bugs %]</h3> - -<p>When filing [% terms.abug %], as soon as you start typing in the summary - field, [% terms.Bugzilla %] will suggest possible duplicates of the - [%+ terms.bug %] you are filing.</p> - -<p>In order for this feature to work, all pre-requisites for JSON-RPC - support must be installed on your [% terms.Bugzilla %]. It will be - much faster on installations that run under mod_perl than it will - be on other installations.</p> - -<h3 id="v40_feat_search_ui">New Advanced Search UI</h3> - -<p>Thanks to the UI work of <a href="http://guy-pyrzak.blogspot.com/">Guy - Pyrzak</a>, the Advanced Search UI has been completely redesigned. - It is now much simpler, and far more approachable for new users, while - still retaining all of the features that power users are used to.</p> - -<h3 id="v40_feat_attach_ui">New Attachment Details UI</h3> - -<p>The UI used for editing attachment details has been completely - redesigned, allowing for a normally-size comment box to be used - when commenting on attachments, and allowing nearly the entire screen - width to be used when doing code reviews or editing an attachment as - a comment.</p> - -<p>Thanks to <a href="http://guy-pyrzak.blogspot.com/">Guy Pyrzak</a> for - his excellent work on this UI redesign.</p> - -<h3 id="v40_feat_autocomplete">Autocomplete for Users and Keywords</h3> - -<p>Once you type at least three characters in any field that can contain a user - (including the [% field_descs.cc FILTER html %], - [%+ field_descs.qa_contact FILTER html %], or - [%+ field_descs.assigned_to FILTER html %] fields), a list will appear - containing all of the users whose real names or usernames match what you are - typing. Your [% terms.Bugzilla %] must have all of the optional Perl - modules required for JSON-RPC support installed, though, in order for - this feature to work. Also, this feature will be <strong>much</strong> - faster on installations that run under mod_perl than it will be on - other installations.</p> - -<p>There is also a similar autocomplete for the Keywords field. The - Keywords autocomplete does not require JSON-RPC.</p> - -<h3 id="v40_feat_ui">General Usability Improvements</h3> - -<p>In addition to the enhancements listed above, there have been - <strong>many</strong> improvements made across the [% terms.Bugzilla %] - user interface. For a list of specific enhancements that were significant, - see the <a href="#v40_feat_other">Other Enhancements and Changes</a> - section.</p> - -<h3 id="v40_feat_workflow">New Default Status Workflow</h3> - -<p>For new installations of [% terms.Bugzilla %], the default set of - statuses will now be:</p> - -<ul> - <li>UNCONFIRMED</li> - <li>CONFIRMED</li> - <li>IN_PROGRESS</li> - <li>RESOLVED</li> - <li>VERIFIED</li> -</ul> - -<p>And the UNCONFIRMED status will be enabled by default in all products.</p> - -<p>On upgrade, existing installations will not be affected--you will retain - your existing status workflow. However, we strongly recommend that you - update your existing workflow to the new one, using a special tool - we've included, <kbd>contrib/convert-workflow.pl</kbd>, which you - can run after you use <kbd>checksetup.pl</kbd> to upgrade. The - <kbd>whineatnews.pl</kbd> and <kbd>bugzilla-submit</kbd> scripts - will probably not work properly if you continue to use the old workflow - (though most other parts of [% terms.Bugzilla %] will still function - normally).</p> - -<p>For more information about the workflow and our rationale for changing - it, see the - <a href="http://bugzillaupdate.wordpress.com/2010/07/06/bugzilla-4-0-has-a-new-default-status-workflow/">blog - post about it</a> and the - <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=486292">[% terms.bug %] - where the change was made</a>.</p> - -<h3 id="v40_feat_lists">"Last Search" Now Remembers Multiple Searches</h3> - -<p>At the top of every [% terms.bug %] in [% terms.Bugzilla %], there are - links that look like: "First", "Last", "Prev", "Next", and - "Show last search results". In earlier versions of [% terms.Bugzilla %], - if you did two separate searches in separate windows, these links would - only work for the <em>last</em> search you did. Now, [% terms.Bugzilla %] - will "remember" which search result you came from and give you the right - "last search results" or "next [% terms.bug %]" from <em>that</em> list, - instead of always using your most recent search.</p> - -<p>There are still some situations where [% terms.Bugzilla %] will have to - "guess" which search you are trying to navigate through, but it does its - best to get it right.</p> - -<h3 id="v40_feat_jsonp">Cross-Domain WebServices with JSONP</h3> - -<p>[% terms.Bugzilla %] now supports making WebService calls from - another domain, inside of a web browser, thanks to support for - <a href="http://bob.pythonmac.org/archives/2005/12/05/remote-json-jsonp/">JSONP</a>. - This will allow for web "mash-ups" to use [% terms.Bugzilla %] data. - When using JSONP, you may only call functions that <em>get</em> data, - you may not call functions that <em>change</em> data.</p> - -<p>For more details, see the - <a href="[% docs_urlbase FILTER html %]api/Bugzilla/WebService/Server/JSONRPC.html#JSONP">JSONP - section</a> of the JSON-RPC WebService documentation.</p> - -<h3 id="v40_feat_ws">Major WebService Enhancements</h3> - -<p>The WebService has been expanded considerably. The WebService should now be - able to do everything with [% terms.bugs %] that you can do via the - web interface, including updating [% terms.bugs %], adding attachments, - and getting attachment data. For specifics, see the - <a href="#v40_feat_ws_changes">WebService Changes</a> section of these - release notes.</p> - -<h3 id="v40_feat_mandatory">Mandatory Custom Fields</h3> - -<p>You can now specify that certain custom fields are "mandatory", - meaning that they must have a value when [% terms.abug %] is filed, - and they can never be empty after that.</p> - -<h3 id="v40_feat_vot_ext">Voting Is Now An Extension</h3> - -<p>All of the code for voting in [% terms.Bugzilla %] has been moved - into an extension, called "Voting", in the <kbd>extensions/Voting/</kbd> - directory. To enable it, you must remove the <kbd>disabled</kbd> file - from that directory, and run <kbd>checksetup.pl</kbd>.</p> - -<p>In a future version of [% terms.Bugzilla %], the Voting extension will - be moved outside of the [% terms.Bugzilla %] core code, so we are looking - for somebody who has an interest in the Voting system and would like to - maintain it as a separate extension. There are many enhancement requests - that have been made against the Voting system, and the best way for those - to get addressed is for somebody to step up and offer to maintain the - system outside of [% terms.Bugzilla %]'s core code.</p> - -<h3 id="v40_feat_js_css_update">Users Get New CSS and Javascript - Automatically</h3> - -<p>In past versions of [% terms.Bugzilla %], if you changed - [%+ terms.Bugzilla %]'s CSS or Javascript files, then every user of - [%+ terms.Bugzilla %] would have to clear their cache in order to get - the updated files. Now, if you are using Apache as your webserver and - you have the <a href="#v40_req_apache">optional Apache modules</a> - installed and enabled, users will automatically get every new version of - [%+ terms.Bugzilla %]'s Javascript and CSS without having to clear - their caches.</p> - -<p>This feature also gives a slight performance speedup to - [%+ terms.Bugzilla %] in some cases, and so we recommend that all - administrators install and enable the optional Apache modules if possible.</p> - -<h3 id="v40_feat_hooks">Many New Hooks</h3> - -<p>Many new code hooks have been added for use by Extensions, - in [% terms.Bugzilla %] 4.0. Now Extensions can access and modify - nearly every part of [% terms.Bugzilla %].</p> - -<h3 id="v40_feat_apache_config">New Apache Configuration</h3> - -<p>If you run [% terms.Bugzilla %] under Apache (as most people do), - you most likely require a <strong>new Apache configuration</strong> - for this version of [% terms.Bugzilla %]. See the - <a href="#v40_upgrading">Notes On Upgrading From a Previous Version</a> - section for details.</p> - -<h3 id="v40_feat_other">Other Enhancements and Changes</h3> - -<h4>Enhancements for Users</h4> - -<ul> - <li>Now, everywhere in [% terms.Bugzilla %] where you can enter a date, - there is a Calendar widget where you can select the date on a - calendar.</li> - <li>The big icons on the front page have been replaced with much nicer - icons, thanks to Jon Pink of <a href="http://www.jpink.co.uk/">J. Pink Design</a>!</li> - <li><strong>[% terms.Bugs %]:</strong> When filing [% terms.bugs %], - you will now be warned if you forgot to fill in any mandatory fields, - <em>before</em> the page is submitted.</li> - <li><strong>[% terms.Bugs %]:</strong> When filing [% terms.abug %], - you can hover your mouse over any of the field labels on the page - to get a brief description of what that field is and what its purpose - is.</li> - <li><strong>[% terms.Bugs %]:</strong> When adding Hours Worked to [% terms.abug %], - you are no longer required to comment.</li> - <li><strong>[% terms.Bugs %]:</strong> There is now a user preference - for whether the comment box appears above or below the existing - comments.</li> - <li><strong>[% terms.Bugs %]:</strong> [% terms.Bugzilla %] will now - send an email for every comment that you mark or un-mark as being - private. (Previous versions of [% terms.Bugzilla %] did not send emails - to users about this change.) The state of comments being made private - is also now stored in [% terms.abug %]'s history.</li> - <li><strong>[% terms.Bugs %]:</strong> The box to "Add [% terms.Bug %] URLs" - in the See Also field is now hidden behind an "(add)" link that you - have to click to see the box.</li> - - <li><strong>Searches:</strong> You can now properly search for field values - that have commas in their name, when using the Advanced Search form.</li> - <li><strong>Searches:</strong> The "URL" field can now be shown as a column - in search results.</li> - <li><strong>Searches:</strong> When viewing a search result, you can now - click on the Summary of the [% terms.bug %] in order to go to the - [%+ terms.bug %]-view page, in addition to being able to click on the - [%+ terms.bug %] ID.</li> - <li><strong>Searches:</strong> When doing a search using the "quicksearch" - box in the header or footer, the box will still contain what you searched - for when viewing the search results page.</li> - <li><strong>Searches:</strong> Multi-select custom fields can now be - shown as columns in the search results.</li> - <li><strong>Searches:</strong> When using the Boolean Charts (now called - "Custom Search"), if you specify both a criterion for an attachment - and a criteron for a flag, then only [% terms.bugs %] that have - attachments with that flag will be found.</li> - <li><strong>Searches:</strong> If you hover your mouse over the field labels - on the Advanced Search page, you will get a description of what that - field is.</li> - <li><strong>Searches:</strong> When searching via a saved search, if you - accidentally click on "Forget Search", there is a link to undo it.</li> - <li><strong>Searches:</strong> When using the Boolean Charts (now called - "Custom Search"), you can search for values "greater than or equal to" - or "less than or equal to" some value.</li> - - <li><strong>Flags:</strong> If you hover your mouse over the name of - a flag setter when viewing [% terms.abug %], you can see that - flag setter's full name and complete username.</li> - <li><strong>Flags:</strong> When setting a flag on [% terms.abug %], - the box for entering a requestee does not appear until you set the flag - to "?", now.</li> - <li><strong>Flags:</strong> On the "My Requests" page, [% terms.bugs %] - that are restricted to certain groups now properly have the "padlock" - icon shown next to them to indicate that they may contain confidential - information.</li> - - <li>When using the Reports interface, you can now choose many more fields - as the X, Y, or Z axis of a report, including custom fields.</li> - <li>[% terms.Bugzilla %] now prevents - Internet Explorer 8 and later from attempting to render - <kbd>text/plain</kbd> attachments as HTML.</li> - <li>If you receive a Whine mail that is empty, there will now be a brief - message explaining that your search found no results.</li> - <li>The <a href="page.cgi?id=fields.html">Field Help Page</a> now - contains a description of every single field that can be on - [%+ terms.abug %] in [% terms.Bugzilla %].</li> -</ul> - -<h4>Enhancements for Administrators and Developers</h4> - -<ul> - <li>The system for moving [% terms.bugs %] between installations has been - moved into an extension called <kbd>OldBugMove</kbd>. This system was used - by very few [% terms.Bugzilla %] installations--if you aren't certain - whether or not you are using it, you're not using it. To enable the system, - you have to remove the file <kbd>extensions/OldBugMove/disabled</kbd> - and then run <kbd>checksetup.pl</kbd>. In a future version of [% terms.Bugzilla %], - this extension may be moved outside of the core [% terms.Bugzilla %] code, - so if you are interested in maintaining it, please let us know.</li> - <li><strong>Custom Fields: </strong> "[% terms.Bug %] ID" custom fields can - now represent relationships between [% terms.bugs %], similarly to how the - [%+ field_descs.blocked FILTER html %] and - [%+ field_descs.dependson FILTER html %] fields work now.</li> - <li><strong>Custom Fields:</strong> You can now restrict the visibility - of custom fields and their values to a specific Component or - Classification.</li> - <li>The "keyword cache" has been removed. When you edit keywords, you no - longer will have to "rebuild the keyword cache" after you are done.</li> - <li>Running <kbd>./collectstats.pl --regenerate</kbd> will now take - minutes or hours, instead of days.</li> - <li>When using <kbd>email_in.pl</kbd>, there are two new switches, - <kbd>--default</kbd> and <kbd>--override</kbd>, which allow you to - specify certain default values or override specified values for - <kbd>@field</kbd> values sent in emails. (This also allows you to specify - defaults for everything so that people do not have to specify any field - values when filing [% terms.abug %] via email.)</li> - <li><strong>Installation:</strong> If you are using a localized version of - [%+ terms.Bugzilla %] and your terminal does not understand Unicode, - <kbd>checksetup.pl</kbd> will now attempt to output its messages in your - terminal's character set.</li> - <li><strong>Installation:</strong> [% terms.Bugzilla %] no longer needs empty - "placeholder" CSS in the <kbd>skins/custom</kbd> directory and other - directories. When you update, <kbd>checksetup.pl</kbd> will remove these. - This also significantly reduces the number of HTTP requests required to - load a page for the first time in [% terms.Bugzilla %].</li> - <li><strong>Installation:</strong> For Windows users, [% terms.Bugzilla %] - now supports Strawberry Perl fully.</li> - <li><strong>Installation:</strong> Now, whenever <kbd>checksetup.pl</kbd> - throws an error, it will be printed in the color red, to make it - obvious that something is wrong.</li> - <li><strong>Installation:</strong> Some actions of <kbd>checksetup.pl</kbd> were - silent, in the past. Now, <kbd>checksetup.pl</kbd> will print a message for - almost anything it does.</li> - <li><strong>Installation:</strong> The process of adding foreign keys - to a table is now much faster. This will particularly improve the speed - of upgrading from [% terms.Bugzilla %] 3.4 or earlier.</li> - <li>If you are using <kbd>jobqueue.pl</kbd> and email gets heavily delayed - for some reason, those emails will now have a Date header reflecting the - time they were <em>supposed</em> to be sent, instead of when they actually - <em>were</em> sent.</li> - <li><kbd>./jobqueue.pl install</kbd> now works on SuSE Linux.</li> - <li>[% terms.Bugzilla %] now runs much better in Apache's suexec mode - than it used to. As part of this, <kbd>checksetup.pl</kbd> sets - much stricter permissions on all the files in [% terms.Bugzilla %] - than it used to. In particular, any files that [% terms.Bugzilla %] - does not know about will not be readable by the webserver.</li> - <li>The <kbd>sendmailnow</kbd> parameter has been removed, as it was - not necessary for any modern version of Sendmail or other Mail Transfer - Agent.</li> - <li>When editing a user via the Users administration panel, you can now - see if they are a Default CC on any component.</li> - <li>For new installations of [% terms.Bugzilla %], all users will be - able to see and use the Whining system by default.</li> - <li>When you are using SSL with [% terms.Bugzilla %], you can now - turn on the <kbd>strict_transport_security</kbd> parameter to - send the - <a href="https://developer.mozilla.org/en/Security/HTTP_Strict_Transport_Security">Strict-Transport-Security</a> - header with every HTTPS connection, for additional security.</li> - <li>New code hooks (see their documentation in - <a href="[% docs_urlbase FILTER html %]api/Bugzilla/Hook.html">Bugzilla::Hook</a>): - bug_check_can_change_field, search_operator_field_override, - bugmail_relationships, object_columns, object_update_columns, - and object_validators. The colchange_columns hook has been removed, - as it is no longer necessary (buglist_columns will be used for data - about which columns can be on the [% terms.bug %] list).</li> - <li>When [% terms.Bugzilla %] throws certain types of errors, it will - now include a "traceback" of where exactly the error occurred in the - code, to help administrators and developers debug problems.</li> - <li>There is now a test, <kbd>xt/search.t</kbd>, that assures that all - of the functionality of <kbd>Bugzilla::Search</kbd> is working properly. - If you customize the search functionality of [% terms.Bugzilla %], - you may wish to run this test to assure that your changes are correct. - You can see more information about running this test by doing - <kbd>perldoc xt/search.t</kbd> at the command line.</li> - <li>[% terms.Bugzilla %] now sends the - <a href="https://developer.mozilla.org/en/the_x-frame-options_response_header"><code>X-Frame-Options: SAMEORIGIN</code></a> header - with every page request in order to prevent "clickjacking" attacks. Note - that this prevents other domains from displaying [% terms.Bugzilla %] - in an HTML frame.</li> -</ul> - -<h4 id="v40_feat_ws_changes">WebService Changes</h4> - -<ul> - <li>You can now call some JSON-RPC methods using HTTP GET, in addition to - using HTTP POST. See the - <a href="[% docs_urlbase FILTER html %]api/Bugzilla/WebService/Server/JSONRPC.html#Connecting_via_GET">JSON-RPC - documentation</a> for details.</li> - <li>You can now update existing [% terms.bugs %] using the - <a href="[% docs_urlbase FILTER html %]api/Bugzilla/WebService/Bug.html#update">B[% %]ug.update</a> - function.</li> - <li>You can now add attachments to [% terms.bugs %] using the - <a href="[% docs_urlbase FILTER html %]api/Bugzilla/WebService/Bug.html#add_attachment">B[% %]ug.add_attachment</a> - function.</li> - <li>The <kbd>B[% %]ug.get</kbd> function now returns all of [% terms.abug %]'s - information other than comments and attachments.</li> - <li><kbd>B[% %]ug.get</kbd> no longer returns the <kbd>internals</kbd> hash.</li> - <li>The <kbd>B[% %]ug.attachments</kbd> function now also returns attachment - data.</li> - <li>The following functions now support the <kbd>include_fields</kbd> - and <kbd>exclude_fields</kbd> arguments: <kbd>B[% %]ug.get</kbd>, - <kbd>B[% %]ug.search</kbd>, and <kbd>B[% %]ug.attachments</kbd>. Also, - server-side performance of the WebService is actually increased when - using these arguments, now, as [% terms.Bugzilla %] will no longer - get data from the database for fields you haven't asked for.</li> - <li>You can now mark the initial description of [% terms.abug %] as - private when filing [% terms.abug %] via the <kbd>B[% %]ug.create</kbd> - function.</li> - <li>You can now specify groups to put [% terms.abug %] in, in the - <a href="[% docs_urlbase FILTER html %]api/Bugzilla/WebService/Bug.html#create">B[% %]ug.create</a> - function. (This also means that you can specify groups when filing - [%+ terms.abug %] via email_in.pl.)</li> - <li>The <kbd>User.get</kbd> function now accepts <kbd>groups</kbd> - and <kbd>group_ids</kbd> arguments, to limit the returned values to - only users in the specified groups.</li> - <li>There is a new, undocumented B[% %]ug.possible_duplicates - function that helps implement the automatic duplicate detection - system. Because this function is not documented, its API may change - between releases of [% terms.Bugzilla %].</li> - <li>You can no longer search using the <kbd>votes</kbd> argument in - <kbd>B[% %]ug.search</kbd>.</li> - <li><kbd>B[% %]ug.attachments</kbd> now returns the attachment's description - using the name "summary" instead of the name "description", to be - consistent with the fact that [% terms.bug %] summaries are called - "summary". The value is still <em>also</em> returned as "description", - for backwards compatibility, but this backwards compatibility will go - away in [% terms.Bugzilla %] 5.0.</li> - <li>In the return values of various <kbd>B[% %]ug</kbd> functions, the author - of comments, [% terms.bugs %], and attachments is now called "creator", - instead of sometimes being called "reporter", "author", or "attacher". - The old names are retained for backwards-compatibility, and will stay - around until [% terms.Bugzilla %] 5.0.</li> -</ul> - -<h2 id="v40_issues">Outstanding Issues</h2> - -<ul> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=423439"> - [%- terms.Bug %] 423439</a>: Tabs in comments will be converted - to four spaces, due to a b<!-- -->ug in Perl as of Perl 5.8.8.</li> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=89822"> - [%- terms.Bug %] 89822</a>: When changing multiple [% terms.bugs %] at - the same time, there is no "mid-air collision" protection.</li> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=276230"> - [%- terms.Bug %] 276230</a>: The support for restricting access to - particular Categories of New Charts is not complete. You should treat - the 'chartgroup' Param as the only access mechanism available.<br> - However, charts migrated from Old Charts will be restricted to - the groups that are marked MANDATORY for the corresponding Product. - There is currently no way to change this restriction, and the - groupings will not be updated if the group configuration - for the Product changes.</li> -</ul> - -<h2 id="v40_upgrading">Notes On Upgrading From a Previous Version</h2> - -<h3>IMPORTANT: Apache Configuration Change</h3> - -<h4>mod_cgi</h4> - -<p>If you run [% terms.Bugzilla %] under mod_cgi (this is the most common - configuration, involving a <Directory> block in your Apache config - file), you will need to update the configuration of Apache for - [%+ terms.Bugzilla %]. In particular, this line in the [% terms.Bugzilla %] - <kbd><Directory></kbd> block:</p> - -<blockquote><code>AllowOverride Limit</code></blockquote> - -<p>needs to become:</p> - -<blockquote><code>AllowOverride Limit FileInfo Indexes</code></blockquote> - -<p>For full details on how to configure Apache for [% terms.Bugzilla %], - see the - <a href="[% docs_urlbase FILTER html %]configuration.html#http-apache">Configuration</a> - section of the [% terms.Bugzilla %] Guide.</p> - -<h4>mod_perl</h4> - -<p>If your [% terms.Bugzilla %] runs under mod_perl, the required Apache - configuration is now simpler. The line that used to look like:</p> - -<blockquote><code>PerlSwitches -w -T -I/var/www/html/bugzilla - -I/var/www/html/bugzilla/lib</code></blockquote> - -<p>Now should be only:</p> - -<blockquote><code>PerlSwitches -w -T</code></blockquote> - -<p>The <code>PerlConfigRequire</code> line should stay the same, however.</p> - -<h3>New .htaccess file</h3> - -<p>In previous versions of [% terms.Bugzilla %], there was a file - in [% terms.Bugzilla %]'s root directory called ".htaccess" that was - generated by <kbd>checksetup.pl</kbd>. This file is now shipped with - [%+ terms.Bugzilla %] instead of being generated during installation.</p> - -<p>If you update via CVS or bzr, you will get a message that your existing - .htaccess file conflicts with the new one. You must - <strong>remove your existing .htaccess file</strong> and use the new one - instead. Continuing to use your old .htaccess file will cause certain new - features of [% terms.Bugzilla %] to not work properly, and may also lead - to security issues for your system in the future.</p> - -<h2 id="v40_code_changes">Code Changes Which May Affect Customizations and - Extensions</h2> - -<ul> - <li>In Extensions, if you want to serve files to the user via the web, - they must now be in a <kbd>web/</kbd> subdirectory of your Extension. - (For example, <kbd>extensions/Foo/web/</kbd>). <kbd>checksetup.pl</kbd> - sets permissions on extensions much more strictly now, and files in - other locations (such as your base <kbd>extensions/Foo/</kbd> directory) - will no longer be available to [% terms.Bugzilla %] users via the web - under certain configurations.</li> - <li>Previous versions of [% terms.Bugzilla %] used to allow putting a - single file into the "skins" directory and having that be an entire - skin. That is no longer allowed, and on upgrade, <kbd>checksetup.pl</kbd> - will convert any such skins into a directory with a single - <kbd>global.css</kbd> file in them.</li> - <li>When updating [% terms.bugs %], you should now use - <code>$bug->set_all</code> instead of using the individual - <kbd>set_</kbd> methods. In particular, <kbd>set_all</kbd> is now the - <em>only</em> way to set the product of [% terms.abug %]. See - <kbd>process_bug.cgi</kbd> for an example of how <kbd>set_all</kbd> - should be used.</li> - <li>You should not insert <script> tags and <link> CSS tags - into HTML anymore, in Extensions or in your customizations. Instead, - you should push new values into the <kbd>style_urls</kbd> or - <kbd>javascript_urls</kbd> parameters. If you have to insert manual - tags for some reason, be sure to call "FILTER mtime" on the URL. (Search - for other uses of "FILTER mtime" in the templates to see how it is - used.)</li> - <li>When calling <kbd>Bugzilla::BugMail::Send</kbd>, the "changer" - argument must now be a <kbd>Bugzilla::User</kbd> object, not just - a login name. The "owner" and "qacontact" arguments are still - just login names.</li> - <li>When creating a new subclass of Bugzilla::Object, you should no - longer use <kbd>UPDATE_VALIDATORS</kbd>. Also, in most cases you will - no longer need to override <kbd>run_create_validators</kbd>. Instead, - there is a new constant called - <a href="[% docs_urlbase FILTER html %]api/Bugzilla/Object.html#VALIDATOR_DEPENDENCIES">VALIDATOR_DEPENDENCIES</a>, - that specifies that certain fields have to be validated before other fields. - Then, all validators receive each already-validated value in a hash - as their fourth argument, so each validator can know the other values - that were passed in, while an object is being created. For an example of - how to use <kbd>VALIDATOR_DEPENDENCIES</kbd>, see - <kbd>Bugzilla/Field.pm</kbd>.</li> - <li>In previous versions of [% terms.Bugzilla %], you had to call - <code>Bugzilla->template_inner("")</code> after any time - that you called <kbd>template_inner</kbd> for a specific language. - It is no longer necessary to do this second <kbd>template_inner</kbd> - call.</li> - <li><kbd>post_bug.cgi</kbd> and <kbd>Bugzilla::Bug->create</kbd> now take - the <em>names</em> of groups instead of group ids.</li> - <li>Bugzilla::Bugmail now uses Bugzilla::Bug objects internally instead of - a lot of direct SQL.</li> - <li>For sending changes about [% terms.bugs %], there is now a method - called <kbd>send_changes</kbd> that you can call on Bugzilla::Bug - objects. For an example of its use, see <kbd>process_bug.cgi</kbd>.</li> - <li>The <kbd>Bugzilla::Search</kbd> class has been refactored, and should - now be easier to customize.</li> - <li>The <kbd>Bugzilla::Util::lsearch</kbd> function is gone. Use - <kbd>firstidx</kbd> from <kbd>List::MoreUtils</kbd>, instead.</li> - <li>[% terms.Bugzilla %] now includes YUI 2.8.2.</li> - <li><kbd>long_list.cgi</kbd>, <kbd>showattachment.cgi</kbd> and - <kbd>xml.cgi</kbd> are deprecated scripts which are no longer actively - used since [% terms.Bugzilla %] 2.19. These scripts will be removed in - [%+ terms.Bugzilla %] 4.2.</li> -</ul> - -<h2 id="v40_previous">Release Notes For Previous Versions</h2> - -<p><a href="page.cgi?id=release-notes3.html">Release Notes for - [%+ terms.Bugzilla %] 3.x and Earlier</a></p> - [% INCLUDE global/footer.html.tmpl %] [% BLOCK db_req %] [% SET m = DB_MODULE.$db %] - <h3 id="v44_req_[% db FILTER html %]">For [% m.name FILTER html %] Users</h3> + <h3 id="req_[% db FILTER html %]">For [% m.name FILTER html %] Users</h3> <ul> <li>[% m.name FILTER html %] @@ -2374,15 +350,15 @@ [% '</span>' IF db_new %] </li> <li><strong>perl module:</strong> - [%+ m.dbd.module FILTER html %] - [% '<span class="req_new">' IF dbd_new %]v[% m.dbd.version FILTER html %] + [%+ m.dbd.module FILTER html %] + [%+ '<span class="req_new">' IF dbd_new %]v[% m.dbd.version FILTER html %] [% '</span>' IF dbd_new %]</li> </ul> [% END %] [% BLOCK req_table %] - <table class="req_table" border="0" cellspacing="0" cellpadding="0"> + <table class="req_table"> <tr> <th>Module</th> <th>Version</th> [% IF include_feature %] @@ -2392,8 +368,8 @@ [% FOREACH req = reqs %] <tr> <td [% ' class="req_new"' IF new.contains(req.package) %]> - [%- req.module FILTER html %]</td> - <td [% ' class="req_new"' IF updated.contains(req.package) + [%- req.module FILTER html %]</td> + <td [% ' class="req_new"' IF updated.contains(req.package) OR new.contains(req.package) %]> [%- IF req.version == 0 %] (Any) @@ -2401,7 +377,7 @@ [%- req.version FILTER html %] [% END %] </td> - [% IF include_feature %] + [% IF include_feature %] <td>[% req.feature.join(', ') FILTER html %]</td> [% END %] </tr> diff --git a/template/en/default/pages/release-notes3.html.tmpl b/template/en/default/pages/release-notes3.html.tmpl deleted file mode 100644 index 8d6ada56a..000000000 --- a/template/en/default/pages/release-notes3.html.tmpl +++ /dev/null @@ -1,3474 +0,0 @@ -[%# 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. - #%] - -[% SET title = "$terms.Bugzilla 3.6 Release Notes" %] -[% INCLUDE global/header.html.tmpl - title = title - style_urls = ['skins/standard/page.css'] -%] - -<h3>Release Notes For Newer Versions</h3> - -<p>Release notes for versions of [% terms.Bugzilla %] of the 4.x series are - available <a href="page.cgi?id=release-notes.html">here</a>.</p> - -<h1>[% title FILTER html %]</h1> - -<ul class="bz_toc"> - <li><a href="#v36_introduction">Introduction</a></li> - <li><a href="#v36_point">Updates in this 3.6.x Release</a></li> - <li><a href="#v36_req">Minimum Requirements</a></li> - <li><a href="#v36_feat">New Features and Improvements</a></li> - <li><a href="#v36_issues">Outstanding Issues</a></li> - <li><a href="#v36_upgrading">Notes On Upgrading From a Previous Version</a></li> - <li><a href="#v36_code_changes">Code Changes Which May Affect - Customizations</a></li> - <li><a href="#v36_previous">Release Notes for Previous Versions</a></li> -</ul> - -<h2 id="v36_introduction">Introduction</h2> - -<p>Welcome to [% terms.Bugzilla %] 3.6! The focus of the 3.6 release is - on improving usability and "polishing up" all our features (by adding - some pieces that were "missing" or always wanted), although we - also have a few great new features for you, as well!</p> - -<p>If you're upgrading, make sure to read <a href="#v36_upgrading">Notes - On Upgrading From a Previous Version</a>. If you are upgrading from a release - before 3.4, make sure to read the release notes for all the - <a href="#v36_previous">previous versions</a> in between your version - and this one, <strong>particularly the Upgrading section of each - version's release notes</strong>.</p> - -<p>We would like to thank <a href="http://www.canonical.com/">Canonical - Ltd.</a>, <a href="http://www.itasoftware.com/">ITA Software</a>, - the <a href="http://www.ibm.com/linux/ltc/">IBM Linux Technology Center</a>, - <a href="http://www.redhat.com/">Red Hat</a>, and - <a href="http://www.novell.com/">Novell</a> for funding the development - of various features and improvements in this release of - [%+ terms.Bugzilla %].</p> - -<h2 id="v36_point">Updates in this 3.6.x Release</h2> - -<h3>3.6.2</h3> - -<p>This release fixes various security issues. See the - <a href="http://www.bugzilla.org/security/3.2.7/">Security Advisory</a> - for details.</p> - -<p>In addition, the following important fixes/changes have been made in - this release:</p> - -<ul> - <li>[% terms.Bugzilla %] installations running on older versions of IIS - will no longer experience the "Undef to trick_taint" errors that would - sometimes occur. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=521416">[% terms.Bug %] 521416</a>) - </li> - <li>Email notifications were missing the dates that comments were made. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=578003">[% terms.Bug %] 578003</a>) - </li> - <li>Putting a phrase in quotes in the Quicksearch box now works properly, - again. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=578494">[% terms.Bug %] 578494</a> - and <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=553884">[% terms.Bug %] 553884</a>) - </li> - <li>Quicksearch was usually (incorrectly) being limited to 200 results. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=581622">[% terms.Bug %] 581622</a>) - </li> - <li>On Windows, <kbd>install-module.pl</kbd> can now properly install - DateTime and certain other Perl modules that didn't install properly - before. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=576105">[% terms.Bug %] 576105</a>) - </li> - <li>Searching "keywords" for "contains none of the words" or "does not - match regular expression" now works properly. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=562014">[% terms.Bug %] 562014</a>) - </li> - <li>Doing <kbd>collectstats.pl --regenerate</kbd> now works on installations - using PostgreSQL. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=577058">[% terms.Bug %] 577058</a>) - </li> - <li>The "Field Values" administrative control panel was sometimes denying - admins the ability to delete field values when there was no reason - to deny the deletion. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=577054">[% terms.Bug %] 577054</a>) - </li> - <li>Eliminate the "uninitialized value" warnings that would happen when - editing a product's components. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=576911">[% terms.Bug %] 576911</a>) - </li> - <li>The updating of bugs_fulltext that happens during - <kbd>checksetup.pl</kbd> for upgrades to 3.6 should now be MUCH faster. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=577754">[% terms.Bug %] 577754</a>) - </li> - <li><kbd>email_in.pl</kbd> was not allowing the setting of time-tracking - fields via inbound emails. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=583622">[% terms.Bug %] 583622</a>) - </li> -</ul> - -<h3>3.6.1</h3> - -<p>This release fixes two security issues. See the - <a href="http://www.bugzilla.org/security/3.2.6/">Security Advisory</a> - for details.</p> - -<p>In addition, the following important fixes/changes have been made in - this release:</p> - -<ul> - <li>Using the "Change Columns" page would sometimes result in a - plain-text page instead of HTML. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=376044">[% terms.Bug %] 376044</a>) - </li> - <li>Extensions that have only templates and no code are now working. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=562551">[% terms.Bug %] 562551</a>) - </li> - <li><kbd>install-module.pl</kbd> has been fixed so that it installs - modules properly on both new and old versions of Perl. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=560318">[% terms.Bug %] 560318</a> - and <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=560330">[% terms.Bug %] 560330</a>) - </li> - <li>It is now possible to upgrade from 3.4 to 3.6 when using Oracle. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=561379">[% terms.Bug %] 561379</a>) - </li> - <li>Editing a field value's name (using the Field Values admin control - panel) wasn't working if the value was set as the default for that - field. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=561296">[% terms.Bug %] 561296</a>) - </li> - <li>If you had the <kbd>noresolveonopenblockers</kbd> parameter set, - [%+ terms.bugs %] couldn't be edited at all if they were marked FIXED - and had any open blockers. (The parameter is only supposed to prevent - <em>changing</em> [% terms.bugs %] to FIXED, not modifying already-FIXED - [%+ terms.bugs %].) - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=565314">[% terms.Bug %] 565314</a>) - </li> - <li>Some minor issues with Perl 5.12 were fixed (mostly warnings that Perl - 5.12 was throwing). [% terms.Bugzilla %] now supports Perl 5.12.</li> -</ul> - -<h2 id="v36_req">Minimum Requirements</h2> - -<p>Any requirements that are new since 3.4.5 will look like - <span class="req_new">this</span>.</p> - -<ul> - <li><a href="#v36_req_perl">Perl</a></li> - <li><a href="#v36_req_mysql">For MySQL Users</a></li> - <li><a href="#v36_req_pg">For PostgreSQL Users</a></li> - <li><a href="#v36_req_oracle">For Oracle Users</a></li> - <li><a href="#v36_req_modules">Required Perl Modules</a></li> - <li><a href="#v36_req_optional_mod">Optional Perl Modules</a></li> -</ul> - -<h3 id="v36_req_perl">Perl</h3> - -<p>Perl v5.8.1</p> - -<h3 id="v36_req_mysql">For MySQL Users</h3> - - <ul> - <li>MySQL - v4.1.2 - </li> - <li><strong>perl module:</strong> - DBD::mysql v4.00</li> - </ul> - -<h3 id="v36_req_pg">For PostgreSQL Users</h3> - - <ul> - <li>PostgreSQL - v8.00.0000 - </li> - <li><strong>perl module:</strong> - DBD::Pg v1.45</li> - </ul> -<h3 id="v36_req_oracle">For Oracle Users</h3> - - <ul> - <li>Oracle - v10.02.0 - </li> - <li><strong>perl module:</strong> - DBD::Oracle v1.19</li> - </ul> - -<h3 id="v36_req_modules">Required Perl Modules</h3> - -<table class="req_table" border="0" cellspacing="0" cellpadding="0"> - <tr> - <th>Module</th> <th>Version</th> - </tr> - <tr> - <td >CGI</td> - <td >3.21 - </td> - </tr> - <tr> - <td >Digest::SHA</td> - <td > - (Any) - </td> - </tr> - <tr> - <td >Date::Format</td> - <td >2.21 - </td> - </tr> - <tr> - <td >DateTime</td> - <td >0.28 - </td> - </tr> - <tr> - <td >DateTime::TimeZone</td> - <td >0.71 - </td> - </tr> - <tr> - <td >DBI</td> - <td >1.41 - </td> - </tr> - <tr> - <td >Template</td> - <td >2.22 - </td> - </tr> - <tr> - <td >Email::Send</td> - <td >2.00 - </td> - </tr> - <tr> - <td >Email::MIME</td> - <td >1.861 - </td> - </tr> - <tr> - <td >Email::MIME::Encodings</td> - <td >1.313 - </td> - </tr> - <tr> - <td >Email::MIME::Modifier</td> - <td >1.442 - </td> - </tr> - <tr> - <td >URI</td> - <td > - (Any) - </td> - </tr> -</table> - -<h3 id="v36_req_optional_mod">Optional Perl Modules</h3> - -<p>The following perl modules, if installed, enable various - features of [% terms.Bugzilla %]:</p> - -<table class="req_table" border="0" cellspacing="0" cellpadding="0"> - <tr> - <th>Module</th> <th>Version</th> - <th>Enables Feature</th> - </tr> - <tr> - <td >GD</td> - <td >1.20 - </td> - <td>Graphical Reports, New Charts, Old Charts</td> - </tr> - <tr> - <td >Chart::Lines</td> - <td class="req_new">2.1 - </td> - <td>New Charts, Old Charts</td> - </tr> - <tr> - <td >Template::Plugin::GD::Image</td> - <td > - (Any) - </td> - <td>Graphical Reports</td> - </tr> - <tr> - <td >GD::Text</td> - <td > - (Any) - </td> - <td>Graphical Reports</td> - </tr> - <tr> - <td >GD::Graph</td> - <td > - (Any) - </td> - <td>Graphical Reports</td> - </tr> - <tr> - <td >XML::Twig</td> - <td > - (Any) - </td> - <td>Move [% terms.Bugs %] Between Installations, - Automatic Update Notifications</td> - </tr> - <tr> - <td >MIME::Parser</td> - <td >5.406 - </td> - <td>Move [% terms.Bugs %] Between Installations</td> - </tr> - <tr> - <td >LWP::UserAgent</td> - <td > - (Any) - </td> - <td>Automatic Update Notifications</td> - </tr> - <tr> - <td >PatchReader</td> - <td >0.9.4 - </td> - <td>Patch Viewer</td> - </tr> - <tr> - <td >Net::LDAP</td> - <td > - (Any) - </td> - <td>LDAP Authentication</td> - </tr> - <tr> - <td >Authen::SASL</td> - <td > - (Any) - </td> - <td>SMTP Authentication</td> - </tr> - <tr> - <td >Authen::Radius</td> - <td > - (Any) - </td> - <td>RADIUS Authentication</td> - </tr> - <tr> - <td >SOAP::Lite</td> - <td >0.710.06 - </td> - <td>XML-RPC Interface</td> - </tr> - <tr> - <td class="req_new">JSON::RPC</td> - <td class="req_new"> - (Any) - </td> - <td>JSON-RPC Interface</td> - </tr> - <tr> - <td class="req_new">Test::Taint</td> - <td class="req_new"> - (Any) - </td> - <td>JSON-RPC Interface, XML-RPC Interface</td> - </tr> - <tr> - <td >HTML::Parser</td> - <td >3.40 - </td> - <td>More HTML in Product/Group Descriptions</td> - </tr> - <tr> - <td >HTML::Scrubber</td> - <td > - (Any) - </td> - <td>More HTML in Product/Group Descriptions</td> - </tr> - <tr> - <td >Email::MIME::Attachment::Stripper</td> - <td > - (Any) - </td> - <td>Inbound Email</td> - </tr> - <tr> - <td >Email::Reply</td> - <td > - (Any) - </td> - <td>Inbound Email</td> - </tr> - <tr> - <td >TheSchwartz</td> - <td > - (Any) - </td> - <td>Mail Queueing</td> - </tr> - <tr> - <td >Daemon::Generic</td> - <td > - (Any) - </td> - <td>Mail Queueing</td> - </tr> - <tr> - <td >mod_perl2</td> - <td >1.999022 - </td> - <td>mod_perl</td> - </tr> -</table> - -<h2 id="v36_feat">New Features and Improvements</h2> - -<ul> - <li><a href="#v36_feat_usability">General Usability Improvements</a></li> - <li><a href="#v36_feat_extensions">New Extensions System</a></li> - <li><a href="#v36_feat_qs">Improved Quicksearch</a></li> - <li><a href="#v36_feat_browse">Simple "Browse" Interface</a></li> - <li><a href="#v36_feat_suexec">SUExec Support</a></li> - <li><a href="#v36_feat_mpwindows">Experimental mod_perl Support on Windows</a></li> - <li><a href="#v36_email_attachments">Send Attachments by Email</a></li> - <li><a href="#v36_feat_jsonrpc">JSON-RPC Interface</a></li> - <li><a href="#v36_feat_migrate">Migration From Other [% terms.Bug %]-Trackers</a></li> - <li><a href="#v36_feat_other">Other Enhancements and Changes</a></li> -</ul> - -<h3 id="v36_feat_usability">General Usability Improvements</h3> - -<p>A <a href="https://wiki.mozilla.org/Bugzilla:CMU_HCI_Research_2008">scientific - usability study</a> was done on [% terms.Bugzilla %] by researchers - from Carnegie-Mellon University. As a result of this study, - <a href="https://bugzilla.mozilla.org/showdependencytree.cgi?id=490786&hide_resolved=0">several - usability issues</a> were prioritized to be fixed, based on specific data - from the study.</p> - -<p>As a result, you will see many small improvements in [% terms.Bugzilla %]'s - usability, such as using Javascript to validate certain forms before - they are submitted, standardizing the words that we use in the user interface, - being clearer about what [% terms.Bugzilla %] needs from the user, - and other changes, all of which are also listed individually in this New - Features section.</p> - -<p>Work continues on improving usability for the next release of - [%+ terms.Bugzilla %], but the results of the research have already - had an impact on this 3.6 release.</p> - -<h3 id="v36_feat_extensions">New Extensions System</h3> - -<p>[% terms.Bugzilla %] has a brand-new Extensions system. The system is - consistent, fast, and - <a href="[% docs_urlbase FILTER html %]api/Bugzilla/Extension.html">fully - documented</a>. It makes it possible to easily extend [% terms.Bugzilla %]'s - code and user interface to add new features or change existing features. - There's even - <a href="[% docs_urlbase FILTER html %]api/extensions/create.html">a - script</a> that will create the basic layout of an extension for you, to - help you get started. For more information about the new system, see the - <a href="[% docs_urlbase FILTER html %]api/Bugzilla/Extension.html">Extensions - documentation</a>.</p> - -<p>If you had written any extensions using [% terms.Bugzilla %]'s previous - extensions system, there is - <a href="[% docs_urlbase FILTER html %]api/contrib/extension-convert.html">a - script to help convert old extensions into the new format</a>.</p> - -<h3 id="v36_feat_qs">Improved Quicksearch</h3> - -<p>The "quicksearch" box that appears on the front page of - [%+ terms.Bugzilla %] and in the header/footer of every page - is now simplified and made more powerful. There is a - <kbd>[?]</kbd> link next to the box that will take you to - the simplified <a href="page.cgi?id=quicksearch.html">Quicksearch Help</a>, - which describes every single feature of the system in a simple layout, - including new features such as the ability to use partial field names - when searching.</p> - -<p>Quicksearch should also be much faster than it was before, particularly - on large installations.</p> - -<p>Note that in order to implement the new quicksearch, certain old - and rarely-used features had to be removed: - -<ul> - <li><b>+</b> as a prefix to mean "search additional resolutions", and - <b>+</b> as a prefix to mean "search just the summary". You can - instead use <kbd>summary:</kbd> to explicitly search summaries.</li> - <li>Searching the [% field_descs.bug_severity FILTER html %] field if you - type something that matches the first few characters of a [% - field_descs.bug_severity FILTER html %]. You can explicitly - search the [% field_descs.bug_severity FILTER html %] field if you want to - find [% terms.bugs %] by [% field_descs.bug_severity FILTER html %].</li> - <li>Searching the Priority field if you typed something that exactly - matched the name of a priority. You can explicitly search the - Priority field if you want to find [% terms.bugs %] by priority.</li> - <li>Searching the [% field_descs.rep_platform FILTER html %] and OS fields - if you typed in one of a certain hard-coded list of strings (like "pc", - "windows", etc.). You can explicitly search these fields, instead, if you want - to find [% terms.bugs %] with a specific [% field_descs.rep_platform - FILTER html %] or OS set.</li> -</ul> - -<h3 id="v36_feat_browse">Simple "Browse" Interface</h3> - -<p>There is now a "Browse" link in the header of each [% terms.Bugzilla %] - page that presents a very basic interface that allows users to simply - browse through all open [% terms.bugs %] in particular components.</p> - -<h3 id="v36_feat_suexec">SUExec Support</h3> - -<p>[% terms.Bugzilla %] can now be run in Apache's "SUExec" mode, - which is what control panel software like cPanel and Plesk use - (so [% terms.Bugzilla %] should now be much easier to install - on shared hosting). SUExec support shows up as an option - in the <kbd>localconfig</kbd> file during installation.</p> - -<h3 id="v36_feat_mpwindows">Experimental mod_perl Support on Windows</h3> - -<p>There is now experimental support for running [% terms.Bugzilla %] - under mod_perl on Windows, for a significant performance enhancement - (in exchange for using more memory).</p> - -<h3 id="v36_email_attachments">Send Attachments by Email</h3> - -<p>The <a href="[% docs_urlbase FILTER html %]api/email_in.html">email_in</a> - script now supports attaching multiple attachments to [% terms.abug %] - by email, both when filing and when updating [% terms.abug %].</p> - -<h3 id="v36_feat_jsonrpc">JSON-RPC Interface</h3> - -<p>[% terms.Bugzilla %] now has support for the - <a href="http://json-rpc.org/">JSON-RPC</a> WebServices protocol via - <a href="[% docs_urlbase FILTER html %]api/Bugzilla/WebService/Server/JSONRPC.html">jsonrpc.cgi</a>. - The JSON-RPC interface is experimental in this release--if you want any - fundamental changes in how it works, - <a href="http://www.bugzilla.org/developers/reporting_bugs.html">let us - know</a>, for the next release of [% terms.Bugzilla %].</p> - -<h3 id="v36_feat_migrate">Migration From Other [% terms.Bug %]-Trackers</h3> - -<p>[% terms.Bugzilla %] 3.6 comes with a new script, - <a href="[% docs_urlbase FILTER html %]api/migrate.html">migrate.pl</a>, - which allows migration from other [% terms.bug %]-tracking systems. - Among the various features of the migration system are:</p> - -<ul> - <li>It is non-destructive--you can migrate into an existing - [%+ terms.Bugzilla %] installation without destroying any data - in the installation.</li> - <li>It has a "dry-run" mode so you can test your migration - before actually running it.</li> - <li>It is relatively easy to write new migrators for new systems, - if you know Perl. The basic migration framework does most of the work - for you, you just have to provide it with the data from your - [%+ terms.bug %]-tracker. See the - <a href="[% docs_urlbase FILTER html %]api/Bugzilla/Migrate.html">Bugzilla::Migrate</a> - documentation and see our current migrator, - <kbd>Bugzilla/Migrate/GNATS.pm</kbd> for information on how to make your - own migrator.</li> -</ul> - -<p>The first migrator that has been implemented is for the GNATS - [%+ terms.bug %]-tracking system. We'd love to see migrators for - other systems! If you want to contribute a new migrator, see our - <a href="http://wiki.mozilla.org/Bugzilla:Developers">development - process</a> for details on how to get code into [% terms.Bugzilla %].</p> - -<p>Thanks to <a href="http://lambdares.com/">Lambda Research</a> for - funding the initial development of this feature.</p> - -<h3 id="v36_feat_other">Other Enhancements and Changes</h3> - -<h4>Enhancements for Users</h4> - -<ul> - <li><b>[% terms.Bug %] Filing:</b> When filing [% terms.abug %], - [%+ terms.Bugzilla %] now visually indicates which fields are - mandatory.</li> - <li><b>[% terms.Bug %] Filing:</b> "Bookmarkable templates" now - support the "alias" and "estimated hours" fields.</li> - - <li><b>[% terms.Bug %] Editing:</b> In previous versions of - [%+ terms.Bugzilla %], if you added a private comment to [% terms.abug %], - then <em>none</em> of the changes that you made at that time were - sent to users who couldn't see the private comment. Now, for users - who can't see private comments, public changes are sent, but the private - comment is excluded from their email notification.</li> - <li><b>[% terms.Bug %] Editing:</b> The controls for groups now - appear to the right of the attachment and time-tracking tables, - when editing [% terms.abug %].</li> - <li><b>[% terms.Bug %] Editing:</b> The "Collapse All Comments" - and "Expand All Comments" links now appear to the right of the - comment list instead of above it.</li> - <li><b>[% terms.Bug %] Editing:</b> The See Also field now supports - URLs for Google Code Issues and the Debian B[% %]ug-Tracking System.</li> - <li><b>[% terms.Bug %] Editing:</b> There have been significant performance - improvements in <kbd>show_bug.cgi</kbd> (the script that displays the - [% terms.bug %]-editing form), particularly for [% terms.bugs %] that - have lots of comments or attachments.</li> - - <li><b>Attachments:</b> The "Details" page of an attachment - now displays itself as uneditable if you can't edit the fields - there.</li> - <li><b>Attachments:</b> We now make sure that there is - a Description specified for an attachment, using JavaScript, before - the form is submitted.</li> - <li><b>Attachments:</b> There is now a link back to the [% terms.bug %] - at the bottom of the "Details" page for an attachment.</li> - <li><b>Attachments:</b> When you click on an "attachment 12345" link - in a comment, if the attachment is a patch, you will now see the - formatted "Diff" view instead of the raw patch.</li> - <li><b>Attachments</b>: For text attachments, we now let the browser - auto-detect the character encoding, instead of forcing the browser to - always assume the attachment is in UTF-8.</li> - - <li><b>Search:</b> You can now display [% terms.bug %] flags as a column - in search results.</li> - <li><b>Search:</b> When viewing search results, you can see which columns are - being sorted on, and which direction the sort is on, as indicated - by arrows next to the column headers.</li> - <li><b>Search:</b> You can now search the Deadline field using relative - dates (like "1d", "2w", etc.).</li> - <li><b>Search:</b> The iCalendar format of search results now includes - a PRIORITY field.</li> - <li><b>Search:</b> It is no longer an error to enter an invalid search - order in a search URL--[% terms.Bugzilla %] will simply warn you that - some of your order options are invalid.</li> - <li><b>Search:</b> When there are no search results, some helpful - links are displayed, offering actions you might want to take.</li> - <li><b>Search:</b> For those who like to make their own - <kbd>buglist.cgi</kbd> URLs (and for people working on customizations), - <kbd>buglist.cgi</kbd> now accepts nearly every valid field in - [%+ terms.Bugzilla %] as a direct URL parameter, like - <kbd>&field=value</kbd>.</li> - - <li><b>Requests:</b> When viewing the "My Requests" page, you can now - see the lists as a normal search result by clicking a link at the - bottom of each table.</li> - <li><b>Requests:</b> When viewing the "My Requests" page, if you are - using Classifications, the Product drop-down will be grouped by - Classification.</li> - - <li><b>Inbound Email:</b> When filing [% terms.abug %] by email, if the - product that you are filing the [% terms.bug %] into has some groups - set as Default for you, the [% terms.bug %] will now be placed into those - groups automatically.</li> - <li><b>Inbound Email:</b> The field names that can be used when creating - [%+ terms.bugs %] by email now exactly matches the set of valid parameters - to the - <a href="[% docs_urlbase FILTER html %]api/Bugzilla/WebService/Bug.html#create">B[% %]ug.create - WebService function</a>. You can still use most of the old field names - that 3.4 and earlier used for inbound emails, though, for - backwards-compatibility.</li> - - <li>If there are multiple languages available for your - [%+ terms.Bugzilla %], you can now select what language you want - [%+ terms.Bugzilla %] displayed in using links at the top of every - page.</li> - <li>When creating a new account, you will be automatically logged in - after setting your password.</li> - <li>There is no longer a maximum password length for accounts.</li> - <li>In the Dusk skin, it's now easier to see links.</li> - <li>In the Whining system, you can now choose to receive emails even - if there are no [% terms.bugs %] that match your searches.</li> - <li>The arrows in dependency graphs now point the other way, so that - [%+ terms.bugs %] point at their dependencies.</li> - - <li><b>New Charts:</b> You can now convert an existing Saved Search - into a data series for New Charts.</li> - <li><b>New Charts:</b> There is now an interface that allows you to - delete data series.</li> - <li><b>New Charts:</b> When deleting a product, you now have the option - to delete the data series that are associated with that product.</li> -</ul> - -<h4>Enhancements for Administrators and Developers</h4> - -<ul> - <li>Depending on how your workflow is set up, it is now possible to - have both UNCONFIRMED and REOPENED show up as status choices for - a closed [% terms.bug %]. If you only want one or the other to - show up, you should edit your status workflow appropriately - (possibly by removing or disabling the REOPENED status).</li> - <li>You can now "disable" field values so that they don't show - up as choices on [% terms.abug %] unless they are already set as - the value for that [% terms.bug %]. This doesn't work for the - per-product field values (component, target_milestone, and version) - yet, though.</li> - <li>Users are now locked out of their accounts for 30 minutes after - trying five bad passwords in a row during login. Every time a - user is locked out like this, the user in the "maintainer" parameter - will get an email.</li> - <li>The minimum length allowed for a password is now 6 characters.</li> - <li>The <kbd>UNCONFIRMED</kbd> status being enabled in a product - is now unrelated to the voting parameters. Instead, there is a checkbox - to enable the <kbd>UNCONFIRMED</kbd> status in a product.</li> - <li>Information about duplicates is now stored in the database instead - of being stored in the <kbd>data/</kbd> directory. On large installations - this could save several hundred megabytes of disk space.</li> - - <li><b>Installation:</b> When installing [% terms.Bugzilla %], the - "maintainer" parameter will be automatically set to the administrator - that was created by <kbd>checksetup.pl</kbd>.</li> - <li><b>Installation:</b> <kbd>checksetup.pl</kbd> now prints out - certain errors in a special color so that you know that something - needs to be done.</li> - <li><b>Installation:</b> <kbd>checksetup.pl</kbd> is now <em>much</em> - faster at upgrading installations, particularly older installations. - Also, it's been made faster to run for the case where it's not - doing an upgrade.</li> - <li><b>Installation:</b> If you install [% terms.Bugzilla %] using the - tarball, the <kbd>CGI.pm</kbd> module from CPAN is now included in - the <kbd>lib/</kbd> dir. If you would rather use the CGI.pm from your - global Perl installation, you can delete <kbd>CGI.pm</kbd> and the - <kbd>CGI</kbd> directory from the <kbd>lib/</kbd> directory.</li> - - <li>When editing a group, you can now specify that members of a group - are allowed to grant others membership in that group itself.</li> - <li>The ability to compress BMP attachments to PNGs is now an Extension. - To enable the feature, remove the file - <kbd>extensions/BmpConvert/disabled</kbd> and then run <kbd>checksetup.pl</kbd>.</li> - <li>The default list of values for the Priority field are now clear English - words instead of P1, P2, etc.</li> - <li>There is now a system in place so that all field values can be - localized. See the <kbd>value_descs</kbd> variable in - <kbd>template/en/default/global/field-descs.none.tmpl</kbd>.</li> - <li><kbd>config.cgi</kbd> now returns an ETag header and understands - the If-None-Match header in HTTP requests.</li> - <li>The XML format of <kbd>show_bug.cgi</kbd> now returns more information: - the numeric id of each comment, whether an attachment is a URL, - the modification time of an attachment, the numeric id of a flag, - and the numeric id of a flag's type.</li> - - <li><b>Parameters:</b> Parameters that aren't actually required are no longer - in the "Required" section of the Parameters page. Instead, some are in the - new "General" section, and some are in the new "Advanced" section.</li> - <li><b>Parameters:</b> The old <kbd>ssl</kbd> parameter has been - changed to <kbd>ssl_redirect</kbd>, and can only be turned "on" or "off". - If "on", then all users will be forcibly redirected to SSL whenever - they access [% terms.Bugzilla %]. When the parameter is off, - no SSL-related redirects will occur (even if the user directly - accesses [% terms.Bugzilla %] via SSL, they will <em>not</em> be - redirected to a non-SSL page).</li> - <li><b>Parameters:</b> In the Advanced parameters, there is a new parameter, - <kbd>inbound_proxies</kbd>. If your [% terms.Bugzilla %] is behind a - proxy, you should set this parameter to the IP address of that proxy. - Then, [% terms.Bugzilla %] will "believe" any "X-Forwarded-For" - header sent from that proxy, and correctly use the X-Forwarded-For - as the end user's IP, instead of believing that all traffic is coming - from the proxy.</li> - - <li><b>Removed Parameter:</b> The <kbd>loginnetmask</kbd> parameter has - been removed. Since [% terms.Bugzilla %] sends secure cookies, it's no - longer necessary to always restrict logins to a specific IP or block - of addresses.</li> - <li><b>Removed Parameter:</b> The <kbd>quicksearch_comment_cutoff</kbd> - parameter is gone. Quicksearch now always searches comments; however, it - uses a much faster algorithm to do it.</li> - <li><b>Removed Parameter:</b> The <kbd>usermatchmode</kbd> parameter has - been removed. User-matching is now <em>always</em> done.</li> - <li><b>Removed Parameter:</b> The <kbd>useentrygroupdefault</kbd> parameter - has been removed. [% terms.Bugzilla %] now always behaves as though - that parameter were off.</li> - <li>The <kbd>t/001compile.t</kbd> test should now always pass, no matter - what configuration of optional modules you do or don't have installed.</li> - <li>New script: <kbd>contrib/console.pl</kbd>, which allows you to have - a "command line" into [% terms.Bugzilla %] by inputting Perl code - or using a few custom commands.</li> -</ul> - -<h4>WebService Changes</h4> - -<ul> - <li>The WebService now returns all dates and times in the UTC timezone. - <kbd>B[% %]ugzilla.time</kbd> now acts as though the [% terms.Bugzilla %] - server were in the UTC timezone, always. If you want to write clients - that are compatible across all [% terms.Bugzilla %] versions, - check the timezone from <kbd>B[% %]ugzilla.timezone</kbd> or - <kbd>B[% %]ugzilla.time</kbd>, and always input times in that timezone - and expect times to be returned in that format.</li> - <li>You can now log in by passing <kbd>Bugzilla_login</kbd> and - <kbd>Bugzilla_password</kbd> as arguments to any WebService function. - See the - <a href="[% docs_urlbase FILTER html %]api/Bugzilla/WebService.html#LOGGING_IN">Bugzilla::WebService</a> - documentation for details.</li> - <li>New Method: - <a href="[% docs_urlbase FILTER html %]api/Bugzilla/WebService/Bug.html#attachments">B[% %]ug.attachments</a> - which allows getting information about attachments.</li> - <li>New Method: - <a href="[% docs_urlbase FILTER html %]api/Bugzilla/WebService/Bug.html#fields">B[% %]ug.fields</a>, - which gets information about all the fields that [% terms.abug %] can have - in [% terms.Bugzilla %], include custom fields and legal values for - all fields. The <kbd>B[% %]ug.legal_values</kbd> method is now deprecated.</li> - <li>In the <kbd>B[% %]ug.add_comment</kbd> method, the "private" parameter - has been renamed to "is_private" (for consistency with other methods). - You can still use "private", though, for backwards-compatibility.</li> - <li>The WebService now has Perl's "taint mode" turned on. This means that - it validates all data passed in before sending it to the database. - Also, all parameter names are validated, and if you pass in a parameter - whose name contains anything other than letters, numbers, or underscores, - that parameter will be ignored. Mostly this just affects - customizers--[% terms.Bugzilla %]'s WebService is not functionally - affected by these changes.</li> - <li>In previous versions of [% terms.Bugzilla %], error messages were - sent word-wrapped to the client, from the WebService. Error messages - are now sent as one unbroken line.</li> -</ul> - -<h2 id="v36_issues">Outstanding Issues</h2> - -<ul> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=423439"> - [%- terms.Bug %] 423439</a>: Tabs in comments will be converted - to four spaces, due to a b<!-- -->ug in Perl as of Perl 5.8.8.</li> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=69621"> - [%- terms.Bug %] 69621</a>: If you rename or remove a keyword that is - in use on [% terms.bugs %], you will need to rebuild the "keyword cache" - by running <a href="sanitycheck.cgi">sanitycheck.cgi</a> and choosing - the option to rebuild the cache when it asks. Otherwise keywords may - not show up properly in search results.</li> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=89822"> - [%- terms.Bug %] 89822</a>: When changing multiple [% terms.bugs %] at - the same time, there is no "mid-air collision" protection.</li> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=276230"> - [%- terms.Bug %] 276230</a>: The support for restricting access to - particular Categories of New Charts is not complete. You should treat - the 'chartgroup' Param as the only access mechanism available.<br> - However, charts migrated from Old Charts will be restricted to - the groups that are marked MANDATORY for the corresponding Product. - There is currently no way to change this restriction, and the - groupings will not be updated if the group configuration - for the Product changes.</li> -</ul> - -<h2 id="v36_upgrading">Notes On Upgrading From a Previous Version</h2> - -<p>When upgrading to 3.6, <kbd>checksetup.pl</kbd> will create foreign keys - for many columns in the database. Before doing this, it will check the - database for consistency. If there are an unresolvable consistency - problems, it will tell you what table and column in the database contain - the bad values, and which values are bad. If you don't know what else to do, - you can always delete the database records which contain the bad values by - logging in to your database and running the following command:</p> - -<p><code>DELETE FROM <var>table</var> WHERE <var>column</var> IN - (<var>1, 2, 3, 4</var>)</code></p> - -<p>Just replace "table" and "column" with the name of the table - and column that <kbd>checksetup.pl</kbd> mentions, and "1, 2, 3, 4" - with the invalid values that <kbd>checksetup.pl</kbd> prints out.</p> - -<p>Remember that you should always back up your database before doing - an upgrade.</p> - -<h2 id="v36_code_changes">Code Changes Which May Affect Customizations</h2> - -<ul> - <li>There is no longer a SendBugMail method in the templates, and bugmail - is no longer sent by processing a template. Instead, it is sent - by using <kbd>Bugzilla::BugMail::Send</kbd>.</li> - <li>Comments are now represented as a - <a href="[% docs_urlbase FILTER html %]api/Bugzilla/Comment.html">Bugzilla::Comment</a> - object instead of just being hashes.</li> - <li>In previous versions of [% terms.Bugzilla %], the template for displaying - [%+ terms.abug %] required a lot of extra variables that are now global - template variables instead.</li> - <li>You can now check if optional modules are installed by using - <kbd>Bugzilla->feature</kbd> in Perl code or - <kbd>feature_enabled</kbd> in template code.</li> - <li>All of the various template header information required to display - the [% terms.bug %] form is now in one template, - <kbd>template/en/default/bug/show-header.html.tmpl</kbd>.</li> - <li>You should now use <kbd>display_value</kbd> instead of - <kbd>get_status</kbd> or <kbd>get_resolution</kbd> in templates. - <kbd>display_value</kbd> should be used anywhere that a - <select>-type field has its values displayed.</li> -</ul> - - -<h1 id="v36_previous">[% terms.Bugzilla %] 3.4 Release Notes</h1> - -<ul class="bz_toc"> - <li><a href="#v34_introduction">Introduction</a></li> - <li><a href="#v34_point">Updates in this 3.4.x Release</a></li> - <li><a href="#v34_req">Minimum Requirements</a></li> - <li><a href="#v34_feat">New Features and Improvements</a></li> - <li><a href="#v34_issues">Outstanding Issues</a></li> - <li><a href="#v34_upgrading">Notes On Upgrading From a Previous Version</a></li> - <li><a href="#v34_code_changes">Code Changes Which May Affect - Customizations</a></li> - <li><a href="#v34_previous">Release Notes for Previous Versions</a></li> -</ul> - -<h2 id="v34_introduction">Introduction</h2> - -<p>This is [% terms.Bugzilla %] 3.4! [% terms.Bugzilla %] 3.4 brings a lot - of great enhancements for [% terms.Bugzilla %] over previous versions, - with various improvements to the user interface, lots of interesting new - features, and many long-standing requests finally being addressed.</p> - -<p>If you're upgrading, make sure to read <a href="#v34_upgrading">Notes - On Upgrading From a Previous Version</a>. If you are upgrading from a release - before 3.2, make sure to read the release notes for all the - <a href="#v34_previous">previous versions</a> in between your version - and this one, <strong>particularly the Upgrading section of each - version's release notes</strong>.</p> - -<p>We would like to thank <a href="http://www.canonical.com/">Canonical - Ltd.</a> for funding development of one new feature, and NASA for funding - development of several new features through the - <a href="http://www.sjsufoundation.org/">San Jose State University - Foundation</a>.</p> - -<h2 id="v34_point">Updates In This 3.4.x Release</h2> - -<h3>3.4.6</h3> - -<ul> - <li>When doing a search that involves "not equals" or "does not contain the - string" or similar "negative" search types, the search description that - appears at the top of the resulting [% terms.bug %] list will indicate - that the search was of that type. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=474738">[% terms.Bug %] 474738</a>) - </li> - <li>In Internet Explorer, users couldn't easily mark a RESOLVED DUPLICATE - [%+ terms.bug %] as REOPENED, due to a JavaScript error. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=546719">[% terms.Bug %] 546719</a>) - </li> - <li>If you use a "bookmarkable template" to pre-fill forms on - the [% terms.bug %]-filing page, and you have custom fields - that are only supposed to appear (or only supposed to have certain - values) based on the values of other fields, those custom fields will - now work properly. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=538211">[% terms.Bug %] 538211</a>) - </li> - <li>If you have a custom field that's only supposed to appear when - a [% terms.bug %]'s resolution is FIXED, it will now behave properly - on the [% terms.bug %]-editing form when a user sets the [% terms.bug %]'s - status to RESOLVED. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=520993">[% terms.Bug %] 520993</a>) - </li> - <li>If you are logged-out and using <kbd>request.cgi</kbd>, the Requester - and Requestee fields no longer respect the <kbd>usermatching</kbd> - parameter--they always require full usernames. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=533018">[% terms.Bug %] 533018</a>) - </li> - <li>If you tried to do a search with too many terms (resulting in a URL - that was longer than about 7000 characters), Apache would return a - 500 error instead of your search results. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=513989">[% terms.Bug %] 513989</a>) - </li> - <li>[% terms.Bugzilla %] would sometimes lose fields from your sort order - when you added new fields to your sort order. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=470214">[% terms.Bug %] 470214</a>) - </li> - <li>The Atom format of search results would sometimes be missing the - Reporter or Assignee field for some [% terms.bugs %]. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=537834">[% terms.Bug %] 537834</a>) - </li> -</ul> - -<h3>3.4.5</h3> - -<p>This release contains fixes for multiple security issues. See the - <a href="http://www.bugzilla.org/security/3.0.10/">Security Advisory</a> - for details.</p> - -<p>In addition, the following important fixes/changes have been made in - this release:</p> - -<ul> - <li>Whining was failing if jobqueue.pl was enabled. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=530270">[% terms.Bug %] 530270</a>) - </li> - <li>The Assignee field was empty in Whine mails. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=511216">[% terms.Bug %] 511216</a>) - </li> - <li>Administrators can now successfully create user accounts using - editusers.cgi when using the "Env" authentication method. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=483987">[% terms.Bug %] 483987</a>) - </li> - <li>[% terms.Bug %]mail now uses the timezone of the recipient of the email, - when displaying the time a comment was made, instead of the timezone of the - person who made the change. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=534587">[% terms.Bug %] 534587</a>) - </li> - <li>"[% terms.bug %] 1234" in comments sometimes would not become a link if - word-wrapping happened between "[% terms.bug %]" and the number. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=514703">[% terms.Bug %] 514703</a>) - </li> - <li>Running <kbd>checksetup.pl</kbd> on Windows will no longer pop up an error box - about OCI.dll. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=480968">[% terms.Bug %] 480968</a>) - </li> -</ul> - -<h3>3.4.4</h3> - -<p>This release contains a fix for a security issue. See the - <a href="http://www.bugzilla.org/security/3.4.3/">Security Advisory</a> - for details.</p> - -<p>Additionally, this release fixes a few minor [% terms.bugs %].</p> - -<h3>3.4.3</h3> - -<ul> - <li>[% terms.Bugzilla %] installations running under mod_perl were leaking - about 512K of RAM per page load. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=517793">[% terms.Bug %] 517793</a>) - </li> - <li>Attachments with Unicode characters in their names were being downloaded - with mangled names. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=328628">[% terms.Bug %] 328628</a>) - </li> - <li>Creating custom fields with Unicode in their database column name - is now no longer allowed, as it would break [% terms.Bugzilla %]. If you - created such a custom field, you should delete it by first marking it - obsolete and then clicking "Delete" in the custom field list, using - <a href="editfields.cgi">editfields.cgi</a>. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=525025">[% terms.Bug %] 525025</a>) - </li> - <li>Clicking "submit only my comment" on the "mid-air collisions" page - was leading to a "Suspicious Action" warning. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=514378">[% terms.Bug %] 514378</a>) - </li> - <li>The XML format of [% terms.abug %] accidentally contained the - word-wrapped content of comments instead of the unwrapped content. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=509152">[% terms.Bug %] 509152</a>) - </li> - <li>You can now do <kbd>./install-module.pl --shell</kbd> to get a CPAN - shell using the configuration of - <a href="[% docs_urlbase FILTER html %]api/install-module.html">install-module.pl</a>, - which allows you to do more advanced Perl module installation tasks. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=445875">[% terms.Bug %] 445875</a>) - </li> -</ul> - -<h3>3.4.2</h3> - -<p>This release contains fixes for multiple security issues, one of which - is highly critical. See the - <a href="http://www.bugzilla.org/security/3.0.8/">Security Advisory</a> - for details.</p> - -<p>In addition, the following important fixes/changes have been made in - this release:</p> - -<ul> - <li>Upgrades from older releases were sometimes failing during UTF-8 - conversion with a foreign key error. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=508181">[% terms.Bug %] 508181</a>) - </li> - <li>Sorting [% terms.bug %] lists on certain fields would result in an error. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=510944">[% terms.Bug %] 510944</a>) - </li> - <li>[% terms.Bug %] update emails had two or three blank lines at the top - and between the various sections of the email. There is now only one - blank line in each of those places, making these emails more compact. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=73330">[% terms.Bug %] 73330</a>) - </li> - <li>[% terms.Bug %] email notifications for new [% terms.bugs %] incorrectly - had a line saying that the description was "Comment 0". - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=510798">[% terms.Bug %] 510798</a>) - </li> - <li>Running <kbd>./collectstats.pl --regenerate</kbd> is now much faster, - on the order of 20x or 100x faster. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=286625">[% terms.Bug %] 286625</a>) - </li> - <li>For users of RHEL, CentOS, Fedora, etc. jobqueue.pl can now automatically - be installed as a daemon by running <kbd>./jobqueue.pl install</kbd> - as root. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=475403">[% terms.Bug %] 475403</a>) - </li> - <li>XML-RPC interface responses had an incorrect Content-Length header - and would sometimes be truncated, if they contained certain UTF-8 - characters. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=486306">[% terms.Bug %] 486306</a>) - </li> - <li>Users who didn't have access to the time-tracking fields would get an - empty [% terms.bug %] update email when the time-tracking fields were - changed. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=509035">[% terms.Bug %] 509035</a>) - </li> - <li>In the New Charts, non-public series now no longer show up as selectable - if you cannot access them. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=389396">[% terms.Bug %] 389396</a>) - </li> -</ul> - -<h3>3.4.1</h3> - -<p>This release contains an important security fix. See the - <a href="http://www.bugzilla.org/security/3.4/">Security Advisory</a> - for details.</p> - -<h2 id="v34_req">Minimum Requirements</h2> - -<p>Any requirements that are new since 3.2.3 will look like - <span class="req_new">this</span>.</p> - -<ul> - <li><a href="#v34_req_perl">Perl</a></li> - <li><a href="#v34_req_mysql">For MySQL Users</a></li> - <li><a href="#v34_req_pg">For PostgreSQL Users</a></li> - <li><a href="#v34_req_oracle">For Oracle Users</a></li> - <li><a href="#v34_req_modules">Required Perl Modules</a></li> - <li><a href="#v34_req_optional_mod">Optional Perl Modules</a></li> -</ul> - -<h3 id="v34_req_perl">Perl</h3> - -<p>Perl v5.8.1</p> - -<h3 id="v34_req_mysql">For MySQL Users</h3> - -<ul> - <li>MySQL v4.1.2</li> - <li><strong>perl module:</strong> DBD::mysql v4.00</li> -</ul> - -<h3 id="v34_req_pg">For PostgreSQL Users</h3> - -<ul> - <li>PostgreSQL v8.00.0000</li> - <li><strong>perl module:</strong> DBD::Pg v1.45</li> -</ul> - -<h3 id="v34_req_oracle">For Oracle Users</h3> - -<ul> - <li>Oracle v10.02.0</li> - <li><strong>perl module:</strong> DBD::Oracle v1.19</li> -</ul> - -<h3 id="v34_req_modules">Required Perl Modules</h3> - -<table class="req_table" border="0" cellspacing="0" cellpadding="0"> - <tr> - <th>Module</th> <th>Version</th> - </tr> - <tr> - <td>CGI</td> - <td>3.21</td> - </tr> - <tr> - <td class="req_new">Digest::SHA</td> - <td class="req_new"> (Any)</td> - </tr> - <tr> - <td>Date::Format</td> - <td>2.21</td> - </tr> - <tr> - <td class="req_new">DateTime</td> - <td class="req_new">0.28</td> - </tr> - <tr> - <td class="req_new">DateTime::TimeZone</td> - <td class="req_new">0.71</td> - </tr> - <tr> - <td>DBI</td> - <td>1.41</td> - </tr> - <tr> - <td>Template</td> - <td class="req_new">2.22</td> - </tr> - <tr> - <td>Email::Send</td> - <td>2.00</td> - </tr> - <tr> - <td>Email::MIME</td> - <td>1.861</td> - </tr> - <tr> - <td>Email::MIME::Encodings</td> - <td>1.313</td> - </tr> - <tr> - <td>Email::MIME::Modifier</td> - <td>1.442</td> - </tr> - <tr> - <td class="req_new">URI</td> - <td class="req_new">(Any)</td> - </tr> -</table> - -<h3 id="v34_req_optional_mod">Optional Perl Modules</h3> - -<p>The following perl modules, if installed, enable various - features of [% terms.Bugzilla %]:</p> - -<table class="req_table" border="0" cellspacing="0" cellpadding="0"> - <tr> - <th>Module</th> - <th>Version</th> - <th>Enables Feature</th> - </tr> - <tr> - <td>LWP::UserAgent</td> - <td>(Any)</td> - <td>Automatic Update Notifications</td> - </tr> - <tr> - <td>Template::Plugin::GD::Image</td> - <td>(Any)</td> - <td>Graphical Reports</td> - </tr> - <tr> - <td>GD::Text</td> - <td>(Any)</td> - <td>Graphical Reports</td> - </tr> - <tr> - <td>GD::Graph</td> - <td>(Any)</td> - <td>Graphical Reports</td> - </tr> - <tr> - <td>GD</td> - <td>1.20</td> - <td>Graphical Reports, New Charts, Old Charts</td> - </tr> - <tr> - <td>Email::MIME::Attachment::Stripper</td> - <td>(Any)</td> - <td>Inbound Email</td> - </tr> - <tr> - <td>Email::Reply</td> - <td>(Any)</td> - <td>Inbound Email</td> - </tr> - <tr> - <td>Net::LDAP</td> - <td>(Any)</td> - <td>LDAP Authentication</td> - </tr> - <tr> - <td class="req_new">TheSchwartz</td> - <td class="req_new">(Any)</td> - <td>Mail Queueing</td> - </tr> - <tr> - <td class="req_new">Daemon::Generic</td> - <td class="req_new">(Any)</td> - <td>Mail Queueing</td> - </tr> - <tr> - <td>HTML::Parser</td> - <td>3.40</td> - <td>More HTML in Product/Group Descriptions</td> - </tr> - <tr> - <td>HTML::Scrubber</td> - <td>(Any)</td> - <td>More HTML in Product/Group Descriptions</td> - </tr> - <tr> - <td>XML::Twig</td> - <td>(Any)</td> - <td>Move [% terms.Bugs %] Between Installations</td> - </tr> - <tr> - <td>MIME::Parser</td> - <td>5.406</td> - <td>Move [% terms.Bugs %] Between Installations</td> - </tr> - <tr> - <td>Chart::Base</td> - <td>1.0</td> - <td>New Charts, Old Charts</td> - </tr> - <tr> - <td>Image::Magick</td> - <td>(Any)</td> - <td>Optionally Convert BMP Attachments to PNGs</td> - </tr> - <tr> - <td>PatchReader</td> - <td>0.9.4</td> - <td>Patch Viewer</td> - </tr> - <tr> - <td>Authen::Radius</td> - <td>(Any)</td> - <td>RADIUS Authentication</td> - </tr> - <tr> - <td>Authen::SASL</td> - <td>(Any)</td> - <td>SMTP Authentication</td> - </tr> - <tr> - <td>SOAP::Lite</td> - <td>0.710.06</td> - <td>XML-RPC Interface</td> - </tr> - <tr> - <td>mod_perl2</td> - <td>1.999022</td> - <td>mod_perl</td> - </tr> -</table> - -<h2 id="v34_feat">New Features and Improvements</h2> - -<ul> - <li><a href="#v34_feat_enter">Simple [% terms.Bug %] Filing</a></li> - <li><a href="#v34_feat_index">New Home Page</a></li> - <li><a href="#v34_feat_spam">Email Addresses Hidden From Logged-Out - Users</a></li> - <li><a href="#v34_feat_urls">Shorter Search URLs</a></li> - <li><a href="#v34_feat_async">Asynchronous Email Sending</a></li> - <li><a href="#v34_feat_tz">Dates and Times Displayed In User's Time - Zone</a></li> - <li><a href="#v34_feat_vis">Custom Fields That Only Appear When - Another Field Has a Particular Value</a></li> - <li><a href="#v34_feat_vals">Custom Fields Whose List of Values - Change Depending on the Value of Another Field</a></li> - <li><a href="#v34_feat_bugid">New Custom Field Type: - [%+ terms.Bug %] ID</a></li> - <li><a href="#v34_feat_see">"See Also" Field</a></li> - <li><a href="#v34_feat_cols">Re-order Columns in Search Results</a></li> - <li><a href="#v34_feat_desc">Search Descriptions</a></li> - <li><a href="#v34_feat_other">Other Enhancements and Changes</a></li> -</ul> - -<h3 id="v34_feat_enter">Simple [% terms.Bug %] Filing</h3> - -<p>When entering a new [% terms.bug %], the vast majority of fields are - now hidden by default, which enormously simplifies the bug-filing form. - You can click "Show Advanced Fields" to show all the fields, if you want - them. [%+ terms.Bugzilla %] remembers whether you last used the "Advanced" - or "Simple" version of the [% terms.bug %]-entry form, and will display the - same version to you again next time you file [% terms.abug %].</p> - -<h3 id="v34_feat_index">New Home Page</h3> - -<p>[% terms.Bugzilla %]'s front page has been redesigned to be better at - guiding new users into the activities that they most commonly want to - do. Further enhancements to the home page are coming in future versions - of [% terms.Bugzilla %].</p> - -<h3 id="v34_feat_spam">Email Addresses Hidden From Logged-Out Users</h3> - -<p>To help prevent spam to [% terms.Bugzilla %] users, all email addresses - stored in [% terms.Bugzilla %] are now displayed only if you are logged in. - If you are logged out, only the part before the "@" of the email address is - displayed. This includes [% terms.bug %] lists, viewing [% terms.bugs %], the - XML format of [% terms.abug %], and any other place in the web interface that - an email address could appear.</p> - -<p>Email addresses are not filtered out of [% terms.bug %] comments. - The WebService still returns full email addresses, even if you are logged - out.</p> - -<h3 id="v34_feat_urls">Shorter Search URLs</h3> - -<p>When submitting a search, all the unused fields are now stripped from - the URL, so search URLs are much more meaningful, and much shorter.</p> - -<h3 id="v34_feat_async">Asynchronous Email Sending</h3> - -<p>The largest performance problem in former versions of [% terms.Bugzilla %] - was that when updating [% terms.bugs %], email would be sent immediately - to every user who needed to be notified, and <kbd>process_bug.cgi</kbd> - would wait for the emails to be sent before continuing.</p> - -<p>Now [% terms.Bugzilla %] is capable of queueing emails to be sent - while [% terms.abug %] is being updated, and sending them in the - background. This requires the administrator to run a daemon - that comes with [% terms.Bugzilla %], named - <a href="[% docs_urlbase FILTER html %]api/jobqueue.html">jobqueue.pl</a>, - and to enable the <a href="editparams.cgi?section=mta#use_mailer_queue"> - use_mailer_queue</a> parameter.</p> - -<p>Using the background email-sending daemon instead of sending mail directly - should result in a very large speed-up for updating [% terms.bugs %], - particularly on larger installations.</p> - -<h3 id="v34_feat_tz">Dates and Times Displayed In User's Time Zone</h3> - -<p>Users can now select what time zone they are in and [% terms.Bugzilla %] - will adjust displayed times to be correct for their time zone. However, - times the user inputs are unfortunately still in [% terms.Bugzilla %]'s - time zone.</p> - -<h3 id="v34_feat_vis">Custom Fields That Only Appear When Another Field - Has a Particular Value</h3> - -<p>When creating a new custom field (or updating the definition of - an existing custom field), you can now say that "this field only - appears when field X has value Y". (In the future, you will be able - to select multiple values for "Y", so a field will appear when any - one of those values is selected.)</p> - -<p>This feature only hides fields--it doesn't make their values go away. - So [% terms.bugs %] will still show up in searches for that field's - value, but the field won't appear in the user interface.</p> - -<p>This is a good way of making Product-specific fields.</p> - -<h3 id="v34_feat_vals">Custom Fields Whose List of Values Change - Depending on the Value of Another Field</h3> - -<p>When creating a drop-down or multiple-selection custom field, you can - now specify that another field "controls the values" of this field. - Then, when adding values to this field, you can say that a particular - value only appears when the other field is set to a particular - value.</p> - -<p>Here's an example: Let's say that we create a field called "Colors", - and we make the Product field "control the values" for Colors. Then we - add Blue, Red, Black, and Yellow as legal values for the "Colors" field. - Now we can say that "Blue" and "Red" only appear as valid choices in - Product A, "Yellow" only appears in Product B, but "Black" <em>always</em> - appears.</p> - -<p>One thing to note is that this feature only controls what values appear in - the <em>user interface</em>. [% terms.Bugzilla %] itself will still accept - any combination of values as valid, in the backend.</p> - -<h3 id="v34_feat_bugid">New Custom Field Type: [% terms.Bug %] ID</h3> - -<p>You can now create a custom field that holds a reference to a single - valid [% terms.bug %] ID. In the future this will be enhanced to allow - [%+ terms.bugs %] to refer to each other via this field.</p> - -<h3 id="v34_feat_see">"See Also" Field</h3> - -<p>We have added a new standard field called "See Also" to - [%+ terms.Bugzilla %]. In this field, you can put URLs to multiple - [%+ terms.bugs %] in any [% terms.Bugzilla %] installation, to indicate - that those [% terms.bugs %] are related to this one. It also supports - adding URLs to [% terms.bugs %] in - <a href="http://launchpad.net/">Launchpad</a>.</p> - -<p>Right now, the field just validates the URLs and then displays them, but - in the future, it will grab information from the other installation about - the [% terms.bug %] and display it here, and possibly even update the - other installation.</p> - -<p>If your installation does not need this field, you can hide it by disabling - the <a href="editparams.cgi?section=bugfields#use_see_also">use_see_also - parameter</a>.</p> - -<h3 id="v34_feat_cols">Re-order Columns in Search Results</h3> - -<p>There is a new interface for choosing what columns appear in search - results, which allows you to change the order in which columns appear - from left to right when viewing the [% terms.bug %] list.</p> - -<h3 id="v34_feat_desc">Search Descriptions</h3> - -<p>When displaying search results, [% terms.Bugzilla %] will now show - a brief description of what you searched for, at the top of the - [%+ terms.bug %] list.</p> - -<h3 id="v34_feat_other">Other Enhancements and Changes</h3> - -<h4>Enhancements for Users</h4> - -<ul> - <li>You can now log in from every page, using the login form that appears - in the header or footer when you click "Log In".</li> - <li>When viewing [% terms.abug %], obsolete attachments are now - hidden from the attachment list by default. You can show them - by clicking "Show Obsolete" at the bottom of the attachment list.</li> - <li>In the Email Preferences, you can now choose to get email when - a new [% terms.bug %] report is filed and you have a particular - role on it.</li> - <li>When resolving a mid-air collision, you can now choose to submit - only your comment.</li> - <li>You can now set the Blocks and Depends On field on the "Change - Several [% terms.Bugs %] At Once" page.</li> - <li>If your installation uses the "insidergroup" feature, you can now add - private comments on the "Change Several [% terms.Bugs %] At Once" - page.</li> - <li>When viewing a search result, you can now hover over any abbreviated - field to see its full value.</li> - <li>When logging out, users are now redirected to the main page of - [%+ terms.Bugzilla %] instead of an empty page.</li> - <li>When editing [% terms.abug %], text fields (except the comment box) now - grow longer when you widen your browser window.</li> - <li>When viewing [% terms.abug %], the Depends On and Blocks list will - display [% terms.abug %]'s alias if it has one, instead of its id. - Also, closed [% terms.bugs %] will be sorted to the end of the list.</li> - - <li>If you use the time-tracking features of [% terms.Bugzilla %], and - you enable the time-tracking related columns in a search result, - then you will see a summary of the time-tracking data at the - bottom of the search result.</li> - <li>For users of time-tracking, the <kbd>summarize_time.cgi</kbd> page - now contains more data.</li> - - <li>When viewing an attachment's details page while you are logged-out, - flags are no longer shown as editable.</li> - <li>Cloning [% terms.abug %] will now retain the "Blocks" and "Depends On" - fields from the [% terms.bug %] being cloned.</li> - <li>[% terms.Bug %]mail for new [% terms.bugs %] will now indicate - what security groups the [% terms.bug %] has been restricted to.</li> - <li>You can now use any custom drop-down field as an axis for a tabular - or graphical report.</li> - <li>The <kbd>X-Bugzilla-Type</kbd> header in emails sent by - [%+ terms.Bugzilla %] is now "new" for [% terms.bug %]mail sent for - newly-filed [% terms.bugs %], and "changed" for emails having to do - with updated [% terms.bugs %].</li> - <li>Mails sent by the "Whining" system now contain the header - <kbd>X-Bugzilla-Type: whine</kbd>.</li> - <li>[% terms.bug %]mail now contains a X-Bugzilla-URL header to uniquely - identify which [% terms.Bugzilla %] installation the email came from.</li> - <li>If you input an invalid regular expression anywhere in - [%+ terms.Bugzilla %], it will now tell you explicitly instead of failing - cryptically.</li> - <li>The <kbd>duplicates.xul</kbd> page (which wasn't used by very many - people) is now gone.</li> -</ul> - -<h4>Enhancements for Administrators and Developers</h4> - -<ul> - <li>[% terms.Bugzilla %] now uses the SHA-256 algorithm (a variant of - SHA-2) to encrypt passwords in the database, instead of using Unix's - "crypt" function. This allows passwords longer than eight characters - to actually be effective. Each user's password will be converted to - SHA-256 the first time they log in after you upgrade to - [%+ terms.Bugzilla %] 3.4 or later.</li> - <li>If you are using database replication with [% terms.Bugzilla %], - many more scripts now take advantage of the read-only slave (the - "shadowdb"). It may be safe to open up <kbd>show_bug.cgi</kbd> - to search-engine indexing by editing your <kbd>robots.txt</kbd> file, - now, if your [% terms.Bugzilla %] is on fast-enough hardware.</li> - <li>The database now uses foreign keys to enforce the validity of - relationships between tables. Not every single table has all its - foreign keys yet, but most do.</li> - <li>Various parameters have been removed, in an effort to de-clutter - the parameter interface and simplify [% terms.Bugzilla %]'s code. - The parameters that were removed were: timezone, supportwatchers, - maxpatchsize, commentonclearresolution, commentonreassignbycomponent, - showallproducts. They have all been replaced with sensible default - behaviors. (For example, user watching is now always enabled.)</li> - <li>When adding <code>&debug=1</code> to the end of a - <kbd>buglist.cgi</kbd> URL, [% terms.Bugzilla %] will now also do an - EXPLAIN on the query, to help debug performance issues.</li> - <li>When editing flag types in the administrative interface, you can now - see how many flags of each type have been set.</li> -</ul> - -<h4>WebService Changes</h4> - -<ul> - <li>Various functions have been added to the WebService: - <a href="[% docs_urlbase FILTER html %]api/Bugzilla/WebService/Bug.html#history">B[% %]ug.history</a>, - <a href="[% docs_urlbase FILTER html %]api/Bugzilla/WebService/Bug.html#search">B[% %]ug.search</a>, - <a href="[% docs_urlbase FILTER html %]api/Bugzilla/WebService/Bug.html#comments">B[% %]ug.comments</a>, - <a href="[% docs_urlbase FILTER html %]api/Bugzilla/WebService/Bug.html#update_see_also">B[% %]ug.update_see_also</a>, - <a href="[% docs_urlbase FILTER html %]api/Bugzilla/WebService/User.html#get">User.get</a>, - and <a href="[% docs_urlbase FILTER html %]api/Bugzilla/WebService/Bugzilla.html#time">B[% %]ugzilla.time</a> - (<kbd>B[% %]ugzilla.timezone</kbd> is now deprecated). - </li> - <li>For network efficiency, you can now limit which fields are returned - from certain WebService functions, like <kbd>User.get</kbd>.</li> - <li>There is now a "permissive" argument for the <kbd>B[% %]ug.get</kbd> - WebService function, which causes it not to throw an error when you - ask for [% terms.bugs %] you can't see.</li> - - <li>The <kbd>B[% %]ug.get</kbd> method now returns many more fields.</li> - <li>The <kbd>B[% %]ug.add_comment</kbd> method now returns the ID of the comment - that was just added.</li> - <li>The <kbd>B[% %]ug.add_comment</kbd> method will now throw an error if you - try to add a private comment but do not have the correct permissions. - (In previous versions, it would just silently ignore the <kbd>private</kbd> - argument if you didn't have the correct permissions.)</li> - <li>Many WebService function parameters now take individual values in - addition to arrays.</li> - <li>The WebService now validates input types--it makes sure that dates - are in the right format, that ints are actually ints, etc. It will throw - an error if you send it invalid data. It also accepts empty ints, doubles, - and dateTimes, and translates them to <kbd>undef</kbd>.</li> -</ul> - -<h2 id="v34_issues">Outstanding Issues</h2> - -<ul> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=423439"> - [%- terms.Bug %] 423439</a>: Tabs in comments will be converted - to four spaces, due to a b<!-- -->ug in Perl as of Perl 5.8.8.</li> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=69621"> - [%- terms.Bug %] 69621</a>: If you rename or remove a keyword that is - in use on [% terms.bugs %], you will need to rebuild the "keyword cache" - by running <a href="sanitycheck.cgi">sanitycheck.cgi</a> and choosing - the option to rebuild the cache when it asks. Otherwise keywords may - not show up properly in search results.</li> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=89822"> - [%- terms.Bug %] 89822</a>: When changing multiple [% terms.bugs %] at - the same time, there is no "mid-air collision" protection.</li> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=276230"> - [%- terms.Bug %] 276230</a>: The support for restricting access to - particular Categories of New Charts is not complete. You should treat - the 'chartgroup' Param as the only access mechanism available.<br> - However, charts migrated from Old Charts will be restricted to - the groups that are marked MANDATORY for the corresponding Product. - There is currently no way to change this restriction, and the - groupings will not be updated if the group configuration - for the Product changes.</li> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=370370"> - [%- terms.Bug %] 370370</a>: mod_perl support is currently not - working on Windows machines.</li> -</ul> - -<h2 id="v34_upgrading">Notes On Upgrading From a Previous Version</h2> - -<p>When upgrading to 3.4, <kbd>checksetup.pl</kbd> will create foreign keys - for many columns in the database. Before doing this, it will check the - database for consistency. If there are an unresolvable consistency - problems, it will tell you what table and column in the database contain - the bad values, and which values are bad. If you don't know what else to do, - you can always delete the database records which contain the bad values by - logging in to your database and running the following command:</p> - -<p><code>DELETE FROM <var>table</var> WHERE <var>column</var> IN - (<var>1, 2, 3, 4</var>)</code></p> - -<p>Just replace "table" and "column" with the name of the table - and column that <kbd>checksetup.pl</kbd> mentions, and "1, 2, 3, 4" - with the invalid values that <kbd>checksetup.pl</kbd> prints out.</p> - -<p>Remember that you should always back up your database before doing - an upgrade.</p> - -<h2 id="v34_code_changes">Code Changes Which May Affect Customizations</h2> - -<ul> - <li><kbd>checksetup.pl</kbd> now re-writes the <kbd>localconfig</kbd> - file every time it runs, keeping the current values set (if there - are any), but moving any unexpected variables into a file called - <kbd>localconfig.old</kbd>. If you want to continue having custom - varibles in <kbd>localconfig</kbd>, you will have to add them to - the <code>LOCALCONFIG_VARS</code> constant in - <kbd>Bugzilla::Install::Localconfig</kbd>.</li> - <li><kbd>Bugzilla::Object->update()</kbd> now returns something different - in list context than it does in scalar context.</li> - <li><kbd>Bugzilla::Object->check()</kbd> now can take object - ids in addition to names. Just pass in <code>{ id => $some_value - }</code>.</li> - <li>Instead of being defined in <kbd>buglist.cgi</kbd>, columns for - search results are now defined in a subroutine called <code>COLUMNS</code> - in <kbd>Bugzilla::Search</kbd>. The data now mostly comes from the - <kbd>fielddefs</kbd> table in the database. Search.pm now takes a list - of column names from fielddefs for its <kbd>fields</kbd> argument instead - of literal SQL columns.</li> - <li><kbd>Bugzilla::Field->legal_values</kbd> now returns an array of - <a href="[% docs_urlbase FILTER html %]api/Bugzilla/Field/Choice.html">Bugzilla::Field::Choice</a> - objects instead of an array of strings. Bugzilla::Field::Choice will be used - in more places, in the future.</li> - <li>We now use <kbd>Bugzilla::Bug->check()</kbd> instead of - <kbd>ValidateBugId</kbd>.</li> - <li>The <kbd>groups</kbd> and <kbd>bless_groups</kbd> methods in - <kbd>Bugzilla::User</kbd> now return an arrayref of - <kbd>Bugzilla::Group</kbd> objects instead of a hashref with - group ids and group names.</li> - <li>Standard [% terms.Bugzilla %] drop-down fields now have their type - set to <kbd>FIELD_TYPE_SINGLE_SELECT</kbd> in the fielddefs table.</li> - <li><kbd>Bugzilla->usage_mode</kbd> now defaults to - <kbd>USAGE_MODE_CMDLINE</kbd> if we are not running inside a web - server.</li> - <li>We no longer delete environment variables like <kbd>$ENV{PATH}</kbd> - automatically unless we're actually running in taint mode.</li> - <li>We are now using YUI 2.6.0.</li> - <li>In <a href="config.cgi?ctype=rdf">the RDF format of config.cgi</a>, - the "resource" attribute for flags now contains "flag.cgi" instead - of "flags.cgi".</li> -</ul> - - - - - - - -<h1 id="v34_previous">[% terms.Bugzilla %] 3.2 Release Notes</h1> - -<h2>Table of Contents</h2> - -<ul class="bz_toc"> - <li><a href="#v32_introduction">Introduction</a></li> - <li><a href="#v32_point">Updates In This 3.2.x Release</a></li> - <li><a href="#v32_security">Security Fixes In This 3.2.x Release</a></li> - <li><a href="#v32_req">Minimum Requirements</a></li> - <li><a href="#v32_feat">New Features and Improvements</a></li> - <li><a href="#v32_issues">Outstanding Issues</a></li> - <li><a href="#v32_upgrading">How to Upgrade From An Older Version</a></li> - <li><a href="#v32_code_changes">Code Changes Which May Affect - Customizations</a></li> - <li><a href="#v32_previous">Release Notes for Previous Versions</a></li> -</ul> - -<h2 id="v32_introduction">Introduction</h2> - -<p>Welcome to [% terms.Bugzilla %] 3.2! This is our first major feature - release since [% terms.Bugzilla %] 3.0, and it brings a lot of great - improvements and polish to the [% terms.Bugzilla %] experience.</p> - -<p>If you're upgrading, make sure to read <a href="#v32_upgrading">How to - Upgrade From An Older Version</a>. If you are upgrading from a release - before 3.0, make sure to read the release notes for all the - <a href="#v32_previous">previous versions</a> in between your version - and this one, <strong>particularly the "Notes For Upgraders" section of each - version's release notes</strong>.</p> - -<h2 id="v32_point">Updates in this 3.2.x Release</h2> - -<p>This section describes what's changed in the most recent b<!-- -->ug-fix - releases of [% terms.Bugzilla %] after 3.2. We only list the - most important fixes in each release. If you want a detailed list of - <em>everything</em> that's changed in each version, you should use our - <a href="http://www.bugzilla.org/status/changes.html">Change Log - Page</a>.</p> - -<h3>3.2.3</h3> - -<ul> - <li>[% terms.Bugzilla %] is now compatible with MySQL 5.1.x versions 5.1.31 - and greater. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=480001">[% terms.Bug %] 480001</a>)</li> - <li>On Windows, [% terms.Bugzilla %] sometimes would send mangled emails - (that would often fail to send). - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=467920">[% terms.Bug %] 467920</a>)</li> - <li><code>recode.pl</code> would sometimes crash when trying to convert - databases from older versions of [% terms.Bugzilla %]. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=431201">[% terms.Bug %] 431201</a>)</li> - <li>Running a saved search with Unicode characters in its name would - cause [% terms.Bugzilla %] to crash. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=477513">[% terms.Bug %] 477513</a>)</li> - <li>[% terms.Bugzilla %] clients like Mylyn can now update [% terms.bugs %] - again (the [% terms.bug %] XML format now contains a "token" element that - can be used when updating [% terms.abug %]). - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=476678">[% terms.Bug %] 476678</a>)</li> - <li>For installations using the <code>shadowdb</code> parameter, - [%+ terms.Bugzilla %] was accidentally writing to the "tokens" table - in the shadow database (instead of the master database) when using the - "Change Several [% terms.Bugs %] at Once" page. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=476943">[% terms.Bug %] 476943</a>)</li> -</ul> - -<p>This release also contains a security fix. See the - <a href="#v32_security">Security Fixes Section</a> for details.</p> - -<h3>3.2.2</h3> - -<p>This release fixes one security issue that is critical for installations - running 3.2.1 under mod_perl. See the - <a href="http://www.bugzilla.org/security/3.0.7/">Security Advisory</a> - for details.</p> - -<h3>3.2.1</h3> - -<ul> - <li>Attachments, charts, and graphs would sometimes be garbled on Windows. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=464992">[% terms.Bug %] 464992</a>)</li> - - <li>Saving changes to parameters would sometimes fail silently (particularly - on Windows when the web server didn't have the right permissions to - update the <code>params</code> file). [% terms.Bugzilla %] will now - throw an error in this case, telling you what is wrong. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=347707">[% terms.Bug %] 347707</a>)</li> - - <li>If you were using the <code>usemenuforusers</code> parameter, - and [% terms.abug %] was assigned to (or had a QA Contact of) a disabled - user, that field would be reset to the first user in the list when - updating [% terms.abug %]. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=465589">[% terms.Bug %] 465589</a>)</li> - - <li>If you were using the <code>PROJECT</code> environment variable - to have multiple [% terms.Bugzilla %] installations using one codebase, - project-specific templates were being ignored. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=467324">[% terms.Bug %] 467324</a>)</li> - - <li>Some versions of the SOAP::Lite Perl module had a b[% %]ug that caused - [%+ terms.Bugzilla %]'s XML-RPC service to break. - <kbd>checksetup.pl</kbd> now checks for these bad versions and - will reject them. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=468009">[% terms.Bug %] 468009</a>)</li> - - <li>The font sizes in various places were too small, when using the - Classic skin. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=469136">[% terms.Bug %] 469136</a>)</li> -</ul> - -<h2 id="v32_security">Security Fixes In This 3.2.x Release</h2> - -<h3>3.2.3</h3> - -<p>This release fixes one security issue related to attachments. See the - <a href="http://www.bugzilla.org/security/3.2.2/">Security Advisory</a> - for details.</p> - -<h3>3.2.2</h3> - -<p>This release fixes one security issue that is critical for installations - running 3.2.1 under mod_perl. See the - <a href="http://www.bugzilla.org/security/3.0.7/">Security Advisory</a> - for details.</p> - -<h3>3.2.1</h3> - -<p>This release contains several security fixes. One fix may break any - automated scripts you have that are loading <kbd>process_bug.cgi</kbd> - directly. We recommend that you read the entire - <a href="http://www.bugzilla.org/security/2.22.6/">Security Advisory</a> - for this release.</p> - -<h2 id="v32_req">Minimum Requirements</h2> - -<p>Any requirements that are new since 3.0.5 will look like - <span class="req_new">this</span>.</p> - -<ul> - <li><a href="#v32_req_perl">Perl</a></li> - <li><a href="#v32_req_mysql">For MySQL Users</a></li> - <li><a href="#v32_req_pg">For PostgreSQL Users</a></li> - <li><a href="#v32_req_oracle">For Oracle Users</a></li> - <li><a href="#v32_req_modules">Required Perl Modules</a></li> - <li><a href="#v32_req_optional_mod">Optional Perl - Modules</a></li> -</ul> - -<h3 id="v32_req_perl">Perl</h3> - -<p>Perl <span class="req_new">v<strong>5.8.1</strong></span></p> - -<h3 id="v32_req_mysql">For MySQL Users</h3> - -<ul> - <li>MySQL v4.1.2</li> - <li><strong>perl module:</strong> - DBD::mysql <span class="req_new">v4.00</span></li> -</ul> - -<h3 id="v32_req_pg">For PostgreSQL Users</h3> - -<ul> - <li>PostgreSQL v8.00.0000</li> - <li><strong>perl module:</strong> DBD::Pg v1.45</li> -</ul> - -<h3 id="v32_req_oracle">Email Addresses Hidden From Logged-Out Users - For Oracle Users</h3> - -<ul> - <li>Oracle v10.02.0</li> - <li><strong>perl module:</strong> DBD::Oracle v1.19</li> -</ul> - -<h3 id="v32_req_modules">Required Perl Modules</h3> - -<table class="req_table" border="0" cellpadding="0" cellspacing="0"> -<tr> <th>Module</th> <th>Version</th> </tr> -<tr> <td>CGI</td> <td class="req_new">3.21 (on Perl 5.8.x) - or 3.33 (on Perl 5.10.x)</td> </tr> -<tr> <td>Date::Format</td> <td>2.21</td> </tr> -<tr> <td>File::Spec</td> <td>0.84</td> </tr> -<tr> <td>DBI</td> <td>1.41</td> </tr> -<tr> <td>Template</td> <td class="req_new">2.15</td> </tr> -<tr> <td>Email::Send</td> <td>2.00</td> </tr> -<tr> <td>Email::MIME</td> <td class="req_new">1.861</td> </tr> -<tr> - <td class="req_new">Email::MIME::Encodings</td> - <td class="req_new">1.313</td> -</tr> -<tr> - <td>Email::MIME::Modifier</td> - <td class="req_new">1.442</td> -</tr> -</table> - -<h3 id="v32_req_optional_mod">Optional Perl Modules</h3> - -<p>The following perl modules, if installed, enable various - features of [% terms.Bugzilla %]:</p> - -<table class="req_table" border="0" cellpadding="0" cellspacing="0"> -<tr> - <th>Module</th> - <th>Version</th> - <th>Enables Feature</th> -</tr> -<tr> - <td>LWP::UserAgent</td> - <td>(Any)</td> - <td>Automatic Update Notifications</td> -</tr> -<tr> - <td>Template::Plugin::GD::Image</td> - <td>(Any)</td> - <td>Graphical Reports</td> -</tr> -<tr> - <td>GD::Text</td> - <td>(Any)</td> - <td>Graphical Reports</td> -</tr> -<tr> - <td>GD::Graph</td> - <td>(Any)</td> - <td>Graphical Reports</td> -</tr> -<tr> - <td>GD</td> - <td>1.20</td> - <td>Graphical Reports, New Charts, Old Charts</td> -</tr> -<tr> - <td>Email::MIME::Attachment::Stripper</td> - <td>(Any)</td> - <td>Inbound Email</td> -</tr> -<tr> - <td>Email::Reply</td> - <td>(Any)</td> - <td>Inbound Email</td> -</tr> -<tr> - <td>Net::LDAP</td> - <td>(Any)</td> - <td>LDAP Authentication</td> -</tr> -<tr> - <td>HTML::Parser</td> - <td>3.40</td> - <td>More HTML in Product/Group Descriptions</td> -</tr> -<tr> - <td>HTML::Scrubber</td> - <td>(Any)</td> - <td>More HTML in Product/Group Descriptions</td> -</tr> -<tr> - <td>XML::Twig</td> - <td>(Any)</td> - <td>Move [% terms.Bugs %] Between Installations</td> -</tr> -<tr> - <td>MIME::Parser</td> - <td>5.406</td> - <td>Move [% terms.Bugs %] Between Installations</td> -</tr> -<tr> - <td>Chart::Base</td> - <td>1.0</td> - <td>New Charts, Old Charts</td> -</tr> -<tr> - <td>Image::Magick</td> - <td>(Any)</td> - <td>Optionally Convert BMP Attachments to PNGs</td> -</tr> -<tr> - <td>PatchReader</td> - <td>0.9.4</td> - <td>Patch Viewer</td> -</tr> -<tr> - <td class="req_new">Authen::Radius</td> - <td class="req_new">(Any)</td> - <td>RADIUS Authentication</td> -</tr> -<tr> - <td class="req_new">Authen::SASL</td> - <td class="req_new">(Any)</td> - <td>SMTP Authentication</td> -</tr> -<tr> - <td>SOAP::Lite</td> - <td>(Any)</td> - <td>XML-RPC Interface</td> -</tr> -<tr> - <td>mod_perl2</td> - <td>1.999022</td> - <td>mod_perl</td> -</tr> -</table> - -<h2 id="v32_feat">New Features and Improvements</h2> - -<ul> - <li><a href="#v32_feat_ui">Major UI Improvements</a></li> - <li><a href="#v32_feat_skin">New Default Skin: Dusk</a></li> - <li><a href="#v32_feat_status">Custom Status Workflow</a></li> - <li><a href="#v32_feat_fields">New Custom Field Types</a></li> - <li><a href="#v32_feat_install">Easier Installation</a></li> - <li><a href="#v32_feat_oracle">Experimental Oracle Support</a></li> - <li><a href="#v32_feat_utf8">Improved UTF-8 Support</a></li> - <li><a href="#v32_feat_grcons">Group Icons</a></li> - <li><a href="#v32_feat_other">Other Enhancements and Changes</a></li> -</ul> - -<h3 id="v32_feat_ui">Major UI Improvements</h3> - -<p>[% terms.Bugzilla %] 3.2 has had some UI assistance from the NASA - Human-Computer Interaction department and the new - <a href="http://wiki.mozilla.org/Bugzilla:UE">[% terms.Bugzilla %] - User Interface Team</a>.</p> - -<p>In particular, you will notice a massively redesigned [% terms.bug %] - editing form, in addition to our <a href="#v32_feat_skin">new skin</a>.</p> - -<h3 id="v32_feat_skin">New Default Skin: Dusk</h3> - -<p>[% terms.Bugzilla %] 3.2 now ships with a skin called "Dusk" that is - a bit more colorful than old default "Classic" skin.</p> - -<p>Upgrading installations will still default to the "Classic" - skin--administrators can change the default in the Default Preferences - control panel. Users can also choose to use the old skin in their - Preferences (or using the View :: Page Style menu in Firefox).</p> - -<p>The changes that [% terms.Bugzilla %] required for Dusk made - [%+ terms.Bugzilla %] much easier to skin. See the - <a href="http://wiki.mozilla.org/Bugzilla:Addons#Skins">Addons page</a> - for additional skins, or try making your own!</p> - -<h3 id="v32_feat_status">Custom Status Workflow</h3> - -<p>You can now customize the list of statuses in [% terms.Bugzilla %], - and transitions between them.</p> - -<p>You can also specify that a comment must be made on certain transitions.</p> - -<h3 id="v32_feat_fields">New Custom Field Types</h3> - -<p>[% terms.Bugzilla %] 3.2 has support for three new types of - custom fields:</p> - -<ul> - <li>Large Text: Adds a multi-line textbox to your [% terms.bugs %].</li> - <li>Multiple Selection Box: Adds a box that allows you to choose - multiple items from a list.</li> - <li>Date/Time: Displays a date and time, along with a JavaScript - calendar popup to make picking a date easier.</li> -</ul> - -<h3 id="v32_feat_install">Easier Installation</h3> - -<p>[% terms.Bugzilla %] now comes with a script called - <kbd>install-module.pl</kbd> that can automatically download - and install all of the required Perl modules for [% terms.Bugzilla %]. - It stores them in a directory inside your [% terms.Bugzilla %] - installation, so you can use it even if you don't have administrator-level - access to your machine, and without modifying your main Perl install.</p> - -<p><kbd>checksetup.pl</kbd> will print out instructions for using - <kbd>install-module.pl</kbd>, or you can read its - <a href="[% docs_urlbase FILTER html %]api/install-module.html">documentation</a>.</p> - -<h3 id="v32_feat_oracle">Experimental Oracle Support</h3> - -<p>[% terms.Bugzilla %] 3.2 contains experimental support for using - Oracle as its database. Some features of [% terms.Bugzilla %] are known - to be broken on Oracle, but hopefully will be working by our next major - release.</p> - -<p>The [% terms.Bugzilla %] Project, as an open-source project, of course - does not recommend the use of proprietary database solutions. However, - if your organization requires that you use Oracle, this will allow - you to use [% terms.Bugzilla %]!</p> - -<p>The [% terms.Bugzilla %] Project thanks Oracle Corp. for their extensive - development contributions to [% terms.Bugzilla %] which allowed this to - happen!</p> - -<h3 id="v32_feat_utf8">Improved UTF-8 Support</h3> - -<p>[% terms.Bugzilla %] 3.2 now has advanced UTF-8 support in its code, - including correct handling for truncating and wrapping multi-byte - languages. Major issues with multi-byte or unusual languages - are now resolved, and [% terms.Bugzilla %] should now be usable - by users in every country with little (or at least much less) - customization.</p> - -<h3 id="v32_feat_grcons">Group Icons</h3> - -<p>Administrators can now specify that users who are in certain groups - should have an icon appear next to their name whenever they comment. - This is particularly useful for distinguishing developers from - [%+ terms.bug %] reporters.</p> - -<h3 id="v32_feat_other">Other Enhancements and Changes</h3> - -<p>These are either minor enhancements, or enhancements that have - very short descriptions. Some of these are very useful, though!</p> - -<h4>Enhancements For Users</h4> - -<ul> - <li><strong>[% terms.Bugs %]</strong>: You can now reassign - [%+ terms.abug %] at the same time as you are changing its status.</li> - <li><strong>[% terms.Bugs %]</strong>: When entering [% terms.abug %], - you will now see the description of a component when you select it.</li> - <li><strong>[% terms.Bugs %]</strong>: The [% terms.bug %] view now - contains some <a href="http://microformats.org/about/">Microformats</a>, - most notably for users' names and email addresses.</li> - <li><strong>[% terms.Bugs %]</strong>: You can now remove a QA Contact - from [% terms.abug %] simply by clearing the QA Contact field.</li> - <li><strong>[% terms.Bugs %]</strong>: There is now a user preference - that will allow you to exclude the quoted text when replying - to comments.</li> - <li><strong>[% terms.Bugs %]</strong>: You can now expand or collapse - individual comments in the [% terms.bug %] view.</li> - - <li><strong>Attachments</strong>: There is now "mid-air collision" - protection when editing attachments.</li> - <li><strong>Attachments</strong>: Patches in the Diff Viewer now show - line numbers (<a href="https://bugzilla.mozilla.org/attachment.cgi?id=327546">Example</a>).</li> - <li><strong>Attachments</strong>: After creating or updating an attachment, - you will be immediately shown the [% terms.bug %] that the attachment - is on.</li> - - <li><strong>Search</strong>: You can now reverse the sort of - [%+ terms.abug %] list by clicking on a column header again.</li> - <li><strong>Search</strong>: Atom feeds of [% terms.bug %] lists now - contain more fields.</li> - <li><strong>Search</strong>: QuickSearch now supports searching flags - and groups. It also now includes the OS field in the list of fields - it searches by default.</li> - <li><strong>Search</strong>: "Help" text can now appear on query.cgi - for Internet Explorer and other non-Firefox browsers. (It always - could appear for Firefox.)</li> - - <li>[% terms.Bugzilla %] now ships with an icon that will show - up next to the URL in most browsers. If you want to replace it, - it's in <kbd>images/favicon.ico</kbd>.</li> - - <li>You can now set the Deadline when using "Change Several - [%+ terms.Bugs %] At Once"</li> - <li><strong>Saved Searches</strong> now save their column list, so if - you customize the list of columns and save your search, it will - always contain those columns.</li> - <li><strong>Saved Searches</strong>: When you share a search, you can - now see how many users have subscribed to it, on - <kbd>userprefs.cgi</kbd>.</li> - <li><strong>Saved Searches</strong>: You can now see what group a - shared search was shared to, on the list of available shared searches - in <kbd>userprefs.cgi</kbd>.</li> - <li><strong>Flags</strong>: If your installation uses drop-down user - lists, the flag requestee box will now contain only users who are - actually allowed to take requests.</li> - <li><strong>Flags</strong>: If somebody makes a request to you, and you - change the requestee to somebody else, the requester is no longer set - to you. In other words, you can "redirect" requests and maintain the - original requester.</li> - <li><strong>Flags</strong>: Emails about flags now will thread properly - in email clients to be a part of [% terms.abug %]'s thread.</li> - <li>When using <kbd>email_in.pl</kbd>, you can now add users to the CC - list by just using <kbd>@cc</kbd> as the field name.</li> - <li>Many pages (particularly administrative pages) now contain links to - the relevant section of the [% terms.Bugzilla %] Guide, so you can read - the documentation for that page.</li> - <li>Dependency Graphs should render more quickly, as they now (by default) - only include the same [% terms.bugs %] that you'd see in the dependency - tree.</li> -</ul> - -<h4>Enhancements For Administrators</h4> - -<ul> - <li><strong>Admin UI</strong>: Instead of having the Administration - Control Panel links in the footer, there is now just one link called - "Administration" that takes you to a page that links to all the - administrative controls for [% terms.Bugzilla %].</li> - <li><strong>Admin UI</strong>: Administrative pages no longer display - confirmation pages, instead they redirect you to some useful page - and display a message about what changed.</li> - <li><strong>Admin UI</strong>: The interface for editing group - inheritance in <kbd>editgroups.cgi</kbd> is much clearer now.</li> - <li><strong>Admin UI</strong>: When editing a user, you can now see - all the components where that user is the Default Assignee or Default - QA Contact.</li> - - <li><strong>Email</strong>: For installations that use SMTP to send - mail (as opposed to Sendmail), [%+ terms.Bugzilla %] now supports - SMTP Authentication, so that it can log in to your mail server - before sending messages.</li> - <li><strong>Email</strong>: Using the "Test" mail delivery method now - creates a valid mbox file to make testing easier.</li> - - <li><strong>Authentication</strong>: [% terms.Bugzilla %] now correctly - handles LDAP records which contain multiple email addresses. (The first - email address in the list that is a valid [% terms.Bugzilla %] account - will be used, or if this is a new user, the first email address in - the list will be used.)</li> - <li><strong>Authentication</strong>: [% terms.Bugzilla %] can now take - a list of LDAP servers to try in order until it gets a successful - connection.</li> - <li><strong>Authentication</strong>: [% terms.Bugzilla %] now supports - RADIUS authentication.</li> - - <li><strong>Security</strong>: The login cookie is now created as - "HTTPOnly" so that it can't be read by possibly malicious scripts. - Also, if SSL is enabled on your installation, the login cookie is - now only sent over SSL connections.</li> - <li><strong>Security</strong>: The <code>ssl</code> parameter now protects - every page a logged-in user accesses, when set to "authenticated sessions." - Also, SSL is now enforced appropriately in the WebServices interface when - the parameter is set.</li> - - <li><strong>Database</strong>: [% terms.Bugzilla %] now uses transactions in - the database instead of table locks. This should generally improve - performance with many concurrent users. It also means if there is - an unexpected error in the middle of a page, all database changes made - during that page will be rolled back.</li> - <li><strong>Database</strong>: You no longer have to set - <code>max_packet_size</code> in MySQL to add large attachments. However, - you may need to set it manually if you restore a mysqldump into your - database.</li> - - <li>New WebService functions: - <a href="[% docs_urlbase FILTER html %]api/Bugzilla/WebService/Bug.html">B<!-- -->ug.add_comment</a> - and <a href="[% docs_urlbase FILTER html %]api/Bugzilla/WebService/Bugzilla.html">Bugzilla.extensions</a>.</li> - - <li>You can now delete custom fields, but only if they have never been - set on any [% terms.bug %].</li> - <li>There is now a <kbd>--reset-password</kbd> argument to - <kbd>checksetup.pl</kbd> that allows you to reset a user's password - from the command line.</li> - <li>There is now a script called <kbd>sanitycheck.pl</kbd> that you can - run from the command line. It works just like <kbd>sanitycheck.cgi</kbd>. - By default, it only outputs anything if there's an error, so it's - ideal for administrators who want to run it nightly in a cron job.</li> - <li>The <kbd>strict_isolation</kbd> parameter now prevents you from setting - users who cannot see [% terms.abug %] as a CC, Assignee, or QA - Contact. Previously it only prevented you from adding users who - could not <em>edit</em> the [% terms.bug %].</li> - <li>Extensions can now add their own headers to the HTML <head> - for things like custom CSS and so on.</li> - <li><kbd>sanitycheck.cgi</kbd> has been templatized, meaning that the - entire [% terms.Bugzilla %] UI is now contained in templates.</li> - <li>When setting the <kbd>sslbase</kbd> parameter, you can now specify - a port number in the URL.</li> - <li>When importing [% terms.bugs %] using <kbd>importxml.pl</kbd>, - attachments will have their actual creator set as their creator, - instead of the person who exported the [% terms.bug %] from the other - system.</li> - <li>The voting system is off by default in new installs. This is to - prepare for the fact that it will be moved into an extension at - some point in the future.</li> - <li>The <code>shutdownhtml</code> parameter now works even when - [%+ terms.Bugzilla %]'s database server is down.</li> -</ul> - -<h3>Enhancements for Localizers (or Localized Installations)</h3> - -<ul> - <li>The documentation can now be localized--in other words, you can have - documentation installed for multiple languages at once and - [%+ terms.Bugzilla %] will link to the correct language in its internal - documentation links.</li> - <li>[% terms.Bugzilla %] no longer uses the <kbd>languages</kbd> parameter. - Instead it reads the <kbd>template/</kbd> directory to see which - languages are available.</li> - <li>Some of the messages printed by <kbd>checksetup.pl</kbd> can now - be localized. See <kbd>template/en/default/setup/strings.txt.pl</kbd>. -</ul> - -<h2 id="v32_issues">Outstanding Issues</h2> - -<ul> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=423439"> - [%- terms.Bug %] 423439</a>: Tabs in comments will be converted - to four spaces, due to a b<!-- -->ug in Perl as of Perl 5.8.8.</li> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=69621"> - [%- terms.Bug %] 69621</a>: If you rename or remove a keyword that is - in use on [% terms.bugs %], you will need to rebuild the "keyword cache" - by running <a href="sanitycheck.cgi">sanitycheck.cgi</a> and choosing - the option to rebuild the cache when it asks. Otherwise keywords may - not show up properly in search results.</li> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=89822"> - [%- terms.Bug %] 89822</a>: When changing multiple [% terms.bugs %] at - the same time, there is no "mid-air collision" protection.</li> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=276230"> - [%- terms.Bug %] 276230</a>: The support for restricting access to - particular Categories of New Charts is not complete. You should treat - the 'chartgroup' Param as the only access mechanism available.<br> - However, charts migrated from Old Charts will be restricted to - the groups that are marked MANDATORY for the corresponding Product. - There is currently no way to change this restriction, and the - groupings will not be updated if the group configuration - for the Product changes.</li> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=370370"> - [%- terms.Bug %] 370370</a>: mod_perl support is currently not - working on Windows machines.</li> -</ul> - -<h2 id="v32_upgrading">How to Upgrade From An Older Version</h2> - -<h3 id="v32_upgrading_notes">Notes For Upgraders</h3> - -<ul> - <li>If you upgrade by CVS, the <kbd>extensions</kbd> and - <kbd>skins/contrib</kbd> directories are now in CVS instead of - being created by <kbd>checksetup.pl</kbd> If you do a <kbd>cvs update</kbd> - from 3.0, you will be told that your directories are "in the way" and - you should delete (or move) them and then do <kbd>cvs update</kbd> - again. Also, the <kbd>docs</kbd> directory has been restructured - and after you <kbd>cvs update</kbd> you can delete the <kbd>docs/html</kbd>, - <kbd>docs/pdf</kbd>, <kbd>docs/txt</kbd>, and <kbd>docs/xml</kbd> - directories.</li> - <li>If you are using MySQL, you should know that [% terms.Bugzilla %] - now uses InnoDB for all tables. <kbd>checksetup.pl</kbd> will convert - your tables automatically, but if you have InnoDB disabled, - the upgrade will not be able to complete (and <kbd>checksetup.pl</kbd> - will tell you so).</li> - - <li><strong>You should also read the - <a href="#v30_upgrading_notes">[% terms.Bugzilla %] 3.0 Notes For Upgraders - section</a> of the - <a href="#v32_previous">previous release notes</a> if you are upgrading - from a version before 3.0.</strong></li> -</ul> - -<h3>Steps For Upgrading</h3> - -<p>Once you have read the notes above, see the - <a href="[% docs_urlbase FILTER html %]upgrade.html">Upgrading - documentation</a> for instructions on how to upgrade.</p> - -<h2 id="v32_code_changes">Code Changes Which May Affect Customizations</h2> - -<ul> - <li><a href="#v32_code_hooks">More Hooks!</a></li> - <li><a href="#v32_code_search">Search.pm Rearchitecture</a></li> - <li><a href="#v32_code_lib">lib Directory</a></li> - <li><a href="#v32_code_other">Other Changes</a></li> -</ul> - -<h3 id="v32_code_hooks">More Hooks!</h3> - -<p>There are more code hooks in 3.2 than there were in 3.0. See the - documentation of <a href="[% docs_urlbase FILTER html %]api/Bugzilla/Hook.html">Bugzilla::Hook</a> - for more details.</p> - -<h3 id="v32_code_search">Search.pm Rearchitecture</h3> - -<p><kbd>Bugzilla/Search.pm</kbd> has been heavily modified, to be much - easier to read and use. It contains mostly the same code as it did in - 3.0, but it has been moved around and reorganized significantly.</p> - -<h3 id="v32_code_lib">lib Directory</h3> - -<p>As part of implementing <a href="#v32_feat_install">install-module.pl</a>, - [%+ terms.Bugzilla %] was given a local <kbd>lib</kbd> directory which - it searches for modules, in addition to the standard system path.</p> - -<p>This means that all [% terms.Bugzilla %] scripts now start with - <code>use lib qw(. lib);</code> as one of the first lines.</p> - -<h3 id="v32_code_other">Other Changes</h3> - -<ul> - <li>You should now be using <code>get_status('NEW')</code> instead of - <code>status_descs.NEW</code> in templates.</li> - <li>The <code>[%# version = 1.0 %]</code> comment at the top of every - template file has been removed.</li> -</ul> - -<h1 id="v32_previous">[% terms.Bugzilla %] 3.0.x Release Notes</h1> - -<h2>Table of Contents</h2> - -<ul class="bz_toc"> - <li><a href="#v30_introduction">Introduction</a></li> - <li><a href="#v30_point">Updates In This 3.0.x Release</a></li> - <li><a href="#v30_req">Minimum Requirements</a></li> - <li><a href="#v30_feat">New Features and Improvements</a></li> - <li><a href="#v30_issues">Outstanding Issues</a></li> - <li><a href="#v30_security">Security Fixes In This Release</a></li> - <li><a href="#v30_upgrading">How to Upgrade From An Older Version</a></li> - <li><a href="#v30_code_changes">Code Changes Which May Affect - Customizations</a></li> - <li><a href="#v30_previous">Release Notes for Previous Versions</a></li> -</ul> - -<h2 id="v30_introduction">Introduction</h2> - -<p>Welcome to [% terms.Bugzilla %] 3.0! It's been over eight years since - we released [% terms.Bugzilla %] 2.0, and everything has changed since - then. Even just since our previous release, [% terms.Bugzilla %] 2.22, - we've added a <em>lot</em> of new features. So enjoy the release, we're - happy to bring it to you.</p> - -<p>If you're upgrading, make sure to read <a href="#v30_upgrading">How to - Upgrade From An Older Version</a>. If you are upgrading from a release - before 2.22, make sure to read the release notes for all the - <a href="#v30_previous">previous versions</a> in between your version - and this one.</p> - -<h2 id="v30_point">Updates in this 3.0.x Release</h2> - -<p>This section describes what's changed in the most recent b<!-- -->ug-fix - releases of [% terms.Bugzilla %] after 3.0. We only list the - most important fixes in each release. If you want a detailed list of - <em>everything</em> that's changed in each version, you should use our - <a href="http://www.bugzilla.org/status/changes.html">Change Log Page</a>.</p> - -<h3>3.0.6</h3> - -<ul> - <li>Before 3.0.6, unexpected fatal WebService errors would result in - a <code>faultCode</code> that was a string instead of a number. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=446327">[% terms.Bug %] 446327</a>)</li> - <li>If you created a product or component with the same name as one you - previously deleted, it would fail with an error about the series table. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=247936">[% terms.Bug %] 247936</a>)</li> -</ul> - -<p>See also the <a href="#v30_security">Security Advisory</a> section for - information about a security issue fixed in this release.</p> - -<h3>3.0.5</h3> - -<ul> - <li>If you don't have permission to set a flag, it will now appear - unchangeable in the UI. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=433851">[% terms.Bug %] 433851</a>)</li> - <li>If you were running mod_perl, [% terms.Bugzilla %] was not correctly - closing its connections to the database since 3.0.3, and so sometimes - the DB would run out of connections. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=441592">[% terms.Bug %] 441592</a>)</li> - <li>The installation script is now clear about exactly which - <code>Email::</code> modules are required in Perl, thus avoiding the - problem where emails show up with a body like - <samp>SCALAR(0xBF126795)</samp>. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=441541">[% terms.Bug %] 441541</a>)</li> - <li><a href="[% docs_urlbase FILTER html %]api/email_in.html">email_in.pl</a> - is no longer case-sensitive for values of <kbd>@product</kbd>. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=365697">[% terms.Bug %] 365697</a>)</li> -</ul> - -<p>See also the <a href="#v30_security">Security Advisory</a> section for - information about security issues fixed in this release.</p> - -<h3>3.0.4</h3> - -<ul> - <li>[% terms.Bugzilla %] administrators were not being correctly notified - about new releases. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=414726">[% terms.Bug %] 414726</a>)</li> - - <li>There could be extra whitespace in email subject lines. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=411544">[% terms.Bug %] 411544</a>)</li> - - <li>The priority, severity, OS, and platform fields were always required by - the <kbd>B<!-- -->ug.create</kbd> WebService function, even if they had - defaults specified. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=384009">[% terms.Bug %] 384009</a>)</li> - - <li>Better threading of [% terms.bug %]mail in some email clients. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=376453">[% terms.Bug %] 376453</a>)</li> - - <li>There were many fixes to the Inbound Email Interface - (<kbd>email_in.pl</kbd>). - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=92274">[% terms.Bug %] 92274</a>, - <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=377025">[% terms.Bug %] 377025</a>, - <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=412943">[% terms.Bug %] 412943</a>, - <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=413672">[% terms.Bug %] 413672</a>, and - <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=431721">[% terms.Bug %] 431721</a>)</li> - - <li><kbd>checksetup.pl</kbd> now handles UTF-8 conversion more reliably during upgrades. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=374951">[% terms.Bug %] 374951</a>)</li> - - <li>Comments written in CJK languages are now correctly word-wrapped. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=388723">[% terms.Bug %] 388723</a>)</li> - - <li>All emails will now be sent in the correct language, when the user - has chosen a language for emails. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=405946">[% terms.Bug %] 405946</a>) - - <li>On Windows, temporary files created when uploading attachments are now - correctly deleted when the upload is complete. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=414002">[% terms.Bug %] 414002</a>)</li> - - <li><kbd>checksetup.pl</kbd> now prints correct installation instructions - for Windows users using Perl 5.10. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=414430">[% terms.Bug %] 414430</a>) -</ul> - -<p>See also the <a href="#v30_security">Security Advisory</a> section for - information about security issues fixed in this release.</p> - -<h3>3.0.3</h3> - -<ul> - <li>mod_perl no longer compiles [% terms.Bugzilla %]'s code for each Apache - process individually. It now compiles code only once and shares it among - each Apache process. This greatly improves performance and highly - decreases the memory footprint. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=398241">[% terms.Bug %] 398241</a>)</li> - - <li>You can now search for '---' (without quotes) in versions and milestones. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=362436">[% terms.Bug %] 362436</a>)</li> - - <li>[% terms.Bugzilla %] should no longer break lines unnecessarily in - email subjects. This was causing trouble with some email clients. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=374424">[% terms.Bug %] 374424</a>)</li> - - <li>If you had selected "I'm added to or removed from this capacity" option - for the "CC" role in your email preferences, you wouldn't get mail when - more than one person was added to the CC list at once. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=394796">[% terms.Bug %] 394796</a>)</li> - - <li>Deleting a user account no longer deletes whines from another user who - has the deleted account as addressee. The schedule is simply removed, - but the whine itself is left intact. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=395924">[% terms.Bug %] 395924</a>)</li> - - <li><kbd>contrib/merge-users.pl</kbd> now correctly merges all required - fields when merging two user accounts. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=400160">[% terms.Bug %] 400160</a>)</li> - - <li>[% terms.Bugzilla %] no longer requires Apache::DBI to run under - mod_perl. It caused troubles such as lost connections with the DB and - didn't give any important performance gain. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=408766">[% terms.Bug %] 408766</a>)</li> -</ul> - -<h3>3.0.2</h3> - -<ul> - <li>[% terms.Bugzilla %] should now work on Perl 5.9.5 (and thus the - upcoming Perl 5.10.0). - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=390442">[% terms.Bug %] 390442</a>)</li> -</ul> - -<p>See also the <a href="#v30_security">Security Advisory</a> section for - information about an important security issue fixed in this release.</p> - -<h3>3.0.1</h3> - -<ul> - <li>For users of Firefox 2, the <code>show_bug.cgi</code> user interface - should no longer "collapse" after you modify [% terms.abug %]. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=370739">[% terms.Bug %] 370739</a>)</li> - <li>If you can bless a group, and you share a saved search with that - group, it will no longer automatically appear in all of that group's - footers unless you specifically request that it automatically appear - in their footers. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=365890">[% terms.Bug %] 365890</a>)</li> - <li>There is now a parameter to allow users to perform searches without - any search terms. (In other words, to search for just a Product - and Status on the Simple Search page.) The parameter is called - <code>specific_search_allow_empty_words</code>. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=385910">[% terms.Bug %] 385910</a>)</li> - <li>If you attach a file that has a MIME-type of <code>text/x-patch</code> - or <code>text/x-diff</code>, it will automatically be treated as a - patch by [% terms.Bugzilla %]. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=365756">[% terms.Bug %] 365756</a>)</li> - <li>Dependency Graphs now work correctly on all mod_perl installations. - There should now be no remaining signficant problems with running - [%+ terms.Bugzilla %] under mod_perl. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=370398">[% terms.Bug %] 370398</a>)</li> - <li>If moving [% terms.abug %] between products would remove groups - from the [% terms.bug %], you are now warned. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=303183">[% terms.Bug %] 303183</a>)</li> - <li>On IIS, whenever [% terms.Bugzilla %] threw a warning, it would - actually appear on the web page. Now warnings are suppressed, - unless you have a file in the <code>data</code> directory called - <code>errorlog</code>, in which case warnings will be printed there. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=390148">[% terms.Bug %] 390148</a>)</li> - <li>If you used <kbd>email_in.pl</kbd> to edit [% terms.abug %] that was - protected by groups, all of the groups would be cleared. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=385453">[% terms.Bug %] 385453</a>)</li> - <li>PostgreSQL users: New Charts were failing to collect data over time. - They will now start collecting data correctly. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=257351">[% terms.Bug %] 257351</a>)</li> - <li>Some flag mails didn't specify who the requestee was. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=379787">[% terms.Bug %] 379787</a>)</li> - <li>Instead of throwing real errors, <kbd>collectstats.pl</kbd> would - just say that it couldn't find <code>ThrowUserError</code>. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=380709">[% terms.Bug %] 380709</a>)</li> - <li>Logging into [% terms.Bugzilla %] from the home page works again - with IIS5. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=364008">[% terms.Bug %] 364008</a>)</li> - <li>If you were using SMTP for sending email, sometimes emails would - be missing the <code>Date</code> header. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=304999">[% terms.Bug %] 304999</a>).</li> - <li>In the XML-RPC WebService, <code>B<!-- -->ug.legal_values</code> now - correctly returns values for custom fields if you request values - for custom fields. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=381737">[% terms.Bug %] 381737</a>)</li> - <li>The "[% terms.Bug %]-Writing Guidelines" page has been shortened - and re-written. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=378590">[% terms.Bug %] 378590</a>)</li> - <li>If your <code>urlbase</code> parameter included a port number, - like <code>www.domain.com:8080</code>, SMTP might have failed. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=384501">[% terms.Bug %] 384501</a>)</li> - <li>For SMTP users, there is a new parameter, <code>smtp_debug</code>. - Turning on this parameter will log the full information about - every SMTP session to your web server's error log, to help with - debugging issues with SMTP. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=384497">[% terms.Bug %] 384497</a>)</li> - <li>If you are a "global watcher" (you get all mails from every - [%+ terms.bug %]), you can now see that in your Email Preferences. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=365302">[% terms.Bug %] 365302</a>)</li> - <li>The Status and Resolution of [% terms.bugs %] are now correctly - localized in CSV search results. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=389517">[% terms.Bug %] 389517</a>)</li> - <li>The "Subject" line of an email was being mangled if it contained - non-Latin characters. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=387860">[% terms.Bug %] 387860</a>)</li> - <li>Editing the "languages" parameter using <kbd>editparams.cgi</kbd> would - sometimes fail, causing [% terms.Bugzilla %] to throw an error. - (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=335354">[% terms.Bug %] 335354</a>)</li> -</ul> - -<h2 id="v30_req">Minimum Requirements</h2> - -<p>Any requirements that are new since 2.22 will look like - <span class="req_new">this</span>.</p> - -<ul> - <li><a href="#v30_req_perl">Perl</a></li> - <li><a href="#v30_req_mysql">For MySQL Users</a></li> - <li><a href="#v30_req_pg">For PostgreSQL Users</a></li> - <li><a href="#v30_req_modules">Required Perl Modules</a></li> - <li><a href="#v30_req_optional_mod">Optional Perl - Modules</a></li> -</ul> - - -<h3 id="v30_req_perl">Perl</h3> - -<ul> - <li>Perl <span class="req_new">v<strong>5.8.0</strong></span> (non-Windows - platforms)</li> - <li>Perl v<strong>5.8.1</strong> (Windows platforms)</li> -</ul> - -<h3 id="v30_req_mysql">For MySQL Users</h3> - -<ul> - <li>MySQL <span class="req_new">v4.1.2</span></li> - <li><strong>perl module:</strong> DBD::mysql v2.9003</li> -</ul> - -<h3 id="v30_req_pg">For PostgreSQL Users</h3> - -<ul> - <li>PostgreSQL v8.00.0000</li> - <li><strong>perl module:</strong> DBD::Pg v1.45</li> -</ul> - -<h3 id="v30_req_modules">Required Perl Modules</h3> - -<table class="req_table" border="0" cellspacing="0" cellpadding="0"> - <tr> - <th>Module</th> <th>Version</th> - </tr> - <tr><td>CGI</td> <td>2.93</td> - </tr> - <tr> - <td>Date::Format</td> <td>2.21</td> - </tr> - <tr> - <td>DBI</td> - <td class="req_new">1.41</td> - </tr> - <tr> - <td>File::Spec</td> <td>0.84</td> - </tr> - <tr> - <td>Template</td> <td>2.12</td> - </tr> - <tr> - <td class="req_new">Email::Send</td> - <td class="req_new">2.00</td> - </tr> - <tr> - <td>Email::MIME</td> - <td>1.861</td> - </tr> - <tr> - <td class="req_new">Email::MIME::Modifier</td> - <td class="req_new">1.442</td> - </tr> -</table> - -<h3 id="v30_req_optional_mod">Optional Perl Modules</h3> - -<p>The following perl modules, if installed, enable various - features of [% terms.Bugzilla %]:</p> - -<table class="req_table" border="0" cellspacing="0" cellpadding="0"> - <tr> - <th>Module</th> <th>Version</th> - <th>Enables Feature</th> - </tr> - <tr> - <td class="req_new">LWP::UserAgent</td> - <td class="req_new">(Any)</td> - <td>Automatic Update Notifications</td> - </tr> - <tr> - <td>Template::Plugin::GD::Image</td> - <td>(Any)</td> - <td>Graphical Reports</td> - </tr> - <tr> - <td>GD::Graph</td> - <td>(Any)</td> - <td>Graphical Reports</td> - </tr> - <tr> - <td>GD::Text</td> - <td>(Any)</td> - <td>Graphical Reports</td> - </tr> - <tr> - <td>GD</td> - <td>1.20</td> - <td>Graphical Reports, New Charts, Old Charts</td> - </tr> - <tr> - <td class="req_new">Email::MIME::Attachment::Stripper</td> - <td class="req_new">(Any)</td> - <td>Inbound Email</td> - </tr> - <tr> - <td class="req_new">Email::Reply</td> - <td class="req_new">(Any)</td> - <td>Inbound Email</td> - </tr> - <tr> - <td>Net::LDAP</td> - <td>(Any)</td> - <td>LDAP Authentication</td> - </tr> - <tr> - <td>HTML::Parser</td> - <td>3.40</td> - <td>More HTML in Product/Group Descriptions</td> - </tr> - <tr> - <td>HTML::Scrubber</td> - <td>(Any)</td> - <td>More HTML in Product/Group Descriptions</td> - </tr> - <tr> - <td>XML::Twig</td> - <td>(Any)</td> - <td>Move [% terms.Bugs %] Between Installations</td> - </tr> - <tr> - <td>MIME::Parser</td> - <td>5.406</td> - <td>Move [% terms.Bugs %] Between Installations</td> - </tr> - <tr> - <td>Chart::Base</td> - <td>1.0</td> - <td>New Charts, Old Charts</td> - </tr> - <tr> - <td>Image::Magick</td> - <td>(Any)</td> - <td>Optionally Convert BMP Attachments to PNGs</td> - </tr> - <tr> - <td>PatchReader</td> - <td>0.9.4</td> - <td>Patch Viewer</td> - </tr> - <tr> - <td class="req_new">SOAP::Lite</td> - <td class="req_new">(Any)</td> - <td>XML-RPC Interface</td> - </tr> - <tr> - <td class="req_new">mod_perl2</td> - <td class="req_new">1.999022</td> - <td>mod_perl</td> - </tr> - <tr> - <td> CGI</td> - <td>3.11</td> - <td>mod_perl</td> - </tr> -</table> - -<h2 id="v30_feat">New Features and Improvements</h2> - -<ul> - <li><a href="#v30_feat_cf">Custom Fields</a></li> - <li><a href="#v30_feat_mp">mod_perl Support</a></li> - <li><a href="#v30_feat_sq">Shared Saved Searches</a></li> - <li> - <a href="#v30_feat_afn">Attachments and Flags on New [% terms.Bugs %]</a> - </li> - <li><a href="#v30_feat_cr">Custom Resolutions</a></li> - <li><a href="#v30_feat_ppp">Per-Product Permissions</a></li> - <li><a href="#v30_feat_ui">User Interface Improvements</a></li> - <li><a href="#v30_feat_xml">XML-RPC Interface</a></li> - <li><a href="#v30_feat_skin">Skins</a></li> - <li><a href="#v30_feat_sbu">Unchangeable Fields Appear - Unchangeable</a></li> - <li><a href="#v30_feat_et">All Emails in Templates</a></li> - <li><a href="#v30_feat_df">No More Double-Filed [% terms.Bugs %]</a></li> - <li><a href="#v30_feat_cc">Default CC List for Components</a></li> - <li><a href="#v30_feat_emi">File/Modify [% terms.Bugs %] By Email</a></li> - <li><a href="#v30_feat_gw">Users Who Get All [% terms.Bug %] - Notifications</a></li> - <li><a href="#v30_feat_utf8">Improved UTF-8 Support</a></li> - <li><a href="#v30_feat_upda">Automatic Update Notification</a></li> - <li><a href="#v30_feat_welc">Welcome Page for New Installs</a></li> - <li><a href="#v30_feat_other">Other Enhancements and Changes</a></li> -</ul> - -<h3 id="v30_feat_cf">Custom Fields</h3> - -<p>[% terms.Bugzilla %] now includes very basic support for custom fields.</p> - -<p>Users in the <kbd>admin</kbd> group can add plain-text or drop-down - custom fields. You can edit the values available for drop-down fields - using the "Field Values" control panel.</p> - -<p>Don't add too many custom fields! It can make [% terms.Bugzilla %] - very difficult to use. Try your best to get along with the default - fields, and then if you find that you can't live without custom fields - after a few weeks of using [% terms.Bugzilla %], only then should you - start your custom fields.</p> - -<h3 id="v30_feat_mp">mod_perl Support</h3> - -<p>[% terms.Bugzilla %] 3.0 supports mod_perl, which allows for extremely - enhanced page-load performance. mod_perl trades memory usage for performance, - allowing near-instantaneous page loads, but using much more memory.</p> - -<p>If you want to enable mod_perl for your [% terms.Bugzilla %], we recommend - a minimum of 1.5GB of RAM, and for a site with heavy traffic, 4GB to 8GB.</p> - -<p>If performance isn't that critical on your installation, you don't - have the memory, or you are running some other web server than - Apache, [% terms.Bugzilla %] still runs perfectly as a normal CGI - application, as well.</p> - -<h3 id="v30_feat_sq">Shared Saved Searches</h3> - -<p>Users can now choose to "share" their saved searches - with a certain group. That group will then be able to - "subscribe" to those searches, and have them appear - in their footer.</p> - -<p>If the sharer can "bless" the group he's sharing to, - (that is, if he can add users to that group), it's considered - that he's a manager of that group, and his queries show up - automatically in that group's footer (although they can - unsubscribe from any particular search, if they want.)</p> - -<p>In order to allow a user to share their queries, they also - have to be a member of the group specified in the - <code>querysharegroup</code> parameter.</p> - -<p>Users can control their shared and subscribed queries from - the "Preferences" screen.</p> - -<h3 id="v30_feat_afn">Attachments and Flags on New [% terms.Bugs %]</h3> - -<p>You can now add an attachment while you are filing a new - [%+ terms.bug %].</p> - -<p>You can also set flags on the [% terms.bug %] and on attachments, while - filing a new [% terms.bug %].</p> - -<h3 id="v30_feat_cr">Custom Resolutions</h3> - -<p>You can now customize the list of resolutions available - in [% terms.Bugzilla %], including renaming the default resolutions.</p> - -<p>The resolutions <code>FIXED</code>, <code>DUPLICATE</code> - and <code>MOVED</code> have a special meaning to [% terms.Bugzilla %], - though, and cannot be renamed or deleted.</p> - -<h3 id="v30_feat_ppp">Per-Product Permissions</h3> - -<p>You can now grant users <kbd>editbugs</kbd> and <kbd>canconfirm</kbd> - for only certain products. You can also grant users <kbd>editcomponents</kbd> - on a product, which means they will be able to edit that product - including adding/removing components and other product-specific - controls.</p> - -<h3 id="v30_feat_ui">User Interface Improvements</h3> - -<p>There has been some work on the user interface for [% terms.Bugzilla %] 3.0, - including:</p> - -<ul> - <li>There is now navigation and a search box a the <em>top</em> of - each page, in addition to the bar at the bottom of the page.</li> - <li>A re-designed "Format for Printing" page for - [%+ terms.bugs %].</li> - <li>The layout of <kbd>show_bug.cgi</kbd> (the [% terms.bug %] editing - page) has been changed, and the attachment table has been redesigned.</li> -</ul> - -<h3 id="v30_feat_xml">XML-RPC Interface</h3> - -<p>[% terms.Bugzilla %] now has a Web Services interface using the XML-RPC - protocol. It can be accessed by external applications by going - to the <kbd>xmlrpc.cgi</kbd> on your installation.</p> - -<p>Documentation can be found in the - <a href="[% docs_urlbase FILTER html %]api/">[% terms.Bugzilla %] - API Docs</a>, in the various <kbd>Bugzilla::WebService</kbd> modules.</p> - -<h3 id="v30_feat_skin">Skins</h3> - -<p>[% terms.Bugzilla %] can have multiple "skins" installed, - and users can pick between them. To write a skin, you just have to - write several CSS files. See the <a href="[% docs_urlbase FILTER html %]cust-skins.html">Custom - Skins Documentation</a> for more details.</p> - -<p>We currently don't have any alternate skins shipping with - [%+ terms.Bugzilla %]. If you write an alternate skin, please - let us know!</p> - -<h3 id="v30_feat_sbu">Unchangeable Fields Appear Unchangeable</h3> - -<p>As long as you are logged in, when viewing [% terms.abug %], if you - cannot change a field, it will not look like you can change it. That - is, the value will just appear as plain text.</p> - -<h3 id="v30_feat_et">All Emails in Templates</h3> - -<p>All outbound emails are now controlled by the templating system. - What used to be the <code>passwordmail</code>, <code>whinemail</code>, - <code>newchangedmail</code> and <code>voteremovedmail</code> - parameters are now all templates in the <kbd>template/</kbd> directory.</p> - -<p>This means that it's now much easier to customize your outbound - emails, and it's also possible for localizers to have more - localized emails as part of their language packs, if they want.</p> - -<p>We also added a <code>mailfrom</code> parameter to let you set - who shows up in the <code>From</code> field on all emails that - [%+ terms.Bugzilla %] sends.</p> - -<h3 id="v30_feat_df">No More Double-Filed [% terms.Bugs %]</h3> - -<p>Users of [% terms.Bugzilla %] will sometimes accidentally submit - [%+ terms.abug %] twice, either by going back in their web browser, - or just by refreshing a page. In the past, this could file the same - [%+ terms.bug %] twice (or even three times) in a row, irritating - developers and confusing users.</p> - -<p>Now, if you try to submit [% terms.abug %] twice from the same screen - (by going back or by refreshing the page), [% terms.Bugzilla %] will warn - you about what you're doing, before it actually submits the duplicate - [%+ terms.bug %].</p> - -<h3 id="v30_feat_cc">Default CC List for Components</h3> - -<p>You can specify a list of users who will <em>always</em> be added to - the CC list of new [% terms.bugs %] in a component.</p> - -<h3 id="v30_feat_emi">File/Modify [% terms.Bugs %] By Email</h3> - -<p>You can now file or modify [% terms.bugs %] via email. Previous versions - of [% terms.Bugzilla %] included this feature only as an - unsupported add-on, but it is now an official interface to - [%+ terms.Bugzilla %].</p> - -<p>For more details see the <a href="[% docs_urlbase FILTER html %]api/email_in.html">documentation - for email_in.pl</a>.</p> - -<h3 id="v30_feat_gw">Users Who Get All [% terms.Bug %] Notifications</h3> - -<p>There is now a parameter called <kbd>globalwatchers</kbd>. This - is a comma-separated list of [% terms.Bugzilla %] users who will - get all [% terms.bug %] notifications generated by [% terms.Bugzilla %].</p> - -<p>Group controls still apply, though, so users who can't see [% terms.abug %] - still won't get notifications about that [% terms.bug %].</p> - -<h3 id="v30_feat_utf8">Improved UTF-8 Support</h3> - -<p>[% terms.Bugzilla %] users running MySQL should now have excellent - UTF-8 support if they turn on the <kbd>utf8</kbd> parameter. (New - installs have this parameter on by default.) [% terms.Bugzilla %] - now correctly supports searching and sorting in non-English languages, - including multi-bytes languages such as Chinese.</p> - -<h3 id="v30_feat_upda">Automatic Update Notification</h3> - -<p>If you belong to the <kbd>admin</kbd> group, you will be notified - when you log in if there is a new release of [% terms.Bugzilla %] - available to download.</p> - -<p>You can control these notifications by changing the - <kbd>upgrade_notification</kbd> parameter.</p> - -<p>If your [% terms.Bugzilla %] installation is on a machine that needs to go - through a proxy to access the web, you may also have to set the - <kbd>proxy_url</kbd> parameter.</p> - -<h3 id="v30_feat_welc">Welcome Page for New Installs</h3> - -<p>When you log in for the first time on a brand-new [% terms.Bugzilla %] - installation, you will be presented with a page that describes - where you should go from here, and what parameters you should set.</p> - -<h3 id="v30_feat_qs">QuickSearch Plugin for IE7 and Firefox 2</h3> - -<p>Firefox 2 users and Internet Explorer 7 users will be presented - with the option to add [% terms.Bugzilla %] to their search bar. - This uses the - <a href="page.cgi?id=quicksearch.html">QuickSearch syntax</a>.</p> - -<h3 id="v30_feat_other">Other Enhancements and Changes</h3> - -<p>These are either minor enhancements, or enhancements that have - very short descriptions. Some of these are very useful, though!</p> - -<h4>Enhancements That Affect [% terms.Bugzilla %] Users</h4> - -<ul> - <li>In comments, quoted text (lines that start with <kbd>></kbd>) - will be a different color from normal text.</li> - <li>There is now a user preference that will add you to the CC list - of any [% terms.bug %] you modify. Note that it's <strong>on</strong> - by default.</li> - <li>[% terms.Bugs %] can now be filed with an initial state of - <kbd>ASSIGNED</kbd>, if you are in the <kbd>editbugs</kbd> group.</li> - <li>By default, comment fields will zoom large when you are typing in them, - and become small when you move out of them. You can disable this - in your user preferences.</li> - <li>You can hide obsolete attachments on [% terms.abug %] by clicking - "Hide Obsolete" at the bottom of the attachment table.</li> - <li>If [% terms.abug %] has flags set, and you move it to a different - product that has flags with the same name, the flags will be - preserved.</li> - <li>You now can't request a flag to be set by somebody who can't set it - ([% terms.Bugzilla %] will throw an error if you try).</li> - <li>Many new headers have been added to outbound [% terms.Bugzilla %] - [%+ terms.bug %] emails: <code>X-Bugzilla-Status</code>, - <code>X-Bugzilla-Priority</code>, <code>X-Bugzilla-Assigned-To</code>, - <code>X-Bugzilla-Target-Milestone</code>, and - <code>X-Bugzilla-Changed-Fields</code>, <code>X-Bugzilla-Who</code>. - You can look at an email to get an idea of what they contain.</li> - <li>In addition to the old <code>X-Bugzilla-Reason</code> email header - which tells you why you got an email, if you got an email because - you were watching somebody, there is now an - <code>X-Bugzilla-Watch-Reason</code> header that tells you who you - were watching and what role they had.</li> - <li>If you hover your mouse over a full URL (like - <code>http://bugs.mycompany.com/show_bug.cgi?id=1212</code>) that - links to [% terms.abug %], you will see the title of the - [%+ terms.bug %]. Of course, this only works for [% terms.bugs %] in your - [%+ terms.Bugzilla %] installation.</li> - <li>If your installation has user watching enabled, you will now see - the users that you can remove from your watch-list as a multi-select - box, much like the current CC list. (Previously it was just a text - box.)</li> - <li>When a user creates their own account in [% terms.Bugzilla %], the - account is now not actually created until they verify their email - address by clicking on a link that is emailed to them.</li> - <li>You can change [% terms.abug %]'s resolution without reopening it.</li> - <li>When you view the dependency tree on [% terms.abug %], resolved - [%+ terms.bugs %] will be hidden by default. (In previous versions, - resolved [% terms.bugs %] were shown by default.)</li> - <li>When viewing [% terms.bug %] activity, fields that hold [% terms.bug %] - numbers (such as "Blocks") will have the [% terms.bug %] numbers - displayed as links to those [% terms.bugs %].</li> - <li>When viewing the "Keywords" field in [% terms.abug %] list, - it will be sorted alphabetically, so you can sanely sort a list on - that field.</li> - <li>In most places, the Version field is now sorted using a version-sort - (so 1.10 is greater than 1.2) instead of an alphabetical sort.</li> - <li>Options for flags will only appear if you can set them. So, for - example, if you can't grant <kbd>+</kbd> on a flag, that option - won't appear for you.</li> - <li>You can limit the product-related output of <kbd>config.cgi</kbd> - by specifying a <kbd>product=</kbd> URL argument, containing the name - of a product. You can specify the argument more than once for multiple - products.</li> - <li>You can now search the boolean charts on whether or not a comment - is private.</li> -</ul> - -<h4>Enhancements For Administrators</h4> - -<ul> - <li>Administrators can now delete attachments, making them disappear - entirely from [% terms.Bugzilla %].</li> - <li><kbd>sanitycheck.cgi</kbd> can now only be accessed by users - in the <kbd>editcomponents</kbd> group.</li> - <li>The "Field Values" control panel can now only be accessed - by users in the <kbd>admin</kbd> group. (Previously it was accessible - to anybody in the <kbd>editcomponents</kbd> group.)</li> - <li>There is a new parameter <kbd>announcehtml</kbd>, that will allow - you to enter some HTML that will be displayed at the top of every - page, as an announcement.</li> - <li>The <kbd>loginnetmask</kbd> parameter now defaults to 0 for new - installations, meaning that as long as somebody has the right - login cookie, they can log in from any IP address. This makes - life a lot easier for dial-up users or other users whose IP - changes a lot. This could be done because the login cookie is now - very random, and thus secure.</li> - <li>Classifications now have sortkeys, so they can be sorted in an - order that isn't alphabetical.</li> - <li>Authentication now supports LDAP over SSL (LDAPS) or TLS (using - the STARTLS command) in addition to plain LDAP.</li> - <li>LDAP users can have their LDAP username be their email address, - instead of having the LDAP <kbd>mail</kbd> attribute be their - email address. You may wish to set the <kbd>emailsuffix</kbd> - parameter if you do this.</li> - <li>Administrators can now see what has changed in a user account, - when using the "Users" control panel.</li> - <li><code>REMIND</code> and <code>LATER</code> are no longer part - of the default list of resolutions. Upgrading installations will - not be affected--they will still have these resolutions.</li> - <li><kbd>editbugs</kbd> is now the default for the <kbd>timetrackinggroup</kbd> - parameter, meaning that time-tracking will be on by default in a new - installation.</li> -</ul> - -<h2 id="v30_issues">Outstanding Issues</h2> - -<ul> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=69621"> - [%- terms.Bug %] 69621</a>: If you rename or remove a keyword that is - in use on [% terms.bugs %], you will need to rebuild the "keyword cache" - by running <a href="sanitycheck.cgi">sanitycheck.cgi</a> and choosing - the option to rebuild the cache when it asks. Otherwise keywords may - not show up properly in search results.</li> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=99215"> - [%- terms.Bug %] 99215</a>: Flags are not protected by "mid-air - collision" detection. Nor are any attachment changes.</li> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=89822"> - [%- terms.Bug %] 89822</a>: When changing multiple [% terms.bugs %] at - the same time, there is no "mid-air collision" protection.</li> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=276230"> - [%- terms.Bug %] 276230</a>: The support for restricting access to - particular Categories of New Charts is not complete. You should treat - the 'chartgroup' Param as the only access mechanism available.<br> - However, charts migrated from Old Charts will be restricted to - the groups that are marked MANDATORY for the corresponding Product. - There is currently no way to change this restriction, and the - groupings will not be updated if the group configuration - for the Product changes.</li> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=370370"> - [%- terms.Bug %] 370370</a>: mod_perl support is currently not - working on Windows machines.</li> - <li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=361149"> - [%- terms.Bug %] 361149</a>: If you are using Perl 5.8.0, you may - get a lot of warnings in your Apache error_log about "deprecated - pseudo-hashes." These are harmless--they are a b[%# fool test %]ug in - Perl 5.8.0. Perl 5.8.1 and later do not have this problem.</li> - <li>[% terms.Bugzilla %] 3.0rc1 allowed custom field column names in - the database to be mixed-case. [% terms.Bugzilla %] 3.0 only allows - lowercase column names. It will fix any column names that you have - made mixed-case, but if you have custom fields that previously were - mixed-case in any Saved Search, you will have to re-create that Saved - Search yourself.</li> -</ul> - -<h2 id="v30_security">Security Updates in This Release</h2> - -<h3>3.0.6</h3> - -<p>[% terms.Bugzilla %] contains a minor security fix. For details, see the - <a href="http://www.bugzilla.org/security/2.20.6/">Security Advisory</a>.</p> - -<h3>3.0.5</h3> - -<p>[% terms.Bugzilla %] contains one security fix for - <a href="[% docs_urlbase FILTER html %]api/importxml.html">importxml.pl</a>. - For details, see the - <a href="http://www.bugzilla.org/security/2.22.4/">Security Advisory</a>.</p> - -<h3>3.0.4</h3> - -<p>[% terms.Bugzilla %] 3.0.4 contains three security fixes. - For details, see the - <a href="http://www.bugzilla.org/security/2.20.5/">Security Advisory</a>.</p> - -<h3>3.0.3</h3> - -<p>No security fixes in this release.</p> - -<h3>3.0.2</h3> - -<p>[% terms.Bugzilla %] 3.0.1 had an important security fix that is - critical for public installations with "requirelogin" turned on. - For details, see the - <a href="http://www.bugzilla.org/security/3.0.1/">Security Advisory</a></p> - -<h3>3.0.1</h3> - -<p>[% terms.Bugzilla %] 3.0 had three security issues that have been - fixed in this release: one minor information leak, one hole only - exploitable by an admin or using <code>email_in.pl</code>, and one in an - uncommonly-used template. For details, see the - <a href="http://www.bugzilla.org/security/2.20.4/">Security Advisory</a>.</p> - -<h2 id="v30_upgrading">How to Upgrade From An Older Version</h2> - -<h3 id="v30_upgrading_notes">Notes For Upgraders</h3> - -<ul> - <li>If you upgrade by CVS, there are several .cvsignore files - that are now in CVS instead of being locally created by - <kbd>checksetup.pl</kbd>. This means that you will have to - delete those files when CVS tells you there's a conflict, and - then run <kbd>cvs update</kbd> again.</li> - <li>In this version of [% terms.Bugzilla %], the Summary field - is now limited to 255 characters. When you upgrade, any Summary - longer than that will be truncated, and the old summary will be - preserved in a comment.</li> - <li>If you have the <kbd>utf8</kbd> parameter turned on, at some - point you will have to convert your database. <kbd>checksetup.pl</kbd> - will tell you when this is, and it will give you certain instructions - at that time, that you have to follow before you can complete - the upgrade. Don't do the conversion yourself manually--follow - the instructions of <kbd>checksetup.pl</kbd>.</li> - <li>If you ever ran 2.23.3, 2.23.4, or 3.0rc1, you will have to run - <kbd>./collectstats.pl --regenerate</kbd> at the command line, because - the data for your Old Charts is corrupted. This can take several days, - so you may only want to run it if you use Old Charts.</li> - <li>You should also read the Outstanding Issues sections of - <a href="#v30_previous">older release notes</a> if you are upgrading - from a version lower than 2.22.</li> -</ul> - -<h3>Steps For Upgrading</h3> - -<p>Once you have read the notes above, see the - <a href="[% docs_urlbase FILTER html %]upgrade.html">Upgrading - documentation</a> for instructions on how to upgrade.</p> - -<h2 id="v30_code_changes">Code Changes Which May Affect Customizations</h2> - -<ul> - <li><a href="#v30_code_loc"><strong>Packagers:</strong> Location - Variables Have Moved</a></li> - <li><a href="#v30_code_hooks">Hooks!</a></li> - <li><a href="#v30_code_api">API Documentation</a></li> - <li><a href="#v30_code_globals">Elimination of globals.pl</a></li> - <li><a href="#v30_code_scope">Cleaned Up Variable Scoping Issues</a></li> - <li><a href="#v30_code_sql">No More SendSQL</a></li> - <li><a href="#v30_code_auth">Auth Re-write</a></li> - <li><a href="#v30_code_obj">Bugzilla::Object</a></li> - <li><a href="#v30_code_req">Bugzilla->request_cache</a></li> - <li><a href="#v30_code_other">Other Changes</a></li> -</ul> - -<h3 id="v30_code_loc"><strong>Packagers:</strong> Location Variables - Have Moved</h3> - -<p>In previous versions of [% terms.Bugzilla %], <kbd>Bugzilla::Config</kbd> - held all the paths for different things, such as the path to localconfig - and the path to the <kbd>data/</kbd> directory.</p> - -<p>Now, all of this data is stored in a subroutine, - <kbd>Bugzilla::Constants::bz_locations</kbd>.</p> - -<p>Also, note that for mod_perl, <kbd>bz_locations</kbd> must return - <em>absolute</em> (not relative) paths. There is already code in that - subroutine to help you with this.</p> - -<h3 id="v30_code_hooks">Hooks!</h3> - -<p>[% terms.Bugzilla %] now supports a code hook mechanism. See the - documentation for - <a href="[% docs_urlbase FILTER html %]api/Bugzilla/Hook.html">Bugzilla::Hook</a> - for more details.</p> - -<p>This gives [% terms.Bugzilla %] very advanced plugin support. You can - hook templates, hook code, add new parameters, and use the XML-RPC - interface. So we'd like to see some [% terms.Bugzilla %] plugins - written! Let us know on the <a href="http://bugzilla.org/cgi-bin/mj_wwwusr?func=lists-long-full&extra=developers">developers@bugzilla.org</a> - mailing list if you write a plugin.</p> - -<p>If you need more hooks, please - <a href="http://www.bugzilla.org/developers/reporting_bugs.html">File a b<!-- -->ug</a>!</p> - -<h3 id="v30_code_api">API Documentation</h3> - -<p>[% terms.Bugzilla %] now ships with all of its perldoc built - as HTML. Go ahead and read the - <a href="[% docs_urlbase FILTER html %]api/">API Documentation</a> - for all of the [% terms.Bugzilla %] modules now! Even scripts like - <kbd>checksetup.pl</kbd> have HTML documentation.</p> - -<h3 id="v30_code_globals">Elimination of globals.pl</h3> - -<p>The old file <kbd>globals.pl</kbd> has been eliminated. - Its code is now in various modules. Each function went to the module - that was appropriate for it.</p> - -<p>Usually we filed [% terms.abug %] in - <a href="https://bugzilla.mozilla.org">bugzilla.mozilla.org</a> for - each function we moved. You can search there for the old name of - the function, and that should get you the information about what - it's called now and where it lives.</p> - -<h3 id="v30_code_scope">Cleaned Up Variable Scoping Issues</h3> - -<p>In normal perl, you can have code like this:</p> -<pre>my $var = 0; -sub y { $var++ }</pre> - -<p>However, under mod_perl that doesn't work. So variables are no - longer "shared" with subroutines--instead all variables - that a subroutine needs must be declared inside the subroutine itself.</p> - -<h3 id="v30_code_sql">No More SendSQL</h3> - -<p>The old <kbd>SendSQL</kbd> function and all of its companions are - <strong>gone</strong>. Instead, we now use DBI for all database - interaction.</p> - -<p>For more information about how to use - <a href="http://search.cpan.org/perldoc?DBI">DBI</a> with - [%+ terms.Bugzilla %], see the - <a href="http://www.bugzilla.org/docs/developer.html#sql-sendreceive">Developer's - Guide Section About DBI</a></p> - -<h3 id="v30_code_auth">Auth Re-write</h3> - -<p>The <kbd>Bugzilla::Auth</kbd> family of modules have been completely - re-written. For details on how the new structure of authentication, - read the - <a href="[% docs_urlbase FILTER html %]api/Bugzilla/Auth.html">Bugzilla::Auth - API docs</a>.</p> - -<p>It should be very easy to write new authentication plugins, now.</p> - -<h3 id="v30_code_obj">Bugzilla::Object</h3> - -<p>There is a new base class for most of our objects, - <a href="[% docs_urlbase FILTER html %]api/Bugzilla/Object.html">Bugzilla::Object</a>. - It makes it really easy to create new objects based on things that are - in the database.</p> - -<h3 id="v30_code_req">Bugzilla->request-cache</h3> - -<p><kbd>Bugzilla.pm</kbd> used to cache things like the database - connection in package-global variables (like <kbd>$_dbh</kbd>). - That doesn't work in mod_perl, so instead now there's a hash - that can be accessed through <code>Bugzilla->request_cache</code> - to store things for the rest of the current page request.</p> - -<p>You shouldn't access <code>Bugzilla->request_cache</code> directly, - but you should use it inside of <kbd>Bugzilla.pm</kbd> if you modify - that. The only time you should be accessing it directly is if you need - to reset one of the caches. Hash keys are always named after the function - that they cache, so to reset the template object, you'd do: - <code>delete Bugzilla->request_cache->{template};</code>.</p> - -<h3 id="v30_code_other">Other Changes</h3> - -<ul> - <li><kbd>checksetup.pl</kbd> has been completely re-written, and most - of its code moved into modules in the <kbd>Bugzilla::Install</kbd> - namespace. See the - <a href="[% docs_urlbase FILTER html %]api/checksetup.html">checksetup - documentation</a> and <a href="https://bugzilla.mozilla.org/showdependencytree.cgi?id=277502&hide_resolved=0">[% terms.Bugzilla %] - [%+ terms.bug %] 277502</a> for details.</li> - <li>Instead of <kbd>UserInGroup()</kbd>, all of [% terms.Bugzilla %] now - uses <kbd>Bugzilla->user->in_group</kbd></li> - <li>mod_perl doesn't like dependency loops in modules, so we now have - a test for that detects dependency loops in modules when you run - <kbd>runtests.pl</kbd>.</li> - <li><kbd>globals.pl</kbd> used to modify the environment variables, - like <kbd>PATH</kbd>. That now happens in <kbd>Bugzilla.pm</kbd>.</li> - <li>Templates can now link to the documentation more easily. - See the <kbd>global/code-error.html.tmpl</kbd> and - <kbd>global/user-error.html.tmpl</kbd> templates for examples. - (Search for "docslinks.")</li> - <li>Parameters are accessed through <kbd>Bugzilla->params</kbd> - instead of using the <kbd>Param()</kbd> function, now.</li> - <li>The variables from the <kbd>localconfig</kbd> file are accessed - through the <code>Bugzilla->localconfig</code> hash instead of through - <kbd>Bugzilla::Config</kbd>.</li> - <li><kbd>Bugzilla::BugMail::MessageToMTA()</kbd> has moved into its - own module, along with other mail-handling code, called - <kbd>Bugzilla::Mailer</kbd></li> - <li>The <kbd>CheckCanChangeField()</kbd> subroutine in - <kbd>process_bug.cgi</kbd> has been moved to <kbd>Bugzilla::Bug</kbd>, - and is now a method of [% terms.abug %] object.</li> - <li>The code that used to be in the <kbd>global/banner.html.tmpl</kbd> - template is now in <kbd>global/header.html.tmpl</kbd>. The banner - still exists, but the file is empty.</li> -</ul> - -<h2 id="v30_previous">Release Notes For Previous Versions</h2> - -<p>Release notes for versions of [% terms.Bugzilla %] for versions - prior to 3.0 are only available in text format: - <a href="[% docs_urlbase FILTER remove('html/$') FILTER html %]rel_notes.txt">Release Notes for [% terms.Bugzilla %] 2.22 - and Earlier</a>.</p> - -[% INCLUDE global/footer.html.tmpl %] - -[% BLOCK db_req %] - [% SET m = DB_MODULE.$db %] - <h3 id="v40_req_[% db FILTER html %]">For [% m.name FILTER html %] Users</h3> - - <ul> - <li>[% m.name FILTER html %] - [%+ '<span class="req_new">' IF db_new %]v[% m.db_version FILTER html %] - [% '</span>' IF db_new %] - </li> - <li><strong>perl module:</strong> - [%+ m.dbd.module FILTER html %] - [% '<span class="req_new">' IF dbd_new %]v[% m.dbd.version FILTER html %] - [% '</span>' IF dbd_new %]</li> - </ul> -[% END %] - - -[% BLOCK req_table %] - <table class="req_table" border="0" cellspacing="0" cellpadding="0"> - <tr> - <th>Module</th> <th>Version</th> - [% IF include_feature %] - <th>Enables Feature</th> - [% END %] - </tr> - [% FOREACH req = reqs %] - <tr> - <td [% ' class="req_new"' IF new.contains(req.package) %]> - [%- req.module FILTER html %]</td> - <td [% ' class="req_new"' IF updated.contains(req.package) - OR new.contains(req.package) %]> - [%- IF req.version == 0 %] - (Any) - [% ELSE %] - [%- req.version FILTER html %] - [% END %] - </td> - [% IF include_feature %] - <td>[% req.feature.join(', ') FILTER html %]</td> - [% END %] - </tr> - [% END %] -</table> -[% END %] diff --git a/template/en/default/pages/sudo.html.tmpl b/template/en/default/pages/sudo.html.tmpl index 2e9035891..f118f04dd 100644 --- a/template/en/default/pages/sudo.html.tmpl +++ b/template/en/default/pages/sudo.html.tmpl @@ -9,13 +9,13 @@ [% INCLUDE global/header.html.tmpl title = "sudo: User Impersonation" %] <p> - [%+ terms.Bugzilla %] includes the ability to have one user impersonate + Bugzilla includes the ability to have one user impersonate another, in something called a <i>sudo session</i>, so long as the person doing the impersonating has the appropriate privileges. </p> <p> - While a session is in progress, [% terms.Bugzilla %] will act as if the + While a session is in progress, Bugzilla will act as if the impersonated user is doing everything. This is especially useful for testing, and for doing critical work when the impersonated user is unavailable. The impersonated user will receive an email from [% terms.Bugzilla %] when the diff --git a/template/en/default/reports/chart.html.tmpl b/template/en/default/reports/chart.html.tmpl index ab334639c..dfab725e6 100644 --- a/template/en/default/reports/chart.html.tmpl +++ b/template/en/default/reports/chart.html.tmpl @@ -20,7 +20,7 @@ header_addl_info = time %] -<div align="center"> +<div class="center"> [% imageurl = BLOCK %]chart.cgi? [% imagebase FILTER html %]&ctype=png&action=plot&width= @@ -36,7 +36,7 @@ <a href="[% sizeurl %]&width=[% width %]&height= [% height + 100 %]">Taller</a><br> <a href="[% sizeurl %]&width=[% width - 100 %]&height= - [% height %]">Thinner</a> * + [% height %]">Thinner</a> | <a href="[% sizeurl %]&width=[% width + 100 %]&height= [% height %]">Fatter</a> <br> <a href="[% sizeurl %]&width=[% width %]&height= diff --git a/template/en/default/reports/chart.png.tmpl b/template/en/default/reports/chart.png.tmpl index a464accd4..91944fee5 100644 --- a/template/en/default/reports/chart.png.tmpl +++ b/template/en/default/reports/chart.png.tmpl @@ -6,9 +6,6 @@ # defined by the Mozilla Public License, v. 2.0. #%] -[% y_label = "$terms.Bugs" %] -[% x_label = "Time" %] - [% IF chart.cumulate %] [% USE graph = GD.Graph.area(width, height) %] [% graph.set(cumulate => "true") %] @@ -19,8 +16,8 @@ [% FILTER null; x_label_skip = (30 * chart.data.0.size / width); - graph.set(x_label => x_label, - y_label => y_label, + graph.set(x_label => "Time", + y_label => terms.Bugs, y_tick_number => 8, y_max_value => chart.y_max_value, x_label_position => 0.5, @@ -32,16 +29,18 @@ "lpurple", "lorange", "black", "green", "blue", "dpink", "lbrown", "gray", "red", "dpurple", "gold", "marine"]); - - # Workaround for the fact that set_legend won't take chart.labels directly, - # because chart.labels is an array reference rather than an array. - graph.set_legend(chart.labels.0, chart.labels.1, chart.labels.2, - chart.labels.3, chart.labels.4, chart.labels.5, - chart.labels.6, chart.labels.7, chart.labels.8, - chart.labels.9, chart.labels.10, chart.labels.11, - chart.labels.12, chart.labels.13, chart.labels.14, - chart.labels.15); - - graph.plot(chart.data).png | stdout(1); + + graph.set_legend(chart.labels); END; -%] + +[% IF Param("font_file") %] + [% graph.set_x_axis_font(Param("font_file"), 9); + graph.set_x_label_font(Param("font_file"), 10); + graph.set_y_axis_font(Param("font_file"), 9); + graph.set_y_label_font(Param("font_file"), 10); + graph.set_legend_font(Param("font_file"), 9); + %] +[% END %] + +[% graph.plot(chart.data).png | stdout(1) %] diff --git a/template/en/default/reports/components.html.tmpl b/template/en/default/reports/components.html.tmpl index 2a5d2399b..22a7c948e 100644 --- a/template/en/default/reports/components.html.tmpl +++ b/template/en/default/reports/components.html.tmpl @@ -16,8 +16,8 @@ [% END %] [% PROCESS global/header.html.tmpl - style_urls = [ "skins/standard/reports.css" ] - title = title + style_urls = ['skins/standard/buglist.css'] + title = title %] [% IF Param("useqacontact") %] @@ -26,39 +26,23 @@ [% numcols = 2 %] [% END %] -<table cellpadding="0" cellspacing="0" id="components_header_table"> - <tr> - <td class="instructions"> - Select a component to see open [% terms.bugs %] in that component: - </td> - <td class="product_container"> - <span class="product_name">[% product.name FILTER html %]</span> - <div class="product_desc"> - [% product.description FILTER html_light %] - </div> - </td> - </tr> -</table> +<h1>[% product.name FILTER html %]</h1> -<span class="components_header">Components</span> +<div id="product_desc">[% product.description FILTER html_light %]</div> +<p>Select a component to see open [% terms.bugs %] in that component.</p> -<table summary="Components table" - class="component_table" cellspacing="0" cellpadding="0"> - <thead> +<table id="component_table"> <tr> - <th> </th> + <th>Component</th> <th>Default Assignee</th> [% IF Param("useqacontact") %] <th>Default QA Contact</th> [% END %] </tr> - </thead> - <tbody> [% FOREACH comp = product.components %] [% INCLUDE describe_comp %] [% END %] - </tbody> </table> [% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/reports/create-chart.html.tmpl b/template/en/default/reports/create-chart.html.tmpl index 471a9cb55..6b5fa5fe3 100644 --- a/template/en/default/reports/create-chart.html.tmpl +++ b/template/en/default/reports/create-chart.html.tmpl @@ -15,6 +15,7 @@ [% PROCESS global/header.html.tmpl title = "Create Chart" + style_urls = ['skins/standard/buglist.css'] %] [% PROCESS "reports/series-common.html.tmpl" @@ -47,9 +48,9 @@ function subcatSelected() { [% gttext = "Grand Total" %] -<form method="get" action="chart.cgi" name="chartform"> - - <table cellpadding="2" cellspacing="2" border="0"> +<form method="get" action="chart.cgi" name="chartform"> + + <table id="create_chart"> [% IF NOT category OR category.size == 0 %] <tr> <td> @@ -58,39 +59,38 @@ function subcatSelected() { </tr> [% ELSE %] <tr> - <th><label for="category">Category</label>:</th> + <th><label for="category">Category</label></th> + <th></th> + <th><label for="subcategory">Sub-category</label></th> <th></th> - <th><label for="subcategory">Sub-category</label>:</th> + <th><label for="name" accesskey="N">Name</label></th> <th></th> - <th><label for="name" accesskey="N">Name</label>:</th> - <th><br> - </th> </tr> <tr> - + [% PROCESS series_select sel = { name => 'category', size => 5, onchange = "catSelected(); subcatSelected();" } %] - + <td> <noscript> <input type="submit" name="action-assemble" value="Update -->" id="action-assemble"> </noscript> </td> - + [% PROCESS series_select sel = { name => 'subcategory', size => 5, onchange = "subcatSelected()" } %] - + <td> <noscript> <input type="submit" name="action-assemble" value="Update -->" id="action-assemble2"> </noscript> </td> - + [% PROCESS series_select sel = { name => 'name', size => 5, multiple => 1, @@ -98,7 +98,7 @@ function subcatSelected() { # not its name. value_in_hash => 1 } %] - <td align="center" valign="middle"> + <td> <input type="submit" name="action-add" value="Add To List" id="action-add"><br> </td> @@ -109,15 +109,15 @@ function subcatSelected() { <h3>List Of Data Sets To Plot</h3> [% IF chart.lines.size %] - <table cellspacing="2" cellpadding="2"> + <table id="edit_charts"> <tr> - <th style="width: 5em;">Select</th> + <th>Select</th> <th>Label</th> <th></th> <th>Data Set</th> <th></th> </tr> - + [%# The external loop has two counters; one which keeps track of where we # are in the old labels array, and one which keeps track of the new # indexes for the form elements. They are different if chart.lines has @@ -134,11 +134,11 @@ function subcatSelected() { [% labelidx = labelidx + 1 %] [% NEXT %] [% END %] - + [% FOREACH series = line %] <tr> [% IF loop.first %] - <td align="center" rowspan="[% line.size %]"> + <td class="center" rowspan="[% line.size %]"> <input type="checkbox" value="1" name="select[% newidx %]"> </td> <td rowspan="[% line.size %]"> @@ -160,7 +160,7 @@ function subcatSelected() { value="[% series.series_id %]"> </td> - <td align="center"> + <td> [% IF user.id == series.creator_id OR user.in_group("admin") %] <a href="chart.cgi?action=edit&series_id= [% series.series_id %]">Edit</a> | @@ -172,7 +172,7 @@ function subcatSelected() { [% series.subcategory FILTER uri %]%20/%20 [% series.name FILTER uri -%]&series_id= [% series.series_id %]&remaction=runseries">Run Search</a> - </td> + </td> </tr> [% END %] [% labelidx = labelidx + 1 %] @@ -181,7 +181,7 @@ function subcatSelected() { [% IF chart.gt %] <tr> - <td align="center"> + <td class="center"> <input type="checkbox" value="1" name="select65536"> <input type="hidden" value="1" name="gt"> </td> @@ -201,30 +201,30 @@ function subcatSelected() { </tr> <tr> - <td valign="bottom" style="text-align: center;"> - <input type="submit" name="action-sum" value="Sum" - style="width: 5em;" id="action-sum"><br> - <input type="submit" name="action-remove" value="Remove" - style="width: 5em;" id="action-remove"> + <td> + <input type="submit" id="action-sum" name="action-sum" value="Sum"><br> + <input type="submit" id="action-remove" name="action-remove" value="Remove"> </td> - <td style="text-align: right; vertical-align: bottom;"> + <td class="right"> <label for="cumulate"><b>Cumulate</b></label>: <input type="checkbox" name="cumulate" id="cumulate" value="1" [% " checked" IF chart.cumulate %]> </td> <td></td> - <td valign="bottom"> + <td> <label for="datefrom"><b>Date Range</b></label>: <input type="text" size="12" name="datefrom" id="datefrom" + placeholder="YYYY-MM-DD" value="[% time2str("%Y-%m-%d", chart.datefrom) IF chart.datefrom%]"> <label for="dateto"><b>to</b></label> <input type="text" size="12" name="dateto" id="dateto" + placeholder="YYYY-MM-DD" value="[% time2str("%Y-%m-%d", chart.dateto) IF chart.dateto %]"> </td> - <td style="text-align: right" valign="bottom"> + <td> <input type="submit" name="action-wrap" value="Chart This List" id="action-wrap"> </td> diff --git a/template/en/default/reports/delete-series.html.tmpl b/template/en/default/reports/delete-series.html.tmpl index 7ff8876aa..d19178ce3 100644 --- a/template/en/default/reports/delete-series.html.tmpl +++ b/template/en/default/reports/delete-series.html.tmpl @@ -24,7 +24,7 @@ This series has been created by <a href="mailto:[% series.creator.email FILTER html %]"> [% series.creator.email FILTER html %]</a> [% ELSE %] - This series has been automatically created by [% terms.Bugzilla %] + This series has been automatically created by Bugzilla [% END %] [% IF series.public %] diff --git a/template/en/default/reports/duplicates-simple.html.tmpl b/template/en/default/reports/duplicates-simple.html.tmpl index 6f586546a..5c3a34bb0 100644 --- a/template/en/default/reports/duplicates-simple.html.tmpl +++ b/template/en/default/reports/duplicates-simple.html.tmpl @@ -10,8 +10,7 @@ # You need to fulfill the interface to duplicates-table.html.tmpl. #%] -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" - "http://www.w3.org/TR/html4/loose.dtd"> +<!DOCTYPE html> <html> [% IF product.size %] [% title = BLOCK %] @@ -25,8 +24,6 @@ <title>[% title FILTER html %]</title> <link href="[% 'skins/standard/global.css' FILTER mtime %]" rel="stylesheet" type="text/css"> - <link href="[% 'skins/standard/duplicates.css' FILTER mtime %]" - rel="stylesheet" type="text/css"> </head> <body> diff --git a/template/en/default/reports/duplicates-table.html.tmpl b/template/en/default/reports/duplicates-table.html.tmpl index 45cf8c394..b8cd2ca78 100644 --- a/template/en/default/reports/duplicates-table.html.tmpl +++ b/template/en/default/reports/duplicates-table.html.tmpl @@ -31,7 +31,7 @@ description => "Change in last<br>$changedsince day(s)" }, { name => "component", description => field_descs.component }, { name => "bug_severity", description => field_descs.bug_severity }, - { name => "op_sys", description => field_descs.op_sys }, + { name => "priority", description => field_descs.priority }, { name => "target_milestone", description => field_descs.target_milestone }, { name => "short_desc", description => field_descs.short_desc }, ] %] @@ -53,7 +53,7 @@ [% base_args_string = base_args.join('&') %] [% IF bugs.size %] - <table id="duplicates_table" cellpadding="0" cellspacing="0"> + <table id="duplicates_table"> <thead> <tr> [% FOREACH column = columns %] @@ -92,8 +92,8 @@ <td class="bug_severity"> [%- display_value('bug_severity', bug.bug_severity) FILTER html %] </td> - <td class="op_sys"> - [%- display_value('op_sys', bug.op_sys) FILTER html %] + <td class="priority"> + [%- display_value('priority', bug.priority) FILTER html %] </td> <td class="target_milestone"> [% display_value('target_milestone', diff --git a/template/en/default/reports/duplicates.html.tmpl b/template/en/default/reports/duplicates.html.tmpl index 4efdcf9f5..35c141265 100644 --- a/template/en/default/reports/duplicates.html.tmpl +++ b/template/en/default/reports/duplicates.html.tmpl @@ -27,10 +27,7 @@ [% title = "Most Frequently Reported $terms.Bugs" %] [% END%] -[% PROCESS global/header.html.tmpl - title = title - style_urls = ['skins/standard/duplicates.css'] -%] +[% PROCESS global/header.html.tmpl title = title %] <p> <a href="#explanation">What is this data?</a> @@ -52,6 +49,18 @@ <input type="hidden" name="bug_id" value="[% bug_ids_string FILTER html %]"> <table> <tr> + <td>Restrict to products:</td> + <td> + [% INCLUDE "global/product-select.html.tmpl" + id => "product" + name => "product" + multiple => 5 + value => product + %] + </td> + </tr> + + <tr> <td>When sorting or restricting, work with:</td> <td> <input type="radio" name="sortvisible" id="entirelist" value="0" @@ -66,16 +75,6 @@ currently visible list </label> </td> - <td rowspan="4" valign="top">Restrict to products:</td> - <td rowspan="4" valign="top"> - <select name="product" size="5" multiple="multiple"> - [% FOREACH p = user.get_selectable_products %] - <option name="[% p.name FILTER html %]" - [% ' selected="selected"' IF product.contains(p.name) %] - >[% p.name FILTER html %]</option> - [% END %] - </select> - </td> </tr> <tr> diff --git a/template/en/default/reports/edit-series.html.tmpl b/template/en/default/reports/edit-series.html.tmpl index c789262ca..ad6bb32f4 100644 --- a/template/en/default/reports/edit-series.html.tmpl +++ b/template/en/default/reports/edit-series.html.tmpl @@ -13,15 +13,9 @@ [%+ default.name FILTER html %] [% END %] -[% PROCESS global/header.html.tmpl %] - -[% IF changes_saved %] - <p> - <font color="red"> - Series updated. - </font> - </p> -[% END %] +[% PROCESS global/header.html.tmpl + style_urls = ['skins/standard/buglist.css'] +%] <form method="get" action="chart.cgi" name="chartform"> @@ -42,7 +36,7 @@ <a href="mailto:[% default.creator.email FILTER html %]"> [% default.creator.email FILTER html %]</a> [% ELSE %] - (automatically created by [% terms.Bugzilla %]) + (automatically created by Bugzilla) [% END %] </p> diff --git a/template/en/default/reports/keywords.html.tmpl b/template/en/default/reports/keywords.html.tmpl index 0624041bd..598979d33 100644 --- a/template/en/default/reports/keywords.html.tmpl +++ b/template/en/default/reports/keywords.html.tmpl @@ -12,34 +12,26 @@ # name: the name of the keyword # description: keyword description. Can contain some limited HTML code. # bug_count: number of bugs with that keyword - # caneditkeywords: boolean. True if this user can edit keywords %] [% PROCESS global/header.html.tmpl title = "$terms.Bugzilla Keyword Descriptions" + style_urls = ['skins/standard/admin.css'] %] -[% FOREACH keyword = keywords %] - [% IF loop.index % 50 == 0 %] - [% IF loop.index != 0 %] - </table> - [% END %] - - <table border="1" cellpadding="4" cellspacing="0"> - <tr bgcolor="#6666FF"> - <th align="left">Name</th> - <th align="left">Description</th> - <th align="left">Open [% terms.Bugs %]</th> - <th align="left">Total [% terms.Bugs %]</th> - </tr> - [% END %] +<table id="admin_table"> + <tr class="column_header"> + <th>Name</th> + <th>Description</th> + <th>Open [% terms.Bugs %]</th> + <th>Total [% terms.Bugs %]</th> + </tr> + [% FOREACH keyword = keywords %] <tr id="[% keyword.name FILTER html %]"> - <th> - [% keyword.name FILTER html %] - </th> + <td>[% keyword.name FILTER html %]</td> <td>[% keyword.description FILTER html_light %]</td> - <td align="center"> + <td class="center"> [% IF keyword.bug_count > 0 %] <a href="buglist.cgi?keywords=[% keyword.name FILTER uri %]&resolution=---"> Search</a> @@ -47,7 +39,7 @@ none [% END %] </td> - <td align="right"> + <td class="right"> [% IF keyword.bug_count > 0 %] <a href="buglist.cgi?keywords=[% keyword.name FILTER uri %]"> [% keyword.bug_count %]</a> @@ -56,13 +48,10 @@ [% END %] </td> </tr> -[% END %] - -[% IF keywords.size > 0 %] - </table> -[% END %] + [% END %] +</table> -[% IF caneditkeywords %] +[% IF user.in_group("editkeywords") %] <p> <a href="editkeywords.cgi">Edit keywords</a>. </p> diff --git a/template/en/default/reports/menu.html.tmpl b/template/en/default/reports/menu.html.tmpl index af83ffb11..526776bbb 100644 --- a/template/en/default/reports/menu.html.tmpl +++ b/template/en/default/reports/menu.html.tmpl @@ -13,12 +13,12 @@ [% PROCESS global/header.html.tmpl title = "Reporting and Charting Kitchen" - doc_section = "reporting.html" - style_urls = ['skins/standard/reports.css'] + doc_section = "using/reports-and-charts.html" + style_urls = ['skins/standard/buglist.css'] %] <p> - [% terms.Bugzilla %] allows you to view and track the state of the [% terms.bug %] database in + Bugzilla allows you to view and track the state of the [% terms.bug %] database in all manner of exciting ways. </p> diff --git a/template/en/default/reports/old-charts.html.tmpl b/template/en/default/reports/old-charts.html.tmpl index 12a0cdd83..a958911f4 100644 --- a/template/en/default/reports/old-charts.html.tmpl +++ b/template/en/default/reports/old-charts.html.tmpl @@ -7,7 +7,6 @@ #%] [%# INTERFACE: - # products: an array of product names the user is allowed to view. # datasets: an array of hashes with available statuses and resolutions. # url_image: URL of the generated graph. #%] @@ -15,29 +14,31 @@ [% PROCESS global/header.html.tmpl title = "$terms.Bug Charts" h1 = "Welcome to the $terms.Bugzilla Charting Kitchen" - doc_section = "reporting.html#charts" + style_urls = ['skins/standard/buglist.css'] + doc_section = "using/reports-and-charts.html#charts" %] -<div align="center"> - [% IF url_image %] +[% IF url_image %] + <div class="center"> <img src="[% url_image FILTER html %]"> - <br clear="both"> - [% ELSE %] + </div> +[% ELSE %] <form id="choose_product" method="get" action="reports.cgi"> - <table border="1" cellpadding="5" cellspacing="2"> + <table id="old_charts"> <tr> <th>Product:</th> - <td align="center"> - <select id="product" name="product"> - [% FOREACH product = products %] - <option value="[% product FILTER html %]">[% product FILTER html %]</option> - [% END %] - </select> + <td> + [% INCLUDE "global/product-select.html.tmpl" + id => "product_id" + name => "product_id" + valueattribute => "id" + add => "-All-" + %] </td> </tr> <tr> <th>Chart datasets:</th> - <td align="center"> + <td> <select id="datasets" name="datasets" multiple="multiple" size="5"> [%# We cannot use translated statuses and resolutions from field-descs.none.html # because old charts do not distinguish statuses from resolutions. %] @@ -56,7 +57,6 @@ </tr> </table> </form> - [% END %] -</div> +[% END %] [% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/reports/report-bar.png.tmpl b/template/en/default/reports/report-bar.png.tmpl index 70d482ec9..d879f6dd1 100644 --- a/template/en/default/reports/report-bar.png.tmpl +++ b/template/en/default/reports/report-bar.png.tmpl @@ -6,10 +6,6 @@ # defined by the Mozilla Public License, v. 2.0. #%] -[% y_label = "$terms.Bugs" %] - -[% col_field_disp = field_descs.$col_field || col_field %] - [% FOR i IN [ 0 .. data.0.0.max ] %] [% data.0.0.$i = display_value(col_field, data.0.0.$i) %] [% END %] @@ -21,8 +17,8 @@ [% FILTER null; USE graph = GD.Graph.bars(width, height); - graph.set(x_label => col_field_disp, - y_label => y_label, + graph.set(x_label => field_descs.$col_field || col_field, + y_label => terms.Bugs, y_tick_number => 8, y_number_format => "%d", x_label_position => 0.5, @@ -36,13 +32,17 @@ graph.set(cumulate => "true", show_values => 0) IF cumulate; - # Workaround for the fact that set_legend won't take row_names directly, - # because row_names is an array reference rather than an array. - graph.set_legend(row_names.0, row_names.1, row_names.2, row_names.3, - row_names.4, row_names.5, row_names.6, row_names.7, - row_names.8, row_names.9, row_names.10, row_names.11, - row_names.12, row_names.13, row_names.14, row_names.15); - - graph.plot(data.0).png | stdout(1); + graph.set_legend(row_names); END; -%] + +[% IF Param("font_file") %] + [% graph.set_x_axis_font(Param("font_file"), 9); + graph.set_x_label_font(Param("font_file"), 10); + graph.set_y_axis_font(Param("font_file"), 9); + graph.set_y_label_font(Param("font_file"), 10); + graph.set_legend_font(Param("font_file"), 9); + %] +[% END %] + +[% graph.plot(data.0).png | stdout(1) %] diff --git a/template/en/default/reports/report-line.png.tmpl b/template/en/default/reports/report-line.png.tmpl index 073e69bcc..585133afd 100644 --- a/template/en/default/reports/report-line.png.tmpl +++ b/template/en/default/reports/report-line.png.tmpl @@ -6,10 +6,6 @@ # defined by the Mozilla Public License, v. 2.0. #%] -[% y_label = "$terms.Bugs" %] - -[% col_field_disp = field_descs.$col_field || col_field %] - [% FOR i IN [ 0 .. data.0.0.max ] %] [% data.0.0.$i = display_value(col_field, data.0.0.$i) %] [% END %] @@ -26,8 +22,8 @@ [% END %] [% FILTER null; - graph.set(x_label => col_field_disp, - y_label => y_label, + graph.set(x_label => field_descs.$col_field || col_field, + y_label => terms.Bugs, y_tick_number => 8, x_label_position => 0.5, x_labels_vertical => x_labels_vertical, @@ -38,13 +34,17 @@ "blue", "dpink", "lbrown", "gray", "red", "dpurple", "gold", "marine"]); - # Workaround for the fact that set_legend won't take row_names directly, - # because row_names is an array reference rather than an array. - graph.set_legend(row_names.0, row_names.1, row_names.2, row_names.3, - row_names.4, row_names.5, row_names.6, row_names.7, - row_names.8, row_names.9, row_names.10, row_names.11, - row_names.12, row_names.13, row_names.14, row_names.15); - - graph.plot(data.0).png | stdout(1); + graph.set_legend(row_names); END; -%] + +[% IF Param("font_file") %] + [% graph.set_x_axis_font(Param("font_file"), 9); + graph.set_x_label_font(Param("font_file"), 10); + graph.set_y_axis_font(Param("font_file"), 9); + graph.set_y_label_font(Param("font_file"), 10); + graph.set_legend_font(Param("font_file"), 9); + %] +[% END %] + +[% graph.plot(data.0).png | stdout(1) %] diff --git a/template/en/default/reports/report-pie.png.tmpl b/template/en/default/reports/report-pie.png.tmpl index 9d3f16fa3..cc2a1325a 100644 --- a/template/en/default/reports/report-pie.png.tmpl +++ b/template/en/default/reports/report-pie.png.tmpl @@ -6,20 +6,24 @@ # defined by the Mozilla Public License, v. 2.0. #%] -[% col_field_disp = field_descs.$col_field || col_field %] - [% FOR i IN [ 0 .. data.0.0.max ] %] [% data.0.0.$i = display_value(col_field, data.0.0.$i) %] [% END %] [% FILTER null; USE graph = GD.Graph.pie(width, height); - - graph.set(title => col_field_disp, + + graph.set(title => field_descs.$col_field || col_field, pie_height => 20, suppress_angle => 2, start_angle => 180); - - graph.plot(data.0).png | stdout(1); END; -%] + +[% IF Param("font_file") %] + [% graph.set_title_font(Param("font_file"), 10); + graph.set_value_font(Param("font_file"), 9); + %] +[% END %] + +[% graph.plot(data.0).png | stdout(1) %] diff --git a/template/en/default/reports/report-simple.html.tmpl b/template/en/default/reports/report-simple.html.tmpl index 17b87c6a6..9be2f0113 100644 --- a/template/en/default/reports/report-simple.html.tmpl +++ b/template/en/default/reports/report-simple.html.tmpl @@ -10,16 +10,13 @@ # You need to fulfill the interface to report-table.html.tmpl. #%] +<!DOCTYPE html> <html> - - [% title = "$terms.Bug List" %] - <head> - <title>[% title FILTER html %]</title> + <title>[% "$terms.Bug List" FILTER html %]</title> </head> <body> [% PROCESS "reports/report-table.html.tmpl" %] </body> - </html> diff --git a/template/en/default/reports/report-table.html.tmpl b/template/en/default/reports/report-table.html.tmpl index 2747166be..57e998b1d 100644 --- a/template/en/default/reports/report-table.html.tmpl +++ b/template/en/default/reports/report-table.html.tmpl @@ -116,7 +116,7 @@ YAHOO.util.Event.addListener(window, "load", function() { return parseFloat(res[1]); }; - this.myDataSource = new YAHOO.util.DataSource(YAHOO.util.Dom.get("tabular_report")); + this.myDataSource = new YAHOO.util.DataSource(YAHOO.util.Dom.get("tabular_report_[% tbl FILTER html FILTER js %]")); this.myDataSource.responseType = YAHOO.util.DataSource.TYPE_HTMLTABLE; this.myDataSource.responseSchema = { fields: [ @@ -137,17 +137,17 @@ YAHOO.util.Event.addListener(window, "load", function() { <h2>[% tbl_disp FILTER email FILTER html %]</h2> [% END %] -<table> +<table class="tabular_report_container"> <tr> <td> </td> - <td align="center"> + <td class="center"> <strong>[% col_field_disp FILTER html %]</strong> </td> </tr> <tr> - <td valign="middle"> + <td class="middle"> <strong>[% row_field_disp FILTER html %]</strong> </td> <td> @@ -156,16 +156,15 @@ YAHOO.util.Event.addListener(window, "load", function() { [% classes = [ [ "t1", "t2" ] , [ "t3", "t4" ] ] %] [% col_idx = 0 %] [% row_idx = 0 %] -[% grand_total = 0 %] +[% total_key = '-total-' %] <div id="tabular_report_container_[% tbl FILTER html %]"> -<table id="tabular_report" border="1"> +<table id="tabular_report_[% tbl FILTER html %]" class="tabular_report"> [% IF col_field %] <thead> <tr> <th class="[% classes.$row_idx.$col_idx %]"> </th> [% FOREACH col = col_names %] - [% col_totals.$col = 0 %] [% NEXT IF col == "" %] [% col_idx = 1 - col_idx %] @@ -181,20 +180,16 @@ YAHOO.util.Event.addListener(window, "load", function() { [% END %] <tbody> [% FOREACH row = row_names %] - [% row_total = 0 %] - [% row_idx = 1 - row_idx %] <tr> - <td class="[% classes.$row_idx.$col_idx %]" align="right"> + <td class="[% classes.$row_idx.$col_idx %] right"> [% PROCESS value_display value = row field = row_field %] </td> [% FOREACH col = col_names %] - [% row_total = row_total + data.$tbl.$col.$row %] [% NEXT IF col == "" %] - [% col_totals.$col = (col_totals.$col || 0) + data.$tbl.$col.$row %] [% col_idx = 1 - col_idx %] - <td class="[% classes.$row_idx.$col_idx %]" align="center"> + <td class="[% classes.$row_idx.$col_idx %]"> [% IF data.$tbl.$col.$row AND data.$tbl.$col.$row > 0 %] <a href="[% urlbase %]& [% row_field FILTER uri %]=[% row FILTER uri %]& @@ -205,12 +200,11 @@ YAHOO.util.Event.addListener(window, "load", function() { [% END %] </td> [% END %] - <td class="ttotal" align="right"> + <td class="ttotal right"> <a href="[% urlbase %]& [% row_field FILTER uri %]=[% row FILTER uri %] [% "&$col_vals" IF col_vals %]"> - [% row_total %]</a> - [% grand_total = grand_total + row_total %] + [% data.$tbl.$total_key.$row OR 0 FILTER html %]</a> </td> </tr> [% END %] @@ -221,30 +215,37 @@ YAHOO.util.Event.addListener(window, "load", function() { </td> [% FOREACH col = col_names %] [% NEXT IF col == "" %] - - <td class="ttotal" align="center"> + + <td class="ttotal"> <a href="[% urlbase %]& [% col_field FILTER uri %]=[% col FILTER uri %] [% "&$row_vals" IF row_vals %]"> - [% col_totals.$col %]</a> + [% data.$tbl.$col.$total_key OR 0 FILTER html %]</a> </td> [% END %] - <td class="ttotal" align="right"> + <td class="ttotal right"> <strong> <a href="[% urlbase %] [% "&$row_vals" IF row_vals %] - [% "&$col_vals" IF col_vals %]">[% grand_total %]</a> + [% "&$col_vals" IF col_vals %]">[% data.$tbl.$total_key.$total_key OR 0 FILTER html %]</a> </strong> </td> </tr> </tbody> </table> </div> - + </td> </tr> </table> +[% IF note_multi_select %] + <p class="extra_info"> + NOTE: Axes contain multi-value fields, so the total numbers might not add up, + as a single [% terms.bug %] can match several rows or columns. + </p> +[% END %] + [% BLOCK value_display %] [% SET disp_value = display_value(field, value) %] [% IF field == 'assigned_to' OR field == 'reporter' diff --git a/template/en/default/reports/report.html.tmpl b/template/en/default/reports/report.html.tmpl index 2ca5dd90f..a9cd96551 100644 --- a/template/en/default/reports/report.html.tmpl +++ b/template/en/default/reports/report.html.tmpl @@ -56,7 +56,7 @@ [% PROCESS global/header.html.tmpl header_addl_info = time - style_urls = ['skins/standard/reports.css'] + style_urls = ['skins/standard/buglist.css'] yui = ['datatable'] %] @@ -66,9 +66,8 @@ [% END %] [% END %] -<div align="center"> - - [% FOREACH tbl = tbl_names %] +<div class="center"> + [% FOREACH tbl = tbl_names %] [% IF tbl == "-total-" %] [% tbl_disp = "Total" %] [% ELSE %] @@ -108,45 +107,38 @@ { name => "table", description => "Table" } ] %] [% formaturl = "report.cgi?$switchbase&width=$width&height=$height&action=wrap" %] - [% FOREACH other_format = formats %] - [% NEXT IF other_format.name == "pie" AND row_field AND col_field %] - [% UNLESS other_format.name == format %] - <a href="[% formaturl %]&format=[% other_format.name %]"> + <p> + [% FOREACH other_format = formats %] + [% NEXT IF other_format.name == "pie" AND row_field AND col_field %] + [% UNLESS other_format.name == format %] + <a href="[% formaturl %]&format=[% other_format.name %]"> + [% END %] + [% other_format.description FILTER html %] + [% "</a>" UNLESS other_format.name == format %] | [% END %] - [% other_format.description FILTER html %] - [% "</a>" UNLESS other_format.name == format %] | + <a href="[% formaturl %]&ctype=csv&format=table">CSV</a> + </p> + + [% IF format == "table" %] + <a href="query.cgi?[% switchbase %]&format=report-table">Edit this report</a> + [% ELSE %] + <a href="query.cgi?[% switchbase %]&chart_format= + [%~ format FILTER uri %]&format=report-graph&cumulate=[% cumulate %]"> + Edit this report</a> + [% END %] + | + [% IF saved_report_id %] + <a href="report.cgi?action=del&saved_report_id=[% saved_report_id FILTER uri %]&token= + [%~ issue_hash_token(['delete_report', saved_report_id]) FILTER uri %]">Forget this report</a> + [% ELSE %] + <form method="get" action="report.cgi" class="inline"> + <input type="submit" id="remember" value="Remember report"> as + <input type="hidden" name="query" value="[% switchbase %]&format=[% format FILTER uri %]&action=wrap"> + <input type="hidden" name="action" value="add"> + <input type="hidden" name="token" value="[% issue_hash_token(['save_report']) FILTER html %]"> + <input type="text" id="name" name="name" size="20" value="" maxlength="64"> + </form> [% END %] - <a href="[% formaturl %]&ctype=csv&format=table">CSV</a> - - <table> - <tr> - <td> - [% IF format == "table" %] - <a href="query.cgi?[% switchbase %]&format=report-table">Edit this report</a> - [% ELSE %] - <a href="query.cgi?[% switchbase %]&chart_format= - [%~ format FILTER uri %]&format=report-graph&cumulate=[% cumulate %]"> - Edit this report</a> - [% END %] - </td> - <td>|</td> - <td> - [% IF saved_report_id %] - <a href="report.cgi?action=del&saved_report_id=[% saved_report_id FILTER uri %]&token= - [%~ issue_hash_token(['delete_report', saved_report_id]) FILTER uri %]">Forget this report</a> - [% ELSE %] - <form method="get" action="report.cgi"> - <input type="submit" id="remember" value="Remember report"> as - <input type="hidden" name="query" value="[% switchbase %]&format=[% format FILTER uri %]&action=wrap"> - <input type="hidden" name="action" value="add"> - <input type="hidden" name="token" value="[% issue_hash_token(['save_report']) FILTER html %]"> - <input type="text" id="name" name="name" size="20" value="" maxlength="64"> - </form> - [% END %] - </td> - </tr> - </table> - </div> [% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/reports/series-common.html.tmpl b/template/en/default/reports/series-common.html.tmpl index 35d3c04af..07b3888f3 100644 --- a/template/en/default/reports/series-common.html.tmpl +++ b/template/en/default/reports/series-common.html.tmpl @@ -85,9 +85,9 @@ function checkNewState() { [%###########################################################################%] [% BLOCK series_select %] - <td align="left"> + <td> <select name="[% sel.name %]" id="[% sel.name %]" - size="[% sel.size %]" style="width: 15em" + size="[% sel.size %]" [%+ 'multiple="multiple"' IF sel.multiple %] [%+ "disabled=\"disabled\"" UNLESS ${sel.name}.keys.size || newtext %] [%+ "onchange=\"$sel.onchange\"" IF sel.onchange %]> diff --git a/template/en/default/reports/series.html.tmpl b/template/en/default/reports/series.html.tmpl index a6bf0d97d..daf522348 100644 --- a/template/en/default/reports/series.html.tmpl +++ b/template/en/default/reports/series.html.tmpl @@ -17,16 +17,14 @@ [% PROCESS "reports/series-common.html.tmpl" newtext = "New (name below)" %] - -<table cellpadding="2" cellspacing="2" border="0" - style="text-align: left; margin-left: 20px"> - <tbody> + +<table id="edit_series"> <tr> - <th>Category:</th> + <th>Category</th> + <th></th> + <th>Sub-category</th> + <th>Name</th> <th></th> - <th>Sub-category:</th> - <th>Name:</th> - <td></td> </tr> <tr> [% PROCESS series_select sel = { name => 'category', @@ -38,41 +36,40 @@ id="action-edit"> </noscript> </td> - + [% PROCESS series_select sel = { name => 'subcategory', size => 5, onchange => "checkNewState()" } %] - - <td valign="top" name="name"> + + <td> <input type="text" name="name" maxlength="64" value="[% default.name.0 FILTER html %]" size="25"> </td> - <td valign="top"> - <span style="font-weight: bold;">Run every</span> - <input type="text" size="2" name="frequency" + <td> + Run every + <input type="text" size="2" id="frequency" name="frequency" value="[% (default.frequency.0 OR 7) FILTER html %]"> - <span style="font-weight: bold;"> day(s)</span><br> + day(s)<br> [%# Change 'admin' here and in Series.pm, or remove the check completely, if you want to change who can make series public. %] - [% IF user.in_group('admin') %] + [% IF user.in_group('admin') %] <input type="checkbox" name="public" [%+ "checked='checked'" IF default.public.0 %]> - <span style="font-weight: bold;">Visible to all<br> - (within group restrictions)</span> + Visible to all<br> + (within group restrictions) [% END %] </td> </tr> <tr> <td> - <input type="text" style="width: 100%" name="newcategory" - maxlength="64" value="[% default.newcategory.0 FILTER html %]"> + <input type="text" name="newcategory" maxlength="64" + value="[% default.newcategory.0 FILTER html %]"> </td> - <td></td> + <td></td> <td> - <input type="text" style="width: 100%" name="newsubcategory" - maxlength="64" + <input type="text" name="newsubcategory" maxlength="64" value="[% default.newsubcategory.0 FILTER html %]"> </td> <td></td> @@ -81,5 +78,4 @@ value="[% button_name FILTER html %]"> </td> </tr> - </tbody> </table> diff --git a/template/en/default/request/queue.csv.tmpl b/template/en/default/request/queue.csv.tmpl new file mode 100644 index 000000000..c6d962b4f --- /dev/null +++ b/template/en/default/request/queue.csv.tmpl @@ -0,0 +1,46 @@ +[%# 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. #%] + +[% PROCESS "global/field-descs.none.tmpl" %] + +[% column_headers = { + "type" => "Flag", + "status" => field_descs.bug_status, + "bug_summary" => field_descs.short_desc, + "bug_id" => field_descs.bug_id, + "attach_summary" => "Attachment Description", + "attach_id" => "Attachment ID", + "requester" => "Requester", + "requestee" => "Requestee", + "created" => "Created", + "category" => field_descs.product _ ": " _ field_descs.component, +} %] + +[% display_columns = ["requester", "requestee", "type", "status", + "bug_id", "bug_summary", "attach_id", + "attach_summary", "created", "category"] %] + +[% IF requests.size == 0 %] +No requests. +[% ELSE %] + [% FOREACH column = display_columns %] + [% column_headers.$column FILTER csv %][% ',' IF NOT loop.last() %] + [% END %] + + [% FOREACH request = requests %] + [% FOREACH column = display_columns %] + [% IF column == 'created' %] + [% request.$column FILTER time FILTER csv %] + [% ELSIF column.match('^requeste') %] + [% request.$column FILTER email FILTER csv %] + [% ELSE %] + [% request.$column FILTER csv %] + [% END %][% ',' IF NOT loop.last() %] + [% END %] + + [% END %] +[% END %] diff --git a/template/en/default/request/queue.html.tmpl b/template/en/default/request/queue.html.tmpl index bac0b8428..7e8c44c8b 100644 --- a/template/en/default/request/queue.html.tmpl +++ b/template/en/default/request/queue.html.tmpl @@ -11,6 +11,7 @@ [% PROCESS global/header.html.tmpl title="Request Queue" + generate_api_token = 1 onload="var f = document.request_form; selectProduct(f.product, f.component, null, null, 'Any');" javascript_urls=["js/productform.js", "js/field.js"] style_urls = ['skins/standard/buglist.css'] @@ -67,28 +68,12 @@ to some group are shown by default. </td> <th>Product:</th> <td> - <select name="product" onchange="selectProduct(this, this.form.component, null, null, 'Any');"> - <option value="">Any</option> - [% IF Param('useclassification') %] - [% FOREACH c = user.get_selectable_classifications %] - <optgroup label="[% c.name FILTER html %]"> - [% FOREACH p = user.get_selectable_products(c.id) %] - <option value="[% p.name FILTER html %]" - [% " selected" IF cgi.param('product') == p.name %]> - [% p.name FILTER html %] - </option> - [% END %] - </optgroup> - [% END %] - [% ELSE %] - [% FOREACH p = user.get_selectable_products %] - <option value="[% p.name FILTER html %]" - [% " selected" IF cgi.param('product') == p.name %]> - [% p.name FILTER html %] - </option> - [% END %] - [% END %] - </select> + [% INCLUDE "global/product-select.html.tmpl" + id => "product" + name => "product" + add => "Any" + onchange => "selectProduct(this, this.form.component, null, null, 'Any');" + %] </td> <th>Flag:</th> <td> @@ -201,6 +186,8 @@ to some group are shown by default. </tr> [% END %] [% PROCESS display_buglist %] + <br><br> + <a href="request.cgi?[% urlquerypart FILTER html %]&ctype=csv">View entire list as CSV</a> [% END %] [% PROCESS global/footer.html.tmpl %] @@ -210,7 +197,7 @@ to some group are shown by default. <h3>[% column_headers.$group_field %]: [%+ (request.$group_field || "None") FILTER email FILTER html %]</h3> - <table class="requests" cellspacing="0" cellpadding="4" border="1"> + <table class="requests"> <tr> [% FOREACH column = display_columns %] [% NEXT IF column == group_field || excluded_columns.contains(column) %] @@ -258,6 +245,6 @@ to some group are shown by default. </table> [% NEXT UNLESS buglist.keys.size %] <a href="buglist.cgi?bug_id= - [%- buglist.keys.nsort.join(",") FILTER html %]">(view as - [%+ terms.bug %] list)</a> + [%- buglist.keys.nsort.join(",") FILTER html %]">View as + [%+ terms.bug %] list</a> [% END %] diff --git a/template/en/default/rest.html.tmpl b/template/en/default/rest.html.tmpl new file mode 100644 index 000000000..f118e5da0 --- /dev/null +++ b/template/en/default/rest.html.tmpl @@ -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. + #%] + +<!DOCTYPE html> +<html> + <head> + <title>Bugzilla::REST::API</title> + <link href="[% urlbase FILTER html %][% 'skins/standard/global.css' FILTER mtime %]" + rel="stylesheet" type="text/css"> + </head> + <body> + <pre>[% result FILTER html %]</pre> + </body> +</html> diff --git a/template/en/default/search/boolean-charts.html.tmpl b/template/en/default/search/boolean-charts.html.tmpl index 508e11c65..bfb4e7bf1 100644 --- a/template/en/default/search/boolean-charts.html.tmpl +++ b/template/en/default/search/boolean-charts.html.tmpl @@ -33,6 +33,8 @@ "changedby", "matches", "notmatches", + "isempty", + "isnotempty", ] %] <div class="bz_section_title" id="custom_search_filter"> @@ -132,7 +134,15 @@ id="f[% cond_num FILTER html %]" onchange="fix_query_string(this)" class="custom_search_form_field"> - [% FOREACH field = fields %] + [%# Turn the array in to a hash with the name as the key %] + [% + field_hash = {}; + FOREACH field IN fields; + field_hash.${field.name} = field; + END; + %] + [% FOREACH field_name = field_hash.keys.sort_by_field_name(field_descs) %] + [% field = field_hash.$field_name %] <option value="[% field.name FILTER html %]" [%~ ' selected="selected"' IF field.name == condition.f %]> [% field_descs.${field.name} || field.description FILTER html %] diff --git a/template/en/default/search/field.html.tmpl b/template/en/default/search/field.html.tmpl index 45c3650f8..5a95d67c1 100644 --- a/template/en/default/search/field.html.tmpl +++ b/template/en/default/search/field.html.tmpl @@ -23,7 +23,7 @@ <input name="[% field.name FILTER html %]" id="[% field.name FILTER html %]" size="40" [% IF onchange %] onchange="[% onchange FILTER html %]"[% END %] - value="[% value FILTER html %]"> + value="[% value FILTER html %]" [% 'autofocus' IF focus %]> [% CASE constants.FIELD_TYPE_KEYWORDS %] [% INCLUDE "bug/field-label.html.tmpl" field = field @@ -39,10 +39,10 @@ <input name="[% field.name FILTER html %]" id="[% field.name FILTER html %]" size="40" [% IF onchange %] onchange="[% onchange FILTER html %]"[% END %] - value="[% value FILTER html %]"> + value="[% value FILTER html %]" [% 'autofocus' IF focus %]> <div id="[% field.name FILTER html %]_autocomplete"></div> </div> - <script type="text/javascript" defer="defer"> + <script type="text/javascript"> if (typeof YAHOO.bugzilla.field_array === "undefined") YAHOO.bugzilla.field_array = []; YAHOO.bugzilla.field_array["[% field.name FILTER js %]"] = [ @@ -52,7 +52,7 @@ YAHOO.bugzilla.fieldAutocomplete.init('[% field.name FILTER js %]', '[% field.name FILTER js %]_autocomplete'); </script> - [% CASE constants.FIELD_TYPE_DATETIME %] + [% CASE [constants.FIELD_TYPE_DATETIME, constants.FIELD_TYPE_DATE] %] [% INCLUDE "bug/field-label.html.tmpl" field = field tag_name = "span" diff --git a/template/en/default/search/form.html.tmpl b/template/en/default/search/form.html.tmpl index 8cfb12aac..0420811ee 100644 --- a/template/en/default/search/form.html.tmpl +++ b/template/en/default/search/form.html.tmpl @@ -52,11 +52,8 @@ TUI_hide_default('information_query'); value = default.short_desc.0 type_selected = default.short_desc_type.0 accesskey = "s" - %] - <script type="text/javascript"> <!-- - document.getElementById('short_desc').focus(); - // --> - </script> + focus = 1 + %] [% IF button_name %] <input type="submit" id="[% button_name FILTER css_class_quote %]_top" @@ -114,7 +111,7 @@ TUI_hide_default('information_query'); [%+ field_descs.longdesc FILTER html %]s, [%+ field_descs.bug_file_loc FILTER html %], [% IF Param('usestatuswhiteboard') %] [%+ field_descs.status_whiteboard FILTER html %], [%+ END %] [% IF use_keywords %] [%+ field_descs.keywords FILTER html %], [%+ END %] - [% IF user.is_timetracker %] [%+ field_descs.deadline FILTER html %], [%+ END %] + [% IF Param('timetrackinggroup') %] [%+ field_descs.deadline FILTER html %], [%+ END %] [% terms.Bug %] Numbers, [%+ field_descs.version FILTER html %], [% IF Param('usetargetmilestone') %] [%+ field_descs.target_milestone FILTER html %], [%+ END %] [% field_descs.bug_severity FILTER html %], [%+ field_descs.priority FILTER html %], [%+ field_descs.rep_platform FILTER html %], @@ -153,8 +150,7 @@ TUI_hide_default('information_query'); </div> [% END %] - [%# Deadline %] - [% IF user.is_timetracker %] + [% IF Param('timetrackinggroup') %] <div class="search_field_row"> [% INCLUDE "search/field.html.tmpl" field = bug_fields.deadline @@ -166,16 +162,18 @@ TUI_hide_default('information_query'); <div class="search_field_row"> <span class="field_label"><label for="bug_id">[% terms.Bugs %] numbered</label></span> - <div id="bug_id_container" > + <div id="bug_id_container"> <input type="text" name="bug_id" id="bug_id" value="[% default.bug_id.0 FILTER html %]" size="20"> <div class="field_help">(comma-separated list)</div> </div> - should be - <select name="bug_id_type" id="bug_id_type"> - <option value="anyexact"[% " selected" IF default.bug_id_type.0 == "anyexact" %]>only included in</option> - <option value="nowords"[% " selected" IF default.bug_id_type.0 == "nowords" %]>excluded from</option> - </select> the results + <span class="field_label field_label_sup"> + should be + <select name="bug_id_type" id="bug_id_type"> + <option value="anyexact"[% " selected" IF default.bug_id_type.0 == "anyexact" %]>only included in</option> + <option value="nowords"[% " selected" IF default.bug_id_type.0 == "nowords" %]>excluded from</option> + </select> the results + </span> </div> [% Hook.process('after_freetext_fields') %] diff --git a/template/en/default/search/search-advanced.html.tmpl b/template/en/default/search/search-advanced.html.tmpl index 2bff834bc..07c5fc528 100644 --- a/template/en/default/search/search-advanced.html.tmpl +++ b/template/en/default/search/search-advanced.html.tmpl @@ -29,8 +29,8 @@ function remove_token() { yui = [ 'autocomplete', 'calendar' ] javascript = javascript javascript_urls = [ "js/util.js", "js/TUI.js", "js/field.js"] - style_urls = [ "skins/standard/search_form.css" ] - doc_section = "query.html" + style_urls = ['skins/standard/buglist.css'] + doc_section = "using/finding.html" %] [% WRAPPER search/tabs.html.tmpl %] diff --git a/template/en/default/search/search-create-series.html.tmpl b/template/en/default/search/search-create-series.html.tmpl index d2f8f7d0b..95750ebc0 100644 --- a/template/en/default/search/search-create-series.html.tmpl +++ b/template/en/default/search/search-create-series.html.tmpl @@ -22,8 +22,8 @@ yui = [ 'autocomplete', 'calendar' ] javascript = js_data javascript_urls = [ "js/util.js", "js/TUI.js", "js/field.js" ] - style_urls = [ "skins/standard/search_form.css" ] - doc_section = "reporting.html#charts-new-series" + style_urls = ['skins/standard/buglist.css'] + doc_section = "using/reports-and-charts.html#creating-charts" %] <form method="get" action="chart.cgi" name="chartform"> diff --git a/template/en/default/search/search-report-graph.html.tmpl b/template/en/default/search/search-report-graph.html.tmpl index 698132ee6..b382edf95 100644 --- a/template/en/default/search/search-report-graph.html.tmpl +++ b/template/en/default/search/search-report-graph.html.tmpl @@ -21,8 +21,8 @@ var queryform = "reportform" yui = [ 'autocomplete', 'calendar' ] javascript = js_data javascript_urls = [ "js/util.js", "js/TUI.js", "js/field.js" ] - style_urls = [ "skins/standard/search_form.css" ] - doc_section = "reporting.html#reports" + style_urls = ['skins/standard/buglist.css'] + doc_section = "using/reports-and-charts.html#reports" %] [% PROCESS "search/search-report-select.html.tmpl" %] @@ -52,71 +52,63 @@ var queryform = "reportform" [% button_name = "Generate Report" %] <form method="get" action="report.cgi" name="reportform" id="reportform"> - -<table align="center"> - <tr> - <td valign="middle"> - <b>Vertical Axis:</b><br> - <noscript><small>(not for pie charts)</small><br></noscript> - [% PROCESS select name = 'y_axis_field' %]<br> - <br> - <b>Plot Data Sets:</b><br> - <input type="radio" name="cumulate" value="0" - [% " checked" IF default.cumulate.0 != "1" %]> - Individually<br> - <input type="radio" name="cumulate" value="1" - [% " checked" IF default.cumulate.0 == "1" %]> - Stacked - </td> - <td width="150" height="150"> - <table border="1" width="100%" height="100%"> - <tr> - <td align="center" valign="middle"> - <b>Multiple Images:</b><br> - [% PROCESS select name = 'z_axis_field' %] - </td> - </tr> - </table> - </td> - <td rowspan="2"> - <b>Format:</b><br> - [% chart_formats = [ - { name => "line", description => "Line Graph" }, - { name => "bar", description => "Bar Chart" }, - { name => "pie", description => "Pie Chart" } ] %] - [% default.chart_format.0 = default.chart_format.0 || "bar" %] - - [% FOREACH chart_format = chart_formats %] - <input type="radio" name="format" - value="[% chart_format.name FILTER html %]" - onchange="chartTypeChanged()" - [% " checked" IF default.chart_format.0 == chart_format.name %]> - [% chart_format.description FILTER html %]<br> - [% END %] - </td> - </tr> - - <tr> - <td> - </td> - <td align="left"> - <b>Horizontal Axis:</b> - [% PROCESS select name = 'x_axis_field' %]<br> - <label for="x_labels_vertical"><b>Vertical labels:</b></label> - <input type="checkbox" name="x_labels_vertical" id="x_labels_vertical" - value="1" - [% " checked" IF default.x_labels_vertical.0 == "1" %]> - </td> - <td> - </td> - </tr> -</table> - -<hr> - -[% PROCESS search/form.html.tmpl %] - -[% PROCESS "search/boolean-charts.html.tmpl" %] + <table id="graphical_reports_menu"> + <tr> + <th id="reports_menu_vertical_axis"> + Vertical Axis:<br> + [% PROCESS select name = 'y_axis_field' %]<br> + <br> + Plot Data Sets:<br> + <input type="radio" id="cumulate_indiv" name="cumulate" value="0" + [%+ 'checked="checked"' IF default.cumulate.0 != "1" %]> + <label for="cumulate_indiv">Individually</label><br> + <input type="radio" id="cumulate_stacked" name="cumulate" value="1" + [%+ 'checked="checked"' IF default.cumulate.0 == "1" %]> + <label for="cumulate_stacked">Stacked</label> + </th> + <th id="reports_menu_multiple_tables"> + Multiple Images:<br> + [% PROCESS select name = 'z_axis_field' %] + </th> + <th id="reports_menu_format"> + Format:<br> + [% chart_formats = [ + { name => "line", description => "Line Graph" }, + { name => "bar", description => "Bar Chart" }, + { name => "pie", description => "Pie Chart" } ] %] + [% default.chart_format.0 = default.chart_format.0 || "bar" %] + + [% FOREACH chart_format = chart_formats %] + <input type="radio" id="format_[% chart_format.name FILTER html %]" + name="format" value="[% chart_format.name FILTER html %]" + onchange="chartTypeChanged()" + [%+ 'checked="checked"' IF default.chart_format.0 == chart_format.name %]> + <label for="format_[% chart_format.name FILTER html %]"> + [% chart_format.description FILTER html %] + </label><br> + [% END %] + </th> + </tr> + + <tr> + <th></th> + <th id="reports_menu_horizontal_axis"> + Horizontal Axis:<br> + [% PROCESS select name = 'x_axis_field' %]<br> + <input type="checkbox" name="x_labels_vertical" id="x_labels_vertical" + value="1" + [%+ 'checked="checked"' IF default.x_labels_vertical.0 == "1" %]> + <label for="x_labels_vertical">Vertical labels</label> + </th> + <th></th> + </tr> + </table> + + <hr> + + [% PROCESS search/form.html.tmpl %] + + [% PROCESS "search/boolean-charts.html.tmpl" %] <div id="knob"> <input type="submit" id="[% button_name FILTER css_class_quote %]" diff --git a/template/en/default/search/search-report-select.html.tmpl b/template/en/default/search/search-report-select.html.tmpl index 93b4c44f8..40eeda1c1 100644 --- a/template/en/default/search/search-report-select.html.tmpl +++ b/template/en/default/search/search-report-select.html.tmpl @@ -17,7 +17,7 @@ <select name="[% name FILTER html %]"> <option value=""><none></option> - [% FOREACH field = report_columns.keys.sort %] + [% FOREACH field = report_columns.keys.sort_by_field_name(field_descs) %] [% NEXT IF field == "classification" AND !Param('useclassification') %] [% NEXT IF field == "target_milestone" AND !Param('usetargetmilestone') %] [% NEXT IF field == "qa_contact" AND !Param('useqacontact') %] diff --git a/template/en/default/search/search-report-table.html.tmpl b/template/en/default/search/search-report-table.html.tmpl index 7e0a0022d..483fd5b07 100644 --- a/template/en/default/search/search-report-table.html.tmpl +++ b/template/en/default/search/search-report-table.html.tmpl @@ -21,8 +21,8 @@ var queryform = "reportform" yui = [ 'autocomplete', 'calendar' ] javascript = js_data javascript_urls = [ "js/util.js", "js/TUI.js", "js/field.js" ] - style_urls = [ "skins/standard/search_form.css" ] - doc_section = "reporting.html#reports" + style_urls = ['skins/standard/buglist.css'] + doc_section = "using/reports-and-charts.html#reports" %] [% PROCESS "search/search-report-select.html.tmpl" %] @@ -35,36 +35,28 @@ var queryform = "reportform" [% button_name = "Generate Report" %] <form method="get" action="report.cgi" name="reportform" id="reportform"> + <table id="tabular_reports_menu"> + <tr> + <th></th> + <th id="reports_menu_horizontal_axis"> + Horizontal Axis:<br> + [% PROCESS select name = 'x_axis_field' %] + </th> + </tr> -<table align="center"> - <tr> - <td> - </td> - <td align="center"> - <b>Horizontal Axis:</b> - [% PROCESS select name = 'x_axis_field' %] - </td> - </tr> + <tr> + <th id="reports_menu_vertical_axis"> + Vertical Axis:<br> + [% PROCESS select name = 'y_axis_field' %] + </th> + <th id="reports_menu_multiple_tables"> + Multiple Tables:<br> + [% PROCESS select name = 'z_axis_field' %] + </th> + </tr> + </table> - <tr> - <td valign="middle" align="center"> - <b>Vertical Axis:</b><br> - [% PROCESS select name = 'y_axis_field' %] - </td> - <td width="150" height="150"> - <table border="1" width="100%"> - <tr> - <td align="center" valign="middle" height="150"> - <b>Multiple Tables:</b><br> - [% PROCESS select name = 'z_axis_field' %] - </td> - </tr> - </table> - </td> - </tr> -</table> - -<hr> + <hr> [% PROCESS search/form.html.tmpl %] diff --git a/template/en/default/search/search-specific.html.tmpl b/template/en/default/search/search-specific.html.tmpl index f09d4bdc0..af61ce52f 100644 --- a/template/en/default/search/search-specific.html.tmpl +++ b/template/en/default/search/search-specific.html.tmpl @@ -8,14 +8,15 @@ [% PROCESS global/header.html.tmpl title = "Simple Search" - style_urls = [ "skins/standard/search_form.css" ] + style_urls = ['skins/standard/buglist.css'] + doc_section = "using/finding.html" %] [% WRAPPER search/tabs.html.tmpl %] <p> Find a specific [% terms.bug %] by entering words that describe it. -[% terms.Bugzilla %] will search [% terms.bug %] descriptions and comments +Bugzilla will search [% terms.bug %] descriptions and comments for those words and return a list of matching [% terms.bugs %] sorted by relevance. </p> @@ -36,7 +37,7 @@ for "crash secure SSL flash". } </script> -<table summary="Search fields" class="bz_simple_search_form"> +<table class="bz_simple_search_form"> <tr> <th> <label for="bug_status">[% field_descs.bug_status FILTER html %]:</label> @@ -60,30 +61,11 @@ for "crash secure SSL flash". <label for="product">[% field_descs.product FILTER html %]:</label> </th> <td> - <select name="product" id="product"> - <option value="">All</option> - [% IF Param('useclassification') %] - [% FOREACH c = classification %] - <optgroup label="[% c.name FILTER html %]"> - [% FOREACH p = user.get_selectable_products(c.id) %] - [% IF p.components.size %] - <option value="[% p.name FILTER html %]" - [% " selected" IF default.product.contains(p.name) %]> - [% p.name FILTER html %] - </option> - [% END %] - [% END %] - </optgroup> - [% END %] - [% ELSE %] - [% FOREACH p = product %] - <option value="[% p.name FILTER html %]" - [% " selected" IF default.product.contains(p.name) %]> - [% p.name FILTER html %] - </option> - [% END %] - [% END %] - </select> + [% INCLUDE "global/product-select.html.tmpl" + id => "product" + name => "product" + add => "All" + %] </td> </tr> <tr> @@ -91,28 +73,14 @@ for "crash secure SSL flash". <label for="content">Words:</label> </th> <td> - <input name="content" size="40" id="content" - value="[% default.content.0 FILTER html %]"> - <script type="text/javascript"> <!-- - document.forms['queryform'].content.focus(); - // --> - </script> + <input name="content" size="40" id="content" autofocus + value="[% default.content.0 FILTER html %]" + [%- " required" UNLESS Param('search_allow_no_criteria') %]> </td> </tr> <tr> <td></td> - <td> - - [% IF Param('search_allow_no_criteria') %] - <input type="submit" id="search" value="Search"> - [% ELSE %] - <input type="submit" id="search" value="Search" - onclick="if (this.form.content.value == '') - {alert('The Words field cannot be empty. You have to ' + - 'enter at least one word in your search criteria.'); - return false;} return true;"> - [% END %] - </td> + <td><input type="submit" id="search" value="Search"></td> </tr> </table> </form> diff --git a/template/en/default/search/tabs.html.tmpl b/template/en/default/search/tabs.html.tmpl index f7703fd92..74569dceb 100644 --- a/template/en/default/search/tabs.html.tmpl +++ b/template/en/default/search/tabs.html.tmpl @@ -10,11 +10,15 @@ # This template has no interface. #%] +[% tabs = [ { name => 'specific', label => "Simple Search", + link => "query.cgi?format=specific" }, + { name => 'advanced', label => "Advanced Search", + link => "query.cgi?format=advanced" } ] %] + +[% Hook.process('search_tabs') %] + [% WRAPPER global/tabs.html.tmpl - tabs = [ { name => 'specific', label => "Simple Search", - link => "query.cgi?format=specific" }, - { name => 'advanced', label => "Advanced Search", - link => "query.cgi?format=advanced" } ] + tabs = tabs current_tab_name = query_format || format || "advanced" %] diff --git a/template/en/default/setup/strings.txt.pl b/template/en/default/setup/strings.txt.pl index d134ef429..78c4d861b 100644 --- a/template/en/default/setup/strings.txt.pl +++ b/template/en/default/setup/strings.txt.pl @@ -83,17 +83,19 @@ the documentation of Bugzilla::Extension for details. END feature_auth_ldap => 'LDAP Authentication', feature_auth_radius => 'RADIUS Authentication', + feature_documentation => 'Documentation', feature_graphical_reports => 'Graphical Reports', feature_html_desc => 'More HTML in Product/Group Descriptions', feature_inbound_email => 'Inbound Email', feature_jobqueue => 'Mail Queueing', feature_jsonrpc => 'JSON-RPC Interface', - feature_jsonrpc_faster => 'Make JSON-RPC Faster', feature_new_charts => 'New Charts', feature_old_charts => 'Old Charts', + feature_memcached => 'Memcached Support', feature_mod_perl => 'mod_perl', feature_moving => 'Move Bugs Between Installations', feature_patch_viewer => 'Patch Viewer', + feature_rest => 'REST Interface', feature_smtp_auth => 'SMTP Authentication', feature_smtp_ssl => 'SSL Support for SMTP', feature_updates => 'Automatic Update Notifications', @@ -153,10 +155,6 @@ they don't exist. If this is set to 0, checksetup.pl will not create .htaccess files. END - localconfig_cvsbin => <<'END', -If you want to use the CVS integration of the Patch Viewer, please specify -the full path to the "cvs" executable here. -END localconfig_db_check => <<'END', Should checksetup.pl try to verify that your database setup is correct? With some combinations of database servers/Perl modules/moonphase this @@ -195,6 +193,22 @@ blank, then MySQL's compiled-in default will be used. You probably want that. END localconfig_db_user => "Who we connect to the database as.", + localconfig_db_mysql_ssl_ca_file => <<'END', +Path to a PEM file with a list of trusted SSL CA certificates. +The file must be readable by web server user. +END + localconfig_db_mysql_ssl_ca_path => <<'END', +Path to a directory containing trusted SSL CA certificates in PEM format. +Directory and files inside must be readable by the web server user. +END + localconfig_db_mysql_ssl_client_cert => <<'END', +Full path to the client SSL certificate in PEM format we will present to the DB server. +The file must be readable by web server user. +END + localconfig_db_mysql_ssl_client_key => <<'END', +Full path to the private key corresponding to the client SSL certificate. +The file must not be password-protected and must be readable by web server user. +END localconfig_diffpath => <<'END', For the "Difference Between Two Patches" feature to work, we need to know what directory the "diff" bin is in. (You only need to set this if you @@ -272,12 +286,15 @@ EOT *********************************************************************** * APACHE MODULES * *********************************************************************** -* Normally, when Bugzilla is upgraded, all Bugzilla users have to * -* clear their browser cache or Bugzilla will break. If you enable * -* certain modules in your Apache configuration (usually called * -* httpd.conf or apache2.conf) then your users will not have to clear * -* their caches when you upgrade Bugzilla. The modules you need to * -* enable are: * +* Some Apache modules allow to extend Bugzilla functionalities. * +* These modules can be enabled in the Apache configuration file * +* (usually called httpd.conf or apache2.conf). * +* - mod_headers, mod_env and mod_expires permit to automatically * +* refresh the browser cache of your users when upgrading Bugzilla. * +* - mod_rewrite permits to write shorter URLs used by the REST API. * +* - mod_version permits to write rules in .htaccess specific to * +* Apache 2.2 or 2.4. * +* The modules you need to enable are: * * * END modules_message_db => <<EOT, @@ -342,8 +359,7 @@ WARNING: We are about to convert your table storage format to UTF-8. This recommend that you stop checksetup.pl NOW and run contrib/recode.pl. END no_checksetup_from_cgi => <<END, -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" - "http://www.w3.org/TR/html4/strict.dtd"> +<!DOCTYPE html> <html> <head> <title>checksetup.pl cannot run from a web browser</title> @@ -354,8 +370,8 @@ END <p> You <b>must not</b> execute this script from your web browser. To install or upgrade Bugzilla, run this script from - the command-line (e.g. <tt>bash</tt> or <tt>ssh</tt> on Linux - or <tt>cmd.exe</tt> on Windows), and follow instructions given there. + the command-line (e.g. <kbd>bash</kbd> or <kbd>ssh</kbd> on Linux + or <kbd>cmd.exe</kbd> on Windows), and follow instructions given there. </p> <p> @@ -371,7 +387,7 @@ OPTIONAL NOTE: If you want to be able to use the 'difference between two patches' feature of Bugzilla (which requires the PatchReader Perl module as well), you should install patchutils from: - http://cyberelk.net/tim/patchutils/ + http://cyberelk.net/tim/software/patchutils/ END template_precompile => "Precompiling templates...", template_removal_failed => <<END, diff --git a/template/en/default/welcome-admin.html.tmpl b/template/en/default/welcome-admin.html.tmpl index 7878ddfcd..7d7b6ab59 100644 --- a/template/en/default/welcome-admin.html.tmpl +++ b/template/en/default/welcome-admin.html.tmpl @@ -10,12 +10,11 @@ # none #%] -[% title = BLOCK %]Welcome to [% terms.Bugzilla %][% END %] +[% title = BLOCK %]Welcome to Bugzilla[% END %] [% PROCESS global/header.html.tmpl title = title header_addl_info = "version ${constants.BUGZILLA_VERSION}${constants.GENTOO_APPEND_VERSION} node ${constants.GENTOO_NODE}" - style_urls = [ 'skins/standard/index.css' ] %] <div id="welcome-admin"> @@ -55,7 +54,7 @@ <li><a href="editparams.cgi?section=auth#createemailregexp_desc">createemailregexp</a> defines which users are allowed to create an account on this installation. If set - to ".*" (the default), everybody is free to create his own account. If set to + to ".*" (the default), everybody is free to create their own account. If set to "@mycompany.com$", only users having an account @mycompany.com will be allowed to create an account. If left blank, users will not be able to create accounts themselves; only an administrator will be able to create one for them. If you want a private @@ -68,7 +67,7 @@ </ul> <p> - After having set up all this, we recommend looking at [% terms.Bugzilla %]'s other + After having set up all this, we recommend looking at Bugzilla's other parameters as well at some time so that you understand what they do and whether you want to modify their settings for your installation. </p> diff --git a/template/en/default/whine/mail.html.tmpl b/template/en/default/whine/mail.html.tmpl index b581d68fd..ed030237d 100644 --- a/template/en/default/whine/mail.html.tmpl +++ b/template/en/default/whine/mail.html.tmpl @@ -18,20 +18,20 @@ # recipient: user object for the intended recipient of the message #%] -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<!DOCTYPE html> <html> <head> <title> [[% terms.Bugzilla %]] [% subject FILTER html %] </title> </head> - <body bgcolor="#FFFFFF"> + <body> <pre> [% body FILTER html %] </pre> - <p align="left"> + <p> [% IF author.login == recipient.login %] <a href="[%+ urlbase FILTER html %]editwhines.cgi">Click here to edit your whine schedule</a> @@ -45,29 +45,29 @@ <h2>[%+ query.title FILTER html %] ([% query.bugs.size %] [%+ terms.bugs %])</h2> - <table width="100%"> + <table> <tr> - <th align="left">ID</th> + <th>ID</th> [% FOREACH col = query.columnlist %] [% NEXT IF col == 'bug_id' %] - <th align="left">[% field_descs.$col FILTER html %]</th> + <th>[% field_descs.$col FILTER html %]</th> [% END %] </tr> [% FOREACH bug=query.bugs %] <tr> - <td align="left"><a href="[%+ urlbase FILTER html %]show_bug.cgi?id= + <td><a href="[%+ urlbase FILTER html %]show_bug.cgi?id= [%- bug.bug_id %]">[% bug.bug_id %]</a></td> [% FOREACH col = query.columnlist %] [% NEXT IF col == 'bug_id' %] - <td align="left">[% display_value(col, bug.$col) FILTER html %]</td> + <td>[% display_value(col, bug.$col) FILTER html %]</td> [% END %] </tr> [% END %] </table> [% IF author.login == recipient.login %] - <p align="left"> + <p> <a href="[% urlbase FILTER html %]buglist.cgi?cmdtype=runnamed&namedcmd=[% query.name FILTER uri %]">View as [% terms.bug %] list</a> </p> [% END %] diff --git a/template/en/default/whine/schedule.html.tmpl b/template/en/default/whine/schedule.html.tmpl index dd58fc53b..a513d9a33 100644 --- a/template/en/default/whine/schedule.html.tmpl +++ b/template/en/default/whine/schedule.html.tmpl @@ -23,11 +23,11 @@ [% PROCESS global/header.html.tmpl title = title style_urls = ['skins/standard/admin.css'] - doc_section = "whining.html" + doc_section = "using/index.html" %] <p> - "Whining" is when [% terms.Bugzilla %] executes a saved query at a regular interval + "Whining" is when Bugzilla executes a saved search at a regular interval and sends the resulting list of [% terms.bugs %] via email. </p> @@ -47,9 +47,9 @@ <p> Searches come from saved searches, which are created by executing a <a - href="query.cgi">search</a>, then telling [% terms.Bugzilla %] to remember - the search under a particular name. Add a query by clicking "Add a new - query", and select the desired saved search name under "Search" and add a + href="query.cgi">search</a>, then telling Bugzilla to remember + the search under a particular name. Add a search by clicking "Add a + search", and select the desired saved search name under "Search" and add a title for the [% terms.bug %] table. The optional number entered under "Sort" will determine the execution order (lowest to highest) if multiple queries are listed. If you check "One message per [% terms.bug %]," each [% @@ -63,29 +63,25 @@ <form method="post" action="editwhines.cgi"> [%# This hidden submit button must be here to set default behavior when the user presses return on a form input field #%] -<input type="submit" value="Update / Commit" name="commit" - style="display: none;" id="commit"> +<input type="submit" value="Update / Commit" id="commit" name="commit" + class="bz_default_hidden"> <input type="hidden" name="update" value="1"> <input type="hidden" name="token" value="[% token FILTER html %]"> [% FOREACH event = events %] -<table cellspacing="2" cellpadding="2" style="border: 1px solid;"> +<table class="whining_list"> <tr> - <th align="left"> - Event: - </th> - <td align="right" colspan="2"> + <th class="subtitle">Event:</th> + <th colspan="2"> <input type="submit" value="Remove Event" name="remove_event_[% event.key %]" id="remove_event_[% event.key %]"> - </td> + </th> </tr> <tr> - <td valign="top" align="right"> - Email subject line: - </td> + <th>Email subject line:</th> <td colspan="2"> <input type="text" name="event_[% event.key %]_subject" size="60" maxlength="128" value=" @@ -94,9 +90,7 @@ </tr> <tr> - <td valign="top" align="right"> - Descriptive text sent within whine message: - </td> + <th>Descriptive text sent within whine message:</th> <td colspan="2"> [% INCLUDE global/textarea.html.tmpl name = "event_${event.key}_body" @@ -110,9 +104,7 @@ </tr> <tr> - <td valign="top" align="right"> - Send a message even if there are no [% terms.bugs %] in the search result: - </td> + <th>Send a message even if there are no [% terms.bugs %] in the search result:</th> <td colspan="2"> <input type="checkbox" name="event_[% event.key %]_mailifnobugs" [%- IF event.value.mailifnobugs == 1 %] checked [% END %]> @@ -122,9 +114,7 @@ [% IF event.value.schedule.size == 0 %] <tr> - <td valign="top" align="right"> - Schedule: - </td> + <th>Schedule:</th> <td class="unset" colspan="2"> Not scheduled to run<br> <input type="submit" value="Add a new schedule" @@ -136,28 +126,23 @@ [% ELSE %] <tr> - <td valign="top" align="right"> - Schedule: - </td> + <th>Schedule:</th> <td class="set" colspan="2"> - <table> + <table class="schedule_list"> <tr> - <th> - Interval - </th> + <th>Interval</th> <th> [% IF mail_others %] Mail to [% END %] </th> - <th> - </th> + <th></th> </tr> + [% FOREACH schedule = event.value.schedule %] <tr> - <td align="left"> - + <td> [%# these hidden fields allow us to compare old values instead of reading the database to tell if a field has changed %] @@ -168,7 +153,7 @@ [% PROCESS day_field val=schedule.day %] [% PROCESS time_field val=schedule.time %] </td> - <td align="left"> + <td> [% IF mail_others %] <input type="hidden" name="orig_mailto_type_[% schedule.id %]" value="[% schedule.mailto_type FILTER html %]"> @@ -186,7 +171,7 @@ value="[% schedule.mailto FILTER html %]" size="30"> [% END %] </td> - <td align="left"> + <td> <input type="submit" value="Remove" name="remove_schedule_[% schedule.id %]" id="remove_schedule_[% schedule.id %]"> @@ -211,16 +196,14 @@ [% IF event.value.queries.size == 0 %] <tr> - <td valign="top" align="right"> - Searches: - </td> - <td align="left"> + <th>Searches:</th> + <td> No searches <br> - <input type="submit" value="Add a new query" + <input type="submit" value="Add a search" name="add_query_[% event.key %]" id="add_query_[% event.key %]"> </td> - <td align="right" valign="bottom"> + <td class="right"> <input type="submit" value="Update / Commit" name="commit" id="update"> </td> </tr> @@ -228,42 +211,39 @@ [% ELSE %] <tr> - <td valign="top" align="right"> - Searches: - </td> - <td align="left" colspan="2"> + <th>Searches:</th> + <td colspan="2"> - <table> + <table class="search_list"> <tr> <th>Sort</th> <th>Search</th> <th>Title</th> - <th></th> - <th></th> + <th colspan="2"></th> </tr> [% FOREACH query = event.value.queries %] <tr> - <td align="left"> + <td> <input type="text" name="query_sort_[% query.id %]" size="3" value="[% query.sort %]"> <input type="hidden" value="[% query.sort %]" name="orig_query_sort_[% query.id %]"> </td> - <td align="left"> + <td> <input type="hidden" value="[% query.name FILTER html %]" name="orig_query_name_[% query.id %]"> [% PROCESS query_field thisquery=query.name %] </td> - <td align="left"> + <td> <input type="hidden" value="[% query.title FILTER html %]" name="orig_query_title_[% query.id %]"> <input type="text" name="query_title_[% query.id %]" size="50" value="[% query.title FILTER html %]" maxlength="64"> </td> - <td align="left"> + <td> <input type="hidden" value="[% query.onemailperbug FILTER html %]" name="orig_query_onemailperbug_[% query.id %]"> <input type="checkbox" [% IF query.onemailperbug == 1 %] checked [% END %] @@ -271,7 +251,7 @@ name="query_onemailperbug_[% query.id %]"> <label for="query_onemailperbug_[% query.id %]">One message per [% terms.bug %]</label> </td> - <td align="right"> + <td> <input type="submit" value="Remove" name="remove_query_[% query.id %]" id="remove_query_[% query.id %]"> @@ -282,11 +262,11 @@ <tr> <td colspan="3"> - <input type="submit" value="Add a new query" + <input type="submit" value="Add a search" name="add_query_[% event.key %]" id="add_query_[% event.key %]"> </td> - <td align="right" colspan="2"> + <td colspan="2" class="right"> <input type="submit" value="Update / Commit" name="commit" id="update"> </td> </tr> @@ -301,7 +281,7 @@ [% END %] -<p align="left"> +<p> <input type="submit" value="Add a new event" name="add_event" id="add_event"> </p> @@ -322,7 +302,7 @@ </select> [% ELSE %] - Please visit the <a href="query.cgi">Search</a> page and save a query + Please visit the <a href="query.cgi">Search</a> page and save a search [% END %] [%+ END %] diff --git a/testagent.cgi b/testagent.cgi index 3480f877e..d9d5afd1a 100755 --- a/testagent.cgi +++ b/testagent.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -10,7 +10,10 @@ # are being run instead of shown. This script does not rely on database access # or correct params. +use 5.10.1; use strict; -print "content-type:text/plain\n\n"; -print "OK " . ($::ENV{MOD_PERL} || "mod_cgi") . "\n"; +use warnings; + +say "content-type:text/plain\n"; +say "OK " . ($::ENV{MOD_PERL} || "mod_cgi"); exit; diff --git a/testserver.pl b/testserver.pl index 12cdfe5f0..d827c80ea 100755 --- a/testserver.pl +++ b/testserver.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl # 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/. @@ -10,7 +10,10 @@ # as its only argument. It attempts to troubleshoot as many installation # issues as possible. +use 5.10.1; use strict; +use warnings; + use lib qw(. lib); use Bugzilla; @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,10 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; + use lib qw(. lib); use Bugzilla; @@ -123,17 +126,18 @@ sub requestChangePassword { or ThrowUserError("login_needed_for_password_change"); check_email_syntax($login_name); - my $user = Bugzilla::User->check($login_name); + my $user = new Bugzilla::User({ name => $login_name }); # Make sure the user account is active. - if (!$user->is_enabled) { + if ($user && !$user->is_enabled) { ThrowUserError('account_disabled', {disabled_reason => get_text('account_disabled', {account => $login_name})}); } - Bugzilla::Token::IssuePasswordToken($user); + Bugzilla::Token::IssuePasswordToken($user) if $user; $vars->{'message'} = "password_change_request"; + $vars->{'login_name'} = $login_name; print $cgi->header(); $template->process("global/message.html.tmpl", $vars) @@ -315,11 +319,11 @@ sub confirm_create_account { # Now delete this token. delete_token($token); - # Let the user know that his user account has been successfully created. + # Let the user know that their user account has been successfully created. $vars->{'message'} = 'account_created'; $vars->{'otheruser'} = $otheruser; - # Log in the new user using credentials he just gave. + # Log in the new user using credentials they just gave. $cgi->param('Bugzilla_login', $otheruser->login); $cgi->param('Bugzilla_password', $password); Bugzilla->login(LOGIN_OPTIONAL); diff --git a/userprefs.cgi b/userprefs.cgi index 19793ec84..870a63f82 100755 --- a/userprefs.cgi +++ b/userprefs.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,17 +6,22 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; use lib qw(. lib); use Bugzilla; use Bugzilla::BugMail; use Bugzilla::Constants; +use Bugzilla::Mailer; use Bugzilla::Search; use Bugzilla::Util; use Bugzilla::Error; use Bugzilla::User; +use Bugzilla::User::APIKey; +use Bugzilla::User::Setting qw(clear_settings_cache); use Bugzilla::Token; my $template = Bugzilla->template; @@ -133,7 +138,7 @@ sub DoSettings { my $settings = $user->settings; $vars->{'settings'} = $settings; - my @setting_list = keys %$settings; + my @setting_list = sort keys %$settings; $vars->{'setting_names'} = \@setting_list; $vars->{'has_settings_enabled'} = 0; @@ -171,6 +176,7 @@ sub SaveSettings { } } $vars->{'settings'} = $user->settings(1); + clear_settings_cache($user->id); } sub DoEmail { @@ -321,6 +327,47 @@ sub SaveEmail { $dbh->bz_commit_transaction(); } + + ########################################################################### + # Ignore Bugs + ########################################################################### + my %ignored_bugs = map { $_->{'id'} => 1 } @{$user->bugs_ignored}; + + # Validate the new bugs to ignore by checking that they exist and also + # if the user gave an alias + my @add_ignored = split(/[\s,]+/, $cgi->param('add_ignored_bugs')); + @add_ignored = map { Bugzilla::Bug->check($_)->id } @add_ignored; + map { $ignored_bugs{$_} = 1 } @add_ignored; + + # Remove any bug ids the user no longer wants to ignore + foreach my $key (grep(/^remove_ignored_bug_/, $cgi->param)) { + my ($bug_id) = $key =~ /(\d+)$/; + delete $ignored_bugs{$bug_id}; + } + + # Update the database with any changes made + my ($removed, $added) = diff_arrays([ map { $_->{'id'} } @{$user->bugs_ignored} ], + [ keys %ignored_bugs ]); + + if (scalar @$removed || scalar @$added) { + $dbh->bz_start_transaction(); + + if (scalar @$removed) { + $dbh->do('DELETE FROM email_bug_ignore WHERE user_id = ? AND ' . + $dbh->sql_in('bug_id', $removed), + undef, $user->id); + } + if (scalar @$added) { + my $sth = $dbh->prepare('INSERT INTO email_bug_ignore + (user_id, bug_id) VALUES (?, ?)'); + $sth->execute($user->id, $_) foreach @$added; + } + + # Reset the cache of ignored bugs if the list changed. + delete $user->{bugs_ignored}; + + $dbh->bz_commit_transaction(); + } } @@ -328,9 +375,9 @@ sub DoPermissions { my $dbh = Bugzilla->dbh; my $user = Bugzilla->user; my (@has_bits, @set_bits); - + my $groups = $dbh->selectall_arrayref( - "SELECT DISTINCT name, description FROM groups WHERE id IN (" . + "SELECT DISTINCT name, description FROM groups WHERE id IN (" . $user->groups_as_string . ") ORDER BY name"); foreach my $group (@$groups) { my ($nam, $desc) = @$group; @@ -346,7 +393,7 @@ sub DoPermissions { } } - # If the user has product specific privileges, inform him about that. + # If the user has product specific privileges, inform them about that. foreach my $privs (PER_PRODUCT_PRIVILEGES) { next if $user->in_group($privs); $vars->{"local_$privs"} = $user->get_products_by_permission($privs); @@ -412,7 +459,7 @@ sub SaveSavedSearches { } if ($group_id) { - # Don't allow the user to share queries with groups he's not + # Don't allow the user to share queries with groups they're not # allowed to. next unless grep($_ eq $group_id, @{$user->queryshare_groups}); @@ -453,15 +500,69 @@ sub SaveSavedSearches { } $user->flush_queries_cache; - + # Update profiles.mybugslink. my $showmybugslink = defined($cgi->param("showmybugslink")) ? 1 : 0; $dbh->do("UPDATE profiles SET mybugslink = ? WHERE userid = ?", - undef, ($showmybugslink, $user->id)); + undef, ($showmybugslink, $user->id)); $user->{'showmybugslink'} = $showmybugslink; + Bugzilla->memcached->clear({ table => 'profiles', id => $user->id }); } +sub DoApiKey { + my $user = Bugzilla->user; + + my $api_keys = Bugzilla::User::APIKey->match({ user_id => $user->id }); + $vars->{api_keys} = $api_keys; + $vars->{any_revoked} = grep { $_->revoked } @$api_keys; +} + +sub SaveApiKey { + my $cgi = Bugzilla->cgi; + my $dbh = Bugzilla->dbh; + my $user = Bugzilla->user; + + # Do it in a transaction. + $dbh->bz_start_transaction; + + # Update any existing keys + my $api_keys = Bugzilla::User::APIKey->match({ user_id => $user->id }); + foreach my $api_key (@$api_keys) { + my $description = $cgi->param('description_' . $api_key->id); + my $revoked = $cgi->param('revoked_' . $api_key->id); + + if ($description ne $api_key->description + || $revoked != $api_key->revoked) + { + $api_key->set_all({ + description => $description, + revoked => $revoked, + }); + $api_key->update(); + } + } + + # Create a new API key if requested. + if ($cgi->param('new_key')) { + $vars->{new_key} = Bugzilla::User::APIKey->create({ + user_id => $user->id, + description => scalar $cgi->param('new_description'), + }); + + # As a security precaution, we always sent out an e-mail when + # an API key is created + my $template = Bugzilla->template_inner($user->setting('lang')); + my $message; + $template->process('email/new-api-key.txt.tmpl', $vars, \$message) + || ThrowTemplateError($template->error()); + + MessageToMTA($message); + } + + $dbh->bz_commit_transaction; +} + ############################################################################### # Live code (not subroutine definitions) starts here ############################################################################### @@ -531,6 +632,11 @@ SWITCH: for ($current_tab_name) { DoSavedSearches(); last SWITCH; }; + /^apikey$/ && do { + SaveApiKey() if $save_changes; + DoApiKey(); + last SWITCH; + }; ThrowUserError("unknown_tab", { current_tab_name => $current_tab_name }); @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -9,8 +9,12 @@ # This script remains as a backwards-compatibility URL for before # the time that Voting was an extension. +use 5.10.1; use strict; +use warnings; + use lib qw(. lib); + use Bugzilla; use Bugzilla::Error; @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -10,7 +10,9 @@ # Script Initialization ################################################################################ +use 5.10.1; use strict; +use warnings; use lib qw(. lib); @@ -422,16 +424,8 @@ sub run_queries { next unless $savedquery; # silently ignore missing queries # Execute the saved query - my @searchfields = qw( - bug_id - bug_severity - priority - rep_platform - assigned_to - bug_status - resolution - short_desc - ); + my @searchfields = ('bug_id', DEFAULT_COLUMN_LIST); + # A new Bugzilla::CGI object needs to be created to allow # Bugzilla::Search to execute a saved query. It's exceedingly weird, # but that's how it works. diff --git a/whineatnews.pl b/whineatnews.pl index 4a5c967c6..4812b4cfe 100755 --- a/whineatnews.pl +++ b/whineatnews.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl # 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/. @@ -14,7 +14,10 @@ # param. (We have NEW and REOPENED in there to keep compatibility with old # Bugzillas.) +use 5.10.1; use strict; +use warnings; + use lib qw(. lib); use Bugzilla; diff --git a/xmlrpc.cgi b/xmlrpc.cgi index 64197a819..893bfba5d 100755 --- a/xmlrpc.cgi +++ b/xmlrpc.cgi @@ -1,4 +1,4 @@ -#!/usr/bin/perl -wT +#!/usr/bin/perl -T # 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/. @@ -6,7 +6,10 @@ # This Source Code Form is "Incompatible With Secondary Licenses", as # defined by the Mozilla Public License, v. 2.0. +use 5.10.1; use strict; +use warnings; + use lib qw(. lib); use Bugzilla; diff --git a/xt/lib/Bugzilla/Test/Search/AndTest.pm b/xt/lib/Bugzilla/Test/Search/AndTest.pm index ac417121e..f34ba1f3a 100644 --- a/xt/lib/Bugzilla/Test/Search/AndTest.pm +++ b/xt/lib/Bugzilla/Test/Search/AndTest.pm @@ -8,7 +8,7 @@ # This test combines two field/operator combinations using AND in # a single boolean chart. package Bugzilla::Test::Search::AndTest; -use base qw(Bugzilla::Test::Search::OrTest); +use parent qw(Bugzilla::Test::Search::OrTest); use Bugzilla::Test::Search::Constants; use List::MoreUtils qw(all); diff --git a/xt/lib/Bugzilla/Test/Search/Constants.pm b/xt/lib/Bugzilla/Test/Search/Constants.pm index 9d62abb94..5d84ec6ff 100644 --- a/xt/lib/Bugzilla/Test/Search/Constants.pm +++ b/xt/lib/Bugzilla/Test/Search/Constants.pm @@ -12,7 +12,7 @@ # More detailed information on each constant is available in the comments # in this file. package Bugzilla::Test::Search::Constants; -use base qw(Exporter); +use parent qw(Exporter); use Bugzilla::Constants; use Bugzilla::Util qw(generate_random_password); @@ -947,6 +947,9 @@ use constant TESTS => { }, }, ], + # XXX these need tests developed + isempty => [], + isnotempty => [], }; # Fields that do not behave as we expect, for InjectionTest. @@ -995,6 +998,8 @@ use constant INJECTION_BROKEN_OPERATOR => { changedafter => { search => 1, field_ok => ['creation_ts'] }, changedbefore => { search => 1, field_ok => ['creation_ts'] }, changedby => { search => 1 }, + isempty => { search => 1 }, + isnotempty => { search => 1 }, }; # Tests run by Bugzilla::Test::Search::InjectionTest. diff --git a/xt/lib/Bugzilla/Test/Search/CustomTest.pm b/xt/lib/Bugzilla/Test/Search/CustomTest.pm index 15e302cf3..132e5ac40 100644 --- a/xt/lib/Bugzilla/Test/Search/CustomTest.pm +++ b/xt/lib/Bugzilla/Test/Search/CustomTest.pm @@ -9,7 +9,7 @@ # Tests like this are specified in CUSTOM_SEARCH_TESTS in # Bugzilla::Test::Search::Constants. package Bugzilla::Test::Search::CustomTest; -use base qw(Bugzilla::Test::Search::FieldTest); +use parent qw(Bugzilla::Test::Search::FieldTest); use strict; use warnings; diff --git a/xt/lib/Bugzilla/Test/Search/FieldTestNormal.pm b/xt/lib/Bugzilla/Test/Search/FieldTestNormal.pm index 4147c249e..888e7eb13 100644 --- a/xt/lib/Bugzilla/Test/Search/FieldTestNormal.pm +++ b/xt/lib/Bugzilla/Test/Search/FieldTestNormal.pm @@ -10,7 +10,7 @@ package Bugzilla::Test::Search::FieldTestNormal; use strict; use warnings; -use base qw(Bugzilla::Test::Search::FieldTest); +use parent qw(Bugzilla::Test::Search::FieldTest); use Scalar::Util qw(blessed); diff --git a/xt/lib/Bugzilla/Test/Search/InjectionTest.pm b/xt/lib/Bugzilla/Test/Search/InjectionTest.pm index 86dff3e0f..90eaabc78 100644 --- a/xt/lib/Bugzilla/Test/Search/InjectionTest.pm +++ b/xt/lib/Bugzilla/Test/Search/InjectionTest.pm @@ -8,7 +8,7 @@ # This module represents the SQL Injection tests that get run on a single # operator/field combination for Bugzilla::Test::Search. package Bugzilla::Test::Search::InjectionTest; -use base qw(Bugzilla::Test::Search::FieldTest); +use parent qw(Bugzilla::Test::Search::FieldTest); use strict; use warnings; diff --git a/xt/lib/Bugzilla/Test/Search/NotTest.pm b/xt/lib/Bugzilla/Test/Search/NotTest.pm index def4f9ac9..190b8567b 100644 --- a/xt/lib/Bugzilla/Test/Search/NotTest.pm +++ b/xt/lib/Bugzilla/Test/Search/NotTest.pm @@ -12,7 +12,7 @@ # it to OrTest and AndTest, but without Moose there isn't much of an # easy way to do that. package Bugzilla::Test::Search::NotTest; -use base qw(Bugzilla::Test::Search::FieldTest); +use parent qw(Bugzilla::Test::Search::FieldTest); use strict; use warnings; use Bugzilla::Test::Search::Constants; diff --git a/xt/lib/Bugzilla/Test/Search/OrTest.pm b/xt/lib/Bugzilla/Test/Search/OrTest.pm index d460e4422..1b948f38d 100644 --- a/xt/lib/Bugzilla/Test/Search/OrTest.pm +++ b/xt/lib/Bugzilla/Test/Search/OrTest.pm @@ -8,7 +8,7 @@ # This test combines two field/operator combinations using OR in # a single boolean chart. package Bugzilla::Test::Search::OrTest; -use base qw(Bugzilla::Test::Search::FieldTest); +use parent qw(Bugzilla::Test::Search::FieldTest); use Bugzilla::Test::Search::Constants; use List::MoreUtils qw(all any uniq); |