Exemplo n.º 1
0
 def _process(self):
     if self._addNew:
         self._redirect(RHRegistrantNewForm._uh.getURL(self._conf))
     elif self._remove:
         if len(self._selectedRegistrants) > 0:
             wp = registrants.WPRegistrantModifRemoveConfirmation(
                 self, self._conf, self._selectedRegistrants)
             return wp.display()
         else:
             self._redirect(
                 urlHandlers.UHConfModifRegistrantList.getURL(self._conf))
     elif self._email:
         r = RHRegistrantListEmail(self, self._conf, self._reglist)
         return r.email()
     elif self._emailSelected:
         if len(self._selectedRegistrants) > 0:
             r = RHRegistrantListEmail(self, self._conf,
                                       self._selectedRegistrants)
             return r.email()
         else:
             self._redirect(
                 urlHandlers.UHConfModifRegistrantList.getURL(self._conf))
     elif self._pdf:
         regs = []
         for reg in self._reglist:
             if self._conf.getRegistrantById(reg) != None:
                 regs.append(self._conf.getRegistrantById(reg))
         r = RHRegistrantListPDF(self, self._conf, regs, self._display)
         return r.pdf()
     elif self._info:
         regs = []
         for reg in self._reglist:
             if self._conf.getRegistrantById(reg) != None:
                 regs.append(self._conf.getRegistrantById(reg))
         r = RHRegistrantsInfo(self, self._conf, regs)
         return r.info()
     elif self._excel:
         regs = []
         for reg in self._reglist:
             if self._conf.getRegistrantById(reg) != None:
                 regs.append(self._conf.getRegistrantById(reg))
         r = RHRegistrantListExcel(self, self._conf, regs, self._display)
         return r.excel()
     elif self._printBadgesSelected:
         if len(self._selectedRegistrants) > 0:
             wp = registrants.WPRegistrantModifPrintBadges(
                 self, self._conf, self._selectedRegistrants)
             return wp.display()
         else:
             self._redirect(
                 urlHandlers.UHConfModifRegistrantList.getURL(self._conf))
     else:
         self._redirect(
             urlHandlers.UHConfModifRegistrantList.getURL(self._conf))
Exemplo n.º 2
0
 def _process(self):
     set_best_lang(
     )  # prevents from having a _LazyString when generating a pdf without session.lang set
     if self._addNew:
         self._redirect(RHRegistrantNewForm._uh.getURL(self._conf))
     elif self._remove:
         if len(self._selectedRegistrants) > 0:
             wp = registrants.WPRegistrantModifRemoveConfirmation(
                 self, self._conf, self._selectedRegistrants)
             return wp.display()
         else:
             self._redirect(
                 urlHandlers.UHConfModifRegistrantList.getURL(self._conf))
     elif self._email:
         r = RHRegistrantListEmail(self, self._conf, self._reglist)
         return r.email()
     elif self._emailSelected:
         if len(self._selectedRegistrants) > 0:
             r = RHRegistrantListEmail(self, self._conf,
                                       self._selectedRegistrants)
             return r.email()
         else:
             self._redirect(
                 urlHandlers.UHConfModifRegistrantList.getURL(self._conf))
     elif self._tablePDF:
         regs = []
         for reg in self._selectedRegistrants:
             if self._conf.getRegistrantById(reg) != None:
                 regs.append(self._conf.getRegistrantById(reg))
         r = RHRegistrantListPDF(self, self._conf, regs, self._display)
         return r.pdf()
     elif self._bookPDF:
         regs = []
         for reg in self._selectedRegistrants:
             if self._conf.getRegistrantById(reg) != None:
                 regs.append(self._conf.getRegistrantById(reg))
         r = RHRegistrantBookPDF(self, self._conf, regs, self._display)
         return r.pdf()
     elif self._excel:
         regs = []
         for reg in self._selectedRegistrants:
             if self._conf.getRegistrantById(reg) != None:
                 regs.append(self._conf.getRegistrantById(reg))
         r = RHRegistrantListExcel(self, self._conf, regs, self._display,
                                   self._windowsAgent)
         return r.excel()
     elif self._printBadgesSelected:
         if len(self._selectedRegistrants) > 0:
             wp = registrants.WPRegistrantModifPrintBadges(
                 self, self._conf, self._selectedRegistrants)
             return wp.display()
         else:
             self._redirect(
                 urlHandlers.UHConfModifRegistrantList.getURL(self._conf))
     elif self._package:
         regs = []
         for reg in self._selectedRegistrants:
             if self._conf.getRegistrantById(reg) != None:
                 regs.append(self._conf.getRegistrantById(reg))
         r = RHRegistrantPackage(self, self._conf, regs)
         return r.pack()
     else:
         self._redirect(
             urlHandlers.UHConfModifRegistrantList.getURL(self._conf))