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

guillaume.hatt at enc.sorbonne.fr guillaume.hatt at enc.sorbonne.fr
Tue Apr 5 15:35:36 CEST 2011


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

This patch adds a new sys pref WaitingNotifyAtCheckin.

If ON librarian will be notified of waiting holds for this patron at this branch.

If OFF (default) not message will be shown.

Signed-off-by: Guillaume Hatt <guillaume.hatt at enc.sorbonne.fr>
---
 patchs/5922-3458.patch |  222 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 222 insertions(+), 0 deletions(-)
 create mode 100644 patchs/5922-3458.patch

diff --git a/patchs/5922-3458.patch b/patchs/5922-3458.patch
new file mode 100644
index 0000000..9259401
--- /dev/null
+++ b/patchs/5922-3458.patch
@@ -0,0 +1,222 @@
+From 1438439d37473c8041558f47f67d00c9de2bb438 Mon Sep 17 00:00:00 2001
+From: Katrin Fischer <Katrin.Fischer.83 at web.de>
+Date: Sat, 26 Mar 2011 22:27:06 +0100
+Subject: [PATCH] Bug 5922: Notify of waiting holds at checkin
+Content-Type: text/plain; charset="utf-8"
+
+This patch adds a new sys pref WaitingNotifyAtCheckin.
+
+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  |    3 ++-
+ installer/data/mysql/pl-PL/mandatory/sysprefs.sql  |    1 +
+ ...m_preferences_full_optimal_for_install_only.sql |    3 ++-
+ ...m_preferences_full_optimal_for_install_only.sql |    1 +
+ installer/data/mysql/updatedatabase.pl             |    6 ++++++
+ .../en/modules/admin/preferences/circulation.pref  |    6 ++++++
+ .../prog/en/modules/circ/returns.tmpl              |    8 ++++++++
+ kohaversion.pl                                     |    2 +-
+ 12 files changed, 47 insertions(+), 4 deletions(-)
+
+diff --git a/circ/returns.pl b/circ/returns.pl
+index 262c126..b83d17a 100755
+--- a/circ/returns.pl
++++ b/circ/returns.pl
+@@ -249,7 +249,23 @@ if ($barcode) {
+                 $template->param( fineborrowernumber => $borrower->{'borrowernumber'} );
+             }
+         }
+-
++        
++        if (C4::Context->preference("WaitingNotifyAtCheckin") ) {
++            #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 7b62465..0d45b53 100644
+--- a/installer/data/mysql/de-DE/mandatory/sysprefs.sql
++++ b/installer/data/mysql/de-DE/mandatory/sysprefs.sql
+@@ -34,6 +34,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('WaitingNotifyAtCheckin',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 cb06622..853cd16 100644
+--- a/installer/data/mysql/en/mandatory/sysprefs.sql
++++ b/installer/data/mysql/en/mandatory/sysprefs.sql
+@@ -34,6 +34,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('WaitingNotifyAtCheckin',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 68d78a0..46d4d63 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
+@@ -36,6 +36,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('WaitingNotifyAtCheckin',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 35116c1..fa40866 100644
+--- a/installer/data/mysql/it-IT/necessari/sysprefs.sql
++++ b/installer/data/mysql/it-IT/necessari/sysprefs.sql
+@@ -65,6 +65,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('WaitingNotifyAtCheckin',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');
+@@ -285,4 +286,4 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
+ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AllowPurchaseSuggestionBranchChoice', 0, 'Allow user to choose branch when making a purchase suggestion','1','YesNo');
+ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','','free');
+ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the Staff client','','free');
+-INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('TraceSubjectSubdivisions', '0', 'Create searches on all subdivisions for subject tracings.','1','YesNo');
+\ No newline at end of file
++INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('TraceSubjectSubdivisions', '0', 'Create searches on all subdivisions for subject tracings.','1','YesNo');
+diff --git a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql
+index 231e541..30f18c8 100644
+--- a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql
++++ b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql
+@@ -34,6 +34,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('WaitingNotifyAtCheckin',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 af69408..f6f2e26 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
+@@ -46,6 +46,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('WaitingNotifyAtCheckin',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');
+@@ -352,4 +353,4 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
+ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AllowPurchaseSuggestionBranchChoice', 0, 'Allow user to choose branch when making a purchase suggestion','1','YesNo');
+ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','','free');
+ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('IntranetFavicon','','Enter a complete URL to an image to replace the default Koha favicon on the Staff client','','free');
+-INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('TraceSubjectSubdivisions', '0', 'Create searches on all subdivisions for subject tracings.','1','YesNo');
+\ No newline at end of file
++INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('TraceSubjectSubdivisions', '0', 'Create searches on all subdivisions for subject tracings.','1','YesNo');
+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 a72e79a..049e1c0 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
+@@ -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('WaitingNotifyAtCheckin',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 23b5d67..a2bef31 100755
+--- a/installer/data/mysql/updatedatabase.pl
++++ b/installer/data/mysql/updatedatabase.pl
+@@ -4131,6 +4131,12 @@ $DBversion = '3.03.00.032';
+ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+     $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('TraceSubjectSubdivisions', 1, 'Create searches on all subdivisions for subject tracings.','1','YesNo')");
+     print "Upgrade to $DBversion done ( include subdivisions when generating subject tracing searches )\n";
++}
++
++$DBversion = "3.03.00.XXX";
++if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
++    $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('WaitingNotifyAtCheckin',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 WaitingNotifyAtCheckin)\n";
+     SetVersion ($DBversion);
+ }
+ 
+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 e0eac4d..2b15543 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
+@@ -67,6 +67,12 @@ Circulation:
+                   no: "Don't notify"
+             - librarians of overdue fines on the items they are checking in.
+         -
++            - pref: WaitingNotifyAtCheckin
++              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 3fbc4e1..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.032';
++    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
+
-- 
1.7.0.4



More information about the Koha-patches mailing list