Bug 9573 - Ability to download items lost report
Summary: Ability to download items lost report
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Jonathan Druart
QA Contact:
URL:
Keywords:
Depends on: 20236
Blocks: 19507 18433 20774 20831 22601
  Show dependency treegraph
 
Reported: 2013-02-08 13:35 UTC by Nicole C. Engard
Modified: 2020-01-06 20:15 UTC (History)
5 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 9573: Lost items report - Add items.notforloan as a filter (7.95 KB, patch)
2017-10-13 18:03 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9573: Lost items report - Move filters code to a separate js file (8.50 KB, patch)
2017-10-13 18:04 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9573: Lost items report - add KohaTable to itemlost (13.65 KB, patch)
2017-10-13 18:04 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9573: Lost items report - Add a new itemlost_on column (2.73 KB, patch)
2017-10-13 18:04 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9573: Lost items report - Add a new "Export selected items" link (4.61 KB, patch)
2017-10-13 18:04 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9573: Lost items report - Add the CSV export ability (8.61 KB, patch)
2017-10-13 18:04 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9573: (follow-up) Lost items report - add KohaTable to itemlost (995 bytes, patch)
2017-10-16 15:10 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9573: Add missing use statement (587 bytes, patch)
2017-10-18 22:50 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9573: Lost items report - Add items.notforloan as a filter (8.01 KB, patch)
2017-10-21 21:28 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 9573: Lost items report - Move filters code to a separate js file (8.56 KB, patch)
2017-10-21 21:28 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 9573: Lost items report - add KohaTable to itemlost (13.70 KB, patch)
2017-10-21 21:28 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 9573: Lost items report - Add a new itemlost_on column (2.79 KB, patch)
2017-10-21 21:28 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 9573: Lost items report - Add a new "Export selected items" link (4.67 KB, patch)
2017-10-21 21:28 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 9573: Lost items report - Add the CSV export ability (8.67 KB, patch)
2017-10-21 21:28 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 9573: (follow-up) Lost items report - add KohaTable to itemlost (1.03 KB, patch)
2017-10-21 21:28 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 9573: Add missing use statement (644 bytes, patch)
2017-10-21 21:28 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 9573: Lost items report - Add items.notforloan as a filter (8.13 KB, patch)
2017-10-23 14:09 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 9573: Lost items report - Move filters code to a separate js file (8.69 KB, patch)
2017-10-23 14:09 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 9573: Lost items report - add KohaTable to itemlost (13.77 KB, patch)
2017-10-23 14:09 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 9573: Lost items report - Add a new itemlost_on column (2.92 KB, patch)
2017-10-23 14:09 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 9573: Lost items report - Add a new "Export selected items" link (4.81 KB, patch)
2017-10-23 14:09 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 9573: Lost items report - Add the CSV export ability (8.79 KB, patch)
2017-10-23 14:09 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 9573: (follow-up) Lost items report - add KohaTable to itemlost (1.17 KB, patch)
2017-10-23 14:10 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 9573: Add missing use statement (846 bytes, patch)
2017-10-23 14:10 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 9573: Lost items report - Add items.notforloan as a filter (8.15 KB, patch)
2018-02-07 14:26 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9573: Lost items report - Move filters code to a separate js file (8.71 KB, patch)
2018-02-07 14:26 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9573: Lost items report - add KohaTable to itemlost (14.05 KB, patch)
2018-02-07 14:26 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9573: Lost items report - Add a new itemlost_on column (2.94 KB, patch)
2018-02-07 14:27 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9573: Lost items report - Add a new "Export selected items" link (4.95 KB, patch)
2018-02-07 14:27 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9573: Lost items report - Add the CSV export ability (8.76 KB, patch)
2018-02-07 14:27 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9573: (follow-up) Lost items report - add KohaTable to itemlost (1.17 KB, patch)
2018-02-07 14:27 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9573: Add missing use statement (878 bytes, patch)
2018-02-07 14:27 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9573: Lost items report - Add items.notforloan as a filter (8.15 KB, patch)
2018-02-17 14:49 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9573: Lost items report - Move filters code to a separate js file (8.76 KB, patch)
2018-02-17 14:49 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9573: Lost items report - add KohaTable to itemlost (14.44 KB, patch)
2018-02-17 14:49 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9573: Lost items report - Add a new itemlost_on column (2.94 KB, patch)
2018-02-17 14:49 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9573: Lost items report - Add a new "Export selected items" link (4.95 KB, patch)
2018-02-17 14:49 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9573: Lost items report - Add the CSV export ability (8.76 KB, patch)
2018-02-17 14:49 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9573: (follow-up) Lost items report - add KohaTable to itemlost (1.17 KB, patch)
2018-02-17 14:49 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9573: Add missing use statement (878 bytes, patch)
2018-02-17 14:50 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9573: Add missing KOHA_VERSION in js paths (1.70 KB, patch)
2018-02-17 14:50 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 9573: Lost items report - Move filters code to a separate js file (8.80 KB, patch)
2018-02-17 17:33 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 9573: Lost items report - add KohaTable to itemlost (14.42 KB, patch)
2018-02-17 17:33 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 9573: Lost items report - Add a new itemlost_on column (2.98 KB, patch)
2018-02-17 17:33 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 9573: Lost items report - Add a new "Export selected items" link (5.00 KB, patch)
2018-02-17 17:33 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 9573: Lost items report - Add the CSV export ability (8.80 KB, patch)
2018-02-17 17:33 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 9573: (follow-up) Lost items report - add KohaTable to itemlost (1.22 KB, patch)
2018-02-17 17:33 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 9573: Add missing use statement (929 bytes, patch)
2018-02-17 17:33 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 9573: Add missing KOHA_VERSION in js paths (1.74 KB, patch)
2018-02-17 17:33 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 9573: (QA follow-up) Add missing include back (1023 bytes, patch)
2018-02-17 17:33 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nicole C. Engard 2013-02-08 13:35:32 UTC
It would be nice if the items lost report had downloadable results.
Comment 1 Séverine Queune 2017-09-11 15:07:24 UTC
The BULAC (http://www.bulac.fr/) would like to sponsore this development with the following features.

On the form page :
  - add a new filter option on the “items.notforloan” field

On the result page :
  - items can be selected
  - there are options “Activate / Deactivate filters”, “Select all” and “Clear all” (like on the “Holdings” tab on the bibliographic record)
  - a column display the “items.itemlost_on” timestamp
  - selected items can be exported ; different csv profiles can be chosen, based on the existing “CSV profiles” on the “Tools” menu

As long as “Change sponsored?” is set on “Seeking developer”, anyone wanting to quote us for the development of such a feature or just ask for more information is welcome to write to us: <sigb@bulac.fr>.
Comment 2 Jonathan Druart 2017-10-13 18:03:59 UTC
Created attachment 68085 [details] [review]
Bug 9573: Lost items report - Add items.notforloan as a filter

This patch adds a new "Not for loan" status filter to the lost items
report.

Test plan:
0/ Apply all patches from this patch set
1/ Use the new "Not for loan" filter to search lost items
2/ The table result must be consistent and a new "Not for loan" column
should be there
3/ Confirm that you are able to hide/show this column with the column
settings tool.
Comment 3 Jonathan Druart 2017-10-13 18:04:02 UTC
Created attachment 68086 [details] [review]
Bug 9573: Lost items report - Move filters code to a separate js file

For the next patches we will need to reuse what is already done on the
bibliographic record detail page. This patch moves the code to make it
reusable easily and avoid copy and paste.
Comment 4 Jonathan Druart 2017-10-13 18:04:06 UTC
Created attachment 68087 [details] [review]
Bug 9573: Lost items report - add KohaTable to itemlost

Before this patch set, we used KohaTable to display a table with the
column visibility plugin, and an usual dataTable initialisation for the
filters.
For the lost items report table we will need both.
To do so we need to reorganize the code a bit

We cannot pass a selector but the id of the node which represents the
table. Indeed it is how works currently the filters (we may want to
improve that later)
Comment 5 Jonathan Druart 2017-10-13 18:04:09 UTC
Created attachment 68088 [details] [review]
Bug 9573: Lost items report - Add a new itemlost_on column

This patch adds a new "Lost on" column to the result table
Comment 6 Jonathan Druart 2017-10-13 18:04:13 UTC
Created attachment 68089 [details] [review]
Bug 9573: Lost items report - Add a new "Export selected items" link
Comment 7 Jonathan Druart 2017-10-13 18:04:16 UTC
Created attachment 68090 [details] [review]
Bug 9573: Lost items report - Add the CSV export ability

Finally we add the ability to export the list of lost items.
The items will be export in CSV format using a CSV profile defined.

Test plan:
0/ Apply all the patches from this patch set
1/ Define a CSV profile (type=SQL, Usage=Export lost items in report)
Try something like that to get the same columns as the default table:
Title=biblio.title
|Author=biblio.author
|Lost status=items.itemlost
|Lost on=items.itemlost_on
|Barcode=items.barcode
|Call number=items.itemcallnumber
|Date last seen=items.datelastseen
|Price=items.price
|Rep. price=items.replacementprice
|Library=items.homebranch
|item type=items.itype
|Current location=items.holdingbranch
|Location=items.location
|Not for loan status=items.notforloan
|Notes=items.itemnotes
2/ Use the filters and select items to export
3/ Export the list of items you want and make sure the CSV is correctly
formatted and contains the items you selected

QA Notes:
- I think we should add default CSV profiles for the different "usage",
but I would consider it as a separate enhancement since none of them is
defined yet
- Most of the code to export CSV is no reusable. We should make
Koha::Exporter::Record support CSV export for type=SQL (it only
supports MARC type so far).
Comment 8 Katrin Fischer 2017-10-14 21:56:34 UTC
The patch appears to break the list of checkouts in the patron account:

Error: Syntax error, unrecognized expression: ##issues-table
Comment 9 Jonathan Druart 2017-10-16 15:10:53 UTC
Created attachment 68184 [details] [review]
Bug 9573: (follow-up) Lost items report - add KohaTable to itemlost
Comment 10 Jonathan Druart 2017-10-16 15:11:40 UTC
(In reply to Katrin Fischer from comment #8)
> The patch appears to break the list of checkouts in the patron account:
> 
> Error: Syntax error, unrecognized expression: ##issues-table

Indeed, I git grepped on **/*.tt but there was an occurrence in a .js file. Thanks for the catch!
Comment 11 Séverine Queune 2017-10-18 20:09:55 UTC
Everyting work well (set csv profile, filter the list on notforloen ou itemlost, select items) until I try to export the selected items.
I always get this Software error :
Can't locate object method "new" via package "Text::CSV_XS" (perhaps you forgot to load "Text::CSV_XS"?) at /home/koha/src/reports/itemslost.pl line 68.
For help, please send mail to the webmaster ([no address given]), giving this error message and the time and date of the error.
Comment 12 Jonathan Druart 2017-10-18 22:50:04 UTC
Created attachment 68283 [details] [review]
Bug 9573: Add missing use statement
Comment 13 Jonathan Druart 2017-10-18 22:50:45 UTC
(In reply to Séverine Queune from comment #11)
> Everyting work well (set csv profile, filter the list on notforloen ou
> itemlost, select items) until I try to export the selected items.
> I always get this Software error :
> Can't locate object method "new" via package "Text::CSV_XS" (perhaps you
> forgot to load "Text::CSV_XS"?) at /home/koha/src/reports/itemslost.pl line
> 68.
> For help, please send mail to the webmaster ([no address given]), giving
> this error message and the time and date of the error.

I did not recreate with my perl version, but indeed there was a missing use statement.
Comment 14 Séverine Queune 2017-10-20 11:43:34 UTC
(In reply to Jonathan Druart from comment #13)
> (In reply to Séverine Queune from comment #11)
> > Everyting work well (set csv profile, filter the list on notforloen ou
> > itemlost, select items) until I try to export the selected items.
> > I always get this Software error :
> > Can't locate object method "new" via package "Text::CSV_XS" (perhaps you
> > forgot to load "Text::CSV_XS"?) at /home/koha/src/reports/itemslost.pl line
> > 68.
> > For help, please send mail to the webmaster ([no address given]), giving
> > this error message and the time and date of the error.
> 
> I did not recreate with my perl version, but indeed there was a missing use
> statement.

I first tried at home with my personal laptop when I had this message.

I just tried :
 - my professional computer + BULAC wired connexion : it works
 - my personal laptop + BULAC wifi for guests : it works

I'll try again tonight with home wifi + laptop and will sign the patch if everything is ok.
Comment 15 Katrin Fischer 2017-10-20 12:23:11 UTC
Maybe you are just missing a dependency on the one computer?
Comment 16 Katrin Fischer 2017-10-21 21:14:49 UTC
Is Text::CSV (0.01) listed on your about page?
Comment 17 Katrin Fischer 2017-10-21 21:28:18 UTC
Created attachment 68351 [details] [review]
Bug 9573: Lost items report - Add items.notforloan as a filter

This patch adds a new "Not for loan" status filter to the lost items
report.

Test plan:
0/ Apply all patches from this patch set
1/ Use the new "Not for loan" filter to search lost items
2/ The table result must be consistent and a new "Not for loan" column
should be there
3/ Confirm that you are able to hide/show this column with the column
settings tool.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 18 Katrin Fischer 2017-10-21 21:28:25 UTC
Created attachment 68352 [details] [review]
Bug 9573: Lost items report - Move filters code to a separate js file

For the next patches we will need to reuse what is already done on the
bibliographic record detail page. This patch moves the code to make it
reusable easily and avoid copy and paste.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 19 Katrin Fischer 2017-10-21 21:28:32 UTC
Created attachment 68353 [details] [review]
Bug 9573: Lost items report - add KohaTable to itemlost

Before this patch set, we used KohaTable to display a table with the
column visibility plugin, and an usual dataTable initialisation for the
filters.
For the lost items report table we will need both.
To do so we need to reorganize the code a bit

We cannot pass a selector but the id of the node which represents the
table. Indeed it is how works currently the filters (we may want to
improve that later)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 20 Katrin Fischer 2017-10-21 21:28:36 UTC
Created attachment 68354 [details] [review]
Bug 9573: Lost items report - Add a new itemlost_on column

This patch adds a new "Lost on" column to the result table

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 21 Katrin Fischer 2017-10-21 21:28:42 UTC
Created attachment 68355 [details] [review]
Bug 9573: Lost items report - Add a new "Export selected items" link

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 22 Katrin Fischer 2017-10-21 21:28:46 UTC
Created attachment 68356 [details] [review]
Bug 9573: Lost items report - Add the CSV export ability

Finally we add the ability to export the list of lost items.
The items will be export in CSV format using a CSV profile defined.

Test plan:
0/ Apply all the patches from this patch set
1/ Define a CSV profile (type=SQL, Usage=Export lost items in report)
Try something like that to get the same columns as the default table:
Title=biblio.title
|Author=biblio.author
|Lost status=items.itemlost
|Lost on=items.itemlost_on
|Barcode=items.barcode
|Call number=items.itemcallnumber
|Date last seen=items.datelastseen
|Price=items.price
|Rep. price=items.replacementprice
|Library=items.homebranch
|item type=items.itype
|Current location=items.holdingbranch
|Location=items.location
|Not for loan status=items.notforloan
|Notes=items.itemnotes
2/ Use the filters and select items to export
3/ Export the list of items you want and make sure the CSV is correctly
formatted and contains the items you selected

QA Notes:
- I think we should add default CSV profiles for the different "usage",
but I would consider it as a separate enhancement since none of them is
defined yet
- Most of the code to export CSV is no reusable. We should make
Koha::Exporter::Record support CSV export for type=SQL (it only
supports MARC type so far).

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 23 Katrin Fischer 2017-10-21 21:28:50 UTC
Created attachment 68357 [details] [review]
Bug 9573: (follow-up) Lost items report - add KohaTable to itemlost

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 24 Katrin Fischer 2017-10-21 21:28:54 UTC
Created attachment 68358 [details] [review]
Bug 9573: Add missing use statement

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 25 Katrin Fischer 2017-10-21 21:35:13 UTC
In my tests all works nicely now, I am filing a separate bug report for adding a sample CSV profile to make it a bit easier. Also, we already have one for claiming issues: bug 19507
Comment 26 Biblibre Sandboxes 2017-10-23 14:08:11 UTC
Patch tested with a sandbox, by Séverine QUEUNE <severine.queune@bulac.fr>
Comment 27 Biblibre Sandboxes 2017-10-23 14:09:35 UTC
Created attachment 68398 [details] [review]
Bug 9573: Lost items report - Add items.notforloan as a filter

This patch adds a new "Not for loan" status filter to the lost items
report.

Test plan:
0/ Apply all patches from this patch set
1/ Use the new "Not for loan" filter to search lost items
2/ The table result must be consistent and a new "Not for loan" column
should be there
3/ Confirm that you are able to hide/show this column with the column
settings tool.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 28 Biblibre Sandboxes 2017-10-23 14:09:38 UTC
Created attachment 68399 [details] [review]
Bug 9573: Lost items report - Move filters code to a separate js file

For the next patches we will need to reuse what is already done on the
bibliographic record detail page. This patch moves the code to make it
reusable easily and avoid copy and paste.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 29 Biblibre Sandboxes 2017-10-23 14:09:41 UTC
Created attachment 68400 [details] [review]
Bug 9573: Lost items report - add KohaTable to itemlost

Before this patch set, we used KohaTable to display a table with the
column visibility plugin, and an usual dataTable initialisation for the
filters.
For the lost items report table we will need both.
To do so we need to reorganize the code a bit

We cannot pass a selector but the id of the node which represents the
table. Indeed it is how works currently the filters (we may want to
improve that later)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 30 Biblibre Sandboxes 2017-10-23 14:09:44 UTC
Created attachment 68401 [details] [review]
Bug 9573: Lost items report - Add a new itemlost_on column

This patch adds a new "Lost on" column to the result table

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 31 Biblibre Sandboxes 2017-10-23 14:09:48 UTC
Created attachment 68402 [details] [review]
Bug 9573: Lost items report - Add a new "Export selected items" link

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 32 Biblibre Sandboxes 2017-10-23 14:09:59 UTC
Created attachment 68403 [details] [review]
Bug 9573: Lost items report - Add the CSV export ability

Finally we add the ability to export the list of lost items.
The items will be export in CSV format using a CSV profile defined.

Test plan:
0/ Apply all the patches from this patch set
1/ Define a CSV profile (type=SQL, Usage=Export lost items in report)
Try something like that to get the same columns as the default table:
Title=biblio.title
|Author=biblio.author
|Lost status=items.itemlost
|Lost on=items.itemlost_on
|Barcode=items.barcode
|Call number=items.itemcallnumber
|Date last seen=items.datelastseen
|Price=items.price
|Rep. price=items.replacementprice
|Library=items.homebranch
|item type=items.itype
|Current location=items.holdingbranch
|Location=items.location
|Not for loan status=items.notforloan
|Notes=items.itemnotes
2/ Use the filters and select items to export
3/ Export the list of items you want and make sure the CSV is correctly
formatted and contains the items you selected

QA Notes:
- I think we should add default CSV profiles for the different "usage",
but I would consider it as a separate enhancement since none of them is
defined yet
- Most of the code to export CSV is no reusable. We should make
Koha::Exporter::Record support CSV export for type=SQL (it only
supports MARC type so far).

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 33 Biblibre Sandboxes 2017-10-23 14:10:03 UTC
Created attachment 68404 [details] [review]
Bug 9573: (follow-up) Lost items report - add KohaTable to itemlost

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 34 Biblibre Sandboxes 2017-10-23 14:10:06 UTC
Created attachment 68405 [details] [review]
Bug 9573: Add missing use statement

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 35 Katrin Fischer 2018-02-07 07:35:24 UTC
Patches no longer apply, can you please rebase?

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 9573: Lost items report - Add items.notforloan as a filter
Applying: Bug 9573: Lost items report - Move filters code to a separate js file
Applying: Bug 9573: Lost items report - add KohaTable to itemlost
fatal: sha1 information is lacking or useless (koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt).
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 Bug 9573: Lost items report - add KohaTable to itemlost
The copy of the patch that failed is found in:
   /home/vagrant/kohaclone/.git/rebase-apply/patch
When you have resolved this problem run "git bz apply --continue".
If you would prefer to skip this patch, instead run "git bz apply --skip".
To restore the original branch and stop patching run "git bz apply --abort".
Patch left in /tmp/Bug-9573-Lost-items-report---add-KohaTable-to-item-M_2w8X.patc
Comment 36 Jonathan Druart 2018-02-07 14:26:46 UTC
Created attachment 71275 [details] [review]
Bug 9573: Lost items report - Add items.notforloan as a filter

This patch adds a new "Not for loan" status filter to the lost items
report.

Test plan:
0/ Apply all patches from this patch set
1/ Use the new "Not for loan" filter to search lost items
2/ The table result must be consistent and a new "Not for loan" column
should be there
3/ Confirm that you are able to hide/show this column with the column
settings tool.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 37 Jonathan Druart 2018-02-07 14:26:51 UTC
Created attachment 71276 [details] [review]
Bug 9573: Lost items report - Move filters code to a separate js file

For the next patches we will need to reuse what is already done on the
bibliographic record detail page. This patch moves the code to make it
reusable easily and avoid copy and paste.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 38 Jonathan Druart 2018-02-07 14:26:56 UTC
Created attachment 71277 [details] [review]
Bug 9573: Lost items report - add KohaTable to itemlost

Before this patch set, we used KohaTable to display a table with the
column visibility plugin, and an usual dataTable initialisation for the
filters.
For the lost items report table we will need both.
To do so we need to reorganize the code a bit

We cannot pass a selector but the id of the node which represents the
table. Indeed it is how works currently the filters (we may want to
improve that later)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 39 Jonathan Druart 2018-02-07 14:27:00 UTC
Created attachment 71278 [details] [review]
Bug 9573: Lost items report - Add a new itemlost_on column

This patch adds a new "Lost on" column to the result table

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 40 Jonathan Druart 2018-02-07 14:27:04 UTC
Created attachment 71279 [details] [review]
Bug 9573: Lost items report - Add a new "Export selected items" link

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 41 Jonathan Druart 2018-02-07 14:27:08 UTC
Created attachment 71280 [details] [review]
Bug 9573: Lost items report - Add the CSV export ability

Finally we add the ability to export the list of lost items.
The items will be export in CSV format using a CSV profile defined.

Test plan:
0/ Apply all the patches from this patch set
1/ Define a CSV profile (type=SQL, Usage=Export lost items in report)
Try something like that to get the same columns as the default table:
Title=biblio.title
|Author=biblio.author
|Lost status=items.itemlost
|Lost on=items.itemlost_on
|Barcode=items.barcode
|Call number=items.itemcallnumber
|Date last seen=items.datelastseen
|Price=items.price
|Rep. price=items.replacementprice
|Library=items.homebranch
|item type=items.itype
|Current location=items.holdingbranch
|Location=items.location
|Not for loan status=items.notforloan
|Notes=items.itemnotes
2/ Use the filters and select items to export
3/ Export the list of items you want and make sure the CSV is correctly
formatted and contains the items you selected

QA Notes:
- I think we should add default CSV profiles for the different "usage",
but I would consider it as a separate enhancement since none of them is
defined yet
- Most of the code to export CSV is no reusable. We should make
Koha::Exporter::Record support CSV export for type=SQL (it only
supports MARC type so far).

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 42 Jonathan Druart 2018-02-07 14:27:12 UTC
Created attachment 71281 [details] [review]
Bug 9573: (follow-up) Lost items report - add KohaTable to itemlost

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 43 Jonathan Druart 2018-02-07 14:27:16 UTC
Created attachment 71282 [details] [review]
Bug 9573: Add missing use statement

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 44 Katrin Fischer 2018-02-17 12:23:49 UTC
Hi Jonathan,

there are some conflicts about the new VERSION variable for .js files. I've tried to resolve those, but get tons of errors in the QA scripts. Can you please take a look? I will paste some examples below:


 FAIL	koha-tmpl/opac-tmpl/bootstrap/en-GB/modules/sco/help.tt
   FAIL	  forbidden patterns
		forbidden pattern: Include [% KOHA_VERSION %] in js paths (bug 12904) - May be false positive (line 13)

 FAIL	koha-tmpl/opac-tmpl/bootstrap/en-GB/modules/opac-user.tt
   FAIL	  forbidden patterns
		forbidden pattern: Contains old bootstrap style for buttons (see bug 16239) (line 742)
		forbidden pattern: Contains old bootstrap style for buttons (see bug 16239) (line 719)
		forbidden pattern: Contains old bootstrap style for buttons (see bug 16239) (line 862)
		forbidden pattern: Contains old bootstrap style for buttons (see bug 16239) (line 46)
   OK	  git manipulation
   FAIL	  spelling
		 transfered  ==> transferred

   FAIL	  valid
			(Missing operator before shelfbrowser?)
		String found where operator expected 
		syntax error 
			(Missing operator before  'shelfbrowser.inc'?)
		koha-tmpl/opac-tmpl/bootstrap/en-GB/modules/svc/shelfbrowser.tt had compilation errors.
		Bareword found where operator expected 
		Unquoted string "shelfbrowser" may clash with future reserved word 

 FAIL	koha-tmpl/opac-tmpl/bootstrap/en-GB/modules/svc/suggestion.tt
   FAIL	  critic
		Code before strictures are enabled at line 1, column 1. See page 429 of PBP.
   OK	  forbidden patterns
   OK	  git manipulation
   OK	  pod
   OK	  spelling
   FAIL	  valid
		Bareword found where operator expected 
			(Missing operator before  'doc-head-open.inc'?)
			(Missing operator before  'doc-head-close.inc'?)
		koha-tmpl/opac-tmpl/bootstrap/en-GB/modules/svc/suggestion.tt had compilation errors.
		Unquoted string "render" may clash with future reserved word 
			(Missing semicolon on previous line?)
			(Missing operator before suggestion?)
			(Missing operator before divider?)
		syntax error 
		Unquoted string "label" may clash with future reserved word 
			(Missing operator before Koha?)
			(Missing operator before jsinclude?)
		Unquoted string "html" may clash with future reserved word 
			(Missing operator before  'opac-bottom.inc'?)
		Unknown regexp modifier "/v" 
		Unquoted string "divider" may clash with future reserved word 
		String found where operator expected 
		Unquoted string "opac" may clash with future reserved word 
		Unknown regexp modifier "/n" 
		Unquoted string "jsinclude" may clash with future reserved word 
		Unquoted string "suggestions" may clash with future reserved word 
		Unquoted string "cssinclude" may clash with future reserved word 
		Unquoted string "koha" may clash with future reserved word 
		Unquoted string "title" may clash with future reserved word 
			(Missing operator before cssinclude?)
		Unquoted string "pl" may clash with future reserved word
Comment 45 Jonathan Druart 2018-02-17 14:49:29 UTC
Created attachment 71872 [details] [review]
Bug 9573: Lost items report - Add items.notforloan as a filter

This patch adds a new "Not for loan" status filter to the lost items
report.

Test plan:
0/ Apply all patches from this patch set
1/ Use the new "Not for loan" filter to search lost items
2/ The table result must be consistent and a new "Not for loan" column
should be there
3/ Confirm that you are able to hide/show this column with the column
settings tool.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 46 Jonathan Druart 2018-02-17 14:49:36 UTC
Created attachment 71873 [details] [review]
Bug 9573: Lost items report - Move filters code to a separate js file

For the next patches we will need to reuse what is already done on the
bibliographic record detail page. This patch moves the code to make it
reusable easily and avoid copy and paste.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 47 Jonathan Druart 2018-02-17 14:49:41 UTC
Created attachment 71874 [details] [review]
Bug 9573: Lost items report - add KohaTable to itemlost

Before this patch set, we used KohaTable to display a table with the
column visibility plugin, and an usual dataTable initialisation for the
filters.
For the lost items report table we will need both.
To do so we need to reorganize the code a bit

We cannot pass a selector but the id of the node which represents the
table. Indeed it is how works currently the filters (we may want to
improve that later)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 48 Jonathan Druart 2018-02-17 14:49:45 UTC
Created attachment 71875 [details] [review]
Bug 9573: Lost items report - Add a new itemlost_on column

This patch adds a new "Lost on" column to the result table

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 49 Jonathan Druart 2018-02-17 14:49:50 UTC
Created attachment 71876 [details] [review]
Bug 9573: Lost items report - Add a new "Export selected items" link

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 50 Jonathan Druart 2018-02-17 14:49:54 UTC
Created attachment 71877 [details] [review]
Bug 9573: Lost items report - Add the CSV export ability

Finally we add the ability to export the list of lost items.
The items will be export in CSV format using a CSV profile defined.

Test plan:
0/ Apply all the patches from this patch set
1/ Define a CSV profile (type=SQL, Usage=Export lost items in report)
Try something like that to get the same columns as the default table:
Title=biblio.title
|Author=biblio.author
|Lost status=items.itemlost
|Lost on=items.itemlost_on
|Barcode=items.barcode
|Call number=items.itemcallnumber
|Date last seen=items.datelastseen
|Price=items.price
|Rep. price=items.replacementprice
|Library=items.homebranch
|item type=items.itype
|Current location=items.holdingbranch
|Location=items.location
|Not for loan status=items.notforloan
|Notes=items.itemnotes
2/ Use the filters and select items to export
3/ Export the list of items you want and make sure the CSV is correctly
formatted and contains the items you selected

QA Notes:
- I think we should add default CSV profiles for the different "usage",
but I would consider it as a separate enhancement since none of them is
defined yet
- Most of the code to export CSV is no reusable. We should make
Koha::Exporter::Record support CSV export for type=SQL (it only
supports MARC type so far).

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 51 Jonathan Druart 2018-02-17 14:49:58 UTC
Created attachment 71878 [details] [review]
Bug 9573: (follow-up) Lost items report - add KohaTable to itemlost

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 52 Jonathan Druart 2018-02-17 14:50:03 UTC
Created attachment 71879 [details] [review]
Bug 9573: Add missing use statement

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 53 Jonathan Druart 2018-02-17 14:50:07 UTC
Created attachment 71880 [details] [review]
Bug 9573: Add missing KOHA_VERSION in js paths
Comment 54 Jonathan Druart 2018-02-17 14:51:14 UTC
Katrin,
You should double check your branch, you get errors on gb-GB files, they are not supposed to be committed (and so checked by the tests).
I have rebased and added a patch to add the KOHA_VERSION part.
Comment 55 Katrin Fischer 2018-02-17 15:25:02 UTC
Argh, you are right... I had installed those and forgot to clean up. Will retest.
Comment 56 Katrin Fischer 2018-02-17 16:17:37 UTC
Much better, but one error remains:

 FAIL	koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt
   OK	  forbidden patterns
   OK	  git manipulation
   OK	  spelling
   OK	  tt_valid
   FAIL	  valid_template
		options_for_libraries: not found

Maybe accidental removal of the include line? Will continue testing later.
Comment 57 Katrin Fischer 2018-02-17 17:33:16 UTC
Created attachment 71887 [details] [review]
Bug 9573: Lost items report - Move filters code to a separate js file

For the next patches we will need to reuse what is already done on the
bibliographic record detail page. This patch moves the code to make it
reusable easily and avoid copy and paste.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 58 Katrin Fischer 2018-02-17 17:33:22 UTC
Created attachment 71888 [details] [review]
Bug 9573: Lost items report - add KohaTable to itemlost

Before this patch set, we used KohaTable to display a table with the
column visibility plugin, and an usual dataTable initialisation for the
filters.
For the lost items report table we will need both.
To do so we need to reorganize the code a bit

We cannot pass a selector but the id of the node which represents the
table. Indeed it is how works currently the filters (we may want to
improve that later)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 59 Katrin Fischer 2018-02-17 17:33:27 UTC
Created attachment 71889 [details] [review]
Bug 9573: Lost items report - Add a new itemlost_on column

This patch adds a new "Lost on" column to the result table

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 60 Katrin Fischer 2018-02-17 17:33:32 UTC
Created attachment 71890 [details] [review]
Bug 9573: Lost items report - Add a new "Export selected items" link

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 61 Katrin Fischer 2018-02-17 17:33:37 UTC
Created attachment 71891 [details] [review]
Bug 9573: Lost items report - Add the CSV export ability

Finally we add the ability to export the list of lost items.
The items will be export in CSV format using a CSV profile defined.

Test plan:
0/ Apply all the patches from this patch set
1/ Define a CSV profile (type=SQL, Usage=Export lost items in report)
Try something like that to get the same columns as the default table:
Title=biblio.title
|Author=biblio.author
|Lost status=items.itemlost
|Lost on=items.itemlost_on
|Barcode=items.barcode
|Call number=items.itemcallnumber
|Date last seen=items.datelastseen
|Price=items.price
|Rep. price=items.replacementprice
|Library=items.homebranch
|item type=items.itype
|Current location=items.holdingbranch
|Location=items.location
|Not for loan status=items.notforloan
|Notes=items.itemnotes
2/ Use the filters and select items to export
3/ Export the list of items you want and make sure the CSV is correctly
formatted and contains the items you selected

QA Notes:
- I think we should add default CSV profiles for the different "usage",
but I would consider it as a separate enhancement since none of them is
defined yet
- Most of the code to export CSV is no reusable. We should make
Koha::Exporter::Record support CSV export for type=SQL (it only
supports MARC type so far).

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 62 Katrin Fischer 2018-02-17 17:33:42 UTC
Created attachment 71892 [details] [review]
Bug 9573: (follow-up) Lost items report - add KohaTable to itemlost

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 63 Katrin Fischer 2018-02-17 17:33:46 UTC
Created attachment 71893 [details] [review]
Bug 9573: Add missing use statement

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 64 Katrin Fischer 2018-02-17 17:33:51 UTC
Created attachment 71894 [details] [review]
Bug 9573: Add missing KOHA_VERSION in js paths

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 65 Katrin Fischer 2018-02-17 17:33:56 UTC
Created attachment 71895 [details] [review]
Bug 9573: (QA follow-up) Add missing include back

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 66 Katrin Fischer 2018-02-17 17:35:30 UTC
I realized (while testing) that I did the original sign-off here. But as we have a second sign-off I hope the RM will be happy to have me QA as well.
Comment 67 Jonathan Druart 2018-02-17 21:51:04 UTC
Pushed to master for 18.05, thanks to everybody involved!