Working on fixing preferences

This commit is contained in:
jengo 2000-10-23 19:16:20 +00:00
parent 88f79433b6
commit 9d9bd233ad
3 changed files with 25 additions and 16 deletions

View File

@ -25,6 +25,9 @@
while ($pref = each($ab_selected)) {
$phpgw->common->preferences_add($phpgw_info["user"]["userid"],$pref[0],"addressbook","addressbook_" . $pref[1]);
}
if ($mainscreen_showbirthdays) {
$phpgw->common->preferences_add($phpgw_info["user"]["userid"],"mainscreen_showbirthdays","addressbook");
}
Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/preferences/index.php"));
}
}
@ -39,7 +42,7 @@
echo "<p><b>" . lang("select addressbook columns to display") . ":" . "</b><hr><p>";
?>
<form method="POST" action="<?php echo $phpgw->link(); ?>">
<table border="0" align="center">
<table border="0" align="center" cellspacing="1" cellpadding="1">
<?php
// I need to create a common function to handle displaying multiable columns
@ -65,8 +68,13 @@
if ($j == count($abc)) {
echo "</tr>";
}
}
}
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
?>
<tr bgcolor="<?php echo $tr_color; ?>">
<td colspan="2"><?php echo lang("show current users on navigation bar"); ?></td>
<td><input type="checkbox" name="mainscreen_showbirthdays" value="True"<?php if ($phpgw_info["user"]["preferences"]["addressbook"]["mainscreen_showbirthdays"]) echo " checked"; ?>></td>
</tr>
<tr>
<td colspan="3" align="center">
<input type="submit" name="submit" value="<?php echo lang("submit"); ?>">

View File

@ -30,6 +30,9 @@
$phpgw->common->phpgw_header();
$phpgw->common->navbar();
$phpgw->common->read_preferences($phpgw_info["user"]["loginid"],"addressbook",True);
$phpgw->common->read_preferences($phpgw_info["user"]["loginid"],"email",True);
$phpgw->common->read_preferences($phpgw_info["user"]["loginid"],"calendar",True);
if ($phpgw_info["user"]["permissions"]["admin"] && $phpgw_info["server"]["checkfornewversion"]) {
$phpgw->network->set_addcrlf(False);
@ -69,7 +72,7 @@
break;
}
if ($phpgw_info["user"]["permissions"]["email"]
if ($phpgw_info["user"]["apps"]["email"]
&& $phpgw_info["user"]["preferences"]["email"]["mainscreen_showmail"]) {
echo "<!-- Mailox info -->\n";
@ -91,7 +94,11 @@
echo "<!-- Mailox info -->\n";
}
if ($phpgw_info["user"]["permissions"]["addressbook"]
if ($phpgw_info["user"]["preferences"]["addressbook"]["mainscreen_showbirthdays"]) {
echo "addressbook pereferences";
}
if ($phpgw_info["user"]["apps"]["addressbook"]
&& $phpgw_info["user"]["preferences"]["addressbook"]["mainscreen_showbirthdays"]) {
echo "<!-- Birthday info -->\n";
$phpgw->db->query("select DISTINCT firstname,lastname from addressbook where "
@ -107,11 +114,11 @@
$phpgw->common->show_date(time(),"d")+1,
$phpgw->common->show_date(time(),"Y")),"n/d" );
$phpgw->db->query("select firstname,lastname from addressbook where "
. "bday like '$tommorow/%' and (owner='"
. $phpgw_info["user"]["userid"] . "' or access='public')");
. "ab_bday like '$tommorow/%' and (ab_owner='"
. $phpgw_info["user"]["userid"] . "' or ab_access='public')");
while ($phpgw->db->next_record()) {
echo "<tr><td>" . lang("Tommorow is x's birthday.", $phpgw->db->f("firstname") . " "
. $phpgw->db->f("lastname")) . "</td></tr>\n";
echo "<tr><td>" . lang("Tommorow is x's birthday.", $phpgw->db->f("ab_firstname") . " "
. $phpgw->db->f("ab_lastname")) . "</td></tr>\n";
}
echo "<!-- Birthday info -->\n";
}
@ -121,7 +128,7 @@
// This is disbaled until I can convert the calendar over
if ($phpgw_info["user"]["permissions"]["calendar"]
if ($phpgw_info["user"]["apps"]["calendar"]
&& $phpgw_info["user"]["preferences"]["calendar"]["mainscreen_showevents"]) {
echo "<!-- Calendar info -->\n";
include($phpgw_info["server"]["server_root"] . "/calendar/inc/functions.inc.php");

View File

@ -151,7 +151,7 @@
<?php
display_option("show current users on navigation bar","admin","show_currentusers",0);
display_option("show new messages on main screen","email","mainscreen_showmail",0);
display_option("show birthday reminders on main screen","addressbook","mainscreen_showbirthdays",0);
// display_option("show birthday reminders on main screen","addressbook","mainscreen_showbirthdays",0);
?>
<tr>
<td><?php echo lang("Default application"); ?></td>
@ -233,12 +233,6 @@
$phpgw->common->preferences_add($phpgw_info["user"]["userid"],"email_sig","email");
}
if ($phpgw_info["user"]["apps"]["addressbook"]) {
if ($mainscreen_showbirthdays) {
$phpgw->common->preferences_add($phpgw_info["user"]["userid"],"mainscreen_showbirthdays","addressbook");
}
}
$phpgw->db->unlock();
Header("Location: " . $phpgw->link("index.php"));