From: Paul Hänsch Date: Sat, 6 Feb 2021 22:45:45 +0000 (+0100) Subject: remove obsolete sections X-Git-Url: https://git.plutz.net/?p=confetti;a=commitdiff_plain;h=90700bf240004c560fa10940d3a0fcef0d4ffbcc remove obsolete sections --- diff --git a/email/email.css b/email/email.css deleted file mode 100644 index e935189..0000000 --- a/email/email.css +++ /dev/null @@ -1,157 +0,0 @@ -/* -# Copyright 2014 Paul Hänsch -# -# This file is part of Confetti. -# -# Confetti is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Confetti is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with Confetti. If not, see . -*/ - -.filter { - display: block; - width: 128ex; - border-width: 1px; - border-style: solid; - border-radius: 4px 4px 0 0; - margin: .5em auto .25em auto; - padding: .25em 1ex .25em 1ex; - background: #EFF; -} - -.filter > .label { - display: block; - font-weight: bold; - font-size: 1.2em; - border-style: none none solid none; - border-width: 1px; - margin: 0em 0ex .5em 0ex; - background: #EEF; -} - -.filter .search { - margin: 0em 2ex .5em 2ex; -} -.filter .search .label { - display: inline-block; - width: 12ex; - font-weight: bold; - margin-top: .5em; -} -.filter .search input[type="radio"] { - margin-top: .5em; - margin-left: 1ex; -} -.filter .search button { - margin-top: .5em; -} - -.filter .search input[type="text"] { - width: 124ex; -} - -.newcard { - display: block; - width: 126ex; - border-width: 1px; - border-style: solid; - border-radius: 0 0 4px 4px; - margin: .25em auto 1em auto; - padding: .25em 2ex .25em 2ex; - background: #EFF; -} - -.cardlist .card { - display: block; - width: 130ex; - border-style: solid; - border-width: 1px; - margin: .25em auto; - padding: 0; - overflow: auto; - background: #FFF; -} - -.cardlist .card .section { - display: inline-block; - float:left; - width: 20ex; - margin: .125em .25ex .5ex .25ex; - padding: 0 .2em .2em .2em; - background: #EEE; -} -.cardlist .card .section a.attendance { - display: inline-block; - margin-right: 1ex; - word-wrap: break-word; -} - -.cardlist .card .attendance { - width: 83.5ex; -} -.cardlist .card .attendance .check { - display: inline-block; - width: 27ex; -} - -.cardlist .card .control { - float: right; - text-align: right; - margin-right: 0; - background: #EEF; -} -.cardlist .card .control .item { - color: #008; - margin-top: .2em; - margin-right: 1ex; -} -.cardlist .card .control a.item { - min-width: 10ex; - border-style: solid double solid solid; - border-width: 1px 3px 1px 1px; - border-color: #000; - padding: .1em 1ex; - background: #FFF; -} -.cardlist .card .control a.item:hover{ - border-width: 1px 1px 1px 1px; -} - -.cardlist .card .section .sectitle { - display: block; - font-weight: bold; - margin: .2em .2em .2em .2em; -} - -.cardlist .card .section .item { - display: block; - max-width: 20ex; - word-wrap: break-word; -} - -.cardlist .card .section textarea.NOTE { - min-height: 6em; -} -.cardlist .card .section textarea.ADR { - min-height: 4em; -} - -.cardlist .card .section .PHOTO { - width: 20ex; - max-heigth: 30ex; -} - -.cardlist .card .section .FN { - font-weight: bold; - font-size: 1.2em; -} - diff --git a/email/email.html.sh b/email/email.html.sh deleted file mode 100755 index 7f93893..0000000 --- a/email/email.html.sh +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright 2014 Paul Hänsch -# -# This file is part of Confetti. -# -# Confetti is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Confetti is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with Confetti. If not, see . - -cat < - $(l10n filter_label) - - - -
-
-EOF - -# vi:set filetype=html: diff --git a/email/email.sh b/email/email.sh deleted file mode 100755 index c79876f..0000000 --- a/email/email.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/zsh - -# Copyright 2014 Paul Hänsch -# -# This file is part of Confetti. -# -# Confetti is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Confetti is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with Confetti. If not, see . - -[ -z "${_GET[order]}" ] && _GET[order]=DOW - -listcards() { - ls -1 ${_DATA}/vcard/*vcf 2>/dev/null |while read file; do - fn=$(sed -rn 's:^N(;.+)*\:([^;]*;){1} *([^;]*).*$:\3:p' "$file") - echo "$fn\t$file" - done |sort |sed -r 's:^.*\t(.*/)([^/]+)$:\2:' -} - -listcourses() { - ls -1 ${_DATA}/ical/*ics |while read file; do - icstime="$(sed -rn 's:^DTSTART\:(TZID=.*\:)?([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2})([0-9]{2})([0-9]{2})Z?\r$:\2-\3-\4 \5\:\6\:\7:p' "$file")" - echo "$(date -d "$icstime" "+%u %H%M%S")\t$file" - done |sort |sed -r 's:^.*\t(.*/)([^/]+)$:\2:' -} diff --git a/prescriptions/edit_prescription.sh b/prescriptions/edit_prescription.sh deleted file mode 100755 index b7a9af4..0000000 --- a/prescriptions/edit_prescription.sh +++ /dev/null @@ -1,175 +0,0 @@ -# Copyright 2016 Paul Hänsch -# -# This file is part of Confetti. -# -# Confetti is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Confetti is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with Confetti. If not, see . - -check(){ [ "$1" = "$2" ] && printf checked} -[ -z $mpx[presctype] ] && mpx[presctype]=doctor_compulsory - -cat < - - - - - - - - - -
- - - - - - - - -
- - - - -
- - - - - - -
- -
- - -
- - -
- - - -
- - -
- -
-

$(l10n therapy_prescription)

- - - - - - - -
- - - - -
-

$(l10n prescription_by_catalogue)

- - -
- - -
- - -
- - -
- - - -
- - -
- - -
- - -
- -
- - - -

- - - -

- -$( for n in {0..10}; do - if [ "$n" -eq 0 -o -n "${mpx[quantity$n]}" -o -n "${mpx[remidy$n]}" -o -n "${mpx[quantity_weekly$n]}" ]; then - printf '' - else - printf '' - fi - printf '

- - - -

- ' "$(l10n quantity)" "${mpx[quantity$n]}" \ - "$(l10n remidy)" "${mpx[remidy$n]}" \ - "$(l10n quantity_weekly)" "${mpx[quantity_weekly$n]}" -done ) - -
-

- - -
- - -

-
-

- - -

-
-

- - - - -

-
- -
- - - -
- - -END_HTML diff --git a/prescriptions/new_prescription.sh b/prescriptions/new_prescription.sh deleted file mode 100755 index 26173af..0000000 --- a/prescriptions/new_prescription.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/zsh - -# Copyright 2016 Paul Hänsch -# -# This file is part of Confetti. -# -# Confetti is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Confetti is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with Confetti. If not, see . - -cgi_refdata - -client="${_POST[client]:-${_GET[client]}}" - -uid=$(uuidgenerator) -prescription="${client%.vcf}.${uid}.mpx" - -cardfile="$_DATA/vcard/$client" -tempfile="$_DATA/temp/$prescription" - -cat >"$tempfile" <. -*/ - -@import url("?static=cards.css"); - -body {padding-bottom: 3em; } - -.trailbtn { display: none; } -.trailbtn + .trailbox { display: none; } -.trailbtn:checked + .trailbox { display: inline-block; } -.trailbtn:checked + .trailbox + .trailbtn { display: block; } -.trailbtn:checked + .trailbox + .trailbtn:before { - display: block; content: '+'; - width: 3ex; text-align: center; - margin-top: .25em; padding: .25em 0; - background-color: #FFF; - border-width: 1px; border-style: solid; -} -.trailbtn:checked + .trailbox + .trailbtn:checked, -.trailbtn:checked { display: none; } - -.prescription { - display: inline-block; - width: 96%; max-width: 460px; - color: #800; - background-color: #DDD; - margin: 1em -1% 0 2%; padding: 0; - border: 1px solid #888; - overflow: hidden; - vertical-align: top; -} -form.prescription { padding-top: 1ex;} - -.newprescription { - display: block; - margin: 0 2em; padding: .5ex 2ex; - background-color: #CFF; - border: 1px solid #888; - border-radius: 0 0 1ex 1ex; -} - -.prescription * { - display: inline-block; - font-size: 1em; - line-height: 1em; - margin: 0; padding: 0; -} -.prescription label { - padding-left: .5ex; - font-size: .75em; -} - -.prescription fieldset { - display: inline-block; - margin: 0; padding: 1ex; - margin-right: -.625ex; - border: none; - vertical-align: top; -} -.prescription fieldset br { display: none;} - -.prescription span, -.prescription input, -.prescription textarea { - height: 1.5em; - border: 1px solid #800; - padding: .25ex; - background-color: #FFF; -} -.prescription span { - background-color: #EEE; - padding: .5ex .25ex; - white-space: pre-wrap; - font-size: .75em; - overflow: hidden; -} - -.prescription input[type=checkbox], -.prescription input[type=radio] { display: none;} - -.prescription label.checkbox, -.prescription label.radio, -.prescription input[type=checkbox] + label, -.prescription input[type=radio] + label { padding-left: 1.25em; font-size: 1em;} - -.prescription label.checkbox:before, -.prescription label.radio:before, -.prescription input[type=checkbox] + label:before, -.prescription input[type=radio] + label:before { - display: inline-block; - position: absolute; - margin-left: -1.25em; - width: .75em; height: .75em; - background-color: #FFF; - border: 1px solid #800; - content: ' '; -} -.prescription label.radio:before, -.prescription input[type=radio] + label:before { border-radius: .5em;} -.prescription label.checkbox.checked:before, -.prescription label.radio.checked:before, -.prescription input[type=checkbox]:checked + label:before, -.prescription input[type=radio]:checked + label:before { content: "\2713";} - -.prescription a.button, -.prescription input[type=submit], -.prescription button { - height: 1.5em; - color: #FFF; - background-color: #800; - text-align: center; - text-decoration: none; - margin: 0; padding: .125em 0 0 0; - border: none; -} -.prescription a.button {padding: .5ex;} - -/* ======== Specific ========== */ - -.prescription label.presctype, -.prescription input[name=presctype] + label { - font-size: medium; - width: 22%; - margin: 0; margin-right: -.5ex; - vertical-align: top; - padding: .25em .5ex .25em 3ex; - height: 2.5em; - border-top: 1px solid #DDD; -} -.prescription label.presctype { - text-align: right; - font-weight: bold; - font-size: .875em; - padding-right: 1ex; - padding-left: 0; -} - -input[name=presctype][value\$=private]:checked ~ fieldset, - input[name=presctype][value\$=private] + label, - .prescription.private { background-color: #CFC;} -input[name=presctype][value\$=selfpaid]:checked ~ fieldset, - input[name=presctype][value\$=selfpaid] + label, - .prescription.selfpaid { background-color: #FFC;} -input[name=presctype][value=doctor_compulsory]:checked ~ fieldset, - input[name=presctype][value=doctor_compulsory] + label, - .prescription.doctor.compulsory { background-color: #CFF;} -input[name=presctype][value=dentist_compulsory]:checked ~ fieldset, - input[name=presctype][value=dentist_compulsory] + label, - .prescription.dentist.compulsory { background-color: #FCC;} -input[name=presctype][value^=altpractition]:checked ~ fieldset, - input[name=presctype][value^=altpractition] + label, - .prescription.altpractition { background-color: #FCF;} - -.prescription .baseinfo { width: 60%;} - - .baseinfo label[for=insurance], - .baseinfo #insurance { width: 100%; } - - .baseinfo label[for=name], - .baseinfo #name { width: 65%; margin-right: -.875ex;} - .baseinfo #name { height: 4em; } - - .baseinfo label[for=bday], - .baseinfo #bday { width: 35%;} - .baseinfo #bday { height: 4em; text-align: center; vertical-align: top;} - - .baseinfo label[for=date], - .baseinfo #date { width: 34%; margin-left: 65%;} - .baseinfo #date { text-align: right;} - -.prescription .misc { width: 40%; } - - .misc h1 { - font-size: 1.25em; - font-weight: bold; - width: 100%; - } - .misc label[for=addcontrib], - .misc label[for=contribconfirm] {width: 100%;} - .misc #addcontrib, - .misc #contribconfirm {width: 100%; text-align: right;} - -.prescription label[for=prescreviewed] { - margin-left: 1ex; - font-weight: bold; - text-decoration: underline; - background-color: #FCC; -} -.prescription label[for=prescreviewed].checked, -.prescription :checked + label[for=prescreviewed] { - font-weight: normal; - text-decoration: none; - background-color: transparent; -} - -.prescription .catalogue { width: 100%; } - - .catalogue h2:nth-of-type(1) { - font-weight: bold; - width: 100%; - margin-bottom: .25em; - } - .catalogue label { - display: inline-block; - width: 33%; - margin-right: -.625ex; - margin-top: .25em; - vertical-align: top; - } - .catalogue label[for=presccontinual] { margin-right: 33%;} - -.prescription .description { width: 100%; position: relative;} - .description * { margin-right: -.625ex; vertical-align: top; } - .description label {vertical-align: bottom;} - - .description label[for=quantity] { width: 20%;} - .description label[for=remidy] { width: 60%; } - .description label[for=quantity_weekly] { width: 20%;} - .description #quantity, - .description .quantity { width: 20%; height: 3em; text-align: center;} - .description #remidy, - .description .remidy { width: 60%; height: 3em;} - .description #quantity_weekly, - .description .quantity_weekly { width: 20%; height: 3em; text-align: center;} - - .description .indicator_codes {display: inline-block; width: 20%; padding: 0; padding-top: 1.5ex;} - .description label[for=indicator], - .description label[for=icd10] { display: block; width: 100%;} - .description #icd10, - .description #indicator {width: 100%; text-align: right;} - - .description .indicator_reading { display: inline-block; width: 78%; padding: 0; padding-top: 1.5ex; margin-left: 2%;} - .description label[for=indicator_reading], - .description #indicator_reading { width: 100%; display: block;} - .description #indicator_reading { height: 4em;} - -.prescription .therapy_dates span { min-width: 8em; margin: 0 .5ex;} - -.prescription .issuer { display: inline-block; width: 50%; padding: 0; padding-top: 0; margin-left: 50%;} -.prescription .issuer label:first-of-type { - display: block; - position: relative; - width: 50%; left: -50%; top: 2.25em; - font-size: 1em; - text-align: right; - padding-right: 1ex; - } -.prescription .issuer input[type=radio] + label:before { content: none; } -.prescription .issuer input[type=radio] { display: none; } -.prescription .issuer input[type=radio] + label { - display: inline-block; - width: 50%; - padding: .25ex 0; margin: 0; - text-align: center; - border: 1px solid black; -} -.prescription .issuer input[type=radio]:checked + label { - font-weight: bold; - background-color: #FFF; - border-width: 1px; - border-bottom: 1px solid #FFF; -} -.prescription .issuer input[type=radio] + label + input + label + select, -.prescription .issuer input[type=radio] + label + select + input { display: none; } -.prescription .issuer input[type=radio]:checked + label + input + label + select, -.prescription .issuer input[type=radio]:checked + label + select + input { - display: block; width: 100%; - border: 1px solid black; - background-color: #FFF; - border-width: 0 1px 1px 1px; - padding: .25ex .5ex; - margin-top: -1px; -} -.prescription .issuer input[type=radio]:checked + label + input + label + select option { display: block;} -.prescription span#issuer { width: 100%; height: 3em; padding: 1ex 2ex;} - -.prescription .controls { width: 100%; } - .controls a.button, - .controls button[value=save], - .controls button[value=cancel], - .controls button[value=delete] { width: 25%;} - diff --git a/prescriptions/prescriptions.html.sh b/prescriptions/prescriptions.html.sh deleted file mode 100755 index c4ef19a..0000000 --- a/prescriptions/prescriptions.html.sh +++ /dev/null @@ -1,47 +0,0 @@ -# Copyright 2016 Paul Hänsch -# -# This file is part of Confetti. -# -# Confetti is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Confetti is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with Confetti. If not, see . - -client="${_GET[client]}" -edit="${_GET[edit]}" -[ -n "$edit" ] && client="${edit%.*.mpx}.vcf" - -cat <$(view_card "$client") - - - -
-
- - -
-
-EOF - -list_prescriptions "$client" |grep -q "$edit" || edit_prescription "$edit" - -list_prescriptions "$client" \ -|while read pre; do - [ "$pre" = "$edit" ] \ - && edit_prescription "$pre" \ - || view_prescription "$pre" -done - -# - -# vi:set filetype=html: diff --git a/prescriptions/prescriptions.sh b/prescriptions/prescriptions.sh deleted file mode 100755 index fcef09a..0000000 --- a/prescriptions/prescriptions.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/zsh - -# Copyright 2016 Paul Hänsch -# -# This file is part of Confetti. -# -# Confetti is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Confetti is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with Confetti. If not, see . - -source "$_EXEC/pages/cards.sh" -declare -A mpx - -BR=' -' - -view_card="$_EXEC/templates/view_client.sh" - -list_prescriptions(){ - client="$1" - find "$_DATA/prescriptions/" -name "${client%.vcf}.*.mpx" \ - | while read pfile; do - printf '%s\t%s\n' "$(grep '^date' "$pfile")" "${pfile##*/}" - done \ - | sort -r | cut -f2 -} - -list_prescription_issuers(){ - sed -rn 's;^issuer:(.+)$;\1;p' ${_DATA}/prescriptions/*.mpx \ - | sort -u -} - -edit_prescription(){ - id="$1" - prescfile="$_DATA/prescriptions/$id" - tempfile="$_DATA/temp/$id" - [ -f "$tempfile" ] || cp "$prescfile" "$tempfile" - - mpx=() - cat "$tempfile" |while read -r line; do - val="${line#*:}" - mpx[${line%%:*}]="${val//\\n/$BR}" - done - - . "$_EXEC/templates/edit_prescription.sh" -} - -view_prescription(){ - id="$1" - prescfile="$_DATA/prescriptions/$id" - - mpx=() - cat "$prescfile" |while read -r line; do - val="${line#*:}" - mpx[${line%%:*}]="$(htmlsafe "${val//\\n/$BR}")" - done - - . "$_EXEC/templates/view_prescription.sh" -} - -therapy_dates(){ - tpyfile="$_DATA/therapies/${1%.mpx}.tpy" - sed -rn 's;^session[0-9]+_date:(.+)$;\1;p' "$tpyfile" -} diff --git a/prescriptions/text_prescriptions.sh b/prescriptions/text_prescriptions.sh deleted file mode 100755 index 8934bc7..0000000 --- a/prescriptions/text_prescriptions.sh +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright 2016 Paul Hänsch -# -# This file is part of Confetti. -# -# Confetti is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Confetti is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with Confetti. If not, see . - -. $_EXEC/templates/text_cards.sh - -item_name[therapy_prescription]="Heil­mit­tel­ver­ord­nung" -item_name[prescriptions_current]="Aktuelle Verordnungen" -item_name[prescriptions_past]="Frühere Verordnungen" -item_name[newprescription]="Neue Verordnung" -item_name[date]="Datum" -item_name[name]="Name d. Versicherten" -item_name[bday]="geb. am" -item_name[addcontrib]="Zuzahlung" -item_name[contribconfirm]="Zuzahlung erfolgt am..." -item_name[contribreceipt]="Quit­tung heraus­ge­ge­ben" -item_name[prescreviewed]="Verordnung geprüft" -item_name[prescreview]="Verordnung prüfen!" -item_name[quantity]="Ver­ord­nungs­men­ge" -item_name[remidy]="Heil­mit­tel nach Maß­ga­be des Ka­ta­lo­ges" -item_name[prescfirst]="Erst­ver­ord­nung" -item_name[prescfollow1]="1. Folge-­VO" -item_name[prescfollow2]="2. Folge-­VO" -item_name[prescother]="VO außer­halb des Re­gel­falls" -item_name[presccontinual]="Lang­frist­ver­ord­nung" -item_name[grouptherapy]="Grup­pen­the­ra­pie" -item_name[housecall]="Haus­be­such" -item_name[report]="The­ra­pie­be­richt" -item_name[indicator]="In­di­ka­tions­schlüssel" -item_name[icd10]="ICD-10-Code" -item_name[indicator_reading]="Befund Beschreibung" -item_name[insurance]="Krankenkasse bzw. Kostenträger" -item_name[prescription_by_catalogue]="Verordnung nach Maßgabe des Kataloges (Regelfall)" -item_name[therapy_start]="Be­hand­lungs­be­ginn spä­test. am" -item_name[quantity_weekly]="An­zahl pro Wo­che" -item_name[save]="Speichern" -item_name[cancel]="Abbrechen" -item_name[delete]="Löschen" -item_name[therapy]="Zur Therapie" - -item_name[doctor]="Arzt" -item_name[dentist]="Zahn­arzt" -item_name[altpractition]="Heil­prak­tiker" -item_name[noprescription]="Ohne Ver­ord­nung" -item_name[selfpaid]="Selbst­zah­lend" -item_name[private]="Pri­vat" -item_name[compulsory]="Ge­setz­lich" - -item_name[therapy_dates]="Be­hand­lungs­ter­mi­ne" - -item_name[issuer]="Ausgestellt durch" -item_name[issuer_from_list]="Aus Liste" -item_name[issuer_other]="Andere" diff --git a/prescriptions/update_prescription.sh b/prescriptions/update_prescription.sh deleted file mode 100755 index aeb4993..0000000 --- a/prescriptions/update_prescription.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/zsh - -# Copyright 2016 Paul Hänsch -# -# This file is part of Confetti. -# -# Confetti is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Confetti is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with Confetti. If not, see . - -BR=' -' -prescription="${_POST[prescription]}" - -tempfile="$_DATA/temp/$prescription" -prescfile="$_DATA/prescriptions/$prescription" -client="${prescription%.*.mpx}.vcf" -clientfile="$_DATA/vcard/$client" - -if [ -z "$prescription" -o \! -f "$clientfile" ]; then - redirect "?p=error" - exit 0 -fi - -[ "$_POST[issuer_select]" = "other" ] && _POST[issuer]="${_POST[issuer_other]}" - -# serialize POST array into file -for key in ${(k)_POST}; do - printf %s:%s\\n "$key" "${_POST[$key]//$BR/\\n}" -done >"$tempfile" - -case "${_POST[action]}" in - save) - mv "$tempfile" "$prescfile" - touch "$clientfile" - ;; - cancel) - rm "$tempfile" - ;; - delete) - rm "$tempfile" "$prescfile" - touch "$clientfile" - ;; -esac - -redirect "?p=prescriptions&client=${client}#${prescription}" diff --git a/prescriptions/view_prescription.sh b/prescriptions/view_prescription.sh deleted file mode 100755 index ced7241..0000000 --- a/prescriptions/view_prescription.sh +++ /dev/null @@ -1,121 +0,0 @@ -# Copyright 2016 Paul Hänsch -# -# This file is part of Confetti. -# -# Confetti is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Confetti is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with Confetti. If not, see . - -check(){ [ "$1" = "$2" ] && printf checked} - -cat < -
- -${mpx[insurance]} -
- - -${mpx[name]} -${mpx[bday]} - -
- -${mpx[date]} -
- -
-

$(l10n therapy_prescription)

-
- -${mpx[addcontrib]} - -${mpx[contribconfirm]} - -
- - - -
-

$(l10n prescription_by_catalogue)

- -
- -
- -
- -
- - -
- -
- -
- -
- -
- - - - ${mpx[quantity]} - ${mpx[remidy]} - ${mpx[quantity_weekly]} -$( for n in {0..10}; do - [ -n "${mpx[quantity$n]}" -o -n "${mpx[remidy$n]}" -o -n "${mpx[quantity_weekly$n]}" ] \ - && printf ' - %s - %s - %s - ' "${mpx[quantity$n]}" "${mpx[remidy$n]}" "${mpx[quantity_weekly$n]}" -done ) -
-

- - ${mpx[indicator]} -
- - ${mpx[icd10]} -

-
-

- - ${mpx[indicator_reading]} -

-
- -

- - $(therapy_dates "$id" \ - | while read date; do - printf '%s' "$date" - done - ) -

- -

- - $mpx[issuer] -

- -
-$(l10n edit) -$(l10n therapy) -
- - -END_HTML diff --git a/therapy/text_therapy.sh b/therapy/text_therapy.sh deleted file mode 100755 index a2735b2..0000000 --- a/therapy/text_therapy.sh +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright 2016 Paul Hänsch -# -# This file is part of Confetti. -# -# Confetti is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Confetti is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with Confetti. If not, see . - -. $_EXEC/templates/text_prescriptions.sh - -item_name[prescriptionlist]="Zur Verordnungsliste" -item_name[delete_session]="Therapiesitzung entfernen" -item_name[therapist]="Therapeut" -item_name[number]="Nr." -item_name[signature]="Un­ter­schrift" -item_name[weekly]="p. Woche" -item_name[notes]="Notizen" -item_name[trailsave]="Speichern für weitere Felder" diff --git a/therapy/therapy.css b/therapy/therapy.css deleted file mode 100644 index b17497c..0000000 --- a/therapy/therapy.css +++ /dev/null @@ -1,360 +0,0 @@ -.trailbtn:checked + fieldset.trailbox { display: block;} - -.trailbtn:checked + .trailbox + .trailbtn { - display: block; - height: 2.25em; padding: 0 3ex; - font-size: 1em; font-weight: normal; - color: #000; background-color: #FDD; - border: 1px solid #000; - border-radius: 4px; -} -.trailbtn:checked + .trailbox + .trailbtn[type=submit]:before {content: none;} - - -* { box-sizing: border-box; } -body { - overflow: scroll; - position: relative; - width: 100%; - margin: 0; padding: 0; - padding-top: 2em; -} - -form > button[type=submit] { - position: fixed; display: block; - top: 0; right: 2.5em; - height: 2.25em; padding: 0 3ex; - font-size: 1em; font-weight: bold; - color: #000; background-color: #FDD; - border-width: 1px; border-color: #000; - border-style: none solid solid solid; - border-radius: 0 0 4px 4px; - z-index: 3; -} -form > button[type=submit]:hover { - background-color: #FEE; -} - -input.tab { display: none; } -input.tab + label.tab { display: block; } -input.tab + label.tab::before { content: '\25b8 \00a0'; float: left;} -input.tab:checked + label.tab::before { content: '\25be \00a0'; } -input.tab + label.tab + div.tab { display: none; } -input.tab:checked + label.tab + div.tab { display: block; } - -input.color { display: none } -input.color + label{ - display: inline-block; - width: 1em; height: 1em; - border: 1px solid black; -} -input.color:checked + label{ border-width: 3px;} -input.color[value="#000"] + label, -input.color[value="#888"] + label { background-color: #888;} -input.color[value="#00A"] + label { background-color: #00F;} -input.color[value="#0A0"] + label { background-color: #0F0;} -input.color[value="#0AA"] + label { background-color: #0FF;} -input.color[value="#A00"] + label { background-color: #F00;} -input.color[value="#A0A"] + label { background-color: #F0F;} -input.color[value="#AA0"] + label { background-color: #FF0;} -input.color[value="#FFF"] + label { background-color: #FFF;} - -h1, label.tab, div.tab, fieldset.tab, -div.patient, div.prescription { - display: block; - width: 96%; - margin: 0 2%; -} - -div.prescription span { - display: inline-block; - width: 50%; - margin-right: -.75ex; - vertical-align: top; -} -div.prescription span label { font-weight: bold; margin-right: 1ex;} -div.prescription span.prescno, -div.prescription span.catalogue { - width: 33%; - font-weight: bold; - margin-bottom: .5em; - padding: .5ex 1ex; -} - -div.prescription ul {margin-top: 0;} - -div.prescription label.checkbox, -div.prescription label.radio { - display: block; - padding-left: 1.25em; - font-size: 1em; - margin: .5em 0; -} - -div.prescription label.checkbox:before, -div.prescription label.radio:before { - display: inline-block; - color: #000; - background-color: #FFF; - height: 1.375em; width: 1.125em; - padding: .125em 0 0 .375em; - margin: 0 .5em .25em -1.25em; - border: 1px solid #000; - vertical-align: middle; - content: ' '; -} -div.prescription label.radio:before { border-radius: .5em;} -div.prescription label.checkbox.checked:before, -div.prescription label.radio.checked:before { content: "\2713";} - -div.prescription label[for=prescreviewed] { - margin-left: 1ex; - font-weight: bold; - text-decoration: underline; - background-color: #FCC; -} -div.prescription label[for=prescreviewed].checked { - font-weight: normal; - text-decoration: none; - background-color: transparent; -} - -div.prescription label.tab {width: 96%; border: none; border-bottom: 1px dotted;} -div.prescription div.tab { width: 96%; background-color: #DDD;} - -input.stickynote { display:none; } -input.stickynote + .stickynote { - position: fixed; - background-color: #FF8; - top: 4em; bottom: 4em; - left: -4.5em; width: 5em; - padding: 1ex; - max-height: 90%; - z-index: 2; -} -input.stickynote + .stickynote:nth-of-type(2n) { - background-color: #8FF; - top: 8em; -} - -input.stickynote + .stickynote > * { display: none; } -input.stickynote + .stickynote > label { - position: absolute; - top: 0; bottom: 0; right: .5ex; - display: block; - text-align: right; - font-weight: bold; -} -input.stickynote + .stickynote:hover { - left: -1ex; -} -input.stickynote:checked + .stickynote { - width: auto; left: 1em; right: 1em; -} -input.stickynote:checked + .stickynote > * { display: block; } -input.stickynote:checked + .stickynote > textarea { - display: block; - position: absolute; - left; 0; right: 0; bottom: 0; top: 0; - width: 100%; height: 100%; - background-color: #FF8; - padding: 2em 1em; -} -input.stickynote:checked + .stickynote > button[type="submit"] { - display: block; - position: absolute; - right: .5ex; bottom: .5ex; - z-index: 2; -} -input.stickynote:checked + .stickynote > label { - display: block; - position: static; - font-size: 0; -} -input.stickynote:checked + .stickynote > label:before { - position: absolute; - font-size: initial; - content: "x"; - top: .5ex; right: .5ex; - padding: .125ex .75ex; - background-color: #000; - color: #FFF; - border-radius: 1ex; - z-index: 2; -} - -fieldset.penwidth, -fieldset.color { - position: absolute; - right: 0; width: 2em; - margin: .5em .5em .125em 2%; - border: none; - padding: 0; -} -fieldset.penwidth { bottom: 19em; } -fieldset.penwidth > input {display: none;} -fieldset.penwidth > input + label { display: none;} -fieldset.penwidth > input:checked + label { - display: block; - width: 2em; height: 2em; - background-color: #000; - border: 1em solid #FFF; - border-radius: 1em; -} -fieldset.penwidth > input[value="4"] + label { border-width: .75em; } -fieldset.penwidth > input[value="12"] + label { border-width: .5em; } -fieldset.penwidth > input[value="36"] + label { border-width: .25em; } - -fieldset.color { bottom: 0; } -fieldset.color > input.color + label { - width: 2em; height: 2em; -} -.dotmark { - max-width: 90%; - margin: .5em 1em .125em 2%; padding: 0; - text-align: left; - border: 1px solid black; -} -.dotmark.ov { - position: absolute; - left: 0; bottom: .25em; - z-index: 1; -} - -@media(min-width: 800px){ - h1, label.tab, div.tab, fieldset.tab, - div.patient, div.prescription { - width: 38%; - margin-right: 0; - } - input.stickynote:checked + .stickynote { right: 50%; } - fieldset.penwidth, - fieldset.color { position: fixed; } - .dotmark { - position: fixed; - max-width: 52%; - max-height: 98%; - right: 2em; bottom: .25em; - } - .dotmark.ov { - position: fixed; - right: 2em; left: auto; - } -} - -h1 {display: none;} - -div.patient, div.prescription { margin-top: 1em; } -div.prescription { - border: 1px solid black; - background-color: #EEE; - padding: .125em 1.25ex .5em 1.25ex; -} -div > h2 { margin: 0; border-bottom: 1px solid black; } -div:nth-child(n+2) > a:first-of-type { - display: block; - margin: .125em 0 .5em 0; - text-decoration: none; -} - -#report fieldset.tab, -#report label.tab { - font-size: 1.25em; - font-weight: bold; - padding: .125em 1ex .25em 1ex; - color: #FFF; - background-color: #333; - margin-top: .125em; - text-align: right; - border: none; -} -#report label.heading { - background-color: #FFF; - margin-top: 1em; - border: 2px solid black; - border-bottom-width: 1px; - color: black; -} -#report label.heading > span { - text-decoration: underline; -} - -#report fieldset.tab > *, -#report label > input, -#report label > span { - display: inline-block; - text-align: right; -} -#report .tab > .no { - width: 10%; float: left; - border: solid 1px #FFF; - background-color: #555; - border-radius: 2ex; - padding: 0; - text-align: center; -} -#report label.heading > span.no { - background-color: inherit; - border: none; -} -#report .tab > .date { width: 30%; } -#report .tab > .therapist { width: 30%; } -#report .tab > .signature { width: 20%; } -#report label.tab > .signature { font-size: .75em; } - -#report .signature > input[type=checkbox] { - display: inline; - font-weight: bold; - font-size: 1.25em; -} -#report .signature > input[type=checkbox]:before { - display: block; width: 1.25em; - margin: -.125em 0 0 -.5ex; - background-color: #FFF; - text-align: center; - content: "\00a0 \00a0 \00a0"; -} -#report .signature > input[type=checkbox]:checked::before { - content: "\2713"; -} - -#report input.tab + label.tab > input.date, -#report input.tab + label.tab > input.therapist { - display: none; -} -#report input.tab:checked + label.tab > input.date, -#report input.tab:checked + label.tab > input.therapist { - display: inline; -} -#report input.tab:checked + label.tab > span.date, -#report input.tab:checked + label.tab > span.therapist { - display: none; -} - -#report div.tab { - border: 2px solid #333; - border-top-width: 1px; - margin-top: -1px; - padding: .25em .5ex 1em .5ex; -} -#report div.tab > fieldset.note { - border: none; - margin: 0; padding: 0; -} -#report div.tab > fieldset.note > textarea { - display: block; - width: 93%; height: 8em; - margin: -8em 0 .5em 2em; - font: normal 1em sans-serif; -} -div.tab > fieldset.note > input.color + label { margin: 0; display: block; } -div.tab > fieldset.note > input.color[value="#888"]:checked ~ textarea { background-color: #AAA; } -div.tab > fieldset.note > input.color[value="#00A"]:checked ~ textarea { background-color: #88F; } -div.tab > fieldset.note > input.color[value="#0A0"]:checked ~ textarea { background-color: #8F8; } -div.tab > fieldset.note > input.color[value="#0AA"]:checked ~ textarea { background-color: #8FF; } -div.tab > fieldset.note > input.color[value="#A00"]:checked ~ textarea { background-color: #F88; } -div.tab > fieldset.note > input.color[value="#A0A"]:checked ~ textarea { background-color: #F8F; } -div.tab > fieldset.note > input.color[value="#AA0"]:checked ~ textarea { background-color: #FF8; } -div.tab > fieldset.note > input.color[value="#FFF"]:checked ~ textarea { background-color: #FFF; } - -div.tab > button.delete {float: right; display: inline-block; margin-top: -1em; display: none;} diff --git a/therapy/therapy.html.sh b/therapy/therapy.html.sh deleted file mode 100755 index 1821c24..0000000 --- a/therapy/therapy.html.sh +++ /dev/null @@ -1,227 +0,0 @@ -# Copyright 2016, 2017 Paul Hänsch -# -# This file is part of Confetti. -# -# Confetti is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Confetti is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with Confetti. If not, see . - -t_session_note(){ - session_n="$1" - note_n="$2" - - color=session${session_n}_note${note_n}_color - unset c0 c1 c2 c3 c4 c5 c6 c7 - - if [ "$note_n" -eq 1 -o -n "${tpy[session${session_n}_note${note_n}]}" ]; then - printf '' - else - printf '' - fi - - _checked="$(validate "$tpy[$color]" '#(888|00A|0A0|0AA|A00|A0A|AA0)' '#FFF')" - cat <<-EOF -
- - - - - - - - - -
- EOF -} - -t_session(){ - session_n="$1" - - sid=session${session_n} - - if [ "$tpy[${sid}_sigset]" = pos ]; then - sigcheck=checked - else - unset sigcheck - fi - - cat <<-EOF - - - -
- - $(n=1; - while [ -n "${tpy[session${session_n}_note${n}]+x}" ]; do - if [ -n "${tpy[session${session_n}_note${n}]}" ]; then - x=$n - fi - n=$(($n + 1)) - done - for n in $(seq 1 $((${x:-0} + 3)) ); do t_session_note $session_n $n; done - ) - - -
- EOF -} - -therapy_sessions(){ - n=1; while [ -n "${tpy[session${n}]}" ]; do - t_session $n - n=$(($n+1)) - done - - sid=session$n - - cat <<-EOF -
- - -
- EOF -} - -cat <$(l10n therapy) - -
-

$client_name

- < $(l10n prescriptionlist) -
- -
-

$(l10n therapy_prescription)

- ${mpx[insurance]} - ${mpx[date]} - - - - ${mpx[prescno]:+$(l10n presc${mpx[prescno]})} - ${mpx[grouptherapy]:+$(l10n grouptherapy)} - ${mpx[housecall]:+$(l10n housecall)} - ${mpx[report]:+$(l10n report)} - -
    $(for n in '' {0..10}; do - [ -n "${mpx[remidy$n]}" ] && \ - printf '
  • %s %s %s
  • ' "${mpx[quantity$n]}" \ - "${mpx[remidy$n]}" \ - "${mpx[quantity_weekly$n]:+($mpx[quantity_weekly$n] $(l10n weekly))}" - done)
- - ${mpx[indicator]:+${mpx[indicator]}} - ${mpx[icd10]:+ ${mpx[icd10]}} - - ${mpx[addcontrib]:+ - - } - - - -
${mpx[indicator_reading]}
-
- -
- - - -
- -

$(l10n notes)

- - -
- - -
- -

$(l10n timesheet)

- - - - $(for n in '' {0..10}; do - printf ' - - - \n' \ - "$mpx[tsgoal${n}]" "$mpx[tsactual${n}]" "$((${mpx[tsgoal${n}]:-0} - ${mpx[tsactual${n}]:-0}))" - done) -
$(l10n time_goal)$(l10n time_actual)$(l10n time_difference)
%s
- -
- - - - -EOF - -therapy_sessions - -_checked="$(validate "$tpy[penwidth]" '(4|12|36)' '4')" -cat < - - - - -EOF - -_checked="$(validate "$tpy[color]" '#(0[0A]{2}|A00|A0A|AA0|FFF)' '#000')" -cat < - - - - - - - - - - WARNING: Background Image not available! - - - - - - - - - - -EOF - -# vi:set filetype=html: diff --git a/therapy/therapy.sh b/therapy/therapy.sh deleted file mode 100755 index 8885515..0000000 --- a/therapy/therapy.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/zsh - -# Copyright 2016 Paul Hänsch -# -# This file is part of Confetti. -# -# Confetti is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Confetti is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with Confetti. If not, see . - -declare -A tpy -declare -A mpx - -BR=' -' - -id="$_GET[id]" - -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")" - -n=$(printf %s "$card_N" \ - | sed -rn 's:^([^;]*)(\;[^;]*)(\;[^;]*)?(\;[^;]*)?(\;[^;]*)?$:\4 \2 \3 \1 \5:gp' \ - | sed -r 's:,: :;s:\;: :g;s: +: :g;s:^ $::;' - ) -client_name="${n:-${card_FN:-${card_NICK}}}" - -mpx=() -cat "$mpxfile" |while read -r line; do - val="${line#*:}" - mpx[${line%%:*}]="$(htmlsafe "${val//\\n/$BR}")" -done - -tpy=() -cat "$tpyfile" |while read -r line; do - val="${line#*:}" - tpy[${line%%:*}]="$(htmlsafe "${val//\\n/$BR}")" -done diff --git a/therapy/therapy_background.png b/therapy/therapy_background.png deleted file mode 100644 index a0574d5..0000000 Binary files a/therapy/therapy_background.png and /dev/null differ diff --git a/therapy/therapy_background.xcf b/therapy/therapy_background.xcf deleted file mode 100644 index e69c024..0000000 Binary files a/therapy/therapy_background.xcf and /dev/null differ diff --git a/therapy/therapy_draw.js b/therapy/therapy_draw.js deleted file mode 100644 index 8a8e936..0000000 --- a/therapy/therapy_draw.js +++ /dev/null @@ -1,115 +0,0 @@ -// Copyright 2016 Paul Hänsch -// -// This file is part of Confetti. -// -// Confetti is free software: you can redistribute it and/or modify -// it under the terms of the GNU Affero General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// Confetti is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Affero General Public License for more details. -// -// You should have received a copy of the GNU Affero General Public License -// along with Confetti. If not, see . - -body = document.body -dbg = document.getElementById("jsdebug") -canvas = document.getElementById("canvas") -data=document.getElementById("image_serialize") - -image = canvas.getContext("2d") -mouse = 0 -image_serialize="" - -// start and current coordinates of a draw -// serves for tracking, whether path ends close to its beginning -stx=0, sty=0 -cux=0, cuy=0 - -function setstroke(w) { - image.lineWidth = w - data.value += " stroke-width " + image.lineWidth -} -function setcol(c) { - this.c = c - image.strokeStyle = c - image.fillStyle = c - data.value += " stroke " + c + "F" -} - -function relX(x){ - if ( body.clientWidth >= 800 ){ - return Math.floor(cscaleW * (x - canvas.offsetLeft)) - } else { - return Math.floor(cscaleW * (x - canvas.offsetLeft + window.pageXOffset)) - } -} -function relY(y){ - if ( body.clientWidth >= 800 ){ - return Math.floor(cscaleH * (y - canvas.offsetTop)) - } else { - return Math.floor(cscaleH * (y - canvas.offsetTop + window.pageYOffset)) - } -} - -function draw(x, y) { - if ( mouse == 1){ - cux=relX(x), cuy=relY(y) - - image.lineTo( cux, cuy ) - image.stroke() - - image_serialize += " " + cux + "," + cuy - } -} - -function drawstart(x, y) { - mouse = 1 - - cscaleW = canvas.width / canvas.clientWidth - cscaleH = canvas.height / canvas.clientHeight - - stx=relX(x), sty=relY(y) - - setstroke(document.querySelector('input[name="penwidth"]:checked').value); - setcol(document.querySelector('input[name="color"]:checked').value); - - image.beginPath() - draw(x, y) // why must this not use relative Coords ??? - - image_serialize = " polyline" -} - -function drawstop() { - - // if path ends close to beginning ( < 50 px); then close path and fill - if ( false && mouse == 1 && Math.sqrt( Math.pow(stx - cux, 2) + Math.pow(sty - cuy, 2)) <= 50 && c !== "#FFF" ){ - image.lineTo( stx, sty ) - image.stroke() - - image.globalAlpha = .5 - image.fill() - image.globalAlpha = 1 - - image_serialize += " " + stx + "," + sty - data.value += " fill " + c + "8" + image_serialize - } else if (mouse == 1) { - data.value += " fill #0000 " + image_serialize - } - dbg.innerHTML = " stx: " + stx + " cux: " + cux + " sty: " + sty + " cuy: " + cuy - - image.closePath() - image_serialize = "" - mouse = 0 -} - -window.addEventListener( 'mouseup', function() { drawstop() } ) -canvas.addEventListener( 'mousedown', function(e) { drawstart(e.clientX, e.clientY) } ) -canvas.addEventListener( 'mousemove', function(e) { draw(e.clientX, e.clientY) } ) - -window.addEventListener( 'touchend', function() { drawstop() } ) -canvas.addEventListener( 'touchstart', function(e) { drawstart(e.touches[0].clientX, e.touches[0].clientY) } ) -canvas.addEventListener( 'touchmove', function(e) { e.preventDefault(); draw(e.touches[0].clientX, e.touches[0].clientY) } ) diff --git a/therapy/update_therapy.sh b/therapy/update_therapy.sh deleted file mode 100755 index 6ba06cb..0000000 --- a/therapy/update_therapy.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/zsh - -# Copyright 2016 Paul Hänsch -# -# This file is part of Confetti. -# -# Confetti is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Confetti is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with Confetti. If not, see . - -BR=' -' -tpy="${_POST[id]}" - -tpyfile="$_DATA/therapies/$tpy" -tempfile="$_DATA/temp/$tpy" - -# serialize POST array into file -for key in ${(k)_POST}; do - [ "$key" != imagedata ] && printf %s:%s\\n "$key" "${_POST[$key]//$BR/\\n}" -done >"$tempfile" - -if [ -n "$_POST[delete_session]" ]; then - n="$_POST[delete_session]" - sed -i -r '/^session'$n'[_:]/d' "$tempfile" - rm "${tpyfile%.tpy}_session${n}.png" - - while grep -Eq '^session'$(($n + 1))'_' "$tempfile"; do - sed -i -r 's;^session'$(($n + 1))'(_|:);session'$n'\1;' "$tempfile" - mv "${tpyfile%.tpy}_session$(($n+1)).png" "${tpyfile%.tpy}_session${n}.png" - n=$(($n+1)) - done - -elif [ -n "$_POST[new_session]" ]; then - sid="$_POST[new_session]" - - identify "$_EXEC/static/therapy_background.png" \ - | sed -r 's;^.* ([0-9]+x[0-9]+) .*$;\1;' \ - | read dim - - convert -size "$dim" xc:transparent "${tpyfile%.tpy}_${sid}.png" - - printf '%s:exists\n' "$sid" >>"$tempfile" - printf '%s_open:checked\n' "$sid" >>"$tempfile" - -elif [ -n "$_POST[imagedata]" ]; then - sed -rn 's;^(session[0-9]+)_open:checked$;\1;p' "$tempfile" \ - | sort -n \ - | tail -n1 \ - | read sid - - convert "${tpyfile%.tpy}_${sid}.png" \ - -strokewidth 2 -fill '#00000000' \ - -draw "${_POST[imagedata]}" -transparent white \ - "${tpyfile%.tpy}_${sid}.png" - sync -fi - -mv "$tempfile" "$tpyfile" - -redirect "?p=therapy&id=${tpy}" diff --git a/update_bookmarks.sh b/update_bookmarks.sh deleted file mode 100755 index 1670840..0000000 --- a/update_bookmarks.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/zsh - -# Copyright 2017 Paul Hänsch -# -# This file is part of Confetti. -# -# Confetti is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# Confetti is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with Confetti. If not, see . - -bmfile="${_DATA}/mappings/bookmarks" - url="$(validate "${_POST[bm_url]}" '/.+' '/')" -name="$(validate "${_POST[bm_name]}" '.+' "$url")" - -case "${_POST[submit]}" in - add) printf '%s\t%s\n' "${url}" "${name}" >>"${bmfile}" - ;; - del) cp "${bmfile}" "${bmfile}.temp" - grep -vF "${url} ${name}" "${bmfile}.temp" >"${bmfile}" - rm "${bmfile}.temp" - ;; -esac - -redirect "${url}#CONFIGURE"