Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
acf-db
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ACF
acf-db
Commits
b0148d55
Commit
b0148d55
authored
Oct 30, 2014
by
Ted Trask
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hide the update option in viewtable HTML view if all fields are key fields
parent
dd629c93
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
lib/db-viewtable-html.lsp
lib/db-viewtable-html.lsp
+13
-2
No files found.
lib/db-viewtable-html.lsp
View file @
b0148d55
...
@@ -65,19 +65,30 @@ if form.value.connection then
...
@@ -65,19 +65,30 @@ if form.value.connection then
formvalues.connection = form.value.connection
formvalues.connection = form.value.connection
for n,v in pairs(form.value.connection.value) do v.type="hidden" end
for n,v in pairs(form.value.connection.value) do v.type="hidden" end
end
end
local reversekeyfields = {}
if form.value.keyfields then
if form.value.keyfields then
formvalues.fields = cfe({ type="group", value={} })
formvalues.fields = cfe({ type="group", value={} })
for i,f in ipairs(form.value.keyfields.value) do
for i,f in ipairs(form.value.keyfields.value) do
formvalues.fields.value[f] = cfe({ type="hidden" })
formvalues.fields.value[f] = cfe({ type="hidden" })
reversekeyfields[f] = i
end
end
end
end
formvalues.table = form.value.table
formvalues.table = form.value.table
form.value.table.type = "hidden"
form.value.table.type = "hidden"
formvalues.redir = redir
formvalues.redir = redir
-- We will hide the update link if all fields are key fields
local allowupdate = false
for i,f in ipairs(form.value.fields.value) do
if not reversekeyfields[f] then
allowupdate = true
break
end
end
allowupdate = allowupdate and viewlibrary.check_permission("updatetableentry")
%>
%>
<% for i,tableentry in ipairs(form.value.entries.value) do %>
<% for i,tableentry in ipairs(form.value.entries.value) do %>
<tr>
<tr>
<% if viewlibrary.check_permission("deletetableentry") or
viewlibrary.check_permission("updatetableentry")
then %>
<% if viewlibrary.check_permission("deletetableentry") or
allowupdate
then %>
<%
<%
if formvalues.fields then
if formvalues.fields then
for i,f in ipairs(form.value.keyfields.value) do
for i,f in ipairs(form.value.keyfields.value) do
...
@@ -86,7 +97,7 @@ formvalues.redir = redir
...
@@ -86,7 +97,7 @@ formvalues.redir = redir
end
end
%>
%>
<td>
<td>
<% if
viewlibrary.check_permission("updatetableentry")
then %>
<% if
allowupdate
then %>
<% htmlviewfunctions.displayitem(cfe({type="link", value=formvalues, label="", option="Update", action="updatetableentry"}), page_info, -1) %>
<% htmlviewfunctions.displayitem(cfe({type="link", value=formvalues, label="", option="Update", action="updatetableentry"}), page_info, -1) %>
<% end %>
<% end %>
<% if viewlibrary.check_permission("deletetableentry") then %>
<% if viewlibrary.check_permission("deletetableentry") then %>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment