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