version 1.85, 2008/12/21 04:14:39
|
version 1.88, 2009/02/02 18:20:15
|
Line 345 sub remove_registration {
|
Line 345 sub remove_registration {
|
return; |
return; |
} |
} |
if (!%consumed) { |
if (!%consumed) { |
$r->print("<p>".&mt('Slot <tt>[_1]</tt> has no reservations.', |
$r->print('<p>'.&mt('Slot [_1] has no reservations.', |
$slot_name)."</p>"); |
'<tt>'.$slot_name.'</tt>').'</p>'); |
return; |
return; |
} |
} |
|
|
Line 557 sub delete_slot {
|
Line 557 sub delete_slot {
|
my $ret = &Apache::lonnet::cput('slots', {$slot_name => \%slot}, |
my $ret = &Apache::lonnet::cput('slots', {$slot_name => \%slot}, |
$cdom, $cnum); |
$cdom, $cnum); |
if ($ret eq 'ok') { |
if ($ret eq 'ok') { |
$r->print("<p>Slot <tt>$slot_name</tt> marked as deleted.</p>"); |
$r->print('<p>'.&mt('Slot [_1] marked as deleted.','<tt>'.$slot_name.'</tt>').'</p>'); |
} else { |
} else { |
$r->print("<p><span class=\"LC_error\"> An error ($ret) occurse when attempting to delete Slot <tt>$slot_name</tt>.</span></p>"); |
$r->print('<p><span class="LC_error">'.&mt('An error occurred when attempting to delete slot: [_1]','<tt>'.$slot_name.'</tt>')." ($ret)</span></p>"); |
} |
} |
} else { |
} else { |
if (%consumed) { |
if (%consumed) { |
$r->print("<p>Slot <tt>$slot_name</tt> has active reservations.</p>"); |
$r->print('<p>'.&mt('Slot [_1] has active reservations.','<tt>'.$slot_name.'</tt>').'</p>'); |
} else { |
} else { |
$r->print("<p>Slot <tt>$slot_name</tt> does not exist.</p>"); |
$r->print('<p>'.&mt('Slot [_1] does not exist.','<tt>'.$slot_name.'</tt>').'</p>'); |
} |
} |
} |
} |
$r->print('<p><a href="/adm/slotrequest?command=showslots">'. |
$r->print('<p><a href="/adm/slotrequest?command=showslots">'. |
Line 597 sub get_slot {
|
Line 597 sub get_slot {
|
my $description1=&get_description($slot_name,\%slot); |
my $description1=&get_description($slot_name,\%slot); |
%slot=&Apache::lonnet::get_slot($env{'form.slotname'}); |
%slot=&Apache::lonnet::get_slot($env{'form.slotname'}); |
my $description2=&get_description($env{'form.slotname'},\%slot); |
my $description2=&get_description($env{'form.slotname'},\%slot); |
$r->print("<p>Already have a reservation: $description1</p>"); |
$r->print('<p>'.&mt('Already have a reservation: [_1].',$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"> |
Line 606 sub get_slot {
|
Line 606 sub get_slot {
|
<input type="hidden" name="releaseslot" value="$slot_name" /> |
<input type="hidden" name="releaseslot" value="$slot_name" /> |
<input type="hidden" name="command" value="change" /> |
<input type="hidden" name="command" value="change" /> |
STUFF |
STUFF |
$r->print("<p>You can either "); |
$r->print('<p>' |
$r->print(<<STUFF); |
.&mt('You can either [_1]Change[_2] your reservation from [_3] to [_4] or' |
<input type="submit" name="change" value="Change" /> |
,'<input type="submit" name="change" value="' |
STUFF |
,'" />' |
$r->print(' your reservation from <b>'.$description1.'</b> to <b>'. |
,'<b>'.$description1.'</b>' |
$description2. |
,'<b>'.$description2.'</b>') |
'</b> <br />or </p>'); |
.'<br /></p>' |
|
); |
&return_link($r); |
&return_link($r); |
$r->print(<<STUFF); |
$r->print(<<STUFF); |
</form> |
</form> |
Line 633 STUFF
|
Line 634 STUFF
|
.&mt('An error occurred while attempting to make a reservation. ([_1])',$1) |
.&mt('An error occurred while attempting to make a reservation. ([_1])',$1) |
.'</span></p>'); |
.'</span></p>'); |
} elsif ($reserved > -1) { |
} elsif ($reserved > -1) { |
$r->print("<p>Success: $description</p>"); |
$r->print('<p>'.&mt('Success: [_1]',$description).'</p>'); |
$retvalue = 1; |
$retvalue = 1; |
} elsif ($reserved < 0) { |
} elsif ($reserved < 0) { |
$r->print("<p>Already reserved: $description</p>"); |
$r->print('<p>'.&mt('Already reserved: [_1]',$description).'</p>'); |
} |
} |
if (!$inhibit_return_link) { &return_link($r); } |
if (!$inhibit_return_link) { &return_link($r); } |
return 1; |
return 1; |
} |
} |
|
|
my %lt=('request'=>"Availibility list", |
my %lt=('request'=>"Availibility list", |
'try' =>'Try again'); |
'try' =>'Try again?', |
|
'or' => 'or'); |
%lt=&Apache::lonlocal::texthash(%lt); |
%lt=&Apache::lonlocal::texthash(%lt); |
|
|
my $extra_input; |
my $extra_input; |
Line 651 STUFF
|
Line 653 STUFF
|
$extra_input='<input type="hidden" name="releaseslot" value="'.$env{'form.slotname'}.'" />'; |
$extra_input='<input type="hidden" name="releaseslot" value="'.$env{'form.slotname'}.'" />'; |
} |
} |
|
|
|
$r->print('<p>'.&mt('[_1]Failed[_2] to reserve a slot for [_3].','<span class="LC_warning">','</span>',$description).'</p>'); |
$r->print(<<STUFF); |
$r->print(<<STUFF); |
<p> <span class="LC_warning">Failed</span> 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'}" /> |
Line 661 STUFF
|
Line 663 STUFF
|
<input type="hidden" name="command" value="$env{'form.command'}" /> |
<input type="hidden" name="command" value="$env{'form.command'}" /> |
$extra_input |
$extra_input |
</form> |
</form> |
? |
|
</p> |
</p> |
<p> |
<p> |
or |
$lt{'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> |
</p> |
|
or |
|
STUFF |
STUFF |
|
|
if (!$inhibit_return_link) { &return_link($r); } |
if (!$inhibit_return_link) { |
|
$r->print(&mt('or').'</p>').&return_link($r); |
|
} else { |
|
$r->print('</p>'); |
|
} |
return 0; |
return 0; |
} |
} |
|
|
Line 756 sub allowed_slot {
|
Line 759 sub allowed_slot {
|
$consumed_uniqueperiods); |
$consumed_uniqueperiods); |
if ($conflict =~ /^error: /) { |
if ($conflict =~ /^error: /) { |
return 0; |
return 0; |
} else { |
} elsif ($conflict ne '') { |
if ($slots->{$conflict}{'starttime'} < time) { |
if ($slots->{$conflict}{'starttime'} < time) { |
return 0; |
return 0; |
} |
} |
Line 859 STUFF
|
Line 862 STUFF
|
} |
} |
|
|
if (!$available) { |
if (!$available) { |
$r->print('<tr><td>No available times. <a href="/adm/flip?postdata=return:">'. |
$r->print('<tr><td>'.&mt('No available times.'). |
|
' <a href="/adm/flip?postdata=return:">'. |
&mt('Return to last resource').'</a></td></tr>'); |
&mt('Return to last resource').'</a></td></tr>'); |
} |
} |
$r->print('</table>'); |
$r->print('</table>'); |
Line 1346 sub upload_start {
|
Line 1350 sub upload_start {
|
$result.=' <b>'. |
$result.=' <b>'. |
&mt('Specify a file containing the slot definitions.'). |
&mt('Specify a file containing the slot definitions.'). |
'</b></td></tr>'."\n"; |
'</b></td></tr>'."\n"; |
$result.='<tr bgcolor=#ffffe6><td>'."\n"; |
$result.='<tr bgcolor="#ffffe6"><td>'."\n"; |
my $upfile_select=&Apache::loncommon::upfile_select_html(); |
my $upfile_select=&Apache::loncommon::upfile_select_html(); |
my $ignore=&mt('Ignore First Line'); |
my $ignore=&mt('Ignore First Line'); |
$result.=<<ENDUPFORM; |
$result.=<<ENDUPFORM; |
Line 1401 ENDPICK
|
Line 1405 ENDPICK
|
|
|
sub csvuploadmap_footer { |
sub csvuploadmap_footer { |
my ($request,$i,$keyfields) =@_; |
my ($request,$i,$keyfields) =@_; |
|
my $buttontext = &mt('Create Slots'); |
$request->print(<<ENDPICK); |
$request->print(<<ENDPICK); |
</table> |
</table> |
<input type="hidden" name="nfields" value="$i" /> |
<input type="hidden" name="nfields" value="$i" /> |
<input type="hidden" name="keyfields" value="$keyfields" /> |
<input type="hidden" name="keyfields" value="$keyfields" /> |
<input type="button" onClick="javascript:verify(this.form)" value="Create Slots" /><br /> |
<input type="button" onClick="javascript:verify(this.form)" value="$buttontext" /><br /> |
</form> |
</form> |
ENDPICK |
ENDPICK |
} |
} |
Line 1522 sub csv_upload_assign {
|
Line 1527 sub csv_upload_assign {
|
my @slotdata = &Apache::loncommon::upfile_record_sep(); |
my @slotdata = &Apache::loncommon::upfile_record_sep(); |
if ($env{'form.noFirstLine'}) { shift(@slotdata); } |
if ($env{'form.noFirstLine'}) { shift(@slotdata); } |
my %fields=&Apache::grades::get_fields(); |
my %fields=&Apache::grades::get_fields(); |
$r->print('<h3>Creating Slots</h3>'); |
$r->print('<h3>'.&mt('Creating Slots').'</h3>'); |
my $cname=$env{'course.'.$env{'request.course.id'}.'.num'}; |
my $cname=$env{'course.'.$env{'request.course.id'}.'.num'}; |
my $cdom=$env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $cdom=$env{'course.'.$env{'request.course.id'}.'.domain'}; |
my $countdone=0; |
my $countdone=0; |
Line 1609 sub csv_upload_assign {
|
Line 1614 sub csv_upload_assign {
|
$r->rflush(); |
$r->rflush(); |
$countdone++; |
$countdone++; |
} |
} |
$r->print("<p>Created $countdone slots\n</p>"); |
$r->print('<p>'.&mt('Created [quant,_1,slot]',$countdone)."\n".'</p>'); |
foreach my $error (@errors) { |
foreach my $error (@errors) { |
$r->print("<p><span class=\"LC_warning\">$error</span></p>\n"); |
$r->print('<p><span class="LC_warning">'.$error.'</span></p>'."\n"); |
} |
} |
&show_table($r,$mgr); |
&show_table($r,$mgr); |
return ''; |
return ''; |
Line 1699 sub handler {
|
Line 1704 sub handler {
|
&release_slot($r,$symb,$env{'form.releaseslot'}); |
&release_slot($r,$symb,$env{'form.releaseslot'}); |
} |
} |
} else { |
} else { |
$r->print("<p>Unknown command: ".$env{'form.command'}."</p>"); |
$r->print('<p>'.&mt('Unknown command: [_1]',$env{'form.command'}).'</p>'); |
} |
} |
} |
} |
&end_page($r); |
&end_page($r); |