--- /dev/null
+#!/bin/zsh
+
+cgi_refdata
+
+card="$_GET[\"card\"]"
+debug card: $card
+filter="&filter=$_REF[\"filter\"]"
+filtertype="&filtertype=$_REF[\"filtertype\"]"
+order="&order=$_REF[\"order\"]"
+
+echo -n "Location: http://$HTTP_HOST/?page=attendees${filter}${filtertype}${order}&edit=$card\n\n"
#!/bin/zsh
cgi_post
+cgi_refdata
+
+filter="&filter=$_REF[\"filter\"]"
+filtertype="&filtertype=$_REF[\"filtertype\"]"
+order="&order=$_REF[\"order\"]"
uid=$(dbus-uuidgen)
card="${uid}.vcf"
END:VCARD
EOF
-echo -n "Location: http://$HTTP_HOST/?page=attendees&edit=$card\n\n"
+echo -n "Location: http://$HTTP_HOST/?page=attendees${filter}${filtertype}${order}&edit=$card\n\n"
#!/bin/zsh
cgi_post
+cgi_refdata
+
+filter="&filter=$_REF[\"filter\"]"
+filtertype="&filtertype=$_REF[\"filtertype\"]"
+order="&order=$_REF[\"order\"]"
card="$_POST[\"card\"]"
tempfile="temp/$card"
addfield)
echo "$_POST[\"newfield\"]:\r" >>"$tempfile"
echo "END:VCARD\r" >>"$tempfile"
- echo -n "Location: http://$HTTP_HOST/?page=attendees&edit=$card\n\n"
+ echo -n "Location: http://$HTTP_HOST/?page=attendees${filter}${filtertype}${order}&edit=$card\n\n"
;;
update)
echo "END:VCARD\r" >>"$tempfile"
mv "$tempfile" "$cardfile"
- echo -n "Location: http://$HTTP_HOST/?page=attendees#$card\n\n"
+ echo -n "Location: http://$HTTP_HOST/?page=attendees${filter}${filtertype}${order}#$card\n\n"
;;
cancel)
rm "$tempfile"
[ -f "$cardfile" ] \
- && echo -n "Location: http://$HTTP_HOST/?page=attendees#$card\n\n" \
- || echo -n "Location: http://$HTTP_HOST/?page=attendees\n\n"
+ && echo -n "Location: http://$HTTP_HOST/?page=attendees${filter}${filtertype}${order}#$card\n\n" \
+ || echo -n "Location: http://$HTTP_HOST/?page=attendees${filter}${filtertype}${order}\n\n"
;;
delete)
rm "$tempfile" "$cardfile"
- echo -n "Location: http://$HTTP_HOST/?page=attendees\n\n"
+ echo -n "Location: http://$HTTP_HOST/?page=attendees${filter}${filtertype}${order}\n\n"
;;
esac
declare -A _GET
declare -A _POST
+declare -A _REF
cgi_get() { # parse HTTP GET string
echo "$QUERY_STRING" |tr '&' '\n' |while read query; do
fi
done
}
+
+cgi_refdata() { # Parse GET data from referer
+ echo "$HTTP_REFERER" |cut -d'?' -f2- |tr '&' '\n' |while read query; do
+ key="$(echo "$query" |sed -r 's:^([a-zA-Z0-9_-]*)=(.*)$:\1:')"
+ val="$(echo "$query" |sed -r 's:^([a-zA-Z0-9_-]*)=(.*)$:\2:')"
+ _REF["$key"]="$(echo -e "$(echo "$val" |sed 's:+: :g;s:%:\\x:g')")"
+ done
+}
echo ' </div>'
echo ''
echo ' <div class="section control">'
-echo ' <a class="item control" href="?page=attendees&edit='${id}'">'$(l10n edit)'</a>'
+echo ' <a class="item control" href="?action=edit_attendee&card='${id}'">'$(l10n edit)'</a>'
echo ' <a class="item control" href="?export=vcard&card='${id}'">'$(l10n vcf_export)'</a>'
echo ' </div>'
echo '</div>'