version 1.284, 2006/04/13 20:54:35
|
version 1.287, 2006/04/14 16:38:43
|
Line 396 sub storeparm_by_symb {
|
Line 396 sub storeparm_by_symb {
|
|
|
{ |
{ |
my $logid; |
my $logid; |
sub logparmset { |
sub log_parmset { |
my ($symb,$spnam,$snum,$nval,$ntype,$uname,$udom,$csec,$cgroup)=@_; |
my ($symb,$spnam,$snum,$nval,$ntype,$uname,$udom,$csec,$cgroup)=@_; |
$logid++; |
$logid++; |
my $id=time.'00000'.$$.'00000'.$logid; |
my $id=time().'00000'.$$.'00000'.$logid; |
&Apache::lonnet::put('parameterlog',{ |
&Apache::lonnet::put('nohist_parameterlog', |
$id.'_exe_uname' => $env{'user.name'}, |
{ |
$id.'_exe_udom' => $env{'user.domain'}, |
$id.'_exe_uname' => $env{'user.name'}, |
$id.'_exe_time' => time, |
$id.'_exe_udom' => $env{'user.domain'}, |
$id.'_exe_ip' => $ENV{'REMOTE_ADDR'}, |
$id.'_exe_time' => time(), |
$id.'_symb' => $symb, |
$id.'_exe_ip' => $ENV{'REMOTE_ADDR'}, |
$id.'_spnam' => $spnam, |
$id.'_symb' => $symb, |
$id.'_snum' => $snum, |
$id.'_spnam' => $spnam, |
$id.'_nval' => $nval, |
$id.'_snum' => $snum, |
$id.'_ntype' => $ntype, |
$id.'_nval' => $nval, |
$id.'_uname' => $uname, |
$id.'_ntype' => $ntype, |
$id.'_udom' => $udom, |
$id.'_uname' => $uname, |
$id.'_csec' => $csec, |
$id.'_udom' => $udom, |
$id.'_cgroup' => $cgroup}, |
$id.'_csec' => $csec, |
|
$id.'_cgroup' => $cgroup |
|
}, |
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
$env{'course.'.$env{'request.course.id'}.'.num'} |
$env{'course.'.$env{'request.course.id'}.'.num'} |
); |
); |
Line 423 sub storeparm_by_symb {
|
Line 425 sub storeparm_by_symb {
|
sub storeparm_by_symb_inner { |
sub storeparm_by_symb_inner { |
# ---------------------------------------------------------- Get symb, map, etc |
# ---------------------------------------------------------- Get symb, map, etc |
my ($symb,$spnam,$snum,$nval,$ntype,$uname,$udom,$csec,$cgroup)=@_; |
my ($symb,$spnam,$snum,$nval,$ntype,$uname,$udom,$csec,$cgroup)=@_; |
&logparmset(@_); |
&log_parmset(@_); |
# ---------------------------------------------------------- Construct prefixes |
# ---------------------------------------------------------- Construct prefixes |
$spnam=~s/\_([^\_]+)$/\.$1/; |
$spnam=~s/\_([^\_]+)$/\.$1/; |
my $map=(&Apache::lonnet::decode_symb($symb))[0]; |
my $map=(&Apache::lonnet::decode_symb($symb))[0]; |
Line 3314 ENDYESNO
|
Line 3316 ENDYESNO
|
return; |
return; |
} |
} |
|
|
sub parmchangelog { |
sub parm_change_log { |
my ($r)=@_; |
my ($r)=@_; |
&startpage($r); |
&startpage($r); |
|
|
|
my @ids=(); |
|
my %symbp=(); |
|
my %mapp=(); |
|
my %typep=(); |
|
my %keyp=(); |
|
my %uris=(); |
|
my %maptitles=(); |
|
|
|
# -------------------------------------------------------- Variable declaration |
|
|
|
my %allmaps=(); |
|
my %alllevs=(); |
|
|
|
my $uname; |
|
my $udom; |
|
my $uhome; |
|
my $csec; |
|
my $cgroup; |
|
my $grouplist; |
|
my @usersgroups = (); |
|
|
|
my $coursename=$env{'course.'.$env{'request.course.id'}.'.description'}; |
|
|
|
$alllevs{'Resource Level'}='full'; |
|
$alllevs{'Map/Folder Level'}='map'; |
|
$alllevs{'Course Level'}='general'; |
|
|
|
my %allparms; |
|
my %allparts; |
|
my %keyorder; |
|
# --------------------------------------------------------- Get all assessments |
|
&extractResourceInformation(\@ids, \%typep,\%keyp, \%allparms, \%allparts, \%allmaps, |
|
\%mapp, \%symbp,\%maptitles,\%uris, |
|
\%keyorder); |
|
|
|
$mapp{'0.0'} = ''; |
|
$symbp{'0.0'} = ''; |
|
|
|
my %level=&Apache::lonlocal::texthash('parmlevel_14' => 'General Course', |
|
'parmlevel_13' => 'Map or Folder level in course', |
|
'parmlevel_12' => 'Resource default', |
|
'parmlevel_11' => 'Map default', |
|
'parmlevel_10' => 'Resource level in course', |
|
'parmlevel_9' => 'General for section', |
|
'parmlevel_8' => 'Map or Folder level for section', |
|
'parmlevel_7' => 'Resource level in section', |
|
'parmlevel_6' => 'General for group', |
|
'parmlevel_5' => 'Map or Folder level for group', |
|
'parmlevel_4' => 'Resource level in group', |
|
'parmlevel_3' => 'General for specific student', |
|
'parmlevel_2' => 'Map or Folder level for specific student', |
|
'parmlevel_1' => 'Resource level for specific student'); |
|
|
|
# $id.'_exe_uname' => $env{'user.name'}, |
|
# $id.'_exe_udom' => $env{'user.domain'}, |
|
# $id.'_exe_time' => time(), |
|
# $id.'_exe_ip' => $ENV{'REMOTE_ADDR'}, |
|
# $id.'_symb' => $symb, |
|
# $id.'_spnam' => $spnam, |
|
# $id.'_snum' => $snum, |
|
# $id.'_nval' => $nval, |
|
# $id.'_ntype' => $ntype, |
|
# $id.'_uname' => $uname, |
|
# $id.'_udom' => $udom, |
|
# $id.'_csec' => $csec, |
|
# $id.'_cgroup' => $cgroup |
|
my %parmlog=&Apache::lonnet::dump('nohist_parameterlog', |
|
$env{'course.'.$env{'request.course.id'}.'.domain'}, |
|
$env{'course.'.$env{'request.course.id'}.'.num'}); |
|
my %exetime=(); |
|
foreach my $key (keys(%parmlog)) { |
|
if ($key=~/^(.+)\_exe\_time$/) { |
|
$exetime{$1}=$parmlog{$key}; |
|
} |
|
} |
|
$r->print('<table border="2">'); |
|
foreach my $id (sort { $exetime{$a}<=>$exetime{$b} } (keys(%exetime))) { |
|
my ($part,$name)=($parmlog{$id.'_spnam'}=~/^(.*)[\_\.]([^\_\.]+)$/); |
|
my $spnam=$part.'_'.$name; |
|
$r->print('<tr><td>'. |
|
&Apache::lonlocal::locallocaltime($parmlog{$id.'_exe_time'}). |
|
'</td><td>'. |
|
&Apache::loncommon::aboutmewrapper( |
|
&Apache::loncommon::plainname($parmlog{$id.'_exe_uname'}, |
|
$parmlog{$id.'_exe_udom'}), |
|
$parmlog{$id.'_exe_uname'}, |
|
$parmlog{$id.'_exe_udom'}).'<br /><tt>'. |
|
$parmlog{$id.'_exe_uname'}.':'.$parmlog{$id.'_exe_udom'}.'</tt>'. |
|
((($parmlog{$id.'_exe_uname'} ne $env{'user.name'}) || |
|
($parmlog{$id.'_exe_udom'} ne $env{'user.domain'}))? |
|
'<br />'.&Apache::loncommon::messagewrapper(&mt('Send message'), |
|
$parmlog{$id.'_exe_uname'}, |
|
$parmlog{$id.'_exe_udom'}):''). |
|
'</td><td>'. |
|
$level{'parmlevel_'.$parmlog{$id.'_snum'}}. |
|
'</td><td>'. |
|
&mt($allparms{$name}).'<br /><tt>'.$name.'</tt>'. |
|
'</td><td>'. |
|
($part?&mt('Part: [_1]',$part):&mt('All parts')). |
|
'</td><td>'. |
|
$parmlog{$id.'_symb'}. |
|
'</td><td>'. |
|
($parmlog{$id.'_nval'}? |
|
(&isdateparm($spnam)?&Apache::lonlocal::locallocaltime($parmlog{$id.'_nval'}):$parmlog{$id.'_nval'}) |
|
:&mt('Deleted Parameter')). |
|
'</td></tr>'); |
|
} |
|
$r->print('</table>'); |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
} |
} |
|
|
Line 3415 sub handler {
|
Line 3526 sub handler {
|
} elsif ($env{'form.action'} eq 'parameterchangelog' && $parm_permission) { |
} elsif ($env{'form.action'} eq 'parameterchangelog' && $parm_permission) { |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=settable', |
&Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=settable', |
text=>"Parameter Change Log and Course Blog Posting"}); |
text=>"Parameter Change Log and Course Blog Posting"}); |
&parmchangelog($r); |
&parm_change_log($r); |
} |
} |
} else { |
} else { |
# ----------------------------- Not in a course, or not allowed to modify parms |
# ----------------------------- Not in a course, or not allowed to modify parms |