Diff for /loncom/interface/lonsupportreq.pm between versions 1.79.2.3.2.1 and 1.108

version 1.79.2.3.2.1, 2017/10/15 03:43:52 version 1.108, 2025/02/25 05:35:26
Line 29 Line 29
 package Apache::lonsupportreq;  package Apache::lonsupportreq;
   
 use strict;  use strict;
 use MIME::Types;  
 use MIME::Lite;  
 use CGI::Cookie();  use CGI::Cookie();
 use Apache::Constants qw(:common);  use Apache::Constants qw(:common);
 use Apache::loncommon();  use Apache::loncommon();
Line 69  sub handler { Line 67  sub handler {
         }          }
     }      }
     my $origurl = $env{'form.origurl'};      my $origurl = $env{'form.origurl'};
     $origurl =~ s{^https?://}{};      if ($origurl =~ m{^https?://[^/]+(.*)$}) {
           $origurl = $1;
       }
     $origurl =~ s/(`)//g;      $origurl =~ s/(`)//g;
     $origurl =~ s/\$/\(\$\)/g;      $origurl =~ s/\$/\(\$\)/g;
     my $command = $env{'form.command'};      my $command = $env{'form.command'};
Line 151  sub print_request_form { Line 151  sub print_request_form {
         }          }
     }      }
   
     my %coursecodes;  
     my %codes;      my %codes;
     my @codetitles;      my @codetitles;
     my %cat_titles;      my %cat_titles;
Line 159  sub print_request_form { Line 158  sub print_request_form {
     my %idlist;      my %idlist;
     my %idnums;      my %idnums;
     my %idlist_titles;      my %idlist_titles;
     my $caller = 'global';  
     my $totcodes = 0;      my $totcodes = 0;
     my $format_reply;  
     my $jscript = '';      my $jscript = '';
     my $loaditems = qq|      my $loaditems = qq|
 function initialize_codes() {  function initialize_codes() {
Line 169  function initialize_codes() { Line 166  function initialize_codes() {
 }  }
     |;      |;
     unless ($helpform{'course'} eq 'no') {      unless ($helpform{'course'} eq 'no') {
         $totcodes = &Apache::courseclassifier::retrieve_instcodes(\%coursecodes,$codedom);          my $instcats = &Apache::lonnet::get_dom_instcats($codedom);
         if ($totcodes > 0) {          if (ref($instcats) eq 'HASH') {
             $format_reply = &Apache::lonnet::auto_instcode_format($caller,$codedom,\%coursecodes,\%codes,\@codetitles,\%cat_titles,\%cat_order);              if ((ref($instcats->{'codetitles'}) eq 'ARRAY') && (ref($instcats->{'codes'}) eq 'HASH') &&
             if ($format_reply eq 'ok') {                  (ref($instcats->{'cat_titles'}) eq 'HASH') && (ref($instcats->{'cat_order'}) eq 'HASH')) {
                   %codes = %{$instcats->{'codes'}};
                   @codetitles = @{$instcats->{'codetitles'}};
                   %cat_titles = %{$instcats->{'cat_titles'}};
                   %cat_order = %{$instcats->{'cat_order'}};
                   $totcodes = scalar(keys(%codes));
               }
               if ($totcodes > 0) {
                 my $numtypes = @codetitles;                  my $numtypes = @codetitles;
                 &Apache::courseclassifier::build_code_selections(\%codes,\@codetitles,\%cat_titles,\%cat_order,\%idlist,\%idnums,\%idlist_titles);                  &Apache::courseclassifier::build_code_selections(\%codes,\@codetitles,\%cat_titles,\%cat_order,\%idlist,\%idnums,\%idlist_titles);
                 my ($scripttext,$longtitles) = &Apache::courseclassifier::javascript_definitions(\@codetitles,\%idlist,\%idlist_titles,\%idnums,\%cat_titles);                  my ($scripttext,$longtitles) = &Apache::courseclassifier::javascript_definitions(\@codetitles,\%idlist,\%idlist_titles,\%idnums,\%cat_titles);
Line 316  $loaditems Line 320  $loaditems
 // ]]>  // ]]>
 </script>  </script>
 ENDJS  ENDJS
     if ($recaptcha_version >=2) {      if ($knownuser) {
           $js .="\n".'<script type="text/javascript" src="/res/adm/includes/file_upload.js"></script>';
       } elsif ($recaptcha_version >=2) {
         $js.= "\n".'<script src="https://www.google.com/recaptcha/api.js"></script>'."\n";          $js.= "\n".'<script src="https://www.google.com/recaptcha/api.js"></script>'."\n";
     }      }
     my %add_entries = (      my %add_entries = (
Line 324  ENDJS Line 330  ENDJS
                        onload   => "initialize_codes();",                         onload   => "initialize_codes();",
                       );                        );
   
           my $args = { 'function'    => $function,
     $r->print(&Apache::loncommon::start_page('Support Request',$js,                   'add_entries' => \%add_entries,
        { 'function'    => $function,                   'only_body'   => 1,};
  'add_entries' => \%add_entries,      unless (($knownuser) || ($public)) {
  'only_body'   => 1,}));          (undef,undef,undef,my $clientmathml,my $clientunicode) =
               &Apache::loncommon::decode_user_agent();
           if ($clientunicode && !$clientmathml) {
               $args->{'browser.unicode'} = 1;
           }
       }
       $r->print(&Apache::loncommon::start_page('Support Request',$js,$args));
     if ($r->uri eq '/adm/helpdesk') {      if ($r->uri eq '/adm/helpdesk') {
         &print_header($r,$origurl);          &print_header($r,$origurl);
     }      }
Line 341  ENDJS Line 353  ENDJS
     }      }
     my $topsubmit = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value="'.$html_lt{'subm'}.'" onclick="validate()" />&nbsp;';      my $topsubmit = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" value="'.$html_lt{'subm'}.'" onclick="validate()" />&nbsp;';
     my $shownsubmit;      my $shownsubmit;
     $r->print('<form method="post" action="" name="logproblem"'.$formtype.'>'."\n");      $r->print('<div class="LC_landmark" role="main">'."\n".
                 '<form method="post" action="" name="logproblem"'.$formtype.'>'."\n");
     my $output = &Apache::lonhtmlcommon::start_pick_box().      my $output = &Apache::lonhtmlcommon::start_pick_box().
                  &Apache::lonhtmlcommon::row_headline().                   &Apache::lonhtmlcommon::row_headline().
                  '<span class="LC_info">'.                   '<span class="LC_info">'.
                  &mt('(All fields marked with * are required.)').                   &mt('(All fields marked with [_1]*[_2] are required.)',
                        '<span class="LC_parm_part">','</span>').
                  '</span>'.                   '</span>'.
                  &Apache::lonhtmlcommon::row_closure();                   &Apache::lonhtmlcommon::row_closure();
     unless ($helpform{'username'} eq 'no') {      unless ($helpform{'username'} eq 'no') {
         my ($reqd,$namefield,$fullname);          my ($reqd,$aria_reqd,$namefield,$fullname);
         if ((defined($lastname) && $lastname ne '') && (defined($firstname) && $firstname ne '')) {          if ((defined($lastname) && $lastname ne '') && (defined($firstname) && $firstname ne '')) {
             $fullname = "$firstname $lastname";              $fullname = "$firstname $lastname";
             $namefield = $fullname.'<input type="hidden" name="username" value="'.&HTML::Entities::encode($fullname,'"<>&').'" />'."\n";              $namefield = $fullname.'<input type="hidden" name="username" id="username" value="'.&HTML::Entities::encode($fullname,'"<>&').'" />'."\n";
         } else {          } else {
             if (defined($firstname) && $firstname ne '') {              if (defined($firstname) && $firstname ne '') {
                 $fullname = $firstname;                  $fullname = $firstname;
             } elsif (defined($lastname) && $lastname ne '') {              } elsif (defined($lastname) && $lastname ne '') {
                 $fullname = " $lastname";                  $fullname = " $lastname";
             }              }
             $namefield = '<input type="text" size="20" name="username" value="'.&HTML::Entities::encode($fullname,'"<>&').'" />'."\n";  
             if ($helpform{'username'} eq 'req') {              if ($helpform{'username'} eq 'req') {
                 $reqd = '<span class="LC_info">*</span>';                  $reqd = '<span class="LC_parm_part">*</span>';
                   $aria_reqd = 'aria-required="true" ';
             }              }
               $namefield = '<input type="text" size="20" name="username" id="username" value="'.&HTML::Entities::encode($fullname,'"<>&').'" '.$aria_reqd.'/>'."\n";
         }          }
         $output .= &Apache::lonhtmlcommon::row_title($html_lt{'name'}.$reqd,undef,$css[$num])."\n".$namefield.          my $title = '<label for="username">'.$html_lt{'name'}.'</label>';
           $output .= &Apache::lonhtmlcommon::row_title($title.$reqd,undef,$css[$num])."\n".$namefield.
                    $topsubmit.                     $topsubmit.
                    &Apache::lonhtmlcommon::row_closure()."\n";                     &Apache::lonhtmlcommon::row_closure()."\n";
         $shownsubmit = 1;          $shownsubmit = 1;
Line 373  ENDJS Line 389  ENDJS
     }      }
     $output .= &Apache::lonhtmlcommon::row_title(      $output .= &Apache::lonhtmlcommon::row_title(
                    '<span title="'.&mt('required').'">'.                     '<span title="'.&mt('required').'">'.
                    $html_lt{'emad'}.' <span class="LC_info">*</span></span>'                     '<label for="email">'.$html_lt{'emad'}.
                      '</label><span class="LC_parm_part">*</span></span>'
                   ,undef,$css[$i]).                    ,undef,$css[$i]).
                '<input type="text" size="20" name="email" value="'.                 '<input type="text" size="20" name="email" id="email" value="'.
                &HTML::Entities::encode($email,'"<>&').'" />'."\n";                 &HTML::Entities::encode($email,'"<>&').'" aria-required="true" />'."\n";
     unless ($shownsubmit) {      unless ($shownsubmit) {
         $output .= $topsubmit;          $output .= $topsubmit;
     }      }
Line 385  ENDJS Line 402  ENDJS
     $i = $num%2;      $i = $num%2;
     if ($knownuser) {      if ($knownuser) {
         if ($homeserver) {          if ($homeserver) {
             unless ($helpform{'cc'} eq 'no') {              my $ip = &Apache::lonnet::get_requestor_ip($r);
                 $output .= &Apache::lonhtmlcommon::row_title($html_lt{'emac'},undef,$css[$i]).              my %setters;
                            '<input type="text" size="50" name="cc" value="" /><br />'."\n".              my ($startblock,$endblock,$triggerblock,$by_ip,$blockdom) =
                   &Apache::loncommon::blockcheck(\%setters,'com',$ip);
               unless (($helpform{'cc'} eq 'no') || ($by_ip)) {
                   $output .= &Apache::lonhtmlcommon::row_title('<label for="cc">'.$html_lt{'emac'}.'</label>',
                                                                undef,$css[$i]).
                              '<input type="text" size="50" name="cc" id="cc" value="" /><br />'."\n".
                            &Apache::lonhtmlcommon::row_closure();                             &Apache::lonhtmlcommon::row_closure();
                 $num ++;                  $num ++;
                 $i = $num%2;                  $i = $num%2;
             }              }
         }          }
     }      }
     unless ($helpform{'user'} eq 'no') {      unless (($helpform{'user'} eq 'no') || ($env{'request.lti.login'})) {
         $output .= &Apache::lonhtmlcommon::row_title("$html_lt{'unme'}/$html_lt{'doma'}",undef,$css[$i]);          $output .= &Apache::lonhtmlcommon::row_title("$html_lt{'unme'}/$html_lt{'doma'}",undef,$css[$i]);
         my $udom_input = '<input type="hidden" name="udom" value="'.          my $udom_input = '<input type="hidden" name="udom" value="'.
                          &HTML::Entities::encode($udom,'"<>&').'" />'."\n";                           &HTML::Entities::encode($udom,'"<>&').'" />'."\n";
         my $uname_input = '<input type="hidden" name="uname" value="'.          my $uname_input = '<input type="hidden" name="uname" value="'.
                          &HTML::Entities::encode($uname,'"<>&').'" />'."\n";                           &HTML::Entities::encode($uname,'"<>&').'" />'."\n";
         if ($knownuser) {          if ($knownuser) {
             $output .= '<i>'.$html_lt{'unme'}.'</i>:&nbsp;'.$uname.'&nbsp;&nbsp;<i>'.$html_lt{'doma'}.'</i>:&nbsp;'.$udom.$udom_input.$uname_input;              $output .= '<span class="LC_nobreak"><span class="LC_cusr_emph">'.$html_lt{'unme'}
                         .'</span>:&nbsp;'.$uname.'&nbsp;&nbsp;<span class="LC_cusr_emph">'
                         .$html_lt{'doma'}.'</span>:&nbsp;'.$udom.$udom_input.$uname_input.'</span>';
         } else {          } else {
             my $udomform = '';              my $udomform = '';
             my $unameform = '';              my $unameform = '';
Line 415  ENDJS Line 439  ENDJS
             $output .= '<br />'."\n";              $output .= '<br />'."\n";
             if (!$public) {              if (!$public) {
                 if ($env{'user.domain'} =~ /^$match_domain$/) {                  if ($env{'user.domain'} =~ /^$match_domain$/) {
                     $udomform = '<i>'.$html_lt{'doma'}.'</i>:&nbsp;'.$udom.$udom_input;                      $udomform = '<span class="LC_cusr_emph">'.$html_lt{'doma'}.'</span>:&nbsp;'.$udom.$udom_input;
                 } elsif ($env{'user.name'} =~ /^$match_username$/) {                  } elsif ($env{'user.name'} =~ /^$match_username$/) {
                     $unameform = '<i>'.$html_lt{'unme'}.'</i>:&nbsp;'.$uname.'&nbsp;&nbsp;'.$uname_input;                      $unameform = '<span class="LC_cusr_emph">'.$html_lt{'unme'}.'</span>:&nbsp;'.$uname.'&nbsp;&nbsp;'.$uname_input;
                 }                  }
             }              }
             if ($udomform eq '') {              if ($udomform eq '') {
                 $udomform = '<i>'.$html_lt{'doma'}.'</i>:&nbsp;';                  $udomform = '<span class="LC_nobreak"><span class="LC_cusr_emph"><label for="udom">'
                 $udomform .= &Apache::loncommon::select_dom_form($codedom,'udom')."\n";                             .$html_lt{'doma'}.'</label></span>:&nbsp;'
                              .&Apache::loncommon::select_dom_form($codedom,'udom','','','','','','','udom')."</span>\n";
             }              }
             if ($unameform eq '') {              if ($unameform eq '') {
                 $unameform= '<i>'.$html_lt{'unme'}.'</i>:&nbsp;<input type="text" size="20" name="uname" value="'.$uname.'" />&nbsp;&nbsp;';                  $unameform= '<span class="LC_nobreak"><span class="LC_cusr_emph"><label for="uname">'
                              .$html_lt{'unme'}.'</label></span>:&nbsp;'
                              .'<input type="text" size="20" name="uname" id="uname" value="'.$uname.'" />'
                              .'&nbsp;&nbsp;</span>';
             }              }
             $output .= $unameform.$udomform;              $output .= $unameform.$udomform;
         }          }
         $output .= &Apache::lonhtmlcommon::row_closure();          $output .= &Apache::lonhtmlcommon::row_closure();
         $num ++;          $num ++;
           $i = $num%2;
       }
       unless ($env{'request.lti.login'}) {
           $output .= &Apache::lonhtmlcommon::row_title("$html_lt{'urlp'}",undef,$css[$i]).
                      $server."\n".'<input type="hidden" name="sourceurl" value="'.
                      &HTML::Entities::encode($sourceurl,'"<>&').'" />'."\n".
                      &Apache::lonhtmlcommon::row_closure();
     }      }
     $i = $num%2;  
     $output .= &Apache::lonhtmlcommon::row_title("$html_lt{'urlp'}",undef,$css[$i]).  
                $server."\n".'<input type="hidden" name="sourceurl" value="'.  
                &HTML::Entities::encode($sourceurl,'"<>&').'" />'."\n".  
                &Apache::lonhtmlcommon::row_closure();  
     unless ($helpform{'phone'} eq 'no') {      unless ($helpform{'phone'} eq 'no') {
         my $reqd;          my ($reqd,$aria_reqd);
         if ($helpform{'phone'} eq 'req') {          if ($helpform{'phone'} eq 'req') {
             $reqd = '<span class="LC_info">*</span>';              $reqd = '<span class="LC_parm_part">*</span>';
               $aria_reqd = 'aria-required="true" ';
         }          }
         $output .= &Apache::lonhtmlcommon::row_title($html_lt{'phon'}.$reqd,undef,'LC_evenrow_value').          $output .= &Apache::lonhtmlcommon::row_title('<label for="phone">'.$html_lt{'phon'}.'</label>'.$reqd,undef,'LC_evenrow_value').
                    '<input type="text" size="15" name="phone" /><br />'."\n".                     '<input type="text" size="15" name="phone" id="phone" '.$aria_reqd.'/><br />'."\n".
                    &Apache::lonhtmlcommon::row_closure();                     &Apache::lonhtmlcommon::row_closure();
         $num ++;          $num ++;
         $i = $num%2;          $i = $num%2;
     }      }
     unless ($helpform{'course'} eq 'no') {      unless (($helpform{'course'} eq 'no') || ($env{'request.lti.login'})) {
         $output .= &Apache::lonhtmlcommon::row_title("$html_lt{'crsd'}$details_title",undef,$css[$i]);          $output .= &Apache::lonhtmlcommon::row_title("$html_lt{'crsd'}$details_title",undef,$css[$i]);
         if ($totcodes > 0) {          if ($totcodes > 0) {
             my $numtitles = @codetitles;              my $numtitles = @codetitles;
             if ($numtitles == 0) {              if ($numtitles == 0) {
                 $output .= $html_lt{'enin'}.':&nbsp;                  $output .= '<label>'.$html_lt{'enin'}.':&nbsp;
                   <input type="text" name="coursecode" size="15" value="" />'."\n";                    <input type="text" name="coursecode" size="15" value="'.&HTML::Entities::encode($ccode,'\'"&<>').'" /></label>'."\n";
             } else {              } else {
                 my @standardnames = &Apache::loncommon::get_standard_codeitems();                  my @standardnames = &Apache::loncommon::get_standard_codeitems();
                 my $lasttitle = $numtitles;                  my $lasttitle = $numtitles;
Line 465  ENDJS Line 496  ENDJS
                 if ($sectionlist) {                  if ($sectionlist) {
                     $onchange = 'toggleSecVis()';                      $onchange = 'toggleSecVis()';
                 }                  }
                 $output .= '<table><tr><td>'.$codetitles[0].'<br />'."\n".                  $output .= '<table><tr>';
                       '<select name="'.$standardnames[0].'" onchange="courseSet('."'$codetitles[0]'".');'.$onchange.'">'."\n".                  for (my $i=0; $i<$lasttitle; $i++) {
                       $output .= '<th><label for="'.$standardnames[$i].'_'.$i.'">'.$codetitles[0].'</label></th>';
                   }
                   $output .= '</tr>';
                   $output .= '<tr><td>'.
                         '<select name="'.$standardnames[0].'" id="'.$standardnames[0].'_0" onchange="courseSet('."'$codetitles[0]'".');'.$onchange.'">'."\n".
                       ' <option value="-1">'.$html_lt{'sele'}."</option>\n";                        ' <option value="-1">'.$html_lt{'sele'}."</option>\n";
                 my @items = ();                  my @items = ();
                 my @longitems = ();                  my @longitems = ();
Line 493  ENDJS Line 529  ENDJS
                     $output .= ' <option value="'.$items[$i].'">'.$longitems[$i].'</option>'."\n";                      $output .= ' <option value="'.$items[$i].'">'.$longitems[$i].'</option>'."\n";
                 }                  }
                 $output .= '</select></td>';                  $output .= '</select></td>';
                 for (my $i=1; $i<$numtitles; $i++) {                  for (my $i=1; $i<$lasttitle; $i++) {
                     $output .= '<td>'.$codetitles[$i].'<br />'."\n".                      $output .= '<td>'."\n".
                      '<select name="'.$standardnames[$i].'" onchange="courseSet('."'$codetitles[$i]'".');'.$onchange.'">'."\n".                       '<select name="'.$standardnames[$i].'" id="'.$standardnames[$i].'_'.$i.'" onchange="courseSet('."'$codetitles[$i]'".');'.$onchange.'">'."\n".
                      '<option value="-1">&lt;-'.$html_lt{'pick'}.' '.$codetitles[$i-1].'</option>'."\n".                       '<option value="-1">&lt;-'.$html_lt{'pick'}.' '.$codetitles[$i-1].'</option>'."\n".
                      '</select>'."\n".                       '</select>'."\n".
                      '</td>'."\n";                       '</td>'."\n";
                 }                  }
                 $output .= '</tr></table>';                  $output .= '</tr></table>';
                 if ($numtitles > 4) {                  if ($numtitles > 4) {
                     $output .= '<br /><br />'.$codetitles[$numtitles].'<br />'."\n".                      $output .= '<br /><br /><label>'.$codetitles[$numtitles].'<br />'."\n".
                           '<select name="'.$standardnames[$numtitles].'" onchange="courseSet('."'$codetitles[$numtitles]'".');'.$onchange.'">'."\n".                            '<select name="'.$standardnames[$numtitles].'" onchange="courseSet('."'$codetitles[$numtitles]'".');'.$onchange.'">'."\n".
                           '<option value="-1">&lt;-'.$html_lt{'pick'}.' '.$codetitles[$numtitles-1].'</option>'."\n".                            '<option value="-1">&lt;-'.$html_lt{'pick'}.' '.$codetitles[$numtitles-1].'</option>'."\n".
                           '</select>'."\n";                            '</select></label>'."\n";
                 }                  }
             }              }
         } else {          } else {
             $output .= $html_lt{'enin'}.':&nbsp;              $output .= '<label>'.$html_lt{'enin'}.':&nbsp;
                   <input type="text" name="coursecode" size="15" value="" />'."\n";                    <input type="text" name="coursecode" size="15" value="" /></label>'."\n";
         }          }
         my $reqd;          my ($reqd,$aria_reqd);
         if ($helpform{'course'} eq 'req') {          if ($helpform{'course'} eq 'req') {
              $reqd = '<span class="LC_info">*</span>';               $reqd = '<span class="LC_parm_part">*</span>';
                $aria_reqd = 'aria-required="true" ';
         }          }
         $output .= '<br />'.$html_lt{'enct'}.$reqd.':&nbsp;          $output .= '<br /><div><label>'.$html_lt{'enct'}.$reqd.':&nbsp;
                    <input type="text" name="title" size="25" value="'.                     <input type="text" name="title" size="25" value="'.
                    &HTML::Entities::encode($ctitle,'"<>&').'" />'."\n";                     &HTML::Entities::encode($ctitle,'"<>&').'" '.$aria_reqd.'/></label></div>'."\n";
         $output .= &Apache::lonhtmlcommon::row_closure();          $output .= &Apache::lonhtmlcommon::row_closure();
         $num ++;          $num ++;
         $i = $num%2;          $i = $num%2;
     }      }
     unless ($helpform{'section'} eq 'no') {      unless (($helpform{'section'} eq 'no') || ($env{'request.lti.login'})) {
         $output .= &Apache::lonhtmlcommon::row_title($html_lt{'secn'},undef,$css[$i]);          $output .= &Apache::lonhtmlcommon::row_title('<label for="section">'.$html_lt{'secn'}.'</label>',
                                                        undef,$css[$i]);
         if ($sectionlist) {          if ($sectionlist) {
             $output .= "<div id=\"LC_helpdesk_sectionlist\"><select name=\"sectionsel\">\n".              $output .= "<div id=\"LC_helpdesk_sectionlist\">\n".
                          "<select name=\"sectionsel\" id=\"section\">\n".
                        "  <option value=\"\" selected=\"selected\">$html_lt{'sele'}</option>\n";                         "  <option value=\"\" selected=\"selected\">$html_lt{'sele'}</option>\n";
             foreach my $id (sort(keys(%groupid))) {              foreach my $id (sort(keys(%groupid))) {
                 if ($id eq $groupid{$id} || $groupid{$id} eq '') {                  if ($id eq $groupid{$id} || $groupid{$id} eq '') {
Line 541  ENDJS Line 580  ENDJS
             }              }
             $output .= '</select></div>'."\n".              $output .= '</select></div>'."\n".
                        '<div id="LC_helpdesk_section" style="display:none">'.                         '<div id="LC_helpdesk_section" style="display:none">'.
                        '<input type="text" name="sectiontxt" size="10" /></div>'."\n";                         '<input type="text" name="sectiontxt" id="notinuse" size="10" /></div>'."\n";
         } else {          } else {
             $output .= '<input type="text" name="section" size="10" />'."\n";              $output .= '<input type="text" name="section" id="section" size="10" />'."\n";
         }          }
         $output .= &Apache::lonhtmlcommon::row_closure();          $output .= &Apache::lonhtmlcommon::row_closure();
         $num ++;          $num ++;
Line 551  ENDJS Line 590  ENDJS
     }      }
     $output .= &Apache::lonhtmlcommon::row_title(      $output .= &Apache::lonhtmlcommon::row_title(
                    '<span title="'.&mt('required').'">'.                     '<span title="'.&mt('required').'">'.
                    $html_lt{'subj'}.' <span class="LC_info">*</span></span>'                     '<label for="subject">'.$html_lt{'subj'}.'</label>'.
                      '<span class="LC_parm_part">*</span></span>'
                   ,undef,'LC_oddrow_value').                    ,undef,'LC_oddrow_value').
                '<input type="text" size="40" name="subject" />'."\n".                 '<input type="text" size="40" name="subject" id="subject" aria-required="true" />'."\n".
                &Apache::lonhtmlcommon::row_closure().                 &Apache::lonhtmlcommon::row_closure().
                &Apache::lonhtmlcommon::row_title(                 &Apache::lonhtmlcommon::row_title(
                    '<span title="'.&mt('required').'">'.                     '<span title="'.&mt('required').'">'.
                    $html_lt{'detd'}.' <span class="LC_info">*</span></span>'                     '<label for="description">'.$html_lt{'detd'}.'</label>'.
                      '<span class="LC_parm_part">*</span></span>'
                   ,undef,'LC_evenrow_value').                    ,undef,'LC_evenrow_value').
                '<textarea rows="10" cols="45" name="description" style="word-wrap:normal;">'.                 '<textarea rows="10" cols="45" name="description" id="description" style="word-wrap:normal;" aria-required="true">'.
                '</textarea>'."\n".                 '</textarea>'."\n".
                &Apache::lonhtmlcommon::row_closure();                 &Apache::lonhtmlcommon::row_closure();
     $num ++;      $num ++;
Line 574  ENDJS Line 615  ENDJS
                     $showmax = $helpform{'maxsize'};                      $showmax = $helpform{'maxsize'};
                 }                  }
                 $showmax = ' ('.sprintf("%.2f",$showmax).' '.&mt('MB max.').')';                  $showmax = ' ('.sprintf("%.2f",$showmax).' '.&mt('MB max.').')';
                 $output .= &Apache::lonhtmlcommon::row_title($html_lt{'opfi'},undef,$css[$i]).                  $output .= &Apache::lonhtmlcommon::row_title($html_lt{'opfi'},undef,$css[$i])
                        ' <input type="file" name="screenshot" size="20" /><br />'.                      .'<input type="file" name="screenshot" id="screenshot" class="LC_flUpload" size="20" />'
                        "\n".$html_lt{'uplf'}.$showmax."\n".                      .'<input type="hidden" id="LC_free_space" value="'.$max.'" />'
                        &Apache::lonhtmlcommon::row_closure();                      .'<br />'."\n".'<label for="screenshot">'.$html_lt{'uplf'}.'</label>'.$showmax."\n"
                       .&Apache::lonhtmlcommon::row_closure();
                 $num ++;                  $num ++;
                 $i = $num%2;                  $i = $num%2;
             }              }
Line 587  ENDJS Line 629  ENDJS
             $output .= &Apache::lonhtmlcommon::row_title(              $output .= &Apache::lonhtmlcommon::row_title(
                            '<span title="'.&mt('required').'">'.                             '<span title="'.&mt('required').'">'.
                            &mt('Validation').                             &mt('Validation').
                            ' <span class="LC_info">*</span></span>'                             '<span class="LC_parm_part">*</span></span>'
                       ,undef,$css[$i]).                        ,undef,$css[$i]).
                        $captcha_form."\n".                         $captcha_form."\n".
                        &Apache::lonhtmlcommon::row_closure();                         &Apache::lonhtmlcommon::row_closure();
Line 597  ENDJS Line 639  ENDJS
     }      }
     $output .= &Apache::lonhtmlcommon::row_title($html_lt{'fini'},undef,$css[$i]);      $output .= &Apache::lonhtmlcommon::row_title($html_lt{'fini'},undef,$css[$i]);
     $output .= <<END;      $output .= <<END;
              <table border="0" cellpadding="8" cellspacing="0">               <div>
               <tr>                 <div class="LC_floatleft" style="padding-top:0, padding-left:8px; padding-right:8px; padding-bottom:0; margin:0">
                <td>  
                 <input type="hidden" name="command" value="process" />                  <input type="hidden" name="command" value="process" />
                 <input type="button" value="$html_lt{'subm'}" onclick="validate()" /> &nbsp;                  <input type="button" value="$html_lt{'subm'}" onclick="validate()" /> &nbsp;
                </td>                 </div>
                <td>&nbsp;</td>                 <div class="LC_floatleft" style="padding-top:0, padding-left:8px; padding-right:8px; padding-bottom:0; margin:0">
                <td>  
                 <input type="reset" value="$html_lt{'clfm'}" />                  <input type="reset" value="$html_lt{'clfm'}" />
                </td>                 </div>
               </tr>               </div>
              </table>               <div style="padding:0;clear:both;margin:0;border:0"></div>
 END  END
     $output .= &Apache::lonhtmlcommon::row_closure(1);      $output .= &Apache::lonhtmlcommon::row_closure(1);
     $output .= &Apache::lonhtmlcommon::end_pick_box();      $output .= &Apache::lonhtmlcommon::end_pick_box();
Line 616  END Line 656  END
 $output  $output
 </form>  </form>
 <br />  <br />
   </div>
 END  END
     $r->print(&Apache::loncommon::end_page());      $r->print(&Apache::loncommon::end_page());
     return;      return;
Line 624  END Line 665  END
 sub print_request_receipt {  sub print_request_receipt {
     my ($r,$url,$function) = @_;      my ($r,$url,$function) = @_;
     my $public;      my $public;
       my $args;
     if (($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public')) {      if (($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public')) {
         $public = 1;          $public = 1;
     }      }
Line 632  sub print_request_receipt { Line 674  sub print_request_receipt {
         my ($captcha_chk,$captcha_error) =           my ($captcha_chk,$captcha_error) = 
             &Apache::loncommon::captcha_response('login',$lonhost);              &Apache::loncommon::captcha_response('login',$lonhost);
         if ($captcha_chk != 1) {          if ($captcha_chk != 1) {
             $r->print(&Apache::loncommon::start_page('Support request failed',undef,              $args = {
                                        {'function'    => $function,                       'function'    => $function,
                                         'add_entries' => {                       'add_entries' => {
                                             topmargin    => "0",                                           topmargin    => "0",
                                             marginheight => "0",                                           marginheight => "0",
                                         },                                        },
                                         'only_body'   => 1,}));                       'only_body'   => 1,};
               (undef,undef,undef,my $clientmathml,my $clientunicode) =
                   &Apache::loncommon::decode_user_agent();
               if ($clientunicode && !$clientmathml) {
                   $args->{'browser.unicode' => 1};
               }
               $r->print(&Apache::loncommon::start_page('Support request failed',undef,$args));
             if ($r->uri eq '/adm/helpdesk') {              if ($r->uri eq '/adm/helpdesk') {
                 &print_header($r,$url,'process');                  &print_header($r,$url,'process');
             }              }
             $r->print(              $r->print(
                 '<h2>'.&mt('Support request failed').'</h2>'.                  '<div class="LC_landmark" role="main">'.
                   '<h2 class="LC_heading_2">'.&mt('Support request failed').'</h2>'.
                       &Apache::lonhtmlcommon::confirm_success(                        &Apache::lonhtmlcommon::confirm_success(
                         &mt('Validation of the code you entered failed.'),1).                          &mt('Validation of the code you entered failed.'),1).
                 '<br /><br />'.                  '<br /><br />'.
                 &Apache::lonhtmlcommon::actionbox([                  &Apache::lonhtmlcommon::actionbox([
                     &mt('[_1]Go back[_2] and try again',                      &mt('[_1]Go back[_2] and try again',
                         '<a href="javascript:history.go(-1)">','</a>')]).                          '<a href="javascript:history.go(-1)">','</a>')]).
                       &Apache::loncommon::end_page());                  '</div>'.
                   &Apache::loncommon::end_page());
             return;              return;
         }          }
     }      }
     my @ENVvars = ('HTTP_HOST','HTTP_USER_AGENT','REMOTE_ADDR','SERVER_ADDR','SERVER_NAME');      my $ip = &Apache::lonnet::get_requestor_ip($r);
       my %setters;
       my ($startblock,$endblock,$triggerblock,$by_ip,$blockdom) =
           &Apache::loncommon::blockcheck(\%setters,'com',$ip);
       my @ENVvars = ('HTTP_HOST','HTTP_USER_AGENT','SERVER_ADDR','SERVER_NAME');
     my @envvars = ('browser.os','browser.type','browser.version','user.home','request.role');      my @envvars = ('browser.os','browser.type','browser.version','user.home','request.role');
     my @loncvars = ('user.name','user.domain','request.course.sec','request.course.id');      my @loncvars = ('user.name','user.domain','request.course.sec','request.course.id');
     my @cookievars = ('lonID');      my @cookievars;
       if ($ENV{'SERVER_PORT'} == 443) {
           @cookievars = ('lonLinkID');
       } else {
           @cookievars = ('lonID');
       }
   
     my $admin = $Apache::lonnet::perlvar{'lonAdminMail'};      my $admin = $Apache::lonnet::perlvar{'lonAdminMail'};
     my $origmail = $Apache::lonnet::perlvar{'lonSupportEMail'};      my $origmail = $Apache::lonnet::perlvar{'lonSupportEMail'};
Line 688  sub print_request_receipt { Line 747  sub print_request_receipt {
     unless ($helpform{'phone'} eq 'no') {      unless ($helpform{'phone'} eq 'no') {
         $formvars{'phone'} = 1;          $formvars{'phone'} = 1;
     }      }
     unless ($helpform{'section'} eq 'no') {      unless (($helpform{'section'} eq 'no') || ($env{'request.lti.login'})) {
         $formvars{'section'} = 1;          $formvars{'section'} = 1;
     }      }
     unless ($helpform{'course'} eq 'no') {      unless (($helpform{'course'} eq 'no') || ($env{'request.lti.login'})) {
         $formvars{'course'} = 1;          $formvars{'course'} = 1;
     }      }
     unless ($helpform{'cc'} eq 'no') {      unless (($helpform{'cc'} eq 'no') || ($by_ip)) {
         $formvars{'cc'} = 1;          $formvars{'cc'} = 1;
     }      }
     unless ($helpform{'screenshot'} eq 'no') {      unless ($helpform{'screenshot'} eq 'no') {
         $formvars{'screenshot'} = 1;          $formvars{'screenshot'} = 1;
     }      }
     my $coursecode;      my ($coursecode,$sourceurl);
     if ($formvars{'course'}) {      if ($formvars{'course'}) {
         $coursecode = $env{'form.coursecode'};          $coursecode = $env{'form.coursecode'};
         if ($coursecode eq '') {          if ($coursecode eq '') {
             my $totcodes = 0;              my $totcodes = 0;
             my %coursecodes;              my $instcats = &Apache::lonnet::get_dom_instcats($defdom);
             $totcodes = &Apache::courseclassifier::retrieve_instcodes(\%coursecodes,$defdom);              if (ref($instcats) eq 'HASH') {
                   if (ref($instcats->{'codes'}) eq 'HASH') {
                       $totcodes = scalar(keys(%{$instcats->{'codes'}}));
                   }
               }
             my @standardnames = &Apache::loncommon::get_standard_codeitems();              my @standardnames = &Apache::loncommon::get_standard_codeitems();
             if ($totcodes > 0) {              if ($totcodes > 0) {
                 my $noregexps = 1;                  my $noregexps = 1;
Line 736  sub print_request_receipt { Line 799  sub print_request_receipt {
                  secn        => 'Section',                   secn        => 'Section',
                  warn        => 'Warning: Problem with support e-mail address',                   warn        => 'Warning: Problem with support e-mail address',
                  your        => 'Your support request contained the following information',                   your        => 'Your support request contained the following information',
                    belo        => 'Below is your support request which could not be sent',
                    ifyk        => 'If you know an IT support address for your institution, you could copy this information and send it to that email address.',
                  sect        => 'section',                   sect        => 'section',
                  info        => 'Information supplied',                   info        => 'Information supplied',
                  adin        => 'Additional information recorded',                   adin        => 'Additional information recorded',
Line 794  sub print_request_receipt { Line 859  sub print_request_receipt {
             $badccmsg .= '<br />'.&mt('The following Cc e-mail addresses are invalid: '). &Apache::loncommon::cleanup_html(join(', ',@bad_ccs));              $badccmsg .= '<br />'.&mt('The following Cc e-mail addresses are invalid: '). &Apache::loncommon::cleanup_html(join(', ',@bad_ccs));
         }          }
     }      }
     $env{'form.user'} = "'".$env{'form.uname'}.':'.$env{'form.udom'}."'";      if ($env{'request.lti.login'}) {
           if (($env{'user.name'} ne '') && ($env{'user.domain'} ne '')) {
               $env{'form.user'} = "'".$env{'user.name'}.':'.$env{'user.domain'}."'";
           }
           $sourceurl = &Apache::lonnet::absolute_url().$url;
       } else {
           $env{'form.user'} = "'".$env{'form.uname'}.':'.$env{'form.udom'}."'";
           $sourceurl = $env{'form.sourceurl'};
       }
     if ($formvars{'course'}) {      if ($formvars{'course'}) {
         $env{'form.crsi'} = $env{'form.title'};          $env{'form.crsi'} = $env{'form.title'};
         if ($coursecode ne '') {          if ($coursecode ne '') {
Line 833  sub print_request_receipt { Line 906  sub print_request_receipt {
     }      }
     $supportmsg .= "$lt{'subject'}: $env{'form.subject'}      $supportmsg .= "$lt{'subject'}: $env{'form.subject'}
 $lt{'description'}: $env{'form.description'}  $lt{'description'}: $env{'form.description'}
 $lt{'sourceurl'}: $env{'form.sourceurl'}  $lt{'sourceurl'}: $sourceurl
 $lt{'date'}: $reporttime  $lt{'date'}: $reporttime
 ";  ";
   
Line 867  $lt{'date'}: $reporttime Line 940  $lt{'date'}: $reporttime
                     next if ($helpform{$item} eq 'no');                      next if ($helpform{$item} eq 'no');
                 }                  }
                 next if (($item eq 'crsi') && ($helpform{'course'} eq 'no'));                  next if (($item eq 'crsi') && ($helpform{'course'} eq 'no'));
                   next if (($item eq 'user') && ($env{'request.lti.login'}));
                 my $showitem = $env{'form.'.$item};                  my $showitem = $env{'form.'.$item};
                 $showitem = &Apache::loncommon::cleanup_html($showitem);                  $showitem = &Apache::loncommon::cleanup_html($showitem);
                 $displaymsg .=                   $displaymsg .= 
Line 882  $lt{'date'}: $reporttime Line 956  $lt{'date'}: $reporttime
         $env{'form.'.$field} =~ s/\s+$//;          $env{'form.'.$field} =~ s/\s+$//;
     }      }
     if ($env{'form.uname'} =~ /^$match_username$/) {      if ($env{'form.uname'} =~ /^$match_username$/) {
         $requdom = $env{'form.udom'};          $requname = $env{'form.uname'};
     }      }
     if ($env{'form.udom'} =~ /^$match_domain$/) {      if ($env{'form.udom'} =~ /^$match_domain$/) {
         $requdom = $env{'form.udom'};          $requdom = $env{'form.udom'};
Line 904  $lt{'date'}: $reporttime Line 978  $lt{'date'}: $reporttime
   
     $displaymsg .= '<span class="LC_helpform_receipt_cat">'.      $displaymsg .= '<span class="LC_helpform_receipt_cat">'.
                    $lt{'date'}.'</span>: '.$reporttime.'<br />'."\n";                     $lt{'date'}.'</span>: '.$reporttime.'<br />'."\n";
       my $args = {'function'    => $function,
     my $start_page =                   'add_entries' => {
  &Apache::loncommon::start_page('Support request recorded',undef,                                      topmargin    => "0",
        {'function'    => $function,                                      marginheight => "0",
  'add_entries' => {                                   },
     topmargin    => "0",                  'only_body'   => 1,};
     marginheight => "0",      (undef,undef,undef,my $clientmathml,my $clientunicode) =
  },          &Apache::loncommon::decode_user_agent();
  'only_body'   => 1,});      if ($clientunicode && !$clientmathml) {
           $args->{'browser.unicode'} = 1;
       }
       $r->print(&Apache::loncommon::start_page('Support request recorded',undef,$args));
     $r->print(<<"END");      $r->print(<<"END");
 $start_page  
 <form name="logproblem" action="">  <form name="logproblem" action="">
 <input type="hidden" name="command" value="result" />  <input type="hidden" name="command" value="result" />
 </form>  </form>
Line 955  END Line 1030  END
   
     my $message;      my $message;
     if (!$bad_email) {      if (!$bad_email) {
         $message = &Apache::lonhtmlcommon::confirm_success(          $message = &mt('A support request has been sent to [_1]','<tt>'.$to.'</tt>');
             &mt('A support request has been sent to [_1]','<tt>'.$to.'</tt>'));  
     } else {      } else {
         $message = &Apache::lonhtmlcommon::confirm_success(          $message = $lt{'warn'}.'<br />';
             $lt{'warn'}.'<br />'          if ($to eq '') {
            .&mt('As the e-mail address provided for this LON-CAPA server ([_1]) does not appear to be a valid e-mail address, your support request has [_2]not[_3] been sent to the LON-CAPA support staff or administrator at your institution.','<tt>'.$to.'</tt>','<b>','</b>')              $message .= &mt('For this LON-CAPA server no e-mail address has been configured to receive support requests, so your support request has [_1]not[_2] been sent to the LON-CAPA support staff or administrator at your institution.','<b>','</b>');
            .' '.&mt('Instead a copy has been sent to the LON-CAPA support team at Michigan State University.'),1);           } else {
         $to = 'helpdesk@lon-capa.org';              $message .= &mt('As the e-mail address provided for this LON-CAPA server ([_1]) does not appear to be a valid e-mail address, your support request has [_2]not[_3] been sent to the LON-CAPA support staff or administrator at your institution.','<tt>'.$to.'</tt>','<b>','</b>');
           }
       }
       $r->print('<div class="LC_landmark" role="main">');
       if ($bad_email) {
           $r->print(&Apache::loncommon::confirmwrapper(&Apache::lonhtmlcommon::confirm_success($message,$bad_email)).'<br />');
     }      }
     $r->print(&Apache::loncommon::confirmwrapper($message));  
   
     if ($reqemail ne '') {      if ($reqemail ne '') {
         $from = $reqemail;          $from = $reqemail;
     }      }
Line 1016  END Line 1093  END
     if ($$cookie{'lonID'} =~ /lonID=($LONCAPA::handle_re);/) {      if ($$cookie{'lonID'} =~ /lonID=($LONCAPA::handle_re);/) {
         $cookies{'lonID'} = $1;          $cookies{'lonID'} = $1;
     }      }
       if ($$cookie{'lonLinkID'} =~ /lonLinkID=([a-f0-9]+_linked);/) {
           $cookies{'lonLinkID'} = $1;
       }
       my $lti_info;
       if (($env{'request.lti.login'}) && ($env{'request.course.id'})) {
           my $ltidom = $env{'course.'.$env{'request.course.id'}.'.domain'};
           if ($ltidom) {
               my %lti = &Apache::lonnet::get_domain_lti($ltidom,'provider');
               if (ref($lti{$env{'request.lti.login'}}) eq 'HASH') {
                   if ($lti{$env{'request.lti.login'}}{'consumer'}) {
                       $lti_info = "LTI consumer: ".$lti{$env{'request.lti.login'}}{'consumer'}."\n";
                   }
               }
           }
       }
     if ($attachmentpath =~ m-/([^/]+)$-) {      if ($attachmentpath =~ m-/([^/]+)$-) {
         $fname = $1;          $fname = $1;
         $displaymsg .= '<br />'          $displaymsg .= '<br />'
Line 1031  END Line 1122  END
         foreach my $var(@ENVvars) {          foreach my $var(@ENVvars) {
             $supportmsg .= "$var: $ENV{$var}\n";              $supportmsg .= "$var: $ENV{$var}\n";
         }          }
           $supportmsg .= "REMOTE_ADDR: $ip\n";
         foreach my $var (@envvars) {          foreach my $var (@envvars) {
             $supportmsg .= "$var: $env{$var}\n";              $supportmsg .= "$var: $env{$var}\n";
         }          }
           if ($lti_info) {
               $supportmsg .= $lti_info;
           }
     }      }
   
     my $cc_string;      my $cc_string;
Line 1051  END Line 1146  END
         foreach my $var (@ENVvars) {          foreach my $var (@ENVvars) {
             $attachment_text .= "$var: $ENV{$var}\n";              $attachment_text .= "$var: $ENV{$var}\n";
         }          }
           $attachment_text .= "REMOTE_ADDR: $ip\n";
         foreach my $var (@envvars) {          foreach my $var (@envvars) {
             $attachment_text .= "$var: $env{$var}\n";              $attachment_text .= "$var: $env{$var}\n";
         }          }
         foreach my $var (@loncvars) {          foreach my $var (@loncvars) {
             $attachment_text .= "$var: $env{$var}\n";              $attachment_text .= "$var: $env{$var}\n";
         }          }
           if ($lti_info) {
               $attachment_text .= $lti_info;
           }
     }      }
   
     if ($addtext) {      if ($addtext) {
Line 1069  END Line 1168  END
         }          }
     }      }
   
     my $msg = MIME::Lite->new(      if ($bad_email) {
                  From    => $from,          $r->print('<b>'.$lt{'belo'}.'</b><br />'.
                  To      => $to,                    $lt{'ifyk'}."\n");
                  Subject => $subject,      } else {
                  Type    =>'TEXT',          # Compose and send a MIME email
                  Data    => $supportmsg,          &Apache::loncommon::mime_email($from,'',$to,$subject,$supportmsg,$cc_string,
                  );                                         $bcc,$attachmentpath,$fname,$attachment_text);
     if ($homeserver) {          $r->print('<b>'.$lt{'your'}.'</b>:'."\n");
         if (@ok_ccs > 0) {  
             my $cc_string = join(', ',@ok_ccs);  
             $msg->add("Cc" => $cc_string);  
         }  
     }  
     if ($bcc ne '') {  
         $msg->add("Bcc" => $bcc);  
     }  
     $msg->attr("content-type"         => "text/plain");  
     $msg->attr("content-type.charset" => "UTF-8");  
   
     if ($homeserver && $attachmentpath) {  
         my ($type, $encoding) = MIME::Types::by_suffix($attachmentpath);  
         $msg->attach(Type     => $type,  
                      Path     => $attachmentpath,  
                      Filename => $fname  
                      );  
   
     } elsif ($attachment_text ne '') {  
         $msg->attach(Type => 'TEXT',  
                      Data => $attachment_text);  
     }      }
   
 ### Send it:  
     $msg->send('sendmail');  
   
     if ($attachmentpath =~ m|$Apache::lonnet::perlvar{'lonDaemons'}/tmp/helprequests/(\d+)/[^/]+|) {      if ($attachmentpath =~ m|$Apache::lonnet::perlvar{'lonDaemons'}/tmp/helprequests/(\d+)/[^/]+|) {
         unlink($attachmentpath);          unlink($attachmentpath);
     }      }
     $r->print('<b>'.$lt{'your'}.'</b>:<br /><br />'."\n");  
     $r->print('<div style="width:620px;">'.      $r->print('<div style="width:620px;">'.
               &Apache::lonhtmlcommon::start_pick_box().                &Apache::lonhtmlcommon::start_pick_box().
               &Apache::lonhtmlcommon::row_title($lt{'info'},undef,'LC_oddrow_value')."\n".$displaymsg."\n".                &Apache::lonhtmlcommon::row_title($lt{'info'},undef,'LC_oddrow_value')."\n".$displaymsg."\n".
Line 1125  END Line 1198  END
                        $var.'</span>:&nbsp;'.$ENV{$var}.', ';                         $var.'</span>:&nbsp;'.$ENV{$var}.', ';
         }          }
     }      }
       if ($ip ne '') {
           $envmsg .= '<span class="LC_helpform_receipt_cat">'.
                      'REMOTE_ADDR</span>:&nbsp;'.$ip.', ';
       }
     foreach my $var (@envvars) {      foreach my $var (@envvars) {
         if ($env{$var} ne '') {           if ($env{$var} ne '') { 
             $envmsg .= '<span class="LC_helpform_receipt_cat">'.              $envmsg .= '<span class="LC_helpform_receipt_cat">'.
Line 1135  END Line 1212  END
     $r->print($envmsg."\n".      $r->print($envmsg."\n".
               &Apache::lonhtmlcommon::row_closure(1)."\n".                &Apache::lonhtmlcommon::row_closure(1)."\n".
               &Apache::lonhtmlcommon::end_pick_box().                &Apache::lonhtmlcommon::end_pick_box().
               "</div>\n".                '</div>');
       unless ($bad_email) {
           $r->print('<p><br />'.&Apache::loncommon::confirmwrapper(&Apache::lonhtmlcommon::confirm_success($message)).'</p>');
       }
       $r->print("</div>\n".
               &Apache::loncommon::end_page());                &Apache::loncommon::end_page());
 }  }
   
Line 1143  sub print_header { Line 1224  sub print_header {
     my ($r,$origurl,$command) = @_;      my ($r,$origurl,$command) = @_;
     my $location=&Apache::loncommon::lonhttpdurl("/adm");      my $location=&Apache::loncommon::lonhttpdurl("/adm");
     my ($component_url);      my ($component_url);
     my $helpdesk_link = '<a href="javascript:validate()">';      my $helpicon_link = '<a href="javascript:validate();" tabindex="-1">';
       if ($command eq 'process') {
           $helpicon_link = '<a href="/adm/helpdesk" tabindex="-1">';
       }
       my $helpdesk_link = '<a href="javascript:validate();">';
     if ($command eq 'process') {      if ($command eq 'process') {
         $helpdesk_link = '<a href="/adm/helpdesk">';          $helpdesk_link = '<a href="/adm/helpdesk">';
     }      }
Line 1159  sub print_header { Line 1244  sub print_header {
                                          );                                           );
     my ($getstartlink,$reviewtext);      my ($getstartlink,$reviewtext);
     if (-e $Apache::lonnet::perlvar{'lonDocRoot'}.'/adm/gettingstarted.html') {      if (-e $Apache::lonnet::perlvar{'lonDocRoot'}.'/adm/gettingstarted.html') {
         $getstartlink = qq|<td align="center">&nbsp;<b><a href="/adm/gettingstarted.html">$lt{'getst'}</a></td>|;          $getstartlink = qq|<div class="LC_helpdesk_links LC_nobreak"><div class="LC_helpdesk_img" aria-hidden="true">&nbsp;</div><div class="LC_helpdesk_text"><a href="/adm/gettingstarted.html">$lt{'getst'}</a>&nbsp;</div></div>|;
         $reviewtext = &mt('Please review the information in "Log-in help" and the "Getting started" guide if you are unable to log-in.');          $reviewtext = &mt('Please review the information in "Log-in help" and the "Getting started" guide if you are unable to log-in.');
     } else {      } else {
         $reviewtext = &mt('Please review the information in "Log-in help" if you are unable to log-in.');          $reviewtext = &mt('Please review the information in "Log-in help" if you are unable to log-in.');
Line 1175  sub print_header { Line 1260  sub print_header {
         $loginhelp = '/adm/loginproblems.html';          $loginhelp = '/adm/loginproblems.html';
     }      }
     $r->print(<<"END");      $r->print(<<"END");
 <table width="620" border="0" cellspacing="0" cellpadding="0" style="height: 55px;">  <div class="LC_landmark" style="display: inline-block;" role="navigation">
  <tr>    <div class="LC_helpdesk_headbox">
    <td width="5" height="50">&nbsp;</td>      <h1 class="LC_helpdesk_legend">
    <td height="50">        <img src="$location/lonIcons/minilogo.gif" height="20" width="29" alt="LONCAPA logo" style="vertical-align: middle" />
     <fieldset>        LON-CAPA $lt{'headline'}
       <legend>      </h1>
         <img src="$location/lonIcons/minilogo.gif" height="20" width="29" alt="logo" style="vertical-align:bottom" />      <div style="border:0; padding:0; margin: 1em 0 0.5em;">
         LON-CAPA $lt{'headline'}        <div class="LC_helpdesk_links LC_nobreak"><div class="LC_helpdesk_img" aria-hidden="true">&nbsp;<a href="$loginhelp" tabindex="-1"><img src="$location/help/help.png" border="0" alt="($lt{'login'})" style="vertical-align:middle" />&nbsp;</a></div><div class="LC_helpdesk_text"><a href="$loginhelp">$lt{'login'}</a>&nbsp;</div></div>
       </legend>        <div class="LC_helpdesk_links LC_nobreak"><div class="LC_helpdesk_img" aria-hidden="true">&nbsp;$helpicon_link<img src="$location/lonIcons/helpdesk.gif" border="0" alt="($lt{'ask'})" style="vertical-align:top" />&nbsp;</a></div><div class="LC_helpdesk_text">$helpdesk_link$lt{'ask'}</a>&nbsp;</div></div>$getstartlink
  <table id="LC_helpmenu_links">        <div class="LC_helpdesk_links LC_nobreak"><div class="LC_helpdesk_img" aria-hidden="true">&nbsp;<a href="$linkback" target="_top" tabindex="-1"><img src="$location/lonIcons/move_up.gif" border="0" alt="($lt{'back'})" style="vertical-align:middle" />&nbsp;</a></div><div class="LC_helpdesk_text"><a href="$linkback" target="_top">$lt{'back'}</a>&nbsp;</div></div>
    <tr>      </div>
     <td align="center"><span class="LC_nobreak"><img src="$location/help/help.png" border="0" alt="($lt{'login'})" style="vertical-align:middle" />&nbsp;<b><a href="$loginhelp">$lt{'login'}</a></b>&nbsp;</span></td>    </div>
     <td align="center"><span class="LC_nobreak">&nbsp;<b>$helpdesk_link<img src="$location/lonIcons/helpdesk.gif" border="0" alt="($lt{'ask'})" style="vertical-align:middle" />&nbsp;$lt{'ask'}</a></b>&nbsp;</span></td>$getstartlink  </div>
     <td align="center"><span class="LC_nobreak">&nbsp;<b><a href="$linkback" target="_top"><img src="$location/lonIcons/move_up.gif" border="0" alt="($lt{'back'})" style="vertical-align:middle" />&nbsp;$lt{'back'}</a></b>&nbsp;</span></td>  
    </tr>  
  </table>  
 </fieldset>  
   </td>  
   <td width="5">&nbsp;</td>  
  </tr>  
  <tr>  
   <td colspan="3" height="5">&nbsp;</td>  
  </tr>  
 END  END
     if  ($command ne 'process') {      if  ($command ne 'process') {
         my $stuwarn = &mt('Do [_1]not[_2] use this form to ask about course content.',          my $stuwarn = &mt('Do [_1]not[_2] use this form to ask about course content.',
                           '<b>','</b>');                            '<b>','</b>');
         $r->print(<<"END");          $r->print(<<"END");
  <tr>   <div style="border:0; padding:0; margin: 0; max-width: 600px;" role="complementary">
   <td colspan="3">$reviewtext     $reviewtext
   $lt{'ifyo'}    $lt{'ifyo'}
 <p class="LC_info">    <p class="LC_info">
 <b>$lt{'stud'}:</b>       <b>$lt{'stud'}:</b> 
 $stuwarn $lt{'cont'}      $stuwarn $lt{'cont'}
 </p><br />    </p>
   </td>   </div>
  </tr>  
 END  END
     }      }
     $r->print('  
 </table>');  
     return;      return;
 }  }
   

Removed from v.1.79.2.3.2.1  
changed lines
  Added in v.1.108


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