--- loncom/interface/lonmsg.pm 2006/04/23 05:47:33 1.173.2.1 +++ loncom/interface/lonmsg.pm 2006/06/19 09:36:14 1.173.2.2 @@ -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 @@ sub all_url_author_res_msg { 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 @@ ENDTREC ($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('

'.&Apache::loncommon::plainname($env{'form.recuname'}, $env{'form.recdomain'}).'

');