Projet

Général

Profil

« Précédent | Suivant » 

Révision 5ea09820

Ajouté par Thomas Noël il y a plus de 11 ans

use formdata.get_visible_status() to display list of forms (fix #1788)

Voir les différences:

extra/modules/root.ptl
84 84
                    f.formdef.url_name, f.id, f.formdef.name)
85 85
            '</ul>'
86 86

  
87
        # with workflows
88 87
        forms_by_status_name = {}
89
        workflows = Workflow.select(order_by = 'name')
90
        for workflow in workflows:
91
            # XXX: seperate endpoints from non-endpoints
92
            for status in workflow.possible_status:
93
                fms = [x for x in user_forms if x.status == 'wf-%s' % status.id and \
94
                        x.formdef and x.formdef.workflow_id == workflow.id]
95
                if not fms:
96
                    continue
97
                if status.name in forms_by_status_name:
98
                    forms_by_status_name[status.name] += fms
99
                else:
100
                    forms_by_status_name[status.name] = fms
88
        for f in user_forms:
89
            status = f.get_visible_status()
90
            if status:
91
                status_name = status.name
92
            else:
93
                status_name = None
94
            if status_name in forms_by_status_name:
95
                forms_by_status_name[status_name].append(f)
96
            else:
97
                forms_by_status_name[status_name] = [f]
101 98
        for status_name in forms_by_status_name:
102
            '<h4>%s</h4>' % _('My forms with status "%s"') % status_name
99
            if status_name:
100
                '<h4>%s</h4>' % _('My forms with status "%s"') % status_name
101
            else:
102
                '<h4>%s</h4>' % _('My forms with an unknown status') % status_name
103 103
            '<ul>'
104 104
            forms_by_status_name[status_name].sort(lambda x,y: cmp(x.receipt_time, y.receipt_time))
105 105
            for f in forms_by_status_name[status_name]:

Formats disponibles : Unified diff