diff options
author | Ted Trask <ttrask01@yahoo.com> | 2013-08-26 20:14:20 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2013-08-26 20:14:20 +0000 |
commit | 05e87b21529bbec383ab513e2899048aded15120 (patch) | |
tree | f52e064a1cbd8bf0b492bed7c3e95fc412255e8e /provisioning-listrequests-html.lsp | |
parent | 837476e5a4c3d872ec0734537a56b3e95a31000e (diff) | |
download | acf-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.lsp | 10 |
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"); |