package JCRUtil;
# --------------------------------------------------------------------
# The copyright and all other proprietary rights in this Database
# (including software - SEE LICENSING AGREEMENT) are the sole and
# exclusive property of the Institute for Scientific Information
# (ISI). This Database and source code, or any derivative works
# thereof, are confidential and proprietary to ISI . Therefore,
# duplication, reuse, redistribution, reverse assembling, reverse
# compiling, or translation of the Database, source code, or any
# portion thereof IS NOT PERMITTED. Consult Licensing Agreement.
# --------------------------------------------------------------------
# $Id: JCRUtil.pm,v 1.9 2008/10/30 20:13:18 ssidanal Exp $
use strict;
use Data::Dumper;
use ISIBench;
use JCRErrorList;
use JCR::MarkedList;
use Log::Log4perl qw(get_logger);
=head1 NAME
JCRUtil - General utility functions for JCRWeb
=head2 METHODS
=over 4
=cut
=item
build_sort_box('selected' => ('title'||'cites_all'||'impact_current'||'immediacy'||'source_current'||'cited_hlife')
Creates a sort box and sets the selected value if provided. If no selected value is provided 'title' will be the default.
=cut
sub build_sort_box {
ISIBench::start();
my $logger = get_logger("JCRUtil");
my $args = (ref $_[0] eq 'HASH') ? shift : { @_ };
my %selection;
my $html;
my $year = $args->{year};
$logger->debug("build_sort_box params are: ", sub{Dumper($args)});
if ( $args->{sort_box_type} =~ /journal/i ) {
if ($args->{selected} =~ /(title|cites_all|impact_current|immediacy|source_current|cited_hlife|impact_5year|eigen_factor|article_influence)/i) {
$selection{$1} = 'SELECTED';
} else {
$selection{title} = 'SELECTED';
}
if ($year >= $CF::data_eigen_impact_start){
$html = qq|
|;
}else{
$html = qq|