List usernames next to entries

This commit is contained in:
Fierelier 2024-08-30 16:04:50 +02:00
parent bb727acc1d
commit e0af56ae0b

View File

@ -234,7 +234,16 @@ local function searchByName()
for i,entry in pairs(env.xmlFindTags(env.db,"entries")[1].children) do
if string.find(string.lower(entry.attrs.name),name) ~= nil then
table.insert(entries,function() manageEntry(entry) end)
table.insert(entriesMenu,entry.attrs.name)
local username = nil
pcall(function()
username = env.run({"field_get",entry.attrs.id,"username"})
end)
local output = entry.attrs.name
if username ~= nil then
output = output .. " (" .. username .. ")"
end
table.insert(entriesMenu,output)
end
end
emenu("Found entries:",entriesMenu,entries)