Bugzilla – Attachment 78176 Details for
Bug 12297
Waitingreserves code duplication
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12297: Fix waitingreserves code duplication
0001-Bug-12297-Fix-waitingreserves-code-duplication.patch (text/plain), 12.78 KB, created by
paxed
on 2018-08-27 10:08:21 UTC
(
hide
)
Description:
Bug 12297: Fix waitingreserves code duplication
Filename:
MIME Type:
Creator:
paxed
Created:
2018-08-27 10:08:21 UTC
Size:
12.78 KB
patch
obsolete
>From b3e9e32b05d7d0072c4020ef8d99efe38f0a1a80 Mon Sep 17 00:00:00 2001 >From: Pasi Kallinen <pasi.kallinen@joensuu.fi> >Date: Mon, 27 Aug 2018 13:04:49 +0300 >Subject: [PATCH] Bug 12297: Fix waitingreserves code duplication > >waitingreserves.tt has two near-identical tables, holdst and holdso. >These should be folded into a single TT BLOCK, which is then called >with appropriate parameters to generate the two tables. > >Test plan: > >1) apply patch >2) Go to the waitingreserves-page. It should look and behave identical > to how it was before. > >Signed-off-by: Pasi Kallinen <pasi.kallinen@joensuu.fi> >--- > .../prog/en/modules/circ/waitingreserves.tt | 165 ++++++++------------- > 1 file changed, 63 insertions(+), 102 deletions(-) > >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 8c442941da..04d044fa9e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt >@@ -19,6 +19,61 @@ > › <a href="/cgi-bin/koha/circ/waitingreserves.pl">Holds awaiting pickup</a> > </div> > >+[% BLOCK show_hold_table %] >+<table id="[% table.id %]"> >+<thead><tr> >+ <th class="title-string">Waiting since</th> >+ <th class="title-string">Date hold placed</th> >+ <th class="anti-the">Title</th> >+ <th>Patron</th> >+ <th>Home branch</th> >+ <th>Current location</th> >+ <th>Call number</th> >+ <th>Copy number</th> >+ <th>Enumeration</th> >+ <th>Action</th> >+</tr></thead> >+<tbody> >+ [% FOREACH reserveloo IN reserveloop %] >+ <tr> >+ <td><span title="[% reserveloo.waitingdate | html %]">[% reserveloo.waitingdate | $KohaDates %]</span></td> >+ <td><span title="[% reserveloo.reservedate | html %]">[% reserveloo.reservedate | $KohaDates %]</span></td> >+ <td>[% INCLUDE 'biblio-default-view.inc' biblionumber = reserveloo.biblionumber %] >+ [% reserveloo.title | html %] [% FOREACH subtitl IN reserveloo.subtitle %] [% subtitl.subfield | html %][% END %] >+ </a> >+ [% UNLESS ( item_level_itypes ) %][% IF ( reserveloo.itemtype ) %] (<b>[% reserveloo.itemtype | html %]</b>)[% END %][% END %] >+ <br />Barcode: [% reserveloo.barcode | html %] >+ </td> >+ <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% reserveloo.patron.borrowernumber | html %]">[% reserveloo.patron.surname | html %], [% reserveloo.patron.firstname | html %]</a> >+ [% IF ( reserveloo.patron.phone ) %]<br />[% reserveloo.patron.phone | html %][% END %] >+ [% IF ( reserveloo.patron.first_valid_email_address ) %]<br /><a href="mailto:[% reserveloo.patron.first_valid_email_address | html %]?subject=[% table.subject | replace('\$1', reserveloo.title) | html %]"> >+ [% reserveloo.patron.first_valid_email_address | html %]</a>[% END %] >+ </td> >+ <td>[% Branches.GetName( reserveloo.homebranch ) | html %]</td> >+ <td>[% Branches.GetName( reserveloo.holdingbranch ) | html %]</td> >+ <td>[% reserveloo.itemcallnumber | html %]</td> >+ <td>[% reserveloo.copynumber | html %]</td> >+ <td>[% reserveloo.enumchron | html %]</td> >+ <td> >+ <form name="cancelReserve" action="waitingreserves.pl" method="post"> >+ <input type="hidden" name="borrowernumber" value="[% reserveloo.borrowernum | html %]" /> >+ <input type="hidden" name="itemnumber" value="[% reserveloo.itemnumber | html %]" /> >+ <input type="hidden" name="fbr" value="[% reserveloo.holdingbranch | html %]" /> >+ <input type="hidden" name="tbr" value="[% reserveloo.homebranch | html %]" /> >+ <input type="hidden" name="tab" value="[% table.tab %]"> >+ [% IF ( reserveloo.dotransfer ) %] >+ <input type="submit" value="Cancel hold and return to : [% Branches.GetName( reserveloo.homebranch ) | html %]" /> >+ [% ELSE %] >+ <input type="submit" value="Cancel hold" /> >+ [% END %] >+ </form> >+ </td> >+ </tr> >+ [% END %] >+</tbody> >+</table> >+[% END # show_hold_table %] >+ > [% IF Koha.Preference('CircSidebar') %]<div id="doc3" class="yui-t2">[% ELSE %]<div id="doc3" class="yui-t7">[% END %] > > <div id="bd"> >@@ -68,64 +123,16 @@ > </li> > </ul> > <div id="holdswaiting"> >- [% IF ( reserveloop ) %] >- <table id="holdst"> >- <thead><tr> >- <th class="title-string">Waiting since</th> >- <th class="title-string">Date hold placed</th> >- <th class="anti-the">Title</th> >- <th>Patron</th> >- <th>Home branch</th> >- <th>Current location</th> >- <th>Call number</th> >- <th>Copy number</th> >- <th>Enumeration</th> >- <th>Action</th> >- </tr></thead> >- <tbody>[% FOREACH reserveloo IN reserveloop %] >- <tr> >- <td><span title="[% reserveloo.waitingdate | html %]">[% reserveloo.waitingdate | $KohaDates %]</span></td> >- <td><span title="[% reserveloo.reservedate | html %]">[% reserveloo.reservedate | $KohaDates %]</span></td> >- <td>[% INCLUDE 'biblio-default-view.inc' biblionumber = reserveloo.biblionumber %] >- [% reserveloo.title | html %] [% FOREACH subtitl IN reserveloo.subtitle %] [% subtitl.subfield | html %][% END %] >- </a> >- [% UNLESS ( item_level_itypes ) %][% IF ( reserveloo.itemtype ) %] (<b>[% reserveloo.itemtype | html %]</b>)[% END %][% END %] >- <br />Barcode: [% reserveloo.barcode | html %] >- </td> >- <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% reserveloo.patron.borrowernumber | html %]">[% reserveloo.patron.surname | html %], [% reserveloo.patron.firstname | html %]</a> >- [% IF ( reserveloo.patron.phone ) %]<br />[% reserveloo.patron.phone | html %][% END %] >- [% IF ( reserveloo.patron.first_valid_email_address ) %]<br /><a href="mailto:[% reserveloo.patron.first_valid_email_address | html %]?subject=Hold waiting: [% reserveloo.title | html %]"> >- [% reserveloo.patron.first_valid_email_address | html %]</a>[% END %] >- </td> >- <td>[% Branches.GetName( reserveloo.homebranch ) | html %]</td> >- <td>[% Branches.GetName( reserveloo.holdingbranch ) | html %]</td> >- <td>[% reserveloo.itemcallnumber | html %]</td> >- <td>[% reserveloo.copynumber | html %]</td> >- <td>[% reserveloo.enumchron | html %]</td> >- <td> >- <form name="cancelReserve" action="waitingreserves.pl" method="post"> >- <input type="hidden" name="borrowernumber" value="[% reserveloo.borrowernum | html %]" /> >- <input type="hidden" name="itemnumber" value="[% reserveloo.itemnumber | html %]" /> >- <input type="hidden" name="fbr" value="[% reserveloo.holdingbranch | html %]" /> >- <input type="hidden" name="tbr" value="[% reserveloo.homebranch | html %]" /> >- <input type="hidden" name="tab" value="holdswaiting"> >- [% IF ( reserveloo.dotransfer ) %] >- <input type="submit" value="Cancel hold and return to : [% Branches.GetName( reserveloo.homebranch ) | html %]" /> >- [% ELSE %] >- <input type="submit" value="Cancel hold" /> >- [% END %] >- </form> >- </td> >- </tr> >- [% END %]</tbody> >- </table> >+ [% IF ( reserveloop ) %] >+ [% mailsubject = BLOCK %]Hold waiting: $1[% END %] >+ [% PROCESS show_hold_table table = { "id" => "holdst", "subject" => mailsubject, "tab" => "holdswaiting" } %] > [% ELSE %] > <div class="dialog message">No holds found.</div> > [% END %] > </div> > <div id="holdsover"> >- [% IF ( ReservesMaxPickUpDelay ) %]<p>Holds listed here have been awaiting pickup for more than [% ReservesMaxPickUpDelay | html %] days.</p>[% END %] >- [% IF ( overloop ) %] >+ [% IF ( ReservesMaxPickUpDelay ) %]<p>Holds listed here have been awaiting pickup for more than [% ReservesMaxPickUpDelay | html %] days.</p>[% END %] >+ [% IF ( overloop ) %] > <form name="cancelAllReserve" action="waitingreserves.pl" method="post"> > <input type="hidden" name="cancelall" value="1" /> > <input type="hidden" name="allbranches" value="[% allbranches | html %]" /> >@@ -140,57 +147,11 @@ > Only items that need not be transferred will be cancelled (TransferWhenCancelAllWaitingHolds sypref) > [% END %] > >- <table id="holdso"> >- <thead><tr> >- <th class="title-string">Waiting since</th> >- <th class="title-string">Date hold placed</th> >- <th class="anti-the">Title</th> >- <th>Patron</th> >- <th>Home branch</th> >- <th>Current location</th> >- <th>Call number</th> >- <th>Copy number</th> >- <th>Enumeration</th> >- <th>Action</th> >- </tr></thead> >- <tbody>[% FOREACH overloo IN overloop %] >- <tr> >- <td><span title="[% overloo.waitingdate | html %]">[% overloo.waitingdate | $KohaDates %]</span></td> >- <td><span title="[% overloo.reservedate | html %]">[% overloo.reservedate | $KohaDates %]</span></td> >- <td>[% INCLUDE 'biblio-default-view.inc' biblionumber = overloo.biblionumber %][% overloo.title | html %] >- [% FOREACH subtitl IN overloo.subtitle %] [% subtitl.subfield | html %][% END %] >- </a> >- [% UNLESS ( item_level_itypes ) %][% IF ( overloo.itemtype ) %] (<b>[% overloo.itemtype | html %]</b>)[% END %][% END %] >- <br />Barcode: [% overloo.barcode | html %] >- </td> >- <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% overloo.patron.borrowernumber | html %]">[% overloo.patron.surname | html %], [% overloo.patron.firstname | html %]</a><br />[% overloo.patron.phone | html %]<br /> >- [% IF ( overloo.patron.first_valid_email_address ) %]<a href="mailto:[% overloo.patron.first_valid_email_address | html %]?subject=Reservation: [% overloo.title |url %]"> >- [% overloo.patron.first_valid_email_address | html %]</a>[% END %] >- </td> >- <td>[% Branches.GetName( overloo.homebranch ) | html %]</td> >- <td>[% Branches.GetName( overloo.holdingbranch ) | html %]</td> >- <td>[% overloo.itemcallnumber | html %]</td> >- <td>[% overloo.copynumber | html %]</td> >- <td>[% overloo.enumchron | html %]</td> >- <td><form name="cancelReserve" action="waitingreserves.pl" method="post"> >- <input type="hidden" name="borrowernumber" value="[% overloo.borrowernum | html %]" /> >- <input type="hidden" name="itemnumber" value="[% overloo.itemnumber | html %]" /> >- <input type="hidden" name="fbr" value="[% overloo.holdingbranch | html %]" /> >- <input type="hidden" name="tbr" value="[% overloo.homebranch | html %]" /> >- <input type="hidden" name="tab" value="holdsover"> >- [% IF ( overloo.dotransfer ) %] >- <input type="submit" value="Cancel hold and return to : [% Branches.GetName( overloo.homebranch ) | html %]" /> >- [% ELSE %] >- <input type="submit" value="Cancel hold" /> >- [% END %] >- </form> >- </td> >- </tr> >- [% END %]</tbody> >- </table> >+ [% mailsubject = BLOCK %]Reservation: $1[% END %] >+ [% PROCESS show_hold_table reserveloop=overloop table = { "id" => "holdso", "subject" => mailsubject, "tab" => "holdsover" } %] > [% ELSE %] > <div class="dialog message">No holds found.</div> >- [% END %] >+ [% END %] > </div> > </div> > [% END %] >-- >2.11.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 12297
: 78176