diff -r -u bugzilla-3.4.1-nopatch/show_bug.cgi bugzilla-3.4.1/show_bug.cgi
--- bugzilla-3.4.1-nopatch/show_bug.cgi 2009-02-05 10:40:13.000000000 -0800
+++ bugzilla-3.4.1/show_bug.cgi 2009-09-01 13:23:51.913678756 -0700
@@ -140,5 +140,38 @@
print $cgi->header($format->{'ctype'});
+# Function to convert the cf_p4fixes custom field into links to
+# a P4Web installation. Input to this function is a whitespace
+# separated string of numbers like "3452 212 6563 2324" which is
+# generated by the Perforce P4DTG Bugzilla plugin.
+sub p4web()
+{
+ # Don't show the header if we don't have any fixes.
+ if( !length "@_" )
+ { return; }
+
+ # URL of your P4Web installation.
+ my $p4web_base = "http://p4web-URL.example.com/";
+ my $p4web_ac = "?ac=10";
+
+ my @f = split( /\s+/, "@_" );
+ my $r = '<tr><th class="field_label">
+ <label for="cf_fixes">Perforce fixes:</label>
+ </th>
+ <td class="field_value" colspan="1">';
+
+ foreach my $c ( @f )
+ {
+ $r .= "<a href='" . $p4web_base . $c . $p4web_ac . "'>"
+ . $c . "</a> ";
+ }
+
+ $r .= '</td></tr>';
+
+ return $r;
+}
+
+$vars->{ p4web } = \&p4web;
+
$template->process("$format->{'template'}", $vars)
|| ThrowTemplateError($template->error());
diff -r -u bugzilla-3.4.1-nopatch/template/en/default/bug/field.html.tmpl bugzilla-3.4.1/template/en/default/bug/field.html.tmpl
--- bugzilla-3.4.1-nopatch/template/en/default/bug/field.html.tmpl 2009-08-01 07:01:29.000000000 -0700
+++ bugzilla-3.4.1/template/en/default/bug/field.html.tmpl 2009-09-08 16:25:58.402676271 -0700
@@ -48,6 +48,7 @@
[% END %]
[% END %]
+[% IF field.name != 'cf_p4fixes' %]
[% IF NOT no_tds %]
<th class="field_label [% ' bz_hidden_field' IF hidden %]"
id="field_label_[% field.name FILTER html %]">
@@ -64,13 +65,18 @@
[% '</label>' IF editable %]
</th>
[% END %]
+[% END %]
[% IF NOT no_tds %]
<td class="field_value [% ' bz_hidden_field' IF hidden %]"
id="field_container_[% field.name FILTER html %]"
[% " colspan=\"$value_span\"" FILTER none IF value_span %]>
[% END %]
-[% IF editable %]
+
+[% IF field.name == 'cf_p4fixes' %]
+ [% p4web( bug.${ field.name } ) %]
+
+[% ELSIF editable %]
[% SWITCH field.type %]
[% CASE constants.FIELD_TYPE_FREETEXT %]
<input id="[% field.name FILTER html %]" class="text_input"