2000-10-12 16:34:25 +02:00
|
|
|
<?php
|
|
|
|
/**************************************************************************\
|
|
|
|
* phpGroupWare - Address Book *
|
|
|
|
* http://www.phpgroupware.org *
|
|
|
|
* -------------------------------------------- *
|
|
|
|
* This program is free software; you can redistribute it and/or modify it *
|
|
|
|
* under the terms of the GNU General Public License as published by the *
|
|
|
|
* Free Software Foundation; either version 2 of the License, or (at your *
|
|
|
|
* option) any later version. *
|
|
|
|
\**************************************************************************/
|
|
|
|
|
|
|
|
/* $Id$ */
|
2000-11-16 23:03:49 +01:00
|
|
|
$phpgw_info["flags"] = array("noheader" => True,
|
|
|
|
"nonavbar" => True,
|
|
|
|
"currentapp" => "addressbook",
|
|
|
|
"enable_addressbook_class" => True,
|
|
|
|
"enable_nextmatchs_class" => True);
|
|
|
|
|
2000-10-12 16:34:25 +02:00
|
|
|
include("../header.inc.php");
|
|
|
|
|
2001-02-02 07:29:27 +01:00
|
|
|
$this = CreateObject("phpgwapi.contacts");
|
|
|
|
|
2000-10-12 16:34:25 +02:00
|
|
|
if ($submit) {
|
|
|
|
$totalerrors = 0;
|
|
|
|
if (! count($ab_selected)) {
|
|
|
|
$errors[$totalerrors++] = lang("You must select at least 1 column to display");
|
|
|
|
}
|
|
|
|
if (! $totalerrors) {
|
2001-02-07 14:47:52 +01:00
|
|
|
$phpgw->preferences->read_repository();
|
2001-02-02 07:29:27 +01:00
|
|
|
while (list($pref[0]) = each($this->stock_contact_fields)) {
|
2000-12-31 23:58:41 +01:00
|
|
|
if ($ab_selected["$pref[0]"]) {
|
2001-02-07 14:47:52 +01:00
|
|
|
$phpgw->preferences->change("addressbook",$pref[0],"addressbook_" . $ab_selected["$pref[0]"]);
|
2000-12-31 23:58:41 +01:00
|
|
|
} else {
|
|
|
|
$phpgw->preferences->delete("addressbook",$pref[0],"addressbook_" . $ab_selected["$pref[0]"]);
|
|
|
|
}
|
2000-10-12 16:34:25 +02:00
|
|
|
}
|
2000-12-31 23:58:41 +01:00
|
|
|
|
2000-10-23 21:16:20 +02:00
|
|
|
if ($mainscreen_showbirthdays) {
|
2001-02-07 14:47:52 +01:00
|
|
|
$phpgw->preferences->delete("addressbook","mainscreen_showbirthdays");
|
2001-02-03 19:49:01 +01:00
|
|
|
$phpgw->preferences->add("addressbook","mainscreen_showbirthdays");
|
2000-12-13 16:19:03 +01:00
|
|
|
} else {
|
|
|
|
$phpgw->preferences->delete("addressbook","mainscreen_showbirthdays");
|
2000-10-23 21:16:20 +02:00
|
|
|
}
|
2000-12-13 16:19:03 +01:00
|
|
|
|
2001-02-07 16:27:19 +01:00
|
|
|
$phpgw->preferences->save_repository(True);
|
2000-10-12 16:34:25 +02:00
|
|
|
Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/preferences/index.php"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$phpgw->common->phpgw_header();
|
2001-01-06 16:26:47 +01:00
|
|
|
echo parse_navbar();
|
2000-10-12 16:34:25 +02:00
|
|
|
|
|
|
|
if ($totalerrors) {
|
|
|
|
echo "<p><center>" . $phpgw->common->error_list($errors) . "</center>";
|
|
|
|
}
|
|
|
|
|
2000-10-23 22:56:29 +02:00
|
|
|
echo "<p><b>" . lang("Addressbook preferences") . ":" . "</b><hr><p>";
|
2000-10-12 16:34:25 +02:00
|
|
|
?>
|
|
|
|
<form method="POST" action="<?php echo $phpgw->link(); ?>">
|
2000-10-23 21:16:20 +02:00
|
|
|
<table border="0" align="center" cellspacing="1" cellpadding="1">
|
2000-10-12 16:34:25 +02:00
|
|
|
<?php
|
|
|
|
// I need to create a common function to handle displaying multiable columns
|
|
|
|
|
2001-02-04 04:54:42 +01:00
|
|
|
echo "<tr bgcolor=\"" . $phpgw_info["theme"]["th_bg"] . "\"><td colspan=\"3\"> </td></tr>\n";
|
2000-10-12 16:34:25 +02:00
|
|
|
$i = 0; $j = 0;
|
|
|
|
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
|
2001-02-04 04:54:42 +01:00
|
|
|
echo "<tr bgcolor=\"" . $tr_color . "\">\n";
|
2001-02-02 07:29:27 +01:00
|
|
|
while (list($col, $descr) = each($this->stock_contact_fields)) {
|
2000-11-01 11:26:14 +01:00
|
|
|
// echo "<br>test: $col - $i $j - " . count($abc);
|
2000-10-12 16:34:25 +02:00
|
|
|
$i++; $j++;
|
2001-02-04 04:54:42 +01:00
|
|
|
$showcol = display_name($descr);
|
|
|
|
if ($showcol) {
|
|
|
|
echo "\t<td><input type=\"checkbox\" name=\"ab_selected[" . $col . "]\" value=\"True\""
|
|
|
|
. ($phpgw_info["user"]["preferences"]["addressbook"][$col]?" checked":"") . '>' . lang($showcol)
|
|
|
|
. "</option></td>\n";
|
|
|
|
} else {
|
|
|
|
$i--;
|
|
|
|
next;
|
|
|
|
}
|
2000-11-01 11:26:14 +01:00
|
|
|
if ($i == 3) {
|
2001-02-04 04:54:42 +01:00
|
|
|
echo "</tr>\n";
|
2000-10-12 16:34:25 +02:00
|
|
|
$i = 0;
|
|
|
|
}
|
2001-02-04 04:54:42 +01:00
|
|
|
if ($i == 0 && $showcol) {
|
2000-10-12 16:34:25 +02:00
|
|
|
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
|
2001-02-04 04:54:42 +01:00
|
|
|
echo "<tr bgcolor=\"" . $tr_color . "\">\n";
|
2000-10-12 16:34:25 +02:00
|
|
|
}
|
2001-02-02 07:29:27 +01:00
|
|
|
if ($j == count($this->stock_contact_fields)) {
|
2000-11-01 11:26:14 +01:00
|
|
|
if ($i == 1) {
|
2001-02-04 04:54:42 +01:00
|
|
|
echo "\t<td> </td><td> </td>\n";
|
2000-11-01 11:26:14 +01:00
|
|
|
}
|
|
|
|
if ($i == 2) {
|
2001-02-04 04:54:42 +01:00
|
|
|
echo "\t<td> </td>\n";
|
2000-11-01 11:26:14 +01:00
|
|
|
}
|
2001-02-04 04:54:42 +01:00
|
|
|
echo "</tr>\n";
|
2000-10-12 16:34:25 +02:00
|
|
|
}
|
2000-10-23 21:16:20 +02:00
|
|
|
}
|
|
|
|
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
|
2000-10-12 16:34:25 +02:00
|
|
|
?>
|
2000-10-23 21:16:20 +02:00
|
|
|
<tr bgcolor="<?php echo $tr_color; ?>">
|
2000-10-25 23:09:00 +02:00
|
|
|
<td colspan="2"><?php echo lang("show birthday reminders on main screen"); ?></td>
|
2000-10-23 21:16:20 +02:00
|
|
|
<td><input type="checkbox" name="mainscreen_showbirthdays" value="True"<?php if ($phpgw_info["user"]["preferences"]["addressbook"]["mainscreen_showbirthdays"]) echo " checked"; ?>></td>
|
|
|
|
</tr>
|
2000-10-12 16:34:25 +02:00
|
|
|
<tr>
|
|
|
|
<td colspan="3" align="center">
|
|
|
|
<input type="submit" name="submit" value="<?php echo lang("submit"); ?>">
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</form>
|
|
|
|
<?php
|
2001-01-07 18:14:36 +01:00
|
|
|
$phpgw->common->phpgw_footer();
|
2000-11-16 23:03:49 +01:00
|
|
|
?>
|