version 1.61, 2006/05/12 05:12:27
|
version 1.65, 2006/06/16 19:54:02
|
Line 36 use Apache::lonlocal;
|
Line 36 use Apache::lonlocal;
|
use Apache::lonnet; |
use Apache::lonnet; |
use Apache::lonnavmaps(); |
use Apache::lonnavmaps(); |
use Date::Manip; |
use Date::Manip; |
|
use lib '/home/httpd/lib/perl/'; |
|
use LONCAPA; |
|
|
sub fail { |
sub fail { |
my ($r,$code)=@_; |
my ($r,$code)=@_; |
Line 383 sub remove_registration_confirmation {
|
Line 385 sub remove_registration_confirmation {
|
'no' => 'No',); |
'no' => 'No',); |
$r->print(<<"END_CONFIRM"); |
$r->print(<<"END_CONFIRM"); |
<p> $msg </p> |
<p> $msg </p> |
<form action="/adm/slotrequest" method="POST"> |
<form action="/adm/slotrequest" method="post"> |
<input type="hidden" name="command" value="release" /> |
<input type="hidden" name="command" value="release" /> |
<input type="hidden" name="button" value="yes" /> |
<input type="hidden" name="button" value="yes" /> |
$hidden_input |
$hidden_input |
<input type="submit" value="$lt{'yes'}" /> |
<input type="submit" value="$lt{'yes'}" /> |
</form> |
</form> |
<form action="/adm/slotrequest" method="POST"> |
<form action="/adm/slotrequest" method="post"> |
<input type="hidden" name="command" value="showslots" /> |
<input type="hidden" name="command" value="showslots" /> |
<input type="submit" value="$lt{'no'}" /> |
<input type="submit" value="$lt{'no'}" /> |
</form> |
</form> |
Line 569 sub get_slot {
|
Line 571 sub get_slot {
|
$r->print("<p>Already have a reservation: $description1</p>"); |
$r->print("<p>Already have a reservation: $description1</p>"); |
if ($slot_name ne $env{'form.slotname'}) { |
if ($slot_name ne $env{'form.slotname'}) { |
$r->print(<<STUFF); |
$r->print(<<STUFF); |
<form method="POST" action="/adm/slotrequest"> |
<form method="post" action="/adm/slotrequest"> |
<input type="hidden" name="symb" value="$env{'form.symb'}" /> |
<input type="hidden" name="symb" value="$env{'form.symb'}" /> |
<input type="hidden" name="slotname" value="$env{'form.slotname'}" /> |
<input type="hidden" name="slotname" value="$env{'form.slotname'}" /> |
<input type="hidden" name="releaseslot" value="$slot_name" /> |
<input type="hidden" name="releaseslot" value="$slot_name" /> |
Line 614 STUFF
|
Line 616 STUFF
|
$r->print(<<STUFF); |
$r->print(<<STUFF); |
<p> <font color="red">Failed</font> to reserve a spot for $description. </p> |
<p> <font color="red">Failed</font> to reserve a spot for $description. </p> |
<p> |
<p> |
<form method="POST" action="/adm/slotrequest"> |
<form method="post" action="/adm/slotrequest"> |
<input type="submit" name="Try Again" value="$lt{'try'}" /> |
<input type="submit" name="Try Again" value="$lt{'try'}" /> |
<input type="hidden" name="symb" value="$env{'form.symb'}" /> |
<input type="hidden" name="symb" value="$env{'form.symb'}" /> |
<input type="hidden" name="slotname" value="$env{'form.slotname'}" /> |
<input type="hidden" name="slotname" value="$env{'form.slotname'}" /> |
Line 624 STUFF
|
Line 626 STUFF
|
</p> |
</p> |
<p> |
<p> |
or |
or |
<form method="POST" action="/adm/slotrequest"> |
<form method="post" action="/adm/slotrequest"> |
<input type="hidden" name="symb" value="$env{'form.symb'}" /> |
<input type="hidden" name="symb" value="$env{'form.symb'}" /> |
<input type="submit" name="requestattempt" value="$lt{'request'}" /> |
<input type="submit" name="requestattempt" value="$lt{'request'}" /> |
</form> |
</form> |
Line 763 sub show_choices {
|
Line 765 sub show_choices {
|
$command='get'; |
$command='get'; |
} |
} |
} |
} |
my $escsymb=&Apache::lonnet::escape($symb); |
my $escsymb=&escape($symb); |
$form=<<STUFF; |
$form=<<STUFF; |
<form method="POST" action="/adm/slotrequest"> |
<form method="post" action="/adm/slotrequest"> |
<input type="submit" name="Select" value="$text" /> |
<input type="submit" name="Select" value="$text" /> |
<input type="hidden" name="symb" value="$escsymb" /> |
<input type="hidden" name="symb" value="$escsymb" /> |
<input type="hidden" name="slotname" value="$slot" /> |
<input type="hidden" name="slotname" value="$slot" /> |
Line 862 sub remove_link {
|
Line 864 sub remove_link {
|
undef($udom); |
undef($udom); |
} |
} |
|
|
$slotname = &Apache::lonnet::escape($slotname); |
$slotname = &escape($slotname); |
$entry = &Apache::lonnet::escape($entry); |
$entry = &escape($entry); |
$uname = &Apache::lonnet::escape($uname); |
$uname = &escape($uname); |
$udom = &Apache::lonnet::escape($udom); |
$udom = &escape($udom); |
$symb = &Apache::lonnet::escape($symb); |
$symb = &escape($symb); |
|
|
return <<"END_LINK"; |
return <<"END_LINK"; |
<a href="/adm/slotrequest?command=remove_registration&slotname=$slotname&entry=$entry&uname=$uname&udom=$udom&symb=$symb" |
<a href="/adm/slotrequest?command=remove_registration&slotname=$slotname&entry=$entry&uname=$uname&udom=$udom&symb=$symb" |
>($remove)</a> |
>($remove)</a> |
END_LINK |
END_LINK |
|
|
Line 886 sub show_table {
|
Line 888 sub show_table {
|
my $available; |
my $available; |
if ($mgr eq 'F') { |
if ($mgr eq 'F') { |
$r->print('<div>'); |
$r->print('<div>'); |
$r->print('<form method="POST" action="/adm/slotrequest"> |
$r->print('<form method="post" action="/adm/slotrequest"> |
<input type="hidden" name="command" value="uploadstart" /> |
<input type="hidden" name="command" value="uploadstart" /> |
<input type="submit" name="start" value="'.&mt('Upload Slot List').'" /> |
<input type="submit" name="start" value="'.&mt('Upload Slot List').'" /> |
</form>'); |
</form>'); |
$r->print('<form method="POST" action="/adm/helper/newslot.helper"> |
$r->print('<form method="post" action="/adm/helper/newslot.helper"> |
<input type="submit" name="newslot" value="'.&mt('Create a New Slot').'" /> |
<input type="submit" name="newslot" value="'.&mt('Create a New Slot').'" /> |
</form>'); |
</form>'); |
$r->print('</div>'); |
$r->print('</div>'); |
Line 977 sub show_table {
|
Line 979 sub show_table {
|
my $name_filter = {'type' => $name_filter_type, |
my $name_filter = {'type' => $name_filter_type, |
'value' => $env{'form.name_filter_value'},}; |
'value' => $env{'form.name_filter_value'},}; |
|
|
|
|
#deleted slot filtering |
#deleted slot filtering |
|
#default to hide if no value |
|
$env{'form.deleted'} ||= 'hide'; |
my $hide_radio = |
my $hide_radio = |
&Apache::lonhtmlcommon::radio('deleted',$env{'form.deleted'},'hide'); |
&Apache::lonhtmlcommon::radio('deleted',$env{'form.deleted'},'hide'); |
my $show_radio = |
my $show_radio = |
&Apache::lonhtmlcommon::radio('deleted',$env{'form.deleted'},'show'); |
&Apache::lonhtmlcommon::radio('deleted',$env{'form.deleted'},'show'); |
|
|
$r->print('<form method="POST" action="/adm/slotrequest"> |
$r->print('<form method="post" action="/adm/slotrequest"> |
<input type="hidden" name="command" value="showslots" />'); |
<input type="hidden" name="command" value="showslots" />'); |
$r->print('<div>'); |
$r->print('<div>'); |
$r->print('<table class="inline"> |
$r->print('<table class="inline"> |
Line 1026 sub show_table {
|
Line 1031 sub show_table {
|
$r->print('</div>'); |
$r->print('</div>'); |
$r->print('<p><input type="submit" name="start" value="'.&mt('Update Display').'" /></p>'); |
$r->print('<p><input type="submit" name="start" value="'.&mt('Update Display').'" /></p>'); |
my $linkstart='<a href="/adm/slotrequest?command=showslots&order='; |
my $linkstart='<a href="/adm/slotrequest?command=showslots&order='; |
$r->print('<table class="thinborder"> |
$r->print(&Apache::loncommon::start_data_table(). |
<tr> |
&Apache::loncommon::start_data_table_header_row().' |
<th></th>'); |
<th></th>'); |
foreach my $which (@show_order) { |
foreach my $which (@show_order) { |
if ($which ne 'proctor' && exists($show{$which})) { |
if ($which ne 'proctor' && exists($show{$which})) { |
$r->print('<th>'.$linkstart.$which.'">'.$show_fields{$which}.'</a></th>'); |
$r->print('<th>'.$linkstart.$which.'">'.$show_fields{$which}.'</a></th>'); |
} |
} |
} |
} |
|
$r->print(&Apache::loncommon::end_data_table_header_row()); |
|
|
my %name_cache; |
my %name_cache; |
my $slotsort = sub { |
my $slotsort = sub { |
Line 1106 sub show_table {
|
Line 1112 sub show_table {
|
|
|
my $unique; |
my $unique; |
if (ref($slots{$slot}{'uniqueperiod'})) { |
if (ref($slots{$slot}{'uniqueperiod'})) { |
$unique=localtime($slots{$slot}{'uniqueperiod'}[0]).','. |
$unique=localtime($slots{$slot}{'uniqueperiod'}[0]).', '. |
localtime($slots{$slot}{'uniqueperiod'}[1]); |
localtime($slots{$slot}{'uniqueperiod'}[1]); |
} |
} |
|
|
Line 1147 sub show_table {
|
Line 1153 sub show_table {
|
if (exists($show{'proctor'})) { |
if (exists($show{'proctor'})) { |
$rowspan=2; |
$rowspan=2; |
@proctors= map { |
@proctors= map { |
my ($uname,$udom)=split(/@/,$_); |
my ($uname,$udom)=split(/:/,$_); |
my $fullname=$name_cache{$_}; |
my $fullname=$name_cache{$_}; |
if (!defined($fullname)) { |
if (!defined($fullname)) { |
$fullname = &Apache::loncommon::plainname($uname,$udom); |
$fullname = &Apache::loncommon::plainname($uname,$udom); |
Line 1164 sub show_table {
|
Line 1170 sub show_table {
|
EDITLINK |
EDITLINK |
|
|
my $delete=(<<"DELETELINK"); |
my $delete=(<<"DELETELINK"); |
<a href="/adm/slotrequest?command=delete&slotname=$slot">Delete</a> |
<a href="/adm/slotrequest?command=delete&slotname=$slot">Delete</a> |
DELETELINK |
DELETELINK |
|
|
my $remove_all=&remove_link($slot,'remove all').'<br />'; |
my $remove_all=&remove_link($slot,'remove all').'<br />'; |
Line 1175 DELETELINK
|
Line 1181 DELETELINK
|
undef($remove_all); |
undef($remove_all); |
} |
} |
|
|
$r->print("<tr>\n<td rowspan=\"$rowspan\">$edit $delete</td>\n"); |
my $row_start=&Apache::loncommon::start_data_table_row(); |
|
my $row_end=&Apache::loncommon::end_data_table_row(); |
|
$r->print($row_start. |
|
"\n<td rowspan=\"$rowspan\">$edit $delete</td>\n"); |
if (exists($show{'name'})) { |
if (exists($show{'name'})) { |
$colspan++;$r->print("<td>$slot</td>"); |
$colspan++;$r->print("<td>$slot</td>"); |
} |
} |
Line 1212 DELETELINK
|
Line 1221 DELETELINK
|
if (exists($show{'allowedusers'})) { |
if (exists($show{'allowedusers'})) { |
$colspan++;$r->print("<td>$allowedusers</td>\n"); |
$colspan++;$r->print("<td>$allowedusers</td>\n"); |
} |
} |
|
if (exists($show{'uniqueperiod'})) { |
|
$colspan++;$r->print("<td>$unique</td>\n"); |
|
} |
if (exists($show{'scheduled'})) { |
if (exists($show{'scheduled'})) { |
$colspan++;$r->print("<td>$remove_all $ids</td>\n</tr>\n"); |
$colspan++;$r->print("<td>$remove_all $ids</td>\n"); |
} |
} |
|
$r->print("$row_end\n"); |
if (exists($show{'proctor'})) { |
if (exists($show{'proctor'})) { |
$r->print(<<STUFF); |
$r->print(<<STUFF); |
<tr> |
$row_start |
<td colspan="$colspan">$proctors</td> |
<td colspan="$colspan">$proctors</td> |
</tr> |
$row_end |
STUFF |
STUFF |
} |
} |
} |
} |
$r->print('</table>'); |
$r->print('</table></form>'); |
} |
} |
|
|
sub upload_start { |
sub upload_start { |
Line 1550 sub handler {
|
Line 1563 sub handler {
|
&csv_upload_map($r); |
&csv_upload_map($r); |
} |
} |
} else { |
} else { |
my $symb=&Apache::lonnet::unescape($env{'form.symb'}); |
my $symb=&unescape($env{'form.symb'}); |
if (!defined($symb)) { |
if (!defined($symb)) { |
&fail($r,'not_valid'); |
&fail($r,'not_valid'); |
return OK; |
return OK; |