Merged in addressbook patch

This commit is contained in:
jengo 2000-09-12 22:14:33 +00:00
parent d63e8085a6
commit ffd1efa794
3 changed files with 104 additions and 42 deletions

View File

@ -76,21 +76,45 @@
?>
<table width=75% border=0 cellspacing=1 cellpadding=3>
<tr bgcolor="<?php echo $phpgw_info["theme"][th_bg]; ?>">
<td width=29% height="21">
<font size="-1" face="Arial, Helvetica, sans-serif">
<?php echo $phpgw->nextmatchs->show_sort_order($sort,"lastname",$order,"index.php",
lang("Last Name"));
?>
</font>
</td>
<td width="63%" height="21" bgcolor="<?php echo $phpgw_info["theme"][th_bg]; ?>">
<font face="Arial, Helvetica, sans-serif" size="-1">
<?php echo $phpgw->nextmatchs->show_sort_order($sort,"firstname",$order,"index.php",
lang("First Name"));
?>
</font>
</td>
<tr bgcolor="<?php echo $phpgw_info["theme"][th_bg]; ?>">
<?php
if ( $phpgw_info["user"]["preferences"]["addressbook_view_company"] == "True" ) {
echo '<td height="21">';
echo '<font size="-1" face="Arial, Helvetica, sans-serif">';
echo $phpgw->nextmatchs->show_sort_order($sort,"company",$order,"index.php",
lang("Company Name"));
echo '</font></td>';
}
if ( $phpgw_info["user"]["preferences"]["addressbook_view_lastname"] == "True" ) {
echo '<td height="21">';
echo '<font size="-1" face="Arial, Helvetica, sans-serif">';
echo $phpgw->nextmatchs->show_sort_order($sort,"lastname",$order,"index.php",
lang("Last Name"));
echo '</font></td>';
}
if ( $phpgw_info["user"]["preferences"]["addressbook_view_firstname"] == "True" ) {
echo '<td height="21">';
echo '<font size="-1" face="Arial, Helvetica, sans-serif">';
echo $phpgw->nextmatchs->show_sort_order($sort,"firstname",$order,"index.php",
lang("First Name"));
echo '</font></td>';
}
if ( $phpgw_info["user"]["preferences"]["addressbook_view_email"] == "True" ) {
echo '<td height="21">';
echo '<font size="-1" face="Arial, Helvetica, sans-serif">';
echo $phpgw->nextmatchs->show_sort_order($sort,"email",$order,"index.php",
lang("Email"));
echo '</font></td>';
}
if ( $phpgw_info["user"]["preferences"]["addressbook_view_wphone"] == "True" ) {
echo '<td height="21">';
echo '<font size="-1" face="Arial, Helvetica, sans-serif">';
echo $phpgw->nextmatchs->show_sort_order($sort,"wphone",$order,"index.php",
lang("Work Phone"));
echo '</font></td>';
}
?>
<td width="3%" height="21">
<font face="Arial, Helvetica, sans-serif" size="-1">
<?php echo lang("View"); ?>
@ -104,6 +128,7 @@
</tr>
</form>
<?php
if ($query) {
$phpgw->db->query("SELECT * FROM addressbook WHERE $filtermethod AND (lastname like '"
@ -121,32 +146,51 @@
$firstname = $phpgw->db->f("firstname");
$lastname = $phpgw->db->f("lastname");
$email = $phpgw->db->f("email");
$company = $phpgw->db->f("company");
$wphone = $phpgw->db->f("wphone");
$con = $phpgw->db->f("con");
/* This for for just showing the company name stored in lastname. */
if (($lastname) && (! $firstname))
$t_colspan = " colspan=2";
else {
$t_colspan = "";
if ($firstname == "") $firstname = "&nbsp;";
if ($lastname == "") $lastname = "&nbsp;";
}
if($firstname == "") $firstname = "&nbsp;";
if($lastname == "") $lastname = "&nbsp;";
if($email == "") $email = "&nbsp;";
if($company == "") $company = "&nbsp;";
if($wphone == "") $wphone = "&nbsp;";
?>
<tr bgcolor=<?php echo $tr_color; ?>>
<td valign=top width=29%<?php echo $t_colspan; ?>>
<font face=Arial, Helvetica, sans-serif size=2>
<?php echo $lastname; ?>
</font>
</td>
<?php if (! $t_colspan)
echo "
<td valign=top width=63%>
<font face=Arial, Helvetica, sans-serif size=2>
$firstname
</font>
</td>";
?>
<?php
echo '<tr bgcolor="#'.$tr_color.'";>';
if ( $phpgw_info["user"]["preferences"]["addressbook_view_company"] == 'True' ) {
echo '<td valign=top>';
echo '<font face=Arial, Helvetica, sans-serif size=2>';
echo $company;
echo '</font></td>';
};
if ( $phpgw_info["user"]["preferences"]["addressbook_view_lastname"] == 'True' ) {
echo '<td valign=top>';
echo '<font face=Arial, Helvetica, sans-serif size=2>';
echo $lastname;
echo '</font></td>';
};
if ( $phpgw_info["user"]["preferences"]["addressbook_view_firstname"] == 'True' ) {
echo '<td valign=top>';
echo '<font face=Arial, Helvetica, sans-serif size=2>';
echo $firstname;
echo '</font></td>';
};
if ( $phpgw_info["user"]["preferences"]["addressbook_view_email"] == 'True' ) {
echo '<td valign=top>';
echo '<font face=Arial, Helvetica, sans-serif size=2>';
echo $email;
echo '</font></td>';
};
if ( $phpgw_info["user"]["preferences"]["addressbook_view_wphone"] == 'True' ) {
echo '<td valign=top>';
echo '<font face=Arial, Helvetica, sans-serif size=2>';
echo $wphone;
echo '</font></td>';
};
?>
<td valign=top width=3%>
<font face=Arial, Helvetica, sans-serif size=2>
<a href="<?php echo $phpgw->link("view.php","con=$con&start=$start&order=$order&filter="

View File

@ -45,6 +45,9 @@
$phpgw->common->preferences_add($n_loginid,"dateformat","m/d/Y");
$phpgw->common->preferences_add($n_loginid,"timeformat","12");
$phpgw->common->preferences_add($n_loginid,"lang","en");
$phpgw->common->preferences_add($n_loginid,"addressbook_view_company","True");
$phpgw->common->preferences_add($n_loginid,"addressbook_view_lastname","True");
$phpgw->common->preferences_add($n_loginid,"addressbook_view_firstname","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

View File

@ -24,13 +24,17 @@
$phpgw->common->navbar();
}
function display_option($text,$check,$option) {
function display_option($text,$check,$option,$indent) {
global $phpgw, $phpgw_info;
if ($phpgw_info["user"]["apps"][$check]) {
?>
<tr>
<td>
<?php echo lang($text); ?> ?
<?php
for ($i=0; $i < $indent; $i++, print '<blockquote>') {};
echo lang($text);
for ($i=0; $i < $indent; $i++, print '</blockquote>') {};
?>
</td>
<td>
<input type="checkbox" name="<?php echo $option; ?>" value="True"<?php if ($phpgw_info["user"]["preferences"][$option]) echo " checked"; ?>>
@ -143,9 +147,9 @@
</td>
</tr>
<?php
display_option("show current users on navigation bar","admin","show_currentusers");
display_option("show new messages on main screen","email","mainscreen_showmail");
display_option("show birthday reminders on main screen","addressbook","mainscreen_showbirthdays");
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);
if ($phpgw_info["user"]["apps"]["calendar"]) {
?>
@ -226,6 +230,13 @@
</tr>
<?php
}
if ($phpgw_info["user"]["apps"]["addressbook"]) {
echo "<tr><td>Addressbook columns :</td><tr>";
$abc = get_abc(); # AddressBook Columns
while (list($col, $descr) = each($abc)) {
display_option($descr,"addressbook","addressbook_view_".$col,1);
}
}
if ($phpgw_info["user"]["apps"]["headlines"]) {
?>
@ -303,6 +314,10 @@
if ($mainscreen_showbirthdays) {
$phpgw->common->preferences_add($phpgw_info["user"]["userid"],"mainscreen_showbirthdays");
}
$abc = get_abc(); # AddressBook Columns
while (list($col, $descr) = each($abc)) {
$phpgw->common->preferences_add($phpgw_info["user"]["userid"],"addressbook_view_".$col);
}
}
if ($phpgw_info["user"]["apps"]["calendar"]) {