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.
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 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.
(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
(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.
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
Patch tested with a sandbox, by JMBroust <jean-manuel.broust@univ-lyon2.fr>
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>
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 ?
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>
(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.
Pushed to master for 17.05, thanks Aleisha!
Nice! This won't get ported back to 16.11.x as it is an enhancement.