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