mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-26 12:51:52 +02:00
Added the date preferences into the addressbook, added special formating to view, fixed date preference not working in todo list, and fixed the target of <a href in index.php
This commit is contained in:
parent
28eeae8ad7
commit
6f675c8c86
@ -41,6 +41,10 @@
|
|||||||
$access = $phpgw->accounts->array_to_string($access,$n_groups);
|
$access = $phpgw->accounts->array_to_string($access,$n_groups);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($url == "http://") {
|
||||||
|
$url = "";
|
||||||
|
}
|
||||||
|
|
||||||
if ($phpgw_info["apps"]["timetrack"]["enabled"]) {
|
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,"
|
||||||
|
@ -59,6 +59,10 @@
|
|||||||
form("","edit.php","Edit",$fields);
|
form("","edit.php","Edit",$fields);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
if ($url == "http://") {
|
||||||
|
$url = "";
|
||||||
|
}
|
||||||
|
|
||||||
if (! $bday_month && ! $bday_day && ! $bday_year) {
|
if (! $bday_month && ! $bday_day && ! $bday_year) {
|
||||||
$bday = "";
|
$bday = "";
|
||||||
} else {
|
} else {
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
/* $Id$ */
|
/* $Id$ */
|
||||||
|
|
||||||
// NOTE: This entire file needs to be rewritten. There is a great deal of code not being used
|
// NOTE: This entire file needs to be rewritten. There is a great deal of code not being used
|
||||||
// anymore. (jengo)
|
// anymore. This should also be converted to templates while where at it (jengo)
|
||||||
|
|
||||||
$abc = array('company' => 'company', // AddressBook Columns and their descriptions
|
$abc = array('company' => 'company', // AddressBook Columns and their descriptions
|
||||||
'firstname' => 'first name',
|
'firstname' => 'first name',
|
||||||
@ -76,7 +76,7 @@
|
|||||||
$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\">";
|
//$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">';
|
||||||
@ -98,7 +98,7 @@
|
|||||||
list( $month, $day, $year ) = split( '/', $bday );
|
list( $month, $day, $year ) = split( '/', $bday );
|
||||||
$temp_month[$month] = "SELECTED";
|
$temp_month[$month] = "SELECTED";
|
||||||
|
|
||||||
$bday ="<select name=bday_month>"
|
$bday_month = "<select name=bday_month>"
|
||||||
. "<option value=\"\" $temp_month[0]> </option>"
|
. "<option value=\"\" $temp_month[0]> </option>"
|
||||||
. "<option value=1 $temp_month[1]>January</option>"
|
. "<option value=1 $temp_month[1]>January</option>"
|
||||||
. "<option value=2 $temp_month[2]>February</option>"
|
. "<option value=2 $temp_month[2]>February</option>"
|
||||||
@ -113,11 +113,12 @@
|
|||||||
. "<option value=11 $temp_month[11]>November</option>"
|
. "<option value=11 $temp_month[11]>November</option>"
|
||||||
. "<option value=12 $temp_month[12]>December</option>"
|
. "<option value=12 $temp_month[12]>December</option>"
|
||||||
. "</select>"
|
. "</select>"
|
||||||
. "<input maxlength=2 name=bday_day value=\"$day\" size=2>"
|
;
|
||||||
. "<input maxlength=4 name=bday_year value=\"$year\" size=4>"
|
$bday_day = '<input maxlength="2" name="bday_day" value="' . $day . '" size="2">'
|
||||||
. "<font face=\"$theme[font]\" size=\"-2\">(e.g. 1969)</font>";
|
;
|
||||||
|
$bday_year = '<input maxlength="4" name="bday_year" value="' . $year . '" size="4">';
|
||||||
} else {
|
} else {
|
||||||
$bday ="<select name=bday_month>"
|
$bday_month = "<select name=bday_month>"
|
||||||
. "<option value=\"\" SELECTED> </option>"
|
. "<option value=\"\" SELECTED> </option>"
|
||||||
. "<option value=1>January</option>"
|
. "<option value=1>January</option>"
|
||||||
. "<option value=2>February</option>"
|
. "<option value=2>February</option>"
|
||||||
@ -132,13 +133,15 @@
|
|||||||
. "<option value=11>November</option>"
|
. "<option value=11>November</option>"
|
||||||
. "<option value=12>December</option>"
|
. "<option value=12>December</option>"
|
||||||
. "</select>"
|
. "</select>"
|
||||||
. "<input maxlength=2 name=bday_day size=2>"
|
;
|
||||||
. "<input maxlength=4 name=bday_year size=4>"
|
$bday_day = '<input name="bday_day" size="2" maxlength="2">'
|
||||||
. "<font face=\"$theme[font]\" size=\"-2\">(e.g. 1969)</font>";
|
;
|
||||||
|
$bday_year = '<input name="bday_year" size="4" maxlength="4">'
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
$notes = "<TEXTAREA cols=\"60\" name=\"notes\" rows=\"4\">"
|
$notes = '<TEXTAREA cols="60" name="notes" rows="4">'
|
||||||
. $notes . "</TEXTAREA>";
|
. $notes . '</TEXTAREA>';
|
||||||
} else {
|
} else {
|
||||||
$notes = "<form><TEXTAREA cols=\"60\" name=\"notes\" rows=\"4\">"
|
$notes = "<form><TEXTAREA cols=\"60\" name=\"notes\" rows=\"4\">"
|
||||||
. $notes . "</TEXTAREA></form>";
|
. $notes . "</TEXTAREA></form>";
|
||||||
@ -203,9 +206,12 @@
|
|||||||
<font color="#000000" face="" size="-1"><?php echo lang("URL"); ?>:</font>
|
<font color="#000000" face="" size="-1"><?php echo lang("URL"); ?>:</font>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<font size="-1">
|
<input name="url" value="<?php
|
||||||
<?php echo $url; ?>
|
if (! ereg("^http://",$url)) {
|
||||||
</font>
|
echo "http://";
|
||||||
|
}
|
||||||
|
echo $url;
|
||||||
|
?>">
|
||||||
</td>
|
</td>
|
||||||
<td><font size="-1"></font></td>
|
<td><font size="-1"></font></td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -254,9 +260,11 @@
|
|||||||
</font></td>
|
</font></td>
|
||||||
<td><font face="" size="-1"><?php echo lang("Birthday"); ?>:</font></td>
|
<td><font face="" size="-1"><?php echo lang("Birthday"); ?>:</font></td>
|
||||||
<td>
|
<td>
|
||||||
<font size="-1">
|
<?php
|
||||||
<?php echo $bday; ?>
|
echo $phpgw->common->dateformatorder($bday_year,$bday_month,$bday_day)
|
||||||
</font> </td>
|
. '<font face="' . $theme["font"] . '" size="-2">(e.g. 1969)</font>';
|
||||||
|
?>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td><font face="" size="-1"><?php echo lang("Line 2"); ?>:</font></td>
|
<td><font face="" size="-1"><?php echo lang("Line 2"); ?>:</font></td>
|
||||||
|
@ -185,16 +185,19 @@
|
|||||||
|
|
||||||
// Some fields require special formating.
|
// Some fields require special formating.
|
||||||
if ($column[0] == "url") {
|
if ($column[0] == "url") {
|
||||||
|
if (! ereg("^http://",$field)) {
|
||||||
|
$data = "http://" . $field;
|
||||||
|
}
|
||||||
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="_new">' . $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="_new">' . $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 . '">' . $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">'
|
||||||
|
@ -19,6 +19,31 @@
|
|||||||
$phpgw_info["flags"]["currentapp"] = "addressbook";
|
$phpgw_info["flags"]["currentapp"] = "addressbook";
|
||||||
include("../header.inc.php");
|
include("../header.inc.php");
|
||||||
|
|
||||||
|
function checkfor_specialformat($field,$data)
|
||||||
|
{
|
||||||
|
global $phpgw_info, $phpgw;
|
||||||
|
|
||||||
|
if ($field == "email") {
|
||||||
|
if ($phpgw_info["user"]["apps"]["email"]) {
|
||||||
|
$s = '<a href="' . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/email/compose.php",
|
||||||
|
"to=" . urlencode($data)) . '" target="_new">' . $data . '</a>';
|
||||||
|
} else {
|
||||||
|
$s = '<a href="mailto:' . $data . '">' . $data . '</a>';
|
||||||
|
}
|
||||||
|
} else if ($field == "URL") {
|
||||||
|
if (! ereg("^http://",$data)) {
|
||||||
|
$data = "http://" . $data;
|
||||||
|
}
|
||||||
|
$s = '<a href="' . $data . '" target="_new">' . $data . '</a>';
|
||||||
|
} else if ($field == "birthday") {
|
||||||
|
$date = explode("/",$data);
|
||||||
|
$s = $phpgw->common->dateformatorder($date[2],$date[1],$date[0],True);
|
||||||
|
} else {
|
||||||
|
$s = $data . " ";
|
||||||
|
}
|
||||||
|
return $s;
|
||||||
|
}
|
||||||
|
|
||||||
if (! $ab_id) {
|
if (! $ab_id) {
|
||||||
Header("Location: " . $phpgw->link("index.php"));
|
Header("Location: " . $phpgw->link("index.php"));
|
||||||
}
|
}
|
||||||
@ -58,14 +83,16 @@
|
|||||||
if (! $columns_to_display[$i]["field_name"]) break;
|
if (! $columns_to_display[$i]["field_name"]) break;
|
||||||
|
|
||||||
$columns_html .= "<tr><td><b>" . lang($columns_to_display[$i]["field_name"]) . "</b>:</td>"
|
$columns_html .= "<tr><td><b>" . lang($columns_to_display[$i]["field_name"]) . "</b>:</td>"
|
||||||
. "<td>" . $columns_to_display[$i]["field_value"] . "</td>";
|
. "<td>" . checkfor_specialformat($columns_to_display[$i]["field_name"],$columns_to_display[$i]["field_value"])
|
||||||
|
. "</td>";
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
|
|
||||||
if (! $columns_to_display[$i]["field_name"]) break;
|
if (! $columns_to_display[$i]["field_name"]) break;
|
||||||
|
|
||||||
$columns_html .= "<td><b>" . lang($columns_to_display[$i]["field_name"]) . "</b>:</td>"
|
$columns_html .= "<tr><td><b>" . lang($columns_to_display[$i]["field_name"]) . "</b>:</td>"
|
||||||
. "<td>" . $columns_to_display[$i]["field_value"];
|
. "<td>" . checkfor_specialformat($columns_to_display[$i]["field_name"],$columns_to_display[$i]["field_value"])
|
||||||
|
. "</td>";
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
$columns_html .= "</td></tr>";
|
$columns_html .= "</td></tr>";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user