Bug 20563

Summary: ILL request list gives no indication of source and/or target
Product: Koha Reporter: Andrew Isherwood <bugzilla>
Component: ILLAssignee: Andrew Isherwood <bugzilla>
Status: CLOSED FIXED QA Contact: Josef Moravec <josef.moravec>
Severity: enhancement    
Priority: P5 - low CC: chloe.hofstede, cslone, joe.mcglynn, josef.moravec, magnus, martin.renvoize, maura.stephens, niamh.walker-headon, nick, paul.thornton
Version: master   
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:
Bug Depends on: 18837    
Bug Blocks: 18589, 25944    
Attachments: Bug [20563] - [ILL request list gives no indication of source and/or target]
Bug 20563: Allow display of requested partners
Bug 20563: Allow display of requested partners
Bug 20563: Allow display of requested partners
Bug 20563: Allow display of requested partners
Bug 20563: (follow-up) Add unit test
Bug 20563: (follow-up) Fix requested partners
Bug 20563: Allow display of requested partners
Bug 20563: (follow-up) Add unit test
Bug 20563: Allow display of requested partners
Bug 20563: (follow-up) Add unit test
Bug 20563: (follow-up) Fix rebasing bug
Bug 20563: Allow display of requested partners
Bug 20563: (follow-up) Add unit test
Bug 20563: (follow-up) Fix rebasing bug
Bug 20563: Allow display of requested partners
Bug 20563: (follow-up) Add unit test
Bug 20563: (follow-up) Fix rebasing bug
Bug 20563: Allow display of requested partners
Bug 20563: (follow-up) Add unit test
Bug 20563: (follow-up) Fix rebasing bug
Bug 20563: Allow display of requested partners
Bug 20563: (QA follow-up) Fix number of tests in api/v1/illrequests.t
Bug 20563: (QA follow-up) Get requested_partners from api

Description Andrew Isherwood 2018-04-11 13:30:43 UTC
Currently when viewing a list of ILL requests in staff view there is no indication of with whom the request was placed. What will be displayed here will depend upon the backend on which the request was placed. For example, with BLDSS the displayed string will simply be BLDSS, whereas with FreeForm some indication of the partner library would be required.
Comment 1 Andrew Isherwood 2018-04-13 10:17:02 UTC Comment hidden (obsolete)
Comment 2 Andrew Isherwood 2018-04-13 10:35:23 UTC Comment hidden (obsolete)
Comment 3 Magnus Enger 2018-05-15 13:12:41 UTC
I try to follow the test plan, but run into an Internal Server Error. I di the following: 

- Create a new request with FreeForm
- Click on "Place request with partners"
- Select a partner library and click on "Send email"
- Get an "Internal Server Error" 

The Plack error log shows this:

Can't call method "isa" on unblessed reference at /home/vagrant/kohaclone/ill/ill-requests.pl line 203.

Any idea what might be going on there?
Comment 4 Andrew Isherwood 2018-05-30 11:31:27 UTC
Created attachment 75657 [details] [review]
Bug 20563: Allow display of requested partners

This patch adds the display of requested partner email addresses when an
ILL backend provides the ability to send requests to partners. Partner
email addresses are displayed in the illlist and illview displays, they
are also included in the 'illrequests' API response.

* api/v1/swagger/paths/illrequests.json:
  - Add 'requested_partners' as an 'embed' enum
* Koha/Illrequest.pm:
  - Add 'requested_partners' accessor calling optional backend 'get_requested_partners' method.
  - Store requested partners upon email send, calling optional backend 'set_requested_partners' method.
  - Add 'requested_parners' embed to overloaded TO_JSON method.
* koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt:
  - Add 'requested_partners' embed to illrequests API call
  - Add render function for "Additional status" datatables column
  - Add display of requested partner email addresses to illlist table
  - Add display of requested partner email addresses to illview display

To test:
1) Enable Interlibrary loans
2) Add a backend that supports sending requests to partners, e.g.
FreeForm
3) Set up at least one partner
4) Create an ILL request
5) Send request to partner(s)
6) Observe partner(s) email address(es) are displayed in "View ILL
requests" view
7) Observe partner(s) email address(es) are displayed in "Manage ILL
request" view
Comment 5 Andrew Isherwood 2018-05-30 11:32:33 UTC
Hi Magnus

Thanks for this. I've modified the way the error handling is done when a request to partner fails, this should hopefully at least give you some indication as to why the request is failing. Let me know how it goes.
Comment 6 PTFS Europe Sandboxes 2018-09-27 15:02:22 UTC
Created attachment 79523 [details] [review]
Bug 20563: Allow display of requested partners

This patch adds the display of requested partner email addresses when an
ILL backend provides the ability to send requests to partners. Partner
email addresses are displayed in the illlist and illview displays, they
are also included in the 'illrequests' API response.

* api/v1/swagger/paths/illrequests.json:
  - Add 'requested_partners' as an 'embed' enum
* Koha/Illrequest.pm:
  - Add 'requested_partners' accessor calling optional backend 'get_requested_partners' method.
  - Store requested partners upon email send, calling optional backend 'set_requested_partners' method.
  - Add 'requested_parners' embed to overloaded TO_JSON method.
* koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt:
  - Add 'requested_partners' embed to illrequests API call
  - Add render function for "Additional status" datatables column
  - Add display of requested partner email addresses to illlist table
  - Add display of requested partner email addresses to illview display

To test:
1) Enable Interlibrary loans
2) Add a backend that supports sending requests to partners, e.g.
FreeForm
3) Set up at least one partner
4) Create an ILL request
5) Send request to partner(s)
6) Observe partner(s) email address(es) are displayed in "View ILL
requests" view
7) Observe partner(s) email address(es) are displayed in "Manage ILL
request" view

Signed-off-by: mmg@interleaf.ie
Comment 7 Andrew Isherwood 2018-10-01 13:40:06 UTC
Created attachment 79715 [details] [review]
Bug 20563: Allow display of requested partners

This patch adds the display of requested partner email addresses when an
ILL backend provides the ability to send requests to partners. Partner
email addresses are displayed in the illlist and illview displays, they
are also included in the 'illrequests' API response.

* api/v1/swagger/paths/illrequests.json:
  - Add 'requested_partners' as an 'embed' enum
* Koha/Illrequest.pm:
  - Add 'requested_partners' accessor calling optional backend 'get_requested_partners' method.
  - Store requested partners upon email send, calling optional backend 'set_requested_partners' method.
  - Add 'requested_parners' embed to overloaded TO_JSON method.
* koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt:
  - Add 'requested_partners' embed to illrequests API call
  - Add render function for "Additional status" datatables column
  - Add display of requested partner email addresses to illlist table
  - Add display of requested partner email addresses to illview display

To test:
1) Enable Interlibrary loans
2) Add a backend that supports sending requests to partners, e.g.
FreeForm
3) Set up at least one partner
4) Create an ILL request
5) Send request to partner(s)
6) Observe partner(s) email address(es) are displayed in "View ILL
requests" view
7) Observe partner(s) email address(es) are displayed in "Manage ILL
request" view

Signed-off-by: mmg@interleaf.ie

https://bugs.koha-community.org/show_bug.cgi?id=20653
Comment 8 Andrew Isherwood 2018-10-01 13:40:28 UTC
Rebased and fixed merge conflict
Comment 9 Andrew Isherwood 2018-10-01 14:06:27 UTC
Created attachment 79716 [details] [review]
Bug 20563: (follow-up) Add unit test

This unit test tests the fetching of the requested_partners embed, if
specified.
Comment 10 Josef Moravec 2018-10-12 13:06:29 UTC
Comment on attachment 79715 [details] [review]
Bug 20563: Allow display of requested partners

Review of attachment 79715 [details] [review]:
-----------------------------------------------------------------

::: Koha/Illrequest.pm
@@ +994,5 @@
> +=head3 requested_partners
> +
> +    my $partners_string = $illRequest->requested_partners;
> +
> +Return the string representing the email addresses of the parters to

typo "parters" ;)

::: koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt
@@ +165,5 @@
> +                row.hasOwnProperty('requested_partners') &&
> +                row.requested_partners &&
> +                row.requested_partners.length > 0
> +            ) ?
> +                "Requested from:<br>" +

This is not translatable

@@ +200,5 @@
>              },
> +            additional_status: {
> +                name: _("Additional status"),
> +                func: createAdditional
> +            },

Why do you create new column for this? It duplicates the information that status is "Requested", You can as well add the partners to the normal status column IMHO.

@@ +547,5 @@
>                                  <div class="status">
>                                      <span class="label status">Status:</span>
>                                      [% request.capabilities.$req_status.name | html %]
> +                                    [% IF request.requested_partners.length > 0 %]
> +                                        ([% request.requested_partners %])

there is missing filter
Comment 11 Josef Moravec 2018-10-12 13:06:57 UTC
Sorry to fail it again
Comment 12 Andrew Isherwood 2018-10-15 14:21:32 UTC
Created attachment 80603 [details] [review]
Bug 20563: (follow-up) Fix requested partners

As per:
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20563#c10

Thanks for the suggestion on merging the "Status" and "Additional status" columns, looks much better!
Comment 13 Andrew Isherwood 2018-11-09 12:23:19 UTC
Comment on attachment 79716 [details] [review]
Bug 20563: (follow-up) Add unit test

Obsoleted by dependency tree rebase
Comment 14 Andrew Isherwood 2018-11-09 14:04:11 UTC
Comment on attachment 79715 [details] [review]
Bug 20563: Allow display of requested partners

Obsoleted by rebase on dependency tree
Comment 15 Andrew Isherwood 2018-11-09 14:04:28 UTC
Comment on attachment 80603 [details] [review]
Bug 20563: (follow-up) Fix requested partners

Obsoleted by rebase on dependency tree
Comment 16 Andrew Isherwood 2018-11-09 14:06:21 UTC
Created attachment 82166 [details] [review]
Bug 20563: Allow display of requested partners

This patch adds the display of requested partner email addresses when an
ILL backend provides the ability to send requests to partners. Partner
email addresses are displayed in the illlist and illview displays, they
are also included in the 'illrequests' API response.

* api/v1/swagger/paths/illrequests.json:
  - Add 'requested_partners' as an 'embed' enum
* Koha/Illrequest.pm:
  - Add 'requested_partners' accessor calling optional backend 'get_requested_partners' method.
  - Store requested partners upon email send, calling optional backend 'set_requested_partners' method.
  - Add 'requested_parners' embed to overloaded TO_JSON method.
* koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt:
  - Add 'requested_partners' embed to illrequests API call
  - Add render function for "Additional status" datatables column
  - Add display of requested partner email addresses to illlist table
  - Add display of requested partner email addresses to illview display

To test:
1) Enable Interlibrary loans
2) Add a backend that supports sending requests to partners, e.g.
FreeForm
3) Set up at least one partner
4) Create an ILL request
5) Send request to partner(s)
6) Observe partner(s) email address(es) are displayed in "View ILL
requests" view
7) Observe partner(s) email address(es) are displayed in "Manage ILL
request" view

Signed-off-by: mmg@interleaf.ie

https://bugs.koha-community.org/show_bug.cgi?id=20653

Bug 20563: (follow-up) Fix requested partners

As per:
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20563#c10

Thanks for the suggestion on merging the "Status" and "Additional status" columns, looks much better!
Comment 17 Andrew Isherwood 2018-11-09 14:06:25 UTC
Created attachment 82167 [details] [review]
Bug 20563: (follow-up) Add unit test

Test that requested partners are returned in API response when requested
Comment 18 Andrew Isherwood 2018-11-19 14:56:36 UTC
Created attachment 82511 [details] [review]
Bug 20563: Allow display of requested partners

This patch adds the display of requested partner email addresses when an
ILL backend provides the ability to send requests to partners. Partner
email addresses are displayed in the illlist and illview displays, they
are also included in the 'illrequests' API response.

* api/v1/swagger/paths/illrequests.json:
  - Add 'requested_partners' as an 'embed' enum
* Koha/Illrequest.pm:
  - Add 'requested_partners' accessor calling optional backend 'get_requested_partners' method.
  - Store requested partners upon email send, calling optional backend 'set_requested_partners' method.
  - Add 'requested_parners' embed to overloaded TO_JSON method.
* koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt:
  - Add 'requested_partners' embed to illrequests API call
  - Add render function for "Additional status" datatables column
  - Add display of requested partner email addresses to illlist table
  - Add display of requested partner email addresses to illview display

To test:
1) Enable Interlibrary loans
2) Add a backend that supports sending requests to partners, e.g.
FreeForm
3) Set up at least one partner
4) Create an ILL request
5) Send request to partner(s)
6) Observe partner(s) email address(es) are displayed in "View ILL
requests" view
7) Observe partner(s) email address(es) are displayed in "Manage ILL
request" view

Signed-off-by: mmg@interleaf.ie

https://bugs.koha-community.org/show_bug.cgi?id=20653

Bug 20563: (follow-up) Fix requested partners

As per:
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20563#c10

Thanks for the suggestion on merging the "Status" and "Additional status" columns, looks much better!
Comment 19 Andrew Isherwood 2018-11-19 14:56:40 UTC
Created attachment 82512 [details] [review]
Bug 20563: (follow-up) Add unit test

Test that requested partners are returned in API response when requested
Comment 20 Andrew Isherwood 2018-11-29 12:27:23 UTC
Created attachment 82734 [details] [review]
Bug 20563: (follow-up) Fix rebasing bug

Fix erroneous curly brackets
Comment 21 Andrew Isherwood 2019-02-04 12:15:39 UTC
Created attachment 84695 [details] [review]
Bug 20563: Allow display of requested partners

This patch adds the display of requested partner email addresses when an
ILL backend provides the ability to send requests to partners. Partner
email addresses are displayed in the illlist and illview displays, they
are also included in the 'illrequests' API response.

* api/v1/swagger/paths/illrequests.json:
  - Add 'requested_partners' as an 'embed' enum
* Koha/Illrequest.pm:
  - Add 'requested_partners' accessor calling optional backend 'get_requested_partners' method.
  - Store requested partners upon email send, calling optional backend 'set_requested_partners' method.
  - Add 'requested_parners' embed to overloaded TO_JSON method.
* koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt:
  - Add 'requested_partners' embed to illrequests API call
  - Add render function for "Additional status" datatables column
  - Add display of requested partner email addresses to illlist table
  - Add display of requested partner email addresses to illview display

To test:
1) Enable Interlibrary loans
2) Add a backend that supports sending requests to partners, e.g.
FreeForm
3) Set up at least one partner
4) Create an ILL request
5) Send request to partner(s)
6) Observe partner(s) email address(es) are displayed in "View ILL
requests" view
7) Observe partner(s) email address(es) are displayed in "Manage ILL
request" view

Signed-off-by: mmg@interleaf.ie

https://bugs.koha-community.org/show_bug.cgi?id=20653

Bug 20563: (follow-up) Fix requested partners

As per:
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20563#c10

Thanks for the suggestion on merging the "Status" and "Additional status" columns, looks much better!
Comment 22 Andrew Isherwood 2019-02-04 12:29:00 UTC
Created attachment 84696 [details] [review]
Bug 20563: (follow-up) Add unit test

Test that requested partners are returned in API response when requested
Comment 23 Andrew Isherwood 2019-02-04 12:29:03 UTC
Created attachment 84697 [details] [review]
Bug 20563: (follow-up) Fix rebasing bug

Fix erroneous curly brackets
Comment 24 Andrew Isherwood 2019-02-04 12:29:07 UTC
Created attachment 84698 [details] [review]
Bug 20563: Allow display of requested partners

This patch adds the display of requested partner email addresses when an
ILL backend provides the ability to send requests to partners. Partner
email addresses are displayed in the illlist and illview displays, they
are also included in the 'illrequests' API response.

* api/v1/swagger/paths/illrequests.json:
  - Add 'requested_partners' as an 'embed' enum
* Koha/Illrequest.pm:
  - Add 'requested_partners' accessor calling optional backend 'get_requested_partners' method.
  - Store requested partners upon email send, calling optional backend 'set_requested_partners' method.
  - Add 'requested_parners' embed to overloaded TO_JSON method.
* koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt:
  - Add 'requested_partners' embed to illrequests API call
  - Add render function for "Additional status" datatables column
  - Add display of requested partner email addresses to illlist table
  - Add display of requested partner email addresses to illview display

To test:
1) Enable Interlibrary loans
2) Add a backend that supports sending requests to partners, e.g.
FreeForm
3) Set up at least one partner
4) Create an ILL request
5) Send request to partner(s)
6) Observe partner(s) email address(es) are displayed in "View ILL
requests" view
7) Observe partner(s) email address(es) are displayed in "Manage ILL
request" view

Signed-off-by: mmg@interleaf.ie

https://bugs.koha-community.org/show_bug.cgi?id=20653

Bug 20563: (follow-up) Fix requested partners

As per:
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20563#c10

Thanks for the suggestion on merging the "Status" and "Additional status" columns, looks much better!
Comment 25 Andrew Isherwood 2019-03-08 11:43:41 UTC
Created attachment 86376 [details] [review]
Bug 20563: (follow-up) Add unit test

Test that requested partners are returned in API response when requested
Comment 26 Andrew Isherwood 2019-03-08 11:43:44 UTC
Created attachment 86377 [details] [review]
Bug 20563: (follow-up) Fix rebasing bug

Fix erroneous curly brackets
Comment 27 Andrew Isherwood 2019-03-08 11:43:47 UTC
Created attachment 86378 [details] [review]
Bug 20563: Allow display of requested partners

This patch adds the display of requested partner email addresses when an
ILL backend provides the ability to send requests to partners. Partner
email addresses are displayed in the illlist and illview displays, they
are also included in the 'illrequests' API response.

* api/v1/swagger/paths/illrequests.json:
  - Add 'requested_partners' as an 'embed' enum
* Koha/Illrequest.pm:
  - Add 'requested_partners' accessor calling optional backend 'get_requested_partners' method.
  - Store requested partners upon email send, calling optional backend 'set_requested_partners' method.
  - Add 'requested_parners' embed to overloaded TO_JSON method.
* koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt:
  - Add 'requested_partners' embed to illrequests API call
  - Add render function for "Additional status" datatables column
  - Add display of requested partner email addresses to illlist table
  - Add display of requested partner email addresses to illview display

To test:
1) Enable Interlibrary loans
2) Add a backend that supports sending requests to partners, e.g.
FreeForm
3) Set up at least one partner
4) Create an ILL request
5) Send request to partner(s)
6) Observe partner(s) email address(es) are displayed in "View ILL
requests" view
7) Observe partner(s) email address(es) are displayed in "Manage ILL
request" view

Signed-off-by: mmg@interleaf.ie

https://bugs.koha-community.org/show_bug.cgi?id=20653

Bug 20563: (follow-up) Fix requested partners

As per:
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20563#c10

Thanks for the suggestion on merging the "Status" and "Additional status" columns, looks much better!
Comment 28 Josef Moravec 2019-03-11 08:49:53 UTC
Created attachment 86427 [details] [review]
Bug 20563: (follow-up) Add unit test

Test that requested partners are returned in API response when requested

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 29 Josef Moravec 2019-03-11 08:49:56 UTC
Created attachment 86428 [details] [review]
Bug 20563: (follow-up) Fix rebasing bug

Fix erroneous curly brackets

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 30 Josef Moravec 2019-03-11 08:50:00 UTC
Created attachment 86429 [details] [review]
Bug 20563: Allow display of requested partners

This patch adds the display of requested partner email addresses when an
ILL backend provides the ability to send requests to partners. Partner
email addresses are displayed in the illlist and illview displays, they
are also included in the 'illrequests' API response.

* api/v1/swagger/paths/illrequests.json:
  - Add 'requested_partners' as an 'embed' enum
* Koha/Illrequest.pm:
  - Add 'requested_partners' accessor calling optional backend 'get_requested_partners' method.
  - Store requested partners upon email send, calling optional backend 'set_requested_partners' method.
  - Add 'requested_parners' embed to overloaded TO_JSON method.
* koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt:
  - Add 'requested_partners' embed to illrequests API call
  - Add render function for "Additional status" datatables column
  - Add display of requested partner email addresses to illlist table
  - Add display of requested partner email addresses to illview display

To test:
1) Enable Interlibrary loans
2) Add a backend that supports sending requests to partners, e.g.
FreeForm
3) Set up at least one partner
4) Create an ILL request
5) Send request to partner(s)
6) Observe partner(s) email address(es) are displayed in "View ILL
requests" view
7) Observe partner(s) email address(es) are displayed in "Manage ILL
request" view

Signed-off-by: mmg@interleaf.ie

https://bugs.koha-community.org/show_bug.cgi?id=20653

Bug 20563: (follow-up) Fix requested partners

As per:
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20563#c10

Thanks for the suggestion on merging the "Status" and "Additional status" columns, looks much better!

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 31 Josef Moravec 2019-03-11 08:50:04 UTC
Created attachment 86430 [details] [review]
Bug 20563: (QA follow-up) Fix number of tests in api/v1/illrequests.t

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 32 Josef Moravec 2019-03-11 08:50:08 UTC
Created attachment 86431 [details] [review]
Bug 20563: (QA follow-up) Get requested_partners from api

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Comment 33 Nick Clemens 2019-03-15 19:57:29 UTC
Awesome work all!

Pushed to master for 19.05
Comment 34 Martin Renvoize 2019-03-19 10:46:05 UTC
Enhancement, will not be backported to 18.11.x series.