|
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 |
this.$__("Are you sure you want to remove this license?"), |
| 74 |
license_name, |
| 75 |
() => { |
| 76 |
const client = APIClient.erm |
| 77 |
client.licenses.delete(license_id).then( |
| 78 |
success => { |
| 79 |
this.setMessage(this.$__("License deleted")) |
| 80 |
$("#" + this.table_id) |
| 81 |
.DataTable() |
| 82 |
.ajax.url("/api/v1/erm/licenses") |
| 83 |
.draw() |
| 84 |
}, |
| 85 |
error => {} |
| 86 |
) |
| 87 |
} |
| 88 |
) |
| 69 |
}, |
89 |
}, |
| 70 |
build_datatable: function () { |
90 |
build_datatable: function () { |
| 71 |
let show_license = this.show_license |
91 |
let show_license = this.show_license |
|
Lines 227-233
export default {
Link Here
|
| 227 |
class: "btn btn-default btn-xs", |
247 |
class: "btn btn-default btn-xs", |
| 228 |
role: "button", |
248 |
role: "button", |
| 229 |
onClick: () => { |
249 |
onClick: () => { |
| 230 |
delete_license(license_id) |
250 |
delete_license( |
|
|
251 |
license_id, |
| 252 |
api.row(tr).data().name |
| 253 |
) |
| 231 |
}, |
254 |
}, |
| 232 |
}, |
255 |
}, |
| 233 |
[ |
256 |
[ |
| 234 |
- |
|
|