Koha/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-privacy.tt
Kyle M Hall 1ad03f5509
Bug 20691: Add ability to turn feature on and off
This patch adds two preferences
1. AllowPatronToSetFinesVisibilityForGuarantor: Allow/Don't allow patrons to choose their own privacy settings for showing the patron's fines to the patron's guarantor
2. AllowStaffToSetFinesVisibilityForGuarantor: Allow/Don't allow staff to set the ability for a patron's fines to be viewed by linked patrons in the OPAC

Also adds a tinyint, non nullable, default to 0 column in borrower and deletedborrower named privacy_guarantor_fines.
1. privacy_guarantor_fines = 0 => don't allow guarantor to see guarantee's fines
2. privacy_guarantor_fines = 1 => allow guarantor to see guarantee's fines

To test:
1) git reset --hard master
2) apply patches (including dependencies)
3) perl installer/data/mysql/updatedatabase.pl
4) dbic
5) restart_all
6) in intranet search for AllowPatronToSetFinesVisibilityForGuarantor and AllowStaffToSetFinesVisibilityForGuarantor preferences
SUCCESS => both preferences should be present
7) search for a patron with guarantor
SUCCESS => in details tab, in "Library use" section you should see a row labeled "Show fines to guarantor"
8) edit
CHECK => in Guarantor information there is no "Show fines to guarantor" select
9) set AllowStaffToSetFinesVisibilityForGuarantor preference to "Allow"
10) return to patron with guarantor and edit
SUCCESS => in Guarantor information section there is a "Show fines to guarantor" select
11) change "Show fines to guarantor" select to "Yes" and save
SUCCESS => Value is saved
12) go to details tab
SUCCESS => in "Library use" section you see a row labeled "Show fines to guarantor" with value "Yes"
13) set OPACPrivacy preference to "Allow"
14) open 2 opacs, one with a patron that has a guarantor and another that hasn't and go to "your privacy" tab.
CHECK => in both opacs you should not see a "Allow your guarantor to view your current fines?" select
15) in intranet set AllowPatronToSetFinesVisibilityForGuarantor to "Allow"
16) refresh both opacs
SUCCESS => in Patron that has guarantor you see a "Allow your guarantor to view your current fines?" select
	=> in Patron without guarantor you don't see a "Allow your guarantor to view your current fines?" select
17) in Patron with guarantor change value of select and save
SUCCESS => Value is saved
18) in intranet set OPACPrivacy preference to "Don't allow" and AllowPatronToSetFinesVisibilityForGuarantor to "Don't allow"
19) got to "your personal details" in both opacs
CHECK => in both opacs you should not see no Privacy section with a "Allow your guarantor to view your current fines?" select
20) in intranet set AllowPatronToSetFinesVisibilityForGuarantor to "Allow"
21) refresh both opacs
SUCCESS => in Patron that has guarantor you see a "Allow your guarantor to view your current fines?" select in a Privacy section
        => in Patron without guarantor there is no Privacy section
22) in Patron with guarantor change value of select and update
SUCCESS => Value is saved
23) Sign off

Signed-off-by: Agustin Moyano <agustinmoyano@theke.io>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
2019-09-11 08:53:46 +01:00

129 lines
9 KiB
Text

[% USE Koha %]
[% INCLUDE 'doc-head-open.inc' %]
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your privacy management</title>
[% INCLUDE 'doc-head-close.inc' %]
[% BLOCK cssinclude %][% END %]
</head>
[% INCLUDE 'bodytag.inc' bodyid='opac-privacy' %]
[% INCLUDE 'masthead.inc' %]
<div class="main">
<ul class="breadcrumb">
<li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
<li><a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a> <span class="divider">&rsaquo;</span></li>
<li><a href="#">Your privacy management</a></li>
</ul>
<div class="container-fluid">
<div class="row-fluid">
<div class="span2">
<div id="navigation">
[% INCLUDE 'navigation.inc' IsPatronPage=1 %]
</div>
</div>
<div class="span10">
<div id="userprivacy">
<h3>Your privacy management</h3>
[% IF deleted %]
<div class="alert alert-success">Your reading history has been deleted.</div>
[% ELSIF history_not_deleted %]
<div class="alert">The deletion of your reading history failed, because there is a problem with the configuration of this feature. Please help to fix the system by informing your library of this error</div>
[% ELSIF nothing_to_delete %]
<div class="alert">No reading history to delete</div>
[% END %]
[% IF ( privacy_updated ) %]
<div class="alert alert-success">Your privacy rules have been updated.</div>
[% END %]
[% IF ( Ask_data ) %]
<p>We take great care in protecting your privacy. On this screen, you can define how long we keep your reading history.</p>
<p>Your options are: <p>
<ul id="opac-privacy-options-list">
<li class="privacy0">Forever: keep my reading history without limit. This is the option for users who want to keep track of what they are reading.</li>
<li class="privacy1">Default: keep my reading history according to local laws. This is the default option : the library will keep your reading history for the duration permitted by local laws.</li>
<li class="privacy2">Never: Delete my reading history immediately. This will delete all record of the item that was checked-out upon check-in.</li>
</ul>
<p id="note1">Please note that information on any book still checked-out must be kept by the library no matter which privacy option you choose.</p>
<p id="note2">Please also note that the library staff can't update these values for you: it's your privacy!</p>
<form action="/cgi-bin/koha/opac-privacy.pl" method="post" id="opac-privacy-update-form">
<input type="hidden" name="op" value="update_privacy" />
<fieldset>
<label for="privacy">Please choose your privacy rule:</label>
<div>
<select name="privacy" id="privacy">
[% IF ( privacy0 ) %]
<option value="0" selected="selected" class="privacy0">Forever</option>
[% ELSE %]
<option value="0" class="privacy0">Forever</option>
[% END %]
[% IF ( privacy1 ) %]
<option value="1" selected="selected" class="privacy1">Default</option>
[% ELSE %]
<option value="1" class="privacy1">Default</option>
[% END %]
[% IF ( privacy2 ) %]
<option value="2" selected="selected" class="privacy2">Never</option>
[% ELSE %]
<option value="2" class="privacy2">Never</option>
[% END %]
</select>
</div>
[% IF has_guarantor_flag && (Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') || Koha.Preference('AllowPatronToSetFinesVisibilityForGuarantor') ) %]
<div>
[% IF Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') %]
<label for="privacy_guarantor_checkouts">Allow your guarantor to view your current checkouts?</label>
<select name="privacy_guarantor_checkouts">
[% IF borrower.privacy_guarantor_checkouts %]
<option value="0">No</option>
<option value="1" selected>Yes</option>
[% ELSE %]
<option value="0" selected>No</option>
<option value="1">Yes</option>
[% END %]
</select>
[% END %]
[% IF Koha.Preference('AllowPatronToSetFinesVisibilityForGuarantor') %]
<label for="privacy_guarantor_fines">Allow your guarantor to view your current fines?</label>
<select name="privacy_guarantor_fines">
[% IF borrower.privacy_guarantor_fines %]
<option value="0">No</option>
<option value="1" selected>Yes</option>
[% ELSE %]
<option value="0" selected>No</option>
<option value="1">Yes</option>
[% END %]
</select>
[% END %]
<span class="hint">
Guaranteed by
[% FOREACH gr IN borrower.guarantor_relationships %]
[% SET g = gr.guarantor %]
[% g.firstname | html %] [% g.surname | html %]
[%- IF ! loop.last %], [% END %]
[% END %]
</span>
</div>
[% END %]
<button type="Submit" class="btn">Save</button>
</fieldset>
</form>
<h2>Immediate deletion</h2>
<form action="/cgi-bin/koha/opac-privacy.pl" method="post" id="opac-privacy-delete-form">
<input type="hidden" name="op" value="delete_record" />
<p>Whatever your privacy rule you choose, you can delete all your reading history immediately by clicking here. <b>BE CAREFUL</b>. Once you've confirmed the deletion, no one can retrieve the list!</p>
<input type="submit" value="Immediate deletion" class="btn btn-danger" onclick="return confirmDelete(MSG_CONFIRM_AGAIN);" />
</form>
[% IF Koha.Preference('StoreLastBorrower') %]<p id="store-last-borrower-msg">Please note, the last person to return an item is tracked for the management of items returned damaged.</p>[% END %]
[% END # / IF Ask_data %]
</div> <!-- / .userprivacy -->
</div> <!-- / .span10 -->
</div> <!-- / .row-fluid -->
</div> <!-- / .container-fluid -->
</div> <!-- / .main -->
[% INCLUDE 'opac-bottom.inc' %]
[% BLOCK jsinclude %][% END %]