Changeset fa59965 in github


Ignore:
Timestamp:
Jul 18, 2011 1:35:12 PM (22 months ago)
Author:
thomascube <thomas@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
Children:
8c37422
Parents:
3a9f795
Message:

Asynchronously load contacts after page load

Location:
program
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • program/js/app.js

    r7f554cf rfa59965  
    339339        this.enable_command('add', 'import', this.env.writable_source); 
    340340        this.enable_command('list', 'listgroup', 'advanced-search', true); 
     341         
     342        // load contacts of selected source 
     343        this.command('list', this.env.source); 
    341344        break; 
    342345 
  • program/steps/addressbook/func.inc

    r63fda8a rfa59965  
    8585    $_SESSION['addressbooks_count'] = count($js_list); 
    8686    $_SESSION['addressbooks_count_writeable'] = $writeable; 
     87     
     88    if (!strlen($source)) 
     89      $source = strval(key($js_list)); 
    8790 
    8891    $CONTACTS = rcmail_contact_source($source, true); 
     
    181184    // currently selected source 
    182185    $current = get_input_value('_source', RCUBE_INPUT_GPC); 
    183     if (!strlen($current) || !isset($sources[$source])) 
    184         $current = strval(key($sources)); 
    185186 
    186187    foreach ($sources as $j => $source) { 
     
    248249 
    249250 
    250 // return the message list as HTML table 
     251// return the contacts list as HTML table 
    251252function rcmail_contacts_list($attrib) 
    252253{ 
     
    255256    // define list of cols to be displayed 
    256257    $a_show_cols = array('name'); 
    257  
    258     // count contacts for this user 
    259     $result = $CONTACTS->list_records($a_show_cols); 
    260258 
    261259    // add id to message list table if not specified 
     
    264262 
    265263    // create XHTML table 
    266     $out = rcube_table_output($attrib, $result->records, $a_show_cols, $CONTACTS->primary_key); 
     264    $out = rcube_table_output($attrib, array(), $a_show_cols, $CONTACTS->primary_key); 
    267265 
    268266    // set client env 
    269267    $OUTPUT->add_gui_object('contactslist', $attrib['id']); 
    270268    $OUTPUT->set_env('current_page', (int)$CONTACTS->list_page); 
    271     $OUTPUT->set_env('pagecount', ceil($result->count/$CONTACTS->page_size)); 
    272269    $OUTPUT->include_script('list.js'); 
    273270 
     
    332329    $OUTPUT->add_gui_object('countdisplay', $attrib['id']); 
    333330 
    334     return html::span($attrib, rcmail_get_rowcount_text()); 
     331    return html::span($attrib, rcube_label('loading')); 
    335332} 
    336333 
     
    343340    if (!$result) { 
    344341        $result = $CONTACTS->get_result(); 
    345     } 
    346     if (!$result) { 
    347         $result = $CONTACTS->count(); 
    348342    } 
    349343 
Note: See TracChangeset for help on using the changeset viewer.