C3Reg-Renaming; adding devtal's passport
This commit is contained in:
44
start_dialog
44
start_dialog
@ -5,9 +5,9 @@ export TERM=vt220
|
||||
|
||||
export DIALOGRC=dialogrc
|
||||
|
||||
LOCKFILE=/tmp/irolock
|
||||
LOCKFILE=/tmp/c3reglock
|
||||
TMP=/tmp/$RANDOM
|
||||
BT="Intergalactic Registration Office - v0.3"
|
||||
BT="C3Reg - v0.4"
|
||||
|
||||
cd $(dirname "$0")
|
||||
|
||||
@ -222,13 +222,13 @@ function printReg() {
|
||||
return 0
|
||||
}
|
||||
|
||||
function printIROStamp() {
|
||||
askForField "IRO stamp" "$1"
|
||||
function printC3RegStamp() {
|
||||
askForField "C3Reg stamp" "$1"
|
||||
if [ $? -eq 0 ]; then
|
||||
checkLockFile
|
||||
diaBox "Insert Passport" "Please insert passport (Visas) into the printer."
|
||||
cd "$1"
|
||||
./iro $FIELD
|
||||
./c3reg $FIELD
|
||||
cd ..
|
||||
rm $LOCKFILE
|
||||
return 0
|
||||
@ -254,7 +254,7 @@ function askForField() {
|
||||
==================\n
|
||||
"
|
||||
|
||||
layout[adafruit]="
|
||||
layout[bounddipl]="
|
||||
------------------\n
|
||||
| VISAS || VISAS |\n
|
||||
==================\n
|
||||
@ -264,8 +264,20 @@ function askForField() {
|
||||
==================\n
|
||||
"
|
||||
|
||||
layout[stapleddipl]="
|
||||
------------------\n
|
||||
| VISAS || VISAS |\n
|
||||
==================\n
|
||||
| 0 | 1 || 4 | 5 |\n
|
||||
|---|---||---|---|\n
|
||||
| 2 | 3 || 6 | 7 |\n
|
||||
==================\n
|
||||
"
|
||||
|
||||
|
||||
maxfield[jhp]=11
|
||||
maxfield[adafruit]=7
|
||||
maxfield[bounddipl]=7
|
||||
maxfield[stapleddipl]=7
|
||||
|
||||
askStr 2 "Select a field" "$text ${layout[$2]}" "" 18
|
||||
if [ $? -eq 1 ]; then
|
||||
@ -284,7 +296,8 @@ function askReg() {
|
||||
# Max length of passport fields
|
||||
declare -A MAXLENGTH
|
||||
MAXLENGTH[jhp]=25
|
||||
MAXLENGTH[adafruit]=17
|
||||
MAXLENGTH[bounddipl]=17
|
||||
MAXLENGTH[stapleddipl]=17
|
||||
|
||||
askStr ${MAXLENGTH[$1]} "Forename/Nickname" "Enter forename/nickname"
|
||||
if [ $? -eq 1 ]; then
|
||||
@ -306,7 +319,7 @@ function askReg() {
|
||||
|
||||
confirm=" Forename: $FNAME\n Surname: $SNAME\n Place: $PLANET"
|
||||
|
||||
ynBox "IRO Stamp" "Does this being want to have a IRO stamp?"
|
||||
ynBox "C3Reg Stamp" "Does this being want to have a C3Reg stamp?"
|
||||
if [ $? -eq 0 ]; then
|
||||
STAMP=true
|
||||
else
|
||||
@ -330,7 +343,7 @@ function menuFor() {
|
||||
dialog --backtitle "$BT" \
|
||||
--menu "Select ID type:" 14 40 3 \
|
||||
1 "Registration" \
|
||||
2 "IRO Stamp" \
|
||||
2 "C3Reg Stamp" \
|
||||
3 "GPG" \
|
||||
9 "Back" 2> $TMP
|
||||
|
||||
@ -341,14 +354,14 @@ function menuFor() {
|
||||
if [ $? -eq 0 ]; then
|
||||
printReg "$1"
|
||||
if [ "$STAMP" == "true" ]; then
|
||||
printIROStamp "$1"
|
||||
printC3RegStamp "$1"
|
||||
fi
|
||||
if [ -n "$FP" ]; then
|
||||
printGPG "$1"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
2) printIROStamp "$1"
|
||||
2) printC3RegStamp "$1"
|
||||
;;
|
||||
3) enterGPG
|
||||
if [ $? -eq 0 ]; then
|
||||
@ -396,7 +409,8 @@ while [ true ]; do
|
||||
dialog --backtitle "$BT" \
|
||||
--menu "Select ID type:" 10 40 3 \
|
||||
1 "Junghackerpass" \
|
||||
2 "New Adafruit passport" \
|
||||
2 "Bound diplomatic passport" \
|
||||
3 "Stapled diplomatic passport" \
|
||||
9 "Logout" 2> $TMP
|
||||
|
||||
if [ $? -eq 9 ]; then
|
||||
@ -409,7 +423,9 @@ while [ true ]; do
|
||||
case $TYPE in
|
||||
1) menuFor jhp
|
||||
;;
|
||||
2) menuFor adafruit
|
||||
2) menuFor bounddipl
|
||||
;;
|
||||
3) menuFor stapleddipl
|
||||
;;
|
||||
9) break
|
||||
;;
|
||||
|
Reference in New Issue
Block a user