- common->phpgw_footer();
+ $t->set_var(lang_sure,lang("Are you sure you want to delete this entry ?"));
+ $t->set_var(no_link,$phpgw->link("view.php","&ab_id=$ab_id&order=$order&sort=$sort&filter=$filter&start=$start&query=$query"));
+ $t->set_var(lang_no,lang("NO"));
+ $t->set_var(yes_link,$phpgw->link("delete.php","ab_id=$ab_id&confirm=true&order=$order&sort=$sort&filter=$filter&start=$start&query=$query"));
+ $t->set_var(lang_yes,lang("YES"));
+ $t->pparse("out","delete");
+
+ $phpgw->common->phpgw_footer();
} else {
- $this->id = $ab_id;
- $this->delete_entry();
+ $this->account_id=$phpgw_info["user"]["account_id"];
+ $this->delete($ab_id);
- @Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"]. "/addressbook/",
- "cd=16&order=$order&sort=$sort&filter=$filter&start=$start&query=$query"));
+ @Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"]. "/addressbook/",
+ "cd=16&order=$order&sort=$sort&filter=$filter&start=$start&query=$query"));
}
?>
diff --git a/addressbook/edit.php b/addressbook/edit.php
index 9631ac09a8..41c78ce287 100755
--- a/addressbook/edit.php
+++ b/addressbook/edit.php
@@ -29,11 +29,11 @@
$phpgw->common->phpgw_exit();
}
- $this = CreateObject("addressbook.addressbook");
+ $this = CreateObject("phpgwapi.contacts");
if (! $submit) {
- $fields = $this->get_entry($ab_id);
- form("","edit.php","Edit",$fields);
+ $fields = $this->read_single_entry($ab_id,$this->stock_addressbook_fields);
+ form("","edit.php","Edit",$fields[0]);
} else {
if ($url == "http://") {
$url = "";
@@ -47,30 +47,28 @@
$access = $phpgw->accounts->array_to_string($access,$n_groups);
}
- $this->id = $ab_id;
- $this->company = $company;
- $this->company_id = $company_id;
- $this->firstname = $firstname;
- $this->lastname = $lastname;
- $this->email = $email;
- $this->title = $title;
- $this->wphone = $wphone;
- $this->hphone = $hphone;
- $this->fax = $fax;
- $this->pager = $pager;
- $this->mphone = $mphone;
- $this->ophone = $ophone;
- $this->street = $street;
- $this->address2 = $address2;
- $this->city = $city;
- $this->state = $state;
- $this->zip = $zip;
- $this->bday = $bday;
- $this->url = $url;
- $this->notes = $notes;
- $this->access = $access;
+ $fields["company"] = $company;
+ $fields["company_id"] = $company_id;
+ $fields["firstname"] = $firstname;
+ $fields["lastname"] = $lastname;
+ $fields["email"] = $email;
+ $fields["title"] = $title;
+ $fields["wphone"] = $wphone;
+ $fields["hphone"] = $hphone;
+ $fields["fax"] = $fax;
+ $fields["pager"] = $pager;
+ $fields["mphone"] = $mphone;
+ $fields["ophone"] = $ophone;
+ $fields["street"] = $street;
+ $fields["address2"] = $address2;
+ $fields["city"] = $city;
+ $fields["state"] = $state;
+ $fields["zip"] = $zip;
+ $fields["bday"] = $bday;
+ $fields["url"] = $url;
+ $fields["notes"] = $notes;
- $this->update_entry();
+ $this->update($ab_id,$phpgw_info["user"]["account_id"],$access,$fields);
Header("Location: " . $phpgw->link("view.php","&ab_id=$ab_id&order=$order&sort=$sort&filter="
. "$filter&start=$start"));
diff --git a/addressbook/inc/functions.inc.php b/addressbook/inc/functions.inc.php
index 3860bd3245..7655f9d525 100755
--- a/addressbook/inc/functions.inc.php
+++ b/addressbook/inc/functions.inc.php
@@ -34,35 +34,34 @@
'url' => 'URL'
);
-
function form($format,$action,$title,$fields) { // used for add/edit
global $phpgw, $phpgw_info;
$t = new Template($phpgw_info["server"]["app_tpl"]);
$t->set_file(array( "form" => "form.tpl"));
- $email = $fields->email;
- $firstname = $fields->firstname;
- $lastname = $fields->lastname;
- $title = $fields->title;
- $hphone = $fields->hphone;
- $wphone = $fields->wphone;
- $fax = $fields->fax;
- $pager = $fields->pager;
- $mphone = $fields->mphone;
- $ophone = $fields->ophone;
- $street = $fields->street;
- $address2 = $fields->address2;
- $city = $fields->city;
- $state = $fields->state;
- $zip = $fields->zip;
- $bday = $fields->bday;
- $notes = $fields->notes;
- $access = $fields->access;
- $ab_company = $fields->company;
- $company_id = $fields->company_id;
- $company_name = $fields->company;
- $url = $fields->url;
+ $email = $fields["email"];
+ $firstname = $fields["firstname"];
+ $lastname = $fields["lastname"];
+ $title = $fields["title"];
+ $hphone = $fields["hphone"];
+ $wphone = $fields["wphone"];
+ $fax = $fields["fax"];
+ $pager = $fields["pager"];
+ $mphone = $fields["mphone"];
+ $ophone = $fields["ophone"];
+ $street = $fields["street"];
+ $address2 = $fields["address2"];
+ $city = $fields["city"];
+ $state = $fields["state"];
+ $zip = $fields["zip"];
+ $bday = $fields["bday"];
+ $notes = $fields["notes"];
+ $access = $fields["access"];
+ $company = $fields["company"];
+ $company_id = $fields["company_id"];
+ $company_name = $fields["company"];
+ $url = $fields["url"];
if ($format != "view") {
$email = "";
@@ -81,9 +80,10 @@
$state = "";
$zip = "";
+/*
if($phpgw_info["apps"]["timetrack"]["enabled"]) {
$company = '";
- } else {
- $company = "";
- }
+ } else { */
+ $company = "";
+/* } */
if (strlen($bday) > 2) {
list( $month, $day, $year ) = split( '/', $bday );
@@ -149,11 +149,13 @@
. $notes . "";
if ($bday == "//")
$bday = "";
+
+/*
if($phpgw_info["apps"]["timetrack"]["enabled"]) {
$company = $company_name;
- } else {
- $company = $ab_company;
- }
+ } else { */
+ $company = $company;
+/* } */
}
if ($action) {
@@ -214,7 +216,7 @@
. ': |