Diff for /loncom/interface/lonmsg.pm between versions 1.23 and 1.24

version 1.23, 2001/10/01 19:24:49 version 1.24, 2001/11/05 19:44:23
Line 14 Line 14
 # 02/06/01 Gerd Kortemeyer  # 02/06/01 Gerd Kortemeyer
 # 07/27 Guy Albertelli  # 07/27 Guy Albertelli
 # 07/27,07/28,07/30,08/03,08/06,08/08,08/09,08/10,8/13,8/15,  # 07/27,07/28,07/30,08/03,08/06,08/08,08/09,08/10,8/13,8/15,
 # 10/1 Gerd Kortemeyer  # 10/1,11/5 Gerd Kortemeyer
   
 package Apache::lonmsg;  package Apache::lonmsg;
   
Line 115  sub author_res_msg { Line 115  sub author_res_msg {
 # ================================================== Critical message to a user  # ================================================== Critical message to a user
   
 sub user_crit_msg {  sub user_crit_msg {
     my ($user,$domain,$subject,$message)=@_;      my ($user,$domain,$subject,$message,$sendback)=@_;
 # Check if allowed missing  # Check if allowed missing
     my $status='';      my $status='';
     my $msgid='undefined';      my $msgid='undefined';
Line 123  sub user_crit_msg { Line 123  sub user_crit_msg {
     my $homeserver=&Apache::lonnet::homeserver($user,$domain);      my $homeserver=&Apache::lonnet::homeserver($user,$domain);
     if ($homeserver ne 'no_host') {      if ($homeserver ne 'no_host') {
        ($msgid,$message)=&packagemsg($subject,$message);         ($msgid,$message)=&packagemsg($subject,$message);
          if ($sendback) { $message.='<sendback>true</sendback>'; }
        $status=&Apache::lonnet::critical(         $status=&Apache::lonnet::critical(
            'put:'.$domain.':'.$user.':critical:'.             'put:'.$domain.':'.$user.':critical:'.
            &Apache::lonnet::escape($msgid).'='.             &Apache::lonnet::escape($msgid).'='.
Line 146  sub user_crit_received { Line 147  sub user_crit_received {
     my $msgid=shift;      my $msgid=shift;
     my %message=&Apache::lonnet::get('critical',[$msgid]);      my %message=&Apache::lonnet::get('critical',[$msgid]);
     my %contents=&unpackagemsg($message{$msgid});      my %contents=&unpackagemsg($message{$msgid});
     my $status='rec: '.      my $status='rec: '.($contents{'sendback'}?
      &user_normal_msg($contents{'sendername'},$contents{'senderdomain'},       &user_normal_msg($contents{'sendername'},$contents{'senderdomain'},
                      'Receipt: '.$ENV{'user.name'}.' at '.$ENV{'user.domain'},                       'Receipt: '.$ENV{'user.name'}.' at '.$ENV{'user.domain'},
                      'User '.$ENV{'user.name'}.' at '.$ENV{'user.domain'}.                       'User '.$ENV{'user.name'}.' at '.$ENV{'user.domain'}.
                      ' acknowledged receipt of message "'.                       ' acknowledged receipt of message "'.
                      $contents{'subject'}.'" dated '.$contents{'time'}.".\n\n"                       $contents{'subject'}.'" dated '.$contents{'time'}.".\n\n"
                      .'Message ID: '.$contents{'msgid'});                       .'Message ID: '.$contents{'msgid'}):'no msg req');
     $status.=' trans: '.      $status.=' trans: '.
      &Apache::lonnet::put(       &Apache::lonnet::put(
      'nohist_email',{$contents{'msgid'} => $message{$msgid}});       'nohist_email',{$contents{'msgid'} => $message{$msgid}});
Line 308  sub comprep { Line 309  sub comprep {
       my $dispcrit='';        my $dispcrit='';
       if (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) {        if (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) {
          $dispcrit=           $dispcrit=
      '<input type=checkbox name=critmsg> Send as critical message<p>';   '<input type=checkbox name=critmsg> Send as critical message<br>'.
    '<input type=checkbox name=sendbck> Send as critical message'.
    ' and return receipt<p>';
       }        }
       $r->print(<<"ENDREPLY");        $r->print(<<"ENDREPLY");
 <form action="/adm/email" method=post>  <form action="/adm/email" method=post>
Line 367  sub compout { Line 370  sub compout {
     my $func='Send New';      my $func='Send New';
       if (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) {        if (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) {
          $dispcrit=           $dispcrit=
      '<input type=checkbox name=critmsg> Send as critical message<p>';   '<input type=checkbox name=critmsg> Send as critical message<br>'.
    '<input type=checkbox name=sendbck> Send as critical message'.
    ' and return receipt<p>';
       }        }
     if ($forwarding) {      if ($forwarding) {
        $dispcrit.='<input type=hidden name=forwid value="'.         $dispcrit.='<input type=hidden name=forwid value="'.
Line 493  sub handler { Line 498  sub handler {
       my %message=&Apache::lonnet::get('nohist_email',[$msgid]);        my %message=&Apache::lonnet::get('nohist_email',[$msgid]);
       my %content=&unpackagemsg($message{$msgid});        my %content=&unpackagemsg($message{$msgid});
       &statuschange($msgid,'replied');        &statuschange($msgid,'replied');
       if (($ENV{'form.critmsg'}) &&         if ((($ENV{'form.critmsg'}) || ($ENV{'form.sendbck'})) && 
           (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}))) {            (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}))) {
          $r->print('Sending critical: '.           $r->print('Sending critical: '.
                 &user_crit_msg($content{'sendername'},                  &user_crit_msg($content{'sendername'},
                                  $content{'senderdomain'},                                   $content{'senderdomain'},
                                  $ENV{'form.subject'},                                   $ENV{'form.subject'},
                                  $ENV{'form.message'}));                                   $ENV{'form.message'},
                                    $ENV{'form.sendbck'}));
       } else {        } else {
          $r->print('Sending: '.&user_normal_msg($content{'sendername'},           $r->print('Sending: '.&user_normal_msg($content{'sendername'},
                                  $content{'senderdomain'},                                   $content{'senderdomain'},
Line 578  sub handler { Line 584  sub handler {
       my ($recuname,$recdomain)=split(/\:/,$_);        my ($recuname,$recdomain)=split(/\:/,$_);
       my $msgtxt=$ENV{'form.message'};        my $msgtxt=$ENV{'form.message'};
       if ($toaddr{$_}) { $msgtxt.='<hr>'.$toaddr{$_}; }            if ($toaddr{$_}) { $msgtxt.='<hr>'.$toaddr{$_}; }    
       if (($ENV{'form.critmsg'}) &&         if ((($ENV{'form.critmsg'}) || ($ENV{'form.sendbck'})) && 
           (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}))) {            (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}))) {
          $r->print('Sending critical: '.           $r->print('Sending critical: '.
                 &user_crit_msg($recuname,$recdomain,                  &user_crit_msg($recuname,$recdomain,
                                  $ENV{'form.subject'},                                   $ENV{'form.subject'},
                                  $msgtxt,                                   $msgtxt,
                                  $content{'citation'}));                                   $ENV{'form.sendbck'}));
       } else {        } else {
          $r->print('Sending: '.&user_normal_msg($recuname,$recdomain,           $r->print('Sending: '.&user_normal_msg($recuname,$recdomain,
                                  $ENV{'form.subject'},                                   $ENV{'form.subject'},

Removed from v.1.23  
changed lines
  Added in v.1.24


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>