From 75b28bf47f056641c6539f79a208aee9266f7436 Mon Sep 17 00:00:00 2001 From: Matthew Wilson Date: Tue, 17 May 2005 17:30:05 +0000 Subject: [PATCH] - fix [ 1187037 ] LastModified.pm refers to LastEdited and pageId from wobject --- lib/WebGUI/Macro/LastModified.pm | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/lib/WebGUI/Macro/LastModified.pm b/lib/WebGUI/Macro/LastModified.pm index 12116a993..40681ee5d 100644 --- a/lib/WebGUI/Macro/LastModified.pm +++ b/lib/WebGUI/Macro/LastModified.pm @@ -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;