Bug 13701

Summary: Sharing lists: Text hardcoded to 2 weeks, but could be any time frame
Product: Koha Reporter: Katrin Fischer <katrin.fischer>
Component: ListsAssignee: Alex Buckley <alexbuckley>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: alexbuckley, m.de.rooy, marjorie.barry-vila, veron
Version: MainKeywords: Academy
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: String patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00
Bug Depends on:    
Bug Blocks: 26831    
Attachments: Bug 13701: Remove hardcoded "two weeks" text from list share confirmation
Bug 13701: Remove hardcoded "two weeks" text from list share confirmation

Description Katrin Fischer 2015-02-12 13:44:23 UTC
When you invite someone to share a list with you, there is a text displayed on the confirmation page:

An invitation to share list ... will be sent shortly to test@...

You will receive an email notification if someone accepts your share within two weeks.

I think the invitations are cleaned up using cronjobs - so maybe the text should be less specific?
Comment 1 Marcel de Rooy 2015-02-12 14:09:16 UTC
I recall starting with a hardcoded value of 14 days, but yes, it is a parameter now of cleanup_database.pl.
Comment 2 Katrin Fischer 2015-02-12 14:10:55 UTC
Just noting things I find in testing Marcel - it would also be nice to make the email field a bit longer... small stuff mostly.
Comment 3 Katrin Fischer 2015-02-12 22:42:44 UTC
I mean to say - not a big thing, just wanted to note for later :)
Comment 4 Katrin Fischer 2019-02-10 21:57:52 UTC
The text still is: 
You will receive an email notification if someone accepts your share within two weeks

How could we rephrase that in a general way? I don't think we can get the value from the cronjob somehow?

Maybe just:

You will receive an email notification if someone accepts your share.

Or:

You will receive an email notification if someone accepts your share before it expires.
Comment 5 Alex Buckley 2020-10-26 07:21:55 UTC
Created attachment 112498 [details] [review]
Bug 13701: Remove hardcoded "two weeks" text from list share confirmation

Test plan:
1. Enable the OpacAllowSharingPrivateLists system preference
2. Create a private list and add items to it
3. In the OPAC click on the private list name and select 'Share list'
4. Input an email address and observe the text: "You will receive an
email notification if someone accepts your share within two weeks."
5. Apply patch
6. Restart services
7. Repeat step 3 & 4 and observe the text now displays: "You will receive
an email notification if someone accepts your share before it expires."

Sponsored-By: Catalyst IT
Comment 6 Alex Buckley 2020-10-26 07:29:41 UTC
I've attached a patch which removes that hardcoded "two weeks" text and replaces it with your second suggestion in comment #4 Katrin. 

One other thought I did have was perhaps we could replace the hardcoded 14 day value in the cleanup_database.pl cronjob with a system preference?

 The system preference could have a default of 14 days, for fresh and upgrading installs. 

The benefits of using a syspref would be:

1. Librarians would be able to change how long share invitations are 'valid' for. This is something they currently don't control, unless they have server access.

2. By storing the invitation cleanup frequency in a syspref then it could be accurately displayed in the opac-shareshelf.tt template

Please let me know what you think of this idea :)

Thanks,
Alex
Comment 7 Katrin Fischer 2020-10-26 19:36:09 UTC
I love the idea :) We might still need a standard text as a fallback for when the cron value is used, but we could have the best of all worlds.
Comment 8 Alex Buckley 2020-10-26 19:59:58 UTC
Awesome, thank you for sharing your thoughts on that Katrin. Glad you like the idea :) 

Do you think it is alright for me to implement both the standard text and new syspref in this bug report, or put adding the new syspref on a separate bug report?
Comment 9 Katrin Fischer 2020-10-26 20:12:04 UTC
Hm, there are advantages to both - and both would be ok. I think this as it stands now could be a candidate for backporting to older versions (but depends on the RMaints) while a new pref would be a new feature. So maybe splitting it might be nicer?
Comment 10 Alex Buckley 2020-10-26 20:25:13 UTC
Yeah that sounds good. In that case I'll create a new bug report a bit later on today, which depends on this one, for the new syspref. And leave this one as it is ready for testing. 

Thanks Katrin!
Comment 11 Katrin Fischer 2020-10-26 23:02:04 UTC
Created attachment 112544 [details] [review]
Bug 13701: Remove hardcoded "two weeks" text from list share confirmation

Test plan:
1. Enable the OpacAllowSharingPrivateLists system preference
2. Create a private list and add items to it
3. In the OPAC click on the private list name and select 'Share list'
4. Input an email address and observe the text: "You will receive an
email notification if someone accepts your share within two weeks."
5. Apply patch
6. Restart services
7. Repeat step 3 & 4 and observe the text now displays: "You will receive
an email notification if someone accepts your share before it expires."

Sponsored-By: Catalyst IT

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 12 Katrin Fischer 2020-10-26 23:03:01 UTC
Two word string change, also passing QA.
Comment 13 Jonathan Druart 2020-11-02 10:05:11 UTC
Pushed to master for 20.11, thanks to everybody involved!