mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
Working on cleaning up the view addressbook section and added a new column called URL
This commit is contained in:
parent
512dd9c983
commit
58d7eb8f15
@ -26,58 +26,64 @@
|
|||||||
} else if (! $submit && ! $add_email) {
|
} else if (! $submit && ! $add_email) {
|
||||||
form("","add.php","Add","","","");
|
form("","add.php","Add","","","");
|
||||||
} else {
|
} else {
|
||||||
if ($bday_month == "" && $bday_day == "" && $bday_year == "")
|
if ($bday_month == "" && $bday_day == "" && $bday_year == "") {
|
||||||
$bday = "";
|
$bday = "";
|
||||||
else
|
} else {
|
||||||
$bday = "$bday_month/$bday_day/$bday_year";
|
$bday = "$bday_month/$bday_day/$bday_year";
|
||||||
|
}
|
||||||
|
|
||||||
$access = $phpgw->accounts->array_to_string($access,$n_groups);
|
if ($access != "private" && $access != "public") {
|
||||||
if($phpgw_info["apps"]["timetrack"]["enabled"]) {
|
$access = $phpgw->accounts->array_to_string($access,$n_groups);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($phpgw_info["apps"]["timetrack"]["enabled"]) {
|
||||||
$sql = "insert into addressbook (ab_owner,ab_access,ab_firstname,ab_lastname,ab_title,ab_email,"
|
$sql = "insert into addressbook (ab_owner,ab_access,ab_firstname,ab_lastname,ab_title,ab_email,"
|
||||||
. "ab_hphone,ab_wphone,ab_fax,ab_pager,ab_mphone,ab_ophone,ab_street,ab_address2,ab_city,"
|
. "ab_hphone,ab_wphone,ab_fax,ab_pager,ab_mphone,ab_ophone,ab_street,ab_address2,ab_city,"
|
||||||
. "ab_state,ab_zip,ab_bday,"
|
. "ab_state,ab_zip,ab_bday,"
|
||||||
. "ab_notes,ab_company_id) values ('" . $phpgw_info["user"]["account_id"] . "','$access','"
|
. "ab_notes,ab_company_id,ab_url) values ('" . $phpgw_info["user"]["account_id"] . "','$access','"
|
||||||
. addslashes($firstname). "','"
|
. addslashes($firstname). "','"
|
||||||
. addslashes($lastname) . "','"
|
. addslashes($lastname) . "','"
|
||||||
. addslashes($title) . "','"
|
. addslashes($title) . "','"
|
||||||
. addslashes($email) . "','"
|
. addslashes($email) . "','"
|
||||||
. addslashes($hphone) . "','"
|
. addslashes($hphone) . "','"
|
||||||
. addslashes($wphone) . "','"
|
. addslashes($wphone) . "','"
|
||||||
. addslashes($fax) . "','"
|
. addslashes($fax) . "','"
|
||||||
. addslashes($pager) . "','"
|
. addslashes($pager) . "','"
|
||||||
. addslashes($mphone) . "','"
|
. addslashes($mphone) . "','"
|
||||||
. addslashes($ophone) . "','"
|
. addslashes($ophone) . "','"
|
||||||
. addslashes($street) . "','"
|
. addslashes($street) . "','"
|
||||||
. addslashes($address2) . "','"
|
. addslashes($address2) . "','"
|
||||||
. addslashes($city) . "','"
|
. addslashes($city) . "','"
|
||||||
. addslashes($state) . "','"
|
. addslashes($state) . "','"
|
||||||
. addslashes($zip) . "','"
|
. addslashes($zip) . "','"
|
||||||
. addslashes($bday) . "','"
|
. addslashes($bday) . "','"
|
||||||
. addslashes($notes) . "','"
|
. addslashes($notes) . "','"
|
||||||
. addslashes($company). "')";
|
. addslashes($company) . "','"
|
||||||
|
. addslashes($url) . "')";
|
||||||
} else {
|
} else {
|
||||||
$sql = "insert into addressbook (ab_owner,ab_access,ab_firstname,ab_lastname,ab_title,ab_email,"
|
$sql = "insert into addressbook (ab_owner,ab_access,ab_firstname,ab_lastname,ab_title,ab_email,"
|
||||||
. "ab_hphone,ab_wphone,ab_fax,ab_pager,ab_mphone,ab_ophone,ab_street,ab_address2,ab_city,"
|
. "ab_hphone,ab_wphone,ab_fax,ab_pager,ab_mphone,ab_ophone,ab_street,ab_address2,ab_city,"
|
||||||
. "ab_state,ab_zip,ab_bday,"
|
. "ab_state,ab_zip,ab_bday,"
|
||||||
. "ab_notes,ab_company) values ('" . $phpgw_info["user"]["account_id"] . "','$access','"
|
. "ab_notes,ab_company,ab_url) values ('" . $phpgw_info["user"]["account_id"] . "','$access','"
|
||||||
. addslashes($firstname). "','"
|
. addslashes($firstname). "','"
|
||||||
. addslashes($lastname) . "','"
|
. addslashes($lastname) . "','"
|
||||||
. addslashes($title) . "','"
|
. addslashes($title) . "','"
|
||||||
. addslashes($email) . "','"
|
. addslashes($email) . "','"
|
||||||
. addslashes($hphone) . "','"
|
. addslashes($hphone) . "','"
|
||||||
. addslashes($wphone) . "','"
|
. addslashes($wphone) . "','"
|
||||||
. addslashes($fax) . "','"
|
. addslashes($fax) . "','"
|
||||||
. addslashes($pager) . "','"
|
. addslashes($pager) . "','"
|
||||||
. addslashes($mphone) . "','"
|
. addslashes($mphone) . "','"
|
||||||
. addslashes($ophone) . "','"
|
. addslashes($ophone) . "','"
|
||||||
. addslashes($street) . "','"
|
. addslashes($street) . "','"
|
||||||
. addslashes($address2) . "','"
|
. addslashes($address2) . "','"
|
||||||
. addslashes($city) . "','"
|
. addslashes($city) . "','"
|
||||||
. addslashes($state) . "','"
|
. addslashes($state) . "','"
|
||||||
. addslashes($zip) . "','"
|
. addslashes($zip) . "','"
|
||||||
. addslashes($bday) . "','"
|
. addslashes($bday) . "','"
|
||||||
. addslashes($notes) . "','"
|
. addslashes($notes) . "','"
|
||||||
. addslashes($company). "')";
|
. addslashes($company) . "','"
|
||||||
|
. addslashes($url) . "')";
|
||||||
}
|
}
|
||||||
$phpgw->db->query($sql);
|
$phpgw->db->query($sql);
|
||||||
|
|
||||||
@ -86,20 +92,20 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<TABLE border=0 cellPadding=0 cellSpacing=0 width="95%">
|
<TABLE border="0" cellPadding="0" cellSpacing="0" width="95%">
|
||||||
<TBODY>
|
<TBODY>
|
||||||
<TR>
|
<TR>
|
||||||
<TD>
|
<TD>
|
||||||
<TABLE border=0 cellPadding=1 cellSpacing=1>
|
<TABLE border="0" cellPadding="1" cellSpacing="1">
|
||||||
<TBODY>
|
<TBODY>
|
||||||
<TR>
|
<TR>
|
||||||
<TD align=left>
|
<TD align="left">
|
||||||
<INPUT type=submit name=submit value="OK">
|
<INPUT type="submit" name="submit" value="<?php echo lang("OK"); ?>">
|
||||||
</TD>
|
</TD>
|
||||||
<TD align=left>
|
<TD align="left">
|
||||||
<INPUT name=reset type=reset value="Clear">
|
<INPUT name="reset" type="reset" value="<?php echo lang("Clear"); ?>">
|
||||||
</TD>
|
</TD>
|
||||||
<TD align=left>
|
<TD align="left">
|
||||||
<a href="<?php echo $phpgw->link($phpgw_info["server"]["webserver_url"] . "/addressbook/") . "\">" . lang("Cancel"); ?></a>
|
<a href="<?php echo $phpgw->link($phpgw_info["server"]["webserver_url"] . "/addressbook/") . "\">" . lang("Cancel"); ?></a>
|
||||||
</TD>
|
</TD>
|
||||||
</TR>
|
</TR>
|
||||||
|
@ -27,31 +27,33 @@
|
|||||||
|
|
||||||
if (! $submit) {
|
if (! $submit) {
|
||||||
$phpgw->db->query("SELECT * FROM addressbook WHERE ab_owner='"
|
$phpgw->db->query("SELECT * FROM addressbook WHERE ab_owner='"
|
||||||
. $phpgw_info["user"]["account_id"] . "' AND ab_id=$ab_id");
|
. $phpgw_info["user"]["account_id"] . "' AND ab_id=$ab_id");
|
||||||
$phpgw->db->next_record();
|
$phpgw->db->next_record();
|
||||||
|
|
||||||
$fields = array('ab_id' => $phpgw->db->f("ab_id"),
|
$fields = array('ab_id' => $phpgw->db->f("ab_id"),
|
||||||
'owner' => $phpgw->db->f("ab_owner"),
|
'owner' => $phpgw->db->f("ab_owner"),
|
||||||
'access' => $phpgw->db->f("ab_access"),
|
'access' => $phpgw->db->f("ab_access"),
|
||||||
'firstname' => $phpgw->db->f("ab_firstname"),
|
'firstname' => $phpgw->db->f("ab_firstname"),
|
||||||
'lastname' => $phpgw->db->f("ab_lastname"),
|
'lastname' => $phpgw->db->f("ab_lastname"),
|
||||||
'title' => $phpgw->db->f("ab_title"),
|
'title' => $phpgw->db->f("ab_title"),
|
||||||
'email' => $phpgw->db->f("ab_email"),
|
'email' => $phpgw->db->f("ab_email"),
|
||||||
'hphone' => $phpgw->db->f("ab_hphone"),
|
'hphone' => $phpgw->db->f("ab_hphone"),
|
||||||
'wphone' => $phpgw->db->f("ab_wphone"),
|
'wphone' => $phpgw->db->f("ab_wphone"),
|
||||||
'fax' => $phpgw->db->f("ab_fax"),
|
'fax' => $phpgw->db->f("ab_fax"),
|
||||||
'pager' => $phpgw->db->f("ab_pager"),
|
'pager' => $phpgw->db->f("ab_pager"),
|
||||||
'mphone' => $phpgw->db->f("ab_mphone"),
|
'mphone' => $phpgw->db->f("ab_mphone"),
|
||||||
'ophone' => $phpgw->db->f("ab_ophone"),
|
'ophone' => $phpgw->db->f("ab_ophone"),
|
||||||
'street' => $phpgw->db->f("ab_street"),
|
'street' => $phpgw->db->f("ab_street"),
|
||||||
'address2' => $phpgw->db->f("ab_address2"),
|
'address2' => $phpgw->db->f("ab_address2"),
|
||||||
'city' => $phpgw->db->f("ab_city"),
|
'city' => $phpgw->db->f("ab_city"),
|
||||||
'state' => $phpgw->db->f("ab_state"),
|
'state' => $phpgw->db->f("ab_state"),
|
||||||
'zip' => $phpgw->db->f("ab_zip"),
|
'zip' => $phpgw->db->f("ab_zip"),
|
||||||
'bday' => $phpgw->db->f("ab_bday"),
|
'bday' => $phpgw->db->f("ab_bday"),
|
||||||
'company' => $phpgw->db->f("ab_company"),
|
'company' => $phpgw->db->f("ab_company"),
|
||||||
'company_id' => $phpgw->db->f("ab_company_id"),
|
'company_id' => $phpgw->db->f("ab_company_id"),
|
||||||
'notes' => $phpgw->db->f("ab_notes")
|
'notes' => $phpgw->db->f("ab_notes")
|
||||||
|
,
|
||||||
|
'url' => $phpgw->db->f("ab_url")
|
||||||
);
|
);
|
||||||
|
|
||||||
form("","edit.php","Edit",$fields);
|
form("","edit.php","Edit",$fields);
|
||||||
@ -64,45 +66,47 @@
|
|||||||
|
|
||||||
if($phpgw_info["apps"]["timetrack"]["enabled"]) {
|
if($phpgw_info["apps"]["timetrack"]["enabled"]) {
|
||||||
$sql = "UPDATE addressbook set ab_email='" . addslashes($email)
|
$sql = "UPDATE addressbook set ab_email='" . addslashes($email)
|
||||||
. "', ab_firstname='". addslashes($firstname)
|
. "', ab_firstname='" . addslashes($firstname)
|
||||||
. "', ab_lastname='" . addslashes($lastname)
|
. "', ab_lastname='" . addslashes($lastname)
|
||||||
. "', ab_title='" . addslashes($title)
|
. "', ab_title='" . addslashes($title)
|
||||||
. "', ab_hphone='" . addslashes($hphone)
|
. "', ab_hphone='" . addslashes($hphone)
|
||||||
. "', ab_wphone='" . addslashes($wphone)
|
. "', ab_wphone='" . addslashes($wphone)
|
||||||
. "', ab_fax='" . addslashes($fax)
|
. "', ab_fax='" . addslashes($fax)
|
||||||
. "', ab_pager='" . addslashes($pager)
|
. "', ab_pager='" . addslashes($pager)
|
||||||
. "', ab_mphone='" . addslashes($mphone)
|
. "', ab_mphone='" . addslashes($mphone)
|
||||||
. "', ab_ophone='" . addslashes($ophone)
|
. "', ab_ophone='" . addslashes($ophone)
|
||||||
. "', ab_street='" . addslashes($street)
|
. "', ab_street='" . addslashes($street)
|
||||||
. "', ab_address2='" . addslashes($address2)
|
. "', ab_address2='" . addslashes($address2)
|
||||||
. "', ab_city='" . addslashes($city)
|
. "', ab_city='" . addslashes($city)
|
||||||
. "', ab_state='" . addslashes($state)
|
. "', ab_state='" . addslashes($state)
|
||||||
. "', ab_zip='" . addslashes($zip)
|
. "', ab_zip='" . addslashes($zip)
|
||||||
. "', ab_bday='" . addslashes($bday)
|
. "', ab_bday='" . addslashes($bday)
|
||||||
. "', ab_notes='" . addslashes($notes)
|
. "', ab_notes='" . addslashes($notes)
|
||||||
. "', ab_company_id='" . addslashes($company)
|
. "', ab_company_id='" . addslashes($company)
|
||||||
. "', ab_access='" . addslashes($access)
|
. "', ab_access='" . addslashes($access)
|
||||||
. "' WHERE ab_owner='" . $phpgw_info["user"]["account_id"] . "' AND ab_id=$ab_id";
|
. "', ab_url='" . addslashes($url)
|
||||||
|
. "' WHERE ab_owner='" . $phpgw_info["user"]["account_id"] . "' AND ab_id=$ab_id";
|
||||||
} else {
|
} else {
|
||||||
$sql = "UPDATE addressbook set ab_email='" . addslashes($email)
|
$sql = "UPDATE addressbook set ab_email='" . addslashes($email)
|
||||||
. "', ab_firstname='". addslashes($firstname)
|
. "', ab_firstname='". addslashes($firstname)
|
||||||
. "', ab_lastname='" . addslashes($lastname)
|
. "', ab_lastname='" . addslashes($lastname)
|
||||||
. "', ab_title='" . addslashes($title)
|
. "', ab_title='" . addslashes($title)
|
||||||
. "', ab_hphone='" . addslashes($hphone)
|
. "', ab_hphone='" . addslashes($hphone)
|
||||||
. "', ab_wphone='" . addslashes($wphone)
|
. "', ab_wphone='" . addslashes($wphone)
|
||||||
. "', ab_fax='" . addslashes($fax)
|
. "', ab_fax='" . addslashes($fax)
|
||||||
. "', ab_pager='" . addslashes($pager)
|
. "', ab_pager='" . addslashes($pager)
|
||||||
. "', ab_mphone='" . addslashes($mphone)
|
. "', ab_mphone='" . addslashes($mphone)
|
||||||
. "', ab_ophone='" . addslashes($ophone)
|
. "', ab_ophone='" . addslashes($ophone)
|
||||||
. "', ab_street='" . addslashes($street)
|
. "', ab_street='" . addslashes($street)
|
||||||
. "', ab_address2='" . addslashes($address2)
|
. "', ab_address2='" . addslashes($address2)
|
||||||
. "', ab_city='" . addslashes($city)
|
. "', ab_city='" . addslashes($city)
|
||||||
. "', ab_state='" . addslashes($state)
|
. "', ab_state='" . addslashes($state)
|
||||||
. "', ab_zip='" . addslashes($zip)
|
. "', ab_zip='" . addslashes($zip)
|
||||||
. "', ab_bday='" . addslashes($bday)
|
. "', ab_bday='" . addslashes($bday)
|
||||||
. "', ab_notes='" . addslashes($notes)
|
. "', ab_notes='" . addslashes($notes)
|
||||||
. "', ab_company='" . addslashes($company)
|
. "', ab_company='" . addslashes($company)
|
||||||
. "', ab_access='" . addslashes($access)
|
. "', ab_access='" . addslashes($access)
|
||||||
|
. "', ab_url='" . addslashes($url)
|
||||||
. "' WHERE ab_owner='" . $phpgw_info["user"]["account_id"] . "' AND ab_id=$ab_id";
|
. "' WHERE ab_owner='" . $phpgw_info["user"]["account_id"] . "' AND ab_id=$ab_id";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,16 +124,16 @@
|
|||||||
<input type="hidden" name="filter" value="<? echo $filter; ?>">
|
<input type="hidden" name="filter" value="<? echo $filter; ?>">
|
||||||
<input type="hidden" name="start" value="<? echo $start; ?>">
|
<input type="hidden" name="start" value="<? echo $start; ?>">
|
||||||
|
|
||||||
<TABLE border=0 cellPadding=1 cellSpacing=1 width="95%">
|
<TABLE border="0" cellPadding="1" cellSpacing="1" width="95%">
|
||||||
<TBODY>
|
<TBODY>
|
||||||
<tr>
|
<tr>
|
||||||
<TD align=left width=7%>
|
<TD align="left" width="7%">
|
||||||
<input type="submit" name="submit" value="<?php echo lang("Submit"); ?>">
|
<input type="submit" name="submit" value="<?php echo lang("Submit"); ?>">
|
||||||
</TD>
|
</TD>
|
||||||
<TD align=left width=7%>
|
<TD align="left" width="7%">
|
||||||
<a href="<?php echo $phpgw->link("view.php","ab_id=$ab_id") . "\">" . lang("Cancel"); ?></a>
|
<a href="<?php echo $phpgw->link("view.php","ab_id=$ab_id") . "\">" . lang("Cancel"); ?></a>
|
||||||
</TD>
|
</TD>
|
||||||
<TD align=right>
|
<TD align="right">
|
||||||
<a href="<?php echo $phpgw->link("delete.php","ab_id=$ab_id") . "\">" . lang("Delete"); ?></a>
|
<a href="<?php echo $phpgw->link("delete.php","ab_id=$ab_id") . "\">" . lang("Delete"); ?></a>
|
||||||
</TD>
|
</TD>
|
||||||
</TR>
|
</TR>
|
||||||
|
@ -32,8 +32,7 @@
|
|||||||
|
|
||||||
function form($format,$action,$title,$fields)
|
function form($format,$action,$title,$fields)
|
||||||
{
|
{
|
||||||
global $phpgw;
|
global $phpgw, $phpgw_info;
|
||||||
global $phpgw_info;
|
|
||||||
|
|
||||||
$email = $fields["email"];
|
$email = $fields["email"];
|
||||||
$firstname = $fields["firstname"];
|
$firstname = $fields["firstname"];
|
||||||
@ -56,6 +55,7 @@
|
|||||||
$ab_company = $fields["company"];
|
$ab_company = $fields["company"];
|
||||||
$company_id = $fields["company_id"];
|
$company_id = $fields["company_id"];
|
||||||
$company_name = $fields["company_name"];
|
$company_name = $fields["company_name"];
|
||||||
|
$url = $fields["url"];
|
||||||
|
|
||||||
if ($format != "view") {
|
if ($format != "view") {
|
||||||
$email = "<input name=\"email\" value=\"$email\">";
|
$email = "<input name=\"email\" value=\"$email\">";
|
||||||
@ -73,6 +73,8 @@
|
|||||||
$city = "<input name=\"city\" value=\"$city\">";
|
$city = "<input name=\"city\" value=\"$city\">";
|
||||||
$state = "<input name=\"state\" value=\"$state\">";
|
$state = "<input name=\"state\" value=\"$state\">";
|
||||||
$zip = "<input name=\"zip\" value=\"$zip\">";
|
$zip = "<input name=\"zip\" value=\"$zip\">";
|
||||||
|
$url = "<input name=\"url\" value=\"$url\">";
|
||||||
|
|
||||||
if($phpgw_info["apps"]["timetrack"]["enabled"]) {
|
if($phpgw_info["apps"]["timetrack"]["enabled"]) {
|
||||||
$company = '<select name="company">';
|
$company = '<select name="company">';
|
||||||
$phpgw->db->query("select company_id,company_name from customers order by company_name");
|
$phpgw->db->query("select company_id,company_name from customers order by company_name");
|
||||||
@ -186,13 +188,25 @@
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><font color="#000000" face="" size="-1"><?php echo lang("Company Name"); ?>:</font></td>
|
|
||||||
<td>
|
<td>
|
||||||
<font size="-1">
|
<font color="#000000" face="" size="-1"><?php echo lang("Company Name"); ?>:</font>
|
||||||
<?php echo $company; ?>
|
</td>
|
||||||
</font></td>
|
<td>
|
||||||
|
<font size="-1">
|
||||||
|
<?php echo $company; ?>
|
||||||
|
</font>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<font color="#000000" face="" size="-1"><?php echo lang("URL"); ?>:</font>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<font size="-1">
|
||||||
|
<?php echo $url; ?>
|
||||||
|
</font>
|
||||||
|
</td>
|
||||||
<td><font size="-1"></font></td>
|
<td><font size="-1"></font></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><font color="#000000" face="" size="-1"><?php echo lang("Home Phone"); ?>:</font></td>
|
<td><font color="#000000" face="" size="-1"><?php echo lang("Home Phone"); ?>:</font></td>
|
||||||
<td>
|
<td>
|
||||||
@ -317,7 +331,7 @@
|
|||||||
. ":</font></td><td colspan=\"3\"><select name=\"n_groups[]\" "
|
. ":</font></td><td colspan=\"3\"><select name=\"n_groups[]\" "
|
||||||
. "multiple size=\"5\">";
|
. "multiple size=\"5\">";
|
||||||
|
|
||||||
$user_groups = $phpgw->accounts->read_group_names($fields["owner"]);
|
$user_groups = $phpgw->accounts->read_group_names($fields["ab_owner"]);
|
||||||
for ($i=0;$i<count($user_groups);$i++) {
|
for ($i=0;$i<count($user_groups);$i++) {
|
||||||
echo "<option value=\"" . $user_groups[$i][0] . "\"";
|
echo "<option value=\"" . $user_groups[$i][0] . "\"";
|
||||||
if (ereg(",".$user_groups[$i][0].",",$access))
|
if (ereg(",".$user_groups[$i][0].",",$access))
|
||||||
|
@ -163,6 +163,8 @@
|
|||||||
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
|
$tr_color = $phpgw->nextmatchs->alternate_row_color($tr_color);
|
||||||
echo '<tr bgcolor="#' . $tr_color . '">';
|
echo '<tr bgcolor="#' . $tr_color . '">';
|
||||||
|
|
||||||
|
$ab_id = $phpgw->db->f("ab_id");
|
||||||
|
|
||||||
while ($column = each($columns_to_display)) {
|
while ($column = each($columns_to_display)) {
|
||||||
if ($phpgw_info["apps"]["timetrack"]["enabled"]) {
|
if ($phpgw_info["apps"]["timetrack"]["enabled"]) {
|
||||||
if ($column[0] == "company") {
|
if ($column[0] == "company") {
|
||||||
@ -174,46 +176,43 @@
|
|||||||
$field = $phpgw->db->f("ab_" . $column[0]);
|
$field = $phpgw->db->f("ab_" . $column[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $field) {
|
$field = htmlentities($field);
|
||||||
$field = " ";
|
|
||||||
} else {
|
|
||||||
$field = htmlentities($field);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Some fields require special formating.
|
// Some fields require special formating.
|
||||||
if ($column[0] == "url") {
|
if ($column[0] == "url") {
|
||||||
echo '<td valign="top"><font face="' . $phpgw_info["theme"]["font"] . '" size="2">'
|
echo '<td valign="top"><font face="' . $phpgw_info["theme"]["font"] . '" size="2">'
|
||||||
. '<a href="' . $field . '" target="_top">' . $field. '</a></font></td>';
|
. '<a href="' . $field . '" target="_new">' . $field. '</a> </font></td>';
|
||||||
} else if ($column[0] == "email") {
|
} else if ($column[0] == "email") {
|
||||||
if ($phpgw_info["user"]["apps"]["email"]) {
|
if ($phpgw_info["user"]["apps"]["email"]) {
|
||||||
echo '<td valign="top"><font face="' . $phpgw_info["theme"]["font"] . '" size="2">'
|
echo '<td valign="top"><font face="' . $phpgw_info["theme"]["font"] . '" size="2">'
|
||||||
. '<a href="' . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/email/compose.php",
|
. '<a href="' . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/email/compose.php",
|
||||||
"to=" . urlencode($field)) . '" target="_top">' . $field . '</a></font></td>';
|
"to=" . urlencode($field)) . '" target="_top">' . $field . '</a> </font></td>';
|
||||||
} else {
|
} else {
|
||||||
echo '<td valign="top"><font face="' . $phpgw_info["theme"]["font"] . '" size="2">'
|
echo '<td valign="top"><font face="' . $phpgw_info["theme"]["font"] . '" size="2">'
|
||||||
. '<a href="mailto:' . $field . '" target="_top">' . $field. '</a></font></td>';
|
. '<a href="mailto:' . $field . '" target="_top">' . $field. '</a> </font></td>';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
echo '<td valign="top"><font face="' . $phpgw_info["theme"]["font"] . '" size="2">'
|
echo '<td valign="top"><font face="' . $phpgw_info["theme"]["font"] . '" size="2">'
|
||||||
. $field . '</font></td>';
|
. $field . ' </font></td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
reset($columns_to_display); // If we don't reset it, our inside while won't loop
|
||||||
?>
|
?>
|
||||||
<td valign=top width=3%>
|
<td valign="top" width="3%">
|
||||||
<font face=Arial, Helvetica, sans-serif size=2>
|
<font face="<?php echo $phpgw_info["theme"]["font"]; ?>" size="2">
|
||||||
<a href="<?php echo $phpgw->link("view.php","ab_id=$ab_id&start=$start&order=$order&filter="
|
<a href="<?php echo $phpgw->link("view.php","ab_id=$ab_id&start=$start&order=$order&filter="
|
||||||
. "$filter&query=$query&sort=$sort");
|
. "$filter&query=$query&sort=$sort");
|
||||||
?>"> <?php echo lang("View"); ?> </a>
|
?>"> <?php echo lang("View"); ?> </a>
|
||||||
</font>
|
</font>
|
||||||
</td>
|
</td>
|
||||||
<td valign=top width=5%>
|
<td valign="top" width="5%">
|
||||||
<font face=Arial, Helvetica, sans-serif size=2>
|
<font face="<?php echo $phpgw_info["theme"]["font"]; ?>" size="2">
|
||||||
<?php echo $phpgw->common->check_owner($phpgw->db->f("ab_owner"),"edit.php",lang("edit"),"ab_id=" . $phpgw->db->f("ab_id")); ?>
|
<?php echo $phpgw->common->check_owner($phpgw->db->f("ab_owner"),"edit.php",lang("edit"),"ab_id=" . $phpgw->db->f("ab_id")); ?>
|
||||||
</font>
|
</font>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@ -24,71 +24,78 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($filter != "private")
|
if ($filter != "private")
|
||||||
|
{
|
||||||
$filtermethod = " or ab_access='public' " . $phpgw->accounts->sql_search("ab_access");
|
$filtermethod = " or ab_access='public' " . $phpgw->accounts->sql_search("ab_access");
|
||||||
|
}
|
||||||
|
|
||||||
if($phpgw_info["apps"]["timetrack"]["enabled"]) {
|
if ($phpgw_info["apps"]["timetrack"]["enabled"]) {
|
||||||
$phpgw->db->query("SELECT * FROM addressbook as a, customers as c WHERE a.ab_company_id = c.company_id "
|
$phpgw->db->query("SELECT * FROM addressbook as a, customers as c WHERE a.ab_company_id = c.company_id "
|
||||||
. "AND ab_id=$ab_id AND (ab_owner='"
|
. "AND ab_id=$ab_id AND (ab_owner='"
|
||||||
. $phpgw_info["user"]["account_id"] . "' $filtermethod)");
|
. $phpgw_info["user"]["account_id"] . "' $filtermethod)");
|
||||||
} else {
|
} else {
|
||||||
$phpgw->db->query("SELECT * FROM addressbook "
|
$phpgw->db->query("SELECT * FROM addressbook WHERE ab_id=$ab_id AND (ab_owner='"
|
||||||
. "WHERE ab_id=$ab_id AND (ab_owner='"
|
|
||||||
. $phpgw_info["user"]["account_id"] . "' $filtermethod)");
|
. $phpgw_info["user"]["account_id"] . "' $filtermethod)");
|
||||||
}
|
}
|
||||||
$phpgw->db->next_record();
|
$phpgw->db->next_record();
|
||||||
|
|
||||||
$fields = array('ab_id' => $phpgw->db->f("ab_id"),
|
echo "<p> <b>" . lang("Address book - view") . "</b><hr><p>";
|
||||||
'owner' => $phpgw->db->f("ab_owner"),
|
|
||||||
'access' => $phpgw->db->f("ab_access"),
|
|
||||||
'firstname' => $phpgw->db->f("ab_firstname"),
|
|
||||||
'lastname' => $phpgw->db->f("ab_lastname"),
|
|
||||||
'title' => $phpgw->db->f("ab_title"),
|
|
||||||
'email' => $phpgw->db->f("ab_email"),
|
|
||||||
'hphone' => $phpgw->db->f("ab_hphone"),
|
|
||||||
'wphone' => $phpgw->db->f("ab_wphone"),
|
|
||||||
'fax' => $phpgw->db->f("ab_fax"),
|
|
||||||
'pager' => $phpgw->db->f("ab_pager"),
|
|
||||||
'mphone' => $phpgw->db->f("ab_mphone"),
|
|
||||||
'ophone' => $phpgw->db->f("ab_ophone"),
|
|
||||||
'street' => $phpgw->db->f("ab_street"),
|
|
||||||
'address2' => $phpgw->db->f("ab_address2"),
|
|
||||||
'city' => $phpgw->db->f("ab_city"),
|
|
||||||
'state' => $phpgw->db->f("ab_state"),
|
|
||||||
'zip' => $phpgw->db->f("ab_zip"),
|
|
||||||
'bday' => $phpgw->db->f("ab_bday"),
|
|
||||||
'company' => $phpgw->db->f("ab_company"),
|
|
||||||
'company_id' => $phpgw->db->f("ab_company_id"),
|
|
||||||
'company_name' => $phpgw->db->f("company_name"),
|
|
||||||
'notes' => $phpgw->db->f("ab_notes")
|
|
||||||
);
|
|
||||||
|
|
||||||
$owner = $phpgw->db->f("ab_owner");
|
$i = 0;
|
||||||
$ab_id = $phpgw->db->f("ab_id");
|
while ($column = each($abc)) {
|
||||||
form("view","","View",$fields);
|
if ($phpgw->db->f("ab_" . $column[0])) {
|
||||||
|
$columns_to_display[$i]["field_name"] = $column[1];
|
||||||
|
$columns_to_display[$i]["field_value"] = $phpgw->db->f("ab_" . $column[0]);
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
echo '<table border="0" cellspacing="2" cellpadding="2" width="80%" align="center">';
|
||||||
|
for ($i=0;$i<200;) { // The $i<200 is only used for a brake
|
||||||
|
if (! $columns_to_display[$i]["field_name"]) break;
|
||||||
|
|
||||||
|
$columns_html .= "<tr><td><b>" . lang($columns_to_display[$i]["field_name"]) . "</b>:</td>"
|
||||||
|
. "<td>" . $columns_to_display[$i]["field_value"] . "</td>";
|
||||||
|
|
||||||
|
$i++;
|
||||||
|
|
||||||
|
if (! $columns_to_display[$i]["field_name"]) break;
|
||||||
|
|
||||||
|
$columns_html .= "<td><b>" . lang($columns_to_display[$i]["field_name"]) . "</b>:</td>"
|
||||||
|
. "<td>" . $columns_to_display[$i]["field_value"];
|
||||||
|
|
||||||
|
$i++;
|
||||||
|
$columns_html .= "</td></tr>";
|
||||||
|
}
|
||||||
|
$owner = $phpgw->db->f("ab_owner");
|
||||||
|
$access = $phpgw->db->f("ab_access");
|
||||||
|
|
||||||
|
echo $columns_html . '<tr><td colspan="4"> </td></tr>';
|
||||||
|
echo "<tr><td><b>" . lang("Record owner") . "</b></td><td>"
|
||||||
|
. $phpgw->common->grab_owner_name($phpgw->db->f("ab_owner")) . "</td><td><b>"
|
||||||
|
. lang("Record Access") . "</b></td><td>";
|
||||||
|
|
||||||
|
if ($access != "private" && $access != "public") {
|
||||||
|
echo lang("Group access") . $phpgw->accounts->convert_string_to_names_access($access);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
echo $access;
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "</td></tr></table>";
|
||||||
?>
|
?>
|
||||||
<TABLE border=0 cellPadding=0 cellSpacing=0 width="95%">
|
<TABLE border="0" cellpadding="1" cellspacing="1">
|
||||||
<TBODY>
|
<TR>
|
||||||
<TR>
|
<TD align="left">
|
||||||
<TD>
|
<?php
|
||||||
<TABLE border=0 cellPadding=1 cellSpacing=1>
|
echo $phpgw->common->check_owner($owner,"edit.php","Edit");
|
||||||
<TBODY>
|
?>
|
||||||
<TR>
|
</TD>
|
||||||
<TD align=left>
|
<TD align="left">
|
||||||
<?php
|
<a href="<?php echo $phpgw->link("index.php","order=$order&start=$start&filter=$filter&query=$query&sort=$sort"); ?>">Done</a>
|
||||||
echo $phpgw->common->check_owner($ab_id,$owner,"Edit");
|
</TD>
|
||||||
?>
|
</TR>
|
||||||
</TD>
|
</TABLE>
|
||||||
<TD align=left>
|
|
||||||
<a href="<?php echo $phpgw->link("index.php","order=$order&start=$start&filter=$filter&query=$query&sort=$sort"); ?>">Done</a>
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
</TBODY>
|
|
||||||
</TABLE>
|
|
||||||
</TD>
|
|
||||||
</TR>
|
|
||||||
</TBODY>
|
|
||||||
</TABLE>
|
|
||||||
</DIV>
|
|
||||||
<?php
|
<?php
|
||||||
$phpgw->common->phpgw_footer();
|
$phpgw->common->phpgw_footer();
|
||||||
?>
|
?>
|
||||||
|
Loading…
Reference in New Issue
Block a user