summaryrefslogtreecommitdiffstats
path: root/cron-listjobs-html.lsp
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2009-09-07 11:46:27 +0000
committerTed Trask <ttrask01@yahoo.com>2009-09-07 11:46:27 +0000
commit3b038c8e0a3c70fb48ced52f8af2782b2d6a8e2c (patch)
treee00bf537139e862cdf90bb1f009530326a4a47f6 /cron-listjobs-html.lsp
parentf42ec486ce67c353d111aa85f751fce85177f254 (diff)
downloadacf-alpine-baselayout-3b038c8e0a3c70fb48ced52f8af2782b2d6a8e2c.tar.bz2
acf-alpine-baselayout-3b038c8e0a3c70fb48ced52f8af2782b2d6a8e2c.tar.xz
Added cron move functionality, added default value for period.
Diffstat (limited to 'cron-listjobs-html.lsp')
-rw-r--r--cron-listjobs-html.lsp28
1 files changed, 24 insertions, 4 deletions
diff --git a/cron-listjobs-html.lsp b/cron-listjobs-html.lsp
index d9705e0..1968bad 100644
--- a/cron-listjobs-html.lsp
+++ b/cron-listjobs-html.lsp
@@ -1,13 +1,30 @@
<% local view, viewlibrary, page_info, session = ... %>
<% require("viewfunctions") %>
-<% displaycommandresults({"editjob", "deletejob"}, session) %>
+<% displaycommandresults({"editjob", "deletejob", "movejob"}, session) %>
<% displaycommandresults({"createjob"}, session, true) %>
<% if viewlibrary and viewlibrary.dispatch_component then
viewlibrary.dispatch_component("status")
end %>
+<% -- set up the form for the move action
+local formstart = '<form action="'..html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/movejob")..'" method="POST">'
+formstart = formstart .. '<input type="hidden" name="name" value="'
+local formend = '">\n<select name="period" style="width:150px">'
+for i,tabl in ipairs(view.value) do
+ if i == 1 then
+ formend = formend .. '<option selected value="'..tabl.period..'">'..tabl.period..'</option>'
+ else
+ formend = formend .. '<option value="'..tabl.period..'">'..tabl.period..'</option>'
+ end
+end
+formend = formend .. '</select>\n<input class="submit" type="submit" name="Move" value="Move"></form>'
+local function createmoveform(name)
+ io.write(formstart, name, formend)
+end
+%>
+
<H1>Cron Jobs</H1>
<% for i,tabl in ipairs(view.value) do %>
<H2><%= html.html_escape(tabl.period) %></H2>
@@ -16,16 +33,19 @@ No jobs
<% else %>
<TABLE>
<TR style="background:#eee;font-weight:bold;">
- <TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Action</TD>
- <TD style="white-space:nowrap;text-align:left;" class="header">Job</TD>
+ <TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Job</TD>
+ <TD style="white-space:nowrap;text-align:left;" class="header">Action</TD>
+ <TD style="white-space:nowrap;text-align:left;" class="header"></TD>
</TR>
<% for i,job in ipairs(tabl.jobs) do %>
<TR>
+ <TD style="white-space:nowrap;"><%= html.html_escape(string.gsub(job, "^.*/", "")) %></TD>
<TD style="padding-right:20px;white-space:nowrap;">
<%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/editjob?name="..job.."&redir="..page_info.orig_action, label="Edit "} %>
<%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/deletejob?name="..job, label="Delete "} %>
+ </TD><TD>
+ <% createmoveform(job, tabl.period) %>
</TD>
- <TD style="white-space:nowrap;"><%= html.html_escape(string.gsub(job, "^.*/", "")) %></TD>
</TR>
<% end %>
</TABLE>