]> git.plutz.net Git - confetti/commitdiff
auto complete in attendant fields
authorPaul Hänsch <paul@plutz.net>
Thu, 18 Apr 2024 18:25:04 +0000 (20:25 +0200)
committerPaul Hänsch <paul@plutz.net>
Thu, 18 Apr 2024 18:25:04 +0000 (20:25 +0200)
ledgers/index.cgi

index 7cd3464dfffb9cccf63028a3093a3a29974ab174..87af8b155435e09425c6c25e0004fce8a14593ed 100755 (executable)
@@ -33,6 +33,12 @@ credit() {
     [input type=hidden name=session_id value="%s"]
     [h3 . %s]
   ' "${_BASE}" "$SESSION_ID" "$(l10n "IBAN Assignments")"
+  printf '[datalist id=lattendants .'
+  pdi_load "${_DATA}"/vcard/*.vcf |sed -n '/^FN\;:/!b; s;^FN\;:;;; p;' \
+  | while read name; do
+    printf '[option value="%s"]' "$(HTML "$name")"
+  done
+  printf ']'
   { pdi_load "${_DATA}"/vcard/*.vcf
     cat "${_DATA}"/ledgers/????-??-??\ -\ ????-??-??\ -\ ????.tbl
   } | "${_EXEC}"/ledgers/iban_assign.awk \
@@ -52,7 +58,7 @@ credit() {
       printf '[h4 . %s]' "$(l10n Guesses)"
       for card in $cards; do
         uid="${card%%/*}" name="$(UNSTRING "${card#*/}")"
-        printf '[input .card key="cardfn" value="%s" placeholder="%s"]' "$(HTML "${name}")" "$(l10n attendent)"
+        printf '[input .card key="cardfn" value="%s" placeholder="%s" list=lattendants]' "$(HTML "${name}")" "$(l10n attendent)"
       done
     elif [ $state = unknown ]; then
       principal="${data#*      *       *       }" principal="${principal%%     *}"