Merged in patch for vcard support

This commit is contained in:
jengo 2000-11-03 20:07:57 +00:00
parent d1ac48253e
commit 9d323346b3
6 changed files with 45 additions and 43 deletions

View File

@ -12,15 +12,20 @@
/* $Id$ */
if ($submit) {
if ($submit || $AddVcard) {
$phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True);
}
$phpgw_info["flags"]["currentapp"] = "addressbook";
include("../header.inc.php");
if ($add_email) {
list($fields["lastname"],$fields["firstname"]) = explode(" ", $name);
if ($AddVcard){
Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] .
"/addressbook/vcardin.php"));
}
else if ($add_email) {
list($fields["firstname"],$fields["lastname"]) = explode(" ", $name);
$fields["email"] = $add_email;
form("","add.php","Add",$fields);
} else if (! $submit && ! $add_email) {

View File

@ -99,7 +99,7 @@
<table width=75% border=0 cellspacing=1 cellpadding=3>
<tr bgcolor="<?php echo $phpgw_info["theme"]["th_bg"]; ?>">
<?php
<?php
while ($column = each($abc)) {
if ($phpgw_info["user"]["preferences"]["addressbook"][$column[0]]) {
echo '<td height="21">';

View File

@ -23,8 +23,7 @@
Header("Location: " . $phpgw->link("index.php"));
}
if ($filter != "private")
{
if ($filter != "private") {
$filtermethod = " or ab_access='public' " . $phpgw->accounts->sql_search("ab_access");
}
@ -78,12 +77,12 @@
if ($access != "private" && $access != "public") {
echo lang("Group access") . " - " . $phpgw->accounts->convert_string_to_names_access($access);
} else {
echo $access;
}
echo "</td></tr></table>";
?>
<TABLE border="0" cellpadding="1" cellspacing="1">
<TR>
<TD align="left">
@ -91,6 +90,9 @@
echo $phpgw->common->check_owner($owner,"edit.php","Edit","ab_id=$ab_id");
?>
</TD>
<TD align=left>
<a href="<?php echo $phpgw->link("vcardout.php","ab_id=$ab_id&order=$order&start=$start&filter=$filter&query=$query&sort=$sort");?>">Vcard</a>
</TD>
<TD align="left">
<a href="<?php echo $phpgw->link("index.php","order=$order&start=$start&filter=$filter&query=$query&sort=$sort"); ?>">Done</a>
</TD>

View File

@ -161,25 +161,9 @@
@ldap_close($ldap);
add_default_preferences($account_info["account_id"]);
$phpgw->db->lock(array("accounts","preferences"));
$phpgw->common->preferences_add($account_info["loginid"],"maxmatchs","common","15");
$phpgw->common->preferences_add($account_info["loginid"],"theme","common","default");
$phpgw->common->preferences_add($account_info["loginid"],"tz_offset","common","0");
$phpgw->common->preferences_add($account_info["loginid"],"dateformat","common","m/d/Y");
$phpgw->common->preferences_add($account_info["loginid"],"timeformat","common","12");
$phpgw->common->preferences_add($account_info["loginid"],"lang","common","en");
$phpgw->common->preferences_add($account_info["loginid"],"company","addressbook","True");
$phpgw->common->preferences_add($account_info["loginid"],"lastname","addressbook","True");
$phpgw->common->preferences_add($account_info["loginid"],"firstname","addressbook","True");
// Even if they don't have access to the calendar, we will add these.
// Its better then the calendar being all messed up, they will be deleted
// the next time the update there preferences.
$phpgw->common->preferences_add($account_info["loginid"],"weekstarts","calendar","Monday");
$phpgw->common->preferences_add($account_info["loginid"],"workdaystarts","calendar","9");
$phpgw->common->preferences_add($account_info["loginid"],"workdayends","calendar","17");
while ($permission = each($account_info["permissions"])) {
if ($phpgw_info["apps"][$permission[0]]["enabled"]) {
$phpgw->accounts->add_app($permission[0]);

View File

@ -72,23 +72,6 @@
$phpgw->db->lock(array("accounts","preferences"));
$phpgw->common->preferences_add($account_info["loginid"],"maxmatchs","common","15");
$phpgw->common->preferences_add($account_info["loginid"],"theme","common","default");
$phpgw->common->preferences_add($account_info["loginid"],"tz_offset","common","0");
$phpgw->common->preferences_add($account_info["loginid"],"dateformat","common","m/d/Y");
$phpgw->common->preferences_add($account_info["loginid"],"timeformat","common","12");
$phpgw->common->preferences_add($account_info["loginid"],"lang","common","en");
$phpgw->common->preferences_add($account_info["loginid"],"company","addressbook","True");
$phpgw->common->preferences_add($account_info["loginid"],"lastname","addressbook","True");
$phpgw->common->preferences_add($account_info["loginid"],"firstname","addressbook","True");
// Even if they don't have access to the calendar, we will add these.
// Its better then the calendar being all messed up, they will be deleted
// the next time the update there preferences.
$phpgw->common->preferences_add($account_info["loginid"],"weekstarts","calendar","Monday");
$phpgw->common->preferences_add($account_info["loginid"],"workdaystarts","calendar","9");
$phpgw->common->preferences_add($account_info["loginid"],"workdayends","calendar","17");
while ($permission = each($account_info["permissions"])) {
if ($phpgw_info["apps"][$permission[0]]["enabled"]) {
$phpgw->accounts->add_app($permission[0]);
@ -102,6 +85,12 @@
. "','" . $phpgw->accounts->add_app("",True) . "','" . $account_info["groups"] . "','A',0)";
$phpgw->db->query($sql);
$phpgw->db->query("select account_id from accounts where account_lid='"
. $account_info["loginid"] . "'");
$phpgw->db->next_record();
add_default_preferences($phpgw->db->f("account_id"));
$phpgw->db->unlock();
$sep = $phpgw->common->filesystem_separator();
@ -206,7 +195,7 @@
$phpgw->db->query("delete from addressbook where ab_owner='$account_id'");
$phpgw->db->query("delete from accounts where account_lid='$account_id'");
$phpgw->common->preferences_delete("all",$lid);
$phpgw->common->preferences_delete("all",$account_id);
$phpgw->db->unlock();

View File

@ -19,6 +19,28 @@
include($phpgw_info["server"]["server_root"] . "/admin/inc/accounts_"
. $phpgw_info["server"]["auth_type"] . ".inc.php");
function add_default_preferences($account_id)
{
global $phpgw;
$phpgw->common->preferences_add($account_id,"maxmatchs","common","15");
$phpgw->common->preferences_add($account_id,"theme","common","default");
$phpgw->common->preferences_add($account_id,"tz_offset","common","0");
$phpgw->common->preferences_add($account_id,"dateformat","common","m/d/Y");
$phpgw->common->preferences_add($account_id,"timeformat","common","12");
$phpgw->common->preferences_add($account_id,"lang","common","en");
$phpgw->common->preferences_add($account_id,"company","addressbook","True");
$phpgw->common->preferences_add($account_id,"lastname","addressbook","True");
$phpgw->common->preferences_add($account_id,"firstname","addressbook","True");
// Even if they don't have access to the calendar, we will add these.
// Its better then the calendar being all messed up, they will be deleted
// the next time the update there preferences.
$phpgw->common->preferences_add($account_id,"weekstarts","calendar","Monday");
$phpgw->common->preferences_add($account_id,"workdaystarts","calendar","9");
$phpgw->common->preferences_add($account_id,"workdayends","calendar","17");
}
if ($submit) {
$totalerrors = 0;