From fc6aa3c91fdcb1d9f11d05d9f13d1da8fce15b45 Mon Sep 17 00:00:00 2001 From: "gerv%gerv.net" <> Date: Sun, 24 Mar 2002 01:58:36 +0000 Subject: Bug 110012 - show_bug templatisation. r=bbaetz, afranke. --- Bugzilla/Attachment.pm | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) (limited to 'Bugzilla') diff --git a/Bugzilla/Attachment.pm b/Bugzilla/Attachment.pm index 7416fd589..23e634276 100644 --- a/Bugzilla/Attachment.pm +++ b/Bugzilla/Attachment.pm @@ -27,16 +27,8 @@ use diagnostics; use strict; -use vars qw( - $template - $vars -); - package Attachment; -my $template = $::template; -my $vars = $::vars; - # This module requires that its caller have said "require CGI.pl" to import # relevant functions from that script and its companion globals.pl. @@ -44,11 +36,11 @@ my $vars = $::vars; # Functions ############################################################################ -sub list +sub query { - # Displays a table of attachments for a given bug along with links for - # viewing, editing, or making requests for each attachment. - + # Retrieves and returns an array of attachment records for a given bug. + # This data should be given to attachment/list.atml in an + # "attachments" variable. my ($bugid) = @_; my $in_editbugs = &::UserInGroup("editbugs"); @@ -98,14 +90,8 @@ sub list $in_editbugs); push @attachments, \%a; } - - $vars->{'bugid'} = $bugid; - $vars->{'attachments'} = \@attachments; - - $template->process("attachment/list.atml", $vars) - || &::DisplayError("Template process failed: " . $template->error()) - && exit; - + + return \@attachments; } 1; -- cgit v1.2.1