Bugzilla – Attachment 31849 Details for
Bug 12984
Improvement of the funds list view on acqui home
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12984: Improvement of the funds list view - acqui home
Bug-12984-Improvement-of-the-funds-list-view---acq.patch (text/plain), 10.23 KB, created by
Jonathan Druart
on 2014-09-24 09:23:15 UTC
(
hide
)
Description:
Bug 12984: Improvement of the funds list view - acqui home
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-09-24 09:23:15 UTC
Size:
10.23 KB
patch
obsolete
>From 648fc962194ad4c72804249740179bc33534647e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 24 Sep 2014 11:19:52 +0200 >Subject: [PATCH] Bug 12984: Improvement of the funds list view - acqui home > >Bug 11578 improved the funds list view in the administration module. >It would be great to have the same improvement on the acquisition >home page. > >This improvement groups funds by budget and displays them with a >hierarchy. > >Test plan: >0/ Create a budget and fund hierarchy, with active and inactive budgets. >1/ Go on the acquisition home page and verify the values are the same as >before >2/ Verify the funds are correctly listed >3/ Verify the links on top of table work (expand/collapse all, show/hide >inactive budgets). >--- > .../prog/en/modules/acqui/acqui-home.tt | 150 ++++++++++++--------- > 1 file changed, 88 insertions(+), 62 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt >index 3a4cf90..6c3b3eb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt >@@ -1,8 +1,11 @@ > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Acquisitions</title> >-<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> > [% INCLUDE 'doc-head-close.inc' %] >+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> > [% INCLUDE 'datatables.inc' %] >+<link href="[% interface %]/lib/jquery/plugins/treetable/stylesheets/jquery.treetable.css" rel="stylesheet" type="text/css" /> >+<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/treetable/jquery.treetable.js"></script> >+ > <script type="text/javascript"> > //<![CDATA[ > >@@ -15,33 +18,70 @@ $(document).ready(function() { > inactive.hide(); > active.show(); > >- $('#showallbudgets').click(function() { >- if ( $('#showallbudgets:checked').val() !== undefined) { >- inactive.show(); >- active.hide(); >- } >- else { >- inactive.hide(); >- active.show(); >- } >- }); >- var srlt = $("#accounts").dataTable($.extend(true, {}, dataTablesDefaults, { >- "aoColumns": [ >- null, >- null, >- null, >- null, >- null, >- { "sType": "title-numeric" }, >- { "sType": "title-numeric" }, >- { "sType": "title-numeric" }, >- { "sType": "title-numeric" } >+ var oTable = $("#accounts").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "fnDrawCallback": function ( oSettings ) { >+ if ( oSettings.aiDisplay.length == 0 ) >+ { >+ return; >+ } >+ >+ var nTrs = $('#accounts tbody tr'); >+ var iColspan = nTrs[0].getElementsByTagName('td').length; >+ var sLastGroup = ""; >+ for ( var i=0 ; i<nTrs.length ; i++ ) >+ { >+ var iDisplayIndex = oSettings._iDisplayStart + i; >+ var sGroup = oSettings.aoData[ oSettings.aiDisplay[iDisplayIndex] ]._aData[1]; >+ if ( sGroup != sLastGroup ) >+ { >+ var nGroup = document.createElement( 'tr' ); >+ var nCell = document.createElement( 'td' ); >+ nCell.colSpan = iColspan; >+ nCell.className = "group"; >+ nCell.innerHTML = sGroup; >+ nGroup.appendChild( nCell ); >+ nTrs[i].parentNode.insertBefore( nGroup, nTrs[i] ); >+ sLastGroup = sGroup; >+ } >+ } >+ }, >+ "aoColumnDefs": [ >+ { "bVisible": false, "aTargets": [ 0, 1 ] }, >+ { "bSortable": false, "aTargets": ["_all"] } > ], >- 'sDom': 't', >+ 'bSort': true, >+ 'aaSortingFixed': [[ 1, 'asc' ]], > 'bPaginate': false, >- 'bFilter': false, >- 'bInfo': false >- } ) ); >+ "bAutoWidth": false >+ })); >+ >+ $(oTable).treetable({ >+ expandable: true >+ }); >+ $(oTable).treetable('expandAll'); >+ $("#expand_all").click(function(e){ >+ e.preventDefault(); >+ $(oTable).treetable('expandAll'); >+ }); >+ $("#collapse_all").click(function(e){ >+ e.preventDefault(); >+ $(oTable).treetable('collapseAll'); >+ }); >+ >+ $("#hide_inactive").click(function(e){ >+ e.preventDefault(); >+ oTable.fnFilter( 1, 0 ); // Show only active=1 >+ inactive.hide(); >+ active.show(); >+ }); >+ $("#show_inactive").click(function(e){ >+ e.preventDefault(); >+ oTable.fnFilter( '', 0 ); >+ inactive.show(); >+ active.hide(); >+ }); >+ $("#hide_inactive").click(); >+ > }); > //]]> > </script> >@@ -101,28 +141,33 @@ $(document).ready(function() { > <h3>All available funds[% IF ( branchname ) %] for [% branchname %][% END %]</h3> > > <div id="BudgetsAndFunds"> >- <p><label for="showallbudgets">Show active and inactive:</label> <input type="checkbox" id="showallbudgets" /></p> > <table id="accounts"> >+ <caption> >+ <span class="actions"><a href="#" id="expand_all">Expand all</a> >+ | <a href="#" id="collapse_all">Collapse all</a> >+ | <a href="#" id="hide_inactive">Hide inactive budgets</a> >+ | <a href="#" id="show_inactive">Show inactive budgets</a></span> >+ </caption> >+ > <thead> > <tr> >- <th>Fund</th> >+ <th>Active</th> >+ <th>Budget period description</th> >+ <th>Fund code</th> > <th>Fund name</th> >- <th class="b_inactive">Active</th> > <th>Owner</th> > <th>Library</th> > <th>Amount</th> > <th>Ordered</th> > <th>Spent</th> >- <th>Avail</th> >+ <th>Total available</th> > </tr> > </thead> > <tfoot id="funds_total"> > <tr> >- <th>Total</th> >- <th> </th> >- <th class="b_inactive"> </th> >- <th> </th> >- <th> </th> >+ <th></th> >+ <th></th> >+ <th colspan="4">Total</th> > <th class="data"><span class="bu_active">[% total %]</span><span class="bu_inactive" >[% total_active %]</span></th> > <th class="data"><span class="bu_active">[% totordered %]</span><span class="bu_inactive" >[% totordered_active %]</span></th> > <th class="data"><span class="bu_active">[% totspent %]</span><span class="bu_inactive" >[% totspent_active %]</span></th> >@@ -131,8 +176,14 @@ $(document).ready(function() { > </tfoot> > <tbody> > [% FOREACH loop_budge IN loop_budget %] >- [% IF ( loop_budge.budget_period_active ) %] >- <tr> >+ [% IF loop_budge.budget_parent_id %] >+ <tr data-tt-id="[% loop_budge.budget_id %]" data-tt-parent-id="[% loop_budge.budget_parent_id %]"> >+ [% ELSE %] >+ <tr data-tt-id="[% loop_budge.budget_id %]"> >+ [% END %] >+ >+ <td>[% loop_budge.budget_period_active %]</td> >+ <td>Budget [% loop_budge.budget_period_description %] [id=[% loop_budge.budget_period_id %]][% UNLESS loop_budge.budget_period_active %] (inactive)[% END %]</td> > <td> > [% IF ( CAN_user_acquisition_budget_manage ) %] > <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% loop_budge.budget_period_id %]">[% loop_budge.budget_code %]</a> >@@ -141,7 +192,6 @@ $(document).ready(function() { > [% END %] > </td> > <td>[% loop_budge.budget_name %]</td> >- <td class="b_inactive">Active</td> > <td>[% IF ( loop_budge.budget_owner_borrowernumber ) %] > <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loop_budge.budget_owner_borrowernumber %]">[% loop_budge.budget_owner_surname %], [% loop_budge.budget_owner_firstname %]</a> > [% ELSE %] >@@ -154,30 +204,6 @@ $(document).ready(function() { > <td class="data"><span title="[% loop_budge.budget_spent %]"><a href="spent.pl?fund=[% loop_budge.budget_id %]&fund_code=[% loop_budge.budget_code %]">[% loop_budge.formatted_budget_spent %]</span></a></td> > <td class="data"><span title="[% loop_budge.budget_avail %]">[% loop_budge.formatted_budget_avail %]</td> > </tr> >- [% ELSE %] >- <tr class="b_inactive"> >- <td> >- [% IF ( CAN_user_acquisition_budget_manage ) %] >- <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% loop_budge.budget_period_id %]">[% loop_budge.budget_code %]</a> >- [% ELSE %] >- [% loop_budge.budget_code %] >- [% END %] >- </td> >- <td>[% loop_budge.budget_name %]</td> >- <td class="b_inactive">Inactive</td> >- <td>[% IF ( loop_budge.budget_owner_borrowernumber ) %] >- <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loop_budge.budget_owner_borrowernumber %]">[% loop_budge.budget_owner_surname %], [% loop_budge.budget_owner_firstname %]</a> >- [% ELSE %] >- >- [% END %] >- </td> >- <td>[% loop_budge.budget_branchname %]</td> >- <td class="data"><span title="[% loop_budge.budget_amount %]">[% loop_budge.formatted_budget_amount %]</span></td> >- <td class="data"><span title="[% loop_budge.budget_ordered %]"><a href="ordered.pl?fund=[% loop_budge.budget_id %]&fund_code=[% loop_budge.budget_code %]">[% loop_budge.formatted_budget_ordered %]</a></span></td> >- <td class="data"><span title="[% loop_budge.budget_spent %]"><a href="spent.pl?fund=[% loop_budge.budget_id %]&fund_code=[% loop_budge.budget_code %]">[% loop_budge.formatted_budget_spent %]</span></a></td> >- <td class="data"><span title="[% loop_budge.budget_avail %]">[% loop_budge.formatted_budget_avail %]</td> >- </tr> >- [% END %] > [% END %] > </tbody> > </table> >-- >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 12984
:
31849
|
31870
|
32147
|
32325
|
32816