X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=templates%2Fprescriptions.html.sh;h=c4ef19addc060da015f8db7c6954aaebd23a38f1;hp=9a0dd480912145e0cf6e5f7f79b77c52c3fc2187;hb=fa569abc3f855692322f791a0c1112f85126e990;hpb=18ecf2c0b034e25c418a83ecb1adefb9f3f04cd8 diff --git a/templates/prescriptions.html.sh b/templates/prescriptions.html.sh index 9a0dd48..c4ef19a 100755 --- a/templates/prescriptions.html.sh +++ b/templates/prescriptions.html.sh @@ -15,17 +15,15 @@ # You should have received a copy of the GNU Affero General Public License # along with Confetti. If not, see . -edit="${_GET[edit]}" client="${_GET[client]}" -[ -z "$client" ] && client="${edit%.*.mpx}.vcf" +edit="${_GET[edit]}" +[ -n "$edit" ] && client="${edit%.*.mpx}.vcf" cat <$(view_card "$client") -

$(l10n prescriptions_current)

- -${edit:+$(edit_prescription "$edit")} +
@@ -33,15 +31,17 @@ ${edit:+$(edit_prescription "$edit")}
+EOF -$(list_prescriptions "$client" \ - |while read pre; do - view_prescription "$pre" - done -) +list_prescriptions "$client" |grep -q "$edit" || edit_prescription "$edit" -

$(l10n prescriptions_past)

+list_prescriptions "$client" \ +|while read pre; do + [ "$pre" = "$edit" ] \ + && edit_prescription "$pre" \ + || view_prescription "$pre" +done -EOF +# # vi:set filetype=html: