Correct field mapping and fix prefs to work with class.

This commit is contained in:
Miles Lott 2001-02-02 06:29:27 +00:00
parent 404f0c79da
commit c682033620
2 changed files with 11 additions and 11 deletions

View File

@ -17,8 +17,6 @@
"enable_nextmatchs_class" => True);
include("../header.inc.php");
//echo "<br>Time track = " . $phpgw_info["apps"]["timetrack"]["enabled"];
$t = new Template($phpgw_info["server"]["app_tpl"]);
$t->set_file(array( "addressbook_header" => "header.tpl",
"column" => "column.tpl",
@ -27,12 +25,12 @@
$this = CreateObject("phpgwapi.contacts");
while ($column = each($this->stock_addressbook_fields)) {
if (isset($phpgw_info["user"]["preferences"]["addressbook"][$column[0]]) &&
$phpgw_info["user"]["preferences"]["addressbook"][$column[0]]) {
while ($column = each($this->stock_contact_fields)) {
if (isset($phpgw_info["user"]["preferences"]["addressbook"][$column[1]]) &&
$phpgw_info["user"]["preferences"]["addressbook"][$column[1]]) {
$cols .= " <td height=\"21\">\n";
$cols .= ' <font size="-1" face="Arial, Helvetica, sans-serif">';
$cols .= $phpgw->nextmatchs->show_sort_order($sort,"ab_" . $column[0],$order,"index.php",lang($column[1]));
$cols .= $phpgw->nextmatchs->show_sort_order($sort, $column[0],$order,"index.php",lang($column[1]));
$cols .= "</font>\n </td>";
$cols .= "\n";
@ -48,7 +46,7 @@
$offset = $phpgw_info["user"]["preferences"]["common"]["maxmatchs"];
$entries = $this->read($start,$offset,$access,$columns_to_display,$query,$filter,$sort,$order);
$entries = $this->read($start,$offset,$columns_to_display,$query,$sort,$order);
$search_filter = $phpgw->nextmatchs->show_tpl("index.php",
$start, $this->total_records,
@ -99,7 +97,7 @@
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
$t->set_var(row_tr_color,$tr_color);
$myid = $entries[$i]["id"];
$myowner = $entries[$i]["owner"];
$myowner = $entries[$i]["uid"];
while ($column = each($columns_to_display)) { // each entry column
$ref=$data="";

View File

@ -18,13 +18,15 @@
include("../header.inc.php");
$this = CreateObject("phpgwapi.contacts");
if ($submit) {
$totalerrors = 0;
if (! count($ab_selected)) {
$errors[$totalerrors++] = lang("You must select at least 1 column to display");
}
if (! $totalerrors) {
while (list($pref[0]) = each($abc)) {
while (list($pref[0]) = each($this->stock_contact_fields)) {
if ($ab_selected["$pref[0]"]) {
$phpgw->preferences->change("addressbook",$pref[0],"addressbook_" . $ab_selected["$pref[0]"]);
} else {
@ -61,7 +63,7 @@
$i = 0; $j = 0;
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
echo '<tr bgcolor="' . $tr_color . '">';
while (list($col, $descr) = each($abc)) {
while (list($col, $descr) = each($this->stock_contact_fields)) {
// echo "<br>test: $col - $i $j - " . count($abc);
$i++; $j++;
@ -77,7 +79,7 @@
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
echo '<tr bgcolor="' . $tr_color . '">';
}
if ($j == count($abc)) {
if ($j == count($this->stock_contact_fields)) {
if ($i == 1) {
echo "<td>&nbsp;</td><td>&nbsp;</td>";
}