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

(-)a/acqui/booksellers.pl (-1 / +15 lines)
Lines 53-58 use strict; Link Here
53
use warnings;
53
use warnings;
54
use C4::Auth;
54
use C4::Auth;
55
use C4::Biblio;
55
use C4::Biblio;
56
use C4::Budgets;
56
use C4::Output;
57
use C4::Output;
57
use CGI;
58
use CGI;
58
59
Lines 62-68 use C4::Members qw/GetMember/; Link Here
62
use C4::Context;
63
use C4::Context;
63
64
64
my $query = CGI->new;
65
my $query = CGI->new;
65
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
66
my ( $template, $loggedinuser, $cookie, $userflags ) = get_template_and_user(
66
    {   template_name   => 'acqui/booksellers.tmpl',
67
    {   template_name   => 'acqui/booksellers.tmpl',
67
        query           => $query,
68
        query           => $query,
68
        type            => 'intranet',
69
        type            => 'intranet',
Lines 103-108 my $viewbaskets = C4::Context->preference('AcqViewBaskets'); Link Here
103
104
104
my $userbranch = $userenv->{branch};
105
my $userbranch = $userenv->{branch};
105
106
107
my $budgets = GetBudgetHierarchy;
108
my $has_budgets = 0;
109
foreach my $r (@{$budgets}) {
110
    if (!defined $r->{budget_amount} || $r->{budget_amount} == 0) {
111
        next;
112
    }
113
    next unless (CanUserUseBudget($loggedinuser, $r, $userflags));
114
115
    $has_budgets = 1;
116
    last;
117
}
118
106
#build result page
119
#build result page
107
my $loop_suppliers = [];
120
my $loop_suppliers = [];
108
121
Lines 150-155 $template->param( Link Here
150
    loop_suppliers => $loop_suppliers,
163
    loop_suppliers => $loop_suppliers,
151
    supplier       => ( $booksellerid || $supplier ),
164
    supplier       => ( $booksellerid || $supplier ),
152
    count          => $supplier_count,
165
    count          => $supplier_count,
166
    has_budgets          => $has_budgets,
153
);
167
);
154
$template->{VARS}->{'allbaskets'} = $allbaskets;
168
$template->{VARS}->{'allbaskets'} = $allbaskets;
155
169
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-add-to-basket.inc (-4 / +7 lines)
Lines 1-13 Link Here
1
<fieldset id="acqui_basket_add">
1
<fieldset class="acqui_basket_add">
2
    <legend>Add order to basket</legend>
2
    <legend>Add order to basket</legend>
3
    [% IF has_budgets %]
3
    [% IF has_budgets %]
4
      <ul>
4
      <ul>
5
        <li>
5
        <li>
6
          <label for="q">From an existing record: </label>
7
          <form action="/cgi-bin/koha/acqui/neworderbiblio.pl" method="post">
6
          <form action="/cgi-bin/koha/acqui/neworderbiblio.pl" method="post">
7
            <label>From an existing record:
8
                <input type="text"  size="25" name="q" />
9
            </label>
8
            <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
10
            <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
9
            <input type="hidden" name="basketno" value="[% basketno %]" />
11
            <input type="hidden" name="basketno" value="[% basketno %]" />
10
            <input id="q" type="text"  size="25" name="q" />
11
            <input type="submit" class="submit" value="Search" />
12
            <input type="submit" class="submit" value="Search" />
12
          </form>
13
          </form>
13
        </li>
14
        </li>
Lines 18-23 Link Here
18
        <li><a href="/cgi-bin/koha/acqui/addorderiso2709.pl?booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]"> From a staged file</a></li>
19
        <li><a href="/cgi-bin/koha/acqui/addorderiso2709.pl?booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]"> From a staged file</a></li>
19
      </ul>
20
      </ul>
20
    [% ELSE %]
21
    [% ELSE %]
21
        You can't create any orders unless you first <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">define a budget and a fund</a>.
22
        <div class="dialog alert">
23
          <p>You can't create any orders unless you first <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">define a budget and a fund</a>.</p>
24
        </div>
22
    [% END %]
25
    [% END %]
23
</fieldset>
26
</fieldset>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt (-1 / +1 lines)
Lines 30-36 Link Here
30
        updateColumnsVisibility(false);
30
        updateColumnsVisibility(false);
31
        [% UNLESS ( closedate ) %]
31
        [% UNLESS ( closedate ) %]
32
            $('#addtoBasket').on('show', function () {
32
            $('#addtoBasket').on('show', function () {
33
               $(this).find(".modal-body").html($("#acqui_basket_add")[0].outerHTML);
33
               $(this).find(".modal-body").html($(".acqui_basket_add")[0].outerHTML);
34
            });
34
            });
35
        [% END %]
35
        [% END %]
36
    });
36
    });
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/booksellers.tt (-17 / +34 lines)
Lines 14-36 Link Here
14
<script type="text/javascript">
14
<script type="text/javascript">
15
//<![CDATA[
15
//<![CDATA[
16
$(document).ready(function() {
16
$(document).ready(function() {
17
    [% IF (dateformat == 'metric') %]
18
        dt_add_type_uk_date();
19
    [% END %]
20
    $("table.baskets").dataTable($.extend(true, {}, dataTablesDefaults, {
17
    $("table.baskets").dataTable($.extend(true, {}, dataTablesDefaults, {
21
        'sDom': 't',
18
        'sDom': 't',
22
        'bPaginate': false,
19
        'bPaginate': false,
23
        'bFilter': false,
20
        'bFilter': false,
24
        'bInfo': false,
21
        'bInfo': false,
25
        "aaSorting": [[ 1, "asc" ]],
22
        "aaSorting": [[ 1, "asc" ]],
23
        "aoColumns": [
24
            null,null,null,null,null,null,{ "sType": "title-string" },{ "sType": "title-string" },null
25
        ],
26
        'aoColumnDefs': [
26
        'aoColumnDefs': [
27
            { 'aTargets': [-1], 'bSortable': false }
27
            { 'aTargets': [-1,-2], 'bSortable': false }
28
        ]
28
        ]
29
    }));
29
    }));
30
    $("#supplierlist").change(function() {
30
    $("#supplierlist").change(function() {
31
        var id = $(this).find("option:selected").val();
31
        var id = $(this).find("option:selected").val();
32
        window.location.href = "#" + id;
32
        window.location.href = "#" + id;
33
    });
33
    });
34
    $(".modal").on("show", function(){
35
        var basket = $(this).data("basketno");
36
        var legend = _("Add order to basket") + " " + basket;
37
        $(this).find("legend").html(legend);
38
    });
34
});
39
});
35
//]]>
40
//]]>
36
</script>
41
</script>
Lines 63-71 $(document).ready(function() { Link Here
63
        </p>
68
        </p>
64
    [% END %]
69
    [% END %]
65
    [% IF ( allbaskets ) %]
70
    [% IF ( allbaskets ) %]
66
        <p><a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier %]&booksellerid=[% booksellerid %]">Show active baskets only</a></p>
71
        <p><a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier %]&amp;booksellerid=[% booksellerid %]">Show active baskets only</a></p>
67
    [% ELSE %]
72
    [% ELSE %]
68
        <p><a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier %]&booksellerid=[% booksellerid %]&allbaskets=1">Show all baskets</a></p>
73
        <p><a href="/cgi-bin/koha/acqui/booksellers.pl?supplier=[% supplier %]&amp;booksellerid=[% booksellerid %]&amp;allbaskets=1">Show all baskets</a></p>
69
    [% END %]
74
    [% END %]
70
    <div id="acqui_order_supplierlist">
75
    <div id="acqui_order_supplierlist">
71
        [% FOREACH supplier IN loop_suppliers %]
76
        [% FOREACH supplier IN loop_suppliers %]
Lines 80-91 $(document).ready(function() { Link Here
80
                <span class="action">
85
                <span class="action">
81
                    [% IF ( CAN_user_acquisition_order_manage ) %]
86
                    [% IF ( CAN_user_acquisition_order_manage ) %]
82
                        [% IF ( supplier.active ) %]
87
                        [% IF ( supplier.active ) %]
83
                            <input type="button" value="New basket" onclick="window.location.href='/cgi-bin/koha/acqui/basketheader.pl?booksellerid=[% supplier.booksellerid %]&amp;op=add_form'" />
88
                            <a class="btn btn-small" href="/cgi-bin/koha/acqui/basketheader.pl?booksellerid=[% supplier.booksellerid %]&amp;op=add_form"><i class="icon-plus"></i> New basket</a>
84
                        [% ELSE %]
89
                        [% ELSE %]
85
                            (inactive)
90
                            (inactive)
86
                        [% END %]
91
                        [% END %]
87
                    [% END %]
92
                    [% END %]
88
                    <input type="button" value="Receive shipment" onclick="window.location.href='/cgi-bin/koha/acqui/parcels.pl?booksellerid=[% supplier.booksellerid %]'" />
93
                    <a class="btn btn-small" href="/cgi-bin/koha/acqui/parcels.pl?booksellerid=[% supplier.booksellerid %]"><i class="icon-inbox"></i> Receive shipment</a>
89
                </span>
94
                </span>
90
                <div class="baskets">
95
                <div class="baskets">
91
                    [% IF ( supplier.loop_basket.size ) %]
96
                    [% IF ( supplier.loop_basket.size ) %]
Lines 99-104 $(document).ready(function() { Link Here
99
                                    <th>Items expected</th>
104
                                    <th>Items expected</th>
100
                                    <th>Created by</th>
105
                                    <th>Created by</th>
101
                                    <th>Date</th>
106
                                    <th>Date</th>
107
                                    <th>Closed</th>
102
                                    <th>&nbsp;</th>
108
                                    <th>&nbsp;</th>
103
                                </tr>
109
                                </tr>
104
                            </thead>
110
                            </thead>
Lines 118-140 $(document).ready(function() { Link Here
118
                                            [% basket.authorisedby_firstname %]
124
                                            [% basket.authorisedby_firstname %]
119
                                            [% basket.authorisedby_surname %]
125
                                            [% basket.authorisedby_surname %]
120
                                        </td>
126
                                        </td>
121
                                        <td>[% basket.creationdate | $KohaDates %]</td>
127
                                        <td><span title="[% basket.creationdate %]">[% basket.creationdate | $KohaDates %]</span></td>
122
                                        <td>
128
                                        <td>
123
                                            [% IF ( basket.closedate ) %]
129
                                            [% IF ( basket.closedate ) %]
124
                                                closed on [% basket.closedate | $KohaDates %]
130
                                                <span title="[% basket.closedate %]">[% basket.closedate | $KohaDates %]</span>
125
                                                <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno %]">View</a>
126
                                            [% ELSE %]
131
                                            [% ELSE %]
127
                                                [% IF ( basket.active ) %]
132
                                                <span title="9999-99-99"></span>
128
                                                    <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno %]">Modify</a>
133
                                            [% END %]
129
                                                [% ELSE %]
134
                                        </td>
130
                                                    <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno %]">View</a>
135
                                        <td>
131
                                                [% END %]
136
                                            <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basket.basketno %]">View</a>
137
138
                                            [% UNLESS ( basket.closedate ) %]
139
                                               | <a id="addtoBasketLabel[% basket.basketno %]" href="#addtoBasket[% basket.basketno %]" role="button" data-toggle="modal">Add to basket</a>
140
                                                <!-- Modal -->
141
                                                <div id="addtoBasket[% basket.basketno %]" class="modal hide" tabindex="-1" role="dialog" aria-labelledby="addtoBasketLabel[% basket.basketno %]" aria-hidden="true" data-basketno="[% basket.basketname %]">
142
                                                    <div class="modal-body">
143
                                                        [% INCLUDE 'acquisitions-add-to-basket.inc' booksellerid=supplier.booksellerid basketno=basket.basketno %]
144
                                                    </div>
145
                                                    <div class="modal-footer">
146
                                                        <a href="#" class="cancel" data-dismiss="modal" aria-hidden="true">Cancel</a>
147
                                                    </div>
148
                                                </div>
132
                                            [% END %]
149
                                            [% END %]
133
                                        </td>
150
                                        </td>
134
                                    </tr>
151
                                    </tr>
135
                                [% END %][%# FOREACH basket IN supplier.loop_basket %]
152
                                [% END %][%# FOREACH basket IN supplier.loop_basket %]
136
                            </tbody>
153
                            </tbody>
137
                        </table>
154
                        </table>
155
138
                    [% ELSE %]
156
                    [% ELSE %]
139
                        <p>No pending baskets</p>
157
                        <p>No pending baskets</p>
140
                    [% END %][%# IF ( supplier.loop_basket.size ) %]
158
                    [% END %][%# IF ( supplier.loop_basket.size ) %]
141
- 

Return to bug 10737