Diff for /loncom/interface/lonmsgdisplay.pm between versions 1.132 and 1.137

version 1.132, 2009/08/28 19:58:57 version 1.137, 2009/10/13 16:37:57
Line 113  use lib '/home/httpd/lib/perl/'; Line 113  use lib '/home/httpd/lib/perl/';
 use LONCAPA;  use LONCAPA;
   
 # Querystring component with sorting type  # Querystring component with sorting type
 my $sqs;  my $sqs='';
 my $startdis;  my $startdis='';
   
 # ============================================================ List all folders  # ============================================================ List all folders
   
Line 558  sub discourse { Line 558  sub discourse {
        $result .= '<fieldset id="LC_futureusers"><legend>'         $result .= '<fieldset id="LC_futureusers"><legend>'
                  .&mt('Bcc: course members with future access')                   .&mt('Bcc: course members with future access')
                  .'</legend>'                   .'</legend>'
                  .'<form name="previoususers">';                   .'<form name="futureusers">';
        $result .= $tmptext.'</form></fieldset>';         $result .= $tmptext.'</form></fieldset>';
        if (ref($statushash) eq 'HASH') {         if (ref($statushash) eq 'HASH') {
            $statushash->{'future'} = 1;             $statushash->{'future'} = 1;
Line 1060  ENDDISHEADER Line 1060  ENDDISHEADER
     $r->print('<form method="post" name="disall" action="/adm/email">'.      $r->print('<form method="post" name="disall" action="/adm/email">'.
       '<table class="LC_mail_list"><tr><th colspan="1">&nbsp;</th><th>');        '<table class="LC_mail_list"><tr><th colspan="1">&nbsp;</th><th>');
     if ($env{'form.sortedby'} eq "revdate") {      if ($env{'form.sortedby'} eq "revdate") {
  $r->print('<a href = "?sortedby=date'.$fsqs.'">'.&mt('Date').'</a></th>');   $r->print('<a href = "/adm/email?sortedby=date'.$fsqs.'">'.&mt('Date').'</a></th>');
     } else {      } else {
  $r->print('<a href = "?sortedby=revdate'.$fsqs.'">'.&mt('Date').'</a></th>');   $r->print('<a href = "/adm/email?sortedby=revdate'.$fsqs.'">'.&mt('Date').'</a></th>');
     }      }
     $r->print('<th>');      $r->print('<th>');
     if ($env{'form.sortedby'} eq "revuser") {      if ($env{'form.sortedby'} eq "revuser") {
  $r->print('<a href = "?sortedby=user'.$fsqs.'">'.&mt('Username').'</a>');   $r->print('<a href = "/adm/email?sortedby=user'.$fsqs.'">'.&mt('Username').'</a>');
     } else {      } else {
  $r->print('<a href = "?sortedby=revuser'.$fsqs.'">'.&mt('Username').'</a>');   $r->print('<a href = "/adm/email?sortedby=revuser'.$fsqs.'">'.&mt('Username').'</a>');
     }      }
     $r->print('</th><th>');      $r->print('</th><th>');
     if ($env{'form.sortedby'} eq "revdomain") {      if ($env{'form.sortedby'} eq "revdomain") {
  $r->print('<a href = "?sortedby=domain'.$fsqs.'">'.&mt('Domain').'</a>');   $r->print('<a href = "/adm/email?sortedby=domain'.$fsqs.'">'.&mt('Domain').'</a>');
     } else {      } else {
  $r->print('<a href = "?sortedby=revdomain'.$fsqs.'">'.&mt('Domain').'</a>');   $r->print('<a href = "/adm/email?sortedby=revdomain'.$fsqs.'">'.&mt('Domain').'</a>');
     }      }
     $r->print('</th><th>');      $r->print('</th><th>');
     if ($env{'form.sortedby'} eq "revsubject") {      if ($env{'form.sortedby'} eq "revsubject") {
  $r->print('<a href = "?sortedby=subject'.$fsqs.'">'.&mt('Subject').'</a>');   $r->print('<a href = "/adm/email?sortedby=subject'.$fsqs.'">'.&mt('Subject').'</a>');
     } else {      } else {
     $r->print('<a href = "?sortedby=revsubject'.$fsqs.'">'.&mt('Subject').'</a>');      $r->print('<a href = "/adm/email?sortedby=revsubject'.$fsqs.'">'.&mt('Subject').'</a>');
     }      }
     $r->print('</th><th>');      $r->print('</th><th>');
     if ($env{'form.sortedby'} eq "revcourse") {      if ($env{'form.sortedby'} eq "revcourse") {
         $r->print('<a href = "?sortedby=course'.$fsqs.'">'.&mt('Course').'</a>');          $r->print('<a href = "/adm/email?sortedby=course'.$fsqs.'">'.&mt('Course').'</a>');
     } else {      } else {
         $r->print('<a href = "?sortedby=revcourse'.$fsqs.'">'.&mt('Course').'</a>');          $r->print('<a href = "/adm/email?sortedby=revcourse'.$fsqs.'">'.&mt('Course').'</a>');
     }      }
     $r->print('</th><th>');      $r->print('</th><th>');
     if ($env{'form.sortedby'} eq "revstatus") {      if ($env{'form.sortedby'} eq "revstatus") {
  $r->print('<a href = "?sortedby=status'.$fsqs.'">'.&mt('Status').'</a></th>');   $r->print('<a href = "/adm/email?sortedby=status'.$fsqs.'">'.&mt('Status').'</a></th>');
     } else {      } else {
       $r->print('<a href = "?sortedby=revstatus'.$fsqs.'">'.&mt('Status').'</a></th>');        $r->print('<a href = "/adm/email?sortedby=revstatus'.$fsqs.'">'.&mt('Status').'</a></th>');
     }      }
     $r->print("</tr>\n");      $r->print("</tr>\n");
   
Line 1268  sub compout { Line 1268  sub compout {
         &printheader($r,'/adm/email?compose=multiforward',          &printheader($r,'/adm/email?compose=multiforward',
              'Forwarding Multiple Messages');               'Forwarding Multiple Messages');
         if ($multiforward > 1) {          if ($multiforward > 1) {
             $r->print(&mt('Each of the <b>[quant,_1,message]</b> you checked'              $r->print(&mt('Each of the [quant,_1,message] you checked'
                          .' will be forwarded to the recipient(s) you select below.',$multiforward)                           .' will be forwarded to the recipient(s) you select below.'
                            ,'<b>'.$multiforward.'</b>')
                     .'<br />');                      .'<br />');
         } else {          } else {
             $r->print(&mt('The message you checked will be forwarded to the recipient(s) you select below.').'<br />');              $r->print(&mt('The message you checked will be forwarded to the recipient(s) you select below.').'<br />');
Line 1785  sub retrieve_instructor_comments { Line 1786  sub retrieve_instructor_comments {
 }  }
   
 sub disfacetoface {  sub disfacetoface {
     my ($r,$user,$domain)=@_;      my ($r,$user,$domain,$target)=@_;
     my $target=$env{'form.grade_target'};   if ($target eq '') {
       my $target=$env{'form.grade_target'};
    }
     unless ($env{'request.course.id'}) { return; }      unless ($env{'request.course.id'}) { return; }
     if  (!&Apache::lonnet::allowed('dff',$env{'request.course.id'})      if  (!&Apache::lonnet::allowed('dff',$env{'request.course.id'})
  && ! &Apache::lonnet::allowed('dff',$env{'request.course.id'}.   && ! &Apache::lonnet::allowed('dff',$env{'request.course.id'}.
Line 1798  sub disfacetoface { Line 1801  sub disfacetoface {
  $env{'course.'.$env{'request.course.id'}.'.domain'},   $env{'course.'.$env{'request.course.id'}.'.domain'},
  $env{'course.'.$env{'request.course.id'}.'.num'},   $env{'course.'.$env{'request.course.id'}.'.num'},
                          '%255b'.$user.'%253a'.$domain.'%255d');                           '%255b'.$user.'%253a'.$domain.'%255d');
     my $result='';      my $result='<div>';
     foreach my $key (sort(keys(%records))) {      foreach my $key (sort(keys(%records))) {
         my %content=&Apache::lonmsg::unpackagemsg($records{$key});          my %content=&Apache::lonmsg::unpackagemsg($records{$key});
         next if ($content{'senderdomain'} eq '');          next if ($content{'senderdomain'} eq '');
Line 1862  $content{'sendername'}.':'. Line 1865  $content{'sendername'}.':'.
  } else {   } else {
     $r->print('\textbf{'.&mt('No notes, face-to-face discussion records, critical messages or broadcast messages in this [_1].',$lctype).'}\\\\');      $r->print('\textbf{'.&mt('No notes, face-to-face discussion records, critical messages or broadcast messages in this [_1].',$lctype).'}\\\\');
  }   }
       } elsif ($target ne 'tex') {
          $r->print($result.'</div>');
     } else {      } else {
        $r->print($result);   $r->print(&Apache::lonxml::xmlparse($r, 'tex', $result));
     }   }
 }  }
   
 sub general_message {  sub general_message {
Line 3352  sub handler { Line 3357  sub handler {
             $total ++;              $total ++;
         }          }
         &printheader($r,'','Marked Messages Read');          &printheader($r,'','Marked Messages Read');
         $r->print(&mt('Marked [_1] message(s) read',$total).'<p>');          $r->print(&mt('Marked [quant,_1,message] read',$total).'<p>');
         &Apache::loncommunicate::menu($r);          &Apache::loncommunicate::menu($r);
         &disall($r,($folder?$folder:$dismode),$msgstatus);          &disall($r,($folder?$folder:$dismode),$msgstatus);
     } elsif ($env{'form.markedaction'} eq 'markedunread') {      } elsif ($env{'form.markedaction'} eq 'markedunread') {
Line 3363  sub handler { Line 3368  sub handler {
             $total ++;              $total ++;
         }          }
         &printheader($r,'','Marked Messages Unread');          &printheader($r,'','Marked Messages Unread');
         $r->print(&mt('Marked [_1] message(s) unread',$total).'<p>');          $r->print(&mt('Marked [quant,_1,message] unread',$total).'<p>');
         &Apache::loncommunicate::menu($r);          &Apache::loncommunicate::menu($r);
         &disall($r,($folder?$folder:$dismode),$msgstatus);          &disall($r,($folder?$folder:$dismode),$msgstatus);
     } elsif ($env{'form.markedaction'} eq 'markedmove') {      } elsif ($env{'form.markedaction'} eq 'markedmove') {
Line 3387  sub handler { Line 3392  sub handler {
         }          }
     }      }
     if ($failed) {      if ($failed) {
         $r->print('<p class="LC_error">                  $r->print('<p class="LC_error">'
                           '.&mt('Failed to move [_1] message(s)',$failed).                           .&mt('Failed to move [quant,_1,message]',$failed)
       '</p>');                           .'</p>');
         $r->print('<p class="LC_error">'.          $r->print('<p class="LC_error">'.
             join("</p>\n<p class=\"LC_error\">",@failed_msg).              join("</p>\n<p class=\"LC_error\">",@failed_msg).
           "</p>\n");            "</p>\n");
     }      }
     $r->print(&mt('Moved [_1] message(s)',$total).'<p>');              $r->print('<p class="LC_success">'
                        .&mt('Moved [quant,_1,message]',$total)
                        .'</p>'
                        .'<p>');
         }          }
  &Apache::loncommunicate::menu($r);   &Apache::loncommunicate::menu($r);
  &disall($r,($folder?$folder:$dismode),$msgstatus);   &disall($r,($folder?$folder:$dismode),$msgstatus);
Line 3413  sub handler { Line 3421  sub handler {
  }   }
  &printheader($r,'','Deleted Messages');   &printheader($r,'','Deleted Messages');
  if ($failed) {   if ($failed) {
     $r->print('<p class="LC_error">              $r->print('<p class="LC_error">'
                           '.&mt('Failed to delete [_1] message(s)',$failed).                       .&mt('Failed to delete [quant,_1,message]',$failed)
       '</p>');                       .'</p>');
     $r->print('<p class="LC_error">'.      $r->print('<p class="LC_error">'.
       join("</p>\n<p class=\"LC_error\">",@failed_msg).        join("</p>\n<p class=\"LC_error\">",@failed_msg).
       "</p>\n");        "</p>\n");
  }   }
  $r->print(&mt('Deleted [_1] message(s)',$total).'<p>');          $r->print('<p class="LC_success">'
                    .&mt('Deleted [quant,_1,message]',$total)
                    .'</p>'
                    .'<p>');
  &Apache::loncommunicate::menu($r);   &Apache::loncommunicate::menu($r);
  &disall($r,($folder?$folder:$dismode),$msgstatus);   &disall($r,($folder?$folder:$dismode),$msgstatus);
     } elsif ($env{'form.markunread'}) {      } elsif ($env{'form.markunread'}) {
Line 3512  sub handler { Line 3523  sub handler {
         my $showfolder = $env{'form.newfolder'};          my $showfolder = $env{'form.newfolder'};
  my ($makeresult,$warning) = &makefolder($env{'form.newfolder'});   my ($makeresult,$warning) = &makefolder($env{'form.newfolder'});
         if ($makeresult eq 'ok') {          if ($makeresult eq 'ok') {
             $r->print(&mt('Folder "[_1]" created.',$showfolder).'<br />');              $r->print('<p class="LC_success">'
                        .&mt('Folder "[_1]" created.',$showfolder)
                        .'</p>');
         } else {          } else {
             $r->print(&mt('Creation failed.').' '.$makeresult.'<br />'.              $r->print('<p class="LC_warning">'
                       $warning);                       .&mt('Creation failed.').' '.$makeresult.'<br />'
                        .$warning
                        .'</p>');
             $showfolder = $folder;              $showfolder = $folder;
         }          }
         &Apache::loncommunicate::menu($r);          &Apache::loncommunicate::menu($r);
Line 3527  sub handler { Line 3542  sub handler {
         my $showfolder = '';          my $showfolder = '';
         my $delresult = &deletefolder($folder);          my $delresult = &deletefolder($folder);
         if ($delresult eq 'ok') {          if ($delresult eq 'ok') {
             $r->print(&mt('Folder "[_1]" deleted.',$folder).'<br />');              $r->print('<p class="LC_success">'
                        .&mt('Folder "[_1]" deleted.',$folder)
                        .'</p>');
             $env{'form.folder'} = '';              $env{'form.folder'} = '';
         } else {          } else {
             $r->print(&mt('Deletion failed.').' '.$delresult.'<br />');              $r->print('<p class="LC_warning">'
                        .&mt('Deletion failed.').' '.$delresult
                        .'</p>');
             $showfolder = $folder;              $showfolder = $folder;
         }          }
         &Apache::loncommunicate::menu($r);          &Apache::loncommunicate::menu($r);
Line 3540  sub handler { Line 3559  sub handler {
         my $showfolder = $env{'form.renamed'};          my $showfolder = $env{'form.renamed'};
         my $renresult = &renamefolder($folder);          my $renresult = &renamefolder($folder);
         if ($renresult eq 'ok') {          if ($renresult eq 'ok') {
             $r->print(&mt('Folder "[_1]" renamed to "[_2]".',$folder,$showfolder).'<br />');              $r->print('<p class="LC_success">'
                        .&mt('Folder "[_1]" renamed to "[_2]".',$folder,$showfolder)
                        .'</p>');
         } else {          } else {
             $r->print(&mt('Renaming failed.').' '.$renresult.'<br />');              $r->print('<p class="LC_warning">'
                        .&mt('Renaming failed.').' '.$renresult
                        .'</p>');
             $showfolder = $folder;              $showfolder = $folder;
         }          }
         &Apache::loncommunicate::menu($r);          &Apache::loncommunicate::menu($r);

Removed from v.1.132  
changed lines
  Added in v.1.137


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>