Bugzilla – Attachment 73393 Details for
Bug 19519
Ability to bind the rotating collection with branch during creating
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19519: Add ability to bind rotating collectino with library during creation
Bug-19519-Add-ability-to-bind-rotating-collectino-.patch (text/plain), 5.97 KB, created by
Josef Moravec
on 2018-03-28 15:29:43 UTC
(
hide
)
Description:
Bug 19519: Add ability to bind rotating collectino with library during creation
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2018-03-28 15:29:43 UTC
Size:
5.97 KB
patch
obsolete
>From cc47a0865df1ce334d353e93ea20b88bf743dcd1 Mon Sep 17 00:00:00 2001 >From: Josef Moravec <josef.moravec@gmail.com> >Date: Mon, 23 Oct 2017 20:47:37 +0200 >Subject: [PATCH] Bug 19519: Add ability to bind rotating collectino with > library during creation > >Test plan: >0) Apply the patch >1) Go to rotating collections tool >2) Try to create and edit collections, note there is new field >"library", try to set and unset it >3) try to transfer a collection, the library saved by creating/editing >collection should be preselected >--- > .../prog/en/modules/rotating_collections/editCollections.tt | 11 +++++++++++ > .../en/modules/rotating_collections/rotatingCollections.tt | 2 +- > .../en/modules/rotating_collections/transferCollection.tt | 6 +++++- > rotating_collections/editCollections.pl | 4 ++++ > 4 files changed, 21 insertions(+), 2 deletions(-) > >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 7ce9ed1..6bdb43a 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 >@@ -1,4 +1,5 @@ > [% SET footerjs = 1 %] >+[% USE Branches %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Tools › Rotating collections › > [%- IF ( action == "new" ) %] >@@ -93,6 +94,16 @@ > <input type="text" size="50" name="description" /> > [% END %] > </li> >+ <li> >+ <label for="branchcode">Library: </label> >+ <select id="branchcode" name="branchcode"> >+ <option value="">No library, will select during transfer</option> >+ [% IF ( collection.colBranchcode ) %] >+ [% PROCESS options_for_libraries libraries => Branches.all( selected => collection.colBranchcode, unfiltered => 1, ) %] >+ [% ELSE %] >+ [% PROCESS options_for_libraries libraries => Branches.all( unfiltered => 1, ) %] >+ [% END %] >+ </select> > </ol> > </fieldset> > <fieldset class="action"> >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 111e92d..585f820 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 >@@ -27,7 +27,7 @@ > <tr> > <th>Title</th> > <th>Description</th> >- <th>Current location</th> >+ <th>Library</th> > <th> </th> > </tr> > </thead> >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 e235ea7..065a2df 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 >@@ -39,7 +39,11 @@ > <li> > <label for="toBranch">Choose your library:</label> > <select id="toBranch" name="toBranch"> >- [% PROCESS options_for_libraries libraries => Branches.all( unfiltered => 1 ) %] >+ [% IF ( collection.colBranchcode ) %] >+ [% PROCESS options_for_libraries libraries => Branches.all( selected => collection.colBranchcode, unfiltered => 1 ) %] >+ [% ELSE %] >+ [% PROCESS options_for_libraries libraries => Branches.all( unfiltered => 1 ) %] >+ [% END %] > </select> > </li> > </ol> >diff --git a/rotating_collections/editCollections.pl b/rotating_collections/editCollections.pl >index 1427a57..a56c7de 100755 >--- a/rotating_collections/editCollections.pl >+++ b/rotating_collections/editCollections.pl >@@ -46,11 +46,13 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > if ( $action eq 'create' ) { > my $title = $query->param('title'); > my $description = $query->param('description'); >+ my $branchcode = $query->param('branchcode') || undef; > $template->param( createdTitle => $title ); > > my $collection = Koha::RotatingCollection->new( > { colTitle => $title, > colDesc => $description, >+ colBranchcode => $branchcode, > } > ); > >@@ -85,6 +87,7 @@ if ( $action eq 'create' ) { > my $colId = $query->param('colId'); > my $title = $query->param('title'); > my $description = $query->param('description'); >+ my $branchcode = $query->param('branchcode') || undef; > > $template->param( updatedTitle => $title ); > >@@ -92,6 +95,7 @@ if ( $action eq 'create' ) { > my $collection = Koha::RotatingCollections->find($colId); > $collection->colTitle($title); > $collection->colDesc($description); >+ $collection->colBranchcode($branchcode); > > eval { $collection->store; }; > >-- >2.1.4
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 19519
:
69542
|
72818
|
73259
| 73393