--- /dev/null
+#!/bin/zsh
+
+ACTION="$(echo "$_GET[\"action\"]" |egrep '^[a-zA-Z0-9_-]+$')"
+ACTION="${_EXEC}/actions/${ACTION}.sh"
+[ -x "$ACTION" ] || echo -n "Location: http://$HTTP_HOST/?page=error"
+
+. $ACTION
cgi_get
debug "$_GET"
-. "$_EXEC/page.sh"
+[ -n "$_GET[\"action\"]" ] && . "$_EXEC/action.sh" || . "$_EXEC/page.sh"
esac
}
+FIELDLIST="$(echo PHOTO LOGO FN NICKNAME SOUND GENDER KIND TITLE ROLE ORG MEMBER CATEGORIES ANNIVERSARY BDAY EMAIL TEL IMPP ADR URL LANG NOTE RELATED |tr ' ' '\n')"
+
vcf_parse() {
tr -d '\n' <"$1" |sed -r 's:\r ::g;s:\r:\n:g' \
| sed -rn '
s:^X-MS-CARDPICTURE:001 PHOTO:p;
s:^LOGO:002 LOGO:p;
s:^FN:003 FN:p;
- s:^NICKNAME:005 NICKNAME:p;
s:^N:004 N:p
+ s:^NICKNAME:005 NICKNAME:p;
s:^SOUND:006 SOUND:p;
s:^GENDER:007 GENDER:p;
s:^X-GENDER:007 GENDER:p;
id="vcf_$card"
if [ "$_GET[\"edit\"]" = "$id" ]; then cat <<x_EOF
<div id="${id}" class="card">
- <form action="/?page=attendees#${id}" method="POST">
- <input type="hidden" name="page" value="attendees"/>
+ <form action="/?action=update_attendee" method="POST">
<input type="hidden" name="card" value="${id}"/>
$(edit_attendee "$card")
+ <br /><select name="newfield">
+ <option value="" disabled="disabled" selected="selected">$(l10n edit_addfieldtext)</option>
+ $(echo $FIELDLIST |while read f; do echo "<option value=\"$f\">$(l10n $f)</option>"; done)
+ </select>
+ <button type="submit" name="action" value="addfield">$(l10n edit_addfield)</button>
<br /><button type="submit" name="action" value="update">$(l10n edit_update)</button>
<br /><button type="submit" name="action" value="cancel">$(l10n edit_cancel)</button>
</form>
;|
*)
echo "<input class=\"VALUE\" name=\"$key\" value=\"$value\" /></item>"
+ echo "<button name=\"deletefield\" value=\"$key $value\">$(l10n edit_deletefield)</button>"
;;
esac
}
item_name[PHOTO]="Foto"
item_name[LOGO]="Logo"
item_name[FN]="Voller Name"
+item_name[NICKNAME]="Spitzname"
item_name[SOUND]="Aussprache"
item_name[GENDER]="Geschlecht"
item_name[KIND]="Typ"
item_name[XML]=""
item_name[edit]="Bearbeiten"
+item_name[edit_update]="Daten Übernehmen"
+item_name[edit_cancel]="Abbrechen"
+item_name[edit_addfieldtext]="Feld hinzufügen"
+item_name[edit_addfield]="+"
+item_name[edit_deletefield]="X"
item_name[filter_all]="Alles"
item_name[filter_name]="Name"
item_name[filter_street]="Straße"