';
@@ -4362,19 +4365,34 @@ sub printable {
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;