[LON-CAPA-cvs] cvs: doc /loncapafiles loncapafiles.lpml loncom/html/adm/help/tex Course_Prefs_Language.tex loncom/html/res/adm/pages timezone.png loncom/interface courseprefs.pm domainprefs.pm loncommon.pm lonconfigsettings.pm loncreateuser.pm lonpreferences.pm loncom/localize lonlocal.pm loncom/localize/localize de.pm ko.pm loncom/lonnet/perl lonnet.pm
raeburn
raeburn at source.lon-capa.org
Wed Sep 7 21:41:17 EDT 2022
raeburn Thu Sep 8 01:41:17 2022 EDT
Added files:
/loncom/html/res/adm/pages timezone.png
Modified files:
/loncom/interface courseprefs.pm domainprefs.pm loncommon.pm
lonconfigsettings.pm loncreateuser.pm
lonpreferences.pm
/loncom/localize lonlocal.pm
/loncom/localize/localize de.pm ko.pm
/loncom/lonnet/perl lonnet.pm
/loncom/html/adm/help/tex Course_Prefs_Language.tex
/doc/loncapafiles loncapafiles.lpml
Log:
- Bug 6971 Individual user preference for Time Zone.
-------------- next part --------------
Index: loncom/interface/courseprefs.pm
diff -u loncom/interface/courseprefs.pm:1.114 loncom/interface/courseprefs.pm:1.115
--- loncom/interface/courseprefs.pm:1.114 Sun Aug 28 02:41:29 2022
+++ loncom/interface/courseprefs.pm Thu Sep 8 01:41:13 2022
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set configuration settings for a course
#
-# $Id: courseprefs.pm,v 1.114 2022/08/28 02:41:29 raeburn Exp $
+# $Id: courseprefs.pm,v 1.115 2022/09/08 01:41:13 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -116,7 +116,7 @@
=item item_table_row_end()
-=item yes_no_radio()
+=item yesno_radio()
=item select_from_options()
@@ -293,7 +293,7 @@
excc => 'Exclude from community catalog',
clon => 'Users allowed to clone community',
rept => 'Replacement titles for standard community roles',
- time => 'Timezone where the community is located',
+ time => 'Time Zone where the community is located',
date => 'Locale used for community calendar',
coco => 'Community Content',
copo => 'Community Policy',
@@ -322,7 +322,7 @@
excc => 'Exclude from course catalog',
clon => 'Users allowed to clone course',
rept => 'Replacement titles for standard course roles',
- time => 'Timezone in which the course takes place',
+ time => 'Time Zone in which the course takes place',
date => 'Locale used for course calendar',
coco => 'Course Content',
copo => 'Course Policy',
@@ -1492,10 +1492,28 @@
$changes->{$entry} = $newvalues{$entry};
}
}
+ } elsif ($entry eq 'timezone') {
+ if ($env{'form.'.$entry}) {
+ $newvalues{$entry} = $env{'form.'.$entry};
+ if ($newvalues{$entry} ne $values->{$entry}) {
+ $changes->{$entry} = $newvalues{$entry};
+ }
+ if ($env{'form.tzover'}) {
+ $newvalues{'tzover'} = $env{'form.tzover'};
+ if ($newvalues{'tzover'} ne $values->{'tzover'}) {
+ $changes->{'tzover'} = $newvalues{'tzover'};
+ }
+ } elsif ($values->{'tzover'}) {
+ $changes->{'tzover'} = '';
+ }
+ } elsif ($values->{$entry}) {
+ $changes->{$entry} = '';
+ }
} else {
$newvalues{$entry} = $env{'form.'.$entry};
}
- unless (($entry eq 'co-owners') || ($entry eq 'discussion_post_fonts') || ($entry eq 'extresource')) {
+ unless (($entry eq 'co-owners') || ($entry eq 'discussion_post_fonts') ||
+ ($entry eq 'extresource') || ($entry eq 'timezone')) {
if ($newvalues{$entry} ne $values->{$entry}) {
$changes->{$entry} = $newvalues{$entry};
}
@@ -1926,6 +1944,46 @@
if ($msg ne '') {
$output .= '<li>'.&Apache::lonhtmlcommon::confirm_success(&mt($displayname)).'<ul class="LC_success">'.$msg.'</ul></li>';
}
+ } elsif ($key eq 'timezone') {
+ next unless ((exists($changes->{$item}{$key})) || (exists($changes->{$item}{'tzover'})));
+ my ($displayname,$text);
+ $text = $prefs->{$item}->{'itemtext'}{$key};
+ my $displayval;
+ if (exists($changes->{$item}{$key})) {
+ $displayname = &mt($text);
+ $storehash{$key} = $changes->{$item}{$key};
+ if ($changes->{$item}{$key} ne '') {
+ $displayval = '<b>'.$changes->{$item}{$key}.'</b>';
+ } else {
+ push(@delkeys,$key);
+ if (exists($values->{'tzover'})) {
+ push(@delkeys,'tzover');
+ }
+ $output .= '<li>'.&Apache::lonhtmlcommon::confirm_success(&mt('Deleted setting for [_1]',
+ '<i>'.$displayname.'</i>')).'</li>';
+ }
+ }
+ unless (grep(/^\Q$key\E$/, at delkeys)) {
+ if (exists($changes->{$item}{'tzover'})) {
+ $storehash{'tzover'} = $changes->{$item}{'tzover'};
+ my $tzovertext;
+ if ($changes->{$item}{'tzover'} ne '') {
+ $tzovertext = &mt('Course Time Zone overrides individual user preference');
+ } else {
+ push(@delkeys,'tzover');
+ $tzovertext = &mt('Course Time Zone does not override individual user preference');
+ }
+ if ($displayval eq '') {
+ $output .= '<li>'.&Apache::lonhtmlcommon::confirm_success($tzovertext).'</li>';
+ } else {
+ $displayval .= '<br />'.(' 'x5).$tzovertext;
+ }
+ }
+ if ($displayval ne '') {
+ $output .= '<li>'.&Apache::lonhtmlcommon::confirm_success(&mt('[_1] set to [_2]',
+ '<i>'.$displayname.'</i>',$displayval)).'</li>';
+ }
+ }
} else {
next if (!exists($changes->{$item}{$key}));
my ($displayname,$text);
@@ -2551,7 +2609,7 @@
sub get_jscript {
my ($cid,$cdom,$phase,$crstype,$settings,$noedit) = @_;
my ($can_toggle_cat,$can_categorize) = &can_modify_catsettings($cdom,$crstype);
- my ($jscript,$categorize_js,$loncaparev_js,$instcode_js,$extresource_js);
+ my ($jscript,$categorize_js,$loncaparev_js,$instcode_js,$extresource_js,$localization_js);
my $stubrowse_js = &Apache::loncommon::studentbrowser_javascript();
my $browse_js = &Apache::loncommon::browser_and_searcher_javascript('parmset');
my $cloners_js = &cloners_javascript($phase);
@@ -2785,10 +2843,25 @@
}
}
ENDSCRIPT
+ $localization_js = <<"ENDSCRIPT";
+function toggleTimeZone() {
+ if (document.getElementById('LC_set_timezone')) {
+ var timezonesel = document.getElementById('LC_set_timezone').value;
+ if (document.getElementById('LC_tzoverdiv')) {
+ var tzoverdiv = document.getElementById('LC_tzoverdiv');
+ if (timezonesel == '') {
+ tzoverdiv.style.display = 'none';
+ } else {
+ tzoverdiv.style.display = 'block';
+ }
+ }
+ }
+}
+ENDSCRIPT
$jscript = '<script type="text/javascript" language="Javascript">'."\n".
'// <![CDATA['."\n".
$browse_js."\n".$categorize_js."\n".$loncaparev_js."\n".
- $cloners_js."\n".$instcode_js.
+ $cloners_js."\n".$instcode_js."\n".$localization_js."\n".
$syllabus_js."\n".$menuitems_js."\n".$extresource_js."\n".
&linkprot_javascript()."\n".'//]]>'."\n".
'</script>'."\n".$stubrowse_js."\n";
@@ -4443,9 +4516,23 @@
if ($item eq 'timezone') {
my $includeempty = 1;
my $timezone = &Apache::lonlocal::gettimezone();
+ my $onchange;
+ unless ($noedit) {
+ $onchange = ' onchange="javascript:toggleTimeZone();"';
+ }
+ my $id = ' id="LC_set_timezone"';
$datatable .=
- &Apache::loncommon::select_timezone($item,$timezone,undef,
- $includeempty,$disabled);
+ &Apache::loncommon::select_timezone($item,$timezone,$onchange,
+ $includeempty,$id,$disabled);
+ my $tzsty = 'none';
+ if ($timezone ne '') {
+ $tzsty = 'block';
+ }
+ $datatable .= '<div id="LC_tzoverdiv" style="display:'.$tzsty.';">'.
+ '<span class="LC_nobreak">'.
+ &mt('Override individual user preference?').
+ &yesno_radio('tzover',$settings,undef,1,'',$noedit).
+ '</span></div>';
} elsif ($item eq 'datelocale') {
my $includeempty = 1;
my $locale_obj = &Apache::lonlocal::getdatelocale();
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.412 loncom/interface/domainprefs.pm:1.413
--- loncom/interface/domainprefs.pm:1.412 Wed Aug 24 20:58:50 2022
+++ loncom/interface/domainprefs.pm Thu Sep 8 01:41:13 2022
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: domainprefs.pm,v 1.412 2022/08/24 20:58:50 raeburn Exp $
+# $Id: domainprefs.pm,v 1.413 2022/09/08 01:41:13 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -359,7 +359,7 @@
modify => \&modify_passwords,
},
'quotas' =>
- { text => 'Blogs, personal web pages, webDAV/quotas, portfolios',
+ { text => 'Blogs, personal pages/timezones, webDAV/quotas, portfolio',
help => 'Domain_Configuration_Quotas',
header => [{col1 => 'User affiliation',
col2 => 'Available tools',
@@ -2383,7 +2383,7 @@
@options = ('norequest','approval','automatic');
%titles = &authorrequest_titles();
} else {
- @usertools = ('aboutme','blog','webdav','portfolio');
+ @usertools = ('aboutme','blog','webdav','portfolio','timezone');
%titles = &tool_titles();
}
if (ref($types) eq 'ARRAY') {
@@ -2487,9 +2487,12 @@
}
} else {
my $checked = 'checked="checked" ';
+ if ($item eq 'timezone') {
+ $checked = '';
+ }
if (ref($settings) eq 'HASH') {
if (ref($settings->{$item}) eq 'HASH') {
- if ($settings->{$item}->{$type} == 0) {
+ if (!$settings->{$item}->{$type}) {
$checked = '';
} elsif ($settings->{$item}->{$type} == 1) {
$checked = 'checked="checked" ';
@@ -9701,6 +9704,7 @@
blog => 'Blog',
webdav => 'WebDAV',
portfolio => 'Portfolio',
+ timezone => 'Can set time zone',
official => 'Official courses (with institutional codes)',
unofficial => 'Unofficial courses',
community => 'Communities',
@@ -13963,7 +13967,7 @@
@usertools = ('author');
%titles = &authorrequest_titles();
} else {
- @usertools = ('aboutme','blog','webdav','portfolio');
+ @usertools = ('aboutme','blog','webdav','portfolio','timezone');
%titles = &tool_titles();
}
my %domdefaults = &Apache::lonnet::get_domain_defaults($dom,1);
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.1386 loncom/interface/loncommon.pm:1.1387
--- loncom/interface/loncommon.pm:1.1386 Wed Aug 24 20:58:50 2022
+++ loncom/interface/loncommon.pm Thu Sep 8 01:41:13 2022
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.1386 2022/08/24 20:58:50 raeburn Exp $
+# $Id: loncommon.pm,v 1.1387 2022/09/08 01:41:13 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -957,8 +957,8 @@
}
sub select_timezone {
- my ($name,$selected,$onchange,$includeempty,$disabled)=@_;
- my $output='<select name="'.$name.'" '.$onchange.$disabled.'>'."\n";
+ my ($name,$selected,$onchange,$includeempty,$id,$disabled)=@_;
+ my $output='<select name="'.$name.'" '.$id.$onchange.$disabled.'>'."\n";
if ($includeempty) {
$output .= '<option value=""';
if (($selected eq '') || ($selected eq 'local')) {
@@ -17444,7 +17444,7 @@
my %is_adv = ( is_adv => $env{'user.adv'} );
my %domdef = &Apache::lonnet::get_domain_defaults($domain);
- foreach my $tool ('aboutme','blog','webdav','portfolio') {
+ foreach my $tool ('aboutme','blog','webdav','portfolio','timezone') {
$userenv{'availabletools.'.$tool} =
&Apache::lonnet::usertools_access($username,$domain,$tool,'reload',
undef,\%userenv,\%domdef,\%is_adv);
Index: loncom/interface/lonconfigsettings.pm
diff -u loncom/interface/lonconfigsettings.pm:1.66 loncom/interface/lonconfigsettings.pm:1.67
--- loncom/interface/lonconfigsettings.pm:1.66 Sun Aug 28 02:41:29 2022
+++ loncom/interface/lonconfigsettings.pm Thu Sep 8 01:41:13 2022
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler to set domain-wide configuration settings
#
-# $Id: lonconfigsettings.pm,v 1.66 2022/08/28 02:41:29 raeburn Exp $
+# $Id: lonconfigsettings.pm,v 1.67 2022/09/08 01:41:13 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -440,7 +440,10 @@
}
}
if (grep(/^appearance$/, at actions)) {
- $onload .= "toggleExtRes();"
+ $onload .= "toggleExtRes();";
+ }
+ if (grep(/^localization$/, at actions)) {
+ $onload .= "toggleTimeZone();";
}
if ($onload) {
my %loaditems = (
Index: loncom/interface/loncreateuser.pm
diff -u loncom/interface/loncreateuser.pm:1.458 loncom/interface/loncreateuser.pm:1.459
--- loncom/interface/loncreateuser.pm:1.458 Fri Dec 24 19:42:37 2021
+++ loncom/interface/loncreateuser.pm Thu Sep 8 01:41:13 2022
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.458 2021/12/24 19:42:37 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.459 2022/09/08 01:41:13 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -247,6 +247,7 @@
'aboutme' => "Personal Information Page",
'webdav' => "WebDAV access to Authoring Spaces (if SSL and author/co-author)",
'portfolio' => "Personal User Portfolio",
+ 'timezone' => "Can set Time Zone",
'avai' => "Available",
'cusa' => "availability",
'chse' => "Change setting",
@@ -287,8 +288,8 @@
} else {
%userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname,
'tools.aboutme','tools.portfolio','tools.blog',
- 'tools.webdav');
- @usertools = ('aboutme','blog','webdav','portfolio');
+ 'tools.webdav','tools.timezone');
+ @usertools = ('aboutme','blog','webdav','portfolio','timezone');
}
foreach my $item (@usertools) {
my ($custom_access,$curr_access,$cust_on,$cust_off,$tool_on,$tool_off,
@@ -2913,7 +2914,7 @@
my (%alerts,%rulematch,%inst_results,%curr_rules);
my @userinfo = ('firstname','middlename','lastname','generation','permanentemail','id');
- my @usertools = ('aboutme','blog','webdav','portfolio');
+ my @usertools = ('aboutme','blog','webdav','portfolio','timezone');
my @requestcourses = ('official','unofficial','community','textbook','placement','lti');
my @requestauthor = ('requestauthor');
my ($othertitle,$usertypes,$types) =
@@ -3089,7 +3090,8 @@
my %userenv = &Apache::lonnet::get
('environment',['firstname','middlename','lastname','generation',
'id','permanentemail','portfolioquota','authorquota','inststatus',
- 'tools.aboutme','tools.blog','tools.webdav','tools.portfolio',
+ 'tools.aboutme','tools.blog','tools.webdav',
+ 'tools.portfolio','tools.timezone',
'requestcourses.official','requestcourses.unofficial',
'requestcourses.community','requestcourses.textbook',
'requestcourses.lti','requestauthor',
@@ -3593,6 +3595,7 @@
'webdav' => 'WebDAV Availability',
'aboutme' => 'Personal Information Page Availability',
'portfolio' => 'Portfolio Availability',
+ 'timezone' => 'Can set own Time Zone',
'official' => 'Can Request Official Courses',
'unofficial' => 'Can Request Unofficial Courses',
'community' => 'Can Request Communities',
Index: loncom/interface/lonpreferences.pm
diff -u loncom/interface/lonpreferences.pm:1.240 loncom/interface/lonpreferences.pm:1.241
--- loncom/interface/lonpreferences.pm:1.240 Fri Aug 19 18:56:41 2022
+++ loncom/interface/lonpreferences.pm Thu Sep 8 01:41:13 2022
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Preferences
#
-# $Id: lonpreferences.pm,v 1.240 2022/08/19 18:56:41 raeburn Exp $
+# $Id: lonpreferences.pm,v 1.241 2022/09/08 01:41:13 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -31,7 +31,6 @@
package Apache::lonpreferences;
use strict;
-use LONCAPA;
use Apache::Constants qw(:common);
use Apache::File;
use Apache::loncommon();
@@ -40,6 +39,7 @@
use Apache::lonnet;
use LONCAPA::lonauthcgi();
use LONCAPA();
+use DateTime::TimeZone();
################################################################
# Handler subroutines #
@@ -2218,6 +2218,120 @@
&print_main_menu($r,$message);
}
+sub timezonechanger {
+ my $r = shift;
+ my $uname = $env{'user.name'};
+ my $udom = $env{'user.domain'};
+ if (&Apache::lonnet::usertools_access($uname,$udom,'timezone')) {
+ my $js = <<"ENDSCRIPT";
+<script type-"text/javascript">
+// <![CDATA[
+function toggleTZdisplay(form) {
+ var radioname = 'settimezone';
+ var divid = 'LC_timezone_selector';
+ var num = form.elements[radioname].length;
+ if (num) {
+ var setvis = '';
+ for (var i=0; i<num; i++) {
+ if (form.elements[radioname][i].checked) {
+ if (form.elements[radioname][i].value == '1') {
+ if (document.getElementById(divid)) {
+ document.getElementById(divid).style.display = 'inline-block';
+ }
+ setvis = 1;
+ }
+ break;
+ }
+ }
+ if (!setvis) {
+ if (document.getElementById(divid)) {
+ document.getElementById(divid).style.display = 'none';
+ }
+ }
+ }
+ return;
+}
+// ]]>
+</script>
+ENDSCRIPT
+ my %loaditems = (
+ onload => 'javascript:toggleTZdisplay(document.prefs);',
+ );
+ my $args = { 'add_entries' => \%loaditems };
+ &Apache::lonhtmlcommon::add_breadcrumb(
+ { href => '/adm/preferences?action=',
+ text => 'Set Your Time Zone'});
+ $r->print(Apache::loncommon::start_page('Set Your Time Zone',$js,$args));
+ $r->print(Apache::lonhtmlcommon::breadcrumbs('Set Your Time Zone'));
+ my %userenv = &Apache::lonnet::get('environment',['timezone']);
+ my $timezone = $userenv{'timezone'};
+ my %lt = &Apache::lonlocal::texthash(
+ lctz => 'Use Time Zone set by LON-CAPA',
+ owntz => 'Use Time Zone set by you',
+ save => 'Save',
+ );
+ my (%checked,$tzsty);
+ if ($userenv{'timezone'} ne '') {
+ $checked{'owntz'} = ' checked="checked"';
+ $tzsty = 'inline-block';
+ } else {
+ $checked{'lctz'} = ' checked="checked"';
+ $tzsty = 'none';
+ }
+ my $onclick = ' onclick="javascript:toggleTZdisplay(this.form);"';
+ my $selector = &Apache::loncommon::select_timezone('timezone',$timezone,undef,1);
+ $r->print(<<"END");
+<form name="prefs" action="/adm/preferences" method="post">
+<input type="hidden" name="action" value="verify_and_change_timezone" />
+<span class="LC_nobreak">
+<label><input type="radio" name="settimezone" value="0"$checked{'lctz'}$onclick />
+$lt{'lctz'}</label>
+<label><input type="radio" name="settimezone" value="1"$checked{'owntz'}$onclick />
+$lt{'owntz'}</label><div style="display:$tzsty" id="LC_timezone_selector">
+$selector
+</div></span><br /><br />
+<input type="submit" value="$lt{'save'}" />
+</form>
+END
+ }
+ return;
+}
+
+sub verify_and_change_timezone {
+ my $r = shift;
+ my $currtimezone = $env{'environment.timezone'};
+ my $newtimezone;
+ if ($env{'form.settimezone'}) {
+ $newtimezone = $env{'form.timezone'};
+ if (DateTime::TimeZone->is_valid_name($env{'form.timezone'})) {
+ $newtimezone = $env{'form.timezone'};
+ }
+ }
+ my $message='';
+ if ($newtimezone) {
+ if ($newtimezone eq $currtimezone) {
+ $message = &mt('Time Zone settings unchanged');
+ } else {
+ &Apache::lonnet::put('environment',{'timezone' => $newtimezone});
+ &Apache::lonnet::appenv({'environment.timezone' => $newtimezone});
+ $message=&Apache::lonhtmlcommon::confirm_success(
+ &mt('Set [_1] to [_2]',
+ '<i>'.&mt('Your Time Zone').'</i>',
+ '<tt>"'.$newtimezone.'"</tt>.')).
+ '<br />';
+ }
+ } elsif ($currtimezone) {
+ &Apache::lonnet::del('environment',['timezone']);
+ &Apache::lonnet::delenv('environment.timezone');
+ $message=&Apache::lonhtmlcommon::confirm_success(&mt('Time Zone now set by LON-CAPA'));
+ } else {
+ $message = &mt('Time Zone settings unchanged');
+ }
+ $message=&Apache::loncommon::confirmwrapper($message);
+ &print_main_menu($r,$message);
+ return;
+}
+
sub print_main_menu {
my ($r, $message) = @_;
# Determine current authentication method
@@ -2232,6 +2346,9 @@
if (&Apache::lonnet::usertools_access($user,$domain,'aboutme')) {
$permissions{'aboutme'} = 'F';
}
+if (&Apache::lonnet::usertools_access($user,$domain,'timezone')) {
+ $permissions{'timezone'} = 'F';
+}
my @menu=
({ categorytitle=>'Personal Data',
items =>[
@@ -2274,6 +2391,14 @@
icon => 'dismath.png',
linktitle => 'Change how math is displayed.'
},
+ {
+ linktext => 'Time Zone',
+ url => '/adm/preferences?action=changetimezone',
+ permission => $permissions{'timezone'},
+ #help => '',
+ icon => 'timezone.png',
+ linktitle => 'Set your time zone.',
+ }
]
},
{ categorytitle=>'Page Display Settings',
@@ -2532,6 +2657,10 @@
} elsif ($env{'form.action'} eq 'verify_and_change_lockednames') {
&verify_and_change_lockednames($r);
$ended = 1;
+ } elsif ($env{'form.action'} eq 'changetimezone') {
+ &timezonechanger($r);
+ } elsif ($env{'form.action'} eq 'verify_and_change_timezone') {
+ &verify_and_change_timezone($r);
}
# Properly end the HTML page of all preference pages
Index: loncom/localize/lonlocal.pm
diff -u loncom/localize/lonlocal.pm:1.68 loncom/localize/lonlocal.pm:1.69
--- loncom/localize/lonlocal.pm:1.68 Thu Oct 29 23:04:39 2020
+++ loncom/localize/lonlocal.pm Thu Sep 8 01:41:14 2022
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Localization routines
#
-# $Id: lonlocal.pm,v 1.68 2020/10/29 23:04:39 raeburn Exp $
+# $Id: lonlocal.pm,v 1.69 2022/09/08 01:41:14 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -363,7 +363,25 @@
}
return $timezone;
}
- my $cid = $Apache::lonnet::env{'request.course.id'};
+ my $cid = $Apache::lonnet::env{'request.course.id'};
+ if (&Apache::lonnet::usertools_access($Apache::lonnet::env{'user.name'},
+ $Apache::lonnet::env{'user.domain'},
+ 'timezone')) {
+ if ($Apache::lonnet::env{'environment.timezone'} ne '') {
+ $timezone = $Apache::lonnet::env{'environment.timezone'};
+ if ($cid ne '') {
+ if (($Apache::lonnet::env{'course.'.$cid.'.tzover'}) &&
+ ($Apache::lonnet::env{'course.'.$cid.'.timezone'} ne '')) {
+ $timezone = $Apache::lonnet::env{'course.'.$cid.'.timezone'};
+ }
+ }
+ if ($timezone ne '') {
+ if (DateTime::TimeZone->is_valid_name($timezone)) {
+ return $timezone;
+ }
+ }
+ }
+ }
if ($cid ne '') {
if ($Apache::lonnet::env{'course.'.$cid.'.timezone'}) {
$timezone = $Apache::lonnet::env{'course.'.$cid.'.timezone'};
Index: loncom/localize/localize/de.pm
diff -u loncom/localize/localize/de.pm:1.627 loncom/localize/localize/de.pm:1.628
--- loncom/localize/localize/de.pm:1.627 Sat Jun 11 17:32:33 2022
+++ loncom/localize/localize/de.pm Thu Sep 8 01:41:14 2022
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# German Localization Lexicon
#
-# $Id: de.pm,v 1.627 2022/06/11 17:32:33 raeburn Exp $
+# $Id: de.pm,v 1.628 2022/09/08 01:41:14 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -21856,6 +21856,9 @@
'Blogs, personal web pages, webDAV/quotas, portfolios'
=> 'Blogs, Persönliche Webseiten, WebDAV/Speicherplatz, Portfolios',
+ 'Blogs, personal pages/timezones, webDAV/quotas, portfolio'
+=> 'Blogs, Persönliche Webseiten/Zeitzone, WebDAV/Speicherplatz, Portfolios',
+
'View or modify a course or community'
=> 'Einen Kurs oder eine Community anzeigen oder ändern',
Index: loncom/localize/localize/ko.pm
diff -u loncom/localize/localize/ko.pm:1.7 loncom/localize/localize/ko.pm:1.8
--- loncom/localize/localize/ko.pm:1.7 Sat Jun 11 17:44:48 2022
+++ loncom/localize/localize/ko.pm Thu Sep 8 01:41:14 2022
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# German Localization Lexicon
#
-# $Id: ko.pm,v 1.7 2022/06/11 17:44:48 raeburn Exp $
+# $Id: ko.pm,v 1.8 2022/09/08 01:41:14 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -21802,8 +21802,8 @@
'Blogs, personal web pages, webDAV, portfolios'
=> 'Blogs, personal web pages, webDAV, portfolios',
- 'Blogs, personal web pages, webDAV/quotas, portfolios'
-=> 'Blogs, personal web pages, webDAV/quotas, portfolios',
+ 'Blogs, personal pages/timezones, webDAV/quotas, portfolio'
+=> 'Blogs, personal pages/timezones, webDAV/quotas, portfolio',
'View or modify a course or community'
=> 'View or modify a course or community',
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1488 loncom/lonnet/perl/lonnet.pm:1.1489
--- loncom/lonnet/perl/lonnet.pm:1.1488 Sat Jun 11 14:20:42 2022
+++ loncom/lonnet/perl/lonnet.pm Thu Sep 8 01:41:15 2022
@@ -1,7 +1,7 @@
# The LearningOnline Network
# TCP networking package
#
-# $Id: lonnet.pm,v 1.1488 2022/06/11 14:20:42 raeburn Exp $
+# $Id: lonnet.pm,v 1.1489 2022/09/08 01:41:15 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -7934,6 +7934,7 @@
blog => 1,
webdav => 1,
portfolio => 1,
+ timezone => 1,
);
}
return if (!defined($tools{$tool}));
Index: loncom/html/adm/help/tex/Course_Prefs_Language.tex
diff -u loncom/html/adm/help/tex/Course_Prefs_Language.tex:1.2 loncom/html/adm/help/tex/Course_Prefs_Language.tex:1.3
--- loncom/html/adm/help/tex/Course_Prefs_Language.tex:1.2 Wed Nov 27 23:17:25 2013
+++ loncom/html/adm/help/tex/Course_Prefs_Language.tex Thu Sep 8 01:41:16 2022
@@ -2,6 +2,6 @@
This panel lets you adapt the language and date format of your course:
\begin{itemize}
\item Language used: whatever you set here overrides both user and institutional settings, i.e., it forces a certain interface language on all users in the course.
-\item Timezone: allows you to set the timezone in which the course runs, which overrides the timezone of your institution.
+\item Timezone: allows you to set the time zone in which the course runs, which overrides the time zone of your institution. If a course time zone is set, there is also an option to set whether the course time zone should override an individual user preference (if set to be available for a particular user, at a domain level).
\item Locale used for course calendar: determines which day is considered the first day of the week when displaying the calendar (course announcements etc.) for a course.
\end{itemize}
Index: doc/loncapafiles/loncapafiles.lpml
diff -u doc/loncapafiles/loncapafiles.lpml:1.1032 doc/loncapafiles/loncapafiles.lpml:1.1033
--- doc/loncapafiles/loncapafiles.lpml:1.1032 Sun Aug 28 02:41:31 2022
+++ doc/loncapafiles/loncapafiles.lpml Thu Sep 8 01:41:16 2022
@@ -2,7 +2,7 @@
"http://lpml.sourceforge.net/DTD/lpml.dtd">
<!-- loncapafiles.lpml -->
-<!-- $Id: loncapafiles.lpml,v 1.1032 2022/08/28 02:41:31 raeburn Exp $ -->
+<!-- $Id: loncapafiles.lpml,v 1.1033 2022/09/08 01:41:16 raeburn Exp $ -->
<!--
@@ -8560,6 +8560,7 @@
system-lock-screen.png;
system-users.png;
timer.png;
+timezone.png;
trck-22x22.png;
ungrade_sub.png;
uplcrs.png;
More information about the LON-CAPA-cvs
mailing list