Changeset 4823 in subversion
- Timestamp:
- Jun 1, 2011 9:44:51 AM (2 years ago)
- Location:
- trunk/roundcubemail
- Files:
-
- 13 edited
-
CHANGELOG (modified) (1 diff)
-
config/main.inc.php.dist (modified) (1 diff)
-
program/include/rcube_contacts.php (modified) (3 diffs)
-
program/include/rcube_ldap.php (modified) (2 diffs)
-
program/js/app.js (modified) (3 diffs)
-
program/localization/en_US/labels.inc (modified) (1 diff)
-
program/localization/pl_PL/labels.inc (modified) (1 diff)
-
program/steps/addressbook/func.inc (modified) (3 diffs)
-
program/steps/addressbook/search.inc (modified) (2 diffs)
-
skins/default/common.css (modified) (2 diffs)
-
skins/default/functions.js (modified) (2 diffs)
-
skins/default/mail.css (modified) (1 diff)
-
skins/default/templates/addressbook.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/CHANGELOG
r4819 r4823 2 2 =========================== 3 3 4 - Add popup with basic fields selection for addressbook search 4 5 - Case-insensitive matching in autocompletion (#1487933) 5 6 - Added option to force spellchecking before sending a message (#1485458) -
trunk/roundcubemail/config/main.inc.php.dist
r4816 r4823 675 675 $rcmail_config['search_mods'] = null; // Example: array('*' => array('subject'=>1, 'from'=>1), 'Sent' => array('subject'=>1, 'to'=>1)); 676 676 677 // Defaults of the addressbook search field configuration. 678 $rcmail_config['addressbook_search_mods'] = null; // Example: array('name'=>1, 'firstname'=>1, 'surname'=>1, 'email'=>1, '*'=>1); 679 677 680 // 'Delete always' 678 681 // This setting reflects if mail should be always deleted -
trunk/roundcubemail/program/include/rcube_contacts.php
r4768 r4823 193 193 // determine whether we have to parse the vcard or if only db cols are requested 194 194 $read_vcard = !$cols || count(array_intersect($cols, $this->table_cols)) < count($cols); 195 195 196 196 while ($sql_result && ($sql_arr = $this->db->fetch_assoc($sql_result))) { 197 197 $sql_arr['ID'] = $sql_arr[$this->primary_key]; … … 256 256 $where[] = 'c.' . $this->primary_key.' IN ('.$ids.')'; 257 257 } 258 else if ($strict) {259 $where[] = $this->db->quoteIdentifier($col).' = '.$this->db->quote($value);260 }261 258 else if ($col == '*') { 262 259 $words = array(); … … 264 261 $words[] = $this->db->ilike('words', '%'.$word.'%'); 265 262 $where[] = '(' . join(' AND ', $words) . ')'; 266 } 267 else 263 } 264 else if ($strict) { 265 $where[] = $this->db->quoteIdentifier($col).' = '.$this->db->quote($value); 266 } 267 else if (in_array($col, $this->table_cols)) { 268 268 $where[] = $this->db->ilike($col, '%'.$value.'%'); 269 } 269 270 } 270 271 -
trunk/roundcubemail/program/include/rcube_ldap.php
r4752 r4823 480 480 $filter = '(|'; 481 481 $wc = !$strict && $this->prop['fuzzy_search'] ? '*' : ''; 482 if ($fields != '*')482 if ($fields == '*') 483 483 { 484 484 // search_fields are required for fulltext search 485 if ( !$this->prop['search_fields'])485 if (empty($this->prop['search_fields'])) 486 486 { 487 487 $this->set_error(self::ERROR_SEARCH, 'nofulltextsearch'); … … 489 489 return $this->result; 490 490 } 491 } 492 493 if (is_array($this->prop['search_fields'])) 494 { 495 foreach ($this->prop['search_fields'] as $k => $field) 496 $filter .= "($field=$wc" . $this->_quote_string($value) . "$wc)"; 491 if (is_array($this->prop['search_fields'])) 492 { 493 foreach ($this->prop['search_fields'] as $k => $field) 494 $filter .= "($field=$wc" . $this->_quote_string($value) . "$wc)"; 495 } 497 496 } 498 497 else -
trunk/roundcubemail/program/js/app.js
r4818 r4823 3333 3333 { 3334 3334 if (value != '') { 3335 var addurl = ''; 3335 var n, addurl = '', mods_arr = [], 3336 mods = this.env.search_mods, 3337 mbox = this.env.mailbox, 3338 lock = this.set_busy(true, 'searching'); 3339 3336 3340 if (this.message_list) { 3337 3341 this.clear_message_list(); 3338 if (this.env.search_mods) { 3339 var mods = this.env.search_mods[this.env.mailbox] ? this.env.search_mods[this.env.mailbox] : this.env.search_mods['*']; 3340 if (mods) { 3341 var head_arr = []; 3342 for (var n in mods) 3343 head_arr.push(n); 3344 addurl += '&_headers='+head_arr.join(','); 3345 } 3346 } 3342 if (mods) 3343 mods = mods[mbox] ? mods[mbox] : mods['*']; 3347 3344 } else if (this.contact_list) { 3348 3345 this.contact_list.clear(true); … … 3350 3347 } 3351 3348 3349 if (mods) { 3350 for (n in mods) 3351 mods_arr.push(n); 3352 addurl += '&_headers='+mods_arr.join(','); 3353 } 3354 3352 3355 if (this.gui_objects.search_filter) 3353 3356 addurl += '&_filter=' + this.gui_objects.search_filter.value; … … 3355 3358 // reset vars 3356 3359 this.env.current_page = 1; 3357 var lock = this.set_busy(true, 'searching');3358 3360 this.http_request('search', '_q='+urlencode(value) 3359 + ( this.env.mailbox ? '&_mbox='+urlencode(this.env.mailbox) : '')3361 + (mbox ? '&_mbox='+urlencode(mbox) : '') 3360 3362 + (this.env.source ? '&_source='+urlencode(this.env.source) : '') 3361 3363 + (this.env.group ? '&_gid='+urlencode(this.env.group) : '') -
trunk/roundcubemail/program/localization/en_US/labels.inc
r4816 r4823 272 272 $labels['assistant'] = 'Assistant'; 273 273 $labels['spouse'] = 'Spouse'; 274 $labels['allfields'] = 'All fields'; 274 275 275 276 $labels['typehome'] = 'Home'; -
trunk/roundcubemail/program/localization/pl_PL/labels.inc
r4816 r4823 459 459 ÅŒki adresowej'; 460 460 $labels['spellcheckbeforesend'] = 'Przed wysÅaniem wiadomoÅci sprawdzaj pisowniÄ'; 461 $labels['allfields'] = 'Wszystkie pola'; 461 462 462 463 ?> -
trunk/roundcubemail/program/steps/addressbook/func.inc
r4764 r4823 20 20 */ 21 21 22 $SEARCH_MODS_DEFAULT = array('name'=>1, 'firstname'=>1, 'surname'=>1, 'email'=>1, '*'=>1); 23 22 24 // add list of address sources to client env 23 25 $js_list = $RCMAIL->get_address_sources(); … … 40 42 else 41 43 $CONTACTS->set_page(isset($_SESSION['page']) ?$_SESSION['page'] : 1); 42 44 43 45 if (!empty($_REQUEST['_gid'])) 44 46 $CONTACTS->set_group(get_input_value('_gid', RCUBE_INPUT_GPC)); … … 52 54 $OUTPUT->set_env('readonly', $CONTACTS->readonly, false); 53 55 if (!$OUTPUT->ajax_call) { 56 $search_mods = $RCMAIL->config->get('addressbook_search_mods', $SEARCH_MODS_DEFAULT); 57 $OUTPUT->set_env('search_mods', $search_mods); 54 58 $OUTPUT->set_env('address_sources', $js_list); 55 59 $OUTPUT->set_pagetitle(rcube_label('addressbook')); -
trunk/roundcubemail/program/steps/addressbook/search.inc
r4812 r4823 23 23 $_SESSION['page'] = 1; 24 24 25 // get input 25 26 $search = trim(get_input_value('_q', RCUBE_INPUT_GET, true)); 26 $search_request = md5('addr'.$search); 27 $fields = explode(',', get_input_value('_headers', RCUBE_INPUT_GET)); 28 29 if (empty($fields)) { 30 $fields = $SEARCH_MODS_DEFAULT; 31 } 32 33 $search_request = md5('addr'.$search.implode($fields, ',')); 34 35 // update search_mods setting 36 $search_mods = array_fill_keys($fields, 1); 37 $RCMAIL->user->save_prefs(array('addressbook_search_mods' => $search_mods)); 38 39 if ($fields['all'] || count($fields) == count($SEARCH_MODS_DEFAULT)) { 40 $fields = '*'; 41 } 27 42 28 43 // get contacts for this user 29 $result = $CONTACTS->search( '*', $search);44 $result = $CONTACTS->search($fields, $search); 30 45 31 46 // save search settings in session 32 47 $_SESSION['search'][$search_request] = $CONTACTS->get_search_set(); 33 48 34 if ($result->count > 0) 35 { 36 // create javascript list 37 rcmail_js_contacts_list($result); 49 if ($result->count > 0) { 50 // create javascript list 51 rcmail_js_contacts_list($result); 38 52 } 39 else 40 { 53 else { 41 54 $OUTPUT->show_message('nocontactsfound', 'notice'); 42 55 } … … 46 59 $OUTPUT->set_env('pagecount', ceil($result->count / $CONTACTS->page_size)); 47 60 $OUTPUT->command('set_rowcount', rcmail_get_rowcount_text()); 48 61 49 62 // send response 50 63 $OUTPUT->send(); -
trunk/roundcubemail/skins/default/common.css
r4808 r4823 618 618 } 619 619 620 621 620 /***** roundcube webmail pre-defined classes *****/ 622 621 … … 814 813 margin-top: 2px; 815 814 padding-top: 2px; 815 } 816 817 #searchmenu 818 { 819 width: 160px; 820 } 821 822 #searchmenu ul.toolbarmenu 823 { 824 margin: 0; 825 } 826 827 #searchmenu ul.toolbarmenu li 828 { 829 margin: 1px 4px 1px; 816 830 } 817 831 -
trunk/roundcubemail/skins/default/functions.js
r4775 r4823 187 187 188 188 if (rcmail.env.search_mods) { 189 var search_mods = rcmail.env.search_mods[rcmail.env.mailbox] ? rcmail.env.search_mods[rcmail.env.mailbox] : rcmail.env.search_mods['*']; 190 for (var n in search_mods) 191 $('#s_mod_' + n).prop('checked', true); 189 var n, mbox = rcmail.env.mailbox, mods = rcmail.env.search_mods; 190 191 if (rcmail.env.task != 'addressbook') { 192 mods = mods[mbox] ? mods[mbox] : mods['*']; 193 194 for (n in mods) 195 $('#s_mod_' + n).prop('checked', true); 196 } 197 else { 198 if (mods['*']) 199 $('input:checkbox[name="s_mods[]"]').map(function() { 200 this.checked = true; 201 this.disabled = this.value != '*'; 202 }); 203 else { 204 for (n in mods) 205 $('#s_mod_' + n).prop('checked', true); 206 } 207 } 192 208 } 193 209 } … … 197 213 set_searchmod: function(elem) 198 214 { 199 if (!rcmail.env.search_mods) 200 rcmail.env.search_mods = {}; 201 202 if (!rcmail.env.search_mods[rcmail.env.mailbox]) 203 rcmail.env.search_mods[rcmail.env.mailbox] = rcube_clone_object(rcmail.env.search_mods['*']); 204 205 if (!elem.checked) 206 delete(rcmail.env.search_mods[rcmail.env.mailbox][elem.value]); 207 else 208 rcmail.env.search_mods[rcmail.env.mailbox][elem.value] = elem.value; 215 var task = rcmail.env.task, 216 mods = rcmail.env.search_mods, 217 mbox = rcmail.env.mailbox; 218 219 if (!mods) 220 mods = {}; 221 222 if (task == 'mail') { 223 if (!mods[mbox]) 224 mods[mbox] = rcube_clone_object(mods['*']); 225 if (!elem.checked) 226 delete(mods[mbox][elem.value]); 227 else 228 mods[mbox][elem.value] = 1; 229 } 230 else { //addressbook 231 if (!elem.checked) 232 delete(mods[elem.value]); 233 else 234 mods[elem.value] = 1; 235 236 // mark all fields 237 if (elem.value == '*') { 238 $('input:checkbox[name="s_mods[]"]').map(function() { 239 if (this == elem) 240 return; 241 242 if (elem.checked) { 243 mods[this.value] = 1; 244 this.checked = true; 245 this.disabled = true; 246 } 247 else { 248 this.disabled = false; 249 } 250 }); 251 } 252 } 253 254 rcmail.env.search_mods = mods; 209 255 }, 210 256 -
trunk/roundcubemail/skins/default/mail.css
r4808 r4823 153 153 { 154 154 padding-left: 2px; 155 }156 157 #searchmenu158 {159 width: 160px;160 }161 162 #searchmenu ul.toolbarmenu163 {164 margin: 0;165 }166 167 #searchmenu ul.toolbarmenu li168 {169 margin: 1px 4px 1px;170 155 } 171 156 -
trunk/roundcubemail/skins/default/templates/addressbook.html
r4538 r4823 30 30 31 31 <div id="quicksearchbar"> 32 <roundcube:button name="searchmenulink" id="searchmenulink" image="/images/icons/glass .png" />32 <roundcube:button name="searchmenulink" id="searchmenulink" image="/images/icons/glass_roll.png" onclick="rcmail_ui.show_popup('searchmenu');return false" title="searchmod" /> 33 33 <roundcube:object name="searchform" id="quicksearchbox" /> 34 34 <roundcube:button command="reset-search" id="searchreset" image="/images/icons/reset.gif" title="resetsearch" /> 35 </div> 36 37 <div id="searchmenu" class="popupmenu"> 38 <ul class="toolbarmenu"> 39 <li><input type="checkbox" name="s_mods[]" value="name" id="s_mod_name" onclick="rcmail_ui.set_searchmod(this)" /><label for="s_mod_name"><roundcube:label name="name" /></label></li> 40 <li><input type="checkbox" name="s_mods[]" value="firstname" id="s_mod_firstname" onclick="rcmail_ui.set_searchmod(this)" /><label for="s_mod_firstname"><roundcube:label name="firstname" /></label></li> 41 <li><input type="checkbox" name="s_mods[]" value="surname" id="s_mod_surname" onclick="rcmail_ui.set_searchmod(this)" /><label for="s_mod_surname"><roundcube:label name="surname" /></label></li> 42 <li><input type="checkbox" name="s_mods[]" value="email" id="s_mod_email" onclick="rcmail_ui.set_searchmod(this)" /><label for="s_mod_email"><roundcube:label name="email" /></label></li> 43 <li><input type="checkbox" name="s_mods[]" value="*" id="s_mod_all" onclick="rcmail_ui.set_searchmod(this)" /><label for="s_mod_all"><roundcube:label name="allfields" /></label></li> 44 <!-- 45 <li class="separator_below"> 46 <li><roundcube:button command="advsearch" type="link" label="advsearch" style="padding-left: 0" classAct="active" /></li> 47 --> 48 </ul> 35 49 </div> 36 50
Note: See TracChangeset
for help on using the changeset viewer.
