[LON-CAPA-cvs] cvs: loncom(GCI_3) /interface lonsupportreq.pm
raeburn
raeburn@source.lon-capa.org
Mon, 29 Nov 2010 13:36:43 -0000
This is a MIME encoded message
--raeburn1291037803
Content-Type: text/plain
raeburn Mon Nov 29 13:36:43 2010 EDT
Modified files: (Branch: GCI_3)
/loncom/interface lonsupportreq.pm
Log:
- Customization for GCI_3
- Eliminating fields which are not needed in this context.
--raeburn1291037803
Content-Type: text/plain
Content-Disposition: attachment; filename="raeburn-20101129133643.txt"
Index: loncom/interface/lonsupportreq.pm
diff -u loncom/interface/lonsupportreq.pm:1.55 loncom/interface/lonsupportreq.pm:1.55.6.1
--- loncom/interface/lonsupportreq.pm:1.55 Thu Oct 22 13:41:41 2009
+++ loncom/interface/lonsupportreq.pm Mon Nov 29 13:36:43 2010
@@ -1,5 +1,5 @@
#
-# $Id: lonsupportreq.pm,v 1.55 2009/10/22 13:41:41 bisitz Exp $
+# $Id: lonsupportreq.pm,v 1.55.6.1 2010/11/29 13:36:43 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -301,7 +301,7 @@
$udomform .= &Apache::loncommon::select_dom_form($codedom,'udom');
}
if ($unameform eq '') {
- $unameform= '<i>'.$lt{'unme'}.'</i>: <input type="text" size="12" name="uname" value="'.$uname.'" /> ';
+ $unameform= '<i>'.$lt{'unme'}.'</i>: <input type="text" size="15" name="uname" value="'.$uname.'" /> ';
}
$output .= $unameform.$udomform;
}
@@ -311,115 +311,119 @@
$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();
- $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) {
- $output .= '<i>'.$item.'</i>: '.$codes{$cnum}{$item}.'; ';
+ if (&Apache::loncommon::check_for_gci_dc()) {
+ $output .= &Apache::lonhtmlcommon::row_title("$lt{'phon'}",undef,
+ 'LC_evenrow_value').
+ '<input type="text" size="15" name="phone" /><br />'.
+ &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) {
+ $output .= '<i>'.$item.'</i>: '.$codes{$cnum}{$item}.'; ';
+ }
+ $output .= ' <input type="hidden" name="coursecode" value="'.&HTML::Entities::encode($coursecodes{$cnum},'"<>&').'" />';
+ } else {
+ $output .= $lt{'enin'}.':
+ <input type="text" name="coursecode" size="15" value="" />';
}
- $output .= ' <input type="hidden" name="coursecode" value="'.&HTML::Entities::encode($coursecodes{$cnum},'"<>&').'" />';
} else {
- $output .= $lt{'enin'}.':
- <input type="text" name="coursecode" size="15" value="" />';
- }
- } else {
- if ($totcodes > 0) {
- my $numtitles = @codetitles;
- if ($numtitles == 0) {
- $output .= $lt{'enin'}.':
- <input type="text" name="coursecode" size="15" value="" />';
- } else {
- my $lasttitle = $numtitles;
- if ($numtitles > 4) {
- $lasttitle = 4;
- }
- $output .= '<table><tr><td>'.$codetitles[0].'<br />'."\n".
- '<select name="'.$codetitles[0].'" onchange="courseSet('."'$codetitles[0]'".')">'."\n".
- ' <option value="-1" />'.$lt{'sele'}."\n";
- my @items = ();
- my @longitems = ();
- if ($idlist{$codetitles[0]} =~ /","/) {
- @items = split(/","/,$idlist{$codetitles[0]});
+ if ($totcodes > 0) {
+ my $numtitles = @codetitles;
+ if ($numtitles == 0) {
+ $output .= $lt{'enin'}.':
+ <input type="text" name="coursecode" size="15" value="" />';
} else {
- $items[0] = $idlist{$codetitles[0]};
- }
- if (defined($idlist_titles{$codetitles[0]})) {
- if ($idlist_titles{$codetitles[0]} =~ /","/) {
- @longitems = split(/","/,$idlist_titles{$codetitles[0]});
+ my $lasttitle = $numtitles;
+ if ($numtitles > 4) {
+ $lasttitle = 4;
+ }
+ $output .= '<table><tr><td>'.$codetitles[0].'<br />'."\n".
+ '<select name="'.$codetitles[0].'" onchange="courseSet('."'$codetitles[0]'".')">'."\n".
+ ' <option value="-1" />'.$lt{'sele'}."\n";
+ my @items = ();
+ my @longitems = ();
+ if ($idlist{$codetitles[0]} =~ /","/) {
+ @items = split(/","/,$idlist{$codetitles[0]});
} else {
- $longitems[0] = $idlist_titles{$codetitles[0]};
+ $items[0] = $idlist{$codetitles[0]};
}
- for (my $i=0; $i<@longitems; $i++) {
- if ($longitems[$i] eq '') {
- $longitems[$i] = $items[$i];
+ if (defined($idlist_titles{$codetitles[0]})) {
+ if ($idlist_titles{$codetitles[0]} =~ /","/) {
+ @longitems = split(/","/,$idlist_titles{$codetitles[0]});
+ } else {
+ $longitems[0] = $idlist_titles{$codetitles[0]};
}
+ for (my $i=0; $i<@longitems; $i++) {
+ if ($longitems[$i] eq '') {
+ $longitems[$i] = $items[$i];
+ }
+ }
+ } else {
+ @longitems = @items;
+ }
+ for (my $i=0; $i<@items; $i++) {
+ $output .= ' <option value="'.$items[$i].'">'.$longitems[$i].'</option>'."\n";
+ }
+ $output .= '</select></td>';
+ for (my $i=1; $i<$numtitles; $i++) {
+ $output .= '<td>'.$codetitles[$i].'<br />'."\n".
+ '<select name="'.$codetitles[$i].'" onchange="courseSet('."'$codetitles[$i]'".')">'."\n".
+ '<option value="-1"><-'.$lt{'pick'}.' '.$codetitles[$i-1].'</option>'."\n".
+ '</select>'."\n".
+ '</td>'."\n";
+ }
+ $output .= '</tr></table>';
+ if ($numtitles > 4) {
+ $output .= '<br /><br />'.$codetitles[$numtitles].'<br />'."\n".
+ '<select name="'.$codetitles[$numtitles].'" onchange="courseSet('."'$codetitles[$numtitles]'".')">'."\n".
+ '<option value="-1"><-'.$lt{'pick'}.' '.$codetitles[$numtitles-1].'</option>'."\n".
+ '</select>'."\n";
}
- } else {
- @longitems = @items;
- }
- for (my $i=0; $i<@items; $i++) {
- $output .= ' <option value="'.$items[$i].'">'.$longitems[$i].'</option>'."\n";
- }
- $output .= '</select></td>';
- for (my $i=1; $i<$numtitles; $i++) {
- $output .= '<td>'.$codetitles[$i].'<br />'."\n".
- '<select name="'.$codetitles[$i].'" onchange="courseSet('."'$codetitles[$i]'".')">'."\n".
- '<option value="-1"><-'.$lt{'pick'}.' '.$codetitles[$i-1].'</option>'."\n".
- '</select>'."\n".
- '</td>'."\n";
- }
- $output .= '</tr></table>';
- if ($numtitles > 4) {
- $output .= '<br /><br />'.$codetitles[$numtitles].'<br />'."\n".
- '<select name="'.$codetitles[$numtitles].'" onchange="courseSet('."'$codetitles[$numtitles]'".')">'."\n".
- '<option value="-1"><-'.$lt{'pick'}.' '.$codetitles[$numtitles-1].'</option>'."\n".
- '</select>'."\n";
}
+ } else {
+ $output .= $lt{'enin'}.':
+ <input type="text" name="coursecode" size="15" value="" />';
}
+ }
+ $output .= '<br />';
+ if ($ctitle) {
+ $output .= '<i>'.$lt{'titl'}.'</i>: '.$ctitle.
+ '<input type="hidden" name="title" value="'.
+ &HTML::Entities::encode($ctitle,'"<>&').'" />'."\n";
} else {
- $output .= $lt{'enin'}.':
- <input type="text" name="coursecode" size="15" value="" />';
+ $output .= $lt{'enct'}.':
+ <input type="text" name="title" size="25" value="" />'."\n";
}
- }
- if ($ctitle) {
- $output .= '<br /><i>'.$lt{'titl'}.'</i>: '.$ctitle.
- '<input type="hidden" name="title" value="'.
- &HTML::Entities::encode($ctitle,'"<>&').'" />'."\n";
- } else {
- $output .= '<br />'.$lt{'enct'}.':
- <input type="text" name="title" size="25" value="" />'."\n";
- }
- $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";
- foreach my $id (sort(keys(%groupid))) {
- if ($id eq $groupid{$id} || $groupid{$id} eq '') {
- $output .= " <option value=".
- &HTML::Entities::encode($id,'"<>&').
- " >$id</option>\n";
- } else {
- $output .= " <option value=".
- &HTML::Entities::encode($id,'"<>&').
- " >$id - ($lt{'lsec'}: $groupid{$id})</option>\n";
+ $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";
+ foreach my $id (sort(keys(%groupid))) {
+ if ($id eq $groupid{$id} || $groupid{$id} eq '') {
+ $output .= " <option value=".
+ &HTML::Entities::encode($id,'"<>&').
+ " >$id</option>\n";
+ } else {
+ $output .= " <option value=".
+ &HTML::Entities::encode($id,'"<>&').
+ " >$id - ($lt{'lsec'}: $groupid{$id})</option>\n";
+ }
}
+ $output .= "</select>";
+ } else {
+ $output .= '<input type="text" name="section" size="10" />';
}
- $output .= "</select>";
- } else {
- $output .= '<input type="text" name="section" size="10" />';
+ $output .= &Apache::lonhtmlcommon::row_closure();
}
- $output .= &Apache::lonhtmlcommon::row_closure();
$num ++;
- $i = $num%2;
+ $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().
@@ -475,22 +479,27 @@
$defdom,$origmail);
my $from = $admin;
my $reporttime = &Apache::lonlocal::locallocaltime(time);
- my @formvars = ('username','email','uname','udom','sourceurl','phone','section','coursecode','title','subject','description','screenshot');
-
+ my @formvars = ('username','email','uname','udom','sourceurl');
+ if (&Apache::loncommon::check_for_gci_dc()) {
+ push(@formvars,('phone','section','coursecode','title'));
+ }
+ push(@formvars,('subject','description','screenshot'));
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},\@formvars);
my $coursecode = $env{'form.coursecode'};
- if ($coursecode eq '') {
- if (defined($env{'form.Year'})) {
- $coursecode .= $env{'form.Year'};
- }
- if (defined($env{'form.Semester'})) {
- $coursecode .= $env{'form.Semester'};
- }
- if (defined($env{'form.Department'})) {
- $coursecode .= $env{'form.Department'};
- }
- if (defined($env{'form.Number'})) {
- $coursecode .= $env{'form.Number'};
+ if (&Apache::loncommon::check_for_gci_dc()) {
+ if ($coursecode eq '') {
+ if (defined($env{'form.Year'})) {
+ $coursecode .= $env{'form.Year'};
+ }
+ if (defined($env{'form.Semester'})) {
+ $coursecode .= $env{'form.Semester'};
+ }
+ if (defined($env{'form.Department'})) {
+ $coursecode .= $env{'form.Department'};
+ }
+ if (defined($env{'form.Number'})) {
+ $coursecode .= $env{'form.Number'};
+ }
}
}
my %lt = &Apache::lonlocal::texthash (
@@ -547,14 +556,22 @@
}
}
$env{'form.user'} = "'".$env{'form.uname'}.':'.$env{'form.udom'}."'";
- $env{'form.csri'} = $env{'form.title'}.' - '.$coursecode.' - '.$lt{'sect'}.': '.$env{'form.section'};
+ if (&Apache::loncommon::check_for_gci_dc()) {
+ $env{'form.csri'} = $env{'form.title'}.' - '.$coursecode.' - '.$lt{'sect'}.': '.$env{'form.section'};
+ }
my $supportmsg = <<END;
$lt{'username'}: $env{'form.username'}
$lt{'email'}: $env{'form.email'}
$lt{'cc'}: $okcclist
$lt{'user'}: $env{'form.user'}
+END
+ if (&Apache::loncommon::check_for_gci_dc()) {
+ $supportmsg .= <<END
$lt{'phone'}: $env{'form.phone'}
$lt{'crsi'}: $env{'form.csri'}
+END
+ }
+ $supportmsg = <<END;
$lt{'subject'}: $env{'form.subject'}
$lt{'description'}: $env{'form.description'}
$lt{'sourceurl'}: $env{'form.sourceurl'}
@@ -562,7 +579,12 @@
END
my $displaymsg;
- foreach my $item ('username','email','cc','user','phone','crsi','subject','description','sourceurl') {
+ my @items = ('username','email','cc','user');
+ if (&Apache::loncommon::check_for_gci_dc()) {
+ push(@items,'phone','crsi');
+ }
+ push(@items,('subject','description','sourceurl'));
+ foreach my $item (@items) {
if ($env{'form.'.$item} ne '') {
if ($item eq 'description') {
my $descrip = $env{'form.description'};
--raeburn1291037803--