summaryrefslogtreecommitdiff
path: root/modules_v3
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@gmail.com>2013-10-05 10:02:32 +0100
committerGreg Roach <fisharebest@gmail.com>2013-10-05 10:02:32 +0100
commit2641e65b167726c8b36f1f32568ceff91703c8e0 (patch)
treefbd7c08df66b643ae1f5eb3faf43b355a41104bc /modules_v3
parentc31614053ce523f50843886ecc9aa821f94fce1d (diff)
downloadwebtrees-2641e65b167726c8b36f1f32568ceff91703c8e0.tar.gz
webtrees-2641e65b167726c8b36f1f32568ceff91703c8e0.tar.bz2
webtrees-2641e65b167726c8b36f1f32568ceff91703c8e0.zip
#1198421 - (part) 1.5 Census assistant module - results are not saved
Diffstat (limited to 'modules_v3')
-rw-r--r--modules_v3/GEDFact_assistant/_CENS/addnoteaction_assisted.php11
-rw-r--r--modules_v3/GEDFact_assistant/module.php41
2 files changed, 43 insertions, 9 deletions
diff --git a/modules_v3/GEDFact_assistant/_CENS/addnoteaction_assisted.php b/modules_v3/GEDFact_assistant/_CENS/addnoteaction_assisted.php
index 7c67abb148..e1bf42993d 100644
--- a/modules_v3/GEDFact_assistant/_CENS/addnoteaction_assisted.php
+++ b/modules_v3/GEDFact_assistant/_CENS/addnoteaction_assisted.php
@@ -96,14 +96,7 @@ if ($pid_array != '') {
if ($record) {
$controller->addInlineJavascript('
- if (parent.opener.document.getElementById("pids_array_edit") == null || parent.opener.document.getElementById("pids_array_edit") == "undefined") {
- } else {
- parent.opener.document.editform.pids_array_edit.value="' . $pid_array .'";
- }
- if (parent.opener.document.getElementById("pids_array_add") == null || parent.opener.document.getElementById("pids_array_add") == "undefined") {
- } else {
- parent.opener.document.addform.pids_array_add.value="' . $pid_array . '";
- }
- openerpasteid("' . $record->getXref() . '")
+ window.opener.set_pid_array("' . $pid_array . '");
+ openerpasteid("' . $record->getXref() . '");
');
}
diff --git a/modules_v3/GEDFact_assistant/module.php b/modules_v3/GEDFact_assistant/module.php
index 58713faf6d..13bf234f6f 100644
--- a/modules_v3/GEDFact_assistant/module.php
+++ b/modules_v3/GEDFact_assistant/module.php
@@ -305,4 +305,45 @@ class GEDFact_assistant_WT_Module extends WT_Module {
return expand_urls($note->getNote());
}
}
+
+ // Modify the “add shared note” field, to create a note using the assistant
+ function print_addnewnote_assisted_link($element_id, $xref, $tag, $action) {
+ global $controller;
+
+ // We do not yet support family records
+ if (WT_GedcomRecord::getInstance($xref) instanceof WT_Individual) {
+ return '';
+ }
+
+ // Only modify “add shared note” links on the add/edit actions.
+ // TODO: does the “edit” action work?
+ if ($action != 'add' && $action != 'edit') {
+ return '';
+ }
+
+ // Only modify “add shared note” links for CENS records.
+ if ($tag != 'CENS') {
+ return '';
+ }
+
+ // There are lots of “add shared note” links. We only need to modify the 2nd one
+ static $n = 0;
+ if (++$n != 2) {
+ return '';
+ }
+
+ $controller->addInlineJavascript('
+ var pid_array=jQuery("#pid_array");
+ function set_pid_array(pa) {
+ pid_array.val(pa);
+ }
+ ');
+
+ return
+ '<br>' .
+ '<input type="hidden" name="pid_array" id="pid_array" value="fish">' .
+ '<a href="#" onclick="return addnewnote_assisted(document.getElementById(\'' . $element_id . '\'), \'' . $xref . '\');">' .
+ WT_I18N::translate('Create a new shared note using assistant') .
+ '</a>';
+ }
}