Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
citizen-science
symbai
Commits
1d585e74
Commit
1d585e74
authored
Jul 08, 2014
by
Dave Griffiths
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
editor history and unanswered/yes/no/not set for all previous toggles - breaks database
parent
43a6057f
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
962 additions
and
847 deletions
+962
-847
android/assets/dbsync.scm
android/assets/dbsync.scm
+18
-14
android/assets/starwisp.scm
android/assets/starwisp.scm
+137
-75
android/assets/translations.csv
android/assets/translations.csv
+266
-223
android/assets/translations.scm
android/assets/translations.scm
+266
-266
eavdb/entity-values.ss
eavdb/entity-values.ss
+2
-2
eavdb/ktv-list.ss
eavdb/ktv-list.ss
+7
-0
translations.csv
translations.csv
+266
-267
No files found.
android/assets/dbsync.scm
View file @
1d585e74
...
@@ -107,19 +107,21 @@
...
@@ -107,19 +107,21 @@
(
msg
"INCORRECT TYPE FOR"
key
":"
type
":"
value
))
(
msg
"INCORRECT TYPE FOR"
key
":"
type
":"
value
))
(
let
((
existing-type
(
ktv-get-type
(
get-current
'entity-values
'
())
key
)))
(
let
((
existing-type
(
ktv-get-type
(
get-current
'entity-values
'
())
key
)))
(
if
(
equal?
existing-type
type
)
(
cond
(
set-current!
((
equal?
existing-type
type
)
'entity-values
;; save straight to local db every time (checks for modification)
(
ktv-set
(
entity-update-single-value!
(
list
key
type
value
))
(
get-current
'entity-values
'
())
;; then save to memory
(
ktv
key
type
value
)))
(
set-current!
;;
'entity-values
(
begin
(
ktv-set
(
msg
"entity-set-value! - adding new "
key
"of type"
type
"to entity"
)
(
get-current
'entity-values
'
())
(
entity-add-value-create!
key
type
value
)))
(
ktv
key
type
value
))))
;; save straight to local db every time
;;
(
entity-update-single-value!
(
list
key
type
value
))
(
else
))
(
msg
"entity-set-value! - adding new "
key
"of type"
type
"to entity"
)
(
entity-add-value-create!
key
type
value
))
)))
(
define
(
date-time->string
dt
)
(
define
(
date-time->string
dt
)
...
@@ -179,6 +181,8 @@
...
@@ -179,6 +181,8 @@
(
table
(
get-current
'table
#f
))
(
table
(
get-current
'table
#f
))
(
unique-id
(
ktv-get
(
get-current
'entity-values
'
())
"unique_id"
)))
(
unique-id
(
ktv-get
(
get-current
'entity-values
'
())
"unique_id"
)))
(
cond
(
cond
((
ktv-eq?
(
ktv-get-whole
(
get-current
'entity-values
'
())
(
ktv-key
ktv
))
ktv
)
(
msg
"eusv: no change for"
(
ktv-key
ktv
)))
(
unique-id
(
unique-id
(
update-entity
db
table
(
entity-id-from-unique
db
table
unique-id
)
(
list
ktv
)))
(
update-entity
db
table
(
entity-id-from-unique
db
table
unique-id
)
(
list
ktv
)))
(
else
(
else
...
@@ -595,7 +599,7 @@
...
@@ -595,7 +599,7 @@
(
vert
(
vert
(
text-view
(
symbol->id
id
)
(
text-view
(
symbol->id
id
)
(
mtext-lookup
id
)
(
mtext-lookup
id
)
30
(
layout
'wrap-content
'wrap-content
1
'centre
1
0
))
30
(
layout
'wrap-content
'wrap-content
1
'centre
0
))
(
spinner
(
make-id
(
string-append
(
symbol->string
id
)
"-spinner"
))
(
spinner
(
make-id
(
string-append
(
symbol->string
id
)
"-spinner"
))
(
map
mtext-lookup
types
)
(
map
mtext-lookup
types
)
(
layout
'wrap-content
'wrap-content
1
'centre
0
)
(
layout
'wrap-content
'wrap-content
1
'centre
0
)
...
...
android/assets/starwisp.scm
View file @
1d585e74
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
;; colours
;; colours
(
msg
"starting up...."
)
(
msg
"starting up...."
)
(
define
entity-types
(
list
"village"
"household"
"individual"
))
(
define
entity-types
(
list
"village"
"household"
"individual"
"child"
"crop"
))
(
define
trans-col
(
list
0
0
0
0
))
(
define
trans-col
(
list
0
0
0
0
))
(
define
colour-one
(
list
0
0
255
100
))
(
define
colour-one
(
list
0
0
255
100
))
...
@@ -62,18 +62,19 @@
...
@@ -62,18 +62,19 @@
;;(display (db-all db "local" "app-settings"))(newline)
;;(display (db-all db "local" "app-settings"))(newline)
(
define
tribes-list
'
(
khasi
other
))
(
define
tribes-list
'
(
not-set
khasi
other
no-answered
))
(
define
subtribe-list
'
(
khynriam
pnar
bhoi
war
other
))
(
define
subtribe-list
'
(
not-set
khynriam
pnar
bhoi
war
other
not-answered
))
(
define
education-list
'
(
primary
middle
high
secondary
university
))
(
define
education-list
'
(
not-set
primary
middle
high
secondary
university
not-answered
))
(
define
married-list
'
(
currently-married
currently-single
seperated
))
(
define
married-list
'
(
not-set
currently-married
currently-single
seperated
not-answered
))
(
define
residence-list
'
(
birthplace
spouse-village
))
(
define
residence-list
'
(
not-set
birthplace
spouse-village
not-answered
))
(
define
gender-list
'
(
male
female
))
(
define
gender-list
'
(
not-set
male
female
not-answered
))
(
define
house-type-list
'
(
concrete
tin
thatched
other
))
(
define
house-type-list
'
(
not-set
concrete
tin
thatched
other
not-answered
))
(
define
yesno-list
'
(
not-set
yes
no
not-answered
))
(
define
social-types-list
'
(
knowledge
prestige
))
(
define
social-types-list
'
(
knowledge
prestige
))
(
define
social-relationship-list
'
(
mother
father
sister
brother
spouse
children
co-wife
spouse-mother
spouse-father
spouse-brother-wife
spouse-sister-husband
friend
neighbour
other
))
(
define
social-relationship-list
'
(
not-set
mother
father
sister
brother
spouse
children
co-wife
spouse-mother
spouse-father
spouse-brother-wife
spouse-sister-husband
friend
neighbour
other
not-answered
))
(
define
social-residence-list
'
(
same
other
))
(
define
social-residence-list
'
(
not-set
same
other
not-answered
))
(
define
social-strength-list
'
(
daily
weekly
monthly
less
))
(
define
social-strength-list
'
(
not-set
daily
weekly
monthly
less
not-answered
))
(
define
village-ktvlist
(
define
village-ktvlist
(
list
(
list
...
@@ -103,20 +104,22 @@
...
@@ -103,20 +104,22 @@
(
define
individual-ktvlist
(
define
individual-ktvlist
(
list
(
list
(
ktv
"edit-history"
"varchar"
""
)
(
ktv
"social-edit-history"
"varchar"
""
)
(
ktv
"name"
"varchar"
""
)
(
ktv
"name"
"varchar"
""
)
(
ktv
"first-name"
"varchar"
""
)
(
ktv
"first-name"
"varchar"
""
)
(
ktv
"family"
"varchar"
""
)
(
ktv
"family"
"varchar"
""
)
(
ktv
"photo-id"
"varchar"
""
)
(
ktv
"photo-id"
"varchar"
""
)
(
ktv
"photo"
"file"
""
)
(
ktv
"photo"
"file"
""
)
(
ktv
"tribe"
"varchar"
""
)
(
ktv
"tribe"
"varchar"
"
not-set
"
)
(
ktv
"subtribe"
"varchar"
""
)
(
ktv
"subtribe"
"varchar"
"
not-set
"
)
(
ktv
"child"
"int"
-1
)
(
ktv
"child"
"int"
-1
)
(
ktv
"age"
"int"
-1
)
(
ktv
"age"
"int"
-1
)
(
ktv
"gender"
"varchar"
""
)
(
ktv
"gender"
"varchar"
"
not-set
"
)
(
ktv
"literate"
"
int"
0
)
(
ktv
"literate"
"
varchar"
"not-set"
)
(
ktv
"education"
"varchar"
""
)
(
ktv
"education"
"varchar"
"
not-set
"
)
(
ktv
"head-of-house"
"varchar"
""
)
(
ktv
"head-of-house"
"varchar"
""
)
(
ktv
"marital-status"
"varchar"
""
)
(
ktv
"marital-status"
"varchar"
"
not-set
"
)
(
ktv
"times-married"
"int"
-1
)
(
ktv
"times-married"
"int"
-1
)
(
ktv
"id-spouse"
"varchar"
""
)
(
ktv
"id-spouse"
"varchar"
""
)
(
ktv
"children-living"
"int"
-1
)
(
ktv
"children-living"
"int"
-1
)
...
@@ -131,22 +134,22 @@
...
@@ -131,22 +134,22 @@
(
ktv
"num-residence-changes"
"int"
-1
)
(
ktv
"num-residence-changes"
"int"
-1
)
(
ktv
"village-visits-month"
"int"
-1
)
(
ktv
"village-visits-month"
"int"
-1
)
(
ktv
"village-visits-year"
"int"
-1
)
(
ktv
"village-visits-year"
"int"
-1
)
(
ktv
"occupation-agriculture"
"
int"
0
)
(
ktv
"occupation-agriculture"
"
varchar"
"not-set"
)
(
ktv
"occupation-gathering"
"
int"
0
)
(
ktv
"occupation-gathering"
"
varchar"
"not-set"
)
(
ktv
"occupation-labour"
"
int"
0
)
(
ktv
"occupation-labour"
"
varchar"
"not-set"
)
(
ktv
"occupation-cows"
"
int"
0
)
(
ktv
"occupation-cows"
"
varchar"
"not-set"
)
(
ktv
"occupation-fishing"
"
int"
0
)
(
ktv
"occupation-fishing"
"
varchar"
"not-set"
)
(
ktv
"occupation-other"
"varchar"
""
)
(
ktv
"occupation-other"
"varchar"
""
)
(
ktv
"contribute"
"
int"
0
)
(
ktv
"contribute"
"
varchar"
"not-set"
)
(
ktv
"own-land"
"
int"
0
)
(
ktv
"own-land"
"
varchar"
"not-set"
)
(
ktv
"rent-land"
"
int"
0
)
(
ktv
"rent-land"
"
varchar"
"not-set"
)
(
ktv
"hire-land"
"
int"
0
)
(
ktv
"hire-land"
"
varchar"
"not-set"
)
(
ktv
"house-type"
"varchar"
""
)
(
ktv
"house-type"
"varchar"
"
not-set
"
)
(
ktv
"loan"
"int"
-1
)
(
ktv
"loan"
"int"
-1
)
(
ktv
"earning"
"int"
-1
)
(
ktv
"earning"
"int"
-1
)
(
ktv
"radio"
"
int"
0
)
(
ktv
"radio"
"
varchar"
"not-set"
)
(
ktv
"tv"
"
int"
0
)
(
ktv
"tv"
"
varchar"
"not-set"
)
(
ktv
"mobile"
"
int"
0
)
(
ktv
"mobile"
"
varchar"
"not-set"
)
(
ktv
"visit-market"
"int"
-1
)
(
ktv
"visit-market"
"int"
-1
)
(
ktv
"town-sell"
"int"
-1
)
(
ktv
"town-sell"
"int"
-1
)
(
ktv
"social-one"
"varchar"
""
)
(
ktv
"social-one"
"varchar"
""
)
...
@@ -212,10 +215,10 @@
...
@@ -212,10 +215,10 @@
(
define
child-ktvlist
(
define
child-ktvlist
(
list
(
list
(
ktv
"name"
"varchar"
(
mtext-lookup
'default-child-name
))
(
ktv
"name"
"varchar"
(
mtext-lookup
'default-child-name
))
(
ktv
"alive"
"
int"
1
)
(
ktv
"alive"
"
varchar"
"varchar"
"not-set"
)
(
ktv
"gender"
"varchar"
""
)
(
ktv
"gender"
"varchar"
"
not-set
"
)
(
ktv
"age"
"int"
-1
)
(
ktv
"age"
"int"
-1
)
(
ktv
"living-at-home"
"
int"
0
)))
(
ktv
"living-at-home"
"
varchar"
"not-set"
)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
...
@@ -228,6 +231,50 @@
...
@@ -228,6 +231,50 @@
(
update-widget
'debug-text-view
(
get-id
"sync-debug"
)
'text
(
update-widget
'debug-text-view
(
get-id
"sync-debug"
)
'text
(
get-current
'debug-text
""
)))
(
get-current
'debug-text
""
)))
;; return last element from comma seperated list
(
define
(
history-get-last
txt
)
(
let
((
l
(
string-split
txt
'
(
#
\
,
))))
(
if
(
null?
l
)
""
(
car
(
reverse
l
)))))
(
define
(
contains-social?
ktv-list
)
(
foldl
(
lambda
(
ktv
r
)
(
if
(
and
(
not
r
)
(
>
(
string-length
(
ktv-key
ktv
))
5
)
(
or
(
equal?
(
substring
(
ktv-key
ktv
)
0
6
)
"friend"
)
(
equal?
(
substring
(
ktv-key
ktv
)
0
6
)
"social"
)))
#t
r
))
#f
ktv-list
))
(
define
(
update-edit-history
db
table
user-id
)
;; get dirty individual entities
(
let
((
de
(
db-select
db
(
string-append
"select entity_id from "
table
"_entity where dirty=1 and entity_type='individual';"
))))
(
when
(
not
(
null?
de
))
(
for-each
(
lambda
(
i
)
(
msg
i
)
(
let*
((
entity-id
(
vector-ref
i
0
))
(
dirty-items
(
dbg
(
get-entity-plain-for-sync
db
table
entity-id
))))
(
when
(
not
(
null?
dirty-items
))
;; check if social change
(
let
((
type
(
if
(
contains-social?
dirty-items
)
"social-edit-history"
"edit-history"
)))
;; check if last editor is different
(
let
((
editors
(
car
(
get-value
db
table
entity-id
(
list
type
"varchar"
)))))
(
when
(
or
(
equal?
editors
""
)
(
not
(
equal?
(
history-get-last
editors
)
user-id
)))
;; append user id
(
msg
"history - setting"
type
)
(
if
(
equal?
editors
""
)
(
update-value
db
table
entity-id
(
ktv
type
"varchar"
(
dbg
user-id
)))
(
update-value
db
table
entity-id
(
ktv
type
"varchar"
(
dbg
(
string-append
editors
","
user-id
)))))))))))
(
cdr
de
)))))
(
define
(
debug-timer-cb
)
(
define
(
debug-timer-cb
)
(
alog
"debug timer cb"
)
(
alog
"debug timer cb"
)
(
append
(
append
...
@@ -242,6 +289,7 @@
...
@@ -242,6 +289,7 @@
(
lambda
()
(
lambda
()
(
msg
"connected, going in..."
)
(
msg
"connected, going in..."
)
(
alog
"got here..."
)
(
alog
"got here..."
)
(
update-edit-history
db
"sync"
(
get-current
'user-id
"no id"
))
(
append
(
append
(
list
(
toast
"Syncing"
))
(
list
(
toast
"Syncing"
))
(
upload-dirty
db
)
(
upload-dirty
db
)
...
@@ -1045,20 +1093,23 @@
...
@@ -1045,20 +1093,23 @@
(
spacer
20
)
(
spacer
20
)
(
mtext
'photo-id-display
)
(
mtext
'photo-id-display
)
))
))
(
m
button
'agreement-button
(
lambda
()
(
list
(
start-activity
"agreement"
0
""
)))
)
(
m
text
'last-editor
)
(
horiz
(
horiz
(
mbutton-scale
'
details
-button
(
lambda
()
(
list
(
start-activity
"
details
"
0
""
))))
(
mbutton-scale
'
agreement
-button
(
lambda
()
(
list
(
start-activity
"
agreement
"
0
""
))))
(
mbutton-scale
'
fam
il
y
-button
(
lambda
()
(
list
(
start-activity
"
fam
il
y
"
0
""
)))))
(
mbutton-scale
'
deta
il
s
-button
(
lambda
()
(
list
(
start-activity
"
deta
il
s
"
0
""
)))))
(
horiz
(
horiz
(
mbutton-scale
'
migration
-button
(
lambda
()
(
list
(
start-activity
"
migration
"
0
""
))))
(
mbutton-scale
'
family
-button
(
lambda
()
(
list
(
start-activity
"
family
"
0
""
))))
(
mbutton-scale
'
income
-button
(
lambda
()
(
list
(
start-activity
"
income
"
0
""
)))))
(
mbutton-scale
'
migration
-button
(
lambda
()
(
list
(
start-activity
"
migration
"
0
""
)))))
(
horiz
(
horiz
(
mbutton-scale
'genealogy-button
(
lambda
()
(
list
(
start-activity
"genealogy"
0
""
))))
(
mbutton-scale
'income-button
(
lambda
()
(
list
(
start-activity
"income"
0
""
))))
(
mbutton-scale
'friendship-button
(
lambda
()
(
list
(
start-activity
"friendship"
0
""
)))))
(
mbutton-scale
'genealogy-button
(
lambda
()
(
list
(
start-activity
"genealogy"
0
""
)))))
(
spacer
20
)
(
mtext
'last-social-editor
)
(
horiz
(
horiz
(
mbutton-scale
'
social
-button
(
lambda
()
(
list
(
start-activity
"
social
"
0
""
))))
(
mbutton-scale
'
friendship
-button
(
lambda
()
(
list
(
start-activity
"
friendship
"
0
""
))))
(
mbutton-scale
'
move
-button
(
lambda
()
(
list
(
start-activity
"
move
"
0
""
)))))
(
mbutton-scale
'
social
-button
(
lambda
()
(
list
(
start-activity
"
social
"
0
""
)))))
(
spacer
20
)
(
spacer
20
)
(
mbutton-scale
'move-button
(
lambda
()
(
list
(
start-activity
"move"
0
""
))))
(
delete-button
))
(
delete-button
))
(
lambda
(
activity
arg
)
(
lambda
(
activity
arg
)
...
@@ -1070,6 +1121,10 @@
...
@@ -1070,6 +1121,10 @@
(
append
(
append
(
update-top-bar
)
(
update-top-bar
)
(
list
(
list
(
update-widget
'text-view
(
get-id
"last-editor"
)
'text
(
string-append
"Last edit by "
(
history-get-last
(
entity-get-value
"edit-history"
))))
(
update-widget
'text-view
(
get-id
"last-social-editor"
)
'text
(
string-append
"Last edit by "
(
history-get-last
(
entity-get-value
"social-edit-history"
))))
(
mupdate
'text-view
'name-display
"name"
)
(
mupdate
'text-view
'name-display
"name"
)
(
mupdate
'text-view
'first-name-display
"first-name"
)
(
mupdate
'text-view
'first-name-display
"first-name"
)
(
mupdate
'text-view
'family-display
"family"
)
(
mupdate
'text-view
'family-display
"family"
)
...
@@ -1106,7 +1161,8 @@
...
@@ -1106,7 +1161,8 @@
(
medit-text
'age
"numeric"
(
lambda
(
v
)
(
entity-set-value!
"age"
"int"
(
string->number
v
))
'
()))
(
medit-text
'age
"numeric"
(
lambda
(
v
)
(
entity-set-value!
"age"
"int"
(
string->number
v
))
'
()))
(
mspinner
'gender
gender-list
(
lambda
(
v
)
(
entity-set-value!
"gender"
"varchar"
(
spinner-choice
gender-list
v
))
'
())))
(
mspinner
'gender
gender-list
(
lambda
(
v
)
(
entity-set-value!
"gender"
"varchar"
(
spinner-choice
gender-list
v
))
'
())))
(
horiz
(
horiz
(
mtoggle-button-scale
'literate
(
lambda
(
v
)
(
entity-set-value!
"literate"
"int"
v
)
'
()))
(
mspinner
'literate
yesno-list
(
lambda
(
v
)
(
entity-set-value!
"literate"
"varchar"
(
spinner-choice
yesno-list
v
))
'
()))
(
mspinner
'education
education-list
(
mspinner
'education
education-list
(
lambda
(
v
)
(
lambda
(
v
)
(
entity-set-value!
"education"
"varchar"
(
entity-set-value!
"education"
"varchar"
...
@@ -1129,7 +1185,7 @@
...
@@ -1129,7 +1185,7 @@
(
mupdate
'image-view
'photo
"photo"
)
(
mupdate
'image-view
'photo
"photo"
)
(
mupdate
'edit-text
'age
"age"
)
(
mupdate
'edit-text
'age
"age"
)
(
mupdate-spinner
'gender
"gender"
gender-list
)
(
mupdate-spinner
'gender
"gender"
gender-list
)
(
mupdate
'toggle-button
'literate
"literate"
)
(
mupdate
-spinner
'literate
"literate"
yesno-list
)
(
mupdate-spinner
'education
"education"
education-list
)
(
mupdate-spinner
'education
"education"
education-list
)
)))
)))
(
lambda
(
activity
)
'
())
(
lambda
(
activity
)
'
())
...
@@ -1289,20 +1345,20 @@
...
@@ -1289,20 +1345,20 @@
(
vert
(
vert
(
mtitle
'occupation
)
(
mtitle
'occupation
)
(
horiz
(
horiz
(
m
toggle-button-scale
'occupation-agriculture
(
lambda
(
v
)
(
entity-set-value!
"occupation-agriculture"
"
int"
v
)
'
()))
(
m
spinner
'occupation-agriculture
yesno-list
(
lambda
(
v
)
(
entity-set-value!
"occupation-agriculture"
"
varchar"
(
spinner-choice
yesno-list
v
)
)
'
()))
(
m
toggle-button-scale
'occupation-gathering
(
lambda
(
v
)
(
entity-set-value!
"occupation-gathering"
"
int"
v
)
'
()))
(
m
spinner
'occupation-gathering
yesno-list
(
lambda
(
v
)
(
entity-set-value!
"occupation-gathering"
"
varchar"
(
spinner-choice
yesno-list
v
)
)
'
()))
(
m
toggle-button-scale
'occupation-labour
(
lambda
(
v
)
(
entity-set-value!
"occupation-labour"
"
int"
v
)
'
())))
(
m
spinner
'occupation-labour
yesno-list
(
lambda
(
v
)
(
entity-set-value!
"occupation-labour"
"
varchar"
(
spinner-choice
yesno-list
v
)
)
'
())))
(
horiz
(
horiz
(
m
toggle-button-scale
'occupation-cows
(
lambda
(
v
)
(
entity-set-value!
"occupation-cows"
"
int"
v
)
'
()))
(
m
spinner
'occupation-cows
yesno-list
(
lambda
(
v
)
(
entity-set-value!
"occupation-cows"
"
varchar"
(
spinner-choice
yesno-list
v
)
)
'
()))
(
m
toggle-button-scale
'occupation-fishing
(
lambda
(
v
)
(
entity-set-value!
"occupation-fishing"
"
int"
v
)
'
()))
(
m
spinner
'occupation-fishing
yesno-list
(
lambda
(
v
)
(
entity-set-value!
"occupation-fishing"
"
varchar"
(
spinner-choice
yesno-list
v
)
)
'
()))
(
medit-text
'occupation-other
"normal"
(
lambda
(
v
)
(
entity-set-value!
"occupation-other"
"varchar"
v
)
'
()))))
(
medit-text
'occupation-other
"normal"
(
lambda
(
v
)
(
entity-set-value!
"occupation-other"
"varchar"
v
)
'
()))))
(
horiz
(
horiz
(
m
toggle-button-scale
'contribute
(
lambda
(
v
)
(
entity-set-value!
"contribute"
"
int"
v
)
'
()))
(
m
spinner
'contribute
yesno-list
(
lambda
(
v
)
(
entity-set-value!
"contribute"
"
varchar"
(
spinner-choice
yesno-list
v
)
)
'
()))
(
m
toggle-button-scale
'own-land
(
lambda
(
v
)
(
entity-set-value!
"own-land"
"
int"
v
)
'
())))
(
m
spinner
'own-land
yesno-list
(
lambda
(
v
)
(
entity-set-value!
"own-land"
"
varchar"
(
spinner-choice
yesno-list
v
)
)
'
())))
(
horiz
(
horiz
(
m
toggle-button-scale
'rent-land
(
lambda
(
v
)
(
entity-set-value!
"ren
t
-land"
"
int"
v
)
'
()))
(
m
spinner
'rent-land
yesno-list
(
lambda
(
v
)
(
entity-set-value!
"ren
d
-land"
"
varchar"
(
spinner-choice
yesno-list
v
)
)
'
()))
(
m
toggle-button-scale
'hire-land
(
lambda
(
v
)
(
entity-set-value!
"hire-land"
"
int"
v
)
'
())))
(
m
spinner
'hire-land
yesno-list
(
lambda
(
v
)
(
entity-set-value!
"hire-land"
"
varchar"
(
spinner-choice
yesno-list
v
)
)
'
())))
(
mtext
'crops-detail
)
(
mtext
'crops-detail
)
(
build-list-widget
(
build-list-widget
db
"sync"
'crops
"crop"
"crop"
(
lambda
()
(
get-current
'individual
#f
))
db
"sync"
'crops
"crop"
"crop"
(
lambda
()
(
get-current
'individual
#f
))
...
@@ -1314,9 +1370,9 @@
...
@@ -1314,9 +1370,9 @@
(
medit-text
'earning
"numeric"
(
lambda
(
v
)
(
entity-set-value!
"earning"
"int"
(
string->number
v
))
'
())))
(
medit-text
'earning
"numeric"
(
lambda
(
v
)
(
entity-set-value!
"earning"
"int"
(
string->number
v
))
'
())))
(
mtext
'in-the-home
)
(
mtext
'in-the-home
)
(
horiz
(
horiz
(
m
toggle-button-scale
'radio
(
lambda
(
v
)
(
entity-set-value!
"radio"
"
int"
v
)
'
()))
(
m
spinner
'radio
yesno-list
(
lambda
(
v
)
(
entity-set-value!
"radio"
"
varchar"
(
spinner-choice
yesno-list
v
)
)
'
()))
(
m
toggle-button-scale
'tv
(
lambda
(
v
)
(
entity-set-value!
"tv"
"
int"
v
)
'
()))
(
m
spinner
'tv
yesno-list
(
lambda
(
v
)
(
entity-set-value!
"tv"
"
varchar"
(
spinner-choice
yesno-list
v
)
)
'
()))
(
m
toggle-button-scale
'mobile
(
lambda
(
v
)
(
entity-set-value!
"mobile"
"
int"
v
)
'
())))
(
m
spinner
'mobile
yesno-list
(
lambda
(
v
)
(
entity-set-value!
"mobile"
"
varchar"
(
spinner-choice
yesno-list
v
)
)
'
())))
(
horiz
(
horiz
(
medit-text
'visit-market
"numeric"
(
lambda
(
v
)
(
entity-set-value!
"visit-market"
"int"
(
string->number
v
))
'
()))
(
medit-text
'visit-market
"numeric"
(
lambda
(
v
)
(
entity-set-value!
"visit-market"
"int"
(
string->number
v
))
'
()))
(
medit-text
'town-sell
"numeric"
(
lambda
(
v
)
(
entity-set-value!
"town-sell"
"int"
(
string->number
v
))
'
())))
(
medit-text
'town-sell
"numeric"
(
lambda
(
v
)
(
entity-set-value!
"town-sell"
"int"
(
string->number
v
))
'
())))
...
@@ -1334,21 +1390,21 @@
...
@@ -1334,21 +1390,21 @@
(
mupdate-spinner-other
'house-type
"house-type"
house-type-list
)
(
mupdate-spinner-other
'house-type
"house-type"
house-type-list
)
(
list
(
list
(
update-list-widget
db
"sync"
"crop"
"crop"
(
get-current
'individual
#f
))
(
update-list-widget
db
"sync"
"crop"
"crop"
(
get-current
'individual
#f
))
(
mupdate
'toggle-button
'occupation-agriculture
"occupation-agriculture"
)
(
mupdate
-spinner
'occupation-agriculture
"occupation-agriculture"
yesno-list
)
(
mupdate
'toggle-button
'occupation-gathering
"occupation-gathering"
)
(
mupdate
-spinner
'occupation-gathering
"occupation-gathering"
yesno-list
)
(
mupdate
'toggle-button
'occupation-labour
"occupation-labour"
)
(
mupdate
-spinner
'occupation-labour
"occupation-labour"
yesno-list
)
(
mupdate
'toggle-button
'occupation-cows
"occupation-cows"
)
(
mupdate
-spinner
'occupation-cows
"occupation-cows"
yesno-list
)
(
mupdate
'toggle-button
'occupation-fishing
"occupation-fishing"
)
(
mupdate
-spinner
'occupation-fishing
"occupation-fishing"
yesno-list
)
(
mupdate
'edit-text
'occupation-other
"occupation-other"
)
(
mupdate
'edit-text
'occupation-other
"occupation-other"
)
(
mupdate
'toggle-button
'contribute
"contribute"
)
(
mupdate
-spinner
'contribute
"contribute"
yesno-list
)
(
mupdate
'toggle-button
'own-land
"own-land"
)
(
mupdate
-spinner
'own-land
"own-land"
yesno-list
)
(
mupdate
'toggle-button
'rent-land
"rent-land"
)
(
mupdate
-spinner
'rent-land
"rent-land"
yesno-list
)
(
mupdate
'toggle-button
'hire-land
"hire-land"
)
(
mupdate
-spinner
'hire-land
"hire-land"
yesno-list
)
(
mupdate
'edit-text
'loan
"loan"
)
(
mupdate
'edit-text
'loan
"loan"
)
(
mupdate
'edit-text
'earning
"earning"
)
(
mupdate
'edit-text
'earning
"earning"
)
(
mupdate
'toggle-button
'radio
"radio"
)
(
mupdate
-spinner
'radio
"radio"
yesno-list
)
(
mupdate
'toggle-button
'tv
"tv"
)
(
mupdate
-spinner
'tv
"tv"
yesno-list
)
(
mupdate
'toggle-button
'mobile
"mobile"
)
(
mupdate
-spinner
'mobile
"mobile"
yesno-list
)
(
mupdate
'edit-text
'visit-market
"visit-market"
)
(
mupdate
'edit-text
'visit-market
"visit-market"
)
(
mupdate
'edit-text
'town-sell
"town-sell"
))))
(
mupdate
'edit-text
'town-sell
"town-sell"
))))
(
lambda
(
activity
)
'
())
(
lambda
(
activity
)
'
())
...
@@ -1398,8 +1454,8 @@
...
@@ -1398,8 +1454,8 @@
(
mspinner
'child-gender
gender-list
(
lambda
(
v
)
(
entity-set-value!
"gender"
"varchar"
(
spinner-choice
gender-list
v
))
'
()))
(
mspinner
'child-gender
gender-list
(
lambda
(
v
)
(
entity-set-value!
"gender"
"varchar"
(
spinner-choice
gender-list
v
))
'
()))
(
medit-text
'child-age
"numeric"
(
lambda
(
v
)
(
entity-set-value!
"age"
"int"
(
string->number
v
))
'
())))
(
medit-text
'child-age
"numeric"
(
lambda
(
v
)
(
entity-set-value!
"age"
"int"
(
string->number
v
))
'
())))
(
horiz
(
horiz
(
m
toggle-button-scale
'child-alive
(
lambda
(
v
)
(
entity-set-value!
"alive"
"
int"
v
)
'
()))
(
m
spinner-other
'child-alive
yesno-list
(
lambda
(
v
)
(
entity-set-value!
"alive"
"
varchar"
(
spinner-choice
yesno-list
v
)
)
'
()))
(
m
toggle-button-scale
'child-home
(
lambda
(
v
)
(
entity-set-value!
"living-at-home"
"
int"
v
)
'
())))
(
m
spinner-other
'child-home
yesno-list
(
lambda
(
v
)
(
entity-set-value!
"living-at-home"
"
varchar"
(
spinner-choice
yesno-list
v
)
)
'
())))
(
delete-button
)))
(
delete-button
)))
(
lambda
(
activity
arg
)
(
lambda
(
activity
arg
)
(
activity-layout
activity
))
(
activity-layout
activity
))
...
@@ -1413,8 +1469,8 @@
...
@@ -1413,8 +1469,8 @@
(
mupdate
'edit-text
'child-name
"name"
)
(
mupdate
'edit-text
'child-name
"name"
)
(
mupdate-spinner
'child-gender
"gender"
gender-list
)
(
mupdate-spinner
'child-gender
"gender"
gender-list
)
(
mupdate
'edit-text
'child-age
"age"
)
(
mupdate
'edit-text
'child-age
"age"
)
(
mupdate
'toggle-button
'child-alive
"alive"
)
(
mupdate
-spinner
'child-alive
"alive"
yesno-list
)
(
mupdate
'toggle-button
'child-home
"living-at-home"
)
(
mupdate
-spnner
'child-home
"living-at-home"
yesno-list
)
)))
)))
(
lambda
(
activity
)
'
())
(
lambda
(
activity
)
'
())
...
@@ -1673,6 +1729,10 @@
...
@@ -1673,6 +1729,10 @@
"getting-db"
"getting-db"
"http://192.168.2.1:8889/symbai.db"
"http://192.168.2.1:8889/symbai.db"
(
string-append
"/sdcard/symbai/symbai.db"
))
(
string-append
"/sdcard/symbai/symbai.db"
))
(
http-download
"getting-log"
"http://192.168.2.1:8889/log.txt"
(
string-append
"/sdcard/symbai/server-log.txt"
))
)
)
entity-types
)
entity-types
)
(
list
))))
(
list
))))
...
@@ -1683,8 +1743,10 @@
...
@@ -1683,8 +1743,10 @@
(
send-mail
(
send-mail
""
""
"From Symbai"
"Please find attached your data"
"From Symbai"
"Please find attached your data"
(
cons
(
append
"/sdcard/symbai/symbai.db"
(
list
"/sdcard/symbai/symbai.db"
"/sdcard/symbai/server-log.txt"
)
(
map
(
map
(
lambda
(
e
)
(
lambda
(
e
)
(
string-append
"/sdcard/symbai/"
e
".csv"
))
(
string-append
"/sdcard/symbai/"
e
".csv"
))
...
...
android/assets/translations.csv
View file @
1d585e74
test-num,1,1,1,
"Code (don't change these)","English","Khasi","Hindi",
test-text, I am test text, I am test text, I am test text,
"start","Symbai",,,
one, one, ,,
"next","Next",,,
two, two, ,,
"yes","Yes",,,
three, three, ,,
"no","No",,,
village, Village, ,,
"unanswered","Unanswered",,,
household, Household, ,,
"not-set","Not set",,,
households, Households, ,,
"details-next","Next",,,
individual, Individual, ,,
"family-next","Next",,,
individuals, Individuals, ,,
"migration-next","Next",,,
add-item-to-list,0, ,,
"income-next","Next",,,
default-village-name, New village, ,,
"gene-next","Next",,,
title, Symbai, Symbai, Symbai,
"social-next","Next",,,
sync, Sync, Sync, Sync,
"friendship-next","Next",,,
languages, Choose language, Choose language, Choose language,
"agreement-next","Next",,,
english, English, English, English,
"village"," Village"," ",,
khasi, Khasi, Khasi, Khasi,
"household"," Household"," ",,
hindi, Hindi, Hindi, Hindi,
"households"," Households"," ",,
user-id, Your user ID, User ID, User ID,
"individual"," Individual"," ",,
save, Save, Save, Save,
"individuals"," Individuals"," ",,
back, Back, Back, Back,
"add-item-to-list",0," ",,
off, Off, Off, Off,
"default-village-name"," New village"," ",,
villages, Villages, Villages, Villages,
"title"," Symbai"," Symbai"," Symbai"," "
list-empty, List empty, ,,
"sync"," Sync"," Sync"," Sync"," "
delete, Delete, ,,
"languages"," Choose language"," Choose language"," Choose language"," "
delete-are-you-sure, Are you sure you want to delete this?, ,,
"english"," English"," English"," English"," "
save-are-you-sure, Are you sure you want to save changes?, ,,
"khasi"," Khasi"," Khasi"," Khasi"," "
quick-name, New person name, ,,
"hindi"," Hindi"," Hindi"," Hindi"," "
quick-add, Quick add, ,,
"user-id"," User ID"," User ID"," User ID"," "
find-individual, Find individual, ,,
"save"," Save"," Save"," Save"," "
filter, Filter, ,,
"back"," Back"," Back"," Back"," "
off, Off, Off, Off,
"off"," Off"," Off"," Off"," "
name, Name, ,,
"villages"," Villages"," Villages"," Villages"," "
sync-all, Sync me!, ,,
"list-empty"," List empty"," ",,
sync-syncall, Sync everything, ,,
"delete"," Delete"," ",,
export-data, Exporting data, ,,
"delete-are-you-sure"," Are you sure you want to delete this?"," ",,
sync-download, Download main DB, ,,
"save-are-you-sure"," Are you sure you want to save changes?"," ",,
sync-export, Email main DB, ,,
"quick-name"," New person name"," ",,
email-local, Email local DB, ,,
"quick-add"," Quick add"," ",,
debug, Debug, ,,
"find-individual"," Find individual"," ",,
sync-back, Back, ,,