]> git.plutz.net Git - lobster/blob - therapies/index.cgi
8512410fbeabf84f2cc96ef0256e7700b5f03e13
[lobster] / therapies / index.cgi
1 #!/bin/sh
2
3 # Copyright 2016, 2020 Paul Hänsch
4 #
5 # This file is part of Lobster.
6
7 # Lobster is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU Affero General Public License as published by
9 # the Free Software Foundation, either version 3 of the License, or
10 # (at your option) any later version.
11
12 # Lobster is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU Affero General Public License for more details.
16
17 # You should have received a copy of the GNU Affero General Public License
18 # along with Lobster.  If not, see <http://www.gnu.org/licenses/>. 
19
20 if [ "$_PATH" = "/therapies/therapy.css" ]; then
21   . $_EXEC/cgilite/file.sh
22   FILE $_EXEC/therapies/therapy.css
23   return 0
24 fi
25
26 . $_EXEC/pdiread.sh
27 . $_EXEC/therapies/l10n.sh
28 # . $_EXEC/cards/widgets.sh
29 # . $_EXEC/cards/list.sh
30
31 # unescape() { [ $# = 0 ] && sed -E 's;\\(.);\1;g' || printf %s "$*" |sed -E 's;\\(.);\1;g'; }
32 # upcase=' y;abcdefghijklmnopqrstuvwxyzäöüé;ABCDEFGHIJKLMNOPQRSTUVWXYZÄÖÜÉ;; '
33
34 BR='
35 '
36
37 id="${_PATH#/therapies/}"
38 id="${id%/*}.${id#*/}"
39 vcffile="${_DATA}/vcard/${id%.*}.vcf"
40 mpxfile="${_DATA}/prescriptions/${id}.mpx"
41 tpyfile="${_DATA}/therapies/${id}.tpy"
42
43 read junkx junky bg_dim junkz <<-E_READ
44         $(identify "$_EXEC/therapies/therapy_background.png")
45 E_READ
46
47 vcf="$(pdi_load "$vcffile")"
48 mpx="$(pdi_load "$mpxfile")"
49 tpy="$(pdi_load "$tpyfile")"
50
51 . $_EXEC/therapies/page.sh |yield_page therapy /therapies/therapy.css