--- loncom/interface/lonwhatsnew.pm 2008/03/18 22:00:28 1.76 +++ loncom/interface/lonwhatsnew.pm 2008/04/30 23:52:00 1.77 @@ -1,5 +1,5 @@ # -# $Id: lonwhatsnew.pm,v 1.76 2008/03/18 22:00:28 raeburn Exp $ +# $Id: lonwhatsnew.pm,v 1.77 2008/04/30 23:52:00 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -36,6 +36,7 @@ use Apache::lonlocal; use Apache::loncoursedata(); use Apache::lonnavmaps(); use Apache::lonuserstate; +use Apache::lonuserutils; use Apache::Constants qw(:common :http); use Time::Local; use GDBM_File; @@ -68,6 +69,8 @@ sub handler { ['vgr','abovethreshold',1], ['opa','haserrors',1], ['mdc','versionchanges',0], + ['vcl','newroles',1], + ['vcl','oldroles',1], ) { my ($perm,$key,$check_section) = @{ $perm_check }; my $scope = $env{'request.course.id'}; @@ -125,6 +128,20 @@ sub handler { $r->print(&Apache::lonhtmlcommon::breadcrumbs ("What's New?",#'Course_Action_Items_Initialization' )); + } elsif ($command eq 'chgoldroleinterval' && $checkallowed{'oldroles'}) { + &Apache::lonhtmlcommon::add_breadcrumb + ({href=>'/adm/whatsnew?command=chgoldroleinterval&refpage='.$refpage, + text=>"Change interval"}); + $r->print(&Apache::lonhtmlcommon::breadcrumbs + ("What's New?",#'Course_Action_Items_Intervals' + )); + } elsif ($command eq 'chgnewroleinterval' && $checkallowed{'newroles'}) { + &Apache::lonhtmlcommon::add_breadcrumb + ({href=>'/adm/whatsnew?command=chgnewroleinterval&refpage='.$refpage, + text=>"Change interval"}); + $r->print(&Apache::lonhtmlcommon::breadcrumbs + ("What's New?",#'Course_Action_Items_Intervals' + )); } else { $r->print(&Apache::lonhtmlcommon::breadcrumbs ("What's New?",#'Course_Action_Items_Display' @@ -152,14 +169,29 @@ sub display_main_box { degdiff => 'Degree of difficulty', numstudents => 'Total number of students with submissions', ); - - my %interval_titles = &Apache::lonlocal::texthash ( - -1 => "since start of $lctype", - 2592000 => 'since last month', - 604800 => 'since last week', - 86400 => 'since yesterday', + my %versions = &Apache::lonlocal::texthash ( + -1 => "version changes since start of $lctype", + 2592000 => 'version changes since last month', + 604800 => 'version changes since last week', + 86400 => 'version changes since yesterday', + ); + my %newroles = &Apache::lonlocal::texthash ( + -1 => "roles which have become active since start of $lctype", + 2592000 => 'roles which have become active since last month', + 604800 => 'roles which have become active since last week', + 86400 => 'roles which have become active since yesterday', + ); + my %oldroles = &Apache::lonlocal::texthash ( + -1 => "roles which expired since start of $lctype", + 2592000 => 'roles which expired since last month', + 604800 => 'roles which expired since last week', + 86400 => 'roles which expired since yesterday', + ); + my %interval_titles = ( + versions => \%versions, + newroles => \%newroles, + oldroles => \%oldroles, ); - my %initpage = &Apache::lonlocal::texthash ( firstres => "first resource in the $lctype", whatsnew => "what's new? page", @@ -175,12 +207,18 @@ sub display_main_box { $cdom,$crs); } elsif (($command eq 'chginterval') && $checkallowed->{'versionchanges'}) { - &display_interval_config($r,$refpage,\%interval_titles); + &display_interval_config($r,$refpage,\%interval_titles,'versions'); } elsif (($command eq 'chgdisc') && $checkallowed->{'coursediscussion'}) { &display_discussion_config($r,$refpage); } elsif ($command eq 'courseinit') { &courseinit_config($r,$refpage,\%initpage); + } elsif (($command eq 'chgnewroleinterval') + && $checkallowed->{'newroles'}) { + &display_interval_config($r,$refpage,\%interval_titles,'newroles'); + } elsif (($command eq 'chgoldroleinterval') + && $checkallowed->{'oldroles'}) { + &display_interval_config($r,$refpage,\%interval_titles,'oldroles'); } else { &display_actions_box($r,$command,$refpage,\%threshold_titles, \%interval_titles,\%initpage,$cdom,$crs,$checkallowed); @@ -205,12 +243,13 @@ sub display_header { my ($command,$checkallowed) = @_; my $scripttag; - unless ($command eq 'chgthreshold' || $command eq 'chginterval') { + unless ($command eq 'chgthreshold' || $command eq 'chginterval' || + $command eq 'chgoldroleinterval' || $command eq 'chgnewroleinterval') { $scripttag = <<"END";