Changeset 546

Show
Ignore:
Timestamp:
09/28/06 07:06:55
Author:
crchemist
Message:

Add Plone-2.1.x compatibility.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • qPloneComments/branches/plone-2.5/skins/qplonecomments/2.1/discussion_publish_comment.py

    r545 r546  
    1010from Products.CMFPlone import transaction_note 
    1111from Products.CMFCore.utils import getToolByName 
    12 from Products.qPloneComments.utils import publishDiscussion, send_email 
     12from Products.qPloneComments.utils import publishDiscussion 
    1313 
    1414if obj is None: 
     
    2525publishDiscussion(reply) 
    2626 
    27 send_notification_message = send_email(reply, container, state="published") 
    28  
    2927portal_status_message='Comment+successfully+published' 
    3028 
  • qPloneComments/branches/plone-2.5/skins/qplonecomments/2.1/discussion_reply.cpy

    r545 r546  
    1111from Products.PythonScripts.standard import url_quote_plus 
    1212from Products.CMFCore.utils import getToolByName 
    13 from Products.qPloneComments.utils import send_email 
     13from Products.qPloneComments.utils import manage_mails 
    1414 
    1515mtool = getToolByName(context, 'portal_membership') 
     
    2020isForAnonymous = pp['qPloneComments'].getProperty('enable_anonymous_commenting', None) 
    2121ifModerate = pp['qPloneComments'].getProperty('enable_moderation', None); 
     22requireEmail = pp['qPloneComments'].getProperty('require_email', False) 
    2223 
    2324if username or password: 
     
    6263 
    6364tb = dtool.getDiscussionFor(context) 
    64 id = tb.createReply(title=subject, text=body_text, Creator=comment_creator) 
     65 
     66if requireEmail: 
     67    if mtool.isAnonymousUser(): 
     68        email = req.get('user_email', '') 
     69    else: 
     70        email = mtool.getAuthenticatedMember().getProperty('email') 
     71 
     72    id = tb.createReply(title=subject, text=body_text, Creator=comment_creator, email=email) 
     73else: 
     74    id = tb.createReply(title=subject, text=body_text, Creator=comment_creator) 
     75 
    6576reply = tb.getReply(id) 
    6677 
     
    7283 
    7384# Send notification e-mail 
    74 send_notification_message = send_email(reply, context, state="approve"
     85manage_mails(reply, context, 'aproving'
    7586if not ifModerate: 
    76     send_notification_message += send_email(reply, context, state="published"
     87    manage_mails(reply, context, 'publishing'
    7788 
    7889# return to the discussable object. 
  • qPloneComments/branches/plone-2.5/skins/qplonecomments/2.1/discussion_reply_form.cpt

    r545 r546  
    109109                    </div> 
    110110                </div> 
     111              <div class="field" 
     112                     tal:define="property_id string:require_email; 
     113                                 props_sheet here/portal_properties/qPloneComments" 
     114                     tal:condition="python:props_sheet.getProperty(property_id) and isAnon"> 
     115 
     116                    <label for="user_email" i18n:translate="label_discussion-manager_email">Please enter your email:</label> 
     117                    <span class="fieldRequired" title="Required" 
     118                          i18n:attributes="title title_required;" 
     119                          i18n:translate="label_required">(Required) 
     120                    </span> 
     121                    <div tal:content="string:">Validation error output</div> 
     122 
     123                    <input name="user_email" 
     124                           value="" 
     125                           size="40" 
     126                           tabindex="" 
     127                           tal:attributes="tabindex tabindex/next;" /> 
     128                </div> 
     129 
    111130            </div> 
    112131 
  • qPloneComments/branches/plone-2.5/skins/qplonecomments/2.5/discussion_publish_comment.py

    r545 r546  
    1010from Products.CMFPlone import transaction_note 
    1111from Products.CMFCore.utils import getToolByName 
    12 from Products.qPloneComments.utils import publishDiscussion,  
     12from Products.qPloneComments.utils import publishDiscussion 
    1313 
    1414if obj is None: 
     
    2525publishDiscussion(reply) 
    2626 
    27  
    2827portal_status_message='Comment+successfully+published' 
    2928 
  • qPloneComments/branches/plone-2.5/skins/qplonecomments/2.5/discussion_reply_form.cpt

    r545 r546  
    120120                          i18n:translate="label_required">(Required) 
    121121                    </span> 
    122               <div tal:content="string:">Validation error output</div> 
     122                    <div tal:content="string:">Validation error output</div> 
    123123 
    124124                    <input name="user_email" 
     
    127127                           tabindex="" 
    128128                           tal:attributes="tabindex tabindex/next;" /> 
    129               </div> 
     129                </div> 
    130130            </div> 
    131131 
  • qPloneComments/branches/plone-2.5/skins/qplonecomments/prefs_comments_setup_form.cpt

    r545 r546  
    258258                </div> 
    259259 
    260                 <div class="field" 
    261                      tal:define="property_id string:enable_reply_user_notification; 
    262                                  isReplyNotificationEnabled python:props_sheet.getProperty(property_id, False);" 
    263                      tal:condition="python:props_sheet.hasProperty(property_id)"> 
    264  
    265                     <input type="checkbox"  
    266                            class="noborder" 
    267                            name="isReplyNotificationEnabled" 
    268                            id="isReplyNotificationEnabled" 
    269                            tabindex ="" 
    270                            tal:attributes="name property_id; 
    271                                            value isReplyNotificationEnabled; 
    272                                            checked python:test(isReplyNotificationEnabled, 'True', ''); 
    273                                            tabindex tabindex/next;"/> 
    274  
    275                     <label i18n:translate="label_enable_approve_notification" 
    276                            for="isReplyNotificationEnabled">Enable Commentator notification on comment was replied.</label> 
    277                 </div> 
    278260 
    279261                <div class="field"