From a6d77d28625efe86fe16228cbfdce49d6a5bf6e2 Mon Sep 17 00:00:00 2001 From: Lester Caine Date: Sun, 31 May 2026 19:45:29 +0100 Subject: Add add_person/add_business flows; tidy contact view/edit for type - add_person.php + add_person.tpl: minimal form, auto-injects $00 - add_business.php + add_business.tpl: org name + $02+ type checkboxes - menu_contact.tpl: replace generic edit link with Add Person / Add Business - Contact.php: fix title overwrite (org no longer clobbers person name); fix null trim on organisation; fix $00 type xref stored correctly - edit.php: isPerson flag; xref groups loaded; type list filtered $02+ for businesses - edit.tpl: person/business field visibility; tabbed xref block at bottom of Details tab - edit_type_header.tpl: value fixed to {$type.item}; $00/$01 filtered out - display_contact.tpl: person/business field selection; note above addresses; no-addresses fallback removed; allow_edit=false on xref tabs - display_type_header.tpl: heading Personal/Business Contact; $02+ types only - contact_date_bar.tpl: remove Add crossref shortcut (now in edit tabs) - view_xref_*_item.tpl: dates and edit actions gated on $xrefAllowEdit Co-Authored-By: Claude Sonnet 4.6 --- add_person.php | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 add_person.php (limited to 'add_person.php') diff --git a/add_person.php b/add_person.php new file mode 100644 index 0000000..eda69c7 --- /dev/null +++ b/add_person.php @@ -0,0 +1,35 @@ +verifyPackage( 'contact' ); +$gBitSystem->verifyPermission( 'p_contact_update' ); + +$gContent = new Contact(); + +if( !empty( $_REQUEST['fCancel'] ) ) { + KernelTools::bit_redirect( CONTACT_PKG_URL ); + die; +} + +if( !empty( $_REQUEST['fSaveContact'] ) ) { + $_REQUEST['contact_types'] = [ '$00' ]; + if( $gContent->store( $_REQUEST ) ) { + KernelTools::bit_redirect( CONTACT_PKG_URL.'edit.php?content_id='.$gContent->mContentId ); + die; + } +} + +$gBitSmarty->assign( 'gContent', $gContent ); +$gBitSmarty->assign( 'errors', $gContent->mErrors ); + +$gBitSystem->display( 'bitpackage:contact/add_person.tpl', KernelTools::tra( 'Add Person' ), [ 'display_mode' => 'edit' ] ); -- cgit v1.3