version 1.566, 2016/08/10 21:05:42
|
version 1.568, 2016/10/16 21:49:51
|
Line 1380 ENDHEAD
|
Line 1380 ENDHEAD
|
# @param {string} $cgroup - group name |
# @param {string} $cgroup - group name |
# @param {array reference} $usersgroups - list of groups the user belongs to, if any |
# @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} $noeditgrp - true if no edit is allowed for group level parameters |
|
# @param {boolean} $readonly - true if no editing allowed. |
sub print_row { |
sub print_row { |
my ($r,$which,$part,$name,$symbp,$rid,$default,$defaulttype,$display,$defbgone, |
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 $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $courseopt=&Apache::lonnet::get_courseresdata($cnum,$cdom); |
my $courseopt=&Apache::lonnet::get_courseresdata($cnum,$cdom); |
Line 1427 sub print_row {
|
Line 1429 sub print_row {
|
|
|
if ($parmlev eq 'general') { |
if ($parmlev eq 'general') { |
if ($uname) { |
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) { |
} 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) { |
} 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 { |
} 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') { |
} elsif ($parmlev eq 'map') { |
if ($uname) { |
if ($uname) { |
&print_td($r,3,$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); |
&print_td($r,2,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly); |
} elsif ($cgroup) { |
} elsif ($cgroup) { |
&print_td($r,7,$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); |
&print_td($r,6,$defbgthree,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,$noeditgrp,$readonly); |
} elsif ($csec) { |
} elsif ($csec) { |
&print_td($r,11,$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); |
&print_td($r,10,$defbgtwo,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly); |
} else { |
} else { |
&print_td($r,17,$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); |
&print_td($r,16,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly); |
} |
} |
} else { |
} else { |
if ($uname) { |
if ($uname) { |
Line 1467 sub print_row {
|
Line 1469 sub print_row {
|
} |
} |
} |
} |
|
|
&print_td($r,18,$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); |
&print_td($r,17,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly); |
&print_td($r,16,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display); |
&print_td($r,16,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly); |
&print_td($r,15,'#FFDDDD',$result,\@outpar,$mprefix,$which,\@typeoutpar,$display); |
&print_td($r,15,'#FFDDDD',$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly); |
&print_td($r,14,'#FFDDDD',$result,\@outpar,$mprefix,$which,\@typeoutpar,$display); |
&print_td($r,14,'#FFDDDD',$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly); |
&print_td($r,13,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display); |
&print_td($r,13,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly); |
|
|
if ($csec) { |
if ($csec) { |
&print_td($r,12,$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); |
&print_td($r,11,$defbgtwo,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly); |
&print_td($r,10,$defbgtwo,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display); |
&print_td($r,10,$defbgtwo,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly); |
&print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display); |
&print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly); |
} |
} |
|
|
if ($cgroup) { |
if ($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); |
&print_td($r,7,$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); |
&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); |
&print_td($r,5,$defbgthree,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,$noeditgrp.'',$readonly); |
} |
} |
|
|
if ($uname) { |
if ($uname) { |
if ($othergrp) { |
if ($othergrp) { |
$r->print($othergrp); |
$r->print($othergrp); |
} |
} |
&print_td($r,4,$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); |
&print_td($r,3,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly); |
&print_td($r,2,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display); |
&print_td($r,2,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly); |
&print_td($r,1,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display); |
&print_td($r,1,$defbgone,$result,\@outpar,$mprefix,$which,\@typeoutpar,$display,'',$readonly); |
} |
} |
|
|
} # end of $parmlev if/else |
} # end of $parmlev if/else |
Line 1532 sub print_row {
|
Line 1534 sub print_row {
|
# @param {array reference} $typeoutpar - array level -> parameter type (when defined) |
# @param {array reference} $typeoutpar - array level -> parameter type (when defined) |
# @param {hash reference} $display - parameter key -> full title for the parameter |
# @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} $noeditgrp - true if no edit is allowed for group level parameters |
|
# @param {boolean} $readonly -true if editing not allowed. |
sub print_td { |
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). |
$r->print('<td style="background-color:'.(($result==$which)?'#AAFFAA':$defbg). |
';" align="center">'); |
';" align="center">'); |
my $nolink = 0; |
my $nolink = 0; |
if ($which == 14 || $which == 15) { |
if ($readonly) { |
$nolink = 1; |
|
} elsif (($env{'request.course.sec'} ne '') && ($which > 12)) { |
|
$nolink = 1; |
$nolink = 1; |
} elsif ($which == 5 || $which == 6 || $which == 7 || $which == 8) { |
} else { |
if ($noeditgrp) { |
if ($which == 14 || $which == 15) { |
$nolink = 1; |
$nolink = 1; |
} |
} elsif (($env{'request.course.sec'} ne '') && ($which > 12)) { |
} elsif ($mprefix =~ /availablestudent\&$/) { |
|
if ($which > 4) { |
|
$nolink = 1; |
|
} |
|
} elsif ($mprefix =~ /examcode\&$/) { |
|
unless ($which == 2) { |
|
$nolink = 1; |
$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) { |
if ($nolink) { |
Line 2630 sub standardkeyorder {
|
Line 2637 sub standardkeyorder {
|
# url - used only with command 'set', the resource url |
# url - used only with command 'set', the resource url |
# |
# |
# @param {Apache2::RequestRec} $r - the Apache request |
# @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 { |
sub assessparms { |
|
|
my $r=shift; |
my ($r,$parm_permission) = @_; |
|
|
|
|
# -------------------------------------------------------- Variable declaration |
# -------------------------------------------------------- Variable declaration |
Line 2803 sub assessparms {
|
Line 2812 sub assessparms {
|
$symbp{'0.0'} = ''; |
$symbp{'0.0'} = ''; |
|
|
# ---------------------------------------------------------- Anything to store? |
# ---------------------------------------------------------- Anything to store? |
if ($env{'form.pres_marker'}) { |
if ($env{'form.pres_marker'} && $parm_permission->{'edit'}) { |
my @markers=split(/\&\&\&/,$env{'form.pres_marker'}); |
my @markers=split(/\&\&\&/,$env{'form.pres_marker'}); |
my @values=split(/\&\&\&/,$env{'form.pres_value'}); |
my @values=split(/\&\&\&/,$env{'form.pres_value'}); |
my @types=split(/\&\&\&/,$env{'form.pres_type'}); |
my @types=split(/\&\&\&/,$env{'form.pres_type'}); |
Line 3096 ENDPARMSELSCRIPT
|
Line 3105 ENDPARMSELSCRIPT
|
my @catmarker=map { tr|.|_|; 'parameter_'.$_; } @pscat; |
my @catmarker=map { tr|.|_|; 'parameter_'.$_; } @pscat; |
my $csuname=$env{'user.name'}; |
my $csuname=$env{'user.name'}; |
my $csudom=$env{'user.domain'}; |
my $csudom=$env{'user.domain'}; |
|
my $readonly = 1; |
|
if ($parm_permission->{'edit'}) { |
|
undef($readonly); |
|
} |
|
|
if ($parmlev eq 'full') { |
if ($parmlev eq 'full') { |
# |
# |
Line 3279 ENDTABLEHEADFOUR
|
Line 3292 ENDTABLEHEADFOUR
|
&print_row($r,$item,\%part,\%name,\%symbp,$rid,\%default, |
&print_row($r,$item,\%part,\%name,\%symbp,$rid,\%default, |
\%type,\%display,$defbgone,$defbgtwo, |
\%type,\%display,$defbgone,$defbgtwo, |
$defbgthree,$parmlev,$uname,$udom,$csec, |
$defbgthree,$parmlev,$uname,$udom,$csec, |
$cgroup,\@usersgroups,$noeditgrp); |
$cgroup,\@usersgroups,$noeditgrp,$readonly); |
} |
} |
} |
} |
} |
} |
Line 3402 ENDTABLEHEADFOUR
|
Line 3415 ENDTABLEHEADFOUR
|
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print(&Apache::loncommon::start_data_table_row()); |
&print_row($r,$item,\%part,\%name,\%symbp,$mapid,\%default, |
&print_row($r,$item,\%part,\%name,\%symbp,$mapid,\%default, |
\%type,\%display,$defbgone,$defbgtwo,$defbgthree, |
\%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>' |
$r->print(&Apache::loncommon::end_data_table().'</p>' |
.'</div>' |
.'</div>' |
Line 3491 ENDMAPONE
|
Line 3505 ENDMAPONE
|
foreach my $item (&keysinorder(\%name,\%keyorder)) { |
foreach my $item (&keysinorder(\%name,\%keyorder)) { |
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print(&Apache::loncommon::start_data_table_row()); |
&print_row($r,$item,\%part,\%name,\%symbp,$mapid,\%default, |
&print_row($r,$item,\%part,\%name,\%symbp,$mapid,\%default, |
\%type,\%display,$defbgone,$defbgtwo,$defbgthree, |
\%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() |
$r->print(&Apache::loncommon::end_data_table() |
.'</p>' |
.'</p>' |
Line 3850 sub parse_listdata_key {
|
Line 3865 sub parse_listdata_key {
|
# @param {string} $sortorder - realmstudent|studentrealm |
# @param {string} $sortorder - realmstudent|studentrealm |
# @param {string} $caller - name of the calling sub (overview|newoverview) |
# @param {string} $caller - name of the calling sub (overview|newoverview) |
# @param {hash reference} $classlist - from loncoursedata::get_classlist |
# @param {hash reference} $classlist - from loncoursedata::get_classlist |
|
# @param {boolean} $readonly - true if editing not allowed |
# @returns{integer} - number of $listdata parameters processed |
# @returns{integer} - number of $listdata parameters processed |
sub listdata { |
sub listdata { |
my ($r,$resourcedata,$listdata,$sortorder,$caller,$classlist)=@_; |
my ($r,$resourcedata,$listdata,$sortorder,$caller,$classlist,$readonly)=@_; |
|
|
# Start list output |
# Start list output |
|
|
Line 3916 sub listdata {
|
Line 3932 sub listdata {
|
|
|
} keys(%{$listdata})) { # foreach my $thiskey |
} keys(%{$listdata})) { # foreach my $thiskey |
|
|
my $readonly; |
|
if ($$listdata{$thiskey.'.type'}) { |
if ($$listdata{$thiskey.'.type'}) { |
my $thistype=$$listdata{$thiskey.'.type'}; |
my $thistype=$$listdata{$thiskey.'.type'}; |
if ($$resourcedata{$thiskey.'.type'}) { |
if ($$resourcedata{$thiskey.'.type'}) { |
Line 4140 sub string_ip_selector {
|
Line 4155 sub string_ip_selector {
|
@{$access{'deny'}} = (''); |
@{$access{'deny'}} = (''); |
} |
} |
my ($disabled,$addmore); |
my ($disabled,$addmore); |
if ($disabled) { |
if ($readonly) { |
$disabled=' disabled="disabled"'; |
$disabled=' disabled="disabled"'; |
} else { |
} else { |
$addmore = "\n".'<button class="LC_add_ipacc_button">'.&mt('Add more').'</button>'; |
$addmore = "\n".'<button class="LC_add_ipacc_button">'.&mt('Add more').'</button>'; |
Line 4561 sub date_interval_selector {
|
Line 4576 sub date_interval_selector {
|
$currprocdisplay = 'text'; |
$currprocdisplay = 'text'; |
} |
} |
my $onclick = ' onclick="toggleSecret(this.form,'."'done_','$thiskey'".');"'; |
my $onclick = ' onclick="toggleSecret(this.form,'."'done_','$thiskey'".');"'; |
|
my $disabled; |
|
if ($readonly) { |
|
$disabled = ' disabled="disabled"'; |
|
} |
$result .= '<br /><span class="LC_nobreak">'.&mt('Include "done" button'). |
$result .= '<br /><span class="LC_nobreak">'.&mt('Include "done" button'). |
'<label><input type="radio" value="" name="done_'.$thiskey.'"'.$checkedoff.$onclick.' />'. |
'<label><input type="radio" value="" name="done_'.$thiskey.'"'.$checkedoff.$onclick.$disabled.' />'. |
&mt('No').'</label>'.(' 'x2). |
&mt('No').'</label>'.(' 'x2). |
'<label><input type="radio" value="_done" name="done_'.$thiskey.'"'.$checkedon.$onclick.' />'. |
'<label><input type="radio" value="_done" name="done_'.$thiskey.'"'.$checkedon.$onclick.$disabled.' />'. |
&mt('Yes').'</label>'.(' 'x2). |
&mt('Yes').'</label>'.(' 'x2). |
'<label><input type="radio" value="_done_proctor" name="done_'.$thiskey.'"'.$checkedproc.$onclick.' />'. |
'<label><input type="radio" value="_done_proctor" name="done_'.$thiskey.'"'.$checkedproc.$onclick.$disabled.' />'. |
&mt('Yes, with proctor key').'</label>'. |
&mt('Yes, with proctor key').'</label>'. |
'<input type="'.$currprocdisplay.'" id="done_'.$thiskey.'_proctorkey" '. |
'<input type="'.$currprocdisplay.'" id="done_'.$thiskey.'_proctorkey" '. |
'name="done_'.$thiskey.'_proctorkey" value="'.&HTML::Entities::encode($currproctorkey,'"<>&').'" /></span><br />'. |
'name="done_'.$thiskey.'_proctorkey" value="'.&HTML::Entities::encode($currproctorkey,'"<>&').'"'.$disabled.' /></span><br />'. |
'<span class="LC_nobreak">'.&mt('Button text').': '. |
'<span class="LC_nobreak">'.&mt('Button text').': '. |
'<input type="text" name="done_'.$thiskey.'_buttontext" value="'.&HTML::Entities::encode($currdonetext,'"<>&').'" /></span>'; |
'<input type="text" name="done_'.$thiskey.'_buttontext" value="'.&HTML::Entities::encode($currdonetext,'"<>&').'"'.$disabled.' /></span>'; |
} |
} |
} |
} |
unless ($readonly) { |
unless ($readonly) { |
Line 4705 sub dateshift {
|
Line 4724 sub dateshift {
|
# |
# |
# @param {Apache2::RequestRec} $r - the Apache request |
# @param {Apache2::RequestRec} $r - the Apache request |
sub newoverview { |
sub newoverview { |
my ($r) = @_; |
my ($r,$parm_permission) = @_; |
|
|
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'}; |
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', |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setoverview', |
text=>"Overview Mode"}); |
text=>"Overview Mode"}); |
|
|
Line 4868 ENDOVER
|
Line 4891 ENDOVER
|
|
|
# List data |
# List data |
|
|
&listdata($r,$resourcedata,$listdata,$sortorder,'newoverview'); |
&listdata($r,$resourcedata,$listdata,$sortorder,'newoverview',undef,$readonly); |
} |
} |
$r->print(&tableend(). |
$r->print(&tableend()); |
((($env{'form.store'}) || ($env{'form.dis'}))?'<p><input type="submit" name="store" value="'.&mt('Save').'" /></p>':''). |
unless ($readonly) { |
'</form>'); |
$r->print( ((($env{'form.store'}) || ($env{'form.dis'}))?'<p><input type="submit" name="store" value="'.&mt('Save').'" /></p>':'') ); |
|
} |
|
$r->print('</form>'); |
&endSettingsScreen($r); |
&endSettingsScreen($r); |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
} |
} |
Line 4934 sub secgroup_lister {
|
Line 4959 sub secgroup_lister {
|
# |
# |
# @param {Apache2::RequestRec} $r - the Apache request |
# @param {Apache2::RequestRec} $r - the Apache request |
sub overview { |
sub overview { |
my ($r) = @_; |
my ($r,$parm_permission) = @_; |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'}; |
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". |
my $js = '<script type="text/javascript">'."\n". |
'// <![CDATA['."\n". |
'// <![CDATA['."\n". |
&toggleparmtextbox_js()."\n". |
&toggleparmtextbox_js()."\n". |
Line 4960 sub overview {
|
Line 4989 sub overview {
|
|
|
# Store modified |
# Store modified |
|
|
&storedata($r,$crs,$dom); |
unless ($readonly) { |
|
&storedata($r,$crs,$dom); |
|
} |
|
|
# Read modified data |
# Read modified data |
|
|
Line 4971 sub overview {
|
Line 5002 sub overview {
|
unless ($sortorder) { $sortorder='realmstudent'; } |
unless ($sortorder) { $sortorder='realmstudent'; } |
&sortmenu($r,$sortorder); |
&sortmenu($r,$sortorder); |
|
|
|
my $submitbutton = '<input type="submit" value="'.&mt('Save').'" />'; |
|
|
|
if ($readonly) { |
|
$r->print('<p>'.$submitbutton.'</p>'); |
|
} |
|
|
# List data |
# List data |
|
|
my $foundkeys=&listdata($r,$resourcedata,$resourcedata,$sortorder,'overview',$classlist); |
my $foundkeys=&listdata($r,$resourcedata,$resourcedata,$sortorder,'overview',$classlist,$readonly); |
$r->print(&tableend().'<p>'. |
$r->print(&tableend().'<p>'); |
($foundkeys?'<input type="submit" value="'.&mt('Save').'" />':'<span class="LC_info">'.&mt('There are no parameters.').'</span>').'</p></form>'. |
if ($foundkeys) { |
&Apache::loncommon::end_page()); |
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. |
# Unused sub. |
Line 5213 ENDMAINFORMHEAD
|
Line 5256 ENDMAINFORMHEAD
|
my $vgr = &Apache::lonnet::allowed('vgr',$env{'request.course.id'}); |
my $vgr = &Apache::lonnet::allowed('vgr',$env{'request.course.id'}); |
my $mgr = &Apache::lonnet::allowed('mgr',$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 $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 '')) { |
if ((!$dcm) && ($env{'request.course.sec'} ne '')) { |
$dcm = &Apache::lonnet::allowed('dcm',$env{'request.course.id'}. |
$dcm = &Apache::lonnet::allowed('dcm',$env{'request.course.id'}. |
'/'.$env{'request.course.sec'}); |
'/'.$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 = |
my @menu = |
( { categorytitle=>"Content Settings for this $crstype", |
( { categorytitle=>"Content Settings for this $crstype", |
items => [ |
items => [ |
{ linktext => 'Portfolio Metadata', |
{ linktext => 'Portfolio Metadata', |
url => '/adm/parmset?action=setrestrictmeta', |
url => '/adm/parmset?action=setrestrictmeta', |
permission => $parm_permission, |
permission => $parm_permission->{'setrestrictmeta'}, |
linktitle => "Restrict metadata for this $lc_crstype." , |
linktitle => "Restrict metadata for this $lc_crstype." , |
icon =>'contact-new.png' , |
icon =>'contact-new.png' , |
}, |
}, |
{ linktext => 'Reset Student Access Times', |
{ linktext => $linktext{'resettimes'}, |
url => '/adm/helper/resettimes.helper', |
url => $url{'resettimes'}, |
permission => $mgr, |
permission => ($vgr || $mgr), |
linktitle => "Reset access times for folders/maps, resources or the $lc_crstype." , |
linktitle => $linktitle{'resettimes'}, |
icon => 'start-here.png' , |
icon => 'start-here.png', |
}, |
}, |
{ linktext => 'Blocking Communication/Resource Access', |
{ linktext => 'Blocking Communication/Resource Access', |
url => '/adm/setblock', |
url => '/adm/setblock', |
permission => $dcm, |
permission => ($vcb || $dcm), |
linktitle => 'Configure blocking of communication/collaboration and access to resources during an exam', |
linktitle => 'Configure blocking of communication/collaboration and access to resources during an exam', |
icon => 'comblock.png', |
icon => 'comblock.png', |
}, |
}, |
{ linktext => 'Set Parameter Setting Default Actions', |
{ linktext => 'Set Parameter Setting Default Actions', |
url => '/adm/parmset?action=setdefaults', |
url => '/adm/parmset?action=setdefaults', |
permission => $parm_permission, |
permission => $parm_permission->{'setdefaults'}, |
linktitle =>'Set default actions for parameters.' , |
linktitle =>'Set default actions for parameters.' , |
icon => 'folder-new.png' , |
icon => 'folder-new.png' , |
}]}, |
}]}, |
Line 5249 ENDMAINFORMHEAD
|
Line 5330 ENDMAINFORMHEAD
|
items => [ |
items => [ |
{ linktext => 'Edit Resource Parameters - Helper Mode', |
{ linktext => 'Edit Resource Parameters - Helper Mode', |
url => '/adm/helper/parameter.helper', |
url => '/adm/helper/parameter.helper', |
permission => $parm_permission, |
permission => $parm_permission->{'helper'}, |
linktitle =>'Set/Modify resource parameters in helper mode.' , |
linktitle =>'Set/Modify resource parameters in helper mode.' , |
icon => 'dialog-information.png' , |
icon => 'dialog-information.png' , |
#help => 'Parameter_Helper', |
#help => 'Parameter_Helper', |
}, |
}, |
{ linktext => 'Edit Resource Parameters - Overview Mode', |
{ linktext => $linktext{'newoverview'}, |
url => '/adm/parmset?action=newoverview', |
url => '/adm/parmset?action=newoverview', |
permission => $parm_permission, |
permission => $parm_permission->{'newoverview'}, |
linktitle =>'Set/Modify resource parameters in overview mode.' , |
linktitle => $linktitle{'newoverview'}, |
icon => 'edit-find.png' , |
icon => 'edit-find.png', |
#help => 'Parameter_Overview', |
#help => 'Parameter_Overview', |
}, |
}, |
{ linktext => 'Edit Resource Parameters - Table Mode', |
{ linktext => $linktext{'settable'}, |
url => '/adm/parmset?action=settable', |
url => '/adm/parmset?action=settable', |
permission => $parm_permission, |
permission => $parm_permission->{'settable'}, |
linktitle =>'Set/Modify resource parameters in table mode.' , |
linktitle => $linktitle{'settable'}, |
icon => 'edit-copy.png' , |
icon => 'edit-copy.png', |
#help => 'Table_Mode', |
#help => 'Table_Mode', |
}]}, |
}]}, |
{ categorytitle => 'Existing Parameter Settings for Resources', |
{ categorytitle => 'Existing Parameter Settings for Resources', |
items => [ |
items => [ |
{ linktext => 'Modify Resource Parameters - Overview Mode', |
{ linktext => $linktext{'setoverview'},, |
url => '/adm/parmset?action=setoverview', |
url => '/adm/parmset?action=setoverview', |
permission => $parm_permission, |
permission => $parm_permission->{'setoverview'}, |
linktitle =>'Set/Modify existing resource parameters in overview mode.' , |
linktitle => $linktitle{'setoverview'}, |
icon => 'preferences-desktop-wallpaper.png' , |
icon => 'preferences-desktop-wallpaper.png', |
#help => 'Parameter_Overview', |
#help => 'Parameter_Overview', |
}, |
}, |
{ linktext => 'Change Log', |
{ linktext => 'Change Log', |
url => '/adm/parmset?action=parameterchangelog', |
url => '/adm/parmset?action=parameterchangelog', |
permission => $parm_permission, |
permission => $parm_permission->{'parameterchangelog'}, |
linktitle =>"View parameter and $lc_crstype blog posting/user notification change log." , |
linktitle =>"View parameter and $lc_crstype blog posting/user notification change log." , |
icon => 'document-properties.png', |
icon => 'document-properties.png', |
}]} |
}]} |
Line 5972 sub standard_parameter_levels {
|
Line 6053 sub standard_parameter_levels {
|
# |
# |
# @param {Apache2::RequestRec} $r - the Apache request |
# @param {Apache2::RequestRec} $r - the Apache request |
sub parm_change_log { |
sub parm_change_log { |
my ($r)=@_; |
my ($r,$parm_permission)=@_; |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'} |
my $crstype = $env{'course.'.$env{'request.course.id'}.'.type'} |
Line 6004 sub parm_change_log {
|
Line 6085 sub parm_change_log {
|
'<input type="submit" value="'.&mt('Display').'" />'. |
'<input type="submit" value="'.&mt('Display').'" />'. |
'</form></fieldset></div><br clear="all" />'); |
'</form></fieldset></div><br clear="all" />'); |
|
|
|
my $readonly = 1; |
|
if ($parm_permission->{'edit'}) { |
|
undef($readonly); |
|
} |
my $courseopt=&Apache::lonnet::get_courseresdata($cnum,$cdom); |
my $courseopt=&Apache::lonnet::get_courseresdata($cnum,$cdom); |
$r->print(&Apache::loncommon::start_data_table().&Apache::loncommon::start_data_table_header_row(). |
$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>'. |
'<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>'. |
&mt('Parameter').'</th><th>'.&mt('Part').'</th><th>'.&mt('New Value').'</th>'); |
&Apache::loncommon::end_data_table_header_row()); |
unless ($readonly) { |
|
$r->print('<th>'.&mt('Announce').'</th>'); |
|
} |
|
$r->print(&Apache::loncommon::end_data_table_header_row()); |
my $shown=0; |
my $shown=0; |
my $folder=''; |
my $folder=''; |
if ($env{'form.displayfilter'} eq 'currentfolder') { |
if ($env{'form.displayfilter'} eq 'currentfolder') { |
Line 6040 sub parm_change_log {
|
Line 6128 sub parm_change_log {
|
$parmlog{$id}{'exe_uname'}, |
$parmlog{$id}{'exe_uname'}, |
$parmlog{$id}{'exe_udom'}); |
$parmlog{$id}{'exe_udom'}); |
my $send_msg_link=''; |
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'}))) { |
|| ($parmlog{$id}{'exe_udom'} ne $env{'user.domain'}))) { |
$send_msg_link ='<br />'. |
$send_msg_link ='<br />'. |
&Apache::loncommon::messagewrapper(&mt('Send message'), |
&Apache::loncommon::messagewrapper(&mt('Send message'), |
Line 6117 sub parm_change_log {
|
Line 6206 sub parm_change_log {
|
} |
} |
} |
} |
} |
} |
$output .= '</td><td>'; |
$output .= '</td>'; |
|
|
if ($stillactive) { |
unless ($readonly) { |
my $parmitem = &standard_parameter_names($parmname); |
$output .= '<td>'; |
$parmitem = &mt($parmitem); |
if ($stillactive) { |
my $title=&mt('Changed [_1]',$parmitem); |
my $parmitem = &standard_parameter_names($parmname); |
my $description=&mt('Changed [_1] for [_2] to [_3]', |
$parmitem = &mt($parmitem); |
$parmitem,$realmdescription, |
my $title=&mt('Changed [_1]',$parmitem); |
(&isdateparm($istype{$parmname})?&Apache::lonlocal::locallocaltime($value):$value)); |
my $description=&mt('Changed [_1] for [_2] to [_3]', |
if (($uname) && ($udom)) { |
$parmitem,$realmdescription, |
$output .= |
(&isdateparm($istype{$parmname})?&Apache::lonlocal::locallocaltime($value):$value)); |
&Apache::loncommon::messagewrapper('Notify User', |
if (($uname) && ($udom)) { |
$uname,$udom,$title, |
$output .= |
$description); |
&Apache::loncommon::messagewrapper('Notify User', |
} else { |
$uname,$udom,$title, |
$output .= |
$description); |
&Apache::lonrss::course_blog_link($id,$title, |
} else { |
$description); |
$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') { |
if ($env{'form.displayfilter'} eq 'containing') { |
my $wholeentry=$about_me_link.':'. |
my $wholeentry=$about_me_link.':'. |
Line 6327 sub parameter_releasecheck {
|
Line 6420 sub parameter_releasecheck {
|
return $needsnewer; |
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 |
# HANDLER |
################################################## |
################################################## |
Line 6375 sub handler {
|
Line 6508 sub handler {
|
'Parameter_Manager,Course_Environment,Parameter_Helper,Parameter_Overview,Table_Mode'}); |
'Parameter_Manager,Course_Environment,Parameter_Helper,Parameter_Overview,Table_Mode'}); |
|
|
# ----------------------------------------------------- Needs to be in a course |
# ----------------------------------------------------- Needs to be in a course |
my $parm_permission = |
my ($parm_permission,$allowed) = &get_permission(); |
(&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(); |
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 |
# Main switch on form.action and form.state, as appropriate |
# |
# |
# Check first if coming from someone else headed directly for |
# Check first if coming from someone else headed directly for |
# the table mode |
# the table mode |
if ((($env{'form.command'} eq 'set') && ($env{'form.url'}) |
if (($parm_permission->{'set'}) && |
&& (!$env{'form.dis'})) || ($env{'form.symb'})) { |
((($env{'form.command'} eq 'set') && ($env{'form.url'}) |
&assessparms($r); |
&& (!$env{'form.dis'})) || ($env{'form.symb'}))) { |
|
&assessparms($r,$parm_permission); |
} elsif (! exists($env{'form.action'})) { |
} elsif (! exists($env{'form.action'})) { |
&print_main_menu($r,$parm_permission); |
&print_main_menu($r,$parm_permission); |
|
} elsif (!$parm_permission->{$env{'form.action'}}) { |
|
&print_main_menu($r,$parm_permission); |
} elsif ($env{'form.action'} eq 'setoverview') { |
} elsif ($env{'form.action'} eq 'setoverview') { |
&overview($r); |
&overview($r,$parm_permission); |
} elsif ($env{'form.action'} eq 'addmetadata') { |
} elsif ($env{'form.action'} eq 'addmetadata') { |
&addmetafield($r); |
&addmetafield($r); |
} elsif ($env{'form.action'} eq 'ordermetadata') { |
} elsif ($env{'form.action'} eq 'ordermetadata') { |
Line 6401 sub handler {
|
Line 6534 sub handler {
|
} elsif ($env{'form.action'} eq 'setrestrictmeta') { |
} elsif ($env{'form.action'} eq 'setrestrictmeta') { |
&setrestrictmeta($r); |
&setrestrictmeta($r); |
} elsif ($env{'form.action'} eq 'newoverview') { |
} elsif ($env{'form.action'} eq 'newoverview') { |
&newoverview($r); |
&newoverview($r,$parm_permission); |
} elsif ($env{'form.action'} eq 'setdefaults') { |
} elsif ($env{'form.action'} eq 'setdefaults') { |
&defaultsetter($r); |
&defaultsetter($r); |
} elsif ($env{'form.action'} eq 'settable') { |
} elsif ($env{'form.action'} eq 'settable') { |
&assessparms($r); |
&assessparms($r,$parm_permission); |
} elsif ($env{'form.action'} eq 'parameterchangelog') { |
} elsif ($env{'form.action'} eq 'parameterchangelog') { |
&parm_change_log($r); |
&parm_change_log($r,$parm_permission); |
} elsif ($env{'form.action'} eq 'cleanparameters') { |
} elsif ($env{'form.action'} eq 'cleanparameters') { |
&clean_parameters($r); |
&clean_parameters($r); |
} elsif ($env{'form.action'} eq 'dateshift1') { |
} elsif ($env{'form.action'} eq 'dateshift1') { |