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> <table width=75% border=0 cellspacing=1 cellpadding=3>
<tr bgcolor="<?php echo $phpgw_info["theme"][th_bg]; ?>"> <tr bgcolor="<?php echo $phpgw_info["theme"][th_bg]; ?>">
<td width=29% height="21"> <?php
<font size="-1" face="Arial, Helvetica, sans-serif"> if ( $phpgw_info["user"]["preferences"]["addressbook_view_company"] == "True" ) {
<?php echo $phpgw->nextmatchs->show_sort_order($sort,"lastname",$order,"index.php", echo '<td height="21">';
lang("Last Name")); echo '<font size="-1" face="Arial, Helvetica, sans-serif">';
?> echo $phpgw->nextmatchs->show_sort_order($sort,"company",$order,"index.php",
</font> lang("Company Name"));
</td> echo '</font></td>';
<td width="63%" height="21" bgcolor="<?php echo $phpgw_info["theme"][th_bg]; ?>"> }
<font face="Arial, Helvetica, sans-serif" size="-1"> if ( $phpgw_info["user"]["preferences"]["addressbook_view_lastname"] == "True" ) {
<?php echo $phpgw->nextmatchs->show_sort_order($sort,"firstname",$order,"index.php", echo '<td height="21">';
lang("First Name")); echo '<font size="-1" face="Arial, Helvetica, sans-serif">';
?> echo $phpgw->nextmatchs->show_sort_order($sort,"lastname",$order,"index.php",
</font> lang("Last Name"));
</td> 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"> <td width="3%" height="21">
<font face="Arial, Helvetica, sans-serif" size="-1"> <font face="Arial, Helvetica, sans-serif" size="-1">
<?php echo lang("View"); ?> <?php echo lang("View"); ?>
@ -104,6 +128,7 @@
</tr> </tr>
</form> </form>
<?php <?php
if ($query) { if ($query) {
$phpgw->db->query("SELECT * FROM addressbook WHERE $filtermethod AND (lastname like '" $phpgw->db->query("SELECT * FROM addressbook WHERE $filtermethod AND (lastname like '"
@ -121,32 +146,51 @@
$firstname = $phpgw->db->f("firstname"); $firstname = $phpgw->db->f("firstname");
$lastname = $phpgw->db->f("lastname"); $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"); $con = $phpgw->db->f("con");
/* This for for just showing the company name stored in lastname. */ if($firstname == "") $firstname = "&nbsp;";
if (($lastname) && (! $firstname)) if($lastname == "") $lastname = "&nbsp;";
$t_colspan = " colspan=2"; if($email == "") $email = "&nbsp;";
else { if($company == "") $company = "&nbsp;";
$t_colspan = ""; if($wphone == "") $wphone = "&nbsp;";
if ($firstname == "") $firstname = "&nbsp;";
if ($lastname == "") $lastname = "&nbsp;";
}
?> ?>
<tr bgcolor=<?php echo $tr_color; ?>> <?php
<td valign=top width=29%<?php echo $t_colspan; ?>> echo '<tr bgcolor="#'.$tr_color.'";>';
<font face=Arial, Helvetica, sans-serif size=2> if ( $phpgw_info["user"]["preferences"]["addressbook_view_company"] == 'True' ) {
<?php echo $lastname; ?> echo '<td valign=top>';
</font> echo '<font face=Arial, Helvetica, sans-serif size=2>';
</td> echo $company;
<?php if (! $t_colspan) echo '</font></td>';
echo " };
<td valign=top width=63%> if ( $phpgw_info["user"]["preferences"]["addressbook_view_lastname"] == 'True' ) {
<font face=Arial, Helvetica, sans-serif size=2> echo '<td valign=top>';
$firstname echo '<font face=Arial, Helvetica, sans-serif size=2>';
</font> echo $lastname;
</td>"; 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%> <td valign=top width=3%>
<font face=Arial, Helvetica, sans-serif size=2> <font face=Arial, Helvetica, sans-serif size=2>
<a href="<?php echo $phpgw->link("view.php","con=$con&start=$start&order=$order&filter=" <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,"dateformat","m/d/Y");
$phpgw->common->preferences_add($n_loginid,"timeformat","12"); $phpgw->common->preferences_add($n_loginid,"timeformat","12");
$phpgw->common->preferences_add($n_loginid,"lang","en"); $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. // 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 // Its better then the calendar being all messed up, they will be deleted

View File

@ -24,13 +24,17 @@
$phpgw->common->navbar(); $phpgw->common->navbar();
} }
function display_option($text,$check,$option) { function display_option($text,$check,$option,$indent) {
global $phpgw, $phpgw_info; global $phpgw, $phpgw_info;
if ($phpgw_info["user"]["apps"][$check]) { if ($phpgw_info["user"]["apps"][$check]) {
?> ?>
<tr> <tr>
<td> <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>
<td> <td>
<input type="checkbox" name="<?php echo $option; ?>" value="True"<?php if ($phpgw_info["user"]["preferences"][$option]) echo " checked"; ?>> <input type="checkbox" name="<?php echo $option; ?>" value="True"<?php if ($phpgw_info["user"]["preferences"][$option]) echo " checked"; ?>>
@ -143,9 +147,9 @@
</td> </td>
</tr> </tr>
<?php <?php
display_option("show current users on navigation bar","admin","show_currentusers"); display_option("show current users on navigation bar","admin","show_currentusers",0);
display_option("show new messages on main screen","email","mainscreen_showmail"); display_option("show new messages on main screen","email","mainscreen_showmail",0);
display_option("show birthday reminders on main screen","addressbook","mainscreen_showbirthdays"); display_option("show birthday reminders on main screen","addressbook","mainscreen_showbirthdays",0);
if ($phpgw_info["user"]["apps"]["calendar"]) { if ($phpgw_info["user"]["apps"]["calendar"]) {
?> ?>
@ -226,6 +230,13 @@
</tr> </tr>
<?php <?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"]) { if ($phpgw_info["user"]["apps"]["headlines"]) {
?> ?>
@ -303,6 +314,10 @@
if ($mainscreen_showbirthdays) { if ($mainscreen_showbirthdays) {
$phpgw->common->preferences_add($phpgw_info["user"]["userid"],"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"]) { if ($phpgw_info["user"]["apps"]["calendar"]) {