From 737e7f91162ec98b99dd2796ca26dd95e8c21f49 Mon Sep 17 00:00:00 2001 From: paul Date: Sun, 17 Nov 2013 19:16:45 +0000 Subject: [PATCH] options for card editor, framework for editing actions svn path=/trunk/; revision=17 --- action.sh | 7 +++++++ index.cgi | 2 +- pages/attendees.sh | 4 +++- templates/attendees.html.sh | 8 ++++++-- templates/edit_attendee.sh | 1 + templates/text_attendee.sh | 6 ++++++ 6 files changed, 24 insertions(+), 4 deletions(-) create mode 100755 action.sh diff --git a/action.sh b/action.sh new file mode 100755 index 0000000..f8fef05 --- /dev/null +++ b/action.sh @@ -0,0 +1,7 @@ +#!/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 diff --git a/index.cgi b/index.cgi index def6da0..277f7ae 100755 --- a/index.cgi +++ b/index.cgi @@ -48,4 +48,4 @@ EOF cgi_get debug "$_GET" -. "$_EXEC/page.sh" +[ -n "$_GET[\"action\"]" ] && . "$_EXEC/action.sh" || . "$_EXEC/page.sh" diff --git a/pages/attendees.sh b/pages/attendees.sh index 1a34b8b..2d06f6b 100755 --- a/pages/attendees.sh +++ b/pages/attendees.sh @@ -28,6 +28,8 @@ listcards() { 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 ' @@ -35,8 +37,8 @@ vcf_parse() { 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; diff --git a/templates/attendees.html.sh b/templates/attendees.html.sh index c97bc46..92e4d91 100644 --- a/templates/attendees.html.sh +++ b/templates/attendees.html.sh @@ -40,10 +40,14 @@ $(listcards |while read card; do id="vcf_$card" if [ "$_GET[\"edit\"]" = "$id" ]; then cat < -
- + $(edit_attendee "$card") +
+

diff --git a/templates/edit_attendee.sh b/templates/edit_attendee.sh index f2acb9f..3d7ad04 100755 --- a/templates/edit_attendee.sh +++ b/templates/edit_attendee.sh @@ -11,6 +11,7 @@ edit_card_item() { ;| *) echo "" + echo "" ;; esac } diff --git a/templates/text_attendee.sh b/templates/text_attendee.sh index 6ce0466..6a90192 100755 --- a/templates/text_attendee.sh +++ b/templates/text_attendee.sh @@ -3,6 +3,7 @@ declare -A item_name 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" @@ -44,6 +45,11 @@ item_name[VERSION]="" 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" -- 2.39.2