Revision 75f43bc1
Von Kivitendo Admin vor mehr als 9 Jahren hinzugefügt
SL/ReportGenerator.pm | ||
---|---|---|
819 | 819 |
|
820 | 820 |
The ReportGenerator class was designed because this exact scenario happened about half a dozen times in kivitendo. |
821 | 821 |
It's purpose is to manage all those formating, culling, sorting, and templating. |
822 |
Which makes it almost as complicated to use as doing the work for yourself.
|
|
822 |
Which makes it almost as complicated to use as doing the work by yourself.
|
|
823 | 823 |
|
824 | 824 |
=head1 FUNCTIONS |
825 | 825 |
|
... | ... | |
839 | 839 |
|
840 | 840 |
=item set_sort_indicator $column,$direction |
841 | 841 |
|
842 |
Sets sorting ot the table by specifying a column and a direction, where the direction will be evaluated to ascending if true.
|
|
843 |
Note that this is only for displaying. The data has to be presented already sorted.
|
|
842 |
Sets sorting of the table by specifying a column and a direction, where the direction will be evaluated to ascending if true.
|
|
843 |
Note that this is only for displaying. The data has to have already been sorted when it was added.
|
|
844 | 844 |
|
845 | 845 |
=item add_data \@data |
846 | 846 |
|
847 | 847 |
=item add_data \%data |
848 | 848 |
|
849 |
Adds data to the report. A given hash_ref is interpreted as a single line of data, every array_ref as a collection of lines. |
|
850 |
Every line will be expected to be in a kay => value format. Note that the rows have to be already sorted. |
|
851 |
ReportGenerator does only colum sorting on its own, and provides links to sorting and visual cue as to which column was sorted by. |
|
849 |
Adds data to the report. A given hash_ref is interpreted as a single line of |
|
850 |
data, every array_ref as a collection of lines. Every line will be expected to |
|
851 |
be in a key => value format. Note that the rows have to already have been |
|
852 |
sorted. |
|
853 |
The ReportGenerator is only able to sort pre-sorted data by column direction |
|
854 |
(ascending or descending), and provides links to sorting and a visual cue as to |
|
855 |
which column was sorted by. |
|
852 | 856 |
|
853 | 857 |
=item add_separator |
854 | 858 |
|
... | ... | |
857 | 861 |
=item add_control \%data |
858 | 862 |
|
859 | 863 |
Adds a control element to the data. Control elements are an experimental feature to add functionality to a report the regular data cannot. |
860 |
Every control element needs to set IS_CONTROL_DATA, in order to be recongnized by the template.
|
|
864 |
Every control element needs to set IS_CONTROL_DATA, in order to be recognized by the template. |
|
861 | 865 |
Currently the only control element is a colspan element, which can be used as a mini header further down the report. |
862 | 866 |
|
863 | 867 |
=item clear_data |
864 | 868 |
|
865 |
Deletes all data filled into the report, but keeps options set.
|
|
869 |
Deletes all data added to the report, but keeps options set.
|
|
866 | 870 |
|
867 | 871 |
=item set_options %options |
868 | 872 |
|
... | ... | |
896 | 900 |
=item prepare_html_content $column,$name,@column_headers |
897 | 901 |
|
898 | 902 |
Parses the data, and sets internal data needed for certain output format. Must be called once before the template is invoked. |
899 |
Should not be called extrenally, since all render and generate functions invoke it anyway.
|
|
903 |
Should not be called externally, since all render and generate functions invoke it anyway.
|
|
900 | 904 |
|
901 | 905 |
=item generate_html_content |
902 | 906 |
|
Auch abrufbar als: Unified diff
Typos / style in Doku