From 2effa267484e63b1bb90815bc4d352bb0ed99753 Mon Sep 17 00:00:00 2001 From: Miles Lott Date: Sat, 17 Mar 2001 15:48:01 +0000 Subject: [PATCH] Update readme, add sql files for table creation manually --- addressbook/inc/mysql_addressbook.sql | 80 +++++++++++++ addressbook/inc/pgsql_addressbook.sql | 79 +++++++++++++ addressbook/inc/readme.txt | 160 +++++++++++++++----------- 3 files changed, 252 insertions(+), 67 deletions(-) create mode 100644 addressbook/inc/mysql_addressbook.sql create mode 100644 addressbook/inc/pgsql_addressbook.sql diff --git a/addressbook/inc/mysql_addressbook.sql b/addressbook/inc/mysql_addressbook.sql new file mode 100644 index 0000000000..132979fe86 --- /dev/null +++ b/addressbook/inc/mysql_addressbook.sql @@ -0,0 +1,80 @@ + +#DROP TABLE IF EXISTS phpgw_addressbook; +#DROP TABLE IF EXISTS phpgw_addressbook_extra; + +# +# Table structure for table 'phpgw_addressbook' +# + +CREATE TABLE phpgw_addressbook ( + id int(8) NOT NULL auto_increment, + lid varchar(32), + tid char(1), + owner int(8), + + fn varchar(64), + n_family varchar(64), + n_given varchar(64), + n_middle varchar(64), + n_prefix varchar(64), + n_suffix varchar(64), + sound varchar(64), + bday varchar(32), + note text, + tz varchar(8), + geo varchar(32), + url varchar(128), + pubkey text, + + org_name varchar(64), + org_unit varchar(64), + title varchar(64), + + adr_one_street varchar(64), + adr_one_locality varchar(32), + adr_one_region varchar(32), + adr_one_postalcode varchar(32), + adr_one_countryname varchar(32), + adr_one_type varchar(64), + label text, + + adr_two_street varchar(64), + adr_two_locality varchar(32), + adr_two_region varchar(32), + adr_two_postalcode varchar(32), + adr_two_countryname varchar(32), + adr_two_type varchar(64), + + tel_work varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL, + tel_home varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL, + tel_voice varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL, + tel_fax varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL, + tel_msg varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL, + tel_cell varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL, + tel_pager varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL, + tel_bbs varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL, + tel_modem varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL, + tel_car varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL, + tel_isdn varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL, + tel_video varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL, + tel_prefer varchar(32), + + email varchar(64), + email_type varchar(32) DEFAULT 'INTERNET' NOT NULL, + email_home varchar(64), + email_home_type varchar(32) DEFAULT 'INTERNET' NOT NULL, + PRIMARY KEY (id), + UNIQUE (id) +); + +# +# Table structure for table 'phpgw_addressbook_extra' +# + +CREATE TABLE phpgw_addressbook_extra ( + contact_id int(11), + contact_owner int(11), + contact_name varchar(255), + contact_value text +); + diff --git a/addressbook/inc/pgsql_addressbook.sql b/addressbook/inc/pgsql_addressbook.sql new file mode 100644 index 0000000000..55d092899f --- /dev/null +++ b/addressbook/inc/pgsql_addressbook.sql @@ -0,0 +1,79 @@ + +#DROP TABLE IF EXISTS phpgw_addressbook; +#DROP TABLE IF EXISTS phpgw_addressbook_extra; + +# +# Table structure for table 'phpgw_addressbook' +# + +CREATE TABLE phpgw_addressbook ( + id serial, + lid varchar(32), + tid char(1), + owner int, + + fn varchar(64), + n_family varchar(64), + n_given varchar(64), + n_middle varchar(64), + n_prefix varchar(64), + n_suffix varchar(64), + sound varchar(64), + bday varchar(32), + note text, + tz varchar(8), + geo varchar(32), + url varchar(128), + pubkey text, + + org_name varchar(64), + org_unit varchar(64), + title varchar(64), + + adr_one_street varchar(64), + adr_one_locality varchar(32), + adr_one_region varchar(32), + adr_one_postalcode varchar(32), + adr_one_countryname varchar(32), + adr_one_type varchar(64), + label text, + + adr_two_street varchar(64), + adr_two_locality varchar(32), + adr_two_region varchar(32), + adr_two_postalcode varchar(32), + adr_two_countryname varchar(32), + adr_two_type varchar(64), + + tel_work varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL, + tel_home varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL, + tel_voice varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL, + tel_fax varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL, + tel_msg varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL, + tel_cell varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL, + tel_pager varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL, + tel_bbs varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL, + tel_modem varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL, + tel_car varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL, + tel_isdn varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL, + tel_video varchar(40) DEFAULT '+1 (000) 000-0000' NOT NULL, + tel_prefer varchar(32), + + email varchar(64), + email_type varchar(32) DEFAULT 'INTERNET' NOT NULL, + email_home varchar(64), + email_home_type varchar(32) DEFAULT 'INTERNET' NOT NULL, + PRIMARY KEY (id) +); + +# +# Table structure for table 'phpgw_addressbook_extra' +# + +CREATE TABLE phpgw_addressbook_extra ( + contact_id int, + contact_owner int, + contact_name varchar(255), + contact_value text +); + diff --git a/addressbook/inc/readme.txt b/addressbook/inc/readme.txt index f7f93dc06f..e534f847c1 100644 --- a/addressbook/inc/readme.txt +++ b/addressbook/inc/readme.txt @@ -8,9 +8,9 @@ function read($start,$offset,$fields,$query="",$sort="",$order="") $order = sort on this field, e.g. N_Given returns an array of name/values, e.g.: - $fields[0]["d_email"] => "name@domain.com" + $fields[0]["email"] => "name@domain.com" ... - $fields[1]["d_email"] => "othername@otherdomain.com" + $fields[1]["email"] => "othername@otherdomain.com" ... function read_single_entry($id,$fields) @@ -18,7 +18,7 @@ function read_single_entry($id,$fields) $fields = simple array of fields to return returns a single array of name/value, e.g.: - $fields[0]["d_email"] => "name@domain.com" + $fields[0]["email"] => "name@domain.com" $fields[0]["n_given"] => "Bob" function add($owner,$fields) @@ -33,69 +33,95 @@ function update($id,$owner,$fields) function delete_($id) $id = id of entry you want to delete + $this->stock_contact_fields = array( + "fn" => "fn", // 'prefix given middle family suffix' + "n_given" => "n_given", // firstname + "n_family" => "n_family", // lastname + "n_middle" => "n_middle", + "n_prefix" => "n_prefix", + "n_suffix" => "n_suffix", + "sound" => "sound", + "bday" => "bday", + "note" => "note", + "tz" => "tz", + "geo" => "geo", + "url" => "url", + "pubkey" => "pubkey", - $this->stock_contact_fields = array( - "fn" => "fn", //'firstname lastname' - "sound" => "sound", - "org_name" => "org_name", //company - "org_unit" => "org_unit", //division - "title" => "title", - "n_given" => "n_given", //firstname - "n_family" => "n_family", //lastname - "n_middle" => "n_middle", - "n_prefix" => "n_prefix", - "n_suffix" => "n_suffix", - "label" => "label", - "adr_street" => "adr_street", - "adr_locality" => "adr_locality", //city - "adr_region" => "adr_region", //state - "adr_postalcode" => "adr_postalcode", //zip - "adr_countryname" => "adr_countryname", - "adr_work" => "adr_work", //yn - "adr_home" => "adr_home", //yn - "adr_parcel" => "adr_parcel", //yn - "adr_postal" => "adr_postal", //yn - "tz" => "tz", - "geo" => "geo", - "a_tel" => "a_teL", - "a_tel_work" => "a_tel_work", //yn - "a_tel_home" => "a_tel_home", //yn - "a_tel_voice" => "a_tel_voice", //yn - "a_tel_msg" => "a_tel_msg", //yn - "a_tel_fax" => "a_tel_fax", //yn - "a_tel_prefer" => "a_tel_prefer", //yn - "b_tel" => "b_tel", - "b_tel_work" => "b_tel_work", //yn - "b_tel_home" => "b_tel_home", //yn - "b_tel_voice" => "b_tel_voice", //yn - "b_tel_msg" => "b_tel_msg", //yn - "b_tel_fax" => "b_tel_fax", //yn - "b_tel_prefer" => "b_tel_prefer", //yn - "c_tel" => "c_tel", - "c_tel_work" => "c_tel_work", //yn - "c_tel_home" => "c_tel_home", //yn - "c_tel_voice" => "c_tel_voice", //yn - "c_tel_msg" => "c_tel_msg", //yn - "c_tel_fax" => "c_tel_fax", //yn - "c_tel_prefer" => "c_tel_prefer", //yn - "d_email" => "d_email", - "d_emailtype" => "d_emailtype", //'INTERNET','CompuServe',etc... - "d_email_work" => "d_email_work", //yn - "d_email_home" => "d_email_home", //yn - ); + "org_name" => "org_name", // company + "org_unit" => "org_unit", // division + "title" => "title", + + "adr_one_street" => "adr_one_street", + "adr_one_locality" => "adr_one_locality", + "adr_one_region" => "adr_one_region", + "adr_one_postalcode" => "adr_one_postalcode", + "adr_one_countryname" => "adr_one_countryname", + "adr_one_type" => "adr_one_type", // address is domestic/intl/postal/parcel/work/home + "label" => "label", // address label + + "adr_two_street" => "adr_two_street", + "adr_two_locality" => "adr_two_locality", + "adr_two_region" => "adr_two_region", + "adr_two_postalcode" => "adr_two_postalcode", + "adr_two_countryname" => "adr_two_countryname", + "adr_two_type" => "adr_two_type", // address is domestic/intl/postal/parcel/work/home + + "tel_work" => "tel_work", + "tel_home" => "tel_home", + "tel_voice" => "tel_voice", + "tel_fax" => "tel_fax", + "tel_msg" => "tel_msg", + "tel_cell" => "tel_cell", + "tel_pager" => "tel_pager", + "tel_bbs" => "tel_bbs", + "tel_modem" => "tel_modem", + "tel_car" => "tel_car", + "tel_isdn" => "tel_isdn", + "tel_video" => "tel_video", + "tel_prefer" => "tel_prefer", // home, work, voice, etc + "email" => "email", + "email_type" => "email_type", //'INTERNET','CompuServe',etc... + "email_home" => "email_home", + "email_home_type" => "email_home_type" //'INTERNET','CompuServe',etc... + ); + + $this->adr_types = array( + "dom" => lang("Domestic"), + "intl" => lang("International"), + "parcel" => lang("Parcel"), + "postal" => lang("Postal") + ); + + // Used to set preferred number field + $this->tel_types = array( + "work" => "work", + "home" => "home", + "voice" => "voice", + "fax" => "fax", + "msg" => "msg", + "cell" => "cell", + "pager" => "pager", + "bbs" => "bbs", + "modem" => "modem", + "car" => "car", + "isdn" => "isdn", + "video" => "video" + ); + + $this->email_types = array( + "INTERNET" => "INTERNET", + "CompuServe" => "CompuServe", + "AOL" => "AOL", + "Prodigy" => "Prodigy", + "eWorld" => "eWorld", + "AppleLink" => "AppleLink", + "AppleTalk" => "AppleTalk", + "PowerShare" => "PowerShare", + "IBMMail" => "IBMMail", + "ATTMail" => "ATTMail", + "MCIMail" => "MCIMail", + "X.400" => "X.400", + "TLX" => "TLX" + ); - $this->email_types = array( - "INTERNET" => "INTERNET", - "CompuServe" => "CompuServe", - "AOL" => "AOL", - "Prodigy" => "Prodigy", - "eWorld" => "eWorld", - "AppleLink" => "AppleLink", - "AppleTalk" => "AppleTalk", - "PowerShare" => "PowerShare", - "IBMMail" => "IBMMail", - "ATTMail" => "ATTMail", - "MCIMail" => "MCIMail", - "X.400" => "X.400", - "TLX" => "TLX" - );