Bugzilla – Attachment 43335 Details for
Bug 14544
Move the list related code to Koha::Virtualshelves
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14544: QA fixes - some minor bug fixes
Bug-14544-QA-fixes---some-minor-bug-fixes.patch (text/plain), 12.61 KB, created by
Jonathan Druart
on 2015-10-12 09:47:03 UTC
(
hide
)
Description:
Bug 14544: QA fixes - some minor bug fixes
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-10-12 09:47:03 UTC
Size:
12.61 KB
patch
obsolete
>From fa4e20c2158c4a1bfc586aaf325cad12822da060 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 12 Oct 2015 09:34:41 +0100 >Subject: [PATCH] Bug 14544: QA fixes - some minor bug fixes > >See comment 171 and 172 for more details. > >This patch mainly fixes typo or silly error in templates. > >It also uses the relationships added by previous patch to join the >biblioitems and items tables (changes in opac-shelves.pl and >shelves.pl). >--- > Koha/Exceptions.pm | 2 +- > .../prog/en/modules/catalogue/detail.tt | 2 +- > .../prog/en/modules/virtualshelves/shelves.tt | 42 ++++++++++++---------- > .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 2 +- > .../bootstrap/en/modules/opac-shareshelf.tt | 2 +- > .../opac-tmpl/bootstrap/en/modules/opac-shelves.tt | 8 ++--- > opac/opac-sendshelf.pl | 2 +- > opac/opac-shelves.pl | 11 +++++- > virtualshelves/shelves.pl | 11 +++++- > 9 files changed, 53 insertions(+), 29 deletions(-) > >diff --git a/Koha/Exceptions.pm b/Koha/Exceptions.pm >index 4409296..beef949 100644 >--- a/Koha/Exceptions.pm >+++ b/Koha/Exceptions.pm >@@ -15,7 +15,7 @@ use Exception::Class ( > > 'Koha::Exceptions::Virtualshelves::DuplicateObject' => { > isa => 'Koha::Exceptions::DuplicateObject', >- description => "poeut", >+ description => "Duplicate shelf object", > }, > 'Koha::Exceptions::Virtualshelves::InvalidInviteKey' => { > isa => 'Koha::Exceptions::Exception', >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index 3a1c632..37bd04c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -357,7 +357,7 @@ function verify_images() { > [% IF ( XSLTDetailsDisplay ) %] > [% XSLTBloc %] > >- [% IF shelves %] >+ [% IF shelves.count %] > <span class="results_summary"><span class="label">Lists that include this title: </span> > [% FOREACH s IN shelves %] > <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% s.shelfnumber %]">[% s.shelfname %]</a> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >index 546f4fa..59ffa65 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >@@ -564,24 +564,30 @@ function placeHold () { > [% END %] > </select></li> > >- [% FOR permission IN ['allow_add', 'allow_delete_own', 'allow_delete_other'] %] >- <li> >- [% IF loop.first %] >- <label for="permissions">Permissions: </label> >- [% ELSE %] >- <label> </label> >- [% END %] >- <select name="[% permission %]" id="[% permission %]"> >- [% IF shelf.$permission %]<option value="0">Do not allow</option>[% ELSE %]<option value="0" selected="selected">Do not allow</option>[% END %] >- [% IF shelf.$permission %]<option value="1" selected="selected">Allow</option>[% ELSE %]<option value="1">Allow</option>[% END %] >- </select> >- [% SWITCH permission %] >- [% CASE 'allow_add' %] <span>anyone else to add entries.</span> >- [% CASE 'allow_delete_own' %] <span>anyone to remove his own contributed entries.</span> >- [% CASE 'allow_delete_other' %] <span>anyone to remove other contributed entries.</span> >- [% END %] >- </li> >- [% END %] >+ <li> >+ <label for="allow_add">Permissions: </label> >+ <select name="allow_add" id="allow_add"> >+ [% IF shelf.allow_add %]<option value="0">Do not allow</option>[% ELSE %]<option value="0" selected="selected">Do not allow</option>[% END %] >+ [% IF shelf.allow_add %]<option value="1" selected="selected">Allow</option>[% ELSE %]<option value="1">Allow</option>[% END %] >+ </select> >+ <span>anyone else to add entries.</span> >+ </li> >+ <li> >+ <label> </label> >+ <select name="allow_delete_own" id="allow_delete_own"> >+ [% IF shelf and not shelf.allow_delete_own %]<option value="0" selected="selected">Do not allow</option>[% ELSE %]<option value="0">Do not allow</option>[% END %] >+ [% IF not shelf or shelf.allow_delete_own %]<option value="1" selected="selected">Allow</option>[% ELSE %]<option value="1">Allow</option>[% END %] >+ </select> >+ <span>anyone to remove his own contributed entries.</span> >+ </li> >+ <li> >+ <label> </label> >+ <select name="allow_delete_other" id="allow_delete_other"> >+ [% IF shelf.allow_delete_other %]<option value="0">Do not allow</option>[% ELSE %]<option value="0" selected="selected">Do not allow</option>[% END %] >+ [% IF shelf.allow_delete_other %]<option value="1" selected="selected">Allow</option>[% ELSE %]<option value="1">Allow</option>[% END %] >+ </select> >+ <span>anyone to remove other contributed entries.</span> >+ </li> > </ol> > </fieldset> > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >index 65fc3bb..410f795 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -390,7 +390,7 @@ > [% END # / LibraryThingForLibrariesID %] > > <!--This grabs all of the lists a bib record appears in --> >- [% IF shelves %] >+ [% IF shelves.count %] > <span class="results_summary lists"><span class="label">List(s) this item appears in: </span> > [% FOREACH s IN shelves %] > <a href="/cgi-bin/koha/opac-shelves.pl?op=view&shelfnumber=[% s.shelfnumber %]">[% s.shelfname %]</a> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shareshelf.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shareshelf.tt >index ac5a19b..c36168a 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shareshelf.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shareshelf.tt >@@ -59,7 +59,7 @@ > </fieldset> > <fieldset class="action"> > <input type="submit" value="Send" class="btn" /> >- <a href="/cgi-bin/koha/opac-shelves.pl?op=view&category=1" class="cancel">Cancel</a> >+ <a href="/cgi-bin/koha/opac-shelves.pl?op=list&category=1" class="cancel">Cancel</a> > </fieldset> > </form> > </div> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >index 9ae8927..113c056 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >@@ -22,8 +22,8 @@ > <li> > <label> </label> > <select name="allow_delete_own" id="allow_delete_own"> >- [% IF shelf.allow_delete_own %]<option value="0">Do not allow</option>[% ELSE %]<option value="0" selected="selected">Do not allow</option>[% END %] >- [% IF shelf.allow_delete_own %]<option value="1" selected="selected">Allow</option>[% ELSE %]<option value="1">Allow</option>[% END %] >+ [% IF shelf and not shelf.allow_delete_own %]<option value="0" selected="selected">Do not allow</option>[% ELSE %]<option value="0">Do not allow</option>[% END %] >+ [% IF not shelf or shelf.allow_delete_own %]<option value="1" selected="selected">Allow</option>[% ELSE %]<option value="1">Allow</option>[% END %] > </select> > <span>anyone to remove his own contributed entries.</span> > </li> >@@ -168,7 +168,7 @@ > <a href="/cgi-bin/koha/opac-downloadshelf.pl?shelfnumber=[% shelf.shelfnumber | html %]" class="download" data-toggle="modal" data-target="#modalWin">Download list</a> > > [% IF Koha.Preference( 'opacuserlogin' ) == 1 %] >- <span class="sendlist"><a href="/cgi-bin/koha/opac-sendshelf.pl?shelfid=[% shelfnumber | html %]" class="send" onclick="open('/cgi-bin/koha/opac-sendshelf.pl?shelfid=[% shelfnumber | html %]','win_form','scrollbars=no,resizable=no,height=300,width=450,top=50,left=100'); return false; ">Send list</a></span> >+ <span class="sendlist"><a href="/cgi-bin/koha/opac-sendshelf.pl?shelfid=[% shelf.shelfnumber | html %]" class="send" onclick="open('/cgi-bin/koha/opac-sendshelf.pl?shelfid=[% shelf.shelfnumber | html %]','win_form','scrollbars=no,resizable=no,height=300,width=450,top=50,left=100'); return false; ">Send list</a></span> > [% END %] > > <a class="print-small" target="_blank" href="/cgi-bin/koha/opac-shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber %]&sortfield=[% sortfield %]&direction=[% direction |uri %]&print=1">Print list</a> >@@ -521,7 +521,7 @@ > [% END %] > > [% IF itemsloop && can_remove_biblios %] >- <input type="hidden" name="op" value="view" /> >+ <input type="hidden" name="op" value="remove_biblios" /> > <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" /> > <input type="hidden" name="modifyshelfcontents" value="1" /> > <input type="submit" value="Remove selected items" id="remove-selected" class="btn btn-danger"/> >diff --git a/opac/opac-sendshelf.pl b/opac/opac-sendshelf.pl >index 91ab4ad..fb7d532 100755 >--- a/opac/opac-sendshelf.pl >+++ b/opac/opac-sendshelf.pl >@@ -52,7 +52,7 @@ my $email = $query->param('email'); > my $dbh = C4::Context->dbh; > > my $shelf = Koha::Virtualshelves->find( $shelfid ); >-if ( $shelf->can_be_viewed( $borrowernumber ) ) { >+if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) { > > if ( $email ) { > my $message = Koha::Email->new(); >diff --git a/opac/opac-shelves.pl b/opac/opac-shelves.pl >index e4e4eaa..067eb10 100755 >--- a/opac/opac-shelves.pl >+++ b/opac/opac-shelves.pl >@@ -222,7 +222,16 @@ if ( $op eq 'view' ) { > $rows = C4::Context->preference('OPACnumSearchResults') || 20; > $page = ( $query->param('page') ? $query->param('page') : 1 ); > } >- my $contents = $shelf->get_contents->search({}, { join => [ 'biblionumber' ], page => $page, rows => $rows, order_by => "$sortfield $direction", }); >+ my $order_by = $sortfield eq 'itemcallnumber' ? 'items.itemcallnumber' : $sortfield; >+ my $contents = $shelf->get_contents->search( >+ {}, >+ { >+ prefetch => [ { 'biblionumber' => { 'biblioitems' => 'items' } } ], >+ page => $page, >+ rows => $rows, >+ order_by => "$order_by $direction", >+ } >+ ); > > # get biblionumbers stored in the cart > my @cart_list; >diff --git a/virtualshelves/shelves.pl b/virtualshelves/shelves.pl >index a6328ce..5a82e0b 100755 >--- a/virtualshelves/shelves.pl >+++ b/virtualshelves/shelves.pl >@@ -201,7 +201,16 @@ if ( $op eq 'view' ) { > $page = ( $query->param('page') ? $query->param('page') : 1 ); > } > >- my $contents = $shelf->get_contents->search({}, { join => [ 'biblionumber' ], page => $page, rows => $rows, order_by => "$sortfield $direction", }); >+ my $order_by = $sortfield eq 'itemcallnumber' ? 'items.itemcallnumber' : $sortfield; >+ my $contents = $shelf->get_contents->search( >+ {}, >+ { >+ prefetch => [ { 'biblionumber' => { 'biblioitems' => 'items' } } ], >+ page => $page, >+ rows => $rows, >+ order_by => "$order_by $direction", >+ } >+ ); > > my $borrower = GetMember( borrowernumber => $loggedinuser ); > >-- >2.1.0
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 14544
:
41034
|
41035
|
41036
|
41037
|
41038
|
41039
|
41040
|
41041
|
41042
|
41403
|
41404
|
41405
|
41406
|
41407
|
41408
|
41409
|
41410
|
41411
|
41412
|
41584
|
41585
|
41586
|
41587
|
41588
|
41589
|
41590
|
41591
|
41592
|
41593
|
41594
|
41595
|
41596
|
41597
|
41598
|
41599
|
41600
|
41601
|
41716
|
41717
|
41718
|
41719
|
41720
|
41721
|
41722
|
41723
|
41724
|
41725
|
41726
|
41727
|
41728
|
41729
|
41730
|
41731
|
41732
|
41733
|
41766
|
41909
|
41910
|
41913
|
41914
|
41915
|
41917
|
41918
|
41919
|
41924
|
41927
|
41931
|
41932
|
41953
|
41954
|
41955
|
41956
|
41957
|
41958
|
41959
|
41960
|
41961
|
41962
|
41963
|
41964
|
41965
|
41966
|
41967
|
41968
|
41969
|
41970
|
41973
|
41974
|
41975
|
41976
|
41977
|
41978
|
41979
|
41980
|
41981
|
41982
|
41983
|
41986
|
41988
|
42192
|
42199
|
42200
|
42201
|
42202
|
42203
|
42204
|
42205
|
42206
|
42207
|
42208
|
42209
|
42210
|
42211
|
42212
|
42213
|
42214
|
42215
|
42216
|
42217
|
42218
|
42219
|
42638
|
43223
|
43224
|
43225
|
43226
|
43227
|
43228
|
43229
|
43230
|
43231
|
43232
|
43233
|
43234
|
43235
|
43236
|
43237
|
43238
|
43239
|
43240
|
43241
|
43242
|
43243
|
43296
|
43334
|
43335
|
43403
|
43456
|
43457
|
43458
|
43459
|
43460
|
43461
|
43462
|
43463
|
43464
|
43465
|
43466
|
43467
|
43469
|
43470
|
43471
|
43472
|
43473
|
43474
|
43475
|
43476
|
43477
|
43478
|
43479
|
43480
|
43481
|
43482
|
43485
|
43486
|
43487
|
44467
|
44468
|
44469
|
44470
|
44471
|
44472
|
44473
|
44474
|
44475
|
44476
|
44477
|
44478
|
44479
|
44480
|
44481
|
44482
|
44483
|
44484
|
44485
|
44486
|
44487
|
44758
|
44845
|
44852
|
44863
|
44872