Bug 29571

Summary: Mainpage : "All libraries" pending suggestions are visible only if the current library has suggestions
Product: Koha Reporter: Christophe TORIN <christophe.torin>
Component: TemplatesAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: a.roussos, andrew, david, fridolin.somers, jonathan.druart, kyle, lucas, nugged, victor
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
This fixes the display of pending suggestions in the staff interface so that it now shows pending suggestions for all libraries, for example: "Suggestions pending approval: Centerville: 0 / All libraries: 1.". Previously suggestions pending approval was only shown if there were suggestions for the user's current library.
Version(s) released in:
22.05.00,21.11.02,21.05.08
Circulation function:
Bug Depends on: 25033    
Bug Blocks:    
Attachments: Bug 29571: Display all pending suggestions even if none from logged in library
Bug 29571: Display all pending suggestions even if none from logged in library
Bug 29571: Display all pending suggestions even if none from logged in library
Bug 29571: Display all pending suggestions even if none from logged in library
Bug 29571: (follow-up) Fix display of pending suggestions in acqui-home.tt
Bug 29571: (follow-up) Fix display of pending suggestions in acqui-home.tt
Bug 29571: Display all pending suggestions even if none from logged in library
Bug 29571: (follow-up) Fix display of pending suggestions in acqui-home.tt

Description Christophe TORIN 2021-11-24 16:13:57 UTC
On the mainpage, the "Suggestions pending approval" block is shown only if there are suggestions for the user's current library, even if the other library have suggestions.


Example with 3 libraries : , LIB_A (3 suggestions), LIB_B (1 sugg.), LIB_C (0 sugg.)

LIB_A will show "Suggestions pending approval: LIB_A: 3 / All Libraries: 4"
LIB_B will show "Suggestions pending approval: LIB_B: 1 / All Libraries: 4"
LIB_C will show nothing.


If this is to be fixed, it would be simple, in the template intranet-main.tt on line 178 : The condition on "pendingsuggestions" will return false if it's equal to 0, thus hiding the whole block, even if the field "all_pendingsuggestions" is set and above 0.


This was seen on koha 20.11, but I checked and is still on master.
Comment 1 Jonathan Druart 2021-11-25 13:07:46 UTC
Created attachment 128010 [details] [review]
Bug 29571: Display all pending suggestions even if none from logged in library

The number of pending suggestions was only displayed if there are pending
suggestions at the logged in library.

Test plan:
Login at CPL
Create a suggestion (ASKED) for another library
=> Without this patch there is nothing on the mainpage
=> With this patch applied you will see info about pending suggestions:

"Suggestions pending approval: Centerville: 0 / All libraries: 1"
Comment 2 David Nind 2021-11-28 18:39:48 UTC
Created attachment 128060 [details] [review]
Bug 29571: Display all pending suggestions even if none from logged in library

The number of pending suggestions was only displayed if there are pending
suggestions at the logged in library.

Test plan:
Login at CPL
Create a suggestion (ASKED) for another library
=> Without this patch there is nothing on the mainpage
=> With this patch applied you will see info about pending suggestions:

"Suggestions pending approval: Centerville: 0 / All libraries: 1"

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Thibaud Guillot (thibaud_g) 2021-12-06 10:27:37 UTC
Created attachment 128271 [details] [review]
Bug 29571: Display all pending suggestions even if none from logged in library

The number of pending suggestions was only displayed if there are pending
suggestions at the logged in library.

Test plan:
Login at CPL
Create a suggestion (ASKED) for another library
=> Without this patch there is nothing on the mainpage
=> With this patch applied you will see info about pending suggestions:

"Suggestions pending approval: Centerville: 0 / All libraries: 1"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: ThibaudGLT <thibaud.guillot@biblibre.com>
Comment 4 Lucas Gass (lukeg) 2021-12-06 16:06:53 UTC
*** Bug 29628 has been marked as a duplicate of this bug. ***
Comment 5 Andreas Roussos 2021-12-10 14:41:34 UTC
Created attachment 128399 [details] [review]
Bug 29571: Display all pending suggestions even if none from logged in library

The number of pending suggestions was only displayed if there are pending
suggestions at the logged in library.

Test plan:
Login at CPL
Create a suggestion (ASKED) for another library
=> Without this patch there is nothing on the mainpage
=> With this patch applied you will see info about pending suggestions:

"Suggestions pending approval: Centerville: 0 / All libraries: 1"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: ThibaudGLT <thibaud.guillot@biblibre.com>
Signed-off-by: Andreas Roussos <a.roussos@dataly.gr>
Comment 6 Andreas Roussos 2021-12-10 14:56:20 UTC
(In reply to Christophe TORIN from comment #0)
> On the mainpage, the "Suggestions pending approval" block is shown only if
> there are suggestions for the user's current library, even if the other
> library have suggestions.
The suggestions pending approval are also meant to be displayed in the
right hand side of Home > Acquisitions. The change Jonathan suggested
can be applied to koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt
as well.

Would it be OK if I submitted a follow-up patch for this here, and also
change the Bug title accordingly (remove "Mainpage : ")?

Or is it best practice to submit a new bug report?
Comment 7 Jonathan Druart 2021-12-10 16:12:30 UTC
Hi Andreas, attach a patch here and switch the status back to Needs Signoff.
Comment 8 Andreas Roussos 2021-12-13 07:09:56 UTC
Created attachment 128426 [details] [review]
Bug 29571: (follow-up) Fix display of pending suggestions in acqui-home.tt

In addition to the Staff Client's home page, the number of pending
suggestions is also displayed in Home > Acquisitions. Currently,
these are only displayed if there are pending suggestions at the
logged in library. However, suggestions should always be displayed.

This follow-up patch fixes that, and also removes a template variable
(`suggestion`) that is no longer in use (removed as part of Bug 4331,
commit 70af4593722ce2f3debd4f6d2c251ad29008b923).

Test plan:
1) Create a suggestion for Library A.
2) Go to Home > Acquisitions while logged in at Library B.
   Without this patch, nothing is displayed regarding suggestions.
3) Apply this patch. Notice how suggestion information is shown, like:
   "Manage suggestions: Library B: 0 / All libraries: 1"
   If you change the library to Library A, you should get:
   "Manage suggestions: Library A: 1"
Comment 9 Andreas Roussos 2021-12-13 07:12:01 UTC
(In reply to Jonathan Druart from comment #7)
> Hi Andreas, attach a patch here and switch the status back to Needs Signoff.
Thanks, Jonathan. Follow-up attached and bug status changed.
Comment 10 Florian 2021-12-13 15:42:11 UTC
Created attachment 128473 [details] [review]
Bug 29571: (follow-up) Fix display of pending suggestions in acqui-home.tt

In addition to the Staff Client's home page, the number of pending
suggestions is also displayed in Home > Acquisitions. Currently,
these are only displayed if there are pending suggestions at the
logged in library. However, suggestions should always be displayed.

This follow-up patch fixes that, and also removes a template variable
(`suggestion`) that is no longer in use (removed as part of Bug 4331,
commit 70af4593722ce2f3debd4f6d2c251ad29008b923).

Test plan:
1) Create a suggestion for Library A.
2) Go to Home > Acquisitions while logged in at Library B.
   Without this patch, nothing is displayed regarding suggestions.
3) Apply this patch. Notice how suggestion information is shown, like:
   "Manage suggestions: Library B: 0 / All libraries: 1"
   If you change the library to Library A, you should get:
   "Manage suggestions: Library A: 1"

Signed-off-by: Florian Bontemps <florian.bontemps@biblibre.com>
Comment 11 Katrin Fischer 2021-12-19 12:57:27 UTC
Created attachment 128710 [details] [review]
Bug 29571: Display all pending suggestions even if none from logged in library

The number of pending suggestions was only displayed if there are pending
suggestions at the logged in library.

Test plan:
Login at CPL
Create a suggestion (ASKED) for another library
=> Without this patch there is nothing on the mainpage
=> With this patch applied you will see info about pending suggestions:

"Suggestions pending approval: Centerville: 0 / All libraries: 1"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: ThibaudGLT <thibaud.guillot@biblibre.com>
Signed-off-by: Andreas Roussos <a.roussos@dataly.gr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 12 Katrin Fischer 2021-12-19 12:57:31 UTC
Created attachment 128711 [details] [review]
Bug 29571: (follow-up) Fix display of pending suggestions in acqui-home.tt

In addition to the Staff Client's home page, the number of pending
suggestions is also displayed in Home > Acquisitions. Currently,
these are only displayed if there are pending suggestions at the
logged in library. However, suggestions should always be displayed.

This follow-up patch fixes that, and also removes a template variable
(`suggestion`) that is no longer in use (removed as part of Bug 4331,
commit 70af4593722ce2f3debd4f6d2c251ad29008b923).

Test plan:
1) Create a suggestion for Library A.
2) Go to Home > Acquisitions while logged in at Library B.
   Without this patch, nothing is displayed regarding suggestions.
3) Apply this patch. Notice how suggestion information is shown, like:
   "Manage suggestions: Library B: 0 / All libraries: 1"
   If you change the library to Library A, you should get:
   "Manage suggestions: Library A: 1"

Signed-off-by: Florian Bontemps <florian.bontemps@biblibre.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 13 Fridolin Somers 2022-01-04 06:59:32 UTC
Pushed to master for 22.05, thanks to everybody involved ﷐[U+1F984]﷑
Comment 14 Kyle M Hall (khall) 2022-01-07 11:19:42 UTC
Pushed to 21.11.x for 21.11.02
Comment 15 Andrew Fuerste-Henry 2022-01-10 16:10:12 UTC
Pushed to 21.05.x for 21.05.08
Comment 16 Victor Grousset/tuxayo 2022-02-07 11:52:42 UTC
Not backported to oldoldstable (20.11.x). Feel free to ask if it's needed.