summaryrefslogtreecommitdiff
path: root/program/steps/addressbook
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2005-12-03 16:54:12 +0000
committerthomascube <thomas@roundcube.net>2005-12-03 16:54:12 +0000
commit1cded85790206afe084e1baff371c543711b2b18 (patch)
treeb050fb89707e048df5f30f500faad792962a1e81 /program/steps/addressbook
parent5bc8cb662fc3bcda9aa641b7a5e88c0b81dd63d6 (diff)
Re-design of caching (new database table added\!); some bugfixes; Postgres support
Diffstat (limited to 'program/steps/addressbook')
-rw-r--r--program/steps/addressbook/delete.inc6
-rw-r--r--program/steps/addressbook/edit.inc2
-rw-r--r--program/steps/addressbook/func.inc6
-rw-r--r--program/steps/addressbook/list.inc4
-rw-r--r--program/steps/addressbook/save.inc12
-rw-r--r--program/steps/addressbook/show.inc2
6 files changed, 16 insertions, 16 deletions
diff --git a/program/steps/addressbook/delete.inc b/program/steps/addressbook/delete.inc
index a3fcefbf7..b95988d12 100644
--- a/program/steps/addressbook/delete.inc
+++ b/program/steps/addressbook/delete.inc
@@ -24,7 +24,7 @@ $REMOTE_REQUEST = TRUE;
if ($_GET['_cid'])
{
$DB->query("UPDATE ".get_table_name('contacts')."
- SET del='1'
+ SET del=1
WHERE user_id=?
AND contact_id IN (".$_GET['_cid'].")",
$_SESSION['user_id']);
@@ -40,7 +40,7 @@ if ($_GET['_cid'])
// count contacts for this user
$sql_result = $DB->query("SELECT COUNT(contact_id) AS rows
FROM ".get_table_name('contacts')."
- WHERE del<>'1'
+ WHERE del<>1
AND user_id=?",
$_SESSION['user_id']);
@@ -60,7 +60,7 @@ if ($_GET['_cid'])
// get contacts from DB
$sql_result = $DB->limitquery("SELECT * FROM ".get_table_name('contacts')."
- WHERE del<>'1'
+ WHERE del<>1
AND user_id=?
ORDER BY name",
$start_row,
diff --git a/program/steps/addressbook/edit.inc b/program/steps/addressbook/edit.inc
index feb794f4d..a129d0094 100644
--- a/program/steps/addressbook/edit.inc
+++ b/program/steps/addressbook/edit.inc
@@ -26,7 +26,7 @@ if (($_GET['_cid'] || $_POST['_cid']) && $_action=='edit')
$DB->query("SELECT * FROM ".get_table_name('contacts')."
WHERE contact_id=?
AND user_id=?
- AND del<>'1'",
+ AND del<>1",
$cid,
$_SESSION['user_id']);
diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc
index 4cc79bad6..8065219b0 100644
--- a/program/steps/addressbook/func.inc
+++ b/program/steps/addressbook/func.inc
@@ -43,7 +43,7 @@ function rcmail_contacts_list($attrib)
// count contacts for this user
$sql_result = $DB->query("SELECT COUNT(contact_id) AS rows
FROM ".get_table_name('contacts')."
- WHERE del<>'1'
+ WHERE del<>1
AND user_id=?",
$_SESSION['user_id']);
@@ -56,7 +56,7 @@ function rcmail_contacts_list($attrib)
// get contacts from DB
$sql_result = $DB->limitquery("SELECT * FROM ".get_table_name('contacts')."
- WHERE del<>'1'
+ WHERE del<>1
AND user_id= ?
ORDER BY name",
$start_row,
@@ -173,7 +173,7 @@ function rcmail_get_rowcount_text($max=NULL)
if ($max===NULL)
{
$sql_result = $DB->query("SELECT 1 FROM ".get_table_name('contacts')."
- WHERE del<>'1'
+ WHERE del<>1
AND user_id=?",
$_SESSION['user_id']);
diff --git a/program/steps/addressbook/list.inc b/program/steps/addressbook/list.inc
index ecb634b6f..0aa4873b3 100644
--- a/program/steps/addressbook/list.inc
+++ b/program/steps/addressbook/list.inc
@@ -24,7 +24,7 @@ $REMOTE_REQUEST = TRUE;
// count contacts for this user
$sql_result = $DB->query("SELECT COUNT(contact_id) AS rows
FROM ".get_table_name('contacts')."
- WHERE del<>'1'
+ WHERE del<>1
AND user_id=?",
$_SESSION['user_id']);
@@ -40,7 +40,7 @@ $start_row = ($CONTACTS_LIST['page']-1) * $CONFIG['pagesize'];
// get contacts from DB
$sql_result = $DB->limitquery("SELECT * FROM ".get_table_name('contacts')."
- WHERE del<>'1'
+ WHERE del<>1
AND user_id=?
ORDER BY name",
$start_row,
diff --git a/program/steps/addressbook/save.inc b/program/steps/addressbook/save.inc
index 2f54e435b..f5ba139b9 100644
--- a/program/steps/addressbook/save.inc
+++ b/program/steps/addressbook/save.inc
@@ -52,7 +52,7 @@ if ($_POST['_cid'])
SET changed=now(), ".join(', ', $a_write_sql)."
WHERE contact_id=?
AND user_id=?
- AND del<>'1'",
+ AND del<>1",
$_POST['_cid'],
$_SESSION['user_id']);
@@ -73,7 +73,7 @@ if ($_POST['_cid'])
$sql_result = $DB->query("SELECT * FROM ".get_table_name('contacts')."
WHERE contact_id=?
AND user_id=?
- AND del<>'1'",
+ AND del<>1",
$_POST['_cid'],
$_SESSION['user_id']);
@@ -109,7 +109,7 @@ else
$sql_result = $DB->query("SELECT 1 FROM ".get_table_name('contacts')."
WHERE user_id=?
AND email=?
- AND del<>'1'",
+ AND del<>1",
$_SESSION['user_id'],
$_POST['_email']);
@@ -134,11 +134,11 @@ else
if (sizeof($a_insert_cols))
{
$DB->query("INSERT INTO ".get_table_name('contacts')."
- (user_id, changed, ".join(', ', $a_insert_cols).")
- VALUES (?, now(), ".join(', ', $a_insert_values).")",
+ (user_id, changed, del, ".join(', ', $a_insert_cols).")
+ VALUES (?, now(), 0, ".join(', ', $a_insert_values).")",
$_SESSION['user_id']);
- $insert_id = $DB->insert_id();
+ $insert_id = $DB->insert_id(get_sequence_name('contacts'));
}
if ($insert_id)
diff --git a/program/steps/addressbook/show.inc b/program/steps/addressbook/show.inc
index 83db486cc..960ea1c45 100644
--- a/program/steps/addressbook/show.inc
+++ b/program/steps/addressbook/show.inc
@@ -26,7 +26,7 @@ if ($_GET['_cid'] || $_POST['_cid'])
$DB->query("SELECT * FROM ".get_table_name('contacts')."
WHERE contact_id=?
AND user_id=?
- AND del<>'1'",
+ AND del<>1",
$cid,
$_SESSION['user_id']);