Begin removing references to access field in prep for acl usage

This commit is contained in:
Miles Lott 2001-02-11 03:23:58 +00:00
parent 6b787678ea
commit 97c08d331e
6 changed files with 35 additions and 37 deletions

View File

@ -85,6 +85,7 @@
}
$acl->add($phpgw_info["flags"]["currentapp"],'u_'.$user_id,$totalacl);
}
$acl->save_repository();
}
$processed = Array();

View File

@ -41,9 +41,7 @@
} else {
$bday = "$bday_month/$bday_day/$bday_year";
}
if ($access != "private" && $access != "public") {
$access = $phpgw->accounts->array_to_string($access,$n_groups);
}
if ($url == "http://") {
$url = "";
}
@ -78,7 +76,6 @@
$fields["bday"] = $bday;
$fields["url"] = $url;
$fields["notes"] = $notes;
$fields["access"] = $access;
$this->add($phpgw_info["user"]["account_id"],$fields);

View File

@ -33,14 +33,15 @@
if (!$submit) {
// merge in extra fields
$extrafields = array ("pager" => "pager",
"mphone" => "mphone",
"ophone" => "ophone",
"access" => "access",
"address2" => "address2",
"bday" => "bday",
"url" => "url",
"notes" => "notes");
$extrafields = array(
"pager" => "pager",
"mphone" => "mphone",
"ophone" => "ophone",
"address2" => "address2",
"bday" => "bday",
"url" => "url",
"notes" => "notes"
);
$qfields = $this->stock_contact_fields + $extrafields;
$fields = $this->read_single_entry($ab_id,$qfields);
form("","edit.php","Edit",$fields[0]);
@ -53,9 +54,6 @@
} else {
$bday = "$bday_month/$bday_day/$bday_year";
}
if ($access != "private" && $access != "public") {
$access = $phpgw->accounts->array_to_string($access,$n_groups);
}
$fields["org_name"] = $company;
$fields["org_unit"] = $department;
@ -87,7 +85,6 @@
$fields["bday"] = $bday;
$fields["url"] = $url;
$fields["notes"] = $notes;
$fields["access"] = $access;
$this->update($ab_id,$phpgw_info["user"]["account_id"],$fields);

View File

@ -61,7 +61,7 @@
"d_email_home" => "", //yn
"bday" => "birthday",
"url" => "URL",
"access" => "access"
//"access" => "access"
);
function display_name($column) {
@ -104,7 +104,7 @@
$company = $fields["org_name"];
$department = $fields["org_unit"];
$url = $fields["url"];
$access = $fields["access"];
//$access = $fields["access"];
if ($format != "view") {
$email = "<input name=\"email\" value=\"$email\">";
@ -239,7 +239,8 @@
$birthday = $phpgw->common->dateformatorder($bday_year,$bday_month,$bday_day)
. '<font face="'.$theme["font"].'" size="-2">(e.g. 1969)</font>';
/*
// This is now handled by acl code, and should go away
if ($format == "Edit") {
if ($access != "private" && $access != "public") {
$access_link .= '<td><font size="-1">'.lang("Group access").':</font></td>'
@ -298,7 +299,7 @@
$access_link = '';
$t->set_var("lang_access",'');
}
*/
if ($format == "view")
$create .= '<tr><td><font size="-1">'.lang("Created by").':</font></td>'
. '<td colspan="3"><font size="-1">'

View File

@ -105,12 +105,14 @@
$t->set_var("cols",$cols);
$t->pparse("out","addressbook_header");
// Show the entries
for ($i=0;$i<count($entries);$i++) { // each entry
if ( ($entries[$i]["access"] == $filter) ||
($entries[$i]["access"] == "," . $filter . ",") ||
($filter == "") || ($filter == "none")) {
$rights = $phpgw->acl->get_rights('u_'.$entries[$i]["owner"],$phpgw_info["flags"]["currentapp"]);
if ( ($rights & PHPGW_ACL_READ) || ($entries[$i]["owner"] == $account_id) ) {
//if ( ($entries[$i]["access"] == $filter) ||
// ($entries[$i]["access"] == "," . $filter . ",") ||
// ($filter == "") || ($filter == "none")) {
$t->set_var(columns,"");
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
$t->set_var(row_tr_color,$tr_color);

View File

@ -22,7 +22,6 @@
include("../header.inc.php");
#$t = new Template($phpgw_info["server"]["app_tpl"]);
$t = new Template($phpgw->common->get_tpl_dir("addressbook"));
$t->set_file(array( "view" => "view.tpl"));
@ -40,19 +39,19 @@
}
}
// merge in extra fields
$extrafields = array ("pager" => "pager",
"mphone" => "mphone",
"ophone" => "ophone",
"address2" => "address2",
"bday" => "bday",
"url" => "url",
"notes" => "notes",
"access" => "access");
$extrafields = array (
"pager" => "pager",
"mphone" => "mphone",
"ophone" => "ophone",
"address2" => "address2",
"bday" => "bday",
"url" => "url",
"notes" => "notes",
);
$qfields = $this->stock_contact_fields + $extrafields;
$fields = $this->read_single_entry($ab_id,$qfields);
$owner = $fields[0]["owner"];
$access = $fields[0]["access"];
$view_header = "<p>&nbsp;<b>" . lang("Address book - view") . "</b><hr><p>";
$view_header .= '<table border="0" cellspacing="2" cellpadding="2" width="80%" align="center">';
@ -79,6 +78,7 @@
$columns_html .= "<td>" . $ref . $data . "</td>";
}
/*
if ($access == "private") {
$access_link .= lang("Record Access") . " - " . $access;
} elseif ($access != "private" && $access != "public") {
@ -86,12 +86,12 @@
} else {
$access_link ="";
}
*/
$columns_html .= '<tr><td colspan="4">&nbsp;</td></tr>'
. '<tr><td><b>' . lang("Record owner") . '</b></td><td>'
. $phpgw->common->grab_owner_name($owner) . '</td><td><b>'
. $phpgw->common->grab_owner_name($owner) . '</td><td><b>'
. $access_link . '</b></td><td></table>';
$editlink = $phpgw->common->check_owner($owner,"edit.php",lang("edit"),"ab_id=" . $ab_id . "&start=".$start."&sort=".$sort."&order=".$order);
$vcardlink = '<form action="'.$phpgw->link("vcardout.php","ab_id=$ab_id&order=$order&start=$start&filter=$filter&query=$query&sort=$sort").'">';
$donelink = '<form action="'.$phpgw->link("index.php","order=$order&start=$start&filter=$filter&query=$query&sort=$sort").'">';