. $_EXEC/pdiread.sh
. $_EXEC/therapies/l10n.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#*/}"
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
# You should have received a copy of the GNU Affero General Public License
# along with Confetti. If not, see <http://www.gnu.org/licenses/>.
-BR='
-'
+. "$_EXEC/pdiread.sh"
tpy=$(POST id)
tpyfile="$_DATA/therapies/${tpy}.tpy"
# serialize POST array into file
for key in $(POST_KEYS); do
case "$key" in
- imagedata) true ;;
+ imagedata) : ;;
session*_date)
- value="$(POST "$key" |sed ':X;N;$!bX; s;\n;\\n;g;')"
+ value="$(POST "$key")"
y=0 mon=0 dom=0
case $value in
*.*.*) IFS=. read dom mon y <<-END
date -d "${y}-${mon}-${dom}" + && printf %s:%s\\n "$key" "$(date -d "${y}-${mon}-${dom}" +%F)" \
|| printf %s:\\n "$key"
;;
- *) printf %s:%s\\n "$key" "$(POST "$key" |sed ':X;N;$!bX; s;\n;\\n;g;')" ;;
+ *) printf %s:%s\\n "$key" "$(pdi_escape "$(POST "$key")")" ;;
esac
done >"$tempfile" 2>&-