Bug 17946 - Show number of subscriptions on tab in OPAC record details
Summary: Show number of subscriptions on tab in OPAC record details
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Aleisha Amohia
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 18307
  Show dependency treegraph
 
Reported: 2017-01-19 21:51 UTC by Aleisha Amohia
Modified: 2017-04-02 17:39 UTC (History)
6 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Small patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 17946: Show number of subscriptions on tab in OPAC record details (1.37 KB, patch)
2017-01-19 21:56 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 17946: Show number of subscriptions on tab in OPAC record details (1.94 KB, patch)
2017-02-02 22:18 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 17946: Show number of subscriptions on tab in OPAC record details (2.00 KB, patch)
2017-03-20 15:29 UTC, sandboxes@biblibre.com
Details | Diff | Splinter Review
Bug 17946: Show number of subscriptions on tab in OPAC record details (2.07 KB, patch)
2017-03-20 19:52 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Aleisha Amohia 2017-01-19 21:51:37 UTC
The OPAC detail page for a biblio shows the number Items, Holdings etc in brackets after the tab title (like 'Holdings ( 1 )'), it should do the same for subscriptions.
Comment 1 Aleisha Amohia 2017-01-19 21:56:14 UTC
Created attachment 59288 [details] [review]
Bug 17946: Show number of subscriptions on tab in OPAC record details

To test:
1) Edit at least one subscription (or add a new one) to have a record
2) Find that record on the OPAC
3) Confirm that the Subscriptions tab reads the correct number of
subscriptions attached to the record

Sponsored-by: Catalyst IT
Comment 2 M. Tompsett 2017-01-20 01:24:58 UTC
Comment on attachment 59288 [details] [review]
Bug 17946: Show number of subscriptions on tab in OPAC record details

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

::: koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt
@@ +576,4 @@
>  
>                          [% IF ( subscriptionsnumber ) %]
>                              [% IF ( defaulttab == 'subscriptions' ) %]<li id="tab_subscriptions" class="ui-tabs-active">[% ELSE %]<li id="tab_subscriptions">[% END %]
> +                                <a href="#subscriptions">Subscriptions ( [% subscriptions.size || 0 %] )</a>

Why not just subscriptionsnumber?
See line 796ish where it puts it in the sentence.
There is no need for || 0, because subscriptions.size should be equal to subscriptionsnumber.
Comment 3 Aleisha Amohia 2017-02-02 22:14:05 UTC
(In reply to M. Tompsett from comment #2)
> Why not just subscriptionsnumber?
> See line 796ish where it puts it in the sentence.
> There is no need for || 0, because subscriptions.size should be equal to
> subscriptionsnumber.

I think maybe the code that creates subscriptionsnumber is unnecessary since template toolkit provides the .size method. I will attach a patch that removes this
Comment 4 Aleisha Amohia 2017-02-02 22:16:23 UTC
(In reply to Aleisha Amohia from comment #3)
> I think maybe the code that creates subscriptionsnumber is unnecessary since
> template toolkit provides the .size method. I will attach a patch that
> removes this

Classic case of "should've looked at the code before making a comment"... subscriptions number is actually used for a few things in the code so I will change my patch to use it.
Comment 5 Aleisha Amohia 2017-02-02 22:18:48 UTC
Created attachment 59832 [details] [review]
Bug 17946: Show number of subscriptions on tab in OPAC record details

This patch removes some duplicate code.

To test:
1) Edit at least one subscription (or add a new one) to have a record
2) Find that record on the OPAC
3) Confirm that the Subscriptions tab reads the correct number of
subscriptions attached to the record

Sponsored-by: Catalyst IT
Comment 6 sandboxes@biblibre.com 2017-03-20 15:29:12 UTC
Patch tested with a sandbox, by JMBroust <jean-manuel.broust@univ-lyon2.fr>
Comment 7 sandboxes@biblibre.com 2017-03-20 15:29:32 UTC
Created attachment 61326 [details] [review]
Bug 17946: Show number of subscriptions on tab in OPAC record details

This patch removes some duplicate code.

To test:
1) Edit at least one subscription (or add a new one) to have a record
2) Find that record on the OPAC
3) Confirm that the Subscriptions tab reads the correct number of
subscriptions attached to the record

Sponsored-by: Catalyst IT

Signed-off-by: JMBroust <jean-manuel.broust@univ-lyon2.fr>
Comment 8 jmbroust 2017-03-20 15:36:58 UTC
Not introduced by this patch but i noticed that the library is no more displayed in opac subscription tab view. There is "Library :" but the name of the library is missing. Shall I fill a new bug ?
Comment 9 Jonathan Druart 2017-03-20 19:52:25 UTC
Created attachment 61342 [details] [review]
Bug 17946: Show number of subscriptions on tab in OPAC record details

This patch removes some duplicate code.

To test:
1) Edit at least one subscription (or add a new one) to have a record
2) Find that record on the OPAC
3) Confirm that the Subscriptions tab reads the correct number of
subscriptions attached to the record

Sponsored-by: Catalyst IT

Signed-off-by: JMBroust <jean-manuel.broust@univ-lyon2.fr>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 10 Jonathan Druart 2017-03-20 19:52:38 UTC
(In reply to jmbroust from comment #8)
> Not introduced by this patch but i noticed that the library is no more
> displayed in opac subscription tab view. There is "Library :" but the name
> of the library is missing. Shall I fill a new bug ?

Yes please.
Comment 11 Kyle M Hall 2017-03-31 14:30:32 UTC
Pushed to master for 17.05, thanks Aleisha!
Comment 12 Katrin Fischer 2017-04-02 17:39:11 UTC
Nice!

This won't get ported back to 16.11.x as it is an enhancement.