Пример #1
0
 def _process(self):
     error=[]
     if self._cancel:
         self._redirect(urlHandlers.UHAbstractModNotifTplDisplay.getURL(self._target))
         return
     elif self._save:
         if len(self._toList)<=0:
             error.append( _("""At least one "To Address" must be seleted """))
             p=WPModCFANotifTplEdit(self, self._target)
             return p.display(errorList=error, \
                                 title=self._title, \
                                 subject=self._subject, \
                                 body=self._body, \
                                 fromAddr=self._fromAddr, \
                                 toList=self._toList, \
                                 ccList=self._ccList)
         else:
             self._notifTpl.setName(self._title)
             self._notifTpl.setDescription(self._description)
             self._notifTpl.setTplSubject(self._subject, EmailNotificator.getVarList())
             self._notifTpl.setTplBody(self._body, EmailNotificator.getVarList())
             self._notifTpl.setFromAddr(self._fromAddr)
             self._notifTpl.setCCAddrList(self._ccList)
             self._notifTpl.setCAasCCAddr(self._CAasCCAddr)
             self._notifTpl.clearToAddrs()
             for toAddr in self._toList:
                 toAddrWrapper=NotifTplToAddrsFactory.getToAddrById(toAddr)
                 if toAddrWrapper:
                     toAddrWrapper.addToAddr(self._notifTpl)
             self._redirect(urlHandlers.UHAbstractModNotifTplDisplay.getURL(self._target))
             return
     else:
         p=WPModCFANotifTplEdit(self, self._target)
         return p.display()
Пример #2
0
 def _process(self):
     if self._cancel:
         self._redirect(
             urlHandlers.UHAbstractModNotifTplDisplay.getURL(self._target))
         return
     elif self._save:
         if len(self._toList) <= 0:
             raise NoReportError(
                 _("""At least one "To Address" must be seleted """))
             p = WPModCFANotifTplEdit(self, self._target)
             return p.display(title=self._title,
                              subject=self._subject,
                              body=self._body,
                              fromAddr=self._fromAddr,
                              toList=self._toList,
                              ccList=self._ccList)
         else:
             self._setValues()
             self._redirect(
                 urlHandlers.UHAbstractModNotifTplDisplay.getURL(
                     self._target))
             return
     else:
         p = WPModCFANotifTplEdit(self, self._target)
         return p.display()
Пример #3
0
 def _process(self):
     if self._cancel:
         self._redirect(
             urlHandlers.UHAbstractModNotifTplDisplay.getURL(self._target))
         return
     elif self._save:
         if len(self._toList) <= 0:
             raise NoReportError(
                 _("""At least one "To Address" must be seleted """))
             p = WPModCFANotifTplEdit(self, self._target)
             return p.display(title=self._title,
                              subject=self._subject,
                              body=self._body,
                              fromAddr=self._fromAddr,
                              toList=self._toList,
                              ccList=self._ccList)
         else:
             self._notifTpl.setName(self._title)
             self._notifTpl.setDescription(self._description)
             self._notifTpl.setTplSubject(self._subject,
                                          EmailNotificator.getVarList())
             self._notifTpl.setTplBody(self._body,
                                       EmailNotificator.getVarList())
             self._notifTpl.setFromAddr(self._fromAddr)
             self._notifTpl.setCCAddrList(self._ccList)
             self._notifTpl.setCAasCCAddr(self._CAasCCAddr)
             self._notifTpl.clearToAddrs()
             for toAddr in self._toList:
                 toAddrWrapper = NotifTplToAddrsFactory.getToAddrById(
                     toAddr)
                 if toAddrWrapper:
                     toAddrWrapper.addToAddr(self._notifTpl)
             self._redirect(
                 urlHandlers.UHAbstractModNotifTplDisplay.getURL(
                     self._target))
             return
     else:
         p = WPModCFANotifTplEdit(self, self._target)
         return p.display()
Пример #4
0
 def _process(self):
     if self._cancel:
         self._redirect(
             urlHandlers.UHAbstractModNotifTplDisplay.getURL(self._target))
         return
     elif self._save:
         if len(self._toList) <= 0:
             raise NoReportError(
                 _("""At least one "To Address" must be seleted """))
             p = WPModCFANotifTplEdit(self, self._target)
             return p.display(title=self._title,
                              subject=self._subject,
                              body=self._body,
                              fromAddr=self._fromAddr,
                              toList=self._toList,
                              ccList=self._ccList)
         else:
             self._setValues()
             self._redirect(urlHandlers.UHAbstractModNotifTplDisplay.getURL(self._target))
             return
     else:
         p=WPModCFANotifTplEdit(self, self._target)
         return p.display()