[%# 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 Bugzilla; bug_modal = 1; # only edit one bug UNLESS bug.defined; bug = bugs.0; END; bugid = bug.id; # these are used in a few places is_cced = bug.cc.contains(user.login); unassigned = (bug.assigned_to.login == "nobody@mozilla.org") || (bug.assigned_to.login.search('\.bugs$')); # custom fields that have custom rendering, or should not be rendered rendered_custom_fields = [ 'cf_user_story', 'cf_last_resolved', ]; # all custom fields custom_fields = Bugzilla.active_custom_fields(product => bug.product_obj, component => bug.component_obj, bug_id => bug.id); # extract needinfo flags needinfo = []; FOREACH flag_type IN bug.flag_types; IF flag_type.name == 'needinfo'; needinfo_flag_type = flag_type; FOREACH flag IN flag_type.flags; IF flag.status == '?'; needinfo.push(flag); END; END; END; END; # count attachments active_attachments = 0; obsolete_attachments = 0; FOREACH attachment IN bug.attachments; NEXT IF attachment.isprivate && !(user.is_insider || attachment.attacher.id == user.id); IF attachment.isobsolete; obsolete_attachments = obsolete_attachments + 1; ELSE; active_attachments = active_attachments + 1; END; END; # count set bug flags (excluding needinfo) has_bug_flags = 0; FOREACH flag IN bug.flags; NEXT IF flag.name == 'needinfo'; has_bug_flags = 1; LAST; END; # count set project/tracking/blocking flags tracking_flags_has = 0; tracking_flags_set = 0; project_flags_has = 0; project_flags_set = 0; blocking_flags_has = 0; blocking_flags_set = 0; FOREACH flag IN tracking_flags; is_set = flag.bug_flag(bug.id).value != "---"; IF flag.flag_type == "tracking"; tracking_flags_has = 1; IF is_set; tracking_flags_set = 1; END; END; IF flag.flag_type == "project"; project_flags_has = 1; IF is_set; project_flags_set = 1; END; END; IF flag.flag_type == 'blocking'; blocking_flags_has = 1; IF is_set; blocking_flags_set = 1; END; END; END; # build firefox flags subtitle firefox_flags = []; firefox_fixed_versions = []; scores = {firefox => 0, thunderbird => 0, seamonkey => 0}; tracking_flags_title = "Firefox Tracking Flags"; # project flags FOREACH row IN tracking_flags_table; NEXT UNLESS row.type == "project"; status_value = row.status.bug_flag(bug.id).value; NEXT IF status_value == "---"; firefox_flags.push(row.name _ ":" _ status_value); END; # tracking flags title and subtitle FOREACH row IN tracking_flags_table; NEXT UNLESS row.type == "tracking"; tracking_value = row.tracking ? row.tracking.bug_flag(bug.id).value : "---"; status_value = row.status.bug_flag(bug.id).value || "---"; NEXT IF tracking_value == "---" && status_value == "---"; blurb = row.name; IF tracking_value != "---"; blurb = blurb _ tracking_value; END; IF status_value != "---"; blurb = blurb _ " " _ status_value; IF status_value == "fixed" || status_value == "verified"; flag_name = row.name; IF flag_name.substr(0, 7) == "firefox"; IF firefox_fixed_versions.0 == ""; firefox_fixed_versions.0 = "Firefox " _ flag_name.substr(7); END; ELSIF flag_name.substr(0, 4) == "b2g-"; IF firefox_fixed_versions.1 == ""; firefox_fixed_versions.1 = "Firefox OS " _ flag_name.substr(4); END; END; END; END; firefox_flags.push(blurb); IF row.name.search("^thunderbird"); scores.thunderbird = scores.thunderbird + 1; ELSIF row.name.search("^seamonkey"); scores.seamonkey = scores.seamonkey + 1; ELSE; scores.firefox = scores.firefox + 1; END; END; IF scores.thunderbird AND NOT scores.firefox; tracking_flags_title = "Thunderbird Tracking Flags"; ELSIF scores.seamonkey AND NOT scores.firefox; tracking_flags_title = "SeaMonkey Tracking Flags"; END; firefox_fixed_version = firefox_fixed_versions.join(", "); IF firefox_flags.size; firefox_flags_subtitle = firefox_flags.join(", "); ELSE; firefox_flags_subtitle = "Not tracked"; END; %] [% IF user.id %]
[% END %] [%# === individual bugs addition === %] [% PROCESS "bug/tagging.html.tmpl" %] [%# === blocks === %] [% BLOCK new_comment %] [%# === new comment === %] [% IF user.id; INCLUDE bug_modal/new_comment.html.tmpl; ELSE; %]