Beispiel #1
0
    def get_config(self):
        """Returns a list with dict per row including this row informations:
        - label
        - value_getter
        - width
        """

        return [{
            'id': 'sequence_number',
            'label': _('short_label_sequence_number', default='No.'),
            'width': '3%',
            'getter': lambda brain: brain.sequence_number
        }, {
            'id':
            'task_type',
            'label':
            _('label_task_type', default='Task type'),
            'width':
            '20%',
            'getter':
            lambda brain: task_type_helper(brain, brain.task_type)
        }, {
            'id':
            'issuer',
            'label':
            _('label_issuer', default='Issuer'),
            'width':
            '15%',
            'getter':
            lambda brain: get_issuer_of_task(
                brain, with_client=True, with_principal=False)
        }, {
            'id': 'responsible',
            'label': _('label_task_responsible', default='Responsible'),
            'width': '15%',
            'getter': lambda brain: get_responsible_of_task(brain)
        }, {
            'id':
            'review_state',
            'label':
            _('label_review_state', default='State'),
            'width':
            '7%',
            'getter':
            lambda brain: workflow_state(brain, brain.review_state)
        }, {
            'id': 'title',
            'label': _('label_title', default='Title'),
            'width': '25%',
            'getter': lambda brain: brain.Title
        }, {
            'id':
            'deadline',
            'label':
            _('label_deadline', default='Deadline'),
            'width':
            '15%',
            'getter':
            lambda brain: helper.readable_date(brain, brain.deadline)
        }]
    def get_data_for_item(self, item):
        admin_unit = item.get_admin_unit().title
        task_type = task_type_helper(item, item.task_type)
        sequence_number = unicode(item.sequence_number).encode("utf-8")
        deadline = helper.readable_date(item, item.deadline)

        title = unicode(getattr(item, "Title", getattr(item, "title", ""))).encode("utf-8")

        issuer = get_issuer_of_task(item, with_client=True, with_principal=False)

        responsible_org_unit = item.get_assigned_org_unit()
        responsible = Actor.lookup(item.responsible)
        responsible_label = responsible_org_unit.prefix_label(responsible.get_label(with_principal=False))

        dossier_title = item.containing_dossier or ""

        reference = unicode(getattr(item, "reference", getattr(item, "reference_number", ""))).encode("utf-8")

        review_state = workflow_state(item, item.review_state)

        return [
            admin_unit,
            sequence_number,
            title,
            task_type,
            dossier_title,
            reference,
            issuer,
            responsible_label,
            deadline,
            review_state,
        ]
Beispiel #3
0
    def get_config(self):
        """Returns a list with dict per row including this row informations:
        - label
        - value_getter
        - width
        """

        return [
            {'id': 'reference',
             'label': _('label_reference_number', default='Reference number'),
             'width': '10%',
             'getter': lambda brain: brain.reference},

            {'id': 'sequence_number',
             'label': _('short_label_sequence_number', default='No.'),
             'width': '5%',
             'getter': lambda brain: brain.sequence_number},

            {'id': 'repository_title',
             'label': _('label_repository_title', default='Repositoryfolder'),
             'width': '20%',
             'getter': self.get_repository_title},

            {'id': 'title',
             'label': _('label_title', default='Title'),
             'width': '25%',
             'getter': lambda brain: brain.Title},

            {'id': 'responsible',
             'label': _('label_responsible', default='Responsible'),
             'width': '20%',
             'getter': self.get_responsible},

            {'id': 'review_state',
             'label': _('label_review_state', default='State'),
             'width': '10%',
             'getter': lambda brain: workflow_state(
                 brain, brain.review_state)},

            {'id': 'start',
             'label': _('label_start', default='Start'),
             'width': '5%',
             'getter': lambda brain: helper.readable_date(
                 brain, brain.start)},

            {'id': 'end',
             'label': _('label_end', default='End'),
             'width': '5%',
             'getter': lambda brain: helper.readable_date(brain, brain.end)}]
Beispiel #4
0
    def get_config(self):
        """Returns a list with dict per row including this row informations:
        - label
        - value_getter
        - width
        """

        return [
            {'id': 'sequence_number',
             'label': _('short_label_sequence_number', default='No.'),
             'width': '3%',
             'getter': lambda brain: brain.sequence_number},

            {'id': 'task_type',
             'label': _('label_task_type', default='Task type'),
             'width': '20%',
             'getter': lambda brain: task_type_helper(brain, brain.task_type)},

            {'id': 'issuer',
             'label': _('label_issuer', default='Issuer'),
             'width': '15%',
             'getter': lambda brain: get_issuer_of_task(
                 brain, with_client=True, with_principal=False)},

            {'id': 'responsible',
             'label': _('label_task_responsible', default='Responsible'),
             'width': '15%',
             'getter': lambda brain: get_responsible_of_task(brain)},

            {'id': 'review_state',
             'label': _('label_review_state', default='State'),
             'width': '7%',
             'getter': lambda brain: workflow_state(
                 brain, brain.review_state)},

            {'id': 'title',
             'label': _('label_title', default='Title'),
             'width': '25%',
             'getter': lambda brain: brain.Title},

            {'id': 'deadline',
             'label': _('label_deadline', default='Deadline'),
             'width': '15%',
             'getter': lambda brain: helper.readable_date(
                 brain, brain.deadline)}]
    def get_row_for_item(self, item, display_issuer_client=False,
                         display_responsible_client=False):
        task_type = task_type_helper(item, item.task_type)
        sequence_number = unicode(item.sequence_number).encode('utf-8')
        deadline = helper.readable_date(item, item.deadline)

        title = unicode(getattr(item, 'Title',
                            getattr(item, 'title', ''))).encode('utf-8')

        issuer = get_issuer_of_task(item,
                                    with_client=display_issuer_client,
                                    with_principal=False)

        responsible = self.info.describe(item.responsible,
                                         with_principal=False)

        if display_responsible_client:
            responsible_client = self.info.get_client_by_id(
                item.assigned_client).title
            responsible = '%s / %s' % (
                responsible_client,
                responsible)

        dossier_title = item.containing_dossier or ''

        reference = unicode(getattr(
                item, 'reference',
                getattr(item, 'reference_number', ''))).encode('utf-8')

        review_state = workflow_state(item, item.review_state)

        data = [
            sequence_number,
            title,
            task_type,
            dossier_title,
            reference,
            issuer,
            responsible,
            deadline,
            review_state,
            ]

        return self.convert_list_to_row(data)
    def get_row_for_item(self,
                         item,
                         display_issuer_client=False,
                         display_responsible_client=False):
        task_type = task_type_helper(item, item.task_type)
        sequence_number = unicode(item.sequence_number).encode('utf-8')
        deadline = helper.readable_date(item, item.deadline)

        title = unicode(getattr(item, 'Title', getattr(item, 'title',
                                                       ''))).encode('utf-8')

        issuer = get_issuer_of_task(item,
                                    with_client=display_issuer_client,
                                    with_principal=False)

        responsible = self.info.describe(item.responsible,
                                         with_principal=False)

        if display_responsible_client:
            responsible_client = self.info.get_client_by_id(
                item.assigned_client).title
            responsible = '%s / %s' % (responsible_client, responsible)

        dossier_title = item.containing_dossier or ''

        reference = unicode(
            getattr(item, 'reference', getattr(item, 'reference_number',
                                               ''))).encode('utf-8')

        review_state = workflow_state(item, item.review_state)

        data = [
            sequence_number,
            title,
            task_type,
            dossier_title,
            reference,
            issuer,
            responsible,
            deadline,
            review_state,
        ]

        return self.convert_list_to_row(data)
Beispiel #7
0
 def get_columns(self):
     return [
         Column('sequence_number',
                _('short_label_sequence_number', default='No.'), '3%'),
         Column('task_type', _('label_task_type', default='Task type'),
                '20%', lambda item: task_type_helper(item, item.task_type)),
         Column(
             'issuer', _('label_issuer', default='Issuer'), '15%',
             lambda item: get_issuer_of_task(
                 item, with_client=True, with_principal=False)),
         Column('responsible',
                _('label_task_responsible', default='Responsible'), '15%',
                get_responsible_of_task),
         Column('review_state', _('label_review_state', default='State'),
                '7%', lambda item: workflow_state(item, item.review_state)),
         Column('title', _('label_title', default='Title'), '25%'),
         Column('deadline', _('label_deadline', default='Deadline'), '15%',
                lambda item: helper.readable_date(item, item.deadline))
     ]
Beispiel #8
0
    def get_data_for_item(self,
                          item,
                          display_issuing_org_unit=False,
                          display_assigned_org_unit=False):
        task_type = task_type_helper(item, item.task_type)
        sequence_number = unicode(item.sequence_number).encode('utf-8')
        deadline = helper.readable_date(item, item.deadline)

        title = unicode(getattr(item, 'Title', getattr(item, 'title',
                                                       ''))).encode('utf-8')

        issuer = get_issuer_of_task(item,
                                    with_client=display_issuing_org_unit,
                                    with_principal=False)

        actor = Actor.lookup(item.responsible)
        responsible = actor.get_label(with_principal=False)

        if display_assigned_org_unit:
            org_unit = item.get_assigned_org_unit()
            responsible = org_unit.prefix_label(responsible)

        dossier_title = item.containing_dossier or ''

        reference = unicode(
            getattr(item, 'reference', getattr(item, 'reference_number',
                                               ''))).encode('utf-8')

        review_state = workflow_state(item, item.review_state)

        return [
            sequence_number,
            title,
            task_type,
            dossier_title,
            reference,
            issuer,
            responsible,
            deadline,
            review_state,
        ]
    def get_data_for_item(self, item,
                          display_issuing_org_unit=False,
                          display_assigned_org_unit=False):
        task_type = task_type_helper(item, item.task_type)
        sequence_number = unicode(item.sequence_number).encode('utf-8')
        deadline = helper.readable_date(item, item.deadline)

        title = unicode(getattr(item, 'Title',
                        getattr(item, 'title', ''))).encode('utf-8')

        issuer = get_issuer_of_task(item,
                                    with_client=display_issuing_org_unit,
                                    with_principal=False)

        actor = Actor.lookup(item.responsible)
        responsible = actor.get_label(with_principal=False)

        if display_assigned_org_unit:
            org_unit = item.get_assigned_org_unit()
            responsible = org_unit.prefix_label(responsible)

        dossier_title = item.containing_dossier or ''

        reference = unicode(getattr(
            item, 'reference',
            getattr(item, 'reference_number', ''))).encode('utf-8')

        review_state = workflow_state(item, item.review_state)

        return [
            sequence_number,
            title,
            task_type,
            dossier_title,
            reference,
            issuer,
            responsible,
            deadline,
            review_state,
            ]
Beispiel #10
0
    def get_columns(self):
        return [
            Column('reference',
                   _('label_reference_number', default='Reference number'),
                   '10%'),

            Column('sequence_number',
                   _('short_label_sequence_number', default='No.'),
                   '5%'),

            Column('repository_title',
                   _('label_repository_title', default='Repositoryfolder'),
                   '20%',
                   self.get_repository_title),

            Column('title',
                   _('label_title', default='Title'),
                   '25%',
                   'Title'),

            Column('responsible',
                   _('label_responsible', default='Responsible'),
                   '20%',
                   self.get_responsible),

            Column('review_state',
                   _('label_review_state', default='State'),
                   '10%',
                   lambda brain: workflow_state(brain, brain.review_state)),

            Column('start',
                   _('label_start', default='Start'),
                   '5%',
                   lambda brain: helper.readable_date(brain, brain.start)),

            Column('end',
                   _('label_end', default='End'),
                   '5%',
                   lambda brain: helper.readable_date(brain, brain.end))
        ]
Beispiel #11
0
 def get_columns(self):
     return [
         Column('reference',
                _('label_reference_number', default='Reference number'),
                '10%'),
         Column('sequence_number',
                _('short_label_sequence_number', default='No.'), '5%'),
         Column('repository_title',
                _('label_repository_title', default='Repositoryfolder'),
                '20%', self.get_repository_title),
         Column('title', _('label_title', default='Title'), '25%', 'Title'),
         Column('responsible', _('label_responsible',
                                 default='Responsible'), '20%',
                self.get_responsible),
         Column('review_state', _('label_review_state',
                                  default='State'), '10%',
                lambda brain: workflow_state(brain, brain.review_state)),
         Column('start', _('label_start', default='Start'), '5%',
                lambda brain: helper.readable_date(brain, brain.start)),
         Column('end', _('label_end', default='End'), '5%',
                lambda brain: helper.readable_date(brain, brain.end))
     ]
Beispiel #12
0
    def get_columns(self):
        return [
            Column('sequence_number',
                   _('short_label_sequence_number', default='No.'),
                   '3%'),

            Column('task_type',
                   _('label_task_type', default='Task type'),
                   '20%',
                   lambda item: task_type_helper(item, item.task_type)),

            Column('issuer',
                   _('label_issuer', default='Issuer'),
                   '15%',
                   lambda item: get_issuer_of_task(item, with_client=True,
                                                   with_principal=False)),

            Column('responsible',
                   _('label_task_responsible', default='Responsible'),
                   '15%',
                   get_responsible_of_task),

            Column('review_state',
                   _('label_review_state', default='State'),
                   '7%',
                   lambda item: workflow_state(item, item.review_state)),

            Column('title',
                   _('label_title', default='Title'),
                   '25%'),

            Column('deadline',
                   _('label_deadline', default='Deadline'),
                   '15%',
                   lambda item: helper.readable_date(item, item.deadline))
        ]
Beispiel #13
0
    def get_config(self):
        """Returns a list with dict per row including this row informations:
        - label
        - value_getter
        - width
        """

        return [{
            'id':
            'reference',
            'label':
            _('label_reference_number', default='Reference number'),
            'width':
            '10%',
            'getter':
            lambda brain: brain.reference
        }, {
            'id': 'sequence_number',
            'label': _('short_label_sequence_number', default='No.'),
            'width': '5%',
            'getter': lambda brain: brain.sequence_number
        }, {
            'id':
            'repository_title',
            'label':
            _('label_repository_title', default='Repositoryfolder'),
            'width':
            '20%',
            'getter':
            self.get_repository_title
        }, {
            'id': 'title',
            'label': _('label_title', default='Title'),
            'width': '25%',
            'getter': lambda brain: brain.Title
        }, {
            'id': 'responsible',
            'label': _('label_responsible', default='Responsible'),
            'width': '20%',
            'getter': self.get_responsible
        }, {
            'id':
            'review_state',
            'label':
            _('label_review_state', default='State'),
            'width':
            '10%',
            'getter':
            lambda brain: workflow_state(brain, brain.review_state)
        }, {
            'id':
            'start',
            'label':
            _('label_start', default='Start'),
            'width':
            '5%',
            'getter':
            lambda brain: helper.readable_date(brain, brain.start)
        }, {
            'id': 'end',
            'label': _('label_end', default='End'),
            'width': '5%',
            'getter': lambda brain: helper.readable_date(brain, brain.end)
        }]