summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorfisharebest <fisharebest@gmail.com>2010-12-31 11:21:01 +0000
committerfisharebest <fisharebest@gmail.com>2010-12-31 11:21:01 +0000
commite1f47ec49abf8b33dccc315555ebe52694d6e6d5 (patch)
treef120e65610db37f6126ed768fe2405cd47698fbd /includes
parenta6b0e82f56962c12492005763816db659d4016c2 (diff)
downloadwebtrees-e1f47ec49abf8b33dccc315555ebe52694d6e6d5.tar.gz
webtrees-e1f47ec49abf8b33dccc315555ebe52694d6e6d5.tar.bz2
webtrees-e1f47ec49abf8b33dccc315555ebe52694d6e6d5.zip
Fix: pending changes to note facts cause all other facts to show as new.
Diffstat (limited to 'includes')
-rw-r--r--includes/controllers/family_ctrl.php4
-rw-r--r--includes/controllers/note_ctrl.php41
2 files changed, 15 insertions, 30 deletions
diff --git a/includes/controllers/family_ctrl.php b/includes/controllers/family_ctrl.php
index eadf00b58e..a9ac227c0e 100644
--- a/includes/controllers/family_ctrl.php
+++ b/includes/controllers/family_ctrl.php
@@ -67,8 +67,8 @@ class FamilyController extends BaseController {
}
if (find_family_record($this->famid, WT_GED_ID) || find_updated_record($this->famid, WT_GED_ID)!==null) {
- $this->family = new Family($gedrec);
- $this->family->ged_id=WT_GED_ID; // This record is from a file
+ $this->family = new Family($gedrec);
+ $this->family->ged_id=WT_GED_ID; // This record is from a file
} else if (!$this->family) {
return false;
}
diff --git a/includes/controllers/note_ctrl.php b/includes/controllers/note_ctrl.php
index 33c1a45436..2ce67c4e0e 100644
--- a/includes/controllers/note_ctrl.php
+++ b/includes/controllers/note_ctrl.php
@@ -39,7 +39,6 @@ require_once WT_ROOT.'includes/functions/functions_import.php';
class NoteController extends BaseController {
var $nid;
var $note = null;
- var $uname = "";
var $diffnote = null;
var $accept_success = false;
var $canedit = false;
@@ -47,16 +46,16 @@ class NoteController extends BaseController {
function init() {
$this->nid = safe_GET_xref('nid');
- $noterec = find_other_record($this->nid, WT_GED_ID);
+ $gedrec = find_other_record($this->nid, WT_GED_ID);
- if (find_updated_record($this->nid, WT_GED_ID)!==null) {
- $noterec = "0 @".$this->nid."@ NOTE\n";
- } else if (!$noterec) {
+ if (find_other_record($this->nid, WT_GED_ID) || find_updated_record($this->nid, WT_GED_ID)!==null) {
+ $this->note = new Note($gedrec);
+ $this->note->ged_id=WT_GED_ID; // This record is from a file
+ } else if (!$gedrec) {
return false;
}
- $this->note = new Note($noterec);
- $this->note->ged_id=WT_GED_ID; // This record is from a file
+ $this->nid=$this->note->getXref(); // Correct upper/lower case mismatch
if (!$this->note->canDisplayDetails()) {
print_header(i18n::translate('Shared note'));
@@ -65,10 +64,6 @@ class NoteController extends BaseController {
exit;
}
- $this->uname = WT_USER_NAME;
-
- $this->nid=$this->note->getXref(); // Correct upper/lower case mismatch
-
//-- perform the desired action
switch($this->action) {
case 'addfav':
@@ -118,19 +113,16 @@ class NoteController extends BaseController {
break;
}
- //-- check for the user
//-- if the user can edit and there are changes then get the new changes
- if ($this->show_changes && WT_USER_CAN_EDIT && ($newrec = find_updated_record($this->nid, WT_GED_ID))!==null) {
- $this->diffnote = new Note($newrec);
- $this->diffnote->setChanged(true);
- $noterec = $newrec;
- }
-
- if ($this->note->canDisplayDetails()) {
- $this->canedit = WT_USER_CAN_EDIT;
+ if ($this->show_changes && WT_USER_CAN_EDIT) {
+ $newrec = find_updated_record($this->nid, WT_GED_ID);
+ if (!empty($newrec)) {
+ $this->diffnote = new Note($newrec);
+ $this->diffnote->setChanged(true);
+ }
}
- if ($this->show_changes && $this->canedit) {
+ if ($this->show_changes) {
$this->note->diffMerge($this->diffnote);
}
}
@@ -146,13 +138,6 @@ class NoteController extends BaseController {
return i18n::translate('Unable to find record with ID');
}
}
- /**
- * check if use can edit this person
- * @return boolean
- */
- function userCanEdit() {
- return $this->canedit;
- }
/**
* get edit menu