version 1.132, 2016/05/21 21:13:58
|
version 1.136, 2017/12/22 02:00:46
|
Line 465 sub get_consumed_uniqueperiods {
|
Line 465 sub get_consumed_uniqueperiods {
|
return 'error: Unable to determine current status'; |
return 'error: Unable to determine current status'; |
} |
} |
my @problems = $navmap->retrieveResources(undef, |
my @problems = $navmap->retrieveResources(undef, |
sub { $_[0]->is_problem() },1,0); |
sub { $_[0]->is_gradable() },1,0); |
my %used_slots; |
my %used_slots; |
foreach my $problem (@problems) { |
foreach my $problem (@problems) { |
my $symb = $problem->symb(); |
my $symb = $problem->symb(); |
Line 805 sub release_reservation {
|
Line 805 sub release_reservation {
|
if ($passed_resource->is_map()) { |
if ($passed_resource->is_map()) { |
my ($a_resource) = |
my ($a_resource) = |
$navmap->retrieveResources($passed_resource, |
$navmap->retrieveResources($passed_resource, |
sub {$_[0]->is_problem()},0,1); |
sub {$_[0]->is_gradable()},0,1); |
$symb = $a_resource->symb(); |
$symb = $a_resource->symb(); |
} |
} |
} else { |
} else { |
Line 1602 sub show_table {
|
Line 1602 sub show_table {
|
$r->print('</div>'); |
$r->print('</div>'); |
$r->print('<p><input type="submit" name="start" value="'.&mt('Update Display').'" /></p>'); |
$r->print('<p><input type="submit" name="start" value="'.&mt('Update Display').'" /></p>'); |
my $linkstart='<a href="/adm/slotrequest?command=showslots&order='; |
my $linkstart='<a href="/adm/slotrequest?command=showslots&order='; |
$r->print(&Apache::loncommon::start_data_table(). |
my $tableheader = &Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table_header_row().' |
&Apache::loncommon::start_data_table_header_row().' |
<th></th>'); |
<th></th>'; |
foreach my $which (@show_order) { |
foreach my $which (@show_order) { |
if ($which ne 'proctor' && exists($show{$which})) { |
if ($which ne 'proctor' && exists($show{$which})) { |
$r->print('<th>'.$linkstart.$which.'">'.$show_fields{$which}.'</a></th>'); |
$tableheader .= '<th>'.$linkstart.$which.'">'.$show_fields{$which}.'</a></th>'; |
} |
} |
} |
} |
$r->print(&Apache::loncommon::end_data_table_header_row()); |
$tableheader .= &Apache::loncommon::end_data_table_header_row(); |
|
my $shownheader = 0; |
|
|
my %name_cache; |
my %name_cache; |
my $slotsort = sub { |
my $slotsort = sub { |
Line 1767 sub show_table {
|
Line 1768 sub show_table {
|
delete => 'Delete', |
delete => 'Delete', |
slotlog => 'History', |
slotlog => 'History', |
); |
); |
my $edit=(<<"EDITLINK"); |
my ($edit,$delete,$showlog,$remove_all); |
|
if ($mgr) { |
|
$edit=(<<"EDITLINK"); |
<a href="/adm/helper/newslot.helper?name=$slot">$lt{'edit'}</a> |
<a href="/adm/helper/newslot.helper?name=$slot">$lt{'edit'}</a> |
EDITLINK |
EDITLINK |
|
|
my $delete=(<<"DELETELINK"); |
$delete=(<<"DELETELINK"); |
<a href="/adm/slotrequest?command=delete&slotname=$slot">$lt{'delete'}</a> |
<a href="/adm/slotrequest?command=delete&slotname=$slot">$lt{'delete'}</a> |
DELETELINK |
DELETELINK |
|
|
my $showlog=(<<"LOGLINK"); |
$remove_all=&remove_link($slot,'remove all').'<br />'; |
|
|
|
if ($ids eq '') { |
|
undef($remove_all); |
|
} else { |
|
undef($delete); |
|
} |
|
} |
|
|
|
$showlog=(<<"LOGLINK"); |
<a href="/adm/slotrequest?command=slotlog&slotname=$slot">$lt{'slotlog'}</a> |
<a href="/adm/slotrequest?command=slotlog&slotname=$slot">$lt{'slotlog'}</a> |
LOGLINK |
LOGLINK |
|
|
my $remove_all=&remove_link($slot,'remove all').'<br />'; |
|
|
|
if ($ids eq '') { |
|
undef($remove_all); |
|
} else { |
|
undef($delete); |
|
} |
|
if ($slots{$slot}{'type'} ne 'schedulable_student') { |
if ($slots{$slot}{'type'} ne 'schedulable_student') { |
undef($showlog); |
undef($showlog); |
undef($remove_all); |
undef($remove_all); |
} |
} |
|
|
|
unless ($shownheader) { |
|
$r->print($tableheader); |
|
$shownheader = 1; |
|
} |
|
|
my $row_start=&Apache::loncommon::start_data_table_row(); |
my $row_start=&Apache::loncommon::start_data_table_row(); |
my $row_end=&Apache::loncommon::end_data_table_row(); |
my $row_end=&Apache::loncommon::end_data_table_row(); |
$r->print($row_start. |
$r->print($row_start. |
Line 1869 $row_end
|
Line 1879 $row_end
|
STUFF |
STUFF |
} |
} |
} |
} |
$r->print(&Apache::loncommon::end_data_table().'</form>'); |
if ($shownheader) { |
|
$r->print(&Apache::loncommon::end_data_table()); |
|
} else { |
|
$r->print('<p>'.&mt('No slots meet the criteria for display').'</p>'); |
|
} |
|
$r->print('</form>'); |
return; |
return; |
} |
} |
|
|
Line 2013 sub manage_reservations {
|
Line 2028 sub manage_reservations {
|
if (ref($resource)) { |
if (ref($resource)) { |
my $symb = $resource->symb(); |
my $symb = $resource->symb(); |
$contents{$lastcontainer} ++; |
$contents{$lastcontainer} ++; |
next if (!$resource->is_problem() && !$resource->is_sequence() && |
next if (!$resource->is_gradable() && !$resource->is_sequence() && |
!$resource->is_page()); |
!$resource->is_page()); |
$count ++; |
$count ++; |
if (($resource->is_sequence()) || ($resource->is_page())) { |
if (($resource->is_sequence()) || ($resource->is_page())) { |
Line 2021 sub manage_reservations {
|
Line 2036 sub manage_reservations {
|
$container{$lastcontainer} = $resource; |
$container{$lastcontainer} = $resource; |
$container_title{$lastcontainer} = $resource->compTitle(); |
$container_title{$lastcontainer} = $resource->compTitle(); |
} |
} |
if ($resource->is_problem()) { |
if ($resource->is_gradable()) { |
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); |
push(@ordered,$symb); |
Line 2360 sub show_reservations {
|
Line 2375 sub show_reservations {
|
if ($showntablehdr) { |
if ($showntablehdr) { |
$r->print(&Apache::loncommon::end_data_table().'<br />'); |
$r->print(&Apache::loncommon::end_data_table().'<br />'); |
if (($curr{'page'} > 1) || ($more_records)) { |
if (($curr{'page'} > 1) || ($more_records)) { |
$r->print('<table><tr>'); |
$r->print('<p>'); |
if ($curr{'page'} > 1) { |
if ($curr{'page'} > 1) { |
$r->print('<td><a href="javascript:chgPage('."'previous'".');">'.&mt('Previous [_1] changes',$curr{'show'}).'</a></td>'); |
$r->print('<input type="button" onclick="javascript:chgPage('."'previous'".');" value="'. |
|
&mt('Previous [_1] changes',$curr{'show'}).'" />'); |
} |
} |
if ($more_records) { |
if ($more_records) { |
$r->print('<td><a href="javascript:chgPage('."'next'".');">'.&mt('Next [_1] changes',$curr{'show'}).'</a></td>'); |
$r->print('<input type="button" onclick="javascript:chgPage('."'next'".');" value="'. |
|
&mt('Next [_1] changes',$curr{'show'}).'" />'); |
} |
} |
$r->print('</tr></table>'); |
$r->print('</p>'); |
$r->print(<<"ENDSCRIPT"); |
$r->print(<<"ENDSCRIPT"); |
<script type="text/javascript"> |
<script type="text/javascript"> |
// <![CDATA[ |
// <![CDATA[ |
Line 2571 sub show_reservations_log {
|
Line 2588 sub show_reservations_log {
|
if ($showntablehdr) { |
if ($showntablehdr) { |
$r->print(&Apache::loncommon::end_data_table().'<br />'); |
$r->print(&Apache::loncommon::end_data_table().'<br />'); |
if (($curr{'page'} > 1) || ($more_records)) { |
if (($curr{'page'} > 1) || ($more_records)) { |
$r->print('<table><tr>'); |
$r->print('<p>'); |
if ($curr{'page'} > 1) { |
if ($curr{'page'} > 1) { |
$r->print('<td><a href="javascript:chgPage('."'previous'".');">'.&mt('Previous [_1] changes',$curr{'show'}).'</a></td>'); |
$r->print('<input type="button" onclick="javascript:chgPage('."'previous'".');" value="'. |
|
&mt('Previous [_1] changes',$curr{'show'}).'" />'); |
} |
} |
if ($more_records) { |
if ($more_records) { |
$r->print('<td><a href="javascript:chgPage('."'next'".');">'.&mt('Next [_1] changes',$curr{'show'}).'</a></td>'); |
$r->print('<input type="button" onclick="javascript:chgPage('."'next'".');" value="'. |
|
&mt('Next [_1] changes',$curr{'show'}).'" />'); |
} |
} |
$r->print('</tr></table>'); |
$r->print('</p>'); |
$r->print(<<"ENDSCRIPT"); |
$r->print(<<"ENDSCRIPT"); |
<script type="text/javascript"> |
<script type="text/javascript"> |
function chgPage(caller) { |
function chgPage(caller) { |
Line 2718 sub display_filter {
|
Line 2737 sub display_filter {
|
} |
} |
$output .= '</select></td>'; |
$output .= '</select></td>'; |
} |
} |
$output .= '<td> </td><td valign="middle"><input type="submit" value="'. |
$output .= '<td> </td></tr></table>'. |
&mt('Update Display').'" /></tr></table>'. |
'<p><input type="submit" value="'. |
|
&mt('Update Display').'" /></p>'. |
'<p class="LC_info">'. |
'<p class="LC_info">'. |
&mt('Only changes made from servers running LON-CAPA [_1] or later are displayed.' |
&mt('Only changes made from servers running LON-CAPA [_1] or later are displayed.' |
,'2.9.0'); |
,'2.9.0'); |
Line 2925 sub csv_upload_map {
|
Line 2945 sub csv_upload_map {
|
if (!$env{'form.datatoken'}) { |
if (!$env{'form.datatoken'}) { |
$datatoken=&Apache::loncommon::upfile_store($r); |
$datatoken=&Apache::loncommon::upfile_store($r); |
} else { |
} else { |
$datatoken=$env{'form.datatoken'}; |
$datatoken=&Apache::loncommon::valid_datatoken($env{'form.datatoken'}); |
&Apache::loncommon::load_tmp_file($r); |
if ($datatoken ne '') { |
|
&Apache::loncommon::load_tmp_file($r,$datatoken); |
|
} |
} |
} |
my @records=&Apache::loncommon::upfile_record_sep(); |
my @records=&Apache::loncommon::upfile_record_sep(); |
if ($env{'form.noFirstLine'}) { shift(@records); } |
if ($env{'form.noFirstLine'}) { shift(@records); } |
Line 2977 sub csvupload_fields {
|
Line 2999 sub csvupload_fields {
|
|
|
sub csv_upload_assign { |
sub csv_upload_assign { |
my ($r,$mgr)= @_; |
my ($r,$mgr)= @_; |
&Apache::loncommon::load_tmp_file($r); |
my $datatoken = &Apache::loncommon::valid_datatoken($env{'form.datatoken'}); |
|
if ($datatoken ne '') { |
|
&Apache::loncommon::load_tmp_file($r,$datatoken); |
|
} |
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(); |
Line 3289 sub handler {
|
Line 3314 sub handler {
|
} |
} |
&csv_upload_map($r); |
&csv_upload_map($r); |
} |
} |
} elsif ($env{'form.command'} eq 'slotlog' && $mgr eq 'F') { |
} elsif (($env{'form.command'} eq 'slotlog') && ($vgr eq 'F')) { |
&show_reservations_log($r); |
&show_reservations_log($r); |
} else { |
} else { |
my $symb=&unescape($env{'form.symb'}); |
my $symb=&unescape($env{'form.symb'}); |