Commit dd9366ef authored by Dave Griffiths's avatar Dave Griffiths
Browse files

filter ui fixes

parent 1d585e74
...@@ -250,6 +250,8 @@ ...@@ -250,6 +250,8 @@
#t r)) #t r))
#f ktv-list)) #f ktv-list))
;; go through each dirty entity and stick the user id
;; on the end of the edit history lists - only for individuals
(define (update-edit-history db table user-id) (define (update-edit-history db table user-id)
;; get dirty individual entities ;; get dirty individual entities
(let ((de (db-select (let ((de (db-select
...@@ -259,7 +261,6 @@ ...@@ -259,7 +261,6 @@
(when (not (null? de)) (when (not (null? de))
(for-each (for-each
(lambda (i) (lambda (i)
(msg i)
(let* ((entity-id (vector-ref i 0)) (let* ((entity-id (vector-ref i 0))
(dirty-items (dbg (get-entity-plain-for-sync db table entity-id)))) (dirty-items (dbg (get-entity-plain-for-sync db table entity-id))))
(when (not (null? dirty-items)) (when (not (null? dirty-items))
...@@ -558,7 +559,10 @@ ...@@ -558,7 +559,10 @@
(list (list "parent" "varchar" "=" (get-setting-value "current-village"))) (list (list "parent" "varchar" "=" (get-setting-value "current-village")))
(list (list "name" "varchar"))))) (list (list "name" "varchar")))))
(msg "UIF" households) (msg "UIF" households)
(update-individual-filter-inner households))) (list
;; clear contents...
(update-widget 'linear-layout (get-id "choose-pics") 'contents '())
(update-individual-filter-inner households))))
(define (update-individual-filter2) (define (update-individual-filter2)
...@@ -1648,7 +1652,7 @@ ...@@ -1648,7 +1652,7 @@
(filter-add! (make-filter "gender" "varchar" "=" (filter-add! (make-filter "gender" "varchar" "="
(spinner-choice '(off female male) v)))) (spinner-choice '(off female male) v))))
(if (get-current 'filter-switch #f) (if (get-current 'filter-switch #f)
(list (update-individual-filter)) '()) (update-individual-filter) '())
)) ))
(medit-text (medit-text
'name "normal" 'name "normal"
...@@ -1657,12 +1661,12 @@ ...@@ -1657,12 +1661,12 @@
(filter-remove! "name") (filter-remove! "name")
(filter-add! (make-filter "name" "varchar" "like" (string-append v "%")))) (filter-add! (make-filter "name" "varchar" "like" (string-append v "%"))))
(if (get-current 'filter-switch #f) (if (get-current 'filter-switch #f)
(list (update-individual-filter)) '())) (update-individual-filter) '()))
) )
(mtoggle-button-scale 'filter-switch (mtoggle-button-scale 'filter-switch
(lambda (v) (lambda (v)
(set-current! 'filter-switch (not (zero? v))) (set-current! 'filter-switch (not (zero? v)))
'()))) (if (not (zero? v)) (update-individual-filter) '()))))
(horiz (horiz
(medit-text 'quick-name "normal" (medit-text 'quick-name "normal"
...@@ -1695,7 +1699,7 @@ ...@@ -1695,7 +1699,7 @@
(set-current! 'choose-result #f) (set-current! 'choose-result #f)
(activity-layout activity)) (activity-layout activity))
(lambda (activity arg) (lambda (activity arg)
(list (update-individual-filter (list)))) (update-individual-filter (list)))
(lambda (activity) '()) (lambda (activity) '())
(lambda (activity) '()) (lambda (activity) '())
(lambda (activity) '()) (lambda (activity) '())
......
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