diff options
author | Ted Trask <ttrask01@yahoo.com> | 2019-03-16 02:31:10 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2019-10-02 20:46:41 +0000 |
commit | a219d102fe69697773800cd91f508443ec293fbf (patch) | |
tree | 81d25bac034c7034bfd06738fdf13b0244e85fad /provisioning-editdeviceparams-html.lsp | |
parent | 8961d795e450e61d38da8ac22e8c3288722edb58 (diff) | |
download | acf-provisioning-master.tar.bz2 acf-provisioning-master.tar.xz |
The deletedeviceparamgroup action will delete a parameter group from a device and move up
all of the subsequent parameter groups. Only works for parameter groups with names ending with
numbers, such as regX. This can be used to delete a registration and move up all of the
subsequent registrations, working around the Polycom bug where subsequent registrations do
not show up on the device.
Diffstat (limited to 'provisioning-editdeviceparams-html.lsp')
-rw-r--r-- | provisioning-editdeviceparams-html.lsp | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/provisioning-editdeviceparams-html.lsp b/provisioning-editdeviceparams-html.lsp index c0d1de8..bd54c1f 100644 --- a/provisioning-editdeviceparams-html.lsp +++ b/provisioning-editdeviceparams-html.lsp @@ -74,15 +74,23 @@ end currentnumber = 0; } - if ((currentsection == previoussection) && (currentnumber != previousnumber) && (0 == $(this).find(".defaultoverride").length) && (0 == $(this).find(".groupdefaultoverride").length) && ($(this).children().first().text().match(currentnumber))) { - $(this).toggle(); - <% if page_info.action ~= "viewdeviceparams" then %> - $('<a href="javascript:;" class="'+id+'"><img src="<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>tango/16x16/actions/list-add.png"> Add '+$(this).children().first().text()+'</a>').insertAfter($(this)).click(showsection); - if ($(this).prev("a").length == 1) { - // If the previous sibling is also an Add link, hide this one - $(this).next().toggle(); - } + if ((currentsection == previoussection) && (currentnumber != previousnumber) && ($(this).children().first().text().match(currentnumber))) { + // Found a section + <% if page_info.action ~= "viewdeviceparams" and viewlibrary.check_permission("deletedeviceparamgroup") then %> + // Add a delete button to previous section + $("<a href='<%= page_info.script..page_info.prefix..page_info.controller.."/deletedeviceparamgroup?device_id="..html.html_escape(form.value.device_id.value) %>&group="+previoussection+previousnumber+"&redir=<%= page_info.script..page_info.prefix..page_info.controller.."/"..page_info.action..html.url_encode("?device_id="..form.value.device_id.value)%>&submit=true' class='deletedeviceparamgroup'> Delete</a>").insertAfter($(this).prevAll("div").first().children().first()); <% end %> + if ((0 == $(this).find(".defaultoverride").length) && (0 == $(this).find(".groupdefaultoverride").length)) { + // Hide this section + $(this).toggle(); + <% if page_info.action ~= "viewdeviceparams" then %> + $('<a href="javascript:;" class="'+id+'"><img src="<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>tango/16x16/actions/list-add.png"> '+$(this).children().first().text()+'</a>').insertAfter($(this)).click(showsection); + if ($(this).prev("a").length == 1) { + // If the previous sibling is also an Add link, hide this one + $(this).next().toggle(); + } + <% end %> + } } previoussection = currentsection; @@ -95,9 +103,12 @@ end $(".deletedevice").click(function(){ return confirm("Are you sure you want to delete this device?")}); $(".groupdefaultoverride").siblings().select("contains('Default:')").addClass("error"); hideunuseddivs(); + $(".deletedeviceparamgroup").click(function(){ return confirm("Are you sure you want to delete this parameter group?")}); }); </script> +<% htmlviewfunctions.displaycommandresults({"deletedeviceparamgroup"}, session) %> + <% if form and form.value and form.value.device_id and form.value.device_id.value ~= "" then %> <% if viewlibrary.check_permission("editdevice") then %> <a href='<%= page_info.script..page_info.prefix..page_info.controller.."/editdevice?device_id="..html.html_escape(form.value.device_id.value) %>'><img src='<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/tango/16x16/categories/applications-system.png' title="Edit Class of Service"></img> <big>Edit Class of Service </big></a> |