Changeset 1243


Ignore:
Timestamp:
12/21/06 16:46:18 (13 years ago)
Author:
pjotr
Message:

Fixes #1052

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/MemberFolder.py

    r1224 r1243  
    682682 
    683683        return show 
     684 
     685    def giveSortedListOfContacts(self): 
     686        """ Sorts list of contacts by the Last Name """ 
     687        contacts = self.getListOfContacts() 
     688        mod_contacts = [] 
     689        sorted_contacts = [] 
     690        # Creating a sortable array by adding Lastnames as additional components 
     691        for contact in contacts: 
     692            mod_contact = [] 
     693            mod_contact.append(contact.getLastname()) 
     694            mod_contact.append(contact) 
     695            mod_contacts.append(mod_contact) 
     696        mod_contacts.sort() 
     697        # Creating new array already sorted array to the way we need it to be 
     698        for m_contact in mod_contacts: 
     699            sorted_contacts.append(m_contact[1]) 
     700 
     701        return sorted_contacts 
     702         
     703 
    684704         
    685705registerType(MemberFolder, PROJECTNAME) 
  • trunk/skins/lemill/portlet_add_community.pt

    r1221 r1243  
    4646 
    4747    <span tal:define="memfolder member/getHomeFolder; 
    48                       contacts python:memfolder.getListOfContacts();"> 
     48                      contacts python:memfolder.giveSortedListOfContacts();"> 
    4949        <ul style="list-style: none;" tal:condition="contacts" tal:repeat="contact contacts"> 
    5050            <li> 
  • trunk/skins/lemill/portlet_member.pt

    r1220 r1243  
    7575                </div> 
    7676 
    77                 <span tal:define="contacts python:context.lemill_usertool.getListOfContacts()"> 
     77                <span tal:define="contacts python:context.lemill_usertool.giveSortedListOfContacts()"> 
    7878                    <ul style="list-style: none;" tal:condition="contacts" tal:repeat="contact contacts"> 
    7979                        <li> 
Note: See TracChangeset for help on using the changeset viewer.