diff --git a/lib/WebGUI.pm b/lib/WebGUI.pm index 16121ba9d..050383361 100644 --- a/lib/WebGUI.pm +++ b/lib/WebGUI.pm @@ -207,7 +207,10 @@ sub page { $wobject = \%hash; $cmd = "WebGUI::Wobject::".${$wobject}{namespace}; $w = $cmd->new($wobject); - $contentHash{${$wobject}{templatePosition}} .= ''.$w->www_view."
\n\n"; + if ($w->inDateRange) { + $contentHash{${$wobject}{templatePosition}} .= '' + .$w->www_view."
\n\n"; + } } $sth->finish; $cmd = "use WebGUI::Template::".$session{page}{template}; diff --git a/lib/WebGUI/Wobject.pm b/lib/WebGUI/Wobject.pm index b171e5b1f..c5042fb39 100644 --- a/lib/WebGUI/Wobject.pm +++ b/lib/WebGUI/Wobject.pm @@ -145,7 +145,7 @@ sub get { =cut sub inDateRange { - if ($_[0]->get("startDate") < time() && $_[0]->get("startDate") > time()) { + if ($_[0]->get("startDate") < time() && $_[0]->get("endDate") > time()) { return 1; } else { return 0; diff --git a/lib/WebGUI/Wobject/Item.pm b/lib/WebGUI/Wobject/Item.pm index 4e18c1458..6bfcac774 100644 --- a/lib/WebGUI/Wobject/Item.pm +++ b/lib/WebGUI/Wobject/Item.pm @@ -105,15 +105,14 @@ sub www_edit { #------------------------------------------------------------------- sub www_editSave { - my ($attachment); + my ($attachment, $property); if (WebGUI::Privilege::canEditPage()) { $_[0]->SUPER::www_editSave(); $attachment = WebGUI::Attachment->new("",$_[0]->get("wobjectId")); $attachment->save("attachment"); - $_[0]->set({ - linkURL=>$session{form}{linkURL}, - attachment=>$attachment->getFilename - }); + $property->{linkURL} = $session{form}{linkURL}; + $property->{attachment} = $attachment->getFilename if ($attachment->getFilename ne ""); + $_[0]->set($property); return ""; } else { return WebGUI::Privilege::insufficient();