--- loncom/interface/lonmsg.pm 2003/12/30 22:45:59 1.76 +++ loncom/interface/lonmsg.pm 2004/01/15 15:12:31 1.79 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines for messaging # -# $Id: lonmsg.pm,v 1.76 2003/12/30 22:45:59 www Exp $ +# $Id: lonmsg.pm,v 1.79 2004/01/15 15:12:31 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -274,13 +274,18 @@ sub author_res_msg { sub retrieve_author_res_msg { my $url=shift; $url=&Apache::lonnet::declutter($url); - my ($domain,$author)=($url=~/^(\w+)\/(\w+)\//); + my ($domain,$author,$file)=($url=~/^(\w+)\/(\w+)\/(.+)$/); + my $listall=($file eq 'allbombs'); my %errormsgs=&Apache::lonnet::dump('nohist_res_msgs',$domain,$author); my $msgs=''; foreach (keys %errormsgs) { - if ($_=~/^\Q$url\E\_\d+$/) { + if (($_=~/^\Q$url\E\_\d+$/) || ($listall)) { + my ($errurl)=($_=~/^(.+)\_(\d+)$/); my %content=&unpackagemsg($errormsgs{$_}); $msgs.='

'. + ($listall?"". + $errurl. + ' ':' '). $content{'time'}.': '.$content{'message'}. '

'; } @@ -294,6 +299,14 @@ sub retrieve_author_res_msg { sub del_url_author_res_msg { my $url=shift; $url=&Apache::lonnet::declutter($url); + my ($domain,$author)=($url=~/^(\w+)\/(\w+)\//); + my @delmsgs=(); + foreach (&Apache::lonnet::getkeys('nohist_res_msgs',$domain,$author)) { + if ($_=~/^\Q$url\E\_\d+$/) { + push (@delmsgs,$_); + } + } + return &Apache::lonnet::del('nohist_res_msgs',\@delmsgs,$domain,$author); } # ================= Return hash with URLs for which there is a resource message @@ -1016,7 +1029,9 @@ sub handler { if (!$ENV{'form.display'}) { $r->print('EMail and Messaging'. &Apache::loncommon::studentbrowser_javascript().''. - &Apache::loncommon::bodytag('EMail and Messages')); + &Apache::loncommon::bodytag('EMail and Messages'). + &Apache::loncommon::help_open_faq(12). + &Apache::loncommon::help_open_bug('Communication Tools')); } if ($ENV{'form.display'}) { my $msgid=$ENV{'form.display'}; @@ -1043,7 +1058,9 @@ sub handler { } $r->print(&Apache::loncommon::studentbrowser_javascript(). ''. - &Apache::loncommon::bodytag('EMail and Messages')); + &Apache::loncommon::bodytag('EMail and Messages'). + &Apache::loncommon::help_open_faq(12). + &Apache::loncommon::help_open_bug('Communication Tools')); $r->print(''.&mt('Subject').': '.$content{'subject'}. '
'.&mt('From').': '. &Apache::loncommon::aboutmewrapper(