--- loncom/interface/lonhtmlcommon.pm 2006/06/13 14:42:24 1.132 +++ loncom/interface/lonhtmlcommon.pm 2006/06/16 22:37:10 1.134 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.132 2006/06/13 14:42:24 www Exp $ +# $Id: lonhtmlcommon.pm,v 1.134 2006/06/16 22:37:10 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -150,8 +150,13 @@ sub get_recent { # Create hash with key as time and recent as value my %time_hash = (); + my $nfrozen = 0; foreach (keys %recent) { - my $thistime=(split(/\&/,$recent{$_}))[0]; + my ($thistime,$thisvalue)=(split(/\&/,$recent{$_})); + if (($thisvalue eq 'role_frozen') && ($area='roles')) { + $thistime=time+$nfrozen; + $nfrozen++; + } $time_hash{$thistime} = $_; } @@ -160,7 +165,7 @@ sub get_recent { my $idx = 1; foreach (reverse sort keys %time_hash) { $return_hash{$time_hash{$_}} = - &unescape((split(/\&/,$recent{$_}))[1]); + &unescape((split(/\&/,$recent{$time_hash{$_}}))[1]); if ($n && ($idx++ >= $n)) {last;} } @@ -283,7 +288,7 @@ The method used to restrict user input w ############################################## sub date_setter { my ($formname,$dname,$currentvalue,$special,$includeempty,$state, - $no_hh_mm_ss,$defhour,$defmin,$defsec) = @_; + $no_hh_mm_ss,$defhour,$defmin,$defsec,$nolink) = @_; my $wasdefined=1; if (! defined($state) || $state ne 'disabled') { $state = ''; @@ -431,17 +436,24 @@ ENDJS $hourselector .= " \n"; my $minuteselector = qq{}; my $secondselector= qq{}; - my $cal_link = qq{}; + my $cal_link; + if (!$nolink) { + $cal_link = qq{}; + } # if ($no_hh_mm_ss) { - $result .= &mt('[_1] [_2] [_3] [_4]Select Date[_5]', - $monthselector,$dayselector,$yearselector, - $cal_link,''); + $result .= &mt('[_1] [_2] [_3] ', + $monthselector,$dayselector,$yearselector); + if (!$nolink) { + $result .= &mt('[_4]Select Date[_5]',$cal_link,''); + } } else { - $result .= &mt('[_1] [_2] [_3] [_4] [_5]m [_6]s [_7]Select Date[_8]', - $monthselector,$dayselector,$yearselector, - $hourselector,$minuteselector,$secondselector, - $cal_link,''); + $result .= &mt('[_1] [_2] [_3] [_4] [_5]m [_6]s ', + $monthselector,$dayselector,$yearselector, + $hourselector,$minuteselector,$secondselector); + if (!$nolink) { + $result .= &mt('[_7]Select Date[_8]',$cal_link,''); + } } $result .= "\n\n"; return $result;