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 <galen.charlton@liblime.com>

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
This commit is contained in:
Chris Cormack 2009-09-04 15:52:09 +12:00
parent 40649f1daf
commit 9b08808a50
6 changed files with 22 additions and 1 deletions

View File

@ -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');

View File

@ -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');

View File

@ -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

View File

@ -304,6 +304,9 @@ $.tablesorter.addParser({
<th>Title</th>
<th>Placed On</th>
<th>Pick Up Location</th>
<!-- TMPL_IF NAME="showpriority" -->
<th>Priority</th>
<!-- /TMPL_IF -->
<th>Status</th>
<th>Modify</th>
</tr></thead>
@ -327,6 +330,9 @@ $.tablesorter.addParser({
</td>
<td><!-- TMPL_VAR NAME="reservedate" --></td>
<td><!-- TMPL_VAR NAME="branch" --></td>
<!-- TMPL_IF NAME="showpriority" -->
<td><!-- TMPL_VAR NAME="priority" --> </td>
<!-- /TMPL_IF -->
<td>
<!-- TMPL_IF NAME="wait" -->
<!-- TMPL_IF NAME="atdestination" -->

View File

@ -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

View File

@ -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;