Lines 26-31
export default {
Link Here
|
26 |
const AVStore = inject("AVStore") |
26 |
const AVStore = inject("AVStore") |
27 |
const { get_lib_from_av, map_av_dt_filter } = AVStore |
27 |
const { get_lib_from_av, map_av_dt_filter } = AVStore |
28 |
|
28 |
|
|
|
29 |
const { setConfirmationDialog, setMessage } = inject("mainStore") |
30 |
|
29 |
const table_id = "license_list" |
31 |
const table_id = "license_list" |
30 |
useDataTable(table_id) |
32 |
useDataTable(table_id) |
31 |
|
33 |
|
Lines 34-39
export default {
Link Here
|
34 |
get_lib_from_av, |
36 |
get_lib_from_av, |
35 |
map_av_dt_filter, |
37 |
map_av_dt_filter, |
36 |
table_id, |
38 |
table_id, |
|
|
39 |
setConfirmationDialog, |
40 |
setMessage, |
37 |
} |
41 |
} |
38 |
}, |
42 |
}, |
39 |
data: function () { |
43 |
data: function () { |
Lines 64-71
export default {
Link Here
|
64 |
edit_license: function (license_id) { |
68 |
edit_license: function (license_id) { |
65 |
this.$router.push("/cgi-bin/koha/erm/licenses/edit/" + license_id) |
69 |
this.$router.push("/cgi-bin/koha/erm/licenses/edit/" + license_id) |
66 |
}, |
70 |
}, |
67 |
delete_license: function (license_id) { |
71 |
delete_license: function (license_id, license_name) { |
68 |
this.$router.push("/cgi-bin/koha/erm/licenses/delete/" + license_id) |
72 |
this.setConfirmationDialog( |
|
|
73 |
{ |
74 |
title: this.$__( |
75 |
"Are you sure you want to remove this license?" |
76 |
), |
77 |
message: license_name, |
78 |
accept_label: this.$__("Yes, delete"), |
79 |
cancel_label: this.$__("No, do not delete"), |
80 |
}, |
81 |
() => { |
82 |
const client = APIClient.erm |
83 |
client.licenses.delete(license_id).then( |
84 |
success => { |
85 |
this.setMessage( |
86 |
this.$__("License %s deleted").format( |
87 |
license_name |
88 |
) |
89 |
) |
90 |
$("#" + this.table_id) |
91 |
.DataTable() |
92 |
.ajax.url("/api/v1/erm/licenses") |
93 |
.draw() |
94 |
}, |
95 |
error => {} |
96 |
) |
97 |
} |
98 |
) |
69 |
}, |
99 |
}, |
70 |
build_datatable: function () { |
100 |
build_datatable: function () { |
71 |
let show_license = this.show_license |
101 |
let show_license = this.show_license |
Lines 203-208
export default {
Link Here
|
203 |
function (index, e) { |
233 |
function (index, e) { |
204 |
let tr = $(this).parent().parent() |
234 |
let tr = $(this).parent().parent() |
205 |
let license_id = api.row(tr).data().license_id |
235 |
let license_id = api.row(tr).data().license_id |
|
|
236 |
let license_name = api.row(tr).data().name |
206 |
let editButton = createVNode( |
237 |
let editButton = createVNode( |
207 |
"a", |
238 |
"a", |
208 |
{ |
239 |
{ |
Lines 227-233
export default {
Link Here
|
227 |
class: "btn btn-default btn-xs", |
258 |
class: "btn btn-default btn-xs", |
228 |
role: "button", |
259 |
role: "button", |
229 |
onClick: () => { |
260 |
onClick: () => { |
230 |
delete_license(license_id) |
261 |
delete_license( |
|
|
262 |
license_id, |
263 |
license_name |
264 |
) |
231 |
}, |
265 |
}, |
232 |
}, |
266 |
}, |
233 |
[ |
267 |
[ |