From f8b08ad6cfe5801cae6d4d8e93f3775e68e02821 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 9 Jul 2010 09:52:46 -0400 Subject: [PATCH] Fix for Bug 4950 - checkbox should be removed when can't place a hold - Hiding form controls for titles which can't be placed on hold - Highlighting hold blocked message for better visibility - Showing table of blocked holds even if none can be placed on hold: hiding the table hides the messages explaining why titles can't be placed on hold - Removing an unused line from the script which was leaving errors in the error log - Consolidating error messages into one box which were displaying in two. - Correcting link to unused opac-userdetails.pl --- koha-tmpl/opac-tmpl/prog/en/css/opac.css | 5 +- .../opac-tmpl/prog/en/modules/opac-reserve.tmpl | 366 ++++++++++---------- opac/opac-reserve.pl | 10 +- 3 files changed, 188 insertions(+), 193 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/css/opac.css b/koha-tmpl/opac-tmpl/prog/en/css/opac.css index 4c7d6ad..4e12660 100644 --- a/koha-tmpl/opac-tmpl/prog/en/css/opac.css +++ b/koha-tmpl/opac-tmpl/prog/en/css/opac.css @@ -1425,6 +1425,7 @@ div#changelanguage{ color : #666; font-size : 85%; padding : 1em; + margin-top : 2em; } div#changelanguage a { @@ -2005,4 +2006,6 @@ div.ft { #plainmarc table { border: 0; margin: .7em 0 0 0; font-family: monospace; font-size: 95%; } #plainmarc th { background-color : #FFF; border: 0; white-space: nowrap; text-align:left; vertical-align: top; padding: 2px; } -#plainmarc td { border: 0; padding : 2px; vertical-align: top; } \ No newline at end of file +#plainmarc td { border: 0; padding : 2px; vertical-align: top; } +div.bibmessage { background-color : #ffffb0; border-radius : 5px; padding : 3px; margin : 2px; } + diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl index 52ff4cd..b496e81 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl @@ -160,27 +160,23 @@
- - + -
- Sorry, you cannot place holds because the library doesn't have up-to-date contact information on file. -
-
Please contact your librarian, or use the online update form to submit current information (Please note: there may be a delay in restoring your account if you submit online) +
+

Sorry, you cannot place holds because the library doesn't have up-to-date contact information on file.

+

Please contact your librarian, or use the online update form to submit current information (Please note: there may be a delay in restoring your account if you submit online)

-
- Sorry, you cannot place holds because your library card has been marked as lost or stolen. -
-
If this is an error, please take your card to the circulation desk at your local library and the error will be corrected. +
+

Sorry, you cannot place holds because your library card has been marked as lost or stolen.

+

If this is an error, please take your card to the circulation desk at your local library and the error will be corrected.

-
- Sorry, you cannot place holds because your account has been frozen. -
-
Usually the reason for freezing an account is old overdues or damage fees. If your account page shows your account to be clear, please consult a librarian. +
+

Sorry, you cannot place holds because your account has been frozen.

+

Usually the reason for freezing an account is old overdues or damage fees. If your account page shows your account to be clear, please consult a librarian.

@@ -211,18 +207,18 @@
ERROR: Internal error: incomplete hold request.
+ -
Sorry, none of these items can be placed on hold. -
- +
Sorry, none of these items can be placed on hold. +
+ - -

Confirm holds for: - - () - -

+

Confirm holds for: + + () + +

@@ -232,8 +228,8 @@
- - + + @@ -251,12 +247,12 @@ - + - - + + - - - - - - + + + + - + - - - - - + + + + + - + - + "> @@ -521,18 +512,17 @@
Hold
Hold Title Item Type Pickup Location
Title
+ "/> "> @@ -269,175 +265,170 @@ - - "/> - "> - - " - name="" disabled="disabled" - id="" - value="any" /> - - +   + "> + , by + + +
You have already requested this title.
- - -
No available items.
-
This title cannot be requested.
+ +
No available items.
+ +
This title cannot be requested.
+ + + + +
- "> - , by - - - " alt="" /> - - - out of + " alt="" /> + + out of - " id="reserve_date_" size="10"> - - + " id="reserve_date_" size="10"> + + - " id="expiration_date_" size="10" readonly="readonly" /> - /lib/calendar/cal.gif" alt="Show Calendar" border="0" id="CalendarExpirationDate_" style="cursor: pointer;" /> - -

- ').value='';return false;">Clear Date

-
+ " id="expiration_date_" size="10" readonly="readonly" /> + /lib/calendar/cal.gif" alt="Show Calendar" border="0" id="CalendarExpirationDate_" style="cursor: pointer;" /> + +

+ ').value='';return false;">Clear Date

+
- - + +
+
- - - + + - + +
- -
diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index 699179b..fca1e0b 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -289,6 +289,7 @@ my $notforloan_label_of = get_notforloan_label_of(); my $biblioLoop = []; my $numBibsAvailable = 0; my $itemdata_enumchron = 0; +my $anyholdable; my $itemLevelTypes = C4::Context->preference('item-level_itypes'); $template->param('item-level_itypes' => $itemLevelTypes); @@ -336,8 +337,6 @@ foreach my $biblioNum (@biblionumbers) { } } - $biblioLoopIter{itemTypeDescription} = $itemTypes->{$biblioData->{itemtype}}{description}; - $biblioLoopIter{itemLoop} = []; my $numCopiesAvailable = 0; foreach my $itemInfo (@{$biblioData->{itemInfos}}) { @@ -455,19 +454,22 @@ foreach my $biblioNum (@biblionumbers) { $numBibsAvailable++; $biblioLoopIter{bib_available} = 1; $biblioLoopIter{holdable} = 1; + $anyholdable = 1; } if ($biblioLoopIter{already_reserved}) { $biblioLoopIter{holdable} = undef; + $anyholdable = undef; } if(not CanBookBeReserved($borrowernumber,$biblioNum)){ $biblioLoopIter{holdable} = undef; + $anyholdable = undef; } push @$biblioLoop, \%biblioLoopIter; } -if ( $numBibsAvailable == 0 ) { - $template->param( none_available => 1, message => 1 ); +if ( $numBibsAvailable == 0 || !$anyholdable) { + $template->param( none_available => 1 ); } my $itemTableColspan = 5; -- 1.7.3