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

raeburn raeburn at source.lon-capa.org
Sat May 31 00:32:13 EDT 2014


raeburn		Sat May 31 04:32:13 2014 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	domainprefs.pm 
  Log:
  - For 2.11
    - Backport 1.245, 1.246, 1.247.
  
  
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.160.6.49 loncom/interface/domainprefs.pm:1.160.6.50
--- loncom/interface/domainprefs.pm:1.160.6.49	Fri May 23 09:00:22 2014
+++ loncom/interface/domainprefs.pm	Sat May 31 04:32:12 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set domain-wide configuration settings
 #
-# $Id: domainprefs.pm,v 1.160.6.49 2014/05/23 09:00:22 raeburn Exp $
+# $Id: domainprefs.pm,v 1.160.6.50 2014/05/31 04:32:12 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -741,8 +741,9 @@
                 $output .= &print_login('help',$dom,$confname,$phase,$settings,\$rowtotal);
             }
         } elsif ($action eq 'requestcourses') {
-            $output .= &print_requestmail($dom,$action,$settings,\$rowtotal).
-                       &print_studentcode($settings,\$rowtotal).'
+            $output .= &print_requestmail($dom,$action,$settings,\$rowtotal);
+            $rowtotal ++;
+            $output .= &print_studentcode($settings,\$rowtotal).'
            </table>
           </td>
          </tr>
@@ -777,6 +778,7 @@
             &print_validation_rows('requestcourses',$dom,$settings,\$rowtotal);
         } elsif ($action eq 'requestauthor') {
             $output .= &print_requestmail($dom,$action,$settings,\$rowtotal);
+            $rowtotal ++;
         } elsif ($action eq 'rolecolors') {
             $output .= &print_rolecolors($phase,'coordinator',$dom,$confname,$settings,\$rowtotal).'
            </table>
@@ -2055,7 +2057,6 @@
         $datatable .= &mt('There are no active Domain Coordinators');
     }
     $datatable .='</td></tr>';
-    $$rowtotal += $rows;
     return $datatable;
 }
 
@@ -2500,13 +2501,15 @@
                   $createoff{'req'}.' value="0" />'.&mt('No').'</label></span>';
     my ($numdc,$dctable,$rows) = &active_dc_picker($dom,$numinrow,'radio',
                                                    'autocreate_xmldc',%currhash);
+    $datatable .= '</td></tr><tr class="LC_odd_row"><td>';
     if ($numdc > 1) {
-        $datatable .= '</td></tr><tr class="LC_odd_row"><td>'.
-                      &mt('Course creation processed as: (choose Dom. Coord.)').
-                      '</td><td class="LC_left_item">'.$dctable.'</td></tr>';
+        $datatable .= &mt('Course creation processed as: (choose Dom. Coord.)').
+                      '</td><td class="LC_left_item">';
     } else {
-        $datatable .= $dctable.'</td></tr>';
+        $datatable .= &mt('Course creation processed as:').
+                      '</td><td class="LC_right_item">';
     }
+    $datatable .= $dctable.'</td></tr>';
     $$rowtotal += $rows;
     return $datatable;
 }
@@ -3106,13 +3109,14 @@
         my $numinrow = 2;
         my ($numdc,$dctable,$rows) = &active_dc_picker($dom,$numinrow,'radio',
                                                        'validationdc',%currhash);
+        my $css_class = $itemcount%2 ? ' class="LC_odd_row"' : '';
+        $datatable .= '</td></tr><tr'.$css_class.'><td>';
         if ($numdc > 1) {
-            $datatable .= '</td></tr><tr class="LC_odd_row"><td>'.
-                          &mt('Course creation processed as: (choose Dom. Coord.)').
-                          '</td><td class="LC_left_item">'.$dctable.'</td></tr>';
+            $datatable .= &mt('Course creation processed as: (choose Dom. Coord.)');
         } else {
-            $datatable .= $dctable.'</td></tr>';
+            $datatable .=  &mt('Course creation processed as: ');
         }
+        $datatable .= '</td><td class="LC_left_item">'.$dctable.'</td></tr>';
         $itemcount ++;
     }
     if (ref($rowtotal)) {
@@ -8929,17 +8933,19 @@
                                 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}'").
                                                     '<ul>';
                                             foreach my $field (@{$infofields}) {
                                                 if ($cancreate{'emailusername'}{$type}{$field}) {
                                                     $chgtext .= '<li>'.$infotitles->{$field}.'</li>';
                                                 }
                                             }
+                                            $chgtext .= '</ul>';
+                                        } 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}'").'<br />';
                                         }
-                                        $chgtext .= '</ul>';
                                     } 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}).'<br />';
+                                        $chgtext .= &mt('When self creating account with e-mail as username, no information besides e-mail address will be provided by [_1].',"'$usertypes->{$type}'").'<br />';
                                     }
                                 }
                             }
@@ -9746,9 +9752,17 @@
             }
             $resulttext .= '</ul>';
             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 {
@@ -10956,7 +10970,7 @@
         my ($dcname,$dcdom) = split(':',$domcoord[0]);
         my $user = &Apache::loncommon::plainname($dcname,$dcdom);
         if ($inputtype eq 'radio') {
-            $table .= '<input type="hidden" name="'.$name.'" value="'.$domcoord[0].'" />'.$user;
+            $table = '<input type="hidden" name="'.$name.'" value="'.$domcoord[0].'" />'.$user;
             if ($user ne $dcname.':'.$dcdom) {
                 $table .=  ' ('.$dcname.':'.$dcdom.')';
             }
@@ -10965,9 +10979,9 @@
             if (exists($currhash{$domcoord[0]})) {
                 $check = ' checked="checked"';
             }
-            $table .= '<span class="LC_nobreak"><label>'.
-                      '<input type="checkbox" name="'.$name.'" '.
-                      'value="'.$domcoord[0].'"'.$check.' />'.$user;
+            $table = '<span class="LC_nobreak"><label>'.
+                     '<input type="checkbox" name="'.$name.'" '.
+                     'value="'.$domcoord[0].'"'.$check.' />'.$user;
             if ($user ne $dcname.':'.$dcdom) {
                 $table .=  ' ('.$dcname.':'.$dcdom.')';
             }




More information about the LON-CAPA-cvs mailing list