Bug 12150 - Use more javascript string formatting in intranet for translated strings.
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / serials-toolbar.inc
1 <script type="text/javascript">
2         //<![CDATA[
3
4     function confirm_close() {
5         var is_confirmed = confirm(_("Are you sure you want to close this subscription?"));
6         if (is_confirmed) {
7             window.location="subscription-detail.pl?subscriptionid=[% subscriptionid %]&op=close";
8         }
9     }
10     function confirm_reopen() {
11         var is_confirmed = confirm(_("Are you sure you want to reopen this subscription?"));
12         if (is_confirmed) {
13             window.location="subscription-detail.pl?subscriptionid=[% subscriptionid %]&op=reopen";
14         }
15     }
16
17          $(document).ready(function() {
18         $("#deletesub").click(function(){
19             confirm_deletion();
20             return false;
21         });
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         })
34          });
35         //]]>
36         </script>
37 <div id="toolbar" class="btn-toolbar">
38
39     [% IF ( CAN_user_serials_create_subscription ) %]
40         [% IF ( biblionumber_for_new_subscription ) %]
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>
42         [% ELSE %]
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>
44         [% END %]
45     [% END %]
46
47     [% IF ( CAN_user_serials_edit_subscription || CAN_user_serials_create_subscription || CAN_user_serials_delete_subscription ) %]
48         [% IF ( subscriptionid ) %]
49
50             [% IF ( CAN_user_serials_edit_subscription || CAN_user_serials_create_subscription || CAN_user_serials_delete_subscription ) %]
51                 [% UNLESS ( cannotedit ) %]
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>
67                 [% END %]
68             [% END %]
69
70             [% UNLESS ( cannotedit ) %]
71                 [% UNLESS closed %]
72                     [% IF ( CAN_user_serials_renew_subscription ) %]
73                         <div class="btn-group"><a id="renew" class="btn btn-small" href="#" onclick="popup([% subscriptionid %])"><i class="icon-refresh"></i> Renew</a></div>
74                     [% END %]
75                 [% END %]
76                 [% IF ( CAN_user_serials_receive_serials ) %]
77                     [% UNLESS closed %]
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>
79                     [% END %]
80                 [% END %]
81                 [% IF CAN_user_serials_edit_subscription %]
82                     [% IF closed %]
83                         <div class="btn-group"><a id="reopen" class="btn btn-small" href="#">Reopen</a></div>
84                     [% ELSE %]
85                         <div class="btn-group"><a id="close" class="btn btn-small" href="#"><i class="icon-remove-circle"></i> Close</a></div>
86                     [% END %]
87                 [% END %]
88             [% END %]
89         [% END %]
90     [% END %]
91 </div>