summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2010-06-29 13:26:23 +0000
committerTed Trask <ttrask01@yahoo.com>2010-06-29 13:26:23 +0000
commit072e06ced2652119c9c1d6fcd2fddeba8cd6445c (patch)
tree6ada200074f202fa6d38dc311edd1ebacfeffadf
parente519a05dbd8a7fe2d5c94cf6786d2bc396ddc40c (diff)
downloadacf-did-072e06ced2652119c9c1d6fcd2fddeba8cd6445c.tar.bz2
acf-did-072e06ced2652119c9c1d6fcd2fddeba8cd6445c.tar.xz
Changed timestamps to 'now' and set precisions
-rw-r--r--did-model.lua10
-rw-r--r--did-viewactivitylog-html.lsp2
2 files changed, 6 insertions, 6 deletions
diff --git a/did-model.lua b/did-model.lua
index 42d81f8..d7b3a8d 100644
--- a/did-model.lua
+++ b/did-model.lua
@@ -25,7 +25,7 @@ local con
local database_creation_script = {
"CREATE AGGREGATE array_accum(anyelement) (SFUNC = array_append, STYPE = anyarray, INITCOND = '{}')",
"CREATE TABLE dbhistlog (logdatetime timestamp(3) without time zone NOT NULL, msgtext text, userid text)",
- "CREATE TABLE definition (did character varying(40) NOT NULL, identification character varying(7), department character varying(40), description character varying(255), lastchange timestamp without time zone)",
+ "CREATE TABLE definition (did character varying(40) NOT NULL, identification character varying(7), department character varying(40), description character varying(255), lastchange timestamp(0) without time zone)",
"CREATE TABLE pubdid (did character varying(40), extension character varying(40), starttime time without time zone, endtime time without time zone, stale boolean)",
"CREATE TABLE rule (did character varying(40) NOT NULL, extension character varying(40) NOT NULL, starttime time without time zone, endtime time without time zone, startdate date, enddate date, dayofweek bit(7))",
"ALTER TABLE ONLY definition ADD CONSTRAINT definition_pkey PRIMARY KEY (did)",
@@ -159,8 +159,8 @@ local logme = function(message)
if APP and APP.sessiondata and APP.sessiondata.userinfo and APP.sessiondata.userinfo.userid then
userid = APP.sessiondata.userinfo.userid
end
- local sql = string.format("INSERT INTO dbhistlog VALUES ('%s', '%s', '%s')",
- os.date("%Y-%m-%d %H:%M:%S"), escape(message), userid)
+ local sql = string.format("INSERT INTO dbhistlog VALUES ('now', '%s', '%s')",
+ escape(message), userid)
local res = assert (con:execute(sql))
end
@@ -337,9 +337,9 @@ local findunuseddefinition = function(exchange)
end
local updatedefinitionentry = function(definition)
- local sql = string.format("UPDATE definition SET identification='%s', department='%s', description='%s', lastchange='%s' WHERE did='%s'",
+ local sql = string.format("UPDATE definition SET identification='%s', department='%s', description='%s', lastchange='now' WHERE did='%s'",
escape(definition.identification), escape(definition.department),
- escape(definition.description), os.date("%Y-%m-%d %H:%M:%S"), escape(definition.did))
+ escape(definition.description), escape(definition.did))
local res = assert (con:execute(sql))
-- logme("Updated DID "..definition.did)
return res
diff --git a/did-viewactivitylog-html.lsp b/did-viewactivitylog-html.lsp
index 9881f27..251cf83 100644
--- a/did-viewactivitylog-html.lsp
+++ b/did-viewactivitylog-html.lsp
@@ -9,7 +9,7 @@
<% for i,log in ipairs(data.value) do %>
<TR>
- <TD><%= html.html_escape(log.logdatetime) %></TD>
+ <TD><%= html.html_escape(string.gsub(log.logdatetime, "%..*", "")) %></TD>
<TD><%= string.gsub(html.html_escape(log.msgtext), "\n", "<BR>") %></TD>
<TD><%= html.html_escape(log.userid) %></TD>
</TR>