Commit fcad9380 authored by Dave Griffiths's avatar Dave Griffiths

removed residence after marriage for those not married

parent b962245c
......@@ -506,25 +506,30 @@
(lambda (c) (fn c)))))
(define (mspinner-other id types fn)
(horiz
(vert
(text-view (symbol->id id)
(mtext-lookup id)
30 (layout 'wrap-content 'wrap-content 1 'centre 10))
(spinner (make-id (string-append (symbol->string id) "-spinner"))
(map mtext-lookup types)
(layout 'wrap-content 'wrap-content 1 'centre 0)
(lambda (c)
;; dont call if set to "other"
(if (< c (- (length types) 1))
(fn c)
'()))))
(vert
(mtext-scale 'other)
(edit-text (make-id (string-append (symbol->string id) "-edit-text"))
"" 30 "normal"
(layout 'fill-parent 'wrap-content 1 'centre 0)
(lambda (t) (fn t))))))
(linear-layout
(make-id (string-append (symbol->string id) "-container"))
'horizontal
(layout 'fill-parent 'wrap-content 1 'centre 5)
(list 0 0 0 0)
(list
(vert
(text-view (symbol->id id)
(mtext-lookup id)
30 (layout 'wrap-content 'wrap-content 1 'centre 10))
(spinner (make-id (string-append (symbol->string id) "-spinner"))
(map mtext-lookup types)
(layout 'wrap-content 'wrap-content 1 'centre 0)
(lambda (c)
;; dont call if set to "other"
(if (< c (- (length types) 1))
(fn c)
'()))))
(vert
(mtext-scale 'other)
(edit-text (make-id (string-append (symbol->string id) "-edit-text"))
"" 30 "normal"
(layout 'fill-parent 'wrap-content 1 'centre 0)
(lambda (t) (fn t)))))))
(define (mspinner-other-vert id text-id types fn)
(linear-layout
......
......@@ -65,7 +65,7 @@
(define tribes-list '(khasi other))
(define subtribe-list '(khynriam pnar bhoi war other))
(define education-list '(primary middle high secondary university))
(define married-list '(ever-married currently-married currently-single seperated))
(define married-list '(currently-married currently-single seperated))
(define residence-list '(birthplace spouse-village))
(define gender-list '(male female))
(define house-type-list '(concrete tin thatched other))
......@@ -982,7 +982,12 @@
(vert
(mspinner 'head-of-house gender-list (lambda (v) (entity-set-value! "head-of-house" "varchar" (spinner-choice gender-list v)) '()))
(mspinner 'marital-status married-list (lambda (v) (entity-set-value! "marital-status" "varchar" (spinner-choice married-list v)) '()))
(medit-text 'times-married "numeric" (lambda (v) (entity-set-value! "times-married" "int" v) '())))
(medit-text 'times-married "numeric"
(lambda (v)
(entity-set-value! "times-married" "int" v)
(list
(update-widget 'linear-layout (get-id "residence-after-marriage-container")
(if (equal? v "0") 'hide 'show) 0)))))
(build-person-selector 'spouse "id-spouse" (list) spouse-request-code)
)
......
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