- fix [ 1187037 ] LastModified.pm refers to LastEdited and pageId from wobject

This commit is contained in:
Matthew Wilson 2005-05-17 17:30:05 +00:00
parent 79333da701
commit 75b28bf47f

View file

@ -13,23 +13,19 @@ package WebGUI::Macro::LastModified;
use strict;
use WebGUI::DateTime;
use WebGUI::Macro;
use WebGUI::Asset;
use WebGUI::Session;
use WebGUI::International;
use WebGUI::SQL;
#-------------------------------------------------------------------
sub process {
my ($label, $format, $time, $output);
($label, $format) = WebGUI::Macro::getParams(shift);
$format = '%z' if ($format eq "");
$output = "";
($time) = WebGUI::SQL->quickArray("SELECT max(lastEdited) FROM wobject where pageId=".quote($session{page}{pageId}),WebGUI::SQL->getSlave);
if ($time) {
$output = $label.epochToHuman($time,$format);
}
return $output;
my ($label, $format, $time);
($label, $format) = WebGUI::Macro::getParams(shift);
$format = '%z' if ($format eq "");
($time) = WebGUI::SQL->quickArray("SELECT lastUpdated FROM asset where assetId=".quote($session{asset}->getId),WebGUI::SQL->getSlave);
return WebGUI::International::get(43,'Asset_Survey') if $time eq 0;
return $label.epochToHuman($time,$format) if ($time);
}
1;