Commit d547be53 authored by Dave Griffiths's avatar Dave Griffiths

explicit number of children in household

parent b2d61b53
......@@ -87,6 +87,7 @@
(list
(ktv "name" "varchar" (mtext-lookup 'default-household-name))
(ktv "num-pots" "int" 0)
(ktv "num-children" "int" 0)
(ktv "house-lat" "real" 0) ;; get from current location?
(ktv "house-lon" "real" 0)
(ktv "toilet-lat" "real" 0)
......@@ -797,7 +798,9 @@
(build-activity
(horiz
(medit-text 'household-name "normal" (lambda (v) (entity-set-value! "name" "varchar" v) '()))
(medit-text 'num-pots "numeric" (lambda (v) (entity-set-value! "num-pots" "int" v) '())))
(vert
(medit-text 'num-pots "numeric" (lambda (v) (entity-set-value! "num-pots" "int" v) '()))
(medit-text 'num-children "numeric" (lambda (v) (entity-set-value! "num-children" "int" v) '()))))
(horiz
(vert
(mtext 'location)
......@@ -844,7 +847,8 @@
(list
(update-list-widget db "sync" "individual" "individual" arg)
(mupdate 'edit-text 'household-name "name")
(mupdate 'edit-text 'num-pots "num-pots"))
(mupdate 'edit-text 'num-pots "num-pots")
(mupdate 'edit-text 'num-children "num-children"))
(mupdate-gps 'house "house")
(mupdate-gps 'toilet "toilet")))
......
......@@ -247,4 +247,5 @@
(list 'gps-are-you-sure (list "Are you sure you want to record your current position?" ))
(list 'gps-are-you-sure-2 (list "Please confirm again..." ))
(list 'Current-village (list "Your current village" ))
(list 'num-children (list "Number of children" ))
))
......@@ -38,3 +38,18 @@
((equal? (ktv-key (car ktv-list)) (ktv-key ktv))
(cons ktv (cdr ktv-list)))
(else (cons (car ktv-list) (ktv-set (cdr ktv-list) ktv)))))
;; replace or insert a ktv
(define (ktvlist-replace ktv ktvlist)
(cond
((null? ktvlist)
(list ktv))
((equal? (ktv-key (car ktvlist)) (ktv-key ktv))
(cons ktv (cdr ktvlist)))
(else (cons (car ktvlist) (ktvlist-replace ktv (cdr ktvlist))))))
(define (ktvlist-merge a b)
(foldl
(lambda (ktv r)
(ktvlist-replace ktv r))
a b))
......@@ -244,3 +244,4 @@
"gps-are-you-sure","Are you sure you want to record your current position?",,,
"gps-are-you-sure-2","Please confirm again...",,,
"Current-village","Your current village",,,
"num-children","Number of children",,,
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment