Bugzilla – Attachment 33060 Details for
Bug 8836
Resurrect Rotating Collections
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8836 [QA Followup 2]
Bug-8836-QA-Followup-2.patch (text/plain), 34.63 KB, created by
Kyle M Hall (khall)
on 2014-10-31 13:09:47 UTC
(
hide
)
Description:
Bug 8836 [QA Followup 2]
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-10-31 13:09:47 UTC
Size:
34.63 KB
patch
obsolete
>From fd60a1e3b3966c16906e0ae5dd940f8fec7109f0 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 30 Oct 2014 06:58:42 -0400 >Subject: [PATCH] Bug 8836 [QA Followup 2] > >Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> >--- > C4/Circulation.pm | 2 +- > C4/RotatingCollections.pm | 37 ++-- > installer/data/mysql/updatedatabase.pl | 8 +- > .../intranet-tmpl/prog/en/includes/tools-menu.inc | 2 - > .../en/modules/rotating_collections/addItems.tt | 164 +++++++++------- > .../rotating_collections/editCollections.tt | 209 ++++++++++---------- > .../rotating_collections/rotatingCollections.tt | 81 +++++---- > .../rotating_collections/transferCollection.tt | 78 ++++---- > rotating_collections/addItems.pl | 4 +- > rotating_collections/editCollections.pl | 18 +- > 10 files changed, 315 insertions(+), 288 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index fa6a99d..aae3ba3 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1899,7 +1899,7 @@ sub AddReturn { > my ($datesent,$frombranch,$tobranch) = GetTransfers( $item->{'itemnumber'} ); > > # if we have a transfer to do, we update the line of transfers with the datearrived >- my $is_in_rotating_collection = 1 if C4::RotatingCollections::isItemInAnyCollection( $item->{'itemnumber'} ); >+ my $is_in_rotating_collection = C4::RotatingCollections::isItemInAnyCollection( $item->{'itemnumber'} ); > if ($datesent) { > if ( $tobranch eq $branch ) { > my $sth = C4::Context->dbh->prepare( >diff --git a/C4/RotatingCollections.pm b/C4/RotatingCollections.pm >index 5a63cd8..12d835d 100644 >--- a/C4/RotatingCollections.pm >+++ b/C4/RotatingCollections.pm >@@ -26,7 +26,7 @@ use Modern::Perl; > > use C4::Context; > use C4::Circulation; >-use C4::Reserves qw(GetReserveStatus); >+use C4::Reserves qw(CheckReserves); > > use DBI; > >@@ -86,10 +86,10 @@ sub CreateCollection { > > ## Check for all neccessary parameters > if ( !$title ) { >- return ( 0, 1, "No Title Given" ); >+ return ( 0, 1, "NO_TITLE" ); > } > if ( !$description ) { >- return ( 0, 2, "No Description Given" ); >+ return ( 0, 2, "NO_DESCRIPTION" ); > } > > my $success = 1; >@@ -130,13 +130,13 @@ sub UpdateCollection { > > ## Check for all neccessary parameters > if ( !$colId ) { >- return ( 0, 1, "No Id Given" ); >+ return ( 0, 1, "NO_ID" ); > } > if ( !$title ) { >- return ( 0, 2, "No Title Given" ); >+ return ( 0, 2, "NO_TITLE" ); > } > if ( !$description ) { >- return ( 0, 3, "No Description Given" ); >+ return ( 0, 3, "NO_DESCRIPTION" ); > } > > my $dbh = C4::Context->dbh; >@@ -175,7 +175,7 @@ sub DeleteCollection { > > ## Paramter check > if ( !$colId ) { >- return ( 0, 1, "No Collection Id Given" ); >+ return ( 0, 1, "NO_ID" ); > } > > my $dbh = C4::Context->dbh; >@@ -239,7 +239,7 @@ sub GetItemsInCollection { > > ## Paramter check > if ( !$colId ) { >- return ( 0, 0, 1, "No Collection Id Given" ); >+ return ( 0, 0, 1, "NO_ID" ); > } > > my $dbh = C4::Context->dbh; >@@ -317,17 +317,17 @@ sub AddItemToCollection { > > ## Check for all neccessary parameters > if ( !$colId ) { >- return ( 0, 1, "No Collection Given" ); >+ return ( 0, 1, "NO_ID" ); > } > if ( !$itemnumber ) { >- return ( 0, 2, "No Itemnumber Given" ); >+ return ( 0, 2, "NO_ITEM" ); > } > > if ( isItemInThisCollection( $itemnumber, $colId ) ) { >- return ( 0, 2, "Item is already in the collection!" ); >+ return ( 0, 2, "IN_COLLECTION" ); > } > elsif ( isItemInAnyCollection($itemnumber) ) { >- return ( 0, 3, "Item is already in a different collection!" ); >+ return ( 0, 3, "IN_COLLECTION_OTHER" ); > } > > my $dbh = C4::Context->dbh; >@@ -367,11 +367,11 @@ sub RemoveItemFromCollection { > > ## Check for all neccessary parameters > if ( !$itemnumber ) { >- return ( 0, 2, "No Itemnumber Given" ); >+ return ( 0, 2, "NO_ITEM" ); > } > > if ( !isItemInThisCollection( $itemnumber, $colId ) ) { >- return ( 0, 2, "Item is not in the collection!" ); >+ return ( 0, 2, "NOT_IN_COLLECTION" ); > } > > my $dbh = C4::Context->dbh; >@@ -408,10 +408,10 @@ sub TransferCollection { > > ## Check for all neccessary parameters > if ( !$colId ) { >- return ( 0, 1, "No Id Given" ); >+ return ( 0, 1, "NO_ID" ); > } > if ( !$colBranchcode ) { >- return ( 0, 2, "No Branchcode Given" ); >+ return ( 0, 2, "NO_BRANCHCODE" ); > } > > my $dbh = C4::Context->dbh; >@@ -435,9 +435,8 @@ sub TransferCollection { > $sth->execute($colId) or return ( 0, 4, $sth->errstr ); > my @results; > while ( my $item = $sth->fetchrow_hashref ) { >- transferbook( $colBranchcode, $item->{barcode}, >- my $ignore_reserves = 1 ) >- unless ( GetReserveStatus( $item->{itemnumber} ) eq "Waiting" ); >+ my ($status) = CheckReserves( $item->{itemnumber} ); >+ transferbook( $colBranchcode, $item->{barcode}, my $ignore_reserves = 1 ) unless ( $status eq 'Waiting' ); > } > > return 1; >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 7369f04..5b877bf 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -9017,13 +9017,9 @@ if ( CheckVersion($DBversion) ) { > $DBversion = "3.17.00.XXX"; > if ( CheckVersion($DBversion) ) { > $dbh->do(q{ >- ALTER TABLE collections CHANGE colBranchcode colBranchcode VARCHAR( 10 ) NULL DEFAULT NULL >- }); >- $dbh->do(q{ >- ALTER TABLE collections ADD INDEX ( colBranchcode ) >- }); >- $dbh->do(q{ > ALTER TABLE collections >+ CHANGE colBranchcode colBranchcode VARCHAR( 10 ) NULL DEFAULT NULL, >+ ADD INDEX ( colBranchcode ), > ADD CONSTRAINT collections_ibfk_1 FOREIGN KEY (colBranchcode) REFERENCES branches (branchcode) ON DELETE CASCADE ON UPDATE CASCADE > }); > print "Upgrade to $DBversion done (Bug 8836 - Resurrect Rotating Collections)\n"; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc >index 45d9b4e..963195d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc >@@ -66,11 +66,9 @@ > <li><a href="/cgi-bin/koha/labels/label-home.pl">Label creator</a></li> > <li><a href="/cgi-bin/koha/labels/spinelabel-home.pl">Quick spine label creator</a></li> > [% END %] >-<!-- > [% IF ( CAN_user_tools_rotating_collections ) %] > <li><a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Rotating collections</a></li> > [% END %] >---> > [% IF ( CAN_user_tools_marc_modification_templates ) %] > <li><a href="/cgi-bin/koha/tools/marc_modification_templates.pl">Manage MARC modification templates</a></li> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/addItems.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/addItems.tt >index 195b324..fef190c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/addItems.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/addItems.tt >@@ -15,83 +15,107 @@ > > <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › <a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Rotating collections</a> › Add/Remove items</div> > >-<div id="doc3"> >-<div id="bd"> >- <div class="yui-gb"> >+<div id="doc3" class="yui-t2"> >+ <div id="bd"> >+ <div class="yui-b"> >+ [% INCLUDE 'tools-menu.inc' %] >+ </div> > >- <h1>Rotating collections: Add/Remove items</h1> >+ <div class="yui-main"> >+ <div class="yui-db"> > >- <div> >- <br /> >- [% IF ( previousActionAdd ) %] >- [% IF ( addSuccess ) %] >- <div>Item with barcode '[% addedBarcode %]' Added successfully!</div> >- [% ELSE %] >- <div>Failed to add item with barcode '[% addedBarcode %]'!</div> >- <div>Reason: <strong>[% failureMessage %]</strong></div> >- [% END %] >- [% END %] >+ <h1>Rotating collections: Add/Remove items</h1> > >- [% IF ( previousActionRemove ) %] >- [% IF ( removeSuccess ) %] >- <div>Item with barcode '[% addedBarcode %]' Removed successfully!</div> >- [% ELSE %] >- <div>Failed to remove item with barcode '[% removedBarcode %]'!</div> >- <div>Reason: <strong>[% failureMessage %]</strong></div> >- [% END %] >- [% END %] >+ <div> >+ <br /> >+ [% IF ( previousActionAdd ) %] >+ [% IF ( addSuccess ) %] >+ <div class="alert">Item with barcode '[% barcode %]' added successfully!</div> >+ [% ELSE %] >+ <div class="alert"> >+ <p>Failed to add item with barcode <i>[% barcode %]</i>: >+ <p> >+ [% IF failureMessage == "NO_ITEM" %] >+ No item with matching barcode found! >+ [% ELSIF failureMessage == "IN_COLLECTION_OTHER" %] >+ Item is already in a different rotating collection! >+ [% ELSE %] >+ [% failureMessage %] >+ [% END %] >+ </p> >+ </div> >+ [% END %] >+ [% END %] > >- <h3>Add item to <i>[% colTitle %]</i></h3> >- </div> >+ [% IF ( previousActionRemove ) %] >+ [% IF ( removeSuccess ) %] >+ <div class="alert">Item with barcode <i>[% barcode %]</i> removed successfully!</div> >+ [% ELSE %] >+ <div class="alert"> >+ Failed to remove item with barcode <i>[% barcode %]</i>: >+ <p> >+ [% IF failureMessage == "NO_ITEM" %] >+ No item with matching barcode found! >+ [% ELSE %] >+ [% failureMessage %] >+ [% END %] >+ </p> >+ </div> >+ [% END %] >+ [% END %] > >- <div> >- <form action="addItems.pl" method="post"> >- <table> >- <tr> >- <th><label for="barcode">Barcode: </label></td> >- <td><input type="text" id="barcode" name="barcode" /></td> >- <td> >- [% IF ( removeChecked ) %]<input type="checkbox" name="removeItem" checked="checked" /> >- [% ELSE %]<input type="checkbox" name="removeItem" />[% END %] >- <label for="removeItem">Remove item from collection</label> >- </td> >- </tr> >+ <h3>Add item to <i>[% colTitle %]</i></h3> >+ </div> > >- <input type="hidden" id="colId" name="colId" value="[% colId %]" /> >- <input type="hidden" name="action" value="addItem" /> >- <tr><td align="right" colspan="99"><input type="submit" value="Submit" /></td></tr> >- </table> >- </form> >- </div> >+ <div> >+ <form action="addItems.pl" method="post"> >+ <table> >+ <tr> >+ <th><label for="barcode">Barcode: </label></td> >+ <td><input type="text" id="barcode" name="barcode" /></td> >+ <td> >+ [% IF ( removeChecked ) %]<input type="checkbox" name="removeItem" checked="checked" /> >+ [% ELSE %]<input type="checkbox" name="removeItem" />[% END %] >+ <label for="removeItem">Remove item from collection</label> >+ </td> >+ </tr> > >- <div> >- <h2>Items in this collection</h2> >- [% IF ( collectionItemsLoop ) %] >- <table> >- <tr> >- <th>Title</th> >- <th>Call number</th> >- <th>Barcode</th> >- </tr> >- [% FOREACH collectionItemsLoo IN collectionItemsLoop %] >- <tr> >- <td>[% collectionItemsLoo.title |html %]</td> >- <td>[% collectionItemsLoo.itemcallnumber %]</td> >- <td>[% collectionItemsLoo.barcode %]</td> >- </tr> >- [% END %] >- </table> >- [% ELSE %] >- There are no items in this collection. >- [% END %] >- </div> >+ <input type="hidden" id="colId" name="colId" value="[% colId %]" /> >+ <input type="hidden" name="action" value="addItem" /> >+ <tr><td align="right" colspan="99"><input class="btn" type="submit" value="Submit" /></td></tr> >+ </table> >+ </form> >+ </div> > >- <div> >- <br/> >- <input type="button" value="Return to rotating collections home" onclick="window.location.href='rotatingCollections.pl'"> >- </div> >+ <div> >+ <h2>Items in this collection</h2> >+ [% IF ( collectionItemsLoop ) %] >+ <table> >+ <tr> >+ <th>Title</th> >+ <th>Call number</th> >+ <th>Barcode</th> >+ </tr> >+ [% FOREACH collectionItemsLoo IN collectionItemsLoop %] >+ <tr> >+ <td>[% collectionItemsLoo.title |html %]</td> >+ <td>[% collectionItemsLoo.itemcallnumber %]</td> >+ <td>[% collectionItemsLoo.barcode %]</td> >+ </tr> >+ [% END %] >+ </table> >+ [% ELSE %] >+ There are no items in this collection. >+ [% END %] >+ </div> > >-</div> >-</div> >-[% INCLUDE 'intranet-bottom.inc' %] >+ <div> >+ <br/> >+ <input type="button" value="Return to rotating collections home" onclick="window.location.href='rotatingCollections.pl'"> >+ </div> >+ >+ </div> >+ </div> >+ </div> > >+[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/editCollections.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/editCollections.tt >index e1bb2a8..fa1099a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/editCollections.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/editCollections.tt >@@ -8,125 +8,118 @@ > > <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › <a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Rotating collections</a> › Edit collections</div> > >-<div id="doc3"> >-<div id="bd"> >- <div class="yui-gb"> >- <h1>Rotating collections: Edit collections</h1> >+<div id="doc3" class="yui-t2"> >+ <div id="bd"> >+ <div class="yui-b"> >+ [% INCLUDE 'tools-menu.inc' %] >+ </div> > >-<!-- >- [% IF ( previousActionCreate ) %] >- [% IF ( createSuccess ) %] >- <div>Collection '[% createdTitle %]' Created successfully!</div> >- [% ELSE %] >- <div>Collection '[% createdTitle %]' Failed to be created!</div> >- <div>Reason: <strong>[% failureMessage %]</strong></div> >- [% END %] >- [% END %] >+ <div class="yui-main"> >+ <div class="yui-bd"> > >- [% IF ( previousActionDelete ) %] >- [% IF ( DeleteSuccess ) %] >- <div>Collection Deleted successfully!</div> >- [% ELSE %] >- <div>Collection Failed to be deleted!</div> >- [% END %] >- [% END %] >---> >+ [% IF ( previousActionCreate ) %] >+ [% IF ( createSuccess ) %] >+ <div class="alert">Collection <i>[% createdTitle %]</i> created successfully!</div> >+ [% ELSE %] >+ <div class="alert"> >+ <p>Collection <i>[% createdTitle %]</i> failed to be created!</p> >+ <p> >+ [% IF failureMessage == "NO_TITLE" %] >+ No title entered. >+ [% ELSIF failureMessage == "NO_DESCRIPTION" %] >+ No description entered. >+ [% ELSE %] >+ [% failureMessage %] >+ [% END %] >+ </p> >+ </div> >+ [% END %] >+ [% END %] >+ >+ [% IF ( previousActionDelete ) %] >+ [% IF ( deleteSuccess ) %] >+ <div class="alert">Collection deleted successfully!</div> >+ [% ELSE %] >+ <div class="alert">Collection failed to be deleted!</div> >+ [% END %] >+ [% END %] > >- [% IF ( previousActionUpdate ) %] >- [% IF ( updateSuccess ) %] >- <div>Collection '[% updatedTitle %]' Updated successfully!</div> >- [% ELSE %] >- <div>Collection '[% updatedTitle %]' Failed to be updated!</div> >- <div>Reason: <strong>[% failureMessage %]</strong></div> >- [% END %] >- [% END %] >+ [% IF ( previousActionUpdate ) %] >+ [% IF ( updateSuccess ) %] >+ <div class="alert">Collection <i>[% updatedTitle %]</i> updated successfully!</div> >+ [% ELSE %] >+ <div class="alert"> >+ <p>Collection <i>[% updatedTitle %]</i> failed to be updated!</p> >+ <p> >+ [% IF failureMessage == "NO_ID" %] >+ No collection id given. >+ [% ELSE %] >+ [% failureMessage %] >+ [% END %] >+ </p> >+ </div> >+ [% END %] >+ [% END %] > >- <div> >- [% IF ( collectionsLoop ) %] >- <table> >- <thead> >- <tr> >- <th>Title</th> >- <th>Description</th> >- <th>Holding library</th> >- <th> </th> >- <th> </th> >- </tr> >- <thead> >- <tbody> >- [% FOREACH collectionsLoo IN collectionsLoop %] >- <tr> >- <td>[% collectionsLoo.colTitle %]</td> >- <td>[% collectionsLoo.colDesc %]</td> >- <td>[% collectionsLoo.colBranchcode %]</td> >- <td><a href="editCollections.pl?action=edit&colId=[% collectionsLoo.colId %]">Edit</a></td> >- <td><a href="editCollections.pl?action=delete&colId=[% collectionsLoo.colId %]">Delete</a></td> >- </tr> >- [% END %] >- </tbody> >- </table> >- [% ELSE %] >- There are no collections currently defined. >- [% END %] >- </div> >+ <div> >+ <br /> > >- <div> >- <br /> >+ [% IF action == "new" || action == "edit" %] >+ [% IF ( previousActionEdit ) %] >+ <h1>Edit collection <i>[% editColTitle %]</i></h1> >+ [% ELSE %] >+ <h1>Create new collection</h1> >+ [% END %] > >- [% IF ( previousActionEdit ) %] >- <h1>Edit Collection</h1> >- [% ELSE %] >- <h1>Create new collection</h1> >- [% END %] >+ <form action="editCollections.pl" method="post"> >+ [% IF ( previousActionEdit ) %] >+ <input type="hidden" name="action" value="update" /> >+ <input type="hidden" name="colId" value="[% editColId %]" /> >+ [% ELSE %] >+ <input type="hidden" name="action" value="create" /> >+ [% END %] > >- <form action="editCollections.pl" method="post"> >- [% IF ( previousActionEdit ) %] >- <input type="hidden" name="action" value="update" /> >- <input type="hidden" name="colId" value="[% editColId %]" /> >- [% ELSE %] >- <input type="hidden" name="action" value="create" /> >- [% END %] >+ <table> >+ <tr> >+ <td> >+ <label class="required" for="title">Title: </label> >+ </td> >+ <td> >+ [% IF ( editColTitle ) %]<input type="text" name="title" value="[% editColTitle %]" /> >+ [% ELSE %]<input type="text" name="title" />[% END %] >+ </td> >+ </tr> > >- <table> >- <tr> >- <td> >- <label for="title">Title: </label> >- </td> >- <td> >- [% IF ( editColTitle ) %]<input type="text" name="title" value="[% editColTitle %]" /> >- [% ELSE %]<input type="text" name="title" />[% END %] >- </td> >- </tr> >- >- <tr> >- <td> >- <label for="description">Description: </label> >- </td> >- <td> >- [% IF (editColDescription ) %]<input type="text" size="50" name="description" value="[% editColDescription %]" /> >- [% ELSE %]<input type="text" size="50" name="description" />[% END %] >- </td> >- </tr> >+ <tr> >+ <td> >+ <label class="required" for="description">Description: </label> >+ </td> >+ <td> >+ [% IF (editColDescription ) %]<input type="text" size="50" name="description" value="[% editColDescription %]" /> >+ [% ELSE %]<input type="text" size="50" name="description" />[% END %] >+ </td> >+ </tr> > >- <tr> >- <td colspan="2"> >- [% IF ( previousActionEdit ) %] >- <input type="submit" value="Update" /> >- [% ELSE %] >- <input type="submit" value="Create" /> >+ <tr> >+ <td colspan="2"> >+ [% IF ( previousActionEdit ) %] >+ <input class="btn" type="submit" value="Update" /> >+ [% ELSE %] >+ <input class="btn" type="submit" value="Create" /> >+ [% END %] >+ </td> >+ </tr> >+ </table> >+ </form> > [% END %] >- </td> >- </tr> >- </table> >- </form> >- </div> >+ </div> > >- <div> >- <br/> >- <input type="button" value="Return to rotating collections home" onclick="window.location.href='rotatingCollections.pl'"> >- </div> >+ <p> >+ <a class="btn" href="rotatingCollections.pl">Return to rotating collections home</a> >+ </p> > >-</div> >-</div> >+ </div> >+ </div> >+ </div> > [% INCLUDE 'intranet-bottom.inc' %] > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/rotatingCollections.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/rotatingCollections.tt >index e1780ad..0a893ab 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/rotatingCollections.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/rotatingCollections.tt >@@ -1,3 +1,4 @@ >+[% USE Branches %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Tools › Rotating collections</title> > [% INCLUDE 'doc-head-close.inc' %] >@@ -8,40 +9,50 @@ > > <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › Rotating collections</div> > >-<div id="doc3"> >-<div id="bd"> >- <div class="yui-gb"> >+<div id="doc3" class="yui-t2"> >+ <div id="bd"> >+ <div class="yui-b"> >+ [% INCLUDE 'tools-menu.inc' %] >+ </div> > >- <h1>Rotating collections</h1> >- <div> >- [% IF ( collectionsLoop ) %] >- <table> >- <tr> >- <th><strong>Title</strong></th> >- <th>Description</strong></th> >- <th>Current location</th> >- <th>Add/Remove items</th> >- <th>Transfer collection</th> >- </tr> >- [% FOREACH collectionsLoo IN collectionsLoop %] >- <tr> >- <td>[% collectionsLoo.colTitle %]</td> >- <td>[% collectionsLoo.colDesc %]</td> >- <td>[% collectionsLoo.colBranchcode %]</td> >- <td><a href="addItems.pl?colId=[% collectionsLoo.colId %]">Add/Remove Items</a></td> >- <td><a href="transferCollection.pl?colId=[% collectionsLoo.colId %]">Transfer Collection</a></td> >- </tr> >- [% END %] >- </table> >- [% ELSE %] >- There are no collections currently defined. >- [% END %] >- </div> >+ <div class="yui-main"> >+ <div class="yui-bd"> > >- <div> >- <br/> >- <input type="button" value="Edit collections" onclick="window.location.href='editCollections.pl'"> >- </div> >-</div> >-</div> >-[% INCLUDE 'intranet-bottom.inc' %] >\ No newline at end of file >+ <h1>Rotating collections</h1> >+ <div> >+ [% IF ( collectionsLoop ) %] >+ <table> >+ <tr> >+ <th><strong>Title</strong></th> >+ <th>Description</strong></th> >+ <th>Current location</th> >+ <th> </th> >+ <th> </th> >+ <th> </th> >+ <th> </th> >+ </tr> >+ >+ [% FOREACH collectionsLoo IN collectionsLoop %] >+ <tr> >+ <td>[% collectionsLoo.colTitle %]</td> >+ <td>[% collectionsLoo.colDesc %]</td> >+ <td>[% Branches.GetName( collectionsLoo.colBranchcode ) %]</td> >+ <td><a href="addItems.pl?colId=[% collectionsLoo.colId %]">Add/remove items</a></td> >+ <td><a href="transferCollection.pl?colId=[% collectionsLoo.colId %]">Transfer</a></td> >+ <td><a href="editCollections.pl?action=edit&colId=[% collectionsLoo.colId %]">Edit</a></td> >+ <td><a href="editCollections.pl?action=delete&colId=[% collectionsLoo.colId %]">Delete</a></td> >+ </tr> >+ [% END %] >+ </table> >+ [% ELSE %] >+ There are no collections currently defined. >+ [% END %] >+ </div> >+ >+ <p> >+ <a class="btn" href="editCollections.pl?action=new">Create collection</a> >+ </p> >+ </div> >+ </div> >+ </div> >+[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/transferCollection.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/transferCollection.tt >index 25f2cb2..fe582f6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/transferCollection.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/rotating_collections/transferCollection.tt >@@ -7,42 +7,50 @@ > [% INCLUDE 'cat-search.inc' %] > > <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> › <a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Rotating collections</a> › Transfer collection</div> >-<div id="doc3"> >-<div id="bd"> >- <div class="yui-gb"> >- <h1>Rotating collections: Transfer collection</h1> >- <br /> >- [% IF ( transferSuccess ) %] >- <div>Collection transferred successfully</div> >- [% END %] >- >- [% IF ( transferFailure ) %] >- <div>Failed to transfer collection!</div> >- <div>Reason: <strong>[% errorMessage %]</strong></div> >- [% END %] >- >- [% IF ( transferSuccess ) %] >- [% ELSE %] >- <div> >- <form action="transferCollection.pl" method="post"> >- <input type="hidden" name="colId" value="[% colId %]"> >- >- <label for="toBranch">Choose your library:</label> >- <select name="toBranch"> >- [% FOREACH branchoptionloo IN branchoptionloop %] >- [% IF ( branchoptionloo.selected ) %]<option value="[% branchoptionloo.code %]" selected="selected">[% branchoptionloo.name %]</option>[% ELSE %]<option value="[% branchoptionloo.code %]">[% branchoptionloo.name %]</option>[% END %] >- [% END %] >- </select> >- <INPUT type="submit" value="Transfer collection"> >- </form> >+ >+<div id="doc3" class="yui-t2"> >+ <div id="bd"> >+ <div class="yui-b"> >+ [% INCLUDE 'tools-menu.inc' %] > </div> >- [% END %] > >- <div> >- <br/> >- <input type="button" value="Return to rotating collections home" onclick="window.location.href='rotatingCollections.pl'"> >- </div> >+ <div class="yui-main"> >+ <div class="yui-bd"> >+ <h1>Rotating collections: Transfer collection</h1> >+ >+ [% IF ( transferSuccess ) %] >+ <div class="alert">Collection transferred successfully</div> >+ [% ELSIF ( transferFailure ) %] >+ <div class="alert">Failed to transfer collection!</div> >+ [% END %] >+ >+ [% IF ( transferSuccess ) %] >+ [% ELSE %] >+ <div> >+ <form action="transferCollection.pl" method="post"> >+ <input type="hidden" name="colId" value="[% colId %]"> >+ >+ <label for="toBranch">Choose your library:</label> >+ <select name="toBranch"> >+ [% FOREACH branchoptionloo IN branchoptionloop %] >+ [% IF ( branchoptionloo.selected ) %] >+ <option value="[% branchoptionloo.code %]" selected="selected">[% branchoptionloo.name %]</option> >+ [% ELSE %] >+ <option value="[% branchoptionloo.code %]">[% branchoptionloo.name %]</option> >+ [% END %] >+ [% END %] >+ </select> > >-</div> >-</div> >+ <input class="btn" type="submit" value="Transfer collection"> >+ </form> >+ </div> >+ [% END %] >+ >+ <p> >+ <a class="btn" href="rotatingCollections.pl">Return to rotating collections home</a> >+ </p> >+ >+ </div> >+ </div> >+ </div> > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/rotating_collections/addItems.pl b/rotating_collections/addItems.pl >index 10be5cb..df87908 100755 >--- a/rotating_collections/addItems.pl >+++ b/rotating_collections/addItems.pl >@@ -48,13 +48,14 @@ if ( $query->param('action') eq 'addItem' ) { > > my ( $success, $errorCode, $errorMessage ); > >+ $template->param( barcode => $barcode ); >+ > if ( !$removeItem ) { > ( $success, $errorCode, $errorMessage ) = > AddItemToCollection( $colId, $itemnumber ); > > $template->param( > previousActionAdd => 1, >- addedBarcode => $barcode, > ); > > if ($success) { >@@ -72,7 +73,6 @@ if ( $query->param('action') eq 'addItem' ) { > > $template->param( > previousActionRemove => 1, >- removedBarcode => $barcode, > removeChecked => 1, > ); > >diff --git a/rotating_collections/editCollections.pl b/rotating_collections/editCollections.pl >index 39e94a5..4372074 100755 >--- a/rotating_collections/editCollections.pl >+++ b/rotating_collections/editCollections.pl >@@ -39,8 +39,11 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > } > ); > >+my $action = $query->param('action'); >+$template->param( action => $action ); >+ > # Create new Collection >-if ( $query->param('action') eq 'create' ) { >+if ( $action eq 'create' ) { > my $title = $query->param('title'); > my $description = $query->param('description'); > >@@ -62,7 +65,7 @@ if ( $query->param('action') eq 'create' ) { > } > > ## Delete a club or service >-elsif ( $query->param('action') eq 'delete' ) { >+elsif ( $action eq 'delete' ) { > my $colId = $query->param('colId'); > my ( $success, $errorCode, $errorMessage ) = DeleteCollection($colId); > >@@ -77,9 +80,8 @@ elsif ( $query->param('action') eq 'delete' ) { > } > > ## Edit a club or service: grab data, put in form. >-elsif ( $query->param('action') eq 'edit' ) { >- my $colId = $query->param('colId'); >- my ( $colId, $colTitle, $colDesc, $colBranchcode ) = GetCollection($colId); >+elsif ( $action eq 'edit' ) { >+ my ( $colId, $colTitle, $colDesc, $colBranchcode ) = GetCollection( $query->param('colId') ); > > $template->param( > previousActionEdit => 1, >@@ -90,7 +92,7 @@ elsif ( $query->param('action') eq 'edit' ) { > } > > # Update a Club or Service >-elsif ( $query->param('action') eq 'update' ) { >+elsif ( $action eq 'update' ) { > my $colId = $query->param('colId'); > my $title = $query->param('title'); > my $description = $query->param('description'); >@@ -112,15 +114,11 @@ elsif ( $query->param('action') eq 'update' ) { > } > } > >-my $collections = GetCollections(); >- > $template->param( > intranetcolorstylesheet => > C4::Context->preference("intranetcolorstylesheet"), > intranetstylesheet => C4::Context->preference("intranetstylesheet"), > IntranetNav => C4::Context->preference("IntranetNav"), >- >- collectionsLoop => $collections, > ); > > output_html_with_http_headers $query, $cookie, $template->output; >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 8836
:
12560
|
16746
|
19118
|
19119
|
19337
|
19339
|
21008
|
21009
|
21010
|
21011
|
23966
|
23967
|
23968
|
23969
|
23970
|
23971
|
23976
|
28140
|
28141
|
30838
|
30921
|
31087
|
32361
|
32362
|
32588
|
32589
|
32690
|
32691
|
32693
|
32773
|
32774
|
32973
|
32974
|
32975
|
32976
|
32994
|
32999
|
33000
|
33001
|
33002
|
33045
|
33046
|
33047
|
33048
|
33050
|
33051
|
33058
|
33059
|
33060
|
33061
|
33062
|
33063
|
33064
|
33065
|
33066
|
33068
|
33070
|
33095
|
33096
|
33097
|
33098
|
33099
|
33100
|
33101
|
33102
|
33103
|
33330
|
33331
|
33374