Bug 34188: Require Library Branch Selection when Logging in
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / rotating_collections / addItems.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% PROCESS 'i18n.inc' %]
4 [% SET footerjs = 1 %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>[% FILTER collapse %]
7     [% t("Manage items") | html %] &rsaquo;
8     [% tx("Collection '{collection_title}'", { collection_title = colTitle }) | html %] &rsaquo;
9     [% t("Rotating collections") | html %] &rsaquo;
10     [% t("Tools") | html %] &rsaquo;
11     [% t("Koha") | html %]
12 [% END %]</title>
13 [% INCLUDE 'doc-head-close.inc' %]
14 </head>
15
16 <body id="rcoll_addItems" class="tools rcoll">
17 [% WRAPPER 'header.inc' %]
18     [% INCLUDE 'cat-search.inc' %]
19 [% END %]
20
21 [% WRAPPER 'sub-header.inc' %]
22     [% WRAPPER breadcrumbs %]
23         [% WRAPPER breadcrumb_item %]
24             <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
25         [% END %]
26         [% WRAPPER breadcrumb_item %]
27             <a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Rotating collections</a>
28         [% END %]
29         [% WRAPPER breadcrumb_item %]
30             <a href="/cgi-bin/koha/rotating_collections/addItems.pl?colId=[% colId | uri %]">[% tx("Collection '{collection_title}'", { collection_title = colTitle }) | html %]</a>
31         [% END %]
32         [% WRAPPER breadcrumb_item bc_active= 1 %]
33             <span>Manage items</span>
34         [% END %]
35     [% END #/ WRAPPER breadcrumbs %]
36 [% END #/ WRAPPER sub-header.inc %]
37
38 <div class="main container-fluid">
39     <div class="row">
40         <div class="col-sm-10 col-sm-push-2">
41             <main>
42               [% IF ( ! colId ) %]
43                 <div class="dialog message">
44                     <p>Invalid collection id</p>
45                     <p><a href="/cgi-bin/koha/rotating_collections/rotatingCollections.pl">Return to rotating collections home</a></p>
46                 </div>
47               [% ELSE %]
48               [% INCLUDE 'rotating-collections-toolbar.inc' %]
49               <h1>[% tx("Manage items for '{collection_title}'", { collection_title = colTitle }) | html %]</h1>
50
51               [% IF ( previousActionAdd ) %]
52                 [% IF ( addSuccess ) %]
53                   <div class="dialog message">Item with barcode '[% barcode | html %]' added successfully</div>
54                 [% ELSE %]
55                   <div class="dialog alert">
56                     <p>Failed to add item with barcode <em>[% barcode | html %]</em>:
57                     <p>
58                         [% IF failureMessage == "NO_ITEM" %]
59                             <span>No item with matching barcode found</span>
60                         [% ELSIF failureMessage == "IN_COLLECTION_OTHER" %]
61                             <span>Item is already in a different rotating collection</span>
62                         [% ELSIF failureMessage == "IN_COLLECTION" %]
63                             <span>Item is already in this collection</span>
64                         [% ELSE %]
65                             [% failureMessage | html %]
66                         [% END %]
67                     </p>
68                 </div>
69                 [% END %]
70               [% END %]
71
72               [% IF ( previousActionRemove ) %]
73                 [% IF ( removeSuccess ) %]
74                   <div class="dialog message">Item with barcode <em>[% barcode | html %]</em> removed successfully</div>
75                 [% ELSE %]
76                   <div class="dialog alert">
77                     Failed to remove item with barcode <em>[% barcode | html %]</em>:
78                     <p>
79                         [% IF failureMessage == "NO_ITEM" %]
80                             <span>No item with matching barcode found</span>
81                         [% ELSIF failureMessage == "NOT_IN_COLLECTION" %]
82                             <span>Item is not in this collection</span>
83                         [% ELSE %]
84                             [% failureMessage | html %]
85                         [% END %]
86                     </p>
87                 </div>
88                 [% END %]
89               [% END %]
90
91               <div>
92                 <form action="addItems.pl" method="post">
93                     <fieldset class="brief">
94                         <legend>Add or remove items</legend>
95                         <ol>
96                             <li>
97                                 <label for="barcode">Barcode: </label>
98                                 <input type="text" id="barcode" name="barcode" />
99                                 [% IF ( removeChecked ) %]
100                                     <label class="inline"><input type="checkbox" name="removeItem" checked="checked" /> Remove item from collection</label>
101                                 [% ELSE %]
102                                     <label class="inline"><input type="checkbox" name="removeItem" /> Remove item from collection</label>
103                                 [% END %]
104                             </li>
105                         </ol>
106                     </fieldset>
107                     <fieldset class="action">
108                         <input type="hidden" id="colId" name="colId" value="[% colId | html %]" />
109                         <input type="hidden" name="action" value="addItem" />
110                         <input type="submit" class="btn btn-primary" value="Submit" />
111                     </fieldset>
112
113                 </form>
114               </div>
115
116               <div class="page-section">
117                 [% IF ( collectionItemsLoop ) %]
118                   <h2>Items in collection</h2>
119                   <p>Total items: [% collectionItemsLoop.size | html%]</p>
120                   <table>
121                     <tr>
122                       <th>Title</th>
123                       <th>Call number</th>
124                       <th>Barcode</th>
125                       <th>&nbsp;</th>
126                     </tr>
127                     [% FOREACH collectionItemsLoo IN collectionItemsLoop %]
128                       <tr>
129                         <td>[% INCLUDE 'biblio-title.inc' biblio=collectionItemsLoo link = 1 %]</td>
130                         <td>[% collectionItemsLoo.itemcallnumber | html %]</td>
131                         <td>[% collectionItemsLoo.barcode | html %]</td>
132                         <td><a href="/cgi-bin/koha/rotating_collections/addItems.pl?colId=[% colId | uri %]&amp;barcode=[% collectionItemsLoo.barcode | uri %]&amp;removeItem=1&amp;action=addItem">Remove</a></td>
133                       </tr>
134                     [% END %]
135                   </table>
136                 [% ELSE %]
137                   <div class="dialog message">There are no items in this collection.</div>
138                 [% END %]
139               </div>
140             [% END %]
141
142             </main>
143         </div> <!-- /.col-sm-10.col-sm-push-2 -->
144
145         <div class="col-sm-2 col-sm-pull-10">
146             <aside>
147                 [% INCLUDE 'tools-menu.inc' %]
148             </aside>
149         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
150      </div> <!-- /.row -->
151
152 [% MACRO jsinclude BLOCK %]
153     [% Asset.js("js/tools-menu.js") | $raw %]
154     [% Asset.js("js/rotating-collections.js") | $raw %]
155 [% END %]
156
157 [% INCLUDE 'intranet-bottom.inc' %]