=head1 NAME EPrints::Plugin::Screen::EPrint::Summary =cut package EPrints::Plugin::Screen::EPrint::Issues2Summary; our @ISA = ( 'EPrints::Plugin::Screen::EPrint' ); use strict; sub new { my( $class, %params ) = @_; my $self = $class->SUPER::new(%params); $self->{appears} = undef; return $self; } sub can_be_viewed { my( $self ) = @_; my $user = $self->{session}->current_user; return 1 if defined( $user ) && $user->get_value( "usertype" ) eq "admin"; return $self->allow( "eprint/summary" ); } sub render { my( $self ) = @_; my $session = $self->{session}; my $eprintid2 = $session->param( "eprintid2" ); my $eprint2 = $self->{processor}->{eprint}; # lazy $eprint2 = new EPrints::DataObj::EPrint( $self->{session}, $eprintid2 ) if $eprintid2; my ($data1, $title1) = $self->{processor}->{eprint}->render_preview; #my ($data1, $title1) = $self->render_eprint_preview( $self->{processor}->{eprint}, 1 ); my $container1 = $session->make_element( "div", class=>"ep_issues2_summary_inner" ); $container1->appendChild( $data1 ); my ($data2, $title2) = $eprint2->render_preview; #my ($data2, $title2) = $self->render_eprint_preview( $eprint2, 1 ); my $container2 = $session->make_element( "div", class=>"ep_issues2_summary_inner" ); $container2->appendChild( $data2 ); my $container = $session->make_element( "div", class=>"ep_issues2_summary" ); $container->appendChild( $container1 ); $container->appendChild( $container2 ); my $table = $session->make_element( "table" ); my $tr1 = $session->make_element( "tr" ); my $tr2 = $session->make_element( "tr" ); my $th1 = $session->make_element( "th" ); my $th2 = $session->make_element( "th" ); my $td1 = $session->make_element( "td", style => "vertical-align: top; border: 1px solid lightgray;" ); my $td2 = $session->make_element( "td", style => "vertical-align: top; border: 1px solid lightgray;" ); $th1->appendChild( $session->make_text( "#" . $self->{processor}->{eprint}->get_value("eprintid") ) ); $th2->appendChild( $session->make_text( "#" . $eprint2->get_value("eprintid") ) ); $td1->appendChild( $container1 ); $td2->appendChild( $container2 ); $tr1->appendChild( $th1 ); $tr1->appendChild( $th2 ) if $eprintid2; $tr2->appendChild( $td1 ); $tr2->appendChild( $td2 ) if $eprintid2; $table->appendChild( $tr1 ); $table->appendChild( $tr2 ); return $table; # return $container; } sub render_eprint_preview { my( $self, $eprint, $preview ) = @_; print STDERR "in render_eprint_preview 1\n"; my( $dom, $title, $links, $template ); my $session = $self->{session}; my $status = $eprint->get_value( "eprint_status" ); { ( $dom, $title, $links, $template ) = $session->get_repository->call( "eprint_render", $eprint, $self->{session}, $preview ); print STDERR "in render_eprint_preview 2\n"; my $content = $session->make_element( "div", class=>"ep_summary_content" ); my $content_top = $session->make_element( "div", class=>"ep_summary_content_top" ); my $content_left = $session->make_element( "div", class=>"ep_summary_content_left" ); my $content_main = $session->make_element( "div", class=>"ep_summary_content_main" ); my $content_right = $session->make_element( "div", class=>"ep_summary_content_right" ); my $content_bottom = $session->make_element( "div", class=>"ep_summary_content_bottom" ); my $content_after = $session->make_element( "div", class=>"ep_summary_content_after" ); print STDERR "in render_eprint_preview 3\n"; $content_left->appendChild( render_box_list( $session, $eprint, "summary_left" ) ); print STDERR "in render_eprint_preview 4a\n"; $content_right->appendChild( render_box_list( $session, $eprint, "summary_right" ) ); print STDERR "in render_eprint_preview 4b\n"; $content_bottom->appendChild( render_box_list( $session, $eprint, "summary_bottom" ) ); print STDERR "in render_eprint_preview 4c\n"; $content_top->appendChild( render_box_list( $session, $eprint, "summary_top" ) ); print STDERR "in render_eprint_preview 4d\n"; $content->appendChild( $content_left ); $content->appendChild( $content_right ); $content->appendChild( $content_top ); $content->appendChild( $content_main ); $content_main->appendChild( $dom ); $content->appendChild( $content_bottom ); $content->appendChild( $content_after ); print STDERR "in render_eprint_preview 5\n"; $dom = $content; } print STDERR "in render_eprint_preview 6\n"; return( $dom, $title, $links, $template ); } 1; =head1 COPYRIGHT =for COPYRIGHT BEGIN Copyright 2000-2011 University of Southampton. =for COPYRIGHT END =for LICENSE BEGIN This file is part of EPrints L. EPrints is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. EPrints is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with EPrints. If not, see L. =for LICENSE END