--- loncom/interface/lonhtmlcommon.pm 2010/10/04 19:43:30 1.253.2.4 +++ loncom/interface/lonhtmlcommon.pm 2010/12/05 21:58:49 1.253.2.8 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.253.2.4 2010/10/04 19:43:30 raeburn Exp $ +# $Id: lonhtmlcommon.pm,v 1.253.2.8 2010/12/05 21:58:49 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -410,7 +410,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,$nolink) = @_; + $no_hh_mm_ss,$defhour,$defmin,$defsec,$nolink,$hide_timezone) = @_; my $now = time; my $wasdefined=1; if (! defined($state) || $state ne 'disabled') { @@ -563,7 +563,10 @@ ENDJS $cal_link = qq{}; } # - my $tzone = ' '.$tzname.' '; + my $tzone; + unless ($hide_timezone) { + $tzone = ' '.$tzname.' '; + } if ($no_hh_mm_ss) { $result .= &mt('[_1] [_2] [_3] ', $monthselector,$dayselector,$yearselector). @@ -643,7 +646,7 @@ Returns: Unix time represented in the fo ############################################## ############################################## sub get_date_from_form { - my ($dname) = @_; + my ($dname,$timezone) = @_; my ($sec,$min,$hour,$day,$month,$year); # if (defined($env{'form.'.$dname.'_second'})) { @@ -693,7 +696,13 @@ sub get_date_from_form { if (($year<1970) || ($year>2037)) { return undef; } if (defined($sec) && defined($min) && defined($hour) && defined($day) && defined($month) && defined($year)) { - my $timezone = &Apache::lonlocal::gettimezone(); + if (defined($timezone)) { + if (&Apache::lonlocal::gettimezone($timezone) eq 'local') { + $timezone = &Apache::lonlocal::gettimezone(); + } + } else { + $timezone = &Apache::lonlocal::gettimezone(); + } my $dt = DateTime->new( year => $year, month => $month, day => $day, @@ -1386,10 +1395,15 @@ returns: nothing my $tooltip = 'Go to main menu'; my $no_mt_descr = 0; if ((exists($env{'request.course.id'})) && - ($env{'request.course.id'} ne '')) { - - if ((&Apache::loncommon::needs_gci_custom()) || ($env{'user.domain'} eq 'gcitest')) { - $href = '/adm/navmaps'; + ($env{'request.course.id'} ne '') && + !($env{'form.context'} eq 'requestcrs')) { + if ((&Apache::loncommon::needs_gci_custom()) || ($env{'user.domain'} =~ /^\w+citest$/)) { + if ($env{'environment.remotenavmap'} eq 'on') { + # open link using javascript when remote navmap is activated + $href = "javascript:gonav('/adm/navmaps');"; + } else { + $href = '/adm/navmaps'; + } $tooltip = 'Contents'; } if ($env{'course.'.$env{'request.course.id'}.'.description'} ne '') {