def sharing(self): # get the participants phandler = IParticipationAware(self.context) results = list(phandler.get_participations()) # also append the responsible class ResponsibleParticipant(object): pass responsible = ResponsibleParticipant() responsible.roles = _dossier(u'label_responsible', 'Responsible') responsible.role_list = responsible.roles dossier_adpt = IDossier(self.context) responsible.contact = dossier_adpt.responsible results.append(responsible) info = getUtility(IContactInformation) return [{ 'Title': info.describe(xx.contact), 'getURL': info.get_profile_url(xx.contact), 'css_class': 'function-user', } for xx in results]
def plone_participations(self): if not self.context.has_participation_support(): return [] # get the participants phandler = IParticipationAware(self.context) results = list(phandler.get_participations()) # also append the responsible class ResponsibleParticipant(object): pass responsible = ResponsibleParticipant() responsible.roles = _dossier(u'label_responsible', 'Responsible') responsible.role_list = responsible.roles dossier_adpt = IDossier(self.context) responsible.contact = dossier_adpt.responsible results.append(responsible) users = [] for dossier in results: actor = Actor.lookup(dossier.contact) users.append({ 'Title': actor.get_label(), 'getURL': actor.get_profile_url(), 'css_class': 'function-user', }) return users
def get_participants(self): dossier = IDossier(self.context) rows = [] # add the responsible rows.append('%s, %s' % ( readable_ogds_author(None, dossier.responsible), translate(_dossier(u'label_responsible', 'Responsible'), context=self.request))) # add the participants participants = list(IParticipationAware( self.context).get_participations()) for participant in participants: rows.append('%s, %s' % ( readable_ogds_author(participant, participant.contact), role_list_helper(participant, participant.roles))) values = ['{', '\\vspace{-\\baselineskip}\\begin{itemize}'] for row in self.convert_list(rows): values.append('\\item {}'.format(row)) values.append('\\vspace{-\\baselineskip}\\end{itemize}') values.append('}') return ' \n'.join(values)