version 1.339, 2006/10/07 20:02:16
|
version 1.350.2.5, 2007/01/18 21:02:20
|
Line 65 use Apache::lonlocal;
|
Line 65 use Apache::lonlocal;
|
use Apache::lonnavmaps; |
use Apache::lonnavmaps; |
use Apache::longroup; |
use Apache::longroup; |
use Apache::lonrss; |
use Apache::lonrss; |
use LONCAPA; |
use LONCAPA qw(:DEFAULT :match); |
|
|
# --- Caches local to lonparmset |
# --- Caches local to lonparmset |
|
|
Line 122 sub parmval_by_symb {
|
Line 122 sub parmval_by_symb {
|
# load caches |
# load caches |
&cacheparmhash(); |
&cacheparmhash(); |
|
|
my $useropt=&Apache::lonnet::get_userresdata($uname,$udom); |
my $useropt; |
|
if ($uname ne '' && $udom ne '') { |
|
$useropt = &Apache::lonnet::get_userresdata($uname,$udom); |
|
} |
|
|
my $result=''; |
my $result=''; |
my @outpar=(); |
my @outpar=(); |
Line 173 sub parmval_by_symb {
|
Line 176 sub parmval_by_symb {
|
} |
} |
|
|
# ------------------------------------------------------ fourth, back to course |
# ------------------------------------------------------ fourth, back to course |
if (defined($csec)) { |
if ($csec ne '') { |
if (defined($$courseopt{$seclevel})) { |
if (defined($$courseopt{$seclevel})) { |
$outpar[9]=$$courseopt{$seclevel}; |
$outpar[9]=$$courseopt{$seclevel}; |
$result=9; |
$result=9; |
Line 189 sub parmval_by_symb {
|
Line 192 sub parmval_by_symb {
|
} |
} |
} |
} |
# ------------------------------------------------------ fifth, check course group |
# ------------------------------------------------------ fifth, check course group |
if (defined($cgroup)) { |
if ($cgroup ne '') { |
if (defined($$courseopt{$grplevel})) { |
if (defined($$courseopt{$grplevel})) { |
$outpar[6]=$$courseopt{$grplevel}; |
$outpar[6]=$$courseopt{$grplevel}; |
$result=6; |
$result=6; |
Line 206 sub parmval_by_symb {
|
Line 209 sub parmval_by_symb {
|
|
|
# ---------------------------------------------------------- fifth, check user |
# ---------------------------------------------------------- fifth, check user |
|
|
if (defined($uname)) { |
if ($uname ne '') { |
if (defined($$useropt{$courselevel})) { |
if (defined($$useropt{$courselevel})) { |
$outpar[3]=$$useropt{$courselevel}; |
$outpar[3]=$$useropt{$courselevel}; |
$result=3; |
$result=3; |
Line 269 sub resetrulescache {
|
Line 272 sub resetrulescache {
|
|
|
sub rulescache { |
sub rulescache { |
my $id=shift; |
my $id=shift; |
if ($rulesid ne $env{'request.course.id'}) { |
if ($rulesid ne $env{'request.course.id'} |
%rules=(); |
&& !defined($rules{$id})) { |
} |
|
unless (defined($rules{$id})) { |
|
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'}; |
%rules=&Apache::lonnet::dump('parmdefactions',$dom,$crs); |
%rules=&Apache::lonnet::dump('parmdefactions',$dom,$crs); |
Line 2193 sub crsenv {
|
Line 2194 sub crsenv {
|
' Tabloid [11x17 in], Executive [7 1/2x10 in], A2 [420x594 mm],'. |
' Tabloid [11x17 in], Executive [7 1/2x10 in], A2 [420x594 mm],'. |
' A3 [297x420 mm], A4 [210x297 mm], A5 [148x210 mm], A6 [105x148 mm])', |
' A3 [297x420 mm], A4 [210x297 mm], A5 [148x210 mm], A6 [105x148 mm])', |
'print_header_format' |
'print_header_format' |
=> '<b>Print header format; substitutions: %n student name %c course id %a assignment', |
=> '<b>Print header format; substitutions</b>: %n student name %c course id %a assignment note, numbers after the % limit the field size', |
'anonymous_quiz' |
'anonymous_quiz' |
=> '<b>'.&mt('Anonymous quiz/exam').'</b><br />'. |
=> '<b>'.&mt('Anonymous quiz/exam').'</b><br />'. |
' (<tt><b>'.&mt('yes').'</b> '.&mt('to avoid print students names').' </tt>)', |
' (<tt><b>'.&mt('yes').'</b> '.&mt('to avoid print students names').' </tt>)', |
Line 2363 sub readdata {
|
Line 2364 sub readdata {
|
|
|
my $classlist=&Apache::loncoursedata::get_classlist(); |
my $classlist=&Apache::loncoursedata::get_classlist(); |
foreach (keys %$classlist) { |
foreach (keys %$classlist) { |
# the following undefs are for 'domain', and 'username' respectively. |
if ($_=~/^($match_username)\:($match_domain)$/) { |
if ($_=~/^(\w+)\:(\w+)$/) { |
|
my ($tuname,$tudom)=($1,$2); |
my ($tuname,$tudom)=($1,$2); |
my $useropt=&Apache::lonnet::get_userresdata($tuname,$tudom); |
my $useropt=&Apache::lonnet::get_userresdata($tuname,$tudom); |
foreach my $userkey (keys %{$useropt}) { |
foreach my $userkey (keys %{$useropt}) { |
Line 2486 sub storedata {
|
Line 2486 sub storedata {
|
|
|
sub extractuser { |
sub extractuser { |
my $key=shift; |
my $key=shift; |
return ($key=~/^$env{'request.course.id'}.\[useropt\:(\w+)\:(\w+)\]\./); |
return ($key=~/^$env{'request.course.id'}.\[useropt\:($match_username)\:($match_domain)\]\./); |
} |
} |
|
|
sub listdata { |
sub listdata { |
Line 2544 sub listdata {
|
Line 2544 sub listdata {
|
my $section=&mt('All Students'); |
my $section=&mt('All Students'); |
if ($middle=~/^\[(.*)\]/) { |
if ($middle=~/^\[(.*)\]/) { |
my $issection=$1; |
my $issection=$1; |
if ($issection=~/^useropt\:(\w+)\:(\w+)/) { |
if ($issection=~/^useropt\:($match_username)\:($match_domain)/) { |
$section=&mt('User').": ".&Apache::loncommon::plainname($1,$2); |
$section=&mt('User').": ".&Apache::loncommon::plainname($1,$2); |
} else { |
} else { |
$section=&mt('Group/Section').': '.$issection; |
$section=&mt('Group/Section').': '.$issection; |
Line 2918 sub parse_key {
|
Line 2918 sub parse_key {
|
$data{'scope_type'} = 'all'; |
$data{'scope_type'} = 'all'; |
if ($middle=~/^\[(.*)\]/) { |
if ($middle=~/^\[(.*)\]/) { |
$data{'scope'} = $1; |
$data{'scope'} = $1; |
if ($data{'scope'}=~/^useropt\:(\w+)\:(\w+)/) { |
if ($data{'scope'}=~/^useropt\:($match_username)\:($match_domain)/) { |
$data{'scope_type'} = 'user'; |
$data{'scope_type'} = 'user'; |
$data{'scope'} = [$1,$2]; |
$data{'scope'} = [$1,$2]; |
} else { |
} else { |
Line 3189 ENDMAINFORMHEAD
|
Line 3189 ENDMAINFORMHEAD
|
### Set portfolio metadata |
### Set portfolio metadata |
sub output_row { |
sub output_row { |
my ($r, $field_name, $field_text, $added_flag) = @_; |
my ($r, $field_name, $field_text, $added_flag) = @_; |
|
my $row_class; |
my $output; |
my $output; |
my $options=$env{'course.'.$env{'request.course.id'}.'.metadata.'.$field_name.'.options'}; |
my $options=$env{'course.'.$env{'request.course.id'}.'.metadata.'.$field_name.'.options'}; |
my $values=$env{'course.'.$env{'request.course.id'}.'.metadata.'.$field_name.'.values'}; |
my $values=$env{'course.'.$env{'request.course.id'}.'.metadata.'.$field_name.'.values'}; |
Line 3197 sub output_row {
|
Line 3198 sub output_row {
|
$values = ''; |
$values = ''; |
} |
} |
if (!($options =~ /deleted/)) { |
if (!($options =~ /deleted/)) { |
$output.='<strong>'.$field_text.':</strong>'; |
$output = &Apache::loncommon::start_data_table_row(); |
$output.='<input name="'.$field_name.'_values" type="text" value="'.$values.'" size="80" /><br />'; |
$output .= '<td><span class="LC_metadata"><strong>'.$field_text.':</strong></span></td>'; |
|
# $output .= '<td><strong>'.$field_text.':</strong></td>'; |
|
$output .= '<td><span class="LC_metadata"><input name="'.$field_name.'_values" type="text" value="'.$values.'" size="80" /></span></td>'; |
|
$output .= &Apache::loncommon::end_data_table_row(); |
my @options= ( ['active', 'Show to student'], |
my @options= ( ['active', 'Show to student'], |
['onlyone','Student may select only one choice'], |
['onlyone','Student may select only one choice'], |
['stuadd', 'Student may type choices']); |
['stuadd', 'Student may type choices']); |
Line 3208 sub output_row {
|
Line 3211 sub output_row {
|
} |
} |
foreach my $opt (@options) { |
foreach my $opt (@options) { |
my $checked = ($options =~ m/$opt->[0]/) ? ' checked="checked" ' : '' ; |
my $checked = ($options =~ m/$opt->[0]/) ? ' checked="checked" ' : '' ; |
$output.=(' 'x5).'<label><input type="checkbox" name="'. |
$output .= &Apache::loncommon::continue_data_table_row(); |
|
$output .= '<td colspan="2">'.(' ' x 5).'<span class="LC_metadata"><label><input type="checkbox" name="'. |
$field_name.'_'.$opt->[0].'" value="yes"'.$checked.' />'. |
$field_name.'_'.$opt->[0].'" value="yes"'.$checked.' />'. |
&mt($opt->[1]).'</label> <br />'; |
&mt($opt->[1]).'</label></span> </td>'; |
|
$output .= &Apache::loncommon::end_data_table_row(); |
} |
} |
|
|
} |
} |
return ($output); |
return ($output); |
} |
} |
|
sub order_meta_fields { |
|
my ($r)=@_; |
|
my $idx = 1; |
|
my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
$r->print(&Apache::loncommon::start_page('Order Metadata Fields')); |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"/adm/parmset?action=setrestrictmeta", |
|
text=>"Restrict Metadata"}, |
|
{text=>"Order Metadata"}); |
|
$r->print(&Apache::lonhtmlcommon::breadcrumbs('Order Metadata')); |
|
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 $i; |
|
if ($newpos > $currentpos) { |
|
# moving stuff up |
|
for ($i=0;$i<$currentpos;$i++) { |
|
$neworder[$i]=$oldorder[$i]; |
|
} |
|
for ($i=$currentpos;$i<$newpos;$i++) { |
|
$neworder[$i]=$oldorder[$i+1]; |
|
} |
|
$neworder[$newpos]=$oldorder[$currentpos]; |
|
for ($i=$newpos+1;$i<=$#oldorder;$i++) { |
|
$neworder[$i]=$oldorder[$i]; |
|
} |
|
} else { |
|
# moving stuff down |
|
for ($i=0;$i<$newpos;$i++) { |
|
$neworder[$i]=$oldorder[$i]; |
|
} |
|
$neworder[$newpos]=$oldorder[$currentpos]; |
|
for ($i=$newpos+1;$i<$currentpos+1;$i++) { |
|
$neworder[$i]=$oldorder[$i-1]; |
|
} |
|
for ($i=$currentpos+1;$i<=$#oldorder;$i++) { |
|
$neworder[$i]=$oldorder[$i]; |
|
} |
|
} |
|
my $ordered_fields = join ",", @neworder; |
|
my $put_result = &Apache::lonnet::put('environment', |
|
{'metadata.addedorder'=>$ordered_fields},$dom,$crs); |
|
&Apache::lonnet::appenv('course.'.$env{'request.course.id'}.'.metadata.addedorder' => $ordered_fields); |
|
} |
|
my $fields = &get_added_meta_fieldnames(); |
|
my $ordered_fields; |
|
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) { |
|
push @fields_in_order, $key; |
|
$ordered_fields = join ",", @fields_in_order; |
|
} |
|
my $put_result = &Apache::lonnet::put('environment', |
|
{'metadata.addedorder'=>$ordered_fields},$dom,$crs); |
|
} |
|
$r->print('<table>'); |
|
my $num_fields = scalar(@fields_in_order); |
|
foreach my $key (@fields_in_order) { |
|
$r->print('<tr><td>'); |
|
$r->print('<form method="post" action="">'); |
|
$r->print('<select name="newpos" onChange="this.form.submit()">'); |
|
for (my $i = 1;$i le $num_fields;$i ++) { |
|
if ($i eq $idx) { |
|
$r->print('<option value="'.$i.'" SELECTED>('.$i.')</option>'); |
|
} else { |
|
$r->print('<option value="'.$i.'">'.$i.'</option>'); |
|
} |
|
} |
|
$r->print('</select></td><td>'); |
|
$r->print('<input type="hidden" name="currentpos" value="'.$idx.'" />'); |
|
$r->print('<input type="hidden" name="storeorder" value="true" />'); |
|
$r->print('</form>'); |
|
$r->print($$fields{$key}.'</td></tr>'); |
|
$idx ++; |
|
} |
|
$r->print('</table>'); |
|
return 'ok'; |
|
} |
sub addmetafield { |
sub addmetafield { |
my ($r)=@_; |
my ($r)=@_; |
$r->print(&Apache::loncommon::start_page('Add Metadata Field')); |
$r->print(&Apache::loncommon::start_page('Add Metadata Field')); |
Line 3222 sub addmetafield {
|
Line 3310 sub addmetafield {
|
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'}; |
if (exists($env{'form.undelete'})) { |
if (exists($env{'form.undelete'})) { |
my @meta_fields = &Apache::loncommon::get_env_multiple('form.undelete'); |
my @meta_fields = &Apache::loncommon::get_env_multiple('form.undeletefield'); |
foreach my $meta_field(@meta_fields) { |
foreach my $meta_field(@meta_fields) { |
my $options = $env{'course.'.$env{'request.course.id'}.'.metadata.'.$meta_field.'.options'}; |
my $options = $env{'course.'.$env{'request.course.id'}.'.metadata.'.$meta_field.'.options'}; |
$options =~ s/deleted//; |
$options =~ s/deleted//; |
Line 3251 sub addmetafield {
|
Line 3339 sub addmetafield {
|
$r->print('You may undelete previously deleted fields.<br />Check those you wish to undelete and click Undelete.<br />'); |
$r->print('You may undelete previously deleted fields.<br />Check those you wish to undelete and click Undelete.<br />'); |
$r->print('<form method="post" action="">'); |
$r->print('<form method="post" action="">'); |
foreach my $key(keys(%$fields)) { |
foreach my $key(keys(%$fields)) { |
$r->print('<input type="checkbox" name="undelete" value="'.$key.'" />'.$$fields{$key}.'<br /'); |
$r->print('<input type="checkbox" name="undeletefield" value="'.$key.'" />'.$$fields{$key}.'<br /'); |
} |
} |
$r->print('<input type="submit" name="undelete" value="Undelete" />'); |
$r->print('<input type="submit" name="undelete" value="Undelete" />'); |
$r->print('</form>'); |
$r->print('</form>'); |
Line 3310 sub setrestrictmeta {
|
Line 3398 sub setrestrictmeta {
|
my %metadata_fields = &Apache::lonmeta::fieldnames('portfolio'); |
my %metadata_fields = &Apache::lonmeta::fieldnames('portfolio'); |
# Now get possible added metadata fields |
# Now get possible added metadata fields |
my $added_metadata_fields = &get_added_meta_fieldnames(\%metadata_fields); |
my $added_metadata_fields = &get_added_meta_fieldnames(\%metadata_fields); |
|
my $row_alt = 1; |
|
$output .= &Apache::loncommon::start_data_table(); |
foreach my $field (sort(keys(%metadata_fields))) { |
foreach my $field (sort(keys(%metadata_fields))) { |
if ($field ne 'courserestricted') { |
if ($field ne 'courserestricted') { |
|
$row_alt = $row_alt ? 0 : 1; |
$output.= &output_row($r, $field, $metadata_fields{$field}); |
$output.= &output_row($r, $field, $metadata_fields{$field}); |
} |
} |
} |
} |
my $added_flag = 1; |
my $added_flag = 1; |
foreach my $field (sort(keys(%$added_metadata_fields))) { |
foreach my $field (sort(keys(%$added_metadata_fields))) { |
$output.= &output_row($r, $field, $$added_metadata_fields{$field},$added_flag); |
$row_alt = $row_alt ? 0 : 1; |
|
$output.= &output_row($r, $field, $$added_metadata_fields{$field},$added_flag, $row_alt); |
} |
} |
|
$output .= &Apache::loncommon::end_data_table(); |
$r->print(<<ENDenv); |
$r->print(<<ENDenv); |
<form method="post" action="/adm/parmset?action=setrestrictmeta" name="form"> |
<form method="post" action="/adm/parmset?action=setrestrictmeta" name="form"> |
<p> |
|
$output |
$output |
<input type="submit" name="restrictmeta" value="Update Metadata Restrictions"> |
<input type="submit" name="restrictmeta" value="Update Metadata Restrictions" /> |
</form><br /> |
</form><br /> |
<form method="post" action="/adm/parmset?action=addmetadata" name="form"> |
<form method="post" action="/adm/parmset?action=addmetadata" name="form1"> |
<input type="submit" name="restrictmeta" value="Add a Metadata Field"> |
<input type="submit" name="restrictmeta" value="Add a Metadata Field" /> |
|
</form> |
|
<br /> |
|
<form method="post" action="/adm/parmset?action=ordermetadata" name="form2"> |
|
<input type="submit" name="restrictmeta" value="Order Metadata Fields" /> |
</form> |
</form> |
ENDenv |
ENDenv |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
Line 3335 ENDenv
|
Line 3431 ENDenv
|
################################################## |
################################################## |
sub get_added_meta_fieldnames { |
sub get_added_meta_fieldnames { |
my %fields; |
my %fields; |
my ($default_fields) = @_; |
|
foreach my $key(%env) { |
foreach my $key(%env) { |
if ($key =~ m/\.metadata\.(.+)\.added$/) { |
if ($key =~ m/\.metadata\.(.+)\.added$/) { |
my $field_name = $1; |
my $field_name = $1; |
Line 3611 sub parm_change_log {
|
Line 3706 sub parm_change_log {
|
\%saveable_parameters); |
\%saveable_parameters); |
&Apache::loncommon::restore_course_settings('parameter_log', |
&Apache::loncommon::restore_course_settings('parameter_log', |
\%saveable_parameters); |
\%saveable_parameters); |
if (!$env{'form.show'}) { $env{'form.show'}=10; } |
$r->print(&Apache::loncommon::display_filter(). |
|
|
my $countselect = |
|
&Apache::lonmeta::selectbox('show',$env{'form.show'},undef, |
|
(&mt('all'),10,20,50,100,1000,10000)); |
|
|
|
$r->print('<nobr>'.&mt('[_1] Records',$countselect).'</nobr>'. |
|
'<label>'.&Apache::lonhtmlcommon::checkbox('includetypes',$env{'form.includetypes'},'1'). |
'<label>'.&Apache::lonhtmlcommon::checkbox('includetypes',$env{'form.includetypes'},'1'). |
' '.&mt('Include parameter types').'</label>'. |
' '.&mt('Include parameter types').'</label>'. |
'<input type="submit" value="'.&mt('Display').'" /></form>'); |
'<input type="submit" value="'.&mt('Display').'" /></form>'); |
Line 3629 sub parm_change_log {
|
Line 3718 sub parm_change_log {
|
&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><th>'.&mt('Announce').'</th>'. |
&Apache::loncommon::end_data_table_header_row()); |
&Apache::loncommon::end_data_table_header_row()); |
my $shown=0; |
my $shown=0; |
foreach my $id (sort { $parmlog{$b}{'exe_time'}<=>$parmlog{$a}{'exe_time'} } (keys(%parmlog))) { |
my $folder=''; |
|
if ($env{'form.displayfilter'} eq 'currentfolder') { |
|
my $last=''; |
|
if (tie(my %hash,'GDBM_File',$env{'request.course.fn'}.'_symb.db', |
|
&GDBM_READER(),0640)) { |
|
$last=$hash{'last_known'}; |
|
untie(%hash); |
|
} |
|
if ($last) { ($folder) = &Apache::lonnet::decode_symb($last); } |
|
} |
|
foreach my $id (sort |
|
{ |
|
if ($parmlog{$b}{'exe_time'} ne $parmlog{$a}{'exe_time'}) { |
|
return $parmlog{$b}{'exe_time'} <=>$parmlog{$a}{'exe_time'} |
|
} |
|
my $aid = (split('00000',$a))[-1]; |
|
my $bid = (split('00000',$b))[-1]; |
|
return $bid<=>$aid; |
|
} (keys(%parmlog))) { |
my @changes=keys(%{$parmlog{$id}{'logentry'}}); |
my @changes=keys(%{$parmlog{$id}{'logentry'}}); |
my $count = 0; |
my $count = 0; |
my $time = |
my $time = |
Line 3650 sub parm_change_log {
|
Line 3757 sub parm_change_log {
|
$parmlog{$id}{'exe_udom'}); |
$parmlog{$id}{'exe_udom'}); |
} |
} |
my $row_start=&Apache::loncommon::start_data_table_row(); |
my $row_start=&Apache::loncommon::start_data_table_row(); |
$r->print($row_start); |
|
my $makenewrow=0; |
my $makenewrow=0; |
my %istype=(); |
my %istype=(); |
my $output; |
my $output; |
Line 3660 sub parm_change_log {
|
Line 3766 sub parm_change_log {
|
!exists($parmlog{$id}{'logentry'}{$changed.'.type'})); |
!exists($parmlog{$id}{'logentry'}{$changed.'.type'})); |
my ($realm,$section,$parmname,$part,$what,$middle,$uname,$udom,$issection,$realmdescription)= |
my ($realm,$section,$parmname,$part,$what,$middle,$uname,$udom,$issection,$realmdescription)= |
&components($changed,$parmlog{$id}{'uname'},$parmlog{$id}{'udom'},undef,undef,$typeflag); |
&components($changed,$parmlog{$id}{'uname'},$parmlog{$id}{'udom'},undef,undef,$typeflag); |
|
if ($env{'form.displayfilter'} eq 'currentfolder') { |
|
if ($folder) { |
|
if ($middle!~/^\Q$folder\E/) { next; } |
|
} |
|
} |
if ($typeflag) { |
if ($typeflag) { |
$istype{$parmname}=$value; |
$istype{$parmname}=$value; |
if (!$env{'form.includetypes'}) { next; } |
if (!$env{'form.includetypes'}) { next; } |
Line 3712 sub parm_change_log {
|
Line 3823 sub parm_change_log {
|
} |
} |
$output .= '</td>'.&Apache::loncommon::end_data_table_row(); |
$output .= '</td>'.&Apache::loncommon::end_data_table_row(); |
} |
} |
$r->print('<td rowspan="'.$count.'">'.$time.'</td> |
if ($env{'form.displayfilter'} eq 'containing') { |
|
my $wholeentry=$about_me_link.':'. |
|
$parmlog{$id}{'exe_uname'}.':'.$parmlog{$id}{'exe_udom'}.':'. |
|
$output; |
|
if ($wholeentry!~/\Q$env{'form.containingphrase'}\E/i) { next; } |
|
} |
|
if ($count) { |
|
$r->print($row_start.'<td rowspan="'.$count.'">'.$time.'</td> |
<td rowspan="'.$count.'">'.$about_me_link. |
<td rowspan="'.$count.'">'.$about_me_link. |
'<br /><tt>'.$parmlog{$id}{'exe_uname'}. |
'<br /><tt>'.$parmlog{$id}{'exe_uname'}. |
':'.$parmlog{$id}{'exe_udom'}.'</tt>'. |
':'.$parmlog{$id}{'exe_udom'}.'</tt>'. |
$send_msg_link.'</td>'.$output); |
$send_msg_link.'</td>'.$output); |
|
$shown++; |
$shown++; |
} |
if (!($env{'form.show'} eq &mt('all') |
if (!($env{'form.show'} eq &mt('all') |
|| $shown<=$env{'form.show'})) { last; } |
|| $shown<=$env{'form.show'})) { last; } |
} |
} |
Line 3726 sub parm_change_log {
|
Line 3844 sub parm_change_log {
|
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
} |
} |
|
|
|
sub check_for_course_info { |
|
my $navmap = Apache::lonnavmaps::navmap->new(); |
|
return 1 if ($navmap); |
|
return 0; |
|
} |
|
|
################################################## |
################################################## |
################################################## |
################################################## |
|
|
Line 3769 sub handler {
|
Line 3893 sub handler {
|
(&Apache::lonnet::allowed('opa',$env{'request.course.id'}) || |
(&Apache::lonnet::allowed('opa',$env{'request.course.id'}) || |
&Apache::lonnet::allowed('opa',$env{'request.course.id'}.'/'. |
&Apache::lonnet::allowed('opa',$env{'request.course.id'}.'/'. |
$env{'request.course.sec'})); |
$env{'request.course.sec'})); |
if ($env{'request.course.id'} && $parm_permission) { |
my $exists = &check_for_course_info(); |
|
|
|
if ($env{'request.course.id'} && $parm_permission && $exists) { |
|
|
# Start Page |
# Start Page |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
Line 3807 sub handler {
|
Line 3933 sub handler {
|
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=addmetadata', |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=addmetadata', |
text=>"Add Metadata Field"}); |
text=>"Add Metadata Field"}); |
&addmetafield($r); |
&addmetafield($r); |
|
} elsif ($env{'form.action'} eq 'ordermetadata' && $parm_permission) { |
|
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=addmetadata', |
|
text=>"Add Metadata Field"}); |
|
&order_meta_fields($r); |
} elsif ($env{'form.action'} eq 'setrestrictmeta' && $parm_permission) { |
} elsif ($env{'form.action'} eq 'setrestrictmeta' && $parm_permission) { |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setrestrictmeta', |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setrestrictmeta', |
text=>"Restrict Metadata"}); |
text=>"Restrict Metadata"}); |
Line 3835 sub handler {
|
Line 3965 sub handler {
|
} |
} |
} else { |
} else { |
# ----------------------------- Not in a course, or not allowed to modify parms |
# ----------------------------- Not in a course, or not allowed to modify parms |
$env{'user.error.msg'}= |
if ($exists) { |
"/adm/parmset:opa:0:0:Cannot modify assessment parameters"; |
$env{'user.error.msg'}= |
|
"/adm/parmset:opa:0:0:Cannot modify assessment parameters"; |
|
} else { |
|
$env{'user.error.msg'}= |
|
"/adm/parmset::0:1:Course environment gone, reinitialize the course"; |
|
} |
return HTTP_NOT_ACCEPTABLE; |
return HTTP_NOT_ACCEPTABLE; |
} |
} |
return OK; |
return OK; |