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

www lon-capa-cvs@mail.lon-capa.org
Thu, 15 Jan 2004 15:12:32 -0000


www		Thu Jan 15 10:12:32 2004 EDT

  Modified files:              
    /loncom/interface	lonmeta.pm lonmsg.pm 
  Log:
  Just saving my work.
  
  
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.57 loncom/interface/lonmeta.pm:1.58
--- loncom/interface/lonmeta.pm:1.57	Sat Jan  3 19:28:22 2004
+++ loncom/interface/lonmeta.pm	Thu Jan 15 10:12:31 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Metadata display handler
 #
-# $Id: lonmeta.pm,v 1.57 2004/01/04 00:28:22 www Exp $
+# $Id: lonmeta.pm,v 1.58 2004/01/15 15:12:31 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -610,21 +610,27 @@
   $target=~s/\.meta$//;
   my $bombs=&Apache::lonmsg::retrieve_author_res_msg($target);
   if ($bombs) {
-      if ($ENV{'form.delmsg'}) {
-	  if (&Apache::lonmsg::del_url_author_res_msg($target) eq 'ok') {
-	      $bombs=&mt('Messages deleted.');
-	  } else {
-	      $bombs=&mt('Error deleting messages');
+      my $del='';
+      if ($target=~/allbombs$/) {
+	  $disuri='All Error Messages';
+      } else {
+	  if ($ENV{'form.delmsg'}) {
+	      if (&Apache::lonmsg::del_url_author_res_msg($target) eq 'ok') {
+		  $bombs=&mt('Messages deleted.');
+	      } else {
+		  $bombs=&mt('Error deleting messages');
+	      }
 	  }
+	  $del='<input type="submit" name="delmsg" value="'.
+	      &mt('Delete Messages').'" />';
       }
       my $bodytag=&Apache::loncommon::bodytag('Error Messages');
-      my $del=&mt('Delete Messages');
       $r->print(<<ENDBOMBS);
 <html><head><title>Edit Catalog Information</title></head>
 $bodytag
 <h1>$disuri</h1>
 <form method="post" name="defaultmeta">
-<input type="submit" name="delmsg" value="$del" />
+$del
 <br />$bombs
 </form>
 </body>
Index: loncom/interface/lonmsg.pm
diff -u loncom/interface/lonmsg.pm:1.78 loncom/interface/lonmsg.pm:1.79
--- loncom/interface/lonmsg.pm:1.78	Wed Jan 14 22:53:12 2004
+++ loncom/interface/lonmsg.pm	Thu Jan 15 10:12:31 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging
 #
-# $Id: lonmsg.pm,v 1.78 2004/01/15 03:53:12 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 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.='<p><img src="/adm/lonMisc/bomb.gif" /><b>'.
+		($listall?"<a href='".&Apache::lonnet::clutter($errurl)."'><tt>".
+		 $errurl.
+		 '</tt></a> ':' ').
 		$content{'time'}.'</b>: '.$content{'message'}.
 		'<br /></p>';
 	}