summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlsces <lester@lsces.co.uk>2025-08-24 15:35:09 +0100
committerlsces <lester@lsces.co.uk>2025-08-24 15:35:09 +0100
commitce4fa87baac56fe2478cfea56b539cba63887467 (patch)
tree6d5f6a74d4d80fcc11b12ce2fa86715e1bff9b88
parent69b08377a8a2d3791b21d96720657d93beda2af0 (diff)
downloadcontact-ce4fa87baac56fe2478cfea56b539cba63887467.tar.gz
contact-ce4fa87baac56fe2478cfea56b539cba63887467.tar.bz2
contact-ce4fa87baac56fe2478cfea56b539cba63887467.zip
Just a crude merging of the PHP7 code base with the PHP8.4 version
-rwxr-xr-x[-rw-r--r--].hgignore0
-rwxr-xr-x[-rw-r--r--]README0
-rwxr-xr-x[-rw-r--r--]add_xref.php12
-rwxr-xr-x[-rw-r--r--]add_xref_address.php12
-rwxr-xr-x[-rw-r--r--]admin/admin_contact_inc.php46
-rwxr-xr-x[-rw-r--r--]admin/admin_contact_type.php11
-rwxr-xr-x[-rw-r--r--]admin/admin_xref_types.php14
-rwxr-xr-x[-rw-r--r--]admin/index.php0
-rwxr-xr-x[-rw-r--r--]admin/schema_inc.php137
-rw-r--r--bit_setup_inc.php17
-rwxr-xr-x[-rw-r--r--]data/README0
-rwxr-xr-xdata/cotswold_guard_cust.csv27
-rwxr-xr-xdata/customers.csv0
-rwxr-xr-xdata/suppliers.csv0
-rwxr-xr-x[-rw-r--r--]display_contact.php40
-rwxr-xr-x[-rw-r--r--]display_list_header.php3
-rwxr-xr-x[-rw-r--r--]edit.php37
-rwxr-xr-x[-rw-r--r--]edit_key_break.php17
-rwxr-xr-x[-rw-r--r--]edit_notes.php56
-rwxr-xr-x[-rw-r--r--]edit_xref.php13
-rwxr-xr-x[-rw-r--r--]edit_xref_type.php8
-rwxr-xr-xform.php45
-rwxr-xr-x[-rw-r--r--]icons/pkg_contact.pngbin2311 -> 2311 bytes
-rwxr-xr-x[-rw-r--r--]import/ContactOld.php6
-rwxr-xr-x[-rw-r--r--]import/ImportContact.php0
-rwxr-xr-ximport/ImportContact2.php86
-rwxr-xr-x[-rw-r--r--]import/ImportPhx.php0
-rwxr-xr-x[-rw-r--r--]import/ImportPhx2.php0
-rwxr-xr-x[-rw-r--r--]import/ImportSage.php0
-rwxr-xr-x[-rw-r--r--]import/ImportWande.php0
-rwxr-xr-x[-rw-r--r--]import/Mbox.php0
-rwxr-xr-x[-rw-r--r--]import/load_contacts.php8
-rwxr-xr-x[-rw-r--r--]import/load_phx_contacts.php8
-rwxr-xr-x[-rw-r--r--]import/load_phx_xref.sql0
-rwxr-xr-x[-rw-r--r--]import/load_sage_contacts.php8
-rwxr-xr-x[-rw-r--r--]import/load_wande_contacts.php5
-rwxr-xr-x[-rw-r--r--]import/mime.php0
-rwxr-xr-x[-rw-r--r--]import/modify.php0
-rwxr-xr-ximport/phail.php2
-rwxr-xr-x[-rw-r--r--]import/read.php0
-rwxr-xr-x[-rw-r--r--]import/schema_import_inc.php0
-rwxr-xr-xincludes/bit_setup_inc.php27
-rwxr-xr-x[-rw-r--r--]includes/classes/Contact.php (renamed from Contact.php)150
-rwxr-xr-x[-rw-r--r--]includes/classes/ContactType.php (renamed from ContactType.php)26
-rwxr-xr-x[-rw-r--r--]includes/classes/ContactXref.php (renamed from ContactXref.php)80
-rwxr-xr-x[-rw-r--r--]includes/classes/ContactXrefType.php (renamed from ContactXrefType.php)12
-rwxr-xr-x[-rw-r--r--]includes/lookup_contact_inc.php (renamed from lookup_contact_inc.php)11
-rwxr-xr-xincludes/lookup_contact_xref_type_inc.php25
-rwxr-xr-x[-rw-r--r--]index.php23
-rwxr-xr-xlib/phpcoord-2.3.php1335
-rwxr-xr-xlib/test-2.3.php197
-rwxr-xr-x[-rw-r--r--]list.php13
-rwxr-xr-x[-rw-r--r--]list1.php9
-rwxr-xr-xlist2.php55
-rwxr-xr-x[-rw-r--r--]list_contacts.php9
-rwxr-xr-x[-rw-r--r--]list_contracts.php9
-rwxr-xr-xload_contacts.php39
-rwxr-xr-x[-rw-r--r--]load_emails.php196
-rwxr-xr-xload_sage_contacts.php53
-rw-r--r--lookup_contact_xref_type_inc.php25
-rwxr-xr-x[-rw-r--r--]modules/index.php0
-rwxr-xr-xprocess.php57
-rwxr-xr-x[-rw-r--r--]templates/add_xref.tpl2
-rwxr-xr-x[-rw-r--r--]templates/add_xref_address.tpl0
-rwxr-xr-x[-rw-r--r--]templates/admin_contact.tpl0
-rwxr-xr-x[-rw-r--r--]templates/admin_contact_type.tpl0
-rwxr-xr-x[-rw-r--r--]templates/admin_xref_types.tpl0
-rwxr-xr-x[-rw-r--r--]templates/comments.tpl6
-rwxr-xr-x[-rw-r--r--]templates/comments_edit.tpl0
-rwxr-xr-x[-rw-r--r--]templates/comments_post_inc.tpl2
-rwxr-xr-x[-rw-r--r--]templates/contact.tpl0
-rwxr-xr-x[-rw-r--r--]templates/contact_action_bar.tpl0
-rwxr-xr-x[-rw-r--r--]templates/contact_date_bar.tpl10
-rwxr-xr-x[-rw-r--r--]templates/contact_display.tpl16
-rwxr-xr-x[-rw-r--r--]templates/contact_header.tpl18
-rwxr-xr-x[-rw-r--r--]templates/contact_options_inc.tpl2
-rwxr-xr-x[-rw-r--r--]templates/display_address.tpl28
-rwxr-xr-x[-rw-r--r--]templates/display_contact.tpl32
-rwxr-xr-x[-rw-r--r--]templates/display_list_header.tpl28
-rwxr-xr-x[-rw-r--r--]templates/display_list_header1.tpl0
-rwxr-xr-xtemplates/display_list_header2.tpl28
-rwxr-xr-x[-rw-r--r--]templates/display_type_header.tpl2
-rwxr-xr-x[-rw-r--r--]templates/edit.tpl34
-rwxr-xr-x[-rw-r--r--]templates/edit_contact.tpl28
-rwxr-xr-x[-rw-r--r--]templates/edit_key_break.tpl0
-rwxr-xr-x[-rw-r--r--]templates/edit_personal.tpl8
-rwxr-xr-x[-rw-r--r--]templates/edit_type_header.tpl6
-rwxr-xr-x[-rw-r--r--]templates/edit_xref.tpl0
-rwxr-xr-x[-rw-r--r--]templates/edit_xref_address.tpl0
-rwxr-xr-x[-rw-r--r--]templates/edit_xref_address_fields.tpl0
-rwxr-xr-x[-rw-r--r--]templates/edit_xref_contact.tpl0
-rwxr-xr-x[-rw-r--r--]templates/edit_xref_contact_fields.tpl0
-rwxr-xr-x[-rw-r--r--]templates/edit_xref_dates.tpl0
-rwxr-xr-x[-rw-r--r--]templates/edit_xref_generic_fields.tpl0
-rwxr-xr-xtemplates/edit_xref_image.tpl68
-rwxr-xr-xtemplates/edit_xref_inc_report.tpl72
-rwxr-xr-xtemplates/edit_xref_inc_report_fields.tpl10
-rwxr-xr-x[-rw-r--r--]templates/edit_xref_key_seal.tpl0
-rwxr-xr-x[-rw-r--r--]templates/edit_xref_key_seal_fields.tpl0
-rwxr-xr-x[-rw-r--r--]templates/edit_xref_locate.tpl0
-rwxr-xr-x[-rw-r--r--]templates/edit_xref_locate_fields.tpl0
-rwxr-xr-x[-rw-r--r--]templates/edit_xref_phone.tpl0
-rwxr-xr-x[-rw-r--r--]templates/edit_xref_phone_fields.tpl0
-rwxr-xr-xtemplates/edit_xref_sig.tpl72
-rwxr-xr-x[-rw-r--r--]templates/edit_xref_text.tpl0
-rwxr-xr-x[-rw-r--r--]templates/edit_xref_text_fields.tpl0
-rwxr-xr-x[-rw-r--r--]templates/edit_xref_type.tpl0
-rwxr-xr-x[-rw-r--r--]templates/edit_xref_value.tpl0
-rwxr-xr-x[-rw-r--r--]templates/edit_xref_value_fields.tpl0
-rwxr-xr-xtemplates/employment.tpl43
-rwxr-xr-xtemplates/employment1.tpl44
-rwxr-xr-xtemplates/employment2.tpl44
-rwxr-xr-xtemplates/employment_full.tpl390
-rwxr-xr-xtemplates/employment_old.tpl372
-rwxr-xr-xtemplates/form_DSInspection.tpl223
-rwxr-xr-xtemplates/incident.tpl41
-rwxr-xr-x[-rw-r--r--]templates/index.php0
-rwxr-xr-x[-rw-r--r--]templates/list.tpl60
-rwxr-xr-x[-rw-r--r--]templates/list1.tpl0
-rwxr-xr-xtemplates/list2.tpl91
-rwxr-xr-x[-rw-r--r--]templates/list_clients.tpl0
-rwxr-xr-x[-rw-r--r--]templates/list_contact.tpl4
-rwxr-xr-x[-rw-r--r--]templates/list_contact_type.tpl14
-rwxr-xr-x[-rw-r--r--]templates/list_contacts.tpl4
-rwxr-xr-x[-rw-r--r--]templates/list_contracts.tpl2
-rwxr-xr-x[-rw-r--r--]templates/list_ticket.tpl16
-rwxr-xr-x[-rw-r--r--]templates/list_xref.tpl28
-rwxr-xr-x[-rw-r--r--]templates/list_xref_generic.tpl66
-rwxr-xr-x[-rw-r--r--]templates/load_contacts.tpl0
-rwxr-xr-x[-rw-r--r--]templates/load_sage_contacts.tpl0
-rwxr-xr-x[-rw-r--r--]templates/menu_contact.tpl6
-rwxr-xr-x[-rw-r--r--]templates/menu_contact_admin.tpl0
-rwxr-xr-x[-rw-r--r--]templates/page_display.tpl16
-rwxr-xr-x[-rw-r--r--]templates/show_contact.tpl10
-rwxr-xr-x[-rw-r--r--]templates/show_contact_item.tpl0
-rwxr-xr-x[-rw-r--r--]templates/view_xref.tpl0
-rwxr-xr-x[-rw-r--r--]templates/view_xref_address.tpl0
-rwxr-xr-xtemplates/view_xref_address_record.tpl43
-rwxr-xr-xtemplates/view_xref_bank_record.tpl40
-rwxr-xr-x[-rw-r--r--]templates/view_xref_contact.tpl0
-rwxr-xr-xtemplates/view_xref_contact_record.tpl50
-rwxr-xr-xtemplates/view_xref_date_record.tpl40
-rwxr-xr-xtemplates/view_xref_image_record.tpl40
-rwxr-xr-xtemplates/view_xref_inc_report.tpl62
-rwxr-xr-xtemplates/view_xref_inc_report_record.tpl42
-rwxr-xr-x[-rw-r--r--]templates/view_xref_key_seal.tpl0
-rwxr-xr-xtemplates/view_xref_key_seal_record.tpl39
-rwxr-xr-x[-rw-r--r--]templates/view_xref_locate.tpl0
-rwxr-xr-xtemplates/view_xref_locate_record.tpl40
-rwxr-xr-x[-rw-r--r--]templates/view_xref_phone.tpl0
-rwxr-xr-xtemplates/view_xref_phone_record.tpl40
-rwxr-xr-xtemplates/view_xref_sig.tpl62
-rwxr-xr-xtemplates/view_xref_sig_record.tpl40
-rwxr-xr-x[-rw-r--r--]templates/view_xref_text.tpl0
-rwxr-xr-xtemplates/view_xref_text_record.tpl50
-rwxr-xr-x[-rw-r--r--]view_xref.php13
156 files changed, 4024 insertions, 1492 deletions
diff --git a/.hgignore b/.hgignore
index 52f8b00..52f8b00 100644..100755
--- a/.hgignore
+++ b/.hgignore
diff --git a/README b/README
index f1d3bd6..f1d3bd6 100644..100755
--- a/README
+++ b/README
diff --git a/add_xref.php b/add_xref.php
index 575cf48..7cbdf9c 100644..100755
--- a/add_xref.php
+++ b/add_xref.php
@@ -13,12 +13,12 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
+require_once '../kernel/includes/setup_inc.php';
$gBitSystem->verifyPackage( 'contact' );
$gBitSystem->verifyPermission( 'p_contact_update' );
-include_once( CONTACT_PKG_PATH.'lookup_contact_inc.php' );
+include_once CONTACT_PKG_INCLUDE_PATH . 'lookup_contact_inc.php';
if (isset($_REQUEST["fCancel"])) {
if( !empty( $gContent->mContentId ) ) {
@@ -61,11 +61,11 @@ $xrefInfo['xref_format_list'] = $gContent->getXrefFormatList();
$gContent->mInfo['format_guid'] = 'text';
// Default dates for creating new record
$xrefInfo['ignore_start_date'] = 'n';
+$xrefInfo['start_date'] = $gContent->mDate->getUTCTime();
$xrefInfo['ignore_end_date'] = 'y';
-$gBitSmarty->assignByRef( 'xrefInfo', $xrefInfo );
-$gBitSmarty->assignByRef( 'title', $gContent->mInfo['title'] );
+$gBitSmarty->assign( 'xrefInfo', $xrefInfo );
+$gBitSmarty->assign( 'title', $gContent->mInfo['title'] );
-$gBitSmarty->assignByRef( 'errors', $gContent->mErrors );
+$gBitSmarty->assign( 'errors', $gContent->mErrors );
$gBitSystem->display( 'bitpackage:contact/add_xref.tpl', 'Edit: ' , array( 'display_mode' => 'edit' ));
-?>
diff --git a/add_xref_address.php b/add_xref_address.php
index 7e84d53..1c0d2cd 100644..100755
--- a/add_xref_address.php
+++ b/add_xref_address.php
@@ -13,12 +13,12 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
+require_once '../kernel/includes/setup_inc.php';
$gBitSystem->verifyPackage( 'contact' );
$gBitSystem->verifyPermission( 'p_contact_update' );
-include_once( CONTACT_PKG_PATH.'lookup_contact_inc.php' );
+include_once CONTACT_PKG_INCLUDE_PATH . 'lookup_contact_inc.php';
if (isset($_REQUEST["fCancel"])) {
if( !empty( $gContent->mContentId ) ) {
@@ -49,11 +49,11 @@ $xrefInfo['xref_type_list'] = $gContent->getXrefTypeList( 0, 'address' );
$gContent->mInfo['format_guid'] = 'text';
// Default dates for creating new record
$xrefInfo['ignore_start_date'] = 'n';
+$xrefInfo['start_date'] = $gContent->mDate->getUTCTime();
$xrefInfo['ignore_end_date'] = 'y';
-$gBitSmarty->assignByRef( 'xrefInfo', $xrefInfo );
-$gBitSmarty->assignByRef( 'title', $gContent->mInfo['title'] );
+$gBitSmarty->assign( 'xrefInfo', $xrefInfo );
+$gBitSmarty->assign( 'title', $gContent->mInfo['title'] );
-$gBitSmarty->assignByRef( 'errors', $gContent->mErrors );
+$gBitSmarty->assign( 'errors', $gContent->mErrors );
$gBitSystem->display( 'bitpackage:contact/add_xref_address.tpl', 'Edit: ' , array( 'display_mode' => 'edit' ));
-?>
diff --git a/admin/admin_contact_inc.php b/admin/admin_contact_inc.php
index a30d509..69a43b9 100644..100755
--- a/admin/admin_contact_inc.php
+++ b/admin/admin_contact_inc.php
@@ -5,39 +5,40 @@
// 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.
-include_once( CONTACT_PKG_PATH.'Contact.php' );
+use Bitweaver\Contact\ContactType;
+
$mTypes = new ContactType();
$mTypes->setup();
-$formContactListFeatures = array(
- "contact_list_id" => array(
+$formContactListFeatures = [
+ "contact_list_id" => [
'label' => 'Contact Number',
- ),
- "contact_list_forename" => array(
+ ],
+ "contact_list_forename" => [
'label' => 'Forname',
- ),
- "contact_list_surname" => array(
+ ],
+ "contact_list_surname" => [
'label' => 'Surname',
- ),
- "contact_list_home_phone" => array(
+ ],
+ "contact_list_home_phone" => [
'label' => 'Home Phone',
- ),
- "contact_list_mobile_phone" => array(
+ ],
+ "contact_list_mobile_phone" => [
'label' => 'Mobile Phone',
- ),
- "contact_list_email" => array(
+ ],
+ "contact_list_email" => [
'label' => 'eMail Address',
- 'help' => 'Primary contact email address - additional contact details can be found in the full record',
- ),
- "contact_list_edit_details" => array(
+ 'help' => 'Primary contact email address - additional contact details can be found in the full record',
+ ],
+ "contact_list_edit_details" => [
'label' => 'Creation and editing details',
- 'help' => 'Enable the record modification data in the contact list. Useful to allow checking when deatils were last changed.',
- ),
- "contact_list_last_modified" => array(
+ 'help' => 'Enable the record modification data in the contact list. Useful to allow checking when deatils were last changed.',
+ ],
+ "contact_list_last_modified" => [
'label' => 'Last Modified',
- 'help' => 'Can be selected to enable filter button, without enabling the details section to allow fast checking of the last contact records that have been modified.',
- ),
-);
+ 'help' => 'Can be selected to enable filter button, without enabling the details section to allow fast checking of the last contact records that have been modified.',
+ ],
+];
$gBitSmarty->assign( 'formContactListFeatures',$formContactListFeatures );
foreach( $mTypes->mContactType as $key => $type ) {
@@ -68,4 +69,3 @@ if (isset($_REQUEST["contactTypesSelected"])) {
$gBitSmarty->assign('contactTypesSelected', $contactTypesSelected);
}
-?>
diff --git a/admin/admin_contact_type.php b/admin/admin_contact_type.php
index 0cda304..8176111 100644..100755
--- a/admin/admin_contact_type.php
+++ b/admin/admin_contact_type.php
@@ -1,8 +1,10 @@
<?php
// $Header$
-require_once( '../../kernel/setup_inc.php' );
+require_once '../../kernel/includes/setup_inc.php';
-include_once( CONTACT_PKG_PATH.'Contact.php' );
+use Bitweaver\Contact\Contact;
+use Bitweaver\Contact\ContactType;
+use Bitweaver\KernelTools;
// Is package installed and enabled
$gBitSystem->verifyPackage( 'contact' );
@@ -11,7 +13,7 @@ $gBitSystem->verifyPermission( 'p_contact_admin' );
if( isset( $_REQUEST["fSubmitAddContactType"] ) ) {
$gContent->storeTopic( $_REQUEST );
if ( !empty( $gContent->mErrors ) ) {
- $gBitSmarty->assignByRef('errors', $gContent->mErrors );
+ $gBitSmarty->assign('errors', $gContent->mErrors );
}
} elseif( !empty( $_REQUEST['fActivateTopic'] )&& $gContent ) {
$gContent->activateTopic();
@@ -26,5 +28,4 @@ if( isset( $_REQUEST["fSubmitAddContactType"] ) ) {
$contacttype = ContactType::getContactTypeList();
$gBitSmarty->assign( 'contacttype', $contacttype );
-$gBitSystem->display( 'bitpackage:contact/admin_contact_type.tpl', tra( 'Edit Contact Types' ) , array( 'display_mode' => 'admin' ));
-?>
+$gBitSystem->display( 'bitpackage:contact/admin_contact_type.tpl', KernelTools::tra( 'Edit Contact Types' ) , array( 'display_mode' => 'admin' ));
diff --git a/admin/admin_xref_types.php b/admin/admin_xref_types.php
index 491a037..e53958b 100644..100755
--- a/admin/admin_xref_types.php
+++ b/admin/admin_xref_types.php
@@ -1,10 +1,11 @@
<?php
// $Header$
-require_once( '../../kernel/setup_inc.php' );
+require_once '../../kernel/includes/setup_inc.php';
-include_once( CONTACT_PKG_PATH.'Contact.php' );
-include_once( CONTACT_PKG_PATH.'ContactXrefType.php' );
-include_once( CONTACT_PKG_PATH.'lookup_contact_xref_type_inc.php' );
+use Bitweaver\Contact\Contact;
+use Bitweaver\Contact\ContactXrefType;
+use Bitweaver\KernelTools;
+include_once CONTACT_PKG_INCLUDE_PATH . 'lookup_contact_xref_type_inc.php';
// Is package installed and enabled
$gBitSystem->verifyPackage( 'contact' );
@@ -13,7 +14,7 @@ $gBitSystem->verifyPermission( 'p_contact_admin' );
if( isset( $_REQUEST["fSubmitAddXrefType"] ) ) {
$gContent->storeXrefType( $_REQUEST );
if ( !empty( $gContent->mErrors ) ) {
- $gBitSmarty->assignByRef('errors', $gContent->mErrors );
+ $gBitSmarty->assign('errors', $gContent->mErrors );
}
} elseif( !empty( $_REQUEST['fActivateXrefType'] )&& $gContent ) {
$gContent->activateXrefType();
@@ -28,5 +29,4 @@ if( isset( $_REQUEST["fSubmitAddXrefType"] ) ) {
$xref_types = ContactXrefType::getContactXrefTypeList();
$gBitSmarty->assign( 'xref_types', $xref_types );
-$gBitSystem->display( 'bitpackage:contact/admin_xref_types.tpl', tra( 'Edit XrefTypes' ) , array( 'display_mode' => 'admin' ));
-?>
+$gBitSystem->display( 'bitpackage:contact/admin_xref_types.tpl', KernelTools::tra( 'Edit XrefTypes' ) , array( 'display_mode' => 'admin' ));
diff --git a/admin/index.php b/admin/index.php
index 80f6d40..80f6d40 100644..100755
--- a/admin/index.php
+++ b/admin/index.php
diff --git a/admin/schema_inc.php b/admin/schema_inc.php
index 38fd7c7..d0b3275 100644..100755
--- a/admin/schema_inc.php
+++ b/admin/schema_inc.php
@@ -1,7 +1,7 @@
<?php
-$tables = array(
+$tables = [
-'contact' => "
+ 'contact' => "
content_id I8 PRIMARY,
parent_id I8 DEFAULT 0,
address_id I8 DEFAULT 0,
@@ -9,7 +9,7 @@ $tables = array(
xkey C(32)
",
-'contact_xref' => "
+ 'contact_xref' => "
xref_id I8 PRIMARY,
content_id I8 NOTNULL,
source C(20) PRIMARY,
@@ -24,7 +24,7 @@ $tables = array(
end_date T
",
-'contact_xref_source' => "
+ 'contact_xref_source' => "
source C(20) PRIMARY,
cross_ref_title C(64),
xref_type I2,
@@ -35,7 +35,7 @@ $tables = array(
data X
",
-'contact_xref_type' => "
+ 'contact_xref_type' => "
xref_type I2 PRIMARY,
source C(20),
title C(64),
@@ -43,7 +43,7 @@ $tables = array(
type_href C(256)
",
-'contact_address' => "
+ 'contact_address' => "
content_id I8 PRIMARY,
address_id I8,
uprn I8,
@@ -62,7 +62,7 @@ $tables = array(
cltype I2
",
-);
+];
global $gBitInstaller;
@@ -71,20 +71,21 @@ foreach( array_keys( $tables ) AS $tableName ) {
}
$gBitInstaller->registerPackageInfo( CONTACT_PKG_NAME, array(
- 'description' => "Base Contact management package with contact xref and address books",
+ 'description' => "Base Contact management package with contact xref and address books
+ designed to be expanded with additional plugins.",
'license' => '<a href="http://www.gnu.org/licenses/licenses.html#LGPL">LGPL</a>',
) );
// ### Indexes
-$indices = array (
- 'contact_parent_id_idx' => array( 'table' => 'contact', 'cols' => 'parent_id', 'opts' => NULL ),
- 'contact_address_id_idx' => array( 'table' => 'contact', 'cols' => 'address_id', 'opts' => NULL ),
-);
+$indices = [
+ 'contact_parent_id_idx' => [ 'table' => 'contact', 'cols' => 'parent_id', 'opts' => null ],
+ 'contact_address_id_idx' => [ 'table' => 'contact', 'cols' => 'address_id', 'opts' => null ],
+];
$gBitInstaller->registerSchemaIndexes( CONTACT_PKG_NAME, $indices );
// ### Sequences
$sequences = array (
- 'contact_xref_seq' => array( 'start' => 1 ),
+ 'contact_xref_seq' => [ 'start' => 1 ],
);
$gBitInstaller->registerSchemaSequences( CONTACT_PKG_NAME, $sequences );
@@ -92,64 +93,66 @@ $gBitInstaller->registerSchemaSequences( CONTACT_PKG_NAME, $sequences );
// ### Default User Permissions
$gBitInstaller->registerUserPermissions( CONTACT_PKG_NAME, array(
- array('p_contact_view', 'Can browse the Contact List', 'basic', CONTACT_PKG_NAME),
- array('p_contact_update', 'Can update the Contact List content', 'registered', CONTACT_PKG_NAME),
- array('p_contact_create', 'Can create a new Contact List entry', 'registered', CONTACT_PKG_NAME),
- array('p_contact_admin', 'Can admin Contact List', 'admin', CONTACT_PKG_NAME),
- array('p_contact_expunge', 'Can remove a Contact entry', 'editors', CONTACT_PKG_NAME)
+ [ 'p_contact_view', 'Can browse the Contact List', 'basic', CONTACT_PKG_NAME ],
+ [ 'p_contact_update', 'Can update the Contact List content', 'registered', CONTACT_PKG_NAME ],
+ [ 'p_contact_create', 'Can create a new Contact List entry', 'registered', CONTACT_PKG_NAME ],
+ [ 'p_contact_admin', 'Can admin Contact List', 'admin', CONTACT_PKG_NAME ],
+ [ 'p_contact_expunge', 'Can remove a Contact entry', 'editors', CONTACT_PKG_NAME ]
) );
// ### Default Preferences
$gBitInstaller->registerPreferences( CONTACT_PKG_NAME, array(
- array( CONTACT_PKG_NAME, 'contact_default_ordering','title_desc'),
- array( CONTACT_PKG_NAME, 'contact_list_created','y'),
- array( CONTACT_PKG_NAME, 'contact_list_lastmodif','y'),
- array( CONTACT_PKG_NAME, 'contact_list_notes','y'),
- array( CONTACT_PKG_NAME, 'contact_list_title','y'),
- array( CONTACT_PKG_NAME, 'contact_list_user','y'),
-) );
-
-$gBitInstaller->registerSchemaDefault( CONTACT_PKG_NAME, array(
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_type` VALUES ('0', 'type', 'Contact Type List', '3', '')",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_type` VALUES ('1', 'contact', 'General Contact Details', '3', '')",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_type` VALUES ('2', 'links', 'Linked Contact Items', '3', '')",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_type` VALUES ('3', 'alarm', 'Security System Links', '3', '')",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_type` VALUES ('4', 'council', 'Council reference links', '3', '')",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_type` VALUES ('5', 'account', 'Account Details', '4', '')",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('$00', 'Personal', '0', '0', '3', '/contact/?type=0', NULL, NULL)",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('$01', 'Business', '0', '0', '3', '/contact/?type=1', NULL, NULL)",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('$02', 'Manufacturer', '0', '0', '3', '/contact/?type=2', NULL, NULL)",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('$03', 'Distributor', '0', '0', '3', '/contact/?type=3', NULL, NULL)",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('$04', 'Supplier', '0', '0', '3', '/contact/?type=4', NULL, NULL)",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('$05', 'Record Company', '0', '0', '3', '/contact/?type=5', NULL, NULL)",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('$06', 'Record Artist', '0', '0', '3', '/contact/?type=6', NULL, NULL)",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('$07', 'Cartographer', '0', '0', '3', '/contact/?type=7', NULL, NULL)",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('$08', 'PHX Client', '0', '0', '3', '/contact/?type=8', NULL, NULL)",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('$09', 'LSCES Supplier', '0', '0', '3', '/contact/?type=9', NULL, NULL)",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('$10', 'Paypal Client', '0', '0', '3', '/contact/?type=10', NULL, NULL)",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('#C', 'Contact Address', '1', '0', '3', '../nlpg/?uprn=', 'address', NULL)",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('#E', 'eMail Address', '1', '1', '3', '../contact/?contact_id=', 'text', NULL)",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('#F', 'Fax', '1', '1', '3', '../contact/?contact_id=', 'text', NULL)",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('#E', 'eMail Address', '1', '1', '3', '../contact/?contact_id=', 'text', NULL)",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('#I', 'Invoice Address', '1', '0', '3', '../nlpg/?uprn=', 'address', NULL)",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('#P', 'Telephone', '1', '1', '3', '../contact/?contact_id=', 'phone', NULL)",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('#R', 'Residential Address', '1', '0', '3', '../nlpg/?uprn=', 'address', NULL)",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('#S', 'Service Address', '1', '0', '3', '../nlpg/?uprn=', 'address', NULL)",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('#T', 'Tenant Address', '1', '0', '3', '../nlpg/?uprn=', 'address', NULL)",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('#W', 'Web Site Url', '1', '1', '3', '../contact/?contact_id=', 'text', NULL)",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('0', 'Free format information', '1', '1', '3', '../contact/?xref=', 'text', NULL)",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('CON', 'Contact', '1', '1', '3', '../nlpg/?uprn=', 'text', NULL)",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('#A', 'Alarm Maintainer', '3', '0', '3', '../nlpg/?uprn=', 'text', NULL)",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('#K', 'Keyholder', '3', '1', '3', '../nlpg/?uprn=', 'phone', NULL)",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('ALARM', 'Alarm System', '3', '0', '3', '../nlpg/?uprn=', 'text', NULL)",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('CTAX', 'Council Tax', '4', '0', '3', '../nlpg/?uprn=', 'text', NULL)",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('ER', 'Electoral Roll', '4', '0', '3', '../nlpg/?uprn=', 'text', NULL)",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('HBEN', 'Housing Benefit', '4', '0', '3', '../nlpg/?uprn=', 'text', NULL)",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('NNDR', 'National Non-domestic Rates', '4', '0', '3', '../nlpg/?uprn=', 'text', NULL)",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('ACC_TO', 'Account Turnover', '5', '0', '3', '../vat/?vat=', 'text', NULL)",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('SAGEID', 'SAGE Account Reference', '5', '0', '3', '''sage''', 'text', NULL)",
-"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('VAT_NO', 'VAT Number', '5', '0', '3', '../vat/?vat=', 'text', NULL)",
+ [ CONTACT_PKG_NAME, 'contact_default_ordering', 'title_desc' ],
+ [ CONTACT_PKG_NAME, 'contact_list_created', 'y' ],
+ [ CONTACT_PKG_NAME, 'contact_list_lastmodif', 'y' ],
+ [ CONTACT_PKG_NAME, 'contact_list_notes', 'y' ],
+ [ CONTACT_PKG_NAME, 'contact_list_title', 'y' ],
+ [ CONTACT_PKG_NAME, 'contact_list_user', 'y' ],
) );
+$gBitInstaller->registerSchemaDefault( CONTACT_PKG_NAME, [
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_type` VALUES ('0', 'type', 'Contact Type List', '3', '')",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_type` VALUES ('1', 'contact', 'General Contact Details', '3', '')",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_type` VALUES ('2', 'links', 'Linked Contact Items', '3', '')",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_type` VALUES ('3', 'alarm', 'Security System Links', '3', '')",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_type` VALUES ('4', 'council', 'Council reference links', '3', '')",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_type` VALUES ('5', 'account', 'Account Details', '4', '')",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_source` VALUES ('$00', 'Personal', '0', '0', '3', '/contact/?type=0', NULL, NULL)",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_source` VALUES ('$01', 'Business', '0', '0', '3', '/contact/?type=1', NULL, NULL)",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_source` VALUES ('$02', 'Manufacturer', '0', '0', '3', '/contact/?type=2', NULL, NULL)",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_source` VALUES ('$03', 'Distributor', '0', '0', '3', '/contact/?type=3', NULL, NULL)",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_source` VALUES ('$04', 'Supplier', '0', '0', '3', '/contact/?type=4', NULL, NULL)",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_source` VALUES ('$05', 'Record Company', '0', '0', '3', '/contact/?type=5', NULL, NULL)",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_source` VALUES ('$06', 'Record Artist', '0', '0', '3', '/contact/?type=6', NULL, NULL)",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_source` VALUES ('$07', 'Cartographer', '0', '0', '3', '/contact/?type=7', NULL, NULL)",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_source` VALUES ('$08', 'PHX Client', '0', '0', '3', '/contact/?type=8', NULL, NULL)",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_source` VALUES ('$09', 'LSCES Supplier', '0', '0', '3', '/contact/?type=9', NULL, NULL)",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_source` VALUES ('$10', 'Paypal Client', '0', '0', '3', '/contact/?type=10', NULL, NULL)",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_source` VALUES ('#C', 'Contact Address', '1', '0', '3', '../nlpg/?uprn=', 'address', NULL)",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_source` VALUES ('#E', 'eMail Address', '1', '1', '3', '../contact/?contact_id=', 'text', NULL)",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_source` VALUES ('#F', 'Fax', '1', '1', '3', '../contact/?contact_id=', 'text', NULL)",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_source` VALUES ('#E', 'eMail Address', '1', '1', '3', '../contact/?contact_id=', 'text', NULL)",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_source` VALUES ('#I', 'Invoice Address', '1', '0', '3', '../nlpg/?uprn=', 'address', NULL)",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_source` VALUES ('#P', 'Telephone', '1', '1', '3', '../contact/?contact_id=', 'phone', NULL)",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_source` VALUES ('#R', 'Residential Address', '1', '0', '3', '../nlpg/?uprn=', 'address', NULL)",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_source` VALUES ('#S', 'Service Address', '1', '0', '3', '../nlpg/?uprn=', 'address', NULL)",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_source` VALUES ('#T', 'Tenant Address', '1', '0', '3', '../nlpg/?uprn=', 'address', NULL)",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_source` VALUES ('#W', 'Web Site Url', '1', '1', '3', '../contact/?contact_id=', 'text', NULL)",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_source` VALUES ('0', 'Free format information', '1', '1', '3', '../contact/?xref=', 'text', NULL)",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_source` VALUES ('CON', 'Contact', '1', '1', '3', '../nlpg/?uprn=', 'text', NULL)",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_source` VALUES ('#A', 'Alarm Maintainer', '3', '0', '3', '../nlpg/?uprn=', 'text', NULL)",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_source` VALUES ('#K', 'Keyholder', '3', '1', '3', '../nlpg/?uprn=', 'phone', NULL)",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_source` VALUES ('ALARM', 'Alarm System', '3', '0', '3', '../nlpg/?uprn=', 'text', NULL)",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_source` VALUES ('CTAX', 'Council Tax', '4', '0', '3', '../nlpg/?uprn=', 'text', NULL)",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_source` VALUES ('ER', 'Electoral Roll', '4', '0', '3', '../nlpg/?uprn=', 'text', NULL)",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_source` VALUES ('HBEN', 'Housing Benefit', '4', '0', '3', '../nlpg/?uprn=', 'text', NULL)",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_source` VALUES ('NNDR', 'National Non-domestic Rates', '4', '0', '3', '../nlpg/?uprn=', 'text', NULL)",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_source` VALUES ('ACC_TO', 'Account Turnover', '5', '0', '3', '../vat/?vat=', 'text', NULL)",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_source` VALUES ('SAGEID', 'SAGE Account Reference', '5', '0', '3', '''sage''', 'text', NULL)",
+ "INSERT INTO `" . BIT_DB_PREFIX . "contact_xref_source` VALUES ('VAT_NO', 'VAT Number', '5', '0', '3', '../vat/?vat=', 'text', NULL)",
+] );
-?>
+// Requirements
+$gBitInstaller->registerRequirements( CONTACT_PKG_NAME, [
+ 'liberty' => [ 'min' => '5.0.0' ],
+] ); \ No newline at end of file
diff --git a/bit_setup_inc.php b/bit_setup_inc.php
deleted file mode 100644
index 9f3aef0..0000000
--- a/bit_setup_inc.php
+++ /dev/null
@@ -1,17 +0,0 @@
-<?php
-global $gBitSystem, $gBitSmarty;
-$registerHash = array(
- 'package_name' => 'contact',
- 'package_path' => dirname( __FILE__ ).'/',
- 'homeable' => FALSE,
-);
-$gBitSystem->registerPackage( $registerHash );
-
-if( $gBitSystem->isPackageActive( 'contact' ) ) {
- $menuHash = array(
- 'package_name' => CONTACT_PKG_NAME,
- 'index_url' => CONTACT_PKG_URL.'index.php',
- 'menu_template' => 'bitpackage:contact/menu_contact.tpl',
- );
- $gBitSystem->registerAppMenu( $menuHash );
-}
diff --git a/data/README b/data/README
index c8ec4c6..c8ec4c6 100644..100755
--- a/data/README
+++ b/data/README
diff --git a/data/cotswold_guard_cust.csv b/data/cotswold_guard_cust.csv
new file mode 100755
index 0000000..c2b0a41
--- /dev/null
+++ b/data/cotswold_guard_cust.csv
@@ -0,0 +1,27 @@
+NK – Ideal Alarms – Mrs Silman,Old Orchard,WR11 8QR,01386 304360
+NK – Ideal Alarms – Mr/S Humphrey,1 Spring Close,WR13 6RE,01684540870
+NK – Ideal Alarms – Mr/s Steggles,1 Woodbury Rise,WR14 1QZ,01684573577
+NK – Ideal Alarms – Mr Roberts,18 Landsdown Close,WR14 2AU,01684566255
+NK – Ideal Alarms – Mr/s Beverley,4 Dairy Close,WR14 2FB,07971560719
+NK – Ideal Alarms – Mrs Exon,12 Chamberline Road,WR2 4PR,01905424521
+NK – Ideal Alarms – Mr & Mrs Cubberley,6 Upton Road,WR2 4TE,01905 830523
+NK – Ideal Alarms – Mr/S Lenox,Pixham Cottage,WR2 4TH,01905831104
+NK – Ideal Alarms – Mr D Handley,13 Ambrose Close,WR2 6JX,01905424603
+NK – Ideal Alarms – Mr Edge & Ms Jones,2 Greenfield Close,WR4 0HG,01905610691
+NK – Ideal Alarms – Mr Fielding,6 Masons Drive,WR4 9XY,01905458117
+NK – Ideal Alarms – Mr Lambert,7 Linksview Crescent,WR5 1JH,01905351033
+NK – Ideal Alarms – Mr/'s Massey,31 Mersey Road,WR5 1LR,01905 921720
+NK – Ideal Alarms – Mr/S Tobin,Willow Bank,WR6 5RT,01886 821629
+NK – Ideal Alarms – Mrs Bradbury,Gruinart,WR6 6AY,01299896489
+NK – Ideal Alarms – Mr/s Withers,Orchard House,WR6 6NT,01905620103
+NK – Ideal Alarms – Mr And Mrs Wardle,Gwynheath,WR6 6YY,01886 888271
+NK – Ideal Alarms – Mr/S Diamond,The Homestead,WR7 4BU,01386462301
+NK – Ideal Alarms – Mr M Windross,9 Hillview Garden,WR8 0QJ,01684591450
+NK – Ideal Alarms – Mr/'s Perks,The Byre,WR8 9AT,01386552655
+NK – Ideal Alarms – Mr/s Goldfinch,17 Banbridge Avenue,WR9 7AT,01905 770415
+NK – Ideal Alarms – Mr/s Stamp,24 Tyndale Road,GL11 6LH,01453547919
+NK – Ideal Alarms – Mr/s Whitaker,12 Littlefield,GL2 4GZ,01452728521
+NK – Ideal Alarms – Mr/s Widdowson,1 Long Eight,GL20 8QZ,01684291060
+NK – Ideal Alarms – Mr/s Harrington,Grange Hill,HR1 3QD,01432851145
+NK – Ideal Alarms – Mr/s Evans,"62 Chatcombe Drive, Worceseter",WR4 9LT,1905455450
+NK – Ideal Alarms – Mr/s Rugman,Lowbourne,WR15 8LY,1584781383
diff --git a/data/customers.csv b/data/customers.csv
new file mode 100755
index 0000000..e69de29
--- /dev/null
+++ b/data/customers.csv
diff --git a/data/suppliers.csv b/data/suppliers.csv
new file mode 100755
index 0000000..e69de29
--- /dev/null
+++ b/data/suppliers.csv
diff --git a/display_contact.php b/display_contact.php
index 151ee3a..749ac98 100644..100755
--- a/display_contact.php
+++ b/display_contact.php
@@ -13,38 +13,39 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
+use Bitweaver\Fisheye\FisheyeGallery;
+
+require_once '../kernel/includes/setup_inc.php';
$gBitSystem->verifyPackage( 'contact' );
$gBitSystem->verifyPermission( 'p_contact_view' );
-include_once( CONTACT_PKG_PATH.'lookup_contact_inc.php' );
+include_once CONTACT_PKG_INCLUDE_PATH . 'lookup_contact_inc.php';
-require_once( FISHEYE_PKG_PATH.'FisheyeGallery.php');
-require_once( FISHEYE_PKG_PATH.'FisheyeImage.php');
global $gBitSystem, $fisheyeErrors, $fisheyeWarnings, $fisheyeSuccess;
-$lookup = array();
-$gGallery = new FisheyeGallery(4);
+$lookup = [];
+$lookup['max_records'] = 4;
+$gGallery = new FisheyeGallery( $gContent->mInfo['client_gallery'] );
$gGallery->load();
-$gGallery->loadImages(0,4);
-$gBitSmarty->assignByRef('gGallery', $gGallery);
-$gBitSmarty->assignByRef('galleryId', $gGallery->mGalleryId);
-$gBitSmarty->assign('galLayout', 'fixed_grid');
+$gGallery->loadImages( $lookup );
+$gBitSmarty->assign( 'gGallery', $gGallery );
+$gBitSmarty->assign( 'galleryId', $gGallery->mGalleryId );
+$gBitSmarty->assign( 'galLayout', 'fixed_grid' );
-if ( !$gContent->isValid() ) {
- header ("location: ".CONTACT_PKG_URL."list.php");
+if (!$gContent->isValid()) {
+ header( "location: " . CONTACT_PKG_URL . "list.php" );
die;
}
-if( $gContent->isCommentable() ) {
+if ($gContent->isCommentable()) {
$commentsParentId = $gContent->mContentId;
- $comments_vars = Array('contact');
- $comments_prefix_var='contact:';
- $comments_object_var='contact';
- $comments_return_url = $_SERVER['PHP_SELF']."?content_id=".$gContent->mContentId;
- include_once( LIBERTY_PKG_PATH.'comments_inc.php' );
+ $comments_vars = [ 'contact' ];
+ $comments_prefix_var = 'contact:';
+ $comments_object_var = 'contact';
+ $comments_return_url = $_SERVER['PHP_SELF'] . "?content_id=" . $gContent->mContentId;
+ include_once LIBERTY_PKG_INCLUDE_PATH . 'comments_inc.php';
- if ( isset($_REQUEST['post_comment_submit']) and !$_REQUEST['post_comment_submit'] == 'Post' ) {
+ if (isset($_REQUEST['post_comment_submit']) and !$_REQUEST['post_comment_submit'] == 'Post' ) {
header ("location: ".CONTACT_PKG_URL."index.php?content_id=".$gContent->mContentId );
die;
}
@@ -54,4 +55,3 @@ $gContent->mInfo['type'] = $gContent->getContactGroupList();
$gBitSystem->setBrowserTitle("Contact Information");
$gBitSystem->display( 'bitpackage:contact/show_contact.tpl');
-?>
diff --git a/display_list_header.php b/display_list_header.php
index a452d4e..73b0825 100644..100755
--- a/display_list_header.php
+++ b/display_list_header.php
@@ -9,6 +9,3 @@
* @package contact
* @subpackage functions
*/
-
-
-?>
diff --git a/edit.php b/edit.php
index c89488b..f6d2d92 100644..100755
--- a/edit.php
+++ b/edit.php
@@ -1,4 +1,6 @@
<?php
+
+use Bitweaver\KernelTools;
/**
* $Header: /cvsroot/bitweaver/_bit_contact/edit.php,v 1.6 2010/02/08 21:27:22 wjames5 Exp $
*
@@ -13,34 +15,34 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
+require_once '../kernel/includes/setup_inc.php';
$gBitSystem->verifyPackage( 'contact' );
$gBitSystem->verifyPermission( 'p_contact_update' );
-include_once( CONTACT_PKG_PATH.'lookup_contact_inc.php' );
+include_once CONTACT_PKG_INCLUDE_PATH . 'lookup_contact_inc.php';
-if( !empty( $gContent->mInfo ) ) {
+if (!empty( $gContent->mInfo )) {
$formInfo = $gContent->mInfo;
$formInfo['edit'] = !empty( $gContent->mInfo['data'] ) ? $gContent->mInfo['data'] : '';
}
$cat_type = BITPAGE_CONTENT_TYPE_GUID;
-if(isset($_REQUEST["preview"])) {
+if (isset( $_REQUEST["preview"] )) {
// get files from all packages that process this data further
- foreach( $gBitSystem->getPackageIntegrationFiles( 'form_processor_inc.php', TRUE ) as $package => $file ) {
- if( $gBitSystem->isPackageActive( $package ) ) {
- include_once( $file );
+ foreach ( $gBitSystem->getPackageIntegrationFiles( 'form_processor_inc.php', true ) as $package => $file ) {
+ if ($gBitSystem->isPackageActive( $package )) {
+ include_once $file;
}
}
- $gBitSmarty->assign('preview',1);
- $gBitSmarty->assign('title',$_REQUEST["title"]);
+ $gBitSmarty->assign( 'preview', 1 );
+ $gBitSmarty->assign( 'title', $_REQUEST["title"] );
- $parsed = $gContent->parseData($formInfo['edit'], (!empty( $_REQUEST['format_guid'] ) ? $_REQUEST['format_guid'] :
- ( isset($gContent->mInfo['format_guid']) ? $gContent->mInfo['format_guid'] : 'tikiwiki' ) ) );
- $gBitSmarty->assignByRef('parsed', $parsed);
+ $parsed = $gContent->parseData( $formInfo['edit'], !empty( $_REQUEST['format_guid'] ) ? $_REQUEST['format_guid'] :
+ ( isset( $gContent->mInfo['format_guid'] ) ? $gContent->mInfo['format_guid'] : 'tikiwiki' ) );
+ $gBitSmarty->assign('parsed', $parsed);
$gContent->invokeServices( 'content_preview_function' );
} else {
$gContent->invokeServices( 'content_edit_function' );
@@ -49,13 +51,13 @@ if(isset($_REQUEST["preview"])) {
// Pro
if (isset($_REQUEST["fCancel"])) {
if( !empty( $gContent->mContentId ) ) {
- bit_redirect( $gContent->getDisplayUrl() );
+ KernelTools::bit_redirect( $gContent->getDisplayUrl() );
} else {
- bit_redirect( CONTACT_PKG_URL );
+ KernelTools::bit_redirect( CONTACT_PKG_URL );
}
} elseif (isset($_REQUEST["fSaveContact"])) {
if( $gContent->store( $_REQUEST ) ) {
- bit_redirect( $gContent->getDisplayUrl() );
+ KernelTools::bit_redirect( $gContent->getDisplayUrl() );
} else {
$formInfo = $_REQUEST;
$formInfo['data'] = &$_REQUEST['edit'];
@@ -68,11 +70,10 @@ if( empty( $formInfo ) ) {
}
$formInfo['contact_type_list'] = $gContent->getContactSourceList();
-$gBitSmarty->assignByRef( 'pageInfo', $formInfo );
+$gBitSmarty->assign( 'pageInfo', $formInfo );
-$gBitSmarty->assignByRef( 'errors', $gContent->mErrors );
+$gBitSmarty->assign( 'errors', $gContent->mErrors );
$gBitSmarty->assign( (!empty( $_REQUEST['tab'] ) ? $_REQUEST['tab'] : 'body').'TabSelect', 'tdefault' );
$gBitSmarty->assign('show_page_bar', 'y');
$gBitSystem->display( 'bitpackage:contact/edit.tpl', 'Edit: ' , array( 'display_mode' => 'edit' ));
-?>
diff --git a/edit_key_break.php b/edit_key_break.php
index 0e76f76..684e593 100644..100755
--- a/edit_key_break.php
+++ b/edit_key_break.php
@@ -1,4 +1,6 @@
<?php
+
+use Bitweaver\KernelTools;
/**
* $Header: /cvsroot/bitweaver/_bit_contact/edit.php,v 1.6 2010/02/08 21:27:22 wjames5 Exp $
*
@@ -13,12 +15,12 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
+require_once '../kernel/includes/setup_inc.php';
$gBitSystem->verifyPackage( 'contact' );
$gBitSystem->verifyPermission( 'p_contact_update' );
-include_once( CONTACT_PKG_PATH.'lookup_contact_inc.php' );
+include_once CONTACT_PKG_INCLUDE_PATH . 'lookup_contact_inc.php';
if( empty( $gContent ) || !is_object( $gContent ) ) {
$gContent = new Contact();
}
@@ -29,7 +31,7 @@ if( !empty( $_REQUEST['xref_id'] ) ) {
$gContent->stepXref( $_REQUEST );
if(isset($_REQUEST["fSaveXref"])) {
- bit_redirect( $gContent->getDisplayUrl() );
+ KernelTools::bit_redirect( $gContent->getDisplayUrl() );
}
// formInfo might be set due to a error on submit
@@ -45,10 +47,9 @@ if( empty( $xrefInfo['content_id'] ) ) {
// Ensure simple text edit boxes for xref entries
$gContent->mInfo['format_guid'] = 'text';
-$gBitSmarty->assignByRef( 'xrefInfo', $xrefInfo );
-$gBitSmarty->assignByRef( 'title', $gContent->mInfo['title'] );
-$gBitSmarty->assignByRef( 'xref_title', $gContent->mInfo['xref_title'] );
+$gBitSmarty->assign( 'xrefInfo', $xrefInfo );
+$gBitSmarty->assign( 'title', $gContent->mInfo['title'] );
+$gBitSmarty->assign( 'xref_title', $gContent->mInfo['xref_title'] );
-$gBitSmarty->assignByRef( 'errors', $gContent->mErrors );
+$gBitSmarty->assign( 'errors', $gContent->mErrors );
$gBitSystem->display( 'bitpackage:contact/edit_key_break.tpl', 'Edit: ' , array( 'display_mode' => 'edit' ));
-?>
diff --git a/edit_notes.php b/edit_notes.php
index 42b92e3..72d0e15 100644..100755
--- a/edit_notes.php
+++ b/edit_notes.php
@@ -13,14 +13,14 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
+require_once '../kernel/includes/setup_inc.php';
$gBitSystem->verifyPackage( 'contact' );
$gBitSystem->verifyPermission( 'p_contact_update' );
-include_once( CONTACT_PKG_PATH.'lookup_contact_inc.php' );
+include_once CONTACT_PKG_INCLUDE_PATH . 'lookup_contact_inc.php';
-if( !empty( $gContent->mInfo ) ) {
+if (!empty( $gContent->mInfo )) {
$formInfo = $gContent->mInfo;
$formInfo['edit'] = !empty( $gContent->mInfo['data'] ) ? $gContent->mInfo['data'] : '';
}
@@ -32,33 +32,34 @@ require_once 'import/mimeDecode.php';
$file = '/srv/website/bitweaver/contact/data/Stockport';
echo 'Using file ' . $file . "<br>";
-$mbox = new Mail_Mbox($file);
+$mbox = new Mail_Mbox( $file );
$mbox->open();
-for ($n = 0; $n < $mbox->size(); $n++) {
- $message = $mbox->get($n);
+for ( $n = 0; $n < $mbox->size(); $n++ ) {
+ $message = $mbox->get( $n );
- preg_match('/Subject: (.*)$/m', $message, $matches);
- $subject = $matches[1];
- echo 'Mail #' . $n . ': ' . $subject . "<br>";
- $Decoder = new Mail_mimeDecode( $message );
- $params = array(
- 'include_bodies' => TRUE,
- 'decode_bodies' => TRUE,
- 'decode_headers' => TRUE
+ preg_match( '/Subject: (.*)$/m', $message, $matches );
+ $subject = $matches[1];
+ echo 'Mail #' . $n . ': ' . $subject . "<br>";
+ $Decoder = new Mail_mimeDecode( $message );
+ $params = array(
+ 'include_bodies' => true,
+ 'decode_bodies' => true,
+ 'decode_headers' => true,
);
- $Decoded = $Decoder->decode($params);
- if ( $Decoded->ctype_primary == "multipart" ) {
- vd($Decoded->parts[0]->ctype_primary);
- vd($Decoded->parts[0]->ctype_secondary);
- print($Decoded->parts[0]->body);
- } else {
- vd($Decoded->ctype_primary);
- vd($Decoded->ctype_secondary);
- print($Decoded->body);
+ $Decoded = $Decoder->decode( $params );
+ if ($Decoded->ctype_primary == "multipart") {
+ \Bitweaver\vd( $Decoded->parts[0]->ctype_primary );
+ \Bitweaver\vd( $Decoded->parts[0]->ctype_secondary );
+ print $Decoded->parts[0]->body;
}
- vd($Decoded->headers);
- print( $message );
+ else {
+ \Bitweaver\vd( $Decoded->ctype_primary );
+ \Bitweaver\vd( $Decoded->ctype_secondary );
+ print $Decoded->body;
+ }
+ \Bitweaver\vd( $Decoded->headers );
+ print $message;
}
$mbox->close();
@@ -69,11 +70,10 @@ if( empty( $formInfo ) ) {
}
$formInfo['contact_type_list'] = $gContent->getContactSourceList();
-$gBitSmarty->assignByRef( 'pageInfo', $formInfo );
+$gBitSmarty->assign( 'pageInfo', $formInfo );
-$gBitSmarty->assignByRef( 'errors', $gContent->mErrors );
+$gBitSmarty->assign( 'errors', $gContent->mErrors );
$gBitSmarty->assign( (!empty( $_REQUEST['tab'] ) ? $_REQUEST['tab'] : 'body').'TabSelect', 'tdefault' );
$gBitSmarty->assign('show_page_bar', 'y');
$gBitSystem->display( 'bitpackage:contact/edit.tpl', 'Edit: ' , array( 'display_mode' => 'edit' ));
-?>
diff --git a/edit_xref.php b/edit_xref.php
index b384b64..16a0057 100644..100755
--- a/edit_xref.php
+++ b/edit_xref.php
@@ -13,12 +13,12 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
+require_once '../kernel/includes/setup_inc.php';
$gBitSystem->verifyPackage( 'contact' );
$gBitSystem->verifyPermission( 'p_contact_update' );
-include_once( CONTACT_PKG_PATH.'lookup_contact_inc.php' );
+include_once CONTACT_PKG_INCLUDE_PATH . 'lookup_contact_inc.php';
if( empty( $gContent ) || !is_object( $gContent ) ) {
$gContent = new Contact();
}
@@ -55,14 +55,13 @@ if (isset($_REQUEST["fCancel"])) {
if( empty( $xrefInfo ) ) {
$xrefInfo = &$gContent->mInfo['xref_store']['data'];
}
-$gBitSmarty->assignByRef( 'xrefInfo', $xrefInfo );
-$gBitSmarty->assignByRef( 'title', $gContent->mInfo['title'] );
-$gBitSmarty->assignByRef( 'xref_title', $gContent->mInfo['xref_title'] );
+$gBitSmarty->assign( 'xrefInfo', $xrefInfo );
+$gBitSmarty->assign( 'title', $gContent->mInfo['title'] );
+$gBitSmarty->assign( 'xref_title', $gContent->mInfo['xref_title'] );
-$gBitSmarty->assignByRef( 'errors', $gContent->mErrors );
+$gBitSmarty->assign( 'errors', $gContent->mErrors );
if( isset($xrefInfo['template']) ) {
$gBitSystem->display( 'bitpackage:contact/edit_xref_'.$xrefInfo['template'].'.tpl', 'Edit: ' , array( 'display_mode' => 'edit' ));
} else {
$gBitSystem->display( 'bitpackage:contact/edit_xref.tpl', 'Edit: ' , array( 'display_mode' => 'edit' ));
}
-?>
diff --git a/edit_xref_type.php b/edit_xref_type.php
index 88a0b08..370e9dc 100644..100755
--- a/edit_xref_type.php
+++ b/edit_xref_type.php
@@ -8,15 +8,16 @@
/**
* Initialization
*/
-require_once( '../kernel/setup_inc.php' );
+use Bitweaver\Contact\Contact;
+
+require_once '../kernel/includes/setup_inc.php';
$gBitSystem->verifyPackage( 'contact' );
$gBitSystem->verifyPermission( 'p_contact_update' );
-include_once( CONTACT_PKG_PATH.'Contact.php' );
$gContent = new Contact();
-$gBitSmarty->assignByRef( 'xref_type_info', $gContent->mInfo);
+$gBitSmarty->assign( 'xref_type_info', $gContent->mInfo);
if( isset( $_REQUEST["fSubmitSaveXrefType"] ) ) {
$gContent->storeXrefType( $_REQUEST );
@@ -27,4 +28,3 @@ if( isset( $_REQUEST["fSubmitSaveXrefType"] ) ) {
}
$gBitSystem->display( 'bitpackage:contact/edit_xref_type.tpl' , NULL, array( 'display_mode' => 'edit' ));
-?> \ No newline at end of file
diff --git a/form.php b/form.php
new file mode 100755
index 0000000..f14aac2
--- /dev/null
+++ b/form.php
@@ -0,0 +1,45 @@
+<?php
+
+use Bitweaver\KernelTools;
+/**
+ * $Header: /cvsroot/bitweaver/_bit_contact/edit.php,v 1.6 2010/02/08 21:27:22 wjames5 Exp $
+ *
+ * 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
+ * @subpackage functions
+ */
+
+/**
+ * required setup
+ */
+require_once '../kernel/includes/setup_inc.php';
+
+$gBitSystem->verifyPackage( 'contact' );
+
+$cat_type = BITPAGE_CONTENT_TYPE_GUID;
+if(isset($_REQUEST["fSaveForm"])) {
+ \Bitweaver\vd($_REQUEST);
+} else {
+
+}
+
+// Pro
+if (isset($_REQUEST["fCancel"])) {
+ if( !empty( $gContent->mContentId ) ) {
+ KernelTools::bit_redirect( $gContent->getDisplayUrl() );
+ } else {
+ KernelTools::bit_redirect( CONTACT_PKG_URL );
+ }
+} elseif (isset($_REQUEST["fSaveContact"])) {
+ if( $gContent->store( $_REQUEST ) ) {
+ KernelTools::bit_redirect( $gContent->getDisplayUrl() );
+ } else {
+ $formInfo = $_REQUEST;
+ $formInfo['data'] = &$_REQUEST['edit'];
+ }
+}
+
+$gBitSystem->display( 'bitpackage:contact/form_DSInspection.tpl', 'Form: OD01 ' , array( 'display_mode' => 'form' ));
diff --git a/icons/pkg_contact.png b/icons/pkg_contact.png
index 123b448..123b448 100644..100755
--- a/icons/pkg_contact.png
+++ b/icons/pkg_contact.png
Binary files differ
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
diff --git a/includes/bit_setup_inc.php b/includes/bit_setup_inc.php
new file mode 100755
index 0000000..f7aa0fe
--- /dev/null
+++ b/includes/bit_setup_inc.php
@@ -0,0 +1,27 @@
+<?php
+/**
+ * @author lsces <lester@lsces.uk>
+ * @version $Revision$
+ * @package Contact
+ * @subpackage functions
+ */
+global $gBitSystem, $gBitSmarty;
+$pRegisterHash = [
+ 'package_name' => 'contact',
+ 'package_path' => dirname( dirname( __FILE__ ) ) . '/',
+ 'homeable' => false,
+];
+define( 'CONTACT_PKG_NAME', $pRegisterHash['package_name'] );
+define( 'CONTACT_PKG_URL', BIT_ROOT_URL . basename( $pRegisterHash['package_path'] ) . '/' );
+define( 'CONTACT_PKG_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/' );
+define( 'CONTACT_PKG_INCLUDE_PATH', BIT_ROOT_PATH . basename( $pRegisterHash['package_path'] ) . '/includes/');
+$gBitSystem->registerPackage( $pRegisterHash );
+
+if( $gBitSystem->isPackageActive( 'contact' ) ) {
+ $menuHash = [
+ 'package_name' => CONTACT_PKG_NAME,
+ 'index_url' => CONTACT_PKG_URL . 'index.php',
+ 'menu_template' => 'bitpackage:contact/menu_contact.tpl',
+ ];
+ $gBitSystem->registerAppMenu( $menuHash );
+}
diff --git a/Contact.php b/includes/classes/Contact.php
index 3e8f7dd..2401d9f 100644..100755
--- a/Contact.php
+++ b/includes/classes/Contact.php
@@ -12,11 +12,11 @@
/**
* required setup
*/
-require_once( CONTACT_PKG_PATH.'ContactXref.php' );
-require_once( CONTACT_PKG_PATH.'ContactType.php' );
-require_once( CONTACT_PKG_PATH.'ContactXrefType.php' );
-require_once( LIBERTY_PKG_PATH.'LibertyContent.php' ); // Contact base class
-require_once( CONTACT_PKG_PATH.'lib/phpcoord-2.3.php' );
+namespace Bitweaver\Contact;
+use Bitweaver\BitBase;
+use Bitweaver\BitDate;
+use Bitweaver\Liberty\LibertyContent; // Contact base class
+require_once CONTACT_PKG_PATH.'lib/phpcoord-2.3.php';
define( 'CONTACT_CONTENT_TYPE_GUID', 'contact' );
@@ -24,9 +24,9 @@ define( 'CONTACT_CONTENT_TYPE_GUID', 'contact' );
* @package contact
*/
class Contact extends LibertyContent {
- var $mParentId;
- var $mDate;
- var $mTypes;
+ public $mParentId;
+ public $mDate;
+ public $mTypes;
/**
* Constructor
@@ -35,8 +35,8 @@ class Contact extends LibertyContent {
* @param integer Contact Id identifer
* @param integer Base content_id identifier
*/
- function __construct( $pContactId = NULL, $pContentId = NULL ) {
- parent::__construct( $pContentId );
+ public function __construct( $pContactId = NULL, $pContentId = NULL ) {
+ parent::__construct();
$this->registerContentType( CONTACT_CONTENT_TYPE_GUID, array(
'content_type_guid' => CONTACT_CONTENT_TYPE_GUID,
'content_name' => 'Contact Entry',
@@ -68,11 +68,12 @@ class Contact extends LibertyContent {
*
* (Describe Contact object here )
*/
- function load( $pContentId = NULL, $pPluginParams = NULL ) {
+ public function load( $pContentId = NULL, $pPluginParams = NULL ) {
if ( $pContentId ) $this->mContentId = (int)$pContentId;
if( $this->verifyId( $this->mContentId ) ) {
$query = "select con.*, lc.*,
ap.*, xhA.`xkey_ext` AS house,
+ img.`xkey` AS client_gallery,
x00.`xkey_ext` as name, lc.`title` as organisation,
xhL.`xkey` as x_coordinate, xhL.`xkey_ext` as y_coordinate,
uue.`login` AS modifier_user, uue.`real_name` AS modifier_real_name,
@@ -81,6 +82,7 @@ class Contact extends LibertyContent {
LEFT JOIN `".BIT_DB_PREFIX."liberty_content` lc ON lc.content_id = con.content_id
LEFT JOIN `".BIT_DB_PREFIX."users_users` uue ON (uue.`user_id` = lc.`modifier_user_id`)
LEFT JOIN `".BIT_DB_PREFIX."users_users` uuc ON (uuc.`user_id` = lc.`user_id`)
+ LEFT JOIN `".BIT_DB_PREFIX."contact_xref` img ON img.`content_id` = con.`content_id` AND img.`source` = 'IMG'
LEFT JOIN `".BIT_DB_PREFIX."contact_xref` x00 ON x00.`content_id` = con.`content_id` AND x00.`source` = '$00'
LEFT JOIN `".BIT_DB_PREFIX."contact_xref` xhA ON xhA.`content_id` = con.`content_id` AND xhA.`source` = '#S' AND ( xhA.`end_date` IS NULL OR xhA.`end_date` > CURRENT_TIMESTAMP )
LEFT JOIN `".BIT_DB_PREFIX."contact_xref` xhL ON xhL.`content_id` = con.`content_id` AND xhL.`source` = '#L' AND ( xhL.`end_date` IS NULL OR xhL.`end_date` > CURRENT_TIMESTAMP )
@@ -96,15 +98,15 @@ class Contact extends LibertyContent {
$this->mContentId = (int)$result->fields['content_id'];
// $this->mParentId = (int)$result->fields['usn'];
$this->mContactName = $result->fields['title'];
- $this->mInfo['creator'] = (isset( $result->fields['creator_real_name'] ) ? $result->fields['creator_real_name'] : $result->fields['creator_user'] );
- $this->mInfo['editor'] = (isset( $result->fields['modifier_real_name'] ) ? $result->fields['modifier_real_name'] : $result->fields['modifier_user'] );
+ $this->mInfo['creator'] = $result->fields['creator_real_name'] ?? $result->fields['creator_user'];
+ $this->mInfo['editor'] = $result->fields['modifier_real_name'] ?? $result->fields['modifier_user'];
$this->mInfo['display_url'] = $this->getDisplayUrl();
$this->mInfo['organisation'] = trim($this->mInfo['organisation']);
- $name = explode( '|', $this->mInfo['name'] );
- if ( isset( $name[0] ) ) { $this->mInfo['prefix'] = $name[0]; } else { $this->mInfo['prefix'] = ''; }
- if ( isset( $name[1] ) ) { $this->mInfo['forename'] = $name[1]; } else { $this->mInfo['forename'] = ''; }
- if ( isset( $name[2] ) ) { $this->mInfo['surname'] = $name[2]; } else { $this->mInfo['surname'] = ''; }
- if ( isset( $name[3] ) ) { $this->mInfo['suffix'] = $name[3]; } else { $this->mInfo['suffix'] = ''; }
+ $name = explode( '|', $this->mInfo['name'] ?? '' );
+ $this->mInfo['prefix'] = $name[0] ?? '';
+ $this->mInfo['forename'] = $name[1] ?? '';
+ $this->mInfo['surname'] = $name[2] ?? '';
+ $this->mInfo['suffix'] = $name[3] ?? '';
$this->mInfo['name'] = $this->mInfo['prefix'];
$this->mInfo['name'] = trim($this->mInfo['name']).' '.$this->mInfo['forename'];
$this->mInfo['name'] = trim($this->mInfo['name']).' '.$this->mInfo['surname'];
@@ -112,7 +114,7 @@ class Contact extends LibertyContent {
$this->mInfo['name'] = trim($this->mInfo['name']);
if ( !$this->mInfo['x_coordinate'] and $this->mInfo['postcode'] and $this->mInfo['grideast'] <> '00000' ) {
- $os1 = new OSRef( $this->mInfo['grideast']*10, $this->mInfo['gridnorth']*10 );
+ $os1 = new \OSRef( $this->mInfo['grideast']*10, $this->mInfo['gridnorth']*10 );
$ll1 = $os1->toLatLng();
$this->mInfo['y_coordinate'] = $ll1->lat;
$this->mInfo['x_coordinate'] = $ll1->lng;
@@ -132,11 +134,11 @@ class Contact extends LibertyContent {
/**
* verify, clean up and prepare data to be stored
- * @param $pParamHash all information that is being stored. will update $pParamHash by reference with fixed array of itmes
+ * @param array $pParamHash all information that is being stored. will update $pParamHash by reference with fixed array of itmes
* @return bool TRUE on success, FALSE if store could not occur. If FALSE, $this->mErrors will have reason why
* @access private
**/
- function verify( &$pParamHash ) {
+ public function verify( &$pParamHash ): bool {
// make sure we're all loaded up if everything is valid
if( $this->isValid() && empty( $this->mInfo ) ) {
$this->load( TRUE );
@@ -166,17 +168,17 @@ class Contact extends LibertyContent {
$pParamHash['title'] = $pParamHash['organisation'];
$pParamHash['title'] = trim( $pParamHash['title'] );
$pParamHash['contact_store']['xkey'] = $pParamHash['xkey'];
- return( count( $this->mErrors ) == 0 );
+ return count( $this->mErrors ) == 0;
}
/**
* Store contact data
- * @param $pParamHash contains all data to store the contact
- * @param $pParamHash[title] title of the new contact
- * @param $pParamHash[edit] description of the contact
+ * @param array $pParamHash contains all data to store the contact
+ * @var $pParamHash[title] title of the new contact
+ * @var $pParamHash[edit] description of the contact
* @return bool TRUE on success, FALSE if store could not occur. If FALSE, $this->mErrors will have reason why
**/
- function store( &$pParamHash ) {
+ public function store( &$pParamHash ): bool {
if( $this->verify( $pParamHash ) ) {
// Start a transaction wrapping the whole insert into liberty
@@ -226,13 +228,13 @@ class Contact extends LibertyContent {
$this->mErrors['store'] = 'Failed to store this contact.';
}
}
- return( count( $this->mErrors ) == 0 );
+ return count( $this->mErrors ) == 0;
}
/**
* Delete content object and all related records
*/
- function expunge()
+ public function expunge(): bool
{
$ret = FALSE;
if ($this->isValid() ) {
@@ -252,7 +254,7 @@ class Contact extends LibertyContent {
/**
* Check if the current post can have comments attached to it
*/
- function isCommentable(){
+ public function isCommentable(){
global $gBitSystem;
return TRUE; // $gBitSystem->isFeatureActive( 'contact_post_comments' );
}
@@ -264,7 +266,7 @@ class Contact extends LibertyContent {
* @param array different possibilities depending on derived class
* @return string the link to display the page.
*/
- function getDisplayUrl( $pContentId=NULL ) {
+ public function getDisplayUrl( $pContentId=NULL ) {
global $gBitSystem;
if( empty( $pContentId ) ) {
$pContentId = $this->mContentId;
@@ -278,16 +280,14 @@ class Contact extends LibertyContent {
*
* @param string Not used ( generated locally )
* @param array mInfo style array of content information
- * @return the link to display the page.
+ * @return string the link to display the page.
*/
- function getDisplayLink( $pLinkText=NULL, $pMixed=NULL, $pAnchor=NULL ) {
- if ( $this->mContentId != $pMixed['content_id'] ) $this->load($aux['content_id']);
+ public function getDisplayLink( $pLinkText=NULL, $pMixed=NULL, $pAnchor=NULL ) {
+ if ( $this->mContentId != $pMixed['content_id'] ) $this->load($pMixed['content_id']);
- if (empty($this->mInfo['content_id']) ) {
- $ret = '<a href="'.$this->getDisplayUrl($pMixed['content_id']).'">'.$pMixed['title'].'</a>';
- } else {
- $ret = '<a href="'.$this->getDisplayUrl($pMixed['content_id']).'">'."Contact - ".$this->mInfo['title'].'</a>';
- }
+ $ret = ( empty( $this->mInfo['content_id'] ) )
+ ? '<a href="' . $this->getDisplayUrl( $pMixed['content_id'] ) . '">' . $pMixed['title'] . '</a>'
+ : '<a href="' . $this->getDisplayUrl( $pMixed['content_id'] ) . '">' . "Contact - " . $this->mInfo['title'] . '</a>';
return $ret;
}
@@ -297,7 +297,7 @@ class Contact extends LibertyContent {
* @param array mInfo style array of content information
* @return string Text for the title description
*/
- function getTitle( $pHash = NULL, $pDefault=TRUE ) {
+ public function getTitle( $pHash = NULL, $pDefault=TRUE ) {
$ret = NULL;
if( empty( $pHash ) ) {
$pHash = &$this->mInfo;
@@ -322,7 +322,7 @@ class Contact extends LibertyContent {
* @param integer
* @return array of contact entries
*/
- function getList( &$pParamHash ) {
+ public function getList( &$pParamHash ) {
global $gBitSystem, $gBitUser;
LibertyContent::prepGetList( $pParamHash );
@@ -460,7 +460,7 @@ class Contact extends LibertyContent {
*
* @return array List of contact type names from the contact mamager in alphabetical order
*/
- function getContactGroupList() {
+ public function getContactGroupList() {
global $gBitUser, $gBitSmarty;
$roles = array_keys($gBitUser->mRoles);
@@ -484,11 +484,11 @@ class Contact extends LibertyContent {
*
* @return array List of contact type names from the contact mamager in alphabetical order
*/
- function getContactSourceList() {
+ public function getContactSourceList() {
global $gBitUser, $gBitSmarty;
$roles = array_keys($gBitUser->mRoles);
- $bindVars = array();
+ $bindVars = [];
$bindVars = array_merge( $bindVars, $roles, array( $gBitUser->mUserId ) );
$query = "SELECT g.`cross_ref_title` AS `type_name`, g.`source` FROM `".BIT_DB_PREFIX."contact_xref_source` g
@@ -496,7 +496,7 @@ class Contact extends LibertyContent {
WHERE g.`xref_type` = 0 AND (g.`role_id` IN(". implode(',', array_fill(0, count($roles), '?')) ." ) OR purm.`user_id`=?)
ORDER BY g.`source`";
$result = $this->mDb->query( $query, $bindVars );
- $ret = array();
+ $ret = [];
$cnt = 0;
while ($res = $result->fetchRow()) {
$ret[$cnt]['source'] = $res["source"];
@@ -510,7 +510,7 @@ class Contact extends LibertyContent {
* @param $xrefGroup selects a single group of xref types
* @return array List of xref type names from the contact mamager in alphabetical order
*/
- function getXrefTypeList( $xrefGroup = 0, $xrefTemplate = NULL ) {
+ public function getXrefTypeList( $xrefGroup = 0, $xrefTemplate = NULL ) {
if ( $xrefTemplate ) {
$query = "SELECT s.`cross_ref_title` AS `type_name`, s.`source`, s.`template` FROM `".BIT_DB_PREFIX."contact_xref_source` s
WHERE s.`template` = '$xrefTemplate'
@@ -543,7 +543,7 @@ class Contact extends LibertyContent {
*
* @return array List of contact format templates names from the contact mamager in alphabetical order
*/
- function getXrefFormatList() {
+ public function getXrefFormatList() {
global $gBitUser, $gBitSmarty;
$roles = array_keys($gBitUser->mRoles);
@@ -568,7 +568,7 @@ class Contact extends LibertyContent {
* @param $contract selects a single type of contract to list
* @return array List of contact numbers in contract number order
*/
- function getContractList( $contract = 0 ) {
+ public function getContractList( $contract = 0 ) {
$query = "SELECT r.`xkey_ext` AS `contract`, r.`content_id`, lc.`title`, r.`xref`, r.`xkey`, r.`data`,
ap.*, xhA.`xkey_ext` AS house, r.xref,
CASE WHEN r.`xkey_ext` STARTING 'C' THEN CAST ( SUBSTRING ( r.`xkey_ext` FROM 2 FOR 4 ) AS INTEGER )
@@ -592,7 +592,7 @@ class Contact extends LibertyContent {
* getXrefList( &$pParamHash );
* Get list of xref records for this contact record
*/
- function getContactTypes() {
+ public function getContactTypes() {
return $this->mTypes->mContactType;
}
@@ -600,7 +600,7 @@ class Contact extends LibertyContent {
* getXrefList( &$pParamHash );
* Get list of xref records for this contact record
*/
- function loadContentTypeList() {
+ public function loadContentTypeList() {
if( $this->isValid() && empty( $this->mInfo['contact_types'] ) ) {
global $gBitUser;
@@ -628,7 +628,7 @@ class Contact extends LibertyContent {
* getXrefList( &$pParamHash );
* Get list of xref records for this contact record
*/
- function loadXrefList() {
+ public function loadXrefList() {
if( $this->isValid() && empty( $this->mInfo['xref'] ) ) {
global $gBitUser;
@@ -647,9 +647,11 @@ class Contact extends LibertyContent {
ELSE s.`cross_ref_title` || '-' || x.`xorder` END
AS source_title,
x.`xref`, x.`xkey`, x.`xkey_ext`, x.`data`,
- x.`start_date`, x.`end_date`
+ x.`start_date`, x.`end_date`, s.`template`,
+ pc.`add1` || ',' || pc.`add2` || ',' || pc.`add4` || ',' || pc.`town` as address
FROM `".BIT_DB_PREFIX."contact_xref` x
JOIN `".BIT_DB_PREFIX."contact_xref_source` s ON s.`source` = x.`source`
+ LEFT JOIN `".BIT_DB_PREFIX."address_postcode` pc ON pc.`postcode` = x.`xkey`
JOIN `".BIT_DB_PREFIX."contact_xref_type` t ON t.`xref_type` = s.`xref_type`
LEFT OUTER JOIN `".BIT_DB_PREFIX."users_roles_map` purm ON ( purm.`user_id`=".$gBitUser->mUserId." ) AND ( purm.`role_id`=s.`role_id` )
WHERE x.content_id = ? AND (s.`role_id` IN(". implode(',', array_fill(0, count($roles), '?')) ." ) OR purm.`user_id`=?)
@@ -669,8 +671,8 @@ class Contact extends LibertyContent {
* loadXref( &$pParamHash );
* find contact record that matches the supplied xref record
*/
- function loadXref( $pXrefId = NULL ) {
- if( @BitBase::verifyId( $pXrefId ) ) {
+ public function loadXref( $pXrefId = NULL ) {
+ if( BitBase::verifyId( $pXrefId ) ) {
$xref = new ContactXref( $pXrefId );
if( $xref->mContentId ) {
$this->load( $xref->mContentId );
@@ -685,7 +687,7 @@ class Contact extends LibertyContent {
* storeXref( &$pParamHash );
* store or update xref records for this contact record
*/
- function storeXref( &$pParamHash ) {
+ public function storeXref( &$pParamHash ) {
$xref = new ContactXref( isset($pParamHash['xref_id']) ? $pParamHash['xref_id'] : NULL );
if ( $xref->store( $pParamHash ) ) {
$this->mInfo['xref_title'] = $xref->mContentId;
@@ -701,7 +703,7 @@ class Contact extends LibertyContent {
* stepXref( &$pParamHash );
* find contact record that matches the supplied xref record
*/
- function stepXref( &$pParamHash ) {
+ public function stepXref( &$pParamHash ) {
$xref = new ContactXref( $pParamHash['xref_id'] );
if ( $xref->stepXref( $pParamHash ) ) {
$this->mInfo['xref_title'] = $xref->mContentId;
@@ -717,7 +719,7 @@ class Contact extends LibertyContent {
* Get list of client records for this contact record
* This is used to list related contact records such as contacts handled by a call center or alarm maintainer
*/
- function loadClientList() {
+ public function loadClientList() {
if( $this->isValid() ) {
global $gBitUser;
@@ -752,7 +754,7 @@ class Contact extends LibertyContent {
* getAddressList( &$pParamHash );
* Get list of address records for this contact record
*/
- function loadAddressList() {
+ public function loadAddressList() {
if( $this->isValid() && empty( $this->mInfo['xref'] ) ) {
global $gBitUser;
@@ -784,7 +786,7 @@ class Contact extends LibertyContent {
while( $res = $result->fetchRow() ) {
if ( $res['grideast'] and $res['grideast'] <> '00000' ) {
- $os1 = new OSRef( $res['grideast']*10, $res['gridnorth']*10 );
+ $os1 = new \OSRef( $res['grideast']*10, $res['gridnorth']*10 );
$ll1 = $os1->toLatLng();
$res['x_coordinate'] = $ll1->lng;
$res['y_coordinate'] = $ll1->lat;
@@ -796,34 +798,4 @@ class Contact extends LibertyContent {
}
}
}
-
- /**
- * ContactRecordLoad( $data );
- * simple csv contact list import
- * Uncomment to enable
- */
-// require( CONTENT_PKG_PATH.'import/ImportContact.php');
-
- /**
- * SageRecordLoad( $data );
- * sage csv data import
- * Uncomment to enable
- */
-// require( CONTENT_PKG_PATH.'import/ImportSage.php');
-
- /**
- * PhxRecordLoad( $data );
- * phoenix security csv data import
- * Uncomment to enable
- */
-// include( CONTENT_PKG_PATH.'import/ImportPhx2.php');
-
- /**
- * wandeRecordLoad( $data );
- * wande data file import
- * Uncomment to enable
- */
-// include( CONTENT_PKG_PATH.'import/ImportWande.php');
-
-}
-?>
+} \ No newline at end of file
diff --git a/ContactType.php b/includes/classes/ContactType.php
index 15df298..88a0823 100644..100755
--- a/ContactType.php
+++ b/includes/classes/ContactType.php
@@ -11,16 +11,16 @@
/**
* Required setup
*/
-global $gBitSystem;
-require_once( KERNEL_PKG_PATH."BitBase.php" );
+namespace Bitweaver\Contact;
+use Bitweaver\BitBase;
/**
* @package contact
*/
class ContactType extends BitBase {
- var $mContactType;
+ public $mContactType;
- function __construct() {
+ public function __construct() {
parent::__construct();
}
@@ -28,11 +28,11 @@ class ContactType extends BitBase {
* setup()
* Setup the contact types for use in the content filter.
*/
- function setup() {
+ public function setup() {
global $gBitUser, $gBitSmarty;
$roles = array_keys($gBitUser->mRoles);
- $bindVars = array();
+ $bindVars = [];
$bindVars = array_merge( $bindVars, $roles, array( $gBitUser->mUserId ) );
$sql = "SELECT r.`source`, r.`cross_ref_title`
@@ -48,14 +48,14 @@ class ContactType extends BitBase {
}
// asort($this->mContactType);
- $gBitSmarty->assignByRef( 'contContactTypes', $this->mContactType );
+ $gBitSmarty->assign( 'contContactTypes', $this->mContactType );
}
/**
* processRequestHash(&$pRequest, &$pStore)
* Build contact_type settins hash for the session
*/
- function processRequestHash(&$pRequest, &$pStore) {
+ public function processRequestHash(&$pRequest, &$pStore) {
global $gBitUser;
if( !empty( $pRequest["contact_type_guid"] ) ) {
if( $gBitUser->isRegistered() ) {
@@ -65,9 +65,9 @@ class ContactType extends BitBase {
} elseif( !isset( $pStore['content_type_guid'] ) && $gBitUser->getPreference( 'contact_default_guids' ) && $gBitUser->isRegistered() ) {
$pStore['contact_type_guid'] = unserialize( $gBitUser->getPreference( 'contact_default_guids' ) );
} elseif( !isset( $pStore['content_type_guid'] ) ) {
- $pStore['contact_type_guid'] = array();
+ $pStore['contact_type_guid'] = [];
} elseif( isset( $pRequest["refresh"] ) && !isset( $pRequest["contact_type_guid"] ) ) {
- $pStore['contact_type_guid'] = array();
+ $pStore['contact_type_guid'] = [];
}
}
@@ -75,7 +75,7 @@ class ContactType extends BitBase {
global $gBitSystem;
$where = '';
- $bindVars = array();
+ $bindVars = [];
if( !empty( $pOptionHash['active_role'] ) ) {
$where = " WHERE cxt.`role_id` = ? ";
$bindVars[] = $pOptionHash['active_role'];
@@ -91,7 +91,7 @@ class ContactType extends BitBase {
$result = $gBitSystem->mDb->query( $query, $bindVars );
- $ret = array();
+ $ret = [];
while( $res = $result->fetchRow() ) {
$res["num_types"] = $gBitSystem->mDb->getOne( "SELECT COUNT(*) FROM `".BIT_DB_PREFIX."contact_xref_source` WHERE `xref_type`= ?", array( $res["xref_type"] ) );
@@ -101,6 +101,4 @@ class ContactType extends BitBase {
return $ret;
}
-
}
-?>
diff --git a/ContactXref.php b/includes/classes/ContactXref.php
index 3d35bb6..6a4184b 100644..100755
--- a/ContactXref.php
+++ b/includes/classes/ContactXref.php
@@ -11,20 +11,21 @@
/**
* Required setup
*/
-global $gBitSystem;
-require_once( CONTACT_PKG_PATH.'ContactXrefType.php' );
+namespace Bitweaver\Contact;
+use Bitweaver\BitBase;
+use Bitweaver\BitDate;
/**
* @package contact
*/
class ContactXref extends BitBase {
- var $mType;
- var $mSource;
- var $mXrefId;
- var $mContentId;
- var $mDate;
+ public $mType;
+ public $mSource;
+ public $mXrefId;
+ public $mContentId;
+ public $mDate;
- function __construct( $iXrefId = NULL ) {
+ public function __construct( $iXrefId = NULL ) {
$this->mXrefId = NULL;
$this->mSource = NULL;
parent::__construct();
@@ -37,12 +38,12 @@ class ContactXref extends BitBase {
$offset = $this->mDate->get_display_offset();
}
- function isValid() {
- return ($this->verifyId($this->mXrefId));
+ public function isValid() {
+ return $this->verifyId( $this->mXrefId );
}
- function load( $pXref_id = NULL ) {
- if( @BitBase::verifyId( $pXref_id ) ) {
+ public function load( $pXref_id = NULL ) {
+ if( BitBase::verifyId( $pXref_id ) ) {
$sql = "SELECT x.*, CASE
WHEN x.`xorder` = 0 THEN s.`cross_ref_title`
ELSE s.`cross_ref_title` || '-' || x.`xorder` END
@@ -68,21 +69,23 @@ class ContactXref extends BitBase {
}
}
- function verify( &$pParamHash ) {
+ public function verify( &$pParamHash ) {
// if ( $this->isValid() ) {
// Validate the (optional) xref_id parameter
- if (@$this->verifyId($pParamHash['xref_id'])) {
- $pParamHash['xref_id'] = (int)$pParamHash['xref_id'];
- } else {
- $pParamHash['xref_id'] = NULL;
- }
+ $pParamHash['xref_id'] = ( @$this->verifyId( $pParamHash['xref_id'] ) ) ? (int) $pParamHash['xref_id'] : null;
+
+ if ( isset( $pParamHash['content_id'] )) {
+ $pParamHash['xref_store']['content_id'] = $pParamHash['content_id'];
+ }
+
+ if ( isset( $pParamHash['source'] )) {
+ $pParamHash['xref_store']['source'] = $pParamHash['source'];
+ }
+
+ $pParamHash['xref_store']['xorder'] = 0;
if ( isset ( $pParamHash['fAddXref'] ) ) {
- if ( isset( $pParamHash['Array_xref_type_list'] )) {
- $pParamHash['xref_store']['source'] = $pParamHash['Array_xref_type_list']['Array.source'];
- } else {
- $pParamHash['xref_store']['source'] = $pParamHash['source'];
- }
+ $pParamHash['xref_store']['source'] = isset( $pParamHash['Array_xref_type_list'] ) ? $pParamHash['Array_xref_type_list']['Array.source'] : $pParamHash['source'];
$pParamHash['xref_store']['content_id'] = $pParamHash['content_id'];
$sql = "SELECT x.`multi` FROM `".BIT_DB_PREFIX."contact_xref_source` x WHERE x.`source` = ?";
$next = $this->mDb->getOne( $sql, array( $pParamHash['xref_store']['source'] ) );
@@ -165,10 +168,10 @@ class ContactXref extends BitBase {
$pParamHash['xref_store']['end_date'] = '';
}
// }
- return(count($this->mErrors) == 0);
+ return count( $this->mErrors ) == 0;
}
- function store( &$pParamHash = NULL ) {
+ public function store( &$pParamHash = NULL ) {
if( $this->verify( $pParamHash ) ) {
$table = BIT_DB_PREFIX."contact_xref";
@@ -190,22 +193,25 @@ class ContactXref extends BitBase {
}
}
- function stepXref( &$pParamHash = NULL ) {
+ public function stepXref( &$pParamHash = NULL ) {
if ( isset($pParamHash["expunge"]) ) {
- if ( $pParamHash["expunge"] == 2 ) {
- $pParamHash['end_date'] = $this->mDb->NOW();
- $this->store( $pParamHash );
- unset($pParamHash['xref_id']);
- $pParamHash['fStepXref'] = 1;
- } else if ( $pParamHash["expunge"] == 1 ) {
- $pParamHash['end_date'] = $this->mDb->NOW();
- } else {
- $pParamHash['ignore_end_date'] = 'on';
+ switch ($pParamHash["expunge"]) {
+ case 2:
+ $pParamHash['end_date'] = $this->mDb->NOW();
+ $this->store( $pParamHash );
+ unset( $pParamHash['xref_id'] );
+ $pParamHash['fStepXref'] = 1;
+ break;
+ case 1:
+ $pParamHash['end_date'] = $this->mDb->NOW();
+ break;
+ default:
+ $pParamHash['ignore_end_date'] = 'on';
+ break;
}
}
$this->store( $pParamHash );
return true;
}
-}
-?>
+} \ No newline at end of file
diff --git a/ContactXrefType.php b/includes/classes/ContactXrefType.php
index 49b0404..b87bfe9 100644..100755
--- a/ContactXrefType.php
+++ b/includes/classes/ContactXrefType.php
@@ -11,15 +11,15 @@
/**
* Required setup
*/
-global $gBitSystem;
-require_once( KERNEL_PKG_PATH."BitBase.php" );
+namespace Bitweaver\Contact;
+use Bitweaver\BitBase;
/**
* @package contact
*/
class ContactXrefType extends BitBase {
- function __construct() {
+ public function __construct() {
parent::__construct();
}
@@ -44,7 +44,7 @@ class ContactXrefType extends BitBase {
$result = $gBitSystem->mDb->query( $query, $bindVars );
- $ret = array();
+ $ret = [];
while( $res = $result->fetchRow() ) {
$res["num_entries"] = $gBitSystem->mDb->getOne( "SELECT COUNT(*) FROM `".BIT_DB_PREFIX."contact_xref` WHERE `source`= ?", array( $res["source"] ) );
@@ -54,6 +54,4 @@ class ContactXrefType extends BitBase {
return $ret;
}
-
-}
-?>
+} \ No newline at end of file
diff --git a/lookup_contact_inc.php b/includes/lookup_contact_inc.php
index 625f566..b159407 100644..100755
--- a/lookup_contact_inc.php
+++ b/includes/lookup_contact_inc.php
@@ -8,13 +8,13 @@
/**
* Initialization
*/
-require_once( CONTACT_PKG_PATH.'Contact.php');
+use Bitweaver\BitBase;
+use Bitweaver\Contact\Contact;
//require_once( TASKS_PKG_PATH.'Tasks.php');
-require_once( LIBERTY_PKG_PATH.'lookup_content_inc.php' );
- // if we already have a gContent, we assume someone else created it for us, and has properly loaded everything up.
+// if we already have a gContent, we assume someone else created it for us, and has properly loaded everything up.
if( empty( $gContent ) || !is_object( $gContent ) ) {
- if( @BitBase::verifyId( $_REQUEST['content_id'] ) ) {
+ if( BitBase::verifyId( $_REQUEST['content_id'] ?? 0 ) ) {
$gContent = new Contact( NULL, $_REQUEST['content_id'] );
$gContent->load();
} else {
@@ -28,7 +28,6 @@ require_once( LIBERTY_PKG_PATH.'lookup_content_inc.php' );
if( is_object( $gContent ) ) {
$gTask = new Tasks( NULL, $_REQUEST['content_id'] );
$gTask->mInfo['tasks'] = $gTask->getList( $_REQUEST );
- $gBitSmarty->assignByRef( 'taskInfo', $gTask->mInfo );
+ $gBitSmarty->assign( 'taskInfo', $gTask->mInfo );
}
*/
-?>
diff --git a/includes/lookup_contact_xref_type_inc.php b/includes/lookup_contact_xref_type_inc.php
new file mode 100755
index 0000000..27db728
--- /dev/null
+++ b/includes/lookup_contact_xref_type_inc.php
@@ -0,0 +1,25 @@
+<?php
+/**
+ * @version $Header$
+ * @package contact
+ * @subpackage functions
+ */
+
+/**
+ * Initialization
+ */
+global $gContent;
+use Bitweaver\Contact\Contact;
+use Bitweaver\Contact\ContactXref;
+
+// if we already have a gContent, we assume someone else created it for us, and has properly loaded everything up.
+if( empty( $gContent ) || !is_object( $gContent ) ) {
+ if (!empty($_REQUEST['xref_id']) && is_numeric($_REQUEST['xref_id'])) {
+ $gContent = new ContactXref( $_REQUEST['xref_id'] );
+ $gContent = new ContactXref( $_REQUEST['xref_id'] );
+ } else {
+ $gContent = new Contact();
+ }
+
+ $gBitSmarty->assign( 'gContent', $gContent );
+}
diff --git a/index.php b/index.php
index 4aacd48..aa59937 100644..100755
--- a/index.php
+++ b/index.php
@@ -13,28 +13,27 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
+require_once '../kernel/includes/setup_inc.php';
$gBitSystem->verifyPackage( 'contact' );
$gBitSystem->verifyPermission( 'p_contact_view' );
-include_once( CONTACT_PKG_PATH.'lookup_contact_inc.php' );
+include_once CONTACT_PKG_INCLUDE_PATH . 'lookup_contact_inc.php';
-if ( !$gContent->mContentId ) {
- header ("location: ".CONTACT_PKG_URL."list.php");
+if (!$gContent->mContentId) {
+ header( "location: " . CONTACT_PKG_URL . "list.php" );
die;
}
-if( $gContent->isCommentable() ) {
+if ($gContent->isCommentable()) {
$commentsParentId = $gContent->mContentId;
- $comments_vars = Array('contact');
- $comments_prefix_var='contact:';
- $comments_object_var='contact';
- $comments_return_url = $_SERVER['PHP_SELF']."?content_id=".$gContent->mContentId;
- include_once( LIBERTY_PKG_PATH.'comments_inc.php' );
+ $comments_vars = [ 'contact' ];
+ $comments_prefix_var = 'contact:';
+ $comments_object_var = 'contact';
+ $comments_return_url = $_SERVER['PHP_SELF'] . "?content_id=" . $gContent->mContentId;
+ include_once LIBERTY_PKG_PATH . 'comments_inc.php';
}
- $gContent->mInfo['type'] = $gContent->getContactGroupList();
+$gContent->mInfo['type'] = $gContent->getContactGroupList();
$gBitSystem->setBrowserTitle("Contact List Item");
$gBitSystem->display( 'bitpackage:contact/show_contact.tpl', NULL, array( 'display_mode' => 'display' ));
-?>
diff --git a/lib/phpcoord-2.3.php b/lib/phpcoord-2.3.php
index 494d62d..ae5b4d6 100755
--- a/lib/phpcoord-2.3.php
+++ b/lib/phpcoord-2.3.php
@@ -1,7 +1,13 @@
<?php
- //-------------------------------------------------------------------------- // PHPcoord
- // phpcoord.php // // (c) 2005 Jonathan Stott // // Created on 11-Aug-2005 //
+ //--------------------------------------------------------------------------
+ // PHPcoord
+ // phpcoord.php
+ //
+ // (c) 2005 Jonathan Stott
+ //
+ // Created on 11-Aug-2005
+ //
// 2.3 - 24 Aug 2006
// - Changed OSRef->toSixFigureString() so that the eastings and northings
// are rounded rather than floored.
@@ -13,749 +19,748 @@
// 2.0 - 21 Dec 2005
// - Completely different object design - conversion functions now through
// objects rather than static functions
- // - Updated comments and documentation // 1.1 - 11 Sep 2005
+ // - Updated comments and documentation
+ // 1.1 - 11 Sep 2005
// - Added OSGB36/WGS84 data conversions
- // 1.0 - 11 Aug 2005 // - Initial version //--------------------------------------------------------------------------
+ // 1.0 - 11 Aug 2005
+ // - Initial version
+ //--------------------------------------------------------------------------
// ================================================================== LatLng
- class LatLng {
+class LatLng {
- var $lat;
- var $lng;
+ public $lat;
+ public $lng;
- /**
- * Create a new LatLng object from the given latitude and longitude
- *
- * @param lat latitude
- * @param lng longitude
- */
- function __construct($lat, $lng) {
- $this->lat = $lat;
- $this->lng = $lng;
- }
+ /**
+ * Create a new LatLng object from the given latitude and longitude
+ *
+ * @param float|integer lat latitude
+ * @param float|integer lng longitude
+ */
+ public function __construct($lat, $lng) {
+ $this->lat = $lat;
+ $this->lng = $lng;
+ }
- /**
- * Return a string representation of this LatLng object
- *
- * @return a string representation of this LatLng object
- */
- function toString() {
- return "(" . $this->lat . ", " . $this->lng . ")";
- }
-
-
- /**
- * Calculate the surface distance between this LatLng object and the one
- * passed in as a parameter.
- *
- * @param to a LatLng object to measure the surface distance to
- * @return the surface distance
- */
- function distance($to) {
- $er = 6366.707;
+ /**
+ * Return a string representation of this LatLng object
+ *
+ * @return string representation of this LatLng object
+ */
+ public function toString() {
+ return "({$this->lat}, {$this->lng})";
+ }
- $latFrom = deg2rad($this->lat);
- $latTo = deg2rad($to->lat);
- $lngFrom = deg2rad($this->lng);
- $lngTo = deg2rad($to->lng);
- $x1 = $er * cos($lngFrom) * sin($latFrom);
- $y1 = $er * sin($lngFrom) * sin($latFrom);
- $z1 = $er * cos($latFrom);
+ /**
+ * Calculate the surface distance between this LatLng object and the one
+ * passed in as a parameter.
+ *
+ * @param array $to a LatLng object to measure the surface distance to
+ * @return float|integer the surface distance
+ */
+ public function distance($to) {
+ $er = 6366.707;
- $x2 = $er * cos($lngTo) * sin($latTo);
- $y2 = $er * sin($lngTo) * sin($latTo);
- $z2 = $er * cos($latTo);
+ $latFrom = deg2rad($this->lat);
+ $latTo = deg2rad($to['lat']);
+ $lngFrom = deg2rad($this->lng);
+ $lngTo = deg2rad($to['lng']);
- $d = acos(sin($latFrom)*sin($latTo) + cos($latFrom)*cos($latTo)*cos($lngTo-$lngFrom)) * $er;
-
- return $d;
- }
+ $x1 = $er * cos($lngFrom) * sin($latFrom);
+ $y1 = $er * sin($lngFrom) * sin($latFrom);
+ $z1 = $er * cos($latFrom);
-
- /**
- * Convert this LatLng object from OSGB36 datum to WGS84 datum.
- */
- function OSGB36ToWGS84() {
- $airy1830 = new RefEll(6377563.396, 6356256.909);
- $a = $airy1830->maj;
- $b = $airy1830->min;
- $eSquared = $airy1830->ecc;
- $phi = deg2rad($this->lat);
- $lambda = deg2rad($this->lng);
- $v = $a / (sqrt(1 - $eSquared * sinSquared($phi)));
- $H = 0; // height
- $x = ($v + $H) * cos($phi) * cos($lambda);
- $y = ($v + $H) * cos($phi) * sin($lambda);
- $z = ((1 - $eSquared) * $v + $H) * sin($phi);
+ $x2 = $er * cos($lngTo) * sin($latTo);
+ $y2 = $er * sin($lngTo) * sin($latTo);
+ $z2 = $er * cos($latTo);
- $tx = 446.448;
- $ty = -124.157;
- $tz = 542.060;
- $s = -0.0000204894;
- $rx = deg2rad( 0.00004172222);
- $ry = deg2rad( 0.00006861111);
- $rz = deg2rad( 0.00023391666);
+ $d = acos(sin($latFrom)*sin($latTo) + cos($latFrom)*cos($latTo)*cos($lngTo-$lngFrom)) * $er;
+
+ return $d;
+ }
- $xB = $tx + ($x * (1 + $s)) + (-$rx * $y) + ($ry * $z);
- $yB = $ty + ($rz * $x) + ($y * (1 + $s)) + (-$rx * $z);
- $zB = $tz + (-$ry * $x) + ($rx * $y) + ($z * (1 + $s));
- $wgs84 = new RefEll(6378137.000, 6356752.3141);
- $a = $wgs84->maj;
- $b = $wgs84->min;
- $eSquared = $wgs84->ecc;
+ /**
+ * Convert this LatLng object from OSGB36 datum to WGS84 datum.
+ */
+ public function OSGB36ToWGS84() {
+ $airy1830 = new RefEll(6377563.396, 6356256.909);
+ $a = $airy1830->maj;
+ $b = $airy1830->min;
+ $eSquared = $airy1830->ecc;
+ $phi = deg2rad($this->lat);
+ $lambda = deg2rad($this->lng);
+ $v = $a / (sqrt(1 - $eSquared * sinSquared($phi)));
+ $H = 0; // height
+ $x = ($v + $H) * cos($phi) * cos($lambda);
+ $y = ($v + $H) * cos($phi) * sin($lambda);
+ $z = ((1 - $eSquared) * $v + $H) * sin($phi);
- $lambdaB = rad2deg(atan($yB / $xB));
- $p = sqrt(($xB * $xB) + ($yB * $yB));
- $phiN = atan($zB / ($p * (1 - $eSquared)));
- for ($i = 1; $i < 10; $i++) {
- $v = $a / (sqrt(1 - $eSquared * sinSquared($phiN)));
- $phiN1 = atan(($zB + ($eSquared * $v * sin($phiN))) / $p);
- $phiN = $phiN1;
- }
+ $tx = 446.448;
+ $ty = -124.157;
+ $tz = 542.060;
+ $s = -0.0000204894;
+ $rx = deg2rad( 0.00004172222);
+ $ry = deg2rad( 0.00006861111);
+ $rz = deg2rad( 0.00023391666);
- $phiB = rad2deg($phiN);
-
- $this->lat = $phiB;
- $this->lng = $lambdaB;
- }
-
-
- /**
- * Convert this LatLng object from WGS84 datum to OSGB36 datum.
- */
- function WGS84ToOSGB36() {
- $wgs84 = new RefEll(6378137.000, 6356752.3141);
- $a = $wgs84->maj;
- $b = $wgs84->min;
- $eSquared = $wgs84->ecc;
- $phi = deg2rad($this->lat);
- $lambda = deg2rad($this->lng);
- $v = $a / (sqrt(1 - $eSquared * sinSquared($phi)));
- $H = 0; // height
- $x = ($v + $H) * cos($phi) * cos($lambda);
- $y = ($v + $H) * cos($phi) * sin($lambda);
- $z = ((1 - $eSquared) * $v + $H) * sin($phi);
+ $xB = $tx + $x * ( 1 + $s ) + -$rx * $y + $ry * $z;
+ $yB = $ty + $rz * $x + $y * ( 1 + $s ) + -$rx * $z;
+ $zB = $tz + -$ry * $x + $rx * $y + $z * ( 1 + $s );
- $tx = -446.448;
- $ty = 124.157;
- $tz = -542.060;
- $s = 0.0000204894;
- $rx = deg2rad(-0.00004172222);
- $ry = deg2rad(-0.00006861111);
- $rz = deg2rad(-0.00023391666);
+ $wgs84 = new RefEll(6378137.000, 6356752.3141);
+ $a = $wgs84->maj;
+ $b = $wgs84->min;
+ $eSquared = $wgs84->ecc;
- $xB = $tx + ($x * (1 + $s)) + (-$rx * $y) + ($ry * $z);
- $yB = $ty + ($rz * $x) + ($y * (1 + $s)) + (-$rx * $z);
- $zB = $tz + (-$ry * $x) + ($rx * $y) + ($z * (1 + $s));
+ $lambdaB = rad2deg(atan($yB / $xB));
+ $p = sqrt( $xB * $xB + $yB * $yB );
+ $phiN = atan($zB / ($p * (1 - $eSquared)));
+ for ($i = 1; $i < 10; $i++) {
+ $v = $a / (sqrt(1 - $eSquared * sinSquared($phiN)));
+ $phiN1 = atan(($zB + $eSquared * $v * sin( $phiN )) / $p);
+ $phiN = $phiN1;
+ }
- $airy1830 = new RefEll(6377563.396, 6356256.909);
- $a = $airy1830->maj;
- $b = $airy1830->min;
- $eSquared = $airy1830->ecc;
+ $phiB = rad2deg($phiN);
+
+ $this->lat = $phiB;
+ $this->lng = $lambdaB;
+ }
- $lambdaB = rad2deg(atan($yB / $xB));
- $p = sqrt(($xB * $xB) + ($yB * $yB));
- $phiN = atan($zB / ($p * (1 - $eSquared)));
- for ($i = 1; $i < 10; $i++) {
- $v = $a / (sqrt(1 - $eSquared * sinSquared($phiN)));
- $phiN1 = atan(($zB + ($eSquared * $v * sin($phiN))) / $p);
- $phiN = $phiN1;
- }
-
- $phiB = rad2deg($phiN);
-
- $this->lat = $phiB;
- $this->lng = $lambdaB;
- }
-
-
- /**
- * Convert this LatLng object into an OSGB grid reference. Note that this
- * function does not take into account the bounds of the OSGB grid -
- * beyond the bounds of the OSGB grid, the resulting OSRef object has no
- * meaning
- *
- * @return the converted OSGB grid reference
- */
- function toOSRef() {
- $airy1830 = new RefEll(6377563.396, 6356256.909);
- $OSGB_F0 = 0.9996012717;
- $N0 = -100000.0;
- $E0 = 400000.0;
- $phi0 = deg2rad(49.0);
- $lambda0 = deg2rad(-2.0);
- $a = $airy1830->maj;
- $b = $airy1830->min;
- $eSquared = $airy1830->ecc;
- $phi = deg2rad($this->lat);
- $lambda = deg2rad($this->lng);
- $E = 0.0;
- $N = 0.0;
- $n = ($a - $b) / ($a + $b);
- $v = $a * $OSGB_F0 * pow(1.0 - $eSquared * sinSquared($phi), -0.5);
- $rho =
- $a * $OSGB_F0 * (1.0 - $eSquared) * pow(1.0 - $eSquared * sinSquared($phi), -1.5);
- $etaSquared = ($v / $rho) - 1.0;
- $M =
- ($b * $OSGB_F0)
- * (((1 + $n + ((5.0 / 4.0) * $n * $n) + ((5.0 / 4.0) * $n * $n * $n))
- * ($phi - $phi0))
- - (((3 * $n) + (3 * $n * $n) + ((21.0 / 8.0) * $n * $n * $n))
- * sin($phi - $phi0)
- * cos($phi + $phi0))
- + ((((15.0 / 8.0) * $n * $n) + ((15.0 / 8.0) * $n * $n * $n))
- * sin(2.0 * ($phi - $phi0))
- * cos(2.0 * ($phi + $phi0)))
- - (((35.0 / 24.0) * $n * $n * $n)
- * sin(3.0 * ($phi - $phi0))
- * cos(3.0 * ($phi + $phi0))));
- $I = $M + $N0;
- $II = ($v / 2.0) * sin($phi) * cos($phi);
- $III =
- ($v / 24.0)
- * sin($phi)
- * pow(cos($phi), 3.0)
- * (5.0 - tanSquared($phi) + (9.0 * $etaSquared));
- $IIIA =
- ($v / 720.0)
- * sin($phi)
- * pow(cos($phi), 5.0)
- * (61.0 - (58.0 * tanSquared($phi)) + pow(tan($phi), 4.0));
- $IV = $v * cos($phi);
- $V = ($v / 6.0) * pow(cos($phi), 3.0) * (($v / $rho) - tanSquared($phi));
- $VI =
- ($v / 120.0)
- * pow(cos($phi), 5.0)
- * (5.0
- - (18.0 * tanSquared($phi))
- + (pow(tan($phi), 4.0))
- + (14 * $etaSquared)
- - (58 * tanSquared($phi) * $etaSquared));
- $N =
- $I
- + ($II * pow($lambda - $lambda0, 2.0))
- + ($III * pow($lambda - $lambda0, 4.0))
- + ($IIIA * pow($lambda - $lambda0, 6.0));
- $E =
- $E0
- + ($IV * ($lambda - $lambda0))
- + ($V * pow($lambda - $lambda0, 3.0))
- + ($VI * pow($lambda - $lambda0, 5.0));
+ /**
+ * Convert this LatLng object from WGS84 datum to OSGB36 datum.
+ */
+ function WGS84ToOSGB36() {
+ $wgs84 = new RefEll(6378137.000, 6356752.3141);
+ $a = $wgs84->maj;
+ $b = $wgs84->min;
+ $eSquared = $wgs84->ecc;
+ $phi = deg2rad($this->lat);
+ $lambda = deg2rad($this->lng);
+ $v = $a / (sqrt(1 - $eSquared * sinSquared($phi)));
+ $H = 0; // height
+ $x = ($v + $H) * cos($phi) * cos($lambda);
+ $y = ($v + $H) * cos($phi) * sin($lambda);
+ $z = ((1 - $eSquared) * $v + $H) * sin($phi);
- return new OSRef($E, $N);
- }
-
-
- /**
- * Convert a latitude and longitude to an UTM reference
- *
- * @return the converted UTM reference
- */
- function toUTMRef() {
- $wgs84 = new RefEll(6378137, 6356752.314);
- $UTM_F0 = 0.9996;
- $a = $wgs84->maj;
- $eSquared = $wgs84->ecc;
- $longitude = $this->lng;
- $latitude = $this->lat;
+ $tx = -446.448;
+ $ty = 124.157;
+ $tz = -542.060;
+ $s = 0.0000204894;
+ $rx = deg2rad(-0.00004172222);
+ $ry = deg2rad(-0.00006861111);
+ $rz = deg2rad(-0.00023391666);
- $latitudeRad = $latitude * (pi() / 180.0);
- $longitudeRad = $longitude * (pi() / 180.0);
- $longitudeZone = (int) (($longitude + 180.0) / 6.0) + 1;
+ $xB = $tx + $x * ( 1 + $s ) + -$rx * $y + $ry * $z;
+ $yB = $ty + $rz * $x + $y * ( 1 + $s ) + -$rx * $z;
+ $zB = $tz + -$ry * $x + $rx * $y + $z * ( 1 + $s );
- // Special zone for Norway
- if ($latitude >= 56.0
- && $latitude < 64.0
- && $longitude >= 3.0
- && $longitude < 12.0) {
- $longitudeZone = 32;
- }
+ $airy1830 = new RefEll(6377563.396, 6356256.909);
+ $a = $airy1830->maj;
+ $b = $airy1830->min;
+ $eSquared = $airy1830->ecc;
- // Special zones for Svalbard if ($latitude >= 72.0 && $latitude < 84.0) {
- if ($longitude >= 0.0 && $longitude < 9.0) {
- $longitudeZone = 31;
- } else if ($longitude >= 9.0 && $longitude < 21.0) {
- $longitudeZone = 33;
- } else if ($longitude >= 21.0 && $longitude < 33.0) {
- $longitudeZone = 35;
- } else if ($longitude >= 33.0 && $longitude < 42.0) {
- $longitudeZone = 37;
- }
- }
+ $lambdaB = rad2deg(atan($yB / $xB));
+ $p = sqrt( $xB * $xB + $yB * $yB );
+ $phiN = atan($zB / ($p * (1 - $eSquared)));
+ for ($i = 1; $i < 10; $i++) {
+ $v = $a / (sqrt(1 - $eSquared * sinSquared($phiN)));
+ $phiN1 = atan(($zB + $eSquared * $v * sin( $phiN )) / $p);
+ $phiN = $phiN1;
+ }
- $longitudeOrigin = ($longitudeZone - 1) * 6 - 180 + 3;
- $longitudeOriginRad = $longitudeOrigin * (pi() / 180.0);
+ $phiB = rad2deg($phiN);
+
+ $this->lat = $phiB;
+ $this->lng = $lambdaB;
+ }
- $UTMZone = getUTMLatitudeZoneLetter($latitude);
+ /**
+ * Convert this LatLng object into an OSGB grid reference. Note that this
+ * function does not take into account the bounds of the OSGB grid -
+ * beyond the bounds of the OSGB grid, the resulting OSRef object has no
+ * meaning
+ *
+ * @return string the converted OSGB grid reference
+ */
+ public function toOSRef() {
+ $airy1830 = new RefEll(6377563.396, 6356256.909);
+ $OSGB_F0 = 0.9996012717;
+ $N0 = -100000.0;
+ $E0 = 400000.0;
+ $phi0 = deg2rad(49.0);
+ $lambda0 = deg2rad(-2.0);
+ $a = $airy1830->maj;
+ $b = $airy1830->min;
+ $eSquared = $airy1830->ecc;
+ $phi = deg2rad($this->lat);
+ $lambda = deg2rad($this->lng);
+ $E = 0.0;
+ $N = 0.0;
+ $n = ($a - $b) / ($a + $b);
+ $v = $a * $OSGB_F0 * pow(1.0 - $eSquared * sinSquared($phi), -0.5);
+ $rho =
+ $a * $OSGB_F0 * (1.0 - $eSquared) * pow(1.0 - $eSquared * sinSquared($phi), -1.5);
+ $etaSquared = $v / $rho - 1.0;
+ $M =
+ ($b * $OSGB_F0)
+ * ( ( 1 + $n + ( 5.0 / 4.0 ) * $n * $n + ( 5.0 / 4.0 ) * $n * $n * $n )
+ * ( $phi - $phi0 )
+ - ( 3 * $n + 3 * $n * $n + ( 21.0 / 8.0 ) * $n * $n * $n )
+ * sin( $phi - $phi0 )
+ * cos( $phi + $phi0 )
+ + ( ( 15.0 / 8.0 ) * $n * $n + ( 15.0 / 8.0 ) * $n * $n * $n )
+ * sin( 2.0 * ( $phi - $phi0 ) )
+ * cos( 2.0 * ( $phi + $phi0 ) )
+ - ( ( 35.0 / 24.0 ) * $n * $n * $n )
+ * sin( 3.0 * ( $phi - $phi0 ) )
+ * cos( 3.0 * ( $phi + $phi0 ) ));
+ $I = $M + $N0;
+ $II = ($v / 2.0) * sin($phi) * cos($phi);
+ $III =
+ ($v / 24.0)
+ * sin($phi)
+ * pow(cos($phi), 3.0)
+ * (5.0 - tanSquared($phi) + 9.0 * $etaSquared);
+ $IIIA =
+ ($v / 720.0)
+ * sin($phi)
+ * pow(cos($phi), 5.0)
+ * (61.0 - 58.0 * tanSquared( $phi ) + pow(tan($phi), 4.0));
+ $IV = $v * cos($phi);
+ $V = ($v / 6.0) * pow(cos($phi), 3.0) * ( $v / $rho - tanSquared($phi));
+ $VI =
+ ($v / 120.0)
+ * pow(cos($phi), 5.0)
+ * (5.0
+ - 18.0 * tanSquared( $phi )
+ + (pow(tan($phi), 4.0))
+ + 14 * $etaSquared
+ - 58 * tanSquared( $phi ) * $etaSquared);
- $ePrimeSquared = ($eSquared) / (1 - $eSquared);
+ $N =
+ $I
+ + $II * pow( $lambda - $lambda0, 2.0 )
+ + $III * pow( $lambda - $lambda0, 4.0 )
+ + $IIIA * pow( $lambda - $lambda0, 6.0 );
+ $E =
+ $E0
+ + $IV * ( $lambda - $lambda0 )
+ + $V * pow( $lambda - $lambda0, 3.0 )
+ + $VI * pow( $lambda - $lambda0, 5.0 );
- $n = $a / sqrt(1 - $eSquared * sin($latitudeRad) * sin($latitudeRad));
- $t = tan($latitudeRad) * tan($latitudeRad);
- $c = $ePrimeSquared * cos($latitudeRad) * cos($latitudeRad);
- $A = cos($latitudeRad) * ($longitudeRad - $longitudeOriginRad);
+ $osref = new OSRef($E, $N);
+ return $osref->toString();
+ }
- $M =
- $a
- * ((1
- - $eSquared / 4
- - 3 * $eSquared * $eSquared / 64
- - 5 * $eSquared * $eSquared * $eSquared / 256)
- * $latitudeRad
- - (3 * $eSquared / 8
- + 3 * $eSquared * $eSquared / 32
- + 45 * $eSquared * $eSquared * $eSquared / 1024)
- * sin(2 * $latitudeRad)
- + (15 * $eSquared * $eSquared / 256
- + 45 * $eSquared * $eSquared * $eSquared / 1024)
- * sin(4 * $latitudeRad)
- - (35 * $eSquared * $eSquared * $eSquared / 3072)
- * sin(6 * $latitudeRad));
- $UTMEasting =
- (double) ($UTM_F0
- * $n
- * ($A
- + (1 - $t + $c) * pow($A, 3.0) / 6
- + (5 - 18 * $t + $t * $t + 72 * $c - 58 * $ePrimeSquared)
- * pow($A, 5.0)
- / 120)
- + 500000.0);
+ /**
+ * Convert a latitude and longitude to an UTM reference
+ *
+ * @return string the converted UTM reference
+ */
+ public function toUTMRef() {
+ $wgs84 = new RefEll(6378137, 6356752.314);
+ $UTM_F0 = 0.9996;
+ $a = $wgs84->maj;
+ $eSquared = $wgs84->ecc;
+ $longitude = $this->lng;
+ $latitude = $this->lat;
- $UTMNorthing =
- (double) ($UTM_F0
- * ($M
- + $n
- * tan($latitudeRad)
- * ($A * $A / 2
- + (5 - $t + (9 * $c) + (4 * $c * $c)) * pow($A, 4.0) / 24
- + (61 - (58 * $t) + ($t * $t) + (600 * $c) - (330 * $ePrimeSquared))
- * pow($A, 6.0)
- / 720)));
+ $latitudeRad = $latitude * (pi() / 180.0);
+ $longitudeRad = $longitude * (pi() / 180.0);
+ $longitudeZone = (int) (($longitude + 180.0) / 6.0) + 1;
- // Adjust for the southern hemisphere if ($latitude < 0) {
- $UTMNorthing += 10000000.0;
- }
+ // Special zone for Norway
+ if ($latitude >= 56.0
+ && $latitude < 64.0
+ && $longitude >= 3.0
+ && $longitude < 12.0) {
+ $longitudeZone = 32;
+ }
- return new UTMRef($UTMEasting, $UTMNorthing, $UTMZone, $longitudeZone);
- }
- }
+ // Special zones for Svalbard
+ if ($latitude >= 72.0 && $latitude < 84.0) {
+ if ($longitude >= 0.0 && $longitude < 9.0) {
+ $longitudeZone = 31;
+ } else if ($longitude >= 9.0 && $longitude < 21.0) {
+ $longitudeZone = 33;
+ } else if ($longitude >= 21.0 && $longitude < 33.0) {
+ $longitudeZone = 35;
+ } else if ($longitude >= 33.0 && $longitude < 42.0) {
+ $longitudeZone = 37;
+ }
+ }
+ $longitudeOrigin = ($longitudeZone - 1) * 6 - 180 + 3;
+ $longitudeOriginRad = $longitudeOrigin * (pi() / 180.0);
- // =================================================================== OSRef
+ $UTMZone = getUTMLatitudeZoneLetter($latitude);
- // References given with OSRef are accurate to 1m.
- class OSRef {
+ $ePrimeSquared = $eSquared / (1 - $eSquared);
- var $easting;
- var $northing;
+ $n = $a / sqrt(1 - $eSquared * sin($latitudeRad) * sin($latitudeRad));
+ $t = tan($latitudeRad) * tan($latitudeRad);
+ $c = $ePrimeSquared * cos($latitudeRad) * cos($latitudeRad);
+ $A = cos($latitudeRad) * ($longitudeRad - $longitudeOriginRad);
+ $M =
+ $a
+ * ((1
+ - $eSquared / 4
+ - 3 * $eSquared * $eSquared / 64
+ - 5 * $eSquared * $eSquared * $eSquared / 256)
+ * $latitudeRad
+ - (3 * $eSquared / 8
+ + 3 * $eSquared * $eSquared / 32
+ + 45 * $eSquared * $eSquared * $eSquared / 1024)
+ * sin(2 * $latitudeRad)
+ + (15 * $eSquared * $eSquared / 256
+ + 45 * $eSquared * $eSquared * $eSquared / 1024)
+ * sin(4 * $latitudeRad)
+ - (35 * $eSquared * $eSquared * $eSquared / 3072)
+ * sin(6 * $latitudeRad));
- /**
- * Create a new OSRef object representing an OSGB grid reference. Note
- * that the parameters for this constructor require eastings and
- * northings with 1m accuracy and need to be absolute with respect to
- * the whole of the British Grid. For example, to create an OSRef
- * object from the six-figure grid reference TG514131, the easting would
- * be 651400 and the northing would be 313100.
- *
- * Grid references with accuracy greater than 1m can be represented
- * using floating point values for the easting and northing. For example,
- * a value representing an easting or northing accurate to 1mm would be
- * given as 651400.0001.
- *
- * @param easting the easting of the reference (with 1m accuracy)
- * @param northing the northing of the reference (with 1m accuracy)
- */
- function __construct($easting, $northing) {
- $this->easting = $easting;
- $this->northing = $northing;
- }
+ $UTMEasting =
+ (float) ($UTM_F0
+ * $n
+ * ($A
+ + (1 - $t + $c) * pow($A, 3.0) / 6
+ + (5 - 18 * $t + $t * $t + 72 * $c - 58 * $ePrimeSquared)
+ * pow($A, 5.0)
+ / 120)
+ + 500000.0);
+ $UTMNorthing =
+ (float) ($UTM_F0
+ * ($M
+ + $n
+ * tan($latitudeRad)
+ * ($A * $A / 2
+ + (5 - $t + 9 * $c + 4 * $c * $c ) * pow($A, 4.0) / 24
+ + (61 - 58 * $t + $t * $t + 600 * $c - 330 * $ePrimeSquared )
+ * pow($A, 6.0)
+ / 720)));
- /**
- * Convert this grid reference into a string showing the exact values
- * of the easting and northing.
- *
- * @return
- */
- function toString() {
- return "(" . $this->easting . ", " . $this->northing . ")";
- }
+ // Adjust for the southern hemisphere
+ if ($latitude < 0) {
+ $UTMNorthing += 10000000.0;
+ }
+ $utmref = new UTMRef($UTMEasting, $UTMNorthing, $UTMZone, $longitudeZone);
+ return $utmref->toString();
+ }
+}
- /**
- * Convert this grid reference into a string using a standard six-figure
- * grid reference including the two-character designation for the 100km
- * square. e.g. TG514131.
- *
- * @return
- */
- function toSixFigureString() {
- $hundredkmE = floor($this->easting / 100000);
- $hundredkmN = floor($this->northing / 100000);
- $firstLetter = "";
- if ($hundredkmN < 5) {
- if ($hundredkmE < 5) {
- $firstLetter = "S";
- } else {
- $firstLetter = "T";
- }
- } else if ($hundredkmN < 10) {
- if ($hundredkmE < 5) {
- $firstLetter = "N";
- } else {
- $firstLetter = "O";
- }
- } else {
- $firstLetter = "H";
- }
- $secondLetter = "";
- $index = 65 + ((4 - ($hundredkmN % 5)) * 5) + ($hundredkmE % 5);
- $ti = $index;
- if ($index >= 73) $index++;
- $secondLetter = chr($index);
+// =================================================================== OSRef
- $e = round(($this->easting - (100000 * $hundredkmE)) / 100);
- $n = round(($this->northing - (100000 * $hundredkmN)) / 100);
+// References given with OSRef are accurate to 1m.
+class OSRef {
- return sprintf("%s%s%03d%03d", $firstLetter, $secondLetter, $e, $n);
- }
+ public $easting;
+ public $northing;
- /**
- * Convert this grid reference into a latitude and longitude
- *
- * @return
- */
- function toLatLng() {
- $airy1830 = new RefEll(6377563.396, 6356256.909);
- $OSGB_F0 = 0.9996012717;
- $N0 = -100050.0;
- $E0 = 400110.0;
- $phi0 = deg2rad(49.0);
- $lambda0 = deg2rad(-2.0);
- $a = $airy1830->maj;
- $b = $airy1830->min;
- $eSquared = $airy1830->ecc;
- $phi = 0.0;
- $lambda = 0.0;
- $E = $this->easting;
- $N = $this->northing;
- $n = ($a - $b) / ($a + $b);
- $M = 0.0;
- $phiPrime = (($N - $N0) / ($a * $OSGB_F0)) + $phi0;
- do {
- $M =
- ($b * $OSGB_F0)
- * (((1 + $n + ((5.0 / 4.0) * $n * $n) + ((5.0 / 4.0) * $n * $n * $n))
- * ($phiPrime - $phi0))
- - (((3 * $n) + (3 * $n * $n) + ((21.0 / 8.0) * $n * $n * $n))
- * sin($phiPrime - $phi0)
- * cos($phiPrime + $phi0))
- + ((((15.0 / 8.0) * $n * $n) + ((15.0 / 8.0) * $n * $n * $n))
- * sin(2.0 * ($phiPrime - $phi0))
- * cos(2.0 * ($phiPrime + $phi0)))
- - (((35.0 / 24.0) * $n * $n * $n)
- * sin(3.0 * ($phiPrime - $phi0))
- * cos(3.0 * ($phiPrime + $phi0))));
- $phiPrime += ($N - $N0 - $M) / ($a * $OSGB_F0);
- } while (($N - $N0 - $M) >= 0.001);
- $v = $a * $OSGB_F0 * pow(1.0 - $eSquared * sinSquared($phiPrime), -0.5);
- $rho =
- $a
- * $OSGB_F0
- * (1.0 - $eSquared)
- * pow(1.0 - $eSquared * sinSquared($phiPrime), -1.5);
- $etaSquared = ($v / $rho) - 1.0;
- $VII = tan($phiPrime) / (2 * $rho * $v);
- $VIII =
- (tan($phiPrime) / (24.0 * $rho * pow($v, 3.0)))
- * (5.0
- + (3.0 * tanSquared($phiPrime))
- + $etaSquared
- - (9.0 * tanSquared($phiPrime) * $etaSquared));
- $IX =
- (tan($phiPrime) / (720.0 * $rho * pow($v, 5.0)))
- * (61.0
- + (90.0 * tanSquared($phiPrime))
- + (45.0 * tanSquared($phiPrime) * tanSquared($phiPrime)));
- $X = sec($phiPrime) / $v;
- $XI =
- (sec($phiPrime) / (6.0 * $v * $v * $v))
- * (($v / $rho) + (2 * tanSquared($phiPrime)));
- $XII =
- (sec($phiPrime) / (120.0 * pow($v, 5.0)))
- * (5.0
- + (28.0 * tanSquared($phiPrime))
- + (24.0 * tanSquared($phiPrime) * tanSquared($phiPrime)));
- $XIIA =
- (sec($phiPrime) / (5040.0 * pow($v, 7.0)))
- * (61.0
- + (662.0 * tanSquared($phiPrime))
- + (1320.0 * tanSquared($phiPrime) * tanSquared($phiPrime))
- + (720.0
- * tanSquared($phiPrime)
- * tanSquared($phiPrime)
- * tanSquared($phiPrime)));
- $phi =
- $phiPrime
- - ($VII * pow($E - $E0, 2.0))
- + ($VIII * pow($E - $E0, 4.0))
- - ($IX * pow($E - $E0, 6.0));
- $lambda =
- $lambda0
- + ($X * ($E - $E0))
- - ($XI * pow($E - $E0, 3.0))
- + ($XII * pow($E - $E0, 5.0))
- - ($XIIA * pow($E - $E0, 7.0));
-
- return new LatLng(rad2deg($phi), rad2deg($lambda));
- }
- }
+ /**
+ * Create a new OSRef object representing an OSGB grid reference. Note
+ * that the parameters for this constructor require eastings and
+ * northings with 1m accuracy and need to be absolute with respect to
+ * the whole of the British Grid. For example, to create an OSRef
+ * object from the six-figure grid reference TG514131, the easting would
+ * be 651400 and the northing would be 313100.
+ *
+ * Grid references with accuracy greater than 1m can be represented
+ * using floating point values for the easting and northing. For example,
+ * a value representing an easting or northing accurate to 1mm would be
+ * given as 651400.0001.
+ *
+ * @param float|integer easting the easting of the reference (with 1m accuracy)
+ * @param float|integer northing the northing of the reference (with 1m accuracy)
+ */
+ public function __construct($easting, $northing) {
+ $this->easting = $easting;
+ $this->northing = $northing;
+ }
- // ================================================================== UTMRef
+ /**
+ * Convert this grid reference into a string showing the exact values
+ * of the easting and northing.
+ *
+ * @return
+ */
+ public function toString() {
+ return "({$this->easting}, {$this->northing})";
+ }
- class UTMRef {
- var $easting;
- var $northing;
- var $latZone;
- var $lngZone;
+ /**
+ * Convert this grid reference into a string using a standard six-figure
+ * grid reference including the two-character designation for the 100km
+ * square. e.g. TG514131.
+ *
+ * @return
+ */
+ public function toSixFigureString() {
+ $hundredkmE = floor($this->easting / 100000);
+ $hundredkmN = floor($this->northing / 100000);
+ $firstLetter = "";
+ $firstLetter = $hundredkmN < 5
+ ? ( $hundredkmE < 5 ? "S" : "T" )
+ : ( $hundredkmN < 10 ? ( $hundredkmE < 5 ? "N" : "O" ) : "H" );
+ $secondLetter = "";
+ $index = 65 + ( 4 - ( $hundredkmN % 5 ) ) * 5 + ($hundredkmE % 5);
+ $ti = $index;
+ if ($index >= 73) $index++;
+ $secondLetter = chr($index);
- /**
- * Create a new object representing a UTM reference.
- *
- * @param easting
- * @param northing
- * @param latZone
- * @param lngZone
- */
- function __construct($easting, $northing, $latZone, $lngZone) {
- $this->easting = $easting;
- $this->northing = $northing;
- $this->latZone = $latZone;
- $this->lngZone = $lngZone;
- }
+ $e = round(($this->easting - 100000 * $hundredkmE) / 100);
+ $n = round(($this->northing - 100000 * $hundredkmN) / 100);
+ return sprintf("%s%s%03d%03d", $firstLetter, $secondLetter, $e, $n);
+ }
- /**
- * Return a string representation of this UTM reference
- *
- * @return
- */
- function toString() {
- return $this->lngZone . $this->latZone . " " .
- $this->easting . " " . $this->northing;
- }
-
-
- /**
- * Convert this UTM reference to a latitude and longitude
- *
- * @return the converted latitude and longitude
- */
- function toLatLng() {
- $wgs84 = new RefEll(6378137, 6356752.314);
- $UTM_F0 = 0.9996;
- $a = $wgs84->maj;
- $eSquared = $wgs84->ecc;
- $ePrimeSquared = $eSquared / (1.0 - $eSquared);
- $e1 = (1 - sqrt(1 - $eSquared)) / (1 + sqrt(1 - $eSquared));
- $x = $this->easting - 500000.0;;
- $y = $this->northing;
- $zoneNumber = $this->lngZone;
- $zoneLetter = $this->latZone;
- $longitudeOrigin = ($zoneNumber - 1.0) * 6.0 - 180.0 + 3.0;
+ /**
+ * Convert this grid reference into a latitude and longitude
+ *
+ * @return
+ */
+ public function toLatLng() {
+ $airy1830 = new RefEll(6377563.396, 6356256.909);
+ $OSGB_F0 = 0.9996012717;
+ $N0 = -100050.0;
+ $E0 = 400110.0;
+ $phi0 = deg2rad(49.0);
+ $lambda0 = deg2rad(-2.0);
+ $a = $airy1830->maj;
+ $b = $airy1830->min;
+ $eSquared = $airy1830->ecc;
+ $phi = 0.0;
+ $lambda = 0.0;
+ $E = $this->easting;
+ $N = $this->northing;
+ $n = ($a - $b) / ($a + $b);
+ $M = 0.0;
+ $phiPrime = ( $N - $N0 ) / ( $a * $OSGB_F0 ) + $phi0;
+ do {
+ $M =
+ ($b * $OSGB_F0)
+ * ( ( 1 + $n + ( 5.0 / 4.0 ) * $n * $n + ( 5.0 / 4.0 ) * $n * $n * $n )
+ * ( $phiPrime - $phi0 )
+ - ( 3 * $n + 3 * $n * $n + ( 21.0 / 8.0 ) * $n * $n * $n )
+ * sin( $phiPrime - $phi0 )
+ * cos( $phiPrime + $phi0 )
+ + ( ( 15.0 / 8.0 ) * $n * $n + ( 15.0 / 8.0 ) * $n * $n * $n )
+ * sin( 2.0 * ( $phiPrime - $phi0 ) )
+ * cos( 2.0 * ( $phiPrime + $phi0 ) )
+ - ( ( 35.0 / 24.0 ) * $n * $n * $n )
+ * sin( 3.0 * ( $phiPrime - $phi0 ) )
+ * cos( 3.0 * ( $phiPrime + $phi0 ) ));
+ $phiPrime += ($N - $N0 - $M) / ($a * $OSGB_F0);
+ } while (($N - $N0 - $M) >= 0.001);
+ $v = $a * $OSGB_F0 * pow(1.0 - $eSquared * sinSquared($phiPrime), -0.5);
+ $rho =
+ $a
+ * $OSGB_F0
+ * (1.0 - $eSquared)
+ * pow(1.0 - $eSquared * sinSquared($phiPrime), -1.5);
+ $etaSquared = $v / $rho - 1.0;
+ $VII = tan($phiPrime) / (2 * $rho * $v);
+ $VIII =
+ (tan($phiPrime) / (24.0 * $rho * pow($v, 3.0)))
+ * (5.0
+ + 3.0 * tanSquared( $phiPrime )
+ + $etaSquared
+ - 9.0 * tanSquared( $phiPrime ) * $etaSquared);
+ $IX =
+ (tan($phiPrime) / (720.0 * $rho * pow($v, 5.0)))
+ * (61.0
+ + 90.0 * tanSquared( $phiPrime )
+ + 45.0 * tanSquared( $phiPrime ) * tanSquared( $phiPrime ));
+ $X = sec($phiPrime) / $v;
+ $XI =
+ (sec($phiPrime) / (6.0 * $v * $v * $v))
+ * ( $v / $rho + 2 * tanSquared( $phiPrime ) );
+ $XII =
+ (sec($phiPrime) / (120.0 * pow($v, 5.0)))
+ * (5.0
+ + 28.0 * tanSquared( $phiPrime )
+ + 24.0 * tanSquared( $phiPrime ) * tanSquared( $phiPrime ));
+ $XIIA =
+ (sec($phiPrime) / (5040.0 * pow($v, 7.0)))
+ * (61.0
+ + 662.0 * tanSquared( $phiPrime )
+ + 1320.0 * tanSquared( $phiPrime ) * tanSquared( $phiPrime )
+ + 720.0
+ * tanSquared( $phiPrime )
+ * tanSquared( $phiPrime )
+ * tanSquared( $phiPrime ));
+ $phi =
+ $phiPrime
+ - $VII * pow( $E - $E0, 2.0 )
+ + $VIII * pow( $E - $E0, 4.0 )
+ - $IX * pow( $E - $E0, 6.0 );
+ $lambda =
+ $lambda0
+ + $X * ( $E - $E0 )
+ - $XI * pow( $E - $E0, 3.0 )
+ + $XII * pow( $E - $E0, 5.0 )
+ - $XIIA * pow( $E - $E0, 7.0 );
- // Correct y for southern hemisphere if ((ord($zoneLetter) - ord("N")) < 0) {
- $y -= 10000000.0;
- }
+ return new LatLng(rad2deg($phi), rad2deg($lambda));
+ }
+}
- $m = $y / $UTM_F0;
- $mu =
- $m
- / ($a
- * (1.0
- - $eSquared / 4.0
- - 3.0 * $eSquared * $eSquared / 64.0
- - 5.0
- * pow($eSquared, 3.0)
- / 256.0));
- $phi1Rad =
- $mu
- + (3.0 * $e1 / 2.0 - 27.0 * pow($e1, 3.0) / 32.0) * sin(2.0 * $mu)
- + (21.0 * $e1 * $e1 / 16.0 - 55.0 * pow($e1, 4.0) / 32.0)
- * sin(4.0 * $mu)
- + (151.0 * pow($e1, 3.0) / 96.0) * sin(6.0 * $mu);
+// ================================================================== UTMRef
- $n =
- $a
- / sqrt(1.0 - $eSquared * sin($phi1Rad) * sin($phi1Rad));
- $t = tan($phi1Rad) * tan($phi1Rad);
- $c = $ePrimeSquared * cos($phi1Rad) * cos($phi1Rad);
- $r =
- $a
- * (1.0 - $eSquared)
- / pow(
- 1.0 - $eSquared * sin($phi1Rad) * sin($phi1Rad),
- 1.5);
- $d = $x / ($n * $UTM_F0);
+class UTMRef {
- $latitude = (
- $phi1Rad
- - ($n * tan($phi1Rad) / $r)
- * ($d * $d / 2.0
- - (5.0
- + (3.0 * $t)
- + (10.0 * $c)
- - (4.0 * $c * $c)
- - (9.0 * $ePrimeSquared))
- * pow($d, 4.0)
- / 24.0
- + (61.0
- + (90.0 * $t)
- + (298.0 * $c)
- + (45.0 * $t * $t)
- - (252.0 * $ePrimeSquared)
- - (3.0 * $c * $c))
- * pow($d, 6.0)
- / 720.0)) * (180.0 / pi());
+ public $easting;
+ public $northing;
+ public $latZone;
+ public $lngZone;
- $longitude = $longitudeOrigin + (
- ($d
- - (1.0 + 2.0 * $t + $c) * pow($d, 3.0) / 6.0
- + (5.0
- - (2.0 * $c)
- + (28.0 * $t)
- - (3.0 * $c * $c)
- + (8.0 * $ePrimeSquared)
- + (24.0 * $t * $t))
- * pow($d, 5.0)
- / 120.0)
- / cos($phi1Rad)) * (180.0 / pi());
- return new LatLng($latitude, $longitude);
- }
- }
+ /**
+ * Create a new object representing a UTM reference.
+ *
+ * @param float|integer easting
+ * @param float|integer northing
+ * @param float|integer latZone
+ * @param float|integer lngZone
+ */
+ public function __construct($easting, $northing, $latZone, $lngZone) {
+ $this->easting = $easting;
+ $this->northing = $northing;
+ $this->latZone = $latZone;
+ $this->lngZone = $lngZone;
+ }
- // ================================================================== RefEll
+ /**
+ * Return a string representation of this UTM reference
+ *
+ * @return string
+ */
+ public function toString() {
+ return "{$this->lngZone}{$this->latZone} {$this->easting} {$this->northing}";
+ }
- class RefEll {
- var $maj;
- var $min;
- var $ecc;
+ /**
+ * Convert this UTM reference to a latitude and longitude
+ *
+ * @return string the converted latitude and longitude
+ */
+ public function toLatLng() {
+ $wgs84 = new RefEll(6378137, 6356752.314);
+ $UTM_F0 = 0.9996;
+ $a = $wgs84->maj;
+ $eSquared = $wgs84->ecc;
+ $ePrimeSquared = $eSquared / (1.0 - $eSquared);
+ $e1 = (1 - sqrt(1 - $eSquared)) / (1 + sqrt(1 - $eSquared));
+ $x = $this->easting - 500000.0;;
+ $y = $this->northing;
+ $zoneNumber = $this->lngZone;
+ $zoneLetter = $this->latZone;
+ $longitudeOrigin = ($zoneNumber - 1.0) * 6.0 - 180.0 + 3.0;
- /**
- * Create a new RefEll object to represent a reference ellipsoid
- *
- * @param maj the major axis
- * @param min the minor axis
- */
- function __construct($maj, $min) {
- $this->maj = $maj;
- $this->min = $min;
- $this->ecc = (($maj * $maj) - ($min * $min)) / ($maj * $maj);
- }
- }
+ // Correct y for southern hemisphere
+ if ((ord($zoneLetter) - ord("N")) < 0) {
+ $y -= 10000000.0;
+ }
+
+ $m = $y / $UTM_F0;
+ $mu =
+ $m
+ / ($a
+ * (1.0
+ - $eSquared / 4.0
+ - 3.0 * $eSquared * $eSquared / 64.0
+ - 5.0
+ * pow($eSquared, 3.0)
+ / 256.0));
+
+ $phi1Rad =
+ $mu
+ + (3.0 * $e1 / 2.0 - 27.0 * pow($e1, 3.0) / 32.0) * sin(2.0 * $mu)
+ + (21.0 * $e1 * $e1 / 16.0 - 55.0 * pow($e1, 4.0) / 32.0)
+ * sin(4.0 * $mu)
+ + (151.0 * pow($e1, 3.0) / 96.0) * sin(6.0 * $mu);
+
+ $n =
+ $a
+ / sqrt(1.0 - $eSquared * sin($phi1Rad) * sin($phi1Rad));
+ $t = tan($phi1Rad) * tan($phi1Rad);
+ $c = $ePrimeSquared * cos($phi1Rad) * cos($phi1Rad);
+ $r =
+ $a
+ * (1.0 - $eSquared)
+ / pow(
+ 1.0 - $eSquared * sin($phi1Rad) * sin($phi1Rad),
+ 1.5);
+ $d = $x / ($n * $UTM_F0);
+
+ $latitude = (
+ $phi1Rad
+ - ($n * tan($phi1Rad) / $r)
+ * ($d * $d / 2.0
+ - (5.0
+ + 3.0 * $t
+ + 10.0 * $c
+ - 4.0 * $c * $c
+ - 9.0 * $ePrimeSquared)
+ * pow($d, 4.0)
+ / 24.0
+ + (61.0
+ + 90.0 * $t
+ + 298.0 * $c
+ + 45.0 * $t * $t
+ - 252.0 * $ePrimeSquared
+ - 3.0 * $c * $c)
+ * pow($d, 6.0)
+ / 720.0)) * (180.0 / pi());
+
+ $longitude = $longitudeOrigin + (
+ ($d
+ - (1.0 + 2.0 * $t + $c) * pow($d, 3.0) / 6.0
+ + (5.0
+ - 2.0 * $c
+ + 28.0 * $t
+ - 3.0 * $c * $c
+ + 8.0 * $ePrimeSquared
+ + 24.0 * $t * $t)
+ * pow($d, 5.0)
+ / 120.0)
+ / cos($phi1Rad)) * (180.0 / pi());
+
+ $latlog = new LatLng($latitude, $longitude);
+ return $latlog->toString();
+ }
+}
+
+
+// ================================================================== RefEll
+
+ class RefEll {
+
+ public $maj;
+ public $min;
+ public $ecc;
+
+
+ /**
+ * Create a new RefEll object to represent a reference ellipsoid
+ *
+ * @param float|integer maj the major axis
+ * @param float|integer min the minor axis
+ */
+ public function __construct($maj, $min) {
+ $this->maj = $maj;
+ $this->min = $min;
+ $this->ecc = ( $maj * $maj - $min * $min ) / ($maj * $maj);
+ }
+ }
// ================================================== Mathematical Functions
- function sinSquared($x) {
- return sin($x) * sin($x);
- }
+function sinSquared($x) {
+ return sin($x) * sin($x);
+}
+
+function cosSquared($x) {
+ return cos($x) * cos($x);
+}
+
+function tanSquared($x) {
+ return tan($x) * tan($x);
+}
+
+function sec($x) {
+ return 1.0 / cos($x);
+}
- function cosSquared($x) {
- return cos($x) * cos($x);
- }
- function tanSquared($x) {
- return tan($x) * tan($x);
- }
+/**
+* Take a string formatted as a six-figure OS grid reference (e.g.
+* "TG514131") and return a reference to an OSRef object that represents
+* that grid reference. The first character must be H, N, S, O or T.
+* The second character can be any uppercase character from A through Z
+* excluding I.
+*
+* @param string $ref
+* @return string
+* @since 2.1
+*/
+function getOSRefFromSixFigureReference($ref) {
+ $char1 = substr($ref, 0, 1);
+ $char2 = substr($ref, 1, 1);
+ $east = substr($ref, 2, 3) * 100;
+ $north = substr($ref, 5, 3) * 100;
+ switch ($char1) {
+ case 'H':
+ $north += 1000000;
+ break;
+ case 'N':
+ $north += 500000;
+ break;
+ case 'O':
+ $north += 500000;
+ $east += 500000;
+ break;
+ case 'T':
+ $east += 500000;
+ break;
+ }
+ $char2ord = ord($char2);
+ if ($char2ord > 73) $char2ord--; // Adjust for no I
+ $nx = (($char2ord - 65) % 5) * 100000;
+ $ny = (4 - floor(($char2ord - 65) / 5)) * 100000;
+ $osref = new OSRef($east + $nx, $north + $ny);
+ return $osref->toString();
+}
- function sec($x) {
- return 1.0 / cos($x);
- }
-
-
- /**
- * Take a string formatted as a six-figure OS grid reference (e.g.
- * "TG514131") and return a reference to an OSRef object that represents
- * that grid reference. The first character must be H, N, S, O or T.
- * The second character can be any uppercase character from A through Z
- * excluding I.
- *
- * @param ref
- * @return
- * @since 2.1
- */
- function getOSRefFromSixFigureReference($ref) {
- $char1 = substr($ref, 0, 1);
- $char2 = substr($ref, 1, 1);
- $east = substr($ref, 2, 3) * 100;
- $north = substr($ref, 5, 3) * 100;
- if ($char1 == 'H') {
- $north += 1000000;
- } else if ($char1 == 'N') {
- $north += 500000;
- } else if ($char1 == 'O') {
- $north += 500000;
- $east += 500000;
- } else if ($char1 == 'T') {
- $east += 500000;
- }
- $char2ord = ord($char2);
- if ($char2ord > 73) $char2ord--; // Adjust for no I
- $nx = (($char2ord - 65) % 5) * 100000;
- $ny = (4 - floor(($char2ord - 65) / 5)) * 100000;
- return new OSRef($east + $nx, $north + $ny);
- }
-
-
- /**
- * Work out the UTM latitude zone from the latitude
- *
- * @param latitude
- * @return
- */
- function getUTMLatitudeZoneLetter($latitude) {
- if ((84 >= $latitude) && ($latitude >= 72)) return "X";
- else if (( 72 > $latitude) && ($latitude >= 64)) return "W";
- else if (( 64 > $latitude) && ($latitude >= 56)) return "V";
- else if (( 56 > $latitude) && ($latitude >= 48)) return "U";
- else if (( 48 > $latitude) && ($latitude >= 40)) return "T";
- else if (( 40 > $latitude) && ($latitude >= 32)) return "S";
- else if (( 32 > $latitude) && ($latitude >= 24)) return "R";
- else if (( 24 > $latitude) && ($latitude >= 16)) return "Q";
- else if (( 16 > $latitude) && ($latitude >= 8)) return "P";
- else if (( 8 > $latitude) && ($latitude >= 0)) return "N";
- else if (( 0 > $latitude) && ($latitude >= -8)) return "M";
- else if (( -8 > $latitude) && ($latitude >= -16)) return "L";
- else if ((-16 > $latitude) && ($latitude >= -24)) return "K";
- else if ((-24 > $latitude) && ($latitude >= -32)) return "J";
- else if ((-32 > $latitude) && ($latitude >= -40)) return "H";
- else if ((-40 > $latitude) && ($latitude >= -48)) return "G";
- else if ((-48 > $latitude) && ($latitude >= -56)) return "F";
- else if ((-56 > $latitude) && ($latitude >= -64)) return "E";
- else if ((-64 > $latitude) && ($latitude >= -72)) return "D";
- else if ((-72 > $latitude) && ($latitude >= -80)) return "C";
- else return 'Z';
- }
-?> \ No newline at end of file
+/**
+* Work out the UTM latitude zone from the latitude
+*
+* @param float|integer latitude
+* @return
+*/
+function getUTMLatitudeZoneLetter($latitude) {
+ if ((84 >= $latitude) && ($latitude >= 72)) return "X";
+ else if (( 72 > $latitude) && ($latitude >= 64)) return "W";
+ else if (( 64 > $latitude) && ($latitude >= 56)) return "V";
+ else if (( 56 > $latitude) && ($latitude >= 48)) return "U";
+ else if (( 48 > $latitude) && ($latitude >= 40)) return "T";
+ else if (( 40 > $latitude) && ($latitude >= 32)) return "S";
+ else if (( 32 > $latitude) && ($latitude >= 24)) return "R";
+ else if (( 24 > $latitude) && ($latitude >= 16)) return "Q";
+ else if (( 16 > $latitude) && ($latitude >= 8)) return "P";
+ else if (( 8 > $latitude) && ($latitude >= 0)) return "N";
+ else if (( 0 > $latitude) && ($latitude >= -8)) return "M";
+ else if (( -8 > $latitude) && ($latitude >= -16)) return "L";
+ else if ((-16 > $latitude) && ($latitude >= -24)) return "K";
+ else if ((-24 > $latitude) && ($latitude >= -32)) return "J";
+ else if ((-32 > $latitude) && ($latitude >= -40)) return "H";
+ else if ((-40 > $latitude) && ($latitude >= -48)) return "G";
+ else if ((-48 > $latitude) && ($latitude >= -56)) return "F";
+ else if ((-56 > $latitude) && ($latitude >= -64)) return "E";
+ else if ((-64 > $latitude) && ($latitude >= -72)) return "D";
+ else if ((-72 > $latitude) && ($latitude >= -80)) return "C";
+ else return 'Z';
+}
diff --git a/lib/test-2.3.php b/lib/test-2.3.php
new file mode 100755
index 0000000..c9edc8b
--- /dev/null
+++ b/lib/test-2.3.php
@@ -0,0 +1,197 @@
+<?php
+
+ //-------------------------------------------------------------------------- // PHPcoord
+ // text.php // // (c) 2005 Jonathan Stott // // Created on 11-Aug-2005 //
+ // 2.3 - 24 Aug 2006
+ // - Changed OSRef->toSixFigureString() so that the eastings and northings
+ // are rounded rather than floored.
+ // 2.2 - 11 Feb 2006
+ // - Used different algorithm for calculating distance between latitudes
+ // and longitudes - fixes a number of problems with distance calculations
+ // 2.1 - 22 Dec 2005
+ // - Added getOSRefFromSixFigureReference function
+ // 2.0 - 21 Dec 2005
+ // - Completely different object design - conversion functions now through
+ // objects rather than static functions
+ // - Updated comments and documentation // 1.1 - 11 Sep 2005
+ // - Added OSGB36/WGS84 data conversions
+ // 1.0 - 11 Aug 2005 // - Initial version //--------------------------------------------------------------------------
+
+
+ require_once("phpcoord-2.3.php");
+?>
+
+<html>
+
+ <head>
+ <title>phpcoord Test Script</title>
+ </head>
+
+ <body>
+
+ <h1>phpcoord Test Script</h1>
+
+ <h2>Calculate Surface Distance between two Latitudes/Longitudes</h2>
+
+ <p>
+ The LatLngDistance function takes two latitudes/longitudes and calculates
+ the surface distance between the two in kilometres:
+ </p>
+
+ <p>
+ <pre>$lld1 = new LatLng(40.718119, -73.995667); // New York
+echo "New York Lat/Long: " . $lld1->toString() . "&lt;br /&gt;";
+$lld2 = new LatLng(51.499981, -0.125313); // London
+$d = $lld1->distance($lld2);
+echo "Surface Distance between New York and London: " . $d . "km";</pre>
+
+ <?php
+ $lld1 = new LatLng(40.718119, -73.995667); // New York
+ echo "New York Lat/Long: " . $lld1->toString() . "<br />";
+ $lld2 = new LatLng(51.499981, -0.125313); // London
+ echo "London Lat/Long: " . $lld2->toString() . "<br />";
+ $d = $lld1->distance($lld2);
+ echo "Surface Distance between New York and London: " . $d . "km";
+ ?>
+ </p>
+
+ <h2>Convert OS Grid Reference to Latitude/Longitude</h2>
+
+ <p>
+ Note that the OSGB-Latitude/Longitude conversions use the OSGB36 datum by default. The
+ majority of applications use the WGS84 datum, for which the appropriate conversions
+ need to be added. See the examples below to see the difference between the two data.
+ </p>
+
+ <p>
+ Using OSGB36 (convert an OSGB grid reference to a latitude and longitude using the OSGB36 datum):
+
+ <pre>$os1 = new OSRef(651409.903, 313177.270);
+echo "OS Grid Reference: " . $os1->toString() . " - " . $os1->toSixFigureString() . "&lt;br /&gt;";
+$ll1 = $os1->toLatLng();
+echo "Converted to Lat/Long: " . $ll1->toString();</pre>
+
+ <?php
+ $os1 = new OSRef(651409.903, 313177.270);
+ echo "OS Grid Reference: " . $os1->toString() . " - " . $os1->toSixFigureString() . "<br />";
+ $ll1 = $os1->toLatLng();
+ echo "Converted to Lat/Long: " . $ll1->toString();
+ ?>
+ </p>
+
+ <p>
+ Using WGS84 (convert an OSGB grid reference to a latitude and longitude using the WGS84 datum):
+
+ <pre>$os1w = new OSRef(651409.903, 313177.270);
+echo "OS Grid Reference: " . $os1w->toString() . " - " . $os1w->toSixFigureString() . "&lt;br /&gt;";
+$l1w = $os1w->toLatLng();
+$l1w->OSGB36ToWGS84();
+echo "Converted to Lat/Long: " . $ll1w->toString();</pre>
+
+ <?php
+ $os1w = new OSRef(651409.903, 313177.270);
+ echo "OS Grid Reference: " . $os1w->toString() . " - " . $os1w->toSixFigureString() . "<br />";
+ $ll1w = $os1w->toLatLng();
+ $ll1w->OSGB36ToWGS84();
+ echo "Converted to Lat/Long: " . $ll1w->toString();
+ ?>
+ </p>
+
+ <h2>Convert Latitude/Longitude to OS Grid Reference</h2>
+
+ <p>
+ Note that the OSGB-Latitude/Longitude conversions use the OSGB36 datum by default. The
+ majority of applications use the WGS84 datum, for which the appropriate conversions
+ need to be added. See the examples below to see the difference between the two data.
+ </p>
+
+ <p>
+ Using OSGB36 (convert a latitude and longitude using the OSGB36 datum to an OSGB grid reference):
+
+ <pre>$ll2 = new LatLng(52.657570301933, 1.7179215806451);
+echo "Latitude/Longitude: " . $ll2->toString() . "&lt;br /&gt;";
+$os2 = $ll2->toOSRef();
+echo "Converted to OS Grid Ref: " . $os2->toString() . " - " . $os2->toSixFigureString();</pre>
+
+ <?php
+ $ll2 = new LatLng(52.657570301933, 1.7179215806451);
+ echo "Latitude/Longitude: " . $ll2->toString() . "<br />";
+ $os2 = $ll2->toOSRef();
+ echo "Converted to OS Grid Ref: " . $os2->toString() . " - " . $os2->toSixFigureString();
+ ?>
+ </p>
+
+ <p>
+ Using WGS84 (convert a latitude and longitude using the WGS84 datum to an OSGB grid reference):
+
+ <pre>$ll2w = new LatLng(52.657570301933, 1.7179215806451);
+echo "Latitude/Longitude: " . $ll2->toString() . "&lt;br /&gt;";
+$ll2w->WGS84ToOSGB36();
+$os2w = $ll2w->toOSRef();
+echo "Converted to OS Grid Ref: " . $os2w->toString() . " - " . $os2w->toSixFigureString();</pre>
+
+ <?php
+ $ll2w = new LatLng(52.657570301933, 1.7179215806451);
+ echo "Latitude/Longitude: " . $ll2->toString() . "<br />";
+ $ll2w->WGS84ToOSGB36();
+ $os2w = $ll2w->toOSRef();
+ echo "Converted to OS Grid Ref: " . $os2w->toString() . " - " . $os2w->toSixFigureString();
+ ?>
+ </p>
+
+ <h2>Convert Six-Figure OS Grid Reference String to an OSRef Object</h2>
+
+ <p>
+ To convert a string representing a six-figure OSGB grid reference:
+
+ <pre>$os6 = "TG514131";
+echo "Six figure string: " . $os6 . "&lt;br /&gt;";
+$os6x = getOSRefFromSixFigureReference($os6);
+echo "Converted to OS Grid Ref: " . $os6x->toString() . " - " . $os6x->toSixFigureString();</pre>
+
+ <?php
+ $os6 = "TG514131";
+ echo "Six figure string: " . $os6 . "<br />";
+ $os6x = getOSRefFromSixFigureReference($os6);
+ echo "Converted to OS Grid Ref: " . $os6x->toString() . " - " . $os6x->toSixFigureString();
+ ?>
+ </p>
+
+ <h2>Convert UTM Reference to Latitude/Longitude</h2>
+
+ <p>
+ <pre>$utm1 = new UTMRef(456463.99, 3335334.05, "E", 12);
+echo "UTM Reference: " . $utm1->toString() . "&lt;br /&gt;";
+$ll3 = $utm1->toLatLng();
+echo "Converted to Lat/Long: " . $ll3->toString();</pre>
+
+ <?php
+ $utm1 = new UTMRef(456463.99, 3335334.05, "E", 12);
+ echo "UTM Reference: " . $utm1->toString() . "<br />";
+ $ll3 = $utm1->toLatLng();
+ echo "Converted to Lat/Long: " . $ll3->toString();
+ ?>
+ </p>
+
+ <h2>Convert Latitude/Longitude to UTM Reference</h2>
+
+ <p>
+ <pre>$ll4 = new LatLng(-60.1167, -111.7833);
+echo "Latitude/Longitude: " . $ll4->toString() . "&lt;br /&gt;";
+$utm2 = $ll4->toUTMRef();
+echo "Converted to UTM Ref: " . $utm2->toString() ;</pre>
+
+ <?php
+ $ll4 = new LatLng(-60.1167, -111.7833);
+ echo "Latitude/Longitude: " . $ll4->toString() . "<br />";
+ $utm2 = $ll4->toUTMRef();
+ echo "Converted to UTM Ref: " . $utm2->toString() ;
+ ?>
+ </p>
+
+ <p>
+ (c) 2005, Jonathan Stott
+ </p>
+
+ </body>
+</html> \ No newline at end of file
diff --git a/list.php b/list.php
index 1464ad0..3a4f2e9 100644..100755
--- a/list.php
+++ b/list.php
@@ -13,9 +13,10 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
+require_once '../kernel/includes/setup_inc.php';
-include_once( CONTACT_PKG_PATH.'Contact.php' );
+use Bitweaver\Contact\Contact;
+use Bitweaver\KernelTools;
$gBitSystem->verifyPackage( 'contact' );
$gBitSystem->verifyPermission( 'p_contact_view' );
@@ -43,14 +44,12 @@ if( $gBitUser->hasPermission("p_contact_view_changes") && $_SESSION['contact']['
$listcontacts = $gContent->getList( $listHash );
if ( $listHash['listInfo']['count'] == 1 ){
- bit_redirect( CONTACT_PKG_URL."display_contact.php?content_id=".$listcontacts[0]['content_id'] );
+ KernelTools::bit_redirect( CONTACT_PKG_URL."display_contact.php?content_id=".$listcontacts[0]['content_id'] );
}
-$gBitSmarty->assignByRef( 'listcontacts', $listcontacts );
-$gBitSmarty->assignByRef( 'listInfo', $listHash['listInfo'] );
+$gBitSmarty->assign( 'listcontacts', $listcontacts );
+$gBitSmarty->assign( 'listInfo', $listHash['listInfo'] );
$gBitSystem->setBrowserTitle("View Contacts List");
// Display the template
$gBitSystem->display( 'bitpackage:contact/list.tpl', NULL, array( 'display_mode' => 'list' ));
-
-?>
diff --git a/list1.php b/list1.php
index a818cd9..3df951b 100644..100755
--- a/list1.php
+++ b/list1.php
@@ -13,9 +13,9 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
+require_once '../kernel/includes/setup_inc.php';
-include_once( CONTACT_PKG_PATH.'Contact.php' );
+use Bitweaver\Contact\Contact;
$gBitSystem->verifyPackage( 'contact' );
$gBitSystem->verifyPermission( 'p_contact_view' );
@@ -46,11 +46,10 @@ if ( $listHash['listInfo']['count'] == 1 ){
bit_redirect( CONTACT_PKG_URL."display_contact.php?content_id=".$listcontacts[0]['content_id'] );
}
-$gBitSmarty->assignByRef( 'listcontacts', $listcontacts );
-$gBitSmarty->assignByRef( 'listInfo', $listHash['listInfo'] );
+$gBitSmarty->assign( 'listcontacts', $listcontacts );
+$gBitSmarty->assign( 'listInfo', $listHash['listInfo'] );
$gBitSystem->setBrowserTitle("View Contacts List");
// Display the template
$gBitSystem->display( 'bitpackage:contact/list1.tpl', NULL, array( 'display_mode' => 'list' ));
-?>
diff --git a/list2.php b/list2.php
new file mode 100755
index 0000000..3e661af
--- /dev/null
+++ b/list2.php
@@ -0,0 +1,55 @@
+<?php
+/**
+ * @version $Header: /cvsroot/bitweaver/_bit_contact/list.php,v 1.5 2010/02/08 21:27:22 wjames5 Exp $
+ *
+ * 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
+ * @subpackage functions
+ */
+
+/**
+ * required setup
+ */
+require_once '../kernel/includes/setup_inc.php';
+
+use Bitweaver\Contact\Contact;
+
+$gBitSystem->verifyPackage( 'contact' );
+$gBitSystem->verifyPermission( 'p_contact_view' );
+
+$gContent = new Contact( );
+$gContent->invokeServices( 'content_list_function', $_REQUEST );
+
+// Handle the request hash storing into the session.
+$gContent->mTypes->processRequestHash($_REQUEST, $_SESSION['contact']);
+
+$listHash = $_REQUEST;
+/*
+ * Setup which contact types we want to view.
+$contactTypes = $gContent->getContactTypes();
+if( $gBitUser->hasPermission("p_contact_view_changes") && $_SESSION['contact']['contact_type_guid'] ) {
+ $listHash['contact_type_guid'] = $_SESSION['contact']['contact_type_guid'];
+} else {
+ foreach ($contactTypes as $key => $val) {
+ if ($gBitSystem->isFeatureActive('contact_default_'.$key)) {
+ $listHash['contact_type_guid'][] = $key;
+ }
+ }
+} */
+// Get a list of matching contact entries
+$listcontacts = $gContent->getList( $listHash );
+
+if ( $listHash['listInfo']['count'] == 1 ){
+ bit_redirect( CONTACT_PKG_URL."display_contact.php?content_id=".$listcontacts[0]['content_id'] );
+}
+
+$gBitSmarty->assign( 'listcontacts', $listcontacts );
+$gBitSmarty->assign( 'listInfo', $listHash['listInfo'] );
+
+$gBitSystem->setBrowserTitle("View Contacts List");
+// Display the template
+$gBitSystem->display( 'bitpackage:contact/list2.tpl', NULL, array( 'display_mode' => 'list' ));
+
diff --git a/list_contacts.php b/list_contacts.php
index a104dd8..39485f4 100644..100755
--- a/list_contacts.php
+++ b/list_contacts.php
@@ -13,8 +13,8 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
-require_once( CONTACT_PKG_PATH.'Contact.php' );
+require_once '../kernel/includes/setup_inc.php';
+use Bitweaver\Contact\Contact;
$gBitSystem->isPackageActive('contact', TRUE);
@@ -30,10 +30,9 @@ if ( empty( $_REQUEST["sort_mode"] ) ) {
// Get a list of Contacts
$contacts->getList( $_REQUEST );
-$smarty->assignByRef('listInfo', $_REQUEST['listInfo']);
-$smarty->assignByRef('list', $contacts);
+$smarty->assign('listInfo', $_REQUEST['listInfo']);
+$smarty->assign('list', $contacts);
// Display the template
$gBitSystem->display( 'bitpackage:contact/list_contacts.tpl', NULL, array( 'display_mode' => 'list' ));
-?>
diff --git a/list_contracts.php b/list_contracts.php
index 96ce303..d3eef46 100644..100755
--- a/list_contracts.php
+++ b/list_contracts.php
@@ -13,8 +13,8 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
-require_once( CONTACT_PKG_PATH.'Contact.php' );
+require_once '../kernel/includes/setup_inc.php';
+use Bitweaver\Contact\Contact;
$gBitSystem->isPackageActive('contact', TRUE);
@@ -29,9 +29,8 @@ if ( !isset($_REQUEST['contract'])) {
// Get a list of Contracts
$contracts = $contacts->getContractList( $_REQUEST['contract'] );
-$gBitSmarty->assignByRef('listInfo', $_REQUEST['listInfo']);
-$gBitSmarty->assignByRef('list', $contracts);
+$gBitSmarty->assign('listInfo', $_REQUEST['listInfo']);
+$gBitSmarty->assign('list', $contracts);
// Display the template
$gBitSystem->display( 'bitpackage:contact/list_contracts.tpl', NULL, array( 'display_mode' => 'list' ));
-?>
diff --git a/load_contacts.php b/load_contacts.php
new file mode 100755
index 0000000..610ace5
--- /dev/null
+++ b/load_contacts.php
@@ -0,0 +1,39 @@
+<?php
+/*
+ * Created on 5 Jan 2008
+ *
+ * To change the template for this generated file go to
+ * Window - Preferences - PHPeclipse - PHP - Code Templates
+ */
+
+// Initialization
+require_once '../kernel/includes/setup_inc.php';
+use Bitweaver\Contact\Contact;
+use Bitweaver\KernelTools;
+
+// Is package installed and enabled
+$gBitSystem->verifyPackage( 'contact' );
+
+// Now check permissions to access this page
+$gBitSystem->verifyPermission('p_contact_admin' );
+
+$contact = new Contact();
+
+// $contact->DataExpunge();
+
+$row = 0;
+
+$handle = fopen("data/cotswold_guard_cust.csv", "r");
+if ( $handle == FALSE) {
+ $row = -999;
+} else {
+ while (($data = fgetcsv($handle, 800, ",")) !== FALSE) {
+ if ( $data ) { $contact->ContactRecordLoad( $data );
+ $row++; }
+ }
+ fclose($handle);
+}
+
+$gBitSmarty->assign( 'count', $row );
+
+$gBitSystem->display( 'bitpackage:contact/load_contacts.tpl', KernelTools::tra( 'Load results: ' ) );
diff --git a/load_emails.php b/load_emails.php
index bf2b6c6..a3d8024 100644..100755
--- a/load_emails.php
+++ b/load_emails.php
@@ -13,18 +13,18 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
-require_once( LIBERTY_PKG_PATH.'LibertyComment.php' );
+require_once '../kernel/includes/setup_inc.php';
+use Bitweaver\Liberty\LibertyComment;
global $commentsLib, $gBitSmarty, $gBitSystem;
$gBitSystem->verifyPackage( 'contact' );
$gBitSystem->verifyPermission( 'p_contact_update' );
-include_once( CONTACT_PKG_PATH.'lookup_contact_inc.php' );
+include_once CONTACT_PKG_INCLUDE_PATH . 'lookup_contact_inc.php';
-if ( !$gContent->mContentId ) {
- header ("location: ".CONTACT_PKG_URL."list.php");
+if (!$gContent->mContentId) {
+ header( "location: " . CONTACT_PKG_URL . "list.php" );
die;
}
@@ -35,107 +35,100 @@ require_once 'import/mimeDecode.php';
$file = '/srv/website/bitweaver/contact/data/Shipped';
//echo 'Using file ' . $file . "<br>";
-$mbox = new Mail_Mbox($file);
+$mbox = new Mail_Mbox( $file );
$mbox->open();
-for ($n = 0; $n < $mbox->size(); $n++) {
- $message = $mbox->get($n);
+for ( $n = 0; $n < $mbox->size(); $n++ ) {
+ $message = $mbox->get( $n );
- preg_match('/Subject: (.*)$/m', $message, $matches);
- if ( isset( $matches[1] ) ) {
- $subject = $matches[1];
- } else {
- $subject = 'Not Set';
- }
-// echo 'Mail #' . $n . ': ' . $subject . "<br>";
- $Decoder = new Mail_mimeDecode( $message );
- $params = array(
- 'include_bodies' => TRUE,
- 'decode_bodies' => TRUE,
- 'decode_headers' => TRUE
+ preg_match( '/Subject: (.*)$/m', $message, $matches );
+ $subject = isset( $matches[1] ) ? $matches[1] : 'Not Set';$subject = 'Not Set';
+ // echo 'Mail #' . $n . ': ' . $subject . "<br>";
+ $Decoder = new Mail_mimeDecode( $message );
+ $params = array(
+ 'include_bodies' => true,
+ 'decode_bodies' => true,
+ 'decode_headers' => true,
);
- $Decoded = $Decoder->decode($params);
- if ( strtolower($Decoded->ctype_primary) == "multipart" ) {
-// vd($Decoded->parts[0]->ctype_primary);
- $ctype_secondary = $Decoded->parts[0]->ctype_secondary;
- if ( strtolower($Decoded->parts[0]->ctype_primary) == "multipart" ) {
- if ( !empty($Decoded->parts[0]->parts[0]->body) ) {
+ $Decoded = $Decoder->decode( $params );
+ if (strtolower( $Decoded->ctype_primary ) == "multipart") {
+ // \Bitweaver\vd($Decoded->parts[0]->ctype_primary);
+ $ctype_secondary = $Decoded->parts[0]->ctype_secondary;
+ if (strtolower( $Decoded->parts[0]->ctype_primary ) == "multipart") {
+ if (!empty( $Decoded->parts[0]->parts[0]->body )) {
$body = $Decoded->parts[0]->parts[0]->body;
} else {
- vd( $Decoded );
+ \Bitweaver\vd( $Decoded );
}
} else {
$body = $Decoded->parts[0]->body;
}
- } else if ( strtolower($Decoded->ctype_primary) == "text" ) {
-// vd($Decoded->ctype_primary);
- $ctype_secondary = $Decoded->ctype_secondary;
- if ( !empty($Decoded->body) ) {
+ }
+ else if (strtolower( $Decoded->ctype_primary ) == "text") {
+ // \Bitweaver\vd($Decoded->ctype_primary);
+ $ctype_secondary = $Decoded->ctype_secondary;
+ if (!empty( $Decoded->body )) {
$body = $Decoded->body;
} else {
- vd( $Decoded );
+ \Bitweaver\vd( $Decoded );
}
} else {
- vd( $message );
- vd($Decoded);
+ \Bitweaver\vd( $message );
+ \Bitweaver\vd( $Decoded );
break;
}
- $em_date = str_replace( '(GMT Daylight Time)', 'BST', $Decoded->headers['date'] );
- $em_date = str_replace( '(West-Europa (standaardtijd))', '', $em_date );
+ $em_date = str_replace( '(GMT Daylight Time)', 'BST', $Decoded->headers['date'] );
+ $em_date = str_replace( '(West-Europa (standaardtijd))', '', $em_date );
$dateTime = new DateTime( $em_date );
- $email = Array();
+ $email = [];
$email['comments_parent_id'] = $gContent->mContentId;
$email['comment_title'] = $subject;
$email['comment_data'] = $body;
$email['created'] = strtotime( $dateTime->format(DATE_ATOM) );
$email['last_modified'] = strtotime( $dateTime->format(DATE_ATOM) );
$email['summary'] = $message;
- if ( $ctype_secondary == 'html' ) {
- $email['format_guid'] = 'bithtml';
- } else {
- $email['format_guid'] = 'simpletext';
- }
+ $email['format_guid'] = ( $ctype_secondary == 'html' ) ? 'bithtml' : 'simpletext';
$storeComment = new LibertyComment();
-/*
- * Process email addresses from the file
- // define our search pattern to extract any email addresses
-// $pattern = '#(?<=s/)[^\s@]+@[^\s@_]#';
-// $pattern = '/([A-Za-z0-9\.\-\_\!\#\$\%\&\'\*\+\/\=\?\^\`\{\|\}]+)\@([A-Za-z0-9.-_]+)(\.[A-Za-z]{2,5})/';
- $pattern = '/([a-z0-9_\.\-])+\@(([a-z0-9\-])+\.)+([a-z0-9]{2,4})+/i';
- // preg match all in the string
- preg_match_all( $pattern, $Decoded->headers['from'], $emails );
- if ( !empty($emails[0]) ) {
- if ( $emails[0][0] == 'lester@lsces.co.uk' ) {
- preg_match_all( $pattern, $Decoded->headers['to'], $to_emails );
- }
+ /*
+ * Process email addresses from the file
+ // define our search pattern to extract any email addresses
+ // $pattern = '#(?<=s/)[^\s@]+@[^\s@_]#';
+ // $pattern = '/([A-Za-z0-9\.\-\_\!\#\$\%\&\'\*\+\/\=\?\^\`\{\|\}]+)\@([A-Za-z0-9.-_]+)(\.[A-Za-z]{2,5})/';
+ $pattern = '/([a-z0-9_\.\-])+\@(([a-z0-9\-])+\.)+([a-z0-9]{2,4})+/i';
+ // preg match all in the string
+ preg_match_all( $pattern, $Decoded->headers['from'], $emails );
+ if ( !empty($emails[0]) ) {
+ if ( $emails[0][0] == 'lester@lsces.co.uk' ) {
+ preg_match_all( $pattern, $Decoded->headers['to'], $to_emails );
+ }
- if ( !empty($to_emails[0]) ) {
- $from_emails = array_unique($to_emails[0]);
- } else {
- $from_emails = array_unique($emails[0]);
- }
+ if ( !empty($to_emails[0]) ) {
+ $from_emails = array_unique($to_emails[0]);
+ } else {
+ $from_emails = array_unique($emails[0]);
+ }
- $sql = "SELECT e.* FROM `".BIT_DB_PREFIX."contact_email` e WHERE e.`email` = ?";
- $result = $storeComment->mDb->getRow( $sql, $from_emails );
- if( $result ) {
- $table = BIT_DB_PREFIX."contact_email";
- $email['email_store']['end_date'] = strtotime( $dateTime->format(DATE_ATOM) );
+ $sql = "SELECT e.* FROM `".BIT_DB_PREFIX."contact_email` e WHERE e.`email` = ?";
+ $result = $storeComment->mDb->getRow( $sql, $from_emails );
+ if( $result ) {
+ $table = BIT_DB_PREFIX."contact_email";
+ $email['email_store']['end_date'] = strtotime( $dateTime->format(DATE_ATOM) );
+
+ $result = $storeComment->mDb->associateUpdate( $table, $email['email_store'], array( "email" => $from_emails[0] ) );
+ } else {
+ $table = BIT_DB_PREFIX."contact_email";
+ $email['email_store']['email'] = $from_emails[0];
+ $email['email_store']['start_date'] = strtotime( $dateTime->format(DATE_ATOM) );
+ $email['email_store']['end_date'] = strtotime( $dateTime->format(DATE_ATOM) );
- $result = $storeComment->mDb->associateUpdate( $table, $email['email_store'], array( "email" => $from_emails[0] ) );
+ $result = $storeComment->mDb->associateInsert( $table, $email['email_store'] );
+ }
} else {
- $table = BIT_DB_PREFIX."contact_email";
- $email['email_store']['email'] = $from_emails[0];
- $email['email_store']['start_date'] = strtotime( $dateTime->format(DATE_ATOM) );
- $email['email_store']['end_date'] = strtotime( $dateTime->format(DATE_ATOM) );
-
- $result = $storeComment->mDb->associateInsert( $table, $email['email_store'] );
+ \Bitweaver\vd( $Decoded->headers );
}
- } else {
- vd( $Decoded->headers );
- }
- */
+ */
// define our search pattern to extract any email addresses
// $pattern = '#(?<=s/)[^\s@]+@[^\s@_]#';
// $pattern = '/([A-Za-z0-9\.\-\_\!\#\$\%\&\'\*\+\/\=\?\^\`\{\|\}]+)\@([A-Za-z0-9.-_]+)(\.[A-Za-z]{2,5})/';
@@ -147,58 +140,53 @@ for ($n = 0; $n < $mbox->size(); $n++) {
preg_match_all( $pattern, $Decoded->headers['to'], $to_emails );
}
- if ( !empty($to_emails[0]) ) {
- $from_emails = array_unique($to_emails[0]);
- } else {
- $from_emails = array_unique($emails[0]);
- }
+ $from_emails = ( !empty( $to_emails[0] ) ) ? array_unique( $to_emails[0] ) : array_unique( $emails[0] );
- $sql = "SELECT e.content_id FROM `".BIT_DB_PREFIX."contact_xref` e WHERE e.`xkey_ext` = ?";
+ $sql = "SELECT e.content_id FROM `" . BIT_DB_PREFIX . "contact_xref` e WHERE e.`xkey_ext` = ?";
$result = $storeComment->mDb->getRow( $sql, $from_emails );
- if( $result ) {
+ if ($result) {
$email['comments_parent_id'] = $result['content_id'];
} else {
- $sql = "SELECT e.* FROM `".BIT_DB_PREFIX."contact_email` e WHERE e.`email` = ?";
+ $sql = "SELECT e.* FROM `" . BIT_DB_PREFIX . "contact_email` e WHERE e.`email` = ?";
$result = $storeComment->mDb->getRow( $sql, $from_emails );
- if( $result ) {
- $table = BIT_DB_PREFIX."contact_email";
- $email['email_store']['end_date'] = strtotime( $dateTime->format(DATE_ATOM) );
-
+ if ($result) {
+ $table = BIT_DB_PREFIX . "contact_email";
+ $email['email_store']['end_date'] = strtotime( $dateTime->format( DATE_ATOM ) );
+
$result = $storeComment->mDb->associateUpdate( $table, $email['email_store'], array( "email" => $from_emails[0] ) );
} else {
- $table = BIT_DB_PREFIX."contact_email";
+ $table = BIT_DB_PREFIX . "contact_email";
$email['email_store']['email'] = $from_emails[0];
- $email['email_store']['start_date'] = strtotime( $dateTime->format(DATE_ATOM) );
- $email['email_store']['end_date'] = strtotime( $dateTime->format(DATE_ATOM) );
+ $email['email_store']['start_date'] = strtotime( $dateTime->format( DATE_ATOM ) );
+ $email['email_store']['end_date'] = strtotime( $dateTime->format( DATE_ATOM ) );
$result = $storeComment->mDb->associateInsert( $table, $email['email_store'] );
- }
+ }
}
} else {
- vd( $Decoded->headers );
- }
-/*
- if( $storeComment->storeComment( &$email )) {
- // store successful
+ \Bitweaver\vd( $Decoded->headers );
}
-*/
+ /*
+ if( $storeComment->storeComment( &$email )) {
+ // store successful
+ }
+ */
}
$mbox->close();
-if( $gContent->isCommentable() ) {
+if ($gContent->isCommentable()) {
$commentsParentId = $gContent->mContentId;
- $comments_vars = Array('contact');
- $comments_prefix_var='contact:';
- $comments_object_var='contact';
- $comments_return_url = $_SERVER['PHP_SELF']."?content_id=".$gContent->mContentId;
- include_once( LIBERTY_PKG_PATH.'comments_inc.php' );
+ $comments_vars = array( 'contact' );
+ $comments_prefix_var = 'contact:';
+ $comments_object_var = 'contact';
+ $comments_return_url = $_SERVER['PHP_SELF'] . "?content_id=" . $gContent->mContentId;
+ include_once LIBERTY_PKG_PATH . 'comments_inc.php';
}
$gContent->mInfo['type'] = $gContent->getContactGroupList();
$gBitSystem->setBrowserTitle("Contact Information");
$gBitSystem->display( 'bitpackage:contact/show_contact.tpl');
-?>
diff --git a/load_sage_contacts.php b/load_sage_contacts.php
new file mode 100755
index 0000000..b904adc
--- /dev/null
+++ b/load_sage_contacts.php
@@ -0,0 +1,53 @@
+<?php
+/*
+ * Created on 5 Jan 2008
+ *
+ * To change the template for this generated file go to
+ * Window - Preferences - PHPeclipse - PHP - Code Templates
+ */
+
+// Initialization
+require_once '../kernel/includes/setup_inc.php';
+use Bitweaver\Contact\Contact;
+use Bitweaver\KernelTools;
+
+// Is package installed and enabled
+$gBitSystem->verifyPackage( 'contact' );
+
+// Now check permissions to access this page
+$gBitSystem->verifyPermission('p_contact_admin' );
+
+$contact = new Contact();
+
+$contact->SageDataExpunge();
+
+$row = 0;
+
+$handle = fopen("data/customers.csv", "r");
+if ( $handle == FALSE) {
+ $row = -999;
+} else {
+ while (($data = fgetcsv($handle, 800, ",")) !== FALSE) {
+ if ( $row ) $contact->SageRecordLoad( $data, 1 );
+ $row++;
+ }
+ fclose($handle);
+}
+
+$gBitSmarty->assign( 'customers', $row );
+$row = 0;
+
+$handle = fopen("data/suppliers.csv", "r");
+if ( $handle == FALSE) {
+ $row = -999;
+} else {
+ while (($data = fgetcsv($handle, 800, ",")) !== FALSE) {
+ if ( $row ) $contact->SageRecordLoad( $data, 2 );
+ $row++;
+ }
+ fclose($handle);
+}
+
+$gBitSmarty->assign( 'suppliers', $row );
+
+$gBitSystem->display( 'bitpackage:contacts/load_sage_contacts.tpl', KernelTools::tra( 'Load results: ' ) );
diff --git a/lookup_contact_xref_type_inc.php b/lookup_contact_xref_type_inc.php
deleted file mode 100644
index 8a98aab..0000000
--- a/lookup_contact_xref_type_inc.php
+++ /dev/null
@@ -1,25 +0,0 @@
-<?php
-/**
- * @version $Header$
- * @package contact
- * @subpackage functions
- */
-
-/**
- * Initialization
- */
- global $gContent;
- require_once( CONTACT_PKG_PATH.'Contact.php');
-
- // if we already have a gContent, we assume someone else created it for us, and has properly loaded everything up.
- if( empty( $gContent ) || !is_object( $gContent ) ) {
- if (!empty($_REQUEST['xref_id']) && is_numeric($_REQUEST['xref_id'])) {
- $gContent = new ContactXref( $_REQUEST['xref_id'] );
- $gContent = new ContactXref( $_REQUEST['xref_id'] );
- } else {
- $gContent = new Contact();
- }
-
- $gBitSmarty->assignByRef( 'gContent', $gContent );
- }
-?>
diff --git a/modules/index.php b/modules/index.php
index 3e305fe..3e305fe 100644..100755
--- a/modules/index.php
+++ b/modules/index.php
diff --git a/process.php b/process.php
new file mode 100755
index 0000000..b8271f7
--- /dev/null
+++ b/process.php
@@ -0,0 +1,57 @@
+<?php
+
+use Bitweaver\KernelTools;
+/**
+ * $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
+ * @subpackage functions
+ */
+
+/**
+ * required setup
+ */
+require_once '../kernel/includes/setup_inc.php';
+
+$gBitSystem->verifyPackage( 'contact' );
+$gBitSystem->verifyPackage( 'form' );
+// $gBitSystem->verifyPermission( 'p_contact_view' );
+
+include_once CONTACT_PKG_INCLUDE_PATH . 'lookup_contact_inc.php';
+use Bitweaver\Form\Form;
+
+global $gBitSystem, $gBitSmarty;
+
+$gForm = new Form( 1, NULL );
+$gForm->getFieldList( $_REQUEST );
+$gBitSmarty->assign( '$gContent->mInfo', $_REQUEST );
+//$gTemplate->getTemplateList();
+
+$gBitSmarty->assign( 'formInfo', $gForm->mForm );
+
+// Process return
+if (isset($_REQUEST["fCancel"])) {
+ if( !empty( $gContent->mContentId ) ) {
+ KernelTools::bit_redirect( $gContent->getDisplayUrl() );
+ } else {
+ KernelTools::bit_redirect( CONTACT_PKG_URL );
+ }
+} elseif (isset($_REQUEST["form"])) {
+ if( $gForm->storeForm( $_REQUEST, $gContent ) ) {
+ KernelTools::bit_redirect( $gContent->getDisplayUrl() );
+ } else {
+ $formInfo = $_REQUEST;
+ $formInfo['data'] = &$_REQUEST['edit'];
+ }
+}
+
+// formInfo might be set due to a error on submit
+if( empty( $formInfo ) ) {
+// $formInfo = &$gContent->mInfo;
+}
+
+$gBitSystem->display( 'bitpackage:contact/employment.tpl', 'Edit: ' , array( 'display_mode' => 'edit' ));
diff --git a/templates/add_xref.tpl b/templates/add_xref.tpl
index 1c2b6c2..6b07030 100644..100755
--- a/templates/add_xref.tpl
+++ b/templates/add_xref.tpl
@@ -1,5 +1,5 @@
{literal}
-<script type="text/javascript">//<![CDATA[
+<script>//<![CDATA[
function updateContactXrefFormat() { {/literal}
{foreach from=$xrefInfo.xref_format_list key=feature item=output}
document.getElementById('{$output}-format').style.display = 'none';
diff --git a/templates/add_xref_address.tpl b/templates/add_xref_address.tpl
index 67374cd..67374cd 100644..100755
--- a/templates/add_xref_address.tpl
+++ b/templates/add_xref_address.tpl
diff --git a/templates/admin_contact.tpl b/templates/admin_contact.tpl
index bb2de40..bb2de40 100644..100755
--- a/templates/admin_contact.tpl
+++ b/templates/admin_contact.tpl
diff --git a/templates/admin_contact_type.tpl b/templates/admin_contact_type.tpl
index cbcef19..cbcef19 100644..100755
--- a/templates/admin_contact_type.tpl
+++ b/templates/admin_contact_type.tpl
diff --git a/templates/admin_xref_types.tpl b/templates/admin_xref_types.tpl
index 41eb9c1..41eb9c1 100644..100755
--- a/templates/admin_xref_types.tpl
+++ b/templates/admin_xref_types.tpl
diff --git a/templates/comments.tpl b/templates/comments.tpl
index d0b78fc..64970a9 100644..100755
--- a/templates/comments.tpl
+++ b/templates/comments.tpl
@@ -7,7 +7,7 @@
<div class="body"{if !( $post_comment_request || $post_comment_preview )} id="editcomments"{/if}>
<div id="edit_comments" {if $comments_ajax}style="display:none"{/if}>
- {include file="bitpackage:contact/comments_post_inc.tpl" post_title="Post Comment"}
+ {include file="bitpackage:liberty/comments_post_inc.tpl" post_title="Post Comment"}
</div>
{include file="bitpackage:liberty/comments_display_option_bar.tpl"}
@@ -20,11 +20,11 @@
<div id="comment_{$gContent->mContentId}"></div>
{foreach name=comments_loop key=key item=item from=$comments}
- {displaycomment comment="$item"}
+ {displaycomment comment=$item}
{/foreach}
<div id="comment_{$gContent->mContentId}_footer"></div>
- {libertypagination ihash=$commentsPgnHash}
+ {pagination}
</div><!-- end .body -->
</div><!-- end .comment -->
{/strip}
diff --git a/templates/comments_edit.tpl b/templates/comments_edit.tpl
index a6dc14f..a6dc14f 100644..100755
--- a/templates/comments_edit.tpl
+++ b/templates/comments_edit.tpl
diff --git a/templates/comments_post_inc.tpl b/templates/comments_post_inc.tpl
index 1dcfa3f..d28b54a 100644..100755
--- a/templates/comments_post_inc.tpl
+++ b/templates/comments_post_inc.tpl
@@ -54,7 +54,7 @@
{formhelp note=""}
{/forminput}
</div>
- {captcha variant="row" id="post-captcha" style="display:none"}
+ {* captcha variant="row" id="post-captcha" style="display:none" *}
<div class="form-group">
{forminput}
<input type="checkbox" name="anon_post" id="anon-post" value="y" onchange="BitBase.toggleElementDisplay('post-login','block');BitBase.toggleElementDisplay('post-anon','block');BitBase.toggleElementDisplay('post-captcha','block');" /> {tr}Anonymous Post{/tr}
diff --git a/templates/contact.tpl b/templates/contact.tpl
index d6715e9..d6715e9 100644..100755
--- a/templates/contact.tpl
+++ b/templates/contact.tpl
diff --git a/templates/contact_action_bar.tpl b/templates/contact_action_bar.tpl
index 2e7a75d..2e7a75d 100644..100755
--- a/templates/contact_action_bar.tpl
+++ b/templates/contact_action_bar.tpl
diff --git a/templates/contact_date_bar.tpl b/templates/contact_date_bar.tpl
index 77ca728..0ab0290 100644..100755
--- a/templates/contact_date_bar.tpl
+++ b/templates/contact_date_bar.tpl
@@ -5,16 +5,16 @@
{if $print_page ne 'y'}
{if !$lock}
{if $gBitUser->hasPermission('p_edit_contact')}
- {smartlink ititle='Add additional crossref record' ifile="add_xref.php" booticon="icon-note-add" content_id=$pageInfo.content_id xref_type=-1}
- {smartlink ititle="Edit Contact" ifile="edit.php" booticon="icon-user-edit" content_id=$pageInfo.content_id}
+ {smartlink ititle='Add additional crossref record' ifile="add_xref.php" booticon="icon-note-add" content_id=$gContent->mInfo.content_id xref_type=-1}
+ {smartlink ititle="Edit Contact" ifile="edit.php" booticon="icon-user-edit" content_id=$gContent->mInfo.content_id}
{/if}
{/if}
- <a title="{tr}print{/tr}" href="print.php?content_id={$pageInfo.content_id}">{booticon ipackage="icons" iname="icon-print" iexplain="print"}</a>
+ <a title="{tr}print{/tr}" href="print.php?content_id={$gContent->mInfo.content_id}">{booticon ipackage="icons" iname="icon-print" iexplain="print"}</a>
{if $gBitUser->hasPermission('p_remove_contact')}
- <a title="{tr}remove this contact{/tr}" href="remove_contact.php?content_id={$pageInfo.content_id}">{booticon ipackage="icons" iname="icon-user-delete" iexplain="delete"}</a>
+ <a title="{tr}remove this contact{/tr}" href="remove_contact.php?content_id={$gContent->mInfo.content_id}">{booticon ipackage="icons" iname="icon-user-delete" iexplain="delete"}</a>
{/if}
{/if} {* end print_page *}
</div> {*end .floaticon *}
<div class="date">
- {tr}Created by{/tr} {displayname user=$pageInfo.creator_user user_id=$pageInfo.user_id real_name=$pageInfo.creator_real_name}, {tr}Last modification by{/tr} {displayname user=$pageInfo.modifier_user user_id=$pageInfo.modifier_user_id real_name=$pageInfo.modifier_real_name} on {$pageInfo.last_modified|bit_long_datetime}
+ {tr}Created by{/tr} {displayname user=$gContent->mInfo.creator_user user_id=$gContent->mInfo.user_id real_name=$gContent->mInfo.creator_real_name}, {tr}Last modification by{/tr} {displayname user=$gContent->mInfo.modifier_user user_id=$gContent->mInfo.modifier_user_id real_name=$gContent->mInfo.modifier_real_name} on {$gContent->mInfo.last_modified|bit_long_datetime}
</div>
diff --git a/templates/contact_display.tpl b/templates/contact_display.tpl
index d1b612f..2940e64 100644..100755
--- a/templates/contact_display.tpl
+++ b/templates/contact_display.tpl
@@ -1,17 +1,17 @@
<div class="body">
<div class="content">
{include file="bitpackage:liberty/storage_thumbs.tpl"}
- Title: {$pageInfo.prefix}<br />
- Forename: {$pageInfo.forename}<br />
- Surname: {$pageInfo.surname}<br />
- Suffix: {$pageInfo.suffix}<br />
+ Title: {$gContent->mInfo.prefix}<br />
+ Forename: {$gContent->mInfo.forename}<br />
+ Surname: {$gContent->mInfo.surname}<br />
+ Suffix: {$gContent->mInfo.suffix}<br />
<br />
- Organisation: {$pageInfo.organisation}<br />
+ Organisation: {$gContent->mInfo.organisation}<br />
<br />
- NI Number:{$pageInfo.nino} Date of Birth:{$pageInfo.dob} Date of eighteenth:{$pageInfo.eighteenth} Date of Death:{$pageInfo.dod} <br />
+ NI Number:{$gContent->mInfo.nino} Date of Birth:{$gContent->mInfo.dob} Date of eighteenth:{$gContent->mInfo.eighteenth} Date of Death:{$gContent->mInfo.dod} <br />
<br />
- Note: {$pageInfo.note}<br />
+ Note: {$gContent->mInfo.note}<br />
Memo:<br />
- {$pageInfo.data}<br />
+ {$gContent->mInfo.data}<br />
</div><!-- end .content -->
</div><!-- end .body -->
diff --git a/templates/contact_header.tpl b/templates/contact_header.tpl
index 0184bf9..3106b5e 100644..100755
--- a/templates/contact_header.tpl
+++ b/templates/contact_header.tpl
@@ -5,17 +5,17 @@
</div> {* end category *}
{/if}
- <h1>{$pageInfo.xkey}&nbsp;-&nbsp;
-{* {if isset($pageInfo.organisation) && ($pageInfo.organisation <> '') }
- {$pageInfo.organisation}
- {elseif isset($pageInfo.surname) && ($pageInfo.surname <> '') }
- {$pageInfo.prefix}&nbsp;
- {$pageInfo.forename}&nbsp;
- {$pageInfo.surname}
+ <h1>{$gContent->mInfo.xkey}&nbsp;-&nbsp;
+{* {if isset(gContent->mInfo.organisation) && (gContent->mInfo.organisation <> '') }
+ {$gContent->mInfo.organisation}
+ {elseif isset(gContent->mInfo.surname) && (gContent->mInfo.surname <> '') }
+ {$gContent->mInfo.prefix}&nbsp;
+ {$gContent->mInfo.forename}&nbsp;
+ {$gContent->mInfo.surname}
{else} *}
- {$pageInfo.title}
+ {$gContent->mInfo.title}
{* {/if} *}
</h1>
- <div class="description">{$pageInfo.description}</div>
+ <div class="description">{$gContent->mInfo.description|default:''}</div>
</div> {* end .header *}
diff --git a/templates/contact_options_inc.tpl b/templates/contact_options_inc.tpl
index 51b0fc1..e360c3f 100644..100755
--- a/templates/contact_options_inc.tpl
+++ b/templates/contact_options_inc.tpl
@@ -8,7 +8,7 @@
{/foreach}
/> {$type}&nbsp;&nbsp;
{/foreach}
-<script type="text/javascript">/* <![CDATA[ */
+<script>/* <![CDATA[ */
document.write("<label><input name=\"switcher\" id=\"switcher\" type=\"checkbox\" onclick=\"BitBase.switchCheckboxes(this.form.id,'contact_type_guid[]','switcher')\" /> {tr}Select all{/tr}</label><br />");
/* ]]> */</script>
<input type="submit" name="refresh" value="{tr}Update Contact Filter{/tr}" />&nbsp;&nbsp;&nbsp;&nbsp;
diff --git a/templates/display_address.tpl b/templates/display_address.tpl
index 37c1aff..84e8bf3 100644..100755
--- a/templates/display_address.tpl
+++ b/templates/display_address.tpl
@@ -1,46 +1,46 @@
<div class="form-group">
{formlabel label="$header" for="lpi"}
{forminput}
- {if isset($address.sao) && ($address.sao <> '') }
+ {if !empty($address.sao)}
{$address.sao},&nbsp;{/if}
- {if isset($address.pao) && ($address.pao <> '') }
+ {if !empty($address.pao)}
{$address.pao},<br />{/if}
- {if isset($address.number) && ($address.number <> '') }
+ {if !empty($address.number)}
{$address.number},<br />{/if}
- {if isset($address.house) && ($address.house <> '') }
+ {if !empty($address.house)}
{$address.house},<br />{/if}
- {if isset($address.add1) && ($address.add1 <> '') }
+ {if !empty($address.add1)}
{$address.add1},<br />{/if}
- {if isset($address.add2) && ($address.add2 <> '') }
+ {if !empty($address.add2)}
{$address.add2},&nbsp;{/if}
- {if isset($address.add3) && ($address.add3 <> '') }
+ {if !empty($address.add3)}
{$address.add3},<br />{/if}
- {if isset($address.add4) && ($address.add4 <> '') }
+ {if !empty($address.add4)}
{$address.add4},&nbsp;{/if}
- {if isset($address.town) && ($address.town <> '') }
+ {if !empty($address.town)}
{$address.town},&nbsp;{/if}
- {if isset($address.county) && ($address.county <> '') }
+ {if !empty($address.county)}
{$address.county},&nbsp;{/if}
{$address.postcode}&nbsp;&nbsp;
{/forminput}
<div class="clear"></div>
</div>
- {if $locate == 1 && isset($address.x_coordinate) && ($address.x_coordinate <> '') }
+ {if $locate == 1 && !empty($address.x_coordinate)}
<div class="form-group">
{formlabel label="Visual Centre Coordinates" for="street_start_x"}
{forminput}
Lat: {$address.y_coordinate|escape} Lon: {$address.x_coordinate|escape}
<br />&lt;<a href="http://www.openstreetmap.org/index.html?mlat={$address.y_coordinate}&mlon={$address.x_coordinate}&zoom=16&layers=BOFT" title="{$propertyInfo.title}" target="_blank">
OpenStreetMap
- </a>&gt;&nbsp;&lt;<a href="http://www.bing.com/maps/?cp={$address.y_coordinate}~{$address.x_coordinate}&lvl=16&style=r&q={$address.postcode}#" title="{$address.title}" target="_blank">
+ </a>&gt;&nbsp;&lt;<a href="http://www.bing.com/maps/?cp={$address.y_coordinate}~{$address.x_coordinate}&lvl=16&style=r&q={$address.postcode}#" title="{$address.title|default:'Bing'}" target="_blank">
Multimap
- </a>&gt;&nbsp;&lt;<a href="http://www.google.co.uk/maps?f=q&source=s_q&hl=en&q={$address.postcode}&ll={$address.y_coordinate},{$address.x_coordinate}&z=16" title="{$address.title}" target="_blank">
+ </a>&gt;&nbsp;&lt;<a href="http://www.google.co.uk/maps?f=q&source=s_q&hl=en&q={$address.postcode}&ll={$address.y_coordinate},{$address.x_coordinate}&z=16" title="{$address.title|default:'Google'}" target="_blank">
Google
</a>&gt;<br />
Navigate to &lt;<a href="http://openrouteservice.org/index.php?start=-1.860930,52.039980&end={$address.x_coordinate},{$address.y_coordinate}&pref=Fastest&lang=en&unit=MI" title="{$propertyInfo.title}" target="_blank">
OpenRouteService
</a>&gt;
- {$address.rpa|escape}
+ {$address.rpa|default:'RPA'|escape}
{/forminput}
<div class="clear"></div>
</div>
diff --git a/templates/display_contact.tpl b/templates/display_contact.tpl
index 92646f3..96767b0 100644..100755
--- a/templates/display_contact.tpl
+++ b/templates/display_contact.tpl
@@ -1,57 +1,57 @@
{include file="bitpackage:contact/display_type_header.tpl"}
- {if isset($pageInfo.usn) && ($pageInfo.usn <> '') }
+ {if isset($gContent->mInfo.usn) && ($gContent->mInfo.usn <> '') }
<div class="form-group">
{formlabel label="USN" for="usn"}
{forminput}
- {$pageInfo.usn|escape}
+ {$gContent->mInfo.usn|escape}
{/forminput}
<div class="clear"></div>
</div>
{/if}
- {if isset($pageInfo.name) && ($pageInfo.name <> '') }
+ {if isset($gContent->mInfo.name) && ($gContent->mInfo.name <> '') }
<div class="form-group">
{formlabel label="Name" for="name"}
{forminput}
- {$pageInfo.name|escape}
+ {$gContent->mInfo.name|escape}
{/forminput}
<div class="clear"></div>
</div>
{/if}
- {if isset($pageInfo.organisation) && ($pageInfo.organisation <> '') }
+ {if isset($gContent->mInfo.organisation) && ($gContent->mInfo.organisation <> '') }
<div class="form-group">
{formlabel label="Organisation" for="organisation"}
{forminput}
- {$pageInfo.organisation|escape}
+ {$gContent->mInfo.organisation|escape}
{/forminput}
<div class="clear"></div>
</div>
{/if}
- {if isset($pageInfo.dob) && ($pageInfo.dob <> '') }
+ {if isset($gContent->mInfo.dob) && ($gContent->mInfo.dob <> '') }
<div class="form-group">
{formlabel label="Date of Birth" for="dob"}
{forminput}
- {$pageInfo.dob|bit_long_date}
+ {$gContent->mInfo.dob|bit_long_date}
{/forminput}
<div class="clear"></div>
</div>
{/if}
- {if isset($pageInfo.nino) && ($pageInfo.nino <> '') }
+ {if isset($gContent->mInfo.nino) && ($gContent->mInfo.nino <> '') }
<div class="form-group">
{formlabel label="National Insurance Number" for="nino"}
{forminput}
- {$pageInfo.nino|escape}
+ {$gContent->mInfo.nino|escape}
{/forminput}
<div class="clear"></div>
</div>
{/if}
- {section name=address loop=$pageInfo.address}
- {include file="bitpackage:contact/display_address.tpl" header=$pageInfo.address[address].source_title address=$pageInfo.address[address] locate=1}
+ {section name=address loop=$gContent->mInfo.address}
+ {include file="bitpackage:contact/display_address.tpl" header=$gContent->mInfo.address[address].source_title address=$gContent->mInfo.address[address] locate=1}
{sectionelse}
<li class="item norecords">
{tr}No addresses found{/tr}
{if $gBitUser->hasPermission('p_edit_contact')}
- {smartlink ititle="Add an address record" ifile="add_xref_address.php" booticon="icon-note-add" content_id=$pageInfo.content_id}
+ {smartlink ititle="Add an address record" ifile="add_xref_address.php" booticon="icon-note-add" content_id=$gContent->mInfo.content_id}
{/if}
</li>
{/section}
@@ -59,12 +59,12 @@
<div class="form-group">
{formlabel label="General Notes" for="data"}
{forminput}
- {$pageInfo.data}
+ {$gContent->mInfo.data}
{/forminput}
</div>
{jstabs}
- {section name=type loop=$pageInfo.type}
- {include file="bitpackage:contact/list_xref_generic.tpl" source=$pageInfo.type[type].source source_title=$pageInfo.type[type].title xref_type=$pageInfo.type[type].xref_type}
+ {section name=type loop=$gContent->mInfo.type}
+ {include file="bitpackage:contact/list_xref_generic.tpl" source=$gContent->mInfo.type[type].source source_title=$gContent->mInfo.type[type].title xref_type=$gContent->mInfo.type[type].xref_type}
{/section}
{/jstabs}
diff --git a/templates/display_list_header.tpl b/templates/display_list_header.tpl
index 82f1f56..58269be 100644..100755
--- a/templates/display_list_header.tpl
+++ b/templates/display_list_header.tpl
@@ -5,24 +5,14 @@
{/foreach}
<input type="hidden" name="sort_mode" value="{$sort_mode|default:$smarty.request.sort_mode}" />
- {include file="bitpackage:contact/contact_options_inc.tpl"}
- <input type="submit" name="refresh" value="{tr}Update Contact Filter{/tr}" />&nbsp;&nbsp;&nbsp;&nbsp;
- {if $gBitUser->hasPermission('p_edit_contact')}
- <input type="hidden" name="active" value="{$active|default:$smarty.request.active}" />
- <input type="submit" name="active" value="{tr}Active{/tr}" />&nbsp;
- <input type="submit" name="active" value="{tr}Inactive{/tr}" />&nbsp;
- <input type="submit" name="active" value="{tr}All{/tr}" />
- {/if}
- <br /><br />
-
- {biticon ipackage="icons" iname="edit-find" iexplain="Search"} &nbsp;
- <label>{tr}Key{/tr}:&nbsp;<input size="6" type="text" name="find_key" value="{$find_key|default:$smarty.request.find_key|escape}" /></label> &nbsp;
- <label>{tr}Title{/tr}:&nbsp;<input size="20" type="text" name="find_title" value="{$find_title|default:$smarty.request.find_title|escape}" /></label> &nbsp;
- <label>{tr}Location{/tr}:&nbsp;<input size="20" type="text" name="find_location" value="{$find_location|default:$smarty.request.find_location|escape}" /></label> &nbsp;
- <label>{tr}Postcode{/tr}:&nbsp;<input size="10" type="text" name="find_postcode" value="{$find_postcode|default:$smarty.request.find_postcode|escape}" /></label> &nbsp;
- <br />
- <label>{tr}Number{/tr}:&nbsp;<input size="10" type="text" name="find_xref" value="{$find_xref|default:$smarty.request.find_xref|escape}" /></label> &nbsp;
- <input type="submit" name="search" value="{tr}Find{/tr}" />&nbsp;
- <input type="button" onclick="location.href='{$smarty.server.PHP_SELF}{if $hidden}?{/if}{foreach from=$hidden item=value key=name}{$name}={$value}&amp;{/foreach}'" value="{tr}Reset{/tr}" />
+ <label class="col-md-1 col-sm-3 col-xs-12">{tr}Key{/tr}:&nbsp;<input size="4" type="text" name="find_key" value="{$find_key|default:$smarty.request.find_key|escape}" /></label>
+ <label class="col-md-3 col-sm-3 col-xs-12">{tr}Title{/tr}:&nbsp;<input size="20" type="text" name="find_title" value="{$find_title|default:$smarty.request.find_title|escape}" /></label>
+ <label class="col-md-3 col-sm-3 col-xs-12">{tr}Location{/tr}:&nbsp;<input size="20" type="text" name="find_location" value="{$find_location|default:$smarty.request.find_location|escape}" /></label>
+ <label class="col-md-2 col-sm-3 col-xs-12">{tr}Postcode{/tr}:&nbsp;<input size="10" type="text" name="find_postcode" value="{$find_postcode|default:$smarty.request.find_postcode|escape}" /></label>
+ <label class="col-md-2 col-sm-3 col-xs-12">{tr}Number{/tr}:&nbsp;<input size="10" type="text" name="find_xref" value="{$find_xref|default:$smarty.request.find_xref|escape}" /></label>
+ <div class="col-md-1 col-sm-3 col-xs-12">
+ <input type="submit" name="search" value="{tr}Find{/tr}" />&nbsp;
+ <input type="button" onclick="location.href='{$smarty.server.PHP_SELF}{if $hidden}?{/if}{foreach from=$hidden item=value key=name}{$name}={$value}&amp;{/foreach}'" value="{tr}Reset{/tr}" />
+ </div>
{/form}
</div> \ No newline at end of file
diff --git a/templates/display_list_header1.tpl b/templates/display_list_header1.tpl
index f2ed2b0..f2ed2b0 100644..100755
--- a/templates/display_list_header1.tpl
+++ b/templates/display_list_header1.tpl
diff --git a/templates/display_list_header2.tpl b/templates/display_list_header2.tpl
new file mode 100755
index 0000000..82f1f56
--- /dev/null
+++ b/templates/display_list_header2.tpl
@@ -0,0 +1,28 @@
+ <div class="navbar">
+ {form class="find" legend="Find in Contact entries" id="data_options"}
+ {foreach from=$hidden item=value key=name}
+ <input type="hidden" name="{$name}" value="{$value}" />
+ {/foreach}
+ <input type="hidden" name="sort_mode" value="{$sort_mode|default:$smarty.request.sort_mode}" />
+
+ {include file="bitpackage:contact/contact_options_inc.tpl"}
+ <input type="submit" name="refresh" value="{tr}Update Contact Filter{/tr}" />&nbsp;&nbsp;&nbsp;&nbsp;
+ {if $gBitUser->hasPermission('p_edit_contact')}
+ <input type="hidden" name="active" value="{$active|default:$smarty.request.active}" />
+ <input type="submit" name="active" value="{tr}Active{/tr}" />&nbsp;
+ <input type="submit" name="active" value="{tr}Inactive{/tr}" />&nbsp;
+ <input type="submit" name="active" value="{tr}All{/tr}" />
+ {/if}
+ <br /><br />
+
+ {biticon ipackage="icons" iname="edit-find" iexplain="Search"} &nbsp;
+ <label>{tr}Key{/tr}:&nbsp;<input size="6" type="text" name="find_key" value="{$find_key|default:$smarty.request.find_key|escape}" /></label> &nbsp;
+ <label>{tr}Title{/tr}:&nbsp;<input size="20" type="text" name="find_title" value="{$find_title|default:$smarty.request.find_title|escape}" /></label> &nbsp;
+ <label>{tr}Location{/tr}:&nbsp;<input size="20" type="text" name="find_location" value="{$find_location|default:$smarty.request.find_location|escape}" /></label> &nbsp;
+ <label>{tr}Postcode{/tr}:&nbsp;<input size="10" type="text" name="find_postcode" value="{$find_postcode|default:$smarty.request.find_postcode|escape}" /></label> &nbsp;
+ <br />
+ <label>{tr}Number{/tr}:&nbsp;<input size="10" type="text" name="find_xref" value="{$find_xref|default:$smarty.request.find_xref|escape}" /></label> &nbsp;
+ <input type="submit" name="search" value="{tr}Find{/tr}" />&nbsp;
+ <input type="button" onclick="location.href='{$smarty.server.PHP_SELF}{if $hidden}?{/if}{foreach from=$hidden item=value key=name}{$name}={$value}&amp;{/foreach}'" value="{tr}Reset{/tr}" />
+ {/form}
+ </div> \ No newline at end of file
diff --git a/templates/display_type_header.tpl b/templates/display_type_header.tpl
index bdfe449..7440659 100644..100755
--- a/templates/display_type_header.tpl
+++ b/templates/display_type_header.tpl
@@ -1,7 +1,7 @@
<div class="form-group">
{formlabel label="Content Types" for=content_types}
{forminput}
- {foreach from=$pageInfo.contact_types key=type_id item=type}
+ {foreach from=$gContent->mInfo.contact_types key=type_id item=type}
{if isset($type.content_id) }{$type.cross_ref_title}<br/> {/if}
{/foreach}
{/forminput}
diff --git a/templates/edit.tpl b/templates/edit.tpl
index 0f14069..9aae398 100644..100755
--- a/templates/edit.tpl
+++ b/templates/edit.tpl
@@ -7,9 +7,9 @@
<div class="header">
<h1>
{* this weird dual assign thing is cause smarty wont interpret backticks to object in assign tag - spiderr *}
- {if $pageInfo.content_id}
+ {if $gContent->mInfo.content_id}
{assign var=editLabel value="{tr}Edit{/tr} $conDescr"}
- {tr}{tr}Edit{/tr} {$pageInfo.title}{/tr}
+ {tr}{tr}Edit{/tr} {$gContent->mInfo.title}{/tr}
{else}
{assign var=editLabel value="{tr}Create{/tr} $conDescr"}
{tr}{$editLabel}{/tr}
@@ -19,7 +19,7 @@
{* Check to see if there is an editing conflict *}
{if $errors.edit_conflict}
- <script language="javascript" type="text/javascript">
+ <script>
<!--
alert( "{$errors.edit_conflict|strip_tags}" );
-->
@@ -32,20 +32,20 @@
{jstabs}
{jstab title="$editLabel Body"}
{legend legend="$editLabel Details"}
- <input type="hidden" name="content_id" value="{$pageInfo.content_id}" />
+ <input type="hidden" name="content_id" value="{$gContent->mInfo.content_id}" />
<div class="form-group">
{formfeedback warning=$errors.names}
{formfeedback warning=$errors.store}
{formlabel label="$conDescr Contact" for="contentno"}
- {if !$pageInfo.content_id}
+ {if !$gContent->mInfo.content_id}
{forminput}
New Contact Entry
{/forminput}
{else}
{forminput}
- Edit Contact Entry No : {$pageInfo.content_id}
+ Edit Contact Entry No : {$gContent->mInfo.content_id}
{/forminput}
{/if}
<div class="clear"></div>
@@ -53,41 +53,41 @@
{include file="bitpackage:contact/edit_type_header.tpl"}
- {if $pageInfo.name or $pageInfo.contact_types.0.content_id or !isset( $pageInfo.contact_types ) }
+ {if $gContent->mInfo.name or $gContent->mInfo.contact_types.0.content_id or !isset( $gContent->mInfo.contact_types ) }
<div class="form-group">
{formlabel label="Title" for="prefix"}
{forminput}
- <input size="60" type="text" name="prefix" id="prefix" value="{$pageInfo.prefix|escape}" />
+ <input size="60" type="text" name="prefix" id="prefix" value="{$gContent->mInfo.prefix|escape}" />
{/forminput}
<div class="clear"></div>
</div>
<div class="form-group">
{formlabel label="Forename" for="forename"}
{forminput}
- <input size="60" type="text" name="forename" id="forename" value="{$pageInfo.forename|escape}" />
+ <input size="60" type="text" name="forename" id="forename" value="{$gContent->mInfo.forename|escape}" />
{/forminput}
<div class="clear"></div>
</div>
<div class="form-group">
{formlabel label="Surname" for="surname"}
{forminput}
- <input size="60" type="text" name="surname" id="surname" value="{$pageInfo.surname|escape}" />
+ <input size="60" type="text" name="surname" id="surname" value="{$gContent->mInfo.surname|escape}" />
{/forminput}
<div class="clear"></div>
</div>
<div class="form-group">
{formlabel label="Suffix" for="suffix"}
{forminput}
- <input size="60" type="text" name="suffix" id="suffix" value="{$pageInfo.suffix|escape}" />
+ <input size="60" type="text" name="suffix" id="suffix" value="{$gContent->mInfo.suffix|escape}" />
{/forminput}
<div class="clear"></div>
</div>
{/if}
- {if $pageInfo.organisation or $pageInfo.contact_types.1.content_id or !isset( $pageInfo.contact_types ) }
+ {if $gContent->mInfo.organisation or $gContent->mInfo.contact_types.1.content_id or !isset( $gContent->mInfo.contact_types ) }
<div class="form-group">
{formlabel label="Organisation" for="organisation"}
{forminput}
- <input size="60" type="text" name="organisation" id="organisation" value="{$pageInfo.organisation|escape}" />
+ <input size="60" type="text" name="organisation" id="organisation" value="{$gContent->mInfo.organisation|escape}" />
{/forminput}
<div class="clear"></div>
</div>
@@ -97,7 +97,7 @@
<div class="form-group">
{formlabel label="Key Number" for="xkey"}
{forminput}
- <input size="10" type="text" name="xkey" id="xkey" value="{$pageInfo.xkey|escape}" />
+ <input size="10" type="text" name="xkey" id="xkey" value="{$gContent->mInfo.xkey|escape}" />
{/forminput}
<div class="clear"></div>
</div>
@@ -105,7 +105,7 @@
<div class="form-group">
{formlabel label="Note" for="description"}
{forminput}
- <input size="60" type="text" name="description" id="description" value="{$pageInfo.description|escape}" />
+ <input size="60" type="text" name="description" id="description" value="{$gContent->mInfo.description|escape}" />
{/forminput}
<div class="clear"></div>
</div>
@@ -115,14 +115,14 @@
{jstab title="Contact Notes"}
{legend legend="Notes Body"}
<div class="form-group">
- {textarea rows=30 noformat=1 edit=$pageInfo.edit}
+ {textarea rows=30 noformat=1 edit=$gContent->mInfo.edit}
</div>
{if $page ne 'SandBox'}
<div class="form-group">
{formlabel label="Comment" for="comment"}
{forminput}
- <input size="50" type="text" name="comment" id="comment" value="{$pageInfo.comment}" />
+ <input size="50" type="text" name="comment" id="comment" value="{$gContent->mInfo.comment}" />
{formhelp note="Add a comment to illustrate your most recent changes."}
{/forminput}
</div>
diff --git a/templates/edit_contact.tpl b/templates/edit_contact.tpl
index 93226a0..80a468b 100644..100755
--- a/templates/edit_contact.tpl
+++ b/templates/edit_contact.tpl
@@ -5,7 +5,7 @@
{* Check to see if there is an editing conflict *}
{if $editpageconflict == 'y'}
- <script language="javascript" type="text/javascript">
+ <script>
<!-- Hide Script
alert("{tr}This page is being edited by{/tr} {$semUser}. {tr}Proceed at your own peril{/tr}.")
//End Hide Script-->
@@ -15,16 +15,16 @@
<div class="admin contact">
{if $preview}
- <h2>Preview - {$pageInfo.title}</h2>
+ <h2>Preview - {$gContent->mInfo.title}</h2>
<div class="preview">
- {include file="bitpackage:contact/contact_display.tpl" page=`$pageInfo.content_id`}
+ {include file="bitpackage:contact/contact_display.tpl" page=`$gContent->mInfo.content_id`}
</div>
{/if}
<div class="header">
<h1>
- {if $pageInfo.content_id}
- {tr}{tr}Edit - {/tr} {$pageInfo.title}{/tr}
+ {if $gContent->mInfo.content_id}
+ {tr}{tr}Edit - {/tr} {$gContent->mInfo.title}{/tr}
{else}
{tr}Create New Record{/tr}
{/if}
@@ -33,49 +33,49 @@
<div class="body">
{form legend="Edit/Create Contact Record" enctype="multipart/form-data" id="editpageform"}
- <input type="hidden" name="content_id" value="{$pageInfo.content_id}" />
+ <input type="hidden" name="content_id" value="{$gContent->mInfo.content_id}" />
{include file="bitpackage:contact/edit_type_header.tpl"}
{* <div class="form-group">
{formlabel label="Title" for="title"}
{forminput}
- <input size="60" type="text" name="prefix" id="prefix" value="{$pageInfo.prefix|escape}" />
+ <input size="60" type="text" name="prefix" id="prefix" value="{$gContent->mInfo.prefix|escape}" />
{/forminput}
<div class="clear"></div>
</div>
<div class="form-group">
{formlabel label="Forename" for="forename"}
{forminput}
- <input size="60" type="text" name="forename" id="forename" value="{$pageInfo.forename|escape}" />
+ <input size="60" type="text" name="forename" id="forename" value="{$gContent->mInfo.forename|escape}" />
{/forminput}
<div class="clear"></div>
</div>
<div class="form-group">
{formlabel label="Surname" for="surname"}
{forminput}
- <input size="60" type="text" name="surname" id="surname" value="{$pageInfo.surname|escape}" />
+ <input size="60" type="text" name="surname" id="surname" value="{$gContent->mInfo.surname|escape}" />
{/forminput}
<div class="clear"></div>
</div>
<div class="form-group">
{formlabel label="Suffix" for="suffix"}
{forminput}
- <input size="60" type="text" name="suffix" id="suffix" value="{$pageInfo.suffix|escape}" />
+ <input size="60" type="text" name="suffix" id="suffix" value="{$gContent->mInfo.suffix|escape}" />
{/forminput}
<div class="clear"></div>
</div>
<div class="form-group">
{formlabel label="Organisation" for="organisation"}
{forminput}
- <input size="60" type="text" name="organisation" id="organisation" value="{$pageInfo.organisation|escape}" />
+ <input size="60" type="text" name="organisation" id="organisation" value="{$gContent->mInfo.organisation|escape}" />
{/forminput}
<div class="clear"></div>
</div>
<div class="form-group">
{formlabel label="NI Number" for="nino"}
{forminput}
- <input size="10" type="text" name="nino" id="nino" value="{$pageInfo.nino|escape}" />
+ <input size="10" type="text" name="nino" id="nino" value="{$gContent->mInfo.nino|escape}" />
{/forminput}
<div class="clear"></div>
</div>
@@ -83,7 +83,7 @@
<div class="form-group">
{formlabel label="Note" for="description"}
{forminput}
- <input size="60" type="text" name="description" id="description" value="{$pageInfo.description|escape}" />
+ <input size="60" type="text" name="description" id="description" value="{$gContent->mInfo.description|escape}" />
{/forminput}
<div class="clear"></div>
</div>
@@ -92,7 +92,7 @@
{forminput}
<input type="hidden" name="rows" value="{$rows}" />
<input type="hidden" name="cols" value="{$cols}" />
- <textarea id="{$textarea_id}" name="edit" rows="{$rows|default:20}" cols="{$cols|default:80}">{if !$preview}{$pageInfo.data|escape}{else}{$edit}{/if}</textarea>
+ <textarea id="{$textarea_id}" name="edit" rows="{$rows|default:20}" cols="{$cols|default:80}">{if !$preview}{$gContent->mInfo.data|escape}{else}{$edit}{/if}</textarea>
{/forminput}
<div class="clear"></div>
</div>
diff --git a/templates/edit_key_break.tpl b/templates/edit_key_break.tpl
index bb070af..bb070af 100644..100755
--- a/templates/edit_key_break.tpl
+++ b/templates/edit_key_break.tpl
diff --git a/templates/edit_personal.tpl b/templates/edit_personal.tpl
index 19dd8fb..d6ba46b 100644..100755
--- a/templates/edit_personal.tpl
+++ b/templates/edit_personal.tpl
@@ -1,25 +1,25 @@
<div class="form-group">
{formlabel label="NI Number" for="nino"}
{forminput}
- <input size="10" type="text" name="nino" id="nino" value="{$pageInfo.nino|escape}" />
+ <input size="10" type="text" name="nino" id="nino" value="{$gContent->mInfo.nino|escape}" />
{/forminput}
</div>
<div class="form-group">
{formlabel label="Date of Birth" for="dob"}
{forminput}
- <input size="10" type="text" name="dob" id="dob" value="{$pageInfo.dob|escape}" />
+ <input size="10" type="text" name="dob" id="dob" value="{$gContent->mInfo.dob|escape}" />
{/forminput}
</div>
<div class="form-group">
{formlabel label="Date of eighteen" for="eighteenth"}
{forminput}
- <input size="10" type="text" name="eighteenth" id="eighteenth" value="{$pageInfo.eighteenth|escape}" />
+ <input size="10" type="text" name="eighteenth" id="eighteenth" value="{$gContent->mInfo.eighteenth|escape}" />
{/forminput}
</div>
<div class="form-group">
{formlabel label="Date of Death" for="dod"}
{forminput}
- <input size="10" type="text" name="dod" id="dod" value="{$pageInfo.dod|escape}" />
+ <input size="10" type="text" name="dod" id="dod" value="{$gContent->mInfo.dod|escape}" />
{/forminput}
</div>
diff --git a/templates/edit_type_header.tpl b/templates/edit_type_header.tpl
index c37c4b8..171ec58 100644..100755
--- a/templates/edit_type_header.tpl
+++ b/templates/edit_type_header.tpl
@@ -1,12 +1,12 @@
<div class="form-group">
{formlabel label="Content Types" for=content_types}
{forminput}
- {if isset( $pageInfo.contact_types ) }
- {foreach from=$pageInfo.contact_types key=type_id item=type}
+ {if isset( $gContent->mInfo.contact_types ) }
+ {foreach from=$gContent->mInfo.contact_types key=type_id item=type}
<input type="checkbox" name="contact_types[{$type_id}]" value={$type.source} {if isset($type.content_id) } checked="checked"{/if} /> {$type.cross_ref_title}<br/>
{/foreach}
{else}
- {foreach from=$pageInfo.contact_type_list key=type_id item=type}
+ {foreach from=$gContent->mInfo.contact_type_list key=type_id item=type}
<input type="checkbox" name="contact_types[$type_id]" value={$type.source} />{$type.name}<br/>
{/foreach}
{/if}
diff --git a/templates/edit_xref.tpl b/templates/edit_xref.tpl
index d6659f9..d6659f9 100644..100755
--- a/templates/edit_xref.tpl
+++ b/templates/edit_xref.tpl
diff --git a/templates/edit_xref_address.tpl b/templates/edit_xref_address.tpl
index 5f8af06..5f8af06 100644..100755
--- a/templates/edit_xref_address.tpl
+++ b/templates/edit_xref_address.tpl
diff --git a/templates/edit_xref_address_fields.tpl b/templates/edit_xref_address_fields.tpl
index 56e282a..56e282a 100644..100755
--- a/templates/edit_xref_address_fields.tpl
+++ b/templates/edit_xref_address_fields.tpl
diff --git a/templates/edit_xref_contact.tpl b/templates/edit_xref_contact.tpl
index 2ea82b6..2ea82b6 100644..100755
--- a/templates/edit_xref_contact.tpl
+++ b/templates/edit_xref_contact.tpl
diff --git a/templates/edit_xref_contact_fields.tpl b/templates/edit_xref_contact_fields.tpl
index 11b18d4..11b18d4 100644..100755
--- a/templates/edit_xref_contact_fields.tpl
+++ b/templates/edit_xref_contact_fields.tpl
diff --git a/templates/edit_xref_dates.tpl b/templates/edit_xref_dates.tpl
index fb58492..fb58492 100644..100755
--- a/templates/edit_xref_dates.tpl
+++ b/templates/edit_xref_dates.tpl
diff --git a/templates/edit_xref_generic_fields.tpl b/templates/edit_xref_generic_fields.tpl
index 5882d41..5882d41 100644..100755
--- a/templates/edit_xref_generic_fields.tpl
+++ b/templates/edit_xref_generic_fields.tpl
diff --git a/templates/edit_xref_image.tpl b/templates/edit_xref_image.tpl
new file mode 100755
index 0000000..5b12803
--- /dev/null
+++ b/templates/edit_xref_image.tpl
@@ -0,0 +1,68 @@
+{strip}
+<div class="floaticon">{bithelp}</div>
+<div class="edit contact_xref">
+ <div class="header">
+ <h1>{tr}Edit {/tr}{$xrefInfo.template_title|escape}: {$title|escape}-{$xref_title|escape}</h1>
+ </div>
+
+ {formfeedback hash=$feedback}
+ {formfeedback warning=$errors.title}
+
+ <div class="body">
+ {form enctype="multipart/form-data" id="writexref"}
+ <input type="hidden" name="content_id" value="{$xrefInfo.content_id}" />
+ <input type="hidden" name="xref_id" value="{$xrefInfo.xref_id}" />
+
+ {jstabs}
+ {jstab title="Details"}
+ {legend legend="Contents"}
+ <div class="form-group">
+ {formlabel label="`$xrefInfo.template_title` Number" for="xkey_ext"}
+ {forminput}
+ <input type="text" name="xkey_ext" id="xkey_ext" value="{$xrefInfo.xkey_ext|escape}" />
+ {formhelp note="Simple free format text entries like email or web addresses."}
+ {/forminput}
+ <div class="clear"></div>
+ </div>
+
+ <img class="thumb" src="/storage/attachments/21/21/thumbs/medium.jpg" alt="" />
+ {/legend}
+ {/jstab}
+
+ {jstab title="Time period"}
+ {legend legend="Start and Stop Dates"}
+ <div class="form-group">
+ <input type="hidden" name="startDateInput" value="1" />
+ &nbsp;Ignore Date <input type="checkbox" name="ignore_start_date" {if $xrefInfo.ignore_start_date eq "y"}checked{/if} />
+ {formlabel label="Start Date" for=""}
+ {forminput}
+ {html_select_date prefix="start_" time=$xrefInfo.start_date start_year="-5" end_year="+10"} {tr}at{/tr}&nbsp;
+ <span dir="ltr">{html_select_time prefix="start_" time=$xrefInfo.start_date display_seconds=false}&nbsp;{$siteTimeZone}</span>
+ {formhelp note="This xref record becomes valid on this date."}
+ {/forminput}
+ <div class="clear"></div>
+ </div>
+
+ <div class="form-group">
+ <input type="hidden" name="endDateInput" value="1" />
+ &nbsp;Ignore Date <input type="checkbox" name="ignore_end_date" {if $xrefInfo.ignore_end_date eq "y"}checked{/if} />
+ {formlabel label="End Date" for=""}
+ {forminput}
+ {html_select_date prefix="end_" time=$xrefInfo.end_date start_year="-5" end_year="+10"} {tr}at{/tr}&nbsp;
+ <span dir="ltr">{html_select_time prefix="end_" time=$xrefInfo.end_date display_seconds=false}&nbsp;{$siteTimeZone}</span>
+ {formhelp note="This xref record finishes on this date."}
+ {/forminput}
+ <div class="clear"></div>
+ </div>
+ {/legend}
+ {/jstab}
+
+ <div class="form-group submit">
+ <input type="submit" name="fCancel" value="{tr}Cancel{/tr}" />&nbsp;
+ <input type="submit" name="fSaveXref" value="{tr}Save{/tr}" />
+ </div>
+ {/jstabs}
+ {/form}
+ </div><!-- end .body -->
+</div><!-- end .article -->
+{/strip}
diff --git a/templates/edit_xref_inc_report.tpl b/templates/edit_xref_inc_report.tpl
new file mode 100755
index 0000000..defdd3b
--- /dev/null
+++ b/templates/edit_xref_inc_report.tpl
@@ -0,0 +1,72 @@
+{strip}
+<div class="floaticon">{bithelp}</div>
+<div class="edit contact_xref">
+ <div class="header">
+ <h1>{tr}Edit {/tr}{$xrefInfo.template_title|escape}: {$title|escape}-{$xref_title|escape}</h1>
+ </div>
+
+ {formfeedback hash=$feedback}
+ {formfeedback warning=$errors.title}
+
+ <div class="body">
+ {form enctype="multipart/form-data" id="writexref"}
+ <input type="hidden" name="content_id" value="{$xrefInfo.content_id}" />
+ <input type="hidden" name="xref_id" value="{$xrefInfo.xref_id}" />
+
+ {jstabs}
+ {jstab title="Details"}
+ {legend legend="Contents"}
+ <div class="form-group">
+ {formlabel label="`$xrefInfo.template_title` Number" for="xkey_ext"}
+ {forminput}
+ <input type="text" name="xkey_ext" id="xkey_ext" value="{$xrefInfo.xkey_ext|escape}" />
+ {formhelp note="Simple free format text entries like email or web addresses."}
+ {/forminput}
+ <div class="clear"></div>
+ </div>
+
+ {formlabel label="`$xrefInfo.template_title` Notes" for="data"}
+ {capture assign=textarea_help}
+ {tr}Keep the text attached to reference items short and use comment records to add larger volumns of text. This should be reserved for simple notes such 'as use after 5PM' or the link.{/tr}
+ {/capture}
+ {textarea rows=5 noformat=1 id="edittext" nowysiwyg="yes" edit=$xrefInfo.data}
+ {/legend}
+ {/jstab}
+
+ {jstab title="Time period"}
+ {legend legend="Start and Stop Dates"}
+ <div class="form-group">
+ <input type="hidden" name="startDateInput" value="1" />
+ &nbsp;Ignore Date <input type="checkbox" name="ignore_start_date" {if $xrefInfo.ignore_start_date eq "y"}checked{/if} />
+ {formlabel label="Start Date" for=""}
+ {forminput}
+ {html_select_date prefix="start_" time=$xrefInfo.start_date start_year="-5" end_year="+10"} {tr}at{/tr}&nbsp;
+ <span dir="ltr">{html_select_time prefix="start_" time=$xrefInfo.start_date display_seconds=false}&nbsp;{$siteTimeZone}</span>
+ {formhelp note="This xref record becomes valid on this date."}
+ {/forminput}
+ <div class="clear"></div>
+ </div>
+
+ <div class="form-group">
+ <input type="hidden" name="endDateInput" value="1" />
+ &nbsp;Ignore Date <input type="checkbox" name="ignore_end_date" {if $xrefInfo.ignore_end_date eq "y"}checked{/if} />
+ {formlabel label="End Date" for=""}
+ {forminput}
+ {html_select_date prefix="end_" time=$xrefInfo.end_date start_year="-5" end_year="+10"} {tr}at{/tr}&nbsp;
+ <span dir="ltr">{html_select_time prefix="end_" time=$xrefInfo.end_date display_seconds=false}&nbsp;{$siteTimeZone}</span>
+ {formhelp note="This xref record finishes on this date."}
+ {/forminput}
+ <div class="clear"></div>
+ </div>
+ {/legend}
+ {/jstab}
+
+ <div class="form-group submit">
+ <input type="submit" name="fCancel" value="{tr}Cancel{/tr}" />&nbsp;
+ <input type="submit" name="fSaveXref" value="{tr}Save{/tr}" />
+ </div>
+ {/jstabs}
+ {/form}
+ </div><!-- end .body -->
+</div><!-- end .article -->
+{/strip}
diff --git a/templates/edit_xref_inc_report_fields.tpl b/templates/edit_xref_inc_report_fields.tpl
new file mode 100755
index 0000000..83bcd47
--- /dev/null
+++ b/templates/edit_xref_inc_report_fields.tpl
@@ -0,0 +1,10 @@
+{strip}
+<div class="form-group">
+ {formlabel label="`$xrefInfo.template_title` Text" for="`$output`xkey_ext"}
+ {forminput}
+ <input type="text" name="{$output}xkey_ext" id="xkey_ext" value="{$xrefInfo.xkey_ext|escape}" />
+ {formhelp note="Handling Incident Report."}
+ {/forminput}
+ <div class="clear"></div>
+</div>
+{/strip}
diff --git a/templates/edit_xref_key_seal.tpl b/templates/edit_xref_key_seal.tpl
index 3118ac6..3118ac6 100644..100755
--- a/templates/edit_xref_key_seal.tpl
+++ b/templates/edit_xref_key_seal.tpl
diff --git a/templates/edit_xref_key_seal_fields.tpl b/templates/edit_xref_key_seal_fields.tpl
index 75f805d..75f805d 100644..100755
--- a/templates/edit_xref_key_seal_fields.tpl
+++ b/templates/edit_xref_key_seal_fields.tpl
diff --git a/templates/edit_xref_locate.tpl b/templates/edit_xref_locate.tpl
index 3cb599d..3cb599d 100644..100755
--- a/templates/edit_xref_locate.tpl
+++ b/templates/edit_xref_locate.tpl
diff --git a/templates/edit_xref_locate_fields.tpl b/templates/edit_xref_locate_fields.tpl
index f63229f..f63229f 100644..100755
--- a/templates/edit_xref_locate_fields.tpl
+++ b/templates/edit_xref_locate_fields.tpl
diff --git a/templates/edit_xref_phone.tpl b/templates/edit_xref_phone.tpl
index a3b640f..a3b640f 100644..100755
--- a/templates/edit_xref_phone.tpl
+++ b/templates/edit_xref_phone.tpl
diff --git a/templates/edit_xref_phone_fields.tpl b/templates/edit_xref_phone_fields.tpl
index d77f487..d77f487 100644..100755
--- a/templates/edit_xref_phone_fields.tpl
+++ b/templates/edit_xref_phone_fields.tpl
diff --git a/templates/edit_xref_sig.tpl b/templates/edit_xref_sig.tpl
new file mode 100755
index 0000000..defdd3b
--- /dev/null
+++ b/templates/edit_xref_sig.tpl
@@ -0,0 +1,72 @@
+{strip}
+<div class="floaticon">{bithelp}</div>
+<div class="edit contact_xref">
+ <div class="header">
+ <h1>{tr}Edit {/tr}{$xrefInfo.template_title|escape}: {$title|escape}-{$xref_title|escape}</h1>
+ </div>
+
+ {formfeedback hash=$feedback}
+ {formfeedback warning=$errors.title}
+
+ <div class="body">
+ {form enctype="multipart/form-data" id="writexref"}
+ <input type="hidden" name="content_id" value="{$xrefInfo.content_id}" />
+ <input type="hidden" name="xref_id" value="{$xrefInfo.xref_id}" />
+
+ {jstabs}
+ {jstab title="Details"}
+ {legend legend="Contents"}
+ <div class="form-group">
+ {formlabel label="`$xrefInfo.template_title` Number" for="xkey_ext"}
+ {forminput}
+ <input type="text" name="xkey_ext" id="xkey_ext" value="{$xrefInfo.xkey_ext|escape}" />
+ {formhelp note="Simple free format text entries like email or web addresses."}
+ {/forminput}
+ <div class="clear"></div>
+ </div>
+
+ {formlabel label="`$xrefInfo.template_title` Notes" for="data"}
+ {capture assign=textarea_help}
+ {tr}Keep the text attached to reference items short and use comment records to add larger volumns of text. This should be reserved for simple notes such 'as use after 5PM' or the link.{/tr}
+ {/capture}
+ {textarea rows=5 noformat=1 id="edittext" nowysiwyg="yes" edit=$xrefInfo.data}
+ {/legend}
+ {/jstab}
+
+ {jstab title="Time period"}
+ {legend legend="Start and Stop Dates"}
+ <div class="form-group">
+ <input type="hidden" name="startDateInput" value="1" />
+ &nbsp;Ignore Date <input type="checkbox" name="ignore_start_date" {if $xrefInfo.ignore_start_date eq "y"}checked{/if} />
+ {formlabel label="Start Date" for=""}
+ {forminput}
+ {html_select_date prefix="start_" time=$xrefInfo.start_date start_year="-5" end_year="+10"} {tr}at{/tr}&nbsp;
+ <span dir="ltr">{html_select_time prefix="start_" time=$xrefInfo.start_date display_seconds=false}&nbsp;{$siteTimeZone}</span>
+ {formhelp note="This xref record becomes valid on this date."}
+ {/forminput}
+ <div class="clear"></div>
+ </div>
+
+ <div class="form-group">
+ <input type="hidden" name="endDateInput" value="1" />
+ &nbsp;Ignore Date <input type="checkbox" name="ignore_end_date" {if $xrefInfo.ignore_end_date eq "y"}checked{/if} />
+ {formlabel label="End Date" for=""}
+ {forminput}
+ {html_select_date prefix="end_" time=$xrefInfo.end_date start_year="-5" end_year="+10"} {tr}at{/tr}&nbsp;
+ <span dir="ltr">{html_select_time prefix="end_" time=$xrefInfo.end_date display_seconds=false}&nbsp;{$siteTimeZone}</span>
+ {formhelp note="This xref record finishes on this date."}
+ {/forminput}
+ <div class="clear"></div>
+ </div>
+ {/legend}
+ {/jstab}
+
+ <div class="form-group submit">
+ <input type="submit" name="fCancel" value="{tr}Cancel{/tr}" />&nbsp;
+ <input type="submit" name="fSaveXref" value="{tr}Save{/tr}" />
+ </div>
+ {/jstabs}
+ {/form}
+ </div><!-- end .body -->
+</div><!-- end .article -->
+{/strip}
diff --git a/templates/edit_xref_text.tpl b/templates/edit_xref_text.tpl
index defdd3b..defdd3b 100644..100755
--- a/templates/edit_xref_text.tpl
+++ b/templates/edit_xref_text.tpl
diff --git a/templates/edit_xref_text_fields.tpl b/templates/edit_xref_text_fields.tpl
index be049ba..be049ba 100644..100755
--- a/templates/edit_xref_text_fields.tpl
+++ b/templates/edit_xref_text_fields.tpl
diff --git a/templates/edit_xref_type.tpl b/templates/edit_xref_type.tpl
index 6545e40..6545e40 100644..100755
--- a/templates/edit_xref_type.tpl
+++ b/templates/edit_xref_type.tpl
diff --git a/templates/edit_xref_value.tpl b/templates/edit_xref_value.tpl
index 5f20952..5f20952 100644..100755
--- a/templates/edit_xref_value.tpl
+++ b/templates/edit_xref_value.tpl
diff --git a/templates/edit_xref_value_fields.tpl b/templates/edit_xref_value_fields.tpl
index 2231b61..2231b61 100644..100755
--- a/templates/edit_xref_value_fields.tpl
+++ b/templates/edit_xref_value_fields.tpl
diff --git a/templates/employment.tpl b/templates/employment.tpl
new file mode 100755
index 0000000..24904ac
--- /dev/null
+++ b/templates/employment.tpl
@@ -0,0 +1,43 @@
+{strip}
+<form id="employmentForm" class="form-horizontal" method="post" action="process.php?form=employment"
+ data-fv-framework="bootstrap"
+ data-fv-icon-valid="icon-tick"
+ data-fv-icon-invalid="icon-cross"
+ data-fv-icon-validating="icon-recycle">
+
+ <input type="hidden" value="form_employment" name="formID" />
+ <div class="col-lg-2 col-md-1 hidden-sm hidden-xs">&nbsp;</div>
+ <div class="form-all col-lg-8 col-md-10 col-sm-12 col-xs-12">
+
+ <div class="form-header-group">
+ <div class="header-text httal htvam">
+ <h3 class="form-header" id="header_1">
+ Employee Details
+ </h3>
+ </div>
+ </div>
+
+ <div class="form-input-wide" id="cid_18">
+ <div class="form-html" id="text_18">
+ <p>
+ <span style="color: #ff0000;"><strong>This form must be completed in full for work to commence and wages to be issued.</strong></span>
+ </p>
+ </div>
+ </div>
+
+ {foreach from=$formInfo key=i item=item}
+ {include file="bitpackage:form/`$item['form_template']`.tpl" value=$item['xkey']}
+ {/foreach}
+
+ <div class="form-group">
+ <div class="col-xs-9 col-xs-offset-3">
+ <button type="submit" class="btn btn-primary" name="signup"
+ value="Sign up">Submit</button>
+ <button type="cancel" class="btn btn-primary" name="fCancel"
+ value="fCancel">Cancel</button>
+ </div>
+ </div>
+ </div>
+ <div class="col-lg-2 col-md-1 hidden-sm hidden-xs">&nbsp;</div>
+</form>
+{/strip} \ No newline at end of file
diff --git a/templates/employment1.tpl b/templates/employment1.tpl
new file mode 100755
index 0000000..b9b6ab6
--- /dev/null
+++ b/templates/employment1.tpl
@@ -0,0 +1,44 @@
+{strip}
+<form id="employmentForm" class="form-horizontal" method="post" action="process.php?form=employment"
+ data-fv-framework="bootstrap"
+ data-fv-icon-valid="icon-tick"
+ data-fv-icon-invalid="icon-cross"
+ data-fv-icon-validating="icon-recycle">
+
+ <input type="hidden" value="form_employment" name="formID" />
+ <div class="col-lg-2 col-md-1 hidden-sm hidden-xs">&nbsp;</div>
+ <div class="form-all col-lg-8 col-md-10 col-sm-12 col-xs-12">
+
+ <div class="form-header-group">
+ <div class="header-text httal htvam">
+ <h3 class="form-header" id="header_1">
+ Employee Details
+ </h3>
+ </div>
+ </div>
+
+ <div class="form-input-wide" id="cid_18">
+ <div class="form-html" id="text_18">
+ <p>
+ <span style="color: #ff0000;"><strong>This form must be completed
+ in full for work to commence and wages to be issued.</strong></span>
+ </p>
+ </div>
+ </div>
+
+ {foreach name=template_loop item=item from=$formInfo}
+ {include file="bitpackage:form/$item.form_template" $item.fld_xref=$gContent->mInfo.$item.fld_xref}
+ {/foreach}
+
+ <div class="form-group">
+ <div class="col-xs-9 col-xs-offset-3">
+ <button type="submit" class="btn btn-primary" name="signup"
+ value="Sign up">Submit</button>
+ <button type="cancel" class="btn btn-primary" name="fCancel"
+ value="fCancel">Cancel</button>
+ </div>
+ </div>
+ </div>
+ <div class="col-lg-2 col-md-1 hidden-sm hidden-xs">&nbsp;</div>
+</form>
+{/strip} \ No newline at end of file
diff --git a/templates/employment2.tpl b/templates/employment2.tpl
new file mode 100755
index 0000000..369a64f
--- /dev/null
+++ b/templates/employment2.tpl
@@ -0,0 +1,44 @@
+{strip}
+<form id="employmentForm" class="form-horizontal" method="post" action="process.php?form=employment"
+ data-fv-framework="bootstrap"
+ data-fv-icon-valid="icon-tick"
+ data-fv-icon-invalid="icon-cross"
+ data-fv-icon-validating="icon-recycle">
+
+ <input type="hidden" value="form_employment" name="formID" />
+ <div class="col-lg-2 col-md-1 hidden-sm hidden-xs">&nbsp;</div>
+ <div class="form-all col-lg-8 col-md-10 col-sm-12 col-xs-12">
+
+ <div class="form-header-group">
+ <div class="header-text httal htvam">
+ <h3 class="form-header" id="header_1">
+ Employee Details
+ </h3>
+ </div>
+ </div>
+
+ <div class="form-input-wide" id="cid_18">
+ <div class="form-html" id="text_18">
+ <p>
+ <span style="color: #ff0000;"><strong>This form must be completed
+ in full for work to commence and wages to be issued.</strong></span>
+ </p>
+ </div>
+ </div>
+
+ {foreach name=template_loop item=item from=$formInfo}
+ {include file="bitpackage:form/`$item.form_template`.tpl" name=$gContent->mInfo.name}
+ {/foreach}
+
+ <div class="form-group">
+ <div class="col-xs-9 col-xs-offset-3">
+ <button type="submit" class="btn btn-primary" name="signup"
+ value="Sign up">Submit</button>
+ <button type="cancel" class="btn btn-primary" name="fCancel"
+ value="fCancel">Cancel</button>
+ </div>
+ </div>
+ </div>
+ <div class="col-lg-2 col-md-1 hidden-sm hidden-xs">&nbsp;</div>
+</form>
+{/strip} \ No newline at end of file
diff --git a/templates/employment_full.tpl b/templates/employment_full.tpl
new file mode 100755
index 0000000..3e836e9
--- /dev/null
+++ b/templates/employment_full.tpl
@@ -0,0 +1,390 @@
+<form id="employmentForm" class="form-horizontal" method="post" action="process.php?for=employment"
+ data-fv-framework="bootstrap"
+ data-fv-icon-valid="icon-tick"
+ data-fv-icon-invalid="icon-cross"
+ data-fv-icon-validating="icon-recycle">
+
+ <input type="hidden" value="form_employment" name="formID" />
+ <div class="col-lg-2 col-md-1 hidden-sm hidden-xs">&nbsp;</div>
+ <div class="form-all col-lg-8 col-md-10 col-sm-12 col-xs-12">
+
+ <div class="form-header-group">
+ <div class="header-text httal htvam">
+ <h3 class="form-header" id="header_1">
+ Employee Details
+ </h3>
+ </div>
+ </div>
+
+ <div class="form-input-wide" id="cid_18">
+ <div class="form-html" id="text_18">
+ <p>
+ <span style="color: #ff0000;"><strong>This form must be completed
+ in full for work to commence and wages to be issued.</strong></span>
+ </p>
+ </div>
+ </div>
+
+ <div id="name" class="form-group"
+ data-toggle="tooltip"
+ data-placement="top"
+ title="Please provide your full name including any middle names">
+ <label class="col-xs-3 control-label">Full name</label>
+ <div class="col-xs-2">
+ <input type="text" class="form-control" name="name_title" placeholder="Title"
+ data-fv-row=".col-xs-2"
+ data-fv-notempty="true"
+ data-fv-notempty-message="The title is required" />
+ </div>
+ <div class="col-xs-2">
+ <input type="text" class="form-control" name="name_first"
+ placeholder="First name" data-fv-row=".col-xs-2"
+ data-fv-notempty="true"
+ data-fv-notempty-message="The first name is required" />
+ </div>
+ <div class="col-xs-2">
+ <input type="text" class="form-control" name="name_middle"
+ placeholder="Middle names" data-fv-row=".col-xs-2"
+ data-fv-notempty="false" />
+ </div>
+ <div class="col-xs-2">
+ <input type="text" class="form-control" name="name_last"
+ placeholder="Last name" data-fv-row=".col-xs-2"
+ data-fv-notempty="true"
+ data-fv-notempty-message="The last name is required" />
+ </div>
+ </div>
+
+ <div id="name_nino" class="form-group"
+ data-toggle="tooltip"
+ data-placement="top"
+ title="National insurance number should be 2 letters, 6 numbers, 1 letter. You will not be paid if this number is incorrect.">
+ <label class="col-xs-3 control-label">National Insurance No.</label>
+ <div class="col-xs-5">
+ <input type="text" class="form-control" name="name_nino"
+ data-fv-notempty="true"
+ data-fv-notempty-message="The national insurance number is required"
+ pattern="^[a-ceghj-nopr-tw-zA-CEGHJ-NOPR-TW-Z]{ldelim}1{rdelim}[a-ceghj-nopr-tw-zA-CEGHJ-NPR-TW-Z]{ldelim}1{rdelim}\d{ldelim}6{rdelim}[a-dA-D]{ldelim}1{rdelim}$"
+ data-fv-regexp-message="The National insurance numbers should be 2 letters, 6 numbers, 1 letter." />
+ </div>
+ </div>
+
+ <div id="sia1" class="form-group">
+ <label class="col-xs-3 control-label">SIA License Number</label>
+ <div class="col-xs-6">
+ <input type="text" class="form-control" name="sia1"
+ data-fv-notempty="true"
+ data-fv-notempty-message="SIA License Number is required"
+ data-fv-stringlength="true" data-fv-stringlength-min="9"
+ data-fv-stringlength-max="9"
+ data-fv-stringlength-message="SIA License Number" />
+ </div>
+ </div>
+
+ <div id="sia2" class="form-group" data-toggle="tooltip"
+ data-placement="top"
+ title="Use this box if you have second SIA license such as CCTV">
+ <label class="col-xs-3 control-label">2nd SIA License Number</label>
+ <div class="col-xs-6">
+ <input type="text" class="form-control" name="sia2" />
+ </div>
+ </div>
+
+ <div id="address" class="form-group group" data-toggle="tooltip"
+ data-placement="top"
+ title="Please supply your current residential address as it appears on the electoral register.">
+ <label class="col-xs-3 control-label">Address</label>
+ <div>
+ <div class="col-xs-6">
+ <div class="col-xs-12 form-group">
+ <input type="text" class="form-control" name="address_house"
+ placeholder="House number or name ( or flat details )" data-fv-row=".col-xs-12"
+ data-fv-notempty="true"
+ data-fv-notempty-message="The house name or number is required" />
+ </div>
+ <div class="col-sm-6 col-xs-8 form-group">
+ <input type="text" class="address_postcode form-control" name="address_postcode"
+ placeholder="Post Code" data-fv-row=".col-xs-8"
+ onkeydown="upperPostcode(this)"
+ data-fv-notempty="true"
+ data-fv-notempty-message="The post code is required"
+ pattern="^(([A-Z]\d{ldelim}2{rdelim}[A-Z]{ldelim}2{rdelim})|([A-Z]\d{ldelim}3{rdelim}[A-Z]{ldelim}2{rdelim})|([A-Z]{ldelim}2{rdelim}\d{ldelim}2{rdelim}[A-Z]{ldelim}2{rdelim})|([A-Z]{ldelim}2{rdelim}\d{ldelim}3{rdelim}[A-Z]{ldelim}2{rdelim})|([A-Z]\d[A-Z]\d[A-Z]{ldelim}2{rdelim})|([A-Z]{ldelim}2{rdelim}\d[A-Z]\d[A-Z]{ldelim}2{rdelim})|(GIR0AA))$"
+ data-fv-regexp-message="Postcodes should be 1 or 2 letters, 2 or 3 numbers, 2 letters. Please ignore space." />
+ </div>
+ <div class="col-sm-6 col-xs-4">
+ <button type="button" class="btn btn-primary" onclick="update()" />Postcode Lookup</button>
+ </div>
+ <div class="postcode_detail_reply col-xs-12 panel panel-default group collapse">
+ <div id="postcode_detail_match" class="panel-body">
+ </div>
+ </div>
+ <div class="postcode_detail_new col-xs-12 panel panel-default group collapse">
+ <div id="postcode_detail_data" class="panel-body">
+ <div class="col-xs-12 form-group">
+ <input type="text" class="form-control" id="address_street1" name="address_street1"
+ placeholder="Street Address" data-fv-row=".col-xs-8"
+ data-fv-notempty="false"
+ data-fv-notempty-message="The street address is required" />
+ </div>
+ <div class="col-xs-12 form-group">
+ <input type="text" class="form-control" id="address_street2" name="address_street2"
+ placeholder="Street Address Line 2" data-fv-row=".col-xs-8"
+ data-fv-notempty="false" />
+ </div>
+ <div class="col-sm-6 col-xs-12 form-group">
+ <input type="text" class="form-control" name="address_town"
+ placeholder="City / Town" data-fv-row=".col-xs-6"
+ data-fv-notempty="false"
+ data-fv-notempty-message="The last name is required" />
+ </div>
+ <div class="col-sm-6 col-xs-12">
+ <input type="text" class="form-control" id="address_county" name="address_county"
+ placeholder="County" data-fv-row=".col-xs-4"
+ data-fv-notempty="false" />
+ </div>
+ </div>
+ <div class="panel-footer">We are too tight to pay for postcode data updates so can you please supply the details for your postcode as we do not have them!
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div id="email" class="form-group">
+ <label class="col-xs-3 control-label">Email address</label>
+ <div class="col-xs-6">
+ <input type="text" class="form-control" name="email"
+ data-fv-notempty="true"
+ data-fv-notempty-message="The email address is required"
+ data-fv-emailaddress="true"
+ data-fv-emailaddress-message="The input is not a valid email address" />
+ </div>
+ </div>
+
+ <div id="birthday" class="form-group">
+ <label class="col-xs-3 control-label">Date of birth</label>
+ <div class="col-xs-3 date">
+ <input type="text" class="form-control" id="datebirthday"
+ name="birthday" placeholder="DD-MM-YYYY" data-fv-notempty="true"
+ data-fv-notempty-message="The date of birth is required"
+ data-fv-date="true" data-fv-date-format="DD-MM-YYYY"
+ data-fv-date-message="The date of birth is not valid" /> <span
+ class="input-group-addon add-on"><span class="icon-calendar"></span></span>
+ </div>
+ </div>
+
+ <div id="gender" class="form-group">
+ <label class="col-xs-3 control-label">Gender</label>
+ <div class="col-xs-5">
+ <div class="btn-group" data-toggle="buttons">
+ <label class="btn btn-default"> <input type="radio" name="gender"
+ value="male" data-fv-notempty="true"
+ data-fv-notempty-message="The gender is required" /> Male
+ </label> <label class="btn btn-default"> <input type="radio"
+ name="gender" value="female" /> Female
+ </label> <label class="btn btn-default"> <input type="radio"
+ name="gender" value="other" /> Other
+ </label>
+ </div>
+ </div>
+ </div>
+
+ <div id="bank" class="form-group group" data-toggle="tooltip"
+ data-placement="top"
+ title="Your bank account details are required in order to make you salary transfers.">
+ <div id="bank_name" class="form-group">
+ <label class="col-xs-3 control-label">Bank Name</label>
+ <div class="col-xs-6">
+ <input type="text" class="form-control" name="bank_name"
+ data-fv-notempty="true"
+ data-fv-notempty-message="The bank name is required" />
+ </div>
+ </div>
+
+ <div id="bank_sort" class="form-group">
+ <label class="col-xs-3 control-label">Sort Code</label>
+ <div class="col-xs-6">
+ <input type="text" class="form-control" name="bank_sort"
+ data-fv-notempty="true"
+ data-fv-notempty-message="Bank Sort Code is required"
+ data-fv-stringlength="true" data-fv-stringlength-min="6"
+ data-fv-stringlength-max="6"
+ data-fv-stringlength-message="Bank Sort Code is 6 numbers" />
+ </div>
+ </div>
+
+ <div id="bank_account" class="form-group">
+ <label class="col-xs-3 control-label">Account Number</label>
+ <div class="col-xs-6">
+ <input type="text" class="form-control" name="bank_account"
+ data-fv-notempty="true"
+ data-fv-notempty-message="Bank Account Number is required"
+ data-fv-stringlength="true" data-fv-stringlength-min="8"
+ data-fv-stringlength-max="8"
+ data-fv-stringlength-message="Bank Account Number is 8 numbers" />
+ </div>
+ </div>
+ </div>
+
+ <div id="student_loan" class="form-group">
+ <label class="col-xs-3 control-label">Student Loan</label>
+ <div class="col-xs-9">
+ <div class="radio">
+ <label>Do you have a student loan?</label>
+ <div class="btn-group" data-toggle="buttons">
+ <label class="btn btn-default">
+ <input type="radio" name="student_loan" value="sl_no" class="select"
+ data-fv-notempty="true"
+ data-fv-notempty-message="Student Load status is required" />
+ No</label>
+ <label class="btn btn-default">
+ <input type="radio" name="student_loan" value="sl_yes" />
+ Yes</label>
+ </div>
+ </div>
+ <div class="loan_detail panel panel-default collapse">
+ <div class="panel-body">
+ <div class="radio">
+ <input type="radio" name="student_loan" value="sl_old" /> <label>
+ If you left a course of Higher Education before last 6 April and
+ received your first Student Loan instalment on or after 1
+ September 1998 and you have not fully repaid your Student Loan,
+ then check box.</label>
+ </div>
+ <div class="radio">
+ <input type="radio" name="student_loan" value="sl_new" /> <label>
+ New student loan scheme.</label>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div id="current_circs" class="form-group">
+ <label class="col-xs-3 control-label">Your present circumstances</label>
+ <div class="col-xs-9">
+ <div class="radio">
+ <input type="radio" name="current_circs" value="cc_first"
+ data-fv-notempty="true"
+ data-fv-notempty-message="The present circumstances information is required" />
+ <label> This is my first job since last 6 April and I have not been
+ receiving taxable Jobseeker's Allowance or taxable Incapacity
+ Benefit or a state or occupational pension.</label>
+ </div>
+ <div class="radio">
+ <input type="radio" name="current_circs" value="cc_only" /> <label>
+ This is now my only job, but since last 6 April I have had another
+ job, or have received taxable Jobseeker's Allowance or Incapacity
+ Benefit. I do not receive a state or occupational pension.</label>
+ </div>
+ <div class="cc_detail panel panel-info collapse">
+ <div class="panel-heading">
+ <h3 class="panel-title">P45 Details</h3>
+ </div>
+ <div class="panel-body">
+ <div id="left_date" class="form-group">
+ <label class="col-xs-3 control-label">Date left previous employment</label>
+ <div class="col-xs-3 date">
+ <input type="text" class="form-control" id="dateleft"
+ name="left_date" placeholder="DD-MM-YYYY"
+ data-fv-notempty="true"
+ data-fv-notempty-message="The date of leaving previous job is required"
+ data-fv-date="true" data-fv-date-format="DD-MM-YYYY"
+ data-fv-date-message="The date of certification of details is not valid" />
+ <span class="input-group-addon add-on"><span
+ class="icon-calendar"></span></span>
+ </div>
+ </div>
+ </div>
+ <div id="p45-avail" class="form-group">
+ <label class="col-xs-3 control-label">Did your previous employer
+ give you a P45?</label>
+ <div class="col-xs-3">
+ <select id="circs-p45" name="circs-p45-avail" default circs-p45-avail="0"
+ class="form-dropdown required form-p45-avail"
+ data-fv-row=".col-xs-6" data-fv-notempty="true"
+ data-fv-notempty-message="A P45 is required before startin a new job">
+
+ <option selected="" value=""></option>
+ <option value="yes">Yes - Please Supply ASAP</option>
+ <option value="no">No</option>
+ </select>
+ </div>
+ </div>
+ <div id="no_p45" class="form-group">
+ <label class="col-xs-3 control-label">If No are you waiting for
+ them to send it to you?</label>
+ <div class="col-xs-3">
+ <select id="circs-no-p45" name="circs-no-p45" default circs-no-p45="0"
+ class="form-dropdown required form-p45-avail"
+ data-fv-row=".col-xs-6" data-fv-notempty="false"
+ data-fv-notempty-message="The country is required">
+
+ <option selected="" value=""></option>
+ <option value="yes">Yes - Please Supply ASAP</option>
+ <option value="no">No</option>
+ </select>
+ </div>
+ </div>
+ </div>
+ <div class="radio">
+ <input type="radio" name="current_circs" value="cc_other" /> <label>
+ I have another job or receive a state or occupational pension.</label>
+ </div>
+ </div>
+ </div>
+
+ <div id="signed_sig" class="form-group">
+ <label class="col-xs-3 control-label">Signature</label>
+ <div class="col-xs-6 sigPad" id="linear" style="width: 404px;">
+ <ul class="sigNav">
+ <li class="clearButton"><a href="#clear">Clear</a></li>
+ </ul>
+ <div class="sig sigWrapper" style="height: auto;">
+ <div class="typed"></div>
+ <canvas class="pad" width="400" height="250"></canvas>
+ <input type="hidden" name="output" class="output">
+ </div>
+ </div>
+ </div>
+
+ <div id="signed_date" class="form-group">
+ <label class="col-xs-3 control-label">Signing Date</label>
+ <div class="col-xs-3 date">
+ <input type="text" class="form-control" id="datesigned"
+ name="signed_date" placeholder="DD-MM-YYYY"
+ data-fv-notempty="true"
+ data-fv-notempty-message="The date of certification of details is required"
+
+ data-fv-date="true"
+ data-fv-date-format="DD-MM-YYYY"
+ data-fv-date-message="The date of certification of details is not valid" />
+ <span class="input-group-addon add-on"><span class="icon-calendar"></span></span>
+ </div>
+ </div>
+
+ <div id="signed_name" class="form-group">
+ <label class="col-xs-3 control-label">Signing name</label>
+ <div class="col-xs-3">
+ <input type="text" class="form-control" name="sig_first" placeholder="First name"
+ data-fv-row=".col-xs-3"
+ data-fv-notempty="true"
+ data-fv-notempty-message="The signed first name is required" />
+ </div>
+ <div class="col-xs-3">
+ <input type="text" class="form-control" name="sig_last" placeholder="Last name"
+ data-fv-row=".col-xs-3"
+ data-fv-notempty="true"
+ data-fv-notempty-message="The signed last name is required" />
+ </div>
+ </div>
+
+ <div class="form-group">
+ <div class="col-xs-9 col-xs-offset-3">
+ <button type="submit" class="btn btn-primary" name="signup"
+ value="Sign up">Submit</button>
+ </div>
+ </div>
+ </div>
+ <div class="col-lg-2 col-md-1 hidden-sm hidden-xs">&nbsp;</div>
+</form> \ No newline at end of file
diff --git a/templates/employment_old.tpl b/templates/employment_old.tpl
new file mode 100755
index 0000000..485f3ca
--- /dev/null
+++ b/templates/employment_old.tpl
@@ -0,0 +1,372 @@
+<form accept-charset="utf-8" id="form_employment" name="form_employment" method="post" action="process.php?for=employment" class="form" novalidate="true">
+ <input type="hidden" value="form_employment" name="formID">
+ <div class="col-lg-2 col-md-1 hidden-sm hidden-xs">&nbsp;</div>
+ <div class="form-all col-lg-8 col-md-10 col-sm-12 col-xs-12">
+ <ul class="form-section page-section">
+ <li data-type="control_head" class="form-input-wide" id="cid_1">
+ <div class="form-header-group">
+ <div class="header-text httal htvam">
+ <h3 class="form-header" id="header_1">
+ Employee Details
+ </h3>
+ </div>
+ </div>
+ </li>
+ <li id="id_18" data-type="control_text" class="form-line">
+ <div class="form-input-wide" id="cid_18">
+ <div class="form-html" id="text_18">
+ <p><span style="color:#ff0000;"><strong>This form must be completed in full for work to commence and wages to be issued.</strong></span></p>
+ </div>
+ </div>
+ </li>
+ <li id="id_3" data-type="control_fullname" class="form-line required" data-toggle="tooltip" data-placement="top" title="Please provide your full name including any middle name">
+ <label for="input_3" id="label_3" class="form-label form-label-left form-label-auto">
+ Full Name
+ <span class="form-required">
+ *
+ </span>
+ </label>
+ <div class="form-input required" id="cid_3">
+ <span style="vertical-align: top" class="form-sub-label-container">
+ <input type="text" id="prefix_3" size="4" name="q3_name[prefix]" class="form-textbox">
+ <label style="min-height: 13px;" id="sublabel_prefix" for="prefix_3" class="form-sub-label"> Prefix </label>
+ </span>
+ <span style="vertical-align: top" class="form-sub-label-container">
+ <input type="text" id="first_3" name="q3_name[first]" size="10" class="form-textbox validate[required]">
+ <label style="min-height: 13px;" id="sublabel_first" for="first_3" class="form-sub-label"> First Name </label>
+ </span>
+ <span style="vertical-align: top" class="form-sub-label-container">
+ <input type="text" id="middle_3" name="q3_name[middle]" size="10" class="form-textbox">
+ <label style="min-height: 13px;" id="sublabel_middle" for="middle_3" class="form-sub-label"> Middle Name </label>
+ </span>
+ <span style="vertical-align: top" class="form-sub-label-container">
+ <input type="text" id="last_3" name="q3_name[last]" size="15" class="form-textbox validate[required]">
+ <label style="min-height: 13px;" id="sublabel_last" for="last_3" class="form-sub-label"> Last Name </label>
+ </span>
+ </div>
+ </li>
+ <li id="id_4" class="form-line required" data-toggle="tooltip" data-placement="top" title="National insurance number should be 2 letters, 6 numbers, 1 letter. You will not be paid if this number is incorrect.">
+ <label for="input_4" id="label_4" class="form-label form-label-left form-label-auto">
+ National Insurance No.
+ <span class="form-required">
+ *
+ </span>
+ </label>
+ <div class="form-input required" id="cid_4">
+ <input type="text" maxlength="9" value="" size="15" name="q4_nationalInsurance4" id="input_4" data-type="input-textbox" class=" form-textbox validate[required, AlphaNumeric]" placeholder="AA123456C">
+ </div>
+ </li>
+ <li id="id_19" class="form-line">
+ <label for="input_19" id="label_19" class="form-label form-label-left form-label-auto"> SIA License Number </label>
+ <div class="form-input required" id="cid_19">
+ <input type="text" value="" size="20" name="q19_siaLicense19" id="input_19" data-type="input-textbox" class=" form-textbox">
+ </div>
+ </li>
+ <li id="id_22" class="form-line" data-toggle="tooltip" data-placement="top" title="Use this box if you have second SIA license such as CCTV">
+ <label for="input_22" id="label_22" class="form-label form-label-left form-label-auto"> 2nd SIA License Number </label>
+ <div class="form-input required" id="cid_22">
+ <input type="text" value="" size="20" name="q22_2ndSia" id="input_22" data-type="input-textbox" class=" form-textbox">
+ </div>
+ </li>
+ <li id="id_5" data-type="control_address" class="form-line required">
+ <label for="input_5" id="label_5" class="form-label form-label-left form-label-auto">
+ Address
+ <span class="form-required">
+ *
+ </span>
+ </label>
+ <div class="form-input required" id="cid_5">
+ <table cellspacing="0" cellpadding="0" border="0" class="form-address-table" undefined="" summary="">
+ <tbody><tr>
+ <td colspan="2">
+ <span style="vertical-align: top" class="form-sub-label-container">
+ <input type="text" id="input_5_addr_line1" name="q5_address[addr_line1]" class="form-textbox validate[required] form-address-line">
+ <label style="min-height: 13px;" id="sublabel_5_addr_line1" for="input_5_addr_line1" class="form-sub-label"> Street Address </label>
+ </span>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <span style="vertical-align: top" class="form-sub-label-container">
+ <input type="text" size="46" id="input_5_addr_line2" name="q5_address[addr_line2]" class="form-textbox form-address-line">
+ <label style="min-height: 13px;" id="sublabel_5_addr_line2" for="input_5_addr_line2" class="form-sub-label"> Street Address Line 2 </label>
+ </span>
+ </td>
+ </tr>
+ <tr>
+ <td width="50%">
+ <span style="vertical-align: top" class="form-sub-label-container">
+ <input type="text" size="21" id="input_5_city" name="q5_address[city]" class="form-textbox validate[required] form-address-city">
+ <label style="min-height: 13px;" id="sublabel_5_city" for="input_5_city" class="form-sub-label"> City / Town </label>
+ </span>
+ </td>
+ <td>
+ <span style="vertical-align: top" class="form-sub-label-container">
+ <input type="text" size="22" id="input_5_state" name="q5_address[state]" class="form-textbox validate[required] form-address-state">
+ <label style="min-height: 13px;" id="sublabel_5_state" for="input_5_state" class="form-sub-label"> County </label>
+ </span>
+ </td>
+ </tr>
+ <tr>
+ <td width="50%">
+ <span style="vertical-align: top" class="form-sub-label-container">
+ <input type="text" size="10" id="input_5_postal" name="q5_address[postal]" class="form-textbox validate[required] form-address-postal">
+ <label style="min-height: 13px;" id="sublabel_5_postal" for="input_5_postal" class="form-sub-label"> Post Code </label>
+ </span>
+ </td>
+ <td>
+ <span style="vertical-align: top" class="form-sub-label-container">
+ <select id="input_5_country" name="q5_address[country]" defaultcountry="0" class="form-dropdown validate[required] form-address-country">
+ <option selected="" value=""> Please Select </option>
+ <option value="England"> England </option>
+ <option value="Scotland"> Scotland </option>
+ <option value="Wales"> Wales </option>
+ <option value="Northern Ireland"> Northern Ireland </option>
+ <option value="Isle of Man"> Isle of Man </option>
+ <option value="Guernsey"> Guernsey </option>
+ <option value="Jersey"> Jersey </option>
+ <option value="Gibraltar"> Gibraltar </option>
+ <option value="United Kingdom"> United Kingdom </option>
+ <option value="other"> Other </option>
+ </select>
+ <label style="min-height: 13px;" id="sublabel_5_country" for="input_5_country" class="form-sub-label"> Country </label>
+ </span>
+ </td>
+ </tr>
+ </tbody></table>
+ </div>
+ </li>
+ <li id="id_6" data-type="control_email" class="form-line">
+ <label for="input_6" id="label_6" class="form-label form-label-left form-label-auto"> E-mail </label>
+ <div class="form-input required" id="cid_6">
+ <input type="email" value="" size="50" name="q6_email" id="input_6" class=" form-textbox validate[Email]">
+ </div>
+ </li>
+ <li id="id_9" data-type="control_widget" class="form-line required">
+ <label for="input_9" id="label_9" class="form-label form-label-left form-label-auto">
+ Date Of Birth
+ <span class="form-required">
+ *
+ </span>
+ </label>
+ <div class="form-input required" id="cid_9">
+ <div style="width:100%; text-align:Left;">
+ <div class="widget-inputs-wrapper">
+ <input type="hidden" value="" name="q9_dateOf9" class="form-hidden form-widget widget-required " id="input_9">
+ </div>
+ </div>
+ </div>
+ </li>
+ <li id="id_8" data-type="control_radio" class="form-line required">
+ <label for="input_8" id="label_8" class="form-label form-label-left form-label-auto">
+ Gender
+ <span class="form-required">
+ *
+ </span>
+ </label>
+ <div class="form-input required" id="cid_8">
+ <div class="form-single-column">
+ <span style="clear:left;" class="form-radio-item">
+ <span class="dragger-item">
+ </span>
+ <input type="radio" value="Male" name="q8_gender" id="input_8_0" class="form-radio validate[required]">
+ <label for="input_8_0" id="label_input_8_0"> Male </label>
+ </span>
+ <span style="clear:left;" class="form-radio-item">
+ <span class="dragger-item">
+ </span>
+ <input type="radio" value="Female" name="q8_gender" id="input_8_1" class="form-radio validate[required]">
+ <label for="input_8_1" id="label_input_8_1"> Female </label>
+ </span>
+ </div>
+ </div>
+ </li>
+ <li id="id_23" class="form-line required">
+ <label for="input_23" id="label_23" class="form-label form-label-left form-label-auto">
+ Bank Name
+ <span class="form-required">
+ *
+ </span>
+ </label>
+ <div class="form-input required" id="cid_23">
+ <input type="text" value="" size="20" name="q23_bankName" id="input_23" data-type="input-textbox" class=" form-textbox validate[required]">
+ </div>
+ </li>
+ <li id="id_24" class="form-line required">
+ <label for="input_24" id="label_24" class="form-label form-label-left form-label-auto">
+ Sort Code
+ <span class="form-required">
+ *
+ </span>
+ </label>
+ <div class="form-input required" id="cid_24">
+ <input type="text" maxlength="6" value="" size="20" name="q24_sortCode" id="input_24" data-type="input-textbox" class=" form-textbox validate[required]">
+ </div>
+ </li>
+ <li id="id_25" class="form-line required">
+ <label for="input_25" id="label_25" class="form-label form-label-left form-label-auto">
+ Account Number
+ <span class="form-required">
+ *
+ </span>
+ </label>
+ <div class="form-input required" id="cid_25">
+ <input type="text" maxlength="8" value="" size="20" name="q25_accountNumber" id="input_25" data-type="input-textbox" class=" form-textbox validate[required]">
+ </div>
+ </li>
+ <li id="id_11" data-type="control_checkbox" class="form-line">
+ <label for="input_11" id="label_11" class="form-label form-label-left form-label-auto"> Student Loan </label>
+ <div class="form-input required" id="cid_11">
+ <div class="form-single-column">
+ <span style="clear:left;" class="form-checkbox-item">
+ <span class="dragger-item">
+ </span>
+ <input type="checkbox" value="If you left a course of Higher Education before last 6 April and received your first Student Loan instalment on or after 1 September 1998 and you have not fully repaid your Student Loan, then check box." name="q11_studentLoan[]" id="input_11_0" class="form-checkbox">
+ <label for="input_11_0" id="label_input_11_0"> If you left a course of Higher Education before last 6 April and received your first Student Loan instalment on or after 1 September 1998 and you have not fully repaid your Student Loan, then check box. </label>
+ </span>
+ </div>
+ </div>
+ </li>
+ <li id="id_12" data-type="control_radio" class="form-line required">
+ <label for="input_12" id="label_12" class="form-label form-label-left form-label-auto">
+ Your present circumstances
+ <span class="form-required">
+ *
+ </span>
+ </label>
+ <div class="form-input required" id="cid_12">
+ <div class="form-single-column">
+ <span style="clear:left;" class="form-radio-item">
+ <span class="dragger-item">
+ </span>
+ <input type="radio" value="This is my first job since last 6 April and I have not been receiving taxable Jobseeker's Allowance or taxable Incapacity Benefit or a state or occupational pension. 1" name="q12_yourPresent" id="input_12_0" class="form-radio validate[required]">
+ <label for="input_12_0" id="label_input_12_0"> This is my first job since last 6 April and I have not been receiving taxable Jobseeker's Allowance or taxable Incapacity Benefit or a state or occupational pension. 1 </label>
+ </span>
+ <span style="clear:left;" class="form-radio-item">
+ <span class="dragger-item">
+ </span>
+ <input type="radio" value="This is now my only job, but since last 6 April I have had another job, or have received taxable Jobseeker's Allowance or Incapacity Benefit. I do not receive a state or occupational pension." name="q12_yourPresent" id="input_12_1" class="form-radio validate[required]">
+ <label for="input_12_1" id="label_input_12_1"> This is now my only job, but since last 6 April I have had another job, or have received taxable Jobseeker's Allowance or Incapacity Benefit. I do not receive a state or occupational pension. </label>
+ </span>
+ <span style="clear:left;" class="form-radio-item">
+ <span class="dragger-item">
+ </span>
+ <input type="radio" value="I have another job or receive a state or occupational pension." name="q12_yourPresent" id="input_12_2" class="form-radio validate[required]">
+ <label for="input_12_2" id="label_input_12_2"> I have another job or receive a state or occupational pension. </label>
+ </span>
+ </div>
+ </div>
+ </li>
+ <li id="id_26" data-type="control_widget" style="display:none;" class="form-line form-field-hidden">
+ <label for="input_26" id="label_26" class="form-label form-label-left form-label-auto"> Date left previous employment </label>
+ <div class="form-input required" id="cid_26">
+ <div style="width:100%; text-align:Left;">
+ <div class="widget-inputs-wrapper">
+ <input type="hidden" value="" name="q26_dateLeft" class="form-hidden form-widget " id="input_26">
+ </div>
+ </div>
+ </div>
+ </li>
+ <li id="id_27" data-type="control_dropdown" style="display:none;" class="form-line form-field-hidden">
+ <label for="input_27" id="label_27" class="form-label form-label-left form-label-auto"> Did your previous employer give you a P45? </label>
+ <div class="form-input required" id="cid_27">
+ <select name="q27_didYour27" id="input_27" style="width:150px" class="form-dropdown">
+ <option value=""> </option>
+ <option value="Yes - Please Supply ASAP"> Yes - Please Supply ASAP </option>
+ <option value="No"> No </option>
+ </select>
+ </div>
+ </li>
+ <li id="id_28" data-type="control_dropdown" style="display:none;" class="form-line form-field-hidden">
+ <label for="input_28" id="label_28" class="form-label form-label-left form-label-auto"> If No are you waiting for them to send it to you? </label>
+ <div class="form-input required" id="cid_28">
+ <select name="q28_ifNo28" id="input_28" style="width:150px" class="form-dropdown">
+ <option value=""> </option>
+ <option value="Yes - Please send once received "> Yes - Please send once received </option>
+ <option value="No"> No </option>
+ </select>
+ </div>
+ </li>
+ <li id="id_15" data-type="control_signature" class="form-line">
+ <label for="input_15" id="label_15" class="form-label form-label-left form-label-auto"> Signature </label>
+ <div class="form-input required" id="cid_15">
+ <div style="width:302px;height:202px;" class="signature-pad-wrapper" id="signature_pad_15">
+ <!--[if IE 7]>
+ <script src="/js/vendor/json2.js"></script>
+ <![endif]-->
+ <div style="width:302px;height:202px;" class="signature-line signature-wrapper">
+ <div class="pad" data-required="false" data-id="15" data-height="200" data-width="300" id="sig_pad_15" style="width: 300px; height: 200px;">
+ <div style="padding:0 !important; margin:0 !important;width: 100% !important; height: 0 !important; -ms-touch-action: none;margin-top:-1em !important; margin-bottom:1em !important;"></div><canvas style="margin: 0px; padding: 0px; border: medium none; height: 200px; width: 300px;" class="jSignature" width="300" height="200"></canvas><div style="padding:0 !important; margin:0 !important;width: 100% !important; height: 0 !important; -ms-touch-action: none;margin-top:-1.5em !important; margin-bottom:1.5em !important; position: relative;"></div></div>
+ <input type="hidden" id="sig_pad_15" class="output4" name="q15_signature">
+ </div>
+ <span class="clear-pad-btn clear-pad">
+ Clear
+ </span>
+ </div>
+ <script>
+ window.signatureForm = true
+ </script>
+ </div>
+ </li>
+ <li id="id_16" data-type="control_widget" class="form-line required">
+ <label for="input_16" id="label_16" class="form-label form-label-left form-label-auto">
+ Signing Date
+ <span class="form-required">
+ *
+ </span>
+ </label>
+ <div class="form-input required" id="cid_16">
+ <div style="width:100%; text-align:Left;">
+ <div class="widget-inputs-wrapper">
+ <input type="hidden" value="" name="q16_signingDate" class="form-hidden form-widget widget-required " id="input_16">
+ </div>
+ <script>
+ </script>
+ </div>
+ </div>
+ </li>
+ <li id="id_17" data-type="control_fullname" class="form-line required">
+ <label for="input_17" id="label_17" class="form-label form-label-left form-label-auto">
+ Signing Name
+ <span class="form-required">
+ *
+ </span>
+ </label>
+ <div class="form-input required" id="cid_17">
+ <span style="vertical-align: top" class="form-sub-label-container">
+ <input type="text" id="first_17" name="q17_signingName[first]" size="10" class="form-textbox validate[required]">
+ <label style="min-height: 13px;" id="sublabel_first" for="first_17" class="form-sub-label"> First Name </label>
+ </span>
+ <span style="vertical-align: top" class="form-sub-label-container">
+ <input type="text" id="last_17" name="q17_signingName[last]" size="15" class="form-textbox validate[required]">
+ <label style="min-height: 13px;" id="sublabel_last" for="last_17" class="form-sub-label"> Last Name </label>
+ </span>
+ </div>
+ </li>
+ <li id="id_21" data-type="control_widget" class="form-line">
+ <label for="input_21" id="label_21" class="form-label form-label-left form-label-auto"> Portrait Photo </label>
+ <div class="form-input required" id="cid_21">
+ <div style="width:100%; text-align:Left;">
+ <div class="widget-inputs-wrapper">
+ <input type="hidden" value="" name="q21_portraitPhoto" class="form-hidden form-widget " id="input_21">
+ </div>
+
+ </div>
+ </div>
+ </li>
+ <li id="id_2" data-type="control_button" class="form-line">
+ <div class="form-input-wide" id="cid_2">
+ <div class="form-buttons-wrapper" style="margin-left:156px">
+ <button class="form-submit-button" type="submit" id="input_2">
+ Submit
+ </button>
+ </div>
+ </li>
+ <li style="display:none">
+ Should be Empty:
+ <input type="text" value="" name="website">
+ </li>
+ </ul>
+ </div>
+ <div class="col-lg-2 col-md-1 hidden-sm hidden-xs">&nbsp;</div>
+</form> \ No newline at end of file
diff --git a/templates/form_DSInspection.tpl b/templates/form_DSInspection.tpl
new file mode 100755
index 0000000..e856b8e
--- /dev/null
+++ b/templates/form_DSInspection.tpl
@@ -0,0 +1,223 @@
+{strip}
+<div class="form contact">
+ <div class="header">
+ <h1>Monthly Door Supervisor Inspection Report</h1>
+ </div>
+
+ <div class="body">
+ <form id="testForm" class="form-horizontal" method="post" novalidate="novalidate">
+ <fieldset>
+ <input id="sig1" name="sig1" type="hidden" value="test1" />
+ <input id="sig2" name="sig2" type="hidden" value="test2" />
+ <!-- Text input-->
+ <div class="col-md-6 col-sm-12">
+ <div class="form-group">
+ <label class="col-sm-4 control-label" for="DoorSupervisor">Door Supervisor</label>
+ <div class="col-sm-6">
+ <input id="DoorSupervisor" name="DoorSupervisor" placeholder="-----" class="form-control input-md" type="text">
+ </div>
+ <div class="col-sm-2">
+ <button type="button" class="btn btn-info" data-toggle="modal" data-target="#DSSig">Signature</button>
+ <!-- Modal -->
+ <div id="DSSig" class="modal fade" role="dialog">
+ <div class="modal-dialog">
+
+ <!-- Modal content-->
+ <div id="sigpad1" class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal">&times;</button>
+ <h4 class="modal-title">Door Supervisor Signature</h4>
+ </div>
+ <div class="modal-body">
+ <canvas></canvas>
+ </div>
+ <div class="modal-footer">
+ <div class="description">Sign above</div>
+ <button id="DSSig-clear" class="button clear" type="button">Clear</button>
+ <button id="DSSig-save" class="button save" type="button">Save</button>
+ </div>
+ </div>
+
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="col-sm-4 control-label" for="Location">Site/Venue</label>
+ <div class="col-sm-8">
+ <input id="Location" name="Location" placeholder="-----" class="form-control input-md" type="text">
+ </div>
+ </div>
+ </div>
+ <div class="col-md-6 col-sm-12">
+ <div class="form-group">
+ <label class="col-sm-4 control-label" for="Supervisor">Supervisor</label>
+ <div class="col-sm-6">
+ <input id="Supervisor" name="Supervisor" placeholder="-----" class="form-control input-md" type="text">
+ </div>
+ <div class="col-sm-2">
+ <button type="button" class="btn btn-info" data-toggle="modal" data-target="#SSig">Signature</button>
+ <!-- Modal -->
+ <div id="SSig" class="modal fade" role="dialog">
+ <div class="modal-dialog">
+
+ <!-- Modal content-->
+ <div id="sigpad2" class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal">&times;</button>
+ <h4 class="modal-title">Supervisor Signature</h4>
+ </div>
+ <div class="modal-body">
+ <canvas></canvas>
+ </div>
+ <div class="modal-footer">
+ <div class="description">Sign above</div>
+ <button id="SSig-clear" class="button clear" type="button">Clear</button>
+ <button id="SSig-save" class="button save" type="button">Save</button>
+ </div>
+ </div>
+
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="col-sm-4 control-label" for="Date">Date</label>
+ <div class="col-sm-8">
+ <input id="Date" name="Date" placeholder="-----" class="form-control input-md" type="text">
+ </div>
+ </div>
+ </div>
+ <div class="clear"></div>
+ <!-- Body Left -->
+ <div class="col-md-6 col-sm-12">
+ <div class="form-group">
+ <label class="col-sm-4 control-label" for="Uniform">Uniform</label>
+ <div class="col-sm-8">
+ <input id="Uniform" name="Uniform" placeholder="-----" class="form-control input-md" type="text">
+ </div>
+ </div>
+ <!-- Select Badge -->
+ <div class="form-group">
+ <label class="col-sm-4 control-label" for="Badge">I.D. Badge</label>
+ <div class="col-sm-8">
+ <select id="Badge" name="Badge" class="form-control">
+ <option value="-">-</option>
+ <option value="1">Yes</option>
+ <option value="0">No</option>
+ </select>
+ </div>
+ </div>
+ <!-- Select SIA Badge -->
+ <div class="form-group">
+ <label class="col-sm-4 control-label" for="SIAB">SIA Badge</label>
+ <div class="col-sm-8">
+ <select id="SIAB" name="SIAB" class="form-control">
+ <option value="-1">-</option>
+ <option value="1">Yes</option>
+ <option value="0">No</option>
+ </select>
+ </div>
+ </div>
+ <!-- Select Alertness -->
+ <div class="form-group">
+ <label class="col-sm-4 control-label" for="Alertness">Alertness</label>
+ <div class="col-sm-8">
+ <select id="Alertness" name="Alertness" class="form-control">
+ <option value="-1">-</option>
+ <option value="1">1 Bad</option>
+ <option value="2">2</option>
+ <option value="3">3</option>
+ <option value="4">4 Excellent</option>
+ </select>
+ </div>
+ </div>
+ <!-- Select Accuracy -->
+ <div class="form-group">
+ <label class="col-sm-4 control-label" for="Accuracy">Site / Venue Log & Timesheets</label>
+ <div class="col-sm-8">
+ <select id="Accuracy" name="Accuracy" class="form-control">
+ <option value="-1">-</option>
+ <option value="1">1 Bad</option>
+ <option value="2">2</option>
+ <option value="3">3</option>
+ <option value="4">4 Excellent</option>
+ </select>
+ </div>
+ </div>
+ <div class="form-group">
+ <label class="col-sm-4 control-label" for="Assign">Assignment Instructions</label>
+ <div class="col-sm-8">
+ <input id="Assign" name="Assign" placeholder="placeholder" class="form-control input-md" type="text">
+ </div>
+ </div>
+
+ </div>
+ <!-- Body Right -->
+ <div class="col-md-6 col-sm-12">
+ <div class="form-group">
+ <label class="col-sm-4 control-label" for="Shortage">Site / Venue Box:<br />(Record any forms missing or those which need replenishing)</label>
+ <div class="col-sm-8">
+ <textarea class="form-control" id="Shortage" name="Shortage" rows="5">Site Shortages</textarea>
+ </div>
+ </div>
+ <!-- Select Knowledge -->
+ <div class="form-group">
+ <label class="col-sm-4 control-label" for="Knowledge">Site / Venue Knowledge</label>
+ <div class="col-sm-8">
+ <select id="Knowledge" name="Knowledge" class="form-control">
+ <option value="-1">-</option>
+ <option value="1">1 Bad</option>
+ <option value="2">2</option>
+ <option value="3">3</option>
+ <option value="4">4 Excellent</option>
+ </select>
+ </div>
+ </div>
+ <!-- Select Handbook -->
+ <div class="form-group">
+ <label class="col-sm-4 control-label" for="Handbook">Employee Handbook</label>
+ <div class="col-sm-8">
+ <select id="Handbook" name="Handbook" class="form-control">
+ <option value="-1">-</option>
+ <option value="1">Yes</option>
+ <option value="0">No</option>
+ </select>
+ </div>
+ </div>
+ <!-- Select Assessment -->
+ <div class="form-group">
+ <label class="col-sm-4 control-label" for="Assessment">Risk Assessment</label>
+ <div class="col-sm-8">
+ <select id="Assessment" name="Assessment" class="form-control">
+ <option value="-1">-</option>
+ <option value="1">Yes</option>
+ <option value="0">No</option>
+ </select>
+ </div>
+ </div>
+
+ </div>
+ <div class="clear"></div>
+ <!-- Textarea -->
+ <div class="col-sm-12">
+ <div class="form-group">
+ <label class="col-sm-2 control-label" for="textarea">Potential Hazards</label>
+ <div class="col-sm-10">
+ <textarea class="form-control" id="Hazards" name="Hazards" rows="10">Record Identified Hazards</textarea>
+ </div>
+ </div>
+ </div>
+ <!-- Button (Double) -->
+ <div class="form-group">
+ <div class="col-md-2 col-sm-3 col-xs-12">
+ <input class="btn btn-primary" type="submit" value="Save" name="fSaveForm">
+ <input class="btn pull-right" type="submit" value="Cancel" name="fCancel" formnovalidate>
+ </div>
+ </div>
+ </fieldset>
+ </form>
+ </div><!-- end .body -->
+</div><!-- end .form_page -->
+{/strip}
+
diff --git a/templates/incident.tpl b/templates/incident.tpl
new file mode 100755
index 0000000..81ad0b3
--- /dev/null
+++ b/templates/incident.tpl
@@ -0,0 +1,41 @@
+{strip}
+<form id="employmentForm" class="form-horizontal" method="post" action="process.php?form=incident"
+ data-fv-framework="bootstrap"
+ data-fv-icon-valid="icon-tick"
+ data-fv-icon-invalid="icon-cross"
+ data-fv-icon-validating="icon-recycle">
+
+ <input type="hidden" value="form_incident" name="formID" />
+ <div class="col-lg-2 col-md-1 hidden-sm hidden-xs">&nbsp;</div>
+ <div class="form-all col-lg-8 col-md-10 col-sm-12 col-xs-12">
+
+ <div class="form-header-group">
+ <div class="header-text httal htvam">
+ <h3 class="form-header" id="header_1">
+ Incident Report
+ </h3>
+ </div>
+ </div>
+
+ <div class="form-input-wide" id="cid_18">
+ <div class="form-html" id="text_18">
+ <p>
+ <span style="color: #ff0000;"><strong>OK14A Rev: 1 Date: 04/2014 Pages: 1 of 1</strong></span>
+ </p>
+ </div>
+ </div>
+
+ {foreach from=$formInfo key=i item=item}
+ {include file="bitpackage:form/`$item['form_template']`.tpl" name=$item['cross_ref_title'] value1=$item['xkey'] value2=$item['xkey_ext'] value3=$item['xdata']}
+ {/foreach}
+
+ <div class="form-group">
+ <div class="col-xs-9 col-xs-offset-3">
+ <button type="submit" class="btn btn-primary" name="signup"
+ value="Sign up">Submit</button>
+ </div>
+ </div>
+ </div>
+ <div class="col-lg-2 col-md-1 hidden-sm hidden-xs">&nbsp;</div>
+</form>
+{/strip} \ No newline at end of file
diff --git a/templates/index.php b/templates/index.php
index 3e305fe..3e305fe 100644..100755
--- a/templates/index.php
+++ b/templates/index.php
diff --git a/templates/list.tpl b/templates/list.tpl
index 8bf772b..430ad80 100644..100755
--- a/templates/list.tpl
+++ b/templates/list.tpl
@@ -11,25 +11,15 @@
{include file="bitpackage:contact/display_list_header.tpl"}
<div class="table-responsive">
- <table class="table data clear">
+ <table class="col-xs-12">
<caption>{tr}Available Content{/tr} <span class="total">[ {$listInfo.total_records} ]</span></caption>
<tr>
- <th class="width2p">{booticon ipackage="icons" iname="icon-link" iexplain="sort by"}</th>
- <th>{smartlink ititle="Contract" isort="xkey" ihash=$listInfo.ihash}</th>
- {* {if $gBitUser->hasPermission( 'p_liberty_view_all_status' )}
- <th>{smartlink ititle="Forename" isort="forename" ihash=$listInfo.ihash}</th>
- <th>{smartlink ititle="Surname" isort="surname" ihash=$listInfo.ihash}</th>
- {/if} *}
- <th>{smartlink ititle="Title" isort="title" idefault=1 iorder=desc ihash=$listInfo.ihash}</th>
- {if $gBitUser->hasPermission( 'p_liberty_view_all_status' )}
- <th>{smartlink ititle="Address" isort="street" ihash=$listInfo.ihash}</th>
- <th>{smartlink ititle="Town" isort="town" ihash=$listInfo.ihash}</th>
- {/if}
- <th>{smartlink ititle="Location" isort="location" ihash=$listInfo.ihash}</th>
- <th>{smartlink ititle="Postcode" isort="postcode" ihash=$listInfo.ihash}</th>
+ <th class="width2p">{smartlink ititle="Contract" isort="xkey" ihash=$listInfo.ihash|default:''}</th>
+ <th>{smartlink ititle="Title" isort="title" idefault=1 iorder=desc ihash=$listInfo.ihash|default:''}</th>
+ <th>{smartlink ititle="Address" isort="street" ihash=$listInfo.ihash|default:''}</th>
</tr>
{section name=content loop=$listcontacts}
- <tr class="{cycle values='odd,even'}">
+ <tr class="first">
<td class="alignright">
<a href="display_contact.php?content_id={$listcontacts[content].content_id}" title="ci_{$listcontacts[content].content_id}">
{$listcontacts[content].xkey}
@@ -40,33 +30,23 @@
{$listcontacts[content].title}
</a>
</td>
- <td>{$item.content_status_name}</td>
- {if $gBitUser->hasPermission( 'p_liberty_view_all_status' )}
- <td>{if isset($listcontacts[content].house) && ($listcontacts[content].house <> '') }
- {$listcontacts[content].house},&nbsp;{/if}
- {if isset($listcontacts[content].add1) && ($listcontacts[content].add1 <> '') }
- {$listcontacts[content].add1},&nbsp;{/if}
- {if isset($listcontacts[content].add2) && ($listcontacts[content].add2 <> '') }
- {$listcontacts[content].add2},&nbsp;{/if}
- {if isset($listcontacts[content].add3) && ($listcontacts[content].add3 <> '') }
- {$listcontacts[content].add3},&nbsp;{/if}
- {if isset($listcontacts[content].add4) && ($listcontacts[content].add4 <> '') }
- {$listcontacts[content].add4},&nbsp;{/if}</td>
- {/if}
- <td>{if isset($listcontacts[content].town) && ($listcontacts[content].town <> '') }
- {$listcontacts[content].town}{/if}</td>
- <td>{if isset($listcontacts[content].grideast) }
- &lt;{$listcontacts[content].grideast|escape}&nbsp;,&nbsp;{$listcontacts[content].gridnorth|escape}&gt;&nbsp;{/if}
- {if $listcontacts[content].y_coordinate and $listcontacts[content].x_coordinate }
- &nbsp;Exact Cords:&lt;{$listcontacts[content].y_coordinate|escape}&nbsp;,&nbsp;{$listcontacts[content].x_coordinate|escape}&gt;&nbsp;
- {/if}
- </td>
- <td>{$listcontacts[content].postcode}</td>
+ <td>{if isset($listcontacts[content].house) && ($listcontacts[content].house <> '') }
+ {$listcontacts[content].house},&nbsp;{/if}
+ {if isset($listcontacts[content].add1) && ($listcontacts[content].add1 <> '') }
+ {$listcontacts[content].add1},&nbsp;{/if}
+ {if isset($listcontacts[content].add2) && ($listcontacts[content].add2 <> '') }
+ {$listcontacts[content].add2},&nbsp;{/if}
+ {if isset($listcontacts[content].add3) && ($listcontacts[content].add3 <> '') }
+ {$listcontacts[content].add3},&nbsp;{/if}
+ {if isset($listcontacts[content].add4) && ($listcontacts[content].add4 <> '') }
+ {$listcontacts[content].add4},&nbsp;{/if}
+ {if isset($listcontacts[content].town) && ($listcontacts[content].town <> '') }
+ {$listcontacts[content].town},&nbsp;{/if}
+ {$listcontacts[content].postcode}</td>
</tr>
<tr class="second">
- <td>{$item.display_link}</td>
- <td>{if isset($listcontacts[content].organisation) && ($listcontacts[content].organisation <> '') }Company: {$listcontacts[content].organisation}&nbsp;&nbsp;{/if}</td>
- <td>{assign var=content_type_guid value=$item.content_type_guid}{$gLibertySystem->getContentTypeName($content_type_guid)}</td>
+ <td>{$item.display_link|default:'Not Set'}</td>
+ <td>{assign var=content_type_guid value=$item.content_type_guid|default:'bitpage'}{$gLibertySystem->getContentTypeName($content_type_guid|default:'bitpage')}</td>
<td>
{tr}Refs{/tr}: {$listcontacts[content].refs|default:0}&nbsp;&nbsp;
{tr}Tasks{/tr}: {$listcontacts[content].tasks|default:0}&nbsp;&nbsp;
diff --git a/templates/list1.tpl b/templates/list1.tpl
index b9d08c4..b9d08c4 100644..100755
--- a/templates/list1.tpl
+++ b/templates/list1.tpl
diff --git a/templates/list2.tpl b/templates/list2.tpl
new file mode 100755
index 0000000..be00cde
--- /dev/null
+++ b/templates/list2.tpl
@@ -0,0 +1,91 @@
+{strip}
+
+<div class="floaticon">{bithelp}</div>
+
+<div class="listing contacts">
+ <div class="header">
+ <h1>{tr}Contacts{/tr}</h1>
+ </div>
+
+ <div class="body">
+
+ {include file="bitpackage:contact/display_list_header2.tpl"}
+ <div class="table-responsive">
+ <table class="table data clear">
+ <caption>{tr}Available Content{/tr} <span class="total">[ {$listInfo.total_records} ]</span></caption>
+ <tr>
+ <th class="width2p">{booticon ipackage="icons" iname="icon-link" iexplain="sort by"}</th>
+ <th>{smartlink ititle="Contract" isort="xkey" ihash=$listInfo.ihash}</th>
+ {* {if $gBitUser->hasPermission( 'p_liberty_view_all_status' )}
+ <th>{smartlink ititle="Forename" isort="forename" ihash=$listInfo.ihash}</th>
+ <th>{smartlink ititle="Surname" isort="surname" ihash=$listInfo.ihash}</th>
+ {/if} *}
+ <th>{smartlink ititle="Title" isort="title" idefault=1 iorder=desc ihash=$listInfo.ihash}</th>
+ {if $gBitUser->hasPermission( 'p_liberty_view_all_status' )}
+ <th>{smartlink ititle="Address" isort="street" ihash=$listInfo.ihash}</th>
+ <th>{smartlink ititle="Town" isort="town" ihash=$listInfo.ihash}</th>
+ {/if}
+ <th>{smartlink ititle="Location" isort="location" ihash=$listInfo.ihash}</th>
+ <th>{smartlink ititle="Postcode" isort="postcode" ihash=$listInfo.ihash}</th>
+ </tr>
+ {section name=content loop=$listcontacts}
+ <tr class="{cycle values='odd,even'}">
+ <td class="alignright">
+ <a href="display_contact.php?content_id={$listcontacts[content].content_id}" title="ci_{$listcontacts[content].content_id}">
+ {$listcontacts[content].xkey}
+ </a>
+ </td>
+ <td class="alignleft">
+ <a href="display_contact.php?content_id={$listcontacts[content].content_id}" title="ci_{$listcontacts[content].content_id}">
+ {$listcontacts[content].title}
+ </a>
+ </td>
+ <td>{$item.content_status_name}</td>
+ {if $gBitUser->hasPermission( 'p_liberty_view_all_status' )}
+ <td>{if isset($listcontacts[content].house) && ($listcontacts[content].house <> '') }
+ {$listcontacts[content].house},&nbsp;{/if}
+ {if isset($listcontacts[content].add1) && ($listcontacts[content].add1 <> '') }
+ {$listcontacts[content].add1},&nbsp;{/if}
+ {if isset($listcontacts[content].add2) && ($listcontacts[content].add2 <> '') }
+ {$listcontacts[content].add2},&nbsp;{/if}
+ {if isset($listcontacts[content].add3) && ($listcontacts[content].add3 <> '') }
+ {$listcontacts[content].add3},&nbsp;{/if}
+ {if isset($listcontacts[content].add4) && ($listcontacts[content].add4 <> '') }
+ {$listcontacts[content].add4},&nbsp;{/if}</td>
+ {/if}
+ <td>{if isset($listcontacts[content].town) && ($listcontacts[content].town <> '') }
+ {$listcontacts[content].town}{/if}</td>
+ <td>{if isset($listcontacts[content].grideast) }
+ &lt;{$listcontacts[content].grideast|escape}&nbsp;,&nbsp;{$listcontacts[content].gridnorth|escape}&gt;&nbsp;{/if}
+ {if $listcontacts[content].y_coordinate and $listcontacts[content].x_coordinate }
+ &nbsp;Exact Cords:&lt;{$listcontacts[content].y_coordinate|escape}&nbsp;,&nbsp;{$listcontacts[content].x_coordinate|escape}&gt;&nbsp;
+ {/if}
+ </td>
+ <td>{$listcontacts[content].postcode}</td>
+ </tr>
+ <tr class="second">
+ <td>{$item.display_link}</td>
+ <td>{if isset($listcontacts[content].organisation) && ($listcontacts[content].organisation <> '') }Company: {$listcontacts[content].organisation}&nbsp;&nbsp;{/if}</td>
+ <td>{assign var=content_type_guid value=$item.content_type_guid}{$gLibertySystem->getContentTypeName($content_type_guid)}</td>
+ <td>
+ {tr}Refs{/tr}: {$listcontacts[content].refs|default:0}&nbsp;&nbsp;
+ {tr}Tasks{/tr}: {$listcontacts[content].tasks|default:0}&nbsp;&nbsp;
+ {tr}Addresses{/tr}: {$listcontacts[content].addresses|default:0}
+ </td>
+ {if $gBitUser->hasPermission( 'p_liberty_view_all_status' )}
+ <td>{if isset($listcontacts[content].dob) && ($listcontacts[content].dob <> '') }DOB: {$listcontacts[content].dob}{/if}</td>
+ <td>{if isset($listcontacts[content].nino) && ($listcontacts[content].nino <> '') }NI: {$listcontacts[content].nino}{/if}</td>
+ {/if}
+ </tr>
+ {sectionelse}
+ <tr class="norecords">
+ <td colspan="8">{tr}No records found{/tr}</td>
+ </tr>
+ {/section}
+ </table>
+ </div>
+ {pagination}
+ </div><!-- end .body -->
+</div><!-- end .contacts -->
+
+{/strip}
diff --git a/templates/list_clients.tpl b/templates/list_clients.tpl
index 8c71a8a..8c71a8a 100644..100755
--- a/templates/list_clients.tpl
+++ b/templates/list_clients.tpl
diff --git a/templates/list_contact.tpl b/templates/list_contact.tpl
index 6d9ed21..156ffa1 100644..100755
--- a/templates/list_contact.tpl
+++ b/templates/list_contact.tpl
@@ -83,7 +83,7 @@
{if $checkboxes_on eq 'y'}
<tr><td colspan="16">
- <script language="Javascript" type="text/javascript">
+ <script>
<!--
// check / uncheck all.
// in the future, we could extend this to happen serverside as well for the convenience of people w/o javascript.
@@ -103,7 +103,7 @@
{/if}
{* add here e.g. <option value="categorize">{tr}categorize{/tr}</option> *}
</select>
- <script language="Javascript" type="text/javascript">
+ <script>
<!--
// Fake js to allow the use of the <noscript> tag (so non-js-users kenn still submit)
//-->
diff --git a/templates/list_contact_type.tpl b/templates/list_contact_type.tpl
index b475b70..1800107 100644..100755
--- a/templates/list_contact_type.tpl
+++ b/templates/list_contact_type.tpl
@@ -1,4 +1,4 @@
-{if isset( $pageInfo.xref_type ) }
+{if isset( $gContent->mInfo.xref_type ) }
<div class="form-group">
<table>
<thead>
@@ -9,16 +9,16 @@
</tr>
</thead>
<tbody>
- {section name=xref loop=$pageInfo.xref_type}
+ {section name=xref loop=$gContent->mInfo.xref_type}
<tr class="{cycle values="even,odd"}" title="{$list[county].title|escape}">
<td>
- {$pageInfo.xref0[xref].source_title|escape}
+ {$gContent->mInfo.xref0[xref].source_title|escape}
</td>
- <td>
- {$pageInfo.xref0[xref].last_update_date|bit_short_date}
- </td>
<td>
- {smartlink ititle="Add additional contact types" ifile="add_xref.php" booticon="icon-page-add" content_id=$pageInfo.content_id}
+ {$gContent->mInfo.xref0[xref].last_update_date|bit_short_date}
+ </td>
+ <td>
+ {smartlink ititle="Add additional contact types" ifile="add_xref.php" booticon="icon-page-add" content_id=$gContent->mInfo.content_id}
</td>
</tr>
{/section}
diff --git a/templates/list_contacts.tpl b/templates/list_contacts.tpl
index 58472d8..02545fd 100644..100755
--- a/templates/list_contacts.tpl
+++ b/templates/list_contacts.tpl
@@ -83,7 +83,7 @@
{if $checkboxes_on eq 'y'}
<tr><td colspan="16">
- <script language="Javascript" type="text/javascript">
+ <script>
<!--
// check / uncheck all.
// in the future, we could extend this to happen serverside as well for the convenience of people w/o javascript.
@@ -103,7 +103,7 @@
{/if}
{* add here e.g. <option value="categorize">{tr}categorize{/tr}</option> *}
</select>
- <script language="Javascript" type="text/javascript">
+ <script>
<!--
// Fake js to allow the use of the <noscript> tag (so non-js-users kenn still submit)
//-->
diff --git a/templates/list_contracts.tpl b/templates/list_contracts.tpl
index 6fc8ecb..1bfc040 100644..100755
--- a/templates/list_contracts.tpl
+++ b/templates/list_contracts.tpl
@@ -73,6 +73,6 @@
</div><!-- end .body -->
-{libertypagination}
+{pagination}
</div> {* end .admin *}
diff --git a/templates/list_ticket.tpl b/templates/list_ticket.tpl
index f794fe6..2368fac 100644..100755
--- a/templates/list_ticket.tpl
+++ b/templates/list_ticket.tpl
@@ -1,6 +1,6 @@
- {assign var=ticketscnt value=$pageInfo.tickets|@count}
+ {assign var=ticketscnt value=$gContent->mInfo.tickets|@count}
{jstab title="Ticket History ($ticketscnt)"}
{legend legend="Ticket History"}
<div class="form-group">
@@ -16,20 +16,20 @@
</tr>
</thead>
<tbody>
- {section name=ticket loop=$pageInfo.tickets}
- <tr class="{cycle values="even,odd"}" title="{$pageInfo.ticket[ticket].title|escape}">
+ {section name=ticket loop=$gContent->mInfo.tickets}
+ <tr class="{cycle values="even,odd"}" title="{$gContent->mInfo.ticket[ticket].title|escape}">
<td>
- {$pageInfo.tickets[ticket].ticket_ref|bit_long_date} - {$pageInfo.tickets[ticket].ticket_no}
+ {$gContent->mInfo.tickets[ticket].ticket_ref|bit_long_date} - {$gContent->mInfo.tickets[ticket].ticket_no}
</td>
<td>
- {$pageInfo.tickets[ticket].tags|escape}
+ {$gContent->mInfo.tickets[ticket].tags|escape}
</td>
<td>
<span class="actionicon">
- {smartlink ititle="View" ifile="view_ticket.php" booticon="icon-note-edit" ticket_id=$pageInfo.tickets[ticket].ticket_id}
+ {smartlink ititle="View" ifile="view_ticket.php" booticon="icon-note-edit" ticket_id=$gContent->mInfo.tickets[ticket].ticket_id}
</span>
- <label for="ev_{$pageInfo.tickets[ticket].ticket_no}">
- {$pageInfo.tickets[ticket].staff_id}
+ <label for="ev_{$gContent->mInfo.tickets[ticket].ticket_no}">
+ {$gContent->mInfo.tickets[ticket].staff_id}
</label>
</td>
</tr>
diff --git a/templates/list_xref.tpl b/templates/list_xref.tpl
index edae52c..794f3ad 100644..100755
--- a/templates/list_xref.tpl
+++ b/templates/list_xref.tpl
@@ -1,5 +1,5 @@
- {assign var=xrefcnt value=$pageInfo.xref|@count}
+ {assign var=xrefcnt value=$gContent->mInfo.xref|@count}
{jstab title="Cross reference ($xrefcnt)"}
{legend legend="Information References"}
<div class="form-group">
@@ -19,34 +19,34 @@
</tr>
</thead>
<tbody>
- {section name=xref loop=$pageInfo.xref}
+ {section name=xref loop=$gContent->mInfo.xref}
<tr class="{cycle values="even,odd"}" title="{$list[county].title|escape}">
<td>
- {$pageInfo.xref[xref].source_title|escape}
+ {$gContent->mInfo.xref[xref].source_title|escape}
</td>
<td>
- {$pageInfo.xref[xref].data|escape}
+ {$gContent->mInfo.xref[xref].data|escape}
</td>
<td>
- {if isset($pageInfo.xref[xref].usn) && ($pageInfo.xref[xref].usn <> '') }
- {$pageInfo.xref[xref].usn|escape}
- {smartlink ititle="Link to" ifile="../property/display_property.php" booticon="icon-note-edit" property_id=$pageInfo.xref[xref].usn}
+ {if isset($gContent->mInfo.xref[xref].usn) && ($gContent->mInfo.xref[xref].usn <> '') }
+ {$gContent->mInfo.xref[xref].usn|escape}
+ {smartlink ititle="Link to" ifile="../property/display_property.php" booticon="icon-note-edit" property_id=$gContent->mInfo.xref[xref].usn}
{/if}
</td>
{if $gBitSystem->isFeatureActive( 'contact_list_last_modified' )}
- <td>
- {$pageInfo.xref[xref].last_update_date|bit_long_date}
- </td>
+ <td>
+ {$gContent->mInfo.xref[xref].last_update_date|bit_long_date}
+ </td>
{/if}
<td>
<span class="actionicon">
- {smartlink ititle="View" ifile="view_xref.php" booticon="icon-note-go" source=$pageInfo.xref[xref].source xref=$pageInfo.xref[xref].cross_reference}
+ {smartlink ititle="View" ifile="view_xref.php" booticon="icon-note-go" source=$gContent->mInfo.xref[xref].source xref=$gContent->mInfo.xref[xref].cross_reference}
</span>
<span class="actionicon">
- {smartlink ititle="Edit" ifile="edit_xref.php" booticon="icon-note-edit" source=$pageInfo.xref[xref].source xref=$pageInfo.xref[xref].cross_reference} </span>
+ {smartlink ititle="Edit" ifile="edit_xref.php" booticon="icon-note-edit" source=$gContent->mInfo.xref[xref].source xref=$gContent->mInfo.xref[xref].cross_reference} </span>
</span>
- <label for="ev_{$pageInfo.xref[xref].cross_reference}">
- {$pageInfo.xref[xref].cross_reference}
+ <label for="ev_{$gContent->mInfo.xref[xref].cross_reference}">
+ {$gContent->mInfo.xref[xref].cross_reference}
</label>
</td>
</tr>
diff --git a/templates/list_xref_generic.tpl b/templates/list_xref_generic.tpl
index 355182b..dcd9f40 100644..100755
--- a/templates/list_xref_generic.tpl
+++ b/templates/list_xref_generic.tpl
@@ -1,8 +1,8 @@
-{* if isset( $pageInfo.$source ) *}
- {assign var=xrefcnt value=$pageInfo.$source|@count}
+{* if isset( $gContent->mInfo.$source ) *}
+ {assign var=xrefcnt value=$gContent->mInfo.$source|default:[]|@count}
{jstab title="$source_title ($xrefcnt)"}
{legend legend=$source_title}
- <div class="form-group">
+ <div class="form-group table-responsive">
<table>
<thead>
<tr>
@@ -23,59 +23,9 @@
</tr>
</thead>
<tbody>
- {section name=xref loop=$pageInfo.$source}
- <tr class="{cycle values="even,odd"}" title="{$pageInfo.title|escape}">
- <td>
- {$pageInfo.$source[xref].source_title|escape}
- </td>
- <td>
- {if isset($pageInfo.$source[xref].xref) && $pageInfo.$source[xref].xref <> '' && $pageInfo.$source[xref].xref > 100 }
- {$pageInfo.$source[xref].xref|escape}
- {smartlink ititle="Link to" ifile="display_contact.php" booticon="icon-note-edit" content_id=$pageInfo.$source[xref].xref}
- {else}
- ------
- {/if}
- </td>
- <td>
- {$pageInfo.$source[xref].xkey|escape} {$pageInfo.$source[xref].xkey_ext|escape}
- </td>
- <td>
- {$pageInfo.$source[xref].data|escape}
- </td>
- <td>
- {if $source ne 'history' }
- {$pageInfo.$source[xref].start_date|bit_short_date}
- {else}
- {$pageInfo.$source[xref].end_date|bit_short_date}
- {/if}
- </td>
- {if $gBitSystem->isFeatureActive( 'contact_list_last_modified' )}
- <td>
- {$pageInfo.xref[xref].last_update_date|bit_long_date}
- </td>
- {/if}
- <td>
- <span class="actionicon">
- {if $gBitUser->hasPermission( 'p_contact_view_detail' )}
- {smartlink ititle="View" ifile="view_xref.php" booticon="icon-view" content_id=$pageInfo.content_id xref_id=$pageInfo.$source[xref].xref_id}
- {/if}
- {if $gBitUser->hasPermission( 'p_contact_update' ) and $source ne 'history' }
- {if $pageInfo.$source[xref].source eq 'KEY_B' }
- {smartlink ititle="Callout" ifile="edit_key_break.php" booticon="icon-redo" expunge=0 content_id=$pageInfo.content_id xref_id=$pageInfo.$source[xref].xref_id}
- {smartlink ititle="Reseal" ifile="edit_key_break.php" booticon="icon-undo" expunge=2 content_id=$pageInfo.content_id xref_id=$pageInfo.$source[xref].xref_id}
- {else}
- {smartlink ititle="Edit" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$pageInfo.content_id xref_id=$pageInfo.$source[xref].xref_id}
- {/if}
- {/if}
- {if $gBitUser->hasPermission( 'p_contact_expunge' ) and $pageInfo.$source[xref].source ne 'KEY_B' }
- {if $source eq 'history' }
- {smartlink ititle="Restore" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$pageInfo.content_id xref_id=$pageInfo.$source[xref].xref_id expunge=-1}
- {else}
- {smartlink ititle="Delete" ifile="edit_xref.php" booticon="icon-note-delete" content_id=$pageInfo.content_id xref_id=$pageInfo.$source[xref].xref_id expunge=1}
- {/if}
- {/if}
- </span>
- </td>
+ {section name=xref loop=$gContent->mInfo.$source}
+ <tr class="{cycle values="even,odd"}" title="{$gContent->mInfo.title|escape}">
+ {include file="bitpackage:contact/view_xref_`$gContent->mInfo.$source[xref].template`_record.tpl"}
</tr>
{sectionelse}
<tr class="norecords">
@@ -90,10 +40,10 @@
{if $gBitUser->hasPermission('p_contact_update')}
<div>
{if $source ne 'history' }
- {smartlink ititle="Add additional detail record" ifile="add_xref.php" booticon="icon-note-add" content_id=$pageInfo.content_id xref_type=$xref_type}
+ {smartlink ititle="Add additional detail record" ifile="add_xref.php" booticon="icon-note-add" content_id=$gContent->mInfo.content_id xref_type=$xref_type}
{/if}
</div>
{/if}
{/legend}
{/jstab}
-{* /if *} \ No newline at end of file
+{* /if *}
diff --git a/templates/load_contacts.tpl b/templates/load_contacts.tpl
index 6a02d8d..6a02d8d 100644..100755
--- a/templates/load_contacts.tpl
+++ b/templates/load_contacts.tpl
diff --git a/templates/load_sage_contacts.tpl b/templates/load_sage_contacts.tpl
index e80a34c..e80a34c 100644..100755
--- a/templates/load_sage_contacts.tpl
+++ b/templates/load_sage_contacts.tpl
diff --git a/templates/menu_contact.tpl b/templates/menu_contact.tpl
index 1140569..3033077 100644..100755
--- a/templates/menu_contact.tpl
+++ b/templates/menu_contact.tpl
@@ -7,9 +7,9 @@
{if $gBitUser->isAdmin() or $gBitUser->hasPermission( 'p_contact_edit' ) }
<li><a class="item" href="{$smarty.const.CONTACT_PKG_URL}edit.php">{booticon ipackage="icons" iname="icon-telephone-edit" iexplain="Create/Edit a Contact" ilocation=menu}</a></li>
{/if}
- {if $pageInfo.content_id and ( $gBitUser->isAdmin() or $gBitUser->hasPermission( 'p_task_edit' ) ) }
- <li><a class="item" href="{$smarty.const.TASKS_PKG_URL}edit.php?content_id={$pageInfo.content_id}">{booticon ipackage="icons" iname="icon-build_add" iexplain="Create/Edit a Job" ilocation=menu}</a></li>
- <li><a class="item" href="{$smarty.const.TASKS_PKG_URL}add_callout.php?content_id={$pageInfo.content_id}&property={$pageInfo.content_id}">{booticon ipackage="icons" iname="icon-telephone-error" iexplain="Log a callout" ilocation=menu}</a></li>
+ {if $gContent->mInfo.content_id and ( $gBitUser->isAdmin() or $gBitUser->hasPermission( 'p_task_edit' ) ) }
+ <li><a class="item" href="{$smarty.const.TASKS_PKG_URL}edit.php?content_id={$gContent->mInfo.content_id}">{booticon ipackage="icons" iname="icon-build_add" iexplain="Create/Edit a Job" ilocation=menu}</a></li>
+ <li><a class="item" href="{$smarty.const.TASKS_PKG_URL}add_callout.php?content_id={$gContent->mInfo.content_id}&property={$gContent->mInfo.content_id}">{booticon ipackage="icons" iname="icon-telephone-error" iexplain="Log a callout" ilocation=menu}</a></li>
{/if}
{if $gBitUser->hasPermission('p_contact_admin')}
<li><a class="item" href="{$smarty.const.KERNEL_PKG_URL}admin/index.php?page=contact">{booticon ipackage="icons" iname="icon-telephone-go" iexplain="Admin contacts" ilocation=menu}</a></li>
diff --git a/templates/menu_contact_admin.tpl b/templates/menu_contact_admin.tpl
index 9c0af21..9c0af21 100644..100755
--- a/templates/menu_contact_admin.tpl
+++ b/templates/menu_contact_admin.tpl
diff --git a/templates/page_display.tpl b/templates/page_display.tpl
index 572332f..2aa72d4 100644..100755
--- a/templates/page_display.tpl
+++ b/templates/page_display.tpl
@@ -1,25 +1,25 @@
{strip}
-<div class="body"{if $users_double_click eq 'y' and $dblclickedit eq 'y' and $gBitUser->hasPermission( 'bit_p_edit' )} ondblclick="location.href='{$smarty.const.CONTACT_PKG_URL}edit.php?content_id={$pageInfo.content_id}';"{/if}>
+<div class="body"{if $users_double_click eq 'y' and $dblclickedit eq 'y' and $gBitUser->hasPermission( 'bit_p_edit' )} ondblclick="location.href='{$smarty.const.CONTACT_PKG_URL}edit.php?content_id={$gContent->mInfo.content_id}';"{/if}>
<div class="header">
- {tr}<h1>Project-{$pageInfo.project_name}{/tr}{tr} Version-{$pageInfo.revision}</h1>{/tr}
+ {tr}<h1>Project-{$gContent->mInfo.project_name}{/tr}{tr} Version-{$gContent->mInfo.revision}</h1>{/tr}
</div>
- {if $pageInfo.status=='C' }
+ {if $gContent->mInfo.status=='C' }
<div class="date">
- {tr}Closed by {displayname user=$pageInfo.closed_user user_id=$pageInfo.closed_user_id real_name=$pageInfo.closed_real_name} on {$pageInfo.closed|bit_short_datetime}{/tr}
+ {tr}Closed by {displayname user=$gContent->mInfo.closed_user user_id=$gContent->mInfo.closed_user_id real_name=$gContent->mInfo.closed_real_name} on {$gContent->mInfo.closed|bit_short_datetime}{/tr}
</div>
{/if}
- {if $pageInfo.status=='O' }
+ {if $gContent->mInfo.status=='O' }
<div class="date">
- {tr}Incident Report Open - Priority {$pageInfo.priority} {/tr}
+ {tr}Incident Report Open - Priority {$gContent->mInfo.priority} {/tr}
</div>
{/if}
- {if $pageInfo.status=='X' }
+ {if $gContent->mInfo.status=='X' }
<div class="date">
{tr}Incident Report Cancelled{/tr}
</div>
{/if}
<div class="header">
- {tr}<h1>{$pageInfo.title}</h1>{/tr}
+ {tr}<h1>{$gContent->mInfo.title}</h1>{/tr}
</div>
<div class="content">
{$parsed}
diff --git a/templates/show_contact.tpl b/templates/show_contact.tpl
index c399a29..d0346f1 100644..100755
--- a/templates/show_contact.tpl
+++ b/templates/show_contact.tpl
@@ -5,11 +5,11 @@
{include file="bitpackage:contact/display_contact.tpl"}
{jstabs}
{jstab title="Local Notes" class="contact_notes"}
- {include file="bitpackage:liberty/comments.tpl"}
+ {include file="bitpackage:contact/comments.tpl"}
{/jstab}
- {if $pageInfo.client_list }
+ {if !empty($gContent->mInfo.client_list) }
{jstab title="Client List" class="client_list"}
- {include file="bitpackage:contact/list_clients.tpl" client_list=$pageInfo.client_list}
+ {include file="bitpackage:contact/list_clients.tpl" client_list=$gContent->mInfo.client_list}
{/jstab}
{/if}
{if $gBitSystem->isFeatureActive('package_tasks')}
@@ -17,9 +17,7 @@
{include file="bitpackage:tasks/list_tasks.tpl"}
{/jstab}
{/if}
- {jstab title="Images" class="contact_pics"}
- {include file="`$smarty.const.FISHEYE_PKG_PATH`gallery_views/fixed_grid/fisheye_fixed_grid_test.tpl" }
- {/jstab}
{/jstabs}
+ {include file="`$smarty.const.FISHEYE_PKG_PATH`gallery_views/fixed_grid/fisheye_fixed_grid_test.tpl" }
</div> {* end .body *}
</div> {* end .contact *}
diff --git a/templates/show_contact_item.tpl b/templates/show_contact_item.tpl
index b881b8b..b881b8b 100644..100755
--- a/templates/show_contact_item.tpl
+++ b/templates/show_contact_item.tpl
diff --git a/templates/view_xref.tpl b/templates/view_xref.tpl
index 2cab28b..2cab28b 100644..100755
--- a/templates/view_xref.tpl
+++ b/templates/view_xref.tpl
diff --git a/templates/view_xref_address.tpl b/templates/view_xref_address.tpl
index 18c8549..18c8549 100644..100755
--- a/templates/view_xref_address.tpl
+++ b/templates/view_xref_address.tpl
diff --git a/templates/view_xref_address_record.tpl b/templates/view_xref_address_record.tpl
new file mode 100755
index 0000000..8c7a4aa
--- /dev/null
+++ b/templates/view_xref_address_record.tpl
@@ -0,0 +1,43 @@
+{strip}
+<td>
+ {$gContent->mInfo.$source[xref].source_title|escape}
+</td>
+<td>
+&nbsp;
+</td>
+<td>
+ {$gContent->mInfo.$source[xref].xkey_ext|escape}, {$gContent->mInfo.$source[xref].address|escape}, {$gContent->mInfo.$source[xref].xkey|escape}
+</td>
+<td>
+ {$gContent->mInfo.$source[xref].data|escape}
+</td>
+<td>
+{if $source ne 'history' }
+ {$gContent->mInfo.$source[xref].start_date|bit_short_date}
+{else}
+ {$gContent->mInfo.$source[xref].end_date|bit_short_date}
+{/if}
+</td>
+{if $gBitSystem->isFeatureActive( 'contact_list_last_modified' )}
+ <td>
+ {$gContent->mInfo.xref[xref].last_update_date|bit_long_date}
+ </td>
+{/if}
+<td>
+ <span class="actionicon">
+ {if $gBitUser->hasPermission( 'p_contact_view_detail' )}
+ {smartlink ititle="View" ifile="view_xref.php" booticon="icon-view" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
+ {/if}
+ {if $gBitUser->hasPermission( 'p_contact_update' ) and $source ne 'history' }
+ {smartlink ititle="Edit" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
+ {/if}
+ {if $gBitUser->hasPermission( 'p_contact_expunge' ) and $gContent->mInfo.$source[xref].source ne 'KEY_B' }
+ {if $source eq 'history' }
+ {smartlink ititle="Restore" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id expunge=-1}
+ {else}
+ {smartlink ititle="Delete" ifile="edit_xref.php" booticon="icon-note-delete" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id expunge=1}
+ {/if}
+ {/if}
+ </span>
+</td>
+{/strip}
diff --git a/templates/view_xref_bank_record.tpl b/templates/view_xref_bank_record.tpl
new file mode 100755
index 0000000..fd9d423
--- /dev/null
+++ b/templates/view_xref_bank_record.tpl
@@ -0,0 +1,40 @@
+{strip}
+<td>
+ {$gContent->mInfo.$source[xref].source_title|escape}
+</td>
+<td>
+ &nbsp;
+</td>
+<td>
+ {$gContent->mInfo.$source[xref].xkey|escape} {$gContent->mInfo.$source[xref].xkey_ext|escape}
+</td>
+<td>
+ {$gContent->mInfo.$source[xref].data|escape}
+</td>
+<td>
+{if $source ne 'history' }
+ {$gContent->mInfo.$source[xref].start_date|bit_short_date}
+{else}
+ {$gContent->mInfo.$source[xref].end_date|bit_short_date}
+{/if}
+</td>
+{if $gBitSystem->isFeatureActive( 'contact_list_last_modified' )}
+ <td>
+ {$gContent->mInfo.xref[xref].last_update_date|bit_long_date}
+ </td>
+{/if}
+<td>
+ <span class="actionicon">
+ {if $gBitUser->hasPermission( 'p_contact_update' ) and $source ne 'history' }
+ {smartlink ititle="Edit" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
+ {/if}
+ {if $gBitUser->hasPermission( 'p_contact_expunge' ) }
+ {if $source eq 'history' }
+ {smartlink ititle="Restore" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id expunge=-1}
+ {else}
+ {smartlink ititle="Delete" ifile="edit_xref.php" booticon="icon-note-delete" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id expunge=1}
+ {/if}
+ {/if}
+ </span>
+</td>
+{/strip}
diff --git a/templates/view_xref_contact.tpl b/templates/view_xref_contact.tpl
index c44f46e..c44f46e 100644..100755
--- a/templates/view_xref_contact.tpl
+++ b/templates/view_xref_contact.tpl
diff --git a/templates/view_xref_contact_record.tpl b/templates/view_xref_contact_record.tpl
new file mode 100755
index 0000000..44dda61
--- /dev/null
+++ b/templates/view_xref_contact_record.tpl
@@ -0,0 +1,50 @@
+{strip}
+<td>
+ {$gContent->mInfo.$source[xref].source_title|escape}
+</td>
+<td>
+ {if isset($gContent->mInfo.$source[xref].xref) && $gContent->mInfo.$source[xref].xref <> '' && $gContent->mInfo.$source[xref].xref > 100 }
+ {$gContent->mInfo.$source[xref].xref|escape}
+ {smartlink ititle="Link to" ifile="display_contact.php" booticon="icon-note-edit" content_id=$gContent->mInfo.$source[xref].xref}
+ {else}
+ &nbsp;
+ {/if}
+</td>
+<td>
+ {$gContent->mInfo.$source[xref].xkey|escape} {$gContent->mInfo.$source[xref].xkey_ext|escape}
+</td>
+<td>
+ {$gContent->mInfo.$source[xref].data|escape}
+</td>
+<td>
+{if $source ne 'history' }
+ {$gContent->mInfo.$source[xref].start_date|bit_short_date}
+{else}
+ {$gContent->mInfo.$source[xref].end_date|bit_short_date}
+{/if}
+</td>
+{if $gBitSystem->isFeatureActive( 'contact_list_last_modified' )}
+ <td>
+ {$gContent->mInfo.xref[xref].last_update_date|bit_long_date}
+ </td>
+{/if}
+<td>
+ <span class="actionicon">
+ {if $gBitUser->hasPermission( 'p_contact_update' ) and $source ne 'history' }
+ {if $gContent->mInfo.$source[xref].source eq 'KEY_B' }
+ {smartlink ititle="Callout" ifile="edit_key_break.php" booticon="icon-redo" expunge=0 content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
+ {smartlink ititle="Reseal" ifile="edit_key_break.php" booticon="icon-undo" expunge=2 content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
+ {else}
+ {smartlink ititle="Edit" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
+ {/if}
+ {/if}
+ {if $gBitUser->hasPermission( 'p_contact_expunge' ) and $gContent->mInfo.$source[xref].source ne 'KEY_B' }
+ {if $source eq 'history' }
+ {smartlink ititle="Restore" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id expunge=-1}
+ {else}
+ {smartlink ititle="Delete" ifile="edit_xref.php" booticon="icon-note-delete" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id expunge=1}
+ {/if}
+ {/if}
+ </span>
+</td>
+{/strip}
diff --git a/templates/view_xref_date_record.tpl b/templates/view_xref_date_record.tpl
new file mode 100755
index 0000000..fd9d423
--- /dev/null
+++ b/templates/view_xref_date_record.tpl
@@ -0,0 +1,40 @@
+{strip}
+<td>
+ {$gContent->mInfo.$source[xref].source_title|escape}
+</td>
+<td>
+ &nbsp;
+</td>
+<td>
+ {$gContent->mInfo.$source[xref].xkey|escape} {$gContent->mInfo.$source[xref].xkey_ext|escape}
+</td>
+<td>
+ {$gContent->mInfo.$source[xref].data|escape}
+</td>
+<td>
+{if $source ne 'history' }
+ {$gContent->mInfo.$source[xref].start_date|bit_short_date}
+{else}
+ {$gContent->mInfo.$source[xref].end_date|bit_short_date}
+{/if}
+</td>
+{if $gBitSystem->isFeatureActive( 'contact_list_last_modified' )}
+ <td>
+ {$gContent->mInfo.xref[xref].last_update_date|bit_long_date}
+ </td>
+{/if}
+<td>
+ <span class="actionicon">
+ {if $gBitUser->hasPermission( 'p_contact_update' ) and $source ne 'history' }
+ {smartlink ititle="Edit" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
+ {/if}
+ {if $gBitUser->hasPermission( 'p_contact_expunge' ) }
+ {if $source eq 'history' }
+ {smartlink ititle="Restore" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id expunge=-1}
+ {else}
+ {smartlink ititle="Delete" ifile="edit_xref.php" booticon="icon-note-delete" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id expunge=1}
+ {/if}
+ {/if}
+ </span>
+</td>
+{/strip}
diff --git a/templates/view_xref_image_record.tpl b/templates/view_xref_image_record.tpl
new file mode 100755
index 0000000..63f9adc
--- /dev/null
+++ b/templates/view_xref_image_record.tpl
@@ -0,0 +1,40 @@
+{strip}
+<td>
+ {$gContent->mInfo.$source[xref].source_title|escape}
+</td>
+<td>
+ &nbsp;
+</td>
+<td>
+ <img class="thumb" src="/storage/attachments/21/21/thumbs/avatar.jpg" alt="" />
+</td>
+<td>
+ {$gContent->mInfo.$source[xref].data|escape}
+</td>
+<td>
+{if $source ne 'history' }
+ {$gContent->mInfo.$source[xref].start_date|bit_short_date}
+{else}
+ {$gContent->mInfo.$source[xref].end_date|bit_short_date}
+{/if}
+</td>
+{if $gBitSystem->isFeatureActive( 'contact_list_last_modified' )}
+ <td>
+ {$gContent->mInfo.xref[xref].last_update_date|bit_long_date}
+ </td>
+{/if}
+<td>
+ <span class="actionicon">
+ {if $gBitUser->hasPermission( 'p_contact_update' ) and $source ne 'history' }
+ {smartlink ititle="Edit" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
+ {/if}
+ {if $gBitUser->hasPermission( 'p_contact_expunge' ) }
+ {if $source eq 'history' }
+ {smartlink ititle="Restore" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id expunge=-1}
+ {else}
+ {smartlink ititle="Delete" ifile="edit_xref.php" booticon="icon-note-delete" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id expunge=1}
+ {/if}
+ {/if}
+ </span>
+</td>
+{/strip}
diff --git a/templates/view_xref_inc_report.tpl b/templates/view_xref_inc_report.tpl
new file mode 100755
index 0000000..329638b
--- /dev/null
+++ b/templates/view_xref_inc_report.tpl
@@ -0,0 +1,62 @@
+{strip}
+<div class="view contact_xref">
+ <div class="header">
+ <h1>{$xrefInfo.template_title|escape}: {$xref_title|escape} for {$title|escape}</h1>
+ </div>
+
+ <div class="body">
+ {legend legend="Contents"}
+ <div class="form-group">
+ {formlabel label="`$xrefInfo.template_title`" for="xkey_ext"}
+ {forminput}
+ {if $xrefInfo.xkey_ext }
+ {$xrefInfo.xkey_ext|escape}
+ {else}
+ Not yet set
+ {/if}
+ {formhelp note="`$xrefInfo.template_title` simple text entry."}
+ {/forminput}
+ <div class="clear"></div>
+ </div>
+
+ <div class="form-group">
+ {formlabel label="`$xrefInfo.template_title` Notes" for="data"}
+ {forminput}
+ {$xrefInfo.data|escape}
+ {formhelp note="Summary from full report."}
+ {/forminput}
+ <div class="clear"></div>
+ </div>
+ {/legend}
+
+ {legend legend="Start and Stop Dates"}
+ <div class="form-group">
+ {formlabel label="Start Date" for=""}
+ {forminput}
+ {if $xrefInfo.ignore_start_date eq "y"}
+ No start date set
+ {else}
+ {$xrefInfo.start_date|bit_long_datetime}
+ {/if}
+ {formhelp note="This `$xrefInfo.template_title` number becomes valid on this date."}
+ {/forminput}
+ <div class="clear"></div>
+ </div>
+
+ <div class="form-group">
+ {formlabel label="End Date" for=""}
+ {forminput}
+ {if $xrefInfo.ignore_end_date eq "y"}
+ No end date set
+ {else}
+ {$xrefInfo.end_date|bit_long_datetime}
+ {/if}
+ {formhelp note="This `$xrefInfo.template_title` number finishes on this date."}
+ {/forminput}
+ <div class="clear"></div>
+ </div>
+ {/legend}
+ <a class="item" href="{$smarty.const.CONTACT_PKG_URL}index.php?content_id={$xrefInfo.content_id}">{tr}Return{/tr}</a>
+ </div><!-- end .body -->
+</div><!-- end .article -->
+{/strip}
diff --git a/templates/view_xref_inc_report_record.tpl b/templates/view_xref_inc_report_record.tpl
new file mode 100755
index 0000000..2c5ee03
--- /dev/null
+++ b/templates/view_xref_inc_report_record.tpl
@@ -0,0 +1,42 @@
+{strip}
+<td>
+ {if $source eq 'history' }
+ {$gContent->mInfo.$source[xref].source_title|escape}
+ {else}
+ &nbsp;
+ {/if}</td>
+<td>
+ {if isset($gContent->mInfo.$source[xref].xref) && $gContent->mInfo.$source[xref].xref <> '' && $gContent->mInfo.$source[xref].xref > 100 }
+ {$gContent->mInfo.$source[xref].xref|escape}
+ {smartlink ititle="Link to" ifile="view_form.php" booticon="icon-note-edit" content_id=$gContent->mInfo.$source[xref].xref}
+ {else}
+ ------
+ {/if}
+</td>
+<td>
+ {$gContent->mInfo.$source[xref].xkey|escape} {$gContent->mInfo.$source[xref].xkey_ext|escape}
+</td>
+<td>
+ {$gContent->mInfo.$source[xref].data|escape}
+</td>
+<td>
+ {$gContent->mInfo.$source[xref].start_date|bit_short_datetime}
+</td>
+<td>
+ Completed: {$gContent->mInfo.$source[xref].last_update_date|bit_short_datetime}
+</td>
+<td>
+ <span class="actionicon">
+ {if $gBitUser->hasPermission( 'p_contact_view_detail' )}
+ {smartlink ititle="View" ifile="view_form.php" booticon="icon-view" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
+ {/if}
+ {if $gBitUser->hasPermission( 'p_contact_expunge' ) }
+ {if $source eq 'history' }
+ {smartlink ititle="Restore" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id expunge=-1}
+ {else}
+ {smartlink ititle="Delete" ifile="edit_xref.php" booticon="icon-note-delete" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id expunge=1}
+ {/if}
+ {/if}
+ </span>
+</td>
+{/strip}
diff --git a/templates/view_xref_key_seal.tpl b/templates/view_xref_key_seal.tpl
index 883e758..883e758 100644..100755
--- a/templates/view_xref_key_seal.tpl
+++ b/templates/view_xref_key_seal.tpl
diff --git a/templates/view_xref_key_seal_record.tpl b/templates/view_xref_key_seal_record.tpl
new file mode 100755
index 0000000..0313047
--- /dev/null
+++ b/templates/view_xref_key_seal_record.tpl
@@ -0,0 +1,39 @@
+{strip}
+<td>
+ {$gContent->mInfo.$source[xref].source_title|escape}
+</td>
+<td>
+ {if isset($gContent->mInfo.$source[xref].xref) && $gContent->mInfo.$source[xref].xref <> '' && $gContent->mInfo.$source[xref].xref > 100 }
+ {$gContent->mInfo.$source[xref].xref|escape}
+ {smartlink ititle="Link to" ifile="display_contact.php" booticon="icon-note-edit" content_id=$gContent->mInfo.$source[xref].xref}
+ {else}
+ &nbsp;
+ {/if}
+</td>
+<td>
+ {$gContent->mInfo.$source[xref].xkey|escape} {$gContent->mInfo.$source[xref].xkey_ext|escape}
+</td>
+<td>
+ {$gContent->mInfo.$source[xref].data|escape}
+</td>
+<td>
+{if $source ne 'history' }
+ {$gContent->mInfo.$source[xref].start_date|bit_short_date}
+{else}
+ {$gContent->mInfo.$source[xref].end_date|bit_short_date}
+{/if}
+</td>
+{if $gBitSystem->isFeatureActive( 'contact_list_last_modified' )}
+ <td>
+ {$gContent->mInfo.xref[xref].last_update_date|bit_long_date}
+ </td>
+{/if}
+<td>
+ <span class="actionicon">
+ {if $gBitUser->hasPermission( 'p_contact_update' ) and $source ne 'history' }
+ {smartlink ititle="Callout" ifile="edit_key_break.php" booticon="icon-redo" expunge=0 content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
+ {smartlink ititle="Reseal" ifile="edit_key_break.php" booticon="icon-undo" expunge=2 content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
+ {/if}
+ </span>
+</td>
+{/strip}
diff --git a/templates/view_xref_locate.tpl b/templates/view_xref_locate.tpl
index 9aaeb05..9aaeb05 100644..100755
--- a/templates/view_xref_locate.tpl
+++ b/templates/view_xref_locate.tpl
diff --git a/templates/view_xref_locate_record.tpl b/templates/view_xref_locate_record.tpl
new file mode 100755
index 0000000..fd9d423
--- /dev/null
+++ b/templates/view_xref_locate_record.tpl
@@ -0,0 +1,40 @@
+{strip}
+<td>
+ {$gContent->mInfo.$source[xref].source_title|escape}
+</td>
+<td>
+ &nbsp;
+</td>
+<td>
+ {$gContent->mInfo.$source[xref].xkey|escape} {$gContent->mInfo.$source[xref].xkey_ext|escape}
+</td>
+<td>
+ {$gContent->mInfo.$source[xref].data|escape}
+</td>
+<td>
+{if $source ne 'history' }
+ {$gContent->mInfo.$source[xref].start_date|bit_short_date}
+{else}
+ {$gContent->mInfo.$source[xref].end_date|bit_short_date}
+{/if}
+</td>
+{if $gBitSystem->isFeatureActive( 'contact_list_last_modified' )}
+ <td>
+ {$gContent->mInfo.xref[xref].last_update_date|bit_long_date}
+ </td>
+{/if}
+<td>
+ <span class="actionicon">
+ {if $gBitUser->hasPermission( 'p_contact_update' ) and $source ne 'history' }
+ {smartlink ititle="Edit" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
+ {/if}
+ {if $gBitUser->hasPermission( 'p_contact_expunge' ) }
+ {if $source eq 'history' }
+ {smartlink ititle="Restore" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id expunge=-1}
+ {else}
+ {smartlink ititle="Delete" ifile="edit_xref.php" booticon="icon-note-delete" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id expunge=1}
+ {/if}
+ {/if}
+ </span>
+</td>
+{/strip}
diff --git a/templates/view_xref_phone.tpl b/templates/view_xref_phone.tpl
index 77b3c03..77b3c03 100644..100755
--- a/templates/view_xref_phone.tpl
+++ b/templates/view_xref_phone.tpl
diff --git a/templates/view_xref_phone_record.tpl b/templates/view_xref_phone_record.tpl
new file mode 100755
index 0000000..11ae3b2
--- /dev/null
+++ b/templates/view_xref_phone_record.tpl
@@ -0,0 +1,40 @@
+{strip}
+<td>
+ {$gContent->mInfo.$source[xref].source_title|escape}
+</td>
+<td>
+&nbsp;
+</td>
+<td>
+ {$gContent->mInfo.$source[xref].xkey|escape}
+</td>
+<td>
+ {$gContent->mInfo.$source[xref].data|escape}
+</td>
+<td>
+{if $source ne 'history' }
+ {$gContent->mInfo.$source[xref].start_date|bit_short_date}
+{else}
+ {$gContent->mInfo.$source[xref].end_date|bit_short_date}
+{/if}
+</td>
+{if $gBitSystem->isFeatureActive( 'contact_list_last_modified' )}
+ <td>
+ {$gContent->mInfo.xref[xref].last_update_date|bit_long_date}
+ </td>
+{/if}
+<td>
+ <span class="actionicon">
+ {if $gBitUser->hasPermission( 'p_contact_update' ) and $source ne 'history' }
+ {smartlink ititle="Edit" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
+ {/if}
+ {if $gBitUser->hasPermission( 'p_contact_expunge' ) }
+ {if $source eq 'history' }
+ {smartlink ititle="Restore" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id expunge=-1}
+ {else}
+ {smartlink ititle="Delete" ifile="edit_xref.php" booticon="icon-note-delete" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id expunge=1}
+ {/if}
+ {/if}
+ </span>
+</td>
+{/strip}
diff --git a/templates/view_xref_sig.tpl b/templates/view_xref_sig.tpl
new file mode 100755
index 0000000..aa15ead
--- /dev/null
+++ b/templates/view_xref_sig.tpl
@@ -0,0 +1,62 @@
+{strip}
+<div class="view contact_xref">
+ <div class="header">
+ <h1>{$xrefInfo.template_title|escape}: {$xref_title|escape} for {$title|escape}</h1>
+ </div>
+
+ <div class="body">
+ {legend legend="Contents"}
+ <div class="form-group">
+ {formlabel label="`$xrefInfo.template_title`" for="xkey_ext"}
+ {forminput}
+ {if $xrefInfo.xkey_ext }
+ {$xrefInfo.xkey_ext|escape}
+ {else}
+ Not yet set
+ {/if}
+ {formhelp note="`$xrefInfo.template_title` simple text entry."}
+ {/forminput}
+ <div class="clear"></div>
+ </div>
+
+ <div class="form-group">
+ {formlabel label="`$xrefInfo.template_title` Notes" for="data"}
+ {forminput}
+ {$xrefInfo.data|escape}
+ {formhelp note="Keep the text attached to reference items short and use comment records to add larger volumns of text. This should be reserved for simple notes such 'as use after 5PM' or the link."}
+ {/forminput}
+ <div class="clear"></div>
+ </div>
+ {/legend}
+
+ {legend legend="Start and Stop Dates"}
+ <div class="form-group">
+ {formlabel label="Start Date" for=""}
+ {forminput}
+ {if $xrefInfo.ignore_start_date eq "y"}
+ No start date set
+ {else}
+ {$xrefInfo.start_date|bit_long_datetime}
+ {/if}
+ {formhelp note="This `$xrefInfo.template_title` number becomes valid on this date."}
+ {/forminput}
+ <div class="clear"></div>
+ </div>
+
+ <div class="form-group">
+ {formlabel label="End Date" for=""}
+ {forminput}
+ {if $xrefInfo.ignore_end_date eq "y"}
+ No end date set
+ {else}
+ {$xrefInfo.end_date|bit_long_datetime}
+ {/if}
+ {formhelp note="This `$xrefInfo.template_title` number finishes on this date."}
+ {/forminput}
+ <div class="clear"></div>
+ </div>
+ {/legend}
+ <a class="item" href="{$smarty.const.CONTACT_PKG_URL}index.php?content_id={$xrefInfo.content_id}">{tr}Return{/tr}</a>
+ </div><!-- end .body -->
+</div><!-- end .article -->
+{/strip}
diff --git a/templates/view_xref_sig_record.tpl b/templates/view_xref_sig_record.tpl
new file mode 100755
index 0000000..fd9d423
--- /dev/null
+++ b/templates/view_xref_sig_record.tpl
@@ -0,0 +1,40 @@
+{strip}
+<td>
+ {$gContent->mInfo.$source[xref].source_title|escape}
+</td>
+<td>
+ &nbsp;
+</td>
+<td>
+ {$gContent->mInfo.$source[xref].xkey|escape} {$gContent->mInfo.$source[xref].xkey_ext|escape}
+</td>
+<td>
+ {$gContent->mInfo.$source[xref].data|escape}
+</td>
+<td>
+{if $source ne 'history' }
+ {$gContent->mInfo.$source[xref].start_date|bit_short_date}
+{else}
+ {$gContent->mInfo.$source[xref].end_date|bit_short_date}
+{/if}
+</td>
+{if $gBitSystem->isFeatureActive( 'contact_list_last_modified' )}
+ <td>
+ {$gContent->mInfo.xref[xref].last_update_date|bit_long_date}
+ </td>
+{/if}
+<td>
+ <span class="actionicon">
+ {if $gBitUser->hasPermission( 'p_contact_update' ) and $source ne 'history' }
+ {smartlink ititle="Edit" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
+ {/if}
+ {if $gBitUser->hasPermission( 'p_contact_expunge' ) }
+ {if $source eq 'history' }
+ {smartlink ititle="Restore" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id expunge=-1}
+ {else}
+ {smartlink ititle="Delete" ifile="edit_xref.php" booticon="icon-note-delete" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id expunge=1}
+ {/if}
+ {/if}
+ </span>
+</td>
+{/strip}
diff --git a/templates/view_xref_text.tpl b/templates/view_xref_text.tpl
index aa15ead..aa15ead 100644..100755
--- a/templates/view_xref_text.tpl
+++ b/templates/view_xref_text.tpl
diff --git a/templates/view_xref_text_record.tpl b/templates/view_xref_text_record.tpl
new file mode 100755
index 0000000..44dda61
--- /dev/null
+++ b/templates/view_xref_text_record.tpl
@@ -0,0 +1,50 @@
+{strip}
+<td>
+ {$gContent->mInfo.$source[xref].source_title|escape}
+</td>
+<td>
+ {if isset($gContent->mInfo.$source[xref].xref) && $gContent->mInfo.$source[xref].xref <> '' && $gContent->mInfo.$source[xref].xref > 100 }
+ {$gContent->mInfo.$source[xref].xref|escape}
+ {smartlink ititle="Link to" ifile="display_contact.php" booticon="icon-note-edit" content_id=$gContent->mInfo.$source[xref].xref}
+ {else}
+ &nbsp;
+ {/if}
+</td>
+<td>
+ {$gContent->mInfo.$source[xref].xkey|escape} {$gContent->mInfo.$source[xref].xkey_ext|escape}
+</td>
+<td>
+ {$gContent->mInfo.$source[xref].data|escape}
+</td>
+<td>
+{if $source ne 'history' }
+ {$gContent->mInfo.$source[xref].start_date|bit_short_date}
+{else}
+ {$gContent->mInfo.$source[xref].end_date|bit_short_date}
+{/if}
+</td>
+{if $gBitSystem->isFeatureActive( 'contact_list_last_modified' )}
+ <td>
+ {$gContent->mInfo.xref[xref].last_update_date|bit_long_date}
+ </td>
+{/if}
+<td>
+ <span class="actionicon">
+ {if $gBitUser->hasPermission( 'p_contact_update' ) and $source ne 'history' }
+ {if $gContent->mInfo.$source[xref].source eq 'KEY_B' }
+ {smartlink ititle="Callout" ifile="edit_key_break.php" booticon="icon-redo" expunge=0 content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
+ {smartlink ititle="Reseal" ifile="edit_key_break.php" booticon="icon-undo" expunge=2 content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
+ {else}
+ {smartlink ititle="Edit" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id}
+ {/if}
+ {/if}
+ {if $gBitUser->hasPermission( 'p_contact_expunge' ) and $gContent->mInfo.$source[xref].source ne 'KEY_B' }
+ {if $source eq 'history' }
+ {smartlink ititle="Restore" ifile="edit_xref.php" booticon="icon-note-edit" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id expunge=-1}
+ {else}
+ {smartlink ititle="Delete" ifile="edit_xref.php" booticon="icon-note-delete" content_id=$gContent->mInfo.content_id xref_id=$gContent->mInfo.$source[xref].xref_id expunge=1}
+ {/if}
+ {/if}
+ </span>
+</td>
+{/strip}
diff --git a/view_xref.php b/view_xref.php
index 264a79b..964cdbd 100644..100755
--- a/view_xref.php
+++ b/view_xref.php
@@ -13,12 +13,12 @@
/**
* required setup
*/
-require_once( '../kernel/setup_inc.php' );
+require_once '../kernel/includes/setup_inc.php';
$gBitSystem->verifyPackage( 'contact' );
$gBitSystem->verifyPermission( 'p_contact_update' );
-include_once( CONTACT_PKG_PATH.'lookup_contact_inc.php' );
+include_once CONTACT_PKG_INCLUDE_PATH . 'lookup_contact_inc.php';
if( !empty( $_REQUEST['xref_id'] ) ) {
$gContent->loadXref( $_REQUEST['xref_id'] );
@@ -46,14 +46,13 @@ if( empty( $xrefInfo ) ) {
$xrefInfo = &$gContent->mInfo['xref_store']['data'];
}
-$gBitSmarty->assignByRef( 'xrefInfo', $xrefInfo );
-$gBitSmarty->assignByRef( 'title', $gContent->mInfo['title'] );
-$gBitSmarty->assignByRef( 'xref_title', $gContent->mInfo['xref_title'] );
+$gBitSmarty->assign( 'xrefInfo', $xrefInfo );
+$gBitSmarty->assign( 'title', $gContent->mInfo['title'] );
+$gBitSmarty->assign( 'xref_title', $gContent->mInfo['xref_title'] );
-$gBitSmarty->assignByRef( 'errors', $gContent->mErrors );
+$gBitSmarty->assign( 'errors', $gContent->mErrors );
if( isset($xrefInfo['template']) ) {
$gBitSystem->display( 'bitpackage:contact/view_xref_'.$xrefInfo['template'].'.tpl', 'View: ' , array( 'display_mode' => 'view' ));
} else {
$gBitSystem->display( 'bitpackage:contact/view_xref.tpl', 'View: ' , array( 'display_mode' => 'view' ));
}
-?>