]> git.plutz.net Git - confetti/blob - actions/new_card.sh
heuristic assignment transaction <-> vcard
[confetti] / actions / new_card.sh
1 #!/bin/zsh
2
3 # Copyright 2014 Paul Hänsch
4 #
5 # This file is part of Confetti.
6
7 # Confetti 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 # Confetti 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 Confetti.  If not, see <http://www.gnu.org/licenses/>. 
19
20 cgi_post
21 cgi_refdata
22
23 filter="&filter=${_REF[filter]}"
24 filtertype="&filtertype=${_REF[filtertype]}"
25 order="&order=${_REF[order]}"
26
27 uid=$(uuidgenerator)
28 card="${uid}.vcf"
29
30 tempfile="$_DATA/temp/$card"
31
32 cat >"$tempfile" <<EOF
33 BEGIN:VCARD
34 VERSION:4.0
35 N:;;;;
36 BDAY:
37 TEL:
38 EMAIL:
39 ADR:
40 NOTE:
41 UID:$uid
42 END:VCARD
43 EOF
44
45 echo -n "Location: ?p=cards${filter}${filtertype}${order}&edit=$card\n\n"