summaryrefslogtreecommitdiff
path: root/admin
diff options
context:
space:
mode:
authorLester Caine <lsces@lsces.co.uk>2010-10-18 13:24:54 +0100
committerLester Caine <lsces@lsces.co.uk>2010-10-18 13:24:54 +0100
commit02ae040e029923d2283fcbb34c10ecc65e98bc4a (patch)
treeac7bf4df915edbd1d4594add40f337c971dc50ef /admin
parent4924349722bf63833f4898a9bc91ccb329f4a2e6 (diff)
downloadcontact-02ae040e029923d2283fcbb34c10ecc65e98bc4a.tar.gz
contact-02ae040e029923d2283fcbb34c10ecc65e98bc4a.tar.bz2
contact-02ae040e029923d2283fcbb34c10ecc65e98bc4a.zip
Major overhaul of contact. Main problem was moving from the older bw formats of working up to the latest standards. Using gContent and pageInfo hashes directly in templates. Other rebuilds have gone on.
This is still work in progress and a full user manual will be added.
Diffstat (limited to 'admin')
-rw-r--r--admin/admin_xref_types.php31
-rw-r--r--admin/schema_inc.php131
2 files changed, 57 insertions, 105 deletions
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/schema_inc.php b/admin/schema_inc.php
index 0e076f7..cba71b1 100644
--- a/admin/schema_inc.php
+++ b/admin/schema_inc.php
@@ -1,112 +1,48 @@
<?php
$tables = array(
-'contact_phx' => "
- contact_id I8 PRIMARY,
- usn I8 NOTNULL,
- parent_id I8,
- organisation C(100),
- last_update_date T DEFAULT CURRENT_TIMESTAMP,
- start_date T DEFAULT CURRENT_TIMESTAMP,
-",
-
-'contact_phx' => "
- contact_id I8 PRIMARY,
- usn I8 NOTNULL,
- parent_id I8,
- uprn I8,
- nlpg I8,
- ctax I8,
- opfl I8,
- cltype I4,
- prefix C(35),
- forename C(128),
- surname C(128),
- suffix C(35),
- organisation C(100),
- last_update_date T DEFAULT CURRENT_TIMESTAMP,
- 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(128),
- prompt C(128),
- start_date T DEFAULT CURRENT_TIMESTAMP,
- payment C(64),
- maintain C(128),
- code C(128),
- full_start_date C(24)
-",
-
-'contact_sage' => "
- contact_id I8 PRIMARY,
- usn C(16) NOTNULL,
- cltype I4,
- prefix C(35),
- forename C(128),
- surname C(128),
- suffix C(35),
- organisation C(100),
- contact_name C(64),
- telephone C(16),
- fax C(32),
- web C(32),
- analysis_1 C(16),
- analysis_2 C(16),
- analysis_3 C(16),
- dept_number C(8),
- vat_reg_number C(16),
- turnover_mtd C(16),
- turnover_ytd C(16),
- turnover_prior C(16),
- credit_limit C(16),
- terms C(32),
- settlement_due_days C(32),
- settlement_disc_rate C(32),
- def_nom_code C(32),
- def_tax_code C(32)
+'contact' => "
+ content_id I8 PRIMARY,
+ parent_id I8 DEFAULT 0,
+ address_id I8 DEFAULT 0,
+ role_id I4,
+ xkey C(32)
",
'contact_xref' => "
- contact_id I8 NOTNULL,
- xref_key C(14),
+ 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,
- source C(20) PRIMARY,
- cross_reference C(22) PRIMARY,
- data X,
- xorder I2
",
-'contact_type' => "
- contact_type_id I4 PRIMARY,
- type_name C(64)
-",
+'contact_xref_type' => "
+ xref_type I2 PRIMARY,
+ source C(20),
+ title C(64),
+ role_id I4,
+ type_href C(256)
+ ",
'contact_xref_source' => "
- source C(6) PRIMARY,
+ source C(20) PRIMARY,
cross_ref_title C(64),
+ xref_type I2,
+ role_id I4,
cross_ref_href C(256),
data X
",
-'contact_type_map' => "
- contact_id I4 PRIMARY,
- contact_type_id I4 PRIMARY,
- type_value I4
-",
-
'contact_address' => "
- contact_id I8 PRIMARY,
+ content_id I8 PRIMARY,
address_id I8,
uprn I8,
postcode C(10),
@@ -119,26 +55,11 @@ $tables = array(
town C(80),
county C(80),
zone_id I4,
+ country C(80),
country_id I4,
last_update_date T DEFAULT CURRENT_TIMESTAMP
",
-'postcode' => "
- postcode C(10),
- add1 C(32),
- add2 C(64),
- add3 C(64),
- add4 C(40),
- 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;