[Koha-patches] [PATCH] [SIGNED-OFF] Bug 3881: OPAC Privacy reimplementation

Chris Nighswonger cnighswonger at foundations.edu
Tue Feb 1 20:48:50 CET 2011


This patch does not apply cleanly to 3.2.x. Please fixup and resubmit with
[3.2.x] in the subject line.

Kind Regards,
Chris

cnighs at li24-93:~/koha.3.2.test (3.2.x *+)$ git status
# On branch 3.2.x
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#    modified:   C4/Auth.pm
#    modified:   C4/Circulation.pm
#    modified:   C4/Members.pm
#    modified:   installer/data/mysql/de-DE/mandatory/sysprefs.sql
#    modified:   installer/data/mysql/en/mandatory/sysprefs.sql
#    modified:
installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql
#    modified:   installer/data/mysql/it-IT/necessari/sysprefs.sql
#    modified:   installer/data/mysql/pl-PL/mandatory/sysprefs.sql
#    modified:
installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql
#    modified:
installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql
#    modified:   installer/data/mysql/updatedatabase.pl
#    modified:
koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl
#    modified:   koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc
#    new file:   koha-tmpl/opac-tmpl/prog/en/modules/opac-privacy.tmpl
#    modified:   members/moremember.pl
#    new file:   opac/opac-privacy.pl
#    modified:   opac/opac-suggestions.pl
#
# Unmerged paths:
#   (use "git reset HEAD <file>..." to unstage)
#   (use "git add/rm <file>..." as appropriate to mark resolution)
#
#    both modified:
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
#


On Sun, Jan 30, 2011 at 12:48 AM, Nicole Engard <
nengard at bywatersolutions.com> wrote:

> From: Ian Walls <ian.walls at bywatersolutions.com>
>
> Reimplements Paul Poulain's original OPAC Privacy patch, with some minor
> improvements and changes to wording
>
> If the library enables the OPACPrivacy system preference along with the
> opacreadinghistory preference, and sets
> an AnonymousPatron (must be a valid patron number in the database), the
> user will see a new tab upon login to
> the OPAC, My Privacy.  From there, the user can:
>
> - Set their OPAC Privacy to one of three values
>  0 - Forever.  This keeps their reading history unless they explicitly
> delete it; the bulk anonymiser won't touch it
>  1 - Default.  Keep reading history until either they delete it or the
> library does
>  2 - Never.    Instantly anonymises reading history upon item return
>
> - Instantly delete their reading history
>  There is a warning and a popup to confirm.  I've removed Paul's extra
> confirm checkbox, which seemed redundant
>
> A note of which preference the patron has selected is added to the Patorn
> Details page in the staff client.  This is read-only.
>
> This patch also consolidates Privacy system preferences into the Privacy
> section of the OPAC tab.
>
> Thank you to BibLibre for the original implmentation of this patch, and Los
> Gatos Public Library for funding and
> testing the reimplementation.
>
> Signed-off-by: Nicole Engard <nengard at bywatersolutions.com>
> ---
>  C4/Auth.pm                                         |    1 +
>  C4/Circulation.pm                                  |   44 ++++++++++--
>  C4/Members.pm                                      |   26 +++++++
>  installer/data/mysql/de-DE/mandatory/sysprefs.sql  |    4 +-
>  installer/data/mysql/en/mandatory/sysprefs.sql     |    4 +-
>  .../1-Obligatoire/unimarc_standard_systemprefs.sql |    4 +-
>  installer/data/mysql/it-IT/necessari/sysprefs.sql  |    9 ++-
>  installer/data/mysql/pl-PL/mandatory/sysprefs.sql  |    4 +-
>  ...m_preferences_full_optimal_for_install_only.sql |    4 +-
>  ...m_preferences_full_optimal_for_install_only.sql |    5 +-
>  installer/data/mysql/updatedatabase.pl             |   10 +++
>  .../prog/en/modules/admin/preferences/opac.pref    |   37 +++++++---
>  .../prog/en/modules/members/moremember.tmpl        |    5 ++
>  koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc  |    3 +
>  .../opac-tmpl/prog/en/modules/opac-privacy.tmpl    |   72
> ++++++++++++++++++++
>  members/moremember.pl                              |    6 ++
>  opac/opac-privacy.pl                               |   68
> ++++++++++++++++++
>  opac/opac-suggestions.pl                           |    2 +-
>  18 files changed, 279 insertions(+), 29 deletions(-)
>  create mode 100644 koha-tmpl/opac-tmpl/prog/en/modules/opac-privacy.tmpl
>  create mode 100755 opac/opac-privacy.pl
>
> diff --git a/C4/Auth.pm b/C4/Auth.pm
> index fc4e3e2..130974e 100644
> --- a/C4/Auth.pm
> +++ b/C4/Auth.pm
> @@ -418,6 +418,7 @@ sub get_template_and_user {
>             OpacNav                   => "" .
> C4::Context->preference("OpacNav"),
>             OpacPasswordChange        =>
> C4::Context->preference("OpacPasswordChange"),
>             OPACPatronDetails        =>
> C4::Context->preference("OPACPatronDetails"),
> +            OPACPrivacy               =>
> C4::Context->preference("OPACPrivacy"),
>             OPACFinesTab              =>
> C4::Context->preference("OPACFinesTab"),
>             OpacTopissue              =>
> C4::Context->preference("OpacTopissue"),
>             RequestOnOpac             =>
> C4::Context->preference("RequestOnOpac"),
> diff --git a/C4/Circulation.pm b/C4/Circulation.pm
> index b741794..f7846ac 100644
> --- a/C4/Circulation.pm
> +++ b/C4/Circulation.pm
> @@ -1516,7 +1516,7 @@ sub AddReturn {
>         }
>
>         if ($borrowernumber) {
> -            MarkIssueReturned($borrowernumber, $item->{'itemnumber'},
> $circControlBranch);
> +            MarkIssueReturned($borrowernumber, $item->{'itemnumber'},
> $circControlBranch, '', $borrower->{'privacy'});
>             $messages->{'WasReturned'} = 1;    # FIXME is the "= 1" right?
>  This could be the borrower hash.
>         }
>
> @@ -1621,7 +1621,7 @@ sub AddReturn {
>
>  =head2 MarkIssueReturned
>
> -  MarkIssueReturned($borrowernumber, $itemnumber, $dropbox_branch,
> $returndate);
> +  MarkIssueReturned($borrowernumber, $itemnumber, $dropbox_branch,
> $returndate, $privacy);
>
>  Unconditionally marks an issue as being returned by
>  moving the C<issues> row to C<old_issues> and
> @@ -1633,6 +1633,9 @@ it's safe to do this, i.e. last non-holiday >
> issuedate.
>  if C<$returndate> is specified (in iso format), it is used as the date
>  of the return. It is ignored when a dropbox_branch is passed in.
>
> +C<$privacy> contains the privacy parameter. If the patron has set privacy
> to 2,
> +the old_issue is immediately anonymised
> +
>  Ideally, this function would be internal to C<C4::Circulation>,
>  not exported, but it is currently needed by one
>  routine in C<C4::Accounts>.
> @@ -1640,7 +1643,7 @@ routine in C<C4::Accounts>.
>  =cut
>
>  sub MarkIssueReturned {
> -    my ( $borrowernumber, $itemnumber, $dropbox_branch, $returndate ) =
> @_;
> +    my ( $borrowernumber, $itemnumber, $dropbox_branch, $returndate,
> $privacy ) = @_;
>     my $dbh   = C4::Context->dbh;
>     my $query = "UPDATE issues SET returndate=";
>     my @bind;
> @@ -1664,6 +1667,16 @@ sub MarkIssueReturned {
>                                   WHERE borrowernumber = ?
>                                   AND itemnumber = ?");
>     $sth_copy->execute($borrowernumber, $itemnumber);
> +    # anonymise patron checkout immediately if $privacy set to 2 and
> AnonymousPatron is set to a valid borrowernumber
> +    if ( $privacy == 2) {
> +        # The default of 0 does not work due to foreign key constraints
> +        # The anonymisation will fail quietly if AnonymousPatron is not a
> valid entry
> +        my $anonymouspatron = (C4::Context->preference('AnonymousPatron'))
> ? C4::Context->preference('AnonymousPatron') : 0;
> +        my $sth_ano = $dbh->prepare("UPDATE old_issues SET
> borrowernumber=?
> +                                  WHERE borrowernumber = ?
> +                                  AND itemnumber = ?");
> +       $sth_ano->execute($anonymouspatron, $borrowernumber, $itemnumber);
> +    }
>     my $sth_del  = $dbh->prepare("DELETE FROM issues
>                                   WHERE borrowernumber = ?
>                                   AND itemnumber = ?");
> @@ -2417,11 +2430,14 @@ sub DeleteTransfer {
>
>  =head2 AnonymiseIssueHistory
>
> -  $rows = AnonymiseIssueHistory($borrowernumber,$date)
> +  $rows = AnonymiseIssueHistory($date,$borrowernumber)
>
>  This function write NULL instead of C<$borrowernumber> given on input arg
> into the table issues.
>  if C<$borrowernumber> is not set, it will delete the issue history for all
> borrower older than C<$date>.
>
> +If c<$borrowernumber> is set, it will delete issue history for only that
> borrower, regardless of their opac privacy
> +setting (force delete).
> +
>  return the number of affected rows.
>
>  =cut
> @@ -2432,12 +2448,24 @@ sub AnonymiseIssueHistory {
>     my $dbh            = C4::Context->dbh;
>     my $query          = "
>         UPDATE old_issues
> -        SET    borrowernumber = NULL
> -        WHERE  returndate < '".$date."'
> +        SET    borrowernumber = ?
> +        WHERE  returndate < ?
>           AND borrowernumber IS NOT NULL
>     ";
> -    $query .= " AND borrowernumber = '".$borrowernumber."'" if defined
> $borrowernumber;
> -    my $rows_affected = $dbh->do($query);
> +
> +    # The default of 0 does not work due to foreign key constraints
> +    # The anonymisation will fail quietly if AnonymousPatron is not a
> valid entry
> +    my $anonymouspatron = (C4::Context->preference('AnonymousPatron')) ?
> C4::Context->preference('AnonymousPatron') : 0;
> +    my @bind_params = ($anonymouspatron, $date);
> +    if (defined $borrowernumber) {
> +       $query .= " AND borrowernumber = ?";
> +       push @bind_params, $borrowernumber;
> +    } else {
> +       $query .= " AND (SELECT privacy FROM borrowers WHERE
> borrowers.borrowernumber=old_issues.borrowernumber) <> 0";
> +    }
> +    my $sth = $dbh->prepare($query);
> +    $sth->execute(@bind_params);
> +    my $rows_affected = $sth->rows;  ### doublecheck row count return
> function
>     return $rows_affected;
>  }
>
> diff --git a/C4/Members.pm b/C4/Members.pm
> index 00716cd..fafc99b 100644
> --- a/C4/Members.pm
> +++ b/C4/Members.pm
> @@ -93,6 +93,7 @@ BEGIN {
>        push @EXPORT, qw(
>                &ModMember
>                &changepassword
> +         &ModPrivacy
>        );
>
>        #Delete data
> @@ -2022,6 +2023,31 @@ sub DebarMember {
>
>  }
>
> +=head2 ModPrivacy
> +
> +=over 4
> +
> +my $success = ModPrivacy( $borrowernumber, $privacy );
> +
> +Update the privacy of a patron.
> +
> +return :
> +true on success, false on failure
> +
> +=back
> +
> +=cut
> +
> +sub ModPrivacy {
> +    my $borrowernumber = shift;
> +    my $privacy = shift;
> +    return unless defined $borrowernumber;
> +    return unless $borrowernumber =~ /^\d+$/;
> +
> +    return ModMember( borrowernumber => $borrowernumber,
> +                      privacy        => $privacy );
> +}
> +
>  =head2 AddMessage
>
>   AddMessage( $borrowernumber, $message_type, $message, $branchcode );
> diff --git a/installer/data/mysql/de-DE/mandatory/sysprefs.sql
> b/installer/data/mysql/de-DE/mandatory/sysprefs.sql
> index 19f7c4d..02511d8 100644
> --- a/installer/data/mysql/de-DE/mandatory/sysprefs.sql
> +++ b/installer/data/mysql/de-DE/mandatory/sysprefs.sql
> @@ -9,7 +9,8 @@ INSERT INTO `systempreferences`
> (variable,value,explanation,options,type) VALUES
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AmazonLocale','US','Use to set the Locale of your Amazon.com Web
> Services','US|CA|DE|FR|JP|UK','Choice');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AWSAccessKeyID','','See:  http://aws.amazon.com','','free');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AmazonAssocTag','','See:  http://aws.amazon.com','','free');
> -INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AnonSuggestions',0,'Set to anonymous borrowernumber to enable
> Anonymous suggestions',NULL,'free');
> +INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AnonSuggestions',0,'Set to enable Anonymous suggestions to
> AnonymousPatron borrowernumber',NULL,'YesNo');
> +INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AnonymousPatron', '0', 'Set the identifier (borrowernumber) of the
> anonymous patron. Used for Suggestion and reading history privacy',NULL,'');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('Babeltheque',0,'Turn ON Babeltheque content  - See babeltheque.comto subscribe to this service','','YesNo');
>
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('authoritysep','--','Used to separate a list of authorities in a
> display. Usually --',10,'free');
> @@ -79,6 +80,7 @@ INSERT INTO `systempreferences`
> (variable,value,explanation,options,type) VALUES
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('OpacNav','Important links here.','Use HTML tags to add navigational
> links to the left-hand navigational bar in OPAC','70|10','Textarea');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('OPACNoResultsFound','','Display this HTML when no results are found
> for a search in the OPAC','70|10','Textarea');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('OpacPasswordChange',1,'If ON, enables patron-initiated password
> change in OPAC (disable it when using LDAP auth)',NULL,'YesNo');
> +INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('OpacPrivacy', '0', 'if ON, allows patrons to define their privacy
> rules (reading history)',NULL,'YesNo');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('opacreadinghistory',1,'If ON, enables display of Patron Circulation
> History in OPAC','','YesNo');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('opacsmallimage','','Enter a complete URL to an image to replace the
> default Koha logo','','free');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('opacstylesheet','','Enter a complete URL to use an alternate layout
> stylesheet in OPAC','','free');
> diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql
> b/installer/data/mysql/en/mandatory/sysprefs.sql
> index b597b02..0b75e98 100644
> --- a/installer/data/mysql/en/mandatory/sysprefs.sql
> +++ b/installer/data/mysql/en/mandatory/sysprefs.sql
> @@ -9,7 +9,8 @@ INSERT INTO `systempreferences`
> (variable,value,explanation,options,type) VALUES
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AmazonLocale','US','Use to set the Locale of your Amazon.com Web
> Services','US|CA|DE|FR|JP|UK','Choice');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AWSAccessKeyID','','See:  http://aws.amazon.com','','free');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AmazonAssocTag','','See:  http://aws.amazon.com','','free');
> -INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AnonSuggestions',0,'Set to anonymous borrowernumber to enable
> Anonymous suggestions',NULL,'free');
> +INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AnonSuggestions',0,'Set to enable Anonymous suggestions to
> AnonymousPatron borrowernumber',NULL,'YesNo');
> +INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AnonymousPatron', '0', 'Set the identifier (borrowernumber) of the
> anonymous patron. Used for Suggestion and reading history privacy',NULL,'');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('Babeltheque',0,'Turn ON Babeltheque content  - See babeltheque.comto subscribe to this service','','YesNo');
>
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('authoritysep','--','Used to separate a list of authorities in a
> display. Usually --',10,'free');
> @@ -79,6 +80,7 @@ INSERT INTO `systempreferences`
> (variable,value,explanation,options,type) VALUES
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('OpacNav','Important links here.','Use HTML tags to add navigational
> links to the left-hand navigational bar in OPAC','70|10','Textarea');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('OPACNoResultsFound','','Display this HTML when no results are found
> for a search in the OPAC','70|10','Textarea');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('OpacPasswordChange',1,'If ON, enables patron-initiated password
> change in OPAC (disable it when using LDAP auth)',NULL,'YesNo');
> +INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('OpacPrivacy', '0', 'if ON, allows patrons to define their privacy
> rules (reading history)',NULL,'YesNo');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('opacreadinghistory',1,'If ON, enables display of Patron Circulation
> History in OPAC','','YesNo');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('opacsmallimage','','Enter a complete URL to an image to replace the
> default Koha logo','','free');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('opacstylesheet','','Enter a complete URL to use an alternate layout
> stylesheet in OPAC','','free');
> diff --git
> a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql
> b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql
> index b051ba3..757f255 100644
> ---
> a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql
> +++
> b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql
> @@ -10,7 +10,8 @@ INSERT INTO `systempreferences`
> (variable,value,explanation,options,type) VALUES
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AmazonLocale','US','Utilisé pour définir la localisation des web
> services Amazon','US|CA|DE|FR|JP|UK','Choice');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AWSAccessKeyID','','Voir :  http://aws.amazon.com','','free');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AmazonAssocTag', '', 'Voir :
> associates.amazon.com/gp/flex/associates/apply-login.html', '', '');
> -INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AnonSuggestions', '0', 'Attribuée au n° de l''emprunteur anonyme
> pour activer les suggestions anonymes. 0, pas de suggestions anonymes.', '',
> 'free');
> +INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AnonSuggestions',0,'Set to enable Anonymous suggestions to
> AnonymousPatron borrowernumber',NULL,'YesNo');
> +INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AnonymousPatron', '0', 'Set the identifier (borrowernumber) of the
> anonymous patron. Used for Suggestion and reading history privacy',NULL,'');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('Babeltheque',0,'Active les contenus Babelthèque - Voir
> babeltheque.com pour s''abonner','','YesNo');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('authoritysep', '--', 'Le séparateur utilisé dans les autorités.
> Habituellement --', '10', 'free');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('autoBarcode', 'OFF', 'Utilisé pour générer automatiquement les codes
> barre: incremental sera de la forme 1, 2, 3; annual de la forme 2007-0001,
> 2007-0002, hbyymmincr de la forme HB09010001 où HB=la branche
> d''appartenance', 'incremental|annual|hbyymmincr|OFF', 'Choice');
> @@ -91,6 +92,7 @@ INSERT INTO `systempreferences`
> (variable,value,explanation,options,type) VALUES
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('OpacMainUserBlock','Bienvenue dans Koha...\r\n<hr>','Bloc HTML
> défini par la bibliothèque, qui apparaît sur la page principale de
> l''OPAC','70|10','Textarea');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('OpacNav', '', 'Ce paramètre contient du code HTML, qui est mis au
> début de la barre de navigation, sur la gauche, à l''OPAC.','70|10',
>  'Textarea');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('OpacPasswordChange', '1', 'Si ce paramètre est activé, les adhérents
> peuvent modifier leur mot de passe à l''OPAC. A désactiver si vous utilisez
> l''authentification ldap', '', 'YesNo');
> +INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('OpacPrivacy', '0', 'if ON, allows patrons to define their privacy
> rules (reading history)',NULL,'YesNo');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('opacreadinghistory', '1', 'Si ce paramètre est activé, les adhérents
> peuvent consulter leur historique de lecture à l''OPAC', '', 'YesNo');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('opacsmallimage', '', 'Ce paramètre contient une URL. Il permet de
> définir l''image qui est affichée en haut, à gauche de l''OPAC', '',
> 'free');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('opacstylesheet', '', 'Ce paramètre a la forme d''une URL. Il définit
> la feuille de style utilisée à l''OPAC. S''il est vide, vous aurez la
> feuille de style par défault de Koha', '', 'free');
> diff --git a/installer/data/mysql/it-IT/necessari/sysprefs.sql
> b/installer/data/mysql/it-IT/necessari/sysprefs.sql
> index 06f279d..cc00e68 100644
> --- a/installer/data/mysql/it-IT/necessari/sysprefs.sql
> +++ b/installer/data/mysql/it-IT/necessari/sysprefs.sql
> @@ -9,6 +9,7 @@ insert into `systempreferences` (`variable`, `value`,
> `options`, `explanation`,
>  insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('advancedMARCeditor','0','','Se su ON, nel
> MARC editor non verranno visualizzati i campi/sottocampi delle
> descrizioni.','YesNo');
>  insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`)
> values('AdvancedSearchTypes','itemtypes','itemtypes|ccode','Selezionare
> quale set di campi comprenderà la ricerca avanzata per tipo.','Choice');
>  insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('AllowHoldsOnDamagedItems','1','','Permette
> l\'inserimento di richieste di prenotazione su copie danneggiate','YesNo');
> +insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('AllowNotForLoanOverride','0','','Se ON,
> abilita il bibliotecario a poter scegliere di dare in prestito un documento
> normalmente escluso.','YesNo');
>  insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('AllowOnShelfHolds','1','','Permette di
> inserire prenotazioni su documenti non in prestito.','YesNo');
>  insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('AllowRenewalLimitOverride','1','','Se On,
> permette che i limiti ai rinnovi possano essere superati dal bibliotecario
> nel modulo della circolazione','YesNo');
>  insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('AmazonAssocTag','','','See:
> http://aws.amazon.com','free');
> @@ -17,7 +18,9 @@ insert into `systempreferences` (`variable`, `value`,
> `options`, `explanation`,
>  insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('AmazonLocale','US','US|CA|DE|FR|JP|UK','Usalo
> per definire il tuo specifico Amazon.com Web Services','Choice');
>  insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('AmazonReviews','0','','Visualizza Amazon
> reviews sull\'interfaccia dello staff.','YesNo');
>  insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('AmazonSimilarItems','0','','Messa su ON
> attiva l\' Amazon Similar Items feature  - Devi settare i valori in
>  AWSAccessKeyID e in AmazonAssocTag per usarla','YesNo');
> -insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('AnonSuggestions','0','','Imposta un utente
> anonimo per abilitare i suggerimenti d\'acquisto da utenti non
> registrati.','free');
> +INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AnonSuggestions',0,'Set to enable Anonymous suggestions to
> AnonymousPatron borrowernumber',NULL,'YesNo');
> +INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AnonymousPatron', '0', 'Set the identifier (borrowernumber) of the
> anonymous patron. Used for Suggestion and reading history privacy',NULL,'');
> +insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('AuthDisplayHierarchy','0','','Se ON attiva la
> gestione gerarchica dell\'authority. Da usare solo con thesaurus','YesNo');
>  insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('authoritysep','--','10','Carattere usato
> nella visualizzazione come separatore della lista delle authority.
> Normalmente è --','free');
>  insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`)
> values('autoBarcode','annual','incremental|annual|hbyymmincr|OFF','Da usare
> per impostare la generazione automatica dei barcode: incremental per la
> tipologia 1, 2, 3; annuale per 2007-0001, 2007-0002; hbyymmincr per
> HB08010001 dove HB sta per Home Branch (sottobiblioteca
> predefinita)','Choice');
>  insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('AutoEmailOpacUser','0','','Quando viene
> creato un account, invia notifica via email all\'utente con i dettagli del
> nuovo account.','YesNo');
> @@ -89,10 +92,12 @@ insert into `systempreferences` (`variable`, `value`,
> `options`, `explanation`,
>  -- insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`)
> values('marcflavour','UNIMARC','MARC21|UNIMARC','Define global MARC flavor
> (MARC21 or UNIMARC) used for character encoding','Choice');
>  insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('MARCOrgCode','0','','Il MARC Organization
> Code - http://www.loc.gov/marc/organizations/orgshome.html','free');
>  insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('MaxFine','9999','','Multa massima che un
> utente potrebbe avere per un singolo ritardo.','Integer');
> +insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('maxItemsInSearchResults','20','','Specifica
> il numero massimo di copie visualizzate nelle pagine di risultati','free');
>  insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('maxoutstanding','5','','Definisci il numero
> massimo di operazioni in corso (prestiti+prenotazioni) dopo il quale si
> blocca la possibilità di fare prenotazioni','Integer');
>  insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('maxreserves','2','','Definisce il numero
> massimo di prenotazioni che un utente può effettuare.','Integer');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('maxItemsInSearchResults',20,'Specify the maximum number of items to
> display for each result on a page of results',NULL,'free');
>  insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('memberofinstitution','0','','Se ON, gli
> utenti possono essere linkati alle istituzioni.','YesNo');
> +insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('MergeAuthoritiesOnUpdate','1','','Se ON,
> aggiornando le authorities saranno automaticamente aggiornati anche i record
> bibliografici','YesNo');
>  insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('minPasswordLength','3','','Specifica la
> lunghezza minima della password sia per l\'utente che per lo staff','free');
>  insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('noissuescharge','5','','Definisce l’ammontare
> massimo di multa che un utente può raggiungere prima di venir sospeso dal
> prestito','Integer');
>  insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('noItemTypeImages','0','','Se Attivo,
> disabilita le immagini relative al tipo documento','YesNo');
> @@ -130,6 +135,7 @@ insert into `systempreferences` (`variable`, `value`,
> `options`, `explanation`,
>  insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('OPACNoResultsFound','','Display this HTML
> when no results are found for a search in the OPAC','70|10','Textarea');
>  insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('OPACnumSearchResults','20','','Specifica il
> numero massimo di risposte da visualizzare nella pagina dei risultati
> ','Integer');
>  insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('OpacPasswordChange','1','','Se ON, abilita
> l\'utente alla modifica della password nell\'OPAC (disabiltare la funzione
> quando è usato LDAP auth)','YesNo');
> +INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('OpacPrivacy', '0', 'if ON, allows patrons to define their privacy
> rules (reading history)',NULL,'YesNo');
>  insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('opacreadinghistory','1','','Se ON, si abilita
> la visualizzazione dello storico circolazione utente nell\'OPAC','YesNo');
>  insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('OpacRenewalAllowed','0','','Se ON, gli utenti
> possono rinnovare i propri prestiti direttamente dal proprio account
> OPAC','YesNo');
>  insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('OPACShelfBrowser','0','','Abilita/disabilita
> una ricerca per scaffale (Shelf Browser) nella pagina dettagli documento.
> ATTENZIONE: questa feature consuma molte risorse nelle collezioni molto
> grandi.','YesNo');
> @@ -153,6 +159,7 @@ insert into `systempreferences` (`variable`, `value`,
> `options`, `explanation`,
>  insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('QueryStemming','0','','Se ON, abilita le
> ricerche con lo stemming (uso di forme variabili)','YesNo');
>  insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('QueryWeightFields','0','','Se ON, abilita le
> opzioni di ricerca per dare uno peso diverso ai vari campi. Opzione
> sperimentale','YesNo');
>  insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('RandomizeHoldsQueueWeight','0','','Se ON, la
> coda delle prenotazione nella circolazione avrà un ordine casuale per tutte
> le collocazioni o solo per quelle collocazioni specificate sotto
> StaticHoldsQueueWeight, se impostato.','YesNo');
> +insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('ReceiveBackIssues','5','','Numero di
> periodici precedenti da visualizzare quando si guarda il dettaglio di una
> sottoscrizione','');
>  insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`)
> values('RenewalPeriodBase','date_due','date_due|now','Per impostare se la
> data di rinnovo deve essere conteggiata a partire dalla data di scadenza del
> prestito o a partire dal momento in cui l’utente ne chiede il
> rinnovo.','Choice');
>  insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('RenewSerialAddsSuggestion','0','','Se ON,
> puoi aggiungere un nuovo suggerimento durante il rinnovo di un
> periodico','YesNo');
>  insert into `systempreferences` (`variable`, `value`, `options`,
> `explanation`, `type`) values('RequestOnOpac','1','','Se ON, si abilitano
> gli utenti globalmente a inserire prenotazione nell\'OPAC','YesNo');
> diff --git a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql
> b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql
> index c87729c..8689c4c 100644
> --- a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql
> +++ b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql
> @@ -9,7 +9,8 @@ INSERT INTO `systempreferences`
> (variable,value,explanation,options,type) VALUES
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AmazonLocale','US','Use to set the Locale of your Amazon.com Web
> Services','US|CA|DE|FR|JP|UK','Choice');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AWSAccessKeyID','','See:  http://aws.amazon.com','','free');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AmazonAssocTag','','See:  http://aws.amazon.com','','free');
> -INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AnonSuggestions',0,'Set to anonymous borrowernumber to enable
> Anonymous suggestions',NULL,'free');
> +INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AnonSuggestions',0,'Set to enable Anonymous suggestions to
> AnonymousPatron borrowernumber',NULL,'YesNo');
> +INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AnonymousPatron', '0', 'Set the identifier (borrowernumber) of the
> anonymous patron. Used for Suggestion and reading history privacy',NULL,'');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('Babeltheque',0,'Turn ON Babeltheque content  - See babeltheque.comto subscribe to this service','','YesNo');
>
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('authoritysep','--','Used to separate a list of authorities in a
> display. Usually --',10,'free');
> @@ -78,6 +79,7 @@ INSERT INTO `systempreferences`
> (variable,value,explanation,options,type) VALUES
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('OpacMainUserBlock','Welcome to Koha...\r\n<hr>','A user-defined
> block of HTML  in the main content area of the opac main
> page','70|10','Textarea');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('OpacNav','Important links here.','Use HTML tags to add navigational
> links to the left-hand navigational bar in OPAC','70|10','Textarea');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('OpacPasswordChange',1,'If ON, enables patron-initiated password
> change in OPAC (disable it when using LDAP auth)',NULL,'YesNo');
> +INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('OpacPrivacy', '0', 'if ON, allows patrons to define their privacy
> rules (reading history)',NULL,'YesNo');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('opacreadinghistory',1,'If ON, enables display of Patron Circulation
> History in OPAC','','YesNo');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('opacsmallimage','','Enter a complete URL to an image to replace the
> default Koha logo','','free');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('opacstylesheet','','Enter a complete URL to use an alternate layout
> stylesheet in OPAC','','free');
> diff --git
> a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql
> b/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql
> index 993c6c3..c862e60 100644
> ---
> a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql
> +++
> b/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql
> @@ -24,7 +24,8 @@ INSERT INTO `systempreferences`
> (variable,value,explanation,options,type) VALUES
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AmazonLocale','US','Use to set the Locale of your Amazon.com Web
> Services','US|CA|DE|FR|JP|UK','Choice');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AWSAccessKeyID','','See:  http://aws.amazon.com','','free');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AmazonAssocTag','','See:  http://aws.amazon.com','','free');
> -INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AnonSuggestions',0,'Set to anonymous borrowernumber to enable
> Anonymous suggestions',NULL,'free');
> +INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AnonSuggestions',0,'Set to enable Anonymous suggestions to
> AnonymousPatron borrowernumber',NULL,'YesNo');
> +INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AnonymousPatron', '0', 'Set the identifier (borrowernumber) of the
> anonymous patron. Used for Suggestion and reading history privacy',NULL,'');
>
>
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('authoritysep','--','Used to separate a list of authorities in a
> display. Usually --',10,'free');
> @@ -107,6 +108,7 @@ INSERT INTO `systempreferences`
> (variable,value,explanation,options,type) VALUES
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('OpacMainUserBlock','Добро пожаловать в АБИС Koha...\r\n<hr>','A
> user-defined block of HTML  in the main content area of the opac main
> page','50|20','Textarea');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('OpacNav','Здесь будут важные ссылки.','Use HTML tags to add
> navigational links to the left-hand navigational bar in
> OPAC','70|10','Textarea');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('OpacPasswordChange',1,'If ON, enables patron-initiated password
> change in OPAC (disable it when using LDAP auth)',NULL,'YesNo');
> +INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('OpacPrivacy', '0', 'if ON, allows patrons to define their privacy
> rules (reading history)',NULL,'YesNo');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('opacreadinghistory',1,'If ON, enables display of Patron Circulation
> History in OPAC','','YesNo');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('opacsmallimage','','Enter a complete URL to an image to replace the
> default Koha logo','','free');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('opacstylesheet','','Enter a complete URL to use an alternate layout
> stylesheet in OPAC','','free');
> diff --git
> a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql
> b/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql
> index 3416b2e..82e285b 100644
> ---
> a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql
> +++
> b/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql
> @@ -24,8 +24,8 @@ INSERT INTO `systempreferences`
> (variable,value,explanation,options,type) VALUES
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AmazonLocale','US','Use to set the Locale of your Amazon.com Web
> Services','US|CA|DE|FR|JP|UK','Choice');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AWSAccessKeyID','','See:  http://aws.amazon.com','','free');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AmazonAssocTag','','See:  http://aws.amazon.com','','free');
> -INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AnonSuggestions',0,'Set to anonymous borrowernumber to enable
> Anonymous suggestions',NULL,'free');
> -
> +INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AnonSuggestions',0,'Set to enable Anonymous suggestions to
> AnonymousPatron borrowernumber',NULL,'YesNo');
> +INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('AnonymousPatron', '0', 'Set the identifier (borrowernumber) of the
> anonymous patron. Used for Suggestion and reading history privacy',NULL,'');
>
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('authoritysep','--','Used to separate a list of authorities in a
> display. Usually --',10,'free');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('autoBarcode','incremental','Used to autogenerate a barcode:
> incremental will be of the form 1, 2, 3; annual of the form 2007-0001,
> 2007-0002; hbyymmincr of the form HB08010001 where HB=Home
> Branch','incremental|annual|hbyymmincr|OFF','Choice');
> @@ -107,6 +107,7 @@ INSERT INTO `systempreferences`
> (variable,value,explanation,options,type) VALUES
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('OpacMainUserBlock','Вітаємо у АБІС Koha...\r\n<hr>','A user-defined
> block of HTML  in the main content area of the opac main
> page','50|20','Textarea');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('OpacNav','Тут будуть важливі посилання.','Use HTML tags to add
> navigational links to the left-hand navigational bar in
> OPAC','70|10','Textarea');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('OpacPasswordChange',1,'If ON, enables patron-initiated password
> change in OPAC (disable it when using LDAP auth)',NULL,'YesNo');
> +INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('OpacPrivacy', '0', 'if ON, allows patrons to define their privacy
> rules (reading history)',NULL,'YesNo');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('opacreadinghistory',1,'If ON, enables display of Patron Circulation
> History in OPAC','','YesNo');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('opacsmallimage','','Enter a complete URL to an image to replace the
> default Koha logo','','free');
>  INSERT INTO `systempreferences` (variable,value,explanation,options,type)
> VALUES('opacstylesheet','','Enter a complete URL to use an alternate layout
> stylesheet in OPAC','','free');
> diff --git a/installer/data/mysql/updatedatabase.plb/installer/data/mysql/
> updatedatabase.pl
> index f03f48f..2d89b02 100755
> --- a/installer/data/mysql/updatedatabase.pl
> +++ b/installer/data/mysql/updatedatabase.pl
> @@ -3970,6 +3970,16 @@ if (C4::Context->preference("Version") <
> TransformToNum($DBversion)) {
>     SetVersion ($DBversion);
>  }
>
> +$DBversion = '3.03.00.xxx';
> +if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
> +    # reimplement OpacPrivacy system preference
> +    $dbh->do("INSERT INTO systempreferences
> (variable,value,explanation,options,type) VALUES('OpacPrivacy', '0', 'if ON,
> allows patrons to define their privacy rules (reading
> history)',NULL,'YesNo')");
> +    $dbh->do("ALTER TABLE `borrowers` ADD `privacy` INTEGER NOT NULL
> DEFAULT 1;");
> +    $dbh->do("ALTER TABLE `deletedborrowers` ADD `privacy` INTEGER NOT
> NULL DEFAULT 1;");
> +    print "Upgrade to $DBversion done (OpacPrivacy reimplementation)\n";
> +    SetVersion($DBversion);
> +};
> +
>  =head1 FUNCTIONS
>
>  =head2 DropAllForeignKeys($table)
> diff --git
> a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
> b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
> index 8707c25..3014e63 100644
> --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
> +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
> @@ -202,12 +202,6 @@ OPAC:
>                   no: "Don't allow"
>             - patrons to store items in a temporary "Cart" on the OPAC.
>         -
> -            - pref: opacreadinghistory
> -              choices:
> -                  yes: Allow
> -                  no: "Don't allow"
> -            - patrons to see what books they have checked out in the past.
> -        -
>             - pref: OpacTopissue
>               choices:
>                   yes: Allow
> @@ -245,12 +239,6 @@ OPAC:
>                   yes: Limit
>                   no: "Don't limit"
>             - "patrons' searches to the library they are registered at."
> -        -
> -            - pref: AnonSuggestions
> -              choices:
> -                  yes: Allow
> -                  no: "Don't allow"
> -            - "patrons that aren't logged in to make purchase
> suggestions."
>  #        -
>  #            This system preference does not actually affect anything
>  #            - pref: OpacBrowser
> @@ -288,12 +276,37 @@ OPAC:
>             - purchase suggestions from other patrons on the OPAC.
>     Privacy:
>         -
> +            - pref: AnonSuggestions
> +              choices:
> +                  yes: Allow
> +                  no: "Don't allow"
> +            - "patrons that aren't logged in to make purchase suggestions.
> Suggestions are connected to the AnonymousPatron syspref"
> +        -
> +            - pref: opacreadinghistory
> +              choices:
> +                  yes: Allow
> +                  no: "Don't allow"
> +            - patrons to see what books they have checked out in the past.
> +        -
>             - pref: EnableOpacSearchHistory
>               default: 0
>               choices:
>                   yes: Keep
>                   no: "Don't keep"
>             - patron search history in the OPAC.
> +        -
> +            - pref: OPACPrivacy
> +              default: 0
> +              choices:
> +                  yes: Allow
> +                  no: "Don't allow"
> +            - patrons to choose their own privacy settings for their
> reading history.  This requires opacreadinghistory and AnonymousPatron
> +        -
> +            - Use borrowernumber
> +            - pref: AnonymousPatron
> +              class: integer
> +            - as the Anonymous Patron (for anonymous suggestions and
> reading history)
> +
>     Shelf Browser:
>         -
>             - pref: OPACShelfBrowser
> diff --git
> a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl
> b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl
> index 030c78a..2cdc13a 100644
> --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl
> +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tmpl
> @@ -320,6 +320,11 @@ function validate1(date) {
>
>     <li><span class="label">Library: </span><!-- TMPL_VAR NAME="branchname"
> --></li>
>
> +    <!-- TMPL_IF NAME="OPACPrivacy" --><li><span class="label">Privacy
> Pref:</span>
> +         <!-- TMPL_IF NAME="privacy0" -->Forever<!-- /TMPL_IF -->
> +         <!-- TMPL_IF NAME="privacy1" -->Default<!-- /TMPL_IF -->
> +         <!-- TMPL_IF NAME="privacy2" -->Never<!-- /TMPL_IF -->
> +    </li><!-- /TMPL_IF -->
>     <!-- TMPL_IF NAME="sort1" --><li><span class="label">Sort field
> 1:</span><!-- TMPL_VAR NAME="lib1" --></li><!-- /TMPL_IF -->
>     <!-- TMPL_IF NAME="sort2" --><li><span class="label">Sort field
> 2:</span><!-- TMPL_VAR NAME="lib2" --></li><!-- /TMPL_IF -->
>     <li><span class="label">OPAC login: </span><!-- TMPL_VAR name="userid"
> --></li>
> diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc
> b/koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc
> index b9e4f74..86ba2f6 100644
> --- a/koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc
> +++ b/koha-tmpl/opac-tmpl/prog/en/includes/usermenu.inc
> @@ -17,6 +17,9 @@
>   <!-- /TMPL_IF -->
>   <!-- TMPL_IF NAME="opacreadinghistory" -->
>   <!-- TMPL_IF NAME="readingrecview" --><li class="active"><!-- TMPL_ELSE
> --><li><!-- /TMPL_IF --><a href="/cgi-bin/koha/opac-readingrecord.pl">my
> reading history</a></li>
> +     <!-- TMPL_IF NAME="OPACPrivacy" -->
> +       <!-- TMPL_IF NAME="privacyview" --><li class="active"><!--
> TMPL_ELSE --><li><!-- /TMPL_IF --><a href="/cgi-bin/koha/opac-privacy.pl">my
> privacy</a></li>
> +     <!-- /TMPL_IF -->
>   <!-- /TMPL_IF -->
>   <!-- TMPL_IF name="suggestion" -->
>     <!-- TMPL_UNLESS NAME="AnonSuggestions" -->
> diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-privacy.tmpl
> b/koha-tmpl/opac-tmpl/prog/en/modules/opac-privacy.tmpl
> new file mode 100644
> index 0000000..92c8973
> --- /dev/null
> +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-privacy.tmpl
> @@ -0,0 +1,72 @@
> +<!-- TMPL_INCLUDE name="doc-head-open.inc" --><!-- TMPL_IF
> NAME="LibraryNameTitle" --><!-- TMPL_VAR NAME="LibraryNameTitle" --><!--
> TMPL_ELSE -->Koha Online<!-- /TMPL_IF --> Catalog &rsaquo; Privacy
> management for <!-- TMPL_VAR name="firstname" --> <!-- TMPL_VAR
> name="surname" -->
> +<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
> +</head>
> +<body>
> +<div id="doc3" class="yui-t1">
> +   <div id="bd">
> +<!-- TMPL_INCLUDE name="masthead.inc" -->
> +
> +       <div id="yui-main">
> +       <div class="yui-b"><div class="yui-g">
> +       <div class="container">
> +       <h3><a href="/cgi-bin/koha/opac-user.pl"><!-- TMPL_VAR
> NAME="firstname" --> <!-- TMPL_VAR NAME="surname" -->'s account</a> <img
> src="<!-- TMPL_VAR NAME="themelang" -->l../../images/caret.gif" width="16"
> height="16" alt="&gt;" border="0" /> Privacy policy </h3>
> +
> +    <!-- TMPL_IF name="deleted" -->
> +        <div class="dialog message">Your reading history has been
> deleted.</div>
> +    <!-- /TMPL_IF -->
> +    <!-- TMPL_IF NAME= "privacy_updated" -->
> +        <div class="dialog message">Your privacy rules have been
> updated</div>
> +    <!-- /TMPL_IF -->
> +
> +    <h2>Privacy rule</h2>
> +    <!-- TMPL_IF NAME= "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>
> +               <form action="/cgi-bin/koha/opac-privacy.pl" method="post"
> id="opac-privacy-update-form">
> +            <input type="hidden" name="op" value="update_privacy" />
> +            <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>
> +            <label for:"privacy">Please choose your privacy rule:</label>
> +            <select name="privacy">
> +                <!-- TMPL_IF name="privacy0" -->
> +                    <option value="0" selected="1"
> class="privacy0">Forever</option>
> +                <!-- TMPL_ELSE -->
> +                    <option value="0" class="privacy0">Forever</option>
> +                <!-- /TMPL_IF -->
> +                <!-- TMPL_IF name="privacy1" -->
> +                    <option value="1" selected="1"
> class="privacy1">Default</option>
> +                <!-- TMPL_ELSE -->
> +                    <option value="1" class="privacy1">Default</option>
> +                <!-- /TMPL_IF -->
> +                <!-- TMPL_IF name="privacy2" -->
> +                    <option value="2" selected="1"
> class="privacy2">Never</option>
> +                <!-- TMPL_ELSE -->
> +                    <option value="2" class="privacy2">Never</option>
> +                <!-- /TMPL_IF -->
> +            </select>
> +            <input type="Submit" value="Submit" />
> +        </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"
> onclick="return confirmDelete(_('Warning: Cannot be undone. Please confirm
> once again'));" />
> +        </form>
> +    <!-- /TMPL_IF -->
> +    </div>
> +</div>
> +</div>
> +</div>
> +<div class="yui-b">
> +<div class="container">
> +<!--TMPL_INCLUDE NAME="navigation.inc" -->
> +<!-- TMPL_INCLUDE name="usermenu.inc" -->
> +</div>
> +</div>
> +</div>
> +<!-- TMPL_INCLUDE NAME="opac-bottom.inc" -->
> diff --git a/members/moremember.pl b/members/moremember.pl
> index 7de3fb0..ac98e1e 100755
> --- a/members/moremember.pl
> +++ b/members/moremember.pl
> @@ -230,6 +230,12 @@ my $lib2 = &GetSortDetails( "Bsort2", $data->{'sort2'}
> );
>  $template->param( lib1 => $lib1 ) if ($lib1);
>  $template->param( lib2 => $lib2 ) if ($lib2);
>
> +# Show OPAC privacy preference is system preference is set
> +if ( C4::Context->preference('OPACPrivacy') ) {
> +    $template->param( OPACPrivacy => 1);
> +    $template->param( "privacy".$data->{'privacy'} => 1);
> +}
> +
>  # current issues
>  #
>  my $issue = GetPendingIssues($borrowernumber);
> diff --git a/opac/opac-privacy.pl b/opac/opac-privacy.pl
> new file mode 100755
> index 0000000..ca50560
> --- /dev/null
> +++ b/opac/opac-privacy.pl
> @@ -0,0 +1,68 @@
> +#!/usr/bin/perl
> +# This script lets the users change their privacy rules
> +#
> +# copyright 2009, BibLibre, paul.poulain at biblibre.com
> +#
> +# Koha is free software; you can redistribute it and/or modify it under
> the
> +# terms of the GNU General Public License as published by the Free
> Software
> +# Foundation; either version 2 of the License, or (at your option) any
> later
> +# version.
> +#
> +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
> +# WARRANTY; without even the implied warranty of MERCHANTABILITY or
> FITNESS FOR
> +# A PARTICULAR PURPOSE.  See the GNU General Public License for more
> details.
> +#
> +# You should have received a copy of the GNU General Public License along
> with
> +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple
> Place,
> +# Suite 330, Boston, MA  02111-1307 USA
> +
> +use strict;
> +use CGI;
> +
> +use C4::Auth;    # checkauth, getborrowernumber.
> +use C4::Context;
> +use C4::Circulation;
> +use C4::Members;
> +use C4::Output;
> +use C4::Dates;
> +
> +my $query = new CGI;
> +my $dbh   = C4::Context->dbh;
> +
> +my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
> +    {
> +        template_name   => "opac-privacy.tmpl",
> +        query           => $query,
> +        type            => "opac",
> +        authnotrequired => 0,
> +        flagsrequired   => { borrow => 1 },
> +        debug           => 1,
> +    }
> +);
> +
> +my $op = $query->param("op");
> +my $privacy = $query->param("privacy");
> +
> +if ($op eq "update_privacy")
> +{
> +    ModPrivacy($borrowernumber,$privacy);
> +    $template->param('privacy_updated' => 1);
> +}
> +if ($op eq "delete_record") {
> +    # delete all reading records for items returned
> +    # uses a hardcoded date ridiculously far in the future
> +    AnonymiseIssueHistory('2999-12-12',$borrowernumber);
> +    # confirm the user the deletion has been done
> +    $template->param('deleted' => 1);
> +}
> +# get borrower privacy ....
> +my ( $borr ) = GetMemberDetails( $borrowernumber );
> +
> +$template->param( 'Ask_data'       => '1',
> +                    'privacy'.$borr->{'privacy'} => 1,
> +                    'firstname' => $borr->{'firstname'},
> +                    'surname' => $borr->{'surname'},
> +                    'privacyview' => 1,
> +);
> +
> +output_html_with_http_headers $query, $cookie, $template->output;
> diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl
> index a2a6670..2f0dc36 100755
> --- a/opac/opac-suggestions.pl
> +++ b/opac/opac-suggestions.pl
> @@ -48,7 +48,7 @@ if ( C4::Context->preference("AnonSuggestions") ) {
>         }
>     );
>     if ( !$$suggestion{suggestedby} ) {
> -        $$suggestion{suggestedby} =
> C4::Context->preference("AnonSuggestions");
> +        $$suggestion{suggestedby} =
> C4::Context->preference("AnonymousPatron");
>     }
>  }
>  else {
> --
> 1.5.6.5
>
> _______________________________________________
> Koha-patches mailing list
> Koha-patches at lists.koha-community.org
> http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-patches
> website : http://www.koha-community.org/
> git : http://git.koha-community.org/
> bugs : http://bugs.koha-community.org/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: </pipermail/koha-patches/attachments/20110201/c0b34978/attachment-0001.htm>


More information about the Koha-patches mailing list