Diff for /loncom/interface/lonmsgdisplay.pm between versions 1.144 and 1.151

version 1.144, 2010/01/25 16:46:12 version 1.151, 2010/05/29 23:19:52
Line 222  function folder_choice(targetform,caller Line 222  function folder_choice(targetform,caller
   
     $output .= '      $output .= '
 <form method="post" action="/adm/email" name="folderlist">  <form method="post" action="/adm/email" name="folderlist">
 <table border="0" cellspacing="2" cellpadding="2">     <table border="0" cellspacing="2" cellpadding="8">
  <tr>  
   <td align="left">  
    <table border="0" cellspacing="2" cellpadding="2">  
     <tr>      <tr>
      <td align="center"><b>'.$lt{'fold'}.'</b><br />'."\n".       <td><b>'.$lt{'fold'}.'</b><br />'."\n".
          &Apache::loncommon::select_form($folder,'folder',%formhash).'           &Apache::loncommon::select_form($folder,'folder',%formhash).'
      </td>       </td>
      <td align="center"><b>'.$lt{'show'}.'</b><br />'."\n".       <td><b>'.$lt{'show'}.'</b><br />'."\n".
          &Apache::loncommon::select_form($env{'form.interdis'},'interdis',           &Apache::loncommon::select_form($env{'form.interdis'},'interdis',
  %show).'   %show).'
      </td>       </td>
      <td align="center"><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 align="center"><b>'.$lt{'actn'}.'</b><br />'.       <td><b>'.$lt{'actn'}.'</b><br />'."\n".'
          &Apache::loncommon::select_form('view','folderaction',%actions).'           <span class="LC_nobreak">'.
      </td><td><br />'.           &Apache::loncommon::select_form('view','folderaction',%actions).
     '<input type="button" value="'.$lt{'go'}.'" onclick="javascript:folder_choice(this.form,'."'change'".');" />           ' <input type="button" value="'.$lt{'go'}.
            '" onclick="javascript:folder_choice(this.form,'."'change'".');" />
            </span>
        </td>
        <td><b>'.&mt('New Folder').'</b><br />'."\n".'
            <span class="LC_nobreak">
            <input type="text" size="15" name="newfolder" value="" />
            <input type="button" value="'.$lt{'go'}.
            '" onclick="javascript:folder_choice(this.form,'."'new'".');" />
            </span>
      </td>       </td>
     </tr>      </tr>
    </table>     </table>
   </td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>  '."\n".
   <td align="right">  
    <table><tr><td><br />  
     <input type="button" value="'.&mt('New Folder').  
     '" onclick="javascript:folder_choice(this.form,'."'new'".');" /></td>'.  
     '<td align="center"><b>'.&mt('Name').'</b><br />'.  
     '<input type="text" size="15" name="newfolder" value="" />  
     </td></tr></table>  
   </td>  
  </tr>  
 </table>'."\n".  
     '<input type="hidden" name="sortedby" value="'.$env{'form.sortedby'}.'" />'.      '<input type="hidden" name="sortedby" value="'.$env{'form.sortedby'}.'" />'.
     '<input type="hidden" name="renamed" value="" />'.      '<input type="hidden" name="renamed" value="" />'.
         ($folder=~/^critical/?'</form>':'');          ($folder=~/^critical/?'</form>':'');
Line 308  sub scrollbuttons { Line 304  sub scrollbuttons {
            '<input type="submit" name="lastview" value="&gt;|" />';             '<input type="submit" name="lastview" value="&gt;|" />';
     }      }
     $output .=      $output .=
         '<br />'          '<p>'
        .'<b>'.&mt($status.' messages:').'</b> '         .'<b>'.&mt($status.' messages:').'</b> '
        .&mt('showing messages [_1] through [_2] of [_3].',         .&mt('showing messages [_1] through [_2] of [_3].',
             $first,$finish,$total)              $first,$finish,$total)
          .'</p>'
        .'</form>';         .'</form>';
   
     return $output;      return $output;
Line 381  sub deletefolder { Line 378  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.',$folder); 
     }      }
     my %userfolders = &Apache::lonmsg::get_user_folders();      my %userfolders = &Apache::lonmsg::get_user_folders();
     if (!defined($userfolders{$folder})) {      if (!defined($userfolders{$folder})) {
Line 1030  sub disfolder { Line 1027  sub disfolder {
     my ($startblock,$endblock) = &Apache::loncommon::blockcheck(\%setters,'com');      my ($startblock,$endblock) = &Apache::loncommon::blockcheck(\%setters,'com');
     my %lt = &Apache::lonlocal::texthash(      my %lt = &Apache::lonlocal::texthash(
                       sede => 'Select a destination folder to which the messages will be moved.',                        sede => 'Select a destination folder to which the messages will be moved.',
                       nome => 'No messages have been selected to apply ths action to.',                        nome => 'No messages have been selected to apply this action to.',
                       chec => 'Check the checkbox for at least one message.',                          chec => 'Check the checkbox for at least one message.',  
     );      );
     my $jscript = &Apache::loncommon::check_uncheck_jscript();      my $jscript = &Apache::loncommon::check_uncheck_jscript();
Line 1101  ENDDISHEADER Line 1098  ENDDISHEADER
     if ($lastdis>$#temp) { $lastdis=$#temp; }      if ($lastdis>$#temp) { $lastdis=$#temp; }
     $r->print(&scrollbuttons($startdis,$number,$firstdis,$lastdis,$totalnumber,$msgstatus));      $r->print(&scrollbuttons($startdis,$number,$firstdis,$lastdis,$totalnumber,$msgstatus));
     $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>');        &Apache::loncommon::start_data_table().
             &Apache::loncommon::start_data_table_row().
             '<th colspan="1">&nbsp;</th><th>');
     if ($env{'form.sortedby'} eq "revdate") {      if ($env{'form.sortedby'} eq "revdate") {
  $r->print('<a href = "/adm/email?sortedby=date'.$fsqs.'">'.&mt('Date').'</a></th>');   $r->print('<a href = "/adm/email?sortedby=date'.$fsqs.'">'.&mt('Date').'</a></th>');
     } else {      } else {
Line 1131  ENDDISHEADER Line 1130  ENDDISHEADER
     } else {      } else {
         $r->print('<a href = "/adm/email?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 colspan="2">');
     if ($env{'form.sortedby'} eq "revstatus") {      if ($env{'form.sortedby'} eq "revstatus") {
  $r->print('<a href = "/adm/email?sortedby=status'.$fsqs.'">'.&mt('Status').'</a></th>');   $r->print('<a href = "/adm/email?sortedby=status'.$fsqs.'">'.&mt('Status').'</a></th>');
     } else {      } else {
Line 1145  ENDDISHEADER Line 1144  ENDDISHEADER
  my ($sendtime,$shortsubj,$fromname,$fromdomain,$status,$origID,   my ($sendtime,$shortsubj,$fromname,$fromdomain,$status,$origID,
     $description,$recv_name,$recv_domain)=       $description,$recv_name,$recv_domain)= 
  @{$temp[$n]};   @{$temp[$n]};
  if (($status ne 'deleted') && defined($sendtime) && $sendtime!~/error/) {          if (($status ne 'deleted') && defined($sendtime) && $sendtime!~/error/) {
               my $class_msgstatus = '';
             $count ++;              $count ++;
     if ($status eq 'new') {              if ($status eq 'new') {
  $r->print('<tr class="LC_mail_new">');                  $class_msgstatus = 'LC_mail_new';
     } elsif ($status eq 'read') {              } elsif ($status eq 'read') {
  $r->print('<tr class="LC_mail_read">');                  $class_msgstatus = 'LC_mail_read';
     } elsif ($status eq 'replied') {              } elsif ($status eq 'replied') {
  $r->print('<tr class="LC_mail_replied">');                   $class_msgstatus = 'LC_mail_replied'; 
     } else {              } else {
  $r->print('<tr class="LC_mail_other">');                  $class_msgstatus = 'LC_mail_other';
     }              }
               $r->print(&Apache::loncommon::start_data_table_row($class_msgstatus));
     my ($dis_name,$dis_domain) = ($fromname,$fromdomain);      my ($dis_name,$dis_domain) = ($fromname,$fromdomain);
     if ($folder eq 'sent') {      if ($folder eq 'sent') {
                 if (defined($recv_name) && defined($recv_domain)) {                  if (defined($recv_name) && defined($recv_domain)) {
Line 1187  ENDDISHEADER Line 1188  ENDDISHEADER
                           '<a href="/adm/email?display='.$origID.$sqs.'">'.                            '<a href="/adm/email?display='.$origID.$sqs.'">'.
                           $item.(($status eq 'new')?'</b>':'').'</a></td>');                            $item.(($status eq 'new')?'</b>':'').'</a></td>');
             }              }
               # Description and Status
             my $showstatus;              my $showstatus;
             my %statushash = &get_msgstatus_types();              my %statushash = &get_msgstatus_types();
             if ($status eq '') {              if ($status eq '') {
Line 1194  ENDDISHEADER Line 1196  ENDDISHEADER
             } else {              } else {
                 $showstatus = $statushash{$status};                  $showstatus = $statushash{$status};
             }              }
     $r->print('<td>'.(($status eq 'new')?'<b>':'').$description.              $r->print('<td>'.(($status eq 'new')?'<b>':'').$description.
                       (($status eq 'new')?'</b>':'').'</td><td>'.                        (($status eq 'new')?'</b>':'').
                       (($status eq 'new')?'<b>':'').$showstatus.                        '</td>');
                       (($status eq 'new')?'</b>':'').'</td></tr>'."\n");              $r->print('<td class="'.$class_msgstatus.'">&nbsp;&nbsp;</td>'.
  } elsif ($status eq 'deleted') {                        '<td>'.
                         (($status eq 'new')?'<b>':'').&mt($showstatus).
                         (($status eq 'new')?'</b>':'').
                         '</td>');
   
               $r->print(&Apache::loncommon::end_data_table_row());
   
           } elsif ($status eq 'deleted') {
 # purge  # purge
     my ($result,$msg) =               my ($result,$msg) = 
  &movemsg(&unescape($origID),$folder,'trash');          &movemsg(&unescape($origID),$folder,'trash');
               }
  }  
     }         }   
     $r->print("</table>\n");      $r->print(&Apache::loncommon::end_data_table());
     $r->print('<table border="0" cellspacing="2" cellpadding="2">  
   
       # Bottom Functions
       $r->print('<table border="0" cellspacing="2" cellpadding="8">
  <tr>   <tr>
   <td>'.    <td>
   '<input type="button" onclick="javascript:checkAll(document.disall.delmark)" value="'.&mt('Check All').'" /><br />'."\n".     <fieldset>
   '<input type="button" onclick="javascript:uncheckAll(document.disall.delmark)" value="'.&mt('Uncheck All').'" />'."\n".     <legend>'.&mt('Select').'</legend>
   '<input type="hidden" name="sortedby" value="'.$env{'form.sortedby'}.'" /></td><td>&nbsp;</td>'."\n".     <span class="LC_nobreak">
   '<td align="center"><b>'.&mt('Action').'</b><br />'."\n".     <input type="button" onclick="javascript:checkAll(document.disall.delmark)" value="'.&mt('Check All').'" />'."\n".
     ' <input type="button" onclick="javascript:uncheckAll(document.disall.delmark)" value="'.&mt('Uncheck All').'" />'."\n".
     '<input type="hidden" name="sortedby" value="'.$env{'form.sortedby'}.'" />
     </span>
     </fieldset>
     </td>'."\n".
     '<td><b>'.&mt('Action').'</b><br />'."\n".
   '  <select name="checkedaction">'."\n");    '  <select name="checkedaction">'."\n");
   
     if ($folder ne 'trash') {      if ($folder ne 'trash') {
Line 1234  ENDDISHEADER Line 1251  ENDDISHEADER
     $r->print("\n".'</select></td>'."\n");      $r->print("\n".'</select></td>'."\n");
   
     if (keys(%gotfolders) > 0) {      if (keys(%gotfolders) > 0) {
         $r->print('<td align="center"><b>'.&mt('Destination folder').'<b><br />');          $r->print('<td><b>'.&mt('Destination folder').'<b><br />');
  my %userfolders;   my %userfolders;
         foreach my $key (keys(%gotfolders)) {          foreach my $key (keys(%gotfolders)) {
             $userfolders{$key} = $key;              $userfolders{$key} = $key;
Line 1243  ENDDISHEADER Line 1260  ENDDISHEADER
         $r->print(&Apache::loncommon::select_form('','movetofolder',%userfolders).          $r->print(&Apache::loncommon::select_form('','movetofolder',%userfolders).
                   '</td>');                    '</td>');
     }      }
     $r->print('<td>&nbsp;</td><td>&nbsp;&nbsp;'.      $r->print('<td>'.
               '<input type="button" name="go" value="'.&mt('Go').                '<input type="button" name="go" value="'.&mt('Go').
               '" onclick="javascript:validate_checkedaction()"/></td>'."\n".                '" onclick="javascript:validate_checkedaction()"/></td>'."\n".
               '</tr></table>');                '</tr></table>');
Line 1844  sub retrieve_instructor_comments { Line 1861  sub retrieve_instructor_comments {
   
 sub disfacetoface {  sub disfacetoface {
     my ($r,$user,$domain,$target)=@_;      my ($r,$user,$domain,$target)=@_;
  if ($target eq '') {      if ($target eq '') {
     my $target=$env{'form.grade_target'};          $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 1992  sub facetoface { Line 2009  sub facetoface {
              .&Apache::lonhtmlcommon::end_pick_box()               .&Apache::lonhtmlcommon::end_pick_box()
              .'<br />'               .'<br />'
              .'<input type="submit" value="'.$lt{'subm'}.'" />'               .'<input type="submit" value="'.$lt{'subm'}.'" />'
                .'</form>'
     );      );
   
     if (($stage ne 'query') &&      if (($stage ne 'query') &&
Line 2249  END Line 2267  END
                            $setuname,$setudom);                             $setuname,$setudom);
         $r->print(&Apache::loncommon::start_data_table_row());          $r->print(&Apache::loncommon::start_data_table_row());
         $r->print(<<"END");          $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>$settername</td>
         <td><input type="text" name="title_$parmcount" size="15" value="$title" /><input type="hidden" name="key_$parmcount" value="$record" /></td>          <td><input type="text" name="title_$parmcount" size="15" value="$title" /><input type="hidden" name="key_$parmcount" value="$record" /></td>
         <td>          <td>
Line 2259  END Line 2277  END
             if ($blocks->{$block} eq 'on') {              if ($blocks->{$block} eq 'on') {
                 $blockstatus = 'checked="checked"';                  $blockstatus = 'checked="checked"';
             }              }
             $r->print('<label><input type="checkbox" name="'.$block.'_'.$parmcount.'" '.$blockstatus.' value="1" />'.$types->{$block}.'</label><br />');              $r->print('<span class="LC_nobreak"><label><input type="checkbox" name="'.$block.'_'.$parmcount.'" '.$blockstatus.' value="1" />'.$types->{$block}.'</label></span><br />');
         }          }
         $r->print(<<"END");          $r->print(<<"END");
         </td>                </td>      
         <td><span class="LC_nobreak"><label>          <td><span class="LC_nobreak"><label>
         <input type="checkbox" name="modify_$parmcount" />$lt{'modi'}          <input type="checkbox" name="modify_$parmcount" />$lt{'modi'}
         </label><br />          </label></span><br /><span class="LC_nobreak">
         <label>          <label>
         <input type="checkbox" name="cancel_$parmcount" />$lt{'canc'}          <input type="checkbox" name="cancel_$parmcount" />$lt{'canc'}
         </label></span>          </label></span>
Line 2315  END Line 2333  END
      <td>       <td>
 END  END
     foreach my $block (@{$typeorder}) {      foreach my $block (@{$typeorder}) {
         $r->print('<label><input type="checkbox" name="'.$block.'_'.$parmcount.'" value="1" />'.$types->{$block}.'</label><br />');          $r->print('<span class="LC_nobreak"><label><input type="checkbox" name="'.$block.'_'.$parmcount.'" value="1" />'.$types->{$block}.'</label></span><br />');
      }       }
      $r->print(<<"END");       $r->print(<<"END");
      </td>        </td>
      <td><label>       <td><span class="LC_nobreak"><label>
      <input type="checkbox" name="add_$parmcount" value="1" />$lt{'addb'}       <input type="checkbox" name="add_$parmcount" value="1" />$lt{'addb'}
      </label></td>       </label></span></td>
 END  END
     $r->print(&Apache::loncommon::end_data_table_row());      $r->print(&Apache::loncommon::end_data_table_row());
     $r->print(&Apache::loncommon::end_data_table());      $r->print(&Apache::loncommon::end_data_table());
Line 3167  sub sendoffmail { Line 3185  sub sendoffmail {
     my ($recuname,$recdomain)=split(/\:/,$address);      my ($recuname,$recdomain)=split(/\:/,$address);
             my $msgtxt = $savemsg;              my $msgtxt = $savemsg;
             if ($toaddr{$address}) {              if ($toaddr{$address}) {
         $msgtxt.='<hr />'.$toaddr{$address};          $msgtxt.="\n".'<hr />'."\n".$toaddr{$address};
             }              }
     my @thismsg;      my @thismsg;
     if ($msgtype eq 'critical') {      if ($msgtype eq 'critical') {
Line 3287  sub sendoffmail { Line 3305  sub sendoffmail {
         }          }
             } else {              } else {
                 my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Could not deliver message'),1);                  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 .= '<br />'.&mt('Please use the browser "Back" button and correct the recipient addresses ([_1]).',$sendstatus);
                 $message = &Apache::loncommon::confirmwrapper($message);                  $message = &Apache::loncommon::confirmwrapper($message);
                 $r->print($message);                  $r->print($message);
             }              }
Line 3409  sub handler { Line 3427  sub handler {
     &statuschange($env{'form.markdel'},'deleted',$folder);      &statuschange($env{'form.markdel'},'deleted',$folder);
  if (!$result) {   if (!$result) {
             my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Failed to delete the message.'),1);              my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Failed to delete the message.'),1);
             $message .= '<p class="LC_error">'.$msg.'</p>';              $message .= '<p class="LC_error" style="font-size: inherit;">'.$msg.'</p>';
             $message = &Apache::loncommon::confirmwrapper($message);              $message = &Apache::loncommon::confirmwrapper($message);
             $r->print($message);              $r->print($message);
  }   }
Line 3459  sub handler { Line 3477  sub handler {
         &printheader($r,'','Moved Messages');          &printheader($r,'','Moved Messages');
         if (!defined($gotfolders{$destfolder})) {          if (!defined($gotfolders{$destfolder})) {
             $r->print(&mt('Destination folder [_1] is not a valid folder',              $r->print(&mt('Destination folder [_1] is not a valid folder',
                       $destfolder));                            '<span class="LC_filename">'.$destfolder.'</span>'));
         } else {          } else {
     my ($total,$failed,@failed_msg)=(0,0);      my ($total,$failed,@failed_msg)=(0,0);
             my @to_move = &Apache::loncommon::get_env_multiple('form.delmark');              my @to_move = &Apache::loncommon::get_env_multiple('form.delmark');
Line 3476  sub handler { Line 3494  sub handler {
             my $message = '';              my $message = '';
             if ($failed) {              if ($failed) {
                 $message .= &Apache::lonhtmlcommon::confirm_success(&mt('Failed to move [quant,_1,message]',$failed),1);                  $message .= &Apache::lonhtmlcommon::confirm_success(&mt('Failed to move [quant,_1,message]',$failed),1);
                 $message .= '<p class="LC_error">'.                  $message .= '<p class="LC_error" style="font-size: inherit;">'.
             join("</p>\n<p class=\"LC_error\">",@failed_msg).              join("</p>\n<p class=\"LC_error\" style=\"font-size: inherit;\">",@failed_msg).
             "</p>\n";              "</p>\n";
             }              }
             $message .= &Apache::lonhtmlcommon::confirm_success(&mt('Moved [quant,_1,message]',$total));              $message .= &Apache::lonhtmlcommon::confirm_success(&mt('Moved [quant,_1,message]',$total));
Line 3504  sub handler { Line 3522  sub handler {
         my $message = '';          my $message = '';
  if ($failed) {   if ($failed) {
             $message .= &Apache::lonhtmlcommon::confirm_success(&mt('Failed to delete [quant,_1,message]',$failed),1);              $message .= &Apache::lonhtmlcommon::confirm_success(&mt('Failed to delete [quant,_1,message]',$failed),1);
             $message .= '<p class="LC_error">'.              $message .= '<p class="LC_error" style="font-size: inherit;">'.
       join("</p>\n<p class=\"LC_error\">",@failed_msg).        join("</p>\n<p class=\"LC_error\" style=\"font-size: inherit;\">",@failed_msg).
       "</p>\n";        "</p>\n";
  }   }
         $message .= &Apache::lonhtmlcommon::confirm_success(&mt('Deleted [quant,_1,message]',$total));          $message .= &Apache::lonhtmlcommon::confirm_success(&mt('Deleted [quant,_1,message]',$total));
Line 3575  sub handler { Line 3593  sub handler {
                 my $count = keys(%forwardfail);                  my $count = keys(%forwardfail);
                 my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Could not forward [quant,_1,message].',$count),1);                  my $message = &Apache::lonhtmlcommon::confirm_success(&mt('Could not forward [quant,_1,message].',$count),1);
                 foreach my $key (keys(%forwardfail)) {                  foreach my $key (keys(%forwardfail)) {
                     $message .= '<br/>'.&mt('Could not deliver forwarded message.').'</span> '.                      $message .= '<br />'.&mt('Could not deliver forwarded message.').'</span> '.
                                 &mt('The recipient addresses may need to be corrected').' ('.$forwardfail{$key}.')';                                  &mt('The recipient addresses may need to be corrected').' ('.$forwardfail{$key}.')';
                 }                  }
                 $message = &Apache::loncommon::confirmwrapper($message);                  $message = &Apache::loncommon::confirmwrapper($message);

Removed from v.1.144  
changed lines
  Added in v.1.151


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