Changeset 1311


Ignore:
Timestamp:
01/29/07 14:23:04 (12 years ago)
Author:
pjotr
Message:

Fixes #1116

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MemberFolder.py

    r1285 r1311  
    632632        mtool = getToolByName(self, 'portal_membership') 
    633633        mfolder = mtool.getHomeFolder() 
     634        # Get UID to add 
     635        added_uid = REQUEST.get('uid') 
     636        # This one gets the added member folder 
     637        uid_catalog = getToolByName(self, 'uid_catalog') 
     638        results=uid_catalog(UID=added_uid) 
     639        added_member_folder = results[0].getObject() 
    634640        # Get contacts and other data 
    635641        field = mfolder.Schema().get('listOfContacts') 
    636642        prev = field.getRaw(mfolder) 
    637         cont = self.UID() 
     643        cont = added_uid 
    638644        new_value = [] 
    639645        new_value = prev 
     
    644650        mess = self.translate('Member added to contacts.', domain='lemill') 
    645651        REQUEST.set('portal_status_message', mess) 
    646         return REQUEST.RESPONSE.redirect(self.absolute_url()+'?portal_status_message='+mess) 
     652        return REQUEST.RESPONSE.redirect(added_member_folder.absolute_url()+'?portal_status_message='+mess) 
    647653 
    648654    def delListOfContacts(self): 
     
    653659        mtool = getToolByName(self, 'portal_membership') 
    654660        mfolder = mtool.getHomeFolder() 
     661        # Get UID to remove 
     662        removed_uid = REQUEST.get('uid') 
     663        # This one gets the removed member folder 
     664        uid_catalog = getToolByName(self, 'uid_catalog') 
     665        results=uid_catalog(UID=removed_uid) 
     666        removed_member_folder = results[0].getObject() 
    655667        # Get contacts and other data 
    656668        field = mfolder.Schema().get('listOfContacts') 
    657669        prev = field.getRaw(mfolder) 
    658         cont = self.UID() 
     670        cont = removed_uid 
    659671        new_value = [] 
    660672        new_value = prev 
     
    665677        mess = self.translate('Member removed from contacts.', domain='lemill') 
    666678        REQUEST.set('portal_status_message', mess) 
    667         return REQUEST.RESPONSE.redirect(self.absolute_url()+'?portal_status_message='+mess) 
     679        return REQUEST.RESPONSE.redirect(removed_member_folder.absolute_url()+'?portal_status_message='+mess) 
    668680 
    669681    def showRemoveContactLink(self): 
  • trunk/skins/lemill/portlet_member.pt

    r1243 r1311  
    2424 
    2525            <tal:defs define="logged_id python:mtool.getAuthenticatedMember().getId(); 
    26                             groups python:context.lemill_usertool.getGroupsList(logged_id);"> 
     26                              groups python:context.lemill_usertool.getGroupsList(logged_id); 
     27                              myFolder python:mtool.getHomeFolder(); 
     28                              userfolderUID python:context.UID();"> 
    2729                            <div class="tb-portlet" tal:condition="python:not isAnon and context.getMemberId()!=logged_id"> 
    28                 <ul style="list-style: none;" tal:define="contUrl here/absolute_url"> 
     30                <ul style="list-style: none;"> 
    2931                    <li tal:condition="groups"> 
    3032                    <a href="group_invite" i18n:translate="link_invite_to_group">Invite to group</a> 
    3133                    </li> 
    3234                    <li tal:condition="python: not here.showRemoveContactLink()"> 
    33                     <a href="#" tal:attributes="href string:${contUrl}/addListOfContacts"> 
     35                    <a href="#" tal:attributes="href string:${myFolder/absolute_url}/addListOfContacts?uid=${userfolderUID}"> 
    3436                        <tal:block i18n:translate="add_as_contact">Add as contact</tal:block> 
    3537                    </a> 
    3638                    </li> 
    3739                    <li tal:condition="python: here.showRemoveContactLink()"> 
    38                     <a href="#" tal:attributes="href string:${contUrl}/delListOfContacts"> 
     40                    <a href="#" tal:attributes="href string:${myFolder/absolute_url}/delListOfContacts?uid=${userfolderUID}"> 
    3941                        <tal:block i18n:translate="remove_from_contacts">Remove from contacts</tal:block> 
    4042                    </a> 
Note: See TracChangeset for help on using the changeset viewer.