[Koha-patches] [PATCH] Bug 5922: Notify of waiting holds at checkin

Chris Cormack chrisc at catalyst.net.nz
Sat Mar 26 23:18:23 CET 2011


I like the idea but can we change the name to WaitingNotifyAtCheckin. I keep thinking it will turn of all hold notifications.

Chris

Katrin Fischer <Katrin.Fischer.83 at web.de> wrote:

>This patch adds a new sys pref HoldNotifyAtCheckin.
>
>If ON librarian will be notified of waiting holds for this patron at this branch.
>
>If OFF (default) not message will be shown.
>---
> circ/returns.pl                                    |   18 +++++++++++++++++-
> installer/data/mysql/de-DE/mandatory/sysprefs.sql  |    1 +
> installer/data/mysql/en/mandatory/sysprefs.sql     |    1 +
> .../1-Obligatoire/unimarc_standard_systemprefs.sql |    1 +
> installer/data/mysql/it-IT/necessari/sysprefs.sql  |    1 +
> installer/data/mysql/pl-PL/mandatory/sysprefs.sql  |    1 +
> ...m_preferences_full_optimal_for_install_only.sql |    1 +
> ...m_preferences_full_optimal_for_install_only.sql |    1 +
> installer/data/mysql/updatedatabase.pl             |    7 +++++++
> .../en/modules/admin/preferences/circulation.pref  |    6 ++++++
> .../prog/en/modules/circ/returns.tmpl              |    8 ++++++++
> kohaversion.pl                                     |    2 +-
> 12 files changed, 46 insertions(+), 2 deletions(-)
>
>diff --git a/circ/returns.pl b/circ/returns.pl
>index 00a2ec2..3b8e3fc 100755
>--- a/circ/returns.pl
>+++ b/circ/returns.pl
>@@ -247,7 +247,23 @@ if ($barcode) {
>             $template->param( fines => sprintf("%.2f",$fines) );
>             $template->param( fineborrowernumber => $borrower->{'borrowernumber'} );
>         }
>-
>+        
>+        if ( C4::Context->preference("HoldNotifyAtCheckin") ) {     
>+            #Check for waiting holds
>+            my @reserves = GetReservesFromBorrowernumber($borrower->{'borrowernumber'});
>+            my $waiting_holds;          
>+            foreach my $num_res (@reserves) {
>+                if ( $num_res->{'found'} eq 'W' && $num_res->{'branchcode'} eq $userenv_branch) {
>+                    $waiting_holds++;
>+                }
>+            } 
>+            if ($waiting_holds > 0) {
>+                $template->param( 
>+                    waiting_holds       => $waiting_holds,
>+                    holdsborrowernumber => $borrower->{'borrowernumber'},
>+                );            
>+            }  
>+        }
>     }
>     elsif ( !$messages->{'BadBarcode'} ) {
>         $input{duedate}   = 0;
>diff --git a/installer/data/mysql/de-DE/mandatory/sysprefs.sql b/installer/data/mysql/de-DE/mandatory/sysprefs.sql
>index 3aa8644..1f38394 100644
>--- a/installer/data/mysql/de-DE/mandatory/sysprefs.sql
>+++ b/installer/data/mysql/de-DE/mandatory/sysprefs.sql
>@@ -33,6 +33,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FinesLog',1,'If ON, log fines',NULL,'YesNo');
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('hidelostitems',0,'If ON, disables display of\"lost\" items in OPAC.','','YesNo');
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('hide_marc',0,'If ON, disables display of MARC fields, subfield codes & indicators (still shows data)',NULL,'YesNo');
>+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('HoldNotifyAtCheckin',0,'If ON, notify librarians of waiting holds for the patron whose items they are checking in.',NULL,'YesNo');
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IndependantBranches',0,'If ON, increases security between libraries',NULL,'YesNo');
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('insecure',0,'If ON, bypasses all authentication. Be careful!',NULL,'YesNo');
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetBiblioDefaultView','normal','Choose the default detail view in the staff interface; choose between normal, labeled_marc, marc or isbd','normal|marc|isbd|labeled_marc','Choice');
>diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql
>index c56a9bb..e5e00da 100644
>--- a/installer/data/mysql/en/mandatory/sysprefs.sql
>+++ b/installer/data/mysql/en/mandatory/sysprefs.sql
>@@ -33,6 +33,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FinesLog',1,'If ON, log fines',NULL,'YesNo');
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('hidelostitems',0,'If ON, disables display of\"lost\" items in OPAC.','','YesNo');
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('hide_marc',0,'If ON, disables display of MARC fields, subfield codes & indicators (still shows data)',NULL,'YesNo');
>+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('HoldNotifyAtCheckin',0,'If ON, notify librarians of waiting holds for the patron whose items they are checking in.',NULL,'YesNo');
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IndependantBranches',0,'If ON, increases security between libraries',NULL,'YesNo');
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('insecure',0,'If ON, bypasses all authentication. Be careful!',NULL,'YesNo');
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetBiblioDefaultView','normal','Choose the default detail view in the staff interface; choose between normal, labeled_marc, marc or isbd','normal|marc|isbd|labeled_marc','Choice');
>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 d05b827..f52330b 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
>@@ -35,6 +35,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('gist', '0', 'Ce paramètre définit le taux de TVA. Attention : ce n''est pas un % mais un nombre (0.055 et pas 5.5%) Laisser à 0 si vous ne récupérez pas la TVA, ce qui est le cas de la plupart des bibliothèques françaises', '', 'Integer');
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('hidelostitems', '0', 'Si ce paramètre est activé, l''OPAC n''affichera pas les notices pour lesquelles le ou les exemplaires sont marqués "perdus"', '', 'YesNo');
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('hide_marc', '0', 'Si ce paramètre est positionné, les code des champs et sous-champs MARC sont cachés, on ne voit que les libellés.', '', 'YesNo');
>+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('HoldNotifyAtCheckin',0,'If ON, notify librarians of waiting holds for the patron whose items they are checking in.',NULL,'YesNo');
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IndependantBranches', '0', 'Si ce paramètre est à "Oui", chaque site est indépendant au niveau de ses acquisitions, de son catalogage, de l''inscription de ses lecteurs...', '', 'YesNo');
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('insecure', '0', 'Ce paramètre, s''il est positionné à "Oui", permet d''utiliser Koha sans mot de passe. A utiliser avec précaution. Devrait être à "Non" normalement', '', 'YesNo');
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('intranetcolorstylesheet', '', 'Ce paramètre permet de définir un jeu de couleur alternatif dans l''interface professionnelle', '50', 'free');
>diff --git a/installer/data/mysql/it-IT/necessari/sysprefs.sql b/installer/data/mysql/it-IT/necessari/sysprefs.sql
>index 40998fb..b918632 100644
>--- a/installer/data/mysql/it-IT/necessari/sysprefs.sql
>+++ b/installer/data/mysql/it-IT/necessari/sysprefs.sql
>@@ -64,6 +64,7 @@ insert into `systempreferences` (`variable`, `value`, `options`, `explanation`,
> insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('GoogleJackets','1','','Se ON, visualizza le copertine usando Google Books','YesNo');
> insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('hidelostitems','0','','Se ON, viene disabilitata la visualizzazione nell\'OPAC delle copie perse.','YesNo');
> insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('hide_marc','0','','Se su ON, disabilita la visualizzazione dei campi del MARC, codici di sottocampi e indicatori (mostra ancora i dati)','YesNo');
>+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('HoldNotifyAtCheckin',0,'If ON, notify librarians of waiting holds for the patron whose items they are checking in.',NULL,'YesNo');
> insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('HomeOrHoldingBranch','holdingbranch','holdingbranch|homebranch','Se IndependantBranches e\' settata su ON, allora il sitema legge questa variabile.  Se questa variabile e\' sul valore \'homebranch\' quando arriva una copia di un\'altra biblioteca si puo\' registare la restituzione dove la copia e\' arrivata. Se invece vale \'holdingbranch\', allora non si puo fare la restituzione ma solo prenderla e inviarla alla biblioteca di appartenenza; là verrà fatta la restituzione ','Choice');
> insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('IndependantBranches','0','','Se è ON, aumenta il livello di sicurezza tra le biblioteche','YesNo');
> insert into `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`) values('insecure','0','','Se è su ON, tutte le richieste di autenticazioni vengono aggirate. Attenzione!','YesNo');
>diff --git a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql
>index f13b3a0..a05a775 100644
>--- a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql
>+++ b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql
>@@ -33,6 +33,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FinesLog',1,'If ON, log fines',NULL,'YesNo');
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('hidelostitems',0,'If ON, disables display of\"lost\" items in OPAC.','','YesNo');
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('hide_marc',0,'If ON, disables display of MARC fields, subfield codes & indicators (still shows data)',NULL,'YesNo');
>+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('HoldNotifyAtCheckin',0,'If ON, notify librarians of waiting holds for the patron whose items they are checking in.',NULL,'YesNo');
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IndependantBranches',0,'If ON, increases security between libraries',NULL,'YesNo');
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('insecure',0,'If ON, bypasses all authentication. Be careful!',NULL,'YesNo');
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetBiblioDefaultView','normal','Choose the default detail view in the staff interface; choose between normal, labeled_marc, marc or isbd','normal|marc|isbd|labeled_marc','Choice');
>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 0ccb940..415cd01 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
>@@ -45,6 +45,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FinesLog',1,'If ON, log fines',NULL,'YesNo');
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('hidelostitems',0,'If ON, disables display of\"lost\" items in OPAC.','','YesNo');
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('hide_marc',0,'If ON, disables display of MARC fields, subfield codes & indicators (still shows data)',NULL,'YesNo');
>+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('HoldNotifyAtCheckin',0,'If ON, notify librarians of waiting holds for the patron whose items they are checking in.',NULL,'YesNo');
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IndependantBranches',0,'If ON, increases security between libraries',NULL,'YesNo');
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('insecure',0,'If ON, bypasses all authentication. Be careful!',NULL,'YesNo');
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetBiblioDefaultView','normal','IntranetBiblioDefaultView','normal|marc|isbd|labeled_marc','Choice');
>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 6cd0d40..7ab1bb5 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
>@@ -44,6 +44,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FinesLog',1,'If ON, log fines',NULL,'YesNo');
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('hidelostitems',0,'If ON, disables display of\"lost\" items in OPAC.','','YesNo');
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('hide_marc',0,'If ON, disables display of MARC fields, subfield codes & indicators (still shows data)',NULL,'YesNo');
>+INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('HoldNotifyAtCheckin',0,'If ON, notify librarians of waiting holds for the patron whose items they are checking in.',NULL,'YesNo');
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IndependantBranches',0,'If ON, increases security between libraries',NULL,'YesNo');
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('insecure',0,'If ON, bypasses all authentication. Be careful!',NULL,'YesNo');
> INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetBiblioDefaultView','normal','IntranetBiblioDefaultView','normal|marc|isbd|labeled_marc','Choice');
>diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl
>index 8395644..e590cd7 100755
>--- a/installer/data/mysql/updatedatabase.pl
>+++ b/installer/data/mysql/updatedatabase.pl
>@@ -4120,6 +4120,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
>     SetVersion ($DBversion);
> }
> 
>+$DBversion = "3.03.00.XXX";
>+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
>+    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('HoldNotifyAtCheckin',0,'If ON, notify librarians of waiting holds for the patron whose items they are checking in.',NULL,'YesNo');");
>+    print "Upgrade to $DBversion done (Add syspref HoldNotifyAtCheckin)\n";
>+    SetVersion ($DBversion);
>+}
>+
> =head1 FUNCTIONS
> 
> =head2 DropAllForeignKeys($table)
>diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref
>index 922e6a0..6903215 100644
>--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref
>+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref
>@@ -61,6 +61,12 @@ Circulation:
>               class: integer
>             - last returned items on the checkin screen.
>         -
>+            - pref: HoldNotifyAtCheckin
>+              choices:
>+                  yes: Notify
>+                  no: "Don't notify"
>+            - librarians of waiting holds for the patron whose items they are checking in.
>+        -
>             - pref: FilterBeforeOverdueReport
>               choices:
>                   yes: Require
>diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl
>index 724a3e9..879a006 100644
>--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl
>+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl
>@@ -66,6 +66,14 @@ function Dopop(link) {
>     </div>
> <!-- /TMPL_IF -->
> 
>+<!-- Patron has waiting holds -->
>+<!-- TMPL_IF NAME="waiting_holds" -->
>+    <div class="dialog alert">
>+        <h3>Patron has <!-- TMPL_VAR NAME="waiting_holds" --> hold(s) waiting for pickup.</h3>
>+        <p><a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=<!-- TMPL_VAR NAME="holdsborrowernumber" -->">Checkout holds</a>.</p>
>+    </div>
>+<!-- /TMPL_IF -->
>+
> 
> <!-- TMPL_IF NAME="wrongbranch" -->
> <div class="dialog alert"><h3>Cannot Check In</h3><p>This item must be checked in at its home library. <strong>NOT CHECKED IN</strong></p>
>diff --git a/kohaversion.pl b/kohaversion.pl
>index 8ac68df..8330459 100644
>--- a/kohaversion.pl
>+++ b/kohaversion.pl
>@@ -16,7 +16,7 @@ the kohaversion is divided in 4 parts :
> use strict;
> 
> sub kohaversion {
>-    our $VERSION = '3.03.00.030';
>+    our $VERSION = '3.03.00.XXX';
>     # version needs to be set this way
>     # so that it can be picked up by Makefile.PL
>     # during install
>-- 
>1.7.1
>
>_______________________________________________
>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/


More information about the Koha-patches mailing list