X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=pages%2Ftherapy.sh;h=88855151a8fa27ea9b9f03c66694478fba47f043;hp=6127b4dfd5979011f2b94aeb6a9484999185afe2;hb=9d6e65a0055304b62e0b2c9502da3443fb82ad33;hpb=c8980226006bdd5a9d518e7d3221dc3d527be321 diff --git a/pages/therapy.sh b/pages/therapy.sh index 6127b4d..8885515 100755 --- a/pages/therapy.sh +++ b/pages/therapy.sh @@ -29,6 +29,10 @@ tpyfile="$_DATA/therapies/$id" mpxfile="$_DATA/prescriptions/${id%.tpy}.mpx" client="$_DATA/vcard/${id%%.*}.vcf" +identify "$_EXEC/static/therapy_background.png" \ +| sed -r 's;^.* ([0-9]+x[0-9]+) .*$;\1;' \ +| read bg_dim + card_N="$(sed -nr 's:^(N)(;[^"\:]+|;"[^"]+")*\:(.*)$:\3:gp' "$client")" card_FN="$(sed -nr 's:^(FN)(;[^"\:]+|;"[^"]+")*\:(.*)$:\3:gp' "$client")" card_NICK="$(sed -nr 's:^(NICKNAME)(;[^"\:]+|;"[^"]+")*\:(.*)$:\3:gp' "$client")" @@ -42,11 +46,11 @@ client_name="${n:-${card_FN:-${card_NICK}}}" mpx=() cat "$mpxfile" |while read -r line; do val="${line#*:}" - mpx[${line%%:*}]="${val//\\n/$BR}" + mpx[${line%%:*}]="$(htmlsafe "${val//\\n/$BR}")" done tpy=() cat "$tpyfile" |while read -r line; do val="${line#*:}" - tpy[${line%%:*}]="${val//\\n/$BR}" + tpy[${line%%:*}]="$(htmlsafe "${val//\\n/$BR}")" done