Changeset 561
- Timestamp:
- 10/05/06 11:00:07
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
qPloneComments/branches/plone-2.5/skins/qplonecomments/prefs_recent_comments_delete.cpy
r560 r561 1 <<<<<<< .working2 1 ## Script (Python) "prefs_recent_comments_delete" 3 2 ##bind container=container … … 9 8 ##title= 10 9 ## 11 12 10 from Products.CMFCore.utils import getToolByName 13 11 from Products.qPloneComments.utils import manage_mails … … 31 29 manage_mails(comment, context, 'deleting') 32 30 33 psm = comment_ids and 'Comment s was successfullydeleted.' or 'Please select items to be processed.'31 psm = comment_ids and 'Comment(s) deleted.' or 'Please select items to be processed.' 34 32 return state.set(portal_status_message=psm) 35 =======36 ## Script (Python) "prefs_recent_comments_delete"37 ##bind container=container38 ##bind context=context39 ##bind namespace=40 ##bind script=script41 ##bind subpath=traverse_subpath42 ##parameters=43 ##title=44 ##45 46 from Products.CMFCore.utils import getToolByName47 portal_discussion = getToolByName(context, "portal_discussion")48 portal_catalog = getToolByName(context, "portal_catalog")49 50 request = context.REQUEST51 comment_ids = request.get('ids')52 53 for comment_id in comment_ids:54 comment = portal_catalog(id=comment_id,portal_type='Discussion Item')[0].getObject()55 56 parent = comment.inReplyTo()57 if parent is not None:58 talkback = portal_discussion.getDiscussionFor(parent)59 else:60 talkback = parent = comment.aq_parent61 62 talkback.deleteReply( comment_id )63 64 return state.set(portal_status_message='Comment(s) deleted.')65 66 >>>>>>> .merge-right.r488qPloneComments/branches/plone-2.5/utils.py
r560 r561 112 112 di_parrent = getDIParent(reply) 113 113 if di_parrent: 114 args={'mto': getEmail(di_parrent, context), 115 'mfrom': admin_email, 116 'obj': reply_parent, 117 'organization_name': organization_name, 118 'name': creator_name} 114 user_email = getEmail(di_parrent, context) 115 if user_email: 116 args={'mto': user_email, 117 'mfrom': admin_email, 118 'obj': reply_parent, 119 'organization_name': organization_name, 120 'name': creator_name} 121 else: 122 args = {} 119 123 else: 120 124 args = {} … … 122 126 elif state == 'enable_published_notification': 123 127 template = 'published_comment_template' 124 args={'mto':getParentOwnerEmail(reply, context), 125 'mfrom':admin_email, 126 'obj':reply_parent, 127 'organization_name':organization_name} 128 user_email = getParentOwnerEmail(reply, context) 129 if user_email: 130 args={'mto':user_email, 131 'mfrom':admin_email, 132 'obj':reply_parent, 133 'organization_name':organization_name} 134 else: 135 args = {} 128 136 129 137 elif state == 'enable_approve_notification': 130 138 template = 'approve_comment_template' 131 args={'mto':getProp(context, "email_discussion_manager", None), 132 'mfrom':admin_email, 133 'obj':reply_parent, 134 'organization_name':organization_name} 139 user_email = getProp(context, "email_discussion_manager", None) 140 if user_email: 141 args={'mto':user_email, 142 'mfrom':admin_email, 143 'obj':reply_parent, 144 'organization_name':organization_name} 145 else: 146 args = {} 147 135 148 if args: 136 149 return send(context, template, args)
