From 3df0e6c3d9ff72b4ace395bb78582765ef4bc6fb Mon Sep 17 00:00:00 2001 From: paul Date: Wed, 13 Jan 2016 08:55:41 +0000 Subject: [PATCH 1/1] basic fields for medical view svn path=/trunk/; revision=77 --- templates/cards.css.sh | 1 + templates/cards.html.sh | 3 + templates/edit_client.sh | 133 +++++++++++++++++++++++++++++++++++++++ templates/text_cards.sh | 13 +++- templates/view_client.sh | 85 +++++++++++++++++++++++++ 5 files changed, 232 insertions(+), 3 deletions(-) create mode 100755 templates/edit_client.sh create mode 100755 templates/view_client.sh diff --git a/templates/cards.css.sh b/templates/cards.css.sh index 6a8cef0..3edd4e2 100755 --- a/templates/cards.css.sh +++ b/templates/cards.css.sh @@ -1,5 +1,6 @@ case $PROFILE in medical) + . ${0%/*}/attendees.css.sh ;; circus) . ${0%/*}/attendees.css.sh diff --git a/templates/cards.html.sh b/templates/cards.html.sh index f1f039a..ff0058d 100755 --- a/templates/cards.html.sh +++ b/templates/cards.html.sh @@ -1,5 +1,8 @@ case $PROFILE in medical) + view_card=${0%/*}/view_client.sh + edit_card=${0%/*}/edit_client.sh + . ${0%/*}/attendees.html.sh ;; circus) view_card=${0%/*}/view_attendee.sh diff --git a/templates/edit_client.sh b/templates/edit_client.sh new file mode 100755 index 0000000..ddb33c3 --- /dev/null +++ b/templates/edit_client.sh @@ -0,0 +1,133 @@ +# Copyright 2014, 2015 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_gen() { + [ "$values[GENDER]" = "$1" ] && echo 'selected="selected"' +} +check_a() { + egrep -q "^${1}.${id}$" "$_DATA/mappings/attendance" && echo 'checked="checked"' +} + +n_last="$(echo "$values[N]" |sed -rn 's:^([^;]*;){0} *([^;]*).*$:\2:p')" +n_first="$(echo "$values[N]" |sed -rn 's:^([^;]*;){1} *([^;]*).*$:\2:p')" +n_middle="$(echo "$values[N]" |sed -rn 's:^([^;]*;){2} *([^;]*).*$:\2:p')" +n_pre="$(echo "$values[N]" |sed -rn 's:^([^;]*;){3} *([^;]*).*$:\2:p')" +n_post="$(echo "$values[N]" |sed -rn 's:^([^;]*;){4} *([^;]*)*$:\2:p')" + +SUP_FIELDS=(N NICKNAME GENDER BDAY ADR TEL EMAIL X-HEALTH-INSURANCE X-HEALTH-INSURANCE-NOCONTRIB IMPP URL NOTE X-CLIENT-REFERRAL) + +[ -z "$values[UID]" ] && values[UID]="$(uuidgenerator)" + +cat < + +
+

$(l10n N)

+ + + + + + + + + $(for n in NICKNAME NICKNAME{0..10}; do + echo "${values[$n]:+}" + done) + +

$(l10n BDAY)

+ + + $(if [ -n "$values[SOUND]" ]; then + echo ' ' + fi) + ${values[PHOTO]:+} + ${values[LOGO]:+} +
+ +
+

$(l10n ADR)

+ + $(for n in ADR{0..10}; do + echo "${values[$n]:+}" + done) + ${values[URL]:+

$(l10n URL)

} + $(for n in URL URL{0..10}; do + echo "${values[$n]:+}" + done) +
+ +
+

$(l10n TEL)

+ + $(for n in TEL{0..10}; do + echo "${values[$n]:+}" + done) + ${values[EMAIL]:+

$(l10n EMAIL)

} + $(for n in EMAIL EMAIL{0..10}; do + echo "${values[$n]:+}" + done) + ${values[IMPP]:+

$(l10n IMPP)

} + $(for n in IMPP IMPP{0..10}; do + echo "${values[$n]:+}" + done) +
+ +
+

$(l10n X-HEALTH-INSURANCE)

+ + + +
+ +
+

$(l10n NOTE)

+ + $(for n in NOTE{0..10}; do + echo "${values[$n]:+}" + done) +

$(l10n X-CLIENT-REFERRAL)

+ + $(for n in X-CLIENT-REFERRAL{0..10}; do + echo "${values[$n]:+}" + done) +
+ +
+ + + + +
+ + +END_HTML diff --git a/templates/text_cards.sh b/templates/text_cards.sh index ec308ff..2e36446 100755 --- a/templates/text_cards.sh +++ b/templates/text_cards.sh @@ -1,4 +1,4 @@ -# Copyright 2014 Paul Hänsch +# Copyright 2014, 2016 Paul Hänsch # # This file is part of Confetti. # @@ -15,8 +15,6 @@ # You should have received a copy of the GNU Affero General Public License # along with Confetti. If not, see . -declare -A item_name - item_name[PHOTO]="Foto" item_name[LOGO]="Logo" item_name[FN]="Voller Name" @@ -67,6 +65,14 @@ item_name[UID]="" item_name[VERSION]="" item_name[XML]="" +item_name[X-HEALTH-INSURANCE]="Krankenversicherung" +item_name[hi_company]="Versicherungsgesellschaft" +item_name[hi_number]="Versichertennummer" +item_name[hi_status]="Versichertenstatus" +item_name[X-HEALTH-INSURANCE-NOCONTRIB]="Zuzahlungsbefreiung" +item_name[X-CLIENT-REFERRAL]="Empfehlung durch" +item_name[prescriptions]="Verordnungen" + item_name[X-ZACK-JOINDATE]="Anmeldedatum" item_name[X-ZACK-LEAVEDATE]="Abmeldedatum" item_name[label_join]="Anm." @@ -109,3 +115,4 @@ item_name[female]="♀" item_name[male]="♂" item_name[other]="⚥" item_name[none]="⚪" + diff --git a/templates/view_client.sh b/templates/view_client.sh new file mode 100755 index 0000000..700420c --- /dev/null +++ b/templates/view_client.sh @@ -0,0 +1,85 @@ +# Copyright 2014 - 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 . + +cat < +

$values[FN]

+ ${values[GENDER]:+$(l10n $values[GENDER])} + + $(for n in NICKNAME NICKNAME{0..10}; do + echo "${values[$n]:+aka. $values[$n]}" + done) + + ${values[BDAY]:+*: $values[BDAY]} + ${values[X-ZACK-JOINDATE]:+$(l10n label_join): $values[X-ZACK-JOINDATE]} + ${values[X-ZACK-LEAVEDATE]:+$(l10n label_leave): $values[X-ZACK-LEAVEDATE]} + ${values[SOUND]:+} + ${values[PHOTO]:+} + ${values[LOGO]:+} +
+

$(l10n ADR)

+ $(for n in ADR ADR{0..10}; do + echo "${values[$n]:+$values[$n]}" + done) + ${values[URL]:+

$(l10n URL)

} + $(for n in URL URL{0..10}; do + echo "${values[$n]:+$values[$n]}" + done) +
+

$(l10n TEL)

+ $(for n in TEL TEL{0..10}; do + echo "${values[$n]:+$tags[${n}_TYPE] $values[$n]}" + done) + ${values[EMAIL]:+

$(l10n EMAIL)

} + $(for n in EMAIL EMAIL{0..10}; do + echo "${values[$n]:+}" + done) + ${values[IMPP]:+

$(l10n IMPP)

} + $(for n in IMPP IMPP{0..10}; do + echo "${values[$n]:+$tags[${n}_TYPE] $values[$n]}" + done) +
+

$(l10n X-HEALTH-INSURANCE)

+
+ ${values[NOTE]:+

$(l10n NOTE)

} + $(for n in NOTE NOTE{0..10}; do + echo "${values[$n]:+$values[$n]}" + done) + ${values[X-CLIENT-REFERRAL]:+

$(l10n X-CLIENT-REFERRAL)

} + $(for n in X-CLIENT-REFERRAL X-CLIENT-REFERRAL{0..10}; do + echo "${values[$n]:+$values[$n]}" + done) +
+

$(l10n prescriptions)

+
    + $(sed -rn 's:(.*)\t'$id'$:\1:p' "$_DATA/mappings/attendance" |while read each; do + cname="$(sed -rn 's:^SUMMARY\:(.*)$:\1:p' "$_DATA/ical/$each")" + echo '
  • '$cname'
  • ' + done) +
+
+END_HTML -- 2.39.2