summaryrefslogtreecommitdiff
path: root/edit_xref.php
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-05-25 16:56:05 +0100
committerLester Caine <lester@lsces.co.uk>2026-05-25 16:56:05 +0100
commit98a222ddbaa5ca0dc7d914d4912af8055d46dbc4 (patch)
treeb90036736e0c371dfddc452074ebaa71a8b7182f /edit_xref.php
parentc35e539cf4777eead5500d3229c4a84669db8c5e (diff)
downloadliberty-98a222ddbaa5ca0dc7d914d4912af8055d46dbc4.tar.gz
liberty-98a222ddbaa5ca0dc7d914d4912af8055d46dbc4.tar.bz2
liberty-98a222ddbaa5ca0dc7d914d4912af8055d46dbc4.zip
Add generic xref record templates and sub-template rendering to liberty
list_xref.tpl now uses 7-column layout (Type/Link/Key/Value/Date/Updated/ Edit) and delegates row rendering to view_xref_{template}_record.tpl, matching the template name stored in liberty_xref_source. Eight generic record templates added (text, contact, phone, address, date, bank, sig, locate) using hasUpdatePermission()/hasExpungePermission() throughout. edit_xref.php gains expunge/stepXref handling for Delete and Restore actions, with permission checks scoped per action branch. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'edit_xref.php')
-rw-r--r--edit_xref.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/edit_xref.php b/edit_xref.php
index 323b4db..2c14384 100644
--- a/edit_xref.php
+++ b/edit_xref.php
@@ -24,21 +24,28 @@ if( !empty( $_REQUEST['xref_id'] ) ) {
$gContent->loadXref( $_REQUEST['xref_id'] );
}
-$gContent->verifyUpdatePermission();
-
if( !empty( $_REQUEST['fCancel'] ) ) {
header( 'Location: '.$gContent->getDisplayUrl() );
die;
}
if( !empty( $_REQUEST['fSaveXref'] ) ) {
+ $gContent->verifyUpdatePermission();
if( $gContent->storeXref( $_REQUEST ) ) {
header( 'Location: '.$gContent->getDisplayUrl() );
die;
}
$xrefInfo = $_REQUEST;
$xrefInfo['data'] = $_REQUEST['edit'] ?? '';
+} elseif( isset( $_REQUEST['expunge'] ) ) {
+ $gContent->verifyExpungePermission();
+ if( $gContent->stepXref( $_REQUEST ) ) {
+ header( 'Location: '.$gContent->getDisplayUrl() );
+ die;
+ }
+ $xrefInfo = $gContent->mInfo['xref_store']['data'] ?? [];
} else {
+ $gContent->verifyUpdatePermission();
$xrefInfo = $gContent->mInfo['xref_store']['data'] ?? [];
}