Update readme, add sql files for table creation manually

This commit is contained in:
Miles Lott 2001-03-17 15:48:01 +00:00
parent 4257932b9f
commit 2effa26748
3 changed files with 252 additions and 67 deletions

View File

@ -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
);

View File

@ -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
);

View File

@ -8,9 +8,9 @@ function read($start,$offset,$fields,$query="",$sort="",$order="")
$order = sort on this field, e.g. N_Given $order = sort on this field, e.g. N_Given
returns an array of name/values, e.g.: 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) function read_single_entry($id,$fields)
@ -18,7 +18,7 @@ function read_single_entry($id,$fields)
$fields = simple array of fields to return $fields = simple array of fields to return
returns a single array of name/value, e.g.: 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" $fields[0]["n_given"] => "Bob"
function add($owner,$fields) function add($owner,$fields)
@ -33,69 +33,95 @@ function update($id,$owner,$fields)
function delete_($id) function delete_($id)
$id = id of entry you want to delete $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( "org_name" => "org_name", // company
"fn" => "fn", //'firstname lastname' "org_unit" => "org_unit", // division
"sound" => "sound", "title" => "title",
"org_name" => "org_name", //company
"org_unit" => "org_unit", //division "adr_one_street" => "adr_one_street",
"title" => "title", "adr_one_locality" => "adr_one_locality",
"n_given" => "n_given", //firstname "adr_one_region" => "adr_one_region",
"n_family" => "n_family", //lastname "adr_one_postalcode" => "adr_one_postalcode",
"n_middle" => "n_middle", "adr_one_countryname" => "adr_one_countryname",
"n_prefix" => "n_prefix", "adr_one_type" => "adr_one_type", // address is domestic/intl/postal/parcel/work/home
"n_suffix" => "n_suffix", "label" => "label", // address label
"label" => "label",
"adr_street" => "adr_street", "adr_two_street" => "adr_two_street",
"adr_locality" => "adr_locality", //city "adr_two_locality" => "adr_two_locality",
"adr_region" => "adr_region", //state "adr_two_region" => "adr_two_region",
"adr_postalcode" => "adr_postalcode", //zip "adr_two_postalcode" => "adr_two_postalcode",
"adr_countryname" => "adr_countryname", "adr_two_countryname" => "adr_two_countryname",
"adr_work" => "adr_work", //yn "adr_two_type" => "adr_two_type", // address is domestic/intl/postal/parcel/work/home
"adr_home" => "adr_home", //yn
"adr_parcel" => "adr_parcel", //yn "tel_work" => "tel_work",
"adr_postal" => "adr_postal", //yn "tel_home" => "tel_home",
"tz" => "tz", "tel_voice" => "tel_voice",
"geo" => "geo", "tel_fax" => "tel_fax",
"a_tel" => "a_teL", "tel_msg" => "tel_msg",
"a_tel_work" => "a_tel_work", //yn "tel_cell" => "tel_cell",
"a_tel_home" => "a_tel_home", //yn "tel_pager" => "tel_pager",
"a_tel_voice" => "a_tel_voice", //yn "tel_bbs" => "tel_bbs",
"a_tel_msg" => "a_tel_msg", //yn "tel_modem" => "tel_modem",
"a_tel_fax" => "a_tel_fax", //yn "tel_car" => "tel_car",
"a_tel_prefer" => "a_tel_prefer", //yn "tel_isdn" => "tel_isdn",
"b_tel" => "b_tel", "tel_video" => "tel_video",
"b_tel_work" => "b_tel_work", //yn "tel_prefer" => "tel_prefer", // home, work, voice, etc
"b_tel_home" => "b_tel_home", //yn "email" => "email",
"b_tel_voice" => "b_tel_voice", //yn "email_type" => "email_type", //'INTERNET','CompuServe',etc...
"b_tel_msg" => "b_tel_msg", //yn "email_home" => "email_home",
"b_tel_fax" => "b_tel_fax", //yn "email_home_type" => "email_home_type" //'INTERNET','CompuServe',etc...
"b_tel_prefer" => "b_tel_prefer", //yn );
"c_tel" => "c_tel",
"c_tel_work" => "c_tel_work", //yn $this->adr_types = array(
"c_tel_home" => "c_tel_home", //yn "dom" => lang("Domestic"),
"c_tel_voice" => "c_tel_voice", //yn "intl" => lang("International"),
"c_tel_msg" => "c_tel_msg", //yn "parcel" => lang("Parcel"),
"c_tel_fax" => "c_tel_fax", //yn "postal" => lang("Postal")
"c_tel_prefer" => "c_tel_prefer", //yn );
"d_email" => "d_email",
"d_emailtype" => "d_emailtype", //'INTERNET','CompuServe',etc... // Used to set preferred number field
"d_email_work" => "d_email_work", //yn $this->tel_types = array(
"d_email_home" => "d_email_home", //yn "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"
);