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/>.
19 grep -vxE '^[ ]*$' "${_DATA}/mappings/categories"
26 [legend $(l10n filter_item):]
28 $(for field in any name street zip TEL BDAY CATEGORIES; do
29 printf '[input id="%s%i" type="radio" name="filter_type%i" value="%s" %s]
30 [label for="%s%i" %s ]' \
31 "$field" "$n" "$n" "$field" "$([ "$1" = "$field" ] && printf checked )" \
32 "$field" "$n" "$(l10n filter_$field)"
34 [input type="text" name="filter_text$n" value="$([ "$1" = CATEGORIES ] || HTML "$2")" placeholder="$(l10n filter_placeholder)"]
36 $(list_categories | while read cat; do
37 printf '[label [checkbox "filter_cat%i" "|%s" %s] %s ]' \
38 "$n" "$(HTML "$cat")" \
39 "$(printf %s "$cat" |grep -qxEe "$2" && printf checked )" \
42 [a href="?p=categories" $(l10n edit_categories)]
50 [form .filter action="?action=filter_card" method="POST"
51 [h1 $(l10n filter_label)]
52 [input type="hidden" name="page" value="cards"]
54 $(n=0; filter="${filter}^"
55 while [ "${filter#^}" ]; do
56 fil="${filter%%^*}" filter="${filter#*^}"
57 w_filter_item "${fil%%:*}" "${fil#*:}" $n
60 w_filter_item any '' $n
63 [fieldset class="order"
64 [legend $(l10n filter_order):]
65 [label [radio "order" "firstname" $( [ "$order" = firstname ] && printf checked )] $(l10n filter_firstname)]
66 [label [radio "order" "lastname" $( [ "$order" = lastname ] && printf checked )] $(l10n filter_lastname)]
67 [label [radio "order" "bdate" $( [ "$order" = bdate ] && printf checked )] $(l10n filter_bdate)]
69 [button type="submit" name="choice" value="new_filter" $(l10n filter_apply)]
70 [button type="submit" name="choice" value="del_filter" $(l10n filter_cancel)]
75 # listcards |grep ${edit:+-v} "$edit" \
76 # | while read card; do
77 # "${_EXEC}"/cgilite/html-sh.sed <<-ENDCARD
79 # $(view_card "$card")[!--
81 # [a "?action=edit_card&card=${card}" .item $(l10n edit)]
82 # [a "?action=export_vcard&card=${card}".item $(l10n vcf_export)]
83 # ${profile_medical:+[a "?action=new_prescription&client=${card}" .item $(l10n new_prescription)]}