Bug 11976 - Add column settings + new column "Publication date" to the subscription table
Summary: Add column settings + new column "Publication date" to the subscription table
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: David Bourgault
QA Contact: Alex Arnaud
URL:
Whiteboard:
Keywords: release-notes-needed
Depends on:
Blocks:
 
Reported: 2014-03-20 15:59 UTC by Nicole C. Engard
Modified: 2018-05-01 10:56 UTC (History)
13 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:
This patchset adds a new column to the subscriptions tab on the opac details page, 'publication date' so a user can see the date of issue rather than the date of receipt. Additionally, the patch brings the table under column settings in the administration side so that staff can determine which columns should be shown by default


Attachments
summary with received date (27.28 KB, image/png)
2014-03-20 15:59 UTC, Nicole C. Engard
Details
full history with the 2 dates (56.55 KB, image/png)
2014-03-20 16:00 UTC, Nicole C. Engard
Details
Bug 11976 - Show publication date instead of received date (5.06 KB, patch)
2017-09-25 18:04 UTC, David Bourgault
Details | Diff | Splinter Review
Bug 11976 - Show publication date instead of received date (5.12 KB, patch)
2017-10-04 20:50 UTC, Sarah Kirby
Details | Diff | Splinter Review
Bug 11976 - Display either or both publication date and receival date (7.22 KB, patch)
2017-10-11 15:32 UTC, David Bourgault
Details | Diff | Splinter Review
Bug 11976 - Choose date to display (6.46 KB, patch)
2017-10-16 18:45 UTC, David Bourgault
Details | Diff | Splinter Review
Bug 11976 - Choose date to display (6.68 KB, patch)
2017-10-26 14:17 UTC, M. Tompsett
Details | Diff | Splinter Review
Bug 11976: Rename things for clarity (7.03 KB, patch)
2017-10-26 14:17 UTC, M. Tompsett
Details | Diff | Splinter Review
Bug 11976: Failing counter patch (3.91 KB, patch)
2017-10-26 15:42 UTC, M. Tompsett
Details | Diff | Splinter Review
Bug 11976: Counter patch using Column Settings (6.11 KB, patch)
2017-10-26 16:06 UTC, M. Tompsett
Details | Diff | Splinter Review
Bug 11976: Counter patch using Column Settings (6.12 KB, patch)
2017-11-07 18:18 UTC, David Bourgault
Details | Diff | Splinter Review
Bug 11976: Counter patch using Column Settings (6.17 KB, patch)
2017-12-21 10:00 UTC, Alex Arnaud
Details | Diff | Splinter Review
Bug 11976: Fix sorting issues (2.77 KB, patch)
2017-12-21 15:58 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 Nicole C. Engard 2014-03-20 15:59:56 UTC
Created attachment 26490 [details]
summary with received date

Patrons don't care so much when you received a magazine they want to know if the January 15 issue is available or not.  You see this on the Full History, but most patrons don't click that, they want to see it in the summary.  See attached images.
Comment 1 Nicole C. Engard 2014-03-20 16:00:24 UTC
Created attachment 26491 [details]
full history with the 2 dates
Comment 2 David Bourgault 2017-09-25 18:04:04 UTC Comment hidden (obsolete)
Comment 3 Sarah Kirby 2017-09-29 03:43:12 UTC
After applying the patch and running the updatedatabase.pl script only the publication date is showing and the receival date is not shown on the OPAC detail page.

Where are you wanting the receival date to be displayed? It wasn't showing under the Subscriptions tab.
Comment 4 David Bourgault 2017-09-29 13:04:42 UTC
(In reply to Sarah Kirby from comment #3)
> After applying the patch and running the updatedatabase.pl script only the
> publication date is showing and the receival date is not shown on the OPAC
> detail page.
> 
> Where are you wanting the receival date to be displayed? It wasn't showing
> under the Subscriptions tab.

It's supposed to be displayed in the 'Date' column of the table under 'subscriptions'. It replaces the existing date (which is the receival date).

Did you check that the systempreference OPACSerialDisplayPublishedDate was set to 1 ('publication date' in the web interface).
Comment 5 Sarah Kirby 2017-10-04 20:50:37 UTC
Created attachment 67615 [details] [review]
Bug 11976 - Show publication date instead of received date

Allows choosing between publication date or receival date for serials information in the OPAC.

Test plan :
0) If you have no serials :
    a) Create a subscription
    b) Receive the item, making sure to have a different publication and receival date
1) Visit the OPAC details page for the item you've created
2) Without the patch the receival date will be displayed
3) Apply patch
4) Run installer/data/mysql/updatedatabase.pl
5) With the patch the publication date will be displayed. This can be changed back with the 'OPACSerialDisplayPublishedDate' system preference.

Signed-off-by: Sarah Kirby <sarah.kirby@catalyst.net.nz>
Comment 6 Nick Clemens 2017-10-07 02:08:47 UTC
This works, but defaulting the pref to on changes current behavior. If we feel the current behavior is so unusual that it shouldn't be standard I am not sure a syspref is the way to go.

I would rather see us add a new column and name them appropriately, with classes for hiding/showing via css easily

Would like a second opinion here.
Comment 7 Katrin Fischer 2017-10-08 15:03:27 UTC
(In reply to Nick Clemens from comment #6)
> This works, but defaulting the pref to on changes current behavior. If we
> feel the current behavior is so unusual that it shouldn't be standard I am
> not sure a syspref is the way to go.
> 
> I would rather see us add a new column and name them appropriately, with
> classes for hiding/showing via css easily
> 
> Would like a second opinion here.

Having both would make sense to me.
Comment 8 Stuart Hall Library, Iniva 2017-10-11 11:17:52 UTC
Hello, We are new to Koha and came across this issue when setting up our first journal subscriptions. Posting this comment to express an interest and to endorse the view that OPAC display of the periodical publication date would be more useful to our patrons than the receival date.
Comment 9 David Bourgault 2017-10-11 15:32:43 UTC
Created attachment 67964 [details] [review]
Bug 11976 - Display either or both publication date and receival date

This changes the behavior of the patch. The systempreference now allows choosing to display either date, or both (in two separate columns).
Comment 10 David Bourgault 2017-10-11 15:34:47 UTC
Addedum : the new patch's default behavior is to display both columns.
Comment 11 Katrin Fischer 2017-10-14 19:46:56 UTC
Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 11976 - Show publication date instead of received date
Applying: Bug 11976 - Display either or both publication date and receival date
error: sha1 information is lacking or useless (installer/data/mysql/sysprefs.sql).
error: could not build fake ancestor
Patch failed at 0001 Bug 11976 - Display either or both publication date and receival date
The copy of the patch that failed is found in: .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-11976---Display-either-or-both-publication-dat-6GeGs3.patch

Some things in the second patch don't look quite right - it seems to contain some changes that don't belong to the patch (drop lines for tables, delete for the pref).
Comment 12 David Bourgault 2017-10-16 18:45:01 UTC
Created attachment 68192 [details] [review]
Bug 11976 - Choose date to display

Allows choosing between publication date or receival date (or both) for serials information in the OPAC.

Test plan :
0) If you have no serials :
    a) Create a subscription
    b) Receive the item, making sure to have a different publication and receival date
1) Visit the OPAC details page for the item you've created
2) Without the patch only the receival date will be displayed
3) Apply patch
4) Run installer/data/mysql/updatedatabase.pl
5) With the patch the publication date and the receival date will be displayed. This can be changed to either (or both) with the 'OPACSerialDisplayPublishedDate' system preference.
Comment 13 David Bourgault 2017-10-16 18:46:55 UTC
Combined both patches into one rebase patch.

Removed unrelated SQL manipulations (they were leftovers from testing on Bug 19422)
Comment 14 M. Tompsett 2017-10-26 14:17:13 UTC
Created attachment 68610 [details] [review]
Bug 11976 - Choose date to display

Allows choosing between publication date or receival date (or both) for serials information in the OPAC.

Test plan :
0) If you have no serials :
    a) Create a subscription
    b) Receive the item, making sure to have a different publication and receival date
1) Visit the OPAC details page for the item you've created
2) Without the patch only the receival date will be displayed
3) Apply patch
4) Run installer/data/mysql/updatedatabase.pl
5) With the patch the publication date and the receival date will be displayed. This can be changed to either (or both) with the 'OPACSerialDisplayPublishedDate' system preference.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 15 M. Tompsett 2017-10-26 14:17:31 UTC
Created attachment 68611 [details] [review]
Bug 11976: Rename things for clarity

"Receival Date" is not what is used on the full history
picture attached to this bug.

Additionally, OPACSerialDisplayDate is better than
OPACSerialDisplayPublicationDate.  As the former clarifies
that it could be more or less than Publication Date that
is displayed.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 16 M. Tompsett 2017-10-26 14:34:33 UTC
I'm torn whether to sign this off or not. I think Nick may have a reasonable suggestion for a counter-patch: CSS related.
Comment 17 M. Tompsett 2017-10-26 15:42:14 UTC
Created attachment 68630 [details] [review]
Bug 11976: Failing counter patch
Comment 18 M. Tompsett 2017-10-26 16:06:36 UTC
Created attachment 68632 [details] [review]
Bug 11976: Counter patch using Column Settings

As per Nick Clemen's suggestion from comment #6,
system preferences may not be the best way.

Using Home->Administration->Column Settings->OPAC->subscriptionst
the fields visibility can be toggled.

TEST PLAN
---------
1) Have a subscription where you have received at least once.
2) Look for it in OPAC and note the date is the received date, not the publication date
3) Apply patch
4) Log in to staff client
5) Home->Administration->Column Settings->OPAC->subscriptionst
6) Set visibility as desired.
7) Refresh OPAC page
   -- everything should be as expected.
8) run koha qa test tools.
Comment 19 Katrin Fischer 2017-10-28 12:58:45 UTC
I really like the idea of using the Column settings, but the proposed patch doesn't seem to have any effect for me.

- Settings show up under 'patron' instead of OPAC
- Changing settings doesn't seem to have any effect on the OPAC display
Comment 20 David Bourgault 2017-11-07 18:18:52 UTC Comment hidden (obsolete)
Comment 21 David Bourgault 2017-11-07 18:20:58 UTC
I did not know that was an option.

I modified Mark's patch slightly: the subscriptionst yaml entry did wasn't under OPAC for me, so I simply moved it down.

Worked as described in test plan otherwise.
Comment 22 Alex Arnaud 2017-12-21 10:00:18 UTC
Created attachment 69988 [details] [review]
Bug 11976: Counter patch using Column Settings

As per Nick Clemen's suggestion from comment #6,
system preferences may not be the best way.

Using Home->Administration->Column Settings->OPAC->subscriptionst
the fields visibility can be toggled.

TEST PLAN
---------
1) Have a subscription where you have received at least once.
2) Look for it in OPAC and note the date is the received date, not the publication date
3) Apply patch
4) Log in to staff client
5) Home->Administration->Column Settings->OPAC->subscriptionst
6) Set visibility as desired.
7) Refresh OPAC page
   -- everything should be as expected.
8) run koha qa test tools.

Signed-off-by: David Bourgault <david.bourgault@inlibro.com>

Signed-off-by: Alex Arnaud <alex.arnaud@biblibre.com>
Comment 23 Jonathan Druart 2017-12-21 15:58:28 UTC
Created attachment 70060 [details] [review]
Bug 11976: Fix sorting issues

The last column must be sortable, and dates must use title-string
I removed the class on the th (did not seem useful as we have an id
already)
Comment 24 Jonathan Druart 2017-12-21 16:22:26 UTC
Pushed to master for 18.05, thanks to everybody involved!
Comment 25 Nick Clemens 2018-01-15 16:42:11 UTC
Awesome work all, pushed to stable for 17.11.02
Comment 26 Fridolin SOMERS 2018-01-19 08:55:05 UTC
Enhancement not pushed to 17.05.x