From 2efbb78b7ceff6c369c2bee68c2a09270ce0fcde Mon Sep 17 00:00:00 2001 From: Lester Caine Date: Sat, 6 Jun 2026 11:22:49 +0100 Subject: edit.php: add expunge=1 handler; contact_date_bar: use edit.php?expunge=1 Replaces broken remove_contact.php link with edit.php?expunge=1 pattern, consistent with other edit pages. Co-Authored-By: Claude Sonnet 4.6 --- edit.php | 6 +++++- templates/contact_date_bar.tpl | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/edit.php b/edit.php index 1320f5f..6bea6aa 100755 --- a/edit.php +++ b/edit.php @@ -49,7 +49,11 @@ if (isset( $_REQUEST["preview"] )) { } // Pro -if (isset($_REQUEST["fCancel"])) { +if( !empty( $_REQUEST['expunge'] ) && $gContent->isValid() ) { + $gBitSystem->verifyPermission( 'p_contact_expunge' ); + $gContent->expunge(); + KernelTools::bit_redirect( CONTACT_PKG_URL . 'list_contacts.php' ); +} elseif (isset($_REQUEST["fCancel"])) { if( !empty( $gContent->mContentId ) ) { KernelTools::bit_redirect( $gContent->getDisplayUrl() ); } else { diff --git a/templates/contact_date_bar.tpl b/templates/contact_date_bar.tpl index d8caca6..2fe464a 100755 --- a/templates/contact_date_bar.tpl +++ b/templates/contact_date_bar.tpl @@ -10,7 +10,7 @@ {/if} {biticon ipackage="icons" iname="document-print" iexplain="print"} {if $gBitUser->hasPermission('p_contact_expunge')} - {biticon ipackage="icons" iname="user-trash" iexplain="delete"} + {smartlink ititle="Delete Contact" ifile="edit.php" biticon="user-trash" content_id=$gContent->mInfo.content_id expunge=1} {/if} {/if} {* end print_page *} {*end .floaticon *} -- cgit v1.3