diff options
author | Ted Trask <ttrask01@yahoo.com> | 2010-09-13 08:26:10 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2010-09-13 08:26:10 +0000 |
commit | 602abbdf57454e72395141094397ef66f3aaad99 (patch) | |
tree | bd54bf46e6b867d71ac9ffe5d3e68e0b9663c6f7 | |
parent | 6311ffeb8a444f60cae2fd857de771811d2931b9 (diff) | |
download | acf-freeswitch-vmail-602abbdf57454e72395141094397ef66f3aaad99.tar.bz2 acf-freeswitch-vmail-602abbdf57454e72395141094397ef66f3aaad99.tar.xz |
Split fullname into firstname and lastname fields.
-rw-r--r-- | template-processdirectoryxml-xml.lsp | 2 | ||||
-rw-r--r-- | vmail-editusersettings-html.lsp | 4 | ||||
-rw-r--r-- | vmail-listmessages-html.lsp | 2 | ||||
-rw-r--r-- | vmail-listusers-html.lsp | 6 | ||||
-rw-r--r-- | vmail-model.lua | 16 |
5 files changed, 16 insertions, 14 deletions
diff --git a/template-processdirectoryxml-xml.lsp b/template-processdirectoryxml-xml.lsp index b8f9719..0d1fd02 100644 --- a/template-processdirectoryxml-xml.lsp +++ b/template-processdirectoryxml-xml.lsp @@ -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) %>" /> diff --git a/vmail-editusersettings-html.lsp b/vmail-editusersettings-html.lsp index 4efe709..d8acbc6 100644 --- a/vmail-editusersettings-html.lsp +++ b/vmail-editusersettings-html.lsp @@ -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) %> diff --git a/vmail-listmessages-html.lsp b/vmail-listmessages-html.lsp index 78687d1..837232c 100644 --- a/vmail-listmessages-html.lsp +++ b/vmail-listmessages-html.lsp @@ -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) diff --git a/vmail-listusers-html.lsp b/vmail-listusers-html.lsp index 3445ae2..0124385 100644 --- a/vmail-listusers-html.lsp +++ b/vmail-listusers-html.lsp @@ -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> diff --git a/vmail-model.lua b/vmail-model.lua index 3ae8b6b..a9eeb59 100644 --- a/vmail-model.lua +++ b/vmail-model.lua @@ -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 |