From 3b1817f6852c68f1e93b3505527cd97837f2907a Mon Sep 17 00:00:00 2001 From: Allen Reinmeyer Date: Fri, 5 Dec 2008 07:43:54 -0600 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 --- admin/systempreferences.pl | 1 + installer/data/mysql/en/mandatory/sysprefs.sql | 2 +- .../fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 6 ++++++ koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl | 6 ++++++ opac/opac-user.pl | 5 +++++ 6 files changed, 20 insertions(+), 1 deletion(-) diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl index ef53715412..f95aea50a0 100755 --- a/admin/systempreferences.pl +++ b/admin/systempreferences.pl @@ -267,6 +267,7 @@ my %tabsysprefs; $tabsysprefs{OPACViewOthersSuggestions}="OPAC"; $tabsysprefs{URLLinkText}="OPAC"; $tabsysprefs{OPACShelfBrowser}="OPAC"; + $tabsysprefs{OPACDisplayRequestPriority}="OPAC"; # OPAC $tabsysprefs{SearchMyLibraryFirst}="OPAC"; diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index 1f139106f8..3f54c6714e 100644 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -211,4 +211,4 @@ INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES -- FIXME: add FrameworksLoaded, noOPACUserLogin, ReadingHistory ? INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('SMSSendDriver','','','Sets which SMS::Send driver is used to send SMS messages.','free'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowRenewalLimitOverride', '0', 'if ON, allows renewal limits to be overridden on the circulation screen',NULL,'YesNo'); - +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 9f51c4c54d..5124a33552 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 @@ -211,4 +211,5 @@ INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES('OpacSuppression', '0', '', 'Turn ON the OPAC Suppression feature, requires further setup, ask your system administrator for details', 'YesNo'); INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ('SMSSendDriver','','','Détermine le pilote utilisé par SMS::Send pour envoyer des SMS.','free'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('AllowRenewalLimitOverride', '0', "S'il est activé, autorise le dépassement des limites du renouvellement sur la page de circulation",NULL,'YesNo'); +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 2fc8634c97..dd741b1ce2 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -2040,6 +2040,12 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = '3.01.00.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 8a0da8a164..6a754fd90d 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-user.tmpl @@ -303,6 +303,9 @@ $.tablesorter.addParser({ Title Placed On Pick Up Location + + Priority + Status Modify @@ -326,6 +329,9 @@ $.tablesorter.addParser({ + + + diff --git a/opac/opac-user.pl b/opac/opac-user.pl index 71b19b9383..dd690728d0 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 .... @@ -195,6 +196,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; @@ -202,6 +206,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