mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-25 01:13:25 +01:00
Added simple version management and added massive updates to the addressbook that were submited by neotexan, so that things will interact with his application better
This commit is contained in:
parent
930e6e1d83
commit
d08ca90692
@ -32,12 +32,14 @@
|
||||
$bday = "$bday_month/$bday_day/$bday_year";
|
||||
|
||||
$access = $phpgw->accounts->array_to_string($access,$n_groups);
|
||||
|
||||
$sql = "insert into addressbook (ab_owner,ab_access,ab_firstname,ab_lastname,ab_email,"
|
||||
. "ab_hphone,ab_wphone,ab_fax,ab_pager,ab_mphone,ab_ophone,ab_street,ab_city,ab_state,ab_zip,ab_bday,"
|
||||
. "ab_notes,ab_company) values ('" . $phpgw_info["user"]["userid"] . "','$access','"
|
||||
if($phpgw_info["apps"]["timetrack"]["enabled"]) {
|
||||
$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_state,ab_zip,ab_bday,"
|
||||
. "ab_notes,ab_company_id) values ('" . $phpgw_info["user"]["userid"] . "','$access','"
|
||||
. addslashes($firstname). "','"
|
||||
. addslashes($lastname) . "','"
|
||||
. addslashes($title) . "','"
|
||||
. addslashes($email) . "','"
|
||||
. addslashes($hphone) . "','"
|
||||
. addslashes($wphone) . "','"
|
||||
@ -46,12 +48,37 @@
|
||||
. addslashes($mphone) . "','"
|
||||
. addslashes($ophone) . "','"
|
||||
. addslashes($street) . "','"
|
||||
. addslashes($address2) . "','"
|
||||
. addslashes($city) . "','"
|
||||
. addslashes($state) . "','"
|
||||
. addslashes($zip) . "','"
|
||||
. addslashes($bday) . "','"
|
||||
. addslashes($notes) . "','"
|
||||
. addslashes($company). "')";
|
||||
} else {
|
||||
$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_state,ab_zip,ab_bday,"
|
||||
. "ab_notes,ab_company) values ('" . $phpgw_info["user"]["userid"] . "','$access','"
|
||||
. addslashes($firstname). "','"
|
||||
. addslashes($lastname) . "','"
|
||||
. addslashes($title) . "','"
|
||||
. addslashes($email) . "','"
|
||||
. addslashes($hphone) . "','"
|
||||
. addslashes($wphone) . "','"
|
||||
. addslashes($fax) . "','"
|
||||
. addslashes($pager) . "','"
|
||||
. addslashes($mphone) . "','"
|
||||
. addslashes($ophone) . "','"
|
||||
. addslashes($street) . "','"
|
||||
. addslashes($address2) . "','"
|
||||
. addslashes($city) . "','"
|
||||
. addslashes($state) . "','"
|
||||
. addslashes($zip) . "','"
|
||||
. addslashes($bday) . "','"
|
||||
. addslashes($notes) . "','"
|
||||
. addslashes($company). "')";
|
||||
}
|
||||
$phpgw->db->query($sql);
|
||||
|
||||
Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/addressbook/",
|
||||
|
@ -19,32 +19,32 @@
|
||||
$phpgw_info["flags"]["currentapp"] = "addressbook";
|
||||
include("../header.inc.php");
|
||||
|
||||
if (! $con) {
|
||||
if (! $ab_id) {
|
||||
Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/addressbook/"));
|
||||
}
|
||||
|
||||
if ($confirm != "true") {
|
||||
$phpgw->db->query("select owner from addressbook where con='$con'");
|
||||
$phpgw->db->query("select ab_owner from addressbook where ab_id='$ab_id'");
|
||||
$phpgw->db->next_record();
|
||||
|
||||
if ($phpgw->db->f("owner") != $phpgw_info["user"]["userid"])
|
||||
if ($phpgw->db->f("ab_owner") != $phpgw_info["user"]["userid"])
|
||||
Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/addressbook/"));
|
||||
|
||||
?>
|
||||
<body bgcolor=FFFFFF aLink=0000EE link=0000EE vlink=0000EE>
|
||||
<center><?php echo lang("Are you sure you want to delete this entry ?"); ?><center>
|
||||
<br><center><a href="<?php
|
||||
echo $phpgw->link("view.php","&con=$con&order=$order&sort=$sort&filter=$filter&start=$start&query=$query");
|
||||
echo $phpgw->link("view.php","&ab_id=$ab_id&order=$order&sort=$sort&filter=$filter&start=$start&query=$query");
|
||||
?>"><?php echo lang("NO"); ?></a>
|
||||
<a href="<?php echo $phpgw->link("delete.php","con=$con&confirm=true&order=$order&sort=$sort&filter=$filter&start=$start&query=$query");
|
||||
<a href="<?php echo $phpgw->link("delete.php","ab_id=$ab_id&confirm=true&order=$order&sort=$sort&filter=$filter&start=$start&query=$query");
|
||||
?>"><?php echo lang("YES"); ?></a><center>
|
||||
<?php
|
||||
|
||||
//exit;
|
||||
} else {
|
||||
|
||||
$phpgw->db->query("delete from addressbook where owner='" . $phpgw_info["user"]["userid"]
|
||||
. "' and con='$con'");
|
||||
$phpgw->db->query("delete from addressbook where ab_owner='" . $phpgw_info["user"]["userid"]
|
||||
. "' and ab_id='$ab_id'");
|
||||
Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"]. "/addressbook/",
|
||||
"cd=16&order=$order&sort=$sort&filter=$filter&start=$start&query=$query"));
|
||||
}
|
||||
|
@ -35,6 +35,7 @@
|
||||
'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"),
|
||||
@ -43,11 +44,13 @@
|
||||
'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"),
|
||||
'notes' => $phpgw->db->f("ab_notes")
|
||||
);
|
||||
|
||||
@ -55,11 +58,15 @@
|
||||
|
||||
} else {
|
||||
$bday = $bday_month . "/" . $bday_day . "/" . $bday_year;
|
||||
if ($access != "private" && $access != "public") {
|
||||
$access = $phpgw->accounts->array_to_string($access,$n_groups);
|
||||
}
|
||||
|
||||
if($phpgw_info["apps"]["timetrack"]["enabled"]) {
|
||||
$sql = "UPDATE addressbook set ab_email='" . addslashes($email)
|
||||
. "', ab_firstname='". addslashes($firstname)
|
||||
. "', ab_lastname='" . addslashes($lastname)
|
||||
. "', ab_title='" . addslashes($title)
|
||||
. "', ab_hphone='" . addslashes($hphone)
|
||||
. "', ab_wphone='" . addslashes($wphone)
|
||||
. "', ab_fax='" . addslashes($fax)
|
||||
@ -67,6 +74,28 @@
|
||||
. "', ab_mphone='" . addslashes($mphone)
|
||||
. "', ab_ophone='" . addslashes($ophone)
|
||||
. "', ab_street='" . addslashes($street)
|
||||
. "', ab_address2='" . addslashes($address2)
|
||||
. "', ab_city='" . addslashes($city)
|
||||
. "', ab_state='" . addslashes($state)
|
||||
. "', ab_zip='" . addslashes($zip)
|
||||
. "', ab_bday='" . addslashes($bday)
|
||||
. "', ab_notes='" . addslashes($notes)
|
||||
. "', ab_company_id='" . addslashes($company)
|
||||
. "', ab_access='" . addslashes($access)
|
||||
. "' WHERE ab_owner='" . $phpgw_info["user"]["userid"] . "' AND ab_id=$ab_id";
|
||||
} else {
|
||||
$sql = "UPDATE addressbook set ab_email='" . addslashes($email)
|
||||
. "', ab_firstname='". addslashes($firstname)
|
||||
. "', ab_lastname='" . addslashes($lastname)
|
||||
. "', ab_title='" . addslashes($title)
|
||||
. "', ab_hphone='" . addslashes($hphone)
|
||||
. "', ab_wphone='" . addslashes($wphone)
|
||||
. "', ab_fax='" . addslashes($fax)
|
||||
. "', ab_pager='" . addslashes($pager)
|
||||
. "', ab_mphone='" . addslashes($mphone)
|
||||
. "', ab_ophone='" . addslashes($ophone)
|
||||
. "', ab_street='" . addslashes($street)
|
||||
. "', ab_address2='" . addslashes($address2)
|
||||
. "', ab_city='" . addslashes($city)
|
||||
. "', ab_state='" . addslashes($state)
|
||||
. "', ab_zip='" . addslashes($zip)
|
||||
@ -75,6 +104,7 @@
|
||||
. "', ab_company='" . addslashes($company)
|
||||
. "', ab_access='" . addslashes($access)
|
||||
. "' WHERE ab_owner='" . $phpgw_info["user"]["userid"] . "' AND ab_id=$ab_id";
|
||||
}
|
||||
|
||||
$phpgw->db->query($sql);
|
||||
|
||||
|
@ -15,10 +15,12 @@
|
||||
function form($format,$action,$title,$fields)
|
||||
{
|
||||
global $phpgw;
|
||||
global $phpgw_info;
|
||||
|
||||
$email = $fields["email"];
|
||||
$firstname = $fields["firstname"];
|
||||
$lastname = $fields["lastname"];
|
||||
$title = $fields["title"];
|
||||
$hphone = $fields["hphone"];
|
||||
$wphone = $fields["wphone"];
|
||||
$fax = $fields["fax"];
|
||||
@ -26,18 +28,22 @@
|
||||
$mphone = $fields["mphone"];
|
||||
$ophone = $fields["ophone"];
|
||||
$street = $fields["street"];
|
||||
$address2 = $fields["address2"];
|
||||
$city = $fields["city"];
|
||||
$state = $fields["state"];
|
||||
$zip = $fields["zip"];
|
||||
$bday = $fields["bday"];
|
||||
$notes = $fields["notes"];
|
||||
$access = $fields["access"];
|
||||
$company = $fields["company"];
|
||||
$ab_company = $fields["company"];
|
||||
$company_id = $fields["company_id"];
|
||||
$company_name = $fields["company_name"];
|
||||
|
||||
if ($format != "view") {
|
||||
$email = "<input name=\"email\" value=\"$email\">";
|
||||
$firstname = "<input name=\"firstname\" value=\"$firstname\">";
|
||||
$lastname = "<input name=\"lastname\" value=\"$lastname\">";
|
||||
$title = "<input name=\"title\" value=\"$title\">";
|
||||
$hphone = "<input name=\"hphone\" value=\"$hphone\">";
|
||||
$wphone = "<input name=\"wphone\" value=\"$wphone\">";
|
||||
$fax = "<input name=\"fax\" value=\"$fax\">";
|
||||
@ -45,10 +51,25 @@
|
||||
$mphone = "<input name=\"mphone\" value=\"$mphone\">";
|
||||
$ophone = "<input name=\"ophone\" value=\"$ophone\">";
|
||||
$street = "<input name=\"street\" value=\"$street\">";
|
||||
$address2 = "<input name=\"address2\" value=\"$address2\">";
|
||||
$city = "<input name=\"city\" value=\"$city\">";
|
||||
$state = "<input name=\"state\" value=\"$state\">";
|
||||
$zip = "<input name=\"zip\" value=\"$zip\">";
|
||||
$company = "<input name=\"company\" value=\"$company\">";
|
||||
if($phpgw_info["apps"]["timetrack"]["enabled"]) {
|
||||
$company = '<select name="company">';
|
||||
$phpgw->db->query("select company_id,company_name from customers order by company_name");
|
||||
while ($phpgw->db->next_record()) {
|
||||
$ncust = $phpgw->db->f("company_id");
|
||||
$company = $company . '<option value="' . $ncust . '"';
|
||||
if ( $company_id == $ncust ) {
|
||||
$company = $company . " selected";
|
||||
}
|
||||
$company = $company . ">" . $phpgw->db->f("company_name") . "</option>";
|
||||
}
|
||||
$company = $company . "</select>";
|
||||
} else {
|
||||
$company = "<input name=\"company\" value=\"$ab_company\">";
|
||||
}
|
||||
|
||||
if (strlen($bday) > 2) {
|
||||
list( $month, $day, $year ) = split( '/', $bday );
|
||||
@ -100,12 +121,20 @@
|
||||
. $notes . "</TEXTAREA></form>";
|
||||
if ($bday == "//")
|
||||
$bday = "";
|
||||
if($phpgw_info["apps"]["timetrack"]["enabled"]) {
|
||||
$company = $company_name;
|
||||
} else {
|
||||
$company = $ab_company;
|
||||
}
|
||||
}
|
||||
|
||||
if ($action) {
|
||||
echo "<FORM action=\"".$phpgw->link($action)."\" method=\"post\">\n";
|
||||
}
|
||||
|
||||
// test:
|
||||
//echo "Time track app status = " . $phpgw_info["apps"]["timetrack"]["enabled"];
|
||||
|
||||
?>
|
||||
|
||||
<table width="75%" border="0" align="center">
|
||||
@ -123,13 +152,22 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<font color="#000000" face="" size="-1"><?php echo lang("E-mail"); ?>:</font>
|
||||
<font color="#000000" face="" size="-1"><?php echo lang("Title"); ?>:</font>
|
||||
</td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
<?php echo $title; ?>
|
||||
</font></td>
|
||||
<td>
|
||||
<font color="#000000" face="" size="-1"><?php echo lang("E-mail"); ?>:
|
||||
</td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
<?php echo $email; ?>
|
||||
</font></td>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><font color="#000000" face="" size="-1"><?php echo lang("Company Name"); ?>:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
@ -185,6 +223,15 @@
|
||||
<?php echo $bday; ?>
|
||||
</font> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><font face="" size="-1"><?php echo lang("Line 2"); ?>:</font></td>
|
||||
<td>
|
||||
<font size="-1">
|
||||
<?php echo $address2; ?>
|
||||
</font></td>
|
||||
<td><font size="-1"></font></td>
|
||||
<td><font size="-1"></font></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><font face="" size="-1"><?php echo lang("City"); ?>:</font></td>
|
||||
<td>
|
||||
|
@ -17,6 +17,7 @@
|
||||
include("../header.inc.php");
|
||||
|
||||
echo "<center>" . lang("Address book");
|
||||
//echo "<br>Time track = " . $phpgw_info["apps"]["timetrack"]["enabled"];
|
||||
|
||||
if (! $start)
|
||||
$start = 0;
|
||||
@ -44,11 +45,25 @@
|
||||
}
|
||||
|
||||
if ($query) {
|
||||
$phpgw->db->query("select count(*) from addressbook where $filtermethod AND (ab_lastname "
|
||||
. "like '%$query%' OR ab_firstname like '%$query%' OR ab_email like '%$query%"
|
||||
. "' OR ab_street like '%$query%' OR ab_city like '%$query%' OR ab_state like '"
|
||||
. "%$query%' OR ab_zip like '%$query%' OR ab_notes like '%$query%' OR ab_company"
|
||||
. " like '%$query%')");
|
||||
if ($phpgw_info["apps"]["timetrack"]["enabled"]){
|
||||
$phpgw->db->query("SELECT count(*) "
|
||||
. "from addressbook as a, customers as c where a.ab_company_id = c.company_id "
|
||||
. "AND $filtermethod AND (a.ab_lastname like '"
|
||||
. "%$query%' OR a.ab_firstname like '%$query%' OR a.ab_email like '%$query%' OR "
|
||||
. "a.ab_street like '%$query%' OR a.ab_city like '%$query%' OR a.ab_state "
|
||||
. "like '%$query%' OR a.ab_zip like '%$query%' OR a.ab_notes like "
|
||||
. "'%$query%' OR c.company_name like '%$query%')"
|
||||
. " $ordermethod limit $limit");
|
||||
} else {
|
||||
$phpgw->db->query("SELECT count(*) "
|
||||
. "from addressbook "
|
||||
. "WHERE $filtermethod AND (ab_lastname like '"
|
||||
. "%$query%' OR ab_firstname like '%$query%' OR ab_email like '%$query%' OR "
|
||||
. "ab_street like '%$query%' OR ab_city like '%$query%' OR ab_state "
|
||||
. "like '%$query%' OR ab_zip like '%$query%' OR ab_notes like "
|
||||
. "'%$query%' OR ab_company like '%$query%')"
|
||||
. " $ordermethod limit $limit");
|
||||
}
|
||||
|
||||
$phpgw->db->next_record();
|
||||
|
||||
@ -58,9 +73,14 @@
|
||||
echo "<br>" . lang("your search returned x matchs",$phpgw->db->f(0));
|
||||
} else {
|
||||
$phpgw->db->query("select count(*) from addressbook where $filtermethod");
|
||||
}
|
||||
|
||||
$phpgw->db->next_record();
|
||||
}
|
||||
if($phpgw_info["apps"]["timetrack"]["enabled"])
|
||||
$company_sortorder = "c.company_name";
|
||||
else
|
||||
$company_sortorder = "ab_company";
|
||||
|
||||
//$phpgw->db->next_record();
|
||||
|
||||
if ($phpgw->db->f(0) > $phpgw_info["user"]["preferences"]["maxmatchs"])
|
||||
echo "<br>" . lang("showing x - x of x",($start + 1),
|
||||
@ -80,7 +100,7 @@
|
||||
if ( $phpgw_info["user"]["preferences"]["addressbook_view_company"] == "True" ) {
|
||||
echo '<td height="21">';
|
||||
echo '<font size="-1" face="Arial, Helvetica, sans-serif">';
|
||||
echo $phpgw->nextmatchs->show_sort_order($sort,"ab_company",$order,"index.php",lang("Company Name"));
|
||||
echo $phpgw->nextmatchs->show_sort_order($sort,$company_sortorder,$order,"index.php",lang("Company Name"));
|
||||
echo '</font></td>';
|
||||
}
|
||||
if ( $phpgw_info["user"]["preferences"]["addressbook_view_lastname"] == "True" ) {
|
||||
@ -129,13 +149,37 @@
|
||||
|
||||
<?php
|
||||
if ($query) {
|
||||
$phpgw->db->query("SELECT * FROM addressbook WHERE $filtermethod AND (ab_lastname like '"
|
||||
if($phpgw_info["apps"]["timetrack"]["enabled"]){
|
||||
$phpgw->db->query("SELECT a.ab_id,a.ab_owner,a.ab_firstname,a.ab_lastname,"
|
||||
. "a.ab_email,a.ab_wphone,c.company_name "
|
||||
. "from addressbook as a, customers as c where a.ab_company_id = c.company_id "
|
||||
. "AND $filtermethod AND (a.ab_lastname like '"
|
||||
. "%$query%' OR a.ab_firstname like '%$query%' OR a.ab_email like '%$query%' OR "
|
||||
. "a.ab_street like '%$query%' OR a.ab_city like '%$query%' OR a.ab_state "
|
||||
. "like '%$query%' OR a.ab_zip like '%$query%' OR a.ab_notes like "
|
||||
. "'%$query%' OR c.company_name like '%$query%') $ordermethod limit $limit");
|
||||
} else {
|
||||
$phpgw->db->query("SELECT ab_id,ab_owner,ab_firstname,ab_lastname,"
|
||||
. "ab_email,ab_wphone,ab_company "
|
||||
. "from addressbook "
|
||||
. "WHERE $filtermethod AND (ab_lastname like '"
|
||||
. "%$query%' OR ab_firstname like '%$query%' OR ab_email like '%$query%' OR "
|
||||
. "ab_street like '%$query%' OR ab_city like '%$query%' OR ab_state "
|
||||
. "like '%$query%' OR ab_zip like '%$query%' OR ab_notes like "
|
||||
. "'%$query%' OR ab_company like '%$query%') $ordermethod limit $limit");
|
||||
}
|
||||
} else {
|
||||
$phpgw->db->query("SELECT * FROM addressbook WHERE $filtermethod $ordermethod limit $limit");
|
||||
if($phpgw_info["apps"]["timetrack"]["enabled"]){
|
||||
$phpgw->db->query("SELECT a.ab_id,a.ab_owner,a.ab_firstname,a.ab_lastname,"
|
||||
. "a.ab_email,a.ab_wphone,c.company_name "
|
||||
. "from addressbook as a, customers as c where a.ab_company_id = c.company_id "
|
||||
. "AND $filtermethod $ordermethod limit $limit");
|
||||
} else {
|
||||
$phpgw->db->query("SELECT ab_id,ab_owner,ab_firstname,ab_lastname,"
|
||||
. "ab_email,ab_wphone,ab_company "
|
||||
. "from addressbook "
|
||||
. "WHERE $filtermethod $ordermethod limit $limit");
|
||||
}
|
||||
}
|
||||
|
||||
while ($phpgw->db->next_record()) {
|
||||
@ -144,7 +188,10 @@
|
||||
$firstname = $phpgw->db->f("ab_firstname");
|
||||
$lastname = $phpgw->db->f("ab_lastname");
|
||||
$email = $phpgw->db->f("ab_email");
|
||||
$company = $phpgw->db->f("ab_company");
|
||||
if($phpgw_info["apps"]["timetrack"]["enabled"])
|
||||
$company = $phpgw->db->f("company_name");
|
||||
else
|
||||
$company = $phpgw->db->f("company");
|
||||
$wphone = $phpgw->db->f("ab_wphone");
|
||||
$ab_id = $phpgw->db->f("ab_id");
|
||||
|
||||
@ -178,7 +225,7 @@
|
||||
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 '<a href="mailto:' . $email . '">' . $email . '</a>';
|
||||
echo '</font></td>';
|
||||
};
|
||||
if ( $phpgw_info["user"]["preferences"]["addressbook_view_wphone"] == 'True' ) {
|
||||
|
@ -26,8 +26,15 @@
|
||||
if ($filter != "private")
|
||||
$filtermethod = " or ab_access='public' " . $phpgw->accounts->sql_search("ab_access");
|
||||
|
||||
$phpgw->db->query("SELECT * FROM addressbook WHERE ab_id=$ab_id AND (ab_owner='"
|
||||
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 "
|
||||
. "AND ab_id=$ab_id AND (ab_owner='"
|
||||
. $phpgw_info["user"]["userid"] . "' $filtermethod)");
|
||||
} else {
|
||||
$phpgw->db->query("SELECT * FROM addressbook "
|
||||
. "WHERE ab_id=$ab_id AND (ab_owner='"
|
||||
. $phpgw_info["user"]["userid"] . "' $filtermethod)");
|
||||
}
|
||||
$phpgw->db->next_record();
|
||||
|
||||
$fields = array('ab_id' => $phpgw->db->f("ab_id"),
|
||||
@ -35,6 +42,7 @@
|
||||
'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"),
|
||||
@ -43,11 +51,14 @@
|
||||
'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")
|
||||
);
|
||||
|
||||
|
@ -37,6 +37,8 @@
|
||||
/**************************************************************************\
|
||||
* Do not edit these lines *
|
||||
\**************************************************************************/
|
||||
include($phpgw_info["server"]["server_root"]."/version.inc.php");
|
||||
$phpgw_info["server"]["header_version"] = "1.1";
|
||||
if (!$phpgw_info["flags"]["noapi"] == True){
|
||||
include($phpgw_info["server"]["include_root"] . "/phpgwapi/phpgw.inc.php");
|
||||
}
|
||||
|
@ -86,7 +86,7 @@
|
||||
loginid varchar(30),
|
||||
ip varchar(30),
|
||||
li int,
|
||||
lo int
|
||||
lo varchar(255)
|
||||
)";
|
||||
$db->query($sql);
|
||||
|
||||
@ -103,7 +103,7 @@
|
||||
$db->query($sql);
|
||||
|
||||
$sql = "CREATE TABLE addressbook (
|
||||
ab_id int(11) DEFAULT '0' NOT NULL auto_increment,
|
||||
ab_id int(11) NOT NULL auto_increment,
|
||||
ab_owner varchar(25),
|
||||
ab_access varchar(10),
|
||||
ab_firstname varchar(255),
|
||||
@ -122,10 +122,30 @@
|
||||
ab_bday varchar(255),
|
||||
ab_notes text,
|
||||
ab_company varchar(255),
|
||||
ab_company_id int(10) unsigned,
|
||||
ab_title varchar(60),
|
||||
ab_address2 varchar(60),
|
||||
PRIMARY KEY (ab_id)
|
||||
)";
|
||||
$db->query($sql);
|
||||
|
||||
|
||||
$sql = "CREATE TABLE customers (
|
||||
company_id int(10) unsigned NOT NULL auto_increment,
|
||||
company_name varchar(255),
|
||||
website varchar(80),
|
||||
ftpsite varchar(80),
|
||||
industry_type varchar(50),
|
||||
status varchar(30),
|
||||
software varchar(40),
|
||||
lastjobnum int(10) unsigned,
|
||||
lastjobfinished date,
|
||||
busrelationship varchar(30),
|
||||
notes text,
|
||||
PRIMARY KEY (company_id)
|
||||
);";
|
||||
$db->query($sql);
|
||||
|
||||
$sql = "CREATE TABLE todo (
|
||||
todo_id int(11) DEFAULT '0' NOT NULL auto_increment,
|
||||
todo_owner varchar(25),
|
||||
|
@ -86,7 +86,7 @@
|
||||
loginid varchar(30),
|
||||
ip varchar(30),
|
||||
li int,
|
||||
lo int
|
||||
lo varchar(255)
|
||||
)";
|
||||
$db->query($sql);
|
||||
|
||||
@ -121,6 +121,9 @@
|
||||
ab_bday varchar(255),
|
||||
ab_notes TEXT,
|
||||
ab_company varchar(255)
|
||||
ab_company_id int(10) unsigned,
|
||||
ab_title varchar(60),
|
||||
ab_address2 varchar(60),
|
||||
)";
|
||||
$db->query($sql);
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
/* $Id$ */
|
||||
|
||||
function add_default_server_config(){
|
||||
global $db, $newversion;
|
||||
global $db, $phpgw_info;
|
||||
$db->query("insert into config (config_name, config_value) values ('default_tplset', 'default')");
|
||||
$db->query("insert into config (config_name, config_value) values ('temp_dir', '/path/to/tmp')");
|
||||
$db->query("insert into config (config_name, config_value) values ('files_dir', '/path/to/dir/phpgroupware/files')");
|
||||
@ -94,18 +94,18 @@
|
||||
}else{
|
||||
add_default_server_config();
|
||||
}
|
||||
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('admin', 'Administration', 1, 1, NULL, '$newversion')");
|
||||
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('admin', 'Administration', 1, 1, NULL, '".$phpgw_info["server"]["version"]."')");
|
||||
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('tts', 'Trouble Ticket System', 0, 2, NULL, '0.0.0')");
|
||||
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('inv', 'Inventory', 0, 3, NULL, '0.0.0')");
|
||||
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('chat', 'Chat', 0, 4, NULL, '0.0.0')");
|
||||
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('headlines', 'Headlines', 0, 5, 'news_sites,news_headlines,users_headlines', '0.0.0')");
|
||||
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('filemanager', 'File manager', 1, 6, NULL, '$newversion')");
|
||||
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('addressbook', 'Address Book', 1, 7, 'addressbook', '$newversion')");
|
||||
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('todo', 'ToDo List', 1, 8, 'todo', '$newversion')");
|
||||
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('calendar', 'Calendar', 1, 9, 'webcal_entry,webcal_entry_users,webcal_entry_groups,webcal_repeats', '$newversion')");
|
||||
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('email', 'Email', 1, 10,NULL, '$newversion')");
|
||||
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('nntp', 'NNTP', 1, 11, 'newsgroups,users_newsgroups', '$newversion')");
|
||||
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('cron_apps', 'cron_apps', 0, 0, NULL, '$newversion')");
|
||||
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('filemanager', 'File manager', 1, 6, NULL, '".$phpgw_info["server"]["version"]."')");
|
||||
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('addressbook', 'Address Book', 1, 7, 'addressbook', '".$phpgw_info["server"]["version"]."')");
|
||||
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('todo', 'ToDo List', 1, 8, 'todo', '".$phpgw_info["server"]["version"]."')");
|
||||
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('calendar', 'Calendar', 1, 9, 'webcal_entry,webcal_entry_users,webcal_entry_groups,webcal_repeats', '".$phpgw_info["server"]["version"]."')");
|
||||
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('email', 'Email', 1, 10,NULL, '".$phpgw_info["server"]["version"]."')");
|
||||
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('nntp', 'NNTP', 1, 11, 'newsgroups,users_newsgroups', '".$phpgw_info["server"]["version"]."')");
|
||||
$db->query("insert into applications (app_name, app_title, app_enabled, app_order, app_tables, app_version) values ('cron_apps', 'cron_apps', 0, 0, NULL, '".$phpgw_info["server"]["version"]."')");
|
||||
|
||||
$db->query("insert into accounts (account_lid,account_pwd,account_firstname,account_lastname,account_permissions,account_groups,account_status) values ('demo','81dc9bdb52d04dc20036dbd8313ed055','Demo','Account',':admin:email:todo:addressbook:calendar:',',1,','A')");
|
||||
|
||||
|
@ -11,9 +11,6 @@
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/* !!! This needs to be changed each time we do an update !!! */
|
||||
$newversion = "0.9.2";
|
||||
|
||||
$phpgw_info["flags"] = array("noheader" => True, "nonavbar" => True, "currentapp" => "home", "noapi" => True);
|
||||
include("../header.inc.php");
|
||||
|
||||
@ -70,7 +67,7 @@
|
||||
echo " </tr>\n";
|
||||
echo " <tr bgcolor=\"e6e6e6\">\n";
|
||||
echo " <td>You appear to be running version $oldversion of phpGroupWare.<br>\n";
|
||||
echo " We will automaticly update your tables/records to $newversion, but we highly recommend backing up your tables incase the script causes damage to your data.\n";
|
||||
echo " We will automaticly update your tables/records to ".$phpgw_info["server"]["version"].", but we highly recommend backing up your tables incase the script causes damage to your data.\n";
|
||||
echo " These automated scripts can easily destroy your data. Please backup before going any further!</td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " </tr>\n";
|
||||
@ -192,7 +189,7 @@
|
||||
break;
|
||||
default:
|
||||
if (isset($oldversion)){
|
||||
if ($newversion == $oldversion){
|
||||
if ($phpgw_info["server"]["version"] == $oldversion){
|
||||
echo "<html><head><title>phpGroupWare Setup</title></head>\n";
|
||||
echo "<body bgcolor='#ffffff'>\n";
|
||||
echo "<table border=\"0\" align=\"center\">\n";
|
||||
|
@ -99,7 +99,7 @@
|
||||
}
|
||||
}
|
||||
function v9072000to0_9_1(){
|
||||
global $currentver, $newversion, $db;
|
||||
global $currentver, $phpgw_info, $db;
|
||||
$didupgrade = True;
|
||||
if ($currentver == "9072000"){
|
||||
|
||||
@ -181,22 +181,42 @@
|
||||
echo " <tr bgcolor=\"e6e6e6\">\n";
|
||||
echo " <td>Upgrade from 9072000 to 0.9.1 is completed.</td>\n";
|
||||
echo " </tr>\n";
|
||||
$currentver = "0_9_1";
|
||||
$currentver = "0.9.1";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function v0_9_1to0_9_2()
|
||||
{
|
||||
global $currentver, $newversion, $db;
|
||||
function v0_9_1to0_9_2pre1(){
|
||||
global $currentver, $phpgw_info, $db;
|
||||
$didupgrade = True;
|
||||
if ($currentver == "9072000") {
|
||||
if ($currentver == "0.9.1"){
|
||||
|
||||
$db->query("alter table access_log change lo lo varchar(255)");
|
||||
}
|
||||
$db->query("alter table addressbook change ab_id ab_id int(11) NOT NULL auto_increment");
|
||||
$db->query("alter table addressbook add ab_company_id int(10) unsigned");
|
||||
$db->query("alter table addressbook add ab_title varchar(60)");
|
||||
$db->query("alter table addressbook add ab_address2 varchar(60)");
|
||||
|
||||
$sql = "CREATE TABLE customers (
|
||||
company_id int(10) unsigned NOT NULL auto_increment,
|
||||
company_name varchar(255),
|
||||
website varchar(80),
|
||||
ftpsite varchar(80),
|
||||
industry_type varchar(50),
|
||||
status varchar(30),
|
||||
software varchar(40),
|
||||
lastjobnum int(10) unsigned,
|
||||
lastjobfinished date,
|
||||
busrelationship varchar(30),
|
||||
notes text,
|
||||
PRIMARY KEY (company_id)
|
||||
);";
|
||||
$db->query($sql);
|
||||
|
||||
echo " <tr bgcolor=\"e6e6e6\">\n";
|
||||
echo " <td>Upgrade from 0.9.1 to 0.9.2 is completed.</td>\n";
|
||||
echo " <td>Upgrade from 0.9.1 to 0.9.2pre1 is completed.</td>\n";
|
||||
echo " </tr>\n";
|
||||
$currentver = "0_9_2";
|
||||
$currentver = "0.9.2pre1";
|
||||
}
|
||||
}
|
||||
|
||||
echo "<table border=\"0\" align=\"center\">\n";
|
||||
@ -209,8 +229,8 @@
|
||||
v8212000to9052000();
|
||||
v9052000to9072000();
|
||||
v9072000to0_9_1();
|
||||
v0_9_1to0_9_2();
|
||||
$db->query("update applications set app_version='$newversion' where (app_name='admin' or app_name='filemanager' or app_name='addressbook' or app_name='todo' or app_name='calendar' or app_name='email' or app_name='nntp' or app_name='cron_apps')");
|
||||
v0_9_1to0_9_2pre1();
|
||||
$db->query("update applications set app_version='".$phpgw_info["server"]["version"]."' where (app_name='admin' or app_name='filemanager' or app_name='addressbook' or app_name='todo' or app_name='calendar' or app_name='email' or app_name='nntp' or app_name='cron_apps')");
|
||||
|
||||
if (!$didupgrade == True){
|
||||
echo " <tr bgcolor=\"e6e6e6\">\n";
|
||||
|
1
version.inc.php
Normal file
1
version.inc.php
Normal file
@ -0,0 +1 @@
|
||||
<?php $phpgw_info["server"]["version"] = "0.9.2pre1"; ?>
|
Loading…
Reference in New Issue
Block a user