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

www lon-capa-cvs@mail.lon-capa.org
Tue, 30 Dec 2003 22:46:00 -0000


www		Tue Dec 30 17:46:00 2003 EDT

  Modified files:              
    /loncom/auth	lonroles.pm 
    /loncom/interface	lonmsg.pm 
  Log:
  Bombs in "Remarks" field on Roles screen for author roles with bombs.
  
  
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.80 loncom/auth/lonroles.pm:1.81
--- loncom/auth/lonroles.pm:1.80	Tue Dec  9 16:25:53 2003
+++ loncom/auth/lonroles.pm	Tue Dec 30 17:45:59 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.80 2003/12/09 21:25:53 albertel Exp $
+# $Id: lonroles.pm,v 1.81 2003/12/30 22:45:59 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -77,6 +77,17 @@
     return;
 }
 
+sub authorbombs {
+    my ($uname,$udom)=@_;
+    my %bombs=&Apache::lonmsg::all_url_author_res_msg($uname,$udom);
+    foreach (keys %bombs) {
+	if ($_=~/^$udom\/$uname\//) {
+	    return '<img src="/adm/lonMisc/bomb.gif" />';
+	}
+    }
+    return '';
+}
+
 sub handler {
 
     my $r = shift;
@@ -417,6 +428,7 @@
 			': '.$tdom.'<br />'.
                         ' '.&mt('Server').':&nbsp;'.$home;
                     $ENV{'course.'.$tdom.'_'.$trest.'.description'}='ca';
+		    $tremark.=&authorbombs($trest,$tdom);
 		    $sortkey=$role."$trest:$tdom";
                 } elsif ($role eq 'au') {
                     # Authors
@@ -436,6 +448,7 @@
                     $twhere=&mt('Domain').': '.$tdom.'<br />'.&mt('Server').
 			':&nbsp;'.$home;
                     $ENV{'course.'.$tdom.'_'.$trest.'.description'}='ca';
+		    $tremark.=&authorbombs($ENV{'user.name'},$tdom);
 		    $sortkey=$role;
                 } elsif ($trest) {
                     $ttype='Course';
Index: loncom/interface/lonmsg.pm
diff -u loncom/interface/lonmsg.pm:1.75 loncom/interface/lonmsg.pm:1.76
--- loncom/interface/lonmsg.pm:1.75	Tue Dec 30 17:19:18 2003
+++ loncom/interface/lonmsg.pm	Tue Dec 30 17:45:59 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging
 #
-# $Id: lonmsg.pm,v 1.75 2003/12/30 22:19:18 www Exp $
+# $Id: lonmsg.pm,v 1.76 2003/12/30 22:45:59 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -275,7 +275,7 @@
     my $url=shift;
     $url=&Apache::lonnet::declutter($url);
     my ($domain,$author)=($url=~/^(\w+)\/(\w+)\//);
-    my %errormsgs=&Apache::lonnet::dump('nohist_res_msgs',$1,$2);
+    my %errormsgs=&Apache::lonnet::dump('nohist_res_msgs',$domain,$author);
     my $msgs='';
     foreach (keys %errormsgs) {
 	if ($_=~/^\Q$url\E\_\d+$/) {
@@ -301,7 +301,7 @@
 sub all_url_author_res_msg {
     my ($author,$domain)=@_;
     my %returnhash=();
-    foreach (&Apache::lonnet::getkeys('nohist_res_msgs')) {
+    foreach (&Apache::lonnet::getkeys('nohist_res_msgs',$domain,$author)) {
 	$_=~/^(.+)\_\d+/;
 	$returnhash{$1}=1;
     }