Minor adjustments

This commit is contained in:
Miles Lott 2001-02-15 17:21:38 +00:00
parent d5bfd7d34f
commit 8f189d4f36
9 changed files with 87 additions and 68 deletions

View File

@ -53,7 +53,7 @@
$t->set_var("cancel_url",$phpgw->link("index.php")); $t->set_var("cancel_url",$phpgw->link("index.php"));
$t->set_var("navbar_bg",$phpgw_info["theme"]["navbar_bg"]); $t->set_var("navbar_bg",$phpgw_info["theme"]["navbar_bg"]);
$t->set_var("navbar_text",$phpgw_info["theme"]["navbar_text"]); $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("action_url",$phpgw->link("import.php"));
$t->set_var("tsvfilename",""); $t->set_var("tsvfilename","");
$t->set_var("conv",$conv); $t->set_var("conv",$conv);

View File

@ -158,7 +158,7 @@
// send this the range,query,sort,order // send this the range,query,sort,order
// and whatever fields you want to see // 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; global $phpgw,$phpgw_info;
$DEBUG = 1; $DEBUG = 1;

View File

@ -65,37 +65,45 @@
//"access" => "access" //"access" => "access"
); );
// this cleans up the fieldnames for display (so we don't see adr_postalcode, etc..)
function display_name($column) { function display_name($column) {
global $abc; global $abc;
while($name = each($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="") { function addressbook_read_entries($start,$offset,$qcols,$query,$qfilter,$sort,$order,$userid="") {
global $this; global $this,$rights;
$entries = $this->read($start,$offset,$qcols,$query,$qfilter,$sort,$order); $readrights = $rights & PHPGW_ACL_READ;
$entries = $this->read($start,$offset,$qcols,$query,$qfilter,$sort,$order,$readrights);
return $entries; return $entries;
} }
function addressbook_read_entry($id,$fields,$userid="") { function addressbook_read_entry($id,$fields,$userid="") {
global $this; global $this,$rights;
$entry = $this->read_single_entry($id,$fields); if ($rights & PHPGW_ACL_READ) {
return $entry; $entry = $this->read_single_entry($id,$fields);
return $entry;
} else {
return "No access";
}
} }
function addressbook_add_entry($userid,$fields) { function addressbook_add_entry($userid,$fields) {
global $this; global $this,$rights;
$this->add($userid,$fields); if ($rights & PHPGW_ACL_ADD) {
$this->add($userid,$fields);
}
return; return;
} }
function addressbook_update_entry($id,$userid,$fields) { function addressbook_update_entry($id,$userid,$fields) {
global $this; global $this,$rights;
//$rights = $phpgw->acl->get_rights($owner,$phpgw_info["flags"]["currentapp"]); //$rights = $phpgw->acl->get_rights($owner,$phpgw_info["flags"]["currentapp"]);
//if ( ($rights & PHPGW_ACL_EDIT) || ($owner == $phpgw_info["user"]["account_id"]) ) { if ($rights & PHPGW_ACL_EDIT) {
$this->update($id,$userid,$fields);
$this->update($id,$userid,$fields); }
return; return;
} }

View File

@ -34,7 +34,7 @@
$showcol = display_name($column[0]); $showcol = display_name($column[0]);
$cols .= " <td height=\"21\">\n"; $cols .= " <td height=\"21\">\n";
$cols .= ' <font size="-1" face="Arial, Helvetica, sans-serif">'; $cols .= ' <font size="-1" face="Arial, Helvetica, sans-serif">';
$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 .= "</font>\n </td>"; $cols .= "</font>\n </td>";
$cols .= "\n"; $cols .= "\n";
@ -83,6 +83,7 @@
$t->set_var("lang_view",lang("View")); $t->set_var("lang_view",lang("View"));
$t->set_var("lang_vcard",lang("VCard")); $t->set_var("lang_vcard",lang("VCard"));
$t->set_var("lang_edit",lang("Edit")); $t->set_var("lang_edit",lang("Edit"));
$t->set_var("lang_owner",lang("Owner"));
$t->set_var(searchreturn,$noprefs . " " . $searchreturn); $t->set_var(searchreturn,$noprefs . " " . $searchreturn);
$t->set_var(lang_showing,$lang_showing); $t->set_var(lang_showing,$lang_showing);
@ -143,6 +144,7 @@
. "$filter&query=$query&sort=$sort")); . "$filter&query=$query&sort=$sort"));
$t->set_var(row_edit_link,$phpgw->common->check_owner($myowner,"edit.php",lang("edit"),"ab_id=" $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)); .$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->parse("rows","row",True);
$t->pparse("out","row"); $t->pparse("out","row");

View File

@ -18,8 +18,8 @@
"noheader" => True, "nonavbar" => True); "noheader" => True, "nonavbar" => True);
include("../header.inc.php"); include("../header.inc.php");
if($access == "group") //if($access == "group")
$access = $n_groups; // $access = $n_groups;
//echo $access . "<BR>"; //echo $access . "<BR>";
parsevcard($filename,$access); parsevcard($filename,$access);

View File

@ -23,5 +23,10 @@
{lang_edit} {lang_edit}
</font> </font>
</td> </td>
<td width="5%" height="21">
<font face="Arial, Helvetica, sans-serif" size="-1">
{lang_owner}
</font>
</td>
</tr> </tr>
<!-- END addressbook_header --> <!-- END addressbook_header -->

View File

@ -10,5 +10,8 @@
<td valign="top" width="5%"> <td valign="top" width="5%">
<font face="{font}" size="2">{row_edit_link}</font> <font face="{font}" size="2">{row_edit_link}</font>
</td> </td>
<td valign="top" width="5%">
<font face="{font}" size="2">{row_owner}</font>
</td>
</tr> </tr>
<!-- END row --> <!-- END row -->

View File

@ -12,12 +12,18 @@
/* $Id$ */ /* $Id$ */
if ($action == "Load Vcard") {
if ($action == "Load Vcard"){ $phpgw_info["flags"] = array(
$phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True, "currentapp" => "addressbook", "enable_addressbook_class" => True); "noheader" => True, "nonavbar" => True,
"currentapp" => "addressbook",
"enable_contacts_class" => True
);
include("../header.inc.php"); include("../header.inc.php");
} else { } 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"); include("../header.inc.php");
echo '<body bgcolor="' . $phpgw_info["theme"]["bg_color"] . '">'; echo '<body bgcolor="' . $phpgw_info["theme"]["bg_color"] . '">';
} }
@ -66,54 +72,49 @@
echo "<B><CENTER>You must select a vcard. (*.vcf)</B></CENTER><BR><BR>"; echo "<B><CENTER>You must select a vcard. (*.vcf)</B></CENTER><BR><BR>";
} }
?>
<form ENCTYPE="multipart/form-data" method="POST" action="<?php echo $phpgw->link("vcardin.php")?>">
<table border=0>
<tr>
<td>Vcard: <input type="file" name="uploadedfile"></td>
<td><input type="submit" name="action" value="Load Vcard"></td>
</tr>
<tr></tr>
<tr></tr>
<tr></tr>
<tr>
<td><?php echo lang("Access");?>:</td>
<td><?php echo lang("Which groups");?>:</td>
</tr>
<tr>
<td>
<select name="access">
<option value="private"<?php if($access == "private") echo "selected";?>>
<?php echo lang("private"); ?>
</option>
<option value="public"<?php if($access == "public") echo "selected";?>>
<?php echo lang("Global Public"); ?>
</option>
<option value="group"<?php if($access != "private" && $access != "public"
&& $access != "") echo "selected";?>>
<?php echo lang("Group Public"); ?>
</option>
</select>
</td>
<td colspan="3">
<select name=n_groups[] multiple size="5">
<?php
$user_groups = $phpgw->accounts->read_group_names($fields["ab_owner"]);
for ($i=0;$i<count($user_groups);$i++) {
echo "<option value=\"" . $user_groups[$i][0] . "\"";
if (ereg(",".$user_groups[$i][0].",",$access))
echo " selected";
echo ">" . $user_groups[$i][1] . "</option>\n";
}
?>
</select>
</td>
</tr>
</table>
</form>
$t = new Template($phpgw->common->get_tpl_dir("addressbook"));
$t->set_file(array("vcardin" => "vcardin.tpl"));
$vcard_header = "<p>&nbsp;<b>" . lang("Address book - VCard in") . "</b><hr><p>";
$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 = "<option value=\"private\"";
if($access == "private")
$access_option .= "selected";
$access_option .= ">" . lang("private");
$access_option .= "</option>\n";
$access_option .= "<option value=\"public\"\n";
if($access == "public")
$access_option .= "selected";
$access_option .= ">" . lang("Global Public");
$access_option .= "</option>\n";
$access_option .= "<option value=\"group\"";
if($access != "private" && $access != "public" && $access != "")
$access_option .= "selected";
$access_option .= ">" . lang("Group Public");
$access_option .= "</option>\n";
$t->set_var(access_option,$access_option);
//$user_groups = $phpgw->accounts->read_group_names($fields["ab_owner"]);
for ($i=0;$i<count($user_groups);$i++) {
$group_option = "<option value=\"" . $user_groups[$i][0] . "\"";
if (ereg(",".$user_groups[$i][0].",",$access)) {
$group_option .= " selected";
$group_option .= ">" . $user_groups[$i][1];
$group_option .= "</option>\n";
}
}
$t->set_var(group_option,$group_option);
$t->pparse("out","vcardin");
<?php
if ($action != "Load Vcard") if ($action != "Load Vcard")
$phpgw->common->phpgw_footer(); $phpgw->common->phpgw_footer();
?> ?>

View File

@ -58,7 +58,7 @@
$view_header .= '<table border="0" cellspacing="2" cellpadding="2" width="80%" align="center">'; $view_header .= '<table border="0" cellspacing="2" cellpadding="2" width="80%" align="center">';
while ($column = each($columns_to_display)) { // each entry column while ($column = each($columns_to_display)) { // each entry column
$columns_html .= "<tr><td><b>" . lang(display_name($colname[$column[0]])) . "</b>:</td>"; $columns_html .= "<tr><td><b>" . display_name($colname[$column[0]]) . "</b>:</td>";
$ref=$data=""; $ref=$data="";
$coldata = $fields[0][$column[0]]; $coldata = $fields[0][$column[0]];
// Some fields require special formatting. // Some fields require special formatting.