'.
@@ -2466,26 +2833,6 @@ sub storedata {
} else {
push (@deldata,$thiskey,$thiskey.'.type');
}
- } elsif ($cmd eq 'datepointer') {
- my $data=&Apache::lonhtmlcommon::get_date_from_form($env{$_});
- my $typeof=$env{'form.typeof_'.$thiskey};
- if (defined($data) and $$olddata{$thiskey} ne $data) {
- if ($tuname) {
- if (&Apache::lonnet::put('resourcedata',{$tkey=>$data,
- $tkey.'.type' => $typeof},
- $tudom,$tuname) eq 'ok') {
- &log_parmset({$tkey=>$data,$tkey.'.type' => $typeof},0,$tuname,$tudom);
- $r->print('
'.&mt('Saved modified date for').' '.&Apache::loncommon::plainname($tuname,$tudom));
- } else {
- $r->print('
'.
- &mt('Error saving parameters').'
');
- }
- &Apache::lonnet::devalidateuserresdata($tuname,$tudom);
- } else {
- $newdata{$thiskey}=$data;
- $newdata{$thiskey.'.type'}=$typeof;
- }
- }
}
}
}
@@ -2521,6 +2868,26 @@ sub extractuser {
return ($key=~/^$env{'request.course.id'}.\[useropt\:($match_username)\:($match_domain)\]\./);
}
+sub parse_listdata_key {
+ my ($key,$listdata) = @_;
+ # split into student/section affected, and
+ # the realm (folder/resource part and parameter
+ my ($student,$realm) =
+ ($key=~/^\Q$env{'request.course.id'}\E\.\[([^\.]+)\]\.(.+)$/);
+ # if course wide student would be undefined
+ if (!defined($student)) {
+ ($realm)=($key=~/^\Q$env{'request.course.id'}\E\.(.+)$/);
+ }
+ # strip off the .type if it's not the Question type parameter
+ if ($realm=~/\.type$/ && !exists($listdata->{$key.'.type'})) {
+ $realm=~s/\.type//;
+ }
+ # split into resource+part and parameter name
+ my ($res, $parm) = ($realm=~/^(.*)\.(.*)$/);
+ ($res, my $part) = ($res =~/^(.*)\.(.*)$/);
+ return ($student,$res,$part,$parm);
+}
+
sub listdata {
my ($r,$resourcedata,$listdata,$sortorder)=@_;
# Start list output
@@ -2532,40 +2899,48 @@ sub listdata {
$tableopen=0;
my $foundkeys=0;
my %keyorder=&standardkeyorder();
+
foreach my $thiskey (sort {
+ my ($astudent,$ares,$apart,$aparm) = &parse_listdata_key($a,$listdata);
+ my ($bstudent,$bres,$bpart,$bparm) = &parse_listdata_key($b,$listdata);
+
+ # get the numerical order for the param
+ $aparm=$keyorder{'parameter_0_'.$aparm};
+ $bparm=$keyorder{'parameter_0_'.$bparm};
+
+ my $result=0;
+
if ($sortorder eq 'realmstudent') {
- my ($astudent,$arealm)=($a=~/^\Q$env{'request.course.id'}\E\.\[([^\.]+)\]\.(.+)\.[^\.]+$/);
- my ($bstudent,$brealm)=($b=~/^\Q$env{'request.course.id'}\E\.\[([^\.]+)\]\.(.+)\.[^\.]+$/);
- if (!defined($astudent)) {
- ($arealm)=($a=~/^\Q$env{'request.course.id'}\E\.(.+)$/);
- }
- if (!defined($bstudent)) {
- ($brealm)=($b=~/^\Q$env{'request.course.id'}\E\.(.+)$/);
- }
- $arealm=~s/\.type//;
- my ($ares, $aparm) = ($arealm=~/^(.*)\.(.*)$/);
- $aparm=$keyorder{'parameter_0_'.$aparm};
- $brealm=~s/\.type//;
- my ($bres, $bparm) = ($brealm=~/^(.*)\.(.*)$/);
- $bparm=$keyorder{'parameter_0_'.$bparm};
- if ($ares eq $bres) {
- if (defined($aparm) && defined($bparm)) {
- ($aparm <=> $bparm);
- } elsif (defined($aparm)) {
- -1;
- } elsif (defined($bparm)) {
- 1;
- } else {
- ($arealm cmp $brealm) || ($astudent cmp $bstudent);
- }
- } else {
- ($arealm cmp $brealm) || ($astudent cmp $bstudent);
+ if ($ares ne $bres ) {
+ $result = ($ares cmp $bres);
+ } elsif ($astudent ne $bstudent) {
+ $result = ($astudent cmp $bstudent);
+ } elsif ($apart ne $bpart ) {
+ $result = ($apart cmp $bpart);
}
} else {
- $a cmp $b;
+ if ($astudent ne $bstudent) {
+ $result = ($astudent cmp $bstudent);
+ } elsif ($ares ne $bres ) {
+ $result = ($ares cmp $bres);
+ } elsif ($apart ne $bpart ) {
+ $result = ($apart cmp $bpart);
+ }
+ }
+
+ if (!$result) {
+ if (defined($aparm) && defined($bparm)) {
+ $result = ($aparm <=> $bparm);
+ } elsif (defined($aparm)) {
+ $result = -1;
+ } elsif (defined($bparm)) {
+ $result = 1;
+ }
}
+
+ $result;
} keys %{$listdata}) {
-
+
if ($$listdata{$thiskey.'.type'}) {
my $thistype=$$listdata{$thiskey.'.type'};
if ($$resourcedata{$thiskey.'.type'}) {
@@ -2617,15 +2992,16 @@ sub listdata {
}
if ($part ne $oldpart) {
$r->print(&tableend().
- "\n
".&mt('Part').": $part ");
+ "\n".'
'.&mt('Part').": $part ");
$oldpart=$part;
}
#
# Ready to print
#
+ my $parmitem = &standard_parameter_names($name);
$r->print(&tablestart().
&Apache::loncommon::start_data_table_row().
- '
'.&standard_parameter_names($name).
+ ' '.&mt($parmitem).
' ');
$foundkeys++;
@@ -2638,41 +3014,138 @@ sub listdata {
$$resourcedata{$thiskey},
'',1,'','').
' '.
+(($$resourcedata{$thiskey}!=0)?''.
+&mt('Shift all dates based on this date').' ':'').
&date_sanity_info($$resourcedata{$thiskey})
);
- } elsif ($thistype eq 'string_yesno') {
- my $showval;
- if (defined($$resourcedata{$thiskey})) {
- $showval=$$resourcedata{$thiskey};
- }
- $r->print(' print(' checked="checked"');
- }
- $r->print(' />'.&mt('Yes').' ');
- $r->print(' print(' checked="checked"');
- }
- $r->print(' />'.&mt('No').' ');
+ } elsif ($thistype eq 'date_interval') {
+ $r->print(&date_interval_selector($thiskey,
+ $$resourcedata{$thiskey}));
+ } elsif ($thistype =~ m/^string/) {
+ $r->print(&string_selector($thistype,$thiskey,
+ $$resourcedata{$thiskey}));
} else {
- my $showval;
- if (defined($$resourcedata{$thiskey})) {
- $showval=$$resourcedata{$thiskey};
- }
- $r->print(' ');
+ $r->print(&default_selector($thiskey,$$resourcedata{$thiskey}));
}
$r->print(' ');
+ $thistype.'" />');
$r->print(' '.&Apache::loncommon::end_data_table_row());
}
}
return $foundkeys;
}
+
+sub date_interval_selector {
+ my ($thiskey, $showval) = @_;
+ my $result;
+ foreach my $which (['days', 86400, 31],
+ ['hours', 3600, 23],
+ ['minutes', 60, 59],
+ ['seconds', 1, 59]) {
+ my ($name, $factor, $max) = @{ $which };
+ my $amount = int($showval/$factor);
+ $showval %= $factor;
+ my %select = ((map {$_ => $_} (0..$max)),
+ 'select_form_order' => [0..$max]);
+ $result .= &Apache::loncommon::select_form($amount,$name.'_'.$thiskey,
+ %select);
+ $result .= ' '.&mt($name);
+ }
+ $result .= '
';
+ return $result;
+
+}
+
+sub get_date_interval_from_form {
+ my ($key) = @_;
+ my $seconds = 0;
+ foreach my $which (['days', 86400],
+ ['hours', 3600],
+ ['minutes', 60],
+ ['seconds', 1]) {
+ my ($name, $factor) = @{ $which };
+ if (defined($env{'form.'.$name.'_'.$key})) {
+ $seconds += $env{'form.'.$name.'_'.$key} * $factor;
+ }
+ }
+ return $seconds;
+}
+
+
+sub default_selector {
+ my ($thiskey, $showval) = @_;
+ return '
';
+}
+
+my %strings =
+ (
+ 'string_yesno'
+ => [[ 'yes', 'Yes' ],
+ [ 'no', 'No' ]],
+ 'string_problemstatus'
+ => [[ 'yes', 'Yes' ],
+ [ 'answer', 'Yes, and show correct answer if they exceed the maximum number of tries.' ],
+ [ 'no', 'No, don\'t show correct/incorrect feedback.' ],
+ [ 'no_feedback_ever', 'No, show no feedback at all.' ]],
+ );
+
+
+sub string_selector {
+ my ($thistype, $thiskey, $showval) = @_;
+
+ if (!exists($strings{$thistype})) {
+ return &default_selector($thiskey,$showval);
+ }
+
+ my $result;
+ foreach my $possibilities (@{ $strings{$thistype} }) {
+ my ($name, $description) = @{ $possibilities };
+ $result .= '
';
+ }
+ return $result;
+}
+
+#
+# Shift all start and end dates by $shift
+#
+
+sub dateshift {
+ my ($shift)=@_;
+ my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+ my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
+ my %data=&Apache::lonnet::dump('resourcedata',$dom,$crs);
+# ugly retro fix for broken version of types
+ foreach my $key (keys %data) {
+ if ($key=~/\wtype$/) {
+ my $newkey=$key;
+ $newkey=~s/type$/\.type/;
+ $data{$newkey}=$data{$key};
+ 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;
+ $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 {
my ($r) = @_;
@@ -2714,8 +3187,8 @@ ENDOVER
my @selected_sections =
&Apache::loncommon::get_env_multiple('form.Section');
@selected_sections = ('all') if (! @selected_sections);
- foreach (@selected_sections) {
- if ($_ eq 'all') {
+ foreach my $sec (@selected_sections) {
+ if ($sec eq 'all') {
@selected_sections = ('all');
}
}
@@ -2735,6 +3208,9 @@ ENDOVER
\%mapp, \%symbp,\%maptitles,\%uris,
\%keyorder,\%defkeytype);
+ if (grep {$_ eq 'all'} (@psprt)) {
+ @psprt = keys(%allparts);
+ }
# Menu to select levels, etc
$r->print('
@@ -2889,7 +3365,7 @@ ENDOVER
$r->print(''.
&mt('These parameters refer to resources that do not exist.').
' '.
- ' '.' '.
+ ' '.' '.
' ');
$r->print(&Apache::loncommon::start_data_table().
''.
@@ -2900,8 +3376,8 @@ ENDOVER
next if (!exists($resourcedata->{$thiskey.'.type'})
&& $thiskey=~/\.type$/);
my %data = &parse_key($thiskey);
- if (exists($data{'realm_exists'})
- && !$data{'realm_exists'}) {
+ if (1) { #exists($data{'realm_exists'})
+ #&& !$data{'realm_exists'}) {
$r->print(&Apache::loncommon::start_data_table_row().
' '.
' ' );
@@ -2912,9 +3388,10 @@ ENDOVER
$display_value =
&Apache::lonlocal::locallocaltime($display_value);
}
+ my $parmitem = &standard_parameter_names($data{'parameter_name'});
+ $parmitem = &mt($parmitem);
$r->print(&mt('Parameter: "[_1]" with value: "[_2]"',
- &standard_parameter_names($data{'parameter_name'}),
- $resourcedata->{$thiskey}));
+ $parmitem,$resourcedata->{$thiskey}));
$r->print(' ');
if ($data{'scope_type'} eq 'all') {
$r->print(&mt('All users'));
@@ -2942,11 +3419,56 @@ ENDOVER
}
}
$r->print(&Apache::loncommon::end_data_table().''.
- ' '.
+ ' '.
'
'.
&Apache::loncommon::end_page());
}
+sub date_shift_one {
+ my ($r) = @_;
+ my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+ my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
+
+ my $start_page=&Apache::loncommon::start_page('Shift Dates');
+ my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Shift');
+ $r->print(<print('');
+ $r->print(&Apache::loncommon::end_page());
+}
+
+sub date_shift_two {
+ my ($r) = @_;
+ my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+ my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
+ my $start_page=&Apache::loncommon::start_page('Shift Dates');
+ my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Shift');
+ $r->print(<print(&mt('Shifting all dates such that [_1] becomes [_2]',
+ &Apache::lonlocal::locallocaltime($env{'form.timebase'}),
+ &Apache::lonlocal::locallocaltime($timeshifted)));
+ my $delta=$timeshifted-$env{'form.timebase'};
+ &dateshift($delta);
+ $r->print(&Apache::loncommon::end_page());
+}
+
sub parse_key {
my ($key) = @_;
my %data;
@@ -2972,7 +3494,6 @@ sub parse_key {
$data{'realm_type'} = 'folder';
$data{'realm_title'} = &Apache::lonnet::gettitle($data{'realm'});
($data{'realm_exists'}) = &Apache::lonnet::is_on_map($data{'realm'});
- &Apache::lonnet::logthis($1." siad ". $data{'realm_exists'} );
} elsif ($middle) {
$data{'realm'} = $middle;
$data{'realm_type'} = 'symb';
@@ -3019,48 +3540,63 @@ where $action is add or drop, and $clone
user for whom cloning ability is to be changed in course.
=cut
-
+
##################################################
##################################################
sub extract_cloners {
my ($clonelist,$allowclone) = @_;
if ($clonelist =~ /,/) {
- @{$allowclone} = split/,/,$clonelist;
+ @{$allowclone} = split(/,/,$clonelist);
} else {
$$allowclone[0] = $clonelist;
}
}
-
sub check_cloners {
my ($clonelist,$oldcloner) = @_;
- my ($clean_clonelist,$disallowed);
+ my ($clean_clonelist,%disallowed);
my @allowclone = ();
&extract_cloners($$clonelist,\@allowclone);
foreach my $currclone (@allowclone) {
- if (!grep/^$currclone$/,@$oldcloner) {
- my ($uname,$udom) = split/:/,$currclone;
- if ($uname && $udom) {
- if (&Apache::lonnet::homeserver($uname,$udom) eq 'no_host') {
- $disallowed .= $currclone.',';
+ if (!grep(/^\Q$currclone\E$/,@$oldcloner)) {
+ if ($currclone eq '*') {
+ $clean_clonelist .= $currclone.',';
+ } else {
+ my ($uname,$udom) = split(/:/,$currclone);
+ if ($uname eq '*') {
+ if ($udom =~ /^$match_domain$/) {
+ if (!&Apache::lonnet::domain($udom)) {
+ $disallowed{'domain'} .= $currclone.',';
+ } else {
+ $clean_clonelist .= $currclone.',';
+ }
+ } else {
+ $disallowed{'format'} .= $currclone.',';
+ }
+ } elsif ($currclone !~/^($match_username)\:($match_domain)$/) {
+ $disallowed{'format'} .= $currclone.',';
} else {
- $clean_clonelist .= $currclone.',';
+ if (&Apache::lonnet::homeserver($uname,$udom) eq 'no_host') {
+ $disallowed{'newuser'} .= $currclone.',';
+ } else {
+ $clean_clonelist .= $currclone.',';
+ }
}
}
} else {
$clean_clonelist .= $currclone.',';
}
}
- if ($disallowed) {
- $disallowed =~ s/,$//;
+ foreach my $key (keys(%disallowed)) {
+ $disallowed{$key} =~ s/,$//;
}
if ($clean_clonelist) {
$clean_clonelist =~ s/,$//;
}
$$clonelist = $clean_clonelist;
- return $disallowed;
-}
+ return %disallowed;
+}
sub change_clone {
my ($clonelist,$oldcloner) = @_;
@@ -3073,43 +3609,47 @@ sub change_clone {
my @allowclone;
&extract_cloners($clonelist,\@allowclone);
foreach my $currclone (@allowclone) {
- if (!grep/^$currclone$/,@$oldcloner) {
- ($uname,$udom) = split/:/,$currclone;
- if ($uname && $udom) {
- unless (&Apache::lonnet::homeserver($uname,$udom) eq 'no_host') {
- my %currclonecrs = &Apache::lonnet::dump('environment',$udom,$uname,'cloneable');
- if ($currclonecrs{'cloneable'} !~ /\Q$clone_crs\E/) {
- if ($currclonecrs{'cloneable'} eq '') {
- $currclonecrs{'cloneable'} = $clone_crs;
- } else {
- $currclonecrs{'cloneable'} .= ','.$clone_crs;
+ if (!grep(/^$currclone$/,@$oldcloner)) {
+ if ($currclone ne '*') {
+ ($uname,$udom) = split(/:/,$currclone);
+ if ($uname && $udom && $uname ne '*') {
+ if (&Apache::lonnet::homeserver($uname,$udom) ne 'no_host') {
+ my %currclonecrs = &Apache::lonnet::dump('environment',$udom,$uname,'cloneable');
+ if ($currclonecrs{'cloneable'} !~ /\Q$clone_crs\E/) {
+ if ($currclonecrs{'cloneable'} eq '') {
+ $currclonecrs{'cloneable'} = $clone_crs;
+ } else {
+ $currclonecrs{'cloneable'} .= ','.$clone_crs;
+ }
+ &Apache::lonnet::put('environment',\%currclonecrs,$udom,$uname);
}
- &Apache::lonnet::put('environment',\%currclonecrs,$udom,$uname);
}
}
}
}
}
foreach my $oldclone (@$oldcloner) {
- if (!grep/^$oldclone$/,@allowclone) {
- ($uname,$udom) = split/:/,$oldclone;
- if ($uname && $udom) {
- unless (&Apache::lonnet::homeserver($uname,$udom) eq 'no_host') {
- my %currclonecrs = &Apache::lonnet::dump('environment',$udom,$uname,'cloneable');
- my %newclonecrs = ();
- if ($currclonecrs{'cloneable'} =~ /\Q$clone_crs\E/) {
- if ($currclonecrs{'cloneable'} =~ /,/) {
- my @currclonecrs = split/,/,$currclonecrs{'cloneable'};
- foreach (@currclonecrs) {
- unless ($_ eq $clone_crs) {
- $newclonecrs{'cloneable'} .= $_.',';
+ if (!grep(/^\Q$oldclone\E$/,@allowclone)) {
+ if ($oldclone ne '*') {
+ ($uname,$udom) = split(/:/,$oldclone);
+ if ($uname && $udom && $uname ne '*' ) {
+ if (&Apache::lonnet::homeserver($uname,$udom) ne 'no_host') {
+ my %currclonecrs = &Apache::lonnet::dump('environment',$udom,$uname,'cloneable');
+ my %newclonecrs = ();
+ if ($currclonecrs{'cloneable'} =~ /\Q$clone_crs\E/) {
+ if ($currclonecrs{'cloneable'} =~ /,/) {
+ my @currclonecrs = split/,/,$currclonecrs{'cloneable'};
+ foreach my $crs (@currclonecrs) {
+ if ($crs ne $clone_crs) {
+ $newclonecrs{'cloneable'} .= $crs.',';
+ }
}
+ $newclonecrs{'cloneable'} =~ s/,$//;
+ } else {
+ $newclonecrs{'cloneable'} = '';
}
- $newclonecrs{'cloneable'} =~ s/,$//;
- } else {
- $newclonecrs{'cloneable'} = '';
+ &Apache::lonnet::put('environment',\%newclonecrs,$udom,$uname);
}
- &Apache::lonnet::put('environment',\%newclonecrs,$udom,$uname);
}
}
}
@@ -3265,21 +3805,21 @@ sub output_row {
my $multiple_checked;
my $single_checked;
if ($options =~ m/onlyone/) {
- $multiple_checked = "";
- $single_checked = " CHECKED ";
+ $multiple_checked = '';
+ $single_checked = ' checked="checked"';
} else {
- $multiple_checked = " CHECKED ";
- $single_checked = "";
+ $multiple_checked = ' checked="checked"';
+ $single_checked = '';
}
$output .= &Apache::loncommon::continue_data_table_row();
$output .= ''.(' ' x 10).'
-
- Student may select multiple choices from list ';
+
+ '.&mt('Student may select multiple choices from list').'';
$output .= &Apache::loncommon::end_data_table_row();
$output .= &Apache::loncommon::continue_data_table_row();
$output .= ''.(' ' x 10).'
- Student may select only one choice from list ';
+ '.&mt('Student may select only one choice from list').'';
$output .= &Apache::loncommon::end_data_table_row();
}
return ($output);
@@ -3329,7 +3869,7 @@ sub order_meta_fields {
my $ordered_fields = join ",", @neworder;
my $put_result = &Apache::lonnet::put('environment',
{'metadata.addedorder'=>$ordered_fields},$dom,$crs);
- &Apache::lonnet::appenv('course.'.$env{'request.course.id'}.'.metadata.addedorder' => $ordered_fields);
+ &Apache::lonnet::appenv({'course.'.$env{'request.course.id'}.'.metadata.addedorder' => $ordered_fields});
}
my $fields = &get_added_meta_fieldnames($env{'request.course.id'});
my $ordered_fields;
@@ -3742,7 +4282,6 @@ sub load_parameter_names {
close($config);
$standard_parms{'int_pos'} = 'Positive Integer';
$standard_parms{'int_zero_pos'} = 'Positive Integer or Zero';
- %standard_parms=&Apache::lonlocal::texthash(%standard_parms);
}
sub standard_parameter_names {
@@ -3856,15 +4395,18 @@ sub parm_change_log {
} else {
$makenewrow=1;
}
+ my $parmitem = &standard_parameter_names($parmname);
$output .=''.$realm.' '.$section.' '.
- &standard_parameter_names($parmname).' '.
+ &mt($parmitem).' '.
($part?&mt('Part: [_1]',$part):&mt('All Parts')).' ';
my $stillactive=0;
if ($parmlog{$id}{'delflag'}) {
$output .= &mt('Deleted');
} else {
if ($typeflag) {
- $output .= &mt('Type: [_1]',&standard_parameter_names($value));
+ my $parmitem = &standard_parameter_names($value);
+ $parmitem = &mt($parmitem);
+ $output .= &mt('Type: [_1]',$parmitem);
} else {
my ($level,@all)=&parmval_by_symb($what,$middle,&Apache::lonnet::metadata($middle,$what),
$uname,$udom,$issection,$issection,$courseopt);
@@ -3882,8 +4424,11 @@ sub parm_change_log {
}
$output .= ' ';
if ($stillactive) {
- my $title=&mt('Changed [_1]',&standard_parameter_names($parmname));
- my $description=&mt('Changed [_1] for [_2] to [_3]',&standard_parameter_names($parmname),$realmdescription,
+ my $parmitem = &standard_parameter_names($parmname);
+ $parmitem = &mt($parmitem);
+ my $title=&mt('Changed [_1]',$parmitem);
+ my $description=&mt('Changed [_1] for [_2] to [_3]',
+ $parmitem,$realmdescription,
(&isdateparm($istype{$parmname})?&Apache::lonlocal::locallocaltime($value):$value));
if (($uname) && ($udom)) {
$output .=
@@ -3935,14 +4480,15 @@ sub check_for_course_info {
Main handler. Calls &assessparms and &crsenv subroutines.
=cut
+
##################################################
##################################################
-# use Data::Dumper;
-
sub handler {
my $r=shift;
+ &reset_caches();
+
if ($r->header_only) {
&Apache::loncommon::content_type($r,'text/html');
$r->send_http_header;
@@ -3953,7 +4499,7 @@ sub handler {
'pres_marker',
'pres_value',
'pres_type',
- 'udom','uname','symb','serial']);
+ 'udom','uname','symb','serial','timebase']);
&Apache::lonhtmlcommon::clear_breadcrumbs();
@@ -3977,10 +4523,6 @@ sub handler {
$r->send_http_header;
- # id numbers can change on re-ordering of folders
-
- &resetsymbcache();
-
#
# Main switch on form.action and form.state, as appropriate
#
@@ -4037,7 +4579,17 @@ sub handler {
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=cleanparameters',
text=>"Clean Parameters"});
&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 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 Dates"});
+ &date_shift_two($r);
+ } elsif ($env{'form.action'} eq 'categorizecourse' && $parm_permission) {
+ &assign_course_categories($r);
+ }
} else {
# ----------------------------- Not in a course, or not allowed to modify parms
if ($exists) {
@@ -4049,6 +4601,8 @@ sub handler {
}
return HTTP_NOT_ACCEPTABLE;
}
+ &reset_caches();
+
return OK;
}