.card .control input.item { font-size: normal; }
.card .control button.item { text-align: right;}
.card .control button.item:hover{ border-color: #888;}
-.card .control .item[name=newfield] { width: 85%;}
-.card .control .item[value=addfield] { width: 15%;}
+
+.card .control .item[name=newfield] {
+ width: calc(100% - 2.5em);
+}
+.card .control .item[value=addfield] {
+ width: 2.5em;
+ border-style: solid solid solid none;
+ text-align: center;
+}
.card .control #delete + label + button,
.card .control #delete { display: none; }
width: 100%;
max-height: 10em;
}
-.card .section .GENDER { display: inline-block; padding-right: .5ex;}
+.card .section .GENDER { display: inline-block; padding-right: .5ex; }
.card .section .BDAY { display: inline-block;}
+.card .section .TEL .type { color: #444; }
.card .section select {
display: block;
form.card .section input[type=text],
form.card .section input:not([type]),
form.card .section textarea,
-form.card .section select {width: 100%;}
+form.card .section select {
+ width: 100%;
+ margin-bottom: .25em;
+}
+
+form.card .section select.teltype { margin-bottom: 0; }
+form.card .section input.TEL { margin-bottom: .5em; }
form.card .attendance {
min-width: 66%;
BDAY) printf %s "Geburtstag";;
EMAIL) printf %s "E-Mail";;
TEL) printf %s "Telefon";;
- phone_typeselect) printf %s "Typ";;
- phone_home) printf %s "Privat";;
- phone_cell) printf %s "Mobil";;
- phone_work) printf %s "Büro";;
- phone_fax) printf %s "Fax";;
- tHOME) printf %s "Privat:";;
- tWORK) printf %s "Büro:";;
- tCELL) printf %s "Mobil:";;
- tFAX) printf %s "Fax:";;
- tVOICE) printf %s "";;
+ teltype) printf %s "Anschlusstyp:";;
+ TYPE=HOME) printf %s "Privat";;
+ TYPE=WORK) printf %s "Geschäftlich";;
+ TYPE=CELL) printf %s "Mobil";;
+ TYPE=FAX) printf %s "Fax";;
IMPP) printf %s "Chat";;
ADR) printf %s "Anschrift";;
URL) printf %s "Webseite";;
other) printf %s "⚥";;
none) printf %s "⚪";;
- teltype) printf %s "Anschlusstyp:";;
- HOME) printf %s "Privat";;
- WORK) printf %s "Geschäftlich";;
- CELL) printf %s "Mobil";;
- FAX) printf %s "Fax";;
*) printf %s "$1";;
esac
teltype="$(pdi_attrib "$card" TEL $c TYPE)"
[ "$teltype" ] \
&& printf '[span .item .TEL [span .type ­%s:] %s]' \
- "$(l10n "$teltype" |HTML)" \
+ "$(l10n "TYPE=$teltype" |HTML)" \
"$(pdi_value "$card" TEL $c |unescape |HTML)" \
|| printf '[span .item .TEL ­%s]' \
"$(pdi_value "$card" TEL $c |unescape |HTML)"
[ $cnt -lt 1 ] && cnt=1
case $item in
- N)if N="$(pdi_value "$card" N)"; then
+ N)N="$(pdi_value "$card" N)"
+ if [ "$N" ]; then
IFS=\; read n1 n2 n3 n4 n5 <<-EOF
- $(pdi_value "$card" N)
+ $N
EOF
else
N="$(pdi_value "$card" FN |unescape)"
[option value="FAX" %s %s]
]\n' \
"$([ "$teltype" = '' ] && printf 'selected="selected"')" "$(l10n teltype)" \
- "$([ "$teltype" = 'HOME' ] && printf 'selected="selected"')" "$(l10n HOME)" \
- "$([ "$teltype" = 'WORK' ] && printf 'selected="selected"')" "$(l10n WORK)" \
- "$([ "$teltype" = 'CELL' ] && printf 'selected="selected"')" "$(l10n CELL)" \
- "$([ "$teltype" = 'FAX' ] && printf 'selected="selected"')" "$(l10n FAX)"
+ "$([ "$teltype" = 'HOME' ] && printf 'selected="selected"')" "$(l10n TYPE=HOME)" \
+ "$([ "$teltype" = 'WORK' ] && printf 'selected="selected"')" "$(l10n TYPE=WORK)" \
+ "$([ "$teltype" = 'CELL' ] && printf 'selected="selected"')" "$(l10n TYPE=CELL)" \
+ "$([ "$teltype" = 'FAX' ] && printf 'selected="selected"')" "$(l10n TYPE=FAX)"
printf '[input .item .%s name="%s" value="%s" placeholder="%s"]' \
"$item" "$item" "$(pdi_value "$card" "$item" $c |unescape |HTML)" "$(l10n "$item")"
[div .control
[select .item name="newfield"
[option value="" disabled="disabled" selected="selected" $(l10n edit_addfieldtext)]
- $(for f in ; do
+ $(for f in NICKNAME EMAIL TEL IMPP ADR URL NOTE; do
printf '[option value="%s" %s] ' "$f" "$(l10n "$f")"
done)
- ]
- [button .item type="submit" name="action" value="addfield" $(l10n edit_addfield)]
+ ][button .item type="submit" name="action" value="addfield" $(l10n edit_addfield)]
[button .item type="submit" name="action" value="update" $(l10n edit_update)]
[input type="checkbox" #delete] [label .item for="delete" $(l10n edit_delete)]
[button .item type="submit" name="action" value="delete"]
cardfile="$_DATA/vcard/$card"
attfile="$_DATA/mappings/attendance"
+action="$(POST action)"
+newfield="$(POST newfield)"
+
if ! tempfile=$(CHECK_SLOCK "$cardfile"); then
SET_COOKIE 0 message="NO VALID FILE LOCK"
REDIRECT "/cards/?o=${order}&f=${filter}&e=${card}"
;;
esac
done; done
-[ "$(POST action)" = addfield ] && vcf="$(vcf_update_field "$vcf" "$(POST newfield)" $(($(pdi_count $(POST newfield)) + 1)) '')"
+if [ "$action" = addfield ]; then
+ vcf="$(pdi_update_value "$vcf" "$newfield" $(( $(pdi_count "$vcf" "$newfield") + 1 )) '')"
+fi
printf '%s' "$vcf" |grep -vx '' >"$tempfile"
-case "$(POST action)" in
+case "$action" in
addfield)
REDIRECT "/cards/?o=${order}&f=${filter}&e=${card}"
;;