summaryrefslogtreecommitdiff
path: root/add_person.php
diff options
context:
space:
mode:
authorLester Caine <lester@lsces.co.uk>2026-06-11 19:26:25 +0100
committerLester Caine <lester@lsces.co.uk>2026-06-11 19:26:25 +0100
commit64aae1e41d9288a6d9709781af29b06fe6adb5ca (patch)
treed5d5e74420cee938d7e8ff90b9e6792d5f44cc77 /add_person.php
parent27c615a0a26edb985543e520587e3043d91489f6 (diff)
downloadcontact-64aae1e41d9288a6d9709781af29b06fe6adb5ca.tar.gz
contact-64aae1e41d9288a6d9709781af29b06fe6adb5ca.tar.bz2
contact-64aae1e41d9288a6d9709781af29b06fe6adb5ca.zip
Introduce ContactPerson and ContactBusiness subclasses
Splits the Contact class into ContactPerson (content_type_guid='contactperson') and ContactBusiness (content_type_guid='contactbusiness'), each using 'contact' as the shared package-level xref schema. Replaces the $isPerson/$00 xref hack with proper class identity via instanceof. - ContactPerson.php, ContactBusiness.php: new subclasses - Contact.php: loadXrefTypeList() reads type tags directly from liberty_xref; getAvailableTypeItems() for edit form (schema-driven with pre-upgrade fallback); getDisplayUrl() now points to display_contact.php - Type item codes: P01/P02 (person), B01-B04 (business, B01=Service new) - list_people.php, list_businesses.php: separate list pages per type - list_contacts.php: combined display-layer merge of both types - 5.0.3.php: upgrade script migrating existing data to new content types and codes - Templates: isPerson flag from instanceof; horizontal type checkboxes; list.tpl accepts $listTitle; menu adds People/Businesses entries Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'add_person.php')
-rw-r--r--add_person.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/add_person.php b/add_person.php
index eda69c7..68e3599 100644
--- a/add_person.php
+++ b/add_person.php
@@ -4,7 +4,7 @@
* @subpackage functions
*/
-use Bitweaver\Contact\Contact;
+use Bitweaver\Contact\ContactPerson;
use Bitweaver\KernelTools;
require_once '../kernel/includes/setup_inc.php';
@@ -14,7 +14,7 @@ global $gBitSystem, $gBitSmarty, $gBitUser;
$gBitSystem->verifyPackage( 'contact' );
$gBitSystem->verifyPermission( 'p_contact_update' );
-$gContent = new Contact();
+$gContent = new ContactPerson();
if( !empty( $_REQUEST['fCancel'] ) ) {
KernelTools::bit_redirect( CONTACT_PKG_URL );
@@ -22,7 +22,7 @@ if( !empty( $_REQUEST['fCancel'] ) ) {
}
if( !empty( $_REQUEST['fSaveContact'] ) ) {
- $_REQUEST['contact_types'] = [ '$00' ];
+ $_REQUEST['contact_types'] = [ 'P01' ];
if( $gContent->store( $_REQUEST ) ) {
KernelTools::bit_redirect( CONTACT_PKG_URL.'edit.php?content_id='.$gContent->mContentId );
die;