[LON-CAPA-cvs] cvs: loncom /interface lonnavmaps.pm
raeburn
raeburn at source.lon-capa.org
Fri Sep 25 13:39:36 EDT 2015
raeburn Fri Sep 25 17:39:36 2015 EDT
Modified files:
/loncom/interface lonnavmaps.pm
Log:
- Show both due date and reservation status for non-task items with access
controlled by slots, if there is a due date, and status is open.
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.508 loncom/interface/lonnavmaps.pm:1.509
--- loncom/interface/lonnavmaps.pm:1.508 Fri Jun 19 15:36:53 2015
+++ loncom/interface/lonnavmaps.pm Fri Sep 25 17:39:36 2015
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Navigate Maps Handler
#
-# $Id: lonnavmaps.pm,v 1.508 2015/06/19 15:36:53 damieng Exp $
+# $Id: lonnavmaps.pm,v 1.509 2015/09/25 17:39:36 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
@@ -624,44 +624,52 @@
if ($status == $res->OPEN_LATER) {
return &mt("Open [_1]",&Apache::lonhtmlcommon::direct_parm_link(&timeToHumanString($open,'start'),$res->symb(),'opendate',$part));
}
+ my $slotinfo;
if ($res->simpleStatus($part) == $res->OPEN) {
unless (&Apache::lonnet::allowed('mgr',$env{'request.course.id'})) {
my ($slot_status,$slot_time,$slot_name)=$res->check_for_slot($part);
+ my $slotmsg;
if ($slot_status == $res->UNKNOWN) {
- return &mt('Reservation status unknown');
+ $slotmsg = &mt('Reservation status unknown');
} elsif ($slot_status == $res->RESERVED) {
- return &mt('Reserved - ends [_1]',
+ $slotmsg = &mt('Reserved - ends [_1]',
timeToHumanString($slot_time,'end'));
} elsif ($slot_status == $res->RESERVED_LOCATION) {
- return &mt('Reserved - specific location(s) - ends [_1]',
+ $slotmsg = &mt('Reserved - specific location(s) - ends [_1]',
timeToHumanString($slot_time,'end'));
} elsif ($slot_status == $res->RESERVED_LATER) {
- return &mt('Reserved - next open [_1]',
+ $slotmsg = &mt('Reserved - next open [_1]',
timeToHumanString($slot_time,'start'));
} elsif ($slot_status == $res->RESERVABLE) {
- return &mt('Reservable, reservations close [_1]',
+ $slotmsg = &mt('Reservable, reservations close [_1]',
timeToHumanString($slot_time,'end'));
} elsif ($slot_status == $res->RESERVABLE_LATER) {
- return &mt('Reservable, reservations open [_1]',
+ $slotmsg = &mt('Reservable, reservations open [_1]',
timeToHumanString($slot_time,'start'));
} elsif ($slot_status == $res->NOT_IN_A_SLOT) {
- return &mt('Reserve a time/place to work');
+ $slotmsg = &mt('Reserve a time/place to work');
} elsif ($slot_status == $res->NOTRESERVABLE) {
- return &mt('Reservation not available');
+ $slotmsg = &mt('Reservation not available');
} elsif ($slot_status == $res->WAITING_FOR_GRADE) {
- return &mt('Submission in grading queue');
+ $slotmsg = &mt('Submission in grading queue');
+ }
+ if ($slotmsg) {
+ if ($res->is_task() || !$due) {
+ return $slotmsg;
+ }
+ $slotinfo = (' ' x 2).'('.$slotmsg.')';
}
}
}
if ($status == $res->OPEN) {
if ($due) {
if ($res->is_practice()) {
- return &mt("Closes [_1]",&Apache::lonhtmlcommon::direct_parm_link(&timeToHumanString($due,'start'),$res->symb(),'duedate',$part));
+ return &mt("Closes [_1]",&Apache::lonhtmlcommon::direct_parm_link(&timeToHumanString($due,'start'),$res->symb(),'duedate',$part)).$slotinfo;
} else {
- return &mt("Due [_1]",&Apache::lonhtmlcommon::direct_parm_link(&timeToHumanString($due,'end'),$res->symb(),'duedate',$part));
+ return &mt("Due [_1]",&Apache::lonhtmlcommon::direct_parm_link(&timeToHumanString($due,'end'),$res->symb(),'duedate',$part)).$slotinfo;
}
} else {
- return &Apache::lonhtmlcommon::direct_parm_link(&mt("Open, no due date"),$res->symb(),'duedate',$part);
+ return &Apache::lonhtmlcommon::direct_parm_link(&mt("Open, no due date"),$res->symb(),'duedate',$part).$slotinfo;
}
}
if ($status == $res->PAST_DUE_ANSWER_LATER) {
More information about the LON-CAPA-cvs
mailing list