From eaa8de0f28f296e889593bc2221d29917aa15712 Mon Sep 17 00:00:00 2001 From: Lester Caine Date: Thu, 11 Jun 2026 10:44:41 +0100 Subject: stock: remove orphaned add_xref/edit_xref files — all links already use liberty package versions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- add_xref.php | 50 --------------------------------------------- edit_xref.php | 54 ------------------------------------------------- templates/add_xref.tpl | 44 ---------------------------------------- templates/edit_xref.tpl | 45 ----------------------------------------- 4 files changed, 193 deletions(-) delete mode 100644 add_xref.php delete mode 100644 edit_xref.php delete mode 100644 templates/add_xref.tpl delete mode 100644 templates/edit_xref.tpl diff --git a/add_xref.php b/add_xref.php deleted file mode 100644 index a42b41c..0000000 --- a/add_xref.php +++ /dev/null @@ -1,50 +0,0 @@ -verifyPackage( 'stock' ); -$gBitSystem->verifyPermission( 'p_stock_update' ); - -if( empty( $_REQUEST['content_id'] ) || !is_numeric( $_REQUEST['content_id'] ) ) { - $gBitSystem->fatalError( 'No content ID specified.' ); -} - -$gContent = LibertyContent::getLibertyObject( (int)$_REQUEST['content_id'] ); - -if( !$gContent || !$gContent->isValid() ) { - $gBitSystem->fatalError( 'Content not found.' ); -} - -$gContent->verifyUpdatePermission(); - -if( !empty( $_REQUEST['fCancel'] ) ) { - header( 'Location: '.$gContent->getDisplayUrl() ); - die; -} - -if( !empty( $_REQUEST['fAddXref'] ) ) { - if( $gContent->storeXref( $_REQUEST ) ) { - header( 'Location: '.$gContent->getDisplayUrl() ); - die; - } -} - -$xref_type = (int)( $_REQUEST['xref_type'] ?? 1 ); -$xrefTypeList = $gContent->getXrefTypeList( $xref_type ); - -$gBitSmarty->assign( 'gContent', $gContent ); -$gBitSmarty->assign( 'xref_type', $xref_type ); -$gBitSmarty->assign( 'xrefTypeList', $xrefTypeList ); -$gBitSmarty->assign( 'errors', $gContent->mErrors ); - -$gBitSystem->display( 'bitpackage:stock/add_xref.tpl', 'Add Detail', [ 'display_mode' => 'edit' ] ); diff --git a/edit_xref.php b/edit_xref.php deleted file mode 100644 index edbd84f..0000000 --- a/edit_xref.php +++ /dev/null @@ -1,54 +0,0 @@ -verifyPackage( 'stock' ); -$gBitSystem->verifyPermission( 'p_stock_update' ); - -if( empty( $_REQUEST['content_id'] ) || !is_numeric( $_REQUEST['content_id'] ) ) { - $gBitSystem->fatalError( 'No content ID specified.' ); -} - -$gContent = LibertyContent::getLibertyObject( (int)$_REQUEST['content_id'] ); - -if( !$gContent || !$gContent->isValid() ) { - $gBitSystem->fatalError( 'Content not found.' ); -} - -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'] ) ) { - if( $gContent->storeXref( $_REQUEST ) ) { - header( 'Location: '.$gContent->getDisplayUrl() ); - die; - } - $xrefInfo = $_REQUEST; - $xrefInfo['data'] = $_REQUEST['edit'] ?? ''; -} else { - $xrefInfo = $gContent->mInfo['xref_store']['data'] ?? []; -} - -$gBitSmarty->assign( 'gContent', $gContent ); -$gBitSmarty->assign( 'xrefInfo', $xrefInfo ); -$gBitSmarty->assign( 'errors', $gContent->mErrors ); - -$gBitSystem->display( 'bitpackage:stock/edit_xref.tpl', 'Edit Detail', [ 'display_mode' => 'edit' ] ); diff --git a/templates/add_xref.tpl b/templates/add_xref.tpl deleted file mode 100644 index 63166cb..0000000 --- a/templates/add_xref.tpl +++ /dev/null @@ -1,44 +0,0 @@ -{strip} -
-
-

{tr}Add Detail{/tr}: {$gContent->getTitle()|escape}

-
- -
- {formfeedback error=$errors} - - {form id="addStockXrefForm"} - - - -
- {formlabel label="Type" for="item"} - {forminput} - {html_options name="item" id="item" options=$xrefTypeList.list} - {/forminput} -
- -
- {formlabel label="Value" for="edit"} - {forminput} - - {formhelp note="Enter the value for this detail record."} - {/forminput} -
- -
- {formlabel label="Linked Content ID" for="xref"} - {forminput} - - {formhelp note="For supplier links: enter the contact content_id. Leave blank for all other types."} - {/forminput} -
- -
- - -
- {/form} -
-
-{/strip} diff --git a/templates/edit_xref.tpl b/templates/edit_xref.tpl deleted file mode 100644 index 35ac2ff..0000000 --- a/templates/edit_xref.tpl +++ /dev/null @@ -1,45 +0,0 @@ -{strip} -
-
-

{tr}Edit Detail{/tr}: {$gContent->getTitle()|escape}

-
- -
- {formfeedback error=$errors} - - {form id="editStockXrefForm"} - - - - -
- {formlabel label="Type"} - {forminput} -

{$xrefInfo.template_title|escape}

- {/forminput} -
- -
- {formlabel label="Value" for="edit"} - {forminput} - - {formhelp note="Enter the value for this detail record."} - {/forminput} -
- -
- {formlabel label="Linked Content ID" for="xref"} - {forminput} - - {formhelp note="For supplier links: enter the contact content_id. Leave blank for all other types."} - {/forminput} -
- -
- - -
- {/form} -
-
-{/strip} -- cgit v1.3