summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-06-06 09:41:03 +0100
committerLester Caine <lester@lsces.co.uk>2026-06-06 09:41:03 +0100
commitfa31eb01f523e1c1e9eb7e4492ba8c308a98447b (patch)
treebc228d73d6bb333ee2f7178ecc3aac8ac364b157 /templates
parent17ee494db0a95e791d71261cedf0478e8a40cf4b (diff)
downloadcontact-fa31eb01f523e1c1e9eb7e4492ba8c308a98447b.tar.gz
contact-fa31eb01f523e1c1e9eb7e4492ba8c308a98447b.tar.bz2
contact-fa31eb01f523e1c1e9eb7e4492ba8c308a98447b.zip
xref item templates: drop dead Link/nbsp column; move generics to liberty
- view_xref_address_item.tpl, view_xref_phone_item.tpl: remove &nbsp; second column - view_xref_contact_group.tpl: add 30/30/40% widths to Type/Value/Note - view_xref_text_item.tpl, list_xref_generic.tpl: deleted — fall through to liberty equivalents - ImportContactCSV.php: set xorder explicitly (#P/#F → 1, others → 0) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'templates')
-rwxr-xr-xtemplates/list_xref_generic.tpl50
-rwxr-xr-xtemplates/view_xref_address_item.tpl23
-rw-r--r--templates/view_xref_contact_group.tpl35
-rwxr-xr-xtemplates/view_xref_phone_item.tpl19
-rwxr-xr-xtemplates/view_xref_text_item.tpl52
5 files changed, 53 insertions, 126 deletions
diff --git a/templates/list_xref_generic.tpl b/templates/list_xref_generic.tpl
deleted file mode 100755
index aeeff7c..0000000
--- a/templates/list_xref_generic.tpl
+++ /dev/null
@@ -1,50 +0,0 @@
-{* if isset( $gContent->mInfo.$source ) *}
- {assign var=xrefcnt value=$gContent->mInfo.$source|default:[]|@count}
- {jstab title="$source_title ($xrefcnt)"}
- {legend legend=$source_title}
- <div class="form-group table-responsive">
- <table>
- <thead>
- <tr>
- <th>ID</th>
- <th>Link</th>
- <th>Data</th>
- <th>Note</th>
- {if $source ne 'history' }
- <th>Started</th>
- {else}
- <th>Ended</th>
- {/if}
- </td>
- {if $gBitSystem->isFeatureActive( 'contact_list_last_modified' )}
- <th>Updated</th>
- {/if}
- <th>Edit</th>
- </tr>
- </thead>
- <tbody>
- {section name=xref loop=$gContent->mInfo.$source}
- {assign var=_rowTpl value=$gContent->mInfo.$source[xref].template}
- <tr class="{cycle values="even,odd"}" title="{$gContent->mInfo.title|escape}">
- {include file=$gContent->getXrefRecordTemplate($_rowTpl)}
- </tr>
- {sectionelse}
- <tr class="norecords">
- <td colspan="3">
- {tr}No {$source} records found{/tr}
- </td>
- </tr>
- {/section}
- </tbody>
- </table>
- </div>
- {if $gBitUser->hasPermission('p_contact_update')}
- <div>
- {if $source ne 'history' }
- {smartlink ititle="Add additional detail record" ifile="add_xref.php" biticon="list-add" content_id=$gContent->mInfo.content_id group=$group}
- {/if}
- </div>
- {/if}
- {/legend}
- {/jstab}
-{* /if *}
diff --git a/templates/view_xref_address_item.tpl b/templates/view_xref_address_item.tpl
index 0695731..368aef6 100755
--- a/templates/view_xref_address_item.tpl
+++ b/templates/view_xref_address_item.tpl
@@ -1,22 +1,19 @@
{strip}
<td>
- {$gContent->mInfo.$source[xref].source_title|escape}
+ {$xrefInfo.xref_title|escape}
</td>
<td>
-&nbsp;
+ {$xrefInfo.xkey_ext|escape}{if $xrefInfo.address}, {$xrefInfo.address|escape}{/if}{if $xrefInfo.xkey}, {$xrefInfo.xkey|escape}{/if}
</td>
<td>
- {$gContent->mInfo.$source[xref].xkey_ext|escape}, {$gContent->mInfo.$source[xref].address|escape}, {$gContent->mInfo.$source[xref].xkey|escape}
-</td>
-<td>
- {$gContent->mInfo.$source[xref].data|escape}
+ {$xrefInfo.data|escape}
</td>
{if $xrefAllowEdit}
<td>
{if $source ne 'history' }
- {$gContent->mInfo.$source[xref].start_date|bit_short_date}
+ {$xrefInfo.start_date|bit_short_date}
{else}
- {$gContent->mInfo.$source[xref].end_date|bit_short_date}
+ {$xrefInfo.end_date|bit_short_date}
{/if}
</td>
{if $gBitSystem->isFeatureActive( 'contact_list_last_modified' )}
@@ -27,16 +24,16 @@
<td>
<span class="actionicon">
{if $gBitUser->hasPermission( 'p_contact_view_detail' )}
- {smartlink ititle="View" ifile="view_xref.php" biticon="view-fullscreen" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
+ {smartlink ititle="View" ifile="view_xref.php" biticon="view-fullscreen" content_id=$gContent->mInfo.content_id xref_id=$xrefInfo.xref_id}
{/if}
{if $gBitUser->hasPermission( 'p_contact_update' ) && $source ne 'history' }
- {smartlink ititle="Edit" ifile="edit_xref.php" biticon="edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
+ {smartlink ititle="Edit" ifile="edit_xref.php" biticon="edit" content_id=$gContent->mInfo.content_id xref_id=$xrefInfo.xref_id}
{/if}
- {if $gBitUser->hasPermission( 'p_contact_expunge' ) && $gContent->mInfo.$source[xref].item ne 'KEY_B' }
+ {if $gBitUser->hasPermission( 'p_contact_expunge' ) && $xrefInfo.item ne 'KEY_B' }
{if $source eq 'history' }
- {smartlink ititle="Restore" ifile="edit_xref.php" biticon="edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id expunge=-1}
+ {smartlink ititle="Restore" ifile="edit_xref.php" biticon="edit" content_id=$gContent->mInfo.content_id xref_id=$xrefInfo.xref_id expunge=-1}
{else}
- {smartlink ititle="Delete" ifile="edit_xref.php" biticon="user-trash" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id expunge=1}
+ {smartlink ititle="Delete" ifile="edit_xref.php" biticon="user-trash" content_id=$gContent->mInfo.content_id xref_id=$xrefInfo.xref_id expunge=1}
{/if}
{/if}
</span>
diff --git a/templates/view_xref_contact_group.tpl b/templates/view_xref_contact_group.tpl
new file mode 100644
index 0000000..cada284
--- /dev/null
+++ b/templates/view_xref_contact_group.tpl
@@ -0,0 +1,35 @@
+{assign var=xrefAllowEdit value=$allow_edit|default:true}
+{jstab title="`$xrefGroup->mTitle` ({$xrefGroup->mXrefs|@count})"}
+{legend legend=$xrefGroup->mTitle}
+<div class="form-group table-responsive">
+ <table>
+ <thead>
+ <tr>
+ <th style="width:30%">{tr}Type{/tr}</th>
+ <th style="width:30%">{tr}Value{/tr}</th>
+ <th style="width:40%">{tr}Note{/tr}</th>
+ {if $xrefAllowEdit}<th>{tr}Added{/tr}</th><th>{tr}Edit{/tr}</th>{/if}
+ </tr>
+ </thead>
+ <tbody>
+ {if $xrefGroup->mXrefs}
+ {foreach $xrefGroup->mXrefs as $xrefInfo}
+ <tr class="{cycle values="even,odd"}">
+ {include file=$gContent->getXrefRecordTemplate($xrefInfo.template)}
+ </tr>
+ {/foreach}
+ {else}
+ <tr class="norecords">
+ <td colspan="{if $xrefAllowEdit}5{else}3{/if}">{tr}No {$xrefGroup->mTitle} records found{/tr}</td>
+ </tr>
+ {/if}
+ </tbody>
+ </table>
+</div>
+{if $allow_add && $gContent->isValid() && $gContent->hasUpdatePermission() && $xrefGroup->mXGroup ne 'history'}
+ <div>
+ {smartlink ititle="Add record" ipackage="liberty" ifile="add_xref.php" biticon="list-add" content_id=$gContent->mInfo.content_id group=$xrefGroup->mSortOrder}
+ </div>
+{/if}
+{/legend}
+{/jstab}
diff --git a/templates/view_xref_phone_item.tpl b/templates/view_xref_phone_item.tpl
index 8e9bc3c..751948f 100755
--- a/templates/view_xref_phone_item.tpl
+++ b/templates/view_xref_phone_item.tpl
@@ -1,22 +1,19 @@
{strip}
<td>
- {$gContent->mInfo.$source[xref].source_title|escape}
+ {$xrefInfo.xref_title|escape}
</td>
<td>
-&nbsp;
+ {$xrefInfo.xkey|escape}
</td>
<td>
- {$gContent->mInfo.$source[xref].xkey|escape}
-</td>
-<td>
- {$gContent->mInfo.$source[xref].data|escape}
+ {$xrefInfo.data|escape}
</td>
{if $xrefAllowEdit}
<td>
{if $source ne 'history' }
- {$gContent->mInfo.$source[xref].start_date|bit_short_date}
+ {$xrefInfo.start_date|bit_short_date}
{else}
- {$gContent->mInfo.$source[xref].end_date|bit_short_date}
+ {$xrefInfo.end_date|bit_short_date}
{/if}
</td>
{if $gBitSystem->isFeatureActive( 'contact_list_last_modified' )}
@@ -27,13 +24,13 @@
<td>
<span class="actionicon">
{if $gBitUser->hasPermission( 'p_contact_update' ) && $source ne 'history' }
- {smartlink ititle="Edit" ifile="edit_xref.php" biticon="edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
+ {smartlink ititle="Edit" ifile="edit_xref.php" biticon="edit" content_id=$gContent->mInfo.content_id xref_id=$xrefInfo.xref_id}
{/if}
{if $gBitUser->hasPermission( 'p_contact_expunge' ) }
{if $source eq 'history' }
- {smartlink ititle="Restore" ifile="edit_xref.php" biticon="edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id expunge=-1}
+ {smartlink ititle="Restore" ifile="edit_xref.php" biticon="edit" content_id=$gContent->mInfo.content_id xref_id=$xrefInfo.xref_id expunge=-1}
{else}
- {smartlink ititle="Delete" ifile="edit_xref.php" biticon="user-trash" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id expunge=1}
+ {smartlink ititle="Delete" ifile="edit_xref.php" biticon="user-trash" content_id=$gContent->mInfo.content_id xref_id=$xrefInfo.xref_id expunge=1}
{/if}
{/if}
</span>
diff --git a/templates/view_xref_text_item.tpl b/templates/view_xref_text_item.tpl
deleted file mode 100755
index e24895a..0000000
--- a/templates/view_xref_text_item.tpl
+++ /dev/null
@@ -1,52 +0,0 @@
-{strip}
-<td>
- {$gContent->mInfo.$source[xref].source_title|escape}
-</td>
-<td>
- {if isset($gContent->mInfo.$source[xref].xref) && $gContent->mInfo.$source[xref].xref <> '' && $gContent->mInfo.$source[xref].xref > 100 }
- {$gContent->mInfo.$source[xref].xref|escape}
- {smartlink ititle="Link to" ifile="display_contact.php" biticon="edit" content_id=$gContent->mInfo.$source[xref].xref}
- {else}
- &nbsp;
- {/if}
-</td>
-<td>
- {$gContent->mInfo.$source[xref].xkey|escape} {$gContent->mInfo.$source[xref].xkey_ext|escape}
-</td>
-<td>
- {$gContent->mInfo.$source[xref].data|escape}
-</td>
-{if $xrefAllowEdit}
-<td>
-{if $source ne 'history' }
- {$gContent->mInfo.$source[xref].start_date|bit_short_date}
-{else}
- {$gContent->mInfo.$source[xref].end_date|bit_short_date}
-{/if}
-</td>
-{if $gBitSystem->isFeatureActive( 'contact_list_last_modified' )}
- <td>
- {$gContent->mInfo.xref[xref].last_update_date|bit_long_date}
- </td>
-{/if}
-<td>
- <span class="actionicon">
- {if $gBitUser->hasPermission( 'p_contact_update' ) && $source ne 'history' }
- {if $gContent->mInfo.$source[xref].item eq 'KEY_B' }
- {smartlink ititle="Callout" ifile="edit_key_break.php" biticon="edit-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" biticon="edit-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" biticon="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].item ne 'KEY_B' }
- {if $source eq 'history' }
- {smartlink ititle="Restore" ifile="edit_xref.php" biticon="edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id expunge=-1}
- {else}
- {smartlink ititle="Delete" ifile="edit_xref.php" biticon="user-trash" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id expunge=1}
- {/if}
- {/if}
- </span>
-</td>
-{/if}
-{/strip}