|
@@ 960-977 (lines=18) @@
|
| 957 |
|
} |
| 958 |
|
break; |
| 959 |
|
|
| 960 |
|
case 'add_parent_to_individual': |
| 961 |
|
////////////////////////////////////////////////////////////////////////////// |
| 962 |
|
// Add a new parent to an existing individual (creating a one-parent family) |
| 963 |
|
////////////////////////////////////////////////////////////////////////////// |
| 964 |
|
$xref = Filter::get('xref', WT_REGEX_XREF); |
| 965 |
|
$gender = Filter::get('gender', '[MF]', 'U'); |
| 966 |
|
|
| 967 |
|
$individual = Individual::getInstance($xref, $controller->tree()); |
| 968 |
|
check_record_access($individual); |
| 969 |
|
|
| 970 |
|
if ($gender === 'F') { |
| 971 |
|
$controller->setPageTitle(I18N::translate('Add a mother')); |
| 972 |
|
$famtag = 'WIFE'; |
| 973 |
|
} else { |
| 974 |
|
$controller->setPageTitle(I18N::translate('Add a father')); |
| 975 |
|
$famtag = 'HUSB'; |
| 976 |
|
} |
| 977 |
|
$controller->pageHeader(); |
| 978 |
|
|
| 979 |
|
print_indi_form('add_parent_to_individual_action', $individual, null, null, $famtag, $gender); |
| 980 |
|
break; |
|
@@ 1095-1112 (lines=18) @@
|
| 1092 |
|
} |
| 1093 |
|
break; |
| 1094 |
|
|
| 1095 |
|
case 'add_spouse_to_individual': |
| 1096 |
|
////////////////////////////////////////////////////////////////////////////// |
| 1097 |
|
// Add a spouse to an existing individual (creating a new family) |
| 1098 |
|
////////////////////////////////////////////////////////////////////////////// |
| 1099 |
|
$sex = Filter::get('sex', 'M|F', 'F'); |
| 1100 |
|
$xref = Filter::get('xref', WT_REGEX_XREF); |
| 1101 |
|
|
| 1102 |
|
$individual = Individual::getInstance($xref, $controller->tree()); |
| 1103 |
|
check_record_access($individual); |
| 1104 |
|
|
| 1105 |
|
if ($sex === 'F') { |
| 1106 |
|
$controller->setPageTitle(I18N::translate('Add a wife')); |
| 1107 |
|
$famtag = 'WIFE'; |
| 1108 |
|
} else { |
| 1109 |
|
$controller->setPageTitle(I18N::translate('Add a husband')); |
| 1110 |
|
$famtag = 'HUSB'; |
| 1111 |
|
} |
| 1112 |
|
$controller->pageHeader(); |
| 1113 |
|
|
| 1114 |
|
print_indi_form('add_spouse_to_individual_action', $individual, null, null, $famtag, $sex); |
| 1115 |
|
break; |
|
@@ 1183-1200 (lines=18) @@
|
| 1180 |
|
} |
| 1181 |
|
break; |
| 1182 |
|
|
| 1183 |
|
case 'add_spouse_to_family': |
| 1184 |
|
////////////////////////////////////////////////////////////////////////////// |
| 1185 |
|
// Add a spouse to an existing family |
| 1186 |
|
////////////////////////////////////////////////////////////////////////////// |
| 1187 |
|
$xref = Filter::get('xref', WT_REGEX_XREF); |
| 1188 |
|
$famtag = Filter::get('famtag', 'HUSB|WIFE'); |
| 1189 |
|
|
| 1190 |
|
$family = Family::getInstance($xref, $controller->tree()); |
| 1191 |
|
check_record_access($family); |
| 1192 |
|
|
| 1193 |
|
if ($famtag === 'WIFE') { |
| 1194 |
|
$controller->setPageTitle(I18N::translate('Add a wife')); |
| 1195 |
|
$sex = 'F'; |
| 1196 |
|
} else { |
| 1197 |
|
$controller->setPageTitle(I18N::translate('Add a husband')); |
| 1198 |
|
$sex = 'M'; |
| 1199 |
|
} |
| 1200 |
|
$controller->pageHeader(); |
| 1201 |
|
|
| 1202 |
|
print_indi_form('add_spouse_to_family_action', null, $family, null, $famtag, $sex); |
| 1203 |
|
break; |