Diff for /loncom/interface/lonsupportreq.pm between versions 1.30 and 1.35

version 1.30, 2006/03/15 19:41:26 version 1.35, 2006/05/30 12:46:09
Line 35  use Apache::Constants qw(:common); Line 35  use Apache::Constants qw(:common);
 use Apache::loncommon();  use Apache::loncommon();
 use Apache::lonnet;  use Apache::lonnet;
 use Apache::lonlocal;  use Apache::lonlocal;
   use Apache::lonacc();
   use lib '/home/httpd/lib/perl/';
   use LONCAPA;
    
   
 sub handler {  sub handler {
     my ($r) = @_;      my ($r) = @_;
Line 46  sub handler { Line 50  sub handler {
     }      }
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['origurl','function']);      &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['origurl','function']);
     if ($r->uri eq '/adm/helpdesk') {      if ($r->uri eq '/adm/helpdesk') {
         &Apache::loncommon::get_posted_cgi($r);          &Apache::lonacc::get_posted_cgi($r);
     }      }
     my $function = $env{'form.function'};      my $function = $env{'form.function'};
     my $origurl = &Apache::lonnet::unescape($env{'form.origurl'});      my $origurl = &unescape($env{'form.origurl'});
     my $action = $env{'form.action'};      my $action = $env{'form.action'};
   
     if ($action eq 'process') {      if ($action eq 'process') {
Line 63  sub handler { Line 67  sub handler {
 sub print_request_form {  sub print_request_form {
     my ($r,$origurl,$function) = @_;      my ($r,$origurl,$function) = @_;
     my ($os,$browser,$bversion,$uhost,$uname,$udom,$uhome,$urole,$usec,$email,$cid,$cdom,$cnum,$ctitle,$ccode,$sectionlist,$lastname,$firstname,$server,$formname);      my ($os,$browser,$bversion,$uhost,$uname,$udom,$uhome,$urole,$usec,$email,$cid,$cdom,$cnum,$ctitle,$ccode,$sectionlist,$lastname,$firstname,$server,$formname);
     my $bodytag = &Apache::loncommon::bodytag('',$function,'topmargin="0" marginheight="0" onLoad="initialize_codes()"',1);  
     my $tablecolor = &Apache::loncommon::designparm($function.'.tabbg');      my $tablecolor = &Apache::loncommon::designparm($function.'.tabbg');
     if (($tablecolor eq '') || ($tablecolor eq '#FFFFFF')) {      if (($tablecolor eq '') || ($tablecolor eq '#FFFFFF')) {
         $tablecolor = '#EEEE99';          $tablecolor = '#EEEE99';
Line 98  function validmail(field) { Line 101  function validmail(field) {
     var str = field.value;      var str = field.value;
     if (window.RegExp) {      if (window.RegExp) {
         var reg1str = "(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)";          var reg1str = "(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)";
         var reg2str = "^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$";          var reg2str = "^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$"; //"
         var reg1 = new RegExp(reg1str);          var reg1 = new RegExp(reg1str);
         var reg2 = new RegExp(reg2str);          var reg2 = new RegExp(reg2str);
         if (!reg1.test(str) && reg2.test(str)) {          if (!reg1.test(str) && reg2.test(str)) {
Line 115  function validmail(field) { Line 118  function validmail(field) {
     }      }
 }  }
 END  END
     #" stupid emacs  
     if ($cid =~ m/_/) {      if ($cid =~ m/_/) {
         ($cdom,$cnum) = split/_/,$cid;          ($cdom,$cnum) = split/_/,$cid;
     }      }
Line 196  function initialize_codes() { Line 199  function initialize_codes() {
         }          }
     }      }
   
     my $html=&Apache::lonxml::xmlbegin();      my $js = '<script type"text/javascript">'."\n$scripttag\n$jscript\n".
     my $head = &Apache::loncommon::headtag('LON-CAPA support request');   '</script>';
     my $end_head = &Apache::loncommon::endheadtag();      my %add_entries = (topmargin    => "0",
     $r->print(<<ENDHEAD);         marginheight => "0",
 $html         onLoad       =>"initialize_codes()",);
 $head  
 <script type"text/javascript">      my $start_page =
 $scripttag   &Apache::loncommon::start_page('Support Request',$js,
 $jscript         { 'function'    => $function,
 </script>   'add_entries' => \%add_entries,
 $end_head   'only_body'   => 1,});
 $bodytag      $r->print($start_page);
 ENDHEAD  
     if ($r->uri eq '/adm/helpdesk') {      if ($r->uri eq '/adm/helpdesk') {
         &print_header($r,$origurl);          &print_header($r,$origurl);
     }      }
Line 646  sub print_request_receipt { Line 649  sub print_request_receipt {
     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 = ('lonID');
   
     my $bodytag = &Apache::loncommon::bodytag('',$function,'topmargin="0" marginheight="0"',1);  
     my $admin = $Apache::lonnet::perlvar{'lonAdminMail'};      my $admin = $Apache::lonnet::perlvar{'lonAdminMail'};
     my $to =  $Apache::lonnet::perlvar{'lonSupportEMail'};      my $to =  $Apache::lonnet::perlvar{'lonSupportEMail'};
     my $from = $admin;      my $from = $admin;
Line 697  Date/Time: $reporttime Line 699  Date/Time: $reporttime
 <font color="$fontcolor">URL: </font><font color="$vlinkcolor">$env{'form.sourceurl'}</font><br />  <font color="$fontcolor">URL: </font><font color="$vlinkcolor">$env{'form.sourceurl'}</font><br />
 <font color="$fontcolor">Date/Time: </font><font color="$vlinkcolor">$reporttime</font><br />  <font color="$fontcolor">Date/Time: </font><font color="$vlinkcolor">$reporttime</font><br />
     |;      |;
     my $html=&Apache::lonxml::xmlbegin();  
     my $head = &Apache::loncommon::head('LON-CAPA support request recorded');      my $start_page = 
    &Apache::loncommon::start_page('Support request recorded',undef,
          {'function'    => $function,
    'add_entries' => {
       topmargin    => "0",
       marginheight => "0",
    },
    'only_body'   => 1,});
   
     $r->print(<<"END");      $r->print(<<"END");
 $html  $start_page
 $head  
 $bodytag  
 <form name="logproblem">  <form name="logproblem">
 <input type="hidden" name="action" value="result" />  <input type="hidden" name="action" value="result" />
 </form>  </form>
Line 971  sub retrieve_instcodes { Line 979  sub retrieve_instcodes {
     my %courses = &Apache::lonnet::courseiddump($codedom,'.',1,'.','.','.');      my %courses = &Apache::lonnet::courseiddump($codedom,'.',1,'.','.','.');
     foreach my $course (keys %courses) {      foreach my $course (keys %courses) {
         if ($courses{$course} =~ m/^[^:]*:([^:]+)/) {          if ($courses{$course} =~ m/^[^:]*:([^:]+)/) {
             $$coursecodes{$course} = &Apache::lonnet::unescape($1);              $$coursecodes{$course} = &unescape($1);
             $totcodes ++;              $totcodes ++;
         }          }
     }      }

Removed from v.1.30  
changed lines
  Added in v.1.35


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