[LON-CAPA-cvs] cvs: loncom /auth lonlogin.pm /interface lonsupportreq.pm

raeburn lon-capa-cvs@mail.lon-capa.org
Sat, 18 Dec 2004 23:58:34 -0000


This is a MIME encoded message

--raeburn1103414314
Content-Type: text/plain

raeburn		Sat Dec 18 18:58:34 2004 EDT

  Modified files:              
    /loncom/interface	lonsupportreq.pm 
    /loncom/auth	lonlogin.pm 
  Log:
  Add some links and preamble to display of support request form, when helpdesk is called from log-in page. Change default color. 
  
  
--raeburn1103414314
Content-Type: text/plain
Content-Disposition: attachment; filename="raeburn-20041218185834.txt"

Index: loncom/interface/lonsupportreq.pm
diff -u loncom/interface/lonsupportreq.pm:1.13 loncom/interface/lonsupportreq.pm:1.14
--- loncom/interface/lonsupportreq.pm:1.13	Sat Dec 18 17:30:28 2004
+++ loncom/interface/lonsupportreq.pm	Sat Dec 18 18:58:34 2004
@@ -39,7 +39,7 @@
     my $bodytag = &Apache::loncommon::bodytag('',$function,'topmargin="0",marginheight="0"',1);
     my $tablecolor = &Apache::loncommon::designparm($function.'.tabbg');
     if (($tablecolor eq '') || ($tablecolor eq '#FFFFFF')) {
-        $tablecolor = '#CCCCFF';
+        $tablecolor = '#EEEE99';
     }
     $ccode = '';
     $os = $ENV{'browser.os'};
@@ -148,7 +148,7 @@
             &javascript_code_selections($numtypes,\$jscript,\%idlist,\%idnums,\%idlist_titles,\@codetitles);
         }
     }
-    $r->print(<<END);
+    $r->print(<<ENDHEAD);
 <html>
 <head>
  <title>LON-CAPA support request</title>
@@ -158,6 +158,11 @@
 </script>
 </head>
 $bodytag
+ENDHEAD
+    if ($r->uri() eq '/adm/helpdesk') {
+        &print_header($r,$origurl);
+    }
+    $r->print(<<"END");
  <table width="580" border="0" cellpadding="0" cellspacing="0" bgcolor="#000000">
   <tr>
    <td>
@@ -289,7 +294,7 @@
              <table width="100%" border="0" cellpadding="8" cellspacing="0">
               <tr>
                <td>
-                http://$server$origurl<input type="hidden" name="origurl" value="http://$server$origurl" />
+                http://$server$origurl<input type="hidden" name="sourceurl" value="http://$server$origurl" />
                </td>
               </tr>
              </table>
@@ -560,6 +565,9 @@
    </td>
   </tr>
  </table>
+</form>
+</body>
+</html>
 END
     return;
 }
@@ -577,7 +585,7 @@
     my $fontcolor = &Apache::loncommon::designparm($function.'.font');
     my $vlinkcolor = &Apache::loncommon::designparm($function.'.vlink');
     my $tablecolor = &Apache::loncommon::designparm($function.'.tabbg');
-    my @formvars = ('username','email','uname','udom','origurl','phone','section','coursecode','title','subject','description','screenshot');
+    my @formvars = ('username','email','uname','udom','sourceurl','phone','section','coursecode','title','subject','description','screenshot');
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},\@formvars);
 
     my $supportmsg = qq|
@@ -588,7 +596,7 @@
 Course Information: $ENV{'form.title'} - $ENV{'form.coursecode'} - section: $ENV{'form.section'}
 Subject: $ENV{'form.subject'}
 Description: $ENV{'form.description'}
-URL: $ENV{'form.origurl'}
+URL: $ENV{'form.sourceurl'}
 Date/Time: $reporttime
 
     |;
@@ -602,37 +610,28 @@
 <font color="$fontcolor">Course Information: </font><font color="$vlinkcolor">$ENV{'form.title'} - $ENV{'form.coursecode'} - section: $ENV{'form.section'}</font><br />
 <font color="$fontcolor">Subject: </font><font color="$vlinkcolor">$ENV{'form.subject'}</font><br />
 <font color="$fontcolor">Description: </font><font color="$vlinkcolor">$descrip</font><br />
-<font color="$fontcolor">URL: </font><font color="$vlinkcolor">$ENV{'form.origurl'}</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 />
     |;
-
-    if ($to =~ m/^[^\@]+\@[^\@]+$/) {
-        $r->print(<<END);
+    $r->print(<<"END");
 <html>
 <head>
  <title>LON-CAPA support request recorded</title>
 </head>
 $bodytag
- <h3>A support request has been sent to $to</h3>
 END
+    if ($r->uri eq '/adm/helpdesk') {
+        &print_header($r,$url,'process');
+    }
+    if ($to =~ m/^[^\@]+\@[^\@]+$/) {
+        $r->print("<h3>A support request has been sent to $to</h3>");
     } else {
         $to = $admin;
         if ($to =~ m/^[^\@]+\@[^\@]+$/) {
-            $r->print(<<END);
-<html>
-<head>
- <title>LON-CAPA support request recorded</title>
-</head>
-$bodytag
- <h3>A support request has been sent to $to</h3>
+            $r->print("<h3>A support request has been sent to $to</h3>");
 END
         } else {
             $r->print(<<END);
-<html>
-<head>
- <title>LON-CAPA support request recorded</title>
-</head>
-$bodytag
  <h3>Warning: Problem with support e-mail address</h3>
 As the e-mail address provided for this LON-CAPA server ($to) does not appear to be a valid e-mail address, your support request has <b>not</b> been sent to the LON-CAPA support staff or administrator at your institution. Instead a copy has been sent to the LON-CAPA support team at Michigan State University. 
 END
@@ -784,9 +783,77 @@
    </td>
   </tr>
  </table>
+</body>
+</html>
     ");
 }
 
+sub print_header {
+    my ($r,$origurl,$action) = @_;
+    my $location=&Apache::loncommon::lonhttpdurl("/adm");
+    my $tablecolor = '#EEEE99';
+    my ($component_url);
+    my $helpdesk_link = '<a href="javascript:validate()">';
+    if ($action eq 'process') {
+        $helpdesk_link = '<a href="/adm/helpdesk">';
+    }
+    my %lt = &Apache::lonlocal::texthash (
+                                           login => 'Log-in help',
+                                           ask   => 'Ask helpdesk',
+                                           getst => 'Getting started guide',
+                                           back =>  'Back to last location'
+                                         );  
+    $r->print(<<END);
+<table width="620" border="0" cellspacing="0" cellpadding="0" height="55">   <tr height="50">    <td width='5'>&nbsp;</td>
+   <td>
+    <fieldset><legend><img src="$location/lonIcons/minilogo.gif" height='20' width='29' valign='bottom' />&nbsp;&nbsp;<b><font size="+1">LON-CAPA help/support</font></b></legend>
+ <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#000000">
+  <tr>
+   <td>
+    <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
+     <tr>
+      <td>
+       <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#ffffff">
+        <tr>
+         <td>
+          <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#ffffff">
+           <tr bgcolor="$tablecolor">
+            <td align="center"><img src="$location/help/gif/smallHelp.gif" border="0" alt="(Login help)" valign="middle" />&nbsp;<b><a href="/adm/loginproblems.html">$lt{'login'}</a></td>
+            <td align="center">&nbsp;<b>$helpdesk_link<img src="$location/lonIcons/helpdesk.gif" border="0" alt="(Ask helpdesk)" valign="middle" />&nbsp;$lt{'ask'}</a></b>&nbsp;</td>
+            <td align="center">&nbsp;<b><a href="/adm/gettingstarted.html">$lt{'getst'}</a></td>
+            <td align="center">&nbsp;<b><a href="$origurl" target="_top"><img src="$location/lonIcons/move_up.gif" border="0" alt="(Back to last location)" valign="middle" />&nbsp;$lt{'back'}</a></b>&nbsp;</td>
+           </tr>
+          </table>
+         </td>
+        </tr>
+       </table>
+      </td>
+     </tr>
+    </table>
+   </td>
+  </tr>
+ </table>
+</fieldset>
+  </td>
+  <td width='5'>&nbsp;</td>
+ </tr>
+ <tr height='5'>
+  <td colspan='3' height='5'>&nbsp;</td>
+ </tr>
+END
+    unless ($action eq 'process') {
+        $r->print('
+ <tr>
+  <td colspan="3">'.&mt('
+Please read the "Log-in help" and "Getting started guide" if you can not log-in').'.  '.&mt('If your problem is still unresolved, the form below can be used to send a question to the LON-CAPA helpdesk').'.<br /><font size="-1"><b>'.&mt('Note').':</b> '.&mt('Student questions about course content should be directed to the course instructor').'.</font><br /><br />
+  </td>
+ </tr>');
+    }
+    $r->print('
+</table>');
+    return;
+}
+
 sub retrieve_instcodes {
     my ($coursecodes,$codedom,$totcodes) = @_;
     my %courses = &Apache::lonnet::courseiddump($codedom,'.',1,'.','.');
Index: loncom/auth/lonlogin.pm
diff -u loncom/auth/lonlogin.pm:1.60 loncom/auth/lonlogin.pm:1.61
--- loncom/auth/lonlogin.pm:1.60	Thu Nov 11 17:18:23 2004
+++ loncom/auth/lonlogin.pm	Sat Dec 18 18:58:34 2004
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Login Screen
 #
-# $Id: lonlogin.pm,v 1.60 2004/11/11 22:18:23 raeburn Exp $
+# $Id: lonlogin.pm,v 1.61 2004/12/18 23:58:34 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -556,7 +556,7 @@
                          '<tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'.$servadm.'</tt><br />&nbsp;<br />';
     }
     if ($showhelpdesk) {
-        $contactblock .= '<b>&nbsp;&nbsp;&nbsp;<a href="/adm/helpdesk">'.$$lt{'helpdesk'}.'</a></b><br />';
+        $contactblock .= '<b>&nbsp;&nbsp;&nbsp;<a href="/adm/helpdesk?origurl='.&Apache::lonnet::escape('/adm/login').'">'.$$lt{'helpdesk'}.'</a></b><br />';
     }
     $contactblock .= <<"ENDBLOCK";
      &nbsp;&nbsp;&nbsp;$version

--raeburn1103414314--