Changeset ab85b3 in indico


Ignore:
Timestamp:
02/17/11 17:20:11 (2 years ago)
Author:
Pedro Ferreira <jose.pedro.ferreira@…>
Branches:
master, burotel, hello-world-walkthrough, ipv6, v0.97-series, v0.98-series, v0.98.2, v0.98.3, v0.98b1, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, d9941f8582b36b24821a11ea5ba16fda6a457fb1
Children:
08b56c
Parents:
8dee82
git-author:
Adrian Moennich <jerome.ernst.monnich@…> (01/17/11 14:54:14)
git-committer:
Pedro Ferreira <jose.pedro.ferreira@…> (02/17/11 17:20:11)
Message:

[IMP] Various regform/epayment improvements

  • Get rid of space right after '('
  • Allow disabling of certain conference registration emails
  • Make the "payment successful" email (partially) customizable
  • Make the "payment summary" email (partially) customizable
  • fixes #602
Location:
indico
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • indico/MaKaC/epayment.py

    r5e3946 rab85b3  
    170170            return "%s"%(self.getPaymentSpecificConditions()) 
    171171 
     172    def getPaymentReceiptMsg(self): 
     173        try: 
     174            return self.receiptMsg 
     175        except: 
     176            self.receiptMsg = EPaymentDefaultValues.getDefaultReceiptMsg() 
     177        return self.receiptMsg 
     178 
     179    def setPaymentReceiptMsg(self, txt): 
     180        self.receiptMsg = txt 
     181 
     182    def getPaymentSuccessMsg(self): 
     183        try: 
     184            return self.successMsg 
     185        except: 
     186            self.successMsg = EPaymentDefaultValues.getDefaultSuccessMsg() 
     187        return self.successMsg 
     188 
     189    def setPaymentSuccessMsg(self, txt): 
     190        self.successMsg = txt 
     191 
    172192    def isActivated(self): 
    173193        return self.activated 
     
    301321The Conference committee reserves the right to refuse reimbursement of part or all of the fee in the case of late cancellation. However, each case of cancellation would be considered individually. 
    302322""" 
     323 
     324    @staticmethod 
     325    def getDefaultSuccessMsg(): 
     326        return """Congratulations, your payment was successful.""" 
     327 
     328    @staticmethod 
     329    def getDefaultReceiptMsg(): 
     330        return """Please, see the summary of your order:""" 
    303331 
    304332class BaseEPayMod(Persistent): 
  • indico/MaKaC/registration.py

    r0a3c0a rab85b3  
    126126        form.setActivated(self.isActivated()) 
    127127        form.setMandatoryAccount(self.isMandatoryAccount()) 
     128        form.setSendRegEmail(self.isSendRegEmail()) 
     129        form.setSendReceiptEmail(self.isSendReceiptEmail()) 
     130        form.setSendPaidEmail(self.isSendPaidEmail()) 
     131        form.setAllSessions() 
    128132        form.notification=self.getNotification().clone() 
    129133        form.personalData = self.getPersonalData().clone() 
     
    202206    def setMandatoryAccount(self, v=True): 
    203207        self._mandatoryAccount = v 
     208 
     209    def isSendRegEmail(self): 
     210        try: 
     211            if self._sendRegEmail: 
     212                pass 
     213        except AttributeError, e: 
     214            self._sendRegEmail = True 
     215        return self._sendRegEmail 
     216 
     217    def setSendRegEmail(self, v=True): 
     218        self._sendRegEmail = v 
     219 
     220    def isSendReceiptEmail(self): 
     221        try: 
     222            if self._sendReceiptEmail: 
     223                pass 
     224        except AttributeError, e: 
     225            self._sendReceiptEmail = True 
     226        return self._sendReceiptEmail 
     227 
     228    def setSendReceiptEmail(self, v=True): 
     229        self._sendReceiptEmail = v 
     230 
     231    def isSendPaidEmail(self): 
     232        try: 
     233            if self._sendPaidEmail: 
     234                pass 
     235        except AttributeError, e: 
     236            self._sendPaidEmail = True 
     237        return self._sendPaidEmail 
     238 
     239    def setSendPaidEmail(self, v=True): 
     240        self._sendPaidEmail = v 
    204241 
    205242    def setTitle( self, newName ): 
     
    723760            GenericMailer.send(GenericNotification(maildata)) 
    724761        # send mail to participant 
    725         if rp.getEmail().strip() != "": 
     762        if regForm.isSendRegEmail() and rp.getEmail().strip() != "": 
    726763            bodyReg = _(""" 
    727764Congratulations, your registration to %s was successful%s See your information below: 
     
    816853        # send email to participants 
    817854        if registrant.getEmail().strip() != "": 
    818             bodyReg = _(""" 
    819              Please, see the summary of your order:\n\n%s\n\n%s""")%\ 
    820                                                                                  ("\n".join(booking),body) 
     855            bodyReg = _("""%s\n\n%s\n\n%s""")%( 
     856                registrant.getConference().getModPay().getPaymentReceiptMsg(), 
     857                "\n".join(booking), body) 
    821858            to=registrant.getEmail().strip() 
    822859            maildata = { "fromAddr": fromAddr, "toList": [to], "subject": subject, "body": bodyReg } 
     
    830867 
    831868        subject= _("""New registrant in '%s': %s""")%(strip_ml_tags(registrant.getConference().getTitle()), registrant.getFullName()) 
    832         body= _(""" 
    833         thank you for the payment :\n 
    834  
    835 - detail of payment  : \n%s 
     869        body= _("""- detail of payment  : \n%s 
    836870- date conference    : %s 
    837871- name conference    : %s 
     
    839873        booking=[] 
    840874        total=0 
    841         booking.append( _(""" Thank you for this payment """)) 
    842875        booking.append("""Quantity\t\tItem\t\tunit.price\t\tCost""") 
    843876        for gsf in registrant.getMiscellaneousGroupList(): 
     
    886919            GenericMailer.send(GenericNotification(maildata)) 
    887920        # send email to participant 
    888         if registrant.getEmail().strip() != "": 
    889             bodyReg =  _(""" 
    890              Congratulations, your registration and your payment were successful. See your informations below:\n\n%s\n\n%s""")%\ 
    891                                                                                  ("\n".join(booking),body) 
     921        if regForm.isSendPaidEmail() and registrant.getEmail().strip() != "": 
     922            bodyReg =  _("""%s\n\n%s\n\n%s""")%(registrant.getConference().getModPay().getPaymentSuccessMsg(), 
     923                                                                "\n".join(booking), 
     924                                                                body) 
    892925            to=registrant.getEmail().strip() 
    893926            maildata = { "fromAddr": fromAddr, "toList": [to], "subject": subject, "body": bodyReg } 
  • indico/MaKaC/webinterface/pages/epayments.py

    rdd81bc rab85b3  
    122122            vars["conditionsPayment"] = self._conf.getModPay().getPaymentConditions() 
    123123            vars["specificConditionsPayment"] = self._conf.getModPay().getPaymentSpecificConditions() 
     124            vars["successMsgPayment"] = self._conf.getModPay().getPaymentSuccessMsg() 
     125            vars["receiptMsgPayment"] = self._conf.getModPay().getPaymentReceiptMsg() 
    124126            vars["conditionsEnabled"] = "DISABLED" 
    125127            if self._conf.getModPay().arePaymentConditionsEnabled(): 
     
    134136            vars["conditionsEnabled"] = "DISABLED" 
    135137            vars["specificConditionsPayment"] = "" 
     138            vars["successMsgPayment"] = "" 
     139            vars["receiptMsgPayment"] = "" 
    136140        vars["dataModificationURL"]=urlHandlers.UHConfModifEPaymentdetailPaymentModification.getURL(self._conf) 
    137141        vars["sections"] = self._getSectionsHTML() 
     
    152156        vars = wcomponents.WTemplated.getVars(self) 
    153157        vars["postURL"]=urlHandlers.UHConfModifEPaymentPerformdetailPaymentModification.getURL(self._conf) 
     158        vars["dataModificationURL"]=urlHandlers.UHConfModifRegFormDataModification.getURL(self._conf) 
    154159        vars["detailPayment"]= self._conf.getModPay().getPaymentDetails() 
    155160        vars["conditionsPayment"]= self._conf.getModPay().getPaymentConditions() 
     
    158163        if self._conf.getModPay().arePaymentConditionsEnabled(): 
    159164            vars["conditionsEnabled"]= "checked=\"checked\"" 
     165        vars["successMsgPayment"] = self._conf.getModPay().getPaymentSuccessMsg() 
     166        vars["receiptMsgPayment"] = self._conf.getModPay().getPaymentReceiptMsg() 
     167        regForm = self._conf.getRegistrationForm() 
     168        vars["successMsgPaymentEnabled"] = regForm.isSendPaidEmail() and _("ENABLED") or _("DISABLED") 
     169        vars["receiptMsgPaymentEnabled"] = regForm.isSendReceiptEmail() and _("ENABLED") or _("DISABLED") 
    160170        return vars 
    161171 
  • indico/MaKaC/webinterface/pages/registrationForm.py

    r2e8d57 rab85b3  
    253253            if not regForm.isMandatoryAccount(): 
    254254                vars["mandatoryAccount"] =  _("No") 
     255            vars["sendRegEmail"] = _("Yes") 
     256            if not regForm.isSendRegEmail(): 
     257                vars["sendRegEmail"] = _("No") 
     258            vars["sendReceiptEmail"] = _("Yes") 
     259            if not regForm.isSendReceiptEmail(): 
     260                vars["sendReceiptEmail"] = _("No") 
     261            vars["sendPaidEmail"] = _("Yes") 
     262            if not regForm.isSendPaidEmail(): 
     263                vars["sendPaidEmail"] = _("No") 
    255264            vars["Currency"]=regForm.getCurrency() 
    256265        else: 
     
    270279            vars["notification"] = "" 
    271280            vars["mandatoryAccount"] = "" 
     281            vars["sendRegEmail"] = "" 
     282            vars["sendReceiptEmail"] = "" 
     283            vars["sendPaidEmail"] = "" 
    272284            vars["Currency"]="" 
    273285        vars["sections"] = self._getSectionsHTML() 
     
    327339        vars["mandatoryAccount"]="" 
    328340        if regForm.isMandatoryAccount(): 
    329             vars["mandatoryAccount"]= _("CHECKED") 
     341            vars["mandatoryAccount"]= "CHECKED" 
     342        vars["sendRegEmail"] = "" 
     343        vars["sendReceiptEmail"] = "" 
     344        vars["sendPaidEmail"] = "" 
     345        if regForm.isSendRegEmail(): 
     346            vars["sendRegEmail"] = "CHECKED" 
     347        if regForm.isSendReceiptEmail(): 
     348            vars["sendReceiptEmail"] = "CHECKED" 
     349        if regForm.isSendPaidEmail(): 
     350            vars["sendPaidEmail"] = "CHECKED" 
    330351        vars["Currency"]="""<select name="%s">%s</select>"""%("Currency", CurrencyRegistry.getSelectItemsHTML(regForm.getCurrency())) 
    331352        vars["extraTimeAmount"] = regForm.getEndExtraTimeAmount() 
  • indico/MaKaC/webinterface/rh/ePaymentModif.py

    rf249b3 rab85b3  
    7676            modpay.setPaymentDetails(params.get("detailPayment", "")) 
    7777            modpay.setPaymentSpecificConditions(params.get("specificConditionsPayment", "")) 
     78            modpay.setPaymentSuccessMsg(params.get("successMsgPayment", "")) 
     79            modpay.setPaymentReceiptMsg(params.get("receiptMsgPayment", "")) 
    7880            from MaKaC.common import HelperMaKaCInfo 
    7981            minfo = HelperMaKaCInfo.getMaKaCInfoInstance() 
  • indico/MaKaC/webinterface/rh/registrationFormDisplay.py

    r4b2050 rab85b3  
    224224        if self._registrant is not None: 
    225225            # avoid multiple sending in case of db conflict 
    226             if not hasattr(self, "_emailSent"): 
     226            if not hasattr(self, "_emailSent") and self._regForm.isSendReceiptEmail(): 
    227227                self._regForm.getNotification().sendEmailNewRegistrantDetailsPay(self._regForm,self._registrant) 
    228228                self._emailSent = True 
  • indico/MaKaC/webinterface/rh/registrationFormModif.py

    r4b2050 rab85b3  
    127127            regForm.getNotification().setCCList( utils.getEmailList(params.get("ccList", "")) ) 
    128128            regForm.setMandatoryAccount(params.has_key("mandatoryAccount")) 
     129            regForm.setSendRegEmail(params.has_key("sendRegEmail")) 
     130            regForm.setSendReceiptEmail(params.has_key("sendReceiptEmail")) 
     131            regForm.setSendPaidEmail(params.has_key("sendPaidEmail")) 
    129132            regForm.setCurrency(params.get("Currency","")) 
    130133        self._redirect(urlHandlers.UHConfModifRegForm.getURL(self._conf)) 
  • indico/MaKaC/webinterface/tpls/ConfModifEPayment.tpl

    r9033fd rab85b3  
    66        <td bgcolor="white" width="100%%" class="blacktext" colspan="2"> 
    77            <form action="%(setStatusURL)s" method="POST"> 
    8                 <input name="changeTo" type="hidden" value="%(changeTo)s">  
    9                 <b>%(status)s</b>  
     8                <input name="changeTo" type="hidden" value="%(changeTo)s"> 
     9                <b>%(status)s</b> 
    1010                <small><input type="submit" value="%(changeStatus)s"></small> 
    1111            </form> 
     
    4141<%end%> 
    4242    <tr> 
    43         <td class="dataCaptionTD"><span class="dataCaptionFormat">Conditions</span></td> 
     43        <td class="dataCaptionTD"><span class="dataCaptionFormat"><%= _("Conditions")%></span></td> 
    4444        <td bgcolor="white" width="100%%" class="blacktext"> 
    4545           <TEXTAREA ROWS="6" COLS="60" disabled="true" >%(specificConditionsPayment)s</TEXTAREA> 
     46           <br/> 
     47        </td> 
     48        <td></td> 
     49    </tr> 
     50    <tr> 
     51        <td class="dataCaptionTD"><span class="dataCaptionFormat"><%= _("Payment Summary Email Message")%></span></td> 
     52        <td bgcolor="white" width="100%%" class="blacktext"> 
     53           <textarea rows="6" cols="60" disabled="disabled">%(receiptMsgPayment)s</textarea> 
     54           <br/> 
     55        </td> 
     56        <td></td> 
     57    </tr> 
     58    <tr> 
     59        <td class="dataCaptionTD"><span class="dataCaptionFormat"><%= _("Success Email Message")%></span></td> 
     60        <td bgcolor="white" width="100%%" class="blacktext"> 
     61           <textarea rows="6" cols="60" disabled="disabled">%(successMsgPayment)s</textarea> 
    4662           <br/> 
    4763        </td> 
  • indico/MaKaC/webinterface/tpls/ConfModifEPaymentDataModification.tpl

    r9033fd rab85b3  
    2828            <td align="left"><TEXTAREA name="specificConditionsPayment" ROWS="6" COLS="60">%(specificConditionsPayment)s</TEXTAREA></td> 
    2929        </tr> 
     30        <tr> 
     31            <td nowrap class="dataCaptionTD"><span class="titleCellFormat"><%= _("Payment Summary Email Message")%></span></td> 
     32            <td align="left"> 
     33                <%=_("Currently this email is")%> <strong>%(receiptMsgPaymentEnabled)s</strong> (<%=_("You can change this in the")%> <a href="%(dataModificationURL)s"><%=_("registration form setup")%></a>)<br> 
     34                <textarea name="receiptMsgPayment" rows="6" cols="60">%(receiptMsgPayment)s</textarea> 
     35            </td> 
     36        </tr> 
     37        <tr> 
     38            <td nowrap class="dataCaptionTD"><span class="titleCellFormat"><%= _("Success Email Message")%></span></td> 
     39            <td align="left"> 
     40                <%=_("Currently this email is")%> <strong>%(successMsgPaymentEnabled)s</strong> (<%=_("You can change this in the")%> <a href="%(dataModificationURL)s"><%=_("registration form setup")%></a>)<br> 
     41                <textarea name="successMsgPayment" rows="6" cols="60">%(successMsgPayment)s</textarea> 
     42            </td> 
     43        </tr> 
    3044                <tr><td>&nbsp;</td></tr> 
    3145        <tr> 
  • indico/MaKaC/webinterface/tpls/ConfModifRegForm.tpl

    r3e5a5e rab85b3  
    6969    <td class="blacktext"> 
    7070      %(notification)s 
     71    </td> 
     72  </tr> 
     73  <tr> 
     74    <td class="dataCaptionTD"><span class="dataCaptionFormat"> <%= _("Email registrant:")%></span></td> 
     75    <td bgcolor="white" width="100%%"> 
     76      <table> 
     77        <tr> 
     78          <td align="right"><strong><%= _("After registration")%></strong>:</td> 
     79          <td>%(sendRegEmail)s</td> 
     80        </tr> 
     81        <tr> 
     82          <td align="right"><strong><%= _("With a payment summary")%></strong>:</td> 
     83          <td>%(sendReceiptEmail)s</td> 
     84        </tr> 
     85        <tr> 
     86          <td align="right"><strong><%= _("After successful payment")%></strong>:</td> 
     87          <td>%(sendPaidEmail)s</td> 
     88        </tr> 
     89      </table> 
    7190    </td> 
    7291  </tr> 
  • indico/MaKaC/webinterface/tpls/ConfModifRegFormDataModification.tpl

    r3e5a5e rab85b3  
    8686    </tr> 
    8787    <tr> 
    88       <td nowrap class="titleCellTD"><span class="titleCellFormat"> <%= _("Email Notification")%></span></td> 
     88      <td nowrap class="titleCellTD"> 
     89        <span class="titleCellFormat"> <%= _("Email organisators")%></span><br> 
     90        <span class="smallLabel"><%= _("(on new registrations)")%></span> 
     91      </td> 
    8992      <td bgcolor="white" width="100%%"> 
    9093        <table align="left"> 
     
    98101        </tr> 
    99102        <tr> 
    100           <td> 
     103          <td align="right"> 
    101104          <b> <%= _("Cc List")%>:&nbsp;</b> 
    102105          </td> 
     
    109112    </tr> 
    110113    <tr> 
     114      <td nowrap class="titleCellTD"><span class="titleCellFormat"> <%= _("Email registrant...")%></span></td> 
     115      <td bgcolor="white" width="100%%"> 
     116        <input type="checkbox" size="50" name="sendRegEmail" id="sendRegEmail" %(sendRegEmail)s> 
     117        <label for="sendRegEmail"><strong><%= _("...after registration")%></strong></label> 
     118        <br> 
     119 
     120        <input type="checkbox" size="50" name="sendReceiptEmail" id="sendReceiptEmail" %(sendReceiptEmail)s> 
     121        <label for="sendReceiptEmail"><strong><%= _("...with a payment summary")%></strong></label> 
     122        <br> 
     123 
     124        <input type="checkbox" size="50" name="sendPaidEmail" id="sendPaidEmail" %(sendPaidEmail)s> 
     125        <label for="sendPaidEmail"><strong><%= _("...after successful payment")%></strong></label> 
     126      </td> 
     127    </tr> 
     128    <tr> 
    111129      <td nowrap class="titleCellTD"><span class="titleCellFormat"> <%= _("Must have an account")%></span></td> 
    112       <td bgcolor="white" width="100%%"><input type="checkbox" size="50" name="mandatoryAccount" %(mandatoryAccount)s> ( <%= _("Uncheck if an account is not needed")%>)</td> 
     130      <td bgcolor="white" width="100%%"><input type="checkbox" size="50" name="mandatoryAccount" %(mandatoryAccount)s> (<%= _("Uncheck if an account is not needed")%>)</td> 
    113131    </tr> 
    114132 
  • indico/htdocs/css/Default.css

    rc3f99f rab85b3  
    1313div.wrapper .emptyFooter { 
    1414    height: 50px; /* The height of the footer */ 
     15} 
     16 
     17.smallLabel { 
     18    font-size: 10px; 
    1519} 
    1620 
Note: See TracChangeset for help on using the changeset viewer.