Fixed the bad case so things will work in postgresql

This commit is contained in:
jengo 2001-02-04 13:35:20 +00:00
parent 46850aae4d
commit b6b7059e89

View File

@ -50,53 +50,53 @@
$this->account_id = $phpgw_info["user"]["account_id"]; $this->account_id = $phpgw_info["user"]["account_id"];
// rework the following to be a simple sed style creation // rework the following to be a simple sed style creation
$this->stock_contact_fields = array("FN" => "FN", //'firstname lastname' $this->stock_contact_fields = array("fn" => "fn", //'firstname lastname'
"SOUND" => "SOUND", "sound" => "sound",
"ORG_Name" => "ORG_Name", //company "org_name" => "org_name", //company
"ORG_Unit" => "ORG_Unit", //division "org_unit" => "org_unit", //division
"TITLE" => "TITLE", "title" => "title",
"N_Given" => "N_Given", //firstname "n_given" => "n_given", //firstname
"N_Family" => "N_Family", //lastname "n_family" => "n_family", //lastname
"N_Middle" => "N_Middle", "n_middle" => "n_middle",
"N_Prefix" => "N_Prefix", "n_prefix" => "n_prefix",
"N_Suffix" => "N_Suffix", "n_suffix" => "n_suffix",
"LABEL" => "LABEL", "label" => "label",
"ADR_Street" => "ADR_Street", "adr_street" => "adr_street",
"ADR_Locality" => "ADR_Locality", //city "adr_locality" => "adr_locality", //city
"ADR_Region" => "ADR_Region", //state "adr_region" => "adr_region", //state
"ADR_PostalCode" => "ADR_PostalCode", //zip "adr_postalcode" => "adr_postalcode", //zip
"ADR_CountryName" => "ADR_CountryName", "adr_countryname" => "adr_countryname",
"ADR_Work" => "ADR_Work", //yn "adr_work" => "adr_work", //yn
"ADR_Home" => "ADR_Home", //yn "adr_home" => "adr_home", //yn
"ADR_Parcel" => "ADR_Parcel", //yn "adr_parcel" => "adr_parcel", //yn
"ADR_Postal" => "ADR_Postal", //yn "adr_postal" => "adr_postal", //yn
"TZ" => "TZ", "tz" => "tz",
"GEO" => "GEO", "geo" => "geo",
"A_TEL" => "A_TEL", "a_tel" => "a_tel",
"A_TEL_Work" => "A_TEL_Work", //yn "a_tel_work" => "a_tel_work", //yn
"A_TEL_Home" => "A_TEL_Home", //yn "a_tel_home" => "a_tel_home", //yn
"A_TEL_Voice" => "A_TEL_Voice", //yn "a_tel_voice" => "a_tel_voice", //yn
"A_TEL_Msg" => "A_TEL_Msg", //yn "a_tel_msg" => "a_tel_msg", //yn
"A_TEL_Fax" => "A_TEL_Fax", //yn "a_tel_fax" => "a_tel_fax", //yn
"A_TEL_Prefer" => "A_TEL_Prefer", //yn "a_tel_prefer" => "a_tel_prefer", //yn
"B_TEL" => "B_TEL", "b_tel" => "b_tel",
"B_TEL_Work" => "B_TEL_Work", //yn "b_tel_work" => "b_tel_work", //yn
"B_TEL_Home" => "B_TEL_Home", //yn "b_tel_home" => "b_tel_home", //yn
"B_TEL_Voice" => "B_TEL_Voice", //yn "b_tel_voice" => "b_tel_voice", //yn
"B_TEL_Msg" => "B_TEL_Msg", //yn "b_tel_msg" => "b_tel_msg", //yn
"B_TEL_Fax" => "B_TEL_Fax", //yn "b_tel_fax" => "b_tel_fax", //yn
"B_TEL_Prefer" => "B_TEL_Prefer", //yn "b_tel_prefer" => "b_tel_prefer", //yn
"C_TEL" => "C_TEL", "c_tel" => "c_tel",
"C_TEL_Work" => "C_TEL_Work", //yn "c_tel_Work" => "c_tel_work", //yn
"C_TEL_Home" => "C_TEL_Home", //yn "c_tel_Home" => "c_tel_home", //yn
"C_TEL_Voice" => "C_TEL_Voice", //yn "c_tel_Voice" => "c_tel_voice", //yn
"C_TEL_Msg" => "C_TEL_Msg", //yn "c_tel_Msg" => "c_tel_msg", //yn
"C_TEL_Fax" => "C_TEL_Fax", //yn "c_tel_Fax" => "c_tel_fax", //yn
"C_TEL_Prefer" => "C_TEL_Prefer", //yn "c_tel_Prefer" => "c_tel_prefer", //yn
"D_EMAIL" => "D_EMAIL", "d_email" => "d_email",
"D_EMAILTYPE" => "D_EMAILTYPE", //'INTERNET','CompuServe',etc... "d_emailtype" => "d_emailtype", //'INTERNET','CompuServe',etc...
"D_EMAIL_Work" => "D_EMAIL_Work", //yn "d_email_work" => "d_email_work", //yn
"D_EMAIL_Home" => "D_EMAIL_Home", //yn "d_email_home" => "d_email_home", //yn
); );
$this->email_types = array("INTERNET" => "INTERNET", $this->email_types = array("INTERNET" => "INTERNET",
@ -207,23 +207,23 @@
if ($order) { if ($order) {
$ordermethod = "order by $order $sort "; $ordermethod = "order by $order $sort ";
} else { } else {
$ordermethod = "order by N_Family,N_Given,D_EMAIL $sort"; $ordermethod = "order by n_family,n_given,d_email $sort";
} }
$this->db3 = $this->db2 = $this->db; // Create new result objects before our queries $this->db3 = $this->db2 = $this->db; // Create new result objects before our queries
if ($query) { if ($query) {
$this->db3->query("SELECT * from addressbook WHERE (N_Family like '" $this->db3->query("SELECT * from addressbook WHERE (n_family like '"
. "%$query%' OR N_Given like '%$query%' OR D_EMAIL like '%$query%' OR " . "%$query%' OR n_given like '%$query%' OR d_email like '%$query%' OR "
. "ADR_Street like '%$query%' OR ADR_Locality like '%$query%' OR ADR_Region " . "adr_street like '%$query%' OR adr_locality like '%$query%' OR adr_region "
. "like '%$query%' OR ADR_PostalCode like '%$query%' OR ORG_Unit like " . "like '%$query%' OR adr_postalcode like '%$query%' OR org_unit like "
. "'%$query%' OR ORG_Name like '%$query%') " . $ordermethod,__LINE__,__FILE__); . "'%$query%' OR org_name like '%$query%') " . $ordermethod,__LINE__,__FILE__);
$this->total_records = $this->db3->num_rows(); $this->total_records = $this->db3->num_rows();
$this->db->query("SELECT * from addressbook WHERE (N_Family like '" $this->db->query("SELECT * from addressbook WHERE (n_family like '"
. "%$query%' OR N_Given like '%$query%' OR D_EMAIL like '%$query%' OR " . "%$query%' OR n_given like '%$query%' OR d_email like '%$query%' OR "
. "ADR_Street like '%$query%' OR ADR_Locality like '%$query%' OR ADR_Region " . "adr_street like '%$query%' OR adr_locality like '%$query%' OR adr_region "
. "like '%$query%' OR ADR_PostalCode like '%$query%' OR ORG_Unit like " . "like '%$query%' OR adr_postalcode like '%$query%' OR org_unit like "
. "'%$query%' OR ORG_Name like '%$query%') " . $ordermethod . " " . "'%$query%' OR ORG_Name like '%$query%') " . $ordermethod . " "
. $this->db->limit($start,$offset),__LINE__,__FILE__); . $this->db->limit($start,$offset),__LINE__,__FILE__);
} else { } else {