diff --git a/addressbook/import.php b/addressbook/import.php index 4d2dc94c3a..e5382812b0 100644 --- a/addressbook/import.php +++ b/addressbook/import.php @@ -53,7 +53,7 @@ $t->set_var("cancel_url",$phpgw->link("index.php")); $t->set_var("navbar_bg",$phpgw_info["theme"]["navbar_bg"]); $t->set_var("navbar_text",$phpgw_info["theme"]["navbar_text"]); - $t->set_var("import_text",lang("Import from Outlook or LDIF")); + $t->set_var("import_text",lang("Import from Outlook or LDIF - not working")); $t->set_var("action_url",$phpgw->link("import.php")); $t->set_var("tsvfilename",""); $t->set_var("conv",$conv); diff --git a/addressbook/inc/class.contacts_sql.inc.php b/addressbook/inc/class.contacts_sql.inc.php index f32e7d1a08..6a3350ee1b 100644 --- a/addressbook/inc/class.contacts_sql.inc.php +++ b/addressbook/inc/class.contacts_sql.inc.php @@ -158,7 +158,7 @@ // send this the range,query,sort,order // and whatever fields you want to see - function read($start,$offset,$fields=array(),$query="",$filter="",$sort="",$order="") + function read($start,$offset,$fields=array(),$query="",$filter="",$sort="",$order="",$rights="") { global $phpgw,$phpgw_info; $DEBUG = 1; diff --git a/addressbook/inc/functions.inc.php b/addressbook/inc/functions.inc.php index 2570a17231..f594b3c159 100755 --- a/addressbook/inc/functions.inc.php +++ b/addressbook/inc/functions.inc.php @@ -65,37 +65,45 @@ //"access" => "access" ); + // this cleans up the fieldnames for display (so we don't see adr_postalcode, etc..) function display_name($column) { global $abc; while($name = each($abc) ) { - if ($column == $name[0]) { return $name[1]; } + if ($column == $name[0]) { return lang($name[1]); } } } function addressbook_read_entries($start,$offset,$qcols,$query,$qfilter,$sort,$order,$userid="") { - global $this; - $entries = $this->read($start,$offset,$qcols,$query,$qfilter,$sort,$order); + global $this,$rights; + $readrights = $rights & PHPGW_ACL_READ; + $entries = $this->read($start,$offset,$qcols,$query,$qfilter,$sort,$order,$readrights); return $entries; } function addressbook_read_entry($id,$fields,$userid="") { - global $this; - $entry = $this->read_single_entry($id,$fields); - return $entry; + global $this,$rights; + if ($rights & PHPGW_ACL_READ) { + $entry = $this->read_single_entry($id,$fields); + return $entry; + } else { + return "No access"; + } } function addressbook_add_entry($userid,$fields) { - global $this; - $this->add($userid,$fields); + global $this,$rights; + if ($rights & PHPGW_ACL_ADD) { + $this->add($userid,$fields); + } return; } function addressbook_update_entry($id,$userid,$fields) { - global $this; + global $this,$rights; //$rights = $phpgw->acl->get_rights($owner,$phpgw_info["flags"]["currentapp"]); - //if ( ($rights & PHPGW_ACL_EDIT) || ($owner == $phpgw_info["user"]["account_id"]) ) { - - $this->update($id,$userid,$fields); + if ($rights & PHPGW_ACL_EDIT) { + $this->update($id,$userid,$fields); + } return; } diff --git a/addressbook/index.php b/addressbook/index.php index 0319ee0528..7a360a93a7 100755 --- a/addressbook/index.php +++ b/addressbook/index.php @@ -34,7 +34,7 @@ $showcol = display_name($column[0]); $cols .= " \n"; $cols .= ' '; - $cols .= $phpgw->nextmatchs->show_sort_order($sort, $column[0],$order,"index.php",lang($showcol)); + $cols .= $phpgw->nextmatchs->show_sort_order($sort, $column[0],$order,"index.php",$showcol); $cols .= "\n "; $cols .= "\n"; @@ -83,6 +83,7 @@ $t->set_var("lang_view",lang("View")); $t->set_var("lang_vcard",lang("VCard")); $t->set_var("lang_edit",lang("Edit")); + $t->set_var("lang_owner",lang("Owner")); $t->set_var(searchreturn,$noprefs . " " . $searchreturn); $t->set_var(lang_showing,$lang_showing); @@ -143,6 +144,7 @@ . "$filter&query=$query&sort=$sort")); $t->set_var(row_edit_link,$phpgw->common->check_owner($myowner,"edit.php",lang("edit"),"ab_id=" .$myid."&start=".$start."&sort=".$sort."&order=".$order."&query=".$query."&sort=".$sort)); + $t->set_var(row_owner,$phpgw->accounts->id2name($myowner)); $t->parse("rows","row",True); $t->pparse("out","row"); diff --git a/addressbook/parsecard.php b/addressbook/parsecard.php index 6ebdba3031..842cfe9fbc 100644 --- a/addressbook/parsecard.php +++ b/addressbook/parsecard.php @@ -18,8 +18,8 @@ "noheader" => True, "nonavbar" => True); include("../header.inc.php"); - if($access == "group") - $access = $n_groups; + //if($access == "group") + // $access = $n_groups; //echo $access . "
"; parsevcard($filename,$access); diff --git a/addressbook/templates/default/header.tpl b/addressbook/templates/default/header.tpl index df87217575..69270bced9 100644 --- a/addressbook/templates/default/header.tpl +++ b/addressbook/templates/default/header.tpl @@ -23,5 +23,10 @@ {lang_edit} + + + {lang_owner} + + diff --git a/addressbook/templates/default/row.tpl b/addressbook/templates/default/row.tpl index 7659c4d193..104bb89a1b 100644 --- a/addressbook/templates/default/row.tpl +++ b/addressbook/templates/default/row.tpl @@ -10,5 +10,8 @@ {row_edit_link} + + {row_owner} + diff --git a/addressbook/vcardin.php b/addressbook/vcardin.php index 2dff733ff0..c023c25836 100644 --- a/addressbook/vcardin.php +++ b/addressbook/vcardin.php @@ -12,12 +12,18 @@ /* $Id$ */ - - if ($action == "Load Vcard"){ - $phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True, "currentapp" => "addressbook", "enable_addressbook_class" => True); + if ($action == "Load Vcard") { + $phpgw_info["flags"] = array( + "noheader" => True, "nonavbar" => True, + "currentapp" => "addressbook", + "enable_contacts_class" => True + ); include("../header.inc.php"); } else { - $phpgw_info["flags"] = array("currentapp" => "addressbook", "enable_addressbook_class" => True); + $phpgw_info["flags"] = array( + "currentapp" => "addressbook", + "enable_contacts_class" => True + ); include("../header.inc.php"); echo ''; } @@ -66,54 +72,49 @@ echo "
You must select a vcard. (*.vcf)


"; } - ?> -
"> - - - - - - - - - - - - - - - - -
Vcard:
::
- - - -
-
+ $t = new Template($phpgw->common->get_tpl_dir("addressbook")); + $t->set_file(array("vcardin" => "vcardin.tpl")); + + $vcard_header = "

 " . lang("Address book - VCard in") . "


"; + + $t->set_var(vcard_header,$vcard_header); + $t->set_var(action_url,$phpgw->link("vcardin.php")); + $t->set_var(lang_access,lang("Access")); + $t->set_var(lang_groups,lang("Which groups")); + + $access_option = "