View | Details | Raw Unified | Return to bug 12984
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/acqui-home.tt (-63 / +88 lines)
Lines 1-9 Link Here
1
[% USE Price %]
1
[% USE Price %]
2
[% INCLUDE 'doc-head-open.inc' %]
2
[% INCLUDE 'doc-head-open.inc' %]
3
<title>Koha &rsaquo; Acquisitions</title>
3
<title>Koha &rsaquo; Acquisitions</title>
4
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
5
[% INCLUDE 'doc-head-close.inc' %]
4
[% INCLUDE 'doc-head-close.inc' %]
5
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
6
[% INCLUDE 'datatables.inc' %]
6
[% INCLUDE 'datatables.inc' %]
7
<link href="[% interface %]/lib/jquery/plugins/treetable/stylesheets/jquery.treetable.css" rel="stylesheet" type="text/css" />
8
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/treetable/jquery.treetable.js"></script>
9
7
<script type="text/javascript">
10
<script type="text/javascript">
8
//<![CDATA[
11
//<![CDATA[
9
12
Lines 16-48 $(document).ready(function() { Link Here
16
    inactive.hide();
19
    inactive.hide();
17
    active.show();
20
    active.show();
18
21
19
    $('#showallbudgets').click(function() {
22
    var oTable = $("#accounts").dataTable($.extend(true, {}, dataTablesDefaults, {
20
        if ( $('#showallbudgets:checked').val() !== undefined) {
23
        "fnDrawCallback": function ( oSettings ) {
21
            inactive.show();
24
            if ( oSettings.aiDisplay.length == 0 )
22
            active.hide();
25
            {
23
        }
26
                return;
24
        else {
27
            }
25
            inactive.hide();
28
26
            active.show();
29
            var nTrs = $('#accounts tbody tr');
27
        }
30
            var iColspan = nTrs[0].getElementsByTagName('td').length;
28
    });
31
            var sLastGroup = "";
29
    var srlt = $("#accounts").dataTable($.extend(true, {}, dataTablesDefaults, {
32
            for ( var i=0 ; i<nTrs.length ; i++ )
30
        "aoColumns": [
33
            {
31
            null,
34
                var iDisplayIndex = oSettings._iDisplayStart + i;
32
            null,
35
                var sGroup = oSettings.aoData[ oSettings.aiDisplay[iDisplayIndex] ]._aData[1];
33
            null,
36
                if ( sGroup != sLastGroup )
34
            null,
37
                {
35
            null,
38
                    var nGroup = document.createElement( 'tr' );
36
            { "sType": "title-numeric" },
39
                    var nCell = document.createElement( 'td' );
37
            { "sType": "title-numeric" },
40
                    nCell.colSpan = iColspan;
38
            { "sType": "title-numeric" },
41
                    nCell.className = "group";
39
            { "sType": "title-numeric" }
42
                    nCell.innerHTML = sGroup;
43
                    nGroup.appendChild( nCell );
44
                    nTrs[i].parentNode.insertBefore( nGroup, nTrs[i] );
45
                    sLastGroup = sGroup;
46
                }
47
            }
48
        },
49
        "aoColumnDefs": [
50
            { "bVisible": false, "aTargets": [ 0, 1 ] },
51
            { "bSortable": false, "aTargets": ["_all"] }
40
        ],
52
        ],
41
        'sDom': 't',
53
        'bSort': true,
54
        'aaSortingFixed': [[ 1, 'asc' ]],
42
        'bPaginate': false,
55
        'bPaginate': false,
43
        'bFilter': false,
56
        "bAutoWidth": false
44
        'bInfo': false
57
    }));
45
    } ) );
58
59
    $(oTable).treetable({
60
        expandable: true
61
    });
62
    $(oTable).treetable('expandAll');
63
    $("#expand_all").click(function(e){
64
        e.preventDefault();
65
        $(oTable).treetable('expandAll');
66
    });
67
    $("#collapse_all").click(function(e){
68
        e.preventDefault();
69
        $(oTable).treetable('collapseAll');
70
    });
71
72
    $("#hide_inactive").click(function(e){
73
        e.preventDefault();
74
        oTable.fnFilter( 1, 0 ); // Show only active=1
75
        inactive.hide();
76
        active.show();
77
    });
78
    $("#show_inactive").click(function(e){
79
        e.preventDefault();
80
        oTable.fnFilter( '', 0 );
81
        inactive.show();
82
        active.hide();
83
    });
84
    $("#hide_inactive").click();
85
46
});
86
});
47
//]]>
87
//]]>
48
</script>
88
</script>
Lines 102-129 $(document).ready(function() { Link Here
102
            <h3>All available funds[% IF ( branchname ) %] for [% branchname %][% END %]</h3>
142
            <h3>All available funds[% IF ( branchname ) %] for [% branchname %][% END %]</h3>
103
143
104
    <div id="BudgetsAndFunds">
144
    <div id="BudgetsAndFunds">
105
    <p><label for="showallbudgets">Show active and inactive:</label> <input type="checkbox" id="showallbudgets" /></p>
106
    <table id="accounts">
145
    <table id="accounts">
146
        <caption>
147
          <span class="actions"><a href="#" id="expand_all">Expand all</a>
148
          | <a href="#" id="collapse_all">Collapse all</a>
149
          | <a href="#" id="hide_inactive">Hide inactive budgets</a>
150
          | <a href="#" id="show_inactive">Show inactive budgets</a></span>
151
        </caption>
152
107
        <thead>
153
        <thead>
108
        <tr>
154
        <tr>
109
            <th>Fund</th>
155
            <th>Active</th>
156
            <th>Budget period description</th>
157
            <th>Fund code</th>
110
            <th>Fund name</th>
158
            <th>Fund name</th>
111
            <th class="b_inactive">Active</th>
112
            <th>Owner</th>
159
            <th>Owner</th>
113
            <th>Library</th>
160
            <th>Library</th>
114
            <th>Amount</th>
161
            <th>Amount</th>
115
            <th>Ordered</th>
162
            <th>Ordered</th>
116
            <th>Spent</th>
163
            <th>Spent</th>
117
            <th>Avail</th>
164
            <th>Total available</th>
118
        </tr>
165
        </tr>
119
        </thead>
166
        </thead>
120
        <tfoot id="funds_total">
167
        <tfoot id="funds_total">
121
        <tr>
168
        <tr>
122
            <th>Total</th>
169
            <th></th>
123
            <th>&nbsp;</th>
170
            <th></th>
124
            <th class="b_inactive">&nbsp;</th>
171
            <th colspan="4">Total</th>
125
            <th>&nbsp;</th>
126
            <th>&nbsp;</th>
127
            <th class="data"><span class="bu_active">[% total %]</span><span class="bu_inactive" >[% total_active | $Price %]</span></th>
172
            <th class="data"><span class="bu_active">[% total %]</span><span class="bu_inactive" >[% total_active | $Price %]</span></th>
128
            <th class="data"><span class="bu_active">[% totordered %]</span><span class="bu_inactive" >[% totordered_active | $Price %]</span></th>
173
            <th class="data"><span class="bu_active">[% totordered %]</span><span class="bu_inactive" >[% totordered_active | $Price %]</span></th>
129
            <th class="data"><span class="bu_active">[% totspent %]</span><span class="bu_inactive" >[% totspent_active | $Price %]</span></th>
174
            <th class="data"><span class="bu_active">[% totspent %]</span><span class="bu_inactive" >[% totspent_active | $Price %]</span></th>
Lines 132-139 $(document).ready(function() { Link Here
132
        </tfoot>
177
        </tfoot>
133
        <tbody>
178
        <tbody>
134
        [% FOREACH loop_budge IN loop_budget %]
179
        [% FOREACH loop_budge IN loop_budget %]
135
        [% IF ( loop_budge.budget_period_active ) %]
180
            [% IF loop_budge.budget_parent_id %]
136
            <tr>
181
                <tr data-tt-id="[% loop_budge.budget_id %]" data-tt-parent-id="[% loop_budge.budget_parent_id %]">
182
            [% ELSE %]
183
                <tr data-tt-id="[% loop_budge.budget_id %]">
184
            [% END %]
185
186
                <td>[% loop_budge.budget_period_active %]</td>
187
                <td>Budget [% loop_budge.budget_period_description %] [id=[% loop_budge.budget_period_id %]][% UNLESS loop_budge.budget_period_active %] (inactive)[% END %]</td>
137
                <td>
188
                <td>
138
                    [% IF ( CAN_user_acquisition_budget_manage ) %]
189
                    [% IF ( CAN_user_acquisition_budget_manage ) %]
139
                        <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% loop_budge.budget_period_id %]">[% loop_budge.budget_code %]</a>
190
                        <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% loop_budge.budget_period_id %]">[% loop_budge.budget_code %]</a>
Lines 142-148 $(document).ready(function() { Link Here
142
                    [% END %]
193
                    [% END %]
143
                </td>
194
                </td>
144
                <td>[% loop_budge.budget_name %]</td>
195
                <td>[% loop_budge.budget_name %]</td>
145
                <td class="b_inactive">Active</td>
146
                <td>[% IF ( loop_budge.budget_owner_borrowernumber ) %]
196
                <td>[% IF ( loop_budge.budget_owner_borrowernumber ) %]
147
                        <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>
197
                        <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>
148
                    [% ELSE %]
198
                    [% ELSE %]
Lines 155-184 $(document).ready(function() { Link Here
155
                <td class="data"><span title="[% loop_budge.budget_spent %]"><a href="spent.pl?fund=[% loop_budge.budget_id %]&amp;fund_code=[% loop_budge.budget_code %]">[% loop_budge.budget_spent | $Price %]</span></a></td>
205
                <td class="data"><span title="[% loop_budge.budget_spent %]"><a href="spent.pl?fund=[% loop_budge.budget_id %]&amp;fund_code=[% loop_budge.budget_code %]">[% loop_budge.budget_spent | $Price %]</span></a></td>
156
                <td class="data"><span title="[% loop_budge.budget_avail %]">[% loop_budge.budget_avail | $Price %]</td>
206
                <td class="data"><span title="[% loop_budge.budget_avail %]">[% loop_budge.budget_avail | $Price %]</td>
157
            </tr>
207
            </tr>
158
        [% ELSE %]
159
            <tr class="b_inactive">
160
                <td>
161
                    [% IF ( CAN_user_acquisition_budget_manage ) %]
162
                        <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% loop_budge.budget_period_id %]">[% loop_budge.budget_code %]</a>
163
                    [% ELSE %]
164
                        [% loop_budge.budget_code %]
165
                    [% END %]
166
                </td>
167
                <td>[% loop_budge.budget_name %]</td>
168
                <td class="b_inactive">Inactive</td>
169
                <td>[% IF ( loop_budge.budget_owner_borrowernumber ) %]
170
                        <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>
171
                    [% ELSE %]
172
                        &nbsp;
173
                    [% END %]
174
                </td>
175
                <td>[% loop_budge.budget_branchname %]</td>
176
                <td class="data"><span title="[% loop_budge.budget_amount %]">[% loop_budge.budget_amount | $Price %]</span></td>
177
                <td class="data"><span title="[% loop_budge.budget_ordered %]"><a href="ordered.pl?fund=[% loop_budge.budget_id %]&amp;fund_code=[% loop_budge.budget_code %]">[% loop_budge.budget_ordered | $Price %]</a></span></td>
178
                <td class="data"><span title="[% loop_budge.budget_spent %]"><a href="spent.pl?fund=[% loop_budge.budget_id %]&amp;fund_code=[% loop_budge.budget_code %]">[% loop_budge.budget_spent | $Price %]</span></a></td>
179
                <td class="data"><span title="[% loop_budge.budget_avail %]">[% loop_budge.budget_avail | $Price %]</td>
180
            </tr>
181
        [% END %]
182
        [% END %]
208
        [% END %]
183
        </tbody>
209
        </tbody>
184
    </table>
210
    </table>
185
- 

Return to bug 12984