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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/acquisitions-toolbar.inc (-36 / +31 lines)
Lines 1-44 Link Here
1
<div id="toolbar"><script type="text/javascript">
1
<script type="text/javascript">
2
    //<![CDATA[
2
//<![CDATA[
3
3
function confirm_deletion() {
4
    // prepare DOM for YUI Toolbar
4
    if (confirm(_("Are you sure you want to delete this vendor?"))) {
5
5
        window.location="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]&op=delete";
6
    $(document).ready(function() {
6
    }
7
        yuiToolbar();
7
}
8
    });
8
//]]>
9
9
</script>
10
    // YUI Toolbar Functions
10
<div id="toolbar" class="btn-toolbar">
11
11
    [% IF ( booksellerid ) %]
12
    function yuiToolbar() {
12
        <div class="btn-group">
13
        new YAHOO.widget.Button("editsupplier");
13
        <a class="btn btn-small dropdown-toggle" data-toggle="dropdown" href="#"><i class="icon-plus"></i> New
14
        new YAHOO.widget.Button("deletesupplier");
14
        <span class="caret"></span>
15
        new YAHOO.widget.Button("receive");
15
        </a>
16
        [% UNLESS ( booksellerid ) %]new YAHOO.widget.Button("newvendor");[% END %]
16
        <ul class="dropdown-menu">
17
18
        var newmenu = [
19
            [% IF ( CAN_user_acquisition_order_manage ) %]
17
            [% IF ( CAN_user_acquisition_order_manage ) %]
20
                { text: _("Basket"), url: "/cgi-bin/koha/acqui/basketheader.pl?booksellerid=[% booksellerid %]&op=add_form"},
18
                <li><a href="/cgi-bin/koha/acqui/basketheader.pl?booksellerid=[% booksellerid %]&amp;op=add_form">Basket</a></li>
19
            [% END %]
20
            [% IF ( CAN_user_acquisition_contracts_manage ) %]
21
                <li><a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&amp;booksellerid=[% booksellerid %]">Contract</a></li>
21
            [% END %]
22
            [% END %]
22
            [% IF ( CAN_user_acquisition_contracts_manage ) %]{ text: _("Contract"), url: "/cgi-bin/koha/admin/aqcontract.pl?op=add_form&amp;booksellerid=[% booksellerid %]"},[% END %]
23
            { text: _("Vendor"), url: "/cgi-bin/koha/acqui/supplier.pl?op=enter"}
24
        ]
25
        new YAHOO.widget.Button({type: "menu", label: _("New"), name: "newmenu", menu: newmenu, container: "newmenuc"});
26
    }
27
28
    //]]>
29
    </script>
30
    <ul id="toolbar-list" class="toolbar">
31
        [% IF ( booksellerid ) %]
32
            [% IF ( CAN_user_acquisition_vendors_manage ) %]
23
            [% IF ( CAN_user_acquisition_vendors_manage ) %]
33
                <li id="newmenuc"></li>
24
                <li><a href="/cgi-bin/koha/acqui/supplier.pl?op=enter">Vendor</a></li>
34
                <li><a id="editsupplier" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]&amp;op=enter">Edit vendor</a></li>
25
            [% END %]
26
        </ul>
27
        </div>
28
            [% IF ( CAN_user_acquisition_vendors_manage ) %]
29
                <div class="btn-group"><a class="btn btn-small" id="editsupplier" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]&amp;op=enter"><i class="icon-pencil"></i> Edit vendor</a></div>
35
                [% UNLESS ( basketcount OR subscriptioncount ) %]
30
                [% UNLESS ( basketcount OR subscriptioncount ) %]
36
                    <li><a id="deletesupplier" href="javascript:confirm_deletion()">Delete vendor</a></li>
31
                    <div class="btn-group"><a class="btn btn-small" id="deletesupplier" href="javascript:confirm_deletion()"><i class="icon-remove"></i> Delete vendor</a></div>
37
                [% END %]
32
                [% END %]
38
            [% END %]
33
            [% END %]
39
                [% IF ( CAN_user_acquisition_order_receive && basketcount ) %]<li><a id="receive" href="/cgi-bin/koha/acqui/parcels.pl?booksellerid=[% booksellerid %]">Receive shipments</a></li>[% END %]
34
            [% IF ( CAN_user_acquisition_order_receive && basketcount ) %]
35
                <div class="btn-group"><a class="btn btn-small" id="receive" href="/cgi-bin/koha/acqui/parcels.pl?booksellerid=[% booksellerid %]"><i class="icon-inbox"></i> Receive shipments</a></div>
36
            [% END %]
40
        [% ELSE %]
37
        [% ELSE %]
41
            <li><a id="newvendor" href="/cgi-bin/koha/acqui/supplier.pl?op=enter">New vendor</a></li>
38
            <div class="btn-group"><a class="btn btn-small" href="/cgi-bin/koha/acqui/supplier.pl?op=enter"><i class="icon-plus"></i> New vendor</a></div>
42
        [% END %]
39
        [% END %]
43
    </ul>
44
</div>
40
</div>
45
- 

Return to bug 9674