Commit 89ceacbb authored by Dave Griffiths's avatar Dave Griffiths
Browse files

group composition, pregnant working...

parent fc0f0b24
...@@ -196,7 +196,7 @@ ...@@ -196,7 +196,7 @@
"" ""
entities)) entities))
(define (string-strip str delim) (define (string-split-simple str delim)
(let ((r (foldl (let ((r (foldl
(lambda (c r) (lambda (c r)
(cond (cond
......
...@@ -261,11 +261,14 @@ ...@@ -261,11 +261,14 @@
'set-enabled 0)) 'set-enabled 0))
items)) items))
(define (update-grid-selector-checked id items) (define (update-grid-selector-checked id items-id)
(map (let ((items-str (entity-get-value items-id)))
(lambda (item) (if items-str
(update-widget 'toggle-button (get-id (string-append id item)) 'checked 1)) (map
items)) (lambda (item)
(update-widget 'toggle-button (get-id (string-append id item)) 'checked 1))
(string-split-simple items-str #\,))
'())))
(define (db-mongooses-by-pack) (define (db-mongooses-by-pack)
(db-all-where (db-all-where
...@@ -1025,7 +1028,7 @@ ...@@ -1025,7 +1028,7 @@
(build-grid-selector "gc-start-present" "toggle" "Who's present?") (build-grid-selector "gc-start-present" "toggle" "Who's present?")
(next-button "gc-start-" "Go to weighing, have you finished here?" "gc-start" "gc-weights" (next-button "gc-start-" "Go to weighing, have you finished here?" "gc-start" "gc-weights"
(lambda () (lambda ()
(set-current! 'gc-present (string-strip (entity-get-value "present") #\,)) (set-current! 'gc-present (string-split-simple (entity-get-value "present") #\,))
(entity-update-values!) (entity-update-values!)
(msg "exiting start") (msg "exiting start")
'())) '()))
...@@ -1047,7 +1050,7 @@ ...@@ -1047,7 +1050,7 @@
(entity-set-value! "present" "varchar" (assemble-array individuals)) (entity-set-value! "present" "varchar" (assemble-array individuals))
(list)) (list))
(get-current 'gc-present '()))) (get-current 'gc-present '())))
(update-grid-selector-checked "gc-start-present" (get-current 'gc-present '()))) (update-grid-selector-checked "gc-start-present" "present"))
) )
(lambda (fragment) '()) (lambda (fragment) '())
(lambda (fragment) '()) (lambda (fragment) '())
...@@ -1143,13 +1146,17 @@ ...@@ -1143,13 +1146,17 @@
(lambda (fragment arg) (lambda (fragment arg)
(activity-layout fragment)) (activity-layout fragment))
(lambda (fragment arg) (lambda (fragment arg)
(list (append
(populate-grid-selector (list
"gc-preg-choose" "toggle" (populate-grid-selector
(db-mongooses-by-pack-female) #f "gc-preg-choose" "toggle"
(lambda (individual) (db-mongooses-by-pack-female) #f
(list))) (lambda (individuals)
)) (entity-update-single-value! (ktv "pregnant" "varchar" (assemble-array individuals)))
(list)))
)
(update-grid-selector-enabled "gc-preg-choose" (get-current 'gc-present '()))
(update-grid-selector-checked "gc-preg-choose" "pregnant")))
(lambda (fragment) '()) (lambda (fragment) '())
(lambda (fragment) '()) (lambda (fragment) '())
(lambda (fragment) '()) (lambda (fragment) '())
......
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