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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/serials-toolbar.inc (-69 / +40 lines)
Lines 1-4 Link Here
1
<div id="toolbar"><script type="text/javascript">
1
<script type="text/javascript">
2
	//<![CDATA[
2
	//<![CDATA[
3
3
4
    function confirm_close() {
4
    function confirm_close() {
Lines 13-80 Link Here
13
            window.location="subscription-detail.pl?subscriptionid=[% subscriptionid %]&op=reopen";
13
            window.location="subscription-detail.pl?subscriptionid=[% subscriptionid %]&op=reopen";
14
        }
14
        }
15
    }
15
    }
16
	// prepare DOM for YUI Toolbar
17
16
18
	 $(document).ready(function() {
17
	 $(document).ready(function() {
19
	    $("#editmenuc").empty();
18
        $("#deletesub").click(function(){
20
	    $("#duplicate").parent().remove();
19
            confirm_deletion();
21
		$("#delete").parent().remove();
20
            return false;
22
	 	$("#renewc").empty();
21
        });
23
	    yuiToolbar();
22
        $("#reopen").click(function(){
23
            confirm_reopen();
24
            return false;
25
        });
26
        $("#close").click(function(){
27
            confirm_close();
28
            return false;
29
        });
30
        $("#renew").click(function(){
31
            popup([% subscriptionid %]);
32
            return false;
33
        })
24
	 });
34
	 });
25
26
	// YUI Toolbar Functions
27
28
	function yuiToolbar() {
29
	
30
    [% IF ( subscriptionid ) %]
31
	    var editmenu = [
32
	        [% IF ( CAN_user_serials_edit_subscription ) %]
33
            { text: _("Edit subscription"),  [% IF ( cannotedit ) %]disabled: true, [% END %] url: "/cgi-bin/koha/serials/subscription-add.pl?op=modify&amp;subscriptionid=[% subscriptionid %]" },
34
		[% END %]
35
	        [% IF ( CAN_user_serials_create_subscription ) %]
36
            { text: _("Edit as new (duplicate)"), [% IF ( cannotedit ) %]disabled: true, [% END %] url: "/cgi-bin/koha/serials/subscription-add.pl?op=dup&amp;subscriptionid=[% subscriptionid %]" },
37
		[% END %]
38
	        [% IF ( CAN_user_serials_delete_subscription ) %]
39
            { text: _("Delete subscription"), [% IF ( cannotedit ) %]disabled: true, [% END %] onclick: {fn: confirm_deletion }}
40
		[% END %]
41
	    ];
42
	 [% END %]
43
	    new YAHOO.widget.Button("newsubscription");
44
	    [% IF ( subscriptionid ) %]		
45
		new YAHOO.widget.Button({
46
              id: "renew", 
47
              type: "link", 
48
			  href: "#",
49
              label: _("Renew"), 
50
              container: "renewc",
51
onclick: {fn:function(){popup([% subscriptionid %])}}
52
          });
53
	[% IF ( subscriptionid ) %]	  
54
	new YAHOO.widget.Button({
55
	        type: "menu",
56
	        label: _("Edit"),
57
	        name: "editmenubutton",
58
	        menu: editmenu,
59
	        container: "editmenuc"
60
			
61
	    });
62
		[% END %]
63
	    new YAHOO.widget.Button("renew");
64
	    new YAHOO.widget.Button("receive");
65
        new YAHOO.widget.Button("close");
66
        new YAHOO.widget.Button("reopen");
67
		[% END %]
68
	}
69
70
	//]]>
35
	//]]>
71
	</script>
36
	</script>
72
<ul class="toolbar">
37
<div id="toolbar" class="btn-toolbar">
38
73
    [% IF ( CAN_user_serials_create_subscription ) %]
39
    [% IF ( CAN_user_serials_create_subscription ) %]
74
        [% IF ( biblionumber_for_new_subscription ) %]
40
        [% IF ( biblionumber_for_new_subscription ) %]
75
            <li><a id="newsubscription" href="/cgi-bin/koha/serials/subscription-add.pl?biblionumber_for_new_subscription=[% biblionumber_for_new_subscription %]">New subscription</a></li>
41
            <div class="btn-group"><a id="newsubscription" class="btn btn-small" href="/cgi-bin/koha/serials/subscription-add.pl?biblionumber_for_new_subscription=[% biblionumber_for_new_subscription %]"><i class="icon-plus"></i> New subscription</a></div>
76
        [% ELSE %]
42
        [% ELSE %]
77
            <li><a id="newsubscription" href="/cgi-bin/koha/serials/subscription-add.pl">New subscription</a></li>
43
            <div class="btn-group"><a id="newsubscription" class="btn btn-small" href="/cgi-bin/koha/serials/subscription-add.pl"><i class="icon-plus"></i> New subscription</a></div>
78
        [% END %]
44
        [% END %]
79
    [% END %]
45
    [% END %]
80
46
Lines 83-119 onclick: {fn:function(){popup([% subscriptionid %])}} Link Here
83
49
84
            [% IF ( CAN_user_serials_edit_subscription || CAN_user_serials_create_subscription || CAN_user_serials_delete_subscription ) %]
50
            [% IF ( CAN_user_serials_edit_subscription || CAN_user_serials_create_subscription || CAN_user_serials_delete_subscription ) %]
85
                [% UNLESS ( cannotedit ) %]
51
                [% UNLESS ( cannotedit ) %]
86
                    <li id="editmenuc"><a id="edit" href="/cgi-bin/koha/serials/subscription-add.pl?op=modify&amp;subscriptionid=[% subscriptionid %]">Edit</a></li>
52
                    <div class="btn-group">
53
                        <button class="btn btn-small dropdown-toggle" data-toggle="dropdown"><i class="icon-pencil"></i> Edit <span class="caret"></span></button>
54
                            <ul class="dropdown-menu">
55
                                [% IF ( cannotedit ) %] <li class="disabled"> [% ELSE %]
56
                                <li> [% END %]
57
                                <a href="/cgi-bin/koha/serials/subscription-add.pl?op=modify&amp;subscriptionid=[% subscriptionid %]">Edit subscription</a></li>
58
                                [% IF ( cannotedit ) %] <li class="disabled"> [% ELSE %]
59
                                <li> [% END %]
60
                                <a href="/cgi-bin/koha/serials/subscription-add.pl?op=dup&amp;subscriptionid=[% subscriptionid %]">Edit as new (duplicate)</a></li>
61
                                [% IF ( CAN_user_serials_delete_subscription ) %]
62
                                [% IF ( cannotedit ) %] <li class="disabled"> [% ELSE %]
63
                                <li> [% END %]
64
                                <a href="#" id="deletesub">Delete subscription</a></li>[% END %]
65
                            </ul>
66
                    </div>
87
                [% END %]
67
                [% END %]
88
            [% END %]
68
            [% END %]
89
69
90
            [% IF ( CAN_user_serials_create_subscription ) %]
91
                <li><a id="duplicate" href="/cgi-bin/koha/serials/subscription-add.pl?op=dup&amp;subscriptionid=[% subscriptionid %]">Duplicate </a></li>
92
            [% END %]
93
94
            [% UNLESS ( cannotedit ) %]
70
            [% UNLESS ( cannotedit ) %]
95
                [% UNLESS closed %]
71
                [% UNLESS closed %]
96
                    [% IF ( CAN_user_serials_renew_subscription ) %]
72
                    [% IF ( CAN_user_serials_renew_subscription ) %]
97
                        <li id="renewc"><a id="renew" href="#" onclick="popup([% subscriptionid %])">Renew </a></li>
73
                        <div class="btn-group"><a id="renew" class="btn btn-small" href="#" onclick="popup([% subscriptionid %])"><i class="icon-refresh"></i> Renew</a></div>
98
                    [% END %]
74
                    [% END %]
99
                [% END %]
75
                [% END %]
100
                [% IF ( CAN_user_serials_receive_serials ) %]
76
                [% IF ( CAN_user_serials_receive_serials ) %]
101
                    [% UNLESS closed %]
77
                    [% UNLESS closed %]
102
                        <li><a id="receive" href="/cgi-bin/koha/serials/serials-edit.pl?subscriptionid=[% subscriptionid %]&amp;serstatus=1,3">Receive</a></li>
78
                        <div class="btn-group"><a id="receive" class="btn btn-small" href="/cgi-bin/koha/serials/serials-edit.pl?subscriptionid=[% subscriptionid %]&amp;serstatus=1,3"><i class="icon-inbox"></i> Receive</a></div>
103
                    [% END %]
79
                    [% END %]
104
                [% END %]
80
                [% END %]
105
                [% IF CAN_user_serials_edit_subscription %]
81
                [% IF CAN_user_serials_edit_subscription %]
106
                    [% IF closed %]
82
                    [% IF closed %]
107
                        <li><a id="reopen" href="javascript:confirm_reopen();">Reopen</a></li>
83
                        <div class="btn-group"><a id="reopen" class="btn btn-small" href="#">Reopen</a></div>
108
                    [% ELSE %]
84
                    [% ELSE %]
109
                        <li><a id="close" href="javascript:confirm_close();">Close</a></li>
85
                        <div class="btn-group"><a id="close" class="btn btn-small" href="#"><i class="icon-remove-circle"></i> Close</a></div>
110
                    [% END %]
86
                    [% END %]
111
                [% END %]
87
                [% END %]
112
                [% IF ( CAN_user_serials_delete_subscription ) %]
113
                    <li><a id="delete" href="javascript:confirm_deletion()">Delete</a></li>
114
                [% END %]
115
            [% END %]
88
            [% END %]
116
        [% END %]
89
        [% END %]
117
    [% END %]
90
    [% END %]
118
</ul>
119
</div>
91
</div>
120
- 

Return to bug 9627