1 # Copyright 2014 - 2019 Paul Hänsch
3 # This file is part of Confetti.
5 # Confetti is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Affero General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # Confetti is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU Affero General Public License for more details.
15 # You should have received a copy of the GNU Affero General Public License
16 # along with Confetti. If not, see <http://www.gnu.org/licenses/>.
21 [legend $(l10n filter_item):]
22 [input type="hidden" name="filter${n}" value="^"]
24 $(for field in any name street zip TEL BDAY CATEGORIES; do
25 printf '[input id="%s%i" type="radio" name="filter%i" value="%s" %s]
26 [label for="%s%i" %s]' \
27 "$field" "$n" "$((n + 1))" "$field" "$([ "$1" = "$field" ] && printf checked )" \
28 "$field" "$n" "$(l10n filter_$field)"
30 [input type="text" name="filter$((n + 2))" value="$([ "$1" = CATEGORIES ] || HTML "$2")" placeholder="$(l10n filter_placeholder)"]
32 $(m=3; list_categories | while read cat; do
33 printf '[label [checkbox "filter%i" "|%s" %s] %s ]' \
34 "$((n + m))" "$(HTML "$cat")" \
35 "$(printf %s "$cat" |grep -qEx "$2" && printf checked )" \
39 [a href="?p=categories" $(l10n edit_categories)]
47 [form .filter action="?action=filter_card" method="POST"
48 [h1 $(l10n filter_label)]
49 [input type="hidden" name="page" value="cards"]
52 n=0; m="$(list_categories |wc -l)"
53 printf '%s\n' "$filter" |tr '^' '\n' \
54 | while read filter; do
55 [ -n "$filter" ] && w_filter_item "${filter%%:*}" "${filter#*:}" "$n"
58 w_filter_item any '' "$n"
61 [fieldset class="order"
62 [legend $(l10n filter_order):]
63 [label [radio "order" "firstname" $( [ "$order" = firstname ] && printf checked )] $(l10n filter_firstname)]
64 [label [radio "order" "lastname" $( [ "$order" = lastname ] && printf checked )] $(l10n filter_lastname)]
65 [label [radio "order" "bdate" $( [ "$order" = bdate ] && printf checked )] $(l10n filter_bdate)]
67 [button type="submit" name="choice" value="new_filter" $(l10n filter_apply)]
68 [button type="submit" name="choice" value="del_filter" $(l10n filter_cancel)]
73 # listcards |grep ${edit:+-v} "$edit" \
74 # | while read card; do
75 # "${_EXEC}"/cgilite/html-sh.sed <<-ENDCARD
77 # $(view_card "$card")[!--
79 # [a "?action=edit_card&card=${card}" .item $(l10n edit)]
80 # [a "?action=export_vcard&card=${card}".item $(l10n vcf_export)]
81 # ${profile_medical:+[a "?action=new_prescription&client=${card}" .item $(l10n new_prescription)]}