diff options
author | Zach LeBar <zach@zachlebar.com> | 2012-08-18 20:02:36 +0000 |
---|---|---|
committer | Zach LeBar <zach@zachlebar.com> | 2012-08-18 20:02:36 +0000 |
commit | bb6fd68db726c6b4d1a12e82a741d4248b0c70de (patch) | |
tree | 10797e2010478358ff146afdb237cbc9266459bc /kamailio-viewtable-html.lsp | |
download | acf-kamailio-bb6fd68db726c6b4d1a12e82a741d4248b0c70de.tar.bz2 acf-kamailio-bb6fd68db726c6b4d1a12e82a741d4248b0c70de.tar.xz |
Further tweaks to support PostgreSQL 'schemas' and a hack to allow DISTributary Phone System Tool: 'ASHP' to submit NULL values into integer columns. The ability to add NULL values should be implemented in the near future.
Diffstat (limited to 'kamailio-viewtable-html.lsp')
-rw-r--r-- | kamailio-viewtable-html.lsp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/kamailio-viewtable-html.lsp b/kamailio-viewtable-html.lsp new file mode 100644 index 0000000..28d4e13 --- /dev/null +++ b/kamailio-viewtable-html.lsp @@ -0,0 +1,54 @@ +<% local form, viewlibrary, page_info, session = ... %> +<% require("viewfunctions") %> + +<% displaycommandresults({"deletetableentry", "updatetableentry"}, session) %> +<% displaycommandresults({"createtableentry"}, session, true) %> + +<H1><%= html.html_escape(form.label) %> - <%= html.html_escape(form.value.table.value) %></H1> +<DL> +<TABLE> + <TR style="background:#eee;font-weight:bold;"> + <% if viewlibrary.check_permission("deletetableentry") or viewlibrary.check_permission("updatetableentry") then %> + <TD style="padding-right:20px;white-space:nowrap;" class="header">Action</TD> + <% end %> + <% for i,f in ipairs(form.value.fields.value) do %> + <TD style="padding-right:20px;white-space:nowrap;" class="header"><%= html.html_escape(f) %></TD> + <% end %> + </TR> + +<% for i,tableentry in ipairs(form.value.entries.value) do %> + <TR> + <% if viewlibrary.check_permission("deletetableentry") or viewlibrary.check_permission("updatetableentry") then %> + <TD style="padding-right:20px;white-space:nowrap;"> + <% if viewlibrary.check_permission("updatetableentry") then %> + <form action="updatetableentry" method="POST"> + <input class="hidden" type="hidden" name="table" value="<%= html.html_escape(form.value.table.value) %>"> + <input class="hidden" type="hidden" name="id" value="<%= html.html_escape(tableentry.id) %>"> + <input class="hidden" type="hidden" name="redir" value="<%= html.html_escape(page_info.orig_action.."?table="..form.value.table.value) %>"> + <input class="submit" type="submit" value="Update"></form> + <% end %> + <% if viewlibrary.check_permission("deletetableentry") then %> + <form action="deletetableentry" method="POST"> + <input class="hidden" type="hidden" name="table" value="<%= html.html_escape(form.value.table.value) %>"> + <input class="hidden" type="hidden" name="id" value="<%= html.html_escape(tableentry.id) %>"> + <input class="submit" type="submit" value="Delete"></form> + <% end %> + </TD> + <% end %> + <% for i,f in ipairs(form.value.fields.value) do %> + <TD><%= html.html_escape(tableentry[f]) %></TD> + <% end %> + </TR> +<% end %> +</TABLE> +<% if form.errtxt then %> +<p class="error"><%= html.html_escape(form.errtxt) %></p> +<% end %> +<% if #form.value.entries.value == 0 then %> +<p>No entries found</p> +<% end %> +</DL> + +<% if page_info.action == "viewtable" and viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createtableentry") then + viewlibrary.dispatch_component("createtableentry", {table=form.value.table.value}) +end %> |