Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision ff932d95

Von Bernd Bleßmann vor fast 2 Jahren hinzugefügt

  • ID ff932d95c58036fbafb42bbf1b316aa142506c98
  • Vorgänger b77889e1
  • Nachfolger 6d981761

design40: Reports als Chart

Unterschiede anzeigen:

templates/design40_webpages/report_generator/chart_export_options.html
1
[%- USE T8 %]
2
[%- USE HTML %]
3
[%- USE L %]
4
[%- USE P %]
5
[%- USE LxERP %]
6

  
7
 <h1>[% HTML.escape(title) %]</h1>
8

  
9
 <form action="[% HTML.escape(script) %]" method="post" name="report_generator_form" id="report_generator_form">
10

  
11
  [%- FOREACH var = HIDDEN %]
12
  <input type="hidden" name="[% HTML.escape(var.key) %]" value="[% HTML.escape(var.value) %]">
13
  [%- END %]
14

  
15
  <input type="hidden" name="report_generator_chart_options_set" value="1">
16
  <input type="hidden" name="report_generator_dispatch_to" value="">
17

  
18
 <div class="wrapper">
19
   <table id="assigment_table" class="tbl-horizontal">
20
     <tbody>
21
       <tr>
22
         <th valign="top" align="right">[% 'Chart assignments' | $T8 %]: [% 'X axis' | $T8 %]</th>
23
         <td>
24
           [% L.select_tag('report_generator_chart_options_assignment_x',
25
                           fields,
26
                           default = SELF.report_generator_chart_options_assignment_x
27
                           value_key = 'name',
28
                           title_key = 'text') %]
29
         </td>
30
       </tr>
31
       <tr id="y_assignment_row">
32
         <th valign="top" align="right">[% 'Chart assignments' | $T8 %]: [% 'Y axis' | $T8 %]</th>
33
         <td>
34
           [% L.select_tag('report_generator_chart_options_assignments_y[]',
35
                           fields,
36
                           value_key = 'name',
37
                           title_key = 'text') %]
38
           [% P.link_tag('', "✘", class='remove_data_assignment interact cursor-pointer', onclick='remove_data_assignment(this)', style='display:none') %]
39
         </td>
40
       </tr>
41
     </tbody>
42
   </table>
43
 </div><!-- /.wrapper -->
44

  
45
  [% L.button_tag('add_data_assignement()', LxERP.t8('Add row')) %]
46

  
47
[%- IF CONTROLLER_DISPATCH %]
48
    <input type="hidden" name="CONTROLLER_DISPATCH" value="[% CONTROLLER_DISPATCH | html %]">
49
[%- ELSE %]
50
   <input type="hidden" name="action" value="report_generator_dispatcher">
51
[%- END %]
52

  
53

  
54
 </form>
55

  
56
 <script type="text/javascript">
57
  <!--
58
   function add_data_assignement() {
59
     const new_row = $('#y_assignment_row').clone();
60
     new_row.removeAttr('id');
61
     new_row.find('a').show();
62
     new_row.find('*').removeAttr('id');
63
     new_row.appendTo("#assigment_table");
64
   }
65
   function remove_data_assignment(clicked) {
66
     $(clicked).closest('tr').remove();
67
   }
68
  -->
69
 </script>
templates/design40_webpages/report_generator/chart_report.html
1
[% USE P -%]
2

  
3
<h1>[% TITLE %]</h1>
4

  
5
[%- INCLUDE 'common/flash.html' %]
6

  
7
[% IF TOP_INFO_TEXT %]
8
 <p>[% TOP_INFO_TEXT %]</p>
9
[% END %]
10

  
11
[% RAW_TOP_INFO_TEXT %]
12

  
13
<div class="chart-container" style="position: relative;">
14
  <canvas id="chart" height="70vH"></canvas>
15
</div>
16

  
17
[% RAW_BOTTOM_INFO_TEXT %]
18

  
19
[% IF BOTTOM_INFO_TEXT %]
20
 <p>[% BOTTOM_INFO_TEXT %]</p>
21
[% END %]
22

  
23

  
24
<script>
25
  kivi.ChartReport.data = { labels: [% labels %],
26
                            datasets: [% datasets %],
27
                            data_labels: [% data_labels %],
28
                          };
29
</script>
templates/design40_webpages/report_generator/html_report.html
80 80
    <input type="hidden" name="report_generator_hidden_[% var.key %]" value="[% HTML.escape(var.value) %]">
81 81
  [% END %]
82 82

  
83
  [% IF ALLOW_CHART_EXPORT %]
84
    [% FOREACH row = HEADER_ROWS %]
85
      [% FOREACH col = row %]
86
        [% IF col.name && col.text %]
87
          <input type="hidden" name="report_generator_chart_fields[+].name" value="[% HTML.escape(col.name) %]">
88
          <input type="hidden" name="report_generator_chart_fields[].text"  value="[% HTML.escape(col.text) %]">
89
        [% END %]
90
      [% END %]
91
    [% END %]
92
  [% END %]
93

  
83 94
  [% IF CONTROLLER_DISPATCH %]
84 95
    [% IF !SKIP_BUTTONS %]
85 96
      <input type="hidden" name="action" value="[% CONTROLLER_DISPATCH %]/dispatch">

Auch abrufbar als: Unified diff