|
Line 0
Link Here
|
|
|
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 %] › [% ELSE %] |
| 14 |
[% IF op == 'delete_confirm' %] |
| 15 |
Confirm deletion of vendor issue › [% END %] |
| 16 |
[% END %] |
| 17 |
Vendor issue › Acquisition › 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?booksellerid=[% vendor.id | uri %]" method="get"> |
| 141 |
<button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button> |
| 142 |
</form> |
| 143 |
</div> |
| 144 |
[% END %] |
| 145 |
|
| 146 |
[% IF op == 'show' %] |
| 147 |
<h1>Vendor issue #[% issue.issue_id | html %]</h1> |
| 148 |
|
| 149 |
<fieldset class="rows"> |
| 150 |
<ol> |
| 151 |
[% IF issue %] |
| 152 |
<li><span class="label">Issue ID: </span>[% issue.issue_id | html %]</li> |
| 153 |
[% END %] |
| 154 |
<li> |
| 155 |
<label for="issue_type">Type: </label> |
| 156 |
[% AuthorisedValues.GetByCode( 'VENDOR_ISSUE_TYPE', issue.type, 0 ) | html %] |
| 157 |
</li> |
| 158 |
<li> |
| 159 |
<label for="started_on">Started on: </label> |
| 160 |
[% issue.started_on | $KohaDates %] |
| 161 |
</li> |
| 162 |
<li> |
| 163 |
<label for="ended_on">Ended on: </label> |
| 164 |
[% issue.ended_on | $KohaDates %] |
| 165 |
</li> |
| 166 |
<li> |
| 167 |
<label for="notes">Notes: </label> |
| 168 |
[% issue.notes | html %] |
| 169 |
</li> |
| 170 |
</ol> |
| 171 |
</fieldset> |
| 172 |
|
| 173 |
<fieldset class="action"> |
| 174 |
<a href="/cgi-bin/koha/acqui/vendor_issues.pl?booksellerid=[% vendor.id | uri %]">Back</a> |
| 175 |
</fieldset> |
| 176 |
</form> |
| 177 |
[% END %] |
| 178 |
[% IF op == 'list' %] |
| 179 |
|
| 180 |
<div id="toolbar" class="btn-toolbar"> |
| 181 |
<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> |
| 182 |
</div> |
| 183 |
|
| 184 |
<h1>Vendor issues</h1> |
| 185 |
|
| 186 |
[% IF issues_count > 0 %] |
| 187 |
<div class="page-section"> |
| 188 |
<div class="table_vendor_issues_table_controls"></div> |
| 189 |
<table id="vendor_issues"> |
| 190 |
<thead> |
| 191 |
<tr> |
| 192 |
<th>Issue ID</th> |
| 193 |
<th>Type</th> |
| 194 |
<th>Started on</th> |
| 195 |
<th>Ended on</th> |
| 196 |
<th data-class-name="actions noExport">Actions</th> |
| 197 |
</tr> |
| 198 |
</thead> |
| 199 |
</table> |
| 200 |
</div><!-- /.page-section --> |
| 201 |
[% ELSE %] |
| 202 |
<div class="dialog message"> |
| 203 |
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>. |
| 204 |
</div> |
| 205 |
[% END %] |
| 206 |
[% END %] |
| 207 |
|
| 208 |
</main> |
| 209 |
</div> <!-- /.col-sm-10.col-sm-push-2 --> |
| 210 |
|
| 211 |
<div class="col-sm-2 col-sm-pull-10"> |
| 212 |
<aside> |
| 213 |
[% INCLUDE 'vendor-menu.inc' %] |
| 214 |
</aside> |
| 215 |
</div> <!-- /.col-sm-2.col-sm-pull-10 --> |
| 216 |
</div> <!-- /.row --> |
| 217 |
|
| 218 |
[% MACRO jsinclude BLOCK %] |
| 219 |
[% Asset.js("js/acquisitions-menu.js") | $raw %] |
| 220 |
[% INCLUDE 'calendar.inc' %] |
| 221 |
[% INCLUDE 'datatables.inc' %] |
| 222 |
<script> |
| 223 |
|
| 224 |
$(document).ready(function() { |
| 225 |
var issues_table_url = '/api/v1/acquisitions/vendors/[% vendor.id | uri %]/issues?'; |
| 226 |
|
| 227 |
var issues_table = $("#vendor_issues").kohaTable({ |
| 228 |
ajax: { |
| 229 |
url: issues_table_url |
| 230 |
}, |
| 231 |
embed: ["+strings"], |
| 232 |
order: [[ 0, "desc" ]], |
| 233 |
columns: [ |
| 234 |
{ |
| 235 |
data: "issue_id", |
| 236 |
searchable: true, |
| 237 |
orderable: true, |
| 238 |
render: function(data, type, row, meta) { |
| 239 |
return '<a href="/cgi-bin/koha/acqui/vendor_issues.pl?op=show&issue_id=' + encodeURIComponent(row.issue_id) +'">' + escape_str(row.issue_id) + '</a>'; |
| 240 |
}, |
| 241 |
}, |
| 242 |
{ |
| 243 |
data: "type", |
| 244 |
searchable: true, |
| 245 |
orderable: true, |
| 246 |
render: function(data, type, row, meta) { |
| 247 |
return row._strings.type ? escape_str(row._strings.type.str) : ""; |
| 248 |
} |
| 249 |
}, |
| 250 |
{ |
| 251 |
data: "started_on", |
| 252 |
searchable: true, |
| 253 |
orderable: true, |
| 254 |
render: function(data, type, row, meta) { |
| 255 |
return $date(row.started_on); |
| 256 |
} |
| 257 |
}, |
| 258 |
{ |
| 259 |
data: "ended_on", |
| 260 |
searchable: true, |
| 261 |
orderable: true, |
| 262 |
render: function(data, type, row, meta) { |
| 263 |
return $date(row.ended_on); |
| 264 |
} |
| 265 |
}, |
| 266 |
{ |
| 267 |
data: function( row, type, val, meta ) { |
| 268 |
|
| 269 |
var result = '<a class="btn btn-default btn-xs" role="button" href="/cgi-bin/koha/acqui/vendor_issues.pl?op=add_form&issue_id='+ encodeURIComponent(row.issue_id) +'"><i class="fa fa-pencil" aria-hidden="true"></i> '+_("Edit")+'</a>'+"\n"; |
| 270 |
result += '<a class="btn btn-default btn-xs" role="button" href="/cgi-bin/koha/acqui/vendor_issues.pl?op=delete_confirm&issue_id='+ encodeURIComponent(row.issue_id) +'"><i class="fa fa-trash" aria-hidden="true"></i> '+_("Delete")+'</a>'; |
| 271 |
return result; |
| 272 |
}, |
| 273 |
searchable: false, |
| 274 |
orderable: false |
| 275 |
} |
| 276 |
] |
| 277 |
}, null, 1); |
| 278 |
|
| 279 |
}); |
| 280 |
</script> |
| 281 |
[% END %] |
| 282 |
[% INCLUDE 'intranet-bottom.inc' %] |