Bug 32091

Summary: Consistent classes for primary buttons: Reports
Product: Koha Reporter: Owen Leonard <oleonard>
Component: TemplatesAssignee: Owen Leonard <oleonard>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: david, testopia
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00
Bug Depends on:    
Bug Blocks: 32067    
Attachments: Bug 32091: Consistent classes for primary buttons: Reports
Bug 32091: Consistent classes for primary buttons: Reports
Screenshots of pages changed - before patch applied
Bug 32091: Consistent classes for primary buttons: Reports

Description Owen Leonard 2022-11-03 14:21:16 UTC
As part of Bug 32067 - [OMNIBUS] Consistent classes for submit and/or primary buttons:

This patch will update buttons in reports templates so that buttons which are currently styled as primary buttons will have the the "btn btn-primary" classes.

In some places, the classes have been added to buttons which were not input[type='submit'] but which should be styled as primary.
Comment 1 Owen Leonard 2022-11-03 14:31:17 UTC
Created attachment 143119 [details] [review]
Bug 32091: Consistent classes for primary buttons: Reports

This patch makes changes the button markup in reports templates so that
all submit buttons and any buttons that should should be styled as
primary buttons have the Bootstrap class "btn btn-primary."

To test, apply the patch and view reports pages to confirm that
everything looks correct. In most cases there are no visible changes.
Comment 2 David Nind 2022-11-07 03:00:46 UTC
Created attachment 143345 [details] [review]
Bug 32091: Consistent classes for primary buttons: Reports

This patch makes changes the button markup in reports templates so that
all submit buttons and any buttons that should should be styled as
primary buttons have the Bootstrap class "btn btn-primary."

To test, apply the patch and view reports pages to confirm that
everything looks correct. In most cases there are no visible changes.

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2022-11-07 03:05:02 UTC
Testing notes (using KTD).

1. These changed templates are accessed from: Reports
   
2. I tested by:
   - Reviewing the patch - <input type="submit"... becomes <input type="submit" class="btn btn-primary"...
   - Listing the templates in koha-tmpl/intranet-tmpl/prog/en/modules/reports/ and splitting into two lists - those changed and those not changed
   - Working out how to access them
   - Creating screenshots and putting them in a document (I have attached this, as there are a lot of pages and screenshots)
   - Applying the patch (+ flush_memcached, restart_all, and clear browser cache)
   - Going through the list of files again: compared to screenshot taken, then noted whether visible changes or not
   - Noting any questions - these don't affect the sign off for this bug
   
3. Files changed - no visible changes for all files that were changed:
   - acquisitions_stats.tt (No visible change. Reports > Statistics wizards > Acquisitions)
   - bor_issues_top.tt (No visible change. Reports > Top lists > Patrons with the most checkouts)
   - borrowers_out.tt (No visible change. Reports > Inactive > Patrons who haven't checked out)
   - borrowers_stats.tt (No visible change. Reports > Statistics wizards > Patrons)
   - cash_register_stats.tt (No visible change. Reports > Statistics wizards > Cash register)
   - cat_issues_top.tt (No visible change. Reports > Top lists > Most-circulated items
   - catalogue_out.tt (No visible change. Reports > Inactive > Items with no checkouts)
   - catalogue_stats.tt (No visible change. Reports > Statistics wizards > Catalog)  
   - dictionary.tt (No visible change. Reports > Reports dictionary > View dictionary. Setup: Go through Steps 1 to 5 to add a new definition - all have 'Next buttons' then 'Save' as the last button)
   - guided_reports_start.tt - all use guided_reports.pl:
     . Create guided reports (No visible change. Reports > Guided reports > [six steps - steps 1 to 5 have a Next button, step 6 = Finish, the confirm steps (Next, then Save report), then Edit SQL report where you can either update the SQL, run or schedule the report])
     . Create from SQL (No visible change. Guided reports > Create from SQL)
     . Use saved (No visible change. Guided reports > Use saved)
     . Search by keyword (No visible change. Guided reports > Search by keyword. Takes you to the 'Used saved' page with a filter)
   - issues_avg_stats.tt (No visible change. Reports > Other > Average loan time)
   - issues_stats.tt (No visible change. Reports > Statistics wizards > Circulation)
   - itemslost.tt (No visible change. Reports > Other > Items lost)
   - itemtypes.tt (No visible change. Reports > Other > Catalog by item type)
   - orders_by_budget.tt (No visible change. Reports > Other > Orders by fund)
   - reports-home.tt (No visible change. Reports home page)
   - reserves_stats.tt (No visible change. Reports > Statistics wizards > Holds)
   - serials_stats.tt (No visible change. Reports > Statistics wizards > Serials)

4. Files not changed:
   - convert_report.tt (referenced by svc/convert_report, doesn't have any submit buttons)
   - csv/cash_register_stats.tt (referenced by reports/cash_register_stats.pl, doesn't have any submit buttons)
   - csv/orders_by_budget.tt (referenced by reports/orders_by_fund.pl, doesn't have any submit buttons)

5. Other things:
   - Report plugins link: goes to plugins home page

6. File count check:
   - Number of files in folder: 19 + 2 in csv subfolder = 21
   - Number of files listed: 21 (18 changed in this patch)

Questions and notes

1. Dictionary - deleting current terms: when you delete a definition, you are NOT prompted to confirm deletion. This seems at odds with our normal pattern to get confirmation before deleting something.

2. GROUP BY issue when database is in strict mode:
   - Patrons with the most checkouts (bor_issues_top.pl): bug 32116 created
   - Patrons who haven't checked out/Patrons with no checkouts (borrowers_out.pl): existing bug 31578
   - Items with no checkouts (catalogue_out.pl): bug 32117 created

3. Breadcrumb for guided reports: In any of the guided reports areas, clicking on the 'Guided reports wizard' breadcrumb takes you back to a landing page for guided reports that has links to the various areas. Should this just be 'Guided reports' and then take you back to the reports home page instead?

4. Lost items report: 
   - if there are no lost items, you just get a page with a blank body area with the heading "Lost items" if there are no results
   - this message appears when there are results for the report:
     "To enable the export of selected items, create a CSV profile of the type "SQL" with usage option "Export lost items in report.""
   - if I create a CSV profile and then refresh the lost items list the option to select the CSV profile/export very briefly appears, then disappears - it maybe something wrong with my CSV profile

5. Orders by fund: similar to the lost items report, you get a blank body area with the heading "Orders by fund" if there are no results.

6. Statistics wizards: most of the pages have the heading repeated, for example: acquisition statistics. The only one that don't is the serials statistics - the single heading is "Serials subscriptions". The cash register statistics heading is repeated, but this includes the date range.

7. Page name heading inconsistencies with the link on reports landing page:
   - 'Items lost' on reports landing page, 'Lost items' on actual page
   - 'Serials' on reports landing page, 'Serials subscriptions' on actual page
   - 'Reports dictionary'/'View dictionary' on landing page, 'Dictionary' on actual page: perhaps on the landing page just have as part of the guided reports block with "Reports dictionary" as the name of the link with an appropriate icon, and on use "Reports dictionary" on the actual pages. Would also require changes to the sidebar.
   - 'Create guided report' on landing page, 'Build a report' on step pages.
   - 'Use saved' on landing page, 'Saved reports" on actual page
   - 'Patrons who haven't checked out' on landing page, 'Patrons with no checkouts' on actual page
   - 'Catalog by item type' on landing page, 'View a count of items held at your library grouped by item type' on actual page
   - 'Average loan time' on landing page, 'Average checkout period' on actual page
Comment 4 David Nind 2022-11-07 03:12:44 UTC
Created attachment 143346 [details]
Screenshots of pages changed - before patch applied

As there were a lot of pages changed, I've attached a file with screenshots of the pages before the patch was applied.

The order is the same as the list of files changed in comment #3.
Comment 5 Tomás Cohen Arazi 2022-11-09 17:50:29 UTC
Created attachment 143561 [details] [review]
Bug 32091: Consistent classes for primary buttons: Reports

This patch makes changes the button markup in reports templates so that
all submit buttons and any buttons that should should be styled as
primary buttons have the Bootstrap class "btn btn-primary."

To test, apply the patch and view reports pages to confirm that
everything looks correct. In most cases there are no visible changes.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 6 Tomás Cohen Arazi 2022-11-09 18:29:51 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!