0001: 
This is a TNG mod directive file
0002: 
%name:Gedcom Converter%
0003: 
%version:13.0.0.16%
0004: 
%description: Installs a program in the Admin >> Import/Export menu that reads a Gedcom file,
0005: 
and saves modifications in a new Gedcom file.
0006: 
The converter has numerous options to convert Gedcom data, and even aspects of the structure of a Gedcom file.
0007: 
It does not use the TNG database, and thus should be compatible with any version of TNG above TNG12.
0008: 
%
0009: 
%wikipage:Gedcom_Converter%
0010: 
%author:Robin Richmond:https://tng.lythgoes.net/wiki/index.php?title=User:Robinrichm%
0011: 
0012: 
*************** Revision History ****************
0013: 
v13.0.0.15 24 Sep 2020
0014: 
# Handled three underlying TNGv13 code changes, including the new functions to start and end the <body> of the new pages.
0015: 
# Upgraded to my TNGv13 Inner Mod Menus mod
0016: 
0017: 
********************************************************************
0018: 
*** See program documentation and additional revision history in readme.php in the mod subfolder ***
0019: 
********************************************************************
0020: 
To Do
0021: 
- To merge duplicate citations, we need a gedcom option, and completion of code that
0022: 
  - grabs media object IDs from the citation being deleted,
0023: 
  - takes those object IDs and adds them to the citation being kept
0024: 
  - looks up the current source record in the dictionary of source records
0025: 
0026: 
*********************************************************************
0027: 
*********************************************************************
0028: 
%target:admin_dataimport.php%
0029: 
0030: 
*************** admin_dataimport.php Location 1 - Top-of-file comments
0031: 
%location:%
0032: 
include("begin.php");
0033: 
%end:%
0034: 
%insert:before%
0035: 
##### admin_dataimport.php, modified by ###Gedcom Converter, by Robin Richmond
0036: 
# Changes the internal tabs to start with a new tab that invokes the Gedcom converter,
0037: 
# and adds a default value to the server-side filename form parameter, based on a new
0038: 
# querystring parameter, "serverfilename"
0039: 
$tngModNames['Gedcom Converter']['admin_dataimport.php'] = '16'; #"Register" the mod
0040: 
#############################################################################
0041: 
0042: 
%end:%
0043: 
0044: 
******* admin_dataimport.php Location 2 - Add a tab that invokes the Gedcom converter.
0045: 
%location:%
0046: 
	$datatabs['0'] = array(1,"admin_dataimport.php",$admtext['import'],"import");
0047: 
%end:%
0048: 
%insert:before%
0049: 
	###Gedcom Converter Location 2: Add a tab that invokes the Gedcom Converter, and flag it as new
0050: 
	if (file_exists("rrinnermodmenu_newtab.php"))
0051: 
		include_once('rrinnermodmenu_newtab.php');
0052: 
	elseif (!function_exists('rrimmNewTab')) {function rrimmNewTab($modname){} }
0053: 
	$datatabs['rr-gc'] = array(1, "rrgedcomconverter_form.php", $admtext['rrgc-convert'].rrimmNewTab('Gedcom Converter'), "convert");
0054: 
	###Gedcom Converter Location 2: End of insertion
0055: 
%end:%
0056: 
0057: 
******* admin_dataimport.php Location 3 - Add the new querystring parameter 'serverfilename' as a default for the server filename form field
0058: 
*** Code fragment replaced with multiple lines, with an HTML comment
0059: 
%location:%
0060: 
database" size="50">
0061: 
%end:%
0062: 
%trimreplace:%
0063: 
database" size="50"
0064: 
			value="<?php echo $_GET['serverfilename']; ?>">
0065: 
			<!-- ###Gedcom Converter Location 3: New default value from querystring -->
0066: 
0067: 
%end:%
0068: 
0069: 
*************** admin_dataimport.php Location 4 - Display mod names
0070: 
%location:%
0071: 
</tr>
0072: 
</table>
0073: 
</form>
0074: 
%end:%
0075: 
%insert:after%
0076: 
<?php ###Gedcom Converter Location 4: Show Mods
0077: 
if (file_exists('rrshowmodnames_include.php')) include_once ('rrshowmodnames_include.php');
0078: 
?>
0079: 
%end:%
0080: 
0081: 
*********************************************************************
0082: 
*********************************************************************
0083: 
%target:admin_export.php%
0084: 
0085: 
*************** admin_export.php Location 1 - Top-of-file comments
0086: 
%location:%
0087: 
include("begin.php");
0088: 
%end:%
0089: 
%insert:before%
0090: 
##### admin_export.php, modified by ###Gedcom Converter, by Robin Richmond
0091: 
# Changes the tab menu to start with a new tab that invokes the Gedcom converter,
0092: 
$tngModNames['Gedcom Converter']['admin_export.php'] = '16';
0093: 
#############################################################################
0094: 
0095: 
%end:%
0096: 
0097: 
******* admin_export.php Location 2 - - Add a tab for the Gedcom Converter
0098: 
%location:%
0099: 
	$datatabs[0] = array(1,"admin_dataimport.php",$admtext['import'],"import");
0100: 
%end:%
0101: 
%insert:before%
0102: 
	###Gedcom Converter Location 2: Add a tab that invokes the Gedcom Converter, and flag it as new
0103: 
	if (file_exists("rrinnermodmenu_newtab.php"))
0104: 
		include_once('rrinnermodmenu_newtab.php');
0105: 
	elseif (!function_exists('rrimmNewTab')) {function rrimmNewTab($modname){} }
0106: 
	$datatabs['rr-gc'] = array(1, "rrgedcomconverter_form.php", $admtext['rrgc-convert'].rrimmNewTab('Gedcom Converter'), "convert");
0107: 
	###Gedcom Converter Location 2: End of insertion
0108: 
%end:%
0109: 
0110: 
*************** admin_export.php Location 3 - Display mod names
0111: 
%location:%
0112: 
</td>
0113: 
</tr>
0114: 
0115: 
</table>
0116: 
%end:%
0117: 
%insert:after%
0118: 
<?php ### Gedcom Converter Location 3: Show Mods
0119: 
if (file_exists('rrshowmodnames_include.php')) include_once ('rrshowmodnames_include.php');
0120: 
?>
0121: 
%end:%
0122: 
0123: 
*********************************************************************
0124: 
*********************************************************************
0125: 
%target:admin_gedimport.php%
0126: 
*** The program that executes an import and shows the results
0127: 
0128: 
*************** admin_gedimport.php Location 1 - Top-of-file comments
0129: 
%location:%
0130: 
@ini_set( "magic_quotes_runtime", "0" );
0131: 
%end:%
0132: 
%insert:before%
0133: 
##### admin_gedimport.php, modified by ###Gedcom Converter, by Robin Richmond
0134: 
# Changes the tab menu to start with a new tab that invokes the Gedcom converter "kickoff form".
0135: 
$tngModNames['Gedcom Converter']['admin_gedimport.php'] = '16';
0136: 
#############################################################################
0137: 
0138: 
%end:%
0139: 
0140: 
******* admin_gedimport.php Location 2 - Add a tab that invokes the Gedcom converter.
0141: 
%location:%
0142: 
		$datatabs['0'] = array(1,"admin_dataimport.php",$admtext['import'],"import");
0143: 
%end:%
0144: 
%insert:before%
0145: 
	###Gedcom Converter Location 2: Add a tab that invokes the Gedcom Converter, and flag it as new
0146: 
	if (file_exists("rrinnermodmenu_newtab.php"))
0147: 
		include_once('rrinnermodmenu_newtab.php');
0148: 
	elseif (!function_exists('rrimmNewTab')) {function rrimmNewTab($modname){}}
0149: 
	$datatabs['rr-gc'] = array(1,"rrgedcomconverter_form.php",$admtext['rrgc-convert'].rrimmNewTab('Gedcom Converter'),"convert");
0150: 
	###Gedcom Converter Location 2: End of insertion
0151: 
%end:%
0152: 
0153: 
*************** admin_gedimport.php Location 3 - Display mod names
0154: 
%location:%
0155: 
	echo "</div></div>\n";
0156: 
%end:%
0157: 
%insert:after%
0158: 
	###Gedcom Converter Location 3: Show Mod Names
0159: 
	if (file_exists('rrshowmodnames_include.php')) include_once ('rrshowmodnames_include.php');
0160: 
%end:%
0161: 
0162: 
*********************************************************************
0163: 
*********************************************************************
0164: 
%target:admin_secondary.php%
0165: 
*** The program that executes a secondary process and shows the results.
0166: 
0167: 
*************** admin_secondary.php Location 1 - Top-of-file comments
0168: 
%location:%
0169: 
include("begin.php");
0170: 
%end:%
0171: 
%insert:before%
0172: 
##### admin_secondary.php, modified by ###Gedcom Converter, by Robin Richmond
0173: 
# Adds a Gedcom Converter tab at the beginning of the tab menu
0174: 
$tngModNames['Gedcom Converter']['admin_secondary.php'] = '16';
0175: 
#############################################################################
0176: 
0177: 
%end:%
0178: 
0179: 
******* admin_secondary.php Location 2 - Add a tab that invokes the Gedcom converter.
0180: 
%location:%
0181: 
	$datatabs[0] = array(1,"admin_dataimport.php",$admtext['import'],"import");
0182: 
%end:%
0183: 
%insert:before%
0184: 
	###Gedcom Converter Location 2: Add a tab that invokes the Gedcom Converter, and flag it as new
0185: 
	if (file_exists("rrinnermodmenu_newtab.php"))
0186: 
		include_once('rrinnermodmenu_newtab.php');
0187: 
	elseif (!function_exists('rrimmNewTab')) {function rrimmNewTab($modname){} }
0188: 
	$datatabs['rr-gc'] = array(1, "rrgedcomconverter_form.php", $admtext['rrgc-convert'].rrimmNewTab('Gedcom Converter'), "convert");
0189: 
	###Gedcom Converter Location 2: End of insertion
0190: 
%end:%
0191: 
0192: 
*************** admin_secondary.php Location 3 - Display mod names
0193: 
%location:%
0194: 
echo tng_adminfooter();
0195: 
%end:%
0196: 
%insert:before%
0197: 
###Gedcom Converter Location 3: Show Mods
0198: 
if (file_exists('rrshowmodnames_include.php')) include_once ('rrshowmodnames_include.php');
0199: 
%end:%
0200: 
0201: 
*********************************************************************
0202: 
*********************************************************************
0203: 
%target:admin_secondmenu.php%
0204: 
*** The menu for secondary processes
0205: 
0206: 
*************** admin_secondmenu.php Location 1 - Top-of-file comments
0207: 
%location:%
0208: 
include("begin.php");
0209: 
%end:%
0210: 
%insert:before%
0211: 
##### admin_secondmenu.php, modified by ###Gedcom Converter, by Robin Richmond
0212: 
# Changes the internal tabs to start with a new tab that invokes the Gedcom converter,
0213: 
$tngModNames['Gedcom Converter']['admin_secondmenu.php'] = '16';
0214: 
#############################################################################
0215: 
0216: 
%end:%
0217: 
0218: 
******* admin_secondmenu.php Location 2 - Add a tab for the Gedcom Converter
0219: 
%location:%
0220: 
	$datatabs[0] = array(1,"admin_dataimport.php",$admtext['import'],"import");
0221: 
%end:%
0222: 
%insert:before%
0223: 
	###Gedcom Converter Location 2: Add a tab that invokes the Gedcom Converter, and flag it as new
0224: 
	if (file_exists("rrinnermodmenu_newtab.php"))
0225: 
		include_once('rrinnermodmenu_newtab.php');
0226: 
	elseif (!function_exists('rrimmNewTab')) {function rrimmNewTab($modname){} }
0227: 
	$datatabs['rr-gc'] = array(1, "rrgedcomconverter_form.php", $admtext['rrgc-convert'].rrimmNewTab('Gedcom Converter'), "convert");
0228: 
	###Gedcom Converter Location 2: End of insertion
0229: 
%end:%
0230: 
0231: 
*************** admin_secondmenu.php Location 3 - Display mod names
0232: 
%location:%
0233: 
</td>
0234: 
</tr>
0235: 
</table>
0236: 
%end:%
0237: 
%insert:after%
0238: 
<?php ###Gedcom Converter Location 3: Show Mods
0239: 
if (file_exists('rrshowmodnames_include.php')) include_once ('rrshowmodnames_include.php');
0240: 
?>
0241: 
%end:%
0242: 
0243: 
*********************************************************************
0244: 
*********************************************************************
0245: 
%target:languages/English/cust_text.php%
0246: 
0247: 
%location:%
0248: 
//Mods should put their changes before this line, local changes should come after it.
0249: 
%end:%
0250: 
%insert:before%
0251: 
0252: 
###########################Gedcom Converter: new strings
0253: 
$admtext['rrgc-convert'] = "Gedcom Converter"; #New tab in Import/Export programs
0254: 
$admtext['rrgc-modfolder'] = "gedcom_converter_v13.0.0.16"; #New tab in Import/Export programs
0255: 
###########################Gedcom Converter: End of new strings
0256: 
0257: 
%end:%
0258: 
0259: 
*********************************************************************
0260: 
*********************************************************************
0261: 
%target:languages/English-UTF8/cust_text.php%
0262: 
0263: 
%location:%
0264: 
//Mods should put their changes before this line, local changes should come after it.
0265: 
%end:%
0266: 
%insert:before%
0267: 
0268: 
###########################Gedcom Converter: new strings
0269: 
$admtext['rrgc-convert'] = "Gedcom Converter"; #New tab in Import/Export programs
0270: 
$admtext['rrgc-modfolder'] = "gedcom_converter_v13.0.0.16"; #New tab in Import/Export programs
0271: 
###########################Gedcom Converter: End of new strings
0272: 
0273: 
%end:%
0274: 
0275: 
***************************************************************************
0276: 
***************************************************************************
0277: 
%target:files%
0278: 
0279: 
1. Kickoff form - displays options and launches the converter.
0280: 
%copyfile:gedcom_converter_v13.0.0.16/rrgedcomconverter_form.php%
0281: 
0282: 
2. Program to do the converting
0283: 
%copyfile:gedcom_converter_v13.0.0.16/rrgedcomconverter.php%
0284: 
0285: 
3. Ajax program to save modified options to the config file.
0286: 
%copyfile:gedcom_converter_v13.0.0.16/rrgedcomconverter_saveoptions.php%
0287: 
0288: 
4. Help file linked from the innermenus of rrgedcomconverter_form.php and gedcom2thg.php.
0289: 
%copyfile2:gedcom_converter_v13.0.0.16/languages/English/rrgedcomconverter_help.php:languages/English/rrgedcomconverter_help.php%
0290: 
0291: 
5. Image file used by the help file to show what the Placename Formatting form would look like.
0292: 
%copyfile2:gedcom_converter_v13.0.0.16/languages/English/rrgedcomconverter_placeoptions.jpg:languages/English/rrgedcomconverter_placeoptions.jpg%
0293: 
0294: 
6. Configuration file for the Gedcom Converter options.
0295: 
(Note that a second config file installed by the Place Name Format mod defines
0296: 
initial values for the Place Name Formating options.)
0297: 
%copyfile2:gedcom_converter_v13.0.0.16/extensions/rrgedcomconverter_config-distrib.php:$extspath/rrgedcomconverter_config-distrib.php%
0298: 
0299: 
7. Include file that defines a PHP class that copies a selected home computer file to the server for reading.
0300: 
It is used to read and upload a Gedcom file that is stored on the user's home computer.
0301: 
%copyfile2:gedcom_converter_v13.0.0.16/extensions/upload.class.php:$extspath/upload.class.php%
0302: 
0303: 
8. Configuration file that determines how INDI and FAM level 1 tags will be processed.
0304: 
There is no program to edit this file. If it must be edited, it must be edited by hand.
0305: 
%copyfile2:gedcom_converter_v13.0.0.16/extensions/rrgedcomconverter_tagsconfig.php:$extspath/rrgedcomconverter_tagsconfig.php%
0306: 
0307: 
*** The mod's subfolder has a "languages" folder with a file that defines language strings.