summaryrefslogtreecommitdiffstats
path: root/provisioning-listrequests-html.lsp
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2013-08-26 20:14:20 +0000
committerTed Trask <ttrask01@yahoo.com>2013-08-26 20:14:20 +0000
commit05e87b21529bbec383ab513e2899048aded15120 (patch)
treef52e064a1cbd8bf0b492bed7c3e95fc412255e8e /provisioning-listrequests-html.lsp
parent837476e5a4c3d872ec0734537a56b3e95a31000e (diff)
downloadacf-provisioning-05e87b21529bbec383ab513e2899048aded15120.tar.bz2
acf-provisioning-05e87b21529bbec383ab513e2899048aded15120.tar.xz
Fix redirection when creating new devices
Diffstat (limited to 'provisioning-listrequests-html.lsp')
-rw-r--r--provisioning-listrequests-html.lsp10
1 files changed, 9 insertions, 1 deletions
diff --git a/provisioning-listrequests-html.lsp b/provisioning-listrequests-html.lsp
index 6b53195..52bb518 100644
--- a/provisioning-listrequests-html.lsp
+++ b/provisioning-listrequests-html.lsp
@@ -13,8 +13,16 @@ html = require("acf.html")
window.location.assign("<%= html.html_escape(page_info.script..page_info.prefix..page_info.controller) %>/searchdevices");
<%
end
+
-- Since we're including a submission of createdevicefromrequest, we need to overcome the automatic redirect
- if session.createdevicefromrequestresult then
+ if session.createdevicefromrequestresult and not session.createdevicefromrequestresult.errtxt then
+ local tmp = session.createdevicefromrequestresult
+ session.createdevicefromrequestresult = nil
+ -- Use JavaScript to redirect to the edit page
+%>
+ window.location.assign("<%= html.html_escape(page_info.script..page_info.prefix..page_info.controller) %>/<% if viewlibrary.check_permission("editdevice") then io.write("editdevice") elseif viewlibrary.check_permission("overridedeviceparams") then io.write("overridedeviceparams") else io.write("editdeviceparams") end %>?device_id=<%= tmp.value.device_id.value %>&redir=<%= html.html_escape(page_info.orig_action) %>");
+<%
+ elseif session.createdevicefromrequestresult then
-- Use JavaScript to redirect to the createdevicefromrequest page
%>
window.location.assign("<%= html.html_escape(page_info.script..page_info.prefix..page_info.controller) %>/createdevicefromrequest");