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

www lon-capa-cvs@mail.lon-capa.org
Wed, 15 Oct 2003 20:01:48 -0000


www		Wed Oct 15 16:01:48 2003 EDT

  Modified files:              
    /loncom/interface	lonfeedback.pm 
  Log:
  Bug #2226: remove query string from refers-to-URL
  
  
Index: loncom/interface/lonfeedback.pm
diff -u loncom/interface/lonfeedback.pm:1.61 loncom/interface/lonfeedback.pm:1.62
--- loncom/interface/lonfeedback.pm:1.61	Fri Sep 19 12:12:50 2003
+++ loncom/interface/lonfeedback.pm	Wed Oct 15 16:01:48 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Feedback
 #
-# $Id: lonfeedback.pm,v 1.61 2003/09/19 16:12:50 www Exp $
+# $Id: lonfeedback.pm,v 1.62 2003/10/15 20:01:48 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -51,6 +51,7 @@
 use Apache::lonmsg();
 use Apache::loncommon();
 use Apache::lontexconvert();
+use Apache::lonlocal;
 
 sub list_discussion {
     my ($mode,$status,$symb)=@_;
@@ -88,7 +89,7 @@
 		if ($contrib{$idx.':attachmenturl'}) {
 		    my ($fname,$ft)
                         =($contrib{$idx.':attachmenturl'}=~/\/(\w+)\.(\w+)$/);
-		    $message.='<p>Attachment: <a href="'.
+		    $message.='<p>'.&mt('Attachment').': <a href="'.
 			&Apache::lonnet::tokenwrapper(
                                              $contrib{$idx.':attachmenturl'}).
 			'"><tt>'.$fname.'.'.$ft.'</tt></a>';
@@ -104,7 +105,7 @@
 					    $contrib{$idx.':sendername'},
 					    $contrib{$idx.':senderdomain'});
 		    
-		    my $sender='Anonymous';
+		    my $sender=&mt('Anonymous');
 		    if ((!$contrib{$idx.':anonymous'}) || ($seeid)) {
 			$sender=&Apache::loncommon::aboutmewrapper(
 					 $plainname,
@@ -113,19 +114,19 @@
 					 $contrib{$idx.':sendername'}.' at '.
 					 $contrib{$idx.':senderdomain'}.')';
 			if ($contrib{$idx.':anonymous'}) {
-			    $sender.=' [anonymous] '.
+			    $sender.=' ['.&mt('anonymous').'] '.
 				$screenname;
 			}
 			if ($seeid) {
 			    if ($hidden) {
 				$sender.=' <a href="/adm/feedback?unhide='.
-				    $symb.':::'.$idx.'">Make Visible</a>';
+				    $symb.':::'.$idx.'">'.&mt('Make Visible').'</a>';
 			    } else {
 				$sender.=' <a href="/adm/feedback?hide='.
-				    $symb.':::'.$idx.'">Hide</a>';
+				    $symb.':::'.$idx.'">'.&mt('Hide').'</a>';
 			    }                     
 			    $sender.=' <a href="/adm/feedback?deldisc='.
-				$symb.':::'.$idx.'">Delete</a>';
+				$symb.':::'.$idx.'">'.&mt('Delete').'</a>';
 			}
 		    } else {
 			if ($screenname) {
@@ -310,21 +311,23 @@
   my $discussoptions='';
   if (($feedurl=~/^\/res\//) && ($feedurl!~/^\/res\/adm/)) {
     $msgoptions= 
-      '<p><input type=checkbox name=author> Feedback to resource author';
+      '<p><input type=checkbox name=author> '.
+      &mt('Feedback to resource author');
   }
   if (&feedback_available(1)) {
     $msgoptions.=
-    '<br><input type=checkbox name=question> Question about resource content';
+    '<br><input type=checkbox name=question> '.
+    &mt('Question about resource content');
   }
   if (&feedback_available(0,1)) {
     $msgoptions.=
       '<br><input type=checkbox name=course> '.
-	'Question/Comment/Feedback about course content';
+	&mt('Question/Comment/Feedback about course content');
   }
   if (&feedback_available(0,0,1)) {
     $msgoptions.=
       '<br><input type=checkbox name=policy> '.
-	'Question/Comment/Feedback about course policy';
+	&mt('Question/Comment/Feedback about course policy');
   }
 
   if ($ENV{'request.course.id'}) {
@@ -332,15 +335,15 @@
         $ENV{'request.course.id'}.
         ($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:''))) {
     $discussoptions='<input type="checkbox" name="discuss" onClick="this.form.anondiscuss.checked=false;"> '.
-	'Contribution to course discussion of resource';
+	&mt('Contribution to course discussion of resource');
     $discussoptions.='<br><input type="checkbox" name="anondiscuss" onClick="this.form.discuss.checked=false;"> '.
-	'Anonymous contribution to course discussion of resource'.
-        ' <i>(name only visible to course faculty)</i>';
+	&mt('Anonymous contribution to course discussion of resource').
+        ' <i>('.&mt('name only visible to course faculty').')</i>';
       }
   }
-  if ($msgoptions) { $msgoptions='<h2>Sending Messages</h2>'.$msgoptions; }
+  if ($msgoptions) { $msgoptions='<h2>'.&mt('Sending Messages').'</h2>'.$msgoptions; }
   if ($discussoptions) { 
-     $discussoptions='<h2>Discussion Contributions</h2>'.$discussoptions; }
+     $discussoptions='<h2>'.&mt('Discussion Contributions').'</h2>'.$discussoptions; }
   return $msgoptions.$discussoptions;
 }
 
@@ -476,7 +479,7 @@
       unless (&Apache::lonmsg::user_normal_msg(split(/\:/,$_),
                'Feedback ['.$declutter.']',$email,$citations,$feedurl,
                 $attachmenturl)=~/ok/) {
-	$status.='<br>Error sending message to '.$_.'<br>';
+	$status.='<br>'.&mt('Error sending message to').' '.$_.'<br>';
       } else {
 	$sendsomething++;
       }
@@ -490,7 +493,7 @@
        $newrecord{'resource'}=$feedurl;
        $newrecord{'subnumber'}=$record{'subnumber'}+1;
        unless (&Apache::lonnet::cstore(\%newrecord,'_feedback') eq 'ok') {
-	   $status.='<br>Not registered<br>';
+	   $status.='<br>'.&mt('Not registered').'<br>';
        }
     }
        
@@ -521,7 +524,7 @@
                      $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
 		     $ENV{'course.'.$ENV{'request.course.id'}.'.num'});
         my %storenewentry=($symb => time);
-        $status.='<br>Updating discussion time: '.
+        $status.='<br>'.&mt('Updating discussion time').': '.
         &Apache::lonnet::put('discussiontimes',\%storenewentry,
                      $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
 		     $ENV{'course.'.$ENV{'request.course.id'}.'.num'});
@@ -532,7 +535,7 @@
        my %newrecord=();
        $newrecord{'resource'}=$symb;
        $newrecord{'subnumber'}=$record{'subnumber'}+1;
-       $status.='<br>Registering: '.
+       $status.='<br>'.&mt('Registering').': '.
                &Apache::lonnet::cstore(\%newrecord,'_discussion');
     }
     } else {
@@ -603,7 +606,7 @@
 		     $ENV{'course.'.$ENV{'request.course.id'}.'.num'});
 
     &redirect_back($r,&Apache::lonnet::clutter($url),
-       'Changed discussion status<p>','0','0');
+       &mt('Changed discussion status').'<p>','0','0');
   } elsif ($ENV{'form.deldisc'}) {
 # --------------------------------------------------------------- Hide for good
     $r->content_type('text/html');
@@ -630,7 +633,7 @@
 		     $ENV{'course.'.$ENV{'request.course.id'}.'.num'});
 
     &redirect_back($r,&Apache::lonnet::clutter($url),
-       'Changed discussion status<p>','0','0');
+       &mt('Changed discussion status').'<p>','0','0');
   } elsif ($ENV{'form.preview'}) {
 # -------------------------------------------------------- User wants a preview
       &show_preview($r);
@@ -640,6 +643,7 @@
   $feedurl=~s/^http\:\/\///;
   $feedurl=~s/^$ENV{'SERVER_NAME'}//;
   $feedurl=~s/^$ENV{'HTTP_HOST'}//;
+  $feedurl=~s/\?.+$//;
 
   my $symb=&Apache::lonnet::symbread($feedurl);
   unless ($symb) {