Bugzilla – Attachment 62119 Details for
Bug 18426
Subscriptions batch editing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18426: Refactor subscriptions tables code in a BLOCK
Bug-18426-Refactor-subscriptions-tables-code-in-a-.patch (text/plain), 23.36 KB, created by
Julian Maurice
on 2017-04-13 07:14:21 UTC
(
hide
)
Description:
Bug 18426: Refactor subscriptions tables code in a BLOCK
Filename:
MIME Type:
Creator:
Julian Maurice
Created:
2017-04-13 07:14:21 UTC
Size:
23.36 KB
patch
obsolete
>From 034b1f3252d39a1e92e75fb47a013aabf7ef1da1 Mon Sep 17 00:00:00 2001 >From: Julian Maurice <julian.maurice@biblibre.com> >Date: Tue, 11 Apr 2017 11:26:36 +0200 >Subject: [PATCH] Bug 18426: Refactor subscriptions tables code in a BLOCK > >--- > .../prog/en/modules/serials/serials-search.tt | 350 +++++++++------------ > 1 file changed, 147 insertions(+), 203 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt >index 1728fb0edf..ceab7c5dcd 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-search.tt >@@ -10,7 +10,7 @@ > <script type="text/javascript"> > //<![CDATA[ > $(document).ready(function() { >- var osrlt = $("#osrlt").dataTable($.extend(true, {}, dataTablesDefaults, { >+ var osrlt = $("#opened table").dataTable($.extend(true, {}, dataTablesDefaults, { > "sPaginationType": "four_button", > "aoColumnDefs": [ > { 'bSortable': false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, >@@ -19,7 +19,7 @@ > ] > } ) ); > >- var csrlt = $("#csrlt").dataTable($.extend(true, {}, dataTablesDefaults, { >+ var csrlt = $("#closed table").dataTable($.extend(true, {}, dataTablesDefaults, { > // FIXME sort function of additional_fields! > "sPaginationType": "four_button", > "aoColumnDefs": [ >@@ -46,6 +46,149 @@ > > <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › [% IF ( done_searched ) %]<a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> › Search results[% ELSE %]Serials [% END %] </div> > >+ >+[% BLOCK subscriptions_table %] >+ <table id="osrlt"> >+ <thead> >+ <tr> >+ <th>ISSN</th> >+ <th class="anti-the">Title</th> >+ <th>Notes</th> >+ <th>Library</th> >+ <th>Location</th> >+ <th>Call number</th> >+ [% UNLESS closed %] >+ <th class="title-string">Expiration date</th> >+ [% END %] >+ [% FOR field IN additional_fields_for_subscription %] >+ <th>[% field.name %]</th> >+ [% END %] >+ <th class="NoSort">Actions</th> >+ </tr> >+ </thead> >+ <tfoot> >+ <tr> >+ <td><input type="text" class="dt-filter" data-column_num="0" placeholder="Search ISSN" /></td> >+ <td><input type="text" class="dt-filter" data-column_num="1" placeholder="Search title" /></td> >+ <td><input type="text" class="dt-filter" data-column_num="2" placeholder="Search notes" /></td> >+ <td><input type="text" class="dt-filter" data-column_num="3" placeholder="Search library" /></td> >+ <td><input type="text" class="dt-filter" data-column_num="4" placeholder="Search location" /></td> >+ <td><input type="text" class="dt-filter" data-column_num="5" placeholder="Search callnumber" /></td> >+ [% UNLESS closed %] >+ <td><input type="text" class="dt-filter" data-column_num="6" placeholder="Search expiration date" /></td> >+ [% END %] >+ [% FOR field IN additional_fields_for_subscription %] >+ <td><input type="text" class="dt-filter" data-column_num="[% loop.count + 6 %]" placeholder="Search [% field.name %]" /></td> >+ [% END %] >+ <td></td> >+ </tr> >+ </tfoot> >+ <tbody> >+ [% FOREACH subscription IN subscriptions %] >+ [% UNLESS subscription.cannotdisplay %] >+ <tr> >+ <td> >+ [% IF ( subscription.issn ) %][% subscription.issn %] >+ [% END %] >+ </td> >+ <td><a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" class="button" title="subscription detail">[% subscription.title |html %]</a> >+ </td> >+ <td>[% IF ( subscription.publicnotes ) %][% subscription.publicnotes %][% END %] >+ [% IF ( subscription.internalnotes ) %]([% subscription.internalnotes %])[% END %] >+ </td> >+ <td> >+ [% IF ( subscription.branchcode ) %][% Branches.GetName( subscription.branchcode ) %][% END %] >+ </td> >+ <td> >+ [% IF ( subscription.location ) %][% AuthorisedValues.GetByCode( 'LOC', subscription.location ) %][% END %] >+ </td> >+ <td> >+ [% IF ( subscription.callnumber ) %][% subscription.callnumber %][% END %] >+ </td> >+ [% UNLESS closed %] >+ <td> >+ [% IF ( subscription.enddate ) %] >+ <span title="[% subscription.enddate %]">[% subscription.enddate | $KohaDates %]</span> >+ [% ELSE %] >+ <span title="0000-00-00"></span> >+ [% END %] >+ </td> >+ [% END %] >+ >+ [% FOR field IN additional_fields_for_subscription %] >+ [% IF field.authorised_value_category %] >+ <td>[% AuthorisedValues.GetByCode( field.authorised_value_category, subscription.additional_fields.${field.name} ) %]</td> >+ [% ELSE %] >+ <td>[% subscription.additional_fields.${field.name} %]</td> >+ [% END %] >+ [% END %] >+ >+ <td> >+ <div class="dropdown"> >+ [% IF closed %] >+ <a class="btn btn-default btn-xs dropdown-toggle" id="closedsubactions[% subscription.subscriptionid %]" role="button" data-toggle="dropdown" href="#"> >+ Actions <b class="caret"></b> >+ </a> >+ <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="closedsubactions[% subscription.subscriptionid %]"> >+ >+ [% IF ( routing && CAN_user_serials_routing ) %] >+ [% UNLESS ( subscription.cannotedit ) %] >+ <li> >+ <a href="/cgi-bin/koha/serials/serials-search.pl?subscriptionid=[% subscription.subscriptionid %]&op=reopen&routing=[% subscription.routing %]&searched=1&title_filter=[% title_filter | uri %]&ISSN_filter=[% ISSN_filter | uri %]&EAN_filter=[% EAN_filter | uri %]&published_filter=[% publisher_filter | uri %]&bookseller_filter=[% bookseller_filter | uri %]&branch_filter=[% branch_filter | uri %]" id="reopensub"> <i class="fa fa-repeat"></i> Reopen</a> >+ </li> >+ [% END %] >+ [% END # IF ( routing && CAN_user_serials_routing ) %] >+ >+ <li> >+ <a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]"><i class="fa fa-list-alt"></i> Issue history</a> >+ </li> >+ >+ </ul> >+ [% ELSE %] >+ <div class="btn-group"> >+ [% IF ( CAN_user_serials_receive_serials ) %] >+ [%# There should be no space between these two buttons, it would render badly %] >+ <a class="btn btn-default btn-xs" role="button" >+ href="/cgi-bin/koha/serials/serials-edit.pl?subscriptionid=[% subscription.subscriptionid %]&serstatus=1,3,7"><i >+ class="fa fa-inbox"></i> Serial receive</a><a >+ class="btn btn-default btn-xs dropdown-toggle" id="subactions[% subscription.subscriptionid %]" role="button" >+ data-toggle="dropdown" href="#"><b class="caret"></b></a> >+ [% ELSE %] >+ <a class="btn btn-default btn-xs dropdown-toggle" id="subactions[% subscription.subscriptionid %]" role="button" data-toggle="dropdown" href="#">Actions <b class="caret"></b></a> >+ [% END %] >+ <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="subactions[% subscription.subscriptionid %]"> >+ >+ [% IF ( routing && CAN_user_serials_routing ) %] >+ [% IF ( subscription.cannotedit ) %] >+ [% ELSE %] >+ [% IF ( subscription.routingedit ) %] >+ <li> >+ <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]"><i class="fa fa-pencil"></i> Edit routing list ([% subscription.routingedit %])</a> >+ </li> >+ [% ELSE %] >+ <li> >+ <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]&op=new"> <i class="fa fa-plus"></i> New routing list</a> >+ </li> >+ [% END %] >+ [% END %] >+ [% END # IF ( routing && CAN_user_serials_routing ) %] >+ >+ <li> >+ <a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]"><i class="fa fa-list-alt"></i> Issue history</a> >+ </li> >+ </ul> >+ </div> >+ [% END %] >+ </div> >+ </td> >+ >+ </tr> >+ [% END %] >+ [% END %] >+ </tbody> >+ </table> >+[% END %] >+ > <div id="doc3" class="yui-t2"> > <div id="bd"> > <div id="yui-main"> >@@ -139,118 +282,7 @@ > </ul> > <div id="opened"> > [% IF openedsubscriptions %] >- <table id="osrlt"> >- <thead> >- <tr> >- <th>ISSN</th> >- <th class="anti-the">Title</th> >- <th>Notes</th> >- <th>Library</th> >- <th>Location</th> >- <th>Call number</th> >- <th class="title-string">Expiration date</th> >- [% FOR field IN additional_fields_for_subscription %] >- <th>[% field.name %]</th> >- [% END %] >- <th class="NoSort">Actions</th> >- </tr> >- </thead> >- <tfoot> >- <tr> >- <td><input type="text" class="dt-filter" data-column_num="0" placeholder="Search ISSN" /></td> >- <td><input type="text" class="dt-filter" data-column_num="1" placeholder="Search title" /></td> >- <td><input type="text" class="dt-filter" data-column_num="2" placeholder="Search notes" /></td> >- <td><input type="text" class="dt-filter" data-column_num="3" placeholder="Search library" /></td> >- <td><input type="text" class="dt-filter" data-column_num="4" placeholder="Search location" /></td> >- <td><input type="text" class="dt-filter" data-column_num="5" placeholder="Search callnumber" /></td> >- <td><input type="text" class="dt-filter" data-column_num="6" placeholder="Search expiration date" /></td> >- [% FOR field IN additional_fields_for_subscription %] >- <td><input type="text" class="dt-filter" data-column_num="[% loop.count + 6 %]" placeholder="Search [% field.name %]" /></td> >- [% END %] >- <td></td> >- </tr> >- </tfoot> >- <tbody> >- [% FOREACH subscription IN openedsubscriptions %] >- [% UNLESS subscription.cannotdisplay %] >- <tr> >- <td> >- [% IF ( subscription.issn ) %][% subscription.issn %] >- [% END %] >- </td> >- <td><a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" class="button" title="subscription detail">[% subscription.title |html %]</a> >- </td> >- <td>[% IF ( subscription.publicnotes ) %][% subscription.publicnotes %][% END %] >- [% IF ( subscription.internalnotes ) %]([% subscription.internalnotes %])[% END %] >- </td> >- <td> >- [% IF ( subscription.branchcode ) %][% Branches.GetName( subscription.branchcode ) %][% END %] >- </td> >- <td> >- [% IF ( subscription.location ) %][% AuthorisedValues.GetByCode( 'LOC', subscription.location ) %][% END %] >- </td> >- <td> >- [% IF ( subscription.callnumber ) %][% subscription.callnumber %][% END %] >- </td> >- <td> >- [% IF ( subscription.enddate ) %] >- <span title="[% subscription.enddate %]">[% subscription.enddate | $KohaDates %]</span> >- [% ELSE %] >- <span title="0000-00-00"></span> >- [% END %] >- </td> >- >- [% FOR field IN additional_fields_for_subscription %] >- [% IF field.authorised_value_category %] >- <td>[% AuthorisedValues.GetByCode( field.authorised_value_category, subscription.additional_fields.${field.name} ) %]</td> >- [% ELSE %] >- <td>[% subscription.additional_fields.${field.name} %]</td> >- [% END %] >- [% END %] >- >- <td> >- <div class="dropdown"> >- <div class="btn-group"> >- [% IF ( CAN_user_serials_receive_serials ) %] >- [%# There should be no space between these two buttons, it would render badly %] >- <a class="btn btn-default btn-xs" role="button" >- href="/cgi-bin/koha/serials/serials-edit.pl?subscriptionid=[% subscription.subscriptionid %]&serstatus=1,3,7"><i >- class="fa fa-inbox"></i> Serial receive</a><a >- class="btn btn-default btn-xs dropdown-toggle" id="subactions[% subscription.subscriptionid %]" role="button" >- data-toggle="dropdown" href="#"><b class="caret"></b></a> >- [% ELSE %] >- <a class="btn btn-default btn-xs dropdown-toggle" id="subactions[% subscription.subscriptionid %]" role="button" data-toggle="dropdown" href="#">Actions <b class="caret"></b></a> >- [% END %] >- <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="subactions[% subscription.subscriptionid %]"> >- >- [% IF ( routing && CAN_user_serials_routing ) %] >- [% IF ( subscription.cannotedit ) %] >- [% ELSE %] >- [% IF ( subscription.routingedit ) %] >- <li> >- <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]"><i class="fa fa-pencil"></i> Edit routing list ([% subscription.routingedit %])</a> >- </li> >- [% ELSE %] >- <li> >- <a href="/cgi-bin/koha/serials/routing.pl?subscriptionid=[% subscription.subscriptionid %]&op=new"> <i class="fa fa-plus"></i> New routing list</a> >- </li> >- [% END %] >- [% END %] >- [% END # IF ( routing && CAN_user_serials_routing ) %] >- >- <li> >- <a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]"><i class="fa fa-list-alt"></i> Issue history</a> >- </li> >- </ul> >- </div> >- </div> >- </td> >- >- </tr> >- [% END %] >- [% END %] >- </tbody> >- </table> >+ [% INCLUDE subscriptions_table subscriptions = openedsubscriptions %] > [% ELSE %] > <div class="dialog message"> > <p>Your search returned no open subscriptions.</p> >@@ -259,95 +291,7 @@ > </div> > <div id="closed"> > [% IF closedsubscriptions %] >- <table id="csrlt"> >- <!-- FIXME add additional_fields for closed subs --> >- <thead> >- <tr> >- <th>ISSN</th> >- <th class="anti-the">Title</th> >- <th>Notes</th> >- <th>Library</th> >- <th>Location</th> >- <th>Call number</th> >- [% FOR field IN additional_fields_for_subscription %] >- <th>[% field.name %]</th> >- [% END %] >- <th class="NoSort">Actions</th> >- </tr> >- </thead> >- <tfoot> >- <tr> >- <td><input type="text" class="dt-filter" data-column_num="0" placeholder="Search ISSN" /></td> >- <td><input type="text" class="dt-filter" data-column_num="1" placeholder="Search title" /></td> >- <td><input type="text" class="dt-filter" data-column_num="2" placeholder="Search notes" /></td> >- <td><input type="text" class="dt-filter" data-column_num="3" placeholder="Search library" /></td> >- <td><input type="text" class="dt-filter" data-column_num="4" placeholder="Search location" /></td> >- <td><input type="text" class="dt-filter" data-column_num="5" placeholder="Search callnumber" /></td> >- [% FOR field IN additional_fields_for_subscription %] >- <td><input type="text" class="dt-filter" data-column_num="[% loop.count + 5 %]" placeholder="Search [% field.name %]" /></td> >- [% END %] >- <td></td> >- </tr> >- </tfoot> >- <tbody> >- [% FOREACH subscription IN closedsubscriptions %] >- [% UNLESS subscription.cannotdisplay %] >- <tr> >- <td> >- [% IF ( subscription.issn ) %] >- [% subscription.issn %] >- [% END %] >- </td> >- <td> >- <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% subscription.subscriptionid %]" class="button" title="subscription detail">[% subscription.title |html %]</a> >- </td> >- <td> >- [% IF ( subscription.notes ) %][% subscription.notes %][% END %] >- [% IF ( subscription.internalnotes ) %]([% subscription.internalnotes %])[% END %] >- </td> >- <td> >- [% IF ( subscription.branchcode ) %][% Branches.GetName( subscription.branchcode ) %][% END %] >- </td> >- <td> >- [% IF ( subscription.location ) %][% AuthorisedValues.GetByCode( 'LOC', subscription.location ) %][% END %] >- </td> >- <td> >- [% IF ( subscription.callnumber ) %][% subscription.callnumber %][% END %] >- </td> >- [% FOR field IN additional_fields_for_subscription %] >- [% IF field.authorised_value_category %] >- <td>[% AuthorisedValues.GetByCode( field.authorised_value_category, subscription.additional_fields.${field.name} ) %]</td> >- [% ELSE %] >- <td>[% subscription.additional_fields.${field.name} %]</td> >- [% END %] >- [% END %] >- <td> >- <div class="dropdown"> >- <a class="btn btn-default btn-xs dropdown-toggle" id="closedsubactions[% subscription.subscriptionid %]" role="button" data-toggle="dropdown" href="#"> >- Actions <b class="caret"></b> >- </a> >- <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="closedsubactions[% subscription.subscriptionid %]"> >- >- [% IF ( routing && CAN_user_serials_routing ) %] >- [% UNLESS ( subscription.cannotedit ) %] >- <li> >- <a href="/cgi-bin/koha/serials/serials-search.pl?subscriptionid=[% subscription.subscriptionid %]&op=reopen&routing=[% subscription.routing %]&searched=1&title_filter=[% title_filter | uri %]&ISSN_filter=[% ISSN_filter | uri %]&EAN_filter=[% EAN_filter | uri %]&published_filter=[% publisher_filter | uri %]&bookseller_filter=[% bookseller_filter | uri %]&branch_filter=[% branch_filter | uri %]" id="reopensub"> <i class="fa fa-repeat"></i> Reopen</a> >- </li> >- [% END %] >- [% END # IF ( routing && CAN_user_serials_routing ) %] >- >- <li> >- <a href="/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=[% subscription.subscriptionid %]"><i class="fa fa-list-alt"></i> Issue history</a> >- </li> >- >- </ul> >- </div> >- </td> >- </tr> >- [% END %] >- [% END %] >- </tbody> >- </table> >+ [% INCLUDE subscriptions_table subscriptions = closedsubscriptions closed = 1 %] > [% ELSE %] > <div class="dialog message"> > <p>Your search returned no closed subscriptions.</p> >-- >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 18426
:
62119
|
62120
|
64198
|
74393
|
74394
|
74395
|
74396
|
74458
|
74536
|
74537
|
74676
|
74677
|
74678
|
74679
|
74680
|
74681