Changeset 1373 for HelpIM3

Show
Ignore:
Timestamp:
01/04/11 16:19:38 (17 months ago)
Author:
zeank
Message:

show last joined and last left for conversation

refs #247

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • HelpIM3/branches/chatgroups/HelpIM/chatgroup/pages/ChatLog.py

    r1372 r1373  
    6868                    chat_conv_id, 
    6969                    chat_conv_start_time, 
     70                    {'detail_field': [[{'label': [{'name': 'Last Joined'}]}, 
     71                                       {'data_text': [{'valueTable': 'ChatgroupMeeting', 
     72                                                       'valueAttr': 'last_joined'}]} 
     73                                       ]]}, 
     74                    {'detail_field': [[{'label': [{'name': 'Last Left'}]}, 
     75                                       {'data_text': [{'valueTable': 'ChatgroupMeeting', 
     76                                                       'valueAttr': 'last_left'}]} 
     77                                       ]]}, 
    7078                    {'detail_field': [[{'label': [{'name': 'Lines Total'}]}, 
    7179                                       {'data_text': [{'valueTable': 'ChatgroupMeeting', 
     
    162170        chatData['ChatgroupMeeting'][0]['chat_words_total'] = chat_words_total 
    163171 
     172        facilitators = self.site.getChatgroupMeetingParticipantsByMeetingId( 
     173            self.site, 
     174            self.getParam('conv_id'), 
     175            True 
     176            ) 
     177 
     178        participants = self.site.getChatgroupMeetingParticipantsByMeetingId( 
     179            self.site, 
     180            self.getParam('conv_id'), 
     181            False 
     182            ) 
     183 
     184        last_joined = None 
     185        last_left = None 
     186        for p in facilitators: 
     187            if not last_joined or last_joined < p.joined_at: 
     188                last_joined = p.joined_at 
     189            if not last_left or last_left < p.left_at: 
     190                last_left = p.left_at 
     191        for p in participants: 
     192            if not last_joined or last_joined < p.joined_at: 
     193                last_joined = p.joined_at 
     194            if not last_left or last_left < p.left_at: 
     195                last_left = p.left_at 
     196             
     197        chatData['ChatgroupMeeting'][0]['last_joined'] = last_joined 
     198        chatData['ChatgroupMeeting'][0]['last_left'] = last_left 
     199 
    164200        self.dbg(chatData) 
    165201 
     
    168204        facilitators = self.site.listOfPythonObjectsAsTuple( 
    169205            'ChatgroupFacilitators', 
    170             self.site.getChatgroupMeetingParticipantsByMeetingId( 
    171                 self.site, 
    172                 self.getParam('conv_id'), 
    173                 True), 
    174              participantDataElements 
    175             ) 
    176              
     206            facilitators, 
     207            participantDataElements 
     208            ) 
     209         
    177210        self.dbg(facilitators) 
    178211         
    179212        participants = self.site.listOfPythonObjectsAsTuple( 
    180213            'ChatgroupParticipants', 
    181             self.site.getChatgroupMeetingParticipantsByMeetingId( 
    182                 self.site, 
    183                 self.getParam('conv_id'), 
    184                 False), 
    185              participantDataElements 
     214            participants, 
     215            participantDataElements 
    186216            ) 
    187217