TODO

TODO:

  • Sources as node edit and add
  • Locations (needs architecture consensus), view, edit, add, as node
  • Easy node selector for adding/editing relationships
  • Associate individuals with users
  • Relationship calculators

SQL query to list the sources for an autocomplete textbox:
SELECT ff2.fact_value
FROM family_facts ff1
INNER JOIN family_relations fr on ff1.fid = fr.fid2
INNER JOIN family_facts ff2 on fr.fid1 = ff2.fid
where (ff1.fact_code = 'SOUR' AND NOT ff1.xref = ' ')
AND (ff2.fact_code = 'TITL' AND LOWER(ff2.fact_value) LIKE LOWER('%[TEXT]%'))
LIMIT 10

I am not worried about auto-complete searching for sources; instead, I built this as a prototype/proof-of-concept for a similar Location auto-complete when we switch PLAC to a pointer architecture. Here is another one for individuals:
SELECT ff1.fid, ff2.fact_value
FROM family_facts ff1
INNER JOIN family_relations fr on ff1.fid = fr.fid2
INNER JOIN family_facts ff2 on fr.fid1 = ff2.fid
where (ff1.fact_code = 'INDI' )
AND (ff2.fact_code = 'NAME' AND ff2.fact_value LIKE LOWER('%[TEXT]%'))
LIMIT 10

The reason I need the fid is that the returned names need to have date ranges attached, but I didn't want to think that hard. But this way we can use the existing module functions to call the BIRT and DEAT facts and get their dates. We also may just call the family_indi_line() since all that is already done. The big concern here is auto-complete type-to-response performance rate. A more complex but complete SQL query may be faster.

Then again, we could also just search the node table for matching family_individuals.