From 7568ab3ec16b3f0fb879f487020ebc2fea398197 Mon Sep 17 00:00:00 2001 From: Naama Menda Date: Sun, 18 Jul 2010 23:05:48 -0400 Subject: [PATCH] mason component for printing locus history data --- mason/locus/history.mas | 85 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 mason/locus/history.mas diff --git a/mason/locus/history.mas b/mason/locus/history.mas new file mode 100644 index 000000000..02cd0f54f --- /dev/null +++ b/mason/locus/history.mas @@ -0,0 +1,85 @@ + + +<%doc> + +=head1 NAME + +/locus/edits_info.mas - a component for printing locus edit dates and person + +=head1 DESCRIPTION + + +Parameters: + +=over 1 + +=item locus + +a locus object + + +=back + +=head1 AUTHOR + +Naama Menda + +=cut + + + +<%args> + +$locus + + + + +<%perl> + +use CXGN::People::Person; +use CXGN::Page::FormattingHelpers qw /columnar_table_html / ; +my @history; +my $history_data; + +my @history_objs = $locus->show_history(); #array of locus_history objects + +foreach my $h (@history_objs) { + my $created_date = $h->get_create_date(); + $created_date = substr $created_date, 0, 10; + my $history_id = $h->{locus_history_id}; + my $updated_by_id = $h->{updated_by}; + my $updated = + CXGN::People::Person->new( $locus->get_dbh(), $updated_by_id ); + my $u_first_name = $updated->get_first_name(); + my $u_last_name = $updated->get_last_name(); + my $up_person_link = + qq |$u_first_name $u_last_name ($created_date)|; + push @history, + [ + map { $_ } ( + $h->get_locus_symbol, $h->get_locus_name, + $h->get_gene_activity, $h->get_description, + $h->get_linkage_group, $h->get_lg_arm, + $up_person_link, + ) + ]; +} + +if (@history) { + + $history_data .= columnar_table_html( + headings => [ + 'Symbol', 'Name', 'Activity', 'Description', + 'Chromosome', 'Arm', 'Updated by', + ], + data => \@history, + __alt_freq => 2, + __alt_width => 1, + __alt_offset => 3, + ); +} + + + +<% $history_data %> -- 2.11.4.GIT