--------------------------------------------------------------------------

	RESEARCH ASSISTANT MODULE
	Beta 2

--------------------------------------------------------------------------

 * LICENSE
 * INTRODUCTION
 * INSTALLING
 * USAGE
 * DATABASE SCHEMA

===============================================================================
LICENSE

PhpGedView: Genealogy Viewer
Copyright (C) 2002 to 2024  Neumont University and Others

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

See the file GPL.txt included with this software for more
detailed licensing information.

===============================================================================
INTRODUCTION

This Research Assistant module adds functionality to the PhpGedView application
which will help you to manage and collaborate on your genealogical research.
With this module you can create and assign research tasks, record the results
of your research online, and share the results with others.  When you have
completed your research you can automatically convert the research into
genealogical data when you complete a research task.

The Research Assistant integrates directly with PhpGedView so that your data
and your research are always associated together.  You will be able to look 
back and see both successful and unsuccessful research.

The Research Assistant module also simplifies data entry and promotes proper 
source citation of data by allowing you to work from a source centric view.  
When you enter data, you can attach it to multiple people so that you don't have
to enter the same data on multiple forms.  And data that you enter through the 
Research Assistant is always cited with a source.  

This version of the Research Assistant is still in a beta phase.  There is 
still much work to be done on the module, but it is usable now in its current
phase.  With this release there will also be future upgrade paths so that data
you enter in this version of the research assistant will not be lost with
future upgrades.

===============================================================================
Changes from Beta 1 to Beta 2:
1. Migrated the code to support php 8.  The minimum recommended PGV PHP to support the 
    Research Assistant is PHP 7.0.
2. Cleaned the code to be more readable for future support (still a lot to do as stubs for 
    alternative coding was left in place for later cleanups) and fix a number of spelling mistakes
    as well as migrating all internal variables to be prefixed as ra_
3. Removed references to dhtmlx javascript which was used in original dialogs.  This has been
    replaced with standardized menuing.
4. Cleaned up duplication of the same functions from within different RA menus to create a
    cleaner interface.
5. Introduced a new task column in the folder view so that tasks that are unassigned can now
    be easily identified so they can be reassigned to a valid user
6. Auto Search in both individual RA tab and the main RA menu supported many different
    geneology websites, that have now changed their URLs or interfaces breaking the function.
    As a result only ancestry.com, ancestry.co.uk, familysearch.org, geneanet.org and werelate.org
    remain usable and the following sites have been temporarily disabled (ellisislandrecords.org,
    genealogy.com and genealogy-search-help.com).  Other sites findagrave.com and billiongraves
    have also been added.
7. Beta 1 introduced forms so that when completing a task you could select a source specific
    entry form (such as a census extraction form) for entering data you have the option of choosing
    and this was to be attached to the task and person.  It was found that the task form saving was
    not working and was never retreivable.  Additionally you could only add these forms AFTER
    selecting the complete operation rather than before.  So Beta 2 currently removes ALL
    post completion forms and their interfaces and a future release will look if they can be made 
    to work during pre-completion task functions.
8. No changes to the DATABASE SCHEMA, however some tasks that were created and completed
    before Beta 2 may have corrupt `t_results` and `t_form` fields, that can be cleared by re-editing
    these completed entries and marking them "Complete" again.
9. A number of RA functions in Beta 1 never really worked or had issues, so these were removed
    or temporarily disabled in Beta 2.  These included (but not limited to) Auto Generate and
    Generate from _TODO
===============================================================================
INSTALLING

1. Requires a running of PhpGedView v4.0 or higher
2. Extract the files and copy them to the "modules" directory in your 
   PhpGedView installation
3. For PhpGedView 4.0.x, move the files from 4.0compat folder into the main 
   PhpGedView directory
4. After logging in you should see a new "Research Assistant" icon in your
   main PhpGedView menu bar.
5. Click on the "Research Assistant" icon to build the database tables and
   setup the Research Assistant

See the USAGE information below for more information on how to get started 
using the research assistant module.

===============================================================================
USAGE

--Tasks
 The Research Assistant is centered on the research Task.  A research Task is 
 similar to a TODO item and tracks a particular genealogical research 
 assignment that needs to be done.  An example task title may be, "Find Joe's 
 Birth record", while the specifics in the description would indicate"Find
 Joe's birth record in the Ottawa county Birth Records".

 Tasks may be assigned to specific PhpGedView users.  By assigning tasks to 
 users everyone knows what research they should be working on, and who is 
 working on other research tasks.
 
 Tasks may also include actions against source material or related to one or
 more individuals in your data.   With the Research Assistant module installed,
 you will see a new Research Assistant tab on each individual's page in
 PhpGedView (see below) and a new tasks section on each Source data page.

 Each task also has comments section where info can be discussed regarding
 the data and research or possible outcomes.  This allows the task to remain
 goal oriented while the comments are progress and result oriented.

--Folders
 Tasks are also organized into folders.  You may create and organize your 
 folders however you like.  You will probably want to organize your online
 folders similar to you how you organize hard copies of your research. Many
 researchers organize their folders by family line, surname, or geographic 
 locations.

--Research Assistant Individual Tab
 The Reserach Assistant tab on the individual page is designed to help you see 
 what research needs to be done for that person. From this tab you can create a
 new task manually, or automatically create a task from one of the missing 
 items.
 
 The missing items table shows you possible holes in this person's data.  It 
 uses inferences based on dates and other related info to provide possible 
 clues to help you find the missing information.  To see inferences against
 the entire PhpGedView dataset, return to the global level Research Assistant
 and choose Analyze Database -> View Probabilities.
 
 The "Search External Web Sources" section allows you to quickly search for the
 details of this  person on common genealogical sites such as Ancestry.com.   In
 this section you choose the geneological site you would like to search, and then
 select the information from your existing data you would like to search against.
 
 There is also a comments section where users can discuss the data and research
 about this individual.
 
===============================================================================
DATABASE SCHEMA

CREATE TABLE `pgv_individualtask` (
  `it_t_id` int(11) NOT NULL,
  `it_i_id` varchar(255) NOT NULL,
  `it_i_file` int(11) NOT NULL,
  PRIMARY KEY  (`it_t_id`,`it_i_id`,`it_i_file`)
)

CREATE TABLE `pgv_probabilities` (
  `pr_id` int(11) NOT NULL,
  `pr_f_lvl` varchar(200) NOT NULL,
  `pr_s_lvl` varchar(200) default NULL,
  `pr_rel` varchar(200) NOT NULL,
  `pr_matches` int(11) NOT NULL,
  `pr_count` int(11) NOT NULL,
  `pr_file` int(11) default NULL,
  PRIMARY KEY  (`pr_id`)
)

CREATE TABLE `pgv_taskfacts` (
  `tf_id` int(11) NOT NULL default '0',
  `tf_t_id` int(11) default NULL,
  `tf_factrec` text,
  `tf_people` varchar(255) default NULL,
  PRIMARY KEY  (`tf_id`)
)

CREATE TABLE `pgv_tasks` (
  `t_id` int(11) NOT NULL,
  `t_fr_id` int(11) NOT NULL,
  `t_title` varchar(255) NOT NULL,
  `t_description` text NOT NULL,
  `t_startdate` int(11) NOT NULL,
  `t_enddate` int(11) default NULL,
  `t_results` text,
  `t_form` varchar(255) default NULL,
  `t_username` varchar(45) default NULL,
  PRIMARY KEY  (`t_id`)
)

CREATE TABLE `pgv_tasksource` (
  `ts_t_id` int(11) NOT NULL,
  `ts_s_id` varchar(255) NOT NULL,
  `ts_page` varchar(255) default NULL,
  `ts_date` varchar(50) default NULL,
  `ts_text` text,
  `ts_quay` varchar(50) default NULL,
  `ts_obje` varchar(20) default NULL,
  `ts_array` text,
  PRIMARY KEY  (`ts_s_id`,`ts_t_id`)
)

CREATE TABLE `pgv_user_comments` (
  `uc_id` int(11) NOT NULL,
  `uc_username` varchar(45) NOT NULL,
  `uc_datetime` int(11) NOT NULL,
  `uc_comment` varchar(500) NOT NULL,
  `uc_p_id` varchar(255) NOT NULL,
  `uc_f_id` int(11) NOT NULL,
  PRIMARY KEY  (`uc_id`)
)
