Exemple #1
0
 def getVars(self):
     vars = wcomponents.WTemplated.getVars(self)
     vars["locator"] = self._subContrib.getLocator().getWebForm()
     vars["title"] = self._subContrib.getTitle()
     if isStringHTML(self._subContrib.getDescription()):
         vars["description"] = self._subContrib.getDescription()
     else:
         vars[
             "description"] = """<table class="tablepre"><tr><td><pre>%s</pre></td></tr></table>""" % self._subContrib.getDescription(
             )
     vars["dataModifButton"] = ""
     vars["dataModifButton"] = _(
         """<input type="submit" class="btn" value="_("modify")">""")
     speakerText = self._subContrib.getSpeakerText()
     if speakerText != "":
         speakerText = "%s<br>" % speakerText
     p = {"newSpeakerURL":vars["newSpeakerURL"],\
         "searchSpeakersURL":vars["searchSpeakersURL"], \
         "removeSpeakersURL":vars["removeSpeakersURL"], \
         "modSpeakerURLGen":vars['modSpeakerURLGen']}
     pt = WSubContribSpeakerTable(self._subContrib.getSpeakerList(),
                                  self._subContrib).getHTML(p)
     vars["speakersTable"] = "%s%s" % (speakerText, pt)
     vars["reportNumbersTable"] = wcomponents.WReportNumbersTable(
         self._subContrib, "subcontribution").getHTML()
     vars["keywords"] = self._subContrib.getKeywords()
     return vars
Exemple #2
0
    def getVars( self ):
        vars = wcomponents.WTemplated.getVars( self )

        vars["dataModificationURL"]=quoteattr(str(urlHandlers.UHSessionDataModification.getURL(self._session)))
        vars["code"]=self.htmlText(self._session.getCode())
        vars["title"]=self._session.getTitle()
        if isStringHTML(self._session.getDescription()):
            vars["description"] = self._session.getDescription()
        else:
            vars["description"] = """<table class="tablepre"><tr><td><pre>%s</pre></td></tr></table>""" % self._session.getDescription()
        vars["bgcolor"] = self._session.getColor()
        vars["textcolor"] = self._session.getTextColor()
        vars["entryDuration"]=self.htmlText((datetime(1900,1,1)+self._session.getContribDuration()).strftime("%Hh%M'"))
        vars["tt_type"]=self.htmlText(self._session.getScheduleType())
        type = self._session.getConference().getType()
        if type == "conference":
            vars["Type"]=WSessionModifMainType().getHTML(vars)
            vars["Colors"]=WSessionModifMainColors().getHTML(vars)
            vars["Code"]=WSessionModifMainCode().getHTML(vars)
            vars["Rowspan"]=6
        else:
            vars["Type"]=""
            vars["Colors"]=""
            vars["Code"]=""
            vars["Rowspan"]=4
        vars["confId"] = self._session.getConference().getId()
        vars["sessionId"] = self._session.getId()
        return vars
Exemple #3
0
    def getVars(self):
        vars = wcomponents.WTemplated.getVars(self)

        vars["dataModificationURL"] = quoteattr(
            str(urlHandlers.UHSessionDataModification.getURL(self._session)))
        vars["code"] = self.htmlText(self._session.getCode())
        vars["title"] = self._session.getTitle()
        if isStringHTML(self._session.getDescription()):
            vars["description"] = self._session.getDescription()
        else:
            vars[
                "description"] = """<table class="tablepre"><tr><td><pre>%s</pre></td></tr></table>""" % self._session.getDescription(
                )
        vars["bgcolor"] = self._session.getColor()
        vars["textcolor"] = self._session.getTextColor()
        vars["entryDuration"] = self.htmlText(
            (datetime(1900, 1, 1) +
             self._session.getContribDuration()).strftime("%Hh%M'"))
        vars["tt_type"] = self.htmlText(self._session.getScheduleType())
        type = self._session.getConference().getType()
        if type == "conference":
            vars["Type"] = WSessionModifMainType().getHTML(vars)
            vars["Colors"] = WSessionModifMainColors().getHTML(vars)
            vars["Code"] = WSessionModifMainCode().getHTML(vars)
            vars["Rowspan"] = 6
        else:
            vars["Type"] = ""
            vars["Colors"] = ""
            vars["Code"] = ""
            vars["Rowspan"] = 4
        vars["confId"] = self._session.getConference().getId()
        vars["sessionId"] = self._session.getId()
        return vars
Exemple #4
0
 def getVars(self):
     vars = wcomponents.WTemplated.getVars(self)
     vars["locator"] = self._subContrib.getLocator().getWebForm()
     vars["title"] = self._subContrib.getTitle()
     if isStringHTML(self._subContrib.getDescription()):
         vars["description"] = self._subContrib.getDescription()
     else:
         vars[
             "description"] = """<table class="tablepre"><tr><td><pre>%s</pre></td></tr></table>""" % self._subContrib.getDescription(
             )
     vars["dataModifButton"] = ""
     vars["dataModifButton"] = _(
         """<input type="submit" class="btn" value="_("modify")">""")
     vars["reportNumbersTable"] = wcomponents.WReportNumbersTable(
         self._subContrib, "subcontribution").getHTML()
     vars["keywords"] = self._subContrib.getKeywords()
     vars["confId"] = self._subContrib.getConference().getId()
     vars["contribId"] = self._subContrib.getContribution().getId()
     vars["subContribId"] = self._subContrib.getId()
     vars["presenters"] = fossilize(self._subContrib.getSpeakerList(),
                                    ISubContribParticipationFullFossil)
     vars["suggested_authors"] = fossilize(
         get_authors_from_author_index(self._subContrib.getConference(),
                                       10))
     vars["eventType"] = self._subContrib.getConference().getType()
     return vars
Exemple #5
0
    def _getCompiledMinutes( self ):
        minutes = []
        isHTML = False
        cList = self._target.getContributionList()
        cList.sort(sortContributionByDate)
        for c in cList:
            if c.getMinutes():
                minText = c.getMinutes().getText()
                minutes.append([c.getTitle(),minText])
                if isStringHTML(minText):
                    isHTML = True
        if isHTML:
            lb = "<br>"
        else:
            lb = "\n"
        text = "%s (%s)%s" % (self._target.getTitle(), self._target.getStartDate().strftime("%d %b %Y"), lb)
        part = self._target.getParticipation().getPresentParticipantListText()
        if part != "":
            text += "Present: %s%s" % (part,lb)
        uList = self._target.getChairList()
        chairs = ""
        for chair in uList:
            if chairs != "":
                chairs += "; "
            chairs += chair.getFullName()
        if len(uList) > 0:
            text += "Chaired by: %s%s%s" % (chairs, lb, lb)
        for min in minutes:
            text += "==================%s%s%s==================%s%s%s%s" % (lb,min[0],lb,lb,min[1],lb,lb)

        return text
Exemple #6
0
def escape(text):
    if text is None:
        text = ""
    try:
        text = PDFHTMLParser().parse(text)
        if not isStringHTML(text):
            text = text.replace("\r\n"," <br/>")
            text = text.replace("\n"," <br/>")
            text = text.replace("\r"," <br/>")
        return text
    except Exception:
        return saxutils.escape(text)
Exemple #7
0
def escape(text):
    if text is None:
        text = ""
    try:
        text = PDFHTMLParser().parse(text)
        if not isStringHTML(text):
            text = text.replace("\r\n", " <br/>")
            text = text.replace("\n", " <br/>")
            text = text.replace("\r", " <br/>")
        return text
    except Exception:
        return saxutils.escape(text)
Exemple #8
0
def escape(text):
    if text is None:
        text = ""
    try:
        if isStringHTML(text):
            text = sanitize_for_platypus(text)
        else:
            text = cgi.escape(text)
            text = text.replace("\r\n", " <br/>")
            text = text.replace("\n", " <br/>")
            text = text.replace("\r", " <br/>")
        return text
    except Exception:
        return saxutils.escape(text)
Exemple #9
0
 def getVars( self ):
     vars = wcomponents.WTemplated.getVars( self )
     vars["locator"] = self._subContrib.getLocator().getWebForm()
     vars["title"] = self._subContrib.getTitle()
     if isStringHTML(self._subContrib.getDescription()):
         vars["description"] = self._subContrib.getDescription()
     else:
         vars["description"] = """<table class="tablepre"><tr><td><pre>%s</pre></td></tr></table>""" % self._subContrib.getDescription()
     vars["dataModifButton"] = ""
     vars["dataModifButton"] =  _("""<input type="submit" class="btn" value="_("modify")">""")
     vars["reportNumbersTable"]=wcomponents.WReportNumbersTable(self._subContrib,"subcontribution").getHTML()
     vars["keywords"] = self._subContrib.getKeywords()
     vars["confId"] = self._subContrib.getConference().getId()
     vars["contribId"] = self._subContrib.getContribution().getId()
     vars["subContribId"] = self._subContrib.getId()
     vars["presenters"] = fossilize(self._subContrib.getSpeakerList(), ISubContribParticipationFullFossil)
     vars["authors"] = fossilize(self._subContrib.getContribution().getAllAuthors())
     vars["eventType"] = self._subContrib.getConference().getType()
     return vars
 def getVars( self ):
     vars = wcomponents.WTemplated.getVars( self )
     vars["locator"] = self._subContrib.getLocator().getWebForm()
     vars["title"] = self._subContrib.getTitle()
     if isStringHTML(self._subContrib.getDescription()):
         vars["description"] = self._subContrib.getDescription()
     else:
         vars["description"] = """<table class="tablepre"><tr><td><pre>%s</pre></td></tr></table>""" % self._subContrib.getDescription()
     vars["dataModifButton"] = ""
     vars["dataModifButton"] =  _("""<input type="submit" class="btn" value="_("modify")">""")
     speakerText = self._subContrib.getSpeakerText()
     if speakerText != "":
         speakerText = "%s<br>"%speakerText
     p = {"newSpeakerURL":vars["newSpeakerURL"],\
         "searchSpeakersURL":vars["searchSpeakersURL"], \
         "removeSpeakersURL":vars["removeSpeakersURL"], \
         "modSpeakerURLGen":vars['modSpeakerURLGen']}
     pt = WSubContribSpeakerTable(self._subContrib.getSpeakerList(), self._subContrib).getHTML(p)
     vars["speakersTable"] = "%s%s"%(speakerText, pt)
     vars["reportNumbersTable"]=wcomponents.WReportNumbersTable(self._subContrib,"subcontribution").getHTML()
     vars["keywords"] = self._subContrib.getKeywords()
     return vars
Exemple #11
0
 def getVars(self):
     vars = wcomponents.WTemplated.getVars(self)
     vars["eventType"] = self._eventType
     vars["withdrawnNotice"] = self._getWithdrawnNoticeHTML()
     vars["locator"] = self._contrib.getLocator().getWebForm()
     vars["title"] = self._contrib.getTitle()
     if isStringHTML(self._contrib.getDescription()):
         vars["description"] = self._contrib.getDescription()
     else:
         vars["description"] = (
             """<table class="tablepre"><tr><td><pre>%s</pre></td></tr></table>""" % self._contrib.getDescription()
         )
     vars["additionalFields"] = self._getAdditionalFieldsHTML()
     vars["rowspan"] = "6"
     vars["place"] = ""
     if self._contrib.getLocation():
         vars["place"] = self.htmlText(self._contrib.getLocation().getName())
     room = self._contrib.getRoom()
     if room is not None and room.getName().strip() != "":
         vars["place"] = i18nformat("""%s <br> _("Room"): %s""") % (vars["place"], self.htmlText(room.getName()))
     if (
         self._eventType == "conference"
         and self._contrib.getBoardNumber() != ""
         and self._contrib.getBoardNumber() is not None
     ):
         vars["place"] = i18nformat("""%s<br> _("Board #")%s""") % (
             vars["place"],
             self.htmlText(self._contrib.getBoardNumber()),
         )
     vars["id"] = self.htmlText(self._contrib.getId())
     vars["dataModificationURL"] = str(urlHandlers.UHContributionDataModification.getURL(self._contrib))
     vars["duration"] = ""
     if self._contrib.getDuration() is not None:
         vars["duration"] = (datetime(1900, 1, 1) + self._contrib.getDuration()).strftime("%Hh%M'")
     vars["type"] = ""
     if self._contrib.getType():
         vars["type"] = self.htmlText(self._contrib.getType().getName())
     vars["track"] = i18nformat("""--_("none")--""")
     if self._contrib.getTrack():
         vars["track"] = """<a href=%s>%s</a>""" % (
             quoteattr(str(urlHandlers.UHTrackModification.getURL(self._contrib.getTrack()))),
             self.htmlText(self._contrib.getTrack().getTitle()),
         )
     vars["session"] = ""
     if self._contrib.getSession():
         vars["session"] = """<a href=%s>%s</a>""" % (
             quoteattr(str(urlHandlers.UHSessionModification.getURL(self._contrib.getSession()))),
             self.htmlText(self._contrib.getSession().getTitle()),
         )
     vars["abstract"] = ""
     if isinstance(self._contrib, conference.AcceptedContribution):
         vars["abstract"] = self._getAbstractHTML()
     vars["contrib"] = self._contrib
     vars["selTracks"] = self._getChangeTracksHTML()
     vars["setTrackURL"] = quoteattr(str(urlHandlers.UHContribModSetTrack.getURL(self._contrib)))
     vars["selSessions"] = self._getChangeSessionsHTML()
     vars["setSessionURL"] = quoteattr(str(urlHandlers.UHContribModSetSession.getURL(self._contrib)))
     vars["contribXML"] = urlHandlers.UHContribToXMLConfManager.getURL(self._contrib)
     vars["contribPDF"] = urlHandlers.UHContribToPDFConfManager.getURL(self._contrib)
     vars["printIconURL"] = Config.getInstance().getSystemIconURL("pdf")
     vars["xmlIconURL"] = Config.getInstance().getSystemIconURL("xml")
     vars["withdrawURL"] = quoteattr(str(urlHandlers.UHContribModWithdraw.getURL(self._contrib)))
     vars["withdrawnInfo"] = self._getWithdrawnInfoHTML()
     vars["withdrawDisabled"] = False
     if isinstance(self._contrib.getCurrentStatus(), conference.ContribStatusWithdrawn):
         vars["withdrawDisabled"] = True
     vars["reportNumbersTable"] = wcomponents.WReportNumbersTable(self._contrib, "contribution").getHTML()
     vars["keywords"] = self._contrib.getKeywords()
     if self._contrib.getSession():
         vars["sessionType"] = self._contrib.getSession().getScheduleType()
     else:
         vars["sessionType"] = "none"
     vars["primaryAuthors"] = self._getParticipantsList(self._contrib.getPrimaryAuthorList())
     vars["coAuthors"] = self._getParticipantsList(self._contrib.getCoAuthorList())
     vars["speakers"] = self._getParticipantsList(self._contrib.getSpeakerList())
     return vars
Exemple #12
0
    def getVars(self):
        vars = wcomponents.WTemplated.getVars(self)
        vars["eventType"] = self._eventType
        vars["withdrawnNotice"] = self._getWithdrawnNoticeHTML()
        vars["locator"] = self._contrib.getLocator().getWebForm()
        vars["title"] = self._contrib.getTitle()
        if isStringHTML(self._contrib.getDescription()):
            vars["description"] = self._contrib.getDescription()
        else:
            vars[
                "description"] = """<table class="tablepre"><tr><td><pre>%s</pre></td></tr></table>""" % self._contrib.getDescription(
                )

        afm = self._contrib.getConference().getAbstractMgr(
        ).getAbstractFieldsMgr()
        vars["additionalFields"] = afm.getActiveFields()

        vars["rowspan"] = "6"
        vars["place"] = ""
        if self._contrib.getLocation():
            vars["place"] = self.htmlText(
                self._contrib.getLocation().getName())
        room = self._contrib.getRoom()
        if room is not None and room.getName().strip() != "":
            vars["place"] = i18nformat("""%s <br> _("Room"): %s""") % (
                vars["place"], self.htmlText(room.getName()))
        if self._eventType == "conference" and self._contrib.getBoardNumber(
        ) != "" and self._contrib.getBoardNumber() is not None:
            vars["place"] = i18nformat("""%s<br> _("Board #")%s""") % (
                vars["place"], self.htmlText(self._contrib.getBoardNumber()))
        vars["id"] = self.htmlText(self._contrib.getId())
        vars["dataModificationURL"] = str(
            urlHandlers.UHContributionDataModification.getURL(self._contrib))
        vars["duration"] = ""
        if self._contrib.getDuration() is not None:
            vars["duration"] = (datetime(1900, 1, 1) +
                                self._contrib.getDuration()).strftime("%Hh%M'")
        vars["type"] = ""
        if self._contrib.getType():
            vars["type"] = self.htmlText(self._contrib.getType().getName())
        vars["track"] = i18nformat("""--_("none")--""")
        if self._contrib.getTrack():
            vars["track"] = """<a href=%s>%s</a>""" % (
                quoteattr(
                    str(
                        urlHandlers.UHTrackModification.getURL(
                            self._contrib.getTrack()))),
                self.htmlText(self._contrib.getTrack().getTitle()))
        vars["session"] = ""
        if self._contrib.getSession():
            vars["session"] = """<a href=%s>%s</a>""" % (
                quoteattr(
                    str(
                        urlHandlers.UHSessionModification.getURL(
                            self._contrib.getSession()))),
                self.htmlText(self._contrib.getSession().getTitle()))
        vars["abstract"] = ""
        if isinstance(self._contrib, conference.AcceptedContribution):
            vars["abstract"] = self._getAbstractHTML()
        vars["contrib"] = self._contrib
        vars["selTracks"] = self._getChangeTracksHTML()
        vars["setTrackURL"] = quoteattr(
            str(urlHandlers.UHContribModSetTrack.getURL(self._contrib)))
        vars["selSessions"] = self._getChangeSessionsHTML()
        vars["setSessionURL"] = quoteattr(
            str(urlHandlers.UHContribModSetSession.getURL(self._contrib)))
        vars["contribXML"] = urlHandlers.UHContribToXMLConfManager.getURL(
            self._contrib)
        vars["contribPDF"] = urlHandlers.UHContribToPDFConfManager.getURL(
            self._contrib)
        vars["printIconURL"] = Config.getInstance().getSystemIconURL("pdf")
        vars["xmlIconURL"] = Config.getInstance().getSystemIconURL("xml")
        vars["withdrawURL"] = quoteattr(
            str(urlHandlers.UHContribModWithdraw.getURL(self._contrib)))
        vars["withdrawnInfo"] = self._getWithdrawnInfoHTML()
        vars["withdrawDisabled"] = False
        if isinstance(self._contrib.getCurrentStatus(),
                      conference.ContribStatusWithdrawn):
            vars["withdrawDisabled"] = True
        vars["reportNumbersTable"] = wcomponents.WReportNumbersTable(
            self._contrib, "contribution").getHTML()
        vars["keywords"] = self._contrib.getKeywords()
        if self._contrib.getSession():
            vars["sessionType"] = self._contrib.getSession().getScheduleType()
        else:
            vars["sessionType"] = 'none'
        vars["primaryAuthors"] = self._getParticipantsList(
            self._contrib.getPrimaryAuthorList())
        vars["coAuthors"] = self._getParticipantsList(
            self._contrib.getCoAuthorList())
        vars["speakers"] = self._getParticipantsList(
            self._contrib.getSpeakerList())
        return vars