Altered to handle objects and classes.

This commit is contained in:
Miles Lott 2001-01-21 06:36:59 +00:00
parent 8821d96b7e
commit 0c582297c4

View File

@ -23,6 +23,8 @@
$t = new Template($phpgw_info["server"]["app_tpl"]); $t = new Template($phpgw_info["server"]["app_tpl"]);
$t->set_file(array( "add" => "add.tpl")); $t->set_file(array( "add" => "add.tpl"));
$this = CreateObject("addressbook.addressbook");
if ($AddVcard){ if ($AddVcard){
Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] .
"/addressbook/vcardin.php")); "/addressbook/vcardin.php"));
@ -39,66 +41,38 @@
} else { } else {
$bday = "$bday_month/$bday_day/$bday_year"; $bday = "$bday_month/$bday_day/$bday_year";
} }
if ($access != "private" && $access != "public") { if ($access != "private" && $access != "public") {
$access = $phpgw->accounts->array_to_string($access,$n_groups); $access = $phpgw->accounts->array_to_string($access,$n_groups);
} }
if ($url == "http://") { if ($url == "http://") {
$url = ""; $url = "";
} }
if ($phpgw_info["apps"]["timetrack"]["enabled"]) { $this->id = $ab_id;
$sql = "insert into addressbook (ab_owner,ab_access,ab_firstname,ab_lastname,ab_title,ab_email," $this->company = $company;
. "ab_hphone,ab_wphone,ab_fax,ab_pager,ab_mphone,ab_ophone,ab_street,ab_address2,ab_city," $this->company_id = $company_id;
. "ab_state,ab_zip,ab_bday," $this->firstname = $firstname;
. "ab_notes,ab_company_id,ab_url) values ('" . $phpgw_info["user"]["account_id"] . "','$access','" $this->lastname = $lastname;
. addslashes($firstname). "','" $this->email = $email;
. addslashes($lastname) . "','" $this->title = $title;
. addslashes($title) . "','" $this->wphone = $wphone;
. addslashes($email) . "','" $this->hphone = $hphone;
. addslashes($hphone) . "','" $this->fax = $fax;
. addslashes($wphone) . "','" $this->pager = $pager;
. addslashes($fax) . "','" $this->mphone = $mphone;
. addslashes($pager) . "','" $this->ophone = $ophone;
. addslashes($mphone) . "','" $this->street = $street;
. addslashes($ophone) . "','" $this->address2 = $address2;
. addslashes($street) . "','" $this->city = $city;
. addslashes($address2) . "','" $this->state = $state;
. addslashes($city) . "','" $this->zip = $zip;
. addslashes($state) . "','" $this->bday = $bday;
. addslashes($zip) . "','" $this->url = $url;
. addslashes($bday) . "','" $this->notes = $notes;
. addslashes($notes) . "','" $this->access = $access;
. addslashes($company) . "','"
. addslashes($url) . "')"; $this->add_entry();
} else {
$sql = "insert into addressbook (ab_owner,ab_access,ab_firstname,ab_lastname,ab_title,ab_email,"
. "ab_hphone,ab_wphone,ab_fax,ab_pager,ab_mphone,ab_ophone,ab_street,ab_address2,ab_city,"
. "ab_state,ab_zip,ab_bday,"
. "ab_notes,ab_company,ab_url) values ('" . $phpgw_info["user"]["account_id"] . "','$access','"
. addslashes($firstname). "','"
. addslashes($lastname) . "','"
. addslashes($title) . "','"
. addslashes($email) . "','"
. addslashes($hphone) . "','"
. addslashes($wphone) . "','"
. addslashes($fax) . "','"
. addslashes($pager) . "','"
. addslashes($mphone) . "','"
. addslashes($ophone) . "','"
. addslashes($street) . "','"
. addslashes($address2) . "','"
. addslashes($city) . "','"
. addslashes($state) . "','"
. addslashes($zip) . "','"
. addslashes($bday) . "','"
. addslashes($notes) . "','"
. addslashes($company) . "','"
. addslashes($url) . "')";
}
$phpgw->db->query($sql);
Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/addressbook/", Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/addressbook/",
"cd=14")); "cd=14"));
} }