예제 #1
0
    def __call__(self):
        task_html_pdf_css.need()
        # If the task is editable, we go the edit page
        if self.request.has_permission('edit.%s' % self.context.type_):
            return HTTPFound(
                self.request.route_path("/%ss/{id}" % self.context.type_,
                                        id=self.context.id))

        populate_actionmenu(self.request)

        return dict(
            title=self.title,
            task=self.context,
            actions=self.actions(),
        )
예제 #2
0
    def __call__(self):
        self.populate_navigation()
        task_html_pdf_css.need()
        # If the task is editable, we go the edit page
        if self.request.has_permission('edit.%s' % self.context.type_):
            return HTTPFound(
                self.request.route_path("/%ss/{id}" % self.context.type_,
                                        id=self.context.id))

        return dict(
            title=self.title,
            task=self.context,
            actions=self.actions(),
            indicators=self._collect_file_indicators(),
        )
예제 #3
0
    def __call__(self):
        self.populate_navigation()
        task_html_pdf_css.need()
        # If the task is editable, we go the edit page
        if self.request.has_permission('edit.%s' % self.context.type_):
            return HTTPFound(
                self.request.route_path(
                    "/%ss/{id}" % self.context.type_,
                    id=self.context.id
                )
            )

        return dict(
            title=self.title,
            task=self.context,
            actions=self.actions(),
            indicators=self._collect_file_indicators(),

        )
예제 #4
0
    def task_html_view(request):
        """
        The task html view
        """
        from autonomie.resources import task_html_pdf_css
        task_html_pdf_css.need()
        # If the task is editable, we go the edit page
        if context_is_editable(request):
            return HTTPFound(
                request.route_path(
                    request.context.__name__,
                    id=request.context.id
                )
            )

        # Get the label for the given task
        if request.context.__name__ == 'invoice':
            label = u"Facture"
        elif request.context.__name__ == 'estimation':
            label = u"Devis"
        elif request.context.__name__ == 'cancelinvoice':
            label = u"Avoir"
        else:
            label = u"Objet"

        title = u"{0} numéro : {1}".format(label, request.context.internal_number)
        populate_actionmenu(request)

        # We use the task's class to retrieve the available actions
        model = request.context.__class__
        button_handler = form_actions_factory(request, model)
        submit_buttons = button_handler.get_buttons()

        return dict(
            title=title,
            task=request.context,
            submit_buttons=submit_buttons,
        )
예제 #5
0
    def task_html_view(request):
        """
        The task html view
        """
        from autonomie.resources import task_html_pdf_css
        task_html_pdf_css.need()
        # If the task is editable, we go the edit page
        if context_is_editable(request):
            return HTTPFound(
                request.route_path(request.context.__name__,
                                   id=request.context.id))

        # Get the label for the given task
        if request.context.__name__ == 'invoice':
            label = u"Facture"
        elif request.context.__name__ == 'estimation':
            label = u"Devis"
        elif request.context.__name__ == 'cancelinvoice':
            label = u"Avoir"
        else:
            label = u"Objet"

        title = u"{0} numéro : {1}".format(label,
                                           request.context.internal_number)
        populate_actionmenu(request)

        # We use the task's class to retrieve the available actions
        model = request.context.__class__
        button_handler = form_actions_factory(request, model)
        submit_buttons = button_handler.get_buttons()

        return dict(
            title=title,
            task=request.context,
            submit_buttons=submit_buttons,
        )