summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-05-26 14:51:23 +0100
committerLester Caine <lester@lsces.co.uk>2026-05-26 14:51:23 +0100
commit620f081325c4e181a011781b5e72d251079b4271 (patch)
treece8ad2c6c0c0e2bca9585454eb61a68b2b05fbb0 /templates
parent3ce59b8686582a514406b1a57574e846ce83a7c1 (diff)
downloadcontact-620f081325c4e181a011781b5e72d251079b4271.tar.gz
contact-620f081325c4e181a011781b5e72d251079b4271.tar.bz2
contact-620f081325c4e181a011781b5e72d251079b4271.zip
Migrate contact xref to liberty_xref tables; add address_postcode to schema
5.0.1 upgrade migrates contact_xref_type/source/xref data into liberty_xref_group/item/xref with content_type_guid='contact'. 5.0.2 upgrade drops the old contact_xref* tables. schema_inc.php updated for fresh installs: - Removes contact_xref, contact_xref_source, contact_xref_type tables - Adds address_postcode table (UK postcode lookup, LEFT JOIN'd in queries) - Defaults now INSERT into liberty_xref_group and liberty_xref_item directly - dependencies => 'liberty' ensures correct install ordering PHP and templates: source→item, xref_type→group rename throughout. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'templates')
-rwxr-xr-xtemplates/add_xref.tpl8
-rwxr-xr-xtemplates/add_xref_address.tpl6
-rwxr-xr-xtemplates/contact_date_bar.tpl2
-rwxr-xr-xtemplates/display_contact.tpl2
-rwxr-xr-xtemplates/list_xref_generic.tpl2
-rwxr-xr-xtemplates/view_xref_address_record.tpl2
-rwxr-xr-xtemplates/view_xref_contact_record.tpl4
-rwxr-xr-xtemplates/view_xref_text_record.tpl4
8 files changed, 15 insertions, 15 deletions
diff --git a/templates/add_xref.tpl b/templates/add_xref.tpl
index 6b07030..fa99ca7 100755
--- a/templates/add_xref.tpl
+++ b/templates/add_xref.tpl
@@ -5,7 +5,7 @@ function updateContactXrefFormat() { {/literal}
document.getElementById('{$output}-format').style.display = 'none';
{/foreach} {literal}
var form = document.getElementById('editContactXrefForm');
- var input = form.source;
+ var input = form.item;
var i = input.selectedIndex;
var select = document.getElementById('format-'+input.options[i].value).value;
document.getElementById(select+'-format').style.display = 'block';
@@ -25,7 +25,7 @@ function updateContactXrefFormat() { {/literal}
<div class="body">
{form enctype="multipart/form-data" id="editContactXrefForm"}
<input type="hidden" name="content_id" value="{$xrefInfo.content_id}" />
- <input type="hidden" name="xref_type" value="{$xrefInfo.xref_type}" />
+ <input type="hidden" name="group" value="{$xrefInfo.group}" />
{foreach from=$xrefInfo.xref_type_list.type key=feature item=output}
<input type="hidden" id="format-{$feature}" name="format-{$feature}" value="{$output}" />
{/foreach}
@@ -36,9 +36,9 @@ function updateContactXrefFormat() { {/literal}
{formfeedback error=$errors warning=$contactWarnings success=$contactSuccess}
<div class="form-group">
- {formlabel label="Reference Type" for="source"}
+ {formlabel label="Reference Type" for="item"}
{forminput}
- {html_options name="source" id="source" options=$xrefInfo.xref_type_list.list selected=$smarty.const.CONTACT_FORMAT_GENERIC onchange="updateContactXrefFormat();"}
+ {html_options name="item" id="item" options=$xrefInfo.xref_type_list.list selected=$smarty.const.CONTACT_FORMAT_GENERIC onchange="updateContactXrefFormat();"}
{formhelp note="Select type of reference information to add"}
{/forminput}
</div>
diff --git a/templates/add_xref_address.tpl b/templates/add_xref_address.tpl
index 67374cd..51dc2ad 100755
--- a/templates/add_xref_address.tpl
+++ b/templates/add_xref_address.tpl
@@ -11,15 +11,15 @@
<div class="body">
{form enctype="multipart/form-data" id="writexref"}
<input type="hidden" name="content_id" value="{$xrefInfo.content_id}" />
- <input type="hidden" name="xref_type" value="{$xrefInfo.xref_type}" />
+ <input type="hidden" name="group" value="{$xrefInfo.group}" />
{jstabs}
{jstab title="Address Details"}
{legend legend="Contents"}
<div class="form-group">
- {formlabel label="Address Type" for="source"}
+ {formlabel label="Address Type" for="item"}
{forminput}
- {html_options name="$xrefInfo.xref_type_list[$xrefInfo.source]" options=$xrefInfo.xref_type_list selected=$xrefInfo.source}
+ {html_options name="$xrefInfo.xref_type_list[$xrefInfo.item]" options=$xrefInfo.xref_type_list selected=$xrefInfo.item}
{formhelp note="Type of cross link reference to add."}
{/forminput}
</div>
diff --git a/templates/contact_date_bar.tpl b/templates/contact_date_bar.tpl
index 0ab0290..883a597 100755
--- a/templates/contact_date_bar.tpl
+++ b/templates/contact_date_bar.tpl
@@ -5,7 +5,7 @@
{if $print_page ne 'y'}
{if !$lock}
{if $gBitUser->hasPermission('p_edit_contact')}
- {smartlink ititle='Add additional crossref record' ifile="add_xref.php" booticon="icon-note-add" content_id=$gContent->mInfo.content_id xref_type=-1}
+ {smartlink ititle='Add additional crossref record' ifile="add_xref.php" booticon="icon-note-add" content_id=$gContent->mInfo.content_id group=-1}
{smartlink ititle="Edit Contact" ifile="edit.php" booticon="icon-user-edit" content_id=$gContent->mInfo.content_id}
{/if}
{/if}
diff --git a/templates/display_contact.tpl b/templates/display_contact.tpl
index 5cb4901..0db300c 100755
--- a/templates/display_contact.tpl
+++ b/templates/display_contact.tpl
@@ -65,6 +65,6 @@
{jstabs}
{section name=type loop=$gContent->mInfo.type}
- {include file="bitpackage:liberty/list_xref.tpl" source=$gContent->mInfo.type[type].source source_title=$gContent->mInfo.type[type].title xref_type=$gContent->mInfo.type[type].sort_order allow_add=true}
+ {include file="bitpackage:liberty/list_xref.tpl" source=$gContent->mInfo.type[type].source source_title=$gContent->mInfo.type[type].title group=$gContent->mInfo.type[type].sort_order allow_add=true}
{/section}
{/jstabs}
diff --git a/templates/list_xref_generic.tpl b/templates/list_xref_generic.tpl
index dcd9f40..7104449 100755
--- a/templates/list_xref_generic.tpl
+++ b/templates/list_xref_generic.tpl
@@ -40,7 +40,7 @@
{if $gBitUser->hasPermission('p_contact_update')}
<div>
{if $source ne 'history' }
- {smartlink ititle="Add additional detail record" ifile="add_xref.php" booticon="icon-note-add" content_id=$gContent->mInfo.content_id xref_type=$xref_type}
+ {smartlink ititle="Add additional detail record" ifile="add_xref.php" booticon="icon-note-add" content_id=$gContent->mInfo.content_id group=$group}
{/if}
</div>
{/if}
diff --git a/templates/view_xref_address_record.tpl b/templates/view_xref_address_record.tpl
index 9750938..f8a217c 100755
--- a/templates/view_xref_address_record.tpl
+++ b/templates/view_xref_address_record.tpl
@@ -31,7 +31,7 @@
{if $gBitUser->hasPermission( 'p_contact_update' ) && $source ne 'history' }
{smartlink ititle="Edit" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
{/if}
- {if $gBitUser->hasPermission( 'p_contact_expunge' ) && $gContent->mInfo.$source[xref].source ne 'KEY_B' }
+ {if $gBitUser->hasPermission( 'p_contact_expunge' ) && $gContent->mInfo.$source[xref].item ne 'KEY_B' }
{if $source eq 'history' }
{smartlink ititle="Restore" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id expunge=-1}
{else}
diff --git a/templates/view_xref_contact_record.tpl b/templates/view_xref_contact_record.tpl
index 77df1f7..01a7095 100755
--- a/templates/view_xref_contact_record.tpl
+++ b/templates/view_xref_contact_record.tpl
@@ -31,14 +31,14 @@
<td>
<span class="actionicon">
{if $gBitUser->hasPermission( 'p_contact_update' ) && $source ne 'history' }
- {if $gContent->mInfo.$source[xref].source eq 'KEY_B' }
+ {if $gContent->mInfo.$source[xref].item eq 'KEY_B' }
{smartlink ititle="Callout" ifile="edit_key_break.php" booticon="icon-redo" expunge=0 content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
{smartlink ititle="Reseal" ifile="edit_key_break.php" booticon="icon-undo" expunge=2 content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
{else}
{smartlink ititle="Edit" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
{/if}
{/if}
- {if $gBitUser->hasPermission( 'p_contact_expunge' ) && $gContent->mInfo.$source[xref].source ne 'KEY_B' }
+ {if $gBitUser->hasPermission( 'p_contact_expunge' ) && $gContent->mInfo.$source[xref].item ne 'KEY_B' }
{if $source eq 'history' }
{smartlink ititle="Restore" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id expunge=-1}
{else}
diff --git a/templates/view_xref_text_record.tpl b/templates/view_xref_text_record.tpl
index 77df1f7..01a7095 100755
--- a/templates/view_xref_text_record.tpl
+++ b/templates/view_xref_text_record.tpl
@@ -31,14 +31,14 @@
<td>
<span class="actionicon">
{if $gBitUser->hasPermission( 'p_contact_update' ) && $source ne 'history' }
- {if $gContent->mInfo.$source[xref].source eq 'KEY_B' }
+ {if $gContent->mInfo.$source[xref].item eq 'KEY_B' }
{smartlink ititle="Callout" ifile="edit_key_break.php" booticon="icon-redo" expunge=0 content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
{smartlink ititle="Reseal" ifile="edit_key_break.php" booticon="icon-undo" expunge=2 content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
{else}
{smartlink ititle="Edit" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
{/if}
{/if}
- {if $gBitUser->hasPermission( 'p_contact_expunge' ) && $gContent->mInfo.$source[xref].source ne 'KEY_B' }
+ {if $gBitUser->hasPermission( 'p_contact_expunge' ) && $gContent->mInfo.$source[xref].item ne 'KEY_B' }
{if $source eq 'history' }
{smartlink ititle="Restore" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id expunge=-1}
{else}