summaryrefslogtreecommitdiffstats
path: root/provisioning-listclassgroups-html.lsp
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2011-02-11 08:34:23 +0000
committerTed Trask <ttrask01@yahoo.com>2011-02-11 08:34:23 +0000
commitcf30a7c085eeadec8f7147836eb92f0a36d3bdff (patch)
tree93838443a157b7339af71758b978c3bbd84748cf /provisioning-listclassgroups-html.lsp
parented135be9599d559e87be706bb9fa2c660a0be8cf (diff)
downloadacf-provisioning-cf30a7c085eeadec8f7147836eb92f0a36d3bdff.tar.bz2
acf-provisioning-cf30a7c085eeadec8f7147836eb92f0a36d3bdff.tar.xz
Added concept of class groups to allow separate name and label for class groups
Added four new actions - listclassgroups, editclassgroup, createclassgroup, and deleteclassgroup Added new provisioning_class_groups table Changed provisioning_classes to change name to class_group_id plus added seq field Modified groups to only accept alphanumeric names and display param group label instead of name when editing params
Diffstat (limited to 'provisioning-listclassgroups-html.lsp')
-rw-r--r--provisioning-listclassgroups-html.lsp55
1 files changed, 55 insertions, 0 deletions
diff --git a/provisioning-listclassgroups-html.lsp b/provisioning-listclassgroups-html.lsp
new file mode 100644
index 0000000..757e8a1
--- /dev/null
+++ b/provisioning-listclassgroups-html.lsp
@@ -0,0 +1,55 @@
+<% local view, viewlibrary, page_info, session = ...
+require("viewfunctions")
+%>
+
+<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery-latest.js"></script>
+<script type="text/javascript" src="<%= html.html_escape(page_info.wwwprefix) %>/js/jquery.tablesorter.js"></script>
+<script type="text/javascript">
+ $(document).ready(function() {
+ $("#list").tablesorter({headers: {0:{sorter: false}}});
+ $(".deletegroup").click(function(){ return confirm("Are you sure you want to delete this group?")});
+ });
+</script>
+
+<% displaycommandresults({"deleteclassgroup", "editclassgroup"}, session) %>
+<% displaycommandresults({"createclassgroup"}, session, true) %>
+
+<h1>Class Groups</h1>
+<DL>
+<TABLE id="list" class="tablesorter"><THEAD>
+ <TR style="background:#eee;font-weight:bold;">
+ <TH>Action</TH>
+ <TH>Name</TH>
+ <TH>Label</TH>
+ <TH>Sequence</TH>
+ </TR>
+</THEAD><TBODY>
+<% for k,v in ipairs( view.value ) do %>
+ <TR>
+ <TD>
+ <% if viewlibrary.check_permission("deleteclassgroup") then %>
+ <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/deleteclassgroup?class_group_id="..v.class_group_id, label="Delete ", class="deletegroup"} %>
+ <% end %>
+ <% if viewlibrary.check_permission("editclassgroup") then %>
+ <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/editclassgroup?class_group_id="..v.class_group_id.."&redir="..page_info.orig_action, label="Edit "} %>
+ <% end %>
+ </TD>
+ <TD><%= html.html_escape(v.name) %></TD>
+ <TD><%= html.html_escape(v.label) %></TD>
+ <TD><%= html.html_escape(v.seq) %></TD>
+ </TR>
+<% end %>
+</TBODY>
+</TABLE>
+
+<% if view.errtxt then %>
+<p class="error"><%= html.html_escape(view.errtxt) %></p>
+<% end %>
+<% if #view.value == 0 then %>
+<p>No class groups found</p>
+<% end %>
+
+<% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("createclassgroup") then
+ viewlibrary.dispatch_component("createclassgroup")
+end %>
+</DL>