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

www lon-capa-cvs@mail.lon-capa.org
Tue, 30 Dec 2003 14:57:49 -0000


www		Tue Dec 30 09:57:49 2003 EDT

  Modified files:              
    /loncom/interface	lonmeta.pm lonmsg.pm 
  Log:
  Bug #2444: saving my work, does not work yet.
  
  
Index: loncom/interface/lonmeta.pm
diff -u loncom/interface/lonmeta.pm:1.48 loncom/interface/lonmeta.pm:1.49
--- loncom/interface/lonmeta.pm:1.48	Mon Dec 29 16:17:00 2003
+++ loncom/interface/lonmeta.pm	Tue Dec 30 09:57:49 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Metadata display handler
 #
-# $Id: lonmeta.pm,v 1.48 2003/12/29 21:17:00 www Exp $
+# $Id: lonmeta.pm,v 1.49 2003/12/30 14:57:49 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -37,6 +37,7 @@
 use Apache::lonpublisher;
 use Apache::lonlocal;
 use Apache::lonmysql;
+use Apache::lonmsg;
 
 # MySQL table columns
 
@@ -529,18 +530,12 @@
       if ((($ENV{'user.domain'} eq $1) && ($ENV{'user.name'} eq $2))
 	  || ($ENV{'user.role.ca./'.$1.'/'.$2})) {
 	  $r->print(
-		    '<h4>'.&mt('Evaluation Comments').' ('.&mt('visible to author and co-authors only').')</h4>'.
+		    '<h4>'.&mt('Evaluation Comments').' ('.
+		    &mt('visible to author and co-authors only').')</h4>'.
 		    '<blockquote>'.$dynmeta{'comments'}.'</blockquote>');
 	  $r->print('<h4>'.&mt('Error Messages').' ('.
-		    &mt('visible to author and co-authors only').')</h4>');
-	  my %errormsgs=&Apache::lonnet::dump('nohist_res_msgs',$1,$2);
-	  foreach (keys %errormsgs) {
-	      if ($_=~/^\Q$disuri\E\_\d+$/) {
-		  my %content=&Apache::lonmsg::unpackagemsg($errormsgs{$_});
-		  $r->print('<b>'.$content{'time'}.'</b>: '.$content{'message'}.
-			    '<br />');
-	      }
-	  }      
+		    &mt('visible to author and co-authors only').')</h4>'.
+		    &Apache::lonmsg::retrieve_author_res_msg($2,$1,$disuri));
       }
 # ------------------------------------------------------------- All other stuff
       $r->print(
Index: loncom/interface/lonmsg.pm
diff -u loncom/interface/lonmsg.pm:1.72 loncom/interface/lonmsg.pm:1.73
--- loncom/interface/lonmsg.pm:1.72	Mon Dec 29 16:21:39 2003
+++ loncom/interface/lonmsg.pm	Tue Dec 30 09:57:49 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging
 #
-# $Id: lonmsg.pm,v 1.72 2003/12/29 21:21:39 www Exp $
+# $Id: lonmsg.pm,v 1.73 2003/12/30 14:57:49 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -282,6 +282,37 @@
           &Apache::lonnet::escape($message),$homeserver);
     }
     return 'no_host';
+}
+
+# =========================================== Retrieve author resource messages
+
+sub retrieve_author_res_msg {
+    my ($author,$domain,$url)=@_;
+    $url=&Apache::lonnet::declutter($url);
+    my %errormsgs=&Apache::lonnet::dump('nohist_res_msgs',$1,$2);
+    my $msgs='';
+    foreach (keys %errormsgs) {
+	if ($_=~/^\Q$url\E\_\d+$/) {
+	    my %content=&unpackagemsg($errormsgs{$_});
+	    $msgs.='<b>'.$content{'time'}.'</b>: '.$content{'message'}.
+		      '<br />';
+	}
+    } 
+    return $msgs;     
+}
+
+
+# =============================== Delete all author messages related to one URL
+
+sub del_url_author_res_msg {
+    my ($author,$domain,$url)=@_;
+    $url=&Apache::lonnet::declutter($url);
+}
+
+# ================= Return hash with URLs for which there is a resource message
+
+sub all_url_author_res_msg {
+    my ($author,$domain)=@_;
 }
 
 # ================================================== Critical message to a user