Bug 20755: (QA follow-up) Fix capitalization in system preference description
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / vendor_issues.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE AuthorisedValues %]
4 [% USE KohaDates %]
5 [% SET footerjs = 1 %]
6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>
8     [% IF op =='add_form' %]
9         [% IF issue.issue_id %]
10             Modify vendor issue
11         [% ELSE %]
12             New vendor issue
13         [% END %] &rsaquo; [% ELSE %]
14         [% IF op == 'delete_confirm' %]
15             Confirm deletion of vendor issue &rsaquo; [% END %]
16     [% END %]
17     Vendor issue &rsaquo; Acquisition &rsaquo; Koha
18 </title>
19 [% INCLUDE 'doc-head-close.inc' %]
20 </head>
21
22 <body id="acq_supplier_issues" class="acq">
23 [% WRAPPER 'header.inc' %]
24     [% INCLUDE 'acquisitions-search.inc' %]
25 [% END %]
26
27 [% WRAPPER 'sub-header.inc' %]
28 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
29     <ol>
30         <li>
31             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
32         </li>
33         <li>
34             <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
35         </li>
36         <li>
37             <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% vendor.id | uri %]">[% vendor.name | html %]</a>
38         </li>
39         [% IF op == 'list' %]
40             <li>
41                 <a href="#" aria-current="page">Issues</a>
42             </li>
43         [% ELSE %]
44             <li>
45                 <a href="/cgi-bin/koha/acqui/vendor_issues.pl?booksellerid=[% vendor.id | uri %]">Issues</a>
46             </li>
47             <li>
48                 <a href="#" aria-current="page">
49                     [% IF issue %]
50                         Issue #[% issue.issue_id| html %]
51                     [% ELSE %]
52                         New issue
53                     [% END %]
54                 </a>
55             </li>
56         [% END %]
57     </ol>
58 </nav>
59 [% END %]
60
61 <div class="main container-fluid">
62     <div class="row">
63         <div class="col-sm-10 col-sm-push-2">
64             <main>
65
66 [% FOR m IN messages %]
67     <div class="dialog [% m.type | html %]">
68         [% SWITCH m.code %]
69         [% CASE 'error_on_update' %]
70             <span>An error occurred when updating this issue.</span>
71         [% CASE 'error_on_insert' %]
72             <span>An error occurred when adding this issue</span>
73         [% CASE 'error_on_delete' %]
74             <span>An error occurred when deleting this issue. Check the logs.</span>
75         [% CASE 'success_on_update' %]
76             <span>Issue updated successfully.</span>
77         [% CASE 'success_on_insert' %]
78             <span>Issue created successfully.</span>
79         [% CASE 'success_on_delete' %]
80             <span>Issue deleted successfully.</span>
81         [% CASE %]
82             <span>[% m.code | html %]</span>
83         [% END %]
84     </div>
85 [% END %]
86
87 [% IF op == 'add_form' %]
88     [% IF issue %]
89         <h1>Modify a vendor issue</h1>
90     [% ELSE %]
91         <h1>New vendor issue</h1>
92     [% END %]
93
94     <form action="/cgi-bin/koha/acqui/vendor_issues.pl" name="Aform" method="post" class="validated">
95         <input type="hidden" name="op" value="add_validate" />
96         <input type="hidden" name="booksellerid" value="[% vendor.id | html %]" />
97         <input type="hidden" name="issue_id" value="[% issue.issue_id| html %]" />
98
99         <fieldset class="rows">
100             <ol>
101                 [% IF issue %]
102                     <li><span class="label">Issue ID: </span>[% issue.issue_id | html %]</li>
103                 [% END %]
104                 <li>
105                     <label for="issue_type">Type: </label>
106                     [% PROCESS 'av-build-dropbox.inc' name="type", category="VENDOR_ISSUE_TYPE", default=issue.type, empty=1, size = 20 %]
107                 </li>
108                 <li>
109                     <label for="started_on">Started on: </label>
110                     <input type="text" size="10" id="from" name="started_on" value="[% issue.started_on| html %]" class="flatpickr" data-date_to="to" />
111                     <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
112                 </li>
113                 <li>
114                     <label for="ended_on">Ended on: </label>
115                     <input type="text" size="10" id="to" name="ended_on" value="[% issue.ended_on | html %]" class="flatpickr" />
116                     <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
117                 </li>
118                 <li>
119                     <label for="notes">Notes: </label>
120                     <textarea name="notes" id="notes" rows="3" cols="50">[% issue.notes | html %]</textarea>
121                 </li>
122             </ol>
123         </fieldset>
124
125         <fieldset class="action">
126             <input type="submit" class="btn btn-primary" value="Submit" />
127             <a class="cancel" href="/cgi-bin/koha/acqui/vendor_issues.pl?booksellerid=[% vendor.id | uri %]">Cancel</a>
128         </fieldset>
129     </form>
130 [% END %]
131
132 [% IF op == 'delete_confirm' %]
133     <div class="dialog alert">
134         <h1>Delete issue #[% issue.issue_id | html %]?<h1>
135         <form action="/cgi-bin/koha/acqui/vendor_issues.pl" method="post">
136             <input type="hidden" name="op" value="delete_confirmed" />
137             <input type="hidden" name="issue_id" value="[% issue.issue_id | html %]" />
138             <button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
139         </form>
140         <form action="/cgi-bin/koha/acqui/vendor_issues.pl" method="get">
141             <input type="hidden" name="booksellerid" value="[% vendor.id | html %]" />
142             <button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
143         </form>
144     </div>
145 [% END %]
146
147 [% IF op == 'show' %]
148     <h1>Vendor issue #[% issue.issue_id | html %]</h1>
149
150         <fieldset class="rows">
151             <ol>
152                 [% IF issue %]
153                     <li><span class="label">Issue ID: </span>[% issue.issue_id | html %]</li>
154                 [% END %]
155                 <li>
156                     <label for="issue_type">Type: </label>
157                     [% AuthorisedValues.GetByCode( 'VENDOR_ISSUE_TYPE', issue.type, 0 ) | html %]
158                 </li>
159                 <li>
160                     <label for="started_on">Started on: </label>
161                     [% issue.started_on | $KohaDates %]
162                 </li>
163                 <li>
164                     <label for="ended_on">Ended on: </label>
165                     [% issue.ended_on | $KohaDates %]
166                 </li>
167                 <li>
168                     <label for="notes">Notes: </label>
169                     [% issue.notes | html %]
170                 </li>
171             </ol>
172         </fieldset>
173
174         <fieldset class="action">
175             <a href="/cgi-bin/koha/acqui/vendor_issues.pl?booksellerid=[% vendor.id | uri %]">Back</a>
176         </fieldset>
177     </form>
178 [% END %]
179 [% IF op == 'list' %]
180
181     <div id="toolbar" class="btn-toolbar">
182         <a class="btn btn-default" id="new_issue" href="/cgi-bin/koha/acqui/vendor_issues.pl?booksellerid=[% vendor.id | uri %]&op=add_form"><i class="fa fa-plus"></i> New issue</a>
183     </div>
184
185     <h1>Vendor issues</h1>
186
187     [% IF issues_count > 0 %]
188         <div class="page-section">
189             <div class="table_vendor_issues_table_controls"></div>
190             <table id="vendor_issues">
191                 <thead>
192                     <tr>
193                         <th>Issue ID</th>
194                         <th>Type</th>
195                         <th>Started on</th>
196                         <th>Ended on</th>
197                         <th data-class-name="actions noExport">Actions</th>
198                     </tr>
199                 </thead>
200             </table>
201         </div><!-- /.page-section -->
202     [% ELSE %]
203         <div class="dialog message">
204             There are no issues defined. <a href="/cgi-bin/koha/acqui/vendor_issues.pl?booksellerid=[% vendor.id | uri %]&op=add_form">Create a new issue</a>.
205         </div>
206     [% END %]
207 [% END %]
208
209             </main>
210         </div> <!-- /.col-sm-10.col-sm-push-2 -->
211
212         <div class="col-sm-2 col-sm-pull-10">
213             <aside>
214                 [% INCLUDE 'vendor-menu.inc' %]
215             </aside>
216         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
217      </div> <!-- /.row -->
218
219 [% MACRO jsinclude BLOCK %]
220     [% Asset.js("js/acquisitions-menu.js") | $raw %]
221     [% INCLUDE 'calendar.inc' %]
222     [% INCLUDE 'datatables.inc' %]
223     <script>
224
225         $(document).ready(function() {
226             var issues_table_url = '/api/v1/acquisitions/vendors/[% vendor.id | uri %]/issues?';
227
228             var issues_table = $("#vendor_issues").kohaTable({
229                 ajax: {
230                     url: issues_table_url
231                 },
232                 embed: ["+strings"],
233                 order: [[ 0, "desc" ]],
234                 columns: [
235                     {
236                         data: "issue_id",
237                         searchable: true,
238                         orderable: true,
239                         render: function(data, type, row, meta) {
240                             return '<a href="/cgi-bin/koha/acqui/vendor_issues.pl?op=show&amp;issue_id=' + encodeURIComponent(row.issue_id) +'">' + escape_str(row.issue_id) + '</a>';
241                         },
242                     },
243                     {
244                         data: "type",
245                         searchable: true,
246                         orderable: true,
247                         render: function(data, type, row, meta) {
248                             return row._strings.type ? escape_str(row._strings.type.str) : "";
249                         }
250                     },
251                     {
252                         data: "started_on",
253                         searchable: true,
254                         orderable: true,
255                         render: function(data, type, row, meta) {
256                             return $date(row.started_on);
257                         }
258                     },
259                     {
260                         data: "ended_on",
261                         searchable: true,
262                         orderable: true,
263                         render: function(data, type, row, meta) {
264                             return $date(row.ended_on);
265                         }
266                     },
267                     {
268                         data: function( row, type, val, meta ) {
269
270                             var result = '<a class="btn btn-default btn-xs" role="button" href="/cgi-bin/koha/acqui/vendor_issues.pl?op=add_form&amp;issue_id='+ encodeURIComponent(row.issue_id) +'"><i class="fa fa-pencil" aria-hidden="true"></i> '+_("Edit")+'</a>'+"\n";
271                             result += '<a class="btn btn-default btn-xs" role="button" href="/cgi-bin/koha/acqui/vendor_issues.pl?op=delete_confirm&amp;issue_id='+ encodeURIComponent(row.issue_id) +'"><i class="fa fa-trash" aria-hidden="true"></i> '+_("Delete")+'</a>';
272                             return result;
273                         },
274                         searchable: false,
275                         orderable: false
276                     }
277                 ]
278             }, null, 1);
279
280         });
281     </script>
282 [% END %]
283 [% INCLUDE 'intranet-bottom.inc' %]