');
- $r->print('');
- $r->print('
' );
+ $r->print('
');
+ $r->print('
');
+ &displaymenu($r,\%allparms,\@pscat,\%keyorder);
$r->print(&Apache::lonhtmlcommon::start_pick_box());
- &parmmenu($r,\%allparms,\@pscat,\%keyorder);
- $r->print(&Apache::lonhtmlcommon::row_closure());
-
$r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View')));
- #$r->print('
'.
- $r->print(''.
+ $r->print(''.
''.&mt('Parts').' '.&mt('Section(s)').
' '.&mt('Group(s)').' ');
&partmenu($r,\%allparts,\@psprt);
@@ -2828,8 +3339,8 @@ ENDOVER
$r->print(&Apache::lonhtmlcommon::end_pick_box());
$r->print('');
- $r->print('');
- $r->print('
' );
+ $r->print('
');
+ $r->print('
');
my $sortorder=$env{'form.sortorder'};
unless ($sortorder) { $sortorder='realmstudent'; }
&sortmenu($r,$sortorder);
@@ -2849,19 +3360,21 @@ ENDOVER
if (($env{'form.store'}) || ($env{'form.dis'})) {
- if ($env{'form.store'}) { &storedata($r,$crs,$dom); }
+ if ($env{'form.store'}) { &storedata($r,$crs,$dom); }
# Read modified data
- my $resourcedata=&readdata($crs,$dom);
+ my $resourcedata=&readdata($crs,$dom);
# List data
- &listdata($r,$resourcedata,$listdata,$sortorder);
+ &listdata($r,$resourcedata,$listdata,$sortorder);
}
$r->print(&tableend().
- ((($env{'form.store'}) || ($env{'form.dis'}))?'
':'').
- ''.&Apache::loncommon::end_page());
+ ((($env{'form.store'}) || ($env{'form.dis'}))?'
':'').
+ '');
+ &endSettingsScreen($r);
+ $r->print(&Apache::loncommon::end_page());
}
sub secgroup_lister {
@@ -2905,14 +3418,13 @@ sub overview {
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setoverview',
- text=>"Overview Mode"});
+ text=>"Overview Mode"});
my $start_page=&Apache::loncommon::start_page('Modify Parameters');
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Overview');
- $r->print(<
-ENDOVER
+ $r->print($start_page.$breadcrumbs);
+ &startSettingsScreen($r,'parmset');
+ $r->print(''.
- &Apache::loncommon::end_page());
+ ($foundkeys?' ':&mt('There are no parameters.')).''.
+ &Apache::loncommon::end_page());
}
sub clean_parameters {
@@ -2941,7 +3453,7 @@ sub clean_parameters {
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=cleanparameters',
- text=>"Clean Parameters"});
+ text=>"Clean Parameters"});
my $start_page=&Apache::loncommon::start_page('Clean Parameters');
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Clean');
$r->print(<print(''.
- &mt('These parameters refer to resources that do not exist.').
- ' '.
- ' '.' '.
- ' ');
+ &mt('These parameters refer to resources that do not exist.').
+ ''.
+ ' '.' '.
+ ' ');
$r->print(&Apache::loncommon::start_data_table().
- ''.
- ''.&mt('Delete').' '.
- ''.&mt('Parameter').' '.
- ' ');
+ ''.
+ ''.&mt('Delete').' '.
+ ''.&mt('Parameter').' '.
+ ' ');
foreach my $thiskey (sort(keys(%{$resourcedata}))) {
- next if (!exists($resourcedata->{$thiskey.'.type'})
- && $thiskey=~/\.type$/);
- my %data = &parse_key($thiskey);
- if (1) { #exists($data{'realm_exists'})
- #&& !$data{'realm_exists'}) {
- $r->print(&Apache::loncommon::start_data_table_row().
- ''.
- ' ' );
-
- $r->print('');
- my $display_value = $resourcedata->{$thiskey};
- if (&isdateparm($resourcedata->{$thiskey.'.type'})) {
- $display_value =
- &Apache::lonlocal::locallocaltime($display_value);
- }
- $r->print(&mt('Parameter: "[_1]" with value: "[_2]"',
- &standard_parameter_names($data{'parameter_name'}),
- $resourcedata->{$thiskey}));
- $r->print(' ');
- if ($data{'scope_type'} eq 'all') {
- $r->print(&mt('All users'));
- } elsif ($data{'scope_type'} eq 'user') {
- $r->print(&mt('User: [_1]',join(':',@{$data{'scope'}})));
- } elsif ($data{'scope_type'} eq 'section') {
- $r->print(&mt('Section: [_1]',$data{'scope'}));
- } elsif ($data{'scope_type'} eq 'group') {
- $r->print(&mt('Group: [_1]',$data{'scope'}));
- }
- $r->print(' ');
- if ($data{'realm_type'} eq 'all') {
- $r->print(&mt('All Resources'));
- } elsif ($data{'realm_type'} eq 'folder') {
- $r->print(&mt('Folder: [_1]'),$data{'realm'});
- } elsif ($data{'realm_type'} eq 'symb') {
- my ($map,$resid,$url) =
- &Apache::lonnet::decode_symb($data{'realm'});
- $r->print(&mt('Resource: [_1] with ID: [_2] in folder [_3]',
- $url,$resid,$map));
- }
- $r->print(' '.&mt('Part: [_1]',$data{'parameter_part'}));
- $r->print(' ');
+ next if (!exists($resourcedata->{$thiskey.'.type'})
+ && $thiskey=~/\.type$/);
+ my %data = &parse_key($thiskey);
+ if (1) { #exists($data{'realm_exists'})
+ #&& !$data{'realm_exists'}) {
+ $r->print(&Apache::loncommon::start_data_table_row().
+ ''.
+ ' ' );
+
+ $r->print('');
+ my $display_value = $resourcedata->{$thiskey};
+ if (&isdateparm($resourcedata->{$thiskey.'.type'})) {
+ $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]"',
+ $parmitem,$resourcedata->{$thiskey}));
+ $r->print(' ');
+ if ($data{'scope_type'} eq 'all') {
+ $r->print(&mt('All users'));
+ } elsif ($data{'scope_type'} eq 'user') {
+ $r->print(&mt('User: [_1]',join(':',@{$data{'scope'}})));
+ } elsif ($data{'scope_type'} eq 'section') {
+ $r->print(&mt('Section: [_1]',$data{'scope'}));
+ } elsif ($data{'scope_type'} eq 'group') {
+ $r->print(&mt('Group: [_1]',$data{'scope'}));
+ }
+ $r->print(' ');
+ if ($data{'realm_type'} eq 'all') {
+ $r->print(&mt('All Resources'));
+ } elsif ($data{'realm_type'} eq 'folder') {
+ $r->print(&mt('Folder: [_1]'),$data{'realm'});
+ } elsif ($data{'realm_type'} eq 'symb') {
+ my ($map,$resid,$url) =
+ &Apache::lonnet::decode_symb($data{'realm'});
+ $r->print(&mt('Resource: [_1] with ID: [_2] in folder [_3]',
+ $url,$resid,$map));
+ }
+ $r->print(' '.&mt('Part: [_1]',$data{'parameter_part'}));
+ $r->print(' ');
- }
+ }
}
$r->print(&Apache::loncommon::end_data_table().''.
- ' '.
- '
'.
- &Apache::loncommon::end_page());
+ ' '.
+ '');
+ &endSettingsScreen($r);
+ $r->print(&Apache::loncommon::end_page());
}
sub date_shift_one {
@@ -3026,13 +3540,11 @@ sub date_shift_one {
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=dateshift1&timebase='.$env{'form.timebase'},
- text=>"Shifting Dates"});
+ text=>"Shifting Dates"});
my $start_page=&Apache::loncommon::start_page('Shift Dates');
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Shift');
- $r->print(<print($start_page.$breadcrumbs);
+ &startSettingsScreen($r,'parmset');
$r->print('');
+ &endSettingsScreen($r);
}
@@ -3538,9 +3928,10 @@ sub setrestrictmeta {
my $item_num;
my $put_result;
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setrestrictmeta',
- text=>"Restrict Metadata"});
+ text=>"Restrict Metadata"});
$r->print(&Apache::loncommon::start_page('Restrict Metadata'));
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Restrict Metadata'));
+ &startSettingsScreen($r,'parmset');
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
my $key_base = $env{'course.'.$env{'request.course.id'}.'.'};
@@ -3553,21 +3944,21 @@ sub setrestrictmeta {
my $meta_key = $2;
if ($save_field ne $meta_field) {
$save_field = $meta_field;
- if ($env{'form.'.$meta_field.'_stuadd'}) {
- $options.='stuadd,';
- }
- if ($env{'form.'.$meta_field.'_choices'}) {
- $options.='choices,';
- }
- if ($env{'form.'.$meta_field.'_onlyone'} eq 'single') {
- $options.='onlyone,';
- }
- if ($env{'form.'.$meta_field.'_active'}) {
- $options.='active,';
- }
- if ($env{'form.'.$meta_field.'_deleted'}) {
- $options.='deleted,';
- }
+ if ($env{'form.'.$meta_field.'_stuadd'}) {
+ $options.='stuadd,';
+ }
+ if ($env{'form.'.$meta_field.'_choices'}) {
+ $options.='choices,';
+ }
+ if ($env{'form.'.$meta_field.'_onlyone'} eq 'single') {
+ $options.='onlyone,';
+ }
+ if ($env{'form.'.$meta_field.'_active'}) {
+ $options.='active,';
+ }
+ if ($env{'form.'.$meta_field.'_deleted'}) {
+ $options.='deleted,';
+ }
my $name = $save_field;
$put_result = &Apache::lonnet::put('environment',
{'metadata.'.$meta_field.'.options'=>$options,
@@ -3578,7 +3969,7 @@ sub setrestrictmeta {
}
}
&Apache::lonnet::coursedescription($env{'request.course.id'},
- {'freshen_cache' => 1});
+ {'freshen_cache' => 1});
# Get the default metadata fields
my %metadata_fields = &Apache::lonmeta::fieldnames('portfolio');
# Now get possible added metadata fields
@@ -3588,8 +3979,8 @@ sub setrestrictmeta {
foreach my $field (sort(keys(%metadata_fields))) {
if ($field ne 'courserestricted') {
$row_alt = $row_alt ? 0 : 1;
- $output.= &output_row($r, $field, $metadata_fields{$field});
- }
+ $output.= &output_row($r, $field, $metadata_fields{$field});
+ }
}
my $buttons = (<
@@ -3613,6 +4004,7 @@ ENDButtons
$buttons
ENDenv
+ &endSettingsScreen($r);
$r->print(&Apache::loncommon::end_page());
return 'ok';
}
@@ -3652,15 +4044,13 @@ sub defaultsetter {
my ($r) = @_;
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setdefaults',
- text=>"Set Defaults"});
+ text=>"Set Defaults"});
my $start_page =
- &Apache::loncommon::start_page('Parameter Setting Default Actions');
+ &Apache::loncommon::start_page('Parameter Setting Default Actions');
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Defaults');
- $r->print(<
-ENDDEFHEAD
+ $r->print($start_page.$breadcrumbs);
+ &startSettingsScreen($r,'parmset');
+ $r->print(''."\n".
- &Apache::loncommon::end_page());
+ "\n".' '."\n");
+ &endSettingsScreen($r);
+ $r->print(&Apache::loncommon::end_page());
return;
}
@@ -3814,84 +4205,94 @@ sub components {
my ($key,$uname,$udom,$exeuser,$exedomain,$typeflag)=@_;
if ($typeflag) {
- $key=~s/\.type$//;
+ $key=~s/\.type$//;
}
my ($middle,$part,$name)=
- ($key=~/^$env{'request.course.id'}\.(?:(.+)\.)*([\w\s]+)\.(\w+)$/);
+ ($key=~/^$env{'request.course.id'}\.(?:(.+)\.)*([\w\s]+)\.(\w+)$/);
my $issection;
my $section=&mt('All Students');
if ($middle=~/^\[(.*)\]/) {
- $issection=$1;
- $section=&mt('Group/Section').': '.$issection;
- $middle=~s/^\[(.*)\]//;
+ $issection=$1;
+ $section=&mt('Group/Section').': '.$issection;
+ $middle=~s/^\[(.*)\]//;
}
$middle=~s/\.+$//;
$middle=~s/^\.+//;
if ($uname) {
- $section=&mt('User').": ".&Apache::loncommon::plainname($uname,$udom);
- $issection='';
+ $section=&mt('User').": ".&Apache::loncommon::plainname($uname,$udom);
+ $issection='';
}
my $realm=''.&mt('All Resources').' ';
my $realmdescription=&mt('all resources');
if ($middle=~/^(.+)\_\_\_\(all\)$/) {
- $realm=''.&mt('Folder/Map').': '.&Apache::lonnet::gettitle($1).' ('.$1.') ';
- $realmdescription=&mt('folder').' '.&Apache::lonnet::gettitle($1);
+ $realm=''.&mt('Folder/Map').': '.&Apache::lonnet::gettitle($1).' ('.$1.') ';
+ $realmdescription=&mt('folder').' '.&Apache::lonnet::gettitle($1);
} elsif ($middle) {
- my ($map,$id,$url)=&Apache::lonnet::decode_symb($middle);
- $realm=''.&mt('Resource').': '.&Apache::lonnet::gettitle($middle).' ('.$url.' in '.$map.' id: '.$id.') ';
- $realmdescription=&mt('resource').' '.&Apache::lonnet::gettitle($middle);
+ my ($map,$id,$url)=&Apache::lonnet::decode_symb($middle);
+ $realm=''.&mt('Resource').': '.&Apache::lonnet::gettitle($middle).' ('.$url.' in '.$map.' id: '.$id.') ';
+ $realmdescription=&mt('resource').' '.&Apache::lonnet::gettitle($middle);
}
my $what=$part.'.'.$name;
return ($realm,$section,$name,$part,
- $what,$middle,$uname,$udom,$issection,$realmdescription);
+ $what,$middle,$uname,$udom,$issection,$realmdescription);
}
my %standard_parms;
-
+my %standard_parms_types;
sub load_parameter_names {
open(my $config,"<$Apache::lonnet::perlvar{'lonTabDir'}/packages.tab");
while (my $configline=<$config>) {
- if ($configline !~ /\S/ || $configline=~/^\#/) { next; }
- chomp($configline);
- my ($short,$plain)=split(/:/,$configline);
- my (undef,$name,$type)=split(/\&/,$short,3);
- if ($type eq 'display') {
- $standard_parms{$name} = $plain;
- }
+ if ($configline !~ /\S/ || $configline=~/^\#/) { next; }
+ chomp($configline);
+ my ($short,$plain)=split(/:/,$configline);
+ my (undef,$name,$type)=split(/\&/,$short,3);
+ if ($type eq 'display') {
+ $standard_parms{$name} = $plain;
+ } elsif ($type eq 'type') {
+ $standard_parms_types{$name} = $plain;
+ }
}
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 {
my ($name)=@_;
if (!%standard_parms) {
- &load_parameter_names();
+ &load_parameter_names();
}
if ($standard_parms{$name}) {
- return $standard_parms{$name};
+ return $standard_parms{$name};
} else {
- return $name;
+ return $name;
}
}
-
+sub standard_parameter_types {
+ my ($name)=@_;
+ if (!%standard_parms_types) {
+ &load_parameter_names();
+ }
+ if ($standard_parms_types{$name}) {
+ return $standard_parms_types{$name};
+ }
+ return;
+}
sub parm_change_log {
my ($r)=@_;
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=settable',
- text=>"Parameter Change Log"});
+ text=>"Parameter Change Log"});
$r->print(&Apache::loncommon::start_page('Parameter Change Log'));
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Parameter Change Log'));
-
+ &startSettingsScreen($r,'parmset');
my %parmlog=&Apache::lonnet::dump('nohist_parameterlog',
- $env{'course.'.$env{'request.course.id'}.'.domain'},
- $env{'course.'.$env{'request.course.id'}.'.num'});
+ $env{'course.'.$env{'request.course.id'}.'.domain'},
+ $env{'course.'.$env{'request.course.id'}.'.num'});
if ((keys(%parmlog))[0]=~/^error\:/) { undef(%parmlog); }
@@ -3905,139 +4306,158 @@ sub parm_change_log {
\%saveable_parameters);
$r->print(&Apache::loncommon::display_filter().
''.&Apache::lonhtmlcommon::checkbox('includetypes',$env{'form.includetypes'},'1').
- ' '.&mt('Include parameter types').' '.
- ' ');
+ ' '.&mt('Include parameter types').''.
+ ' ');
my $courseopt=&Apache::lonnet::get_courseresdata($env{'course.'.$env{'request.course.id'}.'.num'},
- $env{'course.'.$env{'request.course.id'}.'.domain'});
+ $env{'course.'.$env{'request.course.id'}.'.domain'});
$r->print(&Apache::loncommon::start_data_table().&Apache::loncommon::start_data_table_header_row().
- ''.&mt('Time').' '.&mt('User').' '.&mt('Extent').' '.&mt('Users').' '.
- &mt('Parameter').' '.&mt('Part').' '.&mt('New Value').' '.&mt('Announce').' '.
- &Apache::loncommon::end_data_table_header_row());
+ ''.&mt('Time').' '.&mt('User').' '.&mt('Extent').' '.&mt('Users').' '.
+ &mt('Parameter').' '.&mt('Part').' '.&mt('New Value').' '.&mt('Announce').' '.
+ &Apache::loncommon::end_data_table_header_row());
my $shown=0;
my $folder='';
if ($env{'form.displayfilter'} eq 'currentfolder') {
- my $last='';
- if (tie(my %hash,'GDBM_File',$env{'request.course.fn'}.'_symb.db',
- &GDBM_READER(),0640)) {
- $last=$hash{'last_known'};
- untie(%hash);
- }
- if ($last) { ($folder) = &Apache::lonnet::decode_symb($last); }
+ my $last='';
+ if (tie(my %hash,'GDBM_File',$env{'request.course.fn'}.'_symb.db',
+ &GDBM_READER(),0640)) {
+ $last=$hash{'last_known'};
+ untie(%hash);
+ }
+ if ($last) { ($folder) = &Apache::lonnet::decode_symb($last); }
}
foreach my $id (sort
- {
- if ($parmlog{$b}{'exe_time'} ne $parmlog{$a}{'exe_time'}) {
- return $parmlog{$b}{'exe_time'} <=>$parmlog{$a}{'exe_time'}
- }
- my $aid = (split('00000',$a))[-1];
- my $bid = (split('00000',$b))[-1];
- return $bid<=>$aid;
- } (keys(%parmlog))) {
+ {
+ if ($parmlog{$b}{'exe_time'} ne $parmlog{$a}{'exe_time'}) {
+ return $parmlog{$b}{'exe_time'} <=>$parmlog{$a}{'exe_time'}
+ }
+ my $aid = (split('00000',$a))[-1];
+ my $bid = (split('00000',$b))[-1];
+ return $bid<=>$aid;
+ } (keys(%parmlog))) {
my @changes=keys(%{$parmlog{$id}{'logentry'}});
- my $count = 0;
- my $time =
- &Apache::lonlocal::locallocaltime($parmlog{$id}{'exe_time'});
- my $plainname =
- &Apache::loncommon::plainname($parmlog{$id}{'exe_uname'},
- $parmlog{$id}{'exe_udom'});
- my $about_me_link =
- &Apache::loncommon::aboutmewrapper($plainname,
- $parmlog{$id}{'exe_uname'},
- $parmlog{$id}{'exe_udom'});
- my $send_msg_link='';
- if ((($parmlog{$id}{'exe_uname'} ne $env{'user.name'})
- || ($parmlog{$id}{'exe_udom'} ne $env{'user.domain'}))) {
- $send_msg_link =' '.
- &Apache::loncommon::messagewrapper(&mt('Send message'),
- $parmlog{$id}{'exe_uname'},
- $parmlog{$id}{'exe_udom'});
- }
- my $row_start=&Apache::loncommon::start_data_table_row();
- my $makenewrow=0;
- my %istype=();
- my $output;
- foreach my $changed (reverse(sort(@changes))) {
+ my $count = 0;
+ my $time =
+ &Apache::lonlocal::locallocaltime($parmlog{$id}{'exe_time'});
+ my $plainname =
+ &Apache::loncommon::plainname($parmlog{$id}{'exe_uname'},
+ $parmlog{$id}{'exe_udom'});
+ my $about_me_link =
+ &Apache::loncommon::aboutmewrapper($plainname,
+ $parmlog{$id}{'exe_uname'},
+ $parmlog{$id}{'exe_udom'});
+ my $send_msg_link='';
+ if ((($parmlog{$id}{'exe_uname'} ne $env{'user.name'})
+ || ($parmlog{$id}{'exe_udom'} ne $env{'user.domain'}))) {
+ $send_msg_link =' '.
+ &Apache::loncommon::messagewrapper(&mt('Send message'),
+ $parmlog{$id}{'exe_uname'},
+ $parmlog{$id}{'exe_udom'});
+ }
+ my $row_start=&Apache::loncommon::start_data_table_row();
+ my $makenewrow=0;
+ my %istype=();
+ my $output;
+ foreach my $changed (reverse(sort(@changes))) {
my $value=$parmlog{$id}{'logentry'}{$changed};
- my $typeflag = ($changed =~/\.type$/ &&
- !exists($parmlog{$id}{'logentry'}{$changed.'.type'}));
+ my $typeflag = ($changed =~/\.type$/ &&
+ !exists($parmlog{$id}{'logentry'}{$changed.'.type'}));
my ($realm,$section,$parmname,$part,$what,$middle,$uname,$udom,$issection,$realmdescription)=
- &components($changed,$parmlog{$id}{'uname'},$parmlog{$id}{'udom'},undef,undef,$typeflag);
- if ($env{'form.displayfilter'} eq 'currentfolder') {
- if ($folder) {
- if ($middle!~/^\Q$folder\E/) { next; }
- }
- }
- if ($typeflag) {
- $istype{$parmname}=$value;
- if (!$env{'form.includetypes'}) { next; }
- }
- $count++;
- if ($makenewrow) {
- $output .= $row_start;
- } else {
- $makenewrow=1;
- }
- $output .=''.$realm.' '.$section.' '.
- &standard_parameter_names($parmname).' '.
- ($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));
- } else {
- my ($level,@all)=&parmval_by_symb($what,$middle,&Apache::lonnet::metadata($middle,$what),
- $uname,$udom,$issection,$issection,$courseopt);
- if (&isdateparm($istype{$parmname})) {
- $output .= &Apache::lonlocal::locallocaltime($value);
- } else {
- $output .= $value;
- }
- if ($value ne $all[$level]) {
- $output .= ''.&mt('Not active anymore').' ';
- } else {
- $stillactive=1;
- }
- }
- }
- $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,
- (&isdateparm($istype{$parmname})?&Apache::lonlocal::locallocaltime($value):$value));
- if (($uname) && ($udom)) {
- $output .=
- &Apache::loncommon::messagewrapper('Notify User',
- $uname,$udom,$title,
- $description);
- } else {
- $output .=
- &Apache::lonrss::course_blog_link($id,$title,
- $description);
- }
- }
- $output .= ' '.&Apache::loncommon::end_data_table_row();
- }
+ &components($changed,$parmlog{$id}{'uname'},$parmlog{$id}{'udom'},undef,undef,$typeflag);
+ if ($env{'form.displayfilter'} eq 'currentfolder') {
+ if ($folder) {
+ if ($middle!~/^\Q$folder\E/) { next; }
+ }
+ }
+ if ($typeflag) {
+ $istype{$parmname}=$value;
+ if (!$env{'form.includetypes'}) { next; }
+ }
+ $count++;
+ if ($makenewrow) {
+ $output .= $row_start;
+ } else {
+ $makenewrow=1;
+ }
+ my $parmitem = &standard_parameter_names($parmname);
+ $output .=''.$realm.' '.$section.' '.
+ &mt($parmitem).' '.
+ ($part?&mt('Part: [_1]',$part):&mt('All Parts')).' ';
+ my $stillactive=0;
+ if ($parmlog{$id}{'delflag'}) {
+ $output .= &mt('Deleted');
+ } else {
+ if ($typeflag) {
+ 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);
+ my $showvalue = $value;
+ if ($istype{$parmname} eq '') {
+ my $type = &standard_parameter_types($parmname);
+ if ($type ne '') {
+ if (&isdateparm($type)) {
+ $showvalue =
+ &Apache::lonlocal::locallocaltime($value);
+ }
+ }
+ } else {
+ if (&isdateparm($istype{$parmname})) {
+ $showvalue =
+ &Apache::lonlocal::locallocaltime($value);
+ }
+ }
+ $output .= $showvalue;
+ if ($value ne $all[$level]) {
+ $output .= ''.&mt('Not active anymore').' ';
+ } else {
+ $stillactive=1;
+ }
+ }
+ }
+ $output .= ' ';
+
+ if ($stillactive) {
+ 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 .=
+ &Apache::loncommon::messagewrapper('Notify User',
+ $uname,$udom,$title,
+ $description);
+ } else {
+ $output .=
+ &Apache::lonrss::course_blog_link($id,$title,
+ $description);
+ }
+ }
+ $output .= ' '.&Apache::loncommon::end_data_table_row();
+ }
if ($env{'form.displayfilter'} eq 'containing') {
- my $wholeentry=$about_me_link.':'.
- $parmlog{$id}{'exe_uname'}.':'.$parmlog{$id}{'exe_udom'}.':'.
- $output;
- if ($wholeentry!~/\Q$env{'form.containingphrase'}\E/i) { next; }
- }
+ my $wholeentry=$about_me_link.':'.
+ $parmlog{$id}{'exe_uname'}.':'.$parmlog{$id}{'exe_udom'}.':'.
+ $output;
+ if ($wholeentry!~/\Q$env{'form.containingphrase'}\E/i) { next; }
+ }
if ($count) {
- $r->print($row_start.''.$time.'
+ $r->print($row_start.''.$time.'
'.$about_me_link.
- ''.$parmlog{$id}{'exe_uname'}.
- ':'.$parmlog{$id}{'exe_udom'}.' '.
- $send_msg_link.' '.$output);
- $shown++;
- }
- if (!($env{'form.show'} eq &mt('all')
- || $shown<=$env{'form.show'})) { last; }
+ ''.$parmlog{$id}{'exe_uname'}.
+ ':'.$parmlog{$id}{'exe_udom'}.' '.
+ $send_msg_link.' '.$output);
+ $shown++;
+ }
+ if (!($env{'form.show'} eq &mt('all')
+ || $shown<=$env{'form.show'})) { last; }
}
$r->print(&Apache::loncommon::end_data_table());
+ &endSettingsScreen($r);
$r->print(&Apache::loncommon::end_page());
}
@@ -4135,6 +4555,49 @@ sub check_for_course_info {
return 0;
}
+sub questiontype_release_vars {
+ my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
+ my $chome = $env{'course.'.$env{'request.course.id'}.'.home'};
+ my $chostname = &Apache::lonnet::hostname($chome);
+ my ($cmajor,$cminor) =
+ split(/\./,&Apache::lonnet::get_server_loncaparev($cdom,$chome));
+ return ($chostname,$cmajor,$cminor);
+}
+
+sub questiontype_releasecheck {
+ my ($questiontype,$needsrelease,$chostname,$cmajor,$cminor) = @_;
+ my $needsnewer;
+ my ($needsmajor,$needsminor) = split(/\./,$needsrelease);
+ if (($cmajor < $needsmajor) ||
+ ($cmajor == $needsmajor && $cminor < $needsminor)) {
+ $needsnewer = 1;
+ } else {
+ &Apache::lonnet::update_released_required($Apache::lonnet::needsrelease{'parameter:type:'.$questiontype});
+ }
+ return $needsnewer;
+}
+
+sub oldversion_warning {
+ my ($questiontype,$chostname,$cmajor,$cminor,$needsrelease) = @_;
+ my $desc;
+ if (ref($strings{'string_questiontype'}) eq 'ARRAY') {
+ foreach my $possibilities (@{ $strings{'string_questiontype'} }) {
+ next unless (ref($possibilities) eq 'ARRAY');
+ my ($name, $description) = @{ $possibilities };
+ if ($name eq $questiontype) {
+ $desc = $description;
+ last;
+ }
+ }
+ }
+ return ''.
+ &mt('Question Type was [_1]not[_2] set to [_3].',
+ '',' ','"'.$desc.'"').' '.
+ &mt('LON-CAPA version ([_1]) installed on home server ([_2]) does not meet version requirements ([_3] or newer).',
+ $cmajor.'.'.$cminor,$chostname,
+ $needsrelease).
+ '
';
+}
sub handler {
my $r=shift;
@@ -4146,26 +4609,27 @@ sub handler {
return OK if $r->header_only;
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
- ['action','state',
+ ['action','state',
'pres_marker',
'pres_value',
'pres_type',
+ 'filter','part',
'udom','uname','symb','serial','timebase']);
&Apache::lonhtmlcommon::clear_breadcrumbs();
&Apache::lonhtmlcommon::add_breadcrumb({href=>"/adm/parmset",
- text=>"Parameter Manager",
- faq=>10,
- bug=>'Instructor Interface',
+ text=>"Content and Problem Settings",
+ faq=>10,
+ bug=>'Instructor Interface',
help =>
'Parameter_Manager,Course_Environment,Parameter_Helper,Parameter_Overview,Table_Mode'});
# ----------------------------------------------------- Needs to be in a course
my $parm_permission =
- (&Apache::lonnet::allowed('opa',$env{'request.course.id'}) ||
- &Apache::lonnet::allowed('opa',$env{'request.course.id'}.'/'.
- $env{'request.course.sec'}));
+ (&Apache::lonnet::allowed('opa',$env{'request.course.id'}) ||
+ &Apache::lonnet::allowed('opa',$env{'request.course.id'}.'/'.
+ $env{'request.course.sec'}));
my $exists = &check_for_course_info();
if ($env{'request.course.id'} && $parm_permission && $exists) {
@@ -4175,45 +4639,43 @@ sub handler {
# Check first if coming from someone else headed directly for
# the table mode
if ((($env{'form.command'} eq 'set') && ($env{'form.url'})
- && (!$env{'form.dis'})) || ($env{'form.symb'})) {
- &assessparms($r);
+ && (!$env{'form.dis'})) || ($env{'form.symb'})) {
+ &assessparms($r);
} elsif (! exists($env{'form.action'})) {
&print_main_menu($r,$parm_permission);
} elsif ($env{'form.action'} eq 'setoverview') {
- &overview($r);
- } elsif ($env{'form.action'} eq 'addmetadata') {
- &addmetafield($r);
- } elsif ($env{'form.action'} eq 'ordermetadata') {
- &order_meta_fields($r);
+ &overview($r);
+ } elsif ($env{'form.action'} eq 'addmetadata') {
+ &addmetafield($r);
+ } elsif ($env{'form.action'} eq 'ordermetadata') {
+ &order_meta_fields($r);
} elsif ($env{'form.action'} eq 'setrestrictmeta') {
- &setrestrictmeta($r);
+ &setrestrictmeta($r);
} elsif ($env{'form.action'} eq 'newoverview') {
- &newoverview($r);
+ &newoverview($r);
} elsif ($env{'form.action'} eq 'setdefaults') {
- &defaultsetter($r);
- } elsif ($env{'form.action'} eq 'settable') {
- &assessparms($r);
+ &defaultsetter($r);
+ } elsif ($env{'form.action'} eq 'settable') {
+ &assessparms($r);
} elsif ($env{'form.action'} eq 'parameterchangelog') {
- &parm_change_log($r);
+ &parm_change_log($r);
} elsif ($env{'form.action'} eq 'cleanparameters') {
- &clean_parameters($r);
+ &clean_parameters($r);
} elsif ($env{'form.action'} eq 'dateshift1') {
&date_shift_one($r);
} elsif ($env{'form.action'} eq 'dateshift2') {
&date_shift_two($r);
- } elsif ($env{'form.action'} eq 'categorizecourse') {
- &assign_course_categories($r);
}
} else {
# ----------------------------- Not in a course, or not allowed to modify parms
- if ($exists) {
- $env{'user.error.msg'}=
- "/adm/parmset:opa:0:0:Cannot modify assessment parameters";
- } else {
- $env{'user.error.msg'}=
- "/adm/parmset::0:1:Course environment gone, reinitialize the course";
- }
- return HTTP_NOT_ACCEPTABLE;
+ if ($exists) {
+ $env{'user.error.msg'}=
+ "/adm/parmset:opa:0:0:Cannot modify assessment parameters";
+ } else {
+ $env{'user.error.msg'}=
+ "/adm/parmset::0:1:Course environment gone, reinitialize the course";
+ }
+ return HTTP_NOT_ACCEPTABLE;
}
&reset_caches();