version 1.122, 2015/05/10 03:58:12
|
version 1.127, 2015/09/25 02:03:29
|
Line 37 use Apache::lonnet;
|
Line 37 use Apache::lonnet;
|
use Apache::lonnavmaps(); |
use Apache::lonnavmaps(); |
use Date::Manip; |
use Date::Manip; |
use lib '/home/httpd/lib/perl/'; |
use lib '/home/httpd/lib/perl/'; |
use LONCAPA; |
use LONCAPA qw(:DEFAULT :match); |
|
|
sub fail { |
sub fail { |
my ($r,$code)=@_; |
my ($r,$code)=@_; |
Line 237 function uncheckSlotRadio() {
|
Line 237 function uncheckSlotRadio() {
|
if (document.getElementsByClassName) { |
if (document.getElementsByClassName) { |
slotpicks = document.getElementsByClassName('LC_slotpick_radio'); |
slotpicks = document.getElementsByClassName('LC_slotpick_radio'); |
} else { |
} else { |
sloctpicks = getElementsByClassName(document.body,'LC_slotpick_radio'); |
slotpicks = getElementsByClassName(document.body,'LC_slotpick_radio'); |
} |
} |
if (slotpicks.length) { |
if (slotpicks.length) { |
for (var i=0; i<slotpicks.length; i++) { |
for (var i=0; i<slotpicks.length; i++) { |
Line 245 function uncheckSlotRadio() {
|
Line 245 function uncheckSlotRadio() {
|
} |
} |
} |
} |
} |
} |
|
|
|
function toggleSlotMap(maprownum) { |
|
if (document.getElementById('arrow'+maprownum)) { |
|
var img = document.getElementById('arrow'+maprownum); |
|
var rowdisplay; |
|
var celldisplay = ''; |
|
if (img.src.indexOf('arrow.open.gif')!=-1) { |
|
img.src = '/adm/lonIcons/arrow.closed.gif'; |
|
rowdisplay = 'none'; |
|
} |
|
else { |
|
img.src = '/adm/lonIcons/arrow.open.gif'; |
|
rowdisplay = 'table-row'; |
|
celldisplay = 'none'; |
|
} |
|
var resrows; |
|
var maptext; |
|
if (document.getElementsByClassName) { |
|
resrows = document.getElementsByClassName('LC_slotmaprow_'+maprownum); |
|
maptext = document.getElementsByClassName('LC_slotmaptext_'+maprownum); |
|
} else { |
|
resrows = getElementsByClassName(document.body,'LC_slotmaprow_'+maprownum); |
|
maptext = getElementsByClassName(document.body,'LC_slotmaptext_'+maprownum); |
|
} |
|
if (resrows.length) { |
|
for (var i=0; i<resrows.length; i++) { |
|
resrows[i].style.display = rowdisplay; |
|
} |
|
} |
|
if (maptext.length) { |
|
for (var i=0; i<maptext.length; i++) { |
|
maptext[i].style.display = celldisplay; |
|
} |
|
} |
|
} |
|
} |
// ]]> |
// ]]> |
</script> |
</script> |
ENDSCRIPT |
ENDSCRIPT |
Line 689 sub release_reservation {
|
Line 725 sub release_reservation {
|
return (0,'error: Unable to determine current status'); |
return (0,'error: Unable to determine current status'); |
} |
} |
my $passed_resource = $navmap->getBySymb($symb); |
my $passed_resource = $navmap->getBySymb($symb); |
if ($passed_resource->is_map()) { |
if (ref($passed_resource)) { |
my ($a_resource) = |
if ($passed_resource->is_map()) { |
$navmap->retrieveResources($passed_resource, |
my ($a_resource) = |
sub {$_[0]->is_problem()},0,1); |
$navmap->retrieveResources($passed_resource, |
$symb = $a_resource->symb(); |
sub {$_[0]->is_problem()},0,1); |
|
$symb = $a_resource->symb(); |
|
} |
|
} else { |
|
unless ($mgr eq 'F') { |
|
return (0,'error: Unable to determine current status'); |
|
} |
} |
} |
|
|
# get parameter string, check for existance, rebuild string with the slot |
# get parameter string, check for existence, rebuild string with the slot |
my $student = &Apache::lonnet::EXT("resource.0.availablestudent", |
my $student = &Apache::lonnet::EXT("resource.0.availablestudent", |
$symb,$udom,$uname); |
$symb,$udom,$uname); |
my @slots = split(/:/,$student); |
my @slots = split(/:/,$student); |
Line 994 sub allowed_slot {
|
Line 1036 sub allowed_slot {
|
return 0 if (!$userallowed); |
return 0 if (!$userallowed); |
|
|
# not allowed for this resource |
# not allowed for this resource |
if (defined($slot->{'symb'}) |
if (defined($slot->{'symb'})) { |
&& $slot->{'symb'} ne $symb) { |
my $exclude = 1; |
unless ((ref($toskip) eq 'HASH') && ($toskip->{'symb'})) { |
my ($slotmap,$slotid,$sloturl) = &Apache::lonnet::decode_symb($slot->{'symb'}); |
return 0; |
if ($sloturl=~/\.(page|sequence)$/) { |
|
my ($map,$id,$url) = &Apache::lonnet::decode_symb($symb); |
|
if (($map ne '') && ($map eq $slotmap)) { |
|
$exclude = 0; |
|
} |
|
} elsif ($slot->{'symb'} eq $symb) { |
|
$exclude = 0; |
|
} |
|
if ($exclude) { |
|
unless ((ref($toskip) eq 'HASH') && ($toskip->{'symb'})) { |
|
return 0; |
|
} |
} |
} |
} |
} |
|
|
Line 1026 sub get_description {
|
Line 1079 sub get_description {
|
} |
} |
|
|
sub show_choices { |
sub show_choices { |
my ($r,$symb,$formname,$num,$slots,$consumed_uniqueperiods,$available,$got_slots)=@_; |
my ($symb,$formname,$num,$class,$slots,$consumed_uniqueperiods,$available,$got_slots)=@_; |
my $output; |
my $output; |
&Apache::lonxml::debug("Checking Slots"); |
&Apache::lonxml::debug("Checking Slots"); |
if (!ref($available) eq 'ARRAY') { |
if (!ref($available) eq 'ARRAY') { |
Line 1038 sub show_choices {
|
Line 1091 sub show_choices {
|
$output .= ' <a href="/adm/flip?postdata=return:">'. |
$output .= ' <a href="/adm/flip?postdata=return:">'. |
&mt('Return to last resource').'</a>'; |
&mt('Return to last resource').'</a>'; |
} |
} |
$r->print($output); |
if ($class) { |
return; |
return '<div class="'.$class.'">'.$output.'</div>'; |
|
} else { |
|
return $output; |
|
} |
} |
} |
if (@{$available} > 1) { |
if (@{$available} > 1) { |
my $numavailable = scalar(@{$available}); |
my $numavailable = scalar(@{$available}); |
Line 1187 STUFF
|
Line 1243 STUFF
|
if (@{$available} > 1) { |
if (@{$available} > 1) { |
$output .= '</div></fieldset>'; |
$output .= '</div></fieldset>'; |
} |
} |
$r->print($output); |
if ($class) { |
return; |
return '<div class="'.$class.'">'.$output.'</div>'; |
|
} else { |
|
return $output; |
|
} |
} |
} |
|
|
sub to_show { |
sub to_show { |
Line 1343 sub show_table {
|
Line 1402 sub show_table {
|
'secret' => 'Secret Word', |
'secret' => 'Secret Word', |
'space' => '# of students/max', |
'space' => '# of students/max', |
'ip' => 'IP or DNS restrictions', |
'ip' => 'IP or DNS restrictions', |
'symb' => 'Resource slot is restricted to.', |
'symb' => 'Resource/Map slot is restricted to.', |
'allowedsections' => 'Sections slot is restricted to.', |
'allowedsections' => 'Sections slot is restricted to.', |
'allowedusers' => 'Users slot is restricted to.', |
'allowedusers' => 'Users slot is restricted to.', |
'uniqueperiod' => 'Period of time slot is unique', |
'uniqueperiod' => 'Period of time slot is unique', |
Line 1752 sub manage_reservations {
|
Line 1811 sub manage_reservations {
|
'<table class="LC_data_table LC_tableOfContent">'."\n"; |
'<table class="LC_data_table LC_tableOfContent">'."\n"; |
my $shownheader = 0; |
my $shownheader = 0; |
my $it=$navmap->getIterator(undef,undef,undef,1,undef,undef); |
my $it=$navmap->getIterator(undef,undef,undef,1,undef,undef); |
|
my (@ordered,%output,$mapitem,$got_map_slot,$currmapoutput,$mapnum); |
|
$mapnum = 0; |
while (my $resource = $it->next()) { |
while (my $resource = $it->next()) { |
if ($resource == $it->BEGIN_MAP()) { |
if ($resource == $it->BEGIN_MAP()) { |
|
@ordered=(); |
|
undef(%output); |
|
$currmapoutput = ''; |
|
$got_map_slot = ''; |
|
$mapitem = ''; |
$depth++; |
$depth++; |
$parent{$depth} = $lastcontainer; |
$parent{$depth} = $lastcontainer; |
} |
} |
if ($resource == $it->END_MAP()) { |
if ($resource == $it->END_MAP()) { |
$depth--; |
$depth--; |
$lastcontainer = $parent{$depth}; |
$lastcontainer = $parent{$depth}; |
|
my %allstatuses; |
|
foreach my $symb (@ordered) { |
|
if (ref($output{$symb}) eq 'HASH') { |
|
if (($output{$symb}{'type'} eq 'map_map') || ($output{$symb}{'type'} eq 'map')) { |
|
if ($output{$symb}{'slotstatus'} ne '') { |
|
if (ref($allstatuses{$output{$symb}{'slotstatus'}}) eq 'ARRAY') { |
|
push(@{$allstatuses{$output{$symb}{'slotstatus'}}},$symb); |
|
} else { |
|
$allstatuses{$output{$symb}{'slotstatus'}} = [$symb]; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
if (keys(%allstatuses) == 1) { |
|
$got_map_slot = 1; |
|
my $repsymb; |
|
my @values = values(%allstatuses); |
|
if (ref($values[0]) eq 'ARRAY') { |
|
if (ref($output{$values[0][0]}) eq 'HASH') { |
|
$repsymb = $values[0][0]; |
|
} |
|
} |
|
if (($mapitem) && ($repsymb)) { |
|
my $formnum = $mapnum.'_'.$output{$repsymb}{'reservable'}; |
|
my $class = 'LC_slotmaptext_'.$mapnum; |
|
if ($output{$repsymb}{'hasaction'}) { |
|
$mapitem .= '<td valign="top"><span class="'.$class.'">'. |
|
$output{$repsymb}{'msg'}. |
|
'</span></td><td valign="top">'. |
|
&slot_chooser($repsymb,$class,$formnum,$allavailable,$slots, |
|
$consumed_uniqueperiods). |
|
'</td>'; |
|
|
|
} else { |
|
$mapitem .= '<td colspan="2" valign="middle"><span class="'.$class.'">'. |
|
$output{$repsymb}{'msg'}. |
|
'</span></td>'; |
|
} |
|
} |
|
foreach my $symb (@ordered) { |
|
if (ref($output{$symb}) eq 'HASH') { |
|
my $bgcolor = $backgrounds[$output{$symb}{'rownum'} % $numcolors]; |
|
$currmapoutput .= $output{$symb}{'header'}. |
|
'<tr class="'.$bgcolor.' LC_slotmaprow_'.$output{$symb}{'mapnum'}.'"'. |
|
' style="display:none">'.$output{$symb}{'info'}. |
|
$output{$symb}{'data'}.'</tr>'."\n"; |
|
} |
|
} |
|
} else { |
|
foreach my $symb (@ordered) { |
|
if (ref($output{$symb}) eq 'HASH') { |
|
my $bgcolor = $backgrounds[$output{$symb}{'rownum'} % $numcolors]; |
|
$currmapoutput .= $output{$symb}{'header'}. |
|
'<tr class="'.$bgcolor.' LC_slotmaprow_'.$output{$symb}{'mapnum'}.'"'. |
|
' style="display:table-row">'.$output{$symb}{'info'}. |
|
$output{$symb}{'data'}.'</tr>'."\n"; |
|
} |
|
} |
|
} |
|
if ($mapitem) { |
|
if ($got_map_slot) { |
|
$mapitem =~ s{(<img src=\"/adm/lonIcons/arrow\.)open(\.gif\")}{$1closed$2}; |
|
$mapitem .= '</tr>'."\n"; |
|
} else { |
|
$mapitem .= '<td colspan="2"> </td></tr>'."\n"; |
|
} |
|
} |
|
$r->print($mapitem.$currmapoutput); |
} |
} |
if (ref($resource)) { |
if (ref($resource)) { |
my $symb = $resource->symb(); |
my $symb = $resource->symb(); |
my $ressymb = $symb; |
|
$contents{$lastcontainer} ++; |
$contents{$lastcontainer} ++; |
next if (!$resource->is_problem() && !$resource->is_sequence() && |
next if (!$resource->is_problem() && !$resource->is_sequence() && |
!$resource->is_page()); |
!$resource->is_page()); |
Line 1776 sub manage_reservations {
|
Line 1910 sub manage_reservations {
|
if ($resource->is_problem()) { |
if ($resource->is_problem()) { |
my ($useslots) = $resource->slot_control(); |
my ($useslots) = $resource->slot_control(); |
next if (($useslots eq '') || ($useslots =~ /^\s*no\s*$/i)); |
next if (($useslots eq '') || ($useslots =~ /^\s*no\s*$/i)); |
|
push(@ordered,$symb); |
|
$output{$symb}{type} = $useslots; |
my ($msg,$get_choices,$slotdescription); |
my ($msg,$get_choices,$slotdescription); |
my $title = $resource->compTitle(); |
my $title = $resource->compTitle(); |
my $status = $resource->simpleStatus('0'); |
my $status = $resource->simpleStatus('0'); |
my ($slot_status,$date,$slot_name) = $resource->check_for_slot('0'); |
my ($slot_status,$date,$slot_name) = $resource->check_for_slot('0'); |
|
|
|
$output{$symb}{'slotstatus'} = $slot_status; |
|
$output{$symb}{'slotname'} = $slot_name; |
if ($slot_name ne '') { |
if ($slot_name ne '') { |
my %slot=&Apache::lonnet::get_slot($slot_name); |
my %slot=&Apache::lonnet::get_slot($slot_name); |
$slotdescription=&get_description($slot_name,\%slot); |
$slotdescription=&get_description($slot_name,\%slot); |
Line 1823 sub manage_reservations {
|
Line 1962 sub manage_reservations {
|
$msg = &Apache::lonnavmaps::getDescription($resource,'0'); |
$msg = &Apache::lonnavmaps::getDescription($resource,'0'); |
} |
} |
} |
} |
|
$output{$symb}{'msg'} = $msg; |
$reservable ++; |
$reservable ++; |
|
$output{$symb}{'reservable'} = $reservable; |
my $treelevel = $depth; |
my $treelevel = $depth; |
my $higherup = $lastcontainer; |
my $higherup = $lastcontainer; |
if ($depth > 1) { |
if ($depth > 1) { |
Line 1844 sub manage_reservations {
|
Line 1985 sub manage_reservations {
|
$treelevel --; |
$treelevel --; |
$higherup = $parent{$treelevel}; |
$higherup = $parent{$treelevel}; |
} |
} |
foreach my $item (@maprows) { |
for (my $i=0; $i<@maprows; $i++) { |
|
$mapnum ++; |
$rownum ++; |
$rownum ++; |
my $bgcolor = $backgrounds[$rownum % $numcolors]; |
my $bgcolor = $backgrounds[$rownum % $numcolors]; |
if (!$shownheader) { |
if (!$shownheader) { |
$r->print($slotheader); |
$mapitem .= $slotheader; |
$shownheader = 1; |
$shownheader = 1; |
} |
} |
$r->print('<tr class="'.$bgcolor.'">'.$item.'</tr>'."\n"); |
if (ref($maprows[$i]) eq 'ARRAY') { |
|
if ($i < scalar(@maprows)-1) { |
|
$mapitem .= '<tr class="'.$bgcolor.'"><td>'.join('',@{$maprows[$i]}).'</td>'. |
|
'<td colspan="2"> </td></tr>'."\n"; |
|
} else { |
|
$mapitem .= |
|
'<tr class="'.$bgcolor.'"><td>'.$maprows[$i][0]. |
|
'<img src="/adm/lonIcons/arrow.open.gif" id="arrow'.$mapnum.'" '. |
|
'alt="arrow" onmouseover="this.style.cursor=\'pointer\'" '. |
|
'onclick="'."toggleSlotMap('$mapnum');".'" />'. |
|
$maprows[$i][1].(' ' x6).'</td>'."\n"; |
|
} |
|
} |
} |
} |
|
$output{$symb}{'mapnum'} = $mapnum; |
} |
} |
$rownum ++; |
$rownum ++; |
my $bgcolor = $backgrounds[$rownum % $numcolors]; |
$output{$symb}{'rownum'} = $rownum; |
if (!$shownheader) { |
if (!$shownheader) { |
$r->print($slotheader); |
$output{$symb}{'header'} = $slotheader; |
$shownheader = 1; |
$shownheader = 1; |
} |
} |
$r->print('<tr class="'.$bgcolor.'"><td>'."\n"); |
$output{$symb}{'info'} = '<td>'; |
for (my $i=0; $i<$depth; $i++) { |
for (my $i=0; $i<$depth; $i++) { |
$r->print('<img src="'.$location.'" alt="" />'); |
$output{$symb}{'info'} .= '<img src="'.$location.'" alt="" />'; |
} |
} |
my $result = '<a href="'.$resource->src().'?symb='.$symb.'">'. |
$output{$symb}{'info'} .= '<a href="'.$resource->src().'?symb='.$symb.'">'. |
'<img class="LC_contentImage" src="/adm/lonIcons/'; |
'<img class="LC_contentImage" src="/adm/lonIcons/'; |
if ($resource->is_task()) { |
if ($resource->is_task()) { |
$result .= 'task.gif" alt="'.&mt('Task'); |
$output{$symb}{'info'} .= 'task.gif" alt="'.&mt('Task'); |
} else { |
} else { |
$result .= 'problem.gif" alt="'.&mt('Problem'); |
$output{$symb}{'info'} .= 'problem.gif" alt="'.&mt('Problem'); |
} |
} |
$result .= '" /><b>'.$title.'</b></a>'.(' ' x6).'</td>'; |
$output{$symb}{'info'} .= '" /><b>'.$title.'</b></a>'.(' ' x6).'</td>'; |
|
|
my $hasaction; |
my $hasaction; |
if ($status == $resource->OPEN) { |
if ($status == $resource->OPEN) { |
if ($get_choices) { |
if ($get_choices) { |
$hasaction = 1; |
$hasaction = 1; |
|
$output{$symb}{'hasaction'} = $hasaction; |
} |
} |
} |
} |
|
my $class = 'LC_slottext_'.$mapnum; |
if ($hasaction) { |
if ($hasaction) { |
$result .= '<td valign="top">'.$msg.'</td>'. |
$output{$symb}{'data'} = '<td valign="top"><span class="'.$class.'">'.$msg.'</span></td>'. |
'<td valign="top">'; |
'<td valign="top">'. |
|
&slot_chooser($symb,$class,$reservable,$allavailable,$slots, |
|
$consumed_uniqueperiods).'</td>'; |
} else { |
} else { |
$result .= '<td colspan="2" valign="middle">'.$msg.'</td>'; |
$output{$symb}{'data'} = '<td colspan="2" valign="middle">'. |
} |
'<span class="'.$class.'">'.$msg.'</span>'. |
$r->print($result); |
'</td>'; |
if ($hasaction) { |
|
my @got_slots=&check_for_reservation($symb,'allslots'); |
|
if ($got_slots[0] =~ /^error: /) { |
|
$r->print('<span class="LC_error">'. |
|
&mt('An error occurred determining slot availability.'). |
|
'</span>'); |
|
} else { |
|
my $formname = 'manageres_'.$reservable; |
|
if (ref($allavailable) eq 'ARRAY') { |
|
my @available; |
|
if (ref($slots) eq 'HASH') { |
|
foreach my $slot (@{$allavailable}) { |
|
# not allowed for this resource |
|
if (ref($slots->{$slot}) eq 'HASH') { |
|
if ((defined($slots->{$slot}->{'symb'})) && |
|
($slots->{$slot}->{'symb'} ne $symb)) { |
|
next; |
|
} |
|
} |
|
push(@available,$slot); |
|
} |
|
} |
|
&show_choices($r,$symb,$formname,$reservable,$slots,$consumed_uniqueperiods, |
|
\@available,\@got_slots); |
|
} |
|
} |
|
$r->print('</td>'); |
|
} |
} |
$r->print('</tr>'); |
|
} |
} |
} |
} |
} |
} |
Line 1935 sub manage_reservations {
|
Line 2067 sub manage_reservations {
|
|
|
sub show_map_row { |
sub show_map_row { |
my ($depth,$location,$type,$title,$maprows) = @_; |
my ($depth,$location,$type,$title,$maprows) = @_; |
my $output = '<td>'; |
my $spacers; |
for (my $i=0; $i<$depth-1; $i++) { |
for (my $i=0; $i<$depth-2; $i++) { |
$output .= '<img src="'.$location.'" alt="" />'; |
$spacers .= '<img src="'.$location.'" alt="" />'; |
} |
} |
|
my $icon; |
if ($type eq 'page') { |
if ($type eq 'page') { |
$output .= '<img src="/adm/lonIcons/navmap.page.open.gif" alt="" /> '."\n"; |
$icon = '<img src="/adm/lonIcons/navmap.page.open.gif" alt="" /> '."\n"; |
} else { |
} else { |
$output .= '<img src="/adm/lonIcons/navmap.folder.open.gif" alt="" /> '."\n"; |
$icon = '<img src="/adm/lonIcons/navmap.folder.open.gif" alt="" /> '."\n"; |
} |
} |
$output .= $title.'</td><td colspan="2"> </td>'."\n"; |
$icon .= $title; |
unshift (@{$maprows},$output); |
unshift (@{$maprows},[$spacers,$icon]); |
return; |
return; |
} |
} |
|
|
|
sub slot_chooser { |
|
my ($symb,$class,$formnum,$allavailable,$slots,$consumed_uniqueperiods) = @_; |
|
my $output; |
|
my @got_slots=&check_for_reservation($symb,'allslots'); |
|
if ($got_slots[0] =~ /^error: /) { |
|
$output = '<span class="'.$class.'"><span class="LC_error">'. |
|
&mt('An error occurred determining slot availability.'). |
|
'</span></span>'; |
|
} else { |
|
my $formname = 'manageres_'.$formnum; |
|
if (ref($allavailable) eq 'ARRAY') { |
|
my @available; |
|
if (ref($slots) eq 'HASH') { |
|
foreach my $slot (@{$allavailable}) { |
|
# not allowed for this resource |
|
if (ref($slots->{$slot}) eq 'HASH') { |
|
if ((defined($slots->{$slot}->{'symb'})) && |
|
($slots->{$slot}->{'symb'} ne $symb)) { |
|
next; |
|
} |
|
} |
|
push(@available,$slot); |
|
} |
|
} |
|
$output .= &show_choices($symb,$formname,$formnum,$class, |
|
$slots,$consumed_uniqueperiods, |
|
\@available,\@got_slots); |
|
} |
|
} |
|
return $output; |
|
} |
|
|
sub show_reservations { |
sub show_reservations { |
my ($r,$uname,$udom) = @_; |
my ($r,$uname,$udom) = @_; |
if (!defined($uname)) { |
if (!defined($uname)) { |
Line 2666 sub csvupload_fields {
|
Line 2831 sub csvupload_fields {
|
['proctor','List of proctor ids'], |
['proctor','List of proctor ids'], |
['description','Slot Description'], |
['description','Slot Description'], |
['maxspace','Maximum number of reservations'], |
['maxspace','Maximum number of reservations'], |
['symb','Resource Restriction'], |
['symb','Resource/Map Restriction'], |
['uniqueperiod','Date range of slot exclusion'], |
['uniqueperiod','Date range of slot exclusion'], |
['secret','Secret word proctor uses to validate'], |
['secret','Secret word proctor uses to validate'], |
['allowedsections','Sections slot is restricted to'], |
['allowedsections','Sections slot is restricted to'], |
Line 2773 sub csv_upload_assign {
|
Line 2938 sub csv_upload_assign {
|
$slot{$key}=$entries{$fields{$key}}; |
$slot{$key}=$entries{$fields{$key}}; |
} |
} |
} |
} |
|
if ($entries{$fields{'allowedusers'}}) { |
|
$entries{$fields{'allowedusers'}} =~ s/^\s+//; |
|
$entries{$fields{'allowedusers'}} =~ s/\s+$//; |
|
my @allowedusers; |
|
foreach my $poss (split(/\s*,\s*/,$entries{$fields{'allowedusers'}})) { |
|
my ($possuname,$possudom) = split(/:/,$poss); |
|
if (($possuname =~ /^$match_username$/) && ($possudom =~ /^$match_domain$/)) { |
|
unless (grep(/^\Q$poss\E$/,@allowedusers)) { |
|
push(@allowedusers,$poss); |
|
} |
|
} |
|
} |
|
if (@allowedusers > 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'}}) { |
if ($entries{$fields{'uniqueperiod'}}) { |
my ($start,$end)=split(',',$entries{$fields{'uniqueperiod'}}); |
my ($start,$end)=split(',',$entries{$fields{'uniqueperiod'}}); |
my @times=(&UnixDate($start,"%s"), |
my @times=(&UnixDate($start,"%s"), |
Line 2971 sub handler {
|
Line 3166 sub handler {
|
} |
} |
if ($env{'form.requestattempt'}) { |
if ($env{'form.requestattempt'}) { |
$r->print('<div class="LC_left_float">'); |
$r->print('<div class="LC_left_float">'); |
&show_choices($r,$symb,undef,undef,\%slots,$consumed_uniqueperiods,$available,$got_slots); |
$r->print(&show_choices($symb,undef,undef,undef,\%slots,$consumed_uniqueperiods,$available,$got_slots)); |
$r->print('</div><div style="padding:0;clear:both;margin:0;border:0"></div>'); |
$r->print('</div><div style="padding:0;clear:both;margin:0;border:0"></div>'); |
} elsif ($env{'form.command'} eq 'release') { |
} elsif ($env{'form.command'} eq 'release') { |
&release_slot($r,$symb); |
&release_slot($r,$symb); |