diff options
| author | "Lester Caine ext:(%22) <lester@lsces.co.uk> | 2010-11-03 09:46:53 +0000 |
|---|---|---|
| committer | "Lester Caine ext:(%22) <lester@lsces.co.uk> | 2010-11-03 09:46:53 +0000 |
| commit | 3261da3afcc151ebc1ddd77b1055d5bde3c70b7f (patch) | |
| tree | a582efa13411b27c7a3a041a38d8afe6d42d26ff /admin | |
| download | contact-3261da3afcc151ebc1ddd77b1055d5bde3c70b7f.tar.gz contact-3261da3afcc151ebc1ddd77b1055d5bde3c70b7f.tar.bz2 contact-3261da3afcc151ebc1ddd77b1055d5bde3c70b7f.zip | |
Import package again after stripping private data which should not have been commited
Diffstat (limited to 'admin')
| -rw-r--r-- | admin/admin_contact_inc.php | 69 | ||||
| -rw-r--r-- | admin/admin_xref_types.php | 31 | ||||
| -rw-r--r-- | admin/index.php | 4 | ||||
| -rw-r--r-- | admin/schema_inc.php | 151 |
4 files changed, 255 insertions, 0 deletions
diff --git a/admin/admin_contact_inc.php b/admin/admin_contact_inc.php new file mode 100644 index 0000000..1fde38e --- /dev/null +++ b/admin/admin_contact_inc.php @@ -0,0 +1,69 @@ +<?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' ); +$mTypes = new ContactType(); +$mTypes->setup(); + +$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 ); + +foreach( $mTypes->mContactType as $key => $type ) { + $option = 'contact_default_'.$key; + $contactChecks[] = $option; + $contactTypeDefaults[$option] = $type; +} +asort($contactTypeDefaults); +$gBitSmarty->assign('contactTypeDefaults', $contactTypeDefaults); + +if (isset($_REQUEST["contactlistfeatures"])) { + + foreach( $formContactListFeatures as $item => $data ) { + simple_set_toggle( $item, CONTACT_PKG_NAME ); + } + + foreach( $contactTypeDefaults as $key => $val ) { + simple_set_toggle_array( 'defaultTypes', $key, CONTACT_PKG_NAME); + } +} + +foreach( $contactTypeDefaults as $key => $val) { + if ($gBitSystem->isFeatureActive($key) ){ + $contactTypesSelected[] = $key; + } +} +$gBitSmarty->assign('contactTypesSelected', $contactTypesSelected); + +?> diff --git a/admin/admin_xref_types.php b/admin/admin_xref_types.php new file mode 100644 index 0000000..bfa0b81 --- /dev/null +++ b/admin/admin_xref_types.php @@ -0,0 +1,31 @@ +<?php +// $Header$ +require_once( '../../kernel/setup_inc.php' ); + +include_once( CONTACT_PKG_PATH.'Contact.php' ); +include_once( CONTACT_PKG_PATH.'lookup_xref_type_inc.php' ); + +// Is package installed and enabled +$gBitSystem->verifyPackage( 'contact' ); +$gBitSystem->verifyPermission( 'p_contact_admin' ); + +if( isset( $_REQUEST["fSubmitAddXrefType"] ) ) { + $gContent->storeXrefType( $_REQUEST ); + if ( !empty( $gContent->mErrors ) ) { + $gBitSmarty->assign_by_ref('errors', $gContent->mErrors ); + } +} elseif( !empty( $_REQUEST['fActivateXrefType'] )&& $gContent ) { + $gContent->activateXrefType(); +} elseif( !empty( $_REQUEST['fDeactivateXrefType'] )&& $gContent ) { + $gContent->deactivateXrefType(); +} elseif( !empty( $_REQUEST['fRemoveXrefType'] )&& $gContent ) { + $gContent->removeXrefType(); +} elseif( !empty( $_REQUEST['fRemoveXrefTypeAll'] )&& $gContent ) { + $gContent->removeXrefType( TRUE ); +} + +$xref_types = ContactXrefType::getXrefTypeList(); +$gBitSmarty->assign( 'xref_types', $xref_types ); + +$gBitSystem->display( 'bitpackage:contact/admin_xref_types.tpl', tra( 'Edit XrefTypes' ) , array( 'display_mode' => 'admin' )); +?> 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..017843a --- /dev/null +++ b/admin/schema_inc.php @@ -0,0 +1,151 @@ +<?php +$tables = array( + +'contact' => " + content_id I8 PRIMARY, + parent_id I8 DEFAULT 0, + address_id I8 DEFAULT 0, + role_id I4, + xkey C(32) +", + +'contact_xref' => " + xref_id I8 PRIMARY, + content_id I8 NOTNULL, + source C(20) PRIMARY, + xorder I2 + xref I8, + xkey C(32), + xkey_ext C(250), + data X, + start_date T, + last_update_date T, + entry_date T, + end_date T + ", + +'contact_xref_source' => " + source C(20) PRIMARY, + cross_ref_title C(64), + xref_type I2, + role_id I4, + cross_ref_href C(256), + data X + ", + +'contact_xref_type' => " + xref_type I2 PRIMARY, + source C(20), + title C(64), + role_id I4, + type_href C(256) + ", + +'contact_address' => " + content_id I8 PRIMARY, + address_id I8, + uprn I8, + postcode C(10), + 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 C(80), + country_id I4, + last_update_date T DEFAULT CURRENT_TIMESTAMP, + cltype I2 +", + +); + +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_parent_id_idx' => array( 'table' => 'contact', 'cols' => 'parent_id', 'opts' => NULL ), + 'contact_address_id_idx' => array( 'table' => 'contact', 'cols' => 'address_id', 'opts' => NULL ), +); +$gBitInstaller->registerSchemaIndexes( CONTACT_PKG_NAME, $indices ); + +// ### Sequences +$sequences = array ( + 'contact_xref_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_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', '3', '/contact/?type=0', NULL)", +"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('$01', 'Business', '0', '3', '/contact/?type=1', NULL)", +"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('$02', 'Manufacturer', '0', '3', '/contact/?type=2', NULL)", +"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('$03', 'Distributor', '0', '3', '/contact/?type=3', NULL)", +"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('$04', 'Supplier', '0', '3', '/contact/?type=4', NULL)", +"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('$05', 'Record Company', '0', '3', '/contact/?type=5', NULL)", +"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('$06', 'Record Artist', '0', '3', '/contact/?type=6', NULL)", +"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('$07', 'Cartographer', '0', '3', '/contact/?type=7', NULL)", +"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('$08', 'PHX Client', '0', '3', '/contact/?type=8', NULL)", +"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('$09', 'LSCES Supplier', '0', '3', '/contact/?type=9', NULL)", +"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('$10', 'Paypal Client', '0', '3', '/contact/?type=10', NULL)", +"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('#C', 'Correspondence Address', '1', '3', '../nlpg/?uprn=', NULL)", +"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('#E', 'eMail Address', '1', '3', '../contact/?contact_id=', NULL)", +"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('#F', 'Fax', '1', '3', '../contact/?contact_id=', NULL)", +"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('#O', 'Owner Address', '1', '3', '../nlpg/?uprn=', NULL)", +"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('#P', 'Telephone', '1', '3', '../contact/?contact_id=', NULL)", +"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('#R', 'Residential Address', '1', '3', '../nlpg/?uprn=', NULL)", +"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('#T', 'Tenant Address', '1', '3', '../nlpg/?uprn=', NULL)", +"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('#W', 'Web Site Url', '1', '3', '../contact/?contact_id=', NULL)", +"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('0', 'Free format information', '1', '3', '../contact/?xref=', NULL)", +"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('CON', 'Contact', '1', '3', '../nlpg/?uprn=', NULL)", +"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('#A', 'Alarm Maintainer', '3', '3', '../nlpg/?uprn=', NULL)", +"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('#K', 'Keyholder', '3', '3', '../nlpg/?uprn=', NULL)", +"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('ALARM', 'Alarm System', '3', '3', '../nlpg/?uprn=', NULL)", +"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('CTAX', 'Council Tax', '4', '3', '../nlpg/?uprn=', NULL)", +"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('ER', 'Electoral Roll', '4', '3', '../nlpg/?uprn=', NULL)", +"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('HBEN', 'Housing Benefit', '4', '3', '../nlpg/?uprn=', NULL)", +"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('NNDR', 'National Non-domestic Rates', '4', '3', '../nlpg/?uprn=', NULL)", +"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('ACC_TO', 'Account Turnover', '5', '3', '../vat/?vat=', NULL)", +"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('SAGEID', 'SAGE Account Reference', '5', '3', '''sage''', NULL)", +"INSERT INTO `".BIT_DB_PREFIX."contact_xref_source` VALUES ('VAT_NO', 'VAT Number', '5', '3', '../vat/?vat=', NULL)", +) ); + + +?> |
