def email(self): """Displays email-address if the IMailInAddressMarker behavior is provided and the dossier is Active""" if IMailInAddressMarker.providedBy(self.context): if self.get_current_state() == 'dossier-state-active': address = IMailInAddress(self.context).get_email_address() return '<a href="mailto:%s">%s</a>' % (address, address)
def find_parent_dossier(self): """Returns the first parent dossier relative to the current context. """ obj = self.context while not IMailInAddressMarker.providedBy(obj): obj = aq_parent(aq_inner(obj)) if IPloneSiteRoot.providedBy(obj): return ValueError('Site root reached while searching ' 'parent dossier.') return obj
def email(self): """Gets Email and display it in Byline""" if IMailInAddressMarker.providedBy(self.context): return IMailInAddress(self.context).get_email_address()