[LON-CAPA-cvs] cvs: loncom /html/adm/helper newslot.helper /interface slotrequest.pm
raeburn
raeburn at source.lon-capa.org
Sun Jun 24 00:11:12 EDT 2018
raeburn Sun Jun 24 04:11:12 2018 EDT
Modified files:
/loncom/interface slotrequest.pm
/loncom/html/adm/helper newslot.helper
Log:
- Bug 5915
Index: loncom/interface/slotrequest.pm
diff -u loncom/interface/slotrequest.pm:1.137 loncom/interface/slotrequest.pm:1.138
--- loncom/interface/slotrequest.pm:1.137 Wed Jan 31 15:28:47 2018
+++ loncom/interface/slotrequest.pm Sun Jun 24 04:11:08 2018
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Handler for requesting to have slots added to a students record
#
-# $Id: slotrequest.pm,v 1.137 2018/01/31 15:28:47 raeburn Exp $
+# $Id: slotrequest.pm,v 1.138 2018/06/24 04:11:08 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -938,9 +938,15 @@
if ($slot_name && $slot_name ne $conflictable_slot) {
my %slot=&Apache::lonnet::get_slot($slot_name);
my $description1=&get_description($slot_name,\%slot);
+ my $slottype1=$slot{'type'};
%slot=&Apache::lonnet::get_slot($env{'form.slotname'});
my $description2=&get_description($env{'form.slotname'},\%slot);
- if ($slot_name ne $env{'form.slotname'}) {
+ if ($slottype1 eq 'preassigned') {
+ $r->print('<p>'.&mt('You already have a reservation: "[_1]", assigned by your instructor.',
+ $description1).'</p>'.
+ '<p>'.&mt('Your instructor must unassign it before you can make a new reservation.').
+ '</p>');
+ } elsif ($slot_name ne $env{'form.slotname'}) {
$r->print(<<STUFF);
<form method="post" action="/adm/slotrequest">
<input type="hidden" name="symb" value="$env{'form.symb'}" />
Index: loncom/html/adm/helper/newslot.helper
diff -u loncom/html/adm/helper/newslot.helper:1.34 loncom/html/adm/helper/newslot.helper:1.35
--- loncom/html/adm/helper/newslot.helper:1.34 Fri Jan 20 06:23:37 2017
+++ loncom/html/adm/helper/newslot.helper Sun Jun 24 04:11:12 2018
@@ -208,11 +208,34 @@
delete($helper->{'VARS'}{'startreserve'});
delete($helper->{'VARS'}{'endreserve'});
delete($helper->{'VARS'}{'maxspace'});
- delete($helper->{'VARS'}{'startunique'});
- delete($helper->{'VARS'}{'endunique'});
</exec>
+ <message>
+ </p><p>Period of time when this slot can only be uniquely assigned:<br /> Start:
+ </message>
+ <date variable="startunique" hoursminutes="1" anytime="1">
+ <defaultvalue>
+ my $default=&{$helper->{DATA}{origslot}}('uniqueperiod','anytime');
+ if ($default eq 'anytime') { return 'anytime' };
+ if (ref($default)) { return $default->[0]; }
+ return 'anytime';
+ </defaultvalue>
+ </date>
+ <message><br /> End: </message>
+ <date variable="endunique" hoursminutes="1" anytime="1">
+ <defaultvalue>
+ my $default=&{$helper->{DATA}{origslot}}('uniqueperiod','anytime');
+ if ($default eq 'anytime') { return 'anytime' };
+ if (ref($default)) { return $default->[1]; }
+ return 'anytime';
+ </defaultvalue>
+ <validator>
+ if (defined($val) && $val < $helper->{'VARS'}{'startunique'}) {
+ return 'End time must be later than the start time.';
+ }
+ return undef;
+ </validator>
+ </date>
</condition>
-
<message>
</p><p>Proctored access:
</message>
More information about the LON-CAPA-cvs
mailing list