Commit c713c3e0 authored by dave griffiths's avatar dave griffiths
Browse files

pi merge

Merge branch 'starwisp_lib' of github.com:nebogeo/mongoose-web into starwisp_lib
parents 66be4ac7 396fca0b
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="foam.mongoose"
android:versionCode="13"
android:versionName="1.0">
android:versionCode="17"
android:versionName="1.2">
<application android:label="@string/app_name"
android:icon="@drawable/logo"
android:theme="@style/StarwispTheme"
......
......@@ -627,7 +627,18 @@
(cons
(mbutton
(string-append "review-" uid)
(string-append type (if time (string-append "-" time) ""))
(string-append type
(cond
((equal? type "pup-focal")
(string-append
" on " (uid->name db (ktv-get entity "id-focal-subject"))))
((equal? type "group-comp")
(string-append
" on pack " (uid->name db (ktv-get entity "pack"))))
(else ""))
(if time (string-append " at " time) "") )
(lambda ()
(set-current! 'review-collection uid)
(entity-init! db "stream" type (get-entity-by-unique db "stream" uid))
......@@ -640,7 +651,7 @@
(cons
(mbutton
(string-append "review-" uid)
(string-append type (if time (string-append "-" time) ""))
(string-append type (if time (string-append "-" time) "") " ")
(lambda ()
(entity-init! db "stream" type (get-entity-by-unique db "stream" uid))
(list (start-activity "review-item" 0 ""))))
......@@ -665,7 +676,27 @@
(uid (list-ref data 1)))
(mbutton
(string-append "review-" uid)
(string-append type (if time (string-append "-" time) ""))
(string-append type
(cond
((equal? type "group-comp-pup-assoc")
(string-append
" between pup " (uid->name db (ktv-get entity "id-mongoose"))
" and " (uid->name db (ktv-get entity "id-escort"))))
((equal? type "group-comp-mate-guard")
(string-append
" between female " (uid->name db (ktv-get entity "id-mongoose"))
" and " (uid->name db (ktv-get entity "id-escort"))))
((equal? type "group-comp-weight")
(string-append
" for " (uid->name db (ktv-get entity "id-mongoose"))))
((equal? type "pup-focal")
(string-append
" on " (uid->name db (ktv-get entity "id-focal-subject"))))
((equal? type "group-comp")
(string-append
" on pack " (uid->name db (ktv-get entity "pack"))))
(else ""))
(if time (string-append " at " time) "") )
(lambda ()
(entity-init! db "stream" type (get-entity-by-unique db "stream" uid))
(list (start-activity "review-item" 0 ""))))
......@@ -729,6 +760,8 @@
(lambda (v)
(cond
((eqv? v 1)
(set-current! 'parent-id #f)
(set-current! 'pup-focal-id #f)
(list (finish-activity 1)))
(else
(set-current! 'timer-minutes 1)
......
......@@ -509,6 +509,11 @@
(mbutton "note-done" "Done"
(lambda ()
(set-current! 'entity-type "note")
;; parent is the current pup focal or group comp, or nothing
(let ((parent (get-current 'parent-id #f)))
(if parent
(entity-set-value! "parent" "varchar" parent)
(entity-set-value! "parent" "varchar" "not-set")))
(entity-record-values!)
(list (replace-fragment (get-id "event-holder") "events"))))
(mbutton "note-cancel" "Cancel"
......@@ -994,7 +999,9 @@
(entity-update-single-value! (ktv "baby-byelim" "varchar" (assemble-array individuals)))
(list)))
)
(update-grid-selector-enabled "gc-baby-byelim" (get-current 'gc-not-present '()))
(update-grid-selector-enabled "gc-baby-byelim"
(invert-mongoose-selection
(get-current 'gc-not-present '())))
(update-grid-selector-checked "gc-baby-byelim" "baby-byelim")))
(lambda (fragment) '())
(lambda (fragment) '())
......@@ -1011,6 +1018,7 @@
(lambda ()
;; clean up...
(get-current 'gc-not-present '())
(set-current! 'parent-id #f)
(set-current! 'group-composition-id #f)
(list (finish-activity 0))))))
(lambda (fragment arg)
......@@ -1160,7 +1168,9 @@
(entity-init&save!
db "stream" "group-comp"
(list (ktv "pack" "varchar" (ktv-get (get-current 'pack ()) "unique_id"))
(ktv "group-comp-code" "varchar" "")))))
(ktv "group-comp-code" "varchar" ""))))
(set-current! 'parent-id (get-current 'group-composition-id #f))
)
(list
(start-activity "group-composition" 2 ""))))
(list
......@@ -1183,6 +1193,7 @@
(ktv-get (get-current 'pack '()) "unique_id"))))
;; need to clear the current group comp
;; id here if we are changing the pack
(set-current! 'parent-id #f)
(set-current! 'group-composition-id #f))
(set-current! 'pack pack)
'()))))
......@@ -1265,6 +1276,7 @@
(cond
((current-exists? 'individual)
(set-current! 'pup-focal-id (entity-record-values!))
(set-current! 'parent-id (get-current 'pup-focal-id #f))
(set-current! 'timer-minutes pf-length)
(set-current! 'timer-seconds 0)
(list
......@@ -1332,6 +1344,8 @@
(lambda (v)
(cond
((eqv? v 1)
(set-current! 'parent-id #f)
(set-current! 'pup-focal-id #f)
(list (finish-activity 1)))
(else
(list))))))))))
......
......@@ -94,7 +94,10 @@
"left join " table "_value_int "
"as d on d.entity_id = e.entity_id and d.attribute_id = 'deleted' ")
filter)
(if typed "where e.entity_type = ? and (d.value = 0 or d.value is NULL) order by n.value"
(if (not (equal? typed "*"))
(if (equal? typed "mongoose")
"where e.entity_type = ? and (d.value = 0 or d.value is NULL) order by substr(n.value,3)"
"where e.entity_type = ? and (d.value = 0 or d.value is NULL) order by n.value")
"order by n.value")))
(define (build-query-inc-deleted table filter)
......@@ -119,7 +122,7 @@
filter))
(define (filter-entities db table type filter)
(let ((q (build-query table filter (not (equal? type "*")))))
(let ((q (build-query table filter type)))
(let ((s (apply
db-select
(dbg (append
......
......@@ -89,7 +89,7 @@
"select e.entity_id, e.entity_type, e.unique_id, e.dirty, e.version from " table "_entity as e "
"left join stream_value_varchar "
"as p on p.entity_id = e.entity_id and p.attribute_id = 'parent' "
"where e.dirty = 1 and p.value is NULL"))))
"where e.dirty = 1 and p.value is NULL or p.value='not-set'"))))
(if (null? de)
'()
(map
......
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