filtertype="&filtertype=${_REF[filtertype]}"
order="&order=${_REF[order]}"
-echo -n "Location: ?p=attendees${filter}${filtertype}${order}&edit=$card\n\n"
+echo -n "Location: ?p=cards${filter}${filtertype}${order}&edit=$card\n\n"
filter="${_POST[filter]}"
filtertype="${_POST[filtertype]}"
order="${_POST[order]}"
- echo -n "Location: ?p=attendees&filter=$filter&filtertype=$filtertype&order=$order\n\n"
+ echo -n "Location: ?p=cards&filter=$filter&filtertype=$filtertype&order=$order\n\n"
;;
*)
- echo -n "Location: ?p=attendees\n\n"
+ echo -n "Location: ?p=cards\n\n"
;;
esac
[ -z "$fromdate" ] && fromdate=$(date +%s)
. ${_EXEC}/pages/courses.sh loadfunctions
-. ${_EXEC}/pages/attendees.sh loadfunctions
+. ${_EXEC}/pages/card.sh loadfunctions
tex_clean() { #in dire need for improvement
echo "$*" |tr -d '{&}\'
END:VCARD
EOF
-echo -n "Location: ?p=attendees${filter}${filtertype}${order}&edit=$card\n\n"
+echo -n "Location: ?p=cards${filter}${filtertype}${order}&edit=$card\n\n"
addfield)
echo "${_POST[newfield]}:\r" >>"$tempfile"
echo "END:VCARD\r" >>"$tempfile"
- echo -n "Location: ?p=attendees${filter}${filtertype}${order}&edit=$card\n\n"
+ echo -n "Location: ?p=cards${filter}${filtertype}${order}&edit=$card\n\n"
;;
update)
attendance=()
echo "END:VCARD\r" >>"$tempfile"
mv "$tempfile" "$cardfile"
- echo -n "Location: ?p=attendees${filter}${filtertype}${order}#$card\n\n"
+ echo -n "Location: ?p=cards${filter}${filtertype}${order}#$card\n\n"
;;
cancel)
rm "$tempfile"
[ -f "$cardfile" ] \
- && echo -n "Location: ?p=attendees${filter}${filtertype}${order}#$card\n\n" \
- || echo -n "Location: ?p=attendees${filter}${filtertype}${order}\n\n"
+ && echo -n "Location: ?p=cards${filter}${filtertype}${order}#$card\n\n" \
+ || echo -n "Location: ?p=cards${filter}${filtertype}${order}\n\n"
;;
delete)
rm "$tempfile" "$cardfile"
- echo -n "Location: ?p=attendees${filter}${filtertype}${order}\n\n"
+ echo -n "Location: ?p=cards${filter}${filtertype}${order}\n\n"
;;
esac
#!/bin/zsh
-# Copyright 2014,2015 Paul Hänsch
+# Copyright 2014 - 2016 Paul Hänsch
#
# This file is part of Confetti.
#
# along with Confetti. If not, see <http://www.gnu.org/licenses/>.
export LC_ALL=de_DE.UTF-8
-data_dirs vcard ical cache temp mappings
+PROFILE=$(validate "$PROFILE" 'medical|circus' circus )
-VCF_FIELDS=(PHOTO LOGO FN NICKNAME SOUND GENDER KIND TITLE ROLE ORG MEMBER CATEGORIES ANNIVERSARY BDAY EMAIL TEL IMPP ADR URL LANG NOTE RELATED X-ZACK-JOINDATE X-ZACK-LEAVEDATE)
-
-[ -z "$NAVIGATION" ] && NAVIGATION=(attendees courses)
PAGE="${_GET[p]:-$PAGE}"
uuidgenerator(){
head -c16 /dev/urandom |sha1sum - |cut -c1-32
}
+
+VCF_FIELDS=(PHOTO LOGO FN NICKNAME SOUND GENDER KIND TITLE ROLE ORG MEMBER CATEGORIES ANNIVERSARY BDAY EMAIL TEL IMPP ADR URL LANG NOTE RELATED X-ZACK-JOINDATE X-ZACK-LEAVEDATE)
+
+case "${PROFILE}" in
+medical)
+;;
+circus)
+ data_dirs vcard ical cache temp mappings
+ [ -z "$NAVIGATION" ] && NAVIGATION=(cards courses)
+;;
+esac
#!/bin/zsh
-# Copyright 2014, 2015 Paul Hänsch
+# Copyright 2014 - 2016 Paul Hänsch
#
# This file is part of Confetti.
#
| sed -r 's:[\\$`]:\\&:g'
}
-view_attendee() { #Parameter: Cardfile
+view_card() { #Parameter: Cardfile
id="$1"
cardfile="$_DATA/vcard/${id}"
cachefile="$_DATA/cache/${id}.cache"
;;
esac
done
- . ${_EXEC}/templates/view_attendee.sh |tee "$cachefile"
+ . $view_card |tee "$cachefile"
fi
}
-edit_attendee() { #Parameter: Cardfile
+edit_card() { #Parameter: Cardfile
id="$1"
cardfile="$_DATA/vcard/$id"
tempfile="$_DATA/temp/$id"
;;
esac
done
- . ${_EXEC}/templates/edit_attendee.sh
+ . $edit_card
}
-# Copyright 2014 Paul Hänsch
+# Copyright 2014 - 2016 Paul Hänsch
#
# This file is part of Confetti.
#
}
edit="${_GET[edit]}"
+[ \! -f "vcard/$edit" -a \! -f "temp/$edit" ] && edit=''
[ -z "${_GET[filtertype]}" ] && _GET[filtertype]="any"
[ -z "${_GET[order]}" ] && _GET[order]="firstname"
cat <<EOF
-<form class="filter" action="?action=filter_attendee" method="POST">
+<form class="filter" action="?action=filter_card" method="POST">
<h1>$(l10n filter_label)</h1>
- <input type="hidden" name="page" value="attendees"/>
+ <input type="hidden" name="page" value="cards"/>
<input type="text" name="filter" value="$_GET["filter"]" placeholder="$(l10n filter_placeholder)"/>
<br />
<fieldset>
<button type="submit" name="choice" value="del_filter">$(l10n filter_cancel)</button>
</form>
-<form class="newcard" action="?action=new_attendee" method="POST">
+<form class="newcard" action="?action=new_card" method="POST">
<button type="submit">$(l10n newcard)</button>
</form>
+${edit:+$(edit_card "$edit")}
+
$(
-[ -f "vcard/$edit" -o -f "temp/$edit" ] && edit_attendee "$edit"
-if [ "$?" = 0 ]; then
- listcards |grep -v "$edit"
-else
- listcards
-fi |while read card; do
- view_attendee "$card"
-done
+ listcards |grep ${edit:+-v} "$edit" \
+ | while read card; do
+ cat <<-ENDCARD
+ <div id="${card}" class="card">
+ $(view_card "$card")<!--
+ --><div class="control">
+ <a class="item" href="?action=edit_card&card=${card}">$(l10n edit)</a>
+ <a class="item" href="?action=export_vcard&card=${card}">$(l10n vcf_export)</a>
+ </div>
+ </div>
+ ENDCARD
+ done
)
EOF
--- /dev/null
+case $PROFILE in
+medical)
+;;
+circus)
+ . ${0%/*}/attendees.css.sh
+;;
+esac
--- /dev/null
+case $PROFILE in
+medical)
+;;
+circus)
+ view_card=${0%/*}/view_attendee.sh
+ edit_card=${0%/*}/edit_attendee.sh
+ . ${0%/*}/attendees.html.sh
+;;
+esac
-# Copyright 2014 - 2015 Paul Hänsch
+# Copyright 2014 - 2016 Paul Hänsch
#
# This file is part of Confetti.
#
# You should have received a copy of the GNU Affero General Public License
# along with Confetti. If not, see <http://www.gnu.org/licenses/>.
-. ${_EXEC}/templates/text_attendee.sh
+. ${_EXEC}/templates/text_cards.sh
echo -E '
\documentclass[landscape,10pt]{article}
[ -z "$values[UID]" ] && values[UID]="$(uuidgenerator)"
cat <<END_HTML
-<form id="$id" class="card" action="?action=update_attendee" method="POST">
+<form id="$id" class="card" action="?action=update_card" method="POST">
<input type="hidden" name="card" value="${id}"/>
<div class="section basic">
<h3>$(l10n N)</h3>
item_name[male]="♂"
item_name[other]="⚥"
item_name[none]="⚪"
-
-l10n() {
- [ -n "$item_name[$1]" ] && echo -n "$item_name[$1]" || echo -n "$1"
-}
-# Copyright 2014, 2015 Paul Hänsch
+# Copyright 2014 - 2016 Paul Hänsch
#
# This file is part of Confetti.
#
# You should have received a copy of the GNU Affero General Public License
# along with Confetti. If not, see <http://www.gnu.org/licenses/>.
-declare -A item_name
-
-item_name[p_attendees]="Teilnehmende"
+item_name[p_cards]="Teilnehmende"
item_name[p_courses]="Kurse"
item_name[p_email]="Email"
item_name[p_error]="Fehler"
-
-l10n() {
- [ -n "$item_name[$1]" ] && echo -n "$item_name[$1]" || echo -n "$1"
-}
# along with Confetti. If not, see <http://www.gnu.org/licenses/>.
cat <<END_HTML
-<div id="${id}" class="card">
<div class="section basic">
<h2 class="item FN">$values[FN]</h2>
${values[GENDER]:+<span class="item GENDER">$(l10n $values[GENDER])</span>}
echo ' <li><a class="item attendance" href="?p=courses#'$each'">'$cname'</a></li>'
done)
</ul>
- </div><!--
-
- --><div class="control">
- <a class="item" href="?action=edit_attendee&card=${id}">$(l10n edit)</a>
- <a class="item" href="?action=export_vcard&card=${id}">$(l10n vcf_export)</a>
</div>
-</div>
END_HTML
echo ' <div class="section attendance">'
echo ' <h3>'$(l10n course_attendance)'</h3>'
-list_attendance "$id" |sort -k 2 |sed -r 's:^([^ ]+) (.*)$:<a class="attendance" href="?p=attendees#\1">\2</a>:'
+list_attendance "$id" |sort -k 2 |sed -r 's:^([^ ]+) (.*)$:<a class="attendance" href="?p=cards#\1">\2</a>:'
echo ' </div>'
echo ' <div class="control">'