version 1.33, 2005/11/21 18:55:41
|
version 1.34, 2005/11/21 19:50:36
|
Line 316 sub release_slot {
|
Line 316 sub release_slot {
|
return 1; |
return 1; |
} |
} |
|
|
|
sub delete_slot { |
|
my ($r)=@_; |
|
|
|
my $slot_name = $env{'form.slotname'}; |
|
my %slot=&Apache::lonnet::get_slot($slot_name); |
|
|
|
my ($cnum,$cdom)=&get_course(); |
|
my %consumed=&Apache::lonnet::dump('slot_reservations',$cdom,$cnum, |
|
"^$slot_name\0"); |
|
|
|
if (%slot && !%consumed) { |
|
$slot{'type'} = 'deleted'; |
|
my $ret = &Apache::lonnet::cput('slots', {$slot_name => \%slot}, |
|
$cdom, $cnum); |
|
if ($ret eq 'ok') { |
|
$r->print("<p>Slot <tt>$slot_name</tt> marked as deleted.</p>"); |
|
} else { |
|
$r->print("<p> An error ($ret) occurse when attempting to delete Slot <tt>$slot_name</tt>.</p>"); |
|
} |
|
} else { |
|
if (%consumed) { |
|
$r->print("<p>Slot <tt>$slot_name</tt> has active reservations.</p>"); |
|
} else { |
|
$r->print("<p>Slot <tt>$slot_name</tt> does not exist.</p>"); |
|
} |
|
} |
|
$r->print('<p><a href="/adm/slotrequest?command=showslots">'. |
|
&mt('Return to slot list').'</a></p>'); |
|
$r->print('<p><a href="/adm/flip?postdata=return:">'. |
|
&mt('Return to last resource').'</a></p>'); |
|
} |
|
|
sub get_slot { |
sub get_slot { |
my ($r,$symb)=@_; |
my ($r,$symb)=@_; |
|
|
Line 718 sub show_table {
|
Line 750 sub show_table {
|
} |
} |
my $proctors=join(', ',@proctors); |
my $proctors=join(', ',@proctors); |
|
|
my $edit=(<<EDITLINK); |
my $edit=(<<"EDITLINK"); |
<a href="/adm/helper/newslot.helper?name=$slot">Edit</a> |
<a href="/adm/helper/newslot.helper?name=$slot">Edit</a> |
EDITLINK |
EDITLINK |
|
|
$r->print("<tr>\n<td rowspan=\"$rowspan\">$edit</td>\n"); |
my $delete=(<<"DELETELINK"); |
|
<a href="/adm/slotrequest?command=delete&slotname=$slot">Delete</a> |
|
DELETELINK |
|
if ($ids ne '') { undef($delete); } |
|
|
|
$r->print("<tr>\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 1040 sub handler {
|
Line 1077 sub handler {
|
&remove_registration($r); |
&remove_registration($r); |
} elsif ($env{'form.command'} eq 'release' && $mgr eq 'F') { |
} elsif ($env{'form.command'} eq 'release' && $mgr eq 'F') { |
&release_slot($r,undef,undef,undef,$mgr); |
&release_slot($r,undef,undef,undef,$mgr); |
|
} elsif ($env{'form.command'} eq 'delete' && $mgr eq 'F') { |
|
&delete_slot($r); |
} elsif ($env{'form.command'} eq 'uploadstart' && $mgr eq 'F') { |
} elsif ($env{'form.command'} eq 'uploadstart' && $mgr eq 'F') { |
&upload_start($r); |
&upload_start($r); |
} elsif ($env{'form.command'} eq 'csvuploadmap' && $mgr eq 'F') { |
} elsif ($env{'form.command'} eq 'csvuploadmap' && $mgr eq 'F') { |