mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-26 09:53:20 +01:00
Minor adjustments
This commit is contained in:
parent
d5bfd7d34f
commit
8f189d4f36
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
$showcol = display_name($column[0]);
|
||||
$cols .= " <td height=\"21\">\n";
|
||||
$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 .= "\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");
|
||||
|
@ -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 . "<BR>";
|
||||
|
||||
parsevcard($filename,$access);
|
||||
|
@ -23,5 +23,10 @@
|
||||
{lang_edit}
|
||||
</font>
|
||||
</td>
|
||||
<td width="5%" height="21">
|
||||
<font face="Arial, Helvetica, sans-serif" size="-1">
|
||||
{lang_owner}
|
||||
</font>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- END addressbook_header -->
|
||||
|
@ -10,5 +10,8 @@
|
||||
<td valign="top" width="5%">
|
||||
<font face="{font}" size="2">{row_edit_link}</font>
|
||||
</td>
|
||||
<td valign="top" width="5%">
|
||||
<font face="{font}" size="2">{row_owner}</font>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- END row -->
|
||||
|
@ -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 '<body bgcolor="' . $phpgw_info["theme"]["bg_color"] . '">';
|
||||
}
|
||||
@ -66,54 +72,49 @@
|
||||
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> <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")
|
||||
$phpgw->common->phpgw_footer();
|
||||
?>
|
||||
|
@ -58,7 +58,7 @@
|
||||
$view_header .= '<table border="0" cellspacing="2" cellpadding="2" width="80%" align="center">';
|
||||
|
||||
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="";
|
||||
$coldata = $fields[0][$column[0]];
|
||||
// Some fields require special formatting.
|
||||
|
Loading…
Reference in New Issue
Block a user