Index: family/family.install =================================================================== RCS file: /cvs/drupal/contributions/modules/family/family.install,v retrieving revision 1.5 diff -u -r1.5 family.install --- family/family.install 6 Dec 2008 03:18:15 -0000 1.5 +++ family/family.install 15 Apr 2009 15:45:12 -0000 @@ -123,6 +123,12 @@ 'not null' => FALSE, 'default' => 'Unknown', ), + 'adopted_group' => array( + 'type' => 'varchar', + 'length' => 128, + 'not null' => FALSE, + 'default' => 'Unknown', + ), 'media' => array( 'type' => 'varchar', 'length' => 128, @@ -243,7 +249,11 @@ return $schema; } - +function family_update_6115(){ + $ret = array(); + db_add_field($ret, 'family_individual', 'adopted_group', array('type' => 'varchar', 'length' => 128, 'not null' => FALSE, 'default' => '',)); + return $ret; +} function family_uninstall() { // Remove tables. drupal_uninstall_schema('family'); Index: family/individual.inc =================================================================== RCS file: /cvs/drupal/contributions/modules/family/individual.inc,v retrieving revision 1.6 diff -u -r1.6 individual.inc --- family/individual.inc 6 Dec 2008 03:18:15 -0000 1.6 +++ family/individual.inc 15 Apr 2009 15:45:12 -0000 @@ -30,27 +30,35 @@ '#title' => check_plain($type->title_label), '#type' => 'hidden', '#default_value' => $node->NAME, + '#weight'=> -10, ); } - $form['FORE'] = array( + $form['FAM'] =array( + '#type' => 'fieldset', + '#title' => t('Individual Information'), + '#collapsible' => TRUE, + '#collapsed' => FALSE, + '#weight'=>-3, +); + $form['FAM']['FORE'] = array( '#type' => 'textfield', '#title' => t('Forename'), '#default_value' => $node->FORE, '#required' => FALSE, ); - $form['MIDN'] = array( + $form['FAM']['MIDN'] = array( '#type' => 'textfield', '#title' => t('Middle Names'), '#default_value' => $node->MIDN, '#required' => FALSE, ); - $form['SURN'] = array( + $form['FAM']['SURN'] = array( '#type' => 'textfield', '#title' => t('Surname'), '#default_value' => $node->SURN, '#required' => FALSE, ); - $form['SEX'] = array( + $form['FAM']['SEX'] = array( '#type' => 'select', '#title' => t('Gender'), '#default_value' => $node->SEX, @@ -66,37 +74,65 @@ $ancestorgroups[$data['nid']]=$data['title_format']; } } - $form['GRUP'] = array( + $form['FAM']['ANCE']['GRUP'] = array( '#type' => 'select', - '#title' => t('Ancestry Group'), + '#title' => t('Biological Ancestor Group'), '#default_value' => $node->GRUP, '#options'=> array('' => 'None', 'Groups'=>$ancestorgroups), ); - $form['BIRT']['BIRT_DATE'] = array( + /*$form['FAM']['ANCE']['ADOPTED'] = array( + '#type' => 'checkbox', + '#title' => t('Adopted?'), + '#default_value' => $node->ADOPTED, + );*/ + $form['FAM']['ANCE']['ADOPT'] = array( + '#type' => 'select', + '#title' => t('Adopted Ancestor Group'), + '#default_value' => $node->ADOPT, + '#options'=> array('' => 'Not Adopted', 'Groups'=>$ancestorgroups), + ); + $form['FAM']['BIRT'] =array( + '#type' => 'fieldset', + '#title' => t('Birth Data'), + '#collapsible' => TRUE, + '#collapsed' => FALSE, + '#weight'=>4, +); + $form['FAM']['BIRT']['BIRT_DATE'] = array( '#type' => 'textfield', '#title' => t('Birth Date'), '#description'=>t('Year-Month-Day YYYY-MM-DD'), '#default_value' => $node->BIRT_DATE, ); - $form['BIRT']['BIRT_PLAC'] = array( + $form['FAM']['BIRT']['BIRT_PLAC'] = array( '#type' => 'textfield', '#title' => t(' Birth Place'), '#default_value' => $node->BIRT_PLAC, ); - $form['DEAT']['DEAT_DATE'] = array( + $form['FAM']['DEAT'] =array( + '#type' => 'fieldset', + '#title' => t('Death Information'), + '#collapsible' => TRUE, + '#collapsed' => FALSE, + '#weight'=>6, +); + $form['FAM']['DEAT']['DEAT_DATE'] = array( '#type' => 'textfield', '#title' => t('Death Date'), '#description'=>t('Year-Month-Day YYYY-MM-DD'), '#default_value' => $node->DEAT_DATE, ); - $form['DEAT']['DEAT_PLAC'] = array( + $form['FAM']['DEAT']['DEAT_PLAC'] = array( '#type' => 'textfield', '#title' => t('Death Place'), '#default_value' => $node->DEAT_PLAC, ); - $form['body_filter']['body_field'] = node_body_field($node, $type->body_label, $type->min_word_count); - - $form['body_filter']['format'] = filter_form($node->format); //Not sure why this goes here, but all the examples have it... + $form['body_filter']=array( + '#type' => 'fieldset', + '#title' => t('Body'), + '#weight'=>-2, + ); +$form['body_filter']['body_field'] = node_body_field($node, $type->body_label, $type->min_word_count); return $form; } // function family_individual_form(&$node, &$param) @@ -113,7 +149,7 @@ $birthdate=explode("-", $node->BIRT_DATE); $node->title_format= (strtoupper($node->SURN)).', '.($node->FORE).' - '.$birthdate[0]; - db_query("INSERT INTO {family_individual} (vid, nid, title_format, firstname, middlename, lastname, gender, birthdate, birthplace, deathdate, deathplace, ancestor_group) VALUES (%d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')", $node->vid, $node->nid, $node->title_format, $node->FORE, $node->MIDN, $node->SURN, $node->SEX, $node->BIRT_DATE, $node->BIRT_PLAC,$node->DEAT_DATE, $node->DEAT_PLAC, $node->GRUP); + db_query("INSERT INTO {family_individual} (vid, nid, title_format, firstname, middlename, lastname, gender, birthdate, birthplace, deathdate, deathplace, ancestor_group, adopted_group) VALUES (%d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')", $node->vid, $node->nid, $node->title_format, $node->FORE, $node->MIDN, $node->SURN, $node->SEX, $node->BIRT_DATE, $node->BIRT_PLAC,$node->DEAT_DATE, $node->DEAT_PLAC, $node->GRUP, $node->ADOPT); } @@ -162,6 +198,10 @@ if ($ans_grup) { $additions->GRUP = $ans_grup; } + $ans_grup = $data['adopted_group']; + if ($ans_grup) { + $additions->ADOPT = $ans_grup; + } return($additions); } /** @@ -178,8 +218,8 @@ db_query("UPDATE {node} SET title='%s' WHERE nid='%d'",$node->title,$node->nid); $birthdate=explode("-", $node->BIRT_DATE); $node->title_format=(strtoupper($node->SURN)).', '.($node->FORE).' - '.$birthdate[0]; - db_query("UPDATE {family_individual} SET vid='%d', title_format='%s', firstname='%s', middlename='%s', lastname='%s', gender='%s', birthdate='%s', birthplace='%s', deathdate='%s', deathplace='%s', ancestor_group='%s' WHERE nid='%d'", - $node->vid, $node->title_format, $node->FORE, $node->MIDN, $node->SURN, $node->SEX, $node->BIRT_DATE, $node->BIRT_PLAC,$node->DEAT_DATE, $node->DEAT_PLAC, $node->GRUP, $node->nid); + db_query("UPDATE {family_individual} SET vid='%d', title_format='%s', firstname='%s', middlename='%s', lastname='%s', gender='%s', birthdate='%s', birthplace='%s', deathdate='%s', deathplace='%s', ancestor_group='%s', adopted_group='%s' WHERE nid='%d'", + $node->vid, $node->title_format, $node->FORE, $node->MIDN, $node->SURN, $node->SEX, $node->BIRT_DATE, $node->BIRT_PLAC,$node->DEAT_DATE, $node->DEAT_PLAC, $node->GRUP, $node->ADOPT, $node->nid); } /** Index: family/tree.inc =================================================================== RCS file: /cvs/drupal/contributions/modules/family/tree.inc,v retrieving revision 1.4 diff -u -r1.4 tree.inc --- family/tree.inc 6 Dec 2008 03:18:15 -0000 1.4 +++ family/tree.inc 15 Apr 2009 15:45:13 -0000 @@ -11,7 +11,7 @@ //} return $output; } -function family_tree_header($nid,$length=3,$detail){ +function family_tree_header($nid,$length=3,$detail, $adopted){ $treecontent =""; $treecontent .="

This page is still under development so not all features are working properly

Please choose a person and a tree type:

@@ -45,7 +45,11 @@ } $treecontent.=">".($i).""; } -$treecontent.="
+$treecontent.="
Show Adopted:=0;$level--){ $treecontent.=' '; -for($familyno=1;$familyno<=pow(2,$level);$familyno++){ -$treecontent.= '

+$levelPower=pow(2,$level); +for($familyno=1;$familyno<=$levelPower;$familyno++){ + +$treecontent.= '

'; if($level!=$length){ // previous method for width of image '.((100/(pow(2,$level-1)))-(2/$level)).' -$treecontent.='
'; +$treecontent.='
'; } if(isset($treearray[$level][$familyno]['NAME'])){ $treecontent.=$treearray[$level][$familyno]['NAME']; @@ -119,11 +139,12 @@ $personnode=$nid; $length=$_GET['len']; $detail=$_GET['det']; +$adopted=$_GET['adopted']; $cellwidth=120; if (!isset($length)){ $length=3; } -$treecontent.=family_tree_header($personnode,$length,$detail); +$treecontent.=family_tree_header($personnode,$length,$detail,$adopted); $nid=$personnode; //$content.='

The descendancy graphs are yet to be completed; hence it probably wont work

'; //Get Data @@ -138,13 +159,23 @@ $families = db_query("SELECT * FROM {family_group} WHERE ((parent1='%d' AND parent1<>'') OR (parent2='%d' AND parent2<>''))",$treearray[$level-1][$parentno]['nid'],$treearray[$level-1][$parentno]['nid']); if ($families) { while($family=db_fetch_array($families)) { - $children=db_query("SELECT * FROM {family_individual} WHERE ancestor_group=%d",$family['nid']); + if($adopted){ + $adoptedGroup=' OR adopted_group='.$family['nid']; + }else{ + $adoptedGroup=''; + } + $children=db_query("SELECT * FROM {family_individual} WHERE (ancestor_group=%d".$adoptedGroup.')',$family['nid']); if($children){ while ($child = db_fetch_array($children)) { $treearray[$level][0]++; $treearray[$level][$familyno] = family_tree_get_info($child['nid']); $treearray[$level][$familyno]['parent'] = $parentno; $treearray[$level][$familyno]['blank']=FALSE; + if($child['adopted_group']==$family['nid']){ + $treearray[$level][$familyno]['redGroup']='Red'; + }else{ + $treearray[$level][$familyno]['redGroup']=''; + } $familyno++; } }else{ @@ -204,16 +235,16 @@ "; if($treearray[$level][$familyno]['blank']==FALSE&&$level!=0){ if(($treearray[$level][$familyno-1]['parent'])&&$treearray[$level][$familyno-1]['parent']==$treearray[$level][$familyno+1]['parent']){ - $treecontent.=" TRUE))."' width=100% height=10px padding=0 margin=0>
"; + $treecontent.=" TRUE))."' width=100% height=10px padding=0 margin=0>
"; }elseif($treearray[$level][$familyno]['parent']==$treearray[$level][$familyno-1]['parent']){ //$treecontent.=" background='../".drupal_get_path('module', 'family')."/img/right.png' STYLE='background-width: 100%;background-repeat: no-repeat;'"; - $treecontent.=" TRUE))."' width=100% height=10px padding=0 margin=0>
"; + $treecontent.=" TRUE))."' width=100% height=10px padding=0 margin=0>
"; }elseif($treearray[$level][$familyno]['parent']==$treearray[$level][$familyno+1]['parent']){ //$treecontent.=" background='../".drupal_get_path('module', 'family')."/img/left.png' STYLE='background-width: 100%;background-repeat: no-repeat;'"; - $treecontent.=" TRUE))."' width=100% height=10px padding=0 margin=0>
"; + $treecontent.=" TRUE))."' width=100% height=10px padding=0 margin=0>
"; }else{ - $treecontent.=" TRUE))."' width=100% height=10px padding=0 margin=0>
"; + $treecontent.=" TRUE))."' width=100% height=10px padding=0 margin=0>
"; } } $treecontent.="

"; Index: family/view.inc =================================================================== RCS file: /cvs/drupal/contributions/modules/family/view.inc,v retrieving revision 1.8 diff -u -r1.8 view.inc --- family/view.inc 6 Dec 2008 03:18:15 -0000 1.8 +++ family/view.inc 15 Apr 2009 15:45:13 -0000 @@ -78,6 +78,17 @@ $list[] = 'Mother: '. family_make_name($mother,TRUE); } } + $fam=db_fetch_array(db_query("SELECT parent1, parent2 FROM {family_group} WHERE nid='%s'",$facts['adopted_group'])); + if ($fam) { + $father = $fam['parent1']; + if ($father) { + $list[] = 'Adopted Father: '. family_make_name($father,TRUE); + } + $mother = $fam['parent2']; + if ($mother) { + $list[] = 'Adopted Mother: '. family_make_name($mother,TRUE); + } + } if ($show_record) { if ($facts['birthdate']!='0000-00-00 00:00:00') { $value=explode(' ',$facts['birthdate']); Index: family/group.inc =================================================================== RCS file: /cvs/drupal/contributions/modules/family/group.inc,v retrieving revision 1.4 diff -u -r1.4 group.inc --- family/group.inc 6 Dec 2008 03:18:15 -0000 1.4 +++ family/group.inc 15 Apr 2009 15:45:12 -0000 @@ -32,6 +32,13 @@ '#default_value' => $node->NAME, ); } +$form['MARR'] =array( + '#type' => 'fieldset', + '#title' => t('Marriage/Union'), + '#collapsible' => TRUE, + '#collapsed' => FALSE, + '#weight'=>-4, +); $form['MARR']['MARR_TYPE'] = array( '#type' => 'select', '#title' => t('Type of Union'), @@ -72,22 +79,33 @@ $parents[$data['nid']]=$data['title_format']; } } - $form['PAR1'] = array( + $form['PARENTS'] =array( + '#type' => 'fieldset', + '#title' => t('Group Members / Parents'), + '#collapsible' => TRUE, + '#collapsed' => FALSE, + '#weight'=>-3, +); + $form['PARENTS']['PAR1'] = array( '#type' => 'select', '#title' => t('Parent 1'), '#description'=>t('The parent whose last name is carried by the children.'), '#default_value' => $node->PAR1, '#options'=> array('' => 'Unknown', 'Individuals'=>$parents), ); - $form['PAR2'] = array( + $form['PARENTS']['PAR2'] = array( '#type' => 'select', '#title' => t('Parent 2'), '#default_value' => $node->PAR2, '#options'=> array('' => 'Unknown', 'Individuals'=>$parents), ); + $form['body_filter']=array( + '#type' => 'fieldset', + '#title' => t('Body'), + '#weight'=>-2, + ); $form['body_filter']['body_field'] = node_body_field($node, $type->body_label, $type->min_word_count); - $form['body_filter']['format'] = filter_form($node->format); //Not sure why this goes here, but all the examples have it... - return $form; +return $form; } // function family_group_form(&$node, &$param) function family_group_insert($node) { @@ -198,5 +216,14 @@ } $content.=""; } + $children = db_query("SELECT * FROM {family_individual} WHERE adopted_group = %d", $nid); + if($children){ + $content .= '

Adopted Children of '. family_make_name($data['parent1'],TRUE).' and '.family_make_name($data['parent2'],TRUE).':

'; + $content .= '

'; + while ($child = db_fetch_array($children)) { + $content .= ""; + } + $content.="
NameGenderBirth DateDeath Date
".family_make_name($child['nid'],TRUE)."".$child['gender']."".$child['birthdate']."".$child['deathdate']."
"; + } return $content; } \ No newline at end of file Index: family/location.inc =================================================================== RCS file: /cvs/drupal/contributions/modules/family/location.inc,v retrieving revision 1.4 diff -u -r1.4 location.inc --- family/location.inc 6 Dec 2008 03:18:15 -0000 1.4 +++ family/location.inc 15 Apr 2009 15:45:13 -0000 @@ -33,37 +33,44 @@ '#default_value' => $node->NAME, ); } - $form['BUILD'] = array( + $form['FAM'] =array( + '#type' => 'fieldset', + '#title' => t('Location Address'), + '#collapsible' => TRUE, + '#collapsed' => FALSE, + '#weight'=>-6, +); + $form['FAM']['BUILD'] = array( '#type' => 'textfield', '#title' => t('Building'), '#default_value' => $node->BUILD, '#required' => FALSE, ); - $form['STREET'] = array( + $form['FAM']['STREET'] = array( '#type' => 'textfield', '#title' => t('Street'), '#default_value' => $node->STREET, '#required' => FALSE, ); - $form['CITY'] = array( + $form['FAM']['CITY'] = array( '#type' => 'textfield', '#title' => t('City'), '#default_value' => $node->CITY, '#required' => FALSE, ); - $form['COUNTY'] = array( + $form['FAM']['COUNTY'] = array( '#type' => 'textfield', '#title' => t('County'), '#default_value' => $node->COUNTY, '#required' => FALSE, ); - $form['STATE_PROV'] = array( + $form['FAM']['STATE_PROV'] = array( '#type' => 'textfield', '#title' => t('State or Province'), '#default_value' => $node->STATE_PROV, '#required' => FALSE, ); - $form['COUNTRY'] = array( + $form['FAM']['COUNTRY'] = array( '#type' => 'textfield', '#title' => t('Country'), '#default_value' => $node->COUNTRY, @@ -79,11 +86,14 @@ '#title' => t('Ancestry Group'), '#default_value' => $node->GRUP, '#options'=> array('' => 'None', 'Groups'=>$ancestorgroups), + '#weight'=>-3, ); + $form['body_filter']=array( + '#type' => 'fieldset', + '#title' => t('Body'), + '#weight'=>-2, + ); $form['body_filter']['body_field'] = node_body_field($node, $type->body_label, $type->min_word_count); - - - $form['body_filter']['format'] = filter_form($node->format); //Not sure why this goes here, but all the examples have it... return $form; } // function family_individual_form(&$node, &$param) @@ -211,7 +221,7 @@ $content .= '

Family group asociated with here:
'; $content .= ''; $fam=db_fetch_array(db_query("SELECT parent1, parent2 FROM {family_group} WHERE nid='%s'",$asocid)); - $asoc= db_query("SELECT * FROM {family_individual} WHERE nid=%d OR nid=%d OR ancestor_group=%d", $fam['parent1'], $fam['parent2'], $asocid); + $asoc= db_query("SELECT * FROM {family_individual} WHERE nid=%d OR nid=%d OR ancestor_group=%d OR adopted_group=%d", $fam['parent1'], $fam['parent2'], $asocid, $asocid); while ($child = db_fetch_array($asoc)) { $content .= ""; }
NameGenderBirth Date
".family_make_name($child['nid'],TRUE)."".$child['gender']."".$child['birthdate']."