diff -r -u bugzilla-3.6.2-nopatch/show_bug.cgi bugzilla-3.6.2/show_bug.cgi --- bugzilla-3.6.2-nopatch/show_bug.cgi 2009-11-10 08:31:48.000000000 -0800 +++ bugzilla-3.6.2/show_bug.cgi 2010-09-10 03:56:26.102071852 -0700 @@ -125,5 +125,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 = ' + + + '; + + foreach my $c ( @f ) + { + $r .= "" + . $c . " "; + } + + $r .= ''; + + return $r; +} + +$vars->{ p4web } = \&p4web; + $template->process("$format->{'template'}", $vars) || ThrowTemplateError($template->error()); diff -r -u bugzilla-3.6.2-nopatch/template/en/default/bug/field.html.tmpl bugzilla-3.6.2/template/en/default/bug/field.html.tmpl --- bugzilla-3.6.2-nopatch/template/en/default/bug/field.html.tmpl 2009-11-09 11:12:53.000000000 -0800 +++ bugzilla-3.6.2/template/en/default/bug/field.html.tmpl 2010-09-10 04:01:18.326987308 -0700 @@ -48,6 +48,7 @@ [% END %] [% END %] +[% IF field.name != 'cf_p4fixes' %] [% IF NOT no_tds %] @@ -64,6 +65,7 @@ [% '' IF editable %] [% END %] +[% END %] [% IF NOT no_tds %] [% END %] [% Hook.process('start_field_column') %] -[% IF editable %] +[% IF field.name == 'cf_p4fixes' %] + [% p4web( bug.${ field.name } ) %] +[% ELSIF editable %] [% SWITCH field.type %] [% CASE constants.FIELD_TYPE_FREETEXT %]