summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-05-27 20:20:11 +0100
committerLester Caine <lester@lsces.co.uk>2026-05-27 20:20:11 +0100
commit2fb898ce714e282f5dfca365fe52abc15437f7ef (patch)
treef585ca09e684eea5d8f05c09b739c2074860e1e6 /templates
parent2a1242bff74c3aa12953a6496004188edc61033a (diff)
downloadliberty-2fb898ce714e282f5dfca365fe52abc15437f7ef.tar.gz
liberty-2fb898ce714e282f5dfca365fe52abc15437f7ef.tar.bz2
liberty-2fb898ce714e282f5dfca365fe52abc15437f7ef.zip
Allow xref tabs to suppress edit/delete buttons via allow_edit=false
list_xref.tpl: accept allow_edit param; assign $xrefAllowEdit for record templates; hide Edit column header when allow_edit is false. view_xref_*_record.tpl (8 files): gate hasUpdatePermission and hasExpungePermission checks on $xrefAllowEdit|default:true so callers can render xref data read-only without altering user permissions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'templates')
-rw-r--r--templates/list_xref.tpl3
-rw-r--r--templates/view_xref_address_record.tpl4
-rw-r--r--templates/view_xref_bank_record.tpl4
-rw-r--r--templates/view_xref_contact_record.tpl4
-rw-r--r--templates/view_xref_date_record.tpl4
-rw-r--r--templates/view_xref_locate_record.tpl4
-rw-r--r--templates/view_xref_phone_record.tpl4
-rw-r--r--templates/view_xref_sig_record.tpl4
-rw-r--r--templates/view_xref_text_record.tpl4
9 files changed, 18 insertions, 17 deletions
diff --git a/templates/list_xref.tpl b/templates/list_xref.tpl
index e1a6bbc..9ac5a3e 100644
--- a/templates/list_xref.tpl
+++ b/templates/list_xref.tpl
@@ -1,4 +1,5 @@
{assign var=xrefcnt value=$gContent->mInfo.$source|default:[]|@count}
+ {assign var=xrefAllowEdit value=$allow_edit|default:true}
{jstab title="$source_title ($xrefcnt)"}
{legend legend=$source_title}
<div class="form-group table-responsive">
@@ -15,7 +16,7 @@
<th>{tr}Ended{/tr}</th>
{/if}
<th>{tr}Updated{/tr}</th>
- <th>{tr}Edit{/tr}</th>
+ {if $xrefAllowEdit}<th>{tr}Edit{/tr}</th>{/if}
</tr>
</thead>
<tbody>
diff --git a/templates/view_xref_address_record.tpl b/templates/view_xref_address_record.tpl
index d7efba4..21af596 100644
--- a/templates/view_xref_address_record.tpl
+++ b/templates/view_xref_address_record.tpl
@@ -13,10 +13,10 @@
<td>{$gContent->mInfo.$source[xref].last_update_date|bit_short_date}</td>
<td>
<span class="actionicon">
- {if $gContent->hasUpdatePermission() && $source ne 'history'}
+ {if $xrefAllowEdit|default:true && $gContent->hasUpdatePermission() && $source ne 'history'}
{smartlink ititle="Edit" ipackage="liberty" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
{/if}
- {if $gContent->hasExpungePermission()}
+ {if $xrefAllowEdit|default:true && $gContent->hasExpungePermission()}
{if $source eq 'history'}
{smartlink ititle="Restore" ipackage="liberty" 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_bank_record.tpl b/templates/view_xref_bank_record.tpl
index edea55a..099ce6b 100644
--- a/templates/view_xref_bank_record.tpl
+++ b/templates/view_xref_bank_record.tpl
@@ -13,10 +13,10 @@
<td>{$gContent->mInfo.$source[xref].last_update_date|bit_short_date}</td>
<td>
<span class="actionicon">
- {if $gContent->hasUpdatePermission() && $source ne 'history'}
+ {if $xrefAllowEdit|default:true && $gContent->hasUpdatePermission() && $source ne 'history'}
{smartlink ititle="Edit" ipackage="liberty" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
{/if}
- {if $gContent->hasExpungePermission()}
+ {if $xrefAllowEdit|default:true && $gContent->hasExpungePermission()}
{if $source eq 'history'}
{smartlink ititle="Restore" ipackage="liberty" 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 ec14270..c89a8ae 100644
--- a/templates/view_xref_contact_record.tpl
+++ b/templates/view_xref_contact_record.tpl
@@ -19,10 +19,10 @@
<td>{$gContent->mInfo.$source[xref].last_update_date|bit_short_date}</td>
<td>
<span class="actionicon">
- {if $gContent->hasUpdatePermission() && $source ne 'history'}
+ {if $xrefAllowEdit|default:true && $gContent->hasUpdatePermission() && $source ne 'history'}
{smartlink ititle="Edit" ipackage="liberty" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
{/if}
- {if $gContent->hasExpungePermission()}
+ {if $xrefAllowEdit|default:true && $gContent->hasExpungePermission()}
{if $source eq 'history'}
{smartlink ititle="Restore" ipackage="liberty" 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_date_record.tpl b/templates/view_xref_date_record.tpl
index edea55a..099ce6b 100644
--- a/templates/view_xref_date_record.tpl
+++ b/templates/view_xref_date_record.tpl
@@ -13,10 +13,10 @@
<td>{$gContent->mInfo.$source[xref].last_update_date|bit_short_date}</td>
<td>
<span class="actionicon">
- {if $gContent->hasUpdatePermission() && $source ne 'history'}
+ {if $xrefAllowEdit|default:true && $gContent->hasUpdatePermission() && $source ne 'history'}
{smartlink ititle="Edit" ipackage="liberty" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
{/if}
- {if $gContent->hasExpungePermission()}
+ {if $xrefAllowEdit|default:true && $gContent->hasExpungePermission()}
{if $source eq 'history'}
{smartlink ititle="Restore" ipackage="liberty" 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_locate_record.tpl b/templates/view_xref_locate_record.tpl
index edea55a..099ce6b 100644
--- a/templates/view_xref_locate_record.tpl
+++ b/templates/view_xref_locate_record.tpl
@@ -13,10 +13,10 @@
<td>{$gContent->mInfo.$source[xref].last_update_date|bit_short_date}</td>
<td>
<span class="actionicon">
- {if $gContent->hasUpdatePermission() && $source ne 'history'}
+ {if $xrefAllowEdit|default:true && $gContent->hasUpdatePermission() && $source ne 'history'}
{smartlink ititle="Edit" ipackage="liberty" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
{/if}
- {if $gContent->hasExpungePermission()}
+ {if $xrefAllowEdit|default:true && $gContent->hasExpungePermission()}
{if $source eq 'history'}
{smartlink ititle="Restore" ipackage="liberty" 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_phone_record.tpl b/templates/view_xref_phone_record.tpl
index 8fe0d1a..5c95005 100644
--- a/templates/view_xref_phone_record.tpl
+++ b/templates/view_xref_phone_record.tpl
@@ -13,10 +13,10 @@
<td>{$gContent->mInfo.$source[xref].last_update_date|bit_short_date}</td>
<td>
<span class="actionicon">
- {if $gContent->hasUpdatePermission() && $source ne 'history'}
+ {if $xrefAllowEdit|default:true && $gContent->hasUpdatePermission() && $source ne 'history'}
{smartlink ititle="Edit" ipackage="liberty" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
{/if}
- {if $gContent->hasExpungePermission()}
+ {if $xrefAllowEdit|default:true && $gContent->hasExpungePermission()}
{if $source eq 'history'}
{smartlink ititle="Restore" ipackage="liberty" 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_sig_record.tpl b/templates/view_xref_sig_record.tpl
index edea55a..099ce6b 100644
--- a/templates/view_xref_sig_record.tpl
+++ b/templates/view_xref_sig_record.tpl
@@ -13,10 +13,10 @@
<td>{$gContent->mInfo.$source[xref].last_update_date|bit_short_date}</td>
<td>
<span class="actionicon">
- {if $gContent->hasUpdatePermission() && $source ne 'history'}
+ {if $xrefAllowEdit|default:true && $gContent->hasUpdatePermission() && $source ne 'history'}
{smartlink ititle="Edit" ipackage="liberty" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
{/if}
- {if $gContent->hasExpungePermission()}
+ {if $xrefAllowEdit|default:true && $gContent->hasExpungePermission()}
{if $source eq 'history'}
{smartlink ititle="Restore" ipackage="liberty" 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 ec14270..c89a8ae 100644
--- a/templates/view_xref_text_record.tpl
+++ b/templates/view_xref_text_record.tpl
@@ -19,10 +19,10 @@
<td>{$gContent->mInfo.$source[xref].last_update_date|bit_short_date}</td>
<td>
<span class="actionicon">
- {if $gContent->hasUpdatePermission() && $source ne 'history'}
+ {if $xrefAllowEdit|default:true && $gContent->hasUpdatePermission() && $source ne 'history'}
{smartlink ititle="Edit" ipackage="liberty" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
{/if}
- {if $gContent->hasExpungePermission()}
+ {if $xrefAllowEdit|default:true && $gContent->hasExpungePermission()}
{if $source eq 'history'}
{smartlink ititle="Restore" ipackage="liberty" 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}