Bugzilla – Attachment 16062 Details for
Bug 9744
Add a column Fund name on the home page of acquisitions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9744 - Add a column Fund name on the home page of acquisitions
Bug-9744---Add-a-column-Fund-name-on-the-home-page.patch (text/plain), 12.44 KB, created by
Owen Leonard
on 2013-03-12 13:31:36 UTC
(
hide
)
Description:
Bug 9744 - Add a column Fund name on the home page of acquisitions
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2013-03-12 13:31:36 UTC
Size:
12.44 KB
patch
obsolete
>From cf0ed61de31f259d7eedaa312b328c4bbcaf3aa1 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Mon, 11 Mar 2013 16:11:26 -0400 >Subject: [PATCH] Bug 9744 - Add a column Fund name on the home page of > acquisitions >Content-Type: text/plain; charset="utf-8" > >This patch offers an alternative option to fix Bug 9744. In this version >the table of funds swaps positions with the suggestions block so that >the table has the whole width of the screen. This eliminates the need to >adjust its float property. > >Other changes: > >- Simplification of the column and row-hiding JavaScript >- The addition of an "Active" column to be shown when all funds > are shown (this helps indicate to the user which rows were hidden) >- Linking the fund owner to their patron record >- Linking the fund id, given the correct permissions, to the view of all > funds for that budget (the best alternative to linking to a view of > the fund details, which we do not have). >- Correcting permission level required to add a budget > >To test, view the acquisitions home page. The layout should feel >comfortable. The table of available funds thsould show the fund name. >The checkbox to show all funds should work correctly. >--- > acqui/acqui-home.pl | 5 +- > .../prog/en/modules/acqui/acqui-home.tt | 154 ++++++++++++-------- > 2 files changed, 93 insertions(+), 66 deletions(-) > >diff --git a/acqui/acqui-home.pl b/acqui/acqui-home.pl >index 8b6c584..5688452 100755 >--- a/acqui/acqui-home.pl >+++ b/acqui/acqui-home.pl >@@ -102,8 +102,9 @@ foreach my $budget ( @{$budget_arr} ) { > > my $member = GetMember( borrowernumber => $budget->{budget_owner_id} ); > if ($member) { >- $budget->{budget_owner} = >- $member->{'firstname'} . ' ' . $member->{'surname'}; >+ $budget->{budget_owner_firstname} = $member->{'firstname'}; >+ $budget->{budget_owner_surname} = $member->{'surname'}; >+ $budget->{budget_owner_borrowernumber} = $member->{'borrowernumber'}; > } > > if ( !defined $budget->{budget_amount} ) { >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 fa6ae53..b41029c 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 >@@ -11,19 +11,21 @@ > dt_overwrite_html_sorting_localeCompare(); > > $(document).ready(function() { >+ >+ var inactive = $(".b_inactive,.bu_active"); >+ var active = $(".bu_inactive"); >+ inactive.hide(); >+ active.show(); >+ > $('#showallbudgets').click(function() { >- if ( $('#showallbudgets:checked').val() !== undefined) { >- $('.b_inactive').show(); >- $('#b_inactive').show(); >- $('.bu_active').show(); >- $('.bu_inactive').hide(); >- } >- else { >- $('.b_inactive').hide(); >- $('#b_inactive').hide(); >- $('.bu_inactive').show(); >- $('.bu_active').hide(); >- } >+ if ( $('#showallbudgets:checked').val() !== undefined) { >+ inactive.show(); >+ active.hide(); >+ } >+ else { >+ inactive.hide(); >+ active.show(); >+ } > }); > var srlt = $("#accounts").dataTable($.extend(true, {}, dataTablesDefaults, { > "aoColumns": [ >@@ -31,13 +33,15 @@ $(document).ready(function() { > null, > null, > null, >+ null, >+ null, > { "sType": "num-html" }, > { "sType": "num-html" }, >- null, >+ null > ], > 'bPaginate': false, > 'bFilter': false, >- 'bInfo': false, >+ 'bInfo': false > } ) ); > }); > //]]> >@@ -59,18 +63,16 @@ $(document).ready(function() { > [% INCLUDE 'acquisitions-toolbar.inc' %] > > <h1>Acquisitions</h1> >-<div class="yui-g"> >-<div class="yui-u first"> >-<div id="acqui_acqui_home_order"> >- > [% UNLESS ( loop_budget ) %] >- [% IF ( CAN_user_parameters ) %] >+ [% IF ( CAN_user_acquisition_period_manage ) %] > <div class="dialog alert">You must <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">define a budget</a> in Administration</div> > [% ELSE %] > <div class="dialog alert">Your administrator must define a budget in Administration</div> > [% END %] > [% END %] >- >+<div class="yui-g"> >+<div class="yui-u first"> >+<div id="acqui_acqui_home_order"> > <fieldset> > <legend>Manage orders</legend> > <form name="findsupplier" action="/cgi-bin/koha/acqui/booksellers.pl" method="post"> >@@ -80,20 +82,22 @@ $(document).ready(function() { > </form> > </fieldset> > </div> >- >-[% IF ( suggestion ) %][% IF ( suggestions_count ) %] >-<div id="acqui_acqui_home_suggestions"> >- <fieldset> >- <legend>Pending suggestions</legend> >- <p>[% suggestions_count %] suggestions waiting. <a href="/cgi-bin/koha/suggestion/suggestion.pl">Manage suggestions</a>.</p> >- </fieldset> >-</div>[% END %][% END %] >- > </div> > >+[% IF ( suggestion && suggestions_count ) %] > <div class="yui-u"> >+ <div id="acqui_acqui_home_suggestions"> >+ <fieldset> >+ <legend>Pending suggestions</legend> >+ <p>[% suggestions_count %] suggestions waiting. <a href="/cgi-bin/koha/suggestion/suggestion.pl">Manage suggestions</a>.</p> >+ </fieldset> >+ </div> >+</div> >+[% END %] >+ >+</div> > >- [% IF ( loop_budget ) %] >+[% IF ( loop_budget ) %] > > <h3>All available funds[% IF ( branchname ) %] for [% branchname %] library[% END %]</h3> > >@@ -103,10 +107,13 @@ $(document).ready(function() { > > > <div id="BudgetsAndFunds"> >+ <p><label for="showallbudgets">Show active and inactive:</label> <input type="checkbox" id="showallbudgets" /></p> > <table id="accounts"> > <thead> > <tr> > <th>Fund</th> >+ <th>Fund name</th> >+ <th class="b_inactive">Active</th> > <th>Owner</th> > <th>Library</th> > <th>Amount</th> >@@ -119,53 +126,72 @@ $(document).ready(function() { > <tr> > <th>Total</th> > <th> </th> >+ <th class="b_inactive"> </th> > <th> </th> >- <th align="right" ><span class="bu_active" style="display : none;">[% total %]</span><span class="bu_inactive" >[% total_active %]</span></th> >- <th align="right" ><span class="bu_active" style="display : none;">[% totordered %]</span><span class="bu_inactive" >[% totordered_active %]</span></th> >- <th align="right" ><span class="bu_active" style="display : none;">[% totspent %]</span><span class="bu_inactive" >[% totspent_active %]</span></th> >- <th align="right" ><span class="bu_active" style="display : none;">[% totavail %]</span><span class="bu_inactive" >[% totavail_active %]</span></th> >+ <th> </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> >+ <th class="data"><span class="bu_active">[% totavail %]</span><span class="bu_inactive" >[% totavail_active %]</span></th> > </tr> > </tfoot> > <tbody> > [% FOREACH loop_budge IN loop_budget %] >- [% IF ( loop_budge.budget_period_active ) %] >- [% IF ( loop.odd ) %] >- <tr> >- [% ELSE %] >- <tr class="highlight"> >- [% END %] >- <td align="center">[% loop_budge.budget_code %]</td> >- <td align="center">[% loop_budge.budget_owner %]</td> >- <td align="center">[% loop_budge.budget_branchname %]</td> >- <td align="right" >[% loop_budge.budget_amount %]</td> >- <td align="right" ><a href="ordered.pl?fund=[% loop_budge.budget_id %]&fund_code=[% loop_budge.budget_code %]">[% loop_budge.budget_ordered %]</a></td> >- <td align="right" ><a href="spent.pl?fund=[% loop_budge.budget_id %]&fund_code=[% loop_budge.budget_code %]">[% loop_budge.budget_spent %]</a></td> >- <td align="right" >[% loop_budge.budget_avail %]</td> >+ [% IF ( loop_budge.budget_period_active ) %] >+ <tr> >+ <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">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 %] >+ >+ [% END %] >+ </td> >+ <td>[% loop_budge.budget_branchname %]</td> >+ <td class="data">[% loop_budge.budget_amount %]</td> >+ <td class="data"><a href="ordered.pl?fund=[% loop_budge.budget_id %]&fund_code=[% loop_budge.budget_code %]">[% loop_budge.budget_ordered %]</a></td> >+ <td class="data"><a href="spent.pl?fund=[% loop_budge.budget_id %]&fund_code=[% loop_budge.budget_code %]">[% loop_budge.budget_spent %]</a></td> >+ <td class="data">[% loop_budge.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">[% loop_budge.budget_amount %]</td> >+ <td class="data"><a href="ordered.pl?fund=[% loop_budge.budget_id %]&fund_code=[% loop_budge.budget_code %]">[% loop_budge.budget_ordered %]</a></td> >+ <td class="data"><a href="spent.pl?fund=[% loop_budge.budget_id %]&fund_code=[% loop_budge.budget_code %]">[% loop_budge.budget_spent %]</a></td> >+ <td class="data">[% loop_budge.budget_avail %]</td> > </tr> >- [% ELSE %] >- [% IF ( loop.odd ) %] >- <tr class="b_inactive" style="display : none;"> >- [% ELSE %] >- <tr class="highlight" id = "b_inactive" style="display : none;"> >- [% END %] >- <td align="center" >[% loop_budge.budget_code %]</td> >- <td align="center">[% loop_budge.budget_owner %]</td> >- <td align="center">[% loop_budge.budget_branchname %]</td> >- <td align="right" >[% loop_budge.budget_amount %]</td> >- <td align="right" ><a href="ordered.pl?fund=[% loop_budge.budget_id %]&fund_code=[% loop_budge.budget_code %]">[% loop_budge.budget_ordered %]</a></td> >- <td align="right" ><a href="spent.pl?fund=[% loop_budge.budget_id %]&fund_code=[% loop_budge.budget_code %]">[% loop_budge.budget_spent %]</a></td> >- <td align="right" >[% loop_budge.budget_avail %]</td> >- [% END %] >+ [% END %] > [% END %] > </tbody> > </table> >- </div><span class="label">Show all : </span><input type="checkbox" id="showallbudgets" /> >+ </div> > [% END %] >-</div> > > </div> > </div> >-</div> > <div class="yui-b"> > [% INCLUDE 'acquisitions-menu.inc' %] > </div> >-- >1.7.9.5
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 9744
:
15864
|
15866
|
16062
|
16274
|
18616