--- loncom/interface/lonparmset.pm 2009/05/08 22:47:01 1.445 +++ loncom/interface/lonparmset.pm 2009/05/12 10:54:11 1.446 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.445 2009/05/08 22:47:01 neumanie Exp $ +# $Id: lonparmset.pm,v 1.446 2009/05/12 10:54:11 bisitz Exp $ # # Copyright Michigan State University Board of Trustees # @@ -366,7 +366,7 @@ sub parmval_by_symb { my $result=''; my @outpar=(); # ----------------------------------------------------- Cascading lookup scheme - my $map=(&Apache::lonnet::decode_symb($symb))[0]; + my $map=(&Apache::lonnet::decode_symb($symb))[0]; $map = &Apache::lonnet::deversion($map); my $symbparm=$symb.'.'.$what; @@ -468,7 +468,7 @@ sub parmval_by_symb { # --- Caches local to lonparmset - + sub reset_caches { &resetparmhash(); &resetsymbcache(); @@ -482,7 +482,7 @@ sub reset_caches { undef($parmhashid); undef(%parmhash); } - + sub cacheparmhash { if ($parmhashid eq $env{'request.course.fn'}) { return; } my %parmhashfile; @@ -493,7 +493,7 @@ sub reset_caches { $parmhashid=$env{'request.course.fn'}; } } - + sub parmhash { my ($id) = @_; &cacheparmhash(); @@ -501,14 +501,14 @@ sub reset_caches { } } -{ +{ my $symbsid; my %symbs; sub resetsymbcache { undef($symbsid); undef(%symbs); } - + sub symbcache { my $id=shift; if ($symbsid ne $env{'request.course.id'}) { @@ -529,14 +529,14 @@ sub reset_caches { } } -{ +{ my $rulesid; my %rules; sub resetrulescache { undef($rulesid); undef(%rules); } - + sub rulescache { my $id=shift; if ($rulesid ne $env{'request.course.id'} @@ -683,7 +683,7 @@ sub storeparm_by_symb_inner { my ($symb,$spnam,$snum,$nval,$ntype,$uname,$udom,$csec,$cgroup)=@_; # ---------------------------------------------------------- Construct prefixes $spnam=~s/\_([^\_]+)$/\.$1/; - my $map=(&Apache::lonnet::decode_symb($symb))[0]; + my $map=(&Apache::lonnet::decode_symb($symb))[0]; $map = &Apache::lonnet::deversion($map); my $symbparm=$symb.'.'.$spnam; @@ -696,11 +696,11 @@ sub storeparm_by_symb_inner { my $seclevel=$env{'request.course.id'}.'.['.$csec.'].'.$spnam; my $seclevelr=$env{'request.course.id'}.'.['.$csec.'].'.$symbparm; my $seclevelm=$env{'request.course.id'}.'.['.$csec.'].'.$mapparm; - + my $courselevel=$env{'request.course.id'}.'.'.$spnam; my $courselevelr=$env{'request.course.id'}.'.'.$symbparm; my $courselevelm=$env{'request.course.id'}.'.'.$mapparm; - + my $storeunder=''; if (($snum==14) || ($snum==3)) { $storeunder=$courselevel; } if (($snum==13) || ($snum==2)) { $storeunder=$courselevelm; } @@ -712,7 +712,7 @@ sub storeparm_by_symb_inner { if ($snum==5) { $storeunder=$grplevelm; } if ($snum==4) { $storeunder=$grplevelr; } - + my $delete; if ($nval eq '') { $delete=1;} my %storecontent = ($storeunder => $nval, @@ -769,7 +769,7 @@ sub storeparm_by_symb_inner { } &Apache::lonnet::devalidateuserresdata($uname,$udom); } - + if ($reply=~/^error\:(.*)/) { return "Write Error: $1"; } @@ -926,11 +926,11 @@ sub startpage { text=>"Table Mode", help => 'Course_Setting_Parameters'}); } - my $start_page = + my $start_page = &Apache::loncommon::start_page('Set/Modify Course Parameters', &page_js(), {'add_entries' => \%loaditems,}); - my $breadcrumbs = + my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Table Mode Parameter Setting','Table_Mode'); $r->print(<0;$i--) { - if ($typeoutpar[$i]) { + if ($typeoutpar[$i]) { $cascadetype=$typeoutpar[$i]; } else { $typeoutpar[$i]=$cascadetype; @@ -981,7 +981,7 @@ sub print_row { $parm.='
'.&mt('Automatically sets').' '.join(', ',split(/\:/,$automatic)).'
'; } $r->print(''.$parm.''); - + my $thismarker=$which; $thismarker=~s/^parameter\_//; my $mprefix=$rid.'&'.$thismarker.'&'; @@ -995,9 +995,9 @@ sub print_row { } elsif ($cgroup) { &print_td($r,6,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); } elsif ($csec) { - &print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); + &print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); } else { - &print_td($r,14,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); + &print_td($r,14,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); } } elsif ($parmlev eq 'map') { @@ -1034,7 +1034,7 @@ sub print_row { &print_td($r,12,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); &print_td($r,11,'#FFDDDD',$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); &print_td($r,10,$defbgone,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); - + if ($csec) { &print_td($r,9,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); &print_td($r,8,$defbgtwo,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); @@ -1046,7 +1046,7 @@ sub print_row { &print_td($r,5,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); &print_td($r,4,$defbgthree,$result,\@outpar,$mprefix,$_,\@typeoutpar,$display); } - + if ($uname) { if ($othergrp) { $r->print($othergrp); @@ -1107,7 +1107,7 @@ sub print_usergroups { $courseopt); my $bgcolor = $defbg; my $grp_parm; - if (($coursereply) && ($cgroup ne $resultgroup)) { + if (($coursereply) && ($cgroup ne $resultgroup)) { if ($result > 3) { $bgcolor = '#AAFFAA'; $grp_parm = &valout($coursereply,$resulttype); @@ -1221,14 +1221,14 @@ sub extractResourceInformation { } # # Put in order -# +# unless ($$keyorder{$key}) { $$keyorder{$key}=$keyordercnt; $keyordercnt++; } } - + if (!exists($$mapp{$mapid})) { $$mapp{$id}= &Apache::lonnet::declutter($resource->enclosing_map_src()); @@ -1238,7 +1238,7 @@ sub extractResourceInformation { $$maptitles{$mapid}=&mt('Main Course Documents'); } else { $$maptitles{$mapid}= - &Apache::lonnet::gettitle($$mapp{$id}); + &Apache::lonnet::gettitle($$mapp{$id}); } $$maptitles{$$mapp{$id}}=$$maptitles{$mapid}; $$symbp{$mapid}=$$mapp{$id}.'___(all)'; @@ -1296,7 +1296,7 @@ sub parmmenu { checkthis('contentopen','pscat'); checkthis('contentclose','pscat'); } - + function checkvisi() { checkthis('hiddenresource','pscat'); @@ -1321,7 +1321,7 @@ sub parmmenu { ENDSCRIPT - $r->print(); + $r->print(); $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parameters to View'))); $r->print("\n".''); my $cnt=0; @@ -1383,8 +1383,8 @@ ENDSCRIPT } sub partmenu { - my ($r,$allparts,$psprt)=@_; - + my ($r,$allparts,$psprt)=@_; + $r->print(''); + $r->print(''); } sub usermenu { @@ -1419,7 +1419,7 @@ sub usermenu { my $g_s_header=''; my $g_s_footer=''; - + if (%sectionhash) { $sections=&mt('Section:').' print(&Apache::lonhtmlcommon::row_title(&mt('Group/Section'))); - $r->print($sections.$groups); + $r->print(&Apache::lonhtmlcommon::row_title(&mt('Group/Section'))); + $r->print($sections.$groups); } - - $r->print(&Apache::lonhtmlcommon::row_title(&mt('User'))); + + $r->print(&Apache::lonhtmlcommon::row_title(&mt('User'))); $r->print(&mt('For User [_1] or Student/Employee ID [_2] at Domain [_3]' ,'' ,' ' - ,$chooseopt)); + ,$chooseopt)); } sub displaymenu { @@ -1503,7 +1503,7 @@ sub displaymenu { $r->print('

Step 2

'); $r->print('
' ); $r->print(&Apache::lonhtmlcommon::start_pick_box()); - + &parmmenu($r,$allparms,$pscat,$keyorder); $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View'))); &partmenu($r,$allparts,$psprt); @@ -1512,8 +1512,8 @@ sub displaymenu { } sub mapmenu { - my ($r,$allmaps,$pschp,$maptitles)=@_; - + my ($r,$allmaps,$pschp,$maptitles)=@_; + $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Enclosing Map or Folder'))); $r->print('"); - + } sub levelmenu { - my ($r,$alllevs,$parmlev)=@_; - + my ($r,$alllevs,$parmlev)=@_; + $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parameter Level').&Apache::loncommon::help_open_topic('Course_Parameter_Levels'))); $r->print('"); + $r->print(""); } @@ -1674,7 +1674,7 @@ sub assessparms { my $csec; my $cgroup; my @usersgroups = (); - + my $coursename=$env{'course.'.$env{'request.course.id'}.'.description'}; $alllevs{'Resource Level'}='full'; @@ -1711,7 +1711,7 @@ sub assessparms { my $pssymb=''; my $parmlev=''; - + unless ($env{'form.parmlev'}) { $parmlev = 'map'; } else { @@ -1762,7 +1762,7 @@ sub assessparms { } else { $csec=&Apache::lonnet::getsection($udom,$uname, $env{'request.course.id'}); - + if ($csec eq '-1') { $message=''. &mt("User")." '$uname' ".&mt("at domain")." '$udom' ". @@ -1792,7 +1792,7 @@ sub assessparms { unless ($cgroup) { $cgroup=''; } # --------------------------------------------------------- Get all assessments - &extractResourceInformation(\@ids, \%typep,\%keyp, \%allparms, \%allparts, \%allmaps, + &extractResourceInformation(\@ids, \%typep,\%keyp, \%allparms, \%allparts, \%allmaps, \%mapp, \%symbp,\%maptitles,\%uris, \%keyorder); @@ -1848,7 +1848,7 @@ sub assessparms { } #----------------------------------------------- if all selected, fill in array if ($pscat[0] eq "all") {@pscat = (keys %allparms);} - if (!@pscat) { @pscat=('duedate','opendate','answerdate','weight','maxtries') }; + if (!@pscat) { @pscat=('duedate','opendate','answerdate','weight','maxtries') }; if ($psprt[0] eq "all" || !@psprt) {@psprt = (keys %allparts);} # ------------------------------------------------------------------ Start page @@ -1860,21 +1860,21 @@ sub assessparms { &HTML::Entities::encode($env{'form.recent_'.$_},'"&<>'). '" name="recent_'.$_.'" />'); } - + if (!$pssymb) { - + $r->print('
'); $r->print('

Step 1

'); $r->print('
' ); $r->print(&Apache::lonhtmlcommon::start_pick_box()); - + &levelmenu($r,\%alllevs,$parmlev); - - if ($parmlev ne 'general') { - &mapmenu($r,\%allmaps,$pschp,\%maptitles); + + if ($parmlev ne 'general') { + &mapmenu($r,\%allmaps,$pschp,\%maptitles); } - - $r->print(&Apache::lonhtmlcommon::end_pick_box()); + + $r->print(&Apache::lonhtmlcommon::end_pick_box()); $r->print('
'); &displaymenu($r,\%allparms,\%allparts,\@pscat,\@psprt,\%keyorder); @@ -1891,7 +1891,7 @@ sub assessparms { $r->print('
' ); $r->print(&Apache::lonhtmlcommon::start_pick_box()); &usermenu($r,$uname,$id,$udom,$csec,$cgroup,$parmlev,\@usersgroups); - + $r->print(&Apache::lonhtmlcommon::end_pick_box()); $r->print('
'); @@ -1918,8 +1918,8 @@ sub assessparms { my $userspan=3; if ($cgroup ne '') { $coursespan += 3; - } - + } + $r->print('

'); $r->print(''); $r->print(''); @@ -1995,7 +1995,7 @@ ENDTABLEHEADFOUR my $rid=$_; my ($inmapid)=($rid=~/\.(\d+)$/); - if ((!$pssymb && + if ((!$pssymb && (($pschp eq 'all') || ($allmaps{$pschp} eq $mapp{$rid}))) || ($pssymb && $pssymb eq $symbp{$rid})) { @@ -2100,7 +2100,7 @@ ENDTABLEHEADFOUR my %maplist; if ($pschp eq 'all') { - %maplist = %allmaps; + %maplist = %allmaps; } else { %maplist = ($pschp => $mapp{$pschp}); } @@ -2120,11 +2120,11 @@ ENDTABLEHEADFOUR my $map = 0; # $r->print("Catmarker: @catmarker
\n"); - + foreach (@ids) { ($map)=(/([\d]*?)\./); my $rid = $_; - + # $r->print("$mapid:$map: $rid
\n"); if ($map eq $mapid) { @@ -2142,7 +2142,7 @@ ENDTABLEHEADFOUR my $tempkeyp = $_; my $fullkeyp = $tempkeyp; $tempkeyp =~ s/_\w+_/_0_/; - + if ((grep $_ eq $fullkeyp, @catmarker) &&(!$name{$tempkeyp})) { $part{$tempkeyp}="0"; $name{$tempkeyp}=&Apache::lonnet::metadata($uri,$fullkeyp.'.name'); @@ -2165,7 +2165,7 @@ ENDTABLEHEADFOUR } # end loop through keys } } # end loop through ids - + #---------------------------------------------------- print header information my $foldermap=&mt($maptitle=~/^uploaded/?'Folder':'Map'); my $showtitle=$maptitles{$maptitle}.($maptitle!~/^uploaded/?' ['.$maptitle.']':''); @@ -2228,10 +2228,10 @@ ENDTABLEHEADFOUR my %display = (); my %type = (); my %default = (); - + foreach (@ids) { my $rid = $_; - + my $uri=&Apache::lonnet::declutter($uris{$rid}); #-------------------------------------------------------------------- @@ -2266,7 +2266,7 @@ ENDTABLEHEADFOUR } } # end loop through keys } # end loop through ids - + #---------------------------------------------------- print header information my $setdef=&mt("Set Defaults for All Resources in Course"); $r->print(<print(" ".&mt("ALL")." ".&mt("USERS")." \n"); } - + if ($csec) {$r->print(&mt("Section")." $csec\n")}; if ($cgroup) {$r->print(&mt("Group")." $cgroup\n")}; $r->print("\n"); @@ -2316,7 +2316,7 @@ sub crsenv { &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=crsenv', text=>"Course Environment"}); - my $breadcrumbs = + my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Edit Course Environment'); my $dom = $env{'course.'.$env{'request.course.id'}.'.domain'}; my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; @@ -2335,7 +2335,7 @@ sub crsenv { } if ($name =~ /^rolenames_([^_]+)$/) { $name = $1.'.plaintext'; - my $standardtitle = + my $standardtitle = &Apache::lonnet::plaintext($1,$crstype,$env{'request.course.id'},1); my %adv_roles = &Apache::lonnet::get_course_adv_roles($env{'request.course.id'},1); @@ -2367,15 +2367,15 @@ sub crsenv { if ($name =~ /^spreadsheet_default_(classcalc| studentcalc| assesscalc)$/x) { - my $sheettype = $1; + my $sheettype = $1; if ($sheettype eq 'classcalc') { # no need to do anything since viewing the sheet will - # cause it to be updated. + # cause it to be updated. } elsif ($sheettype eq 'studentcalc') { # expire all the student spreadsheets &Apache::lonnet::expirespread('','','studentcalc'); } else { - # expire all the assessment spreadsheets + # expire all the assessment spreadsheets # this includes non-default spreadsheets, but better to # be safe than sorry. &Apache::lonnet::expirespread('','','assesscalc'); @@ -2448,7 +2448,7 @@ sub crsenv { &change_clone($value,\@oldcloner); } # Update environment and nohist_courseids.db - if (($name eq 'description') || ($name eq 'cloners') || + if (($name eq 'description') || ($name eq 'cloners') || ($name eq 'hidefromcat') || ($name eq 'categories')) { if ($chome eq '') { %crsinfo = @@ -2460,7 +2460,7 @@ sub crsenv { if ($name eq 'description' && defined($value)) { &Apache::lonnet::appenv({'course.'.$env{'request.course.id'}.'.description' => $value}); if (ref($crsinfo{$env{'request.course.id'}}) eq 'HASH') { - $crsinfo{$env{'request.course.id'}}{'description'} = $value; + $crsinfo{$env{'request.course.id'}}{'description'} = $value; my $putresult = &Apache::lonnet::courseidput($dom,\%crsinfo, $chome,'notime'); @@ -2580,7 +2580,7 @@ sub crsenv { .'('.&mt('[_1]: student, [_2]: TA, [_3]: instructor','"st"','"ta"','"in"').')
' .'("'.&mt('role,role,...').'") ' .Apache::loncommon::help_open_topic("Course_Disable_Discussion"), - 'plc.users.denied' => + 'plc.users.denied' => ''.&mt('Disallow chat room use for Users').'
'. '("'.&mt('user:domain,user:domain,...').'")', @@ -2588,20 +2588,20 @@ sub crsenv { .'('.&mt('[_1]: student, [_2]: TA, [_3]: instructor','"st"','"ta"','"in"') .'("'.&mt('role,role,...').'") ' .Apache::loncommon::help_open_topic("Course_Disable_Discussion"), - 'pch.users.denied' => + 'pch.users.denied' => ''.&mt('Disallow Resource Discussion for Users').'
'. '("'.&mt('user:domain,user:domain,...').'")', - 'spreadsheet_default_classcalc' + 'spreadsheet_default_classcalc' => ''.&mt('Default Course Spreadsheet').' '. '$SelectSpreadsheetFile
", - 'spreadsheet_default_studentcalc' + 'spreadsheet_default_studentcalc' => ''.&mt('Default Student Spreadsheet').'
'. '$SelectSpreadsheetFile
", - 'spreadsheet_default_assesscalc' + 'spreadsheet_default_assesscalc' => ''.&mt('Default Assessment Spreadsheet').' '. ' ''.&mt('Allow problems to be split over pages').'
'. ' ('.&mt('[_1] if allowed, anything else if not','"yes"').')', - 'default_paper_size' + 'default_paper_size' => ''.&mt('Default paper type').'
'. - ' ('.&mt('supported types').': Letter [8 1/2x11 in], Legal [8 1/2x14 in],'. - ' Tabloid [11x17 in], Executive [7 1/2x10 in], A2 [420x594 mm],'. + ' ('.&mt('supported types').': Letter [8 1/2x11 in], Legal [8 1/2x14 in],'. + ' Tabloid [11x17 in], Executive [7 1/2x10 in], A2 [420x594 mm],'. ' A3 [297x420 mm], A4 [210x297 mm], A5 [148x210 mm], A6 [105x148 mm])', 'print_header_format' => ' '.&mt('Print header format').'
' @@ -2673,7 +2673,7 @@ sub crsenv { 'categories' => ''.&mt('Categorize course').'
'. &mt('Display Categories').'', - 'datelocale' + 'datelocale' => ''.&mt('Locale used for course calendar').'', 'rolenames' => ''.&mt('Replacement titles for standard course roles').'
'. @@ -2755,7 +2755,7 @@ sub crsenv { $catdisplay .= &unescape($name).'&'; } $catdisplay =~ s/\&$//; - } + } $output .= '
'.&mt('Any User').''. ''. @@ -2915,7 +2915,7 @@ $output_SB .= '' .'

'.&mt('Course Parameter Overview').'

' .'
' @@ -2996,15 +2996,15 @@ function catsbrowser() { } else { catswin.focus(); } -} +} ENDSCRIPT } $jscript = ''; - my $start_page = + my $start_page = &Apache::loncommon::start_page('Set Course Environment', $jscript); - my $end_page = + my $end_page = &Apache::loncommon::end_page(); $r->print(< ENDSCRIPT } else { - my $onload; + my $onload; } my $start_page = &Apache::loncommon::start_page('Course Categories',$catwin_js, @@ -3191,7 +3191,7 @@ sub storedata { $typeof=$env{'form.typeof_'.$thiskey}; $text = &mt('Saved modified date for'); } - if (defined($data) and $$olddata{$thiskey} ne $data) { + if (defined($data) and $$olddata{$thiskey} ne $data) { if ($tuname) { if (&Apache::lonnet::put('resourcedata',{$tkey=>$data, $tkey.'.type' => $typeof}, @@ -3206,8 +3206,8 @@ sub storedata { &Apache::lonnet::devalidateuserresdata($tuname,$tudom); } else { $newdata{$thiskey}=$data; - $newdata{$thiskey.'.type'}=$typeof; - } + $newdata{$thiskey.'.type'}=$typeof; + } } } elsif ($cmd eq 'del') { if ($tuname) { @@ -3261,7 +3261,7 @@ sub parse_listdata_key { my ($key,$listdata) = @_; # split into student/section affected, and # the realm (folder/resource part and parameter - my ($student,$realm) = + my ($student,$realm) = ($key=~/^\Q$env{'request.course.id'}\E\.\[([^\.]+)\]\.(.+)$/); # if course wide student would be undefined if (!defined($student)) { @@ -3302,13 +3302,13 @@ sub listdata { if ($sortorder eq 'realmstudent') { if ($ares ne $bres ) { $result = ($ares cmp $bres); - } elsif ($astudent ne $bstudent) { + } elsif ($astudent ne $bstudent) { $result = ($astudent cmp $bstudent); } elsif ($apart ne $bpart ) { $result = ($apart cmp $bpart); } } else { - if ($astudent ne $bstudent) { + if ($astudent ne $bstudent) { $result = ($astudent cmp $bstudent); } elsif ($ares ne $bres ) { $result = ($ares cmp $bres); @@ -3316,7 +3316,7 @@ sub listdata { $result = ($apart cmp $bpart); } } - + if (!$result) { if (defined($aparm) && defined($bparm)) { $result = ($aparm <=> $bparm); @@ -3466,7 +3466,7 @@ sub default_selector { return ''; } -my %strings = +my %strings = ( 'string_yesno' => [[ 'yes', 'Yes' ], @@ -3481,7 +3481,7 @@ my %strings = sub string_selector { my ($thistype, $thiskey, $showval) = @_; - + if (!exists($strings{$thistype})) { return &default_selector($thiskey,$showval); } @@ -3574,7 +3574,7 @@ ENDOVER my @psprt=&Apache::loncommon::get_env_multiple('form.psprt'); if (!@psprt) { $psprt[0]='0'; } - my @selected_sections = + my @selected_sections = &Apache::loncommon::get_env_multiple('form.Section'); @selected_sections = ('all') if (! @selected_sections); foreach my $sec (@selected_sections) { @@ -3587,14 +3587,14 @@ ENDOVER my $pssymb=''; my $parmlev=''; - + unless ($env{'form.parmlev'}) { $parmlev = 'map'; } else { $parmlev = $env{'form.parmlev'}; } - &extractResourceInformation(\@ids, \%typep,\%keyp, \%allparms, \%allparts, \%allmaps, + &extractResourceInformation(\@ids, \%typep,\%keyp, \%allparms, \%allparts, \%allmaps, \%mapp, \%symbp,\%maptitles,\%uris, \%keyorder,\%defkeytype); @@ -3618,15 +3618,15 @@ ENDOVER $r->print(&Apache::lonhtmlcommon::end_pick_box()); $r->print(''); #$r->print('
'); - + #$r->print(' #
'); $r->print('
'); $r->print('
' ); - $r->print(&Apache::lonhtmlcommon::start_pick_box()); + $r->print(&Apache::lonhtmlcommon::start_pick_box()); &parmmenu($r,\%allparms,\@pscat,\%keyorder); - $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View'))); + $r->print(&Apache::lonhtmlcommon::row_title(&mt('Select Parts to View'))); #$r->print('
'. $r->print(''. ''. '' ); - + $r->print(''); - + } } $r->print(&Apache::loncommon::end_data_table().'

'. @@ -3914,7 +3914,7 @@ sub parse_key { my ($map,$resid,$url) = &Apache::lonnet::decode_symb($data{'realm'}); $data{'realm_exists'} = &Apache::lonnet::symbverify($data{'realm'},$url); } - + $data{'parameter_part'} = $part; $data{'parameter_name'} = $name; @@ -3954,7 +3954,7 @@ sub check_cloners { $disallowed{'format'} .= $currclone.','; } } elsif ($currclone !~/^($match_username)\:($match_domain)$/) { - $disallowed{'format'} .= $currclone.','; + $disallowed{'format'} .= $currclone.','; } else { if (&Apache::lonnet::homeserver($uname,$udom) eq 'no_host') { $disallowed{'newuser'} .= $currclone.','; @@ -3983,7 +3983,7 @@ sub change_clone { my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; my $clone_crs = $cnum.':'.$cdom; - + if ($cnum && $cdom) { my @allowclone; &extract_cloners($clonelist,\@allowclone); @@ -4095,7 +4095,7 @@ ENDMAINFORMHEAD permission => $parm_permission, linktitle =>'Set default actions for parameters.' , icon => 'folder-new.png' , - }]}, + }]}, { categorytitle => 'New and Existing Parameter Settings for Resources', items => [ { linktext => 'Edit Resource Parameters - Helper Mode', @@ -4127,7 +4127,7 @@ ENDMAINFORMHEAD linktitle =>'Set/Modify existing resource parameters in overview mode.' , icon => 'preferences-desktop-wallpaper.png' , #help => 'Parameter_Overview', - }, + }, { linktext => 'Change Log', url => '/adm/parmset?action=parameterchangelog', permission => $parm_permission, @@ -4244,7 +4244,7 @@ sub order_meta_fields { } my $ordered_fields = join ",", @neworder; my $put_result = &Apache::lonnet::put('environment', - {'metadata.addedorder'=>$ordered_fields},$dom,$crs); + {'metadata.addedorder'=>$ordered_fields},$dom,$crs); &Apache::lonnet::appenv({'course.'.$env{'request.course.id'}.'.metadata.addedorder' => $ordered_fields}); } my $fields = &get_added_meta_fieldnames($env{'request.course.id'}); @@ -4257,8 +4257,8 @@ sub order_meta_fields { $ordered_fields = join ",", @fields_in_order; } my $put_result = &Apache::lonnet::put('environment', - {'metadata.addedorder'=>$ordered_fields},$dom,$crs); - } + {'metadata.addedorder'=>$ordered_fields},$dom,$crs); + } $r->print('

'.&mt('Parts').''.&mt('Section(s)'). @@ -3647,9 +3647,9 @@ ENDOVER unless ($sortorder) { $sortorder='realmstudent'; } &sortmenu($r,$sortorder); $r->print(''); - + $r->print('

'); - + # Build the list data hash from the specified parms my $listdata; @@ -3791,11 +3791,11 @@ ENDOVER $r->print(&Apache::loncommon::start_data_table_row(). '
'); my $display_value = $resourcedata->{$thiskey}; if (&isdateparm($resourcedata->{$thiskey.'.type'})) { - $display_value = + $display_value = &Apache::lonlocal::locallocaltime($display_value); } $r->print(&mt('Parameter: "[_1]" with value: "[_2]"', @@ -3824,7 +3824,7 @@ ENDOVER } $r->print('
   '.&mt('Part: [_1]',$data{'parameter_part'})); $r->print('
'); my $num_fields = scalar(@fields_in_order); foreach my $key (@fields_in_order) { @@ -4309,7 +4309,7 @@ sub addmetafield { $options =~ s/,,/,/; my $put_result = &Apache::lonnet::put('environment', {'metadata.'.$meta_field.'.options'=>$options},$dom,$crs); - + $r->print('Undeleted Metadata Field '.$env{'course.'.$env{'request.course.id'}.'.metadata.'.$meta_field.'.added'}." with result ".$put_result.'
'); } $r->print(&continue()); @@ -4368,13 +4368,13 @@ sub setrestrictmeta { $save_field = $meta_field; if ($env{'form.'.$meta_field.'_stuadd'}) { $options.='stuadd,'; - } + } if ($env{'form.'.$meta_field.'_choices'}) { $options.='choices,'; - } + } if ($env{'form.'.$meta_field.'_onlyone'} eq 'single') { $options.='onlyone,'; - } + } if ($env{'form.'.$meta_field.'_active'}) { $options.='active,'; } @@ -4420,7 +4420,7 @@ ENDButtons $output.= &output_row($r, $field, $$added_metadata_fields{$field},$added_flag, $row_alt); } $output .= &Apache::loncommon::end_data_table(); - $r->print(<print(< $output $buttons @@ -4466,7 +4466,7 @@ sub defaultsetter { &Apache::lonhtmlcommon::add_breadcrumb({href=>'/adm/parmset?action=setdefaults', text=>"Set Defaults"}); - my $start_page = + my $start_page = &Apache::loncommon::start_page('Parameter Setting Default Actions'); my $breadcrumbs = &Apache::lonhtmlcommon::breadcrumbs('Defaults'); $r->print(<print(&mt('Manual setting rules apply to all interfaces.').'
'. &mt('Automatic setting rules apply to table mode interfaces only.')); @@ -4647,7 +4647,7 @@ sub components { $issection=''; } my $realm=''.&mt('All Resources').''; - my $realmdescription=&mt('all resources'); + my $realmdescription=&mt('all resources'); if ($middle=~/^(.+)\_\_\_\(all\)$/) { $realm=''.&mt('Folder/Map').': '.&Apache::lonnet::gettitle($1).'
('.$1.')
'; $realmdescription=&mt('folder').' '.&Apache::lonnet::gettitle($1); @@ -4678,7 +4678,7 @@ sub load_parameter_names { close($config); $standard_parms{'int_pos'} = 'Positive Integer'; $standard_parms{'int_zero_pos'} = 'Positive Integer or Zero'; - %standard_parms=&Apache::lonlocal::texthash(%standard_parms); + %standard_parms=&Apache::lonlocal::texthash(%standard_parms); } sub standard_parameter_names { @@ -4687,9 +4687,9 @@ sub standard_parameter_names { &load_parameter_names(); } if ($standard_parms{$name}) { - return $standard_parms{$name}; - } else { - return $name; + return $standard_parms{$name}; + } else { + return $name; } } @@ -4710,7 +4710,7 @@ sub parm_change_log { $r->print('
'); - + my %saveable_parameters = ('show' => 'scalar',); &Apache::loncommon::store_course_settings('parameter_log', \%saveable_parameters); @@ -4738,7 +4738,7 @@ sub parm_change_log { } if ($last) { ($folder) = &Apache::lonnet::decode_symb($last); } } - foreach my $id (sort + foreach my $id (sort { if ($parmlog{$b}{'exe_time'} ne $parmlog{$a}{'exe_time'}) { return $parmlog{$b}{'exe_time'} <=>$parmlog{$a}{'exe_time'} @@ -4751,15 +4751,15 @@ sub parm_change_log { my $count = 0; my $time = &Apache::lonlocal::locallocaltime($parmlog{$id}{'exe_time'}); - my $plainname = + my $plainname = &Apache::loncommon::plainname($parmlog{$id}{'exe_uname'}, $parmlog{$id}{'exe_udom'}); - my $about_me_link = + my $about_me_link = &Apache::loncommon::aboutmewrapper($plainname, $parmlog{$id}{'exe_uname'}, $parmlog{$id}{'exe_udom'}); my $send_msg_link=''; - if ((($parmlog{$id}{'exe_uname'} ne $env{'user.name'}) + if ((($parmlog{$id}{'exe_uname'} ne $env{'user.name'}) || ($parmlog{$id}{'exe_udom'} ne $env{'user.domain'}))) { $send_msg_link ='
'. &Apache::loncommon::messagewrapper(&mt('Send message'), @@ -4782,8 +4782,8 @@ sub parm_change_log { } } if ($typeflag) { - $istype{$parmname}=$value; - if (!$env{'form.includetypes'}) { next; } + $istype{$parmname}=$value; + if (!$env{'form.includetypes'}) { next; } } $count++; if ($makenewrow) { @@ -4821,12 +4821,12 @@ sub parm_change_log { my $description=&mt('Changed [_1] for [_2] to [_3]',&standard_parameter_names($parmname),$realmdescription, (&isdateparm($istype{$parmname})?&Apache::lonlocal::locallocaltime($value):$value)); if (($uname) && ($udom)) { - $output .= + $output .= &Apache::loncommon::messagewrapper('Notify User', $uname,$udom,$title, $description); } else { - $output .= + $output .= &Apache::lonrss::course_blog_link($id,$title, $description); } @@ -4837,7 +4837,7 @@ sub parm_change_log { my $wholeentry=$about_me_link.':'. $parmlog{$id}{'exe_uname'}.':'.$parmlog{$id}{'exe_udom'}.':'. $output; - if ($wholeentry!~/\Q$env{'form.containingphrase'}\E/i) { next; } + if ($wholeentry!~/\Q$env{'form.containingphrase'}\E/i) { next; } } if ($count) { $r->print($row_start.'
@@ -4847,7 +4847,7 @@ sub parm_change_log { $send_msg_link.''.$output); $shown++; } - if (!($env{'form.show'} eq &mt('all') + if (!($env{'form.show'} eq &mt('all') || $shown<=$env{'form.show'})) { last; } } $r->print(&Apache::loncommon::end_data_table()); @@ -4993,7 +4993,7 @@ sub handler { } elsif (! exists($env{'form.action'})) { &print_main_menu($r,$parm_permission); } elsif ($env{'form.action'} eq 'crsenv') { - &crsenv($r); + &crsenv($r); } elsif ($env{'form.action'} eq 'setoverview') { &overview($r); } elsif ($env{'form.action'} eq 'addmetadata') { @@ -5018,7 +5018,7 @@ sub handler { &date_shift_two($r); } elsif ($env{'form.action'} eq 'categorizecourse') { &assign_course_categories($r); - } + } } else { # ----------------------------- Not in a course, or not allowed to modify parms if ($exists) {
'.$time.'