From 634df1c76ce338afb7b8b6b4854c777bcc779dcc Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Wed, 19 Aug 2009 20:21:13 +1200 Subject: [PATCH] Bug 3539, Adding a systempreference to hide borrowers name on the catalogue detail page, and holds page Squashed commit of the following: commit e9dd6e1dee03fe3503f7995b57510f9edfe6b333 Author: Chris Cormack Date: Wed Aug 19 08:14:53 2009 +0000 Version number commit df3ee5473e79b760a91c62b96d7ce19229e0fd27 Author: Chris Cormack Date: Wed Aug 19 08:08:11 2009 +0000 French systempref commit c4b036e4e43947d7d1fb9f2e18e460788cb4e1ec Author: Chris Cormack Date: Wed Aug 19 00:25:33 2009 +0000 Code to update the database, and updating the sysprefs.sql commit f74b942c24d5e9c33a4ec0e5ac706a0e347eb1a7 Author: Chris Cormack Date: Tue Aug 18 02:07:22 2009 +0000 Now hides the name on the detail screen too commit 53c80dbef88e360a4bbb78ecff3a6ca6ec401398 Author: Chris Cormack Date: Tue Aug 18 01:35:19 2009 +0000 Allowing the librarians to choose to hide the borrowers name on holds Signed-off-by: Galen Charlton --- admin/systempreferences.pl | 2 ++ catalogue/detail.pl | 7 ++++++- installer/data/mysql/en/mandatory/sysprefs.sql | 1 + .../unimarc_standard_systemprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 7 +++++++ .../prog/en/modules/catalogue/detail.tmpl | 16 ++++++++++++++-- .../prog/en/modules/reserve/request.tmpl | 8 +++++++- kohaversion.pl | 2 +- reserve/request.pl | 7 +++++-- 9 files changed, 44 insertions(+), 7 deletions(-) diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl index a56229300d..222f96ce49 100755 --- a/admin/systempreferences.pl +++ b/admin/systempreferences.pl @@ -206,6 +206,8 @@ $tabsysprefs{AutoEmailOpacUser} = "Patrons"; $tabsysprefs{AutoEmailPrimaryAddress} = "Patrons"; $tabsysprefs{EnhancedMessagingPreferences} = "Patrons"; $tabsysprefs{'SMSSendDriver'} = 'Patrons'; +$tabsysprefs{HidePatronName} = "Patrons"; + # I18N/L10N $tabsysprefs{dateformat} = "I18N/L10N"; diff --git a/catalogue/detail.pl b/catalogue/detail.pl index a24031e66b..9c9ebe9647 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -155,6 +155,10 @@ foreach my $item (@items) { # checking for holds my ($reservedate,$reservedfor,$expectedAt) = GetReservesFromItemnumber($item->{itemnumber}); my $ItemBorrowerReserveInfo = GetMemberDetails( $reservedfor, 0); + + if (C4::Context->preference('HidePatronName')){ + $item->{'hidepatronname'} = 1; + } if ( defined $reservedate ) { $item->{backgroundcolor} = 'reserved'; @@ -162,7 +166,8 @@ foreach my $item (@items) { $item->{ReservedForBorrowernumber} = $reservedfor; $item->{ReservedForSurname} = $ItemBorrowerReserveInfo->{'surname'}; $item->{ReservedForFirstname} = $ItemBorrowerReserveInfo->{'firstname'}; - $item->{ExpectedAtLibrary} = $branches->{$expectedAt}{branchname}; + $item->{ExpectedAtLibrary} = $branches->{$expectedAt}{branchname}; + $item->{cardnumber} = $ItemBorrowerReserveInfo->{'cardnumber'}; } # Check the transit status diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index 64fcf159d5..6a1a248f0e 100644 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -255,3 +255,4 @@ INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanatio INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'InProcessingToShelvingCart', '0', '', 'If set, when any item with a location code of PROC is ''checked in'', it''s location code will be changed to CART.', 'YesNo'); INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'ReturnToShelvingCart', '0', '', 'If set, when any item is ''checked in'', it''s location code will be changed to CART.', 'YesNo'); INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'DisplayClearScreenButton', '0', '', 'If set to yes, a clear screen button will appear on the circulation page.', 'YesNo'); +INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('HidePatronName', '0', '', 'If this is switched on, patrons cardnumbers will be shown instead of their name on the holds and catalogue screens', 'YesNo'); 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 ed50a41287..9c6886aa8f 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 @@ -257,3 +257,4 @@ INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanatio INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'InProcessingToShelvingCart', '0', '', 'Si défini, quand un exemplaire avec localisation de PROC est renvoyé son code sera modifié pour CART.', 'YesNo'); INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'ReturnToShelvingCart', '0', '', 'Si défini, quand un exemplaire est renvoyé son code sera modifié pour CART.' 'YesNo'); INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ('DisplayClearScreenButton', '0', '', 'Cette option ajoute un bouton à la page de circulation pour effacer l\'écran', 'YesNo'); +INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('HidePatronName', '0', '', 'Active l''affichage du numéro des adhérents à la place de leur nom dans les pages de réservation et du catalogue.', 'YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index b70a141f46..6c861f79be 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -2528,6 +2528,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { print "Upgrade to $DBversion done (added DisplayClearScreenButton system preference)\n"; } +$DBversion = '3.01.00.045'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('HidePatronName', '0', '', 'If this is switched on, patrons cardnumbers will be shown instead of their name on the holds and catalogue screens', 'YesNo')"); + SetVersion ($DBversion); + print "Upgrade to $DBversion done (added a preference to hide the patrons name in the staff catalog)"; +} + =item DropAllForeignKeys($table) Drop all foreign keys of the table $table diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl index 4bacb77ae6..e330f7f50f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl @@ -200,7 +200,13 @@ function verify_images() { Checked out - to "> + to "> + + + + + + : due @@ -252,7 +258,13 @@ function verify_images() { On hold - for "> + for "> + + + + + + atexpected at diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl index 29187b9f08..094a4f40c5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tmpl @@ -552,7 +552,13 @@ function checkMultiHold() { - " > + " > + + + + + + diff --git a/kohaversion.pl b/kohaversion.pl index f5151fed4a..41c2a33ec4 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -10,7 +10,7 @@ use strict; sub kohaversion { - our $VERSION = '3.01.00.044'; + our $VERSION = '3.01.00.045'; # version needs to be set this way # so that it can be picked up by Makefile.PL # during install diff --git a/reserve/request.pl b/reserve/request.pl index 08ddd61867..2a744e334c 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -478,13 +478,16 @@ foreach my $biblionumber (@biblionumbers) { # get borrowers reserve info my $reserveborrowerinfo = GetMemberDetails( $res->{'borrowernumber'}, 0); - + if (C4::Context->preference('HidePatronName')){ + $reserve{'hidename'} = 1; + $reserve{'cardnumber'} = $reserveborrowerinfo->{'cardnumber'}; + } $reserve{'date'} = format_date( $res->{'reservedate'} ); $reserve{'borrowernumber'} = $res->{'borrowernumber'}; $reserve{'biblionumber'} = $res->{'biblionumber'}; $reserve{'borrowernumber'} = $res->{'borrowernumber'}; $reserve{'firstname'} = $reserveborrowerinfo->{'firstname'}; - $reserve{'surname'} = $reserveborrowerinfo->{'surname'}; + $reserve{'surname'} = $reserveborrowerinfo->{'surname'}; $reserve{'notes'} = $res->{'reservenotes'}; $reserve{'wait'} = ( ( defined $res->{'found'} and $res->{'found'} eq 'W' ) or ( $res->{'priority'} eq '0' ) ); -- 2.39.5