--- loncom/interface/domainprefs.pm 2014/05/09 15:02:31 1.242 +++ loncom/interface/domainprefs.pm 2014/05/30 00:11:06 1.245 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set domain-wide configuration settings # -# $Id: domainprefs.pm,v 1.242 2014/05/09 15:02:31 raeburn Exp $ +# $Id: domainprefs.pm,v 1.245 2014/05/30 00:11:06 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2135,11 +2135,12 @@ sub print_textbookcourses { my $key = $ordered{$items[$i]}; my %coursehash=&Apache::lonnet::coursedescription($key); my $coursetitle = $coursehash{'description'}; - my ($subject,$title,$author,$image,$imgsrc,$cdom,$cnum); + my ($subject,$title,$author,$publisher,$image,$imgsrc,$cdom,$cnum); if (ref($bookshash->{$key}) eq 'HASH') { $subject = $bookshash->{$key}->{'subject'}; $title = $bookshash->{$key}->{'title'}; if ($type eq 'textbooks') { + $publisher = $bookshash->{$key}->{'publisher'}; $author = $bookshash->{$key}->{'author'}; $image = $bookshash->{$key}->{'image'}; if ($image ne '') { @@ -2169,6 +2170,8 @@ sub print_textbookcourses { ''.&mt('Title:').' '; if ($type eq 'textbooks') { $datatable .= (' 'x2). + ''.&mt('Publisher:').' '. + (' 'x2). ''.&mt('Author(s):').' '. (' 'x2). ''.&mt('Thumbnail:'); @@ -2212,7 +2215,9 @@ sub print_textbookcourses { ''.&mt('Title:').' '."\n". (' 'x2); if ($type eq 'textbooks') { - $datatable .= ''.&mt('Author(s):').' '."\n". + $datatable .= ''.&mt('Publisher:').' '."\n". + (' 'x2). + ''.&mt('Author(s):').' '."\n". (' 'x2). ''.&mt('Image:').' '; if ($switchserver) { @@ -6968,8 +6973,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 +7020,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 +7436,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 +8530,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 +8948,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}'").'
    '; } } }