From 9b08808a502df56e6cda4fce1f8a44911ff14b11 Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Fri, 4 Sep 2009 15:52:09 +1200 Subject: [PATCH] Bug #2754 Show hold request priority in OPAC Code changes to display the priority level on holds in OPAC. Turned on/off based on System Preference. Database changes to systempreferences for both English and French Signed-off-by: Galen Charlton Fixed to work with 3.0.4 Conflicts: admin/systempreferences.pl installer/data/mysql/en/mandatory/sysprefs.sql installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql --- installer/data/mysql/en/mandatory/sysprefs.sql | 2 ++ .../fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql | 2 ++ installer/data/mysql/updatedatabase.pl | 6 ++++++ koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl | 6 ++++++ kohaversion.pl | 2 +- opac/opac-user.pl | 5 +++++ 6 files changed, 22 insertions(+), 1 deletion(-) diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index 4d41987c11..bf1375ff64 100644 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -213,3 +213,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('MergeAuthoritiesOnUpdate', '1', 'if ON, Updating authorities will automatically updates biblios',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowNotForLoanOverride', '0', 'if ON, enables the librarian to choose when they want to check out a notForLoan regular item',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RenewalPeriodBase', 'date_due', 'Set whether the renewal date should be counted from the date_due or from the moment the Patron asks for renewal ','date_due|now','Choice'); +INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('OPACDisplayRequestPriority','0','','Show patrons the priority level on holds in the OPAC','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 88815a01f9..1d92a02ee5 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 @@ -213,4 +213,6 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('MergeAuthoritiesOnUpdate', '0', 'Si Activé, met à jour toutes les notices bibliographiques afférentes dès la modification d''une autorité',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowNotForLoanOverride', '0', 'Si activé, permet au bibliothécaire de choisir de prêter tout de même un exemplaire normalement exclu du prêt',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RenewalPeriodBase', 'date_due', 'Permet de déterminer si la période de renouvellement doit être calculée sur la date de retour ou sur le jour du renouvellement','date_due|now','Choice'); +INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('OPACDisplayRequestPriority','0','','Afficher l\'ordre des réservation pour les adhérents à l\'opac','YesNo'); + diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index cba636a407..78c21d5c9c 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -2042,6 +2042,12 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = '3.00.04.004'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACDisplayRequestPriority','0','Show patrons the priority level on holds in the OPAC','','YesNo')"); + print "Upgrade to $DBversion done (added OPACDisplayRequestPriority system preference)\n"; + SetVersion ($DBversion); +} =item DropAllForeignKeys($table) Drop all foreign keys of the table $table diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl index 6771f37d28..31687aa9ea 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl @@ -304,6 +304,9 @@ $.tablesorter.addParser({ Title Placed On Pick Up Location + + Priority + Status Modify @@ -327,6 +330,9 @@ $.tablesorter.addParser({ + + + diff --git a/kohaversion.pl b/kohaversion.pl index 08410e10b3..bcfac8b445 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -10,7 +10,7 @@ use strict; sub kohaversion { - our $VERSION = '3.00.04.003'; + our $VERSION = '3.00.04.004'; # version needs to be set this way # so that it can be picked up by Makefile.PL # during install diff --git a/opac/opac-user.pl b/opac/opac-user.pl index 19a63be7f1..78ffe781c0 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -52,6 +52,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( } ); +my $OPACDisplayRequestPriority = (C4::Context->preference("OPACDisplayRequestPriority")) ? 1 : 0; my $patronupdate = $query->param('patronupdate'); # get borrower information .... @@ -196,6 +197,9 @@ foreach my $res (@reserves) { $res->{'branch'} = $branches->{ $res->{'branchcode'} }->{'branchname'}; my $biblioData = GetBiblioData($res->{'biblionumber'}); $res->{'reserves_title'} = $biblioData->{'title'}; + if ($OPACDisplayRequestPriority) { + $res->{'priority'} = '' if $res->{'priority'} eq '0'; + } } # use Data::Dumper; @@ -203,6 +207,7 @@ foreach my $res (@reserves) { $template->param( RESERVES => \@reserves ); $template->param( reserves_count => $#reserves+1 ); +$template->param( showpriority=>1 ) if $OPACDisplayRequestPriority; my @waiting; my $wcount = 0; -- 2.39.5