';
$itemcount ++;
}
if (ref($rowtotal)) {
@@ -4152,8 +4165,10 @@ sub print_selfcreation {
$datatable .= '
';
}
my $currval;
- if (ref($createsettings->{'shibenv'}) eq 'HASH') {
- $currval = $createsettings->{'shibenv'}{$fields[$i]};
+ if (ref($createsettings) eq 'HASH') {
+ if (ref($createsettings->{'shibenv'}) eq 'HASH') {
+ $currval = $createsettings->{'shibenv'}{$fields[$i]};
+ }
}
$datatable .= '
'.
''.
@@ -5157,7 +5172,8 @@ sub serverstatus_pages {
sub defaults_javascript {
my ($settings) = @_;
- my ($output,$jstext);
+ my ($output,$jstext);
+ return unless (ref($settings) eq 'HASH');
if ((ref($settings->{'inststatusorder'}) eq 'ARRAY') && (ref($settings->{'inststatustypes'}) eq 'HASH')) {
my $maxnum = scalar(@{$settings->{'inststatusorder'}});
if ($maxnum eq '') {
@@ -6968,8 +6984,9 @@ sub modify_quotas {
} else {
my $newpos = $env{'form.'.$itemid};
$newpos =~ s/\D+//g;
- foreach my $item ('subject','title','author') {
- next if (($item eq 'author') && ($type eq 'templates'));
+ foreach my $item ('subject','title','publisher','author') {
+ next if ((($item eq 'author') || ($item eq 'publisher')) &&
+ ($type eq 'templates'));
$confhash{$type}{$key}{$item} = $env{'form.'.$type.'_'.$item.'_'.$i};
if ($domconfig{$action}{$type}{$key}{$item} ne $confhash{$type}{$key}{$item}) {
$changes{$type}{$key} = 1;
@@ -7014,8 +7031,9 @@ sub modify_quotas {
foreach my $type ('textbooks','templates') {
if ($newbook{$type}) {
$changes{$type}{$newbook{$type}} = 1;
- foreach my $item ('subject','title','author') {
- next if (($item eq 'author') && ($type eq 'template'));
+ foreach my $item ('subject','title','publisher','author') {
+ next if ((($item eq 'author') || ($item eq 'publisher')) &&
+ ($type eq 'template'));
$env{'form.'.$type.'_addbook_'.$item} =~ s/(`)/'/g;
if ($env{'form.'.$type.'_addbook_'.$item}) {
$confhash{$type}{$newbook{$type}}{$item} = $env{'form.'.$type.'_addbook_'.$item};
@@ -7429,8 +7447,9 @@ sub modify_quotas {
my $coursetitle = $coursehash{'description'};
my $position = $confhash{$type}{$key}{'order'} + 1;
$resulttext .= '
';
- foreach my $item ('subject','title','author') {
- next if (($item eq 'author') && ($type eq 'templates'));
+ foreach my $item ('subject','title','publisher','author') {
+ next if ((($item eq 'author') || ($item eq 'publisher')) &&
+ ($type eq 'templates'));
my $name = $item.':';
$name =~ s/^(\w)/\U$1/;
$resulttext .= &mt($name).' '.$confhash{$type}{$key}{$item}.' ';
@@ -8522,7 +8541,7 @@ sub modify_selfcreation {
# value set to one), if self-creation with e-mail address permitted, where $type is user type: faculty, staff, student etc.
#
- if ($env{'form.cancreate_email'} eq 'email') {
+ if ($env{'form.cancreate_email'}) {
push(@contexts,'emailusername');
if (ref($types) eq 'ARRAY') {
foreach my $type (@{$types}) {
@@ -8940,17 +8959,19 @@ sub modify_selfcreation {
foreach my $type (@{$types}) {
if (ref($cancreate{'emailusername'}{$type}) eq 'HASH') {
if (keys(%{$cancreate{'emailusername'}{$type}}) > 0) {
- $chgtext .= &mt('When self-creating account with e-mail as username, the following information will be provided by [_1]:',$usertypes->{$type}).
+ $chgtext .= &mt('When self-creating account with e-mail as username, the following information will be provided by [_1]:',"'$usertypes->{$type}'").
'
';
foreach my $field (@{$infofields}) {
if ($cancreate{'emailusername'}{$type}{$field}) {
$chgtext .= '
'.$infotitles->{$field}.'
';
}
}
+ $chgtext .= '
';
+ } else {
+ $chgtext .= &mt('When self creating account with e-mail as username, no information besides e-mail address will be provided by [_1].',"'$usertypes->{$type}'").' ';
}
- $chgtext .= '';
} else {
- $chgtext .= &mt('When self creating account with e-mail as username, no information besides e-mail address will be provided by [_1].',$usertypes->{$type}).' ';
+ $chgtext .= &mt('When self creating account with e-mail as username, no information besides e-mail address will be provided by [_1].',"'$usertypes->{$type}'").' ';
}
}
}
@@ -9757,9 +9778,17 @@ sub modify_coursecategories {
}
$resulttext .= '';
if ($changes{'unauth'} || $changes{'auth'}) {
- &Apache::loncommon::devalidate_domconfig_cache($dom);
+ my %domdefaults = &Apache::lonnet::get_domain_defaults($dom);
+ if ($changes{'auth'}) {
+ $domdefaults{'catauth'} = $domconfig{'coursecategories'}{'auth'};
+ }
+ if ($changes{'unauth'}) {
+ $domdefaults{'catunauth'} = $domconfig{'coursecategories'}{'unauth'};
+ }
+ my $cachetime = 24*60*60;
+ &Apache::lonnet::do_cache_new('domdefaults',$dom,\%domdefaults,$cachetime);
if (ref($lastactref) eq 'HASH') {
- $lastactref->{'domainconfig'} = 1;
+ $lastactref->{'domdefaults'} = 1;
}
}
} else {
@@ -10967,7 +10996,7 @@ sub active_dc_picker {
my ($dcname,$dcdom) = split(':',$domcoord[0]);
my $user = &Apache::loncommon::plainname($dcname,$dcdom);
if ($inputtype eq 'radio') {
- $table .= ''.$user;
+ $table = ''.$user;
if ($user ne $dcname.':'.$dcdom) {
$table .= ' ('.$dcname.':'.$dcdom.')';
}
@@ -10976,9 +11005,9 @@ sub active_dc_picker {
if (exists($currhash{$domcoord[0]})) {
$check = ' checked="checked"';
}
- $table .= '