[LON-CAPA-cvs] cvs: loncom /interface lonparmset.pm

www lon-capa-cvs-allow@mail.lon-capa.org
Sat, 26 Jan 2008 19:22:27 -0000


www		Sat Jan 26 14:22:27 2008 EDT

  Modified files:              
    /loncom/interface	lonparmset.pm 
  Log:
  Bug #4325: Shift all dates
  
  
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.390 loncom/interface/lonparmset.pm:1.391
--- loncom/interface/lonparmset.pm:1.390	Thu Jan 24 18:23:55 2008
+++ loncom/interface/lonparmset.pm	Sat Jan 26 14:22:24 2008
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.390 2008/01/24 23:23:55 www Exp $
+# $Id: lonparmset.pm,v 1.391 2008/01/26 19:22:24 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2844,13 +2844,21 @@
             delete $data{$key};
         }
     }
+    my %storecontent=();
 # go through all parameters and look for dates
     foreach my $key (keys %data) {
        if ($data{$key.'.type'}=~/^date_(start|end)$/) {
           my $newdate=$data{$key}+$shift;
-          &Apache::lonnet::put('resourcedata',{$key => $newdate},$dom,$crs);
+          $storecontent{$key}=$newdate;
        }
     }
+    my $reply=&Apache::lonnet::cput
+                ('resourcedata',\%storecontent,$dom,$crs);
+    if ($reply eq 'ok') {
+       &log_parmset(\%storecontent);
+    }
+    &Apache::lonnet::devalidatecourseresdata($crs,$dom);
+    return $reply;
 }
 
 sub newoverview {
@@ -3166,8 +3174,6 @@
 $start_page
 $breadcrumbs
 ENDOVER
-    my $start_page=&Apache::loncommon::start_page('Shift Dates');
-    my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Shift');
     my $timeshifted=&Apache::lonhtmlcommon::get_date_from_form('timeshifted');
     $r->print(&mt('Shifting all dates such that [_1] becomes [_2]',
               &Apache::lonlocal::locallocaltime($env{'form.timebase'}),
@@ -4284,11 +4290,11 @@
 	    &clean_parameters($r);
         } elsif ($env{'form.action'} eq 'dateshift1' && $parm_permission) {
             &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=dateshift1&timebase='.$env{'form.timebase'},
-                                                    text=>"Shifting Grades"});
+                                                    text=>"Shifting Dates"});
             &date_shift_one($r);
         } elsif ($env{'form.action'} eq 'dateshift2' && $parm_permission) {
             &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=dateshift1&timebase='.$env{'form.timebase'},
-                                                    text=>"Shifting Grades"});
+                                                    text=>"Shifting Dates"});
             &date_shift_two($r);
 	}       
     } else {