X-Git-Url: https://git.plutz.net/?p=confetti;a=blobdiff_plain;f=actions%2Fupdate_card.sh;h=a1143c3d72057359ef7b42a07c919c3d21ef33f4;hp=c2a4a7193654eaaf3ede4d8e2d99a703aa2fae1e;hb=refs%2Fheads%2Fmaster;hpb=d6ca659b75648cf1001d731484e643aa35888dd7
diff --git a/actions/update_card.sh b/actions/update_card.sh
deleted file mode 100755
index c2a4a71..0000000
--- a/actions/update_card.sh
+++ /dev/null
@@ -1,102 +0,0 @@
-#!/bin/zsh
-
-# 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 .
-
-cgi_refdata
-
-filter="&filter=${_REF[filter]}"
-filtertype="&filtertype=${_REF[filtertype]}"
-order="&order=${_REF[order]}"
-
-card="${_POST[card]}"
-tempfile="$_DATA/temp/$card"
-cardfile="$_DATA/vcard/$card"
-attfile="$_DATA/mappings/attendance"
-
-vcf_escape(){
- for each in "$@"; do
- printf %s\\n "$each" \
- | sed -r ':X;$!{N;bX}; s;\r\n;\n;g; s;([\n\;,\\]);\\\1;g;'
- done \
- | sed -r ':X;$!{N;bX}; s;\n;\;;g'
-}
-
-[ "${_POST[hi_select]}" = "list" ] || _POST[hi_company]="${_POST[hi_other]}"
-[ -n "${_POST[hi_company]}${_POST[hi_number]}${_POST[hi_status]}" ] \
-&& _POST[X-HEALTH-INSURANCE]="$(vcf_escape "${_POST[hi_company]}" "${_POST[hi_number]}" "${_POST[hi_status]}")"
-
-sed -r 's;$;\r;' >"$tempfile" <>"$attfile"
- sed -rn 's:^(.+)'$card'$:\1:p' "$attfile" |while read course; do
- touch "$_DATA/ical/$course"
- done
-
- mv "$tempfile" "$cardfile"
- redirect "?p=cards${filter}${filtertype}${order}#$card"
- ;;
- cancel)
- rm "$tempfile"
- [ -f "$cardfile" ] \
- && redirect "?p=cards${filter}${filtertype}${order}#$card" \
- || redirect "?p=cards${filter}${filtertype}${order}"
- ;;
- delete)
- rm "$tempfile" "$cardfile"
- redirect "?p=cards${filter}${filtertype}${order}"
- ;;
-esac