diff options
| author | lsces <lester@lsces.co.uk> | 2025-08-24 15:35:09 +0100 |
|---|---|---|
| committer | lsces <lester@lsces.co.uk> | 2025-08-24 15:35:09 +0100 |
| commit | ce4fa87baac56fe2478cfea56b539cba63887467 (patch) | |
| tree | 6d5f6a74d4d80fcc11b12ce2fa86715e1bff9b88 /import | |
| parent | 69b08377a8a2d3791b21d96720657d93beda2af0 (diff) | |
| download | contact-ce4fa87baac56fe2478cfea56b539cba63887467.tar.gz contact-ce4fa87baac56fe2478cfea56b539cba63887467.tar.bz2 contact-ce4fa87baac56fe2478cfea56b539cba63887467.zip | |
Just a crude merging of the PHP7 code base with the PHP8.4 version
Diffstat (limited to 'import')
| -rwxr-xr-x[-rw-r--r--] | import/ContactOld.php | 6 | ||||
| -rwxr-xr-x[-rw-r--r--] | import/ImportContact.php | 0 | ||||
| -rwxr-xr-x | import/ImportContact2.php | 86 | ||||
| -rwxr-xr-x[-rw-r--r--] | import/ImportPhx.php | 0 | ||||
| -rwxr-xr-x[-rw-r--r--] | import/ImportPhx2.php | 0 | ||||
| -rwxr-xr-x[-rw-r--r--] | import/ImportSage.php | 0 | ||||
| -rwxr-xr-x[-rw-r--r--] | import/ImportWande.php | 0 | ||||
| -rwxr-xr-x[-rw-r--r--] | import/Mbox.php | 0 | ||||
| -rwxr-xr-x[-rw-r--r--] | import/load_contacts.php | 8 | ||||
| -rwxr-xr-x[-rw-r--r--] | import/load_phx_contacts.php | 8 | ||||
| -rwxr-xr-x[-rw-r--r--] | import/load_phx_xref.sql | 0 | ||||
| -rwxr-xr-x[-rw-r--r--] | import/load_sage_contacts.php | 8 | ||||
| -rwxr-xr-x[-rw-r--r--] | import/load_wande_contacts.php | 5 | ||||
| -rwxr-xr-x[-rw-r--r--] | import/mime.php | 0 | ||||
| -rwxr-xr-x[-rw-r--r--] | import/modify.php | 0 | ||||
| -rwxr-xr-x | import/phail.php | 2 | ||||
| -rwxr-xr-x[-rw-r--r--] | import/read.php | 0 | ||||
| -rwxr-xr-x[-rw-r--r--] | import/schema_import_inc.php | 0 |
18 files changed, 103 insertions, 20 deletions
diff --git a/import/ContactOld.php b/import/ContactOld.php index e22384c..63941c5 100644..100755 --- a/import/ContactOld.php +++ b/import/ContactOld.php @@ -12,8 +12,8 @@ /** * required setup */ -require_once( LIBERTY_PKG_PATH.'LibertyContent.php' ); // Contact base class -require_once( NLPG_PKG_PATH.'lib/phpcoord-2.3.php' ); +use Bitweaver\Liberty\LibertyBase; // Contact base class +require_once CONTACT_PKG_PATH . 'lib/phpcoord-2.3.php'; define( 'CONTACT_CONTENT_TYPE_GUID', 'contact' ); @@ -247,8 +247,6 @@ class Contact extends LibertyBase { * Returns list of contract entries * * @param integer - * @param integer - * @param integer * @return string Text for the title description */ function getList( &$pListHash ) { diff --git a/import/ImportContact.php b/import/ImportContact.php index ebef181..ebef181 100644..100755 --- a/import/ImportContact.php +++ b/import/ImportContact.php diff --git a/import/ImportContact2.php b/import/ImportContact2.php new file mode 100755 index 0000000..d5d4801 --- /dev/null +++ b/import/ImportContact2.php @@ -0,0 +1,86 @@ +<?php +/** + * @version $Header:$ + * + * Copyright ( c ) 2006 bitweaver.org + * All Rights Reserved. See below for details and a complete list of authors. + * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details + * + * @package contact + */ + + /** + * ContactRecordLoad( $data ); + * Uncomment to enable + */ + function ContactRecordLoad( &$data ) { + $table = BIT_DB_PREFIX."contact"; +// $atable = BIT_DB_PREFIX."contact_address"; + +/** + * $data[0] - Name + * $data[1] - Address House + * $data[2] - POSTCODE + * $data[3] - Property Phone + */ + $pDataHash['title'] = $data[0]; + $pDataHash['address_store']['house'] = $data[1]; + $pDataHash['address_store']['postcode'] = $data[2]; + $pDataHash['property_store']['telephone'] = $data[3]; + + $this->mDb->StartTrans(); + $this->mContentId = 0; + $pDataHash['content_id'] = 0; + if ( LibertyContent::store( $pDataHash ) ) { + $pDataHash['contact_store']['content_id'] = $pDataHash['content_id']; + + $result = $this->mDb->associateInsert( $table, $pDataHash['contact_store'] ); + $this->mDb->CompleteTrans(); + } else { + $this->mDb->RollbackTrans(); + $this->mErrors['store'] = 'Failed to store this contact.'; + } + $Xref = new ContactXref(); + $pParams = array( 'source' => '#S', + 'content_id' => $pDataHash['content_id'], + 'xkey' => $data[2], + 'xorder' => '0', + 'xkey_ext' => $data[1] ); + $Xref->store($pParams); + $pParams = array( 'source' => '#P', + 'content_id' => $pDataHash['content_id'], + 'xkey' => '', + 'xorder' => '0', + 'xkey_ext' => 'External patrol of property. No keys. See site list in photos. Phone Ideal Alarms once completed.' ); + $Xref->store($pParams); + $pParams = array( 'source' => '#P', + 'content_id' => $pDataHash['content_id'], + 'xkey' => '08007 076595', + 'xorder' => '1', + 'xkey_ext' => NULL ); + $Xref->store($pParams); + $pParams = array( 'source' => '#P', + 'content_id' => $pDataHash['content_id'], + 'xkey' => $data[1], + 'xorder' => '2', + 'xkey_ext' => 'Property number' ); + $Xref->store($pParams); + + return( count( $this->mErrors ) == 0 ); + } + + /** + * Delete contact object and all related records + */ + function ContactDataExpunge() + { + $ret = FALSE; + $query = "DELETE FROM `".BIT_DB_PREFIX."contact`"; + $result = $this->mDb->query( $query ); +// $query = "DELETE FROM `".BIT_DB_PREFIX."contact_address`"; +// $result = $this->mDb->query( $query ); + $query = "DELETE FROM `".BIT_DB_PREFIX."contact_xref`"; + $result = $this->mDb->query( $query ); + return $ret; + } +?> diff --git a/import/ImportPhx.php b/import/ImportPhx.php index cb92cca..cb92cca 100644..100755 --- a/import/ImportPhx.php +++ b/import/ImportPhx.php diff --git a/import/ImportPhx2.php b/import/ImportPhx2.php index f2cded2..f2cded2 100644..100755 --- a/import/ImportPhx2.php +++ b/import/ImportPhx2.php diff --git a/import/ImportSage.php b/import/ImportSage.php index d24afe8..d24afe8 100644..100755 --- a/import/ImportSage.php +++ b/import/ImportSage.php diff --git a/import/ImportWande.php b/import/ImportWande.php index 79fbad5..79fbad5 100644..100755 --- a/import/ImportWande.php +++ b/import/ImportWande.php diff --git a/import/Mbox.php b/import/Mbox.php index 52daec1..52daec1 100644..100755 --- a/import/Mbox.php +++ b/import/Mbox.php diff --git a/import/load_contacts.php b/import/load_contacts.php index 20f90c6..23a3a38 100644..100755 --- a/import/load_contacts.php +++ b/import/load_contacts.php @@ -7,8 +7,9 @@ */ // Initialization -require_once( '../../kernel/setup_inc.php' ); -require_once(CONTACT_PKG_PATH.'Contact.php' ); +require_once '../../kernel/includes/setup_inc.php'; +use Bitweaver\Contact\Contact; +use Bitweaver\KernelTools; // Is package installed and enabled $gBitSystem->verifyPackage( 'contact' ); @@ -35,5 +36,4 @@ if ( $handle == FALSE) { $gBitSmarty->assign( 'golden', $row ); -$gBitSystem->display( 'bitpackage:contacts/load_contacts.tpl', tra( 'Load results: ' ) ); -?> +$gBitSystem->display( 'bitpackage:contacts/load_contacts.tpl', KernelTools::tra( 'Load results: ' ) ); diff --git a/import/load_phx_contacts.php b/import/load_phx_contacts.php index f719b0b..264e872 100644..100755 --- a/import/load_phx_contacts.php +++ b/import/load_phx_contacts.php @@ -7,8 +7,9 @@ */ // Initialization -require_once( '../../kernel/setup_inc.php' ); -require_once(CONTACT_PKG_PATH.'Contact.php' ); +require_once '../../kernel/includes/setup_inc.php'; +use Bitweaver\Contact\Contact; +use Bitweaver\KernelTools; // Is package installed and enabled $gBitSystem->verifyPackage( 'contact' ); @@ -35,5 +36,4 @@ if ( $handle == FALSE) { $gBitSmarty->assign( 'count', $row ); -$gBitSystem->display( 'bitpackage:contact/load_contacts.tpl', tra( 'Load results: ' ) ); -?> +$gBitSystem->display( 'bitpackage:contact/load_contacts.tpl', KernelTools::tra( 'Load results: ' ) ); diff --git a/import/load_phx_xref.sql b/import/load_phx_xref.sql index c8ea6c7..c8ea6c7 100644..100755 --- a/import/load_phx_xref.sql +++ b/import/load_phx_xref.sql diff --git a/import/load_sage_contacts.php b/import/load_sage_contacts.php index bbb8136..a3fd92a 100644..100755 --- a/import/load_sage_contacts.php +++ b/import/load_sage_contacts.php @@ -7,8 +7,9 @@ */ // Initialization -require_once( '../../kernel/setup_inc.php' ); -require_once(CONTACT_PKG_PATH.'Contact.php' ); +require_once '../../kernel/includes/setup_inc.php'; +use Bitweaver\Contact\Contact; +use Bitweaver\KernelTools; // Is package installed and enabled $gBitSystem->verifyPackage( 'contact' ); @@ -49,5 +50,4 @@ if ( $handle == FALSE) { $gBitSmarty->assign( 'suppliers', $row ); -$gBitSystem->display( 'bitpackage:contacts/load_sage_contacts.tpl', tra( 'Load results: ' ) ); -?> +$gBitSystem->display( 'bitpackage:contacts/load_sage_contacts.tpl', KernelTools::tra( 'Load results: ' ) ); diff --git a/import/load_wande_contacts.php b/import/load_wande_contacts.php index 5d9b8c0..c31070d 100644..100755 --- a/import/load_wande_contacts.php +++ b/import/load_wande_contacts.php @@ -7,8 +7,8 @@ */ // Initialization -require_once( '../../kernel/setup_inc.php' ); -require_once(CONTACT_PKG_PATH.'Contact.php' ); +require_once '../../kernel/includes/setup_inc.php'; +use Bitweaver\Contact\Contact; // Is package installed and enabled $gBitSystem->verifyPackage( 'contact' ); @@ -36,4 +36,3 @@ if ( $handle == FALSE) { $gBitSmarty->assign( 'count', $row ); $gBitSystem->display( 'bitpackage:contact/load_contacts.tpl', tra( 'Load results: ' ) ); -?> diff --git a/import/mime.php b/import/mime.php index adfe2ad..adfe2ad 100644..100755 --- a/import/mime.php +++ b/import/mime.php diff --git a/import/modify.php b/import/modify.php index 36b6e20..36b6e20 100644..100755 --- a/import/modify.php +++ b/import/modify.php diff --git a/import/phail.php b/import/phail.php index 16755bb..2148289 100755 --- a/import/phail.php +++ b/import/phail.php @@ -15,7 +15,7 @@ if (PEAR::isError($opts)) { } PEAR::setErrorHandling(PEAR_ERROR_DIE); -$mime = &new Mail_Mime; +$mime = new Mail_Mime; foreach ($opts[0] as $opt) { $param = $opt[1]; switch ($opt[0]) { diff --git a/import/read.php b/import/read.php index 9d573b1..9d573b1 100644..100755 --- a/import/read.php +++ b/import/read.php diff --git a/import/schema_import_inc.php b/import/schema_import_inc.php index fc898c1..fc898c1 100644..100755 --- a/import/schema_import_inc.php +++ b/import/schema_import_inc.php |
