[LON-CAPA-cvs] cvs: loncom /interface lonsupportreq.pm
raeburn
lon-capa-cvs-allow@mail.lon-capa.org
Wed, 01 Oct 2008 17:47:10 -0000
raeburn Wed Oct 1 13:47:10 2008 EDT
Modified files:
/loncom/interface lonsupportreq.pm
Log:
- Alternation of css styles uses two-element @css.
- Cc field only available to logged-in users.
Index: loncom/interface/lonsupportreq.pm
diff -u loncom/interface/lonsupportreq.pm:1.49 loncom/interface/lonsupportreq.pm:1.50
--- loncom/interface/lonsupportreq.pm:1.49 Mon Jul 7 21:08:57 2008
+++ loncom/interface/lonsupportreq.pm Wed Oct 1 13:47:06 2008
@@ -1,5 +1,5 @@
#
-# $Id: lonsupportreq.pm,v 1.49 2008/07/08 01:08:57 raeburn Exp $
+# $Id: lonsupportreq.pm,v 1.50 2008/10/01 17:47:06 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -238,9 +238,12 @@
if ($r->uri eq '/adm/helpdesk') {
&print_header($r,$origurl);
}
+ my @css = ('LC_evenrow_value','LC_oddrow_value');
+ my $num = 1;
+ my $i = $num%2;
$r->print('<form method="post" name="logproblem" enctype="multipart/form-data">'."\n");
my $output = &Apache::lonhtmlcommon::start_pick_box().
- &Apache::lonhtmlcommon::row_title($lt{'name'},undef,'LC_oddrow_value')."\n";
+ &Apache::lonhtmlcommon::row_title($lt{'name'},undef,$css[$num])."\n";
my $fullname = '';
if ((defined($lastname) && $lastname ne '') && (defined($firstname) && $firstname ne '')) {
$fullname = "$firstname $lastname";
@@ -254,15 +257,23 @@
$output .= '<input type="text" size="20" name="username" value="'.&HTML::Entities::encode($fullname,'"<>&').'" />';
}
$output .= ' <input type="button" value="'.$lt{'subm'}.'" onclick="validate()" /> '.
- &Apache::lonhtmlcommon::row_closure()."\n".
- &Apache::lonhtmlcommon::row_title($lt{'emad'},undef,'LC_evenrow_value').
- '<input type="text" size="20" name="email" value="'.
- &HTML::Entities::encode($email,'"<>&').'" /><br />'."\n".
- &Apache::lonhtmlcommon::row_closure().
- &Apache::lonhtmlcommon::row_title($lt{'emac'},undef,'LC_oddrow_value').
- '<input type="text" size="50" name="cc" value="" /><br />'."\n".
- &Apache::lonhtmlcommon::row_closure().
- &Apache::lonhtmlcommon::row_title("$lt{'unme'}/$lt{'doma'}",undef,'LC_evenrow_value');
+ &Apache::lonhtmlcommon::row_closure()."\n";
+ $num ++;
+ $i = $num%2;
+ $output .= &Apache::lonhtmlcommon::row_title($lt{'emad'},undef,$css[$i]).
+ '<input type="text" size="20" name="email" value="'.
+ &HTML::Entities::encode($email,'"<>&').'" /><br />'."\n".
+ &Apache::lonhtmlcommon::row_closure();
+ $num ++;
+ $i = $num%2;
+ if (defined($env{'user.name'})) {
+ $output .= &Apache::lonhtmlcommon::row_title($lt{'emac'},undef,$css[$i]).
+ '<input type="text" size="50" name="cc" value="" /><br />'."\n".
+ &Apache::lonhtmlcommon::row_closure();
+ $num ++;
+ $i = $num%2;
+ }
+ $output .= &Apache::lonhtmlcommon::row_title("$lt{'unme'}/$lt{'doma'}",undef,$css[$i]);
my $udom_input = '<input type="hidden" name="udom" value="'.
&HTML::Entities::encode($udom,'"<>&').'" />';
my $uname_input = '<input type="hidden" name="uname" value="'.
@@ -294,15 +305,19 @@
}
$output .= $unameform.$udomform;
}
- $output .= &Apache::lonhtmlcommon::row_closure().
- &Apache::lonhtmlcommon::row_title("$lt{'urlp'}",undef,'LC_oddrow_value').
+ $output .= &Apache::lonhtmlcommon::row_closure();
+ $num ++;
+ $i = $num%2;
+ $output .= &Apache::lonhtmlcommon::row_title("$lt{'urlp'}",undef,$css[$i]).
$showserver.'<input type="hidden" name="sourceurl" value="'.
&HTML::Entities::encode($server,'"<>&').'" />'.
&Apache::lonhtmlcommon::row_closure().
&Apache::lonhtmlcommon::row_title("$lt{'phon'}",undef,'LC_evenrow_value').
'<input type="text" size="15" name="phone" /><br />'.
- &Apache::lonhtmlcommon::row_closure().
- &Apache::lonhtmlcommon::row_title("$lt{'crsd'}$details_title",undef,'LC_oddrow_value');
+ &Apache::lonhtmlcommon::row_closure();
+ $num ++;
+ $i = $num%2;
+ $output .= &Apache::lonhtmlcommon::row_title("$lt{'crsd'}$details_title",undef,$css[$i]);
if ($cnum) {
if ($coursecodes{$cnum}) {
foreach my $item (@codetitles) {
@@ -380,8 +395,10 @@
$output .= '<br />'.$lt{'enct'}.':
<input type="text" name="title" size="25" value="" />'."\n";
}
- $output .= &Apache::lonhtmlcommon::row_closure().
- &Apache::lonhtmlcommon::row_title($lt{'secn'},undef,'LC_evenrow_value');
+ $output .= &Apache::lonhtmlcommon::row_closure();
+ $num ++;
+ $i = $num%2;
+ $output .= &Apache::lonhtmlcommon::row_title($lt{'secn'},undef,$css[$i]);
if ($sectionlist) {
$output .= "<select name=\"section\"\n>".
" <option value=\"\" selected=\"selected\">$lt{'sele'}</option>\n";
@@ -400,21 +417,25 @@
} else {
$output .= '<input type="text" name="section" size="10" />';
}
- $output .= &Apache::lonhtmlcommon::row_closure().
- &Apache::lonhtmlcommon::row_title($lt{'subj'},undef,'LC_oddrow_value').
+ $output .= &Apache::lonhtmlcommon::row_closure();
+ $num ++;
+ $i = $num%2;
+ $output .= &Apache::lonhtmlcommon::row_title($lt{'subj'},undef,'LC_oddrow_value').
' <input type="text" size="40" name="subject" />'."\n".
&Apache::lonhtmlcommon::row_closure().
&Apache::lonhtmlcommon::row_title($lt{'detd'},undef,'LC_evenrow_value').
' <textarea rows="10" cols="45" name="description" wrap="virtual"></textarea>'.
&Apache::lonhtmlcommon::row_closure();
- my $lastrow = 'LC_evenrow_value';
+ $num ++;
+ $i = $num%2;
if (defined($env{'user.name'})) {
- $output .= &Apache::lonhtmlcommon::row_title($lt{'opfi'},undef,'LC_oddrow_value').
+ $output .= &Apache::lonhtmlcommon::row_title($lt{'opfi'},undef,$css[$i]).
' <input type="file" name="screenshot" size="20" /><br />'.$lt{'uplf'}."\n".
&Apache::lonhtmlcommon::row_closure();
- $lastrow = 'LC_oddrow_value';
+ $num ++;
+ $i = $num%2;
}
- $output .= &Apache::lonhtmlcommon::row_title($lt{'fini'},undef,$lastrow);
+ $output .= &Apache::lonhtmlcommon::row_title($lt{'fini'},undef,$css[$i]);
$output .= <<END;
<table border="0" cellpadding="8" cellspacing="0">
<tr>
@@ -493,7 +514,7 @@
);
my (@ok_ccs,@bad_ccs,$badccmsg,$okcclist);
- if (defined($env{'form.cc'})) {
+ if ((defined($env{'user.name'})) && (defined($env{'form.cc'}))) {
my @ccs;
if ($env{'form.cc'} =~ /,/) {
@ccs = split(/,/,$env{'form.cc'});