X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;f=therapies%2Findex.cgi;h=515f2b0265308042562f291f0a93a61ad7af6d2f;hb=b67065bfb57b072dd1c344eedabfbb545eae6629;hp=62b621d45e5eaf7d8a1393476d5d06a8012e851e;hpb=993c5a9ed5aead587f52ba129e7978d10dafe2c4;p=lobster diff --git a/therapies/index.cgi b/therapies/index.cgi index 62b621d..515f2b0 100755 --- a/therapies/index.cgi +++ b/therapies/index.cgi @@ -30,18 +30,21 @@ case "$_PATH" in fi return 0 ;; + /therapies/*/new) + card="${_PATH#/therapies/}" + card="${card%/new}" + uid="$(timeid)$(randomid)" + if [ -f "${_DATA}/vcard/${card}.vcf" ]; then + touch "${_DATA}/therapies/${card}.${uid}.tpy" + rm -f "${_DATA}/cache/${card}.vcf.cache" + REDIRECT "/therapies/${card}/${uid}" + fi + return 0 + ;; esac . $_EXEC/pdiread.sh . $_EXEC/therapies/l10n.sh -# . $_EXEC/cards/widgets.sh -# . $_EXEC/cards/list.sh - -# unescape() { [ $# = 0 ] && sed -E 's;\\(.);\1;g' || printf %s "$*" |sed -E 's;\\(.);\1;g'; } -# upcase=' y;abcdefghijklmnopqrstuvwxyzäöüé;ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜÉ;; ' - -BR=' -' id="${_PATH#/therapies/}" id="${id%/*}.${id#*/}" @@ -55,12 +58,12 @@ mpxfile="${_DATA}/prescriptions/${id}.mpx" tpyfile="${_DATA}/therapies/${id}.tpy" vcf="$(pdi_load "$vcffile")" -mpx="$(sed '1s;^;\n;; s/:/;:/' "$mpxfile")" +mpx="$([ -f "$mpxfile" ] && sed '1s;^;\n;; s/:/;:/' "$mpxfile")" tpy="$(sed '1s;^;\n;; s/:/;:/' "$tpyfile")" VCF(){ pdi_value "$vcf" "$@"; } MPX(){ pdi_value "$mpx" "$@"; } -TPY(){ pdi_value "$tpy" "$@"; } +TPY(){ pdi_value "$tpy" "$@" >/dev/null && pdi_value "$tpy" "$@" |pdi_unescape; } . $_EXEC/therapies/page.sh \ | yield_page therapy /therapies/therapy.css