diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt index 12f94c7a7f..06375c49f3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt @@ -258,1511 +258,1489 @@ [% INCLUDE 'guided-reports-view.inc' %] [% END %] - [% WRAPPER 'main-container.inc' aside_block=aside %] - [% INCLUDE "reports-toolbar.inc" %] + [% INCLUDE "reports-toolbar.inc" %] - [% IF access_denied %] -
-

Access denied

-

This report is restricted and cannot be accessed by the current user.

- [% IF id %]

Report ID: [% id | html %]

[% END %] -

Return to saved reports

-
- [% END %] + [% IF access_denied %] +
+

Access denied

+

This report is restricted and cannot be accessed by the current user.

+ [% IF id %]

Report ID: [% id | html %]

[% END %] +

Return to saved reports

+
+ [% END %] - [% IF ( start ) %] -

Guided reports

-

Use the guided reports engine to create non standard reports. This feature aims to provide some middle ground between the built in canned reports and writing custom SQL reports.

+ [% IF ( start ) %] +

Guided reports

+

Use the guided reports engine to create non standard reports. This feature aims to provide some middle ground between the built in canned reports and writing custom SQL reports.

-

Build and run reports

+

Build and run reports

- [% IF ( CAN_user_reports_create_reports ) %] - Build new - [% END %] + [% IF ( CAN_user_reports_create_reports ) %] + Build new + [% END %] - [% IF ( CAN_user_reports_execute_reports ) %] - View saved - [% END %] + [% IF ( CAN_user_reports_execute_reports ) %] + View saved + [% END %] - [% IF ( CAN_user_reports_create_reports ) %] - Create report from SQL - [% END %] + [% IF ( CAN_user_reports_create_reports ) %] + Create report from SQL + [% END %] -

Reports dictionary

-

Use the reports dictionary to define custom criteria to use in your reports

- View dictionary - [% END # /IF (start) %] +

Reports dictionary

+

Use the reports dictionary to define custom criteria to use in your reports

+ View dictionary + [% END # /IF (start) %] - [% IF report_converted %] -
The report "[% report_converted | html %]" has been converted.
- [% END %] + [% IF report_converted %] +
The report "[% report_converted | html %]" has been converted.
+ [% END %] - [% IF ( saved1 ) %] -

Saved reports

- [% IF ( savedreports ) %] + [% IF ( saved1 ) %] +

Saved reports

+ [% IF ( savedreports ) %] - [% IF ( filters.date || filters.author || filters.keyword || library_limit_active ) %] -

Filtered by: - - [% IF ( filters.date ) %] - Date: [% filters.date | html %] - [% END %] - [% IF ( filters.author ) %] - Author: [% filters.author | html %] - [% END %] - [% IF ( filters.keyword ) %] - Keyword: [% filters.keyword | html %] - [% END %] - [% IF library_limit_active %] - Show reports: My library reports - [% END %] - Clear - -

+ [% IF ( filters.date || filters.author || filters.keyword || library_limit_active ) %] +

Filtered by: + + [% IF ( filters.date ) %] + Date: [% filters.date | html %] [% END %] + [% IF ( filters.author ) %] + Author: [% filters.author | html %] + [% END %] + [% IF ( filters.keyword ) %] + Keyword: [% filters.keyword | html %] + [% END %] + [% IF library_limit_active %] + Show reports: My library reports + [% END %] + Clear + +

+ [% END %] - [% WRAPPER tabs id= "tabs" %] - [% WRAPPER tabs_nav %] - [% WRAPPER tab_item tabname= "reports" bt_active= 1 %]All[% END %] - [% FOREACH group IN groups_with_subgroups %] - [% WRAPPER tab_item tabname= group.id %][% group.name | html %][% END %] - [% END %] - [% END # /WRAPPER tabs_nav %] + [% WRAPPER tabs id= "tabs" %] + [% WRAPPER tabs_nav %] + [% WRAPPER tab_item tabname= "reports" bt_active= 1 %]All[% END %] + [% FOREACH group IN groups_with_subgroups %] + [% WRAPPER tab_item tabname= group.id %][% group.name | html %][% END %] + [% END %] + [% END # /WRAPPER tabs_nav %] - [% WRAPPER tab_panels %] - [% WRAPPER tab_panel tabname="reports" bt_active= 1 %] -
- - -
- - [% IF (Koha.Preference('Mana') == 1) %] - [% IF manamsg %] -
-

[% manamsg | html %]

-
- [% END %] - [% END %] - -
- [% INCLUDE 'csrf-token.inc' %] - - - - - - - - - - - - - - - - - - [% IF (usecache) %] - - [% ELSE %] - - [% END %] - - [% IF has_obsolete_reports %] - - [% ELSE %] - - [% END %] - - - - - - [% FOREACH savedreport IN savedreports %] - - - - - - - - - - - - - - - - - - - - - [% END %] - -
 IDReport nameTypeGroupSubgroupNotesAuthorCreation dateLast editLast runPublicJSON URLCache expiry (seconds)Cache expiry (seconds)Saved resultsUpdateUpdateLibrary limitsActions
- [% IF ( CAN_user_reports_delete_all_reports || (CAN_user_reports_delete_own_reports && savedreport.borrowernumber == loggedinusernumber) ) %] - - - [% END %] - - - - - [% IF ( savedreport.report_name ) %] - [% savedreport.report_name | html %] - [% ELSE %] - [ no name ] - [% END %] - [% savedreport.type | html %] [% savedreport.groupname | html %] [% savedreport.subgroupname | html %] [% savedreport.notes | html %] - [%- savedreport.borrowersurname | html -%][%- IF ( savedreport.borrowerfirstname ) -%], [%- savedreport.borrowerfirstname | html -%][%- END -%] - ([% savedreport.borrowernumber | html %]) - [% savedreport.date_created | $KohaDates %] [% savedreport.last_modified | $KohaDates with_hours => 1 %] [% savedreport.last_run | $KohaDates with_hours => 1 %] - [% IF (savedreport.public) %] - Yes - [% ELSE %] - No - [% END %] - - [% IF (savedreport.public) %] - [% OPACBaseURL | html %]/cgi-bin/koha/svc/report?id=[% savedreport.id | html %] - [% ELSE %] - [% Koha.Preference('staffClientBaseURL') | html %]/cgi-bin/koha/svc/report?id=[% savedreport.id | html %] - [% END %] - [% savedreport.cache_expiry | html %] - [% FOR result IN savedreport.results %] - [% result.date_run | html %] -
- [% END %] -
- [% IF savedreport.seems_obsolete %] - This report seems obsolete, it uses biblioitems.marcxml field. - Update SQL - [% END %] - - [% IF ( Koha.Preference('LimitReportsByLibrary') && ( CAN_user_superlibrarian || CAN_user_reports_manage_report_limits ) ) %] - [% IF savedreport.library_limits && savedreport.library_limits.size > 0 %] - [% library_str = "" %] - [% FOREACH library IN savedreport.library_limits %] - [%- IF loop.first -%] - [% library_str = library.branchname _ " (" _ library.branchcode _ ")" %] - [% ELSE %] - [% library_str = library_str _ "\n" _ library.branchname _ " (" _ library.branchcode _ ")" %] - [% END %] - [% END %] - - [% IF savedreport.library_limits.size > 1 %] - [% savedreport.library_limits.size | html %] library limitations - [% ELSE %] - [% savedreport.library_limits.size | html %] library limitation - [% END %] - - [% ELSE %] - No limitation - [% END %] - [% END %] - -
- [%# There should be no space between these two buttons, it would render badly %] - [%- IF ( CAN_user_reports_execute_reports ) -%] - [% INCLUDE 'throttled-button.inc' element_type='link' href='/cgi-bin/koha/reports/guided_reports.pl?id=' _ savedreport.id _ '&op=run' classes='btn btn-default btn-xs' label=t('Run') attrs={ role => 'button' } %] - [%- ELSE -%] - - View - - [% END -%] - [%- "" |$raw %] - -
- -
- - [% IF ( CAN_user_reports_delete_all_reports || CAN_user_reports_delete_own_reports ) %] -
- -
- [% END %] -
- [% END # /tab_panel# %] - [% END # /WRAPPER tab_panels %] - [% END # /WRAPPER tabs %] - [% ELSE # IF ( savedreports ) %] -
- [% IF (filter_set || filters.date || filters.author || filters.keyword) %] -

No saved reports match your criteria.

- [% IF ( CAN_user_reports_create_reports ) %] - New guided report - - New SQL report - - Cancel filter - [% END %] - [% ELSE %] -

There are no saved reports.

- [% IF ( CAN_user_reports_create_reports ) %] - Build a new report? - [% END %] - [% END # IF (filter_set || filters.date || filters.author || filters.keyword) %] + [% WRAPPER tab_panels %] + [% WRAPPER tab_panel tabname="reports" bt_active= 1 %] +
+ +
- - [% END # /IF ( savedreports ) %] - [% END # /IF ( saved1 ) %] - [% INCLUDE 'mana/mana-share-report.inc' %] - - [% IF ( build1 ) %] - [% IF ( cache_error) %] -
- Please choose a cache_expiry less than 30 days -
- [% END %] - -

Build a report

-
- [% INCLUDE 'csrf-token.inc' %] -
- Step 1 of 7: Choose a module to report on,[% IF (usecache) %]Set cache expiry,[% END %] and choose report visibility -
    -
  1. - - -
  2. - [% IF (public) %] -
  3. - - -
  4. - [% ELSE %] -
  5. - - -
  6. - [% END %] - - [% IF (usecache) %] -
  7. - - - -
  8. - [% END %] -
-
- -
- - -
-
- [% END # /build1 %] - - [% IF ( build2 ) %] -

Build a report

-
- [% INCLUDE 'csrf-token.inc' %] - - - -
- Step 2 of 7: Pick a report type -
    -
  1. - - -
  2. -
-
- -
- - - -
-
- [% END # /IF (build2 ) %] - - [% IF ( build3 ) %] -

Build a report

- -
- [% INCLUDE 'csrf-token.inc' %] - - - - -
- Step 3 of 7: Select columns for display -

Note: Be careful selecting when selecting columns. If your choice is too broad it could result in a very large report that will either not complete, or slow your system down.

- -
-
- + [% IF (Koha.Preference('Mana') == 1) %] + [% IF manamsg %] +
+

[% manamsg | html %]

-
- - -
-
- -
-
-
-
- - - -
-
- - [% END # /IF ( build3 ) %] - - [% IF ( build4 ) %] -

Build a report

-
- [% INCLUDE 'csrf-token.inc' %] - - - - - -
- Step 4 of 7: Select criteria to limit on - - [% FOREACH criteri IN criteria %] - - - [% IF ( criteri.date ) %] - - [% ELSE %] - [% IF ( criteri.textrange ) %] - - [% ELSE %] - [% IF ( criteri.daterange ) %] - - [% ELSE %] - - [% END %] - [% END %] - [% END %] - - [% END %] -
- - - - - [% INCLUDE 'date-format.inc' %] - - from - to - - - from - - to - - [% INCLUDE 'date-format.inc' %] - - -
-
- - [% IF ( definitions ) %] -
- Dictionary definitions - - [% FOREACH definition IN definitions %] - - - - [% END %] -
- - [% definition.name | html %] -
-
+ [% END %] [% END %] -
- - - -
-
- [% END # /IF ( build4 ) %] - - [% IF ( build5 ) %] -

Build a report

-
- [% INCLUDE 'csrf-token.inc' %] - - - - - - - -
- Step 5 of 7: Pick which columns to total - - [% FOREACH total_b IN total_by %] - - - - - [% END %] -
- - - - -
-
- -
- - -
-
- [% END # /IF ( build5 ) %] - - [% IF ( build6 ) %] -

Build a report

-
- [% INCLUDE 'csrf-token.inc' %] - - - - - - - - -
- Step 6 of 7: Choose how you want the report ordered - - [% FOREACH order_b IN order_by %] - - - - - [% END %] -
- - - - -
-
-
- - - -
-
- [% END #/ IF ( build6 ) %] - - [% IF ( showreport ) %] -

Build a report

-
-

Step 7 of 7: Confirm custom report

-

Your report will be generated with the following SQL statement.

- -
You may add a title to your report in the next step.
-
- -
- [% INCLUDE 'csrf-token.inc' %] - - - - -
- - -
-
- [% END #/ IF ( showreport ) %] - - [% IF ( save ) %] -
- [% INCLUDE 'csrf-token.inc' %] - - - - - -
-

Save your custom report

-
    -
  1. - - - Required -
  2. - [% PROCESS group_and_subgroup_selection %] -
  3. - - -
  4. -
-
-
- -
-
- [% END # /IF( save ) %] - - [% IF ( warn_authval_problem ) %] -
-

Errors found when processing parameters for report: [% name | html %]

- [% FOREACH problematic_authval IN problematic_authvals %] -

[% problematic_authval.name | html %]: The authorized value category ([% problematic_authval.authval | html %]) you selected does not exist.

- [% END %] - -
- + [% INCLUDE 'csrf-token.inc' %] - - - - - - - - - - - [% IF ( op == 'update') %] - - - [% ELSIF ( op == 'save') %] - - - - [% END %] -
- - Edit SQL -
- [% END # /IF ( warn_authval_problem ) %] - - [% IF ( enter_params ) %] - [% IF ( auth_val_error ) %] -
-

Errors found when processing parameters for report: [% name | html %]

- [% FOREACH auth_val_error IN auth_val_errors %] -

[% auth_val_error.entry | html %]: The authorized value category ([% auth_val_error.auth_val | html %]) you selected does not exist.

- [% END %] -
-
- Edit SQL -
- [% ELSE # IF ( auth_val_error ) %] -
- -

Enter parameters for report [% name | html %]:

- [% IF ( notes ) %] -

[% notes | scrub_html type => 'note' | $raw %]

- [% END %] -
-
    - [% FOREACH sql_param IN sql_params %] - - [% IF sql_param.input == 'date' %] -
  1. - - -
  2. - [% ELSIF ( sql_param.input == 'text' ) %] -
  3. - - -
  4. - [% ELSIF ( sql_param.input == 'textarea' ) %] -
  5. - - -
  6. - [% ELSE %] -
  7. - - -
  8. - [% END # /IF sql_param.input == 'date' %] - [% END # /FOREACH sql_param %] -
-
- -
- - [% IF ( template_code ) %] - - [% END %] - [% INCLUDE 'throttled-button.inc' element_type='button' classes='btn btn-primary' label=t('Run the report') %] -
-
- [% END # / IF ( auth_val_error ) %] - [% END # /IF ( enter_params ) %] - - [% IF processed_notice %] - [% processed_notice | $raw %] - [% ELSIF ( execute ) %] -

[% name | html %] Report ID: [% id | html %]

-
- [% IF ( notes ) %] -

Notes: [% notes | scrub_html type => 'note' | $raw %]

- [% END %] - [% IF ( unlimited_total ) %] -

- Total number of results: - [% unlimited_total | html %] - [% IF unlimited_total >= limit %] - ([% results.size | html %] shown) - [% END %] -

- [% END %] - - - -
- - -
-
- - [% IF ( execute ) %] - [% UNLESS ( errors ) %] -
- [% INCLUDE 'csrf-token.inc' %] - - - [%# Preserve the whitespace of the following textarea in order to format the values correctly %] - -
- -
- [% INCLUDE 'csrf-token.inc' %] - - - [%# Preserve the whitespace of the following textarea in order to format the values correctly %] - -
- -
- [% INCLUDE 'csrf-token.inc' %] - - [% FOREACH result IN results %] - [% FOREACH cells IN result.cells %] - [% place = loop.index %] - [% NEXT UNLESS cells.cell.match('^(\d+)$') %] - [% IF header_row.$place.cell == 'itemnumber' || header_types.item(header_row.$place.cell) == 'itemnumber' %] - [% SET batch_itemnumbers = 1 %] - [% SET header_row.$place.has_itemnumbers = 1 %] - - [% END %] - [% END %] - [% END %] -
- -
- [% INCLUDE 'csrf-token.inc' %] - - - [% FOREACH result IN results %] - [% FOREACH cells IN result.cells %] - [% place = loop.index %] - [% NEXT UNLESS cells.cell.match('^(\d+)$') %] - [% IF header_row.$place.cell == 'itemnumber' || header_types.item(header_row.$place.cell) == 'itemnumber' %] - [% SET batch_itemnumbers = 1 %] - [% SET header_row.$place.has_itemnumbers = 1 %] - - [% END %] - [% END %] - [% END %] -
- -
- [% FOREACH result IN results %] - [% FOREACH cells IN result.cells %] - [% place = loop.index %] - [% NEXT UNLESS cells.cell.match('^(\d+)$') %] - [% IF header_row.$place.cell == 'biblionumber' || header_types.item(header_row.$place.cell) == 'biblionumber' %] - [% SET batch_biblionumbers = 1 %] - [% SET header_row.$place.has_biblionumbers = 1 %] - - [% END %] - [% END %] - [% END %] -
- -
- [% INCLUDE 'csrf-token.inc' %] - - [%# Preserve the whitespace of the following textarea in order to format the values correctly %] - [%- borrowernumbers = PROCESS batch_list results=results batch_type='borrowernumber' | trim | html -%] - [%- IF borrowernumbers -%] - [%- SET batch_borrowernumbers = 1 -%] - - [%- END -%] - [%- cardnumbers = PROCESS batch_list results=results batch_type='cardnumber' | trim | html %] - [% IF !batch_borrowernumbers && cardnumbers %] - [% SET batch_cardnumbers = 1 %] - - [% END %] -
- -
- [% INCLUDE 'csrf-token.inc' %] - - - [%# Preserve the whitespace of the following textarea in order to format the values correctly %] - -
- -
- [% INCLUDE 'csrf-token.inc' %] - - -
- - [% BLOCK batch_list %] - [%- FOREACH result IN results %] - [%- FOREACH cells IN result.cells %] - [%- place = loop.index %] - [%- IF header_row.$place.cell == batch_type || header_types.item(header_row.$place.cell) == batch_type -%] - [%- cells.cell | html -%][% "\n" | $raw %][%# We want 1 item per line, without whitespace %] - [%- END -%] - [%- END %] - [%- END -%] - [% END %] - -
- - - [% FOREACH p IN sql_params %] - - [% END %] - [% FOREACH n IN param_names %] - - [% END %] - -
- - - [% IF ( batch_biblionumbers || batch_itemnumbers || batch_cardnumbers || batch_borrowernumbers || batch_reserve_ids ) || ( unlimited_total > 10 && limit <= 1000 ) %] -
- [% IF ( batch_biblionumbers || batch_itemnumbers || batch_cardnumbers || batch_borrowernumbers || batch_reserve_ids ) %] -
- - - -
- - [% END # /IF ( batch_biblionumbers || batch_itemnumbers || batch_cardnumbers || batch_reserve_ids ) %] - - [% IF ( unlimited_total > 10 && limit <= 1000 ) %] -
- - -
- [% END # /IF ( unlimited_total > 10 && limit <= 1000 ) %] - - [% IF ( batch_biblionumbers || batch_itemnumbers || batch_cardnumbers || batch_reserve_ids || batch_borrowernumbers ) %] - - - - - Hide data menus - - [% END %] -
- - [% END # /IF batch operations || ( unlimited_total > 10 && limit <= 1000 ) %] - - - [% END # UNLESS ( errors ) %] - [% END # IF ( execute ) %] - - [% UNLESS ( errors ) %] - + +
- [% FOREACH header_ro IN header_row %] - [% IF header_ro.has_itemnumbers && ( header_ro.cell == 'itemnumber' || header_types.item( header_ro.cell ) == 'itemnumber' ) %] - - [% ELSIF header_ro.has_biblionumbers && ( header_ro.cell == 'biblionumber' || header_types.item( header_ro.cell ) == 'biblionumber' ) %] - - [% ELSIF header_ro.cell == 'cardnumber' || header_types.item( header_ro.cell ) == 'cardnumber' %] - - [% ELSIF header_ro.cell == 'borrowernumber' || header_types.item( header_ro.cell ) == 'borrowernumber' %] - - [% ELSE %] - - [% END %] + + + + + + + + + + + + + + [% IF (usecache) %] + + [% ELSE %] + [% END %] + + [% IF has_obsolete_reports %] + + [% ELSE %] + + [% END %] + + - [% FOREACH result IN results %] + [% FOREACH savedreport IN savedreports %] - [% FOREACH cells IN result.cells %] - [% place = loop.index %] - [%- IF header_row.$place.cell == 'itemnumber' || header_types.item(header_row.$place.cell) == 'itemnumber' %] - - [% ELSIF header_row.$place.cell == 'biblionumber' || header_types.item(header_row.$place.cell) == 'biblionumber' %] - - [% ELSIF header_row.$place.cell == 'borrowernumber' || header_types.item(header_row.$place.cell) == 'borrowernumber' %] - - [% ELSIF header_row.$place.cell == 'cardnumber' || header_types.item(header_row.$place.cell) == 'cardnumber' %] - - [% ELSE %] - + + + + + + + + + + + + + + + + + + [% END %]
[% header_ro.cell | html %][% header_ro.cell | html %][% header_ro.cell | html %][% header_ro.cell | html %][% header_ro.cell | html %] IDReport nameTypeGroupSubgroupNotesAuthorCreation dateLast editLast runPublicJSON URLCache expiry (seconds)Cache expiry (seconds)Saved resultsUpdateUpdateLibrary limitsActions
- [% cells.cell | $raw %] - - - [% cells.cell | $raw %] - - - [% cells.cell | $raw %] - - - [% cells.cell | $raw %] - - [% cells.cell | $raw %] + [% IF ( CAN_user_reports_delete_all_reports || (CAN_user_reports_delete_own_reports && savedreport.borrowernumber == loggedinusernumber) ) %] + + [% END %] - [% END %] + + + + + [% IF ( savedreport.report_name ) %] + [% savedreport.report_name | html %] + [% ELSE %] + [ no name ] + [% END %] + [% savedreport.type | html %] [% savedreport.groupname | html %] [% savedreport.subgroupname | html %] [% savedreport.notes | html %] [%- savedreport.borrowersurname | html -%][%- IF ( savedreport.borrowerfirstname ) -%], [%- savedreport.borrowerfirstname | html -%][%- END -%] ([% savedreport.borrowernumber | html %]) [% savedreport.date_created | $KohaDates %] [% savedreport.last_modified | $KohaDates with_hours => 1 %] [% savedreport.last_run | $KohaDates with_hours => 1 %] + [% IF (savedreport.public) %] + Yes + [% ELSE %] + No + [% END %] + + [% IF (savedreport.public) %] + [% OPACBaseURL | html %]/cgi-bin/koha/svc/report?id=[% savedreport.id | html %] + [% ELSE %] + [% Koha.Preference('staffClientBaseURL') | html %]/cgi-bin/koha/svc/report?id=[% savedreport.id | html %] + [% END %] + [% savedreport.cache_expiry | html %] + [% FOR result IN savedreport.results %] + [% result.date_run | html %] +
+ [% END %] +
+ [% IF savedreport.seems_obsolete %] + This report seems obsolete, it uses biblioitems.marcxml field. + Update SQL + [% END %] + + [% IF ( Koha.Preference('LimitReportsByLibrary') && ( CAN_user_superlibrarian || CAN_user_reports_manage_report_limits ) ) %] + [% IF savedreport.library_limits && savedreport.library_limits.size > 0 %] + [% library_str = "" %] + [% FOREACH library IN savedreport.library_limits %] + [%- IF loop.first -%] + [% library_str = library.branchname _ " (" _ library.branchcode _ ")" %] + [% ELSE %] + [% library_str = library_str _ "\n" _ library.branchname _ " (" _ library.branchcode _ ")" %] + [% END %] + [% END %] + + [% IF savedreport.library_limits.size > 1 %] + [% savedreport.library_limits.size | html %] library limitations + [% ELSE %] + [% savedreport.library_limits.size | html %] library limitation + [% END %] + + [% ELSE %] + No limitation + [% END %] + [% END %] + +
+ [%# There should be no space between these two buttons, it would render badly %] + [%- IF ( CAN_user_reports_execute_reports ) -%] + [% INCLUDE 'throttled-button.inc' element_type='link' href='/cgi-bin/koha/reports/guided_reports.pl?id=' _ savedreport.id _ '&op=run' classes='btn btn-default btn-xs' label=t('Run') attrs={ role => 'button' } %] + [%- ELSE -%] + View + [% END -%] + [%- "" |$raw %] + +
+ +
- [% END %] - -
- [% INCLUDE 'chart.inc' %] - [% END #/IF ( execute ) %] - [% IF ( create ) %] -

Create from SQL

-
- [% INCLUDE 'csrf-token.inc' %] -
- Create report from SQL -
    -
  1. - - [% IF ( reportname ) %] - - [% ELSE %] - + [% IF ( CAN_user_reports_delete_all_reports || CAN_user_reports_delete_own_reports ) %] +
    + +
    + [% END %] +
  2. + [% END # /tab_panel# %] + [% END # /WRAPPER tab_panels %] + [% END # /WRAPPER tabs %] + [% ELSE # IF ( savedreports ) %] +
    + [% IF (filter_set || filters.date || filters.author || filters.keyword) %] +

    No saved reports match your criteria.

    + [% IF ( CAN_user_reports_create_reports ) %] + New guided report + + New SQL report + + Cancel filter + [% END %] + [% ELSE %] +

    There are no saved reports.

    + [% IF ( CAN_user_reports_create_reports ) %] + Build a new report? + [% END %] + [% END # IF (filter_set || filters.date || filters.author || filters.keyword) %] +
    + + [% END # /IF ( savedreports ) %] + [% END # /IF ( saved1 ) %] + + [% INCLUDE 'mana/mana-share-report.inc' %] + + [% IF ( build1 ) %] + [% IF ( cache_error) %] +
    + Please choose a cache_expiry less than 30 days +
    + [% END %] + +

    Build a report

    +
    + [% INCLUDE 'csrf-token.inc' %] +
    + Step 1 of 7: Choose a module to report on,[% IF (usecache) %]Set cache expiry,[% END %] and choose report visibility +
      +
    1. + + +
    2. + [% IF (public) %] +
    3. + + +
    4. + [% ELSE %] +
    5. + + +
    6. + [% END %] + + [% IF (usecache) %] +
    7. + + + +
    8. + [% END %] +
    +
    + +
    + + +
    +
    + [% END # /build1 %] + + [% IF ( build2 ) %] +

    Build a report

    +
    + [% INCLUDE 'csrf-token.inc' %] + + + +
    + Step 2 of 7: Pick a report type +
      +
    1. + + +
    2. +
    +
    + +
    + + + +
    +
    + [% END # /IF (build2 ) %] + + [% IF ( build3 ) %] +

    Build a report

    + +
    + [% INCLUDE 'csrf-token.inc' %] + + + + +
    + Step 3 of 7: Select columns for display +

    Note: Be careful selecting when selecting columns. If your choice is too broad it could result in a very large report that will either not complete, or slow your system down.

    + +
    +
    + +
    +
    + + +
    +
    + +
    +
    +
    +
    + + + +
    +
    + + [% END # /IF ( build3 ) %] - [% IF (public) %] -
  3. - - -
  4. + [% IF ( build4 ) %] +

    Build a report

    +
    + [% INCLUDE 'csrf-token.inc' %] + + + + + +
    + Step 4 of 7: Select criteria to limit on + + [% FOREACH criteri IN criteria %] + + + [% IF ( criteri.date ) %] + + [% ELSE %] + [% IF ( criteri.textrange ) %] + [% ELSE %] -
  5. - - -
  6. - [% END # /IF (public) %] - - [% IF (usecache) %] -
  7. - - - -
  8. - [% END # /IF (usecache) %] -
  9. - - -
  10. - - - - - [% IF ( Koha.Preference('LimitReportsByLibrary') && ( CAN_user_superlibrarian || CAN_user_reports_manage_report_limits ) ) %] -
    - Library limitation: -
    - - -
    Limits the use of this report to the selected libraries.
    -
    -
    - [% END %] - -
    - SQL: -
    - [% PROCESS insert_runtime_parameter %] - - * In order to achieve auto-complete for columns, please prepend the column name with the table name, followed by a period. For example: 'borrowers.surname' -
    - Required -
    -
    - -
    - - - Cancel -
    - - [% END #/IF ( create ) %] - - [% IF saved_results %] -

    Saved report results

    -

    [% name | html %]

    -

    [% notes | scrub_html type => 'note' | $raw %]

    -
    + + + + + [% INCLUDE 'date-format.inc' %] + + from + to + +
    - [% FOREACH rows IN saved_results %] - - [% FOREACH col IN rows %] - + [% IF ( criteri.daterange ) %] + + [% ELSE %] + + [% END %] [% END %] + [% END %] + + [% END %] +
    [% col | html %] + from + + to + + [% INCLUDE 'date-format.inc' %] + + +
    +
    + + [% IF ( definitions ) %] +
    + Dictionary definitions + + [% FOREACH definition IN definitions %] + + [% END %]
    + + [% definition.name | html %] +
    - [% END # /IF saved_results %] +
    + [% END %] - [% IF ( showsql ) %] -

    Saved reports - SQL

    -
    - [% reportname | html %] -
      - [% IF ( notes ) %] -
    1. - Notes: - [% notes | scrub_html type => 'note' | $raw %] -
    2. - [% ELSE %] +
      + + + +
      + + [% END # /IF ( build4 ) %] - [% END %] -
    3. - -
    4. -
    -
    - [% END # /IF ( showsql ) %] - - [% IF ( save_successful ) %] - [% UNLESS ( errors ) %] -
    -
    - [% IF ( reportname ) %] -
    Your report "[% reportname | html %]" has been saved
    - [% ELSE %] -
    Your report has been saved without a title
    - [% END %] -
    + [% IF ( build5 ) %] +

    Build a report

    +
    + [% INCLUDE 'csrf-token.inc' %] + + + + + + + +
    + Step 5 of 7: Pick which columns to total + + [% FOREACH total_b IN total_by %] + + + + [% END %] +
    + + + + +
    +
    + +
    + + +
    +
    + [% END # /IF ( build5 ) %] + + [% IF ( build6 ) %] +

    Build a report

    +
    + [% INCLUDE 'csrf-token.inc' %] + + + + + + + + +
    + Step 6 of 7: Choose how you want the report ordered + + [% FOREACH order_b IN order_by %] + + + + + [% END %] +
    + + + + +
    +
    +
    + + + +
    +
    + [% END #/ IF ( build6 ) %] + + [% IF ( showreport ) %] +

    Build a report

    +
    +

    Step 7 of 7: Confirm custom report

    +

    Your report will be generated with the following SQL statement.

    + +
    You may add a title to your report in the next step.
    +
    + +
    + [% INCLUDE 'csrf-token.inc' %] + + + + +
    + + +
    +
    + [% END #/ IF ( showreport ) %] + + [% IF ( save ) %] +
    + [% INCLUDE 'csrf-token.inc' %] + + + + + +
    +

    Save your custom report

    +
      +
    1. + + + Required +
    2. + [% PROCESS group_and_subgroup_selection %] +
    3. + + +
    4. +
    +
    +
    + +
    +
    + [% END # /IF( save ) %] + + [% IF ( warn_authval_problem ) %] +
    +

    Errors found when processing parameters for report: [% name | html %]

    + [% FOREACH problematic_authval IN problematic_authvals %] +

    [% problematic_authval.name | html %]: The authorized value category ([% problematic_authval.authval | html %]) you selected does not exist.

    + [% END %] + +
    + + [% INCLUDE 'csrf-token.inc' %] + + + + + + + + + + + [% IF ( op == 'update') %] + + + [% ELSIF ( op == 'save') %] + + + [% END %] +
    + + Edit SQL +
    + [% END # /IF ( warn_authval_problem ) %] - [% IF ( editsql ) %] -
    - [% INCLUDE 'csrf-token.inc' %] - -
    -

    Edit SQL report

    -
      + [% IF ( enter_params ) %] + [% IF ( auth_val_error ) %] +
      +

      Errors found when processing parameters for report: [% name | html %]

      + [% FOREACH auth_val_error IN auth_val_errors %] +

      [% auth_val_error.entry | html %]: The authorized value category ([% auth_val_error.auth_val | html %]) you selected does not exist.

      + [% END %] +
      +
      + Edit SQL +
      + [% ELSE # IF ( auth_val_error ) %] + + +

      Enter parameters for report [% name | html %]:

      + [% IF ( notes ) %] +

      [% notes | scrub_html type => 'note' | $raw %]

      + [% END %] +
      +
        + [% FOREACH sql_param IN sql_params %] + + [% IF sql_param.input == 'date' %]
      1. - - - Required + +
      2. - [% PROCESS group_and_subgroup_selection %] - [% IF (public) %] -
      3. - - -
      4. - [% ELSE %] -
      5. - - -
      6. - [% END # /IF (public) %] - - [% IF (usecache) %] -
      7. - - - -
      8. - [% END %] + [% ELSIF ( sql_param.input == 'text' ) %]
      9. - - + +
      10. -
      -
      - - - [% IF ( Koha.Preference('LimitReportsByLibrary') && ( CAN_user_superlibrarian || CAN_user_reports_manage_report_limits ) ) %] -
      - Library limitation: -
      - + + [% ELSE %] +
    1. + + -
      Limits the use of this report to the selected libraries.
      -
    2. -
      - [% END %] + + [% END # /IF sql_param.input == 'date' %] + [% END # /FOREACH sql_param %] +
    +
    + +
    + + [% IF ( template_code ) %] + + [% END %] + [% INCLUDE 'throttled-button.inc' element_type='button' classes='btn btn-primary' label=t('Run the report') %] +
    +
    + [% END # / IF ( auth_val_error ) %] + [% END # /IF ( enter_params ) %] -
    - SQL: - [% PROCESS insert_runtime_parameter %] - - * In order to achieve auto-complete for columns, please prepend the column name with the table name, followed by a period. For example: 'borrowers.surname' -
    - Required -
    + [% IF processed_notice %] + [% processed_notice | $raw %] + [% ELSIF ( execute ) %] +

    [% name | html %] Report ID: [% id | html %]

    +
    + [% IF ( notes ) %] +

    Notes: [% notes | scrub_html type => 'note' | $raw %]

    + [% END %] + [% IF ( unlimited_total ) %] +

    + Total number of results: + [% unlimited_total | html %] + [% IF unlimited_total >= limit %] + ([% results.size | html %] shown) + [% END %] +

    + [% END %] -
    - - [% IF ( CAN_user_reports_create_reports && CAN_user_reports_execute_reports ) %] - [% INCLUDE 'throttled-button.inc' element_type='button' classes='btn btn-default' label=t('Update and run SQL') attrs={ name => 'op', value => 'cud-update_and_run_sql' } %] - [% END %] - Cancel -
    + + + +
    + + [% IF ( execute ) %] + [% UNLESS ( errors ) %] +
    + [% INCLUDE 'csrf-token.inc' %] + + + [%# Preserve the whitespace of the following textarea in order to format the values correctly %] +
    - [% END # /IF ( editsql ) %] - [% IF ( errors ) %] -
    -
    -

    The following error was encountered:

    - [% FOREACH error IN errors %] - [% IF ( error.duplicate_running_report ) %] -

    This report is already running. Please wait for it to finish before running it again.

    - [% ELSIF ( error.total_running_reports_limit_exceeded ) %] -

    You have too many reports running at the moment. Please wait for some of them to finish before running this report again.

    - [% ELSIF ( error.sqlerr ) %] -

    This report contains an SQL keyword: [% error.sqlerr | html %].

    -

    Use of this keyword is not allowed in Koha reports due to security and data integrity risks. Only SELECT queries are allowed.

    -

    Please delete this report or retry creating a new one.

    - [% ELSIF ( error.queryerr ) %] -

    SQL error:

    -

    [% error.queryerr | html %]

    -

    Please check the log for further details.

    - [% ELSIF ( error.cache_expiry ) %] -

    Please select a cache expiry less than 30 days.

    - [% ELSIF ( error.passworderr ) %] -

    The column selection in this report includes a password field.

    -

    The report cannot be executed due to security risks. Please edit this report and ensure no password columns have been selected.

    - [% ELSE %] + + [% INCLUDE 'csrf-token.inc' %] + + + [%# Preserve the whitespace of the following textarea in order to format the values correctly %] + + +
    + [% INCLUDE 'csrf-token.inc' %] + + [% FOREACH result IN results %] + [% FOREACH cells IN result.cells %] + [% place = loop.index %] + [% NEXT UNLESS cells.cell.match('^(\d+)$') %] + [% IF header_row.$place.cell == 'itemnumber' || header_types.item(header_row.$place.cell) == 'itemnumber' %] + [% SET batch_itemnumbers = 1 %] + [% SET header_row.$place.has_itemnumbers = 1 %] + [% END %] -
    - Return to previous page + [% END %] + [% END %] + + +
    + [% INCLUDE 'csrf-token.inc' %] + + + [% FOREACH result IN results %] + [% FOREACH cells IN result.cells %] + [% place = loop.index %] + [% NEXT UNLESS cells.cell.match('^(\d+)$') %] + [% IF header_row.$place.cell == 'itemnumber' || header_types.item(header_row.$place.cell) == 'itemnumber' %] + [% SET batch_itemnumbers = 1 %] + [% SET header_row.$place.has_itemnumbers = 1 %] + + [% END %] + [% END %] + [% END %] +
    + +
    + [% FOREACH result IN results %] + [% FOREACH cells IN result.cells %] + [% place = loop.index %] + [% NEXT UNLESS cells.cell.match('^(\d+)$') %] + [% IF header_row.$place.cell == 'biblionumber' || header_types.item(header_row.$place.cell) == 'biblionumber' %] + [% SET batch_biblionumbers = 1 %] + [% SET header_row.$place.has_biblionumbers = 1 %] + + [% END %] + [% END %] + [% END %] +
    + +
    + [% INCLUDE 'csrf-token.inc' %] + + [%# Preserve the whitespace of the following textarea in order to format the values correctly %] + [%- borrowernumbers = PROCESS batch_list results=results batch_type='borrowernumber' | trim | html -%] + [%- IF borrowernumbers -%] + [%- SET batch_borrowernumbers = 1 -%] + + [%- END -%] + [%- cardnumbers = PROCESS batch_list results=results batch_type='cardnumber' | trim | html %] + [% IF !batch_borrowernumbers && cardnumbers %] + [% SET batch_cardnumbers = 1 %] + + [% END %] +
    + +
    + [% INCLUDE 'csrf-token.inc' %] + + + [%# Preserve the whitespace of the following textarea in order to format the values correctly %] + +
    + +
    + [% INCLUDE 'csrf-token.inc' %] + + +
    + + [% BLOCK batch_list %] + [%- FOREACH result IN results %] + [%- FOREACH cells IN result.cells %] + [%- place = loop.index %] + [%- IF header_row.$place.cell == batch_type || header_types.item(header_row.$place.cell) == batch_type -%] + [%- cells.cell | html -%][% "\n" | $raw %][%# We want 1 item per line, without whitespace %] + [%- END -%] + [%- END %] + [%- END -%] + [% END %] + +
    + + + [% FOREACH p IN sql_params %] + + [% END %] + [% FOREACH n IN param_names %] + + [% END %] + +
    + + + [% IF ( batch_biblionumbers || batch_itemnumbers || batch_cardnumbers || batch_borrowernumbers || batch_reserve_ids ) || ( unlimited_total > 10 && limit <= 1000 ) %] +
    + [% IF ( batch_biblionumbers || batch_itemnumbers || batch_cardnumbers || batch_borrowernumbers || batch_reserve_ids ) %] +
    + + +
    + + [% END # /IF ( batch_biblionumbers || batch_itemnumbers || batch_cardnumbers || batch_reserve_ids ) %] + + [% IF ( unlimited_total > 10 && limit <= 1000 ) %] +
    + + +
    + [% END # /IF ( unlimited_total > 10 && limit <= 1000 ) %] + + [% IF ( batch_biblionumbers || batch_itemnumbers || batch_cardnumbers || batch_reserve_ids || batch_borrowernumbers ) %] + + + + + Hide data menus + [% END %]
    -
    - - -
    - - [% END # /IF ( errors ) %] + + [% END # /IF batch operations || ( unlimited_total > 10 && limit <= 1000 ) %] + + + [% END # UNLESS ( errors ) %] + [% END # IF ( execute ) %] + + [% UNLESS ( errors ) %] + + + + [% FOREACH header_ro IN header_row %] + [% IF header_ro.has_itemnumbers && ( header_ro.cell == 'itemnumber' || header_types.item( header_ro.cell ) == 'itemnumber' ) %] + + [% ELSIF header_ro.has_biblionumbers && ( header_ro.cell == 'biblionumber' || header_types.item( header_ro.cell ) == 'biblionumber' ) %] + + [% ELSIF header_ro.cell == 'cardnumber' || header_types.item( header_ro.cell ) == 'cardnumber' %] + + [% ELSIF header_ro.cell == 'borrowernumber' || header_types.item( header_ro.cell ) == 'borrowernumber' %] + + [% ELSE %] + + [% END %] + [% END %] + + + + [% FOREACH result IN results %] + + [% FOREACH cells IN result.cells %] + [% place = loop.index %] + [%- IF header_row.$place.cell == 'itemnumber' || header_types.item(header_row.$place.cell) == 'itemnumber' %] + + [% ELSIF header_row.$place.cell == 'biblionumber' || header_types.item(header_row.$place.cell) == 'biblionumber' %] + + [% ELSIF header_row.$place.cell == 'borrowernumber' || header_types.item(header_row.$place.cell) == 'borrowernumber' %] + + [% ELSIF header_row.$place.cell == 'cardnumber' || header_types.item(header_row.$place.cell) == 'cardnumber' %] + + [% ELSE %] + + [% END %] + [% END %] + + [% END %] + +
    [% header_ro.cell | html %][% header_ro.cell | html %][% header_ro.cell | html %][% header_ro.cell | html %][% header_ro.cell | html %]
    + [% cells.cell | $raw %] + + + [% cells.cell | $raw %] + + + [% cells.cell | $raw %] + + + [% cells.cell | $raw %] + + [% cells.cell | $raw %]
    + [% END %] + +
    + [% INCLUDE 'chart.inc' %] + [% END #/IF ( execute ) %] + + [% IF ( create ) %] +

    Create from SQL

    +
    + [% INCLUDE 'csrf-token.inc' %] +
    + Create report from SQL +
      +
    1. + + [% IF ( reportname ) %] + + [% ELSE %] + + [% END %] + Required +
    2. + [% PROCESS group_and_subgroup_selection %] + + [% IF (public) %] +
    3. + + +
    4. + [% ELSE %] +
    5. + + +
    6. + [% END # /IF (public) %] + + [% IF (usecache) %] +
    7. + + + +
    8. + [% END # /IF (usecache) %] +
    9. + + +
    10. +
    +
    + + + [% IF ( Koha.Preference('LimitReportsByLibrary') && ( CAN_user_superlibrarian || CAN_user_reports_manage_report_limits ) ) %] +
    + Library limitation: +
    + + +
    Limits the use of this report to the selected libraries.
    +
    +
    + [% END %] + +
    + SQL: +
    + [% PROCESS insert_runtime_parameter %] + + * In order to achieve auto-complete for columns, please prepend the column name with the table name, followed by a period. For example: 'borrowers.surname' +
    + Required +
    +
    + +
    + + + Cancel +
    +
    + [% END #/IF ( create ) %] + + [% IF saved_results %] +

    Saved report results

    +

    [% name | html %]

    +

    [% notes | scrub_html type => 'note' | $raw %]

    + + [% FOREACH rows IN saved_results %] + + [% FOREACH col IN rows %] + + [% END %] + + [% END %] +
    [% col | html %]
    + [% END # /IF saved_results %] + + [% IF ( showsql ) %] +

    Saved reports - SQL

    +
    + [% reportname | html %] +
      + [% IF ( notes ) %] +
    1. + Notes: + [% notes | scrub_html type => 'note' | $raw %] +
    2. + [% ELSE %] + + [% END %] +
    3. + +
    4. +
    +
    + [% END # /IF ( showsql ) %] + + [% IF ( save_successful ) %] + [% UNLESS ( errors ) %] +
    +
    + [% IF ( reportname ) %] +
    Your report "[% reportname | html %]" has been saved
    + [% ELSE %] +
    Your report has been saved without a title
    + [% END %] +
    + [% END %] + [% END %] + + [% IF ( editsql ) %] +
    + [% INCLUDE 'csrf-token.inc' %] + +
    +

    Edit SQL report

    +
      +
    1. + + + Required +
    2. + [% PROCESS group_and_subgroup_selection %] + [% IF (public) %] +
    3. + + +
    4. + [% ELSE %] +
    5. + + +
    6. + [% END # /IF (public) %] + + [% IF (usecache) %] +
    7. + + + +
    8. + [% END %] +
    9. + + +
    10. +
    +
    + + + [% IF ( Koha.Preference('LimitReportsByLibrary') && ( CAN_user_superlibrarian || CAN_user_reports_manage_report_limits ) ) %] +
    + Library limitation: +
    + +
    Limits the use of this report to the selected libraries.
    +
    +
    + [% END %] + +
    + SQL: + [% PROCESS insert_runtime_parameter %] + + * In order to achieve auto-complete for columns, please prepend the column name with the table name, followed by a period. For example: 'borrowers.surname' +
    + Required +
    + +
    + + [% IF ( CAN_user_reports_create_reports && CAN_user_reports_execute_reports ) %] + [% INCLUDE 'throttled-button.inc' element_type='button' classes='btn btn-default' label=t('Update and run SQL') attrs={ name => 'op', value => 'cud-update_and_run_sql' } %] + [% END %] + Cancel +
    +
    + [% END # /IF ( editsql ) %] + + [% IF ( errors ) %] +
    +
    +

    The following error was encountered:

    + [% FOREACH error IN errors %] + [% IF ( error.duplicate_running_report ) %] +

    This report is already running. Please wait for it to finish before running it again.

    + [% ELSIF ( error.total_running_reports_limit_exceeded ) %] +

    You have too many reports running at the moment. Please wait for some of them to finish before running this report again.

    + [% ELSIF ( error.sqlerr ) %] +

    This report contains an SQL keyword: [% error.sqlerr | html %].

    +

    Use of this keyword is not allowed in Koha reports due to security and data integrity risks. Only SELECT queries are allowed.

    +

    Please delete this report or retry creating a new one.

    + [% ELSIF ( error.queryerr ) %] +

    SQL error:

    +

    [% error.queryerr | html %]

    +

    Please check the log for further details.

    + [% ELSIF ( error.cache_expiry ) %] +

    Please select a cache expiry less than 30 days.

    + [% ELSIF ( error.passworderr ) %] +

    The column selection in this report includes a password field.

    +

    The report cannot be executed due to security risks. Please edit this report and ensure no password columns have been selected.

    + [% ELSE %] + + [% END %] + + [% END %] +
    +
    + + +
    +
    + [% END # /IF ( errors ) %] [% END %]