[LON-CAPA-cvs] cvs: loncom /interface lonfeedback.pm /xml lonxml.pm

www lon-capa-cvs@mail.lon-capa.org
Thu, 26 Dec 2002 16:40:33 -0000


www		Thu Dec 26 11:40:33 2002 EDT

  Modified files:              
    /loncom/interface	lonfeedback.pm 
    /loncom/xml	lonxml.pm 
  Log:
  Bug #905 - delete a feedback message (actually, hide for good)
  
  
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.37 loncom/interface/lonfeedback.pm:1.38
--- loncom/interface/lonfeedback.pm:1.37	Mon Oct 28 18:28:52 2002
+++ loncom/interface/lonfeedback.pm	Thu Dec 26 11:40:33 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Feedback
 #
-# $Id: lonfeedback.pm,v 1.37 2002/10/28 23:28:52 albertel Exp $
+# $Id: lonfeedback.pm,v 1.38 2002/12/26 16:40:33 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -435,7 +435,7 @@
 # --------------------------- Get query string for limited number of parameters
 
    &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
-                                       ['hide','unhide','postdata','preview']);
+                             ['hide','unhide','deldisc','postdata','preview']);
 
   if (($ENV{'form.hide'}) || ($ENV{'form.unhide'})) {
 # ----------------------------------------------------------------- Hide/unhide
@@ -460,6 +460,33 @@
         $currenthidden=~s/\.$idx\.//g;
     }
     my %newhash=('hidden' => $currenthidden);
+
+    &Apache::lonnet::store(\%newhash,$symb,$ENV{'request.course.id'},
+                     $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
+		     $ENV{'course.'.$ENV{'request.course.id'}.'.num'});
+
+    &redirect_back($r,&Apache::lonnet::clutter($url),
+       'Changed discussion status<p>','0','0');
+  } elsif ($ENV{'form.deldisc'}) {
+# --------------------------------------------------------------- Hide for good
+    $r->content_type('text/html');
+    $r->send_http_header;
+
+    my $entry=$ENV{'form.deldisc'};
+
+    my ($symb,$idx)=split(/\:\:\:/,$entry);
+    my ($map,$ind,$url)=split(/\_\_\_/,$symb);
+
+    my %contrib=&Apache::lonnet::restore($symb,$ENV{'request.course.id'},
+                     $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
+		     $ENV{'course.'.$ENV{'request.course.id'}.'.num'});
+
+        
+    my $currentdeleted=$contrib{'deleted'};
+    
+    $currentdeleted.='.'.$idx.'.';
+
+    my %newhash=('deleted' => $currentdeleted);
 
     &Apache::lonnet::store(\%newhash,$symb,$ENV{'request.course.id'},
                      $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
Index: loncom/xml/lonxml.pm
diff -u loncom/xml/lonxml.pm:1.221 loncom/xml/lonxml.pm:1.222
--- loncom/xml/lonxml.pm:1.221	Fri Dec 13 16:39:19 2002
+++ loncom/xml/lonxml.pm	Thu Dec 26 11:40:33 2002
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # XML Parser Module 
 #
-# $Id: lonxml.pm,v 1.221 2002/12/13 21:39:19 albertel Exp $
+# $Id: lonxml.pm,v 1.222 2002/12/26 16:40:33 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -192,7 +192,8 @@
               my $idx;
               for ($idx=1;$idx<=$contrib{'version'};$idx++) {
 		my $hidden=($contrib{'hidden'}=~/\.$idx\./);
-		unless (($hidden) && (!$seeid)) {
+		my $deleted=($contrib{'deleted'}=~/\.$idx\./);
+		unless ((($hidden) && (!$seeid)) || ($deleted)) {
                  my $message=$contrib{$idx.':message'};
                  $message=~s/\n/\<br \/\>/g;
 		 $message=&Apache::lontexconvert::msgtexconverted($message);
@@ -226,8 +227,10 @@
                           } else {
                              $sender.=' <a href="/adm/feedback?hide='.
 				 $symb.':::'.$idx.'">Hide</a>';
-			  }
-                      }                   
+			  }                     
+                          $sender.=' <a href="/adm/feedback?deldisc='.
+				 $symb.':::'.$idx.'">Delete</a>';
+                      }
                   } else {
                       if ($screenname) {
 			  $sender='<i>'.$screenname.'</i>';