Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions SQL/0000-00-00-schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1365,6 +1365,7 @@ CREATE TABLE `family` (
`FamilyID` int(6) NOT NULL,
`CandidateID` int(10) unsigned NOT NULL,
`Relationship_type` enum('half_sibling','full_sibling','1st_cousin') DEFAULT NULL,
`RelationshipLabel` VARCHAR(255) DEFAULT NULL,
PRIMARY KEY (`ID`),
CONSTRAINT `FK_family_candidate_1` FOREIGN KEY (`CandidateID`) REFERENCES `candidate`(`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Expand Down
6 changes: 6 additions & 0 deletions SQL/New_patches/2026-05-25_add_family_label.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ALTER TABLE family ADD COLUMN RelationshipLabel VARCHAR(255);

-- LORIS specific labels (can be modified for projects)
UPDATE family SET RelationshipLabel = 'Full Sibling' WHERE Relationship_type = 'full_sibling';
UPDATE family SET RelationshipLabel = 'Half Sibling' WHERE Relationship_type = 'half_sibling';
UPDATE family SET RelationshipLabel = '1st Cousin' WHERE Relationship_type = '1st_cousin';
10 changes: 10 additions & 0 deletions modules/candidate_parameters/ajax/getData.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,21 @@ function getFamilyInfoFields()
]
);

$relationshipOptions = $db->pselectWithIndexKey(
"SELECT DISTINCT Relationship_type, RelationshipLabel
FROM family
WHERE Relationship_type IS NOT NULL
ORDER BY RelationshipLabel",
[],
'Relationship_type'
);

$result = [
'pscid' => $pscid,
'candID' => $candID->__toString(),
'candidates' => $candidates,
'existingFamilyMembers' => $familyMembers,
'relationshipOptions' => $relationshipOptions,
];

return $result;
Expand Down
13 changes: 8 additions & 5 deletions modules/candidate_parameters/jsx/FamilyInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,14 @@ class FamilyInfo extends Component {
</button>
);
}
let relationshipOptions = {
'full_sibling': t('Full Sibling', {ns: 'candidate_parameters'}),
'half_sibling': t('Half Sibling', {ns: 'candidate_parameters'}),
'1st_cousin': t('First Cousin', {ns: 'candidate_parameters'}),
};
let relationshipOptions = {};

Object.keys(this.state.Data.relationshipOptions).forEach((type) => {
relationshipOptions[type] = t(
this.state.Data.relationshipOptions[type].RelationshipLabel,
{ns: 'candidate_parameters'}
);
});

let disabled = true;
let addButton = null;
Expand Down
6 changes: 3 additions & 3 deletions raisinbread/RB_files/RB_family.sql
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
SET FOREIGN_KEY_CHECKS=0;
TRUNCATE TABLE `family`;
LOCK TABLES `family` WRITE;
INSERT INTO `family` (`ID`, `FamilyID`, `CandidateID`, `Relationship_type`) VALUES (21,1,1004,'full_sibling');
INSERT INTO `family` (`ID`, `FamilyID`, `CandidateID`, `Relationship_type`) VALUES (24,1,1005,'full_sibling');
INSERT INTO `family` (`ID`, `FamilyID`, `CandidateID`, `Relationship_type`) VALUES (26,2,166,'half_sibling');
INSERT INTO `family` (`ID`, `FamilyID`, `CandidateID`, `Relationship_type`, `RelationshipLabel`) VALUES (21,1,1004,'full_sibling','Full Sibling');
INSERT INTO `family` (`ID`, `FamilyID`, `CandidateID`, `Relationship_type`, `RelationshipLabel`) VALUES (24,1,1005,'full_sibling','Full Sibling');
INSERT INTO `family` (`ID`, `FamilyID`, `CandidateID`, `Relationship_type`, `RelationshipLabel`) VALUES (26,2,166,'half_sibling','Half Sibling');
UNLOCK TABLES;
SET FOREIGN_KEY_CHECKS=1;
Loading