From ef7826bde482a94dd7aa935d39e15f91d931c1eb Mon Sep 17 00:00:00 2001 From: vfilippov Date: Fri, 14 Jan 2011 12:25:54 +0000 Subject: [PATCH] Bug 61456 - Add forgotten user error git-svn-id: svn://svn.office.custis.ru/3rdparty/bugzilla.org/trunk@1196 6955db30-a419-402b-8a0d-67ecbb4d7f56 --- Bugzilla/Bug.pm | 3 + Bugzilla/Field/Choice.pm | 1 + .../en/default/global/user-error.html.tmpl | 182 +++++++++--------- 3 files changed, 98 insertions(+), 88 deletions(-) diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm index 995dd2bc7..685df5adc 100644 --- a/Bugzilla/Bug.pm +++ b/Bugzilla/Bug.pm @@ -799,6 +799,9 @@ sub check_dependent_fields }); } + use Data::Dumper; + die Dumper $validators; + if (Bugzilla->usage_mode == USAGE_MODE_BROWSER && (%$incorrect_fields || $verify_bug_groups)) { Bugzilla->template->process('bug/process/verify-field-values.html.tmpl', { diff --git a/Bugzilla/Field/Choice.pm b/Bugzilla/Field/Choice.pm index 0cb940d6a..53b266f88 100644 --- a/Bugzilla/Field/Choice.pm +++ b/Bugzilla/Field/Choice.pm @@ -479,6 +479,7 @@ sub check_visibility my $vf = $self->field->value_field || return 1; my $m = $vf->name; $m = blessed $bug ? $bug->$m : $bug->{$m}; + $m = ref $m ? $m->name : $m; my $value = Bugzilla::Field::Choice->type($vf)->new({ name => $m }) || return 1; return $self->has_visibility_value($value); } diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index 0dd3ad9e8..0251b35fd 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -32,7 +32,7 @@ # Note that you must explicitly filter every single template variable # in this file; if you do not wish to change it, use the "none" filter. # - # Extension- or custom-specific error handling can be easily added + # Extension- or custom-specific error handling can be easily added # via hooks: just place additional code into # template/en/hook/global/user-error-errors.html.tmpl # Note: be aware of uniqueness of error string parameter value, since @@ -186,7 +186,7 @@ a sudo session [% ELSIF object == "timetracking_summaries" %] time-tracking summary reports - [% ELSIF object == "user" %] + [% ELSIF object == "user" %] the user [% IF userid %] with ID '[% userid FILTER html %]' [% ELSE %]you specified [% END %] [% ELSIF object == "users" %] @@ -247,7 +247,7 @@ [% ELSIF error == "bug_url_too_long" %] [% title = "Invalid $terms.Bug URL" %] - [% terms.Bug %] URLs can not be longer than + [% terms.Bug %] URLs can not be longer than [%+ constants.MAX_BUG_URL_LENGTH FILTER none %] characters long. [% url FILTER html %] is too long. @@ -285,7 +285,7 @@ [% ELSIF error == "comment_too_long" %] [% title = "Comment Too Long" %] - Comments cannot be longer than + Comments cannot be longer than [%+ constants.MAX_COMMENT_LENGTH FILTER html %] characters. [% ELSIF error == "auth_classification_not_enabled" %] @@ -420,7 +420,7 @@ [% ELSIF error == "empty_group_name" %] [% title = "The group name can not be empty" %] You must enter a name for the group. - + [% ELSIF error == "entry_access_denied" %] [% title = "Permission Denied" %] [% admindocslinks = {'groups.html' => 'Group Security'} %] @@ -437,13 +437,13 @@ [% ELSIF error == "field_already_exists" %] [% title = "Field Already Exists" %] - The field '[% field.name FILTER html %]' + The field '[% field.name FILTER html %]' ([% field.description FILTER html %]) already exists. Please choose another name. [% ELSIF error == "field_cant_control_self" %] [% title = "Field Can't Control Itself" %] - The [% field.description FILTER html %] field can't be set to control + The [% field.description FILTER html %] field can't be set to control itself. [% ELSIF error == "field_control_must_be_select" %] @@ -486,7 +486,7 @@ [% ELSIF error == "fieldname_invalid" %] [% title = "Specified Field Does Not Exist" %] - The field '[% field.name FILTER html %]' does not exist or + The field '[% field.name FILTER html %]' does not exist or cannot be edited with this interface. [% ELSIF error == "fieldvalue_already_exists" %] @@ -526,8 +526,8 @@ [% ELSIF error == "fieldvalue_name_too_long" %] [% title = "Field Value Is Too Long" %] - The value of a field is limited to - [%+ constants.FIELD_VALUE_MAX_SIZE FILTER none %] characters. + The value of a field is limited to + [%+ constants.FIELD_VALUE_MAX_SIZE FILTER none %] characters. '[% value FILTER html %]' is too long ([% value.length %] characters). [% ELSIF error == "fieldvalue_not_editable" %] @@ -539,7 +539,7 @@ [% ELSIF error == "fieldvalue_not_deletable" %] [% title = "Field Value Not Deletable" %] The value '[% value.name FILTER html %]' cannot be removed because - it plays some special role for the '[% field.description FILTER html %]' + it plays some special role for the '[% field.description FILTER html %]' field. [% ELSIF error == "fieldvalue_reserved_word" %] @@ -550,13 +550,13 @@ [% ELSIF error == "fieldvalue_sortkey_invalid" %] [% title = "Invalid Field Value Sortkey" %] - The sortkey '[% sortkey FILTER html %]' for the - [%+ field.description FILTER html %] field is not a valid + The sortkey '[% sortkey FILTER html %]' for the + [%+ field.description FILTER html %] field is not a valid (positive) number. [% ELSIF error == "fieldvalue_still_has_bugs" %] [% title = "You Cannot Delete This Field Value" %] - You cannot delete the value '[% value.name FILTER html %]' from the + You cannot delete the value '[% value.name FILTER html %]' from the [% field.description FILTER html %] field, because there are still [%+ value.bug_count FILTER html %] [%+ terms.bugs %] using it. @@ -570,7 +570,7 @@ [% ELSIF error == "file_too_large" %] [% title = "File Too Large" %] - The file you are trying to attach is [% filesize FILTER html %] + The file you are trying to attach is [% filesize FILTER html %] kilobytes (KB) in size. Attachments cannot be more than [%+ Param('maxattachmentsize') %] KB.
We recommend that you store your attachment elsewhere @@ -598,11 +598,11 @@ 'flags.html' => 'Using Flags'} %] You asked [% requestee.identity FILTER html %] - for [% flag_type.name FILTER html %] on [% terms.bug %] + for [% flag_type.name FILTER html %] on [% terms.bug %] [%+ bug_id FILTER html -%] [% IF attach_id && attach_id > 0 %], attachment [% attach_id FILTER html %][% END %], - but that [% terms.bug %] has been restricted to users in certain groups, - and the user you asked isn't in all the groups to which + but that [% terms.bug %] has been restricted to users in certain groups, + and the user you asked isn't in all the groups to which the [% terms.bug %] has been restricted. Please choose someone else to ask, or make the [% terms.bug %] accessible to users on its CC: list and add that user to the list. @@ -615,7 +615,7 @@ 'flags.html' => 'Using Flags'} %] You asked [% requestee.identity FILTER html %] - for [% flag_type.name FILTER html %] on + for [% flag_type.name FILTER html %] on [%+ terms.bug %] [%+ bug_id FILTER html %], attachment [% attach_id FILTER html %], but that attachment is restricted to users in the [% Param("insidergroup") FILTER html %] group, @@ -665,7 +665,7 @@ [% title = "Format Not Found" %] The requested format [% format FILTER html %] does not exist with a content type of [% ctype FILTER html %]. - + [% ELSIF error == "flag_type_sortkey_invalid" %] [% title = "Flag Type Sort Key Invalid" %] The sort key must be an integer between 0 and 32767 inclusive. @@ -714,10 +714,10 @@ [% ELSIF error == "group_invalid_removal" %] You tried to remove [% terms.bug %] [%+ bug.id FILTER html %] - from group id [% group_id FILTER html %], but [% terms.bugs %] in the + from group id [% group_id FILTER html %], but [% terms.bugs %] in the '[% product FILTER html %]' product can not be removed from that group. - + [% ELSIF error == "group_invalid_restriction" %] You tried to restrict [% terms.bug %] [%+ bug.id FILTER html %] to to group id [% group_id FILTER html %], but [% terms.bugs %] in the @@ -740,18 +740,18 @@ [% ELSIF error == "illegal_at_least_x_votes" %] [% title = "Your Search Makes No Sense" %] - The At least ___ votes field must be a simple number. + The At least ___ votes field must be a simple number. You entered [% value FILTER html %], which isn't. - + [% ELSIF error == "illegal_attachment_edit" %] [% title = "Unauthorized Action" %] You are not authorized to edit attachment [% attach_id FILTER html %]. [% ELSIF error == "illegal_attachment_edit_bug" %] [% title = "Unauthorized Action" %] - You are not authorized to edit attachments on [% terms.bug %] + You are not authorized to edit attachments on [% terms.bug %] [%+ bug_id FILTER html %]. - + [% ELSIF error == "illegal_attachment_is_patch" %] [% title = "Your Search Makes No Sense" %] The only legal values for the Attachment is patch field are @@ -766,13 +766,13 @@ You are not allowed to assign new [% terms.bugs %] to other people. [% ELSE %] You are not allowed to file new [% terms.bugs %] with the - [%+ new.name FILTER html %] status. + [%+ new.name FILTER html %] status. [% END %] [% ELSIF error == "illegal_change" %] [% title = "Not allowed" %] You tried to change the - [% field_descs.$field FILTER html %] field + [% field_descs.$field FILTER html %] field [% IF oldvalue.defined %] from [% oldvalue.join(', ') FILTER html %] [% END %] @@ -789,26 +789,26 @@ [% ELSIF error == "illegal_change_deps" %] [% title = "Not allowed" %] - You tried to change the - [% field_descs.$field FILTER html %] field - but only a user allowed to edit + You tried to change the + [% field_descs.$field FILTER html %] field + but only a user allowed to edit both related [% terms.bugs %] may change that field. [% ELSIF error == "illegal_changed_in_last_x_days" %] [% title = "Your Search Makes No Sense" %] - The Changed in last ___ days field must be a simple number. + The Changed in last ___ days field must be a simple number. You entered [% value FILTER html %], which isn't. - + [% ELSIF error == "illegal_date" %] [% title = "Illegal Date" %] '[% date FILTER html %]' is not a legal date. [% IF format %] Please use the format '[% format FILTER html %]'. [% END %] - + [% ELSIF error == "illegal_email_address" %] [% title = "Invalid Email Address" %] - The e-mail address you entered ([% addr FILTER html %]) + The e-mail address you entered ([% addr FILTER html %]) didn't pass our syntax checking for a legal email address. [% IF default %] A legal address must contain exactly one '@', @@ -818,12 +818,12 @@ [% END %] It must also not contain any of these special characters: \ ( ) & < > , ; : " [ ], or any whitespace. - + [% ELSIF error == "illegal_frequency" %] [% title = "Too Frequent" %] - Unless you are an administrator, you may not create series which are + Unless you are an administrator, you may not create series which are run more often than once every [% minimum FILTER html %] days. - + [% ELSIF error == "illegal_group_control_combination" %] [% title = "Your Group Control Combination Is Illegal" %] [% admindocslinks = {'groups.html' => 'Assigning Group Controls to Products'} %] @@ -837,14 +837,14 @@ [% ELSIF error == "illegal_query_name" %] [% title = "Illegal Search Name" %] - The name of your search cannot contain any of the following characters: + The name of your search cannot contain any of the following characters: <, >, &. [% ELSIF error == "illegal_series_creation" %] [% admindocslinks = {'groups.html' => 'Group security'} %] [% docslinks = {'reporting.html' => 'Reporting'} %] You are not authorized to create series. - + [% ELSIF error == "illegal_series_edit" %] [% admindocslinks = {'groups.html' => 'Group security'} %] [% docslinks = {'reporting.html' => 'Reporting'} %] @@ -862,11 +862,11 @@ [% title = "Illegal Regular Expression" %] The regular expression you provided [% value FILTER html %] is not valid. The error was: [% dberror FILTER html %]. - + [% ELSIF error == "insufficient_data_points" %] [% docslinks = {'reporting.html' => 'Reporting'} %] We don't have enough data points to make a graph (yet). - + [% ELSIF error == "invalid_attach_id" %] [% title = "Invalid Attachment ID" %] The attachment id [% attach_id FILTER html %] is invalid. @@ -874,7 +874,7 @@ [% ELSIF error == "bug_id_does_not_exist" %] [% title = BLOCK %]Invalid [% terms.Bug %] ID[% END %] [% terms.Bug %] #[% bug_id FILTER html %] does not exist. - + [% ELSIF error == "improper_bug_id_field_value" %] [% title = BLOCK %] [% IF bug_id %]Invalid [% ELSE %]Missing [% END %] [% terms.Bug %] ID @@ -902,7 +902,7 @@ The content type [% contenttype FILTER html %] is invalid. Valid types must be of the form foo/bar where foo is one of [% constants.LEGAL_CONTENT_TYPES.join(', ') FILTER html %]. - + [% ELSIF error == "invalid_context" %] [% title = "Invalid Context" %] The context [% context FILTER html %] is invalid (must be a number, @@ -966,7 +966,7 @@ [% ELSIF error == "invalid_username" %] [% title = "Invalid Username" %] - The name [% name FILTER html %] is not a valid username. + The name [% name FILTER html %] is not a valid username. Either you misspelled it, or the person has not registered for a [% terms.Bugzilla %] account. @@ -977,9 +977,9 @@ # being locked out. #%] [% IF remaining <= 2 %] - If you do not enter the correct password after + If you do not enter the correct password after [%+ remaining FILTER html %] more attempt(s), you will be - locked out of this account for + locked out of this account for [%+ Param('login_lockout_interval') FILTER html %] minutes. [% END %] @@ -994,18 +994,18 @@ [% ELSIF error == "keyword_blank_description" %] [% title = "Blank Keyword Description Not Allowed" %] You must enter a non-blank description for the keyword. - + [% ELSIF error == "keyword_blank_name" %] [% title = "Blank Keyword Name Not Allowed" %] You must enter a non-blank name for the keyword. - + [% ELSIF error == "keyword_invalid_name" %] [% title = "Invalid Keyword Name" %] You may not use commas or whitespace in a keyword name. - + [% ELSIF error == "local_file_too_large" %] [% title = "Local File Too Large" %] - Local file uploads must not exceed + Local file uploads must not exceed [% Param('maxlocalattachment') %] MB in size. [% ELSIF error == "login_needed_for_password_change" %] @@ -1058,7 +1058,7 @@ [% title = "Milestone Required" %] You must select a target milestone for [% terms.bug %] [%+ bug.id FILTER html %] - if you are going to accept it. Part of accepting + if you are going to accept it. Part of accepting [%+ terms.abug %] is giving an estimate of when it will be fixed. [% ELSIF error == "milestone_sortkey_invalid" %] @@ -1069,13 +1069,13 @@ [% ELSIF error == "misarranged_dates" %] [% title = "Misarranged Dates" %] - Your start date ([% datefrom FILTER html %]) is after + Your start date ([% datefrom FILTER html %]) is after your end date ([% dateto FILTER html %]). - + [% ELSIF error == "missing_attachment_description" %] [% title = "Missing Attachment Description" %] You must enter a description for the attachment. - + [% ELSIF error == "missing_category" %] [% title = "Missing Category" %] You did not specify a category for this series. @@ -1098,36 +1098,36 @@ [% ELSIF error == "missing_content_type" %] [% title = "Missing Content-Type" %] You asked [% terms.Bugzilla %] to auto-detect the content type, but - your browser did not specify a content type when uploading the file, + your browser did not specify a content type when uploading the file, so you must enter a content type manually. - + [% ELSIF error == "missing_content_type_method" %] [% title = "Missing Content-Type Determination Method" %] You must choose a method for determining the content type, - either auto-detect, select from list, or enter + either auto-detect, select from list, or enter manually. - + [% ELSIF error == "missing_cookie" %] [% title = "Missing Cookie" %] Sorry, I seem to have lost the cookie that recorded the results of your last search. I'm afraid you will have to start again from the search page. - + [% ELSIF error == "missing_datasets" %] [% title = "No Datasets Selected" %] [% docslinks = {'reporting.html' => 'Reporting'} %] You must specify one or more datasets to plot. - + [% ELSIF error == "missing_frequency" %] [% title = "Missing Frequency" %] [% docslinks = {'reporting.html' => 'Reporting'} %] You did not specify a valid frequency for this series. - + [% ELSIF error == "missing_name" %] [% title = "Missing Name" %] [% docslinks = {'reporting.html' => 'Reporting'} %] You did not specify a name for this series. - + [% ELSIF error == "missing_query" %] [% title = "Missing Search" %] [% docslinks = {'query.html' => "Searching for $terms.bugs", @@ -1152,7 +1152,7 @@ [% ELSIF error == "missing_subcategory" %] [% title = "Missing Subcategory" %] You did not specify a subcategory for this series. - + [% ELSIF error == "missing_version" %] [% title = "Missing Version" %] [% admindocslinks = {'versions.html' => 'Defining versions'} %] @@ -1237,32 +1237,32 @@ [% ELSIF error == "number_not_numeric" %] [% title = "Numeric Value Required" %] - The value '[% num FILTER html %]' in the - [% field_descs.$field FILTER html %] field + The value '[% num FILTER html %]' in the + [% field_descs.$field FILTER html %] field is not a numeric value. [% ELSIF error == "number_too_large" %] [% title = "Number Too Large" %] - The value '[% num FILTER html %]' in the - [% field_descs.$field FILTER html %] field + The value '[% num FILTER html %]' in the + [% field_descs.$field FILTER html %] field is more than the maximum allowable value of '[% max_num FILTER html %]'. [% ELSIF error == "number_too_small" %] [% title = "Number Too Small" %] - The value '[% num FILTER html %]' - in the [% field_descs.$field FILTER html %] field + The value '[% num FILTER html %]' + in the [% field_descs.$field FILTER html %] field is less than the minimum allowable value of '[% min_num FILTER html %]'. [% ELSIF error == "object_not_specified" %] [% type = BLOCK %][% INCLUDE object_name class = class %][% END %] - [% title = BLOCK %][% type FILTER ucfirst FILTER html %] Not + [% title = BLOCK %][% type FILTER ucfirst FILTER html %] Not Specified[% END %] You must select/enter a [% type FILTER html %]. [% ELSIF error == "object_does_not_exist" %] [% type = BLOCK %][% INCLUDE object_name class = class %][% END %] [% title = BLOCK %]Invalid [% type FILTER ucfirst FILTER html %][% END %] - There is no [% type FILTER html %] + There is no [% type FILTER html %] [% IF id.defined %] with the id '[% id FILTER html %]' [% ELSE %] @@ -1307,13 +1307,13 @@ [% ELSIF error == "patch_too_large" %] [% title = "File Too Large" %] - The file you are trying to attach is [% filesize FILTER html %] + The file you are trying to attach is [% filesize FILTER html %] kilobytes (KB) in size. Patches cannot be more than [% Param('maxattachmentsize') %] KB in size. Try splitting your patch into several pieces. [% ELSIF error == "product_access_denied" %] - Either the product + Either the product [%+ IF id.defined %] with the id [% id FILTER html %] [% ELSE %] @@ -1348,11 +1348,11 @@ [% title = "Product name already exists" %] [% admindocslinks = {'products.html' => 'Administering products'} %] The product name '[% product FILTER html %]' already exists. - + [% ELSIF error == "product_name_diff_in_case" %] [% title = "Product name differs only in case" %] [% admindocslinks = {'products.html' => 'Administering products'} %] - The product name '[% product FILTER html %]' differs from existing + The product name '[% product FILTER html %]' differs from existing product '[% existing_product FILTER html %]' only in case. [% ELSIF error == "product_name_too_long" %] @@ -1376,7 +1376,7 @@ [% title = "Blank Product Name Not Allowed" %] [% admindocslinks = {'products.html' => 'Administering products'} %] You must enter a name for the product. - + [% ELSIF error == "product_disabled" %] [% title = BLOCK %]Product closed for [% terms.Bug %] Entry[% END %] [% admindocslinks = {'products.html' => 'Administering products'} %] @@ -1387,7 +1387,7 @@ [% title = "Product Edit Access Denied" %] [% admindocslinks = {'products.html' => 'Administering products', 'groups.html' => 'Group security'} %] - You are not permitted to edit [% terms.bugs %] in product + You are not permitted to edit [% terms.bugs %] in product [%+ product FILTER html %]. [% ELSIF error == "product_has_bugs" %] @@ -1448,7 +1448,7 @@ [% END %] [% IF unknown.size %] -

The legal field names are +

The legal field names are listed here.

[% END %] @@ -1471,7 +1471,7 @@ You must enter a summary for this [% terms.bug %]. [% ELSIF error == "resolution_cant_clear" %] - [% terms.Bug %] [%+ bug_id FILTER bug_link(bug_id) FILTER none %] is + [% terms.Bug %] [%+ bug_id FILTER bug_link(bug_id) FILTER none %] is closed, so you cannot clear its resolution. [% ELSIF error == "resolution_not_allowed" %] @@ -1481,13 +1481,13 @@ [% ELSIF error == "saved_search_used_by_whines" %] [% title = "Saved Search In Use" %] [% docslinks = {'whining.html' => 'About Whining'} %] - The saved search [% search_name FILTER html %] is being used + The saved search [% search_name FILTER html %] is being used by Whining events with the following subjects: [%+ subjects FILTER html %] [% ELSIF error == "search_content_without_matches" %] [% title = "Illegal Search" %] - The "content" field can only be used with "matches" search + The "content" field can only be used with "matches" search and the "matches" search can only be used with the "content" field. @@ -1495,10 +1495,10 @@ [% title = "Series Already Exists" %] [% docslinks = {'reporting.html' => 'Reporting'} %] A series named [% series.category FILTER html %] / - [%+ series.subcategory FILTER html %] / + [%+ series.subcategory FILTER html %] / [%+ series.name FILTER html %] already exists. - + [% ELSIF error == "sidebar_supports_mozilla_only" %] Sorry - sidebar.cgi currently only supports Mozilla based web browsers. Upgrade today. :-) @@ -1549,16 +1549,16 @@ [% ELSIF error == "sudo_in_progress" %] [% title = "Session In Progress" %] - A sudo session (impersonating [% target FILTER html %]) is in progress. + A sudo session (impersonating [% target FILTER html %]) is in progress. End that session (using the link in the footer) before starting a new one. [% ELSIF error == "sudo_password_required" %] [% title = "Password Required" %] - Your [% terms.Bugzilla %] password is required to begin a sudo + Your [% terms.Bugzilla %] password is required to begin a sudo session. Please go back and enter your password. - + [% ELSIF error == "sudo_preparation_required" %] [% title = "Preparation Required" %] You may not start a sudo session directly. Please @@ -1658,7 +1658,7 @@ [% ELSIF error == "user_match_failed" %] [% title = "Match Failed" %] - [% name FILTER html %] does not exist or you are not allowed + [% name FILTER html %] does not exist or you are not allowed to see that user. [% ELSIF error == "user_match_too_many" %] @@ -1714,6 +1714,12 @@ I could not figure out what you wanted to do. [% END %] + [% ELSIF error == "incorrect_field_values" %] + [% FOR f = incorrect_fields %] + [% "
" IF !loop.first %] + The value(s) "[% f.value_names.join('", "') | html %]" of field "[% f.field.description | html %]" + are incorrect for the value "[% f.controller.name | html %]" of controlling field "[% f.controller.field.description | html %]". + [% END %] [% ELSE %] [%# Try to find hooked error messages %] [% error_message = Hook.process("errors") %]