A Library may have multiple desks inside its public space. If desks are defined in Koha, a librarion in public space should set her desk when opening her session as she should set her library. When items are checked-in and trigger a hold, the hold may be attachable to a desk and the patron may be advertised where she can retreive her hold. This may also be usefull when items come from closed stacked. Some may be kept as hold behind the everyday items issue desk, some may be behind the rare books section desks. Such a module was developped by Progilone for the BULAC Koha 3.2, check: <https://github.com/BULAC/koha/blob/bulac-dead_end-3.02.04/C4/Stack/Desk.pm>. The BULAC is going to port it to current master, with a more Kohaish style and comments. The circulation logic will be a bit different from those sources, as the BULAC plans to use Holds for books coming from closed stacked and dumps its overkill stack request module.
Created attachment 37808 [details] [review] Add desk management Test plan : 1/ perl installer/data/mysql/updatedatabase.pl (create new table desks) 2/ prove t/db_dependent/Desks.t 3/ go to admin page, click on desk management, try to create, modify and delete desks
Hi, can this be tested? Comments: 1) Can this be defined into Koha namespace? 2) You could use GetBranchesLoop to get an ordered (by branchname) list of branches 3) Many backticks (`) (Coding guidelines SQL6: Backticks Don't use ` in table or column names (this is a mySQLism)) 4) I think we can't use smartmatch (~~). In test "ok($deskcode ~~ @$desks, 'GetDesks returns desk codes');" Look at http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11468#c6
Hey, thanks a lot for your comments. (In reply to Bernardo Gonzalez Kriegel from comment #2) > Hi, can this be tested? It's not really functionnal yet, It'll be soon I hope, next week at least :). > Comments: > 1) Can this be defined into Koha namespace? I'm not sure about it. I'm mostly unaware of namespace policy, I thought this kind of code was for C4. Where can I find policy for namespaces ? > 2) You could use GetBranchesLoop to get an ordered (by branchname) list of > branches Ho, thanks, I missed the note in the doc and didn't catch the function cause it's not documented. > 3) Many backticks (`) > (Coding guidelines SQL6: Backticks > Don't use ` in table or column names (this is a mySQLism)) argh, ok, thanks. > 4) I think we can't use smartmatch (~~). > In test "ok($deskcode ~~ @$desks, 'GetDesks returns desk codes');" > Look at http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=11468#c6 Thanks again. I'll try to fix those soon.
Created attachment 39837 [details] [review] Bug 13881: Select desk in an intranet session the selected Desk appears in the header. The desk can be selecting in the menu beside username, branchname. Test plan : 1/ Go to the intranet administration, remove all desks if you have any. The desks should not appear in the header. 2/ add some desks in administration, without selecting some. The message « NO DESK SET » should appear at the left of the branchname. 3/ set a desk for your session. The desk deskcode should appear beside the branchname. 4/ change desk, the new name should appear also.
Created attachment 40186 [details] [review] Bug 13881: attach a reserve to a desk In the intranet, if desks are defined, a librarian can set her desk as she sets her branch. If the desk is set, and she checks in an items on which a patron made a hold, the desk deskcode is attached to the reserve and can be viewed in the Holds awaiting pickup circulation report. Test plan: Set a desk, put a book on hold, check it in, confirm hold, it should appear in the "holds awaiting pickup" circulation page, it should appear as waiting at the desk on the patron's session.
It seems to do now what we mostly expect from it.
Created attachment 40569 [details] [review] Bug 13881: attach a reserve to a desk In the intranet, if desks are defined, a librarian can set her desk as she sets her branch. If the desk is set, and she checks in an items on which a patron made a hold, the desk deskcode is attached to the reserve and can be viewed in the Holds awaiting pickup circulation report. Test plan: Set a desk, put a book on hold, check it in, confirm hold, it should appear in the "holds awaiting pickup" circulation page, it should appear as waiting at the desk on the patron's session.
Created attachment 40709 [details] [review] Bug 13881: Basic desk management Permits to add desks to Koha in the Admin Basic Parameters. Test plan : 1/ perl installer/data/mysql/updatedatabase.pl (create new table desks) 2/ prove t/db_dependent/Desks.t 3/ go to admin page, click on desk management, try to create, modify and delete desks
Hi Nicolas, are the patches in the right order? Could they be squashed? I am not sure how they are divided up and the first seems to refer +use C4::Desks;, which is only added by the third patch. Also, should this be needs sign-off?
Created attachment 40895 [details] [review] Bug 13881: Add desk management Desks can be created for a branch. If a librarian sets a desk in the intranet and check in a document on hold, the document is then attached to a desk. Test plan, basic desk creation/modification/deletion: 1/ perl installer/data/mysql/updatedatabase.pl (create new table desks) 2/ prove t/db_dependent/Desks.t 3/ go to admin page, click on desk management, try to create, modify and delete desks Test plan, setting desk in the intranet: 1/ Go to the intranet administration, remove all desks if you have any. The desks should not appear in the header. 2/ add some desks in administration, without selecting some. The message « NO DESK SET » should appear at the left of the branchname. 3/ set a desk for your session. The desk deskcode should appear beside the branchname. 4/ change desk, the new name should appear also. Test plan, attach holds awaiting pickup to a desk: Set a desk, put a book on hold, check it in, confirm hold, it should appear in the "holds awaiting pickup" circulation page, it should appear as waiting at the desk on the patron's session.
Comment on attachment 40569 [details] [review] Bug 13881: attach a reserve to a desk >From 61e00bd675d86d6f3f3f6590c0ad403e19e2a1e0 Mon Sep 17 00:00:00 2001 >From: Nicolas Legrand <nicolas.legrand@bulac.fr> >Date: Wed, 24 Jun 2015 12:20:27 +0200 >Subject: [PATCH] Bug 13881: attach a reserve to a desk > >In the intranet, if desks are defined, a librarian can set her desk as >she sets her branch. If the desk is set, and she checks in an items on >which a patron made a hold, the desk deskcode is attached to the >reserve and can be viewed in the Holds awaiting pickup circulation >report. > >Test plan: > >Set a desk, put a book on hold, check it in, confirm hold, it should >appear in the "holds awaiting pickup" circulation page, it should >appear as waiting at the desk on the patron's session. >--- > C4/Auth.pm | 32 ++++++++++---------- > C4/Reserves.pm | 20 ++++++++++-- > circ/returns.pl | 3 +- > circ/waitingreserves.pl | 9 ++++++ > .../bug_138881_link_desk_to_reserves.sql | 10 ++++++ > installer/data/mysql/kohastructure.sql | 6 +++- > .../prog/en/modules/circ/waitingreserves.tt | 6 ++++ > .../opac-tmpl/bootstrap/en/modules/opac-user.tt | 2 +- > opac/opac-user.pl | 7 +++++ > 9 files changed, 73 insertions(+), 22 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_138881_link_desk_to_reserves.sql > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index 5cd5823..2dd92d5 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -392,21 +392,6 @@ sub get_template_and_user { > persona => C4::Context->preference("persona"), > OPACBaseURL => C4::Context->preference('OPACBaseURL'), > ); >- if (C4::Context->userenv->{"branch"}) { >- my $desksaref = GetDesks(C4::Context->userenv->{"branch"}); >- if ($#$desksaref > -1) { >- $template->param( >- LoginDeskcode => ( C4::Context->userenv ? C4::Context->userenv->{"deskcode"} : undef ), >- LoginDeskname => ( C4::Context->userenv ? C4::Context->userenv->{"deskname"} : undef ), >- HasDesk => (1), >- ); >- } >- else { >- $template->param( >- HasDesk => (undef), >- ); >- } >- } > if ( $in->{'type'} eq "intranet" ) { > $template->param( > AmazonCoverImages => C4::Context->preference("AmazonCoverImages"), >@@ -441,7 +426,22 @@ sub get_template_and_user { > UseKohaPlugins => C4::Context->preference('UseKohaPlugins'), > UseCourseReserves => C4::Context->preference("UseCourseReserves"), > useDischarge => C4::Context->preference('useDischarge'), >- ); >+ ); >+ if ( C4::Context->userenv ? C4::Context->userenv->{"branch"} : undef) { >+ my $desksaref = GetDesks(C4::Context->userenv->{"branch"}); >+ if ($#$desksaref > -1) { >+ $template->param( >+ LoginDeskcode => ( C4::Context->userenv->{"deskcode"} ), >+ LoginDeskname => ( C4::Context->userenv->{"deskname"} ), >+ HasDesk => (1), >+ ); >+ } >+ else { >+ $template->param( >+ HasDesk => ( undef ), >+ ); >+ } >+ } > } > else { > warn "template type should be OPAC, here it is=[" . $in->{'type'} . "]" unless ( $in->{'type'} eq 'opac' ); >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 9c760b6..9a43585 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -843,7 +843,7 @@ sub GetReservesForBranch { > my $dbh = C4::Context->dbh; > > my $query = " >- SELECT reserve_id,borrowernumber,reservedate,itemnumber,waitingdate >+ SELECT reserve_id,borrowernumber,reservedate,itemnumber,waitingdate, deskcode > FROM reserves > WHERE priority='0' > AND found='W' >@@ -1353,7 +1353,7 @@ sub ModReserveStatus { > > =head2 ModReserveAffect > >- &ModReserveAffect($itemnumber,$borrowernumber,$diffBranchSend); >+ &ModReserveAffect($itemnumber,$borrowernumber,$diffBranchSend, $deskcode); > > This function affect an item and a status for a given reserve > The itemnumber parameter is used to find the biblionumber. >@@ -1367,7 +1367,7 @@ take care of the waiting status > =cut > > sub ModReserveAffect { >- my ( $itemnumber, $borrowernumber,$transferToDo ) = @_; >+ my ( $itemnumber, $borrowernumber,$transferToDo, $deskcode ) = @_; > my $dbh = C4::Context->dbh; > > # we want to attach $itemnumber to $borrowernumber, find the biblionumber >@@ -1398,6 +1398,19 @@ sub ModReserveAffect { > AND biblionumber = ? > "; > } >+ elsif ($deskcode) { >+ # add deskcode with waiting >+ $query = " >+ UPDATE reserves >+ SET priority = 0, >+ found = 'W', >+ waitingdate = NOW(), >+ deskcode = '$deskcode', >+ itemnumber = ? >+ WHERE borrowernumber = ? >+ AND biblionumber = ? >+ "; >+ } > else { > # affect the reserve to Waiting as well. > $query = " >@@ -1405,6 +1418,7 @@ sub ModReserveAffect { > SET priority = 0, > found = 'W', > waitingdate = NOW(), >+ deskcode = NULL, > itemnumber = ? > WHERE borrowernumber = ? > AND biblionumber = ? >diff --git a/circ/returns.pl b/circ/returns.pl >index 8b70e1a..67864e9 100755 >--- a/circ/returns.pl >+++ b/circ/returns.pl >@@ -144,12 +144,13 @@ if ( $query->param('resbarcode') ) { > my $resbarcode = $query->param('resbarcode'); > my $diffBranchReturned = $query->param('diffBranch'); > my $iteminfo = GetBiblioFromItemNumber($item); >+ my $deskcode = C4::Context->userenv->{"deskcode"} || undef; > # fix up item type for display > $iteminfo->{'itemtype'} = C4::Context->preference('item-level_itypes') ? $iteminfo->{'itype'} : $iteminfo->{'itemtype'}; > my $diffBranchSend = ($userenv_branch ne $diffBranchReturned) ? $diffBranchReturned : undef; > # diffBranchSend tells ModReserveAffect whether document is expected in this library or not, > # i.e., whether to apply waiting status >- ModReserveAffect( $item, $borrowernumber, $diffBranchSend); >+ ModReserveAffect( $item, $borrowernumber, $diffBranchSend, $deskcode); > # check if we have other reserves for this document, if we have a return send the message of transfer > my ( $messages, $nextreservinfo ) = GetOtherReserves($item); > >diff --git a/circ/waitingreserves.pl b/circ/waitingreserves.pl >index 5471643..0ce4eb3 100755 >--- a/circ/waitingreserves.pl >+++ b/circ/waitingreserves.pl >@@ -24,6 +24,7 @@ use CGI qw ( -utf8 ); > use C4::Context; > use C4::Output; > use C4::Branch; # GetBranchName >+use C4::Desks; > use C4::Auth; > use C4::Dates qw/format_date/; > use C4::Circulation; >@@ -93,18 +94,26 @@ foreach my $num (@getreserves) { > my $itemnumber = $num->{'itemnumber'}; > my $gettitle = GetBiblioFromItemNumber( $itemnumber ); > my $borrowernum = $num->{'borrowernumber'}; >+ my $deskcode = $num->{'deskcode'}; >+ my $desk = GetDesk($deskcode); >+ my $deskname; >+ if ($desk) { >+ $deskname = $desk->{'deskname'}; >+ } > my $holdingbranch = $gettitle->{'holdingbranch'}; > my $homebranch = $gettitle->{'homebranch'}; > > my %getreserv = ( > itemnumber => $itemnumber, > borrowernum => $borrowernum, >+ deskname => $deskname, > ); > > # fix up item type for display > $gettitle->{'itemtype'} = C4::Context->preference('item-level_itypes') ? $gettitle->{'itype'} : $gettitle->{'itemtype'}; > my $getborrower = GetMember(borrowernumber => $num->{'borrowernumber'}); > my $itemtypeinfo = getitemtypeinfo( $gettitle->{'itemtype'} ); # using the fixed up itype/itemtype >+ > $getreserv{'waitingdate'} = $num->{'waitingdate'}; > my ( $waiting_year, $waiting_month, $waiting_day ) = split (/-/, $num->{'waitingdate'}); > ( $waiting_year, $waiting_month, $waiting_day ) = >diff --git a/installer/data/mysql/atomicupdate/bug_138881_link_desk_to_reserves.sql b/installer/data/mysql/atomicupdate/bug_138881_link_desk_to_reserves.sql >new file mode 100644 >index 0000000..e412527 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_138881_link_desk_to_reserves.sql >@@ -0,0 +1,10 @@ >+ALTER TABLE reserves ADD COLUMN deskcode VARCHAR(10) DEFAULT NULL AFTER branchcode >+ ADD KEY deskcode (deskcode) >+ ADD CONSTRAINT reserves_ibfk_5 >+ FOREIGN KEY (deskcode) REFERENCES desks (deskcode) >+ ON DELETE CASCADE ON UPDATE CASCADE; >+ALTER TABLE old_reserves ADD COLUMN deskcode VARCHAR(10) DEFAULT NULL AFTER branchcode >+ ADD KEY deskcode (deskcode) >+ ADD CONSTRAINT old_reserves_ibfk_4 >+ FOREIGN KEY (deskcode) REFERENCES desks (deskcode) >+ ON DELETE SET NULL ON UPDATE SET NULL; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index d3fca1d..554ca7e 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -1676,6 +1676,7 @@ CREATE TABLE `old_reserves` ( -- this table holds all holds/reserves that have b > `biblionumber` int(11) default NULL, -- foreign key from the biblio table defining which bib record this hold is on > `constrainttype` varchar(1) default NULL, > `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick this hold up at >+ `deskcode` varchar(10) default NULL, -- foreign key from the desks table defining which desk the patron may pick this hold up from > `notificationdate` date default NULL, -- currently unused > `reminderdate` date default NULL, -- currently unused > `cancellationdate` date default NULL, -- the date this hold was cancelled >@@ -1863,6 +1864,7 @@ CREATE TABLE `reserves` ( -- information related to holds/reserves in Koha > `biblionumber` int(11) NOT NULL default 0, -- foreign key from the biblio table defining which bib record this hold is on > `constrainttype` varchar(1) default NULL, > `branchcode` varchar(10) default NULL, -- foreign key from the branches table defining which branch the patron wishes to pick this hold up at >+ `deskcode` varchar(10) default NULL, -- foreign key from the desks table defining which desk the patron may pick this hold up from > `notificationdate` date default NULL, -- currently unused > `reminderdate` date default NULL, -- currently unused > `cancellationdate` date default NULL, -- the date this hold was cancelled >@@ -1882,10 +1884,12 @@ CREATE TABLE `reserves` ( -- information related to holds/reserves in Koha > KEY `biblionumber` (`biblionumber`), > KEY `itemnumber` (`itemnumber`), > KEY `branchcode` (`branchcode`), >+ KEY `deskcode` (`deskcode`), > CONSTRAINT `reserves_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE, > CONSTRAINT `reserves_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE, > CONSTRAINT `reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE, >- CONSTRAINT `reserves_ibfk_4` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE >+ CONSTRAINT `reserves_ibfk_4` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE, >+ CONSTRAINT `reserves_ibfk_5` FOREIGN KEY (`deskcode`) REFERENCES `desks` (`deskcode`) ON DELETE CASCADE ON UPDATE CASCADE > ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; > > -- >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt >index 1d5faf4..31294ec 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt >@@ -82,6 +82,9 @@ > <th class="anti-the">Title</th> > <th>Patron</th> > <th>Location</th> >+ [% IF HasDesk %] >+ <th>Desk</th> >+ [% END %] > <th>Copy number</th> > <th>Enumeration</th> > <th>Action</th> >@@ -101,6 +104,9 @@ > [% reserveloo.borrowermail %]</a>[% END %] > </td> > <td>[% Branches.GetName( reserveloo.homebranch ) %]<br />[% reserveloo.itemcallnumber %]</td> >+ [% IF HasDesk %] >+ <td>[% reserveloo.deskname %]</td> >+ [% END %] > <td>[% reserveloo.copynumber %]</td> > <td>[% reserveloo.enumchron %]</td> > <td> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >index 85c985d..5945492 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >@@ -566,7 +566,7 @@ > [% IF ( RESERVE.wait ) %] > [% IF ( RESERVE.atdestination ) %] > [% IF ( RESERVE.found ) %] >- Item waiting at <b> [% RESERVE.wbrname %]</b>[% IF ( RESERVE.waitingdate ) %] since [% RESERVE.waitingdate | $KohaDates %][% END %] >+ Item waiting at <b> [% RESERVE.wbrname %]</b>[% IF (RESERVE.wdkname) %], [% RESERVE.wdkname %][% END %][% IF ( RESERVE.waitingdate ) %], since [% RESERVE.waitingdate | $KohaDates %][% END %] > <input type="hidden" name="pickup" value="[% RESERVE.wbrcd %]" /> > [% ELSE %] > Item waiting to be pulled from <b> [% RESERVE.wbrname %]</b> >diff --git a/opac/opac-user.pl b/opac/opac-user.pl >index 18dfec6..a8cdd38 100755 >--- a/opac/opac-user.pl >+++ b/opac/opac-user.pl >@@ -34,6 +34,7 @@ use C4::Biblio; > use C4::Items; > use C4::Letters; > use C4::Branch; # GetBranches >+use C4::Desks; > use Koha::DateUtils; > use Koha::Borrower::Debarments qw(IsDebarred); > >@@ -325,6 +326,12 @@ foreach my $res (@reserves) { > $res->{'wbrcode'} = $res->{'branchcode'}; > $res->{'itemnumber'} = $res->{'itemnumber'}; > $res->{'wbrname'} = $branches->{$res->{'branchcode'}}->{'branchname'}; >+ if ($res->{'deskcode'}) { >+ my $desk = GetDesk($res->{'deskcode'}); >+ if ($desk) { >+ $res->{'wdkname'} = $desk->{'deskname'}; >+ } >+ } > if($res->{'holdingbranch'} eq $res->{'wbrcode'}){ > $res->{'atdestination'} = 1; > } >-- >1.7.10.4
(In reply to Katrin Fischer from comment #9) Hey Katrin, > are the patches in the right order? Could they be squashed? I am not sure > how they are divided up and the first seems to refer +use C4::Desks;, which > is only added by the third patch. Yes, I wanted to change the first commit and then it appeared at the end of the list. Anyway, I just squashed them as you suggested. > Also, should this be needs sign-off? Sadely, there is a bit more work on databases, I'm fighting with constraints, the db updates doesn't work yet. I have been working on something else hoping it will be plain clear next time I look upon it ^^.
Created attachment 41233 [details] [review] Bug 13881: Add desk management Desks can be created for a branch. If a librarian sets a desk in the intranet and check in a document on hold, the document is then attached to a desk. Test plan, basic desk creation/modification/deletion: 1/ perl installer/data/mysql/updatedatabase.pl (create new table desks) 2/ prove t/db_dependent/Desks.t 3/ go to admin page, click on desk management, try to create, modify and delete desks Test plan, setting desk in the intranet: 1/ Go to the intranet administration, remove all desks if you have any. The desks should not appear in the header. 2/ add some desks in administration, without selecting some. The message « NO DESK SET » should appear at the left of the branchname. 3/ set a desk for your session. The desk deskcode should appear beside the branchname. 4/ change desk, the new name should appear also. Test plan, attach holds awaiting pickup to a desk: 1/ Set a desk, put a book on hold, check it in, confirm hold, it should appear in the "holds awaiting pickup" circulation page, it should appear as waiting at the desk on the patron's session. 2/ Suppress desk. The hold is still pending, but desk mentions should have disappear from "holds awaiting pickup" and patron's session. http://bugs.koha-community.org/show_bug.cgi?id=3881
Hey Katrin, (In reply to Nicolas Legrand from comment #12) > (In reply to Katrin Fischer from comment #9) > > Also, should this be needs sign-off? > > Sadely, there is a bit more work on databases, I'm fighting with > constraints, the db updates doesn't work yet. I have been working on > something else hoping it will be plain clear next time I look upon it ^^. Done. After trying to understand serials history and serials current management at the BULAC everything seems easy and MySQL errno: 150 due to bad collation matching just plain clear :).
Created attachment 42804 [details] [review] Bug 13881: Add desk management Desks can be created for a branch. If a librarian sets a desk in the intranet and check in a document on hold, the document is then attached to a desk. Test plan, basic desk creation/modification/deletion: 1/ perl installer/data/mysql/updatedatabase.pl (create new table desks) 2/ prove t/db_dependent/Desks.t 3/ go to admin page, click on desk management, try to create, modify and delete desks Test plan, setting desk in the intranet: 1/ Go to the intranet administration, remove all desks if you have any. The desks should not appear in the header. 2/ add some desks in administration, without selecting some. The message « NO DESK SET » should appear at the left of the branchname. 3/ set a desk for your session. The desk deskcode should appear beside the branchname. 4/ change desk, the new name should appear also. Test plan, attach holds awaiting pickup to a desk: 1/ Set a desk, put a book on hold, check it in, confirm hold, it should appear in the "holds awaiting pickup" circulation page, it should appear as waiting at the desk on the patron's session. 2/ Suppress desk. The hold is still pending, but desk mentions should have disappear from "holds awaiting pickup" and patron's session. http://bugs.koha-community.org/show_bug.cgi?id=3881
Created attachment 43664 [details] [review] Bug 13881: Add desk management Desks can be created for a branch. If a librarian sets a desk in the intranet and check in a document on hold, the document is then attached to a desk. Test plan, basic desk creation/modification/deletion: 1/ perl installer/data/mysql/updatedatabase.pl (create new table desks) 2/ prove t/db_dependent/Desks.t 3/ go to admin page, click on desk management, try to create, modify and delete desks Test plan, setting desk in the intranet: 1/ Go to the intranet administration, remove all desks if you have any. The desks should not appear in the header. 2/ add some desks in administration, without selecting some. The message « NO DESK SET » should appear at the left of the branchname. 3/ set a desk for your session. The desk deskcode should appear beside the branchname. 4/ change desk, the new name should appear also. Test plan, attach holds awaiting pickup to a desk: 1/ Set a desk, put a book on hold, check it in, confirm hold, it should appear in the "holds awaiting pickup" circulation page, it should appear as waiting at the desk on the patron's session. 2/ Suppress desk. The hold is still pending, but desk mentions should have disappear from "holds awaiting pickup" and patron's session. http://bugs.koha-community.org/show_bug.cgi?id=13881 Fixed conflict in installer/data/mysql/kohastructure.sql Followed testplan, works as advertised. Signed-off-by: Marc Véron <veron@veron.ch>
Nicolas, This is the very old fashion way to do. I am rewriting all the admin scripts not make them use Koha::Objects, so I am strongly against pushing this one as it. See bug 10363, bug 14828, bug 14836, bug 14888 and bug 14889 for examples.
ok, I'll check that, thanks!
Created attachment 93445 [details] [review] Bug 13881: Schema file DO NOT PUSH!
Created attachment 93446 [details] [review] Bug 13881: kohastructure and atomic update
Created attachment 93447 [details] [review] Bug 13881: Add desk management Add a desk and linked it to a library (branch). That's it. In the future it'll have super features like being able to link waiting reserve to a specific desk. Test plan: 1. go to the administration page and notice there isn't any mention of desk whatsoever 2. apply patches 3. ./installer/data/mysql/updatedatabase.pl 4. you now have desks links in admin-home and admin-menu 5. click the link 6. add a desk 7. add another one 8. delete one 9. you should have a fair list of all current desks defined 10. Done
Created attachment 93452 [details] [review] Bug 13881: Schema file DO NOT PUSH!
Created attachment 93453 [details] [review] Bug 13881: kohastructure and atomic update
Created attachment 93454 [details] [review] Bug 13881: Add desk management Add a desk and linked it to a library (branch). That's it. In the future it'll have super features like being able to link waiting reserve to a specific desk. Test plan: 1. go to the administration page and notice there isn't any mention of desk whatsoever 2. apply patches 3. ./installer/data/mysql/updatedatabase.pl 4. you now have desks links in admin-home and admin-menu 5. click the link 6. add a desk 7. add another one 8. delete one 9. you should have a fair list of all current desks defined 10. Done
I notices several problems : - the creation form make me think I can choose the desk ID, but I can't : it has to be a number. If I write something else, it's replaced. - if I delete a desk and then create a new one, I can re-use the desk ID of the deleted desk. I don't know if it can lead to problems linking datas, but to me, it's seems a curious behaviour. - if I create a new desk using, by mistake, an existing desk ID, it updates the existing desk. My conclusion is that desk ID should not be an editable field. Except these points, it works fine :)
Comment on attachment 93453 [details] [review] Bug 13881: kohastructure and atomic update Review of attachment 93453 [details] [review]: ----------------------------------------------------------------- ::: installer/data/mysql/kohastructure.sql @@ +1842,4 @@ > CONSTRAINT `reserves_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE, > CONSTRAINT `reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE, > CONSTRAINT `reserves_ibfk_4` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE, > + CONSTRAINT `reserves_ibfk_5` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE CASCADE ON UPDATE CASCADE, added comma at the end of line by mistake... @@ +1885,4 @@ > ON DELETE SET NULL ON UPDATE SET NULL, > CONSTRAINT `old_reserves_ibfk_4` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) > ON DELETE SET NULL ON UPDATE SET NULL > + ON DELETE SET NULL ON UPDATE SET NULL line duplicated by mistake
oups, thank you
Created attachment 95287 [details] [review] Bug 13881: Schema file DO NOT PUSH!
Created attachment 95288 [details] [review] Bug 13881: kohastructure and atomic update
Created attachment 95289 [details] [review] Bug 13881: Add desk management Add a desk and linked it to a library (branch). That's it. In the future it'll have super features like being able to link waiting reserve to a specific desk. Test plan: 1. go to the administration page and notice there isn't any mention of desk whatsoever 2. apply patches 3. ./installer/data/mysql/updatedatabase.pl 4. you now have desks links in admin-home and admin-menu 5. click the link 6. add a desk 7. add another one 8. delete one 9. you should have a fair list of all current desks defined 10. Done
Created attachment 95293 [details] [review] Bug 13881: Schema file DO NOT PUSH! Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Created attachment 95294 [details] [review] Bug 13881: kohastructure and atomic update Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Created attachment 95295 [details] [review] Bug 13881: Add desk management Add a desk and linked it to a library (branch). That's it. In the future it'll have super features like being able to link waiting reserve to a specific desk. Test plan: 1. go to the administration page and notice there isn't any mention of desk whatsoever 2. apply patches 3. ./installer/data/mysql/updatedatabase.pl 4. you now have desks links in admin-home and admin-menu 5. click the link 6. add a desk 7. add another one 8. delete one 9. you should have a fair list of all current desks defined 10. Done Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Hi Nicolas, starting with QA review here: 1) QA test tools Possibly a false positive: FAIL Koha/Desk.pm FAIL pod coverage POD coverage was greater before, try perl -MPod::Coverage=PackageName -e666 FAIL Koha/Desks.pm FAIL pod coverage POD is missing for 'object_class' Possibly a false positive: FAIL Koha/Schema/Result/Desk.pm FAIL pod coverage POD coverage was greater before, try perl -MPod::Coverage=PackageName -e666 FAIL koha-tmpl/intranet-tmpl/prog/en/includes/desks-admin-search.inc FAIL filters missing_filter at line 3 (<h1 id="logo"><a href="/cgi-bin/koha/mainpage.pl">[% LibraryName %]</a></h1><!-- Begin Desks Resident Search Box -->) missing_filter at line 7 ( <form action="[% script_name %]" method="post">) missing_filter at line 8 ( <input class="head-searchbox" type="text" name="desk_name" value="[% searchfield %]" size="40" />) FAIL forbidden patterns forbidden pattern: tab char (line 5) forbidden pattern: tab char (line 7) forbidden pattern: tab char (line 9) forbidden pattern: tab char (line 10) forbidden pattern: tab char (line 11) forbidden pattern: tab char (line 15) forbidden pattern: tab char (line 17) forbidden pattern: tab char (line 18) forbidden pattern: tab char (line 21) forbidden pattern: tab char (line 22) forbidden pattern: tab char (line 23) forbidden pattern: tab char (line 24) forbidden pattern: tab char (line 28) FAIL koha-tmpl/intranet-tmpl/prog/en/modules/admin/desks.tt FAIL filters missing_filter at line 79 ( <option value="[% branch.branchcode %]" selected="selected">[% branch.branchname %]</option>) missing_filter at line 79 ( <option value="[% branch.branchcode %]" selected="selected">[% branch.branchname %]</option>) missing_filter at line 81 ( <option value="[% branch.branchcode %]">[% branch.branchname %]</option>) missing_filter at line 81 ( <option value="[% branch.branchcode %]">[% branch.branchname %]</option>) 2) Quick code review admin/desks.pl Are the copyright statements correct? +# Copyright 2006 SAN OUEST-PROVENCE et Paul POULAIN +# Copyright 2015 Koha Development Team Leftover debugging code: +use Data::Dumper; The new page requires a new permission: manage_desks + flagsrequired => { parameters => 'manage_desks' }, But the new permission is not properly added. It looks like maybe you were planning to use manage_libraries here instead? Check: koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc koha-tmpl/intranet-tmpl/prog/en/includes/admin-menu.inc
Also missing tests!
Created attachment 101033 [details] [review] Bug 13881: Add desk management Add a desk and linked it to a library (branch). That's it. In the future it'll have super features like being able to link waiting reserve to a specific desk. Test plan: 1. go to the administration page and notice there isn't any mention of desk whatsoever 2. apply patches 3. ./installer/data/mysql/updatedatabase.pl 4. you now have desks links in admin-home and admin-menu 5. click the link 6. add a desk 7. add another one 8. delete one 9. you should have a fair list of all current desks defined 10. Done Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Created attachment 101050 [details] [review] Bug 13881: Add desk management Add a desk and linked it to a library (branch). That's it. In the future it'll have super features like being able to link waiting reserve to a specific desk. Test plan: 1. go to the administration page and notice there isn't any mention of desk whatsoever 2. apply patches 3. ./installer/data/mysql/updatedatabase.pl 4. you now have desks links in admin-home and admin-menu 5. click the link 6. add a desk 7. add another one 8. delete one 9. you should have a fair list of all current desks defined 10. Done Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Created attachment 101064 [details] [review] Bug 13881: Add desk management Add a desk and linked it to a library (branch). That's it. In the future it'll have super features like being able to link waiting reserve to a specific desk. Test plan: 1. go to the administration page and notice there isn't any mention of desk whatsoever 2. apply patches 3. ./installer/data/mysql/updatedatabase.pl 4. you now have desks links in admin-home and admin-menu 5. click the link 6. add a desk 7. add another one 8. delete one 9. you should have a fair list of all current desks defined 10. Done Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Created attachment 101065 [details] [review] Bug 13881: Add desk management Add a desk and linked it to a library (branch). That's it. In the future it'll have super features like being able to link waiting reserve to a specific desk. Test plan: 1. go to the administration page and notice there isn't any mention of desk whatsoever 2. apply patches 3. ./installer/data/mysql/updatedatabase.pl 4. prove t/db_dependent/Koha/Desks.t 5. you now have desks links in admin-home and admin-menu 6. click the link 7. add a desk 8. add another one 9. delete one 10. you should have a fair list of all current desks defined 11. Done Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
(In reply to Katrin Fischer from comment #34) > Hi Nicolas, > > starting with QA review here: Oups! From now on, I won't attach anything without running first qa-tools! Sorry! I've get rid of most of them, but not this one: > > 1) QA test tools > > Possibly a false positive: > FAIL Koha/Desk.pm > FAIL pod coverage > POD coverage was greater before, try perl -MPod::Coverage=PackageName > -e666 I don't really understand what the problem is...
(In reply to Katrin Fischer from comment #35) > Also missing tests! done also, based on t/db_dependent/Koha/Cities.t and t/db_dependent/Koha/Suggestions.t
Created attachment 101479 [details] [review] Bug 13881: Add desk management Add a desk and linked it to a library (branch). That's it. In the future it'll have super features like being able to link waiting reserve to a specific desk. Test plan: 1. go to the administration page and notice there isn't any mention of desk whatsoever 2. apply patches 3. ./installer/data/mysql/updatedatabase.pl 4. prove t/db_dependent/Koha/Desks.t 5. you now have desks links in admin-home and admin-menu 6. click the link 7. add a desk 8. add another one 9. delete one 10. you should have a fair list of all current desks defined 11. Done Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Not on IRC? ;)
Created attachment 101543 [details] [review] Bug 13881: Schema file DO NOT PUSH! Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 101544 [details] [review] Bug 13881: kohastructure and atomic update Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 101545 [details] [review] Bug 13881: Add desk management Add a desk and linked it to a library (branch). That's it. In the future it'll have super features like being able to link waiting reserve to a specific desk. Test plan: 1. go to the administration page and notice there isn't any mention of desk whatsoever 2. apply patches 3. ./installer/data/mysql/updatedatabase.pl 4. prove t/db_dependent/Koha/Desks.t 5. you now have desks links in admin-home and admin-menu 6. click the link 7. add a desk 8. add another one 9. delete one 10. you should have a fair list of all current desks defined 11. Done Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 101546 [details] [review] Bug 13881: (QA follow-up) Check for manage_libraries permission The .pl was checking for a new permission desks_management not (yet) added. As the templates already checked for manage_libraries the .pl was changed accordingly to also use it. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 101547 [details] [review] Bug 13881: (QA follow-up) Some documentation and terminology fixes - Branchcode = Library - Desk id = Desk ID - Show library name on desk list and when deleting desk instead of code - Some small changes to the database documentation. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Nice work everyone! Pushed to master for 20.05
Upgrade to 19.12.00.054 done [07:00:32]: Bug 13881 - Add desk management DBD::mysql::db do failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'A' at line 2 [for Statement " ALTER TABLE suggestions ADD CONSTRAINT `suggestions_ibfk_lastmodificationby` FOREIGN KEY (`lastmodificationby`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE A "] at installer/data/mysql/updatedatabase.pl line 21300.
(In reply to Marcel de Rooy from comment #50) > Upgrade to 19.12.00.054 done [07:00:32]: Bug 13881 - Add desk management > DBD::mysql::db do failed: You have an error in your SQL syntax; check the > manual that corresponds to your MariaDB server version for the right syntax > to use near 'A' at line 2 [for Statement " > ALTER TABLE suggestions ADD CONSTRAINT > `suggestions_ibfk_lastmodificationby` FOREIGN KEY (`lastmodificationby`) > REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE > CASCADE > A > "] at installer/data/mysql/updatedatabase.pl line 21300. Hi Marcel, I think that#s the wrong bug - that's changes to suggestions, not desks. (see 23590)
enhancement not backported to 19.11.x
Nicolas, should we add sponsorship by BULAC here?
(In reply to Katrin Fischer from comment #53) > Nicolas, should we add sponsorship by BULAC here? maybe!
Created attachment 105009 [details] [review] Bug 13881: (RM follow-up) Make 'Desks' feature optional This patch adds a new 'UseIssueDesks' preference which defaults to "Don't use" to enabled/disable the 'Desks' functionality added with this bug. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(In reply to Martin Renvoize from comment #55) > Created attachment 105009 [details] [review] [review] > Bug 13881: (RM follow-up) Make 'Desks' feature optional > > This patch adds a new 'UseIssueDesks' preference which defaults to > "Don't use" to enabled/disable the 'Desks' functionality added with this > bug. > > Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Missing out on QA here... don't use issue, use circulation ;)
Appreciate the title change. This bug is completely different to what I thought it was. Sounds niche... but I haven't worked at a circulation desk for nearly 10 years now.
(In reply to David Cook from comment #57) > Appreciate the title change. This bug is completely different to what I > thought it was. Sounds niche... but I haven't worked at a circulation desk > for nearly 10 years now. A gut yor, right, thanks Martin! At first it was doing more but I cut it up into three after rewrite to help the work for QA. I'm surprised it sounds niche :), I know not so few libraries with multiple desks and waiting reserves. Truth is it's even odd for me it wasn't there. Sadly I wasn't able to work more quickly on the “useful parts”, but it'll be ready soon for 20.11! Thanks a lot everyone to help me on this one!
(In reply to Nicolas Legrand from comment #58) > At first it was doing more but I cut it up into three > after rewrite to help the work for QA. Makes sense to me. > I'm surprised it sounds niche :), I > know not so few libraries with multiple desks and waiting reserves. Truth is > it's even odd for me it wasn't there. What sort of libraries are these? Public libraries? I've worked in academic libraries and special libraries and we always had just 1 circulation desk per library branch, which had all the waiting reserves for that branch behind it. I don't think that I've even used a library (in Canada or Australia) that has had multiple circulation desks? Not that I'm being negative. I'm really intrigued! Very different to my experience, so it's interesting to learn about different setups.
I know that this is a common feature in at least one ILS widely used here in Germany in academic libraries. I could also imagine it being useful in public libraries with different desks for adult and children services.
(In reply to Katrin Fischer from comment #60) > I know that this is a common feature in at least one ILS widely used here in > Germany in academic libraries. I could also imagine it being useful in > public libraries with different desks for adult and children services. Oh right! Good one! Now that I think about it, I have gone to a public library that had different circulation areas for adults and children. I wonder if they treated them as separate branches or as separate desks in the same branch. Interesting...
(In reply to David Cook from comment #61) > (In reply to Katrin Fischer from comment #60) > > I know that this is a common feature in at least one ILS widely used here in > > Germany in academic libraries. I could also imagine it being useful in > > public libraries with different desks for adult and children services. > > Oh right! Good one! Now that I think about it, I have gone to a public > library that had different circulation areas for adults and children. I > wonder if they treated them as separate branches or as separate desks in the > same branch. Interesting... In a public library with three circulation desk, we had to set them as branches, as there was no other option in Koha... It's not big issue in relatively small public library. But when the library has more branches and more desks at each of them, the branches and desks combination could be more precise and semantically much more meaningful
(In reply to Josef Moravec from comment #62) > In a public library with three circulation desk, we had to set them as > branches, as there was no other option in Koha... It's not big issue in > relatively small public library. But when the library has more branches and > more desks at each of them, the branches and desks combination could be more > precise and semantically much more meaningful This is so interesting. I used to use the biggest public library in the third biggest city (population 2.5 million) in Canada and it only had 1 area for circulation. In Australia, I live in the biggest city (population 5 million) but all our public libraries do seem to be small. Usually with 1 circulation area that is mostly self checkout with 1 desk and 1 hold/reserve area. Having more desks seems like it would be more challenging from a management perspective... but maybe it's necessary for bigger libraries in bigger places?
(In reply to David Cook from comment #63) > (In reply to Josef Moravec from comment #62) > > In a public library with three circulation desk, we had to set them as > > branches, as there was no other option in Koha... It's not big issue in > > relatively small public library. But when the library has more branches and > > more desks at each of them, the branches and desks combination could be more > > precise and semantically much more meaningful > > This is so interesting. I used to use the biggest public library in the > third biggest city (population 2.5 million) in Canada and it only had 1 area > for circulation. > > In Australia, I live in the biggest city (population 5 million) but all our > public libraries do seem to be small. Usually with 1 circulation area that > is mostly self checkout with 1 desk and 1 hold/reserve area. > > Having more desks seems like it would be more challenging from a management > perspective... but maybe it's necessary for bigger libraries in bigger > places? This is really interesting David! It looks like it does not depend on size of library but more on the attitude and customs of librariens ;)
I could think of another example: academic libraries with reading rooms for rare materials. That could be treated as a separate desk.
(In reply to Katrin Fischer from comment #65) > I could think of another example: academic libraries with reading rooms for > rare materials. That could be treated as a separate desk. Oh that's an interesting idea. I think the academic libraries I've attended usually have a "special collections" branch for those, but I don't know for sure.
(In reply to Josef Moravec from comment #64) > This is really interesting David! > > It looks like it does not depend on size of library but more on the attitude > and customs of librariens ;) Indeed! Hopefully this comment thread will be inspiring to people. I know it's going to make me re-think the advice I give to libraries. We provide services to every library type around the world, so it's very possible that I'll run into this scenario and now I know it's more common than I thought!
(In reply to David Cook from comment #59) > > I'm surprised it sounds niche :), I > > know not so few libraries with multiple desks and waiting reserves. Truth is > > it's even odd for me it wasn't there. > > What sort of libraries are these? Public libraries? I've worked in academic > libraries and special libraries and we always had just 1 circulation desk > per library branch, which had all the waiting reserves for that branch > behind it. > > I don't think that I've even used a library (in Canada or Australia) that > has had multiple circulation desks? > > Not that I'm being negative. I'm really intrigued! Very different to my > experience, so it's interesting to learn about different setups. It's all sort of libraries in France, first the one I work into, la BULAC, its an academic library (more than 1,5 million documents, 1000 seats, three delivery desks). It's also what's done in the French national library (more than 40 millions of documents, something like 20 rooms with a delivery desk). My public library in Montrouge, which is a little one, has three delivery desks. It depends a lot of the library though, my academic library in Tours had just one delivery desk, the public library in Bourges has also just one...
> It's all sort of libraries in France, first the one I work into, la BULAC, > its an academic library (more than 1,5 million documents, 1000 seats, three > delivery desks). It's also what's done in the French national library (more > than 40 millions of documents, something like 20 rooms with a delivery > desk). My public library in Montrouge, which is a little one, has three > delivery desks. It depends a lot of the library though, my academic library > in Tours had just one delivery desk, the public library in Bourges has also > just one... Sometimes where your document is deliver depends of the room you're into (BNF Tolbiac site). Sometimes its a document from a specific department you can consult only in the department reading room (BNF Richelieu site). At my library (BULAC), we have a return desk at the entrance of the library where we keep all waiting reserves. We have another desk in another floor where we bring all documents asked from closed stacks. And finally, we have a place for rare or damaged books. Usually, we know from start a rare book will go into the rare books special room. But sometimes, a rare or damaged book may be asked and deliver to the common desk. The librarian checking in books as may decide it's a book that should be consulted in the rare books room. So it's put on a shelving cart and checked in again in the rare books room.
Thanks for following up, Nicolas. It's great having this context!
(In reply to David Cook from comment #70) > Thanks for following up, Nicolas. > > It's great having this context! my pleasure, and thanks to you for asking!