From 6c76c91951d259f59b2b7a42b8fe895dcc0ef21b Mon Sep 17 00:00:00 2001 From: thomascube <thomas@roundcube.net> Date: Wed, 23 Aug 2006 17:36:37 -0400 Subject: [PATCH] Updated Polish, Portuguese, Latvian, Chinese and Japanese localization --- program/steps/addressbook/func.inc | 51 ++++++++++++++++++++++++++++----------------------- 1 files changed, 28 insertions(+), 23 deletions(-) diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc index 309c2a3..6d3e95e 100644 --- a/program/steps/addressbook/func.inc +++ b/program/steps/addressbook/func.inc @@ -6,7 +6,7 @@ | | | This file is part of the RoundCube Webmail client | | Copyright (C) 2005, RoundCube Dev. - Switzerland | - | All rights reserved. | + | Licensed under the GNU GPL | | | | PURPOSE: | | Provide addressbook functionality and GUI objects | @@ -30,7 +30,12 @@ else $CONTACTS_LIST['page'] = $_SESSION['page'] ? $_SESSION['page'] : 1; - +// disable the ldap public search button if there's no servers configured +$enable_ldap = 'true'; +if (!$CONFIG['ldap_public']) + $enable_ldap = 'false'; + +$OUTPUT->add_script("$JS_OBJECT_NAME.set_env('ldappublicsearch', $enable_ldap);"); // return the message list as HTML table function rcmail_contacts_list($attrib) @@ -41,12 +46,11 @@ //$image_tag = '<img src="%s%s" alt="%s" border="0" />'; // count contacts for this user - $sql_result = $DB->query(sprintf("SELECT COUNT(contact_id) AS rows - FROM %s - WHERE del!='1' - AND user_id=%d", - get_table_name('contacts'), - $_SESSION['user_id'])); + $sql_result = $DB->query("SELECT COUNT(contact_id) AS rows + FROM ".get_table_name('contacts')." + WHERE del<>1 + AND user_id=?", + $_SESSION['user_id']); $sql_arr = $DB->fetch_assoc($sql_result); $rowcount = $sql_arr['rows']; @@ -56,15 +60,13 @@ $start_row = ($CONTACTS_LIST['page']-1) * $CONFIG['pagesize']; // get contacts from DB - $sql_result = $DB->query(sprintf("SELECT * FROM %s - WHERE del!='1' - AND user_id=%d - ORDER BY name - LIMIT %d, %d", - get_table_name('contacts'), - $_SESSION['user_id'], - $start_row, - $CONFIG['pagesize'])); + $sql_result = $DB->limitquery("SELECT * FROM ".get_table_name('contacts')." + WHERE del<>1 + AND user_id= ? + ORDER BY name", + $start_row, + $CONFIG['pagesize'], + $_SESSION['user_id']); } else $sql_result = NULL; @@ -84,9 +86,13 @@ $javascript = sprintf("%s.gui_object('contactslist', '%s');\n", $JS_OBJECT_NAME, $attrib['id']); $javascript .= sprintf("%s.set_env('current_page', %d);\n", $JS_OBJECT_NAME, $CONTACTS_LIST['page']); $javascript .= sprintf("%s.set_env('pagecount', %d);\n", $JS_OBJECT_NAME, ceil($rowcount/$CONFIG['pagesize'])); + $javascript .= "rcmail.set_env('newcontact', '" . rcube_label('newcontact') . "');"; //$javascript .= sprintf("%s.set_env('contacts', %s);", $JS_OBJECT_NAME, array2js($a_js_message_arr)); $OUTPUT->add_script($javascript); + + // add some labels to client + rcube_add_label('deletecontactconfirm'); return $out; } @@ -175,11 +181,10 @@ // get nr of contacts if ($max===NULL) { - $sql_result = $DB->query(sprintf("SELECT 1 FROM %s - WHERE del!='1' - AND user_id=%d", - get_table_name('contacts'), - $_SESSION['user_id'])); + $sql_result = $DB->query("SELECT 1 FROM ".get_table_name('contacts')." + WHERE del<>1 + AND user_id=?", + $_SESSION['user_id']); $max = $DB->num_rows($sql_result); } @@ -195,4 +200,4 @@ return $out; } -?> \ No newline at end of file +?> -- Gitblit v1.9.1