--- loncom/interface/lonsearchcat.pm 2011/12/09 01:04:27 1.331 +++ loncom/interface/lonsearchcat.pm 2013/01/07 22:20:58 1.331.4.4 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Search Catalog # -# $Id: lonsearchcat.pm,v 1.331 2011/12/09 01:04:27 www Exp $ +# $Id: lonsearchcat.pm,v 1.331.4.4 2013/01/07 22:20:58 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1781,14 +1781,14 @@ sub build_date_queries { if ((defined($cafter) && ! defined($cbefore)) || (defined($cbefore) && ! defined($cafter))) { # This is bad, so let them know - $error = &mt('Incorrect entry for the creation date. '. + $error = &mt('Incorrect entry for the creation date. '. 'You must specify both the beginning and ending dates.'); } if (! defined($error) && ((defined($mafter) && ! defined($mbefore)) || (defined($mbefore) && ! defined($mafter)))) { # This is also bad, so let them know - $error = &mt('Incorrect entry for the last revision date. '. + $error = &mt('Incorrect entry for the last revision date. '. 'You must specify both the beginning and ending dates.'); } if (! defined($error)) { @@ -1915,9 +1915,12 @@ sub ensure_db_and_table { ## my $connection_result = &Apache::lonmysql::connect_to_db(); if (!defined($connection_result)) { - $r->print("Unable to connect to the MySQL database where your results". - " are saved.". - &Apache::loncommon::end_page()); + $r->print( + '

' + .&mt('Unable to connect to the MySQL database where your results are saved.') + .'

' + .&Apache::loncommon::end_page() + ); &Apache::lonnet::logthis("lonsearchcat: unable to get lonmysql to". " connect to database."); &Apache::lonnet::logthis(&Apache::lonmysql::get_error()); @@ -1925,13 +1928,20 @@ sub ensure_db_and_table { } my $table_check = &Apache::lonmysql::check_table($table); if (! defined($table_check)) { - $r->print("A MySQL error has occurred.". - &Apache::loncommon::end_page()); + $r->print( + '

' + .&mt('A MySQL error has occurred.') + .'

' + .&Apache::loncommon::end_page()); &Apache::lonnet::logthis("lonmysql was unable to determine the status". " of table ".$table); return undef; } elsif (! $table_check) { - $r->print("The table of results could not be found."); + $r->print( + '

' + .&mt('The table of results could not be found.') + .'

' + ); &Apache::lonnet::logthis("The user requested a table, ".$table. ", that could not be found."); return undef; @@ -3157,6 +3167,28 @@ sub evalfields { ###################################################################### ###################################################################### +sub display_tools { + my ($title, $jumpurl) = @_; + my $result; + # Metadata + $result.= + &Apache::loncommon::modal_link( + $jumpurl.'.meta?inhibitmenu=yes', + 'Info', + 500,500,'_blank',undef,&mt('Metadata')); + # Stored Links + $result.= + ' '. + ''; + return $result; +} + +###################################################################### +###################################################################### + =pod =item Metadata Viewing Functions @@ -3181,16 +3213,14 @@ sub detailed_citation_view { my $result; my $jumpurl=$values{'url'}; $jumpurl=~s|^/ext/|http://|; - $result .= ''.$prefix. + $result .= + ''.$prefix. ''.' '. ''.$values{'title'}."\n". - ''. - ''; - $result .= "

\n"; - $result .= ''.$values{'author'}.','. + &display_tools($values{'title'}, $jumpurl). + "

\n". + ''.$values{'author'}.','. ' '.$values{'owner'}.'
'; foreach my $field ( @@ -3318,16 +3348,10 @@ sub summary_view { my $jumpurl=$values{'url'}; $jumpurl=~s|^/ext/|http://|; my $link = '
'.&display_url($jumpurl,1).'
'; - - my $titleWL = &mt('Set link to wishlist'); - $result.=<$values{'title'} - - set wishlistlink - + $result .= + ''.$values{'title'}.''. + &display_tools($values{'title'}, $jumpurl).< $link
$values{'author'}, $values{'owner'} -- $values{'lastrevisiondate'}
@@ -3374,11 +3398,7 @@ sub compact_view { $result.=' '. ''. &HTML::Entities::encode($values{'title'},'<>&"').' '. - ''. - ''. - ''. + &display_tools($values{'title'}, $jumpurl). $link.' '.$values{'author'}.' ('.$values{'domain'}.')'; return $result; } @@ -3420,20 +3440,16 @@ sub fielded_format_view { my $jumpurl=$values{'url'}; $jumpurl=~s|^/ext/|http://|; - my $titleWL = ('Set link to wishlist'); my $result=<

URL:
$values{'url'} - - set wishlistlink - -
END + $result .= + &display_tools($values{'title'}, $jumpurl).' + '; foreach my $field ('title','author','domain','subject','keywords','notes', 'mimetag','language','creationdate','lastrevisiondate', 'owner','copyrighttag','hostname','abstract') {