summaryrefslogtreecommitdiff
path: root/program/include/rcube_contacts.php
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2012-04-13 08:52:02 +0000
committeralecpl <alec@alec.pl>2012-04-13 08:52:02 +0000
commit0c259682f65eaaf23ea4ccb56a706d6baf3007e4 (patch)
treef1491f39189c8a970e7612b9dcc20f9409d7361e /program/include/rcube_contacts.php
parentce64332e7a9bf2468eabdb4b789270aebb3e7dc7 (diff)
- Merge devel-framework branch, resolved conflicts
Diffstat (limited to 'program/include/rcube_contacts.php')
-rw-r--r--program/include/rcube_contacts.php42
1 files changed, 21 insertions, 21 deletions
diff --git a/program/include/rcube_contacts.php b/program/include/rcube_contacts.php
index c30751faf..8834a7dbc 100644
--- a/program/include/rcube_contacts.php
+++ b/program/include/rcube_contacts.php
@@ -153,7 +153,7 @@ class rcube_contacts extends rcube_addressbook
$sql_filter = $search ? " AND " . $this->db->ilike('name', '%'.$search.'%') : '';
$sql_result = $this->db->query(
- "SELECT * FROM ".get_table_name($this->db_groups).
+ "SELECT * FROM ".$this->db->table_name($this->db_groups).
" WHERE del<>1".
" AND user_id=?".
$sql_filter.
@@ -178,7 +178,7 @@ class rcube_contacts extends rcube_addressbook
function get_group($group_id)
{
$sql_result = $this->db->query(
- "SELECT * FROM ".get_table_name($this->db_groups).
+ "SELECT * FROM ".$this->db->table_name($this->db_groups).
" WHERE del<>1".
" AND contactgroup_id=?".
" AND user_id=?",
@@ -214,7 +214,7 @@ class rcube_contacts extends rcube_addressbook
$length = $subset != 0 ? abs($subset) : $this->page_size;
if ($this->group_id)
- $join = " LEFT JOIN ".get_table_name($this->db_groupmembers)." AS m".
+ $join = " LEFT JOIN ".$this->db->table_name($this->db_groupmembers)." AS m".
" ON (m.contact_id = c.".$this->primary_key.")";
$order_col = (in_array($this->sort_col, $this->table_cols) ? $this->sort_col : 'name');
@@ -228,7 +228,7 @@ class rcube_contacts extends rcube_addressbook
$order_cols[] = 'c.email';
$sql_result = $this->db->limitquery(
- "SELECT * FROM ".get_table_name($this->db_name)." AS c" .
+ "SELECT * FROM ".$this->db->table_name($this->db_name)." AS c" .
$join .
" WHERE c.del<>1" .
" AND c.user_id=?" .
@@ -488,13 +488,13 @@ class rcube_contacts extends rcube_addressbook
private function _count()
{
if ($this->group_id)
- $join = " LEFT JOIN ".get_table_name($this->db_groupmembers)." AS m".
+ $join = " LEFT JOIN ".$this->db->table_name($this->db_groupmembers)." AS m".
" ON (m.contact_id=c.".$this->primary_key.")";
// count contacts for this user
$sql_result = $this->db->query(
"SELECT COUNT(c.contact_id) AS rows".
- " FROM ".get_table_name($this->db_name)." AS c".
+ " FROM ".$this->db->table_name($this->db_name)." AS c".
$join.
" WHERE c.del<>1".
" AND c.user_id=?".
@@ -536,7 +536,7 @@ class rcube_contacts extends rcube_addressbook
return $assoc ? $first : $this->result;
$this->db->query(
- "SELECT * FROM ".get_table_name($this->db_name).
+ "SELECT * FROM ".$this->db->table_name($this->db_name).
" WHERE contact_id=?".
" AND user_id=?".
" AND del<>1",
@@ -568,8 +568,8 @@ class rcube_contacts extends rcube_addressbook
return $results;
$sql_result = $this->db->query(
- "SELECT cgm.contactgroup_id, cg.name FROM " . get_table_name($this->db_groupmembers) . " AS cgm" .
- " LEFT JOIN " . get_table_name($this->db_groups) . " AS cg ON (cgm.contactgroup_id = cg.contactgroup_id AND cg.del<>1)" .
+ "SELECT cgm.contactgroup_id, cg.name FROM " . $this->db->table_name($this->db_groupmembers) . " AS cgm" .
+ " LEFT JOIN " . $this->db->table_name($this->db_groups) . " AS cg ON (cgm.contactgroup_id = cg.contactgroup_id AND cg.del<>1)" .
" WHERE cgm.contact_id=?",
$id
);
@@ -638,7 +638,7 @@ class rcube_contacts extends rcube_addressbook
if (!$existing->count && !empty($a_insert_cols)) {
$this->db->query(
- "INSERT INTO ".get_table_name($this->db_name).
+ "INSERT INTO ".$this->db->table_name($this->db_name).
" (user_id, changed, del, ".join(', ', $a_insert_cols).")".
" VALUES (".intval($this->user_id).", ".$this->db->now().", 0, ".join(', ', $a_insert_values).")"
);
@@ -676,7 +676,7 @@ class rcube_contacts extends rcube_addressbook
if (!empty($write_sql)) {
$this->db->query(
- "UPDATE ".get_table_name($this->db_name).
+ "UPDATE ".$this->db->table_name($this->db_name).
" SET changed=".$this->db->now().", ".join(', ', $write_sql).
" WHERE contact_id=?".
" AND user_id=?".
@@ -772,7 +772,7 @@ class rcube_contacts extends rcube_addressbook
// flag record as deleted (always)
$this->db->query(
- "UPDATE ".get_table_name($this->db_name).
+ "UPDATE ".$this->db->table_name($this->db_name).
" SET del=1, changed=".$this->db->now().
" WHERE user_id=?".
" AND contact_id IN ($ids)",
@@ -799,7 +799,7 @@ class rcube_contacts extends rcube_addressbook
// clear deleted flag
$this->db->query(
- "UPDATE ".get_table_name($this->db_name).
+ "UPDATE ".$this->db->table_name($this->db_name).
" SET del=0, changed=".$this->db->now().
" WHERE user_id=?".
" AND contact_id IN ($ids)",
@@ -819,7 +819,7 @@ class rcube_contacts extends rcube_addressbook
{
$this->cache = null;
- $this->db->query("UPDATE ".get_table_name($this->db_name).
+ $this->db->query("UPDATE ".$this->db->table_name($this->db_name).
" SET del=1, changed=".$this->db->now().
" WHERE user_id = ?", $this->user_id);
@@ -841,7 +841,7 @@ class rcube_contacts extends rcube_addressbook
$name = $this->unique_groupname($name);
$this->db->query(
- "INSERT INTO ".get_table_name($this->db_groups).
+ "INSERT INTO ".$this->db->table_name($this->db_groups).
" (user_id, changed, name)".
" VALUES (".intval($this->user_id).", ".$this->db->now().", ".$this->db->quote($name).")"
);
@@ -863,7 +863,7 @@ class rcube_contacts extends rcube_addressbook
{
// flag group record as deleted
$sql_result = $this->db->query(
- "UPDATE ".get_table_name($this->db_groups).
+ "UPDATE ".$this->db->table_name($this->db_groups).
" SET del=1, changed=".$this->db->now().
" WHERE contactgroup_id=?".
" AND user_id=?",
@@ -889,7 +889,7 @@ class rcube_contacts extends rcube_addressbook
$name = $this->unique_groupname($newname);
$sql_result = $this->db->query(
- "UPDATE ".get_table_name($this->db_groups).
+ "UPDATE ".$this->db->table_name($this->db_groups).
" SET name=?, changed=".$this->db->now().
" WHERE contactgroup_id=?".
" AND user_id=?",
@@ -917,7 +917,7 @@ class rcube_contacts extends rcube_addressbook
// get existing assignments ...
$sql_result = $this->db->query(
- "SELECT contact_id FROM ".get_table_name($this->db_groupmembers).
+ "SELECT contact_id FROM ".$this->db->table_name($this->db_groupmembers).
" WHERE contactgroup_id=?".
" AND contact_id IN (".$this->db->array2list($ids, 'integer').")",
$group_id
@@ -930,7 +930,7 @@ class rcube_contacts extends rcube_addressbook
foreach ($ids as $contact_id) {
$this->db->query(
- "INSERT INTO ".get_table_name($this->db_groupmembers).
+ "INSERT INTO ".$this->db->table_name($this->db_groupmembers).
" (contactgroup_id, contact_id, created)".
" VALUES (?, ?, ".$this->db->now().")",
$group_id,
@@ -960,7 +960,7 @@ class rcube_contacts extends rcube_addressbook
$ids = $this->db->array2list($ids, 'integer');
$sql_result = $this->db->query(
- "DELETE FROM ".get_table_name($this->db_groupmembers).
+ "DELETE FROM ".$this->db->table_name($this->db_groupmembers).
" WHERE contactgroup_id=?".
" AND contact_id IN ($ids)",
$group_id
@@ -983,7 +983,7 @@ class rcube_contacts extends rcube_addressbook
do {
$sql_result = $this->db->query(
- "SELECT 1 FROM ".get_table_name($this->db_groups).
+ "SELECT 1 FROM ".$this->db->table_name($this->db_groups).
" WHERE del<>1".
" AND user_id=?".
" AND name=?",