Commit 602abbdf authored by Ted Trask's avatar Ted Trask

Split fullname into firstname and lastname fields.

parent 6311ffeb
......@@ -15,7 +15,7 @@ Content-Type: Content Type: text/xml
<params>
<param name="vm-enable" value="true>" />
<%
local ignore = {username=true, fullname=true, domain=true, ["vm-password-confirm"]=true }
local ignore = {username=true, firstname=true, lastname=true, domain=true, ["vm-password-confirm"]=true }
for name,val in pairs(viewtable.value) do
if not ignore[name] then %>
<param name="<%= name %>" value="<%= tostring(val.value) %>" />
......
......@@ -2,7 +2,7 @@
require("viewfunctions")
%>
<H1>Settings for <%= html.html_escape(form.value.fullname.value) %> (<%= html.html_escape(form.value.username.value) %>)</H1>
<H1>Settings for <%= html.html_escape(form.value.firstname.value) %> <%= html.html_escape(form.value.lastname.value) %> (<%= html.html_escape(form.value.username.value) %>)</H1>
<%
form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action
if page_info.action ~= "createuser" then
......@@ -10,6 +10,6 @@ require("viewfunctions")
end
form.value["vm-password"].type = "password"
form.value["vm-password-confirm"].type = "password"
local order = {"username", "fullname", "vm-password", "vm-password-confirm", "vm-mailto", "vm-email-all-messages", "vm-attach-file", "vm-keep-local-after-email", "vm-notify-mailto", "vm-notify-email-all-messages"}
local order = {"username", "firstname", "lastname", "vm-password", "vm-password-confirm", "vm-mailto", "vm-email-all-messages", "vm-attach-file", "vm-keep-local-after-email", "vm-notify-mailto", "vm-notify-email-all-messages"}
displayform(form, order)
%>
......@@ -8,7 +8,7 @@ if viewlibrary.check_permission("listusers") and (viewlibrary.check_permission("
useroptions = {}
for i,u in ipairs(users.value) do
if u.username ~= session.userinfo.userid then
useroptions[#useroptions+1] = '<option value="'..html.html_escape(u.username)..'">'..html.html_escape(u.fullname)..' ('..html.html_escape(u.username)..')</option>'
useroptions[#useroptions+1] = '<option value="'..html.html_escape(u.username)..'">'..html.html_escape(u.firstname)..' '..html.html_escape(u.lastname)..' ('..html.html_escape(u.username)..')</option>'
end
end
useroptions = table.concat(useroptions)
......
......@@ -17,7 +17,8 @@ require("viewfunctions")
<TR style="background:#eee;font-weight:bold;">
<TH>Action</TH>
<TH>Extension</TH>
<TH>Full Name</TH>
<TH>First Name</TH>
<TH>Last Name</TH>
</TR>
</THEAD><TBODY>
<% for k,v in ipairs( view.value ) do %>
......@@ -31,7 +32,8 @@ require("viewfunctions")
<% end %>
</TD>
<TD><%= html.html_escape(v.username) %></TD>
<TD><%= html.html_escape(v.fullname) %></TD>
<TD><%= html.html_escape(v.firstname) %></TD>
<TD><%= html.html_escape(v.lastname) %></TD>
</TR>
<% end %>
</TBODY>
......
......@@ -32,7 +32,8 @@ local voicemail_values_creation_script = {
local voicemail_params_creation_script = {
"CREATE TABLE voicemail_params (name VARCHAR(255) primary key, type VARCHAR(255), label VARCHAR(255), descr VARCHAR(255), value VARCHAR(255))",
"INSERT INTO voicemail_params VALUES('username', 'text', 'Extension', '', '')",
"INSERT INTO voicemail_params VALUES('fullname', 'text', 'Full User Name', '', '')",
"INSERT INTO voicemail_params VALUES('firstname', 'text', 'User First Name', '', '')",
"INSERT INTO voicemail_params VALUES('lastname', 'text', 'User Last Name', '', '')",
"INSERT INTO voicemail_params VALUES('vm-password', 'text', 'Voicemail Password', '', '')",
"INSERT INTO voicemail_params VALUES('vm-password-confirm', 'text', 'Enter again to confirm', '', '')",
"INSERT INTO voicemail_params VALUES('vm-mailto', 'text', 'Email Address', 'Email a notification, including audio file if enabled', '')",
......@@ -546,15 +547,14 @@ list_users = function()
if string.find(u.username, "^tempuser") then
table.remove(users, i)
else
local sql = "SELECT value FROM voicemail_values"..generatewhereclause(u.username).." and name='fullname'"
local sql = "SELECT * FROM voicemail_values"..generatewhereclause(u.username).." and (name='firstname' or name='lastname')"
local cur = con:execute(sql)
if cur then
local row = cur:fetch ({}, "a")
if row and row.value then
u.fullname = row.value
end
cur:close()
local row = cur:fetch ({}, "a")
while row do
u[row.name] = row.value
row = cur:fetch (row, "a")
end
cur:close()
end
end
if connected then databasedisconnect() end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment