[LON-CAPA-cvs] cvs: rat / lonratedt.pm

www lon-capa-cvs@mail.lon-capa.org
Tue, 21 May 2002 15:04:10 -0000


www		Tue May 21 11:04:10 2002 EDT

  Modified files:              
    /rat	lonratedt.pm 
  Log:
  Paste seems to work from import to target
  
  
Index: rat/lonratedt.pm
diff -u rat/lonratedt.pm:1.23 rat/lonratedt.pm:1.24
--- rat/lonratedt.pm:1.23	Tue May 21 09:41:13 2002
+++ rat/lonratedt.pm	Tue May 21 11:04:10 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Edit Handler for RAT Maps
 #
-# $Id: lonratedt.pm,v 1.23 2002/05/21 13:41:13 www Exp $
+# $Id: lonratedt.pm,v 1.24 2002/05/21 15:04:10 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -355,14 +355,14 @@
    undef @targetselect;
    if (defined($ENV{'form.import'})) {
        if (ref($ENV{'form.import'})) {
-	   @importselect=sort($ENV->{'form.import'});
+	   @importselect=sort(@{ $ENV{'form.import'} });
        } else {
            @importselect=($ENV{'form.import'});
        }
    }
    if (defined($ENV{'form.target'})) {
        if (ref($ENV{'form.target'})) {
-	   @targetselect=sort($ENV->{'form.target'});
+	   @targetselect=sort(@{ $ENV->{'form.target'} });
        } else {
            @targetselect=($ENV{'form.target'});
        }
@@ -472,6 +472,19 @@
    } elsif ($ENV{'form.cut'}) {
 # ----------------------------------------------------------------------- Paste
    } elsif ($ENV{'form.paste'}) {
+       my $lastsel;
+       if (defined($targetselect[-1])) {
+	   $lastsel=$targetselect[-1];
+       } else {
+           $lastsel=$#order+1;
+       }
+       my @newsequence;
+       my @curimport=split(/\&/,$ENV{'form.curimpdetail'});
+       foreach (@importselect) {
+          $newsequence[$#newsequence+1]=$curimport[$_];
+       }
+       &pastetarget($lastsel,@newsequence);
+       &storemap(&Apache::lonnet::filelocation('',$url));
 # ------------------------------------------------ 
    }
 # ------------------------------------------------------------ Assemble windows