');
+}
+
+
+
sub parmval {
my ($what,$id,$def,$uname,$udom,$csec,$cgroup,$courseopt)=@_;
return &parmval_by_symb($what,&symbcache($id),$def,$uname,$udom,$csec,
@@ -767,17 +791,7 @@ sub valout {
}
} else {
if ($type eq 'date_interval') {
- my ($totalsecs,$donesuffix) = split(/_/,$value,2);
- my ($usesdone,$donebuttontext,$proctor,$secretkey);
- if ($donesuffix =~ /^done\:([^\:]+)\:(.*)$/) {
- $donebuttontext = $1;
- (undef,$proctor,$secretkey) = split(/_/,$2);
- $usesdone = 'done';
- } elsif ($donesuffix =~ /^done(|_.+)$/) {
- $donebuttontext = &mt('Done');
- ($usesdone,$proctor,$secretkey) = split(/_/,$donesuffix);
- }
- my ($sec,$min,$hour,$mday,$mon,$year)=gmtime($totalsecs);
+ my ($sec,$min,$hour,$mday,$mon,$year)=gmtime($value);
my @timer;
$year=$year-70;
$mday--;
@@ -810,13 +824,6 @@ sub valout {
push(@timer,&mt('[quant,_1,sec]',0));
}
$result.=join(", ",@timer);
- if ($usesdone eq 'done') {
- if ($secretkey) {
- $result .= ' '.&mt('+ "[_1]" with proctor key: [_2]',$donebuttontext,$secretkey);
- } else {
- $result .= ' + "'.$donebuttontext.'"';
- }
- }
} elsif (&isdateparm($type)) {
$result = &Apache::lonlocal::locallocaltime($value).
&date_sanity_info($value);
@@ -834,12 +841,8 @@ sub plink {
my ($type,$dis,$value,$marker,$return,$call)=@_;
my $winvalue=$value;
unless ($winvalue) {
- if ((&isdateparm($type)) || (&is_specialstring($type))) {
+ if (&isdateparm($type)) {
$winvalue=$env{'form.recent_'.$type};
- } elsif ($type eq 'string_yesno') {
- if ($env{'form.recent_string'} =~ /^(yes|no)$/i) {
- $winvalue=$env{'form.recent_string'};
- }
} else {
$winvalue=$env{'form.recent_'.(split(/\_/,$type))[0]};
}
@@ -872,22 +875,20 @@ sub page_js {
$pjump_def
function psub() {
- var specstring = /^string_!(yesno|any)/i;
if (document.parmform.pres_marker.value!='') {
document.parmform.action+='#'+document.parmform.pres_marker.value;
var typedef=new Array();
typedef=document.parmform.pres_type.value.split('_');
- if (document.parmform.pres_type.value!='') {
- if ((typedef[0]=='date') ||
- (specstring.test(document.parmform.pres_type.value))) {
- eval('document.parmform.recent_'+
- document.parmform.pres_type.value+
- '.value=document.parmform.pres_value.value;');
- } else {
- eval('document.parmform.recent_'+typedef[0]+
- '.value=document.parmform.pres_value.value;');
- }
+ if (document.parmform.pres_type.value!='') {
+ if (typedef[0]=='date') {
+ eval('document.parmform.recent_'+
+ document.parmform.pres_type.value+
+ '.value=document.parmform.pres_value.value;');
+ } else {
+ eval('document.parmform.recent_'+typedef[0]+
+ '.value=document.parmform.pres_value.value;');
}
+ }
document.parmform.submit();
} else {
document.parmform.pres_value.value='';
@@ -902,7 +903,9 @@ sub page_js {
var newWin = window.open(url, wdwName, options);
newWin.focus();
}
+
// ]]>
+
$selscript
ENDJS
@@ -929,35 +932,126 @@ function showHide_courseContent() {
COURSECONTENTSCRIPT
}
+sub toggleparmtextbox_js {
+ return <<"ENDSCRIPT";
+
+if (!document.getElementsByClassName) {
+ function getElementsByClassName(node, classname) {
+ var a = [];
+ var re = new RegExp('(^| )'+classname+'( |$)');
+ var els = node.getElementsByTagName("*");
+ for(var i=0,j=els.length; i "group_or_section('cgroup')",
@@ -1048,13 +1116,14 @@ sub startpage {
';
my $start_page =
- &Apache::loncommon::start_page('Set/Modify Course Parameters',$js,
- {'add_entries' => \%loaditems,});
+ &Apache::loncommon::start_page('Set/Modify Course Parameters',$js,
+ {'add_entries' => \%loaditems,});
my $breadcrumbs =
&Apache::lonhtmlcommon::breadcrumbs('Table Mode Parameter Setting','Table_Mode');
my $escfilter=&Apache::lonhtmlcommon::entity_encode($env{'form.filter'});
my $escpart=&Apache::lonhtmlcommon::entity_encode($env{'form.part'});
$r->print($start_page.$breadcrumbs);
+ &startSettingsScreen($r,'parmset',$crstype);
$r->print(<
@@ -1069,8 +1138,7 @@ ENDHEAD
sub print_row {
my ($r,$which,$part,$name,$symbp,$rid,$default,$defaulttype,$display,$defbgone,
- $defbgtwo,$defbgthree,$parmlev,$uname,$udom,$csec,$cgroup,$usersgroups,$noeditgrp,
- $readonly)=@_;
+ $defbgtwo,$defbgthree,$parmlev,$uname,$udom,$csec,$cgroup,$usersgroups)=@_;
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
my $courseopt=&Apache::lonnet::get_courseresdata($cnum,$cdom);
@@ -1113,33 +1181,32 @@ sub print_row {
my ($othergrp,$grp_parm,$controlgrp);
if ($parmlev eq 'general') {
-
if ($uname) {
- &print_td($r,3,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly);
+ &print_td($r,3,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
} elsif ($cgroup) {
- &print_td($r,6,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,$noeditgrp,$readonly);
+ &print_td($r,6,$defbgthree,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
} elsif ($csec) {
- &print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly);
+ &print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
} else {
- &print_td($r,14,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly);
+ &print_td($r,14,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
}
} elsif ($parmlev eq 'map') {
if ($uname) {
- &print_td($r,2,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly);
+ &print_td($r,2,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
} elsif ($cgroup) {
- &print_td($r,5,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,$noeditgrp,$readonly);
+ &print_td($r,5,$defbgthree,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
} elsif ($csec) {
- &print_td($r,8,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly);
+ &print_td($r,8,$defbgtwo,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
} else {
- &print_td($r,13,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly);
+ &print_td($r,13,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
}
} else {
if ($uname) {
if (@{$usersgroups} > 1) {
my ($coursereply,$grp_parm,$controlgrp);
($coursereply,$othergrp,$grp_parm,$controlgrp) =
- &check_other_groups($$part{$which}.'.'.$$name{$which},
+ &print_usergroups($r,$$part{$which}.'.'.$$name{$which},
$rid,$cgroup,$defbgone,$usersgroups,$result,$courseopt);
if ($coursereply && $result > 3) {
if (defined($controlgrp)) {
@@ -1152,33 +1219,32 @@ sub print_row {
}
}
- &print_td($r,14,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly);
-
- &print_td($r,13,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly);
- &print_td($r,12,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly);
- &print_td($r,11,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly);
- &print_td($r,10,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly);
-
- if ($csec) {
- &print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly);
- &print_td($r,8,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly);
- &print_td($r,7,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly);
- }
+ &print_td($r,14,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
+ &print_td($r,13,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
+ &print_td($r,12,'#FFDDDD',$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
+ &print_td($r,11,'#FFDDDD',$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
+ &print_td($r,10,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
+
+ if ($csec) {
+ &print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
+ &print_td($r,8,$defbgtwo,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
+ &print_td($r,7,$defbgtwo,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
+ }
if ($cgroup) {
- &print_td($r,6,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,$noeditgrp,$readonly);
- &print_td($r,5,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,$noeditgrp,$readonly);
- &print_td($r,4,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,$noeditgrp,$readonly);
+ &print_td($r,6,$defbgthree,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
+ &print_td($r,5,$defbgthree,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
+ &print_td($r,4,$defbgthree,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
}
- if ($uname) {
+ if ($uname) {
if ($othergrp) {
$r->print($othergrp);
}
- &print_td($r,3,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly);
- &print_td($r,2,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly);
- &print_td($r,1,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display,'',$readonly);
- }
+ &print_td($r,3,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
+ &print_td($r,2,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
+ &print_td($r,1,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
+ }
} # end of $parmlev if/else
$r->print('
'.$effective_parm.'
');
@@ -1197,27 +1263,21 @@ sub print_row {
}
sub print_td {
- my ($r,$which,$defbg,$result,$outpar,$mprefix,$value,$typeoutpar,$display,$noeditgrp,$readonly)=@_;
+ my ($r,$which,$defbg,$result,$outpar,$mprefix,$value,$typeoutpar,$display)=@_;
$r->print('
'."\n");
}
-sub check_other_groups {
- my ($what,$rid,$cgroup,$defbg,$usersgroups,$result,$courseopt) = @_;
+sub print_usergroups {
+ my ($r,$what,$rid,$cgroup,$defbg,$usersgroups,$result,$courseopt) = @_;
my $courseid = $env{'request.course.id'};
my $output;
my $symb = &symbcache($rid);
@@ -1246,6 +1306,7 @@ sub check_other_groups {
if (($coursereply) && ($cgroup ne $resultgroup)) {
if ($result > 3) {
$bgcolor = '#AAFFAA';
+ $grp_parm = &valout($coursereply,$resulttype);
}
$grp_parm = &valout($coursereply,$resulttype);
$output = '
';
@@ -1391,21 +1452,14 @@ sub isdateparm {
return (($type=~/^date/) && (!($type eq 'date_interval')));
}
-# Determine if parameter type is specialized string type (i.e.,
-# not just string or string_yesno.
-
-sub is_specialstring {
- my $type=shift;
- return (($type=~/^string_/) && (($type ne 'string_yesno')));
-}
-
#
# parmmenu displays a list of the selected parameters.
# It also offers a link to show/hide the complete parameter list
# from which you can select all desired parameters.
#
sub parmmenu {
- my ($r)=@_;
+ my ($r,$allparms,$pscat,$keyorder)=@_;
+ my $tempkey;
$r->print(<
// print('');
- &shortCuts($r);
+ &shortCuts($r,$allparms,$pscat,$keyorder);
$r->print('');
}
# return a hash
@@ -1548,8 +1602,8 @@ sub lookUpTableParameter {
'lenient' => 'grading',
'retrypartial' => 'tries',
'discussvote' => 'misc',
- 'examcode' => 'high_level_randomization',
- );
+ 'examcode' => 'high_level_randomization',
+ );
}
sub whatIsMyCategory {
@@ -1600,9 +1654,7 @@ sub category_order {
sub parmboxes {
my ($r,$allparms,$pscat,$keyorder)=@_;
- my $tempkey;
- my $tempparameter;
- my %categories = &categories;
+ my %categories = &categories();
my %category_order = &category_order();
my %categoryList = (
'time_settings' => [],
@@ -1617,41 +1669,35 @@ sub parmboxes {
'misc' => [],
);
- foreach $tempparameter (keys %$allparms) {
+ foreach my $tempparameter (keys(%$allparms)) {
&whatIsMyCategory($tempparameter, \%categoryList);
}
#part to print the parm-list
- $r->print('
'."\n");
-
- #Print parameters
- for my $key (sort { $category_order{$a} <=> $category_order{$b} } keys %categoryList) {
- next if(@{$categoryList{$key}} == 0);
+ foreach my $key (sort { $category_order{$a} <=> $category_order{$b} } keys(%categoryList)) {
+ next if (@{$categoryList{$key}} == 0);
+ next if ($key eq '');
$r->print('
'
- .'
'
- .&mt($categories{$key})
- .'
'."\n");
- foreach $tempkey (&keysindisplayorderCategory($categoryList{$key},$keyorder)) {
- next if ($tempkey eq '');
+ .'
');
+ &endSettingsScreen($r);
$r->print(&Apache::loncommon::end_page());
}
@@ -4246,24 +4174,14 @@ 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 $sec = $env{'request.course.sec'};
+ my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'};
+
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=dateshift1&timebase='.$env{'form.timebase'},
text=>"Shifting Dates"});
- my $submit_text = &mt('Shift all dates accordingly');
- if ($sec ne '') {
- my @groups;
- if ($env{'request.course.groups'} ne '') {
- @groups = split(/:/,$env{'request.course.groups'});
- }
- if (@groups) {
- $submit_text = &mt("Shift dates set just for your section/group(s), accordingly");
- } else {
- $submit_text = &mt("Shift dates set just for your section, accordingly");
- }
- }
my $start_page=&Apache::loncommon::start_page('Shift Dates');
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Shift');
$r->print($start_page.$breadcrumbs);
+ &startSettingsScreen($r,'parmset',$crstype);
$r->print('');
+ '');
+ &endSettingsScreen($r);
$r->print(&Apache::loncommon::end_page());
}
@@ -4283,57 +4202,26 @@ 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 $sec = $env{'request.course.sec'};
+ my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'};
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=dateshift1&timebase='.$env{'form.timebase'},
text=>"Shifting Dates"});
my $start_page=&Apache::loncommon::start_page('Shift Dates');
my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Shift');
$r->print($start_page.$breadcrumbs);
+ &startSettingsScreen($r,'parmset',$crstype);
my $timeshifted=&Apache::lonhtmlcommon::get_date_from_form('timeshifted');
- $r->print('
'.&mt('Shift Dates').'
');
- if ($sec ne '') {
- my @groups;
- if ($env{'request.course.groups'} ne '') {
- @groups = split(/:/,$env{'request.course.groups'});
- }
- if (@groups) {
- $r->print('
'.
- &mt("Shift dates set just for your section/group(s), such that [_1] becomes [_2]",
- &Apache::lonlocal::locallocaltime($env{'form.timebase'}),
- &Apache::lonlocal::locallocaltime($timeshifted)).
- '
');
- } else {
- $r->print('
'.
- &mt("Shift dates set just for your section, such that [_1] becomes [_2]",
- &Apache::lonlocal::locallocaltime($env{'form.timebase'}),
- &Apache::lonlocal::locallocaltime($timeshifted)).
- '
');
- }
- } else {
- $r->print('
'.&mt('Shifting all dates such that [_1] becomes [_2]',
- &Apache::lonlocal::locallocaltime($env{'form.timebase'}),
- &Apache::lonlocal::locallocaltime($timeshifted)).
- '
');
- }
+ $r->print('
'.&mt('Shift Dates').'
'.
+ '
'.&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'};
- my $numchanges = 0;
- my $result = &dateshift($delta,\$numchanges);
- if ($result eq 'ok') {
- $r->print(
- &Apache::lonhtmlcommon::confirm_success(&mt('Completed shifting of [quant,_1,date setting]',
- $numchanges)));
- } elsif ($result eq 'con_delayed') {
- $r->print(
- &Apache::lonhtmlcommon::confirm_success(&mt('Queued shifting of [quant,_1,date setting]',
- $numchanges)));
- } else {
- $r->print(
- &Apache::lonhtmlcommon::confirm_success(&mt('An error occurred attempting to shift dates'),1));
- }
+ &dateshift($delta);
$r->print(
+ &Apache::lonhtmlcommon::confirm_success(&mt('Done')).
'
'.
&Apache::lonhtmlcommon::actionbox(
[''.&mt('Content and Problem Settings').'']));
+ &endSettingsScreen($r);
$r->print(&Apache::loncommon::end_page());
}
@@ -4349,7 +4237,8 @@ sub parse_key {
$data{'scope_type'} = 'user';
$data{'scope'} = [$1,$2];
} else {
- $data{'scope_type'} = 'secgroup';
+ #FIXME check for group scope
+ $data{'scope_type'} = 'section';
}
$middle=~s/^\[(.*)\]//;
}
@@ -4377,7 +4266,7 @@ sub parse_key {
sub header {
- return &Apache::loncommon::start_page('Content and Problem Settings');
+ return &Apache::loncommon::start_page('Settings');
}
@@ -4390,6 +4279,7 @@ sub print_main_menu {
my $crstype = &Apache::loncommon::course_type();
my $lc_crstype = lc($crstype);
+ &startSettingsScreen($r,'parmset',$crstype);
$r->print(<
@@ -4400,73 +4290,35 @@ ENDMAINFORMHEAD
my $vgr = &Apache::lonnet::allowed('vgr',$env{'request.course.id'});
my $mgr = &Apache::lonnet::allowed('mgr',$env{'request.course.id'});
my $dcm = &Apache::lonnet::allowed('dcm',$env{'request.course.id'});
- my $vcb = &Apache::lonnet::allowed('vcb',$env{'request.course.id'});
- my $vpa = &Apache::lonnet::allowed('vpa',$env{'request.course.id'});
if ((!$dcm) && ($env{'request.course.sec'} ne '')) {
$dcm = &Apache::lonnet::allowed('dcm',$env{'request.course.id'}.
'/'.$env{'request.course.sec'});
}
- if ((!$vcb) && ($env{'request.course.sec'} ne '')) {
- $vcb = &Apache::lonnet::allowed('vcb',$env{'request.course.id'}.
- '/'.$env{'request.course.sec'});
- }
- my (%linktext,%linktitle,%url);
- if ($parm_permission->{'edit'}) {
- %linktext = (
- newoverview => 'Edit Resource Parameters - Overview Mode',
- settable => 'Edit Resource Parameters - Table Mode',
- setoverview => 'Modify Resource Parameters - Overview Mode',
- );
- %linktitle = (
- newoverview => 'Set/Modify resource parameters in overview mode.',
- settable => 'Set/Modify resource parameters in table mode.',
- setoverview => 'Set/Modify existing resource parameters in overview mode.',
- );
- } else {
- %linktext = (
- newoverview => 'View Resource Parameters - Overview Mode',
- settable => 'View Resource Parameters - Table Mode',
- setoverview => 'View Resource Parameters - Overview Mode',
- );
- %linktitle = (
- newoverview => 'Display resource parameters in overview mode.',
- settable => 'Display resource parameters in table mode.',
- setoverview => 'Display existing resource parameters in overview mode.',
- );
- }
- if ($mgr) {
- $linktext{'resettimes'} = 'Reset Student Access Times';
- $linktitle{'resettimes'} = "Reset access times for folders/maps, resources or the $lc_crstype.";
- $url{'resettimes'} = '/adm/helper/resettimes.helper';
- } elsif ($vgr) {
- $linktext{'resettimes'} = 'Display Student Access Times',
- $linktitle{'resettimes'} = "Display access times for folders/maps, resources or the $lc_crstype.",
- $url{'resettimes'} = '/adm/accesstimes';
- }
+
my @menu =
( { categorytitle=>"Content Settings for this $crstype",
items => [
{ linktext => 'Portfolio Metadata',
url => '/adm/parmset?action=setrestrictmeta',
- permission => $parm_permission->{'setrestrictmeta'},
+ permission => $parm_permission,
linktitle => "Restrict metadata for this $lc_crstype." ,
icon =>'contact-new.png' ,
},
- { linktext => $linktext{'resettimes'},
- url => $url{'resettimes'},
- permission => ($vgr || $mgr),
- linktitle => $linktitle{'resettimes'},
- icon => 'start-here.png',
+ { linktext => 'Reset Student Access Times',
+ url => '/adm/helper/resettimes.helper',
+ permission => $mgr,
+ linktitle => "Reset access times for folders/maps, resources or the $lc_crstype." ,
+ icon => 'start-here.png' ,
},
{ linktext => 'Blocking Communication/Resource Access',
url => '/adm/setblock',
- permission => ($vcb || $dcm),
+ permission => $dcm,
linktitle => 'Configure blocking of communication/collaboration and access to resources during an exam',
icon => 'comblock.png',
},
{ linktext => 'Set Parameter Setting Default Actions',
url => '/adm/parmset?action=setdefaults',
- permission => $parm_permission->{'setdefaults'},
+ permission => $parm_permission,
linktitle =>'Set default actions for parameters.' ,
icon => 'folder-new.png' ,
}]},
@@ -4474,43 +4326,45 @@ ENDMAINFORMHEAD
items => [
{ linktext => 'Edit Resource Parameters - Helper Mode',
url => '/adm/helper/parameter.helper',
- permission => $parm_permission->{'helper'},
+ permission => $parm_permission,
linktitle =>'Set/Modify resource parameters in helper mode.' ,
icon => 'dialog-information.png' ,
#help => 'Parameter_Helper',
},
- { linktext => $linktext{'newoverview'},
+ { linktext => 'Edit Resource Parameters - Overview Mode',
url => '/adm/parmset?action=newoverview',
- permission => $parm_permission->{'newoverview'},
- linktitle => $linktitle{'newoverview'},
- icon => 'edit-find.png',
+ permission => $parm_permission,
+ linktitle =>'Set/Modify resource parameters in overview mode.' ,
+ icon => 'edit-find.png' ,
#help => 'Parameter_Overview',
},
- { linktext => $linktext{'settable'},
+ { linktext => 'Edit Resource Parameters - Table Mode',
url => '/adm/parmset?action=settable',
- permission => $parm_permission->{'settable'},
- linktitle => $linktitle{'settable'},
- icon => 'edit-copy.png',
+ permission => $parm_permission,
+ linktitle =>'Set/Modify resource parameters in table mode.' ,
+ icon => 'edit-copy.png' ,
#help => 'Table_Mode',
}]},
{ categorytitle => 'Existing Parameter Settings for Resources',
items => [
- { linktext => $linktext{'setoverview'},
+ { linktext => 'Modify Resource Parameters - Overview Mode',
url => '/adm/parmset?action=setoverview',
- permission => $parm_permission->{'setoverview'},
- linktitle => $linktitle{'setoverview'},
- icon => 'preferences-desktop-wallpaper.png',
+ permission => $parm_permission,
+ linktitle =>'Set/Modify existing resource parameters in overview mode.' ,
+ icon => 'preferences-desktop-wallpaper.png' ,
#help => 'Parameter_Overview',
},
{ linktext => 'Change Log',
url => '/adm/parmset?action=parameterchangelog',
- permission => $parm_permission->{'parameterchangelog'},
+ permission => $parm_permission,
linktitle =>"View parameter and $lc_crstype blog posting/user notification change log." ,
icon => 'document-properties.png',
}]}
);
$r->print(&Apache::lonhtmlcommon::generate_menu(@menu));
- $r->print(''.&Apache::loncommon::end_page());
+ $r->print('');
+ &endSettingsScreen($r);
+ $r->print(&Apache::loncommon::end_page());
return;
}
@@ -4578,6 +4432,7 @@ sub order_meta_fields {
my $idx = 1;
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
+ my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'};;
$r->print(&Apache::loncommon::start_page('Order Metadata Fields'));
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=addmetadata',
text=>"Add Metadata Field"});
@@ -4586,11 +4441,12 @@ sub order_meta_fields {
text=>"Restrict Metadata"},
{text=>"Order Metadata"});
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Order Metadata'));
+ &startSettingsScreen($r,'parmset',$crstype);
if ($env{'form.storeorder'}) {
my $newpos = $env{'form.newpos'} - 1;
my $currentpos = $env{'form.currentpos'} - 1;
my @neworder = ();
- my @oldorder = split /,/,$env{'course.'.$env{'request.course.id'}.'.metadata.addedorder'};
+ my @oldorder = split(/,/,$env{'course.'.$env{'request.course.id'}.'.metadata.addedorder'});
my $i;
if ($newpos > $currentpos) {
# moving stuff up
@@ -4624,10 +4480,10 @@ sub order_meta_fields {
}
my $fields = &get_added_meta_fieldnames($env{'request.course.id'});
my $ordered_fields;
- my @fields_in_order = split /,/,$env{'course.'.$env{'request.course.id'}.'.metadata.addedorder'};
+ my @fields_in_order = split(/,/,$env{'course.'.$env{'request.course.id'}.'.metadata.addedorder'});
if (!@fields_in_order) {
# no order found, pick sorted order then create metadata.addedorder key.
- foreach my $key (sort keys %$fields) {
+ foreach my $key (sort(keys(%$fields))) {
push @fields_in_order, $key;
$ordered_fields = join ",", @fields_in_order;
}
@@ -4655,6 +4511,7 @@ sub order_meta_fields {
$idx ++;
}
$r->print('');
+ &endSettingsScreen($r);
return 'ok';
}
@@ -4663,7 +4520,7 @@ sub continue {
my $output;
$output .= '');
}
- $r->print(''.
- &mt('[_1]Or[_2] you may enter a new metadata field name.',
- '','').
- '');
+ &endSettingsScreen($r);
}
@@ -4742,13 +4591,10 @@ sub setrestrictmeta {
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Restrict Metadata'));
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'};
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'};
+ my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'};
+ &startSettingsScreen($r,'parmset',$crstype);
my $key_base = $env{'course.'.$env{'request.course.id'}.'.'};
my $save_field = '';
- my %lt = &Apache::lonlocal::texthash(
- addm => 'Add Metadata Field',
- ordm => 'Order Metadata Fields',
- save => 'Save',
- );
if ($env{'form.restrictmeta'}) {
foreach my $field (sort(keys(%env))) {
if ($field=~m/^form.(.+)_(.+)$/) {
@@ -4787,25 +4633,28 @@ sub setrestrictmeta {
my %metadata_fields = &Apache::lonmeta::fieldnames('portfolio');
# Now get possible added metadata fields
my $added_metadata_fields = &get_added_meta_fieldnames($env{'request.course.id'});
+ my $row_alt = 1;
$output .= &Apache::loncommon::start_data_table();
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});
}
}
my $buttons = (<
+
');
- my $readonly = 1;
- if ($parm_permission->{'edit'}) {
- undef($readonly);
- }
- my $courseopt=&Apache::lonnet::get_courseresdata($env{'course.'.$env{'request.course.id'}.'.num'},
- $env{'course.'.$env{'request.course.id'}.'.domain'});
+
+ my $courseopt=&Apache::lonnet::get_courseresdata($cnum,$cdom);
$r->print(&Apache::loncommon::start_data_table().&Apache::loncommon::start_data_table_header_row().
'
'.
+ &Apache::loncommon::end_data_table_header_row());
my $shown=0;
my $folder='';
if ($env{'form.displayfilter'} eq 'currentfolder') {
@@ -5145,12 +4992,6 @@ sub parm_change_log {
}
if ($last) { ($folder) = &Apache::lonnet::decode_symb($last); }
}
- my $numgroups = 0;
- my @groups;
- if ($env{'request.course.groups'} ne '') {
- @groups = split(/:/,$env{'request.course.groups'});
- $numgroups = scalar(@groups);
- }
foreach my $id (sort
{
if ($parmlog{$b}{'exe_time'} ne $parmlog{$a}{'exe_time'}) {
@@ -5172,8 +5013,7 @@ sub parm_change_log {
$parmlog{$id}{'exe_uname'},
$parmlog{$id}{'exe_udom'});
my $send_msg_link='';
- if ((!$readonly) &&
- (($parmlog{$id}{'exe_uname'} ne $env{'user.name'})
+ 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'),
@@ -5191,11 +5031,10 @@ sub parm_change_log {
my ($realm,$section,$parmname,$part,$what,$middle,$uname,$udom,$issection,$realmdescription)=
&components($changed,$parmlog{$id}{'uname'},$parmlog{$id}{'udom'},undef,undef,$typeflag);
if ($env{'request.course.sec'} ne '') {
- next if (($issection ne '') && (!(($issection eq $env{'request.course.sec'}) ||
- ($numgroups && (grep(/^\Q$issection\E$/,@groups))))));
+ next if (($issection ne '') && ($issection ne $env{'request.course.sec'}));
if ($uname ne '') {
my $stusection = &Apache::lonnet::getsection($uname,$udom,$env{'request.course.id'});
- next if (($stusection ne '-1') && ($stusection ne $env{'request.course.sec'}));
+ next if (($stusection ne '-1') && ($stusection ne $env{'request.course.sec'}));
}
}
if ($env{'form.displayfilter'} eq 'currentfolder') {
@@ -5251,31 +5090,27 @@ sub parm_change_log {
}
}
}
- $output .= '';
-
- unless ($readonly) {
- $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 .= '