Bug 19656: Move rotating collections templates JS to the footer
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / rotating_collections / addItems.tt
blobc7bf918e70f4247e9ad99ba8748a59397f496df6
1 [% SET footerjs = 1 %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha &rsaquo; Tools &rsaquo; Rotating collections &rsaquo; Collection [% colTitle %] &rsquo; Add or remove items</title>
4 [% INCLUDE 'doc-head-close.inc' %]
5 </head>
7 <body id="rcoll_addItems" class="tools rcoll">
8 [% INCLUDE 'header.inc' %]
9 [% INCLUDE 'cat-search.inc' %]
11 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo; <a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Rotating collections</a> &rsaquo; <a href="/cgi-bin/koha/rotating_collections/addItems.pl?colId=[% colId %]">Collection <i>[% colTitle %]</i></a> &rsaquo; Add or remove items</div>
13 <div id="doc3" class="yui-t2">
14     <div id="bd">
15         <div id="yui-main">
16             <div class="yui-b">
18               [% IF ( ! colId ) %]
19                 <div class="dialog message">
20                     <p>Invalid collection id</p>
21                     <p><a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Return to rotating collections home</a></p>
22                 </div>
23               [% ELSE %]
24               [% INCLUDE 'rotating-collections-toolbar.inc' %]
25               <h1>Collection <i>[% colTitle %]</i></h1>
27               [% IF ( previousActionAdd ) %]
28                 [% IF ( addSuccess ) %]
29                   <div class="dialog message">Item with barcode '[% barcode %]' added successfully</div>
30                 [% ELSE %]
31                   <div class="dialog alert">
32                     <p>Failed to add item with barcode <i>[% barcode %]</i>:
33                     <p>
34                         [% IF failureMessage == "NO_ITEM" %]
35                             No item with matching barcode found
36                         [% ELSIF failureMessage == "IN_COLLECTION_OTHER" %]
37                             Item is already in a different rotating collection
38                         [% ELSIF failureMessage == "IN_COLLECTION" %]
39                             Item is already in this collection
40                         [% ELSE %]
41                             [% failureMessage %]
42                         [% END %]
43                     </p>
44                 </div>
45                 [% END %]
46               [% END %]
48               [% IF ( previousActionRemove ) %]
49                 [% IF ( removeSuccess ) %]
50                   <div class="dialog message">Item with barcode <i>[% barcode %]</i> removed successfully</div>
51                 [% ELSE %]
52                   <div class="dialog alert">
53                     Failed to remove item with barcode <i>[% barcode %]</i>:
54                     <p>
55                         [% IF failureMessage == "NO_ITEM" %]
56                             No item with matching barcode found
57                         [% ELSIF failureMessage == "NOT_IN_COLLECTION" %]
58                             Item is not in this collection
59                         [% ELSE %]
60                             [% failureMessage %]
61                         [% END %]
62                     </p>
63                 </div>
64                 [% END %]
65               [% END %]
67               <div>
68                 <form action="addItems.pl" method="post">
69                     <fieldset class="brief">
70                         <legend>Add or remove items</legend>
71                         <ol>
72                             <li>
73                                 <label for="barcode">Barcode: </label>
74                                 <input type="text" id="barcode" name="barcode" />
75                                 [% IF ( removeChecked ) %]
76                                     <label class="inline"><input type="checkbox" name="removeItem" checked="checked" /> Remove item from collection</label>
77                                 [% ELSE %]
78                                     <label class="inline"><input type="checkbox" name="removeItem" /> Remove item from collection</label>
79                                 [% END %]
80                             </li>
81                         </ol>
82                         <p>
83                             <input type="hidden" id="colId" name="colId" value="[% colId %]" />
84                             <input type="hidden" name="action" value="addItem" />
85                             <input type="submit" value="Submit" />
86                         </p>
87                     </fieldset>
89                 </form>
90               </div>
92               <div>
93                 <h2>Items in <i>[% colTitle %]</i></h2>
94                 [% IF ( collectionItemsLoop ) %]
95                   <table>
96                     <tr>
97                       <th>Title</th>
98                       <th>Call number</th>
99                       <th>Barcode</th>
100                       <th>&nbsp;</th>
101                     </tr>
102                     [% FOREACH collectionItemsLoo IN collectionItemsLoop %]
103                       <tr>
104                         <td>[% INCLUDE 'biblio-default-view.inc' biblionumber = collectionItemsLoo.biblionumber %][% collectionItemsLoo.title |html %]</a></td>
105                         <td>[% collectionItemsLoo.itemcallnumber %]</td>
106                         <td>[% collectionItemsLoo.barcode %]</td>
107                         <td><a href="/cgi-bin/koha/rotating_collections/addItems.pl?colId=[% colId %]&amp;barcode=[% collectionItemsLoo.barcode %]&amp;removeItem=1&amp;action=addItem">Remove</a></td>
108                       </tr>
109                     [% END %]
110                   </table>
111                 [% ELSE %]
112                   <div class="dialog message">There are no items in this collection.</div>
113                 [% END %]
114               </div>
115             [% END %]
116             </div> <!-- /.yui-b -->
117         </div> <!-- /#yui-main -->
118         <div class="yui-b">
119             [% INCLUDE 'tools-menu.inc' %]
120         </div>
121     </div> <!-- /#bd -->
123 [% MACRO jsinclude BLOCK %]
124     <script type="text/javascript" src="[% interface %]/[% theme %]/js/tools-menu.js"></script>
125     <script type="text/javascript" src="[% interface %]/[% theme %]/js/rotating-collections.js"></script>
126 [% END %]
128 [% INCLUDE 'intranet-bottom.inc' %]