2000-08-18 05:24:22 +02:00
|
|
|
<?php
|
|
|
|
/**************************************************************************\
|
|
|
|
* phpGroupWare - addressbook *
|
|
|
|
* http://www.phpgroupware.org *
|
|
|
|
* Written by Joseph Engo <jengo@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 09:10:43 +01:00
|
|
|
$phpgw_info["flags"] = array("currentapp" => "addressbook", "enable_addressbook_class" => True,
|
|
|
|
"enable_nextmatchs_class" => True);
|
2000-08-18 05:24:22 +02:00
|
|
|
include("../header.inc.php");
|
|
|
|
|
2000-10-04 19:49:36 +02:00
|
|
|
//echo "<br>Time track = " . $phpgw_info["apps"]["timetrack"]["enabled"];
|
2000-08-18 05:24:22 +02:00
|
|
|
|
|
|
|
if (! $start)
|
|
|
|
$start = 0;
|
|
|
|
|
2001-01-13 20:06:36 +01:00
|
|
|
$t = new Template($phpgw_info["server"]["app_tpl"]);
|
|
|
|
$t->set_file(array( "addressbook_header" => "header.tpl",
|
|
|
|
"searchfilter" => "searchfilter.tpl",
|
|
|
|
"body" => "list.tpl",
|
|
|
|
"addressbook_footer" => "footer.tpl" ));
|
|
|
|
|
2001-01-21 03:31:24 +01:00
|
|
|
$this = CreateObject("addressbook.addressbook");
|
|
|
|
$entries = $this->get_entries($query,$filter,$sort,$order,$start);
|
2001-01-13 20:06:36 +01:00
|
|
|
|
2001-01-21 03:31:24 +01:00
|
|
|
$rows="";
|
|
|
|
$columns_to_display=$this->columns_to_display;
|
|
|
|
if($phpgw_info["user"]["preferences"]["common"]["maxmatchs"] ) {
|
|
|
|
$limit = $phpgw_info["user"]["preferences"]["common"]["maxmatchs"];
|
|
|
|
} else { // this must be broken, but it works
|
|
|
|
$limit = 15;
|
2001-01-13 20:06:36 +01:00
|
|
|
}
|
2000-08-18 05:24:22 +02:00
|
|
|
|
2001-01-21 03:31:24 +01:00
|
|
|
for ($i=0;$i<$limit;$i++) { // each entry
|
2000-08-18 05:24:22 +02:00
|
|
|
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
|
2001-01-13 20:06:36 +01:00
|
|
|
$rows .= '<tr bgcolor="#'.$tr_color . '">';
|
2001-01-21 03:31:24 +01:00
|
|
|
while ($column = each($columns_to_display)) { // each entry column
|
|
|
|
$colname = $this->colname($column[0],$i);
|
|
|
|
$myid = $entries->ab_id[$i];
|
|
|
|
$myowner = $entries->owner[$i];
|
|
|
|
// Some fields require special formatting.
|
2001-01-13 20:06:36 +01:00
|
|
|
if ($column[0] == "url") {
|
|
|
|
$rows .= '<td valign="top"><font face="' . $phpgw_info["theme"]["font"] . '" size="2">'
|
2001-01-21 03:31:24 +01:00
|
|
|
. '<a href="' . $colname . '" target="_new">' . $colname . '</a> </font></td>';
|
|
|
|
} else if ($column[0] == "email") {
|
|
|
|
if ($phpgw_info["user"]["apps"]["email"]) {
|
2001-01-13 20:06:36 +01:00
|
|
|
$rows .= '<td valign="top"><font face="' . $phpgw_info["theme"]["font"] . '" size="2">'
|
2001-01-21 03:31:24 +01:00
|
|
|
. '<a href="' . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/email/compose.php",
|
|
|
|
"to=" . urlencode($colname)) . '" target="_new">' . $colname . '</a> </font></td>';
|
|
|
|
} else {
|
2001-01-13 20:06:36 +01:00
|
|
|
$rows .= '<td valign="top"><font face="' . $phpgw_info["theme"]["font"] . '" size="2">'
|
2001-01-21 03:31:24 +01:00
|
|
|
. '<a href="mailto:' . $colname . '">' . $colname . '</a> </font></td>';
|
|
|
|
}
|
|
|
|
} else { // But these do not
|
2001-01-13 20:06:36 +01:00
|
|
|
$rows .= '<td valign="top"><font face="' . $phpgw_info["theme"]["font"] . '" size="2">'
|
2001-01-21 03:31:24 +01:00
|
|
|
. $colname . ' </font></td>';
|
2001-01-13 20:06:36 +01:00
|
|
|
}
|
2000-11-01 11:26:14 +01:00
|
|
|
}
|
2001-01-21 03:31:24 +01:00
|
|
|
|
|
|
|
reset($columns_to_display); // If we don't reset it, our inside while won't loop
|
|
|
|
|
2001-01-13 20:06:36 +01:00
|
|
|
$rows .= '<td valign="top" width="3%">
|
2001-01-21 03:31:24 +01:00
|
|
|
<font face="'.$phpgw_info["theme"]["font"].'" size="2">
|
|
|
|
<a href="'. $phpgw->link("view.php","ab_id=$myid&start=$start&order=$order&filter="
|
|
|
|
. "$filter&query=$query&sort=$sort").'
|
|
|
|
">'.lang("View").'</a>
|
2000-11-01 13:32:36 +01:00
|
|
|
</font>
|
|
|
|
</td>
|
2000-11-03 23:24:12 +01:00
|
|
|
<td valign=top width=3%>
|
2001-01-13 20:06:36 +01:00
|
|
|
<font face="'.$phpgw_info["theme"]["font"].'" size=2>
|
2001-01-21 03:31:24 +01:00
|
|
|
<a href="'.$phpgw->link("vcardout.php","ab_id=$myid&start=$start&order=$order&filter="
|
|
|
|
. "$filter&query=$query&sort=$sort").'
|
2001-01-13 20:25:38 +01:00
|
|
|
">'.lang("vcard").'</a>
|
2000-11-03 23:24:12 +01:00
|
|
|
</font>
|
|
|
|
</td>
|
2000-11-01 13:32:36 +01:00
|
|
|
<td valign="top" width="5%">
|
2001-01-13 20:06:36 +01:00
|
|
|
<font face="'.$phpgw_info["theme"]["font"].'" size="2">
|
2001-01-21 03:59:51 +01:00
|
|
|
'.$phpgw->common->check_owner($myowner,"edit.php",lang("edit"),"ab_id=".$myid."&start=".$start."&sort=".$sort."&order=".$order."&query=".$query."&sort=".$sort).'
|
2000-11-01 13:32:36 +01:00
|
|
|
</font>
|
|
|
|
</td>
|
|
|
|
</tr>
|
2001-01-13 20:06:36 +01:00
|
|
|
';
|
2000-08-18 05:24:22 +02:00
|
|
|
}
|
|
|
|
|
2001-01-21 03:31:24 +01:00
|
|
|
$t->set_var(searchreturn,$this->searchreturn);
|
|
|
|
$t->set_var(lang_showing,$this->lang_showing);
|
|
|
|
$t->set_var(search_filter,$this->search_filter);
|
2001-01-13 20:06:36 +01:00
|
|
|
$t->set_var("lang_addressbook",lang("Address book"));
|
|
|
|
$t->set_var("th_bg",$phpgw_info["theme"]["th_bg"]);
|
|
|
|
$t->set_var("th_font",$phpgw_info["theme"]["font"]);
|
|
|
|
$t->set_var("th_text",$phpgw_info["theme"]["th_text"]);
|
|
|
|
$t->set_var("lang_add",lang("Add"));
|
2001-01-13 20:25:38 +01:00
|
|
|
$t->set_var("lang_addvcard",lang("AddVCard"));
|
2001-01-14 22:35:04 +01:00
|
|
|
$t->set_var("lang_import",lang("Import File"));
|
|
|
|
$t->set_var("import_url",$phpgw->link("import.php"));
|
2001-01-13 20:06:36 +01:00
|
|
|
$t->set_var("lang_view",lang("View"));
|
|
|
|
$t->set_var("lang_vcard",lang("VCard"));
|
|
|
|
$t->set_var("lang_edit",lang("Edit"));
|
|
|
|
$t->set_var("start",$start);
|
2001-01-14 03:43:14 +01:00
|
|
|
$t->set_var("sort",$sort);
|
|
|
|
$t->set_var("order",$order);
|
2001-01-13 20:06:36 +01:00
|
|
|
$t->set_var("filter",$filter);
|
|
|
|
$t->set_var("qfield",$qfield);
|
|
|
|
$t->set_var("query",$query);
|
2001-01-15 03:30:29 +01:00
|
|
|
$t->set_var("actionurl",$phpgw->link("add.php?sort=$sort&order=$order&filter=$filter&start=$start"));
|
2001-01-13 20:06:36 +01:00
|
|
|
$t->set_var("start",$start);
|
|
|
|
$t->set_var("filter",$filter);
|
2001-01-21 03:31:24 +01:00
|
|
|
$t->set_var("cols",$this->cols);
|
2001-01-13 20:06:36 +01:00
|
|
|
$t->set_var("rows",$rows);
|
|
|
|
|
|
|
|
$t->parse("out","addressbook_header");
|
|
|
|
$t->pparse("out","addressbook_header");
|
|
|
|
$t->parse("out","searchfilter");
|
|
|
|
$t->pparse("out","searchfilter");
|
|
|
|
$t->parse("out","body");
|
|
|
|
$t->pparse("out","body");
|
|
|
|
$t->parse("out","addressbook_footer");
|
|
|
|
$t->pparse("out","addressbook_footer");
|
2000-08-18 05:24:22 +02:00
|
|
|
|
2000-09-29 07:24:18 +02:00
|
|
|
$phpgw->common->phpgw_footer();
|
2000-10-27 04:07:59 +02:00
|
|
|
?>
|