Bugzilla – Attachment 41917 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: Do not use shelf as a variable loop
Bug-14544-Do-not-use-shelf-as-a-variable-loop.patch (text/plain), 18.87 KB, created by
Jonathan Druart
on 2015-08-25 14:03:35 UTC
(
hide
)
Description:
Bug 14544: Do not use shelf as a variable loop
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-08-25 14:03:35 UTC
Size:
18.87 KB
patch
obsolete
>From fb440bb8fac8f6820c3db42fd0849858ed3df213 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 25 Aug 2015 14:57:30 +0100 >Subject: [PATCH] Bug 14544: Do not use shelf as a variable loop > >Otherwise the shelf variable send from the pl script is overwrite >--- > .../prog/en/modules/catalogue/detail.tt | 8 +++---- > .../prog/en/modules/catalogue/results.tt | 12 +++++----- > .../prog/en/modules/virtualshelves/shelves.tt | 12 +++++----- > .../opac-tmpl/bootstrap/en/includes/masthead.inc | 8 +++---- > .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 4 ++-- > .../opac-tmpl/bootstrap/en/modules/opac-results.tt | 12 +++++----- > .../opac-tmpl/bootstrap/en/modules/opac-shelves.tt | 28 +++++++++++----------- > 7 files changed, 42 insertions(+), 42 deletions(-) > >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 ac1d878..20b6615 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -358,8 +358,8 @@ function verify_images() { > > [% IF shelves %] > <span class="results_summary"><span class="label">Lists that include this title: </span> >- [% FOREACH shelf IN shelves %] >- <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber %]">[% shelf.shelfname %]</a> >+ [% FOREACH s IN shelves %] >+ <a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% s.shelfnumber %]">[% s.shelfname %]</a> > [% IF ( loop.last ) %][% ELSE %]|[% END %] > [% END %] > </span> >@@ -523,8 +523,8 @@ function verify_images() { > [% IF shelves %] > <li><strong>Lists that include this title: </strong> > <ul> >- [% FOREACH shelf IN shelves %] >- <li><a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber %]">[% shelf.shelfname %]</a></li> >+ [% FOREACH s IN shelves %] >+ <li><a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=view&shelfnumber=[% s.shelfnumber %]">[% s.shelfname %]</a></li> > [% END %] > </ul> > </li> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >index e0b3beb..0a4b2cd 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >@@ -96,9 +96,9 @@ $('#sort_by').change(function() { > [% IF some_private_shelves.count %] > param1 += "<optgroup label=\""+_("Your lists:")+"\">"; > [% SET number_of_private_shelves = 0 %] >- [% FOREACH shelf IN some_private_shelves %] >- [% IF shelfnumber != shelf.shelfnumber %] >- param1 += "<option id=\"s[% shelf.shelfnumber %]\" value=\"addtolist\">[% shelf.shelfname |html %]<\/option>"; >+ [% FOREACH s IN some_private_shelves %] >+ [% IF shelfnumber != s.shelfnumber %] >+ param1 += "<option id=\"s[% s.shelfnumber %]\" value=\"addtolist\">[% s.shelfname |html %]<\/option>"; > [% SET number_of_private_shelves = number_of_private_shelves + 1 %] > [% IF number_of_private_shelves == 10 %][% LAST %][% END %] > [% END %] >@@ -108,9 +108,9 @@ $('#sort_by').change(function() { > [% IF some_public_shelves.count %] > param1 += "<optgroup label=\""+_("Public lists:")+"\">"; > [% SET number_of_public_shelves = 0 %] >- [% FOREACH shelf IN some_public_shelves %] >- [% IF shelfnumber != shelf.shelfnumber %] >- param1 += "<option id=\"s[% shelf.shelfnumber %]\" value=\"addtolist\">[% shelf.shelfname |html %]<\/option>"; >+ [% FOREACH s IN some_public_shelves %] >+ [% IF shelfnumber != s.shelfnumber %] >+ param1 += "<option id=\"s[% s.shelfnumber %]\" value=\"addtolist\">[% s.shelfname |html %]<\/option>"; > [% SET number_of_public_shelves = number_of_public_shelves + 1 %] > [% IF number_of_public_shelves == 10 %][% LAST %][% END %] > [% END %] >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 1ff8e8f..9a9cafe 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >@@ -134,9 +134,9 @@ $(document).ready(function(){ > [% IF some_private_shelves.count %] > param1 += "<optgroup label=\""+_("Your lists:")+"\">"; > [% SET number_of_private_shelves = 0 %] >- [% FOREACH shelf IN some_private_shelves %] >- [% IF shelfnumber != shelf.shelfnumber %] >- param1 += "<option id=\"s[% shelf.shelfnumber %]\" value=\"addtolist\">[% shelf.shelfname |html %]<\/option>"; >+ [% FOREACH s IN some_private_shelves %] >+ [% IF shelfnumber != s.shelfnumber %] >+ param1 += "<option id=\"s[% s.shelfnumber %]\" value=\"addtolist\">[% s.shelfname |html %]<\/option>"; > [% SET number_of_private_shelves = number_of_private_shelves + 1 %] > [% IF number_of_private_shelves == 10 %][% LAST %][% END %] > [% END %] >@@ -146,9 +146,9 @@ $(document).ready(function(){ > [% IF some_public_shelves.count %] > param1 += "<optgroup label=\""+_("Public lists:")+"\">"; > [% SET number_of_public_shelves = 0 %] >- [% FOREACH shelf IN some_public_shelves %] >- [% IF shelfnumber != shelf.shelfnumber %] >- param1 += "<option id=\"s[% shelf.shelfnumber %]\" value=\"addtolist\">[% shelf.shelfname |html %]<\/option>"; >+ [% FOREACH s IN some_public_shelves %] >+ [% IF shelfnumber != s.shelfnumber %] >+ param1 += "<option id=\"s[% s.shelfnumber %]\" value=\"addtolist\">[% s.shelfname |html %]<\/option>"; > [% SET number_of_public_shelves = number_of_public_shelves + 1 %] > [% IF number_of_public_shelves == 10 %][% LAST %][% END %] > [% END %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >index 76f6ab3..28dfa60 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc >@@ -40,8 +40,8 @@ > [% IF some_public_shelves.count %] > <li role="presentation"><a href="/cgi-bin/koha/opac-shelves.pl?op=list&category=2" tabindex="-1" role="menuitem"><strong>Public lists</strong></a></li> > [% SET number_of_public_shelves = 0 %] >- [% FOREACH shelf IN some_public_shelves %] >- <li role="presentation"><a href="/cgi-bin/koha/opac-shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber %]&sortfield=[% shelf.sortfield %]" tabindex="-1" role="menuitem">[% shelf.shelfname |html %]</a></li> >+ [% FOREACH s IN some_public_shelves %] >+ <li role="presentation"><a href="/cgi-bin/koha/opac-shelves.pl?op=view&shelfnumber=[% s.shelfnumber %]&sortfield=[% s.sortfield %]" tabindex="-1" role="menuitem">[% s.shelfname |html %]</a></li> > [% SET number_of_public_shelves = number_of_public_shelves + 1 %] > [% IF number_of_public_shelves >= 10 %][% LAST %][% END %] > [% END %] >@@ -57,8 +57,8 @@ > [% IF loggedinusername %] > [% IF some_private_shelves.count %] > [% SET number_of_private_shelves = 0 %] >- [% FOREACH shelf IN some_private_shelves %] >- <li role="presentation"><a href="/cgi-bin/koha/opac-shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber %]&sortfield=[% shelf.sortfield %]" tabindex="-1" role="menuitem">[% shelf.shelfname |html %]</a></li> >+ [% FOREACH s IN some_private_shelves %] >+ <li role="presentation"><a href="/cgi-bin/koha/opac-shelves.pl?op=view&shelfnumber=[% s.shelfnumber %]&sortfield=[% s.sortfield %]" tabindex="-1" role="menuitem">[% s.shelfname |html %]</a></li> > [% SET number_of_private_shelves = number_of_private_shelves + 1 %] > [% IF number_of_private_shelves >= 10 %][% LAST %][% END %] > [% END %] >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 60fda6a..811874f 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -391,8 +391,8 @@ > <!--This grabs all of the lists a bib record appears in --> > [% IF shelves %] > <span class="results_summary lists"><span class="label">List(s) this item appears in: </span> >- [% FOREACH shelf IN shelves %] >- <a href="/cgi-bin/koha/opac-shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber %]">[% shelf.shelfname %]</a> >+ [% FOREACH s IN shelves %] >+ <a href="/cgi-bin/koha/opac-shelves.pl?op=view&shelfnumber=[% s.shelfnumber %]">[% s.shelfname %]</a> > [% IF ( loop.last ) %][% ELSE %]|[% END %] > [% END %] > </span> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >index 7e48ed5..4b92450 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >@@ -751,9 +751,9 @@ $(document).ready(function(){ > [% IF loggedinusername AND some_private_shelves.count %] > param1 += "<optgroup label=\""+_("Your lists:")+"\">"; > [% SET number_of_private_shelves = 0 %] >- [% FOREACH shelf IN some_private_shelves %] >- [% IF shelfnumber != shelf.shelfnumber %] >- param1 += "<option id=\"s[% shelf.shelfnumber %]\" value=\"addtolist\">[% shelf.shelfname |html %]<\/option>"; >+ [% FOREACH s IN some_private_shelves %] >+ [% IF shelfnumber != s.shelfnumber %] >+ param1 += "<option id=\"s[% s.shelfnumber %]\" value=\"addtolist\">[% s.shelfname |html %]<\/option>"; > [% SET number_of_private_shelves = number_of_private_shelves + 1 %] > [% IF number_of_private_shelves == 10 %][% LAST %][% END %] > [% END %] >@@ -763,9 +763,9 @@ $(document).ready(function(){ > [% IF some_public_shelves.count %] > param1 += "<optgroup label=\""+_("Public lists:")+"\">"; > [% SET number_of_public_shelves = 0 %] >- [% FOREACH shelf IN some_public_shelves %] >- [% IF shelfnumber != shelf.shelfnumber %] >- param1 += "<option id=\"s[% shelf.shelfnumber %]\" value=\"addtolist\">[% shelf.shelfname |html %]<\/option>"; >+ [% FOREACH s IN some_public_shelves %] >+ [% IF shelfnumber != s.shelfnumber %] >+ param1 += "<option id=\"s[% s.shelfnumber %]\" value=\"addtolist\">[% s.shelfname |html %]<\/option>"; > [% SET number_of_public_shelves = number_of_public_shelves + 1 %] > [% IF number_of_public_shelves == 10 %][% LAST %][% END %] > [% END %] >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 1b5fac1..0ea5602 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >@@ -649,46 +649,46 @@ > </tr> > </thead> > <tbody> >- [% FOREACH shelf IN shelves %] >- [% SET contents = shelf.get_contents %] >+ [% FOREACH s IN shelves %] >+ [% SET contents = s.get_contents %] > <tr> >- <td><a href="/cgi-bin/koha/opac-shelves.pl?op=view&shelfnumber=[% shelf.shelfnumber %]">[% shelf.shelfname |html %]</a></td> >+ <td><a href="/cgi-bin/koha/opac-shelves.pl?op=view&shelfnumber=[% s.shelfnumber %]">[% s.shelfname |html %]</a></td> > <td>[% IF contents.count %][% contents.count %] [% IF contents.count == 1 %]item[% ELSE %]items[% END %][% ELSE %]Empty[% END %]</td> > <td> >- [% IF shelf.category == PRIVATE %] >- [% IF shelf.is_shared %]Shared[% ELSE %]Private[% END %] >+ [% IF s.category == PRIVATE %] >+ [% IF s.is_shared %]Shared[% ELSE %]Private[% END %] > [% ELSE %] > Public > [% END %] > </td> > <td> >- [% IF shelf.can_be_managed( loggedinusernumber ) %] >+ [% IF s.can_be_managed( loggedinusernumber ) %] > <form action="/cgi-bin/koha/opac-shelves.pl" method="get" class="form-inline"> >- <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber |html %]" /> >- <input type="hidden" name="category" value="[% shelf.category %]" /> >+ <input type="hidden" name="shelfnumber" value="[% s.shelfnumber |html %]" /> >+ <input type="hidden" name="category" value="[% s.category %]" /> > <input type="hidden" name="op" value="edit_form" /> > <input type="hidden" name="referer" value="list" /> > <input type="submit" class="editshelf" value="Edit" /> > </form> > [% END %] >- [% IF shelf.can_be_deleted( loggedinusernumber ) %] >+ [% IF s.can_be_deleted( loggedinusernumber ) %] > <form action="/cgi-bin/koha/opac-shelves.pl" method="post" class="form-inline"> > <input type="hidden" name="op" value="delete" /> > <input type="hidden" name="referer" value="list" /> > <input type='hidden' name='category' value='[% category %]' /> >- <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" /> >+ <input type="hidden" name="shelfnumber" value="[% s.shelfnumber | html %]" /> > <input type="submit" class="deleteshelf" onclick="return confirmDelete(MSG_CONFIRM_DELETE_LIST);" value="Delete" /> > </form> > [% END %] >- [% IF shelf.category == PRIVATE AND shelf.can_be_managed( loggedinusernumber ) AND Koha.Preference('OpacAllowSharingPrivateLists') %] >- <a href="/cgi-bin/koha/opac-shareshelf.pl?op=invite&shelfnumber=[% shelf.shelfnumber |html %]" class="">Share</a> >+ [% IF s.category == PRIVATE AND s.can_be_managed( loggedinusernumber ) AND Koha.Preference('OpacAllowSharingPrivateLists') %] >+ <a href="/cgi-bin/koha/opac-shareshelf.pl?op=invite&shelfnumber=[% s.shelfnumber |html %]" class="">Share</a> > [% END %] >- [% IF shelf.is_shared_with( loggedinusernumber ) %] >+ [% IF s.is_shared_with( loggedinusernumber ) %] > <form action="opac-shelves.pl" method="post" class="form-inline"> > <input type="hidden" name="op" value="remove_share" /> > <input type="hidden" name="referer" value="list" /> > <input type='hidden' name='category' value='[% category %]' /> >- <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber | html %]" /> >+ <input type="hidden" name="shelfnumber" value="[% s.shelfnumber | html %]" /> > <input type="submit" class="deleteshelf" onclick="return confirmDelete(MSG_CONFIRM_REMOVE_SHARE);" value="Remove share" /> > </form> > [% END %] >-- >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