[LON-CAPA-cvs] cvs: loncom /interface lonnavmaps.pm

foxr foxr at source.lon-capa.org
Tue Jun 19 06:11:35 EDT 2012


foxr		Tue Jun 19 10:11:35 2012 EDT

  Modified files:              
    /loncom/interface	lonnavmaps.pm 
  Log:
  BZ6511 - Factor in contentopen and open dates into the printability of a 
  resource.
  
  
  
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.486 loncom/interface/lonnavmaps.pm:1.487
--- loncom/interface/lonnavmaps.pm:1.486	Fri Jun  8 21:24:16 2012
+++ loncom/interface/lonnavmaps.pm	Tue Jun 19 10:11:35 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.486 2012/06/08 21:24:16 raeburn Exp $
+# $Id: lonnavmaps.pm,v 1.487 2012/06/19 10:11:35 foxr Exp $
 
 #
 # Copyright Michigan State University Board of Trustees
@@ -4363,19 +4363,34 @@
 
     my ($self, $part) = @_;
 
-    # Get the print open/close dates for the resource.
+    &Apache::lonnet::logthis($self->symb());
 
-    my $start = $self->parmval("printstartdate", $part);
-    my $end   = $self->parmval("printenddate", $part);
 
     #  The following cases apply:
-    #  - No dates set: Printable.
+    #  - If a start date is not set, it is replaced by the open date.
+    #  - Ditto for start/open replaced by content open.
+    #  - If neither start nor printdates are set the part is printable.
     #  - Start date set but no end date: Printable if now >= start date.
     #  - End date set but no start date: Printable if now <= end date.
     #  - both defined: printable if start <= now <= end
     #
+
+    # Get the print open/close dates for the resource.
+
+    my $start = $self->parmval("printstartdate", $part);
+    my $end   = $self->parmval("printenddate", $part);
+
+    if (!$start) {
+	$start = $self->parmval("opendate", $part);
+    }
+    if (!$start) {
+	$start = $self->parmval("contentopen", $part);
+    }
+
+
     my $now  = time();
 
+
     my $startok = 1;
     my $endok   = 1;
 




More information about the LON-CAPA-cvs mailing list