Bug 33908: Improve translation of title tags: Acquisitions
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / basketheader.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Branches %]
4 [% USE Koha %]
5 [% SET footerjs = 1 %]
6 [% PROCESS 'i18n.inc' %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>[% FILTER collapse %]
9     [% IF ( add_form ) %]
10         [% IF ( basketno ) %]
11             [% tx("Edit basket '{basketname}'", { basketname = basketname }) | html %]
12         [% ELSE %]
13             [% tx("Add basket to {vendor}", { vendor = booksellername }) | html %]
14         [% END %]
15     [% END %] &rsaquo;
16     [% t("Acquisitions") | html %] &rsaquo;
17     [% t("Koha") | html %]
18 [% END %]</title>
19 [% INCLUDE 'doc-head-close.inc' %]
20 </head>
21
22 <body id="acq_basketheader" class="acq">
23 [% WRAPPER 'header.inc' %]
24     [% INCLUDE 'acquisitions-search.inc' %]
25 [% END %]
26
27 [% WRAPPER 'sub-header.inc' %]
28     [% WRAPPER breadcrumbs %]
29         [% WRAPPER breadcrumb_item %]
30             <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
31         [% END %]
32         [% WRAPPER breadcrumb_item %]
33             <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% booksellername | html %]</a>
34         [% END %]
35         [% IF ( add_form ) %]
36             [% IF ( basketno ) %]
37                 [% WRAPPER breadcrumb_item bc_active= 1%]
38                     <span>Edit basket '[% basketname | html %]'</span>
39                 [% END %]
40             [% ELSE %]
41                 [% WRAPPER breadcrumb_item bc_active= 1%]
42                     <span>Add a basket to [% booksellername | html %]</span>
43                 [% END %]
44             [% END %]
45         [% END %]
46     [% END #/ WRAPPER breadcrumbs %]
47 [% END #/ WRAPPER sub-header.inc %]
48
49 <div class="main container-fluid">
50     <div class="row">
51         <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
52
53     [% IF ( add_form ) %]
54         [% IF ( basketno ) %]
55             <h1>Edit basket [% basketname | html %]</h1>
56         [% ELSE %]<h1>Add a basket to [% booksellername | html %]</h1>
57         [% END %]
58     <form name="Aform" action="[% script_name | html %]" method="post" class="validated">
59         <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
60         <fieldset class="rows">
61             <ol>
62                 [% IF ( basketno ) %]
63                     <li>
64                         <input type="hidden" name="basketno" value="[% basketno | html %]" />
65                         <input type="hidden" name="is_an_edit" value="1" />
66                     </li>
67                 [% END %]
68                 <li>
69                     <label for="basketname" class="required">Basket name: </label>
70                     <input type="text" name="basketname" id="basketname" size="40" maxlength="80" value="[% basketname | html %]" required="required" class="focus required" />
71                     <span class="required">Required</span>
72                 </li>
73                 <li>
74                     <label for="billingplace">Billing place: </label>
75                     <select name="billingplace" id="billingplace">
76                         <option value="">--</option>
77                         [% PROCESS options_for_libraries libraries => Branches.all( selected => billingplace ) %]
78                     </select>
79                 </li>
80                 <li>
81                     <label for="deliveryplace">Delivery place: </label>
82                     <select name="deliveryplace" id="deliveryplace">
83                         <option value="">--</option>
84                         [% PROCESS options_for_libraries libraries => Branches.all( selected => deliveryplace ) %]
85                     </select>
86                 </li>
87                 <li>
88                     <label for="basketbooksellerid">Vendor: </label>
89                     <select name="basketbooksellerid" id="basketbooksellerid">
90                         <option value="[% booksellerid | html %]" selected="selected">Current vendor ([% booksellername | html %])</option>
91                     </select>
92                 </li>
93                 <li>
94                     <label for="basketnote">Internal note: </label>
95                     <textarea name="basketnote" id="basketnote" rows="5" cols="40">[% basketnote |html %]</textarea>
96                 </li>
97                 <li>
98                     <label for="basketbooksellernote">Vendor note: </label>
99                     <textarea name="basketbooksellernote" id="basketbooksellernote" rows="5" cols="40">[% basketbooksellernote |html %]</textarea>
100                 </li>
101                 [% IF ( contractloop ) %]
102                     <li><label for="basketcontractnumber">Contract: </label>
103                         <select id="basketcontractnumber" name="basketcontractnumber">
104                             <option value=""></option>
105                             [% FOREACH contractloo IN contractloop %]
106                                 [% IF ( contractloo.selected ) %]
107                                     <option value="[% contractloo.contractnumber | html %]" selected="selected">[% contractloo.contractname | html %]</option>
108                                 [% ELSE %]
109                                      <option value="[% contractloo.contractnumber | html %]">[% contractloo.contractname | html %]</option>
110                                 [% END %]
111                             [% END %]
112                         </select>
113                     </li>
114                 [% END %]
115                 <li>
116                     <label for="is_standing">Orders are standing:</label>
117                     [% IF is_standing %]
118                         <input type="checkbox" id="is_standing" name="is_standing" checked="checked" />
119                     [% ELSE %]
120                         <input type="checkbox" id="is_standing" name="is_standing"/>
121                     [% END %]
122                     <div class="hint">Standing orders do not close when received.</div>
123                 </li>
124                 [% IF basketno %]
125                     <input type="hidden" name="create_items" value="[% create_items | html %]" />
126                 [% ELSE %]
127                  <li>
128                     <label for="create_items">Create items when:</label>
129                     <select name="create_items" id="create_items">
130                         [% SWITCH Koha.Preference('AcqCreateItem') %]
131                             [% CASE 'receiving' %]<option value="">use default (receiving an order)</option>
132                             [% CASE 'cataloguing' %]<option value="">use default (cataloging the record)</option>
133                             [% CASE %]<option value="">use default (placing an order)</option>
134                         [% END %]
135                         <option value="ordering">placing an order</option>
136                         <option value="receiving">receiving an order</option>
137                         <option value="cataloguing">cataloging the record</option>
138                     </select>
139                 </li>
140                 [% END %]
141             </ol>
142         </fieldset>
143
144         [% IF available_additional_fields.count %]
145             [% INCLUDE 'additional-fields-entry.inc' available=available_additional_fields values=additional_field_values %]
146         [% END %]
147
148         <fieldset class="action">
149             <input type="hidden" name="op" value="add_validate" />
150             <input type="submit" class="btn btn-primary" value="Save" />
151             [% IF ( basketno ) %]
152                 <a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno | html %]">Cancel</a>
153             [% ELSE %]
154                 <a class="cancel" href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | html %]">Cancel</a>
155             [% END %]
156         </fieldset>
157     </form>
158     [% END %]
159 </div>
160 </div>
161
162 [% MACRO jsinclude BLOCK %]
163     [% Asset.js("js/acquisitions-menu.js") | $raw %]
164     [% Asset.js("js/acq.js") | $raw %]
165     [% INCLUDE 'select2.inc' %]
166 <script>
167
168 $(document).ready(function() {
169
170     function display_vendor(vendor) {
171         var $text;
172         $text = $('<span>'+vendor.text+'</span>');
173
174         return $text;
175     };
176
177     $("#basketbooksellerid").kohaSelect({
178         width: '50%',
179         allowClear: false,
180         ajax: {
181             url: '/api/v1/acquisitions/vendors',
182             delay: 300, // wait 300 milliseconds before triggering the request
183             cache: true,
184             dataType: 'json',
185             data: function (params) {
186                 var search_term = (params.term === undefined) ? '' : params.term;
187                 var query = {
188                     "q": JSON.stringify({"name":{"-like":'%'+search_term+'%'}}),
189                     "_order_by": "name",
190                     "_page": params.page
191                 };
192
193                 return query;
194             },
195             processResults: function (data) {
196                 var results = [];
197                 data.results.forEach( function ( vendor ) {
198                     results.push(
199                         {
200                             "id": vendor.id,
201                             "text": vendor.name.escapeHtml()
202                         }
203                     );
204                 });
205                 return { "results": results, "pagination": { "more": data.pagination.more } };
206             }
207         },
208         templateResult: display_vendor,
209         templateSelection: display_vendor
210     });
211 });
212 </script>
213 [% END %]
214
215 [% INCLUDE 'intranet-bottom.inc' %]