Esempio n. 1
0
    def __call__(self):
        meeting = self.get_meeting()

        command = CreateGeneratedDocumentCommand(
            self.context,
            meeting,
            self.operations,
            )

        try:
            command.execute()
            command.show_message()

        except AgendaItemListMissingTemplate:
            msg = _(
                u'msg_error_agendaitem_list_missing_template',
                default=(u'There is no agendaitem list template configured, agendaitem list could not be generated.'),
                mapping=dict(title=meeting.get_title()),
                )
            api.portal.show_message(msg, self.request, type='error')

        except AgendaItemListAlreadyGenerated:
            msg = _(
                u'msg_error_agendaitem_list_already_generated',
                default=(u'The agenda item list for meeting ${title} has already been generated.'),
                mapping=dict(title=meeting.get_title()),
                )
            api.portal.show_message(msg, self.request, type='error')

        except SablonProcessingFailed:
            msg = _(u'Error while processing Sablon template')
            api.portal.show_message(msg, self.request, type='error')

        return self.request.RESPONSE.redirect(meeting.get_url())
Esempio n. 2
0
    def handleApply(self, action):
        data, errors = self.extractData()
        if errors:
            return

        agenda_items_to_include = []
        for agenda_item in self.get_agenda_items():
            if agenda_item.name in self.request:
                agenda_items_to_include.append(agenda_item)

        if not agenda_items_to_include:
            raise (ActionExecutionError(
                Invalid(_(u"Please select at least one agenda item."))))

        operations = ManualExcerptOperations(
            agenda_items_to_include,
            data['title'],
            include_initial_position=data['include_initial_position'],
            include_legal_basis=data['include_legal_basis'],
            include_considerations=data['include_considerations'],
            include_proposed_action=data['include_proposed_action'],
            include_discussion=data['include_discussion'],
            include_decision=data['include_decision'],
            include_publish_in=data['include_publish_in'],
            include_disclose_to=data['include_disclose_to'],
            include_copy_for_attention=data['include_copy_for_attention'])
        command = CreateGeneratedDocumentCommand(data['dossier'], self.model,
                                                 operations)
        command.execute()
        command.show_message()
        return self.redirect_to_meeting()
Esempio n. 3
0
    def handleApply(self, action):
        data, errors = self.extractData()
        if errors:
            return

        agenda_items_to_include = []
        for agenda_item in self.get_agenda_items():
            if agenda_item.name in self.request:
                agenda_items_to_include.append(agenda_item)

        if not agenda_items_to_include:
            raise(ActionExecutionError(
                Invalid(_(u"Please select at least one agenda item."))))

        operations = ManualExcerptOperations(
            agenda_items_to_include, data['title'],
            include_initial_position=data['include_initial_position'],
            include_legal_basis=data['include_legal_basis'],
            include_considerations=data['include_considerations'],
            include_proposed_action=data['include_proposed_action'],
            include_discussion=data['include_discussion'],
            include_decision=data['include_decision'],
            include_publish_in=data['include_publish_in'],
            include_disclose_to=data['include_disclose_to'],
            include_copy_for_attention=data['include_copy_for_attention'])
        command = CreateGeneratedDocumentCommand(
            data['dossier'], self.model, operations)
        command.execute()
        command.show_message()
        return self.redirect_to_meeting()
Esempio n. 4
0
    def render(self):
        meeting = self.get_meeting()

        command = CreateGeneratedDocumentCommand(
            self.context, meeting, self.operations,
            lock_document_after_creation=True)
        try:
            command.execute()
            command.show_message()
        except ProtocolAlreadyGenerated:
            msg = _(u'msg_error_protocol_already_generated',
                    default=u'The protocol for meeting ${title} has already '
                            u'been generated.',
                    mapping=dict(title=meeting.get_title()))
            api.portal.show_message(msg, self.request, type='error')

        return self.request.RESPONSE.redirect(meeting.get_url())
Esempio n. 5
0
    def __call__(self):
        meeting = self.get_meeting()
        command = CreateGeneratedDocumentCommand(
            self.context,
            meeting,
            self.operations,
            lock_document_after_creation=True)
        try:
            command.execute()
            command.show_message()
        except ProtocolAlreadyGenerated:
            msg = _(u'msg_error_protocol_already_generated',
                    default=u'The protocol for meeting ${title} has already '
                    u'been generated.',
                    mapping=dict(title=meeting.get_title()))
            api.portal.show_message(msg, self.request, type='error')

        return self.request.RESPONSE.redirect(meeting.get_url())