Bug 6254 - Set default for privacy by patron category
Summary: Set default for privacy by patron category
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Kyle M Hall
QA Contact: Jonathan Druart
URL:
Keywords:
: 4426 (view as bug list)
Depends on:
Blocks: 12454
  Show dependency treegraph
 
Reported: 2011-04-22 14:40 UTC by Nicole C. Engard
Modified: 2015-12-03 22:11 UTC (History)
10 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 6254 - can't set patron privacy by default (4.72 KB, patch)
2013-06-18 16:27 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 6254 - can't set patron privacy by default (4.72 KB, patch)
2013-06-18 16:28 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 6254 - can't set patron privacy by default (4.86 KB, patch)
2013-06-18 16:29 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 6254 - can't set patron privacy by default (4.92 KB, patch)
2013-06-28 10:13 UTC, Liz Rea
Details | Diff | Splinter Review
[PASSED QA] Bug 6254 - can't set patron privacy by default (5.48 KB, patch)
2013-07-14 12:38 UTC, Katrin Fischer
Details | Diff | Splinter Review
[PASSED QA] Bug 6254 - can't set patron privacy by default (5.03 KB, patch)
2013-12-04 18:11 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 6254 - can't set patron privacy by default - QA Followup (4.06 KB, patch)
2013-12-04 18:13 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 6254 - can't set patron privacy by default (13.30 KB, patch)
2013-12-05 13:23 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 6254 - can't set patron privacy by default (13.28 KB, patch)
2013-12-13 14:53 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 6254 - can't set patron privacy by default (13.33 KB, patch)
2013-12-13 16:24 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review
Bug 6254 [QA Followup 1] - can't set patron privacy by default (15.62 KB, patch)
2014-01-07 13:35 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 6254 [QA Followup 1] - can't set patron privacy by default (15.90 KB, patch)
2014-01-07 13:42 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 6254 [QA Followup 1] - can't set patron privacy by default (16.72 KB, patch)
2014-01-07 13:51 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 6254 [QA Followup 1] - can't set patron privacy by default (16.72 KB, patch)
2014-01-07 13:53 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 6254 [QA Followup 2] - can't set patron privacy by default (2.57 KB, patch)
2014-01-22 13:35 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 6254 - can't set patron privacy by default (13.42 KB, patch)
2014-01-24 14:57 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 6254 [QA Followup 1] - can't set patron privacy by default (16.79 KB, patch)
2014-01-24 14:57 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 6254 [QA Followup 2] - can't set patron privacy by default (2.63 KB, patch)
2014-01-24 14:58 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 6254: QA FIX: remove trailing whitespaces (1.96 KB, patch)
2014-01-24 14:58 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 6254 [1] - Can't set patron privacy by default (20.49 KB, patch)
2014-05-07 17:51 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 6254 [2] - Update Schema File (2.65 KB, patch)
2014-05-07 17:51 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 6254 [3] - Tidy admin/categorie.pl ( whitespace changes only ) (23.85 KB, patch)
2014-05-07 17:51 UTC, Kyle M Hall
Details | Diff | Splinter Review
Bug 6254 [3] - Tidy admin/categorie.pl ( whitespace changes only ) (23.79 KB, patch)
2014-05-07 17:55 UTC, Kyle M Hall
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 2011-04-22 14:40:13 UTC
When you do a bulk patron import you can choose a privacy setting for your patrons, but when you create a new patron you can't.  Many libraries want the default to be 'Never' and have the patrons opt in - while others want the patrons to choose to opt-out instead.  Given this librarians should be able to set the default per patron or patron category and then never be allowed to edit that once it's set (in order to let the patron have control over the preference).
Comment 1 Nicole C. Engard 2011-04-22 14:50:16 UTC
Also, patron import shouldn't be allowed to change the privacy setting on existing patrons .. only for new patrons.
Comment 2 Magnus Enger 2011-05-06 12:03:05 UTC
The privacy setting is stored in borrowers.privacy which has a default of 1. A quick and dirty hack for a library that wanted 0 or 2 as the default could be to change the default of the column in MySQL. 

But I agree with Nicole, it would be nice to have a "proper" way to set the defualt to something else than 1, and very nice if a default could be set for each patron category.
Comment 3 Nicole C. Engard 2012-01-23 22:32:43 UTC
*** Bug 4426 has been marked as a duplicate of this bug. ***
Comment 4 Kyle M Hall 2013-06-18 16:27:42 UTC Comment hidden (obsolete)
Comment 5 Kyle M Hall 2013-06-18 16:28:34 UTC Comment hidden (obsolete)
Comment 6 Kyle M Hall 2013-06-18 16:29:38 UTC Comment hidden (obsolete)
Comment 7 Viktor Sarge 2013-06-28 08:14:14 UTC
Here in Sweden we are generally forbidden to have reading history active. There are certain categories of borrowers however (those reading DAISY for example) that are dependent on reading history being enabled. Therefore it would be highly useful to have Koha allow setting the default privacy per patron category. Imported users should get the default privacy setting if nothing else is specified.
Comment 8 Liz Rea 2013-06-28 10:13:18 UTC Comment hidden (obsolete)
Comment 9 Katrin Fischer 2013-07-14 12:38:51 UTC Comment hidden (obsolete)
Comment 10 Katrin Fischer 2013-07-14 12:39:12 UTC
Functionality wise this works and passes QA, but I am not so happy about the system preference description:

NewPatronPrivacySetting:
New patrons should have a privacy setting of default|never|forever

I don't thinks this explains what this setting will do to a librarian trying to configure Koha and without deeper knowledge about the features and terminology. Also "Privacy" is a pretty broad term and this only affects how long we keep the reading history.
Comment 11 Galen Charlton 2013-07-16 15:51:50 UTC
There are two separate requests in this bug to have the default be per-patron category.

Kyle, are you amenable to redoing the patch to have the default privacy value be an attribute of patron category?  Consider this part of my "sometimes a global YASP is not the right level of configurability" hobbyhorse.

Setting to in discussion.
Comment 12 Galen Charlton 2013-07-16 15:53:13 UTC
(In reply to Katrin Fischer from comment #10)
> Functionality wise this works and passes QA, but I am not so happy about the
> system preference description:
> 
> NewPatronPrivacySetting:
> New patrons should have a privacy setting of default|never|forever
> 
> I don't thinks this explains what this setting will do to a librarian trying
> to configure Koha and without deeper knowledge about the features and
> terminology. Also "Privacy" is a pretty broad term and this only affects how
> long we keep the reading history.

I share Katrin's concerns about the description and feel that it could be expanded a bit.  If we end up running with a syspref (but see my previous comment), I also think that DefaultPatronPrivacySetting would be a better name.
Comment 13 Kyle M Hall 2013-12-04 18:11:09 UTC Comment hidden (obsolete)
Comment 14 Kyle M Hall 2013-12-04 18:13:21 UTC Comment hidden (obsolete)
Comment 15 Kyle M Hall 2013-12-05 13:23:13 UTC Comment hidden (obsolete)
Comment 16 Kyle M Hall 2013-12-13 14:53:14 UTC Comment hidden (obsolete)
Comment 17 Biblibre Sandboxes 2013-12-13 16:24:15 UTC
Patch tested with a sandbox, by Joel Sasse <jsasse@plumcreeklibrary.net>
Comment 18 Biblibre Sandboxes 2013-12-13 16:24:48 UTC Comment hidden (obsolete)
Comment 19 Katrin Fischer 2013-12-23 13:13:57 UTC
Hi Kyle, 
ready to QA this, but I have a question about the default setting. In the templates I read:

Controls how long a patrons checkout history is kept for new patrons of this category. "Default" lets the library decide, "Never" anonymizes checkouts on return, and "Forever" keeps a patron's checkout history indefinitely.

Where and how does the library decide the meaning of "default"?
Comment 20 Katrin Fischer 2013-12-23 13:15:46 UTC
And a quick note so I don't forget: we should fix the "librairies" typo in categorie.tt :)
Comment 21 Magnus Enger 2013-12-23 14:40:41 UTC
(In reply to Katrin Fischer from comment #19)
> Where and how does the library decide the meaning of "default"?

If i remember correctly, "default" means loans get anonymized as often as the library decides to run the anonymize cronjob: misc/cronjobs/batch_anonymise.pl The language here seems to be same that is used on the privacu settings page in the OPAC (for logged in users).
Comment 22 Katrin Fischer 2013-12-26 13:48:34 UTC
Some QA notes:
- The new column is missing from the summary table
- The new column is also missing from the summary on deleting a patron category
- The database update could be improved by specifying where the new column
  will be added ('AFTER categorycode')
- I think the note in the staff client could be a bit more specific and mention the cronjob, as it's directed at the librarians and not at the patrons. 

Kyle, could you provide a follow up?
Comment 23 Kyle M Hall 2014-01-07 13:35:19 UTC Comment hidden (obsolete)
Comment 24 Kyle M Hall 2014-01-07 13:42:04 UTC Comment hidden (obsolete)
Comment 25 Kyle M Hall 2014-01-07 13:51:21 UTC Comment hidden (obsolete)
Comment 26 Kyle M Hall 2014-01-07 13:53:30 UTC Comment hidden (obsolete)
Comment 27 Katrin Fischer 2014-01-12 19:26:04 UTC
Comment on attachment 23987 [details] [review]
Bug 6254 [QA Followup 1] - can't set patron privacy by default

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

Kyle, we are really almost there, but there is a translation problem:

::: koha-tmpl/intranet-tmpl/prog/en/modules/admin/categorie.tt
@@ +276,5 @@
> +                <tr><th scope="row">Enrollment fee: </th><td>[% category.enrolmentfee | format('%.02f') %]</td></tr>
> +                <tr><th scope="row">Receives overdue notices: </th><td>[% IF ( category.overduenoticerequired ) %]Yes[% ELSE %]No[% END %]</td></tr>
> +                <tr><th scope="row">Lost items in staff client</th><td>[% IF ( category.hidelostitems ) %]Hidden by default[% ELSE %]Shown[% END %]</td></tr>
> +                <tr><th scope="row">Hold fee: </th><td>[% category.reservefee | format('%.02f') %]</td></tr>
> +                <tr><th scope="row">Default privacy: </th><td>[% category.default_privacy %]</td></tr>

I think this should be a SWITCH making the never, forever and default translatable. The configuration page already does it correctly.

@@ +404,5 @@
>                                  No limitation
>                              [% END %]
>                          </td>
> +                        <td>
> +                            [% loo.default_privacy %]

And here.
Comment 28 Kyle M Hall 2014-01-22 13:35:40 UTC Comment hidden (obsolete)
Comment 29 Jonathan Druart 2014-01-24 13:39:06 UTC
Maybe should we hide the "default privacy" entry on the categorie.pl page (form add/edit and list) if OPACPrivacy is off?
Comment 30 Jonathan Druart 2014-01-24 14:56:13 UTC
All seems good to me.
It would have been good to have several patches instead of one (for indentation and wording fixes).
I still don't think it is a good idea to call Koha::Database in script file but it seems this idea does not win unanimous support.

I will provide 1 patch with 2 small fixes.

Marked as Passed QA.
Comment 31 Jonathan Druart 2014-01-24 14:57:31 UTC
(In reply to Jonathan Druart from comment #29)
> Maybe should we hide the "default privacy" entry on the categorie.pl page
> (form add/edit and list) if OPACPrivacy is off?

I asked to Katrin on the IRC and she answered me:

cait: I wonder if a library would want to clean the history for certain patron categories without the patron being able to choose how they do it
cait: i mean they could use the cronjob with a special setting for some patron categories... even if you don't let the patrons choose their setting
so if that would work... maybe it should always be visible

Which is make sense.
Comment 32 Jonathan Druart 2014-01-24 14:57:51 UTC Comment hidden (obsolete)
Comment 33 Jonathan Druart 2014-01-24 14:57:57 UTC Comment hidden (obsolete)
Comment 34 Jonathan Druart 2014-01-24 14:58:04 UTC Comment hidden (obsolete)
Comment 35 Jonathan Druart 2014-01-24 14:58:10 UTC Comment hidden (obsolete)
Comment 36 Galen Charlton 2014-05-05 22:33:41 UTC
Patch does not apply.

Reminder: please keep extensive whitespace changes onto separate patches.
Comment 37 Kyle M Hall 2014-05-07 17:51:12 UTC
Created attachment 28033 [details] [review]
Bug 6254 [1] - Can't set patron privacy by default

There is currently no way to set the privacy setting for newly created
patrons. This patch adds a new field "default privacy" to the patron
categories such that each patron category may have a different default
privacy setting.

Test Plan:
1) Apply this patch
2) Edit a patron category, change the default privacy to "forever"
3) Create a new patron of that category
4) Log into the catalog as that patron, verify the privacy setting
   is set to "forever"
5) Repeat steps 2-4 with the settings "never" and "default"

Signed-off-by: Joel Sasse <jsasse@plumcreeklibrary.net>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Bug 6254 [QA Followup 1] - can't set patron privacy by default

* Adds default privacy column to summary table
* Adds default privacy to delete category summary
* Adds "AFTER categorycode" to the database update
* Whitespace cleanup and formatting for affected code blocks
* Switch basic DBI queries to DBIx::Class to simplify code
* Adds reference to misc/cronjobs/batch_anonymise.pl to description

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Bug 6254 [QA Followup 2] - can't set patron privacy by default

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>

Bug 6254: QA FIX: remove trailing whitespaces

This patch removes trailing whitespaces/tab and fix the fields order in
the updatedb entry (according to the kohastructure.pl).

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Comment 38 Kyle M Hall 2014-05-07 17:51:29 UTC
Created attachment 28034 [details] [review]
Bug 6254 [2] - Update Schema File
Comment 39 Kyle M Hall 2014-05-07 17:51:31 UTC Comment hidden (obsolete)
Comment 40 Kyle M Hall 2014-05-07 17:52:58 UTC
I've re-flowed these patches for simplicity and ease of updating:
1) Squashed all qa followups into main patch
2) Split schema file update into separate patch
3) Split whitespace cleanup into separate patch
Comment 41 Kyle M Hall 2014-05-07 17:55:26 UTC
Created attachment 28036 [details] [review]
Bug 6254 [3] - Tidy admin/categorie.pl ( whitespace changes only )
Comment 42 Kyle M Hall 2014-05-07 18:06:07 UTC
I do believe this had passed qa. I've made no functional changes with my re-arrangement of the patch set, so back it goes! I did re-test and verify this patch set before uploading.
Comment 43 Galen Charlton 2014-05-26 01:35:54 UTC
Pushed to master.  Thanks, Kyle!