--- loncom/interface/slotrequest.pm 2015/06/23 16:09:43 1.123 +++ loncom/interface/slotrequest.pm 2015/09/23 20:09:07 1.125 @@ -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.123 2015/06/23 16:09:43 raeburn Exp $ +# $Id: slotrequest.pm,v 1.125 2015/09/23 20:09:07 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -37,7 +37,7 @@ use Apache::lonnet; use Apache::lonnavmaps(); use Date::Manip; use lib '/home/httpd/lib/perl/'; -use LONCAPA; +use LONCAPA qw(:DEFAULT :match); sub fail { my ($r,$code)=@_; @@ -237,7 +237,7 @@ function uncheckSlotRadio() { if (document.getElementsByClassName) { slotpicks = document.getElementsByClassName('LC_slotpick_radio'); } else { - sloctpicks = getElementsByClassName(document.body,'LC_slotpick_radio'); + slotpicks = getElementsByClassName(document.body,'LC_slotpick_radio'); } if (slotpicks.length) { for (var i=0; i 0) { + $slot{'allowedusers'} = join(',',@allowedusers); + } + } + if ($entries{$fields{'allowedsections'}}) { + $entries{$fields{'allowedsections'}} =~ s/^\s+//; + $entries{$fields{'allowedsections'}} =~ s/\s+$//; + my @allowedsections; + foreach my $poss (split(/\s*,\s*/,$entries{$fields{'allowedsections'}})) { + if (($poss !~ /\W/) && ($poss ne 'none')) { + unless (grep(/^\Q$poss\E$/,@allowedsections)) { + push(@allowedsections,$poss); + } + } + } + if (@allowedsections > 0) { + $slot{'allowedsections'} = join(',',@allowedsections); + } + } if ($entries{$fields{'uniqueperiod'}}) { my ($start,$end)=split(',',$entries{$fields{'uniqueperiod'}}); my @times=(&UnixDate($start,"%s"),