From ed8e506953b78de0a09b87011709281054641ab0 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 11 Mar 2013 16:11:26 -0400 Subject: [PATCH] Bug 9744 - Add a column Fund name on the home page of acquisitions 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 should show the fund name. The checkbox to show all funds should work correctly. Signed-off-by: caroline very-mathieu Signed-off-by: Chris Cormack --- 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 8b6c584738..5688452cfd 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 b029b3fd7f..34aa8e9c9a 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,14 +33,16 @@ $(document).ready(function() { null, null, null, + null, + null, { "sType": "num-html" }, { "sType": "num-html" }, - null, + null ], 'sDom': 't', 'bPaginate': false, 'bFilter': false, - 'bInfo': false, + 'bInfo': false } ) ); }); //]]> @@ -60,18 +64,16 @@ $(document).ready(function() { [% INCLUDE 'acquisitions-toolbar.inc' %]

Acquisitions

-
-
-
- [% UNLESS ( loop_budget ) %] - [% IF ( CAN_user_parameters ) %] + [% IF ( CAN_user_acquisition_period_manage ) %]
You must define a budget in Administration
[% ELSE %]
Your administrator must define a budget in Administration
[% END %] [% END %] - +
+
+
Manage orders
@@ -81,20 +83,22 @@ $(document).ready(function() {
- -[% IF ( suggestion ) %][% IF ( suggestions_count ) %] -
-
- Pending suggestions -

[% suggestions_count %] suggestions waiting. Manage suggestions.

-
-
[% END %][% END %] -
+[% IF ( suggestion && suggestions_count ) %]
+
+
+ Pending suggestions +

[% suggestions_count %] suggestions waiting. Manage suggestions.

+
+
+
+[% END %] + +
- [% IF ( loop_budget ) %] +[% IF ( loop_budget ) %]

All available funds[% IF ( branchname ) %] for [% branchname %] library[% END %]

@@ -104,10 +108,13 @@ $(document).ready(function() {
+

+ + @@ -120,51 +127,70 @@ $(document).ready(function() { + - - - - + + + + + [% FOREACH loop_budge IN loop_budget %] - [% IF ( loop_budge.budget_period_active ) %] - [% IF ( loop.odd ) %] - - [% ELSE %] - - [% END %] - - - - - - - + [% IF ( loop_budge.budget_period_active ) %] + + + + + + + + + + + + [% ELSE %] + + + + + + + + + + - [% ELSE %] - [% IF ( loop.odd ) %] - - [% ELSE %] - - [% END %] - - - - - - - - [% END %] + [% END %] [% END %]
FundFund nameActive Owner Library Amount
Total     [% total_active %][% totordered_active %][% totspent_active %][% totavail_active %] [% total %][% total_active %][% totordered %][% totordered_active %][% totspent %][% totspent_active %][% totavail %][% totavail_active %]
[% loop_budge.budget_code %][% loop_budge.budget_owner %][% loop_budge.budget_branchname %][% loop_budge.budget_amount %][% loop_budge.budget_ordered %][% loop_budge.budget_spent %][% loop_budge.budget_avail %]
+ [% IF ( CAN_user_acquisition_budget_manage ) %] + [% loop_budge.budget_code %] + [% ELSE %] + [% loop_budge.budget_code %] + [% END %] + [% loop_budge.budget_name %]Active[% IF ( loop_budge.budget_owner_borrowernumber ) %] + [% loop_budge.budget_owner_surname %], [% loop_budge.budget_owner_firstname %] + [% ELSE %] +   + [% END %] + [% loop_budge.budget_branchname %][% loop_budge.budget_amount %][% loop_budge.budget_ordered %][% loop_budge.budget_spent %][% loop_budge.budget_avail %]
+ [% IF ( CAN_user_acquisition_budget_manage ) %] + [% loop_budge.budget_code %] + [% ELSE %] + [% loop_budge.budget_code %] + [% END %] + [% loop_budge.budget_name %]Inactive[% IF ( loop_budge.budget_owner_borrowernumber ) %] + [% loop_budge.budget_owner_surname %], [% loop_budge.budget_owner_firstname %] + [% ELSE %] +   + [% END %] + [% loop_budge.budget_branchname %][% loop_budge.budget_amount %][% loop_budge.budget_ordered %][% loop_budge.budget_spent %][% loop_budge.budget_avail %]
-
Show all :  +
[% END %] -
-
-- 2.39.5