From 844f63f1f8704e7f02f9fb194e5dc7142a9f12b5 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 27 Jan 2010 14:53:41 +0000 Subject: [PATCH] Rotating Collections Fixes This patch does the following: * Fixes the typos in updatedatabase.pl ( updates colBranchcode to varchar(10) * Adds the rotating_collections template files that somehow were not committed * Adds a missing sub from RotatingCollections.pm that must been deleted by accident * Adds the neccessary hooks in returns.pl to warn that and item needs to be returned to the branch that currently holds the collection. Signed-off-by: Galen Charlton --- C4/RotatingCollections.pm | 28 ++++ circ/returns.pl | 11 ++ installer/data/mysql/updatedatabase.pl | 2 +- .../prog/en/modules/circ/returns.tmpl | 5 + .../rotating_collections/addItems.tmpl | 88 ++++++++++++ .../rotating_collections/editCollections.tmpl | 125 ++++++++++++++++++ .../rotatingCollections.tmpl | 47 +++++++ .../transferCollection.tmpl | 48 +++++++ 8 files changed, 353 insertions(+), 1 deletion(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/addItems.tmpl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/editCollections.tmpl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/rotatingCollections.tmpl create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/transferCollection.tmpl diff --git a/C4/RotatingCollections.pm b/C4/RotatingCollections.pm index 254453f88c..fd4532fbdd 100644 --- a/C4/RotatingCollections.pm +++ b/C4/RotatingCollections.pm @@ -406,6 +406,34 @@ sub TransferCollection { } +=item GetCollectionItemBranches + my ( $holdingBranch, $collectionBranch ) = GetCollectionItemBranches( $itemnumber ); +=cut +sub GetCollectionItemBranches { + my ( $itemnumber ) = @_; + + if ( ! $itemnumber ) { + return; + } + + my $dbh = C4::Context->dbh; + + my ( $sth, @results ); + $sth = $dbh->prepare("SELECT holdingbranch, colBranchcode FROM items, collections, collections_tracking + WHERE items.itemnumber = collections_tracking.itemnumber + AND collections.colId = collections_tracking.colId + AND items.itemnumber = ?"); + $sth->execute( $itemnumber ); + + my $row = $sth->fetchrow_hashref; + + $sth->finish; + + return ( + $$row{'holdingbranch'}, + $$row{'colBranchcode'}, + ); +} =item isItemInThisCollection $inCollection = isItemInThisCollection( $itemnumber, $colId ); diff --git a/circ/returns.pl b/circ/returns.pl index 1ed378b273..da2b574d1d 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -549,5 +549,16 @@ $template->param( overduecharges => $overduecharges, ); +my $itemnumber = GetItemnumberFromBarcode( $query->param('barcode') ); +if ( $itemnumber ) { + my ( $holdingBranch, $collectionBranch ) = GetCollectionItemBranches( $itemnumber ); + if ( ! ( $holdingBranch eq $collectionBranch ) ) { + $template->param( + collectionItemNeedsTransferred => 1, + collectionBranch => GetBranchName($collectionBranch), + ); + } +} + # actually print the page! output_html_with_http_headers $query, $cookie, $template->output; diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 9f4c14957b..6c23edec43 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -3340,7 +3340,7 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { $dbh->do(" INSERT INTO permissions (module_bit, code, description) VALUES ( 13, 'rotating_collections', 'Manage Rotating collections')" ); - print "Upgrade to $DBversion done (added collection and collection_tracking tables for rotataing collection functionnality)\n"; + print "Upgrade to $DBversion done (added collection and collection_tracking tables for rotating collections functionality)\n"; SetVersion ($DBversion); } $DBversion = "3.01.00.106"; 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 f1663a2923..bfd22bf5c6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tmpl @@ -56,6 +56,11 @@ function Dopop(link) {
+ + +
This item is part of a Rotating Collection and needs to be Transferred to
+ +

Cannot Check In

This item must be checked in at its home library. NOT CHECKED IN

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/addItems.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/addItems.tmpl new file mode 100644 index 0000000000..c70c94a517 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/addItems.tmpl @@ -0,0 +1,88 @@ + +Koha › Tools › Rotating Collections › Add/Remove Items + + + + + + + + +
+
+
+ +

Rotating Collections: Add/Remove Items

+ +
+
+ + +
Item with barcode '' Added Succesfully!
+ +
Failed to add item with barcode ''!
+
Reason:
+ + + + + +
Item with barcode '' Removed Succesfully!
+ +
Failed to remove item with barcode ''!
+
Reason:
+ + + +

Add Item to

+
+ +
+
+ + + + + + + " /> + + +
+ + checked > + +
+
+
+ +
+

Items In This Collection

+ + + + + + + + + + + + + + +
TitleCallnumberBarcode
+ + There are no Items in this Collection. + +
+ +
+
+ +
+ +
+
+ \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/editCollections.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/editCollections.tmpl new file mode 100644 index 0000000000..93055c7571 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/editCollections.tmpl @@ -0,0 +1,125 @@ + +Koha › Tools › Rotating Collections › Edit Collections + + + + + + + + +
+
+
+

Rotating Collections: Edit Collections

+ + + +
Collection '' Created Succesfully!
+ +
Collection '' Failed To Be Created!
+
Reason:
+ + + + + +
Collection Deleted Succesfully!
+ +
Collection Failed To Be Deleted!
+ + +--> + + + +
Collection '' Updated Succesfully!
+ +
Collection '' Failed To Be Updated!
+
Reason:
+ + + +
+ + + + + + + + + + + + + + + + + + +
TitleDescriptionHolding Library
">Edit">Delete
+ + There are no Collections currently defined. + +
+ +
+
+ + +

Edit Collection

+ +

Create New Collection

+ + +
+ + + " /> + + + + + + + + + + + + + + + + + + +
+ + + value="" /> +
+ + + value="" /> +
+ + + + + +
+
+
+ +
+
+ +
+ +
+
+ \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/rotatingCollections.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/rotatingCollections.tmpl new file mode 100644 index 0000000000..999e9142f9 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/rotatingCollections.tmpl @@ -0,0 +1,47 @@ + +Koha › Tools › Rotating Collections + + + + + + + + +
+
+
+ +

Rotating Collections

+
+ + + + + + + + + + + + + + + + + + +
TitleDescriptionCurrent LocationAdd/Remove ItemsTransfer Collection
">Add/Remove Items">Transfer Collection
+ + There are no Collections currently defined. + +
+ +
+
+ +
+
+
+ \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/transferCollection.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/transferCollection.tmpl new file mode 100644 index 0000000000..56f29e8258 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/transferCollection.tmpl @@ -0,0 +1,48 @@ + +Koha › Tools › Rotating Collections › Transfer Collection + + + + + + + +
+
+
+

Rotating Collections: Transfer Collection

+
+ +
Collection Transfered Successfully
+ + + +
Failed to Transfer Collection!
+
Reason:
+ + + + +
+
+ "> + + + + +
+
+ + +
+
+ +
+ +
+
+ -- 2.39.5