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

www www at source.lon-capa.org
Fri Jan 6 22:01:11 EST 2012


www		Sat Jan  7 03:01:11 2012 EDT

  Modified files:              
    /loncom/interface	lonfeedback.pm 
  Log:
  Bug #6293: undelete discussion entries
  
  
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.326 loncom/interface/lonfeedback.pm:1.327
--- loncom/interface/lonfeedback.pm:1.326	Fri Jan  6 20:05:59 2012
+++ loncom/interface/lonfeedback.pm	Sat Jan  7 03:01:11 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Feedback
 #
-# $Id: lonfeedback.pm,v 1.326 2012/01/06 20:05:59 www Exp $
+# $Id: lonfeedback.pm,v 1.327 2012/01/07 03:01:11 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -827,7 +827,17 @@
         $discussion .= '&previous='.$prevread;
     }
     $discussion .= &group_args($group);
-    $discussion .= '">'.&mt('Export').'</a></td>';
+    $discussion .= '">'.&mt('Export').'</a>';
+    if (&Apache::lonnet::allowed('rin',$env{'request.course.id'})) {
+        $discussion .= '  ';
+        $discussion .='<a href="/adm/feedback?undeleteall='.$escsymb;
+        if ($newpostsflag) {
+            $discussion .= '&previous='.$prevread;
+        }
+        $discussion .= &group_args($group);
+        $discussion .= '">'.&mt('Undelete all deleted entries').'</a>';
+    }
+    $discussion.='</td>';
     if ($newpostsflag) {
         if (!$markondisp) {
             $discussion .='<td class="LC_disc_action_right"><a href="/adm/preferences?action=changediscussions';
@@ -3642,7 +3652,7 @@
 # --------------------------- Get query string for limited number of parameters
 
   &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
-         ['like','unlike','modal','hide','unhide','deldisc','postdata','preview','replydisc','editdisc','cmd','symb','onlyunread','allposts','onlyunmark','previous','markread','markonread','markondisp','toggoff','toggon','modifydisp','changes','navtime','navmaps','navurl','sortposts','applysort','rolefilter','statusfilter','sectionpick','groupick','posterlist','userpick','attach','origpage','currnewattach','deloldattach','keepold','allversions','export','sendmessageonly','group','ref']);
+         ['like','unlike','modal','hide','unhide','deldisc','undeleteall','postdata','preview','replydisc','editdisc','cmd','symb','onlyunread','allposts','onlyunmark','previous','markread','markonread','markondisp','toggoff','toggon','modifydisp','changes','navtime','navmaps','navurl','sortposts','applysort','rolefilter','statusfilter','sectionpick','groupick','posterlist','userpick','attach','origpage','currnewattach','deloldattach','keepold','allversions','export','sendmessageonly','group','ref']);
   my $group = $env{'form.group'};
   my %attachmax = (
                     text => &mt('(128 KB max size)'),
@@ -4075,6 +4085,24 @@
 	  &Apache::loncommon::end_page();
       $r->print($start_page.$discussion.$end_page);
       return OK;
+
+  } elsif ($env{'form.undeleteall'}) {
+      &Apache::loncommon::content_type($r,'text/html');
+      $r->send_http_header;
+      my ($symb,$feedurl) = &get_feedurl_and_clean_symb($env{'form.undeleteall'});
+      $r->print(&Apache::loncommon::start_page('Undelete all deleted discussion entries'));
+      if (&Apache::lonnet::allowed('rin',$env{'request.course.id'})) {
+           if (&Apache::lonnet::store({'deleted' => ''},$symb,$env{'request.course.id'},
+                     $env{'course.'.$env{'request.course.id'}.'.domain'},
+                     $env{'course.'.$env{'request.course.id'}.'.num'}) eq 'ok') {
+               $r->print(&Apache::lonhtmlcommon::confirm_success(&mt("Undeleted all entries")));
+           } else {
+               $r->print(&Apache::lonhtmlcommon::confirm_success(&mt("Failed to undelete entries"),1));
+           }
+           $r->print("<br /><a href='$feedurl'>".&mt("Return and reload")."</a>");
+      }
+      $r->print(&Apache::loncommon::end_page());
+      return OK;
   } else {
 # ------------------------------------------------------------- Normal feedback
       my $feedurl=$env{'form.postdata'};




More information about the LON-CAPA-cvs mailing list