Make address.sh -e permanent
And make letterhead.cls use default values for emtpy Opening and Closing
This commit is contained in:
parent
a6baa58013
commit
6666985a08
|
@ -2,8 +2,8 @@ handle,Name,Anrede,Adresse,FaxNr,TelNr,Closing,parent
|
|||
AGdn,"AG Düren","Damen und Herren","August-Klotz-Str. 14\\52349 Düren",02421 493-6001,02421 493-0,"Mit der Ihnen gebührenden Hochachtung",LGac
|
||||
LGac,"Landgericht Aachen","Damen und Herren","Adalbertsteinweg 92\\52070 Aachen",0241 9425-80000,0241 9425-0,"Mit der Ihnen gebührenden Hochachtung",OLGham
|
||||
OLGham,Oberlandesgericht Hamm,,Heßlerstraße 53\\59065 Hamm,02381 272-518,02381 272-0,
|
||||
AGkerpen,Amtsgericht Kerpen,,Nordring 2-8\\50171 Kerpen,02237 508-470,02237 508-0,LGk
|
||||
LGk,Landgericht Köln,Damen und Herren,Luxemburger Straße 101\\50939 Köln,0221 477-3333,0221 477-0,Mit der Ihnen gebührenden Hochachtung,OLGk
|
||||
AGfl,Amtsgericht Flensburg,Damen und Herren,Südergraben 22\\24937 Flensburg,0461 89-434,0461 89-0,Mit der Ihnen gebührenden Hochachtung,LGfl
|
||||
LGfl,Landgericht Flensburg,Damen und Herren,Südergraben 22\\24937 Flensburg,0461 89-295,0461 89-0,Mit der Ihnen gebührenden Hochachtung,OLGsh
|
||||
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
|
||||
|
|
Can't render this file because it has a wrong number of fields in line 4.
|
|
@ -90,14 +90,16 @@ then
|
|||
exit 1
|
||||
fi
|
||||
fi
|
||||
IFS=',' read -ra HEADER <<< $(grep "^handle" $BASEPATH/Adressen.csv) #read field keys
|
||||
IFS=',' read -ra VALUES <<< $(grep "^$H" $BASEPATH/Adressen.csv) #read old values
|
||||
IFS=',' read -ra HEADER <<< $(grep "^handle," $BASEPATH/Adressen.csv) #read field keys
|
||||
IFS=',' read -ra VALUES <<< $(grep "^$H," $BASEPATH/Adressen.csv) #read old values
|
||||
# for loop startet bei 1, um die handle Spalte nicht zu editieren:
|
||||
NEWLINE="$H"
|
||||
for (( i=1; i<${#HEADER[@]}; i++ ));
|
||||
do
|
||||
read -rp "${HEADER[$i]} (${VALUES[$i]}): " NEWVAL
|
||||
# echo "${HEADER[$i]} (${VALUES[$i]}): "
|
||||
VALUES[$i]=${NEWVAL:-${VALUES[$i]}}
|
||||
NEWLINE="$NEWLINE,${VALUES[$i]}" #already prepare output line
|
||||
if [ ${HEADER[$i]} = "parent" ]
|
||||
then
|
||||
PARENT=${VALUES[$i]}
|
||||
|
@ -109,7 +111,8 @@ then
|
|||
fi
|
||||
fi
|
||||
done
|
||||
echo ${VALUES[*]}
|
||||
echo "$(grep -v "^$H," $BASEPATH/Adressen.csv)" > $BASEPATH/Adressen.csv
|
||||
echo $NEWLINE >> $BASEPATH/Adressen.csv
|
||||
fi
|
||||
|
||||
if [ $F = "-g" ]
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
\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}
|
||||
\ifthenelse{\equal{\Opening}{}}{\renewcommand\Opening{Damen und Herren}}
|
||||
\ifthenelse{\equal{\Closing}{}}{\renewcommand\Closing{Mit der Ihnen gebührenden Hochachtung}}
|
||||
}
|
||||
|
||||
\newcommand*{\receivenostar}[1][+]{
|
||||
|
@ -38,6 +40,8 @@
|
|||
\xDTLassignfirstmatch{adressen}{handle}{\handle}{\Name=Name,\Adresse=Adresse,\FaxNr=FaxNr,\TelNr=TelNr,\Opening=Anrede,\Closing=Closing}
|
||||
\setkomavar{yourref}{\aktenzeichen}
|
||||
\setkomavar{myref}{\myref}
|
||||
\ifthenelse{\equal{\Opening}{}}{\renewcommand\Opening{Damen und Herren}}
|
||||
\ifthenelse{\equal{\Closing}{}}{\renewcommand\Closing{Mit der Ihnen gebührenden Hochachtung}}
|
||||
}
|
||||
\newcommand*{\receive}{\@ifstar{\receivestar}{\receivenostar}}
|
||||
|
||||
|
|
Loading…
Reference in a new issue