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

raeburn raeburn@source.lon-capa.org
Wed, 14 Apr 2010 05:16:48 -0000


raeburn		Wed Apr 14 05:16:48 2010 EDT

  Modified files:              (Branch: version_2_9_X)
    /loncom/interface	domainprefs.pm 
  Log:
  - Backport 1.134.
  
  
Index: loncom/interface/domainprefs.pm
diff -u loncom/interface/domainprefs.pm:1.102.2.13 loncom/interface/domainprefs.pm:1.102.2.14
--- loncom/interface/domainprefs.pm:1.102.2.13	Fri Mar 26 16:25:38 2010
+++ loncom/interface/domainprefs.pm	Wed Apr 14 05:16:47 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set domain-wide configuration settings
 #
-# $Id: domainprefs.pm,v 1.102.2.13 2010/03/26 16:25:38 raeburn Exp $
+# $Id: domainprefs.pm,v 1.102.2.14 2010/04/14 05:16:47 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1960,12 +1960,13 @@
     my ($dom,$settings,$rowtotal) = @_;
     my $datatable;
     my @contacts = ('adminemail','supportemail');
-    my (%checked,%to,%otheremails);
+    my (%checked,%to,%otheremails,%bccemails);
     my @mailings = ('errormail','packagesmail','lonstatusmail','helpdeskmail',
                     'requestsmail');
     foreach my $type (@mailings) {
         $otheremails{$type} = '';
     }
+    $bccemails{'helpdeskmail'} = '';
     if (ref($settings) eq 'HASH') {
         foreach my $item (@contacts) {
             if (exists($settings->{$item})) {
@@ -1981,6 +1982,9 @@
                         }
                     }
                     $otheremails{$type} = $settings->{$type}{'others'};
+                    if ($type eq 'helpdeskmail') {
+                        $bccemails{$type} = $settings->{$type}{'bcc'};
+                    }
                 }
             } elsif ($type eq 'lonstatusmail') {
                 $checked{'lonstatusmail'}{'adminemail'} = ' checked="checked" ';
@@ -2024,8 +2028,13 @@
         }
         $datatable .= '</span><br />'.&mt('Others').':&nbsp;&nbsp;'.
                       '<input type="text" name="'.$type.'_others" '.
-                      'value="'.$otheremails{$type}.'"  />'.
-                      '</td></tr>'."\n";
+                      'value="'.$otheremails{$type}.'"  />';
+        if ($type eq 'helpdeskmail') {
+            $datatable .= '<br />'.&mt('Bcc').':'.('&nbsp;'x6).
+                          '<input type="text" name="'.$type.'_bcc" '.
+                          'value="'.$bccemails{$type}.'"  />';
+        }
+        $datatable .= '</td></tr>'."\n";
     }
     $$rowtotal += $rownum;
     return $datatable;
@@ -5025,7 +5034,7 @@
             $currsetting{$key} = $domconfig{'contacts'}{$key};
         }
     }
-    my (%others,%to);
+    my (%others,%to,%bcc);
     my @contacts = ('supportemail','adminemail');
     my @mailings = ('errormail','packagesmail','helpdeskmail','lonstatusmail',
                     'requestsmail');
@@ -5041,6 +5050,10 @@
         }  
         $others{$type} = $env{'form.'.$type.'_others'};
         $contacts_hash{contacts}{$type}{'others'} = $others{$type};
+        if ($type eq 'helpdeskmail') {
+            $bcc{$type} = $env{'form.'.$type.'_bcc'};
+            $contacts_hash{contacts}{$type}{'bcc'} = $bcc{$type};
+        }
     }
     foreach my $item (@contacts) {
         $to{$item} = $env{'form.'.$item};
@@ -5065,6 +5078,11 @@
             if ($others{$type} ne $currsetting{$type}{'others'}) {
                 push(@{$changes{$type}},'others');
             }
+            if ($type eq 'helpdeskmail') {
+                if ($bcc{$type} ne $currsetting{$type}{'bcc'}) {
+                    push(@{$changes{$type}},'bcc');
+                }
+            }
         }
     } else {
         my %default;
@@ -5087,7 +5105,12 @@
             }
             if ($others{$type} ne '') {
                 push(@{$changes{$type}},'others');
-            } 
+            }
+            if ($type eq 'helpdeskmail') {
+                if ($bcc{$type} ne '') {
+                    push(@{$changes{$type}},'bcc');
+                }
+            }
         }
     }
     my $putresult = &Apache::lonnet::put_dom('configuration',\%contacts_hash,
@@ -5115,7 +5138,13 @@
                         push(@text,$others{$type});
                     }
                     $resulttext .= '<span class="LC_cusr_emph">'.
-                                   join(', ',@text).'</span></li>';
+                                   join(', ',@text).'</span>';
+                    if ($type eq 'helpdeskmail') {
+                        if ($bcc{$type} ne '') {
+                            $resulttext .= '&nbsp;'.&mt('with Bcc to').': <span class="LC_cusr_emph">'.$bcc{$type}.'</span>';
+                        }
+                    }
+                    $resulttext .= '</li>';
                 }
             }
             $resulttext .= '</ul>';