[%# The contents of this file are subject to the Mozilla Public
  # License Version 1.1 (the "License"); you may not use this file
  # except in compliance with the License. You may obtain a copy of
  # the License at http://www.mozilla.org/MPL/
  #
  # Software distributed under the License is distributed on an "AS
  # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  # implied. See the License for the specific language governing
  # rights and limitations under the License.
  #
  # The Original Code is the Bugzilla Bug Tracking System.
  #
  # The Initial Developer of the Original Code is Netscape Communications
  # Corporation. Portions created by Netscape are
  # Copyright (C) 1998 Netscape Communications Corporation. All
  # Rights Reserved.
  #
  # Contributor(s): Gervase Markham <gerv@gerv.net>
  #                 Elliotte Martin <elliotte_martin@yahoo.com>
  #%]

[%# Remember to PROCESS rather than INCLUDE this template. %]

[% RAWPERL %]

$context->process("global/variables.none.tmpl");

my $terms = $stash->get("terms");
$stash->set(
    search_descs => {
        "noop"           => "---",
        "equals"         => "is equal to",
        "notequals"      => "is not equal to",
        "anyexact"       => "is equal to any of the strings",
        "substring"      => "contains the string",
        "casesubstring"  => "contains the string (exact case)",
        "notsubstring"   => "does not contain the string",
        "anywordssubstr" => "contains any of the strings",
        "allwordssubstr" => "contains all of the strings",
        "nowordssubstr"  => "contains none of the strings",
        "regexp"         => "matches regular expression",
        "notregexp"      => "does not match regular expression",
        "lessthan"       => "is less than",
        "lessthaneq"     => "is less than or equal to",
        "greaterthan"    => "is greater than",
        "greaterthaneq"  => "is greater than or equal to",
        "anywords"       => "contains any of the words",
        "allwords"       => "contains all of the words",
        "nowords"        => "contains none of the words",
        "everchanged"    => "ever changed",
        "changedbefore"  => "changed before",
        "changedafter"   => "changed after",
        "changedfrom"    => "changed from",
        "changedto"      => "changed to",
        "changedby"      => "changed by",
        "matches"        => "matches",
        "notmatches"     => "does not match",
        "isempty"        => "is empty",
        "isnotempty"     => "is not empty",
    }
);

$stash->set(
    field_types => {
        Bugzilla::Constants::FIELD_TYPE_UNKNOWN()       => "Unknown Type",
        Bugzilla::Constants::FIELD_TYPE_FREETEXT()      => "Free Text",
        Bugzilla::Constants::FIELD_TYPE_SINGLE_SELECT() => "Drop Down",
        Bugzilla::Constants::FIELD_TYPE_MULTI_SELECT()  => "Multiple-Selection Box",
        Bugzilla::Constants::FIELD_TYPE_TEXTAREA()      => "Large Text Box",
        Bugzilla::Constants::FIELD_TYPE_DATETIME()      => "Date/Time",
        Bugzilla::Constants::FIELD_TYPE_BUG_ID()        => "$terms->{Bug} ID",
        Bugzilla::Constants::FIELD_TYPE_BUG_URLS()      => "$terms->{Bug} URL List",
        Bugzilla::Constants::FIELD_TYPE_KEYWORDS()      => "Keywords",
        Bugzilla::Constants::FIELD_TYPE_DATE()          => "Date",
        Bugzilla::Constants::FIELD_TYPE_INTEGER()       => "Integer",
        Bugzilla::Constants::FIELD_TYPE_BOOLEAN()       => "Boolean",
        Bugzilla::Constants::FIELD_TYPE_USER()          => "User",
        Bugzilla::Constants::FIELD_TYPE_USERS()         => "User List",
        Bugzilla::Constants::FIELD_TYPE_BUG_LIST()      => "$terms->{Bug} ID List",
        Bugzilla::Constants::FIELD_TYPE_EXTENSION()     => "Extension",
    }
);

if ( $stash->get("in_template_var") ) {
    my $vars = $stash->get("vars");
    $context->process("global/value-descs.none.tmpl");
    $vars->{value_descs} = $stash->get("value_descs");
    $vars->{terms}       = $terms;

    # field_descs is loaded as a global template variable and cached
    # across all templates--see VARIABLES in Bugzilla/Template.pm.
    #
    $vars->{field_descs} = {
        "[Bug creation]"          => "[$terms->{Bug} creation]",
        "actual_time"             => "Actual Hours",
        "alias"                   => "Alias",
        "anything"                => "Any field",
        "assigned_to"             => "Assignee",
        "assigned_to_realname"    => "Assignee Real Name",
        "assignee_last_login"     => "Assignee Last Login Date",
        "attach_data.thedata"     => "Attachment data",
        "attachments.count"       => "Number of Attachments",
        "attachments.description" => "Attachment description",
        "attachments.filename"    => "Attachment filename",
        "attachments.mimetype"    => "Attachment mime type",
        "attachments.ispatch"     => "Attachment is patch",
        "attachments.isobsolete"  => "Attachment is obsolete",
        "attachments.isprivate"   => "Attachment is private",
        "attachments.submitter"   => "Attachment creator",
        "blocked"                 => "Blocks",
        "blocked.count"           => "Number of Blocks",
        "bug_file_loc"            => "URL",
        "bug_group"               => "Group",
        "bug_id"                  => "$terms->{Bug} ID",
        "bug_severity"            => "Severity",
        "bug_status"              => "Status",
        "bug_type"                => "Type",
        "changeddate"             => "Updated",
        "cc"                      => "CC",
        "cc_count"                => "Number of CC",
        "classification"          => "Classification",
        "cclist_accessible"       => "CC list accessible",
        "commenter"               => "Commenter",
        "component_id"            => "Component ID",
        "component"               => "Component",
        "content"                 => "Content",
        "creation_ts"             => "Opened",
        "days_elapsed"            => "Days since $terms->{bug} changed",
        "deadline"                => "Deadline",
        "delta_ts"                => "Updated",
        "dependson"               => "Depends on",
        "dependson.count"         => "Number of Depends on",
        "dup_id"                  => "Duplicate of",
        "dupe_count"              => "Number of Duplicates",
        "duplicates"              => "Duplicates",
        "estimated_time"          => "Orig. Est.",
        "everconfirmed"           => "Ever confirmed",
        "filed_via"               => "Filed via",
        "flagtypes.name"          => "Flags",
        "keywords"                => "Keywords",
        "keywords.count"          => "Number of Keywords",
        "last_visit_ts"           => "Last Visit",
        "longdesc"                => "Comment",
        "longdescs.count"         => "Number of Comments",
        "longdescs.isprivate"     => "Comment is private",
        "newcc"                   => "CC",
        "op_sys"                  => "OS",
        "opendate"                => "Opened",
        "owner_idle_time"         => "Time Since Assignee Touched",
        "percentage_complete"     => "%Complete",
        "priority"                => "Priority",
        "product_id"              => "Product ID",
        "product"                 => "Product",
        "qa_contact"              => "QA Contact",
        "qa_contact_realname"     => "QA Contact Real Name",
        "regressed_by"            => "Regressed by",
        "regressed_by.count"      => "Number of Regressed by",
        "regresses"               => "Regressions",
        "regresses.count"         => "Number of Regressions",
        "remaining_time"          => "Hours Left",
        "rep_platform"            => "Hardware",
        "reporter"                => "Reporter",
        "reporter_accessible"     => "Reporter accessible",
        "reporter_realname"       => "Reporter Real Name",
        "requestees.login_name"   => "Flag Requestee",
        "resolution"              => "Resolution",
        "see_also"                => "See Also",
        "setters.login_name"      => "Flag Setter",
        "setting"                 => "Setting",
        "settings"                => "Settings",
        "short_desc"              => "Summary",
        "short_short_desc"        => "Summary",
        "status_whiteboard"       => "Whiteboard",
        "tag.name"                => "Tags",
        "target_milestone"        => "Target Milestone",
        "triage_owner"            => "Triage Owner",
        "version"                 => "Version",
        "work_time"               => "Hours Worked",
    };

    # Also include any custom fields or fields which don't have a
    #   Description here, by copying their Description from the
    #   database. If you want to override this for your language
    #   or your installation, just use a hook. %]
    my $bug_fields = $stash->get("bug_fields");
    foreach my $bz_field ( values %$bug_fields ) {
        $vars->{field_descs}{$bz_field->name} //= $bz_field->description;
    }

    $context->process("bug/field-help.none.tmpl");
}
[% END %]

[% Hook.process("end") %]
