new cards function
[confetti] / cards / index.cgi
1 #!/bin/sh
2
3 if [ "$_PATH" = "/cards/cards.css" ]; then
4   . $_EXEC/cgilite/file.sh
5   FILE $_EXEC/cards/cards.css
6   return 0
7 fi
8
9 . $_EXEC/pdiread.sh
10 . $_EXEC/cards/l10n.sh
11 . $_EXEC/cards/widgets.sh
12 . $_EXEC/cards/list.sh
13
14 unescape() { [ $# = 0 ] && sed -E 's;\\(.);\1;g' || printf %s "$*" |sed -E 's;\\(.);\1;g'; }
15 upcase=' y;abcdefghijklmnopqrstuvwxyzäöüé;ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜÉ;; '
16
17 filter="$(GET f)"
18 order="$(GET o)"
19 edit="$(GET e)"
20 [ "$order" ] || order=firstname
21
22 { w_filter_diag
23
24   printf '
25   [form class="newcard" action="/cards/new_card.sh" method="POST"
26     [button type="submit" %s]
27   ]' "$(l10n newcard)"
28
29   [ "$edit" ] && edit_card "$edit"
30   list_cards
31 } | yield_page cards /cards/cards.css