Diff for /loncom/interface/lonmsgdisplay.pm between versions 1.164 and 1.178

version 1.164, 2013/07/19 18:24:16 version 1.178, 2014/12/11 01:52:30
Line 128  sub folderlist { Line 128  sub folderlist {
                 go   => 'Go',                  go   => 'Go',
                 nnff => 'New Name for Folder',                  nnff => 'New Name for Folder',
                 newn => 'New Name',                  newn => 'New Name',
                 thfm => 'The folder may not be renamed',                  fmnb => 'Folder may not be renamed as it is a folder provided by the system.',
                 fmnb => 'folder may not be renamed as it is a folder provided by the system.',                  asth => 'Requested name already in use for a system-provided or user-defined folder.',
                 asth => 'as this name is already in use for a system-provided or user-defined folder.',  
                 the => 'The',  
                 tnfm => 'The new folder may not be named',  
   
     );      );
   
Line 182  function folder_choice(targetform,caller Line 179  function folder_choice(targetform,caller
         if (targetform.folderaction.options[targetform.folderaction.selectedIndex].value == 'rename') {          if (targetform.folderaction.options[targetform.folderaction.selectedIndex].value == 'rename') {
             for (var i=0; i<permfolders_keys.length; i++) {              for (var i=0; i<permfolders_keys.length; i++) {
                 if (permfolders_keys[i] == targetform.folder.value) {                  if (permfolders_keys[i] == targetform.folder.value) {
                     alert("$lt{'the'} '"+permfolders_vals[i]+"' $lt{'fmnb'}");                      alert("'"+permfolders_vals[i]+"' -- $lt{'fmnb'}");
                     return;                      return;
                 }                  }
             }              }
Line 191  function folder_choice(targetform,caller Line 188  function folder_choice(targetform,caller
                 targetform.renamed.value=foldername;                  targetform.renamed.value=foldername;
                 for (var i=0; i<allfolders.length; i++) {                  for (var i=0; i<allfolders.length; i++) {
                     if (allfolders[i] == foldername) {                      if (allfolders[i] == foldername) {
                         alert("$lt{'thfm'} '"+foldername+"' $lt{'asth'}");                          alert("'"+foldername+"' $lt{'asth'}");
                         return;                          return;
                     }                      }
                 }                  }
Line 207  function folder_choice(targetform,caller Line 204  function folder_choice(targetform,caller
         if (newname) {          if (newname) {
             for (var i=0; i<allfolders.length; i++) {              for (var i=0; i<allfolders.length; i++) {
                 if (allfolders[i] == newname) {                  if (allfolders[i] == newname) {
                     alert("$lt{'tnfm'} '"+newname+"' $lt{'asth'}");                      alert("'"+newname+"' -- $lt{'asth'}");
                     return;                      return;
                 }                  }
             }              }
Line 236  function folder_choice(targetform,caller Line 233  function folder_choice(targetform,caller
      <td><b>'.$lt{'status'}.'</b><br />'."\n".       <td><b>'.$lt{'status'}.'</b><br />'."\n".
        &Apache::loncommon::select_form($msgstatus,'msgstatus',\%statushash).'         &Apache::loncommon::select_form($msgstatus,'msgstatus',\%statushash).'
      </td>       </td>
      <td><b>'.$lt{'actn'}.'</b><br />'."\n".'       <td style="padding-right: 40px;">
            <b>'.$lt{'actn'}.'</b><br />'."\n".'
          <span class="LC_nobreak">'.           <span class="LC_nobreak">'.
          &Apache::loncommon::select_form('view','folderaction',\%actions).           &Apache::loncommon::select_form('view','folderaction',\%actions).
          ' <input type="button" value="'.$lt{'go'}.           ' <input type="button" value="'.$lt{'go'}.
          '" onclick="javascript:folder_choice(this.form,'."'change'".');" />           '" onclick="javascript:folder_choice(this.form,'."'change'".');" />
          </span>           </span>
      </td>       </td>
     </tr>       <td style="border-left: 1px solid;padding-left: 40px;">
     <tr>           <b>'.&mt('New Folder').'</b><br />'."\n".'
      <td colspan="4"><b>'.&mt('New Folder').'</b><br />'."\n".'  
          <span class="LC_nobreak">           <span class="LC_nobreak">
          <input type="text" size="15" name="newfolder" value="" />           <input type="text" size="15" name="newfolder" value="" />
          <input type="button" value="'.$lt{'go'}.           <input type="button" value="'.$lt{'go'}.
Line 266  sub get_permanent_folders { Line 263  sub get_permanent_folders {
     my %permfolders =       my %permfolders = 
  &Apache::lonlocal::texthash(''         => 'INBOX',   &Apache::lonlocal::texthash(''         => 'INBOX',
     'trash'    => 'TRASH',      'trash'    => 'TRASH',
     'critical' => 'Critical',      'critical' => 'CRITICAL',
     'sent'     => 'Sent Messages',      'sent'     => 'SENT MESSAGES',
     );      );
     return %permfolders;      return %permfolders;
 }  }
Line 383  sub deletefolder { Line 380  sub deletefolder {
     my ($folder)=@_;      my ($folder)=@_;
     my %permfolders = &get_permanent_folders();      my %permfolders = &get_permanent_folders();
     if (defined($permfolders{$folder})) {      if (defined($permfolders{$folder})) {
         return &mt('The folder "[_1]" may not be deleted.',$folder);           return &mt('The folder "[_1]" may not be deleted.',$permfolders{$folder}); 
     }      }
     my %userfolders = &Apache::lonmsg::get_user_folders();      my %userfolders = &Apache::lonmsg::get_user_folders();
     if (!defined($userfolders{$folder})) {      if (!defined($userfolders{$folder})) {
Line 816  sub discrit { Line 813  sub discrit {
                 .'<input type="hidden" name="confirm" value="true" />';                  .'<input type="hidden" name="confirm" value="true" />';
     my %what=&Apache::lonnet::dump('critical');      my %what=&Apache::lonnet::dump('critical');
     my $result = '';      my $result = '';
     foreach my $key (sort(keys(%what))) {      # Sort by date in descending order
       foreach my $key (sort{$b <=> $a}(keys(%what))) {    
         my %content=&Apache::lonmsg::unpackagemsg($what{$key});          my %content=&Apache::lonmsg::unpackagemsg($what{$key});
         next if ($content{'senderdomain'} eq '');          next if ($content{'senderdomain'} eq '');
         my $description;          my $description;
Line 1026  sub disall { Line 1024  sub disall {
     &Apache::loncommon::store_settings('user','mail',\%saveable);      &Apache::loncommon::store_settings('user','mail',\%saveable);
     &Apache::loncommon::restore_settings('user','mail',\%saveable);      &Apache::loncommon::restore_settings('user','mail',\%saveable);
     $folder    ||= $env{'form.folder'};      $folder    ||= $env{'form.folder'};
       # Always show critical messages if present
       my @what=&Apache::lonnet::dump('critical',$env{'user.domain'},$env{'user.name'});
       if ($what[0]) {
    if (($what[0] ne 'con_lost') && ($what[0]!~/^error\:/)) {
               $folder = 'critical';
           }
       }
     $msgstatus ||= $env{'form.msgstatus'};      $msgstatus ||= $env{'form.msgstatus'};
     $env{'form.interdis'} ||= 20;      $env{'form.interdis'} ||= 20;
   
Line 1207  ENDDISHEADER Line 1212  ENDDISHEADER
             foreach my $item ($localsenttime,$dis_name,$dis_domain,$shortsubj) {              foreach my $item ($localsenttime,$dis_name,$dis_domain,$shortsubj) {
                 $r->print('<td>'.(($status eq 'new')?'<b>':'').                  $r->print('<td>'.(($status eq 'new')?'<b>':'').
                           '<a href="/adm/email?display='.$origID.$sqs.'">'.                            '<a href="/adm/email?display='.$origID.$sqs.'">'.
                           $item.(($status eq 'new')?'</b>':'').'</a></td>');                            $item.'</a>'.(($status eq 'new')?'</b>':'').'</td>');
             }              }
             # Description and Status              # Description and Status
             my $showstatus;              my $showstatus;
Line 1257  ENDDISHEADER Line 1262  ENDDISHEADER
         $r->print('    <option value="markeddel">'.&mt('Delete').'</option>'."\n");          $r->print('    <option value="markeddel">'.&mt('Delete').'</option>'."\n");
     }      }
     if ($msgstatus ne 'read') {      if ($msgstatus ne 'read') {
         $r->print('    <option value="markedread">'.&mt('Mark Read').'</option>."\n"');          $r->print('    <option value="markedread">'.&mt('Mark Read').'</option>'."\n");
     }      }
     if ($msgstatus ne 'unread') {      if ($msgstatus ne 'unread') {
         $r->print('    <option value="markedunread">'.&mt('Mark Unread').'</option>'."\n");          $r->print('    <option value="markedunread">'.&mt('Mark Unread').'</option>'."\n");
Line 1665  ENDREPSCRIPT Line 1670  ENDREPSCRIPT
         $r->print(&additional_rec_row(\%lt));          $r->print(&additional_rec_row(\%lt));
         $r->print('<tr><td colspan="2">'.          $r->print('<tr><td colspan="2">'.
                   &mt('Unless you choose otherwise:').'<ul><li>'.                    &mt('Unless you choose otherwise:').'<ul><li>'.
         &mt("The subject in each forwarded message will be <i>'Forwarding:'</i> followed by the original subject.").'</li><li>'.          &mt("The subject in each forwarded message will be [_1]'Forwarding:'[_2] followed by the original subject.",'<i>','</i>').'</li><li>'.
         &mt("The message itself will begin with a first line: <i>'Forwarded message from'</i> followed by the original sender's name.").'</li></ul></td></tr>');          &mt("The message itself will begin with a first line: [_1]'Forwarded message from'[_2] followed by the original sender's name.",'<i>','</i>').'</li></ul></td></tr>');
         $func1='Forward'; # do not translate here!          $func1='Forward'; # do not translate here!
         $dissub = &mt('Forwarding').': ';          $dissub = &mt('Forwarding').': ';
         $subj_size = '10';          $subj_size = '10';
Line 1895  sub disfacetoface { Line 1900  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='<div>';      my $result='';
     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 1927  sub disfacetoface { Line 1932  sub disfacetoface {
             } else {              } else {
                 %content=&Apache::lonmsg::unpackagemsg($content{'message'});                  %content=&Apache::lonmsg::unpackagemsg($content{'message'});
                 $content{'message'} =                  $content{'message'} =
                 '<b>'.&mt('Subject').': '.$content{'subject'}.'</b><br                  '<b>'.&mt('Subject').': '.$content{'subject'}.'</b><br />'.
 '.  
                 $content{'message'};                  $content{'message'};
             }              }
         } else {          } else {
Line 1957  $content{'sendername'}.':'. Line 1961  $content{'sendername'}.':'.
     if ($result eq '') {      if ($result eq '') {
         my $lctype = &mt(lc(&Apache::loncommon::course_type()));          my $lctype = &mt(lc(&Apache::loncommon::course_type()));
  if ($target ne 'tex') {    if ($target ne 'tex') { 
     $r->print("<p><b>".&mt('No notes, face-to-face discussion records, critical messages, or broadcast messages in this [_1].',$lctype)."</b></p>");      $r->print("<p><b>".&mt('No notes, face-to-face discussion records, critical messages or broadcast messages in this '.$lctype.'.')."</b></p>");
  } 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 '.$lctype.'.').'}\\\\');
  }   }
     } elsif ($target ne 'tex') {      } elsif ($target eq 'tex') {
        $r->print($result.'</div>');          $r->print(&Apache::lonxml::xmlparse($r,$target,$result));
     } else {      } else {
  $r->print(&Apache::lonxml::xmlparse($r, 'tex', $result));          $r->print('<div>'.$result.'</div>');
  }      }
 }  }
   
 sub general_message {  sub general_message {
Line 2166  sub displaymessage { Line 2170  sub displaymessage {
   
  if (&Apache::lonnet::allowed('vgr',$env{'request.course.id'})) {   if (&Apache::lonnet::allowed('vgr',$env{'request.course.id'})) {
  push(@actionlist,&Apache::loncommon::track_student_link(   push(@actionlist,&Apache::loncommon::track_student_link(
                                       &mt('View recent activity')                                        'View recent activity'
                                      ,$content{'sendername'}                                       ,$content{'sendername'}
                                      ,$content{'senderdomain'}                                       ,$content{'senderdomain'}
                                      ,'check'));                                       ,'check'));
Line 2694  sub storedcommentlisting { Line 2698  sub storedcommentlisting {
        '^'.&escape(&escape($env{'form.showcommentbaseurl'})));         '^'.&escape(&escape($env{'form.showcommentbaseurl'})));
     $r->print(&Apache::loncommon::start_page('Saved Comment Listing',undef,      $r->print(&Apache::loncommon::start_page('Saved Comment Listing',undef,
      {'onlybody' => 1}));       {'onlybody' => 1}));
     if ((keys %msgs)[0]=~/^error\:/) {      if ((keys(%msgs))[0]=~/^error\:/) {
  $r->print(&mt('No saved comments yet.'));   $r->print(&mt('No saved comments yet.'));
     } else {      } else {
  my $found=0;   my $found=0;

Removed from v.1.164  
changed lines
  Added in v.1.178


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