Skip to content

Commit

Permalink
pool to popup
Browse files Browse the repository at this point in the history
  • Loading branch information
StiftungAusNachlass committed May 2, 2023
1 parent 3562b6c commit 7d037f4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
3 changes: 3 additions & 0 deletions l10n/find-duplicate-field-values.csv
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ fylr-plugin-find-duplicate-field-values.info.link,Dubletten gefunden. Mehr Info
fylr-plugin-find-duplicate-field-values.modal.open.link,Öffnen,Öffnen
fylr-plugin-find-duplicate-field-values.options.empty,Ohne,Without
fylr-plugin-find-duplicate-field-values.options.empty_save,Die Optionen werden erst nach dem Speichern sichtbar,The options only become visible after saving
fylr-plugin-find-duplicate-field-values.modal.open.shortinfo_standard,Kurzinfo,Shortinfo
fylr-plugin-find-duplicate-field-values.modal.open.pool,Pool,Pool
fylr-plugin-find-duplicate-field-values.modal.open.objecttype,Objekttyp,Objecttype
20 changes: 17 additions & 3 deletions src/webfrontend/find-duplicate-field-values.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,25 @@ class FindDublicateFieldValues extends CustomMaskSplitter
newOnClick = (evt, button) ->
# generate content for modal
searchResults = button.opts.searchResults
# if pool, show pool-path, else show objecttype
objecttype = searchResults[0]._objecttype
hasPool = false
if searchResults[0][objecttype]?._pool?._path
hasPool = true
firstRowLabel = $$('fylr-plugin-find-duplicate-field-values.modal.open.pool')
else
firstRowLabel = $$('fylr-plugin-find-duplicate-field-values.modal.open.objecttype')
content = '<table>'
content += '<tr><th>Objekttyp</th><th>ID</th><th>Kurzinfo</th><th>' + $$('fylr-plugin-find-duplicate-field-values.modal.open.link') + '</th></tr>'
content += '<tr><th>' + firstRowLabel + '</th><th>ID</th><th>' + $$('fylr-plugin-find-duplicate-field-values.modal.open.shortinfo_standard') + '</th><th>' + $$('fylr-plugin-find-duplicate-field-values.modal.open.link') + '</th></tr>'
for object in searchResults
content += '<tr>'
content += '<td>' + object._objecttype + '</td>'
if hasPool == false
content += '<td>' + object._objecttype + '</td>'
else
fullPath = []
for pathElem in object[objecttype]._pool._path
fullPath.push pathElem.pool.name[ez5.loca.getLanguage()]
content += '<td>' + fullPath.join(' > ') + '</td>'
content += '<td>' + object._system_object_id + '</td>'
content += '<td>' + object._standard[1].text[ez5.loca.getLanguage()] + '</td>'
link = window.location.origin + '/#/detail/' + object._uuid
Expand Down Expand Up @@ -59,7 +73,7 @@ class FindDublicateFieldValues extends CustomMaskSplitter
type: "POST"
json_data:
limit: 100
format: 'standard'
format: 'full'
generate_rights: false
objecttypes: [objecttype]
search: [
Expand Down

0 comments on commit 7d037f4

Please sign in to comment.