Private Note Mod

From TNG Wiki

Jump to: navigation, search
Private Note
Summary Allows users with Admin privilege to view the Notes marked Private.
Download link Private Notes for Admins v1.2.zip
Author(s) Brian McFadyen
Homepage Private Note Mod (This page)
Mod Support TNG Forums
Latest Mod 1.2
Min TNG V 7.0.0
Max TNG V 7.1.2
Files modified personlib.php
browsenotes.php
reglib.php
Related Mods None
Notes Note that version 1.2 of this mod extended the Private notes display to the Family Group and Browse Notes pages

Contents

Purpose of the Mod

This TNG modification deals with notes that have been marked Private.

It is a modification to the person pages so that notes that are marked Private will display for admin users in the same area that regular notes are displayed.

The description below is specific to TNG V7.0, although the mod has worked for versions since V6.1.1 at different line numbers.

V1.2 of the mod extends the Private note display to the Browse Notes and the Family Group sheet

Developer

This mod was developed by Brian McFadyen

Mod was enhanced by Ken Roy to also display private notes in the Browse Notes display and Family Group sheet

Revision History

Version Date Contents
v1.2 5 January 2010 updated to add display of Private Notes in the Browse Notes and Family Group sheet displays when logged in as Admin
v1.1 1 December 2009 config file updated to point to TNG Wiki article
v1.0 13 May 2009 initial config file release


Known Issues

see Discussion-page

Requirements

  • a working TNG installation. The automated installation release was initially tested at TNG Version 7.1.0.
  • an installed current version of the Mod Manager
  • a backup of your TNG personlib.php file or access to your original TNG installation package.
  • An installed current version of the Mod Manager.

Automated Installation Requirements

  1. Download the Private Notes for Admins v1.2.zip mod configuration file
  2. Unzip the private_notes_for_admins_v1.2.zip file to your ./admin/mod_folder.
  3. Follow the normal automated installation for Mod Manager, as shown in the example Mod Manager - Installing Config Files to install the private_notes_for_admins_v1.2.cfg.

Side effects

  1. As with most source code modifications, these changes will likely be overwritten during your next TNG revision upgrade and will need to be re-implemented. (Using the Mod Manager greatly simplifies this process.

TNG Manual Modifications

No longer recommended and was not updated for version 1.2 that includes browsenotes.php and reglib.php.

The following are the manual install instructions

  1. backup your existing TNG personlib.php file
  2. open a copy of your personlib.php file
  3. There are two sections to change, both within 30 lines of each other
    • locate the following code
 function getNotes( $persfamID, $flag ) {
 	global $notelinks_table, $xnotes_table, $tree, $eventtypes_table, $events_table, $text, $eventswithnotes;
 
  • change to this (red sections are the differences)
 function getNotes( $persfamID, $flag ) {
 	global $allow_admin, $notelinks_table, $xnotes_table, $tree, $eventtypes_table, $events_table, $text, $eventswithnotes;
 
  • and locate the following code

 $query = "SELECT display, $xnotes_table.note as note, $notelinks_table.eventID as eventID,$notelinks_table.xnoteID as xnoteID, $notelinks_table.ID as ID, noteID FROM $notelinks_table
 LEFT JOIN  $xnotes_table on $notelinks_table.xnoteID = $xnotes_table.ID AND $notelinks_table.gedcom = $xnotes_table.gedcom
 LEFT JOIN $events_table ON $notelinks_table.eventID = $events_table.eventID
 LEFT JOIN $eventtypes_table on $eventtypes_table.eventtypeID = $events_table.eventtypeID
 WHERE $notelinks_table.persfamID=\"$persfamID\" AND $notelinks_table.gedcom=\"$tree\" AND secret!=\"1\"
 ORDER BY ordernum, tag, eventdatetr, $notelinks_table.ID";
 
  • change to this (red sections are the differences)

 if( $allow_admin == "1") {
 	$hidenotes = " ";
 }
 else {
 	$hidenotes = " AND secret !=\"1\" ";
 }
 
 $query = "SELECT display, $xnotes_table.note as note, $notelinks_table.eventID as eventID,$notelinks_table.xnoteID as xnoteID, $notelinks_table.ID as ID, noteID FROM $notelinks_table
 LEFT JOIN  $xnotes_table on $notelinks_table.xnoteID = $xnotes_table.ID AND $notelinks_table.gedcom = $xnotes_table.gedcom
 LEFT JOIN $events_table ON $notelinks_table.eventID = $events_table.eventID
 LEFT JOIN $eventtypes_table on $eventtypes_table.eventtypeID = $events_table.eventtypeID
 WHERE $notelinks_table.persfamID=\"$persfamID\" AND $notelinks_table.gedcom=\"$tree\" $hidenotes
 ORDER BY ordernum, tag, eventdatetr, $notelinks_table.ID";
 
  • you can copy the bits of red text from above to paste into your file
  1. close your personlib.php file and copy it to your base TNG directory
  2. check it out

In the event of a problem

  • Try using the Mod Manager Remove capability
  • copy your backup personlib.php, browsenotes.php, and reglib.php files to your base TNG directory
    • all should be well now

Visualization of this mod

Without Mod

Person page

Without this mod, the Individual Person page does not display Private notes, as shown in the image on the right.


Family page

Without the version 1.2 of this mod,, the Family Group sheet does not display Private Notes, as shown in the image on the right.

Browse Notes page

Without the version 1.2 of this mod, the Browse Notes list does not display Private Notes, as shown in the image on the right.

With Mod Installed

Person page

With the Private Note Mod installed, the Private note added to the Death event is also displayed as shown in the image on the right.

Note that Private Notes are not displayed to users who do not have Admin privilege.

Family page

With the Private Note Mod version 1.2 installed, the Family Group sheet displays Private Notes, as shown in the image on the right.

Note that Private Notes are not displayed to users who do not have Admin privilege.

Browse Notes page

With the Private Note Mod version 1.2 installed, the Browse Notes list displays Private Notes, as shown in the image on the right.

Note that Private Notes are not displayed to users who do not have Admin privilege.

Personal tools
Translators