Exemple #1
0
 def dispatch(self, request, *args, **kwargs):
     if has_report_builder_access(request):
         report_type = kwargs.get('report_type', None)
         domain = kwargs.get('domain', None)
         if report_type != 'map' or REPORT_BUILDER_MAP_REPORTS.enabled(domain):
             return super(ReportBuilderView, self).dispatch(request, *args, **kwargs)
         else:
             raise Http404
     else:
         raise Http404
Exemple #2
0
 def tiles(self):
     analytics_workflow_label = "Clicked on Report Builder Tile"
     tiles = [
         TileConfiguration(
             title=_('Chart'),
             slug='chart',
             analytics_usage_label="Chart",
             analytics_workflow_label=analytics_workflow_label,
             icon='fcc fcc-piegraph-report',
             context_processor_class=IconContext,
             url=reverse('report_builder_select_source', args=[self.domain, 'chart']),
             help_text=_('A bar graph or a pie chart to show data from your cases or forms.'
                         ' You choose the property to graph.'),
         ),
         TileConfiguration(
             title=_('Form or Case List'),
             slug='form-or-case-list',
             analytics_usage_label="List",
             analytics_workflow_label=analytics_workflow_label,
             icon='fcc fcc-form-report',
             context_processor_class=IconContext,
             url=reverse('report_builder_select_source', args=[self.domain, 'list']),
             help_text=_('A list of cases or form submissions.'
                         ' You choose which properties will be columns.'),
         ),
         TileConfiguration(
             title=_('Worker Report'),
             slug='worker-report',
             analytics_usage_label="Worker",
             analytics_workflow_label=analytics_workflow_label,
             icon='fcc fcc-user-report',
             context_processor_class=IconContext,
             url=reverse('report_builder_select_source', args=[self.domain, 'worker']),
             help_text=_('A table of your mobile workers.'
                         ' You choose which properties will be the columns.'),
         ),
         TileConfiguration(
             title=_('Data Table'),
             slug='data-table',
             analytics_usage_label="Table",
             analytics_workflow_label=analytics_workflow_label,
             icon='fcc fcc-datatable-report',
             context_processor_class=IconContext,
             url=reverse('report_builder_select_source', args=[self.domain, 'table']),
             help_text=_('A table of aggregated data from form submissions or case properties.'
                         ' You choose the columns and rows.'),
         ),
     ]
     if REPORT_BUILDER_MAP_REPORTS.enabled(self.domain):
         tiles.append(TileConfiguration(
             title=_('Map'),
             slug='map',
             analytics_usage_label="Map",
             analytics_workflow_label=analytics_workflow_label,
             icon='fa fa-globe',
             context_processor_class=IconContext,
             url=reverse('report_builder_select_source', args=[self.domain, 'map']),
             help_text=_('A map to show data from your cases or forms.'
                         ' You choose the property to map.'),
         ))
     return tiles