[LON-CAPA-cvs] cvs: loncom /auth roles.tab rolesplain.tab /interface lonblockingmenu.pm loncourserespicker.pm lonmenu.pm lonparmset.pm
raeburn
raeburn at source.lon-capa.org
Sun Oct 16 17:50:09 EDT 2016
raeburn Sun Oct 16 21:50:09 2016 EDT
Modified files:
/loncom/interface lonparmset.pm lonmenu.pm loncourserespicker.pm
lonblockingmenu.pm
/loncom/auth roles.tab rolesplain.tab
Log:
- vpa privilege in a course allows Content Settings to be displayed, but
not modified (which requires opa priv).
- vcb privilege in a course allows "Exam" Blocking items to be displayed,
but not modified (which requires dcm priv).
-------------- next part --------------
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.567 loncom/interface/lonparmset.pm:1.568
--- loncom/interface/lonparmset.pm:1.567 Sat Oct 15 14:02:43 2016
+++ loncom/interface/lonparmset.pm Sun Oct 16 21:49:51 2016
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set parameters for assessments
#
-# $Id: lonparmset.pm,v 1.567 2016/10/15 14:02:43 raeburn Exp $
+# $Id: lonparmset.pm,v 1.568 2016/10/16 21:49:51 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1380,9 +1380,11 @@
# @param {string} $cgroup - group name
# @param {array reference} $usersgroups - list of groups the user belongs to, if any
# @param {boolean} $noeditgrp - true if no edit is allowed for group level parameters
+# @param {boolean} $readonly - true if no editing allowed.
sub print_row {
my ($r,$which,$part,$name,$symbp,$rid,$default,$defaulttype,$display,$defbgone,
- $defbgtwo,$defbgthree,$parmlev,$uname,$udom,$csec,$cgroup,$usersgroups,$noeditgrp)=@_;
+ $defbgtwo,$defbgthree,$parmlev,$uname,$udom,$csec,$cgroup,$usersgroups,$noeditgrp,
+ $readonly)=@_;
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);
@@ -1427,27 +1429,27 @@
if ($parmlev eq 'general') {
if ($uname) {
- &print_td($r,4,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
+ &print_td($r,4,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly);
} elsif ($cgroup) {
- &print_td($r,8,$defbgthree,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,$noeditgrp);
+ &print_td($r,8,$defbgthree,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,$noeditgrp,$readonly);
} elsif ($csec) {
- &print_td($r,12,$defbgtwo,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
+ &print_td($r,12,$defbgtwo,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly);
} else {
- &print_td($r,18,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
+ &print_td($r,18,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly);
}
} elsif ($parmlev eq 'map') {
if ($uname) {
- &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,3,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly);
+ &print_td($r,2,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly);
} elsif ($cgroup) {
- &print_td($r,7,$defbgthree,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,$noeditgrp);
- &print_td($r,6,$defbgthree,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,$noeditgrp);
+ &print_td($r,7,$defbgthree,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,$noeditgrp,$readonly);
+ &print_td($r,6,$defbgthree,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,$noeditgrp,$readonly);
} elsif ($csec) {
- &print_td($r,11,$defbgtwo,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
- &print_td($r,10,$defbgtwo,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
+ &print_td($r,11,$defbgtwo,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly);
+ &print_td($r,10,$defbgtwo,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly);
} else {
- &print_td($r,17,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
- &print_td($r,16,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
+ &print_td($r,17,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly);
+ &print_td($r,16,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly);
}
} else {
if ($uname) {
@@ -1467,35 +1469,35 @@
}
}
- &print_td($r,18,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
- &print_td($r,17,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
- &print_td($r,16,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
- &print_td($r,15,'#FFDDDD',$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
- &print_td($r,14,'#FFDDDD',$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
- &print_td($r,13,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
+ &print_td($r,18,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly);
+ &print_td($r,17,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly);
+ &print_td($r,16,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly);
+ &print_td($r,15,'#FFDDDD',$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly);
+ &print_td($r,14,'#FFDDDD',$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly);
+ &print_td($r,13,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly);
if ($csec) {
- &print_td($r,12,$defbgtwo,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
- &print_td($r,11,$defbgtwo,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
- &print_td($r,10,$defbgtwo,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
- &print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
+ &print_td($r,12,$defbgtwo,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly);
+ &print_td($r,11,$defbgtwo,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly);
+ &print_td($r,10,$defbgtwo,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly);
+ &print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly);
}
if ($cgroup) {
- &print_td($r,8,$defbgthree,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,$noeditgrp);
- &print_td($r,7,$defbgthree,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,$noeditgrp);
- &print_td($r,6,$defbgthree,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,$noeditgrp);
- &print_td($r,5,$defbgthree,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,$noeditgrp);
+ &print_td($r,8,$defbgthree,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,$noeditgrp,'',$readonly);
+ &print_td($r,7,$defbgthree,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,$noeditgrp,'',$readonly);
+ &print_td($r,6,$defbgthree,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,$noeditgrp,'',$readonly);
+ &print_td($r,5,$defbgthree,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,$noeditgrp.'',$readonly);
}
if ($uname) {
if ($othergrp) {
$r->print($othergrp);
}
- &print_td($r,4,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display);
- &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);
+ &print_td($r,4,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly);
+ &print_td($r,3,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly);
+ &print_td($r,2,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly);
+ &print_td($r,1,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly);
}
} # end of $parmlev if/else
@@ -1532,26 +1534,31 @@
# @param {array reference} $typeoutpar - array level -> parameter type (when defined)
# @param {hash reference} $display - parameter key -> full title for the parameter
# @param {boolean} $noeditgrp - true if no edit is allowed for group level parameters
+# @param {boolean} $readonly -true if editing not allowed.
sub print_td {
- my ($r,$which,$defbg,$result,$outpar,$mprefix,$value,$typeoutpar,$display,$noeditgrp)=@_;
+ my ($r,$which,$defbg,$result,$outpar,$mprefix,$value,$typeoutpar,$display,$noeditgrp,$readonly)=@_;
$r->print('<td style="background-color:'.(($result==$which)?'#AAFFAA':$defbg).
';" align="center">');
my $nolink = 0;
- if ($which == 14 || $which == 15) {
- $nolink = 1;
- } elsif (($env{'request.course.sec'} ne '') && ($which > 12)) {
+ if ($readonly) {
$nolink = 1;
- } elsif ($which == 5 || $which == 6 || $which == 7 || $which == 8) {
- if ($noeditgrp) {
+ } else {
+ if ($which == 14 || $which == 15) {
$nolink = 1;
- }
- } elsif ($mprefix =~ /availablestudent\&$/) {
- if ($which > 4) {
- $nolink = 1;
- }
- } elsif ($mprefix =~ /examcode\&$/) {
- unless ($which == 2) {
+ } elsif (($env{'request.course.sec'} ne '') && ($which > 12)) {
$nolink = 1;
+ } elsif ($which == 5 || $which == 6 || $which == 7 || $which == 8) {
+ if ($noeditgrp) {
+ $nolink = 1;
+ }
+ } elsif ($mprefix =~ /availablestudent\&$/) {
+ if ($which > 4) {
+ $nolink = 1;
+ }
+ } elsif ($mprefix =~ /examcode\&$/) {
+ unless ($which == 2) {
+ $nolink = 1;
+ }
}
}
if ($nolink) {
@@ -2630,9 +2637,11 @@
# url - used only with command 'set', the resource url
#
# @param {Apache2::RequestRec} $r - the Apache request
+# @param $parm_permission - ref to hash of permissions
+# if $parm_permission->{'edit'} is true, editing is allowed.
sub assessparms {
- my $r=shift;
+ my ($r,$parm_permission) = @_;
# -------------------------------------------------------- Variable declaration
@@ -2803,7 +2812,7 @@
$symbp{'0.0'} = '';
# ---------------------------------------------------------- Anything to store?
- if ($env{'form.pres_marker'}) {
+ if ($env{'form.pres_marker'} && $parm_permission->{'edit'}) {
my @markers=split(/\&\&\&/,$env{'form.pres_marker'});
my @values=split(/\&\&\&/,$env{'form.pres_value'});
my @types=split(/\&\&\&/,$env{'form.pres_type'});
@@ -3096,6 +3105,10 @@
my @catmarker=map { tr|.|_|; 'parameter_'.$_; } @pscat;
my $csuname=$env{'user.name'};
my $csudom=$env{'user.domain'};
+ my $readonly = 1;
+ if ($parm_permission->{'edit'}) {
+ undef($readonly);
+ }
if ($parmlev eq 'full') {
#
@@ -3279,7 +3292,7 @@
&print_row($r,$item,\%part,\%name,\%symbp,$rid,\%default,
\%type,\%display,$defbgone,$defbgtwo,
$defbgthree,$parmlev,$uname,$udom,$csec,
- $cgroup,\@usersgroups,$noeditgrp);
+ $cgroup,\@usersgroups,$noeditgrp,$readonly);
}
}
}
@@ -3402,7 +3415,8 @@
$r->print(&Apache::loncommon::start_data_table_row());
&print_row($r,$item,\%part,\%name,\%symbp,$mapid,\%default,
\%type,\%display,$defbgone,$defbgtwo,$defbgthree,
- $parmlev,$uname,$udom,$csec,$cgroup,'',$noeditgrp);
+ $parmlev,$uname,$udom,$csec,$cgroup,'',$noeditgrp,
+ $readonly);
}
$r->print(&Apache::loncommon::end_data_table().'</p>'
.'</div>'
@@ -3491,8 +3505,9 @@
foreach my $item (&keysinorder(\%name,\%keyorder)) {
$r->print(&Apache::loncommon::start_data_table_row());
&print_row($r,$item,\%part,\%name,\%symbp,$mapid,\%default,
- \%type,\%display,$defbgone,$defbgtwo,$defbgthree,
- $parmlev,$uname,$udom,$csec,$cgroup,'',$noeditgrp);
+ \%type,\%display,$defbgone,$defbgtwo,$defbgthree,
+ $parmlev,$uname,$udom,$csec,$cgroup,'',$noeditgrp,
+ $readonly);
}
$r->print(&Apache::loncommon::end_data_table()
.'</p>'
@@ -3850,9 +3865,10 @@
# @param {string} $sortorder - realmstudent|studentrealm
# @param {string} $caller - name of the calling sub (overview|newoverview)
# @param {hash reference} $classlist - from loncoursedata::get_classlist
+# @param {boolean} $readonly - true if editing not allowed
# @returns{integer} - number of $listdata parameters processed
sub listdata {
- my ($r,$resourcedata,$listdata,$sortorder,$caller,$classlist)=@_;
+ my ($r,$resourcedata,$listdata,$sortorder,$caller,$classlist,$readonly)=@_;
# Start list output
@@ -3916,7 +3932,6 @@
} keys(%{$listdata})) { # foreach my $thiskey
- my $readonly;
if ($$listdata{$thiskey.'.type'}) {
my $thistype=$$listdata{$thiskey.'.type'};
if ($$resourcedata{$thiskey.'.type'}) {
@@ -4709,11 +4724,15 @@
#
# @param {Apache2::RequestRec} $r - the Apache request
sub newoverview {
- my ($r) = @_;
+ my ($r,$parm_permission) = @_;
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'};
+ my $readonly = 1;
+ if ($parm_permission->{'edit'}) {
+ undef($readonly);
+ }
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setoverview',
text=>"Overview Mode"});
@@ -4872,11 +4891,13 @@
# List data
- &listdata($r,$resourcedata,$listdata,$sortorder,'newoverview');
+ &listdata($r,$resourcedata,$listdata,$sortorder,'newoverview',undef,$readonly);
+ }
+ $r->print(&tableend());
+ unless ($readonly) {
+ $r->print( ((($env{'form.store'}) || ($env{'form.dis'}))?'<p><input type="submit" name="store" value="'.&mt('Save').'" /></p>':'') );
}
- $r->print(&tableend().
- ((($env{'form.store'}) || ($env{'form.dis'}))?'<p><input type="submit" name="store" value="'.&mt('Save').'" /></p>':'').
- '</form>');
+ $r->print('</form>');
&endSettingsScreen($r);
$r->print(&Apache::loncommon::end_page());
}
@@ -4938,10 +4959,14 @@
#
# @param {Apache2::RequestRec} $r - the Apache request
sub overview {
- my ($r) = @_;
+ my ($r,$parm_permission) = @_;
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'};
+ my $readonly = 1;
+ if ($parm_permission->{'edit'}) {
+ undef($readonly);
+ }
my $js = '<script type="text/javascript">'."\n".
'// <![CDATA['."\n".
&toggleparmtextbox_js()."\n".
@@ -4964,7 +4989,9 @@
# Store modified
- &storedata($r,$crs,$dom);
+ unless ($readonly) {
+ &storedata($r,$crs,$dom);
+ }
# Read modified data
@@ -4975,12 +5002,24 @@
unless ($sortorder) { $sortorder='realmstudent'; }
&sortmenu($r,$sortorder);
+ my $submitbutton = '<input type="submit" value="'.&mt('Save').'" />';
+
+ if ($readonly) {
+ $r->print('<p>'.$submitbutton.'</p>');
+ }
+
# List data
- my $foundkeys=&listdata($r,$resourcedata,$resourcedata,$sortorder,'overview',$classlist);
- $r->print(&tableend().'<p>'.
- ($foundkeys?'<input type="submit" value="'.&mt('Save').'" />':'<span class="LC_info">'.&mt('There are no parameters.').'</span>').'</p></form>'.
- &Apache::loncommon::end_page());
+ my $foundkeys=&listdata($r,$resourcedata,$resourcedata,$sortorder,'overview',$classlist,$readonly);
+ $r->print(&tableend().'<p>');
+ if ($foundkeys) {
+ unless ($readonly) {
+ $r->print('<p>'.$submitbutton.'</p>');
+ }
+ } else {
+ $r->print('<p class="LC_info">'.&mt('There are no parameters.').'</p>');
+ }
+ $r->print('</form>'.&Apache::loncommon::end_page());
}
# Unused sub.
@@ -5217,35 +5256,73 @@
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,
+ permission => $parm_permission->{'setrestrictmeta'},
linktitle => "Restrict metadata for this $lc_crstype." ,
icon =>'contact-new.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 => $linktext{'resettimes'},
+ url => $url{'resettimes'},
+ permission => ($vgr || $mgr),
+ linktitle => $linktitle{'resettimes'},
+ icon => 'start-here.png',
},
{ linktext => 'Blocking Communication/Resource Access',
url => '/adm/setblock',
- permission => $dcm,
+ permission => ($vcb || $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,
+ permission => $parm_permission->{'setdefaults'},
linktitle =>'Set default actions for parameters.' ,
icon => 'folder-new.png' ,
}]},
@@ -5253,37 +5330,37 @@
items => [
{ linktext => 'Edit Resource Parameters - Helper Mode',
url => '/adm/helper/parameter.helper',
- permission => $parm_permission,
+ permission => $parm_permission->{'helper'},
linktitle =>'Set/Modify resource parameters in helper mode.' ,
icon => 'dialog-information.png' ,
#help => 'Parameter_Helper',
},
- { linktext => 'Edit Resource Parameters - Overview Mode',
+ { linktext => $linktext{'newoverview'},
url => '/adm/parmset?action=newoverview',
- permission => $parm_permission,
- linktitle =>'Set/Modify resource parameters in overview mode.' ,
- icon => 'edit-find.png' ,
+ permission => $parm_permission->{'newoverview'},
+ linktitle => $linktitle{'newoverview'},
+ icon => 'edit-find.png',
#help => 'Parameter_Overview',
},
- { linktext => 'Edit Resource Parameters - Table Mode',
+ { linktext => $linktext{'settable'},
url => '/adm/parmset?action=settable',
- permission => $parm_permission,
- linktitle =>'Set/Modify resource parameters in table mode.' ,
- icon => 'edit-copy.png' ,
+ permission => $parm_permission->{'settable'},
+ linktitle => $linktitle{'settable'},
+ icon => 'edit-copy.png',
#help => 'Table_Mode',
}]},
{ categorytitle => 'Existing Parameter Settings for Resources',
items => [
- { linktext => 'Modify Resource Parameters - Overview Mode',
+ { linktext => $linktext{'setoverview'},,
url => '/adm/parmset?action=setoverview',
- permission => $parm_permission,
- linktitle =>'Set/Modify existing resource parameters in overview mode.' ,
- icon => 'preferences-desktop-wallpaper.png' ,
+ permission => $parm_permission->{'setoverview'},
+ linktitle => $linktitle{'setoverview'},
+ icon => 'preferences-desktop-wallpaper.png',
#help => 'Parameter_Overview',
},
{ linktext => 'Change Log',
url => '/adm/parmset?action=parameterchangelog',
- permission => $parm_permission,
+ permission => $parm_permission->{'parameterchangelog'},
linktitle =>"View parameter and $lc_crstype blog posting/user notification change log." ,
icon => 'document-properties.png',
}]}
@@ -5976,7 +6053,7 @@
#
# @param {Apache2::RequestRec} $r - the Apache request
sub parm_change_log {
- my ($r)=@_;
+ my ($r,$parm_permission)=@_;
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'};
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'}
@@ -6008,11 +6085,18 @@
'<input type="submit" value="'.&mt('Display').'" />'.
'</form></fieldset></div><br clear="all" />');
+ my $readonly = 1;
+ if ($parm_permission->{'edit'}) {
+ undef($readonly);
+ }
my $courseopt=&Apache::lonnet::get_courseresdata($cnum,$cdom);
$r->print(&Apache::loncommon::start_data_table().&Apache::loncommon::start_data_table_header_row().
'<th>'.&mt('Time').'</th><th>'.&mt('User').'</th><th>'.&mt('Extent').'</th><th>'.&mt('Users').'</th><th>'.
- &mt('Parameter').'</th><th>'.&mt('Part').'</th><th>'.&mt('New Value').'</th><th>'.&mt('Announce').'</th>'.
- &Apache::loncommon::end_data_table_header_row());
+ &mt('Parameter').'</th><th>'.&mt('Part').'</th><th>'.&mt('New Value').'</th>');
+ unless ($readonly) {
+ $r->print('<th>'.&mt('Announce').'</th>');
+ }
+ $r->print(&Apache::loncommon::end_data_table_header_row());
my $shown=0;
my $folder='';
if ($env{'form.displayfilter'} eq 'currentfolder') {
@@ -6044,7 +6128,8 @@
$parmlog{$id}{'exe_uname'},
$parmlog{$id}{'exe_udom'});
my $send_msg_link='';
- if ((($parmlog{$id}{'exe_uname'} ne $env{'user.name'})
+ if ((!$readonly) &&
+ (($parmlog{$id}{'exe_uname'} ne $env{'user.name'})
|| ($parmlog{$id}{'exe_udom'} ne $env{'user.domain'}))) {
$send_msg_link ='<br />'.
&Apache::loncommon::messagewrapper(&mt('Send message'),
@@ -6121,27 +6206,31 @@
}
}
}
- $output .= '</td><td>';
-
- 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 .= '</td>';
+
+ unless ($readonly) {
+ $output .= '<td>';
+ 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 .= '</td>';
}
- $output .= '</td>'.&Apache::loncommon::end_data_table_row();
+ $output .= &Apache::loncommon::end_data_table_row();
}
if ($env{'form.displayfilter'} eq 'containing') {
my $wholeentry=$about_me_link.':'.
@@ -6331,6 +6420,46 @@
return $needsnewer;
}
+sub get_permission {
+ my %permission;
+ my $allowed = 0;
+ return (\%permission,$allowed) unless ($env{'request.course.id'});
+ if ((&Apache::lonnet::allowed('opa',$env{'request.course.id'})) ||
+ (&Apache::lonnet::allowed('opa',$env{'request.course.id'}.'/'.
+ $env{'request.course.sec'}))) {
+ %permission= (
+ 'edit' => 1,
+ 'set' => 1,
+ 'setoverview' => 1,
+ 'addmetadata' => 1,
+ 'ordermetadata' => 1,
+ 'setrestrictmeta' => 1,
+ 'newoverview' => 1,
+ 'setdefaults' => 1,
+ 'settable' => 1,
+ 'parameterchangelog' => 1,
+ 'cleanparameters' => 1,
+ 'dateshift1' => 1,
+ 'dateshift2' => 1,
+ 'helper' => 1,
+ );
+ } elsif ((&Apache::lonnet::allowed('vpa',$env{'request.course.id'})) ||
+ (&Apache::lonnet::allowed('vpa',$env{'request.course.id'}.'/'.
+ $env{'request.course.sec'}))) {
+ %permission = (
+ 'set' => 1,
+ 'settable' => 1,
+ 'newoverview' => 1,
+ 'setoverview' => 1,
+ 'parameterchangelog' => 1,
+ );
+ }
+ foreach my $perm (values(%permission)) {
+ if ($perm) { $allowed=1; last; }
+ }
+ return (\%permission,$allowed);
+}
+
##################################################
# HANDLER
##################################################
@@ -6379,25 +6508,25 @@
'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'}));
+ my ($parm_permission,$allowed) = &get_permission();
my $exists = &check_for_course_info();
- if ($env{'request.course.id'} && $parm_permission && $exists) {
+ if ($env{'request.course.id'} && $allowed && $exists) {
#
# Main switch on form.action and form.state, as appropriate
#
# 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);
+ if (($parm_permission->{'set'}) &&
+ ((($env{'form.command'} eq 'set') && ($env{'form.url'})
+ && (!$env{'form.dis'})) || ($env{'form.symb'}))) {
+ &assessparms($r,$parm_permission);
} elsif (! exists($env{'form.action'})) {
&print_main_menu($r,$parm_permission);
+ } elsif (!$parm_permission->{$env{'form.action'}}) {
+ &print_main_menu($r,$parm_permission);
} elsif ($env{'form.action'} eq 'setoverview') {
- &overview($r);
+ &overview($r,$parm_permission);
} elsif ($env{'form.action'} eq 'addmetadata') {
&addmetafield($r);
} elsif ($env{'form.action'} eq 'ordermetadata') {
@@ -6405,13 +6534,13 @@
} elsif ($env{'form.action'} eq 'setrestrictmeta') {
&setrestrictmeta($r);
} elsif ($env{'form.action'} eq 'newoverview') {
- &newoverview($r);
+ &newoverview($r,$parm_permission);
} elsif ($env{'form.action'} eq 'setdefaults') {
&defaultsetter($r);
} elsif ($env{'form.action'} eq 'settable') {
- &assessparms($r);
+ &assessparms($r,$parm_permission);
} elsif ($env{'form.action'} eq 'parameterchangelog') {
- &parm_change_log($r);
+ &parm_change_log($r,$parm_permission);
} elsif ($env{'form.action'} eq 'cleanparameters') {
&clean_parameters($r);
} elsif ($env{'form.action'} eq 'dateshift1') {
Index: loncom/interface/lonmenu.pm
diff -u loncom/interface/lonmenu.pm:1.454 loncom/interface/lonmenu.pm:1.455
--- loncom/interface/lonmenu.pm:1.454 Tue Oct 11 22:58:55 2016
+++ loncom/interface/lonmenu.pm Sun Oct 16 21:49:51 2016
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Routines to control the menu
#
-# $Id: lonmenu.pm,v 1.454 2016/10/11 22:58:55 raeburn Exp $
+# $Id: lonmenu.pm,v 1.455 2016/10/16 21:49:51 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -751,7 +751,7 @@
if ($env{'request.filename'}=~/$LONCAPA::assess_re/) {
push(@privs,('mgr','vgr'));
}
- push(@privs,'opa');
+ push(@privs,('opa','vpa'));
}
foreach my $priv (@privs) {
$perms{$priv} = &Apache::lonnet::allowed($priv,$env{'request.course.id'});
@@ -775,7 +775,7 @@
'Content Submissions');
}
}
- if (($env{'request.symb'} ne '') && ($perms{'opa'})) {
+ if (($env{'request.symb'} ne '') && (($perms{'opa'}) || ($perms{'vpa'}))) {
&switch('','',7,3,'pparm.png','Content Settings','parms[_2]',
"gocmd('/adm/parmset','set')",
'Content Settings');
Index: loncom/interface/loncourserespicker.pm
diff -u loncom/interface/loncourserespicker.pm:1.13 loncom/interface/loncourserespicker.pm:1.14
--- loncom/interface/loncourserespicker.pm:1.13 Tue Jun 9 21:22:56 2015
+++ loncom/interface/loncourserespicker.pm Sun Oct 16 21:49:51 2016
@@ -1,6 +1,6 @@
# The LearningOnline Network
#
-# $Id: loncourserespicker.pm,v 1.13 2015/06/09 21:22:56 damieng Exp $
+# $Id: loncourserespicker.pm,v 1.14 2016/10/16 21:49:51 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -75,7 +75,7 @@
within the folder. Unchecking a resource causing unchecking of folders
containing the item back up to the top level.
-Inputs: 9.
+Inputs: 11.
- $navmap -- Reference to LON-CAPA navmap object
(encapsulates information about resources in the course).
@@ -106,6 +106,10 @@
- $uploadedfiles -- Reference to hash: keys are paths to files in
/home/httpd/lonUsers/$cdom/$1/$2/$3/$cnum/userfiles.
+
+ - $readonly -- if true, no "check all" or "uncheck all" buttons will
+ be displayed, and checkboxes will be disabled, if this
+ is for an exam block.
Output: $output is the HTML mark-up for display/selection of content
@@ -206,7 +210,8 @@
use LONCAPA qw(:DEFAULT :match);
sub create_picker {
- my ($navmap,$context,$formname,$crstype,$blockedmaps,$blockedresources,$block,$preamble,$numhome,$uploadedfiles) = @_;
+ my ($navmap,$context,$formname,$crstype,$blockedmaps,$blockedresources,$block,$preamble,
+ $numhome,$uploadedfiles,$readonly) = @_;
return unless (ref($navmap));
my ($it,$output,$numdisc,%maps,%resources,%discussiontime,%currmaps,%currresources,%files);
$it = $navmap->getIterator(undef,undef,undef,1,undef,undef);
@@ -236,12 +241,15 @@
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
my $crsprefix = &propath($cdom,$cnum).'/userfiles/';
- my ($info,$display,$onsubmit,$togglebuttons);
+ my ($info,$display,$onsubmit,$togglebuttons,$disabled);
if ($context eq 'examblock') {
my $maps_elem = 'docs_maps_'.$block;
my $res_elem = 'docs_resources_'.$block;
$onsubmit = ' onsubmit="return writeToOpener('."'$maps_elem','$res_elem'".');"';
$info = &mt('Items in '.lc($crstype).' for which access will be blocked.');
+ if ($readonly) {
+ $disabled = ' disabled="disabled"';
+ }
}
if ($context eq 'dumpdocs') {
$info = '<span class="LC_fontsize_medium">'.
@@ -253,10 +261,14 @@
$info = &mt('Choose which items you wish to export from your '.$crstype.'.');
$startcount = 5;
}
- $togglebuttons = '<input type="button" value="'.&mt('check all').'" '.
- 'onclick="javascript:checkAll(document.'.$formname.'.archive)" />'.
- ' <input type="button" value="'.&mt('uncheck all').'"'.
- ' onclick="javascript:uncheckAll(document.'.$formname.'.archive)" />';
+ if ($disabled) {
+ $togglebuttons = '<br />';
+ } else {
+ $togglebuttons = '<input type="button" value="'.&mt('check all').'" '.
+ 'onclick="javascript:checkAll(document.'.$formname.'.archive)" />'.
+ ' <input type="button" value="'.&mt('uncheck all').'"'.
+ ' onclick="javascript:uncheckAll(document.'.$formname.'.archive)" />';
+ }
$display = '<form name="'.$formname.'" action="" method="post"'.$onsubmit.'>'."\n";
if ($context eq 'imsexport') {
$display .= $info.
@@ -353,7 +365,7 @@
$display .= 'checked="checked"';
}
}
- $display .= ' />'."\n";
+ $display .= $disabled.' />'."\n";
if ($context eq 'dumpdocs') {
$display .= '</td><td valign="top">';
}
@@ -450,10 +462,12 @@
&mt('Export').'" /></p>';
$numcount = $count + $boards + $startcount;
} elsif ($context eq 'examblock') {
- $display .=
- '<p>'.
- '<input type="submit" name="resourceblocks" value="'.
- &mt('Copy Choices to Main Window').'" /></p>';
+ unless ($readonly) {
+ $display .=
+ '<p>'.
+ '<input type="submit" name="resourceblocks" value="'.
+ &mt('Copy Choices to Main Window').'" /></p>';
+ }
$numcount = $count + $startcount;
} elsif ($context eq 'dumpdocs') {
$display .= '</fieldset>'.
Index: loncom/interface/lonblockingmenu.pm
diff -u loncom/interface/lonblockingmenu.pm:1.18 loncom/interface/lonblockingmenu.pm:1.19
--- loncom/interface/lonblockingmenu.pm:1.18 Fri Mar 4 21:43:15 2016
+++ loncom/interface/lonblockingmenu.pm Sun Oct 16 21:49:51 2016
@@ -2,7 +2,7 @@
# Routines for configuring blocking of access to collaborative functions,
# and specific resources during an exam
#
-# $Id: lonblockingmenu.pm,v 1.18 2016/03/04 21:43:15 raeburn Exp $
+# $Id: lonblockingmenu.pm,v 1.19 2016/10/16 21:49:51 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -105,6 +105,19 @@
=over
+=item &get_permission()
+
+Returns information about permission user has to set/modify exam
+blocking events.
+
+Inputs: None
+
+Outputs: 2
+ $readonly - true if modification of blocking events is prohibited.
+
+ $allowed - true if blocking events information can be shown.
+
+
=item &get_timed_items()
Provides perl data structure with information about timed interval
@@ -222,7 +235,7 @@
Generates web form elements used to display, cancel, or modify
existing blocking events.
-Inputs: 7
+Inputs: 8
- $r - Apache request object
- $records - Reference to hash of current blocks
@@ -238,6 +251,9 @@
- $blockcount - number of existing blocking events in course
+ - $readonly - if true, modification not allowed.
+
+
Output: None
Side Effects: prints web form elements (in a table) for current blocks.
@@ -422,11 +438,10 @@
# ----------------------------------------------------------- Permissions check
- unless ((&Apache::lonnet::allowed('dcm',$env{'request.course.id'})) ||
- (&Apache::lonnet::allowed('dcm',$env{'request.course.id'}.
- '/'.$env{'request.course.sec'}))) {
+ my ($readonly,$allowed) = &get_permission();
+ unless ($allowed) {
$env{'user.error.msg'}=
- "/adm/setblock:dcm:0:0:Cannot set blocking of communications in a course";
+ "/adm/setblock:dcm:0:0:Cannot view/set blocking of communications in a course";
return HTTP_NOT_ACCEPTABLE;
}
@@ -471,7 +486,7 @@
$r->print(&Apache::loncourserespicker::create_picker($navmap,
'examblock','resourceblocks',$crstype,
\%blockedmaps,\%blockedresources,
- $env{'form.block'}));
+ $env{'form.block'},'','',undef,$readonly));
} else {
$r->print($errormsg);
}
@@ -480,10 +495,12 @@
# -------------------------- Store changes and retrieve latest block information
my $storeresult;
- if ($env{'form.action'} eq 'store') {
- (my $numchanges,$storeresult) = &blockstore($r,$crstype,$blockcount,\%records);
- if ($numchanges > 0) {
- $blockcount = &get_blockdates(\%records);
+ unless ($readonly) {
+ if ($env{'form.action'} eq 'store') {
+ (my $numchanges,$storeresult) = &blockstore($r,$crstype,$blockcount,\%records);
+ if ($numchanges > 0) {
+ $blockcount = &get_blockdates(\%records);
+ }
}
}
@@ -569,8 +586,10 @@
# ------------------------ Choose between modifying existing block or adding new
$r->print('<form name="blockform" method="post" action="/adm/setblock?action=store">');
- if ($blockcount > 0) {
- $r->print(<<"END");
+
+ unless ($readonly) {
+ if ($blockcount > 0) {
+ $r->print(<<"END");
<div class="LC_left_float">
<fieldset><legend>$lt{'actt'}</legend>
<span class="LC_nobreak">
@@ -587,33 +606,62 @@
<br clear="all" />
<div id="showadd" style="display:none">
END
- } else {
- $r->print($lt{'ncbc'}.'<br /><br />'.
- '<h4>'.$lt{'addn'}.'</h4>'.
- '<input type="hidden" name="blockaction" value="add" />');
+ } else {
+ $r->print($lt{'ncbc'}.'<br /><br />'.
+ '<h4>'.$lt{'addn'}.'</h4>'.
+ '<input type="hidden" name="blockaction" value="add" />');
+ }
}
my ($navmap,$errormsg) =
&Apache::loncourserespicker::get_navmap_object($crstype,'examblock');
# --------------------------------------------- Interface for adding a new block
- &display_addblocker_table($r,$blockcount,\%ltext,\%intervals,
- $navmap,$errormsg);
+ if ($readonly) {
+ if (!$blockcount) {
+ $r->print($lt{'ncbc'}.'<br />');
+ }
+ } else {
+ &display_addblocker_table($r,$blockcount,\%ltext,\%intervals,
+ $navmap,$errormsg);
+ if ($blockcount > 0) {
+ $r->print('</div>');
+ }
+ }
-# ------------------------------------------------- Interface for existig blocks
+# ------------------------------------------------ Interface for existing blocks
if ($blockcount > 0) {
- $r->print('</div>');
&display_blocker_status($r,\%records,\%ltext,\%intervals,
- $navmap,$errormsg,$blockcount);
+ $navmap,$errormsg,$blockcount,$readonly);
}
- $r->print(<<"END");
+ unless ($readonly) {
+ $r->print(<<"END");
<br />
<input type ="submit" value="$lt{'stor'}" />
-</form>
END
- $r->print(&Apache::loncommon::end_page());
+ }
+ $r->print('</form>'.
+ &Apache::loncommon::end_page());
return OK;
}
+sub get_permission {
+ my %permission;
+ my $allowed = 0;
+ my $readonly = 0;
+ return ($readonly,$allowed) unless ($env{'request.course.id'});
+ if ((&Apache::lonnet::allowed('dcm',$env{'request.course.id'})) ||
+ (&Apache::lonnet::allowed('dcm',$env{'request.course.id'}.'/'.
+ $env{'request.course.sec'}))) {
+ $allowed = 1;
+ } elsif ((&Apache::lonnet::allowed('vcb',$env{'request.course.id'})) ||
+ (&Apache::lonnet::allowed('vcb',$env{'request.course.id'}.'/'.
+ $env{'request.course.sec'}))) {
+ $readonly = 1;
+ $allowed = 1;
+ }
+ return ($readonly,$allowed);
+}
+
sub get_timed_items {
my ($cdom,$cnum) = @_;
my ($cid,%intervals);
@@ -975,9 +1023,9 @@
}
sub display_blocker_status {
- my ($r,$records,$ltext,$intervals,$navmap,$errormsg,$blockcount) = @_;
+ my ($r,$records,$ltext,$intervals,$navmap,$errormsg,$blockcount,$readonly) = @_;
my $parmcount = 0;
- my (%map_url,%resource_symb,%titles,%lookups);
+ my (%map_url,%resource_symb,%titles,%lookups,$disabled);
&Apache::loncourserespicker::enumerate_course_contents($navmap,\%map_url,\%resource_symb,\%titles,'examblock');
%{$lookups{'maps'}} = reverse(%map_url);
%{$lookups{'resources'}} = reverse(%resource_symb);
@@ -987,10 +1035,13 @@
'noch' => 'No change',
);
$r->print('<div id="showmodify" style="display:block">'.
- &Apache::loncommon::start_data_table());
+ &Apache::loncommon::start_data_table().'<tr>');
+ if ($readonly) {
+ $disabled = ' disabled="disabled"';
+ } else {
+ $r->print('<th></th>');
+ }
$r->print(<<"END");
- <tr>
- <th></th>
<th>$ltext->{'type'}</th>
<th>$ltext->{'even'}</th>
<th>$ltext->{'blck'}</th>
@@ -1009,8 +1060,12 @@
&Apache::loncommon::aboutmewrapper(
&Apache::loncommon::plainname($setuname,$setudom),
$setuname,$setudom);
+ my $state = '';
$r->print(&Apache::loncommon::start_data_table_row());
- $r->print(<<"ACT");
+ if ($readonly) {
+ $state = 'disabled';
+ } else {
+ $r->print(<<"ACT");
<td valign="middle"><span class="LC_nobreak"><label>
<input type="radio" name="action_$parmcount" value="modify" />$lt{'modi'}
@@ -1024,13 +1079,16 @@
</label></span>
</td>
ACT
+ }
my ($start,$end,$startform,$endform);
if ($record =~ /^(\d+)____(\d+)$/) {
($start,$end) = split(/____/,$record);
$startform = &Apache::lonhtmlcommon::date_setter('blockform','startdate_'.
- $parmcount,$start,$onchange);
+ $parmcount,$start,$onchange,
+ undef,$state);
$endform = &Apache::lonhtmlcommon::date_setter('blockform','enddate_'.
- $parmcount,$end,$onchange);
+ $parmcount,$end,$onchange,
+ undef,$state);
$r->print('<td><fieldset><legend>'.$ltext->{'defs'}.'</legend>'.
$ltext->{'star'}.': '.$startform.'<br />'.
$ltext->{'endd'}.': '.$endform.'</fieldset></td>');
@@ -1160,18 +1218,18 @@
}
}
$r->print(&create_interval_form($intervals,$parmcount,$navmap,$item,$jschg,
- $itemname,$iteminfo).'</fieldset></td>');
+ $itemname,$iteminfo,$disabled).'</fieldset></td>');
}
$r->print(<<"END");
<td>
- <input type="text" name="title_$parmcount" size="15" value="$title" onfocus="$jschg" />
+ <input type="text" name="title_$parmcount" size="15" value="$title" onfocus="$jschg" $disabled />
<input type="hidden" name="key_$parmcount" value="$blockid" />
<br />
<br />
$ltext->{'setb'}: $settername
</td>
END
- $r->print('<td>'.&blocker_checkboxes($parmcount,$blocks,$jschg,\%lookups).'</td>'.
+ $r->print('<td>'.&blocker_checkboxes($parmcount,$blocks,$jschg,\%lookups,$disabled).'</td>'.
&Apache::loncommon::end_data_table_row());
$parmcount++;
}
@@ -1261,7 +1319,7 @@
}
sub blocker_checkboxes {
- my ($parmcount,$blocks,$jschg,$lookups) = @_;
+ my ($parmcount,$blocks,$jschg,$lookups,$disabled) = @_;
my ($typeorder,$types) = &blocktype_text();
my $numinrow = 2;
my %currdocs;
@@ -1328,7 +1386,7 @@
}
$output .= '<span class="LC_nobreak"><label>'."\n".
'<input type="checkbox" id="'.$item.'" name="'.$item.'"'.
- $blockstatus.$clickaction.' value="1" />'.
+ $blockstatus.$clickaction.' value="1"'.$disabled.' />'.
$types->{$block}.'</label></span>'."\n";
if ($block eq 'docs') {
if ($blockstatus ne '') {
@@ -1347,7 +1405,7 @@
}
sub create_interval_form {
- my ($intervals,$parmcount,$navmap,$currkey,$jschg,$itemname,$iteminfo) = @_;
+ my ($intervals,$parmcount,$navmap,$currkey,$jschg,$itemname,$iteminfo,$disabled) = @_;
return unless ((ref($intervals) eq 'HASH') && (ref($navmap)));
my $intervalform;
if (keys(%{$intervals}) > 0) {
@@ -1360,7 +1418,7 @@
$clickaction = ' onclick="'.$jschg.'"';
}
$intervalform .= '<label><input type="radio" name="firstaccess_'.$parmcount.
- '" value="course"'.$checked.$clickaction.' />';
+ '" value="course"'.$checked.$clickaction.$disabled.' />';
if ($currkey eq 'course') {
$intervalform .= $itemname;
} else {
@@ -1385,7 +1443,7 @@
}
$intervalform .= '<label><input type="radio" name="firstaccess_'.$parmcount.
'" value="'.&HTML::Entities::encode($map,'"<>&').'"'.
- $checked.$clickaction.' />';
+ $checked.$clickaction.$disabled.' />';
if ($currkey eq $map) {
$intervalform .= $itemname.'</label>'.$iteminfo;
} else {
@@ -1426,7 +1484,7 @@
}
$intervalform .= '<label><input type="radio" name="firstaccess_'.$parmcount.
'" value="'.&HTML::Entities::encode($resource,'"<>&').'"'.
- $checked.$clickaction.' />';
+ $checked.$clickaction.$disabled.' />';
if ($currkey eq $resource) {
$intervalform .= $itemname.'</label>'.$iteminfo;
} else {
@@ -1456,7 +1514,7 @@
if ($currkey ne '') {
$intervalform = '<input type="radio" name="firstaccess_'.$parmcount.
'" checked="checked" value="'.
- &HTML::Entities::encode($currkey,'"<>&').' />'.
+ &HTML::Entities::encode($currkey,'"<>&').'"'.$disabled.' />'.
$itemname.'<br />';
} else {
$intervalform = &mt('No timed items defined.').' '.
Index: loncom/auth/roles.tab
diff -u loncom/auth/roles.tab:1.64 loncom/auth/roles.tab:1.65
--- loncom/auth/roles.tab:1.64 Mon Oct 10 03:02:57 2016
+++ loncom/auth/roles.tab Sun Oct 16 21:50:08 2016
@@ -14,7 +14,7 @@
ep:c bre&R:mgr&R:mqg&R:dcm:evb:las:pav:pfo
cr:s adv&SR:bre&S:bro&S
cr:d sma
-cr:c bre&R:vgr&SCR:mgr&SCR:mqg&SCR:mgq&SCR:gan&SCR:dcm&SC:evb&SC:srm&SC:dff&SC:pch:plc:dch&S:pac:rin&S:las&SR:opa&SR:vpa&SR:mdc&SR:cst&IK:vcl&C:pav&C:pfo&C:whn&C
+cr:c bre&R:vgr&SCR:mgr&SCR:mqg&SCR:mgq&SCR:gan&SCR:dcm&SC:vcb&SC:evb&SC:srm&SC:dff&SC:pch:plc:dch&S:pac:rin&S:las&SR:opa&SR:vpa&SR:mdc&SR:cst&IK:vcl&C:pav&C:pfo&C:whn&C
st:d sma&L
st:c bre&RXL:pch&CL:plc&CL:pac&CL
ad:s adv
Index: loncom/auth/rolesplain.tab
diff -u loncom/auth/rolesplain.tab:1.47 loncom/auth/rolesplain.tab:1.48
--- loncom/auth/rolesplain.tab:1.47 Mon Oct 10 03:02:57 2016
+++ loncom/auth/rolesplain.tab Sun Oct 16 21:50:08 2016
@@ -66,6 +66,7 @@
mgq:Modify grade queue
gan:Generate anonymous statistics
dcm:Disable all communication among students
+vcb:View communication blocking
evb:Evade communication blocking
sma:Send internal message
srm:Send broadcast and receipt-required message
More information about the LON-CAPA-cvs
mailing list