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