Changeset 12700

Show
Ignore:
Timestamp:
10/09/07 11:08:56 (1 year ago)
Author:
bergie
Message:

Show users on the welcome screen if there are fewer than N of them in DB

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/midcom.admin.user/config/config.inc

    r12696 r12700  
    11'schemadb_person' => 'file:/midcom/admin/user/config/schemadb_person.inc', 
     2'list_without_search' => 20, 
    23'search_fields' => array 
    34( 
  • trunk/midcom/midcom.admin.user/handler/list.php

    r12697 r12700  
    106106        if (isset($_REQUEST['midcom_admin_user_search'])) 
    107107        { 
    108  
    109108            // Run the person-seeking QB 
    110109            $qb = midcom_db_person::new_query_builder(); 
     
    119118             
    120119            $this->_persons = $qb->execute(); 
     120        } 
     121        else 
     122        { 
     123            // List all persons if there are less than N of them 
     124            $qb = midcom_db_person::new_query_builder(); 
     125             
     126            if ($qb->count() < $this->_config->get('list_without_search')) 
     127            { 
     128                $qb->add_order('lastname'); 
     129                $qb->add_order('firstname'); 
     130             
     131                $this->_persons = $qb->execute(); 
     132            } 
    121133        } 
    122134