version 1.53, 2009/06/05 12:49:50
|
version 1.55.6.1, 2010/11/29 13:36:43
|
Line 301 function initialize_codes() {
|
Line 301 function initialize_codes() {
|
$udomform .= &Apache::loncommon::select_dom_form($codedom,'udom'); |
$udomform .= &Apache::loncommon::select_dom_form($codedom,'udom'); |
} |
} |
if ($unameform eq '') { |
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; |
$output .= $unameform.$udomform; |
} |
} |
Line 311 function initialize_codes() {
|
Line 311 function initialize_codes() {
|
$output .= &Apache::lonhtmlcommon::row_title("$lt{'urlp'}",undef,$css[$i]). |
$output .= &Apache::lonhtmlcommon::row_title("$lt{'urlp'}",undef,$css[$i]). |
$showserver.'<input type="hidden" name="sourceurl" value="'. |
$showserver.'<input type="hidden" name="sourceurl" value="'. |
&HTML::Entities::encode($server,'"<>&').'" />'. |
&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_closure(); |
$num ++; |
if (&Apache::loncommon::check_for_gci_dc()) { |
$i = $num%2; |
$output .= &Apache::lonhtmlcommon::row_title("$lt{'phon'}",undef, |
$output .= &Apache::lonhtmlcommon::row_title("$lt{'crsd'}$details_title",undef,$css[$i]); |
'LC_evenrow_value'). |
if ($cnum) { |
'<input type="text" size="15" name="phone" /><br />'. |
if ($coursecodes{$cnum}) { |
&Apache::lonhtmlcommon::row_closure(); |
foreach my $item (@codetitles) { |
$num ++; |
$output .= '<i>'.$item.'</i>: '.$codes{$cnum}{$item}.'; '; |
$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 { |
} else { |
$output .= $lt{'enin'}.': |
if ($totcodes > 0) { |
<input type="text" name="coursecode" size="15" value="" />'; |
my $numtitles = @codetitles; |
} |
if ($numtitles == 0) { |
} else { |
$output .= $lt{'enin'}.': |
if ($totcodes > 0) { |
<input type="text" name="coursecode" size="15" value="" />'; |
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]}); |
|
} else { |
} else { |
$items[0] = $idlist{$codetitles[0]}; |
my $lasttitle = $numtitles; |
} |
if ($numtitles > 4) { |
if (defined($idlist_titles{$codetitles[0]})) { |
$lasttitle = 4; |
if ($idlist_titles{$codetitles[0]} =~ /","/) { |
} |
@longitems = split(/","/,$idlist_titles{$codetitles[0]}); |
$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 { |
} else { |
$longitems[0] = $idlist_titles{$codetitles[0]}; |
$items[0] = $idlist{$codetitles[0]}; |
} |
} |
for (my $i=0; $i<@longitems; $i++) { |
if (defined($idlist_titles{$codetitles[0]})) { |
if ($longitems[$i] eq '') { |
if ($idlist_titles{$codetitles[0]} =~ /","/) { |
$longitems[$i] = $items[$i]; |
@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 { |
} else { |
$output .= $lt{'enin'}.': |
$output .= $lt{'enct'}.': |
<input type="text" name="coursecode" size="15" value="" />'; |
<input type="text" name="title" size="25" value="" />'."\n"; |
} |
} |
} |
$output .= &Apache::lonhtmlcommon::row_closure(); |
if ($ctitle) { |
$num ++; |
$output .= '<br /><i>'.$lt{'titl'}.'</i>: '.$ctitle. |
$i = $num%2; |
'<input type="hidden" name="title" value="'. |
$output .= &Apache::lonhtmlcommon::row_title($lt{'secn'},undef,$css[$i]); |
&HTML::Entities::encode($ctitle,'"<>&').'" />'."\n"; |
if ($sectionlist) { |
} else { |
$output .= "<select name=\"section\"\n>". |
$output .= '<br />'.$lt{'enct'}.': |
" <option value=\"\" selected=\"selected\">$lt{'sele'}</option>\n"; |
<input type="text" name="title" size="25" value="" />'."\n"; |
foreach my $id (sort(keys(%groupid))) { |
} |
if ($id eq $groupid{$id} || $groupid{$id} eq '') { |
$output .= &Apache::lonhtmlcommon::row_closure(); |
$output .= " <option value=". |
$num ++; |
&HTML::Entities::encode($id,'"<>&'). |
$i = $num%2; |
" >$id</option>\n"; |
$output .= &Apache::lonhtmlcommon::row_title($lt{'secn'},undef,$css[$i]); |
} else { |
if ($sectionlist) { |
$output .= " <option value=". |
$output .= "<select name=\"section\"\n>". |
&HTML::Entities::encode($id,'"<>&'). |
" <option value=\"\" selected=\"selected\">$lt{'sele'}</option>\n"; |
" >$id - ($lt{'lsec'}: $groupid{$id})</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>"; |
$output .= &Apache::lonhtmlcommon::row_closure(); |
} else { |
|
$output .= '<input type="text" name="section" size="10" />'; |
|
} |
} |
$output .= &Apache::lonhtmlcommon::row_closure(); |
|
$num ++; |
$num ++; |
$i = $num%2; |
$i = $num%2; |
$output .= &Apache::lonhtmlcommon::row_title($lt{'subj'},undef,'LC_oddrow_value'). |
$output .= &Apache::lonhtmlcommon::row_title($lt{'subj'},undef,'LC_oddrow_value'). |
' <input type="text" size="40" name="subject" />'."\n". |
' <input type="text" size="40" name="subject" />'."\n". |
&Apache::lonhtmlcommon::row_closure(). |
&Apache::lonhtmlcommon::row_closure(). |
Line 475 sub print_request_receipt {
|
Line 479 sub print_request_receipt {
|
$defdom,$origmail); |
$defdom,$origmail); |
my $from = $admin; |
my $from = $admin; |
my $reporttime = &Apache::lonlocal::locallocaltime(time); |
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); |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},\@formvars); |
my $coursecode = $env{'form.coursecode'}; |
my $coursecode = $env{'form.coursecode'}; |
if ($coursecode eq '') { |
if (&Apache::loncommon::check_for_gci_dc()) { |
if (defined($env{'form.Year'})) { |
if ($coursecode eq '') { |
$coursecode .= $env{'form.Year'}; |
if (defined($env{'form.Year'})) { |
} |
$coursecode .= $env{'form.Year'}; |
if (defined($env{'form.Semester'})) { |
} |
$coursecode .= $env{'form.Semester'}; |
if (defined($env{'form.Semester'})) { |
} |
$coursecode .= $env{'form.Semester'}; |
if (defined($env{'form.Department'})) { |
} |
$coursecode .= $env{'form.Department'}; |
if (defined($env{'form.Department'})) { |
} |
$coursecode .= $env{'form.Department'}; |
if (defined($env{'form.Number'})) { |
} |
$coursecode .= $env{'form.Number'}; |
if (defined($env{'form.Number'})) { |
|
$coursecode .= $env{'form.Number'}; |
|
} |
} |
} |
} |
} |
my %lt = &Apache::lonlocal::texthash ( |
my %lt = &Apache::lonlocal::texthash ( |
Line 547 sub print_request_receipt {
|
Line 556 sub print_request_receipt {
|
} |
} |
} |
} |
$env{'form.user'} = "'".$env{'form.uname'}.':'.$env{'form.udom'}."'"; |
$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; |
my $supportmsg = <<END; |
$lt{'username'}: $env{'form.username'} |
$lt{'username'}: $env{'form.username'} |
$lt{'email'}: $env{'form.email'} |
$lt{'email'}: $env{'form.email'} |
$lt{'cc'}: $okcclist |
$lt{'cc'}: $okcclist |
$lt{'user'}: $env{'form.user'} |
$lt{'user'}: $env{'form.user'} |
|
END |
|
if (&Apache::loncommon::check_for_gci_dc()) { |
|
$supportmsg .= <<END |
$lt{'phone'}: $env{'form.phone'} |
$lt{'phone'}: $env{'form.phone'} |
$lt{'crsi'}: $env{'form.csri'} |
$lt{'crsi'}: $env{'form.csri'} |
|
END |
|
} |
|
$supportmsg = <<END; |
$lt{'subject'}: $env{'form.subject'} |
$lt{'subject'}: $env{'form.subject'} |
$lt{'description'}: $env{'form.description'} |
$lt{'description'}: $env{'form.description'} |
$lt{'sourceurl'}: $env{'form.sourceurl'} |
$lt{'sourceurl'}: $env{'form.sourceurl'} |
Line 562 $lt{'date'}: $reporttime
|
Line 579 $lt{'date'}: $reporttime
|
|
|
END |
END |
my $displaymsg; |
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 ($env{'form.'.$item} ne '') { |
if ($item eq 'description') { |
if ($item eq 'description') { |
my $descrip = $env{'form.description'}; |
my $descrip = $env{'form.description'}; |
$descrip =~ s|\n|<br />|g; |
$descrip = &cleanup_html($descrip); |
|
$descrip =~ s|[\n\r\f]|<br />|g; |
$displaymsg .= |
$displaymsg .= |
'<span class="LC_helpform_receipt_cat">'. |
'<span class="LC_helpform_receipt_cat">'. |
"$lt{$item}</span>: $descrip<br />\n"; |
"$lt{$item}</span>: $descrip<br />\n"; |
} elsif ($item eq 'sourceurl') { |
} elsif ($item eq 'sourceurl') { |
my $showurl = $env{'form.sourceurl'}; |
my $showurl = $env{'form.sourceurl'}; |
$showurl =~ s/\?.*$//; |
$showurl =~ s/\?.*$//; |
|
$showurl = &cleanup_html($showurl); |
$displaymsg .= |
$displaymsg .= |
'<span class="LC_helpform_receipt_cat">'. |
'<span class="LC_helpform_receipt_cat">'. |
"$lt{$item}</span>: $showurl<br />\n"; |
"$lt{$item}</span>: $showurl<br />\n"; |
Line 581 END
|
Line 605 END
|
'<span class="LC_helpform_receipt_cat">'. |
'<span class="LC_helpform_receipt_cat">'. |
"$lt{$item}</span>: $okcclist<br />\n"; |
"$lt{$item}</span>: $okcclist<br />\n"; |
} else { |
} else { |
|
my $showitem = $env{'form.'.$item}; |
|
$showitem = &cleanup_html($showitem); |
$displaymsg .= |
$displaymsg .= |
'<span class="LC_helpform_receipt_cat">'. |
'<span class="LC_helpform_receipt_cat">'. |
"$lt{$item}</span>: $env{'form.'.$item}<br />\n"; |
"$lt{$item}</span>: $showitem<br />\n"; |
} |
} |
} |
} |
} |
} |
Line 746 END
|
Line 772 END
|
unlink($attachmentpath); |
unlink($attachmentpath); |
} |
} |
$r->print('<b>'.$lt{'your'}.'</b>:<br /><br />'."\n"); |
$r->print('<b>'.$lt{'your'}.'</b>:<br /><br />'."\n"); |
$r->print(&Apache::lonhtmlcommon::start_pick_box('LC_helpform_receipt'). |
$r->print('<div style="width:620px;">'. |
|
&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". |
&Apache::lonhtmlcommon::row_closure(). |
&Apache::lonhtmlcommon::row_closure(). |
&Apache::lonhtmlcommon::row_title($lt{'adin'},undef,'LC_evenrow_value')); |
&Apache::lonhtmlcommon::row_title($lt{'adin'},undef,'LC_evenrow_value')); |
Line 772 END
|
Line 799 END
|
$envmsg =~ s/, $//; |
$envmsg =~ s/, $//; |
$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()."\n". |
&Apache::lonhtmlcommon::end_pick_box(). |
|
"</div>\n". |
&Apache::loncommon::end_page()); |
&Apache::loncommon::end_page()); |
} |
} |
|
|
Line 846 sub get_domain {
|
Line 874 sub get_domain {
|
} elsif ($env{'request.role.domain'}) { |
} elsif ($env{'request.role.domain'}) { |
$codedom = $env{'request.role.domain'}; |
$codedom = $env{'request.role.domain'}; |
} else { |
} else { |
$codedom = $Apache::lonnet::perlvar{'lonDefDomain'}; |
$codedom = &Apache::lonnet::default_login_domain(); |
} |
} |
return $codedom; |
return $codedom; |
} |
} |
|
|
|
sub cleanup_html { |
|
my ($incoming) = @_; |
|
my $outgoing; |
|
if ($incoming ne '') { |
|
$outgoing = $incoming; |
|
$outgoing =~ s/\#/#/g; |
|
$outgoing =~ s/\&/&/g; |
|
$outgoing =~ s/</</g; |
|
$outgoing =~ s/>/>/g; |
|
$outgoing =~ s/\(/(/g; |
|
$outgoing =~ s/\)/)/g; |
|
$outgoing =~ s/"/"/g; |
|
$outgoing =~ s/'/'/g; |
|
$outgoing =~ s/\$/$/g; |
|
} |
|
return $outgoing; |
|
} |
|
|
1; |
1; |