--- loncom/interface/lonsearchcat.pm 2011/01/17 20:18:02 1.327 +++ loncom/interface/lonsearchcat.pm 2012/05/10 18:34:18 1.331.4.1 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Search Catalog # -# $Id: lonsearchcat.pm,v 1.327 2011/01/17 20:18:02 www Exp $ +# $Id: lonsearchcat.pm,v 1.331.4.1 2012/05/10 18:34:18 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -151,7 +151,8 @@ sub handler { ## Initialize global variables ## my $domain = $r->dir_config('lonDefDomain'); - $diropendb= "/home/httpd/perl/tmp/". + my $temp_file_dir = LONCAPA::tempdir(); + $diropendb= $temp_file_dir . "$env{'user.domain'}_$env{'user.name'}_sel_res.db"; # # set the name of the persistent database @@ -162,7 +163,7 @@ sub handler { $env{'form.persistent_db_id'} = time; } - my $persistent_db_file = "/home/httpd/perl/tmp/". + my $persistent_db_file = $temp_file_dir . &escape($domain). '_'.&escape($env{'user.name'}). '_'.$env{'form.persistent_db_id'}.'_persistent_search.db'; @@ -2382,7 +2383,10 @@ END next; } $status=~s|/||g; - my $datafile=$r->dir_config('lonDaemons').'/tmp/'.$status; + + + + my $datafile=LONCAPA::tempdir().$status; if (-e $datafile && ! -e "$datafile.end") { &update_status($r,&mt('Receiving results from [_1]',$server)); next; @@ -3058,91 +3062,8 @@ SCRIPT SCRIPT - # HTML-Markup for 'Set a link for this resource to wishlist' - # this is written via JavaScript document.write (function set_wishlistlink) - # it is split into 3 parts and the inputfields for title and path are left out - # these fields are inserted later to set the values for title and path - # automatically via JavaScript (document.title and location.pathname) - my %folders = &Apache::lonnet::get('wishlist',['folders']); - if ($folders{'folders'} eq '') { - $folders{'folders'} = ''; - } - my $start_page_wishlistlink = - &Apache::loncommon::start_page('Set link to wishlist',undef, - {'only_body' => 1, - 'js_ready' => 1, - 'bgcolor' => '#FFFFFF',}); - - my $warningLink = &mt('You must insert a title!'); - - my $in_page_wishlistlink1 = '

'.&mt('Set a link to wishlist').'

'. - '
'. - &Apache::lonhtmlcommon::start_pick_box(). - &Apache::lonhtmlcommon::row_title(&mt('Link Title')); - - my $in_page_wishlistlink2 = &Apache::lonhtmlcommon::row_closure(). - &Apache::lonhtmlcommon::row_title(&mt('Path')); - - my $in_page_wishlistlink3 = &Apache::lonhtmlcommon::row_closure(). - &Apache::lonhtmlcommon::row_title(&mt('Note')). - ''. - &Apache::lonhtmlcommon::row_closure(1). - &Apache::lonhtmlcommon::end_pick_box(). - '

'. - ''. - ''. - ''. - '
'; - - # remove all \n for inserting on javascript document.write - $in_page_wishlistlink1 =~ s/\n//g; - $in_page_wishlistlink2 =~ s/\n//g; - $in_page_wishlistlink3 =~ s/\n//g; - - my $end_page_wishlistlink = - &Apache::loncommon::end_page({'js_ready' => 1}); - - # Add JavaScript-function to set link for a ressource to wishlist - $js.=< -// ' - +'function newlinksubmit(){' - +'var title = document.getElementsByName("title")[0].value;' - +'if (!title) {' - +'alert("$warningLink");' - +'return false;}' - +'return true;}' - +'<\/scr'+'ipt>' - +'$in_page_wishlistlink1' - +'' - +'$in_page_wishlistlink2' - +'' - +'$in_page_wishlistlink3' - +'$end_page_wishlistlink' ); - wishlistlink.document.close(); -} - -// ]]> - -SCRIPT - my $start_page = &Apache::loncommon::start_page(undef,$js, - {'only_body' =>1}); + {'only_body' =>1,}); my $result=< @@ -3261,11 +3182,7 @@ sub detailed_citation_view { $result .= ''.$prefix. ''.' '. ''.$values{'title'}."\n". - ''. - ''; + 'target="preview">'.$values{'title'}."\n"; $result .= "

\n"; $result .= ''.$values{'author'}.','. ' '.$values{'owner'}.'
'; @@ -3396,15 +3313,9 @@ sub summary_view { $jumpurl=~s|^/ext/|http://|; my $link = '
'.&display_url($jumpurl,1).'
'; - my $titleWL = &mt('Set link to wishlist'); $result.=<$values{'title'} - - set wishlistlink -
$link
$values{'author'}, $values{'owner'} -- $values{'lastrevisiondate'}
@@ -3451,11 +3362,6 @@ sub compact_view { $result.=' '. ''. &HTML::Entities::encode($values{'title'},'<>&"').' '. - ''. - ''. - ''. $link.' '.$values{'author'}.' ('.$values{'domain'}.')'; return $result; } @@ -3497,18 +3403,12 @@ 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 foreach my $field ('title','author','domain','subject','keywords','notes',