diff options
author | Ted Trask <ttrask01@yahoo.com> | 2012-10-28 03:15:18 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2012-10-28 03:15:18 +0000 |
commit | f3efbd5c0c63a4ecc4b0261f138b29a1d0a63e65 (patch) | |
tree | 070a7936b8a5b532d964bf5f05d9b1d71d01fd26 | |
parent | 567e623b8285a1b93440c2aa51a00bffb92e32ab (diff) | |
download | acf-kamailio-f3efbd5c0c63a4ecc4b0261f138b29a1d0a63e65.tar.bz2 acf-kamailio-f3efbd5c0c63a4ecc4b0261f138b29a1d0a63e65.tar.xz |
Removed unneeded views by updating CFE for autoview
-rw-r--r-- | kamailio-createtableentry-html.lsp | 15 | ||||
-rw-r--r-- | kamailio-createuser-html.lsp | 16 | ||||
-rw-r--r-- | kamailio-model.lua | 16 | ||||
l--------- | kamailio-updatetableentry-html.lsp | 1 | ||||
l--------- | kamailio-updateuser-html.lsp | 1 |
5 files changed, 10 insertions, 39 deletions
diff --git a/kamailio-createtableentry-html.lsp b/kamailio-createtableentry-html.lsp deleted file mode 100644 index e8dc1ca..0000000 --- a/kamailio-createtableentry-html.lsp +++ /dev/null @@ -1,15 +0,0 @@ -<% local form, viewlibrary, page_info = ... -require("htmlviewfunctions") -html = require("acf.html") -%> - -<H1><%= html.html_escape(form.label) %></H1> -<% - form.value.table.readonly = true - if page_info.action == "updatetableentry" and form.value.id then - form.value.id.readonly = true - elseif form.value.id then - form.value.id.type = "hidden" - end - htmlviewfunctions.displayform(form, nil, nil, page_info, 2) -%> diff --git a/kamailio-createuser-html.lsp b/kamailio-createuser-html.lsp deleted file mode 100644 index b83f2b1..0000000 --- a/kamailio-createuser-html.lsp +++ /dev/null @@ -1,16 +0,0 @@ -<% local form, viewlibrary, page_info = ... -require("htmlviewfunctions") -html = require("acf.html") -%> - -<H1><%= html.html_escape(form.label) %></H1> -<% - form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action - form.value.password.type = "password" - form.value.password_confirm.type = "password" - if page_info.action == "updateuser" then - form.value.username.readonly = true - end - local order = {"username", "password", "password_confirm", "email_address"} - htmlviewfunctions.displayform(form, order) -%> diff --git a/kamailio-model.lua b/kamailio-model.lua index e730bc5..2f921de 100644 --- a/kamailio-model.lua +++ b/kamailio-model.lua @@ -233,10 +233,10 @@ end function get_new_user() local user = {} - user.username = cfe({label="User Name"}) - user.password = cfe({label="Password"}) - user.password_confirm = cfe({label="Password (confirm)"}) - --user.email_address = cfe({label="E-mail Address"}) + user.username = cfe({label="User Name", seq=1}) + user.password = cfe({type="password", label="Password", seq=2}) + user.password_confirm = cfe({type="password", label="Password (confirm)", seq=3}) + --user.email_address = cfe({label="E-mail Address", seq=4}) return cfe({type="group", value=user, label="Kamailio User"}) end @@ -281,6 +281,7 @@ function get_user(username) local user = get_new_user() user.value.username.value = username user.value.username.errtxt = "Invalid user" + user.value.username.readonly = true local users = list_users() for i,u in ipairs(users.value) do if u.username == username then @@ -352,7 +353,7 @@ end function get_table_entry(table, id) local retval = {} - retval.table = cfe({ value=table or "", label="Table", errtxt="Table does not exist", seq=0 }) + retval.table = cfe({ value=table or "", label="Table", errtxt="Table does not exist", readonly=true, seq=0 }) local errtxt = "Table does not exist" if table and table ~= "" then local res, err = pcall(function() @@ -370,13 +371,16 @@ function get_table_entry(table, id) for i,f in ipairs(fields) do retval[f] = cfe({ label=f, seq=i }) end - if id and id ~= "" then + if id and id ~= "" and retval.id then + retval.id.readonly = true local entry = getselectresponse("SELECT * FROM "..table.." WHERE id='"..escape(id).."'") if entry and #entry > 0 then for n,v in pairs(entry[1]) do if retval[n] then retval[n].value = v end end end + elseif retval.id then + retval.id.type = "hidden" end end if connected then databasedisconnect() end diff --git a/kamailio-updatetableentry-html.lsp b/kamailio-updatetableentry-html.lsp deleted file mode 120000 index ee06465..0000000 --- a/kamailio-updatetableentry-html.lsp +++ /dev/null @@ -1 +0,0 @@ -kamailio-createtableentry-html.lsp
\ No newline at end of file diff --git a/kamailio-updateuser-html.lsp b/kamailio-updateuser-html.lsp deleted file mode 120000 index cd878eb..0000000 --- a/kamailio-updateuser-html.lsp +++ /dev/null @@ -1 +0,0 @@ -kamailio-createuser-html.lsp
\ No newline at end of file |