sub get_column_list { # return columns (to superclass) for the database to grab my @columns = ( qw (id author title pub_date date_purch) ); return join ", ", @columns; } sub _get_table_header { my $self = shift; my $order_ref = shift; my %header; $header{author} = td({-width=>"30%"},u(b("Author"))); $header{title} = td({-width=>"*"},u(b("Title"))); $header{date_purch} = td({-width=>"10%"},u(b("Date acquired"))); # use hash keyed to the order, to print results # based on desired order of display return Tr( $header{@$order_ref[0]} . $header{@$order_ref[1]} . $header{@$order_ref[2]} ); } # end _get_table_header sub _get_table_row { # clean this up--named params? my $self = shift; my $order_ref = shift; my $ref = shift; # reference to single result--rename my $book = shift; my $rowcolor = shift; my %cell; my $author; $author = $ref->{'author'} if $ref->{'author'}; $author = $author ? escapeHTML($author) : " "; $cell{author} = $author; my $pub_date = $ref->{'pub_date'} if $ref->{'pub_date'}; $pub_date = $pub_date ? escapeHTML($pub_date) : " "; my $title; $title = a({-href=>"$book->{library}_displayfull.cgi?id=$ref->{id}"}, i(escapeHTML($ref->{'title'})) . " (" . $pub_date . ")"); $cell{title} = $title; my $date_purch; $date_purch= $ref->{'date_purch'} if $ref->{'date_purch'}; $date_purch = $date_purch ? escapeHTML($date_purch) : " "; $cell{date_purch} = $date_purch; return Tr({-class=>"$rowcolor"}, td($cell{@$order_ref[0]}), td($cell{@$order_ref[1]}), td($cell{@$order_ref[2]}) ); } # end _get_table_row