[LON-CAPA-cvs] cvs: loncom(version_2_1_X) /interface lonmsg.pm

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 19 Jun 2006 09:36:16 -0000


albertel		Mon Jun 19 05:36:16 2006 EDT

  Modified files:              (Branch: version_2_1_X)
    /loncom/interface	lonmsg.pm 
  Log:
  - backport lonmsg.pm 1.185 lonmsgdisplay 1.31
  
  
Index: loncom/interface/lonmsg.pm
diff -u loncom/interface/lonmsg.pm:1.173.2.1 loncom/interface/lonmsg.pm:1.173.2.2
--- loncom/interface/lonmsg.pm:1.173.2.1	Sun Apr 23 01:47:33 2006
+++ loncom/interface/lonmsg.pm	Mon Jun 19 05:36:14 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging
 #
-# $Id: lonmsg.pm,v 1.173.2.1 2006/04/23 05:47:33 albertel Exp $
+# $Id: lonmsg.pm,v 1.173.2.2 2006/06/19 09:36:14 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -431,6 +431,18 @@
     return %returnhash;
 }
 
+# ====================================== Add a comment to the User Notes screen
+
+sub store_instructor_comment {
+    my ($msg,$uname,$udom) = @_;
+    my $cid  = $env{'request.course.id'};
+    my $cnum = $env{'course.'.$cid.'.num'};
+    my $cdom = $env{'course.'.$cid.'.domain'};
+    my $subject= &mt('Record').' ['.$uname.':'.$udom.']';
+    my $result = &user_normal_msg_raw($cnum,$cdom,$subject,$msg);
+    return $result;
+}
+
 # ================================================== Critical message to a user
 
 sub user_crit_msg_raw {
@@ -1544,13 +1556,9 @@
         ($env{'form.recdomain'}) && ($env{'form.recuname'})) {
         chomp($env{'form.newrecord'});
         if ($env{'form.newrecord'}) {
-           my $recordtxt = $env{'form.newrecord'};
-           &user_normal_msg_raw(
-            $env{'course.'.$env{'request.course.id'}.'.num'},
-            $env{'course.'.$env{'request.course.id'}.'.domain'},
-            &mt('Record').
-	     ' ['.$env{'form.recuname'}.':'.$env{'form.recdomain'}.']',
-	    $recordtxt);
+	    &Apache::lonmsg::store_instructor_comment($env{'form.newrecord'},
+						      $env{'form.recuname'},
+						      $env{'form.recdomain'});
         }
         $r->print('<h3>'.&Apache::loncommon::plainname($env{'form.recuname'},
 				     $env{'form.recdomain'}).'</h3>');