[LON-CAPA-cvs] cvs: rat / lonratedt.pm lonsequence.pm /client ratcode.js loncom/interface groupsort.pm lonindexer.pm lonsearchcat.pm

www lon-capa-cvs@mail.lon-capa.org
Thu, 08 Jun 2006 13:56:52 -0000


This is a MIME encoded message

--www1149775012
Content-Type: text/plain

www		Thu Jun  8 09:56:52 2006 EDT

  Modified files:              
    /loncom/interface	groupsort.pm lonindexer.pm lonsearchcat.pm 
    /rat	lonratedt.pm lonsequence.pm 
    /rat/client	ratcode.js 
  Log:
  Jump from Search into Resource Space
  
  
--www1149775012
Content-Type: text/plain
Content-Disposition: attachment; filename="www-20060608095652.txt"

Index: loncom/interface/groupsort.pm
diff -u loncom/interface/groupsort.pm:1.42 loncom/interface/groupsort.pm:1.43
--- loncom/interface/groupsort.pm:1.42	Thu Jun  8 03:20:41 2006
+++ loncom/interface/groupsort.pm	Thu Jun  8 09:56:31 2006
@@ -2,7 +2,7 @@
 # The LON-CAPA group sort handler
 # Allows for sorting prior to import into RAT.
 #
-# $Id: groupsort.pm,v 1.42 2006/06/08 07:20:41 www Exp $
+# $Id: groupsort.pm,v 1.43 2006/06/08 13:56:31 www Exp $
 # 
 # Copyright Michigan State University Board of Trustees
 #
@@ -329,9 +329,9 @@
         my $resurl = &Apache::loncommon::lastresurl();
         $r->print(<<END);
 <input type="button" name="alter" value="$lt{'ci'}"
- onClick="window.location='$resurl'" />&nbsp;
+ onClick="window.location='$resurl?catalogmode=import'" />&nbsp;
 <input type="button" name="altersearch" value="$lt{'cs'}"
- onClick="window.location='/adm/searchcat'" />&nbsp;
+ onClick="window.location='/adm/searchcat?catalogmode=import'" />&nbsp;
 END
         # ---
 
Index: loncom/interface/lonindexer.pm
diff -u loncom/interface/lonindexer.pm:1.144 loncom/interface/lonindexer.pm:1.145
--- loncom/interface/lonindexer.pm:1.144	Thu Jun  8 03:20:41 2006
+++ loncom/interface/lonindexer.pm	Thu Jun  8 09:56:31 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Directory Indexer
 #
-# $Id: lonindexer.pm,v 1.144 2006/06/08 07:20:41 www Exp $
+# $Id: lonindexer.pm,v 1.145 2006/06/08 13:56:31 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -179,7 +179,7 @@
 <input type="button" name="close" value='$cl' onClick="self.close()" />
 END
         }
-	elsif ($env{'form.catalogmode'} eq 'groupimport') {
+	elsif ($env{'form.catalogmode'} eq 'import') {
 	    $extrafield='<td bgcolor="'.$fileclr.'" valign="bottom">'.
 		'<a name="$anchor"><img src="'.$iconpath.'whitespace1.gif"'.
 		' border="0" /></td>';
@@ -229,7 +229,7 @@
 # ------ set catalogmodefunctions to have extra needed javascript functionality
 	my $catalogmodefunctions='';
 	if ($env{'form.catalogmode'} eq 'interactive' or
-	    $env{'form.catalogmode'} eq 'groupimport') {
+	    $env{'form.catalogmode'} eq 'import') {
 	    # The if statement below sets us up to use the old version
 	    # by default (ie. if $mode is undefined).  This is the easy
 	    # way out.  Hopefully in the future I'll find a way to get 
@@ -240,7 +240,7 @@
 #
 #
 	    if (!defined($mode) || ($mode ne 'edit' && $mode ne 'parmset')) {
-                my $location = "/adm/groupsort?catalogmode=groupimport&";
+                my $location = "/adm/groupsort?catalogmode=import&";
                 $location .= "mode=".$mode."&";
                 $location .= "acts=";
 		$catalogmodefunctions=<<"END";
@@ -327,7 +327,7 @@
     eval("document.forms.dirpath"+suffix+".acts.value=val");
 }
 END
-	if ($env{'form.catalogmode'} eq 'groupimport') {
+	if ($env{'form.catalogmode'} eq 'import') {
             $catalogmodefunctions.=<<END;
 function queue(val) {
     if (eval("document.forms."+val+".filelink.checked")) {
@@ -369,7 +369,7 @@
 	$r->print(&Apache::loncommon::start_page('Browse Resources',$js,
 						 {'domain' => $headerdom,}));
 # - Evaluate actions from previous page (both cumulatively and chronologically)
-        if ($env{'form.catalogmode'} eq 'groupimport') {
+        if ($env{'form.catalogmode'} eq 'import') {
 	    my $acts=$env{'form.acts'};
 	    my @Acts=split(/b/,$acts);
 	    my %ahash;
@@ -478,7 +478,7 @@
 	$storeuri=~s/\/+/\//g;
 # ---------------------------------------------------------------- Bread crumbs
         $r->print(&Apache::lonhtmlcommon::crumbs($storeuri,'','',
-				(($env{'form.catalogmode'} eq 'groupimport')?
+				(($env{'form.catalogmode'} eq 'import')?
 				 'document.forms.fileattr':'')).
 		  &Apache::lonhtmlcommon::select_recent('residx','resrecent',
 'window.status=this.form.resrecent.options[this.form.resrecent.selectedIndex].value;this.form.action=this.form.resrecent.options[this.form.resrecent.selectedIndex].value;this.form.submit();'));
@@ -486,7 +486,7 @@
 	my $reshome=$env{'course.'.$env{'request.course.id'}.'.reshome'};
 	if ($reshome) {
 	    $r->print("<font size='+2'><a href='");
-	    if ($env{'form.catalogmode'} eq 'groupimport') {
+	    if ($env{'form.catalogmode'} eq 'import') {
 		$r->print('javascript:document.forms.fileattr.action="'.$reshome.'";document.forms.fileattr.submit();');
 	    } else {
 		$r->print($reshome);
@@ -912,7 +912,7 @@
 	    $r->print("<img src='",$iconpath,"select.gif' border='0' /></a>".
 		      "\n");
 	    $r->print("</td><td nowrap>");
-	} elsif ($env{'form.catalogmode'} eq 'groupimport') {
+	} elsif ($env{'form.catalogmode'} eq 'import') {
 	    $r->print("<form name='form$fnum'>\n");
 	    $r->print("<input type='checkbox' name='filelink"."' ".
 		      "value='$filelink' onClick='".
@@ -1188,9 +1188,9 @@
 	$r->print("\n<br />".$fieldnames{$item}.': '.
 		  &Apache::lonmeta::prettyprint($item,
 						$dynhash{$filelink}->{$item},
-		  (($env{'form.catalogmode'} ne 'groupimport')?'preview':''),
+		  (($env{'form.catalogmode'} ne 'import')?'preview':''),
 		  '',
-		  (($env{'form.catalogmode'} eq 'groupimport')?'document.forms.fileattr':''),1));
+		  (($env{'form.catalogmode'} eq 'import')?'document.forms.fileattr':''),1));
     }
 }
 
Index: loncom/interface/lonsearchcat.pm
diff -u loncom/interface/lonsearchcat.pm:1.266 loncom/interface/lonsearchcat.pm:1.267
--- loncom/interface/lonsearchcat.pm:1.266	Thu Jun  8 03:20:41 2006
+++ loncom/interface/lonsearchcat.pm	Thu Jun  8 09:56:31 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Search Catalog
 #
-# $Id: lonsearchcat.pm,v 1.266 2006/06/08 07:20:41 www Exp $
+# $Id: lonsearchcat.pm,v 1.267 2006/06/08 13:56:31 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -215,7 +215,7 @@
     untie %groupsearch_db if (tied(%groupsearch_db));
     if (($env{'form.cleargroupsort'} eq '1') || 
         (($env{'form.launch'} eq '1') && 
-         ($env{'form.catalogmode'} eq 'groupsearch'))) {
+         ($env{'form.catalogmode'} eq 'import'))) {
 	if (tie(%groupsearch_db,'GDBM_File',$diropendb,&GDBM_WRCREAT(),0640)) {
 	    &start_fresh_session();
 	    untie %groupsearch_db;
@@ -260,7 +260,7 @@
             $closebutton .="onClick='self.close()'";
         }
         $closebutton .=">\n";
-    } elsif ($env{'form.catalogmode'} eq 'groupsearch') {
+    } elsif ($env{'form.catalogmode'} eq 'import') {
         $closebutton="<input type='button' name='close' value='CLOSE' ";
         if ($env{'form.phase'} =~ /(results|run_search)/) {
 	    $closebutton .="onClick='parent.close()'";
@@ -660,10 +660,10 @@
 ######################################################################
 sub print_basic_search_form {
     my ($r,$closebutton,$hidden_fields) = @_;
-    my $result = ($env{'form.catalogmode'} ne 'groupsearch');
+    my $result = ($env{'form.catalogmode'} ne 'import');
     my $bread_crumb =
         &Apache::lonhtmlcommon::breadcrumbs('Searching','Search_Basic',
-					    $env{'form.catalogmode'} ne 'groupsearch');
+					    $env{'form.catalogmode'} ne 'import');
     my $scrout = &Apache::loncommon::start_page('Search').$bread_crumb;
     if (&Apache::lonnet::allowed('bre',$env{'request.role.domain'})) {
         # Define interface components
@@ -794,7 +794,7 @@
     my ($r,$closebutton,$hidden_fields) = @_;
     my $bread_crumb = 
         &Apache::lonhtmlcommon::breadcrumbs('Searching','Search_Advanced',
-					    $env{'form.catalogmode'} ne 'groupsearch');
+					    $env{'form.catalogmode'} ne 'import');
     my %lt=&Apache::lonlocal::texthash('srch' => 'Search',
 				       'reset' => 'Reset',
 				       'help' => 'Help');
@@ -2107,12 +2107,12 @@
 						    {'only_body' => 1});
     my $breadcrumbs=
         &Apache::lonhtmlcommon::breadcrumbs('Searching','Searching',
-					    $env{'form.catalogmode'} ne 'groupsearch');
+					    $env{'form.catalogmode'} ne 'import');
 
     my $result = <<END;
 $start_page
 $breadcrumbs
-<form name="statusform" action="" method="POST">
+<form name="statusform" action="" method="post" target="_top">
 <input type="hidden" name="Queue" value="" />
 END
 
@@ -2337,7 +2337,7 @@
 						    {'only_body' => 1});
     my $breadcrumbs =
 	&Apache::lonhtmlcommon::breadcrumbs('Searching','Searching',
-					    $env{'form.catalogmode'} ne 'groupsearch');
+					    $env{'form.catalogmode'} ne 'import');
     $r->print(<<END);
 $start_page
 $breadcrumbs
@@ -2527,7 +2527,7 @@
     # results to get, so let the client know the top frame needs to be
     # loaded from /adm/searchcat
     $r->print(&Apache::loncommon::end_page());
-#    if ($env{'form.catalogmode'} ne 'groupsearch') {
+#    if ($env{'form.catalogmode'} ne 'import') {
         $r->print("<script>".
                       "window.location='/adm/searchcat?".
                       "phase=sort&".
@@ -2594,15 +2594,15 @@
     }
     ##
     ## $checkbox_num is a count of the number of checkboxes output on the 
-    ## page this is used only during catalogmode=groupsearch.
+    ## page this is used only during catalogmode=import.
     my $checkbox_num = 0;
     ##
     ## Get the catalog controls setup
     ##
     my $action = "/adm/searchcat?phase=results";
     ##
-    ## Deal with groupsearch by opening the groupsearch db file.
-    if ($env{'form.catalogmode'} eq 'groupsearch') {
+    ## Deal with import by opening the import db file.
+    if ($env{'form.catalogmode'} eq 'import') {
         if (! tie(%groupsearch_db,'GDBM_File',$diropendb,
                   &GDBM_WRCREAT(),0640)) {
             $r->print('Unable to store import results.</form>'.
@@ -2825,7 +2825,7 @@
 </font>
 END
         }
-    } elsif ($env{'form.catalogmode'} eq 'groupsearch') {
+    } elsif ($env{'form.catalogmode'} eq 'import') {
         $groupsearch_db{"pre_${fnum}_link"}=$url;
         $groupsearch_db{"pre_${fnum}_title"}=$title;
         $output.=<<END;
@@ -2964,7 +2964,7 @@
 
 =item 'form.catalogmode' 
 
-Checked for 'interactive' and 'groupsearch'.
+Checked for 'interactive' and 'import'.
 
 =item 'form.mode'
 
@@ -3056,7 +3056,7 @@
 SCRIPT
         }
     }
-    $js.=<<SCRIPT if $env{'form.catalogmode'} eq 'groupsearch';
+    $js.=<<SCRIPT if $env{'form.catalogmode'} eq 'import';
 <script type="text/javascript">
     function queue(checkbox_num,val) {
         if (document.forms.results.returnvalues.length != "undefined" &&
@@ -3076,7 +3076,7 @@
     }
     function select_group() {
 	parent.window.location=
-    "/adm/groupsort?mode=$env{'form.mode'}&catalogmode=groupsearch&acts="+
+    "/adm/groupsort?mode=$env{'form.mode'}&catalogmode=import&acts="+
 	    parent.statusframe.document.forms.statusform.elements.Queue.value;
     }
 </script>
@@ -3086,8 +3086,7 @@
 						     {'only_body' =>1});
     my $result=<<END;
 $start_page
-<form name="results" method="post" action="/adm/searchcat" >
-<input type="hidden" name="Queue" value="" />
+<form name="results" method="post" action="/adm/searchcat">
 $importbutton
 END
     return $result;
@@ -3211,7 +3210,7 @@
     my $jumpurl=$values{'url'};
     $jumpurl=~s/^\/ext\//http\:\/\//;
     $result .= '<b>'.$prefix.
-        '<img src="'.&Apache::loncommon::icon($values{'url'}).' " />'.'&nbsp;'.
+        '<img src="'.&Apache::loncommon::icon($values{'url'}).'" />'.'&nbsp;'.
         '<a href="'.$jumpurl.'" '.
         'target="search_preview">'.$values{'title'}."</a></b>\n";
     $result .= "<p>\n";
@@ -3277,25 +3276,25 @@
         next if (! exists($values{$field->{'name'}}) ||
                  $values{$field->{'name'}} eq '');
         if (exists($field->{'type'}) && $field->{'type'} eq 'list') {
-            $result .= '<b>'.&mt($field->{'translate'}).'</b><ul>';
+            $result .= '<b>'.&mt($field->{'translate'}).'</b>';
             foreach my $item (split(',',$values{$field->{'name'}})){
-                $result .= '<li>'.
-                    '<a target="search_preview" '.
-                    'href="'.$jumpurl.'">'.$item.'</a></li>';
+                $result .= 
+		  &Apache::lonhtmlcommon::crumbs($item,
+		  (($env{'form.catalogmode'} eq 'import')?'_top':'preview'),
+		  '/res',
+		  (($env{'form.catalogmode'} eq 'import')?'parent.statusframe.document.forms.statusform':''),1);
             }
-            $result .= '</ul>';
         } elsif (exists($field->{'format'}) && $field->{'format'} ne ''){
             $result.= &mt($field->{'translate'},
                           sprintf($field->{'format'},
                                   $values{$field->{'name'}}))."<br />\n";
         } else {
             if ($field->{'special'} eq 'url link') {
-                $result.= 
-                     &mt($field->{'translate'},
-                         '<a href="'.$jumpurl.'" '.
-                         'target="search_preview">'.
-                         $values{$field->{'name'}}.
-                         '</a>');
+                $result.=
+		  &Apache::lonhtmlcommon::crumbs($jumpurl,
+		  (($env{'form.catalogmode'} eq 'import')?'_top':'preview'),
+		  '',
+		  (($env{'form.catalogmode'} eq 'import')?'parent.statusframe.document.forms.statusform':''),1);
             } else {
                 $result.= &mt($field->{'translate'},
                               $values{$field->{'name'}});
@@ -3352,10 +3351,14 @@
     }
     my $jumpurl=$values{'url'};
     $jumpurl=~s/^\/ext\//http\:\/\//;
+    my $link=&Apache::lonhtmlcommon::crumbs($jumpurl,
+		  (($env{'form.catalogmode'} eq 'import')?'_top':'preview'),
+		  '',
+		  (($env{'form.catalogmode'} eq 'import')?'parent.statusframe.document.forms.statusform':''),1);
 
     $result.=<<END;
 <a href="$jumpurl" 
-   target='search_preview'>$values{'title'}</a><br />
+   target='search_preview'>$values{'title'}</a>$link
 $values{'author'}, $values{'owner'} -- $values{'lastrevisiondate'}<br />
 $values{'copyrighttag'}<br />
 $values{'extrashow'}
@@ -3389,7 +3392,10 @@
     my ($prefix,%values) = @_;
     my $jumpurl=$values{'url'};
     $jumpurl=~s/^\/ext\//http\:\/\//;
-
+    my $link=&Apache::lonhtmlcommon::crumbs($jumpurl,
+		  (($env{'form.catalogmode'} eq 'import')?'_top':'preview'),
+		  '',
+		  (($env{'form.catalogmode'} eq 'import')?'parent.statusframe.document.forms.statusform':''),1);
     my $result = 
         $prefix.'<img src="'.&Apache::loncommon::icon($values{'url'}).'">';
     if (exists($env{'form.sortfield'}) && 
@@ -3399,7 +3405,7 @@
         $result .= '&nbsp;'.$tmp.'&nbsp;';
     }
     $result.='&nbsp;<a href="'.$jumpurl.'" target="search_preview">'.
-        $values{'title'}.'</a>'.('&nbsp;'x2).
+        $values{'title'}.'</a>'.('&nbsp;'x2).$link.
         '<b>'.$values{'author'}.'</b> ('.$values{'domain'}.')<br />';
     return $result;
 }
Index: rat/lonratedt.pm
diff -u rat/lonratedt.pm:1.78 rat/lonratedt.pm:1.79
--- rat/lonratedt.pm:1.78	Tue May 30 13:15:10 2006
+++ rat/lonratedt.pm	Thu Jun  8 09:56:40 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Edit Handler for RAT Maps
 #
-# $Id: lonratedt.pm,v 1.78 2006/05/30 17:15:10 www Exp $
+# $Id: lonratedt.pm,v 1.79 2006/06/08 13:56:40 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -716,11 +716,11 @@
 }
 // ----------------------------------------------------- launch indexer browser
 function groupsearch() {
-   srchcheck('groupsearch');
+   srchcheck('import');
 }
 
 function groupimport() {
-   idxcheck('groupimport');
+   idxcheck('import');
 }
 
 // ------------------------------------------------------- Do srch status check
Index: rat/lonsequence.pm
diff -u rat/lonsequence.pm:1.26 rat/lonsequence.pm:1.27
--- rat/lonsequence.pm:1.26	Tue Apr  4 11:32:12 2006
+++ rat/lonsequence.pm	Thu Jun  8 09:56:40 2006
@@ -2,7 +2,7 @@
 #
 # Sequence Handler
 #
-# $Id: lonsequence.pm,v 1.26 2006/04/04 15:32:12 albertel Exp $
+# $Id: lonsequence.pm,v 1.27 2006/06/08 13:56:40 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -26,8 +26,6 @@
 #
 # http://www.lon-capa.org/
 #
-# (Handler to resolve ambiguous file locations
-#
 
 package Apache::lonsequence;
 
@@ -108,7 +106,7 @@
 </form>   
 ENDSELECT
     my $diropendb = 
-    "/home/httpd/perl/tmp/$env{'user.domain'}\_$env{'user.name'}_groupsec.db";
+    "/home/httpd/perl/tmp/$env{'user.domain'}\_$env{'user.name'}_sel_res.db";
         if (tie(%selhash,'GDBM_File',$diropendb,&GDBM_WRCREAT(),0640)) {
 	    if ($env{'form.launch'} eq '1') {
 	       &start_fresh_session();
@@ -116,7 +114,7 @@
             $successtied=1;
 
 # - Evaluate actions from previous page (both cumulatively and chronologically)
-        if ($env{'form.catalogmode'} eq 'groupimport') {
+        if ($env{'form.catalogmode'} eq 'import') {
 	    my $acts=$env{'form.acts'};
 	    my @Acts=split(/b/,$acts);
 	    my %ahash;
Index: rat/client/ratcode.js
diff -u rat/client/ratcode.js:1.4 rat/client/ratcode.js:1.5
--- rat/client/ratcode.js:1.4	Fri Jun 10 21:06:54 2005
+++ rat/client/ratcode.js	Thu Jun  8 09:56:52 2006
@@ -1,7 +1,7 @@
 <!--
 The LearningOnline Network
 Resource Assembly Tool
-// $Id: ratcode.js,v 1.4 2005/06/11 01:06:54 www Exp $
+// $Id: ratcode.js,v 1.5 2006/06/08 13:56:52 www Exp $
 //
 // Copyright Michigan State University Board of Trustees
 //
@@ -2758,15 +2758,15 @@
 
 // ----------------------------------------------------- launch indexer browser
 function groupsearch() {
-   srchcheck('groupsearch');
+   srchcheck('import');
 }
 
 function groupimport() {
-   idxcheck('groupimport');
+   idxcheck('import');
 }
 
 function groupcopy() {
-   copydxcheck('groupsec');
+   copydxcheck('import');
 }
 
 // -------------------------------------------------------------- Store changes

--www1149775012--