summaryrefslogtreecommitdiff
path: root/admin
diff options
context:
space:
mode:
authorLester Caine <lsces@lsces.co.uk>2010-09-06 23:33:23 +0100
committerLester Caine <lsces@lsces.co.uk>2010-09-06 23:33:23 +0100
commitffa698b970cf21692ec88c87490c1f7a5020c4c5 (patch)
tree34fc8d19d567829ffacde4e8ce55a9c0281a2221 /admin
parent830ed35b6afa7b02cc8f17f225e210c2d76bfc6d (diff)
downloadcontact-ffa698b970cf21692ec88c87490c1f7a5020c4c5.tar.gz
contact-ffa698b970cf21692ec88c87490c1f7a5020c4c5.tar.bz2
contact-ffa698b970cf21692ec88c87490c1f7a5020c4c5.zip
Add code from local development copy
Diffstat (limited to 'admin')
-rw-r--r--admin/admin_contact_inc.php48
-rw-r--r--admin/index.php4
-rw-r--r--admin/schema_inc.php171
3 files changed, 223 insertions, 0 deletions
diff --git a/admin/admin_contact_inc.php b/admin/admin_contact_inc.php
new file mode 100644
index 0000000..d5253bb
--- /dev/null
+++ b/admin/admin_contact_inc.php
@@ -0,0 +1,48 @@
+<?php
+
+// $Header: /cvsroot/bitweaver/_bit_contact/admin/admin_contact_inc.php,v 1.3 2009/10/01 14:16:59 wjames5 Exp $
+
+// 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' );
+
+$formContactListFeatures = array(
+ "contact_list_id" => array(
+ 'label' => 'Contact Number',
+ ),
+ "contact_list_forename" => array(
+ 'label' => 'Forname',
+ ),
+ "contact_list_surname" => array(
+ 'label' => 'Surname',
+ ),
+ "contact_list_home_phone" => array(
+ 'label' => 'Home Phone',
+ ),
+ "contact_list_mobile_phone" => array(
+ 'label' => 'Mobile Phone',
+ ),
+ "contact_list_email" => array(
+ 'label' => 'eMail Address',
+ 'help' => 'Primary contact email address - additional contact details can be found in the full record',
+ ),
+ "contact_list_edit_details" => array(
+ '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(
+ '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.',
+ ),
+);
+$gBitSmarty->assign( 'formContactListFeatures',$formContactListFeatures );
+
+if (isset($_REQUEST["contactlistfeatures"])) {
+
+ foreach( $formContactListFeatures as $item => $data ) {
+ simple_set_toggle( $item, CONTACT_PKG_NAME );
+ }
+}
+
+?>
diff --git a/admin/index.php b/admin/index.php
new file mode 100644
index 0000000..80f6d40
--- /dev/null
+++ b/admin/index.php
@@ -0,0 +1,4 @@
+<?php
+ // This is not a package.
+ header ("location: ../index.php");
+?> \ No newline at end of file
diff --git a/admin/schema_inc.php b/admin/schema_inc.php
new file mode 100644
index 0000000..12f44fa
--- /dev/null
+++ b/admin/schema_inc.php
@@ -0,0 +1,171 @@
+<?php
+$tables = array(
+
+'contact' => "
+ content_id I8 PRIMARY,
+ usn I8 NOTNULL,
+ parent_id I8,
+ uprn I8,
+ nlpg I8,
+ ctax I8,
+ opfl I8,
+ cltype I4,
+ prefix C(35),
+ forename C(35),
+ surname C(35),
+ suffix C(35),
+ organisation C(100),
+ last_update_date T DEFAULT 'NOW',
+ note C(40),
+ memo X,
+ contact1 C(128),
+ contact2 C(128),
+ contact3 C(128),
+ key1 C(128),
+ tel1 C(128),
+ key2 C(128),
+ tel2 C(128),
+ key3 C(128),
+ tel3 C(128),
+ passwd C(64),
+ prompt C(64),
+ start_date T DEFAULT 'NOW',
+ payment C(64),
+ maintain C(128),
+ code C(128)
+",
+
+'contact_xref' => "
+ content_id I8 NOTNULL,
+ xref_key C(14),
+ start_date T,
+ last_update_date T,
+ entry_date T,
+ end_date T,
+ source C(20) PRIMARY,
+ cross_reference C(22) PRIMARY,
+ data X
+ ",
+
+'contact_type' => "
+ contact_type_id I4 PRIMARY,
+ type_name C(64)
+",
+
+'contact_xref_source' => "
+ source C(6) PRIMARY,
+ cross_ref_title C(64),
+ cross_ref_href C(256),
+ data X
+ ",
+
+'contact_type_map' => "
+ content_id I4 PRIMARY,
+ contact_type_id I4 PRIMARY,
+ type_value I4
+",
+
+'contact_address' => "
+ content_id I8 PRIMARY,
+ usn I8,
+ uprn I8,
+ postcode C(10),
+ organisation C(100),
+ sao C(80),
+ pao C(80),
+ number C(80),
+ street C(250),
+ locality C(250),
+ town C(80),
+ county C(80),
+ zone_id I4,
+ country_id I4,
+ last_update_date T DEFAULT CURRENT_TIMESTAMP
+",
+
+'postcode' => "
+ postcode C(10),
+ add1 C(32),
+ add2 C(32),
+ add3 C(32),
+ add4 C(32),
+ town C(20),
+ county C(20),
+ grideast I4,
+ gridnorth I4,
+ w_id C(6),
+ p_id C(7),
+ NHS C(3),
+ PCG C(5)
+",
+
+);
+
+global $gBitInstaller;
+
+foreach( array_keys( $tables ) AS $tableName ) {
+ $gBitInstaller->registerSchemaTable( CONTACT_PKG_NAME, $tableName, $tables[$tableName] );
+}
+
+$gBitInstaller->registerPackageInfo( CONTACT_PKG_NAME, array(
+ 'description' => "Base Contact management package with contact xref and address books",
+ 'license' => '<a href="http://www.gnu.org/licenses/licenses.html#LGPL">LGPL</a>',
+) );
+
+// ### Indexes
+$indices = array (
+ 'contact_contact_id_idx' => array( 'table' => 'contact', 'cols' => 'usn', 'opts' => NULL ),
+);
+$gBitInstaller->registerSchemaIndexes( CONTACT_PKG_NAME, $indices );
+
+// ### Sequences
+$sequences = array (
+ 'contact_id_seq' => array( 'start' => 1 ),
+);
+$gBitInstaller->registerSchemaSequences( CONTACT_PKG_NAME, $sequences );
+
+// ### Defaults
+
+// ### 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)
+) );
+
+// ### 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_type` VALUES (0, 'Personal')",
+"INSERT INTO `".BIT_DB_PREFIX."contact_type` VALUES (1, 'Business')",
+"INSERT INTO `".BIT_DB_PREFIX."contact_type` VALUES (2, 'Manufacturer')",
+"INSERT INTO `".BIT_DB_PREFIX."contact_type` VALUES (3, 'Distributor')",
+"INSERT INTO `".BIT_DB_PREFIX."contact_type` VALUES (4, 'Supplier')",
+"INSERT INTO `".BIT_DB_PREFIX."contact_type` VALUES (5, 'Record Company')",
+"INSERT INTO `".BIT_DB_PREFIX."contact_type` VALUES (6, 'Record Artist')",
+"INSERT INTO `".BIT_DB_PREFIX."contact_type` VALUES (7, 'Cartographer')",
+
+"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source`( `source`, `cross_ref_title`, `cross_ref_href` ) VALUES ('0' , 'Free format information', '../contact/?xref=')",
+"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source`( `source`, `cross_ref_title`, `cross_ref_href` ) VALUES ('#R', 'Residential Address', '../nlpg/?uprn=')",
+"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source`( `source`, `cross_ref_title`, `cross_ref_href` ) VALUES ('#T', 'Tenant Address', '../nlpg/?uprn=')",
+"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source`( `source`, `cross_ref_title`, `cross_ref_href` ) VALUES ('#C', 'Correspondence Address', '../nlpg/?uprn=')",
+"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source`( `source`, `cross_ref_title`, `cross_ref_href` ) VALUES ('#O', 'Owner Address', '../nlpg/?uprn=')",
+"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source`( `source`, `cross_ref_title`, `cross_ref_href` ) VALUES ('#K', 'Keyholder', '../nlpg/?uprn=')",
+"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source`( `source`, `cross_ref_title`, `cross_ref_href` ) VALUES ('HBEN', 'Housing Benefit', '../nlpg/?uprn=')",
+"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source`( `source`, `cross_ref_title`, `cross_ref_href` ) VALUES ('CTAX', 'Council Tax', '../nlpg/?uprn=')",
+"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source`( `source`, `cross_ref_title`, `cross_ref_href` ) VALUES ('NNDR', 'National Non-domestic Rates', '../nlpg/?uprn=')",
+"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source`( `source`, `cross_ref_title`, `cross_ref_href` ) VALUES ('ER', 'Electoral Roll', '../nlpg/?uprn=')",
+) );
+
+
+?>