[LON-CAPA-cvs] cvs: loncom(version_2_9_X) /interface lonmsgdisplay.pm

raeburn raeburn@source.lon-capa.org
Mon, 25 Jan 2010 17:59:44 -0000


This is a MIME encoded message

--raeburn1264442384
Content-Type: text/plain

raeburn		Mon Jan 25 17:59:44 2010 EDT

  Modified files:              (Branch: version_2_9_X)
    /loncom/interface	lonmsgdisplay.pm 
  Log:
  - Backport 1.135, 1.143, 1.144. 
  
  
--raeburn1264442384
Content-Type: text/plain
Content-Disposition: attachment; filename="raeburn-20100125175944.txt"

Index: loncom/interface/lonmsgdisplay.pm
diff -u loncom/interface/lonmsgdisplay.pm:1.124.4.3 loncom/interface/lonmsgdisplay.pm:1.124.4.4
--- loncom/interface/lonmsgdisplay.pm:1.124.4.3	Thu Sep 10 12:08:42 2009
+++ loncom/interface/lonmsgdisplay.pm	Mon Jan 25 17:59:43 2010
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Routines for messaging display
 #
-# $Id: lonmsgdisplay.pm,v 1.124.4.3 2009/09/10 12:08:42 raeburn Exp $
+# $Id: lonmsgdisplay.pm,v 1.124.4.4 2010/01/25 17:59:43 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1254,8 +1254,8 @@
         &printheader($r,'/adm/email?compose=multiforward',
              'Forwarding Multiple Messages');
         if ($multiforward > 1) {
-            $r->print(&mt('Each of the <b>[quant,_1,message]</b> you checked'
-                         .' will be forwarded to the recipient(s) you select below.',$multiforward)
+            $r->print(&mt('Each of the[_1] [quant,_2,message] [_3]you checked'
+                         .' will be forwarded to the recipient(s) you select below.','<b>',$multiforward,'</b>')
                     .'<br />');
         } else {
             $r->print(&mt('The message you checked will be forwarded to the recipient(s) you select below.').'<br />');
@@ -2165,7 +2165,7 @@
                            $setuname,$setudom);
         $r->print(&Apache::loncommon::start_data_table_row());
         $r->print(<<"END");
-        <td>$ltext->{'star'}:&nbsp;$startform<br/>$ltext->{'endd'}:&nbsp;&nbsp;$endform</td>
+        <td>$ltext->{'star'}:&nbsp;$startform<br />$ltext->{'endd'}:&nbsp;&nbsp;$endform</td>
         <td>$settername</td>
         <td><input type="text" name="title_$parmcount" size="15" value="$title" /><input type="hidden" name="key_$parmcount" value="$record" /></td>
         <td>
@@ -3191,8 +3191,9 @@
         }
         if (!$env{'form.multiforward'}) { 
             if ($sendstatus=~/^(\s*(?:ok|con_delayed)\s*)*$/) {
-	        $r->print('<br /><span class="LC_success">'.&mt('Completed.').
-                          '</span>');
+                my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Completed.'));
+                $message = &Apache::loncommon::confirmwrapper($message);
+                $r->print($message);
 	        if ($env{'form.displayedcrit'}) {
 	            &discrit($r);
                 }
@@ -3202,8 +3203,10 @@
 	            &Apache::loncommunicate::menu($r);
 	        }
             } else {
-	        $r->print('<p>'.&Apache::lonhtmlcommon::confirm_success(&mt('Could not deliver message'),1).'<br /> '.
-		          &mt('Please use the browser "Back" button and correct the recipient addresses ([_1]).',$sendstatus).'</p>');
+                my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Could not deliver message'),1);
+                $message .= '<br />'.&mt('Please use the browser "Back" button and correct the recipient addresses ([_1]).',$sendstatus);
+                $message = &Apache::loncommon::confirmwrapper($message);
+                $r->print($message);
             }
         }
     }
@@ -3322,9 +3325,10 @@
 	my ($result,$msg) = 
 	    &statuschange($env{'form.markdel'},'deleted',$folder);
 	if (!$result) {
-	    $r->print('<p class="LC_error">'.
-		      &mt('Failed to delete the message.').'</p>'.
-		      '<p class="LC_error">'.$msg."</p>\n");
+            my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Failed to delete the message.'),1);
+            $message .= '<p class="LC_error">'.$msg.'</p>';
+            $message = &Apache::loncommon::confirmwrapper($message);
+            $r->print($message);
 	}
 	&Apache::loncommunicate::menu($r);
 	&disall($r,($folder?$folder:$dismode),$msgstatus);
@@ -3346,7 +3350,9 @@
             $total ++;
         }
         &printheader($r,'','Marked Messages Read');
-        $r->print(&mt('Marked [_1] message(s) read',$total).'<p>');
+        my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Marked [quant,_1,message] read',$total));
+        $message = &Apache::loncommon::confirmwrapper($message);
+        $r->print($message);
         &Apache::loncommunicate::menu($r);
         &disall($r,($folder?$folder:$dismode),$msgstatus);
     } elsif ($env{'form.markedaction'} eq 'markedunread') {
@@ -3357,7 +3363,9 @@
             $total ++;
         }
         &printheader($r,'','Marked Messages Unread');
-        $r->print(&mt('Marked [_1] message(s) unread',$total).'<p>');
+        my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Marked [quant,_1,message] unread',$total));
+        $message = &Apache::loncommon::confirmwrapper($message);
+        $r->print($message);
         &Apache::loncommunicate::menu($r);
         &disall($r,($folder?$folder:$dismode),$msgstatus);
     } elsif ($env{'form.markedaction'} eq 'markedmove') {
@@ -3380,15 +3388,16 @@
 		    push(@failed_msg,$msg);
 	        }
 	    }
-	    if ($failed) {
-	        $r->print('<p class="LC_error">
-                          '.&mt('Failed to move [_1] message(s)',$failed).
-		      '</p>');
-	        $r->print('<p class="LC_error">'.
-	   	          join("</p>\n<p class=\"LC_error\">",@failed_msg).
-		          "</p>\n");
-	    }
-	    $r->print(&mt('Moved [_1] message(s)',$total).'<p>');
+            my $message;
+            if ($failed) {
+                $message = &Apache::lonhtmlcommon::confirm_success(&mt('Failed to move [quant,_1,message]',$failed),1);
+                $message .= '<p class="LC_error">'.
+		            join("</p>\n<p class=\"LC_error\">",@failed_msg).
+		            "</p>\n";
+            }
+            $message .= &Apache::lonhtmlcommon::confirm_success(&mt('Moved [quant,_1,message]',$total));
+            $message = &Apache::loncommon::confirmwrapper($message);
+            $r->print($message);
         }
 	&Apache::loncommunicate::menu($r);
 	&disall($r,($folder?$folder:$dismode),$msgstatus);
@@ -3406,15 +3415,16 @@
 	    }
 	}
 	&printheader($r,'','Deleted Messages');
+        my $message;
 	if ($failed) {
-	    $r->print('<p class="LC_error">
-                          '.&mt('Failed to delete [_1] message(s)',$failed).
-		      '</p>');
-	    $r->print('<p class="LC_error">'.
+            $message = &Apache::lonhtmlcommon::confirm_success(&mt('Failed to delete [quant,_1,message]',$failed),1);
+            $message .= '<p class="LC_error">'.
 		      join("</p>\n<p class=\"LC_error\">",@failed_msg).
-		      "</p>\n");
+		      "</p>\n";
 	}
-	$r->print(&mt('Deleted [_1] message(s)',$total).'<p>');
+        $message .= &Apache::lonhtmlcommon::confirm_success(&mt('Deleted [quant,_1,message]',$total));
+        $message = &Apache::loncommon::confirmwrapper($message);
+        $r->print($message);
 	&Apache::loncommunicate::menu($r);
 	&disall($r,($folder?$folder:$dismode),$msgstatus);
     } elsif ($env{'form.markunread'}) {
@@ -3470,19 +3480,19 @@
             }
             if (keys(%forwardok) > 0) {
                 my $count = keys(%forwardok);
-                $r->print('<br /><span class="LC_success">'.
-                          &mt('[quant,_1,message] forwarded.',$count).
-                          '</span>');
+                my $message = &Apache::lonhtmlcommon::confirm_success(&mt('[quant,_1,message] forwarded.',$count));
+                $message = &Apache::loncommon::confirmwrapper($message);
+                $r->print($message);
             }
             if (keys(%forwardfail) > 0) {
                 my $count = keys(%forwardfail);
-                $r->print('<p><span class="LC_error">'.
-                          &mt('Could not forward [quant,_1,message].',$count).
-                          '</span> ');
+                my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Could not forward [quant,_1,message].',$count),1);
                 foreach my $key (keys(%forwardfail)) {
-                    $r->print(&mt('Could not deliver forwarded message.').'</span> '.
-                              &mt('The recipient addresses may need to be corrected').' ('.$forwardfail{$key}.').<br /><br />');
+                    $message .= '<br />'.&mt('Could not deliver forwarded message.').'</span> '.
+                                &mt('The recipient addresses may need to be corrected').' ('.$forwardfail{$key}.')';
                 }
+                $message = &Apache::loncommon::confirmwrapper($message);
+                $r->print($message);
             }
             &Apache::loncommunicate::menu($r);
         } else {
@@ -3506,10 +3516,13 @@
         my $showfolder = $env{'form.newfolder'};
 	my ($makeresult,$warning) = &makefolder($env{'form.newfolder'});
         if ($makeresult eq 'ok') {
-            $r->print(&mt('Folder "[_1]" created.',$showfolder).'<br />');
+            my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Folder "[_1]" created.',$showfolder));
+            $message = &Apache::loncommon::confirmwrapper($message);
+            $r->print($message);
         } else {
-            $r->print(&mt('Creation failed.').' '.$makeresult.'<br />'.
-                      $warning);
+            my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Creation failed.').' '.$makeresult.'<br />'.$warning,1);
+            $message = &Apache::loncommon::confirmwrapper($message);
+            $r->print($message);
             $showfolder = $folder;
         }
         &Apache::loncommunicate::menu($r);
@@ -3521,10 +3534,14 @@
         my $showfolder = '';
         my $delresult = &deletefolder($folder);
         if ($delresult eq 'ok') {
-            $r->print(&mt('Folder "[_1]" deleted.',$folder).'<br />');
+            my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Folder "[_1]" deleted.',$folder));
+            $message = &Apache::loncommon::confirmwrapper($message);
+            $r->print($message);
             $env{'form.folder'} = '';
         } else {
-            $r->print(&mt('Deletion failed.').' '.$delresult.'<br />');
+            my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Deletion failed.').' '.$delresult,1);
+            $message = &Apache::loncommon::confirmwrapper($message);
+            $r->print($message);
             $showfolder = $folder;
         }
         &Apache::loncommunicate::menu($r);
@@ -3534,9 +3551,13 @@
         my $showfolder = $env{'form.renamed'};
         my $renresult = &renamefolder($folder);
         if ($renresult eq 'ok') {
-            $r->print(&mt('Folder "[_1]" renamed to "[_2]".',$folder,$showfolder).'<br />');
+            my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Folder "[_1]" renamed to "[_2]".',$folder,$showfolder));
+            $message = &Apache::loncommon::confirmwrapper($message);
+            $r->print($message);
         } else {
-            $r->print(&mt('Renaming failed.').' '.$renresult.'<br />');
+            my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Renaming failed.').' '.$renresult,1);
+            $message = &Apache::loncommon::confirmwrapper($message);
+            $r->print($message);
             $showfolder = $folder;
         }
         &Apache::loncommunicate::menu($r);

--raeburn1264442384--