while [ "$dts_date" -lt "$today" ]; do dts_date="$(date -d "${dts_date} + ${rec}" +%Y%m%d)"; done
for n in 1 2 3 4 5 6 7 8 9 10; do
- LANG=de_DE.UTF-8 date -d "$dts_date" +"%A, %d. %b."
+ LANG=de_DE.UTF-8 date -d "$dts_date" +"%d. %b."
dts_date="$(date -d "${dts_date} + ${rec}" +%Y%m%d)"
done
}
-"$_EXEC/cgilite/html-sh.sed" <<-EOF |sed -E 's;<(td|th)([^>]*)>;<\1 \2 style="border: 1pt solid\; padding: 1mm 2mm\;">;g' >"$htmlfile"
+# some table styles need to be inline, because this is how libreoffice works
+style_td='style="border: 1pt solid; padding: 1mm 2mm; vertical-align: top;"'
+
+"$_EXEC/cgilite/html-sh.sed" <<-EOF >"$htmlfile"
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
[html [head
[meta http-equiv="content-type" content="text/html; charset=utf-8"]
th, td { text-align: left; }
]
][body lang="de_DE"
- [table width="100%"
+ [table width="100%" style="page-break-after: always;"
[col width=10*] [col width=5*] [col width=10*] [col width=15*]
[thead
- [tr [th . $(l10n N)] [th . $(l10n BDAY)] [th . $(l10n TEL)] [th . $(l10n NOTE)]]
+ [tr [th $style_td . $(l10n N)] [th $style_td . $(l10n BDAY)] [th $style_td . $(l10n TEL)] [th $style_td . $(l10n NOTE)]]
][tbody
$(grep -F "${coursefile##*/} " "$_DATA/mappings/attendance" |while read discard each; do
vcf="$(pdi_load "$_DATA/vcard/$each")"
[ "$type" ] && type="$(l10n "TYPE=$type"):"
printf '%s %s<br>' "$type" "$(pdi_value "$vcf" TEL $n)"
done )"
- printf '[tr [td .N . %s] [td .BDAY . %s] [td .TEL . %s] [td .NOTE . %s]]\n' \
- "$(pdi_value "$vcf" FN |unescape |HTML)" \
- "$(pdi_value "$vcf" BDAY |unescape |HTML)" \
- "$tel" \
- "$(pdi_value "$vcf" NOTE |unescape |HTML)"
- done |sort -k4)]
+ printf '[tr valign=top [td %s .N . %s] [td %s .BDAY . %s] [td %s .TEL . %s] [td %s .NOTE . %s]]\n' \
+ "$style_td" "$(pdi_value "$vcf" FN |unescape |HTML)" \
+ "$style_td" "$(pdi_value "$vcf" BDAY |unescape |HTML)" \
+ "$style_td" "$tel" \
+ "$style_td" "$(pdi_value "$vcf" NOTE |unescape |HTML)"
+ done |sort)]
]
- [table width="100%" style="page-break-before: always;"
+ [table width="100%"
[col width=30*] [col width=10*] [col width=10*] [col width=10*] [col width=10*] [col width=10*] [col width=10*] [col width=10*] [col width=10*] [col width=10*] [col width=10*]
[thead
- [tr [th ] $(get_dates |xargs -d\\n printf '[th . %s]')]
+ [tr [th $style_td ] $(get_dates |xargs -d\\n printf "[th $style_td . %s]")]
][tbody
$(grep -F "${coursefile##*/} " "$_DATA/mappings/attendance" |while read discard each; do
vcf="$(pdi_load "$_DATA/vcard/$each")"
- printf '[tr [td .N . %s] [td] [td] [td] [td] [td] [td] [td] [td] [td] [td]]\n' \
- "$(pdi_value "$vcf" FN |unescape |HTML)"
- done |sort -k4)]
+ printf '[tr [td %s .N . %s] [td %s] [td %s] [td %s] [td %s] [td %s] [td %s] [td %s] [td %s] [td %s] [td %s]]\n' \
+ "$style_td" "$(pdi_value "$vcf" FN |unescape |HTML)" \
+ "$style_td" "$style_td" "$style_td" "$style_td" "$style_td" "$style_td" "$style_td" "$style_td" "$style_td" "$style_td"
+ done |sort)]
]
]]
EOF