Compare commits

...

2 Commits

Author SHA1 Message Date
Gandalf 14f97e1765 deckblatt edit 2021-04-07 21:18:26 +02:00
Gandalf 7285aa1427 Usage message 2021-04-07 19:33:29 +02:00
5 changed files with 83 additions and 29 deletions

View File

@ -8,3 +8,4 @@ LGfl,Landgericht Flensburg,Damen und Herren,Südergraben 22\\24937 Flensburg,046
OLGsh,Schleswig-Holsteinisches Oberlandesgericht,Damen und Herren,Gottorfstraße 2\\24837 Schleswig,+ 49 4621 86-1372,+49 4621 86-0,Mit der Ihnen gebührenden Hochachtung,
AGkerpen,Amtsgericht Kerpen,,Nordring 2-8\\50171 Kerpen,02237 508-470,02237 508-0,Mit der Ihnen gebührenden Hochachtung,LGk
JCkalk,Jobcenter Köln\\Standort Kalk,Damen und Herren,Bergischer Ring 35-39\\51063 Köln,(0221) 96 44 34 00,(02 21) 96 44 35 90,Mit der Ihnen gebührenden Hochachtung,
POLk,Polizeipräsidium Köln,Damen und Herren,Walter-Pauli-Ring 2-6\\51103 Köln,0221 229-2002,0221 229-0,Gruß,

Can't render this file because it has a wrong number of fields in line 4.

View File

@ -8,7 +8,27 @@ LOC=""
COL=""
BASEPATH=$(dirname $(realpath $0))
if [ $F = "-l" ] # -l möchte kein weiteres Argument, im Gegensatz zu allen anderen Optionen.
function usage {
echo "Usage:
./address.sh <option> <handle>
Option is exactly one of the following:
-h Print this message und exit
-l List all available handles and names.
With those two options, no <handle> ist needed.
-g Generate new entry
-n Print name
-o Print preferred Opening
-c Print preferred Closing
-a Print address
-f Print fax number
-t Print telephone number
-p Print parent handle
-e Edit entry"
exit 1
}
if [ "$F" = "-l" ] # -l nimmt kein weiteres Argument, im Gegensatz zu allen anderen Optionen.
then
echo "handle: Name"
while IFS="," read -r COL1 COL2 COLX
@ -18,15 +38,23 @@ then
exit 0
fi
if [ "$F" = "-h" ] # -h auch nicht, um genau zu sein.
then
usage
fi
if [ $# -lt 2 ]
then
echo "Zu wenig Argumente"
exit 1
echo "Zu wenig Argumente
"
usage
fi
if [ $# -gt 2 ]
then
echo "Ignoriere überschüssige Argumente"
echo "Ignoriere überschüssige Argumente
"
usage
fi
case $F in
@ -35,12 +63,12 @@ case $F in
O=true
;;
"-a")
"-o")
COL=Anrede
O=true
;;
"-d")
"-a")
COL=Adresse
O=true
;;

View File

@ -15,28 +15,28 @@ if [ -e DECKBLATT.csv ]
then
# Formatiert anzeigen
echo "Deckblatt für $PWD"
join -t, -1 2 -2 1 <(sort -t, -k2 DECKBLATT.csv) <(sort $BASEPATH/Adressen.csv) -o 1.4,2.2,1.2,1.3 -a 1 | grep -v handle | sort | awk -F, '{ print $2 " (" $3 "): " $4 }' | sed -e 's|"||g' -e 's|^ (me)|Mein Az|'
join -t, -1 2 -2 1 <(sort -t, -k2 DECKBLATT.csv) <(sort $BASEPATH/Adressen.csv) -o 1.4,2.2,1.2,1.3 -a 1 | grep -v handle | sort | awk -F, '{ print $2 " (" $3 "): " $4 }' | sed -e 's|"||g' -e 's|^ ()|Mein Az|'
else
# Neu anlegen
read -p "Kein Deckblatt im Verzeichnis. Lege neues Deckblatt an? " NEW
if [[ ! $NEW =~ [yYjJ] ]]; then exit 0; fi
read -p "Mein Aktenzeichen: " MYAZ
until [[ $GEG =~ AG|LG|OLG|BGH|SG|VG|OVG|BVG|BVerfG|Pol|StA ]]
do
read -p "aktuelle Gegenseite? (AG/LG/OLG/SG/VG/OVG/BVG/BVerfG/Pol/StA) " GEG
done
echo "aktuelle Gegenseite?"
select GEG in AG LG OLG SG VG OVG BVG BVerfG Pol StA JC
do if [ ! -z "$GEG" ]; then break; fi; done
echo Auswahl: $GEG
read -p "Deren Aktenzeichen: " AZ
until [ $GEGHANDLE ]
do
read -p "Das eindeutige Kürzel für die Gegenseite: " GEGHANDLE
GEGNAME=$($BASEPATH/address.sh -n $GEGHANDLE)
if [ $GEGNAME ]
if [ -z "$GEGNAME" ]
then
read -p "$GEGNAME als Gegenseite bestätigen? (y/n) " GEGSAVE
if [[ ! $GEGSAVE =~ [yYjJ] ]]; then GEGSAVE= ; fi
else
read -p "$GEGHANDLE nicht gefunden. Neu anlegen? (y/n) " GEGSAVE
if [[ $GEGSAVE =~ [yYjJ] ]]; then $BASEPATH/address.sh -g $GEGHANDLE ; else GEGSAVE= ; fi
else
read -p "$GEGNAME als Gegenseite bestätigen? (y/n) " GEGSAVE
if [[ ! $GEGSAVE =~ [yYjJ] ]]; then GEGSAVE= ; fi
fi
done
if [[ $GEG =~ AG|LG|OLG|BGH ]]
@ -47,6 +47,26 @@ else
then
STA="StA,,$STAZ,\n"
fi
echo -e "INH,handle,az,stand\nME,,$MYAZ,0\n${STA}$GEG,$GEGHANDLE,$AZ,+"
echo -e "INH,handle,az,stand\nME,,$MYAZ,0\n${STA}$GEG,$GEGHANDLE,$AZ,+" > DECKBLATT.csv
fi
if [ $EDIT = true ]
then
echo "Was möchtest du tun?"
OPT1="Vorhandene Instanz zuständig machen"
OPT2="Neues Aktenzeichen anlegen"
select ACTION in "$OPT1" "$OPT2"
do if [ -n "$ACTION" ]; then break; fi; done
case "$ACTION" in
"$OPT1")
sed -i.bac -e "s/\+$//" DECKBLATT.csv
select NEWZ in $(cut -d, -f2 DECKBLATT.csv | tail -2) #Titelzeile und eigene Zeile weglassen
do if [ ! -z "$NEWZ" ]; then break; fi; done
LN=$(nl DECKBLATT.csv | grep -w $NEWZ | cut -f1 | tr -d " ")
sed -i.bac2 -e "${LN}s/$/+/" DECKBLATT.csv
;;
"$OPT2")
;;
esac
fi

View File

@ -55,21 +55,24 @@ Wo `INH ∈ {AG,LG,StA,OLG,BVerfG,VG,OVG,GEG,SG}` und `stand='+'` in der Zeile d
#### `address.sh`
Führt durch die Eintragung in die Adressdatenbank oder gibt einzelne Werte aus selbiger zurück. (Zur Verwendung durch `sipgate-cli` zB)
```
./address.sh <flag> <handle>
Usage:
./address.sh <option> <handle>
Option is exactly one of the following:
-h Print this message und exit
-l List all available handles and names.
With those two options, no <handle> ist needed.
-g Generate new entry
-n Print name
-o Print preferred Opening
-c Print preferred Closing
-a Print address
-f Print fax number
-t Print telephone number
-p Print parent handle
-e Edit entry
```
Verfügbare Flags:
* `-f` gibt die Faxnummer zurück. Anwendung: `fax <Datei> $(address.sh -f <handle>)`
* `-t`: Telefonnummer
* `-p`: Parent Entity
* `-a`: Anrede
* `-d`: Adresse
* `-n`: Name
* `-e`: Editieren
* `-c`: Closing
* `-g`: Erzeugen eines Eintrags
* `-l`: Auflisten aller `handle`s und Namen. Dies ist die einzige Option, die kein angegebenes `<handle>` verlangt.
Wird `<handle>` nicht angegeben, soll nach der aktuell zuständigen Stelle in einer `DECKBLATT.csv` gesucht werden. Das ist aber Zukunftsmusik, die Angabe von `<handle>` wird, außer bei `-l`, immer verlangt.
Wird `<handle>` nicht angegeben, soll nach der aktuell zuständigen Stelle in einer `DECKBLATT.csv` gesucht werden. Das ist aber Zukunftsmusik, die Angabe von `<handle>` wird, außer bei `-l` und `-h`, immer verlangt.
#### `deckblatt.sh`
Führt durch die Anlage eines Deckblattes ~~und stellt sicher, dass die korrekte Gerichtshierarchie eingetragen ist~~.
Falls schon ein Deckblatt existiert, soll dieses angezeigt werden.

View File

@ -39,6 +39,7 @@
\newcommand*{\receivestar}[1]{
\DTLloaddb{adressen}{/home/bernhardt/Entwicklung/Letterhead/Adressen/Adressen.csv}
\DTLassignfirstmatch{adressen}{handle}{#1}{\Name=Name,\Adresse=Adresse,\FaxNr=FaxNr,\TelNr=TelNr,\Opening=Anrede,\Closing=Closing}
\newcommand\FullAdress{\Name\\\Adresse\\per Fax: \FaxNr}
\ifthenelse{\equal{\Opening}{}}{\renewcommand\Opening{Damen und Herren}}
% \ifthenelse{\equal{\Closing}{}}{\renewcommand\Closing{Mit der Ihnen gebührenden Hochachtung}}
% Why the hell does this line throw "\equal not def'd" and the line before does not?
@ -56,6 +57,7 @@
\xDTLassignfirstmatch{adressen}{handle}{\handle}{\Name=Name,\Adresse=Adresse,\FaxNr=FaxNr,\TelNr=TelNr,\Opening=Anrede,\Closing=Closing}
\setkomavar{yourref}{\aktenzeichen}
\setkomavar{myref}{\myref}
\newcommand\FullAdress{\Name\\\Adresse\\per Fax: \FaxNr}
\ifthenelse{\equal{\Opening}{}}{\renewcommand\Opening{Damen und Herren}}
\ifthenelse{\equal{\Closing}{}}{\renewcommand\Closing{Mit der Ihnen gebührenden Hochachtung}}
}