[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface domainprefs.pm

raeburn raeburn at source.lon-capa.org
Fri May 9 13:49:48 EDT 2014


raeburn		Fri May  9 17:49:48 2014 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	domainprefs.pm 
  Log:
  - For 2.11
    - Backport 1.243.
  
  
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.160.6.46 loncom/interface/domainprefs.pm:1.160.6.47
--- loncom/interface/domainprefs.pm:1.160.6.46	Fri May  9 15:23:28 2014
+++ loncom/interface/domainprefs.pm	Fri May  9 17:49:47 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set domain-wide configuration settings
 #
-# $Id: domainprefs.pm,v 1.160.6.46 2014/05/09 15:23:28 raeburn Exp $
+# $Id: domainprefs.pm,v 1.160.6.47 2014/05/09 17:49:47 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2117,11 +2117,12 @@
             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 '') {
@@ -2151,6 +2152,8 @@
                 '<span class="LC_nobreak">'.&mt('Title:').'<input type="text" size="30" name="'.$type.'_title_'.$i.'" value="'.$title.'" /></span> ';
             if ($type eq 'textbooks') {
                 $datatable .= (' 'x2).
+                              '<span class="LC_nobreak">'.&mt('Publisher:').'<input type="text" size="10" name="'.$type.'_publisher_'.$i.'" value="'.$publisher.'" /></span> '.
+                              (' 'x2).
                               '<span class="LC_nobreak">'.&mt('Author(s):').'<input type="text" size="25" name="'.$type.'_author_'.$i.'" value="'.$author.'" /></span> '.
                               (' 'x2).
                               '<span class="LC_nobreak">'.&mt('Thumbnail:');
@@ -2194,7 +2197,9 @@
                   '<span class="LC_nobreak">'.&mt('Title:').'<input type="text" size="30" name="'.$type.'_addbook_title" value="" /></span> '."\n".
                   (' 'x2);
     if ($type eq 'textbooks') {
-        $datatable .= '<span class="LC_nobreak">'.&mt('Author(s):').'<input type="text" size="25" name="'.$type.'_addbook_author" value="" /></span> '."\n".
+        $datatable .= '<span class="LC_nobreak">'.&mt('Publisher:').'<input type="text" size="10" name="'.$type.'_addbook_publisher" value="" /></span> '."\n".
+                      (' 'x2).
+                      '<span class="LC_nobreak">'.&mt('Author(s):').'<input type="text" size="25" name="'.$type.'_addbook_author" value="" /></span> '."\n".
                       (' 'x2).
                       '<span class="LC_nobreak">'.&mt('Image:').' ';
         if ($switchserver) {
@@ -6950,8 +6955,9 @@
                                 } 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;
@@ -6996,8 +7002,9 @@
             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};
@@ -7411,8 +7418,9 @@
                             my $coursetitle = $coursehash{'description'};
                             my $position = $confhash{$type}{$key}{'order'} + 1;
                             $resulttext .= '<li>';
-                            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}.'<br />';




More information about the LON-CAPA-cvs mailing list