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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/budgets-admin-toolbar.inc (-111 / +61 lines)
Lines 1-110 Link Here
1
<div id="toolbar"><script type="text/javascript">
1
<div id="toolbar" class="btn-toolbar">
2
	//<![CDATA[
2
    [% IF ( budget_period_id ) %]
3
3
        <div class="btn-group">
4
	// prepare DOM for YUI Toolbar
4
            <button class="btn btn-small dropdown-toggle" data-toggle="dropdown"><i class="icon-plus"></i> New <span class="caret"></span></button>
5
	 $(document).ready(function() {
5
                <ul class="dropdown-menu">
6
            $("#periods_menuc").empty();
6
                    <li><a href="/cgi-bin/koha/admin/aqbudgetperiods.pl?op=add_form">New budget</a></li>
7
            $("#budgets_menuc").empty();
7
                    [% IF ( budget_period_locked || !CAN_user_acquisition_budget_add_del ) %]
8
            $("#newrootbudgetc").empty();
8
                        <li class="disabled">
9
9
                    [% ELSE %]
10
// IF THERE IS NO BUDGETS DEFINED YET, THEN DISPLAY PERIOD BUTTON *ONLY*
10
                        <li>
11
[% UNLESS ( period_button_only ) %]
11
                    [% END %]
12
            $("#planning_menuc").empty();
12
                    <a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&amp;budget_period_id=[% budget_period_id %]">New fund for [% budget_period_description %]</a></li>
13
[% END %]
13
                </ul>
14
14
        </div>
15
	    yuiToolbar();
15
16
	 });
16
        <div class="btn-group">
17
17
            <button class="btn btn-small dropdown-toggle" data-toggle="dropdown"><i class="icon-pencil"></i> Edit <span class="caret"></span></button>
18
	// YUI Toolbar Functions
18
                <ul class="dropdown-menu">
19
19
                    <li><a href="/cgi-bin/koha/admin/aqbudgetperiods.pl?op=add_form&amp;budget_period_id=[% budget_period_id %]">Edit budget [% budget_period_description %]</a></li>
20
	function yuiToolbar() {
20
                    <li><a href="/cgi-bin/koha/admin/aqbudgetperiods.pl?op=duplicate_form&amp;budget_period_id=[% budget_period_id %]">Duplicate budget [% budget_period_description %]</a></li>
21
[% IF ( budget_period_id ) %]
21
                </ul>
22
		                var budgets_menu = [
22
        </div>
23
						{ text: _("New budget"), url: "/cgi-bin/koha/admin/aqbudgetperiods.pl?op=add_form" },
23
24
                        { text: _("New fund for") + " '[% budget_period_description %]'", url: "/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&budget_period_id=[% budget_period_id %]"
24
        <div class="btn-group">
25
                           [% IF ( budget_period_locked ) %],  disabled:true[% END %]
25
            <button class="btn btn-small dropdown-toggle" data-toggle="dropdown"><i class="icon-pencil"></i> Planning <span class="caret"></span></button>
26
                           [% UNLESS ( CAN_user_acquisition_budget_add_del ) %],  disabled:true [% END %]
26
                <ul class="dropdown-menu">
27
                          }
27
                    [% IF ( CAN_user_acquisition_planning_manage ) %]
28
                ]
28
                    <li>
29
		[% ELSE %]
29
                    [% ELSE %]
30
        var newrootbudgetButton = new YAHOO.widget.Button("newrootbudget");
30
                    <li class="disabled">
31
		[% END %]
31
                    [% END %]
32
32
                    <a href="/cgi-bin/koha/admin/aqplan.pl?budget_period_id=[% budget_period_id %]&amp;authcat=MONTHS">Plan by months</a></li>
33
        [% IF ( budget_period_id ) %]
33
                    [% IF ( CAN_user_acquisition_planning_manage ) %]
34
                var periods_menu = [
34
                    <li>
35
                        { text: _("Edit budget") + " '[% budget_period_description %]'", url: "/cgi-bin/koha/admin/aqbudgetperiods.pl?op=add_form&budget_period_id=[% budget_period_id %]" },
35
                    [% ELSE %]
36
                        { text: _("Duplicate budget") + " '[% budget_period_description %]'", url: "/cgi-bin/koha/admin/aqbudgetperiods.pl?op=duplicate_form&budget_period_id=[% budget_period_id %]" },
36
                    <li class="disabled">
37
                ]
37
                    [% END %]
38
        [% END %]
38
                    <a href="/cgi-bin/koha/admin/aqplan.pl?budget_period_id=[% budget_period_id %]&amp;authcat=BRANCHES">Plan by libraries</a></li>
39
39
                    [% IF ( CAN_user_acquisition_planning_manage ) %]
40
// IF THERE IS NO BUDGETS DEFINED YET, THEN DISPLAY PERIOD BUTTON *ONLY*
40
                    <li>
41
[% IF ( budget_period_id ) %]
41
                    [% ELSE %]
42
42
                    <li class="disabled">
43
               var planning_menu = [
43
                    [% END %]
44
44
                    <a href="/cgi-bin/koha/admin/aqplan.pl?budget_period_id=[% budget_period_id %]&amp;authcat=ITEMTYPES">Plan by item types</a></li>
45
                        { text: _("Plan by months"),
45
                    [% FOREACH auth_cats_loo IN auth_cats_loop %]
46
                            url: "/cgi-bin/koha/admin/aqplan.pl?budget_period_id=[% budget_period_id %]&authcat=MONTHS"
46
                        [% IF ( CAN_user_acquisition_planning_manage ) %]
47
                            [% UNLESS ( CAN_user_acquisition_planning_manage ) %],  id:'disabled' [% END %]
47
                        <li>
48
                        },
48
                        [% ELSE %]
49
49
                        <li class="disabled">
50
                        { text: _("Plan by libraries"),
50
                        [% END %]
51
                            url: "/cgi-bin/koha/admin/aqplan.pl?budget_period_id=[% budget_period_id %]&authcat=BRANCHES"
51
                        <a href="/cgi-bin/koha/admin/aqplan.pl?budget_period_id=[% budget_period_id %]&amp;authcat=[% auth_cats_loo.authcat %]">Plan by [% auth_cats_loo.authcat %]</a>
52
                            [% UNLESS ( CAN_user_acquisition_planning_manage ) %],  id:'disabled' [% END %]
52
                        </li>
53
                        },
53
                    [% END %]
54
54
                </ul>
55
                        { text: _("Plan by item types"),
55
        </div>
56
                            url: "/cgi-bin/koha/admin/aqplan.pl?budget_period_id=[% budget_period_id %]&authcat=ITEMTYPES"
56
57
                            [% UNLESS ( CAN_user_acquisition_planning_manage ) %],  id:'disabled' [% END %]
57
    [% ELSE %]
58
                        },
58
        <div class="btn-group"><a class="btn btn-small" id="newrootbudget" href="/cgi-bin/koha/admin/aqbudgetperiods.pl?op=add_form"><i class="icon-plus"></i> New budget</a></div>
59
        [% FOREACH auth_cats_loo IN auth_cats_loop %]
59
    [% END %]
60
            { text: _("Plan by [% auth_cats_loo.authcat %]    "),
60
61
            url: "/cgi-bin/koha/admin/aqplan.pl?budget_period_id=[% budget_period_id %]&authcat=[% auth_cats_loo.authcat %]"
61
</div>
62
            [% UNLESS ( CAN_user_acquisition_planning_manage ) %],  id:'disabled' [% END %]
63
            },
64
        [% END %]
65
                ]
66
67
	            new YAHOO.widget.Button({
68
                type: "menu",
69
                label: _("Edit"),
70
                name: "periods_button",
71
                menu: periods_menu,
72
                container: "periods_menuc"
73
            });
74
75
            new YAHOO.widget.Button({
76
                type: "menu",
77
                label: _("New"),
78
                name: "budgets_button",
79
                menu: budgets_menu,
80
                container: "budgets_menuc"
81
            });
82
83
            new YAHOO.widget.Button({
84
                type: "menu",
85
                label: _("Planning"),
86
                name: "planning_button",
87
                menu: planning_menu,
88
                container: "planning_menuc"
89
            });
90
91
[% END %]
92
93
// IF THERE IS NO BUDGETS DEFINED YET, THEN DISPLAY PERIOD BUTTON *ONLY*
94
[% UNLESS ( period_button_only ) %]
95
96
97
[% END %]
98
99
	} //yui-toolbar...
100
101
	//]]>
102
</script>
103
	<ul class="toolbar">
104
        [% UNLESS ( budget_period_id ) %]<li><a id="newrootbudget" href="/cgi-bin/koha/admin/aqbudgetperiods.pl?op=add_form">New budget</a></li>[% END %]
105
		[% UNLESS ( period_button_only ) %]<li id="budgets_menuc"><a id="budgets_menu" href="/cgi-bin/koha/cataloguing/addbiblio.pl">New</a></li>[% END %]
106
        <li id="periods_menuc"><a id="periods_menu" href="/cgi-bin/koha/admin/aqbudgetperiods.pl?op=add_form">Budgets</a></li>
107
		[% UNLESS ( period_button_only ) %]<li id="planning_menuc"><a id="planning_menu" href="/cgi-bin/koha/admin/aqplan.pl?budget_period_id=[% budget_period_id %]">Budget planning</a></li>
108
	[% END %]
109
	</ul>
110
</div>
111
- 

Return to bug 9628