[LON-CAPA-cvs] cvs: loncom /interface domainprefs.pm lonrequestcourse.pm

raeburn raeburn at source.lon-capa.org
Fri May 9 13:43:14 EDT 2014


raeburn		Fri May  9 17:43:14 2014 EDT

  Modified files:              
    /loncom/interface	domainprefs.pm lonrequestcourse.pm 
  Log:
  - Add "publisher" field to display of available "textbooks" whicn may bea
    selected for cloning when requesting a textbook course.
  
  
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.242 loncom/interface/domainprefs.pm:1.243
--- loncom/interface/domainprefs.pm:1.242	Fri May  9 15:02:31 2014
+++ loncom/interface/domainprefs.pm	Fri May  9 17:43:13 2014
@@ -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.243 2014/05/09 17:43:13 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2135,11 +2135,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 '') {
@@ -2169,6 +2170,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:');
@@ -2212,7 +2215,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) {
@@ -6968,8 +6973,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;
@@ -7014,8 +7020,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};
@@ -7429,8 +7436,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 />';
Index: loncom/interface/lonrequestcourse.pm
diff -u loncom/interface/lonrequestcourse.pm:1.81 loncom/interface/lonrequestcourse.pm:1.82
--- loncom/interface/lonrequestcourse.pm:1.81	Fri May  9 15:02:31 2014
+++ loncom/interface/lonrequestcourse.pm	Fri May  9 17:43:13 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Request a course
 #
-# $Id: lonrequestcourse.pm,v 1.81 2014/05/09 15:02:31 raeburn Exp $
+# $Id: lonrequestcourse.pm,v 1.82 2014/05/09 17:43:13 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -4543,7 +4543,8 @@
                 }
                 $r->print('<th>'.&mt('Subject').'</th>');
                 if ($type eq 'textbooks') {
-                    $r->print('<th>'.&mt('Book').'</th>');
+                    $r->print('<th>'.&mt('Publisher').'</th>'.
+                              '<th>'.&mt('Book').'</th>');
                 }
                 $r->print(&Apache::loncommon::end_data_table_header_row());
                 my @items = sort { $a <=> $b } keys(%{$ordered{$type}});
@@ -4560,7 +4561,8 @@
                     }
                     $r->print('<td>'.$prefab{$type}{$item}{'subject'}.'</td>');
                     if ($type eq 'textbooks') {
-                        $r->print('<td><img border="0" src="'.$prefab{$type}{$item}{'image'}.
+                        $r->print('<td>'.$prefab{$type}{$item}{'publisher'}.'</td>'.
+                                  '<td><img border="0" src="'.$prefab{$type}{$item}{'image'}.
                                   '" alt="'.$cleantitle.'" /></td>');
                     }
                     $r->print(&Apache::loncommon::end_data_table_row());




More information about the LON-CAPA-cvs mailing list