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

raeburn raeburn at source.lon-capa.org
Fri Jan 3 21:10:36 EST 2014


raeburn		Sat Jan  4 02:10:36 2014 EDT

  Modified files:              
    /loncom/interface	lonrequestcourse.pm 
  Log:
  - Include course title in message sent to course requestor containing
    unique code.
  - Change args passed to &notification_information() to include course domain
    as third arg. $dom is used to construct $cid argument when calling 
    loncoursequeueadmin::send_selfserve_notification(), where appropriate.
  
  
Index: loncom/interface/lonrequestcourse.pm
diff -u loncom/interface/lonrequestcourse.pm:1.73 loncom/interface/lonrequestcourse.pm:1.74
--- loncom/interface/lonrequestcourse.pm:1.73	Fri Jan  3 18:39:51 2014
+++ loncom/interface/lonrequestcourse.pm	Sat Jan  4 02:10:36 2014
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Request a course
 #
-# $Id: lonrequestcourse.pm,v 1.73 2014/01/03 18:39:51 raeburn Exp $
+# $Id: lonrequestcourse.pm,v 1.74 2014/01/04 02:10:36 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -3706,7 +3706,7 @@
                 if (($code) || ((ref($postprocess) eq 'HASH') && 
                                 (($postprocess->{'createdweb'}) || ($postprocess->{'createdmsg'})))) {
                     $output .= &notification_information($disposition,$env{'user.name'}.':'.$env{'user.domain'},
-                                                         $cnum,$now,$code,$postprocess);
+                                                         $dom,$cnum,$now,$code,$postprocess);
                 }
                 if ($code) {
                     $reqhash{'code'} = $code;
@@ -3764,7 +3764,7 @@
                     }
                     $output .= '<br />'.
                               &notification_information($disposition,$req_notifylist,
-                                                        $cnum,$now);
+                                                        $dom,$cnum,$now);
                 } else {
                     $reqstatus = 'domainerror';
                     $reqhash{'disposition'} = $disposition;
@@ -3782,7 +3782,7 @@
             } else {
                 $output .= '<p>'.&mt('Your course request has been updated').'</p>';
             }
-            $output .= &notification_information($disposition,$req_notifylist,$cnum,$now);
+            $output .= &notification_information($disposition,$req_notifylist,$dom,$cnum,$now);
             if ($disposition eq 'approval') {
                 my $fullname = &Apache::loncommon::plainname($env{'user.name'},
                                                              $env{'user.domain'});
@@ -3792,7 +3792,7 @@
                 if ((ref($postprocess) eq 'HASH') && 
                     ((ref($postprocess->{'queuedmsg'}) eq 'HASH') || ($postprocess->{'queuedweb'}))) { 
                     my $recipient = $env{'user.name'}.':'.$env{'user.domain'};
-                    $output .= &notification_information($disposition,$recipient,$cnum,$now,undef,$postprocess);
+                    $output .= &notification_information($disposition,$recipient,$dom,$cnum,$now,undef,$postprocess);
                 }
             }
         }
@@ -3946,7 +3946,7 @@
 }
 
 sub notification_information {
-    my ($disposition,$req_notifylist,$cnum,$now,$code,$postprocess) = @_;
+    my ($disposition,$req_notifylist,$dom,$cnum,$now,$code,$postprocess) = @_;
     my %emails = &Apache::loncommon::getemails();
     my $address;
     if (($emails{'permanentemail'} ne '') || ($emails{'notification'} ne '')) {
@@ -3966,7 +3966,8 @@
             my $fullname = &Apache::loncommon::plainname($env{'user.name'},
                                                          $env{'user.domain'});
             my $sender = $env{'user.name'}.':'.$env{'user.domain'};
-            &Apache::loncoursequeueadmin::send_selfserve_notification($req_notifylist,"$fullname ($env{'user.name'}:$env{'user.domain'})",$cnum,$env{'form.cdescr'},$now,'coursereq',$sender);
+            &Apache::loncoursequeueadmin::send_selfserve_notification($req_notifylist,"$fullname ($env{'user.name'}:$env{'user.domain'})",
+                                                                      'undef',$env{'form.cdescr'},$now,'coursereq',$sender);
         }
         if (ref($postprocess) eq 'HASH') {
             if (ref($postprocess->{'queuedmsg'}) eq 'ARRAY') {
@@ -3982,7 +3983,7 @@
                         }
                     }
                     if (scalar(@{$addmsg}) > 0) {
-                        &Apache::loncoursequeueadmin::send_selfserve_notification($recipient,$addmsg,$cnum,
+                        &Apache::loncoursequeueadmin::send_selfserve_notification($recipient,$addmsg,undef,
                                                                                   $env{'form.cdescr'},$now,
                                                                                   'queuedreq',$sender);
                     }
@@ -4006,8 +4007,8 @@
             my $sender = $recipient;
             if ($code) {
                 push(@{$addmsg},{
-                                  mt   => 'Students can automatically select your course by entering this code: [_1]',
-                                  args => [$code],
+                                  mt   => 'Students can automatically select your course: "[_1]" by entering this code: [_2]',
+                                  args => [$env{'form.cdescr'},$code],
                                 });
                 $output .= '<p>'.
                            &mt('Students can automatically select your course by entering this code: [_1].','<b>'.$code.'</b>').
@@ -4037,7 +4038,7 @@
                 if ($code) {
                     $type = 'uniquecode';
                 }
-                &Apache::loncoursequeueadmin::send_selfserve_notification($recipient,$addmsg,$cnum,$env{'form.cdescr'},
+                &Apache::loncoursequeueadmin::send_selfserve_notification($recipient,$addmsg,$dom.'_'.$cnum,$env{'form.cdescr'},
                                                                           $now,$type,$sender);
             }
         }




More information about the LON-CAPA-cvs mailing list