1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
<% local data, viewlibrary, page_info, session = ...
require("viewfunctions")
%>
<% local subdata, pagedata = paginate(data.value.definitions.value, page_info.clientdata, 15) %>
<script type="text/javascript">
function newPopup(url) {
popupWindow = window.open(
url,'popUpWindow','width=600,resizable=yes,scrollbars=yes,toolbar=no,menubar=no,location=no,directories=no,status=no')
}
</script>
<% if session.editdefinitionresult then
session.didresult = session.editdefinitionresult.value
session.editdefinitionresult = nil
end %>
<% if session.didresult then %>
<H1>Last Result</H1><DL>
<P CLASS="descr"><%= string.gsub(html.html_escape(session.didresult), "\n", "<BR>") %></P>
</DL></H1>
<% end %>
<% displaycommandresults({"editdefinition", "deletedefinition", "publish", "publishall"}, session) %>
<% if data.value.did.value ~= "" or (data.value.extension and data.value.extension.value ~= "") or data.value.description.value ~= "" or data.value.identification.value ~= "" or data.value.department.value ~= "" then %>
<H2>Search Description</H2>
<DL>
<% if data.value.did.value ~= "" then %><DT>DID</DT><DD><%= data.value.did.value %></DD><% end %>
<% if (data.value.extension and data.value.extension.value ~= "") then %><DT>Extension</DT><DD><%= data.value.extension.value %></DD><% end %>
<% if data.value.description.value ~= "" then %><DT>Description</DT><DD><%= data.value.description.value %></DD><% end %>
<% if data.value.identification.value ~= "" then %><DT>Identification</DT><DD><%= data.value.identification.value %></DD><% end %>
<% if data.value.department.value ~= "" then %><DT>Department</DT><DD><%= data.value.department.value %></DD><% end %>
</DL>
<% end %>
<H1><%= html.html_escape(data.label) %></H1>
<DL>
<% displaypagination(pagedata, page_info) %>
<TABLE>
<TR style="background:#eee;font-weight:bold;">
<TD style="padding-right:20px;white-space:nowrap;" class="header">Action</TD>
<TD style="padding-right:20px;white-space:nowrap;" class="header">DID</TD>
<% if subdata[1] and subdata[1].extension then %>
<TD style="padding-right:20px;white-space:nowrap;" class="header">Extensions</TD>
<% end %>
<TD style="padding-right:20px;white-space:nowrap;" class="header">ID Number</TD>
<TD style="padding-right:20px;white-space:nowrap;" class="header">Department</TD>
<TD style="white-space:nowrap;" WIDTD="90%" class="header">Description</TD>
</TR>
<% for i,def in ipairs(subdata) do %>
<TR>
<TD>
<%= html.link{value = "editdefinition?did="..def.did.."&redir="..page_info.orig_action, label="Edit "} %>
<% if viewlibrary.check_permission("publish") then %>
<%= html.link{value = "publish?did=" .. def.did, label="Publish "} %>
<% end %>
<% if viewlibrary.check_permission("deletedefinition") then %>
<%= html.link{value = "deletedefinition?did=" .. def.did, label="Delete "} %>
<% end %>
</TD>
<TD><%= html.html_escape(def.did) %></TD>
<% if def.extension then %>
<TD><%= html.html_escape(def.extension) %></TD>
<% end %>
<TD><%= html.html_escape(def.identification) %></TD>
<TD><%= html.html_escape(def.department) %></TD>
<TD><%= html.html_escape(def.description) %></TD>
</TR>
<% end %>
</TABLE>
<% if data.errtxt then %>
<p class='error'><%= html.html_escape(data.errtxt) %></p>
<% end %>
<% if #subdata == 0 then %>
<p>No definitions found</p>
<% end %>
<% if viewlibrary.check_permission("publishall") then %>
<form action="<%= html.html_escape(page_info.script .. page_info.prefix .. page_info.controller .. "/publishall") %>">
<DT>Publish All DIDs</DT>
<DD><input class="submit" type="submit" value="Publish"></DD>
</form>
<% end %>
</DL>
|