Commit 9ee1cd65 authored by Ted Trask's avatar Ted Trask
Browse files

Fixed downloadadhocquery and cleaned up use of viewtype

parent ee5cf20d
......@@ -37,6 +37,7 @@ html = require("acf.html")
<% if viewlibrary.check_permission("downloadadhocquery") then %>
<form action="/cgi-bin/acf/weblog/weblog/downloadadhocquery" method="POST">
<input class="hidden" type="hidden" name="query" value="<%= html.html_escape(form.value.query.value) %>" >
<input class="hidden" type="hidden" name="viewtype" value="stream" >
<DL>
<DT>Download query result</DT><DD><input class="submit" type="submit" name="submit" value="Download"></DD>
</DL>
......
......@@ -45,7 +45,6 @@ function viewweblog(self)
end
function downloadweblog(self)
self.conf.viewtype = "stream"
local retval = viewweblog(self)
local file = cfe({ type="longtext", value="", label="Weblog-"..os.date()..".tab" })
local content = {"sourcename\tclientuserid\tclientip\tlogdatetime\turi\tbytes\treason\tscore\tshortreason\tbadyesno\tdeniedyesno\tbypassyesno"}
......@@ -82,10 +81,9 @@ function adhocquery(self)
end
function downloadadhocquery(self)
self.conf.viewtype = "stream"
local retval = self.model.getnewadhocquery()
local retval = self.model.getnewadhocquery(self, self.clientdata)
self.handle_clientdata(retval, self.clientdata)
retval = self.model.adhocquery(retval)
retval = self.model.adhocquery(self, retval)
local file = cfe({ type="longtext", value="", label="weblogadhocquery.tab" })
if retval.value.result and #retval.value.result.value > 0 then
......
......@@ -209,6 +209,7 @@ data.option = "Download"
data.value.log = nil
data.value.window = nil
data.value.focus = nil
data.value.viewtype = cfe({ value="stream" })
for n,v in pairs(data.value) do
v.type = "hidden"
v.checked = nil
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment